From 03c5b8232e0dfb1bdda86350c73759b70f3768d8 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Wed, 4 Jul 2018 09:23:53 +0100 Subject: [PATCH] Update github.com/Azure/azure-sdk-for-go #2118 This pulls in https://github.com/Azure/azure-sdk-for-go/issues/2119 which fixes the SAS URL support. --- Gopkg.lock | 8 +- .../Azure/azure-sdk-for-go/.travis.yml | 3 + .../Azure/azure-sdk-for-go/CHANGELOG.md | 191 +- .../Azure/azure-sdk-for-go/Gopkg.lock | 40 +- .../Azure/azure-sdk-for-go/Gopkg.toml | 2 +- .../Azure/azure-sdk-for-go/README.md | 225 +- .../latest/advisor/mgmt/advisor/models.go | 1 - .../appinsights/mgmt/insights/models.go | 34 +- .../automation/mgmt/automation/models.go | 15 +- .../computervision/models.go | 14 +- .../latest/cognitiveservices/face/models.go | 4 + .../cognitiveservices/luis/runtime/models.go | 4 + .../cognitiveservices/textanalytics/models.go | 4 + .../mgmt/notificationhubs/models.go | 3 + .../mgmt/operationalinsights/models.go | 2 - .../recoveryservices/mgmt/backup/models.go | 109 +- .../mgmt/adhybridhealthservice/models.go | 44 + .../preview/advisor/mgmt/advisor/models.go | 1 - .../appinsights/mgmt/insights/models.go | 34 +- .../preview/batchai/mgmt/batchai/models.go | 3 +- .../cognitiveservices/autosuggest/models.go | 176 + .../computervision/models.go | 26 +- .../preview/cognitiveservices/face/models.go | 4 + .../luis/authoring/models.go | 4 + .../cognitiveservices/luis/runtime/models.go | 4 + .../cognitiveservices/textanalytics/models.go | 4 + .../consumption/mgmt/consumption/models.go | 23 + .../mgmt/containerservice/models.go | 35 +- .../datafactory/mgmt/datafactory/models.go | 177 +- .../preview/keyvault/mgmt/keyvault/models.go | 28 +- .../preview/network/mgmt/network/models.go | 5 +- .../mgmt/notificationhubs/models.go | 3 + .../mgmt/apimanagement/models.go | 38 +- .../automation/mgmt/automation/models.go | 915 + .../devspaces/mgmt/devspaces/models.go | 111 + .../preview/eventhub/mgmt/eventhub/models.go | 55 + .../hdinsight/mgmt/hdinsight/models.go | 54 +- .../iotcentral/mgmt/iotcentral/models.go | 17 +- .../preview/keyvault/keyvault/models.go | 32 +- .../mediaservices/mgmt/media/models.go | 3 +- .../preview/monitor/mgmt/insights/models.go | 3 + .../mgmt/operationsmanagement/models.go | 2 + .../preview/signalr/mgmt/signalr/models.go | 7 +- .../preview/preview/sql/mgmt/sql/models.go | 21 + .../recoveryservices/mgmt/backup/models.go | 109 +- .../reservations/mgmt/reservations/models.go | 225 +- .../datalake/storagedatalake/models.go | 120 + .../adhybridhealthservice/addsservice.go | 121 + .../addsservicemembers.go | 211 + .../adhybridhealthservice/addsservices.go | 138 +- .../addsservicesreplicationstatus.go | 106 + .../addsservicesservicemembers.go | 213 + .../addsservicesuserpreference.go | 239 + .../adhybridhealthservice/models.go | 20 + .../adhybridhealthservice/reports.go | 98 + .../adhybridhealthservice/service.go | 121 + .../adhybridhealthservice/servicemembers.go | 164 +- .../advisor/mgmt/2017-04-19/advisor/models.go | 24 - .../2017-04-19/advisor/recommendations.go | 26 +- .../{analyticsitem.go => analyticsitems.go} | 72 +- .../mgmt/2015-05-01/insights/annotations.go | 6 +- .../mgmt/2015-05-01/insights/components.go | 97 +- .../mgmt/2015-05-01/insights/favorite.go | 322 - .../mgmt/2015-05-01/insights/favorites.go | 282 + .../mgmt/2015-05-01/insights/models.go | 185 +- .../mgmt/2015-05-01/insights/workbook.go | 326 - .../mgmt/2015-05-01/insights/workbooks.go | 290 +- .../insights/workitemconfigurations.go | 6 +- .../appinsights/v1/insights/client.go | 681 +- .../appinsights/v1/insights/events.go | 280 + .../appinsights/v1/insights/metrics.go | 283 + .../appinsights/v1/insights/models.go | 91 +- .../services/appinsights/v1/insights/query.go | 112 + .../mgmt/2015-10-31/automation/account.go | 48 +- .../mgmt/2015-10-31/automation/activity.go | 23 +- .../agentregistrationinformation.go | 20 +- .../mgmt/2015-10-31/automation/certificate.go | 57 +- .../mgmt/2015-10-31/automation/connection.go | 57 +- .../2015-10-31/automation/connectiontype.go | 44 +- .../mgmt/2015-10-31/automation/credential.go | 57 +- .../automation/dsccompilationjob.go | 47 +- .../automation/dsccompilationjobstream.go | 11 +- .../2015-10-31/automation/dscconfiguration.go | 94 +- .../mgmt/2015-10-31/automation/dscnode.go | 45 +- .../automation/dscnodeconfiguration.go | 46 +- .../mgmt/2015-10-31/automation/fields.go | 12 +- .../automation/hybridrunbookworkergroup.go | 58 +- .../mgmt/2015-10-31/automation/job.go | 89 +- .../mgmt/2015-10-31/automation/jobschedule.go | 58 +- .../mgmt/2015-10-31/automation/jobstream.go | 24 +- .../mgmt/2015-10-31/automation/keys.go | 9 +- .../2015-10-31/automation/linkedworkspace.go | 9 +- .../mgmt/2015-10-31/automation/models.go | 761 +- .../mgmt/2015-10-31/automation/module.go | 55 +- .../mgmt/2015-10-31/automation/nodereports.go | 36 +- .../2015-10-31/automation/objectdatatypes.go | 23 +- .../mgmt/2015-10-31/automation/runbook.go | 68 +- .../2015-10-31/automation/runbookdraft.go | 89 +- .../mgmt/2015-10-31/automation/schedule.go | 57 +- .../mgmt/2015-10-31/automation/statistics.go | 11 +- .../mgmt/2015-10-31/automation/testjob.go | 57 +- .../2015-10-31/automation/testjobstreams.go | 24 +- .../mgmt/2015-10-31/automation/usages.go | 9 +- .../mgmt/2015-10-31/automation/variable.go | 55 +- .../mgmt/2015-10-31/automation/webhook.go | 66 +- .../batch/2017-05-01.5.0/batch/account.go | 2 +- .../batch/2017-05-01.5.0/batch/application.go | 2 +- .../batch/2017-05-01.5.0/batch/certificate.go | 2 +- .../batch/2017-05-01.5.0/batch/computenode.go | 2 +- .../batch/2017-05-01.5.0/batch/file.go | 4 +- .../batch/2017-05-01.5.0/batch/job.go | 6 +- .../batch/2017-05-01.5.0/batch/jobschedule.go | 2 +- .../batch/2017-05-01.5.0/batch/pool.go | 4 +- .../batch/2017-05-01.5.0/batch/task.go | 2 +- .../batch/2018-03-01.6.1/batch/account.go | 4 +- .../batch/2018-03-01.6.1/batch/application.go | 2 +- .../batch/2018-03-01.6.1/batch/certificate.go | 2 +- .../batch/2018-03-01.6.1/batch/computenode.go | 2 +- .../batch/2018-03-01.6.1/batch/file.go | 4 +- .../batch/2018-03-01.6.1/batch/job.go | 6 +- .../batch/2018-03-01.6.1/batch/jobschedule.go | 2 +- .../batch/2018-03-01.6.1/batch/pool.go | 4 +- .../batch/2018-03-01.6.1/batch/task.go | 2 +- .../mgmt/2018-03-01/batchai/clusters.go | 4 +- .../mgmt/2018-03-01/batchai/fileservers.go | 4 +- .../batchai/mgmt/2018-03-01/batchai/jobs.go | 8 +- .../mgmt/2018-05-01/batchai/clusters.go | 291 +- .../mgmt/2018-05-01/batchai/experiments.go | 2 +- .../mgmt/2018-05-01/batchai/fileservers.go | 245 +- .../batchai/mgmt/2018-05-01/batchai/jobs.go | 6 +- .../batchai/mgmt/2018-05-01/batchai/models.go | 753 +- .../mgmt/2018-05-01/batchai/workspaces.go | 85 +- .../v1.0/autosuggest/client.go | 264 + .../v1.0/autosuggest/models.go | 4080 + .../v1.0/autosuggest/version.go | 30 + .../v1.0/computervision/client.go | 77 +- .../v1.0/computervision/models.go | 110 +- .../cognitiveservices/v1.0/face/face.go | 4 +- .../cognitiveservices/v1.0/face/models.go | 10 +- .../v1.0/face/persongroup.go | 2 +- .../v1.0/face/persongroupperson.go | 2 +- .../v2.0/computervision/client.go | 1330 + .../v2.0/computervision/models.go | 594 + .../v2.0/computervision/version.go | 30 + .../v2.0/luis/authoring/apps.go | 2 +- .../v2.0/luis/authoring/examples.go | 2 +- .../v2.0/luis/authoring/features.go | 4 +- .../v2.0/luis/authoring/model.go | 24 +- .../v2.0/luis/authoring/models.go | 10 +- .../v2.0/luis/authoring/pattern.go | 4 +- .../v2.0/luis/authoring/versions.go | 2 +- .../v2.0/luis/runtime/models.go | 10 +- .../v2.0/textanalytics/models.go | 10 +- .../compute/virtualmachinescalesets.go | 6 +- .../compute/virtualmachinescalesets.go | 6 +- .../2017-11-30/consumption/usagedetails.go | 2 +- .../2018-01-31/consumption/marketplaces.go | 4 +- .../mgmt/2018-01-31/consumption/pricesheet.go | 4 +- .../2018-01-31/consumption/usagedetails.go | 4 +- .../2018-03-31/consumption/marketplaces.go | 4 +- .../marketplacesbybillingaccount.go | 4 +- .../consumption/marketplacesbydepartment.go | 4 +- .../marketplacesbyenrollmentaccounts.go | 4 +- .../mgmt/2018-03-31/consumption/pricesheet.go | 4 +- .../2018-03-31/consumption/usagedetails.go | 4 +- .../usagedetailsbybillingaccount.go | 4 +- .../consumption/usagedetailsbydepartment.go | 4 +- .../usagedetailsbyenrollmentaccount.go | 4 +- .../mgmt/2018-05-31/consumption/models.go | 405 +- .../mgmt/2018-05-31/consumption/pricesheet.go | 220 + .../2018-05-31/consumption/usagedetails.go | 1076 + .../2017-07-01/containerservice/models.go | 4 +- .../2017-08-31/containerservice/models.go | 4 +- .../2017-09-30/containerservice/models.go | 4 +- .../2018-03-31/containerservice/client.go | 51 + .../containerservice/containerservices.go | 548 + .../containerservice/managedclusters.go | 611 + .../2018-03-31/containerservice/models.go | 1726 + .../2018-03-31/containerservice/operations.go | 98 + .../2018-03-31/containerservice/version.go | 30 + .../2015-04-08/documentdb/databaseaccounts.go | 84 +- .../mgmt/2017-01-01/customerinsights/hubs.go | 4 +- .../mgmt/2017-04-26/customerinsights/hubs.go | 4 +- .../2018-06-01/datafactory/activityruns.go | 129 + .../mgmt/2018-06-01/datafactory/client.go | 52 + .../mgmt/2018-06-01/datafactory/datasets.go | 425 + .../mgmt/2018-06-01/datafactory/factories.go | 656 + .../datafactory/integrationruntimenodes.go | 317 + .../datafactory/integrationruntimes.go | 1286 + .../2018-06-01/datafactory/linkedservices.go | 425 + .../mgmt/2018-06-01/datafactory/models.go | 93925 ++++++++++++++++ .../mgmt/2018-06-01/datafactory/operations.go | 127 + .../2018-06-01/datafactory/pipelineruns.go | 288 + .../mgmt/2018-06-01/datafactory/pipelines.go | 520 + .../2018-06-01/datafactory/triggerruns.go | 127 + .../mgmt/2018-06-01/datafactory/triggers.go | 596 + .../mgmt/2018-06-01/datafactory/version.go | 30 + .../mgmt/2016-11-01/account/accounts.go | 2 +- .../dns/mgmt/2016-04-01/dns/recordsets.go | 61 +- .../services/dns/mgmt/2016-04-01/dns/zones.go | 41 +- .../dns/mgmt/2017-09-01/dns/recordsets.go | 61 +- .../services/dns/mgmt/2017-09-01/dns/zones.go | 41 +- .../dns/mgmt/2017-10-01/dns/recordsets.go | 71 +- .../services/dns/mgmt/2017-10-01/dns/zones.go | 51 +- .../2017-04-01/eventhub/consumergroups.go | 4 +- .../mgmt/2017-04-01/eventhub/eventhubs.go | 8 +- .../mgmt/2017-04-01/eventhub/models.go | 2 + .../mgmt/2017-04-01/eventhub/namespaces.go | 4 +- .../mgmt/2016-02-03/devices/iothubresource.go | 4 +- .../mgmt/2017-01-19/devices/iothubresource.go | 4 +- .../mgmt/2017-07-01/devices/iothubresource.go | 4 +- .../mgmt/2018-01-22/devices/iothubresource.go | 4 +- .../mgmt/2018-04-01/devices/iothubresource.go | 4 +- .../keyvault/2015-06-01/keyvault/client.go | 14 +- .../keyvault/2015-06-01/keyvault/models.go | 45 +- .../keyvault/2016-10-01/keyvault/client.go | 24 +- .../keyvault/2016-10-01/keyvault/models.go | 53 +- .../mgmt/2018-02-14/keyvault/client.go | 51 + .../mgmt/2018-02-14/keyvault/models.go | 1162 + .../mgmt/2018-02-14/keyvault/operations.go | 127 + .../mgmt/2018-02-14/keyvault/vaults.go | 1008 + .../mgmt/2018-02-14/keyvault/version.go | 30 + .../services/keyvault/v7.0/keyvault/client.go | 6420 ++ .../services/keyvault/v7.0/keyvault/models.go | 3128 + .../keyvault/v7.0/keyvault/version.go | 30 + .../logic/mgmt/2016-06-01/logic/agreements.go | 2 +- .../logic/mgmt/2016-06-01/logic/maps.go | 2 +- .../logic/mgmt/2016-06-01/logic/partners.go | 2 +- .../logic/mgmt/2016-06-01/logic/schemas.go | 2 +- .../logic/mgmt/2016-06-01/logic/sessions.go | 2 +- .../2016-06-01/logic/workflowrunactions.go | 2 +- .../mgmt/2016-06-01/logic/workflowruns.go | 3 +- .../logic/mgmt/2016-06-01/logic/workflows.go | 6 +- .../logic/workflowtriggerhistories.go | 3 +- .../2017-01-01/webservices/webservices.go | 2 +- .../virtualnetworkgatewayconnections.go | 2 +- .../virtualnetworkgatewayconnections.go | 2 +- .../virtualnetworkgatewayconnections.go | 2 +- .../virtualnetworkgatewayconnections.go | 2 +- .../virtualnetworkgatewayconnections.go | 2 +- .../virtualnetworkgatewayconnections.go | 2 +- .../network/expressroutecircuitpeerings.go | 2 +- .../virtualnetworkgatewayconnections.go | 2 +- .../network/expressroutecircuitpeerings.go | 2 +- .../virtualnetworkgatewayconnections.go | 2 +- .../2018-01-01/network/applicationgateways.go | 2 +- .../network/expressroutecircuitpeerings.go | 5 +- .../virtualnetworkgatewayconnections.go | 2 +- .../2018-02-01/network/applicationgateways.go | 2 +- .../network/expressroutecircuitpeerings.go | 2 +- .../expressroutecrossconnectionpeerings.go | 2 +- .../network/mgmt/2018-02-01/network/models.go | 6 +- .../virtualnetworkgatewayconnections.go | 2 +- .../2018-04-01/network/applicationgateways.go | 8 +- .../mgmt/2018-04-01/network/azurefirewalls.go | 434 + .../network/expressroutecircuitpeerings.go | 4 +- .../expressroutecrossconnectionpeerings.go | 2 +- .../network/hubvirtualnetworkconnections.go | 205 + .../network/mgmt/2018-04-01/network/models.go | 2696 +- .../mgmt/2018-04-01/network/virtualhubs.go | 508 + .../virtualnetworkgatewayconnections.go | 4 +- .../mgmt/2018-04-01/network/virtualwans.go | 508 + .../mgmt/2018-04-01/network/vpnconnections.go | 351 + .../mgmt/2018-04-01/network/vpngateways.go | 508 + .../mgmt/2018-04-01/network/vpnsites.go | 508 + .../network/vpnsitesconfiguration.go | 113 + .../2018-05-01/network/applicationgateways.go | 2 +- .../network/expressroutecircuitpeerings.go | 2 +- .../expressroutecrossconnectionpeerings.go | 2 +- .../network/mgmt/2018-05-01/network/models.go | 6 +- .../virtualnetworkgatewayconnections.go | 2 +- .../2017-04-01/notificationhubs/models.go | 257 + .../2017-04-01/notificationhubs/namespaces.go | 3 +- .../notificationhubs/notificationhubs.go | 153 +- .../2015-03-20/operationalinsights/models.go | 40 +- .../operationalinsights/savedsearches.go | 2 +- .../operationalinsights/workspaces.go | 104 +- .../v1/operationalinsights/client.go | 29 +- .../mgmt/2018-01-01/apimanagement/models.go | 2 +- .../2018-01-01/apimanagement/productapi.go | 21 +- .../2018-06-01-preview/apimanagement/api.go | 732 + .../apimanagement/apidiagnostic.go | 657 + .../apimanagement/apiexport.go | 128 + .../apimanagement/apiissue.go | 536 + .../apimanagement/apiissueattachment.go | 565 + .../apimanagement/apiissuecomment.go | 564 + .../apimanagement/apioperation.go | 645 + .../apimanagement/apioperationpolicy.go | 502 + .../apimanagement/apipolicy.go | 467 + .../apimanagement/apiproduct.go | 170 + .../apimanagement/apirelease.go | 617 + .../apimanagement/apirevisions.go | 171 + .../apimanagement/apischema.go | 515 + .../apimanagement/apiversionset.go | 596 + .../apimanagement/authorizationserver.go | 595 + .../apimanagement/backend.go | 678 + .../apimanagement/certificate.go | 509 + .../apimanagement/client.go | 51 + .../apimanagement/delegationsettings.go | 348 + .../apimanagement/diagnostic.go | 621 + .../apimanagement/emailtemplate.go | 563 + .../2018-06-01-preview/apimanagement/group.go | 593 + .../apimanagement/groupuser.go | 435 + .../apimanagement/identityprovider.go | 550 + .../apimanagement/logger.go | 585 + .../apimanagement/models.go | 10198 ++ .../apimanagement/networkstatus.go | 198 + .../apimanagement/notification.go | 317 + .../notificationrecipientemail.go | 353 + .../notificationrecipientuser.go | 365 + .../apimanagement/openidconnectprovider.go | 586 + .../apimanagement/operation.go | 176 + .../apimanagement/operations.go | 126 + .../apimanagement/policy.go | 431 + .../apimanagement/policysnippets.go | 120 + .../apimanagement/product.go | 603 + .../apimanagement/productapi.go | 436 + .../apimanagement/productgroup.go | 432 + .../apimanagement/productpolicy.go | 462 + .../apimanagement/productsubscriptions.go | 175 + .../apimanagement/property.go | 591 + .../apimanagement/quotabycounterkeys.go | 205 + .../apimanagement/quotabyperiodkeys.go | 208 + .../apimanagement/regions.go | 144 + .../apimanagement/reports.go | 975 + .../apimanagement/service.go | 1126 + .../apimanagement/signinsettings.go | 348 + .../apimanagement/signupsettings.go | 348 + .../apimanagement/subscription.go | 777 + .../2018-06-01-preview/apimanagement/tag.go | 2086 + .../apimanagement/tagdescription.go | 539 + .../apimanagement/tagresource.go | 176 + .../apimanagement/tenantaccess.go | 348 + .../apimanagement/tenantaccessgit.go | 267 + .../apimanagement/tenantconfiguration.go | 376 + .../2018-06-01-preview/apimanagement/user.go | 780 + .../apimanagement/usergroup.go | 172 + .../apimanagement/useridentities.go | 150 + .../apimanagement/usersubscription.go | 175 + .../apimanagement/version.go | 30 + .../2017-05-15-preview/automation/account.go | 537 + .../2017-05-15-preview/automation/activity.go | 225 + .../agentregistrationinformation.go | 195 + .../automation/certificate.go | 461 + .../2017-05-15-preview/automation/client.go | 51 + .../automation/connection.go | 462 + .../automation/connectiontype.go | 381 + .../automation/credential.go | 463 + .../automation/dsccompilationjob.go | 388 + .../automation/dsccompilationjobstream.go | 119 + .../automation/dscconfiguration.go | 562 + .../2017-05-15-preview/automation/dscnode.go | 382 + .../automation/dscnodeconfiguration.go | 390 + .../2017-05-15-preview/automation/fields.go | 120 + .../automation/hybridrunbookworkergroup.go | 381 + .../mgmt/2017-05-15-preview/automation/job.go | 729 + .../automation/jobschedule.go | 387 + .../automation/jobstream.go | 239 + .../2017-05-15-preview/automation/keys.go | 116 + .../automation/linkedworkspace.go | 116 + .../2017-05-15-preview/automation/models.go | 8915 ++ .../2017-05-15-preview/automation/module.go | 466 + .../automation/nodereports.go | 308 + .../automation/objectdatatypes.go | 197 + .../automation/operations.go | 98 + .../2017-05-15-preview/automation/runbook.go | 552 + .../automation/runbookdraft.go | 436 + .../2017-05-15-preview/automation/schedule.go | 461 + .../softwareupdateconfigurationmachineruns.go | 219 + .../softwareupdateconfigurationruns.go | 218 + .../softwareupdateconfigurations.go | 379 + .../automation/sourcecontrol.go | 474 + .../automation/sourcecontrolsyncjob.go | 314 + .../automation/sourcecontrolsyncjobstreams.go | 234 + .../automation/statistics.go | 120 + .../2017-05-15-preview/automation/testjob.go | 426 + .../automation/testjobstreams.go | 229 + .../2017-05-15-preview/automation/usages.go | 116 + .../2017-05-15-preview/automation/variable.go | 460 + .../2017-05-15-preview/automation/version.go | 30 + .../2017-05-15-preview/automation/webhook.go | 539 + .../2018-01-preview/automation/account.go | 537 + .../2018-01-preview/automation/activity.go | 225 + .../agentregistrationinformation.go | 195 + .../2018-01-preview/automation/certificate.go | 461 + .../mgmt/2018-01-preview/automation/client.go | 53 + .../2018-01-preview/automation/connection.go | 462 + .../automation/connectiontype.go | 381 + .../2018-01-preview/automation/credential.go | 463 + .../automation/dsccompilationjob.go | 392 + .../automation/dsccompilationjobstream.go | 119 + .../automation/dscconfiguration.go | 562 + .../2018-01-preview/automation/dscnode.go | 394 + .../automation/dscnodeconfiguration.go | 407 + .../mgmt/2018-01-preview/automation/fields.go | 120 + .../automation/hybridrunbookworkergroup.go | 381 + .../mgmt/2018-01-preview/automation/job.go | 729 + .../2018-01-preview/automation/jobschedule.go | 387 + .../2018-01-preview/automation/jobstream.go | 239 + .../mgmt/2018-01-preview/automation/keys.go | 116 + .../automation/linkedworkspace.go | 116 + .../mgmt/2018-01-preview/automation/models.go | 9733 ++ .../mgmt/2018-01-preview/automation/module.go | 466 + .../automation/nodecountinformation.go | 117 + .../2018-01-preview/automation/nodereports.go | 308 + .../automation/objectdatatypes.go | 197 + .../2018-01-preview/automation/operations.go | 98 + .../2018-01-preview/automation/runbook.go | 552 + .../automation/runbookdraft.go | 436 + .../2018-01-preview/automation/schedule.go | 461 + .../softwareupdateconfigurationmachineruns.go | 219 + .../softwareupdateconfigurationruns.go | 218 + .../softwareupdateconfigurations.go | 379 + .../automation/sourcecontrol.go | 474 + .../automation/sourcecontrolsyncjob.go | 314 + .../automation/sourcecontrolsyncjobstreams.go | 234 + .../2018-01-preview/automation/statistics.go | 120 + .../2018-01-preview/automation/testjob.go | 426 + .../automation/testjobstreams.go | 229 + .../mgmt/2018-01-preview/automation/usages.go | 116 + .../2018-01-preview/automation/variable.go | 460 + .../2018-01-preview/automation/version.go | 30 + .../2018-01-preview/automation/watcher.go | 613 + .../2018-01-preview/automation/webhook.go | 539 + .../mgmt/2017-09-preview/batchai/clusters.go | 4 +- .../2017-09-preview/batchai/fileservers.go | 4 +- .../mgmt/2017-09-preview/batchai/jobs.go | 8 +- .../2017-02-27-preview/billing/invoices.go | 2 +- .../2017-04-24-preview/billing/invoices.go | 2 +- .../2017-04-24-preview/billing/periods.go | 2 +- .../2018-03-01-preview/billing/invoices.go | 2 +- .../2018-03-01-preview/billing/periods.go | 2 +- .../consumption/usagedetails.go | 2 +- .../containerregistry/buildtasks.go | 2 +- .../2018-02-01/containerregistry/models.go | 4 +- .../2018-06-01-preview/devspaces/client.go | 51 + .../devspaces/controllers.go | 643 + .../2018-06-01-preview/devspaces/models.go | 750 + .../devspaces/operations.go | 126 + .../2018-06-01-preview/devspaces/version.go | 30 + .../mgmt/2015-05-04-preview/dns/recordsets.go | 51 +- .../dns/mgmt/2015-05-04-preview/dns/zones.go | 41 +- .../mgmt/2018-03-01-preview/dns/recordsets.go | 71 +- .../dns/mgmt/2018-03-01-preview/dns/zones.go | 51 +- .../2018-01-01-preview/eventhub/client.go | 2 +- .../2018-01-01-preview/eventhub/clusters.go | 3 +- .../eventhub/configuration.go | 3 +- .../2018-01-01-preview/eventhub/models.go | 739 + .../2018-01-01-preview/eventhub/namespaces.go | 1268 + .../2018-01-01-preview/eventhub/operations.go | 3 +- .../hdinsight/applications.go | 48 +- .../hdinsight/configurations.go | 20 +- .../2015-03-01-preview/hdinsight/extension.go | 27 +- .../2015-03-01-preview/hdinsight/locations.go | 170 + .../2015-03-01-preview/hdinsight/models.go | 152 +- .../hdinsight/scriptexecutionhistory.go | 6 +- .../hdinsight/applications.go | 352 + .../2018-06-01-preview/hdinsight/client.go | 51 + .../2018-06-01-preview/hdinsight/clusters.go | 658 + .../hdinsight/configurations.go | 191 + .../hdinsight/extensions.go | 466 + .../hdinsight/locations.go} | 48 +- .../2018-06-01-preview/hdinsight/models.go | 1555 + .../hdinsight/operations.go | 126 + .../hdinsight/scriptactions.go | 272 + .../hdinsight/scriptexecutionhistory.go | 203 + .../2018-06-01-preview/hdinsight/version.go | 30 + .../iotcentral/apps.go | 48 +- .../iotcentral/client.go | 7 +- .../iotcentral/operations.go | 5 +- .../preview/keyvault/v7.0/keyvault/client.go | 202 +- .../preview/keyvault/v7.0/keyvault/models.go | 86 +- .../webservices/webservices.go | 2 +- .../compute/operationalizationclusters.go | 4 +- .../mgmt/2018-06-01-preview/media/assets.go | 572 + .../mgmt/2018-06-01-preview/media/client.go | 51 + .../media/contentkeypolicies.go | 506 + .../mgmt/2018-06-01-preview/media/jobs.go | 446 + .../2018-06-01-preview/media/liveevents.go | 711 + .../2018-06-01-preview/media/liveoutputs.go | 410 + .../2018-06-01-preview/media/locations.go | 107 + .../2018-06-01-preview/media/mediaservices.go | 630 + .../mgmt/2018-06-01-preview/media/models.go | 9643 ++ .../2018-06-01-preview/media/operations.go | 126 + .../media/streamingendpoints.go | 708 + .../media/streaminglocators.go | 505 + .../media/streamingpolicies.go | 401 + .../2018-06-01-preview/media/transforms.go | 438 + .../mgmt/2018-06-01-preview/media/version.go | 30 + .../2017-05-01-preview/insights/alertrules.go | 62 + .../insights/autoscalesettings.go | 90 + .../2017-05-01-preview/insights/models.go | 8 +- .../mgmt/2018-03-01/insights/alertrules.go | 62 + .../2018-03-01/insights/autoscalesettings.go | 90 + .../mgmt/2018-03-01/insights/models.go | 102 +- .../insights/scheduledqueryrules.go | 70 + .../operationalinsights/workspaces.go | 2 +- .../servicemap/clientgroups.go | 2 +- .../2015-11-01-preview/servicemap/machines.go | 2 +- .../operationsmanagement/models.go | 53 + .../operationsmanagement/solutions.go | 54 +- .../mgmt/2018-03-01-preview/signalr/models.go | 6 +- .../sql/databaseblobauditingpolicies.go | 4 +- .../sql/mgmt/2015-05-01-preview/sql/models.go | 60 +- .../sql/databaseblobauditingpolicies.go | 8 +- .../extendeddatabaseblobauditingpolicies.go | 189 + .../sql/extendedserverblobauditingpolicies.go | 189 + .../sql/mgmt/2017-03-01-preview/sql/models.go | 734 +- .../sql/serverblobauditingpolicies.go | 187 + .../sql/serversecurityalertpolicies.go | 187 + .../sql/backupshorttermretentionpolicies.go | 98 + .../sql/managedinstancetdecertificates.go | 125 + .../sql/mgmt/2017-10-01-preview/sql/models.go | 238 + .../2017-10-01-preview/sql/tdecertificates.go | 124 + .../mgmt/2018-03-01-preview/storage/models.go | 10 +- .../timeseriesinsights/environments.go | 2 +- .../mgmt/2016-12-01/backup/backups.go | 116 + .../mgmt/2016-12-01/backup/client.go | 51 + .../mgmt/2016-12-01/backup/engines.go | 220 + .../backup/itemlevelrecoveryconnections.go | 197 + .../2016-12-01/backup/jobcancellations.go | 109 + .../2016-12-01/backup/joboperationresults.go | 111 + .../mgmt/2016-12-01/backup/models.go | 15114 +++ .../2016-12-01/backup/operationresults.go | 111 + .../2016-12-01/backup/operationstatuses.go | 111 + .../backup/protectablecontainers.go | 141 + .../2016-12-01/backup/protectableitems.go | 144 + .../backup/protecteditemoperationresults.go | 116 + .../backup/protecteditemoperationstatuses.go | 118 + .../mgmt/2016-12-01/backup/protecteditems.go | 267 + .../protectioncontaineroperationresults.go | 115 + ...tectioncontainerrefreshoperationresults.go | 112 + .../2016-12-01/backup/protectioncontainers.go | 406 + .../backup/protectioncontainersgroup.go | 139 + .../2016-12-01/backup/protectionpolicies.go | 252 + .../protectionpolicyoperationresults.go | 112 + .../protectionpolicyoperationstatuses.go | 115 + .../mgmt/2016-12-01/backup/recoverypoints.go | 221 + .../backup/resourcestorageconfigs.go | 176 + .../2016-12-01/backup/resourcevaultconfigs.go | 177 + .../mgmt/2016-12-01/backup/restores.go | 118 + .../mgmt/2016-12-01/backup/securitypins.go | 107 + .../mgmt/2016-12-01/backup/version.go | 30 + .../mgmt/2016-12-01/backup/workloaditems.go | 148 + .../mgmt/2017-07-01/backup/models.go | 2803 +- .../2017-07-01/backup/protectioncontainers.go | 10 +- .../2016-07-01/relay/hybridconnections.go | 2 +- .../2017-04-01/relay/hybridconnections.go | 2 +- .../relay/mgmt/2017-04-01/relay/wcfrelays.go | 2 +- .../mgmt/2018-06-01/reservations/models.go | 354 +- .../mgmt/2018-03-01/policy/definitions.go | 2 +- .../mgmt/2018-03-01/policy/models.go | 10 +- .../mgmt/2016-03-01/scheduler/jobs.go | 4 +- .../search/mgmt/2015-08-19/search/services.go | 4 +- .../mgmt/2017-04-01/servicebus/models.go | 4 + .../mgmt/2017-04-01/servicebus/queues.go | 4 +- .../mgmt/2017-04-01/servicebus/rules.go | 4 +- .../2017-04-01/servicebus/subscriptions.go | 4 +- .../mgmt/2017-04-01/servicebus/topics.go | 4 +- .../servicefabric/5.6/servicefabric/client.go | 234 +- .../servicefabric/6.0/servicefabric/client.go | 282 +- .../servicefabric/6.1/servicefabric/client.go | 298 +- .../servicefabric/6.2/servicefabric/client.go | 392 +- .../2018-06-17/storagedatalake/client.go | 53 + .../2018-06-17/storagedatalake/filesystem.go | 588 + .../2018-06-17/storagedatalake/models.go | 172 + .../2018-06-17/storagedatalake/path.go | 1260 + .../2018-06-17/storagedatalake/version.go | 30 + .../storage/mgmt/2018-02-01/storage/models.go | 10 +- .../timeseriesinsights/environments.go | 2 +- .../services/web/mgmt/2016-09-01/web/apps.go | 4 +- .../web/appservicecertificateorders.go | 4 +- .../services/web/mgmt/2018-02-01/web/apps.go | 4 +- .../web/appservicecertificateorders.go | 4 +- .../2018-02-01/web/appserviceenvironments.go | 4 +- .../Azure/azure-sdk-for-go/storage/README.md | 10 +- .../storage/blobserviceclient.go | 6 +- .../Azure/azure-sdk-for-go/storage/client.go | 67 +- .../Azure/azure-sdk-for-go/storage/message.go | 3 +- .../swagger_to_sdk_config.json | 2 +- .../tools/apidiff/cmd/common.go | 22 +- .../tools/apidiff/cmd/packages.go | 128 +- .../tools/apidiff/cmd/root.go | 7 + .../tools/apidiff/repo/repo.go | 16 + .../azure-sdk-for-go/tools/picker/cmd/root.go | 78 +- .../Azure/azure-sdk-for-go/version/version.go | 2 +- .../github.com/Azure/go-autorest/CHANGELOG.md | 23 + .../Azure/go-autorest/autorest/adal/token.go | 22 +- .../Azure/go-autorest/autorest/azure/async.go | 8 +- .../go-autorest/autorest/azure/async_test.go | 52 + .../Azure/go-autorest/autorest/azure/azure.go | 27 +- .../go-autorest/autorest/azure/azure_test.go | 3 + .../Azure/go-autorest/autorest/azure/rp.go | 2 +- .../Azure/go-autorest/autorest/version.go | 2 +- 594 files changed, 269883 insertions(+), 5970 deletions(-) create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/cognitiveservices/autosuggest/models.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/preview/automation/mgmt/automation/models.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/preview/devspaces/mgmt/devspaces/models.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/storage/datalake/storagedatalake/models.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/adhybridhealthservice/mgmt/2014-01-01/adhybridhealthservice/addsservice.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/adhybridhealthservice/mgmt/2014-01-01/adhybridhealthservice/addsservicesreplicationstatus.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/adhybridhealthservice/mgmt/2014-01-01/adhybridhealthservice/addsservicesservicemembers.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/adhybridhealthservice/mgmt/2014-01-01/adhybridhealthservice/addsservicesuserpreference.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/adhybridhealthservice/mgmt/2014-01-01/adhybridhealthservice/reports.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/adhybridhealthservice/mgmt/2014-01-01/adhybridhealthservice/service.go rename vendor/github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2015-05-01/insights/{analyticsitem.go => analyticsitems.go} (71%) delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2015-05-01/insights/favorite.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2015-05-01/insights/workbook.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/appinsights/v1/insights/events.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/appinsights/v1/insights/metrics.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/appinsights/v1/insights/query.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v1.0/autosuggest/client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v1.0/autosuggest/models.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v1.0/autosuggest/version.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v2.0/computervision/client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v2.0/computervision/models.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v2.0/computervision/version.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/consumption/mgmt/2018-05-31/consumption/pricesheet.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/consumption/mgmt/2018-05-31/consumption/usagedetails.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2018-03-31/containerservice/client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2018-03-31/containerservice/containerservices.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2018-03-31/containerservice/managedclusters.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2018-03-31/containerservice/models.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2018-03-31/containerservice/operations.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2018-03-31/containerservice/version.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory/activityruns.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory/client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory/datasets.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory/factories.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory/integrationruntimenodes.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory/integrationruntimes.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory/linkedservices.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory/models.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory/operations.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory/pipelineruns.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory/pipelines.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory/triggerruns.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory/triggers.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory/version.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/keyvault/mgmt/2018-02-14/keyvault/client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/keyvault/mgmt/2018-02-14/keyvault/models.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/keyvault/mgmt/2018-02-14/keyvault/operations.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/keyvault/mgmt/2018-02-14/keyvault/vaults.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/keyvault/mgmt/2018-02-14/keyvault/version.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/keyvault/v7.0/keyvault/client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/keyvault/v7.0/keyvault/models.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/keyvault/v7.0/keyvault/version.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-04-01/network/azurefirewalls.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-04-01/network/hubvirtualnetworkconnections.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-04-01/network/virtualhubs.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-04-01/network/virtualwans.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-04-01/network/vpnconnections.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-04-01/network/vpngateways.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-04-01/network/vpnsites.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-04-01/network/vpnsitesconfiguration.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/api.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/apidiagnostic.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/apiexport.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/apiissue.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/apiissueattachment.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/apiissuecomment.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/apioperation.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/apioperationpolicy.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/apipolicy.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/apiproduct.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/apirelease.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/apirevisions.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/apischema.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/apiversionset.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/authorizationserver.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/backend.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/certificate.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/delegationsettings.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/diagnostic.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/emailtemplate.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/group.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/groupuser.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/identityprovider.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/logger.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/models.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/networkstatus.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/notification.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/notificationrecipientemail.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/notificationrecipientuser.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/openidconnectprovider.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/operation.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/operations.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/policy.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/policysnippets.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/product.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/productapi.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/productgroup.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/productpolicy.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/productsubscriptions.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/property.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/quotabycounterkeys.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/quotabyperiodkeys.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/regions.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/reports.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/service.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/signinsettings.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/signupsettings.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/subscription.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/tag.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/tagdescription.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/tagresource.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/tenantaccess.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/tenantaccessgit.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/tenantconfiguration.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/user.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/usergroup.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/useridentities.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/usersubscription.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/version.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/account.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/activity.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/agentregistrationinformation.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/certificate.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/connection.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/connectiontype.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/credential.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/dsccompilationjob.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/dsccompilationjobstream.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/dscconfiguration.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/dscnode.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/dscnodeconfiguration.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/fields.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/hybridrunbookworkergroup.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/job.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/jobschedule.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/jobstream.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/keys.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/linkedworkspace.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/models.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/module.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/nodereports.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/objectdatatypes.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/operations.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/runbook.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/runbookdraft.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/schedule.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/softwareupdateconfigurationmachineruns.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/softwareupdateconfigurationruns.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/softwareupdateconfigurations.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/sourcecontrol.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/sourcecontrolsyncjob.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/sourcecontrolsyncjobstreams.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/statistics.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/testjob.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/testjobstreams.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/usages.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/variable.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/version.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/webhook.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/account.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/activity.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/agentregistrationinformation.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/certificate.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/connection.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/connectiontype.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/credential.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/dsccompilationjob.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/dsccompilationjobstream.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/dscconfiguration.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/dscnode.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/dscnodeconfiguration.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/fields.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/hybridrunbookworkergroup.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/job.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/jobschedule.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/jobstream.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/keys.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/linkedworkspace.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/models.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/module.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/nodecountinformation.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/nodereports.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/objectdatatypes.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/operations.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/runbook.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/runbookdraft.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/schedule.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/softwareupdateconfigurationmachineruns.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/softwareupdateconfigurationruns.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/softwareupdateconfigurations.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/sourcecontrol.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/sourcecontrolsyncjob.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/sourcecontrolsyncjobstreams.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/statistics.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/testjob.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/testjobstreams.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/usages.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/variable.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/version.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/watcher.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/webhook.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/devspaces/mgmt/2018-06-01-preview/devspaces/client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/devspaces/mgmt/2018-06-01-preview/devspaces/controllers.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/devspaces/mgmt/2018-06-01-preview/devspaces/models.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/devspaces/mgmt/2018-06-01-preview/devspaces/operations.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/devspaces/mgmt/2018-06-01-preview/devspaces/version.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/eventhub/mgmt/2018-01-01-preview/eventhub/namespaces.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/hdinsight/mgmt/2015-03-01-preview/hdinsight/locations.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/hdinsight/mgmt/2018-06-01-preview/hdinsight/applications.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/hdinsight/mgmt/2018-06-01-preview/hdinsight/client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/hdinsight/mgmt/2018-06-01-preview/hdinsight/clusters.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/hdinsight/mgmt/2018-06-01-preview/hdinsight/configurations.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/hdinsight/mgmt/2018-06-01-preview/hdinsight/extensions.go rename vendor/github.com/Azure/azure-sdk-for-go/services/preview/hdinsight/mgmt/{2015-03-01-preview/hdinsight/location.go => 2018-06-01-preview/hdinsight/locations.go} (51%) create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/hdinsight/mgmt/2018-06-01-preview/hdinsight/models.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/hdinsight/mgmt/2018-06-01-preview/hdinsight/operations.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/hdinsight/mgmt/2018-06-01-preview/hdinsight/scriptactions.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/hdinsight/mgmt/2018-06-01-preview/hdinsight/scriptexecutionhistory.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/hdinsight/mgmt/2018-06-01-preview/hdinsight/version.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/mediaservices/mgmt/2018-06-01-preview/media/assets.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/mediaservices/mgmt/2018-06-01-preview/media/client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/mediaservices/mgmt/2018-06-01-preview/media/contentkeypolicies.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/mediaservices/mgmt/2018-06-01-preview/media/jobs.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/mediaservices/mgmt/2018-06-01-preview/media/liveevents.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/mediaservices/mgmt/2018-06-01-preview/media/liveoutputs.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/mediaservices/mgmt/2018-06-01-preview/media/locations.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/mediaservices/mgmt/2018-06-01-preview/media/mediaservices.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/mediaservices/mgmt/2018-06-01-preview/media/models.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/mediaservices/mgmt/2018-06-01-preview/media/operations.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/mediaservices/mgmt/2018-06-01-preview/media/streamingendpoints.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/mediaservices/mgmt/2018-06-01-preview/media/streaminglocators.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/mediaservices/mgmt/2018-06-01-preview/media/streamingpolicies.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/mediaservices/mgmt/2018-06-01-preview/media/transforms.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/mediaservices/mgmt/2018-06-01-preview/media/version.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2017-03-01-preview/sql/extendeddatabaseblobauditingpolicies.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2017-03-01-preview/sql/extendedserverblobauditingpolicies.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2017-03-01-preview/sql/serverblobauditingpolicies.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2017-03-01-preview/sql/serversecurityalertpolicies.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2017-10-01-preview/sql/managedinstancetdecertificates.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2017-10-01-preview/sql/tdecertificates.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2016-12-01/backup/backups.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2016-12-01/backup/client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2016-12-01/backup/engines.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2016-12-01/backup/itemlevelrecoveryconnections.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2016-12-01/backup/jobcancellations.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2016-12-01/backup/joboperationresults.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2016-12-01/backup/models.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2016-12-01/backup/operationresults.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2016-12-01/backup/operationstatuses.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2016-12-01/backup/protectablecontainers.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2016-12-01/backup/protectableitems.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2016-12-01/backup/protecteditemoperationresults.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2016-12-01/backup/protecteditemoperationstatuses.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2016-12-01/backup/protecteditems.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2016-12-01/backup/protectioncontaineroperationresults.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2016-12-01/backup/protectioncontainerrefreshoperationresults.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2016-12-01/backup/protectioncontainers.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2016-12-01/backup/protectioncontainersgroup.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2016-12-01/backup/protectionpolicies.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2016-12-01/backup/protectionpolicyoperationresults.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2016-12-01/backup/protectionpolicyoperationstatuses.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2016-12-01/backup/recoverypoints.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2016-12-01/backup/resourcestorageconfigs.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2016-12-01/backup/resourcevaultconfigs.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2016-12-01/backup/restores.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2016-12-01/backup/securitypins.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2016-12-01/backup/version.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2016-12-01/backup/workloaditems.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/storage/datalake/2018-06-17/storagedatalake/client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/storage/datalake/2018-06-17/storagedatalake/filesystem.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/storage/datalake/2018-06-17/storagedatalake/models.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/storage/datalake/2018-06-17/storagedatalake/path.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/storage/datalake/2018-06-17/storagedatalake/version.go diff --git a/Gopkg.lock b/Gopkg.lock index 851cad592..ba2848120 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -23,8 +23,8 @@ "storage", "version" ] - revision = "cd93ccfe0395e70031704ca68f14606588eec120" - version = "v17.3.0" + revision = "fbe7db0e3f9793ba3e5704efbab84f51436c136e" + version = "v18.0.0" [[projects]] name = "github.com/Azure/go-autorest" @@ -34,8 +34,8 @@ "autorest/azure", "autorest/date" ] - revision = "f04d503958a4fe854c1b41667c73f8813c9dd9c3" - version = "v10.11.2" + revision = "1f7cd6cfe0adea687ad44a512dfe76140f804318" + version = "v10.12.0" [[projects]] branch = "master" diff --git a/vendor/github.com/Azure/azure-sdk-for-go/.travis.yml b/vendor/github.com/Azure/azure-sdk-for-go/.travis.yml index 9b1248d2c..83c067628 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/.travis.yml +++ b/vendor/github.com/Azure/azure-sdk-for-go/.travis.yml @@ -12,6 +12,9 @@ env: - DEP_VERSION="0.4.1" - DEP_SHA=31144e465e52ffbc0035248a10ddea61a09bf28b00784fd3fdd9882c8cbb2315 - IGNORE_BREAKING_CHANGES=true + matrix: + - GOARCH="amd64" + - GOARCH="386" matrix: allow_failures: diff --git a/vendor/github.com/Azure/azure-sdk-for-go/CHANGELOG.md b/vendor/github.com/Azure/azure-sdk-for-go/CHANGELOG.md index 194b5b845..46c247984 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/CHANGELOG.md +++ b/vendor/github.com/Azure/azure-sdk-for-go/CHANGELOG.md @@ -1,43 +1,120 @@ # CHANGELOG +## `v18.0.0` + +### New Services + +| Package Name | API Version | +| ----------------------: | :-------------------: | +| apimanagement | 2018-06-01-preview | +| hdinsight | 2018-06-01-preview | +| computervision | v2.0 | +| recoveryservices/backup | 2016-12-01 | +| storagedatalake | 2018-06-17 | +| devspaces | 2018-06-01-preview | +| automation | 2017-05-15-preview | +| keyvault | v7.0
2018-02-14 | +| automation | 2018-01-preview | +| media | 2018-06-01-preview | +| datafactory | 2018-06-01 | + +### Updates Services + +| Package Name | API Version | +| -------------: | :--------------------------------: | +| face | v1.0 | +| luis/authoring | v2.0 | +| luis/runtime | v2.0 | +| textanalytics | v2.0 | +| eventhub | 2017-04-01
2018-01-01-preview | +| monitor | 2017-05-01-preview | +| signalr | 2018-03-01-preview | +| sql | 2017-10-01-preview | +| storage | 2018-03-01-preview
2018-02-01 | +| servicebus | 2017-04-01 | + +### Breaking Changes + +| Package Name | API Version | +| ----------------------: | :-------------------: | +| adhybridhealthservice | 2014-01-01 | +| advisor | 2017-04-19 | +| appinsights | 2015-05-01
v1 | +| automation | 2015-10-31/automation | +| batchai | 2018-05-01/batchai | +| computervision | v1.0 | +| consumption | 2018-05-31 | +| network | 2018-04-01 | +| operationalinsights | 2015-03-20
v1 | +| recoveryservices/backup | 2017-07-01 | +| reservations | 2018-06-01 | + +## `v17.4.0` + +### New Services + +| Package Name | API Version | +| ---------------: | :---------: | +| autosuggest | v1.0 | +| containerservice | 2018-03-31 | + +### Updated Services + +| Package Name | API Version | +| ---------------: | :---------------------------------------: | +| consumption | 2018-05-31 | +| documentdb | 2015-04-08 | +| network | 2018-02-01
2018-04-01
2018-05-01 | +| notificationhubs | 2017-04-01 | +| sql | 2017-03-01-preview
2017-10-01-preview | + +## `v17.3.1` + +### Updated Services + +| Package Name | API Version | +| ------------: | :-----------------------------------------------------------------------------------: | +| network | 2017-10-01
2017-11-01
2018-01-01
2018-02-01
2018-04-01
2018-05-01 | +| servicefabric | 5.6
6.0
6.1
6.2 | + ## `v17.3.0` ### New Services -| Package Name | API Version | -| --------------------: | :-----------------: | -| containerinstance | 2018-06-01 | -| reservations | 2018-06-01 | +| Package Name | API Version | +| ----------------: | :---------: | +| containerinstance | 2018-06-01 | +| reservations | 2018-06-01 | ### Updated Services -| Package Name | API Version | -| --------------------: | :-----------------: | -| datafactory | 2017-09-01 | -| network | 2015-06-15 | +| Package Name | API Version | +| -----------: | :---------: | +| datafactory | 2017-09-01 | +| network | 2015-06-15 | ## `v17.2.0` ### New Services -| Package Name | API Version | -| --------------------: | :-----------------: | -| managedapplications | 2018-06-01 | -| resources | 2018-05-01 | +| Package Name | API Version | +| ------------------: | :---------: | +| managedapplications | 2018-06-01 | +| resources | 2018-05-01 | ### Updated Services -| Package Name | API Version | -| --------------------: | :-----------------: | -| networksecuritygroup | classic | +| Package Name | API Version | +| -------------------: | :---------: | +| networksecuritygroup | classic | ## `v17.1.0` ### New Services -| Package Name | API Version | -| --------------------: | :-----------------: | -| iotcentral | 2017-07-01-privatepreview | +| Package Name | API Version | +| -----------: | :-----------------------: | +| iotcentral | 2017-07-01-privatepreview | ## `v17.0.0` @@ -248,7 +325,7 @@ ## `v16.1.0` -* Added a `NewAuthorizerFromEnvironment()` function for the keyvault service. +- Added a `NewAuthorizerFromEnvironment()` function for the keyvault service. ## `v16.0.0` @@ -339,8 +416,8 @@ ### Bug Fixes -* Drain the response body when retrying a request. -* Avoid allocating when draining a response body. +- Drain the response body when retrying a request. +- Avoid allocating when draining a response body. ## `v15.1.0` @@ -374,14 +451,14 @@ NOTE: There is a new subdirectory, ./services/preview, which going forward will ### New Features -* Added helper func per enum type that returns a slice of all possible values for that type. +- Added helper func per enum type that returns a slice of all possible values for that type. ### Bug Fixes -* Removed the "arm-" prefix from user-agent strings as not all services are for ARM. -* Fixed missing marshaller for structs with flattened fields. -* Fixed an issue where the incorrect content MIME type was being specified. -* Marshalling of empty values for enum types now works as expected. +- Removed the "arm-" prefix from user-agent strings as not all services are for ARM. +- Fixed missing marshaller for structs with flattened fields. +- Fixed an issue where the incorrect content MIME type was being specified. +- Marshalling of empty values for enum types now works as expected. ### New Services @@ -441,80 +518,80 @@ NOTE: There is a new subdirectory, ./services/preview, which going forward will ### New Services -* Batch 2018-03-01.6.1 -* BatchAI 2018-03-01 -* Cognitive services custom vision prediction v1.1 -* Eventhub 2018-01-01-preview -* MySQL 2017-12-01 -* PostgreSQL 2017-12-01 -* Redis 2018-03-01 -* Subscription 2018-03-01-preview +- Batch 2018-03-01.6.1 +- BatchAI 2018-03-01 +- Cognitive services custom vision prediction v1.1 +- Eventhub 2018-01-01-preview +- MySQL 2017-12-01 +- PostgreSQL 2017-12-01 +- Redis 2018-03-01 +- Subscription 2018-03-01-preview ## `v14.5.0` ### Changes -* Added new preview packages for apimanagement and dns. +- Added new preview packages for apimanagement and dns. ## `v14.4.0` ### Changes -* Added new preview API versions for mysql and postgresql. +- Added new preview API versions for mysql and postgresql. ## `v14.3.0` ### Changes -* Add exports for max file range and sizes for files in storage. -* Updated README regarding blob storage support. -* Add godoc indexer tool. -* Add apidiff tool. +- Add exports for max file range and sizes for files in storage. +- Updated README regarding blob storage support. +- Add godoc indexer tool. +- Add apidiff tool. ## `v14.2.0` ### Changes -* For blob storage, added GetProperties() method to Container. -* Added PublicAccess field to ContainerProperties struct. +- For blob storage, added GetProperties() method to Container. +- Added PublicAccess field to ContainerProperties struct. ## `v14.1.1` -* Fixing timestamp marshalling bug in the `storage` package. -* Updating `profileBuilder` to clear-output folders when it is run by `go generate`. -* Tweaking Swagger -> SDK config to use "latest" instead of "nightly" and be tied to a particular version of autorest.go. +- Fixing timestamp marshalling bug in the `storage` package. +- Updating `profileBuilder` to clear-output folders when it is run by `go generate`. +- Tweaking Swagger -> SDK config to use "latest" instead of "nightly" and be tied to a particular version of autorest.go. ## `v14.1.0` ### Changes -* Update README with details on new authentication helpers. -* Update `latest` profile to point to latest stable API versions. -* Add new API version for Azure Monitoring service and for Batch Data plane service. +- Update README with details on new authentication helpers. +- Update `latest` profile to point to latest stable API versions. +- Add new API version for Azure Monitoring service and for Batch Data plane service. ## `v14.0.2` ### Changes -* Updating `profileBuilder list` to accept an `input` flag instead of reading from `stdin`. -* Simplifying CI to have less chatter, be faster, and have no special cases. +- Updating `profileBuilder list` to accept an `input` flag instead of reading from `stdin`. +- Simplifying CI to have less chatter, be faster, and have no special cases. ## `v14.0.1` ### Changes -* Removed the ./services/search/2016-09-01/search package, it was never intended to be included and doesn't work. +- Removed the ./services/search/2016-09-01/search package, it was never intended to be included and doesn't work. ## `v14.0.0` ### Breaking Changes -* Removed the ./arm, ./datalake-store and ./dataplane directories. You can find the same packages under ./services -* The management package was moved to ./services/classic/management -* Renamed package ./services/redis/mgmt/2017-10-01/cache to ./services/redis/mgmt/2017-10-01/redis +- Removed the ./arm, ./datalake-store and ./dataplane directories. You can find the same packages under ./services +- The management package was moved to ./services/classic/management +- Renamed package ./services/redis/mgmt/2017-10-01/cache to ./services/redis/mgmt/2017-10-01/redis ### Changes -* Removed the "-beta" suffix. -* Added various new services. -* Added ./version package for centralized SDK versioning. +- Removed the "-beta" suffix. +- Added various new services. +- Added ./version package for centralized SDK versioning. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/Gopkg.lock b/vendor/github.com/Azure/azure-sdk-for-go/Gopkg.lock index 8ccb75b62..edcfae5d8 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/Gopkg.lock +++ b/vendor/github.com/Azure/azure-sdk-for-go/Gopkg.lock @@ -12,8 +12,8 @@ "autorest/to", "autorest/validation" ] - revision = "4de44cd533576f3c7b44dcb08dc03754d217144d" - version = "v10.9.2" + revision = "1f7cd6cfe0adea687ad44a512dfe76140f804318" + version = "v10.12.0" [[projects]] name = "github.com/dgrijalva/jwt-go" @@ -34,7 +34,7 @@ "cassette", "recorder" ] - revision = "f8a7e8b9c630b486df74145bb887793a1b85459b" + revision = "8b144be0744f013a1b44386058f1fcb3ba98177d" [[projects]] name = "github.com/fsnotify/fsnotify" @@ -52,7 +52,7 @@ "internal/sasl", "internal/scram" ] - revision = "efe0945164a7e582241f37ae8983c075f8f2e870" + revision = "113d3961e7311526535a1ef7042196563d442761" [[projects]] branch = "master" @@ -77,6 +77,18 @@ revision = "76626ae9c91c4f2a10f34cad8ce83ea42c93bb75" version = "v1.0" +[[projects]] + name = "github.com/kr/pretty" + packages = ["."] + revision = "73f6ac0b30a98e433b289500d779f50c1a6f0712" + version = "v0.1.0" + +[[projects]] + name = "github.com/kr/text" + packages = ["."] + revision = "e2ffdb16a802fe2bb95e2e35ff34f0e53aeef34f" + version = "v0.1.0" + [[projects]] name = "github.com/magiconair/properties" packages = ["."] @@ -105,7 +117,7 @@ branch = "master" name = "github.com/marstr/randname" packages = ["."] - revision = "3ef1f47af99e66171417047e6f6fa334345e95e7" + revision = "48a63b6052f1f9373db9388a658da30c6ab53db1" [[projects]] branch = "master" @@ -122,8 +134,8 @@ [[projects]] name = "github.com/pelletier/go-toml" packages = ["."] - revision = "acdc4509485b587f5e675510c4f2c63e90ff68a8" - version = "v1.1.0" + revision = "c01d1270ff3e442a8a57cddc1c92dc1138598194" + version = "v1.2.0" [[projects]] name = "github.com/satori/go.uuid" @@ -143,8 +155,8 @@ ".", "mem" ] - revision = "63644898a8da0bc22138abf860edaf5277b6102e" - version = "v1.1.0" + revision = "787d034dfe70e44075ccc060d346146ef53270ad" + version = "v1.1.1" [[projects]] name = "github.com/spf13/cast" @@ -183,13 +195,13 @@ "pkcs12", "pkcs12/internal/rc2" ] - revision = "5ba7f63082460102a45837dbd1827e10f9479ac0" + revision = "a49355c7e3f8fe157a85be2f77e6e269a0f89602" [[projects]] branch = "master" name = "golang.org/x/sys" packages = ["unix"] - revision = "c11f84a56e43e20a78cee75a7c034031ecf57d1f" + revision = "7138fd3d9dc8335c567ca206f4333fb75eb05d56" [[projects]] name = "golang.org/x/text" @@ -212,13 +224,13 @@ "imports", "internal/fastwalk" ] - revision = "a5b4c53f6e8bdcafa95a94671bf2d1203365858b" + revision = "ffe88906718454e356e61776b54256e873fc133b" [[projects]] branch = "v1" name = "gopkg.in/check.v1" packages = ["."] - revision = "20d25e2804050c1cd24a7eea1e7a6447dd0e74ec" + revision = "788fd78401277ebd861206a03c884797c6ec5541" [[projects]] name = "gopkg.in/yaml.v2" @@ -229,6 +241,6 @@ [solve-meta] analyzer-name = "dep" analyzer-version = 1 - inputs-digest = "3ba7e7e6599059a0ac88f854eca95495c02501ebe2e0be13b38e4f2b823d5c53" + inputs-digest = "f4bfed9d1dcc4af2e0ff5811bb14dfebe84f87e7aed10199b8ff8d867d947612" solver-name = "gps-cdcl" solver-version = 1 diff --git a/vendor/github.com/Azure/azure-sdk-for-go/Gopkg.toml b/vendor/github.com/Azure/azure-sdk-for-go/Gopkg.toml index 83e67124a..60e66ace8 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/Gopkg.toml +++ b/vendor/github.com/Azure/azure-sdk-for-go/Gopkg.toml @@ -22,7 +22,7 @@ [[constraint]] name = "github.com/Azure/go-autorest" - version = "10.9.2" + version = "10.12.0" [[constraint]] branch = "master" diff --git a/vendor/github.com/Azure/azure-sdk-for-go/README.md b/vendor/github.com/Azure/azure-sdk-for-go/README.md index 6d446d740..d30b67b7b 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/README.md +++ b/vendor/github.com/Azure/azure-sdk-for-go/README.md @@ -4,37 +4,52 @@ [![Build Status](https://travis-ci.org/Azure/azure-sdk-for-go.svg?branch=master)](https://travis-ci.org/Azure/azure-sdk-for-go) [![Go Report Card](https://goreportcard.com/badge/github.com/Azure/azure-sdk-for-go)](https://goreportcard.com/report/github.com/Azure/azure-sdk-for-go) -azure-sdk-for-go provides Go packages for managing and using Azure services. It has been -tested with Go 1.8, 1.9 and 1.10. +azure-sdk-for-go provides Go packages for managing and using Azure services. +It is continuously tested with Go 1.8, 1.9, 1.10 and master. To be notified about updates and changes, subscribe to the [Azure update feed](https://azure.microsoft.com/updates/). -Users of the SDK may prefer to jump right in to our samples repo at +Users may prefer to jump right in to our samples repo at [github.com/Azure-Samples/azure-sdk-for-go-samples][samples_repo]. -### Build Details +## Package Updates Most packages in the SDK are generated from [Azure API specs][azure_rest_specs] using [Azure/autorest.go][] and [Azure/autorest][]. These generated packages depend on the HTTP client implemented at [Azure/go-autorest][]. [azure_rest_specs]: https://github.com/Azure/azure-rest-api-specs -[Azure/autorest]: https://github.com/Azure/autorest -[Azure/autorest.go]: https://github.com/Azure/autorest.go -[Azure/go-autorest]: https://github.com/Azure/go-autorest +[azure/autorest]: https://github.com/Azure/autorest +[azure/autorest.go]: https://github.com/Azure/autorest.go +[azure/go-autorest]: https://github.com/Azure/go-autorest The SDK codebase adheres to [semantic versioning](https://semver.org) and thus -avoids breaking changes other than at major (x.0.0) releases. However, -occasionally Azure API fixes require breaking updates within an individual -package; these exceptions are noted in release changelogs. +avoids breaking changes other than at major (x.0.0) releases. Because Azure's +APIs are updated frequently, we release a **new major version at the end of +each month** with a full changelog. For more details and background see [SDK Update +Practices](https://github.com/Azure/azure-sdk-for-go/wiki/SDK-Update-Practices). To more reliably manage dependencies like the Azure SDK in your applications we recommend [golang/dep](https://github.com/golang/dep). +## Other Azure Go Packages + +Azure provides several other packages for using services from Go, listed below. +If a package you need isn't available please open an issue and let us know. + +| Service | Import Path/Repo | +| -------------------- | -------------------------------------------------------------------------------------------------- | +| Storage - Blobs | [github.com/Azure/azure-storage-blob-go](https://github.com/Azure/azure-storage-blob-go) | +| Storage - Files | [github.com/Azure/azure-storage-file-go](https://github.com/Azure/azure-storage-file-go) | +| Storage - Queues | [github.com/Azure/azure-storage-queue-go](https://github.com/Azure/azure-storage-queue-go) | +| Service Bus | [github.com/Azure/azure-service-bus-go](https://github.com/Azure/azure-service-bus-go) | +| Event Hubs | [github.com/Azure/azure-event-hubs-go](https://github.com/Azure/azure-event-hubs-go) | +| Application Insights | [github.com/Microsoft/ApplicationInsights-go](https://github.com/Microsoft/ApplicationInsights-go) | + # Install and Use: -### Install +## Install ```sh $ go get -u github.com/Azure/azure-sdk-for-go/... @@ -48,42 +63,49 @@ $ dep ensure -add github.com/Azure/azure-sdk-for-go If you need to install Go, follow [the official instructions](https://golang.org/dl/). -### Use +## Use -For complete examples of many scenarios see [Azure-Samples/azure-sdk-for-go-samples][samples_repo]. +For many more scenarios and examples see +[Azure-Samples/azure-sdk-for-go-samples][samples_repo]. -1. Import a package from the [services][services_dir] directory. -2. Create and authenticate a client with a `New*Client` func, e.g. - `c := compute.NewVirtualMachinesClient(...)`. -3. Invoke API methods using the client, e.g. `c.CreateOrUpdate(...)`. -4. Handle responses. +Apply the following general steps to use packages in this repo. For more on +authentication and the `Authorizer` interface see [the next +section](#authentication). + +1. Import a package from the [services][services_dir] directory. +2. Create and authenticate a client with a `New*Client` func, e.g. + `c := compute.NewVirtualMachinesClient(...)`. +3. Invoke API methods using the client, e.g. + `res, err := c.CreateOrUpdate(...)`. +4. Handle responses and errors. [services_dir]: https://github.com/Azure/azure-sdk-for-go/tree/master/services For example, to create a new virtual network (substitute your own values for strings in angle brackets): -Note: For more on authentication and the `Authorizer` interface see [the next - section](#authentication). - ```go package main import ( "context" "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network" + "github.com/Azure/go-autorest/autorest/azure/auth" "github.com/Azure/go-autorest/autorest/to" ) func main() { + // create a VirtualNetworks client vnetClient := network.NewVirtualNetworksClient("") - authorizer, err := auth.NewAuthorizerFromEnvironment() + // create an authorizer from env vars or Azure Managed Service Idenity + authorizer, err := auth.NewAuthorizerFromEnvironment() if err == nil { vnetClient.Authorizer = authorizer } + // call the VirtualNetworks CreateOrUpdate API vnetClient.CreateOrUpdate(context.Background(), "", "", @@ -112,52 +134,111 @@ func main() { } ``` -### Authentication +## Authentication -Most SDK operations require an OAuth token for authentication and authorization. These are -made available in the Go SDK For Azure through types implementing the `Authorizer` interface. -You can get one from Azure Active Directory using the SDK's -[authentication](https://godoc.org/github.com/Azure/go-autorest/autorest/azure/auth) package. The `Authorizer` returned should -be set as the authorizer for the resource client, as shown in the [previous section](#use). +Typical SDK operations must be authenticated and authorized. The _Authorizer_ +interface allows use of any auth style in requests, such as inserting an OAuth2 +Authorization header and bearer token received from Azure AD. -You can get an authorizer in the following ways: -1. From the **Environment**: - - Use `auth.auth.NewAuthorizerFromEnvironment()`. This call will try to get an authorizer based on the environment -variables with different types of credentials in the following order: - 1. **Client Credentials**: Uses the AAD App Secret for auth. - - `AZURE_TENANT_ID`: Specifies the Tenant to which to authenticate. - - `AZURE_CLIENT_ID`: Specifies the app client ID to use. - - `AZURE_CLIENT_SECRET`: Specifies the app secret to use. - 2. **Client Certificate**: Uses a certificate that was configured on the AAD Service Principal. - - `AZURE_TENANT_ID`: Specifies the Tenant to which to authenticate. - - `AZURE_CLIENT_ID`: Specifies the app client ID to use. - - `AZURE_CERTIFICATE_PATH`: Specifies the certificate Path to use. - - `AZURE_CERTIFICATE_PASSWORD`: Specifies the certificate password to use. - 3. **Username Pasword**: Uses a username and a password for auth. This is not recommended. Use `Device Flow` Auth instead for user interactive acccess. - - `AZURE_TENANT_ID`: Specifies the Tenant to which to authenticate. - - `AZURE_CLIENT_ID`: Specifies the app client ID to use. - - `AZURE_USERNAME`: Specifies the username to use. - - `AZURE_PASSWORD`: Specifies the password to use. - 4. **MSI**: Only available for apps running in Azure. No configuration needed as it leverages the fact that the app is running in Azure. See [Azure Managed Service Identity](https://docs.microsoft.com/en-us/azure/active-directory/msi-overview). +The SDK itself provides a simple way to get an authorizer which first checks +for OAuth client credentials in environment variables and then falls back to +Azure's [Managed Service Identity]() when available, e.g. when on an Azure +VM. The following snippet from [the previous section](#use) demonstrates +this helper. - - Optionally, the following environment variables can be defined: - - `AZURE_ENVIRONMENT`: Specifies the Azure Environment to use. If not set, it defaults to `AzurePublicCloud`. (Not applicable to MSI based auth) - - `AZURE_AD_RESOURCE`: Specifies the AAD resource ID to use. If not set, it defaults to `ResourceManagerEndpoint`which allows management operations against Azure Resource Manager. +```go +import github.com/Azure/go-autorest/autorest/azure/auth -2. From an **Auth File**: - - Create a service principal and output the file content using `az ad sp create-for-rbac --sdk-auth` from the Azure CLI.For more details see [az ad sp](https://docs.microsoft.com/en-us/cli/azure/ad/sp). - - Set environment variable `AZURE_AUTH_LOCATION` for finding the file. - - Use `auth.NewAuthorizerFromFile()` for getting the `Authorizer` based on the auth file. +// create a VirtualNetworks client +vnetClient := network.NewVirtualNetworksClient("") -3. From **Device Flow** by configuring `auth.DeviceFlowConfig` and calling the `Authorizer()` method. +// create an authorizer from env vars or Azure Managed Service Idenity +authorizer, err := auth.NewAuthorizerFromEnvironment() +if err == nil { + vnetClient.Authorizer = authorizer +} -Note: To authenticate you first need to create a service principal in Azure. To create a new service principal, run -`az ad sp create-for-rbac -n ""` in the -[azure-cli](https://github.com/Azure/azure-cli). See -[these docs](https://docs.microsoft.com/cli/azure/create-an-azure-service-principal-azure-cli?view=azure-cli-latest) -for more info. Copy the new principal's ID, secret, and tenant ID for use in your app. +// call the VirtualNetworks CreateOrUpdate API +vnetClient.CreateOrUpdate(context.Background(), +// ... +``` -Alternatively, if your apps are running in Azure, you can now leverage the [Managed Service Identity](https://docs.microsoft.com/en-us/azure/active-directory/msi-overview). +The following environment variables help determine authentication configuration: + +- `AZURE_ENVIRONMENT`: Specifies the Azure Environment to use. If not set, it + defaults to `AzurePublicCloud`. Not applicable to authentication with Managed + Service Identity (MSI). +- `AZURE_AD_RESOURCE`: Specifies the AAD resource ID to use. If not set, it + defaults to `ResourceManagerEndpoint` for operations with Azure Resource + Manager. You can also choose an alternate resource programatically with + `auth.NewAuthorizerFromEnvironmentWithResource(resource string)`. + +### More Authentication Details + +The previous is the first and most recommended of several authentication +options offered by the SDK because it allows seamless use of both service +principals and [Azure Managed Service Identity][]. Other options are listed +below. + +> Note: If you need to create a new service principal, run `az ad sp create-for-rbac -n ""` in the +> [azure-cli](https://github.com/Azure/azure-cli). See [these +> docs](https://docs.microsoft.com/cli/azure/create-an-azure-service-principal-azure-cli?view=azure-cli-latest) +> for more info. Copy the new principal's ID, secret, and tenant ID for use in +> your app, or consider the `--sdk-auth` parameter for serialized output. + +[azure managed service identity]: https://docs.microsoft.com/en-us/azure/active-directory/msi-overview + +- The `auth.NewAuthorizerFromEnvironment()` described above creates an authorizer + from the first available of the following configuration: + + 1. **Client Credentials**: Azure AD Application ID and Secret. + + - `AZURE_TENANT_ID`: Specifies the Tenant to which to authenticate. + - `AZURE_CLIENT_ID`: Specifies the app client ID to use. + - `AZURE_CLIENT_SECRET`: Specifies the app secret to use. + + 2. **Client Certificate**: Azure AD Application ID and X.509 Certificate. + + - `AZURE_TENANT_ID`: Specifies the Tenant to which to authenticate. + - `AZURE_CLIENT_ID`: Specifies the app client ID to use. + - `AZURE_CERTIFICATE_PATH`: Specifies the certificate Path to use. + - `AZURE_CERTIFICATE_PASSWORD`: Specifies the certificate password to use. + + 3. **Resource Owner Password**: Azure AD User and Password. This grant type is *not + recommended*, use device login instead if you need interactive login. + + - `AZURE_TENANT_ID`: Specifies the Tenant to which to authenticate. + - `AZURE_CLIENT_ID`: Specifies the app client ID to use. + - `AZURE_USERNAME`: Specifies the username to use. + - `AZURE_PASSWORD`: Specifies the password to use. + + 4. **Azure Managed Service Identity**: Delegate credential management to the + platform. Requires that code is running in Azure, e.g. on a VM. All + configuration is handled by Azure. See [Azure Managed Service + Identity](https://docs.microsoft.com/en-us/azure/active-directory/msi-overview) + for more details. + +- The `auth.NewAuthorizerFromFile()` method creates an authorizer using + credentials from an auth file created by the [Azure CLI][]. Follow these + steps to utilize: + + 1. Create a service principal and output an auth file using `az ad sp create-for-rbac --sdk-auth > client_credentials.json`. + 2. Set environment variable `AZURE_AUTH_LOCATION` to the path of the saved + output file. + 3. Use the authorizer returned by `auth.NewAuthorizerFromFile()` in your + client as described above. + +[azure cli]: https://github.com/Azure/azure-cli + +- Finally, you can use OAuth's [Device Flow][] by calling + `auth.NewDeviceFlowConfig()` and extracting the Authorizer as follows: + + ```go + config := auth.NewDeviceFlowConfig(clientID, tenantID) + a, err = config.Authorizer() + ``` + +[device flow]: https://oauth.net/2/device-flow/ # Versioning @@ -186,17 +267,16 @@ Occasionally service-side changes require major changes to existing versions. These cases are noted in the changelog. All avilable services and versions are listed under the `services/` path in -this repo and in [GoDoc][services_godoc]. Run `find ./services -type d --mindepth 3` to list all available service packages. +this repo and in [GoDoc][services_godoc]. Run `find ./services -type d -mindepth 3` to list all available service packages. -[services_godoc]: https://godoc.org/github.com/Azure/azure-sdk-for-go/services +[services_godoc]: https://godoc.org/github.com/Azure/azure-sdk-for-go/services ### Profiles Azure **API profiles** specify subsets of Azure APIs and versions. Profiles can provide: -* **stability** for your application by locking to specific API versions; and/or -* **compatibility** for your application with Azure Stack and regional Azure datacenters. +- **stability** for your application by locking to specific API versions; and/or +- **compatibility** for your application with Azure Stack and regional Azure datacenters. In the Go SDK, profiles are available under the `profiles/` path and their component API versions are aliases to the true service package under @@ -212,9 +292,9 @@ The 2017-03-09 profile is the only one currently available and is for use in hybrid Azure and Azure Stack environments. More profiles are under development. In addition to versioned profiles, we also provide two special profiles -`latest` and `preview`. These *always* include the most recent respective stable or +`latest` and `preview`. These _always_ include the most recent respective stable or preview API versions for each service, even when updating them to do so causes -breaking changes. That is, these do *not* adhere to semantic versioning rules. +breaking changes. That is, these do _not_ adhere to semantic versioning rules. The `latest` and `preview` profiles can help you stay up to date with API updates as you build applications. Since they are by definition not stable, @@ -240,7 +320,6 @@ All clients implement some handy hooks to help inspect the underlying requests b Here is an example of how these can be used with `net/http/httputil` to see requests and responses. ```go - vnetClient := network.NewVirtualNetworksClient("") vnetClient.RequestInspector = LogRequest() vnetClient.ResponseInspector = LogResponse() @@ -284,11 +363,6 @@ func LogResponse() autorest.RespondDecorator { - Azure API docs are at [docs.microsoft.com/rest/api](https://docs.microsoft.com/rest/api/). - General Azure docs are at [docs.microsoft.com/azure](https://docs.microsoft.com/azure). -### Other Azure packages for Go - -- [Azure Storage Blobs](https://azure.microsoft.com/services/storage/blobs) - [github.com/Azure/azure-storage-blob-go](https://github.com/Azure/azure-storage-blob-go) -- [Azure Applications Insights](https://azure.microsoft.com/en-us/services/application-insights/) - [github.com/Microsoft/ApplicationInsights-Go](https://github.com/Microsoft/ApplicationInsights-Go) - ## License Apache 2.0, see [LICENSE](./LICENSE). @@ -297,5 +371,4 @@ Apache 2.0, see [LICENSE](./LICENSE). See [CONTRIBUTING.md](./CONTRIBUTING.md). -[samples_repo]: https://github.com/Azure-Samples/azure-sdk-for-go-samples - +[samples_repo]: https://github.com/Azure-Samples/azure-sdk-for-go-samples diff --git a/vendor/github.com/Azure/azure-sdk-for-go/profiles/latest/advisor/mgmt/advisor/models.go b/vendor/github.com/Azure/azure-sdk-for-go/profiles/latest/advisor/mgmt/advisor/models.go index 736c0f56b..42bd83ab7 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/profiles/latest/advisor/mgmt/advisor/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/profiles/latest/advisor/mgmt/advisor/models.go @@ -64,7 +64,6 @@ type OperationEntityListResult = original.OperationEntityListResult type OperationEntityListResultIterator = original.OperationEntityListResultIterator type OperationEntityListResultPage = original.OperationEntityListResultPage type RecommendationProperties = original.RecommendationProperties -type RecommendationsGetGenerateStatusFuture = original.RecommendationsGetGenerateStatusFuture type Resource = original.Resource type ResourceRecommendationBase = original.ResourceRecommendationBase type ResourceRecommendationBaseListResult = original.ResourceRecommendationBaseListResult diff --git a/vendor/github.com/Azure/azure-sdk-for-go/profiles/latest/appinsights/mgmt/insights/models.go b/vendor/github.com/Azure/azure-sdk-for-go/profiles/latest/appinsights/mgmt/insights/models.go index 5ae7a185d..c06bb7af5 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/profiles/latest/appinsights/mgmt/insights/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/profiles/latest/appinsights/mgmt/insights/models.go @@ -21,7 +21,7 @@ package insights import original "github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2015-05-01/insights" -type AnalyticsItemClient = original.AnalyticsItemClient +type AnalyticsItemsClient = original.AnalyticsItemsClient type AnnotationsClient = original.AnnotationsClient type APIKeysClient = original.APIKeysClient @@ -36,7 +36,6 @@ type ComponentFeatureCapabilitiesClient = original.ComponentFeatureCapabilitiesC type ComponentQuotaStatusClient = original.ComponentQuotaStatusClient type ComponentsClient = original.ComponentsClient type ExportConfigurationsClient = original.ExportConfigurationsClient -type FavoriteClient = original.FavoriteClient type FavoritesClient = original.FavoritesClient type ApplicationType = original.ApplicationType @@ -142,6 +141,7 @@ const ( type Annotation = original.Annotation type AnnotationError = original.AnnotationError +type AnnotationsListResult = original.AnnotationsListResult type APIKeyRequest = original.APIKeyRequest type ApplicationInsightsComponent = original.ApplicationInsightsComponent type ApplicationInsightsComponentAnalyticsItem = original.ApplicationInsightsComponentAnalyticsItem @@ -170,7 +170,7 @@ type ComponentPurgeBody = original.ComponentPurgeBody type ComponentPurgeBodyFilters = original.ComponentPurgeBodyFilters type ComponentPurgeResponse = original.ComponentPurgeResponse type ComponentPurgeStatusResponse = original.ComponentPurgeStatusResponse -type ComponentsPurgeFuture = original.ComponentsPurgeFuture +type ComponentsResource = original.ComponentsResource type ErrorFieldContract = original.ErrorFieldContract type ErrorResponse = original.ErrorResponse type InnerError = original.InnerError @@ -180,13 +180,11 @@ type ListApplicationInsightsComponentAnalyticsItem = original.ListApplicationIns type ListApplicationInsightsComponentExportConfiguration = original.ListApplicationInsightsComponentExportConfiguration type ListApplicationInsightsComponentFavorite = original.ListApplicationInsightsComponentFavorite type ListApplicationInsightsComponentProactiveDetectionConfiguration = original.ListApplicationInsightsComponentProactiveDetectionConfiguration -type ListWorkItemConfiguration = original.ListWorkItemConfiguration type Operation = original.Operation type OperationDisplay = original.OperationDisplay type OperationListResult = original.OperationListResult type OperationListResultIterator = original.OperationListResultIterator type OperationListResultPage = original.OperationListResultPage -type Resource = original.Resource type SetObject = original.SetObject type TagsResource = original.TagsResource type WebTest = original.WebTest @@ -196,26 +194,28 @@ type WebTestListResultIterator = original.WebTestListResultIterator type WebTestListResultPage = original.WebTestListResultPage type WebTestProperties = original.WebTestProperties type WebTestPropertiesConfiguration = original.WebTestPropertiesConfiguration +type WebtestsResource = original.WebtestsResource type Workbook = original.Workbook type WorkbookError = original.WorkbookError type WorkbookProperties = original.WorkbookProperties -type Workbooks = original.Workbooks +type WorkbookResource = original.WorkbookResource +type WorkbooksListResult = original.WorkbooksListResult type WorkItemConfiguration = original.WorkItemConfiguration type WorkItemConfigurationError = original.WorkItemConfigurationError +type WorkItemConfigurationsListResult = original.WorkItemConfigurationsListResult type WorkItemCreateConfiguration = original.WorkItemCreateConfiguration type OperationsClient = original.OperationsClient type ProactiveDetectionConfigurationsClient = original.ProactiveDetectionConfigurationsClient type WebTestLocationsClient = original.WebTestLocationsClient type WebTestsClient = original.WebTestsClient -type WorkbookClient = original.WorkbookClient type WorkbooksClient = original.WorkbooksClient type WorkItemConfigurationsClient = original.WorkItemConfigurationsClient -func NewAnalyticsItemClient(subscriptionID string) AnalyticsItemClient { - return original.NewAnalyticsItemClient(subscriptionID) +func NewAnalyticsItemsClient(subscriptionID string) AnalyticsItemsClient { + return original.NewAnalyticsItemsClient(subscriptionID) } -func NewAnalyticsItemClientWithBaseURI(baseURI string, subscriptionID string) AnalyticsItemClient { - return original.NewAnalyticsItemClientWithBaseURI(baseURI, subscriptionID) +func NewAnalyticsItemsClientWithBaseURI(baseURI string, subscriptionID string) AnalyticsItemsClient { + return original.NewAnalyticsItemsClientWithBaseURI(baseURI, subscriptionID) } func NewAnnotationsClient(subscriptionID string) AnnotationsClient { return original.NewAnnotationsClient(subscriptionID) @@ -271,12 +271,6 @@ func NewExportConfigurationsClient(subscriptionID string) ExportConfigurationsCl func NewExportConfigurationsClientWithBaseURI(baseURI string, subscriptionID string) ExportConfigurationsClient { return original.NewExportConfigurationsClientWithBaseURI(baseURI, subscriptionID) } -func NewFavoriteClient(subscriptionID string) FavoriteClient { - return original.NewFavoriteClient(subscriptionID) -} -func NewFavoriteClientWithBaseURI(baseURI string, subscriptionID string) FavoriteClient { - return original.NewFavoriteClientWithBaseURI(baseURI, subscriptionID) -} func NewFavoritesClient(subscriptionID string) FavoritesClient { return original.NewFavoritesClient(subscriptionID) } @@ -352,12 +346,6 @@ func NewWebTestsClient(subscriptionID string) WebTestsClient { func NewWebTestsClientWithBaseURI(baseURI string, subscriptionID string) WebTestsClient { return original.NewWebTestsClientWithBaseURI(baseURI, subscriptionID) } -func NewWorkbookClient(subscriptionID string) WorkbookClient { - return original.NewWorkbookClient(subscriptionID) -} -func NewWorkbookClientWithBaseURI(baseURI string, subscriptionID string) WorkbookClient { - return original.NewWorkbookClientWithBaseURI(baseURI, subscriptionID) -} func NewWorkbooksClient(subscriptionID string) WorkbooksClient { return original.NewWorkbooksClient(subscriptionID) } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/profiles/latest/automation/mgmt/automation/models.go b/vendor/github.com/Azure/azure-sdk-for-go/profiles/latest/automation/mgmt/automation/models.go index 15edbef78..f8ce54d13 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/profiles/latest/automation/mgmt/automation/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/profiles/latest/automation/mgmt/automation/models.go @@ -82,6 +82,13 @@ const ( DscConfigurationStatePublished DscConfigurationState = original.DscConfigurationStatePublished ) +type GroupTypeEnum = original.GroupTypeEnum + +const ( + System GroupTypeEnum = original.System + User GroupTypeEnum = original.User +) + type HTTPStatusCode = original.HTTPStatusCode const ( @@ -184,6 +191,7 @@ type KeyPermissions = original.KeyPermissions const ( Full KeyPermissions = original.Full + Read KeyPermissions = original.Read ) type ModuleProvisioningState = original.ModuleProvisioningState @@ -277,6 +285,7 @@ type ActivityListResultPage = original.ActivityListResultPage type ActivityOutputType = original.ActivityOutputType type ActivityParameter = original.ActivityParameter type ActivityParameterSet = original.ActivityParameterSet +type ActivityParameterValidationSet = original.ActivityParameterValidationSet type ActivityProperties = original.ActivityProperties type AdvancedSchedule = original.AdvancedSchedule type AdvancedScheduleMonthlyOccurrence = original.AdvancedScheduleMonthlyOccurrence @@ -373,7 +382,6 @@ type JobListResult = original.JobListResult type JobListResultIterator = original.JobListResultIterator type JobListResultPage = original.JobListResultPage type JobProperties = original.JobProperties -type JobProvisioningStateProperty = original.JobProvisioningStateProperty type JobSchedule = original.JobSchedule type JobScheduleCreateParameters = original.JobScheduleCreateParameters type JobScheduleCreateProperties = original.JobScheduleCreateProperties @@ -438,9 +446,9 @@ type Sku = original.Sku type Statistics = original.Statistics type StatisticsListResult = original.StatisticsListResult type String = original.String -type SubResource = original.SubResource type TestJob = original.TestJob type TestJobCreateParameters = original.TestJobCreateParameters +type TrackedResource = original.TrackedResource type TypeField = original.TypeField type TypeFieldListResult = original.TypeFieldListResult type Usage = original.Usage @@ -613,6 +621,9 @@ func PossibleDscConfigurationProvisioningStateValues() []DscConfigurationProvisi func PossibleDscConfigurationStateValues() []DscConfigurationState { return original.PossibleDscConfigurationStateValues() } +func PossibleGroupTypeEnumValues() []GroupTypeEnum { + return original.PossibleGroupTypeEnumValues() +} func PossibleHTTPStatusCodeValues() []HTTPStatusCode { return original.PossibleHTTPStatusCodeValues() } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/profiles/latest/cognitiveservices/computervision/models.go b/vendor/github.com/Azure/azure-sdk-for-go/profiles/latest/cognitiveservices/computervision/models.go index 954a0e004..be9b19dad 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/profiles/latest/cognitiveservices/computervision/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/profiles/latest/cognitiveservices/computervision/models.go @@ -46,13 +46,6 @@ const ( Landmarks Details = original.Landmarks ) -type DomainModels = original.DomainModels - -const ( - DomainModelsCelebrities DomainModels = original.DomainModelsCelebrities - DomainModelsLandmarks DomainModels = original.DomainModelsLandmarks -) - type ErrorCodes = original.ErrorCodes const ( @@ -135,8 +128,8 @@ type AdultInfo = original.AdultInfo type Category = original.Category type CategoryDetail = original.CategoryDetail type CelebritiesModel = original.CelebritiesModel +type CelebrityResults = original.CelebrityResults type ColorInfo = original.ColorInfo -type DomainModelResult = original.DomainModelResult type DomainModelResults = original.DomainModelResults type Error = original.Error type FaceDescription = original.FaceDescription @@ -149,6 +142,8 @@ type ImageMetadata = original.ImageMetadata type ImageTag = original.ImageTag type ImageType = original.ImageType type ImageURL = original.ImageURL +type LandmarkResults = original.LandmarkResults +type LandmarkResultsLandmarksItem = original.LandmarkResultsLandmarksItem type Line = original.Line type ListModelsResult = original.ListModelsResult type ModelDescription = original.ModelDescription @@ -174,9 +169,6 @@ func PossibleAzureRegionsValues() []AzureRegions { func PossibleDetailsValues() []Details { return original.PossibleDetailsValues() } -func PossibleDomainModelsValues() []DomainModels { - return original.PossibleDomainModelsValues() -} func PossibleErrorCodesValues() []ErrorCodes { return original.PossibleErrorCodesValues() } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/profiles/latest/cognitiveservices/face/models.go b/vendor/github.com/Azure/azure-sdk-for-go/profiles/latest/cognitiveservices/face/models.go index d842f0f02..b4ab5ad79 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/profiles/latest/cognitiveservices/face/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/profiles/latest/cognitiveservices/face/models.go @@ -56,12 +56,16 @@ type AzureRegions = original.AzureRegions const ( Australiaeast AzureRegions = original.Australiaeast Brazilsouth AzureRegions = original.Brazilsouth + Canadacentral AzureRegions = original.Canadacentral + Centralindia AzureRegions = original.Centralindia Eastasia AzureRegions = original.Eastasia Eastus AzureRegions = original.Eastus Eastus2 AzureRegions = original.Eastus2 + Japaneast AzureRegions = original.Japaneast Northeurope AzureRegions = original.Northeurope Southcentralus AzureRegions = original.Southcentralus Southeastasia AzureRegions = original.Southeastasia + Uksouth AzureRegions = original.Uksouth Westcentralus AzureRegions = original.Westcentralus Westeurope AzureRegions = original.Westeurope Westus AzureRegions = original.Westus diff --git a/vendor/github.com/Azure/azure-sdk-for-go/profiles/latest/cognitiveservices/luis/runtime/models.go b/vendor/github.com/Azure/azure-sdk-for-go/profiles/latest/cognitiveservices/luis/runtime/models.go index 4e0c10065..8fec93a63 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/profiles/latest/cognitiveservices/luis/runtime/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/profiles/latest/cognitiveservices/luis/runtime/models.go @@ -27,12 +27,16 @@ type AzureRegions = original.AzureRegions const ( Australiaeast AzureRegions = original.Australiaeast Brazilsouth AzureRegions = original.Brazilsouth + Canadacentral AzureRegions = original.Canadacentral + Centralindia AzureRegions = original.Centralindia Eastasia AzureRegions = original.Eastasia Eastus AzureRegions = original.Eastus Eastus2 AzureRegions = original.Eastus2 + Japaneast AzureRegions = original.Japaneast Northeurope AzureRegions = original.Northeurope Southcentralus AzureRegions = original.Southcentralus Southeastasia AzureRegions = original.Southeastasia + Uksouth AzureRegions = original.Uksouth Westcentralus AzureRegions = original.Westcentralus Westeurope AzureRegions = original.Westeurope Westus AzureRegions = original.Westus diff --git a/vendor/github.com/Azure/azure-sdk-for-go/profiles/latest/cognitiveservices/textanalytics/models.go b/vendor/github.com/Azure/azure-sdk-for-go/profiles/latest/cognitiveservices/textanalytics/models.go index 64cf7df40..02b6c66dc 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/profiles/latest/cognitiveservices/textanalytics/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/profiles/latest/cognitiveservices/textanalytics/models.go @@ -27,12 +27,16 @@ type AzureRegions = original.AzureRegions const ( Australiaeast AzureRegions = original.Australiaeast Brazilsouth AzureRegions = original.Brazilsouth + Canadacentral AzureRegions = original.Canadacentral + Centralindia AzureRegions = original.Centralindia Eastasia AzureRegions = original.Eastasia Eastus AzureRegions = original.Eastus Eastus2 AzureRegions = original.Eastus2 + Japaneast AzureRegions = original.Japaneast Northeurope AzureRegions = original.Northeurope Southcentralus AzureRegions = original.Southcentralus Southeastasia AzureRegions = original.Southeastasia + Uksouth AzureRegions = original.Uksouth Westcentralus AzureRegions = original.Westcentralus Westeurope AzureRegions = original.Westeurope Westus AzureRegions = original.Westus diff --git a/vendor/github.com/Azure/azure-sdk-for-go/profiles/latest/notificationhubs/mgmt/notificationhubs/models.go b/vendor/github.com/Azure/azure-sdk-for-go/profiles/latest/notificationhubs/mgmt/notificationhubs/models.go index 887270844..784a0f2c5 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/profiles/latest/notificationhubs/mgmt/notificationhubs/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/profiles/latest/notificationhubs/mgmt/notificationhubs/models.go @@ -58,6 +58,8 @@ type BaiduCredentialProperties = original.BaiduCredentialProperties type CheckAvailabilityParameters = original.CheckAvailabilityParameters type CheckAvailabilityResult = original.CheckAvailabilityResult type CreateOrUpdateParameters = original.CreateOrUpdateParameters +type DebugSendResponse = original.DebugSendResponse +type DebugSendResult = original.DebugSendResult type ErrorResponse = original.ErrorResponse type GcmCredential = original.GcmCredential type GcmCredentialProperties = original.GcmCredentialProperties @@ -79,6 +81,7 @@ type OperationDisplay = original.OperationDisplay type OperationListResult = original.OperationListResult type OperationListResultIterator = original.OperationListResultIterator type OperationListResultPage = original.OperationListResultPage +type PatchParameters = original.PatchParameters type PnsCredentialsProperties = original.PnsCredentialsProperties type PnsCredentialsResource = original.PnsCredentialsResource type PolicykeyResource = original.PolicykeyResource diff --git a/vendor/github.com/Azure/azure-sdk-for-go/profiles/latest/operationalinsights/mgmt/operationalinsights/models.go b/vendor/github.com/Azure/azure-sdk-for-go/profiles/latest/operationalinsights/mgmt/operationalinsights/models.go index 539cacd3c..aeada2890 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/profiles/latest/operationalinsights/mgmt/operationalinsights/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/profiles/latest/operationalinsights/mgmt/operationalinsights/models.go @@ -67,7 +67,6 @@ type SearchParameters = original.SearchParameters type SearchResultsResponse = original.SearchResultsResponse type SearchSchemaValue = original.SearchSchemaValue type SearchSort = original.SearchSort -type SetObject = original.SetObject type StorageAccount = original.StorageAccount type StorageInsight = original.StorageInsight type StorageInsightListResult = original.StorageInsightListResult @@ -81,7 +80,6 @@ type WorkspacePurgeBodyFilters = original.WorkspacePurgeBodyFilters type WorkspacePurgeResponse = original.WorkspacePurgeResponse type WorkspacePurgeStatusResponse = original.WorkspacePurgeStatusResponse type WorkspacesGetSearchResultsFuture = original.WorkspacesGetSearchResultsFuture -type WorkspacesPurgeFuture = original.WorkspacesPurgeFuture type OperationsClient = original.OperationsClient type SavedSearchesClient = original.SavedSearchesClient type StorageInsightsClient = original.StorageInsightsClient diff --git a/vendor/github.com/Azure/azure-sdk-for-go/profiles/latest/recoveryservices/mgmt/backup/models.go b/vendor/github.com/Azure/azure-sdk-for-go/profiles/latest/recoveryservices/mgmt/backup/models.go index b5c14bdb3..c2aa61e76 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/profiles/latest/recoveryservices/mgmt/backup/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/profiles/latest/recoveryservices/mgmt/backup/models.go @@ -52,17 +52,22 @@ const ( ContainerTypeAzureSQLContainer ContainerType = original.ContainerTypeAzureSQLContainer ContainerTypeCluster ContainerType = original.ContainerTypeCluster ContainerTypeDPMContainer ContainerType = original.ContainerTypeDPMContainer + ContainerTypeExchangeDAG ContainerType = original.ContainerTypeExchangeDAG ContainerTypeGenericContainer ContainerType = original.ContainerTypeGenericContainer + ContainerTypeHyperVCluster ContainerType = original.ContainerTypeHyperVCluster ContainerTypeIaasVMContainer ContainerType = original.ContainerTypeIaasVMContainer ContainerTypeIaasVMServiceContainer ContainerType = original.ContainerTypeIaasVMServiceContainer ContainerTypeInvalid ContainerType = original.ContainerTypeInvalid ContainerTypeMABContainer ContainerType = original.ContainerTypeMABContainer + ContainerTypeSharepointFarm ContainerType = original.ContainerTypeSharepointFarm ContainerTypeSQLAGWorkLoadContainer ContainerType = original.ContainerTypeSQLAGWorkLoadContainer + ContainerTypeSQLCluster ContainerType = original.ContainerTypeSQLCluster ContainerTypeStorageContainer ContainerType = original.ContainerTypeStorageContainer ContainerTypeUnknown ContainerType = original.ContainerTypeUnknown ContainerTypeVCenter ContainerType = original.ContainerTypeVCenter ContainerTypeVMAppContainer ContainerType = original.ContainerTypeVMAppContainer ContainerTypeWindows ContainerType = original.ContainerTypeWindows + ContainerTypeWindowsClient ContainerType = original.ContainerTypeWindowsClient ) type ContainerTypeBasicProtectionContainer = original.ContainerTypeBasicProtectionContainer @@ -74,13 +79,13 @@ const ( ContainerTypeDPMContainer1 ContainerTypeBasicProtectionContainer = original.ContainerTypeDPMContainer1 ContainerTypeGenericContainer1 ContainerTypeBasicProtectionContainer = original.ContainerTypeGenericContainer1 ContainerTypeIaaSVMContainer ContainerTypeBasicProtectionContainer = original.ContainerTypeIaaSVMContainer - ContainerTypeMABWindowsContainer ContainerTypeBasicProtectionContainer = original.ContainerTypeMABWindowsContainer ContainerTypeMicrosoftClassicComputevirtualMachines ContainerTypeBasicProtectionContainer = original.ContainerTypeMicrosoftClassicComputevirtualMachines ContainerTypeMicrosoftComputevirtualMachines ContainerTypeBasicProtectionContainer = original.ContainerTypeMicrosoftComputevirtualMachines ContainerTypeProtectionContainer ContainerTypeBasicProtectionContainer = original.ContainerTypeProtectionContainer ContainerTypeSQLAGWorkLoadContainer1 ContainerTypeBasicProtectionContainer = original.ContainerTypeSQLAGWorkLoadContainer1 ContainerTypeStorageContainer1 ContainerTypeBasicProtectionContainer = original.ContainerTypeStorageContainer1 ContainerTypeVMAppContainer1 ContainerTypeBasicProtectionContainer = original.ContainerTypeVMAppContainer1 + ContainerTypeWindows1 ContainerTypeBasicProtectionContainer = original.ContainerTypeWindows1 ) type CopyOptions = original.CopyOptions @@ -93,6 +98,14 @@ const ( CopyOptionsSkip CopyOptions = original.CopyOptionsSkip ) +type CreateMode = original.CreateMode + +const ( + CreateModeDefault CreateMode = original.CreateModeDefault + CreateModeInvalid CreateMode = original.CreateModeInvalid + CreateModeRecover CreateMode = original.CreateModeRecover +) + type DataSourceType = original.DataSourceType const ( @@ -103,6 +116,7 @@ const ( DataSourceTypeFileFolder DataSourceType = original.DataSourceTypeFileFolder DataSourceTypeGenericDataSource DataSourceType = original.DataSourceTypeGenericDataSource DataSourceTypeInvalid DataSourceType = original.DataSourceTypeInvalid + DataSourceTypeSAPHanaDatabase DataSourceType = original.DataSourceTypeSAPHanaDatabase DataSourceTypeSharepoint DataSourceType = original.DataSourceTypeSharepoint DataSourceTypeSQLDataBase DataSourceType = original.DataSourceTypeSQLDataBase DataSourceTypeSQLDB DataSourceType = original.DataSourceTypeSQLDB @@ -149,6 +163,7 @@ const ( type FeatureType = original.FeatureType const ( + FeatureTypeAzureBackupGoals FeatureType = original.FeatureTypeAzureBackupGoals FeatureTypeAzureVMResourceBackup FeatureType = original.FeatureTypeAzureVMResourceBackup FeatureTypeFeatureSupportRequest FeatureType = original.FeatureTypeFeatureSupportRequest ) @@ -241,6 +256,7 @@ const ( ItemTypeFileFolder ItemType = original.ItemTypeFileFolder ItemTypeGenericDataSource ItemType = original.ItemTypeGenericDataSource ItemTypeInvalid ItemType = original.ItemTypeInvalid + ItemTypeSAPHanaDatabase ItemType = original.ItemTypeSAPHanaDatabase ItemTypeSharepoint ItemType = original.ItemTypeSharepoint ItemTypeSQLDataBase ItemType = original.ItemTypeSQLDataBase ItemTypeSQLDB ItemType = original.ItemTypeSQLDB @@ -309,17 +325,22 @@ const ( MabServerTypeAzureSQLContainer MabServerType = original.MabServerTypeAzureSQLContainer MabServerTypeCluster MabServerType = original.MabServerTypeCluster MabServerTypeDPMContainer MabServerType = original.MabServerTypeDPMContainer + MabServerTypeExchangeDAG MabServerType = original.MabServerTypeExchangeDAG MabServerTypeGenericContainer MabServerType = original.MabServerTypeGenericContainer + MabServerTypeHyperVCluster MabServerType = original.MabServerTypeHyperVCluster MabServerTypeIaasVMContainer MabServerType = original.MabServerTypeIaasVMContainer MabServerTypeIaasVMServiceContainer MabServerType = original.MabServerTypeIaasVMServiceContainer MabServerTypeInvalid MabServerType = original.MabServerTypeInvalid MabServerTypeMABContainer MabServerType = original.MabServerTypeMABContainer + MabServerTypeSharepointFarm MabServerType = original.MabServerTypeSharepointFarm MabServerTypeSQLAGWorkLoadContainer MabServerType = original.MabServerTypeSQLAGWorkLoadContainer + MabServerTypeSQLCluster MabServerType = original.MabServerTypeSQLCluster MabServerTypeStorageContainer MabServerType = original.MabServerTypeStorageContainer MabServerTypeUnknown MabServerType = original.MabServerTypeUnknown MabServerTypeVCenter MabServerType = original.MabServerTypeVCenter MabServerTypeVMAppContainer MabServerType = original.MabServerTypeVMAppContainer MabServerTypeWindows MabServerType = original.MabServerTypeWindows + MabServerTypeWindowsClient MabServerType = original.MabServerTypeWindowsClient ) type ManagementType = original.ManagementType @@ -402,24 +423,28 @@ const ( type ObjectTypeBasicRecoveryPoint = original.ObjectTypeBasicRecoveryPoint const ( - ObjectTypeAzureFileShareRecoveryPoint ObjectTypeBasicRecoveryPoint = original.ObjectTypeAzureFileShareRecoveryPoint - ObjectTypeAzureWorkloadRecoveryPoint ObjectTypeBasicRecoveryPoint = original.ObjectTypeAzureWorkloadRecoveryPoint - ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint ObjectTypeBasicRecoveryPoint = original.ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint - ObjectTypeAzureWorkloadSQLRecoveryPoint ObjectTypeBasicRecoveryPoint = original.ObjectTypeAzureWorkloadSQLRecoveryPoint - ObjectTypeGenericRecoveryPoint ObjectTypeBasicRecoveryPoint = original.ObjectTypeGenericRecoveryPoint - ObjectTypeIaasVMRecoveryPoint ObjectTypeBasicRecoveryPoint = original.ObjectTypeIaasVMRecoveryPoint - ObjectTypeRecoveryPoint ObjectTypeBasicRecoveryPoint = original.ObjectTypeRecoveryPoint + ObjectTypeAzureFileShareRecoveryPoint ObjectTypeBasicRecoveryPoint = original.ObjectTypeAzureFileShareRecoveryPoint + ObjectTypeAzureWorkloadRecoveryPoint ObjectTypeBasicRecoveryPoint = original.ObjectTypeAzureWorkloadRecoveryPoint + ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint ObjectTypeBasicRecoveryPoint = original.ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint + ObjectTypeAzureWorkloadSAPHanaRecoveryPoint ObjectTypeBasicRecoveryPoint = original.ObjectTypeAzureWorkloadSAPHanaRecoveryPoint + ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint ObjectTypeBasicRecoveryPoint = original.ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint + ObjectTypeAzureWorkloadSQLRecoveryPoint ObjectTypeBasicRecoveryPoint = original.ObjectTypeAzureWorkloadSQLRecoveryPoint + ObjectTypeGenericRecoveryPoint ObjectTypeBasicRecoveryPoint = original.ObjectTypeGenericRecoveryPoint + ObjectTypeIaasVMRecoveryPoint ObjectTypeBasicRecoveryPoint = original.ObjectTypeIaasVMRecoveryPoint + ObjectTypeRecoveryPoint ObjectTypeBasicRecoveryPoint = original.ObjectTypeRecoveryPoint ) type ObjectTypeBasicRestoreRequest = original.ObjectTypeBasicRestoreRequest const ( - ObjectTypeAzureFileShareRestoreRequest ObjectTypeBasicRestoreRequest = original.ObjectTypeAzureFileShareRestoreRequest - ObjectTypeAzureWorkloadRestoreRequest ObjectTypeBasicRestoreRequest = original.ObjectTypeAzureWorkloadRestoreRequest - ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest ObjectTypeBasicRestoreRequest = original.ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest - ObjectTypeAzureWorkloadSQLRestoreRequest ObjectTypeBasicRestoreRequest = original.ObjectTypeAzureWorkloadSQLRestoreRequest - ObjectTypeIaasVMRestoreRequest ObjectTypeBasicRestoreRequest = original.ObjectTypeIaasVMRestoreRequest - ObjectTypeRestoreRequest ObjectTypeBasicRestoreRequest = original.ObjectTypeRestoreRequest + ObjectTypeAzureFileShareRestoreRequest ObjectTypeBasicRestoreRequest = original.ObjectTypeAzureFileShareRestoreRequest + ObjectTypeAzureWorkloadRestoreRequest ObjectTypeBasicRestoreRequest = original.ObjectTypeAzureWorkloadRestoreRequest + ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest ObjectTypeBasicRestoreRequest = original.ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest + ObjectTypeAzureWorkloadSAPHanaRestoreRequest ObjectTypeBasicRestoreRequest = original.ObjectTypeAzureWorkloadSAPHanaRestoreRequest + ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest ObjectTypeBasicRestoreRequest = original.ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest + ObjectTypeAzureWorkloadSQLRestoreRequest ObjectTypeBasicRestoreRequest = original.ObjectTypeAzureWorkloadSQLRestoreRequest + ObjectTypeIaasVMRestoreRequest ObjectTypeBasicRestoreRequest = original.ObjectTypeIaasVMRestoreRequest + ObjectTypeRestoreRequest ObjectTypeBasicRestoreRequest = original.ObjectTypeRestoreRequest ) type OperationStatusValues = original.OperationStatusValues @@ -456,6 +481,8 @@ const ( ProtectableItemTypeIaaSVMProtectableItem ProtectableItemType = original.ProtectableItemTypeIaaSVMProtectableItem ProtectableItemTypeMicrosoftClassicComputevirtualMachines ProtectableItemType = original.ProtectableItemTypeMicrosoftClassicComputevirtualMachines ProtectableItemTypeMicrosoftComputevirtualMachines ProtectableItemType = original.ProtectableItemTypeMicrosoftComputevirtualMachines + ProtectableItemTypeSAPHanaDatabase ProtectableItemType = original.ProtectableItemTypeSAPHanaDatabase + ProtectableItemTypeSAPHanaSystem ProtectableItemType = original.ProtectableItemTypeSAPHanaSystem ProtectableItemTypeSQLAvailabilityGroupContainer ProtectableItemType = original.ProtectableItemTypeSQLAvailabilityGroupContainer ProtectableItemTypeSQLDataBase ProtectableItemType = original.ProtectableItemTypeSQLDataBase ProtectableItemTypeSQLInstance ProtectableItemType = original.ProtectableItemTypeSQLInstance @@ -488,6 +515,8 @@ type ProtectedItemType = original.ProtectedItemType const ( ProtectedItemTypeAzureFileShareProtectedItem ProtectedItemType = original.ProtectedItemTypeAzureFileShareProtectedItem ProtectedItemTypeAzureIaaSVMProtectedItem ProtectedItemType = original.ProtectedItemTypeAzureIaaSVMProtectedItem + ProtectedItemTypeAzureVMWorkloadProtectedItem ProtectedItemType = original.ProtectedItemTypeAzureVMWorkloadProtectedItem + ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase ProtectedItemType = original.ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase ProtectedItemTypeAzureVMWorkloadSQLDatabase ProtectedItemType = original.ProtectedItemTypeAzureVMWorkloadSQLDatabase ProtectedItemTypeDPMProtectedItem ProtectedItemType = original.ProtectedItemTypeDPMProtectedItem ProtectedItemTypeGenericProtectedItem ProtectedItemType = original.ProtectedItemTypeGenericProtectedItem @@ -501,8 +530,11 @@ const ( type ProtectionIntentItemType = original.ProtectionIntentItemType const ( - ProtectionIntentItemTypeAzureResourceItem ProtectionIntentItemType = original.ProtectionIntentItemTypeAzureResourceItem - ProtectionIntentItemTypeProtectionIntent ProtectionIntentItemType = original.ProtectionIntentItemTypeProtectionIntent + ProtectionIntentItemTypeAzureResourceItem ProtectionIntentItemType = original.ProtectionIntentItemTypeAzureResourceItem + ProtectionIntentItemTypeAzureWorkloadAutoProtectionIntent ProtectionIntentItemType = original.ProtectionIntentItemTypeAzureWorkloadAutoProtectionIntent + ProtectionIntentItemTypeAzureWorkloadSQLAutoProtectionIntent ProtectionIntentItemType = original.ProtectionIntentItemTypeAzureWorkloadSQLAutoProtectionIntent + ProtectionIntentItemTypeProtectionIntent ProtectionIntentItemType = original.ProtectionIntentItemTypeProtectionIntent + ProtectionIntentItemTypeRecoveryServiceVaultItem ProtectionIntentItemType = original.ProtectionIntentItemTypeRecoveryServiceVaultItem ) type ProtectionState = original.ProtectionState @@ -697,25 +729,30 @@ const ( type WeekOfMonth = original.WeekOfMonth const ( - First WeekOfMonth = original.First - Fourth WeekOfMonth = original.Fourth - Last WeekOfMonth = original.Last - Second WeekOfMonth = original.Second - Third WeekOfMonth = original.Third + WeekOfMonthFirst WeekOfMonth = original.WeekOfMonthFirst + WeekOfMonthFourth WeekOfMonth = original.WeekOfMonthFourth + WeekOfMonthInvalid WeekOfMonth = original.WeekOfMonthInvalid + WeekOfMonthLast WeekOfMonth = original.WeekOfMonthLast + WeekOfMonthSecond WeekOfMonth = original.WeekOfMonthSecond + WeekOfMonthThird WeekOfMonth = original.WeekOfMonthThird ) type WorkloadItemType = original.WorkloadItemType const ( - WorkloadItemTypeInvalid WorkloadItemType = original.WorkloadItemTypeInvalid - WorkloadItemTypeSQLDataBase WorkloadItemType = original.WorkloadItemTypeSQLDataBase - WorkloadItemTypeSQLInstance WorkloadItemType = original.WorkloadItemTypeSQLInstance + WorkloadItemTypeInvalid WorkloadItemType = original.WorkloadItemTypeInvalid + WorkloadItemTypeSAPHanaDatabase WorkloadItemType = original.WorkloadItemTypeSAPHanaDatabase + WorkloadItemTypeSAPHanaSystem WorkloadItemType = original.WorkloadItemTypeSAPHanaSystem + WorkloadItemTypeSQLDataBase WorkloadItemType = original.WorkloadItemTypeSQLDataBase + WorkloadItemTypeSQLInstance WorkloadItemType = original.WorkloadItemTypeSQLInstance ) type WorkloadItemTypeBasicWorkloadItem = original.WorkloadItemTypeBasicWorkloadItem const ( WorkloadItemTypeAzureVMWorkloadItem WorkloadItemTypeBasicWorkloadItem = original.WorkloadItemTypeAzureVMWorkloadItem + WorkloadItemTypeSAPHanaDatabase1 WorkloadItemTypeBasicWorkloadItem = original.WorkloadItemTypeSAPHanaDatabase1 + WorkloadItemTypeSAPHanaSystem1 WorkloadItemTypeBasicWorkloadItem = original.WorkloadItemTypeSAPHanaSystem1 WorkloadItemTypeSQLDataBase1 WorkloadItemTypeBasicWorkloadItem = original.WorkloadItemTypeSQLDataBase1 WorkloadItemTypeSQLInstance1 WorkloadItemTypeBasicWorkloadItem = original.WorkloadItemTypeSQLInstance1 WorkloadItemTypeWorkloadItem WorkloadItemTypeBasicWorkloadItem = original.WorkloadItemTypeWorkloadItem @@ -731,6 +768,7 @@ const ( WorkloadTypeFileFolder WorkloadType = original.WorkloadTypeFileFolder WorkloadTypeGenericDataSource WorkloadType = original.WorkloadTypeGenericDataSource WorkloadTypeInvalid WorkloadType = original.WorkloadTypeInvalid + WorkloadTypeSAPHanaDatabase WorkloadType = original.WorkloadTypeSAPHanaDatabase WorkloadTypeSharepoint WorkloadType = original.WorkloadTypeSharepoint WorkloadTypeSQLDataBase WorkloadType = original.WorkloadTypeSQLDataBase WorkloadTypeSQLDB WorkloadType = original.WorkloadTypeSQLDB @@ -739,6 +777,7 @@ const ( WorkloadTypeVMwareVM WorkloadType = original.WorkloadTypeVMwareVM ) +type AzureBackupGoalFeatureSupportRequest = original.AzureBackupGoalFeatureSupportRequest type AzureBackupServerContainer = original.AzureBackupServerContainer type AzureBackupServerEngine = original.AzureBackupServerEngine type AzureFileShareBackupRequest = original.AzureFileShareBackupRequest @@ -763,6 +802,8 @@ type BasicAzureIaaSVMProtectedItem = original.BasicAzureIaaSVMProtectedItem type AzureIaaSVMProtectedItem = original.AzureIaaSVMProtectedItem type AzureIaaSVMProtectedItemExtendedInfo = original.AzureIaaSVMProtectedItemExtendedInfo type AzureIaaSVMProtectionPolicy = original.AzureIaaSVMProtectionPolicy +type BasicAzureRecoveryServiceVaultProtectionIntent = original.BasicAzureRecoveryServiceVaultProtectionIntent +type AzureRecoveryServiceVaultProtectionIntent = original.AzureRecoveryServiceVaultProtectionIntent type AzureResourceProtectionIntent = original.AzureResourceProtectionIntent type AzureSQLAGWorkloadContainerProtectionContainer = original.AzureSQLAGWorkloadContainerProtectionContainer type AzureSQLContainer = original.AzureSQLContainer @@ -783,14 +824,23 @@ type BasicAzureVMWorkloadItem = original.BasicAzureVMWorkloadItem type AzureVMWorkloadItem = original.AzureVMWorkloadItem type BasicAzureVMWorkloadProtectableItem = original.BasicAzureVMWorkloadProtectableItem type AzureVMWorkloadProtectableItem = original.AzureVMWorkloadProtectableItem +type BasicAzureVMWorkloadProtectedItem = original.BasicAzureVMWorkloadProtectedItem +type AzureVMWorkloadProtectedItem = original.AzureVMWorkloadProtectedItem type AzureVMWorkloadProtectedItemExtendedInfo = original.AzureVMWorkloadProtectedItemExtendedInfo type AzureVMWorkloadProtectionPolicy = original.AzureVMWorkloadProtectionPolicy +type AzureVMWorkloadSAPHanaDatabaseProtectableItem = original.AzureVMWorkloadSAPHanaDatabaseProtectableItem +type AzureVMWorkloadSAPHanaDatabaseProtectedItem = original.AzureVMWorkloadSAPHanaDatabaseProtectedItem +type AzureVMWorkloadSAPHanaDatabaseWorkloadItem = original.AzureVMWorkloadSAPHanaDatabaseWorkloadItem +type AzureVMWorkloadSAPHanaSystemProtectableItem = original.AzureVMWorkloadSAPHanaSystemProtectableItem +type AzureVMWorkloadSAPHanaSystemWorkloadItem = original.AzureVMWorkloadSAPHanaSystemWorkloadItem type AzureVMWorkloadSQLAvailabilityGroupProtectableItem = original.AzureVMWorkloadSQLAvailabilityGroupProtectableItem type AzureVMWorkloadSQLDatabaseProtectableItem = original.AzureVMWorkloadSQLDatabaseProtectableItem type AzureVMWorkloadSQLDatabaseProtectedItem = original.AzureVMWorkloadSQLDatabaseProtectedItem type AzureVMWorkloadSQLDatabaseWorkloadItem = original.AzureVMWorkloadSQLDatabaseWorkloadItem type AzureVMWorkloadSQLInstanceProtectableItem = original.AzureVMWorkloadSQLInstanceProtectableItem type AzureVMWorkloadSQLInstanceWorkloadItem = original.AzureVMWorkloadSQLInstanceWorkloadItem +type BasicAzureWorkloadAutoProtectionIntent = original.BasicAzureWorkloadAutoProtectionIntent +type AzureWorkloadAutoProtectionIntent = original.AzureWorkloadAutoProtectionIntent type AzureWorkloadBackupRequest = original.AzureWorkloadBackupRequest type BasicAzureWorkloadContainer = original.BasicAzureWorkloadContainer type AzureWorkloadContainer = original.AzureWorkloadContainer @@ -803,6 +853,13 @@ type BasicAzureWorkloadRecoveryPoint = original.BasicAzureWorkloadRecoveryPoint type AzureWorkloadRecoveryPoint = original.AzureWorkloadRecoveryPoint type BasicAzureWorkloadRestoreRequest = original.BasicAzureWorkloadRestoreRequest type AzureWorkloadRestoreRequest = original.AzureWorkloadRestoreRequest +type AzureWorkloadSAPHanaPointInTimeRecoveryPoint = original.AzureWorkloadSAPHanaPointInTimeRecoveryPoint +type AzureWorkloadSAPHanaPointInTimeRestoreRequest = original.AzureWorkloadSAPHanaPointInTimeRestoreRequest +type BasicAzureWorkloadSAPHanaRecoveryPoint = original.BasicAzureWorkloadSAPHanaRecoveryPoint +type AzureWorkloadSAPHanaRecoveryPoint = original.AzureWorkloadSAPHanaRecoveryPoint +type BasicAzureWorkloadSAPHanaRestoreRequest = original.BasicAzureWorkloadSAPHanaRestoreRequest +type AzureWorkloadSAPHanaRestoreRequest = original.AzureWorkloadSAPHanaRestoreRequest +type AzureWorkloadSQLAutoProtectionIntent = original.AzureWorkloadSQLAutoProtectionIntent type AzureWorkloadSQLPointInTimeRecoveryPoint = original.AzureWorkloadSQLPointInTimeRecoveryPoint type AzureWorkloadSQLPointInTimeRestoreRequest = original.AzureWorkloadSQLPointInTimeRestoreRequest type BasicAzureWorkloadSQLRecoveryPoint = original.BasicAzureWorkloadSQLRecoveryPoint @@ -815,6 +872,7 @@ type BMSBackupEngineQueryObject = original.BMSBackupEngineQueryObject type BMSBackupEnginesQueryObject = original.BMSBackupEnginesQueryObject type BMSBackupSummariesQueryObject = original.BMSBackupSummariesQueryObject type BMSContainerQueryObject = original.BMSContainerQueryObject +type BMSContainersInquiryQueryObject = original.BMSContainersInquiryQueryObject type BMSPOQueryObject = original.BMSPOQueryObject type BMSRefreshContainersQueryObject = original.BMSRefreshContainersQueryObject type BMSRPQueryObject = original.BMSRPQueryObject @@ -1102,6 +1160,9 @@ func PossibleContainerTypeBasicProtectionContainerValues() []ContainerTypeBasicP func PossibleCopyOptionsValues() []CopyOptions { return original.PossibleCopyOptionsValues() } +func PossibleCreateModeValues() []CreateMode { + return original.PossibleCreateModeValues() +} func PossibleDataSourceTypeValues() []DataSourceType { return original.PossibleDataSourceTypeValues() } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/adhybridhealthservice/mgmt/adhybridhealthservice/models.go b/vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/adhybridhealthservice/mgmt/adhybridhealthservice/models.go index d9564268b..dda44b438 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/adhybridhealthservice/mgmt/adhybridhealthservice/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/adhybridhealthservice/mgmt/adhybridhealthservice/models.go @@ -22,8 +22,12 @@ package adhybridhealthservice import original "github.com/Azure/azure-sdk-for-go/services/adhybridhealthservice/mgmt/2014-01-01/adhybridhealthservice" type AdDomainServiceMembersClient = original.AdDomainServiceMembersClient +type AddsServiceClient = original.AddsServiceClient type AddsServiceMembersClient = original.AddsServiceMembersClient type AddsServicesClient = original.AddsServicesClient +type AddsServicesReplicationStatusClient = original.AddsServicesReplicationStatusClient +type AddsServicesServiceMembersClient = original.AddsServicesServiceMembersClient +type AddsServicesUserPreferenceClient = original.AddsServicesUserPreferenceClient type AlertsClient = original.AlertsClient const ( @@ -230,6 +234,7 @@ type Partition = original.Partition type PartitionScope = original.PartitionScope type PasswordHashSyncConfiguration = original.PasswordHashSyncConfiguration type PasswordManagementSettings = original.PasswordManagementSettings +type ReplicationDetailsList = original.ReplicationDetailsList type ReplicationStatus = original.ReplicationStatus type ReplicationSummary = original.ReplicationSummary type ReplicationSummaryList = original.ReplicationSummaryList @@ -250,8 +255,11 @@ type ServicesPage = original.ServicesPage type TabularExportError = original.TabularExportError type Tenant = original.Tenant type TenantOnboardingDetails = original.TenantOnboardingDetails +type UserPreference = original.UserPreference type ValueDelta = original.ValueDelta type OperationsClient = original.OperationsClient +type ReportsClient = original.ReportsClient +type ServiceClient = original.ServiceClient type ServiceMembersClient = original.ServiceMembersClient type ServicesClient = original.ServicesClient @@ -261,6 +269,12 @@ func NewAdDomainServiceMembersClient() AdDomainServiceMembersClient { func NewAdDomainServiceMembersClientWithBaseURI(baseURI string) AdDomainServiceMembersClient { return original.NewAdDomainServiceMembersClientWithBaseURI(baseURI) } +func NewAddsServiceClient() AddsServiceClient { + return original.NewAddsServiceClient() +} +func NewAddsServiceClientWithBaseURI(baseURI string) AddsServiceClient { + return original.NewAddsServiceClientWithBaseURI(baseURI) +} func NewAddsServiceMembersClient() AddsServiceMembersClient { return original.NewAddsServiceMembersClient() } @@ -273,6 +287,24 @@ func NewAddsServicesClient() AddsServicesClient { func NewAddsServicesClientWithBaseURI(baseURI string) AddsServicesClient { return original.NewAddsServicesClientWithBaseURI(baseURI) } +func NewAddsServicesReplicationStatusClient() AddsServicesReplicationStatusClient { + return original.NewAddsServicesReplicationStatusClient() +} +func NewAddsServicesReplicationStatusClientWithBaseURI(baseURI string) AddsServicesReplicationStatusClient { + return original.NewAddsServicesReplicationStatusClientWithBaseURI(baseURI) +} +func NewAddsServicesServiceMembersClient() AddsServicesServiceMembersClient { + return original.NewAddsServicesServiceMembersClient() +} +func NewAddsServicesServiceMembersClientWithBaseURI(baseURI string) AddsServicesServiceMembersClient { + return original.NewAddsServicesServiceMembersClientWithBaseURI(baseURI) +} +func NewAddsServicesUserPreferenceClient() AddsServicesUserPreferenceClient { + return original.NewAddsServicesUserPreferenceClient() +} +func NewAddsServicesUserPreferenceClientWithBaseURI(baseURI string) AddsServicesUserPreferenceClient { + return original.NewAddsServicesUserPreferenceClientWithBaseURI(baseURI) +} func NewAlertsClient() AlertsClient { return original.NewAlertsClient() } @@ -336,6 +368,18 @@ func NewOperationsClient() OperationsClient { func NewOperationsClientWithBaseURI(baseURI string) OperationsClient { return original.NewOperationsClientWithBaseURI(baseURI) } +func NewReportsClient() ReportsClient { + return original.NewReportsClient() +} +func NewReportsClientWithBaseURI(baseURI string) ReportsClient { + return original.NewReportsClientWithBaseURI(baseURI) +} +func NewServiceClient() ServiceClient { + return original.NewServiceClient() +} +func NewServiceClientWithBaseURI(baseURI string) ServiceClient { + return original.NewServiceClientWithBaseURI(baseURI) +} func NewServiceMembersClient() ServiceMembersClient { return original.NewServiceMembersClient() } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/advisor/mgmt/advisor/models.go b/vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/advisor/mgmt/advisor/models.go index f7cf5cf78..d7ebcf86f 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/advisor/mgmt/advisor/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/advisor/mgmt/advisor/models.go @@ -64,7 +64,6 @@ type OperationEntityListResult = original.OperationEntityListResult type OperationEntityListResultIterator = original.OperationEntityListResultIterator type OperationEntityListResultPage = original.OperationEntityListResultPage type RecommendationProperties = original.RecommendationProperties -type RecommendationsGetGenerateStatusFuture = original.RecommendationsGetGenerateStatusFuture type Resource = original.Resource type ResourceRecommendationBase = original.ResourceRecommendationBase type ResourceRecommendationBaseListResult = original.ResourceRecommendationBaseListResult diff --git a/vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/appinsights/mgmt/insights/models.go b/vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/appinsights/mgmt/insights/models.go index 77e41913d..d88d1a980 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/appinsights/mgmt/insights/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/appinsights/mgmt/insights/models.go @@ -21,7 +21,7 @@ package insights import original "github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2015-05-01/insights" -type AnalyticsItemClient = original.AnalyticsItemClient +type AnalyticsItemsClient = original.AnalyticsItemsClient type AnnotationsClient = original.AnnotationsClient type APIKeysClient = original.APIKeysClient @@ -36,7 +36,6 @@ type ComponentFeatureCapabilitiesClient = original.ComponentFeatureCapabilitiesC type ComponentQuotaStatusClient = original.ComponentQuotaStatusClient type ComponentsClient = original.ComponentsClient type ExportConfigurationsClient = original.ExportConfigurationsClient -type FavoriteClient = original.FavoriteClient type FavoritesClient = original.FavoritesClient type ApplicationType = original.ApplicationType @@ -142,6 +141,7 @@ const ( type Annotation = original.Annotation type AnnotationError = original.AnnotationError +type AnnotationsListResult = original.AnnotationsListResult type APIKeyRequest = original.APIKeyRequest type ApplicationInsightsComponent = original.ApplicationInsightsComponent type ApplicationInsightsComponentAnalyticsItem = original.ApplicationInsightsComponentAnalyticsItem @@ -170,7 +170,7 @@ type ComponentPurgeBody = original.ComponentPurgeBody type ComponentPurgeBodyFilters = original.ComponentPurgeBodyFilters type ComponentPurgeResponse = original.ComponentPurgeResponse type ComponentPurgeStatusResponse = original.ComponentPurgeStatusResponse -type ComponentsPurgeFuture = original.ComponentsPurgeFuture +type ComponentsResource = original.ComponentsResource type ErrorFieldContract = original.ErrorFieldContract type ErrorResponse = original.ErrorResponse type InnerError = original.InnerError @@ -180,13 +180,11 @@ type ListApplicationInsightsComponentAnalyticsItem = original.ListApplicationIns type ListApplicationInsightsComponentExportConfiguration = original.ListApplicationInsightsComponentExportConfiguration type ListApplicationInsightsComponentFavorite = original.ListApplicationInsightsComponentFavorite type ListApplicationInsightsComponentProactiveDetectionConfiguration = original.ListApplicationInsightsComponentProactiveDetectionConfiguration -type ListWorkItemConfiguration = original.ListWorkItemConfiguration type Operation = original.Operation type OperationDisplay = original.OperationDisplay type OperationListResult = original.OperationListResult type OperationListResultIterator = original.OperationListResultIterator type OperationListResultPage = original.OperationListResultPage -type Resource = original.Resource type SetObject = original.SetObject type TagsResource = original.TagsResource type WebTest = original.WebTest @@ -196,26 +194,28 @@ type WebTestListResultIterator = original.WebTestListResultIterator type WebTestListResultPage = original.WebTestListResultPage type WebTestProperties = original.WebTestProperties type WebTestPropertiesConfiguration = original.WebTestPropertiesConfiguration +type WebtestsResource = original.WebtestsResource type Workbook = original.Workbook type WorkbookError = original.WorkbookError type WorkbookProperties = original.WorkbookProperties -type Workbooks = original.Workbooks +type WorkbookResource = original.WorkbookResource +type WorkbooksListResult = original.WorkbooksListResult type WorkItemConfiguration = original.WorkItemConfiguration type WorkItemConfigurationError = original.WorkItemConfigurationError +type WorkItemConfigurationsListResult = original.WorkItemConfigurationsListResult type WorkItemCreateConfiguration = original.WorkItemCreateConfiguration type OperationsClient = original.OperationsClient type ProactiveDetectionConfigurationsClient = original.ProactiveDetectionConfigurationsClient type WebTestLocationsClient = original.WebTestLocationsClient type WebTestsClient = original.WebTestsClient -type WorkbookClient = original.WorkbookClient type WorkbooksClient = original.WorkbooksClient type WorkItemConfigurationsClient = original.WorkItemConfigurationsClient -func NewAnalyticsItemClient(subscriptionID string) AnalyticsItemClient { - return original.NewAnalyticsItemClient(subscriptionID) +func NewAnalyticsItemsClient(subscriptionID string) AnalyticsItemsClient { + return original.NewAnalyticsItemsClient(subscriptionID) } -func NewAnalyticsItemClientWithBaseURI(baseURI string, subscriptionID string) AnalyticsItemClient { - return original.NewAnalyticsItemClientWithBaseURI(baseURI, subscriptionID) +func NewAnalyticsItemsClientWithBaseURI(baseURI string, subscriptionID string) AnalyticsItemsClient { + return original.NewAnalyticsItemsClientWithBaseURI(baseURI, subscriptionID) } func NewAnnotationsClient(subscriptionID string) AnnotationsClient { return original.NewAnnotationsClient(subscriptionID) @@ -271,12 +271,6 @@ func NewExportConfigurationsClient(subscriptionID string) ExportConfigurationsCl func NewExportConfigurationsClientWithBaseURI(baseURI string, subscriptionID string) ExportConfigurationsClient { return original.NewExportConfigurationsClientWithBaseURI(baseURI, subscriptionID) } -func NewFavoriteClient(subscriptionID string) FavoriteClient { - return original.NewFavoriteClient(subscriptionID) -} -func NewFavoriteClientWithBaseURI(baseURI string, subscriptionID string) FavoriteClient { - return original.NewFavoriteClientWithBaseURI(baseURI, subscriptionID) -} func NewFavoritesClient(subscriptionID string) FavoritesClient { return original.NewFavoritesClient(subscriptionID) } @@ -352,12 +346,6 @@ func NewWebTestsClient(subscriptionID string) WebTestsClient { func NewWebTestsClientWithBaseURI(baseURI string, subscriptionID string) WebTestsClient { return original.NewWebTestsClientWithBaseURI(baseURI, subscriptionID) } -func NewWorkbookClient(subscriptionID string) WorkbookClient { - return original.NewWorkbookClient(subscriptionID) -} -func NewWorkbookClientWithBaseURI(baseURI string, subscriptionID string) WorkbookClient { - return original.NewWorkbookClientWithBaseURI(baseURI, subscriptionID) -} func NewWorkbooksClient(subscriptionID string) WorkbooksClient { return original.NewWorkbooksClient(subscriptionID) } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/batchai/mgmt/batchai/models.go b/vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/batchai/mgmt/batchai/models.go index 1d8db5a66..1d392ca26 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/batchai/mgmt/batchai/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/batchai/mgmt/batchai/models.go @@ -112,8 +112,8 @@ const ( Chainer ToolType = original.Chainer Cntk ToolType = original.Cntk Custom ToolType = original.Custom + Custommpi ToolType = original.Custommpi Horovod ToolType = original.Horovod - Mpi ToolType = original.Mpi Tensorflow ToolType = original.Tensorflow ) @@ -242,6 +242,7 @@ type WorkspaceListResultPage = original.WorkspaceListResultPage type WorkspaceProperties = original.WorkspaceProperties type WorkspacesCreateFuture = original.WorkspacesCreateFuture type WorkspacesDeleteFuture = original.WorkspacesDeleteFuture +type WorkspaceUpdateParameters = original.WorkspaceUpdateParameters type OperationsClient = original.OperationsClient type UsagesClient = original.UsagesClient type WorkspacesClient = original.WorkspacesClient diff --git a/vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/cognitiveservices/autosuggest/models.go b/vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/cognitiveservices/autosuggest/models.go new file mode 100644 index 000000000..3e1958eae --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/cognitiveservices/autosuggest/models.go @@ -0,0 +1,176 @@ +// +build go1.9 + +// Copyright 2018 Microsoft Corporation +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// This code was auto-generated by: +// github.com/Azure/azure-sdk-for-go/tools/profileBuilder + +package autosuggest + +import original "github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v1.0/autosuggest" + +const ( + DefaultBaseURI = original.DefaultBaseURI +) + +type BaseClient = original.BaseClient +type ErrorCode = original.ErrorCode + +const ( + InsufficientAuthorization ErrorCode = original.InsufficientAuthorization + InvalidAuthorization ErrorCode = original.InvalidAuthorization + InvalidRequest ErrorCode = original.InvalidRequest + None ErrorCode = original.None + RateLimitExceeded ErrorCode = original.RateLimitExceeded + ServerError ErrorCode = original.ServerError +) + +type ResponseFormat = original.ResponseFormat + +const ( + JSON ResponseFormat = original.JSON + JSONLd ResponseFormat = original.JSONLd +) + +type SafeSearch = original.SafeSearch + +const ( + Moderate SafeSearch = original.Moderate + Off SafeSearch = original.Off + Strict SafeSearch = original.Strict +) + +type ScenarioType = original.ScenarioType + +const ( + Custom ScenarioType = original.Custom + PersonalSearchDocuments ScenarioType = original.PersonalSearchDocuments + PersonalSearchTags ScenarioType = original.PersonalSearchTags + SearchHistory ScenarioType = original.SearchHistory + StoreApps ScenarioType = original.StoreApps + Unknown ScenarioType = original.Unknown + Web ScenarioType = original.Web +) + +type SearchKind = original.SearchKind + +const ( + CustomSearch SearchKind = original.CustomSearch + DocumentSearch SearchKind = original.DocumentSearch + HistorySearch SearchKind = original.HistorySearch + LocationSearch SearchKind = original.LocationSearch + TagSearch SearchKind = original.TagSearch + WebSearch SearchKind = original.WebSearch +) + +type Type = original.Type + +const ( + TypeSuggestionsSuggestionGroup Type = original.TypeSuggestionsSuggestionGroup +) + +type TypeBasicError = original.TypeBasicError + +const ( + TypeError TypeBasicError = original.TypeError +) + +type TypeBasicQueryContext = original.TypeBasicQueryContext + +const ( + TypeQueryContext TypeBasicQueryContext = original.TypeQueryContext +) + +type TypeBasicResponseBase = original.TypeBasicResponseBase + +const ( + TypeAction TypeBasicResponseBase = original.TypeAction + TypeAnswer TypeBasicResponseBase = original.TypeAnswer + TypeCreativeWork TypeBasicResponseBase = original.TypeCreativeWork + TypeErrorResponse TypeBasicResponseBase = original.TypeErrorResponse + TypeIdentifiable TypeBasicResponseBase = original.TypeIdentifiable + TypeResponse TypeBasicResponseBase = original.TypeResponse + TypeResponseBase TypeBasicResponseBase = original.TypeResponseBase + TypeSearchAction TypeBasicResponseBase = original.TypeSearchAction + TypeSearchResultsAnswer TypeBasicResponseBase = original.TypeSearchResultsAnswer + TypeSuggestions TypeBasicResponseBase = original.TypeSuggestions + TypeThing TypeBasicResponseBase = original.TypeThing +) + +type BasicAction = original.BasicAction +type Action = original.Action +type BasicAnswer = original.BasicAnswer +type Answer = original.Answer +type BasicCreativeWork = original.BasicCreativeWork +type CreativeWork = original.CreativeWork +type BasicError = original.BasicError +type Error = original.Error +type ErrorResponse = original.ErrorResponse +type BasicIdentifiable = original.BasicIdentifiable +type Identifiable = original.Identifiable +type BasicQueryContext = original.BasicQueryContext +type QueryContext = original.QueryContext +type BasicResponse = original.BasicResponse +type Response = original.Response +type BasicResponseBase = original.BasicResponseBase +type ResponseBase = original.ResponseBase +type SearchAction = original.SearchAction +type BasicSearchResultsAnswer = original.BasicSearchResultsAnswer +type SearchResultsAnswer = original.SearchResultsAnswer +type Suggestions = original.Suggestions +type BasicSuggestionsSuggestionGroup = original.BasicSuggestionsSuggestionGroup +type SuggestionsSuggestionGroup = original.SuggestionsSuggestionGroup +type BasicThing = original.BasicThing +type Thing = original.Thing + +func New() BaseClient { + return original.New() +} +func NewWithBaseURI(baseURI string) BaseClient { + return original.NewWithBaseURI(baseURI) +} +func PossibleErrorCodeValues() []ErrorCode { + return original.PossibleErrorCodeValues() +} +func PossibleResponseFormatValues() []ResponseFormat { + return original.PossibleResponseFormatValues() +} +func PossibleSafeSearchValues() []SafeSearch { + return original.PossibleSafeSearchValues() +} +func PossibleScenarioTypeValues() []ScenarioType { + return original.PossibleScenarioTypeValues() +} +func PossibleSearchKindValues() []SearchKind { + return original.PossibleSearchKindValues() +} +func PossibleTypeValues() []Type { + return original.PossibleTypeValues() +} +func PossibleTypeBasicErrorValues() []TypeBasicError { + return original.PossibleTypeBasicErrorValues() +} +func PossibleTypeBasicQueryContextValues() []TypeBasicQueryContext { + return original.PossibleTypeBasicQueryContextValues() +} +func PossibleTypeBasicResponseBaseValues() []TypeBasicResponseBase { + return original.PossibleTypeBasicResponseBaseValues() +} +func UserAgent() string { + return original.UserAgent() + " profiles/preview" +} +func Version() string { + return original.Version() +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/cognitiveservices/computervision/models.go b/vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/cognitiveservices/computervision/models.go index bbb11cb1d..ba35b2280 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/cognitiveservices/computervision/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/cognitiveservices/computervision/models.go @@ -19,7 +19,7 @@ package computervision -import original "github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v1.0/computervision" +import original "github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v2.0/computervision" type BaseClient = original.BaseClient type AzureRegions = original.AzureRegions @@ -46,13 +46,6 @@ const ( Landmarks Details = original.Landmarks ) -type DomainModels = original.DomainModels - -const ( - DomainModelsCelebrities DomainModels = original.DomainModelsCelebrities - DomainModelsLandmarks DomainModels = original.DomainModelsLandmarks -) - type ErrorCodes = original.ErrorCodes const ( @@ -119,6 +112,13 @@ const ( Succeeded TextOperationStatusCodes = original.Succeeded ) +type TextRecognitionMode = original.TextRecognitionMode + +const ( + Handwritten TextRecognitionMode = original.Handwritten + Printed TextRecognitionMode = original.Printed +) + type VisualFeatureTypes = original.VisualFeatureTypes const ( @@ -135,8 +135,8 @@ type AdultInfo = original.AdultInfo type Category = original.Category type CategoryDetail = original.CategoryDetail type CelebritiesModel = original.CelebritiesModel +type CelebrityResults = original.CelebrityResults type ColorInfo = original.ColorInfo -type DomainModelResult = original.DomainModelResult type DomainModelResults = original.DomainModelResults type Error = original.Error type FaceDescription = original.FaceDescription @@ -149,6 +149,8 @@ type ImageMetadata = original.ImageMetadata type ImageTag = original.ImageTag type ImageType = original.ImageType type ImageURL = original.ImageURL +type LandmarkResults = original.LandmarkResults +type LandmarksModel = original.LandmarksModel type Line = original.Line type ListModelsResult = original.ListModelsResult type ModelDescription = original.ModelDescription @@ -174,9 +176,6 @@ func PossibleAzureRegionsValues() []AzureRegions { func PossibleDetailsValues() []Details { return original.PossibleDetailsValues() } -func PossibleDomainModelsValues() []DomainModels { - return original.PossibleDomainModelsValues() -} func PossibleErrorCodesValues() []ErrorCodes { return original.PossibleErrorCodesValues() } @@ -189,6 +188,9 @@ func PossibleOcrLanguagesValues() []OcrLanguages { func PossibleTextOperationStatusCodesValues() []TextOperationStatusCodes { return original.PossibleTextOperationStatusCodesValues() } +func PossibleTextRecognitionModeValues() []TextRecognitionMode { + return original.PossibleTextRecognitionModeValues() +} func PossibleVisualFeatureTypesValues() []VisualFeatureTypes { return original.PossibleVisualFeatureTypesValues() } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/cognitiveservices/face/models.go b/vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/cognitiveservices/face/models.go index 0340f62e1..2ad602e59 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/cognitiveservices/face/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/cognitiveservices/face/models.go @@ -56,12 +56,16 @@ type AzureRegions = original.AzureRegions const ( Australiaeast AzureRegions = original.Australiaeast Brazilsouth AzureRegions = original.Brazilsouth + Canadacentral AzureRegions = original.Canadacentral + Centralindia AzureRegions = original.Centralindia Eastasia AzureRegions = original.Eastasia Eastus AzureRegions = original.Eastus Eastus2 AzureRegions = original.Eastus2 + Japaneast AzureRegions = original.Japaneast Northeurope AzureRegions = original.Northeurope Southcentralus AzureRegions = original.Southcentralus Southeastasia AzureRegions = original.Southeastasia + Uksouth AzureRegions = original.Uksouth Westcentralus AzureRegions = original.Westcentralus Westeurope AzureRegions = original.Westeurope Westus AzureRegions = original.Westus diff --git a/vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/cognitiveservices/luis/authoring/models.go b/vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/cognitiveservices/luis/authoring/models.go index b4b34b529..360bb7265 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/cognitiveservices/luis/authoring/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/cognitiveservices/luis/authoring/models.go @@ -31,12 +31,16 @@ type AzureRegions = original.AzureRegions const ( Australiaeast AzureRegions = original.Australiaeast Brazilsouth AzureRegions = original.Brazilsouth + Canadacentral AzureRegions = original.Canadacentral + Centralindia AzureRegions = original.Centralindia Eastasia AzureRegions = original.Eastasia Eastus AzureRegions = original.Eastus Eastus2 AzureRegions = original.Eastus2 + Japaneast AzureRegions = original.Japaneast Northeurope AzureRegions = original.Northeurope Southcentralus AzureRegions = original.Southcentralus Southeastasia AzureRegions = original.Southeastasia + Uksouth AzureRegions = original.Uksouth Westcentralus AzureRegions = original.Westcentralus Westeurope AzureRegions = original.Westeurope Westus AzureRegions = original.Westus diff --git a/vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/cognitiveservices/luis/runtime/models.go b/vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/cognitiveservices/luis/runtime/models.go index 02bfe5bb5..d83341493 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/cognitiveservices/luis/runtime/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/cognitiveservices/luis/runtime/models.go @@ -27,12 +27,16 @@ type AzureRegions = original.AzureRegions const ( Australiaeast AzureRegions = original.Australiaeast Brazilsouth AzureRegions = original.Brazilsouth + Canadacentral AzureRegions = original.Canadacentral + Centralindia AzureRegions = original.Centralindia Eastasia AzureRegions = original.Eastasia Eastus AzureRegions = original.Eastus Eastus2 AzureRegions = original.Eastus2 + Japaneast AzureRegions = original.Japaneast Northeurope AzureRegions = original.Northeurope Southcentralus AzureRegions = original.Southcentralus Southeastasia AzureRegions = original.Southeastasia + Uksouth AzureRegions = original.Uksouth Westcentralus AzureRegions = original.Westcentralus Westeurope AzureRegions = original.Westeurope Westus AzureRegions = original.Westus diff --git a/vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/cognitiveservices/textanalytics/models.go b/vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/cognitiveservices/textanalytics/models.go index 4501c72ac..a49a4b405 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/cognitiveservices/textanalytics/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/cognitiveservices/textanalytics/models.go @@ -27,12 +27,16 @@ type AzureRegions = original.AzureRegions const ( Australiaeast AzureRegions = original.Australiaeast Brazilsouth AzureRegions = original.Brazilsouth + Canadacentral AzureRegions = original.Canadacentral + Centralindia AzureRegions = original.Centralindia Eastasia AzureRegions = original.Eastasia Eastus AzureRegions = original.Eastus Eastus2 AzureRegions = original.Eastus2 + Japaneast AzureRegions = original.Japaneast Northeurope AzureRegions = original.Northeurope Southcentralus AzureRegions = original.Southcentralus Southeastasia AzureRegions = original.Southeastasia + Uksouth AzureRegions = original.Uksouth Westcentralus AzureRegions = original.Westcentralus Westeurope AzureRegions = original.Westeurope Westus AzureRegions = original.Westus diff --git a/vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/consumption/mgmt/consumption/models.go b/vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/consumption/mgmt/consumption/models.go index cf86760f7..16d982e4e 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/consumption/mgmt/consumption/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/consumption/mgmt/consumption/models.go @@ -55,13 +55,24 @@ type Forecast = original.Forecast type ForecastProperties = original.ForecastProperties type ForecastPropertiesConfidenceLevelsItem = original.ForecastPropertiesConfidenceLevelsItem type ForecastsListResult = original.ForecastsListResult +type MeterDetails = original.MeterDetails type Operation = original.Operation type OperationDisplay = original.OperationDisplay type OperationListResult = original.OperationListResult type OperationListResultIterator = original.OperationListResultIterator type OperationListResultPage = original.OperationListResultPage +type PriceSheetModel = original.PriceSheetModel +type PriceSheetProperties = original.PriceSheetProperties +type PriceSheetResult = original.PriceSheetResult type Resource = original.Resource +type UsageDetail = original.UsageDetail +type UsageDetailProperties = original.UsageDetailProperties +type UsageDetailsListResult = original.UsageDetailsListResult +type UsageDetailsListResultIterator = original.UsageDetailsListResultIterator +type UsageDetailsListResultPage = original.UsageDetailsListResultPage type OperationsClient = original.OperationsClient +type PriceSheetClient = original.PriceSheetClient +type UsageDetailsClient = original.UsageDetailsClient func New(subscriptionID string) BaseClient { return original.New(subscriptionID) @@ -90,6 +101,18 @@ func NewOperationsClient(subscriptionID string) OperationsClient { func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient { return original.NewOperationsClientWithBaseURI(baseURI, subscriptionID) } +func NewPriceSheetClient(subscriptionID string) PriceSheetClient { + return original.NewPriceSheetClient(subscriptionID) +} +func NewPriceSheetClientWithBaseURI(baseURI string, subscriptionID string) PriceSheetClient { + return original.NewPriceSheetClientWithBaseURI(baseURI, subscriptionID) +} +func NewUsageDetailsClient(subscriptionID string) UsageDetailsClient { + return original.NewUsageDetailsClient(subscriptionID) +} +func NewUsageDetailsClientWithBaseURI(baseURI string, subscriptionID string) UsageDetailsClient { + return original.NewUsageDetailsClientWithBaseURI(baseURI, subscriptionID) +} func UserAgent() string { return original.UserAgent() + " profiles/preview" } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/containerservice/mgmt/containerservice/models.go b/vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/containerservice/mgmt/containerservice/models.go index 78a104f10..9829e5f87 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/containerservice/mgmt/containerservice/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/containerservice/mgmt/containerservice/models.go @@ -19,7 +19,7 @@ package containerservice -import original "github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2017-09-30/containerservice" +import original "github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2018-03-31/containerservice" const ( DefaultBaseURI = original.DefaultBaseURI @@ -28,6 +28,19 @@ const ( type BaseClient = original.BaseClient type ContainerServicesClient = original.ContainerServicesClient type ManagedClustersClient = original.ManagedClustersClient +type NetworkPlugin = original.NetworkPlugin + +const ( + Azure NetworkPlugin = original.Azure + Kubenet NetworkPlugin = original.Kubenet +) + +type NetworkPolicy = original.NetworkPolicy + +const ( + Calico NetworkPolicy = original.Calico +) + type OrchestratorTypes = original.OrchestratorTypes const ( @@ -244,7 +257,10 @@ type ListResult = original.ListResult type ListResultIterator = original.ListResultIterator type ListResultPage = original.ListResultPage type ManagedCluster = original.ManagedCluster +type ManagedClusterAADProfile = original.ManagedClusterAADProfile type ManagedClusterAccessProfile = original.ManagedClusterAccessProfile +type ManagedClusterAddonProfile = original.ManagedClusterAddonProfile +type ManagedClusterAgentPoolProfile = original.ManagedClusterAgentPoolProfile type ManagedClusterListResult = original.ManagedClusterListResult type ManagedClusterListResultIterator = original.ManagedClusterListResultIterator type ManagedClusterListResultPage = original.ManagedClusterListResultPage @@ -255,6 +271,10 @@ type ManagedClustersDeleteFuture = original.ManagedClustersDeleteFuture type ManagedClusterUpgradeProfile = original.ManagedClusterUpgradeProfile type ManagedClusterUpgradeProfileProperties = original.ManagedClusterUpgradeProfileProperties type MasterProfile = original.MasterProfile +type NetworkProfile = original.NetworkProfile +type OperationListResult = original.OperationListResult +type OperationValue = original.OperationValue +type OperationValueDisplay = original.OperationValueDisplay type OrchestratorProfile = original.OrchestratorProfile type OrchestratorProfileType = original.OrchestratorProfileType type OrchestratorVersionProfile = original.OrchestratorVersionProfile @@ -267,6 +287,7 @@ type SSHConfiguration = original.SSHConfiguration type SSHPublicKey = original.SSHPublicKey type VMDiagnostics = original.VMDiagnostics type WindowsProfile = original.WindowsProfile +type OperationsClient = original.OperationsClient func New(subscriptionID string) BaseClient { return original.New(subscriptionID) @@ -286,6 +307,12 @@ func NewManagedClustersClient(subscriptionID string) ManagedClustersClient { func NewManagedClustersClientWithBaseURI(baseURI string, subscriptionID string) ManagedClustersClient { return original.NewManagedClustersClientWithBaseURI(baseURI, subscriptionID) } +func PossibleNetworkPluginValues() []NetworkPlugin { + return original.PossibleNetworkPluginValues() +} +func PossibleNetworkPolicyValues() []NetworkPolicy { + return original.PossibleNetworkPolicyValues() +} func PossibleOrchestratorTypesValues() []OrchestratorTypes { return original.PossibleOrchestratorTypesValues() } @@ -298,6 +325,12 @@ func PossibleStorageProfileTypesValues() []StorageProfileTypes { func PossibleVMSizeTypesValues() []VMSizeTypes { return original.PossibleVMSizeTypesValues() } +func NewOperationsClient(subscriptionID string) OperationsClient { + return original.NewOperationsClient(subscriptionID) +} +func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient { + return original.NewOperationsClientWithBaseURI(baseURI, subscriptionID) +} func UserAgent() string { return original.UserAgent() + " profiles/preview" } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/datafactory/mgmt/datafactory/models.go b/vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/datafactory/mgmt/datafactory/models.go index 6214614e7..3ee15d7a1 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/datafactory/mgmt/datafactory/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/datafactory/mgmt/datafactory/models.go @@ -19,7 +19,7 @@ package datafactory -import original "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2017-09-01-preview/datafactory" +import original "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" type ActivityRunsClient = original.ActivityRunsClient @@ -42,14 +42,6 @@ const ( AuthenticationTypeWebLinkedServiceTypeProperties AuthenticationType = original.AuthenticationTypeWebLinkedServiceTypeProperties ) -type AuthorizationType = original.AuthorizationType - -const ( - AuthorizationTypeKey AuthorizationType = original.AuthorizationTypeKey - AuthorizationTypeLinkedIntegrationRuntimeProperties AuthorizationType = original.AuthorizationTypeLinkedIntegrationRuntimeProperties - AuthorizationTypeRBAC AuthorizationType = original.AuthorizationTypeRBAC -) - type AzureSearchIndexWriteBehaviorType = original.AzureSearchIndexWriteBehaviorType const ( @@ -57,6 +49,13 @@ const ( Upload AzureSearchIndexWriteBehaviorType = original.Upload ) +type BlobEventTypes = original.BlobEventTypes + +const ( + MicrosoftStorageBlobCreated BlobEventTypes = original.MicrosoftStorageBlobCreated + MicrosoftStorageBlobDeleted BlobEventTypes = original.MicrosoftStorageBlobDeleted +) + type CassandraSourceReadConsistencyLevels = original.CassandraSourceReadConsistencyLevels const ( @@ -321,38 +320,6 @@ const ( PhoenixAuthenticationTypeWindowsAzureHDInsightService PhoenixAuthenticationType = original.PhoenixAuthenticationTypeWindowsAzureHDInsightService ) -type PipelineRunQueryFilterOperand = original.PipelineRunQueryFilterOperand - -const ( - PipelineName PipelineRunQueryFilterOperand = original.PipelineName - RunEnd PipelineRunQueryFilterOperand = original.RunEnd - RunStart PipelineRunQueryFilterOperand = original.RunStart - Status PipelineRunQueryFilterOperand = original.Status -) - -type PipelineRunQueryFilterOperator = original.PipelineRunQueryFilterOperator - -const ( - Equals PipelineRunQueryFilterOperator = original.Equals - In PipelineRunQueryFilterOperator = original.In - NotEquals PipelineRunQueryFilterOperator = original.NotEquals - NotIn PipelineRunQueryFilterOperator = original.NotIn -) - -type PipelineRunQueryOrder = original.PipelineRunQueryOrder - -const ( - ASC PipelineRunQueryOrder = original.ASC - DESC PipelineRunQueryOrder = original.DESC -) - -type PipelineRunQueryOrderByField = original.PipelineRunQueryOrderByField - -const ( - PipelineRunQueryOrderByFieldRunEnd PipelineRunQueryOrderByField = original.PipelineRunQueryOrderByFieldRunEnd - PipelineRunQueryOrderByFieldRunStart PipelineRunQueryOrderByField = original.PipelineRunQueryOrderByFieldRunStart -) - type PolybaseSettingsRejectType = original.PolybaseSettingsRejectType const ( @@ -379,6 +346,51 @@ const ( Year RecurrenceFrequency = original.Year ) +type RunQueryFilterOperand = original.RunQueryFilterOperand + +const ( + ActivityName RunQueryFilterOperand = original.ActivityName + ActivityRunEnd RunQueryFilterOperand = original.ActivityRunEnd + ActivityRunStart RunQueryFilterOperand = original.ActivityRunStart + ActivityType RunQueryFilterOperand = original.ActivityType + PipelineName RunQueryFilterOperand = original.PipelineName + RunEnd RunQueryFilterOperand = original.RunEnd + RunStart RunQueryFilterOperand = original.RunStart + Status RunQueryFilterOperand = original.Status + TriggerName RunQueryFilterOperand = original.TriggerName + TriggerRunTimestamp RunQueryFilterOperand = original.TriggerRunTimestamp +) + +type RunQueryFilterOperator = original.RunQueryFilterOperator + +const ( + Equals RunQueryFilterOperator = original.Equals + In RunQueryFilterOperator = original.In + NotEquals RunQueryFilterOperator = original.NotEquals + NotIn RunQueryFilterOperator = original.NotIn +) + +type RunQueryOrder = original.RunQueryOrder + +const ( + ASC RunQueryOrder = original.ASC + DESC RunQueryOrder = original.DESC +) + +type RunQueryOrderByField = original.RunQueryOrderByField + +const ( + RunQueryOrderByFieldActivityName RunQueryOrderByField = original.RunQueryOrderByFieldActivityName + RunQueryOrderByFieldActivityRunEnd RunQueryOrderByField = original.RunQueryOrderByFieldActivityRunEnd + RunQueryOrderByFieldActivityRunStart RunQueryOrderByField = original.RunQueryOrderByFieldActivityRunStart + RunQueryOrderByFieldPipelineName RunQueryOrderByField = original.RunQueryOrderByFieldPipelineName + RunQueryOrderByFieldRunEnd RunQueryOrderByField = original.RunQueryOrderByFieldRunEnd + RunQueryOrderByFieldRunStart RunQueryOrderByField = original.RunQueryOrderByFieldRunStart + RunQueryOrderByFieldStatus RunQueryOrderByField = original.RunQueryOrderByFieldStatus + RunQueryOrderByFieldTriggerName RunQueryOrderByField = original.RunQueryOrderByFieldTriggerName + RunQueryOrderByFieldTriggerRunTimestamp RunQueryOrderByField = original.RunQueryOrderByFieldTriggerRunTimestamp +) + type SalesforceSinkWriteBehavior = original.SalesforceSinkWriteBehavior const ( @@ -714,6 +726,14 @@ const ( TypeTextFormat TypeBasicDatasetStorageFormat = original.TypeTextFormat ) +type TypeBasicFactoryRepoConfiguration = original.TypeBasicFactoryRepoConfiguration + +const ( + TypeFactoryGithubConfiguration TypeBasicFactoryRepoConfiguration = original.TypeFactoryGithubConfiguration + TypeFactoryRepoConfiguration TypeBasicFactoryRepoConfiguration = original.TypeFactoryRepoConfiguration + TypeFactoryVSTSConfiguration TypeBasicFactoryRepoConfiguration = original.TypeFactoryVSTSConfiguration +) + type TypeBasicIntegrationRuntime = original.TypeBasicIntegrationRuntime const ( @@ -809,6 +829,7 @@ const ( type TypeBasicTrigger = original.TypeBasicTrigger const ( + TypeBlobEventsTrigger TypeBasicTrigger = original.TypeBlobEventsTrigger TypeBlobTrigger TypeBasicTrigger = original.TypeBlobTrigger TypeMultiplePipelineTrigger TypeBasicTrigger = original.TypeMultiplePipelineTrigger TypeScheduleTrigger TypeBasicTrigger = original.TypeScheduleTrigger @@ -830,9 +851,7 @@ type Activity = original.Activity type ActivityDependency = original.ActivityDependency type ActivityPolicy = original.ActivityPolicy type ActivityRun = original.ActivityRun -type ActivityRunsListResponse = original.ActivityRunsListResponse -type ActivityRunsListResponseIterator = original.ActivityRunsListResponseIterator -type ActivityRunsListResponsePage = original.ActivityRunsListResponsePage +type ActivityRunsQueryResponse = original.ActivityRunsQueryResponse type AmazonMWSLinkedService = original.AmazonMWSLinkedService type AmazonMWSLinkedServiceTypeProperties = original.AmazonMWSLinkedServiceTypeProperties type AmazonMWSObjectDataset = original.AmazonMWSObjectDataset @@ -898,6 +917,8 @@ type AzureTableDataset = original.AzureTableDataset type AzureTableDatasetTypeProperties = original.AzureTableDatasetTypeProperties type AzureTableSink = original.AzureTableSink type AzureTableSource = original.AzureTableSource +type BlobEventsTrigger = original.BlobEventsTrigger +type BlobEventsTriggerTypeProperties = original.BlobEventsTriggerTypeProperties type BlobSink = original.BlobSink type BlobSource = original.BlobSource type BlobTrigger = original.BlobTrigger @@ -907,6 +928,8 @@ type CassandraLinkedServiceTypeProperties = original.CassandraLinkedServiceTypeP type CassandraSource = original.CassandraSource type CassandraTableDataset = original.CassandraTableDataset type CassandraTableDatasetTypeProperties = original.CassandraTableDatasetTypeProperties +type CloudError = original.CloudError +type CloudErrorBody = original.CloudErrorBody type ConcurLinkedService = original.ConcurLinkedService type ConcurLinkedServiceTypeProperties = original.ConcurLinkedServiceTypeProperties type ConcurObjectDataset = original.ConcurObjectDataset @@ -973,7 +996,6 @@ type EloquaLinkedService = original.EloquaLinkedService type EloquaLinkedServiceTypeProperties = original.EloquaLinkedServiceTypeProperties type EloquaObjectDataset = original.EloquaObjectDataset type EloquaSource = original.EloquaSource -type ErrorResponse = original.ErrorResponse type ExecutePipelineActivity = original.ExecutePipelineActivity type ExecutePipelineActivityTypeProperties = original.ExecutePipelineActivityTypeProperties type ExecuteSSISPackageActivity = original.ExecuteSSISPackageActivity @@ -982,11 +1004,14 @@ type BasicExecutionActivity = original.BasicExecutionActivity type ExecutionActivity = original.ExecutionActivity type Expression = original.Expression type Factory = original.Factory +type FactoryGitHubConfiguration = original.FactoryGitHubConfiguration type FactoryIdentity = original.FactoryIdentity type FactoryListResponse = original.FactoryListResponse type FactoryListResponseIterator = original.FactoryListResponseIterator type FactoryListResponsePage = original.FactoryListResponsePage type FactoryProperties = original.FactoryProperties +type BasicFactoryRepoConfiguration = original.BasicFactoryRepoConfiguration +type FactoryRepoConfiguration = original.FactoryRepoConfiguration type FactoryRepoUpdate = original.FactoryRepoUpdate type FactoryUpdateParameters = original.FactoryUpdateParameters type FactoryVSTSConfiguration = original.FactoryVSTSConfiguration @@ -1066,7 +1091,6 @@ type IntegrationRuntimeNodeIPAddress = original.IntegrationRuntimeNodeIPAddress type IntegrationRuntimeNodeMonitoringData = original.IntegrationRuntimeNodeMonitoringData type IntegrationRuntimeReference = original.IntegrationRuntimeReference type IntegrationRuntimeRegenerateKeyParameters = original.IntegrationRuntimeRegenerateKeyParameters -type IntegrationRuntimeRemoveNodeRequest = original.IntegrationRuntimeRemoveNodeRequest type IntegrationRuntimeResource = original.IntegrationRuntimeResource type IntegrationRuntimeSsisCatalogInfo = original.IntegrationRuntimeSsisCatalogInfo type IntegrationRuntimeSsisProperties = original.IntegrationRuntimeSsisProperties @@ -1082,12 +1106,6 @@ type JiraLinkedServiceTypeProperties = original.JiraLinkedServiceTypeProperties type JiraObjectDataset = original.JiraObjectDataset type JiraSource = original.JiraSource type JSONFormat = original.JSONFormat -type LinkedIntegrationRuntime = original.LinkedIntegrationRuntime -type LinkedIntegrationRuntimeKey = original.LinkedIntegrationRuntimeKey -type BasicLinkedIntegrationRuntimeProperties = original.BasicLinkedIntegrationRuntimeProperties -type LinkedIntegrationRuntimeProperties = original.LinkedIntegrationRuntimeProperties -type LinkedIntegrationRuntimeRbac = original.LinkedIntegrationRuntimeRbac -type LinkedIntegrationRuntimeTypeProperties = original.LinkedIntegrationRuntimeTypeProperties type BasicLinkedService = original.BasicLinkedService type LinkedService = original.LinkedService type LinkedServiceListResponse = original.LinkedServiceListResponse @@ -1139,8 +1157,11 @@ type OdbcSink = original.OdbcSink type Operation = original.Operation type OperationDisplay = original.OperationDisplay type OperationListResponse = original.OperationListResponse +type OperationListResponseIterator = original.OperationListResponseIterator +type OperationListResponsePage = original.OperationListResponsePage type OperationLogSpecification = original.OperationLogSpecification type OperationMetricAvailability = original.OperationMetricAvailability +type OperationMetricDimension = original.OperationMetricDimension type OperationMetricSpecification = original.OperationMetricSpecification type OperationProperties = original.OperationProperties type OperationServiceSpecification = original.OperationServiceSpecification @@ -1168,11 +1189,8 @@ type PipelineListResponsePage = original.PipelineListResponsePage type PipelineReference = original.PipelineReference type PipelineResource = original.PipelineResource type PipelineRun = original.PipelineRun -type PipelineRunFilterParameters = original.PipelineRunFilterParameters type PipelineRunInvokedBy = original.PipelineRunInvokedBy -type PipelineRunQueryFilter = original.PipelineRunQueryFilter -type PipelineRunQueryOrderBy = original.PipelineRunQueryOrderBy -type PipelineRunQueryResponse = original.PipelineRunQueryResponse +type PipelineRunsQueryResponse = original.PipelineRunsQueryResponse type PolybaseSettings = original.PolybaseSettings type PostgreSQLLinkedService = original.PostgreSQLLinkedService type PostgreSQLLinkedServiceTypeProperties = original.PostgreSQLLinkedServiceTypeProperties @@ -1197,6 +1215,9 @@ type ResponsysLinkedServiceTypeProperties = original.ResponsysLinkedServiceTypeP type ResponsysObjectDataset = original.ResponsysObjectDataset type ResponsysSource = original.ResponsysSource type RetryPolicy = original.RetryPolicy +type RunFilterParameters = original.RunFilterParameters +type RunQueryFilter = original.RunQueryFilter +type RunQueryOrderBy = original.RunQueryOrderBy type SalesforceLinkedService = original.SalesforceLinkedService type SalesforceLinkedServiceTypeProperties = original.SalesforceLinkedServiceTypeProperties type SalesforceMarketingCloudLinkedService = original.SalesforceMarketingCloudLinkedService @@ -1280,9 +1301,7 @@ type TriggerListResponsePage = original.TriggerListResponsePage type TriggerPipelineReference = original.TriggerPipelineReference type TriggerResource = original.TriggerResource type TriggerRun = original.TriggerRun -type TriggerRunListResponse = original.TriggerRunListResponse -type TriggerRunListResponseIterator = original.TriggerRunListResponseIterator -type TriggerRunListResponsePage = original.TriggerRunListResponsePage +type TriggerRunsQueryResponse = original.TriggerRunsQueryResponse type TriggersStartFuture = original.TriggersStartFuture type TriggersStopFuture = original.TriggersStopFuture type TumblingWindowTrigger = original.TumblingWindowTrigger @@ -1320,6 +1339,7 @@ type ZohoSource = original.ZohoSource type OperationsClient = original.OperationsClient type PipelineRunsClient = original.PipelineRunsClient type PipelinesClient = original.PipelinesClient +type TriggerRunsClient = original.TriggerRunsClient type TriggersClient = original.TriggersClient func NewActivityRunsClient(subscriptionID string) ActivityRunsClient { @@ -1367,12 +1387,12 @@ func NewLinkedServicesClientWithBaseURI(baseURI string, subscriptionID string) L func PossibleAuthenticationTypeValues() []AuthenticationType { return original.PossibleAuthenticationTypeValues() } -func PossibleAuthorizationTypeValues() []AuthorizationType { - return original.PossibleAuthorizationTypeValues() -} func PossibleAzureSearchIndexWriteBehaviorTypeValues() []AzureSearchIndexWriteBehaviorType { return original.PossibleAzureSearchIndexWriteBehaviorTypeValues() } +func PossibleBlobEventTypesValues() []BlobEventTypes { + return original.PossibleBlobEventTypesValues() +} func PossibleCassandraSourceReadConsistencyLevelsValues() []CassandraSourceReadConsistencyLevels { return original.PossibleCassandraSourceReadConsistencyLevelsValues() } @@ -1466,18 +1486,6 @@ func PossibleParameterTypeValues() []ParameterType { func PossiblePhoenixAuthenticationTypeValues() []PhoenixAuthenticationType { return original.PossiblePhoenixAuthenticationTypeValues() } -func PossiblePipelineRunQueryFilterOperandValues() []PipelineRunQueryFilterOperand { - return original.PossiblePipelineRunQueryFilterOperandValues() -} -func PossiblePipelineRunQueryFilterOperatorValues() []PipelineRunQueryFilterOperator { - return original.PossiblePipelineRunQueryFilterOperatorValues() -} -func PossiblePipelineRunQueryOrderValues() []PipelineRunQueryOrder { - return original.PossiblePipelineRunQueryOrderValues() -} -func PossiblePipelineRunQueryOrderByFieldValues() []PipelineRunQueryOrderByField { - return original.PossiblePipelineRunQueryOrderByFieldValues() -} func PossiblePolybaseSettingsRejectTypeValues() []PolybaseSettingsRejectType { return original.PossiblePolybaseSettingsRejectTypeValues() } @@ -1487,6 +1495,18 @@ func PossiblePrestoAuthenticationTypeValues() []PrestoAuthenticationType { func PossibleRecurrenceFrequencyValues() []RecurrenceFrequency { return original.PossibleRecurrenceFrequencyValues() } +func PossibleRunQueryFilterOperandValues() []RunQueryFilterOperand { + return original.PossibleRunQueryFilterOperandValues() +} +func PossibleRunQueryFilterOperatorValues() []RunQueryFilterOperator { + return original.PossibleRunQueryFilterOperatorValues() +} +func PossibleRunQueryOrderValues() []RunQueryOrder { + return original.PossibleRunQueryOrderValues() +} +func PossibleRunQueryOrderByFieldValues() []RunQueryOrderByField { + return original.PossibleRunQueryOrderByFieldValues() +} func PossibleSalesforceSinkWriteBehaviorValues() []SalesforceSinkWriteBehavior { return original.PossibleSalesforceSinkWriteBehaviorValues() } @@ -1562,6 +1582,9 @@ func PossibleTypeBasicDatasetCompressionValues() []TypeBasicDatasetCompression { func PossibleTypeBasicDatasetStorageFormatValues() []TypeBasicDatasetStorageFormat { return original.PossibleTypeBasicDatasetStorageFormatValues() } +func PossibleTypeBasicFactoryRepoConfigurationValues() []TypeBasicFactoryRepoConfiguration { + return original.PossibleTypeBasicFactoryRepoConfigurationValues() +} func PossibleTypeBasicIntegrationRuntimeValues() []TypeBasicIntegrationRuntime { return original.PossibleTypeBasicIntegrationRuntimeValues() } @@ -1595,6 +1618,12 @@ func NewPipelinesClient(subscriptionID string) PipelinesClient { func NewPipelinesClientWithBaseURI(baseURI string, subscriptionID string) PipelinesClient { return original.NewPipelinesClientWithBaseURI(baseURI, subscriptionID) } +func NewTriggerRunsClient(subscriptionID string) TriggerRunsClient { + return original.NewTriggerRunsClient(subscriptionID) +} +func NewTriggerRunsClientWithBaseURI(baseURI string, subscriptionID string) TriggerRunsClient { + return original.NewTriggerRunsClientWithBaseURI(baseURI, subscriptionID) +} func NewTriggersClient(subscriptionID string) TriggersClient { return original.NewTriggersClient(subscriptionID) } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/keyvault/mgmt/keyvault/models.go b/vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/keyvault/mgmt/keyvault/models.go index 37dff205d..8b276ba8c 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/keyvault/mgmt/keyvault/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/keyvault/mgmt/keyvault/models.go @@ -19,7 +19,7 @@ package keyvault -import original "github.com/Azure/azure-sdk-for-go/services/keyvault/mgmt/2016-10-01/keyvault" +import original "github.com/Azure/azure-sdk-for-go/services/keyvault/mgmt/2018-02-14/keyvault" const ( DefaultBaseURI = original.DefaultBaseURI @@ -37,6 +37,7 @@ const ( type CertificatePermissions = original.CertificatePermissions const ( + Backup CertificatePermissions = original.Backup Create CertificatePermissions = original.Create Delete CertificatePermissions = original.Delete Deleteissuers CertificatePermissions = original.Deleteissuers @@ -49,6 +50,7 @@ const ( Manageissuers CertificatePermissions = original.Manageissuers Purge CertificatePermissions = original.Purge Recover CertificatePermissions = original.Recover + Restore CertificatePermissions = original.Restore Setissuers CertificatePermissions = original.Setissuers Update CertificatePermissions = original.Update ) @@ -81,6 +83,20 @@ const ( KeyPermissionsWrapKey KeyPermissions = original.KeyPermissionsWrapKey ) +type NetworkRuleAction = original.NetworkRuleAction + +const ( + Allow NetworkRuleAction = original.Allow + Deny NetworkRuleAction = original.Deny +) + +type NetworkRuleBypassOptions = original.NetworkRuleBypassOptions + +const ( + AzureServices NetworkRuleBypassOptions = original.AzureServices + None NetworkRuleBypassOptions = original.None +) + type Reason = original.Reason const ( @@ -134,7 +150,9 @@ type DeletedVaultListResult = original.DeletedVaultListResult type DeletedVaultListResultIterator = original.DeletedVaultListResultIterator type DeletedVaultListResultPage = original.DeletedVaultListResultPage type DeletedVaultProperties = original.DeletedVaultProperties +type IPRule = original.IPRule type LogSpecification = original.LogSpecification +type NetworkRuleSet = original.NetworkRuleSet type Operation = original.Operation type OperationDisplay = original.OperationDisplay type OperationListResult = original.OperationListResult @@ -159,7 +177,9 @@ type VaultListResultPage = original.VaultListResultPage type VaultPatchParameters = original.VaultPatchParameters type VaultPatchProperties = original.VaultPatchProperties type VaultProperties = original.VaultProperties +type VaultsCreateOrUpdateFuture = original.VaultsCreateOrUpdateFuture type VaultsPurgeDeletedFuture = original.VaultsPurgeDeletedFuture +type VirtualNetworkRule = original.VirtualNetworkRule type OperationsClient = original.OperationsClient type VaultsClient = original.VaultsClient @@ -181,6 +201,12 @@ func PossibleCreateModeValues() []CreateMode { func PossibleKeyPermissionsValues() []KeyPermissions { return original.PossibleKeyPermissionsValues() } +func PossibleNetworkRuleActionValues() []NetworkRuleAction { + return original.PossibleNetworkRuleActionValues() +} +func PossibleNetworkRuleBypassOptionsValues() []NetworkRuleBypassOptions { + return original.PossibleNetworkRuleBypassOptionsValues() +} func PossibleReasonValues() []Reason { return original.PossibleReasonValues() } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/network/mgmt/network/models.go b/vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/network/mgmt/network/models.go index 1c80f0297..6126902f1 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/network/mgmt/network/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/network/mgmt/network/models.go @@ -522,8 +522,9 @@ const ( type ProbeProtocol = original.ProbeProtocol const ( - ProbeProtocolHTTP ProbeProtocol = original.ProbeProtocolHTTP - ProbeProtocolTCP ProbeProtocol = original.ProbeProtocolTCP + ProbeProtocolHTTP ProbeProtocol = original.ProbeProtocolHTTP + ProbeProtocolHTTPS ProbeProtocol = original.ProbeProtocolHTTPS + ProbeProtocolTCP ProbeProtocol = original.ProbeProtocolTCP ) type ProcessorArchitecture = original.ProcessorArchitecture diff --git a/vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/notificationhubs/mgmt/notificationhubs/models.go b/vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/notificationhubs/mgmt/notificationhubs/models.go index 3e8fbef3a..092647046 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/notificationhubs/mgmt/notificationhubs/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/notificationhubs/mgmt/notificationhubs/models.go @@ -58,6 +58,8 @@ type BaiduCredentialProperties = original.BaiduCredentialProperties type CheckAvailabilityParameters = original.CheckAvailabilityParameters type CheckAvailabilityResult = original.CheckAvailabilityResult type CreateOrUpdateParameters = original.CreateOrUpdateParameters +type DebugSendResponse = original.DebugSendResponse +type DebugSendResult = original.DebugSendResult type ErrorResponse = original.ErrorResponse type GcmCredential = original.GcmCredential type GcmCredentialProperties = original.GcmCredentialProperties @@ -79,6 +81,7 @@ type OperationDisplay = original.OperationDisplay type OperationListResult = original.OperationListResult type OperationListResultIterator = original.OperationListResultIterator type OperationListResultPage = original.OperationListResultPage +type PatchParameters = original.PatchParameters type PnsCredentialsProperties = original.PnsCredentialsProperties type PnsCredentialsResource = original.PnsCredentialsResource type PolicykeyResource = original.PolicykeyResource diff --git a/vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/preview/apimanagement/mgmt/apimanagement/models.go b/vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/preview/apimanagement/mgmt/apimanagement/models.go index 963e7c98f..ded96192f 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/preview/apimanagement/mgmt/apimanagement/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/preview/apimanagement/mgmt/apimanagement/models.go @@ -19,11 +19,10 @@ package apimanagement -import original "github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-01-01/apimanagement" +import original "github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement" type APIClient = original.APIClient type APIDiagnosticClient = original.APIDiagnosticClient -type APIDiagnosticLoggerClient = original.APIDiagnosticLoggerClient type APIExportClient = original.APIExportClient type APIIssueClient = original.APIIssueClient type APIIssueAttachmentClient = original.APIIssueAttachmentClient @@ -47,12 +46,17 @@ const ( type BaseClient = original.BaseClient type DelegationSettingsClient = original.DelegationSettingsClient type DiagnosticClient = original.DiagnosticClient -type DiagnosticLoggerClient = original.DiagnosticLoggerClient type EmailTemplateClient = original.EmailTemplateClient type GroupClient = original.GroupClient type GroupUserClient = original.GroupUserClient type IdentityProviderClient = original.IdentityProviderClient type LoggerClient = original.LoggerClient +type AlwaysLog = original.AlwaysLog + +const ( + AllErrors AlwaysLog = original.AllErrors +) + type APIType = original.APIType const ( @@ -241,6 +245,12 @@ const ( ProtocolHTTPS Protocol = original.ProtocolHTTPS ) +type SamplingType = original.SamplingType + +const ( + Fixed SamplingType = original.Fixed +) + type SkuType = original.SkuType const ( @@ -398,6 +408,7 @@ type BackendServiceFabricClusterProperties = original.BackendServiceFabricCluste type BackendTLSProperties = original.BackendTLSProperties type BackendUpdateParameterProperties = original.BackendUpdateParameterProperties type BackendUpdateParameters = original.BackendUpdateParameters +type BodyDiagnosticSettings = original.BodyDiagnosticSettings type CertificateCollection = original.CertificateCollection type CertificateCollectionIterator = original.CertificateCollectionIterator type CertificateCollectionPage = original.CertificateCollectionPage @@ -437,6 +448,7 @@ type GroupUpdateParameters = original.GroupUpdateParameters type GroupUpdateParametersProperties = original.GroupUpdateParametersProperties type HostnameConfiguration = original.HostnameConfiguration type HostnameConfigurationOld = original.HostnameConfigurationOld +type HTTPMessageDiagnostic = original.HTTPMessageDiagnostic type IdentityProviderBaseParameters = original.IdentityProviderBaseParameters type IdentityProviderContract = original.IdentityProviderContract type IdentityProviderContractProperties = original.IdentityProviderContractProperties @@ -500,6 +512,7 @@ type OperationTagResourceContractProperties = original.OperationTagResourceContr type OperationUpdateContract = original.OperationUpdateContract type OperationUpdateContractProperties = original.OperationUpdateContractProperties type ParameterContract = original.ParameterContract +type PipelineDiagnosticSettings = original.PipelineDiagnosticSettings type PolicyCollection = original.PolicyCollection type PolicyContract = original.PolicyContract type PolicyContractProperties = original.PolicyContractProperties @@ -554,6 +567,7 @@ type RequestReportCollection = original.RequestReportCollection type RequestReportRecordContract = original.RequestReportRecordContract type Resource = original.Resource type ResponseContract = original.ResponseContract +type SamplingSettings = original.SamplingSettings type SaveConfigurationParameter = original.SaveConfigurationParameter type SchemaCollection = original.SchemaCollection type SchemaCollectionIterator = original.SchemaCollectionIterator @@ -683,12 +697,6 @@ func NewAPIDiagnosticClient(subscriptionID string) APIDiagnosticClient { func NewAPIDiagnosticClientWithBaseURI(baseURI string, subscriptionID string) APIDiagnosticClient { return original.NewAPIDiagnosticClientWithBaseURI(baseURI, subscriptionID) } -func NewAPIDiagnosticLoggerClient(subscriptionID string) APIDiagnosticLoggerClient { - return original.NewAPIDiagnosticLoggerClient(subscriptionID) -} -func NewAPIDiagnosticLoggerClientWithBaseURI(baseURI string, subscriptionID string) APIDiagnosticLoggerClient { - return original.NewAPIDiagnosticLoggerClientWithBaseURI(baseURI, subscriptionID) -} func NewAPIExportClient(subscriptionID string) APIExportClient { return original.NewAPIExportClient(subscriptionID) } @@ -797,12 +805,6 @@ func NewDiagnosticClient(subscriptionID string) DiagnosticClient { func NewDiagnosticClientWithBaseURI(baseURI string, subscriptionID string) DiagnosticClient { return original.NewDiagnosticClientWithBaseURI(baseURI, subscriptionID) } -func NewDiagnosticLoggerClient(subscriptionID string) DiagnosticLoggerClient { - return original.NewDiagnosticLoggerClient(subscriptionID) -} -func NewDiagnosticLoggerClientWithBaseURI(baseURI string, subscriptionID string) DiagnosticLoggerClient { - return original.NewDiagnosticLoggerClientWithBaseURI(baseURI, subscriptionID) -} func NewEmailTemplateClient(subscriptionID string) EmailTemplateClient { return original.NewEmailTemplateClient(subscriptionID) } @@ -833,6 +835,9 @@ func NewLoggerClient(subscriptionID string) LoggerClient { func NewLoggerClientWithBaseURI(baseURI string, subscriptionID string) LoggerClient { return original.NewLoggerClientWithBaseURI(baseURI, subscriptionID) } +func PossibleAlwaysLogValues() []AlwaysLog { + return original.PossibleAlwaysLogValues() +} func PossibleAPITypeValues() []APIType { return original.PossibleAPITypeValues() } @@ -899,6 +904,9 @@ func PossibleProductStateValues() []ProductState { func PossibleProtocolValues() []Protocol { return original.PossibleProtocolValues() } +func PossibleSamplingTypeValues() []SamplingType { + return original.PossibleSamplingTypeValues() +} func PossibleSkuTypeValues() []SkuType { return original.PossibleSkuTypeValues() } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/preview/automation/mgmt/automation/models.go b/vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/preview/automation/mgmt/automation/models.go new file mode 100644 index 000000000..2412359c8 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/preview/automation/mgmt/automation/models.go @@ -0,0 +1,915 @@ +// +build go1.9 + +// Copyright 2018 Microsoft Corporation +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// This code was auto-generated by: +// github.com/Azure/azure-sdk-for-go/tools/profileBuilder + +package automation + +import original "github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation" + +type AccountClient = original.AccountClient +type ActivityClient = original.ActivityClient +type AgentRegistrationInformationClient = original.AgentRegistrationInformationClient +type CertificateClient = original.CertificateClient + +const ( + DefaultBaseURI = original.DefaultBaseURI +) + +type BaseClient = original.BaseClient +type ConnectionClient = original.ConnectionClient +type ConnectionTypeClient = original.ConnectionTypeClient +type CredentialClient = original.CredentialClient +type DscCompilationJobClient = original.DscCompilationJobClient +type DscCompilationJobStreamClient = original.DscCompilationJobStreamClient +type DscConfigurationClient = original.DscConfigurationClient +type DscNodeClient = original.DscNodeClient +type DscNodeConfigurationClient = original.DscNodeConfigurationClient +type FieldsClient = original.FieldsClient +type HybridRunbookWorkerGroupClient = original.HybridRunbookWorkerGroupClient +type JobClient = original.JobClient +type JobScheduleClient = original.JobScheduleClient +type JobStreamClient = original.JobStreamClient +type KeysClient = original.KeysClient +type LinkedWorkspaceClient = original.LinkedWorkspaceClient +type AccountState = original.AccountState + +const ( + Ok AccountState = original.Ok + Suspended AccountState = original.Suspended + Unavailable AccountState = original.Unavailable +) + +type AgentRegistrationKeyName = original.AgentRegistrationKeyName + +const ( + Primary AgentRegistrationKeyName = original.Primary + Secondary AgentRegistrationKeyName = original.Secondary +) + +type ContentSourceType = original.ContentSourceType + +const ( + EmbeddedContent ContentSourceType = original.EmbeddedContent + URI ContentSourceType = original.URI +) + +type DscConfigurationProvisioningState = original.DscConfigurationProvisioningState + +const ( + Succeeded DscConfigurationProvisioningState = original.Succeeded +) + +type DscConfigurationState = original.DscConfigurationState + +const ( + DscConfigurationStateEdit DscConfigurationState = original.DscConfigurationStateEdit + DscConfigurationStateNew DscConfigurationState = original.DscConfigurationStateNew + DscConfigurationStatePublished DscConfigurationState = original.DscConfigurationStatePublished +) + +type GroupTypeEnum = original.GroupTypeEnum + +const ( + System GroupTypeEnum = original.System + User GroupTypeEnum = original.User +) + +type HTTPStatusCode = original.HTTPStatusCode + +const ( + Accepted HTTPStatusCode = original.Accepted + Ambiguous HTTPStatusCode = original.Ambiguous + BadGateway HTTPStatusCode = original.BadGateway + BadRequest HTTPStatusCode = original.BadRequest + Conflict HTTPStatusCode = original.Conflict + Continue HTTPStatusCode = original.Continue + Created HTTPStatusCode = original.Created + ExpectationFailed HTTPStatusCode = original.ExpectationFailed + Forbidden HTTPStatusCode = original.Forbidden + Found HTTPStatusCode = original.Found + GatewayTimeout HTTPStatusCode = original.GatewayTimeout + Gone HTTPStatusCode = original.Gone + HTTPVersionNotSupported HTTPStatusCode = original.HTTPVersionNotSupported + InternalServerError HTTPStatusCode = original.InternalServerError + LengthRequired HTTPStatusCode = original.LengthRequired + MethodNotAllowed HTTPStatusCode = original.MethodNotAllowed + Moved HTTPStatusCode = original.Moved + MovedPermanently HTTPStatusCode = original.MovedPermanently + MultipleChoices HTTPStatusCode = original.MultipleChoices + NoContent HTTPStatusCode = original.NoContent + NonAuthoritativeInformation HTTPStatusCode = original.NonAuthoritativeInformation + NotAcceptable HTTPStatusCode = original.NotAcceptable + NotFound HTTPStatusCode = original.NotFound + NotImplemented HTTPStatusCode = original.NotImplemented + NotModified HTTPStatusCode = original.NotModified + OK HTTPStatusCode = original.OK + PartialContent HTTPStatusCode = original.PartialContent + PaymentRequired HTTPStatusCode = original.PaymentRequired + PreconditionFailed HTTPStatusCode = original.PreconditionFailed + ProxyAuthenticationRequired HTTPStatusCode = original.ProxyAuthenticationRequired + Redirect HTTPStatusCode = original.Redirect + RedirectKeepVerb HTTPStatusCode = original.RedirectKeepVerb + RedirectMethod HTTPStatusCode = original.RedirectMethod + RequestedRangeNotSatisfiable HTTPStatusCode = original.RequestedRangeNotSatisfiable + RequestEntityTooLarge HTTPStatusCode = original.RequestEntityTooLarge + RequestTimeout HTTPStatusCode = original.RequestTimeout + RequestURITooLong HTTPStatusCode = original.RequestURITooLong + ResetContent HTTPStatusCode = original.ResetContent + SeeOther HTTPStatusCode = original.SeeOther + ServiceUnavailable HTTPStatusCode = original.ServiceUnavailable + SwitchingProtocols HTTPStatusCode = original.SwitchingProtocols + TemporaryRedirect HTTPStatusCode = original.TemporaryRedirect + Unauthorized HTTPStatusCode = original.Unauthorized + UnsupportedMediaType HTTPStatusCode = original.UnsupportedMediaType + Unused HTTPStatusCode = original.Unused + UpgradeRequired HTTPStatusCode = original.UpgradeRequired + UseProxy HTTPStatusCode = original.UseProxy +) + +type JobProvisioningState = original.JobProvisioningState + +const ( + JobProvisioningStateFailed JobProvisioningState = original.JobProvisioningStateFailed + JobProvisioningStateProcessing JobProvisioningState = original.JobProvisioningStateProcessing + JobProvisioningStateSucceeded JobProvisioningState = original.JobProvisioningStateSucceeded + JobProvisioningStateSuspended JobProvisioningState = original.JobProvisioningStateSuspended +) + +type JobStatus = original.JobStatus + +const ( + JobStatusActivating JobStatus = original.JobStatusActivating + JobStatusBlocked JobStatus = original.JobStatusBlocked + JobStatusCompleted JobStatus = original.JobStatusCompleted + JobStatusDisconnected JobStatus = original.JobStatusDisconnected + JobStatusFailed JobStatus = original.JobStatusFailed + JobStatusNew JobStatus = original.JobStatusNew + JobStatusRemoving JobStatus = original.JobStatusRemoving + JobStatusResuming JobStatus = original.JobStatusResuming + JobStatusRunning JobStatus = original.JobStatusRunning + JobStatusStopped JobStatus = original.JobStatusStopped + JobStatusStopping JobStatus = original.JobStatusStopping + JobStatusSuspended JobStatus = original.JobStatusSuspended + JobStatusSuspending JobStatus = original.JobStatusSuspending +) + +type JobStreamType = original.JobStreamType + +const ( + Any JobStreamType = original.Any + Debug JobStreamType = original.Debug + Error JobStreamType = original.Error + Output JobStreamType = original.Output + Progress JobStreamType = original.Progress + Verbose JobStreamType = original.Verbose + Warning JobStreamType = original.Warning +) + +type KeyName = original.KeyName + +const ( + KeyNamePrimary KeyName = original.KeyNamePrimary + KeyNameSecondary KeyName = original.KeyNameSecondary +) + +type KeyPermissions = original.KeyPermissions + +const ( + Full KeyPermissions = original.Full + Read KeyPermissions = original.Read +) + +type LinuxUpdateClasses = original.LinuxUpdateClasses + +const ( + Critical LinuxUpdateClasses = original.Critical + Other LinuxUpdateClasses = original.Other + Security LinuxUpdateClasses = original.Security + Unclassified LinuxUpdateClasses = original.Unclassified +) + +type ModuleProvisioningState = original.ModuleProvisioningState + +const ( + ModuleProvisioningStateActivitiesStored ModuleProvisioningState = original.ModuleProvisioningStateActivitiesStored + ModuleProvisioningStateCancelled ModuleProvisioningState = original.ModuleProvisioningStateCancelled + ModuleProvisioningStateConnectionTypeImported ModuleProvisioningState = original.ModuleProvisioningStateConnectionTypeImported + ModuleProvisioningStateContentDownloaded ModuleProvisioningState = original.ModuleProvisioningStateContentDownloaded + ModuleProvisioningStateContentRetrieved ModuleProvisioningState = original.ModuleProvisioningStateContentRetrieved + ModuleProvisioningStateContentStored ModuleProvisioningState = original.ModuleProvisioningStateContentStored + ModuleProvisioningStateContentValidated ModuleProvisioningState = original.ModuleProvisioningStateContentValidated + ModuleProvisioningStateCreated ModuleProvisioningState = original.ModuleProvisioningStateCreated + ModuleProvisioningStateCreating ModuleProvisioningState = original.ModuleProvisioningStateCreating + ModuleProvisioningStateFailed ModuleProvisioningState = original.ModuleProvisioningStateFailed + ModuleProvisioningStateModuleDataStored ModuleProvisioningState = original.ModuleProvisioningStateModuleDataStored + ModuleProvisioningStateModuleImportRunbookComplete ModuleProvisioningState = original.ModuleProvisioningStateModuleImportRunbookComplete + ModuleProvisioningStateRunningImportModuleRunbook ModuleProvisioningState = original.ModuleProvisioningStateRunningImportModuleRunbook + ModuleProvisioningStateStartingImportModuleRunbook ModuleProvisioningState = original.ModuleProvisioningStateStartingImportModuleRunbook + ModuleProvisioningStateSucceeded ModuleProvisioningState = original.ModuleProvisioningStateSucceeded + ModuleProvisioningStateUpdating ModuleProvisioningState = original.ModuleProvisioningStateUpdating +) + +type OperatingSystemType = original.OperatingSystemType + +const ( + Linux OperatingSystemType = original.Linux + Windows OperatingSystemType = original.Windows +) + +type ProvisioningState = original.ProvisioningState + +const ( + Completed ProvisioningState = original.Completed + Failed ProvisioningState = original.Failed + Running ProvisioningState = original.Running +) + +type RunbookProvisioningState = original.RunbookProvisioningState + +const ( + RunbookProvisioningStateSucceeded RunbookProvisioningState = original.RunbookProvisioningStateSucceeded +) + +type RunbookState = original.RunbookState + +const ( + RunbookStateEdit RunbookState = original.RunbookStateEdit + RunbookStateNew RunbookState = original.RunbookStateNew + RunbookStatePublished RunbookState = original.RunbookStatePublished +) + +type RunbookTypeEnum = original.RunbookTypeEnum + +const ( + Graph RunbookTypeEnum = original.Graph + GraphPowerShell RunbookTypeEnum = original.GraphPowerShell + GraphPowerShellWorkflow RunbookTypeEnum = original.GraphPowerShellWorkflow + PowerShell RunbookTypeEnum = original.PowerShell + PowerShellWorkflow RunbookTypeEnum = original.PowerShellWorkflow + Script RunbookTypeEnum = original.Script +) + +type ScheduleDay = original.ScheduleDay + +const ( + Friday ScheduleDay = original.Friday + Monday ScheduleDay = original.Monday + Saturday ScheduleDay = original.Saturday + Sunday ScheduleDay = original.Sunday + Thursday ScheduleDay = original.Thursday + Tuesday ScheduleDay = original.Tuesday + Wednesday ScheduleDay = original.Wednesday +) + +type ScheduleFrequency = original.ScheduleFrequency + +const ( + Day ScheduleFrequency = original.Day + Hour ScheduleFrequency = original.Hour + Month ScheduleFrequency = original.Month + OneTime ScheduleFrequency = original.OneTime + Week ScheduleFrequency = original.Week +) + +type SkuNameEnum = original.SkuNameEnum + +const ( + Basic SkuNameEnum = original.Basic + Free SkuNameEnum = original.Free +) + +type SourceType = original.SourceType + +const ( + GitHub SourceType = original.GitHub + VsoGit SourceType = original.VsoGit + VsoTfvc SourceType = original.VsoTfvc +) + +type StartType = original.StartType + +const ( + AutoSync StartType = original.AutoSync + ManualSync StartType = original.ManualSync +) + +type StreamType = original.StreamType + +const ( + StreamTypeError StreamType = original.StreamTypeError + StreamTypeOutput StreamType = original.StreamTypeOutput +) + +type WindowsUpdateClasses = original.WindowsUpdateClasses + +const ( + WindowsUpdateClassesCritical WindowsUpdateClasses = original.WindowsUpdateClassesCritical + WindowsUpdateClassesDefinition WindowsUpdateClasses = original.WindowsUpdateClassesDefinition + WindowsUpdateClassesFeaturePack WindowsUpdateClasses = original.WindowsUpdateClassesFeaturePack + WindowsUpdateClassesSecurity WindowsUpdateClasses = original.WindowsUpdateClassesSecurity + WindowsUpdateClassesServicePack WindowsUpdateClasses = original.WindowsUpdateClassesServicePack + WindowsUpdateClassesTools WindowsUpdateClasses = original.WindowsUpdateClassesTools + WindowsUpdateClassesUnclassified WindowsUpdateClasses = original.WindowsUpdateClassesUnclassified + WindowsUpdateClassesUpdateRollup WindowsUpdateClasses = original.WindowsUpdateClassesUpdateRollup + WindowsUpdateClassesUpdates WindowsUpdateClasses = original.WindowsUpdateClassesUpdates +) + +type Account = original.Account +type AccountCreateOrUpdateParameters = original.AccountCreateOrUpdateParameters +type AccountCreateOrUpdateProperties = original.AccountCreateOrUpdateProperties +type AccountListResult = original.AccountListResult +type AccountListResultIterator = original.AccountListResultIterator +type AccountListResultPage = original.AccountListResultPage +type AccountProperties = original.AccountProperties +type AccountUpdateParameters = original.AccountUpdateParameters +type AccountUpdateProperties = original.AccountUpdateProperties +type Activity = original.Activity +type ActivityListResult = original.ActivityListResult +type ActivityListResultIterator = original.ActivityListResultIterator +type ActivityListResultPage = original.ActivityListResultPage +type ActivityOutputType = original.ActivityOutputType +type ActivityParameter = original.ActivityParameter +type ActivityParameterSet = original.ActivityParameterSet +type ActivityParameterValidationSet = original.ActivityParameterValidationSet +type ActivityProperties = original.ActivityProperties +type AdvancedSchedule = original.AdvancedSchedule +type AdvancedScheduleMonthlyOccurrence = original.AdvancedScheduleMonthlyOccurrence +type AgentRegistration = original.AgentRegistration +type AgentRegistrationKeys = original.AgentRegistrationKeys +type AgentRegistrationRegenerateKeyParameter = original.AgentRegistrationRegenerateKeyParameter +type Certificate = original.Certificate +type CertificateCreateOrUpdateParameters = original.CertificateCreateOrUpdateParameters +type CertificateCreateOrUpdateProperties = original.CertificateCreateOrUpdateProperties +type CertificateListResult = original.CertificateListResult +type CertificateListResultIterator = original.CertificateListResultIterator +type CertificateListResultPage = original.CertificateListResultPage +type CertificateProperties = original.CertificateProperties +type CertificateUpdateParameters = original.CertificateUpdateParameters +type CertificateUpdateProperties = original.CertificateUpdateProperties +type CollectionItemUpdateConfiguration = original.CollectionItemUpdateConfiguration +type Connection = original.Connection +type ConnectionCreateOrUpdateParameters = original.ConnectionCreateOrUpdateParameters +type ConnectionCreateOrUpdateProperties = original.ConnectionCreateOrUpdateProperties +type ConnectionListResult = original.ConnectionListResult +type ConnectionListResultIterator = original.ConnectionListResultIterator +type ConnectionListResultPage = original.ConnectionListResultPage +type ConnectionProperties = original.ConnectionProperties +type ConnectionType = original.ConnectionType +type ConnectionTypeAssociationProperty = original.ConnectionTypeAssociationProperty +type ConnectionTypeCreateOrUpdateParameters = original.ConnectionTypeCreateOrUpdateParameters +type ConnectionTypeCreateOrUpdateProperties = original.ConnectionTypeCreateOrUpdateProperties +type ConnectionTypeListResult = original.ConnectionTypeListResult +type ConnectionTypeListResultIterator = original.ConnectionTypeListResultIterator +type ConnectionTypeListResultPage = original.ConnectionTypeListResultPage +type ConnectionTypeProperties = original.ConnectionTypeProperties +type ConnectionUpdateParameters = original.ConnectionUpdateParameters +type ConnectionUpdateProperties = original.ConnectionUpdateProperties +type ContentHash = original.ContentHash +type ContentLink = original.ContentLink +type ContentSource = original.ContentSource +type Credential = original.Credential +type CredentialCreateOrUpdateParameters = original.CredentialCreateOrUpdateParameters +type CredentialCreateOrUpdateProperties = original.CredentialCreateOrUpdateProperties +type CredentialListResult = original.CredentialListResult +type CredentialListResultIterator = original.CredentialListResultIterator +type CredentialListResultPage = original.CredentialListResultPage +type CredentialProperties = original.CredentialProperties +type CredentialUpdateParameters = original.CredentialUpdateParameters +type CredentialUpdateProperties = original.CredentialUpdateProperties +type DscCompilationJob = original.DscCompilationJob +type DscCompilationJobCreateParameters = original.DscCompilationJobCreateParameters +type DscCompilationJobCreateProperties = original.DscCompilationJobCreateProperties +type DscCompilationJobListResult = original.DscCompilationJobListResult +type DscCompilationJobListResultIterator = original.DscCompilationJobListResultIterator +type DscCompilationJobListResultPage = original.DscCompilationJobListResultPage +type DscCompilationJobProperties = original.DscCompilationJobProperties +type DscConfiguration = original.DscConfiguration +type DscConfigurationAssociationProperty = original.DscConfigurationAssociationProperty +type DscConfigurationCreateOrUpdateParameters = original.DscConfigurationCreateOrUpdateParameters +type DscConfigurationCreateOrUpdateProperties = original.DscConfigurationCreateOrUpdateProperties +type DscConfigurationListResult = original.DscConfigurationListResult +type DscConfigurationListResultIterator = original.DscConfigurationListResultIterator +type DscConfigurationListResultPage = original.DscConfigurationListResultPage +type DscConfigurationParameter = original.DscConfigurationParameter +type DscConfigurationProperties = original.DscConfigurationProperties +type DscConfigurationUpdateParameters = original.DscConfigurationUpdateParameters +type DscMetaConfiguration = original.DscMetaConfiguration +type DscNode = original.DscNode +type DscNodeConfiguration = original.DscNodeConfiguration +type DscNodeConfigurationAssociationProperty = original.DscNodeConfigurationAssociationProperty +type DscNodeConfigurationCreateOrUpdateParameters = original.DscNodeConfigurationCreateOrUpdateParameters +type DscNodeConfigurationListResult = original.DscNodeConfigurationListResult +type DscNodeConfigurationListResultIterator = original.DscNodeConfigurationListResultIterator +type DscNodeConfigurationListResultPage = original.DscNodeConfigurationListResultPage +type DscNodeExtensionHandlerAssociationProperty = original.DscNodeExtensionHandlerAssociationProperty +type DscNodeListResult = original.DscNodeListResult +type DscNodeListResultIterator = original.DscNodeListResultIterator +type DscNodeListResultPage = original.DscNodeListResultPage +type DscNodeReport = original.DscNodeReport +type DscNodeReportListResult = original.DscNodeReportListResult +type DscNodeReportListResultIterator = original.DscNodeReportListResultIterator +type DscNodeReportListResultPage = original.DscNodeReportListResultPage +type DscNodeUpdateParameters = original.DscNodeUpdateParameters +type DscReportError = original.DscReportError +type DscReportResource = original.DscReportResource +type DscReportResourceNavigation = original.DscReportResourceNavigation +type ErrorResponse = original.ErrorResponse +type FieldDefinition = original.FieldDefinition +type HybridRunbookWorker = original.HybridRunbookWorker +type HybridRunbookWorkerGroup = original.HybridRunbookWorkerGroup +type HybridRunbookWorkerGroupsListResult = original.HybridRunbookWorkerGroupsListResult +type HybridRunbookWorkerGroupsListResultIterator = original.HybridRunbookWorkerGroupsListResultIterator +type HybridRunbookWorkerGroupsListResultPage = original.HybridRunbookWorkerGroupsListResultPage +type HybridRunbookWorkerGroupUpdateParameters = original.HybridRunbookWorkerGroupUpdateParameters +type Job = original.Job +type JobCollectionItem = original.JobCollectionItem +type JobCollectionItemProperties = original.JobCollectionItemProperties +type JobCreateParameters = original.JobCreateParameters +type JobCreateProperties = original.JobCreateProperties +type JobListResultV2 = original.JobListResultV2 +type JobListResultV2Iterator = original.JobListResultV2Iterator +type JobListResultV2Page = original.JobListResultV2Page +type JobNavigation = original.JobNavigation +type JobProperties = original.JobProperties +type JobSchedule = original.JobSchedule +type JobScheduleCreateParameters = original.JobScheduleCreateParameters +type JobScheduleCreateProperties = original.JobScheduleCreateProperties +type JobScheduleListResult = original.JobScheduleListResult +type JobScheduleListResultIterator = original.JobScheduleListResultIterator +type JobScheduleListResultPage = original.JobScheduleListResultPage +type JobScheduleProperties = original.JobScheduleProperties +type JobStream = original.JobStream +type JobStreamListResult = original.JobStreamListResult +type JobStreamListResultIterator = original.JobStreamListResultIterator +type JobStreamListResultPage = original.JobStreamListResultPage +type JobStreamProperties = original.JobStreamProperties +type Key = original.Key +type KeyListResult = original.KeyListResult +type LinkedWorkspace = original.LinkedWorkspace +type LinuxProperties = original.LinuxProperties +type Module = original.Module +type ModuleCreateOrUpdateParameters = original.ModuleCreateOrUpdateParameters +type ModuleCreateOrUpdateProperties = original.ModuleCreateOrUpdateProperties +type ModuleErrorInfo = original.ModuleErrorInfo +type ModuleListResult = original.ModuleListResult +type ModuleListResultIterator = original.ModuleListResultIterator +type ModuleListResultPage = original.ModuleListResultPage +type ModuleProperties = original.ModuleProperties +type ModuleUpdateParameters = original.ModuleUpdateParameters +type ModuleUpdateProperties = original.ModuleUpdateProperties +type Operation = original.Operation +type OperationDisplay = original.OperationDisplay +type OperationListResult = original.OperationListResult +type ProxyResource = original.ProxyResource +type Resource = original.Resource +type RunAsCredentialAssociationProperty = original.RunAsCredentialAssociationProperty +type Runbook = original.Runbook +type RunbookAssociationProperty = original.RunbookAssociationProperty +type RunbookCreateOrUpdateDraftParameters = original.RunbookCreateOrUpdateDraftParameters +type RunbookCreateOrUpdateDraftProperties = original.RunbookCreateOrUpdateDraftProperties +type RunbookCreateOrUpdateParameters = original.RunbookCreateOrUpdateParameters +type RunbookCreateOrUpdateProperties = original.RunbookCreateOrUpdateProperties +type RunbookDraft = original.RunbookDraft +type RunbookDraftPublishFuture = original.RunbookDraftPublishFuture +type RunbookDraftReplaceContentFuture = original.RunbookDraftReplaceContentFuture +type RunbookDraftUndoEditResult = original.RunbookDraftUndoEditResult +type RunbookListResult = original.RunbookListResult +type RunbookListResultIterator = original.RunbookListResultIterator +type RunbookListResultPage = original.RunbookListResultPage +type RunbookParameter = original.RunbookParameter +type RunbookProperties = original.RunbookProperties +type RunbookUpdateParameters = original.RunbookUpdateParameters +type RunbookUpdateProperties = original.RunbookUpdateProperties +type Schedule = original.Schedule +type ScheduleAssociationProperty = original.ScheduleAssociationProperty +type ScheduleCreateOrUpdateParameters = original.ScheduleCreateOrUpdateParameters +type ScheduleCreateOrUpdateProperties = original.ScheduleCreateOrUpdateProperties +type ScheduleListResult = original.ScheduleListResult +type ScheduleListResultIterator = original.ScheduleListResultIterator +type ScheduleListResultPage = original.ScheduleListResultPage +type ScheduleProperties = original.ScheduleProperties +type ScheduleUpdateParameters = original.ScheduleUpdateParameters +type ScheduleUpdateProperties = original.ScheduleUpdateProperties +type SetObject = original.SetObject +type Sku = original.Sku +type SoftwareUpdateConfiguration = original.SoftwareUpdateConfiguration +type SoftwareUpdateConfigurationCollectionItem = original.SoftwareUpdateConfigurationCollectionItem +type SoftwareUpdateConfigurationCollectionItemProperties = original.SoftwareUpdateConfigurationCollectionItemProperties +type SoftwareUpdateConfigurationListResult = original.SoftwareUpdateConfigurationListResult +type SoftwareUpdateConfigurationMachineRun = original.SoftwareUpdateConfigurationMachineRun +type SoftwareUpdateConfigurationMachineRunListResult = original.SoftwareUpdateConfigurationMachineRunListResult +type SoftwareUpdateConfigurationProperties = original.SoftwareUpdateConfigurationProperties +type SoftwareUpdateConfigurationRun = original.SoftwareUpdateConfigurationRun +type SoftwareUpdateConfigurationRunListResult = original.SoftwareUpdateConfigurationRunListResult +type SoftwareUpdateConfigurationRunProperties = original.SoftwareUpdateConfigurationRunProperties +type SourceControl = original.SourceControl +type SourceControlCreateOrUpdateParameters = original.SourceControlCreateOrUpdateParameters +type SourceControlCreateOrUpdateProperties = original.SourceControlCreateOrUpdateProperties +type SourceControlListResult = original.SourceControlListResult +type SourceControlListResultIterator = original.SourceControlListResultIterator +type SourceControlListResultPage = original.SourceControlListResultPage +type SourceControlProperties = original.SourceControlProperties +type SourceControlSyncJob = original.SourceControlSyncJob +type SourceControlSyncJobByID = original.SourceControlSyncJobByID +type SourceControlSyncJobByIDProperties = original.SourceControlSyncJobByIDProperties +type SourceControlSyncJobCreateParameters = original.SourceControlSyncJobCreateParameters +type SourceControlSyncJobCreateProperties = original.SourceControlSyncJobCreateProperties +type SourceControlSyncJobListResult = original.SourceControlSyncJobListResult +type SourceControlSyncJobListResultIterator = original.SourceControlSyncJobListResultIterator +type SourceControlSyncJobListResultPage = original.SourceControlSyncJobListResultPage +type SourceControlSyncJobProperties = original.SourceControlSyncJobProperties +type SourceControlSyncJobStream = original.SourceControlSyncJobStream +type SourceControlSyncJobStreamByID = original.SourceControlSyncJobStreamByID +type SourceControlSyncJobStreamByIDProperties = original.SourceControlSyncJobStreamByIDProperties +type SourceControlSyncJobStreamProperties = original.SourceControlSyncJobStreamProperties +type SourceControlSyncJobStreamsListBySyncJob = original.SourceControlSyncJobStreamsListBySyncJob +type SourceControlSyncJobStreamsListBySyncJobIterator = original.SourceControlSyncJobStreamsListBySyncJobIterator +type SourceControlSyncJobStreamsListBySyncJobPage = original.SourceControlSyncJobStreamsListBySyncJobPage +type SourceControlUpdateParameters = original.SourceControlUpdateParameters +type SourceControlUpdateProperties = original.SourceControlUpdateProperties +type Statistics = original.Statistics +type StatisticsListResult = original.StatisticsListResult +type String = original.String +type TestJob = original.TestJob +type TestJobCreateParameters = original.TestJobCreateParameters +type TrackedResource = original.TrackedResource +type TypeField = original.TypeField +type TypeFieldListResult = original.TypeFieldListResult +type UpdateConfiguration = original.UpdateConfiguration +type UpdateConfigurationMachineRunProperties = original.UpdateConfigurationMachineRunProperties +type UpdateConfigurationNavigation = original.UpdateConfigurationNavigation +type Usage = original.Usage +type UsageCounterName = original.UsageCounterName +type UsageListResult = original.UsageListResult +type Variable = original.Variable +type VariableCreateOrUpdateParameters = original.VariableCreateOrUpdateParameters +type VariableCreateOrUpdateProperties = original.VariableCreateOrUpdateProperties +type VariableListResult = original.VariableListResult +type VariableListResultIterator = original.VariableListResultIterator +type VariableListResultPage = original.VariableListResultPage +type VariableProperties = original.VariableProperties +type VariableUpdateParameters = original.VariableUpdateParameters +type VariableUpdateProperties = original.VariableUpdateProperties +type Webhook = original.Webhook +type WebhookCreateOrUpdateParameters = original.WebhookCreateOrUpdateParameters +type WebhookCreateOrUpdateProperties = original.WebhookCreateOrUpdateProperties +type WebhookListResult = original.WebhookListResult +type WebhookListResultIterator = original.WebhookListResultIterator +type WebhookListResultPage = original.WebhookListResultPage +type WebhookProperties = original.WebhookProperties +type WebhookUpdateParameters = original.WebhookUpdateParameters +type WebhookUpdateProperties = original.WebhookUpdateProperties +type WindowsProperties = original.WindowsProperties +type ModuleClient = original.ModuleClient +type NodeReportsClient = original.NodeReportsClient +type ObjectDataTypesClient = original.ObjectDataTypesClient +type OperationsClient = original.OperationsClient +type RunbookClient = original.RunbookClient +type RunbookDraftClient = original.RunbookDraftClient +type ScheduleClient = original.ScheduleClient +type SoftwareUpdateConfigurationMachineRunsClient = original.SoftwareUpdateConfigurationMachineRunsClient +type SoftwareUpdateConfigurationRunsClient = original.SoftwareUpdateConfigurationRunsClient +type SoftwareUpdateConfigurationsClient = original.SoftwareUpdateConfigurationsClient +type SourceControlClient = original.SourceControlClient +type SourceControlSyncJobClient = original.SourceControlSyncJobClient +type SourceControlSyncJobStreamsClient = original.SourceControlSyncJobStreamsClient +type StatisticsClient = original.StatisticsClient +type TestJobClient = original.TestJobClient +type TestJobStreamsClient = original.TestJobStreamsClient +type UsagesClient = original.UsagesClient +type VariableClient = original.VariableClient +type WebhookClient = original.WebhookClient + +func NewAccountClient(subscriptionID string) AccountClient { + return original.NewAccountClient(subscriptionID) +} +func NewAccountClientWithBaseURI(baseURI string, subscriptionID string) AccountClient { + return original.NewAccountClientWithBaseURI(baseURI, subscriptionID) +} +func NewActivityClient(subscriptionID string) ActivityClient { + return original.NewActivityClient(subscriptionID) +} +func NewActivityClientWithBaseURI(baseURI string, subscriptionID string) ActivityClient { + return original.NewActivityClientWithBaseURI(baseURI, subscriptionID) +} +func NewAgentRegistrationInformationClient(subscriptionID string) AgentRegistrationInformationClient { + return original.NewAgentRegistrationInformationClient(subscriptionID) +} +func NewAgentRegistrationInformationClientWithBaseURI(baseURI string, subscriptionID string) AgentRegistrationInformationClient { + return original.NewAgentRegistrationInformationClientWithBaseURI(baseURI, subscriptionID) +} +func NewCertificateClient(subscriptionID string) CertificateClient { + return original.NewCertificateClient(subscriptionID) +} +func NewCertificateClientWithBaseURI(baseURI string, subscriptionID string) CertificateClient { + return original.NewCertificateClientWithBaseURI(baseURI, subscriptionID) +} +func New(subscriptionID string) BaseClient { + return original.New(subscriptionID) +} +func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { + return original.NewWithBaseURI(baseURI, subscriptionID) +} +func NewConnectionClient(subscriptionID string) ConnectionClient { + return original.NewConnectionClient(subscriptionID) +} +func NewConnectionClientWithBaseURI(baseURI string, subscriptionID string) ConnectionClient { + return original.NewConnectionClientWithBaseURI(baseURI, subscriptionID) +} +func NewConnectionTypeClient(subscriptionID string) ConnectionTypeClient { + return original.NewConnectionTypeClient(subscriptionID) +} +func NewConnectionTypeClientWithBaseURI(baseURI string, subscriptionID string) ConnectionTypeClient { + return original.NewConnectionTypeClientWithBaseURI(baseURI, subscriptionID) +} +func NewCredentialClient(subscriptionID string) CredentialClient { + return original.NewCredentialClient(subscriptionID) +} +func NewCredentialClientWithBaseURI(baseURI string, subscriptionID string) CredentialClient { + return original.NewCredentialClientWithBaseURI(baseURI, subscriptionID) +} +func NewDscCompilationJobClient(subscriptionID string) DscCompilationJobClient { + return original.NewDscCompilationJobClient(subscriptionID) +} +func NewDscCompilationJobClientWithBaseURI(baseURI string, subscriptionID string) DscCompilationJobClient { + return original.NewDscCompilationJobClientWithBaseURI(baseURI, subscriptionID) +} +func NewDscCompilationJobStreamClient(subscriptionID string) DscCompilationJobStreamClient { + return original.NewDscCompilationJobStreamClient(subscriptionID) +} +func NewDscCompilationJobStreamClientWithBaseURI(baseURI string, subscriptionID string) DscCompilationJobStreamClient { + return original.NewDscCompilationJobStreamClientWithBaseURI(baseURI, subscriptionID) +} +func NewDscConfigurationClient(subscriptionID string) DscConfigurationClient { + return original.NewDscConfigurationClient(subscriptionID) +} +func NewDscConfigurationClientWithBaseURI(baseURI string, subscriptionID string) DscConfigurationClient { + return original.NewDscConfigurationClientWithBaseURI(baseURI, subscriptionID) +} +func NewDscNodeClient(subscriptionID string) DscNodeClient { + return original.NewDscNodeClient(subscriptionID) +} +func NewDscNodeClientWithBaseURI(baseURI string, subscriptionID string) DscNodeClient { + return original.NewDscNodeClientWithBaseURI(baseURI, subscriptionID) +} +func NewDscNodeConfigurationClient(subscriptionID string) DscNodeConfigurationClient { + return original.NewDscNodeConfigurationClient(subscriptionID) +} +func NewDscNodeConfigurationClientWithBaseURI(baseURI string, subscriptionID string) DscNodeConfigurationClient { + return original.NewDscNodeConfigurationClientWithBaseURI(baseURI, subscriptionID) +} +func NewFieldsClient(subscriptionID string) FieldsClient { + return original.NewFieldsClient(subscriptionID) +} +func NewFieldsClientWithBaseURI(baseURI string, subscriptionID string) FieldsClient { + return original.NewFieldsClientWithBaseURI(baseURI, subscriptionID) +} +func NewHybridRunbookWorkerGroupClient(subscriptionID string) HybridRunbookWorkerGroupClient { + return original.NewHybridRunbookWorkerGroupClient(subscriptionID) +} +func NewHybridRunbookWorkerGroupClientWithBaseURI(baseURI string, subscriptionID string) HybridRunbookWorkerGroupClient { + return original.NewHybridRunbookWorkerGroupClientWithBaseURI(baseURI, subscriptionID) +} +func NewJobClient(subscriptionID string) JobClient { + return original.NewJobClient(subscriptionID) +} +func NewJobClientWithBaseURI(baseURI string, subscriptionID string) JobClient { + return original.NewJobClientWithBaseURI(baseURI, subscriptionID) +} +func NewJobScheduleClient(subscriptionID string) JobScheduleClient { + return original.NewJobScheduleClient(subscriptionID) +} +func NewJobScheduleClientWithBaseURI(baseURI string, subscriptionID string) JobScheduleClient { + return original.NewJobScheduleClientWithBaseURI(baseURI, subscriptionID) +} +func NewJobStreamClient(subscriptionID string) JobStreamClient { + return original.NewJobStreamClient(subscriptionID) +} +func NewJobStreamClientWithBaseURI(baseURI string, subscriptionID string) JobStreamClient { + return original.NewJobStreamClientWithBaseURI(baseURI, subscriptionID) +} +func NewKeysClient(subscriptionID string) KeysClient { + return original.NewKeysClient(subscriptionID) +} +func NewKeysClientWithBaseURI(baseURI string, subscriptionID string) KeysClient { + return original.NewKeysClientWithBaseURI(baseURI, subscriptionID) +} +func NewLinkedWorkspaceClient(subscriptionID string) LinkedWorkspaceClient { + return original.NewLinkedWorkspaceClient(subscriptionID) +} +func NewLinkedWorkspaceClientWithBaseURI(baseURI string, subscriptionID string) LinkedWorkspaceClient { + return original.NewLinkedWorkspaceClientWithBaseURI(baseURI, subscriptionID) +} +func PossibleAccountStateValues() []AccountState { + return original.PossibleAccountStateValues() +} +func PossibleAgentRegistrationKeyNameValues() []AgentRegistrationKeyName { + return original.PossibleAgentRegistrationKeyNameValues() +} +func PossibleContentSourceTypeValues() []ContentSourceType { + return original.PossibleContentSourceTypeValues() +} +func PossibleDscConfigurationProvisioningStateValues() []DscConfigurationProvisioningState { + return original.PossibleDscConfigurationProvisioningStateValues() +} +func PossibleDscConfigurationStateValues() []DscConfigurationState { + return original.PossibleDscConfigurationStateValues() +} +func PossibleGroupTypeEnumValues() []GroupTypeEnum { + return original.PossibleGroupTypeEnumValues() +} +func PossibleHTTPStatusCodeValues() []HTTPStatusCode { + return original.PossibleHTTPStatusCodeValues() +} +func PossibleJobProvisioningStateValues() []JobProvisioningState { + return original.PossibleJobProvisioningStateValues() +} +func PossibleJobStatusValues() []JobStatus { + return original.PossibleJobStatusValues() +} +func PossibleJobStreamTypeValues() []JobStreamType { + return original.PossibleJobStreamTypeValues() +} +func PossibleKeyNameValues() []KeyName { + return original.PossibleKeyNameValues() +} +func PossibleKeyPermissionsValues() []KeyPermissions { + return original.PossibleKeyPermissionsValues() +} +func PossibleLinuxUpdateClassesValues() []LinuxUpdateClasses { + return original.PossibleLinuxUpdateClassesValues() +} +func PossibleModuleProvisioningStateValues() []ModuleProvisioningState { + return original.PossibleModuleProvisioningStateValues() +} +func PossibleOperatingSystemTypeValues() []OperatingSystemType { + return original.PossibleOperatingSystemTypeValues() +} +func PossibleProvisioningStateValues() []ProvisioningState { + return original.PossibleProvisioningStateValues() +} +func PossibleRunbookProvisioningStateValues() []RunbookProvisioningState { + return original.PossibleRunbookProvisioningStateValues() +} +func PossibleRunbookStateValues() []RunbookState { + return original.PossibleRunbookStateValues() +} +func PossibleRunbookTypeEnumValues() []RunbookTypeEnum { + return original.PossibleRunbookTypeEnumValues() +} +func PossibleScheduleDayValues() []ScheduleDay { + return original.PossibleScheduleDayValues() +} +func PossibleScheduleFrequencyValues() []ScheduleFrequency { + return original.PossibleScheduleFrequencyValues() +} +func PossibleSkuNameEnumValues() []SkuNameEnum { + return original.PossibleSkuNameEnumValues() +} +func PossibleSourceTypeValues() []SourceType { + return original.PossibleSourceTypeValues() +} +func PossibleStartTypeValues() []StartType { + return original.PossibleStartTypeValues() +} +func PossibleStreamTypeValues() []StreamType { + return original.PossibleStreamTypeValues() +} +func PossibleWindowsUpdateClassesValues() []WindowsUpdateClasses { + return original.PossibleWindowsUpdateClassesValues() +} +func NewModuleClient(subscriptionID string) ModuleClient { + return original.NewModuleClient(subscriptionID) +} +func NewModuleClientWithBaseURI(baseURI string, subscriptionID string) ModuleClient { + return original.NewModuleClientWithBaseURI(baseURI, subscriptionID) +} +func NewNodeReportsClient(subscriptionID string) NodeReportsClient { + return original.NewNodeReportsClient(subscriptionID) +} +func NewNodeReportsClientWithBaseURI(baseURI string, subscriptionID string) NodeReportsClient { + return original.NewNodeReportsClientWithBaseURI(baseURI, subscriptionID) +} +func NewObjectDataTypesClient(subscriptionID string) ObjectDataTypesClient { + return original.NewObjectDataTypesClient(subscriptionID) +} +func NewObjectDataTypesClientWithBaseURI(baseURI string, subscriptionID string) ObjectDataTypesClient { + return original.NewObjectDataTypesClientWithBaseURI(baseURI, subscriptionID) +} +func NewOperationsClient(subscriptionID string) OperationsClient { + return original.NewOperationsClient(subscriptionID) +} +func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient { + return original.NewOperationsClientWithBaseURI(baseURI, subscriptionID) +} +func NewRunbookClient(subscriptionID string) RunbookClient { + return original.NewRunbookClient(subscriptionID) +} +func NewRunbookClientWithBaseURI(baseURI string, subscriptionID string) RunbookClient { + return original.NewRunbookClientWithBaseURI(baseURI, subscriptionID) +} +func NewRunbookDraftClient(subscriptionID string) RunbookDraftClient { + return original.NewRunbookDraftClient(subscriptionID) +} +func NewRunbookDraftClientWithBaseURI(baseURI string, subscriptionID string) RunbookDraftClient { + return original.NewRunbookDraftClientWithBaseURI(baseURI, subscriptionID) +} +func NewScheduleClient(subscriptionID string) ScheduleClient { + return original.NewScheduleClient(subscriptionID) +} +func NewScheduleClientWithBaseURI(baseURI string, subscriptionID string) ScheduleClient { + return original.NewScheduleClientWithBaseURI(baseURI, subscriptionID) +} +func NewSoftwareUpdateConfigurationMachineRunsClient(subscriptionID string) SoftwareUpdateConfigurationMachineRunsClient { + return original.NewSoftwareUpdateConfigurationMachineRunsClient(subscriptionID) +} +func NewSoftwareUpdateConfigurationMachineRunsClientWithBaseURI(baseURI string, subscriptionID string) SoftwareUpdateConfigurationMachineRunsClient { + return original.NewSoftwareUpdateConfigurationMachineRunsClientWithBaseURI(baseURI, subscriptionID) +} +func NewSoftwareUpdateConfigurationRunsClient(subscriptionID string) SoftwareUpdateConfigurationRunsClient { + return original.NewSoftwareUpdateConfigurationRunsClient(subscriptionID) +} +func NewSoftwareUpdateConfigurationRunsClientWithBaseURI(baseURI string, subscriptionID string) SoftwareUpdateConfigurationRunsClient { + return original.NewSoftwareUpdateConfigurationRunsClientWithBaseURI(baseURI, subscriptionID) +} +func NewSoftwareUpdateConfigurationsClient(subscriptionID string) SoftwareUpdateConfigurationsClient { + return original.NewSoftwareUpdateConfigurationsClient(subscriptionID) +} +func NewSoftwareUpdateConfigurationsClientWithBaseURI(baseURI string, subscriptionID string) SoftwareUpdateConfigurationsClient { + return original.NewSoftwareUpdateConfigurationsClientWithBaseURI(baseURI, subscriptionID) +} +func NewSourceControlClient(subscriptionID string) SourceControlClient { + return original.NewSourceControlClient(subscriptionID) +} +func NewSourceControlClientWithBaseURI(baseURI string, subscriptionID string) SourceControlClient { + return original.NewSourceControlClientWithBaseURI(baseURI, subscriptionID) +} +func NewSourceControlSyncJobClient(subscriptionID string) SourceControlSyncJobClient { + return original.NewSourceControlSyncJobClient(subscriptionID) +} +func NewSourceControlSyncJobClientWithBaseURI(baseURI string, subscriptionID string) SourceControlSyncJobClient { + return original.NewSourceControlSyncJobClientWithBaseURI(baseURI, subscriptionID) +} +func NewSourceControlSyncJobStreamsClient(subscriptionID string) SourceControlSyncJobStreamsClient { + return original.NewSourceControlSyncJobStreamsClient(subscriptionID) +} +func NewSourceControlSyncJobStreamsClientWithBaseURI(baseURI string, subscriptionID string) SourceControlSyncJobStreamsClient { + return original.NewSourceControlSyncJobStreamsClientWithBaseURI(baseURI, subscriptionID) +} +func NewStatisticsClient(subscriptionID string) StatisticsClient { + return original.NewStatisticsClient(subscriptionID) +} +func NewStatisticsClientWithBaseURI(baseURI string, subscriptionID string) StatisticsClient { + return original.NewStatisticsClientWithBaseURI(baseURI, subscriptionID) +} +func NewTestJobClient(subscriptionID string) TestJobClient { + return original.NewTestJobClient(subscriptionID) +} +func NewTestJobClientWithBaseURI(baseURI string, subscriptionID string) TestJobClient { + return original.NewTestJobClientWithBaseURI(baseURI, subscriptionID) +} +func NewTestJobStreamsClient(subscriptionID string) TestJobStreamsClient { + return original.NewTestJobStreamsClient(subscriptionID) +} +func NewTestJobStreamsClientWithBaseURI(baseURI string, subscriptionID string) TestJobStreamsClient { + return original.NewTestJobStreamsClientWithBaseURI(baseURI, subscriptionID) +} +func NewUsagesClient(subscriptionID string) UsagesClient { + return original.NewUsagesClient(subscriptionID) +} +func NewUsagesClientWithBaseURI(baseURI string, subscriptionID string) UsagesClient { + return original.NewUsagesClientWithBaseURI(baseURI, subscriptionID) +} +func NewVariableClient(subscriptionID string) VariableClient { + return original.NewVariableClient(subscriptionID) +} +func NewVariableClientWithBaseURI(baseURI string, subscriptionID string) VariableClient { + return original.NewVariableClientWithBaseURI(baseURI, subscriptionID) +} +func UserAgent() string { + return original.UserAgent() + " profiles/preview" +} +func Version() string { + return original.Version() +} +func NewWebhookClient(subscriptionID string) WebhookClient { + return original.NewWebhookClient(subscriptionID) +} +func NewWebhookClientWithBaseURI(baseURI string, subscriptionID string) WebhookClient { + return original.NewWebhookClientWithBaseURI(baseURI, subscriptionID) +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/preview/devspaces/mgmt/devspaces/models.go b/vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/preview/devspaces/mgmt/devspaces/models.go new file mode 100644 index 000000000..d9198db8f --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/preview/devspaces/mgmt/devspaces/models.go @@ -0,0 +1,111 @@ +// +build go1.9 + +// Copyright 2018 Microsoft Corporation +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// This code was auto-generated by: +// github.com/Azure/azure-sdk-for-go/tools/profileBuilder + +package devspaces + +import original "github.com/Azure/azure-sdk-for-go/services/preview/devspaces/mgmt/2018-06-01-preview/devspaces" + +const ( + DefaultBaseURI = original.DefaultBaseURI +) + +type BaseClient = original.BaseClient +type ControllersClient = original.ControllersClient +type InstanceType = original.InstanceType + +const ( + InstanceTypeKubernetes InstanceType = original.InstanceTypeKubernetes + InstanceTypeOrchestratorSpecificConnectionDetails InstanceType = original.InstanceTypeOrchestratorSpecificConnectionDetails +) + +type ProvisioningState = original.ProvisioningState + +const ( + Canceled ProvisioningState = original.Canceled + Creating ProvisioningState = original.Creating + Deleting ProvisioningState = original.Deleting + Failed ProvisioningState = original.Failed + Succeeded ProvisioningState = original.Succeeded + Updating ProvisioningState = original.Updating +) + +type SkuTier = original.SkuTier + +const ( + Standard SkuTier = original.Standard +) + +type Controller = original.Controller +type ControllerConnectionDetails = original.ControllerConnectionDetails +type ControllerConnectionDetailsList = original.ControllerConnectionDetailsList +type ControllerList = original.ControllerList +type ControllerListIterator = original.ControllerListIterator +type ControllerListPage = original.ControllerListPage +type ControllerProperties = original.ControllerProperties +type ControllersCreateFuture = original.ControllersCreateFuture +type ControllersDeleteFuture = original.ControllersDeleteFuture +type ControllerUpdateParameters = original.ControllerUpdateParameters +type ErrorDetails = original.ErrorDetails +type ErrorResponse = original.ErrorResponse +type KubernetesConnectionDetails = original.KubernetesConnectionDetails +type BasicOrchestratorSpecificConnectionDetails = original.BasicOrchestratorSpecificConnectionDetails +type OrchestratorSpecificConnectionDetails = original.OrchestratorSpecificConnectionDetails +type Resource = original.Resource +type ResourceProviderOperationDefinition = original.ResourceProviderOperationDefinition +type ResourceProviderOperationDisplay = original.ResourceProviderOperationDisplay +type ResourceProviderOperationList = original.ResourceProviderOperationList +type ResourceProviderOperationListIterator = original.ResourceProviderOperationListIterator +type ResourceProviderOperationListPage = original.ResourceProviderOperationListPage +type Sku = original.Sku +type TrackedResource = original.TrackedResource +type OperationsClient = original.OperationsClient + +func New(subscriptionID string) BaseClient { + return original.New(subscriptionID) +} +func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { + return original.NewWithBaseURI(baseURI, subscriptionID) +} +func NewControllersClient(subscriptionID string) ControllersClient { + return original.NewControllersClient(subscriptionID) +} +func NewControllersClientWithBaseURI(baseURI string, subscriptionID string) ControllersClient { + return original.NewControllersClientWithBaseURI(baseURI, subscriptionID) +} +func PossibleInstanceTypeValues() []InstanceType { + return original.PossibleInstanceTypeValues() +} +func PossibleProvisioningStateValues() []ProvisioningState { + return original.PossibleProvisioningStateValues() +} +func PossibleSkuTierValues() []SkuTier { + return original.PossibleSkuTierValues() +} +func NewOperationsClient(subscriptionID string) OperationsClient { + return original.NewOperationsClient(subscriptionID) +} +func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient { + return original.NewOperationsClientWithBaseURI(baseURI, subscriptionID) +} +func UserAgent() string { + return original.UserAgent() + " profiles/preview" +} +func Version() string { + return original.Version() +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/preview/eventhub/mgmt/eventhub/models.go b/vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/preview/eventhub/mgmt/eventhub/models.go index c8d275e49..e79c39819 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/preview/eventhub/mgmt/eventhub/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/preview/eventhub/mgmt/eventhub/models.go @@ -28,6 +28,27 @@ const ( type BaseClient = original.BaseClient type ClustersClient = original.ClustersClient type ConfigurationClient = original.ConfigurationClient +type IPAction = original.IPAction + +const ( + Accept IPAction = original.Accept + Reject IPAction = original.Reject +) + +type SkuName = original.SkuName + +const ( + Basic SkuName = original.Basic + Standard SkuName = original.Standard +) + +type SkuTier = original.SkuTier + +const ( + SkuTierBasic SkuTier = original.SkuTierBasic + SkuTierStandard SkuTier = original.SkuTierStandard +) + type Cluster = original.Cluster type ClusterListResult = original.ClusterListResult type ClusterListResultIterator = original.ClusterListResultIterator @@ -36,14 +57,33 @@ type ClusterProperties = original.ClusterProperties type ClusterQuotaConfigurationProperties = original.ClusterQuotaConfigurationProperties type ClusterSku = original.ClusterSku type ClustersPatchFuture = original.ClustersPatchFuture +type EHNamespace = original.EHNamespace +type EHNamespaceListResult = original.EHNamespaceListResult +type EHNamespaceListResultIterator = original.EHNamespaceListResultIterator +type EHNamespaceListResultPage = original.EHNamespaceListResultPage +type EHNamespaceProperties = original.EHNamespaceProperties type ErrorResponse = original.ErrorResponse +type IPFilterRule = original.IPFilterRule +type IPFilterRuleListResult = original.IPFilterRuleListResult +type IPFilterRuleListResultIterator = original.IPFilterRuleListResultIterator +type IPFilterRuleListResultPage = original.IPFilterRuleListResultPage +type IPFilterRuleProperties = original.IPFilterRuleProperties +type NamespacesCreateOrUpdateFuture = original.NamespacesCreateOrUpdateFuture +type NamespacesDeleteFuture = original.NamespacesDeleteFuture type Operation = original.Operation type OperationDisplay = original.OperationDisplay type OperationListResult = original.OperationListResult type OperationListResultIterator = original.OperationListResultIterator type OperationListResultPage = original.OperationListResultPage type Resource = original.Resource +type Sku = original.Sku type TrackedResource = original.TrackedResource +type VirtualNetworkRule = original.VirtualNetworkRule +type VirtualNetworkRuleListResult = original.VirtualNetworkRuleListResult +type VirtualNetworkRuleListResultIterator = original.VirtualNetworkRuleListResultIterator +type VirtualNetworkRuleListResultPage = original.VirtualNetworkRuleListResultPage +type VirtualNetworkRuleProperties = original.VirtualNetworkRuleProperties +type NamespacesClient = original.NamespacesClient type OperationsClient = original.OperationsClient func New(subscriptionID string) BaseClient { @@ -64,6 +104,21 @@ func NewConfigurationClient(subscriptionID string) ConfigurationClient { func NewConfigurationClientWithBaseURI(baseURI string, subscriptionID string) ConfigurationClient { return original.NewConfigurationClientWithBaseURI(baseURI, subscriptionID) } +func PossibleIPActionValues() []IPAction { + return original.PossibleIPActionValues() +} +func PossibleSkuNameValues() []SkuName { + return original.PossibleSkuNameValues() +} +func PossibleSkuTierValues() []SkuTier { + return original.PossibleSkuTierValues() +} +func NewNamespacesClient(subscriptionID string) NamespacesClient { + return original.NewNamespacesClient(subscriptionID) +} +func NewNamespacesClientWithBaseURI(baseURI string, subscriptionID string) NamespacesClient { + return original.NewNamespacesClientWithBaseURI(baseURI, subscriptionID) +} func NewOperationsClient(subscriptionID string) OperationsClient { return original.NewOperationsClient(subscriptionID) } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/preview/hdinsight/mgmt/hdinsight/models.go b/vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/preview/hdinsight/mgmt/hdinsight/models.go index 57e39fc3d..541895a71 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/preview/hdinsight/mgmt/hdinsight/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/preview/hdinsight/mgmt/hdinsight/models.go @@ -19,7 +19,7 @@ package hdinsight -import original "github.com/Azure/azure-sdk-for-go/services/preview/hdinsight/mgmt/2015-03-01-preview/hdinsight" +import original "github.com/Azure/azure-sdk-for-go/services/preview/hdinsight/mgmt/2018-06-01-preview/hdinsight" type ApplicationsClient = original.ApplicationsClient @@ -30,8 +30,8 @@ const ( type BaseClient = original.BaseClient type ClustersClient = original.ClustersClient type ConfigurationsClient = original.ConfigurationsClient -type ExtensionClient = original.ExtensionClient -type LocationClient = original.LocationClient +type ExtensionsClient = original.ExtensionsClient +type LocationsClient = original.LocationsClient type AsyncOperationState = original.AsyncOperationState const ( @@ -56,13 +56,6 @@ const ( ActiveDirectory DirectoryType = original.ActiveDirectory ) -type EnabledCredential = original.EnabledCredential - -const ( - False EnabledCredential = original.False - True EnabledCredential = original.True -) - type OSType = original.OSType const ( @@ -80,12 +73,12 @@ const ( type Application = original.Application type ApplicationGetEndpoint = original.ApplicationGetEndpoint type ApplicationGetHTTPSEndpoint = original.ApplicationGetHTTPSEndpoint -type ApplicationGetProperties = original.ApplicationGetProperties type ApplicationListResult = original.ApplicationListResult type ApplicationListResultIterator = original.ApplicationListResultIterator type ApplicationListResultPage = original.ApplicationListResultPage +type ApplicationProperties = original.ApplicationProperties +type ApplicationsCreateFuture = original.ApplicationsCreateFuture type ApplicationsDeleteFuture = original.ApplicationsDeleteFuture -type CapabilitiesResult = original.CapabilitiesResult type Cluster = original.Cluster type ClusterCreateParametersExtended = original.ClusterCreateParametersExtended type ClusterCreateProperties = original.ClusterCreateProperties @@ -108,14 +101,17 @@ type ComputeProfile = original.ComputeProfile type ConfigurationsUpdateHTTPSettingsFuture = original.ConfigurationsUpdateHTTPSettingsFuture type ConnectivityEndpoint = original.ConnectivityEndpoint type DataDisksGroups = original.DataDisksGroups +type ErrorResponse = original.ErrorResponse type Errors = original.Errors type ExecuteScriptActionParameters = original.ExecuteScriptActionParameters type Extension = original.Extension -type ExtensionDisableMonitoringFuture = original.ExtensionDisableMonitoringFuture -type ExtensionEnableMonitoringFuture = original.ExtensionEnableMonitoringFuture +type ExtensionsCreateFuture = original.ExtensionsCreateFuture +type ExtensionsDeleteFuture = original.ExtensionsDeleteFuture +type ExtensionsDisableMonitoringFuture = original.ExtensionsDisableMonitoringFuture +type ExtensionsEnableMonitoringFuture = original.ExtensionsEnableMonitoringFuture type HardwareProfile = original.HardwareProfile -type HTTPConnectivitySettings = original.HTTPConnectivitySettings type LinuxOperatingSystemProfile = original.LinuxOperatingSystemProfile +type LocalizedName = original.LocalizedName type Operation = original.Operation type OperationDisplay = original.OperationDisplay type OperationListResult = original.OperationListResult @@ -124,10 +120,7 @@ type OperationListResultPage = original.OperationListResultPage type OperationResource = original.OperationResource type OsProfile = original.OsProfile type ProxyResource = original.ProxyResource -type QuotaCapability = original.QuotaCapability type QuotaInfo = original.QuotaInfo -type RegionalQuotaCapability = original.RegionalQuotaCapability -type RegionsCapability = original.RegionsCapability type Resource = original.Resource type Role = original.Role type RuntimeScriptAction = original.RuntimeScriptAction @@ -148,11 +141,9 @@ type SSHPublicKey = original.SSHPublicKey type StorageAccount = original.StorageAccount type StorageProfile = original.StorageProfile type TrackedResource = original.TrackedResource -type VersionsCapability = original.VersionsCapability -type VersionSpec = original.VersionSpec +type Usage = original.Usage +type UsagesListResult = original.UsagesListResult type VirtualNetworkProfile = original.VirtualNetworkProfile -type VMSizeCompatibilityFilter = original.VMSizeCompatibilityFilter -type VMSizesCapability = original.VMSizesCapability type OperationsClient = original.OperationsClient type ScriptActionsClient = original.ScriptActionsClient type ScriptExecutionHistoryClient = original.ScriptExecutionHistoryClient @@ -181,17 +172,17 @@ func NewConfigurationsClient(subscriptionID string) ConfigurationsClient { func NewConfigurationsClientWithBaseURI(baseURI string, subscriptionID string) ConfigurationsClient { return original.NewConfigurationsClientWithBaseURI(baseURI, subscriptionID) } -func NewExtensionClient(subscriptionID string) ExtensionClient { - return original.NewExtensionClient(subscriptionID) +func NewExtensionsClient(subscriptionID string) ExtensionsClient { + return original.NewExtensionsClient(subscriptionID) } -func NewExtensionClientWithBaseURI(baseURI string, subscriptionID string) ExtensionClient { - return original.NewExtensionClientWithBaseURI(baseURI, subscriptionID) +func NewExtensionsClientWithBaseURI(baseURI string, subscriptionID string) ExtensionsClient { + return original.NewExtensionsClientWithBaseURI(baseURI, subscriptionID) } -func NewLocationClient(subscriptionID string) LocationClient { - return original.NewLocationClient(subscriptionID) +func NewLocationsClient(subscriptionID string) LocationsClient { + return original.NewLocationsClient(subscriptionID) } -func NewLocationClientWithBaseURI(baseURI string, subscriptionID string) LocationClient { - return original.NewLocationClientWithBaseURI(baseURI, subscriptionID) +func NewLocationsClientWithBaseURI(baseURI string, subscriptionID string) LocationsClient { + return original.NewLocationsClientWithBaseURI(baseURI, subscriptionID) } func PossibleAsyncOperationStateValues() []AsyncOperationState { return original.PossibleAsyncOperationStateValues() @@ -202,9 +193,6 @@ func PossibleClusterProvisioningStateValues() []ClusterProvisioningState { func PossibleDirectoryTypeValues() []DirectoryType { return original.PossibleDirectoryTypeValues() } -func PossibleEnabledCredentialValues() []EnabledCredential { - return original.PossibleEnabledCredentialValues() -} func PossibleOSTypeValues() []OSType { return original.PossibleOSTypeValues() } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/preview/iotcentral/mgmt/iotcentral/models.go b/vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/preview/iotcentral/mgmt/iotcentral/models.go index 921bdfa91..7c8b2047a 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/preview/iotcentral/mgmt/iotcentral/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/preview/iotcentral/mgmt/iotcentral/models.go @@ -19,10 +19,7 @@ package iotcentral -import ( - original "github.com/Azure/azure-sdk-for-go/services/preview/iotcentral/mgmt/2017-07-01-privatepreview/iotcentral" - uuid "github.com/satori/go.uuid" -) +import original "github.com/Azure/azure-sdk-for-go/services/preview/iotcentral/mgmt/2017-07-01-privatepreview/iotcentral" type AppsClient = original.AppsClient @@ -66,16 +63,16 @@ type OperationListResultPage = original.OperationListResultPage type Resource = original.Resource type OperationsClient = original.OperationsClient -func NewAppsClient(subscriptionID uuid.UUID) AppsClient { +func NewAppsClient(subscriptionID string) AppsClient { return original.NewAppsClient(subscriptionID) } -func NewAppsClientWithBaseURI(baseURI string, subscriptionID uuid.UUID) AppsClient { +func NewAppsClientWithBaseURI(baseURI string, subscriptionID string) AppsClient { return original.NewAppsClientWithBaseURI(baseURI, subscriptionID) } -func New(subscriptionID uuid.UUID) BaseClient { +func New(subscriptionID string) BaseClient { return original.New(subscriptionID) } -func NewWithBaseURI(baseURI string, subscriptionID uuid.UUID) BaseClient { +func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { return original.NewWithBaseURI(baseURI, subscriptionID) } func PossibleAppNameUnavailabilityReasonValues() []AppNameUnavailabilityReason { @@ -84,10 +81,10 @@ func PossibleAppNameUnavailabilityReasonValues() []AppNameUnavailabilityReason { func PossibleAppSkuValues() []AppSku { return original.PossibleAppSkuValues() } -func NewOperationsClient(subscriptionID uuid.UUID) OperationsClient { +func NewOperationsClient(subscriptionID string) OperationsClient { return original.NewOperationsClient(subscriptionID) } -func NewOperationsClientWithBaseURI(baseURI string, subscriptionID uuid.UUID) OperationsClient { +func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient { return original.NewOperationsClientWithBaseURI(baseURI, subscriptionID) } func UserAgent() string { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/preview/keyvault/keyvault/models.go b/vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/preview/keyvault/keyvault/models.go index 511fe28c6..d47450288 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/preview/keyvault/keyvault/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/preview/keyvault/keyvault/models.go @@ -41,10 +41,10 @@ const ( type JSONWebKeyCurveName = original.JSONWebKeyCurveName const ( - P256 JSONWebKeyCurveName = original.P256 - P384 JSONWebKeyCurveName = original.P384 - P521 JSONWebKeyCurveName = original.P521 - SECP256K1 JSONWebKeyCurveName = original.SECP256K1 + P256 JSONWebKeyCurveName = original.P256 + P256K JSONWebKeyCurveName = original.P256K + P384 JSONWebKeyCurveName = original.P384 + P521 JSONWebKeyCurveName = original.P521 ) type JSONWebKeyEncryptionAlgorithm = original.JSONWebKeyEncryptionAlgorithm @@ -69,17 +69,17 @@ const ( type JSONWebKeySignatureAlgorithm = original.JSONWebKeySignatureAlgorithm const ( - ECDSA256 JSONWebKeySignatureAlgorithm = original.ECDSA256 - ES256 JSONWebKeySignatureAlgorithm = original.ES256 - ES384 JSONWebKeySignatureAlgorithm = original.ES384 - ES512 JSONWebKeySignatureAlgorithm = original.ES512 - PS256 JSONWebKeySignatureAlgorithm = original.PS256 - PS384 JSONWebKeySignatureAlgorithm = original.PS384 - PS512 JSONWebKeySignatureAlgorithm = original.PS512 - RS256 JSONWebKeySignatureAlgorithm = original.RS256 - RS384 JSONWebKeySignatureAlgorithm = original.RS384 - RS512 JSONWebKeySignatureAlgorithm = original.RS512 - RSNULL JSONWebKeySignatureAlgorithm = original.RSNULL + ES256 JSONWebKeySignatureAlgorithm = original.ES256 + ES256K JSONWebKeySignatureAlgorithm = original.ES256K + ES384 JSONWebKeySignatureAlgorithm = original.ES384 + ES512 JSONWebKeySignatureAlgorithm = original.ES512 + PS256 JSONWebKeySignatureAlgorithm = original.PS256 + PS384 JSONWebKeySignatureAlgorithm = original.PS384 + PS512 JSONWebKeySignatureAlgorithm = original.PS512 + RS256 JSONWebKeySignatureAlgorithm = original.RS256 + RS384 JSONWebKeySignatureAlgorithm = original.RS384 + RS512 JSONWebKeySignatureAlgorithm = original.RS512 + RSNULL JSONWebKeySignatureAlgorithm = original.RSNULL ) type JSONWebKeyType = original.JSONWebKeyType @@ -116,6 +116,7 @@ const ( type Action = original.Action type AdministratorDetails = original.AdministratorDetails type Attributes = original.Attributes +type BackupCertificateResult = original.BackupCertificateResult type BackupKeyResult = original.BackupKeyResult type BackupSecretResult = original.BackupSecretResult type BackupStorageResult = original.BackupStorageResult @@ -137,6 +138,7 @@ type CertificateMergeParameters = original.CertificateMergeParameters type CertificateOperation = original.CertificateOperation type CertificateOperationUpdateParameter = original.CertificateOperationUpdateParameter type CertificatePolicy = original.CertificatePolicy +type CertificateRestoreParameters = original.CertificateRestoreParameters type CertificateUpdateParameters = original.CertificateUpdateParameters type Contact = original.Contact type Contacts = original.Contacts diff --git a/vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/preview/mediaservices/mgmt/media/models.go b/vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/preview/mediaservices/mgmt/media/models.go index 79b682b65..a63d502fb 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/preview/mediaservices/mgmt/media/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/preview/mediaservices/mgmt/media/models.go @@ -19,7 +19,7 @@ package media -import original "github.com/Azure/azure-sdk-for-go/services/preview/mediaservices/mgmt/2018-03-30-preview/media" +import original "github.com/Azure/azure-sdk-for-go/services/preview/mediaservices/mgmt/2018-06-01-preview/media" type AssetsClient = original.AssetsClient @@ -607,7 +607,6 @@ type StreamingLocatorCollectionIterator = original.StreamingLocatorCollectionIte type StreamingLocatorCollectionPage = original.StreamingLocatorCollectionPage type StreamingLocatorContentKey = original.StreamingLocatorContentKey type StreamingLocatorProperties = original.StreamingLocatorProperties -type StreamingLocatorUserDefinedContentKey = original.StreamingLocatorUserDefinedContentKey type StreamingPath = original.StreamingPath type StreamingPolicy = original.StreamingPolicy type StreamingPolicyCollection = original.StreamingPolicyCollection diff --git a/vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/preview/monitor/mgmt/insights/models.go b/vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/preview/monitor/mgmt/insights/models.go index 723d85a01..6a7ff0543 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/preview/monitor/mgmt/insights/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/preview/monitor/mgmt/insights/models.go @@ -331,13 +331,16 @@ type ItsmReceiver = original.ItsmReceiver type LocalizableString = original.LocalizableString type LocationThresholdRuleCondition = original.LocationThresholdRuleCondition type LogicAppReceiver = original.LogicAppReceiver +type LogMetricTrigger = original.LogMetricTrigger type LogProfileCollection = original.LogProfileCollection type LogProfileProperties = original.LogProfileProperties type LogProfileResource = original.LogProfileResource type LogProfileResourcePatch = original.LogProfileResourcePatch type LogSearchRule = original.LogSearchRule +type LogSearchRulePatch = original.LogSearchRulePatch type LogSearchRuleResource = original.LogSearchRuleResource type LogSearchRuleResourceCollection = original.LogSearchRuleResourceCollection +type LogSearchRuleResourcePatch = original.LogSearchRuleResourcePatch type LogSettings = original.LogSettings type ManagementEventAggregationCondition = original.ManagementEventAggregationCondition type ManagementEventRuleCondition = original.ManagementEventRuleCondition diff --git a/vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/preview/operationsmanagement/mgmt/operationsmanagement/models.go b/vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/preview/operationsmanagement/mgmt/operationsmanagement/models.go index 58ba57d81..4ebc3221b 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/preview/operationsmanagement/mgmt/operationsmanagement/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/preview/operationsmanagement/mgmt/operationsmanagement/models.go @@ -44,6 +44,8 @@ type Solution = original.Solution type SolutionPlan = original.SolutionPlan type SolutionProperties = original.SolutionProperties type SolutionPropertiesList = original.SolutionPropertiesList +type SolutionsCreateOrUpdateFuture = original.SolutionsCreateOrUpdateFuture +type SolutionsDeleteFuture = original.SolutionsDeleteFuture type OperationsClient = original.OperationsClient type SolutionsClient = original.SolutionsClient diff --git a/vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/preview/signalr/mgmt/signalr/models.go b/vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/preview/signalr/mgmt/signalr/models.go index 81eb080c0..0a13a02e8 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/preview/signalr/mgmt/signalr/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/preview/signalr/mgmt/signalr/models.go @@ -50,9 +50,10 @@ const ( type SkuTier = original.SkuTier const ( - Basic SkuTier = original.Basic - Free SkuTier = original.Free - Premium SkuTier = original.Premium + Basic SkuTier = original.Basic + Free SkuTier = original.Free + Premium SkuTier = original.Premium + Standard SkuTier = original.Standard ) type CreateOrUpdateFuture = original.CreateOrUpdateFuture diff --git a/vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/preview/sql/mgmt/sql/models.go b/vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/preview/sql/mgmt/sql/models.go index 91394b177..2fb66d6ba 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/preview/sql/mgmt/sql/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/preview/sql/mgmt/sql/models.go @@ -35,6 +35,7 @@ type DatabaseVulnerabilityAssessmentScansClient = original.DatabaseVulnerability type ElasticPoolOperationsClient = original.ElasticPoolOperationsClient type ElasticPoolsClient = original.ElasticPoolsClient type InstanceFailoverGroupsClient = original.InstanceFailoverGroupsClient +type ManagedInstanceTdeCertificatesClient = original.ManagedInstanceTdeCertificatesClient type CapabilityGroup = original.CapabilityGroup const ( @@ -211,6 +212,9 @@ const ( type BackupShortTermRetentionPoliciesCreateOrUpdateFuture = original.BackupShortTermRetentionPoliciesCreateOrUpdateFuture type BackupShortTermRetentionPoliciesUpdateFuture = original.BackupShortTermRetentionPoliciesUpdateFuture type BackupShortTermRetentionPolicy = original.BackupShortTermRetentionPolicy +type BackupShortTermRetentionPolicyListResult = original.BackupShortTermRetentionPolicyListResult +type BackupShortTermRetentionPolicyListResultIterator = original.BackupShortTermRetentionPolicyListResultIterator +type BackupShortTermRetentionPolicyListResultPage = original.BackupShortTermRetentionPolicyListResultPage type BackupShortTermRetentionPolicyProperties = original.BackupShortTermRetentionPolicyProperties type Database = original.Database type DatabaseListResult = original.DatabaseListResult @@ -272,6 +276,7 @@ type LogSizeCapability = original.LogSizeCapability type ManagedInstanceEditionCapability = original.ManagedInstanceEditionCapability type ManagedInstanceFamilyCapability = original.ManagedInstanceFamilyCapability type ManagedInstancePairInfo = original.ManagedInstancePairInfo +type ManagedInstanceTdeCertificatesCreateFuture = original.ManagedInstanceTdeCertificatesCreateFuture type ManagedInstanceVcoresCapability = original.ManagedInstanceVcoresCapability type ManagedInstanceVersionCapability = original.ManagedInstanceVersionCapability type MaxSizeCapability = original.MaxSizeCapability @@ -284,6 +289,9 @@ type ResourceMoveDefinition = original.ResourceMoveDefinition type ServerVersionCapability = original.ServerVersionCapability type ServiceObjectiveCapability = original.ServiceObjectiveCapability type Sku = original.Sku +type TdeCertificate = original.TdeCertificate +type TdeCertificateProperties = original.TdeCertificateProperties +type TdeCertificatesCreateFuture = original.TdeCertificatesCreateFuture type TrackedResource = original.TrackedResource type VulnerabilityAssessmentRecurringScansProperties = original.VulnerabilityAssessmentRecurringScansProperties type VulnerabilityAssessmentScanError = original.VulnerabilityAssessmentScanError @@ -292,6 +300,7 @@ type VulnerabilityAssessmentScanRecordListResult = original.VulnerabilityAssessm type VulnerabilityAssessmentScanRecordListResultIterator = original.VulnerabilityAssessmentScanRecordListResultIterator type VulnerabilityAssessmentScanRecordListResultPage = original.VulnerabilityAssessmentScanRecordListResultPage type VulnerabilityAssessmentScanRecordProperties = original.VulnerabilityAssessmentScanRecordProperties +type TdeCertificatesClient = original.TdeCertificatesClient func NewBackupShortTermRetentionPoliciesClient(subscriptionID string) BackupShortTermRetentionPoliciesClient { return original.NewBackupShortTermRetentionPoliciesClient(subscriptionID) @@ -347,6 +356,12 @@ func NewInstanceFailoverGroupsClient(subscriptionID string) InstanceFailoverGrou func NewInstanceFailoverGroupsClientWithBaseURI(baseURI string, subscriptionID string) InstanceFailoverGroupsClient { return original.NewInstanceFailoverGroupsClientWithBaseURI(baseURI, subscriptionID) } +func NewManagedInstanceTdeCertificatesClient(subscriptionID string) ManagedInstanceTdeCertificatesClient { + return original.NewManagedInstanceTdeCertificatesClient(subscriptionID) +} +func NewManagedInstanceTdeCertificatesClientWithBaseURI(baseURI string, subscriptionID string) ManagedInstanceTdeCertificatesClient { + return original.NewManagedInstanceTdeCertificatesClientWithBaseURI(baseURI, subscriptionID) +} func PossibleCapabilityGroupValues() []CapabilityGroup { return original.PossibleCapabilityGroupValues() } @@ -404,6 +419,12 @@ func PossibleVulnerabilityAssessmentScanStateValues() []VulnerabilityAssessmentS func PossibleVulnerabilityAssessmentScanTriggerTypeValues() []VulnerabilityAssessmentScanTriggerType { return original.PossibleVulnerabilityAssessmentScanTriggerTypeValues() } +func NewTdeCertificatesClient(subscriptionID string) TdeCertificatesClient { + return original.NewTdeCertificatesClient(subscriptionID) +} +func NewTdeCertificatesClientWithBaseURI(baseURI string, subscriptionID string) TdeCertificatesClient { + return original.NewTdeCertificatesClientWithBaseURI(baseURI, subscriptionID) +} func UserAgent() string { return original.UserAgent() + " profiles/preview" } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/recoveryservices/mgmt/backup/models.go b/vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/recoveryservices/mgmt/backup/models.go index 831927fa9..f446d0b3e 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/recoveryservices/mgmt/backup/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/recoveryservices/mgmt/backup/models.go @@ -52,17 +52,22 @@ const ( ContainerTypeAzureSQLContainer ContainerType = original.ContainerTypeAzureSQLContainer ContainerTypeCluster ContainerType = original.ContainerTypeCluster ContainerTypeDPMContainer ContainerType = original.ContainerTypeDPMContainer + ContainerTypeExchangeDAG ContainerType = original.ContainerTypeExchangeDAG ContainerTypeGenericContainer ContainerType = original.ContainerTypeGenericContainer + ContainerTypeHyperVCluster ContainerType = original.ContainerTypeHyperVCluster ContainerTypeIaasVMContainer ContainerType = original.ContainerTypeIaasVMContainer ContainerTypeIaasVMServiceContainer ContainerType = original.ContainerTypeIaasVMServiceContainer ContainerTypeInvalid ContainerType = original.ContainerTypeInvalid ContainerTypeMABContainer ContainerType = original.ContainerTypeMABContainer + ContainerTypeSharepointFarm ContainerType = original.ContainerTypeSharepointFarm ContainerTypeSQLAGWorkLoadContainer ContainerType = original.ContainerTypeSQLAGWorkLoadContainer + ContainerTypeSQLCluster ContainerType = original.ContainerTypeSQLCluster ContainerTypeStorageContainer ContainerType = original.ContainerTypeStorageContainer ContainerTypeUnknown ContainerType = original.ContainerTypeUnknown ContainerTypeVCenter ContainerType = original.ContainerTypeVCenter ContainerTypeVMAppContainer ContainerType = original.ContainerTypeVMAppContainer ContainerTypeWindows ContainerType = original.ContainerTypeWindows + ContainerTypeWindowsClient ContainerType = original.ContainerTypeWindowsClient ) type ContainerTypeBasicProtectionContainer = original.ContainerTypeBasicProtectionContainer @@ -74,13 +79,13 @@ const ( ContainerTypeDPMContainer1 ContainerTypeBasicProtectionContainer = original.ContainerTypeDPMContainer1 ContainerTypeGenericContainer1 ContainerTypeBasicProtectionContainer = original.ContainerTypeGenericContainer1 ContainerTypeIaaSVMContainer ContainerTypeBasicProtectionContainer = original.ContainerTypeIaaSVMContainer - ContainerTypeMABWindowsContainer ContainerTypeBasicProtectionContainer = original.ContainerTypeMABWindowsContainer ContainerTypeMicrosoftClassicComputevirtualMachines ContainerTypeBasicProtectionContainer = original.ContainerTypeMicrosoftClassicComputevirtualMachines ContainerTypeMicrosoftComputevirtualMachines ContainerTypeBasicProtectionContainer = original.ContainerTypeMicrosoftComputevirtualMachines ContainerTypeProtectionContainer ContainerTypeBasicProtectionContainer = original.ContainerTypeProtectionContainer ContainerTypeSQLAGWorkLoadContainer1 ContainerTypeBasicProtectionContainer = original.ContainerTypeSQLAGWorkLoadContainer1 ContainerTypeStorageContainer1 ContainerTypeBasicProtectionContainer = original.ContainerTypeStorageContainer1 ContainerTypeVMAppContainer1 ContainerTypeBasicProtectionContainer = original.ContainerTypeVMAppContainer1 + ContainerTypeWindows1 ContainerTypeBasicProtectionContainer = original.ContainerTypeWindows1 ) type CopyOptions = original.CopyOptions @@ -93,6 +98,14 @@ const ( CopyOptionsSkip CopyOptions = original.CopyOptionsSkip ) +type CreateMode = original.CreateMode + +const ( + CreateModeDefault CreateMode = original.CreateModeDefault + CreateModeInvalid CreateMode = original.CreateModeInvalid + CreateModeRecover CreateMode = original.CreateModeRecover +) + type DataSourceType = original.DataSourceType const ( @@ -103,6 +116,7 @@ const ( DataSourceTypeFileFolder DataSourceType = original.DataSourceTypeFileFolder DataSourceTypeGenericDataSource DataSourceType = original.DataSourceTypeGenericDataSource DataSourceTypeInvalid DataSourceType = original.DataSourceTypeInvalid + DataSourceTypeSAPHanaDatabase DataSourceType = original.DataSourceTypeSAPHanaDatabase DataSourceTypeSharepoint DataSourceType = original.DataSourceTypeSharepoint DataSourceTypeSQLDataBase DataSourceType = original.DataSourceTypeSQLDataBase DataSourceTypeSQLDB DataSourceType = original.DataSourceTypeSQLDB @@ -149,6 +163,7 @@ const ( type FeatureType = original.FeatureType const ( + FeatureTypeAzureBackupGoals FeatureType = original.FeatureTypeAzureBackupGoals FeatureTypeAzureVMResourceBackup FeatureType = original.FeatureTypeAzureVMResourceBackup FeatureTypeFeatureSupportRequest FeatureType = original.FeatureTypeFeatureSupportRequest ) @@ -241,6 +256,7 @@ const ( ItemTypeFileFolder ItemType = original.ItemTypeFileFolder ItemTypeGenericDataSource ItemType = original.ItemTypeGenericDataSource ItemTypeInvalid ItemType = original.ItemTypeInvalid + ItemTypeSAPHanaDatabase ItemType = original.ItemTypeSAPHanaDatabase ItemTypeSharepoint ItemType = original.ItemTypeSharepoint ItemTypeSQLDataBase ItemType = original.ItemTypeSQLDataBase ItemTypeSQLDB ItemType = original.ItemTypeSQLDB @@ -309,17 +325,22 @@ const ( MabServerTypeAzureSQLContainer MabServerType = original.MabServerTypeAzureSQLContainer MabServerTypeCluster MabServerType = original.MabServerTypeCluster MabServerTypeDPMContainer MabServerType = original.MabServerTypeDPMContainer + MabServerTypeExchangeDAG MabServerType = original.MabServerTypeExchangeDAG MabServerTypeGenericContainer MabServerType = original.MabServerTypeGenericContainer + MabServerTypeHyperVCluster MabServerType = original.MabServerTypeHyperVCluster MabServerTypeIaasVMContainer MabServerType = original.MabServerTypeIaasVMContainer MabServerTypeIaasVMServiceContainer MabServerType = original.MabServerTypeIaasVMServiceContainer MabServerTypeInvalid MabServerType = original.MabServerTypeInvalid MabServerTypeMABContainer MabServerType = original.MabServerTypeMABContainer + MabServerTypeSharepointFarm MabServerType = original.MabServerTypeSharepointFarm MabServerTypeSQLAGWorkLoadContainer MabServerType = original.MabServerTypeSQLAGWorkLoadContainer + MabServerTypeSQLCluster MabServerType = original.MabServerTypeSQLCluster MabServerTypeStorageContainer MabServerType = original.MabServerTypeStorageContainer MabServerTypeUnknown MabServerType = original.MabServerTypeUnknown MabServerTypeVCenter MabServerType = original.MabServerTypeVCenter MabServerTypeVMAppContainer MabServerType = original.MabServerTypeVMAppContainer MabServerTypeWindows MabServerType = original.MabServerTypeWindows + MabServerTypeWindowsClient MabServerType = original.MabServerTypeWindowsClient ) type ManagementType = original.ManagementType @@ -402,24 +423,28 @@ const ( type ObjectTypeBasicRecoveryPoint = original.ObjectTypeBasicRecoveryPoint const ( - ObjectTypeAzureFileShareRecoveryPoint ObjectTypeBasicRecoveryPoint = original.ObjectTypeAzureFileShareRecoveryPoint - ObjectTypeAzureWorkloadRecoveryPoint ObjectTypeBasicRecoveryPoint = original.ObjectTypeAzureWorkloadRecoveryPoint - ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint ObjectTypeBasicRecoveryPoint = original.ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint - ObjectTypeAzureWorkloadSQLRecoveryPoint ObjectTypeBasicRecoveryPoint = original.ObjectTypeAzureWorkloadSQLRecoveryPoint - ObjectTypeGenericRecoveryPoint ObjectTypeBasicRecoveryPoint = original.ObjectTypeGenericRecoveryPoint - ObjectTypeIaasVMRecoveryPoint ObjectTypeBasicRecoveryPoint = original.ObjectTypeIaasVMRecoveryPoint - ObjectTypeRecoveryPoint ObjectTypeBasicRecoveryPoint = original.ObjectTypeRecoveryPoint + ObjectTypeAzureFileShareRecoveryPoint ObjectTypeBasicRecoveryPoint = original.ObjectTypeAzureFileShareRecoveryPoint + ObjectTypeAzureWorkloadRecoveryPoint ObjectTypeBasicRecoveryPoint = original.ObjectTypeAzureWorkloadRecoveryPoint + ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint ObjectTypeBasicRecoveryPoint = original.ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint + ObjectTypeAzureWorkloadSAPHanaRecoveryPoint ObjectTypeBasicRecoveryPoint = original.ObjectTypeAzureWorkloadSAPHanaRecoveryPoint + ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint ObjectTypeBasicRecoveryPoint = original.ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint + ObjectTypeAzureWorkloadSQLRecoveryPoint ObjectTypeBasicRecoveryPoint = original.ObjectTypeAzureWorkloadSQLRecoveryPoint + ObjectTypeGenericRecoveryPoint ObjectTypeBasicRecoveryPoint = original.ObjectTypeGenericRecoveryPoint + ObjectTypeIaasVMRecoveryPoint ObjectTypeBasicRecoveryPoint = original.ObjectTypeIaasVMRecoveryPoint + ObjectTypeRecoveryPoint ObjectTypeBasicRecoveryPoint = original.ObjectTypeRecoveryPoint ) type ObjectTypeBasicRestoreRequest = original.ObjectTypeBasicRestoreRequest const ( - ObjectTypeAzureFileShareRestoreRequest ObjectTypeBasicRestoreRequest = original.ObjectTypeAzureFileShareRestoreRequest - ObjectTypeAzureWorkloadRestoreRequest ObjectTypeBasicRestoreRequest = original.ObjectTypeAzureWorkloadRestoreRequest - ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest ObjectTypeBasicRestoreRequest = original.ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest - ObjectTypeAzureWorkloadSQLRestoreRequest ObjectTypeBasicRestoreRequest = original.ObjectTypeAzureWorkloadSQLRestoreRequest - ObjectTypeIaasVMRestoreRequest ObjectTypeBasicRestoreRequest = original.ObjectTypeIaasVMRestoreRequest - ObjectTypeRestoreRequest ObjectTypeBasicRestoreRequest = original.ObjectTypeRestoreRequest + ObjectTypeAzureFileShareRestoreRequest ObjectTypeBasicRestoreRequest = original.ObjectTypeAzureFileShareRestoreRequest + ObjectTypeAzureWorkloadRestoreRequest ObjectTypeBasicRestoreRequest = original.ObjectTypeAzureWorkloadRestoreRequest + ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest ObjectTypeBasicRestoreRequest = original.ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest + ObjectTypeAzureWorkloadSAPHanaRestoreRequest ObjectTypeBasicRestoreRequest = original.ObjectTypeAzureWorkloadSAPHanaRestoreRequest + ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest ObjectTypeBasicRestoreRequest = original.ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest + ObjectTypeAzureWorkloadSQLRestoreRequest ObjectTypeBasicRestoreRequest = original.ObjectTypeAzureWorkloadSQLRestoreRequest + ObjectTypeIaasVMRestoreRequest ObjectTypeBasicRestoreRequest = original.ObjectTypeIaasVMRestoreRequest + ObjectTypeRestoreRequest ObjectTypeBasicRestoreRequest = original.ObjectTypeRestoreRequest ) type OperationStatusValues = original.OperationStatusValues @@ -456,6 +481,8 @@ const ( ProtectableItemTypeIaaSVMProtectableItem ProtectableItemType = original.ProtectableItemTypeIaaSVMProtectableItem ProtectableItemTypeMicrosoftClassicComputevirtualMachines ProtectableItemType = original.ProtectableItemTypeMicrosoftClassicComputevirtualMachines ProtectableItemTypeMicrosoftComputevirtualMachines ProtectableItemType = original.ProtectableItemTypeMicrosoftComputevirtualMachines + ProtectableItemTypeSAPHanaDatabase ProtectableItemType = original.ProtectableItemTypeSAPHanaDatabase + ProtectableItemTypeSAPHanaSystem ProtectableItemType = original.ProtectableItemTypeSAPHanaSystem ProtectableItemTypeSQLAvailabilityGroupContainer ProtectableItemType = original.ProtectableItemTypeSQLAvailabilityGroupContainer ProtectableItemTypeSQLDataBase ProtectableItemType = original.ProtectableItemTypeSQLDataBase ProtectableItemTypeSQLInstance ProtectableItemType = original.ProtectableItemTypeSQLInstance @@ -488,6 +515,8 @@ type ProtectedItemType = original.ProtectedItemType const ( ProtectedItemTypeAzureFileShareProtectedItem ProtectedItemType = original.ProtectedItemTypeAzureFileShareProtectedItem ProtectedItemTypeAzureIaaSVMProtectedItem ProtectedItemType = original.ProtectedItemTypeAzureIaaSVMProtectedItem + ProtectedItemTypeAzureVMWorkloadProtectedItem ProtectedItemType = original.ProtectedItemTypeAzureVMWorkloadProtectedItem + ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase ProtectedItemType = original.ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase ProtectedItemTypeAzureVMWorkloadSQLDatabase ProtectedItemType = original.ProtectedItemTypeAzureVMWorkloadSQLDatabase ProtectedItemTypeDPMProtectedItem ProtectedItemType = original.ProtectedItemTypeDPMProtectedItem ProtectedItemTypeGenericProtectedItem ProtectedItemType = original.ProtectedItemTypeGenericProtectedItem @@ -501,8 +530,11 @@ const ( type ProtectionIntentItemType = original.ProtectionIntentItemType const ( - ProtectionIntentItemTypeAzureResourceItem ProtectionIntentItemType = original.ProtectionIntentItemTypeAzureResourceItem - ProtectionIntentItemTypeProtectionIntent ProtectionIntentItemType = original.ProtectionIntentItemTypeProtectionIntent + ProtectionIntentItemTypeAzureResourceItem ProtectionIntentItemType = original.ProtectionIntentItemTypeAzureResourceItem + ProtectionIntentItemTypeAzureWorkloadAutoProtectionIntent ProtectionIntentItemType = original.ProtectionIntentItemTypeAzureWorkloadAutoProtectionIntent + ProtectionIntentItemTypeAzureWorkloadSQLAutoProtectionIntent ProtectionIntentItemType = original.ProtectionIntentItemTypeAzureWorkloadSQLAutoProtectionIntent + ProtectionIntentItemTypeProtectionIntent ProtectionIntentItemType = original.ProtectionIntentItemTypeProtectionIntent + ProtectionIntentItemTypeRecoveryServiceVaultItem ProtectionIntentItemType = original.ProtectionIntentItemTypeRecoveryServiceVaultItem ) type ProtectionState = original.ProtectionState @@ -697,25 +729,30 @@ const ( type WeekOfMonth = original.WeekOfMonth const ( - First WeekOfMonth = original.First - Fourth WeekOfMonth = original.Fourth - Last WeekOfMonth = original.Last - Second WeekOfMonth = original.Second - Third WeekOfMonth = original.Third + WeekOfMonthFirst WeekOfMonth = original.WeekOfMonthFirst + WeekOfMonthFourth WeekOfMonth = original.WeekOfMonthFourth + WeekOfMonthInvalid WeekOfMonth = original.WeekOfMonthInvalid + WeekOfMonthLast WeekOfMonth = original.WeekOfMonthLast + WeekOfMonthSecond WeekOfMonth = original.WeekOfMonthSecond + WeekOfMonthThird WeekOfMonth = original.WeekOfMonthThird ) type WorkloadItemType = original.WorkloadItemType const ( - WorkloadItemTypeInvalid WorkloadItemType = original.WorkloadItemTypeInvalid - WorkloadItemTypeSQLDataBase WorkloadItemType = original.WorkloadItemTypeSQLDataBase - WorkloadItemTypeSQLInstance WorkloadItemType = original.WorkloadItemTypeSQLInstance + WorkloadItemTypeInvalid WorkloadItemType = original.WorkloadItemTypeInvalid + WorkloadItemTypeSAPHanaDatabase WorkloadItemType = original.WorkloadItemTypeSAPHanaDatabase + WorkloadItemTypeSAPHanaSystem WorkloadItemType = original.WorkloadItemTypeSAPHanaSystem + WorkloadItemTypeSQLDataBase WorkloadItemType = original.WorkloadItemTypeSQLDataBase + WorkloadItemTypeSQLInstance WorkloadItemType = original.WorkloadItemTypeSQLInstance ) type WorkloadItemTypeBasicWorkloadItem = original.WorkloadItemTypeBasicWorkloadItem const ( WorkloadItemTypeAzureVMWorkloadItem WorkloadItemTypeBasicWorkloadItem = original.WorkloadItemTypeAzureVMWorkloadItem + WorkloadItemTypeSAPHanaDatabase1 WorkloadItemTypeBasicWorkloadItem = original.WorkloadItemTypeSAPHanaDatabase1 + WorkloadItemTypeSAPHanaSystem1 WorkloadItemTypeBasicWorkloadItem = original.WorkloadItemTypeSAPHanaSystem1 WorkloadItemTypeSQLDataBase1 WorkloadItemTypeBasicWorkloadItem = original.WorkloadItemTypeSQLDataBase1 WorkloadItemTypeSQLInstance1 WorkloadItemTypeBasicWorkloadItem = original.WorkloadItemTypeSQLInstance1 WorkloadItemTypeWorkloadItem WorkloadItemTypeBasicWorkloadItem = original.WorkloadItemTypeWorkloadItem @@ -731,6 +768,7 @@ const ( WorkloadTypeFileFolder WorkloadType = original.WorkloadTypeFileFolder WorkloadTypeGenericDataSource WorkloadType = original.WorkloadTypeGenericDataSource WorkloadTypeInvalid WorkloadType = original.WorkloadTypeInvalid + WorkloadTypeSAPHanaDatabase WorkloadType = original.WorkloadTypeSAPHanaDatabase WorkloadTypeSharepoint WorkloadType = original.WorkloadTypeSharepoint WorkloadTypeSQLDataBase WorkloadType = original.WorkloadTypeSQLDataBase WorkloadTypeSQLDB WorkloadType = original.WorkloadTypeSQLDB @@ -739,6 +777,7 @@ const ( WorkloadTypeVMwareVM WorkloadType = original.WorkloadTypeVMwareVM ) +type AzureBackupGoalFeatureSupportRequest = original.AzureBackupGoalFeatureSupportRequest type AzureBackupServerContainer = original.AzureBackupServerContainer type AzureBackupServerEngine = original.AzureBackupServerEngine type AzureFileShareBackupRequest = original.AzureFileShareBackupRequest @@ -763,6 +802,8 @@ type BasicAzureIaaSVMProtectedItem = original.BasicAzureIaaSVMProtectedItem type AzureIaaSVMProtectedItem = original.AzureIaaSVMProtectedItem type AzureIaaSVMProtectedItemExtendedInfo = original.AzureIaaSVMProtectedItemExtendedInfo type AzureIaaSVMProtectionPolicy = original.AzureIaaSVMProtectionPolicy +type BasicAzureRecoveryServiceVaultProtectionIntent = original.BasicAzureRecoveryServiceVaultProtectionIntent +type AzureRecoveryServiceVaultProtectionIntent = original.AzureRecoveryServiceVaultProtectionIntent type AzureResourceProtectionIntent = original.AzureResourceProtectionIntent type AzureSQLAGWorkloadContainerProtectionContainer = original.AzureSQLAGWorkloadContainerProtectionContainer type AzureSQLContainer = original.AzureSQLContainer @@ -783,14 +824,23 @@ type BasicAzureVMWorkloadItem = original.BasicAzureVMWorkloadItem type AzureVMWorkloadItem = original.AzureVMWorkloadItem type BasicAzureVMWorkloadProtectableItem = original.BasicAzureVMWorkloadProtectableItem type AzureVMWorkloadProtectableItem = original.AzureVMWorkloadProtectableItem +type BasicAzureVMWorkloadProtectedItem = original.BasicAzureVMWorkloadProtectedItem +type AzureVMWorkloadProtectedItem = original.AzureVMWorkloadProtectedItem type AzureVMWorkloadProtectedItemExtendedInfo = original.AzureVMWorkloadProtectedItemExtendedInfo type AzureVMWorkloadProtectionPolicy = original.AzureVMWorkloadProtectionPolicy +type AzureVMWorkloadSAPHanaDatabaseProtectableItem = original.AzureVMWorkloadSAPHanaDatabaseProtectableItem +type AzureVMWorkloadSAPHanaDatabaseProtectedItem = original.AzureVMWorkloadSAPHanaDatabaseProtectedItem +type AzureVMWorkloadSAPHanaDatabaseWorkloadItem = original.AzureVMWorkloadSAPHanaDatabaseWorkloadItem +type AzureVMWorkloadSAPHanaSystemProtectableItem = original.AzureVMWorkloadSAPHanaSystemProtectableItem +type AzureVMWorkloadSAPHanaSystemWorkloadItem = original.AzureVMWorkloadSAPHanaSystemWorkloadItem type AzureVMWorkloadSQLAvailabilityGroupProtectableItem = original.AzureVMWorkloadSQLAvailabilityGroupProtectableItem type AzureVMWorkloadSQLDatabaseProtectableItem = original.AzureVMWorkloadSQLDatabaseProtectableItem type AzureVMWorkloadSQLDatabaseProtectedItem = original.AzureVMWorkloadSQLDatabaseProtectedItem type AzureVMWorkloadSQLDatabaseWorkloadItem = original.AzureVMWorkloadSQLDatabaseWorkloadItem type AzureVMWorkloadSQLInstanceProtectableItem = original.AzureVMWorkloadSQLInstanceProtectableItem type AzureVMWorkloadSQLInstanceWorkloadItem = original.AzureVMWorkloadSQLInstanceWorkloadItem +type BasicAzureWorkloadAutoProtectionIntent = original.BasicAzureWorkloadAutoProtectionIntent +type AzureWorkloadAutoProtectionIntent = original.AzureWorkloadAutoProtectionIntent type AzureWorkloadBackupRequest = original.AzureWorkloadBackupRequest type BasicAzureWorkloadContainer = original.BasicAzureWorkloadContainer type AzureWorkloadContainer = original.AzureWorkloadContainer @@ -803,6 +853,13 @@ type BasicAzureWorkloadRecoveryPoint = original.BasicAzureWorkloadRecoveryPoint type AzureWorkloadRecoveryPoint = original.AzureWorkloadRecoveryPoint type BasicAzureWorkloadRestoreRequest = original.BasicAzureWorkloadRestoreRequest type AzureWorkloadRestoreRequest = original.AzureWorkloadRestoreRequest +type AzureWorkloadSAPHanaPointInTimeRecoveryPoint = original.AzureWorkloadSAPHanaPointInTimeRecoveryPoint +type AzureWorkloadSAPHanaPointInTimeRestoreRequest = original.AzureWorkloadSAPHanaPointInTimeRestoreRequest +type BasicAzureWorkloadSAPHanaRecoveryPoint = original.BasicAzureWorkloadSAPHanaRecoveryPoint +type AzureWorkloadSAPHanaRecoveryPoint = original.AzureWorkloadSAPHanaRecoveryPoint +type BasicAzureWorkloadSAPHanaRestoreRequest = original.BasicAzureWorkloadSAPHanaRestoreRequest +type AzureWorkloadSAPHanaRestoreRequest = original.AzureWorkloadSAPHanaRestoreRequest +type AzureWorkloadSQLAutoProtectionIntent = original.AzureWorkloadSQLAutoProtectionIntent type AzureWorkloadSQLPointInTimeRecoveryPoint = original.AzureWorkloadSQLPointInTimeRecoveryPoint type AzureWorkloadSQLPointInTimeRestoreRequest = original.AzureWorkloadSQLPointInTimeRestoreRequest type BasicAzureWorkloadSQLRecoveryPoint = original.BasicAzureWorkloadSQLRecoveryPoint @@ -815,6 +872,7 @@ type BMSBackupEngineQueryObject = original.BMSBackupEngineQueryObject type BMSBackupEnginesQueryObject = original.BMSBackupEnginesQueryObject type BMSBackupSummariesQueryObject = original.BMSBackupSummariesQueryObject type BMSContainerQueryObject = original.BMSContainerQueryObject +type BMSContainersInquiryQueryObject = original.BMSContainersInquiryQueryObject type BMSPOQueryObject = original.BMSPOQueryObject type BMSRefreshContainersQueryObject = original.BMSRefreshContainersQueryObject type BMSRPQueryObject = original.BMSRPQueryObject @@ -1102,6 +1160,9 @@ func PossibleContainerTypeBasicProtectionContainerValues() []ContainerTypeBasicP func PossibleCopyOptionsValues() []CopyOptions { return original.PossibleCopyOptionsValues() } +func PossibleCreateModeValues() []CreateMode { + return original.PossibleCreateModeValues() +} func PossibleDataSourceTypeValues() []DataSourceType { return original.PossibleDataSourceTypeValues() } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/reservations/mgmt/reservations/models.go b/vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/reservations/mgmt/reservations/models.go index bf0943228..4a79517cf 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/reservations/mgmt/reservations/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/reservations/mgmt/reservations/models.go @@ -33,71 +33,64 @@ const ( Single AppliedScopeType = original.Single ) -type AppliedScopeType1 = original.AppliedScopeType1 +type ErrorResponseCode = original.ErrorResponseCode const ( - AppliedScopeType1Shared AppliedScopeType1 = original.AppliedScopeType1Shared - AppliedScopeType1Single AppliedScopeType1 = original.AppliedScopeType1Single -) - -type Code = original.Code - -const ( - ActivateQuoteFailed Code = original.ActivateQuoteFailed - AppliedScopesNotAssociatedWithCommerceAccount Code = original.AppliedScopesNotAssociatedWithCommerceAccount - AuthorizationFailed Code = original.AuthorizationFailed - BadRequest Code = original.BadRequest - BillingCustomerInputError Code = original.BillingCustomerInputError - BillingError Code = original.BillingError - BillingPaymentInstrumentHardError Code = original.BillingPaymentInstrumentHardError - BillingPaymentInstrumentSoftError Code = original.BillingPaymentInstrumentSoftError - BillingScopeIDCannotBeChanged Code = original.BillingScopeIDCannotBeChanged - BillingTransientError Code = original.BillingTransientError - CalculatePriceFailed Code = original.CalculatePriceFailed - CapacityUpdateScopesFailed Code = original.CapacityUpdateScopesFailed - ClientCertificateThumbprintNotSet Code = original.ClientCertificateThumbprintNotSet - CreateQuoteFailed Code = original.CreateQuoteFailed - Forbidden Code = original.Forbidden - FulfillmentConfigurationError Code = original.FulfillmentConfigurationError - FulfillmentError Code = original.FulfillmentError - FulfillmentOutOfStockError Code = original.FulfillmentOutOfStockError - FulfillmentTransientError Code = original.FulfillmentTransientError - HTTPMethodNotSupported Code = original.HTTPMethodNotSupported - InternalServerError Code = original.InternalServerError - InvalidAccessToken Code = original.InvalidAccessToken - InvalidFulfillmentRequestParameters Code = original.InvalidFulfillmentRequestParameters - InvalidHealthCheckType Code = original.InvalidHealthCheckType - InvalidLocationID Code = original.InvalidLocationID - InvalidRefundQuantity Code = original.InvalidRefundQuantity - InvalidRequestContent Code = original.InvalidRequestContent - InvalidRequestURI Code = original.InvalidRequestURI - InvalidReservationID Code = original.InvalidReservationID - InvalidReservationOrderID Code = original.InvalidReservationOrderID - InvalidSingleAppliedScopesCount Code = original.InvalidSingleAppliedScopesCount - InvalidSubscriptionID Code = original.InvalidSubscriptionID - InvalidTenantID Code = original.InvalidTenantID - MissingAppliedScopesForSingle Code = original.MissingAppliedScopesForSingle - MissingTenantID Code = original.MissingTenantID - NonsupportedAccountID Code = original.NonsupportedAccountID - NotSpecified Code = original.NotSpecified - NotSupportedCountry Code = original.NotSupportedCountry - NoValidReservationsToReRate Code = original.NoValidReservationsToReRate - OperationCannotBePerformedInCurrentState Code = original.OperationCannotBePerformedInCurrentState - OperationFailed Code = original.OperationFailed - PatchValuesSameAsExisting Code = original.PatchValuesSameAsExisting - PaymentInstrumentNotFound Code = original.PaymentInstrumentNotFound - PurchaseError Code = original.PurchaseError - ReRateOnlyAllowedForEA Code = original.ReRateOnlyAllowedForEA - ReservationIDNotInReservationOrder Code = original.ReservationIDNotInReservationOrder - ReservationOrderCreationFailed Code = original.ReservationOrderCreationFailed - ReservationOrderIDAlreadyExists Code = original.ReservationOrderIDAlreadyExists - ReservationOrderNotEnabled Code = original.ReservationOrderNotEnabled - ReservationOrderNotFound Code = original.ReservationOrderNotFound - RiskCheckFailed Code = original.RiskCheckFailed - RoleAssignmentCreationFailed Code = original.RoleAssignmentCreationFailed - ServerTimeout Code = original.ServerTimeout - UnauthenticatedRequestsThrottled Code = original.UnauthenticatedRequestsThrottled - UnsupportedReservationTerm Code = original.UnsupportedReservationTerm + ActivateQuoteFailed ErrorResponseCode = original.ActivateQuoteFailed + AppliedScopesNotAssociatedWithCommerceAccount ErrorResponseCode = original.AppliedScopesNotAssociatedWithCommerceAccount + AuthorizationFailed ErrorResponseCode = original.AuthorizationFailed + BadRequest ErrorResponseCode = original.BadRequest + BillingCustomerInputError ErrorResponseCode = original.BillingCustomerInputError + BillingError ErrorResponseCode = original.BillingError + BillingPaymentInstrumentHardError ErrorResponseCode = original.BillingPaymentInstrumentHardError + BillingPaymentInstrumentSoftError ErrorResponseCode = original.BillingPaymentInstrumentSoftError + BillingScopeIDCannotBeChanged ErrorResponseCode = original.BillingScopeIDCannotBeChanged + BillingTransientError ErrorResponseCode = original.BillingTransientError + CalculatePriceFailed ErrorResponseCode = original.CalculatePriceFailed + CapacityUpdateScopesFailed ErrorResponseCode = original.CapacityUpdateScopesFailed + ClientCertificateThumbprintNotSet ErrorResponseCode = original.ClientCertificateThumbprintNotSet + CreateQuoteFailed ErrorResponseCode = original.CreateQuoteFailed + Forbidden ErrorResponseCode = original.Forbidden + FulfillmentConfigurationError ErrorResponseCode = original.FulfillmentConfigurationError + FulfillmentError ErrorResponseCode = original.FulfillmentError + FulfillmentOutOfStockError ErrorResponseCode = original.FulfillmentOutOfStockError + FulfillmentTransientError ErrorResponseCode = original.FulfillmentTransientError + HTTPMethodNotSupported ErrorResponseCode = original.HTTPMethodNotSupported + InternalServerError ErrorResponseCode = original.InternalServerError + InvalidAccessToken ErrorResponseCode = original.InvalidAccessToken + InvalidFulfillmentRequestParameters ErrorResponseCode = original.InvalidFulfillmentRequestParameters + InvalidHealthCheckType ErrorResponseCode = original.InvalidHealthCheckType + InvalidLocationID ErrorResponseCode = original.InvalidLocationID + InvalidRefundQuantity ErrorResponseCode = original.InvalidRefundQuantity + InvalidRequestContent ErrorResponseCode = original.InvalidRequestContent + InvalidRequestURI ErrorResponseCode = original.InvalidRequestURI + InvalidReservationID ErrorResponseCode = original.InvalidReservationID + InvalidReservationOrderID ErrorResponseCode = original.InvalidReservationOrderID + InvalidSingleAppliedScopesCount ErrorResponseCode = original.InvalidSingleAppliedScopesCount + InvalidSubscriptionID ErrorResponseCode = original.InvalidSubscriptionID + InvalidTenantID ErrorResponseCode = original.InvalidTenantID + MissingAppliedScopesForSingle ErrorResponseCode = original.MissingAppliedScopesForSingle + MissingTenantID ErrorResponseCode = original.MissingTenantID + NonsupportedAccountID ErrorResponseCode = original.NonsupportedAccountID + NotSpecified ErrorResponseCode = original.NotSpecified + NotSupportedCountry ErrorResponseCode = original.NotSupportedCountry + NoValidReservationsToReRate ErrorResponseCode = original.NoValidReservationsToReRate + OperationCannotBePerformedInCurrentState ErrorResponseCode = original.OperationCannotBePerformedInCurrentState + OperationFailed ErrorResponseCode = original.OperationFailed + PatchValuesSameAsExisting ErrorResponseCode = original.PatchValuesSameAsExisting + PaymentInstrumentNotFound ErrorResponseCode = original.PaymentInstrumentNotFound + PurchaseError ErrorResponseCode = original.PurchaseError + ReRateOnlyAllowedForEA ErrorResponseCode = original.ReRateOnlyAllowedForEA + ReservationIDNotInReservationOrder ErrorResponseCode = original.ReservationIDNotInReservationOrder + ReservationOrderCreationFailed ErrorResponseCode = original.ReservationOrderCreationFailed + ReservationOrderIDAlreadyExists ErrorResponseCode = original.ReservationOrderIDAlreadyExists + ReservationOrderNotEnabled ErrorResponseCode = original.ReservationOrderNotEnabled + ReservationOrderNotFound ErrorResponseCode = original.ReservationOrderNotFound + RiskCheckFailed ErrorResponseCode = original.RiskCheckFailed + RoleAssignmentCreationFailed ErrorResponseCode = original.RoleAssignmentCreationFailed + ServerTimeout ErrorResponseCode = original.ServerTimeout + UnauthenticatedRequestsThrottled ErrorResponseCode = original.UnauthenticatedRequestsThrottled + UnsupportedReservationTerm ErrorResponseCode = original.UnsupportedReservationTerm ) type InstanceFlexibility = original.InstanceFlexibility @@ -108,81 +101,11 @@ const ( On InstanceFlexibility = original.On ) -type InstanceFlexibility1 = original.InstanceFlexibility1 +type ReservationTerm = original.ReservationTerm const ( - InstanceFlexibility1NotSupported InstanceFlexibility1 = original.InstanceFlexibility1NotSupported - InstanceFlexibility1Off InstanceFlexibility1 = original.InstanceFlexibility1Off - InstanceFlexibility1On InstanceFlexibility1 = original.InstanceFlexibility1On -) - -type Location = original.Location - -const ( - Australiac Location = original.Australiac - Australiac2 Location = original.Australiac2 - Australiaeast Location = original.Australiaeast - Australiasoutheast Location = original.Australiasoutheast - Brazilsouth Location = original.Brazilsouth - Canadacentral Location = original.Canadacentral - Canadaeast Location = original.Canadaeast - Centralindia Location = original.Centralindia - Centralus Location = original.Centralus - Eastasia Location = original.Eastasia - Eastus Location = original.Eastus - Eastus2 Location = original.Eastus2 - Francecentral Location = original.Francecentral - Francesouth Location = original.Francesouth - Japaneast Location = original.Japaneast - Japanwest Location = original.Japanwest - Northcentralus Location = original.Northcentralus - Northeurope Location = original.Northeurope - Southcentralus Location = original.Southcentralus - Southeastasia Location = original.Southeastasia - Southindia Location = original.Southindia - Uksouth Location = original.Uksouth - Ukwest Location = original.Ukwest - Westcentralus Location = original.Westcentralus - Westeurope Location = original.Westeurope - Westindia Location = original.Westindia - Westus Location = original.Westus - Westus2 Location = original.Westus2 -) - -type ProvisioningState = original.ProvisioningState - -const ( - BillingFailed ProvisioningState = original.BillingFailed - Cancelled ProvisioningState = original.Cancelled - ConfirmedBilling ProvisioningState = original.ConfirmedBilling - ConfirmedResourceHold ProvisioningState = original.ConfirmedResourceHold - Created ProvisioningState = original.Created - Creating ProvisioningState = original.Creating - Expired ProvisioningState = original.Expired - Failed ProvisioningState = original.Failed - Merged ProvisioningState = original.Merged - PendingBilling ProvisioningState = original.PendingBilling - PendingResourceHold ProvisioningState = original.PendingResourceHold - Split ProvisioningState = original.Split - Succeeded ProvisioningState = original.Succeeded -) - -type ProvisioningState1 = original.ProvisioningState1 - -const ( - ProvisioningState1BillingFailed ProvisioningState1 = original.ProvisioningState1BillingFailed - ProvisioningState1Cancelled ProvisioningState1 = original.ProvisioningState1Cancelled - ProvisioningState1ConfirmedBilling ProvisioningState1 = original.ProvisioningState1ConfirmedBilling - ProvisioningState1ConfirmedResourceHold ProvisioningState1 = original.ProvisioningState1ConfirmedResourceHold - ProvisioningState1Created ProvisioningState1 = original.ProvisioningState1Created - ProvisioningState1Creating ProvisioningState1 = original.ProvisioningState1Creating - ProvisioningState1Expired ProvisioningState1 = original.ProvisioningState1Expired - ProvisioningState1Failed ProvisioningState1 = original.ProvisioningState1Failed - ProvisioningState1Merged ProvisioningState1 = original.ProvisioningState1Merged - ProvisioningState1PendingBilling ProvisioningState1 = original.ProvisioningState1PendingBilling - ProvisioningState1PendingResourceHold ProvisioningState1 = original.ProvisioningState1PendingResourceHold - ProvisioningState1Split ProvisioningState1 = original.ProvisioningState1Split - ProvisioningState1Succeeded ProvisioningState1 = original.ProvisioningState1Succeeded + P1Y ReservationTerm = original.P1Y + P3Y ReservationTerm = original.P3Y ) type ReservedResourceType = original.ReservedResourceType @@ -207,13 +130,6 @@ const ( StatusCodeSucceeded StatusCode = original.StatusCodeSucceeded ) -type Term = original.Term - -const ( - P1Y Term = original.P1Y - P3Y Term = original.P3Y -) - type AppliedReservationList = original.AppliedReservationList type AppliedReservations = original.AppliedReservations type AppliedReservationsProperties = original.AppliedReservationsProperties @@ -265,26 +181,14 @@ func NewWithBaseURI(baseURI string) BaseClient { func PossibleAppliedScopeTypeValues() []AppliedScopeType { return original.PossibleAppliedScopeTypeValues() } -func PossibleAppliedScopeType1Values() []AppliedScopeType1 { - return original.PossibleAppliedScopeType1Values() -} -func PossibleCodeValues() []Code { - return original.PossibleCodeValues() +func PossibleErrorResponseCodeValues() []ErrorResponseCode { + return original.PossibleErrorResponseCodeValues() } func PossibleInstanceFlexibilityValues() []InstanceFlexibility { return original.PossibleInstanceFlexibilityValues() } -func PossibleInstanceFlexibility1Values() []InstanceFlexibility1 { - return original.PossibleInstanceFlexibility1Values() -} -func PossibleLocationValues() []Location { - return original.PossibleLocationValues() -} -func PossibleProvisioningStateValues() []ProvisioningState { - return original.PossibleProvisioningStateValues() -} -func PossibleProvisioningState1Values() []ProvisioningState1 { - return original.PossibleProvisioningState1Values() +func PossibleReservationTermValues() []ReservationTerm { + return original.PossibleReservationTermValues() } func PossibleReservedResourceTypeValues() []ReservedResourceType { return original.PossibleReservedResourceTypeValues() @@ -292,9 +196,6 @@ func PossibleReservedResourceTypeValues() []ReservedResourceType { func PossibleStatusCodeValues() []StatusCode { return original.PossibleStatusCodeValues() } -func PossibleTermValues() []Term { - return original.PossibleTermValues() -} func NewOperationClient() OperationClient { return original.NewOperationClient() } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/storage/datalake/storagedatalake/models.go b/vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/storage/datalake/storagedatalake/models.go new file mode 100644 index 000000000..fecd15c27 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/profiles/preview/storage/datalake/storagedatalake/models.go @@ -0,0 +1,120 @@ +// +build go1.9 + +// Copyright 2018 Microsoft Corporation +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// This code was auto-generated by: +// github.com/Azure/azure-sdk-for-go/tools/profileBuilder + +package storagedatalake + +import original "github.com/Azure/azure-sdk-for-go/services/storage/datalake/2018-06-17/storagedatalake" + +const ( + DefaultDNSSuffix = original.DefaultDNSSuffix +) + +type BaseClient = original.BaseClient +type FilesystemClient = original.FilesystemClient +type PathGetPropertiesAction = original.PathGetPropertiesAction + +const ( + GetAccessControl PathGetPropertiesAction = original.GetAccessControl +) + +type PathLeaseAction = original.PathLeaseAction + +const ( + Acquire PathLeaseAction = original.Acquire + Break PathLeaseAction = original.Break + Change PathLeaseAction = original.Change + Release PathLeaseAction = original.Release + Renew PathLeaseAction = original.Renew +) + +type PathRenameMode = original.PathRenameMode + +const ( + Legacy PathRenameMode = original.Legacy + Posix PathRenameMode = original.Posix +) + +type PathResourceType = original.PathResourceType + +const ( + Directory PathResourceType = original.Directory + File PathResourceType = original.File +) + +type PathUpdateAction = original.PathUpdateAction + +const ( + Append PathUpdateAction = original.Append + Flush PathUpdateAction = original.Flush + SetAccessControl PathUpdateAction = original.SetAccessControl + SetProperties PathUpdateAction = original.SetProperties +) + +type PathUpdateLeaseAction = original.PathUpdateLeaseAction + +const ( + PathUpdateLeaseActionRelease PathUpdateLeaseAction = original.PathUpdateLeaseActionRelease + PathUpdateLeaseActionRenew PathUpdateLeaseAction = original.PathUpdateLeaseActionRenew +) + +type DataLakeStorageError = original.DataLakeStorageError +type DataLakeStorageErrorError = original.DataLakeStorageErrorError +type Filesystem = original.Filesystem +type FilesystemList = original.FilesystemList +type Path = original.Path +type PathList = original.PathList +type ReadCloser = original.ReadCloser +type PathClient = original.PathClient + +func New(xMsVersion string, accountName string) BaseClient { + return original.New(xMsVersion, accountName) +} +func NewWithoutDefaults(xMsVersion string, accountName string, dNSSuffix string) BaseClient { + return original.NewWithoutDefaults(xMsVersion, accountName, dNSSuffix) +} +func NewFilesystemClient(xMsVersion string, accountName string) FilesystemClient { + return original.NewFilesystemClient(xMsVersion, accountName) +} +func PossiblePathGetPropertiesActionValues() []PathGetPropertiesAction { + return original.PossiblePathGetPropertiesActionValues() +} +func PossiblePathLeaseActionValues() []PathLeaseAction { + return original.PossiblePathLeaseActionValues() +} +func PossiblePathRenameModeValues() []PathRenameMode { + return original.PossiblePathRenameModeValues() +} +func PossiblePathResourceTypeValues() []PathResourceType { + return original.PossiblePathResourceTypeValues() +} +func PossiblePathUpdateActionValues() []PathUpdateAction { + return original.PossiblePathUpdateActionValues() +} +func PossiblePathUpdateLeaseActionValues() []PathUpdateLeaseAction { + return original.PossiblePathUpdateLeaseActionValues() +} +func NewPathClient(xMsVersion string, accountName string) PathClient { + return original.NewPathClient(xMsVersion, accountName) +} +func UserAgent() string { + return original.UserAgent() + " profiles/preview" +} +func Version() string { + return original.Version() +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/adhybridhealthservice/mgmt/2014-01-01/adhybridhealthservice/addsservice.go b/vendor/github.com/Azure/azure-sdk-for-go/services/adhybridhealthservice/mgmt/2014-01-01/adhybridhealthservice/addsservice.go new file mode 100644 index 000000000..0a6be9446 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/adhybridhealthservice/mgmt/2014-01-01/adhybridhealthservice/addsservice.go @@ -0,0 +1,121 @@ +package adhybridhealthservice + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/date" + "net/http" +) + +// AddsServiceClient is the REST APIs for Azure Active Drectory Connect Health +type AddsServiceClient struct { + BaseClient +} + +// NewAddsServiceClient creates an instance of the AddsServiceClient client. +func NewAddsServiceClient() AddsServiceClient { + return NewAddsServiceClientWithBaseURI(DefaultBaseURI) +} + +// NewAddsServiceClientWithBaseURI creates an instance of the AddsServiceClient client. +func NewAddsServiceClientWithBaseURI(baseURI string) AddsServiceClient { + return AddsServiceClient{NewWithBaseURI(baseURI)} +} + +// GetMetrics gets the server related metrics for a given metric and group combination. +// Parameters: +// serviceName - the name of the service. +// metricName - the metric name +// groupName - the group name +// groupKey - the group key +// fromDate - the start date. +// toDate - the end date. +func (client AddsServiceClient) GetMetrics(ctx context.Context, serviceName string, metricName string, groupName string, groupKey string, fromDate *date.Time, toDate *date.Time) (result MetricSets, err error) { + req, err := client.GetMetricsPreparer(ctx, serviceName, metricName, groupName, groupKey, fromDate, toDate) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.AddsServiceClient", "GetMetrics", nil, "Failure preparing request") + return + } + + resp, err := client.GetMetricsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "adhybridhealthservice.AddsServiceClient", "GetMetrics", resp, "Failure sending request") + return + } + + result, err = client.GetMetricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.AddsServiceClient", "GetMetrics", resp, "Failure responding to request") + } + + return +} + +// GetMetricsPreparer prepares the GetMetrics request. +func (client AddsServiceClient) GetMetricsPreparer(ctx context.Context, serviceName string, metricName string, groupName string, groupKey string, fromDate *date.Time, toDate *date.Time) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "groupName": autorest.Encode("path", groupName), + "metricName": autorest.Encode("path", metricName), + "serviceName": autorest.Encode("path", serviceName), + } + + const APIVersion = "2014-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(groupKey) > 0 { + queryParameters["groupKey"] = autorest.Encode("query", groupKey) + } + if fromDate != nil { + queryParameters["fromDate"] = autorest.Encode("query", *fromDate) + } + if toDate != nil { + queryParameters["toDate"] = autorest.Encode("query", *toDate) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.ADHybridHealthService/addsservices/{serviceName}/metrics/{metricName}/groups/{groupName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetMetricsSender sends the GetMetrics request. The method will close the +// http.Response Body if it receives an error. +func (client AddsServiceClient) GetMetricsSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetMetricsResponder handles the response to the GetMetrics request. The method always +// closes the http.Response Body. +func (client AddsServiceClient) GetMetricsResponder(resp *http.Response) (result MetricSets, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/adhybridhealthservice/mgmt/2014-01-01/adhybridhealthservice/addsservicemembers.go b/vendor/github.com/Azure/azure-sdk-for-go/services/adhybridhealthservice/mgmt/2014-01-01/adhybridhealthservice/addsservicemembers.go index e5ed7a9f8..a7b884648 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/adhybridhealthservice/mgmt/2014-01-01/adhybridhealthservice/addsservicemembers.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/adhybridhealthservice/mgmt/2014-01-01/adhybridhealthservice/addsservicemembers.go @@ -21,6 +21,7 @@ import ( "context" "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" + "github.com/satori/go.uuid" "net/http" ) @@ -39,6 +40,145 @@ func NewAddsServiceMembersClientWithBaseURI(baseURI string) AddsServiceMembersCl return AddsServiceMembersClient{NewWithBaseURI(baseURI)} } +// Delete deletes a Active Directory Domain Controller server that has been onboarded to Azure Active Directory Connect +// Health Service. +// Parameters: +// serviceName - the name of the service. +// serviceMemberID - the server Id. +// confirm - indicates if the server will be permanently deleted or disabled. True indicates that the server +// will be permanently deleted and False indicates that the server will be marked disabled and then deleted +// after 30 days, if it is not re-registered. +func (client AddsServiceMembersClient) Delete(ctx context.Context, serviceName string, serviceMemberID uuid.UUID, confirm *bool) (result autorest.Response, err error) { + req, err := client.DeletePreparer(ctx, serviceName, serviceMemberID, confirm) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.AddsServiceMembersClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "adhybridhealthservice.AddsServiceMembersClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.AddsServiceMembersClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client AddsServiceMembersClient) DeletePreparer(ctx context.Context, serviceName string, serviceMemberID uuid.UUID, confirm *bool) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "serviceMemberId": autorest.Encode("path", serviceMemberID), + "serviceName": autorest.Encode("path", serviceName), + } + + const APIVersion = "2014-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if confirm != nil { + queryParameters["confirm"] = autorest.Encode("query", *confirm) + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.ADHybridHealthService/addsservices/{serviceName}/servicemembers/{serviceMemberId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client AddsServiceMembersClient) DeleteSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client AddsServiceMembersClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the details of a server, for a given Active Directory Domain Controller service, that are onboarded to +// Azure Active Directory Connect Health Service. +// Parameters: +// serviceName - the name of the service. +// serviceMemberID - the server Id. +func (client AddsServiceMembersClient) Get(ctx context.Context, serviceName string, serviceMemberID uuid.UUID) (result ServiceMember, err error) { + req, err := client.GetPreparer(ctx, serviceName, serviceMemberID) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.AddsServiceMembersClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "adhybridhealthservice.AddsServiceMembersClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.AddsServiceMembersClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client AddsServiceMembersClient) GetPreparer(ctx context.Context, serviceName string, serviceMemberID uuid.UUID) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "serviceMemberId": autorest.Encode("path", serviceMemberID), + "serviceName": autorest.Encode("path", serviceName), + } + + const APIVersion = "2014-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.ADHybridHealthService/addsservices/{serviceName}/servicemembers/{serviceMemberId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client AddsServiceMembersClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client AddsServiceMembersClient) GetResponder(resp *http.Response) (result ServiceMember, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + // List gets the details of the Active Directory Domain servers, for a given Active Directory Domain Service, that are // onboarded to Azure Active Directory Connect Health. // Parameters: @@ -135,3 +275,74 @@ func (client AddsServiceMembersClient) ListComplete(ctx context.Context, service result.page, err = client.List(ctx, serviceName, filter) return } + +// ListCredentials gets the credentials of the server which is needed by the agent to connect to Azure Active Directory +// Connect Health Service. +// Parameters: +// serviceName - the name of the service. +// serviceMemberID - the server Id. +// filter - the property filter to apply. +func (client AddsServiceMembersClient) ListCredentials(ctx context.Context, serviceName string, serviceMemberID uuid.UUID, filter string) (result Credentials, err error) { + req, err := client.ListCredentialsPreparer(ctx, serviceName, serviceMemberID, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.AddsServiceMembersClient", "ListCredentials", nil, "Failure preparing request") + return + } + + resp, err := client.ListCredentialsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "adhybridhealthservice.AddsServiceMembersClient", "ListCredentials", resp, "Failure sending request") + return + } + + result, err = client.ListCredentialsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.AddsServiceMembersClient", "ListCredentials", resp, "Failure responding to request") + } + + return +} + +// ListCredentialsPreparer prepares the ListCredentials request. +func (client AddsServiceMembersClient) ListCredentialsPreparer(ctx context.Context, serviceName string, serviceMemberID uuid.UUID, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "serviceMemberId": autorest.Encode("path", serviceMemberID), + "serviceName": autorest.Encode("path", serviceName), + } + + const APIVersion = "2014-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.ADHybridHealthService/addsservices/{serviceName}/servicemembers/{serviceMemberId}/credentials", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListCredentialsSender sends the ListCredentials request. The method will close the +// http.Response Body if it receives an error. +func (client AddsServiceMembersClient) ListCredentialsSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// ListCredentialsResponder handles the response to the ListCredentials request. The method always +// closes the http.Response Body. +func (client AddsServiceMembersClient) ListCredentialsResponder(resp *http.Response) (result Credentials, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/adhybridhealthservice/mgmt/2014-01-01/adhybridhealthservice/addsservices.go b/vendor/github.com/Azure/azure-sdk-for-go/services/adhybridhealthservice/mgmt/2014-01-01/adhybridhealthservice/addsservices.go index 934b14a4c..abec74f8a 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/adhybridhealthservice/mgmt/2014-01-01/adhybridhealthservice/addsservices.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/adhybridhealthservice/mgmt/2014-01-01/adhybridhealthservice/addsservices.go @@ -448,71 +448,6 @@ func (client AddsServicesClient) GetMetricMetadataForGroupResponder(resp *http.R return } -// GetReplicationStatus gets Replication status for a given Active Directory Domain Service, that is onboarded to Azure -// Active Directory Connect Health. -// Parameters: -// serviceName - the name of the service. -func (client AddsServicesClient) GetReplicationStatus(ctx context.Context, serviceName string) (result ReplicationStatus, err error) { - req, err := client.GetReplicationStatusPreparer(ctx, serviceName) - if err != nil { - err = autorest.NewErrorWithError(err, "adhybridhealthservice.AddsServicesClient", "GetReplicationStatus", nil, "Failure preparing request") - return - } - - resp, err := client.GetReplicationStatusSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "adhybridhealthservice.AddsServicesClient", "GetReplicationStatus", resp, "Failure sending request") - return - } - - result, err = client.GetReplicationStatusResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "adhybridhealthservice.AddsServicesClient", "GetReplicationStatus", resp, "Failure responding to request") - } - - return -} - -// GetReplicationStatusPreparer prepares the GetReplicationStatus request. -func (client AddsServicesClient) GetReplicationStatusPreparer(ctx context.Context, serviceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "serviceName": autorest.Encode("path", serviceName), - } - - const APIVersion = "2014-01-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/providers/Microsoft.ADHybridHealthService/addsservices/{serviceName}/replicationstatus", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetReplicationStatusSender sends the GetReplicationStatus request. The method will close the -// http.Response Body if it receives an error. -func (client AddsServicesClient) GetReplicationStatusSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// GetReplicationStatusResponder handles the response to the GetReplicationStatus request. The method always -// closes the http.Response Body. -func (client AddsServicesClient) GetReplicationStatusResponder(resp *http.Response) (result ReplicationStatus, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - // List gets the details of Active Directory Domain Service, for a tenant, that are onboarded to Azure Active Directory // Connect Health. // Parameters: @@ -1019,6 +954,79 @@ func (client AddsServicesClient) ListPremiumServicesComplete(ctx context.Context return } +// ListReplicationDetails gets complete domain controller list along with replication details for a given Active +// Directory Domain Service, that is onboarded to Azure Active Directory Connect Health. +// Parameters: +// serviceName - the name of the service. +// filter - the server property filter to apply. +// withDetails - indicates if InboundReplicationNeighbor details are required or not. +func (client AddsServicesClient) ListReplicationDetails(ctx context.Context, serviceName string, filter string, withDetails *bool) (result ReplicationDetailsList, err error) { + req, err := client.ListReplicationDetailsPreparer(ctx, serviceName, filter, withDetails) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.AddsServicesClient", "ListReplicationDetails", nil, "Failure preparing request") + return + } + + resp, err := client.ListReplicationDetailsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "adhybridhealthservice.AddsServicesClient", "ListReplicationDetails", resp, "Failure sending request") + return + } + + result, err = client.ListReplicationDetailsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.AddsServicesClient", "ListReplicationDetails", resp, "Failure responding to request") + } + + return +} + +// ListReplicationDetailsPreparer prepares the ListReplicationDetails request. +func (client AddsServicesClient) ListReplicationDetailsPreparer(ctx context.Context, serviceName string, filter string, withDetails *bool) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "serviceName": autorest.Encode("path", serviceName), + } + + const APIVersion = "2014-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if withDetails != nil { + queryParameters["withDetails"] = autorest.Encode("query", *withDetails) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.ADHybridHealthService/addsservices/{serviceName}/replicationdetails", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListReplicationDetailsSender sends the ListReplicationDetails request. The method will close the +// http.Response Body if it receives an error. +func (client AddsServicesClient) ListReplicationDetailsSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// ListReplicationDetailsResponder handles the response to the ListReplicationDetails request. The method always +// closes the http.Response Body. +func (client AddsServicesClient) ListReplicationDetailsResponder(resp *http.Response) (result ReplicationDetailsList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + // ListReplicationSummary gets complete domain controller list along with replication details for a given Active // Directory Domain Service, that is onboarded to Azure Active Directory Connect Health. // Parameters: diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/adhybridhealthservice/mgmt/2014-01-01/adhybridhealthservice/addsservicesreplicationstatus.go b/vendor/github.com/Azure/azure-sdk-for-go/services/adhybridhealthservice/mgmt/2014-01-01/adhybridhealthservice/addsservicesreplicationstatus.go new file mode 100644 index 000000000..e93db2be3 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/adhybridhealthservice/mgmt/2014-01-01/adhybridhealthservice/addsservicesreplicationstatus.go @@ -0,0 +1,106 @@ +package adhybridhealthservice + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "net/http" +) + +// AddsServicesReplicationStatusClient is the REST APIs for Azure Active Drectory Connect Health +type AddsServicesReplicationStatusClient struct { + BaseClient +} + +// NewAddsServicesReplicationStatusClient creates an instance of the AddsServicesReplicationStatusClient client. +func NewAddsServicesReplicationStatusClient() AddsServicesReplicationStatusClient { + return NewAddsServicesReplicationStatusClientWithBaseURI(DefaultBaseURI) +} + +// NewAddsServicesReplicationStatusClientWithBaseURI creates an instance of the AddsServicesReplicationStatusClient +// client. +func NewAddsServicesReplicationStatusClientWithBaseURI(baseURI string) AddsServicesReplicationStatusClient { + return AddsServicesReplicationStatusClient{NewWithBaseURI(baseURI)} +} + +// Get gets Replication status for a given Active Directory Domain Service, that is onboarded to Azure Active Directory +// Connect Health. +// Parameters: +// serviceName - the name of the service. +func (client AddsServicesReplicationStatusClient) Get(ctx context.Context, serviceName string) (result ReplicationStatus, err error) { + req, err := client.GetPreparer(ctx, serviceName) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.AddsServicesReplicationStatusClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "adhybridhealthservice.AddsServicesReplicationStatusClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.AddsServicesReplicationStatusClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client AddsServicesReplicationStatusClient) GetPreparer(ctx context.Context, serviceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "serviceName": autorest.Encode("path", serviceName), + } + + const APIVersion = "2014-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.ADHybridHealthService/addsservices/{serviceName}/replicationstatus", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client AddsServicesReplicationStatusClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client AddsServicesReplicationStatusClient) GetResponder(resp *http.Response) (result ReplicationStatus, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/adhybridhealthservice/mgmt/2014-01-01/adhybridhealthservice/addsservicesservicemembers.go b/vendor/github.com/Azure/azure-sdk-for-go/services/adhybridhealthservice/mgmt/2014-01-01/adhybridhealthservice/addsservicesservicemembers.go new file mode 100644 index 000000000..de5a61815 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/adhybridhealthservice/mgmt/2014-01-01/adhybridhealthservice/addsservicesservicemembers.go @@ -0,0 +1,213 @@ +package adhybridhealthservice + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "net/http" +) + +// AddsServicesServiceMembersClient is the REST APIs for Azure Active Drectory Connect Health +type AddsServicesServiceMembersClient struct { + BaseClient +} + +// NewAddsServicesServiceMembersClient creates an instance of the AddsServicesServiceMembersClient client. +func NewAddsServicesServiceMembersClient() AddsServicesServiceMembersClient { + return NewAddsServicesServiceMembersClientWithBaseURI(DefaultBaseURI) +} + +// NewAddsServicesServiceMembersClientWithBaseURI creates an instance of the AddsServicesServiceMembersClient client. +func NewAddsServicesServiceMembersClientWithBaseURI(baseURI string) AddsServicesServiceMembersClient { + return AddsServicesServiceMembersClient{NewWithBaseURI(baseURI)} +} + +// Add onboards a server, for a given Active Directory Domain Controller service, to Azure Active Directory Connect +// Health Service. +// Parameters: +// serviceName - the name of the service under which the server is to be onboarded. +// serviceMember - the server object. +func (client AddsServicesServiceMembersClient) Add(ctx context.Context, serviceName string, serviceMember ServiceMember) (result ServiceMember, err error) { + req, err := client.AddPreparer(ctx, serviceName, serviceMember) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.AddsServicesServiceMembersClient", "Add", nil, "Failure preparing request") + return + } + + resp, err := client.AddSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "adhybridhealthservice.AddsServicesServiceMembersClient", "Add", resp, "Failure sending request") + return + } + + result, err = client.AddResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.AddsServicesServiceMembersClient", "Add", resp, "Failure responding to request") + } + + return +} + +// AddPreparer prepares the Add request. +func (client AddsServicesServiceMembersClient) AddPreparer(ctx context.Context, serviceName string, serviceMember ServiceMember) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "serviceName": autorest.Encode("path", serviceName), + } + + const APIVersion = "2014-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.ADHybridHealthService/addsservices/{serviceName}/servicemembers", pathParameters), + autorest.WithJSON(serviceMember), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// AddSender sends the Add request. The method will close the +// http.Response Body if it receives an error. +func (client AddsServicesServiceMembersClient) AddSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// AddResponder handles the response to the Add request. The method always +// closes the http.Response Body. +func (client AddsServicesServiceMembersClient) AddResponder(resp *http.Response) (result ServiceMember, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List gets the details of the servers, for a given Active Directory Domain Controller service, that are onboarded to +// Azure Active Directory Connect Health Service. +// Parameters: +// serviceName - the name of the service. +// filter - the server property filter to apply. +// dimensionType - the server specific dimension. +// dimensionSignature - the value of the dimension. +func (client AddsServicesServiceMembersClient) List(ctx context.Context, serviceName string, filter string, dimensionType string, dimensionSignature string) (result ServiceMembersPage, err error) { + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, serviceName, filter, dimensionType, dimensionSignature) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.AddsServicesServiceMembersClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.sm.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "adhybridhealthservice.AddsServicesServiceMembersClient", "List", resp, "Failure sending request") + return + } + + result.sm, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.AddsServicesServiceMembersClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client AddsServicesServiceMembersClient) ListPreparer(ctx context.Context, serviceName string, filter string, dimensionType string, dimensionSignature string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "serviceName": autorest.Encode("path", serviceName), + } + + const APIVersion = "2014-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if len(dimensionType) > 0 { + queryParameters["dimensionType"] = autorest.Encode("query", dimensionType) + } + if len(dimensionSignature) > 0 { + queryParameters["dimensionSignature"] = autorest.Encode("query", dimensionSignature) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.ADHybridHealthService/addsservices/{serviceName}/servicemembers", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client AddsServicesServiceMembersClient) ListSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client AddsServicesServiceMembersClient) ListResponder(resp *http.Response) (result ServiceMembers, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client AddsServicesServiceMembersClient) listNextResults(lastResults ServiceMembers) (result ServiceMembers, err error) { + req, err := lastResults.serviceMembersPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "adhybridhealthservice.AddsServicesServiceMembersClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "adhybridhealthservice.AddsServicesServiceMembersClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.AddsServicesServiceMembersClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client AddsServicesServiceMembersClient) ListComplete(ctx context.Context, serviceName string, filter string, dimensionType string, dimensionSignature string) (result ServiceMembersIterator, err error) { + result.page, err = client.List(ctx, serviceName, filter, dimensionType, dimensionSignature) + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/adhybridhealthservice/mgmt/2014-01-01/adhybridhealthservice/addsservicesuserpreference.go b/vendor/github.com/Azure/azure-sdk-for-go/services/adhybridhealthservice/mgmt/2014-01-01/adhybridhealthservice/addsservicesuserpreference.go new file mode 100644 index 000000000..da339bb29 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/adhybridhealthservice/mgmt/2014-01-01/adhybridhealthservice/addsservicesuserpreference.go @@ -0,0 +1,239 @@ +package adhybridhealthservice + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "net/http" +) + +// AddsServicesUserPreferenceClient is the REST APIs for Azure Active Drectory Connect Health +type AddsServicesUserPreferenceClient struct { + BaseClient +} + +// NewAddsServicesUserPreferenceClient creates an instance of the AddsServicesUserPreferenceClient client. +func NewAddsServicesUserPreferenceClient() AddsServicesUserPreferenceClient { + return NewAddsServicesUserPreferenceClientWithBaseURI(DefaultBaseURI) +} + +// NewAddsServicesUserPreferenceClientWithBaseURI creates an instance of the AddsServicesUserPreferenceClient client. +func NewAddsServicesUserPreferenceClientWithBaseURI(baseURI string) AddsServicesUserPreferenceClient { + return AddsServicesUserPreferenceClient{NewWithBaseURI(baseURI)} +} + +// Add adds the user preferences for a given feature. +// Parameters: +// serviceName - the name of the service. +// featureName - the name of the feature. +// setting - the user preference setting. +func (client AddsServicesUserPreferenceClient) Add(ctx context.Context, serviceName string, featureName string, setting UserPreference) (result autorest.Response, err error) { + req, err := client.AddPreparer(ctx, serviceName, featureName, setting) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.AddsServicesUserPreferenceClient", "Add", nil, "Failure preparing request") + return + } + + resp, err := client.AddSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "adhybridhealthservice.AddsServicesUserPreferenceClient", "Add", resp, "Failure sending request") + return + } + + result, err = client.AddResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.AddsServicesUserPreferenceClient", "Add", resp, "Failure responding to request") + } + + return +} + +// AddPreparer prepares the Add request. +func (client AddsServicesUserPreferenceClient) AddPreparer(ctx context.Context, serviceName string, featureName string, setting UserPreference) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "featureName": autorest.Encode("path", featureName), + "serviceName": autorest.Encode("path", serviceName), + } + + const APIVersion = "2014-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.ADHybridHealthService/addsservices/{serviceName}/features/{featureName}/userpreference", pathParameters), + autorest.WithJSON(setting), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// AddSender sends the Add request. The method will close the +// http.Response Body if it receives an error. +func (client AddsServicesUserPreferenceClient) AddSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// AddResponder handles the response to the Add request. The method always +// closes the http.Response Body. +func (client AddsServicesUserPreferenceClient) AddResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Delete deletes the user preferences for a given feature. +// Parameters: +// serviceName - the name of the service. +// featureName - the name of the feature. +func (client AddsServicesUserPreferenceClient) Delete(ctx context.Context, serviceName string, featureName string) (result autorest.Response, err error) { + req, err := client.DeletePreparer(ctx, serviceName, featureName) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.AddsServicesUserPreferenceClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "adhybridhealthservice.AddsServicesUserPreferenceClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.AddsServicesUserPreferenceClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client AddsServicesUserPreferenceClient) DeletePreparer(ctx context.Context, serviceName string, featureName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "featureName": autorest.Encode("path", featureName), + "serviceName": autorest.Encode("path", serviceName), + } + + const APIVersion = "2014-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.ADHybridHealthService/addsservices/{serviceName}/features/{featureName}/userpreference", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client AddsServicesUserPreferenceClient) DeleteSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client AddsServicesUserPreferenceClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the user preferences for a given feature. +// Parameters: +// serviceName - the name of the service. +// featureName - the name of the feature. +func (client AddsServicesUserPreferenceClient) Get(ctx context.Context, serviceName string, featureName string) (result UserPreference, err error) { + req, err := client.GetPreparer(ctx, serviceName, featureName) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.AddsServicesUserPreferenceClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "adhybridhealthservice.AddsServicesUserPreferenceClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.AddsServicesUserPreferenceClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client AddsServicesUserPreferenceClient) GetPreparer(ctx context.Context, serviceName string, featureName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "featureName": autorest.Encode("path", featureName), + "serviceName": autorest.Encode("path", serviceName), + } + + const APIVersion = "2014-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.ADHybridHealthService/addsservices/{serviceName}/features/{featureName}/userpreference", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client AddsServicesUserPreferenceClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client AddsServicesUserPreferenceClient) GetResponder(resp *http.Response) (result UserPreference, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/adhybridhealthservice/mgmt/2014-01-01/adhybridhealthservice/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/adhybridhealthservice/mgmt/2014-01-01/adhybridhealthservice/models.go index beba71acf..76e517e34 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/adhybridhealthservice/mgmt/2014-01-01/adhybridhealthservice/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/adhybridhealthservice/mgmt/2014-01-01/adhybridhealthservice/models.go @@ -2110,6 +2110,19 @@ type PasswordManagementSettings struct { UnlockAccount *bool `json:"unlockAccount,omitempty"` } +// ReplicationDetailsList the list of replication details. +type ReplicationDetailsList struct { + autorest.Response `json:"-"` + // Value - The value returned by the operation. + Value *[]ReplicationSummary `json:"value,omitempty"` + // TotalCount - The total count of replication detail elements. + TotalCount *int32 `json:"totalCount,omitempty"` + // ContinuationToken - The continuation token for paginated calls. + ContinuationToken *string `json:"continuationToken,omitempty"` + // NextLink - The link used to get the next page of operations. + NextLink *string `json:"nextLink,omitempty"` +} + // ReplicationStatus replication summary for a domain controller. type ReplicationStatus struct { autorest.Response `json:"-"` @@ -2613,6 +2626,13 @@ type TenantOnboardingDetails struct { OnboardingDisplayURL *string `json:"onboardingDisplayUrl,omitempty"` } +// UserPreference the user preference for a given feature. +type UserPreference struct { + autorest.Response `json:"-"` + // MetricNames - The name of the metric. + MetricNames *[]string `json:"metricNames,omitempty"` +} + // ValueDelta the value of the delta. type ValueDelta struct { // OperationType - The operation type. Possible values include: 'ValueDeltaOperationTypeUndefined', 'ValueDeltaOperationTypeAdd', 'ValueDeltaOperationTypeUpdate', 'ValueDeltaOperationTypeDelete' diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/adhybridhealthservice/mgmt/2014-01-01/adhybridhealthservice/reports.go b/vendor/github.com/Azure/azure-sdk-for-go/services/adhybridhealthservice/mgmt/2014-01-01/adhybridhealthservice/reports.go new file mode 100644 index 000000000..0c25a2fc1 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/adhybridhealthservice/mgmt/2014-01-01/adhybridhealthservice/reports.go @@ -0,0 +1,98 @@ +package adhybridhealthservice + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "net/http" +) + +// ReportsClient is the REST APIs for Azure Active Drectory Connect Health +type ReportsClient struct { + BaseClient +} + +// NewReportsClient creates an instance of the ReportsClient client. +func NewReportsClient() ReportsClient { + return NewReportsClientWithBaseURI(DefaultBaseURI) +} + +// NewReportsClientWithBaseURI creates an instance of the ReportsClient client. +func NewReportsClientWithBaseURI(baseURI string) ReportsClient { + return ReportsClient{NewWithBaseURI(baseURI)} +} + +// GetDevOps checks if the user is enabled for Dev Ops access. +func (client ReportsClient) GetDevOps(ctx context.Context) (result Result, err error) { + req, err := client.GetDevOpsPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.ReportsClient", "GetDevOps", nil, "Failure preparing request") + return + } + + resp, err := client.GetDevOpsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "adhybridhealthservice.ReportsClient", "GetDevOps", resp, "Failure sending request") + return + } + + result, err = client.GetDevOpsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.ReportsClient", "GetDevOps", resp, "Failure responding to request") + } + + return +} + +// GetDevOpsPreparer prepares the GetDevOps request. +func (client ReportsClient) GetDevOpsPreparer(ctx context.Context) (*http.Request, error) { + const APIVersion = "2014-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/providers/Microsoft.ADHybridHealthService/reports/DevOps/IsDevOps"), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetDevOpsSender sends the GetDevOps request. The method will close the +// http.Response Body if it receives an error. +func (client ReportsClient) GetDevOpsSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetDevOpsResponder handles the response to the GetDevOps request. The method always +// closes the http.Response Body. +func (client ReportsClient) GetDevOpsResponder(resp *http.Response) (result Result, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/adhybridhealthservice/mgmt/2014-01-01/adhybridhealthservice/service.go b/vendor/github.com/Azure/azure-sdk-for-go/services/adhybridhealthservice/mgmt/2014-01-01/adhybridhealthservice/service.go new file mode 100644 index 000000000..7b88067a6 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/adhybridhealthservice/mgmt/2014-01-01/adhybridhealthservice/service.go @@ -0,0 +1,121 @@ +package adhybridhealthservice + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/date" + "net/http" +) + +// ServiceClient is the REST APIs for Azure Active Drectory Connect Health +type ServiceClient struct { + BaseClient +} + +// NewServiceClient creates an instance of the ServiceClient client. +func NewServiceClient() ServiceClient { + return NewServiceClientWithBaseURI(DefaultBaseURI) +} + +// NewServiceClientWithBaseURI creates an instance of the ServiceClient client. +func NewServiceClientWithBaseURI(baseURI string) ServiceClient { + return ServiceClient{NewWithBaseURI(baseURI)} +} + +// GetMetrics gets the server related metrics for a given metric and group combination. +// Parameters: +// serviceName - the name of the service. +// metricName - the metric name +// groupName - the group name +// groupKey - the group key +// fromDate - the start date. +// toDate - the end date. +func (client ServiceClient) GetMetrics(ctx context.Context, serviceName string, metricName string, groupName string, groupKey string, fromDate *date.Time, toDate *date.Time) (result MetricSets, err error) { + req, err := client.GetMetricsPreparer(ctx, serviceName, metricName, groupName, groupKey, fromDate, toDate) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServiceClient", "GetMetrics", nil, "Failure preparing request") + return + } + + resp, err := client.GetMetricsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServiceClient", "GetMetrics", resp, "Failure sending request") + return + } + + result, err = client.GetMetricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServiceClient", "GetMetrics", resp, "Failure responding to request") + } + + return +} + +// GetMetricsPreparer prepares the GetMetrics request. +func (client ServiceClient) GetMetricsPreparer(ctx context.Context, serviceName string, metricName string, groupName string, groupKey string, fromDate *date.Time, toDate *date.Time) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "groupName": autorest.Encode("path", groupName), + "metricName": autorest.Encode("path", metricName), + "serviceName": autorest.Encode("path", serviceName), + } + + const APIVersion = "2014-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(groupKey) > 0 { + queryParameters["groupKey"] = autorest.Encode("query", groupKey) + } + if fromDate != nil { + queryParameters["fromDate"] = autorest.Encode("query", *fromDate) + } + if toDate != nil { + queryParameters["toDate"] = autorest.Encode("query", *toDate) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.ADHybridHealthService/services/{serviceName}/metrics/{metricName}/groups/{groupName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetMetricsSender sends the GetMetrics request. The method will close the +// http.Response Body if it receives an error. +func (client ServiceClient) GetMetricsSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetMetricsResponder handles the response to the GetMetrics request. The method always +// closes the http.Response Body. +func (client ServiceClient) GetMetricsResponder(resp *http.Response) (result MetricSets, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/adhybridhealthservice/mgmt/2014-01-01/adhybridhealthservice/servicemembers.go b/vendor/github.com/Azure/azure-sdk-for-go/services/adhybridhealthservice/mgmt/2014-01-01/adhybridhealthservice/servicemembers.go index 5ab001dac..dd2ee6b62 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/adhybridhealthservice/mgmt/2014-01-01/adhybridhealthservice/servicemembers.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/adhybridhealthservice/mgmt/2014-01-01/adhybridhealthservice/servicemembers.go @@ -311,6 +311,88 @@ func (client ServiceMembersClient) GetResponder(resp *http.Response) (result Ser return } +// GetMetrics gets the server related metrics for a given metric and group combination. +// Parameters: +// serviceName - the name of the service. +// metricName - the metric name +// groupName - the group name +// serviceMemberID - the server id. +// groupKey - the group key +// fromDate - the start date. +// toDate - the end date. +func (client ServiceMembersClient) GetMetrics(ctx context.Context, serviceName string, metricName string, groupName string, serviceMemberID uuid.UUID, groupKey string, fromDate *date.Time, toDate *date.Time) (result MetricSets, err error) { + req, err := client.GetMetricsPreparer(ctx, serviceName, metricName, groupName, serviceMemberID, groupKey, fromDate, toDate) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServiceMembersClient", "GetMetrics", nil, "Failure preparing request") + return + } + + resp, err := client.GetMetricsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServiceMembersClient", "GetMetrics", resp, "Failure sending request") + return + } + + result, err = client.GetMetricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServiceMembersClient", "GetMetrics", resp, "Failure responding to request") + } + + return +} + +// GetMetricsPreparer prepares the GetMetrics request. +func (client ServiceMembersClient) GetMetricsPreparer(ctx context.Context, serviceName string, metricName string, groupName string, serviceMemberID uuid.UUID, groupKey string, fromDate *date.Time, toDate *date.Time) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "groupName": autorest.Encode("path", groupName), + "metricName": autorest.Encode("path", metricName), + "serviceMemberId": autorest.Encode("path", serviceMemberID), + "serviceName": autorest.Encode("path", serviceName), + } + + const APIVersion = "2014-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(groupKey) > 0 { + queryParameters["groupKey"] = autorest.Encode("query", groupKey) + } + if fromDate != nil { + queryParameters["fromDate"] = autorest.Encode("query", *fromDate) + } + if toDate != nil { + queryParameters["toDate"] = autorest.Encode("query", *toDate) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.ADHybridHealthService/services/{serviceName}/servicemembers/{serviceMemberId}/metrics/{metricName}/groups/{groupName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetMetricsSender sends the GetMetrics request. The method will close the +// http.Response Body if it receives an error. +func (client ServiceMembersClient) GetMetricsSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetMetricsResponder handles the response to the GetMetrics request. The method always +// closes the http.Response Body. +func (client ServiceMembersClient) GetMetricsResponder(resp *http.Response) (result MetricSets, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + // GetServiceConfiguration gets the service configuration. // Parameters: // serviceName - the name of the service. @@ -954,85 +1036,3 @@ func (client ServiceMembersClient) ListGlobalConfigurationResponder(resp *http.R result.Response = autorest.Response{Response: resp} return } - -// ListMetrics gets the server related metrics for a given metric and group combination. -// Parameters: -// serviceName - the name of the service. -// metricName - the metric name -// groupName - the group name -// serviceMemberID - the server id. -// groupKey - the group key -// fromDate - the start date. -// toDate - the end date. -func (client ServiceMembersClient) ListMetrics(ctx context.Context, serviceName string, metricName string, groupName string, serviceMemberID uuid.UUID, groupKey string, fromDate *date.Time, toDate *date.Time) (result MetricSets, err error) { - req, err := client.ListMetricsPreparer(ctx, serviceName, metricName, groupName, serviceMemberID, groupKey, fromDate, toDate) - if err != nil { - err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServiceMembersClient", "ListMetrics", nil, "Failure preparing request") - return - } - - resp, err := client.ListMetricsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServiceMembersClient", "ListMetrics", resp, "Failure sending request") - return - } - - result, err = client.ListMetricsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServiceMembersClient", "ListMetrics", resp, "Failure responding to request") - } - - return -} - -// ListMetricsPreparer prepares the ListMetrics request. -func (client ServiceMembersClient) ListMetricsPreparer(ctx context.Context, serviceName string, metricName string, groupName string, serviceMemberID uuid.UUID, groupKey string, fromDate *date.Time, toDate *date.Time) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "groupName": autorest.Encode("path", groupName), - "metricName": autorest.Encode("path", metricName), - "serviceMemberId": autorest.Encode("path", serviceMemberID), - "serviceName": autorest.Encode("path", serviceName), - } - - const APIVersion = "2014-01-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(groupKey) > 0 { - queryParameters["groupKey"] = autorest.Encode("query", groupKey) - } - if fromDate != nil { - queryParameters["fromDate"] = autorest.Encode("query", *fromDate) - } - if toDate != nil { - queryParameters["toDate"] = autorest.Encode("query", *toDate) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/providers/Microsoft.ADHybridHealthService/services/{serviceName}/servicemembers/{serviceMemberId}/metrics/{metricName}/groups/{groupName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListMetricsSender sends the ListMetrics request. The method will close the -// http.Response Body if it receives an error. -func (client ServiceMembersClient) ListMetricsSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// ListMetricsResponder handles the response to the ListMetrics request. The method always -// closes the http.Response Body. -func (client ServiceMembersClient) ListMetricsResponder(resp *http.Response) (result MetricSets, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/advisor/mgmt/2017-04-19/advisor/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/advisor/mgmt/2017-04-19/advisor/models.go index 43a997f0f..a9e003da2 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/advisor/mgmt/2017-04-19/advisor/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/advisor/mgmt/2017-04-19/advisor/models.go @@ -20,7 +20,6 @@ package advisor import ( "encoding/json" "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" "github.com/Azure/go-autorest/autorest/date" "github.com/Azure/go-autorest/autorest/to" "github.com/satori/go.uuid" @@ -410,29 +409,6 @@ func (rp RecommendationProperties) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// RecommendationsGetGenerateStatusFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type RecommendationsGetGenerateStatusFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *RecommendationsGetGenerateStatusFuture) Result(client RecommendationsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.Done(client) - if err != nil { - err = autorest.NewErrorWithError(err, "advisor.RecommendationsGetGenerateStatusFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("advisor.RecommendationsGetGenerateStatusFuture") - return - } - ar.Response = future.Response() - return -} - // Resource an Azure resource. type Resource struct { // ID - The resource ID. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/advisor/mgmt/2017-04-19/advisor/recommendations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/advisor/mgmt/2017-04-19/advisor/recommendations.go index 3b0396e03..c153a6d8b 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/advisor/mgmt/2017-04-19/advisor/recommendations.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/advisor/mgmt/2017-04-19/advisor/recommendations.go @@ -175,19 +175,25 @@ func (client RecommendationsClient) GetResponder(resp *http.Response) (result Re // Parameters: // operationID - the operation ID, which can be found from the Location field in the generate recommendation // response header. -func (client RecommendationsClient) GetGenerateStatus(ctx context.Context, operationID uuid.UUID) (result RecommendationsGetGenerateStatusFuture, err error) { +func (client RecommendationsClient) GetGenerateStatus(ctx context.Context, operationID uuid.UUID) (result autorest.Response, err error) { req, err := client.GetGenerateStatusPreparer(ctx, operationID) if err != nil { err = autorest.NewErrorWithError(err, "advisor.RecommendationsClient", "GetGenerateStatus", nil, "Failure preparing request") return } - result, err = client.GetGenerateStatusSender(req) + resp, err := client.GetGenerateStatusSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "advisor.RecommendationsClient", "GetGenerateStatus", result.Response(), "Failure sending request") + result.Response = resp + err = autorest.NewErrorWithError(err, "advisor.RecommendationsClient", "GetGenerateStatus", resp, "Failure sending request") return } + result, err = client.GetGenerateStatusResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "advisor.RecommendationsClient", "GetGenerateStatus", resp, "Failure responding to request") + } + return } @@ -213,19 +219,9 @@ func (client RecommendationsClient) GetGenerateStatusPreparer(ctx context.Contex // GetGenerateStatusSender sends the GetGenerateStatus request. The method will close the // http.Response Body if it receives an error. -func (client RecommendationsClient) GetGenerateStatusSender(req *http.Request) (future RecommendationsGetGenerateStatusFuture, err error) { - var resp *http.Response - resp, err = autorest.SendWithSender(client, req, +func (client RecommendationsClient) GetGenerateStatusSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent)) - if err != nil { - return - } - future.Future, err = azure.NewFutureFromResponse(resp) - return } // GetGenerateStatusResponder handles the response to the GetGenerateStatus request. The method always diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2015-05-01/insights/analyticsitem.go b/vendor/github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2015-05-01/insights/analyticsitems.go similarity index 71% rename from vendor/github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2015-05-01/insights/analyticsitem.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2015-05-01/insights/analyticsitems.go index a3a3c27d6..c4949b0fa 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2015-05-01/insights/analyticsitem.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2015-05-01/insights/analyticsitems.go @@ -24,19 +24,19 @@ import ( "net/http" ) -// AnalyticsItemClient is the composite Swagger for Application Insights Management Client -type AnalyticsItemClient struct { +// AnalyticsItemsClient is the composite Swagger for Application Insights Management Client +type AnalyticsItemsClient struct { BaseClient } -// NewAnalyticsItemClient creates an instance of the AnalyticsItemClient client. -func NewAnalyticsItemClient(subscriptionID string) AnalyticsItemClient { - return NewAnalyticsItemClientWithBaseURI(DefaultBaseURI, subscriptionID) +// NewAnalyticsItemsClient creates an instance of the AnalyticsItemsClient client. +func NewAnalyticsItemsClient(subscriptionID string) AnalyticsItemsClient { + return NewAnalyticsItemsClientWithBaseURI(DefaultBaseURI, subscriptionID) } -// NewAnalyticsItemClientWithBaseURI creates an instance of the AnalyticsItemClient client. -func NewAnalyticsItemClientWithBaseURI(baseURI string, subscriptionID string) AnalyticsItemClient { - return AnalyticsItemClient{NewWithBaseURI(baseURI, subscriptionID)} +// NewAnalyticsItemsClientWithBaseURI creates an instance of the AnalyticsItemsClient client. +func NewAnalyticsItemsClientWithBaseURI(baseURI string, subscriptionID string) AnalyticsItemsClient { + return AnalyticsItemsClient{NewWithBaseURI(baseURI, subscriptionID)} } // Delete deletes a specific Analytics Items defined within an Application Insights component. @@ -47,30 +47,30 @@ func NewAnalyticsItemClientWithBaseURI(baseURI string, subscriptionID string) An // users with access to the Application Insights component. // ID - the Id of a specific item defined in the Application Insights component // name - the name of a specific item defined in the Application Insights component -func (client AnalyticsItemClient) Delete(ctx context.Context, resourceGroupName string, resourceName string, scopePath ItemScopePath, ID string, name string) (result autorest.Response, err error) { +func (client AnalyticsItemsClient) Delete(ctx context.Context, resourceGroupName string, resourceName string, scopePath ItemScopePath, ID string, name string) (result autorest.Response, err error) { req, err := client.DeletePreparer(ctx, resourceGroupName, resourceName, scopePath, ID, name) if err != nil { - err = autorest.NewErrorWithError(err, "insights.AnalyticsItemClient", "Delete", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "insights.AnalyticsItemsClient", "Delete", nil, "Failure preparing request") return } resp, err := client.DeleteSender(req) if err != nil { result.Response = resp - err = autorest.NewErrorWithError(err, "insights.AnalyticsItemClient", "Delete", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "insights.AnalyticsItemsClient", "Delete", resp, "Failure sending request") return } result, err = client.DeleteResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "insights.AnalyticsItemClient", "Delete", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "insights.AnalyticsItemsClient", "Delete", resp, "Failure responding to request") } return } // DeletePreparer prepares the Delete request. -func (client AnalyticsItemClient) DeletePreparer(ctx context.Context, resourceGroupName string, resourceName string, scopePath ItemScopePath, ID string, name string) (*http.Request, error) { +func (client AnalyticsItemsClient) DeletePreparer(ctx context.Context, resourceGroupName string, resourceName string, scopePath ItemScopePath, ID string, name string) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "resourceName": autorest.Encode("path", resourceName), @@ -99,14 +99,14 @@ func (client AnalyticsItemClient) DeletePreparer(ctx context.Context, resourceGr // DeleteSender sends the Delete request. The method will close the // http.Response Body if it receives an error. -func (client AnalyticsItemClient) DeleteSender(req *http.Request) (*http.Response, error) { +func (client AnalyticsItemsClient) DeleteSender(req *http.Request) (*http.Response, error) { return autorest.SendWithSender(client, req, azure.DoRetryWithRegistration(client.Client)) } // DeleteResponder handles the response to the Delete request. The method always // closes the http.Response Body. -func (client AnalyticsItemClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { +func (client AnalyticsItemsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -124,30 +124,30 @@ func (client AnalyticsItemClient) DeleteResponder(resp *http.Response) (result a // users with access to the Application Insights component. // ID - the Id of a specific item defined in the Application Insights component // name - the name of a specific item defined in the Application Insights component -func (client AnalyticsItemClient) Get(ctx context.Context, resourceGroupName string, resourceName string, scopePath ItemScopePath, ID string, name string) (result ApplicationInsightsComponentAnalyticsItem, err error) { +func (client AnalyticsItemsClient) Get(ctx context.Context, resourceGroupName string, resourceName string, scopePath ItemScopePath, ID string, name string) (result ApplicationInsightsComponentAnalyticsItem, err error) { req, err := client.GetPreparer(ctx, resourceGroupName, resourceName, scopePath, ID, name) if err != nil { - err = autorest.NewErrorWithError(err, "insights.AnalyticsItemClient", "Get", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "insights.AnalyticsItemsClient", "Get", nil, "Failure preparing request") return } resp, err := client.GetSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "insights.AnalyticsItemClient", "Get", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "insights.AnalyticsItemsClient", "Get", resp, "Failure sending request") return } result, err = client.GetResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "insights.AnalyticsItemClient", "Get", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "insights.AnalyticsItemsClient", "Get", resp, "Failure responding to request") } return } // GetPreparer prepares the Get request. -func (client AnalyticsItemClient) GetPreparer(ctx context.Context, resourceGroupName string, resourceName string, scopePath ItemScopePath, ID string, name string) (*http.Request, error) { +func (client AnalyticsItemsClient) GetPreparer(ctx context.Context, resourceGroupName string, resourceName string, scopePath ItemScopePath, ID string, name string) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "resourceName": autorest.Encode("path", resourceName), @@ -176,14 +176,14 @@ func (client AnalyticsItemClient) GetPreparer(ctx context.Context, resourceGroup // GetSender sends the Get request. The method will close the // http.Response Body if it receives an error. -func (client AnalyticsItemClient) GetSender(req *http.Request) (*http.Response, error) { +func (client AnalyticsItemsClient) GetSender(req *http.Request) (*http.Response, error) { return autorest.SendWithSender(client, req, azure.DoRetryWithRegistration(client.Client)) } // GetResponder handles the response to the Get request. The method always // closes the http.Response Body. -func (client AnalyticsItemClient) GetResponder(resp *http.Response) (result ApplicationInsightsComponentAnalyticsItem, err error) { +func (client AnalyticsItemsClient) GetResponder(resp *http.Response) (result ApplicationInsightsComponentAnalyticsItem, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -205,30 +205,30 @@ func (client AnalyticsItemClient) GetResponder(resp *http.Response) (result Appl // typeParameter - enum indicating the type of the Analytics item. // includeContent - flag indicating whether or not to return the content of each applicable item. If false, // only return the item information. -func (client AnalyticsItemClient) List(ctx context.Context, resourceGroupName string, resourceName string, scopePath ItemScopePath, scope ItemScope, typeParameter ItemTypeParameter, includeContent *bool) (result ListApplicationInsightsComponentAnalyticsItem, err error) { +func (client AnalyticsItemsClient) List(ctx context.Context, resourceGroupName string, resourceName string, scopePath ItemScopePath, scope ItemScope, typeParameter ItemTypeParameter, includeContent *bool) (result ListApplicationInsightsComponentAnalyticsItem, err error) { req, err := client.ListPreparer(ctx, resourceGroupName, resourceName, scopePath, scope, typeParameter, includeContent) if err != nil { - err = autorest.NewErrorWithError(err, "insights.AnalyticsItemClient", "List", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "insights.AnalyticsItemsClient", "List", nil, "Failure preparing request") return } resp, err := client.ListSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "insights.AnalyticsItemClient", "List", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "insights.AnalyticsItemsClient", "List", resp, "Failure sending request") return } result, err = client.ListResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "insights.AnalyticsItemClient", "List", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "insights.AnalyticsItemsClient", "List", resp, "Failure responding to request") } return } // ListPreparer prepares the List request. -func (client AnalyticsItemClient) ListPreparer(ctx context.Context, resourceGroupName string, resourceName string, scopePath ItemScopePath, scope ItemScope, typeParameter ItemTypeParameter, includeContent *bool) (*http.Request, error) { +func (client AnalyticsItemsClient) ListPreparer(ctx context.Context, resourceGroupName string, resourceName string, scopePath ItemScopePath, scope ItemScope, typeParameter ItemTypeParameter, includeContent *bool) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "resourceName": autorest.Encode("path", resourceName), @@ -264,14 +264,14 @@ func (client AnalyticsItemClient) ListPreparer(ctx context.Context, resourceGrou // ListSender sends the List request. The method will close the // http.Response Body if it receives an error. -func (client AnalyticsItemClient) ListSender(req *http.Request) (*http.Response, error) { +func (client AnalyticsItemsClient) ListSender(req *http.Request) (*http.Response, error) { return autorest.SendWithSender(client, req, azure.DoRetryWithRegistration(client.Client)) } // ListResponder handles the response to the List request. The method always // closes the http.Response Body. -func (client AnalyticsItemClient) ListResponder(resp *http.Response) (result ListApplicationInsightsComponentAnalyticsItem, err error) { +func (client AnalyticsItemsClient) ListResponder(resp *http.Response) (result ListApplicationInsightsComponentAnalyticsItem, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -292,30 +292,30 @@ func (client AnalyticsItemClient) ListResponder(resp *http.Response) (result Lis // Insights component. // overrideItem - flag indicating whether or not to force save an item. This allows overriding an item if it // already exists. -func (client AnalyticsItemClient) Put(ctx context.Context, resourceGroupName string, resourceName string, scopePath ItemScopePath, itemProperties ApplicationInsightsComponentAnalyticsItem, overrideItem *bool) (result ApplicationInsightsComponentAnalyticsItem, err error) { +func (client AnalyticsItemsClient) Put(ctx context.Context, resourceGroupName string, resourceName string, scopePath ItemScopePath, itemProperties ApplicationInsightsComponentAnalyticsItem, overrideItem *bool) (result ApplicationInsightsComponentAnalyticsItem, err error) { req, err := client.PutPreparer(ctx, resourceGroupName, resourceName, scopePath, itemProperties, overrideItem) if err != nil { - err = autorest.NewErrorWithError(err, "insights.AnalyticsItemClient", "Put", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "insights.AnalyticsItemsClient", "Put", nil, "Failure preparing request") return } resp, err := client.PutSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "insights.AnalyticsItemClient", "Put", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "insights.AnalyticsItemsClient", "Put", resp, "Failure sending request") return } result, err = client.PutResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "insights.AnalyticsItemClient", "Put", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "insights.AnalyticsItemsClient", "Put", resp, "Failure responding to request") } return } // PutPreparer prepares the Put request. -func (client AnalyticsItemClient) PutPreparer(ctx context.Context, resourceGroupName string, resourceName string, scopePath ItemScopePath, itemProperties ApplicationInsightsComponentAnalyticsItem, overrideItem *bool) (*http.Request, error) { +func (client AnalyticsItemsClient) PutPreparer(ctx context.Context, resourceGroupName string, resourceName string, scopePath ItemScopePath, itemProperties ApplicationInsightsComponentAnalyticsItem, overrideItem *bool) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "resourceName": autorest.Encode("path", resourceName), @@ -343,14 +343,14 @@ func (client AnalyticsItemClient) PutPreparer(ctx context.Context, resourceGroup // PutSender sends the Put request. The method will close the // http.Response Body if it receives an error. -func (client AnalyticsItemClient) PutSender(req *http.Request) (*http.Response, error) { +func (client AnalyticsItemsClient) PutSender(req *http.Request) (*http.Response, error) { return autorest.SendWithSender(client, req, azure.DoRetryWithRegistration(client.Client)) } // PutResponder handles the response to the Put request. The method always // closes the http.Response Body. -func (client AnalyticsItemClient) PutResponder(resp *http.Response) (result ApplicationInsightsComponentAnalyticsItem, err error) { +func (client AnalyticsItemsClient) PutResponder(resp *http.Response) (result ApplicationInsightsComponentAnalyticsItem, err error) { err = autorest.Respond( resp, client.ByInspecting(), diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2015-05-01/insights/annotations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2015-05-01/insights/annotations.go index 7e548ea9a..fab37ef31 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2015-05-01/insights/annotations.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2015-05-01/insights/annotations.go @@ -254,7 +254,7 @@ func (client AnnotationsClient) GetResponder(resp *http.Response) (result ListAn // resourceName - the name of the Application Insights component resource. // start - the start time to query from for annotations, cannot be older than 90 days from current date. // end - the end time to query for annotations. -func (client AnnotationsClient) List(ctx context.Context, resourceGroupName string, resourceName string, start string, end string) (result ListAnnotation, err error) { +func (client AnnotationsClient) List(ctx context.Context, resourceGroupName string, resourceName string, start string, end string) (result AnnotationsListResult, err error) { req, err := client.ListPreparer(ctx, resourceGroupName, resourceName, start, end) if err != nil { err = autorest.NewErrorWithError(err, "insights.AnnotationsClient", "List", nil, "Failure preparing request") @@ -308,12 +308,12 @@ func (client AnnotationsClient) ListSender(req *http.Request) (*http.Response, e // ListResponder handles the response to the List request. The method always // closes the http.Response Body. -func (client AnnotationsClient) ListResponder(resp *http.Response) (result ListAnnotation, err error) { +func (client AnnotationsClient) ListResponder(resp *http.Response) (result AnnotationsListResult, err error) { err = autorest.Respond( resp, client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2015-05-01/insights/components.go b/vendor/github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2015-05-01/insights/components.go index 556529872..e52d86e5f 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2015-05-01/insights/components.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2015-05-01/insights/components.go @@ -250,6 +250,75 @@ func (client ComponentsClient) GetResponder(resp *http.Response) (result Applica return } +// GetPurgeStatus get status for an ongoing purge operation. +// Parameters: +// resourceGroupName - the name of the resource group. +// resourceName - the name of the Application Insights component resource. +// purgeID - in a purge status request, this is the Id of the operation the status of which is returned. +func (client ComponentsClient) GetPurgeStatus(ctx context.Context, resourceGroupName string, resourceName string, purgeID string) (result ComponentPurgeStatusResponse, err error) { + req, err := client.GetPurgeStatusPreparer(ctx, resourceGroupName, resourceName, purgeID) + if err != nil { + err = autorest.NewErrorWithError(err, "insights.ComponentsClient", "GetPurgeStatus", nil, "Failure preparing request") + return + } + + resp, err := client.GetPurgeStatusSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "insights.ComponentsClient", "GetPurgeStatus", resp, "Failure sending request") + return + } + + result, err = client.GetPurgeStatusResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "insights.ComponentsClient", "GetPurgeStatus", resp, "Failure responding to request") + } + + return +} + +// GetPurgeStatusPreparer prepares the GetPurgeStatus request. +func (client ComponentsClient) GetPurgeStatusPreparer(ctx context.Context, resourceGroupName string, resourceName string, purgeID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "purgeId": autorest.Encode("path", purgeID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/operations/{purgeId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetPurgeStatusSender sends the GetPurgeStatus request. The method will close the +// http.Response Body if it receives an error. +func (client ComponentsClient) GetPurgeStatusSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetPurgeStatusResponder handles the response to the GetPurgeStatus request. The method always +// closes the http.Response Body. +func (client ComponentsClient) GetPurgeStatusResponder(resp *http.Response) (result ComponentPurgeStatusResponse, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + // List gets a list of all Application Insights components within a subscription. func (client ComponentsClient) List(ctx context.Context) (result ApplicationInsightsComponentListResultPage, err error) { result.fn = client.listNextResults @@ -438,7 +507,7 @@ func (client ComponentsClient) ListByResourceGroupComplete(ctx context.Context, // resourceGroupName - the name of the resource group. // resourceName - the name of the Application Insights component resource. // body - describes the body of a request to purge data in a single table of an Application Insights component -func (client ComponentsClient) Purge(ctx context.Context, resourceGroupName string, resourceName string, body ComponentPurgeBody) (result ComponentsPurgeFuture, err error) { +func (client ComponentsClient) Purge(ctx context.Context, resourceGroupName string, resourceName string, body ComponentPurgeBody) (result ComponentPurgeResponse, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: body, Constraints: []validation.Constraint{{Target: "body.Table", Name: validation.Null, Rule: true, Chain: nil}, @@ -452,12 +521,18 @@ func (client ComponentsClient) Purge(ctx context.Context, resourceGroupName stri return } - result, err = client.PurgeSender(req) + resp, err := client.PurgeSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "insights.ComponentsClient", "Purge", result.Response(), "Failure sending request") + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "insights.ComponentsClient", "Purge", resp, "Failure sending request") return } + result, err = client.PurgeResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "insights.ComponentsClient", "Purge", resp, "Failure responding to request") + } + return } @@ -486,24 +561,14 @@ func (client ComponentsClient) PurgePreparer(ctx context.Context, resourceGroupN // PurgeSender sends the Purge request. The method will close the // http.Response Body if it receives an error. -func (client ComponentsClient) PurgeSender(req *http.Request) (future ComponentsPurgeFuture, err error) { - var resp *http.Response - resp, err = autorest.SendWithSender(client, req, +func (client ComponentsClient) PurgeSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted)) - if err != nil { - return - } - future.Future, err = azure.NewFutureFromResponse(resp) - return } // PurgeResponder handles the response to the Purge request. The method always // closes the http.Response Body. -func (client ComponentsClient) PurgeResponder(resp *http.Response) (result SetObject, err error) { +func (client ComponentsClient) PurgeResponder(resp *http.Response) (result ComponentPurgeResponse, err error) { err = autorest.Respond( resp, client.ByInspecting(), diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2015-05-01/insights/favorite.go b/vendor/github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2015-05-01/insights/favorite.go deleted file mode 100644 index 298cbefb4..000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2015-05-01/insights/favorite.go +++ /dev/null @@ -1,322 +0,0 @@ -package insights - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "net/http" -) - -// FavoriteClient is the composite Swagger for Application Insights Management Client -type FavoriteClient struct { - BaseClient -} - -// NewFavoriteClient creates an instance of the FavoriteClient client. -func NewFavoriteClient(subscriptionID string) FavoriteClient { - return NewFavoriteClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewFavoriteClientWithBaseURI creates an instance of the FavoriteClient client. -func NewFavoriteClientWithBaseURI(baseURI string, subscriptionID string) FavoriteClient { - return FavoriteClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Add adds a new favorites to an Application Insights component. -// Parameters: -// resourceGroupName - the name of the resource group. -// resourceName - the name of the Application Insights component resource. -// favoriteID - the Id of a specific favorite defined in the Application Insights component -// favoriteProperties - properties that need to be specified to create a new favorite and add it to an -// Application Insights component. -func (client FavoriteClient) Add(ctx context.Context, resourceGroupName string, resourceName string, favoriteID string, favoriteProperties ApplicationInsightsComponentFavorite) (result ApplicationInsightsComponentFavorite, err error) { - req, err := client.AddPreparer(ctx, resourceGroupName, resourceName, favoriteID, favoriteProperties) - if err != nil { - err = autorest.NewErrorWithError(err, "insights.FavoriteClient", "Add", nil, "Failure preparing request") - return - } - - resp, err := client.AddSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "insights.FavoriteClient", "Add", resp, "Failure sending request") - return - } - - result, err = client.AddResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "insights.FavoriteClient", "Add", resp, "Failure responding to request") - } - - return -} - -// AddPreparer prepares the Add request. -func (client FavoriteClient) AddPreparer(ctx context.Context, resourceGroupName string, resourceName string, favoriteID string, favoriteProperties ApplicationInsightsComponentFavorite) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "favoriteId": autorest.Encode("path", favoriteID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "resourceName": autorest.Encode("path", resourceName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2015-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/favorites/{favoriteId}", pathParameters), - autorest.WithJSON(favoriteProperties), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// AddSender sends the Add request. The method will close the -// http.Response Body if it receives an error. -func (client FavoriteClient) AddSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - azure.DoRetryWithRegistration(client.Client)) -} - -// AddResponder handles the response to the Add request. The method always -// closes the http.Response Body. -func (client FavoriteClient) AddResponder(resp *http.Response) (result ApplicationInsightsComponentFavorite, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete remove a favorite that is associated to an Application Insights component. -// Parameters: -// resourceGroupName - the name of the resource group. -// resourceName - the name of the Application Insights component resource. -// favoriteID - the Id of a specific favorite defined in the Application Insights component -func (client FavoriteClient) Delete(ctx context.Context, resourceGroupName string, resourceName string, favoriteID string) (result autorest.Response, err error) { - req, err := client.DeletePreparer(ctx, resourceGroupName, resourceName, favoriteID) - if err != nil { - err = autorest.NewErrorWithError(err, "insights.FavoriteClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "insights.FavoriteClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "insights.FavoriteClient", "Delete", resp, "Failure responding to request") - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client FavoriteClient) DeletePreparer(ctx context.Context, resourceGroupName string, resourceName string, favoriteID string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "favoriteId": autorest.Encode("path", favoriteID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "resourceName": autorest.Encode("path", resourceName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2015-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/favorites/{favoriteId}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client FavoriteClient) DeleteSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - azure.DoRetryWithRegistration(client.Client)) -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client FavoriteClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get get a single favorite by its FavoriteId, defined within an Application Insights component. -// Parameters: -// resourceGroupName - the name of the resource group. -// resourceName - the name of the Application Insights component resource. -// favoriteID - the Id of a specific favorite defined in the Application Insights component -func (client FavoriteClient) Get(ctx context.Context, resourceGroupName string, resourceName string, favoriteID string) (result ApplicationInsightsComponentFavorite, err error) { - req, err := client.GetPreparer(ctx, resourceGroupName, resourceName, favoriteID) - if err != nil { - err = autorest.NewErrorWithError(err, "insights.FavoriteClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "insights.FavoriteClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "insights.FavoriteClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client FavoriteClient) GetPreparer(ctx context.Context, resourceGroupName string, resourceName string, favoriteID string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "favoriteId": autorest.Encode("path", favoriteID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "resourceName": autorest.Encode("path", resourceName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2015-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/favorites/{favoriteId}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client FavoriteClient) GetSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client FavoriteClient) GetResponder(resp *http.Response) (result ApplicationInsightsComponentFavorite, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Update updates a favorite that has already been added to an Application Insights component. -// Parameters: -// resourceGroupName - the name of the resource group. -// resourceName - the name of the Application Insights component resource. -// favoriteID - the Id of a specific favorite defined in the Application Insights component -// favoriteProperties - properties that need to be specified to update the existing favorite. -func (client FavoriteClient) Update(ctx context.Context, resourceGroupName string, resourceName string, favoriteID string, favoriteProperties ApplicationInsightsComponentFavorite) (result ApplicationInsightsComponentFavorite, err error) { - req, err := client.UpdatePreparer(ctx, resourceGroupName, resourceName, favoriteID, favoriteProperties) - if err != nil { - err = autorest.NewErrorWithError(err, "insights.FavoriteClient", "Update", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "insights.FavoriteClient", "Update", resp, "Failure sending request") - return - } - - result, err = client.UpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "insights.FavoriteClient", "Update", resp, "Failure responding to request") - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client FavoriteClient) UpdatePreparer(ctx context.Context, resourceGroupName string, resourceName string, favoriteID string, favoriteProperties ApplicationInsightsComponentFavorite) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "favoriteId": autorest.Encode("path", favoriteID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "resourceName": autorest.Encode("path", resourceName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2015-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/favorites/{favoriteId}", pathParameters), - autorest.WithJSON(favoriteProperties), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateSender sends the Update request. The method will close the -// http.Response Body if it receives an error. -func (client FavoriteClient) UpdateSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - azure.DoRetryWithRegistration(client.Client)) -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client FavoriteClient) UpdateResponder(resp *http.Response) (result ApplicationInsightsComponentFavorite, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2015-05-01/insights/favorites.go b/vendor/github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2015-05-01/insights/favorites.go index 644e74980..3da83bbe4 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2015-05-01/insights/favorites.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2015-05-01/insights/favorites.go @@ -39,6 +39,216 @@ func NewFavoritesClientWithBaseURI(baseURI string, subscriptionID string) Favori return FavoritesClient{NewWithBaseURI(baseURI, subscriptionID)} } +// Add adds a new favorites to an Application Insights component. +// Parameters: +// resourceGroupName - the name of the resource group. +// resourceName - the name of the Application Insights component resource. +// favoriteID - the Id of a specific favorite defined in the Application Insights component +// favoriteProperties - properties that need to be specified to create a new favorite and add it to an +// Application Insights component. +func (client FavoritesClient) Add(ctx context.Context, resourceGroupName string, resourceName string, favoriteID string, favoriteProperties ApplicationInsightsComponentFavorite) (result ApplicationInsightsComponentFavorite, err error) { + req, err := client.AddPreparer(ctx, resourceGroupName, resourceName, favoriteID, favoriteProperties) + if err != nil { + err = autorest.NewErrorWithError(err, "insights.FavoritesClient", "Add", nil, "Failure preparing request") + return + } + + resp, err := client.AddSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "insights.FavoritesClient", "Add", resp, "Failure sending request") + return + } + + result, err = client.AddResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "insights.FavoritesClient", "Add", resp, "Failure responding to request") + } + + return +} + +// AddPreparer prepares the Add request. +func (client FavoritesClient) AddPreparer(ctx context.Context, resourceGroupName string, resourceName string, favoriteID string, favoriteProperties ApplicationInsightsComponentFavorite) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "favoriteId": autorest.Encode("path", favoriteID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/favorites/{favoriteId}", pathParameters), + autorest.WithJSON(favoriteProperties), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// AddSender sends the Add request. The method will close the +// http.Response Body if it receives an error. +func (client FavoritesClient) AddSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// AddResponder handles the response to the Add request. The method always +// closes the http.Response Body. +func (client FavoritesClient) AddResponder(resp *http.Response) (result ApplicationInsightsComponentFavorite, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete remove a favorite that is associated to an Application Insights component. +// Parameters: +// resourceGroupName - the name of the resource group. +// resourceName - the name of the Application Insights component resource. +// favoriteID - the Id of a specific favorite defined in the Application Insights component +func (client FavoritesClient) Delete(ctx context.Context, resourceGroupName string, resourceName string, favoriteID string) (result autorest.Response, err error) { + req, err := client.DeletePreparer(ctx, resourceGroupName, resourceName, favoriteID) + if err != nil { + err = autorest.NewErrorWithError(err, "insights.FavoritesClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "insights.FavoritesClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "insights.FavoritesClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client FavoritesClient) DeletePreparer(ctx context.Context, resourceGroupName string, resourceName string, favoriteID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "favoriteId": autorest.Encode("path", favoriteID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/favorites/{favoriteId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client FavoritesClient) DeleteSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client FavoritesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get get a single favorite by its FavoriteId, defined within an Application Insights component. +// Parameters: +// resourceGroupName - the name of the resource group. +// resourceName - the name of the Application Insights component resource. +// favoriteID - the Id of a specific favorite defined in the Application Insights component +func (client FavoritesClient) Get(ctx context.Context, resourceGroupName string, resourceName string, favoriteID string) (result ApplicationInsightsComponentFavorite, err error) { + req, err := client.GetPreparer(ctx, resourceGroupName, resourceName, favoriteID) + if err != nil { + err = autorest.NewErrorWithError(err, "insights.FavoritesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "insights.FavoritesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "insights.FavoritesClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client FavoritesClient) GetPreparer(ctx context.Context, resourceGroupName string, resourceName string, favoriteID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "favoriteId": autorest.Encode("path", favoriteID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/favorites/{favoriteId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client FavoritesClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client FavoritesClient) GetResponder(resp *http.Response) (result ApplicationInsightsComponentFavorite, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + // List gets a list of favorites defined within an Application Insights component. // Parameters: // resourceGroupName - the name of the resource group. @@ -125,3 +335,75 @@ func (client FavoritesClient) ListResponder(resp *http.Response) (result ListApp result.Response = autorest.Response{Response: resp} return } + +// Update updates a favorite that has already been added to an Application Insights component. +// Parameters: +// resourceGroupName - the name of the resource group. +// resourceName - the name of the Application Insights component resource. +// favoriteID - the Id of a specific favorite defined in the Application Insights component +// favoriteProperties - properties that need to be specified to update the existing favorite. +func (client FavoritesClient) Update(ctx context.Context, resourceGroupName string, resourceName string, favoriteID string, favoriteProperties ApplicationInsightsComponentFavorite) (result ApplicationInsightsComponentFavorite, err error) { + req, err := client.UpdatePreparer(ctx, resourceGroupName, resourceName, favoriteID, favoriteProperties) + if err != nil { + err = autorest.NewErrorWithError(err, "insights.FavoritesClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "insights.FavoritesClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "insights.FavoritesClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client FavoritesClient) UpdatePreparer(ctx context.Context, resourceGroupName string, resourceName string, favoriteID string, favoriteProperties ApplicationInsightsComponentFavorite) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "favoriteId": autorest.Encode("path", favoriteID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/favorites/{favoriteId}", pathParameters), + autorest.WithJSON(favoriteProperties), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client FavoritesClient) UpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client FavoritesClient) UpdateResponder(resp *http.Response) (result ApplicationInsightsComponentFavorite, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2015-05-01/insights/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2015-05-01/insights/models.go index 827ee3305..3222af879 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2015-05-01/insights/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2015-05-01/insights/models.go @@ -20,7 +20,6 @@ package insights import ( "encoding/json" "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" "github.com/Azure/go-autorest/autorest/date" "github.com/Azure/go-autorest/autorest/to" "net/http" @@ -190,9 +189,9 @@ type PurgeState string const ( // Completed ... - Completed PurgeState = "Completed" + Completed PurgeState = "completed" // Pending ... - Pending PurgeState = "Pending" + Pending PurgeState = "pending" ) // PossiblePurgeStateValues returns an array of possible values for the PurgeState const type. @@ -268,6 +267,13 @@ type AnnotationError struct { Innererror *InnerError `json:"innererror,omitempty"` } +// AnnotationsListResult annotations list result. +type AnnotationsListResult struct { + autorest.Response `json:"-"` + // Value - An array of annotations. + Value *[]Annotation `json:"value,omitempty"` +} + // APIKeyRequest an Application Insights component API Key createion request definition. type APIKeyRequest struct { // Name - The name of the API Key. @@ -876,42 +882,51 @@ type ComponentPurgeBodyFilters struct { // ComponentPurgeResponse response containing operationId for a specific purge action. type ComponentPurgeResponse struct { + autorest.Response `json:"-"` // OperationID - Id to use when querying for status for a particular purge operation. OperationID *string `json:"operationId,omitempty"` } // ComponentPurgeStatusResponse response containing status for a specific purge operation. type ComponentPurgeStatusResponse struct { + autorest.Response `json:"-"` // Status - Status of the operation represented by the requested Id. Possible values include: 'Pending', 'Completed' Status PurgeState `json:"status,omitempty"` } -// ComponentsPurgeFuture an abstraction for monitoring and retrieving the results of a long-running operation. -type ComponentsPurgeFuture struct { - azure.Future +// ComponentsResource an azure resource object +type ComponentsResource struct { + // ID - Azure resource Id + ID *string `json:"id,omitempty"` + // Name - Azure resource name + Name *string `json:"name,omitempty"` + // Type - Azure resource type + Type *string `json:"type,omitempty"` + // Location - Resource location + Location *string `json:"location,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ComponentsPurgeFuture) Result(client ComponentsClient) (so SetObject, err error) { - var done bool - done, err = future.Done(client) - if err != nil { - err = autorest.NewErrorWithError(err, "insights.ComponentsPurgeFuture", "Result", future.Response(), "Polling failure") - return +// MarshalJSON is the custom marshaler for ComponentsResource. +func (cr ComponentsResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cr.ID != nil { + objectMap["id"] = cr.ID } - if !done { - err = azure.NewAsyncOpIncompleteError("insights.ComponentsPurgeFuture") - return + if cr.Name != nil { + objectMap["name"] = cr.Name } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if so.Response.Response, err = future.GetResult(sender); err == nil && so.Response.Response.StatusCode != http.StatusNoContent { - so, err = client.PurgeResponder(so.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "insights.ComponentsPurgeFuture", "Result", so.Response.Response, "Failure responding to request") - } + if cr.Type != nil { + objectMap["type"] = cr.Type } - return + if cr.Location != nil { + objectMap["location"] = cr.Location + } + if cr.Tags != nil { + objectMap["tags"] = cr.Tags + } + return json.Marshal(objectMap) } // ErrorFieldContract error Field contract. @@ -981,12 +996,6 @@ type ListApplicationInsightsComponentProactiveDetectionConfiguration struct { Value *[]ApplicationInsightsComponentProactiveDetectionConfiguration `json:"value,omitempty"` } -// ListWorkItemConfiguration ... -type ListWorkItemConfiguration struct { - autorest.Response `json:"-"` - Value *[]WorkItemConfiguration `json:"value,omitempty"` -} - // Operation CDN REST API operation type Operation struct { // Name - Operation name: {provider}/{resource}/{operation} @@ -1108,41 +1117,6 @@ func (page OperationListResultPage) Values() []Operation { return *page.olr.Value } -// Resource an azure resource object -type Resource struct { - // ID - Azure resource Id - ID *string `json:"id,omitempty"` - // Name - Azure resource name - Name *string `json:"name,omitempty"` - // Type - Azure resource type - Type *string `json:"type,omitempty"` - // Location - Resource location - Location *string `json:"location,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for Resource. -func (r Resource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if r.ID != nil { - objectMap["id"] = r.ID - } - if r.Name != nil { - objectMap["name"] = r.Name - } - if r.Type != nil { - objectMap["type"] = r.Type - } - if r.Location != nil { - objectMap["location"] = r.Location - } - if r.Tags != nil { - objectMap["tags"] = r.Tags - } - return json.Marshal(objectMap) -} - // SetObject ... type SetObject struct { autorest.Response `json:"-"` @@ -1430,6 +1404,41 @@ type WebTestPropertiesConfiguration struct { WebTest *string `json:"WebTest,omitempty"` } +// WebtestsResource an azure resource object +type WebtestsResource struct { + // ID - Azure resource Id + ID *string `json:"id,omitempty"` + // Name - Azure resource name + Name *string `json:"name,omitempty"` + // Type - Azure resource type + Type *string `json:"type,omitempty"` + // Location - Resource location + Location *string `json:"location,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for WebtestsResource. +func (wr WebtestsResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if wr.ID != nil { + objectMap["id"] = wr.ID + } + if wr.Name != nil { + objectMap["name"] = wr.Name + } + if wr.Type != nil { + objectMap["type"] = wr.Type + } + if wr.Location != nil { + objectMap["location"] = wr.Location + } + if wr.Tags != nil { + objectMap["tags"] = wr.Tags + } + return json.Marshal(objectMap) +} + // Workbook an Application Insights workbook definition. type Workbook struct { autorest.Response `json:"-"` @@ -1588,8 +1597,43 @@ type WorkbookProperties struct { SourceResourceID *string `json:"sourceResourceId,omitempty"` } -// Workbooks workbook list result. -type Workbooks struct { +// WorkbookResource an azure resource object +type WorkbookResource struct { + // ID - Azure resource Id + ID *string `json:"id,omitempty"` + // Name - Azure resource name + Name *string `json:"name,omitempty"` + // Type - Azure resource type + Type *string `json:"type,omitempty"` + // Location - Resource location + Location *string `json:"location,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for WorkbookResource. +func (wr WorkbookResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if wr.ID != nil { + objectMap["id"] = wr.ID + } + if wr.Name != nil { + objectMap["name"] = wr.Name + } + if wr.Type != nil { + objectMap["type"] = wr.Type + } + if wr.Location != nil { + objectMap["location"] = wr.Location + } + if wr.Tags != nil { + objectMap["tags"] = wr.Tags + } + return json.Marshal(objectMap) +} + +// WorkbooksListResult workbook list result. +type WorkbooksListResult struct { autorest.Response `json:"-"` // Value - An array of workbooks. Value *[]Workbook `json:"value,omitempty"` @@ -1619,6 +1663,13 @@ type WorkItemConfigurationError struct { Innererror *InnerError `json:"innererror,omitempty"` } +// WorkItemConfigurationsListResult work item configuration list result. +type WorkItemConfigurationsListResult struct { + autorest.Response `json:"-"` + // Value - An array of work item configurations. + Value *[]WorkItemConfiguration `json:"value,omitempty"` +} + // WorkItemCreateConfiguration work item configuration creation payload type WorkItemCreateConfiguration struct { // ConnectorID - Unique connector id diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2015-05-01/insights/workbook.go b/vendor/github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2015-05-01/insights/workbook.go deleted file mode 100644 index 65e002ea7..000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2015-05-01/insights/workbook.go +++ /dev/null @@ -1,326 +0,0 @@ -package insights - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "net/http" -) - -// WorkbookClient is the composite Swagger for Application Insights Management Client -type WorkbookClient struct { - BaseClient -} - -// NewWorkbookClient creates an instance of the WorkbookClient client. -func NewWorkbookClient(subscriptionID string) WorkbookClient { - return NewWorkbookClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewWorkbookClientWithBaseURI creates an instance of the WorkbookClient client. -func NewWorkbookClientWithBaseURI(baseURI string, subscriptionID string) WorkbookClient { - return WorkbookClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate create a new workbook. -// Parameters: -// resourceGroupName - the name of the resource group. -// resourceName - the name of the Application Insights component resource. -// workbookProperties - properties that need to be specified to create a new workbook. -func (client WorkbookClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, workbookProperties Workbook) (result Workbook, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: workbookProperties, - Constraints: []validation.Constraint{{Target: "workbookProperties.WorkbookProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "workbookProperties.WorkbookProperties.Name", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "workbookProperties.WorkbookProperties.SerializedData", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "workbookProperties.WorkbookProperties.WorkbookID", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "workbookProperties.WorkbookProperties.Category", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "workbookProperties.WorkbookProperties.UserID", Name: validation.Null, Rule: true, Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("insights.WorkbookClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, resourceName, workbookProperties) - if err != nil { - err = autorest.NewErrorWithError(err, "insights.WorkbookClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - resp, err := client.CreateOrUpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "insights.WorkbookClient", "CreateOrUpdate", resp, "Failure sending request") - return - } - - result, err = client.CreateOrUpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "insights.WorkbookClient", "CreateOrUpdate", resp, "Failure responding to request") - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client WorkbookClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, resourceName string, workbookProperties Workbook) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "resourceName": autorest.Encode("path", resourceName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2015-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroup/{resourceGroupName}/providers/microsoft.insights/workbooks/{resourceName}", pathParameters), - autorest.WithJSON(workbookProperties), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client WorkbookClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - azure.DoRetryWithRegistration(client.Client)) -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client WorkbookClient) CreateOrUpdateResponder(resp *http.Response) (result Workbook, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete delete a workbook. -// Parameters: -// resourceGroupName - the name of the resource group. -// resourceName - the name of the Application Insights component resource. -func (client WorkbookClient) Delete(ctx context.Context, resourceGroupName string, resourceName string) (result autorest.Response, err error) { - req, err := client.DeletePreparer(ctx, resourceGroupName, resourceName) - if err != nil { - err = autorest.NewErrorWithError(err, "insights.WorkbookClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "insights.WorkbookClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "insights.WorkbookClient", "Delete", resp, "Failure responding to request") - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client WorkbookClient) DeletePreparer(ctx context.Context, resourceGroupName string, resourceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "resourceName": autorest.Encode("path", resourceName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2015-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroup/{resourceGroupName}/providers/microsoft.insights/workbooks/{resourceName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client WorkbookClient) DeleteSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - azure.DoRetryWithRegistration(client.Client)) -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client WorkbookClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get get a single workbook by its resourceName. -// Parameters: -// resourceGroupName - the name of the resource group. -// resourceName - the name of the Application Insights component resource. -func (client WorkbookClient) Get(ctx context.Context, resourceGroupName string, resourceName string) (result Workbook, err error) { - req, err := client.GetPreparer(ctx, resourceGroupName, resourceName) - if err != nil { - err = autorest.NewErrorWithError(err, "insights.WorkbookClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "insights.WorkbookClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "insights.WorkbookClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client WorkbookClient) GetPreparer(ctx context.Context, resourceGroupName string, resourceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "resourceName": autorest.Encode("path", resourceName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2015-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroup/{resourceGroupName}/providers/microsoft.insights/workbooks/{resourceName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client WorkbookClient) GetSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client WorkbookClient) GetResponder(resp *http.Response) (result Workbook, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Update updates a workbook that has already been added. -// Parameters: -// resourceGroupName - the name of the resource group. -// resourceName - the name of the Application Insights component resource. -// workbookProperties - properties that need to be specified to create a new workbook. -func (client WorkbookClient) Update(ctx context.Context, resourceGroupName string, resourceName string, workbookProperties Workbook) (result Workbook, err error) { - req, err := client.UpdatePreparer(ctx, resourceGroupName, resourceName, workbookProperties) - if err != nil { - err = autorest.NewErrorWithError(err, "insights.WorkbookClient", "Update", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "insights.WorkbookClient", "Update", resp, "Failure sending request") - return - } - - result, err = client.UpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "insights.WorkbookClient", "Update", resp, "Failure responding to request") - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client WorkbookClient) UpdatePreparer(ctx context.Context, resourceGroupName string, resourceName string, workbookProperties Workbook) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "resourceName": autorest.Encode("path", resourceName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2015-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroup/{resourceGroupName}/providers/microsoft.insights/workbooks/{resourceName}", pathParameters), - autorest.WithJSON(workbookProperties), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateSender sends the Update request. The method will close the -// http.Response Body if it receives an error. -func (client WorkbookClient) UpdateSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - azure.DoRetryWithRegistration(client.Client)) -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client WorkbookClient) UpdateResponder(resp *http.Response) (result Workbook, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2015-05-01/insights/workbooks.go b/vendor/github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2015-05-01/insights/workbooks.go index 46e4f0d82..7dc771d38 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2015-05-01/insights/workbooks.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2015-05-01/insights/workbooks.go @@ -21,6 +21,7 @@ import ( "context" "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" "net/http" ) @@ -39,6 +40,221 @@ func NewWorkbooksClientWithBaseURI(baseURI string, subscriptionID string) Workbo return WorkbooksClient{NewWithBaseURI(baseURI, subscriptionID)} } +// CreateOrUpdate create a new workbook. +// Parameters: +// resourceGroupName - the name of the resource group. +// resourceName - the name of the Application Insights component resource. +// workbookProperties - properties that need to be specified to create a new workbook. +func (client WorkbooksClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, workbookProperties Workbook) (result Workbook, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: workbookProperties, + Constraints: []validation.Constraint{{Target: "workbookProperties.WorkbookProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "workbookProperties.WorkbookProperties.Name", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "workbookProperties.WorkbookProperties.SerializedData", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "workbookProperties.WorkbookProperties.WorkbookID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "workbookProperties.WorkbookProperties.Category", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "workbookProperties.WorkbookProperties.UserID", Name: validation.Null, Rule: true, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("insights.WorkbooksClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, resourceName, workbookProperties) + if err != nil { + err = autorest.NewErrorWithError(err, "insights.WorkbooksClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "insights.WorkbooksClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "insights.WorkbooksClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client WorkbooksClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, resourceName string, workbookProperties Workbook) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroup/{resourceGroupName}/providers/microsoft.insights/workbooks/{resourceName}", pathParameters), + autorest.WithJSON(workbookProperties), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client WorkbooksClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client WorkbooksClient) CreateOrUpdateResponder(resp *http.Response) (result Workbook, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete delete a workbook. +// Parameters: +// resourceGroupName - the name of the resource group. +// resourceName - the name of the Application Insights component resource. +func (client WorkbooksClient) Delete(ctx context.Context, resourceGroupName string, resourceName string) (result autorest.Response, err error) { + req, err := client.DeletePreparer(ctx, resourceGroupName, resourceName) + if err != nil { + err = autorest.NewErrorWithError(err, "insights.WorkbooksClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "insights.WorkbooksClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "insights.WorkbooksClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client WorkbooksClient) DeletePreparer(ctx context.Context, resourceGroupName string, resourceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroup/{resourceGroupName}/providers/microsoft.insights/workbooks/{resourceName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client WorkbooksClient) DeleteSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client WorkbooksClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get get a single workbook by its resourceName. +// Parameters: +// resourceGroupName - the name of the resource group. +// resourceName - the name of the Application Insights component resource. +func (client WorkbooksClient) Get(ctx context.Context, resourceGroupName string, resourceName string) (result Workbook, err error) { + req, err := client.GetPreparer(ctx, resourceGroupName, resourceName) + if err != nil { + err = autorest.NewErrorWithError(err, "insights.WorkbooksClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "insights.WorkbooksClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "insights.WorkbooksClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client WorkbooksClient) GetPreparer(ctx context.Context, resourceGroupName string, resourceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroup/{resourceGroupName}/providers/microsoft.insights/workbooks/{resourceName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client WorkbooksClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client WorkbooksClient) GetResponder(resp *http.Response) (result Workbook, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + // ListByResourceGroup get all Workbooks defined within a specified resource group and category. // Parameters: // resourceGroupName - the name of the resource group. @@ -46,7 +262,7 @@ func NewWorkbooksClientWithBaseURI(baseURI string, subscriptionID string) Workbo // tags - tags presents on each workbook returned. // canFetchContent - flag indicating whether or not to return the full content for each applicable workbook. If // false, only return summary content for workbooks. -func (client WorkbooksClient) ListByResourceGroup(ctx context.Context, resourceGroupName string, category CategoryType, tags []string, canFetchContent *bool) (result Workbooks, err error) { +func (client WorkbooksClient) ListByResourceGroup(ctx context.Context, resourceGroupName string, category CategoryType, tags []string, canFetchContent *bool) (result WorkbooksListResult, err error) { req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName, category, tags, canFetchContent) if err != nil { err = autorest.NewErrorWithError(err, "insights.WorkbooksClient", "ListByResourceGroup", nil, "Failure preparing request") @@ -104,7 +320,77 @@ func (client WorkbooksClient) ListByResourceGroupSender(req *http.Request) (*htt // ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always // closes the http.Response Body. -func (client WorkbooksClient) ListByResourceGroupResponder(resp *http.Response) (result Workbooks, err error) { +func (client WorkbooksClient) ListByResourceGroupResponder(resp *http.Response) (result WorkbooksListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Update updates a workbook that has already been added. +// Parameters: +// resourceGroupName - the name of the resource group. +// resourceName - the name of the Application Insights component resource. +// workbookProperties - properties that need to be specified to create a new workbook. +func (client WorkbooksClient) Update(ctx context.Context, resourceGroupName string, resourceName string, workbookProperties Workbook) (result Workbook, err error) { + req, err := client.UpdatePreparer(ctx, resourceGroupName, resourceName, workbookProperties) + if err != nil { + err = autorest.NewErrorWithError(err, "insights.WorkbooksClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "insights.WorkbooksClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "insights.WorkbooksClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client WorkbooksClient) UpdatePreparer(ctx context.Context, resourceGroupName string, resourceName string, workbookProperties Workbook) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroup/{resourceGroupName}/providers/microsoft.insights/workbooks/{resourceName}", pathParameters), + autorest.WithJSON(workbookProperties), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client WorkbooksClient) UpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client WorkbooksClient) UpdateResponder(resp *http.Response) (result Workbook, err error) { err = autorest.Respond( resp, client.ByInspecting(), diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2015-05-01/insights/workitemconfigurations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2015-05-01/insights/workitemconfigurations.go index a8bab87a3..1c4e259ec 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2015-05-01/insights/workitemconfigurations.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2015-05-01/insights/workitemconfigurations.go @@ -251,7 +251,7 @@ func (client WorkItemConfigurationsClient) GetDefaultResponder(resp *http.Respon // Parameters: // resourceGroupName - the name of the resource group. // resourceName - the name of the Application Insights component resource. -func (client WorkItemConfigurationsClient) List(ctx context.Context, resourceGroupName string, resourceName string) (result ListWorkItemConfiguration, err error) { +func (client WorkItemConfigurationsClient) List(ctx context.Context, resourceGroupName string, resourceName string) (result WorkItemConfigurationsListResult, err error) { req, err := client.ListPreparer(ctx, resourceGroupName, resourceName) if err != nil { err = autorest.NewErrorWithError(err, "insights.WorkItemConfigurationsClient", "List", nil, "Failure preparing request") @@ -303,12 +303,12 @@ func (client WorkItemConfigurationsClient) ListSender(req *http.Request) (*http. // ListResponder handles the response to the List request. The method always // closes the http.Response Body. -func (client WorkItemConfigurationsClient) ListResponder(resp *http.Response) (result ListWorkItemConfiguration, err error) { +func (client WorkItemConfigurationsClient) ListResponder(resp *http.Response) (result WorkItemConfigurationsListResult, err error) { err = autorest.Respond( resp, client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/appinsights/v1/insights/client.go b/vendor/github.com/Azure/azure-sdk-for-go/services/appinsights/v1/insights/client.go index 4a70bca9a..49ccf5f10 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/appinsights/v1/insights/client.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/appinsights/v1/insights/client.go @@ -21,11 +21,7 @@ package insights // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( - "context" "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "net/http" ) const ( @@ -37,688 +33,17 @@ const ( type BaseClient struct { autorest.Client BaseURI string - AppID string } // New creates an instance of the BaseClient client. -func New(appID string) BaseClient { - return NewWithBaseURI(DefaultBaseURI, appID) +func New() BaseClient { + return NewWithBaseURI(DefaultBaseURI) } // NewWithBaseURI creates an instance of the BaseClient client. -func NewWithBaseURI(baseURI string, appID string) BaseClient { +func NewWithBaseURI(baseURI string) BaseClient { return BaseClient{ Client: autorest.NewClientWithUserAgent(UserAgent()), BaseURI: baseURI, - AppID: appID, } } - -// GetEvent gets the data for a single event -// Parameters: -// eventType - the type of events to query; either a standard event type (`traces`, `customEvents`, -// `pageViews`, `requests`, `dependencies`, `exceptions`, `availabilityResults`) or `$all` to query across all -// event types. -// eventID - ID of event. -// timespan - optional. The timespan over which to retrieve events. This is an ISO8601 time period value. This -// timespan is applied in addition to any that are specified in the Odata expression. -func (client BaseClient) GetEvent(ctx context.Context, eventType EventType, eventID string, timespan *string) (result EventsResults, err error) { - req, err := client.GetEventPreparer(ctx, eventType, eventID, timespan) - if err != nil { - err = autorest.NewErrorWithError(err, "insights.BaseClient", "GetEvent", nil, "Failure preparing request") - return - } - - resp, err := client.GetEventSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "insights.BaseClient", "GetEvent", resp, "Failure sending request") - return - } - - result, err = client.GetEventResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "insights.BaseClient", "GetEvent", resp, "Failure responding to request") - } - - return -} - -// GetEventPreparer prepares the GetEvent request. -func (client BaseClient) GetEventPreparer(ctx context.Context, eventType EventType, eventID string, timespan *string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", client.AppID), - "eventId": autorest.Encode("path", eventID), - "eventType": autorest.Encode("path", eventType), - } - - queryParameters := map[string]interface{}{} - if timespan != nil { - queryParameters["timespan"] = autorest.Encode("query", *timespan) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/apps/{appId}/events/{eventType}/{eventId}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetEventSender sends the GetEvent request. The method will close the -// http.Response Body if it receives an error. -func (client BaseClient) GetEventSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// GetEventResponder handles the response to the GetEvent request. The method always -// closes the http.Response Body. -func (client BaseClient) GetEventResponder(resp *http.Response) (result EventsResults, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetEvents executes an OData query for events -// Parameters: -// eventType - the type of events to query; either a standard event type (`traces`, `customEvents`, -// `pageViews`, `requests`, `dependencies`, `exceptions`, `availabilityResults`) or `$all` to query across all -// event types. -// timespan - optional. The timespan over which to retrieve events. This is an ISO8601 time period value. This -// timespan is applied in addition to any that are specified in the Odata expression. -// filter - an expression used to filter the returned events -// search - a free-text search expression to match for whether a particular event should be returned -// orderby - a comma-separated list of properties with \"asc\" (the default) or \"desc\" to control the order -// of returned events -// selectParameter - limits the properties to just those requested on each returned event -// skip - the number of items to skip over before returning events -// top - the number of events to return -// formatParameter - format for the returned events -// count - request a count of matching items included with the returned events -// apply - an expression used for aggregation over returned events -func (client BaseClient) GetEvents(ctx context.Context, eventType EventType, timespan *string, filter string, search string, orderby string, selectParameter string, skip *int32, top *int32, formatParameter string, count *bool, apply string) (result EventsResults, err error) { - req, err := client.GetEventsPreparer(ctx, eventType, timespan, filter, search, orderby, selectParameter, skip, top, formatParameter, count, apply) - if err != nil { - err = autorest.NewErrorWithError(err, "insights.BaseClient", "GetEvents", nil, "Failure preparing request") - return - } - - resp, err := client.GetEventsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "insights.BaseClient", "GetEvents", resp, "Failure sending request") - return - } - - result, err = client.GetEventsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "insights.BaseClient", "GetEvents", resp, "Failure responding to request") - } - - return -} - -// GetEventsPreparer prepares the GetEvents request. -func (client BaseClient) GetEventsPreparer(ctx context.Context, eventType EventType, timespan *string, filter string, search string, orderby string, selectParameter string, skip *int32, top *int32, formatParameter string, count *bool, apply string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", client.AppID), - "eventType": autorest.Encode("path", eventType), - } - - queryParameters := map[string]interface{}{} - if timespan != nil { - queryParameters["timespan"] = autorest.Encode("query", *timespan) - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - if len(search) > 0 { - queryParameters["$search"] = autorest.Encode("query", search) - } - if len(orderby) > 0 { - queryParameters["$orderby"] = autorest.Encode("query", orderby) - } - if len(selectParameter) > 0 { - queryParameters["$select"] = autorest.Encode("query", selectParameter) - } - if skip != nil { - queryParameters["$skip"] = autorest.Encode("query", *skip) - } - if top != nil { - queryParameters["$top"] = autorest.Encode("query", *top) - } - if len(formatParameter) > 0 { - queryParameters["$format"] = autorest.Encode("query", formatParameter) - } - if count != nil { - queryParameters["$count"] = autorest.Encode("query", *count) - } - if len(apply) > 0 { - queryParameters["$apply"] = autorest.Encode("query", apply) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/apps/{appId}/events/{eventType}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetEventsSender sends the GetEvents request. The method will close the -// http.Response Body if it receives an error. -func (client BaseClient) GetEventsSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// GetEventsResponder handles the response to the GetEvents request. The method always -// closes the http.Response Body. -func (client BaseClient) GetEventsResponder(resp *http.Response) (result EventsResults, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetEventsMetadataOData gets OData EDMX metadata describing the event data model -func (client BaseClient) GetEventsMetadataOData(ctx context.Context) (result SetObject, err error) { - req, err := client.GetEventsMetadataODataPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "insights.BaseClient", "GetEventsMetadataOData", nil, "Failure preparing request") - return - } - - resp, err := client.GetEventsMetadataODataSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "insights.BaseClient", "GetEventsMetadataOData", resp, "Failure sending request") - return - } - - result, err = client.GetEventsMetadataODataResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "insights.BaseClient", "GetEventsMetadataOData", resp, "Failure responding to request") - } - - return -} - -// GetEventsMetadataODataPreparer prepares the GetEventsMetadataOData request. -func (client BaseClient) GetEventsMetadataODataPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", client.AppID), - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/apps/{appId}/events/$metadata", pathParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetEventsMetadataODataSender sends the GetEventsMetadataOData request. The method will close the -// http.Response Body if it receives an error. -func (client BaseClient) GetEventsMetadataODataSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// GetEventsMetadataODataResponder handles the response to the GetEventsMetadataOData request. The method always -// closes the http.Response Body. -func (client BaseClient) GetEventsMetadataODataResponder(resp *http.Response) (result SetObject, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result.Value), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetMetric gets data for a single metric. -// Parameters: -// metricID - ID of the metric. This is either a standard AI metric, or an application-specific custom metric. -// timespan - the timespan over which to retrieve metric values. This is an ISO8601 time period value. If -// timespan is omitted, a default time range of `PT12H` ("last 12 hours") is used. The actual timespan that is -// queried may be adjusted by the server based. In all cases, the actual time span used for the query is -// included in the response. -// interval - the time interval to use when retrieving metric values. This is an ISO8601 duration. If interval -// is omitted, the metric value is aggregated across the entire timespan. If interval is supplied, the server -// may adjust the interval to a more appropriate size based on the timespan used for the query. In all cases, -// the actual interval used for the query is included in the response. -// aggregation - the aggregation to use when computing the metric values. To retrieve more than one aggregation -// at a time, separate them with a comma. If no aggregation is specified, then the default aggregation for the -// metric is used. -// segment - the name of the dimension to segment the metric values by. This dimension must be applicable to -// the metric you are retrieving. To segment by more than one dimension at a time, separate them with a comma -// (,). In this case, the metric data will be segmented in the order the dimensions are listed in the -// parameter. -// top - the number of segments to return. This value is only valid when segment is specified. -// orderby - the aggregation function and direction to sort the segments by. This value is only valid when -// segment is specified. -// filter - an expression used to filter the results. This value should be a valid OData filter expression -// where the keys of each clause should be applicable dimensions for the metric you are retrieving. -func (client BaseClient) GetMetric(ctx context.Context, metricID string, timespan *string, interval *string, aggregation []string, segment []string, top *int32, orderby string, filter string) (result MetricsResult, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: aggregation, - Constraints: []validation.Constraint{{Target: "aggregation", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "aggregation", Name: validation.MinItems, Rule: 1, Chain: nil}}}}}, - {TargetValue: segment, - Constraints: []validation.Constraint{{Target: "segment", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "segment", Name: validation.MinItems, Rule: 1, Chain: nil}}}}}}); err != nil { - return result, validation.NewError("insights.BaseClient", "GetMetric", err.Error()) - } - - req, err := client.GetMetricPreparer(ctx, metricID, timespan, interval, aggregation, segment, top, orderby, filter) - if err != nil { - err = autorest.NewErrorWithError(err, "insights.BaseClient", "GetMetric", nil, "Failure preparing request") - return - } - - resp, err := client.GetMetricSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "insights.BaseClient", "GetMetric", resp, "Failure sending request") - return - } - - result, err = client.GetMetricResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "insights.BaseClient", "GetMetric", resp, "Failure responding to request") - } - - return -} - -// GetMetricPreparer prepares the GetMetric request. -func (client BaseClient) GetMetricPreparer(ctx context.Context, metricID string, timespan *string, interval *string, aggregation []string, segment []string, top *int32, orderby string, filter string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", client.AppID), - "metricId": autorest.Encode("path", metricID), - } - - queryParameters := map[string]interface{}{} - if timespan != nil { - queryParameters["timespan"] = autorest.Encode("query", *timespan) - } - if interval != nil { - queryParameters["interval"] = autorest.Encode("query", *interval) - } - if aggregation != nil && len(aggregation) > 0 { - queryParameters["aggregation"] = autorest.Encode("query", aggregation, ",") - } - if segment != nil && len(segment) > 0 { - queryParameters["segment"] = autorest.Encode("query", segment, ",") - } - if top != nil { - queryParameters["top"] = autorest.Encode("query", *top) - } - if len(orderby) > 0 { - queryParameters["orderby"] = autorest.Encode("query", orderby) - } - if len(filter) > 0 { - queryParameters["filter"] = autorest.Encode("query", filter) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/apps/{appId}/metrics/{metricId}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetMetricSender sends the GetMetric request. The method will close the -// http.Response Body if it receives an error. -func (client BaseClient) GetMetricSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// GetMetricResponder handles the response to the GetMetric request. The method always -// closes the http.Response Body. -func (client BaseClient) GetMetricResponder(resp *http.Response) (result MetricsResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetMetrics gets metric values for multiple metrics -// Parameters: -// body - the batched metrics query. -func (client BaseClient) GetMetrics(ctx context.Context, body []MetricsPostBodySchema) (result ListMetricsResultsItem, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: body, - Constraints: []validation.Constraint{{Target: "body", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("insights.BaseClient", "GetMetrics", err.Error()) - } - - req, err := client.GetMetricsPreparer(ctx, body) - if err != nil { - err = autorest.NewErrorWithError(err, "insights.BaseClient", "GetMetrics", nil, "Failure preparing request") - return - } - - resp, err := client.GetMetricsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "insights.BaseClient", "GetMetrics", resp, "Failure sending request") - return - } - - result, err = client.GetMetricsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "insights.BaseClient", "GetMetrics", resp, "Failure responding to request") - } - - return -} - -// GetMetricsPreparer prepares the GetMetrics request. -func (client BaseClient) GetMetricsPreparer(ctx context.Context, body []MetricsPostBodySchema) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", client.AppID), - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/apps/{appId}/metrics", pathParameters), - autorest.WithJSON(body)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetMetricsSender sends the GetMetrics request. The method will close the -// http.Response Body if it receives an error. -func (client BaseClient) GetMetricsSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// GetMetricsResponder handles the response to the GetMetrics request. The method always -// closes the http.Response Body. -func (client BaseClient) GetMetricsResponder(resp *http.Response) (result ListMetricsResultsItem, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result.Value), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetMetricsMetadata gets metadata describing the available metrics -func (client BaseClient) GetMetricsMetadata(ctx context.Context) (result SetObject, err error) { - req, err := client.GetMetricsMetadataPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "insights.BaseClient", "GetMetricsMetadata", nil, "Failure preparing request") - return - } - - resp, err := client.GetMetricsMetadataSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "insights.BaseClient", "GetMetricsMetadata", resp, "Failure sending request") - return - } - - result, err = client.GetMetricsMetadataResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "insights.BaseClient", "GetMetricsMetadata", resp, "Failure responding to request") - } - - return -} - -// GetMetricsMetadataPreparer prepares the GetMetricsMetadata request. -func (client BaseClient) GetMetricsMetadataPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", client.AppID), - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/apps/{appId}/metrics/metadata", pathParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetMetricsMetadataSender sends the GetMetricsMetadata request. The method will close the -// http.Response Body if it receives an error. -func (client BaseClient) GetMetricsMetadataSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// GetMetricsMetadataResponder handles the response to the GetMetricsMetadata request. The method always -// closes the http.Response Body. -func (client BaseClient) GetMetricsMetadataResponder(resp *http.Response) (result SetObject, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result.Value), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetQuery executes an Analytics query for data -// Parameters: -// query - the Analytics query. Learn more about the [Analytics query -// syntax](https://azure.microsoft.com/documentation/articles/app-insights-analytics-reference/) -// timespan - optional. The timespan over which to query data. This is an ISO8601 time period value. This -// timespan is applied in addition to any that are specified in the query expression. -func (client BaseClient) GetQuery(ctx context.Context, query string, timespan *string) (result QueryResults, err error) { - req, err := client.GetQueryPreparer(ctx, query, timespan) - if err != nil { - err = autorest.NewErrorWithError(err, "insights.BaseClient", "GetQuery", nil, "Failure preparing request") - return - } - - resp, err := client.GetQuerySender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "insights.BaseClient", "GetQuery", resp, "Failure sending request") - return - } - - result, err = client.GetQueryResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "insights.BaseClient", "GetQuery", resp, "Failure responding to request") - } - - return -} - -// GetQueryPreparer prepares the GetQuery request. -func (client BaseClient) GetQueryPreparer(ctx context.Context, query string, timespan *string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", client.AppID), - } - - queryParameters := map[string]interface{}{ - "query": autorest.Encode("query", query), - } - if timespan != nil { - queryParameters["timespan"] = autorest.Encode("query", *timespan) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/apps/{appId}/query", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetQuerySender sends the GetQuery request. The method will close the -// http.Response Body if it receives an error. -func (client BaseClient) GetQuerySender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// GetQueryResponder handles the response to the GetQuery request. The method always -// closes the http.Response Body. -func (client BaseClient) GetQueryResponder(resp *http.Response) (result QueryResults, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetQuerySchema gets Analytics query schema describing the data model -func (client BaseClient) GetQuerySchema(ctx context.Context) (result QueryResults, err error) { - req, err := client.GetQuerySchemaPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "insights.BaseClient", "GetQuerySchema", nil, "Failure preparing request") - return - } - - resp, err := client.GetQuerySchemaSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "insights.BaseClient", "GetQuerySchema", resp, "Failure sending request") - return - } - - result, err = client.GetQuerySchemaResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "insights.BaseClient", "GetQuerySchema", resp, "Failure responding to request") - } - - return -} - -// GetQuerySchemaPreparer prepares the GetQuerySchema request. -func (client BaseClient) GetQuerySchemaPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", client.AppID), - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/apps/{appId}/query/schema", pathParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetQuerySchemaSender sends the GetQuerySchema request. The method will close the -// http.Response Body if it receives an error. -func (client BaseClient) GetQuerySchemaSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// GetQuerySchemaResponder handles the response to the GetQuerySchema request. The method always -// closes the http.Response Body. -func (client BaseClient) GetQuerySchemaResponder(resp *http.Response) (result QueryResults, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Query executes an Analytics query for data. [Here](/documentation/2-Using-the-API/Query) is an example for using -// POST with an Analytics query. -// Parameters: -// body - the Analytics query. Learn more about the [Analytics query -// syntax](https://azure.microsoft.com/documentation/articles/app-insights-analytics-reference/) -// timespan - optional. The timespan over which to query data. This is an ISO8601 time period value. This -// timespan is applied in addition to any that are specified in the query expression. -func (client BaseClient) Query(ctx context.Context, body QueryBody, timespan *string) (result QueryResults, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: body, - Constraints: []validation.Constraint{{Target: "body.Query", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("insights.BaseClient", "Query", err.Error()) - } - - req, err := client.QueryPreparer(ctx, body, timespan) - if err != nil { - err = autorest.NewErrorWithError(err, "insights.BaseClient", "Query", nil, "Failure preparing request") - return - } - - resp, err := client.QuerySender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "insights.BaseClient", "Query", resp, "Failure sending request") - return - } - - result, err = client.QueryResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "insights.BaseClient", "Query", resp, "Failure responding to request") - } - - return -} - -// QueryPreparer prepares the Query request. -func (client BaseClient) QueryPreparer(ctx context.Context, body QueryBody, timespan *string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", client.AppID), - } - - queryParameters := map[string]interface{}{} - if timespan != nil { - queryParameters["timespan"] = autorest.Encode("query", *timespan) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/apps/{appId}/query", pathParameters), - autorest.WithJSON(body), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// QuerySender sends the Query request. The method will close the -// http.Response Body if it receives an error. -func (client BaseClient) QuerySender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// QueryResponder handles the response to the Query request. The method always -// closes the http.Response Body. -func (client BaseClient) QueryResponder(resp *http.Response) (result QueryResults, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/appinsights/v1/insights/events.go b/vendor/github.com/Azure/azure-sdk-for-go/services/appinsights/v1/insights/events.go new file mode 100644 index 000000000..5deba043c --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/appinsights/v1/insights/events.go @@ -0,0 +1,280 @@ +package insights + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "net/http" +) + +// EventsClient is the composite Swagger for Application Insights Data Client +type EventsClient struct { + BaseClient +} + +// NewEventsClient creates an instance of the EventsClient client. +func NewEventsClient() EventsClient { + return NewEventsClientWithBaseURI(DefaultBaseURI) +} + +// NewEventsClientWithBaseURI creates an instance of the EventsClient client. +func NewEventsClientWithBaseURI(baseURI string) EventsClient { + return EventsClient{NewWithBaseURI(baseURI)} +} + +// Get gets the data for a single event +// Parameters: +// appID - ID of the application. This is Application ID from the API Access settings blade in the Azure +// portal. +// eventType - the type of events to query; either a standard event type (`traces`, `customEvents`, +// `pageViews`, `requests`, `dependencies`, `exceptions`, `availabilityResults`) or `$all` to query across all +// event types. +// eventID - ID of event. +// timespan - optional. The timespan over which to retrieve events. This is an ISO8601 time period value. This +// timespan is applied in addition to any that are specified in the Odata expression. +func (client EventsClient) Get(ctx context.Context, appID string, eventType EventType, eventID string, timespan string) (result EventsResults, err error) { + req, err := client.GetPreparer(ctx, appID, eventType, eventID, timespan) + if err != nil { + err = autorest.NewErrorWithError(err, "insights.EventsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "insights.EventsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "insights.EventsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client EventsClient) GetPreparer(ctx context.Context, appID string, eventType EventType, eventID string, timespan string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "appId": autorest.Encode("path", appID), + "eventId": autorest.Encode("path", eventID), + "eventType": autorest.Encode("path", eventType), + } + + queryParameters := map[string]interface{}{} + if len(timespan) > 0 { + queryParameters["timespan"] = autorest.Encode("query", timespan) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/apps/{appId}/events/{eventType}/{eventId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client EventsClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client EventsClient) GetResponder(resp *http.Response) (result EventsResults, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetByType executes an OData query for events +// Parameters: +// appID - ID of the application. This is Application ID from the API Access settings blade in the Azure +// portal. +// eventType - the type of events to query; either a standard event type (`traces`, `customEvents`, +// `pageViews`, `requests`, `dependencies`, `exceptions`, `availabilityResults`) or `$all` to query across all +// event types. +// timespan - optional. The timespan over which to retrieve events. This is an ISO8601 time period value. This +// timespan is applied in addition to any that are specified in the Odata expression. +// filter - an expression used to filter the returned events +// search - a free-text search expression to match for whether a particular event should be returned +// orderby - a comma-separated list of properties with \"asc\" (the default) or \"desc\" to control the order +// of returned events +// selectParameter - limits the properties to just those requested on each returned event +// skip - the number of items to skip over before returning events +// top - the number of events to return +// formatParameter - format for the returned events +// count - request a count of matching items included with the returned events +// apply - an expression used for aggregation over returned events +func (client EventsClient) GetByType(ctx context.Context, appID string, eventType EventType, timespan string, filter string, search string, orderby string, selectParameter string, skip *int32, top *int32, formatParameter string, count *bool, apply string) (result EventsResults, err error) { + req, err := client.GetByTypePreparer(ctx, appID, eventType, timespan, filter, search, orderby, selectParameter, skip, top, formatParameter, count, apply) + if err != nil { + err = autorest.NewErrorWithError(err, "insights.EventsClient", "GetByType", nil, "Failure preparing request") + return + } + + resp, err := client.GetByTypeSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "insights.EventsClient", "GetByType", resp, "Failure sending request") + return + } + + result, err = client.GetByTypeResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "insights.EventsClient", "GetByType", resp, "Failure responding to request") + } + + return +} + +// GetByTypePreparer prepares the GetByType request. +func (client EventsClient) GetByTypePreparer(ctx context.Context, appID string, eventType EventType, timespan string, filter string, search string, orderby string, selectParameter string, skip *int32, top *int32, formatParameter string, count *bool, apply string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "appId": autorest.Encode("path", appID), + "eventType": autorest.Encode("path", eventType), + } + + queryParameters := map[string]interface{}{} + if len(timespan) > 0 { + queryParameters["timespan"] = autorest.Encode("query", timespan) + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if len(search) > 0 { + queryParameters["$search"] = autorest.Encode("query", search) + } + if len(orderby) > 0 { + queryParameters["$orderby"] = autorest.Encode("query", orderby) + } + if len(selectParameter) > 0 { + queryParameters["$select"] = autorest.Encode("query", selectParameter) + } + if skip != nil { + queryParameters["$skip"] = autorest.Encode("query", *skip) + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + if len(formatParameter) > 0 { + queryParameters["$format"] = autorest.Encode("query", formatParameter) + } + if count != nil { + queryParameters["$count"] = autorest.Encode("query", *count) + } + if len(apply) > 0 { + queryParameters["$apply"] = autorest.Encode("query", apply) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/apps/{appId}/events/{eventType}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetByTypeSender sends the GetByType request. The method will close the +// http.Response Body if it receives an error. +func (client EventsClient) GetByTypeSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetByTypeResponder handles the response to the GetByType request. The method always +// closes the http.Response Body. +func (client EventsClient) GetByTypeResponder(resp *http.Response) (result EventsResults, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetOdataMetadata gets OData EDMX metadata describing the event data model +// Parameters: +// appID - ID of the application. This is Application ID from the API Access settings blade in the Azure +// portal. +func (client EventsClient) GetOdataMetadata(ctx context.Context, appID string) (result SetObject, err error) { + req, err := client.GetOdataMetadataPreparer(ctx, appID) + if err != nil { + err = autorest.NewErrorWithError(err, "insights.EventsClient", "GetOdataMetadata", nil, "Failure preparing request") + return + } + + resp, err := client.GetOdataMetadataSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "insights.EventsClient", "GetOdataMetadata", resp, "Failure sending request") + return + } + + result, err = client.GetOdataMetadataResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "insights.EventsClient", "GetOdataMetadata", resp, "Failure responding to request") + } + + return +} + +// GetOdataMetadataPreparer prepares the GetOdataMetadata request. +func (client EventsClient) GetOdataMetadataPreparer(ctx context.Context, appID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "appId": autorest.Encode("path", appID), + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/apps/{appId}/events/$metadata", pathParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetOdataMetadataSender sends the GetOdataMetadata request. The method will close the +// http.Response Body if it receives an error. +func (client EventsClient) GetOdataMetadataSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetOdataMetadataResponder handles the response to the GetOdataMetadata request. The method always +// closes the http.Response Body. +func (client EventsClient) GetOdataMetadataResponder(resp *http.Response) (result SetObject, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/appinsights/v1/insights/metrics.go b/vendor/github.com/Azure/azure-sdk-for-go/services/appinsights/v1/insights/metrics.go new file mode 100644 index 000000000..f54e86770 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/appinsights/v1/insights/metrics.go @@ -0,0 +1,283 @@ +package insights + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// MetricsClient is the composite Swagger for Application Insights Data Client +type MetricsClient struct { + BaseClient +} + +// NewMetricsClient creates an instance of the MetricsClient client. +func NewMetricsClient() MetricsClient { + return NewMetricsClientWithBaseURI(DefaultBaseURI) +} + +// NewMetricsClientWithBaseURI creates an instance of the MetricsClient client. +func NewMetricsClientWithBaseURI(baseURI string) MetricsClient { + return MetricsClient{NewWithBaseURI(baseURI)} +} + +// Get gets metric values for a single metric +// Parameters: +// appID - ID of the application. This is Application ID from the API Access settings blade in the Azure +// portal. +// metricID - ID of the metric. This is either a standard AI metric, or an application-specific custom metric. +// timespan - the timespan over which to retrieve metric values. This is an ISO8601 time period value. If +// timespan is omitted, a default time range of `PT12H` ("last 12 hours") is used. The actual timespan that is +// queried may be adjusted by the server based. In all cases, the actual time span used for the query is +// included in the response. +// interval - the time interval to use when retrieving metric values. This is an ISO8601 duration. If interval +// is omitted, the metric value is aggregated across the entire timespan. If interval is supplied, the server +// may adjust the interval to a more appropriate size based on the timespan used for the query. In all cases, +// the actual interval used for the query is included in the response. +// aggregation - the aggregation to use when computing the metric values. To retrieve more than one aggregation +// at a time, separate them with a comma. If no aggregation is specified, then the default aggregation for the +// metric is used. +// segment - the name of the dimension to segment the metric values by. This dimension must be applicable to +// the metric you are retrieving. To segment by more than one dimension at a time, separate them with a comma +// (,). In this case, the metric data will be segmented in the order the dimensions are listed in the +// parameter. +// top - the number of segments to return. This value is only valid when segment is specified. +// orderby - the aggregation function and direction to sort the segments by. This value is only valid when +// segment is specified. +// filter - an expression used to filter the results. This value should be a valid OData filter expression +// where the keys of each clause should be applicable dimensions for the metric you are retrieving. +func (client MetricsClient) Get(ctx context.Context, appID string, metricID MetricID, timespan string, interval *string, aggregation []MetricsAggregation, segment []MetricsSegment, top *int32, orderby string, filter string) (result MetricsResult, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: aggregation, + Constraints: []validation.Constraint{{Target: "aggregation", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "aggregation", Name: validation.MinItems, Rule: 1, Chain: nil}}}}}, + {TargetValue: segment, + Constraints: []validation.Constraint{{Target: "segment", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "segment", Name: validation.MinItems, Rule: 1, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("insights.MetricsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, appID, metricID, timespan, interval, aggregation, segment, top, orderby, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "insights.MetricsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "insights.MetricsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "insights.MetricsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client MetricsClient) GetPreparer(ctx context.Context, appID string, metricID MetricID, timespan string, interval *string, aggregation []MetricsAggregation, segment []MetricsSegment, top *int32, orderby string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "appId": autorest.Encode("path", appID), + "metricId": autorest.Encode("path", metricID), + } + + queryParameters := map[string]interface{}{} + if len(timespan) > 0 { + queryParameters["timespan"] = autorest.Encode("query", timespan) + } + if interval != nil { + queryParameters["interval"] = autorest.Encode("query", *interval) + } + if aggregation != nil && len(aggregation) > 0 { + queryParameters["aggregation"] = autorest.Encode("query", aggregation, ",") + } + if segment != nil && len(segment) > 0 { + queryParameters["segment"] = autorest.Encode("query", segment, ",") + } + if top != nil { + queryParameters["top"] = autorest.Encode("query", *top) + } + if len(orderby) > 0 { + queryParameters["orderby"] = autorest.Encode("query", orderby) + } + if len(filter) > 0 { + queryParameters["filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/apps/{appId}/metrics/{metricId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client MetricsClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client MetricsClient) GetResponder(resp *http.Response) (result MetricsResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetMetadata gets metadata describing the available metrics +// Parameters: +// appID - ID of the application. This is Application ID from the API Access settings blade in the Azure +// portal. +func (client MetricsClient) GetMetadata(ctx context.Context, appID string) (result SetObject, err error) { + req, err := client.GetMetadataPreparer(ctx, appID) + if err != nil { + err = autorest.NewErrorWithError(err, "insights.MetricsClient", "GetMetadata", nil, "Failure preparing request") + return + } + + resp, err := client.GetMetadataSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "insights.MetricsClient", "GetMetadata", resp, "Failure sending request") + return + } + + result, err = client.GetMetadataResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "insights.MetricsClient", "GetMetadata", resp, "Failure responding to request") + } + + return +} + +// GetMetadataPreparer prepares the GetMetadata request. +func (client MetricsClient) GetMetadataPreparer(ctx context.Context, appID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "appId": autorest.Encode("path", appID), + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/apps/{appId}/metrics/metadata", pathParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetMetadataSender sends the GetMetadata request. The method will close the +// http.Response Body if it receives an error. +func (client MetricsClient) GetMetadataSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetMetadataResponder handles the response to the GetMetadata request. The method always +// closes the http.Response Body. +func (client MetricsClient) GetMetadataResponder(resp *http.Response) (result SetObject, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetMultiple gets metric values for multiple metrics +// Parameters: +// appID - ID of the application. This is Application ID from the API Access settings blade in the Azure +// portal. +// body - the batched metrics query. +func (client MetricsClient) GetMultiple(ctx context.Context, appID string, body []MetricsPostBodySchema) (result ListMetricsResultsItem, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: body, + Constraints: []validation.Constraint{{Target: "body", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("insights.MetricsClient", "GetMultiple", err.Error()) + } + + req, err := client.GetMultiplePreparer(ctx, appID, body) + if err != nil { + err = autorest.NewErrorWithError(err, "insights.MetricsClient", "GetMultiple", nil, "Failure preparing request") + return + } + + resp, err := client.GetMultipleSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "insights.MetricsClient", "GetMultiple", resp, "Failure sending request") + return + } + + result, err = client.GetMultipleResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "insights.MetricsClient", "GetMultiple", resp, "Failure responding to request") + } + + return +} + +// GetMultiplePreparer prepares the GetMultiple request. +func (client MetricsClient) GetMultiplePreparer(ctx context.Context, appID string, body []MetricsPostBodySchema) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "appId": autorest.Encode("path", appID), + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/apps/{appId}/metrics", pathParameters), + autorest.WithJSON(body)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetMultipleSender sends the GetMultiple request. The method will close the +// http.Response Body if it receives an error. +func (client MetricsClient) GetMultipleSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetMultipleResponder handles the response to the GetMultiple request. The method always +// closes the http.Response Body. +func (client MetricsClient) GetMultipleResponder(resp *http.Response) (result ListMetricsResultsItem, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/appinsights/v1/insights/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/appinsights/v1/insights/models.go index bf523033f..8d34e5b2e 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/appinsights/v1/insights/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/appinsights/v1/insights/models.go @@ -131,6 +131,72 @@ func PossibleMetricIDValues() []MetricID { return []MetricID{AvailabilityResultsavailabilityPercentage, AvailabilityResultsduration, BillingtelemetryCount, ClientnetworkDuration, ClientprocessingDuration, ClientreceiveDuration, ClientsendDuration, ClienttotalDuration, CustomEventscount, Dependenciescount, Dependenciesduration, Dependenciesfailed, Exceptionsbrowser, Exceptionscount, Exceptionsserver, PageViewscount, PageViewsduration, PerformanceCountersexceptionsPerSecond, PerformanceCountersmemoryAvailableBytes, PerformanceCountersprocessCPUPercentage, PerformanceCountersprocessIOBytesPerSecond, PerformanceCountersprocessorCPUPercentage, PerformanceCountersprocessPrivateBytes, PerformanceCountersrequestExecutionTime, PerformanceCountersrequestsInQueue, PerformanceCountersrequestsPerSecond, Requestscount, Requestsduration, Requestsfailed, Sessionscount, Usersauthenticated, Userscount} } +// MetricsAggregation enumerates the values for metrics aggregation. +type MetricsAggregation string + +const ( + // Avg ... + Avg MetricsAggregation = "avg" + // Count ... + Count MetricsAggregation = "count" + // Max ... + Max MetricsAggregation = "max" + // Min ... + Min MetricsAggregation = "min" + // Sum ... + Sum MetricsAggregation = "sum" + // Unique ... + Unique MetricsAggregation = "unique" +) + +// PossibleMetricsAggregationValues returns an array of possible values for the MetricsAggregation const type. +func PossibleMetricsAggregationValues() []MetricsAggregation { + return []MetricsAggregation{Avg, Count, Max, Min, Sum, Unique} +} + +// MetricsSegment enumerates the values for metrics segment. +type MetricsSegment string + +const ( + // ApplicationBuild ... + ApplicationBuild MetricsSegment = "applicationBuild" + // ApplicationVersion ... + ApplicationVersion MetricsSegment = "applicationVersion" + // AuthenticatedOrAnonymousTraffic ... + AuthenticatedOrAnonymousTraffic MetricsSegment = "authenticatedOrAnonymousTraffic" + // Browser ... + Browser MetricsSegment = "browser" + // BrowserVersion ... + BrowserVersion MetricsSegment = "browserVersion" + // City ... + City MetricsSegment = "city" + // CloudRoleName ... + CloudRoleName MetricsSegment = "cloudRoleName" + // CloudServiceName ... + CloudServiceName MetricsSegment = "cloudServiceName" + // Continent ... + Continent MetricsSegment = "continent" + // CountryOrRegion ... + CountryOrRegion MetricsSegment = "countryOrRegion" + // DeploymentID ... + DeploymentID MetricsSegment = "deploymentId" + // DeploymentUnit ... + DeploymentUnit MetricsSegment = "deploymentUnit" + // DeviceType ... + DeviceType MetricsSegment = "deviceType" + // Environment ... + Environment MetricsSegment = "environment" + // HostingLocation ... + HostingLocation MetricsSegment = "hostingLocation" + // InstanceName ... + InstanceName MetricsSegment = "instanceName" +) + +// PossibleMetricsSegmentValues returns an array of possible values for the MetricsSegment const type. +func PossibleMetricsSegmentValues() []MetricsSegment { + return []MetricsSegment{ApplicationBuild, ApplicationVersion, AuthenticatedOrAnonymousTraffic, Browser, BrowserVersion, City, CloudRoleName, CloudServiceName, Continent, CountryOrRegion, DeploymentID, DeploymentUnit, DeviceType, Environment, HostingLocation, InstanceName} +} + // Type enumerates the values for type. type Type string @@ -741,7 +807,7 @@ type EventsCustomMetricInfo struct { // ValueSum - The sum of the custom metric ValueSum *float64 `json:"valueSum,omitempty"` // ValueCount - The count of the custom metric - ValueCount *float64 `json:"valueCount,omitempty"` + ValueCount *int32 `json:"valueCount,omitempty"` // ValueMin - The minimum value of the custom metric ValueMin *float64 `json:"valueMin,omitempty"` // ValueMax - The maximum value of the custom metric @@ -1423,7 +1489,7 @@ func (epvr EventsPageViewResult) AsBasicEventsResultData() (BasicEventsResultDat // EventsPerformanceCounterInfo the performance counter info type EventsPerformanceCounterInfo struct { // Value - The value of the performance counter - Value *int64 `json:"value,omitempty"` + Value *float64 `json:"value,omitempty"` // Name - The name of the performance counter Name *string `json:"name,omitempty"` // Category - The category of the performance counter @@ -2242,14 +2308,14 @@ type MetricsPostBodySchema struct { // MetricsPostBodySchemaParameters the parameters for a single metrics query type MetricsPostBodySchemaParameters struct { // MetricID - Possible values include: 'Requestscount', 'Requestsduration', 'Requestsfailed', 'Userscount', 'Usersauthenticated', 'PageViewscount', 'PageViewsduration', 'ClientprocessingDuration', 'ClientreceiveDuration', 'ClientnetworkDuration', 'ClientsendDuration', 'ClienttotalDuration', 'Dependenciescount', 'Dependenciesfailed', 'Dependenciesduration', 'Exceptionscount', 'Exceptionsbrowser', 'Exceptionsserver', 'Sessionscount', 'PerformanceCountersrequestExecutionTime', 'PerformanceCountersrequestsPerSecond', 'PerformanceCountersrequestsInQueue', 'PerformanceCountersmemoryAvailableBytes', 'PerformanceCountersexceptionsPerSecond', 'PerformanceCountersprocessCPUPercentage', 'PerformanceCountersprocessIOBytesPerSecond', 'PerformanceCountersprocessPrivateBytes', 'PerformanceCountersprocessorCPUPercentage', 'AvailabilityResultsavailabilityPercentage', 'AvailabilityResultsduration', 'BillingtelemetryCount', 'CustomEventscount' - MetricID MetricID `json:"metricId,omitempty"` - Timespan *string `json:"timespan,omitempty"` - Aggregation *[]string `json:"aggregation,omitempty"` - Interval *string `json:"interval,omitempty"` - Segment *[]string `json:"segment,omitempty"` - Top *int32 `json:"top,omitempty"` - Orderby *string `json:"orderby,omitempty"` - Filter *string `json:"filter,omitempty"` + MetricID MetricID `json:"metricId,omitempty"` + Timespan *string `json:"timespan,omitempty"` + Aggregation *[]MetricsAggregation `json:"aggregation,omitempty"` + Interval *string `json:"interval,omitempty"` + Segment *[]MetricsSegment `json:"segment,omitempty"` + Top *int32 `json:"top,omitempty"` + Orderby *string `json:"orderby,omitempty"` + Filter *string `json:"filter,omitempty"` } // MetricsResult a metric result. @@ -2333,13 +2399,14 @@ func (msi MetricsSegmentInfo) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// QueryBody query request body +// QueryBody the Analytics query. Learn more about the [Analytics query +// syntax](https://azure.microsoft.com/documentation/articles/app-insights-analytics-reference/) type QueryBody struct { // Query - The query to execute. Query *string `json:"query,omitempty"` // Timespan - Optional. The timespan over which to query data. This is an ISO8601 time period value. This timespan is applied in addition to any that are specified in the query expression. Timespan *string `json:"timespan,omitempty"` - // Applications - A list of applications that are included in the query. + // Applications - A list of Application IDs for cross-application queries. Applications *[]string `json:"applications,omitempty"` } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/appinsights/v1/insights/query.go b/vendor/github.com/Azure/azure-sdk-for-go/services/appinsights/v1/insights/query.go new file mode 100644 index 000000000..d306b6bfd --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/appinsights/v1/insights/query.go @@ -0,0 +1,112 @@ +package insights + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// QueryClient is the composite Swagger for Application Insights Data Client +type QueryClient struct { + BaseClient +} + +// NewQueryClient creates an instance of the QueryClient client. +func NewQueryClient() QueryClient { + return NewQueryClientWithBaseURI(DefaultBaseURI) +} + +// NewQueryClientWithBaseURI creates an instance of the QueryClient client. +func NewQueryClientWithBaseURI(baseURI string) QueryClient { + return QueryClient{NewWithBaseURI(baseURI)} +} + +// Execute executes an Analytics query for data. +// [Here](https://dev.applicationinsights.io/documentation/Using-the-API/Query) is an example for using POST with an +// Analytics query. +// Parameters: +// appID - ID of the application. This is Application ID from the API Access settings blade in the Azure +// portal. +// body - the Analytics query. Learn more about the [Analytics query +// syntax](https://azure.microsoft.com/documentation/articles/app-insights-analytics-reference/) +func (client QueryClient) Execute(ctx context.Context, appID string, body QueryBody) (result QueryResults, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: body, + Constraints: []validation.Constraint{{Target: "body.Query", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("insights.QueryClient", "Execute", err.Error()) + } + + req, err := client.ExecutePreparer(ctx, appID, body) + if err != nil { + err = autorest.NewErrorWithError(err, "insights.QueryClient", "Execute", nil, "Failure preparing request") + return + } + + resp, err := client.ExecuteSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "insights.QueryClient", "Execute", resp, "Failure sending request") + return + } + + result, err = client.ExecuteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "insights.QueryClient", "Execute", resp, "Failure responding to request") + } + + return +} + +// ExecutePreparer prepares the Execute request. +func (client QueryClient) ExecutePreparer(ctx context.Context, appID string, body QueryBody) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "appId": autorest.Encode("path", appID), + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/apps/{appId}/query", pathParameters), + autorest.WithJSON(body)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ExecuteSender sends the Execute request. The method will close the +// http.Response Body if it receives an error. +func (client QueryClient) ExecuteSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// ExecuteResponder handles the response to the Execute request. The method always +// closes the http.Response Body. +func (client QueryClient) ExecuteResponder(resp *http.Response) (result QueryResults, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/account.go b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/account.go index 037f73a92..5d3b9f1d1 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/account.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/account.go @@ -41,13 +41,16 @@ func NewAccountClientWithBaseURI(baseURI string, subscriptionID string) AccountC } // CreateOrUpdate create or update automation account. -// -// resourceGroupName is the resource group name. automationAccountName is parameters supplied to the create or -// update automation account. parameters is parameters supplied to the create or update automation account. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// parameters - parameters supplied to the create or update automation account. func (client AccountClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, automationAccountName string, parameters AccountCreateOrUpdateParameters) (result Account, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("automation.AccountClient", "CreateOrUpdate", err.Error()) } @@ -116,12 +119,15 @@ func (client AccountClient) CreateOrUpdateResponder(resp *http.Response) (result } // Delete delete an automation account. -// -// resourceGroupName is the resource group name. automationAccountName is automation account name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. func (client AccountClient) Delete(ctx context.Context, resourceGroupName string, automationAccountName string) (result autorest.Response, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("automation.AccountClient", "Delete", err.Error()) } @@ -187,12 +193,15 @@ func (client AccountClient) DeleteResponder(resp *http.Response) (result autores } // Get get information about an Automation Account. -// -// resourceGroupName is the resource group name. automationAccountName is the automation account name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. func (client AccountClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string) (result Account, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("automation.AccountClient", "Get", err.Error()) } @@ -349,12 +358,14 @@ func (client AccountClient) ListComplete(ctx context.Context) (result AccountLis } // ListByResourceGroup retrieve a list of accounts within a given resource group. -// -// resourceGroupName is the resource group name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. func (client AccountClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result AccountListResultPage, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("automation.AccountClient", "ListByResourceGroup", err.Error()) } @@ -448,13 +459,16 @@ func (client AccountClient) ListByResourceGroupComplete(ctx context.Context, res } // Update update an automation account. -// -// resourceGroupName is the resource group name. automationAccountName is automation account name. parameters is -// parameters supplied to the update automation account. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// parameters - parameters supplied to the update automation account. func (client AccountClient) Update(ctx context.Context, resourceGroupName string, automationAccountName string, parameters AccountUpdateParameters) (result Account, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("automation.AccountClient", "Update", err.Error()) } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/activity.go b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/activity.go index ac9db9eb8..9cb37f954 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/activity.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/activity.go @@ -41,13 +41,17 @@ func NewActivityClientWithBaseURI(baseURI string, subscriptionID string) Activit } // Get retrieve the activity in the module identified by module name and activity name. -// -// resourceGroupName is the resource group name. automationAccountName is the automation account name. moduleName -// is the name of module. activityName is the name of activity. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// moduleName - the name of module. +// activityName - the name of activity. func (client ActivityClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, moduleName string, activityName string) (result Activity, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("automation.ActivityClient", "Get", err.Error()) } @@ -116,13 +120,16 @@ func (client ActivityClient) GetResponder(resp *http.Response) (result Activity, } // ListByModule retrieve a list of activities in the module identified by module name. -// -// resourceGroupName is the resource group name. automationAccountName is the automation account name. moduleName -// is the name of module. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// moduleName - the name of module. func (client ActivityClient) ListByModule(ctx context.Context, resourceGroupName string, automationAccountName string, moduleName string) (result ActivityListResultPage, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("automation.ActivityClient", "ListByModule", err.Error()) } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/agentregistrationinformation.go b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/agentregistrationinformation.go index 365936df4..ac1fc3e08 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/agentregistrationinformation.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/agentregistrationinformation.go @@ -42,12 +42,15 @@ func NewAgentRegistrationInformationClientWithBaseURI(baseURI string, subscripti } // Get retrieve the automation agent registration information. -// -// resourceGroupName is the resource group name. automationAccountName is the automation account name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. func (client AgentRegistrationInformationClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string) (result AgentRegistration, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("automation.AgentRegistrationInformationClient", "Get", err.Error()) } @@ -114,13 +117,16 @@ func (client AgentRegistrationInformationClient) GetResponder(resp *http.Respons } // RegenerateKey regenerate a primary or secondary agent registration key -// -// resourceGroupName is the resource group name. automationAccountName is the automation account name. parameters -// is the name of the agent registration key to be regenerated +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// parameters - the name of the agent registration key to be regenerated func (client AgentRegistrationInformationClient) RegenerateKey(ctx context.Context, resourceGroupName string, automationAccountName string, parameters AgentRegistrationRegenerateKeyParameter) (result AgentRegistration, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("automation.AgentRegistrationInformationClient", "RegenerateKey", err.Error()) } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/certificate.go b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/certificate.go index 11a65b7c9..bb46d3d1e 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/certificate.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/certificate.go @@ -41,14 +41,17 @@ func NewCertificateClientWithBaseURI(baseURI string, subscriptionID string) Cert } // CreateOrUpdate create a certificate. -// -// resourceGroupName is the resource group name. automationAccountName is the automation account name. -// certificateName is the parameters supplied to the create or update certificate operation. parameters is the -// parameters supplied to the create or update certificate operation. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// certificateName - the parameters supplied to the create or update certificate operation. +// parameters - the parameters supplied to the create or update certificate operation. func (client CertificateClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, automationAccountName string, certificateName string, parameters CertificateCreateOrUpdateParameters) (result Certificate, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.Name", Name: validation.Null, Rule: true, Chain: nil}, {Target: "parameters.CertificateCreateOrUpdateProperties", Name: validation.Null, Rule: true, @@ -122,13 +125,16 @@ func (client CertificateClient) CreateOrUpdateResponder(resp *http.Response) (re } // Delete delete the certificate. -// -// resourceGroupName is the resource group name. automationAccountName is the automation account name. -// certificateName is the name of certificate. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// certificateName - the name of certificate. func (client CertificateClient) Delete(ctx context.Context, resourceGroupName string, automationAccountName string, certificateName string) (result autorest.Response, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("automation.CertificateClient", "Delete", err.Error()) } @@ -195,13 +201,16 @@ func (client CertificateClient) DeleteResponder(resp *http.Response) (result aut } // Get retrieve the certificate identified by certificate name. -// -// resourceGroupName is the resource group name. automationAccountName is the automation account name. -// certificateName is the name of certificate. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// certificateName - the name of certificate. func (client CertificateClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, certificateName string) (result Certificate, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("automation.CertificateClient", "Get", err.Error()) } @@ -269,12 +278,15 @@ func (client CertificateClient) GetResponder(resp *http.Response) (result Certif } // ListByAutomationAccount retrieve a list of certificates. -// -// resourceGroupName is the resource group name. automationAccountName is the automation account name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. func (client CertificateClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string) (result CertificateListResultPage, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("automation.CertificateClient", "ListByAutomationAccount", err.Error()) } @@ -369,14 +381,17 @@ func (client CertificateClient) ListByAutomationAccountComplete(ctx context.Cont } // Update update a certificate. -// -// resourceGroupName is the resource group name. automationAccountName is the automation account name. -// certificateName is the parameters supplied to the update certificate operation. parameters is the parameters -// supplied to the update certificate operation. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// certificateName - the parameters supplied to the update certificate operation. +// parameters - the parameters supplied to the update certificate operation. func (client CertificateClient) Update(ctx context.Context, resourceGroupName string, automationAccountName string, certificateName string, parameters CertificateUpdateParameters) (result Certificate, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("automation.CertificateClient", "Update", err.Error()) } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/connection.go b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/connection.go index 39287927d..f29f93593 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/connection.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/connection.go @@ -41,14 +41,17 @@ func NewConnectionClientWithBaseURI(baseURI string, subscriptionID string) Conne } // CreateOrUpdate create or update a connection. -// -// resourceGroupName is the resource group name. automationAccountName is the automation account name. -// connectionName is the parameters supplied to the create or update connection operation. parameters is the -// parameters supplied to the create or update connection operation. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// connectionName - the parameters supplied to the create or update connection operation. +// parameters - the parameters supplied to the create or update connection operation. func (client ConnectionClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, automationAccountName string, connectionName string, parameters ConnectionCreateOrUpdateParameters) (result Connection, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.Name", Name: validation.Null, Rule: true, Chain: nil}, {Target: "parameters.ConnectionCreateOrUpdateProperties", Name: validation.Null, Rule: true, @@ -122,13 +125,16 @@ func (client ConnectionClient) CreateOrUpdateResponder(resp *http.Response) (res } // Delete delete the connection. -// -// resourceGroupName is the resource group name. automationAccountName is the automation account name. -// connectionName is the name of connection. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// connectionName - the name of connection. func (client ConnectionClient) Delete(ctx context.Context, resourceGroupName string, automationAccountName string, connectionName string) (result Connection, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("automation.ConnectionClient", "Delete", err.Error()) } @@ -196,13 +202,16 @@ func (client ConnectionClient) DeleteResponder(resp *http.Response) (result Conn } // Get retrieve the connection identified by connection name. -// -// resourceGroupName is the resource group name. automationAccountName is the automation account name. -// connectionName is the name of connection. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// connectionName - the name of connection. func (client ConnectionClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, connectionName string) (result Connection, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("automation.ConnectionClient", "Get", err.Error()) } @@ -270,12 +279,15 @@ func (client ConnectionClient) GetResponder(resp *http.Response) (result Connect } // ListByAutomationAccount retrieve a list of connections. -// -// resourceGroupName is the resource group name. automationAccountName is the automation account name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. func (client ConnectionClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string) (result ConnectionListResultPage, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("automation.ConnectionClient", "ListByAutomationAccount", err.Error()) } @@ -370,14 +382,17 @@ func (client ConnectionClient) ListByAutomationAccountComplete(ctx context.Conte } // Update update a connection. -// -// resourceGroupName is the resource group name. automationAccountName is the automation account name. -// connectionName is the parameters supplied to the update a connection operation. parameters is the parameters -// supplied to the update a connection operation. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// connectionName - the parameters supplied to the update a connection operation. +// parameters - the parameters supplied to the update a connection operation. func (client ConnectionClient) Update(ctx context.Context, resourceGroupName string, automationAccountName string, connectionName string, parameters ConnectionUpdateParameters) (result Connection, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("automation.ConnectionClient", "Update", err.Error()) } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/connectiontype.go b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/connectiontype.go index a5ce642d0..7ec6c994a 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/connectiontype.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/connectiontype.go @@ -41,14 +41,17 @@ func NewConnectionTypeClientWithBaseURI(baseURI string, subscriptionID string) C } // CreateOrUpdate create a connectiontype. -// -// resourceGroupName is the resource group name. automationAccountName is the automation account name. -// connectionTypeName is the parameters supplied to the create or update connectiontype operation. parameters is -// the parameters supplied to the create or update connectiontype operation. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// connectionTypeName - the parameters supplied to the create or update connectiontype operation. +// parameters - the parameters supplied to the create or update connectiontype operation. func (client ConnectionTypeClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, automationAccountName string, connectionTypeName string, parameters ConnectionTypeCreateOrUpdateParameters) (result ConnectionType, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.Name", Name: validation.Null, Rule: true, Chain: nil}, {Target: "parameters.ConnectionTypeCreateOrUpdateProperties", Name: validation.Null, Rule: true, @@ -122,13 +125,16 @@ func (client ConnectionTypeClient) CreateOrUpdateResponder(resp *http.Response) } // Delete delete the connectiontype. -// -// resourceGroupName is the resource group name. automationAccountName is the automation account name. -// connectionTypeName is the name of connectiontype. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// connectionTypeName - the name of connectiontype. func (client ConnectionTypeClient) Delete(ctx context.Context, resourceGroupName string, automationAccountName string, connectionTypeName string) (result autorest.Response, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("automation.ConnectionTypeClient", "Delete", err.Error()) } @@ -195,13 +201,16 @@ func (client ConnectionTypeClient) DeleteResponder(resp *http.Response) (result } // Get retrieve the connectiontype identified by connectiontype name. -// -// resourceGroupName is the resource group name. automationAccountName is the automation account name. -// connectionTypeName is the name of connectiontype. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// connectionTypeName - the name of connectiontype. func (client ConnectionTypeClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, connectionTypeName string) (result ConnectionType, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("automation.ConnectionTypeClient", "Get", err.Error()) } @@ -269,12 +278,15 @@ func (client ConnectionTypeClient) GetResponder(resp *http.Response) (result Con } // ListByAutomationAccount retrieve a list of connectiontypes. -// -// resourceGroupName is the resource group name. automationAccountName is the automation account name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. func (client ConnectionTypeClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string) (result ConnectionTypeListResultPage, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("automation.ConnectionTypeClient", "ListByAutomationAccount", err.Error()) } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/credential.go b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/credential.go index 11f696368..c54ccec48 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/credential.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/credential.go @@ -41,14 +41,17 @@ func NewCredentialClientWithBaseURI(baseURI string, subscriptionID string) Crede } // CreateOrUpdate create a credential. -// -// resourceGroupName is the resource group name. automationAccountName is the automation account name. -// credentialName is the parameters supplied to the create or update credential operation. parameters is the -// parameters supplied to the create or update credential operation. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// credentialName - the parameters supplied to the create or update credential operation. +// parameters - the parameters supplied to the create or update credential operation. func (client CredentialClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, automationAccountName string, credentialName string, parameters CredentialCreateOrUpdateParameters) (result Credential, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.Name", Name: validation.Null, Rule: true, Chain: nil}, {Target: "parameters.CredentialCreateOrUpdateProperties", Name: validation.Null, Rule: true, @@ -124,13 +127,16 @@ func (client CredentialClient) CreateOrUpdateResponder(resp *http.Response) (res } // Delete delete the credential. -// -// resourceGroupName is the resource group name. automationAccountName is the automation account name. -// credentialName is the name of credential. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// credentialName - the name of credential. func (client CredentialClient) Delete(ctx context.Context, resourceGroupName string, automationAccountName string, credentialName string) (result autorest.Response, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("automation.CredentialClient", "Delete", err.Error()) } @@ -197,13 +203,16 @@ func (client CredentialClient) DeleteResponder(resp *http.Response) (result auto } // Get retrieve the credential identified by credential name. -// -// resourceGroupName is the resource group name. automationAccountName is the automation account name. -// credentialName is the name of credential. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// credentialName - the name of credential. func (client CredentialClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, credentialName string) (result Credential, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("automation.CredentialClient", "Get", err.Error()) } @@ -271,12 +280,15 @@ func (client CredentialClient) GetResponder(resp *http.Response) (result Credent } // ListByAutomationAccount retrieve a list of credentials. -// -// resourceGroupName is the resource group name. automationAccountName is the automation account name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. func (client CredentialClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string) (result CredentialListResultPage, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("automation.CredentialClient", "ListByAutomationAccount", err.Error()) } @@ -371,14 +383,17 @@ func (client CredentialClient) ListByAutomationAccountComplete(ctx context.Conte } // Update update a credential. -// -// resourceGroupName is the resource group name. automationAccountName is the automation account name. -// credentialName is the parameters supplied to the Update credential operation. parameters is the parameters -// supplied to the Update credential operation. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// credentialName - the parameters supplied to the Update credential operation. +// parameters - the parameters supplied to the Update credential operation. func (client CredentialClient) Update(ctx context.Context, resourceGroupName string, automationAccountName string, credentialName string, parameters CredentialUpdateParameters) (result Credential, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("automation.CredentialClient", "Update", err.Error()) } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/dsccompilationjob.go b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/dsccompilationjob.go index 148d7c66a..3ed11e06b 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/dsccompilationjob.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/dsccompilationjob.go @@ -42,14 +42,17 @@ func NewDscCompilationJobClientWithBaseURI(baseURI string, subscriptionID string } // Create creates the Dsc compilation job of the configuration. -// -// resourceGroupName is the resource group name. automationAccountName is the automation account name. -// compilationJobID is the the DSC configuration Id. parameters is the parameters supplied to the create -// compilation job operation. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// compilationJobID - the the DSC configuration Id. +// parameters - the parameters supplied to the create compilation job operation. func (client DscCompilationJobClient) Create(ctx context.Context, resourceGroupName string, automationAccountName string, compilationJobID uuid.UUID, parameters DscCompilationJobCreateParameters) (result DscCompilationJob, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.DscCompilationJobCreateProperties", Name: validation.Null, Rule: true, Chain: []validation.Constraint{{Target: "parameters.DscCompilationJobCreateProperties.Configuration", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { @@ -122,13 +125,16 @@ func (client DscCompilationJobClient) CreateResponder(resp *http.Response) (resu } // Get retrieve the Dsc configuration compilation job identified by job id. -// -// resourceGroupName is the resource group name. automationAccountName is the automation account name. -// compilationJobID is the Dsc configuration compilation job id. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// compilationJobID - the Dsc configuration compilation job id. func (client DscCompilationJobClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, compilationJobID uuid.UUID) (result DscCompilationJob, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("automation.DscCompilationJobClient", "Get", err.Error()) } @@ -196,13 +202,17 @@ func (client DscCompilationJobClient) GetResponder(resp *http.Response) (result } // GetStream retrieve the job stream identified by job stream id. -// -// resourceGroupName is the resource group name. automationAccountName is the automation account name. jobID is the -// job id. jobStreamID is the job stream id. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// jobID - the job id. +// jobStreamID - the job stream id. func (client DscCompilationJobClient) GetStream(ctx context.Context, resourceGroupName string, automationAccountName string, jobID uuid.UUID, jobStreamID string) (result JobStream, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("automation.DscCompilationJobClient", "GetStream", err.Error()) } @@ -271,13 +281,16 @@ func (client DscCompilationJobClient) GetStreamResponder(resp *http.Response) (r } // ListByAutomationAccount retrieve a list of dsc compilation jobs. -// -// resourceGroupName is the resource group name. automationAccountName is the automation account name. filter is -// the filter to apply on the operation. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// filter - the filter to apply on the operation. func (client DscCompilationJobClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (result DscCompilationJobListResultPage, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("automation.DscCompilationJobClient", "ListByAutomationAccount", err.Error()) } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/dsccompilationjobstream.go b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/dsccompilationjobstream.go index 6e103018f..4b3723035 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/dsccompilationjobstream.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/dsccompilationjobstream.go @@ -42,13 +42,16 @@ func NewDscCompilationJobStreamClientWithBaseURI(baseURI string, subscriptionID } // ListByJob retrieve all the job streams for the compilation Job. -// -// resourceGroupName is the resource group name. automationAccountName is the automation account name. jobID is the -// job id. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// jobID - the job id. func (client DscCompilationJobStreamClient) ListByJob(ctx context.Context, resourceGroupName string, automationAccountName string, jobID uuid.UUID) (result JobStreamListResult, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("automation.DscCompilationJobStreamClient", "ListByJob", err.Error()) } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/dscconfiguration.go b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/dscconfiguration.go index bd6e51e2f..72c361a04 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/dscconfiguration.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/dscconfiguration.go @@ -41,14 +41,17 @@ func NewDscConfigurationClientWithBaseURI(baseURI string, subscriptionID string) } // CreateOrUpdate create the configuration identified by configuration name. -// -// resourceGroupName is the resource group name. automationAccountName is the automation account name. -// configurationName is the create or update parameters for configuration. parameters is the create or update -// parameters for configuration. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// configurationName - the create or update parameters for configuration. +// parameters - the create or update parameters for configuration. func (client DscConfigurationClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, automationAccountName string, configurationName string, parameters DscConfigurationCreateOrUpdateParameters) (result DscConfiguration, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.DscConfigurationCreateOrUpdateProperties", Name: validation.Null, Rule: true, Chain: []validation.Constraint{{Target: "parameters.DscConfigurationCreateOrUpdateProperties.Source", Name: validation.Null, Rule: true, @@ -127,13 +130,16 @@ func (client DscConfigurationClient) CreateOrUpdateResponder(resp *http.Response } // Delete delete the dsc configuration identified by configuration name. -// -// resourceGroupName is the resource group name. automationAccountName is the automation account name. -// configurationName is the configuration name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// configurationName - the configuration name. func (client DscConfigurationClient) Delete(ctx context.Context, resourceGroupName string, automationAccountName string, configurationName string) (result autorest.Response, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("automation.DscConfigurationClient", "Delete", err.Error()) } @@ -200,13 +206,16 @@ func (client DscConfigurationClient) DeleteResponder(resp *http.Response) (resul } // Get retrieve the configuration identified by configuration name. -// -// resourceGroupName is the resource group name. automationAccountName is the automation account name. -// configurationName is the configuration name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// configurationName - the configuration name. func (client DscConfigurationClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, configurationName string) (result DscConfiguration, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("automation.DscConfigurationClient", "Get", err.Error()) } @@ -274,13 +283,16 @@ func (client DscConfigurationClient) GetResponder(resp *http.Response) (result D } // GetContent retrieve the configuration script identified by configuration name. -// -// resourceGroupName is the resource group name. automationAccountName is the automation account name. -// configurationName is the configuration name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// configurationName - the configuration name. func (client DscConfigurationClient) GetContent(ctx context.Context, resourceGroupName string, automationAccountName string, configurationName string) (result String, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("automation.DscConfigurationClient", "GetContent", err.Error()) } @@ -348,17 +360,24 @@ func (client DscConfigurationClient) GetContentResponder(resp *http.Response) (r } // ListByAutomationAccount retrieve a list of configurations. -// -// resourceGroupName is the resource group name. automationAccountName is the automation account name. -func (client DscConfigurationClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string) (result DscConfigurationListResultPage, err error) { +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// filter - the filter to apply on the operation. +// skip - the number of rows to skip. +// top - the the number of rows to take. +// inlinecount - return total rows. +func (client DscConfigurationClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string, filter string, skip *int32, top *int32, inlinecount string) (result DscConfigurationListResultPage, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("automation.DscConfigurationClient", "ListByAutomationAccount", err.Error()) } result.fn = client.listByAutomationAccountNextResults - req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName) + req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName, filter, skip, top, inlinecount) if err != nil { err = autorest.NewErrorWithError(err, "automation.DscConfigurationClient", "ListByAutomationAccount", nil, "Failure preparing request") return @@ -380,7 +399,7 @@ func (client DscConfigurationClient) ListByAutomationAccount(ctx context.Context } // ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. -func (client DscConfigurationClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string) (*http.Request, error) { +func (client DscConfigurationClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, filter string, skip *int32, top *int32, inlinecount string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -391,6 +410,18 @@ func (client DscConfigurationClient) ListByAutomationAccountPreparer(ctx context queryParameters := map[string]interface{}{ "api-version": APIVersion, } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if skip != nil { + queryParameters["$skip"] = autorest.Encode("query", *skip) + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + if len(inlinecount) > 0 { + queryParameters["$inlinecount"] = autorest.Encode("query", inlinecount) + } preparer := autorest.CreatePreparer( autorest.AsGet(), @@ -442,20 +473,23 @@ func (client DscConfigurationClient) listByAutomationAccountNextResults(lastResu } // ListByAutomationAccountComplete enumerates all values, automatically crossing page boundaries as required. -func (client DscConfigurationClient) ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string) (result DscConfigurationListResultIterator, err error) { - result.page, err = client.ListByAutomationAccount(ctx, resourceGroupName, automationAccountName) +func (client DscConfigurationClient) ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string, filter string, skip *int32, top *int32, inlinecount string) (result DscConfigurationListResultIterator, err error) { + result.page, err = client.ListByAutomationAccount(ctx, resourceGroupName, automationAccountName, filter, skip, top, inlinecount) return } // Update create the configuration identified by configuration name. -// -// resourceGroupName is the resource group name. automationAccountName is the automation account name. -// configurationName is the create or update parameters for configuration. parameters is the create or update -// parameters for configuration. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// configurationName - the create or update parameters for configuration. +// parameters - the create or update parameters for configuration. func (client DscConfigurationClient) Update(ctx context.Context, resourceGroupName string, automationAccountName string, configurationName string, parameters *DscConfigurationUpdateParameters) (result DscConfiguration, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("automation.DscConfigurationClient", "Update", err.Error()) } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/dscnode.go b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/dscnode.go index a51206bcc..e61c56e58 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/dscnode.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/dscnode.go @@ -41,13 +41,16 @@ func NewDscNodeClientWithBaseURI(baseURI string, subscriptionID string) DscNodeC } // Delete delete the dsc node identified by node id. -// -// resourceGroupName is the resource group name. automationAccountName is automation account name. nodeID is the -// node id. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// nodeID - the node id. func (client DscNodeClient) Delete(ctx context.Context, resourceGroupName string, automationAccountName string, nodeID string) (result DscNode, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("automation.DscNodeClient", "Delete", err.Error()) } @@ -115,13 +118,16 @@ func (client DscNodeClient) DeleteResponder(resp *http.Response) (result DscNode } // Get retrieve the dsc node identified by node id. -// -// resourceGroupName is the resource group name. automationAccountName is the automation account name. nodeID is -// the node id. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// nodeID - the node id. func (client DscNodeClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, nodeID string) (result DscNode, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("automation.DscNodeClient", "Get", err.Error()) } @@ -189,13 +195,16 @@ func (client DscNodeClient) GetResponder(resp *http.Response) (result DscNode, e } // ListByAutomationAccount retrieve a list of dsc nodes. -// -// resourceGroupName is the resource group name. automationAccountName is the automation account name. filter is -// the filter to apply on the operation. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// filter - the filter to apply on the operation. func (client DscNodeClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (result DscNodeListResultPage, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("automation.DscNodeClient", "ListByAutomationAccount", err.Error()) } @@ -293,13 +302,17 @@ func (client DscNodeClient) ListByAutomationAccountComplete(ctx context.Context, } // Update update the dsc node. -// -// resourceGroupName is the resource group name. automationAccountName is the automation account name. nodeID is -// parameters supplied to the update dsc node. parameters is parameters supplied to the update dsc node. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// nodeID - parameters supplied to the update dsc node. +// parameters - parameters supplied to the update dsc node. func (client DscNodeClient) Update(ctx context.Context, resourceGroupName string, automationAccountName string, nodeID string, parameters DscNodeUpdateParameters) (result DscNode, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("automation.DscNodeClient", "Update", err.Error()) } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/dscnodeconfiguration.go b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/dscnodeconfiguration.go index e2684c9b1..dc292bbd8 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/dscnodeconfiguration.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/dscnodeconfiguration.go @@ -41,14 +41,17 @@ func NewDscNodeConfigurationClientWithBaseURI(baseURI string, subscriptionID str } // CreateOrUpdate create the node configuration identified by node configuration name. -// -// resourceGroupName is the resource group name. automationAccountName is the automation account name. -// nodeConfigurationName is the create or update parameters for configuration. parameters is the create or update -// parameters for configuration. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// nodeConfigurationName - the create or update parameters for configuration. +// parameters - the create or update parameters for configuration. func (client DscNodeConfigurationClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, automationAccountName string, nodeConfigurationName string, parameters DscNodeConfigurationCreateOrUpdateParameters) (result DscNodeConfiguration, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.Source", Name: validation.Null, Rule: true, Chain: []validation.Constraint{{Target: "parameters.Source.Hash", Name: validation.Null, Rule: false, @@ -127,13 +130,16 @@ func (client DscNodeConfigurationClient) CreateOrUpdateResponder(resp *http.Resp } // Delete delete the Dsc node configurations by node configuration. -// -// resourceGroupName is the resource group name. automationAccountName is the automation account name. -// nodeConfigurationName is the Dsc node configuration name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// nodeConfigurationName - the Dsc node configuration name. func (client DscNodeConfigurationClient) Delete(ctx context.Context, resourceGroupName string, automationAccountName string, nodeConfigurationName string) (result autorest.Response, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("automation.DscNodeConfigurationClient", "Delete", err.Error()) } @@ -200,13 +206,16 @@ func (client DscNodeConfigurationClient) DeleteResponder(resp *http.Response) (r } // Get retrieve the Dsc node configurations by node configuration. -// -// resourceGroupName is the resource group name. automationAccountName is the automation account name. -// nodeConfigurationName is the Dsc node configuration name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// nodeConfigurationName - the Dsc node configuration name. func (client DscNodeConfigurationClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, nodeConfigurationName string) (result DscNodeConfiguration, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("automation.DscNodeConfigurationClient", "Get", err.Error()) } @@ -274,13 +283,16 @@ func (client DscNodeConfigurationClient) GetResponder(resp *http.Response) (resu } // ListByAutomationAccount retrieve a list of dsc node configurations. -// -// resourceGroupName is the resource group name. automationAccountName is the automation account name. filter is -// the filter to apply on the operation. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// filter - the filter to apply on the operation. func (client DscNodeConfigurationClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (result DscNodeConfigurationListResultPage, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("automation.DscNodeConfigurationClient", "ListByAutomationAccount", err.Error()) } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/fields.go b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/fields.go index 756ad090d..61c80c6eb 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/fields.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/fields.go @@ -41,13 +41,17 @@ func NewFieldsClientWithBaseURI(baseURI string, subscriptionID string) FieldsCli } // ListByType retrieve a list of fields of a given type identified by module name. -// -// resourceGroupName is the resource group name. automationAccountName is the automation account name. moduleName -// is the name of module. typeName is the name of type. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// moduleName - the name of module. +// typeName - the name of type. func (client FieldsClient) ListByType(ctx context.Context, resourceGroupName string, automationAccountName string, moduleName string, typeName string) (result TypeFieldListResult, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("automation.FieldsClient", "ListByType", err.Error()) } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/hybridrunbookworkergroup.go b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/hybridrunbookworkergroup.go index d480a4417..86bd913bf 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/hybridrunbookworkergroup.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/hybridrunbookworkergroup.go @@ -41,13 +41,16 @@ func NewHybridRunbookWorkerGroupClientWithBaseURI(baseURI string, subscriptionID } // Delete delete a hybrid runbook worker group. -// -// resourceGroupName is the resource group name. automationAccountName is automation account name. -// hybridRunbookWorkerGroupName is the hybrid runbook worker group name +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// hybridRunbookWorkerGroupName - the hybrid runbook worker group name func (client HybridRunbookWorkerGroupClient) Delete(ctx context.Context, resourceGroupName string, automationAccountName string, hybridRunbookWorkerGroupName string) (result autorest.Response, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("automation.HybridRunbookWorkerGroupClient", "Delete", err.Error()) } @@ -114,13 +117,16 @@ func (client HybridRunbookWorkerGroupClient) DeleteResponder(resp *http.Response } // Get retrieve a hybrid runbook worker group. -// -// resourceGroupName is the resource group name. automationAccountName is the automation account name. -// hybridRunbookWorkerGroupName is the hybrid runbook worker group name +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// hybridRunbookWorkerGroupName - the hybrid runbook worker group name func (client HybridRunbookWorkerGroupClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, hybridRunbookWorkerGroupName string) (result HybridRunbookWorkerGroup, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("automation.HybridRunbookWorkerGroupClient", "Get", err.Error()) } @@ -188,17 +194,21 @@ func (client HybridRunbookWorkerGroupClient) GetResponder(resp *http.Response) ( } // ListByAutomationAccount retrieve a list of hybrid runbook worker groups. -// -// resourceGroupName is the resource group name. automationAccountName is the automation account name. -func (client HybridRunbookWorkerGroupClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string) (result HybridRunbookWorkerGroupsListResultPage, err error) { +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// filter - the filter to apply on the operation. +func (client HybridRunbookWorkerGroupClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (result HybridRunbookWorkerGroupsListResultPage, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("automation.HybridRunbookWorkerGroupClient", "ListByAutomationAccount", err.Error()) } result.fn = client.listByAutomationAccountNextResults - req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName) + req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName, filter) if err != nil { err = autorest.NewErrorWithError(err, "automation.HybridRunbookWorkerGroupClient", "ListByAutomationAccount", nil, "Failure preparing request") return @@ -220,7 +230,7 @@ func (client HybridRunbookWorkerGroupClient) ListByAutomationAccount(ctx context } // ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. -func (client HybridRunbookWorkerGroupClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string) (*http.Request, error) { +func (client HybridRunbookWorkerGroupClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -231,6 +241,9 @@ func (client HybridRunbookWorkerGroupClient) ListByAutomationAccountPreparer(ctx queryParameters := map[string]interface{}{ "api-version": APIVersion, } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } preparer := autorest.CreatePreparer( autorest.AsGet(), @@ -282,20 +295,23 @@ func (client HybridRunbookWorkerGroupClient) listByAutomationAccountNextResults( } // ListByAutomationAccountComplete enumerates all values, automatically crossing page boundaries as required. -func (client HybridRunbookWorkerGroupClient) ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string) (result HybridRunbookWorkerGroupsListResultIterator, err error) { - result.page, err = client.ListByAutomationAccount(ctx, resourceGroupName, automationAccountName) +func (client HybridRunbookWorkerGroupClient) ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (result HybridRunbookWorkerGroupsListResultIterator, err error) { + result.page, err = client.ListByAutomationAccount(ctx, resourceGroupName, automationAccountName, filter) return } // Update update a hybrid runbook worker group. -// -// resourceGroupName is the resource group name. automationAccountName is the automation account name. -// hybridRunbookWorkerGroupName is the hybrid runbook worker group name parameters is the hybrid runbook worker -// group +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// hybridRunbookWorkerGroupName - the hybrid runbook worker group name +// parameters - the hybrid runbook worker group func (client HybridRunbookWorkerGroupClient) Update(ctx context.Context, resourceGroupName string, automationAccountName string, hybridRunbookWorkerGroupName string, parameters HybridRunbookWorkerGroupUpdateParameters) (result HybridRunbookWorkerGroup, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("automation.HybridRunbookWorkerGroupClient", "Update", err.Error()) } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/job.go b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/job.go index 72cd180f9..cc3e1d1cf 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/job.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/job.go @@ -42,13 +42,17 @@ func NewJobClientWithBaseURI(baseURI string, subscriptionID string) JobClient { } // Create create a job of the runbook. -// -// resourceGroupName is the resource group name. automationAccountName is the automation account name. jobID is the -// job id. parameters is the parameters supplied to the create job operation. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// jobID - the job id. +// parameters - the parameters supplied to the create job operation. func (client JobClient) Create(ctx context.Context, resourceGroupName string, automationAccountName string, jobID uuid.UUID, parameters JobCreateParameters) (result Job, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.JobCreateProperties", Name: validation.Null, Rule: true, Chain: []validation.Constraint{{Target: "parameters.JobCreateProperties.Runbook", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { @@ -121,13 +125,16 @@ func (client JobClient) CreateResponder(resp *http.Response) (result Job, err er } // Get retrieve the job identified by job id. -// -// resourceGroupName is the resource group name. automationAccountName is the automation account name. jobID is the -// job id. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// jobID - the job id. func (client JobClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, jobID uuid.UUID) (result Job, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("automation.JobClient", "Get", err.Error()) } @@ -195,13 +202,16 @@ func (client JobClient) GetResponder(resp *http.Response) (result Job, err error } // GetOutput retrieve the job output identified by job id. -// -// resourceGroupName is the resource group name. automationAccountName is the automation account name. jobID is the -// job id. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// jobID - the job id. func (client JobClient) GetOutput(ctx context.Context, resourceGroupName string, automationAccountName string, jobID string) (result ReadCloser, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("automation.JobClient", "GetOutput", err.Error()) } @@ -268,13 +278,16 @@ func (client JobClient) GetOutputResponder(resp *http.Response) (result ReadClos } // GetRunbookContent retrieve the runbook content of the job identified by job id. -// -// resourceGroupName is the resource group name. automationAccountName is the automation account name. jobID is the -// job id. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// jobID - the job id. func (client JobClient) GetRunbookContent(ctx context.Context, resourceGroupName string, automationAccountName string, jobID string) (result ReadCloser, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("automation.JobClient", "GetRunbookContent", err.Error()) } @@ -341,13 +354,16 @@ func (client JobClient) GetRunbookContentResponder(resp *http.Response) (result } // ListByAutomationAccount retrieve a list of jobs. -// -// resourceGroupName is the resource group name. automationAccountName is the automation account name. filter is -// the filter to apply on the operation. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// filter - the filter to apply on the operation. func (client JobClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (result JobListResultPage, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("automation.JobClient", "ListByAutomationAccount", err.Error()) } @@ -445,13 +461,16 @@ func (client JobClient) ListByAutomationAccountComplete(ctx context.Context, res } // Resume resume the job identified by jobId. -// -// resourceGroupName is the resource group name. automationAccountName is the automation account name. jobID is the -// job id. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// jobID - the job id. func (client JobClient) Resume(ctx context.Context, resourceGroupName string, automationAccountName string, jobID uuid.UUID) (result autorest.Response, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("automation.JobClient", "Resume", err.Error()) } @@ -518,13 +537,16 @@ func (client JobClient) ResumeResponder(resp *http.Response) (result autorest.Re } // Stop stop the job identified by jobId. -// -// resourceGroupName is the resource group name. automationAccountName is the automation account name. jobID is the -// job id. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// jobID - the job id. func (client JobClient) Stop(ctx context.Context, resourceGroupName string, automationAccountName string, jobID uuid.UUID) (result autorest.Response, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("automation.JobClient", "Stop", err.Error()) } @@ -591,13 +613,16 @@ func (client JobClient) StopResponder(resp *http.Response) (result autorest.Resp } // Suspend suspend the job identified by jobId. -// -// resourceGroupName is the resource group name. automationAccountName is the automation account name. jobID is the -// job id. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// jobID - the job id. func (client JobClient) Suspend(ctx context.Context, resourceGroupName string, automationAccountName string, jobID uuid.UUID) (result autorest.Response, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("automation.JobClient", "Suspend", err.Error()) } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/jobschedule.go b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/jobschedule.go index 4d9819392..1dbcb8ed2 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/jobschedule.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/jobschedule.go @@ -43,14 +43,17 @@ func NewJobScheduleClientWithBaseURI(baseURI string, subscriptionID string) JobS } // Create create a job schedule. -// -// resourceGroupName is the resource group name. automationAccountName is the automation account name. -// jobScheduleID is the job schedule name. parameters is the parameters supplied to the create job schedule -// operation. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// jobScheduleID - the job schedule name. +// parameters - the parameters supplied to the create job schedule operation. func (client JobScheduleClient) Create(ctx context.Context, resourceGroupName string, automationAccountName string, jobScheduleID uuid.UUID, parameters JobScheduleCreateParameters) (result JobSchedule, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.JobScheduleCreateProperties", Name: validation.Null, Rule: true, Chain: []validation.Constraint{{Target: "parameters.JobScheduleCreateProperties.Schedule", Name: validation.Null, Rule: true, Chain: nil}, @@ -125,13 +128,16 @@ func (client JobScheduleClient) CreateResponder(resp *http.Response) (result Job } // Delete delete the job schedule identified by job schedule name. -// -// resourceGroupName is the resource group name. automationAccountName is the automation account name. -// jobScheduleID is the job schedule name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// jobScheduleID - the job schedule name. func (client JobScheduleClient) Delete(ctx context.Context, resourceGroupName string, automationAccountName string, jobScheduleID uuid.UUID) (result autorest.Response, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("automation.JobScheduleClient", "Delete", err.Error()) } @@ -198,13 +204,16 @@ func (client JobScheduleClient) DeleteResponder(resp *http.Response) (result aut } // Get retrieve the job schedule identified by job schedule name. -// -// resourceGroupName is the resource group name. automationAccountName is the automation account name. -// jobScheduleID is the job schedule name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// jobScheduleID - the job schedule name. func (client JobScheduleClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, jobScheduleID uuid.UUID) (result JobSchedule, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("automation.JobScheduleClient", "Get", err.Error()) } @@ -272,17 +281,21 @@ func (client JobScheduleClient) GetResponder(resp *http.Response) (result JobSch } // ListByAutomationAccount retrieve a list of job schedules. -// -// resourceGroupName is the resource group name. automationAccountName is the automation account name. -func (client JobScheduleClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string) (result JobScheduleListResultPage, err error) { +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// filter - the filter to apply on the operation. +func (client JobScheduleClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (result JobScheduleListResultPage, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("automation.JobScheduleClient", "ListByAutomationAccount", err.Error()) } result.fn = client.listByAutomationAccountNextResults - req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName) + req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName, filter) if err != nil { err = autorest.NewErrorWithError(err, "automation.JobScheduleClient", "ListByAutomationAccount", nil, "Failure preparing request") return @@ -304,7 +317,7 @@ func (client JobScheduleClient) ListByAutomationAccount(ctx context.Context, res } // ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. -func (client JobScheduleClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string) (*http.Request, error) { +func (client JobScheduleClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -315,6 +328,9 @@ func (client JobScheduleClient) ListByAutomationAccountPreparer(ctx context.Cont queryParameters := map[string]interface{}{ "api-version": APIVersion, } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } preparer := autorest.CreatePreparer( autorest.AsGet(), @@ -366,7 +382,7 @@ func (client JobScheduleClient) listByAutomationAccountNextResults(lastResults J } // ListByAutomationAccountComplete enumerates all values, automatically crossing page boundaries as required. -func (client JobScheduleClient) ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string) (result JobScheduleListResultIterator, err error) { - result.page, err = client.ListByAutomationAccount(ctx, resourceGroupName, automationAccountName) +func (client JobScheduleClient) ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (result JobScheduleListResultIterator, err error) { + result.page, err = client.ListByAutomationAccount(ctx, resourceGroupName, automationAccountName, filter) return } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/jobstream.go b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/jobstream.go index 71d0b27fb..3cc4c6d2b 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/jobstream.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/jobstream.go @@ -41,13 +41,17 @@ func NewJobStreamClientWithBaseURI(baseURI string, subscriptionID string) JobStr } // Get retrieve the job stream identified by job stream id. -// -// resourceGroupName is the resource group name. automationAccountName is the automation account name. jobID is the -// job id. jobStreamID is the job stream id. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// jobID - the job id. +// jobStreamID - the job stream id. func (client JobStreamClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, jobID string, jobStreamID string) (result JobStream, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("automation.JobStreamClient", "Get", err.Error()) } @@ -116,13 +120,17 @@ func (client JobStreamClient) GetResponder(resp *http.Response) (result JobStrea } // ListByJob retrieve a list of jobs streams identified by job id. -// -// resourceGroupName is the resource group name. automationAccountName is the automation account name. jobID is the -// job Id. filter is the filter to apply on the operation. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// jobID - the job Id. +// filter - the filter to apply on the operation. func (client JobStreamClient) ListByJob(ctx context.Context, resourceGroupName string, automationAccountName string, jobID string, filter string) (result JobStreamListResultPage, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("automation.JobStreamClient", "ListByJob", err.Error()) } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/keys.go b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/keys.go index 2f3b9cac4..a063a20de 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/keys.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/keys.go @@ -41,12 +41,15 @@ func NewKeysClientWithBaseURI(baseURI string, subscriptionID string) KeysClient } // ListByAutomationAccount retrieve the automation keys for an account. -// -// resourceGroupName is the resource group name. automationAccountName is the automation account name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. func (client KeysClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string) (result KeyListResult, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("automation.KeysClient", "ListByAutomationAccount", err.Error()) } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/linkedworkspace.go b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/linkedworkspace.go index 07bd7f664..0ddea23c6 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/linkedworkspace.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/linkedworkspace.go @@ -41,12 +41,15 @@ func NewLinkedWorkspaceClientWithBaseURI(baseURI string, subscriptionID string) } // Get retrieve the linked workspace for the account id. -// -// resourceGroupName is the resource group name. automationAccountName is the automation account name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. func (client LinkedWorkspaceClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string) (result LinkedWorkspace, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("automation.LinkedWorkspaceClient", "Get", err.Error()) } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/models.go index dcdd6f820..70f8dfdd7 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/models.go @@ -105,6 +105,21 @@ func PossibleDscConfigurationStateValues() []DscConfigurationState { return []DscConfigurationState{DscConfigurationStateEdit, DscConfigurationStateNew, DscConfigurationStatePublished} } +// GroupTypeEnum enumerates the values for group type enum. +type GroupTypeEnum string + +const ( + // System ... + System GroupTypeEnum = "System" + // User ... + User GroupTypeEnum = "User" +) + +// PossibleGroupTypeEnumValues returns an array of possible values for the GroupTypeEnum const type. +func PossibleGroupTypeEnumValues() []GroupTypeEnum { + return []GroupTypeEnum{System, User} +} + // HTTPStatusCode enumerates the values for http status code. type HTTPStatusCode string @@ -296,9 +311,9 @@ type KeyName string const ( // KeyNamePrimary ... - KeyNamePrimary KeyName = "primary" + KeyNamePrimary KeyName = "Primary" // KeyNameSecondary ... - KeyNameSecondary KeyName = "secondary" + KeyNameSecondary KeyName = "Secondary" ) // PossibleKeyNameValues returns an array of possible values for the KeyName const type. @@ -312,11 +327,13 @@ type KeyPermissions string const ( // Full ... Full KeyPermissions = "Full" + // Read ... + Read KeyPermissions = "Read" ) // PossibleKeyPermissionsValues returns an array of possible values for the KeyPermissions const type. func PossibleKeyPermissionsValues() []KeyPermissions { - return []KeyPermissions{Full} + return []KeyPermissions{Full, Read} } // ModuleProvisioningState enumerates the values for module provisioning state. @@ -483,16 +500,16 @@ type Account struct { *AccountProperties `json:"properties,omitempty"` // Etag - Gets or sets the etag of the resource. Etag *string `json:"etag,omitempty"` - // ID - Resource Id - ID *string `json:"id,omitempty"` - // Name - Resource name - Name *string `json:"name,omitempty"` - // Type - Resource type - Type *string `json:"type,omitempty"` - // Location - Resource location - Location *string `json:"location,omitempty"` - // Tags - Resource tags + // Tags - Resource tags. Tags map[string]*string `json:"tags"` + // Location - The Azure Region where the resource lives + Location *string `json:"location,omitempty"` + // ID - Fully qualified resource Id for the resource + ID *string `json:"id,omitempty"` + // Name - The name of the resource + Name *string `json:"name,omitempty"` + // Type - The type of the resource. + Type *string `json:"type,omitempty"` } // MarshalJSON is the custom marshaler for Account. @@ -504,6 +521,12 @@ func (a Account) MarshalJSON() ([]byte, error) { if a.Etag != nil { objectMap["etag"] = a.Etag } + if a.Tags != nil { + objectMap["tags"] = a.Tags + } + if a.Location != nil { + objectMap["location"] = a.Location + } if a.ID != nil { objectMap["id"] = a.ID } @@ -513,12 +536,6 @@ func (a Account) MarshalJSON() ([]byte, error) { if a.Type != nil { objectMap["type"] = a.Type } - if a.Location != nil { - objectMap["location"] = a.Location - } - if a.Tags != nil { - objectMap["tags"] = a.Tags - } return json.Marshal(objectMap) } @@ -549,6 +566,24 @@ func (a *Account) UnmarshalJSON(body []byte) error { } a.Etag = &etag } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + a.Tags = tags + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + a.Location = &location + } case "id": if v != nil { var ID string @@ -576,24 +611,6 @@ func (a *Account) UnmarshalJSON(body []byte) error { } a.Type = &typeVar } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - a.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - a.Tags = tags - } } } @@ -1081,13 +1098,17 @@ type ActivityParameter struct { // IsDynamic - Gets or sets a Boolean value that indicates true if the parameter is dynamic. IsDynamic *bool `json:"isDynamic,omitempty"` // Position - Gets or sets the position of the activity parameter. - Position *bool `json:"position,omitempty"` + Position *int64 `json:"position,omitempty"` // ValueFromPipeline - Gets or sets a Boolean value that indicates true if the parameter can take values from the incoming pipeline objects. This setting is used if the cmdlet must access the complete input object. false indicates that the parameter cannot take values from the complete input object. ValueFromPipeline *bool `json:"valueFromPipeline,omitempty"` // ValueFromPipelineByPropertyName - Gets or sets a Boolean value that indicates true if the parameter can be filled from a property of the incoming pipeline object that has the same name as this parameter. false indicates that the parameter cannot be filled from the incoming pipeline object property with the same name. ValueFromPipelineByPropertyName *bool `json:"valueFromPipelineByPropertyName,omitempty"` // ValueFromRemainingArguments - Gets or sets a Boolean value that indicates true if the cmdlet parameter accepts all the remaining command-line arguments that are associated with this parameter in the form of an array. false if the cmdlet parameter does not accept all the remaining argument values. ValueFromRemainingArguments *bool `json:"valueFromRemainingArguments,omitempty"` + // Description - Gets or sets the description of the activity parameter. + Description *string `json:"description,omitempty"` + // ValidationSet - Gets or sets the validation set of activity parameter. + ValidationSet *[]ActivityParameterValidationSet `json:"validationSet,omitempty"` } // ActivityParameterSet definition of the activity parameter set. @@ -1098,6 +1119,12 @@ type ActivityParameterSet struct { Parameters *[]ActivityParameter `json:"parameters,omitempty"` } +// ActivityParameterValidationSet definition of the activity parameter validation set. +type ActivityParameterValidationSet struct { + // MemberValue - Gets or sets the name of the activity parameter validation set member. + MemberValue *string `json:"memberValue,omitempty"` +} + // ActivityProperties properties of the activity. type ActivityProperties struct { // Definition - Gets or sets the user name of the activity. @@ -1128,7 +1155,7 @@ type AdvancedSchedule struct { type AdvancedScheduleMonthlyOccurrence struct { // Occurrence - Occurrence of the week within the month. Must be between 1 and 5 Occurrence *int32 `json:"occurrence,omitempty"` - // Day - Day of the occurrence. Must be one of monday, tuesday, wednesday,thursday, friday, saturday, sunday. Possible values include: 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday' + // Day - Day of the occurrence. Must be one of monday, tuesday, wednesday, thursday, friday, saturday, sunday. Possible values include: 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday' Day ScheduleDay `json:"day,omitempty"` } @@ -1186,19 +1213,22 @@ func (arrkp AgentRegistrationRegenerateKeyParameter) MarshalJSON() ([]byte, erro // Certificate definition of the certificate. type Certificate struct { autorest.Response `json:"-"` - // ID - Gets the id of the resource. - ID *string `json:"id,omitempty"` - // Name - Gets the name of the certificate. - Name *string `json:"name,omitempty"` - // Type - Resource type - Type *string `json:"type,omitempty"` // CertificateProperties - Gets or sets the properties of the certificate. *CertificateProperties `json:"properties,omitempty"` + // ID - Fully qualified resource Id for the resource + ID *string `json:"id,omitempty"` + // Name - The name of the resource + Name *string `json:"name,omitempty"` + // Type - The type of the resource. + Type *string `json:"type,omitempty"` } // MarshalJSON is the custom marshaler for Certificate. func (c Certificate) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) + if c.CertificateProperties != nil { + objectMap["properties"] = c.CertificateProperties + } if c.ID != nil { objectMap["id"] = c.ID } @@ -1208,9 +1238,6 @@ func (c Certificate) MarshalJSON() ([]byte, error) { if c.Type != nil { objectMap["type"] = c.Type } - if c.CertificateProperties != nil { - objectMap["properties"] = c.CertificateProperties - } return json.Marshal(objectMap) } @@ -1223,6 +1250,15 @@ func (c *Certificate) UnmarshalJSON(body []byte) error { } for k, v := range m { switch k { + case "properties": + if v != nil { + var certificateProperties CertificateProperties + err = json.Unmarshal(*v, &certificateProperties) + if err != nil { + return err + } + c.CertificateProperties = &certificateProperties + } case "id": if v != nil { var ID string @@ -1250,15 +1286,6 @@ func (c *Certificate) UnmarshalJSON(body []byte) error { } c.Type = &typeVar } - case "properties": - if v != nil { - var certificateProperties CertificateProperties - err = json.Unmarshal(*v, &certificateProperties) - if err != nil { - return err - } - c.CertificateProperties = &certificateProperties - } } } @@ -1511,19 +1538,22 @@ type CertificateUpdateProperties struct { // Connection definition of the connection. type Connection struct { autorest.Response `json:"-"` - // ID - Gets the id of the resource. - ID *string `json:"id,omitempty"` - // Name - Gets the name of the connection. - Name *string `json:"name,omitempty"` - // Type - Resource type - Type *string `json:"type,omitempty"` // ConnectionProperties - Gets or sets the properties of the connection. *ConnectionProperties `json:"properties,omitempty"` + // ID - Fully qualified resource Id for the resource + ID *string `json:"id,omitempty"` + // Name - The name of the resource + Name *string `json:"name,omitempty"` + // Type - The type of the resource. + Type *string `json:"type,omitempty"` } // MarshalJSON is the custom marshaler for Connection. func (c Connection) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) + if c.ConnectionProperties != nil { + objectMap["properties"] = c.ConnectionProperties + } if c.ID != nil { objectMap["id"] = c.ID } @@ -1533,9 +1563,6 @@ func (c Connection) MarshalJSON() ([]byte, error) { if c.Type != nil { objectMap["type"] = c.Type } - if c.ConnectionProperties != nil { - objectMap["properties"] = c.ConnectionProperties - } return json.Marshal(objectMap) } @@ -1548,6 +1575,15 @@ func (c *Connection) UnmarshalJSON(body []byte) error { } for k, v := range m { switch k { + case "properties": + if v != nil { + var connectionProperties ConnectionProperties + err = json.Unmarshal(*v, &connectionProperties) + if err != nil { + return err + } + c.ConnectionProperties = &connectionProperties + } case "id": if v != nil { var ID string @@ -1575,15 +1611,6 @@ func (c *Connection) UnmarshalJSON(body []byte) error { } c.Type = &typeVar } - case "properties": - if v != nil { - var connectionProperties ConnectionProperties - err = json.Unmarshal(*v, &connectionProperties) - if err != nil { - return err - } - c.ConnectionProperties = &connectionProperties - } } } @@ -2210,19 +2237,22 @@ type ContentSource struct { // Credential definition of the credential. type Credential struct { autorest.Response `json:"-"` - // ID - Gets the id of the resource. - ID *string `json:"id,omitempty"` - // Name - Gets the name of the credential. - Name *string `json:"name,omitempty"` - // Type - Resource type - Type *string `json:"type,omitempty"` // CredentialProperties - Gets or sets the properties of the credential. *CredentialProperties `json:"properties,omitempty"` + // ID - Fully qualified resource Id for the resource + ID *string `json:"id,omitempty"` + // Name - The name of the resource + Name *string `json:"name,omitempty"` + // Type - The type of the resource. + Type *string `json:"type,omitempty"` } // MarshalJSON is the custom marshaler for Credential. func (c Credential) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) + if c.CredentialProperties != nil { + objectMap["properties"] = c.CredentialProperties + } if c.ID != nil { objectMap["id"] = c.ID } @@ -2232,9 +2262,6 @@ func (c Credential) MarshalJSON() ([]byte, error) { if c.Type != nil { objectMap["type"] = c.Type } - if c.CredentialProperties != nil { - objectMap["properties"] = c.CredentialProperties - } return json.Marshal(objectMap) } @@ -2247,6 +2274,15 @@ func (c *Credential) UnmarshalJSON(body []byte) error { } for k, v := range m { switch k { + case "properties": + if v != nil { + var credentialProperties CredentialProperties + err = json.Unmarshal(*v, &credentialProperties) + if err != nil { + return err + } + c.CredentialProperties = &credentialProperties + } case "id": if v != nil { var ID string @@ -2274,15 +2310,6 @@ func (c *Credential) UnmarshalJSON(body []byte) error { } c.Type = &typeVar } - case "properties": - if v != nil { - var credentialProperties CredentialProperties - err = json.Unmarshal(*v, &credentialProperties) - if err != nil { - return err - } - c.CredentialProperties = &credentialProperties - } } } @@ -2534,11 +2561,11 @@ type DscCompilationJob struct { autorest.Response `json:"-"` // DscCompilationJobProperties - Gets or sets the properties of the Dsc Compilation job. *DscCompilationJobProperties `json:"properties,omitempty"` - // ID - Resource Id + // ID - Fully qualified resource Id for the resource ID *string `json:"id,omitempty"` - // Name - Resource name + // Name - The name of the resource Name *string `json:"name,omitempty"` - // Type - Resource type + // Type - The type of the resource. Type *string `json:"type,omitempty"` } @@ -2698,8 +2725,8 @@ type DscCompilationJobCreateProperties struct { Configuration *DscConfigurationAssociationProperty `json:"configuration,omitempty"` // Parameters - Gets or sets the parameters of the job. Parameters map[string]*string `json:"parameters"` - // NewNodeConfigurationBuildVersionRequired - If a new build version of NodeConfiguration is required. - NewNodeConfigurationBuildVersionRequired *bool `json:"newNodeConfigurationBuildVersionRequired,omitempty"` + // IncrementNodeConfigurationBuild - If a new build version of NodeConfiguration is required. + IncrementNodeConfigurationBuild *bool `json:"incrementNodeConfigurationBuild,omitempty"` } // MarshalJSON is the custom marshaler for DscCompilationJobCreateProperties. @@ -2711,8 +2738,8 @@ func (dcjcp DscCompilationJobCreateProperties) MarshalJSON() ([]byte, error) { if dcjcp.Parameters != nil { objectMap["parameters"] = dcjcp.Parameters } - if dcjcp.NewNodeConfigurationBuildVersionRequired != nil { - objectMap["newNodeConfigurationBuildVersionRequired"] = dcjcp.NewNodeConfigurationBuildVersionRequired + if dcjcp.IncrementNodeConfigurationBuild != nil { + objectMap["incrementNodeConfigurationBuild"] = dcjcp.IncrementNodeConfigurationBuild } return json.Marshal(objectMap) } @@ -2829,8 +2856,8 @@ type DscCompilationJobProperties struct { JobID *uuid.UUID `json:"jobId,omitempty"` // CreationTime - Gets the creation time of the job. CreationTime *date.Time `json:"creationTime,omitempty"` - // ProvisioningState - The current provisioning state of the job. - ProvisioningState *JobProvisioningStateProperty `json:"provisioningState,omitempty"` + // ProvisioningState - The current provisioning state of the job. Possible values include: 'JobProvisioningStateFailed', 'JobProvisioningStateSucceeded', 'JobProvisioningStateSuspended', 'JobProvisioningStateProcessing' + ProvisioningState JobProvisioningState `json:"provisioningState,omitempty"` // RunOn - Gets or sets the runOn which specifies the group name where the job is to be executed. RunOn *string `json:"runOn,omitempty"` // Status - Gets or sets the status of the job. Possible values include: 'JobStatusNew', 'JobStatusActivating', 'JobStatusRunning', 'JobStatusCompleted', 'JobStatusFailed', 'JobStatusStopped', 'JobStatusBlocked', 'JobStatusSuspended', 'JobStatusDisconnected', 'JobStatusSuspending', 'JobStatusStopping', 'JobStatusResuming', 'JobStatusRemoving' @@ -2866,7 +2893,7 @@ func (dcjp DscCompilationJobProperties) MarshalJSON() ([]byte, error) { if dcjp.CreationTime != nil { objectMap["creationTime"] = dcjp.CreationTime } - if dcjp.ProvisioningState != nil { + if dcjp.ProvisioningState != "" { objectMap["provisioningState"] = dcjp.ProvisioningState } if dcjp.RunOn != nil { @@ -2906,16 +2933,16 @@ type DscConfiguration struct { *DscConfigurationProperties `json:"properties,omitempty"` // Etag - Gets or sets the etag of the resource. Etag *string `json:"etag,omitempty"` - // ID - Resource Id - ID *string `json:"id,omitempty"` - // Name - Resource name - Name *string `json:"name,omitempty"` - // Type - Resource type - Type *string `json:"type,omitempty"` - // Location - Resource location - Location *string `json:"location,omitempty"` - // Tags - Resource tags + // Tags - Resource tags. Tags map[string]*string `json:"tags"` + // Location - The Azure Region where the resource lives + Location *string `json:"location,omitempty"` + // ID - Fully qualified resource Id for the resource + ID *string `json:"id,omitempty"` + // Name - The name of the resource + Name *string `json:"name,omitempty"` + // Type - The type of the resource. + Type *string `json:"type,omitempty"` } // MarshalJSON is the custom marshaler for DscConfiguration. @@ -2927,6 +2954,12 @@ func (dc DscConfiguration) MarshalJSON() ([]byte, error) { if dc.Etag != nil { objectMap["etag"] = dc.Etag } + if dc.Tags != nil { + objectMap["tags"] = dc.Tags + } + if dc.Location != nil { + objectMap["location"] = dc.Location + } if dc.ID != nil { objectMap["id"] = dc.ID } @@ -2936,12 +2969,6 @@ func (dc DscConfiguration) MarshalJSON() ([]byte, error) { if dc.Type != nil { objectMap["type"] = dc.Type } - if dc.Location != nil { - objectMap["location"] = dc.Location - } - if dc.Tags != nil { - objectMap["tags"] = dc.Tags - } return json.Marshal(objectMap) } @@ -2972,6 +2999,24 @@ func (dc *DscConfiguration) UnmarshalJSON(body []byte) error { } dc.Etag = &etag } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + dc.Tags = tags + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + dc.Location = &location + } case "id": if v != nil { var ID string @@ -2999,24 +3044,6 @@ func (dc *DscConfiguration) UnmarshalJSON(body []byte) error { } dc.Type = &typeVar } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - dc.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - dc.Tags = tags - } } } @@ -3153,6 +3180,8 @@ type DscConfigurationListResult struct { Value *[]DscConfiguration `json:"value,omitempty"` // NextLink - Gets or sets the next link. NextLink *string `json:"nextLink,omitempty"` + // TotalCount - Gets the total number of configurations matching filter criteria. + TotalCount *int32 `json:"totalCount,omitempty"` } // DscConfigurationListResultIterator provides access to a complete listing of DscConfiguration values. @@ -3278,6 +3307,8 @@ type DscConfigurationProperties struct { CreationTime *date.Time `json:"creationTime,omitempty"` // LastModifiedTime - Gets or sets the last modified time. LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` + // NodeConfigurationCount - Gets the number of compiled node configurations. + NodeConfigurationCount *int32 `json:"nodeConfigurationCount,omitempty"` // Description - Gets or sets the description. Description *string `json:"description,omitempty"` } @@ -3309,6 +3340,9 @@ func (dcp DscConfigurationProperties) MarshalJSON() ([]byte, error) { if dcp.LastModifiedTime != nil { objectMap["lastModifiedTime"] = dcp.LastModifiedTime } + if dcp.NodeConfigurationCount != nil { + objectMap["nodeConfigurationCount"] = dcp.NodeConfigurationCount + } if dcp.Description != nil { objectMap["description"] = dcp.Description } @@ -3421,11 +3455,11 @@ type DscNode struct { Etag *string `json:"etag,omitempty"` // ExtensionHandler - Gets or sets the list of extensionHandler properties for a Node. ExtensionHandler *[]DscNodeExtensionHandlerAssociationProperty `json:"extensionHandler,omitempty"` - // ID - Resource Id + // ID - Fully qualified resource Id for the resource ID *string `json:"id,omitempty"` - // Name - Resource name + // Name - The name of the resource Name *string `json:"name,omitempty"` - // Type - Resource type + // Type - The type of the resource. Type *string `json:"type,omitempty"` } @@ -3438,11 +3472,11 @@ type DscNodeConfiguration struct { CreationTime *date.Time `json:"creationTime,omitempty"` // Configuration - Gets or sets the configuration of the node. Configuration *DscConfigurationAssociationProperty `json:"configuration,omitempty"` - // ID - Resource Id + // ID - Fully qualified resource Id for the resource ID *string `json:"id,omitempty"` - // Name - Resource name + // Name - The name of the resource Name *string `json:"name,omitempty"` - // Type - Resource type + // Type - The type of the resource. Type *string `json:"type,omitempty"` } @@ -3457,12 +3491,12 @@ type DscNodeConfigurationAssociationProperty struct { type DscNodeConfigurationCreateOrUpdateParameters struct { // Source - Gets or sets the source. Source *ContentSource `json:"source,omitempty"` - // Name - Gets or sets the type of the parameter. + // Name - Name of the node configuration. Name *string `json:"name,omitempty"` // Configuration - Gets or sets the configuration of the node. Configuration *DscConfigurationAssociationProperty `json:"configuration,omitempty"` - // NewNodeConfigurationBuildVersionRequired - If a new build version of NodeConfiguration is required. - NewNodeConfigurationBuildVersionRequired *bool `json:"newNodeConfigurationBuildVersionRequired,omitempty"` + // IncrementNodeConfigurationBuild - If a new build version of NodeConfiguration is required. + IncrementNodeConfigurationBuild *bool `json:"incrementNodeConfigurationBuild,omitempty"` } // DscNodeConfigurationListResult the response model for the list job operation. @@ -3902,6 +3936,8 @@ type HybridRunbookWorker struct { IP *string `json:"ip,omitempty"` // RegistrationTime - Gets or sets the registration time of the worker machine. RegistrationTime *date.Time `json:"registrationTime,omitempty"` + // LastSeenDateTime - Last Heartbeat from the Worker + LastSeenDateTime *date.Time `json:"lastSeenDateTime,omitempty"` } // HybridRunbookWorkerGroup definition of hybrid runbook worker group. @@ -3915,6 +3951,8 @@ type HybridRunbookWorkerGroup struct { HybridRunbookWorkers *[]HybridRunbookWorker `json:"hybridRunbookWorkers,omitempty"` // Credential - Sets the credential of a worker group. Credential *RunAsCredentialAssociationProperty `json:"credential,omitempty"` + // GroupType - Type of the HybridWorkerGroup. Possible values include: 'User', 'System' + GroupType GroupTypeEnum `json:"groupType,omitempty"` } // HybridRunbookWorkerGroupsListResult the response model for the list hybrid runbook worker groups. @@ -4274,8 +4312,12 @@ type JobProperties struct { LastStatusModifiedTime *date.Time `json:"lastStatusModifiedTime,omitempty"` // Parameters - Gets or sets the parameters of the job. Parameters map[string]*string `json:"parameters"` - // ProvisioningState - The provisioning state of a resource. - ProvisioningState *JobProvisioningStateProperty `json:"provisioningState,omitempty"` + // ProvisioningState - The provisioning state of a resource. Possible values include: 'JobProvisioningStateFailed', 'JobProvisioningStateSucceeded', 'JobProvisioningStateSuspended', 'JobProvisioningStateProcessing' + ProvisioningState JobProvisioningState `json:"provisioningState,omitempty"` + // JobScheduleID - Gets or sets the id of job schedule. + JobScheduleID *string `json:"jobScheduleId,omitempty"` + // Schedule - Gets or sets the runbook. + Schedule *ScheduleAssociationProperty `json:"schedule,omitempty"` } // MarshalJSON is the custom marshaler for JobProperties. @@ -4320,18 +4362,18 @@ func (jp JobProperties) MarshalJSON() ([]byte, error) { if jp.Parameters != nil { objectMap["parameters"] = jp.Parameters } - if jp.ProvisioningState != nil { + if jp.ProvisioningState != "" { objectMap["provisioningState"] = jp.ProvisioningState } + if jp.JobScheduleID != nil { + objectMap["jobScheduleId"] = jp.JobScheduleID + } + if jp.Schedule != nil { + objectMap["schedule"] = jp.Schedule + } return json.Marshal(objectMap) } -// JobProvisioningStateProperty the provisioning state property. -type JobProvisioningStateProperty struct { - // ProvisioningState - The provisioning state of the resource. Possible values include: 'JobProvisioningStateFailed', 'JobProvisioningStateSucceeded', 'JobProvisioningStateSuspended', 'JobProvisioningStateProcessing' - ProvisioningState JobProvisioningState `json:"provisioningState,omitempty"` -} - // JobSchedule definition of the job schedule. type JobSchedule struct { autorest.Response `json:"-"` @@ -4819,18 +4861,18 @@ func (jsp JobStreamProperties) MarshalJSON() ([]byte, error) { // Key automation key which is used to register a DSC Node type Key struct { // KeyName - Automation key name. Possible values include: 'KeyNamePrimary', 'KeyNameSecondary' - KeyName KeyName `json:"keyName,omitempty"` - // Permissions - Automation key permissions. Possible values include: 'Full' - Permissions KeyPermissions `json:"permissions,omitempty"` + KeyName KeyName `json:"KeyName,omitempty"` + // Permissions - Automation key permissions. Possible values include: 'Read', 'Full' + Permissions KeyPermissions `json:"Permissions,omitempty"` // Value - Value of the Automation Key used for registration. - Value *string `json:"value,omitempty"` + Value *string `json:"Value,omitempty"` } // KeyListResult ... type KeyListResult struct { autorest.Response `json:"-"` - // Value - Lists the automation keys. - Value *[]Key `json:"value,omitempty"` + // Keys - Lists the automation keys. + Keys *[]Key `json:"keys,omitempty"` } // LinkedWorkspace definition of the linked workspace. @@ -4847,16 +4889,16 @@ type Module struct { *ModuleProperties `json:"properties,omitempty"` // Etag - Gets or sets the etag of the resource. Etag *string `json:"etag,omitempty"` - // ID - Resource Id - ID *string `json:"id,omitempty"` - // Name - Resource name - Name *string `json:"name,omitempty"` - // Type - Resource type - Type *string `json:"type,omitempty"` - // Location - Resource location - Location *string `json:"location,omitempty"` - // Tags - Resource tags + // Tags - Resource tags. Tags map[string]*string `json:"tags"` + // Location - The Azure Region where the resource lives + Location *string `json:"location,omitempty"` + // ID - Fully qualified resource Id for the resource + ID *string `json:"id,omitempty"` + // Name - The name of the resource + Name *string `json:"name,omitempty"` + // Type - The type of the resource. + Type *string `json:"type,omitempty"` } // MarshalJSON is the custom marshaler for Module. @@ -4868,6 +4910,12 @@ func (mVar Module) MarshalJSON() ([]byte, error) { if mVar.Etag != nil { objectMap["etag"] = mVar.Etag } + if mVar.Tags != nil { + objectMap["tags"] = mVar.Tags + } + if mVar.Location != nil { + objectMap["location"] = mVar.Location + } if mVar.ID != nil { objectMap["id"] = mVar.ID } @@ -4877,12 +4925,6 @@ func (mVar Module) MarshalJSON() ([]byte, error) { if mVar.Type != nil { objectMap["type"] = mVar.Type } - if mVar.Location != nil { - objectMap["location"] = mVar.Location - } - if mVar.Tags != nil { - objectMap["tags"] = mVar.Tags - } return json.Marshal(objectMap) } @@ -4913,6 +4955,24 @@ func (mVar *Module) UnmarshalJSON(body []byte) error { } mVar.Etag = &etag } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + mVar.Tags = tags + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + mVar.Location = &location + } case "id": if v != nil { var ID string @@ -4940,24 +5000,6 @@ func (mVar *Module) UnmarshalJSON(body []byte) error { } mVar.Type = &typeVar } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - mVar.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - mVar.Tags = tags - } } } @@ -5183,6 +5225,8 @@ type ModuleProperties struct { LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` // Description - Gets or sets the description. Description *string `json:"description,omitempty"` + // IsComposite - Gets or sets type of module, if its composite or not. + IsComposite *bool `json:"isComposite,omitempty"` } // ModuleUpdateParameters the parameters supplied to the update module operation. @@ -5297,13 +5341,13 @@ type OperationListResult struct { Value *[]Operation `json:"value,omitempty"` } -// ProxyResource the Resource definition. +// ProxyResource ARM proxy resource. type ProxyResource struct { - // ID - Resource Id + // ID - Fully qualified resource Id for the resource ID *string `json:"id,omitempty"` - // Name - Resource name + // Name - The name of the resource Name *string `json:"name,omitempty"` - // Type - Resource type + // Type - The type of the resource. Type *string `json:"type,omitempty"` } @@ -5313,39 +5357,14 @@ type ReadCloser struct { Value *io.ReadCloser `json:"value,omitempty"` } -// Resource the Resource definition. +// Resource the core properties of ARM resources type Resource struct { - // ID - Resource Id + // ID - Fully qualified resource Id for the resource ID *string `json:"id,omitempty"` - // Name - Resource name + // Name - The name of the resource Name *string `json:"name,omitempty"` - // Type - Resource type + // Type - The type of the resource. Type *string `json:"type,omitempty"` - // Location - Resource location - Location *string `json:"location,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for Resource. -func (r Resource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if r.ID != nil { - objectMap["id"] = r.ID - } - if r.Name != nil { - objectMap["name"] = r.Name - } - if r.Type != nil { - objectMap["type"] = r.Type - } - if r.Location != nil { - objectMap["location"] = r.Location - } - if r.Tags != nil { - objectMap["tags"] = r.Tags - } - return json.Marshal(objectMap) } // RunAsCredentialAssociationProperty definition of runas credential to use for hybrid worker. @@ -5361,16 +5380,16 @@ type Runbook struct { *RunbookProperties `json:"properties,omitempty"` // Etag - Gets or sets the etag of the resource. Etag *string `json:"etag,omitempty"` - // ID - Resource Id - ID *string `json:"id,omitempty"` - // Name - Resource name - Name *string `json:"name,omitempty"` - // Type - Resource type - Type *string `json:"type,omitempty"` - // Location - Resource location - Location *string `json:"location,omitempty"` - // Tags - Resource tags + // Tags - Resource tags. Tags map[string]*string `json:"tags"` + // Location - The Azure Region where the resource lives + Location *string `json:"location,omitempty"` + // ID - Fully qualified resource Id for the resource + ID *string `json:"id,omitempty"` + // Name - The name of the resource + Name *string `json:"name,omitempty"` + // Type - The type of the resource. + Type *string `json:"type,omitempty"` } // MarshalJSON is the custom marshaler for Runbook. @@ -5382,6 +5401,12 @@ func (r Runbook) MarshalJSON() ([]byte, error) { if r.Etag != nil { objectMap["etag"] = r.Etag } + if r.Tags != nil { + objectMap["tags"] = r.Tags + } + if r.Location != nil { + objectMap["location"] = r.Location + } if r.ID != nil { objectMap["id"] = r.ID } @@ -5391,12 +5416,6 @@ func (r Runbook) MarshalJSON() ([]byte, error) { if r.Type != nil { objectMap["type"] = r.Type } - if r.Location != nil { - objectMap["location"] = r.Location - } - if r.Tags != nil { - objectMap["tags"] = r.Tags - } return json.Marshal(objectMap) } @@ -5427,6 +5446,24 @@ func (r *Runbook) UnmarshalJSON(body []byte) error { } r.Etag = &etag } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + r.Tags = tags + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + r.Location = &location + } case "id": if v != nil { var ID string @@ -5454,24 +5491,6 @@ func (r *Runbook) UnmarshalJSON(body []byte) error { } r.Type = &typeVar } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - r.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - r.Tags = tags - } } } @@ -5605,7 +5624,7 @@ type RunbookCreateOrUpdateProperties struct { LogActivityTrace *int32 `json:"logActivityTrace,omitempty"` } -// RunbookDraft definition of the runbook type. +// RunbookDraft ... type RunbookDraft struct { autorest.Response `json:"-"` // InEdit - Gets or sets whether runbook is in edit mode. @@ -5649,12 +5668,11 @@ func (rd RunbookDraft) MarshalJSON() ([]byte, error) { // RunbookDraftPublishFuture an abstraction for monitoring and retrieving the results of a long-running operation. type RunbookDraftPublishFuture struct { azure.Future - req *http.Request } // Result returns the result of the asynchronous operation. // If the operation has not completed it will return an error. -func (future RunbookDraftPublishFuture) Result(client RunbookDraftClient) (s String, err error) { +func (future *RunbookDraftPublishFuture) Result(client RunbookDraftClient) (ar autorest.Response, err error) { var done bool done, err = future.Done(client) if err != nil { @@ -5662,35 +5680,10 @@ func (future RunbookDraftPublishFuture) Result(client RunbookDraftClient) (s Str return } if !done { - return s, azure.NewAsyncOpIncompleteError("automation.RunbookDraftPublishFuture") - } - if future.PollingMethod() == azure.PollingLocation { - s, err = client.PublishResponder(future.Response()) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.RunbookDraftPublishFuture", "Result", future.Response(), "Failure responding to request") - } + err = azure.NewAsyncOpIncompleteError("automation.RunbookDraftPublishFuture") return } - var req *http.Request - var resp *http.Response - if future.PollingURL() != "" { - req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) - if err != nil { - return - } - } else { - req = autorest.ChangeToGet(future.req) - } - resp, err = autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.RunbookDraftPublishFuture", "Result", resp, "Failure sending request") - return - } - s, err = client.PublishResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.RunbookDraftPublishFuture", "Result", resp, "Failure responding to request") - } + ar.Response = future.Response() return } @@ -5698,12 +5691,11 @@ func (future RunbookDraftPublishFuture) Result(client RunbookDraftClient) (s Str // operation. type RunbookDraftReplaceContentFuture struct { azure.Future - req *http.Request } // Result returns the result of the asynchronous operation. // If the operation has not completed it will return an error. -func (future RunbookDraftReplaceContentFuture) Result(client RunbookDraftClient) (s String, err error) { +func (future *RunbookDraftReplaceContentFuture) Result(client RunbookDraftClient) (s String, err error) { var done bool done, err = future.Done(client) if err != nil { @@ -5711,34 +5703,15 @@ func (future RunbookDraftReplaceContentFuture) Result(client RunbookDraftClient) return } if !done { - return s, azure.NewAsyncOpIncompleteError("automation.RunbookDraftReplaceContentFuture") - } - if future.PollingMethod() == azure.PollingLocation { - s, err = client.ReplaceContentResponder(future.Response()) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.RunbookDraftReplaceContentFuture", "Result", future.Response(), "Failure responding to request") - } + err = azure.NewAsyncOpIncompleteError("automation.RunbookDraftReplaceContentFuture") return } - var req *http.Request - var resp *http.Response - if future.PollingURL() != "" { - req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if s.Response.Response, err = future.GetResult(sender); err == nil && s.Response.Response.StatusCode != http.StatusNoContent { + s, err = client.ReplaceContentResponder(s.Response.Response) if err != nil { - return + err = autorest.NewErrorWithError(err, "automation.RunbookDraftReplaceContentFuture", "Result", s.Response.Response, "Failure responding to request") } - } else { - req = autorest.ChangeToGet(future.req) - } - resp, err = autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.RunbookDraftReplaceContentFuture", "Result", resp, "Failure sending request") - return - } - s, err = client.ReplaceContentResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.RunbookDraftReplaceContentFuture", "Result", resp, "Failure responding to request") } return } @@ -6046,19 +6019,22 @@ type RunbookUpdateProperties struct { // Schedule definition of the schedule. type Schedule struct { autorest.Response `json:"-"` - // ID - Gets the id of the resource. - ID *string `json:"id,omitempty"` - // Name - Gets name of the schedule. - Name *string `json:"name,omitempty"` - // Type - Resource type - Type *string `json:"type,omitempty"` // ScheduleProperties - Gets or sets the properties of the schedule. *ScheduleProperties `json:"properties,omitempty"` + // ID - Fully qualified resource Id for the resource + ID *string `json:"id,omitempty"` + // Name - The name of the resource + Name *string `json:"name,omitempty"` + // Type - The type of the resource. + Type *string `json:"type,omitempty"` } // MarshalJSON is the custom marshaler for Schedule. func (s Schedule) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) + if s.ScheduleProperties != nil { + objectMap["properties"] = s.ScheduleProperties + } if s.ID != nil { objectMap["id"] = s.ID } @@ -6068,9 +6044,6 @@ func (s Schedule) MarshalJSON() ([]byte, error) { if s.Type != nil { objectMap["type"] = s.Type } - if s.ScheduleProperties != nil { - objectMap["properties"] = s.ScheduleProperties - } return json.Marshal(objectMap) } @@ -6083,6 +6056,15 @@ func (s *Schedule) UnmarshalJSON(body []byte) error { } for k, v := range m { switch k { + case "properties": + if v != nil { + var scheduleProperties ScheduleProperties + err = json.Unmarshal(*v, &scheduleProperties) + if err != nil { + return err + } + s.ScheduleProperties = &scheduleProperties + } case "id": if v != nil { var ID string @@ -6110,15 +6092,6 @@ func (s *Schedule) UnmarshalJSON(body []byte) error { } s.Type = &typeVar } - case "properties": - if v != nil { - var scheduleProperties ScheduleProperties - err = json.Unmarshal(*v, &scheduleProperties) - if err != nil { - return err - } - s.ScheduleProperties = &scheduleProperties - } } } @@ -6127,13 +6100,13 @@ func (s *Schedule) UnmarshalJSON(body []byte) error { // ScheduleAssociationProperty the schedule property associated with the entity. type ScheduleAssociationProperty struct { - // Name - Gets or sets the name of the schedule. + // Name - Gets or sets the name of the Schedule. Name *string `json:"name,omitempty"` } // ScheduleCreateOrUpdateParameters the parameters supplied to the create or update schedule operation. type ScheduleCreateOrUpdateParameters struct { - // Name - Gets or sets the name of the schedule. + // Name - Gets or sets the name of the Schedule. Name *string `json:"name,omitempty"` // ScheduleCreateOrUpdateProperties - Gets or sets the list of schedule properties. *ScheduleCreateOrUpdateProperties `json:"properties,omitempty"` @@ -6338,7 +6311,7 @@ type ScheduleProperties struct { // ScheduleUpdateParameters the parameters supplied to the update schedule operation. type ScheduleUpdateParameters struct { - // Name - Gets or sets the name of the schedule. + // Name - Gets or sets the name of the Schedule. Name *string `json:"name,omitempty"` // ScheduleUpdateProperties - Gets or sets the list of schedule properties. *ScheduleUpdateProperties `json:"properties,omitempty"` @@ -6440,12 +6413,6 @@ type String struct { Value *string `json:"value,omitempty"` } -// SubResource the Sub Resource definition. -type SubResource struct { - // ID - Resource Id - ID *string `json:"id,omitempty"` -} - // TestJob definition of the test job. type TestJob struct { autorest.Response `json:"-"` @@ -6532,6 +6499,41 @@ func (tjcp TestJobCreateParameters) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// TrackedResource the resource model definition for a ARM tracked top level resource +type TrackedResource struct { + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // Location - The Azure Region where the resource lives + Location *string `json:"location,omitempty"` + // ID - Fully qualified resource Id for the resource + ID *string `json:"id,omitempty"` + // Name - The name of the resource + Name *string `json:"name,omitempty"` + // Type - The type of the resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for TrackedResource. +func (tr TrackedResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if tr.Tags != nil { + objectMap["tags"] = tr.Tags + } + if tr.Location != nil { + objectMap["location"] = tr.Location + } + if tr.ID != nil { + objectMap["id"] = tr.ID + } + if tr.Name != nil { + objectMap["name"] = tr.Name + } + if tr.Type != nil { + objectMap["type"] = tr.Type + } + return json.Marshal(objectMap) +} + // TypeField information about a field of a type. type TypeField struct { // Name - Gets or sets the name of the field. @@ -6581,19 +6583,22 @@ type UsageListResult struct { // Variable definition of the varible. type Variable struct { autorest.Response `json:"-"` - // ID - Gets the id of the resource. - ID *string `json:"id,omitempty"` - // Name - Gets the name of the variable. - Name *string `json:"name,omitempty"` - // Type - Resource type - Type *string `json:"type,omitempty"` // VariableProperties - Gets or sets the properties of the variable. *VariableProperties `json:"properties,omitempty"` + // ID - Fully qualified resource Id for the resource + ID *string `json:"id,omitempty"` + // Name - The name of the resource + Name *string `json:"name,omitempty"` + // Type - The type of the resource. + Type *string `json:"type,omitempty"` } // MarshalJSON is the custom marshaler for Variable. func (vVar Variable) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) + if vVar.VariableProperties != nil { + objectMap["properties"] = vVar.VariableProperties + } if vVar.ID != nil { objectMap["id"] = vVar.ID } @@ -6603,9 +6608,6 @@ func (vVar Variable) MarshalJSON() ([]byte, error) { if vVar.Type != nil { objectMap["type"] = vVar.Type } - if vVar.VariableProperties != nil { - objectMap["properties"] = vVar.VariableProperties - } return json.Marshal(objectMap) } @@ -6618,6 +6620,15 @@ func (vVar *Variable) UnmarshalJSON(body []byte) error { } for k, v := range m { switch k { + case "properties": + if v != nil { + var variableProperties VariableProperties + err = json.Unmarshal(*v, &variableProperties) + if err != nil { + return err + } + vVar.VariableProperties = &variableProperties + } case "id": if v != nil { var ID string @@ -6645,15 +6656,6 @@ func (vVar *Variable) UnmarshalJSON(body []byte) error { } vVar.Type = &typeVar } - case "properties": - if v != nil { - var variableProperties VariableProperties - err = json.Unmarshal(*v, &variableProperties) - if err != nil { - return err - } - vVar.VariableProperties = &variableProperties - } } } @@ -6903,19 +6905,22 @@ type VariableUpdateProperties struct { // Webhook definition of the webhook type. type Webhook struct { autorest.Response `json:"-"` - // ID - Gets the id of the resource. - ID *string `json:"id,omitempty"` - // Name - Gets the name of the webhook. - Name *string `json:"name,omitempty"` - // Type - Gets the type of the resource. - Type *string `json:"type,omitempty"` // WebhookProperties - Gets or sets the webhook properties. *WebhookProperties `json:"properties,omitempty"` + // ID - Fully qualified resource Id for the resource + ID *string `json:"id,omitempty"` + // Name - The name of the resource + Name *string `json:"name,omitempty"` + // Type - The type of the resource. + Type *string `json:"type,omitempty"` } // MarshalJSON is the custom marshaler for Webhook. func (w Webhook) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) + if w.WebhookProperties != nil { + objectMap["properties"] = w.WebhookProperties + } if w.ID != nil { objectMap["id"] = w.ID } @@ -6925,9 +6930,6 @@ func (w Webhook) MarshalJSON() ([]byte, error) { if w.Type != nil { objectMap["type"] = w.Type } - if w.WebhookProperties != nil { - objectMap["properties"] = w.WebhookProperties - } return json.Marshal(objectMap) } @@ -6940,6 +6942,15 @@ func (w *Webhook) UnmarshalJSON(body []byte) error { } for k, v := range m { switch k { + case "properties": + if v != nil { + var webhookProperties WebhookProperties + err = json.Unmarshal(*v, &webhookProperties) + if err != nil { + return err + } + w.WebhookProperties = &webhookProperties + } case "id": if v != nil { var ID string @@ -6967,15 +6978,6 @@ func (w *Webhook) UnmarshalJSON(body []byte) error { } w.Type = &typeVar } - case "properties": - if v != nil { - var webhookProperties WebhookProperties - err = json.Unmarshal(*v, &webhookProperties) - if err != nil { - return err - } - w.WebhookProperties = &webhookProperties - } } } @@ -7197,6 +7199,8 @@ type WebhookProperties struct { CreationTime *date.Time `json:"creationTime,omitempty"` // LastModifiedTime - Gets or sets the last modified time. LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` + // LastModifiedBy - Details of the user who last modified the Webhook + LastModifiedBy *string `json:"lastModifiedBy,omitempty"` // Description - Gets or sets the description. Description *string `json:"description,omitempty"` } @@ -7231,6 +7235,9 @@ func (wp WebhookProperties) MarshalJSON() ([]byte, error) { if wp.LastModifiedTime != nil { objectMap["lastModifiedTime"] = wp.LastModifiedTime } + if wp.LastModifiedBy != nil { + objectMap["lastModifiedBy"] = wp.LastModifiedBy + } if wp.Description != nil { objectMap["description"] = wp.Description } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/module.go b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/module.go index 929cc72ca..d75a0d02f 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/module.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/module.go @@ -41,13 +41,17 @@ func NewModuleClientWithBaseURI(baseURI string, subscriptionID string) ModuleCli } // CreateOrUpdate create or Update the module identified by module name. -// -// resourceGroupName is the resource group name. automationAccountName is the automation account name. moduleName -// is the name of module. parameters is the create or update parameters for module. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// moduleName - the name of module. +// parameters - the create or update parameters for module. func (client ModuleClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, automationAccountName string, moduleName string, parameters ModuleCreateOrUpdateParameters) (result Module, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.ModuleCreateOrUpdateProperties", Name: validation.Null, Rule: true, Chain: []validation.Constraint{{Target: "parameters.ModuleCreateOrUpdateProperties.ContentLink", Name: validation.Null, Rule: true, @@ -126,13 +130,16 @@ func (client ModuleClient) CreateOrUpdateResponder(resp *http.Response) (result } // Delete delete the module by name. -// -// resourceGroupName is the resource group name. automationAccountName is the automation account name. moduleName -// is the module name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// moduleName - the module name. func (client ModuleClient) Delete(ctx context.Context, resourceGroupName string, automationAccountName string, moduleName string) (result autorest.Response, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("automation.ModuleClient", "Delete", err.Error()) } @@ -199,13 +206,16 @@ func (client ModuleClient) DeleteResponder(resp *http.Response) (result autorest } // Get retrieve the module identified by module name. -// -// resourceGroupName is the resource group name. automationAccountName is the automation account name. moduleName -// is the module name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// moduleName - the module name. func (client ModuleClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, moduleName string) (result Module, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("automation.ModuleClient", "Get", err.Error()) } @@ -273,12 +283,15 @@ func (client ModuleClient) GetResponder(resp *http.Response) (result Module, err } // ListByAutomationAccount retrieve a list of modules. -// -// resourceGroupName is the resource group name. automationAccountName is the automation account name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. func (client ModuleClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string) (result ModuleListResultPage, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("automation.ModuleClient", "ListByAutomationAccount", err.Error()) } @@ -373,13 +386,17 @@ func (client ModuleClient) ListByAutomationAccountComplete(ctx context.Context, } // Update update the module identified by module name. -// -// resourceGroupName is the resource group name. automationAccountName is the automation account name. moduleName -// is the name of module. parameters is the update parameters for module. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// moduleName - the name of module. +// parameters - the update parameters for module. func (client ModuleClient) Update(ctx context.Context, resourceGroupName string, automationAccountName string, moduleName string, parameters ModuleUpdateParameters) (result Module, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("automation.ModuleClient", "Update", err.Error()) } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/nodereports.go b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/nodereports.go index 2cdc9b7ee..32a8f9af7 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/nodereports.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/nodereports.go @@ -41,13 +41,17 @@ func NewNodeReportsClientWithBaseURI(baseURI string, subscriptionID string) Node } // Get retrieve the Dsc node report data by node id and report id. -// -// resourceGroupName is the resource group name. automationAccountName is the automation account name. nodeID is -// the Dsc node id. reportID is the report id. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// nodeID - the Dsc node id. +// reportID - the report id. func (client NodeReportsClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, nodeID string, reportID string) (result DscNodeReport, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("automation.NodeReportsClient", "Get", err.Error()) } @@ -116,13 +120,17 @@ func (client NodeReportsClient) GetResponder(resp *http.Response) (result DscNod } // GetContent retrieve the Dsc node reports by node id and report id. -// -// resourceGroupName is the resource group name. automationAccountName is the automation account name. nodeID is -// the Dsc node id. reportID is the report id. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// nodeID - the Dsc node id. +// reportID - the report id. func (client NodeReportsClient) GetContent(ctx context.Context, resourceGroupName string, automationAccountName string, nodeID string, reportID string) (result SetObject, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("automation.NodeReportsClient", "GetContent", err.Error()) } @@ -191,13 +199,17 @@ func (client NodeReportsClient) GetContentResponder(resp *http.Response) (result } // ListByNode retrieve the Dsc node report list by node id. -// -// resourceGroupName is the resource group name. automationAccountName is the automation account name. nodeID is -// the parameters supplied to the list operation. filter is the filter to apply on the operation. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// nodeID - the parameters supplied to the list operation. +// filter - the filter to apply on the operation. func (client NodeReportsClient) ListByNode(ctx context.Context, resourceGroupName string, automationAccountName string, nodeID string, filter string) (result DscNodeReportListResultPage, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("automation.NodeReportsClient", "ListByNode", err.Error()) } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/objectdatatypes.go b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/objectdatatypes.go index 80f1cb735..04791f5ad 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/objectdatatypes.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/objectdatatypes.go @@ -41,13 +41,17 @@ func NewObjectDataTypesClientWithBaseURI(baseURI string, subscriptionID string) } // ListFieldsByModuleAndType retrieve a list of fields of a given type identified by module name. -// -// resourceGroupName is the resource group name. automationAccountName is the automation account name. moduleName -// is the name of module. typeName is the name of type. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// moduleName - the name of module. +// typeName - the name of type. func (client ObjectDataTypesClient) ListFieldsByModuleAndType(ctx context.Context, resourceGroupName string, automationAccountName string, moduleName string, typeName string) (result TypeFieldListResult, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("automation.ObjectDataTypesClient", "ListFieldsByModuleAndType", err.Error()) } @@ -116,13 +120,16 @@ func (client ObjectDataTypesClient) ListFieldsByModuleAndTypeResponder(resp *htt } // ListFieldsByType retrieve a list of fields of a given type across all accessible modules. -// -// resourceGroupName is the resource group name. automationAccountName is the automation account name. typeName is -// the name of type. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// typeName - the name of type. func (client ObjectDataTypesClient) ListFieldsByType(ctx context.Context, resourceGroupName string, automationAccountName string, typeName string) (result TypeFieldListResult, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("automation.ObjectDataTypesClient", "ListFieldsByType", err.Error()) } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/runbook.go b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/runbook.go index fc316a1d7..af0abb990 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/runbook.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/runbook.go @@ -41,14 +41,18 @@ func NewRunbookClientWithBaseURI(baseURI string, subscriptionID string) RunbookC } // CreateOrUpdate create the runbook identified by runbook name. -// -// resourceGroupName is the resource group name. automationAccountName is the automation account name. runbookName -// is the runbook name. parameters is the create or update parameters for runbook. Provide either content link for -// a published runbook or draft, not both. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// runbookName - the runbook name. +// parameters - the create or update parameters for runbook. Provide either content link for a published +// runbook or draft, not both. func (client RunbookClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string, parameters RunbookCreateOrUpdateParameters) (result Runbook, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.RunbookCreateOrUpdateProperties", Name: validation.Null, Rule: true, Chain: []validation.Constraint{{Target: "parameters.RunbookCreateOrUpdateProperties.Draft", Name: validation.Null, Rule: false, @@ -135,13 +139,16 @@ func (client RunbookClient) CreateOrUpdateResponder(resp *http.Response) (result } // Delete delete the runbook by name. -// -// resourceGroupName is the resource group name. automationAccountName is the automation account name. runbookName -// is the runbook name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// runbookName - the runbook name. func (client RunbookClient) Delete(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (result autorest.Response, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("automation.RunbookClient", "Delete", err.Error()) } @@ -208,13 +215,16 @@ func (client RunbookClient) DeleteResponder(resp *http.Response) (result autores } // Get retrieve the runbook identified by runbook name. -// -// resourceGroupName is the resource group name. automationAccountName is the automation account name. runbookName -// is the runbook name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// runbookName - the runbook name. func (client RunbookClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (result Runbook, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("automation.RunbookClient", "Get", err.Error()) } @@ -282,13 +292,16 @@ func (client RunbookClient) GetResponder(resp *http.Response) (result Runbook, e } // GetContent retrieve the content of runbook identified by runbook name. -// -// resourceGroupName is the resource group name. automationAccountName is the automation account name. runbookName -// is the runbook name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// runbookName - the runbook name. func (client RunbookClient) GetContent(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (result String, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("automation.RunbookClient", "GetContent", err.Error()) } @@ -356,12 +369,15 @@ func (client RunbookClient) GetContentResponder(resp *http.Response) (result Str } // ListByAutomationAccount retrieve a list of runbooks. -// -// resourceGroupName is the resource group name. automationAccountName is the automation account name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. func (client RunbookClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string) (result RunbookListResultPage, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("automation.RunbookClient", "ListByAutomationAccount", err.Error()) } @@ -456,13 +472,17 @@ func (client RunbookClient) ListByAutomationAccountComplete(ctx context.Context, } // Update update the runbook identified by runbook name. -// -// resourceGroupName is the resource group name. automationAccountName is the automation account name. runbookName -// is the runbook name. parameters is the update parameters for runbook. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// runbookName - the runbook name. +// parameters - the update parameters for runbook. func (client RunbookClient) Update(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string, parameters RunbookUpdateParameters) (result Runbook, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("automation.RunbookClient", "Update", err.Error()) } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/runbookdraft.go b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/runbookdraft.go index 4bc9805d5..b3c0c9ad8 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/runbookdraft.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/runbookdraft.go @@ -41,13 +41,16 @@ func NewRunbookDraftClientWithBaseURI(baseURI string, subscriptionID string) Run } // Get retrieve the runbook draft identified by runbook name. -// -// resourceGroupName is the resource group name. automationAccountName is the automation account name. runbookName -// is the runbook name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// runbookName - the runbook name. func (client RunbookDraftClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (result RunbookDraft, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("automation.RunbookDraftClient", "Get", err.Error()) } @@ -115,13 +118,16 @@ func (client RunbookDraftClient) GetResponder(resp *http.Response) (result Runbo } // GetContent retrieve the content of runbook draft identified by runbook name. -// -// resourceGroupName is the resource group name. automationAccountName is the automation account name. runbookName -// is the runbook name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// runbookName - the runbook name. func (client RunbookDraftClient) GetContent(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (result String, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("automation.RunbookDraftClient", "GetContent", err.Error()) } @@ -189,13 +195,16 @@ func (client RunbookDraftClient) GetContentResponder(resp *http.Response) (resul } // Publish publish runbook draft. -// -// resourceGroupName is the resource group name. automationAccountName is the automation account name. runbookName -// is the parameters supplied to the publish runbook operation. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// runbookName - the parameters supplied to the publish runbook operation. func (client RunbookDraftClient) Publish(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (result RunbookDraftPublishFuture, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("automation.RunbookDraftClient", "Publish", err.Error()) } @@ -239,39 +248,44 @@ func (client RunbookDraftClient) PublishPreparer(ctx context.Context, resourceGr // PublishSender sends the Publish request. The method will close the // http.Response Body if it receives an error. func (client RunbookDraftClient) PublishSender(req *http.Request) (future RunbookDraftPublishFuture, err error) { - sender := autorest.DecorateSender(client, azure.DoRetryWithRegistration(client.Client)) - future.Future = azure.NewFuture(req) - future.req = req - _, err = future.Done(sender) + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) if err != nil { return } - err = autorest.Respond(future.Response(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted)) + err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) return } // PublishResponder handles the response to the Publish request. The method always // closes the http.Response Body. -func (client RunbookDraftClient) PublishResponder(resp *http.Response) (result String, err error) { +func (client RunbookDraftClient) PublishResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} + result.Response = resp return } // ReplaceContent replaces the runbook draft content. -// -// resourceGroupName is the resource group name. automationAccountName is the automation account name. runbookName -// is the runbook name. runbookContent is the runbook draft content. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// runbookName - the runbook name. +// runbookContent - the runbook draft content. func (client RunbookDraftClient) ReplaceContent(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string, runbookContent string) (result RunbookDraftReplaceContentFuture, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("automation.RunbookDraftClient", "ReplaceContent", err.Error()) } @@ -317,15 +331,17 @@ func (client RunbookDraftClient) ReplaceContentPreparer(ctx context.Context, res // ReplaceContentSender sends the ReplaceContent request. The method will close the // http.Response Body if it receives an error. func (client RunbookDraftClient) ReplaceContentSender(req *http.Request) (future RunbookDraftReplaceContentFuture, err error) { - sender := autorest.DecorateSender(client, azure.DoRetryWithRegistration(client.Client)) - future.Future = azure.NewFuture(req) - future.req = req - _, err = future.Done(sender) + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) if err != nil { return } - err = autorest.Respond(future.Response(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted)) + err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) return } @@ -343,13 +359,16 @@ func (client RunbookDraftClient) ReplaceContentResponder(resp *http.Response) (r } // UndoEdit undo draft edit to last known published state identified by runbook name. -// -// resourceGroupName is the resource group name. automationAccountName is the automation account name. runbookName -// is the runbook name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// runbookName - the runbook name. func (client RunbookDraftClient) UndoEdit(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (result RunbookDraftUndoEditResult, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("automation.RunbookDraftClient", "UndoEdit", err.Error()) } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/schedule.go b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/schedule.go index ee673e960..c6635f076 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/schedule.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/schedule.go @@ -41,13 +41,17 @@ func NewScheduleClientWithBaseURI(baseURI string, subscriptionID string) Schedul } // CreateOrUpdate create a schedule. -// -// resourceGroupName is the resource group name. automationAccountName is the automation account name. scheduleName -// is the schedule name. parameters is the parameters supplied to the create or update schedule operation. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// scheduleName - the schedule name. +// parameters - the parameters supplied to the create or update schedule operation. func (client ScheduleClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, automationAccountName string, scheduleName string, parameters ScheduleCreateOrUpdateParameters) (result Schedule, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.Name", Name: validation.Null, Rule: true, Chain: nil}, {Target: "parameters.ScheduleCreateOrUpdateProperties", Name: validation.Null, Rule: true, @@ -121,13 +125,16 @@ func (client ScheduleClient) CreateOrUpdateResponder(resp *http.Response) (resul } // Delete delete the schedule identified by schedule name. -// -// resourceGroupName is the resource group name. automationAccountName is the automation account name. scheduleName -// is the schedule name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// scheduleName - the schedule name. func (client ScheduleClient) Delete(ctx context.Context, resourceGroupName string, automationAccountName string, scheduleName string) (result autorest.Response, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("automation.ScheduleClient", "Delete", err.Error()) } @@ -187,20 +194,23 @@ func (client ScheduleClient) DeleteResponder(resp *http.Response) (result autore err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound), + azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByClosing()) result.Response = resp return } // Get retrieve the schedule identified by schedule name. -// -// resourceGroupName is the resource group name. automationAccountName is the automation account name. scheduleName -// is the schedule name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// scheduleName - the schedule name. func (client ScheduleClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, scheduleName string) (result Schedule, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("automation.ScheduleClient", "Get", err.Error()) } @@ -268,12 +278,15 @@ func (client ScheduleClient) GetResponder(resp *http.Response) (result Schedule, } // ListByAutomationAccount retrieve a list of schedules. -// -// resourceGroupName is the resource group name. automationAccountName is the automation account name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. func (client ScheduleClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string) (result ScheduleListResultPage, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("automation.ScheduleClient", "ListByAutomationAccount", err.Error()) } @@ -368,13 +381,17 @@ func (client ScheduleClient) ListByAutomationAccountComplete(ctx context.Context } // Update update the schedule identified by schedule name. -// -// resourceGroupName is the resource group name. automationAccountName is the automation account name. scheduleName -// is the schedule name. parameters is the parameters supplied to the update schedule operation. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// scheduleName - the schedule name. +// parameters - the parameters supplied to the update schedule operation. func (client ScheduleClient) Update(ctx context.Context, resourceGroupName string, automationAccountName string, scheduleName string, parameters ScheduleUpdateParameters) (result Schedule, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("automation.ScheduleClient", "Update", err.Error()) } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/statistics.go b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/statistics.go index 4ebfa7f12..94c03fd22 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/statistics.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/statistics.go @@ -41,13 +41,16 @@ func NewStatisticsClientWithBaseURI(baseURI string, subscriptionID string) Stati } // ListByAutomationAccount retrieve the statistics for the account. -// -// resourceGroupName is the resource group name. automationAccountName is the automation account name. filter is -// the filter to apply on the operation. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// filter - the filter to apply on the operation. func (client StatisticsClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (result StatisticsListResult, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("automation.StatisticsClient", "ListByAutomationAccount", err.Error()) } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/testjob.go b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/testjob.go index 63af34493..38da3d182 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/testjob.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/testjob.go @@ -41,14 +41,17 @@ func NewTestJobClientWithBaseURI(baseURI string, subscriptionID string) TestJobC } // Create create a test job of the runbook. -// -// resourceGroupName is the resource group name. automationAccountName is the automation account name. runbookName -// is the parameters supplied to the create test job operation. parameters is the parameters supplied to the create -// test job operation. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// runbookName - the parameters supplied to the create test job operation. +// parameters - the parameters supplied to the create test job operation. func (client TestJobClient) Create(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string, parameters TestJobCreateParameters) (result TestJob, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("automation.TestJobClient", "Create", err.Error()) } @@ -118,13 +121,16 @@ func (client TestJobClient) CreateResponder(resp *http.Response) (result TestJob } // Get retrieve the test job for the specified runbook. -// -// resourceGroupName is the resource group name. automationAccountName is the automation account name. runbookName -// is the runbook name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// runbookName - the runbook name. func (client TestJobClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (result TestJob, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("automation.TestJobClient", "Get", err.Error()) } @@ -192,13 +198,16 @@ func (client TestJobClient) GetResponder(resp *http.Response) (result TestJob, e } // Resume resume the test job. -// -// resourceGroupName is the resource group name. automationAccountName is the automation account name. runbookName -// is the runbook name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// runbookName - the runbook name. func (client TestJobClient) Resume(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (result autorest.Response, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("automation.TestJobClient", "Resume", err.Error()) } @@ -265,13 +274,16 @@ func (client TestJobClient) ResumeResponder(resp *http.Response) (result autores } // Stop stop the test job. -// -// resourceGroupName is the resource group name. automationAccountName is the automation account name. runbookName -// is the runbook name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// runbookName - the runbook name. func (client TestJobClient) Stop(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (result autorest.Response, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("automation.TestJobClient", "Stop", err.Error()) } @@ -338,13 +350,16 @@ func (client TestJobClient) StopResponder(resp *http.Response) (result autorest. } // Suspend suspend the test job. -// -// resourceGroupName is the resource group name. automationAccountName is the automation account name. runbookName -// is the runbook name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// runbookName - the runbook name. func (client TestJobClient) Suspend(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (result autorest.Response, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("automation.TestJobClient", "Suspend", err.Error()) } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/testjobstreams.go b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/testjobstreams.go index 5c7f9707c..3e6219040 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/testjobstreams.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/testjobstreams.go @@ -41,13 +41,17 @@ func NewTestJobStreamsClientWithBaseURI(baseURI string, subscriptionID string) T } // Get retrieve a test job stream of the test job identified by runbook name and stream id. -// -// resourceGroupName is the resource group name. automationAccountName is the automation account name. runbookName -// is the runbook name. jobStreamID is the job stream id. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// runbookName - the runbook name. +// jobStreamID - the job stream id. func (client TestJobStreamsClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string, jobStreamID string) (result JobStream, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("automation.TestJobStreamsClient", "Get", err.Error()) } @@ -116,13 +120,17 @@ func (client TestJobStreamsClient) GetResponder(resp *http.Response) (result Job } // ListByTestJob retrieve a list of test job streams identified by runbook name. -// -// resourceGroupName is the resource group name. automationAccountName is the automation account name. runbookName -// is the runbook name. filter is the filter to apply on the operation. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// runbookName - the runbook name. +// filter - the filter to apply on the operation. func (client TestJobStreamsClient) ListByTestJob(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string, filter string) (result JobStreamListResultPage, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("automation.TestJobStreamsClient", "ListByTestJob", err.Error()) } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/usages.go b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/usages.go index 9c8726a20..39f4e6b68 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/usages.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/usages.go @@ -41,12 +41,15 @@ func NewUsagesClientWithBaseURI(baseURI string, subscriptionID string) UsagesCli } // ListByAutomationAccount retrieve the usage for the account id. -// -// resourceGroupName is the resource group name. automationAccountName is the automation account name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. func (client UsagesClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string) (result UsageListResult, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("automation.UsagesClient", "ListByAutomationAccount", err.Error()) } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/variable.go b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/variable.go index e957827d4..df53908db 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/variable.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/variable.go @@ -41,13 +41,17 @@ func NewVariableClientWithBaseURI(baseURI string, subscriptionID string) Variabl } // CreateOrUpdate create a variable. -// -// resourceGroupName is the resource group name. automationAccountName is the automation account name. variableName -// is the variable name. parameters is the parameters supplied to the create or update variable operation. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// variableName - the variable name. +// parameters - the parameters supplied to the create or update variable operation. func (client VariableClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, automationAccountName string, variableName string, parameters VariableCreateOrUpdateParameters) (result Variable, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.Name", Name: validation.Null, Rule: true, Chain: nil}, {Target: "parameters.VariableCreateOrUpdateProperties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { @@ -120,13 +124,16 @@ func (client VariableClient) CreateOrUpdateResponder(resp *http.Response) (resul } // Delete delete the variable. -// -// resourceGroupName is the resource group name. automationAccountName is the automation account name. variableName -// is the name of variable. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// variableName - the name of variable. func (client VariableClient) Delete(ctx context.Context, resourceGroupName string, automationAccountName string, variableName string) (result autorest.Response, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("automation.VariableClient", "Delete", err.Error()) } @@ -193,13 +200,16 @@ func (client VariableClient) DeleteResponder(resp *http.Response) (result autore } // Get retrieve the variable identified by variable name. -// -// resourceGroupName is the resource group name. automationAccountName is the automation account name. variableName -// is the name of variable. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// variableName - the name of variable. func (client VariableClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, variableName string) (result Variable, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("automation.VariableClient", "Get", err.Error()) } @@ -267,12 +277,15 @@ func (client VariableClient) GetResponder(resp *http.Response) (result Variable, } // ListByAutomationAccount retrieve a list of variables. -// -// resourceGroupName is the resource group name. automationAccountName is the automation account name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. func (client VariableClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string) (result VariableListResultPage, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("automation.VariableClient", "ListByAutomationAccount", err.Error()) } @@ -367,13 +380,17 @@ func (client VariableClient) ListByAutomationAccountComplete(ctx context.Context } // Update update a variable. -// -// resourceGroupName is the resource group name. automationAccountName is the automation account name. variableName -// is the variable name. parameters is the parameters supplied to the update variable operation. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// variableName - the variable name. +// parameters - the parameters supplied to the update variable operation. func (client VariableClient) Update(ctx context.Context, resourceGroupName string, automationAccountName string, variableName string, parameters VariableUpdateParameters) (result Variable, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("automation.VariableClient", "Update", err.Error()) } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/webhook.go b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/webhook.go index e55131849..186ab20e4 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/webhook.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/webhook.go @@ -41,13 +41,17 @@ func NewWebhookClientWithBaseURI(baseURI string, subscriptionID string) WebhookC } // CreateOrUpdate create the webhook identified by webhook name. -// -// resourceGroupName is the resource group name. automationAccountName is the automation account name. webhookName -// is the webhook name. parameters is the create or update parameters for webhook. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// webhookName - the webhook name. +// parameters - the create or update parameters for webhook. func (client WebhookClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, automationAccountName string, webhookName string, parameters WebhookCreateOrUpdateParameters) (result Webhook, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.Name", Name: validation.Null, Rule: true, Chain: nil}, {Target: "parameters.WebhookCreateOrUpdateProperties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { @@ -120,13 +124,16 @@ func (client WebhookClient) CreateOrUpdateResponder(resp *http.Response) (result } // Delete delete the webhook by name. -// -// resourceGroupName is the resource group name. automationAccountName is the automation account name. webhookName -// is the webhook name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// webhookName - the webhook name. func (client WebhookClient) Delete(ctx context.Context, resourceGroupName string, automationAccountName string, webhookName string) (result autorest.Response, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("automation.WebhookClient", "Delete", err.Error()) } @@ -193,12 +200,15 @@ func (client WebhookClient) DeleteResponder(resp *http.Response) (result autores } // GenerateURI generates a Uri for use in creating a webhook. -// -// resourceGroupName is the resource group name. automationAccountName is the automation account name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. func (client WebhookClient) GenerateURI(ctx context.Context, resourceGroupName string, automationAccountName string) (result String, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("automation.WebhookClient", "GenerateURI", err.Error()) } @@ -265,13 +275,16 @@ func (client WebhookClient) GenerateURIResponder(resp *http.Response) (result St } // Get retrieve the webhook identified by webhook name. -// -// resourceGroupName is the resource group name. automationAccountName is the automation account name. webhookName -// is the webhook name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// webhookName - the webhook name. func (client WebhookClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, webhookName string) (result Webhook, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("automation.WebhookClient", "Get", err.Error()) } @@ -339,13 +352,16 @@ func (client WebhookClient) GetResponder(resp *http.Response) (result Webhook, e } // ListByAutomationAccount retrieve a list of webhooks. -// -// resourceGroupName is the resource group name. automationAccountName is the automation account name. filter is -// the filter to apply on the operation. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// filter - the filter to apply on the operation. func (client WebhookClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (result WebhookListResultPage, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("automation.WebhookClient", "ListByAutomationAccount", err.Error()) } @@ -443,13 +459,17 @@ func (client WebhookClient) ListByAutomationAccountComplete(ctx context.Context, } // Update update the webhook identified by webhook name. -// -// resourceGroupName is the resource group name. automationAccountName is the automation account name. webhookName -// is the webhook name. parameters is the update parameters for webhook. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// webhookName - the webhook name. +// parameters - the update parameters for webhook. func (client WebhookClient) Update(ctx context.Context, resourceGroupName string, automationAccountName string, webhookName string, parameters WebhookUpdateParameters) (result Webhook, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("automation.WebhookClient", "Update", err.Error()) } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/batch/2017-05-01.5.0/batch/account.go b/vendor/github.com/Azure/azure-sdk-for-go/services/batch/2017-05-01.5.0/batch/account.go index 9e5ab46f5..79d29b047 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/batch/2017-05-01.5.0/batch/account.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/batch/2017-05-01.5.0/batch/account.go @@ -58,7 +58,7 @@ func (client AccountClient) ListNodeAgentSkus(ctx context.Context, filter string if err := validation.Validate([]validation.Validation{ {TargetValue: maxResults, Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, + Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: int64(1000), Chain: nil}, {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("batch.AccountClient", "ListNodeAgentSkus", err.Error()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/batch/2017-05-01.5.0/batch/application.go b/vendor/github.com/Azure/azure-sdk-for-go/services/batch/2017-05-01.5.0/batch/application.go index d4f654818..249ad6dce 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/batch/2017-05-01.5.0/batch/application.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/batch/2017-05-01.5.0/batch/application.go @@ -150,7 +150,7 @@ func (client ApplicationClient) List(ctx context.Context, maxResults *int32, tim if err := validation.Validate([]validation.Validation{ {TargetValue: maxResults, Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, + Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: int64(1000), Chain: nil}, {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("batch.ApplicationClient", "List", err.Error()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/batch/2017-05-01.5.0/batch/certificate.go b/vendor/github.com/Azure/azure-sdk-for-go/services/batch/2017-05-01.5.0/batch/certificate.go index 13398a221..ec822d0e7 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/batch/2017-05-01.5.0/batch/certificate.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/batch/2017-05-01.5.0/batch/certificate.go @@ -446,7 +446,7 @@ func (client CertificateClient) List(ctx context.Context, filter string, selectP if err := validation.Validate([]validation.Validation{ {TargetValue: maxResults, Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, + Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: int64(1000), Chain: nil}, {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("batch.CertificateClient", "List", err.Error()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/batch/2017-05-01.5.0/batch/computenode.go b/vendor/github.com/Azure/azure-sdk-for-go/services/batch/2017-05-01.5.0/batch/computenode.go index eec271526..4d9e85aa7 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/batch/2017-05-01.5.0/batch/computenode.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/batch/2017-05-01.5.0/batch/computenode.go @@ -729,7 +729,7 @@ func (client ComputeNodeClient) List(ctx context.Context, poolID string, filter if err := validation.Validate([]validation.Validation{ {TargetValue: maxResults, Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, + Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: int64(1000), Chain: nil}, {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("batch.ComputeNodeClient", "List", err.Error()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/batch/2017-05-01.5.0/batch/file.go b/vendor/github.com/Azure/azure-sdk-for-go/services/batch/2017-05-01.5.0/batch/file.go index 654cb284f..794e2b8bc 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/batch/2017-05-01.5.0/batch/file.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/batch/2017-05-01.5.0/batch/file.go @@ -700,7 +700,7 @@ func (client FileClient) ListFromComputeNode(ctx context.Context, poolID string, if err := validation.Validate([]validation.Validation{ {TargetValue: maxResults, Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, + Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: int64(1000), Chain: nil}, {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("batch.FileClient", "ListFromComputeNode", err.Error()) @@ -845,7 +845,7 @@ func (client FileClient) ListFromTask(ctx context.Context, jobID string, taskID if err := validation.Validate([]validation.Validation{ {TargetValue: maxResults, Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, + Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: int64(1000), Chain: nil}, {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("batch.FileClient", "ListFromTask", err.Error()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/batch/2017-05-01.5.0/batch/job.go b/vendor/github.com/Azure/azure-sdk-for-go/services/batch/2017-05-01.5.0/batch/job.go index 9c511bce1..5961b02f2 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/batch/2017-05-01.5.0/batch/job.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/batch/2017-05-01.5.0/batch/job.go @@ -764,7 +764,7 @@ func (client JobClient) List(ctx context.Context, filter string, selectParameter if err := validation.Validate([]validation.Validation{ {TargetValue: maxResults, Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, + Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: int64(1000), Chain: nil}, {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("batch.JobClient", "List", err.Error()) @@ -906,7 +906,7 @@ func (client JobClient) ListFromJobSchedule(ctx context.Context, jobScheduleID s if err := validation.Validate([]validation.Validation{ {TargetValue: maxResults, Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, + Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: int64(1000), Chain: nil}, {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("batch.JobClient", "ListFromJobSchedule", err.Error()) @@ -1053,7 +1053,7 @@ func (client JobClient) ListPreparationAndReleaseTaskStatus(ctx context.Context, if err := validation.Validate([]validation.Validation{ {TargetValue: maxResults, Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, + Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: int64(1000), Chain: nil}, {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("batch.JobClient", "ListPreparationAndReleaseTaskStatus", err.Error()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/batch/2017-05-01.5.0/batch/jobschedule.go b/vendor/github.com/Azure/azure-sdk-for-go/services/batch/2017-05-01.5.0/batch/jobschedule.go index 6881f82be..6678d689e 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/batch/2017-05-01.5.0/batch/jobschedule.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/batch/2017-05-01.5.0/batch/jobschedule.go @@ -783,7 +783,7 @@ func (client JobScheduleClient) List(ctx context.Context, filter string, selectP if err := validation.Validate([]validation.Validation{ {TargetValue: maxResults, Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, + Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: int64(1000), Chain: nil}, {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("batch.JobScheduleClient", "List", err.Error()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/batch/2017-05-01.5.0/batch/pool.go b/vendor/github.com/Azure/azure-sdk-for-go/services/batch/2017-05-01.5.0/batch/pool.go index 7bca00375..154d6c8c6 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/batch/2017-05-01.5.0/batch/pool.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/batch/2017-05-01.5.0/batch/pool.go @@ -937,7 +937,7 @@ func (client PoolClient) List(ctx context.Context, filter string, selectParamete if err := validation.Validate([]validation.Validation{ {TargetValue: maxResults, Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, + Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: int64(1000), Chain: nil}, {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("batch.PoolClient", "List", err.Error()) @@ -1084,7 +1084,7 @@ func (client PoolClient) ListUsageMetrics(ctx context.Context, startTime *date.T if err := validation.Validate([]validation.Validation{ {TargetValue: maxResults, Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, + Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: int64(1000), Chain: nil}, {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("batch.PoolClient", "ListUsageMetrics", err.Error()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/batch/2017-05-01.5.0/batch/task.go b/vendor/github.com/Azure/azure-sdk-for-go/services/batch/2017-05-01.5.0/batch/task.go index d621fccc7..c8d742c24 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/batch/2017-05-01.5.0/batch/task.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/batch/2017-05-01.5.0/batch/task.go @@ -521,7 +521,7 @@ func (client TaskClient) List(ctx context.Context, jobID string, filter string, if err := validation.Validate([]validation.Validation{ {TargetValue: maxResults, Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, + Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: int64(1000), Chain: nil}, {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("batch.TaskClient", "List", err.Error()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/batch/2018-03-01.6.1/batch/account.go b/vendor/github.com/Azure/azure-sdk-for-go/services/batch/2018-03-01.6.1/batch/account.go index 84fb3e478..cfeb897a1 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/batch/2018-03-01.6.1/batch/account.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/batch/2018-03-01.6.1/batch/account.go @@ -59,7 +59,7 @@ func (client AccountClient) ListNodeAgentSkus(ctx context.Context, filter string if err := validation.Validate([]validation.Validation{ {TargetValue: maxResults, Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, + Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: int64(1000), Chain: nil}, {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("batch.AccountClient", "ListNodeAgentSkus", err.Error()) @@ -192,7 +192,7 @@ func (client AccountClient) ListPoolNodeCounts(ctx context.Context, filter strin if err := validation.Validate([]validation.Validation{ {TargetValue: maxResults, Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 10, Chain: nil}, + Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: int64(10), Chain: nil}, {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("batch.AccountClient", "ListPoolNodeCounts", err.Error()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/batch/2018-03-01.6.1/batch/application.go b/vendor/github.com/Azure/azure-sdk-for-go/services/batch/2018-03-01.6.1/batch/application.go index 2369119d7..5dabda0a7 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/batch/2018-03-01.6.1/batch/application.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/batch/2018-03-01.6.1/batch/application.go @@ -152,7 +152,7 @@ func (client ApplicationClient) List(ctx context.Context, maxResults *int32, tim if err := validation.Validate([]validation.Validation{ {TargetValue: maxResults, Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, + Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: int64(1000), Chain: nil}, {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("batch.ApplicationClient", "List", err.Error()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/batch/2018-03-01.6.1/batch/certificate.go b/vendor/github.com/Azure/azure-sdk-for-go/services/batch/2018-03-01.6.1/batch/certificate.go index e70e02bf0..99e08d4fb 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/batch/2018-03-01.6.1/batch/certificate.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/batch/2018-03-01.6.1/batch/certificate.go @@ -447,7 +447,7 @@ func (client CertificateClient) List(ctx context.Context, filter string, selectP if err := validation.Validate([]validation.Validation{ {TargetValue: maxResults, Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, + Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: int64(1000), Chain: nil}, {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("batch.CertificateClient", "List", err.Error()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/batch/2018-03-01.6.1/batch/computenode.go b/vendor/github.com/Azure/azure-sdk-for-go/services/batch/2018-03-01.6.1/batch/computenode.go index 6b69c741c..fa2822411 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/batch/2018-03-01.6.1/batch/computenode.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/batch/2018-03-01.6.1/batch/computenode.go @@ -731,7 +731,7 @@ func (client ComputeNodeClient) List(ctx context.Context, poolID string, filter if err := validation.Validate([]validation.Validation{ {TargetValue: maxResults, Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, + Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: int64(1000), Chain: nil}, {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("batch.ComputeNodeClient", "List", err.Error()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/batch/2018-03-01.6.1/batch/file.go b/vendor/github.com/Azure/azure-sdk-for-go/services/batch/2018-03-01.6.1/batch/file.go index 46d6645e3..56e94eb08 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/batch/2018-03-01.6.1/batch/file.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/batch/2018-03-01.6.1/batch/file.go @@ -701,7 +701,7 @@ func (client FileClient) ListFromComputeNode(ctx context.Context, poolID string, if err := validation.Validate([]validation.Validation{ {TargetValue: maxResults, Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, + Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: int64(1000), Chain: nil}, {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("batch.FileClient", "ListFromComputeNode", err.Error()) @@ -847,7 +847,7 @@ func (client FileClient) ListFromTask(ctx context.Context, jobID string, taskID if err := validation.Validate([]validation.Validation{ {TargetValue: maxResults, Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, + Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: int64(1000), Chain: nil}, {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("batch.FileClient", "ListFromTask", err.Error()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/batch/2018-03-01.6.1/batch/job.go b/vendor/github.com/Azure/azure-sdk-for-go/services/batch/2018-03-01.6.1/batch/job.go index 5d0082232..4457b8476 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/batch/2018-03-01.6.1/batch/job.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/batch/2018-03-01.6.1/batch/job.go @@ -894,7 +894,7 @@ func (client JobClient) List(ctx context.Context, filter string, selectParameter if err := validation.Validate([]validation.Validation{ {TargetValue: maxResults, Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, + Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: int64(1000), Chain: nil}, {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("batch.JobClient", "List", err.Error()) @@ -1037,7 +1037,7 @@ func (client JobClient) ListFromJobSchedule(ctx context.Context, jobScheduleID s if err := validation.Validate([]validation.Validation{ {TargetValue: maxResults, Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, + Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: int64(1000), Chain: nil}, {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("batch.JobClient", "ListFromJobSchedule", err.Error()) @@ -1186,7 +1186,7 @@ func (client JobClient) ListPreparationAndReleaseTaskStatus(ctx context.Context, if err := validation.Validate([]validation.Validation{ {TargetValue: maxResults, Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, + Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: int64(1000), Chain: nil}, {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("batch.JobClient", "ListPreparationAndReleaseTaskStatus", err.Error()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/batch/2018-03-01.6.1/batch/jobschedule.go b/vendor/github.com/Azure/azure-sdk-for-go/services/batch/2018-03-01.6.1/batch/jobschedule.go index d2a192b26..c3f7b9b17 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/batch/2018-03-01.6.1/batch/jobschedule.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/batch/2018-03-01.6.1/batch/jobschedule.go @@ -815,7 +815,7 @@ func (client JobScheduleClient) List(ctx context.Context, filter string, selectP if err := validation.Validate([]validation.Validation{ {TargetValue: maxResults, Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, + Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: int64(1000), Chain: nil}, {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("batch.JobScheduleClient", "List", err.Error()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/batch/2018-03-01.6.1/batch/pool.go b/vendor/github.com/Azure/azure-sdk-for-go/services/batch/2018-03-01.6.1/batch/pool.go index 30122246b..e1bc5aef9 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/batch/2018-03-01.6.1/batch/pool.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/batch/2018-03-01.6.1/batch/pool.go @@ -947,7 +947,7 @@ func (client PoolClient) List(ctx context.Context, filter string, selectParamete if err := validation.Validate([]validation.Validation{ {TargetValue: maxResults, Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, + Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: int64(1000), Chain: nil}, {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("batch.PoolClient", "List", err.Error()) @@ -1096,7 +1096,7 @@ func (client PoolClient) ListUsageMetrics(ctx context.Context, startTime *date.T if err := validation.Validate([]validation.Validation{ {TargetValue: maxResults, Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, + Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: int64(1000), Chain: nil}, {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("batch.PoolClient", "ListUsageMetrics", err.Error()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/batch/2018-03-01.6.1/batch/task.go b/vendor/github.com/Azure/azure-sdk-for-go/services/batch/2018-03-01.6.1/batch/task.go index af6b6ef2f..c092c344e 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/batch/2018-03-01.6.1/batch/task.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/batch/2018-03-01.6.1/batch/task.go @@ -534,7 +534,7 @@ func (client TaskClient) List(ctx context.Context, jobID string, filter string, if err := validation.Validate([]validation.Validation{ {TargetValue: maxResults, Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, + Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: int64(1000), Chain: nil}, {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("batch.TaskClient", "List", err.Error()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/batchai/mgmt/2018-03-01/batchai/clusters.go b/vendor/github.com/Azure/azure-sdk-for-go/services/batchai/mgmt/2018-03-01/batchai/clusters.go index 11af19d83..78b8a6f60 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/batchai/mgmt/2018-03-01/batchai/clusters.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/batchai/mgmt/2018-03-01/batchai/clusters.go @@ -337,7 +337,7 @@ func (client ClustersClient) List(ctx context.Context, filter string, selectPara if err := validation.Validate([]validation.Validation{ {TargetValue: maxResults, Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, + Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: int64(1000), Chain: nil}, {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("batchai.ClustersClient", "List", err.Error()) @@ -454,7 +454,7 @@ func (client ClustersClient) ListByResourceGroup(ctx context.Context, resourceGr Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, {TargetValue: maxResults, Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, + Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: int64(1000), Chain: nil}, {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("batchai.ClustersClient", "ListByResourceGroup", err.Error()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/batchai/mgmt/2018-03-01/batchai/fileservers.go b/vendor/github.com/Azure/azure-sdk-for-go/services/batchai/mgmt/2018-03-01/batchai/fileservers.go index 5708ac8d1..ce09c29bd 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/batchai/mgmt/2018-03-01/batchai/fileservers.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/batchai/mgmt/2018-03-01/batchai/fileservers.go @@ -312,7 +312,7 @@ func (client FileServersClient) List(ctx context.Context, filter string, selectP if err := validation.Validate([]validation.Validation{ {TargetValue: maxResults, Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, + Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: int64(1000), Chain: nil}, {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("batchai.FileServersClient", "List", err.Error()) @@ -430,7 +430,7 @@ func (client FileServersClient) ListByResourceGroup(ctx context.Context, resourc Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, {TargetValue: maxResults, Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, + Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: int64(1000), Chain: nil}, {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("batchai.FileServersClient", "ListByResourceGroup", err.Error()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/batchai/mgmt/2018-03-01/batchai/jobs.go b/vendor/github.com/Azure/azure-sdk-for-go/services/batchai/mgmt/2018-03-01/batchai/jobs.go index e17a20c02..347c4e4ec 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/batchai/mgmt/2018-03-01/batchai/jobs.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/batchai/mgmt/2018-03-01/batchai/jobs.go @@ -327,7 +327,7 @@ func (client JobsClient) List(ctx context.Context, filter string, selectParamete if err := validation.Validate([]validation.Validation{ {TargetValue: maxResults, Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, + Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: int64(1000), Chain: nil}, {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("batchai.JobsClient", "List", err.Error()) @@ -444,7 +444,7 @@ func (client JobsClient) ListByResourceGroup(ctx context.Context, resourceGroupN Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, {TargetValue: maxResults, Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, + Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: int64(1000), Chain: nil}, {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("batchai.JobsClient", "ListByResourceGroup", err.Error()) @@ -572,12 +572,12 @@ func (client JobsClient) ListOutputFiles(ctx context.Context, resourceGroupName {Target: "jobName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, {TargetValue: linkexpiryinminutes, Constraints: []validation.Constraint{{Target: "linkexpiryinminutes", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "linkexpiryinminutes", Name: validation.InclusiveMaximum, Rule: 600, Chain: nil}, + Chain: []validation.Constraint{{Target: "linkexpiryinminutes", Name: validation.InclusiveMaximum, Rule: int64(600), Chain: nil}, {Target: "linkexpiryinminutes", Name: validation.InclusiveMinimum, Rule: 5, Chain: nil}, }}}}, {TargetValue: maxResults, Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, + Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: int64(1000), Chain: nil}, {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("batchai.JobsClient", "ListOutputFiles", err.Error()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/batchai/mgmt/2018-05-01/batchai/clusters.go b/vendor/github.com/Azure/azure-sdk-for-go/services/batchai/mgmt/2018-05-01/batchai/clusters.go index 979f0edb2..3882a4c4d 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/batchai/mgmt/2018-05-01/batchai/clusters.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/batchai/mgmt/2018-05-01/batchai/clusters.go @@ -62,46 +62,45 @@ func (client ClustersClient) Create(ctx context.Context, resourceGroupName strin {Target: "clusterName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "clusterName", Name: validation.Pattern, Rule: `^[-\w_]+$`, Chain: nil}}}, {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.Location", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.ClusterBaseProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.ClusterBaseProperties.VMSize", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.ClusterBaseProperties.ScaleSettings", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.ClusterBaseProperties.ScaleSettings.Manual", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.ClusterBaseProperties.ScaleSettings.Manual.TargetNodeCount", Name: validation.Null, Rule: true, Chain: nil}}}, - {Target: "parameters.ClusterBaseProperties.ScaleSettings.AutoScale", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.ClusterBaseProperties.ScaleSettings.AutoScale.MinimumNodeCount", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.ClusterBaseProperties.ScaleSettings.AutoScale.MaximumNodeCount", Name: validation.Null, Rule: true, Chain: nil}, - }}, - }}, - {Target: "parameters.ClusterBaseProperties.VirtualMachineConfiguration", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.ClusterBaseProperties.VirtualMachineConfiguration.ImageReference", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.ClusterBaseProperties.VirtualMachineConfiguration.ImageReference.Publisher", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.ClusterBaseProperties.VirtualMachineConfiguration.ImageReference.Offer", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.ClusterBaseProperties.VirtualMachineConfiguration.ImageReference.Sku", Name: validation.Null, Rule: true, Chain: nil}, + Constraints: []validation.Constraint{{Target: "parameters.ClusterBaseProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ClusterBaseProperties.VMSize", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.ClusterBaseProperties.ScaleSettings", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ClusterBaseProperties.ScaleSettings.Manual", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ClusterBaseProperties.ScaleSettings.Manual.TargetNodeCount", Name: validation.Null, Rule: true, Chain: nil}}}, + {Target: "parameters.ClusterBaseProperties.ScaleSettings.AutoScale", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ClusterBaseProperties.ScaleSettings.AutoScale.MinimumNodeCount", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.ClusterBaseProperties.ScaleSettings.AutoScale.MaximumNodeCount", Name: validation.Null, Rule: true, Chain: nil}, }}, + }}, + {Target: "parameters.ClusterBaseProperties.VirtualMachineConfiguration", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ClusterBaseProperties.VirtualMachineConfiguration.ImageReference", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ClusterBaseProperties.VirtualMachineConfiguration.ImageReference.Publisher", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.ClusterBaseProperties.VirtualMachineConfiguration.ImageReference.Offer", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.ClusterBaseProperties.VirtualMachineConfiguration.ImageReference.Sku", Name: validation.Null, Rule: true, Chain: nil}, }}, - {Target: "parameters.ClusterBaseProperties.NodeSetup", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.ClusterBaseProperties.NodeSetup.SetupTask", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.ClusterBaseProperties.NodeSetup.SetupTask.CommandLine", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.ClusterBaseProperties.NodeSetup.SetupTask.StdOutErrPathPrefix", Name: validation.Null, Rule: true, Chain: nil}, - }}, - {Target: "parameters.ClusterBaseProperties.NodeSetup.PerformanceCountersSettings", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.ClusterBaseProperties.NodeSetup.PerformanceCountersSettings.AppInsightsReference", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.ClusterBaseProperties.NodeSetup.PerformanceCountersSettings.AppInsightsReference.Component", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.ClusterBaseProperties.NodeSetup.PerformanceCountersSettings.AppInsightsReference.Component.ID", Name: validation.Null, Rule: true, Chain: nil}}}, - {Target: "parameters.ClusterBaseProperties.NodeSetup.PerformanceCountersSettings.AppInsightsReference.InstrumentationKeySecretReference", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.ClusterBaseProperties.NodeSetup.PerformanceCountersSettings.AppInsightsReference.InstrumentationKeySecretReference.SourceVault", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.ClusterBaseProperties.NodeSetup.PerformanceCountersSettings.AppInsightsReference.InstrumentationKeySecretReference.SourceVault.ID", Name: validation.Null, Rule: true, Chain: nil}}}, - {Target: "parameters.ClusterBaseProperties.NodeSetup.PerformanceCountersSettings.AppInsightsReference.InstrumentationKeySecretReference.SecretURL", Name: validation.Null, Rule: true, Chain: nil}, - }}, - }}, + }}, + {Target: "parameters.ClusterBaseProperties.NodeSetup", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ClusterBaseProperties.NodeSetup.SetupTask", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ClusterBaseProperties.NodeSetup.SetupTask.CommandLine", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.ClusterBaseProperties.NodeSetup.SetupTask.StdOutErrPathPrefix", Name: validation.Null, Rule: true, Chain: nil}, + }}, + {Target: "parameters.ClusterBaseProperties.NodeSetup.PerformanceCountersSettings", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ClusterBaseProperties.NodeSetup.PerformanceCountersSettings.AppInsightsReference", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.ClusterBaseProperties.NodeSetup.PerformanceCountersSettings.AppInsightsReference.Component", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.ClusterBaseProperties.NodeSetup.PerformanceCountersSettings.AppInsightsReference.Component.ID", Name: validation.Null, Rule: true, Chain: nil}}}, + {Target: "parameters.ClusterBaseProperties.NodeSetup.PerformanceCountersSettings.AppInsightsReference.InstrumentationKeySecretReference", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ClusterBaseProperties.NodeSetup.PerformanceCountersSettings.AppInsightsReference.InstrumentationKeySecretReference.SourceVault", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.ClusterBaseProperties.NodeSetup.PerformanceCountersSettings.AppInsightsReference.InstrumentationKeySecretReference.SourceVault.ID", Name: validation.Null, Rule: true, Chain: nil}}}, + {Target: "parameters.ClusterBaseProperties.NodeSetup.PerformanceCountersSettings.AppInsightsReference.InstrumentationKeySecretReference.SecretURL", Name: validation.Null, Rule: true, Chain: nil}, + }}, }}, - }}, - {Target: "parameters.ClusterBaseProperties.UserAccountSettings", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.ClusterBaseProperties.UserAccountSettings.AdminUserName", Name: validation.Null, Rule: true, Chain: nil}}}, - {Target: "parameters.ClusterBaseProperties.Subnet", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.ClusterBaseProperties.Subnet.ID", Name: validation.Null, Rule: true, Chain: nil}}}, - }}}}}); err != nil { + }}, + }}, + {Target: "parameters.ClusterBaseProperties.UserAccountSettings", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.ClusterBaseProperties.UserAccountSettings.AdminUserName", Name: validation.Null, Rule: true, Chain: nil}}}, + {Target: "parameters.ClusterBaseProperties.Subnet", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ClusterBaseProperties.Subnet.ID", Name: validation.Null, Rule: true, Chain: nil}}}, + }}}}}); err != nil { return result, validation.NewError("batchai.ClustersClient", "Create", err.Error()) } @@ -349,222 +348,6 @@ func (client ClustersClient) GetResponder(resp *http.Response) (result Cluster, return } -// List gets a list of Clusters associated with the given subscription. -// Parameters: -// maxResults - the maximum number of items to return in the response. A maximum of 1000 files can be returned. -func (client ClustersClient) List(ctx context.Context, maxResults *int32) (result ClusterListResultPage, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: maxResults, - Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, - {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("batchai.ClustersClient", "List", err.Error()) - } - - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, maxResults) - if err != nil { - err = autorest.NewErrorWithError(err, "batchai.ClustersClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.clr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batchai.ClustersClient", "List", resp, "Failure sending request") - return - } - - result.clr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batchai.ClustersClient", "List", resp, "Failure responding to request") - } - - return -} - -// ListPreparer prepares the List request. -func (client ClustersClient) ListPreparer(ctx context.Context, maxResults *int32) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if maxResults != nil { - queryParameters["maxresults"] = autorest.Encode("query", *maxResults) - } else { - queryParameters["maxresults"] = autorest.Encode("query", 1000) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.BatchAI/clusters", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client ClustersClient) ListSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client ClustersClient) ListResponder(resp *http.Response) (result ClusterListResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client ClustersClient) listNextResults(lastResults ClusterListResult) (result ClusterListResult, err error) { - req, err := lastResults.clusterListResultPreparer() - if err != nil { - return result, autorest.NewErrorWithError(err, "batchai.ClustersClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "batchai.ClustersClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batchai.ClustersClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client ClustersClient) ListComplete(ctx context.Context, maxResults *int32) (result ClusterListResultIterator, err error) { - result.page, err = client.List(ctx, maxResults) - return -} - -// ListByResourceGroup gets a list of Clusters within the specified resource group. -// Parameters: -// resourceGroupName - name of the resource group to which the resource belongs. -// maxResults - the maximum number of items to return in the response. A maximum of 1000 files can be returned. -func (client ClustersClient) ListByResourceGroup(ctx context.Context, resourceGroupName string, maxResults *int32) (result ClusterListResultPage, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, - {TargetValue: maxResults, - Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, - {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("batchai.ClustersClient", "ListByResourceGroup", err.Error()) - } - - result.fn = client.listByResourceGroupNextResults - req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName, maxResults) - if err != nil { - err = autorest.NewErrorWithError(err, "batchai.ClustersClient", "ListByResourceGroup", nil, "Failure preparing request") - return - } - - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.clr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batchai.ClustersClient", "ListByResourceGroup", resp, "Failure sending request") - return - } - - result.clr, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batchai.ClustersClient", "ListByResourceGroup", resp, "Failure responding to request") - } - - return -} - -// ListByResourceGroupPreparer prepares the ListByResourceGroup request. -func (client ClustersClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string, maxResults *int32) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if maxResults != nil { - queryParameters["maxresults"] = autorest.Encode("query", *maxResults) - } else { - queryParameters["maxresults"] = autorest.Encode("query", 1000) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BatchAI/clusters", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the -// http.Response Body if it receives an error. -func (client ClustersClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - azure.DoRetryWithRegistration(client.Client)) -} - -// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always -// closes the http.Response Body. -func (client ClustersClient) ListByResourceGroupResponder(resp *http.Response) (result ClusterListResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByResourceGroupNextResults retrieves the next set of results, if any. -func (client ClustersClient) listByResourceGroupNextResults(lastResults ClusterListResult) (result ClusterListResult, err error) { - req, err := lastResults.clusterListResultPreparer() - if err != nil { - return result, autorest.NewErrorWithError(err, "batchai.ClustersClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "batchai.ClustersClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batchai.ClustersClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. -func (client ClustersClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string, maxResults *int32) (result ClusterListResultIterator, err error) { - result.page, err = client.ListByResourceGroup(ctx, resourceGroupName, maxResults) - return -} - // ListByWorkspace gets information about Clusters associated with the given Workspace. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. @@ -581,7 +364,7 @@ func (client ClustersClient) ListByWorkspace(ctx context.Context, resourceGroupN {Target: "workspaceName", Name: validation.Pattern, Rule: `^[-\w_]+$`, Chain: nil}}}, {TargetValue: maxResults, Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, + Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: int64(1000), Chain: nil}, {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("batchai.ClustersClient", "ListByWorkspace", err.Error()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/batchai/mgmt/2018-05-01/batchai/experiments.go b/vendor/github.com/Azure/azure-sdk-for-go/services/batchai/mgmt/2018-05-01/batchai/experiments.go index 6e0d9db41..213d4181f 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/batchai/mgmt/2018-05-01/batchai/experiments.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/batchai/mgmt/2018-05-01/batchai/experiments.go @@ -318,7 +318,7 @@ func (client ExperimentsClient) ListByWorkspace(ctx context.Context, resourceGro {Target: "workspaceName", Name: validation.Pattern, Rule: `^[-\w_]+$`, Chain: nil}}}, {TargetValue: maxResults, Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, + Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: int64(1000), Chain: nil}, {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("batchai.ExperimentsClient", "ListByWorkspace", err.Error()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/batchai/mgmt/2018-05-01/batchai/fileservers.go b/vendor/github.com/Azure/azure-sdk-for-go/services/batchai/mgmt/2018-05-01/batchai/fileservers.go index acd98cab8..cf94272a6 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/batchai/mgmt/2018-05-01/batchai/fileservers.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/batchai/mgmt/2018-05-01/batchai/fileservers.go @@ -62,20 +62,19 @@ func (client FileServersClient) Create(ctx context.Context, resourceGroupName st {Target: "fileServerName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "fileServerName", Name: validation.Pattern, Rule: `^[-\w_]+$`, Chain: nil}}}, {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.Location", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.FileServerBaseProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.FileServerBaseProperties.VMSize", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.FileServerBaseProperties.SSHConfiguration", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.FileServerBaseProperties.SSHConfiguration.UserAccountSettings", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.FileServerBaseProperties.SSHConfiguration.UserAccountSettings.AdminUserName", Name: validation.Null, Rule: true, Chain: nil}}}, - }}, - {Target: "parameters.FileServerBaseProperties.DataDisks", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.FileServerBaseProperties.DataDisks.DiskSizeInGB", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.FileServerBaseProperties.DataDisks.DiskCount", Name: validation.Null, Rule: true, Chain: nil}, - }}, - {Target: "parameters.FileServerBaseProperties.Subnet", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.FileServerBaseProperties.Subnet.ID", Name: validation.Null, Rule: true, Chain: nil}}}, - }}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "parameters.FileServerBaseProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.FileServerBaseProperties.VMSize", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.FileServerBaseProperties.SSHConfiguration", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.FileServerBaseProperties.SSHConfiguration.UserAccountSettings", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.FileServerBaseProperties.SSHConfiguration.UserAccountSettings.AdminUserName", Name: validation.Null, Rule: true, Chain: nil}}}, + }}, + {Target: "parameters.FileServerBaseProperties.DataDisks", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.FileServerBaseProperties.DataDisks.DiskSizeInGB", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.FileServerBaseProperties.DataDisks.DiskCount", Name: validation.Null, Rule: true, Chain: nil}, + }}, + {Target: "parameters.FileServerBaseProperties.Subnet", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.FileServerBaseProperties.Subnet.ID", Name: validation.Null, Rule: true, Chain: nil}}}, + }}}}}); err != nil { return result, validation.NewError("batchai.FileServersClient", "Create", err.Error()) } @@ -323,222 +322,6 @@ func (client FileServersClient) GetResponder(resp *http.Response) (result FileSe return } -// List gets a list of File Servers associated with the given subscription. -// Parameters: -// maxResults - the maximum number of items to return in the response. A maximum of 1000 files can be returned. -func (client FileServersClient) List(ctx context.Context, maxResults *int32) (result FileServerListResultPage, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: maxResults, - Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, - {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("batchai.FileServersClient", "List", err.Error()) - } - - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, maxResults) - if err != nil { - err = autorest.NewErrorWithError(err, "batchai.FileServersClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.fslr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batchai.FileServersClient", "List", resp, "Failure sending request") - return - } - - result.fslr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batchai.FileServersClient", "List", resp, "Failure responding to request") - } - - return -} - -// ListPreparer prepares the List request. -func (client FileServersClient) ListPreparer(ctx context.Context, maxResults *int32) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if maxResults != nil { - queryParameters["maxresults"] = autorest.Encode("query", *maxResults) - } else { - queryParameters["maxresults"] = autorest.Encode("query", 1000) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.BatchAI/fileServers", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client FileServersClient) ListSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client FileServersClient) ListResponder(resp *http.Response) (result FileServerListResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client FileServersClient) listNextResults(lastResults FileServerListResult) (result FileServerListResult, err error) { - req, err := lastResults.fileServerListResultPreparer() - if err != nil { - return result, autorest.NewErrorWithError(err, "batchai.FileServersClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "batchai.FileServersClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batchai.FileServersClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client FileServersClient) ListComplete(ctx context.Context, maxResults *int32) (result FileServerListResultIterator, err error) { - result.page, err = client.List(ctx, maxResults) - return -} - -// ListByResourceGroup gets a list of File Servers within the specified resource group. -// Parameters: -// resourceGroupName - name of the resource group to which the resource belongs. -// maxResults - the maximum number of items to return in the response. A maximum of 1000 files can be returned. -func (client FileServersClient) ListByResourceGroup(ctx context.Context, resourceGroupName string, maxResults *int32) (result FileServerListResultPage, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, - {TargetValue: maxResults, - Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, - {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("batchai.FileServersClient", "ListByResourceGroup", err.Error()) - } - - result.fn = client.listByResourceGroupNextResults - req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName, maxResults) - if err != nil { - err = autorest.NewErrorWithError(err, "batchai.FileServersClient", "ListByResourceGroup", nil, "Failure preparing request") - return - } - - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.fslr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "batchai.FileServersClient", "ListByResourceGroup", resp, "Failure sending request") - return - } - - result.fslr, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batchai.FileServersClient", "ListByResourceGroup", resp, "Failure responding to request") - } - - return -} - -// ListByResourceGroupPreparer prepares the ListByResourceGroup request. -func (client FileServersClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string, maxResults *int32) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if maxResults != nil { - queryParameters["maxresults"] = autorest.Encode("query", *maxResults) - } else { - queryParameters["maxresults"] = autorest.Encode("query", 1000) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BatchAI/fileServers", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the -// http.Response Body if it receives an error. -func (client FileServersClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - azure.DoRetryWithRegistration(client.Client)) -} - -// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always -// closes the http.Response Body. -func (client FileServersClient) ListByResourceGroupResponder(resp *http.Response) (result FileServerListResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByResourceGroupNextResults retrieves the next set of results, if any. -func (client FileServersClient) listByResourceGroupNextResults(lastResults FileServerListResult) (result FileServerListResult, err error) { - req, err := lastResults.fileServerListResultPreparer() - if err != nil { - return result, autorest.NewErrorWithError(err, "batchai.FileServersClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "batchai.FileServersClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "batchai.FileServersClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. -func (client FileServersClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string, maxResults *int32) (result FileServerListResultIterator, err error) { - result.page, err = client.ListByResourceGroup(ctx, resourceGroupName, maxResults) - return -} - // ListByWorkspace gets a list of File Servers associated with the specified workspace. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. @@ -555,7 +338,7 @@ func (client FileServersClient) ListByWorkspace(ctx context.Context, resourceGro {Target: "workspaceName", Name: validation.Pattern, Rule: `^[-\w_]+$`, Chain: nil}}}, {TargetValue: maxResults, Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, + Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: int64(1000), Chain: nil}, {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("batchai.FileServersClient", "ListByWorkspace", err.Error()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/batchai/mgmt/2018-05-01/batchai/jobs.go b/vendor/github.com/Azure/azure-sdk-for-go/services/batchai/mgmt/2018-05-01/batchai/jobs.go index f45f79669..3a576acae 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/batchai/mgmt/2018-05-01/batchai/jobs.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/batchai/mgmt/2018-05-01/batchai/jobs.go @@ -385,7 +385,7 @@ func (client JobsClient) ListByExperiment(ctx context.Context, resourceGroupName {Target: "experimentName", Name: validation.Pattern, Rule: `^[-\w_]+$`, Chain: nil}}}, {TargetValue: maxResults, Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, + Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: int64(1000), Chain: nil}, {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("batchai.JobsClient", "ListByExperiment", err.Error()) @@ -521,12 +521,12 @@ func (client JobsClient) ListOutputFiles(ctx context.Context, resourceGroupName {Target: "jobName", Name: validation.Pattern, Rule: `^[-\w_]+$`, Chain: nil}}}, {TargetValue: linkexpiryinminutes, Constraints: []validation.Constraint{{Target: "linkexpiryinminutes", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "linkexpiryinminutes", Name: validation.InclusiveMaximum, Rule: 600, Chain: nil}, + Chain: []validation.Constraint{{Target: "linkexpiryinminutes", Name: validation.InclusiveMaximum, Rule: int64(600), Chain: nil}, {Target: "linkexpiryinminutes", Name: validation.InclusiveMinimum, Rule: 5, Chain: nil}, }}}}, {TargetValue: maxResults, Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, + Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: int64(1000), Chain: nil}, {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("batchai.JobsClient", "ListOutputFiles", err.Error()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/batchai/mgmt/2018-05-01/batchai/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/batchai/mgmt/2018-05-01/batchai/models.go index 92dc799ef..f5193419d 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/batchai/mgmt/2018-05-01/batchai/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/batchai/mgmt/2018-05-01/batchai/models.go @@ -197,17 +197,17 @@ const ( Cntk ToolType = "cntk" // Custom ... Custom ToolType = "custom" + // Custommpi ... + Custommpi ToolType = "custommpi" // Horovod ... Horovod ToolType = "horovod" - // Mpi ... - Mpi ToolType = "mpi" // Tensorflow ... Tensorflow ToolType = "tensorflow" ) // PossibleToolTypeValues returns an array of possible values for the ToolType const type. func PossibleToolTypeValues() []ToolType { - return []ToolType{Caffe, Caffe2, Chainer, Cntk, Custom, Horovod, Mpi, Tensorflow} + return []ToolType{Caffe, Caffe2, Chainer, Cntk, Custom, Custommpi, Horovod, Tensorflow} } // UsageUnit enumerates the values for usage unit. @@ -238,80 +238,99 @@ func PossibleVMPriorityValues() []VMPriority { return []VMPriority{Dedicated, Lowpriority} } -// AppInsightsReference specifies Azure Application Insights information for performance counters reporting. +// AppInsightsReference azure Application Insights information for performance counters reporting. type AppInsightsReference struct { - Component *ResourceID `json:"component,omitempty"` - InstrumentationKey *string `json:"instrumentationKey,omitempty"` - // InstrumentationKeySecretReference - Specifies KeyVault Store and Secret which contains Azure Application Insights instrumentation key. One of instumentationKey or instrumentationKeySecretReference must be specified. + // Component - Azure Application Insights component resource ID. + Component *ResourceID `json:"component,omitempty"` + // InstrumentationKey - Value of the Azure Application Insights instrumentation key. + InstrumentationKey *string `json:"instrumentationKey,omitempty"` + // InstrumentationKeySecretReference - KeyVault Store and Secret which contains Azure Application Insights instrumentation key. One of instrumentationKey or instrumentationKeySecretReference must be specified. InstrumentationKeySecretReference *KeyVaultSecretReference `json:"instrumentationKeySecretReference,omitempty"` } -// AutoScaleSettings the system automatically scales the cluster up and down (within minimumNodeCount and -// maximumNodeCount) based on the pending and running jobs on the cluster. +// AutoScaleSettings auto-scale settings for the cluster. The system automatically scales the cluster up and down +// (within minimumNodeCount and maximumNodeCount) based on the number of queued and running jobs assigned to the +// cluster. type AutoScaleSettings struct { + // MinimumNodeCount - The minimum number of compute nodes the Batch AI service will try to allocate for the cluster. Note, the actual number of nodes can be less than the specified value if the subscription has not enough quota to fulfill the request. MinimumNodeCount *int32 `json:"minimumNodeCount,omitempty"` + // MaximumNodeCount - The maximum number of compute nodes the cluster can have. MaximumNodeCount *int32 `json:"maximumNodeCount,omitempty"` + // InitialNodeCount - The number of compute nodes to allocate on cluster creation. Note that this value is used only during cluster creation. Default: 0. InitialNodeCount *int32 `json:"initialNodeCount,omitempty"` } -// AzureBlobFileSystemReference provides required information, for the service to be able to mount Azure Blob -// Storage container on the cluster nodes. +// AzureBlobFileSystemReference azure Blob Storage Container mounting configuration. type AzureBlobFileSystemReference struct { - AccountName *string `json:"accountName,omitempty"` - ContainerName *string `json:"containerName,omitempty"` - Credentials *AzureStorageCredentialsInfo `json:"credentials,omitempty"` - // RelativeMountPath - Note that all cluster level blob file systems will be mounted under $AZ_BATCHAI_MOUNT_ROOT location and all job level blob file systems will be mounted under $AZ_BATCHAI_JOB_MOUNT_ROOT. + // AccountName - Name of the Azure storage account. + AccountName *string `json:"accountName,omitempty"` + // ContainerName - Name of the Azure Blob Storage container to mount on the cluster. + ContainerName *string `json:"containerName,omitempty"` + // Credentials - Information about the Azure storage credentials. + Credentials *AzureStorageCredentialsInfo `json:"credentials,omitempty"` + // RelativeMountPath - The relative path on the compute node where the Azure File container will be mounted. Note that all cluster level containers will be mounted under $AZ_BATCHAI_MOUNT_ROOT location and all job level containers will be mounted under $AZ_BATCHAI_JOB_MOUNT_ROOT. RelativeMountPath *string `json:"relativeMountPath,omitempty"` - MountOptions *string `json:"mountOptions,omitempty"` + // MountOptions - Mount options for mounting blobfuse file system. + MountOptions *string `json:"mountOptions,omitempty"` } -// AzureFileShareReference details of the Azure File Share to mount on the cluster. +// AzureFileShareReference azure File Share mounting configuration. type AzureFileShareReference struct { - AccountName *string `json:"accountName,omitempty"` - AzureFileURL *string `json:"azureFileUrl,omitempty"` - Credentials *AzureStorageCredentialsInfo `json:"credentials,omitempty"` - // RelativeMountPath - Note that all cluster level file shares will be mounted under $AZ_BATCHAI_MOUNT_ROOT location and all job level file shares will be mounted under $AZ_BATCHAI_JOB_MOUNT_ROOT. + // AccountName - Name of the Azure storage account. + AccountName *string `json:"accountName,omitempty"` + // AzureFileURL - URL to access the Azure File. + AzureFileURL *string `json:"azureFileUrl,omitempty"` + // Credentials - Information about the Azure storage credentials. + Credentials *AzureStorageCredentialsInfo `json:"credentials,omitempty"` + // RelativeMountPath - The relative path on the compute node where the Azure File share will be mounted. Note that all cluster level file shares will be mounted under $AZ_BATCHAI_MOUNT_ROOT location and all job level file shares will be mounted under $AZ_BATCHAI_JOB_MOUNT_ROOT. RelativeMountPath *string `json:"relativeMountPath,omitempty"` - // FileMode - Default value is 0777. Valid only if OS is linux. + // FileMode - File mode for files on the mounted file share. Default value: 0777. FileMode *string `json:"fileMode,omitempty"` - // DirectoryMode - Default value is 0777. Valid only if OS is linux. + // DirectoryMode - File mode for directories on the mounted file share. Default value: 0777. DirectoryMode *string `json:"directoryMode,omitempty"` } -// AzureStorageCredentialsInfo credentials to access Azure File Share. +// AzureStorageCredentialsInfo azure storage account credentials. type AzureStorageCredentialsInfo struct { - // AccountKey - One of accountKey or accountKeySecretReference must be specified. + // AccountKey - Storage account key. One of accountKey or accountKeySecretReference must be specified. AccountKey *string `json:"accountKey,omitempty"` - // AccountKeySecretReference - Users can store their secrets in Azure KeyVault and pass it to the Batch AI Service to integrate with KeyVault. One of accountKey or accountKeySecretReference must be specified. + // AccountKeySecretReference - Information about KeyVault secret storing the storage account key. One of accountKey or accountKeySecretReference must be specified. AccountKeySecretReference *KeyVaultSecretReference `json:"accountKeySecretReference,omitempty"` } -// Caffe2Settings specifies the settings for Caffe2 job. +// Caffe2Settings caffe2 job settings. type Caffe2Settings struct { - PythonScriptFilePath *string `json:"pythonScriptFilePath,omitempty"` + // PythonScriptFilePath - The python script to execute. + PythonScriptFilePath *string `json:"pythonScriptFilePath,omitempty"` + // PythonInterpreterPath - The path to the Python interpreter. PythonInterpreterPath *string `json:"pythonInterpreterPath,omitempty"` - CommandLineArgs *string `json:"commandLineArgs,omitempty"` + // CommandLineArgs - Command line arguments that need to be passed to the python script. + CommandLineArgs *string `json:"commandLineArgs,omitempty"` } -// CaffeSettings specifies the settings for Caffe job. +// CaffeSettings caffe job settings. type CaffeSettings struct { - // ConfigFilePath - This property cannot be specified if pythonScriptFilePath is specified. + // ConfigFilePath - Path of the config file for the job. This property cannot be specified if pythonScriptFilePath is specified. ConfigFilePath *string `json:"configFilePath,omitempty"` - // PythonScriptFilePath - This property cannot be specified if configFilePath is specified. + // PythonScriptFilePath - Python script to execute. This property cannot be specified if configFilePath is specified. PythonScriptFilePath *string `json:"pythonScriptFilePath,omitempty"` - // PythonInterpreterPath - This property can be specified only if the pythonScriptFilePath is specified. + // PythonInterpreterPath - The path to the Python interpreter. The property can be specified only if the pythonScriptFilePath is specified. PythonInterpreterPath *string `json:"pythonInterpreterPath,omitempty"` - CommandLineArgs *string `json:"commandLineArgs,omitempty"` - // ProcessCount - The default value for this property is equal to nodeCount property + // CommandLineArgs - Command line arguments that need to be passed to the Caffe job. + CommandLineArgs *string `json:"commandLineArgs,omitempty"` + // ProcessCount - Number of processes to launch for the job execution. The default value for this property is equal to nodeCount property ProcessCount *int32 `json:"processCount,omitempty"` } -// ChainerSettings specifies the settings for Chainer job. +// ChainerSettings chainer job settings. type ChainerSettings struct { - PythonScriptFilePath *string `json:"pythonScriptFilePath,omitempty"` + // PythonScriptFilePath - The python script to execute. + PythonScriptFilePath *string `json:"pythonScriptFilePath,omitempty"` + // PythonInterpreterPath - The path to the Python interpreter. PythonInterpreterPath *string `json:"pythonInterpreterPath,omitempty"` - CommandLineArgs *string `json:"commandLineArgs,omitempty"` - // ProcessCount - The default value for this property is equal to nodeCount property + // CommandLineArgs - Command line arguments that need to be passed to the python script. + CommandLineArgs *string `json:"commandLineArgs,omitempty"` + // ProcessCount - Number of processes to launch for the job execution. The default value for this property is equal to nodeCount property ProcessCount *int32 `json:"processCount,omitempty"` } @@ -333,21 +352,17 @@ type CloudErrorBody struct { Details *[]CloudErrorBody `json:"details,omitempty"` } -// Cluster contains information about a Cluster. +// Cluster information about a Cluster. type Cluster struct { autorest.Response `json:"-"` // ClusterProperties - The properties associated with the Cluster. *ClusterProperties `json:"properties,omitempty"` - // ID - The ID of the resource + // ID - The ID of the resource. ID *string `json:"id,omitempty"` - // Name - The name of the resource + // Name - The name of the resource. Name *string `json:"name,omitempty"` - // Type - The type of the resource + // Type - The type of the resource. Type *string `json:"type,omitempty"` - // Location - The location of the resource - Location *string `json:"location,omitempty"` - // Tags - The tags of the resource - Tags map[string]*string `json:"tags"` } // MarshalJSON is the custom marshaler for Cluster. @@ -365,12 +380,6 @@ func (c Cluster) MarshalJSON() ([]byte, error) { if c.Type != nil { objectMap["type"] = c.Type } - if c.Location != nil { - objectMap["location"] = c.Location - } - if c.Tags != nil { - objectMap["tags"] = c.Tags - } return json.Marshal(objectMap) } @@ -419,24 +428,6 @@ func (c *Cluster) UnmarshalJSON(body []byte) error { } c.Type = &typeVar } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - c.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - c.Tags = tags - } } } @@ -445,23 +436,24 @@ func (c *Cluster) UnmarshalJSON(body []byte) error { // ClusterBaseProperties the properties of a Cluster. type ClusterBaseProperties struct { - // VMSize - All virtual machines in a cluster are the same size. For information about available VM sizes for clusters using images from the Virtual Machines Marketplace (see Sizes for Virtual Machines (Linux) or Sizes for Virtual Machines (Windows). Batch AI service supports all Azure VM sizes except STANDARD_A0 and those with premium storage (STANDARD_GS, STANDARD_DS, and STANDARD_DSV2 series). + // VMSize - The size of the virtual machines in the cluster. All nodes in a cluster have the same VM size. For information about available VM sizes for clusters using images from the Virtual Machines Marketplace see Sizes for Virtual Machines (Linux). Batch AI service supports all Azure VM sizes except STANDARD_A0 and those with premium storage (STANDARD_GS, STANDARD_DS, and STANDARD_DSV2 series). VMSize *string `json:"vmSize,omitempty"` - // VMPriority - Default is dedicated. Possible values include: 'Dedicated', 'Lowpriority' - VMPriority VMPriority `json:"vmPriority,omitempty"` - ScaleSettings *ScaleSettings `json:"scaleSettings,omitempty"` + // VMPriority - VM priority. Allowed values are: dedicated (default) and lowpriority. Possible values include: 'Dedicated', 'Lowpriority' + VMPriority VMPriority `json:"vmPriority,omitempty"` + // ScaleSettings - Scale settings for the cluster. Batch AI service supports manual and auto scale clusters. + ScaleSettings *ScaleSettings `json:"scaleSettings,omitempty"` + // VirtualMachineConfiguration - OS image configuration for cluster nodes. All nodes in a cluster have the same OS image. VirtualMachineConfiguration *VirtualMachineConfiguration `json:"virtualMachineConfiguration,omitempty"` - NodeSetup *NodeSetup `json:"nodeSetup,omitempty"` - UserAccountSettings *UserAccountSettings `json:"userAccountSettings,omitempty"` - Subnet *ResourceID `json:"subnet,omitempty"` + // NodeSetup - Setup to be performed on each compute node in the cluster. + NodeSetup *NodeSetup `json:"nodeSetup,omitempty"` + // UserAccountSettings - Settings for an administrator user account that will be created on each compute node in the cluster. + UserAccountSettings *UserAccountSettings `json:"userAccountSettings,omitempty"` + // Subnet - Existing virtual network subnet to put the cluster nodes in. Note, if a File Server mount configured in node setup, the File Server's subnet will be used automatically. + Subnet *ResourceID `json:"subnet,omitempty"` } -// ClusterCreateParameters parameters supplied to the Create operation. +// ClusterCreateParameters cluster creation operation. type ClusterCreateParameters struct { - // Location - The region in which to create the cluster. - Location *string `json:"location,omitempty"` - // Tags - The user specified tags associated with the Cluster. - Tags map[string]*string `json:"tags"` // ClusterBaseProperties - The properties of the Cluster. *ClusterBaseProperties `json:"properties,omitempty"` } @@ -469,12 +461,6 @@ type ClusterCreateParameters struct { // MarshalJSON is the custom marshaler for ClusterCreateParameters. func (ccp ClusterCreateParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if ccp.Location != nil { - objectMap["location"] = ccp.Location - } - if ccp.Tags != nil { - objectMap["tags"] = ccp.Tags - } if ccp.ClusterBaseProperties != nil { objectMap["properties"] = ccp.ClusterBaseProperties } @@ -490,24 +476,6 @@ func (ccp *ClusterCreateParameters) UnmarshalJSON(body []byte) error { } for k, v := range m { switch k { - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - ccp.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - ccp.Tags = tags - } case "properties": if v != nil { var clusterBaseProperties ClusterBaseProperties @@ -625,28 +593,38 @@ func (page ClusterListResultPage) Values() []Cluster { return *page.clr.Value } -// ClusterProperties job specific properties. +// ClusterProperties cluster properties. type ClusterProperties struct { - // VMSize - All virtual machines in a cluster are the same size. For information about available VM sizes for clusters using images from the Virtual Machines Marketplace (see Sizes for Virtual Machines (Linux) or Sizes for Virtual Machines (Windows). Batch AI service supports all Azure VM sizes except STANDARD_A0 and those with premium storage (STANDARD_GS, STANDARD_DS, and STANDARD_DSV2 series). + // VMSize - The size of the virtual machines in the cluster. All nodes in a cluster have the same VM size. VMSize *string `json:"vmSize,omitempty"` - // VMPriority - The default value is dedicated. The node can get preempted while the task is running if lowpriority is choosen. This is best suited if the workload is checkpointing and can be restarted. Possible values include: 'Dedicated', 'Lowpriority' - VMPriority VMPriority `json:"vmPriority,omitempty"` - ScaleSettings *ScaleSettings `json:"scaleSettings,omitempty"` + // VMPriority - VM priority of cluster nodes. Possible values include: 'Dedicated', 'Lowpriority' + VMPriority VMPriority `json:"vmPriority,omitempty"` + // ScaleSettings - Scale settings of the cluster. + ScaleSettings *ScaleSettings `json:"scaleSettings,omitempty"` + // VirtualMachineConfiguration - Virtual machine configuration (OS image) of the compute nodes. All nodes in a cluster have the same OS image configuration. VirtualMachineConfiguration *VirtualMachineConfiguration `json:"virtualMachineConfiguration,omitempty"` - NodeSetup *NodeSetup `json:"nodeSetup,omitempty"` - UserAccountSettings *UserAccountSettings `json:"userAccountSettings,omitempty"` - Subnet *ResourceID `json:"subnet,omitempty"` - CreationTime *date.Time `json:"creationTime,omitempty"` - // ProvisioningState - Possible value are: creating - Specifies that the cluster is being created. succeeded - Specifies that the cluster has been created successfully. failed - Specifies that the cluster creation has failed. deleting - Specifies that the cluster is being deleted. Possible values include: 'ProvisioningStateCreating', 'ProvisioningStateSucceeded', 'ProvisioningStateFailed', 'ProvisioningStateDeleting' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - ProvisioningStateTransitionTime *date.Time `json:"provisioningStateTransitionTime,omitempty"` - // AllocationState - Possible values are: steady and resizing. steady state indicates that the cluster is not resizing. There are no changes to the number of compute nodes in the cluster in progress. A cluster enters this state when it is created and when no operations are being performed on the cluster to change the number of compute nodes. resizing state indicates that the cluster is resizing; that is, compute nodes are being added to or removed from the cluster. Possible values include: 'Steady', 'Resizing' - AllocationState AllocationState `json:"allocationState,omitempty"` - AllocationStateTransitionTime *date.Time `json:"allocationStateTransitionTime,omitempty"` - // Errors - This element contains all the errors encountered by various compute nodes during node setup. - Errors *[]Error `json:"errors,omitempty"` - CurrentNodeCount *int32 `json:"currentNodeCount,omitempty"` - NodeStateCounts *NodeStateCounts `json:"nodeStateCounts,omitempty"` + // NodeSetup - Setup (mount file systems, performance counters settings and custom setup task) to be performed on each compute node in the cluster. + NodeSetup *NodeSetup `json:"nodeSetup,omitempty"` + // UserAccountSettings - Administrator user account settings which can be used to SSH to compute nodes. + UserAccountSettings *UserAccountSettings `json:"userAccountSettings,omitempty"` + // Subnet - Virtual network subnet resource ID the cluster nodes belong to. + Subnet *ResourceID `json:"subnet,omitempty"` + // CreationTime - The time when the cluster was created. + CreationTime *date.Time `json:"creationTime,omitempty"` + // ProvisioningState - Provisioning state of the cluster. Possible value are: creating - Specifies that the cluster is being created. succeeded - Specifies that the cluster has been created successfully. failed - Specifies that the cluster creation has failed. deleting - Specifies that the cluster is being deleted. Possible values include: 'ProvisioningStateCreating', 'ProvisioningStateSucceeded', 'ProvisioningStateFailed', 'ProvisioningStateDeleting' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // ProvisioningStateTransitionTime - Time when the provisioning state was changed. + ProvisioningStateTransitionTime *date.Time `json:"provisioningStateTransitionTime,omitempty"` + // AllocationState - Allocation state of the cluster. Possible values are: steady - Indicates that the cluster is not resizing. There are no changes to the number of compute nodes in the cluster in progress. A cluster enters this state when it is created and when no operations are being performed on the cluster to change the number of compute nodes. resizing - Indicates that the cluster is resizing; that is, compute nodes are being added to or removed from the cluster. Possible values include: 'Steady', 'Resizing' + AllocationState AllocationState `json:"allocationState,omitempty"` + // AllocationStateTransitionTime - The time at which the cluster entered its current allocation state. + AllocationStateTransitionTime *date.Time `json:"allocationStateTransitionTime,omitempty"` + // Errors - Collection of errors encountered by various compute nodes during node setup. + Errors *[]Error `json:"errors,omitempty"` + // CurrentNodeCount - The number of compute nodes currently assigned to the cluster. + CurrentNodeCount *int32 `json:"currentNodeCount,omitempty"` + // NodeStateCounts - Counts of various node states on the cluster. + NodeStateCounts *NodeStateCounts `json:"nodeStateCounts,omitempty"` } // ClustersCreateFuture an abstraction for monitoring and retrieving the results of a long-running operation. @@ -699,10 +677,8 @@ func (future *ClustersDeleteFuture) Result(client ClustersClient) (ar autorest.R return } -// ClusterUpdateParameters parameters supplied to the Update operation. +// ClusterUpdateParameters cluster update parameters. type ClusterUpdateParameters struct { - // Tags - The user specified tags associated with the Cluster. - Tags map[string]*string `json:"tags"` // ClusterUpdateProperties - The properties of the Cluster. *ClusterUpdateProperties `json:"properties,omitempty"` } @@ -710,9 +686,6 @@ type ClusterUpdateParameters struct { // MarshalJSON is the custom marshaler for ClusterUpdateParameters. func (cup ClusterUpdateParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if cup.Tags != nil { - objectMap["tags"] = cup.Tags - } if cup.ClusterUpdateProperties != nil { objectMap["properties"] = cup.ClusterUpdateProperties } @@ -728,15 +701,6 @@ func (cup *ClusterUpdateParameters) UnmarshalJSON(body []byte) error { } for k, v := range m { switch k { - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - cup.Tags = tags - } case "properties": if v != nil { var clusterUpdateProperties ClusterUpdateProperties @@ -754,68 +718,81 @@ func (cup *ClusterUpdateParameters) UnmarshalJSON(body []byte) error { // ClusterUpdateProperties the properties of a Cluster that need to be updated. type ClusterUpdateProperties struct { + // ScaleSettings - Desired scale settings for the cluster. Batch AI service supports manual and auto scale clusters. ScaleSettings *ScaleSettings `json:"scaleSettings,omitempty"` } -// CNTKsettings specifies the settings for CNTK (aka Microsoft Cognitive Toolkit) job. +// CNTKsettings CNTK (aka Microsoft Cognitive Toolkit) job settings. type CNTKsettings struct { - // LanguageType - Valid values are 'BrainScript' or 'Python'. + // LanguageType - The language to use for launching CNTK (aka Microsoft Cognitive Toolkit) job. Valid values are 'BrainScript' or 'Python'. LanguageType *string `json:"languageType,omitempty"` - // ConfigFilePath - This property can be specified only if the languageType is 'BrainScript'. + // ConfigFilePath - Specifies the path of the BrainScript config file. This property can be specified only if the languageType is 'BrainScript'. ConfigFilePath *string `json:"configFilePath,omitempty"` - // PythonScriptFilePath - This property can be specified only if the languageType is 'Python'. + // PythonScriptFilePath - Python script to execute. This property can be specified only if the languageType is 'Python'. PythonScriptFilePath *string `json:"pythonScriptFilePath,omitempty"` - // PythonInterpreterPath - This property can be specified only if the languageType is 'Python'. + // PythonInterpreterPath - The path to the Python interpreter. This property can be specified only if the languageType is 'Python'. PythonInterpreterPath *string `json:"pythonInterpreterPath,omitempty"` - CommandLineArgs *string `json:"commandLineArgs,omitempty"` - // ProcessCount - The default value for this property is equal to nodeCount property + // CommandLineArgs - Command line arguments that need to be passed to the python script or cntk executable. + CommandLineArgs *string `json:"commandLineArgs,omitempty"` + // ProcessCount - Number of processes to launch for the job execution. The default value for this property is equal to nodeCount property ProcessCount *int32 `json:"processCount,omitempty"` } -// ContainerSettings settings for the container to be downloaded. +// ContainerSettings docker container settings. type ContainerSettings struct { + // ImageSourceRegistry - Information about docker image and docker registry to download the container from. ImageSourceRegistry *ImageSourceRegistry `json:"imageSourceRegistry,omitempty"` + // ShmSize - Size of /dev/shm. Please refer to docker documentation for supported argument formats. + ShmSize *string `json:"shmSize,omitempty"` } -// CustomMpiSettings specifies the settings for a custom tool kit job. +// CustomMpiSettings custom MPI job settings. type CustomMpiSettings struct { + // CommandLine - The command line to be executed by mpi runtime on each compute node. CommandLine *string `json:"commandLine,omitempty"` - // ProcessCount - The default value for this property is equal to nodeCount property + // ProcessCount - Number of processes to launch for the job execution. The default value for this property is equal to nodeCount property ProcessCount *int32 `json:"processCount,omitempty"` } -// CustomToolkitSettings specifies the settings for a custom tool kit job. +// CustomToolkitSettings custom tool kit job settings. type CustomToolkitSettings struct { + // CommandLine - The command line to execute on the master node. CommandLine *string `json:"commandLine,omitempty"` } -// DataDisks settings for the data disk which would be created for the File Server. +// DataDisks data disks settings. type DataDisks struct { + // DiskSizeInGB - Disk size in GB for the blank data disks. DiskSizeInGB *int32 `json:"diskSizeInGB,omitempty"` - // CachingType - Possible values include: 'None', 'Readonly', 'Readwrite' + // CachingType - Caching type for the disks. Available values are none (default), readonly, readwrite. Caching type can be set only for VM sizes supporting premium storage. Possible values include: 'None', 'Readonly', 'Readwrite' CachingType CachingType `json:"cachingType,omitempty"` - DiskCount *int32 `json:"diskCount,omitempty"` - // StorageAccountType - Possible values include: 'StandardLRS', 'PremiumLRS' + // DiskCount - Number of data disks attached to the File Server. If multiple disks attached, they will be configured in RAID level 0. + DiskCount *int32 `json:"diskCount,omitempty"` + // StorageAccountType - Type of storage account to be used on the disk. Possible values are: Standard_LRS or Premium_LRS. Premium storage account type can only be used with VM sizes supporting premium storage. Possible values include: 'StandardLRS', 'PremiumLRS' StorageAccountType StorageAccountType `json:"storageAccountType,omitempty"` } -// EnvironmentVariable a collection of environment variables to set. +// EnvironmentVariable an environment variable definition. type EnvironmentVariable struct { - Name *string `json:"name,omitempty"` + // Name - The name of the environment variable. + Name *string `json:"name,omitempty"` + // Value - The value of the environment variable. Value *string `json:"value,omitempty"` } -// EnvironmentVariableWithSecretValue a collection of environment variables with secret values to set. +// EnvironmentVariableWithSecretValue an environment variable with secret value definition. type EnvironmentVariableWithSecretValue struct { - Name *string `json:"name,omitempty"` + // Name - The name of the environment variable to store the secret value. + Name *string `json:"name,omitempty"` + // Value - The value of the environment variable. This value will never be reported back by Batch AI. Value *string `json:"value,omitempty"` - // ValueSecretReference - Specifies KeyVault Store and Secret which contains the value for the environment variable. One of value or valueSecretReference must be provided. + // ValueSecretReference - KeyVault store and secret which contains the value for the environment variable. One of value or valueSecretReference must be provided. ValueSecretReference *KeyVaultSecretReference `json:"valueSecretReference,omitempty"` } // Error an error response from the Batch AI service. type Error struct { - // Code - An identifier for the error. Codes are invariant and are intended to be consumed programmatically. + // Code - An identifier of the error. Codes are invariant and are intended to be consumed programmatically. Code *string `json:"code,omitempty"` // Message - A message describing the error, intended to be suitable for display in a user interface. Message *string `json:"message,omitempty"` @@ -823,7 +800,7 @@ type Error struct { Details *[]NameValuePair `json:"details,omitempty"` } -// Experiment contains information about the experiment. +// Experiment experiment information. type Experiment struct { autorest.Response `json:"-"` // ExperimentProperties - The properties associated with the experiment. @@ -1007,8 +984,9 @@ func (page ExperimentListResultPage) Values() []Experiment { return *page.elr.Value } -// ExperimentProperties experiment specific properties. +// ExperimentProperties experiment properties. type ExperimentProperties struct { + // CreationTime - Time when the Experiment was created. CreationTime *date.Time `json:"creationTime,omitempty"` // ProvisioningState - The provisioned state of the experiment. Possible values include: 'ProvisioningStateCreating', 'ProvisioningStateSucceeded', 'ProvisioningStateFailed', 'ProvisioningStateDeleting' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` @@ -1070,9 +1048,10 @@ func (future *ExperimentsDeleteFuture) Result(client ExperimentsClient) (ar auto type File struct { // Name - Name of the file. Name *string `json:"name,omitempty"` - // FileType - Contains information about file type. Possible values include: 'FileTypeFile', 'FileTypeDirectory' - FileType FileType `json:"fileType,omitempty"` - DownloadURL *string `json:"downloadUrl,omitempty"` + // FileType - Type of the file. Possible values are file and directory. Possible values include: 'FileTypeFile', 'FileTypeDirectory' + FileType FileType `json:"fileType,omitempty"` + // DownloadURL - URL to download the corresponding file. The downloadUrl is not returned for directories. + DownloadURL *string `json:"downloadUrl,omitempty"` // FileProperties - The properties associated with the file. The properties are not returned for directories. *FileProperties `json:"properties,omitempty"` } @@ -1248,29 +1227,25 @@ func (page FileListResultPage) Values() []File { return *page.flr.Value } -// FileProperties file specific properties. +// FileProperties file properties. type FileProperties struct { // LastModified - The time at which the file was last modified. LastModified *date.Time `json:"lastModified,omitempty"` - // ContentLength - The file size. + // ContentLength - The file of the size. ContentLength *int64 `json:"contentLength,omitempty"` } -// FileServer contains information about the File Server. +// FileServer file Server information. type FileServer struct { autorest.Response `json:"-"` - // FileServerProperties - The properties associated with the File Server. + // FileServerProperties - File Server properties. *FileServerProperties `json:"properties,omitempty"` - // ID - The ID of the resource + // ID - The ID of the resource. ID *string `json:"id,omitempty"` - // Name - The name of the resource + // Name - The name of the resource. Name *string `json:"name,omitempty"` - // Type - The type of the resource + // Type - The type of the resource. Type *string `json:"type,omitempty"` - // Location - The location of the resource - Location *string `json:"location,omitempty"` - // Tags - The tags of the resource - Tags map[string]*string `json:"tags"` } // MarshalJSON is the custom marshaler for FileServer. @@ -1288,12 +1263,6 @@ func (fs FileServer) MarshalJSON() ([]byte, error) { if fs.Type != nil { objectMap["type"] = fs.Type } - if fs.Location != nil { - objectMap["location"] = fs.Location - } - if fs.Tags != nil { - objectMap["tags"] = fs.Tags - } return json.Marshal(objectMap) } @@ -1342,24 +1311,6 @@ func (fs *FileServer) UnmarshalJSON(body []byte) error { } fs.Type = &typeVar } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - fs.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - fs.Tags = tags - } } } @@ -1368,19 +1319,18 @@ func (fs *FileServer) UnmarshalJSON(body []byte) error { // FileServerBaseProperties the properties of a file server. type FileServerBaseProperties struct { - // VMSize - For information about available VM sizes for fileservers from the Virtual Machines Marketplace, see Sizes for Virtual Machines (Linux). - VMSize *string `json:"vmSize,omitempty"` + // VMSize - The size of the virtual machine for the File Server. For information about available VM sizes from the Virtual Machines Marketplace, see Sizes for Virtual Machines (Linux). + VMSize *string `json:"vmSize,omitempty"` + // SSHConfiguration - SSH configuration for the File Server node. SSHConfiguration *SSHConfiguration `json:"sshConfiguration,omitempty"` - DataDisks *DataDisks `json:"dataDisks,omitempty"` - Subnet *ResourceID `json:"subnet,omitempty"` + // DataDisks - Settings for the data disks which will be created for the File Server. + DataDisks *DataDisks `json:"dataDisks,omitempty"` + // Subnet - Identifier of an existing virtual network subnet to put the File Server in. If not provided, a new virtual network and subnet will be created. + Subnet *ResourceID `json:"subnet,omitempty"` } -// FileServerCreateParameters parameters supplied to the Create operation. +// FileServerCreateParameters file Server creation parameters. type FileServerCreateParameters struct { - // Location - The region in which to create the File Server. - Location *string `json:"location,omitempty"` - // Tags - The user specified tags associated with the File Server. - Tags map[string]*string `json:"tags"` // FileServerBaseProperties - The properties of the File Server. *FileServerBaseProperties `json:"properties,omitempty"` } @@ -1388,12 +1338,6 @@ type FileServerCreateParameters struct { // MarshalJSON is the custom marshaler for FileServerCreateParameters. func (fscp FileServerCreateParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if fscp.Location != nil { - objectMap["location"] = fscp.Location - } - if fscp.Tags != nil { - objectMap["tags"] = fscp.Tags - } if fscp.FileServerBaseProperties != nil { objectMap["properties"] = fscp.FileServerBaseProperties } @@ -1409,24 +1353,6 @@ func (fscp *FileServerCreateParameters) UnmarshalJSON(body []byte) error { } for k, v := range m { switch k { - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - fscp.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - fscp.Tags = tags - } case "properties": if v != nil { var fileServerBaseProperties FileServerBaseProperties @@ -1442,7 +1368,7 @@ func (fscp *FileServerCreateParameters) UnmarshalJSON(body []byte) error { return nil } -// FileServerListResult values returned by the List operation. +// FileServerListResult values returned by the File Server List operation. type FileServerListResult struct { autorest.Response `json:"-"` // Value - The collection of File Servers. @@ -1544,29 +1470,36 @@ func (page FileServerListResultPage) Values() []FileServer { return *page.fslr.Value } -// FileServerProperties file server specific properties. +// FileServerProperties file Server properties. type FileServerProperties struct { - // VMSize - For information about available VM sizes for File Server from the Virtual Machines Marketplace, see Sizes for Virtual Machines (Linux). - VMSize *string `json:"vmSize,omitempty"` - SSHConfiguration *SSHConfiguration `json:"sshConfiguration,omitempty"` - DataDisks *DataDisks `json:"dataDisks,omitempty"` - Subnet *ResourceID `json:"subnet,omitempty"` - MountSettings *MountSettings `json:"mountSettings,omitempty"` - ProvisioningStateTransitionTime *date.Time `json:"provisioningStateTransitionTime,omitempty"` - CreationTime *date.Time `json:"creationTime,omitempty"` - // ProvisioningState - Possible values: creating - The File Server is getting created. updating - The File Server creation has been accepted and it is getting updated. deleting - The user has requested that the File Server be deleted, and it is in the process of being deleted. failed - The File Server creation has failed with the specified errorCode. Details about the error code are specified in the message field. succeeded - The File Server creation has succeeded. Possible values include: 'FileServerProvisioningStateCreating', 'FileServerProvisioningStateUpdating', 'FileServerProvisioningStateDeleting', 'FileServerProvisioningStateSucceeded', 'FileServerProvisioningStateFailed' + // VMSize - VM size of the File Server. + VMSize *string `json:"vmSize,omitempty"` + // SSHConfiguration - SSH configuration for accessing the File Server node. + SSHConfiguration *SSHConfiguration `json:"sshConfiguration,omitempty"` + // DataDisks - Information about disks attached to File Server VM. + DataDisks *DataDisks `json:"dataDisks,omitempty"` + // Subnet - File Server virtual network subnet resource ID. + Subnet *ResourceID `json:"subnet,omitempty"` + // MountSettings - File Server mount settings. + MountSettings *MountSettings `json:"mountSettings,omitempty"` + // ProvisioningStateTransitionTime - Time when the provisioning state was changed. + ProvisioningStateTransitionTime *date.Time `json:"provisioningStateTransitionTime,omitempty"` + // CreationTime - Time when the FileServer was created. + CreationTime *date.Time `json:"creationTime,omitempty"` + // ProvisioningState - Provisioning state of the File Server. Possible values: creating - The File Server is getting created; updating - The File Server creation has been accepted and it is getting updated; deleting - The user has requested that the File Server be deleted, and it is in the process of being deleted; failed - The File Server creation has failed with the specified error code. Details about the error code are specified in the message field; succeeded - The File Server creation has succeeded. Possible values include: 'FileServerProvisioningStateCreating', 'FileServerProvisioningStateUpdating', 'FileServerProvisioningStateDeleting', 'FileServerProvisioningStateSucceeded', 'FileServerProvisioningStateFailed' ProvisioningState FileServerProvisioningState `json:"provisioningState,omitempty"` } -// FileServerReference provides required information, for the service to be able to mount Azure FileShare on the -// cluster nodes. +// FileServerReference file Server mounting configuration. type FileServerReference struct { + // FileServer - Resource ID of the existing File Server to be mounted. FileServer *ResourceID `json:"fileServer,omitempty"` - // SourceDirectory - If this property is not specified, the entire File Server will be mounted. + // SourceDirectory - File Server directory that needs to be mounted. If this property is not specified, the entire File Server will be mounted. SourceDirectory *string `json:"sourceDirectory,omitempty"` - // RelativeMountPath - Note that all cluster level file servers will be mounted under $AZ_BATCHAI_MOUNT_ROOT location and job level file servers will be mouted under $AZ_BATCHAI_JOB_MOUNT_ROOT. + // RelativeMountPath - The relative path on the compute node where the File Server will be mounted. Note that all cluster level file servers will be mounted under $AZ_BATCHAI_MOUNT_ROOT location and all job level file servers will be mounted under $AZ_BATCHAI_JOB_MOUNT_ROOT. RelativeMountPath *string `json:"relativeMountPath,omitempty"` - MountOptions *string `json:"mountOptions,omitempty"` + // MountOptions - Mount options to be passed to mount command. + MountOptions *string `json:"mountOptions,omitempty"` } // FileServersCreateFuture an abstraction for monitoring and retrieving the results of a long-running operation. @@ -1619,40 +1552,51 @@ func (future *FileServersDeleteFuture) Result(client FileServersClient) (ar auto return } -// HorovodSettings specifies the settings for Chainer job. +// HorovodSettings specifies the settings for Horovod job. type HorovodSettings struct { - PythonScriptFilePath *string `json:"pythonScriptFilePath,omitempty"` + // PythonScriptFilePath - The python script to execute. + PythonScriptFilePath *string `json:"pythonScriptFilePath,omitempty"` + // PythonInterpreterPath - The path to the Python interpreter. PythonInterpreterPath *string `json:"pythonInterpreterPath,omitempty"` - CommandLineArgs *string `json:"commandLineArgs,omitempty"` - // ProcessCount - The default value for this property is equal to nodeCount property + // CommandLineArgs - Command line arguments that need to be passed to the python script. + CommandLineArgs *string `json:"commandLineArgs,omitempty"` + // ProcessCount - Number of processes to launch for the job execution. The default value for this property is equal to nodeCount property ProcessCount *int32 `json:"processCount,omitempty"` } -// ImageReference the image reference. +// ImageReference the OS image reference. type ImageReference struct { + // Publisher - Publisher of the image. Publisher *string `json:"publisher,omitempty"` - Offer *string `json:"offer,omitempty"` - Sku *string `json:"sku,omitempty"` - Version *string `json:"version,omitempty"` - // VirtualMachineImageID - The virtual machine image must be in the same region and subscription as the cluster. For information about the firewall settings for the Batch node agent to communicate with the Batch service see https://docs.microsoft.com/en-us/azure/batch/batch-api-basics#virtual-network-vnet-and-firewall-configuration. Note, you need to provide publisher, offer and sku of the base OS image of which the custom image has been derived from. + // Offer - Offer of the image. + Offer *string `json:"offer,omitempty"` + // Sku - SKU of the image. + Sku *string `json:"sku,omitempty"` + // Version - Version of the image. + Version *string `json:"version,omitempty"` + // VirtualMachineImageID - The ARM resource identifier of the virtual machine image for the compute nodes. This is of the form /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/images/{imageName}. The virtual machine image must be in the same region and subscription as the cluster. For information about the firewall settings for the Batch node agent to communicate with the Batch service see https://docs.microsoft.com/en-us/azure/batch/batch-api-basics#virtual-network-vnet-and-firewall-configuration. Note, you need to provide publisher, offer and sku of the base OS image of which the custom image has been derived from. VirtualMachineImageID *string `json:"virtualMachineImageId,omitempty"` } -// ImageSourceRegistry details of the container image such as name, URL and credentials. +// ImageSourceRegistry information about docker image for the job. type ImageSourceRegistry struct { - ServerURL *string `json:"serverUrl,omitempty"` - Image *string `json:"image,omitempty"` + // ServerURL - URL for image repository. + ServerURL *string `json:"serverUrl,omitempty"` + // Image - The name of the image in the image repository. + Image *string `json:"image,omitempty"` + // Credentials - Credentials to access the private docker repository. Credentials *PrivateRegistryCredentials `json:"credentials,omitempty"` } // InputDirectory input directory for the job. type InputDirectory struct { - // ID - The path of the input directory will be available as a value of an environment variable with AZ_BATCHAI_INPUT_ name, where is the value of id attribute. - ID *string `json:"id,omitempty"` + // ID - The ID for the input directory. The job can use AZ_BATCHAI_INPUT_ environment variable to find the directory path, where is the value of id attribute. + ID *string `json:"id,omitempty"` + // Path - The path to the input directory. Path *string `json:"path,omitempty"` } -// Job contains information about a Job. +// Job information about a Job. type Job struct { autorest.Response `json:"-"` // JobProperties - The properties associated with the Job. @@ -1736,33 +1680,45 @@ func (j *Job) UnmarshalJSON(body []byte) error { // JobBaseProperties the properties of a Batch AI Job. type JobBaseProperties struct { - // SchedulingPriority - Scheduling priority associated with the job. Possible values include: 'Low', 'Normal', 'High' + // SchedulingPriority - Scheduling priority associated with the job. Possible values: low, normal, high. Possible values include: 'Low', 'Normal', 'High' SchedulingPriority JobPriority `json:"schedulingPriority,omitempty"` - Cluster *ResourceID `json:"cluster,omitempty"` - // MountVolumes - These volumes will be mounted before the job execution and will be unmouted after the job completion. The volumes will be mounted at location specified by $AZ_BATCHAI_JOB_MOUNT_ROOT environment variable. + // Cluster - Resource ID of the cluster on which this job will run. + Cluster *ResourceID `json:"cluster,omitempty"` + // MountVolumes - Information on mount volumes to be used by the job. These volumes will be mounted before the job execution and will be unmouted after the job completion. The volumes will be mounted at location specified by $AZ_BATCHAI_JOB_MOUNT_ROOT environment variable. MountVolumes *MountVolumes `json:"mountVolumes,omitempty"` - // NodeCount - The job will be gang scheduled on that many compute nodes + // NodeCount - Number of compute nodes to run the job on. The job will be gang scheduled on that many compute nodes. NodeCount *int32 `json:"nodeCount,omitempty"` - // ContainerSettings - If the container was downloaded as part of cluster setup then the same container image will be used. If not provided, the job will run on the VM. - ContainerSettings *ContainerSettings `json:"containerSettings,omitempty"` - CntkSettings *CNTKsettings `json:"cntkSettings,omitempty"` - PyTorchSettings *PyTorchSettings `json:"pyTorchSettings,omitempty"` - TensorFlowSettings *TensorFlowSettings `json:"tensorFlowSettings,omitempty"` - CaffeSettings *CaffeSettings `json:"caffeSettings,omitempty"` - Caffe2Settings *Caffe2Settings `json:"caffe2Settings,omitempty"` - ChainerSettings *ChainerSettings `json:"chainerSettings,omitempty"` + // ContainerSettings - Docker container settings for the job. If not provided, the job will run directly on the node. + ContainerSettings *ContainerSettings `json:"containerSettings,omitempty"` + // CntkSettings - Settings for CNTK (aka Microsoft Cognitive Toolkit) job. + CntkSettings *CNTKsettings `json:"cntkSettings,omitempty"` + // PyTorchSettings - Settings for pyTorch job. + PyTorchSettings *PyTorchSettings `json:"pyTorchSettings,omitempty"` + // TensorFlowSettings - Settings for Tensor Flow job. + TensorFlowSettings *TensorFlowSettings `json:"tensorFlowSettings,omitempty"` + // CaffeSettings - Settings for Caffe job. + CaffeSettings *CaffeSettings `json:"caffeSettings,omitempty"` + // Caffe2Settings - Settings for Caffe2 job. + Caffe2Settings *Caffe2Settings `json:"caffe2Settings,omitempty"` + // ChainerSettings - Settings for Chainer job. + ChainerSettings *ChainerSettings `json:"chainerSettings,omitempty"` + // CustomToolkitSettings - Settings for custom tool kit job. CustomToolkitSettings *CustomToolkitSettings `json:"customToolkitSettings,omitempty"` - CustomMpiSettings *CustomMpiSettings `json:"customMpiSettings,omitempty"` - HorovodSettings *HorovodSettings `json:"horovodSettings,omitempty"` - // JobPreparation - The specified actions will run on all the nodes that are part of the job + // CustomMpiSettings - Settings for custom MPI job. + CustomMpiSettings *CustomMpiSettings `json:"customMpiSettings,omitempty"` + // HorovodSettings - Settings for Horovod job. + HorovodSettings *HorovodSettings `json:"horovodSettings,omitempty"` + // JobPreparation - A command line to be executed on each node allocated for the job before tool kit is launched. JobPreparation *JobPreparation `json:"jobPreparation,omitempty"` - // StdOutErrPathPrefix - The path where the Batch AI service will upload stdout and stderror of the job. - StdOutErrPathPrefix *string `json:"stdOutErrPathPrefix,omitempty"` - InputDirectories *[]InputDirectory `json:"inputDirectories,omitempty"` - OutputDirectories *[]OutputDirectory `json:"outputDirectories,omitempty"` - // EnvironmentVariables - Batch AI will setup these additional environment variables for the job. + // StdOutErrPathPrefix - The path where the Batch AI service will store stdout, stderror and execution log of the job. + StdOutErrPathPrefix *string `json:"stdOutErrPathPrefix,omitempty"` + // InputDirectories - A list of input directories for the job. + InputDirectories *[]InputDirectory `json:"inputDirectories,omitempty"` + // OutputDirectories - A list of output directories for the job. + OutputDirectories *[]OutputDirectory `json:"outputDirectories,omitempty"` + // EnvironmentVariables - A list of user defined environment variables which will be setup for the job. EnvironmentVariables *[]EnvironmentVariable `json:"environmentVariables,omitempty"` - // Secrets - Batch AI will setup these additional environment variables for the job. Server will never report values of these variables back. + // Secrets - A list of user defined environment variables with secret values which will be setup for the job. Server will never report values of these variables back. Secrets *[]EnvironmentVariableWithSecretValue `json:"secrets,omitempty"` // Constraints - Constraints associated with the Job. Constraints *JobBasePropertiesConstraints `json:"constraints,omitempty"` @@ -1770,11 +1726,11 @@ type JobBaseProperties struct { // JobBasePropertiesConstraints constraints associated with the Job. type JobBasePropertiesConstraints struct { - // MaxWallClockTime - Default Value = 1 week. + // MaxWallClockTime - Max time the job can run. Default value: 1 week. MaxWallClockTime *string `json:"maxWallClockTime,omitempty"` } -// JobCreateParameters parameters supplied to the Create operation. +// JobCreateParameters job creation parameters. type JobCreateParameters struct { // JobBaseProperties - The properties of the Job. *JobBaseProperties `json:"properties,omitempty"` @@ -1915,44 +1871,48 @@ func (page JobListResultPage) Values() []Job { return *page.jlr.Value } -// JobPreparation specifies the settings for job preparation. +// JobPreparation job preparation settings. type JobPreparation struct { - // CommandLine - If containerSettings is specified on the job, this commandLine will be executed in the same container as job. Otherwise it will be executed on the node. + // CommandLine - The command line to execute. If containerSettings is specified on the job, this commandLine will be executed in the same container as job. Otherwise it will be executed on the node. CommandLine *string `json:"commandLine,omitempty"` } -// JobProperties job specific properties. +// JobProperties job properties. type JobProperties struct { - // Priority - Priority associated with the job. Possible values include: 'Low', 'Normal', 'High' - Priority JobPriority `json:"priority,omitempty"` - Cluster *ResourceID `json:"cluster,omitempty"` - // MountVolumes - These volumes will be mounted before the job execution and will be unmouted after the job completion. The volumes will be mounted at location specified by $AZ_BATCHAI_JOB_MOUNT_ROOT environment variable. + // SchedulingPriority - Scheduling priority associated with the job. Possible values include: 'Low', 'Normal', 'High' + SchedulingPriority JobPriority `json:"schedulingPriority,omitempty"` + // Cluster - Resource ID of the cluster associated with the job. + Cluster *ResourceID `json:"cluster,omitempty"` + // MountVolumes - Collection of mount volumes available to the job during execution. These volumes are mounted before the job execution and unmouted after the job completion. The volumes are mounted at location specified by $AZ_BATCHAI_JOB_MOUNT_ROOT environment variable. MountVolumes *MountVolumes `json:"mountVolumes,omitempty"` - // JobOutputDirectoryPathSegment - Batch AI creates job's output directories under an unique path to avoid conflicts between jobs. This value contains a path segment generated by Batch AI to make the path unique and can be used to find the output directory on the node or mounted filesystem. - JobOutputDirectoryPathSegment *string `json:"jobOutputDirectoryPathSegment,omitempty"` // NodeCount - The job will be gang scheduled on that many compute nodes NodeCount *int32 `json:"nodeCount,omitempty"` // ContainerSettings - If the container was downloaded as part of cluster setup then the same container image will be used. If not provided, the job will run on the VM. ContainerSettings *ContainerSettings `json:"containerSettings,omitempty"` - // ToolType - Possible values are: cntk, tensorflow, caffe, caffe2, chainer, pytorch, custom, mpi, horovod. Possible values include: 'Cntk', 'Tensorflow', 'Caffe', 'Caffe2', 'Chainer', 'Horovod', 'Mpi', 'Custom' + // ToolType - Possible values are: cntk, tensorflow, caffe, caffe2, chainer, pytorch, custom, custommpi, horovod. Possible values include: 'Cntk', 'Tensorflow', 'Caffe', 'Caffe2', 'Chainer', 'Horovod', 'Custommpi', 'Custom' ToolType ToolType `json:"toolType,omitempty"` CntkSettings *CNTKsettings `json:"cntkSettings,omitempty"` PyTorchSettings *PyTorchSettings `json:"pyTorchSettings,omitempty"` TensorFlowSettings *TensorFlowSettings `json:"tensorFlowSettings,omitempty"` CaffeSettings *CaffeSettings `json:"caffeSettings,omitempty"` + Caffe2Settings *Caffe2Settings `json:"caffe2Settings,omitempty"` ChainerSettings *ChainerSettings `json:"chainerSettings,omitempty"` CustomToolkitSettings *CustomToolkitSettings `json:"customToolkitSettings,omitempty"` CustomMpiSettings *CustomMpiSettings `json:"customMpiSettings,omitempty"` HorovodSettings *HorovodSettings `json:"horovodSettings,omitempty"` // JobPreparation - The specified actions will run on all the nodes that are part of the job JobPreparation *JobPreparation `json:"jobPreparation,omitempty"` - // StdOutErrPathPrefix - The path where the Batch AI service will upload stdout and stderror of the job. - StdOutErrPathPrefix *string `json:"stdOutErrPathPrefix,omitempty"` - InputDirectories *[]InputDirectory `json:"inputDirectories,omitempty"` - OutputDirectories *[]OutputDirectory `json:"outputDirectories,omitempty"` - // EnvironmentVariables - Batch AI will setup these additional environment variables for the job. + // JobOutputDirectoryPathSegment - A segment of job's output directories path created by Batch AI. Batch AI creates job's output directories under an unique path to avoid conflicts between jobs. This value contains a path segment generated by Batch AI to make the path unique and can be used to find the output directory on the node or mounted filesystem. + JobOutputDirectoryPathSegment *string `json:"jobOutputDirectoryPathSegment,omitempty"` + // StdOutErrPathPrefix - The path where the Batch AI service stores stdout, stderror and execution log of the job. + StdOutErrPathPrefix *string `json:"stdOutErrPathPrefix,omitempty"` + // InputDirectories - A list of input directories for the job. + InputDirectories *[]InputDirectory `json:"inputDirectories,omitempty"` + // OutputDirectories - A list of output directories for the job. + OutputDirectories *[]OutputDirectory `json:"outputDirectories,omitempty"` + // EnvironmentVariables - A collection of user defined environment variables to be setup for the job. EnvironmentVariables *[]EnvironmentVariable `json:"environmentVariables,omitempty"` - // Secrets - Batch AI will setup these additional environment variables for the job. Server will never report values of these variables back. + // Secrets - A collection of user defined environment variables with secret values to be setup for the job. Server will never report values of these variables back. Secrets *[]EnvironmentVariableWithSecretValue `json:"secrets,omitempty"` // Constraints - Constraints associated with the Job. Constraints *JobPropertiesConstraints `json:"constraints,omitempty"` @@ -1966,25 +1926,26 @@ type JobProperties struct { ExecutionState ExecutionState `json:"executionState,omitempty"` // ExecutionStateTransitionTime - The time at which the job entered its current execution state. ExecutionStateTransitionTime *date.Time `json:"executionStateTransitionTime,omitempty"` - // ExecutionInfo - Contains information about the execution of a job in the Azure Batch service. + // ExecutionInfo - Information about the execution of a job. ExecutionInfo *JobPropertiesExecutionInfo `json:"executionInfo,omitempty"` } // JobPropertiesConstraints constraints associated with the Job. type JobPropertiesConstraints struct { - // MaxWallClockTime - Default Value = 1 week. + // MaxWallClockTime - Max time the job can run. Default value: 1 week. MaxWallClockTime *string `json:"maxWallClockTime,omitempty"` } -// JobPropertiesExecutionInfo contains information about the execution of a job in the Azure Batch service. +// JobPropertiesExecutionInfo information about the execution of a job. type JobPropertiesExecutionInfo struct { - // StartTime - 'Running' corresponds to the running state. If the job has been restarted or retried, this is the most recent time at which the job started running. This property is present only for job that are in the running or completed state. + // StartTime - The time at which the job started running. 'Running' corresponds to the running state. If the job has been restarted or retried, this is the most recent time at which the job started running. This property is present only for job that are in the running or completed state. StartTime *date.Time `json:"startTime,omitempty"` - // EndTime - This property is only returned if the job is in completed state. + // EndTime - The time at which the job completed. This property is only returned if the job is in completed state. EndTime *date.Time `json:"endTime,omitempty"` - // ExitCode - This property is only returned if the job is in completed state. - ExitCode *int32 `json:"exitCode,omitempty"` - Errors *[]Error `json:"errors,omitempty"` + // ExitCode - The exit code of the job. This property is only returned if the job is in completed state. + ExitCode *int32 `json:"exitCode,omitempty"` + // Errors - A collection of errors encountered by the service during job execution. + Errors *[]Error `json:"errors,omitempty"` } // JobsCreateFuture an abstraction for monitoring and retrieving the results of a long-running operation. @@ -2059,10 +2020,12 @@ func (future *JobsTerminateFuture) Result(client JobsClient) (ar autorest.Respon return } -// KeyVaultSecretReference describes a reference to Key Vault Secret. +// KeyVaultSecretReference key Vault Secret reference. type KeyVaultSecretReference struct { + // SourceVault - Fully qualified resource indentifier of the Key Vault. SourceVault *ResourceID `json:"sourceVault,omitempty"` - SecretURL *string `json:"secretUrl,omitempty"` + // SecretURL - The URL referencing a secret in the Key Vault. + SecretURL *string `json:"secretUrl,omitempty"` } // ListUsagesResult the List Usages operation response. @@ -2169,51 +2132,64 @@ func (page ListUsagesResultPage) Values() []Usage { // ManualScaleSettings manual scale settings for the cluster. type ManualScaleSettings struct { - // TargetNodeCount - Default is 0. If autoScaleSettings are not specified, then the Cluster starts with this target. + // TargetNodeCount - The desired number of compute nodes in the Cluster. Default is 0. TargetNodeCount *int32 `json:"targetNodeCount,omitempty"` - // NodeDeallocationOption - The default value is requeue. Possible values include: 'Requeue', 'Terminate', 'Waitforjobcompletion' + // NodeDeallocationOption - An action to be performed when the cluster size is decreasing. The default value is requeue. Possible values include: 'Requeue', 'Terminate', 'Waitforjobcompletion' NodeDeallocationOption DeallocationOption `json:"nodeDeallocationOption,omitempty"` } -// MountSettings details of the File Server. +// MountSettings file Server mount Information. type MountSettings struct { - MountPoint *string `json:"mountPoint,omitempty"` - FileServerPublicIP *string `json:"fileServerPublicIP,omitempty"` + // MountPoint - Path where the data disks are mounted on the File Server. + MountPoint *string `json:"mountPoint,omitempty"` + // FileServerPublicIP - Public IP address of the File Server which can be used to SSH to the node from outside of the subnet. + FileServerPublicIP *string `json:"fileServerPublicIP,omitempty"` + // FileServerInternalIP - Internal IP address of the File Server which can be used to access the File Server from within the subnet. FileServerInternalIP *string `json:"fileServerInternalIP,omitempty"` } // MountVolumes details of volumes to mount on the cluster. type MountVolumes struct { - // AzureFileShares - References to Azure File Shares that are to be mounted to the cluster nodes. + // AzureFileShares - A collection of Azure File Shares that are to be mounted to the cluster nodes. AzureFileShares *[]AzureFileShareReference `json:"azureFileShares,omitempty"` - // AzureBlobFileSystems - References to Azure Blob FUSE that are to be mounted to the cluster nodes. + // AzureBlobFileSystems - A collection of Azure Blob Containers that are to be mounted to the cluster nodes. AzureBlobFileSystems *[]AzureBlobFileSystemReference `json:"azureBlobFileSystems,omitempty"` - FileServers *[]FileServerReference `json:"fileServers,omitempty"` + // FileServers - A collection of Batch AI File Servers that are to be mounted to the cluster nodes. + FileServers *[]FileServerReference `json:"fileServers,omitempty"` + // UnmanagedFileSystems - A collection of unmanaged file systems that are to be mounted to the cluster nodes. UnmanagedFileSystems *[]UnmanagedFileSystemReference `json:"unmanagedFileSystems,omitempty"` } -// NameValuePair represents a name-value pair. +// NameValuePair name-value pair. type NameValuePair struct { - Name *string `json:"name,omitempty"` + // Name - The name in the name-value pair. + Name *string `json:"name,omitempty"` + // Value - The value in the name-value pair. Value *string `json:"value,omitempty"` } -// NodeSetup use this to prepare the VM. NOTE: The volumes specified in mountVolumes are mounted first and then the -// setupTask is run. Therefore the setup task can use local mountPaths in its execution. +// NodeSetup node setup settings. type NodeSetup struct { + // SetupTask - Setup task to run on cluster nodes when nodes got created or rebooted. The setup task code needs to be idempotent. Generally the setup task is used to download static data that is required for all jobs that run on the cluster VMs and/or to download/install software. SetupTask *SetupTask `json:"setupTask,omitempty"` - // MountVolumes - Specified mount volumes will be available to all jobs executing on the cluster. The volumes will be mounted at location specified by $AZ_BATCHAI_MOUNT_ROOT environment variable. - MountVolumes *MountVolumes `json:"mountVolumes,omitempty"` + // MountVolumes - Mount volumes to be available to setup task and all jobs executing on the cluster. The volumes will be mounted at location specified by $AZ_BATCHAI_MOUNT_ROOT environment variable. + MountVolumes *MountVolumes `json:"mountVolumes,omitempty"` + // PerformanceCountersSettings - Settings for performance counters collecting and uploading. PerformanceCountersSettings *PerformanceCountersSettings `json:"performanceCountersSettings,omitempty"` } // NodeStateCounts counts of various compute node states on the cluster. type NodeStateCounts struct { - IdleNodeCount *int32 `json:"idleNodeCount,omitempty"` - RunningNodeCount *int32 `json:"runningNodeCount,omitempty"` + // IdleNodeCount - Number of compute nodes in idle state. + IdleNodeCount *int32 `json:"idleNodeCount,omitempty"` + // RunningNodeCount - Number of compute nodes which are running jobs. + RunningNodeCount *int32 `json:"runningNodeCount,omitempty"` + // PreparingNodeCount - Number of compute nodes which are being prepared. PreparingNodeCount *int32 `json:"preparingNodeCount,omitempty"` - UnusableNodeCount *int32 `json:"unusableNodeCount,omitempty"` - LeavingNodeCount *int32 `json:"leavingNodeCount,omitempty"` + // UnusableNodeCount - Number of compute nodes which are in unusable state. + UnusableNodeCount *int32 `json:"unusableNodeCount,omitempty"` + // LeavingNodeCount - Number of compute nodes which are leaving the cluster. + LeavingNodeCount *int32 `json:"leavingNodeCount,omitempty"` } // Operation details of a REST API operation @@ -2337,9 +2313,9 @@ func (page OperationListResultPage) Values() []Operation { // OutputDirectory output directory for the job. type OutputDirectory struct { - // ID - The path of the output directory will be available as a value of an environment variable with AZ_BATCHAI_OUTPUT_ name, where is the value of id attribute. + // ID - The ID of the output directory. The job can use AZ_BATCHAI_OUTPUT_ environment variale to find the directory path, where is the value of id attribute. ID *string `json:"id,omitempty"` - // PathPrefix - NOTE: This is an absolute path to prefix. E.g. $AZ_BATCHAI_MOUNT_ROOT/MyNFS/MyLogs. You can find the full path to the output directory by combining pathPrefix, jobOutputDirectoryPathSegment (reported by get job) and pathSuffix. + // PathPrefix - The prefix path where the output directory will be created. Note, this is an absolute path to prefix. E.g. $AZ_BATCHAI_MOUNT_ROOT/MyNFS/MyLogs. The full path to the output directory by combining pathPrefix, jobOutputDirectoryPathSegment (reported by get job) and pathSuffix. PathPrefix *string `json:"pathPrefix,omitempty"` // PathSuffix - The suffix path where the output directory will be created. E.g. models. You can find the full path to the output directory by combining pathPrefix, jobOutputDirectoryPathSegment (reported by get job) and pathSuffix. PathSuffix *string `json:"pathSuffix,omitempty"` @@ -2347,16 +2323,17 @@ type OutputDirectory struct { // PerformanceCountersSettings performance counters reporting settings. type PerformanceCountersSettings struct { - // AppInsightsReference - If provided, Batch AI will upload node performance counters to the corresponding Azure Application Insights account. + // AppInsightsReference - Azure Application Insights information for performance counters reporting. If provided, Batch AI will upload node performance counters to the corresponding Azure Application Insights account. AppInsightsReference *AppInsightsReference `json:"appInsightsReference,omitempty"` } // PrivateRegistryCredentials credentials to access a container image in a private repository. type PrivateRegistryCredentials struct { + // Username - User name to login to the repository. Username *string `json:"username,omitempty"` - // Password - One of password or passwordSecretReference must be specified. + // Password - User password to login to the docker repository. One of password or passwordSecretReference must be specified. Password *string `json:"password,omitempty"` - // PasswordSecretReference - Users can store their secrets in Azure KeyVault and pass it to the Batch AI Service to integrate with KeyVault. One of password or passwordSecretReference must be specified. + // PasswordSecretReference - KeyVault Secret storing the password. Users can store their secrets in Azure KeyVault and pass it to the Batch AI service to integrate with KeyVault. One of password or passwordSecretReference must be specified. PasswordSecretReference *KeyVaultSecretReference `json:"passwordSecretReference,omitempty"` } @@ -2370,24 +2347,28 @@ type ProxyResource struct { Type *string `json:"type,omitempty"` } -// PyTorchSettings specifies the settings for pyTorch job. +// PyTorchSettings pyTorch job settings. type PyTorchSettings struct { - PythonScriptFilePath *string `json:"pythonScriptFilePath,omitempty"` + // PythonScriptFilePath - The python script to execute. + PythonScriptFilePath *string `json:"pythonScriptFilePath,omitempty"` + // PythonInterpreterPath - The path to the Python interpreter. PythonInterpreterPath *string `json:"pythonInterpreterPath,omitempty"` - CommandLineArgs *string `json:"commandLineArgs,omitempty"` - // ProcessCount - The default value for this property is equal to nodeCount property. + // CommandLineArgs - Command line arguments that need to be passed to the python script. + CommandLineArgs *string `json:"commandLineArgs,omitempty"` + // ProcessCount - Number of processes to launch for the job execution. The default value for this property is equal to nodeCount property ProcessCount *int32 `json:"processCount,omitempty"` - // CommunicationBackend - Valid values are 'TCP', 'Gloo' or 'MPI'. Not required for non-distributed jobs. + // CommunicationBackend - Type of the communication backend for distributed jobs. Valid values are 'TCP', 'Gloo' or 'MPI'. Not required for non-distributed jobs. CommunicationBackend *string `json:"communicationBackend,omitempty"` } -// RemoteLoginInformation contains remote login details to SSH/RDP to a compute node in cluster. +// RemoteLoginInformation login details to SSH to a compute node in cluster. type RemoteLoginInformation struct { - // NodeID - Id of the compute node + // NodeID - ID of the compute node. NodeID *string `json:"nodeId,omitempty"` - // IPAddress - ip address - IPAddress *string `json:"ipAddress,omitempty"` - Port *float64 `json:"port,omitempty"` + // IPAddress - Public IP address of the compute node. + IPAddress *string `json:"ipAddress,omitempty"` + // Port - SSH port number of the node. + Port *float64 `json:"port,omitempty"` } // RemoteLoginInformationListResult values returned by the List operation. @@ -2537,49 +2518,57 @@ type ResourceID struct { // settings can be specified. If autoScale settings are specified, the system automatically scales the cluster up // and down (within the supplied limits) based on the pending jobs on the cluster. type ScaleSettings struct { - Manual *ManualScaleSettings `json:"manual,omitempty"` - AutoScale *AutoScaleSettings `json:"autoScale,omitempty"` + // Manual - Manual scale settings for the cluster. + Manual *ManualScaleSettings `json:"manual,omitempty"` + // AutoScale - Auto-scale settings for the cluster. + AutoScale *AutoScaleSettings `json:"autoScale,omitempty"` } // SetupTask specifies a setup task which can be used to customize the compute nodes of the cluster. type SetupTask struct { - // CommandLine - Command line to be executed on each cluster's node after it being allocated or rebooted. The command is executed in a bash subshell as a root. - CommandLine *string `json:"commandLine,omitempty"` + // CommandLine - The command line to be executed on each cluster's node after it being allocated or rebooted. The command is executed in a bash subshell as a root. + CommandLine *string `json:"commandLine,omitempty"` + // EnvironmentVariables - A collection of user defined environment variables to be set for setup task. EnvironmentVariables *[]EnvironmentVariable `json:"environmentVariables,omitempty"` - // Secrets - Server will never report values of these variables back. + // Secrets - A collection of user defined environment variables with secret values to be set for the setup task. Server will never report values of these variables back. Secrets *[]EnvironmentVariableWithSecretValue `json:"secrets,omitempty"` - // StdOutErrPathPrefix - The prefix of a path where the Batch AI service will upload the stdout and stderr of the setup task. + // StdOutErrPathPrefix - The prefix of a path where the Batch AI service will upload the stdout, stderr and execution log of the setup task. StdOutErrPathPrefix *string `json:"stdOutErrPathPrefix,omitempty"` - // StdOutErrPathSuffix - Batch AI creates the setup task output directories under an unique path to avoid conflicts between different clusters. You can concatinate stdOutErrPathPrefix and stdOutErrPathSuffix to get the full path to the output directory. + // StdOutErrPathSuffix - A path segment appended by Batch AI to stdOutErrPathPrefix to form a path where stdout, stderr and execution log of the setup task will be uploaded. Batch AI creates the setup task output directories under an unique path to avoid conflicts between different clusters. The full path can be obtained by concatenation of stdOutErrPathPrefix and stdOutErrPathSuffix. StdOutErrPathSuffix *string `json:"stdOutErrPathSuffix,omitempty"` } -// SSHConfiguration SSH configuration settings for the VM +// SSHConfiguration SSH configuration. type SSHConfiguration struct { - // PublicIPsToAllow - Default value is '*' can be used to match all source IPs. Maximum number of IP ranges that can be specified are 400. - PublicIPsToAllow *[]string `json:"publicIPsToAllow,omitempty"` + // PublicIPsToAllow - List of source IP ranges to allow SSH connection from. The default value is '*' (all source IPs are allowed). Maximum number of IP ranges that can be specified is 400. + PublicIPsToAllow *[]string `json:"publicIPsToAllow,omitempty"` + // UserAccountSettings - Settings for administrator user account to be created on a node. The account can be used to establish SSH connection to the node. UserAccountSettings *UserAccountSettings `json:"userAccountSettings,omitempty"` } -// TensorFlowSettings specifies the settings for TensorFlow job. +// TensorFlowSettings tensorFlow job settings. type TensorFlowSettings struct { - PythonScriptFilePath *string `json:"pythonScriptFilePath,omitempty"` + // PythonScriptFilePath - The python script to execute. + PythonScriptFilePath *string `json:"pythonScriptFilePath,omitempty"` + // PythonInterpreterPath - The path to the Python interpreter. PythonInterpreterPath *string `json:"pythonInterpreterPath,omitempty"` + // MasterCommandLineArgs - Command line arguments that need to be passed to the python script for the master task. MasterCommandLineArgs *string `json:"masterCommandLineArgs,omitempty"` - // WorkerCommandLineArgs - This property is optional for single machine training. + // WorkerCommandLineArgs - Command line arguments that need to be passed to the python script for the worker task. Optional for single process jobs. WorkerCommandLineArgs *string `json:"workerCommandLineArgs,omitempty"` - // ParameterServerCommandLineArgs - This property is optional for single machine training. + // ParameterServerCommandLineArgs - Command line arguments that need to be passed to the python script for the parameter server. Optional for single process jobs. ParameterServerCommandLineArgs *string `json:"parameterServerCommandLineArgs,omitempty"` - // WorkerCount - If specified, the value must be less than or equal to (nodeCount * numberOfGPUs per VM). If not specified, the default value is equal to nodeCount. This property can be specified only for distributed TensorFlow training + // WorkerCount - The number of worker tasks. If specified, the value must be less than or equal to (nodeCount * numberOfGPUs per VM). If not specified, the default value is equal to nodeCount. This property can be specified only for distributed TensorFlow training. WorkerCount *int32 `json:"workerCount,omitempty"` - // ParameterServerCount - If specified, the value must be less than or equal to nodeCount. If not specified, the default value is equal to 1 for distributed TensorFlow training (This property is not applicable for single machine training). This property can be specified only for distributed TensorFlow training. + // ParameterServerCount - The number of parameter server tasks. If specified, the value must be less than or equal to nodeCount. If not specified, the default value is equal to 1 for distributed TensorFlow training. This property can be specified only for distributed TensorFlow training. ParameterServerCount *int32 `json:"parameterServerCount,omitempty"` } -// UnmanagedFileSystemReference details of the file system to mount on the compute cluster nodes. +// UnmanagedFileSystemReference unmananged file system mounting configuration. type UnmanagedFileSystemReference struct { + // MountCommand - Mount command line. Note, Batch AI will append mount path to the command on its own. MountCommand *string `json:"mountCommand,omitempty"` - // RelativeMountPath - Note that all cluster level unmanaged file system will be mounted under $AZ_BATCHAI_MOUNT_ROOT location and job level unmanaged file system will be mounted under $AZ_BATCHAI_JOB_MOUNT_ROOT. + // RelativeMountPath - The relative path on the compute node where the unmanaged file system will be mounted. Note that all cluster level unmanaged file systems will be mounted under $AZ_BATCHAI_MOUNT_ROOT location and all job level unmanaged file systems will be mounted under $AZ_BATCHAI_JOB_MOUNT_ROOT. RelativeMountPath *string `json:"relativeMountPath,omitempty"` } @@ -2605,17 +2594,21 @@ type UsageName struct { // UserAccountSettings settings for user account that gets created on each on the nodes of a cluster. type UserAccountSettings struct { - AdminUserName *string `json:"adminUserName,omitempty"` + // AdminUserName - Name of the administrator user account which can be used to SSH to nodes. + AdminUserName *string `json:"adminUserName,omitempty"` + // AdminUserSSHPublicKey - SSH public key of the administrator user account. AdminUserSSHPublicKey *string `json:"adminUserSshPublicKey,omitempty"` - AdminUserPassword *string `json:"adminUserPassword,omitempty"` + // AdminUserPassword - Password of the administrator user account. + AdminUserPassword *string `json:"adminUserPassword,omitempty"` } -// VirtualMachineConfiguration settings for OS image. +// VirtualMachineConfiguration VM configuration. type VirtualMachineConfiguration struct { + // ImageReference - OS image reference for cluster nodes. ImageReference *ImageReference `json:"imageReference,omitempty"` } -// Workspace describes Batch AI Workspace. +// Workspace batch AI Workspace information. type Workspace struct { autorest.Response `json:"-"` // WorkspaceProperties - The properties associated with the workspace. @@ -2725,7 +2718,7 @@ func (w *Workspace) UnmarshalJSON(body []byte) error { return nil } -// WorkspaceCreateParameters parameters supplied to the Create operation. +// WorkspaceCreateParameters workspace creation parameters. type WorkspaceCreateParameters struct { // Location - The region in which to create the Workspace. Location *string `json:"location,omitempty"` @@ -2849,8 +2842,9 @@ func (page WorkspaceListResultPage) Values() []Workspace { // WorkspaceProperties workspace specific properties. type WorkspaceProperties struct { + // CreationTime - Time when the Workspace was created. CreationTime *date.Time `json:"creationTime,omitempty"` - // ProvisioningState - The provisioned state of the workspace. Possible values include: 'ProvisioningStateCreating', 'ProvisioningStateSucceeded', 'ProvisioningStateFailed', 'ProvisioningStateDeleting' + // ProvisioningState - The provisioned state of the Workspace. Possible values include: 'ProvisioningStateCreating', 'ProvisioningStateSucceeded', 'ProvisioningStateFailed', 'ProvisioningStateDeleting' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` // ProvisioningStateTransitionTime - The time at which the workspace entered its current provisioning state. ProvisioningStateTransitionTime *date.Time `json:"provisioningStateTransitionTime,omitempty"` @@ -2905,3 +2899,18 @@ func (future *WorkspacesDeleteFuture) Result(client WorkspacesClient) (ar autore ar.Response = future.Response() return } + +// WorkspaceUpdateParameters workspace update parameters. +type WorkspaceUpdateParameters struct { + // Tags - The user specified tags associated with the Workspace. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for WorkspaceUpdateParameters. +func (wup WorkspaceUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if wup.Tags != nil { + objectMap["tags"] = wup.Tags + } + return json.Marshal(objectMap) +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/batchai/mgmt/2018-05-01/batchai/workspaces.go b/vendor/github.com/Azure/azure-sdk-for-go/services/batchai/mgmt/2018-05-01/batchai/workspaces.go index ea641b51a..4e650bd0a 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/batchai/mgmt/2018-05-01/batchai/workspaces.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/batchai/mgmt/2018-05-01/batchai/workspaces.go @@ -293,7 +293,7 @@ func (client WorkspacesClient) List(ctx context.Context, maxResults *int32) (res if err := validation.Validate([]validation.Validation{ {TargetValue: maxResults, Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, + Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: int64(1000), Chain: nil}, {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("batchai.WorkspacesClient", "List", err.Error()) @@ -402,7 +402,7 @@ func (client WorkspacesClient) ListByResourceGroup(ctx context.Context, resource Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, {TargetValue: maxResults, Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, + Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: int64(1000), Chain: nil}, {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("batchai.WorkspacesClient", "ListByResourceGroup", err.Error()) @@ -501,3 +501,84 @@ func (client WorkspacesClient) ListByResourceGroupComplete(ctx context.Context, result.page, err = client.ListByResourceGroup(ctx, resourceGroupName, maxResults) return } + +// Update updates properties of a Workspace. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// workspaceName - the name of the workspace. Workspace names can only contain a combination of alphanumeric +// characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long. +// parameters - additional parameters for workspace update. +func (client WorkspacesClient) Update(ctx context.Context, resourceGroupName string, workspaceName string, parameters WorkspaceUpdateParameters) (result Workspace, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, + {TargetValue: workspaceName, + Constraints: []validation.Constraint{{Target: "workspaceName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + {Target: "workspaceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "workspaceName", Name: validation.Pattern, Rule: `^[-\w_]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("batchai.WorkspacesClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, workspaceName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "batchai.WorkspacesClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "batchai.WorkspacesClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "batchai.WorkspacesClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client WorkspacesClient) UpdatePreparer(ctx context.Context, resourceGroupName string, workspaceName string, parameters WorkspaceUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2018-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BatchAI/workspaces/{workspaceName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client WorkspacesClient) UpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client WorkspacesClient) UpdateResponder(resp *http.Response) (result Workspace, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v1.0/autosuggest/client.go b/vendor/github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v1.0/autosuggest/client.go new file mode 100644 index 000000000..165d9a68f --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v1.0/autosuggest/client.go @@ -0,0 +1,264 @@ +// Package autosuggest implements the Azure ARM Autosuggest service API version 1.0. +// +// The AutoSuggest Search API lets you send a search query to Bing and get back a list of news that are relevant to the +// search query. This section provides technical details about the query parameters and headers that you use to request +// news and the JSON response objects that contain them. For examples that show how to make requests, see [Searching +// the web for +// AutoSuggest](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-autosuggest-api-v7-reference). +package autosuggest + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "net/http" +) + +const ( + // DefaultBaseURI is the default URI used for the service Autosuggest + DefaultBaseURI = "https://api.cognitive.microsoft.com/bing/v7.0" +) + +// BaseClient is the base client for Autosuggest. +type BaseClient struct { + autorest.Client + BaseURI string +} + +// New creates an instance of the BaseClient client. +func New() BaseClient { + return NewWithBaseURI(DefaultBaseURI) +} + +// NewWithBaseURI creates an instance of the BaseClient client. +func NewWithBaseURI(baseURI string) BaseClient { + return BaseClient{ + Client: autorest.NewClientWithUserAgent(UserAgent()), + BaseURI: baseURI, + } +} + +// AutoSuggest sends the auto suggest request. +// Parameters: +// query - the user's search term. +// acceptLanguage - a comma-delimited list of one or more languages to use for user interface strings. The list +// is in decreasing order of preference. For additional information, including expected format, see +// [RFC2616](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html). This header and the setLang query +// parameter are mutually exclusive; do not specify both. If you set this header, you must also specify the +// [cc](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-autosuggest-api-v7-reference#cc) query +// parameter. To determine the market to return results for, Bing uses the first supported language it finds +// from the list and combines it with the cc parameter value. If the list does not include a supported +// language, Bing finds the closest language and market that supports the request or it uses an aggregated or +// default market for the results. To determine the market that Bing used, see the BingAPIs-Market header. Use +// this header and the cc query parameter only if you specify multiple languages. Otherwise, use the +// [mkt](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-autosuggest-api-v7-reference#mkt) and +// [setLang](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-autosuggest-api-v7-reference#setlang) +// query parameters. A user interface string is a string that's used as a label in a user interface. There are +// few user interface strings in the JSON response objects. Any links to Bing.com properties in the response +// objects apply the specified language. +// pragma - by default, Bing returns cached content, if available. To prevent Bing from returning cached +// content, set the Pragma header to no-cache (for example, Pragma: no-cache). +// userAgent - the user agent originating the request. Bing uses the user agent to provide mobile users with an +// optimized experience. Although optional, you are encouraged to always specify this header. The user-agent +// should be the same string that any commonly used browser sends. For information about user agents, see [RFC +// 2616](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html). The following are examples of user-agent +// strings. Windows Phone: Mozilla/5.0 (compatible; MSIE 10.0; Windows Phone 8.0; Trident/6.0; IEMobile/10.0; +// ARM; Touch; NOKIA; Lumia 822). Android: Mozilla / 5.0 (Linux; U; Android 2.3.5; en - us; SCH - I500 Build / +// GINGERBREAD) AppleWebKit / 533.1 (KHTML; like Gecko) Version / 4.0 Mobile Safari / 533.1. iPhone: Mozilla / +// 5.0 (iPhone; CPU iPhone OS 6_1 like Mac OS X) AppleWebKit / 536.26 (KHTML; like Gecko) Mobile / 10B142 +// iPhone4; 1 BingWeb / 3.03.1428.20120423. PC: Mozilla / 5.0 (Windows NT 6.3; WOW64; Trident / 7.0; Touch; +// rv:11.0) like Gecko. iPad: Mozilla / 5.0 (iPad; CPU OS 7_0 like Mac OS X) AppleWebKit / 537.51.1 (KHTML, +// like Gecko) Version / 7.0 Mobile / 11A465 Safari / 9537.53 +// clientID - bing uses this header to provide users with consistent behavior across Bing API calls. Bing often +// flights new features and improvements, and it uses the client ID as a key for assigning traffic on different +// flights. If you do not use the same client ID for a user across multiple requests, then Bing may assign the +// user to multiple conflicting flights. Being assigned to multiple conflicting flights can lead to an +// inconsistent user experience. For example, if the second request has a different flight assignment than the +// first, the experience may be unexpected. Also, Bing can use the client ID to tailor web results to that +// client ID’s search history, providing a richer experience for the user. Bing also uses this header to help +// improve result rankings by analyzing the activity generated by a client ID. The relevance improvements help +// with better quality of results delivered by Bing APIs and in turn enables higher click-through rates for the +// API consumer. IMPORTANT: Although optional, you should consider this header required. Persisting the client +// ID across multiple requests for the same end user and device combination enables 1) the API consumer to +// receive a consistent user experience, and 2) higher click-through rates via better quality of results from +// the Bing APIs. Each user that uses your application on the device must have a unique, Bing generated client +// ID. If you do not include this header in the request, Bing generates an ID and returns it in the +// X-MSEdge-ClientID response header. The only time that you should NOT include this header in a request is the +// first time the user uses your app on that device. Use the client ID for each Bing API request that your app +// makes for this user on the device. Persist the client ID. To persist the ID in a browser app, use a +// persistent HTTP cookie to ensure the ID is used across all sessions. Do not use a session cookie. For other +// apps such as mobile apps, use the device's persistent storage to persist the ID. The next time the user uses +// your app on that device, get the client ID that you persisted. Bing responses may or may not include this +// header. If the response includes this header, capture the client ID and use it for all subsequent Bing +// requests for the user on that device. If you include the X-MSEdge-ClientID, you must not include cookies in +// the request. +// clientIP - the IPv4 or IPv6 address of the client device. The IP address is used to discover the user's +// location. Bing uses the location information to determine safe search behavior. Although optional, you are +// encouraged to always specify this header and the X-Search-Location header. Do not obfuscate the address (for +// example, by changing the last octet to 0). Obfuscating the address results in the location not being +// anywhere near the device's actual location, which may result in Bing serving erroneous results. +// location - a semicolon-delimited list of key/value pairs that describe the client's geographical location. +// Bing uses the location information to determine safe search behavior and to return relevant local content. +// Specify the key/value pair as :. The following are the keys that you use to specify the user's +// location. lat (required): The latitude of the client's location, in degrees. The latitude must be greater +// than or equal to -90.0 and less than or equal to +90.0. Negative values indicate southern latitudes and +// positive values indicate northern latitudes. long (required): The longitude of the client's location, in +// degrees. The longitude must be greater than or equal to -180.0 and less than or equal to +180.0. Negative +// values indicate western longitudes and positive values indicate eastern longitudes. re (required): The +// radius, in meters, which specifies the horizontal accuracy of the coordinates. Pass the value returned by +// the device's location service. Typical values might be 22m for GPS/Wi-Fi, 380m for cell tower triangulation, +// and 18,000m for reverse IP lookup. ts (optional): The UTC UNIX timestamp of when the client was at the +// location. (The UNIX timestamp is the number of seconds since January 1, 1970.) head (optional): The client's +// relative heading or direction of travel. Specify the direction of travel as degrees from 0 through 360, +// counting clockwise relative to true north. Specify this key only if the sp key is nonzero. sp (optional): +// The horizontal velocity (speed), in meters per second, that the client device is traveling. alt (optional): +// The altitude of the client device, in meters. are (optional): The radius, in meters, that specifies the +// vertical accuracy of the coordinates. Specify this key only if you specify the alt key. Although many of the +// keys are optional, the more information that you provide, the more accurate the location results are. +// Although optional, you are encouraged to always specify the user's geographical location. Providing the +// location is especially important if the client's IP address does not accurately reflect the user's physical +// location (for example, if the client uses VPN). For optimal results, you should include this header and the +// X-MSEdge-ClientIP header, but at a minimum, you should include this header. +// countryCode - a 2-character country code of the country where the results come from. This API supports only +// the United States market. If you specify this query parameter, it must be set to us. If you set this +// parameter, you must also specify the Accept-Language header. Bing uses the first supported language it finds +// from the languages list, and combine that language with the country code that you specify to determine the +// market to return results for. If the languages list does not include a supported language, Bing finds the +// closest language and market that supports the request, or it may use an aggregated or default market for the +// results instead of a specified one. You should use this query parameter and the Accept-Language query +// parameter only if you specify multiple languages; otherwise, you should use the mkt and setLang query +// parameters. This parameter and the mkt query parameter are mutually exclusive—do not specify both. +// market - the market where the results come from. You are strongly encouraged to always specify the market, +// if known. Specifying the market helps Bing route the request and return an appropriate and optimal response. +// This parameter and the cc query parameter are mutually exclusive—do not specify both. +// safeSearch - filter suggestions for adult content. The following are the possible filter values. Off: Return +// suggestions with adult text, images, or videos. Moderate: Return suggestion with adult text but not adult +// images or videos. Strict: Do not return news articles with adult text, images, or videos. If the request +// comes from a market that Bing's adult policy requires that safeSearch is set to Strict, Bing ignores the +// safeSearch value and uses Strict. If you use the site: query operator, there is the chance that the response +// may contain adult content regardless of what the safeSearch query parameter is set to. Use site: only if you +// are aware of the content on the site and your scenario supports the possibility of adult content. +// setLang - the language to use for user interface strings. Specify the language using the ISO 639-1 2-letter +// language code. For example, the language code for English is EN. The default is EN (English). Although +// optional, you should always specify the language. Typically, you set setLang to the same language specified +// by mkt unless the user wants the user interface strings displayed in a different language. This parameter +// and the Accept-Language header are mutually exclusive; do not specify both. A user interface string is a +// string that's used as a label in a user interface. There are few user interface strings in the JSON response +// objects. Also, any links to Bing.com properties in the response objects apply the specified language. +// responseFormat - the media type to use for the response. The following are the possible case-insensitive +// values: JSON, JSONLD. The default is JSON. If you specify JSONLD, the response body includes JSON-LD objects +// that contain the search results. +func (client BaseClient) AutoSuggest(ctx context.Context, query string, acceptLanguage string, pragma string, userAgent string, clientID string, clientIP string, location string, countryCode string, market string, safeSearch SafeSearch, setLang string, responseFormat []ResponseFormat) (result Suggestions, err error) { + req, err := client.AutoSuggestPreparer(ctx, query, acceptLanguage, pragma, userAgent, clientID, clientIP, location, countryCode, market, safeSearch, setLang, responseFormat) + if err != nil { + err = autorest.NewErrorWithError(err, "autosuggest.BaseClient", "AutoSuggest", nil, "Failure preparing request") + return + } + + resp, err := client.AutoSuggestSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "autosuggest.BaseClient", "AutoSuggest", resp, "Failure sending request") + return + } + + result, err = client.AutoSuggestResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "autosuggest.BaseClient", "AutoSuggest", resp, "Failure responding to request") + } + + return +} + +// AutoSuggestPreparer prepares the AutoSuggest request. +func (client BaseClient) AutoSuggestPreparer(ctx context.Context, query string, acceptLanguage string, pragma string, userAgent string, clientID string, clientIP string, location string, countryCode string, market string, safeSearch SafeSearch, setLang string, responseFormat []ResponseFormat) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "q": autorest.Encode("query", query), + } + if len(countryCode) > 0 { + queryParameters["cc"] = autorest.Encode("query", countryCode) + } + if len(market) > 0 { + queryParameters["mkt"] = autorest.Encode("query", market) + } else { + queryParameters["mkt"] = autorest.Encode("query", "en-us") + } + if len(string(safeSearch)) > 0 { + queryParameters["safeSearch"] = autorest.Encode("query", safeSearch) + } + if len(setLang) > 0 { + queryParameters["setLang"] = autorest.Encode("query", setLang) + } + if responseFormat != nil && len(responseFormat) > 0 { + queryParameters["ResponseFormat"] = autorest.Encode("query", responseFormat, ",") + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/Suggestions"), + autorest.WithQueryParameters(queryParameters), + autorest.WithHeader("X-BingApis-SDK", "true")) + if len(acceptLanguage) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("Accept-Language", autorest.String(acceptLanguage))) + } + if len(pragma) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("Pragma", autorest.String(pragma))) + } + if len(userAgent) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("User-Agent", autorest.String(userAgent))) + } + if len(clientID) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("X-MSEdge-ClientID", autorest.String(clientID))) + } + if len(clientIP) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("X-MSEdge-ClientIP", autorest.String(clientIP))) + } + if len(location) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("X-Search-Location", autorest.String(location))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// AutoSuggestSender sends the AutoSuggest request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) AutoSuggestSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// AutoSuggestResponder handles the response to the AutoSuggest request. The method always +// closes the http.Response Body. +func (client BaseClient) AutoSuggestResponder(resp *http.Response) (result Suggestions, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v1.0/autosuggest/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v1.0/autosuggest/models.go new file mode 100644 index 000000000..f3457f7e0 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v1.0/autosuggest/models.go @@ -0,0 +1,4080 @@ +package autosuggest + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "encoding/json" + "github.com/Azure/go-autorest/autorest" +) + +// ErrorCode enumerates the values for error code. +type ErrorCode string + +const ( + // InsufficientAuthorization ... + InsufficientAuthorization ErrorCode = "InsufficientAuthorization" + // InvalidAuthorization ... + InvalidAuthorization ErrorCode = "InvalidAuthorization" + // InvalidRequest ... + InvalidRequest ErrorCode = "InvalidRequest" + // None ... + None ErrorCode = "None" + // RateLimitExceeded ... + RateLimitExceeded ErrorCode = "RateLimitExceeded" + // ServerError ... + ServerError ErrorCode = "ServerError" +) + +// PossibleErrorCodeValues returns an array of possible values for the ErrorCode const type. +func PossibleErrorCodeValues() []ErrorCode { + return []ErrorCode{InsufficientAuthorization, InvalidAuthorization, InvalidRequest, None, RateLimitExceeded, ServerError} +} + +// ResponseFormat enumerates the values for response format. +type ResponseFormat string + +const ( + // JSON ... + JSON ResponseFormat = "Json" + // JSONLd ... + JSONLd ResponseFormat = "JsonLd" +) + +// PossibleResponseFormatValues returns an array of possible values for the ResponseFormat const type. +func PossibleResponseFormatValues() []ResponseFormat { + return []ResponseFormat{JSON, JSONLd} +} + +// SafeSearch enumerates the values for safe search. +type SafeSearch string + +const ( + // Moderate ... + Moderate SafeSearch = "Moderate" + // Off ... + Off SafeSearch = "Off" + // Strict ... + Strict SafeSearch = "Strict" +) + +// PossibleSafeSearchValues returns an array of possible values for the SafeSearch const type. +func PossibleSafeSearchValues() []SafeSearch { + return []SafeSearch{Moderate, Off, Strict} +} + +// ScenarioType enumerates the values for scenario type. +type ScenarioType string + +const ( + // Custom ... + Custom ScenarioType = "Custom" + // PersonalSearchDocuments ... + PersonalSearchDocuments ScenarioType = "PersonalSearchDocuments" + // PersonalSearchTags ... + PersonalSearchTags ScenarioType = "PersonalSearchTags" + // SearchHistory ... + SearchHistory ScenarioType = "SearchHistory" + // StoreApps ... + StoreApps ScenarioType = "StoreApps" + // Unknown ... + Unknown ScenarioType = "Unknown" + // Web ... + Web ScenarioType = "Web" +) + +// PossibleScenarioTypeValues returns an array of possible values for the ScenarioType const type. +func PossibleScenarioTypeValues() []ScenarioType { + return []ScenarioType{Custom, PersonalSearchDocuments, PersonalSearchTags, SearchHistory, StoreApps, Unknown, Web} +} + +// SearchKind enumerates the values for search kind. +type SearchKind string + +const ( + // CustomSearch ... + CustomSearch SearchKind = "CustomSearch" + // DocumentSearch ... + DocumentSearch SearchKind = "DocumentSearch" + // HistorySearch ... + HistorySearch SearchKind = "HistorySearch" + // LocationSearch ... + LocationSearch SearchKind = "LocationSearch" + // TagSearch ... + TagSearch SearchKind = "TagSearch" + // WebSearch ... + WebSearch SearchKind = "WebSearch" +) + +// PossibleSearchKindValues returns an array of possible values for the SearchKind const type. +func PossibleSearchKindValues() []SearchKind { + return []SearchKind{CustomSearch, DocumentSearch, HistorySearch, LocationSearch, TagSearch, WebSearch} +} + +// Type enumerates the values for type. +type Type string + +const ( + // TypeSuggestionsSuggestionGroup ... + TypeSuggestionsSuggestionGroup Type = "Suggestions/SuggestionGroup" +) + +// PossibleTypeValues returns an array of possible values for the Type const type. +func PossibleTypeValues() []Type { + return []Type{TypeSuggestionsSuggestionGroup} +} + +// TypeBasicError enumerates the values for type basic error. +type TypeBasicError string + +const ( + // TypeError ... + TypeError TypeBasicError = "Error" +) + +// PossibleTypeBasicErrorValues returns an array of possible values for the TypeBasicError const type. +func PossibleTypeBasicErrorValues() []TypeBasicError { + return []TypeBasicError{TypeError} +} + +// TypeBasicQueryContext enumerates the values for type basic query context. +type TypeBasicQueryContext string + +const ( + // TypeQueryContext ... + TypeQueryContext TypeBasicQueryContext = "QueryContext" +) + +// PossibleTypeBasicQueryContextValues returns an array of possible values for the TypeBasicQueryContext const type. +func PossibleTypeBasicQueryContextValues() []TypeBasicQueryContext { + return []TypeBasicQueryContext{TypeQueryContext} +} + +// TypeBasicResponseBase enumerates the values for type basic response base. +type TypeBasicResponseBase string + +const ( + // TypeAction ... + TypeAction TypeBasicResponseBase = "Action" + // TypeAnswer ... + TypeAnswer TypeBasicResponseBase = "Answer" + // TypeCreativeWork ... + TypeCreativeWork TypeBasicResponseBase = "CreativeWork" + // TypeErrorResponse ... + TypeErrorResponse TypeBasicResponseBase = "ErrorResponse" + // TypeIdentifiable ... + TypeIdentifiable TypeBasicResponseBase = "Identifiable" + // TypeResponse ... + TypeResponse TypeBasicResponseBase = "Response" + // TypeResponseBase ... + TypeResponseBase TypeBasicResponseBase = "ResponseBase" + // TypeSearchAction ... + TypeSearchAction TypeBasicResponseBase = "SearchAction" + // TypeSearchResultsAnswer ... + TypeSearchResultsAnswer TypeBasicResponseBase = "SearchResultsAnswer" + // TypeSuggestions ... + TypeSuggestions TypeBasicResponseBase = "Suggestions" + // TypeThing ... + TypeThing TypeBasicResponseBase = "Thing" +) + +// PossibleTypeBasicResponseBaseValues returns an array of possible values for the TypeBasicResponseBase const type. +func PossibleTypeBasicResponseBaseValues() []TypeBasicResponseBase { + return []TypeBasicResponseBase{TypeAction, TypeAnswer, TypeCreativeWork, TypeErrorResponse, TypeIdentifiable, TypeResponse, TypeResponseBase, TypeSearchAction, TypeSearchResultsAnswer, TypeSuggestions, TypeThing} +} + +// BasicAction ... +type BasicAction interface { + AsSearchAction() (*SearchAction, bool) + AsAction() (*Action, bool) +} + +// Action ... +type Action struct { + Result *[]BasicThing `json:"result,omitempty"` + DisplayName *string `json:"displayName,omitempty"` + IsTopAction *bool `json:"isTopAction,omitempty"` + ServiceURL *string `json:"serviceUrl,omitempty"` + // ThumbnailURL - The URL to a thumbnail of the item. + ThumbnailURL *string `json:"thumbnailUrl,omitempty"` + // About - For internal use only. + About *[]BasicThing `json:"about,omitempty"` + // Mentions - For internal use only. + Mentions *[]BasicThing `json:"mentions,omitempty"` + // Provider - The source of the creative work. + Provider *[]BasicThing `json:"provider,omitempty"` + Creator BasicThing `json:"creator,omitempty"` + // Text - Text content of this creative work + Text *string `json:"text,omitempty"` + DiscussionURL *string `json:"discussionUrl,omitempty"` + CommentCount *int32 `json:"commentCount,omitempty"` + MainEntity BasicThing `json:"mainEntity,omitempty"` + HeadLine *string `json:"headLine,omitempty"` + CopyrightHolder BasicThing `json:"copyrightHolder,omitempty"` + CopyrightYear *int32 `json:"copyrightYear,omitempty"` + Disclaimer *string `json:"disclaimer,omitempty"` + IsAccessibleForFree *bool `json:"isAccessibleForFree,omitempty"` + Genre *[]string `json:"genre,omitempty"` + IsFamilyFriendly *bool `json:"isFamilyFriendly,omitempty"` + // URL - The URL to get more information about the thing represented by this object. + URL *string `json:"url,omitempty"` + // ReadLink - The URL that returns this resource. + ReadLink *string `json:"readLink,omitempty"` + // WebSearchURL - The URL To Bing's search result for this item. + WebSearchURL *string `json:"webSearchUrl,omitempty"` + PotentialAction *[]BasicAction `json:"potentialAction,omitempty"` + ImmediateAction *[]BasicAction `json:"immediateAction,omitempty"` + PreferredClickthroughURL *string `json:"preferredClickthroughUrl,omitempty"` + AdaptiveCard *string `json:"adaptiveCard,omitempty"` + // ID - A String identifier. + ID *string `json:"id,omitempty"` + // Type - Possible values include: 'TypeResponseBase', 'TypeSearchAction', 'TypeSuggestions', 'TypeSearchResultsAnswer', 'TypeAnswer', 'TypeThing', 'TypeAction', 'TypeResponse', 'TypeIdentifiable', 'TypeErrorResponse', 'TypeCreativeWork' + Type TypeBasicResponseBase `json:"_type,omitempty"` +} + +func unmarshalBasicAction(body []byte) (BasicAction, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["_type"] { + case string(TypeSearchAction): + var sa SearchAction + err := json.Unmarshal(body, &sa) + return sa, err + default: + var a Action + err := json.Unmarshal(body, &a) + return a, err + } +} +func unmarshalBasicActionArray(body []byte) ([]BasicAction, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + aArray := make([]BasicAction, len(rawMessages)) + + for index, rawMessage := range rawMessages { + a, err := unmarshalBasicAction(*rawMessage) + if err != nil { + return nil, err + } + aArray[index] = a + } + return aArray, nil +} + +// MarshalJSON is the custom marshaler for Action. +func (a Action) MarshalJSON() ([]byte, error) { + a.Type = TypeAction + objectMap := make(map[string]interface{}) + if a.Result != nil { + objectMap["result"] = a.Result + } + if a.DisplayName != nil { + objectMap["displayName"] = a.DisplayName + } + if a.IsTopAction != nil { + objectMap["isTopAction"] = a.IsTopAction + } + if a.ServiceURL != nil { + objectMap["serviceUrl"] = a.ServiceURL + } + if a.ThumbnailURL != nil { + objectMap["thumbnailUrl"] = a.ThumbnailURL + } + if a.About != nil { + objectMap["about"] = a.About + } + if a.Mentions != nil { + objectMap["mentions"] = a.Mentions + } + if a.Provider != nil { + objectMap["provider"] = a.Provider + } + objectMap["creator"] = a.Creator + if a.Text != nil { + objectMap["text"] = a.Text + } + if a.DiscussionURL != nil { + objectMap["discussionUrl"] = a.DiscussionURL + } + if a.CommentCount != nil { + objectMap["commentCount"] = a.CommentCount + } + objectMap["mainEntity"] = a.MainEntity + if a.HeadLine != nil { + objectMap["headLine"] = a.HeadLine + } + objectMap["copyrightHolder"] = a.CopyrightHolder + if a.CopyrightYear != nil { + objectMap["copyrightYear"] = a.CopyrightYear + } + if a.Disclaimer != nil { + objectMap["disclaimer"] = a.Disclaimer + } + if a.IsAccessibleForFree != nil { + objectMap["isAccessibleForFree"] = a.IsAccessibleForFree + } + if a.Genre != nil { + objectMap["genre"] = a.Genre + } + if a.IsFamilyFriendly != nil { + objectMap["isFamilyFriendly"] = a.IsFamilyFriendly + } + if a.URL != nil { + objectMap["url"] = a.URL + } + if a.ReadLink != nil { + objectMap["readLink"] = a.ReadLink + } + if a.WebSearchURL != nil { + objectMap["webSearchUrl"] = a.WebSearchURL + } + if a.PotentialAction != nil { + objectMap["potentialAction"] = a.PotentialAction + } + if a.ImmediateAction != nil { + objectMap["immediateAction"] = a.ImmediateAction + } + if a.PreferredClickthroughURL != nil { + objectMap["preferredClickthroughUrl"] = a.PreferredClickthroughURL + } + if a.AdaptiveCard != nil { + objectMap["adaptiveCard"] = a.AdaptiveCard + } + if a.ID != nil { + objectMap["id"] = a.ID + } + if a.Type != "" { + objectMap["_type"] = a.Type + } + return json.Marshal(objectMap) +} + +// AsSearchAction is the BasicResponseBase implementation for Action. +func (a Action) AsSearchAction() (*SearchAction, bool) { + return nil, false +} + +// AsSuggestions is the BasicResponseBase implementation for Action. +func (a Action) AsSuggestions() (*Suggestions, bool) { + return nil, false +} + +// AsSearchResultsAnswer is the BasicResponseBase implementation for Action. +func (a Action) AsSearchResultsAnswer() (*SearchResultsAnswer, bool) { + return nil, false +} + +// AsBasicSearchResultsAnswer is the BasicResponseBase implementation for Action. +func (a Action) AsBasicSearchResultsAnswer() (BasicSearchResultsAnswer, bool) { + return nil, false +} + +// AsAnswer is the BasicResponseBase implementation for Action. +func (a Action) AsAnswer() (*Answer, bool) { + return nil, false +} + +// AsBasicAnswer is the BasicResponseBase implementation for Action. +func (a Action) AsBasicAnswer() (BasicAnswer, bool) { + return nil, false +} + +// AsThing is the BasicResponseBase implementation for Action. +func (a Action) AsThing() (*Thing, bool) { + return nil, false +} + +// AsBasicThing is the BasicResponseBase implementation for Action. +func (a Action) AsBasicThing() (BasicThing, bool) { + return &a, true +} + +// AsAction is the BasicResponseBase implementation for Action. +func (a Action) AsAction() (*Action, bool) { + return &a, true +} + +// AsBasicAction is the BasicResponseBase implementation for Action. +func (a Action) AsBasicAction() (BasicAction, bool) { + return &a, true +} + +// AsResponse is the BasicResponseBase implementation for Action. +func (a Action) AsResponse() (*Response, bool) { + return nil, false +} + +// AsBasicResponse is the BasicResponseBase implementation for Action. +func (a Action) AsBasicResponse() (BasicResponse, bool) { + return &a, true +} + +// AsIdentifiable is the BasicResponseBase implementation for Action. +func (a Action) AsIdentifiable() (*Identifiable, bool) { + return nil, false +} + +// AsBasicIdentifiable is the BasicResponseBase implementation for Action. +func (a Action) AsBasicIdentifiable() (BasicIdentifiable, bool) { + return &a, true +} + +// AsErrorResponse is the BasicResponseBase implementation for Action. +func (a Action) AsErrorResponse() (*ErrorResponse, bool) { + return nil, false +} + +// AsCreativeWork is the BasicResponseBase implementation for Action. +func (a Action) AsCreativeWork() (*CreativeWork, bool) { + return nil, false +} + +// AsBasicCreativeWork is the BasicResponseBase implementation for Action. +func (a Action) AsBasicCreativeWork() (BasicCreativeWork, bool) { + return &a, true +} + +// AsResponseBase is the BasicResponseBase implementation for Action. +func (a Action) AsResponseBase() (*ResponseBase, bool) { + return nil, false +} + +// AsBasicResponseBase is the BasicResponseBase implementation for Action. +func (a Action) AsBasicResponseBase() (BasicResponseBase, bool) { + return &a, true +} + +// UnmarshalJSON is the custom unmarshaler for Action struct. +func (a *Action) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "result": + if v != nil { + resultVar, err := unmarshalBasicThingArray(*v) + if err != nil { + return err + } + a.Result = &resultVar + } + case "displayName": + if v != nil { + var displayName string + err = json.Unmarshal(*v, &displayName) + if err != nil { + return err + } + a.DisplayName = &displayName + } + case "isTopAction": + if v != nil { + var isTopAction bool + err = json.Unmarshal(*v, &isTopAction) + if err != nil { + return err + } + a.IsTopAction = &isTopAction + } + case "serviceUrl": + if v != nil { + var serviceURL string + err = json.Unmarshal(*v, &serviceURL) + if err != nil { + return err + } + a.ServiceURL = &serviceURL + } + case "thumbnailUrl": + if v != nil { + var thumbnailURL string + err = json.Unmarshal(*v, &thumbnailURL) + if err != nil { + return err + } + a.ThumbnailURL = &thumbnailURL + } + case "about": + if v != nil { + about, err := unmarshalBasicThingArray(*v) + if err != nil { + return err + } + a.About = &about + } + case "mentions": + if v != nil { + mentions, err := unmarshalBasicThingArray(*v) + if err != nil { + return err + } + a.Mentions = &mentions + } + case "provider": + if v != nil { + provider, err := unmarshalBasicThingArray(*v) + if err != nil { + return err + } + a.Provider = &provider + } + case "creator": + if v != nil { + creator, err := unmarshalBasicThing(*v) + if err != nil { + return err + } + a.Creator = creator + } + case "text": + if v != nil { + var textVar string + err = json.Unmarshal(*v, &textVar) + if err != nil { + return err + } + a.Text = &textVar + } + case "discussionUrl": + if v != nil { + var discussionURL string + err = json.Unmarshal(*v, &discussionURL) + if err != nil { + return err + } + a.DiscussionURL = &discussionURL + } + case "commentCount": + if v != nil { + var commentCount int32 + err = json.Unmarshal(*v, &commentCount) + if err != nil { + return err + } + a.CommentCount = &commentCount + } + case "mainEntity": + if v != nil { + mainEntity, err := unmarshalBasicThing(*v) + if err != nil { + return err + } + a.MainEntity = mainEntity + } + case "headLine": + if v != nil { + var headLine string + err = json.Unmarshal(*v, &headLine) + if err != nil { + return err + } + a.HeadLine = &headLine + } + case "copyrightHolder": + if v != nil { + copyrightHolder, err := unmarshalBasicThing(*v) + if err != nil { + return err + } + a.CopyrightHolder = copyrightHolder + } + case "copyrightYear": + if v != nil { + var copyrightYear int32 + err = json.Unmarshal(*v, ©rightYear) + if err != nil { + return err + } + a.CopyrightYear = ©rightYear + } + case "disclaimer": + if v != nil { + var disclaimer string + err = json.Unmarshal(*v, &disclaimer) + if err != nil { + return err + } + a.Disclaimer = &disclaimer + } + case "isAccessibleForFree": + if v != nil { + var isAccessibleForFree bool + err = json.Unmarshal(*v, &isAccessibleForFree) + if err != nil { + return err + } + a.IsAccessibleForFree = &isAccessibleForFree + } + case "genre": + if v != nil { + var genre []string + err = json.Unmarshal(*v, &genre) + if err != nil { + return err + } + a.Genre = &genre + } + case "isFamilyFriendly": + if v != nil { + var isFamilyFriendly bool + err = json.Unmarshal(*v, &isFamilyFriendly) + if err != nil { + return err + } + a.IsFamilyFriendly = &isFamilyFriendly + } + case "url": + if v != nil { + var URL string + err = json.Unmarshal(*v, &URL) + if err != nil { + return err + } + a.URL = &URL + } + case "readLink": + if v != nil { + var readLink string + err = json.Unmarshal(*v, &readLink) + if err != nil { + return err + } + a.ReadLink = &readLink + } + case "webSearchUrl": + if v != nil { + var webSearchURL string + err = json.Unmarshal(*v, &webSearchURL) + if err != nil { + return err + } + a.WebSearchURL = &webSearchURL + } + case "potentialAction": + if v != nil { + potentialAction, err := unmarshalBasicActionArray(*v) + if err != nil { + return err + } + a.PotentialAction = &potentialAction + } + case "immediateAction": + if v != nil { + immediateAction, err := unmarshalBasicActionArray(*v) + if err != nil { + return err + } + a.ImmediateAction = &immediateAction + } + case "preferredClickthroughUrl": + if v != nil { + var preferredClickthroughURL string + err = json.Unmarshal(*v, &preferredClickthroughURL) + if err != nil { + return err + } + a.PreferredClickthroughURL = &preferredClickthroughURL + } + case "adaptiveCard": + if v != nil { + var adaptiveCard string + err = json.Unmarshal(*v, &adaptiveCard) + if err != nil { + return err + } + a.AdaptiveCard = &adaptiveCard + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + a.ID = &ID + } + case "_type": + if v != nil { + var typeVar TypeBasicResponseBase + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + a.Type = typeVar + } + } + } + + return nil +} + +// BasicAnswer defines an answer. +type BasicAnswer interface { + AsSuggestions() (*Suggestions, bool) + AsSearchResultsAnswer() (*SearchResultsAnswer, bool) + AsBasicSearchResultsAnswer() (BasicSearchResultsAnswer, bool) + AsAnswer() (*Answer, bool) +} + +// Answer defines an answer. +type Answer struct { + // ReadLink - The URL that returns this resource. + ReadLink *string `json:"readLink,omitempty"` + // WebSearchURL - The URL To Bing's search result for this item. + WebSearchURL *string `json:"webSearchUrl,omitempty"` + PotentialAction *[]BasicAction `json:"potentialAction,omitempty"` + ImmediateAction *[]BasicAction `json:"immediateAction,omitempty"` + PreferredClickthroughURL *string `json:"preferredClickthroughUrl,omitempty"` + AdaptiveCard *string `json:"adaptiveCard,omitempty"` + // ID - A String identifier. + ID *string `json:"id,omitempty"` + // Type - Possible values include: 'TypeResponseBase', 'TypeSearchAction', 'TypeSuggestions', 'TypeSearchResultsAnswer', 'TypeAnswer', 'TypeThing', 'TypeAction', 'TypeResponse', 'TypeIdentifiable', 'TypeErrorResponse', 'TypeCreativeWork' + Type TypeBasicResponseBase `json:"_type,omitempty"` +} + +func unmarshalBasicAnswer(body []byte) (BasicAnswer, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["_type"] { + case string(TypeSuggestions): + var s Suggestions + err := json.Unmarshal(body, &s) + return s, err + case string(TypeSearchResultsAnswer): + var sra SearchResultsAnswer + err := json.Unmarshal(body, &sra) + return sra, err + default: + var a Answer + err := json.Unmarshal(body, &a) + return a, err + } +} +func unmarshalBasicAnswerArray(body []byte) ([]BasicAnswer, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + aArray := make([]BasicAnswer, len(rawMessages)) + + for index, rawMessage := range rawMessages { + a, err := unmarshalBasicAnswer(*rawMessage) + if err != nil { + return nil, err + } + aArray[index] = a + } + return aArray, nil +} + +// MarshalJSON is the custom marshaler for Answer. +func (a Answer) MarshalJSON() ([]byte, error) { + a.Type = TypeAnswer + objectMap := make(map[string]interface{}) + if a.ReadLink != nil { + objectMap["readLink"] = a.ReadLink + } + if a.WebSearchURL != nil { + objectMap["webSearchUrl"] = a.WebSearchURL + } + if a.PotentialAction != nil { + objectMap["potentialAction"] = a.PotentialAction + } + if a.ImmediateAction != nil { + objectMap["immediateAction"] = a.ImmediateAction + } + if a.PreferredClickthroughURL != nil { + objectMap["preferredClickthroughUrl"] = a.PreferredClickthroughURL + } + if a.AdaptiveCard != nil { + objectMap["adaptiveCard"] = a.AdaptiveCard + } + if a.ID != nil { + objectMap["id"] = a.ID + } + if a.Type != "" { + objectMap["_type"] = a.Type + } + return json.Marshal(objectMap) +} + +// AsSearchAction is the BasicResponseBase implementation for Answer. +func (a Answer) AsSearchAction() (*SearchAction, bool) { + return nil, false +} + +// AsSuggestions is the BasicResponseBase implementation for Answer. +func (a Answer) AsSuggestions() (*Suggestions, bool) { + return nil, false +} + +// AsSearchResultsAnswer is the BasicResponseBase implementation for Answer. +func (a Answer) AsSearchResultsAnswer() (*SearchResultsAnswer, bool) { + return nil, false +} + +// AsBasicSearchResultsAnswer is the BasicResponseBase implementation for Answer. +func (a Answer) AsBasicSearchResultsAnswer() (BasicSearchResultsAnswer, bool) { + return nil, false +} + +// AsAnswer is the BasicResponseBase implementation for Answer. +func (a Answer) AsAnswer() (*Answer, bool) { + return &a, true +} + +// AsBasicAnswer is the BasicResponseBase implementation for Answer. +func (a Answer) AsBasicAnswer() (BasicAnswer, bool) { + return &a, true +} + +// AsThing is the BasicResponseBase implementation for Answer. +func (a Answer) AsThing() (*Thing, bool) { + return nil, false +} + +// AsBasicThing is the BasicResponseBase implementation for Answer. +func (a Answer) AsBasicThing() (BasicThing, bool) { + return nil, false +} + +// AsAction is the BasicResponseBase implementation for Answer. +func (a Answer) AsAction() (*Action, bool) { + return nil, false +} + +// AsBasicAction is the BasicResponseBase implementation for Answer. +func (a Answer) AsBasicAction() (BasicAction, bool) { + return nil, false +} + +// AsResponse is the BasicResponseBase implementation for Answer. +func (a Answer) AsResponse() (*Response, bool) { + return nil, false +} + +// AsBasicResponse is the BasicResponseBase implementation for Answer. +func (a Answer) AsBasicResponse() (BasicResponse, bool) { + return &a, true +} + +// AsIdentifiable is the BasicResponseBase implementation for Answer. +func (a Answer) AsIdentifiable() (*Identifiable, bool) { + return nil, false +} + +// AsBasicIdentifiable is the BasicResponseBase implementation for Answer. +func (a Answer) AsBasicIdentifiable() (BasicIdentifiable, bool) { + return &a, true +} + +// AsErrorResponse is the BasicResponseBase implementation for Answer. +func (a Answer) AsErrorResponse() (*ErrorResponse, bool) { + return nil, false +} + +// AsCreativeWork is the BasicResponseBase implementation for Answer. +func (a Answer) AsCreativeWork() (*CreativeWork, bool) { + return nil, false +} + +// AsBasicCreativeWork is the BasicResponseBase implementation for Answer. +func (a Answer) AsBasicCreativeWork() (BasicCreativeWork, bool) { + return nil, false +} + +// AsResponseBase is the BasicResponseBase implementation for Answer. +func (a Answer) AsResponseBase() (*ResponseBase, bool) { + return nil, false +} + +// AsBasicResponseBase is the BasicResponseBase implementation for Answer. +func (a Answer) AsBasicResponseBase() (BasicResponseBase, bool) { + return &a, true +} + +// UnmarshalJSON is the custom unmarshaler for Answer struct. +func (a *Answer) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "readLink": + if v != nil { + var readLink string + err = json.Unmarshal(*v, &readLink) + if err != nil { + return err + } + a.ReadLink = &readLink + } + case "webSearchUrl": + if v != nil { + var webSearchURL string + err = json.Unmarshal(*v, &webSearchURL) + if err != nil { + return err + } + a.WebSearchURL = &webSearchURL + } + case "potentialAction": + if v != nil { + potentialAction, err := unmarshalBasicActionArray(*v) + if err != nil { + return err + } + a.PotentialAction = &potentialAction + } + case "immediateAction": + if v != nil { + immediateAction, err := unmarshalBasicActionArray(*v) + if err != nil { + return err + } + a.ImmediateAction = &immediateAction + } + case "preferredClickthroughUrl": + if v != nil { + var preferredClickthroughURL string + err = json.Unmarshal(*v, &preferredClickthroughURL) + if err != nil { + return err + } + a.PreferredClickthroughURL = &preferredClickthroughURL + } + case "adaptiveCard": + if v != nil { + var adaptiveCard string + err = json.Unmarshal(*v, &adaptiveCard) + if err != nil { + return err + } + a.AdaptiveCard = &adaptiveCard + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + a.ID = &ID + } + case "_type": + if v != nil { + var typeVar TypeBasicResponseBase + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + a.Type = typeVar + } + } + } + + return nil +} + +// BasicCreativeWork the most generic kind of creative work, including books, movies, photographs, software programs, +// etc. +type BasicCreativeWork interface { + AsSearchAction() (*SearchAction, bool) + AsAction() (*Action, bool) + AsBasicAction() (BasicAction, bool) + AsCreativeWork() (*CreativeWork, bool) +} + +// CreativeWork the most generic kind of creative work, including books, movies, photographs, software programs, +// etc. +type CreativeWork struct { + // ThumbnailURL - The URL to a thumbnail of the item. + ThumbnailURL *string `json:"thumbnailUrl,omitempty"` + // About - For internal use only. + About *[]BasicThing `json:"about,omitempty"` + // Mentions - For internal use only. + Mentions *[]BasicThing `json:"mentions,omitempty"` + // Provider - The source of the creative work. + Provider *[]BasicThing `json:"provider,omitempty"` + Creator BasicThing `json:"creator,omitempty"` + // Text - Text content of this creative work + Text *string `json:"text,omitempty"` + DiscussionURL *string `json:"discussionUrl,omitempty"` + CommentCount *int32 `json:"commentCount,omitempty"` + MainEntity BasicThing `json:"mainEntity,omitempty"` + HeadLine *string `json:"headLine,omitempty"` + CopyrightHolder BasicThing `json:"copyrightHolder,omitempty"` + CopyrightYear *int32 `json:"copyrightYear,omitempty"` + Disclaimer *string `json:"disclaimer,omitempty"` + IsAccessibleForFree *bool `json:"isAccessibleForFree,omitempty"` + Genre *[]string `json:"genre,omitempty"` + IsFamilyFriendly *bool `json:"isFamilyFriendly,omitempty"` + // URL - The URL to get more information about the thing represented by this object. + URL *string `json:"url,omitempty"` + // ReadLink - The URL that returns this resource. + ReadLink *string `json:"readLink,omitempty"` + // WebSearchURL - The URL To Bing's search result for this item. + WebSearchURL *string `json:"webSearchUrl,omitempty"` + PotentialAction *[]BasicAction `json:"potentialAction,omitempty"` + ImmediateAction *[]BasicAction `json:"immediateAction,omitempty"` + PreferredClickthroughURL *string `json:"preferredClickthroughUrl,omitempty"` + AdaptiveCard *string `json:"adaptiveCard,omitempty"` + // ID - A String identifier. + ID *string `json:"id,omitempty"` + // Type - Possible values include: 'TypeResponseBase', 'TypeSearchAction', 'TypeSuggestions', 'TypeSearchResultsAnswer', 'TypeAnswer', 'TypeThing', 'TypeAction', 'TypeResponse', 'TypeIdentifiable', 'TypeErrorResponse', 'TypeCreativeWork' + Type TypeBasicResponseBase `json:"_type,omitempty"` +} + +func unmarshalBasicCreativeWork(body []byte) (BasicCreativeWork, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["_type"] { + case string(TypeSearchAction): + var sa SearchAction + err := json.Unmarshal(body, &sa) + return sa, err + case string(TypeAction): + var a Action + err := json.Unmarshal(body, &a) + return a, err + default: + var cw CreativeWork + err := json.Unmarshal(body, &cw) + return cw, err + } +} +func unmarshalBasicCreativeWorkArray(body []byte) ([]BasicCreativeWork, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + cwArray := make([]BasicCreativeWork, len(rawMessages)) + + for index, rawMessage := range rawMessages { + cw, err := unmarshalBasicCreativeWork(*rawMessage) + if err != nil { + return nil, err + } + cwArray[index] = cw + } + return cwArray, nil +} + +// MarshalJSON is the custom marshaler for CreativeWork. +func (cw CreativeWork) MarshalJSON() ([]byte, error) { + cw.Type = TypeCreativeWork + objectMap := make(map[string]interface{}) + if cw.ThumbnailURL != nil { + objectMap["thumbnailUrl"] = cw.ThumbnailURL + } + if cw.About != nil { + objectMap["about"] = cw.About + } + if cw.Mentions != nil { + objectMap["mentions"] = cw.Mentions + } + if cw.Provider != nil { + objectMap["provider"] = cw.Provider + } + objectMap["creator"] = cw.Creator + if cw.Text != nil { + objectMap["text"] = cw.Text + } + if cw.DiscussionURL != nil { + objectMap["discussionUrl"] = cw.DiscussionURL + } + if cw.CommentCount != nil { + objectMap["commentCount"] = cw.CommentCount + } + objectMap["mainEntity"] = cw.MainEntity + if cw.HeadLine != nil { + objectMap["headLine"] = cw.HeadLine + } + objectMap["copyrightHolder"] = cw.CopyrightHolder + if cw.CopyrightYear != nil { + objectMap["copyrightYear"] = cw.CopyrightYear + } + if cw.Disclaimer != nil { + objectMap["disclaimer"] = cw.Disclaimer + } + if cw.IsAccessibleForFree != nil { + objectMap["isAccessibleForFree"] = cw.IsAccessibleForFree + } + if cw.Genre != nil { + objectMap["genre"] = cw.Genre + } + if cw.IsFamilyFriendly != nil { + objectMap["isFamilyFriendly"] = cw.IsFamilyFriendly + } + if cw.URL != nil { + objectMap["url"] = cw.URL + } + if cw.ReadLink != nil { + objectMap["readLink"] = cw.ReadLink + } + if cw.WebSearchURL != nil { + objectMap["webSearchUrl"] = cw.WebSearchURL + } + if cw.PotentialAction != nil { + objectMap["potentialAction"] = cw.PotentialAction + } + if cw.ImmediateAction != nil { + objectMap["immediateAction"] = cw.ImmediateAction + } + if cw.PreferredClickthroughURL != nil { + objectMap["preferredClickthroughUrl"] = cw.PreferredClickthroughURL + } + if cw.AdaptiveCard != nil { + objectMap["adaptiveCard"] = cw.AdaptiveCard + } + if cw.ID != nil { + objectMap["id"] = cw.ID + } + if cw.Type != "" { + objectMap["_type"] = cw.Type + } + return json.Marshal(objectMap) +} + +// AsSearchAction is the BasicResponseBase implementation for CreativeWork. +func (cw CreativeWork) AsSearchAction() (*SearchAction, bool) { + return nil, false +} + +// AsSuggestions is the BasicResponseBase implementation for CreativeWork. +func (cw CreativeWork) AsSuggestions() (*Suggestions, bool) { + return nil, false +} + +// AsSearchResultsAnswer is the BasicResponseBase implementation for CreativeWork. +func (cw CreativeWork) AsSearchResultsAnswer() (*SearchResultsAnswer, bool) { + return nil, false +} + +// AsBasicSearchResultsAnswer is the BasicResponseBase implementation for CreativeWork. +func (cw CreativeWork) AsBasicSearchResultsAnswer() (BasicSearchResultsAnswer, bool) { + return nil, false +} + +// AsAnswer is the BasicResponseBase implementation for CreativeWork. +func (cw CreativeWork) AsAnswer() (*Answer, bool) { + return nil, false +} + +// AsBasicAnswer is the BasicResponseBase implementation for CreativeWork. +func (cw CreativeWork) AsBasicAnswer() (BasicAnswer, bool) { + return nil, false +} + +// AsThing is the BasicResponseBase implementation for CreativeWork. +func (cw CreativeWork) AsThing() (*Thing, bool) { + return nil, false +} + +// AsBasicThing is the BasicResponseBase implementation for CreativeWork. +func (cw CreativeWork) AsBasicThing() (BasicThing, bool) { + return &cw, true +} + +// AsAction is the BasicResponseBase implementation for CreativeWork. +func (cw CreativeWork) AsAction() (*Action, bool) { + return nil, false +} + +// AsBasicAction is the BasicResponseBase implementation for CreativeWork. +func (cw CreativeWork) AsBasicAction() (BasicAction, bool) { + return nil, false +} + +// AsResponse is the BasicResponseBase implementation for CreativeWork. +func (cw CreativeWork) AsResponse() (*Response, bool) { + return nil, false +} + +// AsBasicResponse is the BasicResponseBase implementation for CreativeWork. +func (cw CreativeWork) AsBasicResponse() (BasicResponse, bool) { + return &cw, true +} + +// AsIdentifiable is the BasicResponseBase implementation for CreativeWork. +func (cw CreativeWork) AsIdentifiable() (*Identifiable, bool) { + return nil, false +} + +// AsBasicIdentifiable is the BasicResponseBase implementation for CreativeWork. +func (cw CreativeWork) AsBasicIdentifiable() (BasicIdentifiable, bool) { + return &cw, true +} + +// AsErrorResponse is the BasicResponseBase implementation for CreativeWork. +func (cw CreativeWork) AsErrorResponse() (*ErrorResponse, bool) { + return nil, false +} + +// AsCreativeWork is the BasicResponseBase implementation for CreativeWork. +func (cw CreativeWork) AsCreativeWork() (*CreativeWork, bool) { + return &cw, true +} + +// AsBasicCreativeWork is the BasicResponseBase implementation for CreativeWork. +func (cw CreativeWork) AsBasicCreativeWork() (BasicCreativeWork, bool) { + return &cw, true +} + +// AsResponseBase is the BasicResponseBase implementation for CreativeWork. +func (cw CreativeWork) AsResponseBase() (*ResponseBase, bool) { + return nil, false +} + +// AsBasicResponseBase is the BasicResponseBase implementation for CreativeWork. +func (cw CreativeWork) AsBasicResponseBase() (BasicResponseBase, bool) { + return &cw, true +} + +// UnmarshalJSON is the custom unmarshaler for CreativeWork struct. +func (cw *CreativeWork) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "thumbnailUrl": + if v != nil { + var thumbnailURL string + err = json.Unmarshal(*v, &thumbnailURL) + if err != nil { + return err + } + cw.ThumbnailURL = &thumbnailURL + } + case "about": + if v != nil { + about, err := unmarshalBasicThingArray(*v) + if err != nil { + return err + } + cw.About = &about + } + case "mentions": + if v != nil { + mentions, err := unmarshalBasicThingArray(*v) + if err != nil { + return err + } + cw.Mentions = &mentions + } + case "provider": + if v != nil { + provider, err := unmarshalBasicThingArray(*v) + if err != nil { + return err + } + cw.Provider = &provider + } + case "creator": + if v != nil { + creator, err := unmarshalBasicThing(*v) + if err != nil { + return err + } + cw.Creator = creator + } + case "text": + if v != nil { + var textVar string + err = json.Unmarshal(*v, &textVar) + if err != nil { + return err + } + cw.Text = &textVar + } + case "discussionUrl": + if v != nil { + var discussionURL string + err = json.Unmarshal(*v, &discussionURL) + if err != nil { + return err + } + cw.DiscussionURL = &discussionURL + } + case "commentCount": + if v != nil { + var commentCount int32 + err = json.Unmarshal(*v, &commentCount) + if err != nil { + return err + } + cw.CommentCount = &commentCount + } + case "mainEntity": + if v != nil { + mainEntity, err := unmarshalBasicThing(*v) + if err != nil { + return err + } + cw.MainEntity = mainEntity + } + case "headLine": + if v != nil { + var headLine string + err = json.Unmarshal(*v, &headLine) + if err != nil { + return err + } + cw.HeadLine = &headLine + } + case "copyrightHolder": + if v != nil { + copyrightHolder, err := unmarshalBasicThing(*v) + if err != nil { + return err + } + cw.CopyrightHolder = copyrightHolder + } + case "copyrightYear": + if v != nil { + var copyrightYear int32 + err = json.Unmarshal(*v, ©rightYear) + if err != nil { + return err + } + cw.CopyrightYear = ©rightYear + } + case "disclaimer": + if v != nil { + var disclaimer string + err = json.Unmarshal(*v, &disclaimer) + if err != nil { + return err + } + cw.Disclaimer = &disclaimer + } + case "isAccessibleForFree": + if v != nil { + var isAccessibleForFree bool + err = json.Unmarshal(*v, &isAccessibleForFree) + if err != nil { + return err + } + cw.IsAccessibleForFree = &isAccessibleForFree + } + case "genre": + if v != nil { + var genre []string + err = json.Unmarshal(*v, &genre) + if err != nil { + return err + } + cw.Genre = &genre + } + case "isFamilyFriendly": + if v != nil { + var isFamilyFriendly bool + err = json.Unmarshal(*v, &isFamilyFriendly) + if err != nil { + return err + } + cw.IsFamilyFriendly = &isFamilyFriendly + } + case "url": + if v != nil { + var URL string + err = json.Unmarshal(*v, &URL) + if err != nil { + return err + } + cw.URL = &URL + } + case "readLink": + if v != nil { + var readLink string + err = json.Unmarshal(*v, &readLink) + if err != nil { + return err + } + cw.ReadLink = &readLink + } + case "webSearchUrl": + if v != nil { + var webSearchURL string + err = json.Unmarshal(*v, &webSearchURL) + if err != nil { + return err + } + cw.WebSearchURL = &webSearchURL + } + case "potentialAction": + if v != nil { + potentialAction, err := unmarshalBasicActionArray(*v) + if err != nil { + return err + } + cw.PotentialAction = &potentialAction + } + case "immediateAction": + if v != nil { + immediateAction, err := unmarshalBasicActionArray(*v) + if err != nil { + return err + } + cw.ImmediateAction = &immediateAction + } + case "preferredClickthroughUrl": + if v != nil { + var preferredClickthroughURL string + err = json.Unmarshal(*v, &preferredClickthroughURL) + if err != nil { + return err + } + cw.PreferredClickthroughURL = &preferredClickthroughURL + } + case "adaptiveCard": + if v != nil { + var adaptiveCard string + err = json.Unmarshal(*v, &adaptiveCard) + if err != nil { + return err + } + cw.AdaptiveCard = &adaptiveCard + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + cw.ID = &ID + } + case "_type": + if v != nil { + var typeVar TypeBasicResponseBase + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + cw.Type = typeVar + } + } + } + + return nil +} + +// BasicError defines the error that occurred. +type BasicError interface { + AsError() (*Error, bool) +} + +// Error defines the error that occurred. +type Error struct { + // Code - The error code that identifies the category of error. Possible values include: 'None', 'ServerError', 'InvalidRequest', 'RateLimitExceeded', 'InvalidAuthorization', 'InsufficientAuthorization' + Code ErrorCode `json:"code,omitempty"` + // Message - A description of the error. + Message *string `json:"message,omitempty"` + // MoreDetails - A description that provides additional information about the error. + MoreDetails *string `json:"moreDetails,omitempty"` + // Parameter - The parameter in the request that caused the error. + Parameter *string `json:"parameter,omitempty"` + // Value - The parameter's value in the request that was not valid. + Value *string `json:"value,omitempty"` + // Type - Possible values include: 'TypeError' + Type TypeBasicError `json:"_type,omitempty"` +} + +func unmarshalBasicError(body []byte) (BasicError, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["_type"] { + default: + var e Error + err := json.Unmarshal(body, &e) + return e, err + } +} +func unmarshalBasicErrorArray(body []byte) ([]BasicError, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + eArray := make([]BasicError, len(rawMessages)) + + for index, rawMessage := range rawMessages { + e, err := unmarshalBasicError(*rawMessage) + if err != nil { + return nil, err + } + eArray[index] = e + } + return eArray, nil +} + +// MarshalJSON is the custom marshaler for Error. +func (e Error) MarshalJSON() ([]byte, error) { + e.Type = TypeError + objectMap := make(map[string]interface{}) + if e.Code != "" { + objectMap["code"] = e.Code + } + if e.Message != nil { + objectMap["message"] = e.Message + } + if e.MoreDetails != nil { + objectMap["moreDetails"] = e.MoreDetails + } + if e.Parameter != nil { + objectMap["parameter"] = e.Parameter + } + if e.Value != nil { + objectMap["value"] = e.Value + } + if e.Type != "" { + objectMap["_type"] = e.Type + } + return json.Marshal(objectMap) +} + +// AsError is the BasicError implementation for Error. +func (e Error) AsError() (*Error, bool) { + return &e, true +} + +// AsBasicError is the BasicError implementation for Error. +func (e Error) AsBasicError() (BasicError, bool) { + return &e, true +} + +// ErrorResponse the top-level response that represents a failed request. +type ErrorResponse struct { + // Errors - A list of errors that describe the reasons why the request failed. + Errors *[]BasicError `json:"errors,omitempty"` + // ReadLink - The URL that returns this resource. + ReadLink *string `json:"readLink,omitempty"` + // WebSearchURL - The URL To Bing's search result for this item. + WebSearchURL *string `json:"webSearchUrl,omitempty"` + PotentialAction *[]BasicAction `json:"potentialAction,omitempty"` + ImmediateAction *[]BasicAction `json:"immediateAction,omitempty"` + PreferredClickthroughURL *string `json:"preferredClickthroughUrl,omitempty"` + AdaptiveCard *string `json:"adaptiveCard,omitempty"` + // ID - A String identifier. + ID *string `json:"id,omitempty"` + // Type - Possible values include: 'TypeResponseBase', 'TypeSearchAction', 'TypeSuggestions', 'TypeSearchResultsAnswer', 'TypeAnswer', 'TypeThing', 'TypeAction', 'TypeResponse', 'TypeIdentifiable', 'TypeErrorResponse', 'TypeCreativeWork' + Type TypeBasicResponseBase `json:"_type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ErrorResponse. +func (er ErrorResponse) MarshalJSON() ([]byte, error) { + er.Type = TypeErrorResponse + objectMap := make(map[string]interface{}) + if er.Errors != nil { + objectMap["errors"] = er.Errors + } + if er.ReadLink != nil { + objectMap["readLink"] = er.ReadLink + } + if er.WebSearchURL != nil { + objectMap["webSearchUrl"] = er.WebSearchURL + } + if er.PotentialAction != nil { + objectMap["potentialAction"] = er.PotentialAction + } + if er.ImmediateAction != nil { + objectMap["immediateAction"] = er.ImmediateAction + } + if er.PreferredClickthroughURL != nil { + objectMap["preferredClickthroughUrl"] = er.PreferredClickthroughURL + } + if er.AdaptiveCard != nil { + objectMap["adaptiveCard"] = er.AdaptiveCard + } + if er.ID != nil { + objectMap["id"] = er.ID + } + if er.Type != "" { + objectMap["_type"] = er.Type + } + return json.Marshal(objectMap) +} + +// AsSearchAction is the BasicResponseBase implementation for ErrorResponse. +func (er ErrorResponse) AsSearchAction() (*SearchAction, bool) { + return nil, false +} + +// AsSuggestions is the BasicResponseBase implementation for ErrorResponse. +func (er ErrorResponse) AsSuggestions() (*Suggestions, bool) { + return nil, false +} + +// AsSearchResultsAnswer is the BasicResponseBase implementation for ErrorResponse. +func (er ErrorResponse) AsSearchResultsAnswer() (*SearchResultsAnswer, bool) { + return nil, false +} + +// AsBasicSearchResultsAnswer is the BasicResponseBase implementation for ErrorResponse. +func (er ErrorResponse) AsBasicSearchResultsAnswer() (BasicSearchResultsAnswer, bool) { + return nil, false +} + +// AsAnswer is the BasicResponseBase implementation for ErrorResponse. +func (er ErrorResponse) AsAnswer() (*Answer, bool) { + return nil, false +} + +// AsBasicAnswer is the BasicResponseBase implementation for ErrorResponse. +func (er ErrorResponse) AsBasicAnswer() (BasicAnswer, bool) { + return nil, false +} + +// AsThing is the BasicResponseBase implementation for ErrorResponse. +func (er ErrorResponse) AsThing() (*Thing, bool) { + return nil, false +} + +// AsBasicThing is the BasicResponseBase implementation for ErrorResponse. +func (er ErrorResponse) AsBasicThing() (BasicThing, bool) { + return nil, false +} + +// AsAction is the BasicResponseBase implementation for ErrorResponse. +func (er ErrorResponse) AsAction() (*Action, bool) { + return nil, false +} + +// AsBasicAction is the BasicResponseBase implementation for ErrorResponse. +func (er ErrorResponse) AsBasicAction() (BasicAction, bool) { + return nil, false +} + +// AsResponse is the BasicResponseBase implementation for ErrorResponse. +func (er ErrorResponse) AsResponse() (*Response, bool) { + return nil, false +} + +// AsBasicResponse is the BasicResponseBase implementation for ErrorResponse. +func (er ErrorResponse) AsBasicResponse() (BasicResponse, bool) { + return &er, true +} + +// AsIdentifiable is the BasicResponseBase implementation for ErrorResponse. +func (er ErrorResponse) AsIdentifiable() (*Identifiable, bool) { + return nil, false +} + +// AsBasicIdentifiable is the BasicResponseBase implementation for ErrorResponse. +func (er ErrorResponse) AsBasicIdentifiable() (BasicIdentifiable, bool) { + return &er, true +} + +// AsErrorResponse is the BasicResponseBase implementation for ErrorResponse. +func (er ErrorResponse) AsErrorResponse() (*ErrorResponse, bool) { + return &er, true +} + +// AsCreativeWork is the BasicResponseBase implementation for ErrorResponse. +func (er ErrorResponse) AsCreativeWork() (*CreativeWork, bool) { + return nil, false +} + +// AsBasicCreativeWork is the BasicResponseBase implementation for ErrorResponse. +func (er ErrorResponse) AsBasicCreativeWork() (BasicCreativeWork, bool) { + return nil, false +} + +// AsResponseBase is the BasicResponseBase implementation for ErrorResponse. +func (er ErrorResponse) AsResponseBase() (*ResponseBase, bool) { + return nil, false +} + +// AsBasicResponseBase is the BasicResponseBase implementation for ErrorResponse. +func (er ErrorResponse) AsBasicResponseBase() (BasicResponseBase, bool) { + return &er, true +} + +// UnmarshalJSON is the custom unmarshaler for ErrorResponse struct. +func (er *ErrorResponse) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "errors": + if v != nil { + errorsVar, err := unmarshalBasicErrorArray(*v) + if err != nil { + return err + } + er.Errors = &errorsVar + } + case "readLink": + if v != nil { + var readLink string + err = json.Unmarshal(*v, &readLink) + if err != nil { + return err + } + er.ReadLink = &readLink + } + case "webSearchUrl": + if v != nil { + var webSearchURL string + err = json.Unmarshal(*v, &webSearchURL) + if err != nil { + return err + } + er.WebSearchURL = &webSearchURL + } + case "potentialAction": + if v != nil { + potentialAction, err := unmarshalBasicActionArray(*v) + if err != nil { + return err + } + er.PotentialAction = &potentialAction + } + case "immediateAction": + if v != nil { + immediateAction, err := unmarshalBasicActionArray(*v) + if err != nil { + return err + } + er.ImmediateAction = &immediateAction + } + case "preferredClickthroughUrl": + if v != nil { + var preferredClickthroughURL string + err = json.Unmarshal(*v, &preferredClickthroughURL) + if err != nil { + return err + } + er.PreferredClickthroughURL = &preferredClickthroughURL + } + case "adaptiveCard": + if v != nil { + var adaptiveCard string + err = json.Unmarshal(*v, &adaptiveCard) + if err != nil { + return err + } + er.AdaptiveCard = &adaptiveCard + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + er.ID = &ID + } + case "_type": + if v != nil { + var typeVar TypeBasicResponseBase + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + er.Type = typeVar + } + } + } + + return nil +} + +// BasicIdentifiable defines the identity of a resource. +type BasicIdentifiable interface { + AsSearchAction() (*SearchAction, bool) + AsSuggestions() (*Suggestions, bool) + AsSearchResultsAnswer() (*SearchResultsAnswer, bool) + AsBasicSearchResultsAnswer() (BasicSearchResultsAnswer, bool) + AsAnswer() (*Answer, bool) + AsBasicAnswer() (BasicAnswer, bool) + AsThing() (*Thing, bool) + AsBasicThing() (BasicThing, bool) + AsAction() (*Action, bool) + AsBasicAction() (BasicAction, bool) + AsResponse() (*Response, bool) + AsBasicResponse() (BasicResponse, bool) + AsErrorResponse() (*ErrorResponse, bool) + AsCreativeWork() (*CreativeWork, bool) + AsBasicCreativeWork() (BasicCreativeWork, bool) + AsIdentifiable() (*Identifiable, bool) +} + +// Identifiable defines the identity of a resource. +type Identifiable struct { + // ID - A String identifier. + ID *string `json:"id,omitempty"` + // Type - Possible values include: 'TypeResponseBase', 'TypeSearchAction', 'TypeSuggestions', 'TypeSearchResultsAnswer', 'TypeAnswer', 'TypeThing', 'TypeAction', 'TypeResponse', 'TypeIdentifiable', 'TypeErrorResponse', 'TypeCreativeWork' + Type TypeBasicResponseBase `json:"_type,omitempty"` +} + +func unmarshalBasicIdentifiable(body []byte) (BasicIdentifiable, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["_type"] { + case string(TypeSearchAction): + var sa SearchAction + err := json.Unmarshal(body, &sa) + return sa, err + case string(TypeSuggestions): + var s Suggestions + err := json.Unmarshal(body, &s) + return s, err + case string(TypeSearchResultsAnswer): + var sra SearchResultsAnswer + err := json.Unmarshal(body, &sra) + return sra, err + case string(TypeAnswer): + var a Answer + err := json.Unmarshal(body, &a) + return a, err + case string(TypeThing): + var t Thing + err := json.Unmarshal(body, &t) + return t, err + case string(TypeAction): + var a Action + err := json.Unmarshal(body, &a) + return a, err + case string(TypeResponse): + var r Response + err := json.Unmarshal(body, &r) + return r, err + case string(TypeErrorResponse): + var er ErrorResponse + err := json.Unmarshal(body, &er) + return er, err + case string(TypeCreativeWork): + var cw CreativeWork + err := json.Unmarshal(body, &cw) + return cw, err + default: + var i Identifiable + err := json.Unmarshal(body, &i) + return i, err + } +} +func unmarshalBasicIdentifiableArray(body []byte) ([]BasicIdentifiable, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + iArray := make([]BasicIdentifiable, len(rawMessages)) + + for index, rawMessage := range rawMessages { + i, err := unmarshalBasicIdentifiable(*rawMessage) + if err != nil { + return nil, err + } + iArray[index] = i + } + return iArray, nil +} + +// MarshalJSON is the custom marshaler for Identifiable. +func (i Identifiable) MarshalJSON() ([]byte, error) { + i.Type = TypeIdentifiable + objectMap := make(map[string]interface{}) + if i.ID != nil { + objectMap["id"] = i.ID + } + if i.Type != "" { + objectMap["_type"] = i.Type + } + return json.Marshal(objectMap) +} + +// AsSearchAction is the BasicResponseBase implementation for Identifiable. +func (i Identifiable) AsSearchAction() (*SearchAction, bool) { + return nil, false +} + +// AsSuggestions is the BasicResponseBase implementation for Identifiable. +func (i Identifiable) AsSuggestions() (*Suggestions, bool) { + return nil, false +} + +// AsSearchResultsAnswer is the BasicResponseBase implementation for Identifiable. +func (i Identifiable) AsSearchResultsAnswer() (*SearchResultsAnswer, bool) { + return nil, false +} + +// AsBasicSearchResultsAnswer is the BasicResponseBase implementation for Identifiable. +func (i Identifiable) AsBasicSearchResultsAnswer() (BasicSearchResultsAnswer, bool) { + return nil, false +} + +// AsAnswer is the BasicResponseBase implementation for Identifiable. +func (i Identifiable) AsAnswer() (*Answer, bool) { + return nil, false +} + +// AsBasicAnswer is the BasicResponseBase implementation for Identifiable. +func (i Identifiable) AsBasicAnswer() (BasicAnswer, bool) { + return nil, false +} + +// AsThing is the BasicResponseBase implementation for Identifiable. +func (i Identifiable) AsThing() (*Thing, bool) { + return nil, false +} + +// AsBasicThing is the BasicResponseBase implementation for Identifiable. +func (i Identifiable) AsBasicThing() (BasicThing, bool) { + return nil, false +} + +// AsAction is the BasicResponseBase implementation for Identifiable. +func (i Identifiable) AsAction() (*Action, bool) { + return nil, false +} + +// AsBasicAction is the BasicResponseBase implementation for Identifiable. +func (i Identifiable) AsBasicAction() (BasicAction, bool) { + return nil, false +} + +// AsResponse is the BasicResponseBase implementation for Identifiable. +func (i Identifiable) AsResponse() (*Response, bool) { + return nil, false +} + +// AsBasicResponse is the BasicResponseBase implementation for Identifiable. +func (i Identifiable) AsBasicResponse() (BasicResponse, bool) { + return nil, false +} + +// AsIdentifiable is the BasicResponseBase implementation for Identifiable. +func (i Identifiable) AsIdentifiable() (*Identifiable, bool) { + return &i, true +} + +// AsBasicIdentifiable is the BasicResponseBase implementation for Identifiable. +func (i Identifiable) AsBasicIdentifiable() (BasicIdentifiable, bool) { + return &i, true +} + +// AsErrorResponse is the BasicResponseBase implementation for Identifiable. +func (i Identifiable) AsErrorResponse() (*ErrorResponse, bool) { + return nil, false +} + +// AsCreativeWork is the BasicResponseBase implementation for Identifiable. +func (i Identifiable) AsCreativeWork() (*CreativeWork, bool) { + return nil, false +} + +// AsBasicCreativeWork is the BasicResponseBase implementation for Identifiable. +func (i Identifiable) AsBasicCreativeWork() (BasicCreativeWork, bool) { + return nil, false +} + +// AsResponseBase is the BasicResponseBase implementation for Identifiable. +func (i Identifiable) AsResponseBase() (*ResponseBase, bool) { + return nil, false +} + +// AsBasicResponseBase is the BasicResponseBase implementation for Identifiable. +func (i Identifiable) AsBasicResponseBase() (BasicResponseBase, bool) { + return &i, true +} + +// BasicQueryContext defines the query context that Bing used for the request. +type BasicQueryContext interface { + AsQueryContext() (*QueryContext, bool) +} + +// QueryContext defines the query context that Bing used for the request. +type QueryContext struct { + // OriginalQuery - The query string as specified in the request. + OriginalQuery *string `json:"originalQuery,omitempty"` + // AlteredQuery - The query string used by Bing to perform the query. Bing uses the altered query string if the original query string contained spelling mistakes. For example, if the query string is "saling downwind", the altered query string will be "sailing downwind". This field is included only if the original query string contains a spelling mistake. + AlteredQuery *string `json:"alteredQuery,omitempty"` + // AlterationOverrideQuery - The query string to use to force Bing to use the original string. For example, if the query string is "saling downwind", the override query string will be "+saling downwind". Remember to encode the query string which results in "%2Bsaling+downwind". This field is included only if the original query string contains a spelling mistake. + AlterationOverrideQuery *string `json:"alterationOverrideQuery,omitempty"` + // AdultIntent - A Boolean value that indicates whether the specified query has adult intent. The value is true if the query has adult intent; otherwise, false. + AdultIntent *bool `json:"adultIntent,omitempty"` + // AskUserForLocation - A Boolean value that indicates whether Bing requires the user's location to provide accurate results. If you specified the user's location by using the X-MSEdge-ClientIP and X-Search-Location headers, you can ignore this field. For location aware queries, such as "today's weather" or "restaurants near me" that need the user's location to provide accurate results, this field is set to true. For location aware queries that include the location (for example, "Seattle weather"), this field is set to false. This field is also set to false for queries that are not location aware, such as "best sellers". + AskUserForLocation *bool `json:"askUserForLocation,omitempty"` + IsTransactional *bool `json:"isTransactional,omitempty"` + // Type - Possible values include: 'TypeQueryContext' + Type TypeBasicQueryContext `json:"_type,omitempty"` +} + +func unmarshalBasicQueryContext(body []byte) (BasicQueryContext, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["_type"] { + default: + var qc QueryContext + err := json.Unmarshal(body, &qc) + return qc, err + } +} +func unmarshalBasicQueryContextArray(body []byte) ([]BasicQueryContext, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + qcArray := make([]BasicQueryContext, len(rawMessages)) + + for index, rawMessage := range rawMessages { + qc, err := unmarshalBasicQueryContext(*rawMessage) + if err != nil { + return nil, err + } + qcArray[index] = qc + } + return qcArray, nil +} + +// MarshalJSON is the custom marshaler for QueryContext. +func (qc QueryContext) MarshalJSON() ([]byte, error) { + qc.Type = TypeQueryContext + objectMap := make(map[string]interface{}) + if qc.OriginalQuery != nil { + objectMap["originalQuery"] = qc.OriginalQuery + } + if qc.AlteredQuery != nil { + objectMap["alteredQuery"] = qc.AlteredQuery + } + if qc.AlterationOverrideQuery != nil { + objectMap["alterationOverrideQuery"] = qc.AlterationOverrideQuery + } + if qc.AdultIntent != nil { + objectMap["adultIntent"] = qc.AdultIntent + } + if qc.AskUserForLocation != nil { + objectMap["askUserForLocation"] = qc.AskUserForLocation + } + if qc.IsTransactional != nil { + objectMap["isTransactional"] = qc.IsTransactional + } + if qc.Type != "" { + objectMap["_type"] = qc.Type + } + return json.Marshal(objectMap) +} + +// AsQueryContext is the BasicQueryContext implementation for QueryContext. +func (qc QueryContext) AsQueryContext() (*QueryContext, bool) { + return &qc, true +} + +// AsBasicQueryContext is the BasicQueryContext implementation for QueryContext. +func (qc QueryContext) AsBasicQueryContext() (BasicQueryContext, bool) { + return &qc, true +} + +// BasicResponse defines a response. All schemas that could be returned at the root of a response should inherit from +// this +type BasicResponse interface { + AsSearchAction() (*SearchAction, bool) + AsSuggestions() (*Suggestions, bool) + AsSearchResultsAnswer() (*SearchResultsAnswer, bool) + AsBasicSearchResultsAnswer() (BasicSearchResultsAnswer, bool) + AsAnswer() (*Answer, bool) + AsBasicAnswer() (BasicAnswer, bool) + AsThing() (*Thing, bool) + AsBasicThing() (BasicThing, bool) + AsAction() (*Action, bool) + AsBasicAction() (BasicAction, bool) + AsErrorResponse() (*ErrorResponse, bool) + AsCreativeWork() (*CreativeWork, bool) + AsBasicCreativeWork() (BasicCreativeWork, bool) + AsResponse() (*Response, bool) +} + +// Response defines a response. All schemas that could be returned at the root of a response should inherit from +// this +type Response struct { + // ReadLink - The URL that returns this resource. + ReadLink *string `json:"readLink,omitempty"` + // WebSearchURL - The URL To Bing's search result for this item. + WebSearchURL *string `json:"webSearchUrl,omitempty"` + PotentialAction *[]BasicAction `json:"potentialAction,omitempty"` + ImmediateAction *[]BasicAction `json:"immediateAction,omitempty"` + PreferredClickthroughURL *string `json:"preferredClickthroughUrl,omitempty"` + AdaptiveCard *string `json:"adaptiveCard,omitempty"` + // ID - A String identifier. + ID *string `json:"id,omitempty"` + // Type - Possible values include: 'TypeResponseBase', 'TypeSearchAction', 'TypeSuggestions', 'TypeSearchResultsAnswer', 'TypeAnswer', 'TypeThing', 'TypeAction', 'TypeResponse', 'TypeIdentifiable', 'TypeErrorResponse', 'TypeCreativeWork' + Type TypeBasicResponseBase `json:"_type,omitempty"` +} + +func unmarshalBasicResponse(body []byte) (BasicResponse, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["_type"] { + case string(TypeSearchAction): + var sa SearchAction + err := json.Unmarshal(body, &sa) + return sa, err + case string(TypeSuggestions): + var s Suggestions + err := json.Unmarshal(body, &s) + return s, err + case string(TypeSearchResultsAnswer): + var sra SearchResultsAnswer + err := json.Unmarshal(body, &sra) + return sra, err + case string(TypeAnswer): + var a Answer + err := json.Unmarshal(body, &a) + return a, err + case string(TypeThing): + var t Thing + err := json.Unmarshal(body, &t) + return t, err + case string(TypeAction): + var a Action + err := json.Unmarshal(body, &a) + return a, err + case string(TypeErrorResponse): + var er ErrorResponse + err := json.Unmarshal(body, &er) + return er, err + case string(TypeCreativeWork): + var cw CreativeWork + err := json.Unmarshal(body, &cw) + return cw, err + default: + var r Response + err := json.Unmarshal(body, &r) + return r, err + } +} +func unmarshalBasicResponseArray(body []byte) ([]BasicResponse, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rArray := make([]BasicResponse, len(rawMessages)) + + for index, rawMessage := range rawMessages { + r, err := unmarshalBasicResponse(*rawMessage) + if err != nil { + return nil, err + } + rArray[index] = r + } + return rArray, nil +} + +// MarshalJSON is the custom marshaler for Response. +func (r Response) MarshalJSON() ([]byte, error) { + r.Type = TypeResponse + objectMap := make(map[string]interface{}) + if r.ReadLink != nil { + objectMap["readLink"] = r.ReadLink + } + if r.WebSearchURL != nil { + objectMap["webSearchUrl"] = r.WebSearchURL + } + if r.PotentialAction != nil { + objectMap["potentialAction"] = r.PotentialAction + } + if r.ImmediateAction != nil { + objectMap["immediateAction"] = r.ImmediateAction + } + if r.PreferredClickthroughURL != nil { + objectMap["preferredClickthroughUrl"] = r.PreferredClickthroughURL + } + if r.AdaptiveCard != nil { + objectMap["adaptiveCard"] = r.AdaptiveCard + } + if r.ID != nil { + objectMap["id"] = r.ID + } + if r.Type != "" { + objectMap["_type"] = r.Type + } + return json.Marshal(objectMap) +} + +// AsSearchAction is the BasicResponseBase implementation for Response. +func (r Response) AsSearchAction() (*SearchAction, bool) { + return nil, false +} + +// AsSuggestions is the BasicResponseBase implementation for Response. +func (r Response) AsSuggestions() (*Suggestions, bool) { + return nil, false +} + +// AsSearchResultsAnswer is the BasicResponseBase implementation for Response. +func (r Response) AsSearchResultsAnswer() (*SearchResultsAnswer, bool) { + return nil, false +} + +// AsBasicSearchResultsAnswer is the BasicResponseBase implementation for Response. +func (r Response) AsBasicSearchResultsAnswer() (BasicSearchResultsAnswer, bool) { + return nil, false +} + +// AsAnswer is the BasicResponseBase implementation for Response. +func (r Response) AsAnswer() (*Answer, bool) { + return nil, false +} + +// AsBasicAnswer is the BasicResponseBase implementation for Response. +func (r Response) AsBasicAnswer() (BasicAnswer, bool) { + return nil, false +} + +// AsThing is the BasicResponseBase implementation for Response. +func (r Response) AsThing() (*Thing, bool) { + return nil, false +} + +// AsBasicThing is the BasicResponseBase implementation for Response. +func (r Response) AsBasicThing() (BasicThing, bool) { + return nil, false +} + +// AsAction is the BasicResponseBase implementation for Response. +func (r Response) AsAction() (*Action, bool) { + return nil, false +} + +// AsBasicAction is the BasicResponseBase implementation for Response. +func (r Response) AsBasicAction() (BasicAction, bool) { + return nil, false +} + +// AsResponse is the BasicResponseBase implementation for Response. +func (r Response) AsResponse() (*Response, bool) { + return &r, true +} + +// AsBasicResponse is the BasicResponseBase implementation for Response. +func (r Response) AsBasicResponse() (BasicResponse, bool) { + return &r, true +} + +// AsIdentifiable is the BasicResponseBase implementation for Response. +func (r Response) AsIdentifiable() (*Identifiable, bool) { + return nil, false +} + +// AsBasicIdentifiable is the BasicResponseBase implementation for Response. +func (r Response) AsBasicIdentifiable() (BasicIdentifiable, bool) { + return &r, true +} + +// AsErrorResponse is the BasicResponseBase implementation for Response. +func (r Response) AsErrorResponse() (*ErrorResponse, bool) { + return nil, false +} + +// AsCreativeWork is the BasicResponseBase implementation for Response. +func (r Response) AsCreativeWork() (*CreativeWork, bool) { + return nil, false +} + +// AsBasicCreativeWork is the BasicResponseBase implementation for Response. +func (r Response) AsBasicCreativeWork() (BasicCreativeWork, bool) { + return nil, false +} + +// AsResponseBase is the BasicResponseBase implementation for Response. +func (r Response) AsResponseBase() (*ResponseBase, bool) { + return nil, false +} + +// AsBasicResponseBase is the BasicResponseBase implementation for Response. +func (r Response) AsBasicResponseBase() (BasicResponseBase, bool) { + return &r, true +} + +// UnmarshalJSON is the custom unmarshaler for Response struct. +func (r *Response) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "readLink": + if v != nil { + var readLink string + err = json.Unmarshal(*v, &readLink) + if err != nil { + return err + } + r.ReadLink = &readLink + } + case "webSearchUrl": + if v != nil { + var webSearchURL string + err = json.Unmarshal(*v, &webSearchURL) + if err != nil { + return err + } + r.WebSearchURL = &webSearchURL + } + case "potentialAction": + if v != nil { + potentialAction, err := unmarshalBasicActionArray(*v) + if err != nil { + return err + } + r.PotentialAction = &potentialAction + } + case "immediateAction": + if v != nil { + immediateAction, err := unmarshalBasicActionArray(*v) + if err != nil { + return err + } + r.ImmediateAction = &immediateAction + } + case "preferredClickthroughUrl": + if v != nil { + var preferredClickthroughURL string + err = json.Unmarshal(*v, &preferredClickthroughURL) + if err != nil { + return err + } + r.PreferredClickthroughURL = &preferredClickthroughURL + } + case "adaptiveCard": + if v != nil { + var adaptiveCard string + err = json.Unmarshal(*v, &adaptiveCard) + if err != nil { + return err + } + r.AdaptiveCard = &adaptiveCard + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + r.ID = &ID + } + case "_type": + if v != nil { + var typeVar TypeBasicResponseBase + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + r.Type = typeVar + } + } + } + + return nil +} + +// BasicResponseBase response base +type BasicResponseBase interface { + AsSearchAction() (*SearchAction, bool) + AsSuggestions() (*Suggestions, bool) + AsSearchResultsAnswer() (*SearchResultsAnswer, bool) + AsBasicSearchResultsAnswer() (BasicSearchResultsAnswer, bool) + AsAnswer() (*Answer, bool) + AsBasicAnswer() (BasicAnswer, bool) + AsThing() (*Thing, bool) + AsBasicThing() (BasicThing, bool) + AsAction() (*Action, bool) + AsBasicAction() (BasicAction, bool) + AsResponse() (*Response, bool) + AsBasicResponse() (BasicResponse, bool) + AsIdentifiable() (*Identifiable, bool) + AsBasicIdentifiable() (BasicIdentifiable, bool) + AsErrorResponse() (*ErrorResponse, bool) + AsCreativeWork() (*CreativeWork, bool) + AsBasicCreativeWork() (BasicCreativeWork, bool) + AsResponseBase() (*ResponseBase, bool) +} + +// ResponseBase response base +type ResponseBase struct { + // Type - Possible values include: 'TypeResponseBase', 'TypeSearchAction', 'TypeSuggestions', 'TypeSearchResultsAnswer', 'TypeAnswer', 'TypeThing', 'TypeAction', 'TypeResponse', 'TypeIdentifiable', 'TypeErrorResponse', 'TypeCreativeWork' + Type TypeBasicResponseBase `json:"_type,omitempty"` +} + +func unmarshalBasicResponseBase(body []byte) (BasicResponseBase, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["_type"] { + case string(TypeSearchAction): + var sa SearchAction + err := json.Unmarshal(body, &sa) + return sa, err + case string(TypeSuggestions): + var s Suggestions + err := json.Unmarshal(body, &s) + return s, err + case string(TypeSearchResultsAnswer): + var sra SearchResultsAnswer + err := json.Unmarshal(body, &sra) + return sra, err + case string(TypeAnswer): + var a Answer + err := json.Unmarshal(body, &a) + return a, err + case string(TypeThing): + var t Thing + err := json.Unmarshal(body, &t) + return t, err + case string(TypeAction): + var a Action + err := json.Unmarshal(body, &a) + return a, err + case string(TypeResponse): + var r Response + err := json.Unmarshal(body, &r) + return r, err + case string(TypeIdentifiable): + var i Identifiable + err := json.Unmarshal(body, &i) + return i, err + case string(TypeErrorResponse): + var er ErrorResponse + err := json.Unmarshal(body, &er) + return er, err + case string(TypeCreativeWork): + var cw CreativeWork + err := json.Unmarshal(body, &cw) + return cw, err + default: + var rb ResponseBase + err := json.Unmarshal(body, &rb) + return rb, err + } +} +func unmarshalBasicResponseBaseArray(body []byte) ([]BasicResponseBase, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rbArray := make([]BasicResponseBase, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rb, err := unmarshalBasicResponseBase(*rawMessage) + if err != nil { + return nil, err + } + rbArray[index] = rb + } + return rbArray, nil +} + +// MarshalJSON is the custom marshaler for ResponseBase. +func (rb ResponseBase) MarshalJSON() ([]byte, error) { + rb.Type = TypeResponseBase + objectMap := make(map[string]interface{}) + if rb.Type != "" { + objectMap["_type"] = rb.Type + } + return json.Marshal(objectMap) +} + +// AsSearchAction is the BasicResponseBase implementation for ResponseBase. +func (rb ResponseBase) AsSearchAction() (*SearchAction, bool) { + return nil, false +} + +// AsSuggestions is the BasicResponseBase implementation for ResponseBase. +func (rb ResponseBase) AsSuggestions() (*Suggestions, bool) { + return nil, false +} + +// AsSearchResultsAnswer is the BasicResponseBase implementation for ResponseBase. +func (rb ResponseBase) AsSearchResultsAnswer() (*SearchResultsAnswer, bool) { + return nil, false +} + +// AsBasicSearchResultsAnswer is the BasicResponseBase implementation for ResponseBase. +func (rb ResponseBase) AsBasicSearchResultsAnswer() (BasicSearchResultsAnswer, bool) { + return nil, false +} + +// AsAnswer is the BasicResponseBase implementation for ResponseBase. +func (rb ResponseBase) AsAnswer() (*Answer, bool) { + return nil, false +} + +// AsBasicAnswer is the BasicResponseBase implementation for ResponseBase. +func (rb ResponseBase) AsBasicAnswer() (BasicAnswer, bool) { + return nil, false +} + +// AsThing is the BasicResponseBase implementation for ResponseBase. +func (rb ResponseBase) AsThing() (*Thing, bool) { + return nil, false +} + +// AsBasicThing is the BasicResponseBase implementation for ResponseBase. +func (rb ResponseBase) AsBasicThing() (BasicThing, bool) { + return nil, false +} + +// AsAction is the BasicResponseBase implementation for ResponseBase. +func (rb ResponseBase) AsAction() (*Action, bool) { + return nil, false +} + +// AsBasicAction is the BasicResponseBase implementation for ResponseBase. +func (rb ResponseBase) AsBasicAction() (BasicAction, bool) { + return nil, false +} + +// AsResponse is the BasicResponseBase implementation for ResponseBase. +func (rb ResponseBase) AsResponse() (*Response, bool) { + return nil, false +} + +// AsBasicResponse is the BasicResponseBase implementation for ResponseBase. +func (rb ResponseBase) AsBasicResponse() (BasicResponse, bool) { + return nil, false +} + +// AsIdentifiable is the BasicResponseBase implementation for ResponseBase. +func (rb ResponseBase) AsIdentifiable() (*Identifiable, bool) { + return nil, false +} + +// AsBasicIdentifiable is the BasicResponseBase implementation for ResponseBase. +func (rb ResponseBase) AsBasicIdentifiable() (BasicIdentifiable, bool) { + return nil, false +} + +// AsErrorResponse is the BasicResponseBase implementation for ResponseBase. +func (rb ResponseBase) AsErrorResponse() (*ErrorResponse, bool) { + return nil, false +} + +// AsCreativeWork is the BasicResponseBase implementation for ResponseBase. +func (rb ResponseBase) AsCreativeWork() (*CreativeWork, bool) { + return nil, false +} + +// AsBasicCreativeWork is the BasicResponseBase implementation for ResponseBase. +func (rb ResponseBase) AsBasicCreativeWork() (BasicCreativeWork, bool) { + return nil, false +} + +// AsResponseBase is the BasicResponseBase implementation for ResponseBase. +func (rb ResponseBase) AsResponseBase() (*ResponseBase, bool) { + return &rb, true +} + +// AsBasicResponseBase is the BasicResponseBase implementation for ResponseBase. +func (rb ResponseBase) AsBasicResponseBase() (BasicResponseBase, bool) { + return &rb, true +} + +// SearchAction ... +type SearchAction struct { + DisplayText *string `json:"displayText,omitempty"` + Query *string `json:"query,omitempty"` + // SearchKind - Possible values include: 'WebSearch', 'HistorySearch', 'DocumentSearch', 'TagSearch', 'LocationSearch', 'CustomSearch' + SearchKind SearchKind `json:"searchKind,omitempty"` + Result *[]BasicThing `json:"result,omitempty"` + DisplayName *string `json:"displayName,omitempty"` + IsTopAction *bool `json:"isTopAction,omitempty"` + ServiceURL *string `json:"serviceUrl,omitempty"` + // ThumbnailURL - The URL to a thumbnail of the item. + ThumbnailURL *string `json:"thumbnailUrl,omitempty"` + // About - For internal use only. + About *[]BasicThing `json:"about,omitempty"` + // Mentions - For internal use only. + Mentions *[]BasicThing `json:"mentions,omitempty"` + // Provider - The source of the creative work. + Provider *[]BasicThing `json:"provider,omitempty"` + Creator BasicThing `json:"creator,omitempty"` + // Text - Text content of this creative work + Text *string `json:"text,omitempty"` + DiscussionURL *string `json:"discussionUrl,omitempty"` + CommentCount *int32 `json:"commentCount,omitempty"` + MainEntity BasicThing `json:"mainEntity,omitempty"` + HeadLine *string `json:"headLine,omitempty"` + CopyrightHolder BasicThing `json:"copyrightHolder,omitempty"` + CopyrightYear *int32 `json:"copyrightYear,omitempty"` + Disclaimer *string `json:"disclaimer,omitempty"` + IsAccessibleForFree *bool `json:"isAccessibleForFree,omitempty"` + Genre *[]string `json:"genre,omitempty"` + IsFamilyFriendly *bool `json:"isFamilyFriendly,omitempty"` + // URL - The URL to get more information about the thing represented by this object. + URL *string `json:"url,omitempty"` + // ReadLink - The URL that returns this resource. + ReadLink *string `json:"readLink,omitempty"` + // WebSearchURL - The URL To Bing's search result for this item. + WebSearchURL *string `json:"webSearchUrl,omitempty"` + PotentialAction *[]BasicAction `json:"potentialAction,omitempty"` + ImmediateAction *[]BasicAction `json:"immediateAction,omitempty"` + PreferredClickthroughURL *string `json:"preferredClickthroughUrl,omitempty"` + AdaptiveCard *string `json:"adaptiveCard,omitempty"` + // ID - A String identifier. + ID *string `json:"id,omitempty"` + // Type - Possible values include: 'TypeResponseBase', 'TypeSearchAction', 'TypeSuggestions', 'TypeSearchResultsAnswer', 'TypeAnswer', 'TypeThing', 'TypeAction', 'TypeResponse', 'TypeIdentifiable', 'TypeErrorResponse', 'TypeCreativeWork' + Type TypeBasicResponseBase `json:"_type,omitempty"` +} + +// MarshalJSON is the custom marshaler for SearchAction. +func (sa SearchAction) MarshalJSON() ([]byte, error) { + sa.Type = TypeSearchAction + objectMap := make(map[string]interface{}) + if sa.DisplayText != nil { + objectMap["displayText"] = sa.DisplayText + } + if sa.Query != nil { + objectMap["query"] = sa.Query + } + if sa.SearchKind != "" { + objectMap["searchKind"] = sa.SearchKind + } + if sa.Result != nil { + objectMap["result"] = sa.Result + } + if sa.DisplayName != nil { + objectMap["displayName"] = sa.DisplayName + } + if sa.IsTopAction != nil { + objectMap["isTopAction"] = sa.IsTopAction + } + if sa.ServiceURL != nil { + objectMap["serviceUrl"] = sa.ServiceURL + } + if sa.ThumbnailURL != nil { + objectMap["thumbnailUrl"] = sa.ThumbnailURL + } + if sa.About != nil { + objectMap["about"] = sa.About + } + if sa.Mentions != nil { + objectMap["mentions"] = sa.Mentions + } + if sa.Provider != nil { + objectMap["provider"] = sa.Provider + } + objectMap["creator"] = sa.Creator + if sa.Text != nil { + objectMap["text"] = sa.Text + } + if sa.DiscussionURL != nil { + objectMap["discussionUrl"] = sa.DiscussionURL + } + if sa.CommentCount != nil { + objectMap["commentCount"] = sa.CommentCount + } + objectMap["mainEntity"] = sa.MainEntity + if sa.HeadLine != nil { + objectMap["headLine"] = sa.HeadLine + } + objectMap["copyrightHolder"] = sa.CopyrightHolder + if sa.CopyrightYear != nil { + objectMap["copyrightYear"] = sa.CopyrightYear + } + if sa.Disclaimer != nil { + objectMap["disclaimer"] = sa.Disclaimer + } + if sa.IsAccessibleForFree != nil { + objectMap["isAccessibleForFree"] = sa.IsAccessibleForFree + } + if sa.Genre != nil { + objectMap["genre"] = sa.Genre + } + if sa.IsFamilyFriendly != nil { + objectMap["isFamilyFriendly"] = sa.IsFamilyFriendly + } + if sa.URL != nil { + objectMap["url"] = sa.URL + } + if sa.ReadLink != nil { + objectMap["readLink"] = sa.ReadLink + } + if sa.WebSearchURL != nil { + objectMap["webSearchUrl"] = sa.WebSearchURL + } + if sa.PotentialAction != nil { + objectMap["potentialAction"] = sa.PotentialAction + } + if sa.ImmediateAction != nil { + objectMap["immediateAction"] = sa.ImmediateAction + } + if sa.PreferredClickthroughURL != nil { + objectMap["preferredClickthroughUrl"] = sa.PreferredClickthroughURL + } + if sa.AdaptiveCard != nil { + objectMap["adaptiveCard"] = sa.AdaptiveCard + } + if sa.ID != nil { + objectMap["id"] = sa.ID + } + if sa.Type != "" { + objectMap["_type"] = sa.Type + } + return json.Marshal(objectMap) +} + +// AsSearchAction is the BasicResponseBase implementation for SearchAction. +func (sa SearchAction) AsSearchAction() (*SearchAction, bool) { + return &sa, true +} + +// AsSuggestions is the BasicResponseBase implementation for SearchAction. +func (sa SearchAction) AsSuggestions() (*Suggestions, bool) { + return nil, false +} + +// AsSearchResultsAnswer is the BasicResponseBase implementation for SearchAction. +func (sa SearchAction) AsSearchResultsAnswer() (*SearchResultsAnswer, bool) { + return nil, false +} + +// AsBasicSearchResultsAnswer is the BasicResponseBase implementation for SearchAction. +func (sa SearchAction) AsBasicSearchResultsAnswer() (BasicSearchResultsAnswer, bool) { + return nil, false +} + +// AsAnswer is the BasicResponseBase implementation for SearchAction. +func (sa SearchAction) AsAnswer() (*Answer, bool) { + return nil, false +} + +// AsBasicAnswer is the BasicResponseBase implementation for SearchAction. +func (sa SearchAction) AsBasicAnswer() (BasicAnswer, bool) { + return nil, false +} + +// AsThing is the BasicResponseBase implementation for SearchAction. +func (sa SearchAction) AsThing() (*Thing, bool) { + return nil, false +} + +// AsBasicThing is the BasicResponseBase implementation for SearchAction. +func (sa SearchAction) AsBasicThing() (BasicThing, bool) { + return &sa, true +} + +// AsAction is the BasicResponseBase implementation for SearchAction. +func (sa SearchAction) AsAction() (*Action, bool) { + return nil, false +} + +// AsBasicAction is the BasicResponseBase implementation for SearchAction. +func (sa SearchAction) AsBasicAction() (BasicAction, bool) { + return &sa, true +} + +// AsResponse is the BasicResponseBase implementation for SearchAction. +func (sa SearchAction) AsResponse() (*Response, bool) { + return nil, false +} + +// AsBasicResponse is the BasicResponseBase implementation for SearchAction. +func (sa SearchAction) AsBasicResponse() (BasicResponse, bool) { + return &sa, true +} + +// AsIdentifiable is the BasicResponseBase implementation for SearchAction. +func (sa SearchAction) AsIdentifiable() (*Identifiable, bool) { + return nil, false +} + +// AsBasicIdentifiable is the BasicResponseBase implementation for SearchAction. +func (sa SearchAction) AsBasicIdentifiable() (BasicIdentifiable, bool) { + return &sa, true +} + +// AsErrorResponse is the BasicResponseBase implementation for SearchAction. +func (sa SearchAction) AsErrorResponse() (*ErrorResponse, bool) { + return nil, false +} + +// AsCreativeWork is the BasicResponseBase implementation for SearchAction. +func (sa SearchAction) AsCreativeWork() (*CreativeWork, bool) { + return nil, false +} + +// AsBasicCreativeWork is the BasicResponseBase implementation for SearchAction. +func (sa SearchAction) AsBasicCreativeWork() (BasicCreativeWork, bool) { + return &sa, true +} + +// AsResponseBase is the BasicResponseBase implementation for SearchAction. +func (sa SearchAction) AsResponseBase() (*ResponseBase, bool) { + return nil, false +} + +// AsBasicResponseBase is the BasicResponseBase implementation for SearchAction. +func (sa SearchAction) AsBasicResponseBase() (BasicResponseBase, bool) { + return &sa, true +} + +// UnmarshalJSON is the custom unmarshaler for SearchAction struct. +func (sa *SearchAction) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "displayText": + if v != nil { + var displayText string + err = json.Unmarshal(*v, &displayText) + if err != nil { + return err + } + sa.DisplayText = &displayText + } + case "query": + if v != nil { + var query string + err = json.Unmarshal(*v, &query) + if err != nil { + return err + } + sa.Query = &query + } + case "searchKind": + if v != nil { + var searchKind SearchKind + err = json.Unmarshal(*v, &searchKind) + if err != nil { + return err + } + sa.SearchKind = searchKind + } + case "result": + if v != nil { + resultVar, err := unmarshalBasicThingArray(*v) + if err != nil { + return err + } + sa.Result = &resultVar + } + case "displayName": + if v != nil { + var displayName string + err = json.Unmarshal(*v, &displayName) + if err != nil { + return err + } + sa.DisplayName = &displayName + } + case "isTopAction": + if v != nil { + var isTopAction bool + err = json.Unmarshal(*v, &isTopAction) + if err != nil { + return err + } + sa.IsTopAction = &isTopAction + } + case "serviceUrl": + if v != nil { + var serviceURL string + err = json.Unmarshal(*v, &serviceURL) + if err != nil { + return err + } + sa.ServiceURL = &serviceURL + } + case "thumbnailUrl": + if v != nil { + var thumbnailURL string + err = json.Unmarshal(*v, &thumbnailURL) + if err != nil { + return err + } + sa.ThumbnailURL = &thumbnailURL + } + case "about": + if v != nil { + about, err := unmarshalBasicThingArray(*v) + if err != nil { + return err + } + sa.About = &about + } + case "mentions": + if v != nil { + mentions, err := unmarshalBasicThingArray(*v) + if err != nil { + return err + } + sa.Mentions = &mentions + } + case "provider": + if v != nil { + provider, err := unmarshalBasicThingArray(*v) + if err != nil { + return err + } + sa.Provider = &provider + } + case "creator": + if v != nil { + creator, err := unmarshalBasicThing(*v) + if err != nil { + return err + } + sa.Creator = creator + } + case "text": + if v != nil { + var textVar string + err = json.Unmarshal(*v, &textVar) + if err != nil { + return err + } + sa.Text = &textVar + } + case "discussionUrl": + if v != nil { + var discussionURL string + err = json.Unmarshal(*v, &discussionURL) + if err != nil { + return err + } + sa.DiscussionURL = &discussionURL + } + case "commentCount": + if v != nil { + var commentCount int32 + err = json.Unmarshal(*v, &commentCount) + if err != nil { + return err + } + sa.CommentCount = &commentCount + } + case "mainEntity": + if v != nil { + mainEntity, err := unmarshalBasicThing(*v) + if err != nil { + return err + } + sa.MainEntity = mainEntity + } + case "headLine": + if v != nil { + var headLine string + err = json.Unmarshal(*v, &headLine) + if err != nil { + return err + } + sa.HeadLine = &headLine + } + case "copyrightHolder": + if v != nil { + copyrightHolder, err := unmarshalBasicThing(*v) + if err != nil { + return err + } + sa.CopyrightHolder = copyrightHolder + } + case "copyrightYear": + if v != nil { + var copyrightYear int32 + err = json.Unmarshal(*v, ©rightYear) + if err != nil { + return err + } + sa.CopyrightYear = ©rightYear + } + case "disclaimer": + if v != nil { + var disclaimer string + err = json.Unmarshal(*v, &disclaimer) + if err != nil { + return err + } + sa.Disclaimer = &disclaimer + } + case "isAccessibleForFree": + if v != nil { + var isAccessibleForFree bool + err = json.Unmarshal(*v, &isAccessibleForFree) + if err != nil { + return err + } + sa.IsAccessibleForFree = &isAccessibleForFree + } + case "genre": + if v != nil { + var genre []string + err = json.Unmarshal(*v, &genre) + if err != nil { + return err + } + sa.Genre = &genre + } + case "isFamilyFriendly": + if v != nil { + var isFamilyFriendly bool + err = json.Unmarshal(*v, &isFamilyFriendly) + if err != nil { + return err + } + sa.IsFamilyFriendly = &isFamilyFriendly + } + case "url": + if v != nil { + var URL string + err = json.Unmarshal(*v, &URL) + if err != nil { + return err + } + sa.URL = &URL + } + case "readLink": + if v != nil { + var readLink string + err = json.Unmarshal(*v, &readLink) + if err != nil { + return err + } + sa.ReadLink = &readLink + } + case "webSearchUrl": + if v != nil { + var webSearchURL string + err = json.Unmarshal(*v, &webSearchURL) + if err != nil { + return err + } + sa.WebSearchURL = &webSearchURL + } + case "potentialAction": + if v != nil { + potentialAction, err := unmarshalBasicActionArray(*v) + if err != nil { + return err + } + sa.PotentialAction = &potentialAction + } + case "immediateAction": + if v != nil { + immediateAction, err := unmarshalBasicActionArray(*v) + if err != nil { + return err + } + sa.ImmediateAction = &immediateAction + } + case "preferredClickthroughUrl": + if v != nil { + var preferredClickthroughURL string + err = json.Unmarshal(*v, &preferredClickthroughURL) + if err != nil { + return err + } + sa.PreferredClickthroughURL = &preferredClickthroughURL + } + case "adaptiveCard": + if v != nil { + var adaptiveCard string + err = json.Unmarshal(*v, &adaptiveCard) + if err != nil { + return err + } + sa.AdaptiveCard = &adaptiveCard + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + sa.ID = &ID + } + case "_type": + if v != nil { + var typeVar TypeBasicResponseBase + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + sa.Type = typeVar + } + } + } + + return nil +} + +// BasicSearchResultsAnswer defines a search result answer. +type BasicSearchResultsAnswer interface { + AsSuggestions() (*Suggestions, bool) + AsSearchResultsAnswer() (*SearchResultsAnswer, bool) +} + +// SearchResultsAnswer defines a search result answer. +type SearchResultsAnswer struct { + QueryContext BasicQueryContext `json:"queryContext,omitempty"` + // ReadLink - The URL that returns this resource. + ReadLink *string `json:"readLink,omitempty"` + // WebSearchURL - The URL To Bing's search result for this item. + WebSearchURL *string `json:"webSearchUrl,omitempty"` + PotentialAction *[]BasicAction `json:"potentialAction,omitempty"` + ImmediateAction *[]BasicAction `json:"immediateAction,omitempty"` + PreferredClickthroughURL *string `json:"preferredClickthroughUrl,omitempty"` + AdaptiveCard *string `json:"adaptiveCard,omitempty"` + // ID - A String identifier. + ID *string `json:"id,omitempty"` + // Type - Possible values include: 'TypeResponseBase', 'TypeSearchAction', 'TypeSuggestions', 'TypeSearchResultsAnswer', 'TypeAnswer', 'TypeThing', 'TypeAction', 'TypeResponse', 'TypeIdentifiable', 'TypeErrorResponse', 'TypeCreativeWork' + Type TypeBasicResponseBase `json:"_type,omitempty"` +} + +func unmarshalBasicSearchResultsAnswer(body []byte) (BasicSearchResultsAnswer, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["_type"] { + case string(TypeSuggestions): + var s Suggestions + err := json.Unmarshal(body, &s) + return s, err + default: + var sra SearchResultsAnswer + err := json.Unmarshal(body, &sra) + return sra, err + } +} +func unmarshalBasicSearchResultsAnswerArray(body []byte) ([]BasicSearchResultsAnswer, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + sraArray := make([]BasicSearchResultsAnswer, len(rawMessages)) + + for index, rawMessage := range rawMessages { + sra, err := unmarshalBasicSearchResultsAnswer(*rawMessage) + if err != nil { + return nil, err + } + sraArray[index] = sra + } + return sraArray, nil +} + +// MarshalJSON is the custom marshaler for SearchResultsAnswer. +func (sra SearchResultsAnswer) MarshalJSON() ([]byte, error) { + sra.Type = TypeSearchResultsAnswer + objectMap := make(map[string]interface{}) + objectMap["queryContext"] = sra.QueryContext + if sra.ReadLink != nil { + objectMap["readLink"] = sra.ReadLink + } + if sra.WebSearchURL != nil { + objectMap["webSearchUrl"] = sra.WebSearchURL + } + if sra.PotentialAction != nil { + objectMap["potentialAction"] = sra.PotentialAction + } + if sra.ImmediateAction != nil { + objectMap["immediateAction"] = sra.ImmediateAction + } + if sra.PreferredClickthroughURL != nil { + objectMap["preferredClickthroughUrl"] = sra.PreferredClickthroughURL + } + if sra.AdaptiveCard != nil { + objectMap["adaptiveCard"] = sra.AdaptiveCard + } + if sra.ID != nil { + objectMap["id"] = sra.ID + } + if sra.Type != "" { + objectMap["_type"] = sra.Type + } + return json.Marshal(objectMap) +} + +// AsSearchAction is the BasicResponseBase implementation for SearchResultsAnswer. +func (sra SearchResultsAnswer) AsSearchAction() (*SearchAction, bool) { + return nil, false +} + +// AsSuggestions is the BasicResponseBase implementation for SearchResultsAnswer. +func (sra SearchResultsAnswer) AsSuggestions() (*Suggestions, bool) { + return nil, false +} + +// AsSearchResultsAnswer is the BasicResponseBase implementation for SearchResultsAnswer. +func (sra SearchResultsAnswer) AsSearchResultsAnswer() (*SearchResultsAnswer, bool) { + return &sra, true +} + +// AsBasicSearchResultsAnswer is the BasicResponseBase implementation for SearchResultsAnswer. +func (sra SearchResultsAnswer) AsBasicSearchResultsAnswer() (BasicSearchResultsAnswer, bool) { + return &sra, true +} + +// AsAnswer is the BasicResponseBase implementation for SearchResultsAnswer. +func (sra SearchResultsAnswer) AsAnswer() (*Answer, bool) { + return nil, false +} + +// AsBasicAnswer is the BasicResponseBase implementation for SearchResultsAnswer. +func (sra SearchResultsAnswer) AsBasicAnswer() (BasicAnswer, bool) { + return &sra, true +} + +// AsThing is the BasicResponseBase implementation for SearchResultsAnswer. +func (sra SearchResultsAnswer) AsThing() (*Thing, bool) { + return nil, false +} + +// AsBasicThing is the BasicResponseBase implementation for SearchResultsAnswer. +func (sra SearchResultsAnswer) AsBasicThing() (BasicThing, bool) { + return nil, false +} + +// AsAction is the BasicResponseBase implementation for SearchResultsAnswer. +func (sra SearchResultsAnswer) AsAction() (*Action, bool) { + return nil, false +} + +// AsBasicAction is the BasicResponseBase implementation for SearchResultsAnswer. +func (sra SearchResultsAnswer) AsBasicAction() (BasicAction, bool) { + return nil, false +} + +// AsResponse is the BasicResponseBase implementation for SearchResultsAnswer. +func (sra SearchResultsAnswer) AsResponse() (*Response, bool) { + return nil, false +} + +// AsBasicResponse is the BasicResponseBase implementation for SearchResultsAnswer. +func (sra SearchResultsAnswer) AsBasicResponse() (BasicResponse, bool) { + return &sra, true +} + +// AsIdentifiable is the BasicResponseBase implementation for SearchResultsAnswer. +func (sra SearchResultsAnswer) AsIdentifiable() (*Identifiable, bool) { + return nil, false +} + +// AsBasicIdentifiable is the BasicResponseBase implementation for SearchResultsAnswer. +func (sra SearchResultsAnswer) AsBasicIdentifiable() (BasicIdentifiable, bool) { + return &sra, true +} + +// AsErrorResponse is the BasicResponseBase implementation for SearchResultsAnswer. +func (sra SearchResultsAnswer) AsErrorResponse() (*ErrorResponse, bool) { + return nil, false +} + +// AsCreativeWork is the BasicResponseBase implementation for SearchResultsAnswer. +func (sra SearchResultsAnswer) AsCreativeWork() (*CreativeWork, bool) { + return nil, false +} + +// AsBasicCreativeWork is the BasicResponseBase implementation for SearchResultsAnswer. +func (sra SearchResultsAnswer) AsBasicCreativeWork() (BasicCreativeWork, bool) { + return nil, false +} + +// AsResponseBase is the BasicResponseBase implementation for SearchResultsAnswer. +func (sra SearchResultsAnswer) AsResponseBase() (*ResponseBase, bool) { + return nil, false +} + +// AsBasicResponseBase is the BasicResponseBase implementation for SearchResultsAnswer. +func (sra SearchResultsAnswer) AsBasicResponseBase() (BasicResponseBase, bool) { + return &sra, true +} + +// UnmarshalJSON is the custom unmarshaler for SearchResultsAnswer struct. +func (sra *SearchResultsAnswer) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "queryContext": + if v != nil { + queryContext, err := unmarshalBasicQueryContext(*v) + if err != nil { + return err + } + sra.QueryContext = queryContext + } + case "readLink": + if v != nil { + var readLink string + err = json.Unmarshal(*v, &readLink) + if err != nil { + return err + } + sra.ReadLink = &readLink + } + case "webSearchUrl": + if v != nil { + var webSearchURL string + err = json.Unmarshal(*v, &webSearchURL) + if err != nil { + return err + } + sra.WebSearchURL = &webSearchURL + } + case "potentialAction": + if v != nil { + potentialAction, err := unmarshalBasicActionArray(*v) + if err != nil { + return err + } + sra.PotentialAction = &potentialAction + } + case "immediateAction": + if v != nil { + immediateAction, err := unmarshalBasicActionArray(*v) + if err != nil { + return err + } + sra.ImmediateAction = &immediateAction + } + case "preferredClickthroughUrl": + if v != nil { + var preferredClickthroughURL string + err = json.Unmarshal(*v, &preferredClickthroughURL) + if err != nil { + return err + } + sra.PreferredClickthroughURL = &preferredClickthroughURL + } + case "adaptiveCard": + if v != nil { + var adaptiveCard string + err = json.Unmarshal(*v, &adaptiveCard) + if err != nil { + return err + } + sra.AdaptiveCard = &adaptiveCard + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + sra.ID = &ID + } + case "_type": + if v != nil { + var typeVar TypeBasicResponseBase + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + sra.Type = typeVar + } + } + } + + return nil +} + +// Suggestions ... +type Suggestions struct { + autorest.Response `json:"-"` + SuggestionGroups *[]BasicSuggestionsSuggestionGroup `json:"suggestionGroups,omitempty"` + QueryContext BasicQueryContext `json:"queryContext,omitempty"` + // ReadLink - The URL that returns this resource. + ReadLink *string `json:"readLink,omitempty"` + // WebSearchURL - The URL To Bing's search result for this item. + WebSearchURL *string `json:"webSearchUrl,omitempty"` + PotentialAction *[]BasicAction `json:"potentialAction,omitempty"` + ImmediateAction *[]BasicAction `json:"immediateAction,omitempty"` + PreferredClickthroughURL *string `json:"preferredClickthroughUrl,omitempty"` + AdaptiveCard *string `json:"adaptiveCard,omitempty"` + // ID - A String identifier. + ID *string `json:"id,omitempty"` + // Type - Possible values include: 'TypeResponseBase', 'TypeSearchAction', 'TypeSuggestions', 'TypeSearchResultsAnswer', 'TypeAnswer', 'TypeThing', 'TypeAction', 'TypeResponse', 'TypeIdentifiable', 'TypeErrorResponse', 'TypeCreativeWork' + Type TypeBasicResponseBase `json:"_type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Suggestions. +func (s Suggestions) MarshalJSON() ([]byte, error) { + s.Type = TypeSuggestions + objectMap := make(map[string]interface{}) + if s.SuggestionGroups != nil { + objectMap["suggestionGroups"] = s.SuggestionGroups + } + objectMap["queryContext"] = s.QueryContext + if s.ReadLink != nil { + objectMap["readLink"] = s.ReadLink + } + if s.WebSearchURL != nil { + objectMap["webSearchUrl"] = s.WebSearchURL + } + if s.PotentialAction != nil { + objectMap["potentialAction"] = s.PotentialAction + } + if s.ImmediateAction != nil { + objectMap["immediateAction"] = s.ImmediateAction + } + if s.PreferredClickthroughURL != nil { + objectMap["preferredClickthroughUrl"] = s.PreferredClickthroughURL + } + if s.AdaptiveCard != nil { + objectMap["adaptiveCard"] = s.AdaptiveCard + } + if s.ID != nil { + objectMap["id"] = s.ID + } + if s.Type != "" { + objectMap["_type"] = s.Type + } + return json.Marshal(objectMap) +} + +// AsSearchAction is the BasicResponseBase implementation for Suggestions. +func (s Suggestions) AsSearchAction() (*SearchAction, bool) { + return nil, false +} + +// AsSuggestions is the BasicResponseBase implementation for Suggestions. +func (s Suggestions) AsSuggestions() (*Suggestions, bool) { + return &s, true +} + +// AsSearchResultsAnswer is the BasicResponseBase implementation for Suggestions. +func (s Suggestions) AsSearchResultsAnswer() (*SearchResultsAnswer, bool) { + return nil, false +} + +// AsBasicSearchResultsAnswer is the BasicResponseBase implementation for Suggestions. +func (s Suggestions) AsBasicSearchResultsAnswer() (BasicSearchResultsAnswer, bool) { + return &s, true +} + +// AsAnswer is the BasicResponseBase implementation for Suggestions. +func (s Suggestions) AsAnswer() (*Answer, bool) { + return nil, false +} + +// AsBasicAnswer is the BasicResponseBase implementation for Suggestions. +func (s Suggestions) AsBasicAnswer() (BasicAnswer, bool) { + return &s, true +} + +// AsThing is the BasicResponseBase implementation for Suggestions. +func (s Suggestions) AsThing() (*Thing, bool) { + return nil, false +} + +// AsBasicThing is the BasicResponseBase implementation for Suggestions. +func (s Suggestions) AsBasicThing() (BasicThing, bool) { + return nil, false +} + +// AsAction is the BasicResponseBase implementation for Suggestions. +func (s Suggestions) AsAction() (*Action, bool) { + return nil, false +} + +// AsBasicAction is the BasicResponseBase implementation for Suggestions. +func (s Suggestions) AsBasicAction() (BasicAction, bool) { + return nil, false +} + +// AsResponse is the BasicResponseBase implementation for Suggestions. +func (s Suggestions) AsResponse() (*Response, bool) { + return nil, false +} + +// AsBasicResponse is the BasicResponseBase implementation for Suggestions. +func (s Suggestions) AsBasicResponse() (BasicResponse, bool) { + return &s, true +} + +// AsIdentifiable is the BasicResponseBase implementation for Suggestions. +func (s Suggestions) AsIdentifiable() (*Identifiable, bool) { + return nil, false +} + +// AsBasicIdentifiable is the BasicResponseBase implementation for Suggestions. +func (s Suggestions) AsBasicIdentifiable() (BasicIdentifiable, bool) { + return &s, true +} + +// AsErrorResponse is the BasicResponseBase implementation for Suggestions. +func (s Suggestions) AsErrorResponse() (*ErrorResponse, bool) { + return nil, false +} + +// AsCreativeWork is the BasicResponseBase implementation for Suggestions. +func (s Suggestions) AsCreativeWork() (*CreativeWork, bool) { + return nil, false +} + +// AsBasicCreativeWork is the BasicResponseBase implementation for Suggestions. +func (s Suggestions) AsBasicCreativeWork() (BasicCreativeWork, bool) { + return nil, false +} + +// AsResponseBase is the BasicResponseBase implementation for Suggestions. +func (s Suggestions) AsResponseBase() (*ResponseBase, bool) { + return nil, false +} + +// AsBasicResponseBase is the BasicResponseBase implementation for Suggestions. +func (s Suggestions) AsBasicResponseBase() (BasicResponseBase, bool) { + return &s, true +} + +// UnmarshalJSON is the custom unmarshaler for Suggestions struct. +func (s *Suggestions) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "suggestionGroups": + if v != nil { + suggestionGroups, err := unmarshalBasicSuggestionsSuggestionGroupArray(*v) + if err != nil { + return err + } + s.SuggestionGroups = &suggestionGroups + } + case "queryContext": + if v != nil { + queryContext, err := unmarshalBasicQueryContext(*v) + if err != nil { + return err + } + s.QueryContext = queryContext + } + case "readLink": + if v != nil { + var readLink string + err = json.Unmarshal(*v, &readLink) + if err != nil { + return err + } + s.ReadLink = &readLink + } + case "webSearchUrl": + if v != nil { + var webSearchURL string + err = json.Unmarshal(*v, &webSearchURL) + if err != nil { + return err + } + s.WebSearchURL = &webSearchURL + } + case "potentialAction": + if v != nil { + potentialAction, err := unmarshalBasicActionArray(*v) + if err != nil { + return err + } + s.PotentialAction = &potentialAction + } + case "immediateAction": + if v != nil { + immediateAction, err := unmarshalBasicActionArray(*v) + if err != nil { + return err + } + s.ImmediateAction = &immediateAction + } + case "preferredClickthroughUrl": + if v != nil { + var preferredClickthroughURL string + err = json.Unmarshal(*v, &preferredClickthroughURL) + if err != nil { + return err + } + s.PreferredClickthroughURL = &preferredClickthroughURL + } + case "adaptiveCard": + if v != nil { + var adaptiveCard string + err = json.Unmarshal(*v, &adaptiveCard) + if err != nil { + return err + } + s.AdaptiveCard = &adaptiveCard + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + s.ID = &ID + } + case "_type": + if v != nil { + var typeVar TypeBasicResponseBase + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + s.Type = typeVar + } + } + } + + return nil +} + +// BasicSuggestionsSuggestionGroup ... +type BasicSuggestionsSuggestionGroup interface { + AsSuggestionsSuggestionGroup() (*SuggestionsSuggestionGroup, bool) +} + +// SuggestionsSuggestionGroup ... +type SuggestionsSuggestionGroup struct { + // Name - Possible values include: 'Unknown', 'Web', 'StoreApps', 'SearchHistory', 'PersonalSearchDocuments', 'PersonalSearchTags', 'Custom' + Name ScenarioType `json:"name,omitempty"` + SearchSuggestions *[]SearchAction `json:"searchSuggestions,omitempty"` + // Type - Possible values include: 'TypeSuggestionsSuggestionGroup' + Type Type `json:"_type,omitempty"` +} + +func unmarshalBasicSuggestionsSuggestionGroup(body []byte) (BasicSuggestionsSuggestionGroup, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["_type"] { + default: + var ssg SuggestionsSuggestionGroup + err := json.Unmarshal(body, &ssg) + return ssg, err + } +} +func unmarshalBasicSuggestionsSuggestionGroupArray(body []byte) ([]BasicSuggestionsSuggestionGroup, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + ssgArray := make([]BasicSuggestionsSuggestionGroup, len(rawMessages)) + + for index, rawMessage := range rawMessages { + ssg, err := unmarshalBasicSuggestionsSuggestionGroup(*rawMessage) + if err != nil { + return nil, err + } + ssgArray[index] = ssg + } + return ssgArray, nil +} + +// MarshalJSON is the custom marshaler for SuggestionsSuggestionGroup. +func (ssg SuggestionsSuggestionGroup) MarshalJSON() ([]byte, error) { + ssg.Type = TypeSuggestionsSuggestionGroup + objectMap := make(map[string]interface{}) + if ssg.Name != "" { + objectMap["name"] = ssg.Name + } + if ssg.SearchSuggestions != nil { + objectMap["searchSuggestions"] = ssg.SearchSuggestions + } + if ssg.Type != "" { + objectMap["_type"] = ssg.Type + } + return json.Marshal(objectMap) +} + +// AsSuggestionsSuggestionGroup is the BasicSuggestionsSuggestionGroup implementation for SuggestionsSuggestionGroup. +func (ssg SuggestionsSuggestionGroup) AsSuggestionsSuggestionGroup() (*SuggestionsSuggestionGroup, bool) { + return &ssg, true +} + +// AsBasicSuggestionsSuggestionGroup is the BasicSuggestionsSuggestionGroup implementation for SuggestionsSuggestionGroup. +func (ssg SuggestionsSuggestionGroup) AsBasicSuggestionsSuggestionGroup() (BasicSuggestionsSuggestionGroup, bool) { + return &ssg, true +} + +// BasicThing defines a thing. +type BasicThing interface { + AsSearchAction() (*SearchAction, bool) + AsAction() (*Action, bool) + AsBasicAction() (BasicAction, bool) + AsCreativeWork() (*CreativeWork, bool) + AsBasicCreativeWork() (BasicCreativeWork, bool) + AsThing() (*Thing, bool) +} + +// Thing defines a thing. +type Thing struct { + // URL - The URL to get more information about the thing represented by this object. + URL *string `json:"url,omitempty"` + // ReadLink - The URL that returns this resource. + ReadLink *string `json:"readLink,omitempty"` + // WebSearchURL - The URL To Bing's search result for this item. + WebSearchURL *string `json:"webSearchUrl,omitempty"` + PotentialAction *[]BasicAction `json:"potentialAction,omitempty"` + ImmediateAction *[]BasicAction `json:"immediateAction,omitempty"` + PreferredClickthroughURL *string `json:"preferredClickthroughUrl,omitempty"` + AdaptiveCard *string `json:"adaptiveCard,omitempty"` + // ID - A String identifier. + ID *string `json:"id,omitempty"` + // Type - Possible values include: 'TypeResponseBase', 'TypeSearchAction', 'TypeSuggestions', 'TypeSearchResultsAnswer', 'TypeAnswer', 'TypeThing', 'TypeAction', 'TypeResponse', 'TypeIdentifiable', 'TypeErrorResponse', 'TypeCreativeWork' + Type TypeBasicResponseBase `json:"_type,omitempty"` +} + +func unmarshalBasicThing(body []byte) (BasicThing, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["_type"] { + case string(TypeSearchAction): + var sa SearchAction + err := json.Unmarshal(body, &sa) + return sa, err + case string(TypeAction): + var a Action + err := json.Unmarshal(body, &a) + return a, err + case string(TypeCreativeWork): + var cw CreativeWork + err := json.Unmarshal(body, &cw) + return cw, err + default: + var t Thing + err := json.Unmarshal(body, &t) + return t, err + } +} +func unmarshalBasicThingArray(body []byte) ([]BasicThing, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + tArray := make([]BasicThing, len(rawMessages)) + + for index, rawMessage := range rawMessages { + t, err := unmarshalBasicThing(*rawMessage) + if err != nil { + return nil, err + } + tArray[index] = t + } + return tArray, nil +} + +// MarshalJSON is the custom marshaler for Thing. +func (t Thing) MarshalJSON() ([]byte, error) { + t.Type = TypeThing + objectMap := make(map[string]interface{}) + if t.URL != nil { + objectMap["url"] = t.URL + } + if t.ReadLink != nil { + objectMap["readLink"] = t.ReadLink + } + if t.WebSearchURL != nil { + objectMap["webSearchUrl"] = t.WebSearchURL + } + if t.PotentialAction != nil { + objectMap["potentialAction"] = t.PotentialAction + } + if t.ImmediateAction != nil { + objectMap["immediateAction"] = t.ImmediateAction + } + if t.PreferredClickthroughURL != nil { + objectMap["preferredClickthroughUrl"] = t.PreferredClickthroughURL + } + if t.AdaptiveCard != nil { + objectMap["adaptiveCard"] = t.AdaptiveCard + } + if t.ID != nil { + objectMap["id"] = t.ID + } + if t.Type != "" { + objectMap["_type"] = t.Type + } + return json.Marshal(objectMap) +} + +// AsSearchAction is the BasicResponseBase implementation for Thing. +func (t Thing) AsSearchAction() (*SearchAction, bool) { + return nil, false +} + +// AsSuggestions is the BasicResponseBase implementation for Thing. +func (t Thing) AsSuggestions() (*Suggestions, bool) { + return nil, false +} + +// AsSearchResultsAnswer is the BasicResponseBase implementation for Thing. +func (t Thing) AsSearchResultsAnswer() (*SearchResultsAnswer, bool) { + return nil, false +} + +// AsBasicSearchResultsAnswer is the BasicResponseBase implementation for Thing. +func (t Thing) AsBasicSearchResultsAnswer() (BasicSearchResultsAnswer, bool) { + return nil, false +} + +// AsAnswer is the BasicResponseBase implementation for Thing. +func (t Thing) AsAnswer() (*Answer, bool) { + return nil, false +} + +// AsBasicAnswer is the BasicResponseBase implementation for Thing. +func (t Thing) AsBasicAnswer() (BasicAnswer, bool) { + return nil, false +} + +// AsThing is the BasicResponseBase implementation for Thing. +func (t Thing) AsThing() (*Thing, bool) { + return &t, true +} + +// AsBasicThing is the BasicResponseBase implementation for Thing. +func (t Thing) AsBasicThing() (BasicThing, bool) { + return &t, true +} + +// AsAction is the BasicResponseBase implementation for Thing. +func (t Thing) AsAction() (*Action, bool) { + return nil, false +} + +// AsBasicAction is the BasicResponseBase implementation for Thing. +func (t Thing) AsBasicAction() (BasicAction, bool) { + return nil, false +} + +// AsResponse is the BasicResponseBase implementation for Thing. +func (t Thing) AsResponse() (*Response, bool) { + return nil, false +} + +// AsBasicResponse is the BasicResponseBase implementation for Thing. +func (t Thing) AsBasicResponse() (BasicResponse, bool) { + return &t, true +} + +// AsIdentifiable is the BasicResponseBase implementation for Thing. +func (t Thing) AsIdentifiable() (*Identifiable, bool) { + return nil, false +} + +// AsBasicIdentifiable is the BasicResponseBase implementation for Thing. +func (t Thing) AsBasicIdentifiable() (BasicIdentifiable, bool) { + return &t, true +} + +// AsErrorResponse is the BasicResponseBase implementation for Thing. +func (t Thing) AsErrorResponse() (*ErrorResponse, bool) { + return nil, false +} + +// AsCreativeWork is the BasicResponseBase implementation for Thing. +func (t Thing) AsCreativeWork() (*CreativeWork, bool) { + return nil, false +} + +// AsBasicCreativeWork is the BasicResponseBase implementation for Thing. +func (t Thing) AsBasicCreativeWork() (BasicCreativeWork, bool) { + return nil, false +} + +// AsResponseBase is the BasicResponseBase implementation for Thing. +func (t Thing) AsResponseBase() (*ResponseBase, bool) { + return nil, false +} + +// AsBasicResponseBase is the BasicResponseBase implementation for Thing. +func (t Thing) AsBasicResponseBase() (BasicResponseBase, bool) { + return &t, true +} + +// UnmarshalJSON is the custom unmarshaler for Thing struct. +func (t *Thing) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "url": + if v != nil { + var URL string + err = json.Unmarshal(*v, &URL) + if err != nil { + return err + } + t.URL = &URL + } + case "readLink": + if v != nil { + var readLink string + err = json.Unmarshal(*v, &readLink) + if err != nil { + return err + } + t.ReadLink = &readLink + } + case "webSearchUrl": + if v != nil { + var webSearchURL string + err = json.Unmarshal(*v, &webSearchURL) + if err != nil { + return err + } + t.WebSearchURL = &webSearchURL + } + case "potentialAction": + if v != nil { + potentialAction, err := unmarshalBasicActionArray(*v) + if err != nil { + return err + } + t.PotentialAction = &potentialAction + } + case "immediateAction": + if v != nil { + immediateAction, err := unmarshalBasicActionArray(*v) + if err != nil { + return err + } + t.ImmediateAction = &immediateAction + } + case "preferredClickthroughUrl": + if v != nil { + var preferredClickthroughURL string + err = json.Unmarshal(*v, &preferredClickthroughURL) + if err != nil { + return err + } + t.PreferredClickthroughURL = &preferredClickthroughURL + } + case "adaptiveCard": + if v != nil { + var adaptiveCard string + err = json.Unmarshal(*v, &adaptiveCard) + if err != nil { + return err + } + t.AdaptiveCard = &adaptiveCard + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + t.ID = &ID + } + case "_type": + if v != nil { + var typeVar TypeBasicResponseBase + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + t.Type = typeVar + } + } + } + + return nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v1.0/autosuggest/version.go b/vendor/github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v1.0/autosuggest/version.go new file mode 100644 index 000000000..f4e33a678 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v1.0/autosuggest/version.go @@ -0,0 +1,30 @@ +package autosuggest + +import "github.com/Azure/azure-sdk-for-go/version" + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// UserAgent returns the UserAgent string to use when sending http.Requests. +func UserAgent() string { + return "Azure-SDK-For-Go/" + version.Number + " autosuggest/1.0" +} + +// Version returns the semantic version (see http://semver.org) of the client. +func Version() string { + return version.Number +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v1.0/computervision/client.go b/vendor/github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v1.0/computervision/client.go index 5c695f7e7..495cefecc 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v1.0/computervision/client.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v1.0/computervision/client.go @@ -70,8 +70,8 @@ func NewWithoutDefaults(azureRegion AzureRegions) BaseClient { // comma-separated. Valid visual feature types include:Celebrities - identifies celebrities if detected in the // image. // language - the desired language for output generation. If this parameter is not specified, the default value -// is "en".Supported languages:en - English, Default.ja - Japanese pt - Portuguese zh - Simplified -// Chinese. +// is "en".Supported languages:en - English, Default. es - Spanish, ja - Japanese, pt - Portuguese, +// zh - Simplified Chinese. func (client BaseClient) AnalyzeImage(ctx context.Context, imageURL ImageURL, visualFeatures []VisualFeatureTypes, details []Details, language string) (result ImageAnalysis, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: imageURL, @@ -157,14 +157,17 @@ func (client BaseClient) AnalyzeImageResponder(resp *http.Response) (result Imag // Parameters: // model - the domain-specific content to recognize. // imageURL - a JSON document with a URL pointing to the image that is to be analyzed. -func (client BaseClient) AnalyzeImageByDomain(ctx context.Context, model DomainModels, imageURL ImageURL) (result DomainModelResults, err error) { +// language - the desired language for output generation. If this parameter is not specified, the default value +// is "en".Supported languages:en - English, Default. es - Spanish, ja - Japanese, pt - Portuguese, +// zh - Simplified Chinese. +func (client BaseClient) AnalyzeImageByDomain(ctx context.Context, model string, imageURL ImageURL, language string) (result DomainModelResults, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: imageURL, Constraints: []validation.Constraint{{Target: "imageURL.URL", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { return result, validation.NewError("computervision.BaseClient", "AnalyzeImageByDomain", err.Error()) } - req, err := client.AnalyzeImageByDomainPreparer(ctx, model, imageURL) + req, err := client.AnalyzeImageByDomainPreparer(ctx, model, imageURL, language) if err != nil { err = autorest.NewErrorWithError(err, "computervision.BaseClient", "AnalyzeImageByDomain", nil, "Failure preparing request") return @@ -186,7 +189,7 @@ func (client BaseClient) AnalyzeImageByDomain(ctx context.Context, model DomainM } // AnalyzeImageByDomainPreparer prepares the AnalyzeImageByDomain request. -func (client BaseClient) AnalyzeImageByDomainPreparer(ctx context.Context, model DomainModels, imageURL ImageURL) (*http.Request, error) { +func (client BaseClient) AnalyzeImageByDomainPreparer(ctx context.Context, model string, imageURL ImageURL, language string) (*http.Request, error) { urlParameters := map[string]interface{}{ "AzureRegion": client.AzureRegion, } @@ -195,12 +198,20 @@ func (client BaseClient) AnalyzeImageByDomainPreparer(ctx context.Context, model "model": autorest.Encode("path", model), } + queryParameters := map[string]interface{}{} + if len(string(language)) > 0 { + queryParameters["language"] = autorest.Encode("query", language) + } else { + queryParameters["language"] = autorest.Encode("query", "en") + } + preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/vision/v1.0", urlParameters), autorest.WithPathParameters("/models/{model}/analyze", pathParameters), - autorest.WithJSON(imageURL)) + autorest.WithJSON(imageURL), + autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -232,8 +243,11 @@ func (client BaseClient) AnalyzeImageByDomainResponder(resp *http.Response) (res // Parameters: // model - the domain-specific content to recognize. // imageParameter - an image stream. -func (client BaseClient) AnalyzeImageByDomainInStream(ctx context.Context, model string, imageParameter io.ReadCloser) (result DomainModelResults, err error) { - req, err := client.AnalyzeImageByDomainInStreamPreparer(ctx, model, imageParameter) +// language - the desired language for output generation. If this parameter is not specified, the default value +// is "en".Supported languages:en - English, Default. es - Spanish, ja - Japanese, pt - Portuguese, +// zh - Simplified Chinese. +func (client BaseClient) AnalyzeImageByDomainInStream(ctx context.Context, model string, imageParameter io.ReadCloser, language string) (result DomainModelResults, err error) { + req, err := client.AnalyzeImageByDomainInStreamPreparer(ctx, model, imageParameter, language) if err != nil { err = autorest.NewErrorWithError(err, "computervision.BaseClient", "AnalyzeImageByDomainInStream", nil, "Failure preparing request") return @@ -255,7 +269,7 @@ func (client BaseClient) AnalyzeImageByDomainInStream(ctx context.Context, model } // AnalyzeImageByDomainInStreamPreparer prepares the AnalyzeImageByDomainInStream request. -func (client BaseClient) AnalyzeImageByDomainInStreamPreparer(ctx context.Context, model string, imageParameter io.ReadCloser) (*http.Request, error) { +func (client BaseClient) AnalyzeImageByDomainInStreamPreparer(ctx context.Context, model string, imageParameter io.ReadCloser, language string) (*http.Request, error) { urlParameters := map[string]interface{}{ "AzureRegion": client.AzureRegion, } @@ -264,12 +278,20 @@ func (client BaseClient) AnalyzeImageByDomainInStreamPreparer(ctx context.Contex "model": autorest.Encode("path", model), } + queryParameters := map[string]interface{}{} + if len(string(language)) > 0 { + queryParameters["language"] = autorest.Encode("query", language) + } else { + queryParameters["language"] = autorest.Encode("query", "en") + } + preparer := autorest.CreatePreparer( autorest.AsContentType("application/octet-stream"), autorest.AsPost(), autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/vision/v1.0", urlParameters), autorest.WithPathParameters("/models/{model}/analyze", pathParameters), - autorest.WithFile(imageParameter)) + autorest.WithFile(imageParameter), + autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -308,8 +330,8 @@ func (client BaseClient) AnalyzeImageByDomainInStreamResponder(resp *http.Respon // comma-separated. Valid visual feature types include:Celebrities - identifies celebrities if detected in the // image. // language - the desired language for output generation. If this parameter is not specified, the default value -// is "en".Supported languages:en - English, Default.ja - Japanese pt - Portuguese zh - Simplified -// Chinese. +// is "en".Supported languages:en - English, Default. es - Spanish, ja - Japanese, pt - Portuguese, +// zh - Simplified Chinese. func (client BaseClient) AnalyzeImageInStream(ctx context.Context, imageParameter io.ReadCloser, visualFeatures []VisualFeatureTypes, details string, language string) (result ImageAnalysis, err error) { req, err := client.AnalyzeImageInStreamPreparer(ctx, imageParameter, visualFeatures, details, language) if err != nil { @@ -391,8 +413,8 @@ func (client BaseClient) AnalyzeImageInStreamResponder(resp *http.Response) (res // imageURL - a JSON document with a URL pointing to the image that is to be analyzed. // maxCandidates - maximum number of candidate descriptions to be returned. The default is 1. // language - the desired language for output generation. If this parameter is not specified, the default value -// is "en".Supported languages:en - English, Default.ja - Japanese pt - Portuguese zh - Simplified -// Chinese. +// is "en".Supported languages:en - English, Default. es - Spanish, ja - Japanese, pt - Portuguese, +// zh - Simplified Chinese. func (client BaseClient) DescribeImage(ctx context.Context, imageURL ImageURL, maxCandidates string, language string) (result ImageDescription, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: imageURL, @@ -479,8 +501,8 @@ func (client BaseClient) DescribeImageResponder(resp *http.Response) (result Ima // imageParameter - an image stream. // maxCandidates - maximum number of candidate descriptions to be returned. The default is 1. // language - the desired language for output generation. If this parameter is not specified, the default value -// is "en".Supported languages:en - English, Default.ja - Japanese pt - Portuguese zh - Simplified -// Chinese. +// is "en".Supported languages:en - English, Default. es - Spanish, ja - Japanese, pt - Portuguese, +// zh - Simplified Chinese. func (client BaseClient) DescribeImageInStream(ctx context.Context, imageParameter io.ReadCloser, maxCandidates string, language string) (result ImageDescription, err error) { req, err := client.DescribeImageInStreamPreparer(ctx, imageParameter, maxCandidates, language) if err != nil { @@ -1167,8 +1189,8 @@ func (client BaseClient) RecognizeTextInStreamResponder(resp *http.Response) (re // Parameters: // imageURL - a JSON document with a URL pointing to the image that is to be analyzed. // language - the desired language for output generation. If this parameter is not specified, the default value -// is "en".Supported languages:en - English, Default.ja - Japanese pt - Portuguese zh - Simplified -// Chinese. +// is "en".Supported languages:en - English, Default. es - Spanish, ja - Japanese, pt - Portuguese, +// zh - Simplified Chinese. func (client BaseClient) TagImage(ctx context.Context, imageURL ImageURL, language string) (result TagResult, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: imageURL, @@ -1247,8 +1269,11 @@ func (client BaseClient) TagImageResponder(resp *http.Response) (result TagResul // accompanied by the hint 'musical instrument'. All tags are in English. // Parameters: // imageParameter - an image stream. -func (client BaseClient) TagImageInStream(ctx context.Context, imageParameter io.ReadCloser) (result TagResult, err error) { - req, err := client.TagImageInStreamPreparer(ctx, imageParameter) +// language - the desired language for output generation. If this parameter is not specified, the default value +// is "en".Supported languages:en - English, Default. es - Spanish, ja - Japanese, pt - Portuguese, +// zh - Simplified Chinese. +func (client BaseClient) TagImageInStream(ctx context.Context, imageParameter io.ReadCloser, language string) (result TagResult, err error) { + req, err := client.TagImageInStreamPreparer(ctx, imageParameter, language) if err != nil { err = autorest.NewErrorWithError(err, "computervision.BaseClient", "TagImageInStream", nil, "Failure preparing request") return @@ -1270,17 +1295,25 @@ func (client BaseClient) TagImageInStream(ctx context.Context, imageParameter io } // TagImageInStreamPreparer prepares the TagImageInStream request. -func (client BaseClient) TagImageInStreamPreparer(ctx context.Context, imageParameter io.ReadCloser) (*http.Request, error) { +func (client BaseClient) TagImageInStreamPreparer(ctx context.Context, imageParameter io.ReadCloser, language string) (*http.Request, error) { urlParameters := map[string]interface{}{ "AzureRegion": client.AzureRegion, } + queryParameters := map[string]interface{}{} + if len(string(language)) > 0 { + queryParameters["language"] = autorest.Encode("query", language) + } else { + queryParameters["language"] = autorest.Encode("query", "en") + } + preparer := autorest.CreatePreparer( autorest.AsContentType("application/octet-stream"), autorest.AsPost(), autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/vision/v1.0", urlParameters), autorest.WithPath("/tag"), - autorest.WithFile(imageParameter)) + autorest.WithFile(imageParameter), + autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v1.0/computervision/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v1.0/computervision/models.go index d342a5268..d740047c3 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v1.0/computervision/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v1.0/computervision/models.go @@ -73,21 +73,6 @@ func PossibleDetailsValues() []Details { return []Details{Celebrities, Landmarks} } -// DomainModels enumerates the values for domain models. -type DomainModels string - -const ( - // DomainModelsCelebrities ... - DomainModelsCelebrities DomainModels = "Celebrities" - // DomainModelsLandmarks ... - DomainModelsLandmarks DomainModels = "Landmarks" -) - -// PossibleDomainModelsValues returns an array of possible values for the DomainModels const type. -func PossibleDomainModelsValues() []DomainModels { - return []DomainModels{DomainModelsCelebrities, DomainModelsLandmarks} -} - // ErrorCodes enumerates the values for error codes. type ErrorCodes string @@ -285,6 +270,14 @@ type CelebritiesModel struct { FaceRectangle *FaceRectangle `json:"faceRectangle,omitempty"` } +// CelebrityResults list of celebrities recognized in the image. +type CelebrityResults struct { + Celebrities *[]CelebritiesModel `json:"celebrities,omitempty"` + // RequestID - Id of the REST API request. + RequestID *string `json:"requestId,omitempty"` + Metadata *ImageMetadata `json:"metadata,omitempty"` +} + // ColorInfo an object providing additional metadata describing color attributes. type ColorInfo struct { // DominantColorForeground - Possible dominant foreground color. @@ -299,78 +292,16 @@ type ColorInfo struct { IsBWImg *bool `json:"isBWImg,omitempty"` } -// DomainModelResult ... -type DomainModelResult struct { - // Celebrities - An array of possible celebritied identified in the image. - Celebrities *[]CelebritiesModel `json:"celebrities,omitempty"` -} - // DomainModelResults result of image analysis using a specific domain model including additional metadata. type DomainModelResults struct { - autorest.Response `json:"-"` - *DomainModelResult `json:"result,omitempty"` + autorest.Response `json:"-"` + // Result - Model-specific response + Result interface{} `json:"result,omitempty"` // RequestID - Id of the REST API request. RequestID *string `json:"requestId,omitempty"` Metadata *ImageMetadata `json:"metadata,omitempty"` } -// MarshalJSON is the custom marshaler for DomainModelResults. -func (dmr DomainModelResults) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if dmr.DomainModelResult != nil { - objectMap["result"] = dmr.DomainModelResult - } - if dmr.RequestID != nil { - objectMap["requestId"] = dmr.RequestID - } - if dmr.Metadata != nil { - objectMap["metadata"] = dmr.Metadata - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for DomainModelResults struct. -func (dmr *DomainModelResults) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "result": - if v != nil { - var domainModelResult DomainModelResult - err = json.Unmarshal(*v, &domainModelResult) - if err != nil { - return err - } - dmr.DomainModelResult = &domainModelResult - } - case "requestId": - if v != nil { - var requestID string - err = json.Unmarshal(*v, &requestID) - if err != nil { - return err - } - dmr.RequestID = &requestID - } - case "metadata": - if v != nil { - var metadata ImageMetadata - err = json.Unmarshal(*v, &metadata) - if err != nil { - return err - } - dmr.Metadata = &metadata - } - } - } - - return nil -} - // Error ... type Error struct { // Code - The error code. Possible values include: 'InvalidImageURL', 'InvalidImageFormat', 'InvalidImageSize', 'NotSupportedVisualFeature', 'NotSupportedImage', 'InvalidDetails', 'NotSupportedLanguage', 'BadArgument', 'FailedToProcess', 'Timeout', 'InternalServerError', 'Unspecified', 'StorageException' @@ -512,6 +443,22 @@ type ImageURL struct { URL *string `json:"url,omitempty"` } +// LandmarkResults list of landmarks recognized in the image. +type LandmarkResults struct { + Landmarks *[]LandmarkResultsLandmarksItem `json:"landmarks,omitempty"` + // RequestID - Id of the REST API request. + RequestID *string `json:"requestId,omitempty"` + Metadata *ImageMetadata `json:"metadata,omitempty"` +} + +// LandmarkResultsLandmarksItem a landmark recognized in the image +type LandmarkResultsLandmarksItem struct { + // Name - Name of the landmark. + Name *string `json:"name,omitempty"` + // Confidence - Confidence level for the landmark recognition. + Confidence *float64 `json:"confidence,omitempty"` +} + // Line ... type Line struct { BoundingBox *[]int32 `json:"boundingBox,omitempty"` @@ -550,7 +497,8 @@ type OcrRegion struct { // OcrResult ... type OcrResult struct { autorest.Response `json:"-"` - Language *OcrResult `json:"language,omitempty"` + // Language - The BCP-47 language code of the text in the image. + Language *string `json:"language,omitempty"` // TextAngle - The angle, in degrees, of the detected text with respect to the closest horizontal or vertical direction. After rotating the input image clockwise by this angle, the recognized text lines become horizontal or vertical. In combination with the orientation property it can be used to overlay recognition results correctly on the original image, by rotating either the original image or recognition results by a suitable angle around the center of the original image. If the angle cannot be confidently detected, this property is not present. If the image contains text at different angles, only part of the text will be recognized correctly. TextAngle *float64 `json:"textAngle,omitempty"` // Orientation - Orientation of the text recognized in the image. The value (up,down,left, or right) refers to the direction that the top of the recognized text is facing, after the image has been rotated around its center according to the detected text angle (see textAngle property). diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v1.0/face/face.go b/vendor/github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v1.0/face/face.go index b3c6d3508..eab2a3c1c 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v1.0/face/face.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v1.0/face/face.go @@ -224,7 +224,7 @@ func (client Client) FindSimilar(ctx context.Context, body FindSimilarRequest) ( {Target: "body.FaceIds", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "body.FaceIds", Name: validation.MaxItems, Rule: 1000, Chain: nil}}}, {Target: "body.MaxNumOfCandidatesReturned", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "body.MaxNumOfCandidatesReturned", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, + Chain: []validation.Constraint{{Target: "body.MaxNumOfCandidatesReturned", Name: validation.InclusiveMaximum, Rule: int64(1000), Chain: nil}, {Target: "body.MaxNumOfCandidatesReturned", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("face.Client", "FindSimilar", err.Error()) @@ -366,7 +366,7 @@ func (client Client) Identify(ctx context.Context, body IdentifyRequest) (result {Target: "body.FaceIds", Name: validation.Null, Rule: true, Chain: []validation.Constraint{{Target: "body.FaceIds", Name: validation.MaxItems, Rule: 10, Chain: nil}}}, {Target: "body.MaxNumOfCandidatesReturned", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "body.MaxNumOfCandidatesReturned", Name: validation.InclusiveMaximum, Rule: 5, Chain: nil}, + Chain: []validation.Constraint{{Target: "body.MaxNumOfCandidatesReturned", Name: validation.InclusiveMaximum, Rule: int64(5), Chain: nil}, {Target: "body.MaxNumOfCandidatesReturned", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("face.Client", "Identify", err.Error()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v1.0/face/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v1.0/face/models.go index aa5ace9d5..400804629 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v1.0/face/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v1.0/face/models.go @@ -87,18 +87,26 @@ const ( Australiaeast AzureRegions = "australiaeast" // Brazilsouth ... Brazilsouth AzureRegions = "brazilsouth" + // Canadacentral ... + Canadacentral AzureRegions = "canadacentral" + // Centralindia ... + Centralindia AzureRegions = "centralindia" // Eastasia ... Eastasia AzureRegions = "eastasia" // Eastus ... Eastus AzureRegions = "eastus" // Eastus2 ... Eastus2 AzureRegions = "eastus2" + // Japaneast ... + Japaneast AzureRegions = "japaneast" // Northeurope ... Northeurope AzureRegions = "northeurope" // Southcentralus ... Southcentralus AzureRegions = "southcentralus" // Southeastasia ... Southeastasia AzureRegions = "southeastasia" + // Uksouth ... + Uksouth AzureRegions = "uksouth" // Westcentralus ... Westcentralus AzureRegions = "westcentralus" // Westeurope ... @@ -111,7 +119,7 @@ const ( // PossibleAzureRegionsValues returns an array of possible values for the AzureRegions const type. func PossibleAzureRegionsValues() []AzureRegions { - return []AzureRegions{Australiaeast, Brazilsouth, Eastasia, Eastus, Eastus2, Northeurope, Southcentralus, Southeastasia, Westcentralus, Westeurope, Westus, Westus2} + return []AzureRegions{Australiaeast, Brazilsouth, Canadacentral, Centralindia, Eastasia, Eastus, Eastus2, Japaneast, Northeurope, Southcentralus, Southeastasia, Uksouth, Westcentralus, Westeurope, Westus, Westus2} } // BlurLevel enumerates the values for blur level. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v1.0/face/persongroup.go b/vendor/github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v1.0/face/persongroup.go index 4c03f14d0..a1b5801dd 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v1.0/face/persongroup.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v1.0/face/persongroup.go @@ -328,7 +328,7 @@ func (client PersonGroupClient) List(ctx context.Context, start string, top *int Constraints: []validation.Constraint{{Target: "start", Name: validation.MaxLength, Rule: 64, Chain: nil}}}, {TargetValue: top, Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: int64(1000), Chain: nil}, {Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("face.PersonGroupClient", "List", err.Error()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v1.0/face/persongroupperson.go b/vendor/github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v1.0/face/persongroupperson.go index 9937eb08f..228dfb6e0 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v1.0/face/persongroupperson.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v1.0/face/persongroupperson.go @@ -598,7 +598,7 @@ func (client PersonGroupPersonClient) List(ctx context.Context, personGroupID st {Target: "personGroupID", Name: validation.Pattern, Rule: `^[a-z0-9-_]+$`, Chain: nil}}}, {TargetValue: top, Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: int64(1000), Chain: nil}, {Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("face.PersonGroupPersonClient", "List", err.Error()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v2.0/computervision/client.go b/vendor/github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v2.0/computervision/client.go new file mode 100644 index 000000000..ceae30ff9 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v2.0/computervision/client.go @@ -0,0 +1,1330 @@ +// Package computervision implements the Azure ARM Computervision service API version 2.0. +// +// The Computer Vision API provides state-of-the-art algorithms to process images and return information. For example, +// it can be used to determine if an image contains mature content, or it can be used to find all the faces in an +// image. It also has other features like estimating dominant and accent colors, categorizing the content of images, +// and describing an image with complete English sentences. Additionally, it can also intelligently generate images +// thumbnails for displaying large images effectively. +package computervision + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "io" + "net/http" +) + +// BaseClient is the base client for Computervision. +type BaseClient struct { + autorest.Client + AzureRegion AzureRegions +} + +// New creates an instance of the BaseClient client. +func New(azureRegion AzureRegions) BaseClient { + return NewWithoutDefaults(azureRegion) +} + +// NewWithoutDefaults creates an instance of the BaseClient client. +func NewWithoutDefaults(azureRegion AzureRegions) BaseClient { + return BaseClient{ + Client: autorest.NewClientWithUserAgent(UserAgent()), + AzureRegion: azureRegion, + } +} + +// AnalyzeImage this operation extracts a rich set of visual features based on the image content. Two input methods are +// supported -- (1) Uploading an image or (2) specifying an image URL. Within your request, there is an optional +// parameter to allow you to choose which features to return. By default, image categories are returned in the +// response. +// Parameters: +// imageURL - a JSON document with a URL pointing to the image that is to be analyzed. +// visualFeatures - a string indicating what visual feature types to return. Multiple values should be +// comma-separated. Valid visual feature types include:Categories - categorizes image content according to a +// taxonomy defined in documentation. Tags - tags the image with a detailed list of words related to the image +// content. Description - describes the image content with a complete English sentence. Faces - detects if +// faces are present. If present, generate coordinates, gender and age. ImageType - detects if image is clipart +// or a line drawing. Color - determines the accent color, dominant color, and whether an image is +// black&white.Adult - detects if the image is pornographic in nature (depicts nudity or a sex act). Sexually +// suggestive content is also detected. +// details - a string indicating which domain-specific details to return. Multiple values should be +// comma-separated. Valid visual feature types include:Celebrities - identifies celebrities if detected in the +// image. +// language - the desired language for output generation. If this parameter is not specified, the default value +// is "en".Supported languages:en - English, Default. es - Spanish, ja - Japanese, pt - Portuguese, +// zh - Simplified Chinese. +func (client BaseClient) AnalyzeImage(ctx context.Context, imageURL ImageURL, visualFeatures []VisualFeatureTypes, details []Details, language string) (result ImageAnalysis, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: imageURL, + Constraints: []validation.Constraint{{Target: "imageURL.URL", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("computervision.BaseClient", "AnalyzeImage", err.Error()) + } + + req, err := client.AnalyzeImagePreparer(ctx, imageURL, visualFeatures, details, language) + if err != nil { + err = autorest.NewErrorWithError(err, "computervision.BaseClient", "AnalyzeImage", nil, "Failure preparing request") + return + } + + resp, err := client.AnalyzeImageSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "computervision.BaseClient", "AnalyzeImage", resp, "Failure sending request") + return + } + + result, err = client.AnalyzeImageResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "computervision.BaseClient", "AnalyzeImage", resp, "Failure responding to request") + } + + return +} + +// AnalyzeImagePreparer prepares the AnalyzeImage request. +func (client BaseClient) AnalyzeImagePreparer(ctx context.Context, imageURL ImageURL, visualFeatures []VisualFeatureTypes, details []Details, language string) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "AzureRegion": client.AzureRegion, + } + + queryParameters := map[string]interface{}{} + if visualFeatures != nil && len(visualFeatures) > 0 { + queryParameters["visualFeatures"] = autorest.Encode("query", visualFeatures, ",") + } + if details != nil && len(details) > 0 { + queryParameters["details"] = autorest.Encode("query", details, ",") + } + if len(string(language)) > 0 { + queryParameters["language"] = autorest.Encode("query", language) + } else { + queryParameters["language"] = autorest.Encode("query", "en") + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/vision/v2.0", urlParameters), + autorest.WithPath("/analyze"), + autorest.WithJSON(imageURL), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// AnalyzeImageSender sends the AnalyzeImage request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) AnalyzeImageSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// AnalyzeImageResponder handles the response to the AnalyzeImage request. The method always +// closes the http.Response Body. +func (client BaseClient) AnalyzeImageResponder(resp *http.Response) (result ImageAnalysis, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// AnalyzeImageByDomain this operation recognizes content within an image by applying a domain-specific model. The +// list of domain-specific models that are supported by the Computer Vision API can be retrieved using the /models GET +// request. Currently, the API only provides a single domain-specific model: celebrities. Two input methods are +// supported -- (1) Uploading an image or (2) specifying an image URL. A successful response will be returned in JSON. +// If the request failed, the response will contain an error code and a message to help understand what went wrong. +// Parameters: +// model - the domain-specific content to recognize. +// imageURL - a JSON document with a URL pointing to the image that is to be analyzed. +// language - the desired language for output generation. If this parameter is not specified, the default value +// is "en".Supported languages:en - English, Default. es - Spanish, ja - Japanese, pt - Portuguese, +// zh - Simplified Chinese. +func (client BaseClient) AnalyzeImageByDomain(ctx context.Context, model string, imageURL ImageURL, language string) (result DomainModelResults, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: imageURL, + Constraints: []validation.Constraint{{Target: "imageURL.URL", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("computervision.BaseClient", "AnalyzeImageByDomain", err.Error()) + } + + req, err := client.AnalyzeImageByDomainPreparer(ctx, model, imageURL, language) + if err != nil { + err = autorest.NewErrorWithError(err, "computervision.BaseClient", "AnalyzeImageByDomain", nil, "Failure preparing request") + return + } + + resp, err := client.AnalyzeImageByDomainSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "computervision.BaseClient", "AnalyzeImageByDomain", resp, "Failure sending request") + return + } + + result, err = client.AnalyzeImageByDomainResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "computervision.BaseClient", "AnalyzeImageByDomain", resp, "Failure responding to request") + } + + return +} + +// AnalyzeImageByDomainPreparer prepares the AnalyzeImageByDomain request. +func (client BaseClient) AnalyzeImageByDomainPreparer(ctx context.Context, model string, imageURL ImageURL, language string) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "AzureRegion": client.AzureRegion, + } + + pathParameters := map[string]interface{}{ + "model": autorest.Encode("path", model), + } + + queryParameters := map[string]interface{}{} + if len(string(language)) > 0 { + queryParameters["language"] = autorest.Encode("query", language) + } else { + queryParameters["language"] = autorest.Encode("query", "en") + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/vision/v2.0", urlParameters), + autorest.WithPathParameters("/models/{model}/analyze", pathParameters), + autorest.WithJSON(imageURL), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// AnalyzeImageByDomainSender sends the AnalyzeImageByDomain request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) AnalyzeImageByDomainSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// AnalyzeImageByDomainResponder handles the response to the AnalyzeImageByDomain request. The method always +// closes the http.Response Body. +func (client BaseClient) AnalyzeImageByDomainResponder(resp *http.Response) (result DomainModelResults, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// AnalyzeImageByDomainInStream this operation recognizes content within an image by applying a domain-specific model. +// The list of domain-specific models that are supported by the Computer Vision API can be retrieved using the /models +// GET request. Currently, the API only provides a single domain-specific model: celebrities. Two input methods are +// supported -- (1) Uploading an image or (2) specifying an image URL. A successful response will be returned in JSON. +// If the request failed, the response will contain an error code and a message to help understand what went wrong. +// Parameters: +// model - the domain-specific content to recognize. +// imageParameter - an image stream. +// language - the desired language for output generation. If this parameter is not specified, the default value +// is "en".Supported languages:en - English, Default. es - Spanish, ja - Japanese, pt - Portuguese, +// zh - Simplified Chinese. +func (client BaseClient) AnalyzeImageByDomainInStream(ctx context.Context, model string, imageParameter io.ReadCloser, language string) (result DomainModelResults, err error) { + req, err := client.AnalyzeImageByDomainInStreamPreparer(ctx, model, imageParameter, language) + if err != nil { + err = autorest.NewErrorWithError(err, "computervision.BaseClient", "AnalyzeImageByDomainInStream", nil, "Failure preparing request") + return + } + + resp, err := client.AnalyzeImageByDomainInStreamSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "computervision.BaseClient", "AnalyzeImageByDomainInStream", resp, "Failure sending request") + return + } + + result, err = client.AnalyzeImageByDomainInStreamResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "computervision.BaseClient", "AnalyzeImageByDomainInStream", resp, "Failure responding to request") + } + + return +} + +// AnalyzeImageByDomainInStreamPreparer prepares the AnalyzeImageByDomainInStream request. +func (client BaseClient) AnalyzeImageByDomainInStreamPreparer(ctx context.Context, model string, imageParameter io.ReadCloser, language string) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "AzureRegion": client.AzureRegion, + } + + pathParameters := map[string]interface{}{ + "model": autorest.Encode("path", model), + } + + queryParameters := map[string]interface{}{} + if len(string(language)) > 0 { + queryParameters["language"] = autorest.Encode("query", language) + } else { + queryParameters["language"] = autorest.Encode("query", "en") + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/octet-stream"), + autorest.AsPost(), + autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/vision/v2.0", urlParameters), + autorest.WithPathParameters("/models/{model}/analyze", pathParameters), + autorest.WithFile(imageParameter), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// AnalyzeImageByDomainInStreamSender sends the AnalyzeImageByDomainInStream request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) AnalyzeImageByDomainInStreamSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// AnalyzeImageByDomainInStreamResponder handles the response to the AnalyzeImageByDomainInStream request. The method always +// closes the http.Response Body. +func (client BaseClient) AnalyzeImageByDomainInStreamResponder(resp *http.Response) (result DomainModelResults, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// AnalyzeImageInStream this operation extracts a rich set of visual features based on the image content. +// Parameters: +// imageParameter - an image stream. +// visualFeatures - a string indicating what visual feature types to return. Multiple values should be +// comma-separated. Valid visual feature types include:Categories - categorizes image content according to a +// taxonomy defined in documentation. Tags - tags the image with a detailed list of words related to the image +// content. Description - describes the image content with a complete English sentence. Faces - detects if +// faces are present. If present, generate coordinates, gender and age. ImageType - detects if image is clipart +// or a line drawing. Color - determines the accent color, dominant color, and whether an image is +// black&white.Adult - detects if the image is pornographic in nature (depicts nudity or a sex act). Sexually +// suggestive content is also detected. +// details - a string indicating which domain-specific details to return. Multiple values should be +// comma-separated. Valid visual feature types include:Celebrities - identifies celebrities if detected in the +// image. +// language - the desired language for output generation. If this parameter is not specified, the default value +// is "en".Supported languages:en - English, Default. es - Spanish, ja - Japanese, pt - Portuguese, +// zh - Simplified Chinese. +func (client BaseClient) AnalyzeImageInStream(ctx context.Context, imageParameter io.ReadCloser, visualFeatures []VisualFeatureTypes, details string, language string) (result ImageAnalysis, err error) { + req, err := client.AnalyzeImageInStreamPreparer(ctx, imageParameter, visualFeatures, details, language) + if err != nil { + err = autorest.NewErrorWithError(err, "computervision.BaseClient", "AnalyzeImageInStream", nil, "Failure preparing request") + return + } + + resp, err := client.AnalyzeImageInStreamSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "computervision.BaseClient", "AnalyzeImageInStream", resp, "Failure sending request") + return + } + + result, err = client.AnalyzeImageInStreamResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "computervision.BaseClient", "AnalyzeImageInStream", resp, "Failure responding to request") + } + + return +} + +// AnalyzeImageInStreamPreparer prepares the AnalyzeImageInStream request. +func (client BaseClient) AnalyzeImageInStreamPreparer(ctx context.Context, imageParameter io.ReadCloser, visualFeatures []VisualFeatureTypes, details string, language string) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "AzureRegion": client.AzureRegion, + } + + queryParameters := map[string]interface{}{} + if visualFeatures != nil && len(visualFeatures) > 0 { + queryParameters["visualFeatures"] = autorest.Encode("query", visualFeatures, ",") + } + if len(string(details)) > 0 { + queryParameters["details"] = autorest.Encode("query", details) + } + if len(string(language)) > 0 { + queryParameters["language"] = autorest.Encode("query", language) + } else { + queryParameters["language"] = autorest.Encode("query", "en") + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/octet-stream"), + autorest.AsPost(), + autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/vision/v2.0", urlParameters), + autorest.WithPath("/analyze"), + autorest.WithFile(imageParameter), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// AnalyzeImageInStreamSender sends the AnalyzeImageInStream request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) AnalyzeImageInStreamSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// AnalyzeImageInStreamResponder handles the response to the AnalyzeImageInStream request. The method always +// closes the http.Response Body. +func (client BaseClient) AnalyzeImageInStreamResponder(resp *http.Response) (result ImageAnalysis, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// DescribeImage this operation generates a description of an image in human readable language with complete sentences. +// The description is based on a collection of content tags, which are also returned by the operation. More than one +// description can be generated for each image. Descriptions are ordered by their confidence score. All descriptions +// are in English. Two input methods are supported -- (1) Uploading an image or (2) specifying an image URL.A +// successful response will be returned in JSON. If the request failed, the response will contain an error code and a +// message to help understand what went wrong. +// Parameters: +// imageURL - a JSON document with a URL pointing to the image that is to be analyzed. +// maxCandidates - maximum number of candidate descriptions to be returned. The default is 1. +// language - the desired language for output generation. If this parameter is not specified, the default value +// is "en".Supported languages:en - English, Default. es - Spanish, ja - Japanese, pt - Portuguese, +// zh - Simplified Chinese. +func (client BaseClient) DescribeImage(ctx context.Context, imageURL ImageURL, maxCandidates string, language string) (result ImageDescription, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: imageURL, + Constraints: []validation.Constraint{{Target: "imageURL.URL", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("computervision.BaseClient", "DescribeImage", err.Error()) + } + + req, err := client.DescribeImagePreparer(ctx, imageURL, maxCandidates, language) + if err != nil { + err = autorest.NewErrorWithError(err, "computervision.BaseClient", "DescribeImage", nil, "Failure preparing request") + return + } + + resp, err := client.DescribeImageSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "computervision.BaseClient", "DescribeImage", resp, "Failure sending request") + return + } + + result, err = client.DescribeImageResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "computervision.BaseClient", "DescribeImage", resp, "Failure responding to request") + } + + return +} + +// DescribeImagePreparer prepares the DescribeImage request. +func (client BaseClient) DescribeImagePreparer(ctx context.Context, imageURL ImageURL, maxCandidates string, language string) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "AzureRegion": client.AzureRegion, + } + + queryParameters := map[string]interface{}{} + if len(maxCandidates) > 0 { + queryParameters["maxCandidates"] = autorest.Encode("query", maxCandidates) + } else { + queryParameters["maxCandidates"] = autorest.Encode("query", "1") + } + if len(string(language)) > 0 { + queryParameters["language"] = autorest.Encode("query", language) + } else { + queryParameters["language"] = autorest.Encode("query", "en") + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/vision/v2.0", urlParameters), + autorest.WithPath("/describe"), + autorest.WithJSON(imageURL), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DescribeImageSender sends the DescribeImage request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) DescribeImageSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// DescribeImageResponder handles the response to the DescribeImage request. The method always +// closes the http.Response Body. +func (client BaseClient) DescribeImageResponder(resp *http.Response) (result ImageDescription, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// DescribeImageInStream this operation generates a description of an image in human readable language with complete +// sentences. The description is based on a collection of content tags, which are also returned by the operation. More +// than one description can be generated for each image. Descriptions are ordered by their confidence score. All +// descriptions are in English. Two input methods are supported -- (1) Uploading an image or (2) specifying an image +// URL.A successful response will be returned in JSON. If the request failed, the response will contain an error code +// and a message to help understand what went wrong. +// Parameters: +// imageParameter - an image stream. +// maxCandidates - maximum number of candidate descriptions to be returned. The default is 1. +// language - the desired language for output generation. If this parameter is not specified, the default value +// is "en".Supported languages:en - English, Default. es - Spanish, ja - Japanese, pt - Portuguese, +// zh - Simplified Chinese. +func (client BaseClient) DescribeImageInStream(ctx context.Context, imageParameter io.ReadCloser, maxCandidates string, language string) (result ImageDescription, err error) { + req, err := client.DescribeImageInStreamPreparer(ctx, imageParameter, maxCandidates, language) + if err != nil { + err = autorest.NewErrorWithError(err, "computervision.BaseClient", "DescribeImageInStream", nil, "Failure preparing request") + return + } + + resp, err := client.DescribeImageInStreamSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "computervision.BaseClient", "DescribeImageInStream", resp, "Failure sending request") + return + } + + result, err = client.DescribeImageInStreamResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "computervision.BaseClient", "DescribeImageInStream", resp, "Failure responding to request") + } + + return +} + +// DescribeImageInStreamPreparer prepares the DescribeImageInStream request. +func (client BaseClient) DescribeImageInStreamPreparer(ctx context.Context, imageParameter io.ReadCloser, maxCandidates string, language string) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "AzureRegion": client.AzureRegion, + } + + queryParameters := map[string]interface{}{} + if len(maxCandidates) > 0 { + queryParameters["maxCandidates"] = autorest.Encode("query", maxCandidates) + } else { + queryParameters["maxCandidates"] = autorest.Encode("query", "1") + } + if len(string(language)) > 0 { + queryParameters["language"] = autorest.Encode("query", language) + } else { + queryParameters["language"] = autorest.Encode("query", "en") + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/octet-stream"), + autorest.AsPost(), + autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/vision/v2.0", urlParameters), + autorest.WithPath("/describe"), + autorest.WithFile(imageParameter), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DescribeImageInStreamSender sends the DescribeImageInStream request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) DescribeImageInStreamSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// DescribeImageInStreamResponder handles the response to the DescribeImageInStream request. The method always +// closes the http.Response Body. +func (client BaseClient) DescribeImageInStreamResponder(resp *http.Response) (result ImageDescription, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GenerateThumbnail this operation generates a thumbnail image with the user-specified width and height. By default, +// the service analyzes the image, identifies the region of interest (ROI), and generates smart cropping coordinates +// based on the ROI. Smart cropping helps when you specify an aspect ratio that differs from that of the input image. A +// successful response contains the thumbnail image binary. If the request failed, the response contains an error code +// and a message to help determine what went wrong. +// Parameters: +// width - width of the thumbnail. It must be between 1 and 1024. Recommended minimum of 50. +// height - height of the thumbnail. It must be between 1 and 1024. Recommended minimum of 50. +// imageURL - a JSON document with a URL pointing to the image that is to be analyzed. +// smartCropping - boolean flag for enabling smart cropping. +func (client BaseClient) GenerateThumbnail(ctx context.Context, width int32, height int32, imageURL ImageURL, smartCropping *bool) (result ReadCloser, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: width, + Constraints: []validation.Constraint{{Target: "width", Name: validation.InclusiveMaximum, Rule: int64(1023), Chain: nil}, + {Target: "width", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}, + {TargetValue: height, + Constraints: []validation.Constraint{{Target: "height", Name: validation.InclusiveMaximum, Rule: int64(1023), Chain: nil}, + {Target: "height", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}, + {TargetValue: imageURL, + Constraints: []validation.Constraint{{Target: "imageURL.URL", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("computervision.BaseClient", "GenerateThumbnail", err.Error()) + } + + req, err := client.GenerateThumbnailPreparer(ctx, width, height, imageURL, smartCropping) + if err != nil { + err = autorest.NewErrorWithError(err, "computervision.BaseClient", "GenerateThumbnail", nil, "Failure preparing request") + return + } + + resp, err := client.GenerateThumbnailSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "computervision.BaseClient", "GenerateThumbnail", resp, "Failure sending request") + return + } + + result, err = client.GenerateThumbnailResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "computervision.BaseClient", "GenerateThumbnail", resp, "Failure responding to request") + } + + return +} + +// GenerateThumbnailPreparer prepares the GenerateThumbnail request. +func (client BaseClient) GenerateThumbnailPreparer(ctx context.Context, width int32, height int32, imageURL ImageURL, smartCropping *bool) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "AzureRegion": client.AzureRegion, + } + + queryParameters := map[string]interface{}{ + "height": autorest.Encode("query", height), + "width": autorest.Encode("query", width), + } + if smartCropping != nil { + queryParameters["smartCropping"] = autorest.Encode("query", *smartCropping) + } else { + queryParameters["smartCropping"] = autorest.Encode("query", false) + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/vision/v2.0", urlParameters), + autorest.WithPath("/generateThumbnail"), + autorest.WithJSON(imageURL), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GenerateThumbnailSender sends the GenerateThumbnail request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GenerateThumbnailSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GenerateThumbnailResponder handles the response to the GenerateThumbnail request. The method always +// closes the http.Response Body. +func (client BaseClient) GenerateThumbnailResponder(resp *http.Response) (result ReadCloser, err error) { + result.Value = &resp.Body + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK)) + result.Response = autorest.Response{Response: resp} + return +} + +// GenerateThumbnailInStream this operation generates a thumbnail image with the user-specified width and height. By +// default, the service analyzes the image, identifies the region of interest (ROI), and generates smart cropping +// coordinates based on the ROI. Smart cropping helps when you specify an aspect ratio that differs from that of the +// input image. A successful response contains the thumbnail image binary. If the request failed, the response contains +// an error code and a message to help determine what went wrong. +// Parameters: +// width - width of the thumbnail. It must be between 1 and 1024. Recommended minimum of 50. +// height - height of the thumbnail. It must be between 1 and 1024. Recommended minimum of 50. +// imageParameter - an image stream. +// smartCropping - boolean flag for enabling smart cropping. +func (client BaseClient) GenerateThumbnailInStream(ctx context.Context, width int32, height int32, imageParameter io.ReadCloser, smartCropping *bool) (result ReadCloser, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: width, + Constraints: []validation.Constraint{{Target: "width", Name: validation.InclusiveMaximum, Rule: int64(1023), Chain: nil}, + {Target: "width", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}, + {TargetValue: height, + Constraints: []validation.Constraint{{Target: "height", Name: validation.InclusiveMaximum, Rule: int64(1023), Chain: nil}, + {Target: "height", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("computervision.BaseClient", "GenerateThumbnailInStream", err.Error()) + } + + req, err := client.GenerateThumbnailInStreamPreparer(ctx, width, height, imageParameter, smartCropping) + if err != nil { + err = autorest.NewErrorWithError(err, "computervision.BaseClient", "GenerateThumbnailInStream", nil, "Failure preparing request") + return + } + + resp, err := client.GenerateThumbnailInStreamSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "computervision.BaseClient", "GenerateThumbnailInStream", resp, "Failure sending request") + return + } + + result, err = client.GenerateThumbnailInStreamResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "computervision.BaseClient", "GenerateThumbnailInStream", resp, "Failure responding to request") + } + + return +} + +// GenerateThumbnailInStreamPreparer prepares the GenerateThumbnailInStream request. +func (client BaseClient) GenerateThumbnailInStreamPreparer(ctx context.Context, width int32, height int32, imageParameter io.ReadCloser, smartCropping *bool) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "AzureRegion": client.AzureRegion, + } + + queryParameters := map[string]interface{}{ + "height": autorest.Encode("query", height), + "width": autorest.Encode("query", width), + } + if smartCropping != nil { + queryParameters["smartCropping"] = autorest.Encode("query", *smartCropping) + } else { + queryParameters["smartCropping"] = autorest.Encode("query", false) + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/octet-stream"), + autorest.AsPost(), + autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/vision/v2.0", urlParameters), + autorest.WithPath("/generateThumbnail"), + autorest.WithFile(imageParameter), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GenerateThumbnailInStreamSender sends the GenerateThumbnailInStream request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GenerateThumbnailInStreamSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GenerateThumbnailInStreamResponder handles the response to the GenerateThumbnailInStream request. The method always +// closes the http.Response Body. +func (client BaseClient) GenerateThumbnailInStreamResponder(resp *http.Response) (result ReadCloser, err error) { + result.Value = &resp.Body + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK)) + result.Response = autorest.Response{Response: resp} + return +} + +// GetTextOperationResult this interface is used for getting text operation result. The URL to this interface should be +// retrieved from 'Operation-Location' field returned from Recognize Text interface. +// Parameters: +// operationID - id of the text operation returned in the response of the 'Recognize Text' +func (client BaseClient) GetTextOperationResult(ctx context.Context, operationID string) (result TextOperationResult, err error) { + req, err := client.GetTextOperationResultPreparer(ctx, operationID) + if err != nil { + err = autorest.NewErrorWithError(err, "computervision.BaseClient", "GetTextOperationResult", nil, "Failure preparing request") + return + } + + resp, err := client.GetTextOperationResultSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "computervision.BaseClient", "GetTextOperationResult", resp, "Failure sending request") + return + } + + result, err = client.GetTextOperationResultResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "computervision.BaseClient", "GetTextOperationResult", resp, "Failure responding to request") + } + + return +} + +// GetTextOperationResultPreparer prepares the GetTextOperationResult request. +func (client BaseClient) GetTextOperationResultPreparer(ctx context.Context, operationID string) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "AzureRegion": client.AzureRegion, + } + + pathParameters := map[string]interface{}{ + "operationId": autorest.Encode("path", operationID), + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/vision/v2.0", urlParameters), + autorest.WithPathParameters("/textOperations/{operationId}", pathParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetTextOperationResultSender sends the GetTextOperationResult request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GetTextOperationResultSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetTextOperationResultResponder handles the response to the GetTextOperationResult request. The method always +// closes the http.Response Body. +func (client BaseClient) GetTextOperationResultResponder(resp *http.Response) (result TextOperationResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListModels this operation returns the list of domain-specific models that are supported by the Computer Vision API. +// Currently, the API only supports one domain-specific model: a celebrity recognizer. A successful response will be +// returned in JSON. If the request failed, the response will contain an error code and a message to help understand +// what went wrong. +func (client BaseClient) ListModels(ctx context.Context) (result ListModelsResult, err error) { + req, err := client.ListModelsPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "computervision.BaseClient", "ListModels", nil, "Failure preparing request") + return + } + + resp, err := client.ListModelsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "computervision.BaseClient", "ListModels", resp, "Failure sending request") + return + } + + result, err = client.ListModelsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "computervision.BaseClient", "ListModels", resp, "Failure responding to request") + } + + return +} + +// ListModelsPreparer prepares the ListModels request. +func (client BaseClient) ListModelsPreparer(ctx context.Context) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "AzureRegion": client.AzureRegion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/vision/v2.0", urlParameters), + autorest.WithPath("/models")) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListModelsSender sends the ListModels request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) ListModelsSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// ListModelsResponder handles the response to the ListModels request. The method always +// closes the http.Response Body. +func (client BaseClient) ListModelsResponder(resp *http.Response) (result ListModelsResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// RecognizePrintedText optical Character Recognition (OCR) detects printed text in an image and extracts the +// recognized characters into a machine-usable character stream. Upon success, the OCR results will be returned. Upon +// failure, the error code together with an error message will be returned. The error code can be one of +// InvalidImageUrl, InvalidImageFormat, InvalidImageSize, NotSupportedImage, NotSupportedLanguage, or +// InternalServerError. +// Parameters: +// detectOrientation - whether detect the text orientation in the image. With detectOrientation=true the OCR +// service tries to detect the image orientation and correct it before further processing (e.g. if it's +// upside-down). +// imageURL - a JSON document with a URL pointing to the image that is to be analyzed. +// language - the BCP-47 language code of the text to be detected in the image. The default value is 'unk' +func (client BaseClient) RecognizePrintedText(ctx context.Context, detectOrientation bool, imageURL ImageURL, language OcrLanguages) (result OcrResult, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: imageURL, + Constraints: []validation.Constraint{{Target: "imageURL.URL", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("computervision.BaseClient", "RecognizePrintedText", err.Error()) + } + + req, err := client.RecognizePrintedTextPreparer(ctx, detectOrientation, imageURL, language) + if err != nil { + err = autorest.NewErrorWithError(err, "computervision.BaseClient", "RecognizePrintedText", nil, "Failure preparing request") + return + } + + resp, err := client.RecognizePrintedTextSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "computervision.BaseClient", "RecognizePrintedText", resp, "Failure sending request") + return + } + + result, err = client.RecognizePrintedTextResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "computervision.BaseClient", "RecognizePrintedText", resp, "Failure responding to request") + } + + return +} + +// RecognizePrintedTextPreparer prepares the RecognizePrintedText request. +func (client BaseClient) RecognizePrintedTextPreparer(ctx context.Context, detectOrientation bool, imageURL ImageURL, language OcrLanguages) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "AzureRegion": client.AzureRegion, + } + + queryParameters := map[string]interface{}{ + "detectOrientation": autorest.Encode("query", detectOrientation), + } + if len(string(language)) > 0 { + queryParameters["language"] = autorest.Encode("query", language) + } else { + queryParameters["language"] = autorest.Encode("query", "unk") + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/vision/v2.0", urlParameters), + autorest.WithPath("/ocr"), + autorest.WithJSON(imageURL), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RecognizePrintedTextSender sends the RecognizePrintedText request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) RecognizePrintedTextSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// RecognizePrintedTextResponder handles the response to the RecognizePrintedText request. The method always +// closes the http.Response Body. +func (client BaseClient) RecognizePrintedTextResponder(resp *http.Response) (result OcrResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// RecognizePrintedTextInStream optical Character Recognition (OCR) detects printed text in an image and extracts the +// recognized characters into a machine-usable character stream. Upon success, the OCR results will be returned. Upon +// failure, the error code together with an error message will be returned. The error code can be one of +// InvalidImageUrl, InvalidImageFormat, InvalidImageSize, NotSupportedImage, NotSupportedLanguage, or +// InternalServerError. +// Parameters: +// detectOrientation - whether detect the text orientation in the image. With detectOrientation=true the OCR +// service tries to detect the image orientation and correct it before further processing (e.g. if it's +// upside-down). +// imageParameter - an image stream. +// language - the BCP-47 language code of the text to be detected in the image. The default value is 'unk' +func (client BaseClient) RecognizePrintedTextInStream(ctx context.Context, detectOrientation bool, imageParameter io.ReadCloser, language OcrLanguages) (result OcrResult, err error) { + req, err := client.RecognizePrintedTextInStreamPreparer(ctx, detectOrientation, imageParameter, language) + if err != nil { + err = autorest.NewErrorWithError(err, "computervision.BaseClient", "RecognizePrintedTextInStream", nil, "Failure preparing request") + return + } + + resp, err := client.RecognizePrintedTextInStreamSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "computervision.BaseClient", "RecognizePrintedTextInStream", resp, "Failure sending request") + return + } + + result, err = client.RecognizePrintedTextInStreamResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "computervision.BaseClient", "RecognizePrintedTextInStream", resp, "Failure responding to request") + } + + return +} + +// RecognizePrintedTextInStreamPreparer prepares the RecognizePrintedTextInStream request. +func (client BaseClient) RecognizePrintedTextInStreamPreparer(ctx context.Context, detectOrientation bool, imageParameter io.ReadCloser, language OcrLanguages) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "AzureRegion": client.AzureRegion, + } + + queryParameters := map[string]interface{}{ + "detectOrientation": autorest.Encode("query", detectOrientation), + } + if len(string(language)) > 0 { + queryParameters["language"] = autorest.Encode("query", language) + } else { + queryParameters["language"] = autorest.Encode("query", "unk") + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/octet-stream"), + autorest.AsPost(), + autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/vision/v2.0", urlParameters), + autorest.WithPath("/ocr"), + autorest.WithFile(imageParameter), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RecognizePrintedTextInStreamSender sends the RecognizePrintedTextInStream request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) RecognizePrintedTextInStreamSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// RecognizePrintedTextInStreamResponder handles the response to the RecognizePrintedTextInStream request. The method always +// closes the http.Response Body. +func (client BaseClient) RecognizePrintedTextInStreamResponder(resp *http.Response) (result OcrResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// RecognizeText recognize Text operation. When you use the Recognize Text interface, the response contains a field +// called 'Operation-Location'. The 'Operation-Location' field contains the URL that you must use for your Get +// Recognize Text Operation Result operation. +// Parameters: +// imageURL - a JSON document with a URL pointing to the image that is to be analyzed. +// mode - type of text to recognize. +func (client BaseClient) RecognizeText(ctx context.Context, imageURL ImageURL, mode TextRecognitionMode) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: imageURL, + Constraints: []validation.Constraint{{Target: "imageURL.URL", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("computervision.BaseClient", "RecognizeText", err.Error()) + } + + req, err := client.RecognizeTextPreparer(ctx, imageURL, mode) + if err != nil { + err = autorest.NewErrorWithError(err, "computervision.BaseClient", "RecognizeText", nil, "Failure preparing request") + return + } + + resp, err := client.RecognizeTextSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "computervision.BaseClient", "RecognizeText", resp, "Failure sending request") + return + } + + result, err = client.RecognizeTextResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "computervision.BaseClient", "RecognizeText", resp, "Failure responding to request") + } + + return +} + +// RecognizeTextPreparer prepares the RecognizeText request. +func (client BaseClient) RecognizeTextPreparer(ctx context.Context, imageURL ImageURL, mode TextRecognitionMode) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "AzureRegion": client.AzureRegion, + } + + queryParameters := map[string]interface{}{ + "mode": autorest.Encode("query", mode), + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/vision/v2.0", urlParameters), + autorest.WithPath("/recognizeText"), + autorest.WithJSON(imageURL), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RecognizeTextSender sends the RecognizeText request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) RecognizeTextSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// RecognizeTextResponder handles the response to the RecognizeText request. The method always +// closes the http.Response Body. +func (client BaseClient) RecognizeTextResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// RecognizeTextInStream recognize Text operation. When you use the Recognize Text interface, the response contains a +// field called 'Operation-Location'. The 'Operation-Location' field contains the URL that you must use for your Get +// Recognize Text Operation Result operation. +// Parameters: +// imageParameter - an image stream. +// mode - type of text to recognize. +func (client BaseClient) RecognizeTextInStream(ctx context.Context, imageParameter io.ReadCloser, mode TextRecognitionMode) (result autorest.Response, err error) { + req, err := client.RecognizeTextInStreamPreparer(ctx, imageParameter, mode) + if err != nil { + err = autorest.NewErrorWithError(err, "computervision.BaseClient", "RecognizeTextInStream", nil, "Failure preparing request") + return + } + + resp, err := client.RecognizeTextInStreamSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "computervision.BaseClient", "RecognizeTextInStream", resp, "Failure sending request") + return + } + + result, err = client.RecognizeTextInStreamResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "computervision.BaseClient", "RecognizeTextInStream", resp, "Failure responding to request") + } + + return +} + +// RecognizeTextInStreamPreparer prepares the RecognizeTextInStream request. +func (client BaseClient) RecognizeTextInStreamPreparer(ctx context.Context, imageParameter io.ReadCloser, mode TextRecognitionMode) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "AzureRegion": client.AzureRegion, + } + + queryParameters := map[string]interface{}{ + "mode": autorest.Encode("query", mode), + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/octet-stream"), + autorest.AsPost(), + autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/vision/v2.0", urlParameters), + autorest.WithPath("/recognizeText"), + autorest.WithFile(imageParameter), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RecognizeTextInStreamSender sends the RecognizeTextInStream request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) RecognizeTextInStreamSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// RecognizeTextInStreamResponder handles the response to the RecognizeTextInStream request. The method always +// closes the http.Response Body. +func (client BaseClient) RecognizeTextInStreamResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// TagImage this operation generates a list of words, or tags, that are relevant to the content of the supplied image. +// The Computer Vision API can return tags based on objects, living beings, scenery or actions found in images. Unlike +// categories, tags are not organized according to a hierarchical classification system, but correspond to image +// content. Tags may contain hints to avoid ambiguity or provide context, for example the tag 'cello' may be +// accompanied by the hint 'musical instrument'. All tags are in English. +// Parameters: +// imageURL - a JSON document with a URL pointing to the image that is to be analyzed. +// language - the desired language for output generation. If this parameter is not specified, the default value +// is "en".Supported languages:en - English, Default. es - Spanish, ja - Japanese, pt - Portuguese, +// zh - Simplified Chinese. +func (client BaseClient) TagImage(ctx context.Context, imageURL ImageURL, language string) (result TagResult, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: imageURL, + Constraints: []validation.Constraint{{Target: "imageURL.URL", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("computervision.BaseClient", "TagImage", err.Error()) + } + + req, err := client.TagImagePreparer(ctx, imageURL, language) + if err != nil { + err = autorest.NewErrorWithError(err, "computervision.BaseClient", "TagImage", nil, "Failure preparing request") + return + } + + resp, err := client.TagImageSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "computervision.BaseClient", "TagImage", resp, "Failure sending request") + return + } + + result, err = client.TagImageResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "computervision.BaseClient", "TagImage", resp, "Failure responding to request") + } + + return +} + +// TagImagePreparer prepares the TagImage request. +func (client BaseClient) TagImagePreparer(ctx context.Context, imageURL ImageURL, language string) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "AzureRegion": client.AzureRegion, + } + + queryParameters := map[string]interface{}{} + if len(string(language)) > 0 { + queryParameters["language"] = autorest.Encode("query", language) + } else { + queryParameters["language"] = autorest.Encode("query", "en") + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/vision/v2.0", urlParameters), + autorest.WithPath("/tag"), + autorest.WithJSON(imageURL), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// TagImageSender sends the TagImage request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) TagImageSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// TagImageResponder handles the response to the TagImage request. The method always +// closes the http.Response Body. +func (client BaseClient) TagImageResponder(resp *http.Response) (result TagResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// TagImageInStream this operation generates a list of words, or tags, that are relevant to the content of the supplied +// image. The Computer Vision API can return tags based on objects, living beings, scenery or actions found in images. +// Unlike categories, tags are not organized according to a hierarchical classification system, but correspond to image +// content. Tags may contain hints to avoid ambiguity or provide context, for example the tag 'cello' may be +// accompanied by the hint 'musical instrument'. All tags are in English. +// Parameters: +// imageParameter - an image stream. +// language - the desired language for output generation. If this parameter is not specified, the default value +// is "en".Supported languages:en - English, Default. es - Spanish, ja - Japanese, pt - Portuguese, +// zh - Simplified Chinese. +func (client BaseClient) TagImageInStream(ctx context.Context, imageParameter io.ReadCloser, language string) (result TagResult, err error) { + req, err := client.TagImageInStreamPreparer(ctx, imageParameter, language) + if err != nil { + err = autorest.NewErrorWithError(err, "computervision.BaseClient", "TagImageInStream", nil, "Failure preparing request") + return + } + + resp, err := client.TagImageInStreamSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "computervision.BaseClient", "TagImageInStream", resp, "Failure sending request") + return + } + + result, err = client.TagImageInStreamResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "computervision.BaseClient", "TagImageInStream", resp, "Failure responding to request") + } + + return +} + +// TagImageInStreamPreparer prepares the TagImageInStream request. +func (client BaseClient) TagImageInStreamPreparer(ctx context.Context, imageParameter io.ReadCloser, language string) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "AzureRegion": client.AzureRegion, + } + + queryParameters := map[string]interface{}{} + if len(string(language)) > 0 { + queryParameters["language"] = autorest.Encode("query", language) + } else { + queryParameters["language"] = autorest.Encode("query", "en") + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/octet-stream"), + autorest.AsPost(), + autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/vision/v2.0", urlParameters), + autorest.WithPath("/tag"), + autorest.WithFile(imageParameter), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// TagImageInStreamSender sends the TagImageInStream request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) TagImageInStreamSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// TagImageInStreamResponder handles the response to the TagImageInStream request. The method always +// closes the http.Response Body. +func (client BaseClient) TagImageInStreamResponder(resp *http.Response) (result TagResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v2.0/computervision/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v2.0/computervision/models.go new file mode 100644 index 000000000..5f3de81b1 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v2.0/computervision/models.go @@ -0,0 +1,594 @@ +package computervision + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "encoding/json" + "github.com/Azure/go-autorest/autorest" + "io" +) + +// AzureRegions enumerates the values for azure regions. +type AzureRegions string + +const ( + // Australiaeast ... + Australiaeast AzureRegions = "australiaeast" + // Brazilsouth ... + Brazilsouth AzureRegions = "brazilsouth" + // Eastasia ... + Eastasia AzureRegions = "eastasia" + // Eastus ... + Eastus AzureRegions = "eastus" + // Eastus2 ... + Eastus2 AzureRegions = "eastus2" + // Northeurope ... + Northeurope AzureRegions = "northeurope" + // Southcentralus ... + Southcentralus AzureRegions = "southcentralus" + // Southeastasia ... + Southeastasia AzureRegions = "southeastasia" + // Westcentralus ... + Westcentralus AzureRegions = "westcentralus" + // Westeurope ... + Westeurope AzureRegions = "westeurope" + // Westus ... + Westus AzureRegions = "westus" + // Westus2 ... + Westus2 AzureRegions = "westus2" +) + +// PossibleAzureRegionsValues returns an array of possible values for the AzureRegions const type. +func PossibleAzureRegionsValues() []AzureRegions { + return []AzureRegions{Australiaeast, Brazilsouth, Eastasia, Eastus, Eastus2, Northeurope, Southcentralus, Southeastasia, Westcentralus, Westeurope, Westus, Westus2} +} + +// Details enumerates the values for details. +type Details string + +const ( + // Celebrities ... + Celebrities Details = "Celebrities" + // Landmarks ... + Landmarks Details = "Landmarks" +) + +// PossibleDetailsValues returns an array of possible values for the Details const type. +func PossibleDetailsValues() []Details { + return []Details{Celebrities, Landmarks} +} + +// ErrorCodes enumerates the values for error codes. +type ErrorCodes string + +const ( + // BadArgument ... + BadArgument ErrorCodes = "BadArgument" + // FailedToProcess ... + FailedToProcess ErrorCodes = "FailedToProcess" + // InternalServerError ... + InternalServerError ErrorCodes = "InternalServerError" + // InvalidDetails ... + InvalidDetails ErrorCodes = "InvalidDetails" + // InvalidImageFormat ... + InvalidImageFormat ErrorCodes = "InvalidImageFormat" + // InvalidImageSize ... + InvalidImageSize ErrorCodes = "InvalidImageSize" + // InvalidImageURL ... + InvalidImageURL ErrorCodes = "InvalidImageUrl" + // NotSupportedImage ... + NotSupportedImage ErrorCodes = "NotSupportedImage" + // NotSupportedLanguage ... + NotSupportedLanguage ErrorCodes = "NotSupportedLanguage" + // NotSupportedVisualFeature ... + NotSupportedVisualFeature ErrorCodes = "NotSupportedVisualFeature" + // StorageException ... + StorageException ErrorCodes = "StorageException" + // Timeout ... + Timeout ErrorCodes = "Timeout" + // Unspecified ... + Unspecified ErrorCodes = "Unspecified" +) + +// PossibleErrorCodesValues returns an array of possible values for the ErrorCodes const type. +func PossibleErrorCodesValues() []ErrorCodes { + return []ErrorCodes{BadArgument, FailedToProcess, InternalServerError, InvalidDetails, InvalidImageFormat, InvalidImageSize, InvalidImageURL, NotSupportedImage, NotSupportedLanguage, NotSupportedVisualFeature, StorageException, Timeout, Unspecified} +} + +// Gender enumerates the values for gender. +type Gender string + +const ( + // Female ... + Female Gender = "Female" + // Male ... + Male Gender = "Male" +) + +// PossibleGenderValues returns an array of possible values for the Gender const type. +func PossibleGenderValues() []Gender { + return []Gender{Female, Male} +} + +// OcrLanguages enumerates the values for ocr languages. +type OcrLanguages string + +const ( + // Ar ... + Ar OcrLanguages = "ar" + // Cs ... + Cs OcrLanguages = "cs" + // Da ... + Da OcrLanguages = "da" + // De ... + De OcrLanguages = "de" + // El ... + El OcrLanguages = "el" + // En ... + En OcrLanguages = "en" + // Es ... + Es OcrLanguages = "es" + // Fi ... + Fi OcrLanguages = "fi" + // Fr ... + Fr OcrLanguages = "fr" + // Hu ... + Hu OcrLanguages = "hu" + // It ... + It OcrLanguages = "it" + // Ja ... + Ja OcrLanguages = "ja" + // Ko ... + Ko OcrLanguages = "ko" + // Nb ... + Nb OcrLanguages = "nb" + // Nl ... + Nl OcrLanguages = "nl" + // Pl ... + Pl OcrLanguages = "pl" + // Pt ... + Pt OcrLanguages = "pt" + // Ro ... + Ro OcrLanguages = "ro" + // Ru ... + Ru OcrLanguages = "ru" + // Sk ... + Sk OcrLanguages = "sk" + // SrCyrl ... + SrCyrl OcrLanguages = "sr-Cyrl" + // SrLatn ... + SrLatn OcrLanguages = "sr-Latn" + // Sv ... + Sv OcrLanguages = "sv" + // Tr ... + Tr OcrLanguages = "tr" + // Unk ... + Unk OcrLanguages = "unk" + // ZhHans ... + ZhHans OcrLanguages = "zh-Hans" + // ZhHant ... + ZhHant OcrLanguages = "zh-Hant" +) + +// PossibleOcrLanguagesValues returns an array of possible values for the OcrLanguages const type. +func PossibleOcrLanguagesValues() []OcrLanguages { + return []OcrLanguages{Ar, Cs, Da, De, El, En, Es, Fi, Fr, Hu, It, Ja, Ko, Nb, Nl, Pl, Pt, Ro, Ru, Sk, SrCyrl, SrLatn, Sv, Tr, Unk, ZhHans, ZhHant} +} + +// TextOperationStatusCodes enumerates the values for text operation status codes. +type TextOperationStatusCodes string + +const ( + // Failed ... + Failed TextOperationStatusCodes = "Failed" + // NotStarted ... + NotStarted TextOperationStatusCodes = "Not Started" + // Running ... + Running TextOperationStatusCodes = "Running" + // Succeeded ... + Succeeded TextOperationStatusCodes = "Succeeded" +) + +// PossibleTextOperationStatusCodesValues returns an array of possible values for the TextOperationStatusCodes const type. +func PossibleTextOperationStatusCodesValues() []TextOperationStatusCodes { + return []TextOperationStatusCodes{Failed, NotStarted, Running, Succeeded} +} + +// TextRecognitionMode enumerates the values for text recognition mode. +type TextRecognitionMode string + +const ( + // Handwritten ... + Handwritten TextRecognitionMode = "Handwritten" + // Printed ... + Printed TextRecognitionMode = "Printed" +) + +// PossibleTextRecognitionModeValues returns an array of possible values for the TextRecognitionMode const type. +func PossibleTextRecognitionModeValues() []TextRecognitionMode { + return []TextRecognitionMode{Handwritten, Printed} +} + +// VisualFeatureTypes enumerates the values for visual feature types. +type VisualFeatureTypes string + +const ( + // VisualFeatureTypesAdult ... + VisualFeatureTypesAdult VisualFeatureTypes = "Adult" + // VisualFeatureTypesCategories ... + VisualFeatureTypesCategories VisualFeatureTypes = "Categories" + // VisualFeatureTypesColor ... + VisualFeatureTypesColor VisualFeatureTypes = "Color" + // VisualFeatureTypesDescription ... + VisualFeatureTypesDescription VisualFeatureTypes = "Description" + // VisualFeatureTypesFaces ... + VisualFeatureTypesFaces VisualFeatureTypes = "Faces" + // VisualFeatureTypesImageType ... + VisualFeatureTypesImageType VisualFeatureTypes = "ImageType" + // VisualFeatureTypesTags ... + VisualFeatureTypesTags VisualFeatureTypes = "Tags" +) + +// PossibleVisualFeatureTypesValues returns an array of possible values for the VisualFeatureTypes const type. +func PossibleVisualFeatureTypesValues() []VisualFeatureTypes { + return []VisualFeatureTypes{VisualFeatureTypesAdult, VisualFeatureTypesCategories, VisualFeatureTypesColor, VisualFeatureTypesDescription, VisualFeatureTypesFaces, VisualFeatureTypesImageType, VisualFeatureTypesTags} +} + +// AdultInfo an object describing whether the image contains adult-oriented content and/or is racy. +type AdultInfo struct { + // IsAdultContent - A value indicating if the image contains adult-oriented content. + IsAdultContent *bool `json:"isAdultContent,omitempty"` + // IsRacyContent - A value indicating if the image is race. + IsRacyContent *bool `json:"isRacyContent,omitempty"` + // AdultScore - Score from 0 to 1 that indicates how much of adult content is within the image. + AdultScore *float64 `json:"adultScore,omitempty"` + // RacyScore - Score from 0 to 1 that indicates how suggestive is the image. + RacyScore *float64 `json:"racyScore,omitempty"` +} + +// Category an object describing identified category. +type Category struct { + // Name - Name of the category. + Name *string `json:"name,omitempty"` + // Score - Scoring of the category. + Score *float64 `json:"score,omitempty"` + Detail *CategoryDetail `json:"detail,omitempty"` +} + +// CategoryDetail an object describing additional category details. +type CategoryDetail struct { + // Celebrities - An array of celebrities if any identified. + Celebrities *[]CelebritiesModel `json:"celebrities,omitempty"` + // Landmarks - An array of landmarks if any identified. + Landmarks *[]LandmarksModel `json:"landmarks,omitempty"` +} + +// CelebritiesModel an object describing possible celebrity identification. +type CelebritiesModel struct { + // Name - Name of the celebrity. + Name *string `json:"name,omitempty"` + // Confidence - Level of confidence ranging from 0 to 1. + Confidence *float64 `json:"confidence,omitempty"` + FaceRectangle *FaceRectangle `json:"faceRectangle,omitempty"` +} + +// CelebrityResults list of celebrities recognized in the image. +type CelebrityResults struct { + Celebrities *[]CelebritiesModel `json:"celebrities,omitempty"` + // RequestID - Id of the REST API request. + RequestID *string `json:"requestId,omitempty"` + Metadata *ImageMetadata `json:"metadata,omitempty"` +} + +// ColorInfo an object providing additional metadata describing color attributes. +type ColorInfo struct { + // DominantColorForeground - Possible dominant foreground color. + DominantColorForeground *string `json:"dominantColorForeground,omitempty"` + // DominantColorBackground - Possible dominant background color. + DominantColorBackground *string `json:"dominantColorBackground,omitempty"` + // DominantColors - An array of possible dominant colors. + DominantColors *[]string `json:"dominantColors,omitempty"` + // AccentColor - Possible accent color. + AccentColor *string `json:"accentColor,omitempty"` + // IsBWImg - A value indicating if the image is black and white. + IsBWImg *bool `json:"isBWImg,omitempty"` +} + +// DomainModelResults result of image analysis using a specific domain model including additional metadata. +type DomainModelResults struct { + autorest.Response `json:"-"` + // Result - Model-specific response + Result interface{} `json:"result,omitempty"` + // RequestID - Id of the REST API request. + RequestID *string `json:"requestId,omitempty"` + Metadata *ImageMetadata `json:"metadata,omitempty"` +} + +// Error ... +type Error struct { + // Code - The error code. Possible values include: 'InvalidImageURL', 'InvalidImageFormat', 'InvalidImageSize', 'NotSupportedVisualFeature', 'NotSupportedImage', 'InvalidDetails', 'NotSupportedLanguage', 'BadArgument', 'FailedToProcess', 'Timeout', 'InternalServerError', 'Unspecified', 'StorageException' + Code ErrorCodes `json:"code,omitempty"` + // Message - A message explaining the error reported by the service. + Message *string `json:"message,omitempty"` + // RequestID - A unique request identifier. + RequestID *string `json:"requestId,omitempty"` +} + +// FaceDescription an object describing a face identified in the image. +type FaceDescription struct { + // Age - Possible age of the face. + Age *int32 `json:"age,omitempty"` + // Gender - Possible gender of the face. Possible values include: 'Male', 'Female' + Gender Gender `json:"gender,omitempty"` + FaceRectangle *FaceRectangle `json:"faceRectangle,omitempty"` +} + +// FaceRectangle an object describing face rectangle. +type FaceRectangle struct { + // Left - X-coordinate of the top left point of the face. + Left *int32 `json:"left,omitempty"` + // Top - Y-coordinate of the top left point of the face. + Top *int32 `json:"top,omitempty"` + // Width - Width measured from the top-left point of the face. + Width *int32 `json:"width,omitempty"` + // Height - Height measured from the top-left point of the face. + Height *int32 `json:"height,omitempty"` +} + +// ImageAnalysis result of AnalyzeImage operation. +type ImageAnalysis struct { + autorest.Response `json:"-"` + // Categories - An array indicating identified categories. + Categories *[]Category `json:"categories,omitempty"` + Adult *AdultInfo `json:"adult,omitempty"` + Color *ColorInfo `json:"color,omitempty"` + ImageType *ImageType `json:"imageType,omitempty"` + // Tags - A list of tags with confidence level. + Tags *[]ImageTag `json:"tags,omitempty"` + Description *ImageDescriptionDetails `json:"description,omitempty"` + // Faces - An array of possible faces within the image. + Faces *[]FaceDescription `json:"faces,omitempty"` + // RequestID - Id of the request for tracking purposes. + RequestID *string `json:"requestId,omitempty"` + Metadata *ImageMetadata `json:"metadata,omitempty"` +} + +// ImageCaption an image caption, i.e. a brief description of what the image depicts. +type ImageCaption struct { + // Text - The text of the caption + Text *string `json:"text,omitempty"` + // Confidence - The level of confidence the service has in the caption + Confidence *float64 `json:"confidence,omitempty"` +} + +// ImageDescription a collection of content tags, along with a list of captions sorted by confidence level, and +// image metadata. +type ImageDescription struct { + autorest.Response `json:"-"` + *ImageDescriptionDetails `json:"description,omitempty"` + // RequestID - Id of the REST API request. + RequestID *string `json:"requestId,omitempty"` + Metadata *ImageMetadata `json:"metadata,omitempty"` +} + +// MarshalJSON is the custom marshaler for ImageDescription. +func (ID ImageDescription) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ID.ImageDescriptionDetails != nil { + objectMap["description"] = ID.ImageDescriptionDetails + } + if ID.RequestID != nil { + objectMap["requestId"] = ID.RequestID + } + if ID.Metadata != nil { + objectMap["metadata"] = ID.Metadata + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ImageDescription struct. +func (ID *ImageDescription) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "description": + if v != nil { + var imageDescriptionDetails ImageDescriptionDetails + err = json.Unmarshal(*v, &imageDescriptionDetails) + if err != nil { + return err + } + ID.ImageDescriptionDetails = &imageDescriptionDetails + } + case "requestId": + if v != nil { + var requestID string + err = json.Unmarshal(*v, &requestID) + if err != nil { + return err + } + ID.RequestID = &requestID + } + case "metadata": + if v != nil { + var metadata ImageMetadata + err = json.Unmarshal(*v, &metadata) + if err != nil { + return err + } + ID.Metadata = &metadata + } + } + } + + return nil +} + +// ImageDescriptionDetails a collection of content tags, along with a list of captions sorted by confidence level, +// and image metadata. +type ImageDescriptionDetails struct { + // Tags - A collection of image tags. + Tags *[]string `json:"tags,omitempty"` + // Captions - A list of captions, sorted by confidence level. + Captions *[]ImageCaption `json:"captions,omitempty"` +} + +// ImageMetadata image metadata +type ImageMetadata struct { + // Width - Image width + Width *int32 `json:"width,omitempty"` + // Height - Image height + Height *int32 `json:"height,omitempty"` + // Format - Image format + Format *string `json:"format,omitempty"` +} + +// ImageTag an image caption, i.e. a brief description of what the image depicts. +type ImageTag struct { + // Name - The tag value + Name *string `json:"name,omitempty"` + // Confidence - The level of confidence the service has in the caption + Confidence *float64 `json:"confidence,omitempty"` + // Hint - Optional categorization for the tag + Hint *string `json:"hint,omitempty"` +} + +// ImageType an object providing possible image types and matching confidence levels. +type ImageType struct { + // ClipArtType - Confidence level that the image is a clip art. + ClipArtType *float64 `json:"clipArtType,omitempty"` + // LineDrawingType - Confidence level that the image is a line drawing. + LineDrawingType *float64 `json:"lineDrawingType,omitempty"` +} + +// ImageURL ... +type ImageURL struct { + // URL - Publicly reachable URL of an image + URL *string `json:"url,omitempty"` +} + +// LandmarkResults list of landmarks recognized in the image. +type LandmarkResults struct { + Landmarks *[]LandmarksModel `json:"landmarks,omitempty"` + // RequestID - Id of the REST API request. + RequestID *string `json:"requestId,omitempty"` + Metadata *ImageMetadata `json:"metadata,omitempty"` +} + +// LandmarksModel a landmark recognized in the image +type LandmarksModel struct { + // Name - Name of the landmark. + Name *string `json:"name,omitempty"` + // Confidence - Confidence level for the landmark recognition. + Confidence *float64 `json:"confidence,omitempty"` +} + +// Line ... +type Line struct { + BoundingBox *[]int32 `json:"boundingBox,omitempty"` + Text *string `json:"text,omitempty"` + Words *[]Word `json:"words,omitempty"` +} + +// ListModelsResult result of the List Domain Models operation. +type ListModelsResult struct { + autorest.Response `json:"-"` + // ModelsProperty - An array of supported models. + ModelsProperty *[]ModelDescription `json:"models,omitempty"` +} + +// ModelDescription an object describing supported model by name and categories. +type ModelDescription struct { + Name *string `json:"name,omitempty"` + Categories *[]string `json:"categories,omitempty"` +} + +// OcrLine an object describing a single recognized line of text. +type OcrLine struct { + // BoundingBox - Bounding box of a recognized line. The four integers represent the x-coordinate of the left edge, the y-coordinate of the top edge, width, and height of the bounding box, in the coordinate system of the input image, after it has been rotated around its center according to the detected text angle (see textAngle property), with the origin at the top-left corner, and the y-axis pointing down. + BoundingBox *string `json:"boundingBox,omitempty"` + // Words - An array of objects, where each object represents a recognized word. + Words *[]OcrWord `json:"words,omitempty"` +} + +// OcrRegion a region consists of multiple lines (e.g. a column of text in a multi-column document). +type OcrRegion struct { + // BoundingBox - Bounding box of a recognized region. The four integers represent the x-coordinate of the left edge, the y-coordinate of the top edge, width, and height of the bounding box, in the coordinate system of the input image, after it has been rotated around its center according to the detected text angle (see textAngle property), with the origin at the top-left corner, and the y-axis pointing down. + BoundingBox *string `json:"boundingBox,omitempty"` + Lines *[]OcrLine `json:"lines,omitempty"` +} + +// OcrResult ... +type OcrResult struct { + autorest.Response `json:"-"` + // Language - The BCP-47 language code of the text in the image. + Language *string `json:"language,omitempty"` + // TextAngle - The angle, in degrees, of the detected text with respect to the closest horizontal or vertical direction. After rotating the input image clockwise by this angle, the recognized text lines become horizontal or vertical. In combination with the orientation property it can be used to overlay recognition results correctly on the original image, by rotating either the original image or recognition results by a suitable angle around the center of the original image. If the angle cannot be confidently detected, this property is not present. If the image contains text at different angles, only part of the text will be recognized correctly. + TextAngle *float64 `json:"textAngle,omitempty"` + // Orientation - Orientation of the text recognized in the image. The value (up,down,left, or right) refers to the direction that the top of the recognized text is facing, after the image has been rotated around its center according to the detected text angle (see textAngle property). + Orientation *string `json:"orientation,omitempty"` + // Regions - An array of objects, where each object represents a region of recognized text. + Regions *[]OcrRegion `json:"regions,omitempty"` +} + +// OcrWord information on a recognized word. +type OcrWord struct { + // BoundingBox - Bounding box of a recognized word. The four integers represent the x-coordinate of the left edge, the y-coordinate of the top edge, width, and height of the bounding box, in the coordinate system of the input image, after it has been rotated around its center according to the detected text angle (see textAngle property), with the origin at the top-left corner, and the y-axis pointing down. + BoundingBox *string `json:"boundingBox,omitempty"` + // Text - String value of a recognized word. + Text *string `json:"text,omitempty"` +} + +// ReadCloser ... +type ReadCloser struct { + autorest.Response `json:"-"` + Value *io.ReadCloser `json:"value,omitempty"` +} + +// RecognitionResult ... +type RecognitionResult struct { + Lines *[]Line `json:"lines,omitempty"` +} + +// TagResult the results of a image tag operation, including any tags and image metadata. +type TagResult struct { + autorest.Response `json:"-"` + // Tags - A list of tags with confidence level. + Tags *[]ImageTag `json:"tags,omitempty"` + // RequestID - Id of the REST API request. + RequestID *string `json:"requestId,omitempty"` + Metadata *ImageMetadata `json:"metadata,omitempty"` +} + +// TextOperationResult ... +type TextOperationResult struct { + autorest.Response `json:"-"` + // Status - Status of the text operation. Possible values include: 'NotStarted', 'Running', 'Failed', 'Succeeded' + Status TextOperationStatusCodes `json:"status,omitempty"` + RecognitionResult *RecognitionResult `json:"recognitionResult,omitempty"` +} + +// Word ... +type Word struct { + BoundingBox *[]int32 `json:"boundingBox,omitempty"` + Text *string `json:"text,omitempty"` +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v2.0/computervision/version.go b/vendor/github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v2.0/computervision/version.go new file mode 100644 index 000000000..e5fe9ed32 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v2.0/computervision/version.go @@ -0,0 +1,30 @@ +package computervision + +import "github.com/Azure/azure-sdk-for-go/version" + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// UserAgent returns the UserAgent string to use when sending http.Requests. +func UserAgent() string { + return "Azure-SDK-For-Go/" + version.Number + " computervision/2.0" +} + +// Version returns the semantic version (see http://semver.org) of the client. +func Version() string { + return version.Number +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v2.0/luis/authoring/apps.go b/vendor/github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v2.0/luis/authoring/apps.go index 678aa0cb4..7a138efc6 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v2.0/luis/authoring/apps.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v2.0/luis/authoring/apps.go @@ -553,7 +553,7 @@ func (client AppsClient) List(ctx context.Context, skip *int32, take *int32) (re Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}, {TargetValue: take, Constraints: []validation.Constraint{{Target: "take", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "take", Name: validation.InclusiveMaximum, Rule: 500, Chain: nil}, + Chain: []validation.Constraint{{Target: "take", Name: validation.InclusiveMaximum, Rule: int64(500), Chain: nil}, {Target: "take", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("authoring.AppsClient", "List", err.Error()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v2.0/luis/authoring/examples.go b/vendor/github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v2.0/luis/authoring/examples.go index 2aab906c4..b40a639a6 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v2.0/luis/authoring/examples.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v2.0/luis/authoring/examples.go @@ -255,7 +255,7 @@ func (client ExamplesClient) List(ctx context.Context, appID uuid.UUID, versionI Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}, {TargetValue: take, Constraints: []validation.Constraint{{Target: "take", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "take", Name: validation.InclusiveMaximum, Rule: 500, Chain: nil}, + Chain: []validation.Constraint{{Target: "take", Name: validation.InclusiveMaximum, Rule: int64(500), Chain: nil}, {Target: "take", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("authoring.ExamplesClient", "List", err.Error()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v2.0/luis/authoring/features.go b/vendor/github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v2.0/luis/authoring/features.go index e7a49593c..f3da143d1 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v2.0/luis/authoring/features.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v2.0/luis/authoring/features.go @@ -249,7 +249,7 @@ func (client FeaturesClient) List(ctx context.Context, appID uuid.UUID, versionI Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}, {TargetValue: take, Constraints: []validation.Constraint{{Target: "take", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "take", Name: validation.InclusiveMaximum, Rule: 500, Chain: nil}, + Chain: []validation.Constraint{{Target: "take", Name: validation.InclusiveMaximum, Rule: int64(500), Chain: nil}, {Target: "take", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("authoring.FeaturesClient", "List", err.Error()) @@ -340,7 +340,7 @@ func (client FeaturesClient) ListPhraseLists(ctx context.Context, appID uuid.UUI Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}, {TargetValue: take, Constraints: []validation.Constraint{{Target: "take", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "take", Name: validation.InclusiveMaximum, Rule: 500, Chain: nil}, + Chain: []validation.Constraint{{Target: "take", Name: validation.InclusiveMaximum, Rule: int64(500), Chain: nil}, {Target: "take", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("authoring.FeaturesClient", "ListPhraseLists", err.Error()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v2.0/luis/authoring/model.go b/vendor/github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v2.0/luis/authoring/model.go index bb576f070..913554fb7 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v2.0/luis/authoring/model.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v2.0/luis/authoring/model.go @@ -3046,7 +3046,7 @@ func (client ModelClient) ExamplesMethod(ctx context.Context, appID uuid.UUID, v Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}, {TargetValue: take, Constraints: []validation.Constraint{{Target: "take", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "take", Name: validation.InclusiveMaximum, Rule: 500, Chain: nil}, + Chain: []validation.Constraint{{Target: "take", Name: validation.InclusiveMaximum, Rule: int64(500), Chain: nil}, {Target: "take", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("authoring.ModelClient", "ExamplesMethod", err.Error()) @@ -3869,7 +3869,7 @@ func (client ModelClient) GetEntitySuggestions(ctx context.Context, appID uuid.U if err := validation.Validate([]validation.Validation{ {TargetValue: take, Constraints: []validation.Constraint{{Target: "take", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "take", Name: validation.InclusiveMaximum, Rule: 500, Chain: nil}, + Chain: []validation.Constraint{{Target: "take", Name: validation.InclusiveMaximum, Rule: int64(500), Chain: nil}, {Target: "take", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("authoring.ModelClient", "GetEntitySuggestions", err.Error()) @@ -4421,7 +4421,7 @@ func (client ModelClient) GetIntentSuggestions(ctx context.Context, appID uuid.U if err := validation.Validate([]validation.Validation{ {TargetValue: take, Constraints: []validation.Constraint{{Target: "take", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "take", Name: validation.InclusiveMaximum, Rule: 500, Chain: nil}, + Chain: []validation.Constraint{{Target: "take", Name: validation.InclusiveMaximum, Rule: int64(500), Chain: nil}, {Target: "take", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("authoring.ModelClient", "GetIntentSuggestions", err.Error()) @@ -4574,7 +4574,7 @@ func (client ModelClient) GetPatternAnyEntityInfos(ctx context.Context, appID uu Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}, {TargetValue: take, Constraints: []validation.Constraint{{Target: "take", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "take", Name: validation.InclusiveMaximum, Rule: 500, Chain: nil}, + Chain: []validation.Constraint{{Target: "take", Name: validation.InclusiveMaximum, Rule: int64(500), Chain: nil}, {Target: "take", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("authoring.ModelClient", "GetPatternAnyEntityInfos", err.Error()) @@ -5065,7 +5065,7 @@ func (client ModelClient) GetRegexEntityInfos(ctx context.Context, appID uuid.UU Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}, {TargetValue: take, Constraints: []validation.Constraint{{Target: "take", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "take", Name: validation.InclusiveMaximum, Rule: 500, Chain: nil}, + Chain: []validation.Constraint{{Target: "take", Name: validation.InclusiveMaximum, Rule: int64(500), Chain: nil}, {Target: "take", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("authoring.ModelClient", "GetRegexEntityInfos", err.Error()) @@ -5290,7 +5290,7 @@ func (client ModelClient) ListClosedLists(ctx context.Context, appID uuid.UUID, Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}, {TargetValue: take, Constraints: []validation.Constraint{{Target: "take", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "take", Name: validation.InclusiveMaximum, Rule: 500, Chain: nil}, + Chain: []validation.Constraint{{Target: "take", Name: validation.InclusiveMaximum, Rule: int64(500), Chain: nil}, {Target: "take", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("authoring.ModelClient", "ListClosedLists", err.Error()) @@ -5381,7 +5381,7 @@ func (client ModelClient) ListCompositeEntities(ctx context.Context, appID uuid. Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}, {TargetValue: take, Constraints: []validation.Constraint{{Target: "take", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "take", Name: validation.InclusiveMaximum, Rule: 500, Chain: nil}, + Chain: []validation.Constraint{{Target: "take", Name: validation.InclusiveMaximum, Rule: int64(500), Chain: nil}, {Target: "take", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("authoring.ModelClient", "ListCompositeEntities", err.Error()) @@ -5664,7 +5664,7 @@ func (client ModelClient) ListEntities(ctx context.Context, appID uuid.UUID, ver Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}, {TargetValue: take, Constraints: []validation.Constraint{{Target: "take", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "take", Name: validation.InclusiveMaximum, Rule: 500, Chain: nil}, + Chain: []validation.Constraint{{Target: "take", Name: validation.InclusiveMaximum, Rule: int64(500), Chain: nil}, {Target: "take", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("authoring.ModelClient", "ListEntities", err.Error()) @@ -5755,7 +5755,7 @@ func (client ModelClient) ListHierarchicalEntities(ctx context.Context, appID uu Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}, {TargetValue: take, Constraints: []validation.Constraint{{Target: "take", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "take", Name: validation.InclusiveMaximum, Rule: 500, Chain: nil}, + Chain: []validation.Constraint{{Target: "take", Name: validation.InclusiveMaximum, Rule: int64(500), Chain: nil}, {Target: "take", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("authoring.ModelClient", "ListHierarchicalEntities", err.Error()) @@ -5846,7 +5846,7 @@ func (client ModelClient) ListIntents(ctx context.Context, appID uuid.UUID, vers Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}, {TargetValue: take, Constraints: []validation.Constraint{{Target: "take", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "take", Name: validation.InclusiveMaximum, Rule: 500, Chain: nil}, + Chain: []validation.Constraint{{Target: "take", Name: validation.InclusiveMaximum, Rule: int64(500), Chain: nil}, {Target: "take", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("authoring.ModelClient", "ListIntents", err.Error()) @@ -5937,7 +5937,7 @@ func (client ModelClient) ListModels(ctx context.Context, appID uuid.UUID, versi Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}, {TargetValue: take, Constraints: []validation.Constraint{{Target: "take", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "take", Name: validation.InclusiveMaximum, Rule: 500, Chain: nil}, + Chain: []validation.Constraint{{Target: "take", Name: validation.InclusiveMaximum, Rule: int64(500), Chain: nil}, {Target: "take", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("authoring.ModelClient", "ListModels", err.Error()) @@ -6092,7 +6092,7 @@ func (client ModelClient) ListPrebuilts(ctx context.Context, appID uuid.UUID, ve Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}, {TargetValue: take, Constraints: []validation.Constraint{{Target: "take", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "take", Name: validation.InclusiveMaximum, Rule: 500, Chain: nil}, + Chain: []validation.Constraint{{Target: "take", Name: validation.InclusiveMaximum, Rule: int64(500), Chain: nil}, {Target: "take", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("authoring.ModelClient", "ListPrebuilts", err.Error()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v2.0/luis/authoring/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v2.0/luis/authoring/models.go index 7cc2f76c2..3c4a4e2a7 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v2.0/luis/authoring/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v2.0/luis/authoring/models.go @@ -33,18 +33,26 @@ const ( Australiaeast AzureRegions = "australiaeast" // Brazilsouth ... Brazilsouth AzureRegions = "brazilsouth" + // Canadacentral ... + Canadacentral AzureRegions = "canadacentral" + // Centralindia ... + Centralindia AzureRegions = "centralindia" // Eastasia ... Eastasia AzureRegions = "eastasia" // Eastus ... Eastus AzureRegions = "eastus" // Eastus2 ... Eastus2 AzureRegions = "eastus2" + // Japaneast ... + Japaneast AzureRegions = "japaneast" // Northeurope ... Northeurope AzureRegions = "northeurope" // Southcentralus ... Southcentralus AzureRegions = "southcentralus" // Southeastasia ... Southeastasia AzureRegions = "southeastasia" + // Uksouth ... + Uksouth AzureRegions = "uksouth" // Westcentralus ... Westcentralus AzureRegions = "westcentralus" // Westeurope ... @@ -57,7 +65,7 @@ const ( // PossibleAzureRegionsValues returns an array of possible values for the AzureRegions const type. func PossibleAzureRegionsValues() []AzureRegions { - return []AzureRegions{Australiaeast, Brazilsouth, Eastasia, Eastus, Eastus2, Northeurope, Southcentralus, Southeastasia, Westcentralus, Westeurope, Westus, Westus2} + return []AzureRegions{Australiaeast, Brazilsouth, Canadacentral, Centralindia, Eastasia, Eastus, Eastus2, Japaneast, Northeurope, Southcentralus, Southeastasia, Uksouth, Westcentralus, Westeurope, Westus, Westus2} } // OperationStatusType enumerates the values for operation status type. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v2.0/luis/authoring/pattern.go b/vendor/github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v2.0/luis/authoring/pattern.go index b96539d0a..48e416b18 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v2.0/luis/authoring/pattern.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v2.0/luis/authoring/pattern.go @@ -329,7 +329,7 @@ func (client PatternClient) GetIntentPatterns(ctx context.Context, appID uuid.UU Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}, {TargetValue: take, Constraints: []validation.Constraint{{Target: "take", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "take", Name: validation.InclusiveMaximum, Rule: 500, Chain: nil}, + Chain: []validation.Constraint{{Target: "take", Name: validation.InclusiveMaximum, Rule: int64(500), Chain: nil}, {Target: "take", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("authoring.PatternClient", "GetIntentPatterns", err.Error()) @@ -421,7 +421,7 @@ func (client PatternClient) GetPatterns(ctx context.Context, appID uuid.UUID, ve Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}, {TargetValue: take, Constraints: []validation.Constraint{{Target: "take", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "take", Name: validation.InclusiveMaximum, Rule: 500, Chain: nil}, + Chain: []validation.Constraint{{Target: "take", Name: validation.InclusiveMaximum, Rule: int64(500), Chain: nil}, {Target: "take", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("authoring.PatternClient", "GetPatterns", err.Error()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v2.0/luis/authoring/versions.go b/vendor/github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v2.0/luis/authoring/versions.go index c77bc18d9..ab45c3a3a 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v2.0/luis/authoring/versions.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v2.0/luis/authoring/versions.go @@ -450,7 +450,7 @@ func (client VersionsClient) List(ctx context.Context, appID uuid.UUID, skip *in Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}, {TargetValue: take, Constraints: []validation.Constraint{{Target: "take", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "take", Name: validation.InclusiveMaximum, Rule: 500, Chain: nil}, + Chain: []validation.Constraint{{Target: "take", Name: validation.InclusiveMaximum, Rule: int64(500), Chain: nil}, {Target: "take", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("authoring.VersionsClient", "List", err.Error()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v2.0/luis/runtime/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v2.0/luis/runtime/models.go index a97ba4f09..2d134c1f5 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v2.0/luis/runtime/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v2.0/luis/runtime/models.go @@ -30,18 +30,26 @@ const ( Australiaeast AzureRegions = "australiaeast" // Brazilsouth ... Brazilsouth AzureRegions = "brazilsouth" + // Canadacentral ... + Canadacentral AzureRegions = "canadacentral" + // Centralindia ... + Centralindia AzureRegions = "centralindia" // Eastasia ... Eastasia AzureRegions = "eastasia" // Eastus ... Eastus AzureRegions = "eastus" // Eastus2 ... Eastus2 AzureRegions = "eastus2" + // Japaneast ... + Japaneast AzureRegions = "japaneast" // Northeurope ... Northeurope AzureRegions = "northeurope" // Southcentralus ... Southcentralus AzureRegions = "southcentralus" // Southeastasia ... Southeastasia AzureRegions = "southeastasia" + // Uksouth ... + Uksouth AzureRegions = "uksouth" // Westcentralus ... Westcentralus AzureRegions = "westcentralus" // Westeurope ... @@ -54,7 +62,7 @@ const ( // PossibleAzureRegionsValues returns an array of possible values for the AzureRegions const type. func PossibleAzureRegionsValues() []AzureRegions { - return []AzureRegions{Australiaeast, Brazilsouth, Eastasia, Eastus, Eastus2, Northeurope, Southcentralus, Southeastasia, Westcentralus, Westeurope, Westus, Westus2} + return []AzureRegions{Australiaeast, Brazilsouth, Canadacentral, Centralindia, Eastasia, Eastus, Eastus2, Japaneast, Northeurope, Southcentralus, Southeastasia, Uksouth, Westcentralus, Westeurope, Westus, Westus2} } // APIError error information returned by the API diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v2.0/textanalytics/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v2.0/textanalytics/models.go index e688fafaa..43c7fda25 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v2.0/textanalytics/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v2.0/textanalytics/models.go @@ -29,18 +29,26 @@ const ( Australiaeast AzureRegions = "australiaeast" // Brazilsouth ... Brazilsouth AzureRegions = "brazilsouth" + // Canadacentral ... + Canadacentral AzureRegions = "canadacentral" + // Centralindia ... + Centralindia AzureRegions = "centralindia" // Eastasia ... Eastasia AzureRegions = "eastasia" // Eastus ... Eastus AzureRegions = "eastus" // Eastus2 ... Eastus2 AzureRegions = "eastus2" + // Japaneast ... + Japaneast AzureRegions = "japaneast" // Northeurope ... Northeurope AzureRegions = "northeurope" // Southcentralus ... Southcentralus AzureRegions = "southcentralus" // Southeastasia ... Southeastasia AzureRegions = "southeastasia" + // Uksouth ... + Uksouth AzureRegions = "uksouth" // Westcentralus ... Westcentralus AzureRegions = "westcentralus" // Westeurope ... @@ -53,7 +61,7 @@ const ( // PossibleAzureRegionsValues returns an array of possible values for the AzureRegions const type. func PossibleAzureRegionsValues() []AzureRegions { - return []AzureRegions{Australiaeast, Brazilsouth, Eastasia, Eastus, Eastus2, Northeurope, Southcentralus, Southeastasia, Westcentralus, Westeurope, Westus, Westus2} + return []AzureRegions{Australiaeast, Brazilsouth, Canadacentral, Centralindia, Eastasia, Eastus, Eastus2, Japaneast, Northeurope, Southcentralus, Southeastasia, Uksouth, Westcentralus, Westeurope, Westus, Westus2} } // BatchInput ... diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-03-30/compute/virtualmachinescalesets.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-03-30/compute/virtualmachinescalesets.go index 5262b0c6b..6db4ac8bd 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-03-30/compute/virtualmachinescalesets.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-03-30/compute/virtualmachinescalesets.go @@ -52,15 +52,15 @@ func (client VirtualMachineScaleSetsClient) CreateOrUpdate(ctx context.Context, Chain: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetProperties.UpgradePolicy", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetProperties.UpgradePolicy.RollingUpgradePolicy", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetProperties.UpgradePolicy.RollingUpgradePolicy.MaxBatchInstancePercent", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetProperties.UpgradePolicy.RollingUpgradePolicy.MaxBatchInstancePercent", Name: validation.InclusiveMaximum, Rule: 100, Chain: nil}, + Chain: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetProperties.UpgradePolicy.RollingUpgradePolicy.MaxBatchInstancePercent", Name: validation.InclusiveMaximum, Rule: int64(100), Chain: nil}, {Target: "parameters.VirtualMachineScaleSetProperties.UpgradePolicy.RollingUpgradePolicy.MaxBatchInstancePercent", Name: validation.InclusiveMinimum, Rule: 5, Chain: nil}, }}, {Target: "parameters.VirtualMachineScaleSetProperties.UpgradePolicy.RollingUpgradePolicy.MaxUnhealthyInstancePercent", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetProperties.UpgradePolicy.RollingUpgradePolicy.MaxUnhealthyInstancePercent", Name: validation.InclusiveMaximum, Rule: 100, Chain: nil}, + Chain: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetProperties.UpgradePolicy.RollingUpgradePolicy.MaxUnhealthyInstancePercent", Name: validation.InclusiveMaximum, Rule: int64(100), Chain: nil}, {Target: "parameters.VirtualMachineScaleSetProperties.UpgradePolicy.RollingUpgradePolicy.MaxUnhealthyInstancePercent", Name: validation.InclusiveMinimum, Rule: 5, Chain: nil}, }}, {Target: "parameters.VirtualMachineScaleSetProperties.UpgradePolicy.RollingUpgradePolicy.MaxUnhealthyUpgradedInstancePercent", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetProperties.UpgradePolicy.RollingUpgradePolicy.MaxUnhealthyUpgradedInstancePercent", Name: validation.InclusiveMaximum, Rule: 100, Chain: nil}, + Chain: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetProperties.UpgradePolicy.RollingUpgradePolicy.MaxUnhealthyUpgradedInstancePercent", Name: validation.InclusiveMaximum, Rule: int64(100), Chain: nil}, {Target: "parameters.VirtualMachineScaleSetProperties.UpgradePolicy.RollingUpgradePolicy.MaxUnhealthyUpgradedInstancePercent", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, }}, }}, diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-04-01/compute/virtualmachinescalesets.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-04-01/compute/virtualmachinescalesets.go index dc742f64f..3cff89972 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-04-01/compute/virtualmachinescalesets.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-04-01/compute/virtualmachinescalesets.go @@ -52,15 +52,15 @@ func (client VirtualMachineScaleSetsClient) CreateOrUpdate(ctx context.Context, Chain: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetProperties.UpgradePolicy", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetProperties.UpgradePolicy.RollingUpgradePolicy", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetProperties.UpgradePolicy.RollingUpgradePolicy.MaxBatchInstancePercent", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetProperties.UpgradePolicy.RollingUpgradePolicy.MaxBatchInstancePercent", Name: validation.InclusiveMaximum, Rule: 100, Chain: nil}, + Chain: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetProperties.UpgradePolicy.RollingUpgradePolicy.MaxBatchInstancePercent", Name: validation.InclusiveMaximum, Rule: int64(100), Chain: nil}, {Target: "parameters.VirtualMachineScaleSetProperties.UpgradePolicy.RollingUpgradePolicy.MaxBatchInstancePercent", Name: validation.InclusiveMinimum, Rule: 5, Chain: nil}, }}, {Target: "parameters.VirtualMachineScaleSetProperties.UpgradePolicy.RollingUpgradePolicy.MaxUnhealthyInstancePercent", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetProperties.UpgradePolicy.RollingUpgradePolicy.MaxUnhealthyInstancePercent", Name: validation.InclusiveMaximum, Rule: 100, Chain: nil}, + Chain: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetProperties.UpgradePolicy.RollingUpgradePolicy.MaxUnhealthyInstancePercent", Name: validation.InclusiveMaximum, Rule: int64(100), Chain: nil}, {Target: "parameters.VirtualMachineScaleSetProperties.UpgradePolicy.RollingUpgradePolicy.MaxUnhealthyInstancePercent", Name: validation.InclusiveMinimum, Rule: 5, Chain: nil}, }}, {Target: "parameters.VirtualMachineScaleSetProperties.UpgradePolicy.RollingUpgradePolicy.MaxUnhealthyUpgradedInstancePercent", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetProperties.UpgradePolicy.RollingUpgradePolicy.MaxUnhealthyUpgradedInstancePercent", Name: validation.InclusiveMaximum, Rule: 100, Chain: nil}, + Chain: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetProperties.UpgradePolicy.RollingUpgradePolicy.MaxUnhealthyUpgradedInstancePercent", Name: validation.InclusiveMaximum, Rule: int64(100), Chain: nil}, {Target: "parameters.VirtualMachineScaleSetProperties.UpgradePolicy.RollingUpgradePolicy.MaxUnhealthyUpgradedInstancePercent", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, }}, }}, diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/consumption/mgmt/2017-11-30/consumption/usagedetails.go b/vendor/github.com/Azure/azure-sdk-for-go/services/consumption/mgmt/2017-11-30/consumption/usagedetails.go index 27c794538..b8465bfe8 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/consumption/mgmt/2017-11-30/consumption/usagedetails.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/consumption/mgmt/2017-11-30/consumption/usagedetails.go @@ -61,7 +61,7 @@ func (client UsageDetailsClient) List(ctx context.Context, scope string, expand if err := validation.Validate([]validation.Validation{ {TargetValue: top, Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: int64(1000), Chain: nil}, {Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("consumption.UsageDetailsClient", "List", err.Error()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/consumption/mgmt/2018-01-31/consumption/marketplaces.go b/vendor/github.com/Azure/azure-sdk-for-go/services/consumption/mgmt/2018-01-31/consumption/marketplaces.go index 50eb7bf1a..3f205640e 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/consumption/mgmt/2018-01-31/consumption/marketplaces.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/consumption/mgmt/2018-01-31/consumption/marketplaces.go @@ -55,7 +55,7 @@ func (client MarketplacesClient) List(ctx context.Context, filter string, top *i if err := validation.Validate([]validation.Validation{ {TargetValue: top, Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: int64(1000), Chain: nil}, {Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("consumption.MarketplacesClient", "List", err.Error()) @@ -173,7 +173,7 @@ func (client MarketplacesClient) ListByBillingPeriod(ctx context.Context, billin if err := validation.Validate([]validation.Validation{ {TargetValue: top, Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: int64(1000), Chain: nil}, {Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("consumption.MarketplacesClient", "ListByBillingPeriod", err.Error()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/consumption/mgmt/2018-01-31/consumption/pricesheet.go b/vendor/github.com/Azure/azure-sdk-for-go/services/consumption/mgmt/2018-01-31/consumption/pricesheet.go index b09e49a2a..0416e4265 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/consumption/mgmt/2018-01-31/consumption/pricesheet.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/consumption/mgmt/2018-01-31/consumption/pricesheet.go @@ -54,7 +54,7 @@ func (client PriceSheetClient) Get(ctx context.Context, expand string, skiptoken if err := validation.Validate([]validation.Validation{ {TargetValue: top, Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: int64(1000), Chain: nil}, {Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("consumption.PriceSheetClient", "Get", err.Error()) @@ -143,7 +143,7 @@ func (client PriceSheetClient) GetByBillingPeriod(ctx context.Context, billingPe if err := validation.Validate([]validation.Validation{ {TargetValue: top, Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: int64(1000), Chain: nil}, {Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("consumption.PriceSheetClient", "GetByBillingPeriod", err.Error()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/consumption/mgmt/2018-01-31/consumption/usagedetails.go b/vendor/github.com/Azure/azure-sdk-for-go/services/consumption/mgmt/2018-01-31/consumption/usagedetails.go index 6818e7242..3cadd37b2 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/consumption/mgmt/2018-01-31/consumption/usagedetails.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/consumption/mgmt/2018-01-31/consumption/usagedetails.go @@ -57,7 +57,7 @@ func (client UsageDetailsClient) List(ctx context.Context, expand string, filter if err := validation.Validate([]validation.Validation{ {TargetValue: top, Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: int64(1000), Chain: nil}, {Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("consumption.UsageDetailsClient", "List", err.Error()) @@ -180,7 +180,7 @@ func (client UsageDetailsClient) ListByBillingPeriod(ctx context.Context, billin if err := validation.Validate([]validation.Validation{ {TargetValue: top, Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: int64(1000), Chain: nil}, {Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("consumption.UsageDetailsClient", "ListByBillingPeriod", err.Error()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/consumption/mgmt/2018-03-31/consumption/marketplaces.go b/vendor/github.com/Azure/azure-sdk-for-go/services/consumption/mgmt/2018-03-31/consumption/marketplaces.go index 88950ed6d..1b8737b33 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/consumption/mgmt/2018-03-31/consumption/marketplaces.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/consumption/mgmt/2018-03-31/consumption/marketplaces.go @@ -55,7 +55,7 @@ func (client MarketplacesClient) List(ctx context.Context, filter string, top *i if err := validation.Validate([]validation.Validation{ {TargetValue: top, Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: int64(1000), Chain: nil}, {Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("consumption.MarketplacesClient", "List", err.Error()) @@ -173,7 +173,7 @@ func (client MarketplacesClient) ListByBillingPeriod(ctx context.Context, billin if err := validation.Validate([]validation.Validation{ {TargetValue: top, Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: int64(1000), Chain: nil}, {Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("consumption.MarketplacesClient", "ListByBillingPeriod", err.Error()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/consumption/mgmt/2018-03-31/consumption/marketplacesbybillingaccount.go b/vendor/github.com/Azure/azure-sdk-for-go/services/consumption/mgmt/2018-03-31/consumption/marketplacesbybillingaccount.go index 6d44b3066..4dd588947 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/consumption/mgmt/2018-03-31/consumption/marketplacesbybillingaccount.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/consumption/mgmt/2018-03-31/consumption/marketplacesbybillingaccount.go @@ -57,7 +57,7 @@ func (client MarketplacesByBillingAccountClient) List(ctx context.Context, billi if err := validation.Validate([]validation.Validation{ {TargetValue: top, Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: int64(1000), Chain: nil}, {Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("consumption.MarketplacesByBillingAccountClient", "List", err.Error()) @@ -176,7 +176,7 @@ func (client MarketplacesByBillingAccountClient) ListByBillingPeriod(ctx context if err := validation.Validate([]validation.Validation{ {TargetValue: top, Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: int64(1000), Chain: nil}, {Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("consumption.MarketplacesByBillingAccountClient", "ListByBillingPeriod", err.Error()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/consumption/mgmt/2018-03-31/consumption/marketplacesbydepartment.go b/vendor/github.com/Azure/azure-sdk-for-go/services/consumption/mgmt/2018-03-31/consumption/marketplacesbydepartment.go index 285d88103..348552b45 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/consumption/mgmt/2018-03-31/consumption/marketplacesbydepartment.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/consumption/mgmt/2018-03-31/consumption/marketplacesbydepartment.go @@ -56,7 +56,7 @@ func (client MarketplacesByDepartmentClient) List(ctx context.Context, departmen if err := validation.Validate([]validation.Validation{ {TargetValue: top, Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: int64(1000), Chain: nil}, {Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("consumption.MarketplacesByDepartmentClient", "List", err.Error()) @@ -175,7 +175,7 @@ func (client MarketplacesByDepartmentClient) ListByBillingPeriod(ctx context.Con if err := validation.Validate([]validation.Validation{ {TargetValue: top, Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: int64(1000), Chain: nil}, {Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("consumption.MarketplacesByDepartmentClient", "ListByBillingPeriod", err.Error()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/consumption/mgmt/2018-03-31/consumption/marketplacesbyenrollmentaccounts.go b/vendor/github.com/Azure/azure-sdk-for-go/services/consumption/mgmt/2018-03-31/consumption/marketplacesbyenrollmentaccounts.go index 2f1e8de5d..4d2fd2251 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/consumption/mgmt/2018-03-31/consumption/marketplacesbyenrollmentaccounts.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/consumption/mgmt/2018-03-31/consumption/marketplacesbyenrollmentaccounts.go @@ -57,7 +57,7 @@ func (client MarketplacesByEnrollmentAccountsClient) List(ctx context.Context, e if err := validation.Validate([]validation.Validation{ {TargetValue: top, Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: int64(1000), Chain: nil}, {Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("consumption.MarketplacesByEnrollmentAccountsClient", "List", err.Error()) @@ -176,7 +176,7 @@ func (client MarketplacesByEnrollmentAccountsClient) ListByBillingPeriod(ctx con if err := validation.Validate([]validation.Validation{ {TargetValue: top, Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: int64(1000), Chain: nil}, {Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("consumption.MarketplacesByEnrollmentAccountsClient", "ListByBillingPeriod", err.Error()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/consumption/mgmt/2018-03-31/consumption/pricesheet.go b/vendor/github.com/Azure/azure-sdk-for-go/services/consumption/mgmt/2018-03-31/consumption/pricesheet.go index c924a0d1a..f27264fd0 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/consumption/mgmt/2018-03-31/consumption/pricesheet.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/consumption/mgmt/2018-03-31/consumption/pricesheet.go @@ -54,7 +54,7 @@ func (client PriceSheetClient) Get(ctx context.Context, expand string, skiptoken if err := validation.Validate([]validation.Validation{ {TargetValue: top, Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: int64(1000), Chain: nil}, {Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("consumption.PriceSheetClient", "Get", err.Error()) @@ -143,7 +143,7 @@ func (client PriceSheetClient) GetByBillingPeriod(ctx context.Context, billingPe if err := validation.Validate([]validation.Validation{ {TargetValue: top, Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: int64(1000), Chain: nil}, {Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("consumption.PriceSheetClient", "GetByBillingPeriod", err.Error()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/consumption/mgmt/2018-03-31/consumption/usagedetails.go b/vendor/github.com/Azure/azure-sdk-for-go/services/consumption/mgmt/2018-03-31/consumption/usagedetails.go index f1afc09a1..bbe5694bc 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/consumption/mgmt/2018-03-31/consumption/usagedetails.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/consumption/mgmt/2018-03-31/consumption/usagedetails.go @@ -59,7 +59,7 @@ func (client UsageDetailsClient) List(ctx context.Context, expand string, filter if err := validation.Validate([]validation.Validation{ {TargetValue: top, Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: int64(1000), Chain: nil}, {Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("consumption.UsageDetailsClient", "List", err.Error()) @@ -188,7 +188,7 @@ func (client UsageDetailsClient) ListByBillingPeriod(ctx context.Context, billin if err := validation.Validate([]validation.Validation{ {TargetValue: top, Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: int64(1000), Chain: nil}, {Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("consumption.UsageDetailsClient", "ListByBillingPeriod", err.Error()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/consumption/mgmt/2018-03-31/consumption/usagedetailsbybillingaccount.go b/vendor/github.com/Azure/azure-sdk-for-go/services/consumption/mgmt/2018-03-31/consumption/usagedetailsbybillingaccount.go index c04755baa..8c22defb2 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/consumption/mgmt/2018-03-31/consumption/usagedetailsbybillingaccount.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/consumption/mgmt/2018-03-31/consumption/usagedetailsbybillingaccount.go @@ -61,7 +61,7 @@ func (client UsageDetailsByBillingAccountClient) List(ctx context.Context, billi if err := validation.Validate([]validation.Validation{ {TargetValue: top, Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: int64(1000), Chain: nil}, {Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("consumption.UsageDetailsByBillingAccountClient", "List", err.Error()) @@ -191,7 +191,7 @@ func (client UsageDetailsByBillingAccountClient) ListByBillingPeriod(ctx context if err := validation.Validate([]validation.Validation{ {TargetValue: top, Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: int64(1000), Chain: nil}, {Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("consumption.UsageDetailsByBillingAccountClient", "ListByBillingPeriod", err.Error()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/consumption/mgmt/2018-03-31/consumption/usagedetailsbydepartment.go b/vendor/github.com/Azure/azure-sdk-for-go/services/consumption/mgmt/2018-03-31/consumption/usagedetailsbydepartment.go index 205dbdecd..e043bf29a 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/consumption/mgmt/2018-03-31/consumption/usagedetailsbydepartment.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/consumption/mgmt/2018-03-31/consumption/usagedetailsbydepartment.go @@ -60,7 +60,7 @@ func (client UsageDetailsByDepartmentClient) List(ctx context.Context, departmen if err := validation.Validate([]validation.Validation{ {TargetValue: top, Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: int64(1000), Chain: nil}, {Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("consumption.UsageDetailsByDepartmentClient", "List", err.Error()) @@ -190,7 +190,7 @@ func (client UsageDetailsByDepartmentClient) ListByBillingPeriod(ctx context.Con if err := validation.Validate([]validation.Validation{ {TargetValue: top, Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: int64(1000), Chain: nil}, {Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("consumption.UsageDetailsByDepartmentClient", "ListByBillingPeriod", err.Error()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/consumption/mgmt/2018-03-31/consumption/usagedetailsbyenrollmentaccount.go b/vendor/github.com/Azure/azure-sdk-for-go/services/consumption/mgmt/2018-03-31/consumption/usagedetailsbyenrollmentaccount.go index 26aef9a07..dede3d89a 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/consumption/mgmt/2018-03-31/consumption/usagedetailsbyenrollmentaccount.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/consumption/mgmt/2018-03-31/consumption/usagedetailsbyenrollmentaccount.go @@ -61,7 +61,7 @@ func (client UsageDetailsByEnrollmentAccountClient) List(ctx context.Context, en if err := validation.Validate([]validation.Validation{ {TargetValue: top, Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: int64(1000), Chain: nil}, {Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("consumption.UsageDetailsByEnrollmentAccountClient", "List", err.Error()) @@ -191,7 +191,7 @@ func (client UsageDetailsByEnrollmentAccountClient) ListByBillingPeriod(ctx cont if err := validation.Validate([]validation.Validation{ {TargetValue: top, Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: int64(1000), Chain: nil}, {Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("consumption.UsageDetailsByEnrollmentAccountClient", "ListByBillingPeriod", err.Error()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/consumption/mgmt/2018-05-31/consumption/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/consumption/mgmt/2018-05-31/consumption/models.go index 9b5909d7c..4282dafb9 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/consumption/mgmt/2018-05-31/consumption/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/consumption/mgmt/2018-05-31/consumption/models.go @@ -19,10 +19,13 @@ package consumption import ( "encoding/json" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/to" - "github.com/shopspring/decimal" "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/date" + "github.com/Azure/go-autorest/autorest/to" + "github.com/satori/go.uuid" + "github.com/shopspring/decimal" ) // Bound enumerates the values for bound. @@ -214,6 +217,24 @@ type ForecastsListResult struct { Value *[]Forecast `json:"value,omitempty"` } +// MeterDetails the properties of the meter detail. +type MeterDetails struct { + // MeterName - The name of the meter, within the given meter category + MeterName *string `json:"meterName,omitempty"` + // MeterCategory - The category of the meter, for example, 'Cloud services', 'Networking', etc.. + MeterCategory *string `json:"meterCategory,omitempty"` + // MeterSubCategory - The subcategory of the meter, for example, 'A6 Cloud services', 'ExpressRoute (IXP)', etc.. + MeterSubCategory *string `json:"meterSubCategory,omitempty"` + // Unit - The unit in which the meter consumption is charged, for example, 'Hours', 'GB', etc. + Unit *string `json:"unit,omitempty"` + // MeterLocation - The location in which the Azure service is available. + MeterLocation *string `json:"meterLocation,omitempty"` + // TotalIncludedQuantity - The total included quantity associated with the offer. + TotalIncludedQuantity *decimal.Decimal `json:"totalIncludedQuantity,omitempty"` + // PretaxStandardRate - The pretax listing price. + PretaxStandardRate *decimal.Decimal `json:"pretaxStandardRate,omitempty"` +} + // Operation a Consumption REST API operation. type Operation struct { // Name - Operation name: {provider}/{resource}/{operation}. @@ -335,6 +356,131 @@ func (page OperationListResultPage) Values() []Operation { return *page.olr.Value } +// PriceSheetModel price sheet result. It contains the pricesheet associated with billing period +type PriceSheetModel struct { + // Pricesheets - Price sheet + Pricesheets *[]PriceSheetProperties `json:"pricesheets,omitempty"` + // NextLink - The link (url) to the next page of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// PriceSheetProperties the properties of the price sheet. +type PriceSheetProperties struct { + // BillingPeriodID - The id of the billing period resource that the usage belongs to. + BillingPeriodID *string `json:"billingPeriodId,omitempty"` + // MeterID - The meter id (GUID) + MeterID *uuid.UUID `json:"meterId,omitempty"` + // MeterDetails - The details about the meter. By default this is not populated, unless it's specified in $expand. + MeterDetails *MeterDetails `json:"meterDetails,omitempty"` + // UnitOfMeasure - Unit of measure + UnitOfMeasure *string `json:"unitOfMeasure,omitempty"` + // IncludedQuantity - Included quality for an offer + IncludedQuantity *decimal.Decimal `json:"includedQuantity,omitempty"` + // PartNumber - Part Number + PartNumber *string `json:"partNumber,omitempty"` + // UnitPrice - Unit Price + UnitPrice *decimal.Decimal `json:"unitPrice,omitempty"` + // CurrencyCode - Currency Code + CurrencyCode *string `json:"currencyCode,omitempty"` + // OfferID - Offer Id + OfferID *string `json:"offerId,omitempty"` +} + +// PriceSheetResult an pricesheet resource. +type PriceSheetResult struct { + autorest.Response `json:"-"` + *PriceSheetModel `json:"properties,omitempty"` + // ID - Resource Id. + ID *string `json:"id,omitempty"` + // Name - Resource name. + Name *string `json:"name,omitempty"` + // Type - Resource type. + Type *string `json:"type,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for PriceSheetResult. +func (psr PriceSheetResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if psr.PriceSheetModel != nil { + objectMap["properties"] = psr.PriceSheetModel + } + if psr.ID != nil { + objectMap["id"] = psr.ID + } + if psr.Name != nil { + objectMap["name"] = psr.Name + } + if psr.Type != nil { + objectMap["type"] = psr.Type + } + if psr.Tags != nil { + objectMap["tags"] = psr.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for PriceSheetResult struct. +func (psr *PriceSheetResult) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var priceSheetModel PriceSheetModel + err = json.Unmarshal(*v, &priceSheetModel) + if err != nil { + return err + } + psr.PriceSheetModel = &priceSheetModel + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + psr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + psr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + psr.Type = &typeVar + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + psr.Tags = tags + } + } + } + + return nil +} + // Resource the Resource model definition. type Resource struct { // ID - Resource Id. @@ -364,3 +510,256 @@ func (r Resource) MarshalJSON() ([]byte, error) { } return json.Marshal(objectMap) } + +// UsageDetail an usage detail resource. +type UsageDetail struct { + *UsageDetailProperties `json:"properties,omitempty"` + // ID - Resource Id. + ID *string `json:"id,omitempty"` + // Name - Resource name. + Name *string `json:"name,omitempty"` + // Type - Resource type. + Type *string `json:"type,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for UsageDetail. +func (ud UsageDetail) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ud.UsageDetailProperties != nil { + objectMap["properties"] = ud.UsageDetailProperties + } + if ud.ID != nil { + objectMap["id"] = ud.ID + } + if ud.Name != nil { + objectMap["name"] = ud.Name + } + if ud.Type != nil { + objectMap["type"] = ud.Type + } + if ud.Tags != nil { + objectMap["tags"] = ud.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for UsageDetail struct. +func (ud *UsageDetail) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var usageDetailProperties UsageDetailProperties + err = json.Unmarshal(*v, &usageDetailProperties) + if err != nil { + return err + } + ud.UsageDetailProperties = &usageDetailProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ud.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ud.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ud.Type = &typeVar + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + ud.Tags = tags + } + } + } + + return nil +} + +// UsageDetailProperties the properties of the usage detail. +type UsageDetailProperties struct { + // BillingPeriodID - The id of the billing period resource that the usage belongs to. + BillingPeriodID *string `json:"billingPeriodId,omitempty"` + // InvoiceID - The id of the invoice resource that the usage belongs to. + InvoiceID *string `json:"invoiceId,omitempty"` + // UsageStart - The start of the date time range covered by the usage detail. + UsageStart *date.Time `json:"usageStart,omitempty"` + // UsageEnd - The end of the date time range covered by the usage detail. + UsageEnd *date.Time `json:"usageEnd,omitempty"` + // InstanceName - The name of the resource instance that the usage is about. + InstanceName *string `json:"instanceName,omitempty"` + // InstanceID - The uri of the resource instance that the usage is about. + InstanceID *string `json:"instanceId,omitempty"` + // InstanceLocation - The location of the resource instance that the usage is about. + InstanceLocation *string `json:"instanceLocation,omitempty"` + // Currency - The ISO currency in which the meter is charged, for example, USD. + Currency *string `json:"currency,omitempty"` + // UsageQuantity - The quantity of usage. + UsageQuantity *decimal.Decimal `json:"usageQuantity,omitempty"` + // BillableQuantity - The billable usage quantity. + BillableQuantity *decimal.Decimal `json:"billableQuantity,omitempty"` + // PretaxCost - The amount of cost before tax. + PretaxCost *decimal.Decimal `json:"pretaxCost,omitempty"` + // IsEstimated - The estimated usage is subject to change. + IsEstimated *bool `json:"isEstimated,omitempty"` + // MeterID - The meter id (GUID). + MeterID *uuid.UUID `json:"meterId,omitempty"` + // MeterDetails - The details about the meter. By default this is not populated, unless it's specified in $expand. + MeterDetails *MeterDetails `json:"meterDetails,omitempty"` + // SubscriptionGUID - Subscription guid. + SubscriptionGUID *uuid.UUID `json:"subscriptionGuid,omitempty"` + // SubscriptionName - Subscription name. + SubscriptionName *string `json:"subscriptionName,omitempty"` + // AccountName - Account name. + AccountName *string `json:"accountName,omitempty"` + // DepartmentName - Department name. + DepartmentName *string `json:"departmentName,omitempty"` + // Product - Product name. + Product *string `json:"product,omitempty"` + // ConsumedService - Consumed service name. + ConsumedService *string `json:"consumedService,omitempty"` + // CostCenter - The cost center of this department if it is a department and a costcenter exists + CostCenter *string `json:"costCenter,omitempty"` + // PartNumber - Part Number + PartNumber *string `json:"partNumber,omitempty"` + // ResourceGUID - Resource Guid + ResourceGUID *string `json:"resourceGuid,omitempty"` + // OfferID - Offer Id + OfferID *string `json:"offerId,omitempty"` + // ChargesBilledSeparately - Charges billed separately + ChargesBilledSeparately *bool `json:"chargesBilledSeparately,omitempty"` + // AdditionalProperties - Additional details of this usage item. By default this is not populated, unless it's specified in $expand. + AdditionalProperties *string `json:"additionalProperties,omitempty"` +} + +// UsageDetailsListResult result of listing usage details. It contains a list of available usage details in reverse +// chronological order by billing period. +type UsageDetailsListResult struct { + autorest.Response `json:"-"` + // Value - The list of usage details. + Value *[]UsageDetail `json:"value,omitempty"` + // NextLink - The link (url) to the next page of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// UsageDetailsListResultIterator provides access to a complete listing of UsageDetail values. +type UsageDetailsListResultIterator struct { + i int + page UsageDetailsListResultPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *UsageDetailsListResultIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter UsageDetailsListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter UsageDetailsListResultIterator) Response() UsageDetailsListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter UsageDetailsListResultIterator) Value() UsageDetail { + if !iter.page.NotDone() { + return UsageDetail{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (udlr UsageDetailsListResult) IsEmpty() bool { + return udlr.Value == nil || len(*udlr.Value) == 0 +} + +// usageDetailsListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (udlr UsageDetailsListResult) usageDetailsListResultPreparer() (*http.Request, error) { + if udlr.NextLink == nil || len(to.String(udlr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(udlr.NextLink))) +} + +// UsageDetailsListResultPage contains a page of UsageDetail values. +type UsageDetailsListResultPage struct { + fn func(UsageDetailsListResult) (UsageDetailsListResult, error) + udlr UsageDetailsListResult +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *UsageDetailsListResultPage) Next() error { + next, err := page.fn(page.udlr) + if err != nil { + return err + } + page.udlr = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page UsageDetailsListResultPage) NotDone() bool { + return !page.udlr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page UsageDetailsListResultPage) Response() UsageDetailsListResult { + return page.udlr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page UsageDetailsListResultPage) Values() []UsageDetail { + if page.udlr.IsEmpty() { + return nil + } + return *page.udlr.Value +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/consumption/mgmt/2018-05-31/consumption/pricesheet.go b/vendor/github.com/Azure/azure-sdk-for-go/services/consumption/mgmt/2018-05-31/consumption/pricesheet.go new file mode 100644 index 000000000..308ff7b2e --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/consumption/mgmt/2018-05-31/consumption/pricesheet.go @@ -0,0 +1,220 @@ +package consumption + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// PriceSheetClient is the consumption management client provides access to consumption resources for Azure Enterprise +// Subscriptions. +type PriceSheetClient struct { + BaseClient +} + +// NewPriceSheetClient creates an instance of the PriceSheetClient client. +func NewPriceSheetClient(subscriptionID string) PriceSheetClient { + return NewPriceSheetClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewPriceSheetClientWithBaseURI creates an instance of the PriceSheetClient client. +func NewPriceSheetClientWithBaseURI(baseURI string, subscriptionID string) PriceSheetClient { + return PriceSheetClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get gets the price sheet for a scope by subscriptionId. Price sheet is available via this API only for May 1, 2014 +// or later. +// Parameters: +// expand - may be used to expand the properties/meterDetails within a price sheet. By default, these fields +// are not included when returning price sheet. +// skiptoken - skiptoken is only used if a previous operation returned a partial result. If a previous response +// contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that +// specifies a starting point to use for subsequent calls. +// top - may be used to limit the number of results to the top N results. +func (client PriceSheetClient) Get(ctx context.Context, expand string, skiptoken string, top *int32) (result PriceSheetResult, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: top, + Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: int64(1000), Chain: nil}, + {Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("consumption.PriceSheetClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, expand, skiptoken, top) + if err != nil { + err = autorest.NewErrorWithError(err, "consumption.PriceSheetClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "consumption.PriceSheetClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "consumption.PriceSheetClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client PriceSheetClient) GetPreparer(ctx context.Context, expand string, skiptoken string, top *int32) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-05-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(expand) > 0 { + queryParameters["$expand"] = autorest.Encode("query", expand) + } + if len(skiptoken) > 0 { + queryParameters["$skiptoken"] = autorest.Encode("query", skiptoken) + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Consumption/pricesheets/default", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client PriceSheetClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client PriceSheetClient) GetResponder(resp *http.Response) (result PriceSheetResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetByBillingPeriod get the price sheet for a scope by subscriptionId and billing period. Price sheet is available +// via this API only for May 1, 2014 or later. +// Parameters: +// billingPeriodName - billing Period Name. +// expand - may be used to expand the properties/meterDetails within a price sheet. By default, these fields +// are not included when returning price sheet. +// skiptoken - skiptoken is only used if a previous operation returned a partial result. If a previous response +// contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that +// specifies a starting point to use for subsequent calls. +// top - may be used to limit the number of results to the top N results. +func (client PriceSheetClient) GetByBillingPeriod(ctx context.Context, billingPeriodName string, expand string, skiptoken string, top *int32) (result PriceSheetResult, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: top, + Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: int64(1000), Chain: nil}, + {Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("consumption.PriceSheetClient", "GetByBillingPeriod", err.Error()) + } + + req, err := client.GetByBillingPeriodPreparer(ctx, billingPeriodName, expand, skiptoken, top) + if err != nil { + err = autorest.NewErrorWithError(err, "consumption.PriceSheetClient", "GetByBillingPeriod", nil, "Failure preparing request") + return + } + + resp, err := client.GetByBillingPeriodSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "consumption.PriceSheetClient", "GetByBillingPeriod", resp, "Failure sending request") + return + } + + result, err = client.GetByBillingPeriodResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "consumption.PriceSheetClient", "GetByBillingPeriod", resp, "Failure responding to request") + } + + return +} + +// GetByBillingPeriodPreparer prepares the GetByBillingPeriod request. +func (client PriceSheetClient) GetByBillingPeriodPreparer(ctx context.Context, billingPeriodName string, expand string, skiptoken string, top *int32) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "billingPeriodName": autorest.Encode("path", billingPeriodName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-05-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(expand) > 0 { + queryParameters["$expand"] = autorest.Encode("query", expand) + } + if len(skiptoken) > 0 { + queryParameters["$skiptoken"] = autorest.Encode("query", skiptoken) + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}/providers/Microsoft.Consumption/pricesheets/default", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetByBillingPeriodSender sends the GetByBillingPeriod request. The method will close the +// http.Response Body if it receives an error. +func (client PriceSheetClient) GetByBillingPeriodSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetByBillingPeriodResponder handles the response to the GetByBillingPeriod request. The method always +// closes the http.Response Body. +func (client PriceSheetClient) GetByBillingPeriodResponder(resp *http.Response) (result PriceSheetResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/consumption/mgmt/2018-05-31/consumption/usagedetails.go b/vendor/github.com/Azure/azure-sdk-for-go/services/consumption/mgmt/2018-05-31/consumption/usagedetails.go new file mode 100644 index 000000000..984ad652b --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/consumption/mgmt/2018-05-31/consumption/usagedetails.go @@ -0,0 +1,1076 @@ +package consumption + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// UsageDetailsClient is the consumption management client provides access to consumption resources for Azure +// Enterprise Subscriptions. +type UsageDetailsClient struct { + BaseClient +} + +// NewUsageDetailsClient creates an instance of the UsageDetailsClient client. +func NewUsageDetailsClient(subscriptionID string) UsageDetailsClient { + return NewUsageDetailsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewUsageDetailsClientWithBaseURI creates an instance of the UsageDetailsClient client. +func NewUsageDetailsClientWithBaseURI(baseURI string, subscriptionID string) UsageDetailsClient { + return UsageDetailsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// List lists the usage details for a scope by current billing period. Usage details are available via this API only +// for May 1, 2014 or later. +// Parameters: +// expand - may be used to expand the properties/additionalProperties or properties/meterDetails within a list +// of usage details. By default, these fields are not included when listing usage details. +// filter - may be used to filter usageDetails by properties/usageEnd (Utc time), properties/usageStart (Utc +// time), properties/resourceGroup, properties/instanceName, properties/instanceId or tags. The filter supports +// 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a +// key value pair string where key and value is separated by a colon (:). +// skiptoken - skiptoken is only used if a previous operation returned a partial result. If a previous response +// contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that +// specifies a starting point to use for subsequent calls. +// top - may be used to limit the number of results to the most recent N usageDetails. +// apply - oData apply expression to aggregate usageDetails by tags or (tags and properties/usageStart) +func (client UsageDetailsClient) List(ctx context.Context, expand string, filter string, skiptoken string, top *int32, apply string) (result UsageDetailsListResultPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: top, + Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: int64(1000), Chain: nil}, + {Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("consumption.UsageDetailsClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, expand, filter, skiptoken, top, apply) + if err != nil { + err = autorest.NewErrorWithError(err, "consumption.UsageDetailsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.udlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "consumption.UsageDetailsClient", "List", resp, "Failure sending request") + return + } + + result.udlr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "consumption.UsageDetailsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client UsageDetailsClient) ListPreparer(ctx context.Context, expand string, filter string, skiptoken string, top *int32, apply string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-05-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(expand) > 0 { + queryParameters["$expand"] = autorest.Encode("query", expand) + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if len(skiptoken) > 0 { + queryParameters["$skiptoken"] = autorest.Encode("query", skiptoken) + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + if len(apply) > 0 { + queryParameters["$apply"] = autorest.Encode("query", apply) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Consumption/usageDetails", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client UsageDetailsClient) ListSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client UsageDetailsClient) ListResponder(resp *http.Response) (result UsageDetailsListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client UsageDetailsClient) listNextResults(lastResults UsageDetailsListResult) (result UsageDetailsListResult, err error) { + req, err := lastResults.usageDetailsListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "consumption.UsageDetailsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "consumption.UsageDetailsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "consumption.UsageDetailsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client UsageDetailsClient) ListComplete(ctx context.Context, expand string, filter string, skiptoken string, top *int32, apply string) (result UsageDetailsListResultIterator, err error) { + result.page, err = client.List(ctx, expand, filter, skiptoken, top, apply) + return +} + +// ListByBillingAccount lists the usage details by billingAccountId for a scope by current billing period. Usage +// details are available via this API only for May 1, 2014 or later. +// Parameters: +// billingAccountID - billingAccount ID +// expand - may be used to expand the properties/additionalProperties or properties/meterDetails within a list +// of usage details. By default, these fields are not included when listing usage details. +// filter - may be used to filter usageDetails by properties/usageEnd (Utc time), properties/usageStart (Utc +// time), properties/resourceGroup, properties/instanceName, properties/instanceId or tags. The filter supports +// 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a +// key value pair string where key and value is separated by a colon (:). +// skiptoken - skiptoken is only used if a previous operation returned a partial result. If a previous response +// contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that +// specifies a starting point to use for subsequent calls. +// top - may be used to limit the number of results to the most recent N usageDetails. +// apply - oData apply expression to aggregate usageDetails by tags or (tags and properties/usageStart) +func (client UsageDetailsClient) ListByBillingAccount(ctx context.Context, billingAccountID string, expand string, filter string, skiptoken string, top *int32, apply string) (result UsageDetailsListResultPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: top, + Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: int64(1000), Chain: nil}, + {Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("consumption.UsageDetailsClient", "ListByBillingAccount", err.Error()) + } + + result.fn = client.listByBillingAccountNextResults + req, err := client.ListByBillingAccountPreparer(ctx, billingAccountID, expand, filter, skiptoken, top, apply) + if err != nil { + err = autorest.NewErrorWithError(err, "consumption.UsageDetailsClient", "ListByBillingAccount", nil, "Failure preparing request") + return + } + + resp, err := client.ListByBillingAccountSender(req) + if err != nil { + result.udlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "consumption.UsageDetailsClient", "ListByBillingAccount", resp, "Failure sending request") + return + } + + result.udlr, err = client.ListByBillingAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "consumption.UsageDetailsClient", "ListByBillingAccount", resp, "Failure responding to request") + } + + return +} + +// ListByBillingAccountPreparer prepares the ListByBillingAccount request. +func (client UsageDetailsClient) ListByBillingAccountPreparer(ctx context.Context, billingAccountID string, expand string, filter string, skiptoken string, top *int32, apply string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "billingAccountId": autorest.Encode("path", billingAccountID), + } + + const APIVersion = "2018-05-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(expand) > 0 { + queryParameters["$expand"] = autorest.Encode("query", expand) + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if len(skiptoken) > 0 { + queryParameters["$skiptoken"] = autorest.Encode("query", skiptoken) + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + if len(apply) > 0 { + queryParameters["$apply"] = autorest.Encode("query", apply) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.Consumption/usageDetails", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByBillingAccountSender sends the ListByBillingAccount request. The method will close the +// http.Response Body if it receives an error. +func (client UsageDetailsClient) ListByBillingAccountSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// ListByBillingAccountResponder handles the response to the ListByBillingAccount request. The method always +// closes the http.Response Body. +func (client UsageDetailsClient) ListByBillingAccountResponder(resp *http.Response) (result UsageDetailsListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByBillingAccountNextResults retrieves the next set of results, if any. +func (client UsageDetailsClient) listByBillingAccountNextResults(lastResults UsageDetailsListResult) (result UsageDetailsListResult, err error) { + req, err := lastResults.usageDetailsListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "consumption.UsageDetailsClient", "listByBillingAccountNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByBillingAccountSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "consumption.UsageDetailsClient", "listByBillingAccountNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByBillingAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "consumption.UsageDetailsClient", "listByBillingAccountNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByBillingAccountComplete enumerates all values, automatically crossing page boundaries as required. +func (client UsageDetailsClient) ListByBillingAccountComplete(ctx context.Context, billingAccountID string, expand string, filter string, skiptoken string, top *int32, apply string) (result UsageDetailsListResultIterator, err error) { + result.page, err = client.ListByBillingAccount(ctx, billingAccountID, expand, filter, skiptoken, top, apply) + return +} + +// ListByBillingPeriod lists the usage details for a scope by billing period. Usage details are available via this API +// only for May 1, 2014 or later. +// Parameters: +// billingPeriodName - billing Period Name. +// expand - may be used to expand the properties/additionalProperties or properties/meterDetails within a list +// of usage details. By default, these fields are not included when listing usage details. +// filter - may be used to filter usageDetails by properties/usageEnd (Utc time), properties/usageStart (Utc +// time), properties/resourceGroup, properties/instanceName or properties/instanceId. The filter supports 'eq', +// 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key +// value pair string where key and value is separated by a colon (:). +// apply - oData apply expression to aggregate usageDetails by tags or (tags and properties/usageStart) for +// specified billing period +// skiptoken - skiptoken is only used if a previous operation returned a partial result. If a previous response +// contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that +// specifies a starting point to use for subsequent calls. +// top - may be used to limit the number of results to the most recent N usageDetails. +func (client UsageDetailsClient) ListByBillingPeriod(ctx context.Context, billingPeriodName string, expand string, filter string, apply string, skiptoken string, top *int32) (result UsageDetailsListResultPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: top, + Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: int64(1000), Chain: nil}, + {Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("consumption.UsageDetailsClient", "ListByBillingPeriod", err.Error()) + } + + result.fn = client.listByBillingPeriodNextResults + req, err := client.ListByBillingPeriodPreparer(ctx, billingPeriodName, expand, filter, apply, skiptoken, top) + if err != nil { + err = autorest.NewErrorWithError(err, "consumption.UsageDetailsClient", "ListByBillingPeriod", nil, "Failure preparing request") + return + } + + resp, err := client.ListByBillingPeriodSender(req) + if err != nil { + result.udlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "consumption.UsageDetailsClient", "ListByBillingPeriod", resp, "Failure sending request") + return + } + + result.udlr, err = client.ListByBillingPeriodResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "consumption.UsageDetailsClient", "ListByBillingPeriod", resp, "Failure responding to request") + } + + return +} + +// ListByBillingPeriodPreparer prepares the ListByBillingPeriod request. +func (client UsageDetailsClient) ListByBillingPeriodPreparer(ctx context.Context, billingPeriodName string, expand string, filter string, apply string, skiptoken string, top *int32) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "billingPeriodName": autorest.Encode("path", billingPeriodName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-05-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(expand) > 0 { + queryParameters["$expand"] = autorest.Encode("query", expand) + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if len(apply) > 0 { + queryParameters["$apply"] = autorest.Encode("query", apply) + } + if len(skiptoken) > 0 { + queryParameters["$skiptoken"] = autorest.Encode("query", skiptoken) + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}/providers/Microsoft.Consumption/usageDetails", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByBillingPeriodSender sends the ListByBillingPeriod request. The method will close the +// http.Response Body if it receives an error. +func (client UsageDetailsClient) ListByBillingPeriodSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByBillingPeriodResponder handles the response to the ListByBillingPeriod request. The method always +// closes the http.Response Body. +func (client UsageDetailsClient) ListByBillingPeriodResponder(resp *http.Response) (result UsageDetailsListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByBillingPeriodNextResults retrieves the next set of results, if any. +func (client UsageDetailsClient) listByBillingPeriodNextResults(lastResults UsageDetailsListResult) (result UsageDetailsListResult, err error) { + req, err := lastResults.usageDetailsListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "consumption.UsageDetailsClient", "listByBillingPeriodNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByBillingPeriodSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "consumption.UsageDetailsClient", "listByBillingPeriodNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByBillingPeriodResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "consumption.UsageDetailsClient", "listByBillingPeriodNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByBillingPeriodComplete enumerates all values, automatically crossing page boundaries as required. +func (client UsageDetailsClient) ListByBillingPeriodComplete(ctx context.Context, billingPeriodName string, expand string, filter string, apply string, skiptoken string, top *int32) (result UsageDetailsListResultIterator, err error) { + result.page, err = client.ListByBillingPeriod(ctx, billingPeriodName, expand, filter, apply, skiptoken, top) + return +} + +// ListByDepartment lists the usage details by departmentId for a scope by current billing period. Usage details are +// available via this API only for May 1, 2014 or later. +// Parameters: +// departmentID - department ID +// expand - may be used to expand the properties/additionalProperties or properties/meterDetails within a list +// of usage details. By default, these fields are not included when listing usage details. +// filter - may be used to filter usageDetails by properties/usageEnd (Utc time), properties/usageStart (Utc +// time), properties/resourceGroup, properties/instanceName, properties/instanceId or tags. The filter supports +// 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a +// key value pair string where key and value is separated by a colon (:). +// skiptoken - skiptoken is only used if a previous operation returned a partial result. If a previous response +// contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that +// specifies a starting point to use for subsequent calls. +// top - may be used to limit the number of results to the most recent N usageDetails. +// apply - oData apply expression to aggregate usageDetails by tags or (tags and properties/usageStart) +func (client UsageDetailsClient) ListByDepartment(ctx context.Context, departmentID string, expand string, filter string, skiptoken string, top *int32, apply string) (result UsageDetailsListResultPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: top, + Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: int64(1000), Chain: nil}, + {Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("consumption.UsageDetailsClient", "ListByDepartment", err.Error()) + } + + result.fn = client.listByDepartmentNextResults + req, err := client.ListByDepartmentPreparer(ctx, departmentID, expand, filter, skiptoken, top, apply) + if err != nil { + err = autorest.NewErrorWithError(err, "consumption.UsageDetailsClient", "ListByDepartment", nil, "Failure preparing request") + return + } + + resp, err := client.ListByDepartmentSender(req) + if err != nil { + result.udlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "consumption.UsageDetailsClient", "ListByDepartment", resp, "Failure sending request") + return + } + + result.udlr, err = client.ListByDepartmentResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "consumption.UsageDetailsClient", "ListByDepartment", resp, "Failure responding to request") + } + + return +} + +// ListByDepartmentPreparer prepares the ListByDepartment request. +func (client UsageDetailsClient) ListByDepartmentPreparer(ctx context.Context, departmentID string, expand string, filter string, skiptoken string, top *int32, apply string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "departmentId": autorest.Encode("path", departmentID), + } + + const APIVersion = "2018-05-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(expand) > 0 { + queryParameters["$expand"] = autorest.Encode("query", expand) + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if len(skiptoken) > 0 { + queryParameters["$skiptoken"] = autorest.Encode("query", skiptoken) + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + if len(apply) > 0 { + queryParameters["$apply"] = autorest.Encode("query", apply) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.Billing/departments/{departmentId}/providers/Microsoft.Consumption/usageDetails", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByDepartmentSender sends the ListByDepartment request. The method will close the +// http.Response Body if it receives an error. +func (client UsageDetailsClient) ListByDepartmentSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// ListByDepartmentResponder handles the response to the ListByDepartment request. The method always +// closes the http.Response Body. +func (client UsageDetailsClient) ListByDepartmentResponder(resp *http.Response) (result UsageDetailsListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByDepartmentNextResults retrieves the next set of results, if any. +func (client UsageDetailsClient) listByDepartmentNextResults(lastResults UsageDetailsListResult) (result UsageDetailsListResult, err error) { + req, err := lastResults.usageDetailsListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "consumption.UsageDetailsClient", "listByDepartmentNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByDepartmentSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "consumption.UsageDetailsClient", "listByDepartmentNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByDepartmentResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "consumption.UsageDetailsClient", "listByDepartmentNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByDepartmentComplete enumerates all values, automatically crossing page boundaries as required. +func (client UsageDetailsClient) ListByDepartmentComplete(ctx context.Context, departmentID string, expand string, filter string, skiptoken string, top *int32, apply string) (result UsageDetailsListResultIterator, err error) { + result.page, err = client.ListByDepartment(ctx, departmentID, expand, filter, skiptoken, top, apply) + return +} + +// ListByEnrollmentAccount lists the usage details by enrollmentAccountId for a scope by current billing period. Usage +// details are available via this API only for May 1, 2014 or later. +// Parameters: +// enrollmentAccountID - enrollmentAccount ID +// expand - may be used to expand the properties/additionalProperties or properties/meterDetails within a list +// of usage details. By default, these fields are not included when listing usage details. +// filter - may be used to filter usageDetails by properties/usageEnd (Utc time), properties/usageStart (Utc +// time), properties/resourceGroup, properties/instanceName, properties/instanceId or tags. The filter supports +// 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a +// key value pair string where key and value is separated by a colon (:). +// skiptoken - skiptoken is only used if a previous operation returned a partial result. If a previous response +// contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that +// specifies a starting point to use for subsequent calls. +// top - may be used to limit the number of results to the most recent N usageDetails. +// apply - oData apply expression to aggregate usageDetails by tags or (tags and properties/usageStart) +func (client UsageDetailsClient) ListByEnrollmentAccount(ctx context.Context, enrollmentAccountID string, expand string, filter string, skiptoken string, top *int32, apply string) (result UsageDetailsListResultPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: top, + Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: int64(1000), Chain: nil}, + {Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("consumption.UsageDetailsClient", "ListByEnrollmentAccount", err.Error()) + } + + result.fn = client.listByEnrollmentAccountNextResults + req, err := client.ListByEnrollmentAccountPreparer(ctx, enrollmentAccountID, expand, filter, skiptoken, top, apply) + if err != nil { + err = autorest.NewErrorWithError(err, "consumption.UsageDetailsClient", "ListByEnrollmentAccount", nil, "Failure preparing request") + return + } + + resp, err := client.ListByEnrollmentAccountSender(req) + if err != nil { + result.udlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "consumption.UsageDetailsClient", "ListByEnrollmentAccount", resp, "Failure sending request") + return + } + + result.udlr, err = client.ListByEnrollmentAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "consumption.UsageDetailsClient", "ListByEnrollmentAccount", resp, "Failure responding to request") + } + + return +} + +// ListByEnrollmentAccountPreparer prepares the ListByEnrollmentAccount request. +func (client UsageDetailsClient) ListByEnrollmentAccountPreparer(ctx context.Context, enrollmentAccountID string, expand string, filter string, skiptoken string, top *int32, apply string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "enrollmentAccountId": autorest.Encode("path", enrollmentAccountID), + } + + const APIVersion = "2018-05-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(expand) > 0 { + queryParameters["$expand"] = autorest.Encode("query", expand) + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if len(skiptoken) > 0 { + queryParameters["$skiptoken"] = autorest.Encode("query", skiptoken) + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + if len(apply) > 0 { + queryParameters["$apply"] = autorest.Encode("query", apply) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}/providers/Microsoft.Consumption/usageDetails", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByEnrollmentAccountSender sends the ListByEnrollmentAccount request. The method will close the +// http.Response Body if it receives an error. +func (client UsageDetailsClient) ListByEnrollmentAccountSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// ListByEnrollmentAccountResponder handles the response to the ListByEnrollmentAccount request. The method always +// closes the http.Response Body. +func (client UsageDetailsClient) ListByEnrollmentAccountResponder(resp *http.Response) (result UsageDetailsListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByEnrollmentAccountNextResults retrieves the next set of results, if any. +func (client UsageDetailsClient) listByEnrollmentAccountNextResults(lastResults UsageDetailsListResult) (result UsageDetailsListResult, err error) { + req, err := lastResults.usageDetailsListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "consumption.UsageDetailsClient", "listByEnrollmentAccountNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByEnrollmentAccountSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "consumption.UsageDetailsClient", "listByEnrollmentAccountNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByEnrollmentAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "consumption.UsageDetailsClient", "listByEnrollmentAccountNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByEnrollmentAccountComplete enumerates all values, automatically crossing page boundaries as required. +func (client UsageDetailsClient) ListByEnrollmentAccountComplete(ctx context.Context, enrollmentAccountID string, expand string, filter string, skiptoken string, top *int32, apply string) (result UsageDetailsListResultIterator, err error) { + result.page, err = client.ListByEnrollmentAccount(ctx, enrollmentAccountID, expand, filter, skiptoken, top, apply) + return +} + +// ListForBillingPeriodByBillingAccount lists the usage details based on billingAccountId for a scope by billing +// period. Usage details are available via this API only for May 1, 2014 or later. +// Parameters: +// billingAccountID - billingAccount ID +// billingPeriodName - billing Period Name. +// expand - may be used to expand the properties/additionalProperties or properties/meterDetails within a list +// of usage details. By default, these fields are not included when listing usage details. +// filter - may be used to filter usageDetails by properties/usageEnd (Utc time), properties/usageStart (Utc +// time), properties/resourceGroup, properties/instanceName or properties/instanceId. The filter supports 'eq', +// 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key +// value pair string where key and value is separated by a colon (:). +// apply - oData apply expression to aggregate usageDetails by tags or (tags and properties/usageStart) for +// specified billing period +// skiptoken - skiptoken is only used if a previous operation returned a partial result. If a previous response +// contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that +// specifies a starting point to use for subsequent calls. +// top - may be used to limit the number of results to the most recent N usageDetails. +func (client UsageDetailsClient) ListForBillingPeriodByBillingAccount(ctx context.Context, billingAccountID string, billingPeriodName string, expand string, filter string, apply string, skiptoken string, top *int32) (result UsageDetailsListResultPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: top, + Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: int64(1000), Chain: nil}, + {Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("consumption.UsageDetailsClient", "ListForBillingPeriodByBillingAccount", err.Error()) + } + + result.fn = client.listForBillingPeriodByBillingAccountNextResults + req, err := client.ListForBillingPeriodByBillingAccountPreparer(ctx, billingAccountID, billingPeriodName, expand, filter, apply, skiptoken, top) + if err != nil { + err = autorest.NewErrorWithError(err, "consumption.UsageDetailsClient", "ListForBillingPeriodByBillingAccount", nil, "Failure preparing request") + return + } + + resp, err := client.ListForBillingPeriodByBillingAccountSender(req) + if err != nil { + result.udlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "consumption.UsageDetailsClient", "ListForBillingPeriodByBillingAccount", resp, "Failure sending request") + return + } + + result.udlr, err = client.ListForBillingPeriodByBillingAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "consumption.UsageDetailsClient", "ListForBillingPeriodByBillingAccount", resp, "Failure responding to request") + } + + return +} + +// ListForBillingPeriodByBillingAccountPreparer prepares the ListForBillingPeriodByBillingAccount request. +func (client UsageDetailsClient) ListForBillingPeriodByBillingAccountPreparer(ctx context.Context, billingAccountID string, billingPeriodName string, expand string, filter string, apply string, skiptoken string, top *int32) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "billingAccountId": autorest.Encode("path", billingAccountID), + "billingPeriodName": autorest.Encode("path", billingPeriodName), + } + + const APIVersion = "2018-05-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(expand) > 0 { + queryParameters["$expand"] = autorest.Encode("query", expand) + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if len(apply) > 0 { + queryParameters["$apply"] = autorest.Encode("query", apply) + } + if len(skiptoken) > 0 { + queryParameters["$skiptoken"] = autorest.Encode("query", skiptoken) + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}/providers/Microsoft.Consumption/usageDetails", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListForBillingPeriodByBillingAccountSender sends the ListForBillingPeriodByBillingAccount request. The method will close the +// http.Response Body if it receives an error. +func (client UsageDetailsClient) ListForBillingPeriodByBillingAccountSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// ListForBillingPeriodByBillingAccountResponder handles the response to the ListForBillingPeriodByBillingAccount request. The method always +// closes the http.Response Body. +func (client UsageDetailsClient) ListForBillingPeriodByBillingAccountResponder(resp *http.Response) (result UsageDetailsListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listForBillingPeriodByBillingAccountNextResults retrieves the next set of results, if any. +func (client UsageDetailsClient) listForBillingPeriodByBillingAccountNextResults(lastResults UsageDetailsListResult) (result UsageDetailsListResult, err error) { + req, err := lastResults.usageDetailsListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "consumption.UsageDetailsClient", "listForBillingPeriodByBillingAccountNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListForBillingPeriodByBillingAccountSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "consumption.UsageDetailsClient", "listForBillingPeriodByBillingAccountNextResults", resp, "Failure sending next results request") + } + result, err = client.ListForBillingPeriodByBillingAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "consumption.UsageDetailsClient", "listForBillingPeriodByBillingAccountNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListForBillingPeriodByBillingAccountComplete enumerates all values, automatically crossing page boundaries as required. +func (client UsageDetailsClient) ListForBillingPeriodByBillingAccountComplete(ctx context.Context, billingAccountID string, billingPeriodName string, expand string, filter string, apply string, skiptoken string, top *int32) (result UsageDetailsListResultIterator, err error) { + result.page, err = client.ListForBillingPeriodByBillingAccount(ctx, billingAccountID, billingPeriodName, expand, filter, apply, skiptoken, top) + return +} + +// ListForBillingPeriodByDepartment lists the usage details based on departmentId for a scope by billing period. Usage +// details are available via this API only for May 1, 2014 or later. +// Parameters: +// departmentID - department ID +// billingPeriodName - billing Period Name. +// expand - may be used to expand the properties/additionalProperties or properties/meterDetails within a list +// of usage details. By default, these fields are not included when listing usage details. +// filter - may be used to filter usageDetails by properties/usageEnd (Utc time), properties/usageStart (Utc +// time), properties/resourceGroup, properties/instanceName or properties/instanceId. The filter supports 'eq', +// 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key +// value pair string where key and value is separated by a colon (:). +// apply - oData apply expression to aggregate usageDetails by tags or (tags and properties/usageStart) for +// specified billing period +// skiptoken - skiptoken is only used if a previous operation returned a partial result. If a previous response +// contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that +// specifies a starting point to use for subsequent calls. +// top - may be used to limit the number of results to the most recent N usageDetails. +func (client UsageDetailsClient) ListForBillingPeriodByDepartment(ctx context.Context, departmentID string, billingPeriodName string, expand string, filter string, apply string, skiptoken string, top *int32) (result UsageDetailsListResultPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: top, + Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: int64(1000), Chain: nil}, + {Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("consumption.UsageDetailsClient", "ListForBillingPeriodByDepartment", err.Error()) + } + + result.fn = client.listForBillingPeriodByDepartmentNextResults + req, err := client.ListForBillingPeriodByDepartmentPreparer(ctx, departmentID, billingPeriodName, expand, filter, apply, skiptoken, top) + if err != nil { + err = autorest.NewErrorWithError(err, "consumption.UsageDetailsClient", "ListForBillingPeriodByDepartment", nil, "Failure preparing request") + return + } + + resp, err := client.ListForBillingPeriodByDepartmentSender(req) + if err != nil { + result.udlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "consumption.UsageDetailsClient", "ListForBillingPeriodByDepartment", resp, "Failure sending request") + return + } + + result.udlr, err = client.ListForBillingPeriodByDepartmentResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "consumption.UsageDetailsClient", "ListForBillingPeriodByDepartment", resp, "Failure responding to request") + } + + return +} + +// ListForBillingPeriodByDepartmentPreparer prepares the ListForBillingPeriodByDepartment request. +func (client UsageDetailsClient) ListForBillingPeriodByDepartmentPreparer(ctx context.Context, departmentID string, billingPeriodName string, expand string, filter string, apply string, skiptoken string, top *int32) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "billingPeriodName": autorest.Encode("path", billingPeriodName), + "departmentId": autorest.Encode("path", departmentID), + } + + const APIVersion = "2018-05-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(expand) > 0 { + queryParameters["$expand"] = autorest.Encode("query", expand) + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if len(apply) > 0 { + queryParameters["$apply"] = autorest.Encode("query", apply) + } + if len(skiptoken) > 0 { + queryParameters["$skiptoken"] = autorest.Encode("query", skiptoken) + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.Billing/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}/providers/Microsoft.Consumption/usageDetails", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListForBillingPeriodByDepartmentSender sends the ListForBillingPeriodByDepartment request. The method will close the +// http.Response Body if it receives an error. +func (client UsageDetailsClient) ListForBillingPeriodByDepartmentSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// ListForBillingPeriodByDepartmentResponder handles the response to the ListForBillingPeriodByDepartment request. The method always +// closes the http.Response Body. +func (client UsageDetailsClient) ListForBillingPeriodByDepartmentResponder(resp *http.Response) (result UsageDetailsListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listForBillingPeriodByDepartmentNextResults retrieves the next set of results, if any. +func (client UsageDetailsClient) listForBillingPeriodByDepartmentNextResults(lastResults UsageDetailsListResult) (result UsageDetailsListResult, err error) { + req, err := lastResults.usageDetailsListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "consumption.UsageDetailsClient", "listForBillingPeriodByDepartmentNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListForBillingPeriodByDepartmentSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "consumption.UsageDetailsClient", "listForBillingPeriodByDepartmentNextResults", resp, "Failure sending next results request") + } + result, err = client.ListForBillingPeriodByDepartmentResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "consumption.UsageDetailsClient", "listForBillingPeriodByDepartmentNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListForBillingPeriodByDepartmentComplete enumerates all values, automatically crossing page boundaries as required. +func (client UsageDetailsClient) ListForBillingPeriodByDepartmentComplete(ctx context.Context, departmentID string, billingPeriodName string, expand string, filter string, apply string, skiptoken string, top *int32) (result UsageDetailsListResultIterator, err error) { + result.page, err = client.ListForBillingPeriodByDepartment(ctx, departmentID, billingPeriodName, expand, filter, apply, skiptoken, top) + return +} + +// ListForBillingPeriodByEnrollmentAccount lists the usage details based on enrollmentAccountId for a scope by billing +// period. Usage details are available via this API only for May 1, 2014 or later. +// Parameters: +// enrollmentAccountID - enrollmentAccount ID +// billingPeriodName - billing Period Name. +// expand - may be used to expand the properties/additionalProperties or properties/meterDetails within a list +// of usage details. By default, these fields are not included when listing usage details. +// filter - may be used to filter usageDetails by properties/usageEnd (Utc time), properties/usageStart (Utc +// time), properties/resourceGroup, properties/instanceName or properties/instanceId. The filter supports 'eq', +// 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key +// value pair string where key and value is separated by a colon (:). +// apply - oData apply expression to aggregate usageDetails by tags or (tags and properties/usageStart) for +// specified billing period +// skiptoken - skiptoken is only used if a previous operation returned a partial result. If a previous response +// contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that +// specifies a starting point to use for subsequent calls. +// top - may be used to limit the number of results to the most recent N usageDetails. +func (client UsageDetailsClient) ListForBillingPeriodByEnrollmentAccount(ctx context.Context, enrollmentAccountID string, billingPeriodName string, expand string, filter string, apply string, skiptoken string, top *int32) (result UsageDetailsListResultPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: top, + Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: int64(1000), Chain: nil}, + {Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("consumption.UsageDetailsClient", "ListForBillingPeriodByEnrollmentAccount", err.Error()) + } + + result.fn = client.listForBillingPeriodByEnrollmentAccountNextResults + req, err := client.ListForBillingPeriodByEnrollmentAccountPreparer(ctx, enrollmentAccountID, billingPeriodName, expand, filter, apply, skiptoken, top) + if err != nil { + err = autorest.NewErrorWithError(err, "consumption.UsageDetailsClient", "ListForBillingPeriodByEnrollmentAccount", nil, "Failure preparing request") + return + } + + resp, err := client.ListForBillingPeriodByEnrollmentAccountSender(req) + if err != nil { + result.udlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "consumption.UsageDetailsClient", "ListForBillingPeriodByEnrollmentAccount", resp, "Failure sending request") + return + } + + result.udlr, err = client.ListForBillingPeriodByEnrollmentAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "consumption.UsageDetailsClient", "ListForBillingPeriodByEnrollmentAccount", resp, "Failure responding to request") + } + + return +} + +// ListForBillingPeriodByEnrollmentAccountPreparer prepares the ListForBillingPeriodByEnrollmentAccount request. +func (client UsageDetailsClient) ListForBillingPeriodByEnrollmentAccountPreparer(ctx context.Context, enrollmentAccountID string, billingPeriodName string, expand string, filter string, apply string, skiptoken string, top *int32) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "billingPeriodName": autorest.Encode("path", billingPeriodName), + "enrollmentAccountId": autorest.Encode("path", enrollmentAccountID), + } + + const APIVersion = "2018-05-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(expand) > 0 { + queryParameters["$expand"] = autorest.Encode("query", expand) + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if len(apply) > 0 { + queryParameters["$apply"] = autorest.Encode("query", apply) + } + if len(skiptoken) > 0 { + queryParameters["$skiptoken"] = autorest.Encode("query", skiptoken) + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}/providers/Microsoft.Consumption/usageDetails", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListForBillingPeriodByEnrollmentAccountSender sends the ListForBillingPeriodByEnrollmentAccount request. The method will close the +// http.Response Body if it receives an error. +func (client UsageDetailsClient) ListForBillingPeriodByEnrollmentAccountSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// ListForBillingPeriodByEnrollmentAccountResponder handles the response to the ListForBillingPeriodByEnrollmentAccount request. The method always +// closes the http.Response Body. +func (client UsageDetailsClient) ListForBillingPeriodByEnrollmentAccountResponder(resp *http.Response) (result UsageDetailsListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listForBillingPeriodByEnrollmentAccountNextResults retrieves the next set of results, if any. +func (client UsageDetailsClient) listForBillingPeriodByEnrollmentAccountNextResults(lastResults UsageDetailsListResult) (result UsageDetailsListResult, err error) { + req, err := lastResults.usageDetailsListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "consumption.UsageDetailsClient", "listForBillingPeriodByEnrollmentAccountNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListForBillingPeriodByEnrollmentAccountSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "consumption.UsageDetailsClient", "listForBillingPeriodByEnrollmentAccountNextResults", resp, "Failure sending next results request") + } + result, err = client.ListForBillingPeriodByEnrollmentAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "consumption.UsageDetailsClient", "listForBillingPeriodByEnrollmentAccountNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListForBillingPeriodByEnrollmentAccountComplete enumerates all values, automatically crossing page boundaries as required. +func (client UsageDetailsClient) ListForBillingPeriodByEnrollmentAccountComplete(ctx context.Context, enrollmentAccountID string, billingPeriodName string, expand string, filter string, apply string, skiptoken string, top *int32) (result UsageDetailsListResultIterator, err error) { + result.page, err = client.ListForBillingPeriodByEnrollmentAccount(ctx, enrollmentAccountID, billingPeriodName, expand, filter, apply, skiptoken, top) + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2017-07-01/containerservice/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2017-07-01/containerservice/models.go index 3942f3c4c..b2e9ac971 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2017-07-01/containerservice/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2017-07-01/containerservice/models.go @@ -453,7 +453,7 @@ type AgentPoolProfile struct { Ports *[]int32 `json:"ports,omitempty"` // StorageProfile - Storage profile specifies what kind of storage used. Choose from StorageAccount and ManagedDisks. Leave it empty, we will choose for you based on the orchestrator choice. Possible values include: 'StorageAccount', 'ManagedDisks' StorageProfile StorageProfileTypes `json:"storageProfile,omitempty"` - // VnetSubnetID - VNet SubnetID specifies the vnet's subnet identifier. If you specify either master VNet Subnet, or agent VNet Subnet, you need to specify both. And they have to be in the same VNet. + // VnetSubnetID - VNet SubnetID specifies the vnet's subnet identifier. VnetSubnetID *string `json:"vnetSubnetID,omitempty"` // OsType - OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: 'Linux', 'Windows' OsType OSType `json:"osType,omitempty"` @@ -763,7 +763,7 @@ type MasterProfile struct { VMSize VMSizeTypes `json:"vmSize,omitempty"` // OsDiskSizeGB - OS Disk Size in GB to be used to specify the disk size for every machine in this master/agent pool. If you specify 0, it will apply the default osDisk size according to the vmSize specified. OsDiskSizeGB *int32 `json:"osDiskSizeGB,omitempty"` - // VnetSubnetID - VNet SubnetID specifies the vnet's subnet identifier. If you specify either master VNet Subnet, or agent VNet Subnet, you need to specify both. And they have to be in the same VNet. + // VnetSubnetID - VNet SubnetID specifies the vnet's subnet identifier. VnetSubnetID *string `json:"vnetSubnetID,omitempty"` // FirstConsecutiveStaticIP - FirstConsecutiveStaticIP used to specify the first static ip of masters. FirstConsecutiveStaticIP *string `json:"firstConsecutiveStaticIP,omitempty"` diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2017-08-31/containerservice/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2017-08-31/containerservice/models.go index f391ff672..7518141cb 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2017-08-31/containerservice/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2017-08-31/containerservice/models.go @@ -459,7 +459,7 @@ type AgentPoolProfile struct { Ports *[]int32 `json:"ports,omitempty"` // StorageProfile - Storage profile specifies what kind of storage used. Choose from StorageAccount and ManagedDisks. Leave it empty, we will choose for you based on the orchestrator choice. Possible values include: 'StorageAccount', 'ManagedDisks' StorageProfile StorageProfileTypes `json:"storageProfile,omitempty"` - // VnetSubnetID - VNet SubnetID specifies the vnet's subnet identifier. If you specify either master VNet Subnet, or agent VNet Subnet, you need to specify both. And they have to be in the same VNet. + // VnetSubnetID - VNet SubnetID specifies the vnet's subnet identifier. VnetSubnetID *string `json:"vnetSubnetID,omitempty"` // OsType - OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: 'Linux', 'Windows' OsType OSType `json:"osType,omitempty"` @@ -1263,7 +1263,7 @@ type MasterProfile struct { VMSize VMSizeTypes `json:"vmSize,omitempty"` // OsDiskSizeGB - OS Disk Size in GB to be used to specify the disk size for every machine in this master/agent pool. If you specify 0, it will apply the default osDisk size according to the vmSize specified. OsDiskSizeGB *int32 `json:"osDiskSizeGB,omitempty"` - // VnetSubnetID - VNet SubnetID specifies the vnet's subnet identifier. If you specify either master VNet Subnet, or agent VNet Subnet, you need to specify both. And they have to be in the same VNet. + // VnetSubnetID - VNet SubnetID specifies the vnet's subnet identifier. VnetSubnetID *string `json:"vnetSubnetID,omitempty"` // FirstConsecutiveStaticIP - FirstConsecutiveStaticIP used to specify the first static ip of masters. FirstConsecutiveStaticIP *string `json:"firstConsecutiveStaticIP,omitempty"` diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2017-09-30/containerservice/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2017-09-30/containerservice/models.go index 91c646f72..9470cf778 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2017-09-30/containerservice/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2017-09-30/containerservice/models.go @@ -459,7 +459,7 @@ type AgentPoolProfile struct { Ports *[]int32 `json:"ports,omitempty"` // StorageProfile - Storage profile specifies what kind of storage used. Choose from StorageAccount and ManagedDisks. Leave it empty, we will choose for you based on the orchestrator choice. Possible values include: 'StorageAccount', 'ManagedDisks' StorageProfile StorageProfileTypes `json:"storageProfile,omitempty"` - // VnetSubnetID - VNet SubnetID specifies the vnet's subnet identifier. If you specify either master VNet Subnet, or agent VNet Subnet, you need to specify both. And they have to be in the same VNet. + // VnetSubnetID - VNet SubnetID specifies the vnet's subnet identifier. VnetSubnetID *string `json:"vnetSubnetID,omitempty"` // OsType - OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: 'Linux', 'Windows' OsType OSType `json:"osType,omitempty"` @@ -1263,7 +1263,7 @@ type MasterProfile struct { VMSize VMSizeTypes `json:"vmSize,omitempty"` // OsDiskSizeGB - OS Disk Size in GB to be used to specify the disk size for every machine in this master/agent pool. If you specify 0, it will apply the default osDisk size according to the vmSize specified. OsDiskSizeGB *int32 `json:"osDiskSizeGB,omitempty"` - // VnetSubnetID - VNet SubnetID specifies the vnet's subnet identifier. If you specify either master VNet Subnet, or agent VNet Subnet, you need to specify both. And they have to be in the same VNet. + // VnetSubnetID - VNet SubnetID specifies the vnet's subnet identifier. VnetSubnetID *string `json:"vnetSubnetID,omitempty"` // FirstConsecutiveStaticIP - FirstConsecutiveStaticIP used to specify the first static ip of masters. FirstConsecutiveStaticIP *string `json:"firstConsecutiveStaticIP,omitempty"` diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2018-03-31/containerservice/client.go b/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2018-03-31/containerservice/client.go new file mode 100644 index 000000000..09a36def7 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2018-03-31/containerservice/client.go @@ -0,0 +1,51 @@ +// Package containerservice implements the Azure ARM Containerservice service API version . +// +// The Container Service Client. +package containerservice + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/Azure/go-autorest/autorest" +) + +const ( + // DefaultBaseURI is the default URI used for the service Containerservice + DefaultBaseURI = "https://management.azure.com" +) + +// BaseClient is the base client for Containerservice. +type BaseClient struct { + autorest.Client + BaseURI string + SubscriptionID string +} + +// New creates an instance of the BaseClient client. +func New(subscriptionID string) BaseClient { + return NewWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewWithBaseURI creates an instance of the BaseClient client. +func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { + return BaseClient{ + Client: autorest.NewClientWithUserAgent(UserAgent()), + BaseURI: baseURI, + SubscriptionID: subscriptionID, + } +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2018-03-31/containerservice/containerservices.go b/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2018-03-31/containerservice/containerservices.go new file mode 100644 index 000000000..4a3dda6f5 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2018-03-31/containerservice/containerservices.go @@ -0,0 +1,548 @@ +package containerservice + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// ContainerServicesClient is the the Container Service Client. +type ContainerServicesClient struct { + BaseClient +} + +// NewContainerServicesClient creates an instance of the ContainerServicesClient client. +func NewContainerServicesClient(subscriptionID string) ContainerServicesClient { + return NewContainerServicesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewContainerServicesClientWithBaseURI creates an instance of the ContainerServicesClient client. +func NewContainerServicesClientWithBaseURI(baseURI string, subscriptionID string) ContainerServicesClient { + return ContainerServicesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or updates a container service with the specified configuration of orchestrator, masters, and +// agents. +// Parameters: +// resourceGroupName - the name of the resource group. +// containerServiceName - the name of the container service in the specified subscription and resource group. +// parameters - parameters supplied to the Create or Update a Container Service operation. +func (client ContainerServicesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, containerServiceName string, parameters ContainerService) (result ContainerServicesCreateOrUpdateFutureType, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.Properties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.Properties.OrchestratorProfile", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.Properties.CustomProfile", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.Properties.CustomProfile.Orchestrator", Name: validation.Null, Rule: true, Chain: nil}}}, + {Target: "parameters.Properties.ServicePrincipalProfile", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.Properties.ServicePrincipalProfile.ClientID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.Properties.ServicePrincipalProfile.KeyVaultSecretRef", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.Properties.ServicePrincipalProfile.KeyVaultSecretRef.VaultID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.Properties.ServicePrincipalProfile.KeyVaultSecretRef.SecretName", Name: validation.Null, Rule: true, Chain: nil}, + }}, + }}, + {Target: "parameters.Properties.MasterProfile", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.Properties.MasterProfile.DNSPrefix", Name: validation.Null, Rule: true, Chain: nil}}}, + {Target: "parameters.Properties.WindowsProfile", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.Properties.WindowsProfile.AdminUsername", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.Properties.WindowsProfile.AdminUsername", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+([._]?[a-zA-Z0-9]+)*$`, Chain: nil}}}, + {Target: "parameters.Properties.WindowsProfile.AdminPassword", Name: validation.Null, Rule: true, Chain: nil}, + }}, + {Target: "parameters.Properties.LinuxProfile", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.Properties.LinuxProfile.AdminUsername", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.Properties.LinuxProfile.AdminUsername", Name: validation.Pattern, Rule: `^[a-z][a-z0-9_-]*$`, Chain: nil}}}, + {Target: "parameters.Properties.LinuxProfile.SSH", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.Properties.LinuxProfile.SSH.PublicKeys", Name: validation.Null, Rule: true, Chain: nil}}}, + }}, + {Target: "parameters.Properties.DiagnosticsProfile", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.Properties.DiagnosticsProfile.VMDiagnostics", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.Properties.DiagnosticsProfile.VMDiagnostics.Enabled", Name: validation.Null, Rule: true, Chain: nil}}}, + }}, + }}}}}); err != nil { + return result, validation.NewError("containerservice.ContainerServicesClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, containerServiceName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ContainerServicesClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ContainerServicesClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client ContainerServicesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, containerServiceName string, parameters ContainerService) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "containerServiceName": autorest.Encode("path", containerServiceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/containerServices/{containerServiceName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client ContainerServicesClient) CreateOrUpdateSender(req *http.Request) (future ContainerServicesCreateOrUpdateFutureType, err error) { + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client ContainerServicesClient) CreateOrUpdateResponder(resp *http.Response) (result ContainerService, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes the specified container service in the specified subscription and resource group. The operation does +// not delete other resources created as part of creating a container service, including storage accounts, VMs, and +// availability sets. All the other resources created with the container service are part of the same resource group +// and can be deleted individually. +// Parameters: +// resourceGroupName - the name of the resource group. +// containerServiceName - the name of the container service in the specified subscription and resource group. +func (client ContainerServicesClient) Delete(ctx context.Context, resourceGroupName string, containerServiceName string) (result ContainerServicesDeleteFutureType, err error) { + req, err := client.DeletePreparer(ctx, resourceGroupName, containerServiceName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ContainerServicesClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ContainerServicesClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ContainerServicesClient) DeletePreparer(ctx context.Context, resourceGroupName string, containerServiceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "containerServiceName": autorest.Encode("path", containerServiceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/containerServices/{containerServiceName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ContainerServicesClient) DeleteSender(req *http.Request) (future ContainerServicesDeleteFutureType, err error) { + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ContainerServicesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the properties of the specified container service in the specified subscription and resource group. The +// operation returns the properties including state, orchestrator, number of masters and agents, and FQDNs of masters +// and agents. +// Parameters: +// resourceGroupName - the name of the resource group. +// containerServiceName - the name of the container service in the specified subscription and resource group. +func (client ContainerServicesClient) Get(ctx context.Context, resourceGroupName string, containerServiceName string) (result ContainerService, err error) { + req, err := client.GetPreparer(ctx, resourceGroupName, containerServiceName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ContainerServicesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerservice.ContainerServicesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ContainerServicesClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client ContainerServicesClient) GetPreparer(ctx context.Context, resourceGroupName string, containerServiceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "containerServiceName": autorest.Encode("path", containerServiceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/containerServices/{containerServiceName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ContainerServicesClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ContainerServicesClient) GetResponder(resp *http.Response) (result ContainerService, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List gets a list of container services in the specified subscription. The operation returns properties of each +// container service including state, orchestrator, number of masters and agents, and FQDNs of masters and agents. +func (client ContainerServicesClient) List(ctx context.Context) (result ListResultPage, err error) { + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ContainerServicesClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.lr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerservice.ContainerServicesClient", "List", resp, "Failure sending request") + return + } + + result.lr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ContainerServicesClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client ContainerServicesClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/containerServices", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ContainerServicesClient) ListSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ContainerServicesClient) ListResponder(resp *http.Response) (result ListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ContainerServicesClient) listNextResults(lastResults ListResult) (result ListResult, err error) { + req, err := lastResults.listResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "containerservice.ContainerServicesClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "containerservice.ContainerServicesClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ContainerServicesClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ContainerServicesClient) ListComplete(ctx context.Context) (result ListResultIterator, err error) { + result.page, err = client.List(ctx) + return +} + +// ListByResourceGroup gets a list of container services in the specified subscription and resource group. The +// operation returns properties of each container service including state, orchestrator, number of masters and agents, +// and FQDNs of masters and agents. +// Parameters: +// resourceGroupName - the name of the resource group. +func (client ContainerServicesClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result ListResultPage, err error) { + result.fn = client.listByResourceGroupNextResults + req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ContainerServicesClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.lr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerservice.ContainerServicesClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result.lr, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ContainerServicesClient", "ListByResourceGroup", resp, "Failure responding to request") + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client ContainerServicesClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/containerServices", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the +// http.Response Body if it receives an error. +func (client ContainerServicesClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always +// closes the http.Response Body. +func (client ContainerServicesClient) ListByResourceGroupResponder(resp *http.Response) (result ListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByResourceGroupNextResults retrieves the next set of results, if any. +func (client ContainerServicesClient) listByResourceGroupNextResults(lastResults ListResult) (result ListResult, err error) { + req, err := lastResults.listResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "containerservice.ContainerServicesClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "containerservice.ContainerServicesClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ContainerServicesClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client ContainerServicesClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result ListResultIterator, err error) { + result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) + return +} + +// ListOrchestrators gets a list of supported orchestrators in the specified subscription. The operation returns +// properties of each orchestrator including verison and available upgrades. +// Parameters: +// location - the name of a supported Azure region. +// resourceType - resource type for which the list of orchestrators needs to be returned +func (client ContainerServicesClient) ListOrchestrators(ctx context.Context, location string, resourceType string) (result OrchestratorVersionProfileListResult, err error) { + req, err := client.ListOrchestratorsPreparer(ctx, location, resourceType) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ContainerServicesClient", "ListOrchestrators", nil, "Failure preparing request") + return + } + + resp, err := client.ListOrchestratorsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerservice.ContainerServicesClient", "ListOrchestrators", resp, "Failure sending request") + return + } + + result, err = client.ListOrchestratorsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ContainerServicesClient", "ListOrchestrators", resp, "Failure responding to request") + } + + return +} + +// ListOrchestratorsPreparer prepares the ListOrchestrators request. +func (client ContainerServicesClient) ListOrchestratorsPreparer(ctx context.Context, location string, resourceType string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "location": autorest.Encode("path", location), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-09-30" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(resourceType) > 0 { + queryParameters["resource-type"] = autorest.Encode("query", resourceType) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/orchestrators", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListOrchestratorsSender sends the ListOrchestrators request. The method will close the +// http.Response Body if it receives an error. +func (client ContainerServicesClient) ListOrchestratorsSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListOrchestratorsResponder handles the response to the ListOrchestrators request. The method always +// closes the http.Response Body. +func (client ContainerServicesClient) ListOrchestratorsResponder(resp *http.Response) (result OrchestratorVersionProfileListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2018-03-31/containerservice/managedclusters.go b/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2018-03-31/containerservice/managedclusters.go new file mode 100644 index 000000000..753471bfb --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2018-03-31/containerservice/managedclusters.go @@ -0,0 +1,611 @@ +package containerservice + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// ManagedClustersClient is the the Container Service Client. +type ManagedClustersClient struct { + BaseClient +} + +// NewManagedClustersClient creates an instance of the ManagedClustersClient client. +func NewManagedClustersClient(subscriptionID string) ManagedClustersClient { + return NewManagedClustersClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewManagedClustersClientWithBaseURI creates an instance of the ManagedClustersClient client. +func NewManagedClustersClientWithBaseURI(baseURI string, subscriptionID string) ManagedClustersClient { + return ManagedClustersClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or updates a managed cluster with the specified configuration for agents and Kubernetes +// version. +// Parameters: +// resourceGroupName - the name of the resource group. +// resourceName - the name of the managed cluster resource. +// parameters - parameters supplied to the Create or Update a Managed Cluster operation. +func (client ManagedClustersClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, parameters ManagedCluster) (result ManagedClustersCreateOrUpdateFuture, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.ManagedClusterProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ManagedClusterProperties.LinuxProfile", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ManagedClusterProperties.LinuxProfile.AdminUsername", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.ManagedClusterProperties.LinuxProfile.AdminUsername", Name: validation.Pattern, Rule: `^[a-z][a-z0-9_-]*$`, Chain: nil}}}, + {Target: "parameters.ManagedClusterProperties.LinuxProfile.SSH", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.ManagedClusterProperties.LinuxProfile.SSH.PublicKeys", Name: validation.Null, Rule: true, Chain: nil}}}, + }}, + {Target: "parameters.ManagedClusterProperties.ServicePrincipalProfile", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ManagedClusterProperties.ServicePrincipalProfile.ClientID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.ManagedClusterProperties.ServicePrincipalProfile.KeyVaultSecretRef", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ManagedClusterProperties.ServicePrincipalProfile.KeyVaultSecretRef.VaultID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.ManagedClusterProperties.ServicePrincipalProfile.KeyVaultSecretRef.SecretName", Name: validation.Null, Rule: true, Chain: nil}, + }}, + }}, + {Target: "parameters.ManagedClusterProperties.NetworkProfile", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ManagedClusterProperties.NetworkProfile.PodCidr", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ManagedClusterProperties.NetworkProfile.PodCidr", Name: validation.Pattern, Rule: `^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$`, Chain: nil}}}, + {Target: "parameters.ManagedClusterProperties.NetworkProfile.ServiceCidr", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ManagedClusterProperties.NetworkProfile.ServiceCidr", Name: validation.Pattern, Rule: `^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$`, Chain: nil}}}, + {Target: "parameters.ManagedClusterProperties.NetworkProfile.DNSServiceIP", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ManagedClusterProperties.NetworkProfile.DNSServiceIP", Name: validation.Pattern, Rule: `^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$`, Chain: nil}}}, + {Target: "parameters.ManagedClusterProperties.NetworkProfile.DockerBridgeCidr", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ManagedClusterProperties.NetworkProfile.DockerBridgeCidr", Name: validation.Pattern, Rule: `^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$`, Chain: nil}}}, + }}, + {Target: "parameters.ManagedClusterProperties.AadProfile", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ManagedClusterProperties.AadProfile.ClientAppID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.ManagedClusterProperties.AadProfile.ServerAppID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.ManagedClusterProperties.AadProfile.ServerAppSecret", Name: validation.Null, Rule: true, Chain: nil}, + }}, + }}}}}); err != nil { + return result, validation.NewError("containerservice.ManagedClustersClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, resourceName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client ManagedClustersClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, resourceName string, parameters ManagedCluster) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-03-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client ManagedClustersClient) CreateOrUpdateSender(req *http.Request) (future ManagedClustersCreateOrUpdateFuture, err error) { + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client ManagedClustersClient) CreateOrUpdateResponder(resp *http.Response) (result ManagedCluster, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes the managed cluster with a specified resource group and name. +// Parameters: +// resourceGroupName - the name of the resource group. +// resourceName - the name of the managed cluster resource. +func (client ManagedClustersClient) Delete(ctx context.Context, resourceGroupName string, resourceName string) (result ManagedClustersDeleteFuture, err error) { + req, err := client.DeletePreparer(ctx, resourceGroupName, resourceName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ManagedClustersClient) DeletePreparer(ctx context.Context, resourceGroupName string, resourceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-03-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ManagedClustersClient) DeleteSender(req *http.Request) (future ManagedClustersDeleteFuture, err error) { + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ManagedClustersClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the details of the managed cluster with a specified resource group and name. +// Parameters: +// resourceGroupName - the name of the resource group. +// resourceName - the name of the managed cluster resource. +func (client ManagedClustersClient) Get(ctx context.Context, resourceGroupName string, resourceName string) (result ManagedCluster, err error) { + req, err := client.GetPreparer(ctx, resourceGroupName, resourceName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client ManagedClustersClient) GetPreparer(ctx context.Context, resourceGroupName string, resourceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-03-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ManagedClustersClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ManagedClustersClient) GetResponder(resp *http.Response) (result ManagedCluster, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetAccessProfile gets the accessProfile for the specified role name of the managed cluster with a specified resource +// group and name. +// Parameters: +// resourceGroupName - the name of the resource group. +// resourceName - the name of the managed cluster resource. +// roleName - the name of the role for managed cluster accessProfile resource. +func (client ManagedClustersClient) GetAccessProfile(ctx context.Context, resourceGroupName string, resourceName string, roleName string) (result ManagedClusterAccessProfile, err error) { + req, err := client.GetAccessProfilePreparer(ctx, resourceGroupName, resourceName, roleName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "GetAccessProfile", nil, "Failure preparing request") + return + } + + resp, err := client.GetAccessProfileSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "GetAccessProfile", resp, "Failure sending request") + return + } + + result, err = client.GetAccessProfileResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "GetAccessProfile", resp, "Failure responding to request") + } + + return +} + +// GetAccessProfilePreparer prepares the GetAccessProfile request. +func (client ManagedClustersClient) GetAccessProfilePreparer(ctx context.Context, resourceGroupName string, resourceName string, roleName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "roleName": autorest.Encode("path", roleName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-03-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetAccessProfileSender sends the GetAccessProfile request. The method will close the +// http.Response Body if it receives an error. +func (client ManagedClustersClient) GetAccessProfileSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetAccessProfileResponder handles the response to the GetAccessProfile request. The method always +// closes the http.Response Body. +func (client ManagedClustersClient) GetAccessProfileResponder(resp *http.Response) (result ManagedClusterAccessProfile, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetUpgradeProfile gets the details of the upgrade profile for a managed cluster with a specified resource group and +// name. +// Parameters: +// resourceGroupName - the name of the resource group. +// resourceName - the name of the managed cluster resource. +func (client ManagedClustersClient) GetUpgradeProfile(ctx context.Context, resourceGroupName string, resourceName string) (result ManagedClusterUpgradeProfile, err error) { + req, err := client.GetUpgradeProfilePreparer(ctx, resourceGroupName, resourceName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "GetUpgradeProfile", nil, "Failure preparing request") + return + } + + resp, err := client.GetUpgradeProfileSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "GetUpgradeProfile", resp, "Failure sending request") + return + } + + result, err = client.GetUpgradeProfileResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "GetUpgradeProfile", resp, "Failure responding to request") + } + + return +} + +// GetUpgradeProfilePreparer prepares the GetUpgradeProfile request. +func (client ManagedClustersClient) GetUpgradeProfilePreparer(ctx context.Context, resourceGroupName string, resourceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-03-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetUpgradeProfileSender sends the GetUpgradeProfile request. The method will close the +// http.Response Body if it receives an error. +func (client ManagedClustersClient) GetUpgradeProfileSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetUpgradeProfileResponder handles the response to the GetUpgradeProfile request. The method always +// closes the http.Response Body. +func (client ManagedClustersClient) GetUpgradeProfileResponder(resp *http.Response) (result ManagedClusterUpgradeProfile, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List gets a list of managed clusters in the specified subscription. The operation returns properties of each managed +// cluster. +func (client ManagedClustersClient) List(ctx context.Context) (result ManagedClusterListResultPage, err error) { + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.mclr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "List", resp, "Failure sending request") + return + } + + result.mclr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client ManagedClustersClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-03-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ManagedClustersClient) ListSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ManagedClustersClient) ListResponder(resp *http.Response) (result ManagedClusterListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ManagedClustersClient) listNextResults(lastResults ManagedClusterListResult) (result ManagedClusterListResult, err error) { + req, err := lastResults.managedClusterListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ManagedClustersClient) ListComplete(ctx context.Context) (result ManagedClusterListResultIterator, err error) { + result.page, err = client.List(ctx) + return +} + +// ListByResourceGroup lists managed clusters in the specified subscription and resource group. The operation returns +// properties of each managed cluster. +// Parameters: +// resourceGroupName - the name of the resource group. +func (client ManagedClustersClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result ManagedClusterListResultPage, err error) { + result.fn = client.listByResourceGroupNextResults + req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.mclr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result.mclr, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "ListByResourceGroup", resp, "Failure responding to request") + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client ManagedClustersClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-03-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the +// http.Response Body if it receives an error. +func (client ManagedClustersClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always +// closes the http.Response Body. +func (client ManagedClustersClient) ListByResourceGroupResponder(resp *http.Response) (result ManagedClusterListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByResourceGroupNextResults retrieves the next set of results, if any. +func (client ManagedClustersClient) listByResourceGroupNextResults(lastResults ManagedClusterListResult) (result ManagedClusterListResult, err error) { + req, err := lastResults.managedClusterListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client ManagedClustersClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result ManagedClusterListResultIterator, err error) { + result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2018-03-31/containerservice/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2018-03-31/containerservice/models.go new file mode 100644 index 000000000..f8b0bc6c3 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2018-03-31/containerservice/models.go @@ -0,0 +1,1726 @@ +package containerservice + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "encoding/json" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/to" + "net/http" +) + +// NetworkPlugin enumerates the values for network plugin. +type NetworkPlugin string + +const ( + // Azure ... + Azure NetworkPlugin = "azure" + // Kubenet ... + Kubenet NetworkPlugin = "kubenet" +) + +// PossibleNetworkPluginValues returns an array of possible values for the NetworkPlugin const type. +func PossibleNetworkPluginValues() []NetworkPlugin { + return []NetworkPlugin{Azure, Kubenet} +} + +// NetworkPolicy enumerates the values for network policy. +type NetworkPolicy string + +const ( + // Calico ... + Calico NetworkPolicy = "calico" +) + +// PossibleNetworkPolicyValues returns an array of possible values for the NetworkPolicy const type. +func PossibleNetworkPolicyValues() []NetworkPolicy { + return []NetworkPolicy{Calico} +} + +// OrchestratorTypes enumerates the values for orchestrator types. +type OrchestratorTypes string + +const ( + // Custom ... + Custom OrchestratorTypes = "Custom" + // DCOS ... + DCOS OrchestratorTypes = "DCOS" + // DockerCE ... + DockerCE OrchestratorTypes = "DockerCE" + // Kubernetes ... + Kubernetes OrchestratorTypes = "Kubernetes" + // Swarm ... + Swarm OrchestratorTypes = "Swarm" +) + +// PossibleOrchestratorTypesValues returns an array of possible values for the OrchestratorTypes const type. +func PossibleOrchestratorTypesValues() []OrchestratorTypes { + return []OrchestratorTypes{Custom, DCOS, DockerCE, Kubernetes, Swarm} +} + +// OSType enumerates the values for os type. +type OSType string + +const ( + // Linux ... + Linux OSType = "Linux" + // Windows ... + Windows OSType = "Windows" +) + +// PossibleOSTypeValues returns an array of possible values for the OSType const type. +func PossibleOSTypeValues() []OSType { + return []OSType{Linux, Windows} +} + +// StorageProfileTypes enumerates the values for storage profile types. +type StorageProfileTypes string + +const ( + // ManagedDisks ... + ManagedDisks StorageProfileTypes = "ManagedDisks" + // StorageAccount ... + StorageAccount StorageProfileTypes = "StorageAccount" +) + +// PossibleStorageProfileTypesValues returns an array of possible values for the StorageProfileTypes const type. +func PossibleStorageProfileTypesValues() []StorageProfileTypes { + return []StorageProfileTypes{ManagedDisks, StorageAccount} +} + +// VMSizeTypes enumerates the values for vm size types. +type VMSizeTypes string + +const ( + // StandardA1 ... + StandardA1 VMSizeTypes = "Standard_A1" + // StandardA10 ... + StandardA10 VMSizeTypes = "Standard_A10" + // StandardA11 ... + StandardA11 VMSizeTypes = "Standard_A11" + // StandardA1V2 ... + StandardA1V2 VMSizeTypes = "Standard_A1_v2" + // StandardA2 ... + StandardA2 VMSizeTypes = "Standard_A2" + // StandardA2mV2 ... + StandardA2mV2 VMSizeTypes = "Standard_A2m_v2" + // StandardA2V2 ... + StandardA2V2 VMSizeTypes = "Standard_A2_v2" + // StandardA3 ... + StandardA3 VMSizeTypes = "Standard_A3" + // StandardA4 ... + StandardA4 VMSizeTypes = "Standard_A4" + // StandardA4mV2 ... + StandardA4mV2 VMSizeTypes = "Standard_A4m_v2" + // StandardA4V2 ... + StandardA4V2 VMSizeTypes = "Standard_A4_v2" + // StandardA5 ... + StandardA5 VMSizeTypes = "Standard_A5" + // StandardA6 ... + StandardA6 VMSizeTypes = "Standard_A6" + // StandardA7 ... + StandardA7 VMSizeTypes = "Standard_A7" + // StandardA8 ... + StandardA8 VMSizeTypes = "Standard_A8" + // StandardA8mV2 ... + StandardA8mV2 VMSizeTypes = "Standard_A8m_v2" + // StandardA8V2 ... + StandardA8V2 VMSizeTypes = "Standard_A8_v2" + // StandardA9 ... + StandardA9 VMSizeTypes = "Standard_A9" + // StandardB2ms ... + StandardB2ms VMSizeTypes = "Standard_B2ms" + // StandardB2s ... + StandardB2s VMSizeTypes = "Standard_B2s" + // StandardB4ms ... + StandardB4ms VMSizeTypes = "Standard_B4ms" + // StandardB8ms ... + StandardB8ms VMSizeTypes = "Standard_B8ms" + // StandardD1 ... + StandardD1 VMSizeTypes = "Standard_D1" + // StandardD11 ... + StandardD11 VMSizeTypes = "Standard_D11" + // StandardD11V2 ... + StandardD11V2 VMSizeTypes = "Standard_D11_v2" + // StandardD11V2Promo ... + StandardD11V2Promo VMSizeTypes = "Standard_D11_v2_Promo" + // StandardD12 ... + StandardD12 VMSizeTypes = "Standard_D12" + // StandardD12V2 ... + StandardD12V2 VMSizeTypes = "Standard_D12_v2" + // StandardD12V2Promo ... + StandardD12V2Promo VMSizeTypes = "Standard_D12_v2_Promo" + // StandardD13 ... + StandardD13 VMSizeTypes = "Standard_D13" + // StandardD13V2 ... + StandardD13V2 VMSizeTypes = "Standard_D13_v2" + // StandardD13V2Promo ... + StandardD13V2Promo VMSizeTypes = "Standard_D13_v2_Promo" + // StandardD14 ... + StandardD14 VMSizeTypes = "Standard_D14" + // StandardD14V2 ... + StandardD14V2 VMSizeTypes = "Standard_D14_v2" + // StandardD14V2Promo ... + StandardD14V2Promo VMSizeTypes = "Standard_D14_v2_Promo" + // StandardD15V2 ... + StandardD15V2 VMSizeTypes = "Standard_D15_v2" + // StandardD16sV3 ... + StandardD16sV3 VMSizeTypes = "Standard_D16s_v3" + // StandardD16V3 ... + StandardD16V3 VMSizeTypes = "Standard_D16_v3" + // StandardD1V2 ... + StandardD1V2 VMSizeTypes = "Standard_D1_v2" + // StandardD2 ... + StandardD2 VMSizeTypes = "Standard_D2" + // StandardD2sV3 ... + StandardD2sV3 VMSizeTypes = "Standard_D2s_v3" + // StandardD2V2 ... + StandardD2V2 VMSizeTypes = "Standard_D2_v2" + // StandardD2V2Promo ... + StandardD2V2Promo VMSizeTypes = "Standard_D2_v2_Promo" + // StandardD2V3 ... + StandardD2V3 VMSizeTypes = "Standard_D2_v3" + // StandardD3 ... + StandardD3 VMSizeTypes = "Standard_D3" + // StandardD32sV3 ... + StandardD32sV3 VMSizeTypes = "Standard_D32s_v3" + // StandardD32V3 ... + StandardD32V3 VMSizeTypes = "Standard_D32_v3" + // StandardD3V2 ... + StandardD3V2 VMSizeTypes = "Standard_D3_v2" + // StandardD3V2Promo ... + StandardD3V2Promo VMSizeTypes = "Standard_D3_v2_Promo" + // StandardD4 ... + StandardD4 VMSizeTypes = "Standard_D4" + // StandardD4sV3 ... + StandardD4sV3 VMSizeTypes = "Standard_D4s_v3" + // StandardD4V2 ... + StandardD4V2 VMSizeTypes = "Standard_D4_v2" + // StandardD4V2Promo ... + StandardD4V2Promo VMSizeTypes = "Standard_D4_v2_Promo" + // StandardD4V3 ... + StandardD4V3 VMSizeTypes = "Standard_D4_v3" + // StandardD5V2 ... + StandardD5V2 VMSizeTypes = "Standard_D5_v2" + // StandardD5V2Promo ... + StandardD5V2Promo VMSizeTypes = "Standard_D5_v2_Promo" + // StandardD64sV3 ... + StandardD64sV3 VMSizeTypes = "Standard_D64s_v3" + // StandardD64V3 ... + StandardD64V3 VMSizeTypes = "Standard_D64_v3" + // StandardD8sV3 ... + StandardD8sV3 VMSizeTypes = "Standard_D8s_v3" + // StandardD8V3 ... + StandardD8V3 VMSizeTypes = "Standard_D8_v3" + // StandardDS1 ... + StandardDS1 VMSizeTypes = "Standard_DS1" + // StandardDS11 ... + StandardDS11 VMSizeTypes = "Standard_DS11" + // StandardDS11V2 ... + StandardDS11V2 VMSizeTypes = "Standard_DS11_v2" + // StandardDS11V2Promo ... + StandardDS11V2Promo VMSizeTypes = "Standard_DS11_v2_Promo" + // StandardDS12 ... + StandardDS12 VMSizeTypes = "Standard_DS12" + // StandardDS12V2 ... + StandardDS12V2 VMSizeTypes = "Standard_DS12_v2" + // StandardDS12V2Promo ... + StandardDS12V2Promo VMSizeTypes = "Standard_DS12_v2_Promo" + // StandardDS13 ... + StandardDS13 VMSizeTypes = "Standard_DS13" + // StandardDS132V2 ... + StandardDS132V2 VMSizeTypes = "Standard_DS13-2_v2" + // StandardDS134V2 ... + StandardDS134V2 VMSizeTypes = "Standard_DS13-4_v2" + // StandardDS13V2 ... + StandardDS13V2 VMSizeTypes = "Standard_DS13_v2" + // StandardDS13V2Promo ... + StandardDS13V2Promo VMSizeTypes = "Standard_DS13_v2_Promo" + // StandardDS14 ... + StandardDS14 VMSizeTypes = "Standard_DS14" + // StandardDS144V2 ... + StandardDS144V2 VMSizeTypes = "Standard_DS14-4_v2" + // StandardDS148V2 ... + StandardDS148V2 VMSizeTypes = "Standard_DS14-8_v2" + // StandardDS14V2 ... + StandardDS14V2 VMSizeTypes = "Standard_DS14_v2" + // StandardDS14V2Promo ... + StandardDS14V2Promo VMSizeTypes = "Standard_DS14_v2_Promo" + // StandardDS15V2 ... + StandardDS15V2 VMSizeTypes = "Standard_DS15_v2" + // StandardDS1V2 ... + StandardDS1V2 VMSizeTypes = "Standard_DS1_v2" + // StandardDS2 ... + StandardDS2 VMSizeTypes = "Standard_DS2" + // StandardDS2V2 ... + StandardDS2V2 VMSizeTypes = "Standard_DS2_v2" + // StandardDS2V2Promo ... + StandardDS2V2Promo VMSizeTypes = "Standard_DS2_v2_Promo" + // StandardDS3 ... + StandardDS3 VMSizeTypes = "Standard_DS3" + // StandardDS3V2 ... + StandardDS3V2 VMSizeTypes = "Standard_DS3_v2" + // StandardDS3V2Promo ... + StandardDS3V2Promo VMSizeTypes = "Standard_DS3_v2_Promo" + // StandardDS4 ... + StandardDS4 VMSizeTypes = "Standard_DS4" + // StandardDS4V2 ... + StandardDS4V2 VMSizeTypes = "Standard_DS4_v2" + // StandardDS4V2Promo ... + StandardDS4V2Promo VMSizeTypes = "Standard_DS4_v2_Promo" + // StandardDS5V2 ... + StandardDS5V2 VMSizeTypes = "Standard_DS5_v2" + // StandardDS5V2Promo ... + StandardDS5V2Promo VMSizeTypes = "Standard_DS5_v2_Promo" + // StandardE16sV3 ... + StandardE16sV3 VMSizeTypes = "Standard_E16s_v3" + // StandardE16V3 ... + StandardE16V3 VMSizeTypes = "Standard_E16_v3" + // StandardE2sV3 ... + StandardE2sV3 VMSizeTypes = "Standard_E2s_v3" + // StandardE2V3 ... + StandardE2V3 VMSizeTypes = "Standard_E2_v3" + // StandardE3216sV3 ... + StandardE3216sV3 VMSizeTypes = "Standard_E32-16s_v3" + // StandardE328sV3 ... + StandardE328sV3 VMSizeTypes = "Standard_E32-8s_v3" + // StandardE32sV3 ... + StandardE32sV3 VMSizeTypes = "Standard_E32s_v3" + // StandardE32V3 ... + StandardE32V3 VMSizeTypes = "Standard_E32_v3" + // StandardE4sV3 ... + StandardE4sV3 VMSizeTypes = "Standard_E4s_v3" + // StandardE4V3 ... + StandardE4V3 VMSizeTypes = "Standard_E4_v3" + // StandardE6416sV3 ... + StandardE6416sV3 VMSizeTypes = "Standard_E64-16s_v3" + // StandardE6432sV3 ... + StandardE6432sV3 VMSizeTypes = "Standard_E64-32s_v3" + // StandardE64sV3 ... + StandardE64sV3 VMSizeTypes = "Standard_E64s_v3" + // StandardE64V3 ... + StandardE64V3 VMSizeTypes = "Standard_E64_v3" + // StandardE8sV3 ... + StandardE8sV3 VMSizeTypes = "Standard_E8s_v3" + // StandardE8V3 ... + StandardE8V3 VMSizeTypes = "Standard_E8_v3" + // StandardF1 ... + StandardF1 VMSizeTypes = "Standard_F1" + // StandardF16 ... + StandardF16 VMSizeTypes = "Standard_F16" + // StandardF16s ... + StandardF16s VMSizeTypes = "Standard_F16s" + // StandardF16sV2 ... + StandardF16sV2 VMSizeTypes = "Standard_F16s_v2" + // StandardF1s ... + StandardF1s VMSizeTypes = "Standard_F1s" + // StandardF2 ... + StandardF2 VMSizeTypes = "Standard_F2" + // StandardF2s ... + StandardF2s VMSizeTypes = "Standard_F2s" + // StandardF2sV2 ... + StandardF2sV2 VMSizeTypes = "Standard_F2s_v2" + // StandardF32sV2 ... + StandardF32sV2 VMSizeTypes = "Standard_F32s_v2" + // StandardF4 ... + StandardF4 VMSizeTypes = "Standard_F4" + // StandardF4s ... + StandardF4s VMSizeTypes = "Standard_F4s" + // StandardF4sV2 ... + StandardF4sV2 VMSizeTypes = "Standard_F4s_v2" + // StandardF64sV2 ... + StandardF64sV2 VMSizeTypes = "Standard_F64s_v2" + // StandardF72sV2 ... + StandardF72sV2 VMSizeTypes = "Standard_F72s_v2" + // StandardF8 ... + StandardF8 VMSizeTypes = "Standard_F8" + // StandardF8s ... + StandardF8s VMSizeTypes = "Standard_F8s" + // StandardF8sV2 ... + StandardF8sV2 VMSizeTypes = "Standard_F8s_v2" + // StandardG1 ... + StandardG1 VMSizeTypes = "Standard_G1" + // StandardG2 ... + StandardG2 VMSizeTypes = "Standard_G2" + // StandardG3 ... + StandardG3 VMSizeTypes = "Standard_G3" + // StandardG4 ... + StandardG4 VMSizeTypes = "Standard_G4" + // StandardG5 ... + StandardG5 VMSizeTypes = "Standard_G5" + // StandardGS1 ... + StandardGS1 VMSizeTypes = "Standard_GS1" + // StandardGS2 ... + StandardGS2 VMSizeTypes = "Standard_GS2" + // StandardGS3 ... + StandardGS3 VMSizeTypes = "Standard_GS3" + // StandardGS4 ... + StandardGS4 VMSizeTypes = "Standard_GS4" + // StandardGS44 ... + StandardGS44 VMSizeTypes = "Standard_GS4-4" + // StandardGS48 ... + StandardGS48 VMSizeTypes = "Standard_GS4-8" + // StandardGS5 ... + StandardGS5 VMSizeTypes = "Standard_GS5" + // StandardGS516 ... + StandardGS516 VMSizeTypes = "Standard_GS5-16" + // StandardGS58 ... + StandardGS58 VMSizeTypes = "Standard_GS5-8" + // StandardH16 ... + StandardH16 VMSizeTypes = "Standard_H16" + // StandardH16m ... + StandardH16m VMSizeTypes = "Standard_H16m" + // StandardH16mr ... + StandardH16mr VMSizeTypes = "Standard_H16mr" + // StandardH16r ... + StandardH16r VMSizeTypes = "Standard_H16r" + // StandardH8 ... + StandardH8 VMSizeTypes = "Standard_H8" + // StandardH8m ... + StandardH8m VMSizeTypes = "Standard_H8m" + // StandardL16s ... + StandardL16s VMSizeTypes = "Standard_L16s" + // StandardL32s ... + StandardL32s VMSizeTypes = "Standard_L32s" + // StandardL4s ... + StandardL4s VMSizeTypes = "Standard_L4s" + // StandardL8s ... + StandardL8s VMSizeTypes = "Standard_L8s" + // StandardM12832ms ... + StandardM12832ms VMSizeTypes = "Standard_M128-32ms" + // StandardM12864ms ... + StandardM12864ms VMSizeTypes = "Standard_M128-64ms" + // StandardM128ms ... + StandardM128ms VMSizeTypes = "Standard_M128ms" + // StandardM128s ... + StandardM128s VMSizeTypes = "Standard_M128s" + // StandardM6416ms ... + StandardM6416ms VMSizeTypes = "Standard_M64-16ms" + // StandardM6432ms ... + StandardM6432ms VMSizeTypes = "Standard_M64-32ms" + // StandardM64ms ... + StandardM64ms VMSizeTypes = "Standard_M64ms" + // StandardM64s ... + StandardM64s VMSizeTypes = "Standard_M64s" + // StandardNC12 ... + StandardNC12 VMSizeTypes = "Standard_NC12" + // StandardNC12sV2 ... + StandardNC12sV2 VMSizeTypes = "Standard_NC12s_v2" + // StandardNC12sV3 ... + StandardNC12sV3 VMSizeTypes = "Standard_NC12s_v3" + // StandardNC24 ... + StandardNC24 VMSizeTypes = "Standard_NC24" + // StandardNC24r ... + StandardNC24r VMSizeTypes = "Standard_NC24r" + // StandardNC24rsV2 ... + StandardNC24rsV2 VMSizeTypes = "Standard_NC24rs_v2" + // StandardNC24rsV3 ... + StandardNC24rsV3 VMSizeTypes = "Standard_NC24rs_v3" + // StandardNC24sV2 ... + StandardNC24sV2 VMSizeTypes = "Standard_NC24s_v2" + // StandardNC24sV3 ... + StandardNC24sV3 VMSizeTypes = "Standard_NC24s_v3" + // StandardNC6 ... + StandardNC6 VMSizeTypes = "Standard_NC6" + // StandardNC6sV2 ... + StandardNC6sV2 VMSizeTypes = "Standard_NC6s_v2" + // StandardNC6sV3 ... + StandardNC6sV3 VMSizeTypes = "Standard_NC6s_v3" + // StandardND12s ... + StandardND12s VMSizeTypes = "Standard_ND12s" + // StandardND24rs ... + StandardND24rs VMSizeTypes = "Standard_ND24rs" + // StandardND24s ... + StandardND24s VMSizeTypes = "Standard_ND24s" + // StandardND6s ... + StandardND6s VMSizeTypes = "Standard_ND6s" + // StandardNV12 ... + StandardNV12 VMSizeTypes = "Standard_NV12" + // StandardNV24 ... + StandardNV24 VMSizeTypes = "Standard_NV24" + // StandardNV6 ... + StandardNV6 VMSizeTypes = "Standard_NV6" +) + +// PossibleVMSizeTypesValues returns an array of possible values for the VMSizeTypes const type. +func PossibleVMSizeTypesValues() []VMSizeTypes { + return []VMSizeTypes{StandardA1, StandardA10, StandardA11, StandardA1V2, StandardA2, StandardA2mV2, StandardA2V2, StandardA3, StandardA4, StandardA4mV2, StandardA4V2, StandardA5, StandardA6, StandardA7, StandardA8, StandardA8mV2, StandardA8V2, StandardA9, StandardB2ms, StandardB2s, StandardB4ms, StandardB8ms, StandardD1, StandardD11, StandardD11V2, StandardD11V2Promo, StandardD12, StandardD12V2, StandardD12V2Promo, StandardD13, StandardD13V2, StandardD13V2Promo, StandardD14, StandardD14V2, StandardD14V2Promo, StandardD15V2, StandardD16sV3, StandardD16V3, StandardD1V2, StandardD2, StandardD2sV3, StandardD2V2, StandardD2V2Promo, StandardD2V3, StandardD3, StandardD32sV3, StandardD32V3, StandardD3V2, StandardD3V2Promo, StandardD4, StandardD4sV3, StandardD4V2, StandardD4V2Promo, StandardD4V3, StandardD5V2, StandardD5V2Promo, StandardD64sV3, StandardD64V3, StandardD8sV3, StandardD8V3, StandardDS1, StandardDS11, StandardDS11V2, StandardDS11V2Promo, StandardDS12, StandardDS12V2, StandardDS12V2Promo, StandardDS13, StandardDS132V2, StandardDS134V2, StandardDS13V2, StandardDS13V2Promo, StandardDS14, StandardDS144V2, StandardDS148V2, StandardDS14V2, StandardDS14V2Promo, StandardDS15V2, StandardDS1V2, StandardDS2, StandardDS2V2, StandardDS2V2Promo, StandardDS3, StandardDS3V2, StandardDS3V2Promo, StandardDS4, StandardDS4V2, StandardDS4V2Promo, StandardDS5V2, StandardDS5V2Promo, StandardE16sV3, StandardE16V3, StandardE2sV3, StandardE2V3, StandardE3216sV3, StandardE328sV3, StandardE32sV3, StandardE32V3, StandardE4sV3, StandardE4V3, StandardE6416sV3, StandardE6432sV3, StandardE64sV3, StandardE64V3, StandardE8sV3, StandardE8V3, StandardF1, StandardF16, StandardF16s, StandardF16sV2, StandardF1s, StandardF2, StandardF2s, StandardF2sV2, StandardF32sV2, StandardF4, StandardF4s, StandardF4sV2, StandardF64sV2, StandardF72sV2, StandardF8, StandardF8s, StandardF8sV2, StandardG1, StandardG2, StandardG3, StandardG4, StandardG5, StandardGS1, StandardGS2, StandardGS3, StandardGS4, StandardGS44, StandardGS48, StandardGS5, StandardGS516, StandardGS58, StandardH16, StandardH16m, StandardH16mr, StandardH16r, StandardH8, StandardH8m, StandardL16s, StandardL32s, StandardL4s, StandardL8s, StandardM12832ms, StandardM12864ms, StandardM128ms, StandardM128s, StandardM6416ms, StandardM6432ms, StandardM64ms, StandardM64s, StandardNC12, StandardNC12sV2, StandardNC12sV3, StandardNC24, StandardNC24r, StandardNC24rsV2, StandardNC24rsV3, StandardNC24sV2, StandardNC24sV3, StandardNC6, StandardNC6sV2, StandardNC6sV3, StandardND12s, StandardND24rs, StandardND24s, StandardND6s, StandardNV12, StandardNV24, StandardNV6} +} + +// AccessProfile profile for enabling a user to access a managed cluster. +type AccessProfile struct { + // KubeConfig - Base64-encoded Kubernetes configuration file. + KubeConfig *[]byte `json:"kubeConfig,omitempty"` +} + +// AgentPoolProfile profile for the container service agent pool. +type AgentPoolProfile struct { + // Name - Unique name of the agent pool profile in the context of the subscription and resource group. + Name *string `json:"name,omitempty"` + // Count - Number of agents (VMs) to host docker containers. Allowed values must be in the range of 1 to 100 (inclusive). The default value is 1. + Count *int32 `json:"count,omitempty"` + // VMSize - Size of agent VMs. Possible values include: 'StandardA1', 'StandardA10', 'StandardA11', 'StandardA1V2', 'StandardA2', 'StandardA2V2', 'StandardA2mV2', 'StandardA3', 'StandardA4', 'StandardA4V2', 'StandardA4mV2', 'StandardA5', 'StandardA6', 'StandardA7', 'StandardA8', 'StandardA8V2', 'StandardA8mV2', 'StandardA9', 'StandardB2ms', 'StandardB2s', 'StandardB4ms', 'StandardB8ms', 'StandardD1', 'StandardD11', 'StandardD11V2', 'StandardD11V2Promo', 'StandardD12', 'StandardD12V2', 'StandardD12V2Promo', 'StandardD13', 'StandardD13V2', 'StandardD13V2Promo', 'StandardD14', 'StandardD14V2', 'StandardD14V2Promo', 'StandardD15V2', 'StandardD16V3', 'StandardD16sV3', 'StandardD1V2', 'StandardD2', 'StandardD2V2', 'StandardD2V2Promo', 'StandardD2V3', 'StandardD2sV3', 'StandardD3', 'StandardD32V3', 'StandardD32sV3', 'StandardD3V2', 'StandardD3V2Promo', 'StandardD4', 'StandardD4V2', 'StandardD4V2Promo', 'StandardD4V3', 'StandardD4sV3', 'StandardD5V2', 'StandardD5V2Promo', 'StandardD64V3', 'StandardD64sV3', 'StandardD8V3', 'StandardD8sV3', 'StandardDS1', 'StandardDS11', 'StandardDS11V2', 'StandardDS11V2Promo', 'StandardDS12', 'StandardDS12V2', 'StandardDS12V2Promo', 'StandardDS13', 'StandardDS132V2', 'StandardDS134V2', 'StandardDS13V2', 'StandardDS13V2Promo', 'StandardDS14', 'StandardDS144V2', 'StandardDS148V2', 'StandardDS14V2', 'StandardDS14V2Promo', 'StandardDS15V2', 'StandardDS1V2', 'StandardDS2', 'StandardDS2V2', 'StandardDS2V2Promo', 'StandardDS3', 'StandardDS3V2', 'StandardDS3V2Promo', 'StandardDS4', 'StandardDS4V2', 'StandardDS4V2Promo', 'StandardDS5V2', 'StandardDS5V2Promo', 'StandardE16V3', 'StandardE16sV3', 'StandardE2V3', 'StandardE2sV3', 'StandardE3216sV3', 'StandardE328sV3', 'StandardE32V3', 'StandardE32sV3', 'StandardE4V3', 'StandardE4sV3', 'StandardE6416sV3', 'StandardE6432sV3', 'StandardE64V3', 'StandardE64sV3', 'StandardE8V3', 'StandardE8sV3', 'StandardF1', 'StandardF16', 'StandardF16s', 'StandardF16sV2', 'StandardF1s', 'StandardF2', 'StandardF2s', 'StandardF2sV2', 'StandardF32sV2', 'StandardF4', 'StandardF4s', 'StandardF4sV2', 'StandardF64sV2', 'StandardF72sV2', 'StandardF8', 'StandardF8s', 'StandardF8sV2', 'StandardG1', 'StandardG2', 'StandardG3', 'StandardG4', 'StandardG5', 'StandardGS1', 'StandardGS2', 'StandardGS3', 'StandardGS4', 'StandardGS44', 'StandardGS48', 'StandardGS5', 'StandardGS516', 'StandardGS58', 'StandardH16', 'StandardH16m', 'StandardH16mr', 'StandardH16r', 'StandardH8', 'StandardH8m', 'StandardL16s', 'StandardL32s', 'StandardL4s', 'StandardL8s', 'StandardM12832ms', 'StandardM12864ms', 'StandardM128ms', 'StandardM128s', 'StandardM6416ms', 'StandardM6432ms', 'StandardM64ms', 'StandardM64s', 'StandardNC12', 'StandardNC12sV2', 'StandardNC12sV3', 'StandardNC24', 'StandardNC24r', 'StandardNC24rsV2', 'StandardNC24rsV3', 'StandardNC24sV2', 'StandardNC24sV3', 'StandardNC6', 'StandardNC6sV2', 'StandardNC6sV3', 'StandardND12s', 'StandardND24rs', 'StandardND24s', 'StandardND6s', 'StandardNV12', 'StandardNV24', 'StandardNV6' + VMSize VMSizeTypes `json:"vmSize,omitempty"` + // OsDiskSizeGB - OS Disk Size in GB to be used to specify the disk size for every machine in this master/agent pool. If you specify 0, it will apply the default osDisk size according to the vmSize specified. + OsDiskSizeGB *int32 `json:"osDiskSizeGB,omitempty"` + // DNSPrefix - DNS prefix to be used to create the FQDN for the agent pool. + DNSPrefix *string `json:"dnsPrefix,omitempty"` + // Fqdn - FDQN for the agent pool. + Fqdn *string `json:"fqdn,omitempty"` + // Ports - Ports number array used to expose on this agent pool. The default opened ports are different based on your choice of orchestrator. + Ports *[]int32 `json:"ports,omitempty"` + // StorageProfile - Storage profile specifies what kind of storage used. Choose from StorageAccount and ManagedDisks. Leave it empty, we will choose for you based on the orchestrator choice. Possible values include: 'StorageAccount', 'ManagedDisks' + StorageProfile StorageProfileTypes `json:"storageProfile,omitempty"` + // VnetSubnetID - VNet SubnetID specifies the vnet's subnet identifier. + VnetSubnetID *string `json:"vnetSubnetID,omitempty"` + // OsType - OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: 'Linux', 'Windows' + OsType OSType `json:"osType,omitempty"` +} + +// ContainerService container service. +type ContainerService struct { + autorest.Response `json:"-"` + // Properties - Properties of the container service. + *Properties `json:"properties,omitempty"` + // ID - Resource Id + ID *string `json:"id,omitempty"` + // Name - Resource name + Name *string `json:"name,omitempty"` + // Type - Resource type + Type *string `json:"type,omitempty"` + // Location - Resource location + Location *string `json:"location,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for ContainerService. +func (cs ContainerService) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cs.Properties != nil { + objectMap["properties"] = cs.Properties + } + if cs.ID != nil { + objectMap["id"] = cs.ID + } + if cs.Name != nil { + objectMap["name"] = cs.Name + } + if cs.Type != nil { + objectMap["type"] = cs.Type + } + if cs.Location != nil { + objectMap["location"] = cs.Location + } + if cs.Tags != nil { + objectMap["tags"] = cs.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ContainerService struct. +func (cs *ContainerService) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var properties Properties + err = json.Unmarshal(*v, &properties) + if err != nil { + return err + } + cs.Properties = &properties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + cs.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + cs.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + cs.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + cs.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + cs.Tags = tags + } + } + } + + return nil +} + +// ContainerServicesCreateOrUpdateFutureType an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ContainerServicesCreateOrUpdateFutureType struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ContainerServicesCreateOrUpdateFutureType) Result(client ContainerServicesClient) (cs ContainerService, err error) { + var done bool + done, err = future.Done(client) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ContainerServicesCreateOrUpdateFutureType", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("containerservice.ContainerServicesCreateOrUpdateFutureType") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if cs.Response.Response, err = future.GetResult(sender); err == nil && cs.Response.Response.StatusCode != http.StatusNoContent { + cs, err = client.CreateOrUpdateResponder(cs.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ContainerServicesCreateOrUpdateFutureType", "Result", cs.Response.Response, "Failure responding to request") + } + } + return +} + +// ContainerServicesDeleteFutureType an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ContainerServicesDeleteFutureType struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ContainerServicesDeleteFutureType) Result(client ContainerServicesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.Done(client) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ContainerServicesDeleteFutureType", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("containerservice.ContainerServicesDeleteFutureType") + return + } + ar.Response = future.Response() + return +} + +// CustomProfile properties to configure a custom container service cluster. +type CustomProfile struct { + // Orchestrator - The name of the custom orchestrator to use. + Orchestrator *string `json:"orchestrator,omitempty"` +} + +// DiagnosticsProfile profile for diagnostics on the container service cluster. +type DiagnosticsProfile struct { + // VMDiagnostics - Profile for diagnostics on the container service VMs. + VMDiagnostics *VMDiagnostics `json:"vmDiagnostics,omitempty"` +} + +// KeyVaultSecretRef reference to a secret stored in Azure Key Vault. +type KeyVaultSecretRef struct { + // VaultID - Key vault identifier. + VaultID *string `json:"vaultID,omitempty"` + // SecretName - The secret name. + SecretName *string `json:"secretName,omitempty"` + // Version - The secret version. + Version *string `json:"version,omitempty"` +} + +// LinuxProfile profile for Linux VMs in the container service cluster. +type LinuxProfile struct { + // AdminUsername - The administrator username to use for Linux VMs. + AdminUsername *string `json:"adminUsername,omitempty"` + // SSH - SSH configuration for Linux-based VMs running on Azure. + SSH *SSHConfiguration `json:"ssh,omitempty"` +} + +// ListResult the response from the List Container Services operation. +type ListResult struct { + autorest.Response `json:"-"` + // Value - The list of container services. + Value *[]ContainerService `json:"value,omitempty"` + // NextLink - The URL to get the next set of container service results. + NextLink *string `json:"nextLink,omitempty"` +} + +// ListResultIterator provides access to a complete listing of ContainerService values. +type ListResultIterator struct { + i int + page ListResultPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ListResultIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ListResultIterator) Response() ListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ListResultIterator) Value() ContainerService { + if !iter.page.NotDone() { + return ContainerService{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (lr ListResult) IsEmpty() bool { + return lr.Value == nil || len(*lr.Value) == 0 +} + +// listResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (lr ListResult) listResultPreparer() (*http.Request, error) { + if lr.NextLink == nil || len(to.String(lr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(lr.NextLink))) +} + +// ListResultPage contains a page of ContainerService values. +type ListResultPage struct { + fn func(ListResult) (ListResult, error) + lr ListResult +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ListResultPage) Next() error { + next, err := page.fn(page.lr) + if err != nil { + return err + } + page.lr = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ListResultPage) NotDone() bool { + return !page.lr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ListResultPage) Response() ListResult { + return page.lr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ListResultPage) Values() []ContainerService { + if page.lr.IsEmpty() { + return nil + } + return *page.lr.Value +} + +// ManagedCluster managed cluster. +type ManagedCluster struct { + autorest.Response `json:"-"` + // ManagedClusterProperties - Properties of a managed cluster. + *ManagedClusterProperties `json:"properties,omitempty"` + // ID - Resource Id + ID *string `json:"id,omitempty"` + // Name - Resource name + Name *string `json:"name,omitempty"` + // Type - Resource type + Type *string `json:"type,omitempty"` + // Location - Resource location + Location *string `json:"location,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for ManagedCluster. +func (mc ManagedCluster) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mc.ManagedClusterProperties != nil { + objectMap["properties"] = mc.ManagedClusterProperties + } + if mc.ID != nil { + objectMap["id"] = mc.ID + } + if mc.Name != nil { + objectMap["name"] = mc.Name + } + if mc.Type != nil { + objectMap["type"] = mc.Type + } + if mc.Location != nil { + objectMap["location"] = mc.Location + } + if mc.Tags != nil { + objectMap["tags"] = mc.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ManagedCluster struct. +func (mc *ManagedCluster) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var managedClusterProperties ManagedClusterProperties + err = json.Unmarshal(*v, &managedClusterProperties) + if err != nil { + return err + } + mc.ManagedClusterProperties = &managedClusterProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + mc.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + mc.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + mc.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + mc.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + mc.Tags = tags + } + } + } + + return nil +} + +// ManagedClusterAADProfile aADProfile specifies attributes for Azure Active Directory integration. +type ManagedClusterAADProfile struct { + // ClientAppID - The client AAD application ID. + ClientAppID *string `json:"clientAppID,omitempty"` + // ServerAppID - The server AAD application ID. + ServerAppID *string `json:"serverAppID,omitempty"` + // ServerAppSecret - The server AAD application secret. + ServerAppSecret *string `json:"serverAppSecret,omitempty"` + // TenantID - The AAD tenant ID to use for authentication. If not specified, will use the tenant of the deployment subscription. + TenantID *string `json:"tenantID,omitempty"` +} + +// ManagedClusterAccessProfile managed cluster Access Profile. +type ManagedClusterAccessProfile struct { + autorest.Response `json:"-"` + // AccessProfile - AccessProfile of a managed cluster. + *AccessProfile `json:"properties,omitempty"` + // ID - Resource Id + ID *string `json:"id,omitempty"` + // Name - Resource name + Name *string `json:"name,omitempty"` + // Type - Resource type + Type *string `json:"type,omitempty"` + // Location - Resource location + Location *string `json:"location,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for ManagedClusterAccessProfile. +func (mcap ManagedClusterAccessProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mcap.AccessProfile != nil { + objectMap["properties"] = mcap.AccessProfile + } + if mcap.ID != nil { + objectMap["id"] = mcap.ID + } + if mcap.Name != nil { + objectMap["name"] = mcap.Name + } + if mcap.Type != nil { + objectMap["type"] = mcap.Type + } + if mcap.Location != nil { + objectMap["location"] = mcap.Location + } + if mcap.Tags != nil { + objectMap["tags"] = mcap.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ManagedClusterAccessProfile struct. +func (mcap *ManagedClusterAccessProfile) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var accessProfile AccessProfile + err = json.Unmarshal(*v, &accessProfile) + if err != nil { + return err + } + mcap.AccessProfile = &accessProfile + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + mcap.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + mcap.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + mcap.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + mcap.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + mcap.Tags = tags + } + } + } + + return nil +} + +// ManagedClusterAddonProfile a Kubernetes add-on profile for a managed cluster. +type ManagedClusterAddonProfile struct { + // Enabled - Whether the add-on is enabled or not. + Enabled *bool `json:"enabled,omitempty"` + // Config - Key-value pairs for configuring an add-on. + Config map[string]*string `json:"config"` +} + +// MarshalJSON is the custom marshaler for ManagedClusterAddonProfile. +func (mcap ManagedClusterAddonProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mcap.Enabled != nil { + objectMap["enabled"] = mcap.Enabled + } + if mcap.Config != nil { + objectMap["config"] = mcap.Config + } + return json.Marshal(objectMap) +} + +// ManagedClusterAgentPoolProfile profile for the container service agent pool. +type ManagedClusterAgentPoolProfile struct { + // Name - Unique name of the agent pool profile in the context of the subscription and resource group. + Name *string `json:"name,omitempty"` + // Count - Number of agents (VMs) to host docker containers. Allowed values must be in the range of 1 to 100 (inclusive). The default value is 1. + Count *int32 `json:"count,omitempty"` + // VMSize - Size of agent VMs. Possible values include: 'StandardA1', 'StandardA10', 'StandardA11', 'StandardA1V2', 'StandardA2', 'StandardA2V2', 'StandardA2mV2', 'StandardA3', 'StandardA4', 'StandardA4V2', 'StandardA4mV2', 'StandardA5', 'StandardA6', 'StandardA7', 'StandardA8', 'StandardA8V2', 'StandardA8mV2', 'StandardA9', 'StandardB2ms', 'StandardB2s', 'StandardB4ms', 'StandardB8ms', 'StandardD1', 'StandardD11', 'StandardD11V2', 'StandardD11V2Promo', 'StandardD12', 'StandardD12V2', 'StandardD12V2Promo', 'StandardD13', 'StandardD13V2', 'StandardD13V2Promo', 'StandardD14', 'StandardD14V2', 'StandardD14V2Promo', 'StandardD15V2', 'StandardD16V3', 'StandardD16sV3', 'StandardD1V2', 'StandardD2', 'StandardD2V2', 'StandardD2V2Promo', 'StandardD2V3', 'StandardD2sV3', 'StandardD3', 'StandardD32V3', 'StandardD32sV3', 'StandardD3V2', 'StandardD3V2Promo', 'StandardD4', 'StandardD4V2', 'StandardD4V2Promo', 'StandardD4V3', 'StandardD4sV3', 'StandardD5V2', 'StandardD5V2Promo', 'StandardD64V3', 'StandardD64sV3', 'StandardD8V3', 'StandardD8sV3', 'StandardDS1', 'StandardDS11', 'StandardDS11V2', 'StandardDS11V2Promo', 'StandardDS12', 'StandardDS12V2', 'StandardDS12V2Promo', 'StandardDS13', 'StandardDS132V2', 'StandardDS134V2', 'StandardDS13V2', 'StandardDS13V2Promo', 'StandardDS14', 'StandardDS144V2', 'StandardDS148V2', 'StandardDS14V2', 'StandardDS14V2Promo', 'StandardDS15V2', 'StandardDS1V2', 'StandardDS2', 'StandardDS2V2', 'StandardDS2V2Promo', 'StandardDS3', 'StandardDS3V2', 'StandardDS3V2Promo', 'StandardDS4', 'StandardDS4V2', 'StandardDS4V2Promo', 'StandardDS5V2', 'StandardDS5V2Promo', 'StandardE16V3', 'StandardE16sV3', 'StandardE2V3', 'StandardE2sV3', 'StandardE3216sV3', 'StandardE328sV3', 'StandardE32V3', 'StandardE32sV3', 'StandardE4V3', 'StandardE4sV3', 'StandardE6416sV3', 'StandardE6432sV3', 'StandardE64V3', 'StandardE64sV3', 'StandardE8V3', 'StandardE8sV3', 'StandardF1', 'StandardF16', 'StandardF16s', 'StandardF16sV2', 'StandardF1s', 'StandardF2', 'StandardF2s', 'StandardF2sV2', 'StandardF32sV2', 'StandardF4', 'StandardF4s', 'StandardF4sV2', 'StandardF64sV2', 'StandardF72sV2', 'StandardF8', 'StandardF8s', 'StandardF8sV2', 'StandardG1', 'StandardG2', 'StandardG3', 'StandardG4', 'StandardG5', 'StandardGS1', 'StandardGS2', 'StandardGS3', 'StandardGS4', 'StandardGS44', 'StandardGS48', 'StandardGS5', 'StandardGS516', 'StandardGS58', 'StandardH16', 'StandardH16m', 'StandardH16mr', 'StandardH16r', 'StandardH8', 'StandardH8m', 'StandardL16s', 'StandardL32s', 'StandardL4s', 'StandardL8s', 'StandardM12832ms', 'StandardM12864ms', 'StandardM128ms', 'StandardM128s', 'StandardM6416ms', 'StandardM6432ms', 'StandardM64ms', 'StandardM64s', 'StandardNC12', 'StandardNC12sV2', 'StandardNC12sV3', 'StandardNC24', 'StandardNC24r', 'StandardNC24rsV2', 'StandardNC24rsV3', 'StandardNC24sV2', 'StandardNC24sV3', 'StandardNC6', 'StandardNC6sV2', 'StandardNC6sV3', 'StandardND12s', 'StandardND24rs', 'StandardND24s', 'StandardND6s', 'StandardNV12', 'StandardNV24', 'StandardNV6' + VMSize VMSizeTypes `json:"vmSize,omitempty"` + // OsDiskSizeGB - OS Disk Size in GB to be used to specify the disk size for every machine in this master/agent pool. If you specify 0, it will apply the default osDisk size according to the vmSize specified. + OsDiskSizeGB *int32 `json:"osDiskSizeGB,omitempty"` + // DNSPrefix - DNS prefix to be used to create the FQDN for the agent pool. + DNSPrefix *string `json:"dnsPrefix,omitempty"` + // Fqdn - FDQN for the agent pool. + Fqdn *string `json:"fqdn,omitempty"` + // Ports - Ports number array used to expose on this agent pool. The default opened ports are different based on your choice of orchestrator. + Ports *[]int32 `json:"ports,omitempty"` + // StorageProfile - Storage profile specifies what kind of storage used. Choose from StorageAccount and ManagedDisks. Leave it empty, we will choose for you based on the orchestrator choice. Possible values include: 'StorageAccount', 'ManagedDisks' + StorageProfile StorageProfileTypes `json:"storageProfile,omitempty"` + // VnetSubnetID - VNet SubnetID specifies the vnet's subnet identifier. + VnetSubnetID *string `json:"vnetSubnetID,omitempty"` + // MaxPods - Maximum number of pods that can run on a node. + MaxPods *int32 `json:"maxPods,omitempty"` + // OsType - OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: 'Linux', 'Windows' + OsType OSType `json:"osType,omitempty"` +} + +// ManagedClusterListResult the response from the List Managed Clusters operation. +type ManagedClusterListResult struct { + autorest.Response `json:"-"` + // Value - The list of managed clusters. + Value *[]ManagedCluster `json:"value,omitempty"` + // NextLink - The URL to get the next set of managed cluster results. + NextLink *string `json:"nextLink,omitempty"` +} + +// ManagedClusterListResultIterator provides access to a complete listing of ManagedCluster values. +type ManagedClusterListResultIterator struct { + i int + page ManagedClusterListResultPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ManagedClusterListResultIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ManagedClusterListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ManagedClusterListResultIterator) Response() ManagedClusterListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ManagedClusterListResultIterator) Value() ManagedCluster { + if !iter.page.NotDone() { + return ManagedCluster{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (mclr ManagedClusterListResult) IsEmpty() bool { + return mclr.Value == nil || len(*mclr.Value) == 0 +} + +// managedClusterListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (mclr ManagedClusterListResult) managedClusterListResultPreparer() (*http.Request, error) { + if mclr.NextLink == nil || len(to.String(mclr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(mclr.NextLink))) +} + +// ManagedClusterListResultPage contains a page of ManagedCluster values. +type ManagedClusterListResultPage struct { + fn func(ManagedClusterListResult) (ManagedClusterListResult, error) + mclr ManagedClusterListResult +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ManagedClusterListResultPage) Next() error { + next, err := page.fn(page.mclr) + if err != nil { + return err + } + page.mclr = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ManagedClusterListResultPage) NotDone() bool { + return !page.mclr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ManagedClusterListResultPage) Response() ManagedClusterListResult { + return page.mclr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ManagedClusterListResultPage) Values() []ManagedCluster { + if page.mclr.IsEmpty() { + return nil + } + return *page.mclr.Value +} + +// ManagedClusterPoolUpgradeProfile the list of available upgrade versions. +type ManagedClusterPoolUpgradeProfile struct { + // KubernetesVersion - Kubernetes version (major, minor, patch). + KubernetesVersion *string `json:"kubernetesVersion,omitempty"` + // Name - Pool name. + Name *string `json:"name,omitempty"` + // OsType - OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: 'Linux', 'Windows' + OsType OSType `json:"osType,omitempty"` + // Upgrades - List of orchestrator types and versions available for upgrade. + Upgrades *[]string `json:"upgrades,omitempty"` +} + +// ManagedClusterProperties properties of the managed cluster. +type ManagedClusterProperties struct { + // ProvisioningState - The current deployment or provisioning state, which only appears in the response. + ProvisioningState *string `json:"provisioningState,omitempty"` + // KubernetesVersion - Version of Kubernetes specified when creating the managed cluster. + KubernetesVersion *string `json:"kubernetesVersion,omitempty"` + // DNSPrefix - DNS prefix specified when creating the managed cluster. + DNSPrefix *string `json:"dnsPrefix,omitempty"` + // Fqdn - FDQN for the master pool. + Fqdn *string `json:"fqdn,omitempty"` + // AgentPoolProfiles - Properties of the agent pool. + AgentPoolProfiles *[]ManagedClusterAgentPoolProfile `json:"agentPoolProfiles,omitempty"` + // LinuxProfile - Profile for Linux VMs in the container service cluster. + LinuxProfile *LinuxProfile `json:"linuxProfile,omitempty"` + // ServicePrincipalProfile - Information about a service principal identity for the cluster to use for manipulating Azure APIs. Either secret or keyVaultSecretRef must be specified. + ServicePrincipalProfile *ServicePrincipalProfile `json:"servicePrincipalProfile,omitempty"` + // AddonProfiles - Profile of managed cluster add-on. + AddonProfiles map[string]*ManagedClusterAddonProfile `json:"addonProfiles"` + // NodeResourceGroup - Name of the resource group containing agent pool nodes. + NodeResourceGroup *string `json:"nodeResourceGroup,omitempty"` + // EnableRBAC - Whether to enable Kubernetes Role-Based Access Control. + EnableRBAC *bool `json:"enableRBAC,omitempty"` + // NetworkProfile - Profile of network configuration. + NetworkProfile *NetworkProfile `json:"networkProfile,omitempty"` + // AadProfile - Profile of Azure Active Directory configuration. + AadProfile *ManagedClusterAADProfile `json:"aadProfile,omitempty"` +} + +// MarshalJSON is the custom marshaler for ManagedClusterProperties. +func (mcp ManagedClusterProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mcp.ProvisioningState != nil { + objectMap["provisioningState"] = mcp.ProvisioningState + } + if mcp.KubernetesVersion != nil { + objectMap["kubernetesVersion"] = mcp.KubernetesVersion + } + if mcp.DNSPrefix != nil { + objectMap["dnsPrefix"] = mcp.DNSPrefix + } + if mcp.Fqdn != nil { + objectMap["fqdn"] = mcp.Fqdn + } + if mcp.AgentPoolProfiles != nil { + objectMap["agentPoolProfiles"] = mcp.AgentPoolProfiles + } + if mcp.LinuxProfile != nil { + objectMap["linuxProfile"] = mcp.LinuxProfile + } + if mcp.ServicePrincipalProfile != nil { + objectMap["servicePrincipalProfile"] = mcp.ServicePrincipalProfile + } + if mcp.AddonProfiles != nil { + objectMap["addonProfiles"] = mcp.AddonProfiles + } + if mcp.NodeResourceGroup != nil { + objectMap["nodeResourceGroup"] = mcp.NodeResourceGroup + } + if mcp.EnableRBAC != nil { + objectMap["enableRBAC"] = mcp.EnableRBAC + } + if mcp.NetworkProfile != nil { + objectMap["networkProfile"] = mcp.NetworkProfile + } + if mcp.AadProfile != nil { + objectMap["aadProfile"] = mcp.AadProfile + } + return json.Marshal(objectMap) +} + +// ManagedClustersCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ManagedClustersCreateOrUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ManagedClustersCreateOrUpdateFuture) Result(client ManagedClustersClient) (mc ManagedCluster, err error) { + var done bool + done, err = future.Done(client) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("containerservice.ManagedClustersCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if mc.Response.Response, err = future.GetResult(sender); err == nil && mc.Response.Response.StatusCode != http.StatusNoContent { + mc, err = client.CreateOrUpdateResponder(mc.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersCreateOrUpdateFuture", "Result", mc.Response.Response, "Failure responding to request") + } + } + return +} + +// ManagedClustersDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ManagedClustersDeleteFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ManagedClustersDeleteFuture) Result(client ManagedClustersClient) (ar autorest.Response, err error) { + var done bool + done, err = future.Done(client) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("containerservice.ManagedClustersDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ManagedClusterUpgradeProfile the list of available upgrades for compute pools. +type ManagedClusterUpgradeProfile struct { + autorest.Response `json:"-"` + // ID - Id of upgrade profile. + ID *string `json:"id,omitempty"` + // Name - Name of upgrade profile. + Name *string `json:"name,omitempty"` + // Type - Type of upgrade profile. + Type *string `json:"type,omitempty"` + // ManagedClusterUpgradeProfileProperties - Properties of upgrade profile. + *ManagedClusterUpgradeProfileProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for ManagedClusterUpgradeProfile. +func (mcup ManagedClusterUpgradeProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mcup.ID != nil { + objectMap["id"] = mcup.ID + } + if mcup.Name != nil { + objectMap["name"] = mcup.Name + } + if mcup.Type != nil { + objectMap["type"] = mcup.Type + } + if mcup.ManagedClusterUpgradeProfileProperties != nil { + objectMap["properties"] = mcup.ManagedClusterUpgradeProfileProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ManagedClusterUpgradeProfile struct. +func (mcup *ManagedClusterUpgradeProfile) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + mcup.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + mcup.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + mcup.Type = &typeVar + } + case "properties": + if v != nil { + var managedClusterUpgradeProfileProperties ManagedClusterUpgradeProfileProperties + err = json.Unmarshal(*v, &managedClusterUpgradeProfileProperties) + if err != nil { + return err + } + mcup.ManagedClusterUpgradeProfileProperties = &managedClusterUpgradeProfileProperties + } + } + } + + return nil +} + +// ManagedClusterUpgradeProfileProperties control plane and agent pool upgrade profiles. +type ManagedClusterUpgradeProfileProperties struct { + // ControlPlaneProfile - The list of available upgrade versions for the control plane. + ControlPlaneProfile *ManagedClusterPoolUpgradeProfile `json:"controlPlaneProfile,omitempty"` + // AgentPoolProfiles - The list of available upgrade versions for agent pools. + AgentPoolProfiles *[]ManagedClusterPoolUpgradeProfile `json:"agentPoolProfiles,omitempty"` +} + +// MasterProfile profile for the container service master. +type MasterProfile struct { + // Count - Number of masters (VMs) in the container service cluster. Allowed values are 1, 3, and 5. The default value is 1. + Count *int32 `json:"count,omitempty"` + // DNSPrefix - DNS prefix to be used to create the FQDN for the master pool. + DNSPrefix *string `json:"dnsPrefix,omitempty"` + // VMSize - Size of agent VMs. Possible values include: 'StandardA1', 'StandardA10', 'StandardA11', 'StandardA1V2', 'StandardA2', 'StandardA2V2', 'StandardA2mV2', 'StandardA3', 'StandardA4', 'StandardA4V2', 'StandardA4mV2', 'StandardA5', 'StandardA6', 'StandardA7', 'StandardA8', 'StandardA8V2', 'StandardA8mV2', 'StandardA9', 'StandardB2ms', 'StandardB2s', 'StandardB4ms', 'StandardB8ms', 'StandardD1', 'StandardD11', 'StandardD11V2', 'StandardD11V2Promo', 'StandardD12', 'StandardD12V2', 'StandardD12V2Promo', 'StandardD13', 'StandardD13V2', 'StandardD13V2Promo', 'StandardD14', 'StandardD14V2', 'StandardD14V2Promo', 'StandardD15V2', 'StandardD16V3', 'StandardD16sV3', 'StandardD1V2', 'StandardD2', 'StandardD2V2', 'StandardD2V2Promo', 'StandardD2V3', 'StandardD2sV3', 'StandardD3', 'StandardD32V3', 'StandardD32sV3', 'StandardD3V2', 'StandardD3V2Promo', 'StandardD4', 'StandardD4V2', 'StandardD4V2Promo', 'StandardD4V3', 'StandardD4sV3', 'StandardD5V2', 'StandardD5V2Promo', 'StandardD64V3', 'StandardD64sV3', 'StandardD8V3', 'StandardD8sV3', 'StandardDS1', 'StandardDS11', 'StandardDS11V2', 'StandardDS11V2Promo', 'StandardDS12', 'StandardDS12V2', 'StandardDS12V2Promo', 'StandardDS13', 'StandardDS132V2', 'StandardDS134V2', 'StandardDS13V2', 'StandardDS13V2Promo', 'StandardDS14', 'StandardDS144V2', 'StandardDS148V2', 'StandardDS14V2', 'StandardDS14V2Promo', 'StandardDS15V2', 'StandardDS1V2', 'StandardDS2', 'StandardDS2V2', 'StandardDS2V2Promo', 'StandardDS3', 'StandardDS3V2', 'StandardDS3V2Promo', 'StandardDS4', 'StandardDS4V2', 'StandardDS4V2Promo', 'StandardDS5V2', 'StandardDS5V2Promo', 'StandardE16V3', 'StandardE16sV3', 'StandardE2V3', 'StandardE2sV3', 'StandardE3216sV3', 'StandardE328sV3', 'StandardE32V3', 'StandardE32sV3', 'StandardE4V3', 'StandardE4sV3', 'StandardE6416sV3', 'StandardE6432sV3', 'StandardE64V3', 'StandardE64sV3', 'StandardE8V3', 'StandardE8sV3', 'StandardF1', 'StandardF16', 'StandardF16s', 'StandardF16sV2', 'StandardF1s', 'StandardF2', 'StandardF2s', 'StandardF2sV2', 'StandardF32sV2', 'StandardF4', 'StandardF4s', 'StandardF4sV2', 'StandardF64sV2', 'StandardF72sV2', 'StandardF8', 'StandardF8s', 'StandardF8sV2', 'StandardG1', 'StandardG2', 'StandardG3', 'StandardG4', 'StandardG5', 'StandardGS1', 'StandardGS2', 'StandardGS3', 'StandardGS4', 'StandardGS44', 'StandardGS48', 'StandardGS5', 'StandardGS516', 'StandardGS58', 'StandardH16', 'StandardH16m', 'StandardH16mr', 'StandardH16r', 'StandardH8', 'StandardH8m', 'StandardL16s', 'StandardL32s', 'StandardL4s', 'StandardL8s', 'StandardM12832ms', 'StandardM12864ms', 'StandardM128ms', 'StandardM128s', 'StandardM6416ms', 'StandardM6432ms', 'StandardM64ms', 'StandardM64s', 'StandardNC12', 'StandardNC12sV2', 'StandardNC12sV3', 'StandardNC24', 'StandardNC24r', 'StandardNC24rsV2', 'StandardNC24rsV3', 'StandardNC24sV2', 'StandardNC24sV3', 'StandardNC6', 'StandardNC6sV2', 'StandardNC6sV3', 'StandardND12s', 'StandardND24rs', 'StandardND24s', 'StandardND6s', 'StandardNV12', 'StandardNV24', 'StandardNV6' + VMSize VMSizeTypes `json:"vmSize,omitempty"` + // OsDiskSizeGB - OS Disk Size in GB to be used to specify the disk size for every machine in this master/agent pool. If you specify 0, it will apply the default osDisk size according to the vmSize specified. + OsDiskSizeGB *int32 `json:"osDiskSizeGB,omitempty"` + // VnetSubnetID - VNet SubnetID specifies the vnet's subnet identifier. + VnetSubnetID *string `json:"vnetSubnetID,omitempty"` + // FirstConsecutiveStaticIP - FirstConsecutiveStaticIP used to specify the first static ip of masters. + FirstConsecutiveStaticIP *string `json:"firstConsecutiveStaticIP,omitempty"` + // StorageProfile - Storage profile specifies what kind of storage used. Choose from StorageAccount and ManagedDisks. Leave it empty, we will choose for you based on the orchestrator choice. Possible values include: 'StorageAccount', 'ManagedDisks' + StorageProfile StorageProfileTypes `json:"storageProfile,omitempty"` + // Fqdn - FDQN for the master pool. + Fqdn *string `json:"fqdn,omitempty"` +} + +// NetworkProfile profile of network configuration. +type NetworkProfile struct { + // NetworkPlugin - Network plugin used for building Kubernetes network. Possible values include: 'Azure', 'Kubenet' + NetworkPlugin NetworkPlugin `json:"networkPlugin,omitempty"` + // NetworkPolicy - Network policy used for building Kubernetes network. Possible values include: 'Calico' + NetworkPolicy NetworkPolicy `json:"networkPolicy,omitempty"` + // PodCidr - A CIDR notation IP range from which to assign pod IPs when kubenet is used. + PodCidr *string `json:"podCidr,omitempty"` + // ServiceCidr - A CIDR notation IP range from which to assign service cluster IPs. It must not overlap with any Subnet IP ranges. + ServiceCidr *string `json:"serviceCidr,omitempty"` + // DNSServiceIP - An IP address assigned to the Kubernetes DNS service. It must be within the Kubernetes service address range specified in serviceCidr. + DNSServiceIP *string `json:"dnsServiceIP,omitempty"` + // DockerBridgeCidr - A CIDR notation IP range assigned to the Docker bridge network. It must not overlap with any Subnet IP ranges or the Kubernetes service address range. + DockerBridgeCidr *string `json:"dockerBridgeCidr,omitempty"` +} + +// OperationListResult the List Compute Operation operation response. +type OperationListResult struct { + autorest.Response `json:"-"` + // Value - The list of compute operations + Value *[]OperationValue `json:"value,omitempty"` +} + +// OperationValue describes the properties of a Compute Operation value. +type OperationValue struct { + // Origin - The origin of the compute operation. + Origin *string `json:"origin,omitempty"` + // Name - The name of the compute operation. + Name *string `json:"name,omitempty"` + // OperationValueDisplay - Describes the properties of a Compute Operation Value Display. + *OperationValueDisplay `json:"display,omitempty"` +} + +// MarshalJSON is the custom marshaler for OperationValue. +func (ov OperationValue) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ov.Origin != nil { + objectMap["origin"] = ov.Origin + } + if ov.Name != nil { + objectMap["name"] = ov.Name + } + if ov.OperationValueDisplay != nil { + objectMap["display"] = ov.OperationValueDisplay + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for OperationValue struct. +func (ov *OperationValue) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "origin": + if v != nil { + var origin string + err = json.Unmarshal(*v, &origin) + if err != nil { + return err + } + ov.Origin = &origin + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ov.Name = &name + } + case "display": + if v != nil { + var operationValueDisplay OperationValueDisplay + err = json.Unmarshal(*v, &operationValueDisplay) + if err != nil { + return err + } + ov.OperationValueDisplay = &operationValueDisplay + } + } + } + + return nil +} + +// OperationValueDisplay describes the properties of a Compute Operation Value Display. +type OperationValueDisplay struct { + // Operation - The display name of the compute operation. + Operation *string `json:"operation,omitempty"` + // Resource - The display name of the resource the operation applies to. + Resource *string `json:"resource,omitempty"` + // Description - The description of the operation. + Description *string `json:"description,omitempty"` + // Provider - The resource provider for the operation. + Provider *string `json:"provider,omitempty"` +} + +// OrchestratorProfile contains information about orchestrator. +type OrchestratorProfile struct { + // OrchestratorType - Orchestrator type. + OrchestratorType *string `json:"orchestratorType,omitempty"` + // OrchestratorVersion - Orchestrator version (major, minor, patch). + OrchestratorVersion *string `json:"orchestratorVersion,omitempty"` +} + +// OrchestratorProfileType profile for the container service orchestrator. +type OrchestratorProfileType struct { + // OrchestratorType - The orchestrator to use to manage container service cluster resources. Valid values are Kubernetes, Swarm, DCOS, DockerCE and Custom. Possible values include: 'Kubernetes', 'Swarm', 'DCOS', 'DockerCE', 'Custom' + OrchestratorType OrchestratorTypes `json:"orchestratorType,omitempty"` + // OrchestratorVersion - The version of the orchestrator to use. You can specify the major.minor.patch part of the actual version.For example, you can specify version as "1.6.11". + OrchestratorVersion *string `json:"orchestratorVersion,omitempty"` +} + +// OrchestratorVersionProfile the profile of an orchestrator and its available versions. +type OrchestratorVersionProfile struct { + // OrchestratorType - Orchestrator type. + OrchestratorType *string `json:"orchestratorType,omitempty"` + // OrchestratorVersion - Orchestrator version (major, minor, patch). + OrchestratorVersion *string `json:"orchestratorVersion,omitempty"` + // Default - Installed by default if version is not specified. + Default *bool `json:"default,omitempty"` + // Upgrades - The list of available upgrade versions. + Upgrades *[]OrchestratorProfile `json:"upgrades,omitempty"` +} + +// OrchestratorVersionProfileListResult the list of versions for supported orchestrators. +type OrchestratorVersionProfileListResult struct { + autorest.Response `json:"-"` + // ID - Id of the orchestrator version profile list result. + ID *string `json:"id,omitempty"` + // Name - Name of the orchestrator version profile list result. + Name *string `json:"name,omitempty"` + // Type - Type of the orchestrator version profile list result. + Type *string `json:"type,omitempty"` + // OrchestratorVersionProfileProperties - The properties of an orchestrator version profile. + *OrchestratorVersionProfileProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for OrchestratorVersionProfileListResult. +func (ovplr OrchestratorVersionProfileListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ovplr.ID != nil { + objectMap["id"] = ovplr.ID + } + if ovplr.Name != nil { + objectMap["name"] = ovplr.Name + } + if ovplr.Type != nil { + objectMap["type"] = ovplr.Type + } + if ovplr.OrchestratorVersionProfileProperties != nil { + objectMap["properties"] = ovplr.OrchestratorVersionProfileProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for OrchestratorVersionProfileListResult struct. +func (ovplr *OrchestratorVersionProfileListResult) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ovplr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ovplr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ovplr.Type = &typeVar + } + case "properties": + if v != nil { + var orchestratorVersionProfileProperties OrchestratorVersionProfileProperties + err = json.Unmarshal(*v, &orchestratorVersionProfileProperties) + if err != nil { + return err + } + ovplr.OrchestratorVersionProfileProperties = &orchestratorVersionProfileProperties + } + } + } + + return nil +} + +// OrchestratorVersionProfileProperties the properties of an orchestrator version profile. +type OrchestratorVersionProfileProperties struct { + // Orchestrators - List of orchestrator version profiles. + Orchestrators *[]OrchestratorVersionProfile `json:"orchestrators,omitempty"` +} + +// Properties properties of the container service. +type Properties struct { + // ProvisioningState - The current deployment or provisioning state, which only appears in the response. + ProvisioningState *string `json:"provisioningState,omitempty"` + // OrchestratorProfile - Profile for the container service orchestrator. + OrchestratorProfile *OrchestratorProfileType `json:"orchestratorProfile,omitempty"` + // CustomProfile - Properties to configure a custom container service cluster. + CustomProfile *CustomProfile `json:"customProfile,omitempty"` + // ServicePrincipalProfile - Information about a service principal identity for the cluster to use for manipulating Azure APIs. Exact one of secret or keyVaultSecretRef need to be specified. + ServicePrincipalProfile *ServicePrincipalProfile `json:"servicePrincipalProfile,omitempty"` + // MasterProfile - Profile for the container service master. + MasterProfile *MasterProfile `json:"masterProfile,omitempty"` + // AgentPoolProfiles - Properties of the agent pool. + AgentPoolProfiles *[]AgentPoolProfile `json:"agentPoolProfiles,omitempty"` + // WindowsProfile - Profile for Windows VMs in the container service cluster. + WindowsProfile *WindowsProfile `json:"windowsProfile,omitempty"` + // LinuxProfile - Profile for Linux VMs in the container service cluster. + LinuxProfile *LinuxProfile `json:"linuxProfile,omitempty"` + // DiagnosticsProfile - Profile for diagnostics in the container service cluster. + DiagnosticsProfile *DiagnosticsProfile `json:"diagnosticsProfile,omitempty"` +} + +// Resource the Resource model definition. +type Resource struct { + // ID - Resource Id + ID *string `json:"id,omitempty"` + // Name - Resource name + Name *string `json:"name,omitempty"` + // Type - Resource type + Type *string `json:"type,omitempty"` + // Location - Resource location + Location *string `json:"location,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for Resource. +func (r Resource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if r.ID != nil { + objectMap["id"] = r.ID + } + if r.Name != nil { + objectMap["name"] = r.Name + } + if r.Type != nil { + objectMap["type"] = r.Type + } + if r.Location != nil { + objectMap["location"] = r.Location + } + if r.Tags != nil { + objectMap["tags"] = r.Tags + } + return json.Marshal(objectMap) +} + +// ServicePrincipalProfile information about a service principal identity for the cluster to use for manipulating +// Azure APIs. Either secret or keyVaultSecretRef must be specified. +type ServicePrincipalProfile struct { + // ClientID - The ID for the service principal. + ClientID *string `json:"clientId,omitempty"` + // Secret - The secret password associated with the service principal in plain text. + Secret *string `json:"secret,omitempty"` + // KeyVaultSecretRef - Reference to a secret stored in Azure Key Vault. + KeyVaultSecretRef *KeyVaultSecretRef `json:"keyVaultSecretRef,omitempty"` +} + +// SSHConfiguration SSH configuration for Linux-based VMs running on Azure. +type SSHConfiguration struct { + // PublicKeys - The list of SSH public keys used to authenticate with Linux-based VMs. Only expect one key specified. + PublicKeys *[]SSHPublicKey `json:"publicKeys,omitempty"` +} + +// SSHPublicKey contains information about SSH certificate public key data. +type SSHPublicKey struct { + // KeyData - Certificate public key used to authenticate with VMs through SSH. The certificate must be in PEM format with or without headers. + KeyData *string `json:"keyData,omitempty"` +} + +// VMDiagnostics profile for diagnostics on the container service VMs. +type VMDiagnostics struct { + // Enabled - Whether the VM diagnostic agent is provisioned on the VM. + Enabled *bool `json:"enabled,omitempty"` + // StorageURI - The URI of the storage account where diagnostics are stored. + StorageURI *string `json:"storageUri,omitempty"` +} + +// WindowsProfile profile for Windows VMs in the container service cluster. +type WindowsProfile struct { + // AdminUsername - The administrator username to use for Windows VMs. + AdminUsername *string `json:"adminUsername,omitempty"` + // AdminPassword - The administrator password to use for Windows VMs. + AdminPassword *string `json:"adminPassword,omitempty"` +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2018-03-31/containerservice/operations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2018-03-31/containerservice/operations.go new file mode 100644 index 000000000..cd5a61846 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2018-03-31/containerservice/operations.go @@ -0,0 +1,98 @@ +package containerservice + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "net/http" +) + +// OperationsClient is the the Container Service Client. +type OperationsClient struct { + BaseClient +} + +// NewOperationsClient creates an instance of the OperationsClient client. +func NewOperationsClient(subscriptionID string) OperationsClient { + return NewOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewOperationsClientWithBaseURI creates an instance of the OperationsClient client. +func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient { + return OperationsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// List gets a list of compute operations. +func (client OperationsClient) List(ctx context.Context) (result OperationListResult, err error) { + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.OperationsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerservice.OperationsClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.OperationsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + const APIVersion = "2018-03-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/providers/Microsoft.ContainerService/operations"), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client OperationsClient) ListSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client OperationsClient) ListResponder(resp *http.Response) (result OperationListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2018-03-31/containerservice/version.go b/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2018-03-31/containerservice/version.go new file mode 100644 index 000000000..c2c4f9aef --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2018-03-31/containerservice/version.go @@ -0,0 +1,30 @@ +package containerservice + +import "github.com/Azure/azure-sdk-for-go/version" + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// UserAgent returns the UserAgent string to use when sending http.Requests. +func UserAgent() string { + return "Azure-SDK-For-Go/" + version.Number + " containerservice/2018-03-31" +} + +// Version returns the semantic version (see http://semver.org) of the client. +func Version() string { + return version.Number +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2015-04-08/documentdb/databaseaccounts.go b/vendor/github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2015-04-08/documentdb/databaseaccounts.go index 99a223b4b..fa75356dc 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2015-04-08/documentdb/databaseaccounts.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2015-04-08/documentdb/databaseaccounts.go @@ -129,11 +129,11 @@ func (client DatabaseAccountsClient) CreateOrUpdate(ctx context.Context, resourc Constraints: []validation.Constraint{{Target: "createUpdateParameters.DatabaseAccountCreateUpdateProperties", Name: validation.Null, Rule: true, Chain: []validation.Constraint{{Target: "createUpdateParameters.DatabaseAccountCreateUpdateProperties.ConsistencyPolicy", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "createUpdateParameters.DatabaseAccountCreateUpdateProperties.ConsistencyPolicy.MaxStalenessPrefix", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "createUpdateParameters.DatabaseAccountCreateUpdateProperties.ConsistencyPolicy.MaxStalenessPrefix", Name: validation.InclusiveMaximum, Rule: 2147483647, Chain: nil}, + Chain: []validation.Constraint{{Target: "createUpdateParameters.DatabaseAccountCreateUpdateProperties.ConsistencyPolicy.MaxStalenessPrefix", Name: validation.InclusiveMaximum, Rule: int64(2147483647), Chain: nil}, {Target: "createUpdateParameters.DatabaseAccountCreateUpdateProperties.ConsistencyPolicy.MaxStalenessPrefix", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}, {Target: "createUpdateParameters.DatabaseAccountCreateUpdateProperties.ConsistencyPolicy.MaxIntervalInSeconds", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "createUpdateParameters.DatabaseAccountCreateUpdateProperties.ConsistencyPolicy.MaxIntervalInSeconds", Name: validation.InclusiveMaximum, Rule: 86400, Chain: nil}, + Chain: []validation.Constraint{{Target: "createUpdateParameters.DatabaseAccountCreateUpdateProperties.ConsistencyPolicy.MaxIntervalInSeconds", Name: validation.InclusiveMaximum, Rule: int64(86400), Chain: nil}, {Target: "createUpdateParameters.DatabaseAccountCreateUpdateProperties.ConsistencyPolicy.MaxIntervalInSeconds", Name: validation.InclusiveMinimum, Rule: 5, Chain: nil}, }}, }}, @@ -458,6 +458,84 @@ func (client DatabaseAccountsClient) GetResponder(resp *http.Response) (result D return } +// GetReadOnlyKeys lists the read-only access keys for the specified Azure Cosmos DB database account. +// Parameters: +// resourceGroupName - name of an Azure resource group. +// accountName - cosmos DB database account name. +func (client DatabaseAccountsClient) GetReadOnlyKeys(ctx context.Context, resourceGroupName string, accountName string) (result DatabaseAccountListReadOnlyKeysResult, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.DatabaseAccountsClient", "GetReadOnlyKeys", err.Error()) + } + + req, err := client.GetReadOnlyKeysPreparer(ctx, resourceGroupName, accountName) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "GetReadOnlyKeys", nil, "Failure preparing request") + return + } + + resp, err := client.GetReadOnlyKeysSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "GetReadOnlyKeys", resp, "Failure sending request") + return + } + + result, err = client.GetReadOnlyKeysResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "GetReadOnlyKeys", resp, "Failure responding to request") + } + + return +} + +// GetReadOnlyKeysPreparer prepares the GetReadOnlyKeys request. +func (client DatabaseAccountsClient) GetReadOnlyKeysPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-04-08" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/readonlykeys", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetReadOnlyKeysSender sends the GetReadOnlyKeys request. The method will close the +// http.Response Body if it receives an error. +func (client DatabaseAccountsClient) GetReadOnlyKeysSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetReadOnlyKeysResponder handles the response to the GetReadOnlyKeys request. The method always +// closes the http.Response Body. +func (client DatabaseAccountsClient) GetReadOnlyKeysResponder(resp *http.Response) (result DatabaseAccountListReadOnlyKeysResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + // List lists all the Azure Cosmos DB database accounts available under the subscription. func (client DatabaseAccountsClient) List(ctx context.Context) (result DatabaseAccountsListResult, err error) { req, err := client.ListPreparer(ctx) @@ -960,7 +1038,7 @@ func (client DatabaseAccountsClient) ListReadOnlyKeysPreparer(ctx context.Contex } preparer := autorest.CreatePreparer( - autorest.AsGet(), + autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/readonlykeys", pathParameters), autorest.WithQueryParameters(queryParameters)) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/customerinsights/mgmt/2017-01-01/customerinsights/hubs.go b/vendor/github.com/Azure/azure-sdk-for-go/services/customerinsights/mgmt/2017-01-01/customerinsights/hubs.go index f1e9c655d..5d50dbae6 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/customerinsights/mgmt/2017-01-01/customerinsights/hubs.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/customerinsights/mgmt/2017-01-01/customerinsights/hubs.go @@ -57,11 +57,11 @@ func (client HubsClient) CreateOrUpdate(ctx context.Context, resourceGroupName s Constraints: []validation.Constraint{{Target: "parameters.HubPropertiesFormat", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "parameters.HubPropertiesFormat.HubBillingInfo", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "parameters.HubPropertiesFormat.HubBillingInfo.MinUnits", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.HubPropertiesFormat.HubBillingInfo.MinUnits", Name: validation.InclusiveMaximum, Rule: 10, Chain: nil}, + Chain: []validation.Constraint{{Target: "parameters.HubPropertiesFormat.HubBillingInfo.MinUnits", Name: validation.InclusiveMaximum, Rule: int64(10), Chain: nil}, {Target: "parameters.HubPropertiesFormat.HubBillingInfo.MinUnits", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}, {Target: "parameters.HubPropertiesFormat.HubBillingInfo.MaxUnits", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.HubPropertiesFormat.HubBillingInfo.MaxUnits", Name: validation.InclusiveMaximum, Rule: 10, Chain: nil}, + Chain: []validation.Constraint{{Target: "parameters.HubPropertiesFormat.HubBillingInfo.MaxUnits", Name: validation.InclusiveMaximum, Rule: int64(10), Chain: nil}, {Target: "parameters.HubPropertiesFormat.HubBillingInfo.MaxUnits", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}, }}, diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/customerinsights/mgmt/2017-04-26/customerinsights/hubs.go b/vendor/github.com/Azure/azure-sdk-for-go/services/customerinsights/mgmt/2017-04-26/customerinsights/hubs.go index b7a57ac29..836f67fc4 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/customerinsights/mgmt/2017-04-26/customerinsights/hubs.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/customerinsights/mgmt/2017-04-26/customerinsights/hubs.go @@ -57,11 +57,11 @@ func (client HubsClient) CreateOrUpdate(ctx context.Context, resourceGroupName s Constraints: []validation.Constraint{{Target: "parameters.HubPropertiesFormat", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "parameters.HubPropertiesFormat.HubBillingInfo", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "parameters.HubPropertiesFormat.HubBillingInfo.MinUnits", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.HubPropertiesFormat.HubBillingInfo.MinUnits", Name: validation.InclusiveMaximum, Rule: 10, Chain: nil}, + Chain: []validation.Constraint{{Target: "parameters.HubPropertiesFormat.HubBillingInfo.MinUnits", Name: validation.InclusiveMaximum, Rule: int64(10), Chain: nil}, {Target: "parameters.HubPropertiesFormat.HubBillingInfo.MinUnits", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}, {Target: "parameters.HubPropertiesFormat.HubBillingInfo.MaxUnits", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.HubPropertiesFormat.HubBillingInfo.MaxUnits", Name: validation.InclusiveMaximum, Rule: 10, Chain: nil}, + Chain: []validation.Constraint{{Target: "parameters.HubPropertiesFormat.HubBillingInfo.MaxUnits", Name: validation.InclusiveMaximum, Rule: int64(10), Chain: nil}, {Target: "parameters.HubPropertiesFormat.HubBillingInfo.MaxUnits", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}, }}, diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory/activityruns.go b/vendor/github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory/activityruns.go new file mode 100644 index 000000000..75a0e7dc4 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory/activityruns.go @@ -0,0 +1,129 @@ +package datafactory + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// ActivityRunsClient is the the Azure Data Factory V2 management API provides a RESTful set of web services that +// interact with Azure Data Factory V2 services. +type ActivityRunsClient struct { + BaseClient +} + +// NewActivityRunsClient creates an instance of the ActivityRunsClient client. +func NewActivityRunsClient(subscriptionID string) ActivityRunsClient { + return NewActivityRunsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewActivityRunsClientWithBaseURI creates an instance of the ActivityRunsClient client. +func NewActivityRunsClientWithBaseURI(baseURI string, subscriptionID string) ActivityRunsClient { + return ActivityRunsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// QueryByPipelineRun query activity runs based on input filter conditions. +// Parameters: +// resourceGroupName - the resource group name. +// factoryName - the factory name. +// runID - the pipeline run identifier. +// filterParameters - parameters to filter the activity runs. +func (client ActivityRunsClient) QueryByPipelineRun(ctx context.Context, resourceGroupName string, factoryName string, runID string, filterParameters RunFilterParameters) (result ActivityRunsQueryResponse, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: factoryName, + Constraints: []validation.Constraint{{Target: "factoryName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "factoryName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "factoryName", Name: validation.Pattern, Rule: `^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$`, Chain: nil}}}, + {TargetValue: filterParameters, + Constraints: []validation.Constraint{{Target: "filterParameters.LastUpdatedAfter", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "filterParameters.LastUpdatedBefore", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("datafactory.ActivityRunsClient", "QueryByPipelineRun", err.Error()) + } + + req, err := client.QueryByPipelineRunPreparer(ctx, resourceGroupName, factoryName, runID, filterParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.ActivityRunsClient", "QueryByPipelineRun", nil, "Failure preparing request") + return + } + + resp, err := client.QueryByPipelineRunSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "datafactory.ActivityRunsClient", "QueryByPipelineRun", resp, "Failure sending request") + return + } + + result, err = client.QueryByPipelineRunResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.ActivityRunsClient", "QueryByPipelineRun", resp, "Failure responding to request") + } + + return +} + +// QueryByPipelineRunPreparer prepares the QueryByPipelineRun request. +func (client ActivityRunsClient) QueryByPipelineRunPreparer(ctx context.Context, resourceGroupName string, factoryName string, runID string, filterParameters RunFilterParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "factoryName": autorest.Encode("path", factoryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "runId": autorest.Encode("path", runID), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/pipelineruns/{runId}/queryActivityruns", pathParameters), + autorest.WithJSON(filterParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// QueryByPipelineRunSender sends the QueryByPipelineRun request. The method will close the +// http.Response Body if it receives an error. +func (client ActivityRunsClient) QueryByPipelineRunSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// QueryByPipelineRunResponder handles the response to the QueryByPipelineRun request. The method always +// closes the http.Response Body. +func (client ActivityRunsClient) QueryByPipelineRunResponder(resp *http.Response) (result ActivityRunsQueryResponse, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory/client.go b/vendor/github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory/client.go new file mode 100644 index 000000000..8fb1140cd --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory/client.go @@ -0,0 +1,52 @@ +// Package datafactory implements the Azure ARM Datafactory service API version 2018-06-01. +// +// The Azure Data Factory V2 management API provides a RESTful set of web services that interact with Azure Data +// Factory V2 services. +package datafactory + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/Azure/go-autorest/autorest" +) + +const ( + // DefaultBaseURI is the default URI used for the service Datafactory + DefaultBaseURI = "https://management.azure.com" +) + +// BaseClient is the base client for Datafactory. +type BaseClient struct { + autorest.Client + BaseURI string + SubscriptionID string +} + +// New creates an instance of the BaseClient client. +func New(subscriptionID string) BaseClient { + return NewWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewWithBaseURI creates an instance of the BaseClient client. +func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { + return BaseClient{ + Client: autorest.NewClientWithUserAgent(UserAgent()), + BaseURI: baseURI, + SubscriptionID: subscriptionID, + } +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory/datasets.go b/vendor/github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory/datasets.go new file mode 100644 index 000000000..24850f0a7 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory/datasets.go @@ -0,0 +1,425 @@ +package datafactory + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// DatasetsClient is the the Azure Data Factory V2 management API provides a RESTful set of web services that interact +// with Azure Data Factory V2 services. +type DatasetsClient struct { + BaseClient +} + +// NewDatasetsClient creates an instance of the DatasetsClient client. +func NewDatasetsClient(subscriptionID string) DatasetsClient { + return NewDatasetsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewDatasetsClientWithBaseURI creates an instance of the DatasetsClient client. +func NewDatasetsClientWithBaseURI(baseURI string, subscriptionID string) DatasetsClient { + return DatasetsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or updates a dataset. +// Parameters: +// resourceGroupName - the resource group name. +// factoryName - the factory name. +// datasetName - the dataset name. +// dataset - dataset resource definition. +// ifMatch - eTag of the dataset entity. Should only be specified for update, for which it should match +// existing entity or can be * for unconditional update. +func (client DatasetsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, factoryName string, datasetName string, dataset DatasetResource, ifMatch string) (result DatasetResource, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: factoryName, + Constraints: []validation.Constraint{{Target: "factoryName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "factoryName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "factoryName", Name: validation.Pattern, Rule: `^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$`, Chain: nil}}}, + {TargetValue: datasetName, + Constraints: []validation.Constraint{{Target: "datasetName", Name: validation.MaxLength, Rule: 260, Chain: nil}, + {Target: "datasetName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "datasetName", Name: validation.Pattern, Rule: `^[A-Za-z0-9_][^<>*#.%&:\\+?/]*$`, Chain: nil}}}, + {TargetValue: dataset, + Constraints: []validation.Constraint{{Target: "dataset.Properties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "dataset.Properties.LinkedServiceName", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "dataset.Properties.LinkedServiceName.Type", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "dataset.Properties.LinkedServiceName.ReferenceName", Name: validation.Null, Rule: true, Chain: nil}, + }}, + }}}}}); err != nil { + return result, validation.NewError("datafactory.DatasetsClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, factoryName, datasetName, dataset, ifMatch) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.DatasetsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "datafactory.DatasetsClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.DatasetsClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client DatasetsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, factoryName string, datasetName string, dataset DatasetResource, ifMatch string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "datasetName": autorest.Encode("path", datasetName), + "factoryName": autorest.Encode("path", factoryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/datasets/{datasetName}", pathParameters), + autorest.WithJSON(dataset), + autorest.WithQueryParameters(queryParameters)) + if len(ifMatch) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client DatasetsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client DatasetsClient) CreateOrUpdateResponder(resp *http.Response) (result DatasetResource, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes a dataset. +// Parameters: +// resourceGroupName - the resource group name. +// factoryName - the factory name. +// datasetName - the dataset name. +func (client DatasetsClient) Delete(ctx context.Context, resourceGroupName string, factoryName string, datasetName string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: factoryName, + Constraints: []validation.Constraint{{Target: "factoryName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "factoryName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "factoryName", Name: validation.Pattern, Rule: `^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$`, Chain: nil}}}, + {TargetValue: datasetName, + Constraints: []validation.Constraint{{Target: "datasetName", Name: validation.MaxLength, Rule: 260, Chain: nil}, + {Target: "datasetName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "datasetName", Name: validation.Pattern, Rule: `^[A-Za-z0-9_][^<>*#.%&:\\+?/]*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("datafactory.DatasetsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, factoryName, datasetName) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.DatasetsClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "datafactory.DatasetsClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.DatasetsClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client DatasetsClient) DeletePreparer(ctx context.Context, resourceGroupName string, factoryName string, datasetName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "datasetName": autorest.Encode("path", datasetName), + "factoryName": autorest.Encode("path", factoryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/datasets/{datasetName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client DatasetsClient) DeleteSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client DatasetsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets a dataset. +// Parameters: +// resourceGroupName - the resource group name. +// factoryName - the factory name. +// datasetName - the dataset name. +// ifNoneMatch - eTag of the dataset entity. Should only be specified for get. If the ETag matches the existing +// entity tag, or if * was provided, then no content will be returned. +func (client DatasetsClient) Get(ctx context.Context, resourceGroupName string, factoryName string, datasetName string, ifNoneMatch string) (result DatasetResource, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: factoryName, + Constraints: []validation.Constraint{{Target: "factoryName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "factoryName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "factoryName", Name: validation.Pattern, Rule: `^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$`, Chain: nil}}}, + {TargetValue: datasetName, + Constraints: []validation.Constraint{{Target: "datasetName", Name: validation.MaxLength, Rule: 260, Chain: nil}, + {Target: "datasetName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "datasetName", Name: validation.Pattern, Rule: `^[A-Za-z0-9_][^<>*#.%&:\\+?/]*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("datafactory.DatasetsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, factoryName, datasetName, ifNoneMatch) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.DatasetsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "datafactory.DatasetsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.DatasetsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client DatasetsClient) GetPreparer(ctx context.Context, resourceGroupName string, factoryName string, datasetName string, ifNoneMatch string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "datasetName": autorest.Encode("path", datasetName), + "factoryName": autorest.Encode("path", factoryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/datasets/{datasetName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if len(ifNoneMatch) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client DatasetsClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client DatasetsClient) GetResponder(resp *http.Response) (result DatasetResource, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotModified), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByFactory lists datasets. +// Parameters: +// resourceGroupName - the resource group name. +// factoryName - the factory name. +func (client DatasetsClient) ListByFactory(ctx context.Context, resourceGroupName string, factoryName string) (result DatasetListResponsePage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: factoryName, + Constraints: []validation.Constraint{{Target: "factoryName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "factoryName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "factoryName", Name: validation.Pattern, Rule: `^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("datafactory.DatasetsClient", "ListByFactory", err.Error()) + } + + result.fn = client.listByFactoryNextResults + req, err := client.ListByFactoryPreparer(ctx, resourceGroupName, factoryName) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.DatasetsClient", "ListByFactory", nil, "Failure preparing request") + return + } + + resp, err := client.ListByFactorySender(req) + if err != nil { + result.dlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "datafactory.DatasetsClient", "ListByFactory", resp, "Failure sending request") + return + } + + result.dlr, err = client.ListByFactoryResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.DatasetsClient", "ListByFactory", resp, "Failure responding to request") + } + + return +} + +// ListByFactoryPreparer prepares the ListByFactory request. +func (client DatasetsClient) ListByFactoryPreparer(ctx context.Context, resourceGroupName string, factoryName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "factoryName": autorest.Encode("path", factoryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/datasets", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByFactorySender sends the ListByFactory request. The method will close the +// http.Response Body if it receives an error. +func (client DatasetsClient) ListByFactorySender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByFactoryResponder handles the response to the ListByFactory request. The method always +// closes the http.Response Body. +func (client DatasetsClient) ListByFactoryResponder(resp *http.Response) (result DatasetListResponse, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByFactoryNextResults retrieves the next set of results, if any. +func (client DatasetsClient) listByFactoryNextResults(lastResults DatasetListResponse) (result DatasetListResponse, err error) { + req, err := lastResults.datasetListResponsePreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "datafactory.DatasetsClient", "listByFactoryNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByFactorySender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "datafactory.DatasetsClient", "listByFactoryNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByFactoryResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.DatasetsClient", "listByFactoryNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByFactoryComplete enumerates all values, automatically crossing page boundaries as required. +func (client DatasetsClient) ListByFactoryComplete(ctx context.Context, resourceGroupName string, factoryName string) (result DatasetListResponseIterator, err error) { + result.page, err = client.ListByFactory(ctx, resourceGroupName, factoryName) + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory/factories.go b/vendor/github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory/factories.go new file mode 100644 index 000000000..a2ab5e18a --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory/factories.go @@ -0,0 +1,656 @@ +package datafactory + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// FactoriesClient is the the Azure Data Factory V2 management API provides a RESTful set of web services that interact +// with Azure Data Factory V2 services. +type FactoriesClient struct { + BaseClient +} + +// NewFactoriesClient creates an instance of the FactoriesClient client. +func NewFactoriesClient(subscriptionID string) FactoriesClient { + return NewFactoriesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewFactoriesClientWithBaseURI creates an instance of the FactoriesClient client. +func NewFactoriesClientWithBaseURI(baseURI string, subscriptionID string) FactoriesClient { + return FactoriesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// ConfigureFactoryRepo updates a factory's repo information. +// Parameters: +// locationID - the location identifier. +// factoryRepoUpdate - update factory repo request definition. +func (client FactoriesClient) ConfigureFactoryRepo(ctx context.Context, locationID string, factoryRepoUpdate FactoryRepoUpdate) (result Factory, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: factoryRepoUpdate, + Constraints: []validation.Constraint{{Target: "factoryRepoUpdate.RepoConfiguration", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "factoryRepoUpdate.RepoConfiguration.AccountName", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "factoryRepoUpdate.RepoConfiguration.RepositoryName", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "factoryRepoUpdate.RepoConfiguration.CollaborationBranch", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "factoryRepoUpdate.RepoConfiguration.RootFolder", Name: validation.Null, Rule: true, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("datafactory.FactoriesClient", "ConfigureFactoryRepo", err.Error()) + } + + req, err := client.ConfigureFactoryRepoPreparer(ctx, locationID, factoryRepoUpdate) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.FactoriesClient", "ConfigureFactoryRepo", nil, "Failure preparing request") + return + } + + resp, err := client.ConfigureFactoryRepoSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "datafactory.FactoriesClient", "ConfigureFactoryRepo", resp, "Failure sending request") + return + } + + result, err = client.ConfigureFactoryRepoResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.FactoriesClient", "ConfigureFactoryRepo", resp, "Failure responding to request") + } + + return +} + +// ConfigureFactoryRepoPreparer prepares the ConfigureFactoryRepo request. +func (client FactoriesClient) ConfigureFactoryRepoPreparer(ctx context.Context, locationID string, factoryRepoUpdate FactoryRepoUpdate) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "locationId": autorest.Encode("path", locationID), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.DataFactory/locations/{locationId}/configureFactoryRepo", pathParameters), + autorest.WithJSON(factoryRepoUpdate), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ConfigureFactoryRepoSender sends the ConfigureFactoryRepo request. The method will close the +// http.Response Body if it receives an error. +func (client FactoriesClient) ConfigureFactoryRepoSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ConfigureFactoryRepoResponder handles the response to the ConfigureFactoryRepo request. The method always +// closes the http.Response Body. +func (client FactoriesClient) ConfigureFactoryRepoResponder(resp *http.Response) (result Factory, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CreateOrUpdate creates or updates a factory. +// Parameters: +// resourceGroupName - the resource group name. +// factoryName - the factory name. +// factory - factory resource definition. +// ifMatch - eTag of the factory entity. Should only be specified for update, for which it should match +// existing entity or can be * for unconditional update. +func (client FactoriesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, factoryName string, factory Factory, ifMatch string) (result Factory, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: factoryName, + Constraints: []validation.Constraint{{Target: "factoryName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "factoryName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "factoryName", Name: validation.Pattern, Rule: `^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$`, Chain: nil}}}, + {TargetValue: factory, + Constraints: []validation.Constraint{{Target: "factory.Identity", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "factory.Identity.Type", Name: validation.Null, Rule: true, Chain: nil}}}, + {Target: "factory.FactoryProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "factory.FactoryProperties.RepoConfiguration", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "factory.FactoryProperties.RepoConfiguration.AccountName", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "factory.FactoryProperties.RepoConfiguration.RepositoryName", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "factory.FactoryProperties.RepoConfiguration.CollaborationBranch", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "factory.FactoryProperties.RepoConfiguration.RootFolder", Name: validation.Null, Rule: true, Chain: nil}, + }}, + }}}}}); err != nil { + return result, validation.NewError("datafactory.FactoriesClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, factoryName, factory, ifMatch) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.FactoriesClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "datafactory.FactoriesClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.FactoriesClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client FactoriesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, factoryName string, factory Factory, ifMatch string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "factoryName": autorest.Encode("path", factoryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}", pathParameters), + autorest.WithJSON(factory), + autorest.WithQueryParameters(queryParameters)) + if len(ifMatch) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client FactoriesClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client FactoriesClient) CreateOrUpdateResponder(resp *http.Response) (result Factory, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes a factory. +// Parameters: +// resourceGroupName - the resource group name. +// factoryName - the factory name. +func (client FactoriesClient) Delete(ctx context.Context, resourceGroupName string, factoryName string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: factoryName, + Constraints: []validation.Constraint{{Target: "factoryName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "factoryName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "factoryName", Name: validation.Pattern, Rule: `^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("datafactory.FactoriesClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, factoryName) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.FactoriesClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "datafactory.FactoriesClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.FactoriesClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client FactoriesClient) DeletePreparer(ctx context.Context, resourceGroupName string, factoryName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "factoryName": autorest.Encode("path", factoryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client FactoriesClient) DeleteSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client FactoriesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets a factory. +// Parameters: +// resourceGroupName - the resource group name. +// factoryName - the factory name. +// ifNoneMatch - eTag of the factory entity. Should only be specified for get. If the ETag matches the existing +// entity tag, or if * was provided, then no content will be returned. +func (client FactoriesClient) Get(ctx context.Context, resourceGroupName string, factoryName string, ifNoneMatch string) (result Factory, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: factoryName, + Constraints: []validation.Constraint{{Target: "factoryName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "factoryName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "factoryName", Name: validation.Pattern, Rule: `^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("datafactory.FactoriesClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, factoryName, ifNoneMatch) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.FactoriesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "datafactory.FactoriesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.FactoriesClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client FactoriesClient) GetPreparer(ctx context.Context, resourceGroupName string, factoryName string, ifNoneMatch string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "factoryName": autorest.Encode("path", factoryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if len(ifNoneMatch) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client FactoriesClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client FactoriesClient) GetResponder(resp *http.Response) (result Factory, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotModified), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists factories under the specified subscription. +func (client FactoriesClient) List(ctx context.Context) (result FactoryListResponsePage, err error) { + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.FactoriesClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.flr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "datafactory.FactoriesClient", "List", resp, "Failure sending request") + return + } + + result.flr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.FactoriesClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client FactoriesClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.DataFactory/factories", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client FactoriesClient) ListSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client FactoriesClient) ListResponder(resp *http.Response) (result FactoryListResponse, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client FactoriesClient) listNextResults(lastResults FactoryListResponse) (result FactoryListResponse, err error) { + req, err := lastResults.factoryListResponsePreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "datafactory.FactoriesClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "datafactory.FactoriesClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.FactoriesClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client FactoriesClient) ListComplete(ctx context.Context) (result FactoryListResponseIterator, err error) { + result.page, err = client.List(ctx) + return +} + +// ListByResourceGroup lists factories. +// Parameters: +// resourceGroupName - the resource group name. +func (client FactoriesClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result FactoryListResponsePage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("datafactory.FactoriesClient", "ListByResourceGroup", err.Error()) + } + + result.fn = client.listByResourceGroupNextResults + req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.FactoriesClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.flr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "datafactory.FactoriesClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result.flr, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.FactoriesClient", "ListByResourceGroup", resp, "Failure responding to request") + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client FactoriesClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the +// http.Response Body if it receives an error. +func (client FactoriesClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always +// closes the http.Response Body. +func (client FactoriesClient) ListByResourceGroupResponder(resp *http.Response) (result FactoryListResponse, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByResourceGroupNextResults retrieves the next set of results, if any. +func (client FactoriesClient) listByResourceGroupNextResults(lastResults FactoryListResponse) (result FactoryListResponse, err error) { + req, err := lastResults.factoryListResponsePreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "datafactory.FactoriesClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "datafactory.FactoriesClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.FactoriesClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client FactoriesClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result FactoryListResponseIterator, err error) { + result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) + return +} + +// Update updates a factory. +// Parameters: +// resourceGroupName - the resource group name. +// factoryName - the factory name. +// factoryUpdateParameters - the parameters for updating a factory. +func (client FactoriesClient) Update(ctx context.Context, resourceGroupName string, factoryName string, factoryUpdateParameters FactoryUpdateParameters) (result Factory, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: factoryName, + Constraints: []validation.Constraint{{Target: "factoryName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "factoryName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "factoryName", Name: validation.Pattern, Rule: `^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("datafactory.FactoriesClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, factoryName, factoryUpdateParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.FactoriesClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "datafactory.FactoriesClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.FactoriesClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client FactoriesClient) UpdatePreparer(ctx context.Context, resourceGroupName string, factoryName string, factoryUpdateParameters FactoryUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "factoryName": autorest.Encode("path", factoryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}", pathParameters), + autorest.WithJSON(factoryUpdateParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client FactoriesClient) UpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client FactoriesClient) UpdateResponder(resp *http.Response) (result Factory, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory/integrationruntimenodes.go b/vendor/github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory/integrationruntimenodes.go new file mode 100644 index 000000000..b338f28b9 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory/integrationruntimenodes.go @@ -0,0 +1,317 @@ +package datafactory + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// IntegrationRuntimeNodesClient is the the Azure Data Factory V2 management API provides a RESTful set of web services +// that interact with Azure Data Factory V2 services. +type IntegrationRuntimeNodesClient struct { + BaseClient +} + +// NewIntegrationRuntimeNodesClient creates an instance of the IntegrationRuntimeNodesClient client. +func NewIntegrationRuntimeNodesClient(subscriptionID string) IntegrationRuntimeNodesClient { + return NewIntegrationRuntimeNodesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewIntegrationRuntimeNodesClientWithBaseURI creates an instance of the IntegrationRuntimeNodesClient client. +func NewIntegrationRuntimeNodesClientWithBaseURI(baseURI string, subscriptionID string) IntegrationRuntimeNodesClient { + return IntegrationRuntimeNodesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Delete deletes a self-hosted integration runtime node. +// Parameters: +// resourceGroupName - the resource group name. +// factoryName - the factory name. +// integrationRuntimeName - the integration runtime name. +// nodeName - the integration runtime node name. +func (client IntegrationRuntimeNodesClient) Delete(ctx context.Context, resourceGroupName string, factoryName string, integrationRuntimeName string, nodeName string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: factoryName, + Constraints: []validation.Constraint{{Target: "factoryName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "factoryName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "factoryName", Name: validation.Pattern, Rule: `^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$`, Chain: nil}}}, + {TargetValue: integrationRuntimeName, + Constraints: []validation.Constraint{{Target: "integrationRuntimeName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "integrationRuntimeName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "integrationRuntimeName", Name: validation.Pattern, Rule: `^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$`, Chain: nil}}}, + {TargetValue: nodeName, + Constraints: []validation.Constraint{{Target: "nodeName", Name: validation.MaxLength, Rule: 150, Chain: nil}, + {Target: "nodeName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "nodeName", Name: validation.Pattern, Rule: `^[a-z0-9A-Z][a-z0-9A-Z_-]{0,149}$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("datafactory.IntegrationRuntimeNodesClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, factoryName, integrationRuntimeName, nodeName) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.IntegrationRuntimeNodesClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "datafactory.IntegrationRuntimeNodesClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.IntegrationRuntimeNodesClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client IntegrationRuntimeNodesClient) DeletePreparer(ctx context.Context, resourceGroupName string, factoryName string, integrationRuntimeName string, nodeName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "factoryName": autorest.Encode("path", factoryName), + "integrationRuntimeName": autorest.Encode("path", integrationRuntimeName), + "nodeName": autorest.Encode("path", nodeName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/integrationRuntimes/{integrationRuntimeName}/nodes/{nodeName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client IntegrationRuntimeNodesClient) DeleteSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client IntegrationRuntimeNodesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// GetIPAddress get the IP address of self-hosted integration runtime node. +// Parameters: +// resourceGroupName - the resource group name. +// factoryName - the factory name. +// integrationRuntimeName - the integration runtime name. +// nodeName - the integration runtime node name. +func (client IntegrationRuntimeNodesClient) GetIPAddress(ctx context.Context, resourceGroupName string, factoryName string, integrationRuntimeName string, nodeName string) (result IntegrationRuntimeNodeIPAddress, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: factoryName, + Constraints: []validation.Constraint{{Target: "factoryName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "factoryName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "factoryName", Name: validation.Pattern, Rule: `^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$`, Chain: nil}}}, + {TargetValue: integrationRuntimeName, + Constraints: []validation.Constraint{{Target: "integrationRuntimeName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "integrationRuntimeName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "integrationRuntimeName", Name: validation.Pattern, Rule: `^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$`, Chain: nil}}}, + {TargetValue: nodeName, + Constraints: []validation.Constraint{{Target: "nodeName", Name: validation.MaxLength, Rule: 150, Chain: nil}, + {Target: "nodeName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "nodeName", Name: validation.Pattern, Rule: `^[a-z0-9A-Z][a-z0-9A-Z_-]{0,149}$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("datafactory.IntegrationRuntimeNodesClient", "GetIPAddress", err.Error()) + } + + req, err := client.GetIPAddressPreparer(ctx, resourceGroupName, factoryName, integrationRuntimeName, nodeName) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.IntegrationRuntimeNodesClient", "GetIPAddress", nil, "Failure preparing request") + return + } + + resp, err := client.GetIPAddressSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "datafactory.IntegrationRuntimeNodesClient", "GetIPAddress", resp, "Failure sending request") + return + } + + result, err = client.GetIPAddressResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.IntegrationRuntimeNodesClient", "GetIPAddress", resp, "Failure responding to request") + } + + return +} + +// GetIPAddressPreparer prepares the GetIPAddress request. +func (client IntegrationRuntimeNodesClient) GetIPAddressPreparer(ctx context.Context, resourceGroupName string, factoryName string, integrationRuntimeName string, nodeName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "factoryName": autorest.Encode("path", factoryName), + "integrationRuntimeName": autorest.Encode("path", integrationRuntimeName), + "nodeName": autorest.Encode("path", nodeName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/integrationRuntimes/{integrationRuntimeName}/nodes/{nodeName}/ipAddress", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetIPAddressSender sends the GetIPAddress request. The method will close the +// http.Response Body if it receives an error. +func (client IntegrationRuntimeNodesClient) GetIPAddressSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetIPAddressResponder handles the response to the GetIPAddress request. The method always +// closes the http.Response Body. +func (client IntegrationRuntimeNodesClient) GetIPAddressResponder(resp *http.Response) (result IntegrationRuntimeNodeIPAddress, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Update updates a self-hosted integration runtime node. +// Parameters: +// resourceGroupName - the resource group name. +// factoryName - the factory name. +// integrationRuntimeName - the integration runtime name. +// nodeName - the integration runtime node name. +// updateIntegrationRuntimeNodeRequest - the parameters for updating an integration runtime node. +func (client IntegrationRuntimeNodesClient) Update(ctx context.Context, resourceGroupName string, factoryName string, integrationRuntimeName string, nodeName string, updateIntegrationRuntimeNodeRequest UpdateIntegrationRuntimeNodeRequest) (result SelfHostedIntegrationRuntimeNode, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: factoryName, + Constraints: []validation.Constraint{{Target: "factoryName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "factoryName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "factoryName", Name: validation.Pattern, Rule: `^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$`, Chain: nil}}}, + {TargetValue: integrationRuntimeName, + Constraints: []validation.Constraint{{Target: "integrationRuntimeName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "integrationRuntimeName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "integrationRuntimeName", Name: validation.Pattern, Rule: `^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$`, Chain: nil}}}, + {TargetValue: nodeName, + Constraints: []validation.Constraint{{Target: "nodeName", Name: validation.MaxLength, Rule: 150, Chain: nil}, + {Target: "nodeName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "nodeName", Name: validation.Pattern, Rule: `^[a-z0-9A-Z][a-z0-9A-Z_-]{0,149}$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("datafactory.IntegrationRuntimeNodesClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, factoryName, integrationRuntimeName, nodeName, updateIntegrationRuntimeNodeRequest) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.IntegrationRuntimeNodesClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "datafactory.IntegrationRuntimeNodesClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.IntegrationRuntimeNodesClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client IntegrationRuntimeNodesClient) UpdatePreparer(ctx context.Context, resourceGroupName string, factoryName string, integrationRuntimeName string, nodeName string, updateIntegrationRuntimeNodeRequest UpdateIntegrationRuntimeNodeRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "factoryName": autorest.Encode("path", factoryName), + "integrationRuntimeName": autorest.Encode("path", integrationRuntimeName), + "nodeName": autorest.Encode("path", nodeName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/integrationRuntimes/{integrationRuntimeName}/nodes/{nodeName}", pathParameters), + autorest.WithJSON(updateIntegrationRuntimeNodeRequest), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client IntegrationRuntimeNodesClient) UpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client IntegrationRuntimeNodesClient) UpdateResponder(resp *http.Response) (result SelfHostedIntegrationRuntimeNode, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory/integrationruntimes.go b/vendor/github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory/integrationruntimes.go new file mode 100644 index 000000000..fa7a95fdc --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory/integrationruntimes.go @@ -0,0 +1,1286 @@ +package datafactory + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// IntegrationRuntimesClient is the the Azure Data Factory V2 management API provides a RESTful set of web services +// that interact with Azure Data Factory V2 services. +type IntegrationRuntimesClient struct { + BaseClient +} + +// NewIntegrationRuntimesClient creates an instance of the IntegrationRuntimesClient client. +func NewIntegrationRuntimesClient(subscriptionID string) IntegrationRuntimesClient { + return NewIntegrationRuntimesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewIntegrationRuntimesClientWithBaseURI creates an instance of the IntegrationRuntimesClient client. +func NewIntegrationRuntimesClientWithBaseURI(baseURI string, subscriptionID string) IntegrationRuntimesClient { + return IntegrationRuntimesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or updates an integration runtime. +// Parameters: +// resourceGroupName - the resource group name. +// factoryName - the factory name. +// integrationRuntimeName - the integration runtime name. +// integrationRuntime - integration runtime resource definition. +// ifMatch - eTag of the integration runtime entity. Should only be specified for update, for which it should +// match existing entity or can be * for unconditional update. +func (client IntegrationRuntimesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, factoryName string, integrationRuntimeName string, integrationRuntime IntegrationRuntimeResource, ifMatch string) (result IntegrationRuntimeResource, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: factoryName, + Constraints: []validation.Constraint{{Target: "factoryName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "factoryName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "factoryName", Name: validation.Pattern, Rule: `^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$`, Chain: nil}}}, + {TargetValue: integrationRuntimeName, + Constraints: []validation.Constraint{{Target: "integrationRuntimeName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "integrationRuntimeName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "integrationRuntimeName", Name: validation.Pattern, Rule: `^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$`, Chain: nil}}}, + {TargetValue: integrationRuntime, + Constraints: []validation.Constraint{{Target: "integrationRuntime.Properties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("datafactory.IntegrationRuntimesClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, factoryName, integrationRuntimeName, integrationRuntime, ifMatch) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.IntegrationRuntimesClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "datafactory.IntegrationRuntimesClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.IntegrationRuntimesClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client IntegrationRuntimesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, factoryName string, integrationRuntimeName string, integrationRuntime IntegrationRuntimeResource, ifMatch string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "factoryName": autorest.Encode("path", factoryName), + "integrationRuntimeName": autorest.Encode("path", integrationRuntimeName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/integrationRuntimes/{integrationRuntimeName}", pathParameters), + autorest.WithJSON(integrationRuntime), + autorest.WithQueryParameters(queryParameters)) + if len(ifMatch) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client IntegrationRuntimesClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client IntegrationRuntimesClient) CreateOrUpdateResponder(resp *http.Response) (result IntegrationRuntimeResource, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes an integration runtime. +// Parameters: +// resourceGroupName - the resource group name. +// factoryName - the factory name. +// integrationRuntimeName - the integration runtime name. +func (client IntegrationRuntimesClient) Delete(ctx context.Context, resourceGroupName string, factoryName string, integrationRuntimeName string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: factoryName, + Constraints: []validation.Constraint{{Target: "factoryName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "factoryName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "factoryName", Name: validation.Pattern, Rule: `^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$`, Chain: nil}}}, + {TargetValue: integrationRuntimeName, + Constraints: []validation.Constraint{{Target: "integrationRuntimeName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "integrationRuntimeName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "integrationRuntimeName", Name: validation.Pattern, Rule: `^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("datafactory.IntegrationRuntimesClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, factoryName, integrationRuntimeName) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.IntegrationRuntimesClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "datafactory.IntegrationRuntimesClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.IntegrationRuntimesClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client IntegrationRuntimesClient) DeletePreparer(ctx context.Context, resourceGroupName string, factoryName string, integrationRuntimeName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "factoryName": autorest.Encode("path", factoryName), + "integrationRuntimeName": autorest.Encode("path", integrationRuntimeName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/integrationRuntimes/{integrationRuntimeName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client IntegrationRuntimesClient) DeleteSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client IntegrationRuntimesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets an integration runtime. +// Parameters: +// resourceGroupName - the resource group name. +// factoryName - the factory name. +// integrationRuntimeName - the integration runtime name. +// ifNoneMatch - eTag of the integration runtime entity. Should only be specified for get. If the ETag matches +// the existing entity tag, or if * was provided, then no content will be returned. +func (client IntegrationRuntimesClient) Get(ctx context.Context, resourceGroupName string, factoryName string, integrationRuntimeName string, ifNoneMatch string) (result IntegrationRuntimeResource, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: factoryName, + Constraints: []validation.Constraint{{Target: "factoryName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "factoryName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "factoryName", Name: validation.Pattern, Rule: `^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$`, Chain: nil}}}, + {TargetValue: integrationRuntimeName, + Constraints: []validation.Constraint{{Target: "integrationRuntimeName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "integrationRuntimeName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "integrationRuntimeName", Name: validation.Pattern, Rule: `^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("datafactory.IntegrationRuntimesClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, factoryName, integrationRuntimeName, ifNoneMatch) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.IntegrationRuntimesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "datafactory.IntegrationRuntimesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.IntegrationRuntimesClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client IntegrationRuntimesClient) GetPreparer(ctx context.Context, resourceGroupName string, factoryName string, integrationRuntimeName string, ifNoneMatch string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "factoryName": autorest.Encode("path", factoryName), + "integrationRuntimeName": autorest.Encode("path", integrationRuntimeName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/integrationRuntimes/{integrationRuntimeName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if len(ifNoneMatch) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client IntegrationRuntimesClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client IntegrationRuntimesClient) GetResponder(resp *http.Response) (result IntegrationRuntimeResource, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotModified), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetConnectionInfo gets the on-premises integration runtime connection information for encrypting the on-premises +// data source credentials. +// Parameters: +// resourceGroupName - the resource group name. +// factoryName - the factory name. +// integrationRuntimeName - the integration runtime name. +func (client IntegrationRuntimesClient) GetConnectionInfo(ctx context.Context, resourceGroupName string, factoryName string, integrationRuntimeName string) (result IntegrationRuntimeConnectionInfo, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: factoryName, + Constraints: []validation.Constraint{{Target: "factoryName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "factoryName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "factoryName", Name: validation.Pattern, Rule: `^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$`, Chain: nil}}}, + {TargetValue: integrationRuntimeName, + Constraints: []validation.Constraint{{Target: "integrationRuntimeName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "integrationRuntimeName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "integrationRuntimeName", Name: validation.Pattern, Rule: `^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("datafactory.IntegrationRuntimesClient", "GetConnectionInfo", err.Error()) + } + + req, err := client.GetConnectionInfoPreparer(ctx, resourceGroupName, factoryName, integrationRuntimeName) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.IntegrationRuntimesClient", "GetConnectionInfo", nil, "Failure preparing request") + return + } + + resp, err := client.GetConnectionInfoSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "datafactory.IntegrationRuntimesClient", "GetConnectionInfo", resp, "Failure sending request") + return + } + + result, err = client.GetConnectionInfoResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.IntegrationRuntimesClient", "GetConnectionInfo", resp, "Failure responding to request") + } + + return +} + +// GetConnectionInfoPreparer prepares the GetConnectionInfo request. +func (client IntegrationRuntimesClient) GetConnectionInfoPreparer(ctx context.Context, resourceGroupName string, factoryName string, integrationRuntimeName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "factoryName": autorest.Encode("path", factoryName), + "integrationRuntimeName": autorest.Encode("path", integrationRuntimeName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/integrationRuntimes/{integrationRuntimeName}/getConnectionInfo", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetConnectionInfoSender sends the GetConnectionInfo request. The method will close the +// http.Response Body if it receives an error. +func (client IntegrationRuntimesClient) GetConnectionInfoSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetConnectionInfoResponder handles the response to the GetConnectionInfo request. The method always +// closes the http.Response Body. +func (client IntegrationRuntimesClient) GetConnectionInfoResponder(resp *http.Response) (result IntegrationRuntimeConnectionInfo, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetMonitoringData get the integration runtime monitoring data, which includes the monitor data for all the nodes +// under this integration runtime. +// Parameters: +// resourceGroupName - the resource group name. +// factoryName - the factory name. +// integrationRuntimeName - the integration runtime name. +func (client IntegrationRuntimesClient) GetMonitoringData(ctx context.Context, resourceGroupName string, factoryName string, integrationRuntimeName string) (result IntegrationRuntimeMonitoringData, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: factoryName, + Constraints: []validation.Constraint{{Target: "factoryName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "factoryName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "factoryName", Name: validation.Pattern, Rule: `^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$`, Chain: nil}}}, + {TargetValue: integrationRuntimeName, + Constraints: []validation.Constraint{{Target: "integrationRuntimeName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "integrationRuntimeName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "integrationRuntimeName", Name: validation.Pattern, Rule: `^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("datafactory.IntegrationRuntimesClient", "GetMonitoringData", err.Error()) + } + + req, err := client.GetMonitoringDataPreparer(ctx, resourceGroupName, factoryName, integrationRuntimeName) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.IntegrationRuntimesClient", "GetMonitoringData", nil, "Failure preparing request") + return + } + + resp, err := client.GetMonitoringDataSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "datafactory.IntegrationRuntimesClient", "GetMonitoringData", resp, "Failure sending request") + return + } + + result, err = client.GetMonitoringDataResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.IntegrationRuntimesClient", "GetMonitoringData", resp, "Failure responding to request") + } + + return +} + +// GetMonitoringDataPreparer prepares the GetMonitoringData request. +func (client IntegrationRuntimesClient) GetMonitoringDataPreparer(ctx context.Context, resourceGroupName string, factoryName string, integrationRuntimeName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "factoryName": autorest.Encode("path", factoryName), + "integrationRuntimeName": autorest.Encode("path", integrationRuntimeName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/integrationRuntimes/{integrationRuntimeName}/monitoringData", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetMonitoringDataSender sends the GetMonitoringData request. The method will close the +// http.Response Body if it receives an error. +func (client IntegrationRuntimesClient) GetMonitoringDataSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetMonitoringDataResponder handles the response to the GetMonitoringData request. The method always +// closes the http.Response Body. +func (client IntegrationRuntimesClient) GetMonitoringDataResponder(resp *http.Response) (result IntegrationRuntimeMonitoringData, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetStatus gets detailed status information for an integration runtime. +// Parameters: +// resourceGroupName - the resource group name. +// factoryName - the factory name. +// integrationRuntimeName - the integration runtime name. +func (client IntegrationRuntimesClient) GetStatus(ctx context.Context, resourceGroupName string, factoryName string, integrationRuntimeName string) (result IntegrationRuntimeStatusResponse, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: factoryName, + Constraints: []validation.Constraint{{Target: "factoryName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "factoryName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "factoryName", Name: validation.Pattern, Rule: `^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$`, Chain: nil}}}, + {TargetValue: integrationRuntimeName, + Constraints: []validation.Constraint{{Target: "integrationRuntimeName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "integrationRuntimeName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "integrationRuntimeName", Name: validation.Pattern, Rule: `^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("datafactory.IntegrationRuntimesClient", "GetStatus", err.Error()) + } + + req, err := client.GetStatusPreparer(ctx, resourceGroupName, factoryName, integrationRuntimeName) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.IntegrationRuntimesClient", "GetStatus", nil, "Failure preparing request") + return + } + + resp, err := client.GetStatusSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "datafactory.IntegrationRuntimesClient", "GetStatus", resp, "Failure sending request") + return + } + + result, err = client.GetStatusResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.IntegrationRuntimesClient", "GetStatus", resp, "Failure responding to request") + } + + return +} + +// GetStatusPreparer prepares the GetStatus request. +func (client IntegrationRuntimesClient) GetStatusPreparer(ctx context.Context, resourceGroupName string, factoryName string, integrationRuntimeName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "factoryName": autorest.Encode("path", factoryName), + "integrationRuntimeName": autorest.Encode("path", integrationRuntimeName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/integrationRuntimes/{integrationRuntimeName}/getStatus", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetStatusSender sends the GetStatus request. The method will close the +// http.Response Body if it receives an error. +func (client IntegrationRuntimesClient) GetStatusSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetStatusResponder handles the response to the GetStatus request. The method always +// closes the http.Response Body. +func (client IntegrationRuntimesClient) GetStatusResponder(resp *http.Response) (result IntegrationRuntimeStatusResponse, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListAuthKeys retrieves the authentication keys for an integration runtime. +// Parameters: +// resourceGroupName - the resource group name. +// factoryName - the factory name. +// integrationRuntimeName - the integration runtime name. +func (client IntegrationRuntimesClient) ListAuthKeys(ctx context.Context, resourceGroupName string, factoryName string, integrationRuntimeName string) (result IntegrationRuntimeAuthKeys, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: factoryName, + Constraints: []validation.Constraint{{Target: "factoryName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "factoryName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "factoryName", Name: validation.Pattern, Rule: `^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$`, Chain: nil}}}, + {TargetValue: integrationRuntimeName, + Constraints: []validation.Constraint{{Target: "integrationRuntimeName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "integrationRuntimeName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "integrationRuntimeName", Name: validation.Pattern, Rule: `^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("datafactory.IntegrationRuntimesClient", "ListAuthKeys", err.Error()) + } + + req, err := client.ListAuthKeysPreparer(ctx, resourceGroupName, factoryName, integrationRuntimeName) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.IntegrationRuntimesClient", "ListAuthKeys", nil, "Failure preparing request") + return + } + + resp, err := client.ListAuthKeysSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "datafactory.IntegrationRuntimesClient", "ListAuthKeys", resp, "Failure sending request") + return + } + + result, err = client.ListAuthKeysResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.IntegrationRuntimesClient", "ListAuthKeys", resp, "Failure responding to request") + } + + return +} + +// ListAuthKeysPreparer prepares the ListAuthKeys request. +func (client IntegrationRuntimesClient) ListAuthKeysPreparer(ctx context.Context, resourceGroupName string, factoryName string, integrationRuntimeName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "factoryName": autorest.Encode("path", factoryName), + "integrationRuntimeName": autorest.Encode("path", integrationRuntimeName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/integrationRuntimes/{integrationRuntimeName}/listAuthKeys", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListAuthKeysSender sends the ListAuthKeys request. The method will close the +// http.Response Body if it receives an error. +func (client IntegrationRuntimesClient) ListAuthKeysSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListAuthKeysResponder handles the response to the ListAuthKeys request. The method always +// closes the http.Response Body. +func (client IntegrationRuntimesClient) ListAuthKeysResponder(resp *http.Response) (result IntegrationRuntimeAuthKeys, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByFactory lists integration runtimes. +// Parameters: +// resourceGroupName - the resource group name. +// factoryName - the factory name. +func (client IntegrationRuntimesClient) ListByFactory(ctx context.Context, resourceGroupName string, factoryName string) (result IntegrationRuntimeListResponsePage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: factoryName, + Constraints: []validation.Constraint{{Target: "factoryName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "factoryName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "factoryName", Name: validation.Pattern, Rule: `^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("datafactory.IntegrationRuntimesClient", "ListByFactory", err.Error()) + } + + result.fn = client.listByFactoryNextResults + req, err := client.ListByFactoryPreparer(ctx, resourceGroupName, factoryName) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.IntegrationRuntimesClient", "ListByFactory", nil, "Failure preparing request") + return + } + + resp, err := client.ListByFactorySender(req) + if err != nil { + result.irlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "datafactory.IntegrationRuntimesClient", "ListByFactory", resp, "Failure sending request") + return + } + + result.irlr, err = client.ListByFactoryResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.IntegrationRuntimesClient", "ListByFactory", resp, "Failure responding to request") + } + + return +} + +// ListByFactoryPreparer prepares the ListByFactory request. +func (client IntegrationRuntimesClient) ListByFactoryPreparer(ctx context.Context, resourceGroupName string, factoryName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "factoryName": autorest.Encode("path", factoryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/integrationRuntimes", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByFactorySender sends the ListByFactory request. The method will close the +// http.Response Body if it receives an error. +func (client IntegrationRuntimesClient) ListByFactorySender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByFactoryResponder handles the response to the ListByFactory request. The method always +// closes the http.Response Body. +func (client IntegrationRuntimesClient) ListByFactoryResponder(resp *http.Response) (result IntegrationRuntimeListResponse, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByFactoryNextResults retrieves the next set of results, if any. +func (client IntegrationRuntimesClient) listByFactoryNextResults(lastResults IntegrationRuntimeListResponse) (result IntegrationRuntimeListResponse, err error) { + req, err := lastResults.integrationRuntimeListResponsePreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "datafactory.IntegrationRuntimesClient", "listByFactoryNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByFactorySender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "datafactory.IntegrationRuntimesClient", "listByFactoryNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByFactoryResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.IntegrationRuntimesClient", "listByFactoryNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByFactoryComplete enumerates all values, automatically crossing page boundaries as required. +func (client IntegrationRuntimesClient) ListByFactoryComplete(ctx context.Context, resourceGroupName string, factoryName string) (result IntegrationRuntimeListResponseIterator, err error) { + result.page, err = client.ListByFactory(ctx, resourceGroupName, factoryName) + return +} + +// RegenerateAuthKey regenerates the authentication key for an integration runtime. +// Parameters: +// resourceGroupName - the resource group name. +// factoryName - the factory name. +// integrationRuntimeName - the integration runtime name. +// regenerateKeyParameters - the parameters for regenerating integration runtime authentication key. +func (client IntegrationRuntimesClient) RegenerateAuthKey(ctx context.Context, resourceGroupName string, factoryName string, integrationRuntimeName string, regenerateKeyParameters IntegrationRuntimeRegenerateKeyParameters) (result IntegrationRuntimeAuthKeys, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: factoryName, + Constraints: []validation.Constraint{{Target: "factoryName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "factoryName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "factoryName", Name: validation.Pattern, Rule: `^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$`, Chain: nil}}}, + {TargetValue: integrationRuntimeName, + Constraints: []validation.Constraint{{Target: "integrationRuntimeName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "integrationRuntimeName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "integrationRuntimeName", Name: validation.Pattern, Rule: `^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("datafactory.IntegrationRuntimesClient", "RegenerateAuthKey", err.Error()) + } + + req, err := client.RegenerateAuthKeyPreparer(ctx, resourceGroupName, factoryName, integrationRuntimeName, regenerateKeyParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.IntegrationRuntimesClient", "RegenerateAuthKey", nil, "Failure preparing request") + return + } + + resp, err := client.RegenerateAuthKeySender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "datafactory.IntegrationRuntimesClient", "RegenerateAuthKey", resp, "Failure sending request") + return + } + + result, err = client.RegenerateAuthKeyResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.IntegrationRuntimesClient", "RegenerateAuthKey", resp, "Failure responding to request") + } + + return +} + +// RegenerateAuthKeyPreparer prepares the RegenerateAuthKey request. +func (client IntegrationRuntimesClient) RegenerateAuthKeyPreparer(ctx context.Context, resourceGroupName string, factoryName string, integrationRuntimeName string, regenerateKeyParameters IntegrationRuntimeRegenerateKeyParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "factoryName": autorest.Encode("path", factoryName), + "integrationRuntimeName": autorest.Encode("path", integrationRuntimeName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/integrationRuntimes/{integrationRuntimeName}/regenerateAuthKey", pathParameters), + autorest.WithJSON(regenerateKeyParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RegenerateAuthKeySender sends the RegenerateAuthKey request. The method will close the +// http.Response Body if it receives an error. +func (client IntegrationRuntimesClient) RegenerateAuthKeySender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// RegenerateAuthKeyResponder handles the response to the RegenerateAuthKey request. The method always +// closes the http.Response Body. +func (client IntegrationRuntimesClient) RegenerateAuthKeyResponder(resp *http.Response) (result IntegrationRuntimeAuthKeys, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Start starts a ManagedReserved type integration runtime. +// Parameters: +// resourceGroupName - the resource group name. +// factoryName - the factory name. +// integrationRuntimeName - the integration runtime name. +func (client IntegrationRuntimesClient) Start(ctx context.Context, resourceGroupName string, factoryName string, integrationRuntimeName string) (result IntegrationRuntimesStartFuture, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: factoryName, + Constraints: []validation.Constraint{{Target: "factoryName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "factoryName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "factoryName", Name: validation.Pattern, Rule: `^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$`, Chain: nil}}}, + {TargetValue: integrationRuntimeName, + Constraints: []validation.Constraint{{Target: "integrationRuntimeName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "integrationRuntimeName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "integrationRuntimeName", Name: validation.Pattern, Rule: `^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("datafactory.IntegrationRuntimesClient", "Start", err.Error()) + } + + req, err := client.StartPreparer(ctx, resourceGroupName, factoryName, integrationRuntimeName) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.IntegrationRuntimesClient", "Start", nil, "Failure preparing request") + return + } + + result, err = client.StartSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.IntegrationRuntimesClient", "Start", result.Response(), "Failure sending request") + return + } + + return +} + +// StartPreparer prepares the Start request. +func (client IntegrationRuntimesClient) StartPreparer(ctx context.Context, resourceGroupName string, factoryName string, integrationRuntimeName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "factoryName": autorest.Encode("path", factoryName), + "integrationRuntimeName": autorest.Encode("path", integrationRuntimeName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/integrationRuntimes/{integrationRuntimeName}/start", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// StartSender sends the Start request. The method will close the +// http.Response Body if it receives an error. +func (client IntegrationRuntimesClient) StartSender(req *http.Request) (future IntegrationRuntimesStartFuture, err error) { + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// StartResponder handles the response to the Start request. The method always +// closes the http.Response Body. +func (client IntegrationRuntimesClient) StartResponder(resp *http.Response) (result IntegrationRuntimeStatusResponse, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Stop stops a ManagedReserved type integration runtime. +// Parameters: +// resourceGroupName - the resource group name. +// factoryName - the factory name. +// integrationRuntimeName - the integration runtime name. +func (client IntegrationRuntimesClient) Stop(ctx context.Context, resourceGroupName string, factoryName string, integrationRuntimeName string) (result IntegrationRuntimesStopFuture, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: factoryName, + Constraints: []validation.Constraint{{Target: "factoryName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "factoryName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "factoryName", Name: validation.Pattern, Rule: `^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$`, Chain: nil}}}, + {TargetValue: integrationRuntimeName, + Constraints: []validation.Constraint{{Target: "integrationRuntimeName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "integrationRuntimeName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "integrationRuntimeName", Name: validation.Pattern, Rule: `^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("datafactory.IntegrationRuntimesClient", "Stop", err.Error()) + } + + req, err := client.StopPreparer(ctx, resourceGroupName, factoryName, integrationRuntimeName) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.IntegrationRuntimesClient", "Stop", nil, "Failure preparing request") + return + } + + result, err = client.StopSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.IntegrationRuntimesClient", "Stop", result.Response(), "Failure sending request") + return + } + + return +} + +// StopPreparer prepares the Stop request. +func (client IntegrationRuntimesClient) StopPreparer(ctx context.Context, resourceGroupName string, factoryName string, integrationRuntimeName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "factoryName": autorest.Encode("path", factoryName), + "integrationRuntimeName": autorest.Encode("path", integrationRuntimeName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/integrationRuntimes/{integrationRuntimeName}/stop", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// StopSender sends the Stop request. The method will close the +// http.Response Body if it receives an error. +func (client IntegrationRuntimesClient) StopSender(req *http.Request) (future IntegrationRuntimesStopFuture, err error) { + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// StopResponder handles the response to the Stop request. The method always +// closes the http.Response Body. +func (client IntegrationRuntimesClient) StopResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// SyncCredentials force the integration runtime to synchronize credentials across integration runtime nodes, and this +// will override the credentials across all worker nodes with those available on the dispatcher node. If you already +// have the latest credential backup file, you should manually import it (preferred) on any self-hosted integration +// runtime node than using this API directly. +// Parameters: +// resourceGroupName - the resource group name. +// factoryName - the factory name. +// integrationRuntimeName - the integration runtime name. +func (client IntegrationRuntimesClient) SyncCredentials(ctx context.Context, resourceGroupName string, factoryName string, integrationRuntimeName string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: factoryName, + Constraints: []validation.Constraint{{Target: "factoryName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "factoryName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "factoryName", Name: validation.Pattern, Rule: `^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$`, Chain: nil}}}, + {TargetValue: integrationRuntimeName, + Constraints: []validation.Constraint{{Target: "integrationRuntimeName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "integrationRuntimeName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "integrationRuntimeName", Name: validation.Pattern, Rule: `^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("datafactory.IntegrationRuntimesClient", "SyncCredentials", err.Error()) + } + + req, err := client.SyncCredentialsPreparer(ctx, resourceGroupName, factoryName, integrationRuntimeName) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.IntegrationRuntimesClient", "SyncCredentials", nil, "Failure preparing request") + return + } + + resp, err := client.SyncCredentialsSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "datafactory.IntegrationRuntimesClient", "SyncCredentials", resp, "Failure sending request") + return + } + + result, err = client.SyncCredentialsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.IntegrationRuntimesClient", "SyncCredentials", resp, "Failure responding to request") + } + + return +} + +// SyncCredentialsPreparer prepares the SyncCredentials request. +func (client IntegrationRuntimesClient) SyncCredentialsPreparer(ctx context.Context, resourceGroupName string, factoryName string, integrationRuntimeName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "factoryName": autorest.Encode("path", factoryName), + "integrationRuntimeName": autorest.Encode("path", integrationRuntimeName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/integrationRuntimes/{integrationRuntimeName}/syncCredentials", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// SyncCredentialsSender sends the SyncCredentials request. The method will close the +// http.Response Body if it receives an error. +func (client IntegrationRuntimesClient) SyncCredentialsSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// SyncCredentialsResponder handles the response to the SyncCredentials request. The method always +// closes the http.Response Body. +func (client IntegrationRuntimesClient) SyncCredentialsResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Update updates an integration runtime. +// Parameters: +// resourceGroupName - the resource group name. +// factoryName - the factory name. +// integrationRuntimeName - the integration runtime name. +// updateIntegrationRuntimeRequest - the parameters for updating an integration runtime. +func (client IntegrationRuntimesClient) Update(ctx context.Context, resourceGroupName string, factoryName string, integrationRuntimeName string, updateIntegrationRuntimeRequest UpdateIntegrationRuntimeRequest) (result IntegrationRuntimeResource, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: factoryName, + Constraints: []validation.Constraint{{Target: "factoryName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "factoryName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "factoryName", Name: validation.Pattern, Rule: `^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$`, Chain: nil}}}, + {TargetValue: integrationRuntimeName, + Constraints: []validation.Constraint{{Target: "integrationRuntimeName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "integrationRuntimeName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "integrationRuntimeName", Name: validation.Pattern, Rule: `^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("datafactory.IntegrationRuntimesClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, factoryName, integrationRuntimeName, updateIntegrationRuntimeRequest) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.IntegrationRuntimesClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "datafactory.IntegrationRuntimesClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.IntegrationRuntimesClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client IntegrationRuntimesClient) UpdatePreparer(ctx context.Context, resourceGroupName string, factoryName string, integrationRuntimeName string, updateIntegrationRuntimeRequest UpdateIntegrationRuntimeRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "factoryName": autorest.Encode("path", factoryName), + "integrationRuntimeName": autorest.Encode("path", integrationRuntimeName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/integrationRuntimes/{integrationRuntimeName}", pathParameters), + autorest.WithJSON(updateIntegrationRuntimeRequest), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client IntegrationRuntimesClient) UpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client IntegrationRuntimesClient) UpdateResponder(resp *http.Response) (result IntegrationRuntimeResource, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Upgrade upgrade self-hosted integration runtime to latest version if availably. +// Parameters: +// resourceGroupName - the resource group name. +// factoryName - the factory name. +// integrationRuntimeName - the integration runtime name. +func (client IntegrationRuntimesClient) Upgrade(ctx context.Context, resourceGroupName string, factoryName string, integrationRuntimeName string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: factoryName, + Constraints: []validation.Constraint{{Target: "factoryName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "factoryName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "factoryName", Name: validation.Pattern, Rule: `^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$`, Chain: nil}}}, + {TargetValue: integrationRuntimeName, + Constraints: []validation.Constraint{{Target: "integrationRuntimeName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "integrationRuntimeName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "integrationRuntimeName", Name: validation.Pattern, Rule: `^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("datafactory.IntegrationRuntimesClient", "Upgrade", err.Error()) + } + + req, err := client.UpgradePreparer(ctx, resourceGroupName, factoryName, integrationRuntimeName) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.IntegrationRuntimesClient", "Upgrade", nil, "Failure preparing request") + return + } + + resp, err := client.UpgradeSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "datafactory.IntegrationRuntimesClient", "Upgrade", resp, "Failure sending request") + return + } + + result, err = client.UpgradeResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.IntegrationRuntimesClient", "Upgrade", resp, "Failure responding to request") + } + + return +} + +// UpgradePreparer prepares the Upgrade request. +func (client IntegrationRuntimesClient) UpgradePreparer(ctx context.Context, resourceGroupName string, factoryName string, integrationRuntimeName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "factoryName": autorest.Encode("path", factoryName), + "integrationRuntimeName": autorest.Encode("path", integrationRuntimeName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/integrationRuntimes/{integrationRuntimeName}/upgrade", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpgradeSender sends the Upgrade request. The method will close the +// http.Response Body if it receives an error. +func (client IntegrationRuntimesClient) UpgradeSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// UpgradeResponder handles the response to the Upgrade request. The method always +// closes the http.Response Body. +func (client IntegrationRuntimesClient) UpgradeResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory/linkedservices.go b/vendor/github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory/linkedservices.go new file mode 100644 index 000000000..06a5923c9 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory/linkedservices.go @@ -0,0 +1,425 @@ +package datafactory + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// LinkedServicesClient is the the Azure Data Factory V2 management API provides a RESTful set of web services that +// interact with Azure Data Factory V2 services. +type LinkedServicesClient struct { + BaseClient +} + +// NewLinkedServicesClient creates an instance of the LinkedServicesClient client. +func NewLinkedServicesClient(subscriptionID string) LinkedServicesClient { + return NewLinkedServicesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewLinkedServicesClientWithBaseURI creates an instance of the LinkedServicesClient client. +func NewLinkedServicesClientWithBaseURI(baseURI string, subscriptionID string) LinkedServicesClient { + return LinkedServicesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or updates a linked service. +// Parameters: +// resourceGroupName - the resource group name. +// factoryName - the factory name. +// linkedServiceName - the linked service name. +// linkedService - linked service resource definition. +// ifMatch - eTag of the linkedService entity. Should only be specified for update, for which it should match +// existing entity or can be * for unconditional update. +func (client LinkedServicesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, factoryName string, linkedServiceName string, linkedService LinkedServiceResource, ifMatch string) (result LinkedServiceResource, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: factoryName, + Constraints: []validation.Constraint{{Target: "factoryName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "factoryName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "factoryName", Name: validation.Pattern, Rule: `^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$`, Chain: nil}}}, + {TargetValue: linkedServiceName, + Constraints: []validation.Constraint{{Target: "linkedServiceName", Name: validation.MaxLength, Rule: 260, Chain: nil}, + {Target: "linkedServiceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "linkedServiceName", Name: validation.Pattern, Rule: `^[A-Za-z0-9_][^<>*#.%&:\\+?/]*$`, Chain: nil}}}, + {TargetValue: linkedService, + Constraints: []validation.Constraint{{Target: "linkedService.Properties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "linkedService.Properties.ConnectVia", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "linkedService.Properties.ConnectVia.Type", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "linkedService.Properties.ConnectVia.ReferenceName", Name: validation.Null, Rule: true, Chain: nil}, + }}, + }}}}}); err != nil { + return result, validation.NewError("datafactory.LinkedServicesClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, factoryName, linkedServiceName, linkedService, ifMatch) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.LinkedServicesClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "datafactory.LinkedServicesClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.LinkedServicesClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client LinkedServicesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, factoryName string, linkedServiceName string, linkedService LinkedServiceResource, ifMatch string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "factoryName": autorest.Encode("path", factoryName), + "linkedServiceName": autorest.Encode("path", linkedServiceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/linkedservices/{linkedServiceName}", pathParameters), + autorest.WithJSON(linkedService), + autorest.WithQueryParameters(queryParameters)) + if len(ifMatch) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client LinkedServicesClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client LinkedServicesClient) CreateOrUpdateResponder(resp *http.Response) (result LinkedServiceResource, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes a linked service. +// Parameters: +// resourceGroupName - the resource group name. +// factoryName - the factory name. +// linkedServiceName - the linked service name. +func (client LinkedServicesClient) Delete(ctx context.Context, resourceGroupName string, factoryName string, linkedServiceName string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: factoryName, + Constraints: []validation.Constraint{{Target: "factoryName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "factoryName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "factoryName", Name: validation.Pattern, Rule: `^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$`, Chain: nil}}}, + {TargetValue: linkedServiceName, + Constraints: []validation.Constraint{{Target: "linkedServiceName", Name: validation.MaxLength, Rule: 260, Chain: nil}, + {Target: "linkedServiceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "linkedServiceName", Name: validation.Pattern, Rule: `^[A-Za-z0-9_][^<>*#.%&:\\+?/]*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("datafactory.LinkedServicesClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, factoryName, linkedServiceName) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.LinkedServicesClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "datafactory.LinkedServicesClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.LinkedServicesClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client LinkedServicesClient) DeletePreparer(ctx context.Context, resourceGroupName string, factoryName string, linkedServiceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "factoryName": autorest.Encode("path", factoryName), + "linkedServiceName": autorest.Encode("path", linkedServiceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/linkedservices/{linkedServiceName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client LinkedServicesClient) DeleteSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client LinkedServicesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets a linked service. +// Parameters: +// resourceGroupName - the resource group name. +// factoryName - the factory name. +// linkedServiceName - the linked service name. +// ifNoneMatch - eTag of the linked service entity. Should only be specified for get. If the ETag matches the +// existing entity tag, or if * was provided, then no content will be returned. +func (client LinkedServicesClient) Get(ctx context.Context, resourceGroupName string, factoryName string, linkedServiceName string, ifNoneMatch string) (result LinkedServiceResource, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: factoryName, + Constraints: []validation.Constraint{{Target: "factoryName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "factoryName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "factoryName", Name: validation.Pattern, Rule: `^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$`, Chain: nil}}}, + {TargetValue: linkedServiceName, + Constraints: []validation.Constraint{{Target: "linkedServiceName", Name: validation.MaxLength, Rule: 260, Chain: nil}, + {Target: "linkedServiceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "linkedServiceName", Name: validation.Pattern, Rule: `^[A-Za-z0-9_][^<>*#.%&:\\+?/]*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("datafactory.LinkedServicesClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, factoryName, linkedServiceName, ifNoneMatch) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.LinkedServicesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "datafactory.LinkedServicesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.LinkedServicesClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client LinkedServicesClient) GetPreparer(ctx context.Context, resourceGroupName string, factoryName string, linkedServiceName string, ifNoneMatch string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "factoryName": autorest.Encode("path", factoryName), + "linkedServiceName": autorest.Encode("path", linkedServiceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/linkedservices/{linkedServiceName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if len(ifNoneMatch) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client LinkedServicesClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client LinkedServicesClient) GetResponder(resp *http.Response) (result LinkedServiceResource, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotModified), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByFactory lists linked services. +// Parameters: +// resourceGroupName - the resource group name. +// factoryName - the factory name. +func (client LinkedServicesClient) ListByFactory(ctx context.Context, resourceGroupName string, factoryName string) (result LinkedServiceListResponsePage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: factoryName, + Constraints: []validation.Constraint{{Target: "factoryName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "factoryName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "factoryName", Name: validation.Pattern, Rule: `^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("datafactory.LinkedServicesClient", "ListByFactory", err.Error()) + } + + result.fn = client.listByFactoryNextResults + req, err := client.ListByFactoryPreparer(ctx, resourceGroupName, factoryName) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.LinkedServicesClient", "ListByFactory", nil, "Failure preparing request") + return + } + + resp, err := client.ListByFactorySender(req) + if err != nil { + result.lslr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "datafactory.LinkedServicesClient", "ListByFactory", resp, "Failure sending request") + return + } + + result.lslr, err = client.ListByFactoryResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.LinkedServicesClient", "ListByFactory", resp, "Failure responding to request") + } + + return +} + +// ListByFactoryPreparer prepares the ListByFactory request. +func (client LinkedServicesClient) ListByFactoryPreparer(ctx context.Context, resourceGroupName string, factoryName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "factoryName": autorest.Encode("path", factoryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/linkedservices", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByFactorySender sends the ListByFactory request. The method will close the +// http.Response Body if it receives an error. +func (client LinkedServicesClient) ListByFactorySender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByFactoryResponder handles the response to the ListByFactory request. The method always +// closes the http.Response Body. +func (client LinkedServicesClient) ListByFactoryResponder(resp *http.Response) (result LinkedServiceListResponse, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByFactoryNextResults retrieves the next set of results, if any. +func (client LinkedServicesClient) listByFactoryNextResults(lastResults LinkedServiceListResponse) (result LinkedServiceListResponse, err error) { + req, err := lastResults.linkedServiceListResponsePreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "datafactory.LinkedServicesClient", "listByFactoryNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByFactorySender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "datafactory.LinkedServicesClient", "listByFactoryNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByFactoryResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.LinkedServicesClient", "listByFactoryNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByFactoryComplete enumerates all values, automatically crossing page boundaries as required. +func (client LinkedServicesClient) ListByFactoryComplete(ctx context.Context, resourceGroupName string, factoryName string) (result LinkedServiceListResponseIterator, err error) { + result.page, err = client.ListByFactory(ctx, resourceGroupName, factoryName) + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory/models.go new file mode 100644 index 000000000..b4990cb15 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory/models.go @@ -0,0 +1,93925 @@ +package datafactory + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "encoding/json" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/date" + "github.com/Azure/go-autorest/autorest/to" + "github.com/satori/go.uuid" + "net/http" +) + +// AuthenticationType enumerates the values for authentication type. +type AuthenticationType string + +const ( + // AuthenticationTypeAnonymous ... + AuthenticationTypeAnonymous AuthenticationType = "Anonymous" + // AuthenticationTypeBasic ... + AuthenticationTypeBasic AuthenticationType = "Basic" + // AuthenticationTypeClientCertificate ... + AuthenticationTypeClientCertificate AuthenticationType = "ClientCertificate" + // AuthenticationTypeWebLinkedServiceTypeProperties ... + AuthenticationTypeWebLinkedServiceTypeProperties AuthenticationType = "WebLinkedServiceTypeProperties" +) + +// PossibleAuthenticationTypeValues returns an array of possible values for the AuthenticationType const type. +func PossibleAuthenticationTypeValues() []AuthenticationType { + return []AuthenticationType{AuthenticationTypeAnonymous, AuthenticationTypeBasic, AuthenticationTypeClientCertificate, AuthenticationTypeWebLinkedServiceTypeProperties} +} + +// AzureSearchIndexWriteBehaviorType enumerates the values for azure search index write behavior type. +type AzureSearchIndexWriteBehaviorType string + +const ( + // Merge ... + Merge AzureSearchIndexWriteBehaviorType = "Merge" + // Upload ... + Upload AzureSearchIndexWriteBehaviorType = "Upload" +) + +// PossibleAzureSearchIndexWriteBehaviorTypeValues returns an array of possible values for the AzureSearchIndexWriteBehaviorType const type. +func PossibleAzureSearchIndexWriteBehaviorTypeValues() []AzureSearchIndexWriteBehaviorType { + return []AzureSearchIndexWriteBehaviorType{Merge, Upload} +} + +// BlobEventTypes enumerates the values for blob event types. +type BlobEventTypes string + +const ( + // MicrosoftStorageBlobCreated ... + MicrosoftStorageBlobCreated BlobEventTypes = "Microsoft.Storage.BlobCreated" + // MicrosoftStorageBlobDeleted ... + MicrosoftStorageBlobDeleted BlobEventTypes = "Microsoft.Storage.BlobDeleted" +) + +// PossibleBlobEventTypesValues returns an array of possible values for the BlobEventTypes const type. +func PossibleBlobEventTypesValues() []BlobEventTypes { + return []BlobEventTypes{MicrosoftStorageBlobCreated, MicrosoftStorageBlobDeleted} +} + +// CassandraSourceReadConsistencyLevels enumerates the values for cassandra source read consistency levels. +type CassandraSourceReadConsistencyLevels string + +const ( + // ALL ... + ALL CassandraSourceReadConsistencyLevels = "ALL" + // EACHQUORUM ... + EACHQUORUM CassandraSourceReadConsistencyLevels = "EACH_QUORUM" + // LOCALONE ... + LOCALONE CassandraSourceReadConsistencyLevels = "LOCAL_ONE" + // LOCALQUORUM ... + LOCALQUORUM CassandraSourceReadConsistencyLevels = "LOCAL_QUORUM" + // LOCALSERIAL ... + LOCALSERIAL CassandraSourceReadConsistencyLevels = "LOCAL_SERIAL" + // ONE ... + ONE CassandraSourceReadConsistencyLevels = "ONE" + // QUORUM ... + QUORUM CassandraSourceReadConsistencyLevels = "QUORUM" + // SERIAL ... + SERIAL CassandraSourceReadConsistencyLevels = "SERIAL" + // THREE ... + THREE CassandraSourceReadConsistencyLevels = "THREE" + // TWO ... + TWO CassandraSourceReadConsistencyLevels = "TWO" +) + +// PossibleCassandraSourceReadConsistencyLevelsValues returns an array of possible values for the CassandraSourceReadConsistencyLevels const type. +func PossibleCassandraSourceReadConsistencyLevelsValues() []CassandraSourceReadConsistencyLevels { + return []CassandraSourceReadConsistencyLevels{ALL, EACHQUORUM, LOCALONE, LOCALQUORUM, LOCALSERIAL, ONE, QUORUM, SERIAL, THREE, TWO} +} + +// CopyBehaviorType enumerates the values for copy behavior type. +type CopyBehaviorType string + +const ( + // FlattenHierarchy ... + FlattenHierarchy CopyBehaviorType = "FlattenHierarchy" + // MergeFiles ... + MergeFiles CopyBehaviorType = "MergeFiles" + // PreserveHierarchy ... + PreserveHierarchy CopyBehaviorType = "PreserveHierarchy" +) + +// PossibleCopyBehaviorTypeValues returns an array of possible values for the CopyBehaviorType const type. +func PossibleCopyBehaviorTypeValues() []CopyBehaviorType { + return []CopyBehaviorType{FlattenHierarchy, MergeFiles, PreserveHierarchy} +} + +// DatasetCompressionLevel enumerates the values for dataset compression level. +type DatasetCompressionLevel string + +const ( + // Fastest ... + Fastest DatasetCompressionLevel = "Fastest" + // Optimal ... + Optimal DatasetCompressionLevel = "Optimal" +) + +// PossibleDatasetCompressionLevelValues returns an array of possible values for the DatasetCompressionLevel const type. +func PossibleDatasetCompressionLevelValues() []DatasetCompressionLevel { + return []DatasetCompressionLevel{Fastest, Optimal} +} + +// DayOfWeek enumerates the values for day of week. +type DayOfWeek string + +const ( + // Friday ... + Friday DayOfWeek = "Friday" + // Monday ... + Monday DayOfWeek = "Monday" + // Saturday ... + Saturday DayOfWeek = "Saturday" + // Sunday ... + Sunday DayOfWeek = "Sunday" + // Thursday ... + Thursday DayOfWeek = "Thursday" + // Tuesday ... + Tuesday DayOfWeek = "Tuesday" + // Wednesday ... + Wednesday DayOfWeek = "Wednesday" +) + +// PossibleDayOfWeekValues returns an array of possible values for the DayOfWeek const type. +func PossibleDayOfWeekValues() []DayOfWeek { + return []DayOfWeek{Friday, Monday, Saturday, Sunday, Thursday, Tuesday, Wednesday} +} + +// DaysOfWeek enumerates the values for days of week. +type DaysOfWeek string + +const ( + // DaysOfWeekFriday ... + DaysOfWeekFriday DaysOfWeek = "Friday" + // DaysOfWeekMonday ... + DaysOfWeekMonday DaysOfWeek = "Monday" + // DaysOfWeekSaturday ... + DaysOfWeekSaturday DaysOfWeek = "Saturday" + // DaysOfWeekSunday ... + DaysOfWeekSunday DaysOfWeek = "Sunday" + // DaysOfWeekThursday ... + DaysOfWeekThursday DaysOfWeek = "Thursday" + // DaysOfWeekTuesday ... + DaysOfWeekTuesday DaysOfWeek = "Tuesday" + // DaysOfWeekWednesday ... + DaysOfWeekWednesday DaysOfWeek = "Wednesday" +) + +// PossibleDaysOfWeekValues returns an array of possible values for the DaysOfWeek const type. +func PossibleDaysOfWeekValues() []DaysOfWeek { + return []DaysOfWeek{DaysOfWeekFriday, DaysOfWeekMonday, DaysOfWeekSaturday, DaysOfWeekSunday, DaysOfWeekThursday, DaysOfWeekTuesday, DaysOfWeekWednesday} +} + +// Db2AuthenticationType enumerates the values for db 2 authentication type. +type Db2AuthenticationType string + +const ( + // Basic ... + Basic Db2AuthenticationType = "Basic" +) + +// PossibleDb2AuthenticationTypeValues returns an array of possible values for the Db2AuthenticationType const type. +func PossibleDb2AuthenticationTypeValues() []Db2AuthenticationType { + return []Db2AuthenticationType{Basic} +} + +// DependencyCondition enumerates the values for dependency condition. +type DependencyCondition string + +const ( + // Completed ... + Completed DependencyCondition = "Completed" + // Failed ... + Failed DependencyCondition = "Failed" + // Skipped ... + Skipped DependencyCondition = "Skipped" + // Succeeded ... + Succeeded DependencyCondition = "Succeeded" +) + +// PossibleDependencyConditionValues returns an array of possible values for the DependencyCondition const type. +func PossibleDependencyConditionValues() []DependencyCondition { + return []DependencyCondition{Completed, Failed, Skipped, Succeeded} +} + +// FtpAuthenticationType enumerates the values for ftp authentication type. +type FtpAuthenticationType string + +const ( + // FtpAuthenticationTypeAnonymous ... + FtpAuthenticationTypeAnonymous FtpAuthenticationType = "Anonymous" + // FtpAuthenticationTypeBasic ... + FtpAuthenticationTypeBasic FtpAuthenticationType = "Basic" +) + +// PossibleFtpAuthenticationTypeValues returns an array of possible values for the FtpAuthenticationType const type. +func PossibleFtpAuthenticationTypeValues() []FtpAuthenticationType { + return []FtpAuthenticationType{FtpAuthenticationTypeAnonymous, FtpAuthenticationTypeBasic} +} + +// GoogleBigQueryAuthenticationType enumerates the values for google big query authentication type. +type GoogleBigQueryAuthenticationType string + +const ( + // ServiceAuthentication ... + ServiceAuthentication GoogleBigQueryAuthenticationType = "ServiceAuthentication" + // UserAuthentication ... + UserAuthentication GoogleBigQueryAuthenticationType = "UserAuthentication" +) + +// PossibleGoogleBigQueryAuthenticationTypeValues returns an array of possible values for the GoogleBigQueryAuthenticationType const type. +func PossibleGoogleBigQueryAuthenticationTypeValues() []GoogleBigQueryAuthenticationType { + return []GoogleBigQueryAuthenticationType{ServiceAuthentication, UserAuthentication} +} + +// HBaseAuthenticationType enumerates the values for h base authentication type. +type HBaseAuthenticationType string + +const ( + // HBaseAuthenticationTypeAnonymous ... + HBaseAuthenticationTypeAnonymous HBaseAuthenticationType = "Anonymous" + // HBaseAuthenticationTypeBasic ... + HBaseAuthenticationTypeBasic HBaseAuthenticationType = "Basic" +) + +// PossibleHBaseAuthenticationTypeValues returns an array of possible values for the HBaseAuthenticationType const type. +func PossibleHBaseAuthenticationTypeValues() []HBaseAuthenticationType { + return []HBaseAuthenticationType{HBaseAuthenticationTypeAnonymous, HBaseAuthenticationTypeBasic} +} + +// HDInsightActivityDebugInfoOption enumerates the values for hd insight activity debug info option. +type HDInsightActivityDebugInfoOption string + +const ( + // Always ... + Always HDInsightActivityDebugInfoOption = "Always" + // Failure ... + Failure HDInsightActivityDebugInfoOption = "Failure" + // None ... + None HDInsightActivityDebugInfoOption = "None" +) + +// PossibleHDInsightActivityDebugInfoOptionValues returns an array of possible values for the HDInsightActivityDebugInfoOption const type. +func PossibleHDInsightActivityDebugInfoOptionValues() []HDInsightActivityDebugInfoOption { + return []HDInsightActivityDebugInfoOption{Always, Failure, None} +} + +// HiveAuthenticationType enumerates the values for hive authentication type. +type HiveAuthenticationType string + +const ( + // Anonymous ... + Anonymous HiveAuthenticationType = "Anonymous" + // Username ... + Username HiveAuthenticationType = "Username" + // UsernameAndPassword ... + UsernameAndPassword HiveAuthenticationType = "UsernameAndPassword" + // WindowsAzureHDInsightService ... + WindowsAzureHDInsightService HiveAuthenticationType = "WindowsAzureHDInsightService" +) + +// PossibleHiveAuthenticationTypeValues returns an array of possible values for the HiveAuthenticationType const type. +func PossibleHiveAuthenticationTypeValues() []HiveAuthenticationType { + return []HiveAuthenticationType{Anonymous, Username, UsernameAndPassword, WindowsAzureHDInsightService} +} + +// HiveServerType enumerates the values for hive server type. +type HiveServerType string + +const ( + // HiveServer1 ... + HiveServer1 HiveServerType = "HiveServer1" + // HiveServer2 ... + HiveServer2 HiveServerType = "HiveServer2" + // HiveThriftServer ... + HiveThriftServer HiveServerType = "HiveThriftServer" +) + +// PossibleHiveServerTypeValues returns an array of possible values for the HiveServerType const type. +func PossibleHiveServerTypeValues() []HiveServerType { + return []HiveServerType{HiveServer1, HiveServer2, HiveThriftServer} +} + +// HiveThriftTransportProtocol enumerates the values for hive thrift transport protocol. +type HiveThriftTransportProtocol string + +const ( + // Binary ... + Binary HiveThriftTransportProtocol = "Binary" + // HTTP ... + HTTP HiveThriftTransportProtocol = "HTTP " + // SASL ... + SASL HiveThriftTransportProtocol = "SASL" +) + +// PossibleHiveThriftTransportProtocolValues returns an array of possible values for the HiveThriftTransportProtocol const type. +func PossibleHiveThriftTransportProtocolValues() []HiveThriftTransportProtocol { + return []HiveThriftTransportProtocol{Binary, HTTP, SASL} +} + +// HTTPAuthenticationType enumerates the values for http authentication type. +type HTTPAuthenticationType string + +const ( + // HTTPAuthenticationTypeAnonymous ... + HTTPAuthenticationTypeAnonymous HTTPAuthenticationType = "Anonymous" + // HTTPAuthenticationTypeBasic ... + HTTPAuthenticationTypeBasic HTTPAuthenticationType = "Basic" + // HTTPAuthenticationTypeClientCertificate ... + HTTPAuthenticationTypeClientCertificate HTTPAuthenticationType = "ClientCertificate" + // HTTPAuthenticationTypeDigest ... + HTTPAuthenticationTypeDigest HTTPAuthenticationType = "Digest" + // HTTPAuthenticationTypeWindows ... + HTTPAuthenticationTypeWindows HTTPAuthenticationType = "Windows" +) + +// PossibleHTTPAuthenticationTypeValues returns an array of possible values for the HTTPAuthenticationType const type. +func PossibleHTTPAuthenticationTypeValues() []HTTPAuthenticationType { + return []HTTPAuthenticationType{HTTPAuthenticationTypeAnonymous, HTTPAuthenticationTypeBasic, HTTPAuthenticationTypeClientCertificate, HTTPAuthenticationTypeDigest, HTTPAuthenticationTypeWindows} +} + +// ImpalaAuthenticationType enumerates the values for impala authentication type. +type ImpalaAuthenticationType string + +const ( + // ImpalaAuthenticationTypeAnonymous ... + ImpalaAuthenticationTypeAnonymous ImpalaAuthenticationType = "Anonymous" + // ImpalaAuthenticationTypeSASLUsername ... + ImpalaAuthenticationTypeSASLUsername ImpalaAuthenticationType = "SASLUsername" + // ImpalaAuthenticationTypeUsernameAndPassword ... + ImpalaAuthenticationTypeUsernameAndPassword ImpalaAuthenticationType = "UsernameAndPassword" +) + +// PossibleImpalaAuthenticationTypeValues returns an array of possible values for the ImpalaAuthenticationType const type. +func PossibleImpalaAuthenticationTypeValues() []ImpalaAuthenticationType { + return []ImpalaAuthenticationType{ImpalaAuthenticationTypeAnonymous, ImpalaAuthenticationTypeSASLUsername, ImpalaAuthenticationTypeUsernameAndPassword} +} + +// IntegrationRuntimeAuthKeyName enumerates the values for integration runtime auth key name. +type IntegrationRuntimeAuthKeyName string + +const ( + // AuthKey1 ... + AuthKey1 IntegrationRuntimeAuthKeyName = "authKey1" + // AuthKey2 ... + AuthKey2 IntegrationRuntimeAuthKeyName = "authKey2" +) + +// PossibleIntegrationRuntimeAuthKeyNameValues returns an array of possible values for the IntegrationRuntimeAuthKeyName const type. +func PossibleIntegrationRuntimeAuthKeyNameValues() []IntegrationRuntimeAuthKeyName { + return []IntegrationRuntimeAuthKeyName{AuthKey1, AuthKey2} +} + +// IntegrationRuntimeAutoUpdate enumerates the values for integration runtime auto update. +type IntegrationRuntimeAutoUpdate string + +const ( + // Off ... + Off IntegrationRuntimeAutoUpdate = "Off" + // On ... + On IntegrationRuntimeAutoUpdate = "On" +) + +// PossibleIntegrationRuntimeAutoUpdateValues returns an array of possible values for the IntegrationRuntimeAutoUpdate const type. +func PossibleIntegrationRuntimeAutoUpdateValues() []IntegrationRuntimeAutoUpdate { + return []IntegrationRuntimeAutoUpdate{Off, On} +} + +// IntegrationRuntimeEdition enumerates the values for integration runtime edition. +type IntegrationRuntimeEdition string + +const ( + // Enterprise ... + Enterprise IntegrationRuntimeEdition = "Enterprise" + // Standard ... + Standard IntegrationRuntimeEdition = "Standard" +) + +// PossibleIntegrationRuntimeEditionValues returns an array of possible values for the IntegrationRuntimeEdition const type. +func PossibleIntegrationRuntimeEditionValues() []IntegrationRuntimeEdition { + return []IntegrationRuntimeEdition{Enterprise, Standard} +} + +// IntegrationRuntimeInternalChannelEncryptionMode enumerates the values for integration runtime internal +// channel encryption mode. +type IntegrationRuntimeInternalChannelEncryptionMode string + +const ( + // NotEncrypted ... + NotEncrypted IntegrationRuntimeInternalChannelEncryptionMode = "NotEncrypted" + // NotSet ... + NotSet IntegrationRuntimeInternalChannelEncryptionMode = "NotSet" + // SslEncrypted ... + SslEncrypted IntegrationRuntimeInternalChannelEncryptionMode = "SslEncrypted" +) + +// PossibleIntegrationRuntimeInternalChannelEncryptionModeValues returns an array of possible values for the IntegrationRuntimeInternalChannelEncryptionMode const type. +func PossibleIntegrationRuntimeInternalChannelEncryptionModeValues() []IntegrationRuntimeInternalChannelEncryptionMode { + return []IntegrationRuntimeInternalChannelEncryptionMode{NotEncrypted, NotSet, SslEncrypted} +} + +// IntegrationRuntimeLicenseType enumerates the values for integration runtime license type. +type IntegrationRuntimeLicenseType string + +const ( + // BasePrice ... + BasePrice IntegrationRuntimeLicenseType = "BasePrice" + // LicenseIncluded ... + LicenseIncluded IntegrationRuntimeLicenseType = "LicenseIncluded" +) + +// PossibleIntegrationRuntimeLicenseTypeValues returns an array of possible values for the IntegrationRuntimeLicenseType const type. +func PossibleIntegrationRuntimeLicenseTypeValues() []IntegrationRuntimeLicenseType { + return []IntegrationRuntimeLicenseType{BasePrice, LicenseIncluded} +} + +// IntegrationRuntimeSsisCatalogPricingTier enumerates the values for integration runtime ssis catalog pricing +// tier. +type IntegrationRuntimeSsisCatalogPricingTier string + +const ( + // IntegrationRuntimeSsisCatalogPricingTierBasic ... + IntegrationRuntimeSsisCatalogPricingTierBasic IntegrationRuntimeSsisCatalogPricingTier = "Basic" + // IntegrationRuntimeSsisCatalogPricingTierPremium ... + IntegrationRuntimeSsisCatalogPricingTierPremium IntegrationRuntimeSsisCatalogPricingTier = "Premium" + // IntegrationRuntimeSsisCatalogPricingTierPremiumRS ... + IntegrationRuntimeSsisCatalogPricingTierPremiumRS IntegrationRuntimeSsisCatalogPricingTier = "PremiumRS" + // IntegrationRuntimeSsisCatalogPricingTierStandard ... + IntegrationRuntimeSsisCatalogPricingTierStandard IntegrationRuntimeSsisCatalogPricingTier = "Standard" +) + +// PossibleIntegrationRuntimeSsisCatalogPricingTierValues returns an array of possible values for the IntegrationRuntimeSsisCatalogPricingTier const type. +func PossibleIntegrationRuntimeSsisCatalogPricingTierValues() []IntegrationRuntimeSsisCatalogPricingTier { + return []IntegrationRuntimeSsisCatalogPricingTier{IntegrationRuntimeSsisCatalogPricingTierBasic, IntegrationRuntimeSsisCatalogPricingTierPremium, IntegrationRuntimeSsisCatalogPricingTierPremiumRS, IntegrationRuntimeSsisCatalogPricingTierStandard} +} + +// IntegrationRuntimeState enumerates the values for integration runtime state. +type IntegrationRuntimeState string + +const ( + // Initial ... + Initial IntegrationRuntimeState = "Initial" + // Limited ... + Limited IntegrationRuntimeState = "Limited" + // NeedRegistration ... + NeedRegistration IntegrationRuntimeState = "NeedRegistration" + // Offline ... + Offline IntegrationRuntimeState = "Offline" + // Online ... + Online IntegrationRuntimeState = "Online" + // Started ... + Started IntegrationRuntimeState = "Started" + // Starting ... + Starting IntegrationRuntimeState = "Starting" + // Stopped ... + Stopped IntegrationRuntimeState = "Stopped" + // Stopping ... + Stopping IntegrationRuntimeState = "Stopping" +) + +// PossibleIntegrationRuntimeStateValues returns an array of possible values for the IntegrationRuntimeState const type. +func PossibleIntegrationRuntimeStateValues() []IntegrationRuntimeState { + return []IntegrationRuntimeState{Initial, Limited, NeedRegistration, Offline, Online, Started, Starting, Stopped, Stopping} +} + +// IntegrationRuntimeType enumerates the values for integration runtime type. +type IntegrationRuntimeType string + +const ( + // Managed ... + Managed IntegrationRuntimeType = "Managed" + // SelfHosted ... + SelfHosted IntegrationRuntimeType = "SelfHosted" +) + +// PossibleIntegrationRuntimeTypeValues returns an array of possible values for the IntegrationRuntimeType const type. +func PossibleIntegrationRuntimeTypeValues() []IntegrationRuntimeType { + return []IntegrationRuntimeType{Managed, SelfHosted} +} + +// IntegrationRuntimeUpdateResult enumerates the values for integration runtime update result. +type IntegrationRuntimeUpdateResult string + +const ( + // Fail ... + Fail IntegrationRuntimeUpdateResult = "Fail" + // Succeed ... + Succeed IntegrationRuntimeUpdateResult = "Succeed" +) + +// PossibleIntegrationRuntimeUpdateResultValues returns an array of possible values for the IntegrationRuntimeUpdateResult const type. +func PossibleIntegrationRuntimeUpdateResultValues() []IntegrationRuntimeUpdateResult { + return []IntegrationRuntimeUpdateResult{Fail, Succeed} +} + +// JSONFormatFilePattern enumerates the values for json format file pattern. +type JSONFormatFilePattern string + +const ( + // ArrayOfObjects ... + ArrayOfObjects JSONFormatFilePattern = "arrayOfObjects" + // SetOfObjects ... + SetOfObjects JSONFormatFilePattern = "setOfObjects" +) + +// PossibleJSONFormatFilePatternValues returns an array of possible values for the JSONFormatFilePattern const type. +func PossibleJSONFormatFilePatternValues() []JSONFormatFilePattern { + return []JSONFormatFilePattern{ArrayOfObjects, SetOfObjects} +} + +// ManagedIntegrationRuntimeNodeStatus enumerates the values for managed integration runtime node status. +type ManagedIntegrationRuntimeNodeStatus string + +const ( + // ManagedIntegrationRuntimeNodeStatusAvailable ... + ManagedIntegrationRuntimeNodeStatusAvailable ManagedIntegrationRuntimeNodeStatus = "Available" + // ManagedIntegrationRuntimeNodeStatusRecycling ... + ManagedIntegrationRuntimeNodeStatusRecycling ManagedIntegrationRuntimeNodeStatus = "Recycling" + // ManagedIntegrationRuntimeNodeStatusStarting ... + ManagedIntegrationRuntimeNodeStatusStarting ManagedIntegrationRuntimeNodeStatus = "Starting" + // ManagedIntegrationRuntimeNodeStatusUnavailable ... + ManagedIntegrationRuntimeNodeStatusUnavailable ManagedIntegrationRuntimeNodeStatus = "Unavailable" +) + +// PossibleManagedIntegrationRuntimeNodeStatusValues returns an array of possible values for the ManagedIntegrationRuntimeNodeStatus const type. +func PossibleManagedIntegrationRuntimeNodeStatusValues() []ManagedIntegrationRuntimeNodeStatus { + return []ManagedIntegrationRuntimeNodeStatus{ManagedIntegrationRuntimeNodeStatusAvailable, ManagedIntegrationRuntimeNodeStatusRecycling, ManagedIntegrationRuntimeNodeStatusStarting, ManagedIntegrationRuntimeNodeStatusUnavailable} +} + +// MongoDbAuthenticationType enumerates the values for mongo db authentication type. +type MongoDbAuthenticationType string + +const ( + // MongoDbAuthenticationTypeAnonymous ... + MongoDbAuthenticationTypeAnonymous MongoDbAuthenticationType = "Anonymous" + // MongoDbAuthenticationTypeBasic ... + MongoDbAuthenticationTypeBasic MongoDbAuthenticationType = "Basic" +) + +// PossibleMongoDbAuthenticationTypeValues returns an array of possible values for the MongoDbAuthenticationType const type. +func PossibleMongoDbAuthenticationTypeValues() []MongoDbAuthenticationType { + return []MongoDbAuthenticationType{MongoDbAuthenticationTypeAnonymous, MongoDbAuthenticationTypeBasic} +} + +// ODataAuthenticationType enumerates the values for o data authentication type. +type ODataAuthenticationType string + +const ( + // ODataAuthenticationTypeAnonymous ... + ODataAuthenticationTypeAnonymous ODataAuthenticationType = "Anonymous" + // ODataAuthenticationTypeBasic ... + ODataAuthenticationTypeBasic ODataAuthenticationType = "Basic" +) + +// PossibleODataAuthenticationTypeValues returns an array of possible values for the ODataAuthenticationType const type. +func PossibleODataAuthenticationTypeValues() []ODataAuthenticationType { + return []ODataAuthenticationType{ODataAuthenticationTypeAnonymous, ODataAuthenticationTypeBasic} +} + +// ParameterType enumerates the values for parameter type. +type ParameterType string + +const ( + // ParameterTypeArray ... + ParameterTypeArray ParameterType = "Array" + // ParameterTypeBool ... + ParameterTypeBool ParameterType = "Bool" + // ParameterTypeFloat ... + ParameterTypeFloat ParameterType = "Float" + // ParameterTypeInt ... + ParameterTypeInt ParameterType = "Int" + // ParameterTypeObject ... + ParameterTypeObject ParameterType = "Object" + // ParameterTypeSecureString ... + ParameterTypeSecureString ParameterType = "SecureString" + // ParameterTypeString ... + ParameterTypeString ParameterType = "String" +) + +// PossibleParameterTypeValues returns an array of possible values for the ParameterType const type. +func PossibleParameterTypeValues() []ParameterType { + return []ParameterType{ParameterTypeArray, ParameterTypeBool, ParameterTypeFloat, ParameterTypeInt, ParameterTypeObject, ParameterTypeSecureString, ParameterTypeString} +} + +// PhoenixAuthenticationType enumerates the values for phoenix authentication type. +type PhoenixAuthenticationType string + +const ( + // PhoenixAuthenticationTypeAnonymous ... + PhoenixAuthenticationTypeAnonymous PhoenixAuthenticationType = "Anonymous" + // PhoenixAuthenticationTypeUsernameAndPassword ... + PhoenixAuthenticationTypeUsernameAndPassword PhoenixAuthenticationType = "UsernameAndPassword" + // PhoenixAuthenticationTypeWindowsAzureHDInsightService ... + PhoenixAuthenticationTypeWindowsAzureHDInsightService PhoenixAuthenticationType = "WindowsAzureHDInsightService" +) + +// PossiblePhoenixAuthenticationTypeValues returns an array of possible values for the PhoenixAuthenticationType const type. +func PossiblePhoenixAuthenticationTypeValues() []PhoenixAuthenticationType { + return []PhoenixAuthenticationType{PhoenixAuthenticationTypeAnonymous, PhoenixAuthenticationTypeUsernameAndPassword, PhoenixAuthenticationTypeWindowsAzureHDInsightService} +} + +// PolybaseSettingsRejectType enumerates the values for polybase settings reject type. +type PolybaseSettingsRejectType string + +const ( + // Percentage ... + Percentage PolybaseSettingsRejectType = "percentage" + // Value ... + Value PolybaseSettingsRejectType = "value" +) + +// PossiblePolybaseSettingsRejectTypeValues returns an array of possible values for the PolybaseSettingsRejectType const type. +func PossiblePolybaseSettingsRejectTypeValues() []PolybaseSettingsRejectType { + return []PolybaseSettingsRejectType{Percentage, Value} +} + +// PrestoAuthenticationType enumerates the values for presto authentication type. +type PrestoAuthenticationType string + +const ( + // PrestoAuthenticationTypeAnonymous ... + PrestoAuthenticationTypeAnonymous PrestoAuthenticationType = "Anonymous" + // PrestoAuthenticationTypeLDAP ... + PrestoAuthenticationTypeLDAP PrestoAuthenticationType = "LDAP" +) + +// PossiblePrestoAuthenticationTypeValues returns an array of possible values for the PrestoAuthenticationType const type. +func PossiblePrestoAuthenticationTypeValues() []PrestoAuthenticationType { + return []PrestoAuthenticationType{PrestoAuthenticationTypeAnonymous, PrestoAuthenticationTypeLDAP} +} + +// RecurrenceFrequency enumerates the values for recurrence frequency. +type RecurrenceFrequency string + +const ( + // Day ... + Day RecurrenceFrequency = "Day" + // Hour ... + Hour RecurrenceFrequency = "Hour" + // Minute ... + Minute RecurrenceFrequency = "Minute" + // Month ... + Month RecurrenceFrequency = "Month" + // NotSpecified ... + NotSpecified RecurrenceFrequency = "NotSpecified" + // Week ... + Week RecurrenceFrequency = "Week" + // Year ... + Year RecurrenceFrequency = "Year" +) + +// PossibleRecurrenceFrequencyValues returns an array of possible values for the RecurrenceFrequency const type. +func PossibleRecurrenceFrequencyValues() []RecurrenceFrequency { + return []RecurrenceFrequency{Day, Hour, Minute, Month, NotSpecified, Week, Year} +} + +// RunQueryFilterOperand enumerates the values for run query filter operand. +type RunQueryFilterOperand string + +const ( + // ActivityName ... + ActivityName RunQueryFilterOperand = "ActivityName" + // ActivityRunEnd ... + ActivityRunEnd RunQueryFilterOperand = "ActivityRunEnd" + // ActivityRunStart ... + ActivityRunStart RunQueryFilterOperand = "ActivityRunStart" + // ActivityType ... + ActivityType RunQueryFilterOperand = "ActivityType" + // PipelineName ... + PipelineName RunQueryFilterOperand = "PipelineName" + // RunEnd ... + RunEnd RunQueryFilterOperand = "RunEnd" + // RunStart ... + RunStart RunQueryFilterOperand = "RunStart" + // Status ... + Status RunQueryFilterOperand = "Status" + // TriggerName ... + TriggerName RunQueryFilterOperand = "TriggerName" + // TriggerRunTimestamp ... + TriggerRunTimestamp RunQueryFilterOperand = "TriggerRunTimestamp" +) + +// PossibleRunQueryFilterOperandValues returns an array of possible values for the RunQueryFilterOperand const type. +func PossibleRunQueryFilterOperandValues() []RunQueryFilterOperand { + return []RunQueryFilterOperand{ActivityName, ActivityRunEnd, ActivityRunStart, ActivityType, PipelineName, RunEnd, RunStart, Status, TriggerName, TriggerRunTimestamp} +} + +// RunQueryFilterOperator enumerates the values for run query filter operator. +type RunQueryFilterOperator string + +const ( + // Equals ... + Equals RunQueryFilterOperator = "Equals" + // In ... + In RunQueryFilterOperator = "In" + // NotEquals ... + NotEquals RunQueryFilterOperator = "NotEquals" + // NotIn ... + NotIn RunQueryFilterOperator = "NotIn" +) + +// PossibleRunQueryFilterOperatorValues returns an array of possible values for the RunQueryFilterOperator const type. +func PossibleRunQueryFilterOperatorValues() []RunQueryFilterOperator { + return []RunQueryFilterOperator{Equals, In, NotEquals, NotIn} +} + +// RunQueryOrder enumerates the values for run query order. +type RunQueryOrder string + +const ( + // ASC ... + ASC RunQueryOrder = "ASC" + // DESC ... + DESC RunQueryOrder = "DESC" +) + +// PossibleRunQueryOrderValues returns an array of possible values for the RunQueryOrder const type. +func PossibleRunQueryOrderValues() []RunQueryOrder { + return []RunQueryOrder{ASC, DESC} +} + +// RunQueryOrderByField enumerates the values for run query order by field. +type RunQueryOrderByField string + +const ( + // RunQueryOrderByFieldActivityName ... + RunQueryOrderByFieldActivityName RunQueryOrderByField = "ActivityName" + // RunQueryOrderByFieldActivityRunEnd ... + RunQueryOrderByFieldActivityRunEnd RunQueryOrderByField = "ActivityRunEnd" + // RunQueryOrderByFieldActivityRunStart ... + RunQueryOrderByFieldActivityRunStart RunQueryOrderByField = "ActivityRunStart" + // RunQueryOrderByFieldPipelineName ... + RunQueryOrderByFieldPipelineName RunQueryOrderByField = "PipelineName" + // RunQueryOrderByFieldRunEnd ... + RunQueryOrderByFieldRunEnd RunQueryOrderByField = "RunEnd" + // RunQueryOrderByFieldRunStart ... + RunQueryOrderByFieldRunStart RunQueryOrderByField = "RunStart" + // RunQueryOrderByFieldStatus ... + RunQueryOrderByFieldStatus RunQueryOrderByField = "Status" + // RunQueryOrderByFieldTriggerName ... + RunQueryOrderByFieldTriggerName RunQueryOrderByField = "TriggerName" + // RunQueryOrderByFieldTriggerRunTimestamp ... + RunQueryOrderByFieldTriggerRunTimestamp RunQueryOrderByField = "TriggerRunTimestamp" +) + +// PossibleRunQueryOrderByFieldValues returns an array of possible values for the RunQueryOrderByField const type. +func PossibleRunQueryOrderByFieldValues() []RunQueryOrderByField { + return []RunQueryOrderByField{RunQueryOrderByFieldActivityName, RunQueryOrderByFieldActivityRunEnd, RunQueryOrderByFieldActivityRunStart, RunQueryOrderByFieldPipelineName, RunQueryOrderByFieldRunEnd, RunQueryOrderByFieldRunStart, RunQueryOrderByFieldStatus, RunQueryOrderByFieldTriggerName, RunQueryOrderByFieldTriggerRunTimestamp} +} + +// SalesforceSinkWriteBehavior enumerates the values for salesforce sink write behavior. +type SalesforceSinkWriteBehavior string + +const ( + // Insert ... + Insert SalesforceSinkWriteBehavior = "Insert" + // Upsert ... + Upsert SalesforceSinkWriteBehavior = "Upsert" +) + +// PossibleSalesforceSinkWriteBehaviorValues returns an array of possible values for the SalesforceSinkWriteBehavior const type. +func PossibleSalesforceSinkWriteBehaviorValues() []SalesforceSinkWriteBehavior { + return []SalesforceSinkWriteBehavior{Insert, Upsert} +} + +// SalesforceSourceReadBehavior enumerates the values for salesforce source read behavior. +type SalesforceSourceReadBehavior string + +const ( + // Query ... + Query SalesforceSourceReadBehavior = "Query" + // QueryAll ... + QueryAll SalesforceSourceReadBehavior = "QueryAll" +) + +// PossibleSalesforceSourceReadBehaviorValues returns an array of possible values for the SalesforceSourceReadBehavior const type. +func PossibleSalesforceSourceReadBehaviorValues() []SalesforceSourceReadBehavior { + return []SalesforceSourceReadBehavior{Query, QueryAll} +} + +// SapCloudForCustomerSinkWriteBehavior enumerates the values for sap cloud for customer sink write behavior. +type SapCloudForCustomerSinkWriteBehavior string + +const ( + // SapCloudForCustomerSinkWriteBehaviorInsert ... + SapCloudForCustomerSinkWriteBehaviorInsert SapCloudForCustomerSinkWriteBehavior = "Insert" + // SapCloudForCustomerSinkWriteBehaviorUpdate ... + SapCloudForCustomerSinkWriteBehaviorUpdate SapCloudForCustomerSinkWriteBehavior = "Update" +) + +// PossibleSapCloudForCustomerSinkWriteBehaviorValues returns an array of possible values for the SapCloudForCustomerSinkWriteBehavior const type. +func PossibleSapCloudForCustomerSinkWriteBehaviorValues() []SapCloudForCustomerSinkWriteBehavior { + return []SapCloudForCustomerSinkWriteBehavior{SapCloudForCustomerSinkWriteBehaviorInsert, SapCloudForCustomerSinkWriteBehaviorUpdate} +} + +// SapHanaAuthenticationType enumerates the values for sap hana authentication type. +type SapHanaAuthenticationType string + +const ( + // SapHanaAuthenticationTypeBasic ... + SapHanaAuthenticationTypeBasic SapHanaAuthenticationType = "Basic" + // SapHanaAuthenticationTypeWindows ... + SapHanaAuthenticationTypeWindows SapHanaAuthenticationType = "Windows" +) + +// PossibleSapHanaAuthenticationTypeValues returns an array of possible values for the SapHanaAuthenticationType const type. +func PossibleSapHanaAuthenticationTypeValues() []SapHanaAuthenticationType { + return []SapHanaAuthenticationType{SapHanaAuthenticationTypeBasic, SapHanaAuthenticationTypeWindows} +} + +// SelfHostedIntegrationRuntimeNodeStatus enumerates the values for self hosted integration runtime node +// status. +type SelfHostedIntegrationRuntimeNodeStatus string + +const ( + // SelfHostedIntegrationRuntimeNodeStatusInitializeFailed ... + SelfHostedIntegrationRuntimeNodeStatusInitializeFailed SelfHostedIntegrationRuntimeNodeStatus = "InitializeFailed" + // SelfHostedIntegrationRuntimeNodeStatusInitializing ... + SelfHostedIntegrationRuntimeNodeStatusInitializing SelfHostedIntegrationRuntimeNodeStatus = "Initializing" + // SelfHostedIntegrationRuntimeNodeStatusLimited ... + SelfHostedIntegrationRuntimeNodeStatusLimited SelfHostedIntegrationRuntimeNodeStatus = "Limited" + // SelfHostedIntegrationRuntimeNodeStatusNeedRegistration ... + SelfHostedIntegrationRuntimeNodeStatusNeedRegistration SelfHostedIntegrationRuntimeNodeStatus = "NeedRegistration" + // SelfHostedIntegrationRuntimeNodeStatusOffline ... + SelfHostedIntegrationRuntimeNodeStatusOffline SelfHostedIntegrationRuntimeNodeStatus = "Offline" + // SelfHostedIntegrationRuntimeNodeStatusOnline ... + SelfHostedIntegrationRuntimeNodeStatusOnline SelfHostedIntegrationRuntimeNodeStatus = "Online" + // SelfHostedIntegrationRuntimeNodeStatusUpgrading ... + SelfHostedIntegrationRuntimeNodeStatusUpgrading SelfHostedIntegrationRuntimeNodeStatus = "Upgrading" +) + +// PossibleSelfHostedIntegrationRuntimeNodeStatusValues returns an array of possible values for the SelfHostedIntegrationRuntimeNodeStatus const type. +func PossibleSelfHostedIntegrationRuntimeNodeStatusValues() []SelfHostedIntegrationRuntimeNodeStatus { + return []SelfHostedIntegrationRuntimeNodeStatus{SelfHostedIntegrationRuntimeNodeStatusInitializeFailed, SelfHostedIntegrationRuntimeNodeStatusInitializing, SelfHostedIntegrationRuntimeNodeStatusLimited, SelfHostedIntegrationRuntimeNodeStatusNeedRegistration, SelfHostedIntegrationRuntimeNodeStatusOffline, SelfHostedIntegrationRuntimeNodeStatusOnline, SelfHostedIntegrationRuntimeNodeStatusUpgrading} +} + +// ServiceNowAuthenticationType enumerates the values for service now authentication type. +type ServiceNowAuthenticationType string + +const ( + // ServiceNowAuthenticationTypeBasic ... + ServiceNowAuthenticationTypeBasic ServiceNowAuthenticationType = "Basic" + // ServiceNowAuthenticationTypeOAuth2 ... + ServiceNowAuthenticationTypeOAuth2 ServiceNowAuthenticationType = "OAuth2" +) + +// PossibleServiceNowAuthenticationTypeValues returns an array of possible values for the ServiceNowAuthenticationType const type. +func PossibleServiceNowAuthenticationTypeValues() []ServiceNowAuthenticationType { + return []ServiceNowAuthenticationType{ServiceNowAuthenticationTypeBasic, ServiceNowAuthenticationTypeOAuth2} +} + +// SftpAuthenticationType enumerates the values for sftp authentication type. +type SftpAuthenticationType string + +const ( + // SftpAuthenticationTypeBasic ... + SftpAuthenticationTypeBasic SftpAuthenticationType = "Basic" + // SftpAuthenticationTypeSSHPublicKey ... + SftpAuthenticationTypeSSHPublicKey SftpAuthenticationType = "SshPublicKey" +) + +// PossibleSftpAuthenticationTypeValues returns an array of possible values for the SftpAuthenticationType const type. +func PossibleSftpAuthenticationTypeValues() []SftpAuthenticationType { + return []SftpAuthenticationType{SftpAuthenticationTypeBasic, SftpAuthenticationTypeSSHPublicKey} +} + +// SparkAuthenticationType enumerates the values for spark authentication type. +type SparkAuthenticationType string + +const ( + // SparkAuthenticationTypeAnonymous ... + SparkAuthenticationTypeAnonymous SparkAuthenticationType = "Anonymous" + // SparkAuthenticationTypeUsername ... + SparkAuthenticationTypeUsername SparkAuthenticationType = "Username" + // SparkAuthenticationTypeUsernameAndPassword ... + SparkAuthenticationTypeUsernameAndPassword SparkAuthenticationType = "UsernameAndPassword" + // SparkAuthenticationTypeWindowsAzureHDInsightService ... + SparkAuthenticationTypeWindowsAzureHDInsightService SparkAuthenticationType = "WindowsAzureHDInsightService" +) + +// PossibleSparkAuthenticationTypeValues returns an array of possible values for the SparkAuthenticationType const type. +func PossibleSparkAuthenticationTypeValues() []SparkAuthenticationType { + return []SparkAuthenticationType{SparkAuthenticationTypeAnonymous, SparkAuthenticationTypeUsername, SparkAuthenticationTypeUsernameAndPassword, SparkAuthenticationTypeWindowsAzureHDInsightService} +} + +// SparkServerType enumerates the values for spark server type. +type SparkServerType string + +const ( + // SharkServer ... + SharkServer SparkServerType = "SharkServer" + // SharkServer2 ... + SharkServer2 SparkServerType = "SharkServer2" + // SparkThriftServer ... + SparkThriftServer SparkServerType = "SparkThriftServer" +) + +// PossibleSparkServerTypeValues returns an array of possible values for the SparkServerType const type. +func PossibleSparkServerTypeValues() []SparkServerType { + return []SparkServerType{SharkServer, SharkServer2, SparkThriftServer} +} + +// SparkThriftTransportProtocol enumerates the values for spark thrift transport protocol. +type SparkThriftTransportProtocol string + +const ( + // SparkThriftTransportProtocolBinary ... + SparkThriftTransportProtocolBinary SparkThriftTransportProtocol = "Binary" + // SparkThriftTransportProtocolHTTP ... + SparkThriftTransportProtocolHTTP SparkThriftTransportProtocol = "HTTP " + // SparkThriftTransportProtocolSASL ... + SparkThriftTransportProtocolSASL SparkThriftTransportProtocol = "SASL" +) + +// PossibleSparkThriftTransportProtocolValues returns an array of possible values for the SparkThriftTransportProtocol const type. +func PossibleSparkThriftTransportProtocolValues() []SparkThriftTransportProtocol { + return []SparkThriftTransportProtocol{SparkThriftTransportProtocolBinary, SparkThriftTransportProtocolHTTP, SparkThriftTransportProtocolSASL} +} + +// SSISExecutionRuntime enumerates the values for ssis execution runtime. +type SSISExecutionRuntime string + +const ( + // X64 ... + X64 SSISExecutionRuntime = "x64" + // X86 ... + X86 SSISExecutionRuntime = "x86" +) + +// PossibleSSISExecutionRuntimeValues returns an array of possible values for the SSISExecutionRuntime const type. +func PossibleSSISExecutionRuntimeValues() []SSISExecutionRuntime { + return []SSISExecutionRuntime{X64, X86} +} + +// StoredProcedureParameterType enumerates the values for stored procedure parameter type. +type StoredProcedureParameterType string + +const ( + // Boolean ... + Boolean StoredProcedureParameterType = "Boolean" + // Date ... + Date StoredProcedureParameterType = "Date" + // Decimal ... + Decimal StoredProcedureParameterType = "Decimal" + // GUID ... + GUID StoredProcedureParameterType = "Guid" + // Int ... + Int StoredProcedureParameterType = "Int" + // String ... + String StoredProcedureParameterType = "String" +) + +// PossibleStoredProcedureParameterTypeValues returns an array of possible values for the StoredProcedureParameterType const type. +func PossibleStoredProcedureParameterTypeValues() []StoredProcedureParameterType { + return []StoredProcedureParameterType{Boolean, Date, Decimal, GUID, Int, String} +} + +// SybaseAuthenticationType enumerates the values for sybase authentication type. +type SybaseAuthenticationType string + +const ( + // SybaseAuthenticationTypeBasic ... + SybaseAuthenticationTypeBasic SybaseAuthenticationType = "Basic" + // SybaseAuthenticationTypeWindows ... + SybaseAuthenticationTypeWindows SybaseAuthenticationType = "Windows" +) + +// PossibleSybaseAuthenticationTypeValues returns an array of possible values for the SybaseAuthenticationType const type. +func PossibleSybaseAuthenticationTypeValues() []SybaseAuthenticationType { + return []SybaseAuthenticationType{SybaseAuthenticationTypeBasic, SybaseAuthenticationTypeWindows} +} + +// TeradataAuthenticationType enumerates the values for teradata authentication type. +type TeradataAuthenticationType string + +const ( + // TeradataAuthenticationTypeBasic ... + TeradataAuthenticationTypeBasic TeradataAuthenticationType = "Basic" + // TeradataAuthenticationTypeWindows ... + TeradataAuthenticationTypeWindows TeradataAuthenticationType = "Windows" +) + +// PossibleTeradataAuthenticationTypeValues returns an array of possible values for the TeradataAuthenticationType const type. +func PossibleTeradataAuthenticationTypeValues() []TeradataAuthenticationType { + return []TeradataAuthenticationType{TeradataAuthenticationTypeBasic, TeradataAuthenticationTypeWindows} +} + +// TriggerRunStatus enumerates the values for trigger run status. +type TriggerRunStatus string + +const ( + // TriggerRunStatusFailed ... + TriggerRunStatusFailed TriggerRunStatus = "Failed" + // TriggerRunStatusInprogress ... + TriggerRunStatusInprogress TriggerRunStatus = "Inprogress" + // TriggerRunStatusSucceeded ... + TriggerRunStatusSucceeded TriggerRunStatus = "Succeeded" +) + +// PossibleTriggerRunStatusValues returns an array of possible values for the TriggerRunStatus const type. +func PossibleTriggerRunStatusValues() []TriggerRunStatus { + return []TriggerRunStatus{TriggerRunStatusFailed, TriggerRunStatusInprogress, TriggerRunStatusSucceeded} +} + +// TriggerRuntimeState enumerates the values for trigger runtime state. +type TriggerRuntimeState string + +const ( + // TriggerRuntimeStateDisabled ... + TriggerRuntimeStateDisabled TriggerRuntimeState = "Disabled" + // TriggerRuntimeStateStarted ... + TriggerRuntimeStateStarted TriggerRuntimeState = "Started" + // TriggerRuntimeStateStopped ... + TriggerRuntimeStateStopped TriggerRuntimeState = "Stopped" +) + +// PossibleTriggerRuntimeStateValues returns an array of possible values for the TriggerRuntimeState const type. +func PossibleTriggerRuntimeStateValues() []TriggerRuntimeState { + return []TriggerRuntimeState{TriggerRuntimeStateDisabled, TriggerRuntimeStateStarted, TriggerRuntimeStateStopped} +} + +// TumblingWindowFrequency enumerates the values for tumbling window frequency. +type TumblingWindowFrequency string + +const ( + // TumblingWindowFrequencyHour ... + TumblingWindowFrequencyHour TumblingWindowFrequency = "Hour" + // TumblingWindowFrequencyMinute ... + TumblingWindowFrequencyMinute TumblingWindowFrequency = "Minute" +) + +// PossibleTumblingWindowFrequencyValues returns an array of possible values for the TumblingWindowFrequency const type. +func PossibleTumblingWindowFrequencyValues() []TumblingWindowFrequency { + return []TumblingWindowFrequency{TumblingWindowFrequencyHour, TumblingWindowFrequencyMinute} +} + +// Type enumerates the values for type. +type Type string + +const ( + // TypeAzureKeyVaultSecret ... + TypeAzureKeyVaultSecret Type = "AzureKeyVaultSecret" + // TypeSecretBase ... + TypeSecretBase Type = "SecretBase" + // TypeSecureString ... + TypeSecureString Type = "SecureString" +) + +// PossibleTypeValues returns an array of possible values for the Type const type. +func PossibleTypeValues() []Type { + return []Type{TypeAzureKeyVaultSecret, TypeSecretBase, TypeSecureString} +} + +// TypeBasicActivity enumerates the values for type basic activity. +type TypeBasicActivity string + +const ( + // TypeActivity ... + TypeActivity TypeBasicActivity = "Activity" + // TypeAzureMLBatchExecution ... + TypeAzureMLBatchExecution TypeBasicActivity = "AzureMLBatchExecution" + // TypeAzureMLUpdateResource ... + TypeAzureMLUpdateResource TypeBasicActivity = "AzureMLUpdateResource" + // TypeContainer ... + TypeContainer TypeBasicActivity = "Container" + // TypeCopy ... + TypeCopy TypeBasicActivity = "Copy" + // TypeCustom ... + TypeCustom TypeBasicActivity = "Custom" + // TypeDatabricksNotebook ... + TypeDatabricksNotebook TypeBasicActivity = "DatabricksNotebook" + // TypeDataLakeAnalyticsUSQL ... + TypeDataLakeAnalyticsUSQL TypeBasicActivity = "DataLakeAnalyticsU-SQL" + // TypeExecutePipeline ... + TypeExecutePipeline TypeBasicActivity = "ExecutePipeline" + // TypeExecuteSSISPackage ... + TypeExecuteSSISPackage TypeBasicActivity = "ExecuteSSISPackage" + // TypeExecution ... + TypeExecution TypeBasicActivity = "Execution" + // TypeFilter ... + TypeFilter TypeBasicActivity = "Filter" + // TypeForEach ... + TypeForEach TypeBasicActivity = "ForEach" + // TypeGetMetadata ... + TypeGetMetadata TypeBasicActivity = "GetMetadata" + // TypeHDInsightHive ... + TypeHDInsightHive TypeBasicActivity = "HDInsightHive" + // TypeHDInsightMapReduce ... + TypeHDInsightMapReduce TypeBasicActivity = "HDInsightMapReduce" + // TypeHDInsightPig ... + TypeHDInsightPig TypeBasicActivity = "HDInsightPig" + // TypeHDInsightSpark ... + TypeHDInsightSpark TypeBasicActivity = "HDInsightSpark" + // TypeHDInsightStreaming ... + TypeHDInsightStreaming TypeBasicActivity = "HDInsightStreaming" + // TypeIfCondition ... + TypeIfCondition TypeBasicActivity = "IfCondition" + // TypeLookup ... + TypeLookup TypeBasicActivity = "Lookup" + // TypeSQLServerStoredProcedure ... + TypeSQLServerStoredProcedure TypeBasicActivity = "SqlServerStoredProcedure" + // TypeUntil ... + TypeUntil TypeBasicActivity = "Until" + // TypeWait ... + TypeWait TypeBasicActivity = "Wait" + // TypeWebActivity ... + TypeWebActivity TypeBasicActivity = "WebActivity" +) + +// PossibleTypeBasicActivityValues returns an array of possible values for the TypeBasicActivity const type. +func PossibleTypeBasicActivityValues() []TypeBasicActivity { + return []TypeBasicActivity{TypeActivity, TypeAzureMLBatchExecution, TypeAzureMLUpdateResource, TypeContainer, TypeCopy, TypeCustom, TypeDatabricksNotebook, TypeDataLakeAnalyticsUSQL, TypeExecutePipeline, TypeExecuteSSISPackage, TypeExecution, TypeFilter, TypeForEach, TypeGetMetadata, TypeHDInsightHive, TypeHDInsightMapReduce, TypeHDInsightPig, TypeHDInsightSpark, TypeHDInsightStreaming, TypeIfCondition, TypeLookup, TypeSQLServerStoredProcedure, TypeUntil, TypeWait, TypeWebActivity} +} + +// TypeBasicCopySink enumerates the values for type basic copy sink. +type TypeBasicCopySink string + +const ( + // TypeAzureDataLakeStoreSink ... + TypeAzureDataLakeStoreSink TypeBasicCopySink = "AzureDataLakeStoreSink" + // TypeAzureQueueSink ... + TypeAzureQueueSink TypeBasicCopySink = "AzureQueueSink" + // TypeAzureSearchIndexSink ... + TypeAzureSearchIndexSink TypeBasicCopySink = "AzureSearchIndexSink" + // TypeAzureTableSink ... + TypeAzureTableSink TypeBasicCopySink = "AzureTableSink" + // TypeBlobSink ... + TypeBlobSink TypeBasicCopySink = "BlobSink" + // TypeCopySink ... + TypeCopySink TypeBasicCopySink = "CopySink" + // TypeDocumentDbCollectionSink ... + TypeDocumentDbCollectionSink TypeBasicCopySink = "DocumentDbCollectionSink" + // TypeDynamicsSink ... + TypeDynamicsSink TypeBasicCopySink = "DynamicsSink" + // TypeFileSystemSink ... + TypeFileSystemSink TypeBasicCopySink = "FileSystemSink" + // TypeOdbcSink ... + TypeOdbcSink TypeBasicCopySink = "OdbcSink" + // TypeOracleSink ... + TypeOracleSink TypeBasicCopySink = "OracleSink" + // TypeSalesforceSink ... + TypeSalesforceSink TypeBasicCopySink = "SalesforceSink" + // TypeSapCloudForCustomerSink ... + TypeSapCloudForCustomerSink TypeBasicCopySink = "SapCloudForCustomerSink" + // TypeSQLDWSink ... + TypeSQLDWSink TypeBasicCopySink = "SqlDWSink" + // TypeSQLSink ... + TypeSQLSink TypeBasicCopySink = "SqlSink" +) + +// PossibleTypeBasicCopySinkValues returns an array of possible values for the TypeBasicCopySink const type. +func PossibleTypeBasicCopySinkValues() []TypeBasicCopySink { + return []TypeBasicCopySink{TypeAzureDataLakeStoreSink, TypeAzureQueueSink, TypeAzureSearchIndexSink, TypeAzureTableSink, TypeBlobSink, TypeCopySink, TypeDocumentDbCollectionSink, TypeDynamicsSink, TypeFileSystemSink, TypeOdbcSink, TypeOracleSink, TypeSalesforceSink, TypeSapCloudForCustomerSink, TypeSQLDWSink, TypeSQLSink} +} + +// TypeBasicCopySource enumerates the values for type basic copy source. +type TypeBasicCopySource string + +const ( + // TypeAmazonMWSSource ... + TypeAmazonMWSSource TypeBasicCopySource = "AmazonMWSSource" + // TypeAmazonRedshiftSource ... + TypeAmazonRedshiftSource TypeBasicCopySource = "AmazonRedshiftSource" + // TypeAzureDataLakeStoreSource ... + TypeAzureDataLakeStoreSource TypeBasicCopySource = "AzureDataLakeStoreSource" + // TypeAzureMySQLSource ... + TypeAzureMySQLSource TypeBasicCopySource = "AzureMySqlSource" + // TypeAzurePostgreSQLSource ... + TypeAzurePostgreSQLSource TypeBasicCopySource = "AzurePostgreSqlSource" + // TypeAzureTableSource ... + TypeAzureTableSource TypeBasicCopySource = "AzureTableSource" + // TypeBlobSource ... + TypeBlobSource TypeBasicCopySource = "BlobSource" + // TypeCassandraSource ... + TypeCassandraSource TypeBasicCopySource = "CassandraSource" + // TypeConcurSource ... + TypeConcurSource TypeBasicCopySource = "ConcurSource" + // TypeCopySource ... + TypeCopySource TypeBasicCopySource = "CopySource" + // TypeCouchbaseSource ... + TypeCouchbaseSource TypeBasicCopySource = "CouchbaseSource" + // TypeDocumentDbCollectionSource ... + TypeDocumentDbCollectionSource TypeBasicCopySource = "DocumentDbCollectionSource" + // TypeDrillSource ... + TypeDrillSource TypeBasicCopySource = "DrillSource" + // TypeDynamicsSource ... + TypeDynamicsSource TypeBasicCopySource = "DynamicsSource" + // TypeEloquaSource ... + TypeEloquaSource TypeBasicCopySource = "EloquaSource" + // TypeFileSystemSource ... + TypeFileSystemSource TypeBasicCopySource = "FileSystemSource" + // TypeGoogleBigQuerySource ... + TypeGoogleBigQuerySource TypeBasicCopySource = "GoogleBigQuerySource" + // TypeGreenplumSource ... + TypeGreenplumSource TypeBasicCopySource = "GreenplumSource" + // TypeHBaseSource ... + TypeHBaseSource TypeBasicCopySource = "HBaseSource" + // TypeHdfsSource ... + TypeHdfsSource TypeBasicCopySource = "HdfsSource" + // TypeHiveSource ... + TypeHiveSource TypeBasicCopySource = "HiveSource" + // TypeHTTPSource ... + TypeHTTPSource TypeBasicCopySource = "HttpSource" + // TypeHubspotSource ... + TypeHubspotSource TypeBasicCopySource = "HubspotSource" + // TypeImpalaSource ... + TypeImpalaSource TypeBasicCopySource = "ImpalaSource" + // TypeJiraSource ... + TypeJiraSource TypeBasicCopySource = "JiraSource" + // TypeMagentoSource ... + TypeMagentoSource TypeBasicCopySource = "MagentoSource" + // TypeMariaDBSource ... + TypeMariaDBSource TypeBasicCopySource = "MariaDBSource" + // TypeMarketoSource ... + TypeMarketoSource TypeBasicCopySource = "MarketoSource" + // TypeMongoDbSource ... + TypeMongoDbSource TypeBasicCopySource = "MongoDbSource" + // TypeNetezzaSource ... + TypeNetezzaSource TypeBasicCopySource = "NetezzaSource" + // TypeOracleSource ... + TypeOracleSource TypeBasicCopySource = "OracleSource" + // TypePaypalSource ... + TypePaypalSource TypeBasicCopySource = "PaypalSource" + // TypePhoenixSource ... + TypePhoenixSource TypeBasicCopySource = "PhoenixSource" + // TypePrestoSource ... + TypePrestoSource TypeBasicCopySource = "PrestoSource" + // TypeQuickBooksSource ... + TypeQuickBooksSource TypeBasicCopySource = "QuickBooksSource" + // TypeRelationalSource ... + TypeRelationalSource TypeBasicCopySource = "RelationalSource" + // TypeResponsysSource ... + TypeResponsysSource TypeBasicCopySource = "ResponsysSource" + // TypeSalesforceMarketingCloudSource ... + TypeSalesforceMarketingCloudSource TypeBasicCopySource = "SalesforceMarketingCloudSource" + // TypeSalesforceSource ... + TypeSalesforceSource TypeBasicCopySource = "SalesforceSource" + // TypeSapCloudForCustomerSource ... + TypeSapCloudForCustomerSource TypeBasicCopySource = "SapCloudForCustomerSource" + // TypeSapEccSource ... + TypeSapEccSource TypeBasicCopySource = "SapEccSource" + // TypeServiceNowSource ... + TypeServiceNowSource TypeBasicCopySource = "ServiceNowSource" + // TypeShopifySource ... + TypeShopifySource TypeBasicCopySource = "ShopifySource" + // TypeSparkSource ... + TypeSparkSource TypeBasicCopySource = "SparkSource" + // TypeSQLDWSource ... + TypeSQLDWSource TypeBasicCopySource = "SqlDWSource" + // TypeSQLSource ... + TypeSQLSource TypeBasicCopySource = "SqlSource" + // TypeSquareSource ... + TypeSquareSource TypeBasicCopySource = "SquareSource" + // TypeVerticaSource ... + TypeVerticaSource TypeBasicCopySource = "VerticaSource" + // TypeWebSource ... + TypeWebSource TypeBasicCopySource = "WebSource" + // TypeXeroSource ... + TypeXeroSource TypeBasicCopySource = "XeroSource" + // TypeZohoSource ... + TypeZohoSource TypeBasicCopySource = "ZohoSource" +) + +// PossibleTypeBasicCopySourceValues returns an array of possible values for the TypeBasicCopySource const type. +func PossibleTypeBasicCopySourceValues() []TypeBasicCopySource { + return []TypeBasicCopySource{TypeAmazonMWSSource, TypeAmazonRedshiftSource, TypeAzureDataLakeStoreSource, TypeAzureMySQLSource, TypeAzurePostgreSQLSource, TypeAzureTableSource, TypeBlobSource, TypeCassandraSource, TypeConcurSource, TypeCopySource, TypeCouchbaseSource, TypeDocumentDbCollectionSource, TypeDrillSource, TypeDynamicsSource, TypeEloquaSource, TypeFileSystemSource, TypeGoogleBigQuerySource, TypeGreenplumSource, TypeHBaseSource, TypeHdfsSource, TypeHiveSource, TypeHTTPSource, TypeHubspotSource, TypeImpalaSource, TypeJiraSource, TypeMagentoSource, TypeMariaDBSource, TypeMarketoSource, TypeMongoDbSource, TypeNetezzaSource, TypeOracleSource, TypePaypalSource, TypePhoenixSource, TypePrestoSource, TypeQuickBooksSource, TypeRelationalSource, TypeResponsysSource, TypeSalesforceMarketingCloudSource, TypeSalesforceSource, TypeSapCloudForCustomerSource, TypeSapEccSource, TypeServiceNowSource, TypeShopifySource, TypeSparkSource, TypeSQLDWSource, TypeSQLSource, TypeSquareSource, TypeVerticaSource, TypeWebSource, TypeXeroSource, TypeZohoSource} +} + +// TypeBasicCopyTranslator enumerates the values for type basic copy translator. +type TypeBasicCopyTranslator string + +const ( + // TypeCopyTranslator ... + TypeCopyTranslator TypeBasicCopyTranslator = "CopyTranslator" + // TypeTabularTranslator ... + TypeTabularTranslator TypeBasicCopyTranslator = "TabularTranslator" +) + +// PossibleTypeBasicCopyTranslatorValues returns an array of possible values for the TypeBasicCopyTranslator const type. +func PossibleTypeBasicCopyTranslatorValues() []TypeBasicCopyTranslator { + return []TypeBasicCopyTranslator{TypeCopyTranslator, TypeTabularTranslator} +} + +// TypeBasicDataset enumerates the values for type basic dataset. +type TypeBasicDataset string + +const ( + // TypeAmazonMWSObject ... + TypeAmazonMWSObject TypeBasicDataset = "AmazonMWSObject" + // TypeAmazonS3Object ... + TypeAmazonS3Object TypeBasicDataset = "AmazonS3Object" + // TypeAzureBlob ... + TypeAzureBlob TypeBasicDataset = "AzureBlob" + // TypeAzureDataLakeStoreFile ... + TypeAzureDataLakeStoreFile TypeBasicDataset = "AzureDataLakeStoreFile" + // TypeAzureMySQLTable ... + TypeAzureMySQLTable TypeBasicDataset = "AzureMySqlTable" + // TypeAzurePostgreSQLTable ... + TypeAzurePostgreSQLTable TypeBasicDataset = "AzurePostgreSqlTable" + // TypeAzureSearchIndex ... + TypeAzureSearchIndex TypeBasicDataset = "AzureSearchIndex" + // TypeAzureSQLDWTable ... + TypeAzureSQLDWTable TypeBasicDataset = "AzureSqlDWTable" + // TypeAzureSQLTable ... + TypeAzureSQLTable TypeBasicDataset = "AzureSqlTable" + // TypeAzureTable ... + TypeAzureTable TypeBasicDataset = "AzureTable" + // TypeCassandraTable ... + TypeCassandraTable TypeBasicDataset = "CassandraTable" + // TypeConcurObject ... + TypeConcurObject TypeBasicDataset = "ConcurObject" + // TypeCouchbaseTable ... + TypeCouchbaseTable TypeBasicDataset = "CouchbaseTable" + // TypeCustomDataset ... + TypeCustomDataset TypeBasicDataset = "CustomDataset" + // TypeDataset ... + TypeDataset TypeBasicDataset = "Dataset" + // TypeDocumentDbCollection ... + TypeDocumentDbCollection TypeBasicDataset = "DocumentDbCollection" + // TypeDrillTable ... + TypeDrillTable TypeBasicDataset = "DrillTable" + // TypeDynamicsEntity ... + TypeDynamicsEntity TypeBasicDataset = "DynamicsEntity" + // TypeEloquaObject ... + TypeEloquaObject TypeBasicDataset = "EloquaObject" + // TypeFileShare ... + TypeFileShare TypeBasicDataset = "FileShare" + // TypeGoogleBigQueryObject ... + TypeGoogleBigQueryObject TypeBasicDataset = "GoogleBigQueryObject" + // TypeGreenplumTable ... + TypeGreenplumTable TypeBasicDataset = "GreenplumTable" + // TypeHBaseObject ... + TypeHBaseObject TypeBasicDataset = "HBaseObject" + // TypeHiveObject ... + TypeHiveObject TypeBasicDataset = "HiveObject" + // TypeHTTPFile ... + TypeHTTPFile TypeBasicDataset = "HttpFile" + // TypeHubspotObject ... + TypeHubspotObject TypeBasicDataset = "HubspotObject" + // TypeImpalaObject ... + TypeImpalaObject TypeBasicDataset = "ImpalaObject" + // TypeJiraObject ... + TypeJiraObject TypeBasicDataset = "JiraObject" + // TypeMagentoObject ... + TypeMagentoObject TypeBasicDataset = "MagentoObject" + // TypeMariaDBTable ... + TypeMariaDBTable TypeBasicDataset = "MariaDBTable" + // TypeMarketoObject ... + TypeMarketoObject TypeBasicDataset = "MarketoObject" + // TypeMongoDbCollection ... + TypeMongoDbCollection TypeBasicDataset = "MongoDbCollection" + // TypeNetezzaTable ... + TypeNetezzaTable TypeBasicDataset = "NetezzaTable" + // TypeODataResource ... + TypeODataResource TypeBasicDataset = "ODataResource" + // TypeOracleTable ... + TypeOracleTable TypeBasicDataset = "OracleTable" + // TypePaypalObject ... + TypePaypalObject TypeBasicDataset = "PaypalObject" + // TypePhoenixObject ... + TypePhoenixObject TypeBasicDataset = "PhoenixObject" + // TypePrestoObject ... + TypePrestoObject TypeBasicDataset = "PrestoObject" + // TypeQuickBooksObject ... + TypeQuickBooksObject TypeBasicDataset = "QuickBooksObject" + // TypeRelationalTable ... + TypeRelationalTable TypeBasicDataset = "RelationalTable" + // TypeResponsysObject ... + TypeResponsysObject TypeBasicDataset = "ResponsysObject" + // TypeSalesforceMarketingCloudObject ... + TypeSalesforceMarketingCloudObject TypeBasicDataset = "SalesforceMarketingCloudObject" + // TypeSalesforceObject ... + TypeSalesforceObject TypeBasicDataset = "SalesforceObject" + // TypeSapCloudForCustomerResource ... + TypeSapCloudForCustomerResource TypeBasicDataset = "SapCloudForCustomerResource" + // TypeSapEccResource ... + TypeSapEccResource TypeBasicDataset = "SapEccResource" + // TypeServiceNowObject ... + TypeServiceNowObject TypeBasicDataset = "ServiceNowObject" + // TypeShopifyObject ... + TypeShopifyObject TypeBasicDataset = "ShopifyObject" + // TypeSparkObject ... + TypeSparkObject TypeBasicDataset = "SparkObject" + // TypeSQLServerTable ... + TypeSQLServerTable TypeBasicDataset = "SqlServerTable" + // TypeSquareObject ... + TypeSquareObject TypeBasicDataset = "SquareObject" + // TypeVerticaTable ... + TypeVerticaTable TypeBasicDataset = "VerticaTable" + // TypeWebTable ... + TypeWebTable TypeBasicDataset = "WebTable" + // TypeXeroObject ... + TypeXeroObject TypeBasicDataset = "XeroObject" + // TypeZohoObject ... + TypeZohoObject TypeBasicDataset = "ZohoObject" +) + +// PossibleTypeBasicDatasetValues returns an array of possible values for the TypeBasicDataset const type. +func PossibleTypeBasicDatasetValues() []TypeBasicDataset { + return []TypeBasicDataset{TypeAmazonMWSObject, TypeAmazonS3Object, TypeAzureBlob, TypeAzureDataLakeStoreFile, TypeAzureMySQLTable, TypeAzurePostgreSQLTable, TypeAzureSearchIndex, TypeAzureSQLDWTable, TypeAzureSQLTable, TypeAzureTable, TypeCassandraTable, TypeConcurObject, TypeCouchbaseTable, TypeCustomDataset, TypeDataset, TypeDocumentDbCollection, TypeDrillTable, TypeDynamicsEntity, TypeEloquaObject, TypeFileShare, TypeGoogleBigQueryObject, TypeGreenplumTable, TypeHBaseObject, TypeHiveObject, TypeHTTPFile, TypeHubspotObject, TypeImpalaObject, TypeJiraObject, TypeMagentoObject, TypeMariaDBTable, TypeMarketoObject, TypeMongoDbCollection, TypeNetezzaTable, TypeODataResource, TypeOracleTable, TypePaypalObject, TypePhoenixObject, TypePrestoObject, TypeQuickBooksObject, TypeRelationalTable, TypeResponsysObject, TypeSalesforceMarketingCloudObject, TypeSalesforceObject, TypeSapCloudForCustomerResource, TypeSapEccResource, TypeServiceNowObject, TypeShopifyObject, TypeSparkObject, TypeSQLServerTable, TypeSquareObject, TypeVerticaTable, TypeWebTable, TypeXeroObject, TypeZohoObject} +} + +// TypeBasicDatasetCompression enumerates the values for type basic dataset compression. +type TypeBasicDatasetCompression string + +const ( + // TypeBZip2 ... + TypeBZip2 TypeBasicDatasetCompression = "BZip2" + // TypeDatasetCompression ... + TypeDatasetCompression TypeBasicDatasetCompression = "DatasetCompression" + // TypeDeflate ... + TypeDeflate TypeBasicDatasetCompression = "Deflate" + // TypeGZip ... + TypeGZip TypeBasicDatasetCompression = "GZip" + // TypeZipDeflate ... + TypeZipDeflate TypeBasicDatasetCompression = "ZipDeflate" +) + +// PossibleTypeBasicDatasetCompressionValues returns an array of possible values for the TypeBasicDatasetCompression const type. +func PossibleTypeBasicDatasetCompressionValues() []TypeBasicDatasetCompression { + return []TypeBasicDatasetCompression{TypeBZip2, TypeDatasetCompression, TypeDeflate, TypeGZip, TypeZipDeflate} +} + +// TypeBasicDatasetStorageFormat enumerates the values for type basic dataset storage format. +type TypeBasicDatasetStorageFormat string + +const ( + // TypeAvroFormat ... + TypeAvroFormat TypeBasicDatasetStorageFormat = "AvroFormat" + // TypeDatasetStorageFormat ... + TypeDatasetStorageFormat TypeBasicDatasetStorageFormat = "DatasetStorageFormat" + // TypeJSONFormat ... + TypeJSONFormat TypeBasicDatasetStorageFormat = "JsonFormat" + // TypeOrcFormat ... + TypeOrcFormat TypeBasicDatasetStorageFormat = "OrcFormat" + // TypeParquetFormat ... + TypeParquetFormat TypeBasicDatasetStorageFormat = "ParquetFormat" + // TypeTextFormat ... + TypeTextFormat TypeBasicDatasetStorageFormat = "TextFormat" +) + +// PossibleTypeBasicDatasetStorageFormatValues returns an array of possible values for the TypeBasicDatasetStorageFormat const type. +func PossibleTypeBasicDatasetStorageFormatValues() []TypeBasicDatasetStorageFormat { + return []TypeBasicDatasetStorageFormat{TypeAvroFormat, TypeDatasetStorageFormat, TypeJSONFormat, TypeOrcFormat, TypeParquetFormat, TypeTextFormat} +} + +// TypeBasicFactoryRepoConfiguration enumerates the values for type basic factory repo configuration. +type TypeBasicFactoryRepoConfiguration string + +const ( + // TypeFactoryGithubConfiguration ... + TypeFactoryGithubConfiguration TypeBasicFactoryRepoConfiguration = "FactoryGithubConfiguration" + // TypeFactoryRepoConfiguration ... + TypeFactoryRepoConfiguration TypeBasicFactoryRepoConfiguration = "FactoryRepoConfiguration" + // TypeFactoryVSTSConfiguration ... + TypeFactoryVSTSConfiguration TypeBasicFactoryRepoConfiguration = "FactoryVSTSConfiguration" +) + +// PossibleTypeBasicFactoryRepoConfigurationValues returns an array of possible values for the TypeBasicFactoryRepoConfiguration const type. +func PossibleTypeBasicFactoryRepoConfigurationValues() []TypeBasicFactoryRepoConfiguration { + return []TypeBasicFactoryRepoConfiguration{TypeFactoryGithubConfiguration, TypeFactoryRepoConfiguration, TypeFactoryVSTSConfiguration} +} + +// TypeBasicIntegrationRuntime enumerates the values for type basic integration runtime. +type TypeBasicIntegrationRuntime string + +const ( + // TypeIntegrationRuntime ... + TypeIntegrationRuntime TypeBasicIntegrationRuntime = "IntegrationRuntime" + // TypeManaged ... + TypeManaged TypeBasicIntegrationRuntime = "Managed" + // TypeSelfHosted ... + TypeSelfHosted TypeBasicIntegrationRuntime = "SelfHosted" +) + +// PossibleTypeBasicIntegrationRuntimeValues returns an array of possible values for the TypeBasicIntegrationRuntime const type. +func PossibleTypeBasicIntegrationRuntimeValues() []TypeBasicIntegrationRuntime { + return []TypeBasicIntegrationRuntime{TypeIntegrationRuntime, TypeManaged, TypeSelfHosted} +} + +// TypeBasicIntegrationRuntimeStatus enumerates the values for type basic integration runtime status. +type TypeBasicIntegrationRuntimeStatus string + +const ( + // TypeBasicIntegrationRuntimeStatusTypeIntegrationRuntimeStatus ... + TypeBasicIntegrationRuntimeStatusTypeIntegrationRuntimeStatus TypeBasicIntegrationRuntimeStatus = "IntegrationRuntimeStatus" + // TypeBasicIntegrationRuntimeStatusTypeManaged ... + TypeBasicIntegrationRuntimeStatusTypeManaged TypeBasicIntegrationRuntimeStatus = "Managed" + // TypeBasicIntegrationRuntimeStatusTypeSelfHosted ... + TypeBasicIntegrationRuntimeStatusTypeSelfHosted TypeBasicIntegrationRuntimeStatus = "SelfHosted" +) + +// PossibleTypeBasicIntegrationRuntimeStatusValues returns an array of possible values for the TypeBasicIntegrationRuntimeStatus const type. +func PossibleTypeBasicIntegrationRuntimeStatusValues() []TypeBasicIntegrationRuntimeStatus { + return []TypeBasicIntegrationRuntimeStatus{TypeBasicIntegrationRuntimeStatusTypeIntegrationRuntimeStatus, TypeBasicIntegrationRuntimeStatusTypeManaged, TypeBasicIntegrationRuntimeStatusTypeSelfHosted} +} + +// TypeBasicLinkedService enumerates the values for type basic linked service. +type TypeBasicLinkedService string + +const ( + // TypeAmazonMWS ... + TypeAmazonMWS TypeBasicLinkedService = "AmazonMWS" + // TypeAmazonRedshift ... + TypeAmazonRedshift TypeBasicLinkedService = "AmazonRedshift" + // TypeAmazonS3 ... + TypeAmazonS3 TypeBasicLinkedService = "AmazonS3" + // TypeAzureBatch ... + TypeAzureBatch TypeBasicLinkedService = "AzureBatch" + // TypeAzureDatabricks ... + TypeAzureDatabricks TypeBasicLinkedService = "AzureDatabricks" + // TypeAzureDataLakeAnalytics ... + TypeAzureDataLakeAnalytics TypeBasicLinkedService = "AzureDataLakeAnalytics" + // TypeAzureDataLakeStore ... + TypeAzureDataLakeStore TypeBasicLinkedService = "AzureDataLakeStore" + // TypeAzureKeyVault ... + TypeAzureKeyVault TypeBasicLinkedService = "AzureKeyVault" + // TypeAzureML ... + TypeAzureML TypeBasicLinkedService = "AzureML" + // TypeAzureMySQL ... + TypeAzureMySQL TypeBasicLinkedService = "AzureMySql" + // TypeAzurePostgreSQL ... + TypeAzurePostgreSQL TypeBasicLinkedService = "AzurePostgreSql" + // TypeAzureSearch ... + TypeAzureSearch TypeBasicLinkedService = "AzureSearch" + // TypeAzureSQLDatabase ... + TypeAzureSQLDatabase TypeBasicLinkedService = "AzureSqlDatabase" + // TypeAzureSQLDW ... + TypeAzureSQLDW TypeBasicLinkedService = "AzureSqlDW" + // TypeAzureStorage ... + TypeAzureStorage TypeBasicLinkedService = "AzureStorage" + // TypeCassandra ... + TypeCassandra TypeBasicLinkedService = "Cassandra" + // TypeConcur ... + TypeConcur TypeBasicLinkedService = "Concur" + // TypeCosmosDb ... + TypeCosmosDb TypeBasicLinkedService = "CosmosDb" + // TypeCouchbase ... + TypeCouchbase TypeBasicLinkedService = "Couchbase" + // TypeCustomDataSource ... + TypeCustomDataSource TypeBasicLinkedService = "CustomDataSource" + // TypeDb2 ... + TypeDb2 TypeBasicLinkedService = "Db2" + // TypeDrill ... + TypeDrill TypeBasicLinkedService = "Drill" + // TypeDynamics ... + TypeDynamics TypeBasicLinkedService = "Dynamics" + // TypeEloqua ... + TypeEloqua TypeBasicLinkedService = "Eloqua" + // TypeFileServer ... + TypeFileServer TypeBasicLinkedService = "FileServer" + // TypeFtpServer ... + TypeFtpServer TypeBasicLinkedService = "FtpServer" + // TypeGoogleBigQuery ... + TypeGoogleBigQuery TypeBasicLinkedService = "GoogleBigQuery" + // TypeGreenplum ... + TypeGreenplum TypeBasicLinkedService = "Greenplum" + // TypeHBase ... + TypeHBase TypeBasicLinkedService = "HBase" + // TypeHdfs ... + TypeHdfs TypeBasicLinkedService = "Hdfs" + // TypeHDInsight ... + TypeHDInsight TypeBasicLinkedService = "HDInsight" + // TypeHDInsightOnDemand ... + TypeHDInsightOnDemand TypeBasicLinkedService = "HDInsightOnDemand" + // TypeHive ... + TypeHive TypeBasicLinkedService = "Hive" + // TypeHTTPServer ... + TypeHTTPServer TypeBasicLinkedService = "HttpServer" + // TypeHubspot ... + TypeHubspot TypeBasicLinkedService = "Hubspot" + // TypeImpala ... + TypeImpala TypeBasicLinkedService = "Impala" + // TypeJira ... + TypeJira TypeBasicLinkedService = "Jira" + // TypeLinkedService ... + TypeLinkedService TypeBasicLinkedService = "LinkedService" + // TypeMagento ... + TypeMagento TypeBasicLinkedService = "Magento" + // TypeMariaDB ... + TypeMariaDB TypeBasicLinkedService = "MariaDB" + // TypeMarketo ... + TypeMarketo TypeBasicLinkedService = "Marketo" + // TypeMongoDb ... + TypeMongoDb TypeBasicLinkedService = "MongoDb" + // TypeMySQL ... + TypeMySQL TypeBasicLinkedService = "MySql" + // TypeNetezza ... + TypeNetezza TypeBasicLinkedService = "Netezza" + // TypeOData ... + TypeOData TypeBasicLinkedService = "OData" + // TypeOdbc ... + TypeOdbc TypeBasicLinkedService = "Odbc" + // TypeOracle ... + TypeOracle TypeBasicLinkedService = "Oracle" + // TypePaypal ... + TypePaypal TypeBasicLinkedService = "Paypal" + // TypePhoenix ... + TypePhoenix TypeBasicLinkedService = "Phoenix" + // TypePostgreSQL ... + TypePostgreSQL TypeBasicLinkedService = "PostgreSql" + // TypePresto ... + TypePresto TypeBasicLinkedService = "Presto" + // TypeQuickBooks ... + TypeQuickBooks TypeBasicLinkedService = "QuickBooks" + // TypeResponsys ... + TypeResponsys TypeBasicLinkedService = "Responsys" + // TypeSalesforce ... + TypeSalesforce TypeBasicLinkedService = "Salesforce" + // TypeSalesforceMarketingCloud ... + TypeSalesforceMarketingCloud TypeBasicLinkedService = "SalesforceMarketingCloud" + // TypeSapBW ... + TypeSapBW TypeBasicLinkedService = "SapBW" + // TypeSapCloudForCustomer ... + TypeSapCloudForCustomer TypeBasicLinkedService = "SapCloudForCustomer" + // TypeSapEcc ... + TypeSapEcc TypeBasicLinkedService = "SapEcc" + // TypeSapHana ... + TypeSapHana TypeBasicLinkedService = "SapHana" + // TypeServiceNow ... + TypeServiceNow TypeBasicLinkedService = "ServiceNow" + // TypeSftp ... + TypeSftp TypeBasicLinkedService = "Sftp" + // TypeShopify ... + TypeShopify TypeBasicLinkedService = "Shopify" + // TypeSpark ... + TypeSpark TypeBasicLinkedService = "Spark" + // TypeSQLServer ... + TypeSQLServer TypeBasicLinkedService = "SqlServer" + // TypeSquare ... + TypeSquare TypeBasicLinkedService = "Square" + // TypeSybase ... + TypeSybase TypeBasicLinkedService = "Sybase" + // TypeTeradata ... + TypeTeradata TypeBasicLinkedService = "Teradata" + // TypeVertica ... + TypeVertica TypeBasicLinkedService = "Vertica" + // TypeWeb ... + TypeWeb TypeBasicLinkedService = "Web" + // TypeXero ... + TypeXero TypeBasicLinkedService = "Xero" + // TypeZoho ... + TypeZoho TypeBasicLinkedService = "Zoho" +) + +// PossibleTypeBasicLinkedServiceValues returns an array of possible values for the TypeBasicLinkedService const type. +func PossibleTypeBasicLinkedServiceValues() []TypeBasicLinkedService { + return []TypeBasicLinkedService{TypeAmazonMWS, TypeAmazonRedshift, TypeAmazonS3, TypeAzureBatch, TypeAzureDatabricks, TypeAzureDataLakeAnalytics, TypeAzureDataLakeStore, TypeAzureKeyVault, TypeAzureML, TypeAzureMySQL, TypeAzurePostgreSQL, TypeAzureSearch, TypeAzureSQLDatabase, TypeAzureSQLDW, TypeAzureStorage, TypeCassandra, TypeConcur, TypeCosmosDb, TypeCouchbase, TypeCustomDataSource, TypeDb2, TypeDrill, TypeDynamics, TypeEloqua, TypeFileServer, TypeFtpServer, TypeGoogleBigQuery, TypeGreenplum, TypeHBase, TypeHdfs, TypeHDInsight, TypeHDInsightOnDemand, TypeHive, TypeHTTPServer, TypeHubspot, TypeImpala, TypeJira, TypeLinkedService, TypeMagento, TypeMariaDB, TypeMarketo, TypeMongoDb, TypeMySQL, TypeNetezza, TypeOData, TypeOdbc, TypeOracle, TypePaypal, TypePhoenix, TypePostgreSQL, TypePresto, TypeQuickBooks, TypeResponsys, TypeSalesforce, TypeSalesforceMarketingCloud, TypeSapBW, TypeSapCloudForCustomer, TypeSapEcc, TypeSapHana, TypeServiceNow, TypeSftp, TypeShopify, TypeSpark, TypeSQLServer, TypeSquare, TypeSybase, TypeTeradata, TypeVertica, TypeWeb, TypeXero, TypeZoho} +} + +// TypeBasicTrigger enumerates the values for type basic trigger. +type TypeBasicTrigger string + +const ( + // TypeBlobEventsTrigger ... + TypeBlobEventsTrigger TypeBasicTrigger = "BlobEventsTrigger" + // TypeBlobTrigger ... + TypeBlobTrigger TypeBasicTrigger = "BlobTrigger" + // TypeMultiplePipelineTrigger ... + TypeMultiplePipelineTrigger TypeBasicTrigger = "MultiplePipelineTrigger" + // TypeScheduleTrigger ... + TypeScheduleTrigger TypeBasicTrigger = "ScheduleTrigger" + // TypeTrigger ... + TypeTrigger TypeBasicTrigger = "Trigger" + // TypeTumblingWindowTrigger ... + TypeTumblingWindowTrigger TypeBasicTrigger = "TumblingWindowTrigger" +) + +// PossibleTypeBasicTriggerValues returns an array of possible values for the TypeBasicTrigger const type. +func PossibleTypeBasicTriggerValues() []TypeBasicTrigger { + return []TypeBasicTrigger{TypeBlobEventsTrigger, TypeBlobTrigger, TypeMultiplePipelineTrigger, TypeScheduleTrigger, TypeTrigger, TypeTumblingWindowTrigger} +} + +// WebActivityMethod enumerates the values for web activity method. +type WebActivityMethod string + +const ( + // DELETE ... + DELETE WebActivityMethod = "DELETE" + // GET ... + GET WebActivityMethod = "GET" + // POST ... + POST WebActivityMethod = "POST" + // PUT ... + PUT WebActivityMethod = "PUT" +) + +// PossibleWebActivityMethodValues returns an array of possible values for the WebActivityMethod const type. +func PossibleWebActivityMethodValues() []WebActivityMethod { + return []WebActivityMethod{DELETE, GET, POST, PUT} +} + +// BasicActivity a pipeline activity. +type BasicActivity interface { + AsDatabricksNotebookActivity() (*DatabricksNotebookActivity, bool) + AsDataLakeAnalyticsUSQLActivity() (*DataLakeAnalyticsUSQLActivity, bool) + AsAzureMLUpdateResourceActivity() (*AzureMLUpdateResourceActivity, bool) + AsAzureMLBatchExecutionActivity() (*AzureMLBatchExecutionActivity, bool) + AsGetMetadataActivity() (*GetMetadataActivity, bool) + AsWebActivity() (*WebActivity, bool) + AsLookupActivity() (*LookupActivity, bool) + AsSQLServerStoredProcedureActivity() (*SQLServerStoredProcedureActivity, bool) + AsCustomActivity() (*CustomActivity, bool) + AsExecuteSSISPackageActivity() (*ExecuteSSISPackageActivity, bool) + AsHDInsightSparkActivity() (*HDInsightSparkActivity, bool) + AsHDInsightStreamingActivity() (*HDInsightStreamingActivity, bool) + AsHDInsightMapReduceActivity() (*HDInsightMapReduceActivity, bool) + AsHDInsightPigActivity() (*HDInsightPigActivity, bool) + AsHDInsightHiveActivity() (*HDInsightHiveActivity, bool) + AsCopyActivity() (*CopyActivity, bool) + AsExecutionActivity() (*ExecutionActivity, bool) + AsBasicExecutionActivity() (BasicExecutionActivity, bool) + AsFilterActivity() (*FilterActivity, bool) + AsUntilActivity() (*UntilActivity, bool) + AsWaitActivity() (*WaitActivity, bool) + AsForEachActivity() (*ForEachActivity, bool) + AsIfConditionActivity() (*IfConditionActivity, bool) + AsExecutePipelineActivity() (*ExecutePipelineActivity, bool) + AsControlActivity() (*ControlActivity, bool) + AsBasicControlActivity() (BasicControlActivity, bool) + AsActivity() (*Activity, bool) +} + +// Activity a pipeline activity. +type Activity struct { + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Name - Activity name. + Name *string `json:"name,omitempty"` + // Description - Activity description. + Description *string `json:"description,omitempty"` + // DependsOn - Activity depends on condition. + DependsOn *[]ActivityDependency `json:"dependsOn,omitempty"` + // UserProperties - Activity user properties. + UserProperties map[string]*string `json:"userProperties"` + // Type - Possible values include: 'TypeActivity', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLUpdateResource', 'TypeAzureMLBatchExecution', 'TypeGetMetadata', 'TypeWebActivity', 'TypeLookup', 'TypeSQLServerStoredProcedure', 'TypeCustom', 'TypeExecuteSSISPackage', 'TypeHDInsightSpark', 'TypeHDInsightStreaming', 'TypeHDInsightMapReduce', 'TypeHDInsightPig', 'TypeHDInsightHive', 'TypeCopy', 'TypeExecution', 'TypeFilter', 'TypeUntil', 'TypeWait', 'TypeForEach', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' + Type TypeBasicActivity `json:"type,omitempty"` +} + +func unmarshalBasicActivity(body []byte) (BasicActivity, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["type"] { + case string(TypeDatabricksNotebook): + var dna DatabricksNotebookActivity + err := json.Unmarshal(body, &dna) + return dna, err + case string(TypeDataLakeAnalyticsUSQL): + var dlaua DataLakeAnalyticsUSQLActivity + err := json.Unmarshal(body, &dlaua) + return dlaua, err + case string(TypeAzureMLUpdateResource): + var amura AzureMLUpdateResourceActivity + err := json.Unmarshal(body, &amura) + return amura, err + case string(TypeAzureMLBatchExecution): + var ambea AzureMLBatchExecutionActivity + err := json.Unmarshal(body, &ambea) + return ambea, err + case string(TypeGetMetadata): + var gma GetMetadataActivity + err := json.Unmarshal(body, &gma) + return gma, err + case string(TypeWebActivity): + var wa WebActivity + err := json.Unmarshal(body, &wa) + return wa, err + case string(TypeLookup): + var la LookupActivity + err := json.Unmarshal(body, &la) + return la, err + case string(TypeSQLServerStoredProcedure): + var ssspa SQLServerStoredProcedureActivity + err := json.Unmarshal(body, &ssspa) + return ssspa, err + case string(TypeCustom): + var ca CustomActivity + err := json.Unmarshal(body, &ca) + return ca, err + case string(TypeExecuteSSISPackage): + var espa ExecuteSSISPackageActivity + err := json.Unmarshal(body, &espa) + return espa, err + case string(TypeHDInsightSpark): + var hisa HDInsightSparkActivity + err := json.Unmarshal(body, &hisa) + return hisa, err + case string(TypeHDInsightStreaming): + var hisa HDInsightStreamingActivity + err := json.Unmarshal(body, &hisa) + return hisa, err + case string(TypeHDInsightMapReduce): + var himra HDInsightMapReduceActivity + err := json.Unmarshal(body, &himra) + return himra, err + case string(TypeHDInsightPig): + var hipa HDInsightPigActivity + err := json.Unmarshal(body, &hipa) + return hipa, err + case string(TypeHDInsightHive): + var hiha HDInsightHiveActivity + err := json.Unmarshal(body, &hiha) + return hiha, err + case string(TypeCopy): + var ca CopyActivity + err := json.Unmarshal(body, &ca) + return ca, err + case string(TypeExecution): + var ea ExecutionActivity + err := json.Unmarshal(body, &ea) + return ea, err + case string(TypeFilter): + var fa FilterActivity + err := json.Unmarshal(body, &fa) + return fa, err + case string(TypeUntil): + var ua UntilActivity + err := json.Unmarshal(body, &ua) + return ua, err + case string(TypeWait): + var wa WaitActivity + err := json.Unmarshal(body, &wa) + return wa, err + case string(TypeForEach): + var fea ForEachActivity + err := json.Unmarshal(body, &fea) + return fea, err + case string(TypeIfCondition): + var ica IfConditionActivity + err := json.Unmarshal(body, &ica) + return ica, err + case string(TypeExecutePipeline): + var epa ExecutePipelineActivity + err := json.Unmarshal(body, &epa) + return epa, err + case string(TypeContainer): + var ca ControlActivity + err := json.Unmarshal(body, &ca) + return ca, err + default: + var a Activity + err := json.Unmarshal(body, &a) + return a, err + } +} +func unmarshalBasicActivityArray(body []byte) ([]BasicActivity, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + aArray := make([]BasicActivity, len(rawMessages)) + + for index, rawMessage := range rawMessages { + a, err := unmarshalBasicActivity(*rawMessage) + if err != nil { + return nil, err + } + aArray[index] = a + } + return aArray, nil +} + +// MarshalJSON is the custom marshaler for Activity. +func (a Activity) MarshalJSON() ([]byte, error) { + a.Type = TypeActivity + objectMap := make(map[string]interface{}) + if a.Name != nil { + objectMap["name"] = a.Name + } + if a.Description != nil { + objectMap["description"] = a.Description + } + if a.DependsOn != nil { + objectMap["dependsOn"] = a.DependsOn + } + if a.UserProperties != nil { + objectMap["userProperties"] = a.UserProperties + } + if a.Type != "" { + objectMap["type"] = a.Type + } + for k, v := range a.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsDatabricksNotebookActivity is the BasicActivity implementation for Activity. +func (a Activity) AsDatabricksNotebookActivity() (*DatabricksNotebookActivity, bool) { + return nil, false +} + +// AsDataLakeAnalyticsUSQLActivity is the BasicActivity implementation for Activity. +func (a Activity) AsDataLakeAnalyticsUSQLActivity() (*DataLakeAnalyticsUSQLActivity, bool) { + return nil, false +} + +// AsAzureMLUpdateResourceActivity is the BasicActivity implementation for Activity. +func (a Activity) AsAzureMLUpdateResourceActivity() (*AzureMLUpdateResourceActivity, bool) { + return nil, false +} + +// AsAzureMLBatchExecutionActivity is the BasicActivity implementation for Activity. +func (a Activity) AsAzureMLBatchExecutionActivity() (*AzureMLBatchExecutionActivity, bool) { + return nil, false +} + +// AsGetMetadataActivity is the BasicActivity implementation for Activity. +func (a Activity) AsGetMetadataActivity() (*GetMetadataActivity, bool) { + return nil, false +} + +// AsWebActivity is the BasicActivity implementation for Activity. +func (a Activity) AsWebActivity() (*WebActivity, bool) { + return nil, false +} + +// AsLookupActivity is the BasicActivity implementation for Activity. +func (a Activity) AsLookupActivity() (*LookupActivity, bool) { + return nil, false +} + +// AsSQLServerStoredProcedureActivity is the BasicActivity implementation for Activity. +func (a Activity) AsSQLServerStoredProcedureActivity() (*SQLServerStoredProcedureActivity, bool) { + return nil, false +} + +// AsCustomActivity is the BasicActivity implementation for Activity. +func (a Activity) AsCustomActivity() (*CustomActivity, bool) { + return nil, false +} + +// AsExecuteSSISPackageActivity is the BasicActivity implementation for Activity. +func (a Activity) AsExecuteSSISPackageActivity() (*ExecuteSSISPackageActivity, bool) { + return nil, false +} + +// AsHDInsightSparkActivity is the BasicActivity implementation for Activity. +func (a Activity) AsHDInsightSparkActivity() (*HDInsightSparkActivity, bool) { + return nil, false +} + +// AsHDInsightStreamingActivity is the BasicActivity implementation for Activity. +func (a Activity) AsHDInsightStreamingActivity() (*HDInsightStreamingActivity, bool) { + return nil, false +} + +// AsHDInsightMapReduceActivity is the BasicActivity implementation for Activity. +func (a Activity) AsHDInsightMapReduceActivity() (*HDInsightMapReduceActivity, bool) { + return nil, false +} + +// AsHDInsightPigActivity is the BasicActivity implementation for Activity. +func (a Activity) AsHDInsightPigActivity() (*HDInsightPigActivity, bool) { + return nil, false +} + +// AsHDInsightHiveActivity is the BasicActivity implementation for Activity. +func (a Activity) AsHDInsightHiveActivity() (*HDInsightHiveActivity, bool) { + return nil, false +} + +// AsCopyActivity is the BasicActivity implementation for Activity. +func (a Activity) AsCopyActivity() (*CopyActivity, bool) { + return nil, false +} + +// AsExecutionActivity is the BasicActivity implementation for Activity. +func (a Activity) AsExecutionActivity() (*ExecutionActivity, bool) { + return nil, false +} + +// AsBasicExecutionActivity is the BasicActivity implementation for Activity. +func (a Activity) AsBasicExecutionActivity() (BasicExecutionActivity, bool) { + return nil, false +} + +// AsFilterActivity is the BasicActivity implementation for Activity. +func (a Activity) AsFilterActivity() (*FilterActivity, bool) { + return nil, false +} + +// AsUntilActivity is the BasicActivity implementation for Activity. +func (a Activity) AsUntilActivity() (*UntilActivity, bool) { + return nil, false +} + +// AsWaitActivity is the BasicActivity implementation for Activity. +func (a Activity) AsWaitActivity() (*WaitActivity, bool) { + return nil, false +} + +// AsForEachActivity is the BasicActivity implementation for Activity. +func (a Activity) AsForEachActivity() (*ForEachActivity, bool) { + return nil, false +} + +// AsIfConditionActivity is the BasicActivity implementation for Activity. +func (a Activity) AsIfConditionActivity() (*IfConditionActivity, bool) { + return nil, false +} + +// AsExecutePipelineActivity is the BasicActivity implementation for Activity. +func (a Activity) AsExecutePipelineActivity() (*ExecutePipelineActivity, bool) { + return nil, false +} + +// AsControlActivity is the BasicActivity implementation for Activity. +func (a Activity) AsControlActivity() (*ControlActivity, bool) { + return nil, false +} + +// AsBasicControlActivity is the BasicActivity implementation for Activity. +func (a Activity) AsBasicControlActivity() (BasicControlActivity, bool) { + return nil, false +} + +// AsActivity is the BasicActivity implementation for Activity. +func (a Activity) AsActivity() (*Activity, bool) { + return &a, true +} + +// AsBasicActivity is the BasicActivity implementation for Activity. +func (a Activity) AsBasicActivity() (BasicActivity, bool) { + return &a, true +} + +// ActivityDependency activity dependency information. +type ActivityDependency struct { + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Activity - Activity name. + Activity *string `json:"activity,omitempty"` + // DependencyConditions - Match-Condition for the dependency. + DependencyConditions *[]DependencyCondition `json:"dependencyConditions,omitempty"` +} + +// MarshalJSON is the custom marshaler for ActivityDependency. +func (ad ActivityDependency) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ad.Activity != nil { + objectMap["activity"] = ad.Activity + } + if ad.DependencyConditions != nil { + objectMap["dependencyConditions"] = ad.DependencyConditions + } + for k, v := range ad.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// ActivityPolicy execution policy for an activity. +type ActivityPolicy struct { + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Timeout - Specifies the timeout for the activity to run. The default timeout is 7 days. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + Timeout interface{} `json:"timeout,omitempty"` + // Retry - Maximum ordinary retry attempts. Default is 0. Type: integer (or Expression with resultType integer), minimum: 0. + Retry interface{} `json:"retry,omitempty"` + // RetryIntervalInSeconds - Interval between each retry attempt (in seconds). The default is 30 sec. + RetryIntervalInSeconds *int32 `json:"retryIntervalInSeconds,omitempty"` + // SecureOutput - When set to true, Output from activity is considered as secure and will not be logged to monitoring. + SecureOutput *bool `json:"secureOutput,omitempty"` +} + +// MarshalJSON is the custom marshaler for ActivityPolicy. +func (ap ActivityPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["timeout"] = ap.Timeout + objectMap["retry"] = ap.Retry + if ap.RetryIntervalInSeconds != nil { + objectMap["retryIntervalInSeconds"] = ap.RetryIntervalInSeconds + } + if ap.SecureOutput != nil { + objectMap["secureOutput"] = ap.SecureOutput + } + for k, v := range ap.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// ActivityRun information about an activity run in a pipeline. +type ActivityRun struct { + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // PipelineName - The name of the pipeline. + PipelineName *string `json:"pipelineName,omitempty"` + // PipelineRunID - The id of the pipeline run. + PipelineRunID *string `json:"pipelineRunId,omitempty"` + // ActivityName - The name of the activity. + ActivityName *string `json:"activityName,omitempty"` + // ActivityType - The type of the activity. + ActivityType *string `json:"activityType,omitempty"` + // ActivityRunID - The id of the activity run. + ActivityRunID *string `json:"activityRunId,omitempty"` + // LinkedServiceName - The name of the compute linked service. + LinkedServiceName *string `json:"linkedServiceName,omitempty"` + // Status - The status of the activity run. + Status *string `json:"status,omitempty"` + // ActivityRunStart - The start time of the activity run in 'ISO 8601' format. + ActivityRunStart *date.Time `json:"activityRunStart,omitempty"` + // ActivityRunEnd - The end time of the activity run in 'ISO 8601' format. + ActivityRunEnd *date.Time `json:"activityRunEnd,omitempty"` + // DurationInMs - The duration of the activity run. + DurationInMs *int32 `json:"durationInMs,omitempty"` + // Input - The input for the activity. + Input interface{} `json:"input,omitempty"` + // Output - The output for the activity. + Output interface{} `json:"output,omitempty"` + // Error - The error if any from the activity run. + Error interface{} `json:"error,omitempty"` +} + +// MarshalJSON is the custom marshaler for ActivityRun. +func (ar ActivityRun) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ar.PipelineName != nil { + objectMap["pipelineName"] = ar.PipelineName + } + if ar.PipelineRunID != nil { + objectMap["pipelineRunId"] = ar.PipelineRunID + } + if ar.ActivityName != nil { + objectMap["activityName"] = ar.ActivityName + } + if ar.ActivityType != nil { + objectMap["activityType"] = ar.ActivityType + } + if ar.ActivityRunID != nil { + objectMap["activityRunId"] = ar.ActivityRunID + } + if ar.LinkedServiceName != nil { + objectMap["linkedServiceName"] = ar.LinkedServiceName + } + if ar.Status != nil { + objectMap["status"] = ar.Status + } + if ar.ActivityRunStart != nil { + objectMap["activityRunStart"] = ar.ActivityRunStart + } + if ar.ActivityRunEnd != nil { + objectMap["activityRunEnd"] = ar.ActivityRunEnd + } + if ar.DurationInMs != nil { + objectMap["durationInMs"] = ar.DurationInMs + } + objectMap["input"] = ar.Input + objectMap["output"] = ar.Output + objectMap["error"] = ar.Error + for k, v := range ar.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// ActivityRunsQueryResponse a list activity runs. +type ActivityRunsQueryResponse struct { + autorest.Response `json:"-"` + // Value - List of activity runs. + Value *[]ActivityRun `json:"value,omitempty"` + // ContinuationToken - The continuation token for getting the next page of results, if any remaining results exist, null otherwise. + ContinuationToken *string `json:"continuationToken,omitempty"` +} + +// AmazonMWSLinkedService amazon Marketplace Web Service linked service. +type AmazonMWSLinkedService struct { + // AmazonMWSLinkedServiceTypeProperties - Amazon Marketplace Web Service linked service properties. + *AmazonMWSLinkedServiceTypeProperties `json:"typeProperties,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // ConnectVia - The integration runtime reference. + ConnectVia *IntegrationRuntimeReference `json:"connectVia,omitempty"` + // Description - Linked service description. + Description *string `json:"description,omitempty"` + // Parameters - Parameters for linked service. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeLinkedService', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforce', 'TypeAzureDataLakeStore', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureStorage' + Type TypeBasicLinkedService `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for AmazonMWSLinkedService. +func (amls AmazonMWSLinkedService) MarshalJSON() ([]byte, error) { + amls.Type = TypeAmazonMWS + objectMap := make(map[string]interface{}) + if amls.AmazonMWSLinkedServiceTypeProperties != nil { + objectMap["typeProperties"] = amls.AmazonMWSLinkedServiceTypeProperties + } + if amls.ConnectVia != nil { + objectMap["connectVia"] = amls.ConnectVia + } + if amls.Description != nil { + objectMap["description"] = amls.Description + } + if amls.Parameters != nil { + objectMap["parameters"] = amls.Parameters + } + if amls.Annotations != nil { + objectMap["annotations"] = amls.Annotations + } + if amls.Type != "" { + objectMap["type"] = amls.Type + } + for k, v := range amls.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysLinkedService is the BasicLinkedService implementation for AmazonMWSLinkedService. +func (amls AmazonMWSLinkedService) AsResponsysLinkedService() (*ResponsysLinkedService, bool) { + return nil, false +} + +// AsAzureDatabricksLinkedService is the BasicLinkedService implementation for AmazonMWSLinkedService. +func (amls AmazonMWSLinkedService) AsAzureDatabricksLinkedService() (*AzureDatabricksLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeAnalyticsLinkedService is the BasicLinkedService implementation for AmazonMWSLinkedService. +func (amls AmazonMWSLinkedService) AsAzureDataLakeAnalyticsLinkedService() (*AzureDataLakeAnalyticsLinkedService, bool) { + return nil, false +} + +// AsHDInsightOnDemandLinkedService is the BasicLinkedService implementation for AmazonMWSLinkedService. +func (amls AmazonMWSLinkedService) AsHDInsightOnDemandLinkedService() (*HDInsightOnDemandLinkedService, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudLinkedService is the BasicLinkedService implementation for AmazonMWSLinkedService. +func (amls AmazonMWSLinkedService) AsSalesforceMarketingCloudLinkedService() (*SalesforceMarketingCloudLinkedService, bool) { + return nil, false +} + +// AsNetezzaLinkedService is the BasicLinkedService implementation for AmazonMWSLinkedService. +func (amls AmazonMWSLinkedService) AsNetezzaLinkedService() (*NetezzaLinkedService, bool) { + return nil, false +} + +// AsVerticaLinkedService is the BasicLinkedService implementation for AmazonMWSLinkedService. +func (amls AmazonMWSLinkedService) AsVerticaLinkedService() (*VerticaLinkedService, bool) { + return nil, false +} + +// AsZohoLinkedService is the BasicLinkedService implementation for AmazonMWSLinkedService. +func (amls AmazonMWSLinkedService) AsZohoLinkedService() (*ZohoLinkedService, bool) { + return nil, false +} + +// AsXeroLinkedService is the BasicLinkedService implementation for AmazonMWSLinkedService. +func (amls AmazonMWSLinkedService) AsXeroLinkedService() (*XeroLinkedService, bool) { + return nil, false +} + +// AsSquareLinkedService is the BasicLinkedService implementation for AmazonMWSLinkedService. +func (amls AmazonMWSLinkedService) AsSquareLinkedService() (*SquareLinkedService, bool) { + return nil, false +} + +// AsSparkLinkedService is the BasicLinkedService implementation for AmazonMWSLinkedService. +func (amls AmazonMWSLinkedService) AsSparkLinkedService() (*SparkLinkedService, bool) { + return nil, false +} + +// AsShopifyLinkedService is the BasicLinkedService implementation for AmazonMWSLinkedService. +func (amls AmazonMWSLinkedService) AsShopifyLinkedService() (*ShopifyLinkedService, bool) { + return nil, false +} + +// AsServiceNowLinkedService is the BasicLinkedService implementation for AmazonMWSLinkedService. +func (amls AmazonMWSLinkedService) AsServiceNowLinkedService() (*ServiceNowLinkedService, bool) { + return nil, false +} + +// AsQuickBooksLinkedService is the BasicLinkedService implementation for AmazonMWSLinkedService. +func (amls AmazonMWSLinkedService) AsQuickBooksLinkedService() (*QuickBooksLinkedService, bool) { + return nil, false +} + +// AsPrestoLinkedService is the BasicLinkedService implementation for AmazonMWSLinkedService. +func (amls AmazonMWSLinkedService) AsPrestoLinkedService() (*PrestoLinkedService, bool) { + return nil, false +} + +// AsPhoenixLinkedService is the BasicLinkedService implementation for AmazonMWSLinkedService. +func (amls AmazonMWSLinkedService) AsPhoenixLinkedService() (*PhoenixLinkedService, bool) { + return nil, false +} + +// AsPaypalLinkedService is the BasicLinkedService implementation for AmazonMWSLinkedService. +func (amls AmazonMWSLinkedService) AsPaypalLinkedService() (*PaypalLinkedService, bool) { + return nil, false +} + +// AsMarketoLinkedService is the BasicLinkedService implementation for AmazonMWSLinkedService. +func (amls AmazonMWSLinkedService) AsMarketoLinkedService() (*MarketoLinkedService, bool) { + return nil, false +} + +// AsMariaDBLinkedService is the BasicLinkedService implementation for AmazonMWSLinkedService. +func (amls AmazonMWSLinkedService) AsMariaDBLinkedService() (*MariaDBLinkedService, bool) { + return nil, false +} + +// AsMagentoLinkedService is the BasicLinkedService implementation for AmazonMWSLinkedService. +func (amls AmazonMWSLinkedService) AsMagentoLinkedService() (*MagentoLinkedService, bool) { + return nil, false +} + +// AsJiraLinkedService is the BasicLinkedService implementation for AmazonMWSLinkedService. +func (amls AmazonMWSLinkedService) AsJiraLinkedService() (*JiraLinkedService, bool) { + return nil, false +} + +// AsImpalaLinkedService is the BasicLinkedService implementation for AmazonMWSLinkedService. +func (amls AmazonMWSLinkedService) AsImpalaLinkedService() (*ImpalaLinkedService, bool) { + return nil, false +} + +// AsHubspotLinkedService is the BasicLinkedService implementation for AmazonMWSLinkedService. +func (amls AmazonMWSLinkedService) AsHubspotLinkedService() (*HubspotLinkedService, bool) { + return nil, false +} + +// AsHiveLinkedService is the BasicLinkedService implementation for AmazonMWSLinkedService. +func (amls AmazonMWSLinkedService) AsHiveLinkedService() (*HiveLinkedService, bool) { + return nil, false +} + +// AsHBaseLinkedService is the BasicLinkedService implementation for AmazonMWSLinkedService. +func (amls AmazonMWSLinkedService) AsHBaseLinkedService() (*HBaseLinkedService, bool) { + return nil, false +} + +// AsGreenplumLinkedService is the BasicLinkedService implementation for AmazonMWSLinkedService. +func (amls AmazonMWSLinkedService) AsGreenplumLinkedService() (*GreenplumLinkedService, bool) { + return nil, false +} + +// AsGoogleBigQueryLinkedService is the BasicLinkedService implementation for AmazonMWSLinkedService. +func (amls AmazonMWSLinkedService) AsGoogleBigQueryLinkedService() (*GoogleBigQueryLinkedService, bool) { + return nil, false +} + +// AsEloquaLinkedService is the BasicLinkedService implementation for AmazonMWSLinkedService. +func (amls AmazonMWSLinkedService) AsEloquaLinkedService() (*EloquaLinkedService, bool) { + return nil, false +} + +// AsDrillLinkedService is the BasicLinkedService implementation for AmazonMWSLinkedService. +func (amls AmazonMWSLinkedService) AsDrillLinkedService() (*DrillLinkedService, bool) { + return nil, false +} + +// AsCouchbaseLinkedService is the BasicLinkedService implementation for AmazonMWSLinkedService. +func (amls AmazonMWSLinkedService) AsCouchbaseLinkedService() (*CouchbaseLinkedService, bool) { + return nil, false +} + +// AsConcurLinkedService is the BasicLinkedService implementation for AmazonMWSLinkedService. +func (amls AmazonMWSLinkedService) AsConcurLinkedService() (*ConcurLinkedService, bool) { + return nil, false +} + +// AsAzurePostgreSQLLinkedService is the BasicLinkedService implementation for AmazonMWSLinkedService. +func (amls AmazonMWSLinkedService) AsAzurePostgreSQLLinkedService() (*AzurePostgreSQLLinkedService, bool) { + return nil, false +} + +// AsAmazonMWSLinkedService is the BasicLinkedService implementation for AmazonMWSLinkedService. +func (amls AmazonMWSLinkedService) AsAmazonMWSLinkedService() (*AmazonMWSLinkedService, bool) { + return &amls, true +} + +// AsSapHanaLinkedService is the BasicLinkedService implementation for AmazonMWSLinkedService. +func (amls AmazonMWSLinkedService) AsSapHanaLinkedService() (*SapHanaLinkedService, bool) { + return nil, false +} + +// AsSapBWLinkedService is the BasicLinkedService implementation for AmazonMWSLinkedService. +func (amls AmazonMWSLinkedService) AsSapBWLinkedService() (*SapBWLinkedService, bool) { + return nil, false +} + +// AsSftpServerLinkedService is the BasicLinkedService implementation for AmazonMWSLinkedService. +func (amls AmazonMWSLinkedService) AsSftpServerLinkedService() (*SftpServerLinkedService, bool) { + return nil, false +} + +// AsFtpServerLinkedService is the BasicLinkedService implementation for AmazonMWSLinkedService. +func (amls AmazonMWSLinkedService) AsFtpServerLinkedService() (*FtpServerLinkedService, bool) { + return nil, false +} + +// AsHTTPLinkedService is the BasicLinkedService implementation for AmazonMWSLinkedService. +func (amls AmazonMWSLinkedService) AsHTTPLinkedService() (*HTTPLinkedService, bool) { + return nil, false +} + +// AsAzureSearchLinkedService is the BasicLinkedService implementation for AmazonMWSLinkedService. +func (amls AmazonMWSLinkedService) AsAzureSearchLinkedService() (*AzureSearchLinkedService, bool) { + return nil, false +} + +// AsCustomDataSourceLinkedService is the BasicLinkedService implementation for AmazonMWSLinkedService. +func (amls AmazonMWSLinkedService) AsCustomDataSourceLinkedService() (*CustomDataSourceLinkedService, bool) { + return nil, false +} + +// AsAmazonRedshiftLinkedService is the BasicLinkedService implementation for AmazonMWSLinkedService. +func (amls AmazonMWSLinkedService) AsAmazonRedshiftLinkedService() (*AmazonRedshiftLinkedService, bool) { + return nil, false +} + +// AsAmazonS3LinkedService is the BasicLinkedService implementation for AmazonMWSLinkedService. +func (amls AmazonMWSLinkedService) AsAmazonS3LinkedService() (*AmazonS3LinkedService, bool) { + return nil, false +} + +// AsSapEccLinkedService is the BasicLinkedService implementation for AmazonMWSLinkedService. +func (amls AmazonMWSLinkedService) AsSapEccLinkedService() (*SapEccLinkedService, bool) { + return nil, false +} + +// AsSapCloudForCustomerLinkedService is the BasicLinkedService implementation for AmazonMWSLinkedService. +func (amls AmazonMWSLinkedService) AsSapCloudForCustomerLinkedService() (*SapCloudForCustomerLinkedService, bool) { + return nil, false +} + +// AsSalesforceLinkedService is the BasicLinkedService implementation for AmazonMWSLinkedService. +func (amls AmazonMWSLinkedService) AsSalesforceLinkedService() (*SalesforceLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeStoreLinkedService is the BasicLinkedService implementation for AmazonMWSLinkedService. +func (amls AmazonMWSLinkedService) AsAzureDataLakeStoreLinkedService() (*AzureDataLakeStoreLinkedService, bool) { + return nil, false +} + +// AsMongoDbLinkedService is the BasicLinkedService implementation for AmazonMWSLinkedService. +func (amls AmazonMWSLinkedService) AsMongoDbLinkedService() (*MongoDbLinkedService, bool) { + return nil, false +} + +// AsCassandraLinkedService is the BasicLinkedService implementation for AmazonMWSLinkedService. +func (amls AmazonMWSLinkedService) AsCassandraLinkedService() (*CassandraLinkedService, bool) { + return nil, false +} + +// AsWebLinkedService is the BasicLinkedService implementation for AmazonMWSLinkedService. +func (amls AmazonMWSLinkedService) AsWebLinkedService() (*WebLinkedService, bool) { + return nil, false +} + +// AsODataLinkedService is the BasicLinkedService implementation for AmazonMWSLinkedService. +func (amls AmazonMWSLinkedService) AsODataLinkedService() (*ODataLinkedService, bool) { + return nil, false +} + +// AsHdfsLinkedService is the BasicLinkedService implementation for AmazonMWSLinkedService. +func (amls AmazonMWSLinkedService) AsHdfsLinkedService() (*HdfsLinkedService, bool) { + return nil, false +} + +// AsOdbcLinkedService is the BasicLinkedService implementation for AmazonMWSLinkedService. +func (amls AmazonMWSLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, bool) { + return nil, false +} + +// AsAzureMLLinkedService is the BasicLinkedService implementation for AmazonMWSLinkedService. +func (amls AmazonMWSLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { + return nil, false +} + +// AsTeradataLinkedService is the BasicLinkedService implementation for AmazonMWSLinkedService. +func (amls AmazonMWSLinkedService) AsTeradataLinkedService() (*TeradataLinkedService, bool) { + return nil, false +} + +// AsDb2LinkedService is the BasicLinkedService implementation for AmazonMWSLinkedService. +func (amls AmazonMWSLinkedService) AsDb2LinkedService() (*Db2LinkedService, bool) { + return nil, false +} + +// AsSybaseLinkedService is the BasicLinkedService implementation for AmazonMWSLinkedService. +func (amls AmazonMWSLinkedService) AsSybaseLinkedService() (*SybaseLinkedService, bool) { + return nil, false +} + +// AsPostgreSQLLinkedService is the BasicLinkedService implementation for AmazonMWSLinkedService. +func (amls AmazonMWSLinkedService) AsPostgreSQLLinkedService() (*PostgreSQLLinkedService, bool) { + return nil, false +} + +// AsMySQLLinkedService is the BasicLinkedService implementation for AmazonMWSLinkedService. +func (amls AmazonMWSLinkedService) AsMySQLLinkedService() (*MySQLLinkedService, bool) { + return nil, false +} + +// AsAzureMySQLLinkedService is the BasicLinkedService implementation for AmazonMWSLinkedService. +func (amls AmazonMWSLinkedService) AsAzureMySQLLinkedService() (*AzureMySQLLinkedService, bool) { + return nil, false +} + +// AsOracleLinkedService is the BasicLinkedService implementation for AmazonMWSLinkedService. +func (amls AmazonMWSLinkedService) AsOracleLinkedService() (*OracleLinkedService, bool) { + return nil, false +} + +// AsFileServerLinkedService is the BasicLinkedService implementation for AmazonMWSLinkedService. +func (amls AmazonMWSLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { + return nil, false +} + +// AsHDInsightLinkedService is the BasicLinkedService implementation for AmazonMWSLinkedService. +func (amls AmazonMWSLinkedService) AsHDInsightLinkedService() (*HDInsightLinkedService, bool) { + return nil, false +} + +// AsDynamicsLinkedService is the BasicLinkedService implementation for AmazonMWSLinkedService. +func (amls AmazonMWSLinkedService) AsDynamicsLinkedService() (*DynamicsLinkedService, bool) { + return nil, false +} + +// AsCosmosDbLinkedService is the BasicLinkedService implementation for AmazonMWSLinkedService. +func (amls AmazonMWSLinkedService) AsCosmosDbLinkedService() (*CosmosDbLinkedService, bool) { + return nil, false +} + +// AsAzureKeyVaultLinkedService is the BasicLinkedService implementation for AmazonMWSLinkedService. +func (amls AmazonMWSLinkedService) AsAzureKeyVaultLinkedService() (*AzureKeyVaultLinkedService, bool) { + return nil, false +} + +// AsAzureBatchLinkedService is the BasicLinkedService implementation for AmazonMWSLinkedService. +func (amls AmazonMWSLinkedService) AsAzureBatchLinkedService() (*AzureBatchLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDatabaseLinkedService is the BasicLinkedService implementation for AmazonMWSLinkedService. +func (amls AmazonMWSLinkedService) AsAzureSQLDatabaseLinkedService() (*AzureSQLDatabaseLinkedService, bool) { + return nil, false +} + +// AsSQLServerLinkedService is the BasicLinkedService implementation for AmazonMWSLinkedService. +func (amls AmazonMWSLinkedService) AsSQLServerLinkedService() (*SQLServerLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDWLinkedService is the BasicLinkedService implementation for AmazonMWSLinkedService. +func (amls AmazonMWSLinkedService) AsAzureSQLDWLinkedService() (*AzureSQLDWLinkedService, bool) { + return nil, false +} + +// AsAzureStorageLinkedService is the BasicLinkedService implementation for AmazonMWSLinkedService. +func (amls AmazonMWSLinkedService) AsAzureStorageLinkedService() (*AzureStorageLinkedService, bool) { + return nil, false +} + +// AsLinkedService is the BasicLinkedService implementation for AmazonMWSLinkedService. +func (amls AmazonMWSLinkedService) AsLinkedService() (*LinkedService, bool) { + return nil, false +} + +// AsBasicLinkedService is the BasicLinkedService implementation for AmazonMWSLinkedService. +func (amls AmazonMWSLinkedService) AsBasicLinkedService() (BasicLinkedService, bool) { + return &amls, true +} + +// UnmarshalJSON is the custom unmarshaler for AmazonMWSLinkedService struct. +func (amls *AmazonMWSLinkedService) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "typeProperties": + if v != nil { + var amazonMWSLinkedServiceTypeProperties AmazonMWSLinkedServiceTypeProperties + err = json.Unmarshal(*v, &amazonMWSLinkedServiceTypeProperties) + if err != nil { + return err + } + amls.AmazonMWSLinkedServiceTypeProperties = &amazonMWSLinkedServiceTypeProperties + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if amls.AdditionalProperties == nil { + amls.AdditionalProperties = make(map[string]interface{}) + } + amls.AdditionalProperties[k] = additionalProperties + } + case "connectVia": + if v != nil { + var connectVia IntegrationRuntimeReference + err = json.Unmarshal(*v, &connectVia) + if err != nil { + return err + } + amls.ConnectVia = &connectVia + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + amls.Description = &description + } + case "parameters": + if v != nil { + var parameters map[string]*ParameterSpecification + err = json.Unmarshal(*v, ¶meters) + if err != nil { + return err + } + amls.Parameters = parameters + } + case "annotations": + if v != nil { + var annotations []interface{} + err = json.Unmarshal(*v, &annotations) + if err != nil { + return err + } + amls.Annotations = &annotations + } + case "type": + if v != nil { + var typeVar TypeBasicLinkedService + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + amls.Type = typeVar + } + } + } + + return nil +} + +// AmazonMWSLinkedServiceTypeProperties amazon Marketplace Web Service linked service properties. +type AmazonMWSLinkedServiceTypeProperties struct { + // Endpoint - The endpoint of the Amazon MWS server, (i.e. mws.amazonservices.com) + Endpoint interface{} `json:"endpoint,omitempty"` + // MarketplaceID - The Amazon Marketplace ID you want to retrieve data from. To retrive data from multiple Marketplace IDs, seperate them with a comma (,). (i.e. A2EUQ1WTGCTBG2) + MarketplaceID interface{} `json:"marketplaceID,omitempty"` + // SellerID - The Amazon seller ID. + SellerID interface{} `json:"sellerID,omitempty"` + // MwsAuthToken - The Amazon MWS authentication token. + MwsAuthToken BasicSecretBase `json:"mwsAuthToken,omitempty"` + // AccessKeyID - The access key id used to access data. + AccessKeyID interface{} `json:"accessKeyId,omitempty"` + // SecretKey - The secret key used to access data. + SecretKey BasicSecretBase `json:"secretKey,omitempty"` + // UseEncryptedEndpoints - Specifies whether the data source endpoints are encrypted using HTTPS. The default value is true. + UseEncryptedEndpoints interface{} `json:"useEncryptedEndpoints,omitempty"` + // UseHostVerification - Specifies whether to require the host name in the server's certificate to match the host name of the server when connecting over SSL. The default value is true. + UseHostVerification interface{} `json:"useHostVerification,omitempty"` + // UsePeerVerification - Specifies whether to verify the identity of the server when connecting over SSL. The default value is true. + UsePeerVerification interface{} `json:"usePeerVerification,omitempty"` + // EncryptedCredential - The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string). + EncryptedCredential interface{} `json:"encryptedCredential,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for AmazonMWSLinkedServiceTypeProperties struct. +func (amlstp *AmazonMWSLinkedServiceTypeProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "endpoint": + if v != nil { + var endpoint interface{} + err = json.Unmarshal(*v, &endpoint) + if err != nil { + return err + } + amlstp.Endpoint = endpoint + } + case "marketplaceID": + if v != nil { + var marketplaceID interface{} + err = json.Unmarshal(*v, &marketplaceID) + if err != nil { + return err + } + amlstp.MarketplaceID = marketplaceID + } + case "sellerID": + if v != nil { + var sellerID interface{} + err = json.Unmarshal(*v, &sellerID) + if err != nil { + return err + } + amlstp.SellerID = sellerID + } + case "mwsAuthToken": + if v != nil { + mwsAuthToken, err := unmarshalBasicSecretBase(*v) + if err != nil { + return err + } + amlstp.MwsAuthToken = mwsAuthToken + } + case "accessKeyId": + if v != nil { + var accessKeyID interface{} + err = json.Unmarshal(*v, &accessKeyID) + if err != nil { + return err + } + amlstp.AccessKeyID = accessKeyID + } + case "secretKey": + if v != nil { + secretKey, err := unmarshalBasicSecretBase(*v) + if err != nil { + return err + } + amlstp.SecretKey = secretKey + } + case "useEncryptedEndpoints": + if v != nil { + var useEncryptedEndpoints interface{} + err = json.Unmarshal(*v, &useEncryptedEndpoints) + if err != nil { + return err + } + amlstp.UseEncryptedEndpoints = useEncryptedEndpoints + } + case "useHostVerification": + if v != nil { + var useHostVerification interface{} + err = json.Unmarshal(*v, &useHostVerification) + if err != nil { + return err + } + amlstp.UseHostVerification = useHostVerification + } + case "usePeerVerification": + if v != nil { + var usePeerVerification interface{} + err = json.Unmarshal(*v, &usePeerVerification) + if err != nil { + return err + } + amlstp.UsePeerVerification = usePeerVerification + } + case "encryptedCredential": + if v != nil { + var encryptedCredential interface{} + err = json.Unmarshal(*v, &encryptedCredential) + if err != nil { + return err + } + amlstp.EncryptedCredential = encryptedCredential + } + } + } + + return nil +} + +// AmazonMWSObjectDataset amazon Marketplace Web Service dataset. +type AmazonMWSObjectDataset struct { + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Description - Dataset description. + Description *string `json:"description,omitempty"` + // Structure - Columns that define the structure of the dataset. Type: array (or Expression with resultType array), itemType: DatasetDataElement. + Structure interface{} `json:"structure,omitempty"` + // LinkedServiceName - Linked service reference. + LinkedServiceName *LinkedServiceReference `json:"linkedServiceName,omitempty"` + // Parameters - Parameters for dataset. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeDataset', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSQLServerTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSalesforceObject', 'TypeRelationalTable', 'TypeAzureMySQLTable', 'TypeOracleTable', 'TypeODataResource', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeAzureDataLakeStoreFile', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeAmazonS3Object' + Type TypeBasicDataset `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for AmazonMWSObjectDataset. +func (amod AmazonMWSObjectDataset) MarshalJSON() ([]byte, error) { + amod.Type = TypeAmazonMWSObject + objectMap := make(map[string]interface{}) + if amod.Description != nil { + objectMap["description"] = amod.Description + } + objectMap["structure"] = amod.Structure + if amod.LinkedServiceName != nil { + objectMap["linkedServiceName"] = amod.LinkedServiceName + } + if amod.Parameters != nil { + objectMap["parameters"] = amod.Parameters + } + if amod.Annotations != nil { + objectMap["annotations"] = amod.Annotations + } + if amod.Type != "" { + objectMap["type"] = amod.Type + } + for k, v := range amod.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysObjectDataset is the BasicDataset implementation for AmazonMWSObjectDataset. +func (amod AmazonMWSObjectDataset) AsResponsysObjectDataset() (*ResponsysObjectDataset, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudObjectDataset is the BasicDataset implementation for AmazonMWSObjectDataset. +func (amod AmazonMWSObjectDataset) AsSalesforceMarketingCloudObjectDataset() (*SalesforceMarketingCloudObjectDataset, bool) { + return nil, false +} + +// AsVerticaTableDataset is the BasicDataset implementation for AmazonMWSObjectDataset. +func (amod AmazonMWSObjectDataset) AsVerticaTableDataset() (*VerticaTableDataset, bool) { + return nil, false +} + +// AsNetezzaTableDataset is the BasicDataset implementation for AmazonMWSObjectDataset. +func (amod AmazonMWSObjectDataset) AsNetezzaTableDataset() (*NetezzaTableDataset, bool) { + return nil, false +} + +// AsZohoObjectDataset is the BasicDataset implementation for AmazonMWSObjectDataset. +func (amod AmazonMWSObjectDataset) AsZohoObjectDataset() (*ZohoObjectDataset, bool) { + return nil, false +} + +// AsXeroObjectDataset is the BasicDataset implementation for AmazonMWSObjectDataset. +func (amod AmazonMWSObjectDataset) AsXeroObjectDataset() (*XeroObjectDataset, bool) { + return nil, false +} + +// AsSquareObjectDataset is the BasicDataset implementation for AmazonMWSObjectDataset. +func (amod AmazonMWSObjectDataset) AsSquareObjectDataset() (*SquareObjectDataset, bool) { + return nil, false +} + +// AsSparkObjectDataset is the BasicDataset implementation for AmazonMWSObjectDataset. +func (amod AmazonMWSObjectDataset) AsSparkObjectDataset() (*SparkObjectDataset, bool) { + return nil, false +} + +// AsShopifyObjectDataset is the BasicDataset implementation for AmazonMWSObjectDataset. +func (amod AmazonMWSObjectDataset) AsShopifyObjectDataset() (*ShopifyObjectDataset, bool) { + return nil, false +} + +// AsServiceNowObjectDataset is the BasicDataset implementation for AmazonMWSObjectDataset. +func (amod AmazonMWSObjectDataset) AsServiceNowObjectDataset() (*ServiceNowObjectDataset, bool) { + return nil, false +} + +// AsQuickBooksObjectDataset is the BasicDataset implementation for AmazonMWSObjectDataset. +func (amod AmazonMWSObjectDataset) AsQuickBooksObjectDataset() (*QuickBooksObjectDataset, bool) { + return nil, false +} + +// AsPrestoObjectDataset is the BasicDataset implementation for AmazonMWSObjectDataset. +func (amod AmazonMWSObjectDataset) AsPrestoObjectDataset() (*PrestoObjectDataset, bool) { + return nil, false +} + +// AsPhoenixObjectDataset is the BasicDataset implementation for AmazonMWSObjectDataset. +func (amod AmazonMWSObjectDataset) AsPhoenixObjectDataset() (*PhoenixObjectDataset, bool) { + return nil, false +} + +// AsPaypalObjectDataset is the BasicDataset implementation for AmazonMWSObjectDataset. +func (amod AmazonMWSObjectDataset) AsPaypalObjectDataset() (*PaypalObjectDataset, bool) { + return nil, false +} + +// AsMarketoObjectDataset is the BasicDataset implementation for AmazonMWSObjectDataset. +func (amod AmazonMWSObjectDataset) AsMarketoObjectDataset() (*MarketoObjectDataset, bool) { + return nil, false +} + +// AsMariaDBTableDataset is the BasicDataset implementation for AmazonMWSObjectDataset. +func (amod AmazonMWSObjectDataset) AsMariaDBTableDataset() (*MariaDBTableDataset, bool) { + return nil, false +} + +// AsMagentoObjectDataset is the BasicDataset implementation for AmazonMWSObjectDataset. +func (amod AmazonMWSObjectDataset) AsMagentoObjectDataset() (*MagentoObjectDataset, bool) { + return nil, false +} + +// AsJiraObjectDataset is the BasicDataset implementation for AmazonMWSObjectDataset. +func (amod AmazonMWSObjectDataset) AsJiraObjectDataset() (*JiraObjectDataset, bool) { + return nil, false +} + +// AsImpalaObjectDataset is the BasicDataset implementation for AmazonMWSObjectDataset. +func (amod AmazonMWSObjectDataset) AsImpalaObjectDataset() (*ImpalaObjectDataset, bool) { + return nil, false +} + +// AsHubspotObjectDataset is the BasicDataset implementation for AmazonMWSObjectDataset. +func (amod AmazonMWSObjectDataset) AsHubspotObjectDataset() (*HubspotObjectDataset, bool) { + return nil, false +} + +// AsHiveObjectDataset is the BasicDataset implementation for AmazonMWSObjectDataset. +func (amod AmazonMWSObjectDataset) AsHiveObjectDataset() (*HiveObjectDataset, bool) { + return nil, false +} + +// AsHBaseObjectDataset is the BasicDataset implementation for AmazonMWSObjectDataset. +func (amod AmazonMWSObjectDataset) AsHBaseObjectDataset() (*HBaseObjectDataset, bool) { + return nil, false +} + +// AsGreenplumTableDataset is the BasicDataset implementation for AmazonMWSObjectDataset. +func (amod AmazonMWSObjectDataset) AsGreenplumTableDataset() (*GreenplumTableDataset, bool) { + return nil, false +} + +// AsGoogleBigQueryObjectDataset is the BasicDataset implementation for AmazonMWSObjectDataset. +func (amod AmazonMWSObjectDataset) AsGoogleBigQueryObjectDataset() (*GoogleBigQueryObjectDataset, bool) { + return nil, false +} + +// AsEloquaObjectDataset is the BasicDataset implementation for AmazonMWSObjectDataset. +func (amod AmazonMWSObjectDataset) AsEloquaObjectDataset() (*EloquaObjectDataset, bool) { + return nil, false +} + +// AsDrillTableDataset is the BasicDataset implementation for AmazonMWSObjectDataset. +func (amod AmazonMWSObjectDataset) AsDrillTableDataset() (*DrillTableDataset, bool) { + return nil, false +} + +// AsCouchbaseTableDataset is the BasicDataset implementation for AmazonMWSObjectDataset. +func (amod AmazonMWSObjectDataset) AsCouchbaseTableDataset() (*CouchbaseTableDataset, bool) { + return nil, false +} + +// AsConcurObjectDataset is the BasicDataset implementation for AmazonMWSObjectDataset. +func (amod AmazonMWSObjectDataset) AsConcurObjectDataset() (*ConcurObjectDataset, bool) { + return nil, false +} + +// AsAzurePostgreSQLTableDataset is the BasicDataset implementation for AmazonMWSObjectDataset. +func (amod AmazonMWSObjectDataset) AsAzurePostgreSQLTableDataset() (*AzurePostgreSQLTableDataset, bool) { + return nil, false +} + +// AsAmazonMWSObjectDataset is the BasicDataset implementation for AmazonMWSObjectDataset. +func (amod AmazonMWSObjectDataset) AsAmazonMWSObjectDataset() (*AmazonMWSObjectDataset, bool) { + return &amod, true +} + +// AsHTTPDataset is the BasicDataset implementation for AmazonMWSObjectDataset. +func (amod AmazonMWSObjectDataset) AsHTTPDataset() (*HTTPDataset, bool) { + return nil, false +} + +// AsAzureSearchIndexDataset is the BasicDataset implementation for AmazonMWSObjectDataset. +func (amod AmazonMWSObjectDataset) AsAzureSearchIndexDataset() (*AzureSearchIndexDataset, bool) { + return nil, false +} + +// AsWebTableDataset is the BasicDataset implementation for AmazonMWSObjectDataset. +func (amod AmazonMWSObjectDataset) AsWebTableDataset() (*WebTableDataset, bool) { + return nil, false +} + +// AsSQLServerTableDataset is the BasicDataset implementation for AmazonMWSObjectDataset. +func (amod AmazonMWSObjectDataset) AsSQLServerTableDataset() (*SQLServerTableDataset, bool) { + return nil, false +} + +// AsSapEccResourceDataset is the BasicDataset implementation for AmazonMWSObjectDataset. +func (amod AmazonMWSObjectDataset) AsSapEccResourceDataset() (*SapEccResourceDataset, bool) { + return nil, false +} + +// AsSapCloudForCustomerResourceDataset is the BasicDataset implementation for AmazonMWSObjectDataset. +func (amod AmazonMWSObjectDataset) AsSapCloudForCustomerResourceDataset() (*SapCloudForCustomerResourceDataset, bool) { + return nil, false +} + +// AsSalesforceObjectDataset is the BasicDataset implementation for AmazonMWSObjectDataset. +func (amod AmazonMWSObjectDataset) AsSalesforceObjectDataset() (*SalesforceObjectDataset, bool) { + return nil, false +} + +// AsRelationalTableDataset is the BasicDataset implementation for AmazonMWSObjectDataset. +func (amod AmazonMWSObjectDataset) AsRelationalTableDataset() (*RelationalTableDataset, bool) { + return nil, false +} + +// AsAzureMySQLTableDataset is the BasicDataset implementation for AmazonMWSObjectDataset. +func (amod AmazonMWSObjectDataset) AsAzureMySQLTableDataset() (*AzureMySQLTableDataset, bool) { + return nil, false +} + +// AsOracleTableDataset is the BasicDataset implementation for AmazonMWSObjectDataset. +func (amod AmazonMWSObjectDataset) AsOracleTableDataset() (*OracleTableDataset, bool) { + return nil, false +} + +// AsODataResourceDataset is the BasicDataset implementation for AmazonMWSObjectDataset. +func (amod AmazonMWSObjectDataset) AsODataResourceDataset() (*ODataResourceDataset, bool) { + return nil, false +} + +// AsMongoDbCollectionDataset is the BasicDataset implementation for AmazonMWSObjectDataset. +func (amod AmazonMWSObjectDataset) AsMongoDbCollectionDataset() (*MongoDbCollectionDataset, bool) { + return nil, false +} + +// AsFileShareDataset is the BasicDataset implementation for AmazonMWSObjectDataset. +func (amod AmazonMWSObjectDataset) AsFileShareDataset() (*FileShareDataset, bool) { + return nil, false +} + +// AsAzureDataLakeStoreDataset is the BasicDataset implementation for AmazonMWSObjectDataset. +func (amod AmazonMWSObjectDataset) AsAzureDataLakeStoreDataset() (*AzureDataLakeStoreDataset, bool) { + return nil, false +} + +// AsDynamicsEntityDataset is the BasicDataset implementation for AmazonMWSObjectDataset. +func (amod AmazonMWSObjectDataset) AsDynamicsEntityDataset() (*DynamicsEntityDataset, bool) { + return nil, false +} + +// AsDocumentDbCollectionDataset is the BasicDataset implementation for AmazonMWSObjectDataset. +func (amod AmazonMWSObjectDataset) AsDocumentDbCollectionDataset() (*DocumentDbCollectionDataset, bool) { + return nil, false +} + +// AsCustomDataset is the BasicDataset implementation for AmazonMWSObjectDataset. +func (amod AmazonMWSObjectDataset) AsCustomDataset() (*CustomDataset, bool) { + return nil, false +} + +// AsCassandraTableDataset is the BasicDataset implementation for AmazonMWSObjectDataset. +func (amod AmazonMWSObjectDataset) AsCassandraTableDataset() (*CassandraTableDataset, bool) { + return nil, false +} + +// AsAzureSQLDWTableDataset is the BasicDataset implementation for AmazonMWSObjectDataset. +func (amod AmazonMWSObjectDataset) AsAzureSQLDWTableDataset() (*AzureSQLDWTableDataset, bool) { + return nil, false +} + +// AsAzureSQLTableDataset is the BasicDataset implementation for AmazonMWSObjectDataset. +func (amod AmazonMWSObjectDataset) AsAzureSQLTableDataset() (*AzureSQLTableDataset, bool) { + return nil, false +} + +// AsAzureTableDataset is the BasicDataset implementation for AmazonMWSObjectDataset. +func (amod AmazonMWSObjectDataset) AsAzureTableDataset() (*AzureTableDataset, bool) { + return nil, false +} + +// AsAzureBlobDataset is the BasicDataset implementation for AmazonMWSObjectDataset. +func (amod AmazonMWSObjectDataset) AsAzureBlobDataset() (*AzureBlobDataset, bool) { + return nil, false +} + +// AsAmazonS3Dataset is the BasicDataset implementation for AmazonMWSObjectDataset. +func (amod AmazonMWSObjectDataset) AsAmazonS3Dataset() (*AmazonS3Dataset, bool) { + return nil, false +} + +// AsDataset is the BasicDataset implementation for AmazonMWSObjectDataset. +func (amod AmazonMWSObjectDataset) AsDataset() (*Dataset, bool) { + return nil, false +} + +// AsBasicDataset is the BasicDataset implementation for AmazonMWSObjectDataset. +func (amod AmazonMWSObjectDataset) AsBasicDataset() (BasicDataset, bool) { + return &amod, true +} + +// AmazonMWSSource a copy activity Amazon Marketplace Web Service source. +type AmazonMWSSource struct { + // Query - A query to retrieve data from source. Type: string (or Expression with resultType string). + Query interface{} `json:"query,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // SourceRetryCount - Source retry count. Type: integer (or Expression with resultType integer). + SourceRetryCount interface{} `json:"sourceRetryCount,omitempty"` + // SourceRetryWait - Source retry wait. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` + // Type - Possible values include: 'TypeCopySource', 'TypeAmazonRedshiftSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeHTTPSource', 'TypeAzureDataLakeStoreSource', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeRelationalSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource' + Type TypeBasicCopySource `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for AmazonMWSSource. +func (ams AmazonMWSSource) MarshalJSON() ([]byte, error) { + ams.Type = TypeAmazonMWSSource + objectMap := make(map[string]interface{}) + objectMap["query"] = ams.Query + objectMap["sourceRetryCount"] = ams.SourceRetryCount + objectMap["sourceRetryWait"] = ams.SourceRetryWait + if ams.Type != "" { + objectMap["type"] = ams.Type + } + for k, v := range ams.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsAmazonRedshiftSource is the BasicCopySource implementation for AmazonMWSSource. +func (ams AmazonMWSSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { + return nil, false +} + +// AsResponsysSource is the BasicCopySource implementation for AmazonMWSSource. +func (ams AmazonMWSSource) AsResponsysSource() (*ResponsysSource, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudSource is the BasicCopySource implementation for AmazonMWSSource. +func (ams AmazonMWSSource) AsSalesforceMarketingCloudSource() (*SalesforceMarketingCloudSource, bool) { + return nil, false +} + +// AsVerticaSource is the BasicCopySource implementation for AmazonMWSSource. +func (ams AmazonMWSSource) AsVerticaSource() (*VerticaSource, bool) { + return nil, false +} + +// AsNetezzaSource is the BasicCopySource implementation for AmazonMWSSource. +func (ams AmazonMWSSource) AsNetezzaSource() (*NetezzaSource, bool) { + return nil, false +} + +// AsZohoSource is the BasicCopySource implementation for AmazonMWSSource. +func (ams AmazonMWSSource) AsZohoSource() (*ZohoSource, bool) { + return nil, false +} + +// AsXeroSource is the BasicCopySource implementation for AmazonMWSSource. +func (ams AmazonMWSSource) AsXeroSource() (*XeroSource, bool) { + return nil, false +} + +// AsSquareSource is the BasicCopySource implementation for AmazonMWSSource. +func (ams AmazonMWSSource) AsSquareSource() (*SquareSource, bool) { + return nil, false +} + +// AsSparkSource is the BasicCopySource implementation for AmazonMWSSource. +func (ams AmazonMWSSource) AsSparkSource() (*SparkSource, bool) { + return nil, false +} + +// AsShopifySource is the BasicCopySource implementation for AmazonMWSSource. +func (ams AmazonMWSSource) AsShopifySource() (*ShopifySource, bool) { + return nil, false +} + +// AsServiceNowSource is the BasicCopySource implementation for AmazonMWSSource. +func (ams AmazonMWSSource) AsServiceNowSource() (*ServiceNowSource, bool) { + return nil, false +} + +// AsQuickBooksSource is the BasicCopySource implementation for AmazonMWSSource. +func (ams AmazonMWSSource) AsQuickBooksSource() (*QuickBooksSource, bool) { + return nil, false +} + +// AsPrestoSource is the BasicCopySource implementation for AmazonMWSSource. +func (ams AmazonMWSSource) AsPrestoSource() (*PrestoSource, bool) { + return nil, false +} + +// AsPhoenixSource is the BasicCopySource implementation for AmazonMWSSource. +func (ams AmazonMWSSource) AsPhoenixSource() (*PhoenixSource, bool) { + return nil, false +} + +// AsPaypalSource is the BasicCopySource implementation for AmazonMWSSource. +func (ams AmazonMWSSource) AsPaypalSource() (*PaypalSource, bool) { + return nil, false +} + +// AsMarketoSource is the BasicCopySource implementation for AmazonMWSSource. +func (ams AmazonMWSSource) AsMarketoSource() (*MarketoSource, bool) { + return nil, false +} + +// AsMariaDBSource is the BasicCopySource implementation for AmazonMWSSource. +func (ams AmazonMWSSource) AsMariaDBSource() (*MariaDBSource, bool) { + return nil, false +} + +// AsMagentoSource is the BasicCopySource implementation for AmazonMWSSource. +func (ams AmazonMWSSource) AsMagentoSource() (*MagentoSource, bool) { + return nil, false +} + +// AsJiraSource is the BasicCopySource implementation for AmazonMWSSource. +func (ams AmazonMWSSource) AsJiraSource() (*JiraSource, bool) { + return nil, false +} + +// AsImpalaSource is the BasicCopySource implementation for AmazonMWSSource. +func (ams AmazonMWSSource) AsImpalaSource() (*ImpalaSource, bool) { + return nil, false +} + +// AsHubspotSource is the BasicCopySource implementation for AmazonMWSSource. +func (ams AmazonMWSSource) AsHubspotSource() (*HubspotSource, bool) { + return nil, false +} + +// AsHiveSource is the BasicCopySource implementation for AmazonMWSSource. +func (ams AmazonMWSSource) AsHiveSource() (*HiveSource, bool) { + return nil, false +} + +// AsHBaseSource is the BasicCopySource implementation for AmazonMWSSource. +func (ams AmazonMWSSource) AsHBaseSource() (*HBaseSource, bool) { + return nil, false +} + +// AsGreenplumSource is the BasicCopySource implementation for AmazonMWSSource. +func (ams AmazonMWSSource) AsGreenplumSource() (*GreenplumSource, bool) { + return nil, false +} + +// AsGoogleBigQuerySource is the BasicCopySource implementation for AmazonMWSSource. +func (ams AmazonMWSSource) AsGoogleBigQuerySource() (*GoogleBigQuerySource, bool) { + return nil, false +} + +// AsEloquaSource is the BasicCopySource implementation for AmazonMWSSource. +func (ams AmazonMWSSource) AsEloquaSource() (*EloquaSource, bool) { + return nil, false +} + +// AsDrillSource is the BasicCopySource implementation for AmazonMWSSource. +func (ams AmazonMWSSource) AsDrillSource() (*DrillSource, bool) { + return nil, false +} + +// AsCouchbaseSource is the BasicCopySource implementation for AmazonMWSSource. +func (ams AmazonMWSSource) AsCouchbaseSource() (*CouchbaseSource, bool) { + return nil, false +} + +// AsConcurSource is the BasicCopySource implementation for AmazonMWSSource. +func (ams AmazonMWSSource) AsConcurSource() (*ConcurSource, bool) { + return nil, false +} + +// AsAzurePostgreSQLSource is the BasicCopySource implementation for AmazonMWSSource. +func (ams AmazonMWSSource) AsAzurePostgreSQLSource() (*AzurePostgreSQLSource, bool) { + return nil, false +} + +// AsAmazonMWSSource is the BasicCopySource implementation for AmazonMWSSource. +func (ams AmazonMWSSource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { + return &ams, true +} + +// AsHTTPSource is the BasicCopySource implementation for AmazonMWSSource. +func (ams AmazonMWSSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for AmazonMWSSource. +func (ams AmazonMWSSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for AmazonMWSSource. +func (ams AmazonMWSSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsCassandraSource is the BasicCopySource implementation for AmazonMWSSource. +func (ams AmazonMWSSource) AsCassandraSource() (*CassandraSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for AmazonMWSSource. +func (ams AmazonMWSSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for AmazonMWSSource. +func (ams AmazonMWSSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureMySQLSource is the BasicCopySource implementation for AmazonMWSSource. +func (ams AmazonMWSSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for AmazonMWSSource. +func (ams AmazonMWSSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for AmazonMWSSource. +func (ams AmazonMWSSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsSQLDWSource is the BasicCopySource implementation for AmazonMWSSource. +func (ams AmazonMWSSource) AsSQLDWSource() (*SQLDWSource, bool) { + return nil, false +} + +// AsSQLSource is the BasicCopySource implementation for AmazonMWSSource. +func (ams AmazonMWSSource) AsSQLSource() (*SQLSource, bool) { + return nil, false +} + +// AsSapEccSource is the BasicCopySource implementation for AmazonMWSSource. +func (ams AmazonMWSSource) AsSapEccSource() (*SapEccSource, bool) { + return nil, false +} + +// AsSapCloudForCustomerSource is the BasicCopySource implementation for AmazonMWSSource. +func (ams AmazonMWSSource) AsSapCloudForCustomerSource() (*SapCloudForCustomerSource, bool) { + return nil, false +} + +// AsSalesforceSource is the BasicCopySource implementation for AmazonMWSSource. +func (ams AmazonMWSSource) AsSalesforceSource() (*SalesforceSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for AmazonMWSSource. +func (ams AmazonMWSSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for AmazonMWSSource. +func (ams AmazonMWSSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for AmazonMWSSource. +func (ams AmazonMWSSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for AmazonMWSSource. +func (ams AmazonMWSSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + +// AsAzureTableSource is the BasicCopySource implementation for AmazonMWSSource. +func (ams AmazonMWSSource) AsAzureTableSource() (*AzureTableSource, bool) { + return nil, false +} + +// AsCopySource is the BasicCopySource implementation for AmazonMWSSource. +func (ams AmazonMWSSource) AsCopySource() (*CopySource, bool) { + return nil, false +} + +// AsBasicCopySource is the BasicCopySource implementation for AmazonMWSSource. +func (ams AmazonMWSSource) AsBasicCopySource() (BasicCopySource, bool) { + return &ams, true +} + +// AmazonRedshiftLinkedService linked service for Amazon Redshift. +type AmazonRedshiftLinkedService struct { + // AmazonRedshiftLinkedServiceTypeProperties - Amazon Redshift linked service properties. + *AmazonRedshiftLinkedServiceTypeProperties `json:"typeProperties,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // ConnectVia - The integration runtime reference. + ConnectVia *IntegrationRuntimeReference `json:"connectVia,omitempty"` + // Description - Linked service description. + Description *string `json:"description,omitempty"` + // Parameters - Parameters for linked service. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeLinkedService', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforce', 'TypeAzureDataLakeStore', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureStorage' + Type TypeBasicLinkedService `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for AmazonRedshiftLinkedService. +func (arls AmazonRedshiftLinkedService) MarshalJSON() ([]byte, error) { + arls.Type = TypeAmazonRedshift + objectMap := make(map[string]interface{}) + if arls.AmazonRedshiftLinkedServiceTypeProperties != nil { + objectMap["typeProperties"] = arls.AmazonRedshiftLinkedServiceTypeProperties + } + if arls.ConnectVia != nil { + objectMap["connectVia"] = arls.ConnectVia + } + if arls.Description != nil { + objectMap["description"] = arls.Description + } + if arls.Parameters != nil { + objectMap["parameters"] = arls.Parameters + } + if arls.Annotations != nil { + objectMap["annotations"] = arls.Annotations + } + if arls.Type != "" { + objectMap["type"] = arls.Type + } + for k, v := range arls.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysLinkedService is the BasicLinkedService implementation for AmazonRedshiftLinkedService. +func (arls AmazonRedshiftLinkedService) AsResponsysLinkedService() (*ResponsysLinkedService, bool) { + return nil, false +} + +// AsAzureDatabricksLinkedService is the BasicLinkedService implementation for AmazonRedshiftLinkedService. +func (arls AmazonRedshiftLinkedService) AsAzureDatabricksLinkedService() (*AzureDatabricksLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeAnalyticsLinkedService is the BasicLinkedService implementation for AmazonRedshiftLinkedService. +func (arls AmazonRedshiftLinkedService) AsAzureDataLakeAnalyticsLinkedService() (*AzureDataLakeAnalyticsLinkedService, bool) { + return nil, false +} + +// AsHDInsightOnDemandLinkedService is the BasicLinkedService implementation for AmazonRedshiftLinkedService. +func (arls AmazonRedshiftLinkedService) AsHDInsightOnDemandLinkedService() (*HDInsightOnDemandLinkedService, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudLinkedService is the BasicLinkedService implementation for AmazonRedshiftLinkedService. +func (arls AmazonRedshiftLinkedService) AsSalesforceMarketingCloudLinkedService() (*SalesforceMarketingCloudLinkedService, bool) { + return nil, false +} + +// AsNetezzaLinkedService is the BasicLinkedService implementation for AmazonRedshiftLinkedService. +func (arls AmazonRedshiftLinkedService) AsNetezzaLinkedService() (*NetezzaLinkedService, bool) { + return nil, false +} + +// AsVerticaLinkedService is the BasicLinkedService implementation for AmazonRedshiftLinkedService. +func (arls AmazonRedshiftLinkedService) AsVerticaLinkedService() (*VerticaLinkedService, bool) { + return nil, false +} + +// AsZohoLinkedService is the BasicLinkedService implementation for AmazonRedshiftLinkedService. +func (arls AmazonRedshiftLinkedService) AsZohoLinkedService() (*ZohoLinkedService, bool) { + return nil, false +} + +// AsXeroLinkedService is the BasicLinkedService implementation for AmazonRedshiftLinkedService. +func (arls AmazonRedshiftLinkedService) AsXeroLinkedService() (*XeroLinkedService, bool) { + return nil, false +} + +// AsSquareLinkedService is the BasicLinkedService implementation for AmazonRedshiftLinkedService. +func (arls AmazonRedshiftLinkedService) AsSquareLinkedService() (*SquareLinkedService, bool) { + return nil, false +} + +// AsSparkLinkedService is the BasicLinkedService implementation for AmazonRedshiftLinkedService. +func (arls AmazonRedshiftLinkedService) AsSparkLinkedService() (*SparkLinkedService, bool) { + return nil, false +} + +// AsShopifyLinkedService is the BasicLinkedService implementation for AmazonRedshiftLinkedService. +func (arls AmazonRedshiftLinkedService) AsShopifyLinkedService() (*ShopifyLinkedService, bool) { + return nil, false +} + +// AsServiceNowLinkedService is the BasicLinkedService implementation for AmazonRedshiftLinkedService. +func (arls AmazonRedshiftLinkedService) AsServiceNowLinkedService() (*ServiceNowLinkedService, bool) { + return nil, false +} + +// AsQuickBooksLinkedService is the BasicLinkedService implementation for AmazonRedshiftLinkedService. +func (arls AmazonRedshiftLinkedService) AsQuickBooksLinkedService() (*QuickBooksLinkedService, bool) { + return nil, false +} + +// AsPrestoLinkedService is the BasicLinkedService implementation for AmazonRedshiftLinkedService. +func (arls AmazonRedshiftLinkedService) AsPrestoLinkedService() (*PrestoLinkedService, bool) { + return nil, false +} + +// AsPhoenixLinkedService is the BasicLinkedService implementation for AmazonRedshiftLinkedService. +func (arls AmazonRedshiftLinkedService) AsPhoenixLinkedService() (*PhoenixLinkedService, bool) { + return nil, false +} + +// AsPaypalLinkedService is the BasicLinkedService implementation for AmazonRedshiftLinkedService. +func (arls AmazonRedshiftLinkedService) AsPaypalLinkedService() (*PaypalLinkedService, bool) { + return nil, false +} + +// AsMarketoLinkedService is the BasicLinkedService implementation for AmazonRedshiftLinkedService. +func (arls AmazonRedshiftLinkedService) AsMarketoLinkedService() (*MarketoLinkedService, bool) { + return nil, false +} + +// AsMariaDBLinkedService is the BasicLinkedService implementation for AmazonRedshiftLinkedService. +func (arls AmazonRedshiftLinkedService) AsMariaDBLinkedService() (*MariaDBLinkedService, bool) { + return nil, false +} + +// AsMagentoLinkedService is the BasicLinkedService implementation for AmazonRedshiftLinkedService. +func (arls AmazonRedshiftLinkedService) AsMagentoLinkedService() (*MagentoLinkedService, bool) { + return nil, false +} + +// AsJiraLinkedService is the BasicLinkedService implementation for AmazonRedshiftLinkedService. +func (arls AmazonRedshiftLinkedService) AsJiraLinkedService() (*JiraLinkedService, bool) { + return nil, false +} + +// AsImpalaLinkedService is the BasicLinkedService implementation for AmazonRedshiftLinkedService. +func (arls AmazonRedshiftLinkedService) AsImpalaLinkedService() (*ImpalaLinkedService, bool) { + return nil, false +} + +// AsHubspotLinkedService is the BasicLinkedService implementation for AmazonRedshiftLinkedService. +func (arls AmazonRedshiftLinkedService) AsHubspotLinkedService() (*HubspotLinkedService, bool) { + return nil, false +} + +// AsHiveLinkedService is the BasicLinkedService implementation for AmazonRedshiftLinkedService. +func (arls AmazonRedshiftLinkedService) AsHiveLinkedService() (*HiveLinkedService, bool) { + return nil, false +} + +// AsHBaseLinkedService is the BasicLinkedService implementation for AmazonRedshiftLinkedService. +func (arls AmazonRedshiftLinkedService) AsHBaseLinkedService() (*HBaseLinkedService, bool) { + return nil, false +} + +// AsGreenplumLinkedService is the BasicLinkedService implementation for AmazonRedshiftLinkedService. +func (arls AmazonRedshiftLinkedService) AsGreenplumLinkedService() (*GreenplumLinkedService, bool) { + return nil, false +} + +// AsGoogleBigQueryLinkedService is the BasicLinkedService implementation for AmazonRedshiftLinkedService. +func (arls AmazonRedshiftLinkedService) AsGoogleBigQueryLinkedService() (*GoogleBigQueryLinkedService, bool) { + return nil, false +} + +// AsEloquaLinkedService is the BasicLinkedService implementation for AmazonRedshiftLinkedService. +func (arls AmazonRedshiftLinkedService) AsEloquaLinkedService() (*EloquaLinkedService, bool) { + return nil, false +} + +// AsDrillLinkedService is the BasicLinkedService implementation for AmazonRedshiftLinkedService. +func (arls AmazonRedshiftLinkedService) AsDrillLinkedService() (*DrillLinkedService, bool) { + return nil, false +} + +// AsCouchbaseLinkedService is the BasicLinkedService implementation for AmazonRedshiftLinkedService. +func (arls AmazonRedshiftLinkedService) AsCouchbaseLinkedService() (*CouchbaseLinkedService, bool) { + return nil, false +} + +// AsConcurLinkedService is the BasicLinkedService implementation for AmazonRedshiftLinkedService. +func (arls AmazonRedshiftLinkedService) AsConcurLinkedService() (*ConcurLinkedService, bool) { + return nil, false +} + +// AsAzurePostgreSQLLinkedService is the BasicLinkedService implementation for AmazonRedshiftLinkedService. +func (arls AmazonRedshiftLinkedService) AsAzurePostgreSQLLinkedService() (*AzurePostgreSQLLinkedService, bool) { + return nil, false +} + +// AsAmazonMWSLinkedService is the BasicLinkedService implementation for AmazonRedshiftLinkedService. +func (arls AmazonRedshiftLinkedService) AsAmazonMWSLinkedService() (*AmazonMWSLinkedService, bool) { + return nil, false +} + +// AsSapHanaLinkedService is the BasicLinkedService implementation for AmazonRedshiftLinkedService. +func (arls AmazonRedshiftLinkedService) AsSapHanaLinkedService() (*SapHanaLinkedService, bool) { + return nil, false +} + +// AsSapBWLinkedService is the BasicLinkedService implementation for AmazonRedshiftLinkedService. +func (arls AmazonRedshiftLinkedService) AsSapBWLinkedService() (*SapBWLinkedService, bool) { + return nil, false +} + +// AsSftpServerLinkedService is the BasicLinkedService implementation for AmazonRedshiftLinkedService. +func (arls AmazonRedshiftLinkedService) AsSftpServerLinkedService() (*SftpServerLinkedService, bool) { + return nil, false +} + +// AsFtpServerLinkedService is the BasicLinkedService implementation for AmazonRedshiftLinkedService. +func (arls AmazonRedshiftLinkedService) AsFtpServerLinkedService() (*FtpServerLinkedService, bool) { + return nil, false +} + +// AsHTTPLinkedService is the BasicLinkedService implementation for AmazonRedshiftLinkedService. +func (arls AmazonRedshiftLinkedService) AsHTTPLinkedService() (*HTTPLinkedService, bool) { + return nil, false +} + +// AsAzureSearchLinkedService is the BasicLinkedService implementation for AmazonRedshiftLinkedService. +func (arls AmazonRedshiftLinkedService) AsAzureSearchLinkedService() (*AzureSearchLinkedService, bool) { + return nil, false +} + +// AsCustomDataSourceLinkedService is the BasicLinkedService implementation for AmazonRedshiftLinkedService. +func (arls AmazonRedshiftLinkedService) AsCustomDataSourceLinkedService() (*CustomDataSourceLinkedService, bool) { + return nil, false +} + +// AsAmazonRedshiftLinkedService is the BasicLinkedService implementation for AmazonRedshiftLinkedService. +func (arls AmazonRedshiftLinkedService) AsAmazonRedshiftLinkedService() (*AmazonRedshiftLinkedService, bool) { + return &arls, true +} + +// AsAmazonS3LinkedService is the BasicLinkedService implementation for AmazonRedshiftLinkedService. +func (arls AmazonRedshiftLinkedService) AsAmazonS3LinkedService() (*AmazonS3LinkedService, bool) { + return nil, false +} + +// AsSapEccLinkedService is the BasicLinkedService implementation for AmazonRedshiftLinkedService. +func (arls AmazonRedshiftLinkedService) AsSapEccLinkedService() (*SapEccLinkedService, bool) { + return nil, false +} + +// AsSapCloudForCustomerLinkedService is the BasicLinkedService implementation for AmazonRedshiftLinkedService. +func (arls AmazonRedshiftLinkedService) AsSapCloudForCustomerLinkedService() (*SapCloudForCustomerLinkedService, bool) { + return nil, false +} + +// AsSalesforceLinkedService is the BasicLinkedService implementation for AmazonRedshiftLinkedService. +func (arls AmazonRedshiftLinkedService) AsSalesforceLinkedService() (*SalesforceLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeStoreLinkedService is the BasicLinkedService implementation for AmazonRedshiftLinkedService. +func (arls AmazonRedshiftLinkedService) AsAzureDataLakeStoreLinkedService() (*AzureDataLakeStoreLinkedService, bool) { + return nil, false +} + +// AsMongoDbLinkedService is the BasicLinkedService implementation for AmazonRedshiftLinkedService. +func (arls AmazonRedshiftLinkedService) AsMongoDbLinkedService() (*MongoDbLinkedService, bool) { + return nil, false +} + +// AsCassandraLinkedService is the BasicLinkedService implementation for AmazonRedshiftLinkedService. +func (arls AmazonRedshiftLinkedService) AsCassandraLinkedService() (*CassandraLinkedService, bool) { + return nil, false +} + +// AsWebLinkedService is the BasicLinkedService implementation for AmazonRedshiftLinkedService. +func (arls AmazonRedshiftLinkedService) AsWebLinkedService() (*WebLinkedService, bool) { + return nil, false +} + +// AsODataLinkedService is the BasicLinkedService implementation for AmazonRedshiftLinkedService. +func (arls AmazonRedshiftLinkedService) AsODataLinkedService() (*ODataLinkedService, bool) { + return nil, false +} + +// AsHdfsLinkedService is the BasicLinkedService implementation for AmazonRedshiftLinkedService. +func (arls AmazonRedshiftLinkedService) AsHdfsLinkedService() (*HdfsLinkedService, bool) { + return nil, false +} + +// AsOdbcLinkedService is the BasicLinkedService implementation for AmazonRedshiftLinkedService. +func (arls AmazonRedshiftLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, bool) { + return nil, false +} + +// AsAzureMLLinkedService is the BasicLinkedService implementation for AmazonRedshiftLinkedService. +func (arls AmazonRedshiftLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { + return nil, false +} + +// AsTeradataLinkedService is the BasicLinkedService implementation for AmazonRedshiftLinkedService. +func (arls AmazonRedshiftLinkedService) AsTeradataLinkedService() (*TeradataLinkedService, bool) { + return nil, false +} + +// AsDb2LinkedService is the BasicLinkedService implementation for AmazonRedshiftLinkedService. +func (arls AmazonRedshiftLinkedService) AsDb2LinkedService() (*Db2LinkedService, bool) { + return nil, false +} + +// AsSybaseLinkedService is the BasicLinkedService implementation for AmazonRedshiftLinkedService. +func (arls AmazonRedshiftLinkedService) AsSybaseLinkedService() (*SybaseLinkedService, bool) { + return nil, false +} + +// AsPostgreSQLLinkedService is the BasicLinkedService implementation for AmazonRedshiftLinkedService. +func (arls AmazonRedshiftLinkedService) AsPostgreSQLLinkedService() (*PostgreSQLLinkedService, bool) { + return nil, false +} + +// AsMySQLLinkedService is the BasicLinkedService implementation for AmazonRedshiftLinkedService. +func (arls AmazonRedshiftLinkedService) AsMySQLLinkedService() (*MySQLLinkedService, bool) { + return nil, false +} + +// AsAzureMySQLLinkedService is the BasicLinkedService implementation for AmazonRedshiftLinkedService. +func (arls AmazonRedshiftLinkedService) AsAzureMySQLLinkedService() (*AzureMySQLLinkedService, bool) { + return nil, false +} + +// AsOracleLinkedService is the BasicLinkedService implementation for AmazonRedshiftLinkedService. +func (arls AmazonRedshiftLinkedService) AsOracleLinkedService() (*OracleLinkedService, bool) { + return nil, false +} + +// AsFileServerLinkedService is the BasicLinkedService implementation for AmazonRedshiftLinkedService. +func (arls AmazonRedshiftLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { + return nil, false +} + +// AsHDInsightLinkedService is the BasicLinkedService implementation for AmazonRedshiftLinkedService. +func (arls AmazonRedshiftLinkedService) AsHDInsightLinkedService() (*HDInsightLinkedService, bool) { + return nil, false +} + +// AsDynamicsLinkedService is the BasicLinkedService implementation for AmazonRedshiftLinkedService. +func (arls AmazonRedshiftLinkedService) AsDynamicsLinkedService() (*DynamicsLinkedService, bool) { + return nil, false +} + +// AsCosmosDbLinkedService is the BasicLinkedService implementation for AmazonRedshiftLinkedService. +func (arls AmazonRedshiftLinkedService) AsCosmosDbLinkedService() (*CosmosDbLinkedService, bool) { + return nil, false +} + +// AsAzureKeyVaultLinkedService is the BasicLinkedService implementation for AmazonRedshiftLinkedService. +func (arls AmazonRedshiftLinkedService) AsAzureKeyVaultLinkedService() (*AzureKeyVaultLinkedService, bool) { + return nil, false +} + +// AsAzureBatchLinkedService is the BasicLinkedService implementation for AmazonRedshiftLinkedService. +func (arls AmazonRedshiftLinkedService) AsAzureBatchLinkedService() (*AzureBatchLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDatabaseLinkedService is the BasicLinkedService implementation for AmazonRedshiftLinkedService. +func (arls AmazonRedshiftLinkedService) AsAzureSQLDatabaseLinkedService() (*AzureSQLDatabaseLinkedService, bool) { + return nil, false +} + +// AsSQLServerLinkedService is the BasicLinkedService implementation for AmazonRedshiftLinkedService. +func (arls AmazonRedshiftLinkedService) AsSQLServerLinkedService() (*SQLServerLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDWLinkedService is the BasicLinkedService implementation for AmazonRedshiftLinkedService. +func (arls AmazonRedshiftLinkedService) AsAzureSQLDWLinkedService() (*AzureSQLDWLinkedService, bool) { + return nil, false +} + +// AsAzureStorageLinkedService is the BasicLinkedService implementation for AmazonRedshiftLinkedService. +func (arls AmazonRedshiftLinkedService) AsAzureStorageLinkedService() (*AzureStorageLinkedService, bool) { + return nil, false +} + +// AsLinkedService is the BasicLinkedService implementation for AmazonRedshiftLinkedService. +func (arls AmazonRedshiftLinkedService) AsLinkedService() (*LinkedService, bool) { + return nil, false +} + +// AsBasicLinkedService is the BasicLinkedService implementation for AmazonRedshiftLinkedService. +func (arls AmazonRedshiftLinkedService) AsBasicLinkedService() (BasicLinkedService, bool) { + return &arls, true +} + +// UnmarshalJSON is the custom unmarshaler for AmazonRedshiftLinkedService struct. +func (arls *AmazonRedshiftLinkedService) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "typeProperties": + if v != nil { + var amazonRedshiftLinkedServiceTypeProperties AmazonRedshiftLinkedServiceTypeProperties + err = json.Unmarshal(*v, &amazonRedshiftLinkedServiceTypeProperties) + if err != nil { + return err + } + arls.AmazonRedshiftLinkedServiceTypeProperties = &amazonRedshiftLinkedServiceTypeProperties + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if arls.AdditionalProperties == nil { + arls.AdditionalProperties = make(map[string]interface{}) + } + arls.AdditionalProperties[k] = additionalProperties + } + case "connectVia": + if v != nil { + var connectVia IntegrationRuntimeReference + err = json.Unmarshal(*v, &connectVia) + if err != nil { + return err + } + arls.ConnectVia = &connectVia + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + arls.Description = &description + } + case "parameters": + if v != nil { + var parameters map[string]*ParameterSpecification + err = json.Unmarshal(*v, ¶meters) + if err != nil { + return err + } + arls.Parameters = parameters + } + case "annotations": + if v != nil { + var annotations []interface{} + err = json.Unmarshal(*v, &annotations) + if err != nil { + return err + } + arls.Annotations = &annotations + } + case "type": + if v != nil { + var typeVar TypeBasicLinkedService + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + arls.Type = typeVar + } + } + } + + return nil +} + +// AmazonRedshiftLinkedServiceTypeProperties amazon Redshift linked service properties. +type AmazonRedshiftLinkedServiceTypeProperties struct { + // Server - The name of the Amazon Redshift server. Type: string (or Expression with resultType string). + Server interface{} `json:"server,omitempty"` + // Username - The username of the Amazon Redshift source. Type: string (or Expression with resultType string). + Username interface{} `json:"username,omitempty"` + // Password - The password of the Amazon Redshift source. + Password BasicSecretBase `json:"password,omitempty"` + // Database - The database name of the Amazon Redshift source. Type: string (or Expression with resultType string). + Database interface{} `json:"database,omitempty"` + // Port - The TCP port number that the Amazon Redshift server uses to listen for client connections. The default value is 5439. Type: integer (or Expression with resultType integer). + Port interface{} `json:"port,omitempty"` + // EncryptedCredential - The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string). + EncryptedCredential interface{} `json:"encryptedCredential,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for AmazonRedshiftLinkedServiceTypeProperties struct. +func (arlstp *AmazonRedshiftLinkedServiceTypeProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "server": + if v != nil { + var server interface{} + err = json.Unmarshal(*v, &server) + if err != nil { + return err + } + arlstp.Server = server + } + case "username": + if v != nil { + var username interface{} + err = json.Unmarshal(*v, &username) + if err != nil { + return err + } + arlstp.Username = username + } + case "password": + if v != nil { + password, err := unmarshalBasicSecretBase(*v) + if err != nil { + return err + } + arlstp.Password = password + } + case "database": + if v != nil { + var databaseVar interface{} + err = json.Unmarshal(*v, &databaseVar) + if err != nil { + return err + } + arlstp.Database = databaseVar + } + case "port": + if v != nil { + var port interface{} + err = json.Unmarshal(*v, &port) + if err != nil { + return err + } + arlstp.Port = port + } + case "encryptedCredential": + if v != nil { + var encryptedCredential interface{} + err = json.Unmarshal(*v, &encryptedCredential) + if err != nil { + return err + } + arlstp.EncryptedCredential = encryptedCredential + } + } + } + + return nil +} + +// AmazonRedshiftSource a copy activity source for Amazon Redshift Source. +type AmazonRedshiftSource struct { + // Query - Database query. Type: string (or Expression with resultType string). + Query interface{} `json:"query,omitempty"` + // RedshiftUnloadSettings - The Amazon S3 settings needed for the interim Amazon S3 when copying from Amazon Redshift with unload. With this, data from Amazon Redshift source will be unloaded into S3 first and then copied into the targeted sink from the interim S3. + RedshiftUnloadSettings *RedshiftUnloadSettings `json:"redshiftUnloadSettings,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // SourceRetryCount - Source retry count. Type: integer (or Expression with resultType integer). + SourceRetryCount interface{} `json:"sourceRetryCount,omitempty"` + // SourceRetryWait - Source retry wait. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` + // Type - Possible values include: 'TypeCopySource', 'TypeAmazonRedshiftSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeHTTPSource', 'TypeAzureDataLakeStoreSource', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeRelationalSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource' + Type TypeBasicCopySource `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for AmazonRedshiftSource. +func (ars AmazonRedshiftSource) MarshalJSON() ([]byte, error) { + ars.Type = TypeAmazonRedshiftSource + objectMap := make(map[string]interface{}) + objectMap["query"] = ars.Query + if ars.RedshiftUnloadSettings != nil { + objectMap["redshiftUnloadSettings"] = ars.RedshiftUnloadSettings + } + objectMap["sourceRetryCount"] = ars.SourceRetryCount + objectMap["sourceRetryWait"] = ars.SourceRetryWait + if ars.Type != "" { + objectMap["type"] = ars.Type + } + for k, v := range ars.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsAmazonRedshiftSource is the BasicCopySource implementation for AmazonRedshiftSource. +func (ars AmazonRedshiftSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { + return &ars, true +} + +// AsResponsysSource is the BasicCopySource implementation for AmazonRedshiftSource. +func (ars AmazonRedshiftSource) AsResponsysSource() (*ResponsysSource, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudSource is the BasicCopySource implementation for AmazonRedshiftSource. +func (ars AmazonRedshiftSource) AsSalesforceMarketingCloudSource() (*SalesforceMarketingCloudSource, bool) { + return nil, false +} + +// AsVerticaSource is the BasicCopySource implementation for AmazonRedshiftSource. +func (ars AmazonRedshiftSource) AsVerticaSource() (*VerticaSource, bool) { + return nil, false +} + +// AsNetezzaSource is the BasicCopySource implementation for AmazonRedshiftSource. +func (ars AmazonRedshiftSource) AsNetezzaSource() (*NetezzaSource, bool) { + return nil, false +} + +// AsZohoSource is the BasicCopySource implementation for AmazonRedshiftSource. +func (ars AmazonRedshiftSource) AsZohoSource() (*ZohoSource, bool) { + return nil, false +} + +// AsXeroSource is the BasicCopySource implementation for AmazonRedshiftSource. +func (ars AmazonRedshiftSource) AsXeroSource() (*XeroSource, bool) { + return nil, false +} + +// AsSquareSource is the BasicCopySource implementation for AmazonRedshiftSource. +func (ars AmazonRedshiftSource) AsSquareSource() (*SquareSource, bool) { + return nil, false +} + +// AsSparkSource is the BasicCopySource implementation for AmazonRedshiftSource. +func (ars AmazonRedshiftSource) AsSparkSource() (*SparkSource, bool) { + return nil, false +} + +// AsShopifySource is the BasicCopySource implementation for AmazonRedshiftSource. +func (ars AmazonRedshiftSource) AsShopifySource() (*ShopifySource, bool) { + return nil, false +} + +// AsServiceNowSource is the BasicCopySource implementation for AmazonRedshiftSource. +func (ars AmazonRedshiftSource) AsServiceNowSource() (*ServiceNowSource, bool) { + return nil, false +} + +// AsQuickBooksSource is the BasicCopySource implementation for AmazonRedshiftSource. +func (ars AmazonRedshiftSource) AsQuickBooksSource() (*QuickBooksSource, bool) { + return nil, false +} + +// AsPrestoSource is the BasicCopySource implementation for AmazonRedshiftSource. +func (ars AmazonRedshiftSource) AsPrestoSource() (*PrestoSource, bool) { + return nil, false +} + +// AsPhoenixSource is the BasicCopySource implementation for AmazonRedshiftSource. +func (ars AmazonRedshiftSource) AsPhoenixSource() (*PhoenixSource, bool) { + return nil, false +} + +// AsPaypalSource is the BasicCopySource implementation for AmazonRedshiftSource. +func (ars AmazonRedshiftSource) AsPaypalSource() (*PaypalSource, bool) { + return nil, false +} + +// AsMarketoSource is the BasicCopySource implementation for AmazonRedshiftSource. +func (ars AmazonRedshiftSource) AsMarketoSource() (*MarketoSource, bool) { + return nil, false +} + +// AsMariaDBSource is the BasicCopySource implementation for AmazonRedshiftSource. +func (ars AmazonRedshiftSource) AsMariaDBSource() (*MariaDBSource, bool) { + return nil, false +} + +// AsMagentoSource is the BasicCopySource implementation for AmazonRedshiftSource. +func (ars AmazonRedshiftSource) AsMagentoSource() (*MagentoSource, bool) { + return nil, false +} + +// AsJiraSource is the BasicCopySource implementation for AmazonRedshiftSource. +func (ars AmazonRedshiftSource) AsJiraSource() (*JiraSource, bool) { + return nil, false +} + +// AsImpalaSource is the BasicCopySource implementation for AmazonRedshiftSource. +func (ars AmazonRedshiftSource) AsImpalaSource() (*ImpalaSource, bool) { + return nil, false +} + +// AsHubspotSource is the BasicCopySource implementation for AmazonRedshiftSource. +func (ars AmazonRedshiftSource) AsHubspotSource() (*HubspotSource, bool) { + return nil, false +} + +// AsHiveSource is the BasicCopySource implementation for AmazonRedshiftSource. +func (ars AmazonRedshiftSource) AsHiveSource() (*HiveSource, bool) { + return nil, false +} + +// AsHBaseSource is the BasicCopySource implementation for AmazonRedshiftSource. +func (ars AmazonRedshiftSource) AsHBaseSource() (*HBaseSource, bool) { + return nil, false +} + +// AsGreenplumSource is the BasicCopySource implementation for AmazonRedshiftSource. +func (ars AmazonRedshiftSource) AsGreenplumSource() (*GreenplumSource, bool) { + return nil, false +} + +// AsGoogleBigQuerySource is the BasicCopySource implementation for AmazonRedshiftSource. +func (ars AmazonRedshiftSource) AsGoogleBigQuerySource() (*GoogleBigQuerySource, bool) { + return nil, false +} + +// AsEloquaSource is the BasicCopySource implementation for AmazonRedshiftSource. +func (ars AmazonRedshiftSource) AsEloquaSource() (*EloquaSource, bool) { + return nil, false +} + +// AsDrillSource is the BasicCopySource implementation for AmazonRedshiftSource. +func (ars AmazonRedshiftSource) AsDrillSource() (*DrillSource, bool) { + return nil, false +} + +// AsCouchbaseSource is the BasicCopySource implementation for AmazonRedshiftSource. +func (ars AmazonRedshiftSource) AsCouchbaseSource() (*CouchbaseSource, bool) { + return nil, false +} + +// AsConcurSource is the BasicCopySource implementation for AmazonRedshiftSource. +func (ars AmazonRedshiftSource) AsConcurSource() (*ConcurSource, bool) { + return nil, false +} + +// AsAzurePostgreSQLSource is the BasicCopySource implementation for AmazonRedshiftSource. +func (ars AmazonRedshiftSource) AsAzurePostgreSQLSource() (*AzurePostgreSQLSource, bool) { + return nil, false +} + +// AsAmazonMWSSource is the BasicCopySource implementation for AmazonRedshiftSource. +func (ars AmazonRedshiftSource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { + return nil, false +} + +// AsHTTPSource is the BasicCopySource implementation for AmazonRedshiftSource. +func (ars AmazonRedshiftSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for AmazonRedshiftSource. +func (ars AmazonRedshiftSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for AmazonRedshiftSource. +func (ars AmazonRedshiftSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsCassandraSource is the BasicCopySource implementation for AmazonRedshiftSource. +func (ars AmazonRedshiftSource) AsCassandraSource() (*CassandraSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for AmazonRedshiftSource. +func (ars AmazonRedshiftSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for AmazonRedshiftSource. +func (ars AmazonRedshiftSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureMySQLSource is the BasicCopySource implementation for AmazonRedshiftSource. +func (ars AmazonRedshiftSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for AmazonRedshiftSource. +func (ars AmazonRedshiftSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for AmazonRedshiftSource. +func (ars AmazonRedshiftSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsSQLDWSource is the BasicCopySource implementation for AmazonRedshiftSource. +func (ars AmazonRedshiftSource) AsSQLDWSource() (*SQLDWSource, bool) { + return nil, false +} + +// AsSQLSource is the BasicCopySource implementation for AmazonRedshiftSource. +func (ars AmazonRedshiftSource) AsSQLSource() (*SQLSource, bool) { + return nil, false +} + +// AsSapEccSource is the BasicCopySource implementation for AmazonRedshiftSource. +func (ars AmazonRedshiftSource) AsSapEccSource() (*SapEccSource, bool) { + return nil, false +} + +// AsSapCloudForCustomerSource is the BasicCopySource implementation for AmazonRedshiftSource. +func (ars AmazonRedshiftSource) AsSapCloudForCustomerSource() (*SapCloudForCustomerSource, bool) { + return nil, false +} + +// AsSalesforceSource is the BasicCopySource implementation for AmazonRedshiftSource. +func (ars AmazonRedshiftSource) AsSalesforceSource() (*SalesforceSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for AmazonRedshiftSource. +func (ars AmazonRedshiftSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for AmazonRedshiftSource. +func (ars AmazonRedshiftSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for AmazonRedshiftSource. +func (ars AmazonRedshiftSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for AmazonRedshiftSource. +func (ars AmazonRedshiftSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + +// AsAzureTableSource is the BasicCopySource implementation for AmazonRedshiftSource. +func (ars AmazonRedshiftSource) AsAzureTableSource() (*AzureTableSource, bool) { + return nil, false +} + +// AsCopySource is the BasicCopySource implementation for AmazonRedshiftSource. +func (ars AmazonRedshiftSource) AsCopySource() (*CopySource, bool) { + return nil, false +} + +// AsBasicCopySource is the BasicCopySource implementation for AmazonRedshiftSource. +func (ars AmazonRedshiftSource) AsBasicCopySource() (BasicCopySource, bool) { + return &ars, true +} + +// AmazonS3Dataset a single Amazon Simple Storage Service (S3) object or a set of S3 objects. +type AmazonS3Dataset struct { + // AmazonS3DatasetTypeProperties - Amazon S3 dataset properties. + *AmazonS3DatasetTypeProperties `json:"typeProperties,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Description - Dataset description. + Description *string `json:"description,omitempty"` + // Structure - Columns that define the structure of the dataset. Type: array (or Expression with resultType array), itemType: DatasetDataElement. + Structure interface{} `json:"structure,omitempty"` + // LinkedServiceName - Linked service reference. + LinkedServiceName *LinkedServiceReference `json:"linkedServiceName,omitempty"` + // Parameters - Parameters for dataset. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeDataset', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSQLServerTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSalesforceObject', 'TypeRelationalTable', 'TypeAzureMySQLTable', 'TypeOracleTable', 'TypeODataResource', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeAzureDataLakeStoreFile', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeAmazonS3Object' + Type TypeBasicDataset `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for AmazonS3Dataset. +func (asd AmazonS3Dataset) MarshalJSON() ([]byte, error) { + asd.Type = TypeAmazonS3Object + objectMap := make(map[string]interface{}) + if asd.AmazonS3DatasetTypeProperties != nil { + objectMap["typeProperties"] = asd.AmazonS3DatasetTypeProperties + } + if asd.Description != nil { + objectMap["description"] = asd.Description + } + objectMap["structure"] = asd.Structure + if asd.LinkedServiceName != nil { + objectMap["linkedServiceName"] = asd.LinkedServiceName + } + if asd.Parameters != nil { + objectMap["parameters"] = asd.Parameters + } + if asd.Annotations != nil { + objectMap["annotations"] = asd.Annotations + } + if asd.Type != "" { + objectMap["type"] = asd.Type + } + for k, v := range asd.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysObjectDataset is the BasicDataset implementation for AmazonS3Dataset. +func (asd AmazonS3Dataset) AsResponsysObjectDataset() (*ResponsysObjectDataset, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudObjectDataset is the BasicDataset implementation for AmazonS3Dataset. +func (asd AmazonS3Dataset) AsSalesforceMarketingCloudObjectDataset() (*SalesforceMarketingCloudObjectDataset, bool) { + return nil, false +} + +// AsVerticaTableDataset is the BasicDataset implementation for AmazonS3Dataset. +func (asd AmazonS3Dataset) AsVerticaTableDataset() (*VerticaTableDataset, bool) { + return nil, false +} + +// AsNetezzaTableDataset is the BasicDataset implementation for AmazonS3Dataset. +func (asd AmazonS3Dataset) AsNetezzaTableDataset() (*NetezzaTableDataset, bool) { + return nil, false +} + +// AsZohoObjectDataset is the BasicDataset implementation for AmazonS3Dataset. +func (asd AmazonS3Dataset) AsZohoObjectDataset() (*ZohoObjectDataset, bool) { + return nil, false +} + +// AsXeroObjectDataset is the BasicDataset implementation for AmazonS3Dataset. +func (asd AmazonS3Dataset) AsXeroObjectDataset() (*XeroObjectDataset, bool) { + return nil, false +} + +// AsSquareObjectDataset is the BasicDataset implementation for AmazonS3Dataset. +func (asd AmazonS3Dataset) AsSquareObjectDataset() (*SquareObjectDataset, bool) { + return nil, false +} + +// AsSparkObjectDataset is the BasicDataset implementation for AmazonS3Dataset. +func (asd AmazonS3Dataset) AsSparkObjectDataset() (*SparkObjectDataset, bool) { + return nil, false +} + +// AsShopifyObjectDataset is the BasicDataset implementation for AmazonS3Dataset. +func (asd AmazonS3Dataset) AsShopifyObjectDataset() (*ShopifyObjectDataset, bool) { + return nil, false +} + +// AsServiceNowObjectDataset is the BasicDataset implementation for AmazonS3Dataset. +func (asd AmazonS3Dataset) AsServiceNowObjectDataset() (*ServiceNowObjectDataset, bool) { + return nil, false +} + +// AsQuickBooksObjectDataset is the BasicDataset implementation for AmazonS3Dataset. +func (asd AmazonS3Dataset) AsQuickBooksObjectDataset() (*QuickBooksObjectDataset, bool) { + return nil, false +} + +// AsPrestoObjectDataset is the BasicDataset implementation for AmazonS3Dataset. +func (asd AmazonS3Dataset) AsPrestoObjectDataset() (*PrestoObjectDataset, bool) { + return nil, false +} + +// AsPhoenixObjectDataset is the BasicDataset implementation for AmazonS3Dataset. +func (asd AmazonS3Dataset) AsPhoenixObjectDataset() (*PhoenixObjectDataset, bool) { + return nil, false +} + +// AsPaypalObjectDataset is the BasicDataset implementation for AmazonS3Dataset. +func (asd AmazonS3Dataset) AsPaypalObjectDataset() (*PaypalObjectDataset, bool) { + return nil, false +} + +// AsMarketoObjectDataset is the BasicDataset implementation for AmazonS3Dataset. +func (asd AmazonS3Dataset) AsMarketoObjectDataset() (*MarketoObjectDataset, bool) { + return nil, false +} + +// AsMariaDBTableDataset is the BasicDataset implementation for AmazonS3Dataset. +func (asd AmazonS3Dataset) AsMariaDBTableDataset() (*MariaDBTableDataset, bool) { + return nil, false +} + +// AsMagentoObjectDataset is the BasicDataset implementation for AmazonS3Dataset. +func (asd AmazonS3Dataset) AsMagentoObjectDataset() (*MagentoObjectDataset, bool) { + return nil, false +} + +// AsJiraObjectDataset is the BasicDataset implementation for AmazonS3Dataset. +func (asd AmazonS3Dataset) AsJiraObjectDataset() (*JiraObjectDataset, bool) { + return nil, false +} + +// AsImpalaObjectDataset is the BasicDataset implementation for AmazonS3Dataset. +func (asd AmazonS3Dataset) AsImpalaObjectDataset() (*ImpalaObjectDataset, bool) { + return nil, false +} + +// AsHubspotObjectDataset is the BasicDataset implementation for AmazonS3Dataset. +func (asd AmazonS3Dataset) AsHubspotObjectDataset() (*HubspotObjectDataset, bool) { + return nil, false +} + +// AsHiveObjectDataset is the BasicDataset implementation for AmazonS3Dataset. +func (asd AmazonS3Dataset) AsHiveObjectDataset() (*HiveObjectDataset, bool) { + return nil, false +} + +// AsHBaseObjectDataset is the BasicDataset implementation for AmazonS3Dataset. +func (asd AmazonS3Dataset) AsHBaseObjectDataset() (*HBaseObjectDataset, bool) { + return nil, false +} + +// AsGreenplumTableDataset is the BasicDataset implementation for AmazonS3Dataset. +func (asd AmazonS3Dataset) AsGreenplumTableDataset() (*GreenplumTableDataset, bool) { + return nil, false +} + +// AsGoogleBigQueryObjectDataset is the BasicDataset implementation for AmazonS3Dataset. +func (asd AmazonS3Dataset) AsGoogleBigQueryObjectDataset() (*GoogleBigQueryObjectDataset, bool) { + return nil, false +} + +// AsEloquaObjectDataset is the BasicDataset implementation for AmazonS3Dataset. +func (asd AmazonS3Dataset) AsEloquaObjectDataset() (*EloquaObjectDataset, bool) { + return nil, false +} + +// AsDrillTableDataset is the BasicDataset implementation for AmazonS3Dataset. +func (asd AmazonS3Dataset) AsDrillTableDataset() (*DrillTableDataset, bool) { + return nil, false +} + +// AsCouchbaseTableDataset is the BasicDataset implementation for AmazonS3Dataset. +func (asd AmazonS3Dataset) AsCouchbaseTableDataset() (*CouchbaseTableDataset, bool) { + return nil, false +} + +// AsConcurObjectDataset is the BasicDataset implementation for AmazonS3Dataset. +func (asd AmazonS3Dataset) AsConcurObjectDataset() (*ConcurObjectDataset, bool) { + return nil, false +} + +// AsAzurePostgreSQLTableDataset is the BasicDataset implementation for AmazonS3Dataset. +func (asd AmazonS3Dataset) AsAzurePostgreSQLTableDataset() (*AzurePostgreSQLTableDataset, bool) { + return nil, false +} + +// AsAmazonMWSObjectDataset is the BasicDataset implementation for AmazonS3Dataset. +func (asd AmazonS3Dataset) AsAmazonMWSObjectDataset() (*AmazonMWSObjectDataset, bool) { + return nil, false +} + +// AsHTTPDataset is the BasicDataset implementation for AmazonS3Dataset. +func (asd AmazonS3Dataset) AsHTTPDataset() (*HTTPDataset, bool) { + return nil, false +} + +// AsAzureSearchIndexDataset is the BasicDataset implementation for AmazonS3Dataset. +func (asd AmazonS3Dataset) AsAzureSearchIndexDataset() (*AzureSearchIndexDataset, bool) { + return nil, false +} + +// AsWebTableDataset is the BasicDataset implementation for AmazonS3Dataset. +func (asd AmazonS3Dataset) AsWebTableDataset() (*WebTableDataset, bool) { + return nil, false +} + +// AsSQLServerTableDataset is the BasicDataset implementation for AmazonS3Dataset. +func (asd AmazonS3Dataset) AsSQLServerTableDataset() (*SQLServerTableDataset, bool) { + return nil, false +} + +// AsSapEccResourceDataset is the BasicDataset implementation for AmazonS3Dataset. +func (asd AmazonS3Dataset) AsSapEccResourceDataset() (*SapEccResourceDataset, bool) { + return nil, false +} + +// AsSapCloudForCustomerResourceDataset is the BasicDataset implementation for AmazonS3Dataset. +func (asd AmazonS3Dataset) AsSapCloudForCustomerResourceDataset() (*SapCloudForCustomerResourceDataset, bool) { + return nil, false +} + +// AsSalesforceObjectDataset is the BasicDataset implementation for AmazonS3Dataset. +func (asd AmazonS3Dataset) AsSalesforceObjectDataset() (*SalesforceObjectDataset, bool) { + return nil, false +} + +// AsRelationalTableDataset is the BasicDataset implementation for AmazonS3Dataset. +func (asd AmazonS3Dataset) AsRelationalTableDataset() (*RelationalTableDataset, bool) { + return nil, false +} + +// AsAzureMySQLTableDataset is the BasicDataset implementation for AmazonS3Dataset. +func (asd AmazonS3Dataset) AsAzureMySQLTableDataset() (*AzureMySQLTableDataset, bool) { + return nil, false +} + +// AsOracleTableDataset is the BasicDataset implementation for AmazonS3Dataset. +func (asd AmazonS3Dataset) AsOracleTableDataset() (*OracleTableDataset, bool) { + return nil, false +} + +// AsODataResourceDataset is the BasicDataset implementation for AmazonS3Dataset. +func (asd AmazonS3Dataset) AsODataResourceDataset() (*ODataResourceDataset, bool) { + return nil, false +} + +// AsMongoDbCollectionDataset is the BasicDataset implementation for AmazonS3Dataset. +func (asd AmazonS3Dataset) AsMongoDbCollectionDataset() (*MongoDbCollectionDataset, bool) { + return nil, false +} + +// AsFileShareDataset is the BasicDataset implementation for AmazonS3Dataset. +func (asd AmazonS3Dataset) AsFileShareDataset() (*FileShareDataset, bool) { + return nil, false +} + +// AsAzureDataLakeStoreDataset is the BasicDataset implementation for AmazonS3Dataset. +func (asd AmazonS3Dataset) AsAzureDataLakeStoreDataset() (*AzureDataLakeStoreDataset, bool) { + return nil, false +} + +// AsDynamicsEntityDataset is the BasicDataset implementation for AmazonS3Dataset. +func (asd AmazonS3Dataset) AsDynamicsEntityDataset() (*DynamicsEntityDataset, bool) { + return nil, false +} + +// AsDocumentDbCollectionDataset is the BasicDataset implementation for AmazonS3Dataset. +func (asd AmazonS3Dataset) AsDocumentDbCollectionDataset() (*DocumentDbCollectionDataset, bool) { + return nil, false +} + +// AsCustomDataset is the BasicDataset implementation for AmazonS3Dataset. +func (asd AmazonS3Dataset) AsCustomDataset() (*CustomDataset, bool) { + return nil, false +} + +// AsCassandraTableDataset is the BasicDataset implementation for AmazonS3Dataset. +func (asd AmazonS3Dataset) AsCassandraTableDataset() (*CassandraTableDataset, bool) { + return nil, false +} + +// AsAzureSQLDWTableDataset is the BasicDataset implementation for AmazonS3Dataset. +func (asd AmazonS3Dataset) AsAzureSQLDWTableDataset() (*AzureSQLDWTableDataset, bool) { + return nil, false +} + +// AsAzureSQLTableDataset is the BasicDataset implementation for AmazonS3Dataset. +func (asd AmazonS3Dataset) AsAzureSQLTableDataset() (*AzureSQLTableDataset, bool) { + return nil, false +} + +// AsAzureTableDataset is the BasicDataset implementation for AmazonS3Dataset. +func (asd AmazonS3Dataset) AsAzureTableDataset() (*AzureTableDataset, bool) { + return nil, false +} + +// AsAzureBlobDataset is the BasicDataset implementation for AmazonS3Dataset. +func (asd AmazonS3Dataset) AsAzureBlobDataset() (*AzureBlobDataset, bool) { + return nil, false +} + +// AsAmazonS3Dataset is the BasicDataset implementation for AmazonS3Dataset. +func (asd AmazonS3Dataset) AsAmazonS3Dataset() (*AmazonS3Dataset, bool) { + return &asd, true +} + +// AsDataset is the BasicDataset implementation for AmazonS3Dataset. +func (asd AmazonS3Dataset) AsDataset() (*Dataset, bool) { + return nil, false +} + +// AsBasicDataset is the BasicDataset implementation for AmazonS3Dataset. +func (asd AmazonS3Dataset) AsBasicDataset() (BasicDataset, bool) { + return &asd, true +} + +// UnmarshalJSON is the custom unmarshaler for AmazonS3Dataset struct. +func (asd *AmazonS3Dataset) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "typeProperties": + if v != nil { + var amazonS3DatasetTypeProperties AmazonS3DatasetTypeProperties + err = json.Unmarshal(*v, &amazonS3DatasetTypeProperties) + if err != nil { + return err + } + asd.AmazonS3DatasetTypeProperties = &amazonS3DatasetTypeProperties + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if asd.AdditionalProperties == nil { + asd.AdditionalProperties = make(map[string]interface{}) + } + asd.AdditionalProperties[k] = additionalProperties + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + asd.Description = &description + } + case "structure": + if v != nil { + var structure interface{} + err = json.Unmarshal(*v, &structure) + if err != nil { + return err + } + asd.Structure = structure + } + case "linkedServiceName": + if v != nil { + var linkedServiceName LinkedServiceReference + err = json.Unmarshal(*v, &linkedServiceName) + if err != nil { + return err + } + asd.LinkedServiceName = &linkedServiceName + } + case "parameters": + if v != nil { + var parameters map[string]*ParameterSpecification + err = json.Unmarshal(*v, ¶meters) + if err != nil { + return err + } + asd.Parameters = parameters + } + case "annotations": + if v != nil { + var annotations []interface{} + err = json.Unmarshal(*v, &annotations) + if err != nil { + return err + } + asd.Annotations = &annotations + } + case "type": + if v != nil { + var typeVar TypeBasicDataset + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + asd.Type = typeVar + } + } + } + + return nil +} + +// AmazonS3DatasetTypeProperties amazon S3 dataset properties. +type AmazonS3DatasetTypeProperties struct { + // BucketName - The name of the Amazon S3 bucket. Type: string (or Expression with resultType string). + BucketName interface{} `json:"bucketName,omitempty"` + // Key - The key of the Amazon S3 object. Type: string (or Expression with resultType string). + Key interface{} `json:"key,omitempty"` + // Prefix - The prefix filter for the S3 object name. Type: string (or Expression with resultType string). + Prefix interface{} `json:"prefix,omitempty"` + // Version - The version for the S3 object. Type: string (or Expression with resultType string). + Version interface{} `json:"version,omitempty"` + // Format - The format of files. + Format BasicDatasetStorageFormat `json:"format,omitempty"` + // Compression - The data compression method used for the Amazon S3 object. + Compression BasicDatasetCompression `json:"compression,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for AmazonS3DatasetTypeProperties struct. +func (asdtp *AmazonS3DatasetTypeProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "bucketName": + if v != nil { + var bucketName interface{} + err = json.Unmarshal(*v, &bucketName) + if err != nil { + return err + } + asdtp.BucketName = bucketName + } + case "key": + if v != nil { + var key interface{} + err = json.Unmarshal(*v, &key) + if err != nil { + return err + } + asdtp.Key = key + } + case "prefix": + if v != nil { + var prefix interface{} + err = json.Unmarshal(*v, &prefix) + if err != nil { + return err + } + asdtp.Prefix = prefix + } + case "version": + if v != nil { + var version interface{} + err = json.Unmarshal(*v, &version) + if err != nil { + return err + } + asdtp.Version = version + } + case "format": + if v != nil { + formatVar, err := unmarshalBasicDatasetStorageFormat(*v) + if err != nil { + return err + } + asdtp.Format = formatVar + } + case "compression": + if v != nil { + compression, err := unmarshalBasicDatasetCompression(*v) + if err != nil { + return err + } + asdtp.Compression = compression + } + } + } + + return nil +} + +// AmazonS3LinkedService linked service for Amazon S3. +type AmazonS3LinkedService struct { + // AmazonS3LinkedServiceTypeProperties - Amazon S3 linked service properties. + *AmazonS3LinkedServiceTypeProperties `json:"typeProperties,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // ConnectVia - The integration runtime reference. + ConnectVia *IntegrationRuntimeReference `json:"connectVia,omitempty"` + // Description - Linked service description. + Description *string `json:"description,omitempty"` + // Parameters - Parameters for linked service. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeLinkedService', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforce', 'TypeAzureDataLakeStore', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureStorage' + Type TypeBasicLinkedService `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for AmazonS3LinkedService. +func (asls AmazonS3LinkedService) MarshalJSON() ([]byte, error) { + asls.Type = TypeAmazonS3 + objectMap := make(map[string]interface{}) + if asls.AmazonS3LinkedServiceTypeProperties != nil { + objectMap["typeProperties"] = asls.AmazonS3LinkedServiceTypeProperties + } + if asls.ConnectVia != nil { + objectMap["connectVia"] = asls.ConnectVia + } + if asls.Description != nil { + objectMap["description"] = asls.Description + } + if asls.Parameters != nil { + objectMap["parameters"] = asls.Parameters + } + if asls.Annotations != nil { + objectMap["annotations"] = asls.Annotations + } + if asls.Type != "" { + objectMap["type"] = asls.Type + } + for k, v := range asls.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysLinkedService is the BasicLinkedService implementation for AmazonS3LinkedService. +func (asls AmazonS3LinkedService) AsResponsysLinkedService() (*ResponsysLinkedService, bool) { + return nil, false +} + +// AsAzureDatabricksLinkedService is the BasicLinkedService implementation for AmazonS3LinkedService. +func (asls AmazonS3LinkedService) AsAzureDatabricksLinkedService() (*AzureDatabricksLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeAnalyticsLinkedService is the BasicLinkedService implementation for AmazonS3LinkedService. +func (asls AmazonS3LinkedService) AsAzureDataLakeAnalyticsLinkedService() (*AzureDataLakeAnalyticsLinkedService, bool) { + return nil, false +} + +// AsHDInsightOnDemandLinkedService is the BasicLinkedService implementation for AmazonS3LinkedService. +func (asls AmazonS3LinkedService) AsHDInsightOnDemandLinkedService() (*HDInsightOnDemandLinkedService, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudLinkedService is the BasicLinkedService implementation for AmazonS3LinkedService. +func (asls AmazonS3LinkedService) AsSalesforceMarketingCloudLinkedService() (*SalesforceMarketingCloudLinkedService, bool) { + return nil, false +} + +// AsNetezzaLinkedService is the BasicLinkedService implementation for AmazonS3LinkedService. +func (asls AmazonS3LinkedService) AsNetezzaLinkedService() (*NetezzaLinkedService, bool) { + return nil, false +} + +// AsVerticaLinkedService is the BasicLinkedService implementation for AmazonS3LinkedService. +func (asls AmazonS3LinkedService) AsVerticaLinkedService() (*VerticaLinkedService, bool) { + return nil, false +} + +// AsZohoLinkedService is the BasicLinkedService implementation for AmazonS3LinkedService. +func (asls AmazonS3LinkedService) AsZohoLinkedService() (*ZohoLinkedService, bool) { + return nil, false +} + +// AsXeroLinkedService is the BasicLinkedService implementation for AmazonS3LinkedService. +func (asls AmazonS3LinkedService) AsXeroLinkedService() (*XeroLinkedService, bool) { + return nil, false +} + +// AsSquareLinkedService is the BasicLinkedService implementation for AmazonS3LinkedService. +func (asls AmazonS3LinkedService) AsSquareLinkedService() (*SquareLinkedService, bool) { + return nil, false +} + +// AsSparkLinkedService is the BasicLinkedService implementation for AmazonS3LinkedService. +func (asls AmazonS3LinkedService) AsSparkLinkedService() (*SparkLinkedService, bool) { + return nil, false +} + +// AsShopifyLinkedService is the BasicLinkedService implementation for AmazonS3LinkedService. +func (asls AmazonS3LinkedService) AsShopifyLinkedService() (*ShopifyLinkedService, bool) { + return nil, false +} + +// AsServiceNowLinkedService is the BasicLinkedService implementation for AmazonS3LinkedService. +func (asls AmazonS3LinkedService) AsServiceNowLinkedService() (*ServiceNowLinkedService, bool) { + return nil, false +} + +// AsQuickBooksLinkedService is the BasicLinkedService implementation for AmazonS3LinkedService. +func (asls AmazonS3LinkedService) AsQuickBooksLinkedService() (*QuickBooksLinkedService, bool) { + return nil, false +} + +// AsPrestoLinkedService is the BasicLinkedService implementation for AmazonS3LinkedService. +func (asls AmazonS3LinkedService) AsPrestoLinkedService() (*PrestoLinkedService, bool) { + return nil, false +} + +// AsPhoenixLinkedService is the BasicLinkedService implementation for AmazonS3LinkedService. +func (asls AmazonS3LinkedService) AsPhoenixLinkedService() (*PhoenixLinkedService, bool) { + return nil, false +} + +// AsPaypalLinkedService is the BasicLinkedService implementation for AmazonS3LinkedService. +func (asls AmazonS3LinkedService) AsPaypalLinkedService() (*PaypalLinkedService, bool) { + return nil, false +} + +// AsMarketoLinkedService is the BasicLinkedService implementation for AmazonS3LinkedService. +func (asls AmazonS3LinkedService) AsMarketoLinkedService() (*MarketoLinkedService, bool) { + return nil, false +} + +// AsMariaDBLinkedService is the BasicLinkedService implementation for AmazonS3LinkedService. +func (asls AmazonS3LinkedService) AsMariaDBLinkedService() (*MariaDBLinkedService, bool) { + return nil, false +} + +// AsMagentoLinkedService is the BasicLinkedService implementation for AmazonS3LinkedService. +func (asls AmazonS3LinkedService) AsMagentoLinkedService() (*MagentoLinkedService, bool) { + return nil, false +} + +// AsJiraLinkedService is the BasicLinkedService implementation for AmazonS3LinkedService. +func (asls AmazonS3LinkedService) AsJiraLinkedService() (*JiraLinkedService, bool) { + return nil, false +} + +// AsImpalaLinkedService is the BasicLinkedService implementation for AmazonS3LinkedService. +func (asls AmazonS3LinkedService) AsImpalaLinkedService() (*ImpalaLinkedService, bool) { + return nil, false +} + +// AsHubspotLinkedService is the BasicLinkedService implementation for AmazonS3LinkedService. +func (asls AmazonS3LinkedService) AsHubspotLinkedService() (*HubspotLinkedService, bool) { + return nil, false +} + +// AsHiveLinkedService is the BasicLinkedService implementation for AmazonS3LinkedService. +func (asls AmazonS3LinkedService) AsHiveLinkedService() (*HiveLinkedService, bool) { + return nil, false +} + +// AsHBaseLinkedService is the BasicLinkedService implementation for AmazonS3LinkedService. +func (asls AmazonS3LinkedService) AsHBaseLinkedService() (*HBaseLinkedService, bool) { + return nil, false +} + +// AsGreenplumLinkedService is the BasicLinkedService implementation for AmazonS3LinkedService. +func (asls AmazonS3LinkedService) AsGreenplumLinkedService() (*GreenplumLinkedService, bool) { + return nil, false +} + +// AsGoogleBigQueryLinkedService is the BasicLinkedService implementation for AmazonS3LinkedService. +func (asls AmazonS3LinkedService) AsGoogleBigQueryLinkedService() (*GoogleBigQueryLinkedService, bool) { + return nil, false +} + +// AsEloquaLinkedService is the BasicLinkedService implementation for AmazonS3LinkedService. +func (asls AmazonS3LinkedService) AsEloquaLinkedService() (*EloquaLinkedService, bool) { + return nil, false +} + +// AsDrillLinkedService is the BasicLinkedService implementation for AmazonS3LinkedService. +func (asls AmazonS3LinkedService) AsDrillLinkedService() (*DrillLinkedService, bool) { + return nil, false +} + +// AsCouchbaseLinkedService is the BasicLinkedService implementation for AmazonS3LinkedService. +func (asls AmazonS3LinkedService) AsCouchbaseLinkedService() (*CouchbaseLinkedService, bool) { + return nil, false +} + +// AsConcurLinkedService is the BasicLinkedService implementation for AmazonS3LinkedService. +func (asls AmazonS3LinkedService) AsConcurLinkedService() (*ConcurLinkedService, bool) { + return nil, false +} + +// AsAzurePostgreSQLLinkedService is the BasicLinkedService implementation for AmazonS3LinkedService. +func (asls AmazonS3LinkedService) AsAzurePostgreSQLLinkedService() (*AzurePostgreSQLLinkedService, bool) { + return nil, false +} + +// AsAmazonMWSLinkedService is the BasicLinkedService implementation for AmazonS3LinkedService. +func (asls AmazonS3LinkedService) AsAmazonMWSLinkedService() (*AmazonMWSLinkedService, bool) { + return nil, false +} + +// AsSapHanaLinkedService is the BasicLinkedService implementation for AmazonS3LinkedService. +func (asls AmazonS3LinkedService) AsSapHanaLinkedService() (*SapHanaLinkedService, bool) { + return nil, false +} + +// AsSapBWLinkedService is the BasicLinkedService implementation for AmazonS3LinkedService. +func (asls AmazonS3LinkedService) AsSapBWLinkedService() (*SapBWLinkedService, bool) { + return nil, false +} + +// AsSftpServerLinkedService is the BasicLinkedService implementation for AmazonS3LinkedService. +func (asls AmazonS3LinkedService) AsSftpServerLinkedService() (*SftpServerLinkedService, bool) { + return nil, false +} + +// AsFtpServerLinkedService is the BasicLinkedService implementation for AmazonS3LinkedService. +func (asls AmazonS3LinkedService) AsFtpServerLinkedService() (*FtpServerLinkedService, bool) { + return nil, false +} + +// AsHTTPLinkedService is the BasicLinkedService implementation for AmazonS3LinkedService. +func (asls AmazonS3LinkedService) AsHTTPLinkedService() (*HTTPLinkedService, bool) { + return nil, false +} + +// AsAzureSearchLinkedService is the BasicLinkedService implementation for AmazonS3LinkedService. +func (asls AmazonS3LinkedService) AsAzureSearchLinkedService() (*AzureSearchLinkedService, bool) { + return nil, false +} + +// AsCustomDataSourceLinkedService is the BasicLinkedService implementation for AmazonS3LinkedService. +func (asls AmazonS3LinkedService) AsCustomDataSourceLinkedService() (*CustomDataSourceLinkedService, bool) { + return nil, false +} + +// AsAmazonRedshiftLinkedService is the BasicLinkedService implementation for AmazonS3LinkedService. +func (asls AmazonS3LinkedService) AsAmazonRedshiftLinkedService() (*AmazonRedshiftLinkedService, bool) { + return nil, false +} + +// AsAmazonS3LinkedService is the BasicLinkedService implementation for AmazonS3LinkedService. +func (asls AmazonS3LinkedService) AsAmazonS3LinkedService() (*AmazonS3LinkedService, bool) { + return &asls, true +} + +// AsSapEccLinkedService is the BasicLinkedService implementation for AmazonS3LinkedService. +func (asls AmazonS3LinkedService) AsSapEccLinkedService() (*SapEccLinkedService, bool) { + return nil, false +} + +// AsSapCloudForCustomerLinkedService is the BasicLinkedService implementation for AmazonS3LinkedService. +func (asls AmazonS3LinkedService) AsSapCloudForCustomerLinkedService() (*SapCloudForCustomerLinkedService, bool) { + return nil, false +} + +// AsSalesforceLinkedService is the BasicLinkedService implementation for AmazonS3LinkedService. +func (asls AmazonS3LinkedService) AsSalesforceLinkedService() (*SalesforceLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeStoreLinkedService is the BasicLinkedService implementation for AmazonS3LinkedService. +func (asls AmazonS3LinkedService) AsAzureDataLakeStoreLinkedService() (*AzureDataLakeStoreLinkedService, bool) { + return nil, false +} + +// AsMongoDbLinkedService is the BasicLinkedService implementation for AmazonS3LinkedService. +func (asls AmazonS3LinkedService) AsMongoDbLinkedService() (*MongoDbLinkedService, bool) { + return nil, false +} + +// AsCassandraLinkedService is the BasicLinkedService implementation for AmazonS3LinkedService. +func (asls AmazonS3LinkedService) AsCassandraLinkedService() (*CassandraLinkedService, bool) { + return nil, false +} + +// AsWebLinkedService is the BasicLinkedService implementation for AmazonS3LinkedService. +func (asls AmazonS3LinkedService) AsWebLinkedService() (*WebLinkedService, bool) { + return nil, false +} + +// AsODataLinkedService is the BasicLinkedService implementation for AmazonS3LinkedService. +func (asls AmazonS3LinkedService) AsODataLinkedService() (*ODataLinkedService, bool) { + return nil, false +} + +// AsHdfsLinkedService is the BasicLinkedService implementation for AmazonS3LinkedService. +func (asls AmazonS3LinkedService) AsHdfsLinkedService() (*HdfsLinkedService, bool) { + return nil, false +} + +// AsOdbcLinkedService is the BasicLinkedService implementation for AmazonS3LinkedService. +func (asls AmazonS3LinkedService) AsOdbcLinkedService() (*OdbcLinkedService, bool) { + return nil, false +} + +// AsAzureMLLinkedService is the BasicLinkedService implementation for AmazonS3LinkedService. +func (asls AmazonS3LinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { + return nil, false +} + +// AsTeradataLinkedService is the BasicLinkedService implementation for AmazonS3LinkedService. +func (asls AmazonS3LinkedService) AsTeradataLinkedService() (*TeradataLinkedService, bool) { + return nil, false +} + +// AsDb2LinkedService is the BasicLinkedService implementation for AmazonS3LinkedService. +func (asls AmazonS3LinkedService) AsDb2LinkedService() (*Db2LinkedService, bool) { + return nil, false +} + +// AsSybaseLinkedService is the BasicLinkedService implementation for AmazonS3LinkedService. +func (asls AmazonS3LinkedService) AsSybaseLinkedService() (*SybaseLinkedService, bool) { + return nil, false +} + +// AsPostgreSQLLinkedService is the BasicLinkedService implementation for AmazonS3LinkedService. +func (asls AmazonS3LinkedService) AsPostgreSQLLinkedService() (*PostgreSQLLinkedService, bool) { + return nil, false +} + +// AsMySQLLinkedService is the BasicLinkedService implementation for AmazonS3LinkedService. +func (asls AmazonS3LinkedService) AsMySQLLinkedService() (*MySQLLinkedService, bool) { + return nil, false +} + +// AsAzureMySQLLinkedService is the BasicLinkedService implementation for AmazonS3LinkedService. +func (asls AmazonS3LinkedService) AsAzureMySQLLinkedService() (*AzureMySQLLinkedService, bool) { + return nil, false +} + +// AsOracleLinkedService is the BasicLinkedService implementation for AmazonS3LinkedService. +func (asls AmazonS3LinkedService) AsOracleLinkedService() (*OracleLinkedService, bool) { + return nil, false +} + +// AsFileServerLinkedService is the BasicLinkedService implementation for AmazonS3LinkedService. +func (asls AmazonS3LinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { + return nil, false +} + +// AsHDInsightLinkedService is the BasicLinkedService implementation for AmazonS3LinkedService. +func (asls AmazonS3LinkedService) AsHDInsightLinkedService() (*HDInsightLinkedService, bool) { + return nil, false +} + +// AsDynamicsLinkedService is the BasicLinkedService implementation for AmazonS3LinkedService. +func (asls AmazonS3LinkedService) AsDynamicsLinkedService() (*DynamicsLinkedService, bool) { + return nil, false +} + +// AsCosmosDbLinkedService is the BasicLinkedService implementation for AmazonS3LinkedService. +func (asls AmazonS3LinkedService) AsCosmosDbLinkedService() (*CosmosDbLinkedService, bool) { + return nil, false +} + +// AsAzureKeyVaultLinkedService is the BasicLinkedService implementation for AmazonS3LinkedService. +func (asls AmazonS3LinkedService) AsAzureKeyVaultLinkedService() (*AzureKeyVaultLinkedService, bool) { + return nil, false +} + +// AsAzureBatchLinkedService is the BasicLinkedService implementation for AmazonS3LinkedService. +func (asls AmazonS3LinkedService) AsAzureBatchLinkedService() (*AzureBatchLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDatabaseLinkedService is the BasicLinkedService implementation for AmazonS3LinkedService. +func (asls AmazonS3LinkedService) AsAzureSQLDatabaseLinkedService() (*AzureSQLDatabaseLinkedService, bool) { + return nil, false +} + +// AsSQLServerLinkedService is the BasicLinkedService implementation for AmazonS3LinkedService. +func (asls AmazonS3LinkedService) AsSQLServerLinkedService() (*SQLServerLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDWLinkedService is the BasicLinkedService implementation for AmazonS3LinkedService. +func (asls AmazonS3LinkedService) AsAzureSQLDWLinkedService() (*AzureSQLDWLinkedService, bool) { + return nil, false +} + +// AsAzureStorageLinkedService is the BasicLinkedService implementation for AmazonS3LinkedService. +func (asls AmazonS3LinkedService) AsAzureStorageLinkedService() (*AzureStorageLinkedService, bool) { + return nil, false +} + +// AsLinkedService is the BasicLinkedService implementation for AmazonS3LinkedService. +func (asls AmazonS3LinkedService) AsLinkedService() (*LinkedService, bool) { + return nil, false +} + +// AsBasicLinkedService is the BasicLinkedService implementation for AmazonS3LinkedService. +func (asls AmazonS3LinkedService) AsBasicLinkedService() (BasicLinkedService, bool) { + return &asls, true +} + +// UnmarshalJSON is the custom unmarshaler for AmazonS3LinkedService struct. +func (asls *AmazonS3LinkedService) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "typeProperties": + if v != nil { + var amazonS3LinkedServiceTypeProperties AmazonS3LinkedServiceTypeProperties + err = json.Unmarshal(*v, &amazonS3LinkedServiceTypeProperties) + if err != nil { + return err + } + asls.AmazonS3LinkedServiceTypeProperties = &amazonS3LinkedServiceTypeProperties + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if asls.AdditionalProperties == nil { + asls.AdditionalProperties = make(map[string]interface{}) + } + asls.AdditionalProperties[k] = additionalProperties + } + case "connectVia": + if v != nil { + var connectVia IntegrationRuntimeReference + err = json.Unmarshal(*v, &connectVia) + if err != nil { + return err + } + asls.ConnectVia = &connectVia + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + asls.Description = &description + } + case "parameters": + if v != nil { + var parameters map[string]*ParameterSpecification + err = json.Unmarshal(*v, ¶meters) + if err != nil { + return err + } + asls.Parameters = parameters + } + case "annotations": + if v != nil { + var annotations []interface{} + err = json.Unmarshal(*v, &annotations) + if err != nil { + return err + } + asls.Annotations = &annotations + } + case "type": + if v != nil { + var typeVar TypeBasicLinkedService + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + asls.Type = typeVar + } + } + } + + return nil +} + +// AmazonS3LinkedServiceTypeProperties amazon S3 linked service properties. +type AmazonS3LinkedServiceTypeProperties struct { + // AccessKeyID - The access key identifier of the Amazon S3 Identity and Access Management (IAM) user. Type: string (or Expression with resultType string). + AccessKeyID interface{} `json:"accessKeyId,omitempty"` + // SecretAccessKey - The secret access key of the Amazon S3 Identity and Access Management (IAM) user. + SecretAccessKey BasicSecretBase `json:"secretAccessKey,omitempty"` + // EncryptedCredential - The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string). + EncryptedCredential interface{} `json:"encryptedCredential,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for AmazonS3LinkedServiceTypeProperties struct. +func (aslstp *AmazonS3LinkedServiceTypeProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "accessKeyId": + if v != nil { + var accessKeyID interface{} + err = json.Unmarshal(*v, &accessKeyID) + if err != nil { + return err + } + aslstp.AccessKeyID = accessKeyID + } + case "secretAccessKey": + if v != nil { + secretAccessKey, err := unmarshalBasicSecretBase(*v) + if err != nil { + return err + } + aslstp.SecretAccessKey = secretAccessKey + } + case "encryptedCredential": + if v != nil { + var encryptedCredential interface{} + err = json.Unmarshal(*v, &encryptedCredential) + if err != nil { + return err + } + aslstp.EncryptedCredential = encryptedCredential + } + } + } + + return nil +} + +// AvroFormat the data stored in Avro format. +type AvroFormat struct { + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Serializer - Serializer. Type: string (or Expression with resultType string). + Serializer interface{} `json:"serializer,omitempty"` + // Deserializer - Deserializer. Type: string (or Expression with resultType string). + Deserializer interface{} `json:"deserializer,omitempty"` + // Type - Possible values include: 'TypeDatasetStorageFormat', 'TypeParquetFormat', 'TypeOrcFormat', 'TypeAvroFormat', 'TypeJSONFormat', 'TypeTextFormat' + Type TypeBasicDatasetStorageFormat `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for AvroFormat. +func (af AvroFormat) MarshalJSON() ([]byte, error) { + af.Type = TypeAvroFormat + objectMap := make(map[string]interface{}) + objectMap["serializer"] = af.Serializer + objectMap["deserializer"] = af.Deserializer + if af.Type != "" { + objectMap["type"] = af.Type + } + for k, v := range af.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsParquetFormat is the BasicDatasetStorageFormat implementation for AvroFormat. +func (af AvroFormat) AsParquetFormat() (*ParquetFormat, bool) { + return nil, false +} + +// AsOrcFormat is the BasicDatasetStorageFormat implementation for AvroFormat. +func (af AvroFormat) AsOrcFormat() (*OrcFormat, bool) { + return nil, false +} + +// AsAvroFormat is the BasicDatasetStorageFormat implementation for AvroFormat. +func (af AvroFormat) AsAvroFormat() (*AvroFormat, bool) { + return &af, true +} + +// AsJSONFormat is the BasicDatasetStorageFormat implementation for AvroFormat. +func (af AvroFormat) AsJSONFormat() (*JSONFormat, bool) { + return nil, false +} + +// AsTextFormat is the BasicDatasetStorageFormat implementation for AvroFormat. +func (af AvroFormat) AsTextFormat() (*TextFormat, bool) { + return nil, false +} + +// AsDatasetStorageFormat is the BasicDatasetStorageFormat implementation for AvroFormat. +func (af AvroFormat) AsDatasetStorageFormat() (*DatasetStorageFormat, bool) { + return nil, false +} + +// AsBasicDatasetStorageFormat is the BasicDatasetStorageFormat implementation for AvroFormat. +func (af AvroFormat) AsBasicDatasetStorageFormat() (BasicDatasetStorageFormat, bool) { + return &af, true +} + +// AzureBatchLinkedService azure Batch linked service. +type AzureBatchLinkedService struct { + // AzureBatchLinkedServiceTypeProperties - Azure Batch linked service properties. + *AzureBatchLinkedServiceTypeProperties `json:"typeProperties,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // ConnectVia - The integration runtime reference. + ConnectVia *IntegrationRuntimeReference `json:"connectVia,omitempty"` + // Description - Linked service description. + Description *string `json:"description,omitempty"` + // Parameters - Parameters for linked service. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeLinkedService', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforce', 'TypeAzureDataLakeStore', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureStorage' + Type TypeBasicLinkedService `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureBatchLinkedService. +func (abls AzureBatchLinkedService) MarshalJSON() ([]byte, error) { + abls.Type = TypeAzureBatch + objectMap := make(map[string]interface{}) + if abls.AzureBatchLinkedServiceTypeProperties != nil { + objectMap["typeProperties"] = abls.AzureBatchLinkedServiceTypeProperties + } + if abls.ConnectVia != nil { + objectMap["connectVia"] = abls.ConnectVia + } + if abls.Description != nil { + objectMap["description"] = abls.Description + } + if abls.Parameters != nil { + objectMap["parameters"] = abls.Parameters + } + if abls.Annotations != nil { + objectMap["annotations"] = abls.Annotations + } + if abls.Type != "" { + objectMap["type"] = abls.Type + } + for k, v := range abls.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysLinkedService is the BasicLinkedService implementation for AzureBatchLinkedService. +func (abls AzureBatchLinkedService) AsResponsysLinkedService() (*ResponsysLinkedService, bool) { + return nil, false +} + +// AsAzureDatabricksLinkedService is the BasicLinkedService implementation for AzureBatchLinkedService. +func (abls AzureBatchLinkedService) AsAzureDatabricksLinkedService() (*AzureDatabricksLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeAnalyticsLinkedService is the BasicLinkedService implementation for AzureBatchLinkedService. +func (abls AzureBatchLinkedService) AsAzureDataLakeAnalyticsLinkedService() (*AzureDataLakeAnalyticsLinkedService, bool) { + return nil, false +} + +// AsHDInsightOnDemandLinkedService is the BasicLinkedService implementation for AzureBatchLinkedService. +func (abls AzureBatchLinkedService) AsHDInsightOnDemandLinkedService() (*HDInsightOnDemandLinkedService, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudLinkedService is the BasicLinkedService implementation for AzureBatchLinkedService. +func (abls AzureBatchLinkedService) AsSalesforceMarketingCloudLinkedService() (*SalesforceMarketingCloudLinkedService, bool) { + return nil, false +} + +// AsNetezzaLinkedService is the BasicLinkedService implementation for AzureBatchLinkedService. +func (abls AzureBatchLinkedService) AsNetezzaLinkedService() (*NetezzaLinkedService, bool) { + return nil, false +} + +// AsVerticaLinkedService is the BasicLinkedService implementation for AzureBatchLinkedService. +func (abls AzureBatchLinkedService) AsVerticaLinkedService() (*VerticaLinkedService, bool) { + return nil, false +} + +// AsZohoLinkedService is the BasicLinkedService implementation for AzureBatchLinkedService. +func (abls AzureBatchLinkedService) AsZohoLinkedService() (*ZohoLinkedService, bool) { + return nil, false +} + +// AsXeroLinkedService is the BasicLinkedService implementation for AzureBatchLinkedService. +func (abls AzureBatchLinkedService) AsXeroLinkedService() (*XeroLinkedService, bool) { + return nil, false +} + +// AsSquareLinkedService is the BasicLinkedService implementation for AzureBatchLinkedService. +func (abls AzureBatchLinkedService) AsSquareLinkedService() (*SquareLinkedService, bool) { + return nil, false +} + +// AsSparkLinkedService is the BasicLinkedService implementation for AzureBatchLinkedService. +func (abls AzureBatchLinkedService) AsSparkLinkedService() (*SparkLinkedService, bool) { + return nil, false +} + +// AsShopifyLinkedService is the BasicLinkedService implementation for AzureBatchLinkedService. +func (abls AzureBatchLinkedService) AsShopifyLinkedService() (*ShopifyLinkedService, bool) { + return nil, false +} + +// AsServiceNowLinkedService is the BasicLinkedService implementation for AzureBatchLinkedService. +func (abls AzureBatchLinkedService) AsServiceNowLinkedService() (*ServiceNowLinkedService, bool) { + return nil, false +} + +// AsQuickBooksLinkedService is the BasicLinkedService implementation for AzureBatchLinkedService. +func (abls AzureBatchLinkedService) AsQuickBooksLinkedService() (*QuickBooksLinkedService, bool) { + return nil, false +} + +// AsPrestoLinkedService is the BasicLinkedService implementation for AzureBatchLinkedService. +func (abls AzureBatchLinkedService) AsPrestoLinkedService() (*PrestoLinkedService, bool) { + return nil, false +} + +// AsPhoenixLinkedService is the BasicLinkedService implementation for AzureBatchLinkedService. +func (abls AzureBatchLinkedService) AsPhoenixLinkedService() (*PhoenixLinkedService, bool) { + return nil, false +} + +// AsPaypalLinkedService is the BasicLinkedService implementation for AzureBatchLinkedService. +func (abls AzureBatchLinkedService) AsPaypalLinkedService() (*PaypalLinkedService, bool) { + return nil, false +} + +// AsMarketoLinkedService is the BasicLinkedService implementation for AzureBatchLinkedService. +func (abls AzureBatchLinkedService) AsMarketoLinkedService() (*MarketoLinkedService, bool) { + return nil, false +} + +// AsMariaDBLinkedService is the BasicLinkedService implementation for AzureBatchLinkedService. +func (abls AzureBatchLinkedService) AsMariaDBLinkedService() (*MariaDBLinkedService, bool) { + return nil, false +} + +// AsMagentoLinkedService is the BasicLinkedService implementation for AzureBatchLinkedService. +func (abls AzureBatchLinkedService) AsMagentoLinkedService() (*MagentoLinkedService, bool) { + return nil, false +} + +// AsJiraLinkedService is the BasicLinkedService implementation for AzureBatchLinkedService. +func (abls AzureBatchLinkedService) AsJiraLinkedService() (*JiraLinkedService, bool) { + return nil, false +} + +// AsImpalaLinkedService is the BasicLinkedService implementation for AzureBatchLinkedService. +func (abls AzureBatchLinkedService) AsImpalaLinkedService() (*ImpalaLinkedService, bool) { + return nil, false +} + +// AsHubspotLinkedService is the BasicLinkedService implementation for AzureBatchLinkedService. +func (abls AzureBatchLinkedService) AsHubspotLinkedService() (*HubspotLinkedService, bool) { + return nil, false +} + +// AsHiveLinkedService is the BasicLinkedService implementation for AzureBatchLinkedService. +func (abls AzureBatchLinkedService) AsHiveLinkedService() (*HiveLinkedService, bool) { + return nil, false +} + +// AsHBaseLinkedService is the BasicLinkedService implementation for AzureBatchLinkedService. +func (abls AzureBatchLinkedService) AsHBaseLinkedService() (*HBaseLinkedService, bool) { + return nil, false +} + +// AsGreenplumLinkedService is the BasicLinkedService implementation for AzureBatchLinkedService. +func (abls AzureBatchLinkedService) AsGreenplumLinkedService() (*GreenplumLinkedService, bool) { + return nil, false +} + +// AsGoogleBigQueryLinkedService is the BasicLinkedService implementation for AzureBatchLinkedService. +func (abls AzureBatchLinkedService) AsGoogleBigQueryLinkedService() (*GoogleBigQueryLinkedService, bool) { + return nil, false +} + +// AsEloquaLinkedService is the BasicLinkedService implementation for AzureBatchLinkedService. +func (abls AzureBatchLinkedService) AsEloquaLinkedService() (*EloquaLinkedService, bool) { + return nil, false +} + +// AsDrillLinkedService is the BasicLinkedService implementation for AzureBatchLinkedService. +func (abls AzureBatchLinkedService) AsDrillLinkedService() (*DrillLinkedService, bool) { + return nil, false +} + +// AsCouchbaseLinkedService is the BasicLinkedService implementation for AzureBatchLinkedService. +func (abls AzureBatchLinkedService) AsCouchbaseLinkedService() (*CouchbaseLinkedService, bool) { + return nil, false +} + +// AsConcurLinkedService is the BasicLinkedService implementation for AzureBatchLinkedService. +func (abls AzureBatchLinkedService) AsConcurLinkedService() (*ConcurLinkedService, bool) { + return nil, false +} + +// AsAzurePostgreSQLLinkedService is the BasicLinkedService implementation for AzureBatchLinkedService. +func (abls AzureBatchLinkedService) AsAzurePostgreSQLLinkedService() (*AzurePostgreSQLLinkedService, bool) { + return nil, false +} + +// AsAmazonMWSLinkedService is the BasicLinkedService implementation for AzureBatchLinkedService. +func (abls AzureBatchLinkedService) AsAmazonMWSLinkedService() (*AmazonMWSLinkedService, bool) { + return nil, false +} + +// AsSapHanaLinkedService is the BasicLinkedService implementation for AzureBatchLinkedService. +func (abls AzureBatchLinkedService) AsSapHanaLinkedService() (*SapHanaLinkedService, bool) { + return nil, false +} + +// AsSapBWLinkedService is the BasicLinkedService implementation for AzureBatchLinkedService. +func (abls AzureBatchLinkedService) AsSapBWLinkedService() (*SapBWLinkedService, bool) { + return nil, false +} + +// AsSftpServerLinkedService is the BasicLinkedService implementation for AzureBatchLinkedService. +func (abls AzureBatchLinkedService) AsSftpServerLinkedService() (*SftpServerLinkedService, bool) { + return nil, false +} + +// AsFtpServerLinkedService is the BasicLinkedService implementation for AzureBatchLinkedService. +func (abls AzureBatchLinkedService) AsFtpServerLinkedService() (*FtpServerLinkedService, bool) { + return nil, false +} + +// AsHTTPLinkedService is the BasicLinkedService implementation for AzureBatchLinkedService. +func (abls AzureBatchLinkedService) AsHTTPLinkedService() (*HTTPLinkedService, bool) { + return nil, false +} + +// AsAzureSearchLinkedService is the BasicLinkedService implementation for AzureBatchLinkedService. +func (abls AzureBatchLinkedService) AsAzureSearchLinkedService() (*AzureSearchLinkedService, bool) { + return nil, false +} + +// AsCustomDataSourceLinkedService is the BasicLinkedService implementation for AzureBatchLinkedService. +func (abls AzureBatchLinkedService) AsCustomDataSourceLinkedService() (*CustomDataSourceLinkedService, bool) { + return nil, false +} + +// AsAmazonRedshiftLinkedService is the BasicLinkedService implementation for AzureBatchLinkedService. +func (abls AzureBatchLinkedService) AsAmazonRedshiftLinkedService() (*AmazonRedshiftLinkedService, bool) { + return nil, false +} + +// AsAmazonS3LinkedService is the BasicLinkedService implementation for AzureBatchLinkedService. +func (abls AzureBatchLinkedService) AsAmazonS3LinkedService() (*AmazonS3LinkedService, bool) { + return nil, false +} + +// AsSapEccLinkedService is the BasicLinkedService implementation for AzureBatchLinkedService. +func (abls AzureBatchLinkedService) AsSapEccLinkedService() (*SapEccLinkedService, bool) { + return nil, false +} + +// AsSapCloudForCustomerLinkedService is the BasicLinkedService implementation for AzureBatchLinkedService. +func (abls AzureBatchLinkedService) AsSapCloudForCustomerLinkedService() (*SapCloudForCustomerLinkedService, bool) { + return nil, false +} + +// AsSalesforceLinkedService is the BasicLinkedService implementation for AzureBatchLinkedService. +func (abls AzureBatchLinkedService) AsSalesforceLinkedService() (*SalesforceLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeStoreLinkedService is the BasicLinkedService implementation for AzureBatchLinkedService. +func (abls AzureBatchLinkedService) AsAzureDataLakeStoreLinkedService() (*AzureDataLakeStoreLinkedService, bool) { + return nil, false +} + +// AsMongoDbLinkedService is the BasicLinkedService implementation for AzureBatchLinkedService. +func (abls AzureBatchLinkedService) AsMongoDbLinkedService() (*MongoDbLinkedService, bool) { + return nil, false +} + +// AsCassandraLinkedService is the BasicLinkedService implementation for AzureBatchLinkedService. +func (abls AzureBatchLinkedService) AsCassandraLinkedService() (*CassandraLinkedService, bool) { + return nil, false +} + +// AsWebLinkedService is the BasicLinkedService implementation for AzureBatchLinkedService. +func (abls AzureBatchLinkedService) AsWebLinkedService() (*WebLinkedService, bool) { + return nil, false +} + +// AsODataLinkedService is the BasicLinkedService implementation for AzureBatchLinkedService. +func (abls AzureBatchLinkedService) AsODataLinkedService() (*ODataLinkedService, bool) { + return nil, false +} + +// AsHdfsLinkedService is the BasicLinkedService implementation for AzureBatchLinkedService. +func (abls AzureBatchLinkedService) AsHdfsLinkedService() (*HdfsLinkedService, bool) { + return nil, false +} + +// AsOdbcLinkedService is the BasicLinkedService implementation for AzureBatchLinkedService. +func (abls AzureBatchLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, bool) { + return nil, false +} + +// AsAzureMLLinkedService is the BasicLinkedService implementation for AzureBatchLinkedService. +func (abls AzureBatchLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { + return nil, false +} + +// AsTeradataLinkedService is the BasicLinkedService implementation for AzureBatchLinkedService. +func (abls AzureBatchLinkedService) AsTeradataLinkedService() (*TeradataLinkedService, bool) { + return nil, false +} + +// AsDb2LinkedService is the BasicLinkedService implementation for AzureBatchLinkedService. +func (abls AzureBatchLinkedService) AsDb2LinkedService() (*Db2LinkedService, bool) { + return nil, false +} + +// AsSybaseLinkedService is the BasicLinkedService implementation for AzureBatchLinkedService. +func (abls AzureBatchLinkedService) AsSybaseLinkedService() (*SybaseLinkedService, bool) { + return nil, false +} + +// AsPostgreSQLLinkedService is the BasicLinkedService implementation for AzureBatchLinkedService. +func (abls AzureBatchLinkedService) AsPostgreSQLLinkedService() (*PostgreSQLLinkedService, bool) { + return nil, false +} + +// AsMySQLLinkedService is the BasicLinkedService implementation for AzureBatchLinkedService. +func (abls AzureBatchLinkedService) AsMySQLLinkedService() (*MySQLLinkedService, bool) { + return nil, false +} + +// AsAzureMySQLLinkedService is the BasicLinkedService implementation for AzureBatchLinkedService. +func (abls AzureBatchLinkedService) AsAzureMySQLLinkedService() (*AzureMySQLLinkedService, bool) { + return nil, false +} + +// AsOracleLinkedService is the BasicLinkedService implementation for AzureBatchLinkedService. +func (abls AzureBatchLinkedService) AsOracleLinkedService() (*OracleLinkedService, bool) { + return nil, false +} + +// AsFileServerLinkedService is the BasicLinkedService implementation for AzureBatchLinkedService. +func (abls AzureBatchLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { + return nil, false +} + +// AsHDInsightLinkedService is the BasicLinkedService implementation for AzureBatchLinkedService. +func (abls AzureBatchLinkedService) AsHDInsightLinkedService() (*HDInsightLinkedService, bool) { + return nil, false +} + +// AsDynamicsLinkedService is the BasicLinkedService implementation for AzureBatchLinkedService. +func (abls AzureBatchLinkedService) AsDynamicsLinkedService() (*DynamicsLinkedService, bool) { + return nil, false +} + +// AsCosmosDbLinkedService is the BasicLinkedService implementation for AzureBatchLinkedService. +func (abls AzureBatchLinkedService) AsCosmosDbLinkedService() (*CosmosDbLinkedService, bool) { + return nil, false +} + +// AsAzureKeyVaultLinkedService is the BasicLinkedService implementation for AzureBatchLinkedService. +func (abls AzureBatchLinkedService) AsAzureKeyVaultLinkedService() (*AzureKeyVaultLinkedService, bool) { + return nil, false +} + +// AsAzureBatchLinkedService is the BasicLinkedService implementation for AzureBatchLinkedService. +func (abls AzureBatchLinkedService) AsAzureBatchLinkedService() (*AzureBatchLinkedService, bool) { + return &abls, true +} + +// AsAzureSQLDatabaseLinkedService is the BasicLinkedService implementation for AzureBatchLinkedService. +func (abls AzureBatchLinkedService) AsAzureSQLDatabaseLinkedService() (*AzureSQLDatabaseLinkedService, bool) { + return nil, false +} + +// AsSQLServerLinkedService is the BasicLinkedService implementation for AzureBatchLinkedService. +func (abls AzureBatchLinkedService) AsSQLServerLinkedService() (*SQLServerLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDWLinkedService is the BasicLinkedService implementation for AzureBatchLinkedService. +func (abls AzureBatchLinkedService) AsAzureSQLDWLinkedService() (*AzureSQLDWLinkedService, bool) { + return nil, false +} + +// AsAzureStorageLinkedService is the BasicLinkedService implementation for AzureBatchLinkedService. +func (abls AzureBatchLinkedService) AsAzureStorageLinkedService() (*AzureStorageLinkedService, bool) { + return nil, false +} + +// AsLinkedService is the BasicLinkedService implementation for AzureBatchLinkedService. +func (abls AzureBatchLinkedService) AsLinkedService() (*LinkedService, bool) { + return nil, false +} + +// AsBasicLinkedService is the BasicLinkedService implementation for AzureBatchLinkedService. +func (abls AzureBatchLinkedService) AsBasicLinkedService() (BasicLinkedService, bool) { + return &abls, true +} + +// UnmarshalJSON is the custom unmarshaler for AzureBatchLinkedService struct. +func (abls *AzureBatchLinkedService) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "typeProperties": + if v != nil { + var azureBatchLinkedServiceTypeProperties AzureBatchLinkedServiceTypeProperties + err = json.Unmarshal(*v, &azureBatchLinkedServiceTypeProperties) + if err != nil { + return err + } + abls.AzureBatchLinkedServiceTypeProperties = &azureBatchLinkedServiceTypeProperties + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if abls.AdditionalProperties == nil { + abls.AdditionalProperties = make(map[string]interface{}) + } + abls.AdditionalProperties[k] = additionalProperties + } + case "connectVia": + if v != nil { + var connectVia IntegrationRuntimeReference + err = json.Unmarshal(*v, &connectVia) + if err != nil { + return err + } + abls.ConnectVia = &connectVia + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + abls.Description = &description + } + case "parameters": + if v != nil { + var parameters map[string]*ParameterSpecification + err = json.Unmarshal(*v, ¶meters) + if err != nil { + return err + } + abls.Parameters = parameters + } + case "annotations": + if v != nil { + var annotations []interface{} + err = json.Unmarshal(*v, &annotations) + if err != nil { + return err + } + abls.Annotations = &annotations + } + case "type": + if v != nil { + var typeVar TypeBasicLinkedService + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + abls.Type = typeVar + } + } + } + + return nil +} + +// AzureBatchLinkedServiceTypeProperties azure Batch linked service properties. +type AzureBatchLinkedServiceTypeProperties struct { + // AccountName - The Azure Batch account name. Type: string (or Expression with resultType string). + AccountName interface{} `json:"accountName,omitempty"` + // AccessKey - The Azure Batch account access key. + AccessKey BasicSecretBase `json:"accessKey,omitempty"` + // BatchURI - The Azure Batch URI. Type: string (or Expression with resultType string). + BatchURI interface{} `json:"batchUri,omitempty"` + // PoolName - The Azure Batch pool name. Type: string (or Expression with resultType string). + PoolName interface{} `json:"poolName,omitempty"` + // LinkedServiceName - The Azure Storage linked service reference. + LinkedServiceName *LinkedServiceReference `json:"linkedServiceName,omitempty"` + // EncryptedCredential - The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string). + EncryptedCredential interface{} `json:"encryptedCredential,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for AzureBatchLinkedServiceTypeProperties struct. +func (ablstp *AzureBatchLinkedServiceTypeProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "accountName": + if v != nil { + var accountName interface{} + err = json.Unmarshal(*v, &accountName) + if err != nil { + return err + } + ablstp.AccountName = accountName + } + case "accessKey": + if v != nil { + accessKey, err := unmarshalBasicSecretBase(*v) + if err != nil { + return err + } + ablstp.AccessKey = accessKey + } + case "batchUri": + if v != nil { + var batchURI interface{} + err = json.Unmarshal(*v, &batchURI) + if err != nil { + return err + } + ablstp.BatchURI = batchURI + } + case "poolName": + if v != nil { + var poolName interface{} + err = json.Unmarshal(*v, &poolName) + if err != nil { + return err + } + ablstp.PoolName = poolName + } + case "linkedServiceName": + if v != nil { + var linkedServiceName LinkedServiceReference + err = json.Unmarshal(*v, &linkedServiceName) + if err != nil { + return err + } + ablstp.LinkedServiceName = &linkedServiceName + } + case "encryptedCredential": + if v != nil { + var encryptedCredential interface{} + err = json.Unmarshal(*v, &encryptedCredential) + if err != nil { + return err + } + ablstp.EncryptedCredential = encryptedCredential + } + } + } + + return nil +} + +// AzureBlobDataset the Azure Blob storage. +type AzureBlobDataset struct { + // AzureBlobDatasetTypeProperties - Azure Blob dataset properties. + *AzureBlobDatasetTypeProperties `json:"typeProperties,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Description - Dataset description. + Description *string `json:"description,omitempty"` + // Structure - Columns that define the structure of the dataset. Type: array (or Expression with resultType array), itemType: DatasetDataElement. + Structure interface{} `json:"structure,omitempty"` + // LinkedServiceName - Linked service reference. + LinkedServiceName *LinkedServiceReference `json:"linkedServiceName,omitempty"` + // Parameters - Parameters for dataset. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeDataset', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSQLServerTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSalesforceObject', 'TypeRelationalTable', 'TypeAzureMySQLTable', 'TypeOracleTable', 'TypeODataResource', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeAzureDataLakeStoreFile', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeAmazonS3Object' + Type TypeBasicDataset `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureBlobDataset. +func (abd AzureBlobDataset) MarshalJSON() ([]byte, error) { + abd.Type = TypeAzureBlob + objectMap := make(map[string]interface{}) + if abd.AzureBlobDatasetTypeProperties != nil { + objectMap["typeProperties"] = abd.AzureBlobDatasetTypeProperties + } + if abd.Description != nil { + objectMap["description"] = abd.Description + } + objectMap["structure"] = abd.Structure + if abd.LinkedServiceName != nil { + objectMap["linkedServiceName"] = abd.LinkedServiceName + } + if abd.Parameters != nil { + objectMap["parameters"] = abd.Parameters + } + if abd.Annotations != nil { + objectMap["annotations"] = abd.Annotations + } + if abd.Type != "" { + objectMap["type"] = abd.Type + } + for k, v := range abd.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysObjectDataset is the BasicDataset implementation for AzureBlobDataset. +func (abd AzureBlobDataset) AsResponsysObjectDataset() (*ResponsysObjectDataset, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudObjectDataset is the BasicDataset implementation for AzureBlobDataset. +func (abd AzureBlobDataset) AsSalesforceMarketingCloudObjectDataset() (*SalesforceMarketingCloudObjectDataset, bool) { + return nil, false +} + +// AsVerticaTableDataset is the BasicDataset implementation for AzureBlobDataset. +func (abd AzureBlobDataset) AsVerticaTableDataset() (*VerticaTableDataset, bool) { + return nil, false +} + +// AsNetezzaTableDataset is the BasicDataset implementation for AzureBlobDataset. +func (abd AzureBlobDataset) AsNetezzaTableDataset() (*NetezzaTableDataset, bool) { + return nil, false +} + +// AsZohoObjectDataset is the BasicDataset implementation for AzureBlobDataset. +func (abd AzureBlobDataset) AsZohoObjectDataset() (*ZohoObjectDataset, bool) { + return nil, false +} + +// AsXeroObjectDataset is the BasicDataset implementation for AzureBlobDataset. +func (abd AzureBlobDataset) AsXeroObjectDataset() (*XeroObjectDataset, bool) { + return nil, false +} + +// AsSquareObjectDataset is the BasicDataset implementation for AzureBlobDataset. +func (abd AzureBlobDataset) AsSquareObjectDataset() (*SquareObjectDataset, bool) { + return nil, false +} + +// AsSparkObjectDataset is the BasicDataset implementation for AzureBlobDataset. +func (abd AzureBlobDataset) AsSparkObjectDataset() (*SparkObjectDataset, bool) { + return nil, false +} + +// AsShopifyObjectDataset is the BasicDataset implementation for AzureBlobDataset. +func (abd AzureBlobDataset) AsShopifyObjectDataset() (*ShopifyObjectDataset, bool) { + return nil, false +} + +// AsServiceNowObjectDataset is the BasicDataset implementation for AzureBlobDataset. +func (abd AzureBlobDataset) AsServiceNowObjectDataset() (*ServiceNowObjectDataset, bool) { + return nil, false +} + +// AsQuickBooksObjectDataset is the BasicDataset implementation for AzureBlobDataset. +func (abd AzureBlobDataset) AsQuickBooksObjectDataset() (*QuickBooksObjectDataset, bool) { + return nil, false +} + +// AsPrestoObjectDataset is the BasicDataset implementation for AzureBlobDataset. +func (abd AzureBlobDataset) AsPrestoObjectDataset() (*PrestoObjectDataset, bool) { + return nil, false +} + +// AsPhoenixObjectDataset is the BasicDataset implementation for AzureBlobDataset. +func (abd AzureBlobDataset) AsPhoenixObjectDataset() (*PhoenixObjectDataset, bool) { + return nil, false +} + +// AsPaypalObjectDataset is the BasicDataset implementation for AzureBlobDataset. +func (abd AzureBlobDataset) AsPaypalObjectDataset() (*PaypalObjectDataset, bool) { + return nil, false +} + +// AsMarketoObjectDataset is the BasicDataset implementation for AzureBlobDataset. +func (abd AzureBlobDataset) AsMarketoObjectDataset() (*MarketoObjectDataset, bool) { + return nil, false +} + +// AsMariaDBTableDataset is the BasicDataset implementation for AzureBlobDataset. +func (abd AzureBlobDataset) AsMariaDBTableDataset() (*MariaDBTableDataset, bool) { + return nil, false +} + +// AsMagentoObjectDataset is the BasicDataset implementation for AzureBlobDataset. +func (abd AzureBlobDataset) AsMagentoObjectDataset() (*MagentoObjectDataset, bool) { + return nil, false +} + +// AsJiraObjectDataset is the BasicDataset implementation for AzureBlobDataset. +func (abd AzureBlobDataset) AsJiraObjectDataset() (*JiraObjectDataset, bool) { + return nil, false +} + +// AsImpalaObjectDataset is the BasicDataset implementation for AzureBlobDataset. +func (abd AzureBlobDataset) AsImpalaObjectDataset() (*ImpalaObjectDataset, bool) { + return nil, false +} + +// AsHubspotObjectDataset is the BasicDataset implementation for AzureBlobDataset. +func (abd AzureBlobDataset) AsHubspotObjectDataset() (*HubspotObjectDataset, bool) { + return nil, false +} + +// AsHiveObjectDataset is the BasicDataset implementation for AzureBlobDataset. +func (abd AzureBlobDataset) AsHiveObjectDataset() (*HiveObjectDataset, bool) { + return nil, false +} + +// AsHBaseObjectDataset is the BasicDataset implementation for AzureBlobDataset. +func (abd AzureBlobDataset) AsHBaseObjectDataset() (*HBaseObjectDataset, bool) { + return nil, false +} + +// AsGreenplumTableDataset is the BasicDataset implementation for AzureBlobDataset. +func (abd AzureBlobDataset) AsGreenplumTableDataset() (*GreenplumTableDataset, bool) { + return nil, false +} + +// AsGoogleBigQueryObjectDataset is the BasicDataset implementation for AzureBlobDataset. +func (abd AzureBlobDataset) AsGoogleBigQueryObjectDataset() (*GoogleBigQueryObjectDataset, bool) { + return nil, false +} + +// AsEloquaObjectDataset is the BasicDataset implementation for AzureBlobDataset. +func (abd AzureBlobDataset) AsEloquaObjectDataset() (*EloquaObjectDataset, bool) { + return nil, false +} + +// AsDrillTableDataset is the BasicDataset implementation for AzureBlobDataset. +func (abd AzureBlobDataset) AsDrillTableDataset() (*DrillTableDataset, bool) { + return nil, false +} + +// AsCouchbaseTableDataset is the BasicDataset implementation for AzureBlobDataset. +func (abd AzureBlobDataset) AsCouchbaseTableDataset() (*CouchbaseTableDataset, bool) { + return nil, false +} + +// AsConcurObjectDataset is the BasicDataset implementation for AzureBlobDataset. +func (abd AzureBlobDataset) AsConcurObjectDataset() (*ConcurObjectDataset, bool) { + return nil, false +} + +// AsAzurePostgreSQLTableDataset is the BasicDataset implementation for AzureBlobDataset. +func (abd AzureBlobDataset) AsAzurePostgreSQLTableDataset() (*AzurePostgreSQLTableDataset, bool) { + return nil, false +} + +// AsAmazonMWSObjectDataset is the BasicDataset implementation for AzureBlobDataset. +func (abd AzureBlobDataset) AsAmazonMWSObjectDataset() (*AmazonMWSObjectDataset, bool) { + return nil, false +} + +// AsHTTPDataset is the BasicDataset implementation for AzureBlobDataset. +func (abd AzureBlobDataset) AsHTTPDataset() (*HTTPDataset, bool) { + return nil, false +} + +// AsAzureSearchIndexDataset is the BasicDataset implementation for AzureBlobDataset. +func (abd AzureBlobDataset) AsAzureSearchIndexDataset() (*AzureSearchIndexDataset, bool) { + return nil, false +} + +// AsWebTableDataset is the BasicDataset implementation for AzureBlobDataset. +func (abd AzureBlobDataset) AsWebTableDataset() (*WebTableDataset, bool) { + return nil, false +} + +// AsSQLServerTableDataset is the BasicDataset implementation for AzureBlobDataset. +func (abd AzureBlobDataset) AsSQLServerTableDataset() (*SQLServerTableDataset, bool) { + return nil, false +} + +// AsSapEccResourceDataset is the BasicDataset implementation for AzureBlobDataset. +func (abd AzureBlobDataset) AsSapEccResourceDataset() (*SapEccResourceDataset, bool) { + return nil, false +} + +// AsSapCloudForCustomerResourceDataset is the BasicDataset implementation for AzureBlobDataset. +func (abd AzureBlobDataset) AsSapCloudForCustomerResourceDataset() (*SapCloudForCustomerResourceDataset, bool) { + return nil, false +} + +// AsSalesforceObjectDataset is the BasicDataset implementation for AzureBlobDataset. +func (abd AzureBlobDataset) AsSalesforceObjectDataset() (*SalesforceObjectDataset, bool) { + return nil, false +} + +// AsRelationalTableDataset is the BasicDataset implementation for AzureBlobDataset. +func (abd AzureBlobDataset) AsRelationalTableDataset() (*RelationalTableDataset, bool) { + return nil, false +} + +// AsAzureMySQLTableDataset is the BasicDataset implementation for AzureBlobDataset. +func (abd AzureBlobDataset) AsAzureMySQLTableDataset() (*AzureMySQLTableDataset, bool) { + return nil, false +} + +// AsOracleTableDataset is the BasicDataset implementation for AzureBlobDataset. +func (abd AzureBlobDataset) AsOracleTableDataset() (*OracleTableDataset, bool) { + return nil, false +} + +// AsODataResourceDataset is the BasicDataset implementation for AzureBlobDataset. +func (abd AzureBlobDataset) AsODataResourceDataset() (*ODataResourceDataset, bool) { + return nil, false +} + +// AsMongoDbCollectionDataset is the BasicDataset implementation for AzureBlobDataset. +func (abd AzureBlobDataset) AsMongoDbCollectionDataset() (*MongoDbCollectionDataset, bool) { + return nil, false +} + +// AsFileShareDataset is the BasicDataset implementation for AzureBlobDataset. +func (abd AzureBlobDataset) AsFileShareDataset() (*FileShareDataset, bool) { + return nil, false +} + +// AsAzureDataLakeStoreDataset is the BasicDataset implementation for AzureBlobDataset. +func (abd AzureBlobDataset) AsAzureDataLakeStoreDataset() (*AzureDataLakeStoreDataset, bool) { + return nil, false +} + +// AsDynamicsEntityDataset is the BasicDataset implementation for AzureBlobDataset. +func (abd AzureBlobDataset) AsDynamicsEntityDataset() (*DynamicsEntityDataset, bool) { + return nil, false +} + +// AsDocumentDbCollectionDataset is the BasicDataset implementation for AzureBlobDataset. +func (abd AzureBlobDataset) AsDocumentDbCollectionDataset() (*DocumentDbCollectionDataset, bool) { + return nil, false +} + +// AsCustomDataset is the BasicDataset implementation for AzureBlobDataset. +func (abd AzureBlobDataset) AsCustomDataset() (*CustomDataset, bool) { + return nil, false +} + +// AsCassandraTableDataset is the BasicDataset implementation for AzureBlobDataset. +func (abd AzureBlobDataset) AsCassandraTableDataset() (*CassandraTableDataset, bool) { + return nil, false +} + +// AsAzureSQLDWTableDataset is the BasicDataset implementation for AzureBlobDataset. +func (abd AzureBlobDataset) AsAzureSQLDWTableDataset() (*AzureSQLDWTableDataset, bool) { + return nil, false +} + +// AsAzureSQLTableDataset is the BasicDataset implementation for AzureBlobDataset. +func (abd AzureBlobDataset) AsAzureSQLTableDataset() (*AzureSQLTableDataset, bool) { + return nil, false +} + +// AsAzureTableDataset is the BasicDataset implementation for AzureBlobDataset. +func (abd AzureBlobDataset) AsAzureTableDataset() (*AzureTableDataset, bool) { + return nil, false +} + +// AsAzureBlobDataset is the BasicDataset implementation for AzureBlobDataset. +func (abd AzureBlobDataset) AsAzureBlobDataset() (*AzureBlobDataset, bool) { + return &abd, true +} + +// AsAmazonS3Dataset is the BasicDataset implementation for AzureBlobDataset. +func (abd AzureBlobDataset) AsAmazonS3Dataset() (*AmazonS3Dataset, bool) { + return nil, false +} + +// AsDataset is the BasicDataset implementation for AzureBlobDataset. +func (abd AzureBlobDataset) AsDataset() (*Dataset, bool) { + return nil, false +} + +// AsBasicDataset is the BasicDataset implementation for AzureBlobDataset. +func (abd AzureBlobDataset) AsBasicDataset() (BasicDataset, bool) { + return &abd, true +} + +// UnmarshalJSON is the custom unmarshaler for AzureBlobDataset struct. +func (abd *AzureBlobDataset) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "typeProperties": + if v != nil { + var azureBlobDatasetTypeProperties AzureBlobDatasetTypeProperties + err = json.Unmarshal(*v, &azureBlobDatasetTypeProperties) + if err != nil { + return err + } + abd.AzureBlobDatasetTypeProperties = &azureBlobDatasetTypeProperties + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if abd.AdditionalProperties == nil { + abd.AdditionalProperties = make(map[string]interface{}) + } + abd.AdditionalProperties[k] = additionalProperties + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + abd.Description = &description + } + case "structure": + if v != nil { + var structure interface{} + err = json.Unmarshal(*v, &structure) + if err != nil { + return err + } + abd.Structure = structure + } + case "linkedServiceName": + if v != nil { + var linkedServiceName LinkedServiceReference + err = json.Unmarshal(*v, &linkedServiceName) + if err != nil { + return err + } + abd.LinkedServiceName = &linkedServiceName + } + case "parameters": + if v != nil { + var parameters map[string]*ParameterSpecification + err = json.Unmarshal(*v, ¶meters) + if err != nil { + return err + } + abd.Parameters = parameters + } + case "annotations": + if v != nil { + var annotations []interface{} + err = json.Unmarshal(*v, &annotations) + if err != nil { + return err + } + abd.Annotations = &annotations + } + case "type": + if v != nil { + var typeVar TypeBasicDataset + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + abd.Type = typeVar + } + } + } + + return nil +} + +// AzureBlobDatasetTypeProperties azure Blob dataset properties. +type AzureBlobDatasetTypeProperties struct { + // FolderPath - The path of the Azure Blob storage. Type: string (or Expression with resultType string). + FolderPath interface{} `json:"folderPath,omitempty"` + // TableRootLocation - The root of blob path. Type: string (or Expression with resultType string). + TableRootLocation interface{} `json:"tableRootLocation,omitempty"` + // FileName - The name of the Azure Blob. Type: string (or Expression with resultType string). + FileName interface{} `json:"fileName,omitempty"` + // Format - The format of the Azure Blob storage. + Format BasicDatasetStorageFormat `json:"format,omitempty"` + // Compression - The data compression method used for the blob storage. + Compression BasicDatasetCompression `json:"compression,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for AzureBlobDatasetTypeProperties struct. +func (abdtp *AzureBlobDatasetTypeProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "folderPath": + if v != nil { + var folderPath interface{} + err = json.Unmarshal(*v, &folderPath) + if err != nil { + return err + } + abdtp.FolderPath = folderPath + } + case "tableRootLocation": + if v != nil { + var tableRootLocation interface{} + err = json.Unmarshal(*v, &tableRootLocation) + if err != nil { + return err + } + abdtp.TableRootLocation = tableRootLocation + } + case "fileName": + if v != nil { + var fileName interface{} + err = json.Unmarshal(*v, &fileName) + if err != nil { + return err + } + abdtp.FileName = fileName + } + case "format": + if v != nil { + formatVar, err := unmarshalBasicDatasetStorageFormat(*v) + if err != nil { + return err + } + abdtp.Format = formatVar + } + case "compression": + if v != nil { + compression, err := unmarshalBasicDatasetCompression(*v) + if err != nil { + return err + } + abdtp.Compression = compression + } + } + } + + return nil +} + +// AzureDatabricksLinkedService azure Databricks linked service. +type AzureDatabricksLinkedService struct { + // AzureDatabricksLinkedServiceTypeProperties - Azure Databricks linked service properties. + *AzureDatabricksLinkedServiceTypeProperties `json:"typeProperties,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // ConnectVia - The integration runtime reference. + ConnectVia *IntegrationRuntimeReference `json:"connectVia,omitempty"` + // Description - Linked service description. + Description *string `json:"description,omitempty"` + // Parameters - Parameters for linked service. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeLinkedService', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforce', 'TypeAzureDataLakeStore', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureStorage' + Type TypeBasicLinkedService `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureDatabricksLinkedService. +func (adls AzureDatabricksLinkedService) MarshalJSON() ([]byte, error) { + adls.Type = TypeAzureDatabricks + objectMap := make(map[string]interface{}) + if adls.AzureDatabricksLinkedServiceTypeProperties != nil { + objectMap["typeProperties"] = adls.AzureDatabricksLinkedServiceTypeProperties + } + if adls.ConnectVia != nil { + objectMap["connectVia"] = adls.ConnectVia + } + if adls.Description != nil { + objectMap["description"] = adls.Description + } + if adls.Parameters != nil { + objectMap["parameters"] = adls.Parameters + } + if adls.Annotations != nil { + objectMap["annotations"] = adls.Annotations + } + if adls.Type != "" { + objectMap["type"] = adls.Type + } + for k, v := range adls.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysLinkedService is the BasicLinkedService implementation for AzureDatabricksLinkedService. +func (adls AzureDatabricksLinkedService) AsResponsysLinkedService() (*ResponsysLinkedService, bool) { + return nil, false +} + +// AsAzureDatabricksLinkedService is the BasicLinkedService implementation for AzureDatabricksLinkedService. +func (adls AzureDatabricksLinkedService) AsAzureDatabricksLinkedService() (*AzureDatabricksLinkedService, bool) { + return &adls, true +} + +// AsAzureDataLakeAnalyticsLinkedService is the BasicLinkedService implementation for AzureDatabricksLinkedService. +func (adls AzureDatabricksLinkedService) AsAzureDataLakeAnalyticsLinkedService() (*AzureDataLakeAnalyticsLinkedService, bool) { + return nil, false +} + +// AsHDInsightOnDemandLinkedService is the BasicLinkedService implementation for AzureDatabricksLinkedService. +func (adls AzureDatabricksLinkedService) AsHDInsightOnDemandLinkedService() (*HDInsightOnDemandLinkedService, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudLinkedService is the BasicLinkedService implementation for AzureDatabricksLinkedService. +func (adls AzureDatabricksLinkedService) AsSalesforceMarketingCloudLinkedService() (*SalesforceMarketingCloudLinkedService, bool) { + return nil, false +} + +// AsNetezzaLinkedService is the BasicLinkedService implementation for AzureDatabricksLinkedService. +func (adls AzureDatabricksLinkedService) AsNetezzaLinkedService() (*NetezzaLinkedService, bool) { + return nil, false +} + +// AsVerticaLinkedService is the BasicLinkedService implementation for AzureDatabricksLinkedService. +func (adls AzureDatabricksLinkedService) AsVerticaLinkedService() (*VerticaLinkedService, bool) { + return nil, false +} + +// AsZohoLinkedService is the BasicLinkedService implementation for AzureDatabricksLinkedService. +func (adls AzureDatabricksLinkedService) AsZohoLinkedService() (*ZohoLinkedService, bool) { + return nil, false +} + +// AsXeroLinkedService is the BasicLinkedService implementation for AzureDatabricksLinkedService. +func (adls AzureDatabricksLinkedService) AsXeroLinkedService() (*XeroLinkedService, bool) { + return nil, false +} + +// AsSquareLinkedService is the BasicLinkedService implementation for AzureDatabricksLinkedService. +func (adls AzureDatabricksLinkedService) AsSquareLinkedService() (*SquareLinkedService, bool) { + return nil, false +} + +// AsSparkLinkedService is the BasicLinkedService implementation for AzureDatabricksLinkedService. +func (adls AzureDatabricksLinkedService) AsSparkLinkedService() (*SparkLinkedService, bool) { + return nil, false +} + +// AsShopifyLinkedService is the BasicLinkedService implementation for AzureDatabricksLinkedService. +func (adls AzureDatabricksLinkedService) AsShopifyLinkedService() (*ShopifyLinkedService, bool) { + return nil, false +} + +// AsServiceNowLinkedService is the BasicLinkedService implementation for AzureDatabricksLinkedService. +func (adls AzureDatabricksLinkedService) AsServiceNowLinkedService() (*ServiceNowLinkedService, bool) { + return nil, false +} + +// AsQuickBooksLinkedService is the BasicLinkedService implementation for AzureDatabricksLinkedService. +func (adls AzureDatabricksLinkedService) AsQuickBooksLinkedService() (*QuickBooksLinkedService, bool) { + return nil, false +} + +// AsPrestoLinkedService is the BasicLinkedService implementation for AzureDatabricksLinkedService. +func (adls AzureDatabricksLinkedService) AsPrestoLinkedService() (*PrestoLinkedService, bool) { + return nil, false +} + +// AsPhoenixLinkedService is the BasicLinkedService implementation for AzureDatabricksLinkedService. +func (adls AzureDatabricksLinkedService) AsPhoenixLinkedService() (*PhoenixLinkedService, bool) { + return nil, false +} + +// AsPaypalLinkedService is the BasicLinkedService implementation for AzureDatabricksLinkedService. +func (adls AzureDatabricksLinkedService) AsPaypalLinkedService() (*PaypalLinkedService, bool) { + return nil, false +} + +// AsMarketoLinkedService is the BasicLinkedService implementation for AzureDatabricksLinkedService. +func (adls AzureDatabricksLinkedService) AsMarketoLinkedService() (*MarketoLinkedService, bool) { + return nil, false +} + +// AsMariaDBLinkedService is the BasicLinkedService implementation for AzureDatabricksLinkedService. +func (adls AzureDatabricksLinkedService) AsMariaDBLinkedService() (*MariaDBLinkedService, bool) { + return nil, false +} + +// AsMagentoLinkedService is the BasicLinkedService implementation for AzureDatabricksLinkedService. +func (adls AzureDatabricksLinkedService) AsMagentoLinkedService() (*MagentoLinkedService, bool) { + return nil, false +} + +// AsJiraLinkedService is the BasicLinkedService implementation for AzureDatabricksLinkedService. +func (adls AzureDatabricksLinkedService) AsJiraLinkedService() (*JiraLinkedService, bool) { + return nil, false +} + +// AsImpalaLinkedService is the BasicLinkedService implementation for AzureDatabricksLinkedService. +func (adls AzureDatabricksLinkedService) AsImpalaLinkedService() (*ImpalaLinkedService, bool) { + return nil, false +} + +// AsHubspotLinkedService is the BasicLinkedService implementation for AzureDatabricksLinkedService. +func (adls AzureDatabricksLinkedService) AsHubspotLinkedService() (*HubspotLinkedService, bool) { + return nil, false +} + +// AsHiveLinkedService is the BasicLinkedService implementation for AzureDatabricksLinkedService. +func (adls AzureDatabricksLinkedService) AsHiveLinkedService() (*HiveLinkedService, bool) { + return nil, false +} + +// AsHBaseLinkedService is the BasicLinkedService implementation for AzureDatabricksLinkedService. +func (adls AzureDatabricksLinkedService) AsHBaseLinkedService() (*HBaseLinkedService, bool) { + return nil, false +} + +// AsGreenplumLinkedService is the BasicLinkedService implementation for AzureDatabricksLinkedService. +func (adls AzureDatabricksLinkedService) AsGreenplumLinkedService() (*GreenplumLinkedService, bool) { + return nil, false +} + +// AsGoogleBigQueryLinkedService is the BasicLinkedService implementation for AzureDatabricksLinkedService. +func (adls AzureDatabricksLinkedService) AsGoogleBigQueryLinkedService() (*GoogleBigQueryLinkedService, bool) { + return nil, false +} + +// AsEloquaLinkedService is the BasicLinkedService implementation for AzureDatabricksLinkedService. +func (adls AzureDatabricksLinkedService) AsEloquaLinkedService() (*EloquaLinkedService, bool) { + return nil, false +} + +// AsDrillLinkedService is the BasicLinkedService implementation for AzureDatabricksLinkedService. +func (adls AzureDatabricksLinkedService) AsDrillLinkedService() (*DrillLinkedService, bool) { + return nil, false +} + +// AsCouchbaseLinkedService is the BasicLinkedService implementation for AzureDatabricksLinkedService. +func (adls AzureDatabricksLinkedService) AsCouchbaseLinkedService() (*CouchbaseLinkedService, bool) { + return nil, false +} + +// AsConcurLinkedService is the BasicLinkedService implementation for AzureDatabricksLinkedService. +func (adls AzureDatabricksLinkedService) AsConcurLinkedService() (*ConcurLinkedService, bool) { + return nil, false +} + +// AsAzurePostgreSQLLinkedService is the BasicLinkedService implementation for AzureDatabricksLinkedService. +func (adls AzureDatabricksLinkedService) AsAzurePostgreSQLLinkedService() (*AzurePostgreSQLLinkedService, bool) { + return nil, false +} + +// AsAmazonMWSLinkedService is the BasicLinkedService implementation for AzureDatabricksLinkedService. +func (adls AzureDatabricksLinkedService) AsAmazonMWSLinkedService() (*AmazonMWSLinkedService, bool) { + return nil, false +} + +// AsSapHanaLinkedService is the BasicLinkedService implementation for AzureDatabricksLinkedService. +func (adls AzureDatabricksLinkedService) AsSapHanaLinkedService() (*SapHanaLinkedService, bool) { + return nil, false +} + +// AsSapBWLinkedService is the BasicLinkedService implementation for AzureDatabricksLinkedService. +func (adls AzureDatabricksLinkedService) AsSapBWLinkedService() (*SapBWLinkedService, bool) { + return nil, false +} + +// AsSftpServerLinkedService is the BasicLinkedService implementation for AzureDatabricksLinkedService. +func (adls AzureDatabricksLinkedService) AsSftpServerLinkedService() (*SftpServerLinkedService, bool) { + return nil, false +} + +// AsFtpServerLinkedService is the BasicLinkedService implementation for AzureDatabricksLinkedService. +func (adls AzureDatabricksLinkedService) AsFtpServerLinkedService() (*FtpServerLinkedService, bool) { + return nil, false +} + +// AsHTTPLinkedService is the BasicLinkedService implementation for AzureDatabricksLinkedService. +func (adls AzureDatabricksLinkedService) AsHTTPLinkedService() (*HTTPLinkedService, bool) { + return nil, false +} + +// AsAzureSearchLinkedService is the BasicLinkedService implementation for AzureDatabricksLinkedService. +func (adls AzureDatabricksLinkedService) AsAzureSearchLinkedService() (*AzureSearchLinkedService, bool) { + return nil, false +} + +// AsCustomDataSourceLinkedService is the BasicLinkedService implementation for AzureDatabricksLinkedService. +func (adls AzureDatabricksLinkedService) AsCustomDataSourceLinkedService() (*CustomDataSourceLinkedService, bool) { + return nil, false +} + +// AsAmazonRedshiftLinkedService is the BasicLinkedService implementation for AzureDatabricksLinkedService. +func (adls AzureDatabricksLinkedService) AsAmazonRedshiftLinkedService() (*AmazonRedshiftLinkedService, bool) { + return nil, false +} + +// AsAmazonS3LinkedService is the BasicLinkedService implementation for AzureDatabricksLinkedService. +func (adls AzureDatabricksLinkedService) AsAmazonS3LinkedService() (*AmazonS3LinkedService, bool) { + return nil, false +} + +// AsSapEccLinkedService is the BasicLinkedService implementation for AzureDatabricksLinkedService. +func (adls AzureDatabricksLinkedService) AsSapEccLinkedService() (*SapEccLinkedService, bool) { + return nil, false +} + +// AsSapCloudForCustomerLinkedService is the BasicLinkedService implementation for AzureDatabricksLinkedService. +func (adls AzureDatabricksLinkedService) AsSapCloudForCustomerLinkedService() (*SapCloudForCustomerLinkedService, bool) { + return nil, false +} + +// AsSalesforceLinkedService is the BasicLinkedService implementation for AzureDatabricksLinkedService. +func (adls AzureDatabricksLinkedService) AsSalesforceLinkedService() (*SalesforceLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeStoreLinkedService is the BasicLinkedService implementation for AzureDatabricksLinkedService. +func (adls AzureDatabricksLinkedService) AsAzureDataLakeStoreLinkedService() (*AzureDataLakeStoreLinkedService, bool) { + return nil, false +} + +// AsMongoDbLinkedService is the BasicLinkedService implementation for AzureDatabricksLinkedService. +func (adls AzureDatabricksLinkedService) AsMongoDbLinkedService() (*MongoDbLinkedService, bool) { + return nil, false +} + +// AsCassandraLinkedService is the BasicLinkedService implementation for AzureDatabricksLinkedService. +func (adls AzureDatabricksLinkedService) AsCassandraLinkedService() (*CassandraLinkedService, bool) { + return nil, false +} + +// AsWebLinkedService is the BasicLinkedService implementation for AzureDatabricksLinkedService. +func (adls AzureDatabricksLinkedService) AsWebLinkedService() (*WebLinkedService, bool) { + return nil, false +} + +// AsODataLinkedService is the BasicLinkedService implementation for AzureDatabricksLinkedService. +func (adls AzureDatabricksLinkedService) AsODataLinkedService() (*ODataLinkedService, bool) { + return nil, false +} + +// AsHdfsLinkedService is the BasicLinkedService implementation for AzureDatabricksLinkedService. +func (adls AzureDatabricksLinkedService) AsHdfsLinkedService() (*HdfsLinkedService, bool) { + return nil, false +} + +// AsOdbcLinkedService is the BasicLinkedService implementation for AzureDatabricksLinkedService. +func (adls AzureDatabricksLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, bool) { + return nil, false +} + +// AsAzureMLLinkedService is the BasicLinkedService implementation for AzureDatabricksLinkedService. +func (adls AzureDatabricksLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { + return nil, false +} + +// AsTeradataLinkedService is the BasicLinkedService implementation for AzureDatabricksLinkedService. +func (adls AzureDatabricksLinkedService) AsTeradataLinkedService() (*TeradataLinkedService, bool) { + return nil, false +} + +// AsDb2LinkedService is the BasicLinkedService implementation for AzureDatabricksLinkedService. +func (adls AzureDatabricksLinkedService) AsDb2LinkedService() (*Db2LinkedService, bool) { + return nil, false +} + +// AsSybaseLinkedService is the BasicLinkedService implementation for AzureDatabricksLinkedService. +func (adls AzureDatabricksLinkedService) AsSybaseLinkedService() (*SybaseLinkedService, bool) { + return nil, false +} + +// AsPostgreSQLLinkedService is the BasicLinkedService implementation for AzureDatabricksLinkedService. +func (adls AzureDatabricksLinkedService) AsPostgreSQLLinkedService() (*PostgreSQLLinkedService, bool) { + return nil, false +} + +// AsMySQLLinkedService is the BasicLinkedService implementation for AzureDatabricksLinkedService. +func (adls AzureDatabricksLinkedService) AsMySQLLinkedService() (*MySQLLinkedService, bool) { + return nil, false +} + +// AsAzureMySQLLinkedService is the BasicLinkedService implementation for AzureDatabricksLinkedService. +func (adls AzureDatabricksLinkedService) AsAzureMySQLLinkedService() (*AzureMySQLLinkedService, bool) { + return nil, false +} + +// AsOracleLinkedService is the BasicLinkedService implementation for AzureDatabricksLinkedService. +func (adls AzureDatabricksLinkedService) AsOracleLinkedService() (*OracleLinkedService, bool) { + return nil, false +} + +// AsFileServerLinkedService is the BasicLinkedService implementation for AzureDatabricksLinkedService. +func (adls AzureDatabricksLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { + return nil, false +} + +// AsHDInsightLinkedService is the BasicLinkedService implementation for AzureDatabricksLinkedService. +func (adls AzureDatabricksLinkedService) AsHDInsightLinkedService() (*HDInsightLinkedService, bool) { + return nil, false +} + +// AsDynamicsLinkedService is the BasicLinkedService implementation for AzureDatabricksLinkedService. +func (adls AzureDatabricksLinkedService) AsDynamicsLinkedService() (*DynamicsLinkedService, bool) { + return nil, false +} + +// AsCosmosDbLinkedService is the BasicLinkedService implementation for AzureDatabricksLinkedService. +func (adls AzureDatabricksLinkedService) AsCosmosDbLinkedService() (*CosmosDbLinkedService, bool) { + return nil, false +} + +// AsAzureKeyVaultLinkedService is the BasicLinkedService implementation for AzureDatabricksLinkedService. +func (adls AzureDatabricksLinkedService) AsAzureKeyVaultLinkedService() (*AzureKeyVaultLinkedService, bool) { + return nil, false +} + +// AsAzureBatchLinkedService is the BasicLinkedService implementation for AzureDatabricksLinkedService. +func (adls AzureDatabricksLinkedService) AsAzureBatchLinkedService() (*AzureBatchLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDatabaseLinkedService is the BasicLinkedService implementation for AzureDatabricksLinkedService. +func (adls AzureDatabricksLinkedService) AsAzureSQLDatabaseLinkedService() (*AzureSQLDatabaseLinkedService, bool) { + return nil, false +} + +// AsSQLServerLinkedService is the BasicLinkedService implementation for AzureDatabricksLinkedService. +func (adls AzureDatabricksLinkedService) AsSQLServerLinkedService() (*SQLServerLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDWLinkedService is the BasicLinkedService implementation for AzureDatabricksLinkedService. +func (adls AzureDatabricksLinkedService) AsAzureSQLDWLinkedService() (*AzureSQLDWLinkedService, bool) { + return nil, false +} + +// AsAzureStorageLinkedService is the BasicLinkedService implementation for AzureDatabricksLinkedService. +func (adls AzureDatabricksLinkedService) AsAzureStorageLinkedService() (*AzureStorageLinkedService, bool) { + return nil, false +} + +// AsLinkedService is the BasicLinkedService implementation for AzureDatabricksLinkedService. +func (adls AzureDatabricksLinkedService) AsLinkedService() (*LinkedService, bool) { + return nil, false +} + +// AsBasicLinkedService is the BasicLinkedService implementation for AzureDatabricksLinkedService. +func (adls AzureDatabricksLinkedService) AsBasicLinkedService() (BasicLinkedService, bool) { + return &adls, true +} + +// UnmarshalJSON is the custom unmarshaler for AzureDatabricksLinkedService struct. +func (adls *AzureDatabricksLinkedService) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "typeProperties": + if v != nil { + var azureDatabricksLinkedServiceTypeProperties AzureDatabricksLinkedServiceTypeProperties + err = json.Unmarshal(*v, &azureDatabricksLinkedServiceTypeProperties) + if err != nil { + return err + } + adls.AzureDatabricksLinkedServiceTypeProperties = &azureDatabricksLinkedServiceTypeProperties + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if adls.AdditionalProperties == nil { + adls.AdditionalProperties = make(map[string]interface{}) + } + adls.AdditionalProperties[k] = additionalProperties + } + case "connectVia": + if v != nil { + var connectVia IntegrationRuntimeReference + err = json.Unmarshal(*v, &connectVia) + if err != nil { + return err + } + adls.ConnectVia = &connectVia + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + adls.Description = &description + } + case "parameters": + if v != nil { + var parameters map[string]*ParameterSpecification + err = json.Unmarshal(*v, ¶meters) + if err != nil { + return err + } + adls.Parameters = parameters + } + case "annotations": + if v != nil { + var annotations []interface{} + err = json.Unmarshal(*v, &annotations) + if err != nil { + return err + } + adls.Annotations = &annotations + } + case "type": + if v != nil { + var typeVar TypeBasicLinkedService + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + adls.Type = typeVar + } + } + } + + return nil +} + +// AzureDatabricksLinkedServiceTypeProperties azure Databricks linked service properties. +type AzureDatabricksLinkedServiceTypeProperties struct { + // Domain - .azuredatabricks.net, domain name of your Databricks deployment. Type: string (or Expression with resultType string). + Domain interface{} `json:"domain,omitempty"` + // AccessToken - Access token for databricks REST API. Refer to https://docs.azuredatabricks.net/api/latest/authentication.html. Type: string (or Expression with resultType string). + AccessToken BasicSecretBase `json:"accessToken,omitempty"` + // ExistingClusterID - The id of an existing cluster that will be used for all runs of this job. Type: string (or Expression with resultType string). + ExistingClusterID interface{} `json:"existingClusterId,omitempty"` + // NewClusterVersion - The Spark version of new cluster. Type: string (or Expression with resultType string). + NewClusterVersion interface{} `json:"newClusterVersion,omitempty"` + // NewClusterNumOfWorker - Number of worker nodes that new cluster should have. A string formatted Int32, like '1' means numOfWorker is 1 or '1:10' means auto-scale from 1 as min and 10 as max. Type: string (or Expression with resultType string). + NewClusterNumOfWorker interface{} `json:"newClusterNumOfWorker,omitempty"` + // NewClusterNodeType - The node types of new cluster. Type: string (or Expression with resultType string). + NewClusterNodeType interface{} `json:"newClusterNodeType,omitempty"` + // NewClusterSparkConf - a set of optional, user-specified Spark configuration key-value pairs. + NewClusterSparkConf map[string]interface{} `json:"newClusterSparkConf"` + // EncryptedCredential - The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string). + EncryptedCredential interface{} `json:"encryptedCredential,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureDatabricksLinkedServiceTypeProperties. +func (adlstp AzureDatabricksLinkedServiceTypeProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["domain"] = adlstp.Domain + objectMap["accessToken"] = adlstp.AccessToken + objectMap["existingClusterId"] = adlstp.ExistingClusterID + objectMap["newClusterVersion"] = adlstp.NewClusterVersion + objectMap["newClusterNumOfWorker"] = adlstp.NewClusterNumOfWorker + objectMap["newClusterNodeType"] = adlstp.NewClusterNodeType + if adlstp.NewClusterSparkConf != nil { + objectMap["newClusterSparkConf"] = adlstp.NewClusterSparkConf + } + objectMap["encryptedCredential"] = adlstp.EncryptedCredential + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for AzureDatabricksLinkedServiceTypeProperties struct. +func (adlstp *AzureDatabricksLinkedServiceTypeProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "domain": + if v != nil { + var domain interface{} + err = json.Unmarshal(*v, &domain) + if err != nil { + return err + } + adlstp.Domain = domain + } + case "accessToken": + if v != nil { + accessToken, err := unmarshalBasicSecretBase(*v) + if err != nil { + return err + } + adlstp.AccessToken = accessToken + } + case "existingClusterId": + if v != nil { + var existingClusterID interface{} + err = json.Unmarshal(*v, &existingClusterID) + if err != nil { + return err + } + adlstp.ExistingClusterID = existingClusterID + } + case "newClusterVersion": + if v != nil { + var newClusterVersion interface{} + err = json.Unmarshal(*v, &newClusterVersion) + if err != nil { + return err + } + adlstp.NewClusterVersion = newClusterVersion + } + case "newClusterNumOfWorker": + if v != nil { + var newClusterNumOfWorker interface{} + err = json.Unmarshal(*v, &newClusterNumOfWorker) + if err != nil { + return err + } + adlstp.NewClusterNumOfWorker = newClusterNumOfWorker + } + case "newClusterNodeType": + if v != nil { + var newClusterNodeType interface{} + err = json.Unmarshal(*v, &newClusterNodeType) + if err != nil { + return err + } + adlstp.NewClusterNodeType = newClusterNodeType + } + case "newClusterSparkConf": + if v != nil { + var newClusterSparkConf map[string]interface{} + err = json.Unmarshal(*v, &newClusterSparkConf) + if err != nil { + return err + } + adlstp.NewClusterSparkConf = newClusterSparkConf + } + case "encryptedCredential": + if v != nil { + var encryptedCredential interface{} + err = json.Unmarshal(*v, &encryptedCredential) + if err != nil { + return err + } + adlstp.EncryptedCredential = encryptedCredential + } + } + } + + return nil +} + +// AzureDataLakeAnalyticsLinkedService azure Data Lake Analytics linked service. +type AzureDataLakeAnalyticsLinkedService struct { + // AzureDataLakeAnalyticsLinkedServiceTypeProperties - Azure Data Lake Analytics linked service properties. + *AzureDataLakeAnalyticsLinkedServiceTypeProperties `json:"typeProperties,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // ConnectVia - The integration runtime reference. + ConnectVia *IntegrationRuntimeReference `json:"connectVia,omitempty"` + // Description - Linked service description. + Description *string `json:"description,omitempty"` + // Parameters - Parameters for linked service. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeLinkedService', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforce', 'TypeAzureDataLakeStore', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureStorage' + Type TypeBasicLinkedService `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureDataLakeAnalyticsLinkedService. +func (adlals AzureDataLakeAnalyticsLinkedService) MarshalJSON() ([]byte, error) { + adlals.Type = TypeAzureDataLakeAnalytics + objectMap := make(map[string]interface{}) + if adlals.AzureDataLakeAnalyticsLinkedServiceTypeProperties != nil { + objectMap["typeProperties"] = adlals.AzureDataLakeAnalyticsLinkedServiceTypeProperties + } + if adlals.ConnectVia != nil { + objectMap["connectVia"] = adlals.ConnectVia + } + if adlals.Description != nil { + objectMap["description"] = adlals.Description + } + if adlals.Parameters != nil { + objectMap["parameters"] = adlals.Parameters + } + if adlals.Annotations != nil { + objectMap["annotations"] = adlals.Annotations + } + if adlals.Type != "" { + objectMap["type"] = adlals.Type + } + for k, v := range adlals.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysLinkedService is the BasicLinkedService implementation for AzureDataLakeAnalyticsLinkedService. +func (adlals AzureDataLakeAnalyticsLinkedService) AsResponsysLinkedService() (*ResponsysLinkedService, bool) { + return nil, false +} + +// AsAzureDatabricksLinkedService is the BasicLinkedService implementation for AzureDataLakeAnalyticsLinkedService. +func (adlals AzureDataLakeAnalyticsLinkedService) AsAzureDatabricksLinkedService() (*AzureDatabricksLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeAnalyticsLinkedService is the BasicLinkedService implementation for AzureDataLakeAnalyticsLinkedService. +func (adlals AzureDataLakeAnalyticsLinkedService) AsAzureDataLakeAnalyticsLinkedService() (*AzureDataLakeAnalyticsLinkedService, bool) { + return &adlals, true +} + +// AsHDInsightOnDemandLinkedService is the BasicLinkedService implementation for AzureDataLakeAnalyticsLinkedService. +func (adlals AzureDataLakeAnalyticsLinkedService) AsHDInsightOnDemandLinkedService() (*HDInsightOnDemandLinkedService, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudLinkedService is the BasicLinkedService implementation for AzureDataLakeAnalyticsLinkedService. +func (adlals AzureDataLakeAnalyticsLinkedService) AsSalesforceMarketingCloudLinkedService() (*SalesforceMarketingCloudLinkedService, bool) { + return nil, false +} + +// AsNetezzaLinkedService is the BasicLinkedService implementation for AzureDataLakeAnalyticsLinkedService. +func (adlals AzureDataLakeAnalyticsLinkedService) AsNetezzaLinkedService() (*NetezzaLinkedService, bool) { + return nil, false +} + +// AsVerticaLinkedService is the BasicLinkedService implementation for AzureDataLakeAnalyticsLinkedService. +func (adlals AzureDataLakeAnalyticsLinkedService) AsVerticaLinkedService() (*VerticaLinkedService, bool) { + return nil, false +} + +// AsZohoLinkedService is the BasicLinkedService implementation for AzureDataLakeAnalyticsLinkedService. +func (adlals AzureDataLakeAnalyticsLinkedService) AsZohoLinkedService() (*ZohoLinkedService, bool) { + return nil, false +} + +// AsXeroLinkedService is the BasicLinkedService implementation for AzureDataLakeAnalyticsLinkedService. +func (adlals AzureDataLakeAnalyticsLinkedService) AsXeroLinkedService() (*XeroLinkedService, bool) { + return nil, false +} + +// AsSquareLinkedService is the BasicLinkedService implementation for AzureDataLakeAnalyticsLinkedService. +func (adlals AzureDataLakeAnalyticsLinkedService) AsSquareLinkedService() (*SquareLinkedService, bool) { + return nil, false +} + +// AsSparkLinkedService is the BasicLinkedService implementation for AzureDataLakeAnalyticsLinkedService. +func (adlals AzureDataLakeAnalyticsLinkedService) AsSparkLinkedService() (*SparkLinkedService, bool) { + return nil, false +} + +// AsShopifyLinkedService is the BasicLinkedService implementation for AzureDataLakeAnalyticsLinkedService. +func (adlals AzureDataLakeAnalyticsLinkedService) AsShopifyLinkedService() (*ShopifyLinkedService, bool) { + return nil, false +} + +// AsServiceNowLinkedService is the BasicLinkedService implementation for AzureDataLakeAnalyticsLinkedService. +func (adlals AzureDataLakeAnalyticsLinkedService) AsServiceNowLinkedService() (*ServiceNowLinkedService, bool) { + return nil, false +} + +// AsQuickBooksLinkedService is the BasicLinkedService implementation for AzureDataLakeAnalyticsLinkedService. +func (adlals AzureDataLakeAnalyticsLinkedService) AsQuickBooksLinkedService() (*QuickBooksLinkedService, bool) { + return nil, false +} + +// AsPrestoLinkedService is the BasicLinkedService implementation for AzureDataLakeAnalyticsLinkedService. +func (adlals AzureDataLakeAnalyticsLinkedService) AsPrestoLinkedService() (*PrestoLinkedService, bool) { + return nil, false +} + +// AsPhoenixLinkedService is the BasicLinkedService implementation for AzureDataLakeAnalyticsLinkedService. +func (adlals AzureDataLakeAnalyticsLinkedService) AsPhoenixLinkedService() (*PhoenixLinkedService, bool) { + return nil, false +} + +// AsPaypalLinkedService is the BasicLinkedService implementation for AzureDataLakeAnalyticsLinkedService. +func (adlals AzureDataLakeAnalyticsLinkedService) AsPaypalLinkedService() (*PaypalLinkedService, bool) { + return nil, false +} + +// AsMarketoLinkedService is the BasicLinkedService implementation for AzureDataLakeAnalyticsLinkedService. +func (adlals AzureDataLakeAnalyticsLinkedService) AsMarketoLinkedService() (*MarketoLinkedService, bool) { + return nil, false +} + +// AsMariaDBLinkedService is the BasicLinkedService implementation for AzureDataLakeAnalyticsLinkedService. +func (adlals AzureDataLakeAnalyticsLinkedService) AsMariaDBLinkedService() (*MariaDBLinkedService, bool) { + return nil, false +} + +// AsMagentoLinkedService is the BasicLinkedService implementation for AzureDataLakeAnalyticsLinkedService. +func (adlals AzureDataLakeAnalyticsLinkedService) AsMagentoLinkedService() (*MagentoLinkedService, bool) { + return nil, false +} + +// AsJiraLinkedService is the BasicLinkedService implementation for AzureDataLakeAnalyticsLinkedService. +func (adlals AzureDataLakeAnalyticsLinkedService) AsJiraLinkedService() (*JiraLinkedService, bool) { + return nil, false +} + +// AsImpalaLinkedService is the BasicLinkedService implementation for AzureDataLakeAnalyticsLinkedService. +func (adlals AzureDataLakeAnalyticsLinkedService) AsImpalaLinkedService() (*ImpalaLinkedService, bool) { + return nil, false +} + +// AsHubspotLinkedService is the BasicLinkedService implementation for AzureDataLakeAnalyticsLinkedService. +func (adlals AzureDataLakeAnalyticsLinkedService) AsHubspotLinkedService() (*HubspotLinkedService, bool) { + return nil, false +} + +// AsHiveLinkedService is the BasicLinkedService implementation for AzureDataLakeAnalyticsLinkedService. +func (adlals AzureDataLakeAnalyticsLinkedService) AsHiveLinkedService() (*HiveLinkedService, bool) { + return nil, false +} + +// AsHBaseLinkedService is the BasicLinkedService implementation for AzureDataLakeAnalyticsLinkedService. +func (adlals AzureDataLakeAnalyticsLinkedService) AsHBaseLinkedService() (*HBaseLinkedService, bool) { + return nil, false +} + +// AsGreenplumLinkedService is the BasicLinkedService implementation for AzureDataLakeAnalyticsLinkedService. +func (adlals AzureDataLakeAnalyticsLinkedService) AsGreenplumLinkedService() (*GreenplumLinkedService, bool) { + return nil, false +} + +// AsGoogleBigQueryLinkedService is the BasicLinkedService implementation for AzureDataLakeAnalyticsLinkedService. +func (adlals AzureDataLakeAnalyticsLinkedService) AsGoogleBigQueryLinkedService() (*GoogleBigQueryLinkedService, bool) { + return nil, false +} + +// AsEloquaLinkedService is the BasicLinkedService implementation for AzureDataLakeAnalyticsLinkedService. +func (adlals AzureDataLakeAnalyticsLinkedService) AsEloquaLinkedService() (*EloquaLinkedService, bool) { + return nil, false +} + +// AsDrillLinkedService is the BasicLinkedService implementation for AzureDataLakeAnalyticsLinkedService. +func (adlals AzureDataLakeAnalyticsLinkedService) AsDrillLinkedService() (*DrillLinkedService, bool) { + return nil, false +} + +// AsCouchbaseLinkedService is the BasicLinkedService implementation for AzureDataLakeAnalyticsLinkedService. +func (adlals AzureDataLakeAnalyticsLinkedService) AsCouchbaseLinkedService() (*CouchbaseLinkedService, bool) { + return nil, false +} + +// AsConcurLinkedService is the BasicLinkedService implementation for AzureDataLakeAnalyticsLinkedService. +func (adlals AzureDataLakeAnalyticsLinkedService) AsConcurLinkedService() (*ConcurLinkedService, bool) { + return nil, false +} + +// AsAzurePostgreSQLLinkedService is the BasicLinkedService implementation for AzureDataLakeAnalyticsLinkedService. +func (adlals AzureDataLakeAnalyticsLinkedService) AsAzurePostgreSQLLinkedService() (*AzurePostgreSQLLinkedService, bool) { + return nil, false +} + +// AsAmazonMWSLinkedService is the BasicLinkedService implementation for AzureDataLakeAnalyticsLinkedService. +func (adlals AzureDataLakeAnalyticsLinkedService) AsAmazonMWSLinkedService() (*AmazonMWSLinkedService, bool) { + return nil, false +} + +// AsSapHanaLinkedService is the BasicLinkedService implementation for AzureDataLakeAnalyticsLinkedService. +func (adlals AzureDataLakeAnalyticsLinkedService) AsSapHanaLinkedService() (*SapHanaLinkedService, bool) { + return nil, false +} + +// AsSapBWLinkedService is the BasicLinkedService implementation for AzureDataLakeAnalyticsLinkedService. +func (adlals AzureDataLakeAnalyticsLinkedService) AsSapBWLinkedService() (*SapBWLinkedService, bool) { + return nil, false +} + +// AsSftpServerLinkedService is the BasicLinkedService implementation for AzureDataLakeAnalyticsLinkedService. +func (adlals AzureDataLakeAnalyticsLinkedService) AsSftpServerLinkedService() (*SftpServerLinkedService, bool) { + return nil, false +} + +// AsFtpServerLinkedService is the BasicLinkedService implementation for AzureDataLakeAnalyticsLinkedService. +func (adlals AzureDataLakeAnalyticsLinkedService) AsFtpServerLinkedService() (*FtpServerLinkedService, bool) { + return nil, false +} + +// AsHTTPLinkedService is the BasicLinkedService implementation for AzureDataLakeAnalyticsLinkedService. +func (adlals AzureDataLakeAnalyticsLinkedService) AsHTTPLinkedService() (*HTTPLinkedService, bool) { + return nil, false +} + +// AsAzureSearchLinkedService is the BasicLinkedService implementation for AzureDataLakeAnalyticsLinkedService. +func (adlals AzureDataLakeAnalyticsLinkedService) AsAzureSearchLinkedService() (*AzureSearchLinkedService, bool) { + return nil, false +} + +// AsCustomDataSourceLinkedService is the BasicLinkedService implementation for AzureDataLakeAnalyticsLinkedService. +func (adlals AzureDataLakeAnalyticsLinkedService) AsCustomDataSourceLinkedService() (*CustomDataSourceLinkedService, bool) { + return nil, false +} + +// AsAmazonRedshiftLinkedService is the BasicLinkedService implementation for AzureDataLakeAnalyticsLinkedService. +func (adlals AzureDataLakeAnalyticsLinkedService) AsAmazonRedshiftLinkedService() (*AmazonRedshiftLinkedService, bool) { + return nil, false +} + +// AsAmazonS3LinkedService is the BasicLinkedService implementation for AzureDataLakeAnalyticsLinkedService. +func (adlals AzureDataLakeAnalyticsLinkedService) AsAmazonS3LinkedService() (*AmazonS3LinkedService, bool) { + return nil, false +} + +// AsSapEccLinkedService is the BasicLinkedService implementation for AzureDataLakeAnalyticsLinkedService. +func (adlals AzureDataLakeAnalyticsLinkedService) AsSapEccLinkedService() (*SapEccLinkedService, bool) { + return nil, false +} + +// AsSapCloudForCustomerLinkedService is the BasicLinkedService implementation for AzureDataLakeAnalyticsLinkedService. +func (adlals AzureDataLakeAnalyticsLinkedService) AsSapCloudForCustomerLinkedService() (*SapCloudForCustomerLinkedService, bool) { + return nil, false +} + +// AsSalesforceLinkedService is the BasicLinkedService implementation for AzureDataLakeAnalyticsLinkedService. +func (adlals AzureDataLakeAnalyticsLinkedService) AsSalesforceLinkedService() (*SalesforceLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeStoreLinkedService is the BasicLinkedService implementation for AzureDataLakeAnalyticsLinkedService. +func (adlals AzureDataLakeAnalyticsLinkedService) AsAzureDataLakeStoreLinkedService() (*AzureDataLakeStoreLinkedService, bool) { + return nil, false +} + +// AsMongoDbLinkedService is the BasicLinkedService implementation for AzureDataLakeAnalyticsLinkedService. +func (adlals AzureDataLakeAnalyticsLinkedService) AsMongoDbLinkedService() (*MongoDbLinkedService, bool) { + return nil, false +} + +// AsCassandraLinkedService is the BasicLinkedService implementation for AzureDataLakeAnalyticsLinkedService. +func (adlals AzureDataLakeAnalyticsLinkedService) AsCassandraLinkedService() (*CassandraLinkedService, bool) { + return nil, false +} + +// AsWebLinkedService is the BasicLinkedService implementation for AzureDataLakeAnalyticsLinkedService. +func (adlals AzureDataLakeAnalyticsLinkedService) AsWebLinkedService() (*WebLinkedService, bool) { + return nil, false +} + +// AsODataLinkedService is the BasicLinkedService implementation for AzureDataLakeAnalyticsLinkedService. +func (adlals AzureDataLakeAnalyticsLinkedService) AsODataLinkedService() (*ODataLinkedService, bool) { + return nil, false +} + +// AsHdfsLinkedService is the BasicLinkedService implementation for AzureDataLakeAnalyticsLinkedService. +func (adlals AzureDataLakeAnalyticsLinkedService) AsHdfsLinkedService() (*HdfsLinkedService, bool) { + return nil, false +} + +// AsOdbcLinkedService is the BasicLinkedService implementation for AzureDataLakeAnalyticsLinkedService. +func (adlals AzureDataLakeAnalyticsLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, bool) { + return nil, false +} + +// AsAzureMLLinkedService is the BasicLinkedService implementation for AzureDataLakeAnalyticsLinkedService. +func (adlals AzureDataLakeAnalyticsLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { + return nil, false +} + +// AsTeradataLinkedService is the BasicLinkedService implementation for AzureDataLakeAnalyticsLinkedService. +func (adlals AzureDataLakeAnalyticsLinkedService) AsTeradataLinkedService() (*TeradataLinkedService, bool) { + return nil, false +} + +// AsDb2LinkedService is the BasicLinkedService implementation for AzureDataLakeAnalyticsLinkedService. +func (adlals AzureDataLakeAnalyticsLinkedService) AsDb2LinkedService() (*Db2LinkedService, bool) { + return nil, false +} + +// AsSybaseLinkedService is the BasicLinkedService implementation for AzureDataLakeAnalyticsLinkedService. +func (adlals AzureDataLakeAnalyticsLinkedService) AsSybaseLinkedService() (*SybaseLinkedService, bool) { + return nil, false +} + +// AsPostgreSQLLinkedService is the BasicLinkedService implementation for AzureDataLakeAnalyticsLinkedService. +func (adlals AzureDataLakeAnalyticsLinkedService) AsPostgreSQLLinkedService() (*PostgreSQLLinkedService, bool) { + return nil, false +} + +// AsMySQLLinkedService is the BasicLinkedService implementation for AzureDataLakeAnalyticsLinkedService. +func (adlals AzureDataLakeAnalyticsLinkedService) AsMySQLLinkedService() (*MySQLLinkedService, bool) { + return nil, false +} + +// AsAzureMySQLLinkedService is the BasicLinkedService implementation for AzureDataLakeAnalyticsLinkedService. +func (adlals AzureDataLakeAnalyticsLinkedService) AsAzureMySQLLinkedService() (*AzureMySQLLinkedService, bool) { + return nil, false +} + +// AsOracleLinkedService is the BasicLinkedService implementation for AzureDataLakeAnalyticsLinkedService. +func (adlals AzureDataLakeAnalyticsLinkedService) AsOracleLinkedService() (*OracleLinkedService, bool) { + return nil, false +} + +// AsFileServerLinkedService is the BasicLinkedService implementation for AzureDataLakeAnalyticsLinkedService. +func (adlals AzureDataLakeAnalyticsLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { + return nil, false +} + +// AsHDInsightLinkedService is the BasicLinkedService implementation for AzureDataLakeAnalyticsLinkedService. +func (adlals AzureDataLakeAnalyticsLinkedService) AsHDInsightLinkedService() (*HDInsightLinkedService, bool) { + return nil, false +} + +// AsDynamicsLinkedService is the BasicLinkedService implementation for AzureDataLakeAnalyticsLinkedService. +func (adlals AzureDataLakeAnalyticsLinkedService) AsDynamicsLinkedService() (*DynamicsLinkedService, bool) { + return nil, false +} + +// AsCosmosDbLinkedService is the BasicLinkedService implementation for AzureDataLakeAnalyticsLinkedService. +func (adlals AzureDataLakeAnalyticsLinkedService) AsCosmosDbLinkedService() (*CosmosDbLinkedService, bool) { + return nil, false +} + +// AsAzureKeyVaultLinkedService is the BasicLinkedService implementation for AzureDataLakeAnalyticsLinkedService. +func (adlals AzureDataLakeAnalyticsLinkedService) AsAzureKeyVaultLinkedService() (*AzureKeyVaultLinkedService, bool) { + return nil, false +} + +// AsAzureBatchLinkedService is the BasicLinkedService implementation for AzureDataLakeAnalyticsLinkedService. +func (adlals AzureDataLakeAnalyticsLinkedService) AsAzureBatchLinkedService() (*AzureBatchLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDatabaseLinkedService is the BasicLinkedService implementation for AzureDataLakeAnalyticsLinkedService. +func (adlals AzureDataLakeAnalyticsLinkedService) AsAzureSQLDatabaseLinkedService() (*AzureSQLDatabaseLinkedService, bool) { + return nil, false +} + +// AsSQLServerLinkedService is the BasicLinkedService implementation for AzureDataLakeAnalyticsLinkedService. +func (adlals AzureDataLakeAnalyticsLinkedService) AsSQLServerLinkedService() (*SQLServerLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDWLinkedService is the BasicLinkedService implementation for AzureDataLakeAnalyticsLinkedService. +func (adlals AzureDataLakeAnalyticsLinkedService) AsAzureSQLDWLinkedService() (*AzureSQLDWLinkedService, bool) { + return nil, false +} + +// AsAzureStorageLinkedService is the BasicLinkedService implementation for AzureDataLakeAnalyticsLinkedService. +func (adlals AzureDataLakeAnalyticsLinkedService) AsAzureStorageLinkedService() (*AzureStorageLinkedService, bool) { + return nil, false +} + +// AsLinkedService is the BasicLinkedService implementation for AzureDataLakeAnalyticsLinkedService. +func (adlals AzureDataLakeAnalyticsLinkedService) AsLinkedService() (*LinkedService, bool) { + return nil, false +} + +// AsBasicLinkedService is the BasicLinkedService implementation for AzureDataLakeAnalyticsLinkedService. +func (adlals AzureDataLakeAnalyticsLinkedService) AsBasicLinkedService() (BasicLinkedService, bool) { + return &adlals, true +} + +// UnmarshalJSON is the custom unmarshaler for AzureDataLakeAnalyticsLinkedService struct. +func (adlals *AzureDataLakeAnalyticsLinkedService) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "typeProperties": + if v != nil { + var azureDataLakeAnalyticsLinkedServiceTypeProperties AzureDataLakeAnalyticsLinkedServiceTypeProperties + err = json.Unmarshal(*v, &azureDataLakeAnalyticsLinkedServiceTypeProperties) + if err != nil { + return err + } + adlals.AzureDataLakeAnalyticsLinkedServiceTypeProperties = &azureDataLakeAnalyticsLinkedServiceTypeProperties + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if adlals.AdditionalProperties == nil { + adlals.AdditionalProperties = make(map[string]interface{}) + } + adlals.AdditionalProperties[k] = additionalProperties + } + case "connectVia": + if v != nil { + var connectVia IntegrationRuntimeReference + err = json.Unmarshal(*v, &connectVia) + if err != nil { + return err + } + adlals.ConnectVia = &connectVia + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + adlals.Description = &description + } + case "parameters": + if v != nil { + var parameters map[string]*ParameterSpecification + err = json.Unmarshal(*v, ¶meters) + if err != nil { + return err + } + adlals.Parameters = parameters + } + case "annotations": + if v != nil { + var annotations []interface{} + err = json.Unmarshal(*v, &annotations) + if err != nil { + return err + } + adlals.Annotations = &annotations + } + case "type": + if v != nil { + var typeVar TypeBasicLinkedService + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + adlals.Type = typeVar + } + } + } + + return nil +} + +// AzureDataLakeAnalyticsLinkedServiceTypeProperties azure Data Lake Analytics linked service properties. +type AzureDataLakeAnalyticsLinkedServiceTypeProperties struct { + // AccountName - The Azure Data Lake Analytics account name. Type: string (or Expression with resultType string). + AccountName interface{} `json:"accountName,omitempty"` + // ServicePrincipalID - The ID of the application used to authenticate against the Azure Data Lake Analytics account. Type: string (or Expression with resultType string). + ServicePrincipalID interface{} `json:"servicePrincipalId,omitempty"` + // ServicePrincipalKey - The Key of the application used to authenticate against the Azure Data Lake Analytics account. + ServicePrincipalKey BasicSecretBase `json:"servicePrincipalKey,omitempty"` + // Tenant - The name or ID of the tenant to which the service principal belongs. Type: string (or Expression with resultType string). + Tenant interface{} `json:"tenant,omitempty"` + // SubscriptionID - Data Lake Analytics account subscription ID (if different from Data Factory account). Type: string (or Expression with resultType string). + SubscriptionID interface{} `json:"subscriptionId,omitempty"` + // ResourceGroupName - Data Lake Analytics account resource group name (if different from Data Factory account). Type: string (or Expression with resultType string). + ResourceGroupName interface{} `json:"resourceGroupName,omitempty"` + // DataLakeAnalyticsURI - Azure Data Lake Analytics URI Type: string (or Expression with resultType string). + DataLakeAnalyticsURI interface{} `json:"dataLakeAnalyticsUri,omitempty"` + // EncryptedCredential - The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string). + EncryptedCredential interface{} `json:"encryptedCredential,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for AzureDataLakeAnalyticsLinkedServiceTypeProperties struct. +func (adlalstp *AzureDataLakeAnalyticsLinkedServiceTypeProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "accountName": + if v != nil { + var accountName interface{} + err = json.Unmarshal(*v, &accountName) + if err != nil { + return err + } + adlalstp.AccountName = accountName + } + case "servicePrincipalId": + if v != nil { + var servicePrincipalID interface{} + err = json.Unmarshal(*v, &servicePrincipalID) + if err != nil { + return err + } + adlalstp.ServicePrincipalID = servicePrincipalID + } + case "servicePrincipalKey": + if v != nil { + servicePrincipalKey, err := unmarshalBasicSecretBase(*v) + if err != nil { + return err + } + adlalstp.ServicePrincipalKey = servicePrincipalKey + } + case "tenant": + if v != nil { + var tenant interface{} + err = json.Unmarshal(*v, &tenant) + if err != nil { + return err + } + adlalstp.Tenant = tenant + } + case "subscriptionId": + if v != nil { + var subscriptionID interface{} + err = json.Unmarshal(*v, &subscriptionID) + if err != nil { + return err + } + adlalstp.SubscriptionID = subscriptionID + } + case "resourceGroupName": + if v != nil { + var resourceGroupName interface{} + err = json.Unmarshal(*v, &resourceGroupName) + if err != nil { + return err + } + adlalstp.ResourceGroupName = resourceGroupName + } + case "dataLakeAnalyticsUri": + if v != nil { + var dataLakeAnalyticsURI interface{} + err = json.Unmarshal(*v, &dataLakeAnalyticsURI) + if err != nil { + return err + } + adlalstp.DataLakeAnalyticsURI = dataLakeAnalyticsURI + } + case "encryptedCredential": + if v != nil { + var encryptedCredential interface{} + err = json.Unmarshal(*v, &encryptedCredential) + if err != nil { + return err + } + adlalstp.EncryptedCredential = encryptedCredential + } + } + } + + return nil +} + +// AzureDataLakeStoreDataset azure Data Lake Store dataset. +type AzureDataLakeStoreDataset struct { + // AzureDataLakeStoreDatasetTypeProperties - Azure Data Lake Store dataset properties. + *AzureDataLakeStoreDatasetTypeProperties `json:"typeProperties,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Description - Dataset description. + Description *string `json:"description,omitempty"` + // Structure - Columns that define the structure of the dataset. Type: array (or Expression with resultType array), itemType: DatasetDataElement. + Structure interface{} `json:"structure,omitempty"` + // LinkedServiceName - Linked service reference. + LinkedServiceName *LinkedServiceReference `json:"linkedServiceName,omitempty"` + // Parameters - Parameters for dataset. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeDataset', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSQLServerTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSalesforceObject', 'TypeRelationalTable', 'TypeAzureMySQLTable', 'TypeOracleTable', 'TypeODataResource', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeAzureDataLakeStoreFile', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeAmazonS3Object' + Type TypeBasicDataset `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureDataLakeStoreDataset. +func (adlsd AzureDataLakeStoreDataset) MarshalJSON() ([]byte, error) { + adlsd.Type = TypeAzureDataLakeStoreFile + objectMap := make(map[string]interface{}) + if adlsd.AzureDataLakeStoreDatasetTypeProperties != nil { + objectMap["typeProperties"] = adlsd.AzureDataLakeStoreDatasetTypeProperties + } + if adlsd.Description != nil { + objectMap["description"] = adlsd.Description + } + objectMap["structure"] = adlsd.Structure + if adlsd.LinkedServiceName != nil { + objectMap["linkedServiceName"] = adlsd.LinkedServiceName + } + if adlsd.Parameters != nil { + objectMap["parameters"] = adlsd.Parameters + } + if adlsd.Annotations != nil { + objectMap["annotations"] = adlsd.Annotations + } + if adlsd.Type != "" { + objectMap["type"] = adlsd.Type + } + for k, v := range adlsd.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysObjectDataset is the BasicDataset implementation for AzureDataLakeStoreDataset. +func (adlsd AzureDataLakeStoreDataset) AsResponsysObjectDataset() (*ResponsysObjectDataset, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudObjectDataset is the BasicDataset implementation for AzureDataLakeStoreDataset. +func (adlsd AzureDataLakeStoreDataset) AsSalesforceMarketingCloudObjectDataset() (*SalesforceMarketingCloudObjectDataset, bool) { + return nil, false +} + +// AsVerticaTableDataset is the BasicDataset implementation for AzureDataLakeStoreDataset. +func (adlsd AzureDataLakeStoreDataset) AsVerticaTableDataset() (*VerticaTableDataset, bool) { + return nil, false +} + +// AsNetezzaTableDataset is the BasicDataset implementation for AzureDataLakeStoreDataset. +func (adlsd AzureDataLakeStoreDataset) AsNetezzaTableDataset() (*NetezzaTableDataset, bool) { + return nil, false +} + +// AsZohoObjectDataset is the BasicDataset implementation for AzureDataLakeStoreDataset. +func (adlsd AzureDataLakeStoreDataset) AsZohoObjectDataset() (*ZohoObjectDataset, bool) { + return nil, false +} + +// AsXeroObjectDataset is the BasicDataset implementation for AzureDataLakeStoreDataset. +func (adlsd AzureDataLakeStoreDataset) AsXeroObjectDataset() (*XeroObjectDataset, bool) { + return nil, false +} + +// AsSquareObjectDataset is the BasicDataset implementation for AzureDataLakeStoreDataset. +func (adlsd AzureDataLakeStoreDataset) AsSquareObjectDataset() (*SquareObjectDataset, bool) { + return nil, false +} + +// AsSparkObjectDataset is the BasicDataset implementation for AzureDataLakeStoreDataset. +func (adlsd AzureDataLakeStoreDataset) AsSparkObjectDataset() (*SparkObjectDataset, bool) { + return nil, false +} + +// AsShopifyObjectDataset is the BasicDataset implementation for AzureDataLakeStoreDataset. +func (adlsd AzureDataLakeStoreDataset) AsShopifyObjectDataset() (*ShopifyObjectDataset, bool) { + return nil, false +} + +// AsServiceNowObjectDataset is the BasicDataset implementation for AzureDataLakeStoreDataset. +func (adlsd AzureDataLakeStoreDataset) AsServiceNowObjectDataset() (*ServiceNowObjectDataset, bool) { + return nil, false +} + +// AsQuickBooksObjectDataset is the BasicDataset implementation for AzureDataLakeStoreDataset. +func (adlsd AzureDataLakeStoreDataset) AsQuickBooksObjectDataset() (*QuickBooksObjectDataset, bool) { + return nil, false +} + +// AsPrestoObjectDataset is the BasicDataset implementation for AzureDataLakeStoreDataset. +func (adlsd AzureDataLakeStoreDataset) AsPrestoObjectDataset() (*PrestoObjectDataset, bool) { + return nil, false +} + +// AsPhoenixObjectDataset is the BasicDataset implementation for AzureDataLakeStoreDataset. +func (adlsd AzureDataLakeStoreDataset) AsPhoenixObjectDataset() (*PhoenixObjectDataset, bool) { + return nil, false +} + +// AsPaypalObjectDataset is the BasicDataset implementation for AzureDataLakeStoreDataset. +func (adlsd AzureDataLakeStoreDataset) AsPaypalObjectDataset() (*PaypalObjectDataset, bool) { + return nil, false +} + +// AsMarketoObjectDataset is the BasicDataset implementation for AzureDataLakeStoreDataset. +func (adlsd AzureDataLakeStoreDataset) AsMarketoObjectDataset() (*MarketoObjectDataset, bool) { + return nil, false +} + +// AsMariaDBTableDataset is the BasicDataset implementation for AzureDataLakeStoreDataset. +func (adlsd AzureDataLakeStoreDataset) AsMariaDBTableDataset() (*MariaDBTableDataset, bool) { + return nil, false +} + +// AsMagentoObjectDataset is the BasicDataset implementation for AzureDataLakeStoreDataset. +func (adlsd AzureDataLakeStoreDataset) AsMagentoObjectDataset() (*MagentoObjectDataset, bool) { + return nil, false +} + +// AsJiraObjectDataset is the BasicDataset implementation for AzureDataLakeStoreDataset. +func (adlsd AzureDataLakeStoreDataset) AsJiraObjectDataset() (*JiraObjectDataset, bool) { + return nil, false +} + +// AsImpalaObjectDataset is the BasicDataset implementation for AzureDataLakeStoreDataset. +func (adlsd AzureDataLakeStoreDataset) AsImpalaObjectDataset() (*ImpalaObjectDataset, bool) { + return nil, false +} + +// AsHubspotObjectDataset is the BasicDataset implementation for AzureDataLakeStoreDataset. +func (adlsd AzureDataLakeStoreDataset) AsHubspotObjectDataset() (*HubspotObjectDataset, bool) { + return nil, false +} + +// AsHiveObjectDataset is the BasicDataset implementation for AzureDataLakeStoreDataset. +func (adlsd AzureDataLakeStoreDataset) AsHiveObjectDataset() (*HiveObjectDataset, bool) { + return nil, false +} + +// AsHBaseObjectDataset is the BasicDataset implementation for AzureDataLakeStoreDataset. +func (adlsd AzureDataLakeStoreDataset) AsHBaseObjectDataset() (*HBaseObjectDataset, bool) { + return nil, false +} + +// AsGreenplumTableDataset is the BasicDataset implementation for AzureDataLakeStoreDataset. +func (adlsd AzureDataLakeStoreDataset) AsGreenplumTableDataset() (*GreenplumTableDataset, bool) { + return nil, false +} + +// AsGoogleBigQueryObjectDataset is the BasicDataset implementation for AzureDataLakeStoreDataset. +func (adlsd AzureDataLakeStoreDataset) AsGoogleBigQueryObjectDataset() (*GoogleBigQueryObjectDataset, bool) { + return nil, false +} + +// AsEloquaObjectDataset is the BasicDataset implementation for AzureDataLakeStoreDataset. +func (adlsd AzureDataLakeStoreDataset) AsEloquaObjectDataset() (*EloquaObjectDataset, bool) { + return nil, false +} + +// AsDrillTableDataset is the BasicDataset implementation for AzureDataLakeStoreDataset. +func (adlsd AzureDataLakeStoreDataset) AsDrillTableDataset() (*DrillTableDataset, bool) { + return nil, false +} + +// AsCouchbaseTableDataset is the BasicDataset implementation for AzureDataLakeStoreDataset. +func (adlsd AzureDataLakeStoreDataset) AsCouchbaseTableDataset() (*CouchbaseTableDataset, bool) { + return nil, false +} + +// AsConcurObjectDataset is the BasicDataset implementation for AzureDataLakeStoreDataset. +func (adlsd AzureDataLakeStoreDataset) AsConcurObjectDataset() (*ConcurObjectDataset, bool) { + return nil, false +} + +// AsAzurePostgreSQLTableDataset is the BasicDataset implementation for AzureDataLakeStoreDataset. +func (adlsd AzureDataLakeStoreDataset) AsAzurePostgreSQLTableDataset() (*AzurePostgreSQLTableDataset, bool) { + return nil, false +} + +// AsAmazonMWSObjectDataset is the BasicDataset implementation for AzureDataLakeStoreDataset. +func (adlsd AzureDataLakeStoreDataset) AsAmazonMWSObjectDataset() (*AmazonMWSObjectDataset, bool) { + return nil, false +} + +// AsHTTPDataset is the BasicDataset implementation for AzureDataLakeStoreDataset. +func (adlsd AzureDataLakeStoreDataset) AsHTTPDataset() (*HTTPDataset, bool) { + return nil, false +} + +// AsAzureSearchIndexDataset is the BasicDataset implementation for AzureDataLakeStoreDataset. +func (adlsd AzureDataLakeStoreDataset) AsAzureSearchIndexDataset() (*AzureSearchIndexDataset, bool) { + return nil, false +} + +// AsWebTableDataset is the BasicDataset implementation for AzureDataLakeStoreDataset. +func (adlsd AzureDataLakeStoreDataset) AsWebTableDataset() (*WebTableDataset, bool) { + return nil, false +} + +// AsSQLServerTableDataset is the BasicDataset implementation for AzureDataLakeStoreDataset. +func (adlsd AzureDataLakeStoreDataset) AsSQLServerTableDataset() (*SQLServerTableDataset, bool) { + return nil, false +} + +// AsSapEccResourceDataset is the BasicDataset implementation for AzureDataLakeStoreDataset. +func (adlsd AzureDataLakeStoreDataset) AsSapEccResourceDataset() (*SapEccResourceDataset, bool) { + return nil, false +} + +// AsSapCloudForCustomerResourceDataset is the BasicDataset implementation for AzureDataLakeStoreDataset. +func (adlsd AzureDataLakeStoreDataset) AsSapCloudForCustomerResourceDataset() (*SapCloudForCustomerResourceDataset, bool) { + return nil, false +} + +// AsSalesforceObjectDataset is the BasicDataset implementation for AzureDataLakeStoreDataset. +func (adlsd AzureDataLakeStoreDataset) AsSalesforceObjectDataset() (*SalesforceObjectDataset, bool) { + return nil, false +} + +// AsRelationalTableDataset is the BasicDataset implementation for AzureDataLakeStoreDataset. +func (adlsd AzureDataLakeStoreDataset) AsRelationalTableDataset() (*RelationalTableDataset, bool) { + return nil, false +} + +// AsAzureMySQLTableDataset is the BasicDataset implementation for AzureDataLakeStoreDataset. +func (adlsd AzureDataLakeStoreDataset) AsAzureMySQLTableDataset() (*AzureMySQLTableDataset, bool) { + return nil, false +} + +// AsOracleTableDataset is the BasicDataset implementation for AzureDataLakeStoreDataset. +func (adlsd AzureDataLakeStoreDataset) AsOracleTableDataset() (*OracleTableDataset, bool) { + return nil, false +} + +// AsODataResourceDataset is the BasicDataset implementation for AzureDataLakeStoreDataset. +func (adlsd AzureDataLakeStoreDataset) AsODataResourceDataset() (*ODataResourceDataset, bool) { + return nil, false +} + +// AsMongoDbCollectionDataset is the BasicDataset implementation for AzureDataLakeStoreDataset. +func (adlsd AzureDataLakeStoreDataset) AsMongoDbCollectionDataset() (*MongoDbCollectionDataset, bool) { + return nil, false +} + +// AsFileShareDataset is the BasicDataset implementation for AzureDataLakeStoreDataset. +func (adlsd AzureDataLakeStoreDataset) AsFileShareDataset() (*FileShareDataset, bool) { + return nil, false +} + +// AsAzureDataLakeStoreDataset is the BasicDataset implementation for AzureDataLakeStoreDataset. +func (adlsd AzureDataLakeStoreDataset) AsAzureDataLakeStoreDataset() (*AzureDataLakeStoreDataset, bool) { + return &adlsd, true +} + +// AsDynamicsEntityDataset is the BasicDataset implementation for AzureDataLakeStoreDataset. +func (adlsd AzureDataLakeStoreDataset) AsDynamicsEntityDataset() (*DynamicsEntityDataset, bool) { + return nil, false +} + +// AsDocumentDbCollectionDataset is the BasicDataset implementation for AzureDataLakeStoreDataset. +func (adlsd AzureDataLakeStoreDataset) AsDocumentDbCollectionDataset() (*DocumentDbCollectionDataset, bool) { + return nil, false +} + +// AsCustomDataset is the BasicDataset implementation for AzureDataLakeStoreDataset. +func (adlsd AzureDataLakeStoreDataset) AsCustomDataset() (*CustomDataset, bool) { + return nil, false +} + +// AsCassandraTableDataset is the BasicDataset implementation for AzureDataLakeStoreDataset. +func (adlsd AzureDataLakeStoreDataset) AsCassandraTableDataset() (*CassandraTableDataset, bool) { + return nil, false +} + +// AsAzureSQLDWTableDataset is the BasicDataset implementation for AzureDataLakeStoreDataset. +func (adlsd AzureDataLakeStoreDataset) AsAzureSQLDWTableDataset() (*AzureSQLDWTableDataset, bool) { + return nil, false +} + +// AsAzureSQLTableDataset is the BasicDataset implementation for AzureDataLakeStoreDataset. +func (adlsd AzureDataLakeStoreDataset) AsAzureSQLTableDataset() (*AzureSQLTableDataset, bool) { + return nil, false +} + +// AsAzureTableDataset is the BasicDataset implementation for AzureDataLakeStoreDataset. +func (adlsd AzureDataLakeStoreDataset) AsAzureTableDataset() (*AzureTableDataset, bool) { + return nil, false +} + +// AsAzureBlobDataset is the BasicDataset implementation for AzureDataLakeStoreDataset. +func (adlsd AzureDataLakeStoreDataset) AsAzureBlobDataset() (*AzureBlobDataset, bool) { + return nil, false +} + +// AsAmazonS3Dataset is the BasicDataset implementation for AzureDataLakeStoreDataset. +func (adlsd AzureDataLakeStoreDataset) AsAmazonS3Dataset() (*AmazonS3Dataset, bool) { + return nil, false +} + +// AsDataset is the BasicDataset implementation for AzureDataLakeStoreDataset. +func (adlsd AzureDataLakeStoreDataset) AsDataset() (*Dataset, bool) { + return nil, false +} + +// AsBasicDataset is the BasicDataset implementation for AzureDataLakeStoreDataset. +func (adlsd AzureDataLakeStoreDataset) AsBasicDataset() (BasicDataset, bool) { + return &adlsd, true +} + +// UnmarshalJSON is the custom unmarshaler for AzureDataLakeStoreDataset struct. +func (adlsd *AzureDataLakeStoreDataset) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "typeProperties": + if v != nil { + var azureDataLakeStoreDatasetTypeProperties AzureDataLakeStoreDatasetTypeProperties + err = json.Unmarshal(*v, &azureDataLakeStoreDatasetTypeProperties) + if err != nil { + return err + } + adlsd.AzureDataLakeStoreDatasetTypeProperties = &azureDataLakeStoreDatasetTypeProperties + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if adlsd.AdditionalProperties == nil { + adlsd.AdditionalProperties = make(map[string]interface{}) + } + adlsd.AdditionalProperties[k] = additionalProperties + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + adlsd.Description = &description + } + case "structure": + if v != nil { + var structure interface{} + err = json.Unmarshal(*v, &structure) + if err != nil { + return err + } + adlsd.Structure = structure + } + case "linkedServiceName": + if v != nil { + var linkedServiceName LinkedServiceReference + err = json.Unmarshal(*v, &linkedServiceName) + if err != nil { + return err + } + adlsd.LinkedServiceName = &linkedServiceName + } + case "parameters": + if v != nil { + var parameters map[string]*ParameterSpecification + err = json.Unmarshal(*v, ¶meters) + if err != nil { + return err + } + adlsd.Parameters = parameters + } + case "annotations": + if v != nil { + var annotations []interface{} + err = json.Unmarshal(*v, &annotations) + if err != nil { + return err + } + adlsd.Annotations = &annotations + } + case "type": + if v != nil { + var typeVar TypeBasicDataset + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + adlsd.Type = typeVar + } + } + } + + return nil +} + +// AzureDataLakeStoreDatasetTypeProperties azure Data Lake Store dataset properties. +type AzureDataLakeStoreDatasetTypeProperties struct { + // FolderPath - Path to the folder in the Azure Data Lake Store. Type: string (or Expression with resultType string). + FolderPath interface{} `json:"folderPath,omitempty"` + // FileName - The name of the file in the Azure Data Lake Store. Type: string (or Expression with resultType string). + FileName interface{} `json:"fileName,omitempty"` + // Format - The format of the Data Lake Store. + Format BasicDatasetStorageFormat `json:"format,omitempty"` + // Compression - The data compression method used for the item(s) in the Azure Data Lake Store. + Compression BasicDatasetCompression `json:"compression,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for AzureDataLakeStoreDatasetTypeProperties struct. +func (adlsdtp *AzureDataLakeStoreDatasetTypeProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "folderPath": + if v != nil { + var folderPath interface{} + err = json.Unmarshal(*v, &folderPath) + if err != nil { + return err + } + adlsdtp.FolderPath = folderPath + } + case "fileName": + if v != nil { + var fileName interface{} + err = json.Unmarshal(*v, &fileName) + if err != nil { + return err + } + adlsdtp.FileName = fileName + } + case "format": + if v != nil { + formatVar, err := unmarshalBasicDatasetStorageFormat(*v) + if err != nil { + return err + } + adlsdtp.Format = formatVar + } + case "compression": + if v != nil { + compression, err := unmarshalBasicDatasetCompression(*v) + if err != nil { + return err + } + adlsdtp.Compression = compression + } + } + } + + return nil +} + +// AzureDataLakeStoreLinkedService azure Data Lake Store linked service. +type AzureDataLakeStoreLinkedService struct { + // AzureDataLakeStoreLinkedServiceTypeProperties - Azure Data Lake Store linked service properties. + *AzureDataLakeStoreLinkedServiceTypeProperties `json:"typeProperties,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // ConnectVia - The integration runtime reference. + ConnectVia *IntegrationRuntimeReference `json:"connectVia,omitempty"` + // Description - Linked service description. + Description *string `json:"description,omitempty"` + // Parameters - Parameters for linked service. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeLinkedService', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforce', 'TypeAzureDataLakeStore', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureStorage' + Type TypeBasicLinkedService `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureDataLakeStoreLinkedService. +func (adlsls AzureDataLakeStoreLinkedService) MarshalJSON() ([]byte, error) { + adlsls.Type = TypeAzureDataLakeStore + objectMap := make(map[string]interface{}) + if adlsls.AzureDataLakeStoreLinkedServiceTypeProperties != nil { + objectMap["typeProperties"] = adlsls.AzureDataLakeStoreLinkedServiceTypeProperties + } + if adlsls.ConnectVia != nil { + objectMap["connectVia"] = adlsls.ConnectVia + } + if adlsls.Description != nil { + objectMap["description"] = adlsls.Description + } + if adlsls.Parameters != nil { + objectMap["parameters"] = adlsls.Parameters + } + if adlsls.Annotations != nil { + objectMap["annotations"] = adlsls.Annotations + } + if adlsls.Type != "" { + objectMap["type"] = adlsls.Type + } + for k, v := range adlsls.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysLinkedService is the BasicLinkedService implementation for AzureDataLakeStoreLinkedService. +func (adlsls AzureDataLakeStoreLinkedService) AsResponsysLinkedService() (*ResponsysLinkedService, bool) { + return nil, false +} + +// AsAzureDatabricksLinkedService is the BasicLinkedService implementation for AzureDataLakeStoreLinkedService. +func (adlsls AzureDataLakeStoreLinkedService) AsAzureDatabricksLinkedService() (*AzureDatabricksLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeAnalyticsLinkedService is the BasicLinkedService implementation for AzureDataLakeStoreLinkedService. +func (adlsls AzureDataLakeStoreLinkedService) AsAzureDataLakeAnalyticsLinkedService() (*AzureDataLakeAnalyticsLinkedService, bool) { + return nil, false +} + +// AsHDInsightOnDemandLinkedService is the BasicLinkedService implementation for AzureDataLakeStoreLinkedService. +func (adlsls AzureDataLakeStoreLinkedService) AsHDInsightOnDemandLinkedService() (*HDInsightOnDemandLinkedService, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudLinkedService is the BasicLinkedService implementation for AzureDataLakeStoreLinkedService. +func (adlsls AzureDataLakeStoreLinkedService) AsSalesforceMarketingCloudLinkedService() (*SalesforceMarketingCloudLinkedService, bool) { + return nil, false +} + +// AsNetezzaLinkedService is the BasicLinkedService implementation for AzureDataLakeStoreLinkedService. +func (adlsls AzureDataLakeStoreLinkedService) AsNetezzaLinkedService() (*NetezzaLinkedService, bool) { + return nil, false +} + +// AsVerticaLinkedService is the BasicLinkedService implementation for AzureDataLakeStoreLinkedService. +func (adlsls AzureDataLakeStoreLinkedService) AsVerticaLinkedService() (*VerticaLinkedService, bool) { + return nil, false +} + +// AsZohoLinkedService is the BasicLinkedService implementation for AzureDataLakeStoreLinkedService. +func (adlsls AzureDataLakeStoreLinkedService) AsZohoLinkedService() (*ZohoLinkedService, bool) { + return nil, false +} + +// AsXeroLinkedService is the BasicLinkedService implementation for AzureDataLakeStoreLinkedService. +func (adlsls AzureDataLakeStoreLinkedService) AsXeroLinkedService() (*XeroLinkedService, bool) { + return nil, false +} + +// AsSquareLinkedService is the BasicLinkedService implementation for AzureDataLakeStoreLinkedService. +func (adlsls AzureDataLakeStoreLinkedService) AsSquareLinkedService() (*SquareLinkedService, bool) { + return nil, false +} + +// AsSparkLinkedService is the BasicLinkedService implementation for AzureDataLakeStoreLinkedService. +func (adlsls AzureDataLakeStoreLinkedService) AsSparkLinkedService() (*SparkLinkedService, bool) { + return nil, false +} + +// AsShopifyLinkedService is the BasicLinkedService implementation for AzureDataLakeStoreLinkedService. +func (adlsls AzureDataLakeStoreLinkedService) AsShopifyLinkedService() (*ShopifyLinkedService, bool) { + return nil, false +} + +// AsServiceNowLinkedService is the BasicLinkedService implementation for AzureDataLakeStoreLinkedService. +func (adlsls AzureDataLakeStoreLinkedService) AsServiceNowLinkedService() (*ServiceNowLinkedService, bool) { + return nil, false +} + +// AsQuickBooksLinkedService is the BasicLinkedService implementation for AzureDataLakeStoreLinkedService. +func (adlsls AzureDataLakeStoreLinkedService) AsQuickBooksLinkedService() (*QuickBooksLinkedService, bool) { + return nil, false +} + +// AsPrestoLinkedService is the BasicLinkedService implementation for AzureDataLakeStoreLinkedService. +func (adlsls AzureDataLakeStoreLinkedService) AsPrestoLinkedService() (*PrestoLinkedService, bool) { + return nil, false +} + +// AsPhoenixLinkedService is the BasicLinkedService implementation for AzureDataLakeStoreLinkedService. +func (adlsls AzureDataLakeStoreLinkedService) AsPhoenixLinkedService() (*PhoenixLinkedService, bool) { + return nil, false +} + +// AsPaypalLinkedService is the BasicLinkedService implementation for AzureDataLakeStoreLinkedService. +func (adlsls AzureDataLakeStoreLinkedService) AsPaypalLinkedService() (*PaypalLinkedService, bool) { + return nil, false +} + +// AsMarketoLinkedService is the BasicLinkedService implementation for AzureDataLakeStoreLinkedService. +func (adlsls AzureDataLakeStoreLinkedService) AsMarketoLinkedService() (*MarketoLinkedService, bool) { + return nil, false +} + +// AsMariaDBLinkedService is the BasicLinkedService implementation for AzureDataLakeStoreLinkedService. +func (adlsls AzureDataLakeStoreLinkedService) AsMariaDBLinkedService() (*MariaDBLinkedService, bool) { + return nil, false +} + +// AsMagentoLinkedService is the BasicLinkedService implementation for AzureDataLakeStoreLinkedService. +func (adlsls AzureDataLakeStoreLinkedService) AsMagentoLinkedService() (*MagentoLinkedService, bool) { + return nil, false +} + +// AsJiraLinkedService is the BasicLinkedService implementation for AzureDataLakeStoreLinkedService. +func (adlsls AzureDataLakeStoreLinkedService) AsJiraLinkedService() (*JiraLinkedService, bool) { + return nil, false +} + +// AsImpalaLinkedService is the BasicLinkedService implementation for AzureDataLakeStoreLinkedService. +func (adlsls AzureDataLakeStoreLinkedService) AsImpalaLinkedService() (*ImpalaLinkedService, bool) { + return nil, false +} + +// AsHubspotLinkedService is the BasicLinkedService implementation for AzureDataLakeStoreLinkedService. +func (adlsls AzureDataLakeStoreLinkedService) AsHubspotLinkedService() (*HubspotLinkedService, bool) { + return nil, false +} + +// AsHiveLinkedService is the BasicLinkedService implementation for AzureDataLakeStoreLinkedService. +func (adlsls AzureDataLakeStoreLinkedService) AsHiveLinkedService() (*HiveLinkedService, bool) { + return nil, false +} + +// AsHBaseLinkedService is the BasicLinkedService implementation for AzureDataLakeStoreLinkedService. +func (adlsls AzureDataLakeStoreLinkedService) AsHBaseLinkedService() (*HBaseLinkedService, bool) { + return nil, false +} + +// AsGreenplumLinkedService is the BasicLinkedService implementation for AzureDataLakeStoreLinkedService. +func (adlsls AzureDataLakeStoreLinkedService) AsGreenplumLinkedService() (*GreenplumLinkedService, bool) { + return nil, false +} + +// AsGoogleBigQueryLinkedService is the BasicLinkedService implementation for AzureDataLakeStoreLinkedService. +func (adlsls AzureDataLakeStoreLinkedService) AsGoogleBigQueryLinkedService() (*GoogleBigQueryLinkedService, bool) { + return nil, false +} + +// AsEloquaLinkedService is the BasicLinkedService implementation for AzureDataLakeStoreLinkedService. +func (adlsls AzureDataLakeStoreLinkedService) AsEloquaLinkedService() (*EloquaLinkedService, bool) { + return nil, false +} + +// AsDrillLinkedService is the BasicLinkedService implementation for AzureDataLakeStoreLinkedService. +func (adlsls AzureDataLakeStoreLinkedService) AsDrillLinkedService() (*DrillLinkedService, bool) { + return nil, false +} + +// AsCouchbaseLinkedService is the BasicLinkedService implementation for AzureDataLakeStoreLinkedService. +func (adlsls AzureDataLakeStoreLinkedService) AsCouchbaseLinkedService() (*CouchbaseLinkedService, bool) { + return nil, false +} + +// AsConcurLinkedService is the BasicLinkedService implementation for AzureDataLakeStoreLinkedService. +func (adlsls AzureDataLakeStoreLinkedService) AsConcurLinkedService() (*ConcurLinkedService, bool) { + return nil, false +} + +// AsAzurePostgreSQLLinkedService is the BasicLinkedService implementation for AzureDataLakeStoreLinkedService. +func (adlsls AzureDataLakeStoreLinkedService) AsAzurePostgreSQLLinkedService() (*AzurePostgreSQLLinkedService, bool) { + return nil, false +} + +// AsAmazonMWSLinkedService is the BasicLinkedService implementation for AzureDataLakeStoreLinkedService. +func (adlsls AzureDataLakeStoreLinkedService) AsAmazonMWSLinkedService() (*AmazonMWSLinkedService, bool) { + return nil, false +} + +// AsSapHanaLinkedService is the BasicLinkedService implementation for AzureDataLakeStoreLinkedService. +func (adlsls AzureDataLakeStoreLinkedService) AsSapHanaLinkedService() (*SapHanaLinkedService, bool) { + return nil, false +} + +// AsSapBWLinkedService is the BasicLinkedService implementation for AzureDataLakeStoreLinkedService. +func (adlsls AzureDataLakeStoreLinkedService) AsSapBWLinkedService() (*SapBWLinkedService, bool) { + return nil, false +} + +// AsSftpServerLinkedService is the BasicLinkedService implementation for AzureDataLakeStoreLinkedService. +func (adlsls AzureDataLakeStoreLinkedService) AsSftpServerLinkedService() (*SftpServerLinkedService, bool) { + return nil, false +} + +// AsFtpServerLinkedService is the BasicLinkedService implementation for AzureDataLakeStoreLinkedService. +func (adlsls AzureDataLakeStoreLinkedService) AsFtpServerLinkedService() (*FtpServerLinkedService, bool) { + return nil, false +} + +// AsHTTPLinkedService is the BasicLinkedService implementation for AzureDataLakeStoreLinkedService. +func (adlsls AzureDataLakeStoreLinkedService) AsHTTPLinkedService() (*HTTPLinkedService, bool) { + return nil, false +} + +// AsAzureSearchLinkedService is the BasicLinkedService implementation for AzureDataLakeStoreLinkedService. +func (adlsls AzureDataLakeStoreLinkedService) AsAzureSearchLinkedService() (*AzureSearchLinkedService, bool) { + return nil, false +} + +// AsCustomDataSourceLinkedService is the BasicLinkedService implementation for AzureDataLakeStoreLinkedService. +func (adlsls AzureDataLakeStoreLinkedService) AsCustomDataSourceLinkedService() (*CustomDataSourceLinkedService, bool) { + return nil, false +} + +// AsAmazonRedshiftLinkedService is the BasicLinkedService implementation for AzureDataLakeStoreLinkedService. +func (adlsls AzureDataLakeStoreLinkedService) AsAmazonRedshiftLinkedService() (*AmazonRedshiftLinkedService, bool) { + return nil, false +} + +// AsAmazonS3LinkedService is the BasicLinkedService implementation for AzureDataLakeStoreLinkedService. +func (adlsls AzureDataLakeStoreLinkedService) AsAmazonS3LinkedService() (*AmazonS3LinkedService, bool) { + return nil, false +} + +// AsSapEccLinkedService is the BasicLinkedService implementation for AzureDataLakeStoreLinkedService. +func (adlsls AzureDataLakeStoreLinkedService) AsSapEccLinkedService() (*SapEccLinkedService, bool) { + return nil, false +} + +// AsSapCloudForCustomerLinkedService is the BasicLinkedService implementation for AzureDataLakeStoreLinkedService. +func (adlsls AzureDataLakeStoreLinkedService) AsSapCloudForCustomerLinkedService() (*SapCloudForCustomerLinkedService, bool) { + return nil, false +} + +// AsSalesforceLinkedService is the BasicLinkedService implementation for AzureDataLakeStoreLinkedService. +func (adlsls AzureDataLakeStoreLinkedService) AsSalesforceLinkedService() (*SalesforceLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeStoreLinkedService is the BasicLinkedService implementation for AzureDataLakeStoreLinkedService. +func (adlsls AzureDataLakeStoreLinkedService) AsAzureDataLakeStoreLinkedService() (*AzureDataLakeStoreLinkedService, bool) { + return &adlsls, true +} + +// AsMongoDbLinkedService is the BasicLinkedService implementation for AzureDataLakeStoreLinkedService. +func (adlsls AzureDataLakeStoreLinkedService) AsMongoDbLinkedService() (*MongoDbLinkedService, bool) { + return nil, false +} + +// AsCassandraLinkedService is the BasicLinkedService implementation for AzureDataLakeStoreLinkedService. +func (adlsls AzureDataLakeStoreLinkedService) AsCassandraLinkedService() (*CassandraLinkedService, bool) { + return nil, false +} + +// AsWebLinkedService is the BasicLinkedService implementation for AzureDataLakeStoreLinkedService. +func (adlsls AzureDataLakeStoreLinkedService) AsWebLinkedService() (*WebLinkedService, bool) { + return nil, false +} + +// AsODataLinkedService is the BasicLinkedService implementation for AzureDataLakeStoreLinkedService. +func (adlsls AzureDataLakeStoreLinkedService) AsODataLinkedService() (*ODataLinkedService, bool) { + return nil, false +} + +// AsHdfsLinkedService is the BasicLinkedService implementation for AzureDataLakeStoreLinkedService. +func (adlsls AzureDataLakeStoreLinkedService) AsHdfsLinkedService() (*HdfsLinkedService, bool) { + return nil, false +} + +// AsOdbcLinkedService is the BasicLinkedService implementation for AzureDataLakeStoreLinkedService. +func (adlsls AzureDataLakeStoreLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, bool) { + return nil, false +} + +// AsAzureMLLinkedService is the BasicLinkedService implementation for AzureDataLakeStoreLinkedService. +func (adlsls AzureDataLakeStoreLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { + return nil, false +} + +// AsTeradataLinkedService is the BasicLinkedService implementation for AzureDataLakeStoreLinkedService. +func (adlsls AzureDataLakeStoreLinkedService) AsTeradataLinkedService() (*TeradataLinkedService, bool) { + return nil, false +} + +// AsDb2LinkedService is the BasicLinkedService implementation for AzureDataLakeStoreLinkedService. +func (adlsls AzureDataLakeStoreLinkedService) AsDb2LinkedService() (*Db2LinkedService, bool) { + return nil, false +} + +// AsSybaseLinkedService is the BasicLinkedService implementation for AzureDataLakeStoreLinkedService. +func (adlsls AzureDataLakeStoreLinkedService) AsSybaseLinkedService() (*SybaseLinkedService, bool) { + return nil, false +} + +// AsPostgreSQLLinkedService is the BasicLinkedService implementation for AzureDataLakeStoreLinkedService. +func (adlsls AzureDataLakeStoreLinkedService) AsPostgreSQLLinkedService() (*PostgreSQLLinkedService, bool) { + return nil, false +} + +// AsMySQLLinkedService is the BasicLinkedService implementation for AzureDataLakeStoreLinkedService. +func (adlsls AzureDataLakeStoreLinkedService) AsMySQLLinkedService() (*MySQLLinkedService, bool) { + return nil, false +} + +// AsAzureMySQLLinkedService is the BasicLinkedService implementation for AzureDataLakeStoreLinkedService. +func (adlsls AzureDataLakeStoreLinkedService) AsAzureMySQLLinkedService() (*AzureMySQLLinkedService, bool) { + return nil, false +} + +// AsOracleLinkedService is the BasicLinkedService implementation for AzureDataLakeStoreLinkedService. +func (adlsls AzureDataLakeStoreLinkedService) AsOracleLinkedService() (*OracleLinkedService, bool) { + return nil, false +} + +// AsFileServerLinkedService is the BasicLinkedService implementation for AzureDataLakeStoreLinkedService. +func (adlsls AzureDataLakeStoreLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { + return nil, false +} + +// AsHDInsightLinkedService is the BasicLinkedService implementation for AzureDataLakeStoreLinkedService. +func (adlsls AzureDataLakeStoreLinkedService) AsHDInsightLinkedService() (*HDInsightLinkedService, bool) { + return nil, false +} + +// AsDynamicsLinkedService is the BasicLinkedService implementation for AzureDataLakeStoreLinkedService. +func (adlsls AzureDataLakeStoreLinkedService) AsDynamicsLinkedService() (*DynamicsLinkedService, bool) { + return nil, false +} + +// AsCosmosDbLinkedService is the BasicLinkedService implementation for AzureDataLakeStoreLinkedService. +func (adlsls AzureDataLakeStoreLinkedService) AsCosmosDbLinkedService() (*CosmosDbLinkedService, bool) { + return nil, false +} + +// AsAzureKeyVaultLinkedService is the BasicLinkedService implementation for AzureDataLakeStoreLinkedService. +func (adlsls AzureDataLakeStoreLinkedService) AsAzureKeyVaultLinkedService() (*AzureKeyVaultLinkedService, bool) { + return nil, false +} + +// AsAzureBatchLinkedService is the BasicLinkedService implementation for AzureDataLakeStoreLinkedService. +func (adlsls AzureDataLakeStoreLinkedService) AsAzureBatchLinkedService() (*AzureBatchLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDatabaseLinkedService is the BasicLinkedService implementation for AzureDataLakeStoreLinkedService. +func (adlsls AzureDataLakeStoreLinkedService) AsAzureSQLDatabaseLinkedService() (*AzureSQLDatabaseLinkedService, bool) { + return nil, false +} + +// AsSQLServerLinkedService is the BasicLinkedService implementation for AzureDataLakeStoreLinkedService. +func (adlsls AzureDataLakeStoreLinkedService) AsSQLServerLinkedService() (*SQLServerLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDWLinkedService is the BasicLinkedService implementation for AzureDataLakeStoreLinkedService. +func (adlsls AzureDataLakeStoreLinkedService) AsAzureSQLDWLinkedService() (*AzureSQLDWLinkedService, bool) { + return nil, false +} + +// AsAzureStorageLinkedService is the BasicLinkedService implementation for AzureDataLakeStoreLinkedService. +func (adlsls AzureDataLakeStoreLinkedService) AsAzureStorageLinkedService() (*AzureStorageLinkedService, bool) { + return nil, false +} + +// AsLinkedService is the BasicLinkedService implementation for AzureDataLakeStoreLinkedService. +func (adlsls AzureDataLakeStoreLinkedService) AsLinkedService() (*LinkedService, bool) { + return nil, false +} + +// AsBasicLinkedService is the BasicLinkedService implementation for AzureDataLakeStoreLinkedService. +func (adlsls AzureDataLakeStoreLinkedService) AsBasicLinkedService() (BasicLinkedService, bool) { + return &adlsls, true +} + +// UnmarshalJSON is the custom unmarshaler for AzureDataLakeStoreLinkedService struct. +func (adlsls *AzureDataLakeStoreLinkedService) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "typeProperties": + if v != nil { + var azureDataLakeStoreLinkedServiceTypeProperties AzureDataLakeStoreLinkedServiceTypeProperties + err = json.Unmarshal(*v, &azureDataLakeStoreLinkedServiceTypeProperties) + if err != nil { + return err + } + adlsls.AzureDataLakeStoreLinkedServiceTypeProperties = &azureDataLakeStoreLinkedServiceTypeProperties + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if adlsls.AdditionalProperties == nil { + adlsls.AdditionalProperties = make(map[string]interface{}) + } + adlsls.AdditionalProperties[k] = additionalProperties + } + case "connectVia": + if v != nil { + var connectVia IntegrationRuntimeReference + err = json.Unmarshal(*v, &connectVia) + if err != nil { + return err + } + adlsls.ConnectVia = &connectVia + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + adlsls.Description = &description + } + case "parameters": + if v != nil { + var parameters map[string]*ParameterSpecification + err = json.Unmarshal(*v, ¶meters) + if err != nil { + return err + } + adlsls.Parameters = parameters + } + case "annotations": + if v != nil { + var annotations []interface{} + err = json.Unmarshal(*v, &annotations) + if err != nil { + return err + } + adlsls.Annotations = &annotations + } + case "type": + if v != nil { + var typeVar TypeBasicLinkedService + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + adlsls.Type = typeVar + } + } + } + + return nil +} + +// AzureDataLakeStoreLinkedServiceTypeProperties azure Data Lake Store linked service properties. +type AzureDataLakeStoreLinkedServiceTypeProperties struct { + // DataLakeStoreURI - Data Lake Store service URI. Type: string (or Expression with resultType string). + DataLakeStoreURI interface{} `json:"dataLakeStoreUri,omitempty"` + // ServicePrincipalID - The ID of the application used to authenticate against the Azure Data Lake Store account. Type: string (or Expression with resultType string). + ServicePrincipalID interface{} `json:"servicePrincipalId,omitempty"` + // ServicePrincipalKey - The Key of the application used to authenticate against the Azure Data Lake Store account. + ServicePrincipalKey BasicSecretBase `json:"servicePrincipalKey,omitempty"` + // Tenant - The name or ID of the tenant to which the service principal belongs. Type: string (or Expression with resultType string). + Tenant interface{} `json:"tenant,omitempty"` + // AccountName - Data Lake Store account name. Type: string (or Expression with resultType string). + AccountName interface{} `json:"accountName,omitempty"` + // SubscriptionID - Data Lake Store account subscription ID (if different from Data Factory account). Type: string (or Expression with resultType string). + SubscriptionID interface{} `json:"subscriptionId,omitempty"` + // ResourceGroupName - Data Lake Store account resource group name (if different from Data Factory account). Type: string (or Expression with resultType string). + ResourceGroupName interface{} `json:"resourceGroupName,omitempty"` + // EncryptedCredential - The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string). + EncryptedCredential interface{} `json:"encryptedCredential,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for AzureDataLakeStoreLinkedServiceTypeProperties struct. +func (adlslstp *AzureDataLakeStoreLinkedServiceTypeProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "dataLakeStoreUri": + if v != nil { + var dataLakeStoreURI interface{} + err = json.Unmarshal(*v, &dataLakeStoreURI) + if err != nil { + return err + } + adlslstp.DataLakeStoreURI = dataLakeStoreURI + } + case "servicePrincipalId": + if v != nil { + var servicePrincipalID interface{} + err = json.Unmarshal(*v, &servicePrincipalID) + if err != nil { + return err + } + adlslstp.ServicePrincipalID = servicePrincipalID + } + case "servicePrincipalKey": + if v != nil { + servicePrincipalKey, err := unmarshalBasicSecretBase(*v) + if err != nil { + return err + } + adlslstp.ServicePrincipalKey = servicePrincipalKey + } + case "tenant": + if v != nil { + var tenant interface{} + err = json.Unmarshal(*v, &tenant) + if err != nil { + return err + } + adlslstp.Tenant = tenant + } + case "accountName": + if v != nil { + var accountName interface{} + err = json.Unmarshal(*v, &accountName) + if err != nil { + return err + } + adlslstp.AccountName = accountName + } + case "subscriptionId": + if v != nil { + var subscriptionID interface{} + err = json.Unmarshal(*v, &subscriptionID) + if err != nil { + return err + } + adlslstp.SubscriptionID = subscriptionID + } + case "resourceGroupName": + if v != nil { + var resourceGroupName interface{} + err = json.Unmarshal(*v, &resourceGroupName) + if err != nil { + return err + } + adlslstp.ResourceGroupName = resourceGroupName + } + case "encryptedCredential": + if v != nil { + var encryptedCredential interface{} + err = json.Unmarshal(*v, &encryptedCredential) + if err != nil { + return err + } + adlslstp.EncryptedCredential = encryptedCredential + } + } + } + + return nil +} + +// AzureDataLakeStoreSink a copy activity Azure Data Lake Store sink. +type AzureDataLakeStoreSink struct { + // CopyBehavior - The type of copy behavior for copy sink. Possible values include: 'PreserveHierarchy', 'FlattenHierarchy', 'MergeFiles' + CopyBehavior CopyBehaviorType `json:"copyBehavior,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // WriteBatchSize - Write batch size. Type: integer (or Expression with resultType integer), minimum: 0. + WriteBatchSize interface{} `json:"writeBatchSize,omitempty"` + // WriteBatchTimeout - Write batch timeout. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + WriteBatchTimeout interface{} `json:"writeBatchTimeout,omitempty"` + // SinkRetryCount - Sink retry count. Type: integer (or Expression with resultType integer). + SinkRetryCount interface{} `json:"sinkRetryCount,omitempty"` + // SinkRetryWait - Sink retry wait. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + SinkRetryWait interface{} `json:"sinkRetryWait,omitempty"` + // Type - Possible values include: 'TypeCopySink', 'TypeSalesforceSink', 'TypeDynamicsSink', 'TypeOdbcSink', 'TypeAzureSearchIndexSink', 'TypeAzureDataLakeStoreSink', 'TypeOracleSink', 'TypeSQLDWSink', 'TypeSQLSink', 'TypeDocumentDbCollectionSink', 'TypeFileSystemSink', 'TypeBlobSink', 'TypeAzureTableSink', 'TypeAzureQueueSink', 'TypeSapCloudForCustomerSink' + Type TypeBasicCopySink `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureDataLakeStoreSink. +func (adlss AzureDataLakeStoreSink) MarshalJSON() ([]byte, error) { + adlss.Type = TypeAzureDataLakeStoreSink + objectMap := make(map[string]interface{}) + if adlss.CopyBehavior != "" { + objectMap["copyBehavior"] = adlss.CopyBehavior + } + objectMap["writeBatchSize"] = adlss.WriteBatchSize + objectMap["writeBatchTimeout"] = adlss.WriteBatchTimeout + objectMap["sinkRetryCount"] = adlss.SinkRetryCount + objectMap["sinkRetryWait"] = adlss.SinkRetryWait + if adlss.Type != "" { + objectMap["type"] = adlss.Type + } + for k, v := range adlss.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsSalesforceSink is the BasicCopySink implementation for AzureDataLakeStoreSink. +func (adlss AzureDataLakeStoreSink) AsSalesforceSink() (*SalesforceSink, bool) { + return nil, false +} + +// AsDynamicsSink is the BasicCopySink implementation for AzureDataLakeStoreSink. +func (adlss AzureDataLakeStoreSink) AsDynamicsSink() (*DynamicsSink, bool) { + return nil, false +} + +// AsOdbcSink is the BasicCopySink implementation for AzureDataLakeStoreSink. +func (adlss AzureDataLakeStoreSink) AsOdbcSink() (*OdbcSink, bool) { + return nil, false +} + +// AsAzureSearchIndexSink is the BasicCopySink implementation for AzureDataLakeStoreSink. +func (adlss AzureDataLakeStoreSink) AsAzureSearchIndexSink() (*AzureSearchIndexSink, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSink is the BasicCopySink implementation for AzureDataLakeStoreSink. +func (adlss AzureDataLakeStoreSink) AsAzureDataLakeStoreSink() (*AzureDataLakeStoreSink, bool) { + return &adlss, true +} + +// AsOracleSink is the BasicCopySink implementation for AzureDataLakeStoreSink. +func (adlss AzureDataLakeStoreSink) AsOracleSink() (*OracleSink, bool) { + return nil, false +} + +// AsSQLDWSink is the BasicCopySink implementation for AzureDataLakeStoreSink. +func (adlss AzureDataLakeStoreSink) AsSQLDWSink() (*SQLDWSink, bool) { + return nil, false +} + +// AsSQLSink is the BasicCopySink implementation for AzureDataLakeStoreSink. +func (adlss AzureDataLakeStoreSink) AsSQLSink() (*SQLSink, bool) { + return nil, false +} + +// AsDocumentDbCollectionSink is the BasicCopySink implementation for AzureDataLakeStoreSink. +func (adlss AzureDataLakeStoreSink) AsDocumentDbCollectionSink() (*DocumentDbCollectionSink, bool) { + return nil, false +} + +// AsFileSystemSink is the BasicCopySink implementation for AzureDataLakeStoreSink. +func (adlss AzureDataLakeStoreSink) AsFileSystemSink() (*FileSystemSink, bool) { + return nil, false +} + +// AsBlobSink is the BasicCopySink implementation for AzureDataLakeStoreSink. +func (adlss AzureDataLakeStoreSink) AsBlobSink() (*BlobSink, bool) { + return nil, false +} + +// AsAzureTableSink is the BasicCopySink implementation for AzureDataLakeStoreSink. +func (adlss AzureDataLakeStoreSink) AsAzureTableSink() (*AzureTableSink, bool) { + return nil, false +} + +// AsAzureQueueSink is the BasicCopySink implementation for AzureDataLakeStoreSink. +func (adlss AzureDataLakeStoreSink) AsAzureQueueSink() (*AzureQueueSink, bool) { + return nil, false +} + +// AsSapCloudForCustomerSink is the BasicCopySink implementation for AzureDataLakeStoreSink. +func (adlss AzureDataLakeStoreSink) AsSapCloudForCustomerSink() (*SapCloudForCustomerSink, bool) { + return nil, false +} + +// AsCopySink is the BasicCopySink implementation for AzureDataLakeStoreSink. +func (adlss AzureDataLakeStoreSink) AsCopySink() (*CopySink, bool) { + return nil, false +} + +// AsBasicCopySink is the BasicCopySink implementation for AzureDataLakeStoreSink. +func (adlss AzureDataLakeStoreSink) AsBasicCopySink() (BasicCopySink, bool) { + return &adlss, true +} + +// AzureDataLakeStoreSource a copy activity Azure Data Lake source. +type AzureDataLakeStoreSource struct { + // Recursive - If true, files under the folder path will be read recursively. Default is true. Type: boolean (or Expression with resultType boolean). + Recursive interface{} `json:"recursive,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // SourceRetryCount - Source retry count. Type: integer (or Expression with resultType integer). + SourceRetryCount interface{} `json:"sourceRetryCount,omitempty"` + // SourceRetryWait - Source retry wait. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` + // Type - Possible values include: 'TypeCopySource', 'TypeAmazonRedshiftSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeHTTPSource', 'TypeAzureDataLakeStoreSource', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeRelationalSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource' + Type TypeBasicCopySource `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureDataLakeStoreSource. +func (adlss AzureDataLakeStoreSource) MarshalJSON() ([]byte, error) { + adlss.Type = TypeAzureDataLakeStoreSource + objectMap := make(map[string]interface{}) + objectMap["recursive"] = adlss.Recursive + objectMap["sourceRetryCount"] = adlss.SourceRetryCount + objectMap["sourceRetryWait"] = adlss.SourceRetryWait + if adlss.Type != "" { + objectMap["type"] = adlss.Type + } + for k, v := range adlss.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsAmazonRedshiftSource is the BasicCopySource implementation for AzureDataLakeStoreSource. +func (adlss AzureDataLakeStoreSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { + return nil, false +} + +// AsResponsysSource is the BasicCopySource implementation for AzureDataLakeStoreSource. +func (adlss AzureDataLakeStoreSource) AsResponsysSource() (*ResponsysSource, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudSource is the BasicCopySource implementation for AzureDataLakeStoreSource. +func (adlss AzureDataLakeStoreSource) AsSalesforceMarketingCloudSource() (*SalesforceMarketingCloudSource, bool) { + return nil, false +} + +// AsVerticaSource is the BasicCopySource implementation for AzureDataLakeStoreSource. +func (adlss AzureDataLakeStoreSource) AsVerticaSource() (*VerticaSource, bool) { + return nil, false +} + +// AsNetezzaSource is the BasicCopySource implementation for AzureDataLakeStoreSource. +func (adlss AzureDataLakeStoreSource) AsNetezzaSource() (*NetezzaSource, bool) { + return nil, false +} + +// AsZohoSource is the BasicCopySource implementation for AzureDataLakeStoreSource. +func (adlss AzureDataLakeStoreSource) AsZohoSource() (*ZohoSource, bool) { + return nil, false +} + +// AsXeroSource is the BasicCopySource implementation for AzureDataLakeStoreSource. +func (adlss AzureDataLakeStoreSource) AsXeroSource() (*XeroSource, bool) { + return nil, false +} + +// AsSquareSource is the BasicCopySource implementation for AzureDataLakeStoreSource. +func (adlss AzureDataLakeStoreSource) AsSquareSource() (*SquareSource, bool) { + return nil, false +} + +// AsSparkSource is the BasicCopySource implementation for AzureDataLakeStoreSource. +func (adlss AzureDataLakeStoreSource) AsSparkSource() (*SparkSource, bool) { + return nil, false +} + +// AsShopifySource is the BasicCopySource implementation for AzureDataLakeStoreSource. +func (adlss AzureDataLakeStoreSource) AsShopifySource() (*ShopifySource, bool) { + return nil, false +} + +// AsServiceNowSource is the BasicCopySource implementation for AzureDataLakeStoreSource. +func (adlss AzureDataLakeStoreSource) AsServiceNowSource() (*ServiceNowSource, bool) { + return nil, false +} + +// AsQuickBooksSource is the BasicCopySource implementation for AzureDataLakeStoreSource. +func (adlss AzureDataLakeStoreSource) AsQuickBooksSource() (*QuickBooksSource, bool) { + return nil, false +} + +// AsPrestoSource is the BasicCopySource implementation for AzureDataLakeStoreSource. +func (adlss AzureDataLakeStoreSource) AsPrestoSource() (*PrestoSource, bool) { + return nil, false +} + +// AsPhoenixSource is the BasicCopySource implementation for AzureDataLakeStoreSource. +func (adlss AzureDataLakeStoreSource) AsPhoenixSource() (*PhoenixSource, bool) { + return nil, false +} + +// AsPaypalSource is the BasicCopySource implementation for AzureDataLakeStoreSource. +func (adlss AzureDataLakeStoreSource) AsPaypalSource() (*PaypalSource, bool) { + return nil, false +} + +// AsMarketoSource is the BasicCopySource implementation for AzureDataLakeStoreSource. +func (adlss AzureDataLakeStoreSource) AsMarketoSource() (*MarketoSource, bool) { + return nil, false +} + +// AsMariaDBSource is the BasicCopySource implementation for AzureDataLakeStoreSource. +func (adlss AzureDataLakeStoreSource) AsMariaDBSource() (*MariaDBSource, bool) { + return nil, false +} + +// AsMagentoSource is the BasicCopySource implementation for AzureDataLakeStoreSource. +func (adlss AzureDataLakeStoreSource) AsMagentoSource() (*MagentoSource, bool) { + return nil, false +} + +// AsJiraSource is the BasicCopySource implementation for AzureDataLakeStoreSource. +func (adlss AzureDataLakeStoreSource) AsJiraSource() (*JiraSource, bool) { + return nil, false +} + +// AsImpalaSource is the BasicCopySource implementation for AzureDataLakeStoreSource. +func (adlss AzureDataLakeStoreSource) AsImpalaSource() (*ImpalaSource, bool) { + return nil, false +} + +// AsHubspotSource is the BasicCopySource implementation for AzureDataLakeStoreSource. +func (adlss AzureDataLakeStoreSource) AsHubspotSource() (*HubspotSource, bool) { + return nil, false +} + +// AsHiveSource is the BasicCopySource implementation for AzureDataLakeStoreSource. +func (adlss AzureDataLakeStoreSource) AsHiveSource() (*HiveSource, bool) { + return nil, false +} + +// AsHBaseSource is the BasicCopySource implementation for AzureDataLakeStoreSource. +func (adlss AzureDataLakeStoreSource) AsHBaseSource() (*HBaseSource, bool) { + return nil, false +} + +// AsGreenplumSource is the BasicCopySource implementation for AzureDataLakeStoreSource. +func (adlss AzureDataLakeStoreSource) AsGreenplumSource() (*GreenplumSource, bool) { + return nil, false +} + +// AsGoogleBigQuerySource is the BasicCopySource implementation for AzureDataLakeStoreSource. +func (adlss AzureDataLakeStoreSource) AsGoogleBigQuerySource() (*GoogleBigQuerySource, bool) { + return nil, false +} + +// AsEloquaSource is the BasicCopySource implementation for AzureDataLakeStoreSource. +func (adlss AzureDataLakeStoreSource) AsEloquaSource() (*EloquaSource, bool) { + return nil, false +} + +// AsDrillSource is the BasicCopySource implementation for AzureDataLakeStoreSource. +func (adlss AzureDataLakeStoreSource) AsDrillSource() (*DrillSource, bool) { + return nil, false +} + +// AsCouchbaseSource is the BasicCopySource implementation for AzureDataLakeStoreSource. +func (adlss AzureDataLakeStoreSource) AsCouchbaseSource() (*CouchbaseSource, bool) { + return nil, false +} + +// AsConcurSource is the BasicCopySource implementation for AzureDataLakeStoreSource. +func (adlss AzureDataLakeStoreSource) AsConcurSource() (*ConcurSource, bool) { + return nil, false +} + +// AsAzurePostgreSQLSource is the BasicCopySource implementation for AzureDataLakeStoreSource. +func (adlss AzureDataLakeStoreSource) AsAzurePostgreSQLSource() (*AzurePostgreSQLSource, bool) { + return nil, false +} + +// AsAmazonMWSSource is the BasicCopySource implementation for AzureDataLakeStoreSource. +func (adlss AzureDataLakeStoreSource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { + return nil, false +} + +// AsHTTPSource is the BasicCopySource implementation for AzureDataLakeStoreSource. +func (adlss AzureDataLakeStoreSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for AzureDataLakeStoreSource. +func (adlss AzureDataLakeStoreSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return &adlss, true +} + +// AsMongoDbSource is the BasicCopySource implementation for AzureDataLakeStoreSource. +func (adlss AzureDataLakeStoreSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsCassandraSource is the BasicCopySource implementation for AzureDataLakeStoreSource. +func (adlss AzureDataLakeStoreSource) AsCassandraSource() (*CassandraSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for AzureDataLakeStoreSource. +func (adlss AzureDataLakeStoreSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for AzureDataLakeStoreSource. +func (adlss AzureDataLakeStoreSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureMySQLSource is the BasicCopySource implementation for AzureDataLakeStoreSource. +func (adlss AzureDataLakeStoreSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for AzureDataLakeStoreSource. +func (adlss AzureDataLakeStoreSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for AzureDataLakeStoreSource. +func (adlss AzureDataLakeStoreSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsSQLDWSource is the BasicCopySource implementation for AzureDataLakeStoreSource. +func (adlss AzureDataLakeStoreSource) AsSQLDWSource() (*SQLDWSource, bool) { + return nil, false +} + +// AsSQLSource is the BasicCopySource implementation for AzureDataLakeStoreSource. +func (adlss AzureDataLakeStoreSource) AsSQLSource() (*SQLSource, bool) { + return nil, false +} + +// AsSapEccSource is the BasicCopySource implementation for AzureDataLakeStoreSource. +func (adlss AzureDataLakeStoreSource) AsSapEccSource() (*SapEccSource, bool) { + return nil, false +} + +// AsSapCloudForCustomerSource is the BasicCopySource implementation for AzureDataLakeStoreSource. +func (adlss AzureDataLakeStoreSource) AsSapCloudForCustomerSource() (*SapCloudForCustomerSource, bool) { + return nil, false +} + +// AsSalesforceSource is the BasicCopySource implementation for AzureDataLakeStoreSource. +func (adlss AzureDataLakeStoreSource) AsSalesforceSource() (*SalesforceSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for AzureDataLakeStoreSource. +func (adlss AzureDataLakeStoreSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for AzureDataLakeStoreSource. +func (adlss AzureDataLakeStoreSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for AzureDataLakeStoreSource. +func (adlss AzureDataLakeStoreSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for AzureDataLakeStoreSource. +func (adlss AzureDataLakeStoreSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + +// AsAzureTableSource is the BasicCopySource implementation for AzureDataLakeStoreSource. +func (adlss AzureDataLakeStoreSource) AsAzureTableSource() (*AzureTableSource, bool) { + return nil, false +} + +// AsCopySource is the BasicCopySource implementation for AzureDataLakeStoreSource. +func (adlss AzureDataLakeStoreSource) AsCopySource() (*CopySource, bool) { + return nil, false +} + +// AsBasicCopySource is the BasicCopySource implementation for AzureDataLakeStoreSource. +func (adlss AzureDataLakeStoreSource) AsBasicCopySource() (BasicCopySource, bool) { + return &adlss, true +} + +// AzureKeyVaultLinkedService azure Key Vault linked service. +type AzureKeyVaultLinkedService struct { + // AzureKeyVaultLinkedServiceTypeProperties - Azure Key Vault linked service properties. + *AzureKeyVaultLinkedServiceTypeProperties `json:"typeProperties,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // ConnectVia - The integration runtime reference. + ConnectVia *IntegrationRuntimeReference `json:"connectVia,omitempty"` + // Description - Linked service description. + Description *string `json:"description,omitempty"` + // Parameters - Parameters for linked service. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeLinkedService', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforce', 'TypeAzureDataLakeStore', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureStorage' + Type TypeBasicLinkedService `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureKeyVaultLinkedService. +func (akvls AzureKeyVaultLinkedService) MarshalJSON() ([]byte, error) { + akvls.Type = TypeAzureKeyVault + objectMap := make(map[string]interface{}) + if akvls.AzureKeyVaultLinkedServiceTypeProperties != nil { + objectMap["typeProperties"] = akvls.AzureKeyVaultLinkedServiceTypeProperties + } + if akvls.ConnectVia != nil { + objectMap["connectVia"] = akvls.ConnectVia + } + if akvls.Description != nil { + objectMap["description"] = akvls.Description + } + if akvls.Parameters != nil { + objectMap["parameters"] = akvls.Parameters + } + if akvls.Annotations != nil { + objectMap["annotations"] = akvls.Annotations + } + if akvls.Type != "" { + objectMap["type"] = akvls.Type + } + for k, v := range akvls.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysLinkedService is the BasicLinkedService implementation for AzureKeyVaultLinkedService. +func (akvls AzureKeyVaultLinkedService) AsResponsysLinkedService() (*ResponsysLinkedService, bool) { + return nil, false +} + +// AsAzureDatabricksLinkedService is the BasicLinkedService implementation for AzureKeyVaultLinkedService. +func (akvls AzureKeyVaultLinkedService) AsAzureDatabricksLinkedService() (*AzureDatabricksLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeAnalyticsLinkedService is the BasicLinkedService implementation for AzureKeyVaultLinkedService. +func (akvls AzureKeyVaultLinkedService) AsAzureDataLakeAnalyticsLinkedService() (*AzureDataLakeAnalyticsLinkedService, bool) { + return nil, false +} + +// AsHDInsightOnDemandLinkedService is the BasicLinkedService implementation for AzureKeyVaultLinkedService. +func (akvls AzureKeyVaultLinkedService) AsHDInsightOnDemandLinkedService() (*HDInsightOnDemandLinkedService, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudLinkedService is the BasicLinkedService implementation for AzureKeyVaultLinkedService. +func (akvls AzureKeyVaultLinkedService) AsSalesforceMarketingCloudLinkedService() (*SalesforceMarketingCloudLinkedService, bool) { + return nil, false +} + +// AsNetezzaLinkedService is the BasicLinkedService implementation for AzureKeyVaultLinkedService. +func (akvls AzureKeyVaultLinkedService) AsNetezzaLinkedService() (*NetezzaLinkedService, bool) { + return nil, false +} + +// AsVerticaLinkedService is the BasicLinkedService implementation for AzureKeyVaultLinkedService. +func (akvls AzureKeyVaultLinkedService) AsVerticaLinkedService() (*VerticaLinkedService, bool) { + return nil, false +} + +// AsZohoLinkedService is the BasicLinkedService implementation for AzureKeyVaultLinkedService. +func (akvls AzureKeyVaultLinkedService) AsZohoLinkedService() (*ZohoLinkedService, bool) { + return nil, false +} + +// AsXeroLinkedService is the BasicLinkedService implementation for AzureKeyVaultLinkedService. +func (akvls AzureKeyVaultLinkedService) AsXeroLinkedService() (*XeroLinkedService, bool) { + return nil, false +} + +// AsSquareLinkedService is the BasicLinkedService implementation for AzureKeyVaultLinkedService. +func (akvls AzureKeyVaultLinkedService) AsSquareLinkedService() (*SquareLinkedService, bool) { + return nil, false +} + +// AsSparkLinkedService is the BasicLinkedService implementation for AzureKeyVaultLinkedService. +func (akvls AzureKeyVaultLinkedService) AsSparkLinkedService() (*SparkLinkedService, bool) { + return nil, false +} + +// AsShopifyLinkedService is the BasicLinkedService implementation for AzureKeyVaultLinkedService. +func (akvls AzureKeyVaultLinkedService) AsShopifyLinkedService() (*ShopifyLinkedService, bool) { + return nil, false +} + +// AsServiceNowLinkedService is the BasicLinkedService implementation for AzureKeyVaultLinkedService. +func (akvls AzureKeyVaultLinkedService) AsServiceNowLinkedService() (*ServiceNowLinkedService, bool) { + return nil, false +} + +// AsQuickBooksLinkedService is the BasicLinkedService implementation for AzureKeyVaultLinkedService. +func (akvls AzureKeyVaultLinkedService) AsQuickBooksLinkedService() (*QuickBooksLinkedService, bool) { + return nil, false +} + +// AsPrestoLinkedService is the BasicLinkedService implementation for AzureKeyVaultLinkedService. +func (akvls AzureKeyVaultLinkedService) AsPrestoLinkedService() (*PrestoLinkedService, bool) { + return nil, false +} + +// AsPhoenixLinkedService is the BasicLinkedService implementation for AzureKeyVaultLinkedService. +func (akvls AzureKeyVaultLinkedService) AsPhoenixLinkedService() (*PhoenixLinkedService, bool) { + return nil, false +} + +// AsPaypalLinkedService is the BasicLinkedService implementation for AzureKeyVaultLinkedService. +func (akvls AzureKeyVaultLinkedService) AsPaypalLinkedService() (*PaypalLinkedService, bool) { + return nil, false +} + +// AsMarketoLinkedService is the BasicLinkedService implementation for AzureKeyVaultLinkedService. +func (akvls AzureKeyVaultLinkedService) AsMarketoLinkedService() (*MarketoLinkedService, bool) { + return nil, false +} + +// AsMariaDBLinkedService is the BasicLinkedService implementation for AzureKeyVaultLinkedService. +func (akvls AzureKeyVaultLinkedService) AsMariaDBLinkedService() (*MariaDBLinkedService, bool) { + return nil, false +} + +// AsMagentoLinkedService is the BasicLinkedService implementation for AzureKeyVaultLinkedService. +func (akvls AzureKeyVaultLinkedService) AsMagentoLinkedService() (*MagentoLinkedService, bool) { + return nil, false +} + +// AsJiraLinkedService is the BasicLinkedService implementation for AzureKeyVaultLinkedService. +func (akvls AzureKeyVaultLinkedService) AsJiraLinkedService() (*JiraLinkedService, bool) { + return nil, false +} + +// AsImpalaLinkedService is the BasicLinkedService implementation for AzureKeyVaultLinkedService. +func (akvls AzureKeyVaultLinkedService) AsImpalaLinkedService() (*ImpalaLinkedService, bool) { + return nil, false +} + +// AsHubspotLinkedService is the BasicLinkedService implementation for AzureKeyVaultLinkedService. +func (akvls AzureKeyVaultLinkedService) AsHubspotLinkedService() (*HubspotLinkedService, bool) { + return nil, false +} + +// AsHiveLinkedService is the BasicLinkedService implementation for AzureKeyVaultLinkedService. +func (akvls AzureKeyVaultLinkedService) AsHiveLinkedService() (*HiveLinkedService, bool) { + return nil, false +} + +// AsHBaseLinkedService is the BasicLinkedService implementation for AzureKeyVaultLinkedService. +func (akvls AzureKeyVaultLinkedService) AsHBaseLinkedService() (*HBaseLinkedService, bool) { + return nil, false +} + +// AsGreenplumLinkedService is the BasicLinkedService implementation for AzureKeyVaultLinkedService. +func (akvls AzureKeyVaultLinkedService) AsGreenplumLinkedService() (*GreenplumLinkedService, bool) { + return nil, false +} + +// AsGoogleBigQueryLinkedService is the BasicLinkedService implementation for AzureKeyVaultLinkedService. +func (akvls AzureKeyVaultLinkedService) AsGoogleBigQueryLinkedService() (*GoogleBigQueryLinkedService, bool) { + return nil, false +} + +// AsEloquaLinkedService is the BasicLinkedService implementation for AzureKeyVaultLinkedService. +func (akvls AzureKeyVaultLinkedService) AsEloquaLinkedService() (*EloquaLinkedService, bool) { + return nil, false +} + +// AsDrillLinkedService is the BasicLinkedService implementation for AzureKeyVaultLinkedService. +func (akvls AzureKeyVaultLinkedService) AsDrillLinkedService() (*DrillLinkedService, bool) { + return nil, false +} + +// AsCouchbaseLinkedService is the BasicLinkedService implementation for AzureKeyVaultLinkedService. +func (akvls AzureKeyVaultLinkedService) AsCouchbaseLinkedService() (*CouchbaseLinkedService, bool) { + return nil, false +} + +// AsConcurLinkedService is the BasicLinkedService implementation for AzureKeyVaultLinkedService. +func (akvls AzureKeyVaultLinkedService) AsConcurLinkedService() (*ConcurLinkedService, bool) { + return nil, false +} + +// AsAzurePostgreSQLLinkedService is the BasicLinkedService implementation for AzureKeyVaultLinkedService. +func (akvls AzureKeyVaultLinkedService) AsAzurePostgreSQLLinkedService() (*AzurePostgreSQLLinkedService, bool) { + return nil, false +} + +// AsAmazonMWSLinkedService is the BasicLinkedService implementation for AzureKeyVaultLinkedService. +func (akvls AzureKeyVaultLinkedService) AsAmazonMWSLinkedService() (*AmazonMWSLinkedService, bool) { + return nil, false +} + +// AsSapHanaLinkedService is the BasicLinkedService implementation for AzureKeyVaultLinkedService. +func (akvls AzureKeyVaultLinkedService) AsSapHanaLinkedService() (*SapHanaLinkedService, bool) { + return nil, false +} + +// AsSapBWLinkedService is the BasicLinkedService implementation for AzureKeyVaultLinkedService. +func (akvls AzureKeyVaultLinkedService) AsSapBWLinkedService() (*SapBWLinkedService, bool) { + return nil, false +} + +// AsSftpServerLinkedService is the BasicLinkedService implementation for AzureKeyVaultLinkedService. +func (akvls AzureKeyVaultLinkedService) AsSftpServerLinkedService() (*SftpServerLinkedService, bool) { + return nil, false +} + +// AsFtpServerLinkedService is the BasicLinkedService implementation for AzureKeyVaultLinkedService. +func (akvls AzureKeyVaultLinkedService) AsFtpServerLinkedService() (*FtpServerLinkedService, bool) { + return nil, false +} + +// AsHTTPLinkedService is the BasicLinkedService implementation for AzureKeyVaultLinkedService. +func (akvls AzureKeyVaultLinkedService) AsHTTPLinkedService() (*HTTPLinkedService, bool) { + return nil, false +} + +// AsAzureSearchLinkedService is the BasicLinkedService implementation for AzureKeyVaultLinkedService. +func (akvls AzureKeyVaultLinkedService) AsAzureSearchLinkedService() (*AzureSearchLinkedService, bool) { + return nil, false +} + +// AsCustomDataSourceLinkedService is the BasicLinkedService implementation for AzureKeyVaultLinkedService. +func (akvls AzureKeyVaultLinkedService) AsCustomDataSourceLinkedService() (*CustomDataSourceLinkedService, bool) { + return nil, false +} + +// AsAmazonRedshiftLinkedService is the BasicLinkedService implementation for AzureKeyVaultLinkedService. +func (akvls AzureKeyVaultLinkedService) AsAmazonRedshiftLinkedService() (*AmazonRedshiftLinkedService, bool) { + return nil, false +} + +// AsAmazonS3LinkedService is the BasicLinkedService implementation for AzureKeyVaultLinkedService. +func (akvls AzureKeyVaultLinkedService) AsAmazonS3LinkedService() (*AmazonS3LinkedService, bool) { + return nil, false +} + +// AsSapEccLinkedService is the BasicLinkedService implementation for AzureKeyVaultLinkedService. +func (akvls AzureKeyVaultLinkedService) AsSapEccLinkedService() (*SapEccLinkedService, bool) { + return nil, false +} + +// AsSapCloudForCustomerLinkedService is the BasicLinkedService implementation for AzureKeyVaultLinkedService. +func (akvls AzureKeyVaultLinkedService) AsSapCloudForCustomerLinkedService() (*SapCloudForCustomerLinkedService, bool) { + return nil, false +} + +// AsSalesforceLinkedService is the BasicLinkedService implementation for AzureKeyVaultLinkedService. +func (akvls AzureKeyVaultLinkedService) AsSalesforceLinkedService() (*SalesforceLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeStoreLinkedService is the BasicLinkedService implementation for AzureKeyVaultLinkedService. +func (akvls AzureKeyVaultLinkedService) AsAzureDataLakeStoreLinkedService() (*AzureDataLakeStoreLinkedService, bool) { + return nil, false +} + +// AsMongoDbLinkedService is the BasicLinkedService implementation for AzureKeyVaultLinkedService. +func (akvls AzureKeyVaultLinkedService) AsMongoDbLinkedService() (*MongoDbLinkedService, bool) { + return nil, false +} + +// AsCassandraLinkedService is the BasicLinkedService implementation for AzureKeyVaultLinkedService. +func (akvls AzureKeyVaultLinkedService) AsCassandraLinkedService() (*CassandraLinkedService, bool) { + return nil, false +} + +// AsWebLinkedService is the BasicLinkedService implementation for AzureKeyVaultLinkedService. +func (akvls AzureKeyVaultLinkedService) AsWebLinkedService() (*WebLinkedService, bool) { + return nil, false +} + +// AsODataLinkedService is the BasicLinkedService implementation for AzureKeyVaultLinkedService. +func (akvls AzureKeyVaultLinkedService) AsODataLinkedService() (*ODataLinkedService, bool) { + return nil, false +} + +// AsHdfsLinkedService is the BasicLinkedService implementation for AzureKeyVaultLinkedService. +func (akvls AzureKeyVaultLinkedService) AsHdfsLinkedService() (*HdfsLinkedService, bool) { + return nil, false +} + +// AsOdbcLinkedService is the BasicLinkedService implementation for AzureKeyVaultLinkedService. +func (akvls AzureKeyVaultLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, bool) { + return nil, false +} + +// AsAzureMLLinkedService is the BasicLinkedService implementation for AzureKeyVaultLinkedService. +func (akvls AzureKeyVaultLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { + return nil, false +} + +// AsTeradataLinkedService is the BasicLinkedService implementation for AzureKeyVaultLinkedService. +func (akvls AzureKeyVaultLinkedService) AsTeradataLinkedService() (*TeradataLinkedService, bool) { + return nil, false +} + +// AsDb2LinkedService is the BasicLinkedService implementation for AzureKeyVaultLinkedService. +func (akvls AzureKeyVaultLinkedService) AsDb2LinkedService() (*Db2LinkedService, bool) { + return nil, false +} + +// AsSybaseLinkedService is the BasicLinkedService implementation for AzureKeyVaultLinkedService. +func (akvls AzureKeyVaultLinkedService) AsSybaseLinkedService() (*SybaseLinkedService, bool) { + return nil, false +} + +// AsPostgreSQLLinkedService is the BasicLinkedService implementation for AzureKeyVaultLinkedService. +func (akvls AzureKeyVaultLinkedService) AsPostgreSQLLinkedService() (*PostgreSQLLinkedService, bool) { + return nil, false +} + +// AsMySQLLinkedService is the BasicLinkedService implementation for AzureKeyVaultLinkedService. +func (akvls AzureKeyVaultLinkedService) AsMySQLLinkedService() (*MySQLLinkedService, bool) { + return nil, false +} + +// AsAzureMySQLLinkedService is the BasicLinkedService implementation for AzureKeyVaultLinkedService. +func (akvls AzureKeyVaultLinkedService) AsAzureMySQLLinkedService() (*AzureMySQLLinkedService, bool) { + return nil, false +} + +// AsOracleLinkedService is the BasicLinkedService implementation for AzureKeyVaultLinkedService. +func (akvls AzureKeyVaultLinkedService) AsOracleLinkedService() (*OracleLinkedService, bool) { + return nil, false +} + +// AsFileServerLinkedService is the BasicLinkedService implementation for AzureKeyVaultLinkedService. +func (akvls AzureKeyVaultLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { + return nil, false +} + +// AsHDInsightLinkedService is the BasicLinkedService implementation for AzureKeyVaultLinkedService. +func (akvls AzureKeyVaultLinkedService) AsHDInsightLinkedService() (*HDInsightLinkedService, bool) { + return nil, false +} + +// AsDynamicsLinkedService is the BasicLinkedService implementation for AzureKeyVaultLinkedService. +func (akvls AzureKeyVaultLinkedService) AsDynamicsLinkedService() (*DynamicsLinkedService, bool) { + return nil, false +} + +// AsCosmosDbLinkedService is the BasicLinkedService implementation for AzureKeyVaultLinkedService. +func (akvls AzureKeyVaultLinkedService) AsCosmosDbLinkedService() (*CosmosDbLinkedService, bool) { + return nil, false +} + +// AsAzureKeyVaultLinkedService is the BasicLinkedService implementation for AzureKeyVaultLinkedService. +func (akvls AzureKeyVaultLinkedService) AsAzureKeyVaultLinkedService() (*AzureKeyVaultLinkedService, bool) { + return &akvls, true +} + +// AsAzureBatchLinkedService is the BasicLinkedService implementation for AzureKeyVaultLinkedService. +func (akvls AzureKeyVaultLinkedService) AsAzureBatchLinkedService() (*AzureBatchLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDatabaseLinkedService is the BasicLinkedService implementation for AzureKeyVaultLinkedService. +func (akvls AzureKeyVaultLinkedService) AsAzureSQLDatabaseLinkedService() (*AzureSQLDatabaseLinkedService, bool) { + return nil, false +} + +// AsSQLServerLinkedService is the BasicLinkedService implementation for AzureKeyVaultLinkedService. +func (akvls AzureKeyVaultLinkedService) AsSQLServerLinkedService() (*SQLServerLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDWLinkedService is the BasicLinkedService implementation for AzureKeyVaultLinkedService. +func (akvls AzureKeyVaultLinkedService) AsAzureSQLDWLinkedService() (*AzureSQLDWLinkedService, bool) { + return nil, false +} + +// AsAzureStorageLinkedService is the BasicLinkedService implementation for AzureKeyVaultLinkedService. +func (akvls AzureKeyVaultLinkedService) AsAzureStorageLinkedService() (*AzureStorageLinkedService, bool) { + return nil, false +} + +// AsLinkedService is the BasicLinkedService implementation for AzureKeyVaultLinkedService. +func (akvls AzureKeyVaultLinkedService) AsLinkedService() (*LinkedService, bool) { + return nil, false +} + +// AsBasicLinkedService is the BasicLinkedService implementation for AzureKeyVaultLinkedService. +func (akvls AzureKeyVaultLinkedService) AsBasicLinkedService() (BasicLinkedService, bool) { + return &akvls, true +} + +// UnmarshalJSON is the custom unmarshaler for AzureKeyVaultLinkedService struct. +func (akvls *AzureKeyVaultLinkedService) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "typeProperties": + if v != nil { + var azureKeyVaultLinkedServiceTypeProperties AzureKeyVaultLinkedServiceTypeProperties + err = json.Unmarshal(*v, &azureKeyVaultLinkedServiceTypeProperties) + if err != nil { + return err + } + akvls.AzureKeyVaultLinkedServiceTypeProperties = &azureKeyVaultLinkedServiceTypeProperties + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if akvls.AdditionalProperties == nil { + akvls.AdditionalProperties = make(map[string]interface{}) + } + akvls.AdditionalProperties[k] = additionalProperties + } + case "connectVia": + if v != nil { + var connectVia IntegrationRuntimeReference + err = json.Unmarshal(*v, &connectVia) + if err != nil { + return err + } + akvls.ConnectVia = &connectVia + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + akvls.Description = &description + } + case "parameters": + if v != nil { + var parameters map[string]*ParameterSpecification + err = json.Unmarshal(*v, ¶meters) + if err != nil { + return err + } + akvls.Parameters = parameters + } + case "annotations": + if v != nil { + var annotations []interface{} + err = json.Unmarshal(*v, &annotations) + if err != nil { + return err + } + akvls.Annotations = &annotations + } + case "type": + if v != nil { + var typeVar TypeBasicLinkedService + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + akvls.Type = typeVar + } + } + } + + return nil +} + +// AzureKeyVaultLinkedServiceTypeProperties azure Key Vault linked service properties. +type AzureKeyVaultLinkedServiceTypeProperties struct { + // BaseURL - The base URL of the Azure Key Vault. e.g. https://myakv.vault.azure.net Type: string (or Expression with resultType string). + BaseURL interface{} `json:"baseUrl,omitempty"` +} + +// AzureKeyVaultSecretReference azure Key Vault secret reference. +type AzureKeyVaultSecretReference struct { + // Store - The Azure Key Vault linked service reference. + Store *LinkedServiceReference `json:"store,omitempty"` + // SecretName - The name of the secret in Azure Key Vault. Type: string (or Expression with resultType string). + SecretName interface{} `json:"secretName,omitempty"` + // SecretVersion - The version of the secret in Azure Key Vault. The default value is the latest version of the secret. Type: string (or Expression with resultType string). + SecretVersion interface{} `json:"secretVersion,omitempty"` + // Type - Possible values include: 'TypeSecretBase', 'TypeSecureString', 'TypeAzureKeyVaultSecret' + Type Type `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureKeyVaultSecretReference. +func (akvsr AzureKeyVaultSecretReference) MarshalJSON() ([]byte, error) { + akvsr.Type = TypeAzureKeyVaultSecret + objectMap := make(map[string]interface{}) + if akvsr.Store != nil { + objectMap["store"] = akvsr.Store + } + objectMap["secretName"] = akvsr.SecretName + objectMap["secretVersion"] = akvsr.SecretVersion + if akvsr.Type != "" { + objectMap["type"] = akvsr.Type + } + return json.Marshal(objectMap) +} + +// AsSecureString is the BasicSecretBase implementation for AzureKeyVaultSecretReference. +func (akvsr AzureKeyVaultSecretReference) AsSecureString() (*SecureString, bool) { + return nil, false +} + +// AsAzureKeyVaultSecretReference is the BasicSecretBase implementation for AzureKeyVaultSecretReference. +func (akvsr AzureKeyVaultSecretReference) AsAzureKeyVaultSecretReference() (*AzureKeyVaultSecretReference, bool) { + return &akvsr, true +} + +// AsSecretBase is the BasicSecretBase implementation for AzureKeyVaultSecretReference. +func (akvsr AzureKeyVaultSecretReference) AsSecretBase() (*SecretBase, bool) { + return nil, false +} + +// AsBasicSecretBase is the BasicSecretBase implementation for AzureKeyVaultSecretReference. +func (akvsr AzureKeyVaultSecretReference) AsBasicSecretBase() (BasicSecretBase, bool) { + return &akvsr, true +} + +// AzureMLBatchExecutionActivity azure ML Batch Execution activity. +type AzureMLBatchExecutionActivity struct { + // AzureMLBatchExecutionActivityTypeProperties - Azure ML Batch Execution activity properties. + *AzureMLBatchExecutionActivityTypeProperties `json:"typeProperties,omitempty"` + // LinkedServiceName - Linked service reference. + LinkedServiceName *LinkedServiceReference `json:"linkedServiceName,omitempty"` + // Policy - Activity policy. + Policy *ActivityPolicy `json:"policy,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Name - Activity name. + Name *string `json:"name,omitempty"` + // Description - Activity description. + Description *string `json:"description,omitempty"` + // DependsOn - Activity depends on condition. + DependsOn *[]ActivityDependency `json:"dependsOn,omitempty"` + // UserProperties - Activity user properties. + UserProperties map[string]*string `json:"userProperties"` + // Type - Possible values include: 'TypeActivity', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLUpdateResource', 'TypeAzureMLBatchExecution', 'TypeGetMetadata', 'TypeWebActivity', 'TypeLookup', 'TypeSQLServerStoredProcedure', 'TypeCustom', 'TypeExecuteSSISPackage', 'TypeHDInsightSpark', 'TypeHDInsightStreaming', 'TypeHDInsightMapReduce', 'TypeHDInsightPig', 'TypeHDInsightHive', 'TypeCopy', 'TypeExecution', 'TypeFilter', 'TypeUntil', 'TypeWait', 'TypeForEach', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' + Type TypeBasicActivity `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureMLBatchExecutionActivity. +func (ambea AzureMLBatchExecutionActivity) MarshalJSON() ([]byte, error) { + ambea.Type = TypeAzureMLBatchExecution + objectMap := make(map[string]interface{}) + if ambea.AzureMLBatchExecutionActivityTypeProperties != nil { + objectMap["typeProperties"] = ambea.AzureMLBatchExecutionActivityTypeProperties + } + if ambea.LinkedServiceName != nil { + objectMap["linkedServiceName"] = ambea.LinkedServiceName + } + if ambea.Policy != nil { + objectMap["policy"] = ambea.Policy + } + if ambea.Name != nil { + objectMap["name"] = ambea.Name + } + if ambea.Description != nil { + objectMap["description"] = ambea.Description + } + if ambea.DependsOn != nil { + objectMap["dependsOn"] = ambea.DependsOn + } + if ambea.UserProperties != nil { + objectMap["userProperties"] = ambea.UserProperties + } + if ambea.Type != "" { + objectMap["type"] = ambea.Type + } + for k, v := range ambea.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsDatabricksNotebookActivity is the BasicActivity implementation for AzureMLBatchExecutionActivity. +func (ambea AzureMLBatchExecutionActivity) AsDatabricksNotebookActivity() (*DatabricksNotebookActivity, bool) { + return nil, false +} + +// AsDataLakeAnalyticsUSQLActivity is the BasicActivity implementation for AzureMLBatchExecutionActivity. +func (ambea AzureMLBatchExecutionActivity) AsDataLakeAnalyticsUSQLActivity() (*DataLakeAnalyticsUSQLActivity, bool) { + return nil, false +} + +// AsAzureMLUpdateResourceActivity is the BasicActivity implementation for AzureMLBatchExecutionActivity. +func (ambea AzureMLBatchExecutionActivity) AsAzureMLUpdateResourceActivity() (*AzureMLUpdateResourceActivity, bool) { + return nil, false +} + +// AsAzureMLBatchExecutionActivity is the BasicActivity implementation for AzureMLBatchExecutionActivity. +func (ambea AzureMLBatchExecutionActivity) AsAzureMLBatchExecutionActivity() (*AzureMLBatchExecutionActivity, bool) { + return &ambea, true +} + +// AsGetMetadataActivity is the BasicActivity implementation for AzureMLBatchExecutionActivity. +func (ambea AzureMLBatchExecutionActivity) AsGetMetadataActivity() (*GetMetadataActivity, bool) { + return nil, false +} + +// AsWebActivity is the BasicActivity implementation for AzureMLBatchExecutionActivity. +func (ambea AzureMLBatchExecutionActivity) AsWebActivity() (*WebActivity, bool) { + return nil, false +} + +// AsLookupActivity is the BasicActivity implementation for AzureMLBatchExecutionActivity. +func (ambea AzureMLBatchExecutionActivity) AsLookupActivity() (*LookupActivity, bool) { + return nil, false +} + +// AsSQLServerStoredProcedureActivity is the BasicActivity implementation for AzureMLBatchExecutionActivity. +func (ambea AzureMLBatchExecutionActivity) AsSQLServerStoredProcedureActivity() (*SQLServerStoredProcedureActivity, bool) { + return nil, false +} + +// AsCustomActivity is the BasicActivity implementation for AzureMLBatchExecutionActivity. +func (ambea AzureMLBatchExecutionActivity) AsCustomActivity() (*CustomActivity, bool) { + return nil, false +} + +// AsExecuteSSISPackageActivity is the BasicActivity implementation for AzureMLBatchExecutionActivity. +func (ambea AzureMLBatchExecutionActivity) AsExecuteSSISPackageActivity() (*ExecuteSSISPackageActivity, bool) { + return nil, false +} + +// AsHDInsightSparkActivity is the BasicActivity implementation for AzureMLBatchExecutionActivity. +func (ambea AzureMLBatchExecutionActivity) AsHDInsightSparkActivity() (*HDInsightSparkActivity, bool) { + return nil, false +} + +// AsHDInsightStreamingActivity is the BasicActivity implementation for AzureMLBatchExecutionActivity. +func (ambea AzureMLBatchExecutionActivity) AsHDInsightStreamingActivity() (*HDInsightStreamingActivity, bool) { + return nil, false +} + +// AsHDInsightMapReduceActivity is the BasicActivity implementation for AzureMLBatchExecutionActivity. +func (ambea AzureMLBatchExecutionActivity) AsHDInsightMapReduceActivity() (*HDInsightMapReduceActivity, bool) { + return nil, false +} + +// AsHDInsightPigActivity is the BasicActivity implementation for AzureMLBatchExecutionActivity. +func (ambea AzureMLBatchExecutionActivity) AsHDInsightPigActivity() (*HDInsightPigActivity, bool) { + return nil, false +} + +// AsHDInsightHiveActivity is the BasicActivity implementation for AzureMLBatchExecutionActivity. +func (ambea AzureMLBatchExecutionActivity) AsHDInsightHiveActivity() (*HDInsightHiveActivity, bool) { + return nil, false +} + +// AsCopyActivity is the BasicActivity implementation for AzureMLBatchExecutionActivity. +func (ambea AzureMLBatchExecutionActivity) AsCopyActivity() (*CopyActivity, bool) { + return nil, false +} + +// AsExecutionActivity is the BasicActivity implementation for AzureMLBatchExecutionActivity. +func (ambea AzureMLBatchExecutionActivity) AsExecutionActivity() (*ExecutionActivity, bool) { + return nil, false +} + +// AsBasicExecutionActivity is the BasicActivity implementation for AzureMLBatchExecutionActivity. +func (ambea AzureMLBatchExecutionActivity) AsBasicExecutionActivity() (BasicExecutionActivity, bool) { + return &ambea, true +} + +// AsFilterActivity is the BasicActivity implementation for AzureMLBatchExecutionActivity. +func (ambea AzureMLBatchExecutionActivity) AsFilterActivity() (*FilterActivity, bool) { + return nil, false +} + +// AsUntilActivity is the BasicActivity implementation for AzureMLBatchExecutionActivity. +func (ambea AzureMLBatchExecutionActivity) AsUntilActivity() (*UntilActivity, bool) { + return nil, false +} + +// AsWaitActivity is the BasicActivity implementation for AzureMLBatchExecutionActivity. +func (ambea AzureMLBatchExecutionActivity) AsWaitActivity() (*WaitActivity, bool) { + return nil, false +} + +// AsForEachActivity is the BasicActivity implementation for AzureMLBatchExecutionActivity. +func (ambea AzureMLBatchExecutionActivity) AsForEachActivity() (*ForEachActivity, bool) { + return nil, false +} + +// AsIfConditionActivity is the BasicActivity implementation for AzureMLBatchExecutionActivity. +func (ambea AzureMLBatchExecutionActivity) AsIfConditionActivity() (*IfConditionActivity, bool) { + return nil, false +} + +// AsExecutePipelineActivity is the BasicActivity implementation for AzureMLBatchExecutionActivity. +func (ambea AzureMLBatchExecutionActivity) AsExecutePipelineActivity() (*ExecutePipelineActivity, bool) { + return nil, false +} + +// AsControlActivity is the BasicActivity implementation for AzureMLBatchExecutionActivity. +func (ambea AzureMLBatchExecutionActivity) AsControlActivity() (*ControlActivity, bool) { + return nil, false +} + +// AsBasicControlActivity is the BasicActivity implementation for AzureMLBatchExecutionActivity. +func (ambea AzureMLBatchExecutionActivity) AsBasicControlActivity() (BasicControlActivity, bool) { + return nil, false +} + +// AsActivity is the BasicActivity implementation for AzureMLBatchExecutionActivity. +func (ambea AzureMLBatchExecutionActivity) AsActivity() (*Activity, bool) { + return nil, false +} + +// AsBasicActivity is the BasicActivity implementation for AzureMLBatchExecutionActivity. +func (ambea AzureMLBatchExecutionActivity) AsBasicActivity() (BasicActivity, bool) { + return &ambea, true +} + +// UnmarshalJSON is the custom unmarshaler for AzureMLBatchExecutionActivity struct. +func (ambea *AzureMLBatchExecutionActivity) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "typeProperties": + if v != nil { + var azureMLBatchExecutionActivityTypeProperties AzureMLBatchExecutionActivityTypeProperties + err = json.Unmarshal(*v, &azureMLBatchExecutionActivityTypeProperties) + if err != nil { + return err + } + ambea.AzureMLBatchExecutionActivityTypeProperties = &azureMLBatchExecutionActivityTypeProperties + } + case "linkedServiceName": + if v != nil { + var linkedServiceName LinkedServiceReference + err = json.Unmarshal(*v, &linkedServiceName) + if err != nil { + return err + } + ambea.LinkedServiceName = &linkedServiceName + } + case "policy": + if v != nil { + var policy ActivityPolicy + err = json.Unmarshal(*v, &policy) + if err != nil { + return err + } + ambea.Policy = &policy + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if ambea.AdditionalProperties == nil { + ambea.AdditionalProperties = make(map[string]interface{}) + } + ambea.AdditionalProperties[k] = additionalProperties + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ambea.Name = &name + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + ambea.Description = &description + } + case "dependsOn": + if v != nil { + var dependsOn []ActivityDependency + err = json.Unmarshal(*v, &dependsOn) + if err != nil { + return err + } + ambea.DependsOn = &dependsOn + } + case "userProperties": + if v != nil { + var userProperties map[string]*string + err = json.Unmarshal(*v, &userProperties) + if err != nil { + return err + } + ambea.UserProperties = userProperties + } + case "type": + if v != nil { + var typeVar TypeBasicActivity + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ambea.Type = typeVar + } + } + } + + return nil +} + +// AzureMLBatchExecutionActivityTypeProperties azure ML Batch Execution activity properties. +type AzureMLBatchExecutionActivityTypeProperties struct { + // GlobalParameters - Key,Value pairs to be passed to the Azure ML Batch Execution Service endpoint. Keys must match the names of web service parameters defined in the published Azure ML web service. Values will be passed in the GlobalParameters property of the Azure ML batch execution request. + GlobalParameters map[string]interface{} `json:"globalParameters"` + // WebServiceOutputs - Key,Value pairs, mapping the names of Azure ML endpoint's Web Service Outputs to AzureMLWebServiceFile objects specifying the output Blob locations. This information will be passed in the WebServiceOutputs property of the Azure ML batch execution request. + WebServiceOutputs map[string]*AzureMLWebServiceFile `json:"webServiceOutputs"` + // WebServiceInputs - Key,Value pairs, mapping the names of Azure ML endpoint's Web Service Inputs to AzureMLWebServiceFile objects specifying the input Blob locations.. This information will be passed in the WebServiceInputs property of the Azure ML batch execution request. + WebServiceInputs map[string]*AzureMLWebServiceFile `json:"webServiceInputs"` +} + +// MarshalJSON is the custom marshaler for AzureMLBatchExecutionActivityTypeProperties. +func (ambeatp AzureMLBatchExecutionActivityTypeProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ambeatp.GlobalParameters != nil { + objectMap["globalParameters"] = ambeatp.GlobalParameters + } + if ambeatp.WebServiceOutputs != nil { + objectMap["webServiceOutputs"] = ambeatp.WebServiceOutputs + } + if ambeatp.WebServiceInputs != nil { + objectMap["webServiceInputs"] = ambeatp.WebServiceInputs + } + return json.Marshal(objectMap) +} + +// AzureMLLinkedService azure ML Web Service linked service. +type AzureMLLinkedService struct { + // AzureMLLinkedServiceTypeProperties - Azure ML Web Service linked service properties. + *AzureMLLinkedServiceTypeProperties `json:"typeProperties,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // ConnectVia - The integration runtime reference. + ConnectVia *IntegrationRuntimeReference `json:"connectVia,omitempty"` + // Description - Linked service description. + Description *string `json:"description,omitempty"` + // Parameters - Parameters for linked service. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeLinkedService', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforce', 'TypeAzureDataLakeStore', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureStorage' + Type TypeBasicLinkedService `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureMLLinkedService. +func (amls AzureMLLinkedService) MarshalJSON() ([]byte, error) { + amls.Type = TypeAzureML + objectMap := make(map[string]interface{}) + if amls.AzureMLLinkedServiceTypeProperties != nil { + objectMap["typeProperties"] = amls.AzureMLLinkedServiceTypeProperties + } + if amls.ConnectVia != nil { + objectMap["connectVia"] = amls.ConnectVia + } + if amls.Description != nil { + objectMap["description"] = amls.Description + } + if amls.Parameters != nil { + objectMap["parameters"] = amls.Parameters + } + if amls.Annotations != nil { + objectMap["annotations"] = amls.Annotations + } + if amls.Type != "" { + objectMap["type"] = amls.Type + } + for k, v := range amls.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysLinkedService is the BasicLinkedService implementation for AzureMLLinkedService. +func (amls AzureMLLinkedService) AsResponsysLinkedService() (*ResponsysLinkedService, bool) { + return nil, false +} + +// AsAzureDatabricksLinkedService is the BasicLinkedService implementation for AzureMLLinkedService. +func (amls AzureMLLinkedService) AsAzureDatabricksLinkedService() (*AzureDatabricksLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeAnalyticsLinkedService is the BasicLinkedService implementation for AzureMLLinkedService. +func (amls AzureMLLinkedService) AsAzureDataLakeAnalyticsLinkedService() (*AzureDataLakeAnalyticsLinkedService, bool) { + return nil, false +} + +// AsHDInsightOnDemandLinkedService is the BasicLinkedService implementation for AzureMLLinkedService. +func (amls AzureMLLinkedService) AsHDInsightOnDemandLinkedService() (*HDInsightOnDemandLinkedService, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudLinkedService is the BasicLinkedService implementation for AzureMLLinkedService. +func (amls AzureMLLinkedService) AsSalesforceMarketingCloudLinkedService() (*SalesforceMarketingCloudLinkedService, bool) { + return nil, false +} + +// AsNetezzaLinkedService is the BasicLinkedService implementation for AzureMLLinkedService. +func (amls AzureMLLinkedService) AsNetezzaLinkedService() (*NetezzaLinkedService, bool) { + return nil, false +} + +// AsVerticaLinkedService is the BasicLinkedService implementation for AzureMLLinkedService. +func (amls AzureMLLinkedService) AsVerticaLinkedService() (*VerticaLinkedService, bool) { + return nil, false +} + +// AsZohoLinkedService is the BasicLinkedService implementation for AzureMLLinkedService. +func (amls AzureMLLinkedService) AsZohoLinkedService() (*ZohoLinkedService, bool) { + return nil, false +} + +// AsXeroLinkedService is the BasicLinkedService implementation for AzureMLLinkedService. +func (amls AzureMLLinkedService) AsXeroLinkedService() (*XeroLinkedService, bool) { + return nil, false +} + +// AsSquareLinkedService is the BasicLinkedService implementation for AzureMLLinkedService. +func (amls AzureMLLinkedService) AsSquareLinkedService() (*SquareLinkedService, bool) { + return nil, false +} + +// AsSparkLinkedService is the BasicLinkedService implementation for AzureMLLinkedService. +func (amls AzureMLLinkedService) AsSparkLinkedService() (*SparkLinkedService, bool) { + return nil, false +} + +// AsShopifyLinkedService is the BasicLinkedService implementation for AzureMLLinkedService. +func (amls AzureMLLinkedService) AsShopifyLinkedService() (*ShopifyLinkedService, bool) { + return nil, false +} + +// AsServiceNowLinkedService is the BasicLinkedService implementation for AzureMLLinkedService. +func (amls AzureMLLinkedService) AsServiceNowLinkedService() (*ServiceNowLinkedService, bool) { + return nil, false +} + +// AsQuickBooksLinkedService is the BasicLinkedService implementation for AzureMLLinkedService. +func (amls AzureMLLinkedService) AsQuickBooksLinkedService() (*QuickBooksLinkedService, bool) { + return nil, false +} + +// AsPrestoLinkedService is the BasicLinkedService implementation for AzureMLLinkedService. +func (amls AzureMLLinkedService) AsPrestoLinkedService() (*PrestoLinkedService, bool) { + return nil, false +} + +// AsPhoenixLinkedService is the BasicLinkedService implementation for AzureMLLinkedService. +func (amls AzureMLLinkedService) AsPhoenixLinkedService() (*PhoenixLinkedService, bool) { + return nil, false +} + +// AsPaypalLinkedService is the BasicLinkedService implementation for AzureMLLinkedService. +func (amls AzureMLLinkedService) AsPaypalLinkedService() (*PaypalLinkedService, bool) { + return nil, false +} + +// AsMarketoLinkedService is the BasicLinkedService implementation for AzureMLLinkedService. +func (amls AzureMLLinkedService) AsMarketoLinkedService() (*MarketoLinkedService, bool) { + return nil, false +} + +// AsMariaDBLinkedService is the BasicLinkedService implementation for AzureMLLinkedService. +func (amls AzureMLLinkedService) AsMariaDBLinkedService() (*MariaDBLinkedService, bool) { + return nil, false +} + +// AsMagentoLinkedService is the BasicLinkedService implementation for AzureMLLinkedService. +func (amls AzureMLLinkedService) AsMagentoLinkedService() (*MagentoLinkedService, bool) { + return nil, false +} + +// AsJiraLinkedService is the BasicLinkedService implementation for AzureMLLinkedService. +func (amls AzureMLLinkedService) AsJiraLinkedService() (*JiraLinkedService, bool) { + return nil, false +} + +// AsImpalaLinkedService is the BasicLinkedService implementation for AzureMLLinkedService. +func (amls AzureMLLinkedService) AsImpalaLinkedService() (*ImpalaLinkedService, bool) { + return nil, false +} + +// AsHubspotLinkedService is the BasicLinkedService implementation for AzureMLLinkedService. +func (amls AzureMLLinkedService) AsHubspotLinkedService() (*HubspotLinkedService, bool) { + return nil, false +} + +// AsHiveLinkedService is the BasicLinkedService implementation for AzureMLLinkedService. +func (amls AzureMLLinkedService) AsHiveLinkedService() (*HiveLinkedService, bool) { + return nil, false +} + +// AsHBaseLinkedService is the BasicLinkedService implementation for AzureMLLinkedService. +func (amls AzureMLLinkedService) AsHBaseLinkedService() (*HBaseLinkedService, bool) { + return nil, false +} + +// AsGreenplumLinkedService is the BasicLinkedService implementation for AzureMLLinkedService. +func (amls AzureMLLinkedService) AsGreenplumLinkedService() (*GreenplumLinkedService, bool) { + return nil, false +} + +// AsGoogleBigQueryLinkedService is the BasicLinkedService implementation for AzureMLLinkedService. +func (amls AzureMLLinkedService) AsGoogleBigQueryLinkedService() (*GoogleBigQueryLinkedService, bool) { + return nil, false +} + +// AsEloquaLinkedService is the BasicLinkedService implementation for AzureMLLinkedService. +func (amls AzureMLLinkedService) AsEloquaLinkedService() (*EloquaLinkedService, bool) { + return nil, false +} + +// AsDrillLinkedService is the BasicLinkedService implementation for AzureMLLinkedService. +func (amls AzureMLLinkedService) AsDrillLinkedService() (*DrillLinkedService, bool) { + return nil, false +} + +// AsCouchbaseLinkedService is the BasicLinkedService implementation for AzureMLLinkedService. +func (amls AzureMLLinkedService) AsCouchbaseLinkedService() (*CouchbaseLinkedService, bool) { + return nil, false +} + +// AsConcurLinkedService is the BasicLinkedService implementation for AzureMLLinkedService. +func (amls AzureMLLinkedService) AsConcurLinkedService() (*ConcurLinkedService, bool) { + return nil, false +} + +// AsAzurePostgreSQLLinkedService is the BasicLinkedService implementation for AzureMLLinkedService. +func (amls AzureMLLinkedService) AsAzurePostgreSQLLinkedService() (*AzurePostgreSQLLinkedService, bool) { + return nil, false +} + +// AsAmazonMWSLinkedService is the BasicLinkedService implementation for AzureMLLinkedService. +func (amls AzureMLLinkedService) AsAmazonMWSLinkedService() (*AmazonMWSLinkedService, bool) { + return nil, false +} + +// AsSapHanaLinkedService is the BasicLinkedService implementation for AzureMLLinkedService. +func (amls AzureMLLinkedService) AsSapHanaLinkedService() (*SapHanaLinkedService, bool) { + return nil, false +} + +// AsSapBWLinkedService is the BasicLinkedService implementation for AzureMLLinkedService. +func (amls AzureMLLinkedService) AsSapBWLinkedService() (*SapBWLinkedService, bool) { + return nil, false +} + +// AsSftpServerLinkedService is the BasicLinkedService implementation for AzureMLLinkedService. +func (amls AzureMLLinkedService) AsSftpServerLinkedService() (*SftpServerLinkedService, bool) { + return nil, false +} + +// AsFtpServerLinkedService is the BasicLinkedService implementation for AzureMLLinkedService. +func (amls AzureMLLinkedService) AsFtpServerLinkedService() (*FtpServerLinkedService, bool) { + return nil, false +} + +// AsHTTPLinkedService is the BasicLinkedService implementation for AzureMLLinkedService. +func (amls AzureMLLinkedService) AsHTTPLinkedService() (*HTTPLinkedService, bool) { + return nil, false +} + +// AsAzureSearchLinkedService is the BasicLinkedService implementation for AzureMLLinkedService. +func (amls AzureMLLinkedService) AsAzureSearchLinkedService() (*AzureSearchLinkedService, bool) { + return nil, false +} + +// AsCustomDataSourceLinkedService is the BasicLinkedService implementation for AzureMLLinkedService. +func (amls AzureMLLinkedService) AsCustomDataSourceLinkedService() (*CustomDataSourceLinkedService, bool) { + return nil, false +} + +// AsAmazonRedshiftLinkedService is the BasicLinkedService implementation for AzureMLLinkedService. +func (amls AzureMLLinkedService) AsAmazonRedshiftLinkedService() (*AmazonRedshiftLinkedService, bool) { + return nil, false +} + +// AsAmazonS3LinkedService is the BasicLinkedService implementation for AzureMLLinkedService. +func (amls AzureMLLinkedService) AsAmazonS3LinkedService() (*AmazonS3LinkedService, bool) { + return nil, false +} + +// AsSapEccLinkedService is the BasicLinkedService implementation for AzureMLLinkedService. +func (amls AzureMLLinkedService) AsSapEccLinkedService() (*SapEccLinkedService, bool) { + return nil, false +} + +// AsSapCloudForCustomerLinkedService is the BasicLinkedService implementation for AzureMLLinkedService. +func (amls AzureMLLinkedService) AsSapCloudForCustomerLinkedService() (*SapCloudForCustomerLinkedService, bool) { + return nil, false +} + +// AsSalesforceLinkedService is the BasicLinkedService implementation for AzureMLLinkedService. +func (amls AzureMLLinkedService) AsSalesforceLinkedService() (*SalesforceLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeStoreLinkedService is the BasicLinkedService implementation for AzureMLLinkedService. +func (amls AzureMLLinkedService) AsAzureDataLakeStoreLinkedService() (*AzureDataLakeStoreLinkedService, bool) { + return nil, false +} + +// AsMongoDbLinkedService is the BasicLinkedService implementation for AzureMLLinkedService. +func (amls AzureMLLinkedService) AsMongoDbLinkedService() (*MongoDbLinkedService, bool) { + return nil, false +} + +// AsCassandraLinkedService is the BasicLinkedService implementation for AzureMLLinkedService. +func (amls AzureMLLinkedService) AsCassandraLinkedService() (*CassandraLinkedService, bool) { + return nil, false +} + +// AsWebLinkedService is the BasicLinkedService implementation for AzureMLLinkedService. +func (amls AzureMLLinkedService) AsWebLinkedService() (*WebLinkedService, bool) { + return nil, false +} + +// AsODataLinkedService is the BasicLinkedService implementation for AzureMLLinkedService. +func (amls AzureMLLinkedService) AsODataLinkedService() (*ODataLinkedService, bool) { + return nil, false +} + +// AsHdfsLinkedService is the BasicLinkedService implementation for AzureMLLinkedService. +func (amls AzureMLLinkedService) AsHdfsLinkedService() (*HdfsLinkedService, bool) { + return nil, false +} + +// AsOdbcLinkedService is the BasicLinkedService implementation for AzureMLLinkedService. +func (amls AzureMLLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, bool) { + return nil, false +} + +// AsAzureMLLinkedService is the BasicLinkedService implementation for AzureMLLinkedService. +func (amls AzureMLLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { + return &amls, true +} + +// AsTeradataLinkedService is the BasicLinkedService implementation for AzureMLLinkedService. +func (amls AzureMLLinkedService) AsTeradataLinkedService() (*TeradataLinkedService, bool) { + return nil, false +} + +// AsDb2LinkedService is the BasicLinkedService implementation for AzureMLLinkedService. +func (amls AzureMLLinkedService) AsDb2LinkedService() (*Db2LinkedService, bool) { + return nil, false +} + +// AsSybaseLinkedService is the BasicLinkedService implementation for AzureMLLinkedService. +func (amls AzureMLLinkedService) AsSybaseLinkedService() (*SybaseLinkedService, bool) { + return nil, false +} + +// AsPostgreSQLLinkedService is the BasicLinkedService implementation for AzureMLLinkedService. +func (amls AzureMLLinkedService) AsPostgreSQLLinkedService() (*PostgreSQLLinkedService, bool) { + return nil, false +} + +// AsMySQLLinkedService is the BasicLinkedService implementation for AzureMLLinkedService. +func (amls AzureMLLinkedService) AsMySQLLinkedService() (*MySQLLinkedService, bool) { + return nil, false +} + +// AsAzureMySQLLinkedService is the BasicLinkedService implementation for AzureMLLinkedService. +func (amls AzureMLLinkedService) AsAzureMySQLLinkedService() (*AzureMySQLLinkedService, bool) { + return nil, false +} + +// AsOracleLinkedService is the BasicLinkedService implementation for AzureMLLinkedService. +func (amls AzureMLLinkedService) AsOracleLinkedService() (*OracleLinkedService, bool) { + return nil, false +} + +// AsFileServerLinkedService is the BasicLinkedService implementation for AzureMLLinkedService. +func (amls AzureMLLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { + return nil, false +} + +// AsHDInsightLinkedService is the BasicLinkedService implementation for AzureMLLinkedService. +func (amls AzureMLLinkedService) AsHDInsightLinkedService() (*HDInsightLinkedService, bool) { + return nil, false +} + +// AsDynamicsLinkedService is the BasicLinkedService implementation for AzureMLLinkedService. +func (amls AzureMLLinkedService) AsDynamicsLinkedService() (*DynamicsLinkedService, bool) { + return nil, false +} + +// AsCosmosDbLinkedService is the BasicLinkedService implementation for AzureMLLinkedService. +func (amls AzureMLLinkedService) AsCosmosDbLinkedService() (*CosmosDbLinkedService, bool) { + return nil, false +} + +// AsAzureKeyVaultLinkedService is the BasicLinkedService implementation for AzureMLLinkedService. +func (amls AzureMLLinkedService) AsAzureKeyVaultLinkedService() (*AzureKeyVaultLinkedService, bool) { + return nil, false +} + +// AsAzureBatchLinkedService is the BasicLinkedService implementation for AzureMLLinkedService. +func (amls AzureMLLinkedService) AsAzureBatchLinkedService() (*AzureBatchLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDatabaseLinkedService is the BasicLinkedService implementation for AzureMLLinkedService. +func (amls AzureMLLinkedService) AsAzureSQLDatabaseLinkedService() (*AzureSQLDatabaseLinkedService, bool) { + return nil, false +} + +// AsSQLServerLinkedService is the BasicLinkedService implementation for AzureMLLinkedService. +func (amls AzureMLLinkedService) AsSQLServerLinkedService() (*SQLServerLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDWLinkedService is the BasicLinkedService implementation for AzureMLLinkedService. +func (amls AzureMLLinkedService) AsAzureSQLDWLinkedService() (*AzureSQLDWLinkedService, bool) { + return nil, false +} + +// AsAzureStorageLinkedService is the BasicLinkedService implementation for AzureMLLinkedService. +func (amls AzureMLLinkedService) AsAzureStorageLinkedService() (*AzureStorageLinkedService, bool) { + return nil, false +} + +// AsLinkedService is the BasicLinkedService implementation for AzureMLLinkedService. +func (amls AzureMLLinkedService) AsLinkedService() (*LinkedService, bool) { + return nil, false +} + +// AsBasicLinkedService is the BasicLinkedService implementation for AzureMLLinkedService. +func (amls AzureMLLinkedService) AsBasicLinkedService() (BasicLinkedService, bool) { + return &amls, true +} + +// UnmarshalJSON is the custom unmarshaler for AzureMLLinkedService struct. +func (amls *AzureMLLinkedService) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "typeProperties": + if v != nil { + var azureMLLinkedServiceTypeProperties AzureMLLinkedServiceTypeProperties + err = json.Unmarshal(*v, &azureMLLinkedServiceTypeProperties) + if err != nil { + return err + } + amls.AzureMLLinkedServiceTypeProperties = &azureMLLinkedServiceTypeProperties + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if amls.AdditionalProperties == nil { + amls.AdditionalProperties = make(map[string]interface{}) + } + amls.AdditionalProperties[k] = additionalProperties + } + case "connectVia": + if v != nil { + var connectVia IntegrationRuntimeReference + err = json.Unmarshal(*v, &connectVia) + if err != nil { + return err + } + amls.ConnectVia = &connectVia + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + amls.Description = &description + } + case "parameters": + if v != nil { + var parameters map[string]*ParameterSpecification + err = json.Unmarshal(*v, ¶meters) + if err != nil { + return err + } + amls.Parameters = parameters + } + case "annotations": + if v != nil { + var annotations []interface{} + err = json.Unmarshal(*v, &annotations) + if err != nil { + return err + } + amls.Annotations = &annotations + } + case "type": + if v != nil { + var typeVar TypeBasicLinkedService + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + amls.Type = typeVar + } + } + } + + return nil +} + +// AzureMLLinkedServiceTypeProperties azure ML Web Service linked service properties. +type AzureMLLinkedServiceTypeProperties struct { + // MlEndpoint - The Batch Execution REST URL for an Azure ML Web Service endpoint. Type: string (or Expression with resultType string). + MlEndpoint interface{} `json:"mlEndpoint,omitempty"` + // APIKey - The API key for accessing the Azure ML model endpoint. + APIKey BasicSecretBase `json:"apiKey,omitempty"` + // UpdateResourceEndpoint - The Update Resource REST URL for an Azure ML Web Service endpoint. Type: string (or Expression with resultType string). + UpdateResourceEndpoint interface{} `json:"updateResourceEndpoint,omitempty"` + // ServicePrincipalID - The ID of the service principal used to authenticate against the ARM-based updateResourceEndpoint of an Azure ML web service. Type: string (or Expression with resultType string). + ServicePrincipalID interface{} `json:"servicePrincipalId,omitempty"` + // ServicePrincipalKey - The key of the service principal used to authenticate against the ARM-based updateResourceEndpoint of an Azure ML web service. + ServicePrincipalKey BasicSecretBase `json:"servicePrincipalKey,omitempty"` + // Tenant - The name or ID of the tenant to which the service principal belongs. Type: string (or Expression with resultType string). + Tenant interface{} `json:"tenant,omitempty"` + // EncryptedCredential - The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string). + EncryptedCredential interface{} `json:"encryptedCredential,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for AzureMLLinkedServiceTypeProperties struct. +func (amlstp *AzureMLLinkedServiceTypeProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "mlEndpoint": + if v != nil { + var mlEndpoint interface{} + err = json.Unmarshal(*v, &mlEndpoint) + if err != nil { + return err + } + amlstp.MlEndpoint = mlEndpoint + } + case "apiKey": + if v != nil { + APIKey, err := unmarshalBasicSecretBase(*v) + if err != nil { + return err + } + amlstp.APIKey = APIKey + } + case "updateResourceEndpoint": + if v != nil { + var updateResourceEndpoint interface{} + err = json.Unmarshal(*v, &updateResourceEndpoint) + if err != nil { + return err + } + amlstp.UpdateResourceEndpoint = updateResourceEndpoint + } + case "servicePrincipalId": + if v != nil { + var servicePrincipalID interface{} + err = json.Unmarshal(*v, &servicePrincipalID) + if err != nil { + return err + } + amlstp.ServicePrincipalID = servicePrincipalID + } + case "servicePrincipalKey": + if v != nil { + servicePrincipalKey, err := unmarshalBasicSecretBase(*v) + if err != nil { + return err + } + amlstp.ServicePrincipalKey = servicePrincipalKey + } + case "tenant": + if v != nil { + var tenant interface{} + err = json.Unmarshal(*v, &tenant) + if err != nil { + return err + } + amlstp.Tenant = tenant + } + case "encryptedCredential": + if v != nil { + var encryptedCredential interface{} + err = json.Unmarshal(*v, &encryptedCredential) + if err != nil { + return err + } + amlstp.EncryptedCredential = encryptedCredential + } + } + } + + return nil +} + +// AzureMLUpdateResourceActivity azure ML Update Resource management activity. +type AzureMLUpdateResourceActivity struct { + // AzureMLUpdateResourceActivityTypeProperties - Azure ML Update Resource management activity properties. + *AzureMLUpdateResourceActivityTypeProperties `json:"typeProperties,omitempty"` + // LinkedServiceName - Linked service reference. + LinkedServiceName *LinkedServiceReference `json:"linkedServiceName,omitempty"` + // Policy - Activity policy. + Policy *ActivityPolicy `json:"policy,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Name - Activity name. + Name *string `json:"name,omitempty"` + // Description - Activity description. + Description *string `json:"description,omitempty"` + // DependsOn - Activity depends on condition. + DependsOn *[]ActivityDependency `json:"dependsOn,omitempty"` + // UserProperties - Activity user properties. + UserProperties map[string]*string `json:"userProperties"` + // Type - Possible values include: 'TypeActivity', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLUpdateResource', 'TypeAzureMLBatchExecution', 'TypeGetMetadata', 'TypeWebActivity', 'TypeLookup', 'TypeSQLServerStoredProcedure', 'TypeCustom', 'TypeExecuteSSISPackage', 'TypeHDInsightSpark', 'TypeHDInsightStreaming', 'TypeHDInsightMapReduce', 'TypeHDInsightPig', 'TypeHDInsightHive', 'TypeCopy', 'TypeExecution', 'TypeFilter', 'TypeUntil', 'TypeWait', 'TypeForEach', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' + Type TypeBasicActivity `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureMLUpdateResourceActivity. +func (amura AzureMLUpdateResourceActivity) MarshalJSON() ([]byte, error) { + amura.Type = TypeAzureMLUpdateResource + objectMap := make(map[string]interface{}) + if amura.AzureMLUpdateResourceActivityTypeProperties != nil { + objectMap["typeProperties"] = amura.AzureMLUpdateResourceActivityTypeProperties + } + if amura.LinkedServiceName != nil { + objectMap["linkedServiceName"] = amura.LinkedServiceName + } + if amura.Policy != nil { + objectMap["policy"] = amura.Policy + } + if amura.Name != nil { + objectMap["name"] = amura.Name + } + if amura.Description != nil { + objectMap["description"] = amura.Description + } + if amura.DependsOn != nil { + objectMap["dependsOn"] = amura.DependsOn + } + if amura.UserProperties != nil { + objectMap["userProperties"] = amura.UserProperties + } + if amura.Type != "" { + objectMap["type"] = amura.Type + } + for k, v := range amura.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsDatabricksNotebookActivity is the BasicActivity implementation for AzureMLUpdateResourceActivity. +func (amura AzureMLUpdateResourceActivity) AsDatabricksNotebookActivity() (*DatabricksNotebookActivity, bool) { + return nil, false +} + +// AsDataLakeAnalyticsUSQLActivity is the BasicActivity implementation for AzureMLUpdateResourceActivity. +func (amura AzureMLUpdateResourceActivity) AsDataLakeAnalyticsUSQLActivity() (*DataLakeAnalyticsUSQLActivity, bool) { + return nil, false +} + +// AsAzureMLUpdateResourceActivity is the BasicActivity implementation for AzureMLUpdateResourceActivity. +func (amura AzureMLUpdateResourceActivity) AsAzureMLUpdateResourceActivity() (*AzureMLUpdateResourceActivity, bool) { + return &amura, true +} + +// AsAzureMLBatchExecutionActivity is the BasicActivity implementation for AzureMLUpdateResourceActivity. +func (amura AzureMLUpdateResourceActivity) AsAzureMLBatchExecutionActivity() (*AzureMLBatchExecutionActivity, bool) { + return nil, false +} + +// AsGetMetadataActivity is the BasicActivity implementation for AzureMLUpdateResourceActivity. +func (amura AzureMLUpdateResourceActivity) AsGetMetadataActivity() (*GetMetadataActivity, bool) { + return nil, false +} + +// AsWebActivity is the BasicActivity implementation for AzureMLUpdateResourceActivity. +func (amura AzureMLUpdateResourceActivity) AsWebActivity() (*WebActivity, bool) { + return nil, false +} + +// AsLookupActivity is the BasicActivity implementation for AzureMLUpdateResourceActivity. +func (amura AzureMLUpdateResourceActivity) AsLookupActivity() (*LookupActivity, bool) { + return nil, false +} + +// AsSQLServerStoredProcedureActivity is the BasicActivity implementation for AzureMLUpdateResourceActivity. +func (amura AzureMLUpdateResourceActivity) AsSQLServerStoredProcedureActivity() (*SQLServerStoredProcedureActivity, bool) { + return nil, false +} + +// AsCustomActivity is the BasicActivity implementation for AzureMLUpdateResourceActivity. +func (amura AzureMLUpdateResourceActivity) AsCustomActivity() (*CustomActivity, bool) { + return nil, false +} + +// AsExecuteSSISPackageActivity is the BasicActivity implementation for AzureMLUpdateResourceActivity. +func (amura AzureMLUpdateResourceActivity) AsExecuteSSISPackageActivity() (*ExecuteSSISPackageActivity, bool) { + return nil, false +} + +// AsHDInsightSparkActivity is the BasicActivity implementation for AzureMLUpdateResourceActivity. +func (amura AzureMLUpdateResourceActivity) AsHDInsightSparkActivity() (*HDInsightSparkActivity, bool) { + return nil, false +} + +// AsHDInsightStreamingActivity is the BasicActivity implementation for AzureMLUpdateResourceActivity. +func (amura AzureMLUpdateResourceActivity) AsHDInsightStreamingActivity() (*HDInsightStreamingActivity, bool) { + return nil, false +} + +// AsHDInsightMapReduceActivity is the BasicActivity implementation for AzureMLUpdateResourceActivity. +func (amura AzureMLUpdateResourceActivity) AsHDInsightMapReduceActivity() (*HDInsightMapReduceActivity, bool) { + return nil, false +} + +// AsHDInsightPigActivity is the BasicActivity implementation for AzureMLUpdateResourceActivity. +func (amura AzureMLUpdateResourceActivity) AsHDInsightPigActivity() (*HDInsightPigActivity, bool) { + return nil, false +} + +// AsHDInsightHiveActivity is the BasicActivity implementation for AzureMLUpdateResourceActivity. +func (amura AzureMLUpdateResourceActivity) AsHDInsightHiveActivity() (*HDInsightHiveActivity, bool) { + return nil, false +} + +// AsCopyActivity is the BasicActivity implementation for AzureMLUpdateResourceActivity. +func (amura AzureMLUpdateResourceActivity) AsCopyActivity() (*CopyActivity, bool) { + return nil, false +} + +// AsExecutionActivity is the BasicActivity implementation for AzureMLUpdateResourceActivity. +func (amura AzureMLUpdateResourceActivity) AsExecutionActivity() (*ExecutionActivity, bool) { + return nil, false +} + +// AsBasicExecutionActivity is the BasicActivity implementation for AzureMLUpdateResourceActivity. +func (amura AzureMLUpdateResourceActivity) AsBasicExecutionActivity() (BasicExecutionActivity, bool) { + return &amura, true +} + +// AsFilterActivity is the BasicActivity implementation for AzureMLUpdateResourceActivity. +func (amura AzureMLUpdateResourceActivity) AsFilterActivity() (*FilterActivity, bool) { + return nil, false +} + +// AsUntilActivity is the BasicActivity implementation for AzureMLUpdateResourceActivity. +func (amura AzureMLUpdateResourceActivity) AsUntilActivity() (*UntilActivity, bool) { + return nil, false +} + +// AsWaitActivity is the BasicActivity implementation for AzureMLUpdateResourceActivity. +func (amura AzureMLUpdateResourceActivity) AsWaitActivity() (*WaitActivity, bool) { + return nil, false +} + +// AsForEachActivity is the BasicActivity implementation for AzureMLUpdateResourceActivity. +func (amura AzureMLUpdateResourceActivity) AsForEachActivity() (*ForEachActivity, bool) { + return nil, false +} + +// AsIfConditionActivity is the BasicActivity implementation for AzureMLUpdateResourceActivity. +func (amura AzureMLUpdateResourceActivity) AsIfConditionActivity() (*IfConditionActivity, bool) { + return nil, false +} + +// AsExecutePipelineActivity is the BasicActivity implementation for AzureMLUpdateResourceActivity. +func (amura AzureMLUpdateResourceActivity) AsExecutePipelineActivity() (*ExecutePipelineActivity, bool) { + return nil, false +} + +// AsControlActivity is the BasicActivity implementation for AzureMLUpdateResourceActivity. +func (amura AzureMLUpdateResourceActivity) AsControlActivity() (*ControlActivity, bool) { + return nil, false +} + +// AsBasicControlActivity is the BasicActivity implementation for AzureMLUpdateResourceActivity. +func (amura AzureMLUpdateResourceActivity) AsBasicControlActivity() (BasicControlActivity, bool) { + return nil, false +} + +// AsActivity is the BasicActivity implementation for AzureMLUpdateResourceActivity. +func (amura AzureMLUpdateResourceActivity) AsActivity() (*Activity, bool) { + return nil, false +} + +// AsBasicActivity is the BasicActivity implementation for AzureMLUpdateResourceActivity. +func (amura AzureMLUpdateResourceActivity) AsBasicActivity() (BasicActivity, bool) { + return &amura, true +} + +// UnmarshalJSON is the custom unmarshaler for AzureMLUpdateResourceActivity struct. +func (amura *AzureMLUpdateResourceActivity) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "typeProperties": + if v != nil { + var azureMLUpdateResourceActivityTypeProperties AzureMLUpdateResourceActivityTypeProperties + err = json.Unmarshal(*v, &azureMLUpdateResourceActivityTypeProperties) + if err != nil { + return err + } + amura.AzureMLUpdateResourceActivityTypeProperties = &azureMLUpdateResourceActivityTypeProperties + } + case "linkedServiceName": + if v != nil { + var linkedServiceName LinkedServiceReference + err = json.Unmarshal(*v, &linkedServiceName) + if err != nil { + return err + } + amura.LinkedServiceName = &linkedServiceName + } + case "policy": + if v != nil { + var policy ActivityPolicy + err = json.Unmarshal(*v, &policy) + if err != nil { + return err + } + amura.Policy = &policy + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if amura.AdditionalProperties == nil { + amura.AdditionalProperties = make(map[string]interface{}) + } + amura.AdditionalProperties[k] = additionalProperties + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + amura.Name = &name + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + amura.Description = &description + } + case "dependsOn": + if v != nil { + var dependsOn []ActivityDependency + err = json.Unmarshal(*v, &dependsOn) + if err != nil { + return err + } + amura.DependsOn = &dependsOn + } + case "userProperties": + if v != nil { + var userProperties map[string]*string + err = json.Unmarshal(*v, &userProperties) + if err != nil { + return err + } + amura.UserProperties = userProperties + } + case "type": + if v != nil { + var typeVar TypeBasicActivity + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + amura.Type = typeVar + } + } + } + + return nil +} + +// AzureMLUpdateResourceActivityTypeProperties azure ML Update Resource activity properties. +type AzureMLUpdateResourceActivityTypeProperties struct { + // TrainedModelName - Name of the Trained Model module in the Web Service experiment to be updated. Type: string (or Expression with resultType string). + TrainedModelName interface{} `json:"trainedModelName,omitempty"` + // TrainedModelLinkedServiceName - Name of Azure Storage linked service holding the .ilearner file that will be uploaded by the update operation. + TrainedModelLinkedServiceName *LinkedServiceReference `json:"trainedModelLinkedServiceName,omitempty"` + // TrainedModelFilePath - The relative file path in trainedModelLinkedService to represent the .ilearner file that will be uploaded by the update operation. Type: string (or Expression with resultType string). + TrainedModelFilePath interface{} `json:"trainedModelFilePath,omitempty"` +} + +// AzureMLWebServiceFile azure ML WebService Input/Output file +type AzureMLWebServiceFile struct { + // FilePath - The relative file path, including container name, in the Azure Blob Storage specified by the LinkedService. Type: string (or Expression with resultType string). + FilePath interface{} `json:"filePath,omitempty"` + // LinkedServiceName - Reference to an Azure Storage LinkedService, where Azure ML WebService Input/Output file located. + LinkedServiceName *LinkedServiceReference `json:"linkedServiceName,omitempty"` +} + +// AzureMySQLLinkedService azure MySQL database linked service. +type AzureMySQLLinkedService struct { + // AzureMySQLLinkedServiceTypeProperties - Azure MySQL database linked service properties. + *AzureMySQLLinkedServiceTypeProperties `json:"typeProperties,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // ConnectVia - The integration runtime reference. + ConnectVia *IntegrationRuntimeReference `json:"connectVia,omitempty"` + // Description - Linked service description. + Description *string `json:"description,omitempty"` + // Parameters - Parameters for linked service. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeLinkedService', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforce', 'TypeAzureDataLakeStore', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureStorage' + Type TypeBasicLinkedService `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureMySQLLinkedService. +func (amsls AzureMySQLLinkedService) MarshalJSON() ([]byte, error) { + amsls.Type = TypeAzureMySQL + objectMap := make(map[string]interface{}) + if amsls.AzureMySQLLinkedServiceTypeProperties != nil { + objectMap["typeProperties"] = amsls.AzureMySQLLinkedServiceTypeProperties + } + if amsls.ConnectVia != nil { + objectMap["connectVia"] = amsls.ConnectVia + } + if amsls.Description != nil { + objectMap["description"] = amsls.Description + } + if amsls.Parameters != nil { + objectMap["parameters"] = amsls.Parameters + } + if amsls.Annotations != nil { + objectMap["annotations"] = amsls.Annotations + } + if amsls.Type != "" { + objectMap["type"] = amsls.Type + } + for k, v := range amsls.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysLinkedService is the BasicLinkedService implementation for AzureMySQLLinkedService. +func (amsls AzureMySQLLinkedService) AsResponsysLinkedService() (*ResponsysLinkedService, bool) { + return nil, false +} + +// AsAzureDatabricksLinkedService is the BasicLinkedService implementation for AzureMySQLLinkedService. +func (amsls AzureMySQLLinkedService) AsAzureDatabricksLinkedService() (*AzureDatabricksLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeAnalyticsLinkedService is the BasicLinkedService implementation for AzureMySQLLinkedService. +func (amsls AzureMySQLLinkedService) AsAzureDataLakeAnalyticsLinkedService() (*AzureDataLakeAnalyticsLinkedService, bool) { + return nil, false +} + +// AsHDInsightOnDemandLinkedService is the BasicLinkedService implementation for AzureMySQLLinkedService. +func (amsls AzureMySQLLinkedService) AsHDInsightOnDemandLinkedService() (*HDInsightOnDemandLinkedService, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudLinkedService is the BasicLinkedService implementation for AzureMySQLLinkedService. +func (amsls AzureMySQLLinkedService) AsSalesforceMarketingCloudLinkedService() (*SalesforceMarketingCloudLinkedService, bool) { + return nil, false +} + +// AsNetezzaLinkedService is the BasicLinkedService implementation for AzureMySQLLinkedService. +func (amsls AzureMySQLLinkedService) AsNetezzaLinkedService() (*NetezzaLinkedService, bool) { + return nil, false +} + +// AsVerticaLinkedService is the BasicLinkedService implementation for AzureMySQLLinkedService. +func (amsls AzureMySQLLinkedService) AsVerticaLinkedService() (*VerticaLinkedService, bool) { + return nil, false +} + +// AsZohoLinkedService is the BasicLinkedService implementation for AzureMySQLLinkedService. +func (amsls AzureMySQLLinkedService) AsZohoLinkedService() (*ZohoLinkedService, bool) { + return nil, false +} + +// AsXeroLinkedService is the BasicLinkedService implementation for AzureMySQLLinkedService. +func (amsls AzureMySQLLinkedService) AsXeroLinkedService() (*XeroLinkedService, bool) { + return nil, false +} + +// AsSquareLinkedService is the BasicLinkedService implementation for AzureMySQLLinkedService. +func (amsls AzureMySQLLinkedService) AsSquareLinkedService() (*SquareLinkedService, bool) { + return nil, false +} + +// AsSparkLinkedService is the BasicLinkedService implementation for AzureMySQLLinkedService. +func (amsls AzureMySQLLinkedService) AsSparkLinkedService() (*SparkLinkedService, bool) { + return nil, false +} + +// AsShopifyLinkedService is the BasicLinkedService implementation for AzureMySQLLinkedService. +func (amsls AzureMySQLLinkedService) AsShopifyLinkedService() (*ShopifyLinkedService, bool) { + return nil, false +} + +// AsServiceNowLinkedService is the BasicLinkedService implementation for AzureMySQLLinkedService. +func (amsls AzureMySQLLinkedService) AsServiceNowLinkedService() (*ServiceNowLinkedService, bool) { + return nil, false +} + +// AsQuickBooksLinkedService is the BasicLinkedService implementation for AzureMySQLLinkedService. +func (amsls AzureMySQLLinkedService) AsQuickBooksLinkedService() (*QuickBooksLinkedService, bool) { + return nil, false +} + +// AsPrestoLinkedService is the BasicLinkedService implementation for AzureMySQLLinkedService. +func (amsls AzureMySQLLinkedService) AsPrestoLinkedService() (*PrestoLinkedService, bool) { + return nil, false +} + +// AsPhoenixLinkedService is the BasicLinkedService implementation for AzureMySQLLinkedService. +func (amsls AzureMySQLLinkedService) AsPhoenixLinkedService() (*PhoenixLinkedService, bool) { + return nil, false +} + +// AsPaypalLinkedService is the BasicLinkedService implementation for AzureMySQLLinkedService. +func (amsls AzureMySQLLinkedService) AsPaypalLinkedService() (*PaypalLinkedService, bool) { + return nil, false +} + +// AsMarketoLinkedService is the BasicLinkedService implementation for AzureMySQLLinkedService. +func (amsls AzureMySQLLinkedService) AsMarketoLinkedService() (*MarketoLinkedService, bool) { + return nil, false +} + +// AsMariaDBLinkedService is the BasicLinkedService implementation for AzureMySQLLinkedService. +func (amsls AzureMySQLLinkedService) AsMariaDBLinkedService() (*MariaDBLinkedService, bool) { + return nil, false +} + +// AsMagentoLinkedService is the BasicLinkedService implementation for AzureMySQLLinkedService. +func (amsls AzureMySQLLinkedService) AsMagentoLinkedService() (*MagentoLinkedService, bool) { + return nil, false +} + +// AsJiraLinkedService is the BasicLinkedService implementation for AzureMySQLLinkedService. +func (amsls AzureMySQLLinkedService) AsJiraLinkedService() (*JiraLinkedService, bool) { + return nil, false +} + +// AsImpalaLinkedService is the BasicLinkedService implementation for AzureMySQLLinkedService. +func (amsls AzureMySQLLinkedService) AsImpalaLinkedService() (*ImpalaLinkedService, bool) { + return nil, false +} + +// AsHubspotLinkedService is the BasicLinkedService implementation for AzureMySQLLinkedService. +func (amsls AzureMySQLLinkedService) AsHubspotLinkedService() (*HubspotLinkedService, bool) { + return nil, false +} + +// AsHiveLinkedService is the BasicLinkedService implementation for AzureMySQLLinkedService. +func (amsls AzureMySQLLinkedService) AsHiveLinkedService() (*HiveLinkedService, bool) { + return nil, false +} + +// AsHBaseLinkedService is the BasicLinkedService implementation for AzureMySQLLinkedService. +func (amsls AzureMySQLLinkedService) AsHBaseLinkedService() (*HBaseLinkedService, bool) { + return nil, false +} + +// AsGreenplumLinkedService is the BasicLinkedService implementation for AzureMySQLLinkedService. +func (amsls AzureMySQLLinkedService) AsGreenplumLinkedService() (*GreenplumLinkedService, bool) { + return nil, false +} + +// AsGoogleBigQueryLinkedService is the BasicLinkedService implementation for AzureMySQLLinkedService. +func (amsls AzureMySQLLinkedService) AsGoogleBigQueryLinkedService() (*GoogleBigQueryLinkedService, bool) { + return nil, false +} + +// AsEloquaLinkedService is the BasicLinkedService implementation for AzureMySQLLinkedService. +func (amsls AzureMySQLLinkedService) AsEloquaLinkedService() (*EloquaLinkedService, bool) { + return nil, false +} + +// AsDrillLinkedService is the BasicLinkedService implementation for AzureMySQLLinkedService. +func (amsls AzureMySQLLinkedService) AsDrillLinkedService() (*DrillLinkedService, bool) { + return nil, false +} + +// AsCouchbaseLinkedService is the BasicLinkedService implementation for AzureMySQLLinkedService. +func (amsls AzureMySQLLinkedService) AsCouchbaseLinkedService() (*CouchbaseLinkedService, bool) { + return nil, false +} + +// AsConcurLinkedService is the BasicLinkedService implementation for AzureMySQLLinkedService. +func (amsls AzureMySQLLinkedService) AsConcurLinkedService() (*ConcurLinkedService, bool) { + return nil, false +} + +// AsAzurePostgreSQLLinkedService is the BasicLinkedService implementation for AzureMySQLLinkedService. +func (amsls AzureMySQLLinkedService) AsAzurePostgreSQLLinkedService() (*AzurePostgreSQLLinkedService, bool) { + return nil, false +} + +// AsAmazonMWSLinkedService is the BasicLinkedService implementation for AzureMySQLLinkedService. +func (amsls AzureMySQLLinkedService) AsAmazonMWSLinkedService() (*AmazonMWSLinkedService, bool) { + return nil, false +} + +// AsSapHanaLinkedService is the BasicLinkedService implementation for AzureMySQLLinkedService. +func (amsls AzureMySQLLinkedService) AsSapHanaLinkedService() (*SapHanaLinkedService, bool) { + return nil, false +} + +// AsSapBWLinkedService is the BasicLinkedService implementation for AzureMySQLLinkedService. +func (amsls AzureMySQLLinkedService) AsSapBWLinkedService() (*SapBWLinkedService, bool) { + return nil, false +} + +// AsSftpServerLinkedService is the BasicLinkedService implementation for AzureMySQLLinkedService. +func (amsls AzureMySQLLinkedService) AsSftpServerLinkedService() (*SftpServerLinkedService, bool) { + return nil, false +} + +// AsFtpServerLinkedService is the BasicLinkedService implementation for AzureMySQLLinkedService. +func (amsls AzureMySQLLinkedService) AsFtpServerLinkedService() (*FtpServerLinkedService, bool) { + return nil, false +} + +// AsHTTPLinkedService is the BasicLinkedService implementation for AzureMySQLLinkedService. +func (amsls AzureMySQLLinkedService) AsHTTPLinkedService() (*HTTPLinkedService, bool) { + return nil, false +} + +// AsAzureSearchLinkedService is the BasicLinkedService implementation for AzureMySQLLinkedService. +func (amsls AzureMySQLLinkedService) AsAzureSearchLinkedService() (*AzureSearchLinkedService, bool) { + return nil, false +} + +// AsCustomDataSourceLinkedService is the BasicLinkedService implementation for AzureMySQLLinkedService. +func (amsls AzureMySQLLinkedService) AsCustomDataSourceLinkedService() (*CustomDataSourceLinkedService, bool) { + return nil, false +} + +// AsAmazonRedshiftLinkedService is the BasicLinkedService implementation for AzureMySQLLinkedService. +func (amsls AzureMySQLLinkedService) AsAmazonRedshiftLinkedService() (*AmazonRedshiftLinkedService, bool) { + return nil, false +} + +// AsAmazonS3LinkedService is the BasicLinkedService implementation for AzureMySQLLinkedService. +func (amsls AzureMySQLLinkedService) AsAmazonS3LinkedService() (*AmazonS3LinkedService, bool) { + return nil, false +} + +// AsSapEccLinkedService is the BasicLinkedService implementation for AzureMySQLLinkedService. +func (amsls AzureMySQLLinkedService) AsSapEccLinkedService() (*SapEccLinkedService, bool) { + return nil, false +} + +// AsSapCloudForCustomerLinkedService is the BasicLinkedService implementation for AzureMySQLLinkedService. +func (amsls AzureMySQLLinkedService) AsSapCloudForCustomerLinkedService() (*SapCloudForCustomerLinkedService, bool) { + return nil, false +} + +// AsSalesforceLinkedService is the BasicLinkedService implementation for AzureMySQLLinkedService. +func (amsls AzureMySQLLinkedService) AsSalesforceLinkedService() (*SalesforceLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeStoreLinkedService is the BasicLinkedService implementation for AzureMySQLLinkedService. +func (amsls AzureMySQLLinkedService) AsAzureDataLakeStoreLinkedService() (*AzureDataLakeStoreLinkedService, bool) { + return nil, false +} + +// AsMongoDbLinkedService is the BasicLinkedService implementation for AzureMySQLLinkedService. +func (amsls AzureMySQLLinkedService) AsMongoDbLinkedService() (*MongoDbLinkedService, bool) { + return nil, false +} + +// AsCassandraLinkedService is the BasicLinkedService implementation for AzureMySQLLinkedService. +func (amsls AzureMySQLLinkedService) AsCassandraLinkedService() (*CassandraLinkedService, bool) { + return nil, false +} + +// AsWebLinkedService is the BasicLinkedService implementation for AzureMySQLLinkedService. +func (amsls AzureMySQLLinkedService) AsWebLinkedService() (*WebLinkedService, bool) { + return nil, false +} + +// AsODataLinkedService is the BasicLinkedService implementation for AzureMySQLLinkedService. +func (amsls AzureMySQLLinkedService) AsODataLinkedService() (*ODataLinkedService, bool) { + return nil, false +} + +// AsHdfsLinkedService is the BasicLinkedService implementation for AzureMySQLLinkedService. +func (amsls AzureMySQLLinkedService) AsHdfsLinkedService() (*HdfsLinkedService, bool) { + return nil, false +} + +// AsOdbcLinkedService is the BasicLinkedService implementation for AzureMySQLLinkedService. +func (amsls AzureMySQLLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, bool) { + return nil, false +} + +// AsAzureMLLinkedService is the BasicLinkedService implementation for AzureMySQLLinkedService. +func (amsls AzureMySQLLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { + return nil, false +} + +// AsTeradataLinkedService is the BasicLinkedService implementation for AzureMySQLLinkedService. +func (amsls AzureMySQLLinkedService) AsTeradataLinkedService() (*TeradataLinkedService, bool) { + return nil, false +} + +// AsDb2LinkedService is the BasicLinkedService implementation for AzureMySQLLinkedService. +func (amsls AzureMySQLLinkedService) AsDb2LinkedService() (*Db2LinkedService, bool) { + return nil, false +} + +// AsSybaseLinkedService is the BasicLinkedService implementation for AzureMySQLLinkedService. +func (amsls AzureMySQLLinkedService) AsSybaseLinkedService() (*SybaseLinkedService, bool) { + return nil, false +} + +// AsPostgreSQLLinkedService is the BasicLinkedService implementation for AzureMySQLLinkedService. +func (amsls AzureMySQLLinkedService) AsPostgreSQLLinkedService() (*PostgreSQLLinkedService, bool) { + return nil, false +} + +// AsMySQLLinkedService is the BasicLinkedService implementation for AzureMySQLLinkedService. +func (amsls AzureMySQLLinkedService) AsMySQLLinkedService() (*MySQLLinkedService, bool) { + return nil, false +} + +// AsAzureMySQLLinkedService is the BasicLinkedService implementation for AzureMySQLLinkedService. +func (amsls AzureMySQLLinkedService) AsAzureMySQLLinkedService() (*AzureMySQLLinkedService, bool) { + return &amsls, true +} + +// AsOracleLinkedService is the BasicLinkedService implementation for AzureMySQLLinkedService. +func (amsls AzureMySQLLinkedService) AsOracleLinkedService() (*OracleLinkedService, bool) { + return nil, false +} + +// AsFileServerLinkedService is the BasicLinkedService implementation for AzureMySQLLinkedService. +func (amsls AzureMySQLLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { + return nil, false +} + +// AsHDInsightLinkedService is the BasicLinkedService implementation for AzureMySQLLinkedService. +func (amsls AzureMySQLLinkedService) AsHDInsightLinkedService() (*HDInsightLinkedService, bool) { + return nil, false +} + +// AsDynamicsLinkedService is the BasicLinkedService implementation for AzureMySQLLinkedService. +func (amsls AzureMySQLLinkedService) AsDynamicsLinkedService() (*DynamicsLinkedService, bool) { + return nil, false +} + +// AsCosmosDbLinkedService is the BasicLinkedService implementation for AzureMySQLLinkedService. +func (amsls AzureMySQLLinkedService) AsCosmosDbLinkedService() (*CosmosDbLinkedService, bool) { + return nil, false +} + +// AsAzureKeyVaultLinkedService is the BasicLinkedService implementation for AzureMySQLLinkedService. +func (amsls AzureMySQLLinkedService) AsAzureKeyVaultLinkedService() (*AzureKeyVaultLinkedService, bool) { + return nil, false +} + +// AsAzureBatchLinkedService is the BasicLinkedService implementation for AzureMySQLLinkedService. +func (amsls AzureMySQLLinkedService) AsAzureBatchLinkedService() (*AzureBatchLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDatabaseLinkedService is the BasicLinkedService implementation for AzureMySQLLinkedService. +func (amsls AzureMySQLLinkedService) AsAzureSQLDatabaseLinkedService() (*AzureSQLDatabaseLinkedService, bool) { + return nil, false +} + +// AsSQLServerLinkedService is the BasicLinkedService implementation for AzureMySQLLinkedService. +func (amsls AzureMySQLLinkedService) AsSQLServerLinkedService() (*SQLServerLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDWLinkedService is the BasicLinkedService implementation for AzureMySQLLinkedService. +func (amsls AzureMySQLLinkedService) AsAzureSQLDWLinkedService() (*AzureSQLDWLinkedService, bool) { + return nil, false +} + +// AsAzureStorageLinkedService is the BasicLinkedService implementation for AzureMySQLLinkedService. +func (amsls AzureMySQLLinkedService) AsAzureStorageLinkedService() (*AzureStorageLinkedService, bool) { + return nil, false +} + +// AsLinkedService is the BasicLinkedService implementation for AzureMySQLLinkedService. +func (amsls AzureMySQLLinkedService) AsLinkedService() (*LinkedService, bool) { + return nil, false +} + +// AsBasicLinkedService is the BasicLinkedService implementation for AzureMySQLLinkedService. +func (amsls AzureMySQLLinkedService) AsBasicLinkedService() (BasicLinkedService, bool) { + return &amsls, true +} + +// UnmarshalJSON is the custom unmarshaler for AzureMySQLLinkedService struct. +func (amsls *AzureMySQLLinkedService) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "typeProperties": + if v != nil { + var azureMySQLLinkedServiceTypeProperties AzureMySQLLinkedServiceTypeProperties + err = json.Unmarshal(*v, &azureMySQLLinkedServiceTypeProperties) + if err != nil { + return err + } + amsls.AzureMySQLLinkedServiceTypeProperties = &azureMySQLLinkedServiceTypeProperties + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if amsls.AdditionalProperties == nil { + amsls.AdditionalProperties = make(map[string]interface{}) + } + amsls.AdditionalProperties[k] = additionalProperties + } + case "connectVia": + if v != nil { + var connectVia IntegrationRuntimeReference + err = json.Unmarshal(*v, &connectVia) + if err != nil { + return err + } + amsls.ConnectVia = &connectVia + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + amsls.Description = &description + } + case "parameters": + if v != nil { + var parameters map[string]*ParameterSpecification + err = json.Unmarshal(*v, ¶meters) + if err != nil { + return err + } + amsls.Parameters = parameters + } + case "annotations": + if v != nil { + var annotations []interface{} + err = json.Unmarshal(*v, &annotations) + if err != nil { + return err + } + amsls.Annotations = &annotations + } + case "type": + if v != nil { + var typeVar TypeBasicLinkedService + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + amsls.Type = typeVar + } + } + } + + return nil +} + +// AzureMySQLLinkedServiceTypeProperties azure MySQL database linked service properties. +type AzureMySQLLinkedServiceTypeProperties struct { + // ConnectionString - The connection string. Type: string, SecureString or AzureKeyVaultSecretReference. + ConnectionString interface{} `json:"connectionString,omitempty"` + // EncryptedCredential - The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string). + EncryptedCredential interface{} `json:"encryptedCredential,omitempty"` +} + +// AzureMySQLSource a copy activity Azure MySQL source. +type AzureMySQLSource struct { + // Query - Database query. Type: string (or Expression with resultType string). + Query interface{} `json:"query,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // SourceRetryCount - Source retry count. Type: integer (or Expression with resultType integer). + SourceRetryCount interface{} `json:"sourceRetryCount,omitempty"` + // SourceRetryWait - Source retry wait. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` + // Type - Possible values include: 'TypeCopySource', 'TypeAmazonRedshiftSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeHTTPSource', 'TypeAzureDataLakeStoreSource', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeRelationalSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource' + Type TypeBasicCopySource `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureMySQLSource. +func (amss AzureMySQLSource) MarshalJSON() ([]byte, error) { + amss.Type = TypeAzureMySQLSource + objectMap := make(map[string]interface{}) + objectMap["query"] = amss.Query + objectMap["sourceRetryCount"] = amss.SourceRetryCount + objectMap["sourceRetryWait"] = amss.SourceRetryWait + if amss.Type != "" { + objectMap["type"] = amss.Type + } + for k, v := range amss.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsAmazonRedshiftSource is the BasicCopySource implementation for AzureMySQLSource. +func (amss AzureMySQLSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { + return nil, false +} + +// AsResponsysSource is the BasicCopySource implementation for AzureMySQLSource. +func (amss AzureMySQLSource) AsResponsysSource() (*ResponsysSource, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudSource is the BasicCopySource implementation for AzureMySQLSource. +func (amss AzureMySQLSource) AsSalesforceMarketingCloudSource() (*SalesforceMarketingCloudSource, bool) { + return nil, false +} + +// AsVerticaSource is the BasicCopySource implementation for AzureMySQLSource. +func (amss AzureMySQLSource) AsVerticaSource() (*VerticaSource, bool) { + return nil, false +} + +// AsNetezzaSource is the BasicCopySource implementation for AzureMySQLSource. +func (amss AzureMySQLSource) AsNetezzaSource() (*NetezzaSource, bool) { + return nil, false +} + +// AsZohoSource is the BasicCopySource implementation for AzureMySQLSource. +func (amss AzureMySQLSource) AsZohoSource() (*ZohoSource, bool) { + return nil, false +} + +// AsXeroSource is the BasicCopySource implementation for AzureMySQLSource. +func (amss AzureMySQLSource) AsXeroSource() (*XeroSource, bool) { + return nil, false +} + +// AsSquareSource is the BasicCopySource implementation for AzureMySQLSource. +func (amss AzureMySQLSource) AsSquareSource() (*SquareSource, bool) { + return nil, false +} + +// AsSparkSource is the BasicCopySource implementation for AzureMySQLSource. +func (amss AzureMySQLSource) AsSparkSource() (*SparkSource, bool) { + return nil, false +} + +// AsShopifySource is the BasicCopySource implementation for AzureMySQLSource. +func (amss AzureMySQLSource) AsShopifySource() (*ShopifySource, bool) { + return nil, false +} + +// AsServiceNowSource is the BasicCopySource implementation for AzureMySQLSource. +func (amss AzureMySQLSource) AsServiceNowSource() (*ServiceNowSource, bool) { + return nil, false +} + +// AsQuickBooksSource is the BasicCopySource implementation for AzureMySQLSource. +func (amss AzureMySQLSource) AsQuickBooksSource() (*QuickBooksSource, bool) { + return nil, false +} + +// AsPrestoSource is the BasicCopySource implementation for AzureMySQLSource. +func (amss AzureMySQLSource) AsPrestoSource() (*PrestoSource, bool) { + return nil, false +} + +// AsPhoenixSource is the BasicCopySource implementation for AzureMySQLSource. +func (amss AzureMySQLSource) AsPhoenixSource() (*PhoenixSource, bool) { + return nil, false +} + +// AsPaypalSource is the BasicCopySource implementation for AzureMySQLSource. +func (amss AzureMySQLSource) AsPaypalSource() (*PaypalSource, bool) { + return nil, false +} + +// AsMarketoSource is the BasicCopySource implementation for AzureMySQLSource. +func (amss AzureMySQLSource) AsMarketoSource() (*MarketoSource, bool) { + return nil, false +} + +// AsMariaDBSource is the BasicCopySource implementation for AzureMySQLSource. +func (amss AzureMySQLSource) AsMariaDBSource() (*MariaDBSource, bool) { + return nil, false +} + +// AsMagentoSource is the BasicCopySource implementation for AzureMySQLSource. +func (amss AzureMySQLSource) AsMagentoSource() (*MagentoSource, bool) { + return nil, false +} + +// AsJiraSource is the BasicCopySource implementation for AzureMySQLSource. +func (amss AzureMySQLSource) AsJiraSource() (*JiraSource, bool) { + return nil, false +} + +// AsImpalaSource is the BasicCopySource implementation for AzureMySQLSource. +func (amss AzureMySQLSource) AsImpalaSource() (*ImpalaSource, bool) { + return nil, false +} + +// AsHubspotSource is the BasicCopySource implementation for AzureMySQLSource. +func (amss AzureMySQLSource) AsHubspotSource() (*HubspotSource, bool) { + return nil, false +} + +// AsHiveSource is the BasicCopySource implementation for AzureMySQLSource. +func (amss AzureMySQLSource) AsHiveSource() (*HiveSource, bool) { + return nil, false +} + +// AsHBaseSource is the BasicCopySource implementation for AzureMySQLSource. +func (amss AzureMySQLSource) AsHBaseSource() (*HBaseSource, bool) { + return nil, false +} + +// AsGreenplumSource is the BasicCopySource implementation for AzureMySQLSource. +func (amss AzureMySQLSource) AsGreenplumSource() (*GreenplumSource, bool) { + return nil, false +} + +// AsGoogleBigQuerySource is the BasicCopySource implementation for AzureMySQLSource. +func (amss AzureMySQLSource) AsGoogleBigQuerySource() (*GoogleBigQuerySource, bool) { + return nil, false +} + +// AsEloquaSource is the BasicCopySource implementation for AzureMySQLSource. +func (amss AzureMySQLSource) AsEloquaSource() (*EloquaSource, bool) { + return nil, false +} + +// AsDrillSource is the BasicCopySource implementation for AzureMySQLSource. +func (amss AzureMySQLSource) AsDrillSource() (*DrillSource, bool) { + return nil, false +} + +// AsCouchbaseSource is the BasicCopySource implementation for AzureMySQLSource. +func (amss AzureMySQLSource) AsCouchbaseSource() (*CouchbaseSource, bool) { + return nil, false +} + +// AsConcurSource is the BasicCopySource implementation for AzureMySQLSource. +func (amss AzureMySQLSource) AsConcurSource() (*ConcurSource, bool) { + return nil, false +} + +// AsAzurePostgreSQLSource is the BasicCopySource implementation for AzureMySQLSource. +func (amss AzureMySQLSource) AsAzurePostgreSQLSource() (*AzurePostgreSQLSource, bool) { + return nil, false +} + +// AsAmazonMWSSource is the BasicCopySource implementation for AzureMySQLSource. +func (amss AzureMySQLSource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { + return nil, false +} + +// AsHTTPSource is the BasicCopySource implementation for AzureMySQLSource. +func (amss AzureMySQLSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for AzureMySQLSource. +func (amss AzureMySQLSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for AzureMySQLSource. +func (amss AzureMySQLSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsCassandraSource is the BasicCopySource implementation for AzureMySQLSource. +func (amss AzureMySQLSource) AsCassandraSource() (*CassandraSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for AzureMySQLSource. +func (amss AzureMySQLSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for AzureMySQLSource. +func (amss AzureMySQLSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureMySQLSource is the BasicCopySource implementation for AzureMySQLSource. +func (amss AzureMySQLSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { + return &amss, true +} + +// AsHdfsSource is the BasicCopySource implementation for AzureMySQLSource. +func (amss AzureMySQLSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for AzureMySQLSource. +func (amss AzureMySQLSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsSQLDWSource is the BasicCopySource implementation for AzureMySQLSource. +func (amss AzureMySQLSource) AsSQLDWSource() (*SQLDWSource, bool) { + return nil, false +} + +// AsSQLSource is the BasicCopySource implementation for AzureMySQLSource. +func (amss AzureMySQLSource) AsSQLSource() (*SQLSource, bool) { + return nil, false +} + +// AsSapEccSource is the BasicCopySource implementation for AzureMySQLSource. +func (amss AzureMySQLSource) AsSapEccSource() (*SapEccSource, bool) { + return nil, false +} + +// AsSapCloudForCustomerSource is the BasicCopySource implementation for AzureMySQLSource. +func (amss AzureMySQLSource) AsSapCloudForCustomerSource() (*SapCloudForCustomerSource, bool) { + return nil, false +} + +// AsSalesforceSource is the BasicCopySource implementation for AzureMySQLSource. +func (amss AzureMySQLSource) AsSalesforceSource() (*SalesforceSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for AzureMySQLSource. +func (amss AzureMySQLSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for AzureMySQLSource. +func (amss AzureMySQLSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for AzureMySQLSource. +func (amss AzureMySQLSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for AzureMySQLSource. +func (amss AzureMySQLSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + +// AsAzureTableSource is the BasicCopySource implementation for AzureMySQLSource. +func (amss AzureMySQLSource) AsAzureTableSource() (*AzureTableSource, bool) { + return nil, false +} + +// AsCopySource is the BasicCopySource implementation for AzureMySQLSource. +func (amss AzureMySQLSource) AsCopySource() (*CopySource, bool) { + return nil, false +} + +// AsBasicCopySource is the BasicCopySource implementation for AzureMySQLSource. +func (amss AzureMySQLSource) AsBasicCopySource() (BasicCopySource, bool) { + return &amss, true +} + +// AzureMySQLTableDataset the Azure MySQL database dataset. +type AzureMySQLTableDataset struct { + // AzureMySQLTableDatasetTypeProperties - Azure MySQL database dataset properties. + *AzureMySQLTableDatasetTypeProperties `json:"typeProperties,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Description - Dataset description. + Description *string `json:"description,omitempty"` + // Structure - Columns that define the structure of the dataset. Type: array (or Expression with resultType array), itemType: DatasetDataElement. + Structure interface{} `json:"structure,omitempty"` + // LinkedServiceName - Linked service reference. + LinkedServiceName *LinkedServiceReference `json:"linkedServiceName,omitempty"` + // Parameters - Parameters for dataset. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeDataset', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSQLServerTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSalesforceObject', 'TypeRelationalTable', 'TypeAzureMySQLTable', 'TypeOracleTable', 'TypeODataResource', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeAzureDataLakeStoreFile', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeAmazonS3Object' + Type TypeBasicDataset `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureMySQLTableDataset. +func (amstd AzureMySQLTableDataset) MarshalJSON() ([]byte, error) { + amstd.Type = TypeAzureMySQLTable + objectMap := make(map[string]interface{}) + if amstd.AzureMySQLTableDatasetTypeProperties != nil { + objectMap["typeProperties"] = amstd.AzureMySQLTableDatasetTypeProperties + } + if amstd.Description != nil { + objectMap["description"] = amstd.Description + } + objectMap["structure"] = amstd.Structure + if amstd.LinkedServiceName != nil { + objectMap["linkedServiceName"] = amstd.LinkedServiceName + } + if amstd.Parameters != nil { + objectMap["parameters"] = amstd.Parameters + } + if amstd.Annotations != nil { + objectMap["annotations"] = amstd.Annotations + } + if amstd.Type != "" { + objectMap["type"] = amstd.Type + } + for k, v := range amstd.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysObjectDataset is the BasicDataset implementation for AzureMySQLTableDataset. +func (amstd AzureMySQLTableDataset) AsResponsysObjectDataset() (*ResponsysObjectDataset, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudObjectDataset is the BasicDataset implementation for AzureMySQLTableDataset. +func (amstd AzureMySQLTableDataset) AsSalesforceMarketingCloudObjectDataset() (*SalesforceMarketingCloudObjectDataset, bool) { + return nil, false +} + +// AsVerticaTableDataset is the BasicDataset implementation for AzureMySQLTableDataset. +func (amstd AzureMySQLTableDataset) AsVerticaTableDataset() (*VerticaTableDataset, bool) { + return nil, false +} + +// AsNetezzaTableDataset is the BasicDataset implementation for AzureMySQLTableDataset. +func (amstd AzureMySQLTableDataset) AsNetezzaTableDataset() (*NetezzaTableDataset, bool) { + return nil, false +} + +// AsZohoObjectDataset is the BasicDataset implementation for AzureMySQLTableDataset. +func (amstd AzureMySQLTableDataset) AsZohoObjectDataset() (*ZohoObjectDataset, bool) { + return nil, false +} + +// AsXeroObjectDataset is the BasicDataset implementation for AzureMySQLTableDataset. +func (amstd AzureMySQLTableDataset) AsXeroObjectDataset() (*XeroObjectDataset, bool) { + return nil, false +} + +// AsSquareObjectDataset is the BasicDataset implementation for AzureMySQLTableDataset. +func (amstd AzureMySQLTableDataset) AsSquareObjectDataset() (*SquareObjectDataset, bool) { + return nil, false +} + +// AsSparkObjectDataset is the BasicDataset implementation for AzureMySQLTableDataset. +func (amstd AzureMySQLTableDataset) AsSparkObjectDataset() (*SparkObjectDataset, bool) { + return nil, false +} + +// AsShopifyObjectDataset is the BasicDataset implementation for AzureMySQLTableDataset. +func (amstd AzureMySQLTableDataset) AsShopifyObjectDataset() (*ShopifyObjectDataset, bool) { + return nil, false +} + +// AsServiceNowObjectDataset is the BasicDataset implementation for AzureMySQLTableDataset. +func (amstd AzureMySQLTableDataset) AsServiceNowObjectDataset() (*ServiceNowObjectDataset, bool) { + return nil, false +} + +// AsQuickBooksObjectDataset is the BasicDataset implementation for AzureMySQLTableDataset. +func (amstd AzureMySQLTableDataset) AsQuickBooksObjectDataset() (*QuickBooksObjectDataset, bool) { + return nil, false +} + +// AsPrestoObjectDataset is the BasicDataset implementation for AzureMySQLTableDataset. +func (amstd AzureMySQLTableDataset) AsPrestoObjectDataset() (*PrestoObjectDataset, bool) { + return nil, false +} + +// AsPhoenixObjectDataset is the BasicDataset implementation for AzureMySQLTableDataset. +func (amstd AzureMySQLTableDataset) AsPhoenixObjectDataset() (*PhoenixObjectDataset, bool) { + return nil, false +} + +// AsPaypalObjectDataset is the BasicDataset implementation for AzureMySQLTableDataset. +func (amstd AzureMySQLTableDataset) AsPaypalObjectDataset() (*PaypalObjectDataset, bool) { + return nil, false +} + +// AsMarketoObjectDataset is the BasicDataset implementation for AzureMySQLTableDataset. +func (amstd AzureMySQLTableDataset) AsMarketoObjectDataset() (*MarketoObjectDataset, bool) { + return nil, false +} + +// AsMariaDBTableDataset is the BasicDataset implementation for AzureMySQLTableDataset. +func (amstd AzureMySQLTableDataset) AsMariaDBTableDataset() (*MariaDBTableDataset, bool) { + return nil, false +} + +// AsMagentoObjectDataset is the BasicDataset implementation for AzureMySQLTableDataset. +func (amstd AzureMySQLTableDataset) AsMagentoObjectDataset() (*MagentoObjectDataset, bool) { + return nil, false +} + +// AsJiraObjectDataset is the BasicDataset implementation for AzureMySQLTableDataset. +func (amstd AzureMySQLTableDataset) AsJiraObjectDataset() (*JiraObjectDataset, bool) { + return nil, false +} + +// AsImpalaObjectDataset is the BasicDataset implementation for AzureMySQLTableDataset. +func (amstd AzureMySQLTableDataset) AsImpalaObjectDataset() (*ImpalaObjectDataset, bool) { + return nil, false +} + +// AsHubspotObjectDataset is the BasicDataset implementation for AzureMySQLTableDataset. +func (amstd AzureMySQLTableDataset) AsHubspotObjectDataset() (*HubspotObjectDataset, bool) { + return nil, false +} + +// AsHiveObjectDataset is the BasicDataset implementation for AzureMySQLTableDataset. +func (amstd AzureMySQLTableDataset) AsHiveObjectDataset() (*HiveObjectDataset, bool) { + return nil, false +} + +// AsHBaseObjectDataset is the BasicDataset implementation for AzureMySQLTableDataset. +func (amstd AzureMySQLTableDataset) AsHBaseObjectDataset() (*HBaseObjectDataset, bool) { + return nil, false +} + +// AsGreenplumTableDataset is the BasicDataset implementation for AzureMySQLTableDataset. +func (amstd AzureMySQLTableDataset) AsGreenplumTableDataset() (*GreenplumTableDataset, bool) { + return nil, false +} + +// AsGoogleBigQueryObjectDataset is the BasicDataset implementation for AzureMySQLTableDataset. +func (amstd AzureMySQLTableDataset) AsGoogleBigQueryObjectDataset() (*GoogleBigQueryObjectDataset, bool) { + return nil, false +} + +// AsEloquaObjectDataset is the BasicDataset implementation for AzureMySQLTableDataset. +func (amstd AzureMySQLTableDataset) AsEloquaObjectDataset() (*EloquaObjectDataset, bool) { + return nil, false +} + +// AsDrillTableDataset is the BasicDataset implementation for AzureMySQLTableDataset. +func (amstd AzureMySQLTableDataset) AsDrillTableDataset() (*DrillTableDataset, bool) { + return nil, false +} + +// AsCouchbaseTableDataset is the BasicDataset implementation for AzureMySQLTableDataset. +func (amstd AzureMySQLTableDataset) AsCouchbaseTableDataset() (*CouchbaseTableDataset, bool) { + return nil, false +} + +// AsConcurObjectDataset is the BasicDataset implementation for AzureMySQLTableDataset. +func (amstd AzureMySQLTableDataset) AsConcurObjectDataset() (*ConcurObjectDataset, bool) { + return nil, false +} + +// AsAzurePostgreSQLTableDataset is the BasicDataset implementation for AzureMySQLTableDataset. +func (amstd AzureMySQLTableDataset) AsAzurePostgreSQLTableDataset() (*AzurePostgreSQLTableDataset, bool) { + return nil, false +} + +// AsAmazonMWSObjectDataset is the BasicDataset implementation for AzureMySQLTableDataset. +func (amstd AzureMySQLTableDataset) AsAmazonMWSObjectDataset() (*AmazonMWSObjectDataset, bool) { + return nil, false +} + +// AsHTTPDataset is the BasicDataset implementation for AzureMySQLTableDataset. +func (amstd AzureMySQLTableDataset) AsHTTPDataset() (*HTTPDataset, bool) { + return nil, false +} + +// AsAzureSearchIndexDataset is the BasicDataset implementation for AzureMySQLTableDataset. +func (amstd AzureMySQLTableDataset) AsAzureSearchIndexDataset() (*AzureSearchIndexDataset, bool) { + return nil, false +} + +// AsWebTableDataset is the BasicDataset implementation for AzureMySQLTableDataset. +func (amstd AzureMySQLTableDataset) AsWebTableDataset() (*WebTableDataset, bool) { + return nil, false +} + +// AsSQLServerTableDataset is the BasicDataset implementation for AzureMySQLTableDataset. +func (amstd AzureMySQLTableDataset) AsSQLServerTableDataset() (*SQLServerTableDataset, bool) { + return nil, false +} + +// AsSapEccResourceDataset is the BasicDataset implementation for AzureMySQLTableDataset. +func (amstd AzureMySQLTableDataset) AsSapEccResourceDataset() (*SapEccResourceDataset, bool) { + return nil, false +} + +// AsSapCloudForCustomerResourceDataset is the BasicDataset implementation for AzureMySQLTableDataset. +func (amstd AzureMySQLTableDataset) AsSapCloudForCustomerResourceDataset() (*SapCloudForCustomerResourceDataset, bool) { + return nil, false +} + +// AsSalesforceObjectDataset is the BasicDataset implementation for AzureMySQLTableDataset. +func (amstd AzureMySQLTableDataset) AsSalesforceObjectDataset() (*SalesforceObjectDataset, bool) { + return nil, false +} + +// AsRelationalTableDataset is the BasicDataset implementation for AzureMySQLTableDataset. +func (amstd AzureMySQLTableDataset) AsRelationalTableDataset() (*RelationalTableDataset, bool) { + return nil, false +} + +// AsAzureMySQLTableDataset is the BasicDataset implementation for AzureMySQLTableDataset. +func (amstd AzureMySQLTableDataset) AsAzureMySQLTableDataset() (*AzureMySQLTableDataset, bool) { + return &amstd, true +} + +// AsOracleTableDataset is the BasicDataset implementation for AzureMySQLTableDataset. +func (amstd AzureMySQLTableDataset) AsOracleTableDataset() (*OracleTableDataset, bool) { + return nil, false +} + +// AsODataResourceDataset is the BasicDataset implementation for AzureMySQLTableDataset. +func (amstd AzureMySQLTableDataset) AsODataResourceDataset() (*ODataResourceDataset, bool) { + return nil, false +} + +// AsMongoDbCollectionDataset is the BasicDataset implementation for AzureMySQLTableDataset. +func (amstd AzureMySQLTableDataset) AsMongoDbCollectionDataset() (*MongoDbCollectionDataset, bool) { + return nil, false +} + +// AsFileShareDataset is the BasicDataset implementation for AzureMySQLTableDataset. +func (amstd AzureMySQLTableDataset) AsFileShareDataset() (*FileShareDataset, bool) { + return nil, false +} + +// AsAzureDataLakeStoreDataset is the BasicDataset implementation for AzureMySQLTableDataset. +func (amstd AzureMySQLTableDataset) AsAzureDataLakeStoreDataset() (*AzureDataLakeStoreDataset, bool) { + return nil, false +} + +// AsDynamicsEntityDataset is the BasicDataset implementation for AzureMySQLTableDataset. +func (amstd AzureMySQLTableDataset) AsDynamicsEntityDataset() (*DynamicsEntityDataset, bool) { + return nil, false +} + +// AsDocumentDbCollectionDataset is the BasicDataset implementation for AzureMySQLTableDataset. +func (amstd AzureMySQLTableDataset) AsDocumentDbCollectionDataset() (*DocumentDbCollectionDataset, bool) { + return nil, false +} + +// AsCustomDataset is the BasicDataset implementation for AzureMySQLTableDataset. +func (amstd AzureMySQLTableDataset) AsCustomDataset() (*CustomDataset, bool) { + return nil, false +} + +// AsCassandraTableDataset is the BasicDataset implementation for AzureMySQLTableDataset. +func (amstd AzureMySQLTableDataset) AsCassandraTableDataset() (*CassandraTableDataset, bool) { + return nil, false +} + +// AsAzureSQLDWTableDataset is the BasicDataset implementation for AzureMySQLTableDataset. +func (amstd AzureMySQLTableDataset) AsAzureSQLDWTableDataset() (*AzureSQLDWTableDataset, bool) { + return nil, false +} + +// AsAzureSQLTableDataset is the BasicDataset implementation for AzureMySQLTableDataset. +func (amstd AzureMySQLTableDataset) AsAzureSQLTableDataset() (*AzureSQLTableDataset, bool) { + return nil, false +} + +// AsAzureTableDataset is the BasicDataset implementation for AzureMySQLTableDataset. +func (amstd AzureMySQLTableDataset) AsAzureTableDataset() (*AzureTableDataset, bool) { + return nil, false +} + +// AsAzureBlobDataset is the BasicDataset implementation for AzureMySQLTableDataset. +func (amstd AzureMySQLTableDataset) AsAzureBlobDataset() (*AzureBlobDataset, bool) { + return nil, false +} + +// AsAmazonS3Dataset is the BasicDataset implementation for AzureMySQLTableDataset. +func (amstd AzureMySQLTableDataset) AsAmazonS3Dataset() (*AmazonS3Dataset, bool) { + return nil, false +} + +// AsDataset is the BasicDataset implementation for AzureMySQLTableDataset. +func (amstd AzureMySQLTableDataset) AsDataset() (*Dataset, bool) { + return nil, false +} + +// AsBasicDataset is the BasicDataset implementation for AzureMySQLTableDataset. +func (amstd AzureMySQLTableDataset) AsBasicDataset() (BasicDataset, bool) { + return &amstd, true +} + +// UnmarshalJSON is the custom unmarshaler for AzureMySQLTableDataset struct. +func (amstd *AzureMySQLTableDataset) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "typeProperties": + if v != nil { + var azureMySQLTableDatasetTypeProperties AzureMySQLTableDatasetTypeProperties + err = json.Unmarshal(*v, &azureMySQLTableDatasetTypeProperties) + if err != nil { + return err + } + amstd.AzureMySQLTableDatasetTypeProperties = &azureMySQLTableDatasetTypeProperties + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if amstd.AdditionalProperties == nil { + amstd.AdditionalProperties = make(map[string]interface{}) + } + amstd.AdditionalProperties[k] = additionalProperties + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + amstd.Description = &description + } + case "structure": + if v != nil { + var structure interface{} + err = json.Unmarshal(*v, &structure) + if err != nil { + return err + } + amstd.Structure = structure + } + case "linkedServiceName": + if v != nil { + var linkedServiceName LinkedServiceReference + err = json.Unmarshal(*v, &linkedServiceName) + if err != nil { + return err + } + amstd.LinkedServiceName = &linkedServiceName + } + case "parameters": + if v != nil { + var parameters map[string]*ParameterSpecification + err = json.Unmarshal(*v, ¶meters) + if err != nil { + return err + } + amstd.Parameters = parameters + } + case "annotations": + if v != nil { + var annotations []interface{} + err = json.Unmarshal(*v, &annotations) + if err != nil { + return err + } + amstd.Annotations = &annotations + } + case "type": + if v != nil { + var typeVar TypeBasicDataset + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + amstd.Type = typeVar + } + } + } + + return nil +} + +// AzureMySQLTableDatasetTypeProperties azure MySQL database dataset properties. +type AzureMySQLTableDatasetTypeProperties struct { + // TableName - The Azure MySQL database table name. Type: string (or Expression with resultType string). + TableName interface{} `json:"tableName,omitempty"` +} + +// AzurePostgreSQLLinkedService azure PostgreSQL linked service. +type AzurePostgreSQLLinkedService struct { + // AzurePostgreSQLLinkedServiceTypeProperties - Azure PostgreSQL linked service properties. + *AzurePostgreSQLLinkedServiceTypeProperties `json:"typeProperties,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // ConnectVia - The integration runtime reference. + ConnectVia *IntegrationRuntimeReference `json:"connectVia,omitempty"` + // Description - Linked service description. + Description *string `json:"description,omitempty"` + // Parameters - Parameters for linked service. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeLinkedService', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforce', 'TypeAzureDataLakeStore', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureStorage' + Type TypeBasicLinkedService `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzurePostgreSQLLinkedService. +func (apsls AzurePostgreSQLLinkedService) MarshalJSON() ([]byte, error) { + apsls.Type = TypeAzurePostgreSQL + objectMap := make(map[string]interface{}) + if apsls.AzurePostgreSQLLinkedServiceTypeProperties != nil { + objectMap["typeProperties"] = apsls.AzurePostgreSQLLinkedServiceTypeProperties + } + if apsls.ConnectVia != nil { + objectMap["connectVia"] = apsls.ConnectVia + } + if apsls.Description != nil { + objectMap["description"] = apsls.Description + } + if apsls.Parameters != nil { + objectMap["parameters"] = apsls.Parameters + } + if apsls.Annotations != nil { + objectMap["annotations"] = apsls.Annotations + } + if apsls.Type != "" { + objectMap["type"] = apsls.Type + } + for k, v := range apsls.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysLinkedService is the BasicLinkedService implementation for AzurePostgreSQLLinkedService. +func (apsls AzurePostgreSQLLinkedService) AsResponsysLinkedService() (*ResponsysLinkedService, bool) { + return nil, false +} + +// AsAzureDatabricksLinkedService is the BasicLinkedService implementation for AzurePostgreSQLLinkedService. +func (apsls AzurePostgreSQLLinkedService) AsAzureDatabricksLinkedService() (*AzureDatabricksLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeAnalyticsLinkedService is the BasicLinkedService implementation for AzurePostgreSQLLinkedService. +func (apsls AzurePostgreSQLLinkedService) AsAzureDataLakeAnalyticsLinkedService() (*AzureDataLakeAnalyticsLinkedService, bool) { + return nil, false +} + +// AsHDInsightOnDemandLinkedService is the BasicLinkedService implementation for AzurePostgreSQLLinkedService. +func (apsls AzurePostgreSQLLinkedService) AsHDInsightOnDemandLinkedService() (*HDInsightOnDemandLinkedService, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudLinkedService is the BasicLinkedService implementation for AzurePostgreSQLLinkedService. +func (apsls AzurePostgreSQLLinkedService) AsSalesforceMarketingCloudLinkedService() (*SalesforceMarketingCloudLinkedService, bool) { + return nil, false +} + +// AsNetezzaLinkedService is the BasicLinkedService implementation for AzurePostgreSQLLinkedService. +func (apsls AzurePostgreSQLLinkedService) AsNetezzaLinkedService() (*NetezzaLinkedService, bool) { + return nil, false +} + +// AsVerticaLinkedService is the BasicLinkedService implementation for AzurePostgreSQLLinkedService. +func (apsls AzurePostgreSQLLinkedService) AsVerticaLinkedService() (*VerticaLinkedService, bool) { + return nil, false +} + +// AsZohoLinkedService is the BasicLinkedService implementation for AzurePostgreSQLLinkedService. +func (apsls AzurePostgreSQLLinkedService) AsZohoLinkedService() (*ZohoLinkedService, bool) { + return nil, false +} + +// AsXeroLinkedService is the BasicLinkedService implementation for AzurePostgreSQLLinkedService. +func (apsls AzurePostgreSQLLinkedService) AsXeroLinkedService() (*XeroLinkedService, bool) { + return nil, false +} + +// AsSquareLinkedService is the BasicLinkedService implementation for AzurePostgreSQLLinkedService. +func (apsls AzurePostgreSQLLinkedService) AsSquareLinkedService() (*SquareLinkedService, bool) { + return nil, false +} + +// AsSparkLinkedService is the BasicLinkedService implementation for AzurePostgreSQLLinkedService. +func (apsls AzurePostgreSQLLinkedService) AsSparkLinkedService() (*SparkLinkedService, bool) { + return nil, false +} + +// AsShopifyLinkedService is the BasicLinkedService implementation for AzurePostgreSQLLinkedService. +func (apsls AzurePostgreSQLLinkedService) AsShopifyLinkedService() (*ShopifyLinkedService, bool) { + return nil, false +} + +// AsServiceNowLinkedService is the BasicLinkedService implementation for AzurePostgreSQLLinkedService. +func (apsls AzurePostgreSQLLinkedService) AsServiceNowLinkedService() (*ServiceNowLinkedService, bool) { + return nil, false +} + +// AsQuickBooksLinkedService is the BasicLinkedService implementation for AzurePostgreSQLLinkedService. +func (apsls AzurePostgreSQLLinkedService) AsQuickBooksLinkedService() (*QuickBooksLinkedService, bool) { + return nil, false +} + +// AsPrestoLinkedService is the BasicLinkedService implementation for AzurePostgreSQLLinkedService. +func (apsls AzurePostgreSQLLinkedService) AsPrestoLinkedService() (*PrestoLinkedService, bool) { + return nil, false +} + +// AsPhoenixLinkedService is the BasicLinkedService implementation for AzurePostgreSQLLinkedService. +func (apsls AzurePostgreSQLLinkedService) AsPhoenixLinkedService() (*PhoenixLinkedService, bool) { + return nil, false +} + +// AsPaypalLinkedService is the BasicLinkedService implementation for AzurePostgreSQLLinkedService. +func (apsls AzurePostgreSQLLinkedService) AsPaypalLinkedService() (*PaypalLinkedService, bool) { + return nil, false +} + +// AsMarketoLinkedService is the BasicLinkedService implementation for AzurePostgreSQLLinkedService. +func (apsls AzurePostgreSQLLinkedService) AsMarketoLinkedService() (*MarketoLinkedService, bool) { + return nil, false +} + +// AsMariaDBLinkedService is the BasicLinkedService implementation for AzurePostgreSQLLinkedService. +func (apsls AzurePostgreSQLLinkedService) AsMariaDBLinkedService() (*MariaDBLinkedService, bool) { + return nil, false +} + +// AsMagentoLinkedService is the BasicLinkedService implementation for AzurePostgreSQLLinkedService. +func (apsls AzurePostgreSQLLinkedService) AsMagentoLinkedService() (*MagentoLinkedService, bool) { + return nil, false +} + +// AsJiraLinkedService is the BasicLinkedService implementation for AzurePostgreSQLLinkedService. +func (apsls AzurePostgreSQLLinkedService) AsJiraLinkedService() (*JiraLinkedService, bool) { + return nil, false +} + +// AsImpalaLinkedService is the BasicLinkedService implementation for AzurePostgreSQLLinkedService. +func (apsls AzurePostgreSQLLinkedService) AsImpalaLinkedService() (*ImpalaLinkedService, bool) { + return nil, false +} + +// AsHubspotLinkedService is the BasicLinkedService implementation for AzurePostgreSQLLinkedService. +func (apsls AzurePostgreSQLLinkedService) AsHubspotLinkedService() (*HubspotLinkedService, bool) { + return nil, false +} + +// AsHiveLinkedService is the BasicLinkedService implementation for AzurePostgreSQLLinkedService. +func (apsls AzurePostgreSQLLinkedService) AsHiveLinkedService() (*HiveLinkedService, bool) { + return nil, false +} + +// AsHBaseLinkedService is the BasicLinkedService implementation for AzurePostgreSQLLinkedService. +func (apsls AzurePostgreSQLLinkedService) AsHBaseLinkedService() (*HBaseLinkedService, bool) { + return nil, false +} + +// AsGreenplumLinkedService is the BasicLinkedService implementation for AzurePostgreSQLLinkedService. +func (apsls AzurePostgreSQLLinkedService) AsGreenplumLinkedService() (*GreenplumLinkedService, bool) { + return nil, false +} + +// AsGoogleBigQueryLinkedService is the BasicLinkedService implementation for AzurePostgreSQLLinkedService. +func (apsls AzurePostgreSQLLinkedService) AsGoogleBigQueryLinkedService() (*GoogleBigQueryLinkedService, bool) { + return nil, false +} + +// AsEloquaLinkedService is the BasicLinkedService implementation for AzurePostgreSQLLinkedService. +func (apsls AzurePostgreSQLLinkedService) AsEloquaLinkedService() (*EloquaLinkedService, bool) { + return nil, false +} + +// AsDrillLinkedService is the BasicLinkedService implementation for AzurePostgreSQLLinkedService. +func (apsls AzurePostgreSQLLinkedService) AsDrillLinkedService() (*DrillLinkedService, bool) { + return nil, false +} + +// AsCouchbaseLinkedService is the BasicLinkedService implementation for AzurePostgreSQLLinkedService. +func (apsls AzurePostgreSQLLinkedService) AsCouchbaseLinkedService() (*CouchbaseLinkedService, bool) { + return nil, false +} + +// AsConcurLinkedService is the BasicLinkedService implementation for AzurePostgreSQLLinkedService. +func (apsls AzurePostgreSQLLinkedService) AsConcurLinkedService() (*ConcurLinkedService, bool) { + return nil, false +} + +// AsAzurePostgreSQLLinkedService is the BasicLinkedService implementation for AzurePostgreSQLLinkedService. +func (apsls AzurePostgreSQLLinkedService) AsAzurePostgreSQLLinkedService() (*AzurePostgreSQLLinkedService, bool) { + return &apsls, true +} + +// AsAmazonMWSLinkedService is the BasicLinkedService implementation for AzurePostgreSQLLinkedService. +func (apsls AzurePostgreSQLLinkedService) AsAmazonMWSLinkedService() (*AmazonMWSLinkedService, bool) { + return nil, false +} + +// AsSapHanaLinkedService is the BasicLinkedService implementation for AzurePostgreSQLLinkedService. +func (apsls AzurePostgreSQLLinkedService) AsSapHanaLinkedService() (*SapHanaLinkedService, bool) { + return nil, false +} + +// AsSapBWLinkedService is the BasicLinkedService implementation for AzurePostgreSQLLinkedService. +func (apsls AzurePostgreSQLLinkedService) AsSapBWLinkedService() (*SapBWLinkedService, bool) { + return nil, false +} + +// AsSftpServerLinkedService is the BasicLinkedService implementation for AzurePostgreSQLLinkedService. +func (apsls AzurePostgreSQLLinkedService) AsSftpServerLinkedService() (*SftpServerLinkedService, bool) { + return nil, false +} + +// AsFtpServerLinkedService is the BasicLinkedService implementation for AzurePostgreSQLLinkedService. +func (apsls AzurePostgreSQLLinkedService) AsFtpServerLinkedService() (*FtpServerLinkedService, bool) { + return nil, false +} + +// AsHTTPLinkedService is the BasicLinkedService implementation for AzurePostgreSQLLinkedService. +func (apsls AzurePostgreSQLLinkedService) AsHTTPLinkedService() (*HTTPLinkedService, bool) { + return nil, false +} + +// AsAzureSearchLinkedService is the BasicLinkedService implementation for AzurePostgreSQLLinkedService. +func (apsls AzurePostgreSQLLinkedService) AsAzureSearchLinkedService() (*AzureSearchLinkedService, bool) { + return nil, false +} + +// AsCustomDataSourceLinkedService is the BasicLinkedService implementation for AzurePostgreSQLLinkedService. +func (apsls AzurePostgreSQLLinkedService) AsCustomDataSourceLinkedService() (*CustomDataSourceLinkedService, bool) { + return nil, false +} + +// AsAmazonRedshiftLinkedService is the BasicLinkedService implementation for AzurePostgreSQLLinkedService. +func (apsls AzurePostgreSQLLinkedService) AsAmazonRedshiftLinkedService() (*AmazonRedshiftLinkedService, bool) { + return nil, false +} + +// AsAmazonS3LinkedService is the BasicLinkedService implementation for AzurePostgreSQLLinkedService. +func (apsls AzurePostgreSQLLinkedService) AsAmazonS3LinkedService() (*AmazonS3LinkedService, bool) { + return nil, false +} + +// AsSapEccLinkedService is the BasicLinkedService implementation for AzurePostgreSQLLinkedService. +func (apsls AzurePostgreSQLLinkedService) AsSapEccLinkedService() (*SapEccLinkedService, bool) { + return nil, false +} + +// AsSapCloudForCustomerLinkedService is the BasicLinkedService implementation for AzurePostgreSQLLinkedService. +func (apsls AzurePostgreSQLLinkedService) AsSapCloudForCustomerLinkedService() (*SapCloudForCustomerLinkedService, bool) { + return nil, false +} + +// AsSalesforceLinkedService is the BasicLinkedService implementation for AzurePostgreSQLLinkedService. +func (apsls AzurePostgreSQLLinkedService) AsSalesforceLinkedService() (*SalesforceLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeStoreLinkedService is the BasicLinkedService implementation for AzurePostgreSQLLinkedService. +func (apsls AzurePostgreSQLLinkedService) AsAzureDataLakeStoreLinkedService() (*AzureDataLakeStoreLinkedService, bool) { + return nil, false +} + +// AsMongoDbLinkedService is the BasicLinkedService implementation for AzurePostgreSQLLinkedService. +func (apsls AzurePostgreSQLLinkedService) AsMongoDbLinkedService() (*MongoDbLinkedService, bool) { + return nil, false +} + +// AsCassandraLinkedService is the BasicLinkedService implementation for AzurePostgreSQLLinkedService. +func (apsls AzurePostgreSQLLinkedService) AsCassandraLinkedService() (*CassandraLinkedService, bool) { + return nil, false +} + +// AsWebLinkedService is the BasicLinkedService implementation for AzurePostgreSQLLinkedService. +func (apsls AzurePostgreSQLLinkedService) AsWebLinkedService() (*WebLinkedService, bool) { + return nil, false +} + +// AsODataLinkedService is the BasicLinkedService implementation for AzurePostgreSQLLinkedService. +func (apsls AzurePostgreSQLLinkedService) AsODataLinkedService() (*ODataLinkedService, bool) { + return nil, false +} + +// AsHdfsLinkedService is the BasicLinkedService implementation for AzurePostgreSQLLinkedService. +func (apsls AzurePostgreSQLLinkedService) AsHdfsLinkedService() (*HdfsLinkedService, bool) { + return nil, false +} + +// AsOdbcLinkedService is the BasicLinkedService implementation for AzurePostgreSQLLinkedService. +func (apsls AzurePostgreSQLLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, bool) { + return nil, false +} + +// AsAzureMLLinkedService is the BasicLinkedService implementation for AzurePostgreSQLLinkedService. +func (apsls AzurePostgreSQLLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { + return nil, false +} + +// AsTeradataLinkedService is the BasicLinkedService implementation for AzurePostgreSQLLinkedService. +func (apsls AzurePostgreSQLLinkedService) AsTeradataLinkedService() (*TeradataLinkedService, bool) { + return nil, false +} + +// AsDb2LinkedService is the BasicLinkedService implementation for AzurePostgreSQLLinkedService. +func (apsls AzurePostgreSQLLinkedService) AsDb2LinkedService() (*Db2LinkedService, bool) { + return nil, false +} + +// AsSybaseLinkedService is the BasicLinkedService implementation for AzurePostgreSQLLinkedService. +func (apsls AzurePostgreSQLLinkedService) AsSybaseLinkedService() (*SybaseLinkedService, bool) { + return nil, false +} + +// AsPostgreSQLLinkedService is the BasicLinkedService implementation for AzurePostgreSQLLinkedService. +func (apsls AzurePostgreSQLLinkedService) AsPostgreSQLLinkedService() (*PostgreSQLLinkedService, bool) { + return nil, false +} + +// AsMySQLLinkedService is the BasicLinkedService implementation for AzurePostgreSQLLinkedService. +func (apsls AzurePostgreSQLLinkedService) AsMySQLLinkedService() (*MySQLLinkedService, bool) { + return nil, false +} + +// AsAzureMySQLLinkedService is the BasicLinkedService implementation for AzurePostgreSQLLinkedService. +func (apsls AzurePostgreSQLLinkedService) AsAzureMySQLLinkedService() (*AzureMySQLLinkedService, bool) { + return nil, false +} + +// AsOracleLinkedService is the BasicLinkedService implementation for AzurePostgreSQLLinkedService. +func (apsls AzurePostgreSQLLinkedService) AsOracleLinkedService() (*OracleLinkedService, bool) { + return nil, false +} + +// AsFileServerLinkedService is the BasicLinkedService implementation for AzurePostgreSQLLinkedService. +func (apsls AzurePostgreSQLLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { + return nil, false +} + +// AsHDInsightLinkedService is the BasicLinkedService implementation for AzurePostgreSQLLinkedService. +func (apsls AzurePostgreSQLLinkedService) AsHDInsightLinkedService() (*HDInsightLinkedService, bool) { + return nil, false +} + +// AsDynamicsLinkedService is the BasicLinkedService implementation for AzurePostgreSQLLinkedService. +func (apsls AzurePostgreSQLLinkedService) AsDynamicsLinkedService() (*DynamicsLinkedService, bool) { + return nil, false +} + +// AsCosmosDbLinkedService is the BasicLinkedService implementation for AzurePostgreSQLLinkedService. +func (apsls AzurePostgreSQLLinkedService) AsCosmosDbLinkedService() (*CosmosDbLinkedService, bool) { + return nil, false +} + +// AsAzureKeyVaultLinkedService is the BasicLinkedService implementation for AzurePostgreSQLLinkedService. +func (apsls AzurePostgreSQLLinkedService) AsAzureKeyVaultLinkedService() (*AzureKeyVaultLinkedService, bool) { + return nil, false +} + +// AsAzureBatchLinkedService is the BasicLinkedService implementation for AzurePostgreSQLLinkedService. +func (apsls AzurePostgreSQLLinkedService) AsAzureBatchLinkedService() (*AzureBatchLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDatabaseLinkedService is the BasicLinkedService implementation for AzurePostgreSQLLinkedService. +func (apsls AzurePostgreSQLLinkedService) AsAzureSQLDatabaseLinkedService() (*AzureSQLDatabaseLinkedService, bool) { + return nil, false +} + +// AsSQLServerLinkedService is the BasicLinkedService implementation for AzurePostgreSQLLinkedService. +func (apsls AzurePostgreSQLLinkedService) AsSQLServerLinkedService() (*SQLServerLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDWLinkedService is the BasicLinkedService implementation for AzurePostgreSQLLinkedService. +func (apsls AzurePostgreSQLLinkedService) AsAzureSQLDWLinkedService() (*AzureSQLDWLinkedService, bool) { + return nil, false +} + +// AsAzureStorageLinkedService is the BasicLinkedService implementation for AzurePostgreSQLLinkedService. +func (apsls AzurePostgreSQLLinkedService) AsAzureStorageLinkedService() (*AzureStorageLinkedService, bool) { + return nil, false +} + +// AsLinkedService is the BasicLinkedService implementation for AzurePostgreSQLLinkedService. +func (apsls AzurePostgreSQLLinkedService) AsLinkedService() (*LinkedService, bool) { + return nil, false +} + +// AsBasicLinkedService is the BasicLinkedService implementation for AzurePostgreSQLLinkedService. +func (apsls AzurePostgreSQLLinkedService) AsBasicLinkedService() (BasicLinkedService, bool) { + return &apsls, true +} + +// UnmarshalJSON is the custom unmarshaler for AzurePostgreSQLLinkedService struct. +func (apsls *AzurePostgreSQLLinkedService) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "typeProperties": + if v != nil { + var azurePostgreSQLLinkedServiceTypeProperties AzurePostgreSQLLinkedServiceTypeProperties + err = json.Unmarshal(*v, &azurePostgreSQLLinkedServiceTypeProperties) + if err != nil { + return err + } + apsls.AzurePostgreSQLLinkedServiceTypeProperties = &azurePostgreSQLLinkedServiceTypeProperties + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if apsls.AdditionalProperties == nil { + apsls.AdditionalProperties = make(map[string]interface{}) + } + apsls.AdditionalProperties[k] = additionalProperties + } + case "connectVia": + if v != nil { + var connectVia IntegrationRuntimeReference + err = json.Unmarshal(*v, &connectVia) + if err != nil { + return err + } + apsls.ConnectVia = &connectVia + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + apsls.Description = &description + } + case "parameters": + if v != nil { + var parameters map[string]*ParameterSpecification + err = json.Unmarshal(*v, ¶meters) + if err != nil { + return err + } + apsls.Parameters = parameters + } + case "annotations": + if v != nil { + var annotations []interface{} + err = json.Unmarshal(*v, &annotations) + if err != nil { + return err + } + apsls.Annotations = &annotations + } + case "type": + if v != nil { + var typeVar TypeBasicLinkedService + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + apsls.Type = typeVar + } + } + } + + return nil +} + +// AzurePostgreSQLLinkedServiceTypeProperties azure PostgreSQL linked service properties. +type AzurePostgreSQLLinkedServiceTypeProperties struct { + // ConnectionString - An ODBC connection string. Type: string, SecureString or AzureKeyVaultSecretReference. + ConnectionString interface{} `json:"connectionString,omitempty"` + // EncryptedCredential - The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string). + EncryptedCredential interface{} `json:"encryptedCredential,omitempty"` +} + +// AzurePostgreSQLSource a copy activity Azure PostgreSQL source. +type AzurePostgreSQLSource struct { + // Query - A query to retrieve data from source. Type: string (or Expression with resultType string). + Query interface{} `json:"query,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // SourceRetryCount - Source retry count. Type: integer (or Expression with resultType integer). + SourceRetryCount interface{} `json:"sourceRetryCount,omitempty"` + // SourceRetryWait - Source retry wait. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` + // Type - Possible values include: 'TypeCopySource', 'TypeAmazonRedshiftSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeHTTPSource', 'TypeAzureDataLakeStoreSource', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeRelationalSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource' + Type TypeBasicCopySource `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzurePostgreSQLSource. +func (apss AzurePostgreSQLSource) MarshalJSON() ([]byte, error) { + apss.Type = TypeAzurePostgreSQLSource + objectMap := make(map[string]interface{}) + objectMap["query"] = apss.Query + objectMap["sourceRetryCount"] = apss.SourceRetryCount + objectMap["sourceRetryWait"] = apss.SourceRetryWait + if apss.Type != "" { + objectMap["type"] = apss.Type + } + for k, v := range apss.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsAmazonRedshiftSource is the BasicCopySource implementation for AzurePostgreSQLSource. +func (apss AzurePostgreSQLSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { + return nil, false +} + +// AsResponsysSource is the BasicCopySource implementation for AzurePostgreSQLSource. +func (apss AzurePostgreSQLSource) AsResponsysSource() (*ResponsysSource, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudSource is the BasicCopySource implementation for AzurePostgreSQLSource. +func (apss AzurePostgreSQLSource) AsSalesforceMarketingCloudSource() (*SalesforceMarketingCloudSource, bool) { + return nil, false +} + +// AsVerticaSource is the BasicCopySource implementation for AzurePostgreSQLSource. +func (apss AzurePostgreSQLSource) AsVerticaSource() (*VerticaSource, bool) { + return nil, false +} + +// AsNetezzaSource is the BasicCopySource implementation for AzurePostgreSQLSource. +func (apss AzurePostgreSQLSource) AsNetezzaSource() (*NetezzaSource, bool) { + return nil, false +} + +// AsZohoSource is the BasicCopySource implementation for AzurePostgreSQLSource. +func (apss AzurePostgreSQLSource) AsZohoSource() (*ZohoSource, bool) { + return nil, false +} + +// AsXeroSource is the BasicCopySource implementation for AzurePostgreSQLSource. +func (apss AzurePostgreSQLSource) AsXeroSource() (*XeroSource, bool) { + return nil, false +} + +// AsSquareSource is the BasicCopySource implementation for AzurePostgreSQLSource. +func (apss AzurePostgreSQLSource) AsSquareSource() (*SquareSource, bool) { + return nil, false +} + +// AsSparkSource is the BasicCopySource implementation for AzurePostgreSQLSource. +func (apss AzurePostgreSQLSource) AsSparkSource() (*SparkSource, bool) { + return nil, false +} + +// AsShopifySource is the BasicCopySource implementation for AzurePostgreSQLSource. +func (apss AzurePostgreSQLSource) AsShopifySource() (*ShopifySource, bool) { + return nil, false +} + +// AsServiceNowSource is the BasicCopySource implementation for AzurePostgreSQLSource. +func (apss AzurePostgreSQLSource) AsServiceNowSource() (*ServiceNowSource, bool) { + return nil, false +} + +// AsQuickBooksSource is the BasicCopySource implementation for AzurePostgreSQLSource. +func (apss AzurePostgreSQLSource) AsQuickBooksSource() (*QuickBooksSource, bool) { + return nil, false +} + +// AsPrestoSource is the BasicCopySource implementation for AzurePostgreSQLSource. +func (apss AzurePostgreSQLSource) AsPrestoSource() (*PrestoSource, bool) { + return nil, false +} + +// AsPhoenixSource is the BasicCopySource implementation for AzurePostgreSQLSource. +func (apss AzurePostgreSQLSource) AsPhoenixSource() (*PhoenixSource, bool) { + return nil, false +} + +// AsPaypalSource is the BasicCopySource implementation for AzurePostgreSQLSource. +func (apss AzurePostgreSQLSource) AsPaypalSource() (*PaypalSource, bool) { + return nil, false +} + +// AsMarketoSource is the BasicCopySource implementation for AzurePostgreSQLSource. +func (apss AzurePostgreSQLSource) AsMarketoSource() (*MarketoSource, bool) { + return nil, false +} + +// AsMariaDBSource is the BasicCopySource implementation for AzurePostgreSQLSource. +func (apss AzurePostgreSQLSource) AsMariaDBSource() (*MariaDBSource, bool) { + return nil, false +} + +// AsMagentoSource is the BasicCopySource implementation for AzurePostgreSQLSource. +func (apss AzurePostgreSQLSource) AsMagentoSource() (*MagentoSource, bool) { + return nil, false +} + +// AsJiraSource is the BasicCopySource implementation for AzurePostgreSQLSource. +func (apss AzurePostgreSQLSource) AsJiraSource() (*JiraSource, bool) { + return nil, false +} + +// AsImpalaSource is the BasicCopySource implementation for AzurePostgreSQLSource. +func (apss AzurePostgreSQLSource) AsImpalaSource() (*ImpalaSource, bool) { + return nil, false +} + +// AsHubspotSource is the BasicCopySource implementation for AzurePostgreSQLSource. +func (apss AzurePostgreSQLSource) AsHubspotSource() (*HubspotSource, bool) { + return nil, false +} + +// AsHiveSource is the BasicCopySource implementation for AzurePostgreSQLSource. +func (apss AzurePostgreSQLSource) AsHiveSource() (*HiveSource, bool) { + return nil, false +} + +// AsHBaseSource is the BasicCopySource implementation for AzurePostgreSQLSource. +func (apss AzurePostgreSQLSource) AsHBaseSource() (*HBaseSource, bool) { + return nil, false +} + +// AsGreenplumSource is the BasicCopySource implementation for AzurePostgreSQLSource. +func (apss AzurePostgreSQLSource) AsGreenplumSource() (*GreenplumSource, bool) { + return nil, false +} + +// AsGoogleBigQuerySource is the BasicCopySource implementation for AzurePostgreSQLSource. +func (apss AzurePostgreSQLSource) AsGoogleBigQuerySource() (*GoogleBigQuerySource, bool) { + return nil, false +} + +// AsEloquaSource is the BasicCopySource implementation for AzurePostgreSQLSource. +func (apss AzurePostgreSQLSource) AsEloquaSource() (*EloquaSource, bool) { + return nil, false +} + +// AsDrillSource is the BasicCopySource implementation for AzurePostgreSQLSource. +func (apss AzurePostgreSQLSource) AsDrillSource() (*DrillSource, bool) { + return nil, false +} + +// AsCouchbaseSource is the BasicCopySource implementation for AzurePostgreSQLSource. +func (apss AzurePostgreSQLSource) AsCouchbaseSource() (*CouchbaseSource, bool) { + return nil, false +} + +// AsConcurSource is the BasicCopySource implementation for AzurePostgreSQLSource. +func (apss AzurePostgreSQLSource) AsConcurSource() (*ConcurSource, bool) { + return nil, false +} + +// AsAzurePostgreSQLSource is the BasicCopySource implementation for AzurePostgreSQLSource. +func (apss AzurePostgreSQLSource) AsAzurePostgreSQLSource() (*AzurePostgreSQLSource, bool) { + return &apss, true +} + +// AsAmazonMWSSource is the BasicCopySource implementation for AzurePostgreSQLSource. +func (apss AzurePostgreSQLSource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { + return nil, false +} + +// AsHTTPSource is the BasicCopySource implementation for AzurePostgreSQLSource. +func (apss AzurePostgreSQLSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for AzurePostgreSQLSource. +func (apss AzurePostgreSQLSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for AzurePostgreSQLSource. +func (apss AzurePostgreSQLSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsCassandraSource is the BasicCopySource implementation for AzurePostgreSQLSource. +func (apss AzurePostgreSQLSource) AsCassandraSource() (*CassandraSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for AzurePostgreSQLSource. +func (apss AzurePostgreSQLSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for AzurePostgreSQLSource. +func (apss AzurePostgreSQLSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureMySQLSource is the BasicCopySource implementation for AzurePostgreSQLSource. +func (apss AzurePostgreSQLSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for AzurePostgreSQLSource. +func (apss AzurePostgreSQLSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for AzurePostgreSQLSource. +func (apss AzurePostgreSQLSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsSQLDWSource is the BasicCopySource implementation for AzurePostgreSQLSource. +func (apss AzurePostgreSQLSource) AsSQLDWSource() (*SQLDWSource, bool) { + return nil, false +} + +// AsSQLSource is the BasicCopySource implementation for AzurePostgreSQLSource. +func (apss AzurePostgreSQLSource) AsSQLSource() (*SQLSource, bool) { + return nil, false +} + +// AsSapEccSource is the BasicCopySource implementation for AzurePostgreSQLSource. +func (apss AzurePostgreSQLSource) AsSapEccSource() (*SapEccSource, bool) { + return nil, false +} + +// AsSapCloudForCustomerSource is the BasicCopySource implementation for AzurePostgreSQLSource. +func (apss AzurePostgreSQLSource) AsSapCloudForCustomerSource() (*SapCloudForCustomerSource, bool) { + return nil, false +} + +// AsSalesforceSource is the BasicCopySource implementation for AzurePostgreSQLSource. +func (apss AzurePostgreSQLSource) AsSalesforceSource() (*SalesforceSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for AzurePostgreSQLSource. +func (apss AzurePostgreSQLSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for AzurePostgreSQLSource. +func (apss AzurePostgreSQLSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for AzurePostgreSQLSource. +func (apss AzurePostgreSQLSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for AzurePostgreSQLSource. +func (apss AzurePostgreSQLSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + +// AsAzureTableSource is the BasicCopySource implementation for AzurePostgreSQLSource. +func (apss AzurePostgreSQLSource) AsAzureTableSource() (*AzureTableSource, bool) { + return nil, false +} + +// AsCopySource is the BasicCopySource implementation for AzurePostgreSQLSource. +func (apss AzurePostgreSQLSource) AsCopySource() (*CopySource, bool) { + return nil, false +} + +// AsBasicCopySource is the BasicCopySource implementation for AzurePostgreSQLSource. +func (apss AzurePostgreSQLSource) AsBasicCopySource() (BasicCopySource, bool) { + return &apss, true +} + +// AzurePostgreSQLTableDataset azure PostgreSQL dataset. +type AzurePostgreSQLTableDataset struct { + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Description - Dataset description. + Description *string `json:"description,omitempty"` + // Structure - Columns that define the structure of the dataset. Type: array (or Expression with resultType array), itemType: DatasetDataElement. + Structure interface{} `json:"structure,omitempty"` + // LinkedServiceName - Linked service reference. + LinkedServiceName *LinkedServiceReference `json:"linkedServiceName,omitempty"` + // Parameters - Parameters for dataset. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeDataset', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSQLServerTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSalesforceObject', 'TypeRelationalTable', 'TypeAzureMySQLTable', 'TypeOracleTable', 'TypeODataResource', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeAzureDataLakeStoreFile', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeAmazonS3Object' + Type TypeBasicDataset `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzurePostgreSQLTableDataset. +func (apstd AzurePostgreSQLTableDataset) MarshalJSON() ([]byte, error) { + apstd.Type = TypeAzurePostgreSQLTable + objectMap := make(map[string]interface{}) + if apstd.Description != nil { + objectMap["description"] = apstd.Description + } + objectMap["structure"] = apstd.Structure + if apstd.LinkedServiceName != nil { + objectMap["linkedServiceName"] = apstd.LinkedServiceName + } + if apstd.Parameters != nil { + objectMap["parameters"] = apstd.Parameters + } + if apstd.Annotations != nil { + objectMap["annotations"] = apstd.Annotations + } + if apstd.Type != "" { + objectMap["type"] = apstd.Type + } + for k, v := range apstd.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysObjectDataset is the BasicDataset implementation for AzurePostgreSQLTableDataset. +func (apstd AzurePostgreSQLTableDataset) AsResponsysObjectDataset() (*ResponsysObjectDataset, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudObjectDataset is the BasicDataset implementation for AzurePostgreSQLTableDataset. +func (apstd AzurePostgreSQLTableDataset) AsSalesforceMarketingCloudObjectDataset() (*SalesforceMarketingCloudObjectDataset, bool) { + return nil, false +} + +// AsVerticaTableDataset is the BasicDataset implementation for AzurePostgreSQLTableDataset. +func (apstd AzurePostgreSQLTableDataset) AsVerticaTableDataset() (*VerticaTableDataset, bool) { + return nil, false +} + +// AsNetezzaTableDataset is the BasicDataset implementation for AzurePostgreSQLTableDataset. +func (apstd AzurePostgreSQLTableDataset) AsNetezzaTableDataset() (*NetezzaTableDataset, bool) { + return nil, false +} + +// AsZohoObjectDataset is the BasicDataset implementation for AzurePostgreSQLTableDataset. +func (apstd AzurePostgreSQLTableDataset) AsZohoObjectDataset() (*ZohoObjectDataset, bool) { + return nil, false +} + +// AsXeroObjectDataset is the BasicDataset implementation for AzurePostgreSQLTableDataset. +func (apstd AzurePostgreSQLTableDataset) AsXeroObjectDataset() (*XeroObjectDataset, bool) { + return nil, false +} + +// AsSquareObjectDataset is the BasicDataset implementation for AzurePostgreSQLTableDataset. +func (apstd AzurePostgreSQLTableDataset) AsSquareObjectDataset() (*SquareObjectDataset, bool) { + return nil, false +} + +// AsSparkObjectDataset is the BasicDataset implementation for AzurePostgreSQLTableDataset. +func (apstd AzurePostgreSQLTableDataset) AsSparkObjectDataset() (*SparkObjectDataset, bool) { + return nil, false +} + +// AsShopifyObjectDataset is the BasicDataset implementation for AzurePostgreSQLTableDataset. +func (apstd AzurePostgreSQLTableDataset) AsShopifyObjectDataset() (*ShopifyObjectDataset, bool) { + return nil, false +} + +// AsServiceNowObjectDataset is the BasicDataset implementation for AzurePostgreSQLTableDataset. +func (apstd AzurePostgreSQLTableDataset) AsServiceNowObjectDataset() (*ServiceNowObjectDataset, bool) { + return nil, false +} + +// AsQuickBooksObjectDataset is the BasicDataset implementation for AzurePostgreSQLTableDataset. +func (apstd AzurePostgreSQLTableDataset) AsQuickBooksObjectDataset() (*QuickBooksObjectDataset, bool) { + return nil, false +} + +// AsPrestoObjectDataset is the BasicDataset implementation for AzurePostgreSQLTableDataset. +func (apstd AzurePostgreSQLTableDataset) AsPrestoObjectDataset() (*PrestoObjectDataset, bool) { + return nil, false +} + +// AsPhoenixObjectDataset is the BasicDataset implementation for AzurePostgreSQLTableDataset. +func (apstd AzurePostgreSQLTableDataset) AsPhoenixObjectDataset() (*PhoenixObjectDataset, bool) { + return nil, false +} + +// AsPaypalObjectDataset is the BasicDataset implementation for AzurePostgreSQLTableDataset. +func (apstd AzurePostgreSQLTableDataset) AsPaypalObjectDataset() (*PaypalObjectDataset, bool) { + return nil, false +} + +// AsMarketoObjectDataset is the BasicDataset implementation for AzurePostgreSQLTableDataset. +func (apstd AzurePostgreSQLTableDataset) AsMarketoObjectDataset() (*MarketoObjectDataset, bool) { + return nil, false +} + +// AsMariaDBTableDataset is the BasicDataset implementation for AzurePostgreSQLTableDataset. +func (apstd AzurePostgreSQLTableDataset) AsMariaDBTableDataset() (*MariaDBTableDataset, bool) { + return nil, false +} + +// AsMagentoObjectDataset is the BasicDataset implementation for AzurePostgreSQLTableDataset. +func (apstd AzurePostgreSQLTableDataset) AsMagentoObjectDataset() (*MagentoObjectDataset, bool) { + return nil, false +} + +// AsJiraObjectDataset is the BasicDataset implementation for AzurePostgreSQLTableDataset. +func (apstd AzurePostgreSQLTableDataset) AsJiraObjectDataset() (*JiraObjectDataset, bool) { + return nil, false +} + +// AsImpalaObjectDataset is the BasicDataset implementation for AzurePostgreSQLTableDataset. +func (apstd AzurePostgreSQLTableDataset) AsImpalaObjectDataset() (*ImpalaObjectDataset, bool) { + return nil, false +} + +// AsHubspotObjectDataset is the BasicDataset implementation for AzurePostgreSQLTableDataset. +func (apstd AzurePostgreSQLTableDataset) AsHubspotObjectDataset() (*HubspotObjectDataset, bool) { + return nil, false +} + +// AsHiveObjectDataset is the BasicDataset implementation for AzurePostgreSQLTableDataset. +func (apstd AzurePostgreSQLTableDataset) AsHiveObjectDataset() (*HiveObjectDataset, bool) { + return nil, false +} + +// AsHBaseObjectDataset is the BasicDataset implementation for AzurePostgreSQLTableDataset. +func (apstd AzurePostgreSQLTableDataset) AsHBaseObjectDataset() (*HBaseObjectDataset, bool) { + return nil, false +} + +// AsGreenplumTableDataset is the BasicDataset implementation for AzurePostgreSQLTableDataset. +func (apstd AzurePostgreSQLTableDataset) AsGreenplumTableDataset() (*GreenplumTableDataset, bool) { + return nil, false +} + +// AsGoogleBigQueryObjectDataset is the BasicDataset implementation for AzurePostgreSQLTableDataset. +func (apstd AzurePostgreSQLTableDataset) AsGoogleBigQueryObjectDataset() (*GoogleBigQueryObjectDataset, bool) { + return nil, false +} + +// AsEloquaObjectDataset is the BasicDataset implementation for AzurePostgreSQLTableDataset. +func (apstd AzurePostgreSQLTableDataset) AsEloquaObjectDataset() (*EloquaObjectDataset, bool) { + return nil, false +} + +// AsDrillTableDataset is the BasicDataset implementation for AzurePostgreSQLTableDataset. +func (apstd AzurePostgreSQLTableDataset) AsDrillTableDataset() (*DrillTableDataset, bool) { + return nil, false +} + +// AsCouchbaseTableDataset is the BasicDataset implementation for AzurePostgreSQLTableDataset. +func (apstd AzurePostgreSQLTableDataset) AsCouchbaseTableDataset() (*CouchbaseTableDataset, bool) { + return nil, false +} + +// AsConcurObjectDataset is the BasicDataset implementation for AzurePostgreSQLTableDataset. +func (apstd AzurePostgreSQLTableDataset) AsConcurObjectDataset() (*ConcurObjectDataset, bool) { + return nil, false +} + +// AsAzurePostgreSQLTableDataset is the BasicDataset implementation for AzurePostgreSQLTableDataset. +func (apstd AzurePostgreSQLTableDataset) AsAzurePostgreSQLTableDataset() (*AzurePostgreSQLTableDataset, bool) { + return &apstd, true +} + +// AsAmazonMWSObjectDataset is the BasicDataset implementation for AzurePostgreSQLTableDataset. +func (apstd AzurePostgreSQLTableDataset) AsAmazonMWSObjectDataset() (*AmazonMWSObjectDataset, bool) { + return nil, false +} + +// AsHTTPDataset is the BasicDataset implementation for AzurePostgreSQLTableDataset. +func (apstd AzurePostgreSQLTableDataset) AsHTTPDataset() (*HTTPDataset, bool) { + return nil, false +} + +// AsAzureSearchIndexDataset is the BasicDataset implementation for AzurePostgreSQLTableDataset. +func (apstd AzurePostgreSQLTableDataset) AsAzureSearchIndexDataset() (*AzureSearchIndexDataset, bool) { + return nil, false +} + +// AsWebTableDataset is the BasicDataset implementation for AzurePostgreSQLTableDataset. +func (apstd AzurePostgreSQLTableDataset) AsWebTableDataset() (*WebTableDataset, bool) { + return nil, false +} + +// AsSQLServerTableDataset is the BasicDataset implementation for AzurePostgreSQLTableDataset. +func (apstd AzurePostgreSQLTableDataset) AsSQLServerTableDataset() (*SQLServerTableDataset, bool) { + return nil, false +} + +// AsSapEccResourceDataset is the BasicDataset implementation for AzurePostgreSQLTableDataset. +func (apstd AzurePostgreSQLTableDataset) AsSapEccResourceDataset() (*SapEccResourceDataset, bool) { + return nil, false +} + +// AsSapCloudForCustomerResourceDataset is the BasicDataset implementation for AzurePostgreSQLTableDataset. +func (apstd AzurePostgreSQLTableDataset) AsSapCloudForCustomerResourceDataset() (*SapCloudForCustomerResourceDataset, bool) { + return nil, false +} + +// AsSalesforceObjectDataset is the BasicDataset implementation for AzurePostgreSQLTableDataset. +func (apstd AzurePostgreSQLTableDataset) AsSalesforceObjectDataset() (*SalesforceObjectDataset, bool) { + return nil, false +} + +// AsRelationalTableDataset is the BasicDataset implementation for AzurePostgreSQLTableDataset. +func (apstd AzurePostgreSQLTableDataset) AsRelationalTableDataset() (*RelationalTableDataset, bool) { + return nil, false +} + +// AsAzureMySQLTableDataset is the BasicDataset implementation for AzurePostgreSQLTableDataset. +func (apstd AzurePostgreSQLTableDataset) AsAzureMySQLTableDataset() (*AzureMySQLTableDataset, bool) { + return nil, false +} + +// AsOracleTableDataset is the BasicDataset implementation for AzurePostgreSQLTableDataset. +func (apstd AzurePostgreSQLTableDataset) AsOracleTableDataset() (*OracleTableDataset, bool) { + return nil, false +} + +// AsODataResourceDataset is the BasicDataset implementation for AzurePostgreSQLTableDataset. +func (apstd AzurePostgreSQLTableDataset) AsODataResourceDataset() (*ODataResourceDataset, bool) { + return nil, false +} + +// AsMongoDbCollectionDataset is the BasicDataset implementation for AzurePostgreSQLTableDataset. +func (apstd AzurePostgreSQLTableDataset) AsMongoDbCollectionDataset() (*MongoDbCollectionDataset, bool) { + return nil, false +} + +// AsFileShareDataset is the BasicDataset implementation for AzurePostgreSQLTableDataset. +func (apstd AzurePostgreSQLTableDataset) AsFileShareDataset() (*FileShareDataset, bool) { + return nil, false +} + +// AsAzureDataLakeStoreDataset is the BasicDataset implementation for AzurePostgreSQLTableDataset. +func (apstd AzurePostgreSQLTableDataset) AsAzureDataLakeStoreDataset() (*AzureDataLakeStoreDataset, bool) { + return nil, false +} + +// AsDynamicsEntityDataset is the BasicDataset implementation for AzurePostgreSQLTableDataset. +func (apstd AzurePostgreSQLTableDataset) AsDynamicsEntityDataset() (*DynamicsEntityDataset, bool) { + return nil, false +} + +// AsDocumentDbCollectionDataset is the BasicDataset implementation for AzurePostgreSQLTableDataset. +func (apstd AzurePostgreSQLTableDataset) AsDocumentDbCollectionDataset() (*DocumentDbCollectionDataset, bool) { + return nil, false +} + +// AsCustomDataset is the BasicDataset implementation for AzurePostgreSQLTableDataset. +func (apstd AzurePostgreSQLTableDataset) AsCustomDataset() (*CustomDataset, bool) { + return nil, false +} + +// AsCassandraTableDataset is the BasicDataset implementation for AzurePostgreSQLTableDataset. +func (apstd AzurePostgreSQLTableDataset) AsCassandraTableDataset() (*CassandraTableDataset, bool) { + return nil, false +} + +// AsAzureSQLDWTableDataset is the BasicDataset implementation for AzurePostgreSQLTableDataset. +func (apstd AzurePostgreSQLTableDataset) AsAzureSQLDWTableDataset() (*AzureSQLDWTableDataset, bool) { + return nil, false +} + +// AsAzureSQLTableDataset is the BasicDataset implementation for AzurePostgreSQLTableDataset. +func (apstd AzurePostgreSQLTableDataset) AsAzureSQLTableDataset() (*AzureSQLTableDataset, bool) { + return nil, false +} + +// AsAzureTableDataset is the BasicDataset implementation for AzurePostgreSQLTableDataset. +func (apstd AzurePostgreSQLTableDataset) AsAzureTableDataset() (*AzureTableDataset, bool) { + return nil, false +} + +// AsAzureBlobDataset is the BasicDataset implementation for AzurePostgreSQLTableDataset. +func (apstd AzurePostgreSQLTableDataset) AsAzureBlobDataset() (*AzureBlobDataset, bool) { + return nil, false +} + +// AsAmazonS3Dataset is the BasicDataset implementation for AzurePostgreSQLTableDataset. +func (apstd AzurePostgreSQLTableDataset) AsAmazonS3Dataset() (*AmazonS3Dataset, bool) { + return nil, false +} + +// AsDataset is the BasicDataset implementation for AzurePostgreSQLTableDataset. +func (apstd AzurePostgreSQLTableDataset) AsDataset() (*Dataset, bool) { + return nil, false +} + +// AsBasicDataset is the BasicDataset implementation for AzurePostgreSQLTableDataset. +func (apstd AzurePostgreSQLTableDataset) AsBasicDataset() (BasicDataset, bool) { + return &apstd, true +} + +// AzureQueueSink a copy activity Azure Queue sink. +type AzureQueueSink struct { + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // WriteBatchSize - Write batch size. Type: integer (or Expression with resultType integer), minimum: 0. + WriteBatchSize interface{} `json:"writeBatchSize,omitempty"` + // WriteBatchTimeout - Write batch timeout. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + WriteBatchTimeout interface{} `json:"writeBatchTimeout,omitempty"` + // SinkRetryCount - Sink retry count. Type: integer (or Expression with resultType integer). + SinkRetryCount interface{} `json:"sinkRetryCount,omitempty"` + // SinkRetryWait - Sink retry wait. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + SinkRetryWait interface{} `json:"sinkRetryWait,omitempty"` + // Type - Possible values include: 'TypeCopySink', 'TypeSalesforceSink', 'TypeDynamicsSink', 'TypeOdbcSink', 'TypeAzureSearchIndexSink', 'TypeAzureDataLakeStoreSink', 'TypeOracleSink', 'TypeSQLDWSink', 'TypeSQLSink', 'TypeDocumentDbCollectionSink', 'TypeFileSystemSink', 'TypeBlobSink', 'TypeAzureTableSink', 'TypeAzureQueueSink', 'TypeSapCloudForCustomerSink' + Type TypeBasicCopySink `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureQueueSink. +func (aqs AzureQueueSink) MarshalJSON() ([]byte, error) { + aqs.Type = TypeAzureQueueSink + objectMap := make(map[string]interface{}) + objectMap["writeBatchSize"] = aqs.WriteBatchSize + objectMap["writeBatchTimeout"] = aqs.WriteBatchTimeout + objectMap["sinkRetryCount"] = aqs.SinkRetryCount + objectMap["sinkRetryWait"] = aqs.SinkRetryWait + if aqs.Type != "" { + objectMap["type"] = aqs.Type + } + for k, v := range aqs.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsSalesforceSink is the BasicCopySink implementation for AzureQueueSink. +func (aqs AzureQueueSink) AsSalesforceSink() (*SalesforceSink, bool) { + return nil, false +} + +// AsDynamicsSink is the BasicCopySink implementation for AzureQueueSink. +func (aqs AzureQueueSink) AsDynamicsSink() (*DynamicsSink, bool) { + return nil, false +} + +// AsOdbcSink is the BasicCopySink implementation for AzureQueueSink. +func (aqs AzureQueueSink) AsOdbcSink() (*OdbcSink, bool) { + return nil, false +} + +// AsAzureSearchIndexSink is the BasicCopySink implementation for AzureQueueSink. +func (aqs AzureQueueSink) AsAzureSearchIndexSink() (*AzureSearchIndexSink, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSink is the BasicCopySink implementation for AzureQueueSink. +func (aqs AzureQueueSink) AsAzureDataLakeStoreSink() (*AzureDataLakeStoreSink, bool) { + return nil, false +} + +// AsOracleSink is the BasicCopySink implementation for AzureQueueSink. +func (aqs AzureQueueSink) AsOracleSink() (*OracleSink, bool) { + return nil, false +} + +// AsSQLDWSink is the BasicCopySink implementation for AzureQueueSink. +func (aqs AzureQueueSink) AsSQLDWSink() (*SQLDWSink, bool) { + return nil, false +} + +// AsSQLSink is the BasicCopySink implementation for AzureQueueSink. +func (aqs AzureQueueSink) AsSQLSink() (*SQLSink, bool) { + return nil, false +} + +// AsDocumentDbCollectionSink is the BasicCopySink implementation for AzureQueueSink. +func (aqs AzureQueueSink) AsDocumentDbCollectionSink() (*DocumentDbCollectionSink, bool) { + return nil, false +} + +// AsFileSystemSink is the BasicCopySink implementation for AzureQueueSink. +func (aqs AzureQueueSink) AsFileSystemSink() (*FileSystemSink, bool) { + return nil, false +} + +// AsBlobSink is the BasicCopySink implementation for AzureQueueSink. +func (aqs AzureQueueSink) AsBlobSink() (*BlobSink, bool) { + return nil, false +} + +// AsAzureTableSink is the BasicCopySink implementation for AzureQueueSink. +func (aqs AzureQueueSink) AsAzureTableSink() (*AzureTableSink, bool) { + return nil, false +} + +// AsAzureQueueSink is the BasicCopySink implementation for AzureQueueSink. +func (aqs AzureQueueSink) AsAzureQueueSink() (*AzureQueueSink, bool) { + return &aqs, true +} + +// AsSapCloudForCustomerSink is the BasicCopySink implementation for AzureQueueSink. +func (aqs AzureQueueSink) AsSapCloudForCustomerSink() (*SapCloudForCustomerSink, bool) { + return nil, false +} + +// AsCopySink is the BasicCopySink implementation for AzureQueueSink. +func (aqs AzureQueueSink) AsCopySink() (*CopySink, bool) { + return nil, false +} + +// AsBasicCopySink is the BasicCopySink implementation for AzureQueueSink. +func (aqs AzureQueueSink) AsBasicCopySink() (BasicCopySink, bool) { + return &aqs, true +} + +// AzureSearchIndexDataset the Azure Search Index. +type AzureSearchIndexDataset struct { + // AzureSearchIndexDatasetTypeProperties - Properties specific to this dataset type. + *AzureSearchIndexDatasetTypeProperties `json:"typeProperties,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Description - Dataset description. + Description *string `json:"description,omitempty"` + // Structure - Columns that define the structure of the dataset. Type: array (or Expression with resultType array), itemType: DatasetDataElement. + Structure interface{} `json:"structure,omitempty"` + // LinkedServiceName - Linked service reference. + LinkedServiceName *LinkedServiceReference `json:"linkedServiceName,omitempty"` + // Parameters - Parameters for dataset. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeDataset', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSQLServerTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSalesforceObject', 'TypeRelationalTable', 'TypeAzureMySQLTable', 'TypeOracleTable', 'TypeODataResource', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeAzureDataLakeStoreFile', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeAmazonS3Object' + Type TypeBasicDataset `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureSearchIndexDataset. +func (asid AzureSearchIndexDataset) MarshalJSON() ([]byte, error) { + asid.Type = TypeAzureSearchIndex + objectMap := make(map[string]interface{}) + if asid.AzureSearchIndexDatasetTypeProperties != nil { + objectMap["typeProperties"] = asid.AzureSearchIndexDatasetTypeProperties + } + if asid.Description != nil { + objectMap["description"] = asid.Description + } + objectMap["structure"] = asid.Structure + if asid.LinkedServiceName != nil { + objectMap["linkedServiceName"] = asid.LinkedServiceName + } + if asid.Parameters != nil { + objectMap["parameters"] = asid.Parameters + } + if asid.Annotations != nil { + objectMap["annotations"] = asid.Annotations + } + if asid.Type != "" { + objectMap["type"] = asid.Type + } + for k, v := range asid.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysObjectDataset is the BasicDataset implementation for AzureSearchIndexDataset. +func (asid AzureSearchIndexDataset) AsResponsysObjectDataset() (*ResponsysObjectDataset, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudObjectDataset is the BasicDataset implementation for AzureSearchIndexDataset. +func (asid AzureSearchIndexDataset) AsSalesforceMarketingCloudObjectDataset() (*SalesforceMarketingCloudObjectDataset, bool) { + return nil, false +} + +// AsVerticaTableDataset is the BasicDataset implementation for AzureSearchIndexDataset. +func (asid AzureSearchIndexDataset) AsVerticaTableDataset() (*VerticaTableDataset, bool) { + return nil, false +} + +// AsNetezzaTableDataset is the BasicDataset implementation for AzureSearchIndexDataset. +func (asid AzureSearchIndexDataset) AsNetezzaTableDataset() (*NetezzaTableDataset, bool) { + return nil, false +} + +// AsZohoObjectDataset is the BasicDataset implementation for AzureSearchIndexDataset. +func (asid AzureSearchIndexDataset) AsZohoObjectDataset() (*ZohoObjectDataset, bool) { + return nil, false +} + +// AsXeroObjectDataset is the BasicDataset implementation for AzureSearchIndexDataset. +func (asid AzureSearchIndexDataset) AsXeroObjectDataset() (*XeroObjectDataset, bool) { + return nil, false +} + +// AsSquareObjectDataset is the BasicDataset implementation for AzureSearchIndexDataset. +func (asid AzureSearchIndexDataset) AsSquareObjectDataset() (*SquareObjectDataset, bool) { + return nil, false +} + +// AsSparkObjectDataset is the BasicDataset implementation for AzureSearchIndexDataset. +func (asid AzureSearchIndexDataset) AsSparkObjectDataset() (*SparkObjectDataset, bool) { + return nil, false +} + +// AsShopifyObjectDataset is the BasicDataset implementation for AzureSearchIndexDataset. +func (asid AzureSearchIndexDataset) AsShopifyObjectDataset() (*ShopifyObjectDataset, bool) { + return nil, false +} + +// AsServiceNowObjectDataset is the BasicDataset implementation for AzureSearchIndexDataset. +func (asid AzureSearchIndexDataset) AsServiceNowObjectDataset() (*ServiceNowObjectDataset, bool) { + return nil, false +} + +// AsQuickBooksObjectDataset is the BasicDataset implementation for AzureSearchIndexDataset. +func (asid AzureSearchIndexDataset) AsQuickBooksObjectDataset() (*QuickBooksObjectDataset, bool) { + return nil, false +} + +// AsPrestoObjectDataset is the BasicDataset implementation for AzureSearchIndexDataset. +func (asid AzureSearchIndexDataset) AsPrestoObjectDataset() (*PrestoObjectDataset, bool) { + return nil, false +} + +// AsPhoenixObjectDataset is the BasicDataset implementation for AzureSearchIndexDataset. +func (asid AzureSearchIndexDataset) AsPhoenixObjectDataset() (*PhoenixObjectDataset, bool) { + return nil, false +} + +// AsPaypalObjectDataset is the BasicDataset implementation for AzureSearchIndexDataset. +func (asid AzureSearchIndexDataset) AsPaypalObjectDataset() (*PaypalObjectDataset, bool) { + return nil, false +} + +// AsMarketoObjectDataset is the BasicDataset implementation for AzureSearchIndexDataset. +func (asid AzureSearchIndexDataset) AsMarketoObjectDataset() (*MarketoObjectDataset, bool) { + return nil, false +} + +// AsMariaDBTableDataset is the BasicDataset implementation for AzureSearchIndexDataset. +func (asid AzureSearchIndexDataset) AsMariaDBTableDataset() (*MariaDBTableDataset, bool) { + return nil, false +} + +// AsMagentoObjectDataset is the BasicDataset implementation for AzureSearchIndexDataset. +func (asid AzureSearchIndexDataset) AsMagentoObjectDataset() (*MagentoObjectDataset, bool) { + return nil, false +} + +// AsJiraObjectDataset is the BasicDataset implementation for AzureSearchIndexDataset. +func (asid AzureSearchIndexDataset) AsJiraObjectDataset() (*JiraObjectDataset, bool) { + return nil, false +} + +// AsImpalaObjectDataset is the BasicDataset implementation for AzureSearchIndexDataset. +func (asid AzureSearchIndexDataset) AsImpalaObjectDataset() (*ImpalaObjectDataset, bool) { + return nil, false +} + +// AsHubspotObjectDataset is the BasicDataset implementation for AzureSearchIndexDataset. +func (asid AzureSearchIndexDataset) AsHubspotObjectDataset() (*HubspotObjectDataset, bool) { + return nil, false +} + +// AsHiveObjectDataset is the BasicDataset implementation for AzureSearchIndexDataset. +func (asid AzureSearchIndexDataset) AsHiveObjectDataset() (*HiveObjectDataset, bool) { + return nil, false +} + +// AsHBaseObjectDataset is the BasicDataset implementation for AzureSearchIndexDataset. +func (asid AzureSearchIndexDataset) AsHBaseObjectDataset() (*HBaseObjectDataset, bool) { + return nil, false +} + +// AsGreenplumTableDataset is the BasicDataset implementation for AzureSearchIndexDataset. +func (asid AzureSearchIndexDataset) AsGreenplumTableDataset() (*GreenplumTableDataset, bool) { + return nil, false +} + +// AsGoogleBigQueryObjectDataset is the BasicDataset implementation for AzureSearchIndexDataset. +func (asid AzureSearchIndexDataset) AsGoogleBigQueryObjectDataset() (*GoogleBigQueryObjectDataset, bool) { + return nil, false +} + +// AsEloquaObjectDataset is the BasicDataset implementation for AzureSearchIndexDataset. +func (asid AzureSearchIndexDataset) AsEloquaObjectDataset() (*EloquaObjectDataset, bool) { + return nil, false +} + +// AsDrillTableDataset is the BasicDataset implementation for AzureSearchIndexDataset. +func (asid AzureSearchIndexDataset) AsDrillTableDataset() (*DrillTableDataset, bool) { + return nil, false +} + +// AsCouchbaseTableDataset is the BasicDataset implementation for AzureSearchIndexDataset. +func (asid AzureSearchIndexDataset) AsCouchbaseTableDataset() (*CouchbaseTableDataset, bool) { + return nil, false +} + +// AsConcurObjectDataset is the BasicDataset implementation for AzureSearchIndexDataset. +func (asid AzureSearchIndexDataset) AsConcurObjectDataset() (*ConcurObjectDataset, bool) { + return nil, false +} + +// AsAzurePostgreSQLTableDataset is the BasicDataset implementation for AzureSearchIndexDataset. +func (asid AzureSearchIndexDataset) AsAzurePostgreSQLTableDataset() (*AzurePostgreSQLTableDataset, bool) { + return nil, false +} + +// AsAmazonMWSObjectDataset is the BasicDataset implementation for AzureSearchIndexDataset. +func (asid AzureSearchIndexDataset) AsAmazonMWSObjectDataset() (*AmazonMWSObjectDataset, bool) { + return nil, false +} + +// AsHTTPDataset is the BasicDataset implementation for AzureSearchIndexDataset. +func (asid AzureSearchIndexDataset) AsHTTPDataset() (*HTTPDataset, bool) { + return nil, false +} + +// AsAzureSearchIndexDataset is the BasicDataset implementation for AzureSearchIndexDataset. +func (asid AzureSearchIndexDataset) AsAzureSearchIndexDataset() (*AzureSearchIndexDataset, bool) { + return &asid, true +} + +// AsWebTableDataset is the BasicDataset implementation for AzureSearchIndexDataset. +func (asid AzureSearchIndexDataset) AsWebTableDataset() (*WebTableDataset, bool) { + return nil, false +} + +// AsSQLServerTableDataset is the BasicDataset implementation for AzureSearchIndexDataset. +func (asid AzureSearchIndexDataset) AsSQLServerTableDataset() (*SQLServerTableDataset, bool) { + return nil, false +} + +// AsSapEccResourceDataset is the BasicDataset implementation for AzureSearchIndexDataset. +func (asid AzureSearchIndexDataset) AsSapEccResourceDataset() (*SapEccResourceDataset, bool) { + return nil, false +} + +// AsSapCloudForCustomerResourceDataset is the BasicDataset implementation for AzureSearchIndexDataset. +func (asid AzureSearchIndexDataset) AsSapCloudForCustomerResourceDataset() (*SapCloudForCustomerResourceDataset, bool) { + return nil, false +} + +// AsSalesforceObjectDataset is the BasicDataset implementation for AzureSearchIndexDataset. +func (asid AzureSearchIndexDataset) AsSalesforceObjectDataset() (*SalesforceObjectDataset, bool) { + return nil, false +} + +// AsRelationalTableDataset is the BasicDataset implementation for AzureSearchIndexDataset. +func (asid AzureSearchIndexDataset) AsRelationalTableDataset() (*RelationalTableDataset, bool) { + return nil, false +} + +// AsAzureMySQLTableDataset is the BasicDataset implementation for AzureSearchIndexDataset. +func (asid AzureSearchIndexDataset) AsAzureMySQLTableDataset() (*AzureMySQLTableDataset, bool) { + return nil, false +} + +// AsOracleTableDataset is the BasicDataset implementation for AzureSearchIndexDataset. +func (asid AzureSearchIndexDataset) AsOracleTableDataset() (*OracleTableDataset, bool) { + return nil, false +} + +// AsODataResourceDataset is the BasicDataset implementation for AzureSearchIndexDataset. +func (asid AzureSearchIndexDataset) AsODataResourceDataset() (*ODataResourceDataset, bool) { + return nil, false +} + +// AsMongoDbCollectionDataset is the BasicDataset implementation for AzureSearchIndexDataset. +func (asid AzureSearchIndexDataset) AsMongoDbCollectionDataset() (*MongoDbCollectionDataset, bool) { + return nil, false +} + +// AsFileShareDataset is the BasicDataset implementation for AzureSearchIndexDataset. +func (asid AzureSearchIndexDataset) AsFileShareDataset() (*FileShareDataset, bool) { + return nil, false +} + +// AsAzureDataLakeStoreDataset is the BasicDataset implementation for AzureSearchIndexDataset. +func (asid AzureSearchIndexDataset) AsAzureDataLakeStoreDataset() (*AzureDataLakeStoreDataset, bool) { + return nil, false +} + +// AsDynamicsEntityDataset is the BasicDataset implementation for AzureSearchIndexDataset. +func (asid AzureSearchIndexDataset) AsDynamicsEntityDataset() (*DynamicsEntityDataset, bool) { + return nil, false +} + +// AsDocumentDbCollectionDataset is the BasicDataset implementation for AzureSearchIndexDataset. +func (asid AzureSearchIndexDataset) AsDocumentDbCollectionDataset() (*DocumentDbCollectionDataset, bool) { + return nil, false +} + +// AsCustomDataset is the BasicDataset implementation for AzureSearchIndexDataset. +func (asid AzureSearchIndexDataset) AsCustomDataset() (*CustomDataset, bool) { + return nil, false +} + +// AsCassandraTableDataset is the BasicDataset implementation for AzureSearchIndexDataset. +func (asid AzureSearchIndexDataset) AsCassandraTableDataset() (*CassandraTableDataset, bool) { + return nil, false +} + +// AsAzureSQLDWTableDataset is the BasicDataset implementation for AzureSearchIndexDataset. +func (asid AzureSearchIndexDataset) AsAzureSQLDWTableDataset() (*AzureSQLDWTableDataset, bool) { + return nil, false +} + +// AsAzureSQLTableDataset is the BasicDataset implementation for AzureSearchIndexDataset. +func (asid AzureSearchIndexDataset) AsAzureSQLTableDataset() (*AzureSQLTableDataset, bool) { + return nil, false +} + +// AsAzureTableDataset is the BasicDataset implementation for AzureSearchIndexDataset. +func (asid AzureSearchIndexDataset) AsAzureTableDataset() (*AzureTableDataset, bool) { + return nil, false +} + +// AsAzureBlobDataset is the BasicDataset implementation for AzureSearchIndexDataset. +func (asid AzureSearchIndexDataset) AsAzureBlobDataset() (*AzureBlobDataset, bool) { + return nil, false +} + +// AsAmazonS3Dataset is the BasicDataset implementation for AzureSearchIndexDataset. +func (asid AzureSearchIndexDataset) AsAmazonS3Dataset() (*AmazonS3Dataset, bool) { + return nil, false +} + +// AsDataset is the BasicDataset implementation for AzureSearchIndexDataset. +func (asid AzureSearchIndexDataset) AsDataset() (*Dataset, bool) { + return nil, false +} + +// AsBasicDataset is the BasicDataset implementation for AzureSearchIndexDataset. +func (asid AzureSearchIndexDataset) AsBasicDataset() (BasicDataset, bool) { + return &asid, true +} + +// UnmarshalJSON is the custom unmarshaler for AzureSearchIndexDataset struct. +func (asid *AzureSearchIndexDataset) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "typeProperties": + if v != nil { + var azureSearchIndexDatasetTypeProperties AzureSearchIndexDatasetTypeProperties + err = json.Unmarshal(*v, &azureSearchIndexDatasetTypeProperties) + if err != nil { + return err + } + asid.AzureSearchIndexDatasetTypeProperties = &azureSearchIndexDatasetTypeProperties + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if asid.AdditionalProperties == nil { + asid.AdditionalProperties = make(map[string]interface{}) + } + asid.AdditionalProperties[k] = additionalProperties + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + asid.Description = &description + } + case "structure": + if v != nil { + var structure interface{} + err = json.Unmarshal(*v, &structure) + if err != nil { + return err + } + asid.Structure = structure + } + case "linkedServiceName": + if v != nil { + var linkedServiceName LinkedServiceReference + err = json.Unmarshal(*v, &linkedServiceName) + if err != nil { + return err + } + asid.LinkedServiceName = &linkedServiceName + } + case "parameters": + if v != nil { + var parameters map[string]*ParameterSpecification + err = json.Unmarshal(*v, ¶meters) + if err != nil { + return err + } + asid.Parameters = parameters + } + case "annotations": + if v != nil { + var annotations []interface{} + err = json.Unmarshal(*v, &annotations) + if err != nil { + return err + } + asid.Annotations = &annotations + } + case "type": + if v != nil { + var typeVar TypeBasicDataset + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + asid.Type = typeVar + } + } + } + + return nil +} + +// AzureSearchIndexDatasetTypeProperties properties specific to this dataset type. +type AzureSearchIndexDatasetTypeProperties struct { + // IndexName - The name of the Azure Search Index. Type: string (or Expression with resultType string). + IndexName interface{} `json:"indexName,omitempty"` +} + +// AzureSearchIndexSink a copy activity Azure Search Index sink. +type AzureSearchIndexSink struct { + // WriteBehavior - Specify the write behavior when upserting documents into Azure Search Index. Possible values include: 'Merge', 'Upload' + WriteBehavior AzureSearchIndexWriteBehaviorType `json:"writeBehavior,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // WriteBatchSize - Write batch size. Type: integer (or Expression with resultType integer), minimum: 0. + WriteBatchSize interface{} `json:"writeBatchSize,omitempty"` + // WriteBatchTimeout - Write batch timeout. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + WriteBatchTimeout interface{} `json:"writeBatchTimeout,omitempty"` + // SinkRetryCount - Sink retry count. Type: integer (or Expression with resultType integer). + SinkRetryCount interface{} `json:"sinkRetryCount,omitempty"` + // SinkRetryWait - Sink retry wait. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + SinkRetryWait interface{} `json:"sinkRetryWait,omitempty"` + // Type - Possible values include: 'TypeCopySink', 'TypeSalesforceSink', 'TypeDynamicsSink', 'TypeOdbcSink', 'TypeAzureSearchIndexSink', 'TypeAzureDataLakeStoreSink', 'TypeOracleSink', 'TypeSQLDWSink', 'TypeSQLSink', 'TypeDocumentDbCollectionSink', 'TypeFileSystemSink', 'TypeBlobSink', 'TypeAzureTableSink', 'TypeAzureQueueSink', 'TypeSapCloudForCustomerSink' + Type TypeBasicCopySink `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureSearchIndexSink. +func (asis AzureSearchIndexSink) MarshalJSON() ([]byte, error) { + asis.Type = TypeAzureSearchIndexSink + objectMap := make(map[string]interface{}) + if asis.WriteBehavior != "" { + objectMap["writeBehavior"] = asis.WriteBehavior + } + objectMap["writeBatchSize"] = asis.WriteBatchSize + objectMap["writeBatchTimeout"] = asis.WriteBatchTimeout + objectMap["sinkRetryCount"] = asis.SinkRetryCount + objectMap["sinkRetryWait"] = asis.SinkRetryWait + if asis.Type != "" { + objectMap["type"] = asis.Type + } + for k, v := range asis.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsSalesforceSink is the BasicCopySink implementation for AzureSearchIndexSink. +func (asis AzureSearchIndexSink) AsSalesforceSink() (*SalesforceSink, bool) { + return nil, false +} + +// AsDynamicsSink is the BasicCopySink implementation for AzureSearchIndexSink. +func (asis AzureSearchIndexSink) AsDynamicsSink() (*DynamicsSink, bool) { + return nil, false +} + +// AsOdbcSink is the BasicCopySink implementation for AzureSearchIndexSink. +func (asis AzureSearchIndexSink) AsOdbcSink() (*OdbcSink, bool) { + return nil, false +} + +// AsAzureSearchIndexSink is the BasicCopySink implementation for AzureSearchIndexSink. +func (asis AzureSearchIndexSink) AsAzureSearchIndexSink() (*AzureSearchIndexSink, bool) { + return &asis, true +} + +// AsAzureDataLakeStoreSink is the BasicCopySink implementation for AzureSearchIndexSink. +func (asis AzureSearchIndexSink) AsAzureDataLakeStoreSink() (*AzureDataLakeStoreSink, bool) { + return nil, false +} + +// AsOracleSink is the BasicCopySink implementation for AzureSearchIndexSink. +func (asis AzureSearchIndexSink) AsOracleSink() (*OracleSink, bool) { + return nil, false +} + +// AsSQLDWSink is the BasicCopySink implementation for AzureSearchIndexSink. +func (asis AzureSearchIndexSink) AsSQLDWSink() (*SQLDWSink, bool) { + return nil, false +} + +// AsSQLSink is the BasicCopySink implementation for AzureSearchIndexSink. +func (asis AzureSearchIndexSink) AsSQLSink() (*SQLSink, bool) { + return nil, false +} + +// AsDocumentDbCollectionSink is the BasicCopySink implementation for AzureSearchIndexSink. +func (asis AzureSearchIndexSink) AsDocumentDbCollectionSink() (*DocumentDbCollectionSink, bool) { + return nil, false +} + +// AsFileSystemSink is the BasicCopySink implementation for AzureSearchIndexSink. +func (asis AzureSearchIndexSink) AsFileSystemSink() (*FileSystemSink, bool) { + return nil, false +} + +// AsBlobSink is the BasicCopySink implementation for AzureSearchIndexSink. +func (asis AzureSearchIndexSink) AsBlobSink() (*BlobSink, bool) { + return nil, false +} + +// AsAzureTableSink is the BasicCopySink implementation for AzureSearchIndexSink. +func (asis AzureSearchIndexSink) AsAzureTableSink() (*AzureTableSink, bool) { + return nil, false +} + +// AsAzureQueueSink is the BasicCopySink implementation for AzureSearchIndexSink. +func (asis AzureSearchIndexSink) AsAzureQueueSink() (*AzureQueueSink, bool) { + return nil, false +} + +// AsSapCloudForCustomerSink is the BasicCopySink implementation for AzureSearchIndexSink. +func (asis AzureSearchIndexSink) AsSapCloudForCustomerSink() (*SapCloudForCustomerSink, bool) { + return nil, false +} + +// AsCopySink is the BasicCopySink implementation for AzureSearchIndexSink. +func (asis AzureSearchIndexSink) AsCopySink() (*CopySink, bool) { + return nil, false +} + +// AsBasicCopySink is the BasicCopySink implementation for AzureSearchIndexSink. +func (asis AzureSearchIndexSink) AsBasicCopySink() (BasicCopySink, bool) { + return &asis, true +} + +// AzureSearchLinkedService linked service for Windows Azure Search Service. +type AzureSearchLinkedService struct { + // AzureSearchLinkedServiceTypeProperties - Windows Azure Search Service linked service properties. + *AzureSearchLinkedServiceTypeProperties `json:"typeProperties,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // ConnectVia - The integration runtime reference. + ConnectVia *IntegrationRuntimeReference `json:"connectVia,omitempty"` + // Description - Linked service description. + Description *string `json:"description,omitempty"` + // Parameters - Parameters for linked service. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeLinkedService', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforce', 'TypeAzureDataLakeStore', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureStorage' + Type TypeBasicLinkedService `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureSearchLinkedService. +func (asls AzureSearchLinkedService) MarshalJSON() ([]byte, error) { + asls.Type = TypeAzureSearch + objectMap := make(map[string]interface{}) + if asls.AzureSearchLinkedServiceTypeProperties != nil { + objectMap["typeProperties"] = asls.AzureSearchLinkedServiceTypeProperties + } + if asls.ConnectVia != nil { + objectMap["connectVia"] = asls.ConnectVia + } + if asls.Description != nil { + objectMap["description"] = asls.Description + } + if asls.Parameters != nil { + objectMap["parameters"] = asls.Parameters + } + if asls.Annotations != nil { + objectMap["annotations"] = asls.Annotations + } + if asls.Type != "" { + objectMap["type"] = asls.Type + } + for k, v := range asls.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysLinkedService is the BasicLinkedService implementation for AzureSearchLinkedService. +func (asls AzureSearchLinkedService) AsResponsysLinkedService() (*ResponsysLinkedService, bool) { + return nil, false +} + +// AsAzureDatabricksLinkedService is the BasicLinkedService implementation for AzureSearchLinkedService. +func (asls AzureSearchLinkedService) AsAzureDatabricksLinkedService() (*AzureDatabricksLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeAnalyticsLinkedService is the BasicLinkedService implementation for AzureSearchLinkedService. +func (asls AzureSearchLinkedService) AsAzureDataLakeAnalyticsLinkedService() (*AzureDataLakeAnalyticsLinkedService, bool) { + return nil, false +} + +// AsHDInsightOnDemandLinkedService is the BasicLinkedService implementation for AzureSearchLinkedService. +func (asls AzureSearchLinkedService) AsHDInsightOnDemandLinkedService() (*HDInsightOnDemandLinkedService, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudLinkedService is the BasicLinkedService implementation for AzureSearchLinkedService. +func (asls AzureSearchLinkedService) AsSalesforceMarketingCloudLinkedService() (*SalesforceMarketingCloudLinkedService, bool) { + return nil, false +} + +// AsNetezzaLinkedService is the BasicLinkedService implementation for AzureSearchLinkedService. +func (asls AzureSearchLinkedService) AsNetezzaLinkedService() (*NetezzaLinkedService, bool) { + return nil, false +} + +// AsVerticaLinkedService is the BasicLinkedService implementation for AzureSearchLinkedService. +func (asls AzureSearchLinkedService) AsVerticaLinkedService() (*VerticaLinkedService, bool) { + return nil, false +} + +// AsZohoLinkedService is the BasicLinkedService implementation for AzureSearchLinkedService. +func (asls AzureSearchLinkedService) AsZohoLinkedService() (*ZohoLinkedService, bool) { + return nil, false +} + +// AsXeroLinkedService is the BasicLinkedService implementation for AzureSearchLinkedService. +func (asls AzureSearchLinkedService) AsXeroLinkedService() (*XeroLinkedService, bool) { + return nil, false +} + +// AsSquareLinkedService is the BasicLinkedService implementation for AzureSearchLinkedService. +func (asls AzureSearchLinkedService) AsSquareLinkedService() (*SquareLinkedService, bool) { + return nil, false +} + +// AsSparkLinkedService is the BasicLinkedService implementation for AzureSearchLinkedService. +func (asls AzureSearchLinkedService) AsSparkLinkedService() (*SparkLinkedService, bool) { + return nil, false +} + +// AsShopifyLinkedService is the BasicLinkedService implementation for AzureSearchLinkedService. +func (asls AzureSearchLinkedService) AsShopifyLinkedService() (*ShopifyLinkedService, bool) { + return nil, false +} + +// AsServiceNowLinkedService is the BasicLinkedService implementation for AzureSearchLinkedService. +func (asls AzureSearchLinkedService) AsServiceNowLinkedService() (*ServiceNowLinkedService, bool) { + return nil, false +} + +// AsQuickBooksLinkedService is the BasicLinkedService implementation for AzureSearchLinkedService. +func (asls AzureSearchLinkedService) AsQuickBooksLinkedService() (*QuickBooksLinkedService, bool) { + return nil, false +} + +// AsPrestoLinkedService is the BasicLinkedService implementation for AzureSearchLinkedService. +func (asls AzureSearchLinkedService) AsPrestoLinkedService() (*PrestoLinkedService, bool) { + return nil, false +} + +// AsPhoenixLinkedService is the BasicLinkedService implementation for AzureSearchLinkedService. +func (asls AzureSearchLinkedService) AsPhoenixLinkedService() (*PhoenixLinkedService, bool) { + return nil, false +} + +// AsPaypalLinkedService is the BasicLinkedService implementation for AzureSearchLinkedService. +func (asls AzureSearchLinkedService) AsPaypalLinkedService() (*PaypalLinkedService, bool) { + return nil, false +} + +// AsMarketoLinkedService is the BasicLinkedService implementation for AzureSearchLinkedService. +func (asls AzureSearchLinkedService) AsMarketoLinkedService() (*MarketoLinkedService, bool) { + return nil, false +} + +// AsMariaDBLinkedService is the BasicLinkedService implementation for AzureSearchLinkedService. +func (asls AzureSearchLinkedService) AsMariaDBLinkedService() (*MariaDBLinkedService, bool) { + return nil, false +} + +// AsMagentoLinkedService is the BasicLinkedService implementation for AzureSearchLinkedService. +func (asls AzureSearchLinkedService) AsMagentoLinkedService() (*MagentoLinkedService, bool) { + return nil, false +} + +// AsJiraLinkedService is the BasicLinkedService implementation for AzureSearchLinkedService. +func (asls AzureSearchLinkedService) AsJiraLinkedService() (*JiraLinkedService, bool) { + return nil, false +} + +// AsImpalaLinkedService is the BasicLinkedService implementation for AzureSearchLinkedService. +func (asls AzureSearchLinkedService) AsImpalaLinkedService() (*ImpalaLinkedService, bool) { + return nil, false +} + +// AsHubspotLinkedService is the BasicLinkedService implementation for AzureSearchLinkedService. +func (asls AzureSearchLinkedService) AsHubspotLinkedService() (*HubspotLinkedService, bool) { + return nil, false +} + +// AsHiveLinkedService is the BasicLinkedService implementation for AzureSearchLinkedService. +func (asls AzureSearchLinkedService) AsHiveLinkedService() (*HiveLinkedService, bool) { + return nil, false +} + +// AsHBaseLinkedService is the BasicLinkedService implementation for AzureSearchLinkedService. +func (asls AzureSearchLinkedService) AsHBaseLinkedService() (*HBaseLinkedService, bool) { + return nil, false +} + +// AsGreenplumLinkedService is the BasicLinkedService implementation for AzureSearchLinkedService. +func (asls AzureSearchLinkedService) AsGreenplumLinkedService() (*GreenplumLinkedService, bool) { + return nil, false +} + +// AsGoogleBigQueryLinkedService is the BasicLinkedService implementation for AzureSearchLinkedService. +func (asls AzureSearchLinkedService) AsGoogleBigQueryLinkedService() (*GoogleBigQueryLinkedService, bool) { + return nil, false +} + +// AsEloquaLinkedService is the BasicLinkedService implementation for AzureSearchLinkedService. +func (asls AzureSearchLinkedService) AsEloquaLinkedService() (*EloquaLinkedService, bool) { + return nil, false +} + +// AsDrillLinkedService is the BasicLinkedService implementation for AzureSearchLinkedService. +func (asls AzureSearchLinkedService) AsDrillLinkedService() (*DrillLinkedService, bool) { + return nil, false +} + +// AsCouchbaseLinkedService is the BasicLinkedService implementation for AzureSearchLinkedService. +func (asls AzureSearchLinkedService) AsCouchbaseLinkedService() (*CouchbaseLinkedService, bool) { + return nil, false +} + +// AsConcurLinkedService is the BasicLinkedService implementation for AzureSearchLinkedService. +func (asls AzureSearchLinkedService) AsConcurLinkedService() (*ConcurLinkedService, bool) { + return nil, false +} + +// AsAzurePostgreSQLLinkedService is the BasicLinkedService implementation for AzureSearchLinkedService. +func (asls AzureSearchLinkedService) AsAzurePostgreSQLLinkedService() (*AzurePostgreSQLLinkedService, bool) { + return nil, false +} + +// AsAmazonMWSLinkedService is the BasicLinkedService implementation for AzureSearchLinkedService. +func (asls AzureSearchLinkedService) AsAmazonMWSLinkedService() (*AmazonMWSLinkedService, bool) { + return nil, false +} + +// AsSapHanaLinkedService is the BasicLinkedService implementation for AzureSearchLinkedService. +func (asls AzureSearchLinkedService) AsSapHanaLinkedService() (*SapHanaLinkedService, bool) { + return nil, false +} + +// AsSapBWLinkedService is the BasicLinkedService implementation for AzureSearchLinkedService. +func (asls AzureSearchLinkedService) AsSapBWLinkedService() (*SapBWLinkedService, bool) { + return nil, false +} + +// AsSftpServerLinkedService is the BasicLinkedService implementation for AzureSearchLinkedService. +func (asls AzureSearchLinkedService) AsSftpServerLinkedService() (*SftpServerLinkedService, bool) { + return nil, false +} + +// AsFtpServerLinkedService is the BasicLinkedService implementation for AzureSearchLinkedService. +func (asls AzureSearchLinkedService) AsFtpServerLinkedService() (*FtpServerLinkedService, bool) { + return nil, false +} + +// AsHTTPLinkedService is the BasicLinkedService implementation for AzureSearchLinkedService. +func (asls AzureSearchLinkedService) AsHTTPLinkedService() (*HTTPLinkedService, bool) { + return nil, false +} + +// AsAzureSearchLinkedService is the BasicLinkedService implementation for AzureSearchLinkedService. +func (asls AzureSearchLinkedService) AsAzureSearchLinkedService() (*AzureSearchLinkedService, bool) { + return &asls, true +} + +// AsCustomDataSourceLinkedService is the BasicLinkedService implementation for AzureSearchLinkedService. +func (asls AzureSearchLinkedService) AsCustomDataSourceLinkedService() (*CustomDataSourceLinkedService, bool) { + return nil, false +} + +// AsAmazonRedshiftLinkedService is the BasicLinkedService implementation for AzureSearchLinkedService. +func (asls AzureSearchLinkedService) AsAmazonRedshiftLinkedService() (*AmazonRedshiftLinkedService, bool) { + return nil, false +} + +// AsAmazonS3LinkedService is the BasicLinkedService implementation for AzureSearchLinkedService. +func (asls AzureSearchLinkedService) AsAmazonS3LinkedService() (*AmazonS3LinkedService, bool) { + return nil, false +} + +// AsSapEccLinkedService is the BasicLinkedService implementation for AzureSearchLinkedService. +func (asls AzureSearchLinkedService) AsSapEccLinkedService() (*SapEccLinkedService, bool) { + return nil, false +} + +// AsSapCloudForCustomerLinkedService is the BasicLinkedService implementation for AzureSearchLinkedService. +func (asls AzureSearchLinkedService) AsSapCloudForCustomerLinkedService() (*SapCloudForCustomerLinkedService, bool) { + return nil, false +} + +// AsSalesforceLinkedService is the BasicLinkedService implementation for AzureSearchLinkedService. +func (asls AzureSearchLinkedService) AsSalesforceLinkedService() (*SalesforceLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeStoreLinkedService is the BasicLinkedService implementation for AzureSearchLinkedService. +func (asls AzureSearchLinkedService) AsAzureDataLakeStoreLinkedService() (*AzureDataLakeStoreLinkedService, bool) { + return nil, false +} + +// AsMongoDbLinkedService is the BasicLinkedService implementation for AzureSearchLinkedService. +func (asls AzureSearchLinkedService) AsMongoDbLinkedService() (*MongoDbLinkedService, bool) { + return nil, false +} + +// AsCassandraLinkedService is the BasicLinkedService implementation for AzureSearchLinkedService. +func (asls AzureSearchLinkedService) AsCassandraLinkedService() (*CassandraLinkedService, bool) { + return nil, false +} + +// AsWebLinkedService is the BasicLinkedService implementation for AzureSearchLinkedService. +func (asls AzureSearchLinkedService) AsWebLinkedService() (*WebLinkedService, bool) { + return nil, false +} + +// AsODataLinkedService is the BasicLinkedService implementation for AzureSearchLinkedService. +func (asls AzureSearchLinkedService) AsODataLinkedService() (*ODataLinkedService, bool) { + return nil, false +} + +// AsHdfsLinkedService is the BasicLinkedService implementation for AzureSearchLinkedService. +func (asls AzureSearchLinkedService) AsHdfsLinkedService() (*HdfsLinkedService, bool) { + return nil, false +} + +// AsOdbcLinkedService is the BasicLinkedService implementation for AzureSearchLinkedService. +func (asls AzureSearchLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, bool) { + return nil, false +} + +// AsAzureMLLinkedService is the BasicLinkedService implementation for AzureSearchLinkedService. +func (asls AzureSearchLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { + return nil, false +} + +// AsTeradataLinkedService is the BasicLinkedService implementation for AzureSearchLinkedService. +func (asls AzureSearchLinkedService) AsTeradataLinkedService() (*TeradataLinkedService, bool) { + return nil, false +} + +// AsDb2LinkedService is the BasicLinkedService implementation for AzureSearchLinkedService. +func (asls AzureSearchLinkedService) AsDb2LinkedService() (*Db2LinkedService, bool) { + return nil, false +} + +// AsSybaseLinkedService is the BasicLinkedService implementation for AzureSearchLinkedService. +func (asls AzureSearchLinkedService) AsSybaseLinkedService() (*SybaseLinkedService, bool) { + return nil, false +} + +// AsPostgreSQLLinkedService is the BasicLinkedService implementation for AzureSearchLinkedService. +func (asls AzureSearchLinkedService) AsPostgreSQLLinkedService() (*PostgreSQLLinkedService, bool) { + return nil, false +} + +// AsMySQLLinkedService is the BasicLinkedService implementation for AzureSearchLinkedService. +func (asls AzureSearchLinkedService) AsMySQLLinkedService() (*MySQLLinkedService, bool) { + return nil, false +} + +// AsAzureMySQLLinkedService is the BasicLinkedService implementation for AzureSearchLinkedService. +func (asls AzureSearchLinkedService) AsAzureMySQLLinkedService() (*AzureMySQLLinkedService, bool) { + return nil, false +} + +// AsOracleLinkedService is the BasicLinkedService implementation for AzureSearchLinkedService. +func (asls AzureSearchLinkedService) AsOracleLinkedService() (*OracleLinkedService, bool) { + return nil, false +} + +// AsFileServerLinkedService is the BasicLinkedService implementation for AzureSearchLinkedService. +func (asls AzureSearchLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { + return nil, false +} + +// AsHDInsightLinkedService is the BasicLinkedService implementation for AzureSearchLinkedService. +func (asls AzureSearchLinkedService) AsHDInsightLinkedService() (*HDInsightLinkedService, bool) { + return nil, false +} + +// AsDynamicsLinkedService is the BasicLinkedService implementation for AzureSearchLinkedService. +func (asls AzureSearchLinkedService) AsDynamicsLinkedService() (*DynamicsLinkedService, bool) { + return nil, false +} + +// AsCosmosDbLinkedService is the BasicLinkedService implementation for AzureSearchLinkedService. +func (asls AzureSearchLinkedService) AsCosmosDbLinkedService() (*CosmosDbLinkedService, bool) { + return nil, false +} + +// AsAzureKeyVaultLinkedService is the BasicLinkedService implementation for AzureSearchLinkedService. +func (asls AzureSearchLinkedService) AsAzureKeyVaultLinkedService() (*AzureKeyVaultLinkedService, bool) { + return nil, false +} + +// AsAzureBatchLinkedService is the BasicLinkedService implementation for AzureSearchLinkedService. +func (asls AzureSearchLinkedService) AsAzureBatchLinkedService() (*AzureBatchLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDatabaseLinkedService is the BasicLinkedService implementation for AzureSearchLinkedService. +func (asls AzureSearchLinkedService) AsAzureSQLDatabaseLinkedService() (*AzureSQLDatabaseLinkedService, bool) { + return nil, false +} + +// AsSQLServerLinkedService is the BasicLinkedService implementation for AzureSearchLinkedService. +func (asls AzureSearchLinkedService) AsSQLServerLinkedService() (*SQLServerLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDWLinkedService is the BasicLinkedService implementation for AzureSearchLinkedService. +func (asls AzureSearchLinkedService) AsAzureSQLDWLinkedService() (*AzureSQLDWLinkedService, bool) { + return nil, false +} + +// AsAzureStorageLinkedService is the BasicLinkedService implementation for AzureSearchLinkedService. +func (asls AzureSearchLinkedService) AsAzureStorageLinkedService() (*AzureStorageLinkedService, bool) { + return nil, false +} + +// AsLinkedService is the BasicLinkedService implementation for AzureSearchLinkedService. +func (asls AzureSearchLinkedService) AsLinkedService() (*LinkedService, bool) { + return nil, false +} + +// AsBasicLinkedService is the BasicLinkedService implementation for AzureSearchLinkedService. +func (asls AzureSearchLinkedService) AsBasicLinkedService() (BasicLinkedService, bool) { + return &asls, true +} + +// UnmarshalJSON is the custom unmarshaler for AzureSearchLinkedService struct. +func (asls *AzureSearchLinkedService) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "typeProperties": + if v != nil { + var azureSearchLinkedServiceTypeProperties AzureSearchLinkedServiceTypeProperties + err = json.Unmarshal(*v, &azureSearchLinkedServiceTypeProperties) + if err != nil { + return err + } + asls.AzureSearchLinkedServiceTypeProperties = &azureSearchLinkedServiceTypeProperties + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if asls.AdditionalProperties == nil { + asls.AdditionalProperties = make(map[string]interface{}) + } + asls.AdditionalProperties[k] = additionalProperties + } + case "connectVia": + if v != nil { + var connectVia IntegrationRuntimeReference + err = json.Unmarshal(*v, &connectVia) + if err != nil { + return err + } + asls.ConnectVia = &connectVia + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + asls.Description = &description + } + case "parameters": + if v != nil { + var parameters map[string]*ParameterSpecification + err = json.Unmarshal(*v, ¶meters) + if err != nil { + return err + } + asls.Parameters = parameters + } + case "annotations": + if v != nil { + var annotations []interface{} + err = json.Unmarshal(*v, &annotations) + if err != nil { + return err + } + asls.Annotations = &annotations + } + case "type": + if v != nil { + var typeVar TypeBasicLinkedService + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + asls.Type = typeVar + } + } + } + + return nil +} + +// AzureSearchLinkedServiceTypeProperties windows Azure Search Service linked service properties. +type AzureSearchLinkedServiceTypeProperties struct { + // URL - URL for Azure Search service. Type: string (or Expression with resultType string). + URL interface{} `json:"url,omitempty"` + // Key - Admin Key for Azure Search service + Key BasicSecretBase `json:"key,omitempty"` + // EncryptedCredential - The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string). + EncryptedCredential interface{} `json:"encryptedCredential,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for AzureSearchLinkedServiceTypeProperties struct. +func (aslstp *AzureSearchLinkedServiceTypeProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "url": + if v != nil { + var URL interface{} + err = json.Unmarshal(*v, &URL) + if err != nil { + return err + } + aslstp.URL = URL + } + case "key": + if v != nil { + key, err := unmarshalBasicSecretBase(*v) + if err != nil { + return err + } + aslstp.Key = key + } + case "encryptedCredential": + if v != nil { + var encryptedCredential interface{} + err = json.Unmarshal(*v, &encryptedCredential) + if err != nil { + return err + } + aslstp.EncryptedCredential = encryptedCredential + } + } + } + + return nil +} + +// AzureSQLDatabaseLinkedService microsoft Azure SQL Database linked service. +type AzureSQLDatabaseLinkedService struct { + // AzureSQLDatabaseLinkedServiceTypeProperties - Azure SQL Database linked service properties. + *AzureSQLDatabaseLinkedServiceTypeProperties `json:"typeProperties,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // ConnectVia - The integration runtime reference. + ConnectVia *IntegrationRuntimeReference `json:"connectVia,omitempty"` + // Description - Linked service description. + Description *string `json:"description,omitempty"` + // Parameters - Parameters for linked service. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeLinkedService', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforce', 'TypeAzureDataLakeStore', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureStorage' + Type TypeBasicLinkedService `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureSQLDatabaseLinkedService. +func (asdls AzureSQLDatabaseLinkedService) MarshalJSON() ([]byte, error) { + asdls.Type = TypeAzureSQLDatabase + objectMap := make(map[string]interface{}) + if asdls.AzureSQLDatabaseLinkedServiceTypeProperties != nil { + objectMap["typeProperties"] = asdls.AzureSQLDatabaseLinkedServiceTypeProperties + } + if asdls.ConnectVia != nil { + objectMap["connectVia"] = asdls.ConnectVia + } + if asdls.Description != nil { + objectMap["description"] = asdls.Description + } + if asdls.Parameters != nil { + objectMap["parameters"] = asdls.Parameters + } + if asdls.Annotations != nil { + objectMap["annotations"] = asdls.Annotations + } + if asdls.Type != "" { + objectMap["type"] = asdls.Type + } + for k, v := range asdls.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysLinkedService is the BasicLinkedService implementation for AzureSQLDatabaseLinkedService. +func (asdls AzureSQLDatabaseLinkedService) AsResponsysLinkedService() (*ResponsysLinkedService, bool) { + return nil, false +} + +// AsAzureDatabricksLinkedService is the BasicLinkedService implementation for AzureSQLDatabaseLinkedService. +func (asdls AzureSQLDatabaseLinkedService) AsAzureDatabricksLinkedService() (*AzureDatabricksLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeAnalyticsLinkedService is the BasicLinkedService implementation for AzureSQLDatabaseLinkedService. +func (asdls AzureSQLDatabaseLinkedService) AsAzureDataLakeAnalyticsLinkedService() (*AzureDataLakeAnalyticsLinkedService, bool) { + return nil, false +} + +// AsHDInsightOnDemandLinkedService is the BasicLinkedService implementation for AzureSQLDatabaseLinkedService. +func (asdls AzureSQLDatabaseLinkedService) AsHDInsightOnDemandLinkedService() (*HDInsightOnDemandLinkedService, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudLinkedService is the BasicLinkedService implementation for AzureSQLDatabaseLinkedService. +func (asdls AzureSQLDatabaseLinkedService) AsSalesforceMarketingCloudLinkedService() (*SalesforceMarketingCloudLinkedService, bool) { + return nil, false +} + +// AsNetezzaLinkedService is the BasicLinkedService implementation for AzureSQLDatabaseLinkedService. +func (asdls AzureSQLDatabaseLinkedService) AsNetezzaLinkedService() (*NetezzaLinkedService, bool) { + return nil, false +} + +// AsVerticaLinkedService is the BasicLinkedService implementation for AzureSQLDatabaseLinkedService. +func (asdls AzureSQLDatabaseLinkedService) AsVerticaLinkedService() (*VerticaLinkedService, bool) { + return nil, false +} + +// AsZohoLinkedService is the BasicLinkedService implementation for AzureSQLDatabaseLinkedService. +func (asdls AzureSQLDatabaseLinkedService) AsZohoLinkedService() (*ZohoLinkedService, bool) { + return nil, false +} + +// AsXeroLinkedService is the BasicLinkedService implementation for AzureSQLDatabaseLinkedService. +func (asdls AzureSQLDatabaseLinkedService) AsXeroLinkedService() (*XeroLinkedService, bool) { + return nil, false +} + +// AsSquareLinkedService is the BasicLinkedService implementation for AzureSQLDatabaseLinkedService. +func (asdls AzureSQLDatabaseLinkedService) AsSquareLinkedService() (*SquareLinkedService, bool) { + return nil, false +} + +// AsSparkLinkedService is the BasicLinkedService implementation for AzureSQLDatabaseLinkedService. +func (asdls AzureSQLDatabaseLinkedService) AsSparkLinkedService() (*SparkLinkedService, bool) { + return nil, false +} + +// AsShopifyLinkedService is the BasicLinkedService implementation for AzureSQLDatabaseLinkedService. +func (asdls AzureSQLDatabaseLinkedService) AsShopifyLinkedService() (*ShopifyLinkedService, bool) { + return nil, false +} + +// AsServiceNowLinkedService is the BasicLinkedService implementation for AzureSQLDatabaseLinkedService. +func (asdls AzureSQLDatabaseLinkedService) AsServiceNowLinkedService() (*ServiceNowLinkedService, bool) { + return nil, false +} + +// AsQuickBooksLinkedService is the BasicLinkedService implementation for AzureSQLDatabaseLinkedService. +func (asdls AzureSQLDatabaseLinkedService) AsQuickBooksLinkedService() (*QuickBooksLinkedService, bool) { + return nil, false +} + +// AsPrestoLinkedService is the BasicLinkedService implementation for AzureSQLDatabaseLinkedService. +func (asdls AzureSQLDatabaseLinkedService) AsPrestoLinkedService() (*PrestoLinkedService, bool) { + return nil, false +} + +// AsPhoenixLinkedService is the BasicLinkedService implementation for AzureSQLDatabaseLinkedService. +func (asdls AzureSQLDatabaseLinkedService) AsPhoenixLinkedService() (*PhoenixLinkedService, bool) { + return nil, false +} + +// AsPaypalLinkedService is the BasicLinkedService implementation for AzureSQLDatabaseLinkedService. +func (asdls AzureSQLDatabaseLinkedService) AsPaypalLinkedService() (*PaypalLinkedService, bool) { + return nil, false +} + +// AsMarketoLinkedService is the BasicLinkedService implementation for AzureSQLDatabaseLinkedService. +func (asdls AzureSQLDatabaseLinkedService) AsMarketoLinkedService() (*MarketoLinkedService, bool) { + return nil, false +} + +// AsMariaDBLinkedService is the BasicLinkedService implementation for AzureSQLDatabaseLinkedService. +func (asdls AzureSQLDatabaseLinkedService) AsMariaDBLinkedService() (*MariaDBLinkedService, bool) { + return nil, false +} + +// AsMagentoLinkedService is the BasicLinkedService implementation for AzureSQLDatabaseLinkedService. +func (asdls AzureSQLDatabaseLinkedService) AsMagentoLinkedService() (*MagentoLinkedService, bool) { + return nil, false +} + +// AsJiraLinkedService is the BasicLinkedService implementation for AzureSQLDatabaseLinkedService. +func (asdls AzureSQLDatabaseLinkedService) AsJiraLinkedService() (*JiraLinkedService, bool) { + return nil, false +} + +// AsImpalaLinkedService is the BasicLinkedService implementation for AzureSQLDatabaseLinkedService. +func (asdls AzureSQLDatabaseLinkedService) AsImpalaLinkedService() (*ImpalaLinkedService, bool) { + return nil, false +} + +// AsHubspotLinkedService is the BasicLinkedService implementation for AzureSQLDatabaseLinkedService. +func (asdls AzureSQLDatabaseLinkedService) AsHubspotLinkedService() (*HubspotLinkedService, bool) { + return nil, false +} + +// AsHiveLinkedService is the BasicLinkedService implementation for AzureSQLDatabaseLinkedService. +func (asdls AzureSQLDatabaseLinkedService) AsHiveLinkedService() (*HiveLinkedService, bool) { + return nil, false +} + +// AsHBaseLinkedService is the BasicLinkedService implementation for AzureSQLDatabaseLinkedService. +func (asdls AzureSQLDatabaseLinkedService) AsHBaseLinkedService() (*HBaseLinkedService, bool) { + return nil, false +} + +// AsGreenplumLinkedService is the BasicLinkedService implementation for AzureSQLDatabaseLinkedService. +func (asdls AzureSQLDatabaseLinkedService) AsGreenplumLinkedService() (*GreenplumLinkedService, bool) { + return nil, false +} + +// AsGoogleBigQueryLinkedService is the BasicLinkedService implementation for AzureSQLDatabaseLinkedService. +func (asdls AzureSQLDatabaseLinkedService) AsGoogleBigQueryLinkedService() (*GoogleBigQueryLinkedService, bool) { + return nil, false +} + +// AsEloquaLinkedService is the BasicLinkedService implementation for AzureSQLDatabaseLinkedService. +func (asdls AzureSQLDatabaseLinkedService) AsEloquaLinkedService() (*EloquaLinkedService, bool) { + return nil, false +} + +// AsDrillLinkedService is the BasicLinkedService implementation for AzureSQLDatabaseLinkedService. +func (asdls AzureSQLDatabaseLinkedService) AsDrillLinkedService() (*DrillLinkedService, bool) { + return nil, false +} + +// AsCouchbaseLinkedService is the BasicLinkedService implementation for AzureSQLDatabaseLinkedService. +func (asdls AzureSQLDatabaseLinkedService) AsCouchbaseLinkedService() (*CouchbaseLinkedService, bool) { + return nil, false +} + +// AsConcurLinkedService is the BasicLinkedService implementation for AzureSQLDatabaseLinkedService. +func (asdls AzureSQLDatabaseLinkedService) AsConcurLinkedService() (*ConcurLinkedService, bool) { + return nil, false +} + +// AsAzurePostgreSQLLinkedService is the BasicLinkedService implementation for AzureSQLDatabaseLinkedService. +func (asdls AzureSQLDatabaseLinkedService) AsAzurePostgreSQLLinkedService() (*AzurePostgreSQLLinkedService, bool) { + return nil, false +} + +// AsAmazonMWSLinkedService is the BasicLinkedService implementation for AzureSQLDatabaseLinkedService. +func (asdls AzureSQLDatabaseLinkedService) AsAmazonMWSLinkedService() (*AmazonMWSLinkedService, bool) { + return nil, false +} + +// AsSapHanaLinkedService is the BasicLinkedService implementation for AzureSQLDatabaseLinkedService. +func (asdls AzureSQLDatabaseLinkedService) AsSapHanaLinkedService() (*SapHanaLinkedService, bool) { + return nil, false +} + +// AsSapBWLinkedService is the BasicLinkedService implementation for AzureSQLDatabaseLinkedService. +func (asdls AzureSQLDatabaseLinkedService) AsSapBWLinkedService() (*SapBWLinkedService, bool) { + return nil, false +} + +// AsSftpServerLinkedService is the BasicLinkedService implementation for AzureSQLDatabaseLinkedService. +func (asdls AzureSQLDatabaseLinkedService) AsSftpServerLinkedService() (*SftpServerLinkedService, bool) { + return nil, false +} + +// AsFtpServerLinkedService is the BasicLinkedService implementation for AzureSQLDatabaseLinkedService. +func (asdls AzureSQLDatabaseLinkedService) AsFtpServerLinkedService() (*FtpServerLinkedService, bool) { + return nil, false +} + +// AsHTTPLinkedService is the BasicLinkedService implementation for AzureSQLDatabaseLinkedService. +func (asdls AzureSQLDatabaseLinkedService) AsHTTPLinkedService() (*HTTPLinkedService, bool) { + return nil, false +} + +// AsAzureSearchLinkedService is the BasicLinkedService implementation for AzureSQLDatabaseLinkedService. +func (asdls AzureSQLDatabaseLinkedService) AsAzureSearchLinkedService() (*AzureSearchLinkedService, bool) { + return nil, false +} + +// AsCustomDataSourceLinkedService is the BasicLinkedService implementation for AzureSQLDatabaseLinkedService. +func (asdls AzureSQLDatabaseLinkedService) AsCustomDataSourceLinkedService() (*CustomDataSourceLinkedService, bool) { + return nil, false +} + +// AsAmazonRedshiftLinkedService is the BasicLinkedService implementation for AzureSQLDatabaseLinkedService. +func (asdls AzureSQLDatabaseLinkedService) AsAmazonRedshiftLinkedService() (*AmazonRedshiftLinkedService, bool) { + return nil, false +} + +// AsAmazonS3LinkedService is the BasicLinkedService implementation for AzureSQLDatabaseLinkedService. +func (asdls AzureSQLDatabaseLinkedService) AsAmazonS3LinkedService() (*AmazonS3LinkedService, bool) { + return nil, false +} + +// AsSapEccLinkedService is the BasicLinkedService implementation for AzureSQLDatabaseLinkedService. +func (asdls AzureSQLDatabaseLinkedService) AsSapEccLinkedService() (*SapEccLinkedService, bool) { + return nil, false +} + +// AsSapCloudForCustomerLinkedService is the BasicLinkedService implementation for AzureSQLDatabaseLinkedService. +func (asdls AzureSQLDatabaseLinkedService) AsSapCloudForCustomerLinkedService() (*SapCloudForCustomerLinkedService, bool) { + return nil, false +} + +// AsSalesforceLinkedService is the BasicLinkedService implementation for AzureSQLDatabaseLinkedService. +func (asdls AzureSQLDatabaseLinkedService) AsSalesforceLinkedService() (*SalesforceLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeStoreLinkedService is the BasicLinkedService implementation for AzureSQLDatabaseLinkedService. +func (asdls AzureSQLDatabaseLinkedService) AsAzureDataLakeStoreLinkedService() (*AzureDataLakeStoreLinkedService, bool) { + return nil, false +} + +// AsMongoDbLinkedService is the BasicLinkedService implementation for AzureSQLDatabaseLinkedService. +func (asdls AzureSQLDatabaseLinkedService) AsMongoDbLinkedService() (*MongoDbLinkedService, bool) { + return nil, false +} + +// AsCassandraLinkedService is the BasicLinkedService implementation for AzureSQLDatabaseLinkedService. +func (asdls AzureSQLDatabaseLinkedService) AsCassandraLinkedService() (*CassandraLinkedService, bool) { + return nil, false +} + +// AsWebLinkedService is the BasicLinkedService implementation for AzureSQLDatabaseLinkedService. +func (asdls AzureSQLDatabaseLinkedService) AsWebLinkedService() (*WebLinkedService, bool) { + return nil, false +} + +// AsODataLinkedService is the BasicLinkedService implementation for AzureSQLDatabaseLinkedService. +func (asdls AzureSQLDatabaseLinkedService) AsODataLinkedService() (*ODataLinkedService, bool) { + return nil, false +} + +// AsHdfsLinkedService is the BasicLinkedService implementation for AzureSQLDatabaseLinkedService. +func (asdls AzureSQLDatabaseLinkedService) AsHdfsLinkedService() (*HdfsLinkedService, bool) { + return nil, false +} + +// AsOdbcLinkedService is the BasicLinkedService implementation for AzureSQLDatabaseLinkedService. +func (asdls AzureSQLDatabaseLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, bool) { + return nil, false +} + +// AsAzureMLLinkedService is the BasicLinkedService implementation for AzureSQLDatabaseLinkedService. +func (asdls AzureSQLDatabaseLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { + return nil, false +} + +// AsTeradataLinkedService is the BasicLinkedService implementation for AzureSQLDatabaseLinkedService. +func (asdls AzureSQLDatabaseLinkedService) AsTeradataLinkedService() (*TeradataLinkedService, bool) { + return nil, false +} + +// AsDb2LinkedService is the BasicLinkedService implementation for AzureSQLDatabaseLinkedService. +func (asdls AzureSQLDatabaseLinkedService) AsDb2LinkedService() (*Db2LinkedService, bool) { + return nil, false +} + +// AsSybaseLinkedService is the BasicLinkedService implementation for AzureSQLDatabaseLinkedService. +func (asdls AzureSQLDatabaseLinkedService) AsSybaseLinkedService() (*SybaseLinkedService, bool) { + return nil, false +} + +// AsPostgreSQLLinkedService is the BasicLinkedService implementation for AzureSQLDatabaseLinkedService. +func (asdls AzureSQLDatabaseLinkedService) AsPostgreSQLLinkedService() (*PostgreSQLLinkedService, bool) { + return nil, false +} + +// AsMySQLLinkedService is the BasicLinkedService implementation for AzureSQLDatabaseLinkedService. +func (asdls AzureSQLDatabaseLinkedService) AsMySQLLinkedService() (*MySQLLinkedService, bool) { + return nil, false +} + +// AsAzureMySQLLinkedService is the BasicLinkedService implementation for AzureSQLDatabaseLinkedService. +func (asdls AzureSQLDatabaseLinkedService) AsAzureMySQLLinkedService() (*AzureMySQLLinkedService, bool) { + return nil, false +} + +// AsOracleLinkedService is the BasicLinkedService implementation for AzureSQLDatabaseLinkedService. +func (asdls AzureSQLDatabaseLinkedService) AsOracleLinkedService() (*OracleLinkedService, bool) { + return nil, false +} + +// AsFileServerLinkedService is the BasicLinkedService implementation for AzureSQLDatabaseLinkedService. +func (asdls AzureSQLDatabaseLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { + return nil, false +} + +// AsHDInsightLinkedService is the BasicLinkedService implementation for AzureSQLDatabaseLinkedService. +func (asdls AzureSQLDatabaseLinkedService) AsHDInsightLinkedService() (*HDInsightLinkedService, bool) { + return nil, false +} + +// AsDynamicsLinkedService is the BasicLinkedService implementation for AzureSQLDatabaseLinkedService. +func (asdls AzureSQLDatabaseLinkedService) AsDynamicsLinkedService() (*DynamicsLinkedService, bool) { + return nil, false +} + +// AsCosmosDbLinkedService is the BasicLinkedService implementation for AzureSQLDatabaseLinkedService. +func (asdls AzureSQLDatabaseLinkedService) AsCosmosDbLinkedService() (*CosmosDbLinkedService, bool) { + return nil, false +} + +// AsAzureKeyVaultLinkedService is the BasicLinkedService implementation for AzureSQLDatabaseLinkedService. +func (asdls AzureSQLDatabaseLinkedService) AsAzureKeyVaultLinkedService() (*AzureKeyVaultLinkedService, bool) { + return nil, false +} + +// AsAzureBatchLinkedService is the BasicLinkedService implementation for AzureSQLDatabaseLinkedService. +func (asdls AzureSQLDatabaseLinkedService) AsAzureBatchLinkedService() (*AzureBatchLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDatabaseLinkedService is the BasicLinkedService implementation for AzureSQLDatabaseLinkedService. +func (asdls AzureSQLDatabaseLinkedService) AsAzureSQLDatabaseLinkedService() (*AzureSQLDatabaseLinkedService, bool) { + return &asdls, true +} + +// AsSQLServerLinkedService is the BasicLinkedService implementation for AzureSQLDatabaseLinkedService. +func (asdls AzureSQLDatabaseLinkedService) AsSQLServerLinkedService() (*SQLServerLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDWLinkedService is the BasicLinkedService implementation for AzureSQLDatabaseLinkedService. +func (asdls AzureSQLDatabaseLinkedService) AsAzureSQLDWLinkedService() (*AzureSQLDWLinkedService, bool) { + return nil, false +} + +// AsAzureStorageLinkedService is the BasicLinkedService implementation for AzureSQLDatabaseLinkedService. +func (asdls AzureSQLDatabaseLinkedService) AsAzureStorageLinkedService() (*AzureStorageLinkedService, bool) { + return nil, false +} + +// AsLinkedService is the BasicLinkedService implementation for AzureSQLDatabaseLinkedService. +func (asdls AzureSQLDatabaseLinkedService) AsLinkedService() (*LinkedService, bool) { + return nil, false +} + +// AsBasicLinkedService is the BasicLinkedService implementation for AzureSQLDatabaseLinkedService. +func (asdls AzureSQLDatabaseLinkedService) AsBasicLinkedService() (BasicLinkedService, bool) { + return &asdls, true +} + +// UnmarshalJSON is the custom unmarshaler for AzureSQLDatabaseLinkedService struct. +func (asdls *AzureSQLDatabaseLinkedService) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "typeProperties": + if v != nil { + var azureSQLDatabaseLinkedServiceTypeProperties AzureSQLDatabaseLinkedServiceTypeProperties + err = json.Unmarshal(*v, &azureSQLDatabaseLinkedServiceTypeProperties) + if err != nil { + return err + } + asdls.AzureSQLDatabaseLinkedServiceTypeProperties = &azureSQLDatabaseLinkedServiceTypeProperties + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if asdls.AdditionalProperties == nil { + asdls.AdditionalProperties = make(map[string]interface{}) + } + asdls.AdditionalProperties[k] = additionalProperties + } + case "connectVia": + if v != nil { + var connectVia IntegrationRuntimeReference + err = json.Unmarshal(*v, &connectVia) + if err != nil { + return err + } + asdls.ConnectVia = &connectVia + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + asdls.Description = &description + } + case "parameters": + if v != nil { + var parameters map[string]*ParameterSpecification + err = json.Unmarshal(*v, ¶meters) + if err != nil { + return err + } + asdls.Parameters = parameters + } + case "annotations": + if v != nil { + var annotations []interface{} + err = json.Unmarshal(*v, &annotations) + if err != nil { + return err + } + asdls.Annotations = &annotations + } + case "type": + if v != nil { + var typeVar TypeBasicLinkedService + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + asdls.Type = typeVar + } + } + } + + return nil +} + +// AzureSQLDatabaseLinkedServiceTypeProperties azure SQL Database linked service properties. +type AzureSQLDatabaseLinkedServiceTypeProperties struct { + // ConnectionString - The connection string. Type: string, SecureString or AzureKeyVaultSecretReference. + ConnectionString interface{} `json:"connectionString,omitempty"` + // ServicePrincipalID - The ID of the service principal used to authenticate against Azure SQL Database. Type: string (or Expression with resultType string). + ServicePrincipalID interface{} `json:"servicePrincipalId,omitempty"` + // ServicePrincipalKey - The key of the service principal used to authenticate against Azure SQL Database. + ServicePrincipalKey BasicSecretBase `json:"servicePrincipalKey,omitempty"` + // Tenant - The name or ID of the tenant to which the service principal belongs. Type: string (or Expression with resultType string). + Tenant interface{} `json:"tenant,omitempty"` + // EncryptedCredential - The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string). + EncryptedCredential interface{} `json:"encryptedCredential,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for AzureSQLDatabaseLinkedServiceTypeProperties struct. +func (asdlstp *AzureSQLDatabaseLinkedServiceTypeProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "connectionString": + if v != nil { + var connectionString interface{} + err = json.Unmarshal(*v, &connectionString) + if err != nil { + return err + } + asdlstp.ConnectionString = connectionString + } + case "servicePrincipalId": + if v != nil { + var servicePrincipalID interface{} + err = json.Unmarshal(*v, &servicePrincipalID) + if err != nil { + return err + } + asdlstp.ServicePrincipalID = servicePrincipalID + } + case "servicePrincipalKey": + if v != nil { + servicePrincipalKey, err := unmarshalBasicSecretBase(*v) + if err != nil { + return err + } + asdlstp.ServicePrincipalKey = servicePrincipalKey + } + case "tenant": + if v != nil { + var tenant interface{} + err = json.Unmarshal(*v, &tenant) + if err != nil { + return err + } + asdlstp.Tenant = tenant + } + case "encryptedCredential": + if v != nil { + var encryptedCredential interface{} + err = json.Unmarshal(*v, &encryptedCredential) + if err != nil { + return err + } + asdlstp.EncryptedCredential = encryptedCredential + } + } + } + + return nil +} + +// AzureSQLDWLinkedService azure SQL Data Warehouse linked service. +type AzureSQLDWLinkedService struct { + // AzureSQLDWLinkedServiceTypeProperties - Azure SQL Data Warehouse linked service properties. + *AzureSQLDWLinkedServiceTypeProperties `json:"typeProperties,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // ConnectVia - The integration runtime reference. + ConnectVia *IntegrationRuntimeReference `json:"connectVia,omitempty"` + // Description - Linked service description. + Description *string `json:"description,omitempty"` + // Parameters - Parameters for linked service. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeLinkedService', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforce', 'TypeAzureDataLakeStore', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureStorage' + Type TypeBasicLinkedService `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureSQLDWLinkedService. +func (asdls AzureSQLDWLinkedService) MarshalJSON() ([]byte, error) { + asdls.Type = TypeAzureSQLDW + objectMap := make(map[string]interface{}) + if asdls.AzureSQLDWLinkedServiceTypeProperties != nil { + objectMap["typeProperties"] = asdls.AzureSQLDWLinkedServiceTypeProperties + } + if asdls.ConnectVia != nil { + objectMap["connectVia"] = asdls.ConnectVia + } + if asdls.Description != nil { + objectMap["description"] = asdls.Description + } + if asdls.Parameters != nil { + objectMap["parameters"] = asdls.Parameters + } + if asdls.Annotations != nil { + objectMap["annotations"] = asdls.Annotations + } + if asdls.Type != "" { + objectMap["type"] = asdls.Type + } + for k, v := range asdls.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysLinkedService is the BasicLinkedService implementation for AzureSQLDWLinkedService. +func (asdls AzureSQLDWLinkedService) AsResponsysLinkedService() (*ResponsysLinkedService, bool) { + return nil, false +} + +// AsAzureDatabricksLinkedService is the BasicLinkedService implementation for AzureSQLDWLinkedService. +func (asdls AzureSQLDWLinkedService) AsAzureDatabricksLinkedService() (*AzureDatabricksLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeAnalyticsLinkedService is the BasicLinkedService implementation for AzureSQLDWLinkedService. +func (asdls AzureSQLDWLinkedService) AsAzureDataLakeAnalyticsLinkedService() (*AzureDataLakeAnalyticsLinkedService, bool) { + return nil, false +} + +// AsHDInsightOnDemandLinkedService is the BasicLinkedService implementation for AzureSQLDWLinkedService. +func (asdls AzureSQLDWLinkedService) AsHDInsightOnDemandLinkedService() (*HDInsightOnDemandLinkedService, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudLinkedService is the BasicLinkedService implementation for AzureSQLDWLinkedService. +func (asdls AzureSQLDWLinkedService) AsSalesforceMarketingCloudLinkedService() (*SalesforceMarketingCloudLinkedService, bool) { + return nil, false +} + +// AsNetezzaLinkedService is the BasicLinkedService implementation for AzureSQLDWLinkedService. +func (asdls AzureSQLDWLinkedService) AsNetezzaLinkedService() (*NetezzaLinkedService, bool) { + return nil, false +} + +// AsVerticaLinkedService is the BasicLinkedService implementation for AzureSQLDWLinkedService. +func (asdls AzureSQLDWLinkedService) AsVerticaLinkedService() (*VerticaLinkedService, bool) { + return nil, false +} + +// AsZohoLinkedService is the BasicLinkedService implementation for AzureSQLDWLinkedService. +func (asdls AzureSQLDWLinkedService) AsZohoLinkedService() (*ZohoLinkedService, bool) { + return nil, false +} + +// AsXeroLinkedService is the BasicLinkedService implementation for AzureSQLDWLinkedService. +func (asdls AzureSQLDWLinkedService) AsXeroLinkedService() (*XeroLinkedService, bool) { + return nil, false +} + +// AsSquareLinkedService is the BasicLinkedService implementation for AzureSQLDWLinkedService. +func (asdls AzureSQLDWLinkedService) AsSquareLinkedService() (*SquareLinkedService, bool) { + return nil, false +} + +// AsSparkLinkedService is the BasicLinkedService implementation for AzureSQLDWLinkedService. +func (asdls AzureSQLDWLinkedService) AsSparkLinkedService() (*SparkLinkedService, bool) { + return nil, false +} + +// AsShopifyLinkedService is the BasicLinkedService implementation for AzureSQLDWLinkedService. +func (asdls AzureSQLDWLinkedService) AsShopifyLinkedService() (*ShopifyLinkedService, bool) { + return nil, false +} + +// AsServiceNowLinkedService is the BasicLinkedService implementation for AzureSQLDWLinkedService. +func (asdls AzureSQLDWLinkedService) AsServiceNowLinkedService() (*ServiceNowLinkedService, bool) { + return nil, false +} + +// AsQuickBooksLinkedService is the BasicLinkedService implementation for AzureSQLDWLinkedService. +func (asdls AzureSQLDWLinkedService) AsQuickBooksLinkedService() (*QuickBooksLinkedService, bool) { + return nil, false +} + +// AsPrestoLinkedService is the BasicLinkedService implementation for AzureSQLDWLinkedService. +func (asdls AzureSQLDWLinkedService) AsPrestoLinkedService() (*PrestoLinkedService, bool) { + return nil, false +} + +// AsPhoenixLinkedService is the BasicLinkedService implementation for AzureSQLDWLinkedService. +func (asdls AzureSQLDWLinkedService) AsPhoenixLinkedService() (*PhoenixLinkedService, bool) { + return nil, false +} + +// AsPaypalLinkedService is the BasicLinkedService implementation for AzureSQLDWLinkedService. +func (asdls AzureSQLDWLinkedService) AsPaypalLinkedService() (*PaypalLinkedService, bool) { + return nil, false +} + +// AsMarketoLinkedService is the BasicLinkedService implementation for AzureSQLDWLinkedService. +func (asdls AzureSQLDWLinkedService) AsMarketoLinkedService() (*MarketoLinkedService, bool) { + return nil, false +} + +// AsMariaDBLinkedService is the BasicLinkedService implementation for AzureSQLDWLinkedService. +func (asdls AzureSQLDWLinkedService) AsMariaDBLinkedService() (*MariaDBLinkedService, bool) { + return nil, false +} + +// AsMagentoLinkedService is the BasicLinkedService implementation for AzureSQLDWLinkedService. +func (asdls AzureSQLDWLinkedService) AsMagentoLinkedService() (*MagentoLinkedService, bool) { + return nil, false +} + +// AsJiraLinkedService is the BasicLinkedService implementation for AzureSQLDWLinkedService. +func (asdls AzureSQLDWLinkedService) AsJiraLinkedService() (*JiraLinkedService, bool) { + return nil, false +} + +// AsImpalaLinkedService is the BasicLinkedService implementation for AzureSQLDWLinkedService. +func (asdls AzureSQLDWLinkedService) AsImpalaLinkedService() (*ImpalaLinkedService, bool) { + return nil, false +} + +// AsHubspotLinkedService is the BasicLinkedService implementation for AzureSQLDWLinkedService. +func (asdls AzureSQLDWLinkedService) AsHubspotLinkedService() (*HubspotLinkedService, bool) { + return nil, false +} + +// AsHiveLinkedService is the BasicLinkedService implementation for AzureSQLDWLinkedService. +func (asdls AzureSQLDWLinkedService) AsHiveLinkedService() (*HiveLinkedService, bool) { + return nil, false +} + +// AsHBaseLinkedService is the BasicLinkedService implementation for AzureSQLDWLinkedService. +func (asdls AzureSQLDWLinkedService) AsHBaseLinkedService() (*HBaseLinkedService, bool) { + return nil, false +} + +// AsGreenplumLinkedService is the BasicLinkedService implementation for AzureSQLDWLinkedService. +func (asdls AzureSQLDWLinkedService) AsGreenplumLinkedService() (*GreenplumLinkedService, bool) { + return nil, false +} + +// AsGoogleBigQueryLinkedService is the BasicLinkedService implementation for AzureSQLDWLinkedService. +func (asdls AzureSQLDWLinkedService) AsGoogleBigQueryLinkedService() (*GoogleBigQueryLinkedService, bool) { + return nil, false +} + +// AsEloquaLinkedService is the BasicLinkedService implementation for AzureSQLDWLinkedService. +func (asdls AzureSQLDWLinkedService) AsEloquaLinkedService() (*EloquaLinkedService, bool) { + return nil, false +} + +// AsDrillLinkedService is the BasicLinkedService implementation for AzureSQLDWLinkedService. +func (asdls AzureSQLDWLinkedService) AsDrillLinkedService() (*DrillLinkedService, bool) { + return nil, false +} + +// AsCouchbaseLinkedService is the BasicLinkedService implementation for AzureSQLDWLinkedService. +func (asdls AzureSQLDWLinkedService) AsCouchbaseLinkedService() (*CouchbaseLinkedService, bool) { + return nil, false +} + +// AsConcurLinkedService is the BasicLinkedService implementation for AzureSQLDWLinkedService. +func (asdls AzureSQLDWLinkedService) AsConcurLinkedService() (*ConcurLinkedService, bool) { + return nil, false +} + +// AsAzurePostgreSQLLinkedService is the BasicLinkedService implementation for AzureSQLDWLinkedService. +func (asdls AzureSQLDWLinkedService) AsAzurePostgreSQLLinkedService() (*AzurePostgreSQLLinkedService, bool) { + return nil, false +} + +// AsAmazonMWSLinkedService is the BasicLinkedService implementation for AzureSQLDWLinkedService. +func (asdls AzureSQLDWLinkedService) AsAmazonMWSLinkedService() (*AmazonMWSLinkedService, bool) { + return nil, false +} + +// AsSapHanaLinkedService is the BasicLinkedService implementation for AzureSQLDWLinkedService. +func (asdls AzureSQLDWLinkedService) AsSapHanaLinkedService() (*SapHanaLinkedService, bool) { + return nil, false +} + +// AsSapBWLinkedService is the BasicLinkedService implementation for AzureSQLDWLinkedService. +func (asdls AzureSQLDWLinkedService) AsSapBWLinkedService() (*SapBWLinkedService, bool) { + return nil, false +} + +// AsSftpServerLinkedService is the BasicLinkedService implementation for AzureSQLDWLinkedService. +func (asdls AzureSQLDWLinkedService) AsSftpServerLinkedService() (*SftpServerLinkedService, bool) { + return nil, false +} + +// AsFtpServerLinkedService is the BasicLinkedService implementation for AzureSQLDWLinkedService. +func (asdls AzureSQLDWLinkedService) AsFtpServerLinkedService() (*FtpServerLinkedService, bool) { + return nil, false +} + +// AsHTTPLinkedService is the BasicLinkedService implementation for AzureSQLDWLinkedService. +func (asdls AzureSQLDWLinkedService) AsHTTPLinkedService() (*HTTPLinkedService, bool) { + return nil, false +} + +// AsAzureSearchLinkedService is the BasicLinkedService implementation for AzureSQLDWLinkedService. +func (asdls AzureSQLDWLinkedService) AsAzureSearchLinkedService() (*AzureSearchLinkedService, bool) { + return nil, false +} + +// AsCustomDataSourceLinkedService is the BasicLinkedService implementation for AzureSQLDWLinkedService. +func (asdls AzureSQLDWLinkedService) AsCustomDataSourceLinkedService() (*CustomDataSourceLinkedService, bool) { + return nil, false +} + +// AsAmazonRedshiftLinkedService is the BasicLinkedService implementation for AzureSQLDWLinkedService. +func (asdls AzureSQLDWLinkedService) AsAmazonRedshiftLinkedService() (*AmazonRedshiftLinkedService, bool) { + return nil, false +} + +// AsAmazonS3LinkedService is the BasicLinkedService implementation for AzureSQLDWLinkedService. +func (asdls AzureSQLDWLinkedService) AsAmazonS3LinkedService() (*AmazonS3LinkedService, bool) { + return nil, false +} + +// AsSapEccLinkedService is the BasicLinkedService implementation for AzureSQLDWLinkedService. +func (asdls AzureSQLDWLinkedService) AsSapEccLinkedService() (*SapEccLinkedService, bool) { + return nil, false +} + +// AsSapCloudForCustomerLinkedService is the BasicLinkedService implementation for AzureSQLDWLinkedService. +func (asdls AzureSQLDWLinkedService) AsSapCloudForCustomerLinkedService() (*SapCloudForCustomerLinkedService, bool) { + return nil, false +} + +// AsSalesforceLinkedService is the BasicLinkedService implementation for AzureSQLDWLinkedService. +func (asdls AzureSQLDWLinkedService) AsSalesforceLinkedService() (*SalesforceLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeStoreLinkedService is the BasicLinkedService implementation for AzureSQLDWLinkedService. +func (asdls AzureSQLDWLinkedService) AsAzureDataLakeStoreLinkedService() (*AzureDataLakeStoreLinkedService, bool) { + return nil, false +} + +// AsMongoDbLinkedService is the BasicLinkedService implementation for AzureSQLDWLinkedService. +func (asdls AzureSQLDWLinkedService) AsMongoDbLinkedService() (*MongoDbLinkedService, bool) { + return nil, false +} + +// AsCassandraLinkedService is the BasicLinkedService implementation for AzureSQLDWLinkedService. +func (asdls AzureSQLDWLinkedService) AsCassandraLinkedService() (*CassandraLinkedService, bool) { + return nil, false +} + +// AsWebLinkedService is the BasicLinkedService implementation for AzureSQLDWLinkedService. +func (asdls AzureSQLDWLinkedService) AsWebLinkedService() (*WebLinkedService, bool) { + return nil, false +} + +// AsODataLinkedService is the BasicLinkedService implementation for AzureSQLDWLinkedService. +func (asdls AzureSQLDWLinkedService) AsODataLinkedService() (*ODataLinkedService, bool) { + return nil, false +} + +// AsHdfsLinkedService is the BasicLinkedService implementation for AzureSQLDWLinkedService. +func (asdls AzureSQLDWLinkedService) AsHdfsLinkedService() (*HdfsLinkedService, bool) { + return nil, false +} + +// AsOdbcLinkedService is the BasicLinkedService implementation for AzureSQLDWLinkedService. +func (asdls AzureSQLDWLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, bool) { + return nil, false +} + +// AsAzureMLLinkedService is the BasicLinkedService implementation for AzureSQLDWLinkedService. +func (asdls AzureSQLDWLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { + return nil, false +} + +// AsTeradataLinkedService is the BasicLinkedService implementation for AzureSQLDWLinkedService. +func (asdls AzureSQLDWLinkedService) AsTeradataLinkedService() (*TeradataLinkedService, bool) { + return nil, false +} + +// AsDb2LinkedService is the BasicLinkedService implementation for AzureSQLDWLinkedService. +func (asdls AzureSQLDWLinkedService) AsDb2LinkedService() (*Db2LinkedService, bool) { + return nil, false +} + +// AsSybaseLinkedService is the BasicLinkedService implementation for AzureSQLDWLinkedService. +func (asdls AzureSQLDWLinkedService) AsSybaseLinkedService() (*SybaseLinkedService, bool) { + return nil, false +} + +// AsPostgreSQLLinkedService is the BasicLinkedService implementation for AzureSQLDWLinkedService. +func (asdls AzureSQLDWLinkedService) AsPostgreSQLLinkedService() (*PostgreSQLLinkedService, bool) { + return nil, false +} + +// AsMySQLLinkedService is the BasicLinkedService implementation for AzureSQLDWLinkedService. +func (asdls AzureSQLDWLinkedService) AsMySQLLinkedService() (*MySQLLinkedService, bool) { + return nil, false +} + +// AsAzureMySQLLinkedService is the BasicLinkedService implementation for AzureSQLDWLinkedService. +func (asdls AzureSQLDWLinkedService) AsAzureMySQLLinkedService() (*AzureMySQLLinkedService, bool) { + return nil, false +} + +// AsOracleLinkedService is the BasicLinkedService implementation for AzureSQLDWLinkedService. +func (asdls AzureSQLDWLinkedService) AsOracleLinkedService() (*OracleLinkedService, bool) { + return nil, false +} + +// AsFileServerLinkedService is the BasicLinkedService implementation for AzureSQLDWLinkedService. +func (asdls AzureSQLDWLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { + return nil, false +} + +// AsHDInsightLinkedService is the BasicLinkedService implementation for AzureSQLDWLinkedService. +func (asdls AzureSQLDWLinkedService) AsHDInsightLinkedService() (*HDInsightLinkedService, bool) { + return nil, false +} + +// AsDynamicsLinkedService is the BasicLinkedService implementation for AzureSQLDWLinkedService. +func (asdls AzureSQLDWLinkedService) AsDynamicsLinkedService() (*DynamicsLinkedService, bool) { + return nil, false +} + +// AsCosmosDbLinkedService is the BasicLinkedService implementation for AzureSQLDWLinkedService. +func (asdls AzureSQLDWLinkedService) AsCosmosDbLinkedService() (*CosmosDbLinkedService, bool) { + return nil, false +} + +// AsAzureKeyVaultLinkedService is the BasicLinkedService implementation for AzureSQLDWLinkedService. +func (asdls AzureSQLDWLinkedService) AsAzureKeyVaultLinkedService() (*AzureKeyVaultLinkedService, bool) { + return nil, false +} + +// AsAzureBatchLinkedService is the BasicLinkedService implementation for AzureSQLDWLinkedService. +func (asdls AzureSQLDWLinkedService) AsAzureBatchLinkedService() (*AzureBatchLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDatabaseLinkedService is the BasicLinkedService implementation for AzureSQLDWLinkedService. +func (asdls AzureSQLDWLinkedService) AsAzureSQLDatabaseLinkedService() (*AzureSQLDatabaseLinkedService, bool) { + return nil, false +} + +// AsSQLServerLinkedService is the BasicLinkedService implementation for AzureSQLDWLinkedService. +func (asdls AzureSQLDWLinkedService) AsSQLServerLinkedService() (*SQLServerLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDWLinkedService is the BasicLinkedService implementation for AzureSQLDWLinkedService. +func (asdls AzureSQLDWLinkedService) AsAzureSQLDWLinkedService() (*AzureSQLDWLinkedService, bool) { + return &asdls, true +} + +// AsAzureStorageLinkedService is the BasicLinkedService implementation for AzureSQLDWLinkedService. +func (asdls AzureSQLDWLinkedService) AsAzureStorageLinkedService() (*AzureStorageLinkedService, bool) { + return nil, false +} + +// AsLinkedService is the BasicLinkedService implementation for AzureSQLDWLinkedService. +func (asdls AzureSQLDWLinkedService) AsLinkedService() (*LinkedService, bool) { + return nil, false +} + +// AsBasicLinkedService is the BasicLinkedService implementation for AzureSQLDWLinkedService. +func (asdls AzureSQLDWLinkedService) AsBasicLinkedService() (BasicLinkedService, bool) { + return &asdls, true +} + +// UnmarshalJSON is the custom unmarshaler for AzureSQLDWLinkedService struct. +func (asdls *AzureSQLDWLinkedService) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "typeProperties": + if v != nil { + var azureSQLDWLinkedServiceTypeProperties AzureSQLDWLinkedServiceTypeProperties + err = json.Unmarshal(*v, &azureSQLDWLinkedServiceTypeProperties) + if err != nil { + return err + } + asdls.AzureSQLDWLinkedServiceTypeProperties = &azureSQLDWLinkedServiceTypeProperties + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if asdls.AdditionalProperties == nil { + asdls.AdditionalProperties = make(map[string]interface{}) + } + asdls.AdditionalProperties[k] = additionalProperties + } + case "connectVia": + if v != nil { + var connectVia IntegrationRuntimeReference + err = json.Unmarshal(*v, &connectVia) + if err != nil { + return err + } + asdls.ConnectVia = &connectVia + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + asdls.Description = &description + } + case "parameters": + if v != nil { + var parameters map[string]*ParameterSpecification + err = json.Unmarshal(*v, ¶meters) + if err != nil { + return err + } + asdls.Parameters = parameters + } + case "annotations": + if v != nil { + var annotations []interface{} + err = json.Unmarshal(*v, &annotations) + if err != nil { + return err + } + asdls.Annotations = &annotations + } + case "type": + if v != nil { + var typeVar TypeBasicLinkedService + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + asdls.Type = typeVar + } + } + } + + return nil +} + +// AzureSQLDWLinkedServiceTypeProperties azure SQL Data Warehouse linked service properties. +type AzureSQLDWLinkedServiceTypeProperties struct { + // ConnectionString - The connection string. Type: string, SecureString or AzureKeyVaultSecretReference. Type: string, SecureString or AzureKeyVaultSecretReference. + ConnectionString interface{} `json:"connectionString,omitempty"` + // ServicePrincipalID - The ID of the service principal used to authenticate against Azure SQL Data Warehouse. Type: string (or Expression with resultType string). + ServicePrincipalID interface{} `json:"servicePrincipalId,omitempty"` + // ServicePrincipalKey - The key of the service principal used to authenticate against Azure SQL Data Warehouse. + ServicePrincipalKey BasicSecretBase `json:"servicePrincipalKey,omitempty"` + // Tenant - The name or ID of the tenant to which the service principal belongs. Type: string (or Expression with resultType string). + Tenant interface{} `json:"tenant,omitempty"` + // EncryptedCredential - The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string). + EncryptedCredential interface{} `json:"encryptedCredential,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for AzureSQLDWLinkedServiceTypeProperties struct. +func (asdlstp *AzureSQLDWLinkedServiceTypeProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "connectionString": + if v != nil { + var connectionString interface{} + err = json.Unmarshal(*v, &connectionString) + if err != nil { + return err + } + asdlstp.ConnectionString = connectionString + } + case "servicePrincipalId": + if v != nil { + var servicePrincipalID interface{} + err = json.Unmarshal(*v, &servicePrincipalID) + if err != nil { + return err + } + asdlstp.ServicePrincipalID = servicePrincipalID + } + case "servicePrincipalKey": + if v != nil { + servicePrincipalKey, err := unmarshalBasicSecretBase(*v) + if err != nil { + return err + } + asdlstp.ServicePrincipalKey = servicePrincipalKey + } + case "tenant": + if v != nil { + var tenant interface{} + err = json.Unmarshal(*v, &tenant) + if err != nil { + return err + } + asdlstp.Tenant = tenant + } + case "encryptedCredential": + if v != nil { + var encryptedCredential interface{} + err = json.Unmarshal(*v, &encryptedCredential) + if err != nil { + return err + } + asdlstp.EncryptedCredential = encryptedCredential + } + } + } + + return nil +} + +// AzureSQLDWTableDataset the Azure SQL Data Warehouse dataset. +type AzureSQLDWTableDataset struct { + // AzureSQLDWTableDatasetTypeProperties - Azure SQL Data Warehouse dataset properties. + *AzureSQLDWTableDatasetTypeProperties `json:"typeProperties,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Description - Dataset description. + Description *string `json:"description,omitempty"` + // Structure - Columns that define the structure of the dataset. Type: array (or Expression with resultType array), itemType: DatasetDataElement. + Structure interface{} `json:"structure,omitempty"` + // LinkedServiceName - Linked service reference. + LinkedServiceName *LinkedServiceReference `json:"linkedServiceName,omitempty"` + // Parameters - Parameters for dataset. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeDataset', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSQLServerTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSalesforceObject', 'TypeRelationalTable', 'TypeAzureMySQLTable', 'TypeOracleTable', 'TypeODataResource', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeAzureDataLakeStoreFile', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeAmazonS3Object' + Type TypeBasicDataset `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureSQLDWTableDataset. +func (asdtd AzureSQLDWTableDataset) MarshalJSON() ([]byte, error) { + asdtd.Type = TypeAzureSQLDWTable + objectMap := make(map[string]interface{}) + if asdtd.AzureSQLDWTableDatasetTypeProperties != nil { + objectMap["typeProperties"] = asdtd.AzureSQLDWTableDatasetTypeProperties + } + if asdtd.Description != nil { + objectMap["description"] = asdtd.Description + } + objectMap["structure"] = asdtd.Structure + if asdtd.LinkedServiceName != nil { + objectMap["linkedServiceName"] = asdtd.LinkedServiceName + } + if asdtd.Parameters != nil { + objectMap["parameters"] = asdtd.Parameters + } + if asdtd.Annotations != nil { + objectMap["annotations"] = asdtd.Annotations + } + if asdtd.Type != "" { + objectMap["type"] = asdtd.Type + } + for k, v := range asdtd.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysObjectDataset is the BasicDataset implementation for AzureSQLDWTableDataset. +func (asdtd AzureSQLDWTableDataset) AsResponsysObjectDataset() (*ResponsysObjectDataset, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudObjectDataset is the BasicDataset implementation for AzureSQLDWTableDataset. +func (asdtd AzureSQLDWTableDataset) AsSalesforceMarketingCloudObjectDataset() (*SalesforceMarketingCloudObjectDataset, bool) { + return nil, false +} + +// AsVerticaTableDataset is the BasicDataset implementation for AzureSQLDWTableDataset. +func (asdtd AzureSQLDWTableDataset) AsVerticaTableDataset() (*VerticaTableDataset, bool) { + return nil, false +} + +// AsNetezzaTableDataset is the BasicDataset implementation for AzureSQLDWTableDataset. +func (asdtd AzureSQLDWTableDataset) AsNetezzaTableDataset() (*NetezzaTableDataset, bool) { + return nil, false +} + +// AsZohoObjectDataset is the BasicDataset implementation for AzureSQLDWTableDataset. +func (asdtd AzureSQLDWTableDataset) AsZohoObjectDataset() (*ZohoObjectDataset, bool) { + return nil, false +} + +// AsXeroObjectDataset is the BasicDataset implementation for AzureSQLDWTableDataset. +func (asdtd AzureSQLDWTableDataset) AsXeroObjectDataset() (*XeroObjectDataset, bool) { + return nil, false +} + +// AsSquareObjectDataset is the BasicDataset implementation for AzureSQLDWTableDataset. +func (asdtd AzureSQLDWTableDataset) AsSquareObjectDataset() (*SquareObjectDataset, bool) { + return nil, false +} + +// AsSparkObjectDataset is the BasicDataset implementation for AzureSQLDWTableDataset. +func (asdtd AzureSQLDWTableDataset) AsSparkObjectDataset() (*SparkObjectDataset, bool) { + return nil, false +} + +// AsShopifyObjectDataset is the BasicDataset implementation for AzureSQLDWTableDataset. +func (asdtd AzureSQLDWTableDataset) AsShopifyObjectDataset() (*ShopifyObjectDataset, bool) { + return nil, false +} + +// AsServiceNowObjectDataset is the BasicDataset implementation for AzureSQLDWTableDataset. +func (asdtd AzureSQLDWTableDataset) AsServiceNowObjectDataset() (*ServiceNowObjectDataset, bool) { + return nil, false +} + +// AsQuickBooksObjectDataset is the BasicDataset implementation for AzureSQLDWTableDataset. +func (asdtd AzureSQLDWTableDataset) AsQuickBooksObjectDataset() (*QuickBooksObjectDataset, bool) { + return nil, false +} + +// AsPrestoObjectDataset is the BasicDataset implementation for AzureSQLDWTableDataset. +func (asdtd AzureSQLDWTableDataset) AsPrestoObjectDataset() (*PrestoObjectDataset, bool) { + return nil, false +} + +// AsPhoenixObjectDataset is the BasicDataset implementation for AzureSQLDWTableDataset. +func (asdtd AzureSQLDWTableDataset) AsPhoenixObjectDataset() (*PhoenixObjectDataset, bool) { + return nil, false +} + +// AsPaypalObjectDataset is the BasicDataset implementation for AzureSQLDWTableDataset. +func (asdtd AzureSQLDWTableDataset) AsPaypalObjectDataset() (*PaypalObjectDataset, bool) { + return nil, false +} + +// AsMarketoObjectDataset is the BasicDataset implementation for AzureSQLDWTableDataset. +func (asdtd AzureSQLDWTableDataset) AsMarketoObjectDataset() (*MarketoObjectDataset, bool) { + return nil, false +} + +// AsMariaDBTableDataset is the BasicDataset implementation for AzureSQLDWTableDataset. +func (asdtd AzureSQLDWTableDataset) AsMariaDBTableDataset() (*MariaDBTableDataset, bool) { + return nil, false +} + +// AsMagentoObjectDataset is the BasicDataset implementation for AzureSQLDWTableDataset. +func (asdtd AzureSQLDWTableDataset) AsMagentoObjectDataset() (*MagentoObjectDataset, bool) { + return nil, false +} + +// AsJiraObjectDataset is the BasicDataset implementation for AzureSQLDWTableDataset. +func (asdtd AzureSQLDWTableDataset) AsJiraObjectDataset() (*JiraObjectDataset, bool) { + return nil, false +} + +// AsImpalaObjectDataset is the BasicDataset implementation for AzureSQLDWTableDataset. +func (asdtd AzureSQLDWTableDataset) AsImpalaObjectDataset() (*ImpalaObjectDataset, bool) { + return nil, false +} + +// AsHubspotObjectDataset is the BasicDataset implementation for AzureSQLDWTableDataset. +func (asdtd AzureSQLDWTableDataset) AsHubspotObjectDataset() (*HubspotObjectDataset, bool) { + return nil, false +} + +// AsHiveObjectDataset is the BasicDataset implementation for AzureSQLDWTableDataset. +func (asdtd AzureSQLDWTableDataset) AsHiveObjectDataset() (*HiveObjectDataset, bool) { + return nil, false +} + +// AsHBaseObjectDataset is the BasicDataset implementation for AzureSQLDWTableDataset. +func (asdtd AzureSQLDWTableDataset) AsHBaseObjectDataset() (*HBaseObjectDataset, bool) { + return nil, false +} + +// AsGreenplumTableDataset is the BasicDataset implementation for AzureSQLDWTableDataset. +func (asdtd AzureSQLDWTableDataset) AsGreenplumTableDataset() (*GreenplumTableDataset, bool) { + return nil, false +} + +// AsGoogleBigQueryObjectDataset is the BasicDataset implementation for AzureSQLDWTableDataset. +func (asdtd AzureSQLDWTableDataset) AsGoogleBigQueryObjectDataset() (*GoogleBigQueryObjectDataset, bool) { + return nil, false +} + +// AsEloquaObjectDataset is the BasicDataset implementation for AzureSQLDWTableDataset. +func (asdtd AzureSQLDWTableDataset) AsEloquaObjectDataset() (*EloquaObjectDataset, bool) { + return nil, false +} + +// AsDrillTableDataset is the BasicDataset implementation for AzureSQLDWTableDataset. +func (asdtd AzureSQLDWTableDataset) AsDrillTableDataset() (*DrillTableDataset, bool) { + return nil, false +} + +// AsCouchbaseTableDataset is the BasicDataset implementation for AzureSQLDWTableDataset. +func (asdtd AzureSQLDWTableDataset) AsCouchbaseTableDataset() (*CouchbaseTableDataset, bool) { + return nil, false +} + +// AsConcurObjectDataset is the BasicDataset implementation for AzureSQLDWTableDataset. +func (asdtd AzureSQLDWTableDataset) AsConcurObjectDataset() (*ConcurObjectDataset, bool) { + return nil, false +} + +// AsAzurePostgreSQLTableDataset is the BasicDataset implementation for AzureSQLDWTableDataset. +func (asdtd AzureSQLDWTableDataset) AsAzurePostgreSQLTableDataset() (*AzurePostgreSQLTableDataset, bool) { + return nil, false +} + +// AsAmazonMWSObjectDataset is the BasicDataset implementation for AzureSQLDWTableDataset. +func (asdtd AzureSQLDWTableDataset) AsAmazonMWSObjectDataset() (*AmazonMWSObjectDataset, bool) { + return nil, false +} + +// AsHTTPDataset is the BasicDataset implementation for AzureSQLDWTableDataset. +func (asdtd AzureSQLDWTableDataset) AsHTTPDataset() (*HTTPDataset, bool) { + return nil, false +} + +// AsAzureSearchIndexDataset is the BasicDataset implementation for AzureSQLDWTableDataset. +func (asdtd AzureSQLDWTableDataset) AsAzureSearchIndexDataset() (*AzureSearchIndexDataset, bool) { + return nil, false +} + +// AsWebTableDataset is the BasicDataset implementation for AzureSQLDWTableDataset. +func (asdtd AzureSQLDWTableDataset) AsWebTableDataset() (*WebTableDataset, bool) { + return nil, false +} + +// AsSQLServerTableDataset is the BasicDataset implementation for AzureSQLDWTableDataset. +func (asdtd AzureSQLDWTableDataset) AsSQLServerTableDataset() (*SQLServerTableDataset, bool) { + return nil, false +} + +// AsSapEccResourceDataset is the BasicDataset implementation for AzureSQLDWTableDataset. +func (asdtd AzureSQLDWTableDataset) AsSapEccResourceDataset() (*SapEccResourceDataset, bool) { + return nil, false +} + +// AsSapCloudForCustomerResourceDataset is the BasicDataset implementation for AzureSQLDWTableDataset. +func (asdtd AzureSQLDWTableDataset) AsSapCloudForCustomerResourceDataset() (*SapCloudForCustomerResourceDataset, bool) { + return nil, false +} + +// AsSalesforceObjectDataset is the BasicDataset implementation for AzureSQLDWTableDataset. +func (asdtd AzureSQLDWTableDataset) AsSalesforceObjectDataset() (*SalesforceObjectDataset, bool) { + return nil, false +} + +// AsRelationalTableDataset is the BasicDataset implementation for AzureSQLDWTableDataset. +func (asdtd AzureSQLDWTableDataset) AsRelationalTableDataset() (*RelationalTableDataset, bool) { + return nil, false +} + +// AsAzureMySQLTableDataset is the BasicDataset implementation for AzureSQLDWTableDataset. +func (asdtd AzureSQLDWTableDataset) AsAzureMySQLTableDataset() (*AzureMySQLTableDataset, bool) { + return nil, false +} + +// AsOracleTableDataset is the BasicDataset implementation for AzureSQLDWTableDataset. +func (asdtd AzureSQLDWTableDataset) AsOracleTableDataset() (*OracleTableDataset, bool) { + return nil, false +} + +// AsODataResourceDataset is the BasicDataset implementation for AzureSQLDWTableDataset. +func (asdtd AzureSQLDWTableDataset) AsODataResourceDataset() (*ODataResourceDataset, bool) { + return nil, false +} + +// AsMongoDbCollectionDataset is the BasicDataset implementation for AzureSQLDWTableDataset. +func (asdtd AzureSQLDWTableDataset) AsMongoDbCollectionDataset() (*MongoDbCollectionDataset, bool) { + return nil, false +} + +// AsFileShareDataset is the BasicDataset implementation for AzureSQLDWTableDataset. +func (asdtd AzureSQLDWTableDataset) AsFileShareDataset() (*FileShareDataset, bool) { + return nil, false +} + +// AsAzureDataLakeStoreDataset is the BasicDataset implementation for AzureSQLDWTableDataset. +func (asdtd AzureSQLDWTableDataset) AsAzureDataLakeStoreDataset() (*AzureDataLakeStoreDataset, bool) { + return nil, false +} + +// AsDynamicsEntityDataset is the BasicDataset implementation for AzureSQLDWTableDataset. +func (asdtd AzureSQLDWTableDataset) AsDynamicsEntityDataset() (*DynamicsEntityDataset, bool) { + return nil, false +} + +// AsDocumentDbCollectionDataset is the BasicDataset implementation for AzureSQLDWTableDataset. +func (asdtd AzureSQLDWTableDataset) AsDocumentDbCollectionDataset() (*DocumentDbCollectionDataset, bool) { + return nil, false +} + +// AsCustomDataset is the BasicDataset implementation for AzureSQLDWTableDataset. +func (asdtd AzureSQLDWTableDataset) AsCustomDataset() (*CustomDataset, bool) { + return nil, false +} + +// AsCassandraTableDataset is the BasicDataset implementation for AzureSQLDWTableDataset. +func (asdtd AzureSQLDWTableDataset) AsCassandraTableDataset() (*CassandraTableDataset, bool) { + return nil, false +} + +// AsAzureSQLDWTableDataset is the BasicDataset implementation for AzureSQLDWTableDataset. +func (asdtd AzureSQLDWTableDataset) AsAzureSQLDWTableDataset() (*AzureSQLDWTableDataset, bool) { + return &asdtd, true +} + +// AsAzureSQLTableDataset is the BasicDataset implementation for AzureSQLDWTableDataset. +func (asdtd AzureSQLDWTableDataset) AsAzureSQLTableDataset() (*AzureSQLTableDataset, bool) { + return nil, false +} + +// AsAzureTableDataset is the BasicDataset implementation for AzureSQLDWTableDataset. +func (asdtd AzureSQLDWTableDataset) AsAzureTableDataset() (*AzureTableDataset, bool) { + return nil, false +} + +// AsAzureBlobDataset is the BasicDataset implementation for AzureSQLDWTableDataset. +func (asdtd AzureSQLDWTableDataset) AsAzureBlobDataset() (*AzureBlobDataset, bool) { + return nil, false +} + +// AsAmazonS3Dataset is the BasicDataset implementation for AzureSQLDWTableDataset. +func (asdtd AzureSQLDWTableDataset) AsAmazonS3Dataset() (*AmazonS3Dataset, bool) { + return nil, false +} + +// AsDataset is the BasicDataset implementation for AzureSQLDWTableDataset. +func (asdtd AzureSQLDWTableDataset) AsDataset() (*Dataset, bool) { + return nil, false +} + +// AsBasicDataset is the BasicDataset implementation for AzureSQLDWTableDataset. +func (asdtd AzureSQLDWTableDataset) AsBasicDataset() (BasicDataset, bool) { + return &asdtd, true +} + +// UnmarshalJSON is the custom unmarshaler for AzureSQLDWTableDataset struct. +func (asdtd *AzureSQLDWTableDataset) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "typeProperties": + if v != nil { + var azureSQLDWTableDatasetTypeProperties AzureSQLDWTableDatasetTypeProperties + err = json.Unmarshal(*v, &azureSQLDWTableDatasetTypeProperties) + if err != nil { + return err + } + asdtd.AzureSQLDWTableDatasetTypeProperties = &azureSQLDWTableDatasetTypeProperties + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if asdtd.AdditionalProperties == nil { + asdtd.AdditionalProperties = make(map[string]interface{}) + } + asdtd.AdditionalProperties[k] = additionalProperties + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + asdtd.Description = &description + } + case "structure": + if v != nil { + var structure interface{} + err = json.Unmarshal(*v, &structure) + if err != nil { + return err + } + asdtd.Structure = structure + } + case "linkedServiceName": + if v != nil { + var linkedServiceName LinkedServiceReference + err = json.Unmarshal(*v, &linkedServiceName) + if err != nil { + return err + } + asdtd.LinkedServiceName = &linkedServiceName + } + case "parameters": + if v != nil { + var parameters map[string]*ParameterSpecification + err = json.Unmarshal(*v, ¶meters) + if err != nil { + return err + } + asdtd.Parameters = parameters + } + case "annotations": + if v != nil { + var annotations []interface{} + err = json.Unmarshal(*v, &annotations) + if err != nil { + return err + } + asdtd.Annotations = &annotations + } + case "type": + if v != nil { + var typeVar TypeBasicDataset + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + asdtd.Type = typeVar + } + } + } + + return nil +} + +// AzureSQLDWTableDatasetTypeProperties azure SQL Data Warehouse dataset properties. +type AzureSQLDWTableDatasetTypeProperties struct { + // TableName - The table name of the Azure SQL Data Warehouse. Type: string (or Expression with resultType string). + TableName interface{} `json:"tableName,omitempty"` +} + +// AzureSQLTableDataset the Azure SQL Server database dataset. +type AzureSQLTableDataset struct { + // AzureSQLTableDatasetTypeProperties - Azure SQL dataset properties. + *AzureSQLTableDatasetTypeProperties `json:"typeProperties,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Description - Dataset description. + Description *string `json:"description,omitempty"` + // Structure - Columns that define the structure of the dataset. Type: array (or Expression with resultType array), itemType: DatasetDataElement. + Structure interface{} `json:"structure,omitempty"` + // LinkedServiceName - Linked service reference. + LinkedServiceName *LinkedServiceReference `json:"linkedServiceName,omitempty"` + // Parameters - Parameters for dataset. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeDataset', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSQLServerTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSalesforceObject', 'TypeRelationalTable', 'TypeAzureMySQLTable', 'TypeOracleTable', 'TypeODataResource', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeAzureDataLakeStoreFile', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeAmazonS3Object' + Type TypeBasicDataset `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureSQLTableDataset. +func (astd AzureSQLTableDataset) MarshalJSON() ([]byte, error) { + astd.Type = TypeAzureSQLTable + objectMap := make(map[string]interface{}) + if astd.AzureSQLTableDatasetTypeProperties != nil { + objectMap["typeProperties"] = astd.AzureSQLTableDatasetTypeProperties + } + if astd.Description != nil { + objectMap["description"] = astd.Description + } + objectMap["structure"] = astd.Structure + if astd.LinkedServiceName != nil { + objectMap["linkedServiceName"] = astd.LinkedServiceName + } + if astd.Parameters != nil { + objectMap["parameters"] = astd.Parameters + } + if astd.Annotations != nil { + objectMap["annotations"] = astd.Annotations + } + if astd.Type != "" { + objectMap["type"] = astd.Type + } + for k, v := range astd.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysObjectDataset is the BasicDataset implementation for AzureSQLTableDataset. +func (astd AzureSQLTableDataset) AsResponsysObjectDataset() (*ResponsysObjectDataset, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudObjectDataset is the BasicDataset implementation for AzureSQLTableDataset. +func (astd AzureSQLTableDataset) AsSalesforceMarketingCloudObjectDataset() (*SalesforceMarketingCloudObjectDataset, bool) { + return nil, false +} + +// AsVerticaTableDataset is the BasicDataset implementation for AzureSQLTableDataset. +func (astd AzureSQLTableDataset) AsVerticaTableDataset() (*VerticaTableDataset, bool) { + return nil, false +} + +// AsNetezzaTableDataset is the BasicDataset implementation for AzureSQLTableDataset. +func (astd AzureSQLTableDataset) AsNetezzaTableDataset() (*NetezzaTableDataset, bool) { + return nil, false +} + +// AsZohoObjectDataset is the BasicDataset implementation for AzureSQLTableDataset. +func (astd AzureSQLTableDataset) AsZohoObjectDataset() (*ZohoObjectDataset, bool) { + return nil, false +} + +// AsXeroObjectDataset is the BasicDataset implementation for AzureSQLTableDataset. +func (astd AzureSQLTableDataset) AsXeroObjectDataset() (*XeroObjectDataset, bool) { + return nil, false +} + +// AsSquareObjectDataset is the BasicDataset implementation for AzureSQLTableDataset. +func (astd AzureSQLTableDataset) AsSquareObjectDataset() (*SquareObjectDataset, bool) { + return nil, false +} + +// AsSparkObjectDataset is the BasicDataset implementation for AzureSQLTableDataset. +func (astd AzureSQLTableDataset) AsSparkObjectDataset() (*SparkObjectDataset, bool) { + return nil, false +} + +// AsShopifyObjectDataset is the BasicDataset implementation for AzureSQLTableDataset. +func (astd AzureSQLTableDataset) AsShopifyObjectDataset() (*ShopifyObjectDataset, bool) { + return nil, false +} + +// AsServiceNowObjectDataset is the BasicDataset implementation for AzureSQLTableDataset. +func (astd AzureSQLTableDataset) AsServiceNowObjectDataset() (*ServiceNowObjectDataset, bool) { + return nil, false +} + +// AsQuickBooksObjectDataset is the BasicDataset implementation for AzureSQLTableDataset. +func (astd AzureSQLTableDataset) AsQuickBooksObjectDataset() (*QuickBooksObjectDataset, bool) { + return nil, false +} + +// AsPrestoObjectDataset is the BasicDataset implementation for AzureSQLTableDataset. +func (astd AzureSQLTableDataset) AsPrestoObjectDataset() (*PrestoObjectDataset, bool) { + return nil, false +} + +// AsPhoenixObjectDataset is the BasicDataset implementation for AzureSQLTableDataset. +func (astd AzureSQLTableDataset) AsPhoenixObjectDataset() (*PhoenixObjectDataset, bool) { + return nil, false +} + +// AsPaypalObjectDataset is the BasicDataset implementation for AzureSQLTableDataset. +func (astd AzureSQLTableDataset) AsPaypalObjectDataset() (*PaypalObjectDataset, bool) { + return nil, false +} + +// AsMarketoObjectDataset is the BasicDataset implementation for AzureSQLTableDataset. +func (astd AzureSQLTableDataset) AsMarketoObjectDataset() (*MarketoObjectDataset, bool) { + return nil, false +} + +// AsMariaDBTableDataset is the BasicDataset implementation for AzureSQLTableDataset. +func (astd AzureSQLTableDataset) AsMariaDBTableDataset() (*MariaDBTableDataset, bool) { + return nil, false +} + +// AsMagentoObjectDataset is the BasicDataset implementation for AzureSQLTableDataset. +func (astd AzureSQLTableDataset) AsMagentoObjectDataset() (*MagentoObjectDataset, bool) { + return nil, false +} + +// AsJiraObjectDataset is the BasicDataset implementation for AzureSQLTableDataset. +func (astd AzureSQLTableDataset) AsJiraObjectDataset() (*JiraObjectDataset, bool) { + return nil, false +} + +// AsImpalaObjectDataset is the BasicDataset implementation for AzureSQLTableDataset. +func (astd AzureSQLTableDataset) AsImpalaObjectDataset() (*ImpalaObjectDataset, bool) { + return nil, false +} + +// AsHubspotObjectDataset is the BasicDataset implementation for AzureSQLTableDataset. +func (astd AzureSQLTableDataset) AsHubspotObjectDataset() (*HubspotObjectDataset, bool) { + return nil, false +} + +// AsHiveObjectDataset is the BasicDataset implementation for AzureSQLTableDataset. +func (astd AzureSQLTableDataset) AsHiveObjectDataset() (*HiveObjectDataset, bool) { + return nil, false +} + +// AsHBaseObjectDataset is the BasicDataset implementation for AzureSQLTableDataset. +func (astd AzureSQLTableDataset) AsHBaseObjectDataset() (*HBaseObjectDataset, bool) { + return nil, false +} + +// AsGreenplumTableDataset is the BasicDataset implementation for AzureSQLTableDataset. +func (astd AzureSQLTableDataset) AsGreenplumTableDataset() (*GreenplumTableDataset, bool) { + return nil, false +} + +// AsGoogleBigQueryObjectDataset is the BasicDataset implementation for AzureSQLTableDataset. +func (astd AzureSQLTableDataset) AsGoogleBigQueryObjectDataset() (*GoogleBigQueryObjectDataset, bool) { + return nil, false +} + +// AsEloquaObjectDataset is the BasicDataset implementation for AzureSQLTableDataset. +func (astd AzureSQLTableDataset) AsEloquaObjectDataset() (*EloquaObjectDataset, bool) { + return nil, false +} + +// AsDrillTableDataset is the BasicDataset implementation for AzureSQLTableDataset. +func (astd AzureSQLTableDataset) AsDrillTableDataset() (*DrillTableDataset, bool) { + return nil, false +} + +// AsCouchbaseTableDataset is the BasicDataset implementation for AzureSQLTableDataset. +func (astd AzureSQLTableDataset) AsCouchbaseTableDataset() (*CouchbaseTableDataset, bool) { + return nil, false +} + +// AsConcurObjectDataset is the BasicDataset implementation for AzureSQLTableDataset. +func (astd AzureSQLTableDataset) AsConcurObjectDataset() (*ConcurObjectDataset, bool) { + return nil, false +} + +// AsAzurePostgreSQLTableDataset is the BasicDataset implementation for AzureSQLTableDataset. +func (astd AzureSQLTableDataset) AsAzurePostgreSQLTableDataset() (*AzurePostgreSQLTableDataset, bool) { + return nil, false +} + +// AsAmazonMWSObjectDataset is the BasicDataset implementation for AzureSQLTableDataset. +func (astd AzureSQLTableDataset) AsAmazonMWSObjectDataset() (*AmazonMWSObjectDataset, bool) { + return nil, false +} + +// AsHTTPDataset is the BasicDataset implementation for AzureSQLTableDataset. +func (astd AzureSQLTableDataset) AsHTTPDataset() (*HTTPDataset, bool) { + return nil, false +} + +// AsAzureSearchIndexDataset is the BasicDataset implementation for AzureSQLTableDataset. +func (astd AzureSQLTableDataset) AsAzureSearchIndexDataset() (*AzureSearchIndexDataset, bool) { + return nil, false +} + +// AsWebTableDataset is the BasicDataset implementation for AzureSQLTableDataset. +func (astd AzureSQLTableDataset) AsWebTableDataset() (*WebTableDataset, bool) { + return nil, false +} + +// AsSQLServerTableDataset is the BasicDataset implementation for AzureSQLTableDataset. +func (astd AzureSQLTableDataset) AsSQLServerTableDataset() (*SQLServerTableDataset, bool) { + return nil, false +} + +// AsSapEccResourceDataset is the BasicDataset implementation for AzureSQLTableDataset. +func (astd AzureSQLTableDataset) AsSapEccResourceDataset() (*SapEccResourceDataset, bool) { + return nil, false +} + +// AsSapCloudForCustomerResourceDataset is the BasicDataset implementation for AzureSQLTableDataset. +func (astd AzureSQLTableDataset) AsSapCloudForCustomerResourceDataset() (*SapCloudForCustomerResourceDataset, bool) { + return nil, false +} + +// AsSalesforceObjectDataset is the BasicDataset implementation for AzureSQLTableDataset. +func (astd AzureSQLTableDataset) AsSalesforceObjectDataset() (*SalesforceObjectDataset, bool) { + return nil, false +} + +// AsRelationalTableDataset is the BasicDataset implementation for AzureSQLTableDataset. +func (astd AzureSQLTableDataset) AsRelationalTableDataset() (*RelationalTableDataset, bool) { + return nil, false +} + +// AsAzureMySQLTableDataset is the BasicDataset implementation for AzureSQLTableDataset. +func (astd AzureSQLTableDataset) AsAzureMySQLTableDataset() (*AzureMySQLTableDataset, bool) { + return nil, false +} + +// AsOracleTableDataset is the BasicDataset implementation for AzureSQLTableDataset. +func (astd AzureSQLTableDataset) AsOracleTableDataset() (*OracleTableDataset, bool) { + return nil, false +} + +// AsODataResourceDataset is the BasicDataset implementation for AzureSQLTableDataset. +func (astd AzureSQLTableDataset) AsODataResourceDataset() (*ODataResourceDataset, bool) { + return nil, false +} + +// AsMongoDbCollectionDataset is the BasicDataset implementation for AzureSQLTableDataset. +func (astd AzureSQLTableDataset) AsMongoDbCollectionDataset() (*MongoDbCollectionDataset, bool) { + return nil, false +} + +// AsFileShareDataset is the BasicDataset implementation for AzureSQLTableDataset. +func (astd AzureSQLTableDataset) AsFileShareDataset() (*FileShareDataset, bool) { + return nil, false +} + +// AsAzureDataLakeStoreDataset is the BasicDataset implementation for AzureSQLTableDataset. +func (astd AzureSQLTableDataset) AsAzureDataLakeStoreDataset() (*AzureDataLakeStoreDataset, bool) { + return nil, false +} + +// AsDynamicsEntityDataset is the BasicDataset implementation for AzureSQLTableDataset. +func (astd AzureSQLTableDataset) AsDynamicsEntityDataset() (*DynamicsEntityDataset, bool) { + return nil, false +} + +// AsDocumentDbCollectionDataset is the BasicDataset implementation for AzureSQLTableDataset. +func (astd AzureSQLTableDataset) AsDocumentDbCollectionDataset() (*DocumentDbCollectionDataset, bool) { + return nil, false +} + +// AsCustomDataset is the BasicDataset implementation for AzureSQLTableDataset. +func (astd AzureSQLTableDataset) AsCustomDataset() (*CustomDataset, bool) { + return nil, false +} + +// AsCassandraTableDataset is the BasicDataset implementation for AzureSQLTableDataset. +func (astd AzureSQLTableDataset) AsCassandraTableDataset() (*CassandraTableDataset, bool) { + return nil, false +} + +// AsAzureSQLDWTableDataset is the BasicDataset implementation for AzureSQLTableDataset. +func (astd AzureSQLTableDataset) AsAzureSQLDWTableDataset() (*AzureSQLDWTableDataset, bool) { + return nil, false +} + +// AsAzureSQLTableDataset is the BasicDataset implementation for AzureSQLTableDataset. +func (astd AzureSQLTableDataset) AsAzureSQLTableDataset() (*AzureSQLTableDataset, bool) { + return &astd, true +} + +// AsAzureTableDataset is the BasicDataset implementation for AzureSQLTableDataset. +func (astd AzureSQLTableDataset) AsAzureTableDataset() (*AzureTableDataset, bool) { + return nil, false +} + +// AsAzureBlobDataset is the BasicDataset implementation for AzureSQLTableDataset. +func (astd AzureSQLTableDataset) AsAzureBlobDataset() (*AzureBlobDataset, bool) { + return nil, false +} + +// AsAmazonS3Dataset is the BasicDataset implementation for AzureSQLTableDataset. +func (astd AzureSQLTableDataset) AsAmazonS3Dataset() (*AmazonS3Dataset, bool) { + return nil, false +} + +// AsDataset is the BasicDataset implementation for AzureSQLTableDataset. +func (astd AzureSQLTableDataset) AsDataset() (*Dataset, bool) { + return nil, false +} + +// AsBasicDataset is the BasicDataset implementation for AzureSQLTableDataset. +func (astd AzureSQLTableDataset) AsBasicDataset() (BasicDataset, bool) { + return &astd, true +} + +// UnmarshalJSON is the custom unmarshaler for AzureSQLTableDataset struct. +func (astd *AzureSQLTableDataset) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "typeProperties": + if v != nil { + var azureSQLTableDatasetTypeProperties AzureSQLTableDatasetTypeProperties + err = json.Unmarshal(*v, &azureSQLTableDatasetTypeProperties) + if err != nil { + return err + } + astd.AzureSQLTableDatasetTypeProperties = &azureSQLTableDatasetTypeProperties + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if astd.AdditionalProperties == nil { + astd.AdditionalProperties = make(map[string]interface{}) + } + astd.AdditionalProperties[k] = additionalProperties + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + astd.Description = &description + } + case "structure": + if v != nil { + var structure interface{} + err = json.Unmarshal(*v, &structure) + if err != nil { + return err + } + astd.Structure = structure + } + case "linkedServiceName": + if v != nil { + var linkedServiceName LinkedServiceReference + err = json.Unmarshal(*v, &linkedServiceName) + if err != nil { + return err + } + astd.LinkedServiceName = &linkedServiceName + } + case "parameters": + if v != nil { + var parameters map[string]*ParameterSpecification + err = json.Unmarshal(*v, ¶meters) + if err != nil { + return err + } + astd.Parameters = parameters + } + case "annotations": + if v != nil { + var annotations []interface{} + err = json.Unmarshal(*v, &annotations) + if err != nil { + return err + } + astd.Annotations = &annotations + } + case "type": + if v != nil { + var typeVar TypeBasicDataset + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + astd.Type = typeVar + } + } + } + + return nil +} + +// AzureSQLTableDatasetTypeProperties azure SQL dataset properties. +type AzureSQLTableDatasetTypeProperties struct { + // TableName - The table name of the Azure SQL database. Type: string (or Expression with resultType string). + TableName interface{} `json:"tableName,omitempty"` +} + +// AzureStorageLinkedService the storage account linked service. +type AzureStorageLinkedService struct { + // AzureStorageLinkedServiceTypeProperties - Azure Storage linked service properties. + *AzureStorageLinkedServiceTypeProperties `json:"typeProperties,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // ConnectVia - The integration runtime reference. + ConnectVia *IntegrationRuntimeReference `json:"connectVia,omitempty"` + // Description - Linked service description. + Description *string `json:"description,omitempty"` + // Parameters - Parameters for linked service. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeLinkedService', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforce', 'TypeAzureDataLakeStore', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureStorage' + Type TypeBasicLinkedService `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureStorageLinkedService. +func (asls AzureStorageLinkedService) MarshalJSON() ([]byte, error) { + asls.Type = TypeAzureStorage + objectMap := make(map[string]interface{}) + if asls.AzureStorageLinkedServiceTypeProperties != nil { + objectMap["typeProperties"] = asls.AzureStorageLinkedServiceTypeProperties + } + if asls.ConnectVia != nil { + objectMap["connectVia"] = asls.ConnectVia + } + if asls.Description != nil { + objectMap["description"] = asls.Description + } + if asls.Parameters != nil { + objectMap["parameters"] = asls.Parameters + } + if asls.Annotations != nil { + objectMap["annotations"] = asls.Annotations + } + if asls.Type != "" { + objectMap["type"] = asls.Type + } + for k, v := range asls.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysLinkedService is the BasicLinkedService implementation for AzureStorageLinkedService. +func (asls AzureStorageLinkedService) AsResponsysLinkedService() (*ResponsysLinkedService, bool) { + return nil, false +} + +// AsAzureDatabricksLinkedService is the BasicLinkedService implementation for AzureStorageLinkedService. +func (asls AzureStorageLinkedService) AsAzureDatabricksLinkedService() (*AzureDatabricksLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeAnalyticsLinkedService is the BasicLinkedService implementation for AzureStorageLinkedService. +func (asls AzureStorageLinkedService) AsAzureDataLakeAnalyticsLinkedService() (*AzureDataLakeAnalyticsLinkedService, bool) { + return nil, false +} + +// AsHDInsightOnDemandLinkedService is the BasicLinkedService implementation for AzureStorageLinkedService. +func (asls AzureStorageLinkedService) AsHDInsightOnDemandLinkedService() (*HDInsightOnDemandLinkedService, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudLinkedService is the BasicLinkedService implementation for AzureStorageLinkedService. +func (asls AzureStorageLinkedService) AsSalesforceMarketingCloudLinkedService() (*SalesforceMarketingCloudLinkedService, bool) { + return nil, false +} + +// AsNetezzaLinkedService is the BasicLinkedService implementation for AzureStorageLinkedService. +func (asls AzureStorageLinkedService) AsNetezzaLinkedService() (*NetezzaLinkedService, bool) { + return nil, false +} + +// AsVerticaLinkedService is the BasicLinkedService implementation for AzureStorageLinkedService. +func (asls AzureStorageLinkedService) AsVerticaLinkedService() (*VerticaLinkedService, bool) { + return nil, false +} + +// AsZohoLinkedService is the BasicLinkedService implementation for AzureStorageLinkedService. +func (asls AzureStorageLinkedService) AsZohoLinkedService() (*ZohoLinkedService, bool) { + return nil, false +} + +// AsXeroLinkedService is the BasicLinkedService implementation for AzureStorageLinkedService. +func (asls AzureStorageLinkedService) AsXeroLinkedService() (*XeroLinkedService, bool) { + return nil, false +} + +// AsSquareLinkedService is the BasicLinkedService implementation for AzureStorageLinkedService. +func (asls AzureStorageLinkedService) AsSquareLinkedService() (*SquareLinkedService, bool) { + return nil, false +} + +// AsSparkLinkedService is the BasicLinkedService implementation for AzureStorageLinkedService. +func (asls AzureStorageLinkedService) AsSparkLinkedService() (*SparkLinkedService, bool) { + return nil, false +} + +// AsShopifyLinkedService is the BasicLinkedService implementation for AzureStorageLinkedService. +func (asls AzureStorageLinkedService) AsShopifyLinkedService() (*ShopifyLinkedService, bool) { + return nil, false +} + +// AsServiceNowLinkedService is the BasicLinkedService implementation for AzureStorageLinkedService. +func (asls AzureStorageLinkedService) AsServiceNowLinkedService() (*ServiceNowLinkedService, bool) { + return nil, false +} + +// AsQuickBooksLinkedService is the BasicLinkedService implementation for AzureStorageLinkedService. +func (asls AzureStorageLinkedService) AsQuickBooksLinkedService() (*QuickBooksLinkedService, bool) { + return nil, false +} + +// AsPrestoLinkedService is the BasicLinkedService implementation for AzureStorageLinkedService. +func (asls AzureStorageLinkedService) AsPrestoLinkedService() (*PrestoLinkedService, bool) { + return nil, false +} + +// AsPhoenixLinkedService is the BasicLinkedService implementation for AzureStorageLinkedService. +func (asls AzureStorageLinkedService) AsPhoenixLinkedService() (*PhoenixLinkedService, bool) { + return nil, false +} + +// AsPaypalLinkedService is the BasicLinkedService implementation for AzureStorageLinkedService. +func (asls AzureStorageLinkedService) AsPaypalLinkedService() (*PaypalLinkedService, bool) { + return nil, false +} + +// AsMarketoLinkedService is the BasicLinkedService implementation for AzureStorageLinkedService. +func (asls AzureStorageLinkedService) AsMarketoLinkedService() (*MarketoLinkedService, bool) { + return nil, false +} + +// AsMariaDBLinkedService is the BasicLinkedService implementation for AzureStorageLinkedService. +func (asls AzureStorageLinkedService) AsMariaDBLinkedService() (*MariaDBLinkedService, bool) { + return nil, false +} + +// AsMagentoLinkedService is the BasicLinkedService implementation for AzureStorageLinkedService. +func (asls AzureStorageLinkedService) AsMagentoLinkedService() (*MagentoLinkedService, bool) { + return nil, false +} + +// AsJiraLinkedService is the BasicLinkedService implementation for AzureStorageLinkedService. +func (asls AzureStorageLinkedService) AsJiraLinkedService() (*JiraLinkedService, bool) { + return nil, false +} + +// AsImpalaLinkedService is the BasicLinkedService implementation for AzureStorageLinkedService. +func (asls AzureStorageLinkedService) AsImpalaLinkedService() (*ImpalaLinkedService, bool) { + return nil, false +} + +// AsHubspotLinkedService is the BasicLinkedService implementation for AzureStorageLinkedService. +func (asls AzureStorageLinkedService) AsHubspotLinkedService() (*HubspotLinkedService, bool) { + return nil, false +} + +// AsHiveLinkedService is the BasicLinkedService implementation for AzureStorageLinkedService. +func (asls AzureStorageLinkedService) AsHiveLinkedService() (*HiveLinkedService, bool) { + return nil, false +} + +// AsHBaseLinkedService is the BasicLinkedService implementation for AzureStorageLinkedService. +func (asls AzureStorageLinkedService) AsHBaseLinkedService() (*HBaseLinkedService, bool) { + return nil, false +} + +// AsGreenplumLinkedService is the BasicLinkedService implementation for AzureStorageLinkedService. +func (asls AzureStorageLinkedService) AsGreenplumLinkedService() (*GreenplumLinkedService, bool) { + return nil, false +} + +// AsGoogleBigQueryLinkedService is the BasicLinkedService implementation for AzureStorageLinkedService. +func (asls AzureStorageLinkedService) AsGoogleBigQueryLinkedService() (*GoogleBigQueryLinkedService, bool) { + return nil, false +} + +// AsEloquaLinkedService is the BasicLinkedService implementation for AzureStorageLinkedService. +func (asls AzureStorageLinkedService) AsEloquaLinkedService() (*EloquaLinkedService, bool) { + return nil, false +} + +// AsDrillLinkedService is the BasicLinkedService implementation for AzureStorageLinkedService. +func (asls AzureStorageLinkedService) AsDrillLinkedService() (*DrillLinkedService, bool) { + return nil, false +} + +// AsCouchbaseLinkedService is the BasicLinkedService implementation for AzureStorageLinkedService. +func (asls AzureStorageLinkedService) AsCouchbaseLinkedService() (*CouchbaseLinkedService, bool) { + return nil, false +} + +// AsConcurLinkedService is the BasicLinkedService implementation for AzureStorageLinkedService. +func (asls AzureStorageLinkedService) AsConcurLinkedService() (*ConcurLinkedService, bool) { + return nil, false +} + +// AsAzurePostgreSQLLinkedService is the BasicLinkedService implementation for AzureStorageLinkedService. +func (asls AzureStorageLinkedService) AsAzurePostgreSQLLinkedService() (*AzurePostgreSQLLinkedService, bool) { + return nil, false +} + +// AsAmazonMWSLinkedService is the BasicLinkedService implementation for AzureStorageLinkedService. +func (asls AzureStorageLinkedService) AsAmazonMWSLinkedService() (*AmazonMWSLinkedService, bool) { + return nil, false +} + +// AsSapHanaLinkedService is the BasicLinkedService implementation for AzureStorageLinkedService. +func (asls AzureStorageLinkedService) AsSapHanaLinkedService() (*SapHanaLinkedService, bool) { + return nil, false +} + +// AsSapBWLinkedService is the BasicLinkedService implementation for AzureStorageLinkedService. +func (asls AzureStorageLinkedService) AsSapBWLinkedService() (*SapBWLinkedService, bool) { + return nil, false +} + +// AsSftpServerLinkedService is the BasicLinkedService implementation for AzureStorageLinkedService. +func (asls AzureStorageLinkedService) AsSftpServerLinkedService() (*SftpServerLinkedService, bool) { + return nil, false +} + +// AsFtpServerLinkedService is the BasicLinkedService implementation for AzureStorageLinkedService. +func (asls AzureStorageLinkedService) AsFtpServerLinkedService() (*FtpServerLinkedService, bool) { + return nil, false +} + +// AsHTTPLinkedService is the BasicLinkedService implementation for AzureStorageLinkedService. +func (asls AzureStorageLinkedService) AsHTTPLinkedService() (*HTTPLinkedService, bool) { + return nil, false +} + +// AsAzureSearchLinkedService is the BasicLinkedService implementation for AzureStorageLinkedService. +func (asls AzureStorageLinkedService) AsAzureSearchLinkedService() (*AzureSearchLinkedService, bool) { + return nil, false +} + +// AsCustomDataSourceLinkedService is the BasicLinkedService implementation for AzureStorageLinkedService. +func (asls AzureStorageLinkedService) AsCustomDataSourceLinkedService() (*CustomDataSourceLinkedService, bool) { + return nil, false +} + +// AsAmazonRedshiftLinkedService is the BasicLinkedService implementation for AzureStorageLinkedService. +func (asls AzureStorageLinkedService) AsAmazonRedshiftLinkedService() (*AmazonRedshiftLinkedService, bool) { + return nil, false +} + +// AsAmazonS3LinkedService is the BasicLinkedService implementation for AzureStorageLinkedService. +func (asls AzureStorageLinkedService) AsAmazonS3LinkedService() (*AmazonS3LinkedService, bool) { + return nil, false +} + +// AsSapEccLinkedService is the BasicLinkedService implementation for AzureStorageLinkedService. +func (asls AzureStorageLinkedService) AsSapEccLinkedService() (*SapEccLinkedService, bool) { + return nil, false +} + +// AsSapCloudForCustomerLinkedService is the BasicLinkedService implementation for AzureStorageLinkedService. +func (asls AzureStorageLinkedService) AsSapCloudForCustomerLinkedService() (*SapCloudForCustomerLinkedService, bool) { + return nil, false +} + +// AsSalesforceLinkedService is the BasicLinkedService implementation for AzureStorageLinkedService. +func (asls AzureStorageLinkedService) AsSalesforceLinkedService() (*SalesforceLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeStoreLinkedService is the BasicLinkedService implementation for AzureStorageLinkedService. +func (asls AzureStorageLinkedService) AsAzureDataLakeStoreLinkedService() (*AzureDataLakeStoreLinkedService, bool) { + return nil, false +} + +// AsMongoDbLinkedService is the BasicLinkedService implementation for AzureStorageLinkedService. +func (asls AzureStorageLinkedService) AsMongoDbLinkedService() (*MongoDbLinkedService, bool) { + return nil, false +} + +// AsCassandraLinkedService is the BasicLinkedService implementation for AzureStorageLinkedService. +func (asls AzureStorageLinkedService) AsCassandraLinkedService() (*CassandraLinkedService, bool) { + return nil, false +} + +// AsWebLinkedService is the BasicLinkedService implementation for AzureStorageLinkedService. +func (asls AzureStorageLinkedService) AsWebLinkedService() (*WebLinkedService, bool) { + return nil, false +} + +// AsODataLinkedService is the BasicLinkedService implementation for AzureStorageLinkedService. +func (asls AzureStorageLinkedService) AsODataLinkedService() (*ODataLinkedService, bool) { + return nil, false +} + +// AsHdfsLinkedService is the BasicLinkedService implementation for AzureStorageLinkedService. +func (asls AzureStorageLinkedService) AsHdfsLinkedService() (*HdfsLinkedService, bool) { + return nil, false +} + +// AsOdbcLinkedService is the BasicLinkedService implementation for AzureStorageLinkedService. +func (asls AzureStorageLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, bool) { + return nil, false +} + +// AsAzureMLLinkedService is the BasicLinkedService implementation for AzureStorageLinkedService. +func (asls AzureStorageLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { + return nil, false +} + +// AsTeradataLinkedService is the BasicLinkedService implementation for AzureStorageLinkedService. +func (asls AzureStorageLinkedService) AsTeradataLinkedService() (*TeradataLinkedService, bool) { + return nil, false +} + +// AsDb2LinkedService is the BasicLinkedService implementation for AzureStorageLinkedService. +func (asls AzureStorageLinkedService) AsDb2LinkedService() (*Db2LinkedService, bool) { + return nil, false +} + +// AsSybaseLinkedService is the BasicLinkedService implementation for AzureStorageLinkedService. +func (asls AzureStorageLinkedService) AsSybaseLinkedService() (*SybaseLinkedService, bool) { + return nil, false +} + +// AsPostgreSQLLinkedService is the BasicLinkedService implementation for AzureStorageLinkedService. +func (asls AzureStorageLinkedService) AsPostgreSQLLinkedService() (*PostgreSQLLinkedService, bool) { + return nil, false +} + +// AsMySQLLinkedService is the BasicLinkedService implementation for AzureStorageLinkedService. +func (asls AzureStorageLinkedService) AsMySQLLinkedService() (*MySQLLinkedService, bool) { + return nil, false +} + +// AsAzureMySQLLinkedService is the BasicLinkedService implementation for AzureStorageLinkedService. +func (asls AzureStorageLinkedService) AsAzureMySQLLinkedService() (*AzureMySQLLinkedService, bool) { + return nil, false +} + +// AsOracleLinkedService is the BasicLinkedService implementation for AzureStorageLinkedService. +func (asls AzureStorageLinkedService) AsOracleLinkedService() (*OracleLinkedService, bool) { + return nil, false +} + +// AsFileServerLinkedService is the BasicLinkedService implementation for AzureStorageLinkedService. +func (asls AzureStorageLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { + return nil, false +} + +// AsHDInsightLinkedService is the BasicLinkedService implementation for AzureStorageLinkedService. +func (asls AzureStorageLinkedService) AsHDInsightLinkedService() (*HDInsightLinkedService, bool) { + return nil, false +} + +// AsDynamicsLinkedService is the BasicLinkedService implementation for AzureStorageLinkedService. +func (asls AzureStorageLinkedService) AsDynamicsLinkedService() (*DynamicsLinkedService, bool) { + return nil, false +} + +// AsCosmosDbLinkedService is the BasicLinkedService implementation for AzureStorageLinkedService. +func (asls AzureStorageLinkedService) AsCosmosDbLinkedService() (*CosmosDbLinkedService, bool) { + return nil, false +} + +// AsAzureKeyVaultLinkedService is the BasicLinkedService implementation for AzureStorageLinkedService. +func (asls AzureStorageLinkedService) AsAzureKeyVaultLinkedService() (*AzureKeyVaultLinkedService, bool) { + return nil, false +} + +// AsAzureBatchLinkedService is the BasicLinkedService implementation for AzureStorageLinkedService. +func (asls AzureStorageLinkedService) AsAzureBatchLinkedService() (*AzureBatchLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDatabaseLinkedService is the BasicLinkedService implementation for AzureStorageLinkedService. +func (asls AzureStorageLinkedService) AsAzureSQLDatabaseLinkedService() (*AzureSQLDatabaseLinkedService, bool) { + return nil, false +} + +// AsSQLServerLinkedService is the BasicLinkedService implementation for AzureStorageLinkedService. +func (asls AzureStorageLinkedService) AsSQLServerLinkedService() (*SQLServerLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDWLinkedService is the BasicLinkedService implementation for AzureStorageLinkedService. +func (asls AzureStorageLinkedService) AsAzureSQLDWLinkedService() (*AzureSQLDWLinkedService, bool) { + return nil, false +} + +// AsAzureStorageLinkedService is the BasicLinkedService implementation for AzureStorageLinkedService. +func (asls AzureStorageLinkedService) AsAzureStorageLinkedService() (*AzureStorageLinkedService, bool) { + return &asls, true +} + +// AsLinkedService is the BasicLinkedService implementation for AzureStorageLinkedService. +func (asls AzureStorageLinkedService) AsLinkedService() (*LinkedService, bool) { + return nil, false +} + +// AsBasicLinkedService is the BasicLinkedService implementation for AzureStorageLinkedService. +func (asls AzureStorageLinkedService) AsBasicLinkedService() (BasicLinkedService, bool) { + return &asls, true +} + +// UnmarshalJSON is the custom unmarshaler for AzureStorageLinkedService struct. +func (asls *AzureStorageLinkedService) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "typeProperties": + if v != nil { + var azureStorageLinkedServiceTypeProperties AzureStorageLinkedServiceTypeProperties + err = json.Unmarshal(*v, &azureStorageLinkedServiceTypeProperties) + if err != nil { + return err + } + asls.AzureStorageLinkedServiceTypeProperties = &azureStorageLinkedServiceTypeProperties + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if asls.AdditionalProperties == nil { + asls.AdditionalProperties = make(map[string]interface{}) + } + asls.AdditionalProperties[k] = additionalProperties + } + case "connectVia": + if v != nil { + var connectVia IntegrationRuntimeReference + err = json.Unmarshal(*v, &connectVia) + if err != nil { + return err + } + asls.ConnectVia = &connectVia + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + asls.Description = &description + } + case "parameters": + if v != nil { + var parameters map[string]*ParameterSpecification + err = json.Unmarshal(*v, ¶meters) + if err != nil { + return err + } + asls.Parameters = parameters + } + case "annotations": + if v != nil { + var annotations []interface{} + err = json.Unmarshal(*v, &annotations) + if err != nil { + return err + } + asls.Annotations = &annotations + } + case "type": + if v != nil { + var typeVar TypeBasicLinkedService + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + asls.Type = typeVar + } + } + } + + return nil +} + +// AzureStorageLinkedServiceTypeProperties azure Storage linked service properties. +type AzureStorageLinkedServiceTypeProperties struct { + // ConnectionString - The connection string. It is mutually exclusive with sasUri property. Type: string, SecureString or AzureKeyVaultSecretReference. + ConnectionString interface{} `json:"connectionString,omitempty"` + // SasURI - SAS URI of the Azure Storage resource. It is mutually exclusive with connectionString property. + SasURI BasicSecretBase `json:"sasUri,omitempty"` + // EncryptedCredential - The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string). + EncryptedCredential interface{} `json:"encryptedCredential,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for AzureStorageLinkedServiceTypeProperties struct. +func (aslstp *AzureStorageLinkedServiceTypeProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "connectionString": + if v != nil { + var connectionString interface{} + err = json.Unmarshal(*v, &connectionString) + if err != nil { + return err + } + aslstp.ConnectionString = connectionString + } + case "sasUri": + if v != nil { + sasURI, err := unmarshalBasicSecretBase(*v) + if err != nil { + return err + } + aslstp.SasURI = sasURI + } + case "encryptedCredential": + if v != nil { + var encryptedCredential interface{} + err = json.Unmarshal(*v, &encryptedCredential) + if err != nil { + return err + } + aslstp.EncryptedCredential = encryptedCredential + } + } + } + + return nil +} + +// AzureTableDataset the Azure Table storage dataset. +type AzureTableDataset struct { + // AzureTableDatasetTypeProperties - Azure Table dataset properties. + *AzureTableDatasetTypeProperties `json:"typeProperties,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Description - Dataset description. + Description *string `json:"description,omitempty"` + // Structure - Columns that define the structure of the dataset. Type: array (or Expression with resultType array), itemType: DatasetDataElement. + Structure interface{} `json:"structure,omitempty"` + // LinkedServiceName - Linked service reference. + LinkedServiceName *LinkedServiceReference `json:"linkedServiceName,omitempty"` + // Parameters - Parameters for dataset. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeDataset', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSQLServerTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSalesforceObject', 'TypeRelationalTable', 'TypeAzureMySQLTable', 'TypeOracleTable', 'TypeODataResource', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeAzureDataLakeStoreFile', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeAmazonS3Object' + Type TypeBasicDataset `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureTableDataset. +func (atd AzureTableDataset) MarshalJSON() ([]byte, error) { + atd.Type = TypeAzureTable + objectMap := make(map[string]interface{}) + if atd.AzureTableDatasetTypeProperties != nil { + objectMap["typeProperties"] = atd.AzureTableDatasetTypeProperties + } + if atd.Description != nil { + objectMap["description"] = atd.Description + } + objectMap["structure"] = atd.Structure + if atd.LinkedServiceName != nil { + objectMap["linkedServiceName"] = atd.LinkedServiceName + } + if atd.Parameters != nil { + objectMap["parameters"] = atd.Parameters + } + if atd.Annotations != nil { + objectMap["annotations"] = atd.Annotations + } + if atd.Type != "" { + objectMap["type"] = atd.Type + } + for k, v := range atd.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysObjectDataset is the BasicDataset implementation for AzureTableDataset. +func (atd AzureTableDataset) AsResponsysObjectDataset() (*ResponsysObjectDataset, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudObjectDataset is the BasicDataset implementation for AzureTableDataset. +func (atd AzureTableDataset) AsSalesforceMarketingCloudObjectDataset() (*SalesforceMarketingCloudObjectDataset, bool) { + return nil, false +} + +// AsVerticaTableDataset is the BasicDataset implementation for AzureTableDataset. +func (atd AzureTableDataset) AsVerticaTableDataset() (*VerticaTableDataset, bool) { + return nil, false +} + +// AsNetezzaTableDataset is the BasicDataset implementation for AzureTableDataset. +func (atd AzureTableDataset) AsNetezzaTableDataset() (*NetezzaTableDataset, bool) { + return nil, false +} + +// AsZohoObjectDataset is the BasicDataset implementation for AzureTableDataset. +func (atd AzureTableDataset) AsZohoObjectDataset() (*ZohoObjectDataset, bool) { + return nil, false +} + +// AsXeroObjectDataset is the BasicDataset implementation for AzureTableDataset. +func (atd AzureTableDataset) AsXeroObjectDataset() (*XeroObjectDataset, bool) { + return nil, false +} + +// AsSquareObjectDataset is the BasicDataset implementation for AzureTableDataset. +func (atd AzureTableDataset) AsSquareObjectDataset() (*SquareObjectDataset, bool) { + return nil, false +} + +// AsSparkObjectDataset is the BasicDataset implementation for AzureTableDataset. +func (atd AzureTableDataset) AsSparkObjectDataset() (*SparkObjectDataset, bool) { + return nil, false +} + +// AsShopifyObjectDataset is the BasicDataset implementation for AzureTableDataset. +func (atd AzureTableDataset) AsShopifyObjectDataset() (*ShopifyObjectDataset, bool) { + return nil, false +} + +// AsServiceNowObjectDataset is the BasicDataset implementation for AzureTableDataset. +func (atd AzureTableDataset) AsServiceNowObjectDataset() (*ServiceNowObjectDataset, bool) { + return nil, false +} + +// AsQuickBooksObjectDataset is the BasicDataset implementation for AzureTableDataset. +func (atd AzureTableDataset) AsQuickBooksObjectDataset() (*QuickBooksObjectDataset, bool) { + return nil, false +} + +// AsPrestoObjectDataset is the BasicDataset implementation for AzureTableDataset. +func (atd AzureTableDataset) AsPrestoObjectDataset() (*PrestoObjectDataset, bool) { + return nil, false +} + +// AsPhoenixObjectDataset is the BasicDataset implementation for AzureTableDataset. +func (atd AzureTableDataset) AsPhoenixObjectDataset() (*PhoenixObjectDataset, bool) { + return nil, false +} + +// AsPaypalObjectDataset is the BasicDataset implementation for AzureTableDataset. +func (atd AzureTableDataset) AsPaypalObjectDataset() (*PaypalObjectDataset, bool) { + return nil, false +} + +// AsMarketoObjectDataset is the BasicDataset implementation for AzureTableDataset. +func (atd AzureTableDataset) AsMarketoObjectDataset() (*MarketoObjectDataset, bool) { + return nil, false +} + +// AsMariaDBTableDataset is the BasicDataset implementation for AzureTableDataset. +func (atd AzureTableDataset) AsMariaDBTableDataset() (*MariaDBTableDataset, bool) { + return nil, false +} + +// AsMagentoObjectDataset is the BasicDataset implementation for AzureTableDataset. +func (atd AzureTableDataset) AsMagentoObjectDataset() (*MagentoObjectDataset, bool) { + return nil, false +} + +// AsJiraObjectDataset is the BasicDataset implementation for AzureTableDataset. +func (atd AzureTableDataset) AsJiraObjectDataset() (*JiraObjectDataset, bool) { + return nil, false +} + +// AsImpalaObjectDataset is the BasicDataset implementation for AzureTableDataset. +func (atd AzureTableDataset) AsImpalaObjectDataset() (*ImpalaObjectDataset, bool) { + return nil, false +} + +// AsHubspotObjectDataset is the BasicDataset implementation for AzureTableDataset. +func (atd AzureTableDataset) AsHubspotObjectDataset() (*HubspotObjectDataset, bool) { + return nil, false +} + +// AsHiveObjectDataset is the BasicDataset implementation for AzureTableDataset. +func (atd AzureTableDataset) AsHiveObjectDataset() (*HiveObjectDataset, bool) { + return nil, false +} + +// AsHBaseObjectDataset is the BasicDataset implementation for AzureTableDataset. +func (atd AzureTableDataset) AsHBaseObjectDataset() (*HBaseObjectDataset, bool) { + return nil, false +} + +// AsGreenplumTableDataset is the BasicDataset implementation for AzureTableDataset. +func (atd AzureTableDataset) AsGreenplumTableDataset() (*GreenplumTableDataset, bool) { + return nil, false +} + +// AsGoogleBigQueryObjectDataset is the BasicDataset implementation for AzureTableDataset. +func (atd AzureTableDataset) AsGoogleBigQueryObjectDataset() (*GoogleBigQueryObjectDataset, bool) { + return nil, false +} + +// AsEloquaObjectDataset is the BasicDataset implementation for AzureTableDataset. +func (atd AzureTableDataset) AsEloquaObjectDataset() (*EloquaObjectDataset, bool) { + return nil, false +} + +// AsDrillTableDataset is the BasicDataset implementation for AzureTableDataset. +func (atd AzureTableDataset) AsDrillTableDataset() (*DrillTableDataset, bool) { + return nil, false +} + +// AsCouchbaseTableDataset is the BasicDataset implementation for AzureTableDataset. +func (atd AzureTableDataset) AsCouchbaseTableDataset() (*CouchbaseTableDataset, bool) { + return nil, false +} + +// AsConcurObjectDataset is the BasicDataset implementation for AzureTableDataset. +func (atd AzureTableDataset) AsConcurObjectDataset() (*ConcurObjectDataset, bool) { + return nil, false +} + +// AsAzurePostgreSQLTableDataset is the BasicDataset implementation for AzureTableDataset. +func (atd AzureTableDataset) AsAzurePostgreSQLTableDataset() (*AzurePostgreSQLTableDataset, bool) { + return nil, false +} + +// AsAmazonMWSObjectDataset is the BasicDataset implementation for AzureTableDataset. +func (atd AzureTableDataset) AsAmazonMWSObjectDataset() (*AmazonMWSObjectDataset, bool) { + return nil, false +} + +// AsHTTPDataset is the BasicDataset implementation for AzureTableDataset. +func (atd AzureTableDataset) AsHTTPDataset() (*HTTPDataset, bool) { + return nil, false +} + +// AsAzureSearchIndexDataset is the BasicDataset implementation for AzureTableDataset. +func (atd AzureTableDataset) AsAzureSearchIndexDataset() (*AzureSearchIndexDataset, bool) { + return nil, false +} + +// AsWebTableDataset is the BasicDataset implementation for AzureTableDataset. +func (atd AzureTableDataset) AsWebTableDataset() (*WebTableDataset, bool) { + return nil, false +} + +// AsSQLServerTableDataset is the BasicDataset implementation for AzureTableDataset. +func (atd AzureTableDataset) AsSQLServerTableDataset() (*SQLServerTableDataset, bool) { + return nil, false +} + +// AsSapEccResourceDataset is the BasicDataset implementation for AzureTableDataset. +func (atd AzureTableDataset) AsSapEccResourceDataset() (*SapEccResourceDataset, bool) { + return nil, false +} + +// AsSapCloudForCustomerResourceDataset is the BasicDataset implementation for AzureTableDataset. +func (atd AzureTableDataset) AsSapCloudForCustomerResourceDataset() (*SapCloudForCustomerResourceDataset, bool) { + return nil, false +} + +// AsSalesforceObjectDataset is the BasicDataset implementation for AzureTableDataset. +func (atd AzureTableDataset) AsSalesforceObjectDataset() (*SalesforceObjectDataset, bool) { + return nil, false +} + +// AsRelationalTableDataset is the BasicDataset implementation for AzureTableDataset. +func (atd AzureTableDataset) AsRelationalTableDataset() (*RelationalTableDataset, bool) { + return nil, false +} + +// AsAzureMySQLTableDataset is the BasicDataset implementation for AzureTableDataset. +func (atd AzureTableDataset) AsAzureMySQLTableDataset() (*AzureMySQLTableDataset, bool) { + return nil, false +} + +// AsOracleTableDataset is the BasicDataset implementation for AzureTableDataset. +func (atd AzureTableDataset) AsOracleTableDataset() (*OracleTableDataset, bool) { + return nil, false +} + +// AsODataResourceDataset is the BasicDataset implementation for AzureTableDataset. +func (atd AzureTableDataset) AsODataResourceDataset() (*ODataResourceDataset, bool) { + return nil, false +} + +// AsMongoDbCollectionDataset is the BasicDataset implementation for AzureTableDataset. +func (atd AzureTableDataset) AsMongoDbCollectionDataset() (*MongoDbCollectionDataset, bool) { + return nil, false +} + +// AsFileShareDataset is the BasicDataset implementation for AzureTableDataset. +func (atd AzureTableDataset) AsFileShareDataset() (*FileShareDataset, bool) { + return nil, false +} + +// AsAzureDataLakeStoreDataset is the BasicDataset implementation for AzureTableDataset. +func (atd AzureTableDataset) AsAzureDataLakeStoreDataset() (*AzureDataLakeStoreDataset, bool) { + return nil, false +} + +// AsDynamicsEntityDataset is the BasicDataset implementation for AzureTableDataset. +func (atd AzureTableDataset) AsDynamicsEntityDataset() (*DynamicsEntityDataset, bool) { + return nil, false +} + +// AsDocumentDbCollectionDataset is the BasicDataset implementation for AzureTableDataset. +func (atd AzureTableDataset) AsDocumentDbCollectionDataset() (*DocumentDbCollectionDataset, bool) { + return nil, false +} + +// AsCustomDataset is the BasicDataset implementation for AzureTableDataset. +func (atd AzureTableDataset) AsCustomDataset() (*CustomDataset, bool) { + return nil, false +} + +// AsCassandraTableDataset is the BasicDataset implementation for AzureTableDataset. +func (atd AzureTableDataset) AsCassandraTableDataset() (*CassandraTableDataset, bool) { + return nil, false +} + +// AsAzureSQLDWTableDataset is the BasicDataset implementation for AzureTableDataset. +func (atd AzureTableDataset) AsAzureSQLDWTableDataset() (*AzureSQLDWTableDataset, bool) { + return nil, false +} + +// AsAzureSQLTableDataset is the BasicDataset implementation for AzureTableDataset. +func (atd AzureTableDataset) AsAzureSQLTableDataset() (*AzureSQLTableDataset, bool) { + return nil, false +} + +// AsAzureTableDataset is the BasicDataset implementation for AzureTableDataset. +func (atd AzureTableDataset) AsAzureTableDataset() (*AzureTableDataset, bool) { + return &atd, true +} + +// AsAzureBlobDataset is the BasicDataset implementation for AzureTableDataset. +func (atd AzureTableDataset) AsAzureBlobDataset() (*AzureBlobDataset, bool) { + return nil, false +} + +// AsAmazonS3Dataset is the BasicDataset implementation for AzureTableDataset. +func (atd AzureTableDataset) AsAmazonS3Dataset() (*AmazonS3Dataset, bool) { + return nil, false +} + +// AsDataset is the BasicDataset implementation for AzureTableDataset. +func (atd AzureTableDataset) AsDataset() (*Dataset, bool) { + return nil, false +} + +// AsBasicDataset is the BasicDataset implementation for AzureTableDataset. +func (atd AzureTableDataset) AsBasicDataset() (BasicDataset, bool) { + return &atd, true +} + +// UnmarshalJSON is the custom unmarshaler for AzureTableDataset struct. +func (atd *AzureTableDataset) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "typeProperties": + if v != nil { + var azureTableDatasetTypeProperties AzureTableDatasetTypeProperties + err = json.Unmarshal(*v, &azureTableDatasetTypeProperties) + if err != nil { + return err + } + atd.AzureTableDatasetTypeProperties = &azureTableDatasetTypeProperties + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if atd.AdditionalProperties == nil { + atd.AdditionalProperties = make(map[string]interface{}) + } + atd.AdditionalProperties[k] = additionalProperties + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + atd.Description = &description + } + case "structure": + if v != nil { + var structure interface{} + err = json.Unmarshal(*v, &structure) + if err != nil { + return err + } + atd.Structure = structure + } + case "linkedServiceName": + if v != nil { + var linkedServiceName LinkedServiceReference + err = json.Unmarshal(*v, &linkedServiceName) + if err != nil { + return err + } + atd.LinkedServiceName = &linkedServiceName + } + case "parameters": + if v != nil { + var parameters map[string]*ParameterSpecification + err = json.Unmarshal(*v, ¶meters) + if err != nil { + return err + } + atd.Parameters = parameters + } + case "annotations": + if v != nil { + var annotations []interface{} + err = json.Unmarshal(*v, &annotations) + if err != nil { + return err + } + atd.Annotations = &annotations + } + case "type": + if v != nil { + var typeVar TypeBasicDataset + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + atd.Type = typeVar + } + } + } + + return nil +} + +// AzureTableDatasetTypeProperties azure Table dataset properties. +type AzureTableDatasetTypeProperties struct { + // TableName - The table name of the Azure Table storage. Type: string (or Expression with resultType string). + TableName interface{} `json:"tableName,omitempty"` +} + +// AzureTableSink a copy activity Azure Table sink. +type AzureTableSink struct { + // AzureTableDefaultPartitionKeyValue - Azure Table default partition key value. Type: string (or Expression with resultType string). + AzureTableDefaultPartitionKeyValue interface{} `json:"azureTableDefaultPartitionKeyValue,omitempty"` + // AzureTablePartitionKeyName - Azure Table partition key name. Type: string (or Expression with resultType string). + AzureTablePartitionKeyName interface{} `json:"azureTablePartitionKeyName,omitempty"` + // AzureTableRowKeyName - Azure Table row key name. Type: string (or Expression with resultType string). + AzureTableRowKeyName interface{} `json:"azureTableRowKeyName,omitempty"` + // AzureTableInsertType - Azure Table insert type. Type: string (or Expression with resultType string). + AzureTableInsertType interface{} `json:"azureTableInsertType,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // WriteBatchSize - Write batch size. Type: integer (or Expression with resultType integer), minimum: 0. + WriteBatchSize interface{} `json:"writeBatchSize,omitempty"` + // WriteBatchTimeout - Write batch timeout. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + WriteBatchTimeout interface{} `json:"writeBatchTimeout,omitempty"` + // SinkRetryCount - Sink retry count. Type: integer (or Expression with resultType integer). + SinkRetryCount interface{} `json:"sinkRetryCount,omitempty"` + // SinkRetryWait - Sink retry wait. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + SinkRetryWait interface{} `json:"sinkRetryWait,omitempty"` + // Type - Possible values include: 'TypeCopySink', 'TypeSalesforceSink', 'TypeDynamicsSink', 'TypeOdbcSink', 'TypeAzureSearchIndexSink', 'TypeAzureDataLakeStoreSink', 'TypeOracleSink', 'TypeSQLDWSink', 'TypeSQLSink', 'TypeDocumentDbCollectionSink', 'TypeFileSystemSink', 'TypeBlobSink', 'TypeAzureTableSink', 'TypeAzureQueueSink', 'TypeSapCloudForCustomerSink' + Type TypeBasicCopySink `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureTableSink. +func (ats AzureTableSink) MarshalJSON() ([]byte, error) { + ats.Type = TypeAzureTableSink + objectMap := make(map[string]interface{}) + objectMap["azureTableDefaultPartitionKeyValue"] = ats.AzureTableDefaultPartitionKeyValue + objectMap["azureTablePartitionKeyName"] = ats.AzureTablePartitionKeyName + objectMap["azureTableRowKeyName"] = ats.AzureTableRowKeyName + objectMap["azureTableInsertType"] = ats.AzureTableInsertType + objectMap["writeBatchSize"] = ats.WriteBatchSize + objectMap["writeBatchTimeout"] = ats.WriteBatchTimeout + objectMap["sinkRetryCount"] = ats.SinkRetryCount + objectMap["sinkRetryWait"] = ats.SinkRetryWait + if ats.Type != "" { + objectMap["type"] = ats.Type + } + for k, v := range ats.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsSalesforceSink is the BasicCopySink implementation for AzureTableSink. +func (ats AzureTableSink) AsSalesforceSink() (*SalesforceSink, bool) { + return nil, false +} + +// AsDynamicsSink is the BasicCopySink implementation for AzureTableSink. +func (ats AzureTableSink) AsDynamicsSink() (*DynamicsSink, bool) { + return nil, false +} + +// AsOdbcSink is the BasicCopySink implementation for AzureTableSink. +func (ats AzureTableSink) AsOdbcSink() (*OdbcSink, bool) { + return nil, false +} + +// AsAzureSearchIndexSink is the BasicCopySink implementation for AzureTableSink. +func (ats AzureTableSink) AsAzureSearchIndexSink() (*AzureSearchIndexSink, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSink is the BasicCopySink implementation for AzureTableSink. +func (ats AzureTableSink) AsAzureDataLakeStoreSink() (*AzureDataLakeStoreSink, bool) { + return nil, false +} + +// AsOracleSink is the BasicCopySink implementation for AzureTableSink. +func (ats AzureTableSink) AsOracleSink() (*OracleSink, bool) { + return nil, false +} + +// AsSQLDWSink is the BasicCopySink implementation for AzureTableSink. +func (ats AzureTableSink) AsSQLDWSink() (*SQLDWSink, bool) { + return nil, false +} + +// AsSQLSink is the BasicCopySink implementation for AzureTableSink. +func (ats AzureTableSink) AsSQLSink() (*SQLSink, bool) { + return nil, false +} + +// AsDocumentDbCollectionSink is the BasicCopySink implementation for AzureTableSink. +func (ats AzureTableSink) AsDocumentDbCollectionSink() (*DocumentDbCollectionSink, bool) { + return nil, false +} + +// AsFileSystemSink is the BasicCopySink implementation for AzureTableSink. +func (ats AzureTableSink) AsFileSystemSink() (*FileSystemSink, bool) { + return nil, false +} + +// AsBlobSink is the BasicCopySink implementation for AzureTableSink. +func (ats AzureTableSink) AsBlobSink() (*BlobSink, bool) { + return nil, false +} + +// AsAzureTableSink is the BasicCopySink implementation for AzureTableSink. +func (ats AzureTableSink) AsAzureTableSink() (*AzureTableSink, bool) { + return &ats, true +} + +// AsAzureQueueSink is the BasicCopySink implementation for AzureTableSink. +func (ats AzureTableSink) AsAzureQueueSink() (*AzureQueueSink, bool) { + return nil, false +} + +// AsSapCloudForCustomerSink is the BasicCopySink implementation for AzureTableSink. +func (ats AzureTableSink) AsSapCloudForCustomerSink() (*SapCloudForCustomerSink, bool) { + return nil, false +} + +// AsCopySink is the BasicCopySink implementation for AzureTableSink. +func (ats AzureTableSink) AsCopySink() (*CopySink, bool) { + return nil, false +} + +// AsBasicCopySink is the BasicCopySink implementation for AzureTableSink. +func (ats AzureTableSink) AsBasicCopySink() (BasicCopySink, bool) { + return &ats, true +} + +// AzureTableSource a copy activity Azure Table source. +type AzureTableSource struct { + // AzureTableSourceQuery - Azure Table source query. Type: string (or Expression with resultType string). + AzureTableSourceQuery interface{} `json:"azureTableSourceQuery,omitempty"` + // AzureTableSourceIgnoreTableNotFound - Azure Table source ignore table not found. Type: boolean (or Expression with resultType boolean). + AzureTableSourceIgnoreTableNotFound interface{} `json:"azureTableSourceIgnoreTableNotFound,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // SourceRetryCount - Source retry count. Type: integer (or Expression with resultType integer). + SourceRetryCount interface{} `json:"sourceRetryCount,omitempty"` + // SourceRetryWait - Source retry wait. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` + // Type - Possible values include: 'TypeCopySource', 'TypeAmazonRedshiftSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeHTTPSource', 'TypeAzureDataLakeStoreSource', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeRelationalSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource' + Type TypeBasicCopySource `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureTableSource. +func (ats AzureTableSource) MarshalJSON() ([]byte, error) { + ats.Type = TypeAzureTableSource + objectMap := make(map[string]interface{}) + objectMap["azureTableSourceQuery"] = ats.AzureTableSourceQuery + objectMap["azureTableSourceIgnoreTableNotFound"] = ats.AzureTableSourceIgnoreTableNotFound + objectMap["sourceRetryCount"] = ats.SourceRetryCount + objectMap["sourceRetryWait"] = ats.SourceRetryWait + if ats.Type != "" { + objectMap["type"] = ats.Type + } + for k, v := range ats.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsAmazonRedshiftSource is the BasicCopySource implementation for AzureTableSource. +func (ats AzureTableSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { + return nil, false +} + +// AsResponsysSource is the BasicCopySource implementation for AzureTableSource. +func (ats AzureTableSource) AsResponsysSource() (*ResponsysSource, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudSource is the BasicCopySource implementation for AzureTableSource. +func (ats AzureTableSource) AsSalesforceMarketingCloudSource() (*SalesforceMarketingCloudSource, bool) { + return nil, false +} + +// AsVerticaSource is the BasicCopySource implementation for AzureTableSource. +func (ats AzureTableSource) AsVerticaSource() (*VerticaSource, bool) { + return nil, false +} + +// AsNetezzaSource is the BasicCopySource implementation for AzureTableSource. +func (ats AzureTableSource) AsNetezzaSource() (*NetezzaSource, bool) { + return nil, false +} + +// AsZohoSource is the BasicCopySource implementation for AzureTableSource. +func (ats AzureTableSource) AsZohoSource() (*ZohoSource, bool) { + return nil, false +} + +// AsXeroSource is the BasicCopySource implementation for AzureTableSource. +func (ats AzureTableSource) AsXeroSource() (*XeroSource, bool) { + return nil, false +} + +// AsSquareSource is the BasicCopySource implementation for AzureTableSource. +func (ats AzureTableSource) AsSquareSource() (*SquareSource, bool) { + return nil, false +} + +// AsSparkSource is the BasicCopySource implementation for AzureTableSource. +func (ats AzureTableSource) AsSparkSource() (*SparkSource, bool) { + return nil, false +} + +// AsShopifySource is the BasicCopySource implementation for AzureTableSource. +func (ats AzureTableSource) AsShopifySource() (*ShopifySource, bool) { + return nil, false +} + +// AsServiceNowSource is the BasicCopySource implementation for AzureTableSource. +func (ats AzureTableSource) AsServiceNowSource() (*ServiceNowSource, bool) { + return nil, false +} + +// AsQuickBooksSource is the BasicCopySource implementation for AzureTableSource. +func (ats AzureTableSource) AsQuickBooksSource() (*QuickBooksSource, bool) { + return nil, false +} + +// AsPrestoSource is the BasicCopySource implementation for AzureTableSource. +func (ats AzureTableSource) AsPrestoSource() (*PrestoSource, bool) { + return nil, false +} + +// AsPhoenixSource is the BasicCopySource implementation for AzureTableSource. +func (ats AzureTableSource) AsPhoenixSource() (*PhoenixSource, bool) { + return nil, false +} + +// AsPaypalSource is the BasicCopySource implementation for AzureTableSource. +func (ats AzureTableSource) AsPaypalSource() (*PaypalSource, bool) { + return nil, false +} + +// AsMarketoSource is the BasicCopySource implementation for AzureTableSource. +func (ats AzureTableSource) AsMarketoSource() (*MarketoSource, bool) { + return nil, false +} + +// AsMariaDBSource is the BasicCopySource implementation for AzureTableSource. +func (ats AzureTableSource) AsMariaDBSource() (*MariaDBSource, bool) { + return nil, false +} + +// AsMagentoSource is the BasicCopySource implementation for AzureTableSource. +func (ats AzureTableSource) AsMagentoSource() (*MagentoSource, bool) { + return nil, false +} + +// AsJiraSource is the BasicCopySource implementation for AzureTableSource. +func (ats AzureTableSource) AsJiraSource() (*JiraSource, bool) { + return nil, false +} + +// AsImpalaSource is the BasicCopySource implementation for AzureTableSource. +func (ats AzureTableSource) AsImpalaSource() (*ImpalaSource, bool) { + return nil, false +} + +// AsHubspotSource is the BasicCopySource implementation for AzureTableSource. +func (ats AzureTableSource) AsHubspotSource() (*HubspotSource, bool) { + return nil, false +} + +// AsHiveSource is the BasicCopySource implementation for AzureTableSource. +func (ats AzureTableSource) AsHiveSource() (*HiveSource, bool) { + return nil, false +} + +// AsHBaseSource is the BasicCopySource implementation for AzureTableSource. +func (ats AzureTableSource) AsHBaseSource() (*HBaseSource, bool) { + return nil, false +} + +// AsGreenplumSource is the BasicCopySource implementation for AzureTableSource. +func (ats AzureTableSource) AsGreenplumSource() (*GreenplumSource, bool) { + return nil, false +} + +// AsGoogleBigQuerySource is the BasicCopySource implementation for AzureTableSource. +func (ats AzureTableSource) AsGoogleBigQuerySource() (*GoogleBigQuerySource, bool) { + return nil, false +} + +// AsEloquaSource is the BasicCopySource implementation for AzureTableSource. +func (ats AzureTableSource) AsEloquaSource() (*EloquaSource, bool) { + return nil, false +} + +// AsDrillSource is the BasicCopySource implementation for AzureTableSource. +func (ats AzureTableSource) AsDrillSource() (*DrillSource, bool) { + return nil, false +} + +// AsCouchbaseSource is the BasicCopySource implementation for AzureTableSource. +func (ats AzureTableSource) AsCouchbaseSource() (*CouchbaseSource, bool) { + return nil, false +} + +// AsConcurSource is the BasicCopySource implementation for AzureTableSource. +func (ats AzureTableSource) AsConcurSource() (*ConcurSource, bool) { + return nil, false +} + +// AsAzurePostgreSQLSource is the BasicCopySource implementation for AzureTableSource. +func (ats AzureTableSource) AsAzurePostgreSQLSource() (*AzurePostgreSQLSource, bool) { + return nil, false +} + +// AsAmazonMWSSource is the BasicCopySource implementation for AzureTableSource. +func (ats AzureTableSource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { + return nil, false +} + +// AsHTTPSource is the BasicCopySource implementation for AzureTableSource. +func (ats AzureTableSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for AzureTableSource. +func (ats AzureTableSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for AzureTableSource. +func (ats AzureTableSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsCassandraSource is the BasicCopySource implementation for AzureTableSource. +func (ats AzureTableSource) AsCassandraSource() (*CassandraSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for AzureTableSource. +func (ats AzureTableSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for AzureTableSource. +func (ats AzureTableSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureMySQLSource is the BasicCopySource implementation for AzureTableSource. +func (ats AzureTableSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for AzureTableSource. +func (ats AzureTableSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for AzureTableSource. +func (ats AzureTableSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsSQLDWSource is the BasicCopySource implementation for AzureTableSource. +func (ats AzureTableSource) AsSQLDWSource() (*SQLDWSource, bool) { + return nil, false +} + +// AsSQLSource is the BasicCopySource implementation for AzureTableSource. +func (ats AzureTableSource) AsSQLSource() (*SQLSource, bool) { + return nil, false +} + +// AsSapEccSource is the BasicCopySource implementation for AzureTableSource. +func (ats AzureTableSource) AsSapEccSource() (*SapEccSource, bool) { + return nil, false +} + +// AsSapCloudForCustomerSource is the BasicCopySource implementation for AzureTableSource. +func (ats AzureTableSource) AsSapCloudForCustomerSource() (*SapCloudForCustomerSource, bool) { + return nil, false +} + +// AsSalesforceSource is the BasicCopySource implementation for AzureTableSource. +func (ats AzureTableSource) AsSalesforceSource() (*SalesforceSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for AzureTableSource. +func (ats AzureTableSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for AzureTableSource. +func (ats AzureTableSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for AzureTableSource. +func (ats AzureTableSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for AzureTableSource. +func (ats AzureTableSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + +// AsAzureTableSource is the BasicCopySource implementation for AzureTableSource. +func (ats AzureTableSource) AsAzureTableSource() (*AzureTableSource, bool) { + return &ats, true +} + +// AsCopySource is the BasicCopySource implementation for AzureTableSource. +func (ats AzureTableSource) AsCopySource() (*CopySource, bool) { + return nil, false +} + +// AsBasicCopySource is the BasicCopySource implementation for AzureTableSource. +func (ats AzureTableSource) AsBasicCopySource() (BasicCopySource, bool) { + return &ats, true +} + +// BlobEventsTrigger trigger that runs everytime a Blob event occurs. +type BlobEventsTrigger struct { + // BlobEventsTriggerTypeProperties - Blob Events Trigger properties. + *BlobEventsTriggerTypeProperties `json:"typeProperties,omitempty"` + // Pipelines - Pipelines that need to be started. + Pipelines *[]TriggerPipelineReference `json:"pipelines,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Description - Trigger description. + Description *string `json:"description,omitempty"` + // RuntimeState - Indicates if trigger is running or not. Updated when Start/Stop APIs are called on the Trigger. Possible values include: 'TriggerRuntimeStateStarted', 'TriggerRuntimeStateStopped', 'TriggerRuntimeStateDisabled' + RuntimeState TriggerRuntimeState `json:"runtimeState,omitempty"` + // Type - Possible values include: 'TypeTrigger', 'TypeTumblingWindowTrigger', 'TypeBlobEventsTrigger', 'TypeBlobTrigger', 'TypeScheduleTrigger', 'TypeMultiplePipelineTrigger' + Type TypeBasicTrigger `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for BlobEventsTrigger. +func (bet BlobEventsTrigger) MarshalJSON() ([]byte, error) { + bet.Type = TypeBlobEventsTrigger + objectMap := make(map[string]interface{}) + if bet.BlobEventsTriggerTypeProperties != nil { + objectMap["typeProperties"] = bet.BlobEventsTriggerTypeProperties + } + if bet.Pipelines != nil { + objectMap["pipelines"] = bet.Pipelines + } + if bet.Description != nil { + objectMap["description"] = bet.Description + } + if bet.RuntimeState != "" { + objectMap["runtimeState"] = bet.RuntimeState + } + if bet.Type != "" { + objectMap["type"] = bet.Type + } + for k, v := range bet.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsTumblingWindowTrigger is the BasicTrigger implementation for BlobEventsTrigger. +func (bet BlobEventsTrigger) AsTumblingWindowTrigger() (*TumblingWindowTrigger, bool) { + return nil, false +} + +// AsBlobEventsTrigger is the BasicTrigger implementation for BlobEventsTrigger. +func (bet BlobEventsTrigger) AsBlobEventsTrigger() (*BlobEventsTrigger, bool) { + return &bet, true +} + +// AsBlobTrigger is the BasicTrigger implementation for BlobEventsTrigger. +func (bet BlobEventsTrigger) AsBlobTrigger() (*BlobTrigger, bool) { + return nil, false +} + +// AsScheduleTrigger is the BasicTrigger implementation for BlobEventsTrigger. +func (bet BlobEventsTrigger) AsScheduleTrigger() (*ScheduleTrigger, bool) { + return nil, false +} + +// AsMultiplePipelineTrigger is the BasicTrigger implementation for BlobEventsTrigger. +func (bet BlobEventsTrigger) AsMultiplePipelineTrigger() (*MultiplePipelineTrigger, bool) { + return nil, false +} + +// AsBasicMultiplePipelineTrigger is the BasicTrigger implementation for BlobEventsTrigger. +func (bet BlobEventsTrigger) AsBasicMultiplePipelineTrigger() (BasicMultiplePipelineTrigger, bool) { + return &bet, true +} + +// AsTrigger is the BasicTrigger implementation for BlobEventsTrigger. +func (bet BlobEventsTrigger) AsTrigger() (*Trigger, bool) { + return nil, false +} + +// AsBasicTrigger is the BasicTrigger implementation for BlobEventsTrigger. +func (bet BlobEventsTrigger) AsBasicTrigger() (BasicTrigger, bool) { + return &bet, true +} + +// UnmarshalJSON is the custom unmarshaler for BlobEventsTrigger struct. +func (bet *BlobEventsTrigger) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "typeProperties": + if v != nil { + var blobEventsTriggerTypeProperties BlobEventsTriggerTypeProperties + err = json.Unmarshal(*v, &blobEventsTriggerTypeProperties) + if err != nil { + return err + } + bet.BlobEventsTriggerTypeProperties = &blobEventsTriggerTypeProperties + } + case "pipelines": + if v != nil { + var pipelines []TriggerPipelineReference + err = json.Unmarshal(*v, &pipelines) + if err != nil { + return err + } + bet.Pipelines = &pipelines + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if bet.AdditionalProperties == nil { + bet.AdditionalProperties = make(map[string]interface{}) + } + bet.AdditionalProperties[k] = additionalProperties + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + bet.Description = &description + } + case "runtimeState": + if v != nil { + var runtimeState TriggerRuntimeState + err = json.Unmarshal(*v, &runtimeState) + if err != nil { + return err + } + bet.RuntimeState = runtimeState + } + case "type": + if v != nil { + var typeVar TypeBasicTrigger + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + bet.Type = typeVar + } + } + } + + return nil +} + +// BlobEventsTriggerTypeProperties blob Events Trigger properties. +type BlobEventsTriggerTypeProperties struct { + // BlobPathBeginsWith - The blob path must begin with the pattern provided for trigger to fire. For example, '/records/blobs/december/' will only fire the trigger for blobs in the december folder under the records container. At least one of these must be provided: blobPathBeginsWith, blobPathEndsWith. + BlobPathBeginsWith *string `json:"blobPathBeginsWith,omitempty"` + // BlobPathEndsWith - The blob path must end with the pattern provided for trigger to fire. For example, 'december/boxes.csv' will only fire the trigger for blobs named boxes in a december folder. At least one of these must be provided: blobPathBeginsWith, blobPathEndsWith. + BlobPathEndsWith *string `json:"blobPathEndsWith,omitempty"` + // Events - The type of events that cause this trigger to fire. + Events *[]BlobEventTypes `json:"events,omitempty"` + // Scope - The ARM resource ID of the Storage Account. + Scope *string `json:"scope,omitempty"` +} + +// BlobSink a copy activity Azure Blob sink. +type BlobSink struct { + // BlobWriterOverwriteFiles - Blob writer overwrite files. Type: boolean (or Expression with resultType boolean). + BlobWriterOverwriteFiles interface{} `json:"blobWriterOverwriteFiles,omitempty"` + // BlobWriterDateTimeFormat - Blob writer date time format. Type: string (or Expression with resultType string). + BlobWriterDateTimeFormat interface{} `json:"blobWriterDateTimeFormat,omitempty"` + // BlobWriterAddHeader - Blob writer add header. Type: boolean (or Expression with resultType boolean). + BlobWriterAddHeader interface{} `json:"blobWriterAddHeader,omitempty"` + // CopyBehavior - The type of copy behavior for copy sink. Possible values include: 'PreserveHierarchy', 'FlattenHierarchy', 'MergeFiles' + CopyBehavior CopyBehaviorType `json:"copyBehavior,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // WriteBatchSize - Write batch size. Type: integer (or Expression with resultType integer), minimum: 0. + WriteBatchSize interface{} `json:"writeBatchSize,omitempty"` + // WriteBatchTimeout - Write batch timeout. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + WriteBatchTimeout interface{} `json:"writeBatchTimeout,omitempty"` + // SinkRetryCount - Sink retry count. Type: integer (or Expression with resultType integer). + SinkRetryCount interface{} `json:"sinkRetryCount,omitempty"` + // SinkRetryWait - Sink retry wait. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + SinkRetryWait interface{} `json:"sinkRetryWait,omitempty"` + // Type - Possible values include: 'TypeCopySink', 'TypeSalesforceSink', 'TypeDynamicsSink', 'TypeOdbcSink', 'TypeAzureSearchIndexSink', 'TypeAzureDataLakeStoreSink', 'TypeOracleSink', 'TypeSQLDWSink', 'TypeSQLSink', 'TypeDocumentDbCollectionSink', 'TypeFileSystemSink', 'TypeBlobSink', 'TypeAzureTableSink', 'TypeAzureQueueSink', 'TypeSapCloudForCustomerSink' + Type TypeBasicCopySink `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for BlobSink. +func (bs BlobSink) MarshalJSON() ([]byte, error) { + bs.Type = TypeBlobSink + objectMap := make(map[string]interface{}) + objectMap["blobWriterOverwriteFiles"] = bs.BlobWriterOverwriteFiles + objectMap["blobWriterDateTimeFormat"] = bs.BlobWriterDateTimeFormat + objectMap["blobWriterAddHeader"] = bs.BlobWriterAddHeader + if bs.CopyBehavior != "" { + objectMap["copyBehavior"] = bs.CopyBehavior + } + objectMap["writeBatchSize"] = bs.WriteBatchSize + objectMap["writeBatchTimeout"] = bs.WriteBatchTimeout + objectMap["sinkRetryCount"] = bs.SinkRetryCount + objectMap["sinkRetryWait"] = bs.SinkRetryWait + if bs.Type != "" { + objectMap["type"] = bs.Type + } + for k, v := range bs.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsSalesforceSink is the BasicCopySink implementation for BlobSink. +func (bs BlobSink) AsSalesforceSink() (*SalesforceSink, bool) { + return nil, false +} + +// AsDynamicsSink is the BasicCopySink implementation for BlobSink. +func (bs BlobSink) AsDynamicsSink() (*DynamicsSink, bool) { + return nil, false +} + +// AsOdbcSink is the BasicCopySink implementation for BlobSink. +func (bs BlobSink) AsOdbcSink() (*OdbcSink, bool) { + return nil, false +} + +// AsAzureSearchIndexSink is the BasicCopySink implementation for BlobSink. +func (bs BlobSink) AsAzureSearchIndexSink() (*AzureSearchIndexSink, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSink is the BasicCopySink implementation for BlobSink. +func (bs BlobSink) AsAzureDataLakeStoreSink() (*AzureDataLakeStoreSink, bool) { + return nil, false +} + +// AsOracleSink is the BasicCopySink implementation for BlobSink. +func (bs BlobSink) AsOracleSink() (*OracleSink, bool) { + return nil, false +} + +// AsSQLDWSink is the BasicCopySink implementation for BlobSink. +func (bs BlobSink) AsSQLDWSink() (*SQLDWSink, bool) { + return nil, false +} + +// AsSQLSink is the BasicCopySink implementation for BlobSink. +func (bs BlobSink) AsSQLSink() (*SQLSink, bool) { + return nil, false +} + +// AsDocumentDbCollectionSink is the BasicCopySink implementation for BlobSink. +func (bs BlobSink) AsDocumentDbCollectionSink() (*DocumentDbCollectionSink, bool) { + return nil, false +} + +// AsFileSystemSink is the BasicCopySink implementation for BlobSink. +func (bs BlobSink) AsFileSystemSink() (*FileSystemSink, bool) { + return nil, false +} + +// AsBlobSink is the BasicCopySink implementation for BlobSink. +func (bs BlobSink) AsBlobSink() (*BlobSink, bool) { + return &bs, true +} + +// AsAzureTableSink is the BasicCopySink implementation for BlobSink. +func (bs BlobSink) AsAzureTableSink() (*AzureTableSink, bool) { + return nil, false +} + +// AsAzureQueueSink is the BasicCopySink implementation for BlobSink. +func (bs BlobSink) AsAzureQueueSink() (*AzureQueueSink, bool) { + return nil, false +} + +// AsSapCloudForCustomerSink is the BasicCopySink implementation for BlobSink. +func (bs BlobSink) AsSapCloudForCustomerSink() (*SapCloudForCustomerSink, bool) { + return nil, false +} + +// AsCopySink is the BasicCopySink implementation for BlobSink. +func (bs BlobSink) AsCopySink() (*CopySink, bool) { + return nil, false +} + +// AsBasicCopySink is the BasicCopySink implementation for BlobSink. +func (bs BlobSink) AsBasicCopySink() (BasicCopySink, bool) { + return &bs, true +} + +// BlobSource a copy activity Azure Blob source. +type BlobSource struct { + // TreatEmptyAsNull - Treat empty as null. Type: boolean (or Expression with resultType boolean). + TreatEmptyAsNull interface{} `json:"treatEmptyAsNull,omitempty"` + // SkipHeaderLineCount - Number of header lines to skip from each blob. Type: integer (or Expression with resultType integer). + SkipHeaderLineCount interface{} `json:"skipHeaderLineCount,omitempty"` + // Recursive - If true, files under the folder path will be read recursively. Default is true. Type: boolean (or Expression with resultType boolean). + Recursive interface{} `json:"recursive,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // SourceRetryCount - Source retry count. Type: integer (or Expression with resultType integer). + SourceRetryCount interface{} `json:"sourceRetryCount,omitempty"` + // SourceRetryWait - Source retry wait. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` + // Type - Possible values include: 'TypeCopySource', 'TypeAmazonRedshiftSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeHTTPSource', 'TypeAzureDataLakeStoreSource', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeRelationalSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource' + Type TypeBasicCopySource `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for BlobSource. +func (bs BlobSource) MarshalJSON() ([]byte, error) { + bs.Type = TypeBlobSource + objectMap := make(map[string]interface{}) + objectMap["treatEmptyAsNull"] = bs.TreatEmptyAsNull + objectMap["skipHeaderLineCount"] = bs.SkipHeaderLineCount + objectMap["recursive"] = bs.Recursive + objectMap["sourceRetryCount"] = bs.SourceRetryCount + objectMap["sourceRetryWait"] = bs.SourceRetryWait + if bs.Type != "" { + objectMap["type"] = bs.Type + } + for k, v := range bs.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsAmazonRedshiftSource is the BasicCopySource implementation for BlobSource. +func (bs BlobSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { + return nil, false +} + +// AsResponsysSource is the BasicCopySource implementation for BlobSource. +func (bs BlobSource) AsResponsysSource() (*ResponsysSource, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudSource is the BasicCopySource implementation for BlobSource. +func (bs BlobSource) AsSalesforceMarketingCloudSource() (*SalesforceMarketingCloudSource, bool) { + return nil, false +} + +// AsVerticaSource is the BasicCopySource implementation for BlobSource. +func (bs BlobSource) AsVerticaSource() (*VerticaSource, bool) { + return nil, false +} + +// AsNetezzaSource is the BasicCopySource implementation for BlobSource. +func (bs BlobSource) AsNetezzaSource() (*NetezzaSource, bool) { + return nil, false +} + +// AsZohoSource is the BasicCopySource implementation for BlobSource. +func (bs BlobSource) AsZohoSource() (*ZohoSource, bool) { + return nil, false +} + +// AsXeroSource is the BasicCopySource implementation for BlobSource. +func (bs BlobSource) AsXeroSource() (*XeroSource, bool) { + return nil, false +} + +// AsSquareSource is the BasicCopySource implementation for BlobSource. +func (bs BlobSource) AsSquareSource() (*SquareSource, bool) { + return nil, false +} + +// AsSparkSource is the BasicCopySource implementation for BlobSource. +func (bs BlobSource) AsSparkSource() (*SparkSource, bool) { + return nil, false +} + +// AsShopifySource is the BasicCopySource implementation for BlobSource. +func (bs BlobSource) AsShopifySource() (*ShopifySource, bool) { + return nil, false +} + +// AsServiceNowSource is the BasicCopySource implementation for BlobSource. +func (bs BlobSource) AsServiceNowSource() (*ServiceNowSource, bool) { + return nil, false +} + +// AsQuickBooksSource is the BasicCopySource implementation for BlobSource. +func (bs BlobSource) AsQuickBooksSource() (*QuickBooksSource, bool) { + return nil, false +} + +// AsPrestoSource is the BasicCopySource implementation for BlobSource. +func (bs BlobSource) AsPrestoSource() (*PrestoSource, bool) { + return nil, false +} + +// AsPhoenixSource is the BasicCopySource implementation for BlobSource. +func (bs BlobSource) AsPhoenixSource() (*PhoenixSource, bool) { + return nil, false +} + +// AsPaypalSource is the BasicCopySource implementation for BlobSource. +func (bs BlobSource) AsPaypalSource() (*PaypalSource, bool) { + return nil, false +} + +// AsMarketoSource is the BasicCopySource implementation for BlobSource. +func (bs BlobSource) AsMarketoSource() (*MarketoSource, bool) { + return nil, false +} + +// AsMariaDBSource is the BasicCopySource implementation for BlobSource. +func (bs BlobSource) AsMariaDBSource() (*MariaDBSource, bool) { + return nil, false +} + +// AsMagentoSource is the BasicCopySource implementation for BlobSource. +func (bs BlobSource) AsMagentoSource() (*MagentoSource, bool) { + return nil, false +} + +// AsJiraSource is the BasicCopySource implementation for BlobSource. +func (bs BlobSource) AsJiraSource() (*JiraSource, bool) { + return nil, false +} + +// AsImpalaSource is the BasicCopySource implementation for BlobSource. +func (bs BlobSource) AsImpalaSource() (*ImpalaSource, bool) { + return nil, false +} + +// AsHubspotSource is the BasicCopySource implementation for BlobSource. +func (bs BlobSource) AsHubspotSource() (*HubspotSource, bool) { + return nil, false +} + +// AsHiveSource is the BasicCopySource implementation for BlobSource. +func (bs BlobSource) AsHiveSource() (*HiveSource, bool) { + return nil, false +} + +// AsHBaseSource is the BasicCopySource implementation for BlobSource. +func (bs BlobSource) AsHBaseSource() (*HBaseSource, bool) { + return nil, false +} + +// AsGreenplumSource is the BasicCopySource implementation for BlobSource. +func (bs BlobSource) AsGreenplumSource() (*GreenplumSource, bool) { + return nil, false +} + +// AsGoogleBigQuerySource is the BasicCopySource implementation for BlobSource. +func (bs BlobSource) AsGoogleBigQuerySource() (*GoogleBigQuerySource, bool) { + return nil, false +} + +// AsEloquaSource is the BasicCopySource implementation for BlobSource. +func (bs BlobSource) AsEloquaSource() (*EloquaSource, bool) { + return nil, false +} + +// AsDrillSource is the BasicCopySource implementation for BlobSource. +func (bs BlobSource) AsDrillSource() (*DrillSource, bool) { + return nil, false +} + +// AsCouchbaseSource is the BasicCopySource implementation for BlobSource. +func (bs BlobSource) AsCouchbaseSource() (*CouchbaseSource, bool) { + return nil, false +} + +// AsConcurSource is the BasicCopySource implementation for BlobSource. +func (bs BlobSource) AsConcurSource() (*ConcurSource, bool) { + return nil, false +} + +// AsAzurePostgreSQLSource is the BasicCopySource implementation for BlobSource. +func (bs BlobSource) AsAzurePostgreSQLSource() (*AzurePostgreSQLSource, bool) { + return nil, false +} + +// AsAmazonMWSSource is the BasicCopySource implementation for BlobSource. +func (bs BlobSource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { + return nil, false +} + +// AsHTTPSource is the BasicCopySource implementation for BlobSource. +func (bs BlobSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for BlobSource. +func (bs BlobSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for BlobSource. +func (bs BlobSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsCassandraSource is the BasicCopySource implementation for BlobSource. +func (bs BlobSource) AsCassandraSource() (*CassandraSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for BlobSource. +func (bs BlobSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for BlobSource. +func (bs BlobSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureMySQLSource is the BasicCopySource implementation for BlobSource. +func (bs BlobSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for BlobSource. +func (bs BlobSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for BlobSource. +func (bs BlobSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsSQLDWSource is the BasicCopySource implementation for BlobSource. +func (bs BlobSource) AsSQLDWSource() (*SQLDWSource, bool) { + return nil, false +} + +// AsSQLSource is the BasicCopySource implementation for BlobSource. +func (bs BlobSource) AsSQLSource() (*SQLSource, bool) { + return nil, false +} + +// AsSapEccSource is the BasicCopySource implementation for BlobSource. +func (bs BlobSource) AsSapEccSource() (*SapEccSource, bool) { + return nil, false +} + +// AsSapCloudForCustomerSource is the BasicCopySource implementation for BlobSource. +func (bs BlobSource) AsSapCloudForCustomerSource() (*SapCloudForCustomerSource, bool) { + return nil, false +} + +// AsSalesforceSource is the BasicCopySource implementation for BlobSource. +func (bs BlobSource) AsSalesforceSource() (*SalesforceSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for BlobSource. +func (bs BlobSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for BlobSource. +func (bs BlobSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for BlobSource. +func (bs BlobSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for BlobSource. +func (bs BlobSource) AsBlobSource() (*BlobSource, bool) { + return &bs, true +} + +// AsAzureTableSource is the BasicCopySource implementation for BlobSource. +func (bs BlobSource) AsAzureTableSource() (*AzureTableSource, bool) { + return nil, false +} + +// AsCopySource is the BasicCopySource implementation for BlobSource. +func (bs BlobSource) AsCopySource() (*CopySource, bool) { + return nil, false +} + +// AsBasicCopySource is the BasicCopySource implementation for BlobSource. +func (bs BlobSource) AsBasicCopySource() (BasicCopySource, bool) { + return &bs, true +} + +// BlobTrigger trigger that runs everytime the selected Blob container changes. +type BlobTrigger struct { + // BlobTriggerTypeProperties - Blob Trigger properties. + *BlobTriggerTypeProperties `json:"typeProperties,omitempty"` + // Pipelines - Pipelines that need to be started. + Pipelines *[]TriggerPipelineReference `json:"pipelines,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Description - Trigger description. + Description *string `json:"description,omitempty"` + // RuntimeState - Indicates if trigger is running or not. Updated when Start/Stop APIs are called on the Trigger. Possible values include: 'TriggerRuntimeStateStarted', 'TriggerRuntimeStateStopped', 'TriggerRuntimeStateDisabled' + RuntimeState TriggerRuntimeState `json:"runtimeState,omitempty"` + // Type - Possible values include: 'TypeTrigger', 'TypeTumblingWindowTrigger', 'TypeBlobEventsTrigger', 'TypeBlobTrigger', 'TypeScheduleTrigger', 'TypeMultiplePipelineTrigger' + Type TypeBasicTrigger `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for BlobTrigger. +func (bt BlobTrigger) MarshalJSON() ([]byte, error) { + bt.Type = TypeBlobTrigger + objectMap := make(map[string]interface{}) + if bt.BlobTriggerTypeProperties != nil { + objectMap["typeProperties"] = bt.BlobTriggerTypeProperties + } + if bt.Pipelines != nil { + objectMap["pipelines"] = bt.Pipelines + } + if bt.Description != nil { + objectMap["description"] = bt.Description + } + if bt.RuntimeState != "" { + objectMap["runtimeState"] = bt.RuntimeState + } + if bt.Type != "" { + objectMap["type"] = bt.Type + } + for k, v := range bt.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsTumblingWindowTrigger is the BasicTrigger implementation for BlobTrigger. +func (bt BlobTrigger) AsTumblingWindowTrigger() (*TumblingWindowTrigger, bool) { + return nil, false +} + +// AsBlobEventsTrigger is the BasicTrigger implementation for BlobTrigger. +func (bt BlobTrigger) AsBlobEventsTrigger() (*BlobEventsTrigger, bool) { + return nil, false +} + +// AsBlobTrigger is the BasicTrigger implementation for BlobTrigger. +func (bt BlobTrigger) AsBlobTrigger() (*BlobTrigger, bool) { + return &bt, true +} + +// AsScheduleTrigger is the BasicTrigger implementation for BlobTrigger. +func (bt BlobTrigger) AsScheduleTrigger() (*ScheduleTrigger, bool) { + return nil, false +} + +// AsMultiplePipelineTrigger is the BasicTrigger implementation for BlobTrigger. +func (bt BlobTrigger) AsMultiplePipelineTrigger() (*MultiplePipelineTrigger, bool) { + return nil, false +} + +// AsBasicMultiplePipelineTrigger is the BasicTrigger implementation for BlobTrigger. +func (bt BlobTrigger) AsBasicMultiplePipelineTrigger() (BasicMultiplePipelineTrigger, bool) { + return &bt, true +} + +// AsTrigger is the BasicTrigger implementation for BlobTrigger. +func (bt BlobTrigger) AsTrigger() (*Trigger, bool) { + return nil, false +} + +// AsBasicTrigger is the BasicTrigger implementation for BlobTrigger. +func (bt BlobTrigger) AsBasicTrigger() (BasicTrigger, bool) { + return &bt, true +} + +// UnmarshalJSON is the custom unmarshaler for BlobTrigger struct. +func (bt *BlobTrigger) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "typeProperties": + if v != nil { + var blobTriggerTypeProperties BlobTriggerTypeProperties + err = json.Unmarshal(*v, &blobTriggerTypeProperties) + if err != nil { + return err + } + bt.BlobTriggerTypeProperties = &blobTriggerTypeProperties + } + case "pipelines": + if v != nil { + var pipelines []TriggerPipelineReference + err = json.Unmarshal(*v, &pipelines) + if err != nil { + return err + } + bt.Pipelines = &pipelines + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if bt.AdditionalProperties == nil { + bt.AdditionalProperties = make(map[string]interface{}) + } + bt.AdditionalProperties[k] = additionalProperties + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + bt.Description = &description + } + case "runtimeState": + if v != nil { + var runtimeState TriggerRuntimeState + err = json.Unmarshal(*v, &runtimeState) + if err != nil { + return err + } + bt.RuntimeState = runtimeState + } + case "type": + if v != nil { + var typeVar TypeBasicTrigger + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + bt.Type = typeVar + } + } + } + + return nil +} + +// BlobTriggerTypeProperties blob Trigger properties. +type BlobTriggerTypeProperties struct { + // FolderPath - The path of the container/folder that will trigger the pipeline. + FolderPath *string `json:"folderPath,omitempty"` + // MaxConcurrency - The max number of parallel files to handle when it is triggered. + MaxConcurrency *int32 `json:"maxConcurrency,omitempty"` + // LinkedService - The Azure Storage linked service reference. + LinkedService *LinkedServiceReference `json:"linkedService,omitempty"` +} + +// CassandraLinkedService linked service for Cassandra data source. +type CassandraLinkedService struct { + // CassandraLinkedServiceTypeProperties - Cassandra linked service properties. + *CassandraLinkedServiceTypeProperties `json:"typeProperties,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // ConnectVia - The integration runtime reference. + ConnectVia *IntegrationRuntimeReference `json:"connectVia,omitempty"` + // Description - Linked service description. + Description *string `json:"description,omitempty"` + // Parameters - Parameters for linked service. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeLinkedService', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforce', 'TypeAzureDataLakeStore', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureStorage' + Type TypeBasicLinkedService `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for CassandraLinkedService. +func (cls CassandraLinkedService) MarshalJSON() ([]byte, error) { + cls.Type = TypeCassandra + objectMap := make(map[string]interface{}) + if cls.CassandraLinkedServiceTypeProperties != nil { + objectMap["typeProperties"] = cls.CassandraLinkedServiceTypeProperties + } + if cls.ConnectVia != nil { + objectMap["connectVia"] = cls.ConnectVia + } + if cls.Description != nil { + objectMap["description"] = cls.Description + } + if cls.Parameters != nil { + objectMap["parameters"] = cls.Parameters + } + if cls.Annotations != nil { + objectMap["annotations"] = cls.Annotations + } + if cls.Type != "" { + objectMap["type"] = cls.Type + } + for k, v := range cls.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysLinkedService is the BasicLinkedService implementation for CassandraLinkedService. +func (cls CassandraLinkedService) AsResponsysLinkedService() (*ResponsysLinkedService, bool) { + return nil, false +} + +// AsAzureDatabricksLinkedService is the BasicLinkedService implementation for CassandraLinkedService. +func (cls CassandraLinkedService) AsAzureDatabricksLinkedService() (*AzureDatabricksLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeAnalyticsLinkedService is the BasicLinkedService implementation for CassandraLinkedService. +func (cls CassandraLinkedService) AsAzureDataLakeAnalyticsLinkedService() (*AzureDataLakeAnalyticsLinkedService, bool) { + return nil, false +} + +// AsHDInsightOnDemandLinkedService is the BasicLinkedService implementation for CassandraLinkedService. +func (cls CassandraLinkedService) AsHDInsightOnDemandLinkedService() (*HDInsightOnDemandLinkedService, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudLinkedService is the BasicLinkedService implementation for CassandraLinkedService. +func (cls CassandraLinkedService) AsSalesforceMarketingCloudLinkedService() (*SalesforceMarketingCloudLinkedService, bool) { + return nil, false +} + +// AsNetezzaLinkedService is the BasicLinkedService implementation for CassandraLinkedService. +func (cls CassandraLinkedService) AsNetezzaLinkedService() (*NetezzaLinkedService, bool) { + return nil, false +} + +// AsVerticaLinkedService is the BasicLinkedService implementation for CassandraLinkedService. +func (cls CassandraLinkedService) AsVerticaLinkedService() (*VerticaLinkedService, bool) { + return nil, false +} + +// AsZohoLinkedService is the BasicLinkedService implementation for CassandraLinkedService. +func (cls CassandraLinkedService) AsZohoLinkedService() (*ZohoLinkedService, bool) { + return nil, false +} + +// AsXeroLinkedService is the BasicLinkedService implementation for CassandraLinkedService. +func (cls CassandraLinkedService) AsXeroLinkedService() (*XeroLinkedService, bool) { + return nil, false +} + +// AsSquareLinkedService is the BasicLinkedService implementation for CassandraLinkedService. +func (cls CassandraLinkedService) AsSquareLinkedService() (*SquareLinkedService, bool) { + return nil, false +} + +// AsSparkLinkedService is the BasicLinkedService implementation for CassandraLinkedService. +func (cls CassandraLinkedService) AsSparkLinkedService() (*SparkLinkedService, bool) { + return nil, false +} + +// AsShopifyLinkedService is the BasicLinkedService implementation for CassandraLinkedService. +func (cls CassandraLinkedService) AsShopifyLinkedService() (*ShopifyLinkedService, bool) { + return nil, false +} + +// AsServiceNowLinkedService is the BasicLinkedService implementation for CassandraLinkedService. +func (cls CassandraLinkedService) AsServiceNowLinkedService() (*ServiceNowLinkedService, bool) { + return nil, false +} + +// AsQuickBooksLinkedService is the BasicLinkedService implementation for CassandraLinkedService. +func (cls CassandraLinkedService) AsQuickBooksLinkedService() (*QuickBooksLinkedService, bool) { + return nil, false +} + +// AsPrestoLinkedService is the BasicLinkedService implementation for CassandraLinkedService. +func (cls CassandraLinkedService) AsPrestoLinkedService() (*PrestoLinkedService, bool) { + return nil, false +} + +// AsPhoenixLinkedService is the BasicLinkedService implementation for CassandraLinkedService. +func (cls CassandraLinkedService) AsPhoenixLinkedService() (*PhoenixLinkedService, bool) { + return nil, false +} + +// AsPaypalLinkedService is the BasicLinkedService implementation for CassandraLinkedService. +func (cls CassandraLinkedService) AsPaypalLinkedService() (*PaypalLinkedService, bool) { + return nil, false +} + +// AsMarketoLinkedService is the BasicLinkedService implementation for CassandraLinkedService. +func (cls CassandraLinkedService) AsMarketoLinkedService() (*MarketoLinkedService, bool) { + return nil, false +} + +// AsMariaDBLinkedService is the BasicLinkedService implementation for CassandraLinkedService. +func (cls CassandraLinkedService) AsMariaDBLinkedService() (*MariaDBLinkedService, bool) { + return nil, false +} + +// AsMagentoLinkedService is the BasicLinkedService implementation for CassandraLinkedService. +func (cls CassandraLinkedService) AsMagentoLinkedService() (*MagentoLinkedService, bool) { + return nil, false +} + +// AsJiraLinkedService is the BasicLinkedService implementation for CassandraLinkedService. +func (cls CassandraLinkedService) AsJiraLinkedService() (*JiraLinkedService, bool) { + return nil, false +} + +// AsImpalaLinkedService is the BasicLinkedService implementation for CassandraLinkedService. +func (cls CassandraLinkedService) AsImpalaLinkedService() (*ImpalaLinkedService, bool) { + return nil, false +} + +// AsHubspotLinkedService is the BasicLinkedService implementation for CassandraLinkedService. +func (cls CassandraLinkedService) AsHubspotLinkedService() (*HubspotLinkedService, bool) { + return nil, false +} + +// AsHiveLinkedService is the BasicLinkedService implementation for CassandraLinkedService. +func (cls CassandraLinkedService) AsHiveLinkedService() (*HiveLinkedService, bool) { + return nil, false +} + +// AsHBaseLinkedService is the BasicLinkedService implementation for CassandraLinkedService. +func (cls CassandraLinkedService) AsHBaseLinkedService() (*HBaseLinkedService, bool) { + return nil, false +} + +// AsGreenplumLinkedService is the BasicLinkedService implementation for CassandraLinkedService. +func (cls CassandraLinkedService) AsGreenplumLinkedService() (*GreenplumLinkedService, bool) { + return nil, false +} + +// AsGoogleBigQueryLinkedService is the BasicLinkedService implementation for CassandraLinkedService. +func (cls CassandraLinkedService) AsGoogleBigQueryLinkedService() (*GoogleBigQueryLinkedService, bool) { + return nil, false +} + +// AsEloquaLinkedService is the BasicLinkedService implementation for CassandraLinkedService. +func (cls CassandraLinkedService) AsEloquaLinkedService() (*EloquaLinkedService, bool) { + return nil, false +} + +// AsDrillLinkedService is the BasicLinkedService implementation for CassandraLinkedService. +func (cls CassandraLinkedService) AsDrillLinkedService() (*DrillLinkedService, bool) { + return nil, false +} + +// AsCouchbaseLinkedService is the BasicLinkedService implementation for CassandraLinkedService. +func (cls CassandraLinkedService) AsCouchbaseLinkedService() (*CouchbaseLinkedService, bool) { + return nil, false +} + +// AsConcurLinkedService is the BasicLinkedService implementation for CassandraLinkedService. +func (cls CassandraLinkedService) AsConcurLinkedService() (*ConcurLinkedService, bool) { + return nil, false +} + +// AsAzurePostgreSQLLinkedService is the BasicLinkedService implementation for CassandraLinkedService. +func (cls CassandraLinkedService) AsAzurePostgreSQLLinkedService() (*AzurePostgreSQLLinkedService, bool) { + return nil, false +} + +// AsAmazonMWSLinkedService is the BasicLinkedService implementation for CassandraLinkedService. +func (cls CassandraLinkedService) AsAmazonMWSLinkedService() (*AmazonMWSLinkedService, bool) { + return nil, false +} + +// AsSapHanaLinkedService is the BasicLinkedService implementation for CassandraLinkedService. +func (cls CassandraLinkedService) AsSapHanaLinkedService() (*SapHanaLinkedService, bool) { + return nil, false +} + +// AsSapBWLinkedService is the BasicLinkedService implementation for CassandraLinkedService. +func (cls CassandraLinkedService) AsSapBWLinkedService() (*SapBWLinkedService, bool) { + return nil, false +} + +// AsSftpServerLinkedService is the BasicLinkedService implementation for CassandraLinkedService. +func (cls CassandraLinkedService) AsSftpServerLinkedService() (*SftpServerLinkedService, bool) { + return nil, false +} + +// AsFtpServerLinkedService is the BasicLinkedService implementation for CassandraLinkedService. +func (cls CassandraLinkedService) AsFtpServerLinkedService() (*FtpServerLinkedService, bool) { + return nil, false +} + +// AsHTTPLinkedService is the BasicLinkedService implementation for CassandraLinkedService. +func (cls CassandraLinkedService) AsHTTPLinkedService() (*HTTPLinkedService, bool) { + return nil, false +} + +// AsAzureSearchLinkedService is the BasicLinkedService implementation for CassandraLinkedService. +func (cls CassandraLinkedService) AsAzureSearchLinkedService() (*AzureSearchLinkedService, bool) { + return nil, false +} + +// AsCustomDataSourceLinkedService is the BasicLinkedService implementation for CassandraLinkedService. +func (cls CassandraLinkedService) AsCustomDataSourceLinkedService() (*CustomDataSourceLinkedService, bool) { + return nil, false +} + +// AsAmazonRedshiftLinkedService is the BasicLinkedService implementation for CassandraLinkedService. +func (cls CassandraLinkedService) AsAmazonRedshiftLinkedService() (*AmazonRedshiftLinkedService, bool) { + return nil, false +} + +// AsAmazonS3LinkedService is the BasicLinkedService implementation for CassandraLinkedService. +func (cls CassandraLinkedService) AsAmazonS3LinkedService() (*AmazonS3LinkedService, bool) { + return nil, false +} + +// AsSapEccLinkedService is the BasicLinkedService implementation for CassandraLinkedService. +func (cls CassandraLinkedService) AsSapEccLinkedService() (*SapEccLinkedService, bool) { + return nil, false +} + +// AsSapCloudForCustomerLinkedService is the BasicLinkedService implementation for CassandraLinkedService. +func (cls CassandraLinkedService) AsSapCloudForCustomerLinkedService() (*SapCloudForCustomerLinkedService, bool) { + return nil, false +} + +// AsSalesforceLinkedService is the BasicLinkedService implementation for CassandraLinkedService. +func (cls CassandraLinkedService) AsSalesforceLinkedService() (*SalesforceLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeStoreLinkedService is the BasicLinkedService implementation for CassandraLinkedService. +func (cls CassandraLinkedService) AsAzureDataLakeStoreLinkedService() (*AzureDataLakeStoreLinkedService, bool) { + return nil, false +} + +// AsMongoDbLinkedService is the BasicLinkedService implementation for CassandraLinkedService. +func (cls CassandraLinkedService) AsMongoDbLinkedService() (*MongoDbLinkedService, bool) { + return nil, false +} + +// AsCassandraLinkedService is the BasicLinkedService implementation for CassandraLinkedService. +func (cls CassandraLinkedService) AsCassandraLinkedService() (*CassandraLinkedService, bool) { + return &cls, true +} + +// AsWebLinkedService is the BasicLinkedService implementation for CassandraLinkedService. +func (cls CassandraLinkedService) AsWebLinkedService() (*WebLinkedService, bool) { + return nil, false +} + +// AsODataLinkedService is the BasicLinkedService implementation for CassandraLinkedService. +func (cls CassandraLinkedService) AsODataLinkedService() (*ODataLinkedService, bool) { + return nil, false +} + +// AsHdfsLinkedService is the BasicLinkedService implementation for CassandraLinkedService. +func (cls CassandraLinkedService) AsHdfsLinkedService() (*HdfsLinkedService, bool) { + return nil, false +} + +// AsOdbcLinkedService is the BasicLinkedService implementation for CassandraLinkedService. +func (cls CassandraLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, bool) { + return nil, false +} + +// AsAzureMLLinkedService is the BasicLinkedService implementation for CassandraLinkedService. +func (cls CassandraLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { + return nil, false +} + +// AsTeradataLinkedService is the BasicLinkedService implementation for CassandraLinkedService. +func (cls CassandraLinkedService) AsTeradataLinkedService() (*TeradataLinkedService, bool) { + return nil, false +} + +// AsDb2LinkedService is the BasicLinkedService implementation for CassandraLinkedService. +func (cls CassandraLinkedService) AsDb2LinkedService() (*Db2LinkedService, bool) { + return nil, false +} + +// AsSybaseLinkedService is the BasicLinkedService implementation for CassandraLinkedService. +func (cls CassandraLinkedService) AsSybaseLinkedService() (*SybaseLinkedService, bool) { + return nil, false +} + +// AsPostgreSQLLinkedService is the BasicLinkedService implementation for CassandraLinkedService. +func (cls CassandraLinkedService) AsPostgreSQLLinkedService() (*PostgreSQLLinkedService, bool) { + return nil, false +} + +// AsMySQLLinkedService is the BasicLinkedService implementation for CassandraLinkedService. +func (cls CassandraLinkedService) AsMySQLLinkedService() (*MySQLLinkedService, bool) { + return nil, false +} + +// AsAzureMySQLLinkedService is the BasicLinkedService implementation for CassandraLinkedService. +func (cls CassandraLinkedService) AsAzureMySQLLinkedService() (*AzureMySQLLinkedService, bool) { + return nil, false +} + +// AsOracleLinkedService is the BasicLinkedService implementation for CassandraLinkedService. +func (cls CassandraLinkedService) AsOracleLinkedService() (*OracleLinkedService, bool) { + return nil, false +} + +// AsFileServerLinkedService is the BasicLinkedService implementation for CassandraLinkedService. +func (cls CassandraLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { + return nil, false +} + +// AsHDInsightLinkedService is the BasicLinkedService implementation for CassandraLinkedService. +func (cls CassandraLinkedService) AsHDInsightLinkedService() (*HDInsightLinkedService, bool) { + return nil, false +} + +// AsDynamicsLinkedService is the BasicLinkedService implementation for CassandraLinkedService. +func (cls CassandraLinkedService) AsDynamicsLinkedService() (*DynamicsLinkedService, bool) { + return nil, false +} + +// AsCosmosDbLinkedService is the BasicLinkedService implementation for CassandraLinkedService. +func (cls CassandraLinkedService) AsCosmosDbLinkedService() (*CosmosDbLinkedService, bool) { + return nil, false +} + +// AsAzureKeyVaultLinkedService is the BasicLinkedService implementation for CassandraLinkedService. +func (cls CassandraLinkedService) AsAzureKeyVaultLinkedService() (*AzureKeyVaultLinkedService, bool) { + return nil, false +} + +// AsAzureBatchLinkedService is the BasicLinkedService implementation for CassandraLinkedService. +func (cls CassandraLinkedService) AsAzureBatchLinkedService() (*AzureBatchLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDatabaseLinkedService is the BasicLinkedService implementation for CassandraLinkedService. +func (cls CassandraLinkedService) AsAzureSQLDatabaseLinkedService() (*AzureSQLDatabaseLinkedService, bool) { + return nil, false +} + +// AsSQLServerLinkedService is the BasicLinkedService implementation for CassandraLinkedService. +func (cls CassandraLinkedService) AsSQLServerLinkedService() (*SQLServerLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDWLinkedService is the BasicLinkedService implementation for CassandraLinkedService. +func (cls CassandraLinkedService) AsAzureSQLDWLinkedService() (*AzureSQLDWLinkedService, bool) { + return nil, false +} + +// AsAzureStorageLinkedService is the BasicLinkedService implementation for CassandraLinkedService. +func (cls CassandraLinkedService) AsAzureStorageLinkedService() (*AzureStorageLinkedService, bool) { + return nil, false +} + +// AsLinkedService is the BasicLinkedService implementation for CassandraLinkedService. +func (cls CassandraLinkedService) AsLinkedService() (*LinkedService, bool) { + return nil, false +} + +// AsBasicLinkedService is the BasicLinkedService implementation for CassandraLinkedService. +func (cls CassandraLinkedService) AsBasicLinkedService() (BasicLinkedService, bool) { + return &cls, true +} + +// UnmarshalJSON is the custom unmarshaler for CassandraLinkedService struct. +func (cls *CassandraLinkedService) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "typeProperties": + if v != nil { + var cassandraLinkedServiceTypeProperties CassandraLinkedServiceTypeProperties + err = json.Unmarshal(*v, &cassandraLinkedServiceTypeProperties) + if err != nil { + return err + } + cls.CassandraLinkedServiceTypeProperties = &cassandraLinkedServiceTypeProperties + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if cls.AdditionalProperties == nil { + cls.AdditionalProperties = make(map[string]interface{}) + } + cls.AdditionalProperties[k] = additionalProperties + } + case "connectVia": + if v != nil { + var connectVia IntegrationRuntimeReference + err = json.Unmarshal(*v, &connectVia) + if err != nil { + return err + } + cls.ConnectVia = &connectVia + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + cls.Description = &description + } + case "parameters": + if v != nil { + var parameters map[string]*ParameterSpecification + err = json.Unmarshal(*v, ¶meters) + if err != nil { + return err + } + cls.Parameters = parameters + } + case "annotations": + if v != nil { + var annotations []interface{} + err = json.Unmarshal(*v, &annotations) + if err != nil { + return err + } + cls.Annotations = &annotations + } + case "type": + if v != nil { + var typeVar TypeBasicLinkedService + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + cls.Type = typeVar + } + } + } + + return nil +} + +// CassandraLinkedServiceTypeProperties cassandra linked service properties. +type CassandraLinkedServiceTypeProperties struct { + // Host - Host name for connection. Type: string (or Expression with resultType string). + Host interface{} `json:"host,omitempty"` + // AuthenticationType - AuthenticationType to be used for connection. Type: string (or Expression with resultType string). + AuthenticationType interface{} `json:"authenticationType,omitempty"` + // Port - The port for the connection. Type: integer (or Expression with resultType integer). + Port interface{} `json:"port,omitempty"` + // Username - Username for authentication. Type: string (or Expression with resultType string). + Username interface{} `json:"username,omitempty"` + // Password - Password for authentication. + Password BasicSecretBase `json:"password,omitempty"` + // EncryptedCredential - The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string). + EncryptedCredential interface{} `json:"encryptedCredential,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for CassandraLinkedServiceTypeProperties struct. +func (clstp *CassandraLinkedServiceTypeProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "host": + if v != nil { + var host interface{} + err = json.Unmarshal(*v, &host) + if err != nil { + return err + } + clstp.Host = host + } + case "authenticationType": + if v != nil { + var authenticationType interface{} + err = json.Unmarshal(*v, &authenticationType) + if err != nil { + return err + } + clstp.AuthenticationType = authenticationType + } + case "port": + if v != nil { + var port interface{} + err = json.Unmarshal(*v, &port) + if err != nil { + return err + } + clstp.Port = port + } + case "username": + if v != nil { + var username interface{} + err = json.Unmarshal(*v, &username) + if err != nil { + return err + } + clstp.Username = username + } + case "password": + if v != nil { + password, err := unmarshalBasicSecretBase(*v) + if err != nil { + return err + } + clstp.Password = password + } + case "encryptedCredential": + if v != nil { + var encryptedCredential interface{} + err = json.Unmarshal(*v, &encryptedCredential) + if err != nil { + return err + } + clstp.EncryptedCredential = encryptedCredential + } + } + } + + return nil +} + +// CassandraSource a copy activity source for a Cassandra database. +type CassandraSource struct { + // Query - Database query. Should be a SQL-92 query expression or Cassandra Query Language (CQL) command. Type: string (or Expression with resultType string). + Query interface{} `json:"query,omitempty"` + // ConsistencyLevel - The consistency level specifies how many Cassandra servers must respond to a read request before returning data to the client application. Cassandra checks the specified number of Cassandra servers for data to satisfy the read request. Must be one of cassandraSourceReadConsistencyLevels. The default value is 'ONE'. It is case-insensitive. Possible values include: 'ALL', 'EACHQUORUM', 'QUORUM', 'LOCALQUORUM', 'ONE', 'TWO', 'THREE', 'LOCALONE', 'SERIAL', 'LOCALSERIAL' + ConsistencyLevel CassandraSourceReadConsistencyLevels `json:"consistencyLevel,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // SourceRetryCount - Source retry count. Type: integer (or Expression with resultType integer). + SourceRetryCount interface{} `json:"sourceRetryCount,omitempty"` + // SourceRetryWait - Source retry wait. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` + // Type - Possible values include: 'TypeCopySource', 'TypeAmazonRedshiftSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeHTTPSource', 'TypeAzureDataLakeStoreSource', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeRelationalSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource' + Type TypeBasicCopySource `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for CassandraSource. +func (cs CassandraSource) MarshalJSON() ([]byte, error) { + cs.Type = TypeCassandraSource + objectMap := make(map[string]interface{}) + objectMap["query"] = cs.Query + if cs.ConsistencyLevel != "" { + objectMap["consistencyLevel"] = cs.ConsistencyLevel + } + objectMap["sourceRetryCount"] = cs.SourceRetryCount + objectMap["sourceRetryWait"] = cs.SourceRetryWait + if cs.Type != "" { + objectMap["type"] = cs.Type + } + for k, v := range cs.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsAmazonRedshiftSource is the BasicCopySource implementation for CassandraSource. +func (cs CassandraSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { + return nil, false +} + +// AsResponsysSource is the BasicCopySource implementation for CassandraSource. +func (cs CassandraSource) AsResponsysSource() (*ResponsysSource, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudSource is the BasicCopySource implementation for CassandraSource. +func (cs CassandraSource) AsSalesforceMarketingCloudSource() (*SalesforceMarketingCloudSource, bool) { + return nil, false +} + +// AsVerticaSource is the BasicCopySource implementation for CassandraSource. +func (cs CassandraSource) AsVerticaSource() (*VerticaSource, bool) { + return nil, false +} + +// AsNetezzaSource is the BasicCopySource implementation for CassandraSource. +func (cs CassandraSource) AsNetezzaSource() (*NetezzaSource, bool) { + return nil, false +} + +// AsZohoSource is the BasicCopySource implementation for CassandraSource. +func (cs CassandraSource) AsZohoSource() (*ZohoSource, bool) { + return nil, false +} + +// AsXeroSource is the BasicCopySource implementation for CassandraSource. +func (cs CassandraSource) AsXeroSource() (*XeroSource, bool) { + return nil, false +} + +// AsSquareSource is the BasicCopySource implementation for CassandraSource. +func (cs CassandraSource) AsSquareSource() (*SquareSource, bool) { + return nil, false +} + +// AsSparkSource is the BasicCopySource implementation for CassandraSource. +func (cs CassandraSource) AsSparkSource() (*SparkSource, bool) { + return nil, false +} + +// AsShopifySource is the BasicCopySource implementation for CassandraSource. +func (cs CassandraSource) AsShopifySource() (*ShopifySource, bool) { + return nil, false +} + +// AsServiceNowSource is the BasicCopySource implementation for CassandraSource. +func (cs CassandraSource) AsServiceNowSource() (*ServiceNowSource, bool) { + return nil, false +} + +// AsQuickBooksSource is the BasicCopySource implementation for CassandraSource. +func (cs CassandraSource) AsQuickBooksSource() (*QuickBooksSource, bool) { + return nil, false +} + +// AsPrestoSource is the BasicCopySource implementation for CassandraSource. +func (cs CassandraSource) AsPrestoSource() (*PrestoSource, bool) { + return nil, false +} + +// AsPhoenixSource is the BasicCopySource implementation for CassandraSource. +func (cs CassandraSource) AsPhoenixSource() (*PhoenixSource, bool) { + return nil, false +} + +// AsPaypalSource is the BasicCopySource implementation for CassandraSource. +func (cs CassandraSource) AsPaypalSource() (*PaypalSource, bool) { + return nil, false +} + +// AsMarketoSource is the BasicCopySource implementation for CassandraSource. +func (cs CassandraSource) AsMarketoSource() (*MarketoSource, bool) { + return nil, false +} + +// AsMariaDBSource is the BasicCopySource implementation for CassandraSource. +func (cs CassandraSource) AsMariaDBSource() (*MariaDBSource, bool) { + return nil, false +} + +// AsMagentoSource is the BasicCopySource implementation for CassandraSource. +func (cs CassandraSource) AsMagentoSource() (*MagentoSource, bool) { + return nil, false +} + +// AsJiraSource is the BasicCopySource implementation for CassandraSource. +func (cs CassandraSource) AsJiraSource() (*JiraSource, bool) { + return nil, false +} + +// AsImpalaSource is the BasicCopySource implementation for CassandraSource. +func (cs CassandraSource) AsImpalaSource() (*ImpalaSource, bool) { + return nil, false +} + +// AsHubspotSource is the BasicCopySource implementation for CassandraSource. +func (cs CassandraSource) AsHubspotSource() (*HubspotSource, bool) { + return nil, false +} + +// AsHiveSource is the BasicCopySource implementation for CassandraSource. +func (cs CassandraSource) AsHiveSource() (*HiveSource, bool) { + return nil, false +} + +// AsHBaseSource is the BasicCopySource implementation for CassandraSource. +func (cs CassandraSource) AsHBaseSource() (*HBaseSource, bool) { + return nil, false +} + +// AsGreenplumSource is the BasicCopySource implementation for CassandraSource. +func (cs CassandraSource) AsGreenplumSource() (*GreenplumSource, bool) { + return nil, false +} + +// AsGoogleBigQuerySource is the BasicCopySource implementation for CassandraSource. +func (cs CassandraSource) AsGoogleBigQuerySource() (*GoogleBigQuerySource, bool) { + return nil, false +} + +// AsEloquaSource is the BasicCopySource implementation for CassandraSource. +func (cs CassandraSource) AsEloquaSource() (*EloquaSource, bool) { + return nil, false +} + +// AsDrillSource is the BasicCopySource implementation for CassandraSource. +func (cs CassandraSource) AsDrillSource() (*DrillSource, bool) { + return nil, false +} + +// AsCouchbaseSource is the BasicCopySource implementation for CassandraSource. +func (cs CassandraSource) AsCouchbaseSource() (*CouchbaseSource, bool) { + return nil, false +} + +// AsConcurSource is the BasicCopySource implementation for CassandraSource. +func (cs CassandraSource) AsConcurSource() (*ConcurSource, bool) { + return nil, false +} + +// AsAzurePostgreSQLSource is the BasicCopySource implementation for CassandraSource. +func (cs CassandraSource) AsAzurePostgreSQLSource() (*AzurePostgreSQLSource, bool) { + return nil, false +} + +// AsAmazonMWSSource is the BasicCopySource implementation for CassandraSource. +func (cs CassandraSource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { + return nil, false +} + +// AsHTTPSource is the BasicCopySource implementation for CassandraSource. +func (cs CassandraSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for CassandraSource. +func (cs CassandraSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for CassandraSource. +func (cs CassandraSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsCassandraSource is the BasicCopySource implementation for CassandraSource. +func (cs CassandraSource) AsCassandraSource() (*CassandraSource, bool) { + return &cs, true +} + +// AsWebSource is the BasicCopySource implementation for CassandraSource. +func (cs CassandraSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for CassandraSource. +func (cs CassandraSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureMySQLSource is the BasicCopySource implementation for CassandraSource. +func (cs CassandraSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for CassandraSource. +func (cs CassandraSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for CassandraSource. +func (cs CassandraSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsSQLDWSource is the BasicCopySource implementation for CassandraSource. +func (cs CassandraSource) AsSQLDWSource() (*SQLDWSource, bool) { + return nil, false +} + +// AsSQLSource is the BasicCopySource implementation for CassandraSource. +func (cs CassandraSource) AsSQLSource() (*SQLSource, bool) { + return nil, false +} + +// AsSapEccSource is the BasicCopySource implementation for CassandraSource. +func (cs CassandraSource) AsSapEccSource() (*SapEccSource, bool) { + return nil, false +} + +// AsSapCloudForCustomerSource is the BasicCopySource implementation for CassandraSource. +func (cs CassandraSource) AsSapCloudForCustomerSource() (*SapCloudForCustomerSource, bool) { + return nil, false +} + +// AsSalesforceSource is the BasicCopySource implementation for CassandraSource. +func (cs CassandraSource) AsSalesforceSource() (*SalesforceSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for CassandraSource. +func (cs CassandraSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for CassandraSource. +func (cs CassandraSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for CassandraSource. +func (cs CassandraSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for CassandraSource. +func (cs CassandraSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + +// AsAzureTableSource is the BasicCopySource implementation for CassandraSource. +func (cs CassandraSource) AsAzureTableSource() (*AzureTableSource, bool) { + return nil, false +} + +// AsCopySource is the BasicCopySource implementation for CassandraSource. +func (cs CassandraSource) AsCopySource() (*CopySource, bool) { + return nil, false +} + +// AsBasicCopySource is the BasicCopySource implementation for CassandraSource. +func (cs CassandraSource) AsBasicCopySource() (BasicCopySource, bool) { + return &cs, true +} + +// CassandraTableDataset the Cassandra database dataset. +type CassandraTableDataset struct { + // CassandraTableDatasetTypeProperties - Cassandra dataset properties. + *CassandraTableDatasetTypeProperties `json:"typeProperties,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Description - Dataset description. + Description *string `json:"description,omitempty"` + // Structure - Columns that define the structure of the dataset. Type: array (or Expression with resultType array), itemType: DatasetDataElement. + Structure interface{} `json:"structure,omitempty"` + // LinkedServiceName - Linked service reference. + LinkedServiceName *LinkedServiceReference `json:"linkedServiceName,omitempty"` + // Parameters - Parameters for dataset. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeDataset', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSQLServerTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSalesforceObject', 'TypeRelationalTable', 'TypeAzureMySQLTable', 'TypeOracleTable', 'TypeODataResource', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeAzureDataLakeStoreFile', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeAmazonS3Object' + Type TypeBasicDataset `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for CassandraTableDataset. +func (ctd CassandraTableDataset) MarshalJSON() ([]byte, error) { + ctd.Type = TypeCassandraTable + objectMap := make(map[string]interface{}) + if ctd.CassandraTableDatasetTypeProperties != nil { + objectMap["typeProperties"] = ctd.CassandraTableDatasetTypeProperties + } + if ctd.Description != nil { + objectMap["description"] = ctd.Description + } + objectMap["structure"] = ctd.Structure + if ctd.LinkedServiceName != nil { + objectMap["linkedServiceName"] = ctd.LinkedServiceName + } + if ctd.Parameters != nil { + objectMap["parameters"] = ctd.Parameters + } + if ctd.Annotations != nil { + objectMap["annotations"] = ctd.Annotations + } + if ctd.Type != "" { + objectMap["type"] = ctd.Type + } + for k, v := range ctd.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysObjectDataset is the BasicDataset implementation for CassandraTableDataset. +func (ctd CassandraTableDataset) AsResponsysObjectDataset() (*ResponsysObjectDataset, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudObjectDataset is the BasicDataset implementation for CassandraTableDataset. +func (ctd CassandraTableDataset) AsSalesforceMarketingCloudObjectDataset() (*SalesforceMarketingCloudObjectDataset, bool) { + return nil, false +} + +// AsVerticaTableDataset is the BasicDataset implementation for CassandraTableDataset. +func (ctd CassandraTableDataset) AsVerticaTableDataset() (*VerticaTableDataset, bool) { + return nil, false +} + +// AsNetezzaTableDataset is the BasicDataset implementation for CassandraTableDataset. +func (ctd CassandraTableDataset) AsNetezzaTableDataset() (*NetezzaTableDataset, bool) { + return nil, false +} + +// AsZohoObjectDataset is the BasicDataset implementation for CassandraTableDataset. +func (ctd CassandraTableDataset) AsZohoObjectDataset() (*ZohoObjectDataset, bool) { + return nil, false +} + +// AsXeroObjectDataset is the BasicDataset implementation for CassandraTableDataset. +func (ctd CassandraTableDataset) AsXeroObjectDataset() (*XeroObjectDataset, bool) { + return nil, false +} + +// AsSquareObjectDataset is the BasicDataset implementation for CassandraTableDataset. +func (ctd CassandraTableDataset) AsSquareObjectDataset() (*SquareObjectDataset, bool) { + return nil, false +} + +// AsSparkObjectDataset is the BasicDataset implementation for CassandraTableDataset. +func (ctd CassandraTableDataset) AsSparkObjectDataset() (*SparkObjectDataset, bool) { + return nil, false +} + +// AsShopifyObjectDataset is the BasicDataset implementation for CassandraTableDataset. +func (ctd CassandraTableDataset) AsShopifyObjectDataset() (*ShopifyObjectDataset, bool) { + return nil, false +} + +// AsServiceNowObjectDataset is the BasicDataset implementation for CassandraTableDataset. +func (ctd CassandraTableDataset) AsServiceNowObjectDataset() (*ServiceNowObjectDataset, bool) { + return nil, false +} + +// AsQuickBooksObjectDataset is the BasicDataset implementation for CassandraTableDataset. +func (ctd CassandraTableDataset) AsQuickBooksObjectDataset() (*QuickBooksObjectDataset, bool) { + return nil, false +} + +// AsPrestoObjectDataset is the BasicDataset implementation for CassandraTableDataset. +func (ctd CassandraTableDataset) AsPrestoObjectDataset() (*PrestoObjectDataset, bool) { + return nil, false +} + +// AsPhoenixObjectDataset is the BasicDataset implementation for CassandraTableDataset. +func (ctd CassandraTableDataset) AsPhoenixObjectDataset() (*PhoenixObjectDataset, bool) { + return nil, false +} + +// AsPaypalObjectDataset is the BasicDataset implementation for CassandraTableDataset. +func (ctd CassandraTableDataset) AsPaypalObjectDataset() (*PaypalObjectDataset, bool) { + return nil, false +} + +// AsMarketoObjectDataset is the BasicDataset implementation for CassandraTableDataset. +func (ctd CassandraTableDataset) AsMarketoObjectDataset() (*MarketoObjectDataset, bool) { + return nil, false +} + +// AsMariaDBTableDataset is the BasicDataset implementation for CassandraTableDataset. +func (ctd CassandraTableDataset) AsMariaDBTableDataset() (*MariaDBTableDataset, bool) { + return nil, false +} + +// AsMagentoObjectDataset is the BasicDataset implementation for CassandraTableDataset. +func (ctd CassandraTableDataset) AsMagentoObjectDataset() (*MagentoObjectDataset, bool) { + return nil, false +} + +// AsJiraObjectDataset is the BasicDataset implementation for CassandraTableDataset. +func (ctd CassandraTableDataset) AsJiraObjectDataset() (*JiraObjectDataset, bool) { + return nil, false +} + +// AsImpalaObjectDataset is the BasicDataset implementation for CassandraTableDataset. +func (ctd CassandraTableDataset) AsImpalaObjectDataset() (*ImpalaObjectDataset, bool) { + return nil, false +} + +// AsHubspotObjectDataset is the BasicDataset implementation for CassandraTableDataset. +func (ctd CassandraTableDataset) AsHubspotObjectDataset() (*HubspotObjectDataset, bool) { + return nil, false +} + +// AsHiveObjectDataset is the BasicDataset implementation for CassandraTableDataset. +func (ctd CassandraTableDataset) AsHiveObjectDataset() (*HiveObjectDataset, bool) { + return nil, false +} + +// AsHBaseObjectDataset is the BasicDataset implementation for CassandraTableDataset. +func (ctd CassandraTableDataset) AsHBaseObjectDataset() (*HBaseObjectDataset, bool) { + return nil, false +} + +// AsGreenplumTableDataset is the BasicDataset implementation for CassandraTableDataset. +func (ctd CassandraTableDataset) AsGreenplumTableDataset() (*GreenplumTableDataset, bool) { + return nil, false +} + +// AsGoogleBigQueryObjectDataset is the BasicDataset implementation for CassandraTableDataset. +func (ctd CassandraTableDataset) AsGoogleBigQueryObjectDataset() (*GoogleBigQueryObjectDataset, bool) { + return nil, false +} + +// AsEloquaObjectDataset is the BasicDataset implementation for CassandraTableDataset. +func (ctd CassandraTableDataset) AsEloquaObjectDataset() (*EloquaObjectDataset, bool) { + return nil, false +} + +// AsDrillTableDataset is the BasicDataset implementation for CassandraTableDataset. +func (ctd CassandraTableDataset) AsDrillTableDataset() (*DrillTableDataset, bool) { + return nil, false +} + +// AsCouchbaseTableDataset is the BasicDataset implementation for CassandraTableDataset. +func (ctd CassandraTableDataset) AsCouchbaseTableDataset() (*CouchbaseTableDataset, bool) { + return nil, false +} + +// AsConcurObjectDataset is the BasicDataset implementation for CassandraTableDataset. +func (ctd CassandraTableDataset) AsConcurObjectDataset() (*ConcurObjectDataset, bool) { + return nil, false +} + +// AsAzurePostgreSQLTableDataset is the BasicDataset implementation for CassandraTableDataset. +func (ctd CassandraTableDataset) AsAzurePostgreSQLTableDataset() (*AzurePostgreSQLTableDataset, bool) { + return nil, false +} + +// AsAmazonMWSObjectDataset is the BasicDataset implementation for CassandraTableDataset. +func (ctd CassandraTableDataset) AsAmazonMWSObjectDataset() (*AmazonMWSObjectDataset, bool) { + return nil, false +} + +// AsHTTPDataset is the BasicDataset implementation for CassandraTableDataset. +func (ctd CassandraTableDataset) AsHTTPDataset() (*HTTPDataset, bool) { + return nil, false +} + +// AsAzureSearchIndexDataset is the BasicDataset implementation for CassandraTableDataset. +func (ctd CassandraTableDataset) AsAzureSearchIndexDataset() (*AzureSearchIndexDataset, bool) { + return nil, false +} + +// AsWebTableDataset is the BasicDataset implementation for CassandraTableDataset. +func (ctd CassandraTableDataset) AsWebTableDataset() (*WebTableDataset, bool) { + return nil, false +} + +// AsSQLServerTableDataset is the BasicDataset implementation for CassandraTableDataset. +func (ctd CassandraTableDataset) AsSQLServerTableDataset() (*SQLServerTableDataset, bool) { + return nil, false +} + +// AsSapEccResourceDataset is the BasicDataset implementation for CassandraTableDataset. +func (ctd CassandraTableDataset) AsSapEccResourceDataset() (*SapEccResourceDataset, bool) { + return nil, false +} + +// AsSapCloudForCustomerResourceDataset is the BasicDataset implementation for CassandraTableDataset. +func (ctd CassandraTableDataset) AsSapCloudForCustomerResourceDataset() (*SapCloudForCustomerResourceDataset, bool) { + return nil, false +} + +// AsSalesforceObjectDataset is the BasicDataset implementation for CassandraTableDataset. +func (ctd CassandraTableDataset) AsSalesforceObjectDataset() (*SalesforceObjectDataset, bool) { + return nil, false +} + +// AsRelationalTableDataset is the BasicDataset implementation for CassandraTableDataset. +func (ctd CassandraTableDataset) AsRelationalTableDataset() (*RelationalTableDataset, bool) { + return nil, false +} + +// AsAzureMySQLTableDataset is the BasicDataset implementation for CassandraTableDataset. +func (ctd CassandraTableDataset) AsAzureMySQLTableDataset() (*AzureMySQLTableDataset, bool) { + return nil, false +} + +// AsOracleTableDataset is the BasicDataset implementation for CassandraTableDataset. +func (ctd CassandraTableDataset) AsOracleTableDataset() (*OracleTableDataset, bool) { + return nil, false +} + +// AsODataResourceDataset is the BasicDataset implementation for CassandraTableDataset. +func (ctd CassandraTableDataset) AsODataResourceDataset() (*ODataResourceDataset, bool) { + return nil, false +} + +// AsMongoDbCollectionDataset is the BasicDataset implementation for CassandraTableDataset. +func (ctd CassandraTableDataset) AsMongoDbCollectionDataset() (*MongoDbCollectionDataset, bool) { + return nil, false +} + +// AsFileShareDataset is the BasicDataset implementation for CassandraTableDataset. +func (ctd CassandraTableDataset) AsFileShareDataset() (*FileShareDataset, bool) { + return nil, false +} + +// AsAzureDataLakeStoreDataset is the BasicDataset implementation for CassandraTableDataset. +func (ctd CassandraTableDataset) AsAzureDataLakeStoreDataset() (*AzureDataLakeStoreDataset, bool) { + return nil, false +} + +// AsDynamicsEntityDataset is the BasicDataset implementation for CassandraTableDataset. +func (ctd CassandraTableDataset) AsDynamicsEntityDataset() (*DynamicsEntityDataset, bool) { + return nil, false +} + +// AsDocumentDbCollectionDataset is the BasicDataset implementation for CassandraTableDataset. +func (ctd CassandraTableDataset) AsDocumentDbCollectionDataset() (*DocumentDbCollectionDataset, bool) { + return nil, false +} + +// AsCustomDataset is the BasicDataset implementation for CassandraTableDataset. +func (ctd CassandraTableDataset) AsCustomDataset() (*CustomDataset, bool) { + return nil, false +} + +// AsCassandraTableDataset is the BasicDataset implementation for CassandraTableDataset. +func (ctd CassandraTableDataset) AsCassandraTableDataset() (*CassandraTableDataset, bool) { + return &ctd, true +} + +// AsAzureSQLDWTableDataset is the BasicDataset implementation for CassandraTableDataset. +func (ctd CassandraTableDataset) AsAzureSQLDWTableDataset() (*AzureSQLDWTableDataset, bool) { + return nil, false +} + +// AsAzureSQLTableDataset is the BasicDataset implementation for CassandraTableDataset. +func (ctd CassandraTableDataset) AsAzureSQLTableDataset() (*AzureSQLTableDataset, bool) { + return nil, false +} + +// AsAzureTableDataset is the BasicDataset implementation for CassandraTableDataset. +func (ctd CassandraTableDataset) AsAzureTableDataset() (*AzureTableDataset, bool) { + return nil, false +} + +// AsAzureBlobDataset is the BasicDataset implementation for CassandraTableDataset. +func (ctd CassandraTableDataset) AsAzureBlobDataset() (*AzureBlobDataset, bool) { + return nil, false +} + +// AsAmazonS3Dataset is the BasicDataset implementation for CassandraTableDataset. +func (ctd CassandraTableDataset) AsAmazonS3Dataset() (*AmazonS3Dataset, bool) { + return nil, false +} + +// AsDataset is the BasicDataset implementation for CassandraTableDataset. +func (ctd CassandraTableDataset) AsDataset() (*Dataset, bool) { + return nil, false +} + +// AsBasicDataset is the BasicDataset implementation for CassandraTableDataset. +func (ctd CassandraTableDataset) AsBasicDataset() (BasicDataset, bool) { + return &ctd, true +} + +// UnmarshalJSON is the custom unmarshaler for CassandraTableDataset struct. +func (ctd *CassandraTableDataset) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "typeProperties": + if v != nil { + var cassandraTableDatasetTypeProperties CassandraTableDatasetTypeProperties + err = json.Unmarshal(*v, &cassandraTableDatasetTypeProperties) + if err != nil { + return err + } + ctd.CassandraTableDatasetTypeProperties = &cassandraTableDatasetTypeProperties + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if ctd.AdditionalProperties == nil { + ctd.AdditionalProperties = make(map[string]interface{}) + } + ctd.AdditionalProperties[k] = additionalProperties + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + ctd.Description = &description + } + case "structure": + if v != nil { + var structure interface{} + err = json.Unmarshal(*v, &structure) + if err != nil { + return err + } + ctd.Structure = structure + } + case "linkedServiceName": + if v != nil { + var linkedServiceName LinkedServiceReference + err = json.Unmarshal(*v, &linkedServiceName) + if err != nil { + return err + } + ctd.LinkedServiceName = &linkedServiceName + } + case "parameters": + if v != nil { + var parameters map[string]*ParameterSpecification + err = json.Unmarshal(*v, ¶meters) + if err != nil { + return err + } + ctd.Parameters = parameters + } + case "annotations": + if v != nil { + var annotations []interface{} + err = json.Unmarshal(*v, &annotations) + if err != nil { + return err + } + ctd.Annotations = &annotations + } + case "type": + if v != nil { + var typeVar TypeBasicDataset + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ctd.Type = typeVar + } + } + } + + return nil +} + +// CassandraTableDatasetTypeProperties cassandra dataset properties. +type CassandraTableDatasetTypeProperties struct { + // TableName - The table name of the Cassandra database. Type: string (or Expression with resultType string). + TableName interface{} `json:"tableName,omitempty"` + // Keyspace - The keyspace of the Cassandra database. Type: string (or Expression with resultType string). + Keyspace interface{} `json:"keyspace,omitempty"` +} + +// CloudError the object that defines the structure of an Azure Data Factory error response. +type CloudError struct { + // CloudErrorBody - Error data + *CloudErrorBody `json:"error,omitempty"` +} + +// MarshalJSON is the custom marshaler for CloudError. +func (ce CloudError) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ce.CloudErrorBody != nil { + objectMap["error"] = ce.CloudErrorBody + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for CloudError struct. +func (ce *CloudError) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "error": + if v != nil { + var cloudErrorBody CloudErrorBody + err = json.Unmarshal(*v, &cloudErrorBody) + if err != nil { + return err + } + ce.CloudErrorBody = &cloudErrorBody + } + } + } + + return nil +} + +// CloudErrorBody the object that defines the structure of an Azure Data Factory error. +type CloudErrorBody struct { + // Code - Error code. + Code *string `json:"code,omitempty"` + // Message - Error message. + Message *string `json:"message,omitempty"` + // Target - Property name/path in request associated with error. + Target *string `json:"target,omitempty"` + // Details - Array with additional error details. + Details *[]CloudError `json:"details,omitempty"` +} + +// ConcurLinkedService concur Serivce linked service. +type ConcurLinkedService struct { + // ConcurLinkedServiceTypeProperties - Concur Serivce linked service properties. + *ConcurLinkedServiceTypeProperties `json:"typeProperties,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // ConnectVia - The integration runtime reference. + ConnectVia *IntegrationRuntimeReference `json:"connectVia,omitempty"` + // Description - Linked service description. + Description *string `json:"description,omitempty"` + // Parameters - Parameters for linked service. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeLinkedService', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforce', 'TypeAzureDataLakeStore', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureStorage' + Type TypeBasicLinkedService `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ConcurLinkedService. +func (cls ConcurLinkedService) MarshalJSON() ([]byte, error) { + cls.Type = TypeConcur + objectMap := make(map[string]interface{}) + if cls.ConcurLinkedServiceTypeProperties != nil { + objectMap["typeProperties"] = cls.ConcurLinkedServiceTypeProperties + } + if cls.ConnectVia != nil { + objectMap["connectVia"] = cls.ConnectVia + } + if cls.Description != nil { + objectMap["description"] = cls.Description + } + if cls.Parameters != nil { + objectMap["parameters"] = cls.Parameters + } + if cls.Annotations != nil { + objectMap["annotations"] = cls.Annotations + } + if cls.Type != "" { + objectMap["type"] = cls.Type + } + for k, v := range cls.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysLinkedService is the BasicLinkedService implementation for ConcurLinkedService. +func (cls ConcurLinkedService) AsResponsysLinkedService() (*ResponsysLinkedService, bool) { + return nil, false +} + +// AsAzureDatabricksLinkedService is the BasicLinkedService implementation for ConcurLinkedService. +func (cls ConcurLinkedService) AsAzureDatabricksLinkedService() (*AzureDatabricksLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeAnalyticsLinkedService is the BasicLinkedService implementation for ConcurLinkedService. +func (cls ConcurLinkedService) AsAzureDataLakeAnalyticsLinkedService() (*AzureDataLakeAnalyticsLinkedService, bool) { + return nil, false +} + +// AsHDInsightOnDemandLinkedService is the BasicLinkedService implementation for ConcurLinkedService. +func (cls ConcurLinkedService) AsHDInsightOnDemandLinkedService() (*HDInsightOnDemandLinkedService, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudLinkedService is the BasicLinkedService implementation for ConcurLinkedService. +func (cls ConcurLinkedService) AsSalesforceMarketingCloudLinkedService() (*SalesforceMarketingCloudLinkedService, bool) { + return nil, false +} + +// AsNetezzaLinkedService is the BasicLinkedService implementation for ConcurLinkedService. +func (cls ConcurLinkedService) AsNetezzaLinkedService() (*NetezzaLinkedService, bool) { + return nil, false +} + +// AsVerticaLinkedService is the BasicLinkedService implementation for ConcurLinkedService. +func (cls ConcurLinkedService) AsVerticaLinkedService() (*VerticaLinkedService, bool) { + return nil, false +} + +// AsZohoLinkedService is the BasicLinkedService implementation for ConcurLinkedService. +func (cls ConcurLinkedService) AsZohoLinkedService() (*ZohoLinkedService, bool) { + return nil, false +} + +// AsXeroLinkedService is the BasicLinkedService implementation for ConcurLinkedService. +func (cls ConcurLinkedService) AsXeroLinkedService() (*XeroLinkedService, bool) { + return nil, false +} + +// AsSquareLinkedService is the BasicLinkedService implementation for ConcurLinkedService. +func (cls ConcurLinkedService) AsSquareLinkedService() (*SquareLinkedService, bool) { + return nil, false +} + +// AsSparkLinkedService is the BasicLinkedService implementation for ConcurLinkedService. +func (cls ConcurLinkedService) AsSparkLinkedService() (*SparkLinkedService, bool) { + return nil, false +} + +// AsShopifyLinkedService is the BasicLinkedService implementation for ConcurLinkedService. +func (cls ConcurLinkedService) AsShopifyLinkedService() (*ShopifyLinkedService, bool) { + return nil, false +} + +// AsServiceNowLinkedService is the BasicLinkedService implementation for ConcurLinkedService. +func (cls ConcurLinkedService) AsServiceNowLinkedService() (*ServiceNowLinkedService, bool) { + return nil, false +} + +// AsQuickBooksLinkedService is the BasicLinkedService implementation for ConcurLinkedService. +func (cls ConcurLinkedService) AsQuickBooksLinkedService() (*QuickBooksLinkedService, bool) { + return nil, false +} + +// AsPrestoLinkedService is the BasicLinkedService implementation for ConcurLinkedService. +func (cls ConcurLinkedService) AsPrestoLinkedService() (*PrestoLinkedService, bool) { + return nil, false +} + +// AsPhoenixLinkedService is the BasicLinkedService implementation for ConcurLinkedService. +func (cls ConcurLinkedService) AsPhoenixLinkedService() (*PhoenixLinkedService, bool) { + return nil, false +} + +// AsPaypalLinkedService is the BasicLinkedService implementation for ConcurLinkedService. +func (cls ConcurLinkedService) AsPaypalLinkedService() (*PaypalLinkedService, bool) { + return nil, false +} + +// AsMarketoLinkedService is the BasicLinkedService implementation for ConcurLinkedService. +func (cls ConcurLinkedService) AsMarketoLinkedService() (*MarketoLinkedService, bool) { + return nil, false +} + +// AsMariaDBLinkedService is the BasicLinkedService implementation for ConcurLinkedService. +func (cls ConcurLinkedService) AsMariaDBLinkedService() (*MariaDBLinkedService, bool) { + return nil, false +} + +// AsMagentoLinkedService is the BasicLinkedService implementation for ConcurLinkedService. +func (cls ConcurLinkedService) AsMagentoLinkedService() (*MagentoLinkedService, bool) { + return nil, false +} + +// AsJiraLinkedService is the BasicLinkedService implementation for ConcurLinkedService. +func (cls ConcurLinkedService) AsJiraLinkedService() (*JiraLinkedService, bool) { + return nil, false +} + +// AsImpalaLinkedService is the BasicLinkedService implementation for ConcurLinkedService. +func (cls ConcurLinkedService) AsImpalaLinkedService() (*ImpalaLinkedService, bool) { + return nil, false +} + +// AsHubspotLinkedService is the BasicLinkedService implementation for ConcurLinkedService. +func (cls ConcurLinkedService) AsHubspotLinkedService() (*HubspotLinkedService, bool) { + return nil, false +} + +// AsHiveLinkedService is the BasicLinkedService implementation for ConcurLinkedService. +func (cls ConcurLinkedService) AsHiveLinkedService() (*HiveLinkedService, bool) { + return nil, false +} + +// AsHBaseLinkedService is the BasicLinkedService implementation for ConcurLinkedService. +func (cls ConcurLinkedService) AsHBaseLinkedService() (*HBaseLinkedService, bool) { + return nil, false +} + +// AsGreenplumLinkedService is the BasicLinkedService implementation for ConcurLinkedService. +func (cls ConcurLinkedService) AsGreenplumLinkedService() (*GreenplumLinkedService, bool) { + return nil, false +} + +// AsGoogleBigQueryLinkedService is the BasicLinkedService implementation for ConcurLinkedService. +func (cls ConcurLinkedService) AsGoogleBigQueryLinkedService() (*GoogleBigQueryLinkedService, bool) { + return nil, false +} + +// AsEloquaLinkedService is the BasicLinkedService implementation for ConcurLinkedService. +func (cls ConcurLinkedService) AsEloquaLinkedService() (*EloquaLinkedService, bool) { + return nil, false +} + +// AsDrillLinkedService is the BasicLinkedService implementation for ConcurLinkedService. +func (cls ConcurLinkedService) AsDrillLinkedService() (*DrillLinkedService, bool) { + return nil, false +} + +// AsCouchbaseLinkedService is the BasicLinkedService implementation for ConcurLinkedService. +func (cls ConcurLinkedService) AsCouchbaseLinkedService() (*CouchbaseLinkedService, bool) { + return nil, false +} + +// AsConcurLinkedService is the BasicLinkedService implementation for ConcurLinkedService. +func (cls ConcurLinkedService) AsConcurLinkedService() (*ConcurLinkedService, bool) { + return &cls, true +} + +// AsAzurePostgreSQLLinkedService is the BasicLinkedService implementation for ConcurLinkedService. +func (cls ConcurLinkedService) AsAzurePostgreSQLLinkedService() (*AzurePostgreSQLLinkedService, bool) { + return nil, false +} + +// AsAmazonMWSLinkedService is the BasicLinkedService implementation for ConcurLinkedService. +func (cls ConcurLinkedService) AsAmazonMWSLinkedService() (*AmazonMWSLinkedService, bool) { + return nil, false +} + +// AsSapHanaLinkedService is the BasicLinkedService implementation for ConcurLinkedService. +func (cls ConcurLinkedService) AsSapHanaLinkedService() (*SapHanaLinkedService, bool) { + return nil, false +} + +// AsSapBWLinkedService is the BasicLinkedService implementation for ConcurLinkedService. +func (cls ConcurLinkedService) AsSapBWLinkedService() (*SapBWLinkedService, bool) { + return nil, false +} + +// AsSftpServerLinkedService is the BasicLinkedService implementation for ConcurLinkedService. +func (cls ConcurLinkedService) AsSftpServerLinkedService() (*SftpServerLinkedService, bool) { + return nil, false +} + +// AsFtpServerLinkedService is the BasicLinkedService implementation for ConcurLinkedService. +func (cls ConcurLinkedService) AsFtpServerLinkedService() (*FtpServerLinkedService, bool) { + return nil, false +} + +// AsHTTPLinkedService is the BasicLinkedService implementation for ConcurLinkedService. +func (cls ConcurLinkedService) AsHTTPLinkedService() (*HTTPLinkedService, bool) { + return nil, false +} + +// AsAzureSearchLinkedService is the BasicLinkedService implementation for ConcurLinkedService. +func (cls ConcurLinkedService) AsAzureSearchLinkedService() (*AzureSearchLinkedService, bool) { + return nil, false +} + +// AsCustomDataSourceLinkedService is the BasicLinkedService implementation for ConcurLinkedService. +func (cls ConcurLinkedService) AsCustomDataSourceLinkedService() (*CustomDataSourceLinkedService, bool) { + return nil, false +} + +// AsAmazonRedshiftLinkedService is the BasicLinkedService implementation for ConcurLinkedService. +func (cls ConcurLinkedService) AsAmazonRedshiftLinkedService() (*AmazonRedshiftLinkedService, bool) { + return nil, false +} + +// AsAmazonS3LinkedService is the BasicLinkedService implementation for ConcurLinkedService. +func (cls ConcurLinkedService) AsAmazonS3LinkedService() (*AmazonS3LinkedService, bool) { + return nil, false +} + +// AsSapEccLinkedService is the BasicLinkedService implementation for ConcurLinkedService. +func (cls ConcurLinkedService) AsSapEccLinkedService() (*SapEccLinkedService, bool) { + return nil, false +} + +// AsSapCloudForCustomerLinkedService is the BasicLinkedService implementation for ConcurLinkedService. +func (cls ConcurLinkedService) AsSapCloudForCustomerLinkedService() (*SapCloudForCustomerLinkedService, bool) { + return nil, false +} + +// AsSalesforceLinkedService is the BasicLinkedService implementation for ConcurLinkedService. +func (cls ConcurLinkedService) AsSalesforceLinkedService() (*SalesforceLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeStoreLinkedService is the BasicLinkedService implementation for ConcurLinkedService. +func (cls ConcurLinkedService) AsAzureDataLakeStoreLinkedService() (*AzureDataLakeStoreLinkedService, bool) { + return nil, false +} + +// AsMongoDbLinkedService is the BasicLinkedService implementation for ConcurLinkedService. +func (cls ConcurLinkedService) AsMongoDbLinkedService() (*MongoDbLinkedService, bool) { + return nil, false +} + +// AsCassandraLinkedService is the BasicLinkedService implementation for ConcurLinkedService. +func (cls ConcurLinkedService) AsCassandraLinkedService() (*CassandraLinkedService, bool) { + return nil, false +} + +// AsWebLinkedService is the BasicLinkedService implementation for ConcurLinkedService. +func (cls ConcurLinkedService) AsWebLinkedService() (*WebLinkedService, bool) { + return nil, false +} + +// AsODataLinkedService is the BasicLinkedService implementation for ConcurLinkedService. +func (cls ConcurLinkedService) AsODataLinkedService() (*ODataLinkedService, bool) { + return nil, false +} + +// AsHdfsLinkedService is the BasicLinkedService implementation for ConcurLinkedService. +func (cls ConcurLinkedService) AsHdfsLinkedService() (*HdfsLinkedService, bool) { + return nil, false +} + +// AsOdbcLinkedService is the BasicLinkedService implementation for ConcurLinkedService. +func (cls ConcurLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, bool) { + return nil, false +} + +// AsAzureMLLinkedService is the BasicLinkedService implementation for ConcurLinkedService. +func (cls ConcurLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { + return nil, false +} + +// AsTeradataLinkedService is the BasicLinkedService implementation for ConcurLinkedService. +func (cls ConcurLinkedService) AsTeradataLinkedService() (*TeradataLinkedService, bool) { + return nil, false +} + +// AsDb2LinkedService is the BasicLinkedService implementation for ConcurLinkedService. +func (cls ConcurLinkedService) AsDb2LinkedService() (*Db2LinkedService, bool) { + return nil, false +} + +// AsSybaseLinkedService is the BasicLinkedService implementation for ConcurLinkedService. +func (cls ConcurLinkedService) AsSybaseLinkedService() (*SybaseLinkedService, bool) { + return nil, false +} + +// AsPostgreSQLLinkedService is the BasicLinkedService implementation for ConcurLinkedService. +func (cls ConcurLinkedService) AsPostgreSQLLinkedService() (*PostgreSQLLinkedService, bool) { + return nil, false +} + +// AsMySQLLinkedService is the BasicLinkedService implementation for ConcurLinkedService. +func (cls ConcurLinkedService) AsMySQLLinkedService() (*MySQLLinkedService, bool) { + return nil, false +} + +// AsAzureMySQLLinkedService is the BasicLinkedService implementation for ConcurLinkedService. +func (cls ConcurLinkedService) AsAzureMySQLLinkedService() (*AzureMySQLLinkedService, bool) { + return nil, false +} + +// AsOracleLinkedService is the BasicLinkedService implementation for ConcurLinkedService. +func (cls ConcurLinkedService) AsOracleLinkedService() (*OracleLinkedService, bool) { + return nil, false +} + +// AsFileServerLinkedService is the BasicLinkedService implementation for ConcurLinkedService. +func (cls ConcurLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { + return nil, false +} + +// AsHDInsightLinkedService is the BasicLinkedService implementation for ConcurLinkedService. +func (cls ConcurLinkedService) AsHDInsightLinkedService() (*HDInsightLinkedService, bool) { + return nil, false +} + +// AsDynamicsLinkedService is the BasicLinkedService implementation for ConcurLinkedService. +func (cls ConcurLinkedService) AsDynamicsLinkedService() (*DynamicsLinkedService, bool) { + return nil, false +} + +// AsCosmosDbLinkedService is the BasicLinkedService implementation for ConcurLinkedService. +func (cls ConcurLinkedService) AsCosmosDbLinkedService() (*CosmosDbLinkedService, bool) { + return nil, false +} + +// AsAzureKeyVaultLinkedService is the BasicLinkedService implementation for ConcurLinkedService. +func (cls ConcurLinkedService) AsAzureKeyVaultLinkedService() (*AzureKeyVaultLinkedService, bool) { + return nil, false +} + +// AsAzureBatchLinkedService is the BasicLinkedService implementation for ConcurLinkedService. +func (cls ConcurLinkedService) AsAzureBatchLinkedService() (*AzureBatchLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDatabaseLinkedService is the BasicLinkedService implementation for ConcurLinkedService. +func (cls ConcurLinkedService) AsAzureSQLDatabaseLinkedService() (*AzureSQLDatabaseLinkedService, bool) { + return nil, false +} + +// AsSQLServerLinkedService is the BasicLinkedService implementation for ConcurLinkedService. +func (cls ConcurLinkedService) AsSQLServerLinkedService() (*SQLServerLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDWLinkedService is the BasicLinkedService implementation for ConcurLinkedService. +func (cls ConcurLinkedService) AsAzureSQLDWLinkedService() (*AzureSQLDWLinkedService, bool) { + return nil, false +} + +// AsAzureStorageLinkedService is the BasicLinkedService implementation for ConcurLinkedService. +func (cls ConcurLinkedService) AsAzureStorageLinkedService() (*AzureStorageLinkedService, bool) { + return nil, false +} + +// AsLinkedService is the BasicLinkedService implementation for ConcurLinkedService. +func (cls ConcurLinkedService) AsLinkedService() (*LinkedService, bool) { + return nil, false +} + +// AsBasicLinkedService is the BasicLinkedService implementation for ConcurLinkedService. +func (cls ConcurLinkedService) AsBasicLinkedService() (BasicLinkedService, bool) { + return &cls, true +} + +// UnmarshalJSON is the custom unmarshaler for ConcurLinkedService struct. +func (cls *ConcurLinkedService) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "typeProperties": + if v != nil { + var concurLinkedServiceTypeProperties ConcurLinkedServiceTypeProperties + err = json.Unmarshal(*v, &concurLinkedServiceTypeProperties) + if err != nil { + return err + } + cls.ConcurLinkedServiceTypeProperties = &concurLinkedServiceTypeProperties + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if cls.AdditionalProperties == nil { + cls.AdditionalProperties = make(map[string]interface{}) + } + cls.AdditionalProperties[k] = additionalProperties + } + case "connectVia": + if v != nil { + var connectVia IntegrationRuntimeReference + err = json.Unmarshal(*v, &connectVia) + if err != nil { + return err + } + cls.ConnectVia = &connectVia + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + cls.Description = &description + } + case "parameters": + if v != nil { + var parameters map[string]*ParameterSpecification + err = json.Unmarshal(*v, ¶meters) + if err != nil { + return err + } + cls.Parameters = parameters + } + case "annotations": + if v != nil { + var annotations []interface{} + err = json.Unmarshal(*v, &annotations) + if err != nil { + return err + } + cls.Annotations = &annotations + } + case "type": + if v != nil { + var typeVar TypeBasicLinkedService + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + cls.Type = typeVar + } + } + } + + return nil +} + +// ConcurLinkedServiceTypeProperties concur Serivce linked service properties. +type ConcurLinkedServiceTypeProperties struct { + // ClientID - Application client_id supplied by Concur App Management. + ClientID interface{} `json:"clientId,omitempty"` + // Username - The user name that you use to access Concur Service. + Username interface{} `json:"username,omitempty"` + // Password - The password corresponding to the user name that you provided in the username field. + Password BasicSecretBase `json:"password,omitempty"` + // UseEncryptedEndpoints - Specifies whether the data source endpoints are encrypted using HTTPS. The default value is true. + UseEncryptedEndpoints interface{} `json:"useEncryptedEndpoints,omitempty"` + // UseHostVerification - Specifies whether to require the host name in the server's certificate to match the host name of the server when connecting over SSL. The default value is true. + UseHostVerification interface{} `json:"useHostVerification,omitempty"` + // UsePeerVerification - Specifies whether to verify the identity of the server when connecting over SSL. The default value is true. + UsePeerVerification interface{} `json:"usePeerVerification,omitempty"` + // EncryptedCredential - The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string). + EncryptedCredential interface{} `json:"encryptedCredential,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for ConcurLinkedServiceTypeProperties struct. +func (clstp *ConcurLinkedServiceTypeProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "clientId": + if v != nil { + var clientID interface{} + err = json.Unmarshal(*v, &clientID) + if err != nil { + return err + } + clstp.ClientID = clientID + } + case "username": + if v != nil { + var username interface{} + err = json.Unmarshal(*v, &username) + if err != nil { + return err + } + clstp.Username = username + } + case "password": + if v != nil { + password, err := unmarshalBasicSecretBase(*v) + if err != nil { + return err + } + clstp.Password = password + } + case "useEncryptedEndpoints": + if v != nil { + var useEncryptedEndpoints interface{} + err = json.Unmarshal(*v, &useEncryptedEndpoints) + if err != nil { + return err + } + clstp.UseEncryptedEndpoints = useEncryptedEndpoints + } + case "useHostVerification": + if v != nil { + var useHostVerification interface{} + err = json.Unmarshal(*v, &useHostVerification) + if err != nil { + return err + } + clstp.UseHostVerification = useHostVerification + } + case "usePeerVerification": + if v != nil { + var usePeerVerification interface{} + err = json.Unmarshal(*v, &usePeerVerification) + if err != nil { + return err + } + clstp.UsePeerVerification = usePeerVerification + } + case "encryptedCredential": + if v != nil { + var encryptedCredential interface{} + err = json.Unmarshal(*v, &encryptedCredential) + if err != nil { + return err + } + clstp.EncryptedCredential = encryptedCredential + } + } + } + + return nil +} + +// ConcurObjectDataset concur Serivce dataset. +type ConcurObjectDataset struct { + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Description - Dataset description. + Description *string `json:"description,omitempty"` + // Structure - Columns that define the structure of the dataset. Type: array (or Expression with resultType array), itemType: DatasetDataElement. + Structure interface{} `json:"structure,omitempty"` + // LinkedServiceName - Linked service reference. + LinkedServiceName *LinkedServiceReference `json:"linkedServiceName,omitempty"` + // Parameters - Parameters for dataset. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeDataset', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSQLServerTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSalesforceObject', 'TypeRelationalTable', 'TypeAzureMySQLTable', 'TypeOracleTable', 'TypeODataResource', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeAzureDataLakeStoreFile', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeAmazonS3Object' + Type TypeBasicDataset `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ConcurObjectDataset. +func (cod ConcurObjectDataset) MarshalJSON() ([]byte, error) { + cod.Type = TypeConcurObject + objectMap := make(map[string]interface{}) + if cod.Description != nil { + objectMap["description"] = cod.Description + } + objectMap["structure"] = cod.Structure + if cod.LinkedServiceName != nil { + objectMap["linkedServiceName"] = cod.LinkedServiceName + } + if cod.Parameters != nil { + objectMap["parameters"] = cod.Parameters + } + if cod.Annotations != nil { + objectMap["annotations"] = cod.Annotations + } + if cod.Type != "" { + objectMap["type"] = cod.Type + } + for k, v := range cod.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysObjectDataset is the BasicDataset implementation for ConcurObjectDataset. +func (cod ConcurObjectDataset) AsResponsysObjectDataset() (*ResponsysObjectDataset, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudObjectDataset is the BasicDataset implementation for ConcurObjectDataset. +func (cod ConcurObjectDataset) AsSalesforceMarketingCloudObjectDataset() (*SalesforceMarketingCloudObjectDataset, bool) { + return nil, false +} + +// AsVerticaTableDataset is the BasicDataset implementation for ConcurObjectDataset. +func (cod ConcurObjectDataset) AsVerticaTableDataset() (*VerticaTableDataset, bool) { + return nil, false +} + +// AsNetezzaTableDataset is the BasicDataset implementation for ConcurObjectDataset. +func (cod ConcurObjectDataset) AsNetezzaTableDataset() (*NetezzaTableDataset, bool) { + return nil, false +} + +// AsZohoObjectDataset is the BasicDataset implementation for ConcurObjectDataset. +func (cod ConcurObjectDataset) AsZohoObjectDataset() (*ZohoObjectDataset, bool) { + return nil, false +} + +// AsXeroObjectDataset is the BasicDataset implementation for ConcurObjectDataset. +func (cod ConcurObjectDataset) AsXeroObjectDataset() (*XeroObjectDataset, bool) { + return nil, false +} + +// AsSquareObjectDataset is the BasicDataset implementation for ConcurObjectDataset. +func (cod ConcurObjectDataset) AsSquareObjectDataset() (*SquareObjectDataset, bool) { + return nil, false +} + +// AsSparkObjectDataset is the BasicDataset implementation for ConcurObjectDataset. +func (cod ConcurObjectDataset) AsSparkObjectDataset() (*SparkObjectDataset, bool) { + return nil, false +} + +// AsShopifyObjectDataset is the BasicDataset implementation for ConcurObjectDataset. +func (cod ConcurObjectDataset) AsShopifyObjectDataset() (*ShopifyObjectDataset, bool) { + return nil, false +} + +// AsServiceNowObjectDataset is the BasicDataset implementation for ConcurObjectDataset. +func (cod ConcurObjectDataset) AsServiceNowObjectDataset() (*ServiceNowObjectDataset, bool) { + return nil, false +} + +// AsQuickBooksObjectDataset is the BasicDataset implementation for ConcurObjectDataset. +func (cod ConcurObjectDataset) AsQuickBooksObjectDataset() (*QuickBooksObjectDataset, bool) { + return nil, false +} + +// AsPrestoObjectDataset is the BasicDataset implementation for ConcurObjectDataset. +func (cod ConcurObjectDataset) AsPrestoObjectDataset() (*PrestoObjectDataset, bool) { + return nil, false +} + +// AsPhoenixObjectDataset is the BasicDataset implementation for ConcurObjectDataset. +func (cod ConcurObjectDataset) AsPhoenixObjectDataset() (*PhoenixObjectDataset, bool) { + return nil, false +} + +// AsPaypalObjectDataset is the BasicDataset implementation for ConcurObjectDataset. +func (cod ConcurObjectDataset) AsPaypalObjectDataset() (*PaypalObjectDataset, bool) { + return nil, false +} + +// AsMarketoObjectDataset is the BasicDataset implementation for ConcurObjectDataset. +func (cod ConcurObjectDataset) AsMarketoObjectDataset() (*MarketoObjectDataset, bool) { + return nil, false +} + +// AsMariaDBTableDataset is the BasicDataset implementation for ConcurObjectDataset. +func (cod ConcurObjectDataset) AsMariaDBTableDataset() (*MariaDBTableDataset, bool) { + return nil, false +} + +// AsMagentoObjectDataset is the BasicDataset implementation for ConcurObjectDataset. +func (cod ConcurObjectDataset) AsMagentoObjectDataset() (*MagentoObjectDataset, bool) { + return nil, false +} + +// AsJiraObjectDataset is the BasicDataset implementation for ConcurObjectDataset. +func (cod ConcurObjectDataset) AsJiraObjectDataset() (*JiraObjectDataset, bool) { + return nil, false +} + +// AsImpalaObjectDataset is the BasicDataset implementation for ConcurObjectDataset. +func (cod ConcurObjectDataset) AsImpalaObjectDataset() (*ImpalaObjectDataset, bool) { + return nil, false +} + +// AsHubspotObjectDataset is the BasicDataset implementation for ConcurObjectDataset. +func (cod ConcurObjectDataset) AsHubspotObjectDataset() (*HubspotObjectDataset, bool) { + return nil, false +} + +// AsHiveObjectDataset is the BasicDataset implementation for ConcurObjectDataset. +func (cod ConcurObjectDataset) AsHiveObjectDataset() (*HiveObjectDataset, bool) { + return nil, false +} + +// AsHBaseObjectDataset is the BasicDataset implementation for ConcurObjectDataset. +func (cod ConcurObjectDataset) AsHBaseObjectDataset() (*HBaseObjectDataset, bool) { + return nil, false +} + +// AsGreenplumTableDataset is the BasicDataset implementation for ConcurObjectDataset. +func (cod ConcurObjectDataset) AsGreenplumTableDataset() (*GreenplumTableDataset, bool) { + return nil, false +} + +// AsGoogleBigQueryObjectDataset is the BasicDataset implementation for ConcurObjectDataset. +func (cod ConcurObjectDataset) AsGoogleBigQueryObjectDataset() (*GoogleBigQueryObjectDataset, bool) { + return nil, false +} + +// AsEloquaObjectDataset is the BasicDataset implementation for ConcurObjectDataset. +func (cod ConcurObjectDataset) AsEloquaObjectDataset() (*EloquaObjectDataset, bool) { + return nil, false +} + +// AsDrillTableDataset is the BasicDataset implementation for ConcurObjectDataset. +func (cod ConcurObjectDataset) AsDrillTableDataset() (*DrillTableDataset, bool) { + return nil, false +} + +// AsCouchbaseTableDataset is the BasicDataset implementation for ConcurObjectDataset. +func (cod ConcurObjectDataset) AsCouchbaseTableDataset() (*CouchbaseTableDataset, bool) { + return nil, false +} + +// AsConcurObjectDataset is the BasicDataset implementation for ConcurObjectDataset. +func (cod ConcurObjectDataset) AsConcurObjectDataset() (*ConcurObjectDataset, bool) { + return &cod, true +} + +// AsAzurePostgreSQLTableDataset is the BasicDataset implementation for ConcurObjectDataset. +func (cod ConcurObjectDataset) AsAzurePostgreSQLTableDataset() (*AzurePostgreSQLTableDataset, bool) { + return nil, false +} + +// AsAmazonMWSObjectDataset is the BasicDataset implementation for ConcurObjectDataset. +func (cod ConcurObjectDataset) AsAmazonMWSObjectDataset() (*AmazonMWSObjectDataset, bool) { + return nil, false +} + +// AsHTTPDataset is the BasicDataset implementation for ConcurObjectDataset. +func (cod ConcurObjectDataset) AsHTTPDataset() (*HTTPDataset, bool) { + return nil, false +} + +// AsAzureSearchIndexDataset is the BasicDataset implementation for ConcurObjectDataset. +func (cod ConcurObjectDataset) AsAzureSearchIndexDataset() (*AzureSearchIndexDataset, bool) { + return nil, false +} + +// AsWebTableDataset is the BasicDataset implementation for ConcurObjectDataset. +func (cod ConcurObjectDataset) AsWebTableDataset() (*WebTableDataset, bool) { + return nil, false +} + +// AsSQLServerTableDataset is the BasicDataset implementation for ConcurObjectDataset. +func (cod ConcurObjectDataset) AsSQLServerTableDataset() (*SQLServerTableDataset, bool) { + return nil, false +} + +// AsSapEccResourceDataset is the BasicDataset implementation for ConcurObjectDataset. +func (cod ConcurObjectDataset) AsSapEccResourceDataset() (*SapEccResourceDataset, bool) { + return nil, false +} + +// AsSapCloudForCustomerResourceDataset is the BasicDataset implementation for ConcurObjectDataset. +func (cod ConcurObjectDataset) AsSapCloudForCustomerResourceDataset() (*SapCloudForCustomerResourceDataset, bool) { + return nil, false +} + +// AsSalesforceObjectDataset is the BasicDataset implementation for ConcurObjectDataset. +func (cod ConcurObjectDataset) AsSalesforceObjectDataset() (*SalesforceObjectDataset, bool) { + return nil, false +} + +// AsRelationalTableDataset is the BasicDataset implementation for ConcurObjectDataset. +func (cod ConcurObjectDataset) AsRelationalTableDataset() (*RelationalTableDataset, bool) { + return nil, false +} + +// AsAzureMySQLTableDataset is the BasicDataset implementation for ConcurObjectDataset. +func (cod ConcurObjectDataset) AsAzureMySQLTableDataset() (*AzureMySQLTableDataset, bool) { + return nil, false +} + +// AsOracleTableDataset is the BasicDataset implementation for ConcurObjectDataset. +func (cod ConcurObjectDataset) AsOracleTableDataset() (*OracleTableDataset, bool) { + return nil, false +} + +// AsODataResourceDataset is the BasicDataset implementation for ConcurObjectDataset. +func (cod ConcurObjectDataset) AsODataResourceDataset() (*ODataResourceDataset, bool) { + return nil, false +} + +// AsMongoDbCollectionDataset is the BasicDataset implementation for ConcurObjectDataset. +func (cod ConcurObjectDataset) AsMongoDbCollectionDataset() (*MongoDbCollectionDataset, bool) { + return nil, false +} + +// AsFileShareDataset is the BasicDataset implementation for ConcurObjectDataset. +func (cod ConcurObjectDataset) AsFileShareDataset() (*FileShareDataset, bool) { + return nil, false +} + +// AsAzureDataLakeStoreDataset is the BasicDataset implementation for ConcurObjectDataset. +func (cod ConcurObjectDataset) AsAzureDataLakeStoreDataset() (*AzureDataLakeStoreDataset, bool) { + return nil, false +} + +// AsDynamicsEntityDataset is the BasicDataset implementation for ConcurObjectDataset. +func (cod ConcurObjectDataset) AsDynamicsEntityDataset() (*DynamicsEntityDataset, bool) { + return nil, false +} + +// AsDocumentDbCollectionDataset is the BasicDataset implementation for ConcurObjectDataset. +func (cod ConcurObjectDataset) AsDocumentDbCollectionDataset() (*DocumentDbCollectionDataset, bool) { + return nil, false +} + +// AsCustomDataset is the BasicDataset implementation for ConcurObjectDataset. +func (cod ConcurObjectDataset) AsCustomDataset() (*CustomDataset, bool) { + return nil, false +} + +// AsCassandraTableDataset is the BasicDataset implementation for ConcurObjectDataset. +func (cod ConcurObjectDataset) AsCassandraTableDataset() (*CassandraTableDataset, bool) { + return nil, false +} + +// AsAzureSQLDWTableDataset is the BasicDataset implementation for ConcurObjectDataset. +func (cod ConcurObjectDataset) AsAzureSQLDWTableDataset() (*AzureSQLDWTableDataset, bool) { + return nil, false +} + +// AsAzureSQLTableDataset is the BasicDataset implementation for ConcurObjectDataset. +func (cod ConcurObjectDataset) AsAzureSQLTableDataset() (*AzureSQLTableDataset, bool) { + return nil, false +} + +// AsAzureTableDataset is the BasicDataset implementation for ConcurObjectDataset. +func (cod ConcurObjectDataset) AsAzureTableDataset() (*AzureTableDataset, bool) { + return nil, false +} + +// AsAzureBlobDataset is the BasicDataset implementation for ConcurObjectDataset. +func (cod ConcurObjectDataset) AsAzureBlobDataset() (*AzureBlobDataset, bool) { + return nil, false +} + +// AsAmazonS3Dataset is the BasicDataset implementation for ConcurObjectDataset. +func (cod ConcurObjectDataset) AsAmazonS3Dataset() (*AmazonS3Dataset, bool) { + return nil, false +} + +// AsDataset is the BasicDataset implementation for ConcurObjectDataset. +func (cod ConcurObjectDataset) AsDataset() (*Dataset, bool) { + return nil, false +} + +// AsBasicDataset is the BasicDataset implementation for ConcurObjectDataset. +func (cod ConcurObjectDataset) AsBasicDataset() (BasicDataset, bool) { + return &cod, true +} + +// ConcurSource a copy activity Concur Serivce source. +type ConcurSource struct { + // Query - A query to retrieve data from source. Type: string (or Expression with resultType string). + Query interface{} `json:"query,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // SourceRetryCount - Source retry count. Type: integer (or Expression with resultType integer). + SourceRetryCount interface{} `json:"sourceRetryCount,omitempty"` + // SourceRetryWait - Source retry wait. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` + // Type - Possible values include: 'TypeCopySource', 'TypeAmazonRedshiftSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeHTTPSource', 'TypeAzureDataLakeStoreSource', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeRelationalSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource' + Type TypeBasicCopySource `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ConcurSource. +func (cs ConcurSource) MarshalJSON() ([]byte, error) { + cs.Type = TypeConcurSource + objectMap := make(map[string]interface{}) + objectMap["query"] = cs.Query + objectMap["sourceRetryCount"] = cs.SourceRetryCount + objectMap["sourceRetryWait"] = cs.SourceRetryWait + if cs.Type != "" { + objectMap["type"] = cs.Type + } + for k, v := range cs.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsAmazonRedshiftSource is the BasicCopySource implementation for ConcurSource. +func (cs ConcurSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { + return nil, false +} + +// AsResponsysSource is the BasicCopySource implementation for ConcurSource. +func (cs ConcurSource) AsResponsysSource() (*ResponsysSource, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudSource is the BasicCopySource implementation for ConcurSource. +func (cs ConcurSource) AsSalesforceMarketingCloudSource() (*SalesforceMarketingCloudSource, bool) { + return nil, false +} + +// AsVerticaSource is the BasicCopySource implementation for ConcurSource. +func (cs ConcurSource) AsVerticaSource() (*VerticaSource, bool) { + return nil, false +} + +// AsNetezzaSource is the BasicCopySource implementation for ConcurSource. +func (cs ConcurSource) AsNetezzaSource() (*NetezzaSource, bool) { + return nil, false +} + +// AsZohoSource is the BasicCopySource implementation for ConcurSource. +func (cs ConcurSource) AsZohoSource() (*ZohoSource, bool) { + return nil, false +} + +// AsXeroSource is the BasicCopySource implementation for ConcurSource. +func (cs ConcurSource) AsXeroSource() (*XeroSource, bool) { + return nil, false +} + +// AsSquareSource is the BasicCopySource implementation for ConcurSource. +func (cs ConcurSource) AsSquareSource() (*SquareSource, bool) { + return nil, false +} + +// AsSparkSource is the BasicCopySource implementation for ConcurSource. +func (cs ConcurSource) AsSparkSource() (*SparkSource, bool) { + return nil, false +} + +// AsShopifySource is the BasicCopySource implementation for ConcurSource. +func (cs ConcurSource) AsShopifySource() (*ShopifySource, bool) { + return nil, false +} + +// AsServiceNowSource is the BasicCopySource implementation for ConcurSource. +func (cs ConcurSource) AsServiceNowSource() (*ServiceNowSource, bool) { + return nil, false +} + +// AsQuickBooksSource is the BasicCopySource implementation for ConcurSource. +func (cs ConcurSource) AsQuickBooksSource() (*QuickBooksSource, bool) { + return nil, false +} + +// AsPrestoSource is the BasicCopySource implementation for ConcurSource. +func (cs ConcurSource) AsPrestoSource() (*PrestoSource, bool) { + return nil, false +} + +// AsPhoenixSource is the BasicCopySource implementation for ConcurSource. +func (cs ConcurSource) AsPhoenixSource() (*PhoenixSource, bool) { + return nil, false +} + +// AsPaypalSource is the BasicCopySource implementation for ConcurSource. +func (cs ConcurSource) AsPaypalSource() (*PaypalSource, bool) { + return nil, false +} + +// AsMarketoSource is the BasicCopySource implementation for ConcurSource. +func (cs ConcurSource) AsMarketoSource() (*MarketoSource, bool) { + return nil, false +} + +// AsMariaDBSource is the BasicCopySource implementation for ConcurSource. +func (cs ConcurSource) AsMariaDBSource() (*MariaDBSource, bool) { + return nil, false +} + +// AsMagentoSource is the BasicCopySource implementation for ConcurSource. +func (cs ConcurSource) AsMagentoSource() (*MagentoSource, bool) { + return nil, false +} + +// AsJiraSource is the BasicCopySource implementation for ConcurSource. +func (cs ConcurSource) AsJiraSource() (*JiraSource, bool) { + return nil, false +} + +// AsImpalaSource is the BasicCopySource implementation for ConcurSource. +func (cs ConcurSource) AsImpalaSource() (*ImpalaSource, bool) { + return nil, false +} + +// AsHubspotSource is the BasicCopySource implementation for ConcurSource. +func (cs ConcurSource) AsHubspotSource() (*HubspotSource, bool) { + return nil, false +} + +// AsHiveSource is the BasicCopySource implementation for ConcurSource. +func (cs ConcurSource) AsHiveSource() (*HiveSource, bool) { + return nil, false +} + +// AsHBaseSource is the BasicCopySource implementation for ConcurSource. +func (cs ConcurSource) AsHBaseSource() (*HBaseSource, bool) { + return nil, false +} + +// AsGreenplumSource is the BasicCopySource implementation for ConcurSource. +func (cs ConcurSource) AsGreenplumSource() (*GreenplumSource, bool) { + return nil, false +} + +// AsGoogleBigQuerySource is the BasicCopySource implementation for ConcurSource. +func (cs ConcurSource) AsGoogleBigQuerySource() (*GoogleBigQuerySource, bool) { + return nil, false +} + +// AsEloquaSource is the BasicCopySource implementation for ConcurSource. +func (cs ConcurSource) AsEloquaSource() (*EloquaSource, bool) { + return nil, false +} + +// AsDrillSource is the BasicCopySource implementation for ConcurSource. +func (cs ConcurSource) AsDrillSource() (*DrillSource, bool) { + return nil, false +} + +// AsCouchbaseSource is the BasicCopySource implementation for ConcurSource. +func (cs ConcurSource) AsCouchbaseSource() (*CouchbaseSource, bool) { + return nil, false +} + +// AsConcurSource is the BasicCopySource implementation for ConcurSource. +func (cs ConcurSource) AsConcurSource() (*ConcurSource, bool) { + return &cs, true +} + +// AsAzurePostgreSQLSource is the BasicCopySource implementation for ConcurSource. +func (cs ConcurSource) AsAzurePostgreSQLSource() (*AzurePostgreSQLSource, bool) { + return nil, false +} + +// AsAmazonMWSSource is the BasicCopySource implementation for ConcurSource. +func (cs ConcurSource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { + return nil, false +} + +// AsHTTPSource is the BasicCopySource implementation for ConcurSource. +func (cs ConcurSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for ConcurSource. +func (cs ConcurSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for ConcurSource. +func (cs ConcurSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsCassandraSource is the BasicCopySource implementation for ConcurSource. +func (cs ConcurSource) AsCassandraSource() (*CassandraSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for ConcurSource. +func (cs ConcurSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for ConcurSource. +func (cs ConcurSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureMySQLSource is the BasicCopySource implementation for ConcurSource. +func (cs ConcurSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for ConcurSource. +func (cs ConcurSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for ConcurSource. +func (cs ConcurSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsSQLDWSource is the BasicCopySource implementation for ConcurSource. +func (cs ConcurSource) AsSQLDWSource() (*SQLDWSource, bool) { + return nil, false +} + +// AsSQLSource is the BasicCopySource implementation for ConcurSource. +func (cs ConcurSource) AsSQLSource() (*SQLSource, bool) { + return nil, false +} + +// AsSapEccSource is the BasicCopySource implementation for ConcurSource. +func (cs ConcurSource) AsSapEccSource() (*SapEccSource, bool) { + return nil, false +} + +// AsSapCloudForCustomerSource is the BasicCopySource implementation for ConcurSource. +func (cs ConcurSource) AsSapCloudForCustomerSource() (*SapCloudForCustomerSource, bool) { + return nil, false +} + +// AsSalesforceSource is the BasicCopySource implementation for ConcurSource. +func (cs ConcurSource) AsSalesforceSource() (*SalesforceSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for ConcurSource. +func (cs ConcurSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for ConcurSource. +func (cs ConcurSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for ConcurSource. +func (cs ConcurSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for ConcurSource. +func (cs ConcurSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + +// AsAzureTableSource is the BasicCopySource implementation for ConcurSource. +func (cs ConcurSource) AsAzureTableSource() (*AzureTableSource, bool) { + return nil, false +} + +// AsCopySource is the BasicCopySource implementation for ConcurSource. +func (cs ConcurSource) AsCopySource() (*CopySource, bool) { + return nil, false +} + +// AsBasicCopySource is the BasicCopySource implementation for ConcurSource. +func (cs ConcurSource) AsBasicCopySource() (BasicCopySource, bool) { + return &cs, true +} + +// BasicControlActivity base class for all control activities like IfCondition, ForEach , Until. +type BasicControlActivity interface { + AsFilterActivity() (*FilterActivity, bool) + AsUntilActivity() (*UntilActivity, bool) + AsWaitActivity() (*WaitActivity, bool) + AsForEachActivity() (*ForEachActivity, bool) + AsIfConditionActivity() (*IfConditionActivity, bool) + AsExecutePipelineActivity() (*ExecutePipelineActivity, bool) + AsControlActivity() (*ControlActivity, bool) +} + +// ControlActivity base class for all control activities like IfCondition, ForEach , Until. +type ControlActivity struct { + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Name - Activity name. + Name *string `json:"name,omitempty"` + // Description - Activity description. + Description *string `json:"description,omitempty"` + // DependsOn - Activity depends on condition. + DependsOn *[]ActivityDependency `json:"dependsOn,omitempty"` + // UserProperties - Activity user properties. + UserProperties map[string]*string `json:"userProperties"` + // Type - Possible values include: 'TypeActivity', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLUpdateResource', 'TypeAzureMLBatchExecution', 'TypeGetMetadata', 'TypeWebActivity', 'TypeLookup', 'TypeSQLServerStoredProcedure', 'TypeCustom', 'TypeExecuteSSISPackage', 'TypeHDInsightSpark', 'TypeHDInsightStreaming', 'TypeHDInsightMapReduce', 'TypeHDInsightPig', 'TypeHDInsightHive', 'TypeCopy', 'TypeExecution', 'TypeFilter', 'TypeUntil', 'TypeWait', 'TypeForEach', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' + Type TypeBasicActivity `json:"type,omitempty"` +} + +func unmarshalBasicControlActivity(body []byte) (BasicControlActivity, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["type"] { + case string(TypeFilter): + var fa FilterActivity + err := json.Unmarshal(body, &fa) + return fa, err + case string(TypeUntil): + var ua UntilActivity + err := json.Unmarshal(body, &ua) + return ua, err + case string(TypeWait): + var wa WaitActivity + err := json.Unmarshal(body, &wa) + return wa, err + case string(TypeForEach): + var fea ForEachActivity + err := json.Unmarshal(body, &fea) + return fea, err + case string(TypeIfCondition): + var ica IfConditionActivity + err := json.Unmarshal(body, &ica) + return ica, err + case string(TypeExecutePipeline): + var epa ExecutePipelineActivity + err := json.Unmarshal(body, &epa) + return epa, err + default: + var ca ControlActivity + err := json.Unmarshal(body, &ca) + return ca, err + } +} +func unmarshalBasicControlActivityArray(body []byte) ([]BasicControlActivity, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + caArray := make([]BasicControlActivity, len(rawMessages)) + + for index, rawMessage := range rawMessages { + ca, err := unmarshalBasicControlActivity(*rawMessage) + if err != nil { + return nil, err + } + caArray[index] = ca + } + return caArray, nil +} + +// MarshalJSON is the custom marshaler for ControlActivity. +func (ca ControlActivity) MarshalJSON() ([]byte, error) { + ca.Type = TypeContainer + objectMap := make(map[string]interface{}) + if ca.Name != nil { + objectMap["name"] = ca.Name + } + if ca.Description != nil { + objectMap["description"] = ca.Description + } + if ca.DependsOn != nil { + objectMap["dependsOn"] = ca.DependsOn + } + if ca.UserProperties != nil { + objectMap["userProperties"] = ca.UserProperties + } + if ca.Type != "" { + objectMap["type"] = ca.Type + } + for k, v := range ca.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsDatabricksNotebookActivity is the BasicActivity implementation for ControlActivity. +func (ca ControlActivity) AsDatabricksNotebookActivity() (*DatabricksNotebookActivity, bool) { + return nil, false +} + +// AsDataLakeAnalyticsUSQLActivity is the BasicActivity implementation for ControlActivity. +func (ca ControlActivity) AsDataLakeAnalyticsUSQLActivity() (*DataLakeAnalyticsUSQLActivity, bool) { + return nil, false +} + +// AsAzureMLUpdateResourceActivity is the BasicActivity implementation for ControlActivity. +func (ca ControlActivity) AsAzureMLUpdateResourceActivity() (*AzureMLUpdateResourceActivity, bool) { + return nil, false +} + +// AsAzureMLBatchExecutionActivity is the BasicActivity implementation for ControlActivity. +func (ca ControlActivity) AsAzureMLBatchExecutionActivity() (*AzureMLBatchExecutionActivity, bool) { + return nil, false +} + +// AsGetMetadataActivity is the BasicActivity implementation for ControlActivity. +func (ca ControlActivity) AsGetMetadataActivity() (*GetMetadataActivity, bool) { + return nil, false +} + +// AsWebActivity is the BasicActivity implementation for ControlActivity. +func (ca ControlActivity) AsWebActivity() (*WebActivity, bool) { + return nil, false +} + +// AsLookupActivity is the BasicActivity implementation for ControlActivity. +func (ca ControlActivity) AsLookupActivity() (*LookupActivity, bool) { + return nil, false +} + +// AsSQLServerStoredProcedureActivity is the BasicActivity implementation for ControlActivity. +func (ca ControlActivity) AsSQLServerStoredProcedureActivity() (*SQLServerStoredProcedureActivity, bool) { + return nil, false +} + +// AsCustomActivity is the BasicActivity implementation for ControlActivity. +func (ca ControlActivity) AsCustomActivity() (*CustomActivity, bool) { + return nil, false +} + +// AsExecuteSSISPackageActivity is the BasicActivity implementation for ControlActivity. +func (ca ControlActivity) AsExecuteSSISPackageActivity() (*ExecuteSSISPackageActivity, bool) { + return nil, false +} + +// AsHDInsightSparkActivity is the BasicActivity implementation for ControlActivity. +func (ca ControlActivity) AsHDInsightSparkActivity() (*HDInsightSparkActivity, bool) { + return nil, false +} + +// AsHDInsightStreamingActivity is the BasicActivity implementation for ControlActivity. +func (ca ControlActivity) AsHDInsightStreamingActivity() (*HDInsightStreamingActivity, bool) { + return nil, false +} + +// AsHDInsightMapReduceActivity is the BasicActivity implementation for ControlActivity. +func (ca ControlActivity) AsHDInsightMapReduceActivity() (*HDInsightMapReduceActivity, bool) { + return nil, false +} + +// AsHDInsightPigActivity is the BasicActivity implementation for ControlActivity. +func (ca ControlActivity) AsHDInsightPigActivity() (*HDInsightPigActivity, bool) { + return nil, false +} + +// AsHDInsightHiveActivity is the BasicActivity implementation for ControlActivity. +func (ca ControlActivity) AsHDInsightHiveActivity() (*HDInsightHiveActivity, bool) { + return nil, false +} + +// AsCopyActivity is the BasicActivity implementation for ControlActivity. +func (ca ControlActivity) AsCopyActivity() (*CopyActivity, bool) { + return nil, false +} + +// AsExecutionActivity is the BasicActivity implementation for ControlActivity. +func (ca ControlActivity) AsExecutionActivity() (*ExecutionActivity, bool) { + return nil, false +} + +// AsBasicExecutionActivity is the BasicActivity implementation for ControlActivity. +func (ca ControlActivity) AsBasicExecutionActivity() (BasicExecutionActivity, bool) { + return nil, false +} + +// AsFilterActivity is the BasicActivity implementation for ControlActivity. +func (ca ControlActivity) AsFilterActivity() (*FilterActivity, bool) { + return nil, false +} + +// AsUntilActivity is the BasicActivity implementation for ControlActivity. +func (ca ControlActivity) AsUntilActivity() (*UntilActivity, bool) { + return nil, false +} + +// AsWaitActivity is the BasicActivity implementation for ControlActivity. +func (ca ControlActivity) AsWaitActivity() (*WaitActivity, bool) { + return nil, false +} + +// AsForEachActivity is the BasicActivity implementation for ControlActivity. +func (ca ControlActivity) AsForEachActivity() (*ForEachActivity, bool) { + return nil, false +} + +// AsIfConditionActivity is the BasicActivity implementation for ControlActivity. +func (ca ControlActivity) AsIfConditionActivity() (*IfConditionActivity, bool) { + return nil, false +} + +// AsExecutePipelineActivity is the BasicActivity implementation for ControlActivity. +func (ca ControlActivity) AsExecutePipelineActivity() (*ExecutePipelineActivity, bool) { + return nil, false +} + +// AsControlActivity is the BasicActivity implementation for ControlActivity. +func (ca ControlActivity) AsControlActivity() (*ControlActivity, bool) { + return &ca, true +} + +// AsBasicControlActivity is the BasicActivity implementation for ControlActivity. +func (ca ControlActivity) AsBasicControlActivity() (BasicControlActivity, bool) { + return &ca, true +} + +// AsActivity is the BasicActivity implementation for ControlActivity. +func (ca ControlActivity) AsActivity() (*Activity, bool) { + return nil, false +} + +// AsBasicActivity is the BasicActivity implementation for ControlActivity. +func (ca ControlActivity) AsBasicActivity() (BasicActivity, bool) { + return &ca, true +} + +// CopyActivity copy activity. +type CopyActivity struct { + // CopyActivityTypeProperties - Copy activity properties. + *CopyActivityTypeProperties `json:"typeProperties,omitempty"` + // Inputs - List of inputs for the activity. + Inputs *[]DatasetReference `json:"inputs,omitempty"` + // Outputs - List of outputs for the activity. + Outputs *[]DatasetReference `json:"outputs,omitempty"` + // LinkedServiceName - Linked service reference. + LinkedServiceName *LinkedServiceReference `json:"linkedServiceName,omitempty"` + // Policy - Activity policy. + Policy *ActivityPolicy `json:"policy,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Name - Activity name. + Name *string `json:"name,omitempty"` + // Description - Activity description. + Description *string `json:"description,omitempty"` + // DependsOn - Activity depends on condition. + DependsOn *[]ActivityDependency `json:"dependsOn,omitempty"` + // UserProperties - Activity user properties. + UserProperties map[string]*string `json:"userProperties"` + // Type - Possible values include: 'TypeActivity', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLUpdateResource', 'TypeAzureMLBatchExecution', 'TypeGetMetadata', 'TypeWebActivity', 'TypeLookup', 'TypeSQLServerStoredProcedure', 'TypeCustom', 'TypeExecuteSSISPackage', 'TypeHDInsightSpark', 'TypeHDInsightStreaming', 'TypeHDInsightMapReduce', 'TypeHDInsightPig', 'TypeHDInsightHive', 'TypeCopy', 'TypeExecution', 'TypeFilter', 'TypeUntil', 'TypeWait', 'TypeForEach', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' + Type TypeBasicActivity `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for CopyActivity. +func (ca CopyActivity) MarshalJSON() ([]byte, error) { + ca.Type = TypeCopy + objectMap := make(map[string]interface{}) + if ca.CopyActivityTypeProperties != nil { + objectMap["typeProperties"] = ca.CopyActivityTypeProperties + } + if ca.Inputs != nil { + objectMap["inputs"] = ca.Inputs + } + if ca.Outputs != nil { + objectMap["outputs"] = ca.Outputs + } + if ca.LinkedServiceName != nil { + objectMap["linkedServiceName"] = ca.LinkedServiceName + } + if ca.Policy != nil { + objectMap["policy"] = ca.Policy + } + if ca.Name != nil { + objectMap["name"] = ca.Name + } + if ca.Description != nil { + objectMap["description"] = ca.Description + } + if ca.DependsOn != nil { + objectMap["dependsOn"] = ca.DependsOn + } + if ca.UserProperties != nil { + objectMap["userProperties"] = ca.UserProperties + } + if ca.Type != "" { + objectMap["type"] = ca.Type + } + for k, v := range ca.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsDatabricksNotebookActivity is the BasicActivity implementation for CopyActivity. +func (ca CopyActivity) AsDatabricksNotebookActivity() (*DatabricksNotebookActivity, bool) { + return nil, false +} + +// AsDataLakeAnalyticsUSQLActivity is the BasicActivity implementation for CopyActivity. +func (ca CopyActivity) AsDataLakeAnalyticsUSQLActivity() (*DataLakeAnalyticsUSQLActivity, bool) { + return nil, false +} + +// AsAzureMLUpdateResourceActivity is the BasicActivity implementation for CopyActivity. +func (ca CopyActivity) AsAzureMLUpdateResourceActivity() (*AzureMLUpdateResourceActivity, bool) { + return nil, false +} + +// AsAzureMLBatchExecutionActivity is the BasicActivity implementation for CopyActivity. +func (ca CopyActivity) AsAzureMLBatchExecutionActivity() (*AzureMLBatchExecutionActivity, bool) { + return nil, false +} + +// AsGetMetadataActivity is the BasicActivity implementation for CopyActivity. +func (ca CopyActivity) AsGetMetadataActivity() (*GetMetadataActivity, bool) { + return nil, false +} + +// AsWebActivity is the BasicActivity implementation for CopyActivity. +func (ca CopyActivity) AsWebActivity() (*WebActivity, bool) { + return nil, false +} + +// AsLookupActivity is the BasicActivity implementation for CopyActivity. +func (ca CopyActivity) AsLookupActivity() (*LookupActivity, bool) { + return nil, false +} + +// AsSQLServerStoredProcedureActivity is the BasicActivity implementation for CopyActivity. +func (ca CopyActivity) AsSQLServerStoredProcedureActivity() (*SQLServerStoredProcedureActivity, bool) { + return nil, false +} + +// AsCustomActivity is the BasicActivity implementation for CopyActivity. +func (ca CopyActivity) AsCustomActivity() (*CustomActivity, bool) { + return nil, false +} + +// AsExecuteSSISPackageActivity is the BasicActivity implementation for CopyActivity. +func (ca CopyActivity) AsExecuteSSISPackageActivity() (*ExecuteSSISPackageActivity, bool) { + return nil, false +} + +// AsHDInsightSparkActivity is the BasicActivity implementation for CopyActivity. +func (ca CopyActivity) AsHDInsightSparkActivity() (*HDInsightSparkActivity, bool) { + return nil, false +} + +// AsHDInsightStreamingActivity is the BasicActivity implementation for CopyActivity. +func (ca CopyActivity) AsHDInsightStreamingActivity() (*HDInsightStreamingActivity, bool) { + return nil, false +} + +// AsHDInsightMapReduceActivity is the BasicActivity implementation for CopyActivity. +func (ca CopyActivity) AsHDInsightMapReduceActivity() (*HDInsightMapReduceActivity, bool) { + return nil, false +} + +// AsHDInsightPigActivity is the BasicActivity implementation for CopyActivity. +func (ca CopyActivity) AsHDInsightPigActivity() (*HDInsightPigActivity, bool) { + return nil, false +} + +// AsHDInsightHiveActivity is the BasicActivity implementation for CopyActivity. +func (ca CopyActivity) AsHDInsightHiveActivity() (*HDInsightHiveActivity, bool) { + return nil, false +} + +// AsCopyActivity is the BasicActivity implementation for CopyActivity. +func (ca CopyActivity) AsCopyActivity() (*CopyActivity, bool) { + return &ca, true +} + +// AsExecutionActivity is the BasicActivity implementation for CopyActivity. +func (ca CopyActivity) AsExecutionActivity() (*ExecutionActivity, bool) { + return nil, false +} + +// AsBasicExecutionActivity is the BasicActivity implementation for CopyActivity. +func (ca CopyActivity) AsBasicExecutionActivity() (BasicExecutionActivity, bool) { + return &ca, true +} + +// AsFilterActivity is the BasicActivity implementation for CopyActivity. +func (ca CopyActivity) AsFilterActivity() (*FilterActivity, bool) { + return nil, false +} + +// AsUntilActivity is the BasicActivity implementation for CopyActivity. +func (ca CopyActivity) AsUntilActivity() (*UntilActivity, bool) { + return nil, false +} + +// AsWaitActivity is the BasicActivity implementation for CopyActivity. +func (ca CopyActivity) AsWaitActivity() (*WaitActivity, bool) { + return nil, false +} + +// AsForEachActivity is the BasicActivity implementation for CopyActivity. +func (ca CopyActivity) AsForEachActivity() (*ForEachActivity, bool) { + return nil, false +} + +// AsIfConditionActivity is the BasicActivity implementation for CopyActivity. +func (ca CopyActivity) AsIfConditionActivity() (*IfConditionActivity, bool) { + return nil, false +} + +// AsExecutePipelineActivity is the BasicActivity implementation for CopyActivity. +func (ca CopyActivity) AsExecutePipelineActivity() (*ExecutePipelineActivity, bool) { + return nil, false +} + +// AsControlActivity is the BasicActivity implementation for CopyActivity. +func (ca CopyActivity) AsControlActivity() (*ControlActivity, bool) { + return nil, false +} + +// AsBasicControlActivity is the BasicActivity implementation for CopyActivity. +func (ca CopyActivity) AsBasicControlActivity() (BasicControlActivity, bool) { + return nil, false +} + +// AsActivity is the BasicActivity implementation for CopyActivity. +func (ca CopyActivity) AsActivity() (*Activity, bool) { + return nil, false +} + +// AsBasicActivity is the BasicActivity implementation for CopyActivity. +func (ca CopyActivity) AsBasicActivity() (BasicActivity, bool) { + return &ca, true +} + +// UnmarshalJSON is the custom unmarshaler for CopyActivity struct. +func (ca *CopyActivity) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "typeProperties": + if v != nil { + var copyActivityTypeProperties CopyActivityTypeProperties + err = json.Unmarshal(*v, ©ActivityTypeProperties) + if err != nil { + return err + } + ca.CopyActivityTypeProperties = ©ActivityTypeProperties + } + case "inputs": + if v != nil { + var inputs []DatasetReference + err = json.Unmarshal(*v, &inputs) + if err != nil { + return err + } + ca.Inputs = &inputs + } + case "outputs": + if v != nil { + var outputs []DatasetReference + err = json.Unmarshal(*v, &outputs) + if err != nil { + return err + } + ca.Outputs = &outputs + } + case "linkedServiceName": + if v != nil { + var linkedServiceName LinkedServiceReference + err = json.Unmarshal(*v, &linkedServiceName) + if err != nil { + return err + } + ca.LinkedServiceName = &linkedServiceName + } + case "policy": + if v != nil { + var policy ActivityPolicy + err = json.Unmarshal(*v, &policy) + if err != nil { + return err + } + ca.Policy = &policy + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if ca.AdditionalProperties == nil { + ca.AdditionalProperties = make(map[string]interface{}) + } + ca.AdditionalProperties[k] = additionalProperties + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ca.Name = &name + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + ca.Description = &description + } + case "dependsOn": + if v != nil { + var dependsOn []ActivityDependency + err = json.Unmarshal(*v, &dependsOn) + if err != nil { + return err + } + ca.DependsOn = &dependsOn + } + case "userProperties": + if v != nil { + var userProperties map[string]*string + err = json.Unmarshal(*v, &userProperties) + if err != nil { + return err + } + ca.UserProperties = userProperties + } + case "type": + if v != nil { + var typeVar TypeBasicActivity + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ca.Type = typeVar + } + } + } + + return nil +} + +// CopyActivityTypeProperties copy activity properties. +type CopyActivityTypeProperties struct { + // Source - Copy activity source. + Source BasicCopySource `json:"source,omitempty"` + // Sink - Copy activity sink. + Sink BasicCopySink `json:"sink,omitempty"` + // Translator - Copy activity translator. If not specificed, tabular translator is used. + Translator BasicCopyTranslator `json:"translator,omitempty"` + // EnableStaging - Specifies whether to copy data via an interim staging. Default value is false. Type: boolean (or Expression with resultType boolean). + EnableStaging interface{} `json:"enableStaging,omitempty"` + // StagingSettings - Specifies interim staging settings when EnableStaging is true. + StagingSettings *StagingSettings `json:"stagingSettings,omitempty"` + // ParallelCopies - Maximum number of concurrent sessions opened on the source or sink to avoid overloading the data store. Type: integer (or Expression with resultType integer), minimum: 0. + ParallelCopies interface{} `json:"parallelCopies,omitempty"` + // DataIntegrationUnits - Maximum number of data integration units that can be used to perform this data movement. Type: integer (or Expression with resultType integer), minimum: 0. + DataIntegrationUnits interface{} `json:"dataIntegrationUnits,omitempty"` + // EnableSkipIncompatibleRow - Whether to skip incompatible row. Default value is false. Type: boolean (or Expression with resultType boolean). + EnableSkipIncompatibleRow interface{} `json:"enableSkipIncompatibleRow,omitempty"` + // RedirectIncompatibleRowSettings - Redirect incompatible row settings when EnableSkipIncompatibleRow is true. + RedirectIncompatibleRowSettings *RedirectIncompatibleRowSettings `json:"redirectIncompatibleRowSettings,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for CopyActivityTypeProperties struct. +func (catp *CopyActivityTypeProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "source": + if v != nil { + source, err := unmarshalBasicCopySource(*v) + if err != nil { + return err + } + catp.Source = source + } + case "sink": + if v != nil { + sink, err := unmarshalBasicCopySink(*v) + if err != nil { + return err + } + catp.Sink = sink + } + case "translator": + if v != nil { + translator, err := unmarshalBasicCopyTranslator(*v) + if err != nil { + return err + } + catp.Translator = translator + } + case "enableStaging": + if v != nil { + var enableStaging interface{} + err = json.Unmarshal(*v, &enableStaging) + if err != nil { + return err + } + catp.EnableStaging = enableStaging + } + case "stagingSettings": + if v != nil { + var stagingSettings StagingSettings + err = json.Unmarshal(*v, &stagingSettings) + if err != nil { + return err + } + catp.StagingSettings = &stagingSettings + } + case "parallelCopies": + if v != nil { + var parallelCopies interface{} + err = json.Unmarshal(*v, ¶llelCopies) + if err != nil { + return err + } + catp.ParallelCopies = parallelCopies + } + case "dataIntegrationUnits": + if v != nil { + var dataIntegrationUnits interface{} + err = json.Unmarshal(*v, &dataIntegrationUnits) + if err != nil { + return err + } + catp.DataIntegrationUnits = dataIntegrationUnits + } + case "enableSkipIncompatibleRow": + if v != nil { + var enableSkipIncompatibleRow interface{} + err = json.Unmarshal(*v, &enableSkipIncompatibleRow) + if err != nil { + return err + } + catp.EnableSkipIncompatibleRow = enableSkipIncompatibleRow + } + case "redirectIncompatibleRowSettings": + if v != nil { + var redirectIncompatibleRowSettings RedirectIncompatibleRowSettings + err = json.Unmarshal(*v, &redirectIncompatibleRowSettings) + if err != nil { + return err + } + catp.RedirectIncompatibleRowSettings = &redirectIncompatibleRowSettings + } + } + } + + return nil +} + +// BasicCopySink a copy activity sink. +type BasicCopySink interface { + AsSalesforceSink() (*SalesforceSink, bool) + AsDynamicsSink() (*DynamicsSink, bool) + AsOdbcSink() (*OdbcSink, bool) + AsAzureSearchIndexSink() (*AzureSearchIndexSink, bool) + AsAzureDataLakeStoreSink() (*AzureDataLakeStoreSink, bool) + AsOracleSink() (*OracleSink, bool) + AsSQLDWSink() (*SQLDWSink, bool) + AsSQLSink() (*SQLSink, bool) + AsDocumentDbCollectionSink() (*DocumentDbCollectionSink, bool) + AsFileSystemSink() (*FileSystemSink, bool) + AsBlobSink() (*BlobSink, bool) + AsAzureTableSink() (*AzureTableSink, bool) + AsAzureQueueSink() (*AzureQueueSink, bool) + AsSapCloudForCustomerSink() (*SapCloudForCustomerSink, bool) + AsCopySink() (*CopySink, bool) +} + +// CopySink a copy activity sink. +type CopySink struct { + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // WriteBatchSize - Write batch size. Type: integer (or Expression with resultType integer), minimum: 0. + WriteBatchSize interface{} `json:"writeBatchSize,omitempty"` + // WriteBatchTimeout - Write batch timeout. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + WriteBatchTimeout interface{} `json:"writeBatchTimeout,omitempty"` + // SinkRetryCount - Sink retry count. Type: integer (or Expression with resultType integer). + SinkRetryCount interface{} `json:"sinkRetryCount,omitempty"` + // SinkRetryWait - Sink retry wait. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + SinkRetryWait interface{} `json:"sinkRetryWait,omitempty"` + // Type - Possible values include: 'TypeCopySink', 'TypeSalesforceSink', 'TypeDynamicsSink', 'TypeOdbcSink', 'TypeAzureSearchIndexSink', 'TypeAzureDataLakeStoreSink', 'TypeOracleSink', 'TypeSQLDWSink', 'TypeSQLSink', 'TypeDocumentDbCollectionSink', 'TypeFileSystemSink', 'TypeBlobSink', 'TypeAzureTableSink', 'TypeAzureQueueSink', 'TypeSapCloudForCustomerSink' + Type TypeBasicCopySink `json:"type,omitempty"` +} + +func unmarshalBasicCopySink(body []byte) (BasicCopySink, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["type"] { + case string(TypeSalesforceSink): + var ss SalesforceSink + err := json.Unmarshal(body, &ss) + return ss, err + case string(TypeDynamicsSink): + var ds DynamicsSink + err := json.Unmarshal(body, &ds) + return ds, err + case string(TypeOdbcSink): + var osVar OdbcSink + err := json.Unmarshal(body, &osVar) + return osVar, err + case string(TypeAzureSearchIndexSink): + var asis AzureSearchIndexSink + err := json.Unmarshal(body, &asis) + return asis, err + case string(TypeAzureDataLakeStoreSink): + var adlss AzureDataLakeStoreSink + err := json.Unmarshal(body, &adlss) + return adlss, err + case string(TypeOracleSink): + var osVar OracleSink + err := json.Unmarshal(body, &osVar) + return osVar, err + case string(TypeSQLDWSink): + var sds SQLDWSink + err := json.Unmarshal(body, &sds) + return sds, err + case string(TypeSQLSink): + var ss SQLSink + err := json.Unmarshal(body, &ss) + return ss, err + case string(TypeDocumentDbCollectionSink): + var ddcs DocumentDbCollectionSink + err := json.Unmarshal(body, &ddcs) + return ddcs, err + case string(TypeFileSystemSink): + var fss FileSystemSink + err := json.Unmarshal(body, &fss) + return fss, err + case string(TypeBlobSink): + var bs BlobSink + err := json.Unmarshal(body, &bs) + return bs, err + case string(TypeAzureTableSink): + var ats AzureTableSink + err := json.Unmarshal(body, &ats) + return ats, err + case string(TypeAzureQueueSink): + var aqs AzureQueueSink + err := json.Unmarshal(body, &aqs) + return aqs, err + case string(TypeSapCloudForCustomerSink): + var scfcs SapCloudForCustomerSink + err := json.Unmarshal(body, &scfcs) + return scfcs, err + default: + var cs CopySink + err := json.Unmarshal(body, &cs) + return cs, err + } +} +func unmarshalBasicCopySinkArray(body []byte) ([]BasicCopySink, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + csArray := make([]BasicCopySink, len(rawMessages)) + + for index, rawMessage := range rawMessages { + cs, err := unmarshalBasicCopySink(*rawMessage) + if err != nil { + return nil, err + } + csArray[index] = cs + } + return csArray, nil +} + +// MarshalJSON is the custom marshaler for CopySink. +func (cs CopySink) MarshalJSON() ([]byte, error) { + cs.Type = TypeCopySink + objectMap := make(map[string]interface{}) + objectMap["writeBatchSize"] = cs.WriteBatchSize + objectMap["writeBatchTimeout"] = cs.WriteBatchTimeout + objectMap["sinkRetryCount"] = cs.SinkRetryCount + objectMap["sinkRetryWait"] = cs.SinkRetryWait + if cs.Type != "" { + objectMap["type"] = cs.Type + } + for k, v := range cs.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsSalesforceSink is the BasicCopySink implementation for CopySink. +func (cs CopySink) AsSalesforceSink() (*SalesforceSink, bool) { + return nil, false +} + +// AsDynamicsSink is the BasicCopySink implementation for CopySink. +func (cs CopySink) AsDynamicsSink() (*DynamicsSink, bool) { + return nil, false +} + +// AsOdbcSink is the BasicCopySink implementation for CopySink. +func (cs CopySink) AsOdbcSink() (*OdbcSink, bool) { + return nil, false +} + +// AsAzureSearchIndexSink is the BasicCopySink implementation for CopySink. +func (cs CopySink) AsAzureSearchIndexSink() (*AzureSearchIndexSink, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSink is the BasicCopySink implementation for CopySink. +func (cs CopySink) AsAzureDataLakeStoreSink() (*AzureDataLakeStoreSink, bool) { + return nil, false +} + +// AsOracleSink is the BasicCopySink implementation for CopySink. +func (cs CopySink) AsOracleSink() (*OracleSink, bool) { + return nil, false +} + +// AsSQLDWSink is the BasicCopySink implementation for CopySink. +func (cs CopySink) AsSQLDWSink() (*SQLDWSink, bool) { + return nil, false +} + +// AsSQLSink is the BasicCopySink implementation for CopySink. +func (cs CopySink) AsSQLSink() (*SQLSink, bool) { + return nil, false +} + +// AsDocumentDbCollectionSink is the BasicCopySink implementation for CopySink. +func (cs CopySink) AsDocumentDbCollectionSink() (*DocumentDbCollectionSink, bool) { + return nil, false +} + +// AsFileSystemSink is the BasicCopySink implementation for CopySink. +func (cs CopySink) AsFileSystemSink() (*FileSystemSink, bool) { + return nil, false +} + +// AsBlobSink is the BasicCopySink implementation for CopySink. +func (cs CopySink) AsBlobSink() (*BlobSink, bool) { + return nil, false +} + +// AsAzureTableSink is the BasicCopySink implementation for CopySink. +func (cs CopySink) AsAzureTableSink() (*AzureTableSink, bool) { + return nil, false +} + +// AsAzureQueueSink is the BasicCopySink implementation for CopySink. +func (cs CopySink) AsAzureQueueSink() (*AzureQueueSink, bool) { + return nil, false +} + +// AsSapCloudForCustomerSink is the BasicCopySink implementation for CopySink. +func (cs CopySink) AsSapCloudForCustomerSink() (*SapCloudForCustomerSink, bool) { + return nil, false +} + +// AsCopySink is the BasicCopySink implementation for CopySink. +func (cs CopySink) AsCopySink() (*CopySink, bool) { + return &cs, true +} + +// AsBasicCopySink is the BasicCopySink implementation for CopySink. +func (cs CopySink) AsBasicCopySink() (BasicCopySink, bool) { + return &cs, true +} + +// BasicCopySource a copy activity source. +type BasicCopySource interface { + AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) + AsResponsysSource() (*ResponsysSource, bool) + AsSalesforceMarketingCloudSource() (*SalesforceMarketingCloudSource, bool) + AsVerticaSource() (*VerticaSource, bool) + AsNetezzaSource() (*NetezzaSource, bool) + AsZohoSource() (*ZohoSource, bool) + AsXeroSource() (*XeroSource, bool) + AsSquareSource() (*SquareSource, bool) + AsSparkSource() (*SparkSource, bool) + AsShopifySource() (*ShopifySource, bool) + AsServiceNowSource() (*ServiceNowSource, bool) + AsQuickBooksSource() (*QuickBooksSource, bool) + AsPrestoSource() (*PrestoSource, bool) + AsPhoenixSource() (*PhoenixSource, bool) + AsPaypalSource() (*PaypalSource, bool) + AsMarketoSource() (*MarketoSource, bool) + AsMariaDBSource() (*MariaDBSource, bool) + AsMagentoSource() (*MagentoSource, bool) + AsJiraSource() (*JiraSource, bool) + AsImpalaSource() (*ImpalaSource, bool) + AsHubspotSource() (*HubspotSource, bool) + AsHiveSource() (*HiveSource, bool) + AsHBaseSource() (*HBaseSource, bool) + AsGreenplumSource() (*GreenplumSource, bool) + AsGoogleBigQuerySource() (*GoogleBigQuerySource, bool) + AsEloquaSource() (*EloquaSource, bool) + AsDrillSource() (*DrillSource, bool) + AsCouchbaseSource() (*CouchbaseSource, bool) + AsConcurSource() (*ConcurSource, bool) + AsAzurePostgreSQLSource() (*AzurePostgreSQLSource, bool) + AsAmazonMWSSource() (*AmazonMWSSource, bool) + AsHTTPSource() (*HTTPSource, bool) + AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) + AsMongoDbSource() (*MongoDbSource, bool) + AsCassandraSource() (*CassandraSource, bool) + AsWebSource() (*WebSource, bool) + AsOracleSource() (*OracleSource, bool) + AsAzureMySQLSource() (*AzureMySQLSource, bool) + AsHdfsSource() (*HdfsSource, bool) + AsFileSystemSource() (*FileSystemSource, bool) + AsSQLDWSource() (*SQLDWSource, bool) + AsSQLSource() (*SQLSource, bool) + AsSapEccSource() (*SapEccSource, bool) + AsSapCloudForCustomerSource() (*SapCloudForCustomerSource, bool) + AsSalesforceSource() (*SalesforceSource, bool) + AsRelationalSource() (*RelationalSource, bool) + AsDynamicsSource() (*DynamicsSource, bool) + AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) + AsBlobSource() (*BlobSource, bool) + AsAzureTableSource() (*AzureTableSource, bool) + AsCopySource() (*CopySource, bool) +} + +// CopySource a copy activity source. +type CopySource struct { + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // SourceRetryCount - Source retry count. Type: integer (or Expression with resultType integer). + SourceRetryCount interface{} `json:"sourceRetryCount,omitempty"` + // SourceRetryWait - Source retry wait. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` + // Type - Possible values include: 'TypeCopySource', 'TypeAmazonRedshiftSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeHTTPSource', 'TypeAzureDataLakeStoreSource', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeRelationalSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource' + Type TypeBasicCopySource `json:"type,omitempty"` +} + +func unmarshalBasicCopySource(body []byte) (BasicCopySource, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["type"] { + case string(TypeAmazonRedshiftSource): + var ars AmazonRedshiftSource + err := json.Unmarshal(body, &ars) + return ars, err + case string(TypeResponsysSource): + var rs ResponsysSource + err := json.Unmarshal(body, &rs) + return rs, err + case string(TypeSalesforceMarketingCloudSource): + var smcs SalesforceMarketingCloudSource + err := json.Unmarshal(body, &smcs) + return smcs, err + case string(TypeVerticaSource): + var vs VerticaSource + err := json.Unmarshal(body, &vs) + return vs, err + case string(TypeNetezzaSource): + var ns NetezzaSource + err := json.Unmarshal(body, &ns) + return ns, err + case string(TypeZohoSource): + var zs ZohoSource + err := json.Unmarshal(body, &zs) + return zs, err + case string(TypeXeroSource): + var xs XeroSource + err := json.Unmarshal(body, &xs) + return xs, err + case string(TypeSquareSource): + var ss SquareSource + err := json.Unmarshal(body, &ss) + return ss, err + case string(TypeSparkSource): + var ss SparkSource + err := json.Unmarshal(body, &ss) + return ss, err + case string(TypeShopifySource): + var ss ShopifySource + err := json.Unmarshal(body, &ss) + return ss, err + case string(TypeServiceNowSource): + var sns ServiceNowSource + err := json.Unmarshal(body, &sns) + return sns, err + case string(TypeQuickBooksSource): + var qbs QuickBooksSource + err := json.Unmarshal(body, &qbs) + return qbs, err + case string(TypePrestoSource): + var ps PrestoSource + err := json.Unmarshal(body, &ps) + return ps, err + case string(TypePhoenixSource): + var ps PhoenixSource + err := json.Unmarshal(body, &ps) + return ps, err + case string(TypePaypalSource): + var ps PaypalSource + err := json.Unmarshal(body, &ps) + return ps, err + case string(TypeMarketoSource): + var ms MarketoSource + err := json.Unmarshal(body, &ms) + return ms, err + case string(TypeMariaDBSource): + var mds MariaDBSource + err := json.Unmarshal(body, &mds) + return mds, err + case string(TypeMagentoSource): + var ms MagentoSource + err := json.Unmarshal(body, &ms) + return ms, err + case string(TypeJiraSource): + var js JiraSource + err := json.Unmarshal(body, &js) + return js, err + case string(TypeImpalaSource): + var is ImpalaSource + err := json.Unmarshal(body, &is) + return is, err + case string(TypeHubspotSource): + var hs HubspotSource + err := json.Unmarshal(body, &hs) + return hs, err + case string(TypeHiveSource): + var hs HiveSource + err := json.Unmarshal(body, &hs) + return hs, err + case string(TypeHBaseSource): + var hbs HBaseSource + err := json.Unmarshal(body, &hbs) + return hbs, err + case string(TypeGreenplumSource): + var gs GreenplumSource + err := json.Unmarshal(body, &gs) + return gs, err + case string(TypeGoogleBigQuerySource): + var gbqs GoogleBigQuerySource + err := json.Unmarshal(body, &gbqs) + return gbqs, err + case string(TypeEloquaSource): + var es EloquaSource + err := json.Unmarshal(body, &es) + return es, err + case string(TypeDrillSource): + var ds DrillSource + err := json.Unmarshal(body, &ds) + return ds, err + case string(TypeCouchbaseSource): + var cs CouchbaseSource + err := json.Unmarshal(body, &cs) + return cs, err + case string(TypeConcurSource): + var cs ConcurSource + err := json.Unmarshal(body, &cs) + return cs, err + case string(TypeAzurePostgreSQLSource): + var apss AzurePostgreSQLSource + err := json.Unmarshal(body, &apss) + return apss, err + case string(TypeAmazonMWSSource): + var ams AmazonMWSSource + err := json.Unmarshal(body, &ams) + return ams, err + case string(TypeHTTPSource): + var hs HTTPSource + err := json.Unmarshal(body, &hs) + return hs, err + case string(TypeAzureDataLakeStoreSource): + var adlss AzureDataLakeStoreSource + err := json.Unmarshal(body, &adlss) + return adlss, err + case string(TypeMongoDbSource): + var mds MongoDbSource + err := json.Unmarshal(body, &mds) + return mds, err + case string(TypeCassandraSource): + var cs CassandraSource + err := json.Unmarshal(body, &cs) + return cs, err + case string(TypeWebSource): + var ws WebSource + err := json.Unmarshal(body, &ws) + return ws, err + case string(TypeOracleSource): + var osVar OracleSource + err := json.Unmarshal(body, &osVar) + return osVar, err + case string(TypeAzureMySQLSource): + var amss AzureMySQLSource + err := json.Unmarshal(body, &amss) + return amss, err + case string(TypeHdfsSource): + var hs HdfsSource + err := json.Unmarshal(body, &hs) + return hs, err + case string(TypeFileSystemSource): + var fss FileSystemSource + err := json.Unmarshal(body, &fss) + return fss, err + case string(TypeSQLDWSource): + var sds SQLDWSource + err := json.Unmarshal(body, &sds) + return sds, err + case string(TypeSQLSource): + var ss SQLSource + err := json.Unmarshal(body, &ss) + return ss, err + case string(TypeSapEccSource): + var ses SapEccSource + err := json.Unmarshal(body, &ses) + return ses, err + case string(TypeSapCloudForCustomerSource): + var scfcs SapCloudForCustomerSource + err := json.Unmarshal(body, &scfcs) + return scfcs, err + case string(TypeSalesforceSource): + var ss SalesforceSource + err := json.Unmarshal(body, &ss) + return ss, err + case string(TypeRelationalSource): + var rs RelationalSource + err := json.Unmarshal(body, &rs) + return rs, err + case string(TypeDynamicsSource): + var ds DynamicsSource + err := json.Unmarshal(body, &ds) + return ds, err + case string(TypeDocumentDbCollectionSource): + var ddcs DocumentDbCollectionSource + err := json.Unmarshal(body, &ddcs) + return ddcs, err + case string(TypeBlobSource): + var bs BlobSource + err := json.Unmarshal(body, &bs) + return bs, err + case string(TypeAzureTableSource): + var ats AzureTableSource + err := json.Unmarshal(body, &ats) + return ats, err + default: + var cs CopySource + err := json.Unmarshal(body, &cs) + return cs, err + } +} +func unmarshalBasicCopySourceArray(body []byte) ([]BasicCopySource, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + csArray := make([]BasicCopySource, len(rawMessages)) + + for index, rawMessage := range rawMessages { + cs, err := unmarshalBasicCopySource(*rawMessage) + if err != nil { + return nil, err + } + csArray[index] = cs + } + return csArray, nil +} + +// MarshalJSON is the custom marshaler for CopySource. +func (cs CopySource) MarshalJSON() ([]byte, error) { + cs.Type = TypeCopySource + objectMap := make(map[string]interface{}) + objectMap["sourceRetryCount"] = cs.SourceRetryCount + objectMap["sourceRetryWait"] = cs.SourceRetryWait + if cs.Type != "" { + objectMap["type"] = cs.Type + } + for k, v := range cs.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsAmazonRedshiftSource is the BasicCopySource implementation for CopySource. +func (cs CopySource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { + return nil, false +} + +// AsResponsysSource is the BasicCopySource implementation for CopySource. +func (cs CopySource) AsResponsysSource() (*ResponsysSource, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudSource is the BasicCopySource implementation for CopySource. +func (cs CopySource) AsSalesforceMarketingCloudSource() (*SalesforceMarketingCloudSource, bool) { + return nil, false +} + +// AsVerticaSource is the BasicCopySource implementation for CopySource. +func (cs CopySource) AsVerticaSource() (*VerticaSource, bool) { + return nil, false +} + +// AsNetezzaSource is the BasicCopySource implementation for CopySource. +func (cs CopySource) AsNetezzaSource() (*NetezzaSource, bool) { + return nil, false +} + +// AsZohoSource is the BasicCopySource implementation for CopySource. +func (cs CopySource) AsZohoSource() (*ZohoSource, bool) { + return nil, false +} + +// AsXeroSource is the BasicCopySource implementation for CopySource. +func (cs CopySource) AsXeroSource() (*XeroSource, bool) { + return nil, false +} + +// AsSquareSource is the BasicCopySource implementation for CopySource. +func (cs CopySource) AsSquareSource() (*SquareSource, bool) { + return nil, false +} + +// AsSparkSource is the BasicCopySource implementation for CopySource. +func (cs CopySource) AsSparkSource() (*SparkSource, bool) { + return nil, false +} + +// AsShopifySource is the BasicCopySource implementation for CopySource. +func (cs CopySource) AsShopifySource() (*ShopifySource, bool) { + return nil, false +} + +// AsServiceNowSource is the BasicCopySource implementation for CopySource. +func (cs CopySource) AsServiceNowSource() (*ServiceNowSource, bool) { + return nil, false +} + +// AsQuickBooksSource is the BasicCopySource implementation for CopySource. +func (cs CopySource) AsQuickBooksSource() (*QuickBooksSource, bool) { + return nil, false +} + +// AsPrestoSource is the BasicCopySource implementation for CopySource. +func (cs CopySource) AsPrestoSource() (*PrestoSource, bool) { + return nil, false +} + +// AsPhoenixSource is the BasicCopySource implementation for CopySource. +func (cs CopySource) AsPhoenixSource() (*PhoenixSource, bool) { + return nil, false +} + +// AsPaypalSource is the BasicCopySource implementation for CopySource. +func (cs CopySource) AsPaypalSource() (*PaypalSource, bool) { + return nil, false +} + +// AsMarketoSource is the BasicCopySource implementation for CopySource. +func (cs CopySource) AsMarketoSource() (*MarketoSource, bool) { + return nil, false +} + +// AsMariaDBSource is the BasicCopySource implementation for CopySource. +func (cs CopySource) AsMariaDBSource() (*MariaDBSource, bool) { + return nil, false +} + +// AsMagentoSource is the BasicCopySource implementation for CopySource. +func (cs CopySource) AsMagentoSource() (*MagentoSource, bool) { + return nil, false +} + +// AsJiraSource is the BasicCopySource implementation for CopySource. +func (cs CopySource) AsJiraSource() (*JiraSource, bool) { + return nil, false +} + +// AsImpalaSource is the BasicCopySource implementation for CopySource. +func (cs CopySource) AsImpalaSource() (*ImpalaSource, bool) { + return nil, false +} + +// AsHubspotSource is the BasicCopySource implementation for CopySource. +func (cs CopySource) AsHubspotSource() (*HubspotSource, bool) { + return nil, false +} + +// AsHiveSource is the BasicCopySource implementation for CopySource. +func (cs CopySource) AsHiveSource() (*HiveSource, bool) { + return nil, false +} + +// AsHBaseSource is the BasicCopySource implementation for CopySource. +func (cs CopySource) AsHBaseSource() (*HBaseSource, bool) { + return nil, false +} + +// AsGreenplumSource is the BasicCopySource implementation for CopySource. +func (cs CopySource) AsGreenplumSource() (*GreenplumSource, bool) { + return nil, false +} + +// AsGoogleBigQuerySource is the BasicCopySource implementation for CopySource. +func (cs CopySource) AsGoogleBigQuerySource() (*GoogleBigQuerySource, bool) { + return nil, false +} + +// AsEloquaSource is the BasicCopySource implementation for CopySource. +func (cs CopySource) AsEloquaSource() (*EloquaSource, bool) { + return nil, false +} + +// AsDrillSource is the BasicCopySource implementation for CopySource. +func (cs CopySource) AsDrillSource() (*DrillSource, bool) { + return nil, false +} + +// AsCouchbaseSource is the BasicCopySource implementation for CopySource. +func (cs CopySource) AsCouchbaseSource() (*CouchbaseSource, bool) { + return nil, false +} + +// AsConcurSource is the BasicCopySource implementation for CopySource. +func (cs CopySource) AsConcurSource() (*ConcurSource, bool) { + return nil, false +} + +// AsAzurePostgreSQLSource is the BasicCopySource implementation for CopySource. +func (cs CopySource) AsAzurePostgreSQLSource() (*AzurePostgreSQLSource, bool) { + return nil, false +} + +// AsAmazonMWSSource is the BasicCopySource implementation for CopySource. +func (cs CopySource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { + return nil, false +} + +// AsHTTPSource is the BasicCopySource implementation for CopySource. +func (cs CopySource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for CopySource. +func (cs CopySource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for CopySource. +func (cs CopySource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsCassandraSource is the BasicCopySource implementation for CopySource. +func (cs CopySource) AsCassandraSource() (*CassandraSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for CopySource. +func (cs CopySource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for CopySource. +func (cs CopySource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureMySQLSource is the BasicCopySource implementation for CopySource. +func (cs CopySource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for CopySource. +func (cs CopySource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for CopySource. +func (cs CopySource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsSQLDWSource is the BasicCopySource implementation for CopySource. +func (cs CopySource) AsSQLDWSource() (*SQLDWSource, bool) { + return nil, false +} + +// AsSQLSource is the BasicCopySource implementation for CopySource. +func (cs CopySource) AsSQLSource() (*SQLSource, bool) { + return nil, false +} + +// AsSapEccSource is the BasicCopySource implementation for CopySource. +func (cs CopySource) AsSapEccSource() (*SapEccSource, bool) { + return nil, false +} + +// AsSapCloudForCustomerSource is the BasicCopySource implementation for CopySource. +func (cs CopySource) AsSapCloudForCustomerSource() (*SapCloudForCustomerSource, bool) { + return nil, false +} + +// AsSalesforceSource is the BasicCopySource implementation for CopySource. +func (cs CopySource) AsSalesforceSource() (*SalesforceSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for CopySource. +func (cs CopySource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for CopySource. +func (cs CopySource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for CopySource. +func (cs CopySource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for CopySource. +func (cs CopySource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + +// AsAzureTableSource is the BasicCopySource implementation for CopySource. +func (cs CopySource) AsAzureTableSource() (*AzureTableSource, bool) { + return nil, false +} + +// AsCopySource is the BasicCopySource implementation for CopySource. +func (cs CopySource) AsCopySource() (*CopySource, bool) { + return &cs, true +} + +// AsBasicCopySource is the BasicCopySource implementation for CopySource. +func (cs CopySource) AsBasicCopySource() (BasicCopySource, bool) { + return &cs, true +} + +// BasicCopyTranslator a copy activity translator. +type BasicCopyTranslator interface { + AsTabularTranslator() (*TabularTranslator, bool) + AsCopyTranslator() (*CopyTranslator, bool) +} + +// CopyTranslator a copy activity translator. +type CopyTranslator struct { + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Type - Possible values include: 'TypeCopyTranslator', 'TypeTabularTranslator' + Type TypeBasicCopyTranslator `json:"type,omitempty"` +} + +func unmarshalBasicCopyTranslator(body []byte) (BasicCopyTranslator, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["type"] { + case string(TypeTabularTranslator): + var tt TabularTranslator + err := json.Unmarshal(body, &tt) + return tt, err + default: + var ct CopyTranslator + err := json.Unmarshal(body, &ct) + return ct, err + } +} +func unmarshalBasicCopyTranslatorArray(body []byte) ([]BasicCopyTranslator, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + ctArray := make([]BasicCopyTranslator, len(rawMessages)) + + for index, rawMessage := range rawMessages { + ct, err := unmarshalBasicCopyTranslator(*rawMessage) + if err != nil { + return nil, err + } + ctArray[index] = ct + } + return ctArray, nil +} + +// MarshalJSON is the custom marshaler for CopyTranslator. +func (ct CopyTranslator) MarshalJSON() ([]byte, error) { + ct.Type = TypeCopyTranslator + objectMap := make(map[string]interface{}) + if ct.Type != "" { + objectMap["type"] = ct.Type + } + for k, v := range ct.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsTabularTranslator is the BasicCopyTranslator implementation for CopyTranslator. +func (ct CopyTranslator) AsTabularTranslator() (*TabularTranslator, bool) { + return nil, false +} + +// AsCopyTranslator is the BasicCopyTranslator implementation for CopyTranslator. +func (ct CopyTranslator) AsCopyTranslator() (*CopyTranslator, bool) { + return &ct, true +} + +// AsBasicCopyTranslator is the BasicCopyTranslator implementation for CopyTranslator. +func (ct CopyTranslator) AsBasicCopyTranslator() (BasicCopyTranslator, bool) { + return &ct, true +} + +// CosmosDbLinkedService microsoft Azure Cosmos Database (CosmosDB) linked service. +type CosmosDbLinkedService struct { + // CosmosDbLinkedServiceTypeProperties - CosmosDB linked service properties. + *CosmosDbLinkedServiceTypeProperties `json:"typeProperties,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // ConnectVia - The integration runtime reference. + ConnectVia *IntegrationRuntimeReference `json:"connectVia,omitempty"` + // Description - Linked service description. + Description *string `json:"description,omitempty"` + // Parameters - Parameters for linked service. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeLinkedService', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforce', 'TypeAzureDataLakeStore', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureStorage' + Type TypeBasicLinkedService `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for CosmosDbLinkedService. +func (cdls CosmosDbLinkedService) MarshalJSON() ([]byte, error) { + cdls.Type = TypeCosmosDb + objectMap := make(map[string]interface{}) + if cdls.CosmosDbLinkedServiceTypeProperties != nil { + objectMap["typeProperties"] = cdls.CosmosDbLinkedServiceTypeProperties + } + if cdls.ConnectVia != nil { + objectMap["connectVia"] = cdls.ConnectVia + } + if cdls.Description != nil { + objectMap["description"] = cdls.Description + } + if cdls.Parameters != nil { + objectMap["parameters"] = cdls.Parameters + } + if cdls.Annotations != nil { + objectMap["annotations"] = cdls.Annotations + } + if cdls.Type != "" { + objectMap["type"] = cdls.Type + } + for k, v := range cdls.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysLinkedService is the BasicLinkedService implementation for CosmosDbLinkedService. +func (cdls CosmosDbLinkedService) AsResponsysLinkedService() (*ResponsysLinkedService, bool) { + return nil, false +} + +// AsAzureDatabricksLinkedService is the BasicLinkedService implementation for CosmosDbLinkedService. +func (cdls CosmosDbLinkedService) AsAzureDatabricksLinkedService() (*AzureDatabricksLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeAnalyticsLinkedService is the BasicLinkedService implementation for CosmosDbLinkedService. +func (cdls CosmosDbLinkedService) AsAzureDataLakeAnalyticsLinkedService() (*AzureDataLakeAnalyticsLinkedService, bool) { + return nil, false +} + +// AsHDInsightOnDemandLinkedService is the BasicLinkedService implementation for CosmosDbLinkedService. +func (cdls CosmosDbLinkedService) AsHDInsightOnDemandLinkedService() (*HDInsightOnDemandLinkedService, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudLinkedService is the BasicLinkedService implementation for CosmosDbLinkedService. +func (cdls CosmosDbLinkedService) AsSalesforceMarketingCloudLinkedService() (*SalesforceMarketingCloudLinkedService, bool) { + return nil, false +} + +// AsNetezzaLinkedService is the BasicLinkedService implementation for CosmosDbLinkedService. +func (cdls CosmosDbLinkedService) AsNetezzaLinkedService() (*NetezzaLinkedService, bool) { + return nil, false +} + +// AsVerticaLinkedService is the BasicLinkedService implementation for CosmosDbLinkedService. +func (cdls CosmosDbLinkedService) AsVerticaLinkedService() (*VerticaLinkedService, bool) { + return nil, false +} + +// AsZohoLinkedService is the BasicLinkedService implementation for CosmosDbLinkedService. +func (cdls CosmosDbLinkedService) AsZohoLinkedService() (*ZohoLinkedService, bool) { + return nil, false +} + +// AsXeroLinkedService is the BasicLinkedService implementation for CosmosDbLinkedService. +func (cdls CosmosDbLinkedService) AsXeroLinkedService() (*XeroLinkedService, bool) { + return nil, false +} + +// AsSquareLinkedService is the BasicLinkedService implementation for CosmosDbLinkedService. +func (cdls CosmosDbLinkedService) AsSquareLinkedService() (*SquareLinkedService, bool) { + return nil, false +} + +// AsSparkLinkedService is the BasicLinkedService implementation for CosmosDbLinkedService. +func (cdls CosmosDbLinkedService) AsSparkLinkedService() (*SparkLinkedService, bool) { + return nil, false +} + +// AsShopifyLinkedService is the BasicLinkedService implementation for CosmosDbLinkedService. +func (cdls CosmosDbLinkedService) AsShopifyLinkedService() (*ShopifyLinkedService, bool) { + return nil, false +} + +// AsServiceNowLinkedService is the BasicLinkedService implementation for CosmosDbLinkedService. +func (cdls CosmosDbLinkedService) AsServiceNowLinkedService() (*ServiceNowLinkedService, bool) { + return nil, false +} + +// AsQuickBooksLinkedService is the BasicLinkedService implementation for CosmosDbLinkedService. +func (cdls CosmosDbLinkedService) AsQuickBooksLinkedService() (*QuickBooksLinkedService, bool) { + return nil, false +} + +// AsPrestoLinkedService is the BasicLinkedService implementation for CosmosDbLinkedService. +func (cdls CosmosDbLinkedService) AsPrestoLinkedService() (*PrestoLinkedService, bool) { + return nil, false +} + +// AsPhoenixLinkedService is the BasicLinkedService implementation for CosmosDbLinkedService. +func (cdls CosmosDbLinkedService) AsPhoenixLinkedService() (*PhoenixLinkedService, bool) { + return nil, false +} + +// AsPaypalLinkedService is the BasicLinkedService implementation for CosmosDbLinkedService. +func (cdls CosmosDbLinkedService) AsPaypalLinkedService() (*PaypalLinkedService, bool) { + return nil, false +} + +// AsMarketoLinkedService is the BasicLinkedService implementation for CosmosDbLinkedService. +func (cdls CosmosDbLinkedService) AsMarketoLinkedService() (*MarketoLinkedService, bool) { + return nil, false +} + +// AsMariaDBLinkedService is the BasicLinkedService implementation for CosmosDbLinkedService. +func (cdls CosmosDbLinkedService) AsMariaDBLinkedService() (*MariaDBLinkedService, bool) { + return nil, false +} + +// AsMagentoLinkedService is the BasicLinkedService implementation for CosmosDbLinkedService. +func (cdls CosmosDbLinkedService) AsMagentoLinkedService() (*MagentoLinkedService, bool) { + return nil, false +} + +// AsJiraLinkedService is the BasicLinkedService implementation for CosmosDbLinkedService. +func (cdls CosmosDbLinkedService) AsJiraLinkedService() (*JiraLinkedService, bool) { + return nil, false +} + +// AsImpalaLinkedService is the BasicLinkedService implementation for CosmosDbLinkedService. +func (cdls CosmosDbLinkedService) AsImpalaLinkedService() (*ImpalaLinkedService, bool) { + return nil, false +} + +// AsHubspotLinkedService is the BasicLinkedService implementation for CosmosDbLinkedService. +func (cdls CosmosDbLinkedService) AsHubspotLinkedService() (*HubspotLinkedService, bool) { + return nil, false +} + +// AsHiveLinkedService is the BasicLinkedService implementation for CosmosDbLinkedService. +func (cdls CosmosDbLinkedService) AsHiveLinkedService() (*HiveLinkedService, bool) { + return nil, false +} + +// AsHBaseLinkedService is the BasicLinkedService implementation for CosmosDbLinkedService. +func (cdls CosmosDbLinkedService) AsHBaseLinkedService() (*HBaseLinkedService, bool) { + return nil, false +} + +// AsGreenplumLinkedService is the BasicLinkedService implementation for CosmosDbLinkedService. +func (cdls CosmosDbLinkedService) AsGreenplumLinkedService() (*GreenplumLinkedService, bool) { + return nil, false +} + +// AsGoogleBigQueryLinkedService is the BasicLinkedService implementation for CosmosDbLinkedService. +func (cdls CosmosDbLinkedService) AsGoogleBigQueryLinkedService() (*GoogleBigQueryLinkedService, bool) { + return nil, false +} + +// AsEloquaLinkedService is the BasicLinkedService implementation for CosmosDbLinkedService. +func (cdls CosmosDbLinkedService) AsEloquaLinkedService() (*EloquaLinkedService, bool) { + return nil, false +} + +// AsDrillLinkedService is the BasicLinkedService implementation for CosmosDbLinkedService. +func (cdls CosmosDbLinkedService) AsDrillLinkedService() (*DrillLinkedService, bool) { + return nil, false +} + +// AsCouchbaseLinkedService is the BasicLinkedService implementation for CosmosDbLinkedService. +func (cdls CosmosDbLinkedService) AsCouchbaseLinkedService() (*CouchbaseLinkedService, bool) { + return nil, false +} + +// AsConcurLinkedService is the BasicLinkedService implementation for CosmosDbLinkedService. +func (cdls CosmosDbLinkedService) AsConcurLinkedService() (*ConcurLinkedService, bool) { + return nil, false +} + +// AsAzurePostgreSQLLinkedService is the BasicLinkedService implementation for CosmosDbLinkedService. +func (cdls CosmosDbLinkedService) AsAzurePostgreSQLLinkedService() (*AzurePostgreSQLLinkedService, bool) { + return nil, false +} + +// AsAmazonMWSLinkedService is the BasicLinkedService implementation for CosmosDbLinkedService. +func (cdls CosmosDbLinkedService) AsAmazonMWSLinkedService() (*AmazonMWSLinkedService, bool) { + return nil, false +} + +// AsSapHanaLinkedService is the BasicLinkedService implementation for CosmosDbLinkedService. +func (cdls CosmosDbLinkedService) AsSapHanaLinkedService() (*SapHanaLinkedService, bool) { + return nil, false +} + +// AsSapBWLinkedService is the BasicLinkedService implementation for CosmosDbLinkedService. +func (cdls CosmosDbLinkedService) AsSapBWLinkedService() (*SapBWLinkedService, bool) { + return nil, false +} + +// AsSftpServerLinkedService is the BasicLinkedService implementation for CosmosDbLinkedService. +func (cdls CosmosDbLinkedService) AsSftpServerLinkedService() (*SftpServerLinkedService, bool) { + return nil, false +} + +// AsFtpServerLinkedService is the BasicLinkedService implementation for CosmosDbLinkedService. +func (cdls CosmosDbLinkedService) AsFtpServerLinkedService() (*FtpServerLinkedService, bool) { + return nil, false +} + +// AsHTTPLinkedService is the BasicLinkedService implementation for CosmosDbLinkedService. +func (cdls CosmosDbLinkedService) AsHTTPLinkedService() (*HTTPLinkedService, bool) { + return nil, false +} + +// AsAzureSearchLinkedService is the BasicLinkedService implementation for CosmosDbLinkedService. +func (cdls CosmosDbLinkedService) AsAzureSearchLinkedService() (*AzureSearchLinkedService, bool) { + return nil, false +} + +// AsCustomDataSourceLinkedService is the BasicLinkedService implementation for CosmosDbLinkedService. +func (cdls CosmosDbLinkedService) AsCustomDataSourceLinkedService() (*CustomDataSourceLinkedService, bool) { + return nil, false +} + +// AsAmazonRedshiftLinkedService is the BasicLinkedService implementation for CosmosDbLinkedService. +func (cdls CosmosDbLinkedService) AsAmazonRedshiftLinkedService() (*AmazonRedshiftLinkedService, bool) { + return nil, false +} + +// AsAmazonS3LinkedService is the BasicLinkedService implementation for CosmosDbLinkedService. +func (cdls CosmosDbLinkedService) AsAmazonS3LinkedService() (*AmazonS3LinkedService, bool) { + return nil, false +} + +// AsSapEccLinkedService is the BasicLinkedService implementation for CosmosDbLinkedService. +func (cdls CosmosDbLinkedService) AsSapEccLinkedService() (*SapEccLinkedService, bool) { + return nil, false +} + +// AsSapCloudForCustomerLinkedService is the BasicLinkedService implementation for CosmosDbLinkedService. +func (cdls CosmosDbLinkedService) AsSapCloudForCustomerLinkedService() (*SapCloudForCustomerLinkedService, bool) { + return nil, false +} + +// AsSalesforceLinkedService is the BasicLinkedService implementation for CosmosDbLinkedService. +func (cdls CosmosDbLinkedService) AsSalesforceLinkedService() (*SalesforceLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeStoreLinkedService is the BasicLinkedService implementation for CosmosDbLinkedService. +func (cdls CosmosDbLinkedService) AsAzureDataLakeStoreLinkedService() (*AzureDataLakeStoreLinkedService, bool) { + return nil, false +} + +// AsMongoDbLinkedService is the BasicLinkedService implementation for CosmosDbLinkedService. +func (cdls CosmosDbLinkedService) AsMongoDbLinkedService() (*MongoDbLinkedService, bool) { + return nil, false +} + +// AsCassandraLinkedService is the BasicLinkedService implementation for CosmosDbLinkedService. +func (cdls CosmosDbLinkedService) AsCassandraLinkedService() (*CassandraLinkedService, bool) { + return nil, false +} + +// AsWebLinkedService is the BasicLinkedService implementation for CosmosDbLinkedService. +func (cdls CosmosDbLinkedService) AsWebLinkedService() (*WebLinkedService, bool) { + return nil, false +} + +// AsODataLinkedService is the BasicLinkedService implementation for CosmosDbLinkedService. +func (cdls CosmosDbLinkedService) AsODataLinkedService() (*ODataLinkedService, bool) { + return nil, false +} + +// AsHdfsLinkedService is the BasicLinkedService implementation for CosmosDbLinkedService. +func (cdls CosmosDbLinkedService) AsHdfsLinkedService() (*HdfsLinkedService, bool) { + return nil, false +} + +// AsOdbcLinkedService is the BasicLinkedService implementation for CosmosDbLinkedService. +func (cdls CosmosDbLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, bool) { + return nil, false +} + +// AsAzureMLLinkedService is the BasicLinkedService implementation for CosmosDbLinkedService. +func (cdls CosmosDbLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { + return nil, false +} + +// AsTeradataLinkedService is the BasicLinkedService implementation for CosmosDbLinkedService. +func (cdls CosmosDbLinkedService) AsTeradataLinkedService() (*TeradataLinkedService, bool) { + return nil, false +} + +// AsDb2LinkedService is the BasicLinkedService implementation for CosmosDbLinkedService. +func (cdls CosmosDbLinkedService) AsDb2LinkedService() (*Db2LinkedService, bool) { + return nil, false +} + +// AsSybaseLinkedService is the BasicLinkedService implementation for CosmosDbLinkedService. +func (cdls CosmosDbLinkedService) AsSybaseLinkedService() (*SybaseLinkedService, bool) { + return nil, false +} + +// AsPostgreSQLLinkedService is the BasicLinkedService implementation for CosmosDbLinkedService. +func (cdls CosmosDbLinkedService) AsPostgreSQLLinkedService() (*PostgreSQLLinkedService, bool) { + return nil, false +} + +// AsMySQLLinkedService is the BasicLinkedService implementation for CosmosDbLinkedService. +func (cdls CosmosDbLinkedService) AsMySQLLinkedService() (*MySQLLinkedService, bool) { + return nil, false +} + +// AsAzureMySQLLinkedService is the BasicLinkedService implementation for CosmosDbLinkedService. +func (cdls CosmosDbLinkedService) AsAzureMySQLLinkedService() (*AzureMySQLLinkedService, bool) { + return nil, false +} + +// AsOracleLinkedService is the BasicLinkedService implementation for CosmosDbLinkedService. +func (cdls CosmosDbLinkedService) AsOracleLinkedService() (*OracleLinkedService, bool) { + return nil, false +} + +// AsFileServerLinkedService is the BasicLinkedService implementation for CosmosDbLinkedService. +func (cdls CosmosDbLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { + return nil, false +} + +// AsHDInsightLinkedService is the BasicLinkedService implementation for CosmosDbLinkedService. +func (cdls CosmosDbLinkedService) AsHDInsightLinkedService() (*HDInsightLinkedService, bool) { + return nil, false +} + +// AsDynamicsLinkedService is the BasicLinkedService implementation for CosmosDbLinkedService. +func (cdls CosmosDbLinkedService) AsDynamicsLinkedService() (*DynamicsLinkedService, bool) { + return nil, false +} + +// AsCosmosDbLinkedService is the BasicLinkedService implementation for CosmosDbLinkedService. +func (cdls CosmosDbLinkedService) AsCosmosDbLinkedService() (*CosmosDbLinkedService, bool) { + return &cdls, true +} + +// AsAzureKeyVaultLinkedService is the BasicLinkedService implementation for CosmosDbLinkedService. +func (cdls CosmosDbLinkedService) AsAzureKeyVaultLinkedService() (*AzureKeyVaultLinkedService, bool) { + return nil, false +} + +// AsAzureBatchLinkedService is the BasicLinkedService implementation for CosmosDbLinkedService. +func (cdls CosmosDbLinkedService) AsAzureBatchLinkedService() (*AzureBatchLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDatabaseLinkedService is the BasicLinkedService implementation for CosmosDbLinkedService. +func (cdls CosmosDbLinkedService) AsAzureSQLDatabaseLinkedService() (*AzureSQLDatabaseLinkedService, bool) { + return nil, false +} + +// AsSQLServerLinkedService is the BasicLinkedService implementation for CosmosDbLinkedService. +func (cdls CosmosDbLinkedService) AsSQLServerLinkedService() (*SQLServerLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDWLinkedService is the BasicLinkedService implementation for CosmosDbLinkedService. +func (cdls CosmosDbLinkedService) AsAzureSQLDWLinkedService() (*AzureSQLDWLinkedService, bool) { + return nil, false +} + +// AsAzureStorageLinkedService is the BasicLinkedService implementation for CosmosDbLinkedService. +func (cdls CosmosDbLinkedService) AsAzureStorageLinkedService() (*AzureStorageLinkedService, bool) { + return nil, false +} + +// AsLinkedService is the BasicLinkedService implementation for CosmosDbLinkedService. +func (cdls CosmosDbLinkedService) AsLinkedService() (*LinkedService, bool) { + return nil, false +} + +// AsBasicLinkedService is the BasicLinkedService implementation for CosmosDbLinkedService. +func (cdls CosmosDbLinkedService) AsBasicLinkedService() (BasicLinkedService, bool) { + return &cdls, true +} + +// UnmarshalJSON is the custom unmarshaler for CosmosDbLinkedService struct. +func (cdls *CosmosDbLinkedService) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "typeProperties": + if v != nil { + var cosmosDbLinkedServiceTypeProperties CosmosDbLinkedServiceTypeProperties + err = json.Unmarshal(*v, &cosmosDbLinkedServiceTypeProperties) + if err != nil { + return err + } + cdls.CosmosDbLinkedServiceTypeProperties = &cosmosDbLinkedServiceTypeProperties + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if cdls.AdditionalProperties == nil { + cdls.AdditionalProperties = make(map[string]interface{}) + } + cdls.AdditionalProperties[k] = additionalProperties + } + case "connectVia": + if v != nil { + var connectVia IntegrationRuntimeReference + err = json.Unmarshal(*v, &connectVia) + if err != nil { + return err + } + cdls.ConnectVia = &connectVia + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + cdls.Description = &description + } + case "parameters": + if v != nil { + var parameters map[string]*ParameterSpecification + err = json.Unmarshal(*v, ¶meters) + if err != nil { + return err + } + cdls.Parameters = parameters + } + case "annotations": + if v != nil { + var annotations []interface{} + err = json.Unmarshal(*v, &annotations) + if err != nil { + return err + } + cdls.Annotations = &annotations + } + case "type": + if v != nil { + var typeVar TypeBasicLinkedService + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + cdls.Type = typeVar + } + } + } + + return nil +} + +// CosmosDbLinkedServiceTypeProperties cosmosDB linked service properties. +type CosmosDbLinkedServiceTypeProperties struct { + // ConnectionString - The connection string. Type: string, SecureString or AzureKeyVaultSecretReference. + ConnectionString interface{} `json:"connectionString,omitempty"` + // EncryptedCredential - The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string). + EncryptedCredential interface{} `json:"encryptedCredential,omitempty"` +} + +// CouchbaseLinkedService couchbase server linked service. +type CouchbaseLinkedService struct { + // CouchbaseLinkedServiceTypeProperties - Couchbase server linked service properties. + *CouchbaseLinkedServiceTypeProperties `json:"typeProperties,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // ConnectVia - The integration runtime reference. + ConnectVia *IntegrationRuntimeReference `json:"connectVia,omitempty"` + // Description - Linked service description. + Description *string `json:"description,omitempty"` + // Parameters - Parameters for linked service. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeLinkedService', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforce', 'TypeAzureDataLakeStore', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureStorage' + Type TypeBasicLinkedService `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for CouchbaseLinkedService. +func (cls CouchbaseLinkedService) MarshalJSON() ([]byte, error) { + cls.Type = TypeCouchbase + objectMap := make(map[string]interface{}) + if cls.CouchbaseLinkedServiceTypeProperties != nil { + objectMap["typeProperties"] = cls.CouchbaseLinkedServiceTypeProperties + } + if cls.ConnectVia != nil { + objectMap["connectVia"] = cls.ConnectVia + } + if cls.Description != nil { + objectMap["description"] = cls.Description + } + if cls.Parameters != nil { + objectMap["parameters"] = cls.Parameters + } + if cls.Annotations != nil { + objectMap["annotations"] = cls.Annotations + } + if cls.Type != "" { + objectMap["type"] = cls.Type + } + for k, v := range cls.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysLinkedService is the BasicLinkedService implementation for CouchbaseLinkedService. +func (cls CouchbaseLinkedService) AsResponsysLinkedService() (*ResponsysLinkedService, bool) { + return nil, false +} + +// AsAzureDatabricksLinkedService is the BasicLinkedService implementation for CouchbaseLinkedService. +func (cls CouchbaseLinkedService) AsAzureDatabricksLinkedService() (*AzureDatabricksLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeAnalyticsLinkedService is the BasicLinkedService implementation for CouchbaseLinkedService. +func (cls CouchbaseLinkedService) AsAzureDataLakeAnalyticsLinkedService() (*AzureDataLakeAnalyticsLinkedService, bool) { + return nil, false +} + +// AsHDInsightOnDemandLinkedService is the BasicLinkedService implementation for CouchbaseLinkedService. +func (cls CouchbaseLinkedService) AsHDInsightOnDemandLinkedService() (*HDInsightOnDemandLinkedService, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudLinkedService is the BasicLinkedService implementation for CouchbaseLinkedService. +func (cls CouchbaseLinkedService) AsSalesforceMarketingCloudLinkedService() (*SalesforceMarketingCloudLinkedService, bool) { + return nil, false +} + +// AsNetezzaLinkedService is the BasicLinkedService implementation for CouchbaseLinkedService. +func (cls CouchbaseLinkedService) AsNetezzaLinkedService() (*NetezzaLinkedService, bool) { + return nil, false +} + +// AsVerticaLinkedService is the BasicLinkedService implementation for CouchbaseLinkedService. +func (cls CouchbaseLinkedService) AsVerticaLinkedService() (*VerticaLinkedService, bool) { + return nil, false +} + +// AsZohoLinkedService is the BasicLinkedService implementation for CouchbaseLinkedService. +func (cls CouchbaseLinkedService) AsZohoLinkedService() (*ZohoLinkedService, bool) { + return nil, false +} + +// AsXeroLinkedService is the BasicLinkedService implementation for CouchbaseLinkedService. +func (cls CouchbaseLinkedService) AsXeroLinkedService() (*XeroLinkedService, bool) { + return nil, false +} + +// AsSquareLinkedService is the BasicLinkedService implementation for CouchbaseLinkedService. +func (cls CouchbaseLinkedService) AsSquareLinkedService() (*SquareLinkedService, bool) { + return nil, false +} + +// AsSparkLinkedService is the BasicLinkedService implementation for CouchbaseLinkedService. +func (cls CouchbaseLinkedService) AsSparkLinkedService() (*SparkLinkedService, bool) { + return nil, false +} + +// AsShopifyLinkedService is the BasicLinkedService implementation for CouchbaseLinkedService. +func (cls CouchbaseLinkedService) AsShopifyLinkedService() (*ShopifyLinkedService, bool) { + return nil, false +} + +// AsServiceNowLinkedService is the BasicLinkedService implementation for CouchbaseLinkedService. +func (cls CouchbaseLinkedService) AsServiceNowLinkedService() (*ServiceNowLinkedService, bool) { + return nil, false +} + +// AsQuickBooksLinkedService is the BasicLinkedService implementation for CouchbaseLinkedService. +func (cls CouchbaseLinkedService) AsQuickBooksLinkedService() (*QuickBooksLinkedService, bool) { + return nil, false +} + +// AsPrestoLinkedService is the BasicLinkedService implementation for CouchbaseLinkedService. +func (cls CouchbaseLinkedService) AsPrestoLinkedService() (*PrestoLinkedService, bool) { + return nil, false +} + +// AsPhoenixLinkedService is the BasicLinkedService implementation for CouchbaseLinkedService. +func (cls CouchbaseLinkedService) AsPhoenixLinkedService() (*PhoenixLinkedService, bool) { + return nil, false +} + +// AsPaypalLinkedService is the BasicLinkedService implementation for CouchbaseLinkedService. +func (cls CouchbaseLinkedService) AsPaypalLinkedService() (*PaypalLinkedService, bool) { + return nil, false +} + +// AsMarketoLinkedService is the BasicLinkedService implementation for CouchbaseLinkedService. +func (cls CouchbaseLinkedService) AsMarketoLinkedService() (*MarketoLinkedService, bool) { + return nil, false +} + +// AsMariaDBLinkedService is the BasicLinkedService implementation for CouchbaseLinkedService. +func (cls CouchbaseLinkedService) AsMariaDBLinkedService() (*MariaDBLinkedService, bool) { + return nil, false +} + +// AsMagentoLinkedService is the BasicLinkedService implementation for CouchbaseLinkedService. +func (cls CouchbaseLinkedService) AsMagentoLinkedService() (*MagentoLinkedService, bool) { + return nil, false +} + +// AsJiraLinkedService is the BasicLinkedService implementation for CouchbaseLinkedService. +func (cls CouchbaseLinkedService) AsJiraLinkedService() (*JiraLinkedService, bool) { + return nil, false +} + +// AsImpalaLinkedService is the BasicLinkedService implementation for CouchbaseLinkedService. +func (cls CouchbaseLinkedService) AsImpalaLinkedService() (*ImpalaLinkedService, bool) { + return nil, false +} + +// AsHubspotLinkedService is the BasicLinkedService implementation for CouchbaseLinkedService. +func (cls CouchbaseLinkedService) AsHubspotLinkedService() (*HubspotLinkedService, bool) { + return nil, false +} + +// AsHiveLinkedService is the BasicLinkedService implementation for CouchbaseLinkedService. +func (cls CouchbaseLinkedService) AsHiveLinkedService() (*HiveLinkedService, bool) { + return nil, false +} + +// AsHBaseLinkedService is the BasicLinkedService implementation for CouchbaseLinkedService. +func (cls CouchbaseLinkedService) AsHBaseLinkedService() (*HBaseLinkedService, bool) { + return nil, false +} + +// AsGreenplumLinkedService is the BasicLinkedService implementation for CouchbaseLinkedService. +func (cls CouchbaseLinkedService) AsGreenplumLinkedService() (*GreenplumLinkedService, bool) { + return nil, false +} + +// AsGoogleBigQueryLinkedService is the BasicLinkedService implementation for CouchbaseLinkedService. +func (cls CouchbaseLinkedService) AsGoogleBigQueryLinkedService() (*GoogleBigQueryLinkedService, bool) { + return nil, false +} + +// AsEloquaLinkedService is the BasicLinkedService implementation for CouchbaseLinkedService. +func (cls CouchbaseLinkedService) AsEloquaLinkedService() (*EloquaLinkedService, bool) { + return nil, false +} + +// AsDrillLinkedService is the BasicLinkedService implementation for CouchbaseLinkedService. +func (cls CouchbaseLinkedService) AsDrillLinkedService() (*DrillLinkedService, bool) { + return nil, false +} + +// AsCouchbaseLinkedService is the BasicLinkedService implementation for CouchbaseLinkedService. +func (cls CouchbaseLinkedService) AsCouchbaseLinkedService() (*CouchbaseLinkedService, bool) { + return &cls, true +} + +// AsConcurLinkedService is the BasicLinkedService implementation for CouchbaseLinkedService. +func (cls CouchbaseLinkedService) AsConcurLinkedService() (*ConcurLinkedService, bool) { + return nil, false +} + +// AsAzurePostgreSQLLinkedService is the BasicLinkedService implementation for CouchbaseLinkedService. +func (cls CouchbaseLinkedService) AsAzurePostgreSQLLinkedService() (*AzurePostgreSQLLinkedService, bool) { + return nil, false +} + +// AsAmazonMWSLinkedService is the BasicLinkedService implementation for CouchbaseLinkedService. +func (cls CouchbaseLinkedService) AsAmazonMWSLinkedService() (*AmazonMWSLinkedService, bool) { + return nil, false +} + +// AsSapHanaLinkedService is the BasicLinkedService implementation for CouchbaseLinkedService. +func (cls CouchbaseLinkedService) AsSapHanaLinkedService() (*SapHanaLinkedService, bool) { + return nil, false +} + +// AsSapBWLinkedService is the BasicLinkedService implementation for CouchbaseLinkedService. +func (cls CouchbaseLinkedService) AsSapBWLinkedService() (*SapBWLinkedService, bool) { + return nil, false +} + +// AsSftpServerLinkedService is the BasicLinkedService implementation for CouchbaseLinkedService. +func (cls CouchbaseLinkedService) AsSftpServerLinkedService() (*SftpServerLinkedService, bool) { + return nil, false +} + +// AsFtpServerLinkedService is the BasicLinkedService implementation for CouchbaseLinkedService. +func (cls CouchbaseLinkedService) AsFtpServerLinkedService() (*FtpServerLinkedService, bool) { + return nil, false +} + +// AsHTTPLinkedService is the BasicLinkedService implementation for CouchbaseLinkedService. +func (cls CouchbaseLinkedService) AsHTTPLinkedService() (*HTTPLinkedService, bool) { + return nil, false +} + +// AsAzureSearchLinkedService is the BasicLinkedService implementation for CouchbaseLinkedService. +func (cls CouchbaseLinkedService) AsAzureSearchLinkedService() (*AzureSearchLinkedService, bool) { + return nil, false +} + +// AsCustomDataSourceLinkedService is the BasicLinkedService implementation for CouchbaseLinkedService. +func (cls CouchbaseLinkedService) AsCustomDataSourceLinkedService() (*CustomDataSourceLinkedService, bool) { + return nil, false +} + +// AsAmazonRedshiftLinkedService is the BasicLinkedService implementation for CouchbaseLinkedService. +func (cls CouchbaseLinkedService) AsAmazonRedshiftLinkedService() (*AmazonRedshiftLinkedService, bool) { + return nil, false +} + +// AsAmazonS3LinkedService is the BasicLinkedService implementation for CouchbaseLinkedService. +func (cls CouchbaseLinkedService) AsAmazonS3LinkedService() (*AmazonS3LinkedService, bool) { + return nil, false +} + +// AsSapEccLinkedService is the BasicLinkedService implementation for CouchbaseLinkedService. +func (cls CouchbaseLinkedService) AsSapEccLinkedService() (*SapEccLinkedService, bool) { + return nil, false +} + +// AsSapCloudForCustomerLinkedService is the BasicLinkedService implementation for CouchbaseLinkedService. +func (cls CouchbaseLinkedService) AsSapCloudForCustomerLinkedService() (*SapCloudForCustomerLinkedService, bool) { + return nil, false +} + +// AsSalesforceLinkedService is the BasicLinkedService implementation for CouchbaseLinkedService. +func (cls CouchbaseLinkedService) AsSalesforceLinkedService() (*SalesforceLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeStoreLinkedService is the BasicLinkedService implementation for CouchbaseLinkedService. +func (cls CouchbaseLinkedService) AsAzureDataLakeStoreLinkedService() (*AzureDataLakeStoreLinkedService, bool) { + return nil, false +} + +// AsMongoDbLinkedService is the BasicLinkedService implementation for CouchbaseLinkedService. +func (cls CouchbaseLinkedService) AsMongoDbLinkedService() (*MongoDbLinkedService, bool) { + return nil, false +} + +// AsCassandraLinkedService is the BasicLinkedService implementation for CouchbaseLinkedService. +func (cls CouchbaseLinkedService) AsCassandraLinkedService() (*CassandraLinkedService, bool) { + return nil, false +} + +// AsWebLinkedService is the BasicLinkedService implementation for CouchbaseLinkedService. +func (cls CouchbaseLinkedService) AsWebLinkedService() (*WebLinkedService, bool) { + return nil, false +} + +// AsODataLinkedService is the BasicLinkedService implementation for CouchbaseLinkedService. +func (cls CouchbaseLinkedService) AsODataLinkedService() (*ODataLinkedService, bool) { + return nil, false +} + +// AsHdfsLinkedService is the BasicLinkedService implementation for CouchbaseLinkedService. +func (cls CouchbaseLinkedService) AsHdfsLinkedService() (*HdfsLinkedService, bool) { + return nil, false +} + +// AsOdbcLinkedService is the BasicLinkedService implementation for CouchbaseLinkedService. +func (cls CouchbaseLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, bool) { + return nil, false +} + +// AsAzureMLLinkedService is the BasicLinkedService implementation for CouchbaseLinkedService. +func (cls CouchbaseLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { + return nil, false +} + +// AsTeradataLinkedService is the BasicLinkedService implementation for CouchbaseLinkedService. +func (cls CouchbaseLinkedService) AsTeradataLinkedService() (*TeradataLinkedService, bool) { + return nil, false +} + +// AsDb2LinkedService is the BasicLinkedService implementation for CouchbaseLinkedService. +func (cls CouchbaseLinkedService) AsDb2LinkedService() (*Db2LinkedService, bool) { + return nil, false +} + +// AsSybaseLinkedService is the BasicLinkedService implementation for CouchbaseLinkedService. +func (cls CouchbaseLinkedService) AsSybaseLinkedService() (*SybaseLinkedService, bool) { + return nil, false +} + +// AsPostgreSQLLinkedService is the BasicLinkedService implementation for CouchbaseLinkedService. +func (cls CouchbaseLinkedService) AsPostgreSQLLinkedService() (*PostgreSQLLinkedService, bool) { + return nil, false +} + +// AsMySQLLinkedService is the BasicLinkedService implementation for CouchbaseLinkedService. +func (cls CouchbaseLinkedService) AsMySQLLinkedService() (*MySQLLinkedService, bool) { + return nil, false +} + +// AsAzureMySQLLinkedService is the BasicLinkedService implementation for CouchbaseLinkedService. +func (cls CouchbaseLinkedService) AsAzureMySQLLinkedService() (*AzureMySQLLinkedService, bool) { + return nil, false +} + +// AsOracleLinkedService is the BasicLinkedService implementation for CouchbaseLinkedService. +func (cls CouchbaseLinkedService) AsOracleLinkedService() (*OracleLinkedService, bool) { + return nil, false +} + +// AsFileServerLinkedService is the BasicLinkedService implementation for CouchbaseLinkedService. +func (cls CouchbaseLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { + return nil, false +} + +// AsHDInsightLinkedService is the BasicLinkedService implementation for CouchbaseLinkedService. +func (cls CouchbaseLinkedService) AsHDInsightLinkedService() (*HDInsightLinkedService, bool) { + return nil, false +} + +// AsDynamicsLinkedService is the BasicLinkedService implementation for CouchbaseLinkedService. +func (cls CouchbaseLinkedService) AsDynamicsLinkedService() (*DynamicsLinkedService, bool) { + return nil, false +} + +// AsCosmosDbLinkedService is the BasicLinkedService implementation for CouchbaseLinkedService. +func (cls CouchbaseLinkedService) AsCosmosDbLinkedService() (*CosmosDbLinkedService, bool) { + return nil, false +} + +// AsAzureKeyVaultLinkedService is the BasicLinkedService implementation for CouchbaseLinkedService. +func (cls CouchbaseLinkedService) AsAzureKeyVaultLinkedService() (*AzureKeyVaultLinkedService, bool) { + return nil, false +} + +// AsAzureBatchLinkedService is the BasicLinkedService implementation for CouchbaseLinkedService. +func (cls CouchbaseLinkedService) AsAzureBatchLinkedService() (*AzureBatchLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDatabaseLinkedService is the BasicLinkedService implementation for CouchbaseLinkedService. +func (cls CouchbaseLinkedService) AsAzureSQLDatabaseLinkedService() (*AzureSQLDatabaseLinkedService, bool) { + return nil, false +} + +// AsSQLServerLinkedService is the BasicLinkedService implementation for CouchbaseLinkedService. +func (cls CouchbaseLinkedService) AsSQLServerLinkedService() (*SQLServerLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDWLinkedService is the BasicLinkedService implementation for CouchbaseLinkedService. +func (cls CouchbaseLinkedService) AsAzureSQLDWLinkedService() (*AzureSQLDWLinkedService, bool) { + return nil, false +} + +// AsAzureStorageLinkedService is the BasicLinkedService implementation for CouchbaseLinkedService. +func (cls CouchbaseLinkedService) AsAzureStorageLinkedService() (*AzureStorageLinkedService, bool) { + return nil, false +} + +// AsLinkedService is the BasicLinkedService implementation for CouchbaseLinkedService. +func (cls CouchbaseLinkedService) AsLinkedService() (*LinkedService, bool) { + return nil, false +} + +// AsBasicLinkedService is the BasicLinkedService implementation for CouchbaseLinkedService. +func (cls CouchbaseLinkedService) AsBasicLinkedService() (BasicLinkedService, bool) { + return &cls, true +} + +// UnmarshalJSON is the custom unmarshaler for CouchbaseLinkedService struct. +func (cls *CouchbaseLinkedService) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "typeProperties": + if v != nil { + var couchbaseLinkedServiceTypeProperties CouchbaseLinkedServiceTypeProperties + err = json.Unmarshal(*v, &couchbaseLinkedServiceTypeProperties) + if err != nil { + return err + } + cls.CouchbaseLinkedServiceTypeProperties = &couchbaseLinkedServiceTypeProperties + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if cls.AdditionalProperties == nil { + cls.AdditionalProperties = make(map[string]interface{}) + } + cls.AdditionalProperties[k] = additionalProperties + } + case "connectVia": + if v != nil { + var connectVia IntegrationRuntimeReference + err = json.Unmarshal(*v, &connectVia) + if err != nil { + return err + } + cls.ConnectVia = &connectVia + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + cls.Description = &description + } + case "parameters": + if v != nil { + var parameters map[string]*ParameterSpecification + err = json.Unmarshal(*v, ¶meters) + if err != nil { + return err + } + cls.Parameters = parameters + } + case "annotations": + if v != nil { + var annotations []interface{} + err = json.Unmarshal(*v, &annotations) + if err != nil { + return err + } + cls.Annotations = &annotations + } + case "type": + if v != nil { + var typeVar TypeBasicLinkedService + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + cls.Type = typeVar + } + } + } + + return nil +} + +// CouchbaseLinkedServiceTypeProperties couchbase server linked service properties. +type CouchbaseLinkedServiceTypeProperties struct { + // ConnectionString - An ODBC connection string. Type: string, SecureString or AzureKeyVaultSecretReference. + ConnectionString interface{} `json:"connectionString,omitempty"` + // EncryptedCredential - The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string). + EncryptedCredential interface{} `json:"encryptedCredential,omitempty"` +} + +// CouchbaseSource a copy activity Couchbase server source. +type CouchbaseSource struct { + // Query - A query to retrieve data from source. Type: string (or Expression with resultType string). + Query interface{} `json:"query,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // SourceRetryCount - Source retry count. Type: integer (or Expression with resultType integer). + SourceRetryCount interface{} `json:"sourceRetryCount,omitempty"` + // SourceRetryWait - Source retry wait. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` + // Type - Possible values include: 'TypeCopySource', 'TypeAmazonRedshiftSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeHTTPSource', 'TypeAzureDataLakeStoreSource', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeRelationalSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource' + Type TypeBasicCopySource `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for CouchbaseSource. +func (cs CouchbaseSource) MarshalJSON() ([]byte, error) { + cs.Type = TypeCouchbaseSource + objectMap := make(map[string]interface{}) + objectMap["query"] = cs.Query + objectMap["sourceRetryCount"] = cs.SourceRetryCount + objectMap["sourceRetryWait"] = cs.SourceRetryWait + if cs.Type != "" { + objectMap["type"] = cs.Type + } + for k, v := range cs.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsAmazonRedshiftSource is the BasicCopySource implementation for CouchbaseSource. +func (cs CouchbaseSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { + return nil, false +} + +// AsResponsysSource is the BasicCopySource implementation for CouchbaseSource. +func (cs CouchbaseSource) AsResponsysSource() (*ResponsysSource, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudSource is the BasicCopySource implementation for CouchbaseSource. +func (cs CouchbaseSource) AsSalesforceMarketingCloudSource() (*SalesforceMarketingCloudSource, bool) { + return nil, false +} + +// AsVerticaSource is the BasicCopySource implementation for CouchbaseSource. +func (cs CouchbaseSource) AsVerticaSource() (*VerticaSource, bool) { + return nil, false +} + +// AsNetezzaSource is the BasicCopySource implementation for CouchbaseSource. +func (cs CouchbaseSource) AsNetezzaSource() (*NetezzaSource, bool) { + return nil, false +} + +// AsZohoSource is the BasicCopySource implementation for CouchbaseSource. +func (cs CouchbaseSource) AsZohoSource() (*ZohoSource, bool) { + return nil, false +} + +// AsXeroSource is the BasicCopySource implementation for CouchbaseSource. +func (cs CouchbaseSource) AsXeroSource() (*XeroSource, bool) { + return nil, false +} + +// AsSquareSource is the BasicCopySource implementation for CouchbaseSource. +func (cs CouchbaseSource) AsSquareSource() (*SquareSource, bool) { + return nil, false +} + +// AsSparkSource is the BasicCopySource implementation for CouchbaseSource. +func (cs CouchbaseSource) AsSparkSource() (*SparkSource, bool) { + return nil, false +} + +// AsShopifySource is the BasicCopySource implementation for CouchbaseSource. +func (cs CouchbaseSource) AsShopifySource() (*ShopifySource, bool) { + return nil, false +} + +// AsServiceNowSource is the BasicCopySource implementation for CouchbaseSource. +func (cs CouchbaseSource) AsServiceNowSource() (*ServiceNowSource, bool) { + return nil, false +} + +// AsQuickBooksSource is the BasicCopySource implementation for CouchbaseSource. +func (cs CouchbaseSource) AsQuickBooksSource() (*QuickBooksSource, bool) { + return nil, false +} + +// AsPrestoSource is the BasicCopySource implementation for CouchbaseSource. +func (cs CouchbaseSource) AsPrestoSource() (*PrestoSource, bool) { + return nil, false +} + +// AsPhoenixSource is the BasicCopySource implementation for CouchbaseSource. +func (cs CouchbaseSource) AsPhoenixSource() (*PhoenixSource, bool) { + return nil, false +} + +// AsPaypalSource is the BasicCopySource implementation for CouchbaseSource. +func (cs CouchbaseSource) AsPaypalSource() (*PaypalSource, bool) { + return nil, false +} + +// AsMarketoSource is the BasicCopySource implementation for CouchbaseSource. +func (cs CouchbaseSource) AsMarketoSource() (*MarketoSource, bool) { + return nil, false +} + +// AsMariaDBSource is the BasicCopySource implementation for CouchbaseSource. +func (cs CouchbaseSource) AsMariaDBSource() (*MariaDBSource, bool) { + return nil, false +} + +// AsMagentoSource is the BasicCopySource implementation for CouchbaseSource. +func (cs CouchbaseSource) AsMagentoSource() (*MagentoSource, bool) { + return nil, false +} + +// AsJiraSource is the BasicCopySource implementation for CouchbaseSource. +func (cs CouchbaseSource) AsJiraSource() (*JiraSource, bool) { + return nil, false +} + +// AsImpalaSource is the BasicCopySource implementation for CouchbaseSource. +func (cs CouchbaseSource) AsImpalaSource() (*ImpalaSource, bool) { + return nil, false +} + +// AsHubspotSource is the BasicCopySource implementation for CouchbaseSource. +func (cs CouchbaseSource) AsHubspotSource() (*HubspotSource, bool) { + return nil, false +} + +// AsHiveSource is the BasicCopySource implementation for CouchbaseSource. +func (cs CouchbaseSource) AsHiveSource() (*HiveSource, bool) { + return nil, false +} + +// AsHBaseSource is the BasicCopySource implementation for CouchbaseSource. +func (cs CouchbaseSource) AsHBaseSource() (*HBaseSource, bool) { + return nil, false +} + +// AsGreenplumSource is the BasicCopySource implementation for CouchbaseSource. +func (cs CouchbaseSource) AsGreenplumSource() (*GreenplumSource, bool) { + return nil, false +} + +// AsGoogleBigQuerySource is the BasicCopySource implementation for CouchbaseSource. +func (cs CouchbaseSource) AsGoogleBigQuerySource() (*GoogleBigQuerySource, bool) { + return nil, false +} + +// AsEloquaSource is the BasicCopySource implementation for CouchbaseSource. +func (cs CouchbaseSource) AsEloquaSource() (*EloquaSource, bool) { + return nil, false +} + +// AsDrillSource is the BasicCopySource implementation for CouchbaseSource. +func (cs CouchbaseSource) AsDrillSource() (*DrillSource, bool) { + return nil, false +} + +// AsCouchbaseSource is the BasicCopySource implementation for CouchbaseSource. +func (cs CouchbaseSource) AsCouchbaseSource() (*CouchbaseSource, bool) { + return &cs, true +} + +// AsConcurSource is the BasicCopySource implementation for CouchbaseSource. +func (cs CouchbaseSource) AsConcurSource() (*ConcurSource, bool) { + return nil, false +} + +// AsAzurePostgreSQLSource is the BasicCopySource implementation for CouchbaseSource. +func (cs CouchbaseSource) AsAzurePostgreSQLSource() (*AzurePostgreSQLSource, bool) { + return nil, false +} + +// AsAmazonMWSSource is the BasicCopySource implementation for CouchbaseSource. +func (cs CouchbaseSource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { + return nil, false +} + +// AsHTTPSource is the BasicCopySource implementation for CouchbaseSource. +func (cs CouchbaseSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for CouchbaseSource. +func (cs CouchbaseSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for CouchbaseSource. +func (cs CouchbaseSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsCassandraSource is the BasicCopySource implementation for CouchbaseSource. +func (cs CouchbaseSource) AsCassandraSource() (*CassandraSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for CouchbaseSource. +func (cs CouchbaseSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for CouchbaseSource. +func (cs CouchbaseSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureMySQLSource is the BasicCopySource implementation for CouchbaseSource. +func (cs CouchbaseSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for CouchbaseSource. +func (cs CouchbaseSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for CouchbaseSource. +func (cs CouchbaseSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsSQLDWSource is the BasicCopySource implementation for CouchbaseSource. +func (cs CouchbaseSource) AsSQLDWSource() (*SQLDWSource, bool) { + return nil, false +} + +// AsSQLSource is the BasicCopySource implementation for CouchbaseSource. +func (cs CouchbaseSource) AsSQLSource() (*SQLSource, bool) { + return nil, false +} + +// AsSapEccSource is the BasicCopySource implementation for CouchbaseSource. +func (cs CouchbaseSource) AsSapEccSource() (*SapEccSource, bool) { + return nil, false +} + +// AsSapCloudForCustomerSource is the BasicCopySource implementation for CouchbaseSource. +func (cs CouchbaseSource) AsSapCloudForCustomerSource() (*SapCloudForCustomerSource, bool) { + return nil, false +} + +// AsSalesforceSource is the BasicCopySource implementation for CouchbaseSource. +func (cs CouchbaseSource) AsSalesforceSource() (*SalesforceSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for CouchbaseSource. +func (cs CouchbaseSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for CouchbaseSource. +func (cs CouchbaseSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for CouchbaseSource. +func (cs CouchbaseSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for CouchbaseSource. +func (cs CouchbaseSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + +// AsAzureTableSource is the BasicCopySource implementation for CouchbaseSource. +func (cs CouchbaseSource) AsAzureTableSource() (*AzureTableSource, bool) { + return nil, false +} + +// AsCopySource is the BasicCopySource implementation for CouchbaseSource. +func (cs CouchbaseSource) AsCopySource() (*CopySource, bool) { + return nil, false +} + +// AsBasicCopySource is the BasicCopySource implementation for CouchbaseSource. +func (cs CouchbaseSource) AsBasicCopySource() (BasicCopySource, bool) { + return &cs, true +} + +// CouchbaseTableDataset couchbase server dataset. +type CouchbaseTableDataset struct { + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Description - Dataset description. + Description *string `json:"description,omitempty"` + // Structure - Columns that define the structure of the dataset. Type: array (or Expression with resultType array), itemType: DatasetDataElement. + Structure interface{} `json:"structure,omitempty"` + // LinkedServiceName - Linked service reference. + LinkedServiceName *LinkedServiceReference `json:"linkedServiceName,omitempty"` + // Parameters - Parameters for dataset. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeDataset', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSQLServerTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSalesforceObject', 'TypeRelationalTable', 'TypeAzureMySQLTable', 'TypeOracleTable', 'TypeODataResource', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeAzureDataLakeStoreFile', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeAmazonS3Object' + Type TypeBasicDataset `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for CouchbaseTableDataset. +func (ctd CouchbaseTableDataset) MarshalJSON() ([]byte, error) { + ctd.Type = TypeCouchbaseTable + objectMap := make(map[string]interface{}) + if ctd.Description != nil { + objectMap["description"] = ctd.Description + } + objectMap["structure"] = ctd.Structure + if ctd.LinkedServiceName != nil { + objectMap["linkedServiceName"] = ctd.LinkedServiceName + } + if ctd.Parameters != nil { + objectMap["parameters"] = ctd.Parameters + } + if ctd.Annotations != nil { + objectMap["annotations"] = ctd.Annotations + } + if ctd.Type != "" { + objectMap["type"] = ctd.Type + } + for k, v := range ctd.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysObjectDataset is the BasicDataset implementation for CouchbaseTableDataset. +func (ctd CouchbaseTableDataset) AsResponsysObjectDataset() (*ResponsysObjectDataset, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudObjectDataset is the BasicDataset implementation for CouchbaseTableDataset. +func (ctd CouchbaseTableDataset) AsSalesforceMarketingCloudObjectDataset() (*SalesforceMarketingCloudObjectDataset, bool) { + return nil, false +} + +// AsVerticaTableDataset is the BasicDataset implementation for CouchbaseTableDataset. +func (ctd CouchbaseTableDataset) AsVerticaTableDataset() (*VerticaTableDataset, bool) { + return nil, false +} + +// AsNetezzaTableDataset is the BasicDataset implementation for CouchbaseTableDataset. +func (ctd CouchbaseTableDataset) AsNetezzaTableDataset() (*NetezzaTableDataset, bool) { + return nil, false +} + +// AsZohoObjectDataset is the BasicDataset implementation for CouchbaseTableDataset. +func (ctd CouchbaseTableDataset) AsZohoObjectDataset() (*ZohoObjectDataset, bool) { + return nil, false +} + +// AsXeroObjectDataset is the BasicDataset implementation for CouchbaseTableDataset. +func (ctd CouchbaseTableDataset) AsXeroObjectDataset() (*XeroObjectDataset, bool) { + return nil, false +} + +// AsSquareObjectDataset is the BasicDataset implementation for CouchbaseTableDataset. +func (ctd CouchbaseTableDataset) AsSquareObjectDataset() (*SquareObjectDataset, bool) { + return nil, false +} + +// AsSparkObjectDataset is the BasicDataset implementation for CouchbaseTableDataset. +func (ctd CouchbaseTableDataset) AsSparkObjectDataset() (*SparkObjectDataset, bool) { + return nil, false +} + +// AsShopifyObjectDataset is the BasicDataset implementation for CouchbaseTableDataset. +func (ctd CouchbaseTableDataset) AsShopifyObjectDataset() (*ShopifyObjectDataset, bool) { + return nil, false +} + +// AsServiceNowObjectDataset is the BasicDataset implementation for CouchbaseTableDataset. +func (ctd CouchbaseTableDataset) AsServiceNowObjectDataset() (*ServiceNowObjectDataset, bool) { + return nil, false +} + +// AsQuickBooksObjectDataset is the BasicDataset implementation for CouchbaseTableDataset. +func (ctd CouchbaseTableDataset) AsQuickBooksObjectDataset() (*QuickBooksObjectDataset, bool) { + return nil, false +} + +// AsPrestoObjectDataset is the BasicDataset implementation for CouchbaseTableDataset. +func (ctd CouchbaseTableDataset) AsPrestoObjectDataset() (*PrestoObjectDataset, bool) { + return nil, false +} + +// AsPhoenixObjectDataset is the BasicDataset implementation for CouchbaseTableDataset. +func (ctd CouchbaseTableDataset) AsPhoenixObjectDataset() (*PhoenixObjectDataset, bool) { + return nil, false +} + +// AsPaypalObjectDataset is the BasicDataset implementation for CouchbaseTableDataset. +func (ctd CouchbaseTableDataset) AsPaypalObjectDataset() (*PaypalObjectDataset, bool) { + return nil, false +} + +// AsMarketoObjectDataset is the BasicDataset implementation for CouchbaseTableDataset. +func (ctd CouchbaseTableDataset) AsMarketoObjectDataset() (*MarketoObjectDataset, bool) { + return nil, false +} + +// AsMariaDBTableDataset is the BasicDataset implementation for CouchbaseTableDataset. +func (ctd CouchbaseTableDataset) AsMariaDBTableDataset() (*MariaDBTableDataset, bool) { + return nil, false +} + +// AsMagentoObjectDataset is the BasicDataset implementation for CouchbaseTableDataset. +func (ctd CouchbaseTableDataset) AsMagentoObjectDataset() (*MagentoObjectDataset, bool) { + return nil, false +} + +// AsJiraObjectDataset is the BasicDataset implementation for CouchbaseTableDataset. +func (ctd CouchbaseTableDataset) AsJiraObjectDataset() (*JiraObjectDataset, bool) { + return nil, false +} + +// AsImpalaObjectDataset is the BasicDataset implementation for CouchbaseTableDataset. +func (ctd CouchbaseTableDataset) AsImpalaObjectDataset() (*ImpalaObjectDataset, bool) { + return nil, false +} + +// AsHubspotObjectDataset is the BasicDataset implementation for CouchbaseTableDataset. +func (ctd CouchbaseTableDataset) AsHubspotObjectDataset() (*HubspotObjectDataset, bool) { + return nil, false +} + +// AsHiveObjectDataset is the BasicDataset implementation for CouchbaseTableDataset. +func (ctd CouchbaseTableDataset) AsHiveObjectDataset() (*HiveObjectDataset, bool) { + return nil, false +} + +// AsHBaseObjectDataset is the BasicDataset implementation for CouchbaseTableDataset. +func (ctd CouchbaseTableDataset) AsHBaseObjectDataset() (*HBaseObjectDataset, bool) { + return nil, false +} + +// AsGreenplumTableDataset is the BasicDataset implementation for CouchbaseTableDataset. +func (ctd CouchbaseTableDataset) AsGreenplumTableDataset() (*GreenplumTableDataset, bool) { + return nil, false +} + +// AsGoogleBigQueryObjectDataset is the BasicDataset implementation for CouchbaseTableDataset. +func (ctd CouchbaseTableDataset) AsGoogleBigQueryObjectDataset() (*GoogleBigQueryObjectDataset, bool) { + return nil, false +} + +// AsEloquaObjectDataset is the BasicDataset implementation for CouchbaseTableDataset. +func (ctd CouchbaseTableDataset) AsEloquaObjectDataset() (*EloquaObjectDataset, bool) { + return nil, false +} + +// AsDrillTableDataset is the BasicDataset implementation for CouchbaseTableDataset. +func (ctd CouchbaseTableDataset) AsDrillTableDataset() (*DrillTableDataset, bool) { + return nil, false +} + +// AsCouchbaseTableDataset is the BasicDataset implementation for CouchbaseTableDataset. +func (ctd CouchbaseTableDataset) AsCouchbaseTableDataset() (*CouchbaseTableDataset, bool) { + return &ctd, true +} + +// AsConcurObjectDataset is the BasicDataset implementation for CouchbaseTableDataset. +func (ctd CouchbaseTableDataset) AsConcurObjectDataset() (*ConcurObjectDataset, bool) { + return nil, false +} + +// AsAzurePostgreSQLTableDataset is the BasicDataset implementation for CouchbaseTableDataset. +func (ctd CouchbaseTableDataset) AsAzurePostgreSQLTableDataset() (*AzurePostgreSQLTableDataset, bool) { + return nil, false +} + +// AsAmazonMWSObjectDataset is the BasicDataset implementation for CouchbaseTableDataset. +func (ctd CouchbaseTableDataset) AsAmazonMWSObjectDataset() (*AmazonMWSObjectDataset, bool) { + return nil, false +} + +// AsHTTPDataset is the BasicDataset implementation for CouchbaseTableDataset. +func (ctd CouchbaseTableDataset) AsHTTPDataset() (*HTTPDataset, bool) { + return nil, false +} + +// AsAzureSearchIndexDataset is the BasicDataset implementation for CouchbaseTableDataset. +func (ctd CouchbaseTableDataset) AsAzureSearchIndexDataset() (*AzureSearchIndexDataset, bool) { + return nil, false +} + +// AsWebTableDataset is the BasicDataset implementation for CouchbaseTableDataset. +func (ctd CouchbaseTableDataset) AsWebTableDataset() (*WebTableDataset, bool) { + return nil, false +} + +// AsSQLServerTableDataset is the BasicDataset implementation for CouchbaseTableDataset. +func (ctd CouchbaseTableDataset) AsSQLServerTableDataset() (*SQLServerTableDataset, bool) { + return nil, false +} + +// AsSapEccResourceDataset is the BasicDataset implementation for CouchbaseTableDataset. +func (ctd CouchbaseTableDataset) AsSapEccResourceDataset() (*SapEccResourceDataset, bool) { + return nil, false +} + +// AsSapCloudForCustomerResourceDataset is the BasicDataset implementation for CouchbaseTableDataset. +func (ctd CouchbaseTableDataset) AsSapCloudForCustomerResourceDataset() (*SapCloudForCustomerResourceDataset, bool) { + return nil, false +} + +// AsSalesforceObjectDataset is the BasicDataset implementation for CouchbaseTableDataset. +func (ctd CouchbaseTableDataset) AsSalesforceObjectDataset() (*SalesforceObjectDataset, bool) { + return nil, false +} + +// AsRelationalTableDataset is the BasicDataset implementation for CouchbaseTableDataset. +func (ctd CouchbaseTableDataset) AsRelationalTableDataset() (*RelationalTableDataset, bool) { + return nil, false +} + +// AsAzureMySQLTableDataset is the BasicDataset implementation for CouchbaseTableDataset. +func (ctd CouchbaseTableDataset) AsAzureMySQLTableDataset() (*AzureMySQLTableDataset, bool) { + return nil, false +} + +// AsOracleTableDataset is the BasicDataset implementation for CouchbaseTableDataset. +func (ctd CouchbaseTableDataset) AsOracleTableDataset() (*OracleTableDataset, bool) { + return nil, false +} + +// AsODataResourceDataset is the BasicDataset implementation for CouchbaseTableDataset. +func (ctd CouchbaseTableDataset) AsODataResourceDataset() (*ODataResourceDataset, bool) { + return nil, false +} + +// AsMongoDbCollectionDataset is the BasicDataset implementation for CouchbaseTableDataset. +func (ctd CouchbaseTableDataset) AsMongoDbCollectionDataset() (*MongoDbCollectionDataset, bool) { + return nil, false +} + +// AsFileShareDataset is the BasicDataset implementation for CouchbaseTableDataset. +func (ctd CouchbaseTableDataset) AsFileShareDataset() (*FileShareDataset, bool) { + return nil, false +} + +// AsAzureDataLakeStoreDataset is the BasicDataset implementation for CouchbaseTableDataset. +func (ctd CouchbaseTableDataset) AsAzureDataLakeStoreDataset() (*AzureDataLakeStoreDataset, bool) { + return nil, false +} + +// AsDynamicsEntityDataset is the BasicDataset implementation for CouchbaseTableDataset. +func (ctd CouchbaseTableDataset) AsDynamicsEntityDataset() (*DynamicsEntityDataset, bool) { + return nil, false +} + +// AsDocumentDbCollectionDataset is the BasicDataset implementation for CouchbaseTableDataset. +func (ctd CouchbaseTableDataset) AsDocumentDbCollectionDataset() (*DocumentDbCollectionDataset, bool) { + return nil, false +} + +// AsCustomDataset is the BasicDataset implementation for CouchbaseTableDataset. +func (ctd CouchbaseTableDataset) AsCustomDataset() (*CustomDataset, bool) { + return nil, false +} + +// AsCassandraTableDataset is the BasicDataset implementation for CouchbaseTableDataset. +func (ctd CouchbaseTableDataset) AsCassandraTableDataset() (*CassandraTableDataset, bool) { + return nil, false +} + +// AsAzureSQLDWTableDataset is the BasicDataset implementation for CouchbaseTableDataset. +func (ctd CouchbaseTableDataset) AsAzureSQLDWTableDataset() (*AzureSQLDWTableDataset, bool) { + return nil, false +} + +// AsAzureSQLTableDataset is the BasicDataset implementation for CouchbaseTableDataset. +func (ctd CouchbaseTableDataset) AsAzureSQLTableDataset() (*AzureSQLTableDataset, bool) { + return nil, false +} + +// AsAzureTableDataset is the BasicDataset implementation for CouchbaseTableDataset. +func (ctd CouchbaseTableDataset) AsAzureTableDataset() (*AzureTableDataset, bool) { + return nil, false +} + +// AsAzureBlobDataset is the BasicDataset implementation for CouchbaseTableDataset. +func (ctd CouchbaseTableDataset) AsAzureBlobDataset() (*AzureBlobDataset, bool) { + return nil, false +} + +// AsAmazonS3Dataset is the BasicDataset implementation for CouchbaseTableDataset. +func (ctd CouchbaseTableDataset) AsAmazonS3Dataset() (*AmazonS3Dataset, bool) { + return nil, false +} + +// AsDataset is the BasicDataset implementation for CouchbaseTableDataset. +func (ctd CouchbaseTableDataset) AsDataset() (*Dataset, bool) { + return nil, false +} + +// AsBasicDataset is the BasicDataset implementation for CouchbaseTableDataset. +func (ctd CouchbaseTableDataset) AsBasicDataset() (BasicDataset, bool) { + return &ctd, true +} + +// CreateRunResponse response body with a run identifier. +type CreateRunResponse struct { + autorest.Response `json:"-"` + // RunID - Identifier of a run. + RunID *string `json:"runId,omitempty"` +} + +// CustomActivity custom activity type. +type CustomActivity struct { + // CustomActivityTypeProperties - Custom activity properties. + *CustomActivityTypeProperties `json:"typeProperties,omitempty"` + // LinkedServiceName - Linked service reference. + LinkedServiceName *LinkedServiceReference `json:"linkedServiceName,omitempty"` + // Policy - Activity policy. + Policy *ActivityPolicy `json:"policy,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Name - Activity name. + Name *string `json:"name,omitempty"` + // Description - Activity description. + Description *string `json:"description,omitempty"` + // DependsOn - Activity depends on condition. + DependsOn *[]ActivityDependency `json:"dependsOn,omitempty"` + // UserProperties - Activity user properties. + UserProperties map[string]*string `json:"userProperties"` + // Type - Possible values include: 'TypeActivity', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLUpdateResource', 'TypeAzureMLBatchExecution', 'TypeGetMetadata', 'TypeWebActivity', 'TypeLookup', 'TypeSQLServerStoredProcedure', 'TypeCustom', 'TypeExecuteSSISPackage', 'TypeHDInsightSpark', 'TypeHDInsightStreaming', 'TypeHDInsightMapReduce', 'TypeHDInsightPig', 'TypeHDInsightHive', 'TypeCopy', 'TypeExecution', 'TypeFilter', 'TypeUntil', 'TypeWait', 'TypeForEach', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' + Type TypeBasicActivity `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for CustomActivity. +func (ca CustomActivity) MarshalJSON() ([]byte, error) { + ca.Type = TypeCustom + objectMap := make(map[string]interface{}) + if ca.CustomActivityTypeProperties != nil { + objectMap["typeProperties"] = ca.CustomActivityTypeProperties + } + if ca.LinkedServiceName != nil { + objectMap["linkedServiceName"] = ca.LinkedServiceName + } + if ca.Policy != nil { + objectMap["policy"] = ca.Policy + } + if ca.Name != nil { + objectMap["name"] = ca.Name + } + if ca.Description != nil { + objectMap["description"] = ca.Description + } + if ca.DependsOn != nil { + objectMap["dependsOn"] = ca.DependsOn + } + if ca.UserProperties != nil { + objectMap["userProperties"] = ca.UserProperties + } + if ca.Type != "" { + objectMap["type"] = ca.Type + } + for k, v := range ca.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsDatabricksNotebookActivity is the BasicActivity implementation for CustomActivity. +func (ca CustomActivity) AsDatabricksNotebookActivity() (*DatabricksNotebookActivity, bool) { + return nil, false +} + +// AsDataLakeAnalyticsUSQLActivity is the BasicActivity implementation for CustomActivity. +func (ca CustomActivity) AsDataLakeAnalyticsUSQLActivity() (*DataLakeAnalyticsUSQLActivity, bool) { + return nil, false +} + +// AsAzureMLUpdateResourceActivity is the BasicActivity implementation for CustomActivity. +func (ca CustomActivity) AsAzureMLUpdateResourceActivity() (*AzureMLUpdateResourceActivity, bool) { + return nil, false +} + +// AsAzureMLBatchExecutionActivity is the BasicActivity implementation for CustomActivity. +func (ca CustomActivity) AsAzureMLBatchExecutionActivity() (*AzureMLBatchExecutionActivity, bool) { + return nil, false +} + +// AsGetMetadataActivity is the BasicActivity implementation for CustomActivity. +func (ca CustomActivity) AsGetMetadataActivity() (*GetMetadataActivity, bool) { + return nil, false +} + +// AsWebActivity is the BasicActivity implementation for CustomActivity. +func (ca CustomActivity) AsWebActivity() (*WebActivity, bool) { + return nil, false +} + +// AsLookupActivity is the BasicActivity implementation for CustomActivity. +func (ca CustomActivity) AsLookupActivity() (*LookupActivity, bool) { + return nil, false +} + +// AsSQLServerStoredProcedureActivity is the BasicActivity implementation for CustomActivity. +func (ca CustomActivity) AsSQLServerStoredProcedureActivity() (*SQLServerStoredProcedureActivity, bool) { + return nil, false +} + +// AsCustomActivity is the BasicActivity implementation for CustomActivity. +func (ca CustomActivity) AsCustomActivity() (*CustomActivity, bool) { + return &ca, true +} + +// AsExecuteSSISPackageActivity is the BasicActivity implementation for CustomActivity. +func (ca CustomActivity) AsExecuteSSISPackageActivity() (*ExecuteSSISPackageActivity, bool) { + return nil, false +} + +// AsHDInsightSparkActivity is the BasicActivity implementation for CustomActivity. +func (ca CustomActivity) AsHDInsightSparkActivity() (*HDInsightSparkActivity, bool) { + return nil, false +} + +// AsHDInsightStreamingActivity is the BasicActivity implementation for CustomActivity. +func (ca CustomActivity) AsHDInsightStreamingActivity() (*HDInsightStreamingActivity, bool) { + return nil, false +} + +// AsHDInsightMapReduceActivity is the BasicActivity implementation for CustomActivity. +func (ca CustomActivity) AsHDInsightMapReduceActivity() (*HDInsightMapReduceActivity, bool) { + return nil, false +} + +// AsHDInsightPigActivity is the BasicActivity implementation for CustomActivity. +func (ca CustomActivity) AsHDInsightPigActivity() (*HDInsightPigActivity, bool) { + return nil, false +} + +// AsHDInsightHiveActivity is the BasicActivity implementation for CustomActivity. +func (ca CustomActivity) AsHDInsightHiveActivity() (*HDInsightHiveActivity, bool) { + return nil, false +} + +// AsCopyActivity is the BasicActivity implementation for CustomActivity. +func (ca CustomActivity) AsCopyActivity() (*CopyActivity, bool) { + return nil, false +} + +// AsExecutionActivity is the BasicActivity implementation for CustomActivity. +func (ca CustomActivity) AsExecutionActivity() (*ExecutionActivity, bool) { + return nil, false +} + +// AsBasicExecutionActivity is the BasicActivity implementation for CustomActivity. +func (ca CustomActivity) AsBasicExecutionActivity() (BasicExecutionActivity, bool) { + return &ca, true +} + +// AsFilterActivity is the BasicActivity implementation for CustomActivity. +func (ca CustomActivity) AsFilterActivity() (*FilterActivity, bool) { + return nil, false +} + +// AsUntilActivity is the BasicActivity implementation for CustomActivity. +func (ca CustomActivity) AsUntilActivity() (*UntilActivity, bool) { + return nil, false +} + +// AsWaitActivity is the BasicActivity implementation for CustomActivity. +func (ca CustomActivity) AsWaitActivity() (*WaitActivity, bool) { + return nil, false +} + +// AsForEachActivity is the BasicActivity implementation for CustomActivity. +func (ca CustomActivity) AsForEachActivity() (*ForEachActivity, bool) { + return nil, false +} + +// AsIfConditionActivity is the BasicActivity implementation for CustomActivity. +func (ca CustomActivity) AsIfConditionActivity() (*IfConditionActivity, bool) { + return nil, false +} + +// AsExecutePipelineActivity is the BasicActivity implementation for CustomActivity. +func (ca CustomActivity) AsExecutePipelineActivity() (*ExecutePipelineActivity, bool) { + return nil, false +} + +// AsControlActivity is the BasicActivity implementation for CustomActivity. +func (ca CustomActivity) AsControlActivity() (*ControlActivity, bool) { + return nil, false +} + +// AsBasicControlActivity is the BasicActivity implementation for CustomActivity. +func (ca CustomActivity) AsBasicControlActivity() (BasicControlActivity, bool) { + return nil, false +} + +// AsActivity is the BasicActivity implementation for CustomActivity. +func (ca CustomActivity) AsActivity() (*Activity, bool) { + return nil, false +} + +// AsBasicActivity is the BasicActivity implementation for CustomActivity. +func (ca CustomActivity) AsBasicActivity() (BasicActivity, bool) { + return &ca, true +} + +// UnmarshalJSON is the custom unmarshaler for CustomActivity struct. +func (ca *CustomActivity) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "typeProperties": + if v != nil { + var customActivityTypeProperties CustomActivityTypeProperties + err = json.Unmarshal(*v, &customActivityTypeProperties) + if err != nil { + return err + } + ca.CustomActivityTypeProperties = &customActivityTypeProperties + } + case "linkedServiceName": + if v != nil { + var linkedServiceName LinkedServiceReference + err = json.Unmarshal(*v, &linkedServiceName) + if err != nil { + return err + } + ca.LinkedServiceName = &linkedServiceName + } + case "policy": + if v != nil { + var policy ActivityPolicy + err = json.Unmarshal(*v, &policy) + if err != nil { + return err + } + ca.Policy = &policy + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if ca.AdditionalProperties == nil { + ca.AdditionalProperties = make(map[string]interface{}) + } + ca.AdditionalProperties[k] = additionalProperties + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ca.Name = &name + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + ca.Description = &description + } + case "dependsOn": + if v != nil { + var dependsOn []ActivityDependency + err = json.Unmarshal(*v, &dependsOn) + if err != nil { + return err + } + ca.DependsOn = &dependsOn + } + case "userProperties": + if v != nil { + var userProperties map[string]*string + err = json.Unmarshal(*v, &userProperties) + if err != nil { + return err + } + ca.UserProperties = userProperties + } + case "type": + if v != nil { + var typeVar TypeBasicActivity + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ca.Type = typeVar + } + } + } + + return nil +} + +// CustomActivityReferenceObject reference objects for custom activity +type CustomActivityReferenceObject struct { + // LinkedServices - Linked service references. + LinkedServices *[]LinkedServiceReference `json:"linkedServices,omitempty"` + // Datasets - Dataset references. + Datasets *[]DatasetReference `json:"datasets,omitempty"` +} + +// CustomActivityTypeProperties custom activity properties. +type CustomActivityTypeProperties struct { + // Command - Command for custom activity Type: string (or Expression with resultType string). + Command interface{} `json:"command,omitempty"` + // ResourceLinkedService - Resource linked service reference. + ResourceLinkedService *LinkedServiceReference `json:"resourceLinkedService,omitempty"` + // FolderPath - Folder path for resource files Type: string (or Expression with resultType string). + FolderPath interface{} `json:"folderPath,omitempty"` + // ReferenceObjects - Reference objects + ReferenceObjects *CustomActivityReferenceObject `json:"referenceObjects,omitempty"` + // ExtendedProperties - User defined property bag. There is no restriction on the keys or values that can be used. The user specified custom activity has the full responsibility to consume and interpret the content defined. + ExtendedProperties map[string]interface{} `json:"extendedProperties"` +} + +// MarshalJSON is the custom marshaler for CustomActivityTypeProperties. +func (catp CustomActivityTypeProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["command"] = catp.Command + if catp.ResourceLinkedService != nil { + objectMap["resourceLinkedService"] = catp.ResourceLinkedService + } + objectMap["folderPath"] = catp.FolderPath + if catp.ReferenceObjects != nil { + objectMap["referenceObjects"] = catp.ReferenceObjects + } + if catp.ExtendedProperties != nil { + objectMap["extendedProperties"] = catp.ExtendedProperties + } + return json.Marshal(objectMap) +} + +// CustomDataset the custom dataset. +type CustomDataset struct { + // TypeProperties - Custom dataset properties. + TypeProperties interface{} `json:"typeProperties,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Description - Dataset description. + Description *string `json:"description,omitempty"` + // Structure - Columns that define the structure of the dataset. Type: array (or Expression with resultType array), itemType: DatasetDataElement. + Structure interface{} `json:"structure,omitempty"` + // LinkedServiceName - Linked service reference. + LinkedServiceName *LinkedServiceReference `json:"linkedServiceName,omitempty"` + // Parameters - Parameters for dataset. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeDataset', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSQLServerTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSalesforceObject', 'TypeRelationalTable', 'TypeAzureMySQLTable', 'TypeOracleTable', 'TypeODataResource', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeAzureDataLakeStoreFile', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeAmazonS3Object' + Type TypeBasicDataset `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for CustomDataset. +func (cd CustomDataset) MarshalJSON() ([]byte, error) { + cd.Type = TypeCustomDataset + objectMap := make(map[string]interface{}) + objectMap["typeProperties"] = cd.TypeProperties + if cd.Description != nil { + objectMap["description"] = cd.Description + } + objectMap["structure"] = cd.Structure + if cd.LinkedServiceName != nil { + objectMap["linkedServiceName"] = cd.LinkedServiceName + } + if cd.Parameters != nil { + objectMap["parameters"] = cd.Parameters + } + if cd.Annotations != nil { + objectMap["annotations"] = cd.Annotations + } + if cd.Type != "" { + objectMap["type"] = cd.Type + } + for k, v := range cd.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysObjectDataset is the BasicDataset implementation for CustomDataset. +func (cd CustomDataset) AsResponsysObjectDataset() (*ResponsysObjectDataset, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudObjectDataset is the BasicDataset implementation for CustomDataset. +func (cd CustomDataset) AsSalesforceMarketingCloudObjectDataset() (*SalesforceMarketingCloudObjectDataset, bool) { + return nil, false +} + +// AsVerticaTableDataset is the BasicDataset implementation for CustomDataset. +func (cd CustomDataset) AsVerticaTableDataset() (*VerticaTableDataset, bool) { + return nil, false +} + +// AsNetezzaTableDataset is the BasicDataset implementation for CustomDataset. +func (cd CustomDataset) AsNetezzaTableDataset() (*NetezzaTableDataset, bool) { + return nil, false +} + +// AsZohoObjectDataset is the BasicDataset implementation for CustomDataset. +func (cd CustomDataset) AsZohoObjectDataset() (*ZohoObjectDataset, bool) { + return nil, false +} + +// AsXeroObjectDataset is the BasicDataset implementation for CustomDataset. +func (cd CustomDataset) AsXeroObjectDataset() (*XeroObjectDataset, bool) { + return nil, false +} + +// AsSquareObjectDataset is the BasicDataset implementation for CustomDataset. +func (cd CustomDataset) AsSquareObjectDataset() (*SquareObjectDataset, bool) { + return nil, false +} + +// AsSparkObjectDataset is the BasicDataset implementation for CustomDataset. +func (cd CustomDataset) AsSparkObjectDataset() (*SparkObjectDataset, bool) { + return nil, false +} + +// AsShopifyObjectDataset is the BasicDataset implementation for CustomDataset. +func (cd CustomDataset) AsShopifyObjectDataset() (*ShopifyObjectDataset, bool) { + return nil, false +} + +// AsServiceNowObjectDataset is the BasicDataset implementation for CustomDataset. +func (cd CustomDataset) AsServiceNowObjectDataset() (*ServiceNowObjectDataset, bool) { + return nil, false +} + +// AsQuickBooksObjectDataset is the BasicDataset implementation for CustomDataset. +func (cd CustomDataset) AsQuickBooksObjectDataset() (*QuickBooksObjectDataset, bool) { + return nil, false +} + +// AsPrestoObjectDataset is the BasicDataset implementation for CustomDataset. +func (cd CustomDataset) AsPrestoObjectDataset() (*PrestoObjectDataset, bool) { + return nil, false +} + +// AsPhoenixObjectDataset is the BasicDataset implementation for CustomDataset. +func (cd CustomDataset) AsPhoenixObjectDataset() (*PhoenixObjectDataset, bool) { + return nil, false +} + +// AsPaypalObjectDataset is the BasicDataset implementation for CustomDataset. +func (cd CustomDataset) AsPaypalObjectDataset() (*PaypalObjectDataset, bool) { + return nil, false +} + +// AsMarketoObjectDataset is the BasicDataset implementation for CustomDataset. +func (cd CustomDataset) AsMarketoObjectDataset() (*MarketoObjectDataset, bool) { + return nil, false +} + +// AsMariaDBTableDataset is the BasicDataset implementation for CustomDataset. +func (cd CustomDataset) AsMariaDBTableDataset() (*MariaDBTableDataset, bool) { + return nil, false +} + +// AsMagentoObjectDataset is the BasicDataset implementation for CustomDataset. +func (cd CustomDataset) AsMagentoObjectDataset() (*MagentoObjectDataset, bool) { + return nil, false +} + +// AsJiraObjectDataset is the BasicDataset implementation for CustomDataset. +func (cd CustomDataset) AsJiraObjectDataset() (*JiraObjectDataset, bool) { + return nil, false +} + +// AsImpalaObjectDataset is the BasicDataset implementation for CustomDataset. +func (cd CustomDataset) AsImpalaObjectDataset() (*ImpalaObjectDataset, bool) { + return nil, false +} + +// AsHubspotObjectDataset is the BasicDataset implementation for CustomDataset. +func (cd CustomDataset) AsHubspotObjectDataset() (*HubspotObjectDataset, bool) { + return nil, false +} + +// AsHiveObjectDataset is the BasicDataset implementation for CustomDataset. +func (cd CustomDataset) AsHiveObjectDataset() (*HiveObjectDataset, bool) { + return nil, false +} + +// AsHBaseObjectDataset is the BasicDataset implementation for CustomDataset. +func (cd CustomDataset) AsHBaseObjectDataset() (*HBaseObjectDataset, bool) { + return nil, false +} + +// AsGreenplumTableDataset is the BasicDataset implementation for CustomDataset. +func (cd CustomDataset) AsGreenplumTableDataset() (*GreenplumTableDataset, bool) { + return nil, false +} + +// AsGoogleBigQueryObjectDataset is the BasicDataset implementation for CustomDataset. +func (cd CustomDataset) AsGoogleBigQueryObjectDataset() (*GoogleBigQueryObjectDataset, bool) { + return nil, false +} + +// AsEloquaObjectDataset is the BasicDataset implementation for CustomDataset. +func (cd CustomDataset) AsEloquaObjectDataset() (*EloquaObjectDataset, bool) { + return nil, false +} + +// AsDrillTableDataset is the BasicDataset implementation for CustomDataset. +func (cd CustomDataset) AsDrillTableDataset() (*DrillTableDataset, bool) { + return nil, false +} + +// AsCouchbaseTableDataset is the BasicDataset implementation for CustomDataset. +func (cd CustomDataset) AsCouchbaseTableDataset() (*CouchbaseTableDataset, bool) { + return nil, false +} + +// AsConcurObjectDataset is the BasicDataset implementation for CustomDataset. +func (cd CustomDataset) AsConcurObjectDataset() (*ConcurObjectDataset, bool) { + return nil, false +} + +// AsAzurePostgreSQLTableDataset is the BasicDataset implementation for CustomDataset. +func (cd CustomDataset) AsAzurePostgreSQLTableDataset() (*AzurePostgreSQLTableDataset, bool) { + return nil, false +} + +// AsAmazonMWSObjectDataset is the BasicDataset implementation for CustomDataset. +func (cd CustomDataset) AsAmazonMWSObjectDataset() (*AmazonMWSObjectDataset, bool) { + return nil, false +} + +// AsHTTPDataset is the BasicDataset implementation for CustomDataset. +func (cd CustomDataset) AsHTTPDataset() (*HTTPDataset, bool) { + return nil, false +} + +// AsAzureSearchIndexDataset is the BasicDataset implementation for CustomDataset. +func (cd CustomDataset) AsAzureSearchIndexDataset() (*AzureSearchIndexDataset, bool) { + return nil, false +} + +// AsWebTableDataset is the BasicDataset implementation for CustomDataset. +func (cd CustomDataset) AsWebTableDataset() (*WebTableDataset, bool) { + return nil, false +} + +// AsSQLServerTableDataset is the BasicDataset implementation for CustomDataset. +func (cd CustomDataset) AsSQLServerTableDataset() (*SQLServerTableDataset, bool) { + return nil, false +} + +// AsSapEccResourceDataset is the BasicDataset implementation for CustomDataset. +func (cd CustomDataset) AsSapEccResourceDataset() (*SapEccResourceDataset, bool) { + return nil, false +} + +// AsSapCloudForCustomerResourceDataset is the BasicDataset implementation for CustomDataset. +func (cd CustomDataset) AsSapCloudForCustomerResourceDataset() (*SapCloudForCustomerResourceDataset, bool) { + return nil, false +} + +// AsSalesforceObjectDataset is the BasicDataset implementation for CustomDataset. +func (cd CustomDataset) AsSalesforceObjectDataset() (*SalesforceObjectDataset, bool) { + return nil, false +} + +// AsRelationalTableDataset is the BasicDataset implementation for CustomDataset. +func (cd CustomDataset) AsRelationalTableDataset() (*RelationalTableDataset, bool) { + return nil, false +} + +// AsAzureMySQLTableDataset is the BasicDataset implementation for CustomDataset. +func (cd CustomDataset) AsAzureMySQLTableDataset() (*AzureMySQLTableDataset, bool) { + return nil, false +} + +// AsOracleTableDataset is the BasicDataset implementation for CustomDataset. +func (cd CustomDataset) AsOracleTableDataset() (*OracleTableDataset, bool) { + return nil, false +} + +// AsODataResourceDataset is the BasicDataset implementation for CustomDataset. +func (cd CustomDataset) AsODataResourceDataset() (*ODataResourceDataset, bool) { + return nil, false +} + +// AsMongoDbCollectionDataset is the BasicDataset implementation for CustomDataset. +func (cd CustomDataset) AsMongoDbCollectionDataset() (*MongoDbCollectionDataset, bool) { + return nil, false +} + +// AsFileShareDataset is the BasicDataset implementation for CustomDataset. +func (cd CustomDataset) AsFileShareDataset() (*FileShareDataset, bool) { + return nil, false +} + +// AsAzureDataLakeStoreDataset is the BasicDataset implementation for CustomDataset. +func (cd CustomDataset) AsAzureDataLakeStoreDataset() (*AzureDataLakeStoreDataset, bool) { + return nil, false +} + +// AsDynamicsEntityDataset is the BasicDataset implementation for CustomDataset. +func (cd CustomDataset) AsDynamicsEntityDataset() (*DynamicsEntityDataset, bool) { + return nil, false +} + +// AsDocumentDbCollectionDataset is the BasicDataset implementation for CustomDataset. +func (cd CustomDataset) AsDocumentDbCollectionDataset() (*DocumentDbCollectionDataset, bool) { + return nil, false +} + +// AsCustomDataset is the BasicDataset implementation for CustomDataset. +func (cd CustomDataset) AsCustomDataset() (*CustomDataset, bool) { + return &cd, true +} + +// AsCassandraTableDataset is the BasicDataset implementation for CustomDataset. +func (cd CustomDataset) AsCassandraTableDataset() (*CassandraTableDataset, bool) { + return nil, false +} + +// AsAzureSQLDWTableDataset is the BasicDataset implementation for CustomDataset. +func (cd CustomDataset) AsAzureSQLDWTableDataset() (*AzureSQLDWTableDataset, bool) { + return nil, false +} + +// AsAzureSQLTableDataset is the BasicDataset implementation for CustomDataset. +func (cd CustomDataset) AsAzureSQLTableDataset() (*AzureSQLTableDataset, bool) { + return nil, false +} + +// AsAzureTableDataset is the BasicDataset implementation for CustomDataset. +func (cd CustomDataset) AsAzureTableDataset() (*AzureTableDataset, bool) { + return nil, false +} + +// AsAzureBlobDataset is the BasicDataset implementation for CustomDataset. +func (cd CustomDataset) AsAzureBlobDataset() (*AzureBlobDataset, bool) { + return nil, false +} + +// AsAmazonS3Dataset is the BasicDataset implementation for CustomDataset. +func (cd CustomDataset) AsAmazonS3Dataset() (*AmazonS3Dataset, bool) { + return nil, false +} + +// AsDataset is the BasicDataset implementation for CustomDataset. +func (cd CustomDataset) AsDataset() (*Dataset, bool) { + return nil, false +} + +// AsBasicDataset is the BasicDataset implementation for CustomDataset. +func (cd CustomDataset) AsBasicDataset() (BasicDataset, bool) { + return &cd, true +} + +// CustomDataSourceLinkedService custom linked service. +type CustomDataSourceLinkedService struct { + // TypeProperties - Custom linked service properties. + TypeProperties interface{} `json:"typeProperties,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // ConnectVia - The integration runtime reference. + ConnectVia *IntegrationRuntimeReference `json:"connectVia,omitempty"` + // Description - Linked service description. + Description *string `json:"description,omitempty"` + // Parameters - Parameters for linked service. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeLinkedService', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforce', 'TypeAzureDataLakeStore', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureStorage' + Type TypeBasicLinkedService `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for CustomDataSourceLinkedService. +func (cdsls CustomDataSourceLinkedService) MarshalJSON() ([]byte, error) { + cdsls.Type = TypeCustomDataSource + objectMap := make(map[string]interface{}) + objectMap["typeProperties"] = cdsls.TypeProperties + if cdsls.ConnectVia != nil { + objectMap["connectVia"] = cdsls.ConnectVia + } + if cdsls.Description != nil { + objectMap["description"] = cdsls.Description + } + if cdsls.Parameters != nil { + objectMap["parameters"] = cdsls.Parameters + } + if cdsls.Annotations != nil { + objectMap["annotations"] = cdsls.Annotations + } + if cdsls.Type != "" { + objectMap["type"] = cdsls.Type + } + for k, v := range cdsls.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysLinkedService is the BasicLinkedService implementation for CustomDataSourceLinkedService. +func (cdsls CustomDataSourceLinkedService) AsResponsysLinkedService() (*ResponsysLinkedService, bool) { + return nil, false +} + +// AsAzureDatabricksLinkedService is the BasicLinkedService implementation for CustomDataSourceLinkedService. +func (cdsls CustomDataSourceLinkedService) AsAzureDatabricksLinkedService() (*AzureDatabricksLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeAnalyticsLinkedService is the BasicLinkedService implementation for CustomDataSourceLinkedService. +func (cdsls CustomDataSourceLinkedService) AsAzureDataLakeAnalyticsLinkedService() (*AzureDataLakeAnalyticsLinkedService, bool) { + return nil, false +} + +// AsHDInsightOnDemandLinkedService is the BasicLinkedService implementation for CustomDataSourceLinkedService. +func (cdsls CustomDataSourceLinkedService) AsHDInsightOnDemandLinkedService() (*HDInsightOnDemandLinkedService, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudLinkedService is the BasicLinkedService implementation for CustomDataSourceLinkedService. +func (cdsls CustomDataSourceLinkedService) AsSalesforceMarketingCloudLinkedService() (*SalesforceMarketingCloudLinkedService, bool) { + return nil, false +} + +// AsNetezzaLinkedService is the BasicLinkedService implementation for CustomDataSourceLinkedService. +func (cdsls CustomDataSourceLinkedService) AsNetezzaLinkedService() (*NetezzaLinkedService, bool) { + return nil, false +} + +// AsVerticaLinkedService is the BasicLinkedService implementation for CustomDataSourceLinkedService. +func (cdsls CustomDataSourceLinkedService) AsVerticaLinkedService() (*VerticaLinkedService, bool) { + return nil, false +} + +// AsZohoLinkedService is the BasicLinkedService implementation for CustomDataSourceLinkedService. +func (cdsls CustomDataSourceLinkedService) AsZohoLinkedService() (*ZohoLinkedService, bool) { + return nil, false +} + +// AsXeroLinkedService is the BasicLinkedService implementation for CustomDataSourceLinkedService. +func (cdsls CustomDataSourceLinkedService) AsXeroLinkedService() (*XeroLinkedService, bool) { + return nil, false +} + +// AsSquareLinkedService is the BasicLinkedService implementation for CustomDataSourceLinkedService. +func (cdsls CustomDataSourceLinkedService) AsSquareLinkedService() (*SquareLinkedService, bool) { + return nil, false +} + +// AsSparkLinkedService is the BasicLinkedService implementation for CustomDataSourceLinkedService. +func (cdsls CustomDataSourceLinkedService) AsSparkLinkedService() (*SparkLinkedService, bool) { + return nil, false +} + +// AsShopifyLinkedService is the BasicLinkedService implementation for CustomDataSourceLinkedService. +func (cdsls CustomDataSourceLinkedService) AsShopifyLinkedService() (*ShopifyLinkedService, bool) { + return nil, false +} + +// AsServiceNowLinkedService is the BasicLinkedService implementation for CustomDataSourceLinkedService. +func (cdsls CustomDataSourceLinkedService) AsServiceNowLinkedService() (*ServiceNowLinkedService, bool) { + return nil, false +} + +// AsQuickBooksLinkedService is the BasicLinkedService implementation for CustomDataSourceLinkedService. +func (cdsls CustomDataSourceLinkedService) AsQuickBooksLinkedService() (*QuickBooksLinkedService, bool) { + return nil, false +} + +// AsPrestoLinkedService is the BasicLinkedService implementation for CustomDataSourceLinkedService. +func (cdsls CustomDataSourceLinkedService) AsPrestoLinkedService() (*PrestoLinkedService, bool) { + return nil, false +} + +// AsPhoenixLinkedService is the BasicLinkedService implementation for CustomDataSourceLinkedService. +func (cdsls CustomDataSourceLinkedService) AsPhoenixLinkedService() (*PhoenixLinkedService, bool) { + return nil, false +} + +// AsPaypalLinkedService is the BasicLinkedService implementation for CustomDataSourceLinkedService. +func (cdsls CustomDataSourceLinkedService) AsPaypalLinkedService() (*PaypalLinkedService, bool) { + return nil, false +} + +// AsMarketoLinkedService is the BasicLinkedService implementation for CustomDataSourceLinkedService. +func (cdsls CustomDataSourceLinkedService) AsMarketoLinkedService() (*MarketoLinkedService, bool) { + return nil, false +} + +// AsMariaDBLinkedService is the BasicLinkedService implementation for CustomDataSourceLinkedService. +func (cdsls CustomDataSourceLinkedService) AsMariaDBLinkedService() (*MariaDBLinkedService, bool) { + return nil, false +} + +// AsMagentoLinkedService is the BasicLinkedService implementation for CustomDataSourceLinkedService. +func (cdsls CustomDataSourceLinkedService) AsMagentoLinkedService() (*MagentoLinkedService, bool) { + return nil, false +} + +// AsJiraLinkedService is the BasicLinkedService implementation for CustomDataSourceLinkedService. +func (cdsls CustomDataSourceLinkedService) AsJiraLinkedService() (*JiraLinkedService, bool) { + return nil, false +} + +// AsImpalaLinkedService is the BasicLinkedService implementation for CustomDataSourceLinkedService. +func (cdsls CustomDataSourceLinkedService) AsImpalaLinkedService() (*ImpalaLinkedService, bool) { + return nil, false +} + +// AsHubspotLinkedService is the BasicLinkedService implementation for CustomDataSourceLinkedService. +func (cdsls CustomDataSourceLinkedService) AsHubspotLinkedService() (*HubspotLinkedService, bool) { + return nil, false +} + +// AsHiveLinkedService is the BasicLinkedService implementation for CustomDataSourceLinkedService. +func (cdsls CustomDataSourceLinkedService) AsHiveLinkedService() (*HiveLinkedService, bool) { + return nil, false +} + +// AsHBaseLinkedService is the BasicLinkedService implementation for CustomDataSourceLinkedService. +func (cdsls CustomDataSourceLinkedService) AsHBaseLinkedService() (*HBaseLinkedService, bool) { + return nil, false +} + +// AsGreenplumLinkedService is the BasicLinkedService implementation for CustomDataSourceLinkedService. +func (cdsls CustomDataSourceLinkedService) AsGreenplumLinkedService() (*GreenplumLinkedService, bool) { + return nil, false +} + +// AsGoogleBigQueryLinkedService is the BasicLinkedService implementation for CustomDataSourceLinkedService. +func (cdsls CustomDataSourceLinkedService) AsGoogleBigQueryLinkedService() (*GoogleBigQueryLinkedService, bool) { + return nil, false +} + +// AsEloquaLinkedService is the BasicLinkedService implementation for CustomDataSourceLinkedService. +func (cdsls CustomDataSourceLinkedService) AsEloquaLinkedService() (*EloquaLinkedService, bool) { + return nil, false +} + +// AsDrillLinkedService is the BasicLinkedService implementation for CustomDataSourceLinkedService. +func (cdsls CustomDataSourceLinkedService) AsDrillLinkedService() (*DrillLinkedService, bool) { + return nil, false +} + +// AsCouchbaseLinkedService is the BasicLinkedService implementation for CustomDataSourceLinkedService. +func (cdsls CustomDataSourceLinkedService) AsCouchbaseLinkedService() (*CouchbaseLinkedService, bool) { + return nil, false +} + +// AsConcurLinkedService is the BasicLinkedService implementation for CustomDataSourceLinkedService. +func (cdsls CustomDataSourceLinkedService) AsConcurLinkedService() (*ConcurLinkedService, bool) { + return nil, false +} + +// AsAzurePostgreSQLLinkedService is the BasicLinkedService implementation for CustomDataSourceLinkedService. +func (cdsls CustomDataSourceLinkedService) AsAzurePostgreSQLLinkedService() (*AzurePostgreSQLLinkedService, bool) { + return nil, false +} + +// AsAmazonMWSLinkedService is the BasicLinkedService implementation for CustomDataSourceLinkedService. +func (cdsls CustomDataSourceLinkedService) AsAmazonMWSLinkedService() (*AmazonMWSLinkedService, bool) { + return nil, false +} + +// AsSapHanaLinkedService is the BasicLinkedService implementation for CustomDataSourceLinkedService. +func (cdsls CustomDataSourceLinkedService) AsSapHanaLinkedService() (*SapHanaLinkedService, bool) { + return nil, false +} + +// AsSapBWLinkedService is the BasicLinkedService implementation for CustomDataSourceLinkedService. +func (cdsls CustomDataSourceLinkedService) AsSapBWLinkedService() (*SapBWLinkedService, bool) { + return nil, false +} + +// AsSftpServerLinkedService is the BasicLinkedService implementation for CustomDataSourceLinkedService. +func (cdsls CustomDataSourceLinkedService) AsSftpServerLinkedService() (*SftpServerLinkedService, bool) { + return nil, false +} + +// AsFtpServerLinkedService is the BasicLinkedService implementation for CustomDataSourceLinkedService. +func (cdsls CustomDataSourceLinkedService) AsFtpServerLinkedService() (*FtpServerLinkedService, bool) { + return nil, false +} + +// AsHTTPLinkedService is the BasicLinkedService implementation for CustomDataSourceLinkedService. +func (cdsls CustomDataSourceLinkedService) AsHTTPLinkedService() (*HTTPLinkedService, bool) { + return nil, false +} + +// AsAzureSearchLinkedService is the BasicLinkedService implementation for CustomDataSourceLinkedService. +func (cdsls CustomDataSourceLinkedService) AsAzureSearchLinkedService() (*AzureSearchLinkedService, bool) { + return nil, false +} + +// AsCustomDataSourceLinkedService is the BasicLinkedService implementation for CustomDataSourceLinkedService. +func (cdsls CustomDataSourceLinkedService) AsCustomDataSourceLinkedService() (*CustomDataSourceLinkedService, bool) { + return &cdsls, true +} + +// AsAmazonRedshiftLinkedService is the BasicLinkedService implementation for CustomDataSourceLinkedService. +func (cdsls CustomDataSourceLinkedService) AsAmazonRedshiftLinkedService() (*AmazonRedshiftLinkedService, bool) { + return nil, false +} + +// AsAmazonS3LinkedService is the BasicLinkedService implementation for CustomDataSourceLinkedService. +func (cdsls CustomDataSourceLinkedService) AsAmazonS3LinkedService() (*AmazonS3LinkedService, bool) { + return nil, false +} + +// AsSapEccLinkedService is the BasicLinkedService implementation for CustomDataSourceLinkedService. +func (cdsls CustomDataSourceLinkedService) AsSapEccLinkedService() (*SapEccLinkedService, bool) { + return nil, false +} + +// AsSapCloudForCustomerLinkedService is the BasicLinkedService implementation for CustomDataSourceLinkedService. +func (cdsls CustomDataSourceLinkedService) AsSapCloudForCustomerLinkedService() (*SapCloudForCustomerLinkedService, bool) { + return nil, false +} + +// AsSalesforceLinkedService is the BasicLinkedService implementation for CustomDataSourceLinkedService. +func (cdsls CustomDataSourceLinkedService) AsSalesforceLinkedService() (*SalesforceLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeStoreLinkedService is the BasicLinkedService implementation for CustomDataSourceLinkedService. +func (cdsls CustomDataSourceLinkedService) AsAzureDataLakeStoreLinkedService() (*AzureDataLakeStoreLinkedService, bool) { + return nil, false +} + +// AsMongoDbLinkedService is the BasicLinkedService implementation for CustomDataSourceLinkedService. +func (cdsls CustomDataSourceLinkedService) AsMongoDbLinkedService() (*MongoDbLinkedService, bool) { + return nil, false +} + +// AsCassandraLinkedService is the BasicLinkedService implementation for CustomDataSourceLinkedService. +func (cdsls CustomDataSourceLinkedService) AsCassandraLinkedService() (*CassandraLinkedService, bool) { + return nil, false +} + +// AsWebLinkedService is the BasicLinkedService implementation for CustomDataSourceLinkedService. +func (cdsls CustomDataSourceLinkedService) AsWebLinkedService() (*WebLinkedService, bool) { + return nil, false +} + +// AsODataLinkedService is the BasicLinkedService implementation for CustomDataSourceLinkedService. +func (cdsls CustomDataSourceLinkedService) AsODataLinkedService() (*ODataLinkedService, bool) { + return nil, false +} + +// AsHdfsLinkedService is the BasicLinkedService implementation for CustomDataSourceLinkedService. +func (cdsls CustomDataSourceLinkedService) AsHdfsLinkedService() (*HdfsLinkedService, bool) { + return nil, false +} + +// AsOdbcLinkedService is the BasicLinkedService implementation for CustomDataSourceLinkedService. +func (cdsls CustomDataSourceLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, bool) { + return nil, false +} + +// AsAzureMLLinkedService is the BasicLinkedService implementation for CustomDataSourceLinkedService. +func (cdsls CustomDataSourceLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { + return nil, false +} + +// AsTeradataLinkedService is the BasicLinkedService implementation for CustomDataSourceLinkedService. +func (cdsls CustomDataSourceLinkedService) AsTeradataLinkedService() (*TeradataLinkedService, bool) { + return nil, false +} + +// AsDb2LinkedService is the BasicLinkedService implementation for CustomDataSourceLinkedService. +func (cdsls CustomDataSourceLinkedService) AsDb2LinkedService() (*Db2LinkedService, bool) { + return nil, false +} + +// AsSybaseLinkedService is the BasicLinkedService implementation for CustomDataSourceLinkedService. +func (cdsls CustomDataSourceLinkedService) AsSybaseLinkedService() (*SybaseLinkedService, bool) { + return nil, false +} + +// AsPostgreSQLLinkedService is the BasicLinkedService implementation for CustomDataSourceLinkedService. +func (cdsls CustomDataSourceLinkedService) AsPostgreSQLLinkedService() (*PostgreSQLLinkedService, bool) { + return nil, false +} + +// AsMySQLLinkedService is the BasicLinkedService implementation for CustomDataSourceLinkedService. +func (cdsls CustomDataSourceLinkedService) AsMySQLLinkedService() (*MySQLLinkedService, bool) { + return nil, false +} + +// AsAzureMySQLLinkedService is the BasicLinkedService implementation for CustomDataSourceLinkedService. +func (cdsls CustomDataSourceLinkedService) AsAzureMySQLLinkedService() (*AzureMySQLLinkedService, bool) { + return nil, false +} + +// AsOracleLinkedService is the BasicLinkedService implementation for CustomDataSourceLinkedService. +func (cdsls CustomDataSourceLinkedService) AsOracleLinkedService() (*OracleLinkedService, bool) { + return nil, false +} + +// AsFileServerLinkedService is the BasicLinkedService implementation for CustomDataSourceLinkedService. +func (cdsls CustomDataSourceLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { + return nil, false +} + +// AsHDInsightLinkedService is the BasicLinkedService implementation for CustomDataSourceLinkedService. +func (cdsls CustomDataSourceLinkedService) AsHDInsightLinkedService() (*HDInsightLinkedService, bool) { + return nil, false +} + +// AsDynamicsLinkedService is the BasicLinkedService implementation for CustomDataSourceLinkedService. +func (cdsls CustomDataSourceLinkedService) AsDynamicsLinkedService() (*DynamicsLinkedService, bool) { + return nil, false +} + +// AsCosmosDbLinkedService is the BasicLinkedService implementation for CustomDataSourceLinkedService. +func (cdsls CustomDataSourceLinkedService) AsCosmosDbLinkedService() (*CosmosDbLinkedService, bool) { + return nil, false +} + +// AsAzureKeyVaultLinkedService is the BasicLinkedService implementation for CustomDataSourceLinkedService. +func (cdsls CustomDataSourceLinkedService) AsAzureKeyVaultLinkedService() (*AzureKeyVaultLinkedService, bool) { + return nil, false +} + +// AsAzureBatchLinkedService is the BasicLinkedService implementation for CustomDataSourceLinkedService. +func (cdsls CustomDataSourceLinkedService) AsAzureBatchLinkedService() (*AzureBatchLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDatabaseLinkedService is the BasicLinkedService implementation for CustomDataSourceLinkedService. +func (cdsls CustomDataSourceLinkedService) AsAzureSQLDatabaseLinkedService() (*AzureSQLDatabaseLinkedService, bool) { + return nil, false +} + +// AsSQLServerLinkedService is the BasicLinkedService implementation for CustomDataSourceLinkedService. +func (cdsls CustomDataSourceLinkedService) AsSQLServerLinkedService() (*SQLServerLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDWLinkedService is the BasicLinkedService implementation for CustomDataSourceLinkedService. +func (cdsls CustomDataSourceLinkedService) AsAzureSQLDWLinkedService() (*AzureSQLDWLinkedService, bool) { + return nil, false +} + +// AsAzureStorageLinkedService is the BasicLinkedService implementation for CustomDataSourceLinkedService. +func (cdsls CustomDataSourceLinkedService) AsAzureStorageLinkedService() (*AzureStorageLinkedService, bool) { + return nil, false +} + +// AsLinkedService is the BasicLinkedService implementation for CustomDataSourceLinkedService. +func (cdsls CustomDataSourceLinkedService) AsLinkedService() (*LinkedService, bool) { + return nil, false +} + +// AsBasicLinkedService is the BasicLinkedService implementation for CustomDataSourceLinkedService. +func (cdsls CustomDataSourceLinkedService) AsBasicLinkedService() (BasicLinkedService, bool) { + return &cdsls, true +} + +// DatabricksNotebookActivity databricksNotebook activity. +type DatabricksNotebookActivity struct { + // DatabricksNotebookActivityTypeProperties - Databricks Notebook activity properties. + *DatabricksNotebookActivityTypeProperties `json:"typeProperties,omitempty"` + // LinkedServiceName - Linked service reference. + LinkedServiceName *LinkedServiceReference `json:"linkedServiceName,omitempty"` + // Policy - Activity policy. + Policy *ActivityPolicy `json:"policy,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Name - Activity name. + Name *string `json:"name,omitempty"` + // Description - Activity description. + Description *string `json:"description,omitempty"` + // DependsOn - Activity depends on condition. + DependsOn *[]ActivityDependency `json:"dependsOn,omitempty"` + // UserProperties - Activity user properties. + UserProperties map[string]*string `json:"userProperties"` + // Type - Possible values include: 'TypeActivity', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLUpdateResource', 'TypeAzureMLBatchExecution', 'TypeGetMetadata', 'TypeWebActivity', 'TypeLookup', 'TypeSQLServerStoredProcedure', 'TypeCustom', 'TypeExecuteSSISPackage', 'TypeHDInsightSpark', 'TypeHDInsightStreaming', 'TypeHDInsightMapReduce', 'TypeHDInsightPig', 'TypeHDInsightHive', 'TypeCopy', 'TypeExecution', 'TypeFilter', 'TypeUntil', 'TypeWait', 'TypeForEach', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' + Type TypeBasicActivity `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for DatabricksNotebookActivity. +func (dna DatabricksNotebookActivity) MarshalJSON() ([]byte, error) { + dna.Type = TypeDatabricksNotebook + objectMap := make(map[string]interface{}) + if dna.DatabricksNotebookActivityTypeProperties != nil { + objectMap["typeProperties"] = dna.DatabricksNotebookActivityTypeProperties + } + if dna.LinkedServiceName != nil { + objectMap["linkedServiceName"] = dna.LinkedServiceName + } + if dna.Policy != nil { + objectMap["policy"] = dna.Policy + } + if dna.Name != nil { + objectMap["name"] = dna.Name + } + if dna.Description != nil { + objectMap["description"] = dna.Description + } + if dna.DependsOn != nil { + objectMap["dependsOn"] = dna.DependsOn + } + if dna.UserProperties != nil { + objectMap["userProperties"] = dna.UserProperties + } + if dna.Type != "" { + objectMap["type"] = dna.Type + } + for k, v := range dna.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsDatabricksNotebookActivity is the BasicActivity implementation for DatabricksNotebookActivity. +func (dna DatabricksNotebookActivity) AsDatabricksNotebookActivity() (*DatabricksNotebookActivity, bool) { + return &dna, true +} + +// AsDataLakeAnalyticsUSQLActivity is the BasicActivity implementation for DatabricksNotebookActivity. +func (dna DatabricksNotebookActivity) AsDataLakeAnalyticsUSQLActivity() (*DataLakeAnalyticsUSQLActivity, bool) { + return nil, false +} + +// AsAzureMLUpdateResourceActivity is the BasicActivity implementation for DatabricksNotebookActivity. +func (dna DatabricksNotebookActivity) AsAzureMLUpdateResourceActivity() (*AzureMLUpdateResourceActivity, bool) { + return nil, false +} + +// AsAzureMLBatchExecutionActivity is the BasicActivity implementation for DatabricksNotebookActivity. +func (dna DatabricksNotebookActivity) AsAzureMLBatchExecutionActivity() (*AzureMLBatchExecutionActivity, bool) { + return nil, false +} + +// AsGetMetadataActivity is the BasicActivity implementation for DatabricksNotebookActivity. +func (dna DatabricksNotebookActivity) AsGetMetadataActivity() (*GetMetadataActivity, bool) { + return nil, false +} + +// AsWebActivity is the BasicActivity implementation for DatabricksNotebookActivity. +func (dna DatabricksNotebookActivity) AsWebActivity() (*WebActivity, bool) { + return nil, false +} + +// AsLookupActivity is the BasicActivity implementation for DatabricksNotebookActivity. +func (dna DatabricksNotebookActivity) AsLookupActivity() (*LookupActivity, bool) { + return nil, false +} + +// AsSQLServerStoredProcedureActivity is the BasicActivity implementation for DatabricksNotebookActivity. +func (dna DatabricksNotebookActivity) AsSQLServerStoredProcedureActivity() (*SQLServerStoredProcedureActivity, bool) { + return nil, false +} + +// AsCustomActivity is the BasicActivity implementation for DatabricksNotebookActivity. +func (dna DatabricksNotebookActivity) AsCustomActivity() (*CustomActivity, bool) { + return nil, false +} + +// AsExecuteSSISPackageActivity is the BasicActivity implementation for DatabricksNotebookActivity. +func (dna DatabricksNotebookActivity) AsExecuteSSISPackageActivity() (*ExecuteSSISPackageActivity, bool) { + return nil, false +} + +// AsHDInsightSparkActivity is the BasicActivity implementation for DatabricksNotebookActivity. +func (dna DatabricksNotebookActivity) AsHDInsightSparkActivity() (*HDInsightSparkActivity, bool) { + return nil, false +} + +// AsHDInsightStreamingActivity is the BasicActivity implementation for DatabricksNotebookActivity. +func (dna DatabricksNotebookActivity) AsHDInsightStreamingActivity() (*HDInsightStreamingActivity, bool) { + return nil, false +} + +// AsHDInsightMapReduceActivity is the BasicActivity implementation for DatabricksNotebookActivity. +func (dna DatabricksNotebookActivity) AsHDInsightMapReduceActivity() (*HDInsightMapReduceActivity, bool) { + return nil, false +} + +// AsHDInsightPigActivity is the BasicActivity implementation for DatabricksNotebookActivity. +func (dna DatabricksNotebookActivity) AsHDInsightPigActivity() (*HDInsightPigActivity, bool) { + return nil, false +} + +// AsHDInsightHiveActivity is the BasicActivity implementation for DatabricksNotebookActivity. +func (dna DatabricksNotebookActivity) AsHDInsightHiveActivity() (*HDInsightHiveActivity, bool) { + return nil, false +} + +// AsCopyActivity is the BasicActivity implementation for DatabricksNotebookActivity. +func (dna DatabricksNotebookActivity) AsCopyActivity() (*CopyActivity, bool) { + return nil, false +} + +// AsExecutionActivity is the BasicActivity implementation for DatabricksNotebookActivity. +func (dna DatabricksNotebookActivity) AsExecutionActivity() (*ExecutionActivity, bool) { + return nil, false +} + +// AsBasicExecutionActivity is the BasicActivity implementation for DatabricksNotebookActivity. +func (dna DatabricksNotebookActivity) AsBasicExecutionActivity() (BasicExecutionActivity, bool) { + return &dna, true +} + +// AsFilterActivity is the BasicActivity implementation for DatabricksNotebookActivity. +func (dna DatabricksNotebookActivity) AsFilterActivity() (*FilterActivity, bool) { + return nil, false +} + +// AsUntilActivity is the BasicActivity implementation for DatabricksNotebookActivity. +func (dna DatabricksNotebookActivity) AsUntilActivity() (*UntilActivity, bool) { + return nil, false +} + +// AsWaitActivity is the BasicActivity implementation for DatabricksNotebookActivity. +func (dna DatabricksNotebookActivity) AsWaitActivity() (*WaitActivity, bool) { + return nil, false +} + +// AsForEachActivity is the BasicActivity implementation for DatabricksNotebookActivity. +func (dna DatabricksNotebookActivity) AsForEachActivity() (*ForEachActivity, bool) { + return nil, false +} + +// AsIfConditionActivity is the BasicActivity implementation for DatabricksNotebookActivity. +func (dna DatabricksNotebookActivity) AsIfConditionActivity() (*IfConditionActivity, bool) { + return nil, false +} + +// AsExecutePipelineActivity is the BasicActivity implementation for DatabricksNotebookActivity. +func (dna DatabricksNotebookActivity) AsExecutePipelineActivity() (*ExecutePipelineActivity, bool) { + return nil, false +} + +// AsControlActivity is the BasicActivity implementation for DatabricksNotebookActivity. +func (dna DatabricksNotebookActivity) AsControlActivity() (*ControlActivity, bool) { + return nil, false +} + +// AsBasicControlActivity is the BasicActivity implementation for DatabricksNotebookActivity. +func (dna DatabricksNotebookActivity) AsBasicControlActivity() (BasicControlActivity, bool) { + return nil, false +} + +// AsActivity is the BasicActivity implementation for DatabricksNotebookActivity. +func (dna DatabricksNotebookActivity) AsActivity() (*Activity, bool) { + return nil, false +} + +// AsBasicActivity is the BasicActivity implementation for DatabricksNotebookActivity. +func (dna DatabricksNotebookActivity) AsBasicActivity() (BasicActivity, bool) { + return &dna, true +} + +// UnmarshalJSON is the custom unmarshaler for DatabricksNotebookActivity struct. +func (dna *DatabricksNotebookActivity) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "typeProperties": + if v != nil { + var databricksNotebookActivityTypeProperties DatabricksNotebookActivityTypeProperties + err = json.Unmarshal(*v, &databricksNotebookActivityTypeProperties) + if err != nil { + return err + } + dna.DatabricksNotebookActivityTypeProperties = &databricksNotebookActivityTypeProperties + } + case "linkedServiceName": + if v != nil { + var linkedServiceName LinkedServiceReference + err = json.Unmarshal(*v, &linkedServiceName) + if err != nil { + return err + } + dna.LinkedServiceName = &linkedServiceName + } + case "policy": + if v != nil { + var policy ActivityPolicy + err = json.Unmarshal(*v, &policy) + if err != nil { + return err + } + dna.Policy = &policy + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if dna.AdditionalProperties == nil { + dna.AdditionalProperties = make(map[string]interface{}) + } + dna.AdditionalProperties[k] = additionalProperties + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + dna.Name = &name + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + dna.Description = &description + } + case "dependsOn": + if v != nil { + var dependsOn []ActivityDependency + err = json.Unmarshal(*v, &dependsOn) + if err != nil { + return err + } + dna.DependsOn = &dependsOn + } + case "userProperties": + if v != nil { + var userProperties map[string]*string + err = json.Unmarshal(*v, &userProperties) + if err != nil { + return err + } + dna.UserProperties = userProperties + } + case "type": + if v != nil { + var typeVar TypeBasicActivity + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + dna.Type = typeVar + } + } + } + + return nil +} + +// DatabricksNotebookActivityTypeProperties databricks Notebook activity properties. +type DatabricksNotebookActivityTypeProperties struct { + // NotebookPath - The absolute path of the notebook to be run in the Databricks Workspace. This path must begin with a slash. Type: string (or Expression with resultType string). + NotebookPath interface{} `json:"notebookPath,omitempty"` + // BaseParameters - Base parameters to be used for each run of this job.If the notebook takes a parameter that is not specified, the default value from the notebook will be used. + BaseParameters map[string]interface{} `json:"baseParameters"` +} + +// MarshalJSON is the custom marshaler for DatabricksNotebookActivityTypeProperties. +func (dnatp DatabricksNotebookActivityTypeProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["notebookPath"] = dnatp.NotebookPath + if dnatp.BaseParameters != nil { + objectMap["baseParameters"] = dnatp.BaseParameters + } + return json.Marshal(objectMap) +} + +// DataLakeAnalyticsUSQLActivity data Lake Analytics U-SQL activity. +type DataLakeAnalyticsUSQLActivity struct { + // DataLakeAnalyticsUSQLActivityTypeProperties - Data Lake Analytics U-SQL activity properties. + *DataLakeAnalyticsUSQLActivityTypeProperties `json:"typeProperties,omitempty"` + // LinkedServiceName - Linked service reference. + LinkedServiceName *LinkedServiceReference `json:"linkedServiceName,omitempty"` + // Policy - Activity policy. + Policy *ActivityPolicy `json:"policy,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Name - Activity name. + Name *string `json:"name,omitempty"` + // Description - Activity description. + Description *string `json:"description,omitempty"` + // DependsOn - Activity depends on condition. + DependsOn *[]ActivityDependency `json:"dependsOn,omitempty"` + // UserProperties - Activity user properties. + UserProperties map[string]*string `json:"userProperties"` + // Type - Possible values include: 'TypeActivity', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLUpdateResource', 'TypeAzureMLBatchExecution', 'TypeGetMetadata', 'TypeWebActivity', 'TypeLookup', 'TypeSQLServerStoredProcedure', 'TypeCustom', 'TypeExecuteSSISPackage', 'TypeHDInsightSpark', 'TypeHDInsightStreaming', 'TypeHDInsightMapReduce', 'TypeHDInsightPig', 'TypeHDInsightHive', 'TypeCopy', 'TypeExecution', 'TypeFilter', 'TypeUntil', 'TypeWait', 'TypeForEach', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' + Type TypeBasicActivity `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for DataLakeAnalyticsUSQLActivity. +func (dlaua DataLakeAnalyticsUSQLActivity) MarshalJSON() ([]byte, error) { + dlaua.Type = TypeDataLakeAnalyticsUSQL + objectMap := make(map[string]interface{}) + if dlaua.DataLakeAnalyticsUSQLActivityTypeProperties != nil { + objectMap["typeProperties"] = dlaua.DataLakeAnalyticsUSQLActivityTypeProperties + } + if dlaua.LinkedServiceName != nil { + objectMap["linkedServiceName"] = dlaua.LinkedServiceName + } + if dlaua.Policy != nil { + objectMap["policy"] = dlaua.Policy + } + if dlaua.Name != nil { + objectMap["name"] = dlaua.Name + } + if dlaua.Description != nil { + objectMap["description"] = dlaua.Description + } + if dlaua.DependsOn != nil { + objectMap["dependsOn"] = dlaua.DependsOn + } + if dlaua.UserProperties != nil { + objectMap["userProperties"] = dlaua.UserProperties + } + if dlaua.Type != "" { + objectMap["type"] = dlaua.Type + } + for k, v := range dlaua.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsDatabricksNotebookActivity is the BasicActivity implementation for DataLakeAnalyticsUSQLActivity. +func (dlaua DataLakeAnalyticsUSQLActivity) AsDatabricksNotebookActivity() (*DatabricksNotebookActivity, bool) { + return nil, false +} + +// AsDataLakeAnalyticsUSQLActivity is the BasicActivity implementation for DataLakeAnalyticsUSQLActivity. +func (dlaua DataLakeAnalyticsUSQLActivity) AsDataLakeAnalyticsUSQLActivity() (*DataLakeAnalyticsUSQLActivity, bool) { + return &dlaua, true +} + +// AsAzureMLUpdateResourceActivity is the BasicActivity implementation for DataLakeAnalyticsUSQLActivity. +func (dlaua DataLakeAnalyticsUSQLActivity) AsAzureMLUpdateResourceActivity() (*AzureMLUpdateResourceActivity, bool) { + return nil, false +} + +// AsAzureMLBatchExecutionActivity is the BasicActivity implementation for DataLakeAnalyticsUSQLActivity. +func (dlaua DataLakeAnalyticsUSQLActivity) AsAzureMLBatchExecutionActivity() (*AzureMLBatchExecutionActivity, bool) { + return nil, false +} + +// AsGetMetadataActivity is the BasicActivity implementation for DataLakeAnalyticsUSQLActivity. +func (dlaua DataLakeAnalyticsUSQLActivity) AsGetMetadataActivity() (*GetMetadataActivity, bool) { + return nil, false +} + +// AsWebActivity is the BasicActivity implementation for DataLakeAnalyticsUSQLActivity. +func (dlaua DataLakeAnalyticsUSQLActivity) AsWebActivity() (*WebActivity, bool) { + return nil, false +} + +// AsLookupActivity is the BasicActivity implementation for DataLakeAnalyticsUSQLActivity. +func (dlaua DataLakeAnalyticsUSQLActivity) AsLookupActivity() (*LookupActivity, bool) { + return nil, false +} + +// AsSQLServerStoredProcedureActivity is the BasicActivity implementation for DataLakeAnalyticsUSQLActivity. +func (dlaua DataLakeAnalyticsUSQLActivity) AsSQLServerStoredProcedureActivity() (*SQLServerStoredProcedureActivity, bool) { + return nil, false +} + +// AsCustomActivity is the BasicActivity implementation for DataLakeAnalyticsUSQLActivity. +func (dlaua DataLakeAnalyticsUSQLActivity) AsCustomActivity() (*CustomActivity, bool) { + return nil, false +} + +// AsExecuteSSISPackageActivity is the BasicActivity implementation for DataLakeAnalyticsUSQLActivity. +func (dlaua DataLakeAnalyticsUSQLActivity) AsExecuteSSISPackageActivity() (*ExecuteSSISPackageActivity, bool) { + return nil, false +} + +// AsHDInsightSparkActivity is the BasicActivity implementation for DataLakeAnalyticsUSQLActivity. +func (dlaua DataLakeAnalyticsUSQLActivity) AsHDInsightSparkActivity() (*HDInsightSparkActivity, bool) { + return nil, false +} + +// AsHDInsightStreamingActivity is the BasicActivity implementation for DataLakeAnalyticsUSQLActivity. +func (dlaua DataLakeAnalyticsUSQLActivity) AsHDInsightStreamingActivity() (*HDInsightStreamingActivity, bool) { + return nil, false +} + +// AsHDInsightMapReduceActivity is the BasicActivity implementation for DataLakeAnalyticsUSQLActivity. +func (dlaua DataLakeAnalyticsUSQLActivity) AsHDInsightMapReduceActivity() (*HDInsightMapReduceActivity, bool) { + return nil, false +} + +// AsHDInsightPigActivity is the BasicActivity implementation for DataLakeAnalyticsUSQLActivity. +func (dlaua DataLakeAnalyticsUSQLActivity) AsHDInsightPigActivity() (*HDInsightPigActivity, bool) { + return nil, false +} + +// AsHDInsightHiveActivity is the BasicActivity implementation for DataLakeAnalyticsUSQLActivity. +func (dlaua DataLakeAnalyticsUSQLActivity) AsHDInsightHiveActivity() (*HDInsightHiveActivity, bool) { + return nil, false +} + +// AsCopyActivity is the BasicActivity implementation for DataLakeAnalyticsUSQLActivity. +func (dlaua DataLakeAnalyticsUSQLActivity) AsCopyActivity() (*CopyActivity, bool) { + return nil, false +} + +// AsExecutionActivity is the BasicActivity implementation for DataLakeAnalyticsUSQLActivity. +func (dlaua DataLakeAnalyticsUSQLActivity) AsExecutionActivity() (*ExecutionActivity, bool) { + return nil, false +} + +// AsBasicExecutionActivity is the BasicActivity implementation for DataLakeAnalyticsUSQLActivity. +func (dlaua DataLakeAnalyticsUSQLActivity) AsBasicExecutionActivity() (BasicExecutionActivity, bool) { + return &dlaua, true +} + +// AsFilterActivity is the BasicActivity implementation for DataLakeAnalyticsUSQLActivity. +func (dlaua DataLakeAnalyticsUSQLActivity) AsFilterActivity() (*FilterActivity, bool) { + return nil, false +} + +// AsUntilActivity is the BasicActivity implementation for DataLakeAnalyticsUSQLActivity. +func (dlaua DataLakeAnalyticsUSQLActivity) AsUntilActivity() (*UntilActivity, bool) { + return nil, false +} + +// AsWaitActivity is the BasicActivity implementation for DataLakeAnalyticsUSQLActivity. +func (dlaua DataLakeAnalyticsUSQLActivity) AsWaitActivity() (*WaitActivity, bool) { + return nil, false +} + +// AsForEachActivity is the BasicActivity implementation for DataLakeAnalyticsUSQLActivity. +func (dlaua DataLakeAnalyticsUSQLActivity) AsForEachActivity() (*ForEachActivity, bool) { + return nil, false +} + +// AsIfConditionActivity is the BasicActivity implementation for DataLakeAnalyticsUSQLActivity. +func (dlaua DataLakeAnalyticsUSQLActivity) AsIfConditionActivity() (*IfConditionActivity, bool) { + return nil, false +} + +// AsExecutePipelineActivity is the BasicActivity implementation for DataLakeAnalyticsUSQLActivity. +func (dlaua DataLakeAnalyticsUSQLActivity) AsExecutePipelineActivity() (*ExecutePipelineActivity, bool) { + return nil, false +} + +// AsControlActivity is the BasicActivity implementation for DataLakeAnalyticsUSQLActivity. +func (dlaua DataLakeAnalyticsUSQLActivity) AsControlActivity() (*ControlActivity, bool) { + return nil, false +} + +// AsBasicControlActivity is the BasicActivity implementation for DataLakeAnalyticsUSQLActivity. +func (dlaua DataLakeAnalyticsUSQLActivity) AsBasicControlActivity() (BasicControlActivity, bool) { + return nil, false +} + +// AsActivity is the BasicActivity implementation for DataLakeAnalyticsUSQLActivity. +func (dlaua DataLakeAnalyticsUSQLActivity) AsActivity() (*Activity, bool) { + return nil, false +} + +// AsBasicActivity is the BasicActivity implementation for DataLakeAnalyticsUSQLActivity. +func (dlaua DataLakeAnalyticsUSQLActivity) AsBasicActivity() (BasicActivity, bool) { + return &dlaua, true +} + +// UnmarshalJSON is the custom unmarshaler for DataLakeAnalyticsUSQLActivity struct. +func (dlaua *DataLakeAnalyticsUSQLActivity) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "typeProperties": + if v != nil { + var dataLakeAnalyticsUSQLActivityTypeProperties DataLakeAnalyticsUSQLActivityTypeProperties + err = json.Unmarshal(*v, &dataLakeAnalyticsUSQLActivityTypeProperties) + if err != nil { + return err + } + dlaua.DataLakeAnalyticsUSQLActivityTypeProperties = &dataLakeAnalyticsUSQLActivityTypeProperties + } + case "linkedServiceName": + if v != nil { + var linkedServiceName LinkedServiceReference + err = json.Unmarshal(*v, &linkedServiceName) + if err != nil { + return err + } + dlaua.LinkedServiceName = &linkedServiceName + } + case "policy": + if v != nil { + var policy ActivityPolicy + err = json.Unmarshal(*v, &policy) + if err != nil { + return err + } + dlaua.Policy = &policy + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if dlaua.AdditionalProperties == nil { + dlaua.AdditionalProperties = make(map[string]interface{}) + } + dlaua.AdditionalProperties[k] = additionalProperties + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + dlaua.Name = &name + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + dlaua.Description = &description + } + case "dependsOn": + if v != nil { + var dependsOn []ActivityDependency + err = json.Unmarshal(*v, &dependsOn) + if err != nil { + return err + } + dlaua.DependsOn = &dependsOn + } + case "userProperties": + if v != nil { + var userProperties map[string]*string + err = json.Unmarshal(*v, &userProperties) + if err != nil { + return err + } + dlaua.UserProperties = userProperties + } + case "type": + if v != nil { + var typeVar TypeBasicActivity + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + dlaua.Type = typeVar + } + } + } + + return nil +} + +// DataLakeAnalyticsUSQLActivityTypeProperties dataLakeAnalyticsU-SQL activity properties. +type DataLakeAnalyticsUSQLActivityTypeProperties struct { + // ScriptPath - Case-sensitive path to folder that contains the U-SQL script. Type: string (or Expression with resultType string). + ScriptPath interface{} `json:"scriptPath,omitempty"` + // ScriptLinkedService - Script linked service reference. + ScriptLinkedService *LinkedServiceReference `json:"scriptLinkedService,omitempty"` + // DegreeOfParallelism - The maximum number of nodes simultaneously used to run the job. Default value is 1. Type: integer (or Expression with resultType integer), minimum: 1. + DegreeOfParallelism interface{} `json:"degreeOfParallelism,omitempty"` + // Priority - Determines which jobs out of all that are queued should be selected to run first. The lower the number, the higher the priority. Default value is 1000. Type: integer (or Expression with resultType integer), minimum: 1. + Priority interface{} `json:"priority,omitempty"` + // Parameters - Parameters for U-SQL job request. + Parameters map[string]interface{} `json:"parameters"` + // RuntimeVersion - Runtime version of the U-SQL engine to use. Type: string (or Expression with resultType string). + RuntimeVersion interface{} `json:"runtimeVersion,omitempty"` + // CompilationMode - Compilation mode of U-SQL. Must be one of these values : Semantic, Full and SingleBox. Type: string (or Expression with resultType string). + CompilationMode interface{} `json:"compilationMode,omitempty"` +} + +// MarshalJSON is the custom marshaler for DataLakeAnalyticsUSQLActivityTypeProperties. +func (dlauatp DataLakeAnalyticsUSQLActivityTypeProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["scriptPath"] = dlauatp.ScriptPath + if dlauatp.ScriptLinkedService != nil { + objectMap["scriptLinkedService"] = dlauatp.ScriptLinkedService + } + objectMap["degreeOfParallelism"] = dlauatp.DegreeOfParallelism + objectMap["priority"] = dlauatp.Priority + if dlauatp.Parameters != nil { + objectMap["parameters"] = dlauatp.Parameters + } + objectMap["runtimeVersion"] = dlauatp.RuntimeVersion + objectMap["compilationMode"] = dlauatp.CompilationMode + return json.Marshal(objectMap) +} + +// BasicDataset the Azure Data Factory nested object which identifies data within different data stores, such as +// tables, files, folders, and documents. +type BasicDataset interface { + AsResponsysObjectDataset() (*ResponsysObjectDataset, bool) + AsSalesforceMarketingCloudObjectDataset() (*SalesforceMarketingCloudObjectDataset, bool) + AsVerticaTableDataset() (*VerticaTableDataset, bool) + AsNetezzaTableDataset() (*NetezzaTableDataset, bool) + AsZohoObjectDataset() (*ZohoObjectDataset, bool) + AsXeroObjectDataset() (*XeroObjectDataset, bool) + AsSquareObjectDataset() (*SquareObjectDataset, bool) + AsSparkObjectDataset() (*SparkObjectDataset, bool) + AsShopifyObjectDataset() (*ShopifyObjectDataset, bool) + AsServiceNowObjectDataset() (*ServiceNowObjectDataset, bool) + AsQuickBooksObjectDataset() (*QuickBooksObjectDataset, bool) + AsPrestoObjectDataset() (*PrestoObjectDataset, bool) + AsPhoenixObjectDataset() (*PhoenixObjectDataset, bool) + AsPaypalObjectDataset() (*PaypalObjectDataset, bool) + AsMarketoObjectDataset() (*MarketoObjectDataset, bool) + AsMariaDBTableDataset() (*MariaDBTableDataset, bool) + AsMagentoObjectDataset() (*MagentoObjectDataset, bool) + AsJiraObjectDataset() (*JiraObjectDataset, bool) + AsImpalaObjectDataset() (*ImpalaObjectDataset, bool) + AsHubspotObjectDataset() (*HubspotObjectDataset, bool) + AsHiveObjectDataset() (*HiveObjectDataset, bool) + AsHBaseObjectDataset() (*HBaseObjectDataset, bool) + AsGreenplumTableDataset() (*GreenplumTableDataset, bool) + AsGoogleBigQueryObjectDataset() (*GoogleBigQueryObjectDataset, bool) + AsEloquaObjectDataset() (*EloquaObjectDataset, bool) + AsDrillTableDataset() (*DrillTableDataset, bool) + AsCouchbaseTableDataset() (*CouchbaseTableDataset, bool) + AsConcurObjectDataset() (*ConcurObjectDataset, bool) + AsAzurePostgreSQLTableDataset() (*AzurePostgreSQLTableDataset, bool) + AsAmazonMWSObjectDataset() (*AmazonMWSObjectDataset, bool) + AsHTTPDataset() (*HTTPDataset, bool) + AsAzureSearchIndexDataset() (*AzureSearchIndexDataset, bool) + AsWebTableDataset() (*WebTableDataset, bool) + AsSQLServerTableDataset() (*SQLServerTableDataset, bool) + AsSapEccResourceDataset() (*SapEccResourceDataset, bool) + AsSapCloudForCustomerResourceDataset() (*SapCloudForCustomerResourceDataset, bool) + AsSalesforceObjectDataset() (*SalesforceObjectDataset, bool) + AsRelationalTableDataset() (*RelationalTableDataset, bool) + AsAzureMySQLTableDataset() (*AzureMySQLTableDataset, bool) + AsOracleTableDataset() (*OracleTableDataset, bool) + AsODataResourceDataset() (*ODataResourceDataset, bool) + AsMongoDbCollectionDataset() (*MongoDbCollectionDataset, bool) + AsFileShareDataset() (*FileShareDataset, bool) + AsAzureDataLakeStoreDataset() (*AzureDataLakeStoreDataset, bool) + AsDynamicsEntityDataset() (*DynamicsEntityDataset, bool) + AsDocumentDbCollectionDataset() (*DocumentDbCollectionDataset, bool) + AsCustomDataset() (*CustomDataset, bool) + AsCassandraTableDataset() (*CassandraTableDataset, bool) + AsAzureSQLDWTableDataset() (*AzureSQLDWTableDataset, bool) + AsAzureSQLTableDataset() (*AzureSQLTableDataset, bool) + AsAzureTableDataset() (*AzureTableDataset, bool) + AsAzureBlobDataset() (*AzureBlobDataset, bool) + AsAmazonS3Dataset() (*AmazonS3Dataset, bool) + AsDataset() (*Dataset, bool) +} + +// Dataset the Azure Data Factory nested object which identifies data within different data stores, such as tables, +// files, folders, and documents. +type Dataset struct { + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Description - Dataset description. + Description *string `json:"description,omitempty"` + // Structure - Columns that define the structure of the dataset. Type: array (or Expression with resultType array), itemType: DatasetDataElement. + Structure interface{} `json:"structure,omitempty"` + // LinkedServiceName - Linked service reference. + LinkedServiceName *LinkedServiceReference `json:"linkedServiceName,omitempty"` + // Parameters - Parameters for dataset. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeDataset', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSQLServerTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSalesforceObject', 'TypeRelationalTable', 'TypeAzureMySQLTable', 'TypeOracleTable', 'TypeODataResource', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeAzureDataLakeStoreFile', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeAmazonS3Object' + Type TypeBasicDataset `json:"type,omitempty"` +} + +func unmarshalBasicDataset(body []byte) (BasicDataset, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["type"] { + case string(TypeResponsysObject): + var rod ResponsysObjectDataset + err := json.Unmarshal(body, &rod) + return rod, err + case string(TypeSalesforceMarketingCloudObject): + var smcod SalesforceMarketingCloudObjectDataset + err := json.Unmarshal(body, &smcod) + return smcod, err + case string(TypeVerticaTable): + var vtd VerticaTableDataset + err := json.Unmarshal(body, &vtd) + return vtd, err + case string(TypeNetezzaTable): + var ntd NetezzaTableDataset + err := json.Unmarshal(body, &ntd) + return ntd, err + case string(TypeZohoObject): + var zod ZohoObjectDataset + err := json.Unmarshal(body, &zod) + return zod, err + case string(TypeXeroObject): + var xod XeroObjectDataset + err := json.Unmarshal(body, &xod) + return xod, err + case string(TypeSquareObject): + var sod SquareObjectDataset + err := json.Unmarshal(body, &sod) + return sod, err + case string(TypeSparkObject): + var sod SparkObjectDataset + err := json.Unmarshal(body, &sod) + return sod, err + case string(TypeShopifyObject): + var sod ShopifyObjectDataset + err := json.Unmarshal(body, &sod) + return sod, err + case string(TypeServiceNowObject): + var snod ServiceNowObjectDataset + err := json.Unmarshal(body, &snod) + return snod, err + case string(TypeQuickBooksObject): + var qbod QuickBooksObjectDataset + err := json.Unmarshal(body, &qbod) + return qbod, err + case string(TypePrestoObject): + var pod PrestoObjectDataset + err := json.Unmarshal(body, &pod) + return pod, err + case string(TypePhoenixObject): + var pod PhoenixObjectDataset + err := json.Unmarshal(body, &pod) + return pod, err + case string(TypePaypalObject): + var pod PaypalObjectDataset + err := json.Unmarshal(body, &pod) + return pod, err + case string(TypeMarketoObject): + var mod MarketoObjectDataset + err := json.Unmarshal(body, &mod) + return mod, err + case string(TypeMariaDBTable): + var mdtd MariaDBTableDataset + err := json.Unmarshal(body, &mdtd) + return mdtd, err + case string(TypeMagentoObject): + var mod MagentoObjectDataset + err := json.Unmarshal(body, &mod) + return mod, err + case string(TypeJiraObject): + var jod JiraObjectDataset + err := json.Unmarshal(body, &jod) + return jod, err + case string(TypeImpalaObject): + var iod ImpalaObjectDataset + err := json.Unmarshal(body, &iod) + return iod, err + case string(TypeHubspotObject): + var hod HubspotObjectDataset + err := json.Unmarshal(body, &hod) + return hod, err + case string(TypeHiveObject): + var hod HiveObjectDataset + err := json.Unmarshal(body, &hod) + return hod, err + case string(TypeHBaseObject): + var hbod HBaseObjectDataset + err := json.Unmarshal(body, &hbod) + return hbod, err + case string(TypeGreenplumTable): + var gtd GreenplumTableDataset + err := json.Unmarshal(body, >d) + return gtd, err + case string(TypeGoogleBigQueryObject): + var gbqod GoogleBigQueryObjectDataset + err := json.Unmarshal(body, &gbqod) + return gbqod, err + case string(TypeEloquaObject): + var eod EloquaObjectDataset + err := json.Unmarshal(body, &eod) + return eod, err + case string(TypeDrillTable): + var dtd DrillTableDataset + err := json.Unmarshal(body, &dtd) + return dtd, err + case string(TypeCouchbaseTable): + var ctd CouchbaseTableDataset + err := json.Unmarshal(body, &ctd) + return ctd, err + case string(TypeConcurObject): + var cod ConcurObjectDataset + err := json.Unmarshal(body, &cod) + return cod, err + case string(TypeAzurePostgreSQLTable): + var apstd AzurePostgreSQLTableDataset + err := json.Unmarshal(body, &apstd) + return apstd, err + case string(TypeAmazonMWSObject): + var amod AmazonMWSObjectDataset + err := json.Unmarshal(body, &amod) + return amod, err + case string(TypeHTTPFile): + var hd HTTPDataset + err := json.Unmarshal(body, &hd) + return hd, err + case string(TypeAzureSearchIndex): + var asid AzureSearchIndexDataset + err := json.Unmarshal(body, &asid) + return asid, err + case string(TypeWebTable): + var wtd WebTableDataset + err := json.Unmarshal(body, &wtd) + return wtd, err + case string(TypeSQLServerTable): + var sstd SQLServerTableDataset + err := json.Unmarshal(body, &sstd) + return sstd, err + case string(TypeSapEccResource): + var serd SapEccResourceDataset + err := json.Unmarshal(body, &serd) + return serd, err + case string(TypeSapCloudForCustomerResource): + var scfcrd SapCloudForCustomerResourceDataset + err := json.Unmarshal(body, &scfcrd) + return scfcrd, err + case string(TypeSalesforceObject): + var sod SalesforceObjectDataset + err := json.Unmarshal(body, &sod) + return sod, err + case string(TypeRelationalTable): + var rtd RelationalTableDataset + err := json.Unmarshal(body, &rtd) + return rtd, err + case string(TypeAzureMySQLTable): + var amstd AzureMySQLTableDataset + err := json.Unmarshal(body, &amstd) + return amstd, err + case string(TypeOracleTable): + var otd OracleTableDataset + err := json.Unmarshal(body, &otd) + return otd, err + case string(TypeODataResource): + var odrd ODataResourceDataset + err := json.Unmarshal(body, &odrd) + return odrd, err + case string(TypeMongoDbCollection): + var mdcd MongoDbCollectionDataset + err := json.Unmarshal(body, &mdcd) + return mdcd, err + case string(TypeFileShare): + var fsd FileShareDataset + err := json.Unmarshal(body, &fsd) + return fsd, err + case string(TypeAzureDataLakeStoreFile): + var adlsd AzureDataLakeStoreDataset + err := json.Unmarshal(body, &adlsd) + return adlsd, err + case string(TypeDynamicsEntity): + var ded DynamicsEntityDataset + err := json.Unmarshal(body, &ded) + return ded, err + case string(TypeDocumentDbCollection): + var ddcd DocumentDbCollectionDataset + err := json.Unmarshal(body, &ddcd) + return ddcd, err + case string(TypeCustomDataset): + var cd CustomDataset + err := json.Unmarshal(body, &cd) + return cd, err + case string(TypeCassandraTable): + var ctd CassandraTableDataset + err := json.Unmarshal(body, &ctd) + return ctd, err + case string(TypeAzureSQLDWTable): + var asdtd AzureSQLDWTableDataset + err := json.Unmarshal(body, &asdtd) + return asdtd, err + case string(TypeAzureSQLTable): + var astd AzureSQLTableDataset + err := json.Unmarshal(body, &astd) + return astd, err + case string(TypeAzureTable): + var atd AzureTableDataset + err := json.Unmarshal(body, &atd) + return atd, err + case string(TypeAzureBlob): + var abd AzureBlobDataset + err := json.Unmarshal(body, &abd) + return abd, err + case string(TypeAmazonS3Object): + var asd AmazonS3Dataset + err := json.Unmarshal(body, &asd) + return asd, err + default: + var d Dataset + err := json.Unmarshal(body, &d) + return d, err + } +} +func unmarshalBasicDatasetArray(body []byte) ([]BasicDataset, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + dArray := make([]BasicDataset, len(rawMessages)) + + for index, rawMessage := range rawMessages { + d, err := unmarshalBasicDataset(*rawMessage) + if err != nil { + return nil, err + } + dArray[index] = d + } + return dArray, nil +} + +// MarshalJSON is the custom marshaler for Dataset. +func (d Dataset) MarshalJSON() ([]byte, error) { + d.Type = TypeDataset + objectMap := make(map[string]interface{}) + if d.Description != nil { + objectMap["description"] = d.Description + } + objectMap["structure"] = d.Structure + if d.LinkedServiceName != nil { + objectMap["linkedServiceName"] = d.LinkedServiceName + } + if d.Parameters != nil { + objectMap["parameters"] = d.Parameters + } + if d.Annotations != nil { + objectMap["annotations"] = d.Annotations + } + if d.Type != "" { + objectMap["type"] = d.Type + } + for k, v := range d.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysObjectDataset is the BasicDataset implementation for Dataset. +func (d Dataset) AsResponsysObjectDataset() (*ResponsysObjectDataset, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudObjectDataset is the BasicDataset implementation for Dataset. +func (d Dataset) AsSalesforceMarketingCloudObjectDataset() (*SalesforceMarketingCloudObjectDataset, bool) { + return nil, false +} + +// AsVerticaTableDataset is the BasicDataset implementation for Dataset. +func (d Dataset) AsVerticaTableDataset() (*VerticaTableDataset, bool) { + return nil, false +} + +// AsNetezzaTableDataset is the BasicDataset implementation for Dataset. +func (d Dataset) AsNetezzaTableDataset() (*NetezzaTableDataset, bool) { + return nil, false +} + +// AsZohoObjectDataset is the BasicDataset implementation for Dataset. +func (d Dataset) AsZohoObjectDataset() (*ZohoObjectDataset, bool) { + return nil, false +} + +// AsXeroObjectDataset is the BasicDataset implementation for Dataset. +func (d Dataset) AsXeroObjectDataset() (*XeroObjectDataset, bool) { + return nil, false +} + +// AsSquareObjectDataset is the BasicDataset implementation for Dataset. +func (d Dataset) AsSquareObjectDataset() (*SquareObjectDataset, bool) { + return nil, false +} + +// AsSparkObjectDataset is the BasicDataset implementation for Dataset. +func (d Dataset) AsSparkObjectDataset() (*SparkObjectDataset, bool) { + return nil, false +} + +// AsShopifyObjectDataset is the BasicDataset implementation for Dataset. +func (d Dataset) AsShopifyObjectDataset() (*ShopifyObjectDataset, bool) { + return nil, false +} + +// AsServiceNowObjectDataset is the BasicDataset implementation for Dataset. +func (d Dataset) AsServiceNowObjectDataset() (*ServiceNowObjectDataset, bool) { + return nil, false +} + +// AsQuickBooksObjectDataset is the BasicDataset implementation for Dataset. +func (d Dataset) AsQuickBooksObjectDataset() (*QuickBooksObjectDataset, bool) { + return nil, false +} + +// AsPrestoObjectDataset is the BasicDataset implementation for Dataset. +func (d Dataset) AsPrestoObjectDataset() (*PrestoObjectDataset, bool) { + return nil, false +} + +// AsPhoenixObjectDataset is the BasicDataset implementation for Dataset. +func (d Dataset) AsPhoenixObjectDataset() (*PhoenixObjectDataset, bool) { + return nil, false +} + +// AsPaypalObjectDataset is the BasicDataset implementation for Dataset. +func (d Dataset) AsPaypalObjectDataset() (*PaypalObjectDataset, bool) { + return nil, false +} + +// AsMarketoObjectDataset is the BasicDataset implementation for Dataset. +func (d Dataset) AsMarketoObjectDataset() (*MarketoObjectDataset, bool) { + return nil, false +} + +// AsMariaDBTableDataset is the BasicDataset implementation for Dataset. +func (d Dataset) AsMariaDBTableDataset() (*MariaDBTableDataset, bool) { + return nil, false +} + +// AsMagentoObjectDataset is the BasicDataset implementation for Dataset. +func (d Dataset) AsMagentoObjectDataset() (*MagentoObjectDataset, bool) { + return nil, false +} + +// AsJiraObjectDataset is the BasicDataset implementation for Dataset. +func (d Dataset) AsJiraObjectDataset() (*JiraObjectDataset, bool) { + return nil, false +} + +// AsImpalaObjectDataset is the BasicDataset implementation for Dataset. +func (d Dataset) AsImpalaObjectDataset() (*ImpalaObjectDataset, bool) { + return nil, false +} + +// AsHubspotObjectDataset is the BasicDataset implementation for Dataset. +func (d Dataset) AsHubspotObjectDataset() (*HubspotObjectDataset, bool) { + return nil, false +} + +// AsHiveObjectDataset is the BasicDataset implementation for Dataset. +func (d Dataset) AsHiveObjectDataset() (*HiveObjectDataset, bool) { + return nil, false +} + +// AsHBaseObjectDataset is the BasicDataset implementation for Dataset. +func (d Dataset) AsHBaseObjectDataset() (*HBaseObjectDataset, bool) { + return nil, false +} + +// AsGreenplumTableDataset is the BasicDataset implementation for Dataset. +func (d Dataset) AsGreenplumTableDataset() (*GreenplumTableDataset, bool) { + return nil, false +} + +// AsGoogleBigQueryObjectDataset is the BasicDataset implementation for Dataset. +func (d Dataset) AsGoogleBigQueryObjectDataset() (*GoogleBigQueryObjectDataset, bool) { + return nil, false +} + +// AsEloquaObjectDataset is the BasicDataset implementation for Dataset. +func (d Dataset) AsEloquaObjectDataset() (*EloquaObjectDataset, bool) { + return nil, false +} + +// AsDrillTableDataset is the BasicDataset implementation for Dataset. +func (d Dataset) AsDrillTableDataset() (*DrillTableDataset, bool) { + return nil, false +} + +// AsCouchbaseTableDataset is the BasicDataset implementation for Dataset. +func (d Dataset) AsCouchbaseTableDataset() (*CouchbaseTableDataset, bool) { + return nil, false +} + +// AsConcurObjectDataset is the BasicDataset implementation for Dataset. +func (d Dataset) AsConcurObjectDataset() (*ConcurObjectDataset, bool) { + return nil, false +} + +// AsAzurePostgreSQLTableDataset is the BasicDataset implementation for Dataset. +func (d Dataset) AsAzurePostgreSQLTableDataset() (*AzurePostgreSQLTableDataset, bool) { + return nil, false +} + +// AsAmazonMWSObjectDataset is the BasicDataset implementation for Dataset. +func (d Dataset) AsAmazonMWSObjectDataset() (*AmazonMWSObjectDataset, bool) { + return nil, false +} + +// AsHTTPDataset is the BasicDataset implementation for Dataset. +func (d Dataset) AsHTTPDataset() (*HTTPDataset, bool) { + return nil, false +} + +// AsAzureSearchIndexDataset is the BasicDataset implementation for Dataset. +func (d Dataset) AsAzureSearchIndexDataset() (*AzureSearchIndexDataset, bool) { + return nil, false +} + +// AsWebTableDataset is the BasicDataset implementation for Dataset. +func (d Dataset) AsWebTableDataset() (*WebTableDataset, bool) { + return nil, false +} + +// AsSQLServerTableDataset is the BasicDataset implementation for Dataset. +func (d Dataset) AsSQLServerTableDataset() (*SQLServerTableDataset, bool) { + return nil, false +} + +// AsSapEccResourceDataset is the BasicDataset implementation for Dataset. +func (d Dataset) AsSapEccResourceDataset() (*SapEccResourceDataset, bool) { + return nil, false +} + +// AsSapCloudForCustomerResourceDataset is the BasicDataset implementation for Dataset. +func (d Dataset) AsSapCloudForCustomerResourceDataset() (*SapCloudForCustomerResourceDataset, bool) { + return nil, false +} + +// AsSalesforceObjectDataset is the BasicDataset implementation for Dataset. +func (d Dataset) AsSalesforceObjectDataset() (*SalesforceObjectDataset, bool) { + return nil, false +} + +// AsRelationalTableDataset is the BasicDataset implementation for Dataset. +func (d Dataset) AsRelationalTableDataset() (*RelationalTableDataset, bool) { + return nil, false +} + +// AsAzureMySQLTableDataset is the BasicDataset implementation for Dataset. +func (d Dataset) AsAzureMySQLTableDataset() (*AzureMySQLTableDataset, bool) { + return nil, false +} + +// AsOracleTableDataset is the BasicDataset implementation for Dataset. +func (d Dataset) AsOracleTableDataset() (*OracleTableDataset, bool) { + return nil, false +} + +// AsODataResourceDataset is the BasicDataset implementation for Dataset. +func (d Dataset) AsODataResourceDataset() (*ODataResourceDataset, bool) { + return nil, false +} + +// AsMongoDbCollectionDataset is the BasicDataset implementation for Dataset. +func (d Dataset) AsMongoDbCollectionDataset() (*MongoDbCollectionDataset, bool) { + return nil, false +} + +// AsFileShareDataset is the BasicDataset implementation for Dataset. +func (d Dataset) AsFileShareDataset() (*FileShareDataset, bool) { + return nil, false +} + +// AsAzureDataLakeStoreDataset is the BasicDataset implementation for Dataset. +func (d Dataset) AsAzureDataLakeStoreDataset() (*AzureDataLakeStoreDataset, bool) { + return nil, false +} + +// AsDynamicsEntityDataset is the BasicDataset implementation for Dataset. +func (d Dataset) AsDynamicsEntityDataset() (*DynamicsEntityDataset, bool) { + return nil, false +} + +// AsDocumentDbCollectionDataset is the BasicDataset implementation for Dataset. +func (d Dataset) AsDocumentDbCollectionDataset() (*DocumentDbCollectionDataset, bool) { + return nil, false +} + +// AsCustomDataset is the BasicDataset implementation for Dataset. +func (d Dataset) AsCustomDataset() (*CustomDataset, bool) { + return nil, false +} + +// AsCassandraTableDataset is the BasicDataset implementation for Dataset. +func (d Dataset) AsCassandraTableDataset() (*CassandraTableDataset, bool) { + return nil, false +} + +// AsAzureSQLDWTableDataset is the BasicDataset implementation for Dataset. +func (d Dataset) AsAzureSQLDWTableDataset() (*AzureSQLDWTableDataset, bool) { + return nil, false +} + +// AsAzureSQLTableDataset is the BasicDataset implementation for Dataset. +func (d Dataset) AsAzureSQLTableDataset() (*AzureSQLTableDataset, bool) { + return nil, false +} + +// AsAzureTableDataset is the BasicDataset implementation for Dataset. +func (d Dataset) AsAzureTableDataset() (*AzureTableDataset, bool) { + return nil, false +} + +// AsAzureBlobDataset is the BasicDataset implementation for Dataset. +func (d Dataset) AsAzureBlobDataset() (*AzureBlobDataset, bool) { + return nil, false +} + +// AsAmazonS3Dataset is the BasicDataset implementation for Dataset. +func (d Dataset) AsAmazonS3Dataset() (*AmazonS3Dataset, bool) { + return nil, false +} + +// AsDataset is the BasicDataset implementation for Dataset. +func (d Dataset) AsDataset() (*Dataset, bool) { + return &d, true +} + +// AsBasicDataset is the BasicDataset implementation for Dataset. +func (d Dataset) AsBasicDataset() (BasicDataset, bool) { + return &d, true +} + +// DatasetBZip2Compression the BZip2 compression method used on a dataset. +type DatasetBZip2Compression struct { + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Type - Possible values include: 'TypeDatasetCompression', 'TypeZipDeflate', 'TypeDeflate', 'TypeGZip', 'TypeBZip2' + Type TypeBasicDatasetCompression `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for DatasetBZip2Compression. +func (dbz2c DatasetBZip2Compression) MarshalJSON() ([]byte, error) { + dbz2c.Type = TypeBZip2 + objectMap := make(map[string]interface{}) + if dbz2c.Type != "" { + objectMap["type"] = dbz2c.Type + } + for k, v := range dbz2c.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsDatasetZipDeflateCompression is the BasicDatasetCompression implementation for DatasetBZip2Compression. +func (dbz2c DatasetBZip2Compression) AsDatasetZipDeflateCompression() (*DatasetZipDeflateCompression, bool) { + return nil, false +} + +// AsDatasetDeflateCompression is the BasicDatasetCompression implementation for DatasetBZip2Compression. +func (dbz2c DatasetBZip2Compression) AsDatasetDeflateCompression() (*DatasetDeflateCompression, bool) { + return nil, false +} + +// AsDatasetGZipCompression is the BasicDatasetCompression implementation for DatasetBZip2Compression. +func (dbz2c DatasetBZip2Compression) AsDatasetGZipCompression() (*DatasetGZipCompression, bool) { + return nil, false +} + +// AsDatasetBZip2Compression is the BasicDatasetCompression implementation for DatasetBZip2Compression. +func (dbz2c DatasetBZip2Compression) AsDatasetBZip2Compression() (*DatasetBZip2Compression, bool) { + return &dbz2c, true +} + +// AsDatasetCompression is the BasicDatasetCompression implementation for DatasetBZip2Compression. +func (dbz2c DatasetBZip2Compression) AsDatasetCompression() (*DatasetCompression, bool) { + return nil, false +} + +// AsBasicDatasetCompression is the BasicDatasetCompression implementation for DatasetBZip2Compression. +func (dbz2c DatasetBZip2Compression) AsBasicDatasetCompression() (BasicDatasetCompression, bool) { + return &dbz2c, true +} + +// BasicDatasetCompression the compression method used on a dataset. +type BasicDatasetCompression interface { + AsDatasetZipDeflateCompression() (*DatasetZipDeflateCompression, bool) + AsDatasetDeflateCompression() (*DatasetDeflateCompression, bool) + AsDatasetGZipCompression() (*DatasetGZipCompression, bool) + AsDatasetBZip2Compression() (*DatasetBZip2Compression, bool) + AsDatasetCompression() (*DatasetCompression, bool) +} + +// DatasetCompression the compression method used on a dataset. +type DatasetCompression struct { + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Type - Possible values include: 'TypeDatasetCompression', 'TypeZipDeflate', 'TypeDeflate', 'TypeGZip', 'TypeBZip2' + Type TypeBasicDatasetCompression `json:"type,omitempty"` +} + +func unmarshalBasicDatasetCompression(body []byte) (BasicDatasetCompression, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["type"] { + case string(TypeZipDeflate): + var dzdc DatasetZipDeflateCompression + err := json.Unmarshal(body, &dzdc) + return dzdc, err + case string(TypeDeflate): + var ddc DatasetDeflateCompression + err := json.Unmarshal(body, &ddc) + return ddc, err + case string(TypeGZip): + var dgzc DatasetGZipCompression + err := json.Unmarshal(body, &dgzc) + return dgzc, err + case string(TypeBZip2): + var dbz2c DatasetBZip2Compression + err := json.Unmarshal(body, &dbz2c) + return dbz2c, err + default: + var dc DatasetCompression + err := json.Unmarshal(body, &dc) + return dc, err + } +} +func unmarshalBasicDatasetCompressionArray(body []byte) ([]BasicDatasetCompression, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + dcArray := make([]BasicDatasetCompression, len(rawMessages)) + + for index, rawMessage := range rawMessages { + dc, err := unmarshalBasicDatasetCompression(*rawMessage) + if err != nil { + return nil, err + } + dcArray[index] = dc + } + return dcArray, nil +} + +// MarshalJSON is the custom marshaler for DatasetCompression. +func (dc DatasetCompression) MarshalJSON() ([]byte, error) { + dc.Type = TypeDatasetCompression + objectMap := make(map[string]interface{}) + if dc.Type != "" { + objectMap["type"] = dc.Type + } + for k, v := range dc.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsDatasetZipDeflateCompression is the BasicDatasetCompression implementation for DatasetCompression. +func (dc DatasetCompression) AsDatasetZipDeflateCompression() (*DatasetZipDeflateCompression, bool) { + return nil, false +} + +// AsDatasetDeflateCompression is the BasicDatasetCompression implementation for DatasetCompression. +func (dc DatasetCompression) AsDatasetDeflateCompression() (*DatasetDeflateCompression, bool) { + return nil, false +} + +// AsDatasetGZipCompression is the BasicDatasetCompression implementation for DatasetCompression. +func (dc DatasetCompression) AsDatasetGZipCompression() (*DatasetGZipCompression, bool) { + return nil, false +} + +// AsDatasetBZip2Compression is the BasicDatasetCompression implementation for DatasetCompression. +func (dc DatasetCompression) AsDatasetBZip2Compression() (*DatasetBZip2Compression, bool) { + return nil, false +} + +// AsDatasetCompression is the BasicDatasetCompression implementation for DatasetCompression. +func (dc DatasetCompression) AsDatasetCompression() (*DatasetCompression, bool) { + return &dc, true +} + +// AsBasicDatasetCompression is the BasicDatasetCompression implementation for DatasetCompression. +func (dc DatasetCompression) AsBasicDatasetCompression() (BasicDatasetCompression, bool) { + return &dc, true +} + +// DatasetDeflateCompression the Deflate compression method used on a dataset. +type DatasetDeflateCompression struct { + // Level - The Deflate compression level. Possible values include: 'Optimal', 'Fastest' + Level DatasetCompressionLevel `json:"level,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Type - Possible values include: 'TypeDatasetCompression', 'TypeZipDeflate', 'TypeDeflate', 'TypeGZip', 'TypeBZip2' + Type TypeBasicDatasetCompression `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for DatasetDeflateCompression. +func (ddc DatasetDeflateCompression) MarshalJSON() ([]byte, error) { + ddc.Type = TypeDeflate + objectMap := make(map[string]interface{}) + if ddc.Level != "" { + objectMap["level"] = ddc.Level + } + if ddc.Type != "" { + objectMap["type"] = ddc.Type + } + for k, v := range ddc.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsDatasetZipDeflateCompression is the BasicDatasetCompression implementation for DatasetDeflateCompression. +func (ddc DatasetDeflateCompression) AsDatasetZipDeflateCompression() (*DatasetZipDeflateCompression, bool) { + return nil, false +} + +// AsDatasetDeflateCompression is the BasicDatasetCompression implementation for DatasetDeflateCompression. +func (ddc DatasetDeflateCompression) AsDatasetDeflateCompression() (*DatasetDeflateCompression, bool) { + return &ddc, true +} + +// AsDatasetGZipCompression is the BasicDatasetCompression implementation for DatasetDeflateCompression. +func (ddc DatasetDeflateCompression) AsDatasetGZipCompression() (*DatasetGZipCompression, bool) { + return nil, false +} + +// AsDatasetBZip2Compression is the BasicDatasetCompression implementation for DatasetDeflateCompression. +func (ddc DatasetDeflateCompression) AsDatasetBZip2Compression() (*DatasetBZip2Compression, bool) { + return nil, false +} + +// AsDatasetCompression is the BasicDatasetCompression implementation for DatasetDeflateCompression. +func (ddc DatasetDeflateCompression) AsDatasetCompression() (*DatasetCompression, bool) { + return nil, false +} + +// AsBasicDatasetCompression is the BasicDatasetCompression implementation for DatasetDeflateCompression. +func (ddc DatasetDeflateCompression) AsBasicDatasetCompression() (BasicDatasetCompression, bool) { + return &ddc, true +} + +// DatasetGZipCompression the GZip compression method used on a dataset. +type DatasetGZipCompression struct { + // Level - The GZip compression level. Possible values include: 'Optimal', 'Fastest' + Level DatasetCompressionLevel `json:"level,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Type - Possible values include: 'TypeDatasetCompression', 'TypeZipDeflate', 'TypeDeflate', 'TypeGZip', 'TypeBZip2' + Type TypeBasicDatasetCompression `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for DatasetGZipCompression. +func (dgzc DatasetGZipCompression) MarshalJSON() ([]byte, error) { + dgzc.Type = TypeGZip + objectMap := make(map[string]interface{}) + if dgzc.Level != "" { + objectMap["level"] = dgzc.Level + } + if dgzc.Type != "" { + objectMap["type"] = dgzc.Type + } + for k, v := range dgzc.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsDatasetZipDeflateCompression is the BasicDatasetCompression implementation for DatasetGZipCompression. +func (dgzc DatasetGZipCompression) AsDatasetZipDeflateCompression() (*DatasetZipDeflateCompression, bool) { + return nil, false +} + +// AsDatasetDeflateCompression is the BasicDatasetCompression implementation for DatasetGZipCompression. +func (dgzc DatasetGZipCompression) AsDatasetDeflateCompression() (*DatasetDeflateCompression, bool) { + return nil, false +} + +// AsDatasetGZipCompression is the BasicDatasetCompression implementation for DatasetGZipCompression. +func (dgzc DatasetGZipCompression) AsDatasetGZipCompression() (*DatasetGZipCompression, bool) { + return &dgzc, true +} + +// AsDatasetBZip2Compression is the BasicDatasetCompression implementation for DatasetGZipCompression. +func (dgzc DatasetGZipCompression) AsDatasetBZip2Compression() (*DatasetBZip2Compression, bool) { + return nil, false +} + +// AsDatasetCompression is the BasicDatasetCompression implementation for DatasetGZipCompression. +func (dgzc DatasetGZipCompression) AsDatasetCompression() (*DatasetCompression, bool) { + return nil, false +} + +// AsBasicDatasetCompression is the BasicDatasetCompression implementation for DatasetGZipCompression. +func (dgzc DatasetGZipCompression) AsBasicDatasetCompression() (BasicDatasetCompression, bool) { + return &dgzc, true +} + +// DatasetListResponse a list of dataset resources. +type DatasetListResponse struct { + autorest.Response `json:"-"` + // Value - List of datasets. + Value *[]DatasetResource `json:"value,omitempty"` + // NextLink - The link to the next page of results, if any remaining results exist. + NextLink *string `json:"nextLink,omitempty"` +} + +// DatasetListResponseIterator provides access to a complete listing of DatasetResource values. +type DatasetListResponseIterator struct { + i int + page DatasetListResponsePage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *DatasetListResponseIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter DatasetListResponseIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter DatasetListResponseIterator) Response() DatasetListResponse { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter DatasetListResponseIterator) Value() DatasetResource { + if !iter.page.NotDone() { + return DatasetResource{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (dlr DatasetListResponse) IsEmpty() bool { + return dlr.Value == nil || len(*dlr.Value) == 0 +} + +// datasetListResponsePreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (dlr DatasetListResponse) datasetListResponsePreparer() (*http.Request, error) { + if dlr.NextLink == nil || len(to.String(dlr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(dlr.NextLink))) +} + +// DatasetListResponsePage contains a page of DatasetResource values. +type DatasetListResponsePage struct { + fn func(DatasetListResponse) (DatasetListResponse, error) + dlr DatasetListResponse +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *DatasetListResponsePage) Next() error { + next, err := page.fn(page.dlr) + if err != nil { + return err + } + page.dlr = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page DatasetListResponsePage) NotDone() bool { + return !page.dlr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page DatasetListResponsePage) Response() DatasetListResponse { + return page.dlr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page DatasetListResponsePage) Values() []DatasetResource { + if page.dlr.IsEmpty() { + return nil + } + return *page.dlr.Value +} + +// DatasetReference dataset reference type. +type DatasetReference struct { + // Type - Dataset reference type. + Type *string `json:"type,omitempty"` + // ReferenceName - Reference dataset name. + ReferenceName *string `json:"referenceName,omitempty"` + // Parameters - Arguments for dataset. + Parameters map[string]interface{} `json:"parameters"` +} + +// MarshalJSON is the custom marshaler for DatasetReference. +func (dr DatasetReference) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dr.Type != nil { + objectMap["type"] = dr.Type + } + if dr.ReferenceName != nil { + objectMap["referenceName"] = dr.ReferenceName + } + if dr.Parameters != nil { + objectMap["parameters"] = dr.Parameters + } + return json.Marshal(objectMap) +} + +// DatasetResource dataset resource type. +type DatasetResource struct { + autorest.Response `json:"-"` + // Properties - Dataset properties. + Properties BasicDataset `json:"properties,omitempty"` + // ID - The resource identifier. + ID *string `json:"id,omitempty"` + // Name - The resource name. + Name *string `json:"name,omitempty"` + // Type - The resource type. + Type *string `json:"type,omitempty"` + // Etag - Etag identifies change in the resource. + Etag *string `json:"etag,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for DatasetResource struct. +func (dr *DatasetResource) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + properties, err := unmarshalBasicDataset(*v) + if err != nil { + return err + } + dr.Properties = properties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + dr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + dr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + dr.Type = &typeVar + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + dr.Etag = &etag + } + } + } + + return nil +} + +// BasicDatasetStorageFormat the format definition of a storage. +type BasicDatasetStorageFormat interface { + AsParquetFormat() (*ParquetFormat, bool) + AsOrcFormat() (*OrcFormat, bool) + AsAvroFormat() (*AvroFormat, bool) + AsJSONFormat() (*JSONFormat, bool) + AsTextFormat() (*TextFormat, bool) + AsDatasetStorageFormat() (*DatasetStorageFormat, bool) +} + +// DatasetStorageFormat the format definition of a storage. +type DatasetStorageFormat struct { + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Serializer - Serializer. Type: string (or Expression with resultType string). + Serializer interface{} `json:"serializer,omitempty"` + // Deserializer - Deserializer. Type: string (or Expression with resultType string). + Deserializer interface{} `json:"deserializer,omitempty"` + // Type - Possible values include: 'TypeDatasetStorageFormat', 'TypeParquetFormat', 'TypeOrcFormat', 'TypeAvroFormat', 'TypeJSONFormat', 'TypeTextFormat' + Type TypeBasicDatasetStorageFormat `json:"type,omitempty"` +} + +func unmarshalBasicDatasetStorageFormat(body []byte) (BasicDatasetStorageFormat, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["type"] { + case string(TypeParquetFormat): + var pf ParquetFormat + err := json.Unmarshal(body, &pf) + return pf, err + case string(TypeOrcFormat): + var of OrcFormat + err := json.Unmarshal(body, &of) + return of, err + case string(TypeAvroFormat): + var af AvroFormat + err := json.Unmarshal(body, &af) + return af, err + case string(TypeJSONFormat): + var jf JSONFormat + err := json.Unmarshal(body, &jf) + return jf, err + case string(TypeTextFormat): + var tf TextFormat + err := json.Unmarshal(body, &tf) + return tf, err + default: + var dsf DatasetStorageFormat + err := json.Unmarshal(body, &dsf) + return dsf, err + } +} +func unmarshalBasicDatasetStorageFormatArray(body []byte) ([]BasicDatasetStorageFormat, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + dsfArray := make([]BasicDatasetStorageFormat, len(rawMessages)) + + for index, rawMessage := range rawMessages { + dsf, err := unmarshalBasicDatasetStorageFormat(*rawMessage) + if err != nil { + return nil, err + } + dsfArray[index] = dsf + } + return dsfArray, nil +} + +// MarshalJSON is the custom marshaler for DatasetStorageFormat. +func (dsf DatasetStorageFormat) MarshalJSON() ([]byte, error) { + dsf.Type = TypeDatasetStorageFormat + objectMap := make(map[string]interface{}) + objectMap["serializer"] = dsf.Serializer + objectMap["deserializer"] = dsf.Deserializer + if dsf.Type != "" { + objectMap["type"] = dsf.Type + } + for k, v := range dsf.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsParquetFormat is the BasicDatasetStorageFormat implementation for DatasetStorageFormat. +func (dsf DatasetStorageFormat) AsParquetFormat() (*ParquetFormat, bool) { + return nil, false +} + +// AsOrcFormat is the BasicDatasetStorageFormat implementation for DatasetStorageFormat. +func (dsf DatasetStorageFormat) AsOrcFormat() (*OrcFormat, bool) { + return nil, false +} + +// AsAvroFormat is the BasicDatasetStorageFormat implementation for DatasetStorageFormat. +func (dsf DatasetStorageFormat) AsAvroFormat() (*AvroFormat, bool) { + return nil, false +} + +// AsJSONFormat is the BasicDatasetStorageFormat implementation for DatasetStorageFormat. +func (dsf DatasetStorageFormat) AsJSONFormat() (*JSONFormat, bool) { + return nil, false +} + +// AsTextFormat is the BasicDatasetStorageFormat implementation for DatasetStorageFormat. +func (dsf DatasetStorageFormat) AsTextFormat() (*TextFormat, bool) { + return nil, false +} + +// AsDatasetStorageFormat is the BasicDatasetStorageFormat implementation for DatasetStorageFormat. +func (dsf DatasetStorageFormat) AsDatasetStorageFormat() (*DatasetStorageFormat, bool) { + return &dsf, true +} + +// AsBasicDatasetStorageFormat is the BasicDatasetStorageFormat implementation for DatasetStorageFormat. +func (dsf DatasetStorageFormat) AsBasicDatasetStorageFormat() (BasicDatasetStorageFormat, bool) { + return &dsf, true +} + +// DatasetZipDeflateCompression the ZipDeflate compression method used on a dataset. +type DatasetZipDeflateCompression struct { + // Level - The ZipDeflate compression level. Possible values include: 'Optimal', 'Fastest' + Level DatasetCompressionLevel `json:"level,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Type - Possible values include: 'TypeDatasetCompression', 'TypeZipDeflate', 'TypeDeflate', 'TypeGZip', 'TypeBZip2' + Type TypeBasicDatasetCompression `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for DatasetZipDeflateCompression. +func (dzdc DatasetZipDeflateCompression) MarshalJSON() ([]byte, error) { + dzdc.Type = TypeZipDeflate + objectMap := make(map[string]interface{}) + if dzdc.Level != "" { + objectMap["level"] = dzdc.Level + } + if dzdc.Type != "" { + objectMap["type"] = dzdc.Type + } + for k, v := range dzdc.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsDatasetZipDeflateCompression is the BasicDatasetCompression implementation for DatasetZipDeflateCompression. +func (dzdc DatasetZipDeflateCompression) AsDatasetZipDeflateCompression() (*DatasetZipDeflateCompression, bool) { + return &dzdc, true +} + +// AsDatasetDeflateCompression is the BasicDatasetCompression implementation for DatasetZipDeflateCompression. +func (dzdc DatasetZipDeflateCompression) AsDatasetDeflateCompression() (*DatasetDeflateCompression, bool) { + return nil, false +} + +// AsDatasetGZipCompression is the BasicDatasetCompression implementation for DatasetZipDeflateCompression. +func (dzdc DatasetZipDeflateCompression) AsDatasetGZipCompression() (*DatasetGZipCompression, bool) { + return nil, false +} + +// AsDatasetBZip2Compression is the BasicDatasetCompression implementation for DatasetZipDeflateCompression. +func (dzdc DatasetZipDeflateCompression) AsDatasetBZip2Compression() (*DatasetBZip2Compression, bool) { + return nil, false +} + +// AsDatasetCompression is the BasicDatasetCompression implementation for DatasetZipDeflateCompression. +func (dzdc DatasetZipDeflateCompression) AsDatasetCompression() (*DatasetCompression, bool) { + return nil, false +} + +// AsBasicDatasetCompression is the BasicDatasetCompression implementation for DatasetZipDeflateCompression. +func (dzdc DatasetZipDeflateCompression) AsBasicDatasetCompression() (BasicDatasetCompression, bool) { + return &dzdc, true +} + +// Db2LinkedService linked service for DB2 data source. +type Db2LinkedService struct { + // Db2LinkedServiceTypeProperties - DB2 linked service properties. + *Db2LinkedServiceTypeProperties `json:"typeProperties,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // ConnectVia - The integration runtime reference. + ConnectVia *IntegrationRuntimeReference `json:"connectVia,omitempty"` + // Description - Linked service description. + Description *string `json:"description,omitempty"` + // Parameters - Parameters for linked service. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeLinkedService', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforce', 'TypeAzureDataLakeStore', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureStorage' + Type TypeBasicLinkedService `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Db2LinkedService. +func (d2ls Db2LinkedService) MarshalJSON() ([]byte, error) { + d2ls.Type = TypeDb2 + objectMap := make(map[string]interface{}) + if d2ls.Db2LinkedServiceTypeProperties != nil { + objectMap["typeProperties"] = d2ls.Db2LinkedServiceTypeProperties + } + if d2ls.ConnectVia != nil { + objectMap["connectVia"] = d2ls.ConnectVia + } + if d2ls.Description != nil { + objectMap["description"] = d2ls.Description + } + if d2ls.Parameters != nil { + objectMap["parameters"] = d2ls.Parameters + } + if d2ls.Annotations != nil { + objectMap["annotations"] = d2ls.Annotations + } + if d2ls.Type != "" { + objectMap["type"] = d2ls.Type + } + for k, v := range d2ls.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysLinkedService is the BasicLinkedService implementation for Db2LinkedService. +func (d2ls Db2LinkedService) AsResponsysLinkedService() (*ResponsysLinkedService, bool) { + return nil, false +} + +// AsAzureDatabricksLinkedService is the BasicLinkedService implementation for Db2LinkedService. +func (d2ls Db2LinkedService) AsAzureDatabricksLinkedService() (*AzureDatabricksLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeAnalyticsLinkedService is the BasicLinkedService implementation for Db2LinkedService. +func (d2ls Db2LinkedService) AsAzureDataLakeAnalyticsLinkedService() (*AzureDataLakeAnalyticsLinkedService, bool) { + return nil, false +} + +// AsHDInsightOnDemandLinkedService is the BasicLinkedService implementation for Db2LinkedService. +func (d2ls Db2LinkedService) AsHDInsightOnDemandLinkedService() (*HDInsightOnDemandLinkedService, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudLinkedService is the BasicLinkedService implementation for Db2LinkedService. +func (d2ls Db2LinkedService) AsSalesforceMarketingCloudLinkedService() (*SalesforceMarketingCloudLinkedService, bool) { + return nil, false +} + +// AsNetezzaLinkedService is the BasicLinkedService implementation for Db2LinkedService. +func (d2ls Db2LinkedService) AsNetezzaLinkedService() (*NetezzaLinkedService, bool) { + return nil, false +} + +// AsVerticaLinkedService is the BasicLinkedService implementation for Db2LinkedService. +func (d2ls Db2LinkedService) AsVerticaLinkedService() (*VerticaLinkedService, bool) { + return nil, false +} + +// AsZohoLinkedService is the BasicLinkedService implementation for Db2LinkedService. +func (d2ls Db2LinkedService) AsZohoLinkedService() (*ZohoLinkedService, bool) { + return nil, false +} + +// AsXeroLinkedService is the BasicLinkedService implementation for Db2LinkedService. +func (d2ls Db2LinkedService) AsXeroLinkedService() (*XeroLinkedService, bool) { + return nil, false +} + +// AsSquareLinkedService is the BasicLinkedService implementation for Db2LinkedService. +func (d2ls Db2LinkedService) AsSquareLinkedService() (*SquareLinkedService, bool) { + return nil, false +} + +// AsSparkLinkedService is the BasicLinkedService implementation for Db2LinkedService. +func (d2ls Db2LinkedService) AsSparkLinkedService() (*SparkLinkedService, bool) { + return nil, false +} + +// AsShopifyLinkedService is the BasicLinkedService implementation for Db2LinkedService. +func (d2ls Db2LinkedService) AsShopifyLinkedService() (*ShopifyLinkedService, bool) { + return nil, false +} + +// AsServiceNowLinkedService is the BasicLinkedService implementation for Db2LinkedService. +func (d2ls Db2LinkedService) AsServiceNowLinkedService() (*ServiceNowLinkedService, bool) { + return nil, false +} + +// AsQuickBooksLinkedService is the BasicLinkedService implementation for Db2LinkedService. +func (d2ls Db2LinkedService) AsQuickBooksLinkedService() (*QuickBooksLinkedService, bool) { + return nil, false +} + +// AsPrestoLinkedService is the BasicLinkedService implementation for Db2LinkedService. +func (d2ls Db2LinkedService) AsPrestoLinkedService() (*PrestoLinkedService, bool) { + return nil, false +} + +// AsPhoenixLinkedService is the BasicLinkedService implementation for Db2LinkedService. +func (d2ls Db2LinkedService) AsPhoenixLinkedService() (*PhoenixLinkedService, bool) { + return nil, false +} + +// AsPaypalLinkedService is the BasicLinkedService implementation for Db2LinkedService. +func (d2ls Db2LinkedService) AsPaypalLinkedService() (*PaypalLinkedService, bool) { + return nil, false +} + +// AsMarketoLinkedService is the BasicLinkedService implementation for Db2LinkedService. +func (d2ls Db2LinkedService) AsMarketoLinkedService() (*MarketoLinkedService, bool) { + return nil, false +} + +// AsMariaDBLinkedService is the BasicLinkedService implementation for Db2LinkedService. +func (d2ls Db2LinkedService) AsMariaDBLinkedService() (*MariaDBLinkedService, bool) { + return nil, false +} + +// AsMagentoLinkedService is the BasicLinkedService implementation for Db2LinkedService. +func (d2ls Db2LinkedService) AsMagentoLinkedService() (*MagentoLinkedService, bool) { + return nil, false +} + +// AsJiraLinkedService is the BasicLinkedService implementation for Db2LinkedService. +func (d2ls Db2LinkedService) AsJiraLinkedService() (*JiraLinkedService, bool) { + return nil, false +} + +// AsImpalaLinkedService is the BasicLinkedService implementation for Db2LinkedService. +func (d2ls Db2LinkedService) AsImpalaLinkedService() (*ImpalaLinkedService, bool) { + return nil, false +} + +// AsHubspotLinkedService is the BasicLinkedService implementation for Db2LinkedService. +func (d2ls Db2LinkedService) AsHubspotLinkedService() (*HubspotLinkedService, bool) { + return nil, false +} + +// AsHiveLinkedService is the BasicLinkedService implementation for Db2LinkedService. +func (d2ls Db2LinkedService) AsHiveLinkedService() (*HiveLinkedService, bool) { + return nil, false +} + +// AsHBaseLinkedService is the BasicLinkedService implementation for Db2LinkedService. +func (d2ls Db2LinkedService) AsHBaseLinkedService() (*HBaseLinkedService, bool) { + return nil, false +} + +// AsGreenplumLinkedService is the BasicLinkedService implementation for Db2LinkedService. +func (d2ls Db2LinkedService) AsGreenplumLinkedService() (*GreenplumLinkedService, bool) { + return nil, false +} + +// AsGoogleBigQueryLinkedService is the BasicLinkedService implementation for Db2LinkedService. +func (d2ls Db2LinkedService) AsGoogleBigQueryLinkedService() (*GoogleBigQueryLinkedService, bool) { + return nil, false +} + +// AsEloquaLinkedService is the BasicLinkedService implementation for Db2LinkedService. +func (d2ls Db2LinkedService) AsEloquaLinkedService() (*EloquaLinkedService, bool) { + return nil, false +} + +// AsDrillLinkedService is the BasicLinkedService implementation for Db2LinkedService. +func (d2ls Db2LinkedService) AsDrillLinkedService() (*DrillLinkedService, bool) { + return nil, false +} + +// AsCouchbaseLinkedService is the BasicLinkedService implementation for Db2LinkedService. +func (d2ls Db2LinkedService) AsCouchbaseLinkedService() (*CouchbaseLinkedService, bool) { + return nil, false +} + +// AsConcurLinkedService is the BasicLinkedService implementation for Db2LinkedService. +func (d2ls Db2LinkedService) AsConcurLinkedService() (*ConcurLinkedService, bool) { + return nil, false +} + +// AsAzurePostgreSQLLinkedService is the BasicLinkedService implementation for Db2LinkedService. +func (d2ls Db2LinkedService) AsAzurePostgreSQLLinkedService() (*AzurePostgreSQLLinkedService, bool) { + return nil, false +} + +// AsAmazonMWSLinkedService is the BasicLinkedService implementation for Db2LinkedService. +func (d2ls Db2LinkedService) AsAmazonMWSLinkedService() (*AmazonMWSLinkedService, bool) { + return nil, false +} + +// AsSapHanaLinkedService is the BasicLinkedService implementation for Db2LinkedService. +func (d2ls Db2LinkedService) AsSapHanaLinkedService() (*SapHanaLinkedService, bool) { + return nil, false +} + +// AsSapBWLinkedService is the BasicLinkedService implementation for Db2LinkedService. +func (d2ls Db2LinkedService) AsSapBWLinkedService() (*SapBWLinkedService, bool) { + return nil, false +} + +// AsSftpServerLinkedService is the BasicLinkedService implementation for Db2LinkedService. +func (d2ls Db2LinkedService) AsSftpServerLinkedService() (*SftpServerLinkedService, bool) { + return nil, false +} + +// AsFtpServerLinkedService is the BasicLinkedService implementation for Db2LinkedService. +func (d2ls Db2LinkedService) AsFtpServerLinkedService() (*FtpServerLinkedService, bool) { + return nil, false +} + +// AsHTTPLinkedService is the BasicLinkedService implementation for Db2LinkedService. +func (d2ls Db2LinkedService) AsHTTPLinkedService() (*HTTPLinkedService, bool) { + return nil, false +} + +// AsAzureSearchLinkedService is the BasicLinkedService implementation for Db2LinkedService. +func (d2ls Db2LinkedService) AsAzureSearchLinkedService() (*AzureSearchLinkedService, bool) { + return nil, false +} + +// AsCustomDataSourceLinkedService is the BasicLinkedService implementation for Db2LinkedService. +func (d2ls Db2LinkedService) AsCustomDataSourceLinkedService() (*CustomDataSourceLinkedService, bool) { + return nil, false +} + +// AsAmazonRedshiftLinkedService is the BasicLinkedService implementation for Db2LinkedService. +func (d2ls Db2LinkedService) AsAmazonRedshiftLinkedService() (*AmazonRedshiftLinkedService, bool) { + return nil, false +} + +// AsAmazonS3LinkedService is the BasicLinkedService implementation for Db2LinkedService. +func (d2ls Db2LinkedService) AsAmazonS3LinkedService() (*AmazonS3LinkedService, bool) { + return nil, false +} + +// AsSapEccLinkedService is the BasicLinkedService implementation for Db2LinkedService. +func (d2ls Db2LinkedService) AsSapEccLinkedService() (*SapEccLinkedService, bool) { + return nil, false +} + +// AsSapCloudForCustomerLinkedService is the BasicLinkedService implementation for Db2LinkedService. +func (d2ls Db2LinkedService) AsSapCloudForCustomerLinkedService() (*SapCloudForCustomerLinkedService, bool) { + return nil, false +} + +// AsSalesforceLinkedService is the BasicLinkedService implementation for Db2LinkedService. +func (d2ls Db2LinkedService) AsSalesforceLinkedService() (*SalesforceLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeStoreLinkedService is the BasicLinkedService implementation for Db2LinkedService. +func (d2ls Db2LinkedService) AsAzureDataLakeStoreLinkedService() (*AzureDataLakeStoreLinkedService, bool) { + return nil, false +} + +// AsMongoDbLinkedService is the BasicLinkedService implementation for Db2LinkedService. +func (d2ls Db2LinkedService) AsMongoDbLinkedService() (*MongoDbLinkedService, bool) { + return nil, false +} + +// AsCassandraLinkedService is the BasicLinkedService implementation for Db2LinkedService. +func (d2ls Db2LinkedService) AsCassandraLinkedService() (*CassandraLinkedService, bool) { + return nil, false +} + +// AsWebLinkedService is the BasicLinkedService implementation for Db2LinkedService. +func (d2ls Db2LinkedService) AsWebLinkedService() (*WebLinkedService, bool) { + return nil, false +} + +// AsODataLinkedService is the BasicLinkedService implementation for Db2LinkedService. +func (d2ls Db2LinkedService) AsODataLinkedService() (*ODataLinkedService, bool) { + return nil, false +} + +// AsHdfsLinkedService is the BasicLinkedService implementation for Db2LinkedService. +func (d2ls Db2LinkedService) AsHdfsLinkedService() (*HdfsLinkedService, bool) { + return nil, false +} + +// AsOdbcLinkedService is the BasicLinkedService implementation for Db2LinkedService. +func (d2ls Db2LinkedService) AsOdbcLinkedService() (*OdbcLinkedService, bool) { + return nil, false +} + +// AsAzureMLLinkedService is the BasicLinkedService implementation for Db2LinkedService. +func (d2ls Db2LinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { + return nil, false +} + +// AsTeradataLinkedService is the BasicLinkedService implementation for Db2LinkedService. +func (d2ls Db2LinkedService) AsTeradataLinkedService() (*TeradataLinkedService, bool) { + return nil, false +} + +// AsDb2LinkedService is the BasicLinkedService implementation for Db2LinkedService. +func (d2ls Db2LinkedService) AsDb2LinkedService() (*Db2LinkedService, bool) { + return &d2ls, true +} + +// AsSybaseLinkedService is the BasicLinkedService implementation for Db2LinkedService. +func (d2ls Db2LinkedService) AsSybaseLinkedService() (*SybaseLinkedService, bool) { + return nil, false +} + +// AsPostgreSQLLinkedService is the BasicLinkedService implementation for Db2LinkedService. +func (d2ls Db2LinkedService) AsPostgreSQLLinkedService() (*PostgreSQLLinkedService, bool) { + return nil, false +} + +// AsMySQLLinkedService is the BasicLinkedService implementation for Db2LinkedService. +func (d2ls Db2LinkedService) AsMySQLLinkedService() (*MySQLLinkedService, bool) { + return nil, false +} + +// AsAzureMySQLLinkedService is the BasicLinkedService implementation for Db2LinkedService. +func (d2ls Db2LinkedService) AsAzureMySQLLinkedService() (*AzureMySQLLinkedService, bool) { + return nil, false +} + +// AsOracleLinkedService is the BasicLinkedService implementation for Db2LinkedService. +func (d2ls Db2LinkedService) AsOracleLinkedService() (*OracleLinkedService, bool) { + return nil, false +} + +// AsFileServerLinkedService is the BasicLinkedService implementation for Db2LinkedService. +func (d2ls Db2LinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { + return nil, false +} + +// AsHDInsightLinkedService is the BasicLinkedService implementation for Db2LinkedService. +func (d2ls Db2LinkedService) AsHDInsightLinkedService() (*HDInsightLinkedService, bool) { + return nil, false +} + +// AsDynamicsLinkedService is the BasicLinkedService implementation for Db2LinkedService. +func (d2ls Db2LinkedService) AsDynamicsLinkedService() (*DynamicsLinkedService, bool) { + return nil, false +} + +// AsCosmosDbLinkedService is the BasicLinkedService implementation for Db2LinkedService. +func (d2ls Db2LinkedService) AsCosmosDbLinkedService() (*CosmosDbLinkedService, bool) { + return nil, false +} + +// AsAzureKeyVaultLinkedService is the BasicLinkedService implementation for Db2LinkedService. +func (d2ls Db2LinkedService) AsAzureKeyVaultLinkedService() (*AzureKeyVaultLinkedService, bool) { + return nil, false +} + +// AsAzureBatchLinkedService is the BasicLinkedService implementation for Db2LinkedService. +func (d2ls Db2LinkedService) AsAzureBatchLinkedService() (*AzureBatchLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDatabaseLinkedService is the BasicLinkedService implementation for Db2LinkedService. +func (d2ls Db2LinkedService) AsAzureSQLDatabaseLinkedService() (*AzureSQLDatabaseLinkedService, bool) { + return nil, false +} + +// AsSQLServerLinkedService is the BasicLinkedService implementation for Db2LinkedService. +func (d2ls Db2LinkedService) AsSQLServerLinkedService() (*SQLServerLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDWLinkedService is the BasicLinkedService implementation for Db2LinkedService. +func (d2ls Db2LinkedService) AsAzureSQLDWLinkedService() (*AzureSQLDWLinkedService, bool) { + return nil, false +} + +// AsAzureStorageLinkedService is the BasicLinkedService implementation for Db2LinkedService. +func (d2ls Db2LinkedService) AsAzureStorageLinkedService() (*AzureStorageLinkedService, bool) { + return nil, false +} + +// AsLinkedService is the BasicLinkedService implementation for Db2LinkedService. +func (d2ls Db2LinkedService) AsLinkedService() (*LinkedService, bool) { + return nil, false +} + +// AsBasicLinkedService is the BasicLinkedService implementation for Db2LinkedService. +func (d2ls Db2LinkedService) AsBasicLinkedService() (BasicLinkedService, bool) { + return &d2ls, true +} + +// UnmarshalJSON is the custom unmarshaler for Db2LinkedService struct. +func (d2ls *Db2LinkedService) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "typeProperties": + if v != nil { + var db2LinkedServiceTypeProperties Db2LinkedServiceTypeProperties + err = json.Unmarshal(*v, &db2LinkedServiceTypeProperties) + if err != nil { + return err + } + d2ls.Db2LinkedServiceTypeProperties = &db2LinkedServiceTypeProperties + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if d2ls.AdditionalProperties == nil { + d2ls.AdditionalProperties = make(map[string]interface{}) + } + d2ls.AdditionalProperties[k] = additionalProperties + } + case "connectVia": + if v != nil { + var connectVia IntegrationRuntimeReference + err = json.Unmarshal(*v, &connectVia) + if err != nil { + return err + } + d2ls.ConnectVia = &connectVia + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + d2ls.Description = &description + } + case "parameters": + if v != nil { + var parameters map[string]*ParameterSpecification + err = json.Unmarshal(*v, ¶meters) + if err != nil { + return err + } + d2ls.Parameters = parameters + } + case "annotations": + if v != nil { + var annotations []interface{} + err = json.Unmarshal(*v, &annotations) + if err != nil { + return err + } + d2ls.Annotations = &annotations + } + case "type": + if v != nil { + var typeVar TypeBasicLinkedService + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + d2ls.Type = typeVar + } + } + } + + return nil +} + +// Db2LinkedServiceTypeProperties dB2 linked service properties. +type Db2LinkedServiceTypeProperties struct { + // Server - Server name for connection. Type: string (or Expression with resultType string). + Server interface{} `json:"server,omitempty"` + // Database - Database name for connection. Type: string (or Expression with resultType string). + Database interface{} `json:"database,omitempty"` + // AuthenticationType - AuthenticationType to be used for connection. Possible values include: 'Basic' + AuthenticationType Db2AuthenticationType `json:"authenticationType,omitempty"` + // Username - Username for authentication. Type: string (or Expression with resultType string). + Username interface{} `json:"username,omitempty"` + // Password - Password for authentication. + Password BasicSecretBase `json:"password,omitempty"` + // EncryptedCredential - The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string). + EncryptedCredential interface{} `json:"encryptedCredential,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for Db2LinkedServiceTypeProperties struct. +func (d2lstp *Db2LinkedServiceTypeProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "server": + if v != nil { + var server interface{} + err = json.Unmarshal(*v, &server) + if err != nil { + return err + } + d2lstp.Server = server + } + case "database": + if v != nil { + var databaseVar interface{} + err = json.Unmarshal(*v, &databaseVar) + if err != nil { + return err + } + d2lstp.Database = databaseVar + } + case "authenticationType": + if v != nil { + var authenticationType Db2AuthenticationType + err = json.Unmarshal(*v, &authenticationType) + if err != nil { + return err + } + d2lstp.AuthenticationType = authenticationType + } + case "username": + if v != nil { + var username interface{} + err = json.Unmarshal(*v, &username) + if err != nil { + return err + } + d2lstp.Username = username + } + case "password": + if v != nil { + password, err := unmarshalBasicSecretBase(*v) + if err != nil { + return err + } + d2lstp.Password = password + } + case "encryptedCredential": + if v != nil { + var encryptedCredential interface{} + err = json.Unmarshal(*v, &encryptedCredential) + if err != nil { + return err + } + d2lstp.EncryptedCredential = encryptedCredential + } + } + } + + return nil +} + +// DistcpSettings distcp settings. +type DistcpSettings struct { + // ResourceManagerEndpoint - Specifies the Yarn ResourceManager endpoint. Type: string (or Expression with resultType string). + ResourceManagerEndpoint interface{} `json:"resourceManagerEndpoint,omitempty"` + // TempScriptPath - Specifies an existing folder path which will be used to store temp Distcp command script. The script file is generated by ADF and will be removed after Copy job finished. Type: string (or Expression with resultType string). + TempScriptPath interface{} `json:"tempScriptPath,omitempty"` + // DistcpOptions - Specifies the Distcp options. Type: string (or Expression with resultType string). + DistcpOptions interface{} `json:"distcpOptions,omitempty"` +} + +// DocumentDbCollectionDataset microsoft Azure Document Database Collection dataset. +type DocumentDbCollectionDataset struct { + // DocumentDbCollectionDatasetTypeProperties - DocumentDB Collection dataset properties. + *DocumentDbCollectionDatasetTypeProperties `json:"typeProperties,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Description - Dataset description. + Description *string `json:"description,omitempty"` + // Structure - Columns that define the structure of the dataset. Type: array (or Expression with resultType array), itemType: DatasetDataElement. + Structure interface{} `json:"structure,omitempty"` + // LinkedServiceName - Linked service reference. + LinkedServiceName *LinkedServiceReference `json:"linkedServiceName,omitempty"` + // Parameters - Parameters for dataset. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeDataset', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSQLServerTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSalesforceObject', 'TypeRelationalTable', 'TypeAzureMySQLTable', 'TypeOracleTable', 'TypeODataResource', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeAzureDataLakeStoreFile', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeAmazonS3Object' + Type TypeBasicDataset `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for DocumentDbCollectionDataset. +func (ddcd DocumentDbCollectionDataset) MarshalJSON() ([]byte, error) { + ddcd.Type = TypeDocumentDbCollection + objectMap := make(map[string]interface{}) + if ddcd.DocumentDbCollectionDatasetTypeProperties != nil { + objectMap["typeProperties"] = ddcd.DocumentDbCollectionDatasetTypeProperties + } + if ddcd.Description != nil { + objectMap["description"] = ddcd.Description + } + objectMap["structure"] = ddcd.Structure + if ddcd.LinkedServiceName != nil { + objectMap["linkedServiceName"] = ddcd.LinkedServiceName + } + if ddcd.Parameters != nil { + objectMap["parameters"] = ddcd.Parameters + } + if ddcd.Annotations != nil { + objectMap["annotations"] = ddcd.Annotations + } + if ddcd.Type != "" { + objectMap["type"] = ddcd.Type + } + for k, v := range ddcd.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysObjectDataset is the BasicDataset implementation for DocumentDbCollectionDataset. +func (ddcd DocumentDbCollectionDataset) AsResponsysObjectDataset() (*ResponsysObjectDataset, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudObjectDataset is the BasicDataset implementation for DocumentDbCollectionDataset. +func (ddcd DocumentDbCollectionDataset) AsSalesforceMarketingCloudObjectDataset() (*SalesforceMarketingCloudObjectDataset, bool) { + return nil, false +} + +// AsVerticaTableDataset is the BasicDataset implementation for DocumentDbCollectionDataset. +func (ddcd DocumentDbCollectionDataset) AsVerticaTableDataset() (*VerticaTableDataset, bool) { + return nil, false +} + +// AsNetezzaTableDataset is the BasicDataset implementation for DocumentDbCollectionDataset. +func (ddcd DocumentDbCollectionDataset) AsNetezzaTableDataset() (*NetezzaTableDataset, bool) { + return nil, false +} + +// AsZohoObjectDataset is the BasicDataset implementation for DocumentDbCollectionDataset. +func (ddcd DocumentDbCollectionDataset) AsZohoObjectDataset() (*ZohoObjectDataset, bool) { + return nil, false +} + +// AsXeroObjectDataset is the BasicDataset implementation for DocumentDbCollectionDataset. +func (ddcd DocumentDbCollectionDataset) AsXeroObjectDataset() (*XeroObjectDataset, bool) { + return nil, false +} + +// AsSquareObjectDataset is the BasicDataset implementation for DocumentDbCollectionDataset. +func (ddcd DocumentDbCollectionDataset) AsSquareObjectDataset() (*SquareObjectDataset, bool) { + return nil, false +} + +// AsSparkObjectDataset is the BasicDataset implementation for DocumentDbCollectionDataset. +func (ddcd DocumentDbCollectionDataset) AsSparkObjectDataset() (*SparkObjectDataset, bool) { + return nil, false +} + +// AsShopifyObjectDataset is the BasicDataset implementation for DocumentDbCollectionDataset. +func (ddcd DocumentDbCollectionDataset) AsShopifyObjectDataset() (*ShopifyObjectDataset, bool) { + return nil, false +} + +// AsServiceNowObjectDataset is the BasicDataset implementation for DocumentDbCollectionDataset. +func (ddcd DocumentDbCollectionDataset) AsServiceNowObjectDataset() (*ServiceNowObjectDataset, bool) { + return nil, false +} + +// AsQuickBooksObjectDataset is the BasicDataset implementation for DocumentDbCollectionDataset. +func (ddcd DocumentDbCollectionDataset) AsQuickBooksObjectDataset() (*QuickBooksObjectDataset, bool) { + return nil, false +} + +// AsPrestoObjectDataset is the BasicDataset implementation for DocumentDbCollectionDataset. +func (ddcd DocumentDbCollectionDataset) AsPrestoObjectDataset() (*PrestoObjectDataset, bool) { + return nil, false +} + +// AsPhoenixObjectDataset is the BasicDataset implementation for DocumentDbCollectionDataset. +func (ddcd DocumentDbCollectionDataset) AsPhoenixObjectDataset() (*PhoenixObjectDataset, bool) { + return nil, false +} + +// AsPaypalObjectDataset is the BasicDataset implementation for DocumentDbCollectionDataset. +func (ddcd DocumentDbCollectionDataset) AsPaypalObjectDataset() (*PaypalObjectDataset, bool) { + return nil, false +} + +// AsMarketoObjectDataset is the BasicDataset implementation for DocumentDbCollectionDataset. +func (ddcd DocumentDbCollectionDataset) AsMarketoObjectDataset() (*MarketoObjectDataset, bool) { + return nil, false +} + +// AsMariaDBTableDataset is the BasicDataset implementation for DocumentDbCollectionDataset. +func (ddcd DocumentDbCollectionDataset) AsMariaDBTableDataset() (*MariaDBTableDataset, bool) { + return nil, false +} + +// AsMagentoObjectDataset is the BasicDataset implementation for DocumentDbCollectionDataset. +func (ddcd DocumentDbCollectionDataset) AsMagentoObjectDataset() (*MagentoObjectDataset, bool) { + return nil, false +} + +// AsJiraObjectDataset is the BasicDataset implementation for DocumentDbCollectionDataset. +func (ddcd DocumentDbCollectionDataset) AsJiraObjectDataset() (*JiraObjectDataset, bool) { + return nil, false +} + +// AsImpalaObjectDataset is the BasicDataset implementation for DocumentDbCollectionDataset. +func (ddcd DocumentDbCollectionDataset) AsImpalaObjectDataset() (*ImpalaObjectDataset, bool) { + return nil, false +} + +// AsHubspotObjectDataset is the BasicDataset implementation for DocumentDbCollectionDataset. +func (ddcd DocumentDbCollectionDataset) AsHubspotObjectDataset() (*HubspotObjectDataset, bool) { + return nil, false +} + +// AsHiveObjectDataset is the BasicDataset implementation for DocumentDbCollectionDataset. +func (ddcd DocumentDbCollectionDataset) AsHiveObjectDataset() (*HiveObjectDataset, bool) { + return nil, false +} + +// AsHBaseObjectDataset is the BasicDataset implementation for DocumentDbCollectionDataset. +func (ddcd DocumentDbCollectionDataset) AsHBaseObjectDataset() (*HBaseObjectDataset, bool) { + return nil, false +} + +// AsGreenplumTableDataset is the BasicDataset implementation for DocumentDbCollectionDataset. +func (ddcd DocumentDbCollectionDataset) AsGreenplumTableDataset() (*GreenplumTableDataset, bool) { + return nil, false +} + +// AsGoogleBigQueryObjectDataset is the BasicDataset implementation for DocumentDbCollectionDataset. +func (ddcd DocumentDbCollectionDataset) AsGoogleBigQueryObjectDataset() (*GoogleBigQueryObjectDataset, bool) { + return nil, false +} + +// AsEloquaObjectDataset is the BasicDataset implementation for DocumentDbCollectionDataset. +func (ddcd DocumentDbCollectionDataset) AsEloquaObjectDataset() (*EloquaObjectDataset, bool) { + return nil, false +} + +// AsDrillTableDataset is the BasicDataset implementation for DocumentDbCollectionDataset. +func (ddcd DocumentDbCollectionDataset) AsDrillTableDataset() (*DrillTableDataset, bool) { + return nil, false +} + +// AsCouchbaseTableDataset is the BasicDataset implementation for DocumentDbCollectionDataset. +func (ddcd DocumentDbCollectionDataset) AsCouchbaseTableDataset() (*CouchbaseTableDataset, bool) { + return nil, false +} + +// AsConcurObjectDataset is the BasicDataset implementation for DocumentDbCollectionDataset. +func (ddcd DocumentDbCollectionDataset) AsConcurObjectDataset() (*ConcurObjectDataset, bool) { + return nil, false +} + +// AsAzurePostgreSQLTableDataset is the BasicDataset implementation for DocumentDbCollectionDataset. +func (ddcd DocumentDbCollectionDataset) AsAzurePostgreSQLTableDataset() (*AzurePostgreSQLTableDataset, bool) { + return nil, false +} + +// AsAmazonMWSObjectDataset is the BasicDataset implementation for DocumentDbCollectionDataset. +func (ddcd DocumentDbCollectionDataset) AsAmazonMWSObjectDataset() (*AmazonMWSObjectDataset, bool) { + return nil, false +} + +// AsHTTPDataset is the BasicDataset implementation for DocumentDbCollectionDataset. +func (ddcd DocumentDbCollectionDataset) AsHTTPDataset() (*HTTPDataset, bool) { + return nil, false +} + +// AsAzureSearchIndexDataset is the BasicDataset implementation for DocumentDbCollectionDataset. +func (ddcd DocumentDbCollectionDataset) AsAzureSearchIndexDataset() (*AzureSearchIndexDataset, bool) { + return nil, false +} + +// AsWebTableDataset is the BasicDataset implementation for DocumentDbCollectionDataset. +func (ddcd DocumentDbCollectionDataset) AsWebTableDataset() (*WebTableDataset, bool) { + return nil, false +} + +// AsSQLServerTableDataset is the BasicDataset implementation for DocumentDbCollectionDataset. +func (ddcd DocumentDbCollectionDataset) AsSQLServerTableDataset() (*SQLServerTableDataset, bool) { + return nil, false +} + +// AsSapEccResourceDataset is the BasicDataset implementation for DocumentDbCollectionDataset. +func (ddcd DocumentDbCollectionDataset) AsSapEccResourceDataset() (*SapEccResourceDataset, bool) { + return nil, false +} + +// AsSapCloudForCustomerResourceDataset is the BasicDataset implementation for DocumentDbCollectionDataset. +func (ddcd DocumentDbCollectionDataset) AsSapCloudForCustomerResourceDataset() (*SapCloudForCustomerResourceDataset, bool) { + return nil, false +} + +// AsSalesforceObjectDataset is the BasicDataset implementation for DocumentDbCollectionDataset. +func (ddcd DocumentDbCollectionDataset) AsSalesforceObjectDataset() (*SalesforceObjectDataset, bool) { + return nil, false +} + +// AsRelationalTableDataset is the BasicDataset implementation for DocumentDbCollectionDataset. +func (ddcd DocumentDbCollectionDataset) AsRelationalTableDataset() (*RelationalTableDataset, bool) { + return nil, false +} + +// AsAzureMySQLTableDataset is the BasicDataset implementation for DocumentDbCollectionDataset. +func (ddcd DocumentDbCollectionDataset) AsAzureMySQLTableDataset() (*AzureMySQLTableDataset, bool) { + return nil, false +} + +// AsOracleTableDataset is the BasicDataset implementation for DocumentDbCollectionDataset. +func (ddcd DocumentDbCollectionDataset) AsOracleTableDataset() (*OracleTableDataset, bool) { + return nil, false +} + +// AsODataResourceDataset is the BasicDataset implementation for DocumentDbCollectionDataset. +func (ddcd DocumentDbCollectionDataset) AsODataResourceDataset() (*ODataResourceDataset, bool) { + return nil, false +} + +// AsMongoDbCollectionDataset is the BasicDataset implementation for DocumentDbCollectionDataset. +func (ddcd DocumentDbCollectionDataset) AsMongoDbCollectionDataset() (*MongoDbCollectionDataset, bool) { + return nil, false +} + +// AsFileShareDataset is the BasicDataset implementation for DocumentDbCollectionDataset. +func (ddcd DocumentDbCollectionDataset) AsFileShareDataset() (*FileShareDataset, bool) { + return nil, false +} + +// AsAzureDataLakeStoreDataset is the BasicDataset implementation for DocumentDbCollectionDataset. +func (ddcd DocumentDbCollectionDataset) AsAzureDataLakeStoreDataset() (*AzureDataLakeStoreDataset, bool) { + return nil, false +} + +// AsDynamicsEntityDataset is the BasicDataset implementation for DocumentDbCollectionDataset. +func (ddcd DocumentDbCollectionDataset) AsDynamicsEntityDataset() (*DynamicsEntityDataset, bool) { + return nil, false +} + +// AsDocumentDbCollectionDataset is the BasicDataset implementation for DocumentDbCollectionDataset. +func (ddcd DocumentDbCollectionDataset) AsDocumentDbCollectionDataset() (*DocumentDbCollectionDataset, bool) { + return &ddcd, true +} + +// AsCustomDataset is the BasicDataset implementation for DocumentDbCollectionDataset. +func (ddcd DocumentDbCollectionDataset) AsCustomDataset() (*CustomDataset, bool) { + return nil, false +} + +// AsCassandraTableDataset is the BasicDataset implementation for DocumentDbCollectionDataset. +func (ddcd DocumentDbCollectionDataset) AsCassandraTableDataset() (*CassandraTableDataset, bool) { + return nil, false +} + +// AsAzureSQLDWTableDataset is the BasicDataset implementation for DocumentDbCollectionDataset. +func (ddcd DocumentDbCollectionDataset) AsAzureSQLDWTableDataset() (*AzureSQLDWTableDataset, bool) { + return nil, false +} + +// AsAzureSQLTableDataset is the BasicDataset implementation for DocumentDbCollectionDataset. +func (ddcd DocumentDbCollectionDataset) AsAzureSQLTableDataset() (*AzureSQLTableDataset, bool) { + return nil, false +} + +// AsAzureTableDataset is the BasicDataset implementation for DocumentDbCollectionDataset. +func (ddcd DocumentDbCollectionDataset) AsAzureTableDataset() (*AzureTableDataset, bool) { + return nil, false +} + +// AsAzureBlobDataset is the BasicDataset implementation for DocumentDbCollectionDataset. +func (ddcd DocumentDbCollectionDataset) AsAzureBlobDataset() (*AzureBlobDataset, bool) { + return nil, false +} + +// AsAmazonS3Dataset is the BasicDataset implementation for DocumentDbCollectionDataset. +func (ddcd DocumentDbCollectionDataset) AsAmazonS3Dataset() (*AmazonS3Dataset, bool) { + return nil, false +} + +// AsDataset is the BasicDataset implementation for DocumentDbCollectionDataset. +func (ddcd DocumentDbCollectionDataset) AsDataset() (*Dataset, bool) { + return nil, false +} + +// AsBasicDataset is the BasicDataset implementation for DocumentDbCollectionDataset. +func (ddcd DocumentDbCollectionDataset) AsBasicDataset() (BasicDataset, bool) { + return &ddcd, true +} + +// UnmarshalJSON is the custom unmarshaler for DocumentDbCollectionDataset struct. +func (ddcd *DocumentDbCollectionDataset) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "typeProperties": + if v != nil { + var documentDbCollectionDatasetTypeProperties DocumentDbCollectionDatasetTypeProperties + err = json.Unmarshal(*v, &documentDbCollectionDatasetTypeProperties) + if err != nil { + return err + } + ddcd.DocumentDbCollectionDatasetTypeProperties = &documentDbCollectionDatasetTypeProperties + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if ddcd.AdditionalProperties == nil { + ddcd.AdditionalProperties = make(map[string]interface{}) + } + ddcd.AdditionalProperties[k] = additionalProperties + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + ddcd.Description = &description + } + case "structure": + if v != nil { + var structure interface{} + err = json.Unmarshal(*v, &structure) + if err != nil { + return err + } + ddcd.Structure = structure + } + case "linkedServiceName": + if v != nil { + var linkedServiceName LinkedServiceReference + err = json.Unmarshal(*v, &linkedServiceName) + if err != nil { + return err + } + ddcd.LinkedServiceName = &linkedServiceName + } + case "parameters": + if v != nil { + var parameters map[string]*ParameterSpecification + err = json.Unmarshal(*v, ¶meters) + if err != nil { + return err + } + ddcd.Parameters = parameters + } + case "annotations": + if v != nil { + var annotations []interface{} + err = json.Unmarshal(*v, &annotations) + if err != nil { + return err + } + ddcd.Annotations = &annotations + } + case "type": + if v != nil { + var typeVar TypeBasicDataset + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ddcd.Type = typeVar + } + } + } + + return nil +} + +// DocumentDbCollectionDatasetTypeProperties documentDB Collection dataset properties. +type DocumentDbCollectionDatasetTypeProperties struct { + // CollectionName - Document Database collection name. Type: string (or Expression with resultType string). + CollectionName interface{} `json:"collectionName,omitempty"` +} + +// DocumentDbCollectionSink a copy activity Document Database Collection sink. +type DocumentDbCollectionSink struct { + // NestingSeparator - Nested properties separator. Default is . (dot). Type: string (or Expression with resultType string). + NestingSeparator interface{} `json:"nestingSeparator,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // WriteBatchSize - Write batch size. Type: integer (or Expression with resultType integer), minimum: 0. + WriteBatchSize interface{} `json:"writeBatchSize,omitempty"` + // WriteBatchTimeout - Write batch timeout. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + WriteBatchTimeout interface{} `json:"writeBatchTimeout,omitempty"` + // SinkRetryCount - Sink retry count. Type: integer (or Expression with resultType integer). + SinkRetryCount interface{} `json:"sinkRetryCount,omitempty"` + // SinkRetryWait - Sink retry wait. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + SinkRetryWait interface{} `json:"sinkRetryWait,omitempty"` + // Type - Possible values include: 'TypeCopySink', 'TypeSalesforceSink', 'TypeDynamicsSink', 'TypeOdbcSink', 'TypeAzureSearchIndexSink', 'TypeAzureDataLakeStoreSink', 'TypeOracleSink', 'TypeSQLDWSink', 'TypeSQLSink', 'TypeDocumentDbCollectionSink', 'TypeFileSystemSink', 'TypeBlobSink', 'TypeAzureTableSink', 'TypeAzureQueueSink', 'TypeSapCloudForCustomerSink' + Type TypeBasicCopySink `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for DocumentDbCollectionSink. +func (ddcs DocumentDbCollectionSink) MarshalJSON() ([]byte, error) { + ddcs.Type = TypeDocumentDbCollectionSink + objectMap := make(map[string]interface{}) + objectMap["nestingSeparator"] = ddcs.NestingSeparator + objectMap["writeBatchSize"] = ddcs.WriteBatchSize + objectMap["writeBatchTimeout"] = ddcs.WriteBatchTimeout + objectMap["sinkRetryCount"] = ddcs.SinkRetryCount + objectMap["sinkRetryWait"] = ddcs.SinkRetryWait + if ddcs.Type != "" { + objectMap["type"] = ddcs.Type + } + for k, v := range ddcs.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsSalesforceSink is the BasicCopySink implementation for DocumentDbCollectionSink. +func (ddcs DocumentDbCollectionSink) AsSalesforceSink() (*SalesforceSink, bool) { + return nil, false +} + +// AsDynamicsSink is the BasicCopySink implementation for DocumentDbCollectionSink. +func (ddcs DocumentDbCollectionSink) AsDynamicsSink() (*DynamicsSink, bool) { + return nil, false +} + +// AsOdbcSink is the BasicCopySink implementation for DocumentDbCollectionSink. +func (ddcs DocumentDbCollectionSink) AsOdbcSink() (*OdbcSink, bool) { + return nil, false +} + +// AsAzureSearchIndexSink is the BasicCopySink implementation for DocumentDbCollectionSink. +func (ddcs DocumentDbCollectionSink) AsAzureSearchIndexSink() (*AzureSearchIndexSink, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSink is the BasicCopySink implementation for DocumentDbCollectionSink. +func (ddcs DocumentDbCollectionSink) AsAzureDataLakeStoreSink() (*AzureDataLakeStoreSink, bool) { + return nil, false +} + +// AsOracleSink is the BasicCopySink implementation for DocumentDbCollectionSink. +func (ddcs DocumentDbCollectionSink) AsOracleSink() (*OracleSink, bool) { + return nil, false +} + +// AsSQLDWSink is the BasicCopySink implementation for DocumentDbCollectionSink. +func (ddcs DocumentDbCollectionSink) AsSQLDWSink() (*SQLDWSink, bool) { + return nil, false +} + +// AsSQLSink is the BasicCopySink implementation for DocumentDbCollectionSink. +func (ddcs DocumentDbCollectionSink) AsSQLSink() (*SQLSink, bool) { + return nil, false +} + +// AsDocumentDbCollectionSink is the BasicCopySink implementation for DocumentDbCollectionSink. +func (ddcs DocumentDbCollectionSink) AsDocumentDbCollectionSink() (*DocumentDbCollectionSink, bool) { + return &ddcs, true +} + +// AsFileSystemSink is the BasicCopySink implementation for DocumentDbCollectionSink. +func (ddcs DocumentDbCollectionSink) AsFileSystemSink() (*FileSystemSink, bool) { + return nil, false +} + +// AsBlobSink is the BasicCopySink implementation for DocumentDbCollectionSink. +func (ddcs DocumentDbCollectionSink) AsBlobSink() (*BlobSink, bool) { + return nil, false +} + +// AsAzureTableSink is the BasicCopySink implementation for DocumentDbCollectionSink. +func (ddcs DocumentDbCollectionSink) AsAzureTableSink() (*AzureTableSink, bool) { + return nil, false +} + +// AsAzureQueueSink is the BasicCopySink implementation for DocumentDbCollectionSink. +func (ddcs DocumentDbCollectionSink) AsAzureQueueSink() (*AzureQueueSink, bool) { + return nil, false +} + +// AsSapCloudForCustomerSink is the BasicCopySink implementation for DocumentDbCollectionSink. +func (ddcs DocumentDbCollectionSink) AsSapCloudForCustomerSink() (*SapCloudForCustomerSink, bool) { + return nil, false +} + +// AsCopySink is the BasicCopySink implementation for DocumentDbCollectionSink. +func (ddcs DocumentDbCollectionSink) AsCopySink() (*CopySink, bool) { + return nil, false +} + +// AsBasicCopySink is the BasicCopySink implementation for DocumentDbCollectionSink. +func (ddcs DocumentDbCollectionSink) AsBasicCopySink() (BasicCopySink, bool) { + return &ddcs, true +} + +// DocumentDbCollectionSource a copy activity Document Database Collection source. +type DocumentDbCollectionSource struct { + // Query - Documents query. Type: string (or Expression with resultType string). + Query interface{} `json:"query,omitempty"` + // NestingSeparator - Nested properties separator. Type: string (or Expression with resultType string). + NestingSeparator interface{} `json:"nestingSeparator,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // SourceRetryCount - Source retry count. Type: integer (or Expression with resultType integer). + SourceRetryCount interface{} `json:"sourceRetryCount,omitempty"` + // SourceRetryWait - Source retry wait. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` + // Type - Possible values include: 'TypeCopySource', 'TypeAmazonRedshiftSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeHTTPSource', 'TypeAzureDataLakeStoreSource', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeRelationalSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource' + Type TypeBasicCopySource `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for DocumentDbCollectionSource. +func (ddcs DocumentDbCollectionSource) MarshalJSON() ([]byte, error) { + ddcs.Type = TypeDocumentDbCollectionSource + objectMap := make(map[string]interface{}) + objectMap["query"] = ddcs.Query + objectMap["nestingSeparator"] = ddcs.NestingSeparator + objectMap["sourceRetryCount"] = ddcs.SourceRetryCount + objectMap["sourceRetryWait"] = ddcs.SourceRetryWait + if ddcs.Type != "" { + objectMap["type"] = ddcs.Type + } + for k, v := range ddcs.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsAmazonRedshiftSource is the BasicCopySource implementation for DocumentDbCollectionSource. +func (ddcs DocumentDbCollectionSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { + return nil, false +} + +// AsResponsysSource is the BasicCopySource implementation for DocumentDbCollectionSource. +func (ddcs DocumentDbCollectionSource) AsResponsysSource() (*ResponsysSource, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudSource is the BasicCopySource implementation for DocumentDbCollectionSource. +func (ddcs DocumentDbCollectionSource) AsSalesforceMarketingCloudSource() (*SalesforceMarketingCloudSource, bool) { + return nil, false +} + +// AsVerticaSource is the BasicCopySource implementation for DocumentDbCollectionSource. +func (ddcs DocumentDbCollectionSource) AsVerticaSource() (*VerticaSource, bool) { + return nil, false +} + +// AsNetezzaSource is the BasicCopySource implementation for DocumentDbCollectionSource. +func (ddcs DocumentDbCollectionSource) AsNetezzaSource() (*NetezzaSource, bool) { + return nil, false +} + +// AsZohoSource is the BasicCopySource implementation for DocumentDbCollectionSource. +func (ddcs DocumentDbCollectionSource) AsZohoSource() (*ZohoSource, bool) { + return nil, false +} + +// AsXeroSource is the BasicCopySource implementation for DocumentDbCollectionSource. +func (ddcs DocumentDbCollectionSource) AsXeroSource() (*XeroSource, bool) { + return nil, false +} + +// AsSquareSource is the BasicCopySource implementation for DocumentDbCollectionSource. +func (ddcs DocumentDbCollectionSource) AsSquareSource() (*SquareSource, bool) { + return nil, false +} + +// AsSparkSource is the BasicCopySource implementation for DocumentDbCollectionSource. +func (ddcs DocumentDbCollectionSource) AsSparkSource() (*SparkSource, bool) { + return nil, false +} + +// AsShopifySource is the BasicCopySource implementation for DocumentDbCollectionSource. +func (ddcs DocumentDbCollectionSource) AsShopifySource() (*ShopifySource, bool) { + return nil, false +} + +// AsServiceNowSource is the BasicCopySource implementation for DocumentDbCollectionSource. +func (ddcs DocumentDbCollectionSource) AsServiceNowSource() (*ServiceNowSource, bool) { + return nil, false +} + +// AsQuickBooksSource is the BasicCopySource implementation for DocumentDbCollectionSource. +func (ddcs DocumentDbCollectionSource) AsQuickBooksSource() (*QuickBooksSource, bool) { + return nil, false +} + +// AsPrestoSource is the BasicCopySource implementation for DocumentDbCollectionSource. +func (ddcs DocumentDbCollectionSource) AsPrestoSource() (*PrestoSource, bool) { + return nil, false +} + +// AsPhoenixSource is the BasicCopySource implementation for DocumentDbCollectionSource. +func (ddcs DocumentDbCollectionSource) AsPhoenixSource() (*PhoenixSource, bool) { + return nil, false +} + +// AsPaypalSource is the BasicCopySource implementation for DocumentDbCollectionSource. +func (ddcs DocumentDbCollectionSource) AsPaypalSource() (*PaypalSource, bool) { + return nil, false +} + +// AsMarketoSource is the BasicCopySource implementation for DocumentDbCollectionSource. +func (ddcs DocumentDbCollectionSource) AsMarketoSource() (*MarketoSource, bool) { + return nil, false +} + +// AsMariaDBSource is the BasicCopySource implementation for DocumentDbCollectionSource. +func (ddcs DocumentDbCollectionSource) AsMariaDBSource() (*MariaDBSource, bool) { + return nil, false +} + +// AsMagentoSource is the BasicCopySource implementation for DocumentDbCollectionSource. +func (ddcs DocumentDbCollectionSource) AsMagentoSource() (*MagentoSource, bool) { + return nil, false +} + +// AsJiraSource is the BasicCopySource implementation for DocumentDbCollectionSource. +func (ddcs DocumentDbCollectionSource) AsJiraSource() (*JiraSource, bool) { + return nil, false +} + +// AsImpalaSource is the BasicCopySource implementation for DocumentDbCollectionSource. +func (ddcs DocumentDbCollectionSource) AsImpalaSource() (*ImpalaSource, bool) { + return nil, false +} + +// AsHubspotSource is the BasicCopySource implementation for DocumentDbCollectionSource. +func (ddcs DocumentDbCollectionSource) AsHubspotSource() (*HubspotSource, bool) { + return nil, false +} + +// AsHiveSource is the BasicCopySource implementation for DocumentDbCollectionSource. +func (ddcs DocumentDbCollectionSource) AsHiveSource() (*HiveSource, bool) { + return nil, false +} + +// AsHBaseSource is the BasicCopySource implementation for DocumentDbCollectionSource. +func (ddcs DocumentDbCollectionSource) AsHBaseSource() (*HBaseSource, bool) { + return nil, false +} + +// AsGreenplumSource is the BasicCopySource implementation for DocumentDbCollectionSource. +func (ddcs DocumentDbCollectionSource) AsGreenplumSource() (*GreenplumSource, bool) { + return nil, false +} + +// AsGoogleBigQuerySource is the BasicCopySource implementation for DocumentDbCollectionSource. +func (ddcs DocumentDbCollectionSource) AsGoogleBigQuerySource() (*GoogleBigQuerySource, bool) { + return nil, false +} + +// AsEloquaSource is the BasicCopySource implementation for DocumentDbCollectionSource. +func (ddcs DocumentDbCollectionSource) AsEloquaSource() (*EloquaSource, bool) { + return nil, false +} + +// AsDrillSource is the BasicCopySource implementation for DocumentDbCollectionSource. +func (ddcs DocumentDbCollectionSource) AsDrillSource() (*DrillSource, bool) { + return nil, false +} + +// AsCouchbaseSource is the BasicCopySource implementation for DocumentDbCollectionSource. +func (ddcs DocumentDbCollectionSource) AsCouchbaseSource() (*CouchbaseSource, bool) { + return nil, false +} + +// AsConcurSource is the BasicCopySource implementation for DocumentDbCollectionSource. +func (ddcs DocumentDbCollectionSource) AsConcurSource() (*ConcurSource, bool) { + return nil, false +} + +// AsAzurePostgreSQLSource is the BasicCopySource implementation for DocumentDbCollectionSource. +func (ddcs DocumentDbCollectionSource) AsAzurePostgreSQLSource() (*AzurePostgreSQLSource, bool) { + return nil, false +} + +// AsAmazonMWSSource is the BasicCopySource implementation for DocumentDbCollectionSource. +func (ddcs DocumentDbCollectionSource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { + return nil, false +} + +// AsHTTPSource is the BasicCopySource implementation for DocumentDbCollectionSource. +func (ddcs DocumentDbCollectionSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for DocumentDbCollectionSource. +func (ddcs DocumentDbCollectionSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for DocumentDbCollectionSource. +func (ddcs DocumentDbCollectionSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsCassandraSource is the BasicCopySource implementation for DocumentDbCollectionSource. +func (ddcs DocumentDbCollectionSource) AsCassandraSource() (*CassandraSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for DocumentDbCollectionSource. +func (ddcs DocumentDbCollectionSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for DocumentDbCollectionSource. +func (ddcs DocumentDbCollectionSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureMySQLSource is the BasicCopySource implementation for DocumentDbCollectionSource. +func (ddcs DocumentDbCollectionSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for DocumentDbCollectionSource. +func (ddcs DocumentDbCollectionSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for DocumentDbCollectionSource. +func (ddcs DocumentDbCollectionSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsSQLDWSource is the BasicCopySource implementation for DocumentDbCollectionSource. +func (ddcs DocumentDbCollectionSource) AsSQLDWSource() (*SQLDWSource, bool) { + return nil, false +} + +// AsSQLSource is the BasicCopySource implementation for DocumentDbCollectionSource. +func (ddcs DocumentDbCollectionSource) AsSQLSource() (*SQLSource, bool) { + return nil, false +} + +// AsSapEccSource is the BasicCopySource implementation for DocumentDbCollectionSource. +func (ddcs DocumentDbCollectionSource) AsSapEccSource() (*SapEccSource, bool) { + return nil, false +} + +// AsSapCloudForCustomerSource is the BasicCopySource implementation for DocumentDbCollectionSource. +func (ddcs DocumentDbCollectionSource) AsSapCloudForCustomerSource() (*SapCloudForCustomerSource, bool) { + return nil, false +} + +// AsSalesforceSource is the BasicCopySource implementation for DocumentDbCollectionSource. +func (ddcs DocumentDbCollectionSource) AsSalesforceSource() (*SalesforceSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for DocumentDbCollectionSource. +func (ddcs DocumentDbCollectionSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for DocumentDbCollectionSource. +func (ddcs DocumentDbCollectionSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for DocumentDbCollectionSource. +func (ddcs DocumentDbCollectionSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return &ddcs, true +} + +// AsBlobSource is the BasicCopySource implementation for DocumentDbCollectionSource. +func (ddcs DocumentDbCollectionSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + +// AsAzureTableSource is the BasicCopySource implementation for DocumentDbCollectionSource. +func (ddcs DocumentDbCollectionSource) AsAzureTableSource() (*AzureTableSource, bool) { + return nil, false +} + +// AsCopySource is the BasicCopySource implementation for DocumentDbCollectionSource. +func (ddcs DocumentDbCollectionSource) AsCopySource() (*CopySource, bool) { + return nil, false +} + +// AsBasicCopySource is the BasicCopySource implementation for DocumentDbCollectionSource. +func (ddcs DocumentDbCollectionSource) AsBasicCopySource() (BasicCopySource, bool) { + return &ddcs, true +} + +// DrillLinkedService drill server linked service. +type DrillLinkedService struct { + // DrillLinkedServiceTypeProperties - Drill server linked service properties. + *DrillLinkedServiceTypeProperties `json:"typeProperties,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // ConnectVia - The integration runtime reference. + ConnectVia *IntegrationRuntimeReference `json:"connectVia,omitempty"` + // Description - Linked service description. + Description *string `json:"description,omitempty"` + // Parameters - Parameters for linked service. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeLinkedService', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforce', 'TypeAzureDataLakeStore', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureStorage' + Type TypeBasicLinkedService `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for DrillLinkedService. +func (dls DrillLinkedService) MarshalJSON() ([]byte, error) { + dls.Type = TypeDrill + objectMap := make(map[string]interface{}) + if dls.DrillLinkedServiceTypeProperties != nil { + objectMap["typeProperties"] = dls.DrillLinkedServiceTypeProperties + } + if dls.ConnectVia != nil { + objectMap["connectVia"] = dls.ConnectVia + } + if dls.Description != nil { + objectMap["description"] = dls.Description + } + if dls.Parameters != nil { + objectMap["parameters"] = dls.Parameters + } + if dls.Annotations != nil { + objectMap["annotations"] = dls.Annotations + } + if dls.Type != "" { + objectMap["type"] = dls.Type + } + for k, v := range dls.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysLinkedService is the BasicLinkedService implementation for DrillLinkedService. +func (dls DrillLinkedService) AsResponsysLinkedService() (*ResponsysLinkedService, bool) { + return nil, false +} + +// AsAzureDatabricksLinkedService is the BasicLinkedService implementation for DrillLinkedService. +func (dls DrillLinkedService) AsAzureDatabricksLinkedService() (*AzureDatabricksLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeAnalyticsLinkedService is the BasicLinkedService implementation for DrillLinkedService. +func (dls DrillLinkedService) AsAzureDataLakeAnalyticsLinkedService() (*AzureDataLakeAnalyticsLinkedService, bool) { + return nil, false +} + +// AsHDInsightOnDemandLinkedService is the BasicLinkedService implementation for DrillLinkedService. +func (dls DrillLinkedService) AsHDInsightOnDemandLinkedService() (*HDInsightOnDemandLinkedService, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudLinkedService is the BasicLinkedService implementation for DrillLinkedService. +func (dls DrillLinkedService) AsSalesforceMarketingCloudLinkedService() (*SalesforceMarketingCloudLinkedService, bool) { + return nil, false +} + +// AsNetezzaLinkedService is the BasicLinkedService implementation for DrillLinkedService. +func (dls DrillLinkedService) AsNetezzaLinkedService() (*NetezzaLinkedService, bool) { + return nil, false +} + +// AsVerticaLinkedService is the BasicLinkedService implementation for DrillLinkedService. +func (dls DrillLinkedService) AsVerticaLinkedService() (*VerticaLinkedService, bool) { + return nil, false +} + +// AsZohoLinkedService is the BasicLinkedService implementation for DrillLinkedService. +func (dls DrillLinkedService) AsZohoLinkedService() (*ZohoLinkedService, bool) { + return nil, false +} + +// AsXeroLinkedService is the BasicLinkedService implementation for DrillLinkedService. +func (dls DrillLinkedService) AsXeroLinkedService() (*XeroLinkedService, bool) { + return nil, false +} + +// AsSquareLinkedService is the BasicLinkedService implementation for DrillLinkedService. +func (dls DrillLinkedService) AsSquareLinkedService() (*SquareLinkedService, bool) { + return nil, false +} + +// AsSparkLinkedService is the BasicLinkedService implementation for DrillLinkedService. +func (dls DrillLinkedService) AsSparkLinkedService() (*SparkLinkedService, bool) { + return nil, false +} + +// AsShopifyLinkedService is the BasicLinkedService implementation for DrillLinkedService. +func (dls DrillLinkedService) AsShopifyLinkedService() (*ShopifyLinkedService, bool) { + return nil, false +} + +// AsServiceNowLinkedService is the BasicLinkedService implementation for DrillLinkedService. +func (dls DrillLinkedService) AsServiceNowLinkedService() (*ServiceNowLinkedService, bool) { + return nil, false +} + +// AsQuickBooksLinkedService is the BasicLinkedService implementation for DrillLinkedService. +func (dls DrillLinkedService) AsQuickBooksLinkedService() (*QuickBooksLinkedService, bool) { + return nil, false +} + +// AsPrestoLinkedService is the BasicLinkedService implementation for DrillLinkedService. +func (dls DrillLinkedService) AsPrestoLinkedService() (*PrestoLinkedService, bool) { + return nil, false +} + +// AsPhoenixLinkedService is the BasicLinkedService implementation for DrillLinkedService. +func (dls DrillLinkedService) AsPhoenixLinkedService() (*PhoenixLinkedService, bool) { + return nil, false +} + +// AsPaypalLinkedService is the BasicLinkedService implementation for DrillLinkedService. +func (dls DrillLinkedService) AsPaypalLinkedService() (*PaypalLinkedService, bool) { + return nil, false +} + +// AsMarketoLinkedService is the BasicLinkedService implementation for DrillLinkedService. +func (dls DrillLinkedService) AsMarketoLinkedService() (*MarketoLinkedService, bool) { + return nil, false +} + +// AsMariaDBLinkedService is the BasicLinkedService implementation for DrillLinkedService. +func (dls DrillLinkedService) AsMariaDBLinkedService() (*MariaDBLinkedService, bool) { + return nil, false +} + +// AsMagentoLinkedService is the BasicLinkedService implementation for DrillLinkedService. +func (dls DrillLinkedService) AsMagentoLinkedService() (*MagentoLinkedService, bool) { + return nil, false +} + +// AsJiraLinkedService is the BasicLinkedService implementation for DrillLinkedService. +func (dls DrillLinkedService) AsJiraLinkedService() (*JiraLinkedService, bool) { + return nil, false +} + +// AsImpalaLinkedService is the BasicLinkedService implementation for DrillLinkedService. +func (dls DrillLinkedService) AsImpalaLinkedService() (*ImpalaLinkedService, bool) { + return nil, false +} + +// AsHubspotLinkedService is the BasicLinkedService implementation for DrillLinkedService. +func (dls DrillLinkedService) AsHubspotLinkedService() (*HubspotLinkedService, bool) { + return nil, false +} + +// AsHiveLinkedService is the BasicLinkedService implementation for DrillLinkedService. +func (dls DrillLinkedService) AsHiveLinkedService() (*HiveLinkedService, bool) { + return nil, false +} + +// AsHBaseLinkedService is the BasicLinkedService implementation for DrillLinkedService. +func (dls DrillLinkedService) AsHBaseLinkedService() (*HBaseLinkedService, bool) { + return nil, false +} + +// AsGreenplumLinkedService is the BasicLinkedService implementation for DrillLinkedService. +func (dls DrillLinkedService) AsGreenplumLinkedService() (*GreenplumLinkedService, bool) { + return nil, false +} + +// AsGoogleBigQueryLinkedService is the BasicLinkedService implementation for DrillLinkedService. +func (dls DrillLinkedService) AsGoogleBigQueryLinkedService() (*GoogleBigQueryLinkedService, bool) { + return nil, false +} + +// AsEloquaLinkedService is the BasicLinkedService implementation for DrillLinkedService. +func (dls DrillLinkedService) AsEloquaLinkedService() (*EloquaLinkedService, bool) { + return nil, false +} + +// AsDrillLinkedService is the BasicLinkedService implementation for DrillLinkedService. +func (dls DrillLinkedService) AsDrillLinkedService() (*DrillLinkedService, bool) { + return &dls, true +} + +// AsCouchbaseLinkedService is the BasicLinkedService implementation for DrillLinkedService. +func (dls DrillLinkedService) AsCouchbaseLinkedService() (*CouchbaseLinkedService, bool) { + return nil, false +} + +// AsConcurLinkedService is the BasicLinkedService implementation for DrillLinkedService. +func (dls DrillLinkedService) AsConcurLinkedService() (*ConcurLinkedService, bool) { + return nil, false +} + +// AsAzurePostgreSQLLinkedService is the BasicLinkedService implementation for DrillLinkedService. +func (dls DrillLinkedService) AsAzurePostgreSQLLinkedService() (*AzurePostgreSQLLinkedService, bool) { + return nil, false +} + +// AsAmazonMWSLinkedService is the BasicLinkedService implementation for DrillLinkedService. +func (dls DrillLinkedService) AsAmazonMWSLinkedService() (*AmazonMWSLinkedService, bool) { + return nil, false +} + +// AsSapHanaLinkedService is the BasicLinkedService implementation for DrillLinkedService. +func (dls DrillLinkedService) AsSapHanaLinkedService() (*SapHanaLinkedService, bool) { + return nil, false +} + +// AsSapBWLinkedService is the BasicLinkedService implementation for DrillLinkedService. +func (dls DrillLinkedService) AsSapBWLinkedService() (*SapBWLinkedService, bool) { + return nil, false +} + +// AsSftpServerLinkedService is the BasicLinkedService implementation for DrillLinkedService. +func (dls DrillLinkedService) AsSftpServerLinkedService() (*SftpServerLinkedService, bool) { + return nil, false +} + +// AsFtpServerLinkedService is the BasicLinkedService implementation for DrillLinkedService. +func (dls DrillLinkedService) AsFtpServerLinkedService() (*FtpServerLinkedService, bool) { + return nil, false +} + +// AsHTTPLinkedService is the BasicLinkedService implementation for DrillLinkedService. +func (dls DrillLinkedService) AsHTTPLinkedService() (*HTTPLinkedService, bool) { + return nil, false +} + +// AsAzureSearchLinkedService is the BasicLinkedService implementation for DrillLinkedService. +func (dls DrillLinkedService) AsAzureSearchLinkedService() (*AzureSearchLinkedService, bool) { + return nil, false +} + +// AsCustomDataSourceLinkedService is the BasicLinkedService implementation for DrillLinkedService. +func (dls DrillLinkedService) AsCustomDataSourceLinkedService() (*CustomDataSourceLinkedService, bool) { + return nil, false +} + +// AsAmazonRedshiftLinkedService is the BasicLinkedService implementation for DrillLinkedService. +func (dls DrillLinkedService) AsAmazonRedshiftLinkedService() (*AmazonRedshiftLinkedService, bool) { + return nil, false +} + +// AsAmazonS3LinkedService is the BasicLinkedService implementation for DrillLinkedService. +func (dls DrillLinkedService) AsAmazonS3LinkedService() (*AmazonS3LinkedService, bool) { + return nil, false +} + +// AsSapEccLinkedService is the BasicLinkedService implementation for DrillLinkedService. +func (dls DrillLinkedService) AsSapEccLinkedService() (*SapEccLinkedService, bool) { + return nil, false +} + +// AsSapCloudForCustomerLinkedService is the BasicLinkedService implementation for DrillLinkedService. +func (dls DrillLinkedService) AsSapCloudForCustomerLinkedService() (*SapCloudForCustomerLinkedService, bool) { + return nil, false +} + +// AsSalesforceLinkedService is the BasicLinkedService implementation for DrillLinkedService. +func (dls DrillLinkedService) AsSalesforceLinkedService() (*SalesforceLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeStoreLinkedService is the BasicLinkedService implementation for DrillLinkedService. +func (dls DrillLinkedService) AsAzureDataLakeStoreLinkedService() (*AzureDataLakeStoreLinkedService, bool) { + return nil, false +} + +// AsMongoDbLinkedService is the BasicLinkedService implementation for DrillLinkedService. +func (dls DrillLinkedService) AsMongoDbLinkedService() (*MongoDbLinkedService, bool) { + return nil, false +} + +// AsCassandraLinkedService is the BasicLinkedService implementation for DrillLinkedService. +func (dls DrillLinkedService) AsCassandraLinkedService() (*CassandraLinkedService, bool) { + return nil, false +} + +// AsWebLinkedService is the BasicLinkedService implementation for DrillLinkedService. +func (dls DrillLinkedService) AsWebLinkedService() (*WebLinkedService, bool) { + return nil, false +} + +// AsODataLinkedService is the BasicLinkedService implementation for DrillLinkedService. +func (dls DrillLinkedService) AsODataLinkedService() (*ODataLinkedService, bool) { + return nil, false +} + +// AsHdfsLinkedService is the BasicLinkedService implementation for DrillLinkedService. +func (dls DrillLinkedService) AsHdfsLinkedService() (*HdfsLinkedService, bool) { + return nil, false +} + +// AsOdbcLinkedService is the BasicLinkedService implementation for DrillLinkedService. +func (dls DrillLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, bool) { + return nil, false +} + +// AsAzureMLLinkedService is the BasicLinkedService implementation for DrillLinkedService. +func (dls DrillLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { + return nil, false +} + +// AsTeradataLinkedService is the BasicLinkedService implementation for DrillLinkedService. +func (dls DrillLinkedService) AsTeradataLinkedService() (*TeradataLinkedService, bool) { + return nil, false +} + +// AsDb2LinkedService is the BasicLinkedService implementation for DrillLinkedService. +func (dls DrillLinkedService) AsDb2LinkedService() (*Db2LinkedService, bool) { + return nil, false +} + +// AsSybaseLinkedService is the BasicLinkedService implementation for DrillLinkedService. +func (dls DrillLinkedService) AsSybaseLinkedService() (*SybaseLinkedService, bool) { + return nil, false +} + +// AsPostgreSQLLinkedService is the BasicLinkedService implementation for DrillLinkedService. +func (dls DrillLinkedService) AsPostgreSQLLinkedService() (*PostgreSQLLinkedService, bool) { + return nil, false +} + +// AsMySQLLinkedService is the BasicLinkedService implementation for DrillLinkedService. +func (dls DrillLinkedService) AsMySQLLinkedService() (*MySQLLinkedService, bool) { + return nil, false +} + +// AsAzureMySQLLinkedService is the BasicLinkedService implementation for DrillLinkedService. +func (dls DrillLinkedService) AsAzureMySQLLinkedService() (*AzureMySQLLinkedService, bool) { + return nil, false +} + +// AsOracleLinkedService is the BasicLinkedService implementation for DrillLinkedService. +func (dls DrillLinkedService) AsOracleLinkedService() (*OracleLinkedService, bool) { + return nil, false +} + +// AsFileServerLinkedService is the BasicLinkedService implementation for DrillLinkedService. +func (dls DrillLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { + return nil, false +} + +// AsHDInsightLinkedService is the BasicLinkedService implementation for DrillLinkedService. +func (dls DrillLinkedService) AsHDInsightLinkedService() (*HDInsightLinkedService, bool) { + return nil, false +} + +// AsDynamicsLinkedService is the BasicLinkedService implementation for DrillLinkedService. +func (dls DrillLinkedService) AsDynamicsLinkedService() (*DynamicsLinkedService, bool) { + return nil, false +} + +// AsCosmosDbLinkedService is the BasicLinkedService implementation for DrillLinkedService. +func (dls DrillLinkedService) AsCosmosDbLinkedService() (*CosmosDbLinkedService, bool) { + return nil, false +} + +// AsAzureKeyVaultLinkedService is the BasicLinkedService implementation for DrillLinkedService. +func (dls DrillLinkedService) AsAzureKeyVaultLinkedService() (*AzureKeyVaultLinkedService, bool) { + return nil, false +} + +// AsAzureBatchLinkedService is the BasicLinkedService implementation for DrillLinkedService. +func (dls DrillLinkedService) AsAzureBatchLinkedService() (*AzureBatchLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDatabaseLinkedService is the BasicLinkedService implementation for DrillLinkedService. +func (dls DrillLinkedService) AsAzureSQLDatabaseLinkedService() (*AzureSQLDatabaseLinkedService, bool) { + return nil, false +} + +// AsSQLServerLinkedService is the BasicLinkedService implementation for DrillLinkedService. +func (dls DrillLinkedService) AsSQLServerLinkedService() (*SQLServerLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDWLinkedService is the BasicLinkedService implementation for DrillLinkedService. +func (dls DrillLinkedService) AsAzureSQLDWLinkedService() (*AzureSQLDWLinkedService, bool) { + return nil, false +} + +// AsAzureStorageLinkedService is the BasicLinkedService implementation for DrillLinkedService. +func (dls DrillLinkedService) AsAzureStorageLinkedService() (*AzureStorageLinkedService, bool) { + return nil, false +} + +// AsLinkedService is the BasicLinkedService implementation for DrillLinkedService. +func (dls DrillLinkedService) AsLinkedService() (*LinkedService, bool) { + return nil, false +} + +// AsBasicLinkedService is the BasicLinkedService implementation for DrillLinkedService. +func (dls DrillLinkedService) AsBasicLinkedService() (BasicLinkedService, bool) { + return &dls, true +} + +// UnmarshalJSON is the custom unmarshaler for DrillLinkedService struct. +func (dls *DrillLinkedService) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "typeProperties": + if v != nil { + var drillLinkedServiceTypeProperties DrillLinkedServiceTypeProperties + err = json.Unmarshal(*v, &drillLinkedServiceTypeProperties) + if err != nil { + return err + } + dls.DrillLinkedServiceTypeProperties = &drillLinkedServiceTypeProperties + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if dls.AdditionalProperties == nil { + dls.AdditionalProperties = make(map[string]interface{}) + } + dls.AdditionalProperties[k] = additionalProperties + } + case "connectVia": + if v != nil { + var connectVia IntegrationRuntimeReference + err = json.Unmarshal(*v, &connectVia) + if err != nil { + return err + } + dls.ConnectVia = &connectVia + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + dls.Description = &description + } + case "parameters": + if v != nil { + var parameters map[string]*ParameterSpecification + err = json.Unmarshal(*v, ¶meters) + if err != nil { + return err + } + dls.Parameters = parameters + } + case "annotations": + if v != nil { + var annotations []interface{} + err = json.Unmarshal(*v, &annotations) + if err != nil { + return err + } + dls.Annotations = &annotations + } + case "type": + if v != nil { + var typeVar TypeBasicLinkedService + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + dls.Type = typeVar + } + } + } + + return nil +} + +// DrillLinkedServiceTypeProperties drill server linked service properties. +type DrillLinkedServiceTypeProperties struct { + // ConnectionString - An ODBC connection string. Type: string, SecureString or AzureKeyVaultSecretReference. + ConnectionString interface{} `json:"connectionString,omitempty"` + // EncryptedCredential - The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string). + EncryptedCredential interface{} `json:"encryptedCredential,omitempty"` +} + +// DrillSource a copy activity Drill server source. +type DrillSource struct { + // Query - A query to retrieve data from source. Type: string (or Expression with resultType string). + Query interface{} `json:"query,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // SourceRetryCount - Source retry count. Type: integer (or Expression with resultType integer). + SourceRetryCount interface{} `json:"sourceRetryCount,omitempty"` + // SourceRetryWait - Source retry wait. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` + // Type - Possible values include: 'TypeCopySource', 'TypeAmazonRedshiftSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeHTTPSource', 'TypeAzureDataLakeStoreSource', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeRelationalSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource' + Type TypeBasicCopySource `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for DrillSource. +func (ds DrillSource) MarshalJSON() ([]byte, error) { + ds.Type = TypeDrillSource + objectMap := make(map[string]interface{}) + objectMap["query"] = ds.Query + objectMap["sourceRetryCount"] = ds.SourceRetryCount + objectMap["sourceRetryWait"] = ds.SourceRetryWait + if ds.Type != "" { + objectMap["type"] = ds.Type + } + for k, v := range ds.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsAmazonRedshiftSource is the BasicCopySource implementation for DrillSource. +func (ds DrillSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { + return nil, false +} + +// AsResponsysSource is the BasicCopySource implementation for DrillSource. +func (ds DrillSource) AsResponsysSource() (*ResponsysSource, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudSource is the BasicCopySource implementation for DrillSource. +func (ds DrillSource) AsSalesforceMarketingCloudSource() (*SalesforceMarketingCloudSource, bool) { + return nil, false +} + +// AsVerticaSource is the BasicCopySource implementation for DrillSource. +func (ds DrillSource) AsVerticaSource() (*VerticaSource, bool) { + return nil, false +} + +// AsNetezzaSource is the BasicCopySource implementation for DrillSource. +func (ds DrillSource) AsNetezzaSource() (*NetezzaSource, bool) { + return nil, false +} + +// AsZohoSource is the BasicCopySource implementation for DrillSource. +func (ds DrillSource) AsZohoSource() (*ZohoSource, bool) { + return nil, false +} + +// AsXeroSource is the BasicCopySource implementation for DrillSource. +func (ds DrillSource) AsXeroSource() (*XeroSource, bool) { + return nil, false +} + +// AsSquareSource is the BasicCopySource implementation for DrillSource. +func (ds DrillSource) AsSquareSource() (*SquareSource, bool) { + return nil, false +} + +// AsSparkSource is the BasicCopySource implementation for DrillSource. +func (ds DrillSource) AsSparkSource() (*SparkSource, bool) { + return nil, false +} + +// AsShopifySource is the BasicCopySource implementation for DrillSource. +func (ds DrillSource) AsShopifySource() (*ShopifySource, bool) { + return nil, false +} + +// AsServiceNowSource is the BasicCopySource implementation for DrillSource. +func (ds DrillSource) AsServiceNowSource() (*ServiceNowSource, bool) { + return nil, false +} + +// AsQuickBooksSource is the BasicCopySource implementation for DrillSource. +func (ds DrillSource) AsQuickBooksSource() (*QuickBooksSource, bool) { + return nil, false +} + +// AsPrestoSource is the BasicCopySource implementation for DrillSource. +func (ds DrillSource) AsPrestoSource() (*PrestoSource, bool) { + return nil, false +} + +// AsPhoenixSource is the BasicCopySource implementation for DrillSource. +func (ds DrillSource) AsPhoenixSource() (*PhoenixSource, bool) { + return nil, false +} + +// AsPaypalSource is the BasicCopySource implementation for DrillSource. +func (ds DrillSource) AsPaypalSource() (*PaypalSource, bool) { + return nil, false +} + +// AsMarketoSource is the BasicCopySource implementation for DrillSource. +func (ds DrillSource) AsMarketoSource() (*MarketoSource, bool) { + return nil, false +} + +// AsMariaDBSource is the BasicCopySource implementation for DrillSource. +func (ds DrillSource) AsMariaDBSource() (*MariaDBSource, bool) { + return nil, false +} + +// AsMagentoSource is the BasicCopySource implementation for DrillSource. +func (ds DrillSource) AsMagentoSource() (*MagentoSource, bool) { + return nil, false +} + +// AsJiraSource is the BasicCopySource implementation for DrillSource. +func (ds DrillSource) AsJiraSource() (*JiraSource, bool) { + return nil, false +} + +// AsImpalaSource is the BasicCopySource implementation for DrillSource. +func (ds DrillSource) AsImpalaSource() (*ImpalaSource, bool) { + return nil, false +} + +// AsHubspotSource is the BasicCopySource implementation for DrillSource. +func (ds DrillSource) AsHubspotSource() (*HubspotSource, bool) { + return nil, false +} + +// AsHiveSource is the BasicCopySource implementation for DrillSource. +func (ds DrillSource) AsHiveSource() (*HiveSource, bool) { + return nil, false +} + +// AsHBaseSource is the BasicCopySource implementation for DrillSource. +func (ds DrillSource) AsHBaseSource() (*HBaseSource, bool) { + return nil, false +} + +// AsGreenplumSource is the BasicCopySource implementation for DrillSource. +func (ds DrillSource) AsGreenplumSource() (*GreenplumSource, bool) { + return nil, false +} + +// AsGoogleBigQuerySource is the BasicCopySource implementation for DrillSource. +func (ds DrillSource) AsGoogleBigQuerySource() (*GoogleBigQuerySource, bool) { + return nil, false +} + +// AsEloquaSource is the BasicCopySource implementation for DrillSource. +func (ds DrillSource) AsEloquaSource() (*EloquaSource, bool) { + return nil, false +} + +// AsDrillSource is the BasicCopySource implementation for DrillSource. +func (ds DrillSource) AsDrillSource() (*DrillSource, bool) { + return &ds, true +} + +// AsCouchbaseSource is the BasicCopySource implementation for DrillSource. +func (ds DrillSource) AsCouchbaseSource() (*CouchbaseSource, bool) { + return nil, false +} + +// AsConcurSource is the BasicCopySource implementation for DrillSource. +func (ds DrillSource) AsConcurSource() (*ConcurSource, bool) { + return nil, false +} + +// AsAzurePostgreSQLSource is the BasicCopySource implementation for DrillSource. +func (ds DrillSource) AsAzurePostgreSQLSource() (*AzurePostgreSQLSource, bool) { + return nil, false +} + +// AsAmazonMWSSource is the BasicCopySource implementation for DrillSource. +func (ds DrillSource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { + return nil, false +} + +// AsHTTPSource is the BasicCopySource implementation for DrillSource. +func (ds DrillSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for DrillSource. +func (ds DrillSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for DrillSource. +func (ds DrillSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsCassandraSource is the BasicCopySource implementation for DrillSource. +func (ds DrillSource) AsCassandraSource() (*CassandraSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for DrillSource. +func (ds DrillSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for DrillSource. +func (ds DrillSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureMySQLSource is the BasicCopySource implementation for DrillSource. +func (ds DrillSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for DrillSource. +func (ds DrillSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for DrillSource. +func (ds DrillSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsSQLDWSource is the BasicCopySource implementation for DrillSource. +func (ds DrillSource) AsSQLDWSource() (*SQLDWSource, bool) { + return nil, false +} + +// AsSQLSource is the BasicCopySource implementation for DrillSource. +func (ds DrillSource) AsSQLSource() (*SQLSource, bool) { + return nil, false +} + +// AsSapEccSource is the BasicCopySource implementation for DrillSource. +func (ds DrillSource) AsSapEccSource() (*SapEccSource, bool) { + return nil, false +} + +// AsSapCloudForCustomerSource is the BasicCopySource implementation for DrillSource. +func (ds DrillSource) AsSapCloudForCustomerSource() (*SapCloudForCustomerSource, bool) { + return nil, false +} + +// AsSalesforceSource is the BasicCopySource implementation for DrillSource. +func (ds DrillSource) AsSalesforceSource() (*SalesforceSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for DrillSource. +func (ds DrillSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for DrillSource. +func (ds DrillSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for DrillSource. +func (ds DrillSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for DrillSource. +func (ds DrillSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + +// AsAzureTableSource is the BasicCopySource implementation for DrillSource. +func (ds DrillSource) AsAzureTableSource() (*AzureTableSource, bool) { + return nil, false +} + +// AsCopySource is the BasicCopySource implementation for DrillSource. +func (ds DrillSource) AsCopySource() (*CopySource, bool) { + return nil, false +} + +// AsBasicCopySource is the BasicCopySource implementation for DrillSource. +func (ds DrillSource) AsBasicCopySource() (BasicCopySource, bool) { + return &ds, true +} + +// DrillTableDataset drill server dataset. +type DrillTableDataset struct { + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Description - Dataset description. + Description *string `json:"description,omitempty"` + // Structure - Columns that define the structure of the dataset. Type: array (or Expression with resultType array), itemType: DatasetDataElement. + Structure interface{} `json:"structure,omitempty"` + // LinkedServiceName - Linked service reference. + LinkedServiceName *LinkedServiceReference `json:"linkedServiceName,omitempty"` + // Parameters - Parameters for dataset. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeDataset', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSQLServerTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSalesforceObject', 'TypeRelationalTable', 'TypeAzureMySQLTable', 'TypeOracleTable', 'TypeODataResource', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeAzureDataLakeStoreFile', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeAmazonS3Object' + Type TypeBasicDataset `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for DrillTableDataset. +func (dtd DrillTableDataset) MarshalJSON() ([]byte, error) { + dtd.Type = TypeDrillTable + objectMap := make(map[string]interface{}) + if dtd.Description != nil { + objectMap["description"] = dtd.Description + } + objectMap["structure"] = dtd.Structure + if dtd.LinkedServiceName != nil { + objectMap["linkedServiceName"] = dtd.LinkedServiceName + } + if dtd.Parameters != nil { + objectMap["parameters"] = dtd.Parameters + } + if dtd.Annotations != nil { + objectMap["annotations"] = dtd.Annotations + } + if dtd.Type != "" { + objectMap["type"] = dtd.Type + } + for k, v := range dtd.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysObjectDataset is the BasicDataset implementation for DrillTableDataset. +func (dtd DrillTableDataset) AsResponsysObjectDataset() (*ResponsysObjectDataset, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudObjectDataset is the BasicDataset implementation for DrillTableDataset. +func (dtd DrillTableDataset) AsSalesforceMarketingCloudObjectDataset() (*SalesforceMarketingCloudObjectDataset, bool) { + return nil, false +} + +// AsVerticaTableDataset is the BasicDataset implementation for DrillTableDataset. +func (dtd DrillTableDataset) AsVerticaTableDataset() (*VerticaTableDataset, bool) { + return nil, false +} + +// AsNetezzaTableDataset is the BasicDataset implementation for DrillTableDataset. +func (dtd DrillTableDataset) AsNetezzaTableDataset() (*NetezzaTableDataset, bool) { + return nil, false +} + +// AsZohoObjectDataset is the BasicDataset implementation for DrillTableDataset. +func (dtd DrillTableDataset) AsZohoObjectDataset() (*ZohoObjectDataset, bool) { + return nil, false +} + +// AsXeroObjectDataset is the BasicDataset implementation for DrillTableDataset. +func (dtd DrillTableDataset) AsXeroObjectDataset() (*XeroObjectDataset, bool) { + return nil, false +} + +// AsSquareObjectDataset is the BasicDataset implementation for DrillTableDataset. +func (dtd DrillTableDataset) AsSquareObjectDataset() (*SquareObjectDataset, bool) { + return nil, false +} + +// AsSparkObjectDataset is the BasicDataset implementation for DrillTableDataset. +func (dtd DrillTableDataset) AsSparkObjectDataset() (*SparkObjectDataset, bool) { + return nil, false +} + +// AsShopifyObjectDataset is the BasicDataset implementation for DrillTableDataset. +func (dtd DrillTableDataset) AsShopifyObjectDataset() (*ShopifyObjectDataset, bool) { + return nil, false +} + +// AsServiceNowObjectDataset is the BasicDataset implementation for DrillTableDataset. +func (dtd DrillTableDataset) AsServiceNowObjectDataset() (*ServiceNowObjectDataset, bool) { + return nil, false +} + +// AsQuickBooksObjectDataset is the BasicDataset implementation for DrillTableDataset. +func (dtd DrillTableDataset) AsQuickBooksObjectDataset() (*QuickBooksObjectDataset, bool) { + return nil, false +} + +// AsPrestoObjectDataset is the BasicDataset implementation for DrillTableDataset. +func (dtd DrillTableDataset) AsPrestoObjectDataset() (*PrestoObjectDataset, bool) { + return nil, false +} + +// AsPhoenixObjectDataset is the BasicDataset implementation for DrillTableDataset. +func (dtd DrillTableDataset) AsPhoenixObjectDataset() (*PhoenixObjectDataset, bool) { + return nil, false +} + +// AsPaypalObjectDataset is the BasicDataset implementation for DrillTableDataset. +func (dtd DrillTableDataset) AsPaypalObjectDataset() (*PaypalObjectDataset, bool) { + return nil, false +} + +// AsMarketoObjectDataset is the BasicDataset implementation for DrillTableDataset. +func (dtd DrillTableDataset) AsMarketoObjectDataset() (*MarketoObjectDataset, bool) { + return nil, false +} + +// AsMariaDBTableDataset is the BasicDataset implementation for DrillTableDataset. +func (dtd DrillTableDataset) AsMariaDBTableDataset() (*MariaDBTableDataset, bool) { + return nil, false +} + +// AsMagentoObjectDataset is the BasicDataset implementation for DrillTableDataset. +func (dtd DrillTableDataset) AsMagentoObjectDataset() (*MagentoObjectDataset, bool) { + return nil, false +} + +// AsJiraObjectDataset is the BasicDataset implementation for DrillTableDataset. +func (dtd DrillTableDataset) AsJiraObjectDataset() (*JiraObjectDataset, bool) { + return nil, false +} + +// AsImpalaObjectDataset is the BasicDataset implementation for DrillTableDataset. +func (dtd DrillTableDataset) AsImpalaObjectDataset() (*ImpalaObjectDataset, bool) { + return nil, false +} + +// AsHubspotObjectDataset is the BasicDataset implementation for DrillTableDataset. +func (dtd DrillTableDataset) AsHubspotObjectDataset() (*HubspotObjectDataset, bool) { + return nil, false +} + +// AsHiveObjectDataset is the BasicDataset implementation for DrillTableDataset. +func (dtd DrillTableDataset) AsHiveObjectDataset() (*HiveObjectDataset, bool) { + return nil, false +} + +// AsHBaseObjectDataset is the BasicDataset implementation for DrillTableDataset. +func (dtd DrillTableDataset) AsHBaseObjectDataset() (*HBaseObjectDataset, bool) { + return nil, false +} + +// AsGreenplumTableDataset is the BasicDataset implementation for DrillTableDataset. +func (dtd DrillTableDataset) AsGreenplumTableDataset() (*GreenplumTableDataset, bool) { + return nil, false +} + +// AsGoogleBigQueryObjectDataset is the BasicDataset implementation for DrillTableDataset. +func (dtd DrillTableDataset) AsGoogleBigQueryObjectDataset() (*GoogleBigQueryObjectDataset, bool) { + return nil, false +} + +// AsEloquaObjectDataset is the BasicDataset implementation for DrillTableDataset. +func (dtd DrillTableDataset) AsEloquaObjectDataset() (*EloquaObjectDataset, bool) { + return nil, false +} + +// AsDrillTableDataset is the BasicDataset implementation for DrillTableDataset. +func (dtd DrillTableDataset) AsDrillTableDataset() (*DrillTableDataset, bool) { + return &dtd, true +} + +// AsCouchbaseTableDataset is the BasicDataset implementation for DrillTableDataset. +func (dtd DrillTableDataset) AsCouchbaseTableDataset() (*CouchbaseTableDataset, bool) { + return nil, false +} + +// AsConcurObjectDataset is the BasicDataset implementation for DrillTableDataset. +func (dtd DrillTableDataset) AsConcurObjectDataset() (*ConcurObjectDataset, bool) { + return nil, false +} + +// AsAzurePostgreSQLTableDataset is the BasicDataset implementation for DrillTableDataset. +func (dtd DrillTableDataset) AsAzurePostgreSQLTableDataset() (*AzurePostgreSQLTableDataset, bool) { + return nil, false +} + +// AsAmazonMWSObjectDataset is the BasicDataset implementation for DrillTableDataset. +func (dtd DrillTableDataset) AsAmazonMWSObjectDataset() (*AmazonMWSObjectDataset, bool) { + return nil, false +} + +// AsHTTPDataset is the BasicDataset implementation for DrillTableDataset. +func (dtd DrillTableDataset) AsHTTPDataset() (*HTTPDataset, bool) { + return nil, false +} + +// AsAzureSearchIndexDataset is the BasicDataset implementation for DrillTableDataset. +func (dtd DrillTableDataset) AsAzureSearchIndexDataset() (*AzureSearchIndexDataset, bool) { + return nil, false +} + +// AsWebTableDataset is the BasicDataset implementation for DrillTableDataset. +func (dtd DrillTableDataset) AsWebTableDataset() (*WebTableDataset, bool) { + return nil, false +} + +// AsSQLServerTableDataset is the BasicDataset implementation for DrillTableDataset. +func (dtd DrillTableDataset) AsSQLServerTableDataset() (*SQLServerTableDataset, bool) { + return nil, false +} + +// AsSapEccResourceDataset is the BasicDataset implementation for DrillTableDataset. +func (dtd DrillTableDataset) AsSapEccResourceDataset() (*SapEccResourceDataset, bool) { + return nil, false +} + +// AsSapCloudForCustomerResourceDataset is the BasicDataset implementation for DrillTableDataset. +func (dtd DrillTableDataset) AsSapCloudForCustomerResourceDataset() (*SapCloudForCustomerResourceDataset, bool) { + return nil, false +} + +// AsSalesforceObjectDataset is the BasicDataset implementation for DrillTableDataset. +func (dtd DrillTableDataset) AsSalesforceObjectDataset() (*SalesforceObjectDataset, bool) { + return nil, false +} + +// AsRelationalTableDataset is the BasicDataset implementation for DrillTableDataset. +func (dtd DrillTableDataset) AsRelationalTableDataset() (*RelationalTableDataset, bool) { + return nil, false +} + +// AsAzureMySQLTableDataset is the BasicDataset implementation for DrillTableDataset. +func (dtd DrillTableDataset) AsAzureMySQLTableDataset() (*AzureMySQLTableDataset, bool) { + return nil, false +} + +// AsOracleTableDataset is the BasicDataset implementation for DrillTableDataset. +func (dtd DrillTableDataset) AsOracleTableDataset() (*OracleTableDataset, bool) { + return nil, false +} + +// AsODataResourceDataset is the BasicDataset implementation for DrillTableDataset. +func (dtd DrillTableDataset) AsODataResourceDataset() (*ODataResourceDataset, bool) { + return nil, false +} + +// AsMongoDbCollectionDataset is the BasicDataset implementation for DrillTableDataset. +func (dtd DrillTableDataset) AsMongoDbCollectionDataset() (*MongoDbCollectionDataset, bool) { + return nil, false +} + +// AsFileShareDataset is the BasicDataset implementation for DrillTableDataset. +func (dtd DrillTableDataset) AsFileShareDataset() (*FileShareDataset, bool) { + return nil, false +} + +// AsAzureDataLakeStoreDataset is the BasicDataset implementation for DrillTableDataset. +func (dtd DrillTableDataset) AsAzureDataLakeStoreDataset() (*AzureDataLakeStoreDataset, bool) { + return nil, false +} + +// AsDynamicsEntityDataset is the BasicDataset implementation for DrillTableDataset. +func (dtd DrillTableDataset) AsDynamicsEntityDataset() (*DynamicsEntityDataset, bool) { + return nil, false +} + +// AsDocumentDbCollectionDataset is the BasicDataset implementation for DrillTableDataset. +func (dtd DrillTableDataset) AsDocumentDbCollectionDataset() (*DocumentDbCollectionDataset, bool) { + return nil, false +} + +// AsCustomDataset is the BasicDataset implementation for DrillTableDataset. +func (dtd DrillTableDataset) AsCustomDataset() (*CustomDataset, bool) { + return nil, false +} + +// AsCassandraTableDataset is the BasicDataset implementation for DrillTableDataset. +func (dtd DrillTableDataset) AsCassandraTableDataset() (*CassandraTableDataset, bool) { + return nil, false +} + +// AsAzureSQLDWTableDataset is the BasicDataset implementation for DrillTableDataset. +func (dtd DrillTableDataset) AsAzureSQLDWTableDataset() (*AzureSQLDWTableDataset, bool) { + return nil, false +} + +// AsAzureSQLTableDataset is the BasicDataset implementation for DrillTableDataset. +func (dtd DrillTableDataset) AsAzureSQLTableDataset() (*AzureSQLTableDataset, bool) { + return nil, false +} + +// AsAzureTableDataset is the BasicDataset implementation for DrillTableDataset. +func (dtd DrillTableDataset) AsAzureTableDataset() (*AzureTableDataset, bool) { + return nil, false +} + +// AsAzureBlobDataset is the BasicDataset implementation for DrillTableDataset. +func (dtd DrillTableDataset) AsAzureBlobDataset() (*AzureBlobDataset, bool) { + return nil, false +} + +// AsAmazonS3Dataset is the BasicDataset implementation for DrillTableDataset. +func (dtd DrillTableDataset) AsAmazonS3Dataset() (*AmazonS3Dataset, bool) { + return nil, false +} + +// AsDataset is the BasicDataset implementation for DrillTableDataset. +func (dtd DrillTableDataset) AsDataset() (*Dataset, bool) { + return nil, false +} + +// AsBasicDataset is the BasicDataset implementation for DrillTableDataset. +func (dtd DrillTableDataset) AsBasicDataset() (BasicDataset, bool) { + return &dtd, true +} + +// DynamicsEntityDataset the Dynamics entity dataset. +type DynamicsEntityDataset struct { + // DynamicsEntityDatasetTypeProperties - Dynamics entity dataset properties. + *DynamicsEntityDatasetTypeProperties `json:"typeProperties,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Description - Dataset description. + Description *string `json:"description,omitempty"` + // Structure - Columns that define the structure of the dataset. Type: array (or Expression with resultType array), itemType: DatasetDataElement. + Structure interface{} `json:"structure,omitempty"` + // LinkedServiceName - Linked service reference. + LinkedServiceName *LinkedServiceReference `json:"linkedServiceName,omitempty"` + // Parameters - Parameters for dataset. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeDataset', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSQLServerTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSalesforceObject', 'TypeRelationalTable', 'TypeAzureMySQLTable', 'TypeOracleTable', 'TypeODataResource', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeAzureDataLakeStoreFile', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeAmazonS3Object' + Type TypeBasicDataset `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for DynamicsEntityDataset. +func (ded DynamicsEntityDataset) MarshalJSON() ([]byte, error) { + ded.Type = TypeDynamicsEntity + objectMap := make(map[string]interface{}) + if ded.DynamicsEntityDatasetTypeProperties != nil { + objectMap["typeProperties"] = ded.DynamicsEntityDatasetTypeProperties + } + if ded.Description != nil { + objectMap["description"] = ded.Description + } + objectMap["structure"] = ded.Structure + if ded.LinkedServiceName != nil { + objectMap["linkedServiceName"] = ded.LinkedServiceName + } + if ded.Parameters != nil { + objectMap["parameters"] = ded.Parameters + } + if ded.Annotations != nil { + objectMap["annotations"] = ded.Annotations + } + if ded.Type != "" { + objectMap["type"] = ded.Type + } + for k, v := range ded.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysObjectDataset is the BasicDataset implementation for DynamicsEntityDataset. +func (ded DynamicsEntityDataset) AsResponsysObjectDataset() (*ResponsysObjectDataset, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudObjectDataset is the BasicDataset implementation for DynamicsEntityDataset. +func (ded DynamicsEntityDataset) AsSalesforceMarketingCloudObjectDataset() (*SalesforceMarketingCloudObjectDataset, bool) { + return nil, false +} + +// AsVerticaTableDataset is the BasicDataset implementation for DynamicsEntityDataset. +func (ded DynamicsEntityDataset) AsVerticaTableDataset() (*VerticaTableDataset, bool) { + return nil, false +} + +// AsNetezzaTableDataset is the BasicDataset implementation for DynamicsEntityDataset. +func (ded DynamicsEntityDataset) AsNetezzaTableDataset() (*NetezzaTableDataset, bool) { + return nil, false +} + +// AsZohoObjectDataset is the BasicDataset implementation for DynamicsEntityDataset. +func (ded DynamicsEntityDataset) AsZohoObjectDataset() (*ZohoObjectDataset, bool) { + return nil, false +} + +// AsXeroObjectDataset is the BasicDataset implementation for DynamicsEntityDataset. +func (ded DynamicsEntityDataset) AsXeroObjectDataset() (*XeroObjectDataset, bool) { + return nil, false +} + +// AsSquareObjectDataset is the BasicDataset implementation for DynamicsEntityDataset. +func (ded DynamicsEntityDataset) AsSquareObjectDataset() (*SquareObjectDataset, bool) { + return nil, false +} + +// AsSparkObjectDataset is the BasicDataset implementation for DynamicsEntityDataset. +func (ded DynamicsEntityDataset) AsSparkObjectDataset() (*SparkObjectDataset, bool) { + return nil, false +} + +// AsShopifyObjectDataset is the BasicDataset implementation for DynamicsEntityDataset. +func (ded DynamicsEntityDataset) AsShopifyObjectDataset() (*ShopifyObjectDataset, bool) { + return nil, false +} + +// AsServiceNowObjectDataset is the BasicDataset implementation for DynamicsEntityDataset. +func (ded DynamicsEntityDataset) AsServiceNowObjectDataset() (*ServiceNowObjectDataset, bool) { + return nil, false +} + +// AsQuickBooksObjectDataset is the BasicDataset implementation for DynamicsEntityDataset. +func (ded DynamicsEntityDataset) AsQuickBooksObjectDataset() (*QuickBooksObjectDataset, bool) { + return nil, false +} + +// AsPrestoObjectDataset is the BasicDataset implementation for DynamicsEntityDataset. +func (ded DynamicsEntityDataset) AsPrestoObjectDataset() (*PrestoObjectDataset, bool) { + return nil, false +} + +// AsPhoenixObjectDataset is the BasicDataset implementation for DynamicsEntityDataset. +func (ded DynamicsEntityDataset) AsPhoenixObjectDataset() (*PhoenixObjectDataset, bool) { + return nil, false +} + +// AsPaypalObjectDataset is the BasicDataset implementation for DynamicsEntityDataset. +func (ded DynamicsEntityDataset) AsPaypalObjectDataset() (*PaypalObjectDataset, bool) { + return nil, false +} + +// AsMarketoObjectDataset is the BasicDataset implementation for DynamicsEntityDataset. +func (ded DynamicsEntityDataset) AsMarketoObjectDataset() (*MarketoObjectDataset, bool) { + return nil, false +} + +// AsMariaDBTableDataset is the BasicDataset implementation for DynamicsEntityDataset. +func (ded DynamicsEntityDataset) AsMariaDBTableDataset() (*MariaDBTableDataset, bool) { + return nil, false +} + +// AsMagentoObjectDataset is the BasicDataset implementation for DynamicsEntityDataset. +func (ded DynamicsEntityDataset) AsMagentoObjectDataset() (*MagentoObjectDataset, bool) { + return nil, false +} + +// AsJiraObjectDataset is the BasicDataset implementation for DynamicsEntityDataset. +func (ded DynamicsEntityDataset) AsJiraObjectDataset() (*JiraObjectDataset, bool) { + return nil, false +} + +// AsImpalaObjectDataset is the BasicDataset implementation for DynamicsEntityDataset. +func (ded DynamicsEntityDataset) AsImpalaObjectDataset() (*ImpalaObjectDataset, bool) { + return nil, false +} + +// AsHubspotObjectDataset is the BasicDataset implementation for DynamicsEntityDataset. +func (ded DynamicsEntityDataset) AsHubspotObjectDataset() (*HubspotObjectDataset, bool) { + return nil, false +} + +// AsHiveObjectDataset is the BasicDataset implementation for DynamicsEntityDataset. +func (ded DynamicsEntityDataset) AsHiveObjectDataset() (*HiveObjectDataset, bool) { + return nil, false +} + +// AsHBaseObjectDataset is the BasicDataset implementation for DynamicsEntityDataset. +func (ded DynamicsEntityDataset) AsHBaseObjectDataset() (*HBaseObjectDataset, bool) { + return nil, false +} + +// AsGreenplumTableDataset is the BasicDataset implementation for DynamicsEntityDataset. +func (ded DynamicsEntityDataset) AsGreenplumTableDataset() (*GreenplumTableDataset, bool) { + return nil, false +} + +// AsGoogleBigQueryObjectDataset is the BasicDataset implementation for DynamicsEntityDataset. +func (ded DynamicsEntityDataset) AsGoogleBigQueryObjectDataset() (*GoogleBigQueryObjectDataset, bool) { + return nil, false +} + +// AsEloquaObjectDataset is the BasicDataset implementation for DynamicsEntityDataset. +func (ded DynamicsEntityDataset) AsEloquaObjectDataset() (*EloquaObjectDataset, bool) { + return nil, false +} + +// AsDrillTableDataset is the BasicDataset implementation for DynamicsEntityDataset. +func (ded DynamicsEntityDataset) AsDrillTableDataset() (*DrillTableDataset, bool) { + return nil, false +} + +// AsCouchbaseTableDataset is the BasicDataset implementation for DynamicsEntityDataset. +func (ded DynamicsEntityDataset) AsCouchbaseTableDataset() (*CouchbaseTableDataset, bool) { + return nil, false +} + +// AsConcurObjectDataset is the BasicDataset implementation for DynamicsEntityDataset. +func (ded DynamicsEntityDataset) AsConcurObjectDataset() (*ConcurObjectDataset, bool) { + return nil, false +} + +// AsAzurePostgreSQLTableDataset is the BasicDataset implementation for DynamicsEntityDataset. +func (ded DynamicsEntityDataset) AsAzurePostgreSQLTableDataset() (*AzurePostgreSQLTableDataset, bool) { + return nil, false +} + +// AsAmazonMWSObjectDataset is the BasicDataset implementation for DynamicsEntityDataset. +func (ded DynamicsEntityDataset) AsAmazonMWSObjectDataset() (*AmazonMWSObjectDataset, bool) { + return nil, false +} + +// AsHTTPDataset is the BasicDataset implementation for DynamicsEntityDataset. +func (ded DynamicsEntityDataset) AsHTTPDataset() (*HTTPDataset, bool) { + return nil, false +} + +// AsAzureSearchIndexDataset is the BasicDataset implementation for DynamicsEntityDataset. +func (ded DynamicsEntityDataset) AsAzureSearchIndexDataset() (*AzureSearchIndexDataset, bool) { + return nil, false +} + +// AsWebTableDataset is the BasicDataset implementation for DynamicsEntityDataset. +func (ded DynamicsEntityDataset) AsWebTableDataset() (*WebTableDataset, bool) { + return nil, false +} + +// AsSQLServerTableDataset is the BasicDataset implementation for DynamicsEntityDataset. +func (ded DynamicsEntityDataset) AsSQLServerTableDataset() (*SQLServerTableDataset, bool) { + return nil, false +} + +// AsSapEccResourceDataset is the BasicDataset implementation for DynamicsEntityDataset. +func (ded DynamicsEntityDataset) AsSapEccResourceDataset() (*SapEccResourceDataset, bool) { + return nil, false +} + +// AsSapCloudForCustomerResourceDataset is the BasicDataset implementation for DynamicsEntityDataset. +func (ded DynamicsEntityDataset) AsSapCloudForCustomerResourceDataset() (*SapCloudForCustomerResourceDataset, bool) { + return nil, false +} + +// AsSalesforceObjectDataset is the BasicDataset implementation for DynamicsEntityDataset. +func (ded DynamicsEntityDataset) AsSalesforceObjectDataset() (*SalesforceObjectDataset, bool) { + return nil, false +} + +// AsRelationalTableDataset is the BasicDataset implementation for DynamicsEntityDataset. +func (ded DynamicsEntityDataset) AsRelationalTableDataset() (*RelationalTableDataset, bool) { + return nil, false +} + +// AsAzureMySQLTableDataset is the BasicDataset implementation for DynamicsEntityDataset. +func (ded DynamicsEntityDataset) AsAzureMySQLTableDataset() (*AzureMySQLTableDataset, bool) { + return nil, false +} + +// AsOracleTableDataset is the BasicDataset implementation for DynamicsEntityDataset. +func (ded DynamicsEntityDataset) AsOracleTableDataset() (*OracleTableDataset, bool) { + return nil, false +} + +// AsODataResourceDataset is the BasicDataset implementation for DynamicsEntityDataset. +func (ded DynamicsEntityDataset) AsODataResourceDataset() (*ODataResourceDataset, bool) { + return nil, false +} + +// AsMongoDbCollectionDataset is the BasicDataset implementation for DynamicsEntityDataset. +func (ded DynamicsEntityDataset) AsMongoDbCollectionDataset() (*MongoDbCollectionDataset, bool) { + return nil, false +} + +// AsFileShareDataset is the BasicDataset implementation for DynamicsEntityDataset. +func (ded DynamicsEntityDataset) AsFileShareDataset() (*FileShareDataset, bool) { + return nil, false +} + +// AsAzureDataLakeStoreDataset is the BasicDataset implementation for DynamicsEntityDataset. +func (ded DynamicsEntityDataset) AsAzureDataLakeStoreDataset() (*AzureDataLakeStoreDataset, bool) { + return nil, false +} + +// AsDynamicsEntityDataset is the BasicDataset implementation for DynamicsEntityDataset. +func (ded DynamicsEntityDataset) AsDynamicsEntityDataset() (*DynamicsEntityDataset, bool) { + return &ded, true +} + +// AsDocumentDbCollectionDataset is the BasicDataset implementation for DynamicsEntityDataset. +func (ded DynamicsEntityDataset) AsDocumentDbCollectionDataset() (*DocumentDbCollectionDataset, bool) { + return nil, false +} + +// AsCustomDataset is the BasicDataset implementation for DynamicsEntityDataset. +func (ded DynamicsEntityDataset) AsCustomDataset() (*CustomDataset, bool) { + return nil, false +} + +// AsCassandraTableDataset is the BasicDataset implementation for DynamicsEntityDataset. +func (ded DynamicsEntityDataset) AsCassandraTableDataset() (*CassandraTableDataset, bool) { + return nil, false +} + +// AsAzureSQLDWTableDataset is the BasicDataset implementation for DynamicsEntityDataset. +func (ded DynamicsEntityDataset) AsAzureSQLDWTableDataset() (*AzureSQLDWTableDataset, bool) { + return nil, false +} + +// AsAzureSQLTableDataset is the BasicDataset implementation for DynamicsEntityDataset. +func (ded DynamicsEntityDataset) AsAzureSQLTableDataset() (*AzureSQLTableDataset, bool) { + return nil, false +} + +// AsAzureTableDataset is the BasicDataset implementation for DynamicsEntityDataset. +func (ded DynamicsEntityDataset) AsAzureTableDataset() (*AzureTableDataset, bool) { + return nil, false +} + +// AsAzureBlobDataset is the BasicDataset implementation for DynamicsEntityDataset. +func (ded DynamicsEntityDataset) AsAzureBlobDataset() (*AzureBlobDataset, bool) { + return nil, false +} + +// AsAmazonS3Dataset is the BasicDataset implementation for DynamicsEntityDataset. +func (ded DynamicsEntityDataset) AsAmazonS3Dataset() (*AmazonS3Dataset, bool) { + return nil, false +} + +// AsDataset is the BasicDataset implementation for DynamicsEntityDataset. +func (ded DynamicsEntityDataset) AsDataset() (*Dataset, bool) { + return nil, false +} + +// AsBasicDataset is the BasicDataset implementation for DynamicsEntityDataset. +func (ded DynamicsEntityDataset) AsBasicDataset() (BasicDataset, bool) { + return &ded, true +} + +// UnmarshalJSON is the custom unmarshaler for DynamicsEntityDataset struct. +func (ded *DynamicsEntityDataset) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "typeProperties": + if v != nil { + var dynamicsEntityDatasetTypeProperties DynamicsEntityDatasetTypeProperties + err = json.Unmarshal(*v, &dynamicsEntityDatasetTypeProperties) + if err != nil { + return err + } + ded.DynamicsEntityDatasetTypeProperties = &dynamicsEntityDatasetTypeProperties + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if ded.AdditionalProperties == nil { + ded.AdditionalProperties = make(map[string]interface{}) + } + ded.AdditionalProperties[k] = additionalProperties + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + ded.Description = &description + } + case "structure": + if v != nil { + var structure interface{} + err = json.Unmarshal(*v, &structure) + if err != nil { + return err + } + ded.Structure = structure + } + case "linkedServiceName": + if v != nil { + var linkedServiceName LinkedServiceReference + err = json.Unmarshal(*v, &linkedServiceName) + if err != nil { + return err + } + ded.LinkedServiceName = &linkedServiceName + } + case "parameters": + if v != nil { + var parameters map[string]*ParameterSpecification + err = json.Unmarshal(*v, ¶meters) + if err != nil { + return err + } + ded.Parameters = parameters + } + case "annotations": + if v != nil { + var annotations []interface{} + err = json.Unmarshal(*v, &annotations) + if err != nil { + return err + } + ded.Annotations = &annotations + } + case "type": + if v != nil { + var typeVar TypeBasicDataset + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ded.Type = typeVar + } + } + } + + return nil +} + +// DynamicsEntityDatasetTypeProperties dynamics entity dataset properties. +type DynamicsEntityDatasetTypeProperties struct { + // EntityName - The logical name of the entity. Type: string (or Expression with resultType string). + EntityName interface{} `json:"entityName,omitempty"` +} + +// DynamicsLinkedService dynamics linked service. +type DynamicsLinkedService struct { + // DynamicsLinkedServiceTypeProperties - Dynamics linked service properties. + *DynamicsLinkedServiceTypeProperties `json:"typeProperties,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // ConnectVia - The integration runtime reference. + ConnectVia *IntegrationRuntimeReference `json:"connectVia,omitempty"` + // Description - Linked service description. + Description *string `json:"description,omitempty"` + // Parameters - Parameters for linked service. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeLinkedService', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforce', 'TypeAzureDataLakeStore', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureStorage' + Type TypeBasicLinkedService `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for DynamicsLinkedService. +func (dls DynamicsLinkedService) MarshalJSON() ([]byte, error) { + dls.Type = TypeDynamics + objectMap := make(map[string]interface{}) + if dls.DynamicsLinkedServiceTypeProperties != nil { + objectMap["typeProperties"] = dls.DynamicsLinkedServiceTypeProperties + } + if dls.ConnectVia != nil { + objectMap["connectVia"] = dls.ConnectVia + } + if dls.Description != nil { + objectMap["description"] = dls.Description + } + if dls.Parameters != nil { + objectMap["parameters"] = dls.Parameters + } + if dls.Annotations != nil { + objectMap["annotations"] = dls.Annotations + } + if dls.Type != "" { + objectMap["type"] = dls.Type + } + for k, v := range dls.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysLinkedService is the BasicLinkedService implementation for DynamicsLinkedService. +func (dls DynamicsLinkedService) AsResponsysLinkedService() (*ResponsysLinkedService, bool) { + return nil, false +} + +// AsAzureDatabricksLinkedService is the BasicLinkedService implementation for DynamicsLinkedService. +func (dls DynamicsLinkedService) AsAzureDatabricksLinkedService() (*AzureDatabricksLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeAnalyticsLinkedService is the BasicLinkedService implementation for DynamicsLinkedService. +func (dls DynamicsLinkedService) AsAzureDataLakeAnalyticsLinkedService() (*AzureDataLakeAnalyticsLinkedService, bool) { + return nil, false +} + +// AsHDInsightOnDemandLinkedService is the BasicLinkedService implementation for DynamicsLinkedService. +func (dls DynamicsLinkedService) AsHDInsightOnDemandLinkedService() (*HDInsightOnDemandLinkedService, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudLinkedService is the BasicLinkedService implementation for DynamicsLinkedService. +func (dls DynamicsLinkedService) AsSalesforceMarketingCloudLinkedService() (*SalesforceMarketingCloudLinkedService, bool) { + return nil, false +} + +// AsNetezzaLinkedService is the BasicLinkedService implementation for DynamicsLinkedService. +func (dls DynamicsLinkedService) AsNetezzaLinkedService() (*NetezzaLinkedService, bool) { + return nil, false +} + +// AsVerticaLinkedService is the BasicLinkedService implementation for DynamicsLinkedService. +func (dls DynamicsLinkedService) AsVerticaLinkedService() (*VerticaLinkedService, bool) { + return nil, false +} + +// AsZohoLinkedService is the BasicLinkedService implementation for DynamicsLinkedService. +func (dls DynamicsLinkedService) AsZohoLinkedService() (*ZohoLinkedService, bool) { + return nil, false +} + +// AsXeroLinkedService is the BasicLinkedService implementation for DynamicsLinkedService. +func (dls DynamicsLinkedService) AsXeroLinkedService() (*XeroLinkedService, bool) { + return nil, false +} + +// AsSquareLinkedService is the BasicLinkedService implementation for DynamicsLinkedService. +func (dls DynamicsLinkedService) AsSquareLinkedService() (*SquareLinkedService, bool) { + return nil, false +} + +// AsSparkLinkedService is the BasicLinkedService implementation for DynamicsLinkedService. +func (dls DynamicsLinkedService) AsSparkLinkedService() (*SparkLinkedService, bool) { + return nil, false +} + +// AsShopifyLinkedService is the BasicLinkedService implementation for DynamicsLinkedService. +func (dls DynamicsLinkedService) AsShopifyLinkedService() (*ShopifyLinkedService, bool) { + return nil, false +} + +// AsServiceNowLinkedService is the BasicLinkedService implementation for DynamicsLinkedService. +func (dls DynamicsLinkedService) AsServiceNowLinkedService() (*ServiceNowLinkedService, bool) { + return nil, false +} + +// AsQuickBooksLinkedService is the BasicLinkedService implementation for DynamicsLinkedService. +func (dls DynamicsLinkedService) AsQuickBooksLinkedService() (*QuickBooksLinkedService, bool) { + return nil, false +} + +// AsPrestoLinkedService is the BasicLinkedService implementation for DynamicsLinkedService. +func (dls DynamicsLinkedService) AsPrestoLinkedService() (*PrestoLinkedService, bool) { + return nil, false +} + +// AsPhoenixLinkedService is the BasicLinkedService implementation for DynamicsLinkedService. +func (dls DynamicsLinkedService) AsPhoenixLinkedService() (*PhoenixLinkedService, bool) { + return nil, false +} + +// AsPaypalLinkedService is the BasicLinkedService implementation for DynamicsLinkedService. +func (dls DynamicsLinkedService) AsPaypalLinkedService() (*PaypalLinkedService, bool) { + return nil, false +} + +// AsMarketoLinkedService is the BasicLinkedService implementation for DynamicsLinkedService. +func (dls DynamicsLinkedService) AsMarketoLinkedService() (*MarketoLinkedService, bool) { + return nil, false +} + +// AsMariaDBLinkedService is the BasicLinkedService implementation for DynamicsLinkedService. +func (dls DynamicsLinkedService) AsMariaDBLinkedService() (*MariaDBLinkedService, bool) { + return nil, false +} + +// AsMagentoLinkedService is the BasicLinkedService implementation for DynamicsLinkedService. +func (dls DynamicsLinkedService) AsMagentoLinkedService() (*MagentoLinkedService, bool) { + return nil, false +} + +// AsJiraLinkedService is the BasicLinkedService implementation for DynamicsLinkedService. +func (dls DynamicsLinkedService) AsJiraLinkedService() (*JiraLinkedService, bool) { + return nil, false +} + +// AsImpalaLinkedService is the BasicLinkedService implementation for DynamicsLinkedService. +func (dls DynamicsLinkedService) AsImpalaLinkedService() (*ImpalaLinkedService, bool) { + return nil, false +} + +// AsHubspotLinkedService is the BasicLinkedService implementation for DynamicsLinkedService. +func (dls DynamicsLinkedService) AsHubspotLinkedService() (*HubspotLinkedService, bool) { + return nil, false +} + +// AsHiveLinkedService is the BasicLinkedService implementation for DynamicsLinkedService. +func (dls DynamicsLinkedService) AsHiveLinkedService() (*HiveLinkedService, bool) { + return nil, false +} + +// AsHBaseLinkedService is the BasicLinkedService implementation for DynamicsLinkedService. +func (dls DynamicsLinkedService) AsHBaseLinkedService() (*HBaseLinkedService, bool) { + return nil, false +} + +// AsGreenplumLinkedService is the BasicLinkedService implementation for DynamicsLinkedService. +func (dls DynamicsLinkedService) AsGreenplumLinkedService() (*GreenplumLinkedService, bool) { + return nil, false +} + +// AsGoogleBigQueryLinkedService is the BasicLinkedService implementation for DynamicsLinkedService. +func (dls DynamicsLinkedService) AsGoogleBigQueryLinkedService() (*GoogleBigQueryLinkedService, bool) { + return nil, false +} + +// AsEloquaLinkedService is the BasicLinkedService implementation for DynamicsLinkedService. +func (dls DynamicsLinkedService) AsEloquaLinkedService() (*EloquaLinkedService, bool) { + return nil, false +} + +// AsDrillLinkedService is the BasicLinkedService implementation for DynamicsLinkedService. +func (dls DynamicsLinkedService) AsDrillLinkedService() (*DrillLinkedService, bool) { + return nil, false +} + +// AsCouchbaseLinkedService is the BasicLinkedService implementation for DynamicsLinkedService. +func (dls DynamicsLinkedService) AsCouchbaseLinkedService() (*CouchbaseLinkedService, bool) { + return nil, false +} + +// AsConcurLinkedService is the BasicLinkedService implementation for DynamicsLinkedService. +func (dls DynamicsLinkedService) AsConcurLinkedService() (*ConcurLinkedService, bool) { + return nil, false +} + +// AsAzurePostgreSQLLinkedService is the BasicLinkedService implementation for DynamicsLinkedService. +func (dls DynamicsLinkedService) AsAzurePostgreSQLLinkedService() (*AzurePostgreSQLLinkedService, bool) { + return nil, false +} + +// AsAmazonMWSLinkedService is the BasicLinkedService implementation for DynamicsLinkedService. +func (dls DynamicsLinkedService) AsAmazonMWSLinkedService() (*AmazonMWSLinkedService, bool) { + return nil, false +} + +// AsSapHanaLinkedService is the BasicLinkedService implementation for DynamicsLinkedService. +func (dls DynamicsLinkedService) AsSapHanaLinkedService() (*SapHanaLinkedService, bool) { + return nil, false +} + +// AsSapBWLinkedService is the BasicLinkedService implementation for DynamicsLinkedService. +func (dls DynamicsLinkedService) AsSapBWLinkedService() (*SapBWLinkedService, bool) { + return nil, false +} + +// AsSftpServerLinkedService is the BasicLinkedService implementation for DynamicsLinkedService. +func (dls DynamicsLinkedService) AsSftpServerLinkedService() (*SftpServerLinkedService, bool) { + return nil, false +} + +// AsFtpServerLinkedService is the BasicLinkedService implementation for DynamicsLinkedService. +func (dls DynamicsLinkedService) AsFtpServerLinkedService() (*FtpServerLinkedService, bool) { + return nil, false +} + +// AsHTTPLinkedService is the BasicLinkedService implementation for DynamicsLinkedService. +func (dls DynamicsLinkedService) AsHTTPLinkedService() (*HTTPLinkedService, bool) { + return nil, false +} + +// AsAzureSearchLinkedService is the BasicLinkedService implementation for DynamicsLinkedService. +func (dls DynamicsLinkedService) AsAzureSearchLinkedService() (*AzureSearchLinkedService, bool) { + return nil, false +} + +// AsCustomDataSourceLinkedService is the BasicLinkedService implementation for DynamicsLinkedService. +func (dls DynamicsLinkedService) AsCustomDataSourceLinkedService() (*CustomDataSourceLinkedService, bool) { + return nil, false +} + +// AsAmazonRedshiftLinkedService is the BasicLinkedService implementation for DynamicsLinkedService. +func (dls DynamicsLinkedService) AsAmazonRedshiftLinkedService() (*AmazonRedshiftLinkedService, bool) { + return nil, false +} + +// AsAmazonS3LinkedService is the BasicLinkedService implementation for DynamicsLinkedService. +func (dls DynamicsLinkedService) AsAmazonS3LinkedService() (*AmazonS3LinkedService, bool) { + return nil, false +} + +// AsSapEccLinkedService is the BasicLinkedService implementation for DynamicsLinkedService. +func (dls DynamicsLinkedService) AsSapEccLinkedService() (*SapEccLinkedService, bool) { + return nil, false +} + +// AsSapCloudForCustomerLinkedService is the BasicLinkedService implementation for DynamicsLinkedService. +func (dls DynamicsLinkedService) AsSapCloudForCustomerLinkedService() (*SapCloudForCustomerLinkedService, bool) { + return nil, false +} + +// AsSalesforceLinkedService is the BasicLinkedService implementation for DynamicsLinkedService. +func (dls DynamicsLinkedService) AsSalesforceLinkedService() (*SalesforceLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeStoreLinkedService is the BasicLinkedService implementation for DynamicsLinkedService. +func (dls DynamicsLinkedService) AsAzureDataLakeStoreLinkedService() (*AzureDataLakeStoreLinkedService, bool) { + return nil, false +} + +// AsMongoDbLinkedService is the BasicLinkedService implementation for DynamicsLinkedService. +func (dls DynamicsLinkedService) AsMongoDbLinkedService() (*MongoDbLinkedService, bool) { + return nil, false +} + +// AsCassandraLinkedService is the BasicLinkedService implementation for DynamicsLinkedService. +func (dls DynamicsLinkedService) AsCassandraLinkedService() (*CassandraLinkedService, bool) { + return nil, false +} + +// AsWebLinkedService is the BasicLinkedService implementation for DynamicsLinkedService. +func (dls DynamicsLinkedService) AsWebLinkedService() (*WebLinkedService, bool) { + return nil, false +} + +// AsODataLinkedService is the BasicLinkedService implementation for DynamicsLinkedService. +func (dls DynamicsLinkedService) AsODataLinkedService() (*ODataLinkedService, bool) { + return nil, false +} + +// AsHdfsLinkedService is the BasicLinkedService implementation for DynamicsLinkedService. +func (dls DynamicsLinkedService) AsHdfsLinkedService() (*HdfsLinkedService, bool) { + return nil, false +} + +// AsOdbcLinkedService is the BasicLinkedService implementation for DynamicsLinkedService. +func (dls DynamicsLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, bool) { + return nil, false +} + +// AsAzureMLLinkedService is the BasicLinkedService implementation for DynamicsLinkedService. +func (dls DynamicsLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { + return nil, false +} + +// AsTeradataLinkedService is the BasicLinkedService implementation for DynamicsLinkedService. +func (dls DynamicsLinkedService) AsTeradataLinkedService() (*TeradataLinkedService, bool) { + return nil, false +} + +// AsDb2LinkedService is the BasicLinkedService implementation for DynamicsLinkedService. +func (dls DynamicsLinkedService) AsDb2LinkedService() (*Db2LinkedService, bool) { + return nil, false +} + +// AsSybaseLinkedService is the BasicLinkedService implementation for DynamicsLinkedService. +func (dls DynamicsLinkedService) AsSybaseLinkedService() (*SybaseLinkedService, bool) { + return nil, false +} + +// AsPostgreSQLLinkedService is the BasicLinkedService implementation for DynamicsLinkedService. +func (dls DynamicsLinkedService) AsPostgreSQLLinkedService() (*PostgreSQLLinkedService, bool) { + return nil, false +} + +// AsMySQLLinkedService is the BasicLinkedService implementation for DynamicsLinkedService. +func (dls DynamicsLinkedService) AsMySQLLinkedService() (*MySQLLinkedService, bool) { + return nil, false +} + +// AsAzureMySQLLinkedService is the BasicLinkedService implementation for DynamicsLinkedService. +func (dls DynamicsLinkedService) AsAzureMySQLLinkedService() (*AzureMySQLLinkedService, bool) { + return nil, false +} + +// AsOracleLinkedService is the BasicLinkedService implementation for DynamicsLinkedService. +func (dls DynamicsLinkedService) AsOracleLinkedService() (*OracleLinkedService, bool) { + return nil, false +} + +// AsFileServerLinkedService is the BasicLinkedService implementation for DynamicsLinkedService. +func (dls DynamicsLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { + return nil, false +} + +// AsHDInsightLinkedService is the BasicLinkedService implementation for DynamicsLinkedService. +func (dls DynamicsLinkedService) AsHDInsightLinkedService() (*HDInsightLinkedService, bool) { + return nil, false +} + +// AsDynamicsLinkedService is the BasicLinkedService implementation for DynamicsLinkedService. +func (dls DynamicsLinkedService) AsDynamicsLinkedService() (*DynamicsLinkedService, bool) { + return &dls, true +} + +// AsCosmosDbLinkedService is the BasicLinkedService implementation for DynamicsLinkedService. +func (dls DynamicsLinkedService) AsCosmosDbLinkedService() (*CosmosDbLinkedService, bool) { + return nil, false +} + +// AsAzureKeyVaultLinkedService is the BasicLinkedService implementation for DynamicsLinkedService. +func (dls DynamicsLinkedService) AsAzureKeyVaultLinkedService() (*AzureKeyVaultLinkedService, bool) { + return nil, false +} + +// AsAzureBatchLinkedService is the BasicLinkedService implementation for DynamicsLinkedService. +func (dls DynamicsLinkedService) AsAzureBatchLinkedService() (*AzureBatchLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDatabaseLinkedService is the BasicLinkedService implementation for DynamicsLinkedService. +func (dls DynamicsLinkedService) AsAzureSQLDatabaseLinkedService() (*AzureSQLDatabaseLinkedService, bool) { + return nil, false +} + +// AsSQLServerLinkedService is the BasicLinkedService implementation for DynamicsLinkedService. +func (dls DynamicsLinkedService) AsSQLServerLinkedService() (*SQLServerLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDWLinkedService is the BasicLinkedService implementation for DynamicsLinkedService. +func (dls DynamicsLinkedService) AsAzureSQLDWLinkedService() (*AzureSQLDWLinkedService, bool) { + return nil, false +} + +// AsAzureStorageLinkedService is the BasicLinkedService implementation for DynamicsLinkedService. +func (dls DynamicsLinkedService) AsAzureStorageLinkedService() (*AzureStorageLinkedService, bool) { + return nil, false +} + +// AsLinkedService is the BasicLinkedService implementation for DynamicsLinkedService. +func (dls DynamicsLinkedService) AsLinkedService() (*LinkedService, bool) { + return nil, false +} + +// AsBasicLinkedService is the BasicLinkedService implementation for DynamicsLinkedService. +func (dls DynamicsLinkedService) AsBasicLinkedService() (BasicLinkedService, bool) { + return &dls, true +} + +// UnmarshalJSON is the custom unmarshaler for DynamicsLinkedService struct. +func (dls *DynamicsLinkedService) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "typeProperties": + if v != nil { + var dynamicsLinkedServiceTypeProperties DynamicsLinkedServiceTypeProperties + err = json.Unmarshal(*v, &dynamicsLinkedServiceTypeProperties) + if err != nil { + return err + } + dls.DynamicsLinkedServiceTypeProperties = &dynamicsLinkedServiceTypeProperties + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if dls.AdditionalProperties == nil { + dls.AdditionalProperties = make(map[string]interface{}) + } + dls.AdditionalProperties[k] = additionalProperties + } + case "connectVia": + if v != nil { + var connectVia IntegrationRuntimeReference + err = json.Unmarshal(*v, &connectVia) + if err != nil { + return err + } + dls.ConnectVia = &connectVia + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + dls.Description = &description + } + case "parameters": + if v != nil { + var parameters map[string]*ParameterSpecification + err = json.Unmarshal(*v, ¶meters) + if err != nil { + return err + } + dls.Parameters = parameters + } + case "annotations": + if v != nil { + var annotations []interface{} + err = json.Unmarshal(*v, &annotations) + if err != nil { + return err + } + dls.Annotations = &annotations + } + case "type": + if v != nil { + var typeVar TypeBasicLinkedService + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + dls.Type = typeVar + } + } + } + + return nil +} + +// DynamicsLinkedServiceTypeProperties dynamics linked service properties. +type DynamicsLinkedServiceTypeProperties struct { + // DeploymentType - The deployment type of the Dynamics instance. 'Online' for Dynamics Online and 'OnPremisesWithIfd' for Dynamics on-premises with Ifd. Type: string (or Expression with resultType string). + DeploymentType interface{} `json:"deploymentType,omitempty"` + // HostName - The host name of the on-premises Dynamics server. The property is required for on-prem and not allowed for online. Type: string (or Expression with resultType string). + HostName interface{} `json:"hostName,omitempty"` + // Port - The port of on-premises Dynamics server. The property is required for on-prem and not allowed for online. Default is 443. Type: integer (or Expression with resultType integer), minimum: 0. + Port interface{} `json:"port,omitempty"` + // ServiceURI - The URL to the Microsoft Dynamics server. The property is required for on-line and not allowed for on-prem. Type: string (or Expression with resultType string). + ServiceURI interface{} `json:"serviceUri,omitempty"` + // OrganizationName - The organization name of the Dynamics instance. The property is required for on-prem and required for online when there are more than one Dynamics instances associated with the user. Type: string (or Expression with resultType string). + OrganizationName interface{} `json:"organizationName,omitempty"` + // AuthenticationType - The authentication type to connect to Dynamics server. 'Office365' for online scenario, 'Ifd' for on-premises with Ifd scenario. Type: string (or Expression with resultType string). + AuthenticationType interface{} `json:"authenticationType,omitempty"` + // Username - User name to access the Dynamics instance. Type: string (or Expression with resultType string). + Username interface{} `json:"username,omitempty"` + // Password - Password to access the Dynamics instance. + Password BasicSecretBase `json:"password,omitempty"` + // EncryptedCredential - The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string). + EncryptedCredential interface{} `json:"encryptedCredential,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for DynamicsLinkedServiceTypeProperties struct. +func (dlstp *DynamicsLinkedServiceTypeProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "deploymentType": + if v != nil { + var deploymentType interface{} + err = json.Unmarshal(*v, &deploymentType) + if err != nil { + return err + } + dlstp.DeploymentType = deploymentType + } + case "hostName": + if v != nil { + var hostName interface{} + err = json.Unmarshal(*v, &hostName) + if err != nil { + return err + } + dlstp.HostName = hostName + } + case "port": + if v != nil { + var port interface{} + err = json.Unmarshal(*v, &port) + if err != nil { + return err + } + dlstp.Port = port + } + case "serviceUri": + if v != nil { + var serviceURI interface{} + err = json.Unmarshal(*v, &serviceURI) + if err != nil { + return err + } + dlstp.ServiceURI = serviceURI + } + case "organizationName": + if v != nil { + var organizationName interface{} + err = json.Unmarshal(*v, &organizationName) + if err != nil { + return err + } + dlstp.OrganizationName = organizationName + } + case "authenticationType": + if v != nil { + var authenticationType interface{} + err = json.Unmarshal(*v, &authenticationType) + if err != nil { + return err + } + dlstp.AuthenticationType = authenticationType + } + case "username": + if v != nil { + var username interface{} + err = json.Unmarshal(*v, &username) + if err != nil { + return err + } + dlstp.Username = username + } + case "password": + if v != nil { + password, err := unmarshalBasicSecretBase(*v) + if err != nil { + return err + } + dlstp.Password = password + } + case "encryptedCredential": + if v != nil { + var encryptedCredential interface{} + err = json.Unmarshal(*v, &encryptedCredential) + if err != nil { + return err + } + dlstp.EncryptedCredential = encryptedCredential + } + } + } + + return nil +} + +// DynamicsSink a copy activity Dynamics sink. +type DynamicsSink struct { + // WriteBehavior - The write behavior for the operation. + WriteBehavior *string `json:"writeBehavior,omitempty"` + // IgnoreNullValues - The flag indicating whether ignore null values from input dataset (except key fields) during write operation. Default is false. Type: boolean (or Expression with resultType boolean). + IgnoreNullValues interface{} `json:"ignoreNullValues,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // WriteBatchSize - Write batch size. Type: integer (or Expression with resultType integer), minimum: 0. + WriteBatchSize interface{} `json:"writeBatchSize,omitempty"` + // WriteBatchTimeout - Write batch timeout. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + WriteBatchTimeout interface{} `json:"writeBatchTimeout,omitempty"` + // SinkRetryCount - Sink retry count. Type: integer (or Expression with resultType integer). + SinkRetryCount interface{} `json:"sinkRetryCount,omitempty"` + // SinkRetryWait - Sink retry wait. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + SinkRetryWait interface{} `json:"sinkRetryWait,omitempty"` + // Type - Possible values include: 'TypeCopySink', 'TypeSalesforceSink', 'TypeDynamicsSink', 'TypeOdbcSink', 'TypeAzureSearchIndexSink', 'TypeAzureDataLakeStoreSink', 'TypeOracleSink', 'TypeSQLDWSink', 'TypeSQLSink', 'TypeDocumentDbCollectionSink', 'TypeFileSystemSink', 'TypeBlobSink', 'TypeAzureTableSink', 'TypeAzureQueueSink', 'TypeSapCloudForCustomerSink' + Type TypeBasicCopySink `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for DynamicsSink. +func (ds DynamicsSink) MarshalJSON() ([]byte, error) { + ds.Type = TypeDynamicsSink + objectMap := make(map[string]interface{}) + if ds.WriteBehavior != nil { + objectMap["writeBehavior"] = ds.WriteBehavior + } + objectMap["ignoreNullValues"] = ds.IgnoreNullValues + objectMap["writeBatchSize"] = ds.WriteBatchSize + objectMap["writeBatchTimeout"] = ds.WriteBatchTimeout + objectMap["sinkRetryCount"] = ds.SinkRetryCount + objectMap["sinkRetryWait"] = ds.SinkRetryWait + if ds.Type != "" { + objectMap["type"] = ds.Type + } + for k, v := range ds.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsSalesforceSink is the BasicCopySink implementation for DynamicsSink. +func (ds DynamicsSink) AsSalesforceSink() (*SalesforceSink, bool) { + return nil, false +} + +// AsDynamicsSink is the BasicCopySink implementation for DynamicsSink. +func (ds DynamicsSink) AsDynamicsSink() (*DynamicsSink, bool) { + return &ds, true +} + +// AsOdbcSink is the BasicCopySink implementation for DynamicsSink. +func (ds DynamicsSink) AsOdbcSink() (*OdbcSink, bool) { + return nil, false +} + +// AsAzureSearchIndexSink is the BasicCopySink implementation for DynamicsSink. +func (ds DynamicsSink) AsAzureSearchIndexSink() (*AzureSearchIndexSink, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSink is the BasicCopySink implementation for DynamicsSink. +func (ds DynamicsSink) AsAzureDataLakeStoreSink() (*AzureDataLakeStoreSink, bool) { + return nil, false +} + +// AsOracleSink is the BasicCopySink implementation for DynamicsSink. +func (ds DynamicsSink) AsOracleSink() (*OracleSink, bool) { + return nil, false +} + +// AsSQLDWSink is the BasicCopySink implementation for DynamicsSink. +func (ds DynamicsSink) AsSQLDWSink() (*SQLDWSink, bool) { + return nil, false +} + +// AsSQLSink is the BasicCopySink implementation for DynamicsSink. +func (ds DynamicsSink) AsSQLSink() (*SQLSink, bool) { + return nil, false +} + +// AsDocumentDbCollectionSink is the BasicCopySink implementation for DynamicsSink. +func (ds DynamicsSink) AsDocumentDbCollectionSink() (*DocumentDbCollectionSink, bool) { + return nil, false +} + +// AsFileSystemSink is the BasicCopySink implementation for DynamicsSink. +func (ds DynamicsSink) AsFileSystemSink() (*FileSystemSink, bool) { + return nil, false +} + +// AsBlobSink is the BasicCopySink implementation for DynamicsSink. +func (ds DynamicsSink) AsBlobSink() (*BlobSink, bool) { + return nil, false +} + +// AsAzureTableSink is the BasicCopySink implementation for DynamicsSink. +func (ds DynamicsSink) AsAzureTableSink() (*AzureTableSink, bool) { + return nil, false +} + +// AsAzureQueueSink is the BasicCopySink implementation for DynamicsSink. +func (ds DynamicsSink) AsAzureQueueSink() (*AzureQueueSink, bool) { + return nil, false +} + +// AsSapCloudForCustomerSink is the BasicCopySink implementation for DynamicsSink. +func (ds DynamicsSink) AsSapCloudForCustomerSink() (*SapCloudForCustomerSink, bool) { + return nil, false +} + +// AsCopySink is the BasicCopySink implementation for DynamicsSink. +func (ds DynamicsSink) AsCopySink() (*CopySink, bool) { + return nil, false +} + +// AsBasicCopySink is the BasicCopySink implementation for DynamicsSink. +func (ds DynamicsSink) AsBasicCopySink() (BasicCopySink, bool) { + return &ds, true +} + +// DynamicsSource a copy activity Dynamics source. +type DynamicsSource struct { + // Query - FetchXML is a proprietary query language that is used in Microsoft Dynamics (online & on-premises). Type: string (or Expression with resultType string). + Query interface{} `json:"query,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // SourceRetryCount - Source retry count. Type: integer (or Expression with resultType integer). + SourceRetryCount interface{} `json:"sourceRetryCount,omitempty"` + // SourceRetryWait - Source retry wait. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` + // Type - Possible values include: 'TypeCopySource', 'TypeAmazonRedshiftSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeHTTPSource', 'TypeAzureDataLakeStoreSource', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeRelationalSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource' + Type TypeBasicCopySource `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for DynamicsSource. +func (ds DynamicsSource) MarshalJSON() ([]byte, error) { + ds.Type = TypeDynamicsSource + objectMap := make(map[string]interface{}) + objectMap["query"] = ds.Query + objectMap["sourceRetryCount"] = ds.SourceRetryCount + objectMap["sourceRetryWait"] = ds.SourceRetryWait + if ds.Type != "" { + objectMap["type"] = ds.Type + } + for k, v := range ds.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsAmazonRedshiftSource is the BasicCopySource implementation for DynamicsSource. +func (ds DynamicsSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { + return nil, false +} + +// AsResponsysSource is the BasicCopySource implementation for DynamicsSource. +func (ds DynamicsSource) AsResponsysSource() (*ResponsysSource, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudSource is the BasicCopySource implementation for DynamicsSource. +func (ds DynamicsSource) AsSalesforceMarketingCloudSource() (*SalesforceMarketingCloudSource, bool) { + return nil, false +} + +// AsVerticaSource is the BasicCopySource implementation for DynamicsSource. +func (ds DynamicsSource) AsVerticaSource() (*VerticaSource, bool) { + return nil, false +} + +// AsNetezzaSource is the BasicCopySource implementation for DynamicsSource. +func (ds DynamicsSource) AsNetezzaSource() (*NetezzaSource, bool) { + return nil, false +} + +// AsZohoSource is the BasicCopySource implementation for DynamicsSource. +func (ds DynamicsSource) AsZohoSource() (*ZohoSource, bool) { + return nil, false +} + +// AsXeroSource is the BasicCopySource implementation for DynamicsSource. +func (ds DynamicsSource) AsXeroSource() (*XeroSource, bool) { + return nil, false +} + +// AsSquareSource is the BasicCopySource implementation for DynamicsSource. +func (ds DynamicsSource) AsSquareSource() (*SquareSource, bool) { + return nil, false +} + +// AsSparkSource is the BasicCopySource implementation for DynamicsSource. +func (ds DynamicsSource) AsSparkSource() (*SparkSource, bool) { + return nil, false +} + +// AsShopifySource is the BasicCopySource implementation for DynamicsSource. +func (ds DynamicsSource) AsShopifySource() (*ShopifySource, bool) { + return nil, false +} + +// AsServiceNowSource is the BasicCopySource implementation for DynamicsSource. +func (ds DynamicsSource) AsServiceNowSource() (*ServiceNowSource, bool) { + return nil, false +} + +// AsQuickBooksSource is the BasicCopySource implementation for DynamicsSource. +func (ds DynamicsSource) AsQuickBooksSource() (*QuickBooksSource, bool) { + return nil, false +} + +// AsPrestoSource is the BasicCopySource implementation for DynamicsSource. +func (ds DynamicsSource) AsPrestoSource() (*PrestoSource, bool) { + return nil, false +} + +// AsPhoenixSource is the BasicCopySource implementation for DynamicsSource. +func (ds DynamicsSource) AsPhoenixSource() (*PhoenixSource, bool) { + return nil, false +} + +// AsPaypalSource is the BasicCopySource implementation for DynamicsSource. +func (ds DynamicsSource) AsPaypalSource() (*PaypalSource, bool) { + return nil, false +} + +// AsMarketoSource is the BasicCopySource implementation for DynamicsSource. +func (ds DynamicsSource) AsMarketoSource() (*MarketoSource, bool) { + return nil, false +} + +// AsMariaDBSource is the BasicCopySource implementation for DynamicsSource. +func (ds DynamicsSource) AsMariaDBSource() (*MariaDBSource, bool) { + return nil, false +} + +// AsMagentoSource is the BasicCopySource implementation for DynamicsSource. +func (ds DynamicsSource) AsMagentoSource() (*MagentoSource, bool) { + return nil, false +} + +// AsJiraSource is the BasicCopySource implementation for DynamicsSource. +func (ds DynamicsSource) AsJiraSource() (*JiraSource, bool) { + return nil, false +} + +// AsImpalaSource is the BasicCopySource implementation for DynamicsSource. +func (ds DynamicsSource) AsImpalaSource() (*ImpalaSource, bool) { + return nil, false +} + +// AsHubspotSource is the BasicCopySource implementation for DynamicsSource. +func (ds DynamicsSource) AsHubspotSource() (*HubspotSource, bool) { + return nil, false +} + +// AsHiveSource is the BasicCopySource implementation for DynamicsSource. +func (ds DynamicsSource) AsHiveSource() (*HiveSource, bool) { + return nil, false +} + +// AsHBaseSource is the BasicCopySource implementation for DynamicsSource. +func (ds DynamicsSource) AsHBaseSource() (*HBaseSource, bool) { + return nil, false +} + +// AsGreenplumSource is the BasicCopySource implementation for DynamicsSource. +func (ds DynamicsSource) AsGreenplumSource() (*GreenplumSource, bool) { + return nil, false +} + +// AsGoogleBigQuerySource is the BasicCopySource implementation for DynamicsSource. +func (ds DynamicsSource) AsGoogleBigQuerySource() (*GoogleBigQuerySource, bool) { + return nil, false +} + +// AsEloquaSource is the BasicCopySource implementation for DynamicsSource. +func (ds DynamicsSource) AsEloquaSource() (*EloquaSource, bool) { + return nil, false +} + +// AsDrillSource is the BasicCopySource implementation for DynamicsSource. +func (ds DynamicsSource) AsDrillSource() (*DrillSource, bool) { + return nil, false +} + +// AsCouchbaseSource is the BasicCopySource implementation for DynamicsSource. +func (ds DynamicsSource) AsCouchbaseSource() (*CouchbaseSource, bool) { + return nil, false +} + +// AsConcurSource is the BasicCopySource implementation for DynamicsSource. +func (ds DynamicsSource) AsConcurSource() (*ConcurSource, bool) { + return nil, false +} + +// AsAzurePostgreSQLSource is the BasicCopySource implementation for DynamicsSource. +func (ds DynamicsSource) AsAzurePostgreSQLSource() (*AzurePostgreSQLSource, bool) { + return nil, false +} + +// AsAmazonMWSSource is the BasicCopySource implementation for DynamicsSource. +func (ds DynamicsSource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { + return nil, false +} + +// AsHTTPSource is the BasicCopySource implementation for DynamicsSource. +func (ds DynamicsSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for DynamicsSource. +func (ds DynamicsSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for DynamicsSource. +func (ds DynamicsSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsCassandraSource is the BasicCopySource implementation for DynamicsSource. +func (ds DynamicsSource) AsCassandraSource() (*CassandraSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for DynamicsSource. +func (ds DynamicsSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for DynamicsSource. +func (ds DynamicsSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureMySQLSource is the BasicCopySource implementation for DynamicsSource. +func (ds DynamicsSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for DynamicsSource. +func (ds DynamicsSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for DynamicsSource. +func (ds DynamicsSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsSQLDWSource is the BasicCopySource implementation for DynamicsSource. +func (ds DynamicsSource) AsSQLDWSource() (*SQLDWSource, bool) { + return nil, false +} + +// AsSQLSource is the BasicCopySource implementation for DynamicsSource. +func (ds DynamicsSource) AsSQLSource() (*SQLSource, bool) { + return nil, false +} + +// AsSapEccSource is the BasicCopySource implementation for DynamicsSource. +func (ds DynamicsSource) AsSapEccSource() (*SapEccSource, bool) { + return nil, false +} + +// AsSapCloudForCustomerSource is the BasicCopySource implementation for DynamicsSource. +func (ds DynamicsSource) AsSapCloudForCustomerSource() (*SapCloudForCustomerSource, bool) { + return nil, false +} + +// AsSalesforceSource is the BasicCopySource implementation for DynamicsSource. +func (ds DynamicsSource) AsSalesforceSource() (*SalesforceSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for DynamicsSource. +func (ds DynamicsSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for DynamicsSource. +func (ds DynamicsSource) AsDynamicsSource() (*DynamicsSource, bool) { + return &ds, true +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for DynamicsSource. +func (ds DynamicsSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for DynamicsSource. +func (ds DynamicsSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + +// AsAzureTableSource is the BasicCopySource implementation for DynamicsSource. +func (ds DynamicsSource) AsAzureTableSource() (*AzureTableSource, bool) { + return nil, false +} + +// AsCopySource is the BasicCopySource implementation for DynamicsSource. +func (ds DynamicsSource) AsCopySource() (*CopySource, bool) { + return nil, false +} + +// AsBasicCopySource is the BasicCopySource implementation for DynamicsSource. +func (ds DynamicsSource) AsBasicCopySource() (BasicCopySource, bool) { + return &ds, true +} + +// EloquaLinkedService eloqua server linked service. +type EloquaLinkedService struct { + // EloquaLinkedServiceTypeProperties - Eloqua server linked service properties. + *EloquaLinkedServiceTypeProperties `json:"typeProperties,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // ConnectVia - The integration runtime reference. + ConnectVia *IntegrationRuntimeReference `json:"connectVia,omitempty"` + // Description - Linked service description. + Description *string `json:"description,omitempty"` + // Parameters - Parameters for linked service. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeLinkedService', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforce', 'TypeAzureDataLakeStore', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureStorage' + Type TypeBasicLinkedService `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for EloquaLinkedService. +func (els EloquaLinkedService) MarshalJSON() ([]byte, error) { + els.Type = TypeEloqua + objectMap := make(map[string]interface{}) + if els.EloquaLinkedServiceTypeProperties != nil { + objectMap["typeProperties"] = els.EloquaLinkedServiceTypeProperties + } + if els.ConnectVia != nil { + objectMap["connectVia"] = els.ConnectVia + } + if els.Description != nil { + objectMap["description"] = els.Description + } + if els.Parameters != nil { + objectMap["parameters"] = els.Parameters + } + if els.Annotations != nil { + objectMap["annotations"] = els.Annotations + } + if els.Type != "" { + objectMap["type"] = els.Type + } + for k, v := range els.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysLinkedService is the BasicLinkedService implementation for EloquaLinkedService. +func (els EloquaLinkedService) AsResponsysLinkedService() (*ResponsysLinkedService, bool) { + return nil, false +} + +// AsAzureDatabricksLinkedService is the BasicLinkedService implementation for EloquaLinkedService. +func (els EloquaLinkedService) AsAzureDatabricksLinkedService() (*AzureDatabricksLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeAnalyticsLinkedService is the BasicLinkedService implementation for EloquaLinkedService. +func (els EloquaLinkedService) AsAzureDataLakeAnalyticsLinkedService() (*AzureDataLakeAnalyticsLinkedService, bool) { + return nil, false +} + +// AsHDInsightOnDemandLinkedService is the BasicLinkedService implementation for EloquaLinkedService. +func (els EloquaLinkedService) AsHDInsightOnDemandLinkedService() (*HDInsightOnDemandLinkedService, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudLinkedService is the BasicLinkedService implementation for EloquaLinkedService. +func (els EloquaLinkedService) AsSalesforceMarketingCloudLinkedService() (*SalesforceMarketingCloudLinkedService, bool) { + return nil, false +} + +// AsNetezzaLinkedService is the BasicLinkedService implementation for EloquaLinkedService. +func (els EloquaLinkedService) AsNetezzaLinkedService() (*NetezzaLinkedService, bool) { + return nil, false +} + +// AsVerticaLinkedService is the BasicLinkedService implementation for EloquaLinkedService. +func (els EloquaLinkedService) AsVerticaLinkedService() (*VerticaLinkedService, bool) { + return nil, false +} + +// AsZohoLinkedService is the BasicLinkedService implementation for EloquaLinkedService. +func (els EloquaLinkedService) AsZohoLinkedService() (*ZohoLinkedService, bool) { + return nil, false +} + +// AsXeroLinkedService is the BasicLinkedService implementation for EloquaLinkedService. +func (els EloquaLinkedService) AsXeroLinkedService() (*XeroLinkedService, bool) { + return nil, false +} + +// AsSquareLinkedService is the BasicLinkedService implementation for EloquaLinkedService. +func (els EloquaLinkedService) AsSquareLinkedService() (*SquareLinkedService, bool) { + return nil, false +} + +// AsSparkLinkedService is the BasicLinkedService implementation for EloquaLinkedService. +func (els EloquaLinkedService) AsSparkLinkedService() (*SparkLinkedService, bool) { + return nil, false +} + +// AsShopifyLinkedService is the BasicLinkedService implementation for EloquaLinkedService. +func (els EloquaLinkedService) AsShopifyLinkedService() (*ShopifyLinkedService, bool) { + return nil, false +} + +// AsServiceNowLinkedService is the BasicLinkedService implementation for EloquaLinkedService. +func (els EloquaLinkedService) AsServiceNowLinkedService() (*ServiceNowLinkedService, bool) { + return nil, false +} + +// AsQuickBooksLinkedService is the BasicLinkedService implementation for EloquaLinkedService. +func (els EloquaLinkedService) AsQuickBooksLinkedService() (*QuickBooksLinkedService, bool) { + return nil, false +} + +// AsPrestoLinkedService is the BasicLinkedService implementation for EloquaLinkedService. +func (els EloquaLinkedService) AsPrestoLinkedService() (*PrestoLinkedService, bool) { + return nil, false +} + +// AsPhoenixLinkedService is the BasicLinkedService implementation for EloquaLinkedService. +func (els EloquaLinkedService) AsPhoenixLinkedService() (*PhoenixLinkedService, bool) { + return nil, false +} + +// AsPaypalLinkedService is the BasicLinkedService implementation for EloquaLinkedService. +func (els EloquaLinkedService) AsPaypalLinkedService() (*PaypalLinkedService, bool) { + return nil, false +} + +// AsMarketoLinkedService is the BasicLinkedService implementation for EloquaLinkedService. +func (els EloquaLinkedService) AsMarketoLinkedService() (*MarketoLinkedService, bool) { + return nil, false +} + +// AsMariaDBLinkedService is the BasicLinkedService implementation for EloquaLinkedService. +func (els EloquaLinkedService) AsMariaDBLinkedService() (*MariaDBLinkedService, bool) { + return nil, false +} + +// AsMagentoLinkedService is the BasicLinkedService implementation for EloquaLinkedService. +func (els EloquaLinkedService) AsMagentoLinkedService() (*MagentoLinkedService, bool) { + return nil, false +} + +// AsJiraLinkedService is the BasicLinkedService implementation for EloquaLinkedService. +func (els EloquaLinkedService) AsJiraLinkedService() (*JiraLinkedService, bool) { + return nil, false +} + +// AsImpalaLinkedService is the BasicLinkedService implementation for EloquaLinkedService. +func (els EloquaLinkedService) AsImpalaLinkedService() (*ImpalaLinkedService, bool) { + return nil, false +} + +// AsHubspotLinkedService is the BasicLinkedService implementation for EloquaLinkedService. +func (els EloquaLinkedService) AsHubspotLinkedService() (*HubspotLinkedService, bool) { + return nil, false +} + +// AsHiveLinkedService is the BasicLinkedService implementation for EloquaLinkedService. +func (els EloquaLinkedService) AsHiveLinkedService() (*HiveLinkedService, bool) { + return nil, false +} + +// AsHBaseLinkedService is the BasicLinkedService implementation for EloquaLinkedService. +func (els EloquaLinkedService) AsHBaseLinkedService() (*HBaseLinkedService, bool) { + return nil, false +} + +// AsGreenplumLinkedService is the BasicLinkedService implementation for EloquaLinkedService. +func (els EloquaLinkedService) AsGreenplumLinkedService() (*GreenplumLinkedService, bool) { + return nil, false +} + +// AsGoogleBigQueryLinkedService is the BasicLinkedService implementation for EloquaLinkedService. +func (els EloquaLinkedService) AsGoogleBigQueryLinkedService() (*GoogleBigQueryLinkedService, bool) { + return nil, false +} + +// AsEloquaLinkedService is the BasicLinkedService implementation for EloquaLinkedService. +func (els EloquaLinkedService) AsEloquaLinkedService() (*EloquaLinkedService, bool) { + return &els, true +} + +// AsDrillLinkedService is the BasicLinkedService implementation for EloquaLinkedService. +func (els EloquaLinkedService) AsDrillLinkedService() (*DrillLinkedService, bool) { + return nil, false +} + +// AsCouchbaseLinkedService is the BasicLinkedService implementation for EloquaLinkedService. +func (els EloquaLinkedService) AsCouchbaseLinkedService() (*CouchbaseLinkedService, bool) { + return nil, false +} + +// AsConcurLinkedService is the BasicLinkedService implementation for EloquaLinkedService. +func (els EloquaLinkedService) AsConcurLinkedService() (*ConcurLinkedService, bool) { + return nil, false +} + +// AsAzurePostgreSQLLinkedService is the BasicLinkedService implementation for EloquaLinkedService. +func (els EloquaLinkedService) AsAzurePostgreSQLLinkedService() (*AzurePostgreSQLLinkedService, bool) { + return nil, false +} + +// AsAmazonMWSLinkedService is the BasicLinkedService implementation for EloquaLinkedService. +func (els EloquaLinkedService) AsAmazonMWSLinkedService() (*AmazonMWSLinkedService, bool) { + return nil, false +} + +// AsSapHanaLinkedService is the BasicLinkedService implementation for EloquaLinkedService. +func (els EloquaLinkedService) AsSapHanaLinkedService() (*SapHanaLinkedService, bool) { + return nil, false +} + +// AsSapBWLinkedService is the BasicLinkedService implementation for EloquaLinkedService. +func (els EloquaLinkedService) AsSapBWLinkedService() (*SapBWLinkedService, bool) { + return nil, false +} + +// AsSftpServerLinkedService is the BasicLinkedService implementation for EloquaLinkedService. +func (els EloquaLinkedService) AsSftpServerLinkedService() (*SftpServerLinkedService, bool) { + return nil, false +} + +// AsFtpServerLinkedService is the BasicLinkedService implementation for EloquaLinkedService. +func (els EloquaLinkedService) AsFtpServerLinkedService() (*FtpServerLinkedService, bool) { + return nil, false +} + +// AsHTTPLinkedService is the BasicLinkedService implementation for EloquaLinkedService. +func (els EloquaLinkedService) AsHTTPLinkedService() (*HTTPLinkedService, bool) { + return nil, false +} + +// AsAzureSearchLinkedService is the BasicLinkedService implementation for EloquaLinkedService. +func (els EloquaLinkedService) AsAzureSearchLinkedService() (*AzureSearchLinkedService, bool) { + return nil, false +} + +// AsCustomDataSourceLinkedService is the BasicLinkedService implementation for EloquaLinkedService. +func (els EloquaLinkedService) AsCustomDataSourceLinkedService() (*CustomDataSourceLinkedService, bool) { + return nil, false +} + +// AsAmazonRedshiftLinkedService is the BasicLinkedService implementation for EloquaLinkedService. +func (els EloquaLinkedService) AsAmazonRedshiftLinkedService() (*AmazonRedshiftLinkedService, bool) { + return nil, false +} + +// AsAmazonS3LinkedService is the BasicLinkedService implementation for EloquaLinkedService. +func (els EloquaLinkedService) AsAmazonS3LinkedService() (*AmazonS3LinkedService, bool) { + return nil, false +} + +// AsSapEccLinkedService is the BasicLinkedService implementation for EloquaLinkedService. +func (els EloquaLinkedService) AsSapEccLinkedService() (*SapEccLinkedService, bool) { + return nil, false +} + +// AsSapCloudForCustomerLinkedService is the BasicLinkedService implementation for EloquaLinkedService. +func (els EloquaLinkedService) AsSapCloudForCustomerLinkedService() (*SapCloudForCustomerLinkedService, bool) { + return nil, false +} + +// AsSalesforceLinkedService is the BasicLinkedService implementation for EloquaLinkedService. +func (els EloquaLinkedService) AsSalesforceLinkedService() (*SalesforceLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeStoreLinkedService is the BasicLinkedService implementation for EloquaLinkedService. +func (els EloquaLinkedService) AsAzureDataLakeStoreLinkedService() (*AzureDataLakeStoreLinkedService, bool) { + return nil, false +} + +// AsMongoDbLinkedService is the BasicLinkedService implementation for EloquaLinkedService. +func (els EloquaLinkedService) AsMongoDbLinkedService() (*MongoDbLinkedService, bool) { + return nil, false +} + +// AsCassandraLinkedService is the BasicLinkedService implementation for EloquaLinkedService. +func (els EloquaLinkedService) AsCassandraLinkedService() (*CassandraLinkedService, bool) { + return nil, false +} + +// AsWebLinkedService is the BasicLinkedService implementation for EloquaLinkedService. +func (els EloquaLinkedService) AsWebLinkedService() (*WebLinkedService, bool) { + return nil, false +} + +// AsODataLinkedService is the BasicLinkedService implementation for EloquaLinkedService. +func (els EloquaLinkedService) AsODataLinkedService() (*ODataLinkedService, bool) { + return nil, false +} + +// AsHdfsLinkedService is the BasicLinkedService implementation for EloquaLinkedService. +func (els EloquaLinkedService) AsHdfsLinkedService() (*HdfsLinkedService, bool) { + return nil, false +} + +// AsOdbcLinkedService is the BasicLinkedService implementation for EloquaLinkedService. +func (els EloquaLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, bool) { + return nil, false +} + +// AsAzureMLLinkedService is the BasicLinkedService implementation for EloquaLinkedService. +func (els EloquaLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { + return nil, false +} + +// AsTeradataLinkedService is the BasicLinkedService implementation for EloquaLinkedService. +func (els EloquaLinkedService) AsTeradataLinkedService() (*TeradataLinkedService, bool) { + return nil, false +} + +// AsDb2LinkedService is the BasicLinkedService implementation for EloquaLinkedService. +func (els EloquaLinkedService) AsDb2LinkedService() (*Db2LinkedService, bool) { + return nil, false +} + +// AsSybaseLinkedService is the BasicLinkedService implementation for EloquaLinkedService. +func (els EloquaLinkedService) AsSybaseLinkedService() (*SybaseLinkedService, bool) { + return nil, false +} + +// AsPostgreSQLLinkedService is the BasicLinkedService implementation for EloquaLinkedService. +func (els EloquaLinkedService) AsPostgreSQLLinkedService() (*PostgreSQLLinkedService, bool) { + return nil, false +} + +// AsMySQLLinkedService is the BasicLinkedService implementation for EloquaLinkedService. +func (els EloquaLinkedService) AsMySQLLinkedService() (*MySQLLinkedService, bool) { + return nil, false +} + +// AsAzureMySQLLinkedService is the BasicLinkedService implementation for EloquaLinkedService. +func (els EloquaLinkedService) AsAzureMySQLLinkedService() (*AzureMySQLLinkedService, bool) { + return nil, false +} + +// AsOracleLinkedService is the BasicLinkedService implementation for EloquaLinkedService. +func (els EloquaLinkedService) AsOracleLinkedService() (*OracleLinkedService, bool) { + return nil, false +} + +// AsFileServerLinkedService is the BasicLinkedService implementation for EloquaLinkedService. +func (els EloquaLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { + return nil, false +} + +// AsHDInsightLinkedService is the BasicLinkedService implementation for EloquaLinkedService. +func (els EloquaLinkedService) AsHDInsightLinkedService() (*HDInsightLinkedService, bool) { + return nil, false +} + +// AsDynamicsLinkedService is the BasicLinkedService implementation for EloquaLinkedService. +func (els EloquaLinkedService) AsDynamicsLinkedService() (*DynamicsLinkedService, bool) { + return nil, false +} + +// AsCosmosDbLinkedService is the BasicLinkedService implementation for EloquaLinkedService. +func (els EloquaLinkedService) AsCosmosDbLinkedService() (*CosmosDbLinkedService, bool) { + return nil, false +} + +// AsAzureKeyVaultLinkedService is the BasicLinkedService implementation for EloquaLinkedService. +func (els EloquaLinkedService) AsAzureKeyVaultLinkedService() (*AzureKeyVaultLinkedService, bool) { + return nil, false +} + +// AsAzureBatchLinkedService is the BasicLinkedService implementation for EloquaLinkedService. +func (els EloquaLinkedService) AsAzureBatchLinkedService() (*AzureBatchLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDatabaseLinkedService is the BasicLinkedService implementation for EloquaLinkedService. +func (els EloquaLinkedService) AsAzureSQLDatabaseLinkedService() (*AzureSQLDatabaseLinkedService, bool) { + return nil, false +} + +// AsSQLServerLinkedService is the BasicLinkedService implementation for EloquaLinkedService. +func (els EloquaLinkedService) AsSQLServerLinkedService() (*SQLServerLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDWLinkedService is the BasicLinkedService implementation for EloquaLinkedService. +func (els EloquaLinkedService) AsAzureSQLDWLinkedService() (*AzureSQLDWLinkedService, bool) { + return nil, false +} + +// AsAzureStorageLinkedService is the BasicLinkedService implementation for EloquaLinkedService. +func (els EloquaLinkedService) AsAzureStorageLinkedService() (*AzureStorageLinkedService, bool) { + return nil, false +} + +// AsLinkedService is the BasicLinkedService implementation for EloquaLinkedService. +func (els EloquaLinkedService) AsLinkedService() (*LinkedService, bool) { + return nil, false +} + +// AsBasicLinkedService is the BasicLinkedService implementation for EloquaLinkedService. +func (els EloquaLinkedService) AsBasicLinkedService() (BasicLinkedService, bool) { + return &els, true +} + +// UnmarshalJSON is the custom unmarshaler for EloquaLinkedService struct. +func (els *EloquaLinkedService) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "typeProperties": + if v != nil { + var eloquaLinkedServiceTypeProperties EloquaLinkedServiceTypeProperties + err = json.Unmarshal(*v, &eloquaLinkedServiceTypeProperties) + if err != nil { + return err + } + els.EloquaLinkedServiceTypeProperties = &eloquaLinkedServiceTypeProperties + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if els.AdditionalProperties == nil { + els.AdditionalProperties = make(map[string]interface{}) + } + els.AdditionalProperties[k] = additionalProperties + } + case "connectVia": + if v != nil { + var connectVia IntegrationRuntimeReference + err = json.Unmarshal(*v, &connectVia) + if err != nil { + return err + } + els.ConnectVia = &connectVia + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + els.Description = &description + } + case "parameters": + if v != nil { + var parameters map[string]*ParameterSpecification + err = json.Unmarshal(*v, ¶meters) + if err != nil { + return err + } + els.Parameters = parameters + } + case "annotations": + if v != nil { + var annotations []interface{} + err = json.Unmarshal(*v, &annotations) + if err != nil { + return err + } + els.Annotations = &annotations + } + case "type": + if v != nil { + var typeVar TypeBasicLinkedService + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + els.Type = typeVar + } + } + } + + return nil +} + +// EloquaLinkedServiceTypeProperties eloqua server linked service properties. +type EloquaLinkedServiceTypeProperties struct { + // Endpoint - The endpoint of the Eloqua server. (i.e. eloqua.example.com) + Endpoint interface{} `json:"endpoint,omitempty"` + // Username - The site name and user name of your Eloqua account in the form: sitename/username. (i.e. Eloqua/Alice) + Username interface{} `json:"username,omitempty"` + // Password - The password corresponding to the user name. + Password BasicSecretBase `json:"password,omitempty"` + // UseEncryptedEndpoints - Specifies whether the data source endpoints are encrypted using HTTPS. The default value is true. + UseEncryptedEndpoints interface{} `json:"useEncryptedEndpoints,omitempty"` + // UseHostVerification - Specifies whether to require the host name in the server's certificate to match the host name of the server when connecting over SSL. The default value is true. + UseHostVerification interface{} `json:"useHostVerification,omitempty"` + // UsePeerVerification - Specifies whether to verify the identity of the server when connecting over SSL. The default value is true. + UsePeerVerification interface{} `json:"usePeerVerification,omitempty"` + // EncryptedCredential - The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string). + EncryptedCredential interface{} `json:"encryptedCredential,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for EloquaLinkedServiceTypeProperties struct. +func (elstp *EloquaLinkedServiceTypeProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "endpoint": + if v != nil { + var endpoint interface{} + err = json.Unmarshal(*v, &endpoint) + if err != nil { + return err + } + elstp.Endpoint = endpoint + } + case "username": + if v != nil { + var username interface{} + err = json.Unmarshal(*v, &username) + if err != nil { + return err + } + elstp.Username = username + } + case "password": + if v != nil { + password, err := unmarshalBasicSecretBase(*v) + if err != nil { + return err + } + elstp.Password = password + } + case "useEncryptedEndpoints": + if v != nil { + var useEncryptedEndpoints interface{} + err = json.Unmarshal(*v, &useEncryptedEndpoints) + if err != nil { + return err + } + elstp.UseEncryptedEndpoints = useEncryptedEndpoints + } + case "useHostVerification": + if v != nil { + var useHostVerification interface{} + err = json.Unmarshal(*v, &useHostVerification) + if err != nil { + return err + } + elstp.UseHostVerification = useHostVerification + } + case "usePeerVerification": + if v != nil { + var usePeerVerification interface{} + err = json.Unmarshal(*v, &usePeerVerification) + if err != nil { + return err + } + elstp.UsePeerVerification = usePeerVerification + } + case "encryptedCredential": + if v != nil { + var encryptedCredential interface{} + err = json.Unmarshal(*v, &encryptedCredential) + if err != nil { + return err + } + elstp.EncryptedCredential = encryptedCredential + } + } + } + + return nil +} + +// EloquaObjectDataset eloqua server dataset. +type EloquaObjectDataset struct { + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Description - Dataset description. + Description *string `json:"description,omitempty"` + // Structure - Columns that define the structure of the dataset. Type: array (or Expression with resultType array), itemType: DatasetDataElement. + Structure interface{} `json:"structure,omitempty"` + // LinkedServiceName - Linked service reference. + LinkedServiceName *LinkedServiceReference `json:"linkedServiceName,omitempty"` + // Parameters - Parameters for dataset. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeDataset', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSQLServerTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSalesforceObject', 'TypeRelationalTable', 'TypeAzureMySQLTable', 'TypeOracleTable', 'TypeODataResource', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeAzureDataLakeStoreFile', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeAmazonS3Object' + Type TypeBasicDataset `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for EloquaObjectDataset. +func (eod EloquaObjectDataset) MarshalJSON() ([]byte, error) { + eod.Type = TypeEloquaObject + objectMap := make(map[string]interface{}) + if eod.Description != nil { + objectMap["description"] = eod.Description + } + objectMap["structure"] = eod.Structure + if eod.LinkedServiceName != nil { + objectMap["linkedServiceName"] = eod.LinkedServiceName + } + if eod.Parameters != nil { + objectMap["parameters"] = eod.Parameters + } + if eod.Annotations != nil { + objectMap["annotations"] = eod.Annotations + } + if eod.Type != "" { + objectMap["type"] = eod.Type + } + for k, v := range eod.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysObjectDataset is the BasicDataset implementation for EloquaObjectDataset. +func (eod EloquaObjectDataset) AsResponsysObjectDataset() (*ResponsysObjectDataset, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudObjectDataset is the BasicDataset implementation for EloquaObjectDataset. +func (eod EloquaObjectDataset) AsSalesforceMarketingCloudObjectDataset() (*SalesforceMarketingCloudObjectDataset, bool) { + return nil, false +} + +// AsVerticaTableDataset is the BasicDataset implementation for EloquaObjectDataset. +func (eod EloquaObjectDataset) AsVerticaTableDataset() (*VerticaTableDataset, bool) { + return nil, false +} + +// AsNetezzaTableDataset is the BasicDataset implementation for EloquaObjectDataset. +func (eod EloquaObjectDataset) AsNetezzaTableDataset() (*NetezzaTableDataset, bool) { + return nil, false +} + +// AsZohoObjectDataset is the BasicDataset implementation for EloquaObjectDataset. +func (eod EloquaObjectDataset) AsZohoObjectDataset() (*ZohoObjectDataset, bool) { + return nil, false +} + +// AsXeroObjectDataset is the BasicDataset implementation for EloquaObjectDataset. +func (eod EloquaObjectDataset) AsXeroObjectDataset() (*XeroObjectDataset, bool) { + return nil, false +} + +// AsSquareObjectDataset is the BasicDataset implementation for EloquaObjectDataset. +func (eod EloquaObjectDataset) AsSquareObjectDataset() (*SquareObjectDataset, bool) { + return nil, false +} + +// AsSparkObjectDataset is the BasicDataset implementation for EloquaObjectDataset. +func (eod EloquaObjectDataset) AsSparkObjectDataset() (*SparkObjectDataset, bool) { + return nil, false +} + +// AsShopifyObjectDataset is the BasicDataset implementation for EloquaObjectDataset. +func (eod EloquaObjectDataset) AsShopifyObjectDataset() (*ShopifyObjectDataset, bool) { + return nil, false +} + +// AsServiceNowObjectDataset is the BasicDataset implementation for EloquaObjectDataset. +func (eod EloquaObjectDataset) AsServiceNowObjectDataset() (*ServiceNowObjectDataset, bool) { + return nil, false +} + +// AsQuickBooksObjectDataset is the BasicDataset implementation for EloquaObjectDataset. +func (eod EloquaObjectDataset) AsQuickBooksObjectDataset() (*QuickBooksObjectDataset, bool) { + return nil, false +} + +// AsPrestoObjectDataset is the BasicDataset implementation for EloquaObjectDataset. +func (eod EloquaObjectDataset) AsPrestoObjectDataset() (*PrestoObjectDataset, bool) { + return nil, false +} + +// AsPhoenixObjectDataset is the BasicDataset implementation for EloquaObjectDataset. +func (eod EloquaObjectDataset) AsPhoenixObjectDataset() (*PhoenixObjectDataset, bool) { + return nil, false +} + +// AsPaypalObjectDataset is the BasicDataset implementation for EloquaObjectDataset. +func (eod EloquaObjectDataset) AsPaypalObjectDataset() (*PaypalObjectDataset, bool) { + return nil, false +} + +// AsMarketoObjectDataset is the BasicDataset implementation for EloquaObjectDataset. +func (eod EloquaObjectDataset) AsMarketoObjectDataset() (*MarketoObjectDataset, bool) { + return nil, false +} + +// AsMariaDBTableDataset is the BasicDataset implementation for EloquaObjectDataset. +func (eod EloquaObjectDataset) AsMariaDBTableDataset() (*MariaDBTableDataset, bool) { + return nil, false +} + +// AsMagentoObjectDataset is the BasicDataset implementation for EloquaObjectDataset. +func (eod EloquaObjectDataset) AsMagentoObjectDataset() (*MagentoObjectDataset, bool) { + return nil, false +} + +// AsJiraObjectDataset is the BasicDataset implementation for EloquaObjectDataset. +func (eod EloquaObjectDataset) AsJiraObjectDataset() (*JiraObjectDataset, bool) { + return nil, false +} + +// AsImpalaObjectDataset is the BasicDataset implementation for EloquaObjectDataset. +func (eod EloquaObjectDataset) AsImpalaObjectDataset() (*ImpalaObjectDataset, bool) { + return nil, false +} + +// AsHubspotObjectDataset is the BasicDataset implementation for EloquaObjectDataset. +func (eod EloquaObjectDataset) AsHubspotObjectDataset() (*HubspotObjectDataset, bool) { + return nil, false +} + +// AsHiveObjectDataset is the BasicDataset implementation for EloquaObjectDataset. +func (eod EloquaObjectDataset) AsHiveObjectDataset() (*HiveObjectDataset, bool) { + return nil, false +} + +// AsHBaseObjectDataset is the BasicDataset implementation for EloquaObjectDataset. +func (eod EloquaObjectDataset) AsHBaseObjectDataset() (*HBaseObjectDataset, bool) { + return nil, false +} + +// AsGreenplumTableDataset is the BasicDataset implementation for EloquaObjectDataset. +func (eod EloquaObjectDataset) AsGreenplumTableDataset() (*GreenplumTableDataset, bool) { + return nil, false +} + +// AsGoogleBigQueryObjectDataset is the BasicDataset implementation for EloquaObjectDataset. +func (eod EloquaObjectDataset) AsGoogleBigQueryObjectDataset() (*GoogleBigQueryObjectDataset, bool) { + return nil, false +} + +// AsEloquaObjectDataset is the BasicDataset implementation for EloquaObjectDataset. +func (eod EloquaObjectDataset) AsEloquaObjectDataset() (*EloquaObjectDataset, bool) { + return &eod, true +} + +// AsDrillTableDataset is the BasicDataset implementation for EloquaObjectDataset. +func (eod EloquaObjectDataset) AsDrillTableDataset() (*DrillTableDataset, bool) { + return nil, false +} + +// AsCouchbaseTableDataset is the BasicDataset implementation for EloquaObjectDataset. +func (eod EloquaObjectDataset) AsCouchbaseTableDataset() (*CouchbaseTableDataset, bool) { + return nil, false +} + +// AsConcurObjectDataset is the BasicDataset implementation for EloquaObjectDataset. +func (eod EloquaObjectDataset) AsConcurObjectDataset() (*ConcurObjectDataset, bool) { + return nil, false +} + +// AsAzurePostgreSQLTableDataset is the BasicDataset implementation for EloquaObjectDataset. +func (eod EloquaObjectDataset) AsAzurePostgreSQLTableDataset() (*AzurePostgreSQLTableDataset, bool) { + return nil, false +} + +// AsAmazonMWSObjectDataset is the BasicDataset implementation for EloquaObjectDataset. +func (eod EloquaObjectDataset) AsAmazonMWSObjectDataset() (*AmazonMWSObjectDataset, bool) { + return nil, false +} + +// AsHTTPDataset is the BasicDataset implementation for EloquaObjectDataset. +func (eod EloquaObjectDataset) AsHTTPDataset() (*HTTPDataset, bool) { + return nil, false +} + +// AsAzureSearchIndexDataset is the BasicDataset implementation for EloquaObjectDataset. +func (eod EloquaObjectDataset) AsAzureSearchIndexDataset() (*AzureSearchIndexDataset, bool) { + return nil, false +} + +// AsWebTableDataset is the BasicDataset implementation for EloquaObjectDataset. +func (eod EloquaObjectDataset) AsWebTableDataset() (*WebTableDataset, bool) { + return nil, false +} + +// AsSQLServerTableDataset is the BasicDataset implementation for EloquaObjectDataset. +func (eod EloquaObjectDataset) AsSQLServerTableDataset() (*SQLServerTableDataset, bool) { + return nil, false +} + +// AsSapEccResourceDataset is the BasicDataset implementation for EloquaObjectDataset. +func (eod EloquaObjectDataset) AsSapEccResourceDataset() (*SapEccResourceDataset, bool) { + return nil, false +} + +// AsSapCloudForCustomerResourceDataset is the BasicDataset implementation for EloquaObjectDataset. +func (eod EloquaObjectDataset) AsSapCloudForCustomerResourceDataset() (*SapCloudForCustomerResourceDataset, bool) { + return nil, false +} + +// AsSalesforceObjectDataset is the BasicDataset implementation for EloquaObjectDataset. +func (eod EloquaObjectDataset) AsSalesforceObjectDataset() (*SalesforceObjectDataset, bool) { + return nil, false +} + +// AsRelationalTableDataset is the BasicDataset implementation for EloquaObjectDataset. +func (eod EloquaObjectDataset) AsRelationalTableDataset() (*RelationalTableDataset, bool) { + return nil, false +} + +// AsAzureMySQLTableDataset is the BasicDataset implementation for EloquaObjectDataset. +func (eod EloquaObjectDataset) AsAzureMySQLTableDataset() (*AzureMySQLTableDataset, bool) { + return nil, false +} + +// AsOracleTableDataset is the BasicDataset implementation for EloquaObjectDataset. +func (eod EloquaObjectDataset) AsOracleTableDataset() (*OracleTableDataset, bool) { + return nil, false +} + +// AsODataResourceDataset is the BasicDataset implementation for EloquaObjectDataset. +func (eod EloquaObjectDataset) AsODataResourceDataset() (*ODataResourceDataset, bool) { + return nil, false +} + +// AsMongoDbCollectionDataset is the BasicDataset implementation for EloquaObjectDataset. +func (eod EloquaObjectDataset) AsMongoDbCollectionDataset() (*MongoDbCollectionDataset, bool) { + return nil, false +} + +// AsFileShareDataset is the BasicDataset implementation for EloquaObjectDataset. +func (eod EloquaObjectDataset) AsFileShareDataset() (*FileShareDataset, bool) { + return nil, false +} + +// AsAzureDataLakeStoreDataset is the BasicDataset implementation for EloquaObjectDataset. +func (eod EloquaObjectDataset) AsAzureDataLakeStoreDataset() (*AzureDataLakeStoreDataset, bool) { + return nil, false +} + +// AsDynamicsEntityDataset is the BasicDataset implementation for EloquaObjectDataset. +func (eod EloquaObjectDataset) AsDynamicsEntityDataset() (*DynamicsEntityDataset, bool) { + return nil, false +} + +// AsDocumentDbCollectionDataset is the BasicDataset implementation for EloquaObjectDataset. +func (eod EloquaObjectDataset) AsDocumentDbCollectionDataset() (*DocumentDbCollectionDataset, bool) { + return nil, false +} + +// AsCustomDataset is the BasicDataset implementation for EloquaObjectDataset. +func (eod EloquaObjectDataset) AsCustomDataset() (*CustomDataset, bool) { + return nil, false +} + +// AsCassandraTableDataset is the BasicDataset implementation for EloquaObjectDataset. +func (eod EloquaObjectDataset) AsCassandraTableDataset() (*CassandraTableDataset, bool) { + return nil, false +} + +// AsAzureSQLDWTableDataset is the BasicDataset implementation for EloquaObjectDataset. +func (eod EloquaObjectDataset) AsAzureSQLDWTableDataset() (*AzureSQLDWTableDataset, bool) { + return nil, false +} + +// AsAzureSQLTableDataset is the BasicDataset implementation for EloquaObjectDataset. +func (eod EloquaObjectDataset) AsAzureSQLTableDataset() (*AzureSQLTableDataset, bool) { + return nil, false +} + +// AsAzureTableDataset is the BasicDataset implementation for EloquaObjectDataset. +func (eod EloquaObjectDataset) AsAzureTableDataset() (*AzureTableDataset, bool) { + return nil, false +} + +// AsAzureBlobDataset is the BasicDataset implementation for EloquaObjectDataset. +func (eod EloquaObjectDataset) AsAzureBlobDataset() (*AzureBlobDataset, bool) { + return nil, false +} + +// AsAmazonS3Dataset is the BasicDataset implementation for EloquaObjectDataset. +func (eod EloquaObjectDataset) AsAmazonS3Dataset() (*AmazonS3Dataset, bool) { + return nil, false +} + +// AsDataset is the BasicDataset implementation for EloquaObjectDataset. +func (eod EloquaObjectDataset) AsDataset() (*Dataset, bool) { + return nil, false +} + +// AsBasicDataset is the BasicDataset implementation for EloquaObjectDataset. +func (eod EloquaObjectDataset) AsBasicDataset() (BasicDataset, bool) { + return &eod, true +} + +// EloquaSource a copy activity Eloqua server source. +type EloquaSource struct { + // Query - A query to retrieve data from source. Type: string (or Expression with resultType string). + Query interface{} `json:"query,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // SourceRetryCount - Source retry count. Type: integer (or Expression with resultType integer). + SourceRetryCount interface{} `json:"sourceRetryCount,omitempty"` + // SourceRetryWait - Source retry wait. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` + // Type - Possible values include: 'TypeCopySource', 'TypeAmazonRedshiftSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeHTTPSource', 'TypeAzureDataLakeStoreSource', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeRelationalSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource' + Type TypeBasicCopySource `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for EloquaSource. +func (es EloquaSource) MarshalJSON() ([]byte, error) { + es.Type = TypeEloquaSource + objectMap := make(map[string]interface{}) + objectMap["query"] = es.Query + objectMap["sourceRetryCount"] = es.SourceRetryCount + objectMap["sourceRetryWait"] = es.SourceRetryWait + if es.Type != "" { + objectMap["type"] = es.Type + } + for k, v := range es.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsAmazonRedshiftSource is the BasicCopySource implementation for EloquaSource. +func (es EloquaSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { + return nil, false +} + +// AsResponsysSource is the BasicCopySource implementation for EloquaSource. +func (es EloquaSource) AsResponsysSource() (*ResponsysSource, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudSource is the BasicCopySource implementation for EloquaSource. +func (es EloquaSource) AsSalesforceMarketingCloudSource() (*SalesforceMarketingCloudSource, bool) { + return nil, false +} + +// AsVerticaSource is the BasicCopySource implementation for EloquaSource. +func (es EloquaSource) AsVerticaSource() (*VerticaSource, bool) { + return nil, false +} + +// AsNetezzaSource is the BasicCopySource implementation for EloquaSource. +func (es EloquaSource) AsNetezzaSource() (*NetezzaSource, bool) { + return nil, false +} + +// AsZohoSource is the BasicCopySource implementation for EloquaSource. +func (es EloquaSource) AsZohoSource() (*ZohoSource, bool) { + return nil, false +} + +// AsXeroSource is the BasicCopySource implementation for EloquaSource. +func (es EloquaSource) AsXeroSource() (*XeroSource, bool) { + return nil, false +} + +// AsSquareSource is the BasicCopySource implementation for EloquaSource. +func (es EloquaSource) AsSquareSource() (*SquareSource, bool) { + return nil, false +} + +// AsSparkSource is the BasicCopySource implementation for EloquaSource. +func (es EloquaSource) AsSparkSource() (*SparkSource, bool) { + return nil, false +} + +// AsShopifySource is the BasicCopySource implementation for EloquaSource. +func (es EloquaSource) AsShopifySource() (*ShopifySource, bool) { + return nil, false +} + +// AsServiceNowSource is the BasicCopySource implementation for EloquaSource. +func (es EloquaSource) AsServiceNowSource() (*ServiceNowSource, bool) { + return nil, false +} + +// AsQuickBooksSource is the BasicCopySource implementation for EloquaSource. +func (es EloquaSource) AsQuickBooksSource() (*QuickBooksSource, bool) { + return nil, false +} + +// AsPrestoSource is the BasicCopySource implementation for EloquaSource. +func (es EloquaSource) AsPrestoSource() (*PrestoSource, bool) { + return nil, false +} + +// AsPhoenixSource is the BasicCopySource implementation for EloquaSource. +func (es EloquaSource) AsPhoenixSource() (*PhoenixSource, bool) { + return nil, false +} + +// AsPaypalSource is the BasicCopySource implementation for EloquaSource. +func (es EloquaSource) AsPaypalSource() (*PaypalSource, bool) { + return nil, false +} + +// AsMarketoSource is the BasicCopySource implementation for EloquaSource. +func (es EloquaSource) AsMarketoSource() (*MarketoSource, bool) { + return nil, false +} + +// AsMariaDBSource is the BasicCopySource implementation for EloquaSource. +func (es EloquaSource) AsMariaDBSource() (*MariaDBSource, bool) { + return nil, false +} + +// AsMagentoSource is the BasicCopySource implementation for EloquaSource. +func (es EloquaSource) AsMagentoSource() (*MagentoSource, bool) { + return nil, false +} + +// AsJiraSource is the BasicCopySource implementation for EloquaSource. +func (es EloquaSource) AsJiraSource() (*JiraSource, bool) { + return nil, false +} + +// AsImpalaSource is the BasicCopySource implementation for EloquaSource. +func (es EloquaSource) AsImpalaSource() (*ImpalaSource, bool) { + return nil, false +} + +// AsHubspotSource is the BasicCopySource implementation for EloquaSource. +func (es EloquaSource) AsHubspotSource() (*HubspotSource, bool) { + return nil, false +} + +// AsHiveSource is the BasicCopySource implementation for EloquaSource. +func (es EloquaSource) AsHiveSource() (*HiveSource, bool) { + return nil, false +} + +// AsHBaseSource is the BasicCopySource implementation for EloquaSource. +func (es EloquaSource) AsHBaseSource() (*HBaseSource, bool) { + return nil, false +} + +// AsGreenplumSource is the BasicCopySource implementation for EloquaSource. +func (es EloquaSource) AsGreenplumSource() (*GreenplumSource, bool) { + return nil, false +} + +// AsGoogleBigQuerySource is the BasicCopySource implementation for EloquaSource. +func (es EloquaSource) AsGoogleBigQuerySource() (*GoogleBigQuerySource, bool) { + return nil, false +} + +// AsEloquaSource is the BasicCopySource implementation for EloquaSource. +func (es EloquaSource) AsEloquaSource() (*EloquaSource, bool) { + return &es, true +} + +// AsDrillSource is the BasicCopySource implementation for EloquaSource. +func (es EloquaSource) AsDrillSource() (*DrillSource, bool) { + return nil, false +} + +// AsCouchbaseSource is the BasicCopySource implementation for EloquaSource. +func (es EloquaSource) AsCouchbaseSource() (*CouchbaseSource, bool) { + return nil, false +} + +// AsConcurSource is the BasicCopySource implementation for EloquaSource. +func (es EloquaSource) AsConcurSource() (*ConcurSource, bool) { + return nil, false +} + +// AsAzurePostgreSQLSource is the BasicCopySource implementation for EloquaSource. +func (es EloquaSource) AsAzurePostgreSQLSource() (*AzurePostgreSQLSource, bool) { + return nil, false +} + +// AsAmazonMWSSource is the BasicCopySource implementation for EloquaSource. +func (es EloquaSource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { + return nil, false +} + +// AsHTTPSource is the BasicCopySource implementation for EloquaSource. +func (es EloquaSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for EloquaSource. +func (es EloquaSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for EloquaSource. +func (es EloquaSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsCassandraSource is the BasicCopySource implementation for EloquaSource. +func (es EloquaSource) AsCassandraSource() (*CassandraSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for EloquaSource. +func (es EloquaSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for EloquaSource. +func (es EloquaSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureMySQLSource is the BasicCopySource implementation for EloquaSource. +func (es EloquaSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for EloquaSource. +func (es EloquaSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for EloquaSource. +func (es EloquaSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsSQLDWSource is the BasicCopySource implementation for EloquaSource. +func (es EloquaSource) AsSQLDWSource() (*SQLDWSource, bool) { + return nil, false +} + +// AsSQLSource is the BasicCopySource implementation for EloquaSource. +func (es EloquaSource) AsSQLSource() (*SQLSource, bool) { + return nil, false +} + +// AsSapEccSource is the BasicCopySource implementation for EloquaSource. +func (es EloquaSource) AsSapEccSource() (*SapEccSource, bool) { + return nil, false +} + +// AsSapCloudForCustomerSource is the BasicCopySource implementation for EloquaSource. +func (es EloquaSource) AsSapCloudForCustomerSource() (*SapCloudForCustomerSource, bool) { + return nil, false +} + +// AsSalesforceSource is the BasicCopySource implementation for EloquaSource. +func (es EloquaSource) AsSalesforceSource() (*SalesforceSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for EloquaSource. +func (es EloquaSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for EloquaSource. +func (es EloquaSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for EloquaSource. +func (es EloquaSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for EloquaSource. +func (es EloquaSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + +// AsAzureTableSource is the BasicCopySource implementation for EloquaSource. +func (es EloquaSource) AsAzureTableSource() (*AzureTableSource, bool) { + return nil, false +} + +// AsCopySource is the BasicCopySource implementation for EloquaSource. +func (es EloquaSource) AsCopySource() (*CopySource, bool) { + return nil, false +} + +// AsBasicCopySource is the BasicCopySource implementation for EloquaSource. +func (es EloquaSource) AsBasicCopySource() (BasicCopySource, bool) { + return &es, true +} + +// ExecutePipelineActivity execute pipeline activity. +type ExecutePipelineActivity struct { + // ExecutePipelineActivityTypeProperties - Execute pipeline activity properties. + *ExecutePipelineActivityTypeProperties `json:"typeProperties,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Name - Activity name. + Name *string `json:"name,omitempty"` + // Description - Activity description. + Description *string `json:"description,omitempty"` + // DependsOn - Activity depends on condition. + DependsOn *[]ActivityDependency `json:"dependsOn,omitempty"` + // UserProperties - Activity user properties. + UserProperties map[string]*string `json:"userProperties"` + // Type - Possible values include: 'TypeActivity', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLUpdateResource', 'TypeAzureMLBatchExecution', 'TypeGetMetadata', 'TypeWebActivity', 'TypeLookup', 'TypeSQLServerStoredProcedure', 'TypeCustom', 'TypeExecuteSSISPackage', 'TypeHDInsightSpark', 'TypeHDInsightStreaming', 'TypeHDInsightMapReduce', 'TypeHDInsightPig', 'TypeHDInsightHive', 'TypeCopy', 'TypeExecution', 'TypeFilter', 'TypeUntil', 'TypeWait', 'TypeForEach', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' + Type TypeBasicActivity `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ExecutePipelineActivity. +func (epa ExecutePipelineActivity) MarshalJSON() ([]byte, error) { + epa.Type = TypeExecutePipeline + objectMap := make(map[string]interface{}) + if epa.ExecutePipelineActivityTypeProperties != nil { + objectMap["typeProperties"] = epa.ExecutePipelineActivityTypeProperties + } + if epa.Name != nil { + objectMap["name"] = epa.Name + } + if epa.Description != nil { + objectMap["description"] = epa.Description + } + if epa.DependsOn != nil { + objectMap["dependsOn"] = epa.DependsOn + } + if epa.UserProperties != nil { + objectMap["userProperties"] = epa.UserProperties + } + if epa.Type != "" { + objectMap["type"] = epa.Type + } + for k, v := range epa.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsDatabricksNotebookActivity is the BasicActivity implementation for ExecutePipelineActivity. +func (epa ExecutePipelineActivity) AsDatabricksNotebookActivity() (*DatabricksNotebookActivity, bool) { + return nil, false +} + +// AsDataLakeAnalyticsUSQLActivity is the BasicActivity implementation for ExecutePipelineActivity. +func (epa ExecutePipelineActivity) AsDataLakeAnalyticsUSQLActivity() (*DataLakeAnalyticsUSQLActivity, bool) { + return nil, false +} + +// AsAzureMLUpdateResourceActivity is the BasicActivity implementation for ExecutePipelineActivity. +func (epa ExecutePipelineActivity) AsAzureMLUpdateResourceActivity() (*AzureMLUpdateResourceActivity, bool) { + return nil, false +} + +// AsAzureMLBatchExecutionActivity is the BasicActivity implementation for ExecutePipelineActivity. +func (epa ExecutePipelineActivity) AsAzureMLBatchExecutionActivity() (*AzureMLBatchExecutionActivity, bool) { + return nil, false +} + +// AsGetMetadataActivity is the BasicActivity implementation for ExecutePipelineActivity. +func (epa ExecutePipelineActivity) AsGetMetadataActivity() (*GetMetadataActivity, bool) { + return nil, false +} + +// AsWebActivity is the BasicActivity implementation for ExecutePipelineActivity. +func (epa ExecutePipelineActivity) AsWebActivity() (*WebActivity, bool) { + return nil, false +} + +// AsLookupActivity is the BasicActivity implementation for ExecutePipelineActivity. +func (epa ExecutePipelineActivity) AsLookupActivity() (*LookupActivity, bool) { + return nil, false +} + +// AsSQLServerStoredProcedureActivity is the BasicActivity implementation for ExecutePipelineActivity. +func (epa ExecutePipelineActivity) AsSQLServerStoredProcedureActivity() (*SQLServerStoredProcedureActivity, bool) { + return nil, false +} + +// AsCustomActivity is the BasicActivity implementation for ExecutePipelineActivity. +func (epa ExecutePipelineActivity) AsCustomActivity() (*CustomActivity, bool) { + return nil, false +} + +// AsExecuteSSISPackageActivity is the BasicActivity implementation for ExecutePipelineActivity. +func (epa ExecutePipelineActivity) AsExecuteSSISPackageActivity() (*ExecuteSSISPackageActivity, bool) { + return nil, false +} + +// AsHDInsightSparkActivity is the BasicActivity implementation for ExecutePipelineActivity. +func (epa ExecutePipelineActivity) AsHDInsightSparkActivity() (*HDInsightSparkActivity, bool) { + return nil, false +} + +// AsHDInsightStreamingActivity is the BasicActivity implementation for ExecutePipelineActivity. +func (epa ExecutePipelineActivity) AsHDInsightStreamingActivity() (*HDInsightStreamingActivity, bool) { + return nil, false +} + +// AsHDInsightMapReduceActivity is the BasicActivity implementation for ExecutePipelineActivity. +func (epa ExecutePipelineActivity) AsHDInsightMapReduceActivity() (*HDInsightMapReduceActivity, bool) { + return nil, false +} + +// AsHDInsightPigActivity is the BasicActivity implementation for ExecutePipelineActivity. +func (epa ExecutePipelineActivity) AsHDInsightPigActivity() (*HDInsightPigActivity, bool) { + return nil, false +} + +// AsHDInsightHiveActivity is the BasicActivity implementation for ExecutePipelineActivity. +func (epa ExecutePipelineActivity) AsHDInsightHiveActivity() (*HDInsightHiveActivity, bool) { + return nil, false +} + +// AsCopyActivity is the BasicActivity implementation for ExecutePipelineActivity. +func (epa ExecutePipelineActivity) AsCopyActivity() (*CopyActivity, bool) { + return nil, false +} + +// AsExecutionActivity is the BasicActivity implementation for ExecutePipelineActivity. +func (epa ExecutePipelineActivity) AsExecutionActivity() (*ExecutionActivity, bool) { + return nil, false +} + +// AsBasicExecutionActivity is the BasicActivity implementation for ExecutePipelineActivity. +func (epa ExecutePipelineActivity) AsBasicExecutionActivity() (BasicExecutionActivity, bool) { + return nil, false +} + +// AsFilterActivity is the BasicActivity implementation for ExecutePipelineActivity. +func (epa ExecutePipelineActivity) AsFilterActivity() (*FilterActivity, bool) { + return nil, false +} + +// AsUntilActivity is the BasicActivity implementation for ExecutePipelineActivity. +func (epa ExecutePipelineActivity) AsUntilActivity() (*UntilActivity, bool) { + return nil, false +} + +// AsWaitActivity is the BasicActivity implementation for ExecutePipelineActivity. +func (epa ExecutePipelineActivity) AsWaitActivity() (*WaitActivity, bool) { + return nil, false +} + +// AsForEachActivity is the BasicActivity implementation for ExecutePipelineActivity. +func (epa ExecutePipelineActivity) AsForEachActivity() (*ForEachActivity, bool) { + return nil, false +} + +// AsIfConditionActivity is the BasicActivity implementation for ExecutePipelineActivity. +func (epa ExecutePipelineActivity) AsIfConditionActivity() (*IfConditionActivity, bool) { + return nil, false +} + +// AsExecutePipelineActivity is the BasicActivity implementation for ExecutePipelineActivity. +func (epa ExecutePipelineActivity) AsExecutePipelineActivity() (*ExecutePipelineActivity, bool) { + return &epa, true +} + +// AsControlActivity is the BasicActivity implementation for ExecutePipelineActivity. +func (epa ExecutePipelineActivity) AsControlActivity() (*ControlActivity, bool) { + return nil, false +} + +// AsBasicControlActivity is the BasicActivity implementation for ExecutePipelineActivity. +func (epa ExecutePipelineActivity) AsBasicControlActivity() (BasicControlActivity, bool) { + return &epa, true +} + +// AsActivity is the BasicActivity implementation for ExecutePipelineActivity. +func (epa ExecutePipelineActivity) AsActivity() (*Activity, bool) { + return nil, false +} + +// AsBasicActivity is the BasicActivity implementation for ExecutePipelineActivity. +func (epa ExecutePipelineActivity) AsBasicActivity() (BasicActivity, bool) { + return &epa, true +} + +// UnmarshalJSON is the custom unmarshaler for ExecutePipelineActivity struct. +func (epa *ExecutePipelineActivity) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "typeProperties": + if v != nil { + var executePipelineActivityTypeProperties ExecutePipelineActivityTypeProperties + err = json.Unmarshal(*v, &executePipelineActivityTypeProperties) + if err != nil { + return err + } + epa.ExecutePipelineActivityTypeProperties = &executePipelineActivityTypeProperties + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if epa.AdditionalProperties == nil { + epa.AdditionalProperties = make(map[string]interface{}) + } + epa.AdditionalProperties[k] = additionalProperties + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + epa.Name = &name + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + epa.Description = &description + } + case "dependsOn": + if v != nil { + var dependsOn []ActivityDependency + err = json.Unmarshal(*v, &dependsOn) + if err != nil { + return err + } + epa.DependsOn = &dependsOn + } + case "userProperties": + if v != nil { + var userProperties map[string]*string + err = json.Unmarshal(*v, &userProperties) + if err != nil { + return err + } + epa.UserProperties = userProperties + } + case "type": + if v != nil { + var typeVar TypeBasicActivity + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + epa.Type = typeVar + } + } + } + + return nil +} + +// ExecutePipelineActivityTypeProperties execute pipeline activity properties. +type ExecutePipelineActivityTypeProperties struct { + // Pipeline - Pipeline reference. + Pipeline *PipelineReference `json:"pipeline,omitempty"` + // Parameters - Pipeline parameters. + Parameters map[string]interface{} `json:"parameters"` + // WaitOnCompletion - Defines whether activity execution will wait for the dependent pipeline execution to finish. Default is false. + WaitOnCompletion *bool `json:"waitOnCompletion,omitempty"` +} + +// MarshalJSON is the custom marshaler for ExecutePipelineActivityTypeProperties. +func (epatp ExecutePipelineActivityTypeProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if epatp.Pipeline != nil { + objectMap["pipeline"] = epatp.Pipeline + } + if epatp.Parameters != nil { + objectMap["parameters"] = epatp.Parameters + } + if epatp.WaitOnCompletion != nil { + objectMap["waitOnCompletion"] = epatp.WaitOnCompletion + } + return json.Marshal(objectMap) +} + +// ExecuteSSISPackageActivity execute SSIS package activity. +type ExecuteSSISPackageActivity struct { + // ExecuteSSISPackageActivityTypeProperties - Execute SSIS package activity properties. + *ExecuteSSISPackageActivityTypeProperties `json:"typeProperties,omitempty"` + // LinkedServiceName - Linked service reference. + LinkedServiceName *LinkedServiceReference `json:"linkedServiceName,omitempty"` + // Policy - Activity policy. + Policy *ActivityPolicy `json:"policy,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Name - Activity name. + Name *string `json:"name,omitempty"` + // Description - Activity description. + Description *string `json:"description,omitempty"` + // DependsOn - Activity depends on condition. + DependsOn *[]ActivityDependency `json:"dependsOn,omitempty"` + // UserProperties - Activity user properties. + UserProperties map[string]*string `json:"userProperties"` + // Type - Possible values include: 'TypeActivity', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLUpdateResource', 'TypeAzureMLBatchExecution', 'TypeGetMetadata', 'TypeWebActivity', 'TypeLookup', 'TypeSQLServerStoredProcedure', 'TypeCustom', 'TypeExecuteSSISPackage', 'TypeHDInsightSpark', 'TypeHDInsightStreaming', 'TypeHDInsightMapReduce', 'TypeHDInsightPig', 'TypeHDInsightHive', 'TypeCopy', 'TypeExecution', 'TypeFilter', 'TypeUntil', 'TypeWait', 'TypeForEach', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' + Type TypeBasicActivity `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ExecuteSSISPackageActivity. +func (espa ExecuteSSISPackageActivity) MarshalJSON() ([]byte, error) { + espa.Type = TypeExecuteSSISPackage + objectMap := make(map[string]interface{}) + if espa.ExecuteSSISPackageActivityTypeProperties != nil { + objectMap["typeProperties"] = espa.ExecuteSSISPackageActivityTypeProperties + } + if espa.LinkedServiceName != nil { + objectMap["linkedServiceName"] = espa.LinkedServiceName + } + if espa.Policy != nil { + objectMap["policy"] = espa.Policy + } + if espa.Name != nil { + objectMap["name"] = espa.Name + } + if espa.Description != nil { + objectMap["description"] = espa.Description + } + if espa.DependsOn != nil { + objectMap["dependsOn"] = espa.DependsOn + } + if espa.UserProperties != nil { + objectMap["userProperties"] = espa.UserProperties + } + if espa.Type != "" { + objectMap["type"] = espa.Type + } + for k, v := range espa.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsDatabricksNotebookActivity is the BasicActivity implementation for ExecuteSSISPackageActivity. +func (espa ExecuteSSISPackageActivity) AsDatabricksNotebookActivity() (*DatabricksNotebookActivity, bool) { + return nil, false +} + +// AsDataLakeAnalyticsUSQLActivity is the BasicActivity implementation for ExecuteSSISPackageActivity. +func (espa ExecuteSSISPackageActivity) AsDataLakeAnalyticsUSQLActivity() (*DataLakeAnalyticsUSQLActivity, bool) { + return nil, false +} + +// AsAzureMLUpdateResourceActivity is the BasicActivity implementation for ExecuteSSISPackageActivity. +func (espa ExecuteSSISPackageActivity) AsAzureMLUpdateResourceActivity() (*AzureMLUpdateResourceActivity, bool) { + return nil, false +} + +// AsAzureMLBatchExecutionActivity is the BasicActivity implementation for ExecuteSSISPackageActivity. +func (espa ExecuteSSISPackageActivity) AsAzureMLBatchExecutionActivity() (*AzureMLBatchExecutionActivity, bool) { + return nil, false +} + +// AsGetMetadataActivity is the BasicActivity implementation for ExecuteSSISPackageActivity. +func (espa ExecuteSSISPackageActivity) AsGetMetadataActivity() (*GetMetadataActivity, bool) { + return nil, false +} + +// AsWebActivity is the BasicActivity implementation for ExecuteSSISPackageActivity. +func (espa ExecuteSSISPackageActivity) AsWebActivity() (*WebActivity, bool) { + return nil, false +} + +// AsLookupActivity is the BasicActivity implementation for ExecuteSSISPackageActivity. +func (espa ExecuteSSISPackageActivity) AsLookupActivity() (*LookupActivity, bool) { + return nil, false +} + +// AsSQLServerStoredProcedureActivity is the BasicActivity implementation for ExecuteSSISPackageActivity. +func (espa ExecuteSSISPackageActivity) AsSQLServerStoredProcedureActivity() (*SQLServerStoredProcedureActivity, bool) { + return nil, false +} + +// AsCustomActivity is the BasicActivity implementation for ExecuteSSISPackageActivity. +func (espa ExecuteSSISPackageActivity) AsCustomActivity() (*CustomActivity, bool) { + return nil, false +} + +// AsExecuteSSISPackageActivity is the BasicActivity implementation for ExecuteSSISPackageActivity. +func (espa ExecuteSSISPackageActivity) AsExecuteSSISPackageActivity() (*ExecuteSSISPackageActivity, bool) { + return &espa, true +} + +// AsHDInsightSparkActivity is the BasicActivity implementation for ExecuteSSISPackageActivity. +func (espa ExecuteSSISPackageActivity) AsHDInsightSparkActivity() (*HDInsightSparkActivity, bool) { + return nil, false +} + +// AsHDInsightStreamingActivity is the BasicActivity implementation for ExecuteSSISPackageActivity. +func (espa ExecuteSSISPackageActivity) AsHDInsightStreamingActivity() (*HDInsightStreamingActivity, bool) { + return nil, false +} + +// AsHDInsightMapReduceActivity is the BasicActivity implementation for ExecuteSSISPackageActivity. +func (espa ExecuteSSISPackageActivity) AsHDInsightMapReduceActivity() (*HDInsightMapReduceActivity, bool) { + return nil, false +} + +// AsHDInsightPigActivity is the BasicActivity implementation for ExecuteSSISPackageActivity. +func (espa ExecuteSSISPackageActivity) AsHDInsightPigActivity() (*HDInsightPigActivity, bool) { + return nil, false +} + +// AsHDInsightHiveActivity is the BasicActivity implementation for ExecuteSSISPackageActivity. +func (espa ExecuteSSISPackageActivity) AsHDInsightHiveActivity() (*HDInsightHiveActivity, bool) { + return nil, false +} + +// AsCopyActivity is the BasicActivity implementation for ExecuteSSISPackageActivity. +func (espa ExecuteSSISPackageActivity) AsCopyActivity() (*CopyActivity, bool) { + return nil, false +} + +// AsExecutionActivity is the BasicActivity implementation for ExecuteSSISPackageActivity. +func (espa ExecuteSSISPackageActivity) AsExecutionActivity() (*ExecutionActivity, bool) { + return nil, false +} + +// AsBasicExecutionActivity is the BasicActivity implementation for ExecuteSSISPackageActivity. +func (espa ExecuteSSISPackageActivity) AsBasicExecutionActivity() (BasicExecutionActivity, bool) { + return &espa, true +} + +// AsFilterActivity is the BasicActivity implementation for ExecuteSSISPackageActivity. +func (espa ExecuteSSISPackageActivity) AsFilterActivity() (*FilterActivity, bool) { + return nil, false +} + +// AsUntilActivity is the BasicActivity implementation for ExecuteSSISPackageActivity. +func (espa ExecuteSSISPackageActivity) AsUntilActivity() (*UntilActivity, bool) { + return nil, false +} + +// AsWaitActivity is the BasicActivity implementation for ExecuteSSISPackageActivity. +func (espa ExecuteSSISPackageActivity) AsWaitActivity() (*WaitActivity, bool) { + return nil, false +} + +// AsForEachActivity is the BasicActivity implementation for ExecuteSSISPackageActivity. +func (espa ExecuteSSISPackageActivity) AsForEachActivity() (*ForEachActivity, bool) { + return nil, false +} + +// AsIfConditionActivity is the BasicActivity implementation for ExecuteSSISPackageActivity. +func (espa ExecuteSSISPackageActivity) AsIfConditionActivity() (*IfConditionActivity, bool) { + return nil, false +} + +// AsExecutePipelineActivity is the BasicActivity implementation for ExecuteSSISPackageActivity. +func (espa ExecuteSSISPackageActivity) AsExecutePipelineActivity() (*ExecutePipelineActivity, bool) { + return nil, false +} + +// AsControlActivity is the BasicActivity implementation for ExecuteSSISPackageActivity. +func (espa ExecuteSSISPackageActivity) AsControlActivity() (*ControlActivity, bool) { + return nil, false +} + +// AsBasicControlActivity is the BasicActivity implementation for ExecuteSSISPackageActivity. +func (espa ExecuteSSISPackageActivity) AsBasicControlActivity() (BasicControlActivity, bool) { + return nil, false +} + +// AsActivity is the BasicActivity implementation for ExecuteSSISPackageActivity. +func (espa ExecuteSSISPackageActivity) AsActivity() (*Activity, bool) { + return nil, false +} + +// AsBasicActivity is the BasicActivity implementation for ExecuteSSISPackageActivity. +func (espa ExecuteSSISPackageActivity) AsBasicActivity() (BasicActivity, bool) { + return &espa, true +} + +// UnmarshalJSON is the custom unmarshaler for ExecuteSSISPackageActivity struct. +func (espa *ExecuteSSISPackageActivity) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "typeProperties": + if v != nil { + var executeSSISPackageActivityTypeProperties ExecuteSSISPackageActivityTypeProperties + err = json.Unmarshal(*v, &executeSSISPackageActivityTypeProperties) + if err != nil { + return err + } + espa.ExecuteSSISPackageActivityTypeProperties = &executeSSISPackageActivityTypeProperties + } + case "linkedServiceName": + if v != nil { + var linkedServiceName LinkedServiceReference + err = json.Unmarshal(*v, &linkedServiceName) + if err != nil { + return err + } + espa.LinkedServiceName = &linkedServiceName + } + case "policy": + if v != nil { + var policy ActivityPolicy + err = json.Unmarshal(*v, &policy) + if err != nil { + return err + } + espa.Policy = &policy + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if espa.AdditionalProperties == nil { + espa.AdditionalProperties = make(map[string]interface{}) + } + espa.AdditionalProperties[k] = additionalProperties + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + espa.Name = &name + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + espa.Description = &description + } + case "dependsOn": + if v != nil { + var dependsOn []ActivityDependency + err = json.Unmarshal(*v, &dependsOn) + if err != nil { + return err + } + espa.DependsOn = &dependsOn + } + case "userProperties": + if v != nil { + var userProperties map[string]*string + err = json.Unmarshal(*v, &userProperties) + if err != nil { + return err + } + espa.UserProperties = userProperties + } + case "type": + if v != nil { + var typeVar TypeBasicActivity + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + espa.Type = typeVar + } + } + } + + return nil +} + +// ExecuteSSISPackageActivityTypeProperties execute SSIS package activity properties. +type ExecuteSSISPackageActivityTypeProperties struct { + // PackageLocation - SSIS package location. + PackageLocation *SSISPackageLocation `json:"packageLocation,omitempty"` + // Runtime - Specifies the runtime to execute SSIS package. Possible values include: 'X64', 'X86' + Runtime SSISExecutionRuntime `json:"runtime,omitempty"` + // LoggingLevel - The logging level of SSIS package execution. + LoggingLevel *string `json:"loggingLevel,omitempty"` + // EnvironmentPath - The environment path to execute the SSIS package. + EnvironmentPath *string `json:"environmentPath,omitempty"` + // ConnectVia - The integration runtime reference. + ConnectVia *IntegrationRuntimeReference `json:"connectVia,omitempty"` + // ProjectParameters - The project level parameters to execute the SSIS package. + ProjectParameters map[string]*SSISExecutionParameter `json:"projectParameters"` + // PackageParameters - The package level parameters to execute the SSIS package. + PackageParameters map[string]*SSISExecutionParameter `json:"packageParameters"` + // ProjectConnectionManagers - The project level connection managers to execute the SSIS package. + ProjectConnectionManagers map[string]map[string]*SSISExecutionParameter `json:"projectConnectionManagers"` + // PackageConnectionManagers - The package level connection managers to execute the SSIS package. + PackageConnectionManagers map[string]map[string]*SSISExecutionParameter `json:"packageConnectionManagers"` + // PropertyOverrides - The property overrides to execute the SSIS package. + PropertyOverrides map[string]*SSISPropertyOverride `json:"propertyOverrides"` +} + +// MarshalJSON is the custom marshaler for ExecuteSSISPackageActivityTypeProperties. +func (espatp ExecuteSSISPackageActivityTypeProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if espatp.PackageLocation != nil { + objectMap["packageLocation"] = espatp.PackageLocation + } + if espatp.Runtime != "" { + objectMap["runtime"] = espatp.Runtime + } + if espatp.LoggingLevel != nil { + objectMap["loggingLevel"] = espatp.LoggingLevel + } + if espatp.EnvironmentPath != nil { + objectMap["environmentPath"] = espatp.EnvironmentPath + } + if espatp.ConnectVia != nil { + objectMap["connectVia"] = espatp.ConnectVia + } + if espatp.ProjectParameters != nil { + objectMap["projectParameters"] = espatp.ProjectParameters + } + if espatp.PackageParameters != nil { + objectMap["packageParameters"] = espatp.PackageParameters + } + if espatp.ProjectConnectionManagers != nil { + objectMap["projectConnectionManagers"] = espatp.ProjectConnectionManagers + } + if espatp.PackageConnectionManagers != nil { + objectMap["packageConnectionManagers"] = espatp.PackageConnectionManagers + } + if espatp.PropertyOverrides != nil { + objectMap["propertyOverrides"] = espatp.PropertyOverrides + } + return json.Marshal(objectMap) +} + +// BasicExecutionActivity base class for all execution activities. +type BasicExecutionActivity interface { + AsDatabricksNotebookActivity() (*DatabricksNotebookActivity, bool) + AsDataLakeAnalyticsUSQLActivity() (*DataLakeAnalyticsUSQLActivity, bool) + AsAzureMLUpdateResourceActivity() (*AzureMLUpdateResourceActivity, bool) + AsAzureMLBatchExecutionActivity() (*AzureMLBatchExecutionActivity, bool) + AsGetMetadataActivity() (*GetMetadataActivity, bool) + AsWebActivity() (*WebActivity, bool) + AsLookupActivity() (*LookupActivity, bool) + AsSQLServerStoredProcedureActivity() (*SQLServerStoredProcedureActivity, bool) + AsCustomActivity() (*CustomActivity, bool) + AsExecuteSSISPackageActivity() (*ExecuteSSISPackageActivity, bool) + AsHDInsightSparkActivity() (*HDInsightSparkActivity, bool) + AsHDInsightStreamingActivity() (*HDInsightStreamingActivity, bool) + AsHDInsightMapReduceActivity() (*HDInsightMapReduceActivity, bool) + AsHDInsightPigActivity() (*HDInsightPigActivity, bool) + AsHDInsightHiveActivity() (*HDInsightHiveActivity, bool) + AsCopyActivity() (*CopyActivity, bool) + AsExecutionActivity() (*ExecutionActivity, bool) +} + +// ExecutionActivity base class for all execution activities. +type ExecutionActivity struct { + // LinkedServiceName - Linked service reference. + LinkedServiceName *LinkedServiceReference `json:"linkedServiceName,omitempty"` + // Policy - Activity policy. + Policy *ActivityPolicy `json:"policy,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Name - Activity name. + Name *string `json:"name,omitempty"` + // Description - Activity description. + Description *string `json:"description,omitempty"` + // DependsOn - Activity depends on condition. + DependsOn *[]ActivityDependency `json:"dependsOn,omitempty"` + // UserProperties - Activity user properties. + UserProperties map[string]*string `json:"userProperties"` + // Type - Possible values include: 'TypeActivity', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLUpdateResource', 'TypeAzureMLBatchExecution', 'TypeGetMetadata', 'TypeWebActivity', 'TypeLookup', 'TypeSQLServerStoredProcedure', 'TypeCustom', 'TypeExecuteSSISPackage', 'TypeHDInsightSpark', 'TypeHDInsightStreaming', 'TypeHDInsightMapReduce', 'TypeHDInsightPig', 'TypeHDInsightHive', 'TypeCopy', 'TypeExecution', 'TypeFilter', 'TypeUntil', 'TypeWait', 'TypeForEach', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' + Type TypeBasicActivity `json:"type,omitempty"` +} + +func unmarshalBasicExecutionActivity(body []byte) (BasicExecutionActivity, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["type"] { + case string(TypeDatabricksNotebook): + var dna DatabricksNotebookActivity + err := json.Unmarshal(body, &dna) + return dna, err + case string(TypeDataLakeAnalyticsUSQL): + var dlaua DataLakeAnalyticsUSQLActivity + err := json.Unmarshal(body, &dlaua) + return dlaua, err + case string(TypeAzureMLUpdateResource): + var amura AzureMLUpdateResourceActivity + err := json.Unmarshal(body, &amura) + return amura, err + case string(TypeAzureMLBatchExecution): + var ambea AzureMLBatchExecutionActivity + err := json.Unmarshal(body, &ambea) + return ambea, err + case string(TypeGetMetadata): + var gma GetMetadataActivity + err := json.Unmarshal(body, &gma) + return gma, err + case string(TypeWebActivity): + var wa WebActivity + err := json.Unmarshal(body, &wa) + return wa, err + case string(TypeLookup): + var la LookupActivity + err := json.Unmarshal(body, &la) + return la, err + case string(TypeSQLServerStoredProcedure): + var ssspa SQLServerStoredProcedureActivity + err := json.Unmarshal(body, &ssspa) + return ssspa, err + case string(TypeCustom): + var ca CustomActivity + err := json.Unmarshal(body, &ca) + return ca, err + case string(TypeExecuteSSISPackage): + var espa ExecuteSSISPackageActivity + err := json.Unmarshal(body, &espa) + return espa, err + case string(TypeHDInsightSpark): + var hisa HDInsightSparkActivity + err := json.Unmarshal(body, &hisa) + return hisa, err + case string(TypeHDInsightStreaming): + var hisa HDInsightStreamingActivity + err := json.Unmarshal(body, &hisa) + return hisa, err + case string(TypeHDInsightMapReduce): + var himra HDInsightMapReduceActivity + err := json.Unmarshal(body, &himra) + return himra, err + case string(TypeHDInsightPig): + var hipa HDInsightPigActivity + err := json.Unmarshal(body, &hipa) + return hipa, err + case string(TypeHDInsightHive): + var hiha HDInsightHiveActivity + err := json.Unmarshal(body, &hiha) + return hiha, err + case string(TypeCopy): + var ca CopyActivity + err := json.Unmarshal(body, &ca) + return ca, err + default: + var ea ExecutionActivity + err := json.Unmarshal(body, &ea) + return ea, err + } +} +func unmarshalBasicExecutionActivityArray(body []byte) ([]BasicExecutionActivity, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + eaArray := make([]BasicExecutionActivity, len(rawMessages)) + + for index, rawMessage := range rawMessages { + ea, err := unmarshalBasicExecutionActivity(*rawMessage) + if err != nil { + return nil, err + } + eaArray[index] = ea + } + return eaArray, nil +} + +// MarshalJSON is the custom marshaler for ExecutionActivity. +func (ea ExecutionActivity) MarshalJSON() ([]byte, error) { + ea.Type = TypeExecution + objectMap := make(map[string]interface{}) + if ea.LinkedServiceName != nil { + objectMap["linkedServiceName"] = ea.LinkedServiceName + } + if ea.Policy != nil { + objectMap["policy"] = ea.Policy + } + if ea.Name != nil { + objectMap["name"] = ea.Name + } + if ea.Description != nil { + objectMap["description"] = ea.Description + } + if ea.DependsOn != nil { + objectMap["dependsOn"] = ea.DependsOn + } + if ea.UserProperties != nil { + objectMap["userProperties"] = ea.UserProperties + } + if ea.Type != "" { + objectMap["type"] = ea.Type + } + for k, v := range ea.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsDatabricksNotebookActivity is the BasicActivity implementation for ExecutionActivity. +func (ea ExecutionActivity) AsDatabricksNotebookActivity() (*DatabricksNotebookActivity, bool) { + return nil, false +} + +// AsDataLakeAnalyticsUSQLActivity is the BasicActivity implementation for ExecutionActivity. +func (ea ExecutionActivity) AsDataLakeAnalyticsUSQLActivity() (*DataLakeAnalyticsUSQLActivity, bool) { + return nil, false +} + +// AsAzureMLUpdateResourceActivity is the BasicActivity implementation for ExecutionActivity. +func (ea ExecutionActivity) AsAzureMLUpdateResourceActivity() (*AzureMLUpdateResourceActivity, bool) { + return nil, false +} + +// AsAzureMLBatchExecutionActivity is the BasicActivity implementation for ExecutionActivity. +func (ea ExecutionActivity) AsAzureMLBatchExecutionActivity() (*AzureMLBatchExecutionActivity, bool) { + return nil, false +} + +// AsGetMetadataActivity is the BasicActivity implementation for ExecutionActivity. +func (ea ExecutionActivity) AsGetMetadataActivity() (*GetMetadataActivity, bool) { + return nil, false +} + +// AsWebActivity is the BasicActivity implementation for ExecutionActivity. +func (ea ExecutionActivity) AsWebActivity() (*WebActivity, bool) { + return nil, false +} + +// AsLookupActivity is the BasicActivity implementation for ExecutionActivity. +func (ea ExecutionActivity) AsLookupActivity() (*LookupActivity, bool) { + return nil, false +} + +// AsSQLServerStoredProcedureActivity is the BasicActivity implementation for ExecutionActivity. +func (ea ExecutionActivity) AsSQLServerStoredProcedureActivity() (*SQLServerStoredProcedureActivity, bool) { + return nil, false +} + +// AsCustomActivity is the BasicActivity implementation for ExecutionActivity. +func (ea ExecutionActivity) AsCustomActivity() (*CustomActivity, bool) { + return nil, false +} + +// AsExecuteSSISPackageActivity is the BasicActivity implementation for ExecutionActivity. +func (ea ExecutionActivity) AsExecuteSSISPackageActivity() (*ExecuteSSISPackageActivity, bool) { + return nil, false +} + +// AsHDInsightSparkActivity is the BasicActivity implementation for ExecutionActivity. +func (ea ExecutionActivity) AsHDInsightSparkActivity() (*HDInsightSparkActivity, bool) { + return nil, false +} + +// AsHDInsightStreamingActivity is the BasicActivity implementation for ExecutionActivity. +func (ea ExecutionActivity) AsHDInsightStreamingActivity() (*HDInsightStreamingActivity, bool) { + return nil, false +} + +// AsHDInsightMapReduceActivity is the BasicActivity implementation for ExecutionActivity. +func (ea ExecutionActivity) AsHDInsightMapReduceActivity() (*HDInsightMapReduceActivity, bool) { + return nil, false +} + +// AsHDInsightPigActivity is the BasicActivity implementation for ExecutionActivity. +func (ea ExecutionActivity) AsHDInsightPigActivity() (*HDInsightPigActivity, bool) { + return nil, false +} + +// AsHDInsightHiveActivity is the BasicActivity implementation for ExecutionActivity. +func (ea ExecutionActivity) AsHDInsightHiveActivity() (*HDInsightHiveActivity, bool) { + return nil, false +} + +// AsCopyActivity is the BasicActivity implementation for ExecutionActivity. +func (ea ExecutionActivity) AsCopyActivity() (*CopyActivity, bool) { + return nil, false +} + +// AsExecutionActivity is the BasicActivity implementation for ExecutionActivity. +func (ea ExecutionActivity) AsExecutionActivity() (*ExecutionActivity, bool) { + return &ea, true +} + +// AsBasicExecutionActivity is the BasicActivity implementation for ExecutionActivity. +func (ea ExecutionActivity) AsBasicExecutionActivity() (BasicExecutionActivity, bool) { + return &ea, true +} + +// AsFilterActivity is the BasicActivity implementation for ExecutionActivity. +func (ea ExecutionActivity) AsFilterActivity() (*FilterActivity, bool) { + return nil, false +} + +// AsUntilActivity is the BasicActivity implementation for ExecutionActivity. +func (ea ExecutionActivity) AsUntilActivity() (*UntilActivity, bool) { + return nil, false +} + +// AsWaitActivity is the BasicActivity implementation for ExecutionActivity. +func (ea ExecutionActivity) AsWaitActivity() (*WaitActivity, bool) { + return nil, false +} + +// AsForEachActivity is the BasicActivity implementation for ExecutionActivity. +func (ea ExecutionActivity) AsForEachActivity() (*ForEachActivity, bool) { + return nil, false +} + +// AsIfConditionActivity is the BasicActivity implementation for ExecutionActivity. +func (ea ExecutionActivity) AsIfConditionActivity() (*IfConditionActivity, bool) { + return nil, false +} + +// AsExecutePipelineActivity is the BasicActivity implementation for ExecutionActivity. +func (ea ExecutionActivity) AsExecutePipelineActivity() (*ExecutePipelineActivity, bool) { + return nil, false +} + +// AsControlActivity is the BasicActivity implementation for ExecutionActivity. +func (ea ExecutionActivity) AsControlActivity() (*ControlActivity, bool) { + return nil, false +} + +// AsBasicControlActivity is the BasicActivity implementation for ExecutionActivity. +func (ea ExecutionActivity) AsBasicControlActivity() (BasicControlActivity, bool) { + return nil, false +} + +// AsActivity is the BasicActivity implementation for ExecutionActivity. +func (ea ExecutionActivity) AsActivity() (*Activity, bool) { + return nil, false +} + +// AsBasicActivity is the BasicActivity implementation for ExecutionActivity. +func (ea ExecutionActivity) AsBasicActivity() (BasicActivity, bool) { + return &ea, true +} + +// Expression azure Data Factory expression definition. +type Expression struct { + // Type - Expression type. + Type *string `json:"type,omitempty"` + // Value - Expression value. + Value *string `json:"value,omitempty"` +} + +// Factory factory resource type. +type Factory struct { + autorest.Response `json:"-"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Identity - Managed service identity of the factory. + Identity *FactoryIdentity `json:"identity,omitempty"` + // FactoryProperties - Properties of the factory. + *FactoryProperties `json:"properties,omitempty"` + // ID - The resource identifier. + ID *string `json:"id,omitempty"` + // Name - The resource name. + Name *string `json:"name,omitempty"` + // Type - The resource type. + Type *string `json:"type,omitempty"` + // Location - The resource location. + Location *string `json:"location,omitempty"` + // Tags - The resource tags. + Tags map[string]*string `json:"tags"` + // ETag - Etag identifies change in the resource. + ETag *string `json:"eTag,omitempty"` +} + +// MarshalJSON is the custom marshaler for Factory. +func (f Factory) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if f.Identity != nil { + objectMap["identity"] = f.Identity + } + if f.FactoryProperties != nil { + objectMap["properties"] = f.FactoryProperties + } + if f.ID != nil { + objectMap["id"] = f.ID + } + if f.Name != nil { + objectMap["name"] = f.Name + } + if f.Type != nil { + objectMap["type"] = f.Type + } + if f.Location != nil { + objectMap["location"] = f.Location + } + if f.Tags != nil { + objectMap["tags"] = f.Tags + } + if f.ETag != nil { + objectMap["eTag"] = f.ETag + } + for k, v := range f.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Factory struct. +func (f *Factory) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if f.AdditionalProperties == nil { + f.AdditionalProperties = make(map[string]interface{}) + } + f.AdditionalProperties[k] = additionalProperties + } + case "identity": + if v != nil { + var identity FactoryIdentity + err = json.Unmarshal(*v, &identity) + if err != nil { + return err + } + f.Identity = &identity + } + case "properties": + if v != nil { + var factoryProperties FactoryProperties + err = json.Unmarshal(*v, &factoryProperties) + if err != nil { + return err + } + f.FactoryProperties = &factoryProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + f.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + f.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + f.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + f.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + f.Tags = tags + } + case "eTag": + if v != nil { + var eTag string + err = json.Unmarshal(*v, &eTag) + if err != nil { + return err + } + f.ETag = &eTag + } + } + } + + return nil +} + +// FactoryGitHubConfiguration factory's GitHub repo information. +type FactoryGitHubConfiguration struct { + // HostName - GitHub repo host name. + HostName *string `json:"hostName,omitempty"` + // AccountName - Account name. + AccountName *string `json:"accountName,omitempty"` + // RepositoryName - Rrepository name. + RepositoryName *string `json:"repositoryName,omitempty"` + // CollaborationBranch - Collaboration branch. + CollaborationBranch *string `json:"collaborationBranch,omitempty"` + // RootFolder - Root folder. + RootFolder *string `json:"rootFolder,omitempty"` + // LastCommitID - Last commit id. + LastCommitID *string `json:"lastCommitId,omitempty"` + // Type - Possible values include: 'TypeFactoryRepoConfiguration', 'TypeFactoryVSTSConfiguration', 'TypeFactoryGithubConfiguration' + Type TypeBasicFactoryRepoConfiguration `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for FactoryGitHubConfiguration. +func (fghc FactoryGitHubConfiguration) MarshalJSON() ([]byte, error) { + fghc.Type = TypeFactoryGithubConfiguration + objectMap := make(map[string]interface{}) + if fghc.HostName != nil { + objectMap["hostName"] = fghc.HostName + } + if fghc.AccountName != nil { + objectMap["accountName"] = fghc.AccountName + } + if fghc.RepositoryName != nil { + objectMap["repositoryName"] = fghc.RepositoryName + } + if fghc.CollaborationBranch != nil { + objectMap["collaborationBranch"] = fghc.CollaborationBranch + } + if fghc.RootFolder != nil { + objectMap["rootFolder"] = fghc.RootFolder + } + if fghc.LastCommitID != nil { + objectMap["lastCommitId"] = fghc.LastCommitID + } + if fghc.Type != "" { + objectMap["type"] = fghc.Type + } + return json.Marshal(objectMap) +} + +// AsFactoryVSTSConfiguration is the BasicFactoryRepoConfiguration implementation for FactoryGitHubConfiguration. +func (fghc FactoryGitHubConfiguration) AsFactoryVSTSConfiguration() (*FactoryVSTSConfiguration, bool) { + return nil, false +} + +// AsFactoryGitHubConfiguration is the BasicFactoryRepoConfiguration implementation for FactoryGitHubConfiguration. +func (fghc FactoryGitHubConfiguration) AsFactoryGitHubConfiguration() (*FactoryGitHubConfiguration, bool) { + return &fghc, true +} + +// AsFactoryRepoConfiguration is the BasicFactoryRepoConfiguration implementation for FactoryGitHubConfiguration. +func (fghc FactoryGitHubConfiguration) AsFactoryRepoConfiguration() (*FactoryRepoConfiguration, bool) { + return nil, false +} + +// AsBasicFactoryRepoConfiguration is the BasicFactoryRepoConfiguration implementation for FactoryGitHubConfiguration. +func (fghc FactoryGitHubConfiguration) AsBasicFactoryRepoConfiguration() (BasicFactoryRepoConfiguration, bool) { + return &fghc, true +} + +// FactoryIdentity identity properties of the factory resource. +type FactoryIdentity struct { + // Type - The identity type. Currently the only supported type is 'SystemAssigned'. + Type *string `json:"type,omitempty"` + // PrincipalID - The principal id of the identity. + PrincipalID *uuid.UUID `json:"principalId,omitempty"` + // TenantID - The client tenant id of the identity. + TenantID *uuid.UUID `json:"tenantId,omitempty"` +} + +// FactoryListResponse a list of factory resources. +type FactoryListResponse struct { + autorest.Response `json:"-"` + // Value - List of factories. + Value *[]Factory `json:"value,omitempty"` + // NextLink - The link to the next page of results, if any remaining results exist. + NextLink *string `json:"nextLink,omitempty"` +} + +// FactoryListResponseIterator provides access to a complete listing of Factory values. +type FactoryListResponseIterator struct { + i int + page FactoryListResponsePage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *FactoryListResponseIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter FactoryListResponseIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter FactoryListResponseIterator) Response() FactoryListResponse { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter FactoryListResponseIterator) Value() Factory { + if !iter.page.NotDone() { + return Factory{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (flr FactoryListResponse) IsEmpty() bool { + return flr.Value == nil || len(*flr.Value) == 0 +} + +// factoryListResponsePreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (flr FactoryListResponse) factoryListResponsePreparer() (*http.Request, error) { + if flr.NextLink == nil || len(to.String(flr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(flr.NextLink))) +} + +// FactoryListResponsePage contains a page of Factory values. +type FactoryListResponsePage struct { + fn func(FactoryListResponse) (FactoryListResponse, error) + flr FactoryListResponse +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *FactoryListResponsePage) Next() error { + next, err := page.fn(page.flr) + if err != nil { + return err + } + page.flr = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page FactoryListResponsePage) NotDone() bool { + return !page.flr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page FactoryListResponsePage) Response() FactoryListResponse { + return page.flr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page FactoryListResponsePage) Values() []Factory { + if page.flr.IsEmpty() { + return nil + } + return *page.flr.Value +} + +// FactoryProperties factory resource properties. +type FactoryProperties struct { + // ProvisioningState - Factory provisioning state, example Succeeded. + ProvisioningState *string `json:"provisioningState,omitempty"` + // CreateTime - Time the factory was created in ISO8601 format. + CreateTime *date.Time `json:"createTime,omitempty"` + // Version - Version of the factory. + Version *string `json:"version,omitempty"` + // RepoConfiguration - Git repo information of the factory. + RepoConfiguration BasicFactoryRepoConfiguration `json:"repoConfiguration,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for FactoryProperties struct. +func (fp *FactoryProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "provisioningState": + if v != nil { + var provisioningState string + err = json.Unmarshal(*v, &provisioningState) + if err != nil { + return err + } + fp.ProvisioningState = &provisioningState + } + case "createTime": + if v != nil { + var createTime date.Time + err = json.Unmarshal(*v, &createTime) + if err != nil { + return err + } + fp.CreateTime = &createTime + } + case "version": + if v != nil { + var version string + err = json.Unmarshal(*v, &version) + if err != nil { + return err + } + fp.Version = &version + } + case "repoConfiguration": + if v != nil { + repoConfiguration, err := unmarshalBasicFactoryRepoConfiguration(*v) + if err != nil { + return err + } + fp.RepoConfiguration = repoConfiguration + } + } + } + + return nil +} + +// BasicFactoryRepoConfiguration factory's git repo information. +type BasicFactoryRepoConfiguration interface { + AsFactoryVSTSConfiguration() (*FactoryVSTSConfiguration, bool) + AsFactoryGitHubConfiguration() (*FactoryGitHubConfiguration, bool) + AsFactoryRepoConfiguration() (*FactoryRepoConfiguration, bool) +} + +// FactoryRepoConfiguration factory's git repo information. +type FactoryRepoConfiguration struct { + // AccountName - Account name. + AccountName *string `json:"accountName,omitempty"` + // RepositoryName - Rrepository name. + RepositoryName *string `json:"repositoryName,omitempty"` + // CollaborationBranch - Collaboration branch. + CollaborationBranch *string `json:"collaborationBranch,omitempty"` + // RootFolder - Root folder. + RootFolder *string `json:"rootFolder,omitempty"` + // LastCommitID - Last commit id. + LastCommitID *string `json:"lastCommitId,omitempty"` + // Type - Possible values include: 'TypeFactoryRepoConfiguration', 'TypeFactoryVSTSConfiguration', 'TypeFactoryGithubConfiguration' + Type TypeBasicFactoryRepoConfiguration `json:"type,omitempty"` +} + +func unmarshalBasicFactoryRepoConfiguration(body []byte) (BasicFactoryRepoConfiguration, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["type"] { + case string(TypeFactoryVSTSConfiguration): + var fvc FactoryVSTSConfiguration + err := json.Unmarshal(body, &fvc) + return fvc, err + case string(TypeFactoryGithubConfiguration): + var fghc FactoryGitHubConfiguration + err := json.Unmarshal(body, &fghc) + return fghc, err + default: + var frc FactoryRepoConfiguration + err := json.Unmarshal(body, &frc) + return frc, err + } +} +func unmarshalBasicFactoryRepoConfigurationArray(body []byte) ([]BasicFactoryRepoConfiguration, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + frcArray := make([]BasicFactoryRepoConfiguration, len(rawMessages)) + + for index, rawMessage := range rawMessages { + frc, err := unmarshalBasicFactoryRepoConfiguration(*rawMessage) + if err != nil { + return nil, err + } + frcArray[index] = frc + } + return frcArray, nil +} + +// MarshalJSON is the custom marshaler for FactoryRepoConfiguration. +func (frc FactoryRepoConfiguration) MarshalJSON() ([]byte, error) { + frc.Type = TypeFactoryRepoConfiguration + objectMap := make(map[string]interface{}) + if frc.AccountName != nil { + objectMap["accountName"] = frc.AccountName + } + if frc.RepositoryName != nil { + objectMap["repositoryName"] = frc.RepositoryName + } + if frc.CollaborationBranch != nil { + objectMap["collaborationBranch"] = frc.CollaborationBranch + } + if frc.RootFolder != nil { + objectMap["rootFolder"] = frc.RootFolder + } + if frc.LastCommitID != nil { + objectMap["lastCommitId"] = frc.LastCommitID + } + if frc.Type != "" { + objectMap["type"] = frc.Type + } + return json.Marshal(objectMap) +} + +// AsFactoryVSTSConfiguration is the BasicFactoryRepoConfiguration implementation for FactoryRepoConfiguration. +func (frc FactoryRepoConfiguration) AsFactoryVSTSConfiguration() (*FactoryVSTSConfiguration, bool) { + return nil, false +} + +// AsFactoryGitHubConfiguration is the BasicFactoryRepoConfiguration implementation for FactoryRepoConfiguration. +func (frc FactoryRepoConfiguration) AsFactoryGitHubConfiguration() (*FactoryGitHubConfiguration, bool) { + return nil, false +} + +// AsFactoryRepoConfiguration is the BasicFactoryRepoConfiguration implementation for FactoryRepoConfiguration. +func (frc FactoryRepoConfiguration) AsFactoryRepoConfiguration() (*FactoryRepoConfiguration, bool) { + return &frc, true +} + +// AsBasicFactoryRepoConfiguration is the BasicFactoryRepoConfiguration implementation for FactoryRepoConfiguration. +func (frc FactoryRepoConfiguration) AsBasicFactoryRepoConfiguration() (BasicFactoryRepoConfiguration, bool) { + return &frc, true +} + +// FactoryRepoUpdate factory's git repo information. +type FactoryRepoUpdate struct { + // FactoryResourceID - The factory resource id. + FactoryResourceID *string `json:"factoryResourceId,omitempty"` + // RepoConfiguration - Git repo information of the factory. + RepoConfiguration BasicFactoryRepoConfiguration `json:"repoConfiguration,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for FactoryRepoUpdate struct. +func (fru *FactoryRepoUpdate) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "factoryResourceId": + if v != nil { + var factoryResourceID string + err = json.Unmarshal(*v, &factoryResourceID) + if err != nil { + return err + } + fru.FactoryResourceID = &factoryResourceID + } + case "repoConfiguration": + if v != nil { + repoConfiguration, err := unmarshalBasicFactoryRepoConfiguration(*v) + if err != nil { + return err + } + fru.RepoConfiguration = repoConfiguration + } + } + } + + return nil +} + +// FactoryUpdateParameters parameters for updating a factory resource. +type FactoryUpdateParameters struct { + // Tags - The resource tags. + Tags map[string]*string `json:"tags"` + // Identity - Managed service identity of the factory. + Identity *FactoryIdentity `json:"identity,omitempty"` +} + +// MarshalJSON is the custom marshaler for FactoryUpdateParameters. +func (fup FactoryUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if fup.Tags != nil { + objectMap["tags"] = fup.Tags + } + if fup.Identity != nil { + objectMap["identity"] = fup.Identity + } + return json.Marshal(objectMap) +} + +// FactoryVSTSConfiguration factory's VSTS repo information. +type FactoryVSTSConfiguration struct { + // ProjectName - VSTS project name. + ProjectName *string `json:"projectName,omitempty"` + // TenantID - VSTS tenant id. + TenantID *string `json:"tenantId,omitempty"` + // AccountName - Account name. + AccountName *string `json:"accountName,omitempty"` + // RepositoryName - Rrepository name. + RepositoryName *string `json:"repositoryName,omitempty"` + // CollaborationBranch - Collaboration branch. + CollaborationBranch *string `json:"collaborationBranch,omitempty"` + // RootFolder - Root folder. + RootFolder *string `json:"rootFolder,omitempty"` + // LastCommitID - Last commit id. + LastCommitID *string `json:"lastCommitId,omitempty"` + // Type - Possible values include: 'TypeFactoryRepoConfiguration', 'TypeFactoryVSTSConfiguration', 'TypeFactoryGithubConfiguration' + Type TypeBasicFactoryRepoConfiguration `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for FactoryVSTSConfiguration. +func (fvc FactoryVSTSConfiguration) MarshalJSON() ([]byte, error) { + fvc.Type = TypeFactoryVSTSConfiguration + objectMap := make(map[string]interface{}) + if fvc.ProjectName != nil { + objectMap["projectName"] = fvc.ProjectName + } + if fvc.TenantID != nil { + objectMap["tenantId"] = fvc.TenantID + } + if fvc.AccountName != nil { + objectMap["accountName"] = fvc.AccountName + } + if fvc.RepositoryName != nil { + objectMap["repositoryName"] = fvc.RepositoryName + } + if fvc.CollaborationBranch != nil { + objectMap["collaborationBranch"] = fvc.CollaborationBranch + } + if fvc.RootFolder != nil { + objectMap["rootFolder"] = fvc.RootFolder + } + if fvc.LastCommitID != nil { + objectMap["lastCommitId"] = fvc.LastCommitID + } + if fvc.Type != "" { + objectMap["type"] = fvc.Type + } + return json.Marshal(objectMap) +} + +// AsFactoryVSTSConfiguration is the BasicFactoryRepoConfiguration implementation for FactoryVSTSConfiguration. +func (fvc FactoryVSTSConfiguration) AsFactoryVSTSConfiguration() (*FactoryVSTSConfiguration, bool) { + return &fvc, true +} + +// AsFactoryGitHubConfiguration is the BasicFactoryRepoConfiguration implementation for FactoryVSTSConfiguration. +func (fvc FactoryVSTSConfiguration) AsFactoryGitHubConfiguration() (*FactoryGitHubConfiguration, bool) { + return nil, false +} + +// AsFactoryRepoConfiguration is the BasicFactoryRepoConfiguration implementation for FactoryVSTSConfiguration. +func (fvc FactoryVSTSConfiguration) AsFactoryRepoConfiguration() (*FactoryRepoConfiguration, bool) { + return nil, false +} + +// AsBasicFactoryRepoConfiguration is the BasicFactoryRepoConfiguration implementation for FactoryVSTSConfiguration. +func (fvc FactoryVSTSConfiguration) AsBasicFactoryRepoConfiguration() (BasicFactoryRepoConfiguration, bool) { + return &fvc, true +} + +// FileServerLinkedService file system linked service. +type FileServerLinkedService struct { + // FileServerLinkedServiceTypeProperties - File system linked service properties. + *FileServerLinkedServiceTypeProperties `json:"typeProperties,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // ConnectVia - The integration runtime reference. + ConnectVia *IntegrationRuntimeReference `json:"connectVia,omitempty"` + // Description - Linked service description. + Description *string `json:"description,omitempty"` + // Parameters - Parameters for linked service. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeLinkedService', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforce', 'TypeAzureDataLakeStore', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureStorage' + Type TypeBasicLinkedService `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for FileServerLinkedService. +func (fsls FileServerLinkedService) MarshalJSON() ([]byte, error) { + fsls.Type = TypeFileServer + objectMap := make(map[string]interface{}) + if fsls.FileServerLinkedServiceTypeProperties != nil { + objectMap["typeProperties"] = fsls.FileServerLinkedServiceTypeProperties + } + if fsls.ConnectVia != nil { + objectMap["connectVia"] = fsls.ConnectVia + } + if fsls.Description != nil { + objectMap["description"] = fsls.Description + } + if fsls.Parameters != nil { + objectMap["parameters"] = fsls.Parameters + } + if fsls.Annotations != nil { + objectMap["annotations"] = fsls.Annotations + } + if fsls.Type != "" { + objectMap["type"] = fsls.Type + } + for k, v := range fsls.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysLinkedService is the BasicLinkedService implementation for FileServerLinkedService. +func (fsls FileServerLinkedService) AsResponsysLinkedService() (*ResponsysLinkedService, bool) { + return nil, false +} + +// AsAzureDatabricksLinkedService is the BasicLinkedService implementation for FileServerLinkedService. +func (fsls FileServerLinkedService) AsAzureDatabricksLinkedService() (*AzureDatabricksLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeAnalyticsLinkedService is the BasicLinkedService implementation for FileServerLinkedService. +func (fsls FileServerLinkedService) AsAzureDataLakeAnalyticsLinkedService() (*AzureDataLakeAnalyticsLinkedService, bool) { + return nil, false +} + +// AsHDInsightOnDemandLinkedService is the BasicLinkedService implementation for FileServerLinkedService. +func (fsls FileServerLinkedService) AsHDInsightOnDemandLinkedService() (*HDInsightOnDemandLinkedService, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudLinkedService is the BasicLinkedService implementation for FileServerLinkedService. +func (fsls FileServerLinkedService) AsSalesforceMarketingCloudLinkedService() (*SalesforceMarketingCloudLinkedService, bool) { + return nil, false +} + +// AsNetezzaLinkedService is the BasicLinkedService implementation for FileServerLinkedService. +func (fsls FileServerLinkedService) AsNetezzaLinkedService() (*NetezzaLinkedService, bool) { + return nil, false +} + +// AsVerticaLinkedService is the BasicLinkedService implementation for FileServerLinkedService. +func (fsls FileServerLinkedService) AsVerticaLinkedService() (*VerticaLinkedService, bool) { + return nil, false +} + +// AsZohoLinkedService is the BasicLinkedService implementation for FileServerLinkedService. +func (fsls FileServerLinkedService) AsZohoLinkedService() (*ZohoLinkedService, bool) { + return nil, false +} + +// AsXeroLinkedService is the BasicLinkedService implementation for FileServerLinkedService. +func (fsls FileServerLinkedService) AsXeroLinkedService() (*XeroLinkedService, bool) { + return nil, false +} + +// AsSquareLinkedService is the BasicLinkedService implementation for FileServerLinkedService. +func (fsls FileServerLinkedService) AsSquareLinkedService() (*SquareLinkedService, bool) { + return nil, false +} + +// AsSparkLinkedService is the BasicLinkedService implementation for FileServerLinkedService. +func (fsls FileServerLinkedService) AsSparkLinkedService() (*SparkLinkedService, bool) { + return nil, false +} + +// AsShopifyLinkedService is the BasicLinkedService implementation for FileServerLinkedService. +func (fsls FileServerLinkedService) AsShopifyLinkedService() (*ShopifyLinkedService, bool) { + return nil, false +} + +// AsServiceNowLinkedService is the BasicLinkedService implementation for FileServerLinkedService. +func (fsls FileServerLinkedService) AsServiceNowLinkedService() (*ServiceNowLinkedService, bool) { + return nil, false +} + +// AsQuickBooksLinkedService is the BasicLinkedService implementation for FileServerLinkedService. +func (fsls FileServerLinkedService) AsQuickBooksLinkedService() (*QuickBooksLinkedService, bool) { + return nil, false +} + +// AsPrestoLinkedService is the BasicLinkedService implementation for FileServerLinkedService. +func (fsls FileServerLinkedService) AsPrestoLinkedService() (*PrestoLinkedService, bool) { + return nil, false +} + +// AsPhoenixLinkedService is the BasicLinkedService implementation for FileServerLinkedService. +func (fsls FileServerLinkedService) AsPhoenixLinkedService() (*PhoenixLinkedService, bool) { + return nil, false +} + +// AsPaypalLinkedService is the BasicLinkedService implementation for FileServerLinkedService. +func (fsls FileServerLinkedService) AsPaypalLinkedService() (*PaypalLinkedService, bool) { + return nil, false +} + +// AsMarketoLinkedService is the BasicLinkedService implementation for FileServerLinkedService. +func (fsls FileServerLinkedService) AsMarketoLinkedService() (*MarketoLinkedService, bool) { + return nil, false +} + +// AsMariaDBLinkedService is the BasicLinkedService implementation for FileServerLinkedService. +func (fsls FileServerLinkedService) AsMariaDBLinkedService() (*MariaDBLinkedService, bool) { + return nil, false +} + +// AsMagentoLinkedService is the BasicLinkedService implementation for FileServerLinkedService. +func (fsls FileServerLinkedService) AsMagentoLinkedService() (*MagentoLinkedService, bool) { + return nil, false +} + +// AsJiraLinkedService is the BasicLinkedService implementation for FileServerLinkedService. +func (fsls FileServerLinkedService) AsJiraLinkedService() (*JiraLinkedService, bool) { + return nil, false +} + +// AsImpalaLinkedService is the BasicLinkedService implementation for FileServerLinkedService. +func (fsls FileServerLinkedService) AsImpalaLinkedService() (*ImpalaLinkedService, bool) { + return nil, false +} + +// AsHubspotLinkedService is the BasicLinkedService implementation for FileServerLinkedService. +func (fsls FileServerLinkedService) AsHubspotLinkedService() (*HubspotLinkedService, bool) { + return nil, false +} + +// AsHiveLinkedService is the BasicLinkedService implementation for FileServerLinkedService. +func (fsls FileServerLinkedService) AsHiveLinkedService() (*HiveLinkedService, bool) { + return nil, false +} + +// AsHBaseLinkedService is the BasicLinkedService implementation for FileServerLinkedService. +func (fsls FileServerLinkedService) AsHBaseLinkedService() (*HBaseLinkedService, bool) { + return nil, false +} + +// AsGreenplumLinkedService is the BasicLinkedService implementation for FileServerLinkedService. +func (fsls FileServerLinkedService) AsGreenplumLinkedService() (*GreenplumLinkedService, bool) { + return nil, false +} + +// AsGoogleBigQueryLinkedService is the BasicLinkedService implementation for FileServerLinkedService. +func (fsls FileServerLinkedService) AsGoogleBigQueryLinkedService() (*GoogleBigQueryLinkedService, bool) { + return nil, false +} + +// AsEloquaLinkedService is the BasicLinkedService implementation for FileServerLinkedService. +func (fsls FileServerLinkedService) AsEloquaLinkedService() (*EloquaLinkedService, bool) { + return nil, false +} + +// AsDrillLinkedService is the BasicLinkedService implementation for FileServerLinkedService. +func (fsls FileServerLinkedService) AsDrillLinkedService() (*DrillLinkedService, bool) { + return nil, false +} + +// AsCouchbaseLinkedService is the BasicLinkedService implementation for FileServerLinkedService. +func (fsls FileServerLinkedService) AsCouchbaseLinkedService() (*CouchbaseLinkedService, bool) { + return nil, false +} + +// AsConcurLinkedService is the BasicLinkedService implementation for FileServerLinkedService. +func (fsls FileServerLinkedService) AsConcurLinkedService() (*ConcurLinkedService, bool) { + return nil, false +} + +// AsAzurePostgreSQLLinkedService is the BasicLinkedService implementation for FileServerLinkedService. +func (fsls FileServerLinkedService) AsAzurePostgreSQLLinkedService() (*AzurePostgreSQLLinkedService, bool) { + return nil, false +} + +// AsAmazonMWSLinkedService is the BasicLinkedService implementation for FileServerLinkedService. +func (fsls FileServerLinkedService) AsAmazonMWSLinkedService() (*AmazonMWSLinkedService, bool) { + return nil, false +} + +// AsSapHanaLinkedService is the BasicLinkedService implementation for FileServerLinkedService. +func (fsls FileServerLinkedService) AsSapHanaLinkedService() (*SapHanaLinkedService, bool) { + return nil, false +} + +// AsSapBWLinkedService is the BasicLinkedService implementation for FileServerLinkedService. +func (fsls FileServerLinkedService) AsSapBWLinkedService() (*SapBWLinkedService, bool) { + return nil, false +} + +// AsSftpServerLinkedService is the BasicLinkedService implementation for FileServerLinkedService. +func (fsls FileServerLinkedService) AsSftpServerLinkedService() (*SftpServerLinkedService, bool) { + return nil, false +} + +// AsFtpServerLinkedService is the BasicLinkedService implementation for FileServerLinkedService. +func (fsls FileServerLinkedService) AsFtpServerLinkedService() (*FtpServerLinkedService, bool) { + return nil, false +} + +// AsHTTPLinkedService is the BasicLinkedService implementation for FileServerLinkedService. +func (fsls FileServerLinkedService) AsHTTPLinkedService() (*HTTPLinkedService, bool) { + return nil, false +} + +// AsAzureSearchLinkedService is the BasicLinkedService implementation for FileServerLinkedService. +func (fsls FileServerLinkedService) AsAzureSearchLinkedService() (*AzureSearchLinkedService, bool) { + return nil, false +} + +// AsCustomDataSourceLinkedService is the BasicLinkedService implementation for FileServerLinkedService. +func (fsls FileServerLinkedService) AsCustomDataSourceLinkedService() (*CustomDataSourceLinkedService, bool) { + return nil, false +} + +// AsAmazonRedshiftLinkedService is the BasicLinkedService implementation for FileServerLinkedService. +func (fsls FileServerLinkedService) AsAmazonRedshiftLinkedService() (*AmazonRedshiftLinkedService, bool) { + return nil, false +} + +// AsAmazonS3LinkedService is the BasicLinkedService implementation for FileServerLinkedService. +func (fsls FileServerLinkedService) AsAmazonS3LinkedService() (*AmazonS3LinkedService, bool) { + return nil, false +} + +// AsSapEccLinkedService is the BasicLinkedService implementation for FileServerLinkedService. +func (fsls FileServerLinkedService) AsSapEccLinkedService() (*SapEccLinkedService, bool) { + return nil, false +} + +// AsSapCloudForCustomerLinkedService is the BasicLinkedService implementation for FileServerLinkedService. +func (fsls FileServerLinkedService) AsSapCloudForCustomerLinkedService() (*SapCloudForCustomerLinkedService, bool) { + return nil, false +} + +// AsSalesforceLinkedService is the BasicLinkedService implementation for FileServerLinkedService. +func (fsls FileServerLinkedService) AsSalesforceLinkedService() (*SalesforceLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeStoreLinkedService is the BasicLinkedService implementation for FileServerLinkedService. +func (fsls FileServerLinkedService) AsAzureDataLakeStoreLinkedService() (*AzureDataLakeStoreLinkedService, bool) { + return nil, false +} + +// AsMongoDbLinkedService is the BasicLinkedService implementation for FileServerLinkedService. +func (fsls FileServerLinkedService) AsMongoDbLinkedService() (*MongoDbLinkedService, bool) { + return nil, false +} + +// AsCassandraLinkedService is the BasicLinkedService implementation for FileServerLinkedService. +func (fsls FileServerLinkedService) AsCassandraLinkedService() (*CassandraLinkedService, bool) { + return nil, false +} + +// AsWebLinkedService is the BasicLinkedService implementation for FileServerLinkedService. +func (fsls FileServerLinkedService) AsWebLinkedService() (*WebLinkedService, bool) { + return nil, false +} + +// AsODataLinkedService is the BasicLinkedService implementation for FileServerLinkedService. +func (fsls FileServerLinkedService) AsODataLinkedService() (*ODataLinkedService, bool) { + return nil, false +} + +// AsHdfsLinkedService is the BasicLinkedService implementation for FileServerLinkedService. +func (fsls FileServerLinkedService) AsHdfsLinkedService() (*HdfsLinkedService, bool) { + return nil, false +} + +// AsOdbcLinkedService is the BasicLinkedService implementation for FileServerLinkedService. +func (fsls FileServerLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, bool) { + return nil, false +} + +// AsAzureMLLinkedService is the BasicLinkedService implementation for FileServerLinkedService. +func (fsls FileServerLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { + return nil, false +} + +// AsTeradataLinkedService is the BasicLinkedService implementation for FileServerLinkedService. +func (fsls FileServerLinkedService) AsTeradataLinkedService() (*TeradataLinkedService, bool) { + return nil, false +} + +// AsDb2LinkedService is the BasicLinkedService implementation for FileServerLinkedService. +func (fsls FileServerLinkedService) AsDb2LinkedService() (*Db2LinkedService, bool) { + return nil, false +} + +// AsSybaseLinkedService is the BasicLinkedService implementation for FileServerLinkedService. +func (fsls FileServerLinkedService) AsSybaseLinkedService() (*SybaseLinkedService, bool) { + return nil, false +} + +// AsPostgreSQLLinkedService is the BasicLinkedService implementation for FileServerLinkedService. +func (fsls FileServerLinkedService) AsPostgreSQLLinkedService() (*PostgreSQLLinkedService, bool) { + return nil, false +} + +// AsMySQLLinkedService is the BasicLinkedService implementation for FileServerLinkedService. +func (fsls FileServerLinkedService) AsMySQLLinkedService() (*MySQLLinkedService, bool) { + return nil, false +} + +// AsAzureMySQLLinkedService is the BasicLinkedService implementation for FileServerLinkedService. +func (fsls FileServerLinkedService) AsAzureMySQLLinkedService() (*AzureMySQLLinkedService, bool) { + return nil, false +} + +// AsOracleLinkedService is the BasicLinkedService implementation for FileServerLinkedService. +func (fsls FileServerLinkedService) AsOracleLinkedService() (*OracleLinkedService, bool) { + return nil, false +} + +// AsFileServerLinkedService is the BasicLinkedService implementation for FileServerLinkedService. +func (fsls FileServerLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { + return &fsls, true +} + +// AsHDInsightLinkedService is the BasicLinkedService implementation for FileServerLinkedService. +func (fsls FileServerLinkedService) AsHDInsightLinkedService() (*HDInsightLinkedService, bool) { + return nil, false +} + +// AsDynamicsLinkedService is the BasicLinkedService implementation for FileServerLinkedService. +func (fsls FileServerLinkedService) AsDynamicsLinkedService() (*DynamicsLinkedService, bool) { + return nil, false +} + +// AsCosmosDbLinkedService is the BasicLinkedService implementation for FileServerLinkedService. +func (fsls FileServerLinkedService) AsCosmosDbLinkedService() (*CosmosDbLinkedService, bool) { + return nil, false +} + +// AsAzureKeyVaultLinkedService is the BasicLinkedService implementation for FileServerLinkedService. +func (fsls FileServerLinkedService) AsAzureKeyVaultLinkedService() (*AzureKeyVaultLinkedService, bool) { + return nil, false +} + +// AsAzureBatchLinkedService is the BasicLinkedService implementation for FileServerLinkedService. +func (fsls FileServerLinkedService) AsAzureBatchLinkedService() (*AzureBatchLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDatabaseLinkedService is the BasicLinkedService implementation for FileServerLinkedService. +func (fsls FileServerLinkedService) AsAzureSQLDatabaseLinkedService() (*AzureSQLDatabaseLinkedService, bool) { + return nil, false +} + +// AsSQLServerLinkedService is the BasicLinkedService implementation for FileServerLinkedService. +func (fsls FileServerLinkedService) AsSQLServerLinkedService() (*SQLServerLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDWLinkedService is the BasicLinkedService implementation for FileServerLinkedService. +func (fsls FileServerLinkedService) AsAzureSQLDWLinkedService() (*AzureSQLDWLinkedService, bool) { + return nil, false +} + +// AsAzureStorageLinkedService is the BasicLinkedService implementation for FileServerLinkedService. +func (fsls FileServerLinkedService) AsAzureStorageLinkedService() (*AzureStorageLinkedService, bool) { + return nil, false +} + +// AsLinkedService is the BasicLinkedService implementation for FileServerLinkedService. +func (fsls FileServerLinkedService) AsLinkedService() (*LinkedService, bool) { + return nil, false +} + +// AsBasicLinkedService is the BasicLinkedService implementation for FileServerLinkedService. +func (fsls FileServerLinkedService) AsBasicLinkedService() (BasicLinkedService, bool) { + return &fsls, true +} + +// UnmarshalJSON is the custom unmarshaler for FileServerLinkedService struct. +func (fsls *FileServerLinkedService) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "typeProperties": + if v != nil { + var fileServerLinkedServiceTypeProperties FileServerLinkedServiceTypeProperties + err = json.Unmarshal(*v, &fileServerLinkedServiceTypeProperties) + if err != nil { + return err + } + fsls.FileServerLinkedServiceTypeProperties = &fileServerLinkedServiceTypeProperties + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if fsls.AdditionalProperties == nil { + fsls.AdditionalProperties = make(map[string]interface{}) + } + fsls.AdditionalProperties[k] = additionalProperties + } + case "connectVia": + if v != nil { + var connectVia IntegrationRuntimeReference + err = json.Unmarshal(*v, &connectVia) + if err != nil { + return err + } + fsls.ConnectVia = &connectVia + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + fsls.Description = &description + } + case "parameters": + if v != nil { + var parameters map[string]*ParameterSpecification + err = json.Unmarshal(*v, ¶meters) + if err != nil { + return err + } + fsls.Parameters = parameters + } + case "annotations": + if v != nil { + var annotations []interface{} + err = json.Unmarshal(*v, &annotations) + if err != nil { + return err + } + fsls.Annotations = &annotations + } + case "type": + if v != nil { + var typeVar TypeBasicLinkedService + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + fsls.Type = typeVar + } + } + } + + return nil +} + +// FileServerLinkedServiceTypeProperties file system linked service properties. +type FileServerLinkedServiceTypeProperties struct { + // Host - Host name of the server. Type: string (or Expression with resultType string). + Host interface{} `json:"host,omitempty"` + // UserID - User ID to logon the server. Type: string (or Expression with resultType string). + UserID interface{} `json:"userId,omitempty"` + // Password - Password to logon the server. + Password BasicSecretBase `json:"password,omitempty"` + // EncryptedCredential - The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string). + EncryptedCredential interface{} `json:"encryptedCredential,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for FileServerLinkedServiceTypeProperties struct. +func (fslstp *FileServerLinkedServiceTypeProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "host": + if v != nil { + var host interface{} + err = json.Unmarshal(*v, &host) + if err != nil { + return err + } + fslstp.Host = host + } + case "userId": + if v != nil { + var userID interface{} + err = json.Unmarshal(*v, &userID) + if err != nil { + return err + } + fslstp.UserID = userID + } + case "password": + if v != nil { + password, err := unmarshalBasicSecretBase(*v) + if err != nil { + return err + } + fslstp.Password = password + } + case "encryptedCredential": + if v != nil { + var encryptedCredential interface{} + err = json.Unmarshal(*v, &encryptedCredential) + if err != nil { + return err + } + fslstp.EncryptedCredential = encryptedCredential + } + } + } + + return nil +} + +// FileShareDataset an on-premises file system dataset. +type FileShareDataset struct { + // FileShareDatasetTypeProperties - On-premises file system dataset properties. + *FileShareDatasetTypeProperties `json:"typeProperties,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Description - Dataset description. + Description *string `json:"description,omitempty"` + // Structure - Columns that define the structure of the dataset. Type: array (or Expression with resultType array), itemType: DatasetDataElement. + Structure interface{} `json:"structure,omitempty"` + // LinkedServiceName - Linked service reference. + LinkedServiceName *LinkedServiceReference `json:"linkedServiceName,omitempty"` + // Parameters - Parameters for dataset. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeDataset', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSQLServerTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSalesforceObject', 'TypeRelationalTable', 'TypeAzureMySQLTable', 'TypeOracleTable', 'TypeODataResource', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeAzureDataLakeStoreFile', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeAmazonS3Object' + Type TypeBasicDataset `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for FileShareDataset. +func (fsd FileShareDataset) MarshalJSON() ([]byte, error) { + fsd.Type = TypeFileShare + objectMap := make(map[string]interface{}) + if fsd.FileShareDatasetTypeProperties != nil { + objectMap["typeProperties"] = fsd.FileShareDatasetTypeProperties + } + if fsd.Description != nil { + objectMap["description"] = fsd.Description + } + objectMap["structure"] = fsd.Structure + if fsd.LinkedServiceName != nil { + objectMap["linkedServiceName"] = fsd.LinkedServiceName + } + if fsd.Parameters != nil { + objectMap["parameters"] = fsd.Parameters + } + if fsd.Annotations != nil { + objectMap["annotations"] = fsd.Annotations + } + if fsd.Type != "" { + objectMap["type"] = fsd.Type + } + for k, v := range fsd.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysObjectDataset is the BasicDataset implementation for FileShareDataset. +func (fsd FileShareDataset) AsResponsysObjectDataset() (*ResponsysObjectDataset, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudObjectDataset is the BasicDataset implementation for FileShareDataset. +func (fsd FileShareDataset) AsSalesforceMarketingCloudObjectDataset() (*SalesforceMarketingCloudObjectDataset, bool) { + return nil, false +} + +// AsVerticaTableDataset is the BasicDataset implementation for FileShareDataset. +func (fsd FileShareDataset) AsVerticaTableDataset() (*VerticaTableDataset, bool) { + return nil, false +} + +// AsNetezzaTableDataset is the BasicDataset implementation for FileShareDataset. +func (fsd FileShareDataset) AsNetezzaTableDataset() (*NetezzaTableDataset, bool) { + return nil, false +} + +// AsZohoObjectDataset is the BasicDataset implementation for FileShareDataset. +func (fsd FileShareDataset) AsZohoObjectDataset() (*ZohoObjectDataset, bool) { + return nil, false +} + +// AsXeroObjectDataset is the BasicDataset implementation for FileShareDataset. +func (fsd FileShareDataset) AsXeroObjectDataset() (*XeroObjectDataset, bool) { + return nil, false +} + +// AsSquareObjectDataset is the BasicDataset implementation for FileShareDataset. +func (fsd FileShareDataset) AsSquareObjectDataset() (*SquareObjectDataset, bool) { + return nil, false +} + +// AsSparkObjectDataset is the BasicDataset implementation for FileShareDataset. +func (fsd FileShareDataset) AsSparkObjectDataset() (*SparkObjectDataset, bool) { + return nil, false +} + +// AsShopifyObjectDataset is the BasicDataset implementation for FileShareDataset. +func (fsd FileShareDataset) AsShopifyObjectDataset() (*ShopifyObjectDataset, bool) { + return nil, false +} + +// AsServiceNowObjectDataset is the BasicDataset implementation for FileShareDataset. +func (fsd FileShareDataset) AsServiceNowObjectDataset() (*ServiceNowObjectDataset, bool) { + return nil, false +} + +// AsQuickBooksObjectDataset is the BasicDataset implementation for FileShareDataset. +func (fsd FileShareDataset) AsQuickBooksObjectDataset() (*QuickBooksObjectDataset, bool) { + return nil, false +} + +// AsPrestoObjectDataset is the BasicDataset implementation for FileShareDataset. +func (fsd FileShareDataset) AsPrestoObjectDataset() (*PrestoObjectDataset, bool) { + return nil, false +} + +// AsPhoenixObjectDataset is the BasicDataset implementation for FileShareDataset. +func (fsd FileShareDataset) AsPhoenixObjectDataset() (*PhoenixObjectDataset, bool) { + return nil, false +} + +// AsPaypalObjectDataset is the BasicDataset implementation for FileShareDataset. +func (fsd FileShareDataset) AsPaypalObjectDataset() (*PaypalObjectDataset, bool) { + return nil, false +} + +// AsMarketoObjectDataset is the BasicDataset implementation for FileShareDataset. +func (fsd FileShareDataset) AsMarketoObjectDataset() (*MarketoObjectDataset, bool) { + return nil, false +} + +// AsMariaDBTableDataset is the BasicDataset implementation for FileShareDataset. +func (fsd FileShareDataset) AsMariaDBTableDataset() (*MariaDBTableDataset, bool) { + return nil, false +} + +// AsMagentoObjectDataset is the BasicDataset implementation for FileShareDataset. +func (fsd FileShareDataset) AsMagentoObjectDataset() (*MagentoObjectDataset, bool) { + return nil, false +} + +// AsJiraObjectDataset is the BasicDataset implementation for FileShareDataset. +func (fsd FileShareDataset) AsJiraObjectDataset() (*JiraObjectDataset, bool) { + return nil, false +} + +// AsImpalaObjectDataset is the BasicDataset implementation for FileShareDataset. +func (fsd FileShareDataset) AsImpalaObjectDataset() (*ImpalaObjectDataset, bool) { + return nil, false +} + +// AsHubspotObjectDataset is the BasicDataset implementation for FileShareDataset. +func (fsd FileShareDataset) AsHubspotObjectDataset() (*HubspotObjectDataset, bool) { + return nil, false +} + +// AsHiveObjectDataset is the BasicDataset implementation for FileShareDataset. +func (fsd FileShareDataset) AsHiveObjectDataset() (*HiveObjectDataset, bool) { + return nil, false +} + +// AsHBaseObjectDataset is the BasicDataset implementation for FileShareDataset. +func (fsd FileShareDataset) AsHBaseObjectDataset() (*HBaseObjectDataset, bool) { + return nil, false +} + +// AsGreenplumTableDataset is the BasicDataset implementation for FileShareDataset. +func (fsd FileShareDataset) AsGreenplumTableDataset() (*GreenplumTableDataset, bool) { + return nil, false +} + +// AsGoogleBigQueryObjectDataset is the BasicDataset implementation for FileShareDataset. +func (fsd FileShareDataset) AsGoogleBigQueryObjectDataset() (*GoogleBigQueryObjectDataset, bool) { + return nil, false +} + +// AsEloquaObjectDataset is the BasicDataset implementation for FileShareDataset. +func (fsd FileShareDataset) AsEloquaObjectDataset() (*EloquaObjectDataset, bool) { + return nil, false +} + +// AsDrillTableDataset is the BasicDataset implementation for FileShareDataset. +func (fsd FileShareDataset) AsDrillTableDataset() (*DrillTableDataset, bool) { + return nil, false +} + +// AsCouchbaseTableDataset is the BasicDataset implementation for FileShareDataset. +func (fsd FileShareDataset) AsCouchbaseTableDataset() (*CouchbaseTableDataset, bool) { + return nil, false +} + +// AsConcurObjectDataset is the BasicDataset implementation for FileShareDataset. +func (fsd FileShareDataset) AsConcurObjectDataset() (*ConcurObjectDataset, bool) { + return nil, false +} + +// AsAzurePostgreSQLTableDataset is the BasicDataset implementation for FileShareDataset. +func (fsd FileShareDataset) AsAzurePostgreSQLTableDataset() (*AzurePostgreSQLTableDataset, bool) { + return nil, false +} + +// AsAmazonMWSObjectDataset is the BasicDataset implementation for FileShareDataset. +func (fsd FileShareDataset) AsAmazonMWSObjectDataset() (*AmazonMWSObjectDataset, bool) { + return nil, false +} + +// AsHTTPDataset is the BasicDataset implementation for FileShareDataset. +func (fsd FileShareDataset) AsHTTPDataset() (*HTTPDataset, bool) { + return nil, false +} + +// AsAzureSearchIndexDataset is the BasicDataset implementation for FileShareDataset. +func (fsd FileShareDataset) AsAzureSearchIndexDataset() (*AzureSearchIndexDataset, bool) { + return nil, false +} + +// AsWebTableDataset is the BasicDataset implementation for FileShareDataset. +func (fsd FileShareDataset) AsWebTableDataset() (*WebTableDataset, bool) { + return nil, false +} + +// AsSQLServerTableDataset is the BasicDataset implementation for FileShareDataset. +func (fsd FileShareDataset) AsSQLServerTableDataset() (*SQLServerTableDataset, bool) { + return nil, false +} + +// AsSapEccResourceDataset is the BasicDataset implementation for FileShareDataset. +func (fsd FileShareDataset) AsSapEccResourceDataset() (*SapEccResourceDataset, bool) { + return nil, false +} + +// AsSapCloudForCustomerResourceDataset is the BasicDataset implementation for FileShareDataset. +func (fsd FileShareDataset) AsSapCloudForCustomerResourceDataset() (*SapCloudForCustomerResourceDataset, bool) { + return nil, false +} + +// AsSalesforceObjectDataset is the BasicDataset implementation for FileShareDataset. +func (fsd FileShareDataset) AsSalesforceObjectDataset() (*SalesforceObjectDataset, bool) { + return nil, false +} + +// AsRelationalTableDataset is the BasicDataset implementation for FileShareDataset. +func (fsd FileShareDataset) AsRelationalTableDataset() (*RelationalTableDataset, bool) { + return nil, false +} + +// AsAzureMySQLTableDataset is the BasicDataset implementation for FileShareDataset. +func (fsd FileShareDataset) AsAzureMySQLTableDataset() (*AzureMySQLTableDataset, bool) { + return nil, false +} + +// AsOracleTableDataset is the BasicDataset implementation for FileShareDataset. +func (fsd FileShareDataset) AsOracleTableDataset() (*OracleTableDataset, bool) { + return nil, false +} + +// AsODataResourceDataset is the BasicDataset implementation for FileShareDataset. +func (fsd FileShareDataset) AsODataResourceDataset() (*ODataResourceDataset, bool) { + return nil, false +} + +// AsMongoDbCollectionDataset is the BasicDataset implementation for FileShareDataset. +func (fsd FileShareDataset) AsMongoDbCollectionDataset() (*MongoDbCollectionDataset, bool) { + return nil, false +} + +// AsFileShareDataset is the BasicDataset implementation for FileShareDataset. +func (fsd FileShareDataset) AsFileShareDataset() (*FileShareDataset, bool) { + return &fsd, true +} + +// AsAzureDataLakeStoreDataset is the BasicDataset implementation for FileShareDataset. +func (fsd FileShareDataset) AsAzureDataLakeStoreDataset() (*AzureDataLakeStoreDataset, bool) { + return nil, false +} + +// AsDynamicsEntityDataset is the BasicDataset implementation for FileShareDataset. +func (fsd FileShareDataset) AsDynamicsEntityDataset() (*DynamicsEntityDataset, bool) { + return nil, false +} + +// AsDocumentDbCollectionDataset is the BasicDataset implementation for FileShareDataset. +func (fsd FileShareDataset) AsDocumentDbCollectionDataset() (*DocumentDbCollectionDataset, bool) { + return nil, false +} + +// AsCustomDataset is the BasicDataset implementation for FileShareDataset. +func (fsd FileShareDataset) AsCustomDataset() (*CustomDataset, bool) { + return nil, false +} + +// AsCassandraTableDataset is the BasicDataset implementation for FileShareDataset. +func (fsd FileShareDataset) AsCassandraTableDataset() (*CassandraTableDataset, bool) { + return nil, false +} + +// AsAzureSQLDWTableDataset is the BasicDataset implementation for FileShareDataset. +func (fsd FileShareDataset) AsAzureSQLDWTableDataset() (*AzureSQLDWTableDataset, bool) { + return nil, false +} + +// AsAzureSQLTableDataset is the BasicDataset implementation for FileShareDataset. +func (fsd FileShareDataset) AsAzureSQLTableDataset() (*AzureSQLTableDataset, bool) { + return nil, false +} + +// AsAzureTableDataset is the BasicDataset implementation for FileShareDataset. +func (fsd FileShareDataset) AsAzureTableDataset() (*AzureTableDataset, bool) { + return nil, false +} + +// AsAzureBlobDataset is the BasicDataset implementation for FileShareDataset. +func (fsd FileShareDataset) AsAzureBlobDataset() (*AzureBlobDataset, bool) { + return nil, false +} + +// AsAmazonS3Dataset is the BasicDataset implementation for FileShareDataset. +func (fsd FileShareDataset) AsAmazonS3Dataset() (*AmazonS3Dataset, bool) { + return nil, false +} + +// AsDataset is the BasicDataset implementation for FileShareDataset. +func (fsd FileShareDataset) AsDataset() (*Dataset, bool) { + return nil, false +} + +// AsBasicDataset is the BasicDataset implementation for FileShareDataset. +func (fsd FileShareDataset) AsBasicDataset() (BasicDataset, bool) { + return &fsd, true +} + +// UnmarshalJSON is the custom unmarshaler for FileShareDataset struct. +func (fsd *FileShareDataset) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "typeProperties": + if v != nil { + var fileShareDatasetTypeProperties FileShareDatasetTypeProperties + err = json.Unmarshal(*v, &fileShareDatasetTypeProperties) + if err != nil { + return err + } + fsd.FileShareDatasetTypeProperties = &fileShareDatasetTypeProperties + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if fsd.AdditionalProperties == nil { + fsd.AdditionalProperties = make(map[string]interface{}) + } + fsd.AdditionalProperties[k] = additionalProperties + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + fsd.Description = &description + } + case "structure": + if v != nil { + var structure interface{} + err = json.Unmarshal(*v, &structure) + if err != nil { + return err + } + fsd.Structure = structure + } + case "linkedServiceName": + if v != nil { + var linkedServiceName LinkedServiceReference + err = json.Unmarshal(*v, &linkedServiceName) + if err != nil { + return err + } + fsd.LinkedServiceName = &linkedServiceName + } + case "parameters": + if v != nil { + var parameters map[string]*ParameterSpecification + err = json.Unmarshal(*v, ¶meters) + if err != nil { + return err + } + fsd.Parameters = parameters + } + case "annotations": + if v != nil { + var annotations []interface{} + err = json.Unmarshal(*v, &annotations) + if err != nil { + return err + } + fsd.Annotations = &annotations + } + case "type": + if v != nil { + var typeVar TypeBasicDataset + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + fsd.Type = typeVar + } + } + } + + return nil +} + +// FileShareDatasetTypeProperties on-premises file system dataset properties. +type FileShareDatasetTypeProperties struct { + // FolderPath - The path of the on-premises file system. Type: string (or Expression with resultType string). + FolderPath interface{} `json:"folderPath,omitempty"` + // FileName - The name of the on-premises file system. Type: string (or Expression with resultType string). + FileName interface{} `json:"fileName,omitempty"` + // Format - The format of the files. + Format BasicDatasetStorageFormat `json:"format,omitempty"` + // FileFilter - Specify a filter to be used to select a subset of files in the folderPath rather than all files. Type: string (or Expression with resultType string). + FileFilter interface{} `json:"fileFilter,omitempty"` + // Compression - The data compression method used for the file system. + Compression BasicDatasetCompression `json:"compression,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for FileShareDatasetTypeProperties struct. +func (fsdtp *FileShareDatasetTypeProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "folderPath": + if v != nil { + var folderPath interface{} + err = json.Unmarshal(*v, &folderPath) + if err != nil { + return err + } + fsdtp.FolderPath = folderPath + } + case "fileName": + if v != nil { + var fileName interface{} + err = json.Unmarshal(*v, &fileName) + if err != nil { + return err + } + fsdtp.FileName = fileName + } + case "format": + if v != nil { + formatVar, err := unmarshalBasicDatasetStorageFormat(*v) + if err != nil { + return err + } + fsdtp.Format = formatVar + } + case "fileFilter": + if v != nil { + var fileFilter interface{} + err = json.Unmarshal(*v, &fileFilter) + if err != nil { + return err + } + fsdtp.FileFilter = fileFilter + } + case "compression": + if v != nil { + compression, err := unmarshalBasicDatasetCompression(*v) + if err != nil { + return err + } + fsdtp.Compression = compression + } + } + } + + return nil +} + +// FileSystemSink a copy activity file system sink. +type FileSystemSink struct { + // CopyBehavior - The type of copy behavior for copy sink. Possible values include: 'PreserveHierarchy', 'FlattenHierarchy', 'MergeFiles' + CopyBehavior CopyBehaviorType `json:"copyBehavior,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // WriteBatchSize - Write batch size. Type: integer (or Expression with resultType integer), minimum: 0. + WriteBatchSize interface{} `json:"writeBatchSize,omitempty"` + // WriteBatchTimeout - Write batch timeout. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + WriteBatchTimeout interface{} `json:"writeBatchTimeout,omitempty"` + // SinkRetryCount - Sink retry count. Type: integer (or Expression with resultType integer). + SinkRetryCount interface{} `json:"sinkRetryCount,omitempty"` + // SinkRetryWait - Sink retry wait. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + SinkRetryWait interface{} `json:"sinkRetryWait,omitempty"` + // Type - Possible values include: 'TypeCopySink', 'TypeSalesforceSink', 'TypeDynamicsSink', 'TypeOdbcSink', 'TypeAzureSearchIndexSink', 'TypeAzureDataLakeStoreSink', 'TypeOracleSink', 'TypeSQLDWSink', 'TypeSQLSink', 'TypeDocumentDbCollectionSink', 'TypeFileSystemSink', 'TypeBlobSink', 'TypeAzureTableSink', 'TypeAzureQueueSink', 'TypeSapCloudForCustomerSink' + Type TypeBasicCopySink `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for FileSystemSink. +func (fss FileSystemSink) MarshalJSON() ([]byte, error) { + fss.Type = TypeFileSystemSink + objectMap := make(map[string]interface{}) + if fss.CopyBehavior != "" { + objectMap["copyBehavior"] = fss.CopyBehavior + } + objectMap["writeBatchSize"] = fss.WriteBatchSize + objectMap["writeBatchTimeout"] = fss.WriteBatchTimeout + objectMap["sinkRetryCount"] = fss.SinkRetryCount + objectMap["sinkRetryWait"] = fss.SinkRetryWait + if fss.Type != "" { + objectMap["type"] = fss.Type + } + for k, v := range fss.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsSalesforceSink is the BasicCopySink implementation for FileSystemSink. +func (fss FileSystemSink) AsSalesforceSink() (*SalesforceSink, bool) { + return nil, false +} + +// AsDynamicsSink is the BasicCopySink implementation for FileSystemSink. +func (fss FileSystemSink) AsDynamicsSink() (*DynamicsSink, bool) { + return nil, false +} + +// AsOdbcSink is the BasicCopySink implementation for FileSystemSink. +func (fss FileSystemSink) AsOdbcSink() (*OdbcSink, bool) { + return nil, false +} + +// AsAzureSearchIndexSink is the BasicCopySink implementation for FileSystemSink. +func (fss FileSystemSink) AsAzureSearchIndexSink() (*AzureSearchIndexSink, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSink is the BasicCopySink implementation for FileSystemSink. +func (fss FileSystemSink) AsAzureDataLakeStoreSink() (*AzureDataLakeStoreSink, bool) { + return nil, false +} + +// AsOracleSink is the BasicCopySink implementation for FileSystemSink. +func (fss FileSystemSink) AsOracleSink() (*OracleSink, bool) { + return nil, false +} + +// AsSQLDWSink is the BasicCopySink implementation for FileSystemSink. +func (fss FileSystemSink) AsSQLDWSink() (*SQLDWSink, bool) { + return nil, false +} + +// AsSQLSink is the BasicCopySink implementation for FileSystemSink. +func (fss FileSystemSink) AsSQLSink() (*SQLSink, bool) { + return nil, false +} + +// AsDocumentDbCollectionSink is the BasicCopySink implementation for FileSystemSink. +func (fss FileSystemSink) AsDocumentDbCollectionSink() (*DocumentDbCollectionSink, bool) { + return nil, false +} + +// AsFileSystemSink is the BasicCopySink implementation for FileSystemSink. +func (fss FileSystemSink) AsFileSystemSink() (*FileSystemSink, bool) { + return &fss, true +} + +// AsBlobSink is the BasicCopySink implementation for FileSystemSink. +func (fss FileSystemSink) AsBlobSink() (*BlobSink, bool) { + return nil, false +} + +// AsAzureTableSink is the BasicCopySink implementation for FileSystemSink. +func (fss FileSystemSink) AsAzureTableSink() (*AzureTableSink, bool) { + return nil, false +} + +// AsAzureQueueSink is the BasicCopySink implementation for FileSystemSink. +func (fss FileSystemSink) AsAzureQueueSink() (*AzureQueueSink, bool) { + return nil, false +} + +// AsSapCloudForCustomerSink is the BasicCopySink implementation for FileSystemSink. +func (fss FileSystemSink) AsSapCloudForCustomerSink() (*SapCloudForCustomerSink, bool) { + return nil, false +} + +// AsCopySink is the BasicCopySink implementation for FileSystemSink. +func (fss FileSystemSink) AsCopySink() (*CopySink, bool) { + return nil, false +} + +// AsBasicCopySink is the BasicCopySink implementation for FileSystemSink. +func (fss FileSystemSink) AsBasicCopySink() (BasicCopySink, bool) { + return &fss, true +} + +// FileSystemSource a copy activity file system source. +type FileSystemSource struct { + // Recursive - If true, files under the folder path will be read recursively. Default is true. Type: boolean (or Expression with resultType boolean). + Recursive interface{} `json:"recursive,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // SourceRetryCount - Source retry count. Type: integer (or Expression with resultType integer). + SourceRetryCount interface{} `json:"sourceRetryCount,omitempty"` + // SourceRetryWait - Source retry wait. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` + // Type - Possible values include: 'TypeCopySource', 'TypeAmazonRedshiftSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeHTTPSource', 'TypeAzureDataLakeStoreSource', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeRelationalSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource' + Type TypeBasicCopySource `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for FileSystemSource. +func (fss FileSystemSource) MarshalJSON() ([]byte, error) { + fss.Type = TypeFileSystemSource + objectMap := make(map[string]interface{}) + objectMap["recursive"] = fss.Recursive + objectMap["sourceRetryCount"] = fss.SourceRetryCount + objectMap["sourceRetryWait"] = fss.SourceRetryWait + if fss.Type != "" { + objectMap["type"] = fss.Type + } + for k, v := range fss.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsAmazonRedshiftSource is the BasicCopySource implementation for FileSystemSource. +func (fss FileSystemSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { + return nil, false +} + +// AsResponsysSource is the BasicCopySource implementation for FileSystemSource. +func (fss FileSystemSource) AsResponsysSource() (*ResponsysSource, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudSource is the BasicCopySource implementation for FileSystemSource. +func (fss FileSystemSource) AsSalesforceMarketingCloudSource() (*SalesforceMarketingCloudSource, bool) { + return nil, false +} + +// AsVerticaSource is the BasicCopySource implementation for FileSystemSource. +func (fss FileSystemSource) AsVerticaSource() (*VerticaSource, bool) { + return nil, false +} + +// AsNetezzaSource is the BasicCopySource implementation for FileSystemSource. +func (fss FileSystemSource) AsNetezzaSource() (*NetezzaSource, bool) { + return nil, false +} + +// AsZohoSource is the BasicCopySource implementation for FileSystemSource. +func (fss FileSystemSource) AsZohoSource() (*ZohoSource, bool) { + return nil, false +} + +// AsXeroSource is the BasicCopySource implementation for FileSystemSource. +func (fss FileSystemSource) AsXeroSource() (*XeroSource, bool) { + return nil, false +} + +// AsSquareSource is the BasicCopySource implementation for FileSystemSource. +func (fss FileSystemSource) AsSquareSource() (*SquareSource, bool) { + return nil, false +} + +// AsSparkSource is the BasicCopySource implementation for FileSystemSource. +func (fss FileSystemSource) AsSparkSource() (*SparkSource, bool) { + return nil, false +} + +// AsShopifySource is the BasicCopySource implementation for FileSystemSource. +func (fss FileSystemSource) AsShopifySource() (*ShopifySource, bool) { + return nil, false +} + +// AsServiceNowSource is the BasicCopySource implementation for FileSystemSource. +func (fss FileSystemSource) AsServiceNowSource() (*ServiceNowSource, bool) { + return nil, false +} + +// AsQuickBooksSource is the BasicCopySource implementation for FileSystemSource. +func (fss FileSystemSource) AsQuickBooksSource() (*QuickBooksSource, bool) { + return nil, false +} + +// AsPrestoSource is the BasicCopySource implementation for FileSystemSource. +func (fss FileSystemSource) AsPrestoSource() (*PrestoSource, bool) { + return nil, false +} + +// AsPhoenixSource is the BasicCopySource implementation for FileSystemSource. +func (fss FileSystemSource) AsPhoenixSource() (*PhoenixSource, bool) { + return nil, false +} + +// AsPaypalSource is the BasicCopySource implementation for FileSystemSource. +func (fss FileSystemSource) AsPaypalSource() (*PaypalSource, bool) { + return nil, false +} + +// AsMarketoSource is the BasicCopySource implementation for FileSystemSource. +func (fss FileSystemSource) AsMarketoSource() (*MarketoSource, bool) { + return nil, false +} + +// AsMariaDBSource is the BasicCopySource implementation for FileSystemSource. +func (fss FileSystemSource) AsMariaDBSource() (*MariaDBSource, bool) { + return nil, false +} + +// AsMagentoSource is the BasicCopySource implementation for FileSystemSource. +func (fss FileSystemSource) AsMagentoSource() (*MagentoSource, bool) { + return nil, false +} + +// AsJiraSource is the BasicCopySource implementation for FileSystemSource. +func (fss FileSystemSource) AsJiraSource() (*JiraSource, bool) { + return nil, false +} + +// AsImpalaSource is the BasicCopySource implementation for FileSystemSource. +func (fss FileSystemSource) AsImpalaSource() (*ImpalaSource, bool) { + return nil, false +} + +// AsHubspotSource is the BasicCopySource implementation for FileSystemSource. +func (fss FileSystemSource) AsHubspotSource() (*HubspotSource, bool) { + return nil, false +} + +// AsHiveSource is the BasicCopySource implementation for FileSystemSource. +func (fss FileSystemSource) AsHiveSource() (*HiveSource, bool) { + return nil, false +} + +// AsHBaseSource is the BasicCopySource implementation for FileSystemSource. +func (fss FileSystemSource) AsHBaseSource() (*HBaseSource, bool) { + return nil, false +} + +// AsGreenplumSource is the BasicCopySource implementation for FileSystemSource. +func (fss FileSystemSource) AsGreenplumSource() (*GreenplumSource, bool) { + return nil, false +} + +// AsGoogleBigQuerySource is the BasicCopySource implementation for FileSystemSource. +func (fss FileSystemSource) AsGoogleBigQuerySource() (*GoogleBigQuerySource, bool) { + return nil, false +} + +// AsEloquaSource is the BasicCopySource implementation for FileSystemSource. +func (fss FileSystemSource) AsEloquaSource() (*EloquaSource, bool) { + return nil, false +} + +// AsDrillSource is the BasicCopySource implementation for FileSystemSource. +func (fss FileSystemSource) AsDrillSource() (*DrillSource, bool) { + return nil, false +} + +// AsCouchbaseSource is the BasicCopySource implementation for FileSystemSource. +func (fss FileSystemSource) AsCouchbaseSource() (*CouchbaseSource, bool) { + return nil, false +} + +// AsConcurSource is the BasicCopySource implementation for FileSystemSource. +func (fss FileSystemSource) AsConcurSource() (*ConcurSource, bool) { + return nil, false +} + +// AsAzurePostgreSQLSource is the BasicCopySource implementation for FileSystemSource. +func (fss FileSystemSource) AsAzurePostgreSQLSource() (*AzurePostgreSQLSource, bool) { + return nil, false +} + +// AsAmazonMWSSource is the BasicCopySource implementation for FileSystemSource. +func (fss FileSystemSource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { + return nil, false +} + +// AsHTTPSource is the BasicCopySource implementation for FileSystemSource. +func (fss FileSystemSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for FileSystemSource. +func (fss FileSystemSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for FileSystemSource. +func (fss FileSystemSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsCassandraSource is the BasicCopySource implementation for FileSystemSource. +func (fss FileSystemSource) AsCassandraSource() (*CassandraSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for FileSystemSource. +func (fss FileSystemSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for FileSystemSource. +func (fss FileSystemSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureMySQLSource is the BasicCopySource implementation for FileSystemSource. +func (fss FileSystemSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for FileSystemSource. +func (fss FileSystemSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for FileSystemSource. +func (fss FileSystemSource) AsFileSystemSource() (*FileSystemSource, bool) { + return &fss, true +} + +// AsSQLDWSource is the BasicCopySource implementation for FileSystemSource. +func (fss FileSystemSource) AsSQLDWSource() (*SQLDWSource, bool) { + return nil, false +} + +// AsSQLSource is the BasicCopySource implementation for FileSystemSource. +func (fss FileSystemSource) AsSQLSource() (*SQLSource, bool) { + return nil, false +} + +// AsSapEccSource is the BasicCopySource implementation for FileSystemSource. +func (fss FileSystemSource) AsSapEccSource() (*SapEccSource, bool) { + return nil, false +} + +// AsSapCloudForCustomerSource is the BasicCopySource implementation for FileSystemSource. +func (fss FileSystemSource) AsSapCloudForCustomerSource() (*SapCloudForCustomerSource, bool) { + return nil, false +} + +// AsSalesforceSource is the BasicCopySource implementation for FileSystemSource. +func (fss FileSystemSource) AsSalesforceSource() (*SalesforceSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for FileSystemSource. +func (fss FileSystemSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for FileSystemSource. +func (fss FileSystemSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for FileSystemSource. +func (fss FileSystemSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for FileSystemSource. +func (fss FileSystemSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + +// AsAzureTableSource is the BasicCopySource implementation for FileSystemSource. +func (fss FileSystemSource) AsAzureTableSource() (*AzureTableSource, bool) { + return nil, false +} + +// AsCopySource is the BasicCopySource implementation for FileSystemSource. +func (fss FileSystemSource) AsCopySource() (*CopySource, bool) { + return nil, false +} + +// AsBasicCopySource is the BasicCopySource implementation for FileSystemSource. +func (fss FileSystemSource) AsBasicCopySource() (BasicCopySource, bool) { + return &fss, true +} + +// FilterActivity filter and return results from input array based on the conditions. +type FilterActivity struct { + // FilterActivityTypeProperties - Filter activity properties. + *FilterActivityTypeProperties `json:"typeProperties,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Name - Activity name. + Name *string `json:"name,omitempty"` + // Description - Activity description. + Description *string `json:"description,omitempty"` + // DependsOn - Activity depends on condition. + DependsOn *[]ActivityDependency `json:"dependsOn,omitempty"` + // UserProperties - Activity user properties. + UserProperties map[string]*string `json:"userProperties"` + // Type - Possible values include: 'TypeActivity', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLUpdateResource', 'TypeAzureMLBatchExecution', 'TypeGetMetadata', 'TypeWebActivity', 'TypeLookup', 'TypeSQLServerStoredProcedure', 'TypeCustom', 'TypeExecuteSSISPackage', 'TypeHDInsightSpark', 'TypeHDInsightStreaming', 'TypeHDInsightMapReduce', 'TypeHDInsightPig', 'TypeHDInsightHive', 'TypeCopy', 'TypeExecution', 'TypeFilter', 'TypeUntil', 'TypeWait', 'TypeForEach', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' + Type TypeBasicActivity `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for FilterActivity. +func (fa FilterActivity) MarshalJSON() ([]byte, error) { + fa.Type = TypeFilter + objectMap := make(map[string]interface{}) + if fa.FilterActivityTypeProperties != nil { + objectMap["typeProperties"] = fa.FilterActivityTypeProperties + } + if fa.Name != nil { + objectMap["name"] = fa.Name + } + if fa.Description != nil { + objectMap["description"] = fa.Description + } + if fa.DependsOn != nil { + objectMap["dependsOn"] = fa.DependsOn + } + if fa.UserProperties != nil { + objectMap["userProperties"] = fa.UserProperties + } + if fa.Type != "" { + objectMap["type"] = fa.Type + } + for k, v := range fa.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsDatabricksNotebookActivity is the BasicActivity implementation for FilterActivity. +func (fa FilterActivity) AsDatabricksNotebookActivity() (*DatabricksNotebookActivity, bool) { + return nil, false +} + +// AsDataLakeAnalyticsUSQLActivity is the BasicActivity implementation for FilterActivity. +func (fa FilterActivity) AsDataLakeAnalyticsUSQLActivity() (*DataLakeAnalyticsUSQLActivity, bool) { + return nil, false +} + +// AsAzureMLUpdateResourceActivity is the BasicActivity implementation for FilterActivity. +func (fa FilterActivity) AsAzureMLUpdateResourceActivity() (*AzureMLUpdateResourceActivity, bool) { + return nil, false +} + +// AsAzureMLBatchExecutionActivity is the BasicActivity implementation for FilterActivity. +func (fa FilterActivity) AsAzureMLBatchExecutionActivity() (*AzureMLBatchExecutionActivity, bool) { + return nil, false +} + +// AsGetMetadataActivity is the BasicActivity implementation for FilterActivity. +func (fa FilterActivity) AsGetMetadataActivity() (*GetMetadataActivity, bool) { + return nil, false +} + +// AsWebActivity is the BasicActivity implementation for FilterActivity. +func (fa FilterActivity) AsWebActivity() (*WebActivity, bool) { + return nil, false +} + +// AsLookupActivity is the BasicActivity implementation for FilterActivity. +func (fa FilterActivity) AsLookupActivity() (*LookupActivity, bool) { + return nil, false +} + +// AsSQLServerStoredProcedureActivity is the BasicActivity implementation for FilterActivity. +func (fa FilterActivity) AsSQLServerStoredProcedureActivity() (*SQLServerStoredProcedureActivity, bool) { + return nil, false +} + +// AsCustomActivity is the BasicActivity implementation for FilterActivity. +func (fa FilterActivity) AsCustomActivity() (*CustomActivity, bool) { + return nil, false +} + +// AsExecuteSSISPackageActivity is the BasicActivity implementation for FilterActivity. +func (fa FilterActivity) AsExecuteSSISPackageActivity() (*ExecuteSSISPackageActivity, bool) { + return nil, false +} + +// AsHDInsightSparkActivity is the BasicActivity implementation for FilterActivity. +func (fa FilterActivity) AsHDInsightSparkActivity() (*HDInsightSparkActivity, bool) { + return nil, false +} + +// AsHDInsightStreamingActivity is the BasicActivity implementation for FilterActivity. +func (fa FilterActivity) AsHDInsightStreamingActivity() (*HDInsightStreamingActivity, bool) { + return nil, false +} + +// AsHDInsightMapReduceActivity is the BasicActivity implementation for FilterActivity. +func (fa FilterActivity) AsHDInsightMapReduceActivity() (*HDInsightMapReduceActivity, bool) { + return nil, false +} + +// AsHDInsightPigActivity is the BasicActivity implementation for FilterActivity. +func (fa FilterActivity) AsHDInsightPigActivity() (*HDInsightPigActivity, bool) { + return nil, false +} + +// AsHDInsightHiveActivity is the BasicActivity implementation for FilterActivity. +func (fa FilterActivity) AsHDInsightHiveActivity() (*HDInsightHiveActivity, bool) { + return nil, false +} + +// AsCopyActivity is the BasicActivity implementation for FilterActivity. +func (fa FilterActivity) AsCopyActivity() (*CopyActivity, bool) { + return nil, false +} + +// AsExecutionActivity is the BasicActivity implementation for FilterActivity. +func (fa FilterActivity) AsExecutionActivity() (*ExecutionActivity, bool) { + return nil, false +} + +// AsBasicExecutionActivity is the BasicActivity implementation for FilterActivity. +func (fa FilterActivity) AsBasicExecutionActivity() (BasicExecutionActivity, bool) { + return nil, false +} + +// AsFilterActivity is the BasicActivity implementation for FilterActivity. +func (fa FilterActivity) AsFilterActivity() (*FilterActivity, bool) { + return &fa, true +} + +// AsUntilActivity is the BasicActivity implementation for FilterActivity. +func (fa FilterActivity) AsUntilActivity() (*UntilActivity, bool) { + return nil, false +} + +// AsWaitActivity is the BasicActivity implementation for FilterActivity. +func (fa FilterActivity) AsWaitActivity() (*WaitActivity, bool) { + return nil, false +} + +// AsForEachActivity is the BasicActivity implementation for FilterActivity. +func (fa FilterActivity) AsForEachActivity() (*ForEachActivity, bool) { + return nil, false +} + +// AsIfConditionActivity is the BasicActivity implementation for FilterActivity. +func (fa FilterActivity) AsIfConditionActivity() (*IfConditionActivity, bool) { + return nil, false +} + +// AsExecutePipelineActivity is the BasicActivity implementation for FilterActivity. +func (fa FilterActivity) AsExecutePipelineActivity() (*ExecutePipelineActivity, bool) { + return nil, false +} + +// AsControlActivity is the BasicActivity implementation for FilterActivity. +func (fa FilterActivity) AsControlActivity() (*ControlActivity, bool) { + return nil, false +} + +// AsBasicControlActivity is the BasicActivity implementation for FilterActivity. +func (fa FilterActivity) AsBasicControlActivity() (BasicControlActivity, bool) { + return &fa, true +} + +// AsActivity is the BasicActivity implementation for FilterActivity. +func (fa FilterActivity) AsActivity() (*Activity, bool) { + return nil, false +} + +// AsBasicActivity is the BasicActivity implementation for FilterActivity. +func (fa FilterActivity) AsBasicActivity() (BasicActivity, bool) { + return &fa, true +} + +// UnmarshalJSON is the custom unmarshaler for FilterActivity struct. +func (fa *FilterActivity) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "typeProperties": + if v != nil { + var filterActivityTypeProperties FilterActivityTypeProperties + err = json.Unmarshal(*v, &filterActivityTypeProperties) + if err != nil { + return err + } + fa.FilterActivityTypeProperties = &filterActivityTypeProperties + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if fa.AdditionalProperties == nil { + fa.AdditionalProperties = make(map[string]interface{}) + } + fa.AdditionalProperties[k] = additionalProperties + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + fa.Name = &name + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + fa.Description = &description + } + case "dependsOn": + if v != nil { + var dependsOn []ActivityDependency + err = json.Unmarshal(*v, &dependsOn) + if err != nil { + return err + } + fa.DependsOn = &dependsOn + } + case "userProperties": + if v != nil { + var userProperties map[string]*string + err = json.Unmarshal(*v, &userProperties) + if err != nil { + return err + } + fa.UserProperties = userProperties + } + case "type": + if v != nil { + var typeVar TypeBasicActivity + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + fa.Type = typeVar + } + } + } + + return nil +} + +// FilterActivityTypeProperties fitler activity properties. +type FilterActivityTypeProperties struct { + // Items - Input array on which filter should be applied. + Items *Expression `json:"items,omitempty"` + // Condition - Condition to be used for filtering the input. + Condition *Expression `json:"condition,omitempty"` +} + +// ForEachActivity this activity is used for iterating over a collection and execute given activities. +type ForEachActivity struct { + // ForEachActivityTypeProperties - ForEach activity properties. + *ForEachActivityTypeProperties `json:"typeProperties,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Name - Activity name. + Name *string `json:"name,omitempty"` + // Description - Activity description. + Description *string `json:"description,omitempty"` + // DependsOn - Activity depends on condition. + DependsOn *[]ActivityDependency `json:"dependsOn,omitempty"` + // UserProperties - Activity user properties. + UserProperties map[string]*string `json:"userProperties"` + // Type - Possible values include: 'TypeActivity', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLUpdateResource', 'TypeAzureMLBatchExecution', 'TypeGetMetadata', 'TypeWebActivity', 'TypeLookup', 'TypeSQLServerStoredProcedure', 'TypeCustom', 'TypeExecuteSSISPackage', 'TypeHDInsightSpark', 'TypeHDInsightStreaming', 'TypeHDInsightMapReduce', 'TypeHDInsightPig', 'TypeHDInsightHive', 'TypeCopy', 'TypeExecution', 'TypeFilter', 'TypeUntil', 'TypeWait', 'TypeForEach', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' + Type TypeBasicActivity `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ForEachActivity. +func (fea ForEachActivity) MarshalJSON() ([]byte, error) { + fea.Type = TypeForEach + objectMap := make(map[string]interface{}) + if fea.ForEachActivityTypeProperties != nil { + objectMap["typeProperties"] = fea.ForEachActivityTypeProperties + } + if fea.Name != nil { + objectMap["name"] = fea.Name + } + if fea.Description != nil { + objectMap["description"] = fea.Description + } + if fea.DependsOn != nil { + objectMap["dependsOn"] = fea.DependsOn + } + if fea.UserProperties != nil { + objectMap["userProperties"] = fea.UserProperties + } + if fea.Type != "" { + objectMap["type"] = fea.Type + } + for k, v := range fea.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsDatabricksNotebookActivity is the BasicActivity implementation for ForEachActivity. +func (fea ForEachActivity) AsDatabricksNotebookActivity() (*DatabricksNotebookActivity, bool) { + return nil, false +} + +// AsDataLakeAnalyticsUSQLActivity is the BasicActivity implementation for ForEachActivity. +func (fea ForEachActivity) AsDataLakeAnalyticsUSQLActivity() (*DataLakeAnalyticsUSQLActivity, bool) { + return nil, false +} + +// AsAzureMLUpdateResourceActivity is the BasicActivity implementation for ForEachActivity. +func (fea ForEachActivity) AsAzureMLUpdateResourceActivity() (*AzureMLUpdateResourceActivity, bool) { + return nil, false +} + +// AsAzureMLBatchExecutionActivity is the BasicActivity implementation for ForEachActivity. +func (fea ForEachActivity) AsAzureMLBatchExecutionActivity() (*AzureMLBatchExecutionActivity, bool) { + return nil, false +} + +// AsGetMetadataActivity is the BasicActivity implementation for ForEachActivity. +func (fea ForEachActivity) AsGetMetadataActivity() (*GetMetadataActivity, bool) { + return nil, false +} + +// AsWebActivity is the BasicActivity implementation for ForEachActivity. +func (fea ForEachActivity) AsWebActivity() (*WebActivity, bool) { + return nil, false +} + +// AsLookupActivity is the BasicActivity implementation for ForEachActivity. +func (fea ForEachActivity) AsLookupActivity() (*LookupActivity, bool) { + return nil, false +} + +// AsSQLServerStoredProcedureActivity is the BasicActivity implementation for ForEachActivity. +func (fea ForEachActivity) AsSQLServerStoredProcedureActivity() (*SQLServerStoredProcedureActivity, bool) { + return nil, false +} + +// AsCustomActivity is the BasicActivity implementation for ForEachActivity. +func (fea ForEachActivity) AsCustomActivity() (*CustomActivity, bool) { + return nil, false +} + +// AsExecuteSSISPackageActivity is the BasicActivity implementation for ForEachActivity. +func (fea ForEachActivity) AsExecuteSSISPackageActivity() (*ExecuteSSISPackageActivity, bool) { + return nil, false +} + +// AsHDInsightSparkActivity is the BasicActivity implementation for ForEachActivity. +func (fea ForEachActivity) AsHDInsightSparkActivity() (*HDInsightSparkActivity, bool) { + return nil, false +} + +// AsHDInsightStreamingActivity is the BasicActivity implementation for ForEachActivity. +func (fea ForEachActivity) AsHDInsightStreamingActivity() (*HDInsightStreamingActivity, bool) { + return nil, false +} + +// AsHDInsightMapReduceActivity is the BasicActivity implementation for ForEachActivity. +func (fea ForEachActivity) AsHDInsightMapReduceActivity() (*HDInsightMapReduceActivity, bool) { + return nil, false +} + +// AsHDInsightPigActivity is the BasicActivity implementation for ForEachActivity. +func (fea ForEachActivity) AsHDInsightPigActivity() (*HDInsightPigActivity, bool) { + return nil, false +} + +// AsHDInsightHiveActivity is the BasicActivity implementation for ForEachActivity. +func (fea ForEachActivity) AsHDInsightHiveActivity() (*HDInsightHiveActivity, bool) { + return nil, false +} + +// AsCopyActivity is the BasicActivity implementation for ForEachActivity. +func (fea ForEachActivity) AsCopyActivity() (*CopyActivity, bool) { + return nil, false +} + +// AsExecutionActivity is the BasicActivity implementation for ForEachActivity. +func (fea ForEachActivity) AsExecutionActivity() (*ExecutionActivity, bool) { + return nil, false +} + +// AsBasicExecutionActivity is the BasicActivity implementation for ForEachActivity. +func (fea ForEachActivity) AsBasicExecutionActivity() (BasicExecutionActivity, bool) { + return nil, false +} + +// AsFilterActivity is the BasicActivity implementation for ForEachActivity. +func (fea ForEachActivity) AsFilterActivity() (*FilterActivity, bool) { + return nil, false +} + +// AsUntilActivity is the BasicActivity implementation for ForEachActivity. +func (fea ForEachActivity) AsUntilActivity() (*UntilActivity, bool) { + return nil, false +} + +// AsWaitActivity is the BasicActivity implementation for ForEachActivity. +func (fea ForEachActivity) AsWaitActivity() (*WaitActivity, bool) { + return nil, false +} + +// AsForEachActivity is the BasicActivity implementation for ForEachActivity. +func (fea ForEachActivity) AsForEachActivity() (*ForEachActivity, bool) { + return &fea, true +} + +// AsIfConditionActivity is the BasicActivity implementation for ForEachActivity. +func (fea ForEachActivity) AsIfConditionActivity() (*IfConditionActivity, bool) { + return nil, false +} + +// AsExecutePipelineActivity is the BasicActivity implementation for ForEachActivity. +func (fea ForEachActivity) AsExecutePipelineActivity() (*ExecutePipelineActivity, bool) { + return nil, false +} + +// AsControlActivity is the BasicActivity implementation for ForEachActivity. +func (fea ForEachActivity) AsControlActivity() (*ControlActivity, bool) { + return nil, false +} + +// AsBasicControlActivity is the BasicActivity implementation for ForEachActivity. +func (fea ForEachActivity) AsBasicControlActivity() (BasicControlActivity, bool) { + return &fea, true +} + +// AsActivity is the BasicActivity implementation for ForEachActivity. +func (fea ForEachActivity) AsActivity() (*Activity, bool) { + return nil, false +} + +// AsBasicActivity is the BasicActivity implementation for ForEachActivity. +func (fea ForEachActivity) AsBasicActivity() (BasicActivity, bool) { + return &fea, true +} + +// UnmarshalJSON is the custom unmarshaler for ForEachActivity struct. +func (fea *ForEachActivity) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "typeProperties": + if v != nil { + var forEachActivityTypeProperties ForEachActivityTypeProperties + err = json.Unmarshal(*v, &forEachActivityTypeProperties) + if err != nil { + return err + } + fea.ForEachActivityTypeProperties = &forEachActivityTypeProperties + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if fea.AdditionalProperties == nil { + fea.AdditionalProperties = make(map[string]interface{}) + } + fea.AdditionalProperties[k] = additionalProperties + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + fea.Name = &name + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + fea.Description = &description + } + case "dependsOn": + if v != nil { + var dependsOn []ActivityDependency + err = json.Unmarshal(*v, &dependsOn) + if err != nil { + return err + } + fea.DependsOn = &dependsOn + } + case "userProperties": + if v != nil { + var userProperties map[string]*string + err = json.Unmarshal(*v, &userProperties) + if err != nil { + return err + } + fea.UserProperties = userProperties + } + case "type": + if v != nil { + var typeVar TypeBasicActivity + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + fea.Type = typeVar + } + } + } + + return nil +} + +// ForEachActivityTypeProperties forEach activity properties. +type ForEachActivityTypeProperties struct { + // IsSequential - Should the loop be executed in sequence or in parallel (max 50) + IsSequential *bool `json:"isSequential,omitempty"` + // BatchCount - Batch count to be used for controlling the number of parallel execution (when isSequential is set to false). + BatchCount *int32 `json:"batchCount,omitempty"` + // Items - Collection to iterate. + Items *Expression `json:"items,omitempty"` + // Activities - List of activities to execute . + Activities *[]BasicActivity `json:"activities,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for ForEachActivityTypeProperties struct. +func (featp *ForEachActivityTypeProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "isSequential": + if v != nil { + var isSequential bool + err = json.Unmarshal(*v, &isSequential) + if err != nil { + return err + } + featp.IsSequential = &isSequential + } + case "batchCount": + if v != nil { + var batchCount int32 + err = json.Unmarshal(*v, &batchCount) + if err != nil { + return err + } + featp.BatchCount = &batchCount + } + case "items": + if v != nil { + var items Expression + err = json.Unmarshal(*v, &items) + if err != nil { + return err + } + featp.Items = &items + } + case "activities": + if v != nil { + activities, err := unmarshalBasicActivityArray(*v) + if err != nil { + return err + } + featp.Activities = &activities + } + } + } + + return nil +} + +// FtpServerLinkedService a FTP server Linked Service. +type FtpServerLinkedService struct { + // FtpServerLinkedServiceTypeProperties - Properties specific to this linked service type. + *FtpServerLinkedServiceTypeProperties `json:"typeProperties,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // ConnectVia - The integration runtime reference. + ConnectVia *IntegrationRuntimeReference `json:"connectVia,omitempty"` + // Description - Linked service description. + Description *string `json:"description,omitempty"` + // Parameters - Parameters for linked service. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeLinkedService', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforce', 'TypeAzureDataLakeStore', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureStorage' + Type TypeBasicLinkedService `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for FtpServerLinkedService. +func (fsls FtpServerLinkedService) MarshalJSON() ([]byte, error) { + fsls.Type = TypeFtpServer + objectMap := make(map[string]interface{}) + if fsls.FtpServerLinkedServiceTypeProperties != nil { + objectMap["typeProperties"] = fsls.FtpServerLinkedServiceTypeProperties + } + if fsls.ConnectVia != nil { + objectMap["connectVia"] = fsls.ConnectVia + } + if fsls.Description != nil { + objectMap["description"] = fsls.Description + } + if fsls.Parameters != nil { + objectMap["parameters"] = fsls.Parameters + } + if fsls.Annotations != nil { + objectMap["annotations"] = fsls.Annotations + } + if fsls.Type != "" { + objectMap["type"] = fsls.Type + } + for k, v := range fsls.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysLinkedService is the BasicLinkedService implementation for FtpServerLinkedService. +func (fsls FtpServerLinkedService) AsResponsysLinkedService() (*ResponsysLinkedService, bool) { + return nil, false +} + +// AsAzureDatabricksLinkedService is the BasicLinkedService implementation for FtpServerLinkedService. +func (fsls FtpServerLinkedService) AsAzureDatabricksLinkedService() (*AzureDatabricksLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeAnalyticsLinkedService is the BasicLinkedService implementation for FtpServerLinkedService. +func (fsls FtpServerLinkedService) AsAzureDataLakeAnalyticsLinkedService() (*AzureDataLakeAnalyticsLinkedService, bool) { + return nil, false +} + +// AsHDInsightOnDemandLinkedService is the BasicLinkedService implementation for FtpServerLinkedService. +func (fsls FtpServerLinkedService) AsHDInsightOnDemandLinkedService() (*HDInsightOnDemandLinkedService, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudLinkedService is the BasicLinkedService implementation for FtpServerLinkedService. +func (fsls FtpServerLinkedService) AsSalesforceMarketingCloudLinkedService() (*SalesforceMarketingCloudLinkedService, bool) { + return nil, false +} + +// AsNetezzaLinkedService is the BasicLinkedService implementation for FtpServerLinkedService. +func (fsls FtpServerLinkedService) AsNetezzaLinkedService() (*NetezzaLinkedService, bool) { + return nil, false +} + +// AsVerticaLinkedService is the BasicLinkedService implementation for FtpServerLinkedService. +func (fsls FtpServerLinkedService) AsVerticaLinkedService() (*VerticaLinkedService, bool) { + return nil, false +} + +// AsZohoLinkedService is the BasicLinkedService implementation for FtpServerLinkedService. +func (fsls FtpServerLinkedService) AsZohoLinkedService() (*ZohoLinkedService, bool) { + return nil, false +} + +// AsXeroLinkedService is the BasicLinkedService implementation for FtpServerLinkedService. +func (fsls FtpServerLinkedService) AsXeroLinkedService() (*XeroLinkedService, bool) { + return nil, false +} + +// AsSquareLinkedService is the BasicLinkedService implementation for FtpServerLinkedService. +func (fsls FtpServerLinkedService) AsSquareLinkedService() (*SquareLinkedService, bool) { + return nil, false +} + +// AsSparkLinkedService is the BasicLinkedService implementation for FtpServerLinkedService. +func (fsls FtpServerLinkedService) AsSparkLinkedService() (*SparkLinkedService, bool) { + return nil, false +} + +// AsShopifyLinkedService is the BasicLinkedService implementation for FtpServerLinkedService. +func (fsls FtpServerLinkedService) AsShopifyLinkedService() (*ShopifyLinkedService, bool) { + return nil, false +} + +// AsServiceNowLinkedService is the BasicLinkedService implementation for FtpServerLinkedService. +func (fsls FtpServerLinkedService) AsServiceNowLinkedService() (*ServiceNowLinkedService, bool) { + return nil, false +} + +// AsQuickBooksLinkedService is the BasicLinkedService implementation for FtpServerLinkedService. +func (fsls FtpServerLinkedService) AsQuickBooksLinkedService() (*QuickBooksLinkedService, bool) { + return nil, false +} + +// AsPrestoLinkedService is the BasicLinkedService implementation for FtpServerLinkedService. +func (fsls FtpServerLinkedService) AsPrestoLinkedService() (*PrestoLinkedService, bool) { + return nil, false +} + +// AsPhoenixLinkedService is the BasicLinkedService implementation for FtpServerLinkedService. +func (fsls FtpServerLinkedService) AsPhoenixLinkedService() (*PhoenixLinkedService, bool) { + return nil, false +} + +// AsPaypalLinkedService is the BasicLinkedService implementation for FtpServerLinkedService. +func (fsls FtpServerLinkedService) AsPaypalLinkedService() (*PaypalLinkedService, bool) { + return nil, false +} + +// AsMarketoLinkedService is the BasicLinkedService implementation for FtpServerLinkedService. +func (fsls FtpServerLinkedService) AsMarketoLinkedService() (*MarketoLinkedService, bool) { + return nil, false +} + +// AsMariaDBLinkedService is the BasicLinkedService implementation for FtpServerLinkedService. +func (fsls FtpServerLinkedService) AsMariaDBLinkedService() (*MariaDBLinkedService, bool) { + return nil, false +} + +// AsMagentoLinkedService is the BasicLinkedService implementation for FtpServerLinkedService. +func (fsls FtpServerLinkedService) AsMagentoLinkedService() (*MagentoLinkedService, bool) { + return nil, false +} + +// AsJiraLinkedService is the BasicLinkedService implementation for FtpServerLinkedService. +func (fsls FtpServerLinkedService) AsJiraLinkedService() (*JiraLinkedService, bool) { + return nil, false +} + +// AsImpalaLinkedService is the BasicLinkedService implementation for FtpServerLinkedService. +func (fsls FtpServerLinkedService) AsImpalaLinkedService() (*ImpalaLinkedService, bool) { + return nil, false +} + +// AsHubspotLinkedService is the BasicLinkedService implementation for FtpServerLinkedService. +func (fsls FtpServerLinkedService) AsHubspotLinkedService() (*HubspotLinkedService, bool) { + return nil, false +} + +// AsHiveLinkedService is the BasicLinkedService implementation for FtpServerLinkedService. +func (fsls FtpServerLinkedService) AsHiveLinkedService() (*HiveLinkedService, bool) { + return nil, false +} + +// AsHBaseLinkedService is the BasicLinkedService implementation for FtpServerLinkedService. +func (fsls FtpServerLinkedService) AsHBaseLinkedService() (*HBaseLinkedService, bool) { + return nil, false +} + +// AsGreenplumLinkedService is the BasicLinkedService implementation for FtpServerLinkedService. +func (fsls FtpServerLinkedService) AsGreenplumLinkedService() (*GreenplumLinkedService, bool) { + return nil, false +} + +// AsGoogleBigQueryLinkedService is the BasicLinkedService implementation for FtpServerLinkedService. +func (fsls FtpServerLinkedService) AsGoogleBigQueryLinkedService() (*GoogleBigQueryLinkedService, bool) { + return nil, false +} + +// AsEloquaLinkedService is the BasicLinkedService implementation for FtpServerLinkedService. +func (fsls FtpServerLinkedService) AsEloquaLinkedService() (*EloquaLinkedService, bool) { + return nil, false +} + +// AsDrillLinkedService is the BasicLinkedService implementation for FtpServerLinkedService. +func (fsls FtpServerLinkedService) AsDrillLinkedService() (*DrillLinkedService, bool) { + return nil, false +} + +// AsCouchbaseLinkedService is the BasicLinkedService implementation for FtpServerLinkedService. +func (fsls FtpServerLinkedService) AsCouchbaseLinkedService() (*CouchbaseLinkedService, bool) { + return nil, false +} + +// AsConcurLinkedService is the BasicLinkedService implementation for FtpServerLinkedService. +func (fsls FtpServerLinkedService) AsConcurLinkedService() (*ConcurLinkedService, bool) { + return nil, false +} + +// AsAzurePostgreSQLLinkedService is the BasicLinkedService implementation for FtpServerLinkedService. +func (fsls FtpServerLinkedService) AsAzurePostgreSQLLinkedService() (*AzurePostgreSQLLinkedService, bool) { + return nil, false +} + +// AsAmazonMWSLinkedService is the BasicLinkedService implementation for FtpServerLinkedService. +func (fsls FtpServerLinkedService) AsAmazonMWSLinkedService() (*AmazonMWSLinkedService, bool) { + return nil, false +} + +// AsSapHanaLinkedService is the BasicLinkedService implementation for FtpServerLinkedService. +func (fsls FtpServerLinkedService) AsSapHanaLinkedService() (*SapHanaLinkedService, bool) { + return nil, false +} + +// AsSapBWLinkedService is the BasicLinkedService implementation for FtpServerLinkedService. +func (fsls FtpServerLinkedService) AsSapBWLinkedService() (*SapBWLinkedService, bool) { + return nil, false +} + +// AsSftpServerLinkedService is the BasicLinkedService implementation for FtpServerLinkedService. +func (fsls FtpServerLinkedService) AsSftpServerLinkedService() (*SftpServerLinkedService, bool) { + return nil, false +} + +// AsFtpServerLinkedService is the BasicLinkedService implementation for FtpServerLinkedService. +func (fsls FtpServerLinkedService) AsFtpServerLinkedService() (*FtpServerLinkedService, bool) { + return &fsls, true +} + +// AsHTTPLinkedService is the BasicLinkedService implementation for FtpServerLinkedService. +func (fsls FtpServerLinkedService) AsHTTPLinkedService() (*HTTPLinkedService, bool) { + return nil, false +} + +// AsAzureSearchLinkedService is the BasicLinkedService implementation for FtpServerLinkedService. +func (fsls FtpServerLinkedService) AsAzureSearchLinkedService() (*AzureSearchLinkedService, bool) { + return nil, false +} + +// AsCustomDataSourceLinkedService is the BasicLinkedService implementation for FtpServerLinkedService. +func (fsls FtpServerLinkedService) AsCustomDataSourceLinkedService() (*CustomDataSourceLinkedService, bool) { + return nil, false +} + +// AsAmazonRedshiftLinkedService is the BasicLinkedService implementation for FtpServerLinkedService. +func (fsls FtpServerLinkedService) AsAmazonRedshiftLinkedService() (*AmazonRedshiftLinkedService, bool) { + return nil, false +} + +// AsAmazonS3LinkedService is the BasicLinkedService implementation for FtpServerLinkedService. +func (fsls FtpServerLinkedService) AsAmazonS3LinkedService() (*AmazonS3LinkedService, bool) { + return nil, false +} + +// AsSapEccLinkedService is the BasicLinkedService implementation for FtpServerLinkedService. +func (fsls FtpServerLinkedService) AsSapEccLinkedService() (*SapEccLinkedService, bool) { + return nil, false +} + +// AsSapCloudForCustomerLinkedService is the BasicLinkedService implementation for FtpServerLinkedService. +func (fsls FtpServerLinkedService) AsSapCloudForCustomerLinkedService() (*SapCloudForCustomerLinkedService, bool) { + return nil, false +} + +// AsSalesforceLinkedService is the BasicLinkedService implementation for FtpServerLinkedService. +func (fsls FtpServerLinkedService) AsSalesforceLinkedService() (*SalesforceLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeStoreLinkedService is the BasicLinkedService implementation for FtpServerLinkedService. +func (fsls FtpServerLinkedService) AsAzureDataLakeStoreLinkedService() (*AzureDataLakeStoreLinkedService, bool) { + return nil, false +} + +// AsMongoDbLinkedService is the BasicLinkedService implementation for FtpServerLinkedService. +func (fsls FtpServerLinkedService) AsMongoDbLinkedService() (*MongoDbLinkedService, bool) { + return nil, false +} + +// AsCassandraLinkedService is the BasicLinkedService implementation for FtpServerLinkedService. +func (fsls FtpServerLinkedService) AsCassandraLinkedService() (*CassandraLinkedService, bool) { + return nil, false +} + +// AsWebLinkedService is the BasicLinkedService implementation for FtpServerLinkedService. +func (fsls FtpServerLinkedService) AsWebLinkedService() (*WebLinkedService, bool) { + return nil, false +} + +// AsODataLinkedService is the BasicLinkedService implementation for FtpServerLinkedService. +func (fsls FtpServerLinkedService) AsODataLinkedService() (*ODataLinkedService, bool) { + return nil, false +} + +// AsHdfsLinkedService is the BasicLinkedService implementation for FtpServerLinkedService. +func (fsls FtpServerLinkedService) AsHdfsLinkedService() (*HdfsLinkedService, bool) { + return nil, false +} + +// AsOdbcLinkedService is the BasicLinkedService implementation for FtpServerLinkedService. +func (fsls FtpServerLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, bool) { + return nil, false +} + +// AsAzureMLLinkedService is the BasicLinkedService implementation for FtpServerLinkedService. +func (fsls FtpServerLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { + return nil, false +} + +// AsTeradataLinkedService is the BasicLinkedService implementation for FtpServerLinkedService. +func (fsls FtpServerLinkedService) AsTeradataLinkedService() (*TeradataLinkedService, bool) { + return nil, false +} + +// AsDb2LinkedService is the BasicLinkedService implementation for FtpServerLinkedService. +func (fsls FtpServerLinkedService) AsDb2LinkedService() (*Db2LinkedService, bool) { + return nil, false +} + +// AsSybaseLinkedService is the BasicLinkedService implementation for FtpServerLinkedService. +func (fsls FtpServerLinkedService) AsSybaseLinkedService() (*SybaseLinkedService, bool) { + return nil, false +} + +// AsPostgreSQLLinkedService is the BasicLinkedService implementation for FtpServerLinkedService. +func (fsls FtpServerLinkedService) AsPostgreSQLLinkedService() (*PostgreSQLLinkedService, bool) { + return nil, false +} + +// AsMySQLLinkedService is the BasicLinkedService implementation for FtpServerLinkedService. +func (fsls FtpServerLinkedService) AsMySQLLinkedService() (*MySQLLinkedService, bool) { + return nil, false +} + +// AsAzureMySQLLinkedService is the BasicLinkedService implementation for FtpServerLinkedService. +func (fsls FtpServerLinkedService) AsAzureMySQLLinkedService() (*AzureMySQLLinkedService, bool) { + return nil, false +} + +// AsOracleLinkedService is the BasicLinkedService implementation for FtpServerLinkedService. +func (fsls FtpServerLinkedService) AsOracleLinkedService() (*OracleLinkedService, bool) { + return nil, false +} + +// AsFileServerLinkedService is the BasicLinkedService implementation for FtpServerLinkedService. +func (fsls FtpServerLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { + return nil, false +} + +// AsHDInsightLinkedService is the BasicLinkedService implementation for FtpServerLinkedService. +func (fsls FtpServerLinkedService) AsHDInsightLinkedService() (*HDInsightLinkedService, bool) { + return nil, false +} + +// AsDynamicsLinkedService is the BasicLinkedService implementation for FtpServerLinkedService. +func (fsls FtpServerLinkedService) AsDynamicsLinkedService() (*DynamicsLinkedService, bool) { + return nil, false +} + +// AsCosmosDbLinkedService is the BasicLinkedService implementation for FtpServerLinkedService. +func (fsls FtpServerLinkedService) AsCosmosDbLinkedService() (*CosmosDbLinkedService, bool) { + return nil, false +} + +// AsAzureKeyVaultLinkedService is the BasicLinkedService implementation for FtpServerLinkedService. +func (fsls FtpServerLinkedService) AsAzureKeyVaultLinkedService() (*AzureKeyVaultLinkedService, bool) { + return nil, false +} + +// AsAzureBatchLinkedService is the BasicLinkedService implementation for FtpServerLinkedService. +func (fsls FtpServerLinkedService) AsAzureBatchLinkedService() (*AzureBatchLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDatabaseLinkedService is the BasicLinkedService implementation for FtpServerLinkedService. +func (fsls FtpServerLinkedService) AsAzureSQLDatabaseLinkedService() (*AzureSQLDatabaseLinkedService, bool) { + return nil, false +} + +// AsSQLServerLinkedService is the BasicLinkedService implementation for FtpServerLinkedService. +func (fsls FtpServerLinkedService) AsSQLServerLinkedService() (*SQLServerLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDWLinkedService is the BasicLinkedService implementation for FtpServerLinkedService. +func (fsls FtpServerLinkedService) AsAzureSQLDWLinkedService() (*AzureSQLDWLinkedService, bool) { + return nil, false +} + +// AsAzureStorageLinkedService is the BasicLinkedService implementation for FtpServerLinkedService. +func (fsls FtpServerLinkedService) AsAzureStorageLinkedService() (*AzureStorageLinkedService, bool) { + return nil, false +} + +// AsLinkedService is the BasicLinkedService implementation for FtpServerLinkedService. +func (fsls FtpServerLinkedService) AsLinkedService() (*LinkedService, bool) { + return nil, false +} + +// AsBasicLinkedService is the BasicLinkedService implementation for FtpServerLinkedService. +func (fsls FtpServerLinkedService) AsBasicLinkedService() (BasicLinkedService, bool) { + return &fsls, true +} + +// UnmarshalJSON is the custom unmarshaler for FtpServerLinkedService struct. +func (fsls *FtpServerLinkedService) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "typeProperties": + if v != nil { + var ftpServerLinkedServiceTypeProperties FtpServerLinkedServiceTypeProperties + err = json.Unmarshal(*v, &ftpServerLinkedServiceTypeProperties) + if err != nil { + return err + } + fsls.FtpServerLinkedServiceTypeProperties = &ftpServerLinkedServiceTypeProperties + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if fsls.AdditionalProperties == nil { + fsls.AdditionalProperties = make(map[string]interface{}) + } + fsls.AdditionalProperties[k] = additionalProperties + } + case "connectVia": + if v != nil { + var connectVia IntegrationRuntimeReference + err = json.Unmarshal(*v, &connectVia) + if err != nil { + return err + } + fsls.ConnectVia = &connectVia + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + fsls.Description = &description + } + case "parameters": + if v != nil { + var parameters map[string]*ParameterSpecification + err = json.Unmarshal(*v, ¶meters) + if err != nil { + return err + } + fsls.Parameters = parameters + } + case "annotations": + if v != nil { + var annotations []interface{} + err = json.Unmarshal(*v, &annotations) + if err != nil { + return err + } + fsls.Annotations = &annotations + } + case "type": + if v != nil { + var typeVar TypeBasicLinkedService + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + fsls.Type = typeVar + } + } + } + + return nil +} + +// FtpServerLinkedServiceTypeProperties properties specific to this linked service type. +type FtpServerLinkedServiceTypeProperties struct { + // Host - Host name of the FTP server. Type: string (or Expression with resultType string). + Host interface{} `json:"host,omitempty"` + // Port - The TCP port number that the FTP server uses to listen for client connections. Default value is 21. Type: integer (or Expression with resultType integer), minimum: 0. + Port interface{} `json:"port,omitempty"` + // AuthenticationType - The authentication type to be used to connect to the FTP server. Possible values include: 'FtpAuthenticationTypeBasic', 'FtpAuthenticationTypeAnonymous' + AuthenticationType FtpAuthenticationType `json:"authenticationType,omitempty"` + // UserName - Username to logon the FTP server. Type: string (or Expression with resultType string). + UserName interface{} `json:"userName,omitempty"` + // Password - Password to logon the FTP server. + Password BasicSecretBase `json:"password,omitempty"` + // EncryptedCredential - The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string). + EncryptedCredential interface{} `json:"encryptedCredential,omitempty"` + // EnableSsl - If true, connect to the FTP server over SSL/TLS channel. Default value is true. Type: boolean (or Expression with resultType boolean). + EnableSsl interface{} `json:"enableSsl,omitempty"` + // EnableServerCertificateValidation - If true, validate the FTP server SSL certificate when connect over SSL/TLS channel. Default value is true. Type: boolean (or Expression with resultType boolean). + EnableServerCertificateValidation interface{} `json:"enableServerCertificateValidation,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for FtpServerLinkedServiceTypeProperties struct. +func (fslstp *FtpServerLinkedServiceTypeProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "host": + if v != nil { + var host interface{} + err = json.Unmarshal(*v, &host) + if err != nil { + return err + } + fslstp.Host = host + } + case "port": + if v != nil { + var port interface{} + err = json.Unmarshal(*v, &port) + if err != nil { + return err + } + fslstp.Port = port + } + case "authenticationType": + if v != nil { + var authenticationType FtpAuthenticationType + err = json.Unmarshal(*v, &authenticationType) + if err != nil { + return err + } + fslstp.AuthenticationType = authenticationType + } + case "userName": + if v != nil { + var userName interface{} + err = json.Unmarshal(*v, &userName) + if err != nil { + return err + } + fslstp.UserName = userName + } + case "password": + if v != nil { + password, err := unmarshalBasicSecretBase(*v) + if err != nil { + return err + } + fslstp.Password = password + } + case "encryptedCredential": + if v != nil { + var encryptedCredential interface{} + err = json.Unmarshal(*v, &encryptedCredential) + if err != nil { + return err + } + fslstp.EncryptedCredential = encryptedCredential + } + case "enableSsl": + if v != nil { + var enableSsl interface{} + err = json.Unmarshal(*v, &enableSsl) + if err != nil { + return err + } + fslstp.EnableSsl = enableSsl + } + case "enableServerCertificateValidation": + if v != nil { + var enableServerCertificateValidation interface{} + err = json.Unmarshal(*v, &enableServerCertificateValidation) + if err != nil { + return err + } + fslstp.EnableServerCertificateValidation = enableServerCertificateValidation + } + } + } + + return nil +} + +// GetMetadataActivity activity to get metadata of dataset +type GetMetadataActivity struct { + // GetMetadataActivityTypeProperties - GetMetadata activity properties. + *GetMetadataActivityTypeProperties `json:"typeProperties,omitempty"` + // LinkedServiceName - Linked service reference. + LinkedServiceName *LinkedServiceReference `json:"linkedServiceName,omitempty"` + // Policy - Activity policy. + Policy *ActivityPolicy `json:"policy,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Name - Activity name. + Name *string `json:"name,omitempty"` + // Description - Activity description. + Description *string `json:"description,omitempty"` + // DependsOn - Activity depends on condition. + DependsOn *[]ActivityDependency `json:"dependsOn,omitempty"` + // UserProperties - Activity user properties. + UserProperties map[string]*string `json:"userProperties"` + // Type - Possible values include: 'TypeActivity', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLUpdateResource', 'TypeAzureMLBatchExecution', 'TypeGetMetadata', 'TypeWebActivity', 'TypeLookup', 'TypeSQLServerStoredProcedure', 'TypeCustom', 'TypeExecuteSSISPackage', 'TypeHDInsightSpark', 'TypeHDInsightStreaming', 'TypeHDInsightMapReduce', 'TypeHDInsightPig', 'TypeHDInsightHive', 'TypeCopy', 'TypeExecution', 'TypeFilter', 'TypeUntil', 'TypeWait', 'TypeForEach', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' + Type TypeBasicActivity `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for GetMetadataActivity. +func (gma GetMetadataActivity) MarshalJSON() ([]byte, error) { + gma.Type = TypeGetMetadata + objectMap := make(map[string]interface{}) + if gma.GetMetadataActivityTypeProperties != nil { + objectMap["typeProperties"] = gma.GetMetadataActivityTypeProperties + } + if gma.LinkedServiceName != nil { + objectMap["linkedServiceName"] = gma.LinkedServiceName + } + if gma.Policy != nil { + objectMap["policy"] = gma.Policy + } + if gma.Name != nil { + objectMap["name"] = gma.Name + } + if gma.Description != nil { + objectMap["description"] = gma.Description + } + if gma.DependsOn != nil { + objectMap["dependsOn"] = gma.DependsOn + } + if gma.UserProperties != nil { + objectMap["userProperties"] = gma.UserProperties + } + if gma.Type != "" { + objectMap["type"] = gma.Type + } + for k, v := range gma.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsDatabricksNotebookActivity is the BasicActivity implementation for GetMetadataActivity. +func (gma GetMetadataActivity) AsDatabricksNotebookActivity() (*DatabricksNotebookActivity, bool) { + return nil, false +} + +// AsDataLakeAnalyticsUSQLActivity is the BasicActivity implementation for GetMetadataActivity. +func (gma GetMetadataActivity) AsDataLakeAnalyticsUSQLActivity() (*DataLakeAnalyticsUSQLActivity, bool) { + return nil, false +} + +// AsAzureMLUpdateResourceActivity is the BasicActivity implementation for GetMetadataActivity. +func (gma GetMetadataActivity) AsAzureMLUpdateResourceActivity() (*AzureMLUpdateResourceActivity, bool) { + return nil, false +} + +// AsAzureMLBatchExecutionActivity is the BasicActivity implementation for GetMetadataActivity. +func (gma GetMetadataActivity) AsAzureMLBatchExecutionActivity() (*AzureMLBatchExecutionActivity, bool) { + return nil, false +} + +// AsGetMetadataActivity is the BasicActivity implementation for GetMetadataActivity. +func (gma GetMetadataActivity) AsGetMetadataActivity() (*GetMetadataActivity, bool) { + return &gma, true +} + +// AsWebActivity is the BasicActivity implementation for GetMetadataActivity. +func (gma GetMetadataActivity) AsWebActivity() (*WebActivity, bool) { + return nil, false +} + +// AsLookupActivity is the BasicActivity implementation for GetMetadataActivity. +func (gma GetMetadataActivity) AsLookupActivity() (*LookupActivity, bool) { + return nil, false +} + +// AsSQLServerStoredProcedureActivity is the BasicActivity implementation for GetMetadataActivity. +func (gma GetMetadataActivity) AsSQLServerStoredProcedureActivity() (*SQLServerStoredProcedureActivity, bool) { + return nil, false +} + +// AsCustomActivity is the BasicActivity implementation for GetMetadataActivity. +func (gma GetMetadataActivity) AsCustomActivity() (*CustomActivity, bool) { + return nil, false +} + +// AsExecuteSSISPackageActivity is the BasicActivity implementation for GetMetadataActivity. +func (gma GetMetadataActivity) AsExecuteSSISPackageActivity() (*ExecuteSSISPackageActivity, bool) { + return nil, false +} + +// AsHDInsightSparkActivity is the BasicActivity implementation for GetMetadataActivity. +func (gma GetMetadataActivity) AsHDInsightSparkActivity() (*HDInsightSparkActivity, bool) { + return nil, false +} + +// AsHDInsightStreamingActivity is the BasicActivity implementation for GetMetadataActivity. +func (gma GetMetadataActivity) AsHDInsightStreamingActivity() (*HDInsightStreamingActivity, bool) { + return nil, false +} + +// AsHDInsightMapReduceActivity is the BasicActivity implementation for GetMetadataActivity. +func (gma GetMetadataActivity) AsHDInsightMapReduceActivity() (*HDInsightMapReduceActivity, bool) { + return nil, false +} + +// AsHDInsightPigActivity is the BasicActivity implementation for GetMetadataActivity. +func (gma GetMetadataActivity) AsHDInsightPigActivity() (*HDInsightPigActivity, bool) { + return nil, false +} + +// AsHDInsightHiveActivity is the BasicActivity implementation for GetMetadataActivity. +func (gma GetMetadataActivity) AsHDInsightHiveActivity() (*HDInsightHiveActivity, bool) { + return nil, false +} + +// AsCopyActivity is the BasicActivity implementation for GetMetadataActivity. +func (gma GetMetadataActivity) AsCopyActivity() (*CopyActivity, bool) { + return nil, false +} + +// AsExecutionActivity is the BasicActivity implementation for GetMetadataActivity. +func (gma GetMetadataActivity) AsExecutionActivity() (*ExecutionActivity, bool) { + return nil, false +} + +// AsBasicExecutionActivity is the BasicActivity implementation for GetMetadataActivity. +func (gma GetMetadataActivity) AsBasicExecutionActivity() (BasicExecutionActivity, bool) { + return &gma, true +} + +// AsFilterActivity is the BasicActivity implementation for GetMetadataActivity. +func (gma GetMetadataActivity) AsFilterActivity() (*FilterActivity, bool) { + return nil, false +} + +// AsUntilActivity is the BasicActivity implementation for GetMetadataActivity. +func (gma GetMetadataActivity) AsUntilActivity() (*UntilActivity, bool) { + return nil, false +} + +// AsWaitActivity is the BasicActivity implementation for GetMetadataActivity. +func (gma GetMetadataActivity) AsWaitActivity() (*WaitActivity, bool) { + return nil, false +} + +// AsForEachActivity is the BasicActivity implementation for GetMetadataActivity. +func (gma GetMetadataActivity) AsForEachActivity() (*ForEachActivity, bool) { + return nil, false +} + +// AsIfConditionActivity is the BasicActivity implementation for GetMetadataActivity. +func (gma GetMetadataActivity) AsIfConditionActivity() (*IfConditionActivity, bool) { + return nil, false +} + +// AsExecutePipelineActivity is the BasicActivity implementation for GetMetadataActivity. +func (gma GetMetadataActivity) AsExecutePipelineActivity() (*ExecutePipelineActivity, bool) { + return nil, false +} + +// AsControlActivity is the BasicActivity implementation for GetMetadataActivity. +func (gma GetMetadataActivity) AsControlActivity() (*ControlActivity, bool) { + return nil, false +} + +// AsBasicControlActivity is the BasicActivity implementation for GetMetadataActivity. +func (gma GetMetadataActivity) AsBasicControlActivity() (BasicControlActivity, bool) { + return nil, false +} + +// AsActivity is the BasicActivity implementation for GetMetadataActivity. +func (gma GetMetadataActivity) AsActivity() (*Activity, bool) { + return nil, false +} + +// AsBasicActivity is the BasicActivity implementation for GetMetadataActivity. +func (gma GetMetadataActivity) AsBasicActivity() (BasicActivity, bool) { + return &gma, true +} + +// UnmarshalJSON is the custom unmarshaler for GetMetadataActivity struct. +func (gma *GetMetadataActivity) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "typeProperties": + if v != nil { + var getMetadataActivityTypeProperties GetMetadataActivityTypeProperties + err = json.Unmarshal(*v, &getMetadataActivityTypeProperties) + if err != nil { + return err + } + gma.GetMetadataActivityTypeProperties = &getMetadataActivityTypeProperties + } + case "linkedServiceName": + if v != nil { + var linkedServiceName LinkedServiceReference + err = json.Unmarshal(*v, &linkedServiceName) + if err != nil { + return err + } + gma.LinkedServiceName = &linkedServiceName + } + case "policy": + if v != nil { + var policy ActivityPolicy + err = json.Unmarshal(*v, &policy) + if err != nil { + return err + } + gma.Policy = &policy + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if gma.AdditionalProperties == nil { + gma.AdditionalProperties = make(map[string]interface{}) + } + gma.AdditionalProperties[k] = additionalProperties + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + gma.Name = &name + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + gma.Description = &description + } + case "dependsOn": + if v != nil { + var dependsOn []ActivityDependency + err = json.Unmarshal(*v, &dependsOn) + if err != nil { + return err + } + gma.DependsOn = &dependsOn + } + case "userProperties": + if v != nil { + var userProperties map[string]*string + err = json.Unmarshal(*v, &userProperties) + if err != nil { + return err + } + gma.UserProperties = userProperties + } + case "type": + if v != nil { + var typeVar TypeBasicActivity + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + gma.Type = typeVar + } + } + } + + return nil +} + +// GetMetadataActivityTypeProperties getMetadata activity properties. +type GetMetadataActivityTypeProperties struct { + // Dataset - GetMetadata activity dataset reference. + Dataset *DatasetReference `json:"dataset,omitempty"` + // FieldList - Fields of metadata to get from dataset. + FieldList *[]interface{} `json:"fieldList,omitempty"` +} + +// GoogleBigQueryLinkedService google BigQuery service linked service. +type GoogleBigQueryLinkedService struct { + // GoogleBigQueryLinkedServiceTypeProperties - Google BigQuery service linked service properties. + *GoogleBigQueryLinkedServiceTypeProperties `json:"typeProperties,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // ConnectVia - The integration runtime reference. + ConnectVia *IntegrationRuntimeReference `json:"connectVia,omitempty"` + // Description - Linked service description. + Description *string `json:"description,omitempty"` + // Parameters - Parameters for linked service. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeLinkedService', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforce', 'TypeAzureDataLakeStore', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureStorage' + Type TypeBasicLinkedService `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for GoogleBigQueryLinkedService. +func (gbqls GoogleBigQueryLinkedService) MarshalJSON() ([]byte, error) { + gbqls.Type = TypeGoogleBigQuery + objectMap := make(map[string]interface{}) + if gbqls.GoogleBigQueryLinkedServiceTypeProperties != nil { + objectMap["typeProperties"] = gbqls.GoogleBigQueryLinkedServiceTypeProperties + } + if gbqls.ConnectVia != nil { + objectMap["connectVia"] = gbqls.ConnectVia + } + if gbqls.Description != nil { + objectMap["description"] = gbqls.Description + } + if gbqls.Parameters != nil { + objectMap["parameters"] = gbqls.Parameters + } + if gbqls.Annotations != nil { + objectMap["annotations"] = gbqls.Annotations + } + if gbqls.Type != "" { + objectMap["type"] = gbqls.Type + } + for k, v := range gbqls.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysLinkedService is the BasicLinkedService implementation for GoogleBigQueryLinkedService. +func (gbqls GoogleBigQueryLinkedService) AsResponsysLinkedService() (*ResponsysLinkedService, bool) { + return nil, false +} + +// AsAzureDatabricksLinkedService is the BasicLinkedService implementation for GoogleBigQueryLinkedService. +func (gbqls GoogleBigQueryLinkedService) AsAzureDatabricksLinkedService() (*AzureDatabricksLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeAnalyticsLinkedService is the BasicLinkedService implementation for GoogleBigQueryLinkedService. +func (gbqls GoogleBigQueryLinkedService) AsAzureDataLakeAnalyticsLinkedService() (*AzureDataLakeAnalyticsLinkedService, bool) { + return nil, false +} + +// AsHDInsightOnDemandLinkedService is the BasicLinkedService implementation for GoogleBigQueryLinkedService. +func (gbqls GoogleBigQueryLinkedService) AsHDInsightOnDemandLinkedService() (*HDInsightOnDemandLinkedService, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudLinkedService is the BasicLinkedService implementation for GoogleBigQueryLinkedService. +func (gbqls GoogleBigQueryLinkedService) AsSalesforceMarketingCloudLinkedService() (*SalesforceMarketingCloudLinkedService, bool) { + return nil, false +} + +// AsNetezzaLinkedService is the BasicLinkedService implementation for GoogleBigQueryLinkedService. +func (gbqls GoogleBigQueryLinkedService) AsNetezzaLinkedService() (*NetezzaLinkedService, bool) { + return nil, false +} + +// AsVerticaLinkedService is the BasicLinkedService implementation for GoogleBigQueryLinkedService. +func (gbqls GoogleBigQueryLinkedService) AsVerticaLinkedService() (*VerticaLinkedService, bool) { + return nil, false +} + +// AsZohoLinkedService is the BasicLinkedService implementation for GoogleBigQueryLinkedService. +func (gbqls GoogleBigQueryLinkedService) AsZohoLinkedService() (*ZohoLinkedService, bool) { + return nil, false +} + +// AsXeroLinkedService is the BasicLinkedService implementation for GoogleBigQueryLinkedService. +func (gbqls GoogleBigQueryLinkedService) AsXeroLinkedService() (*XeroLinkedService, bool) { + return nil, false +} + +// AsSquareLinkedService is the BasicLinkedService implementation for GoogleBigQueryLinkedService. +func (gbqls GoogleBigQueryLinkedService) AsSquareLinkedService() (*SquareLinkedService, bool) { + return nil, false +} + +// AsSparkLinkedService is the BasicLinkedService implementation for GoogleBigQueryLinkedService. +func (gbqls GoogleBigQueryLinkedService) AsSparkLinkedService() (*SparkLinkedService, bool) { + return nil, false +} + +// AsShopifyLinkedService is the BasicLinkedService implementation for GoogleBigQueryLinkedService. +func (gbqls GoogleBigQueryLinkedService) AsShopifyLinkedService() (*ShopifyLinkedService, bool) { + return nil, false +} + +// AsServiceNowLinkedService is the BasicLinkedService implementation for GoogleBigQueryLinkedService. +func (gbqls GoogleBigQueryLinkedService) AsServiceNowLinkedService() (*ServiceNowLinkedService, bool) { + return nil, false +} + +// AsQuickBooksLinkedService is the BasicLinkedService implementation for GoogleBigQueryLinkedService. +func (gbqls GoogleBigQueryLinkedService) AsQuickBooksLinkedService() (*QuickBooksLinkedService, bool) { + return nil, false +} + +// AsPrestoLinkedService is the BasicLinkedService implementation for GoogleBigQueryLinkedService. +func (gbqls GoogleBigQueryLinkedService) AsPrestoLinkedService() (*PrestoLinkedService, bool) { + return nil, false +} + +// AsPhoenixLinkedService is the BasicLinkedService implementation for GoogleBigQueryLinkedService. +func (gbqls GoogleBigQueryLinkedService) AsPhoenixLinkedService() (*PhoenixLinkedService, bool) { + return nil, false +} + +// AsPaypalLinkedService is the BasicLinkedService implementation for GoogleBigQueryLinkedService. +func (gbqls GoogleBigQueryLinkedService) AsPaypalLinkedService() (*PaypalLinkedService, bool) { + return nil, false +} + +// AsMarketoLinkedService is the BasicLinkedService implementation for GoogleBigQueryLinkedService. +func (gbqls GoogleBigQueryLinkedService) AsMarketoLinkedService() (*MarketoLinkedService, bool) { + return nil, false +} + +// AsMariaDBLinkedService is the BasicLinkedService implementation for GoogleBigQueryLinkedService. +func (gbqls GoogleBigQueryLinkedService) AsMariaDBLinkedService() (*MariaDBLinkedService, bool) { + return nil, false +} + +// AsMagentoLinkedService is the BasicLinkedService implementation for GoogleBigQueryLinkedService. +func (gbqls GoogleBigQueryLinkedService) AsMagentoLinkedService() (*MagentoLinkedService, bool) { + return nil, false +} + +// AsJiraLinkedService is the BasicLinkedService implementation for GoogleBigQueryLinkedService. +func (gbqls GoogleBigQueryLinkedService) AsJiraLinkedService() (*JiraLinkedService, bool) { + return nil, false +} + +// AsImpalaLinkedService is the BasicLinkedService implementation for GoogleBigQueryLinkedService. +func (gbqls GoogleBigQueryLinkedService) AsImpalaLinkedService() (*ImpalaLinkedService, bool) { + return nil, false +} + +// AsHubspotLinkedService is the BasicLinkedService implementation for GoogleBigQueryLinkedService. +func (gbqls GoogleBigQueryLinkedService) AsHubspotLinkedService() (*HubspotLinkedService, bool) { + return nil, false +} + +// AsHiveLinkedService is the BasicLinkedService implementation for GoogleBigQueryLinkedService. +func (gbqls GoogleBigQueryLinkedService) AsHiveLinkedService() (*HiveLinkedService, bool) { + return nil, false +} + +// AsHBaseLinkedService is the BasicLinkedService implementation for GoogleBigQueryLinkedService. +func (gbqls GoogleBigQueryLinkedService) AsHBaseLinkedService() (*HBaseLinkedService, bool) { + return nil, false +} + +// AsGreenplumLinkedService is the BasicLinkedService implementation for GoogleBigQueryLinkedService. +func (gbqls GoogleBigQueryLinkedService) AsGreenplumLinkedService() (*GreenplumLinkedService, bool) { + return nil, false +} + +// AsGoogleBigQueryLinkedService is the BasicLinkedService implementation for GoogleBigQueryLinkedService. +func (gbqls GoogleBigQueryLinkedService) AsGoogleBigQueryLinkedService() (*GoogleBigQueryLinkedService, bool) { + return &gbqls, true +} + +// AsEloquaLinkedService is the BasicLinkedService implementation for GoogleBigQueryLinkedService. +func (gbqls GoogleBigQueryLinkedService) AsEloquaLinkedService() (*EloquaLinkedService, bool) { + return nil, false +} + +// AsDrillLinkedService is the BasicLinkedService implementation for GoogleBigQueryLinkedService. +func (gbqls GoogleBigQueryLinkedService) AsDrillLinkedService() (*DrillLinkedService, bool) { + return nil, false +} + +// AsCouchbaseLinkedService is the BasicLinkedService implementation for GoogleBigQueryLinkedService. +func (gbqls GoogleBigQueryLinkedService) AsCouchbaseLinkedService() (*CouchbaseLinkedService, bool) { + return nil, false +} + +// AsConcurLinkedService is the BasicLinkedService implementation for GoogleBigQueryLinkedService. +func (gbqls GoogleBigQueryLinkedService) AsConcurLinkedService() (*ConcurLinkedService, bool) { + return nil, false +} + +// AsAzurePostgreSQLLinkedService is the BasicLinkedService implementation for GoogleBigQueryLinkedService. +func (gbqls GoogleBigQueryLinkedService) AsAzurePostgreSQLLinkedService() (*AzurePostgreSQLLinkedService, bool) { + return nil, false +} + +// AsAmazonMWSLinkedService is the BasicLinkedService implementation for GoogleBigQueryLinkedService. +func (gbqls GoogleBigQueryLinkedService) AsAmazonMWSLinkedService() (*AmazonMWSLinkedService, bool) { + return nil, false +} + +// AsSapHanaLinkedService is the BasicLinkedService implementation for GoogleBigQueryLinkedService. +func (gbqls GoogleBigQueryLinkedService) AsSapHanaLinkedService() (*SapHanaLinkedService, bool) { + return nil, false +} + +// AsSapBWLinkedService is the BasicLinkedService implementation for GoogleBigQueryLinkedService. +func (gbqls GoogleBigQueryLinkedService) AsSapBWLinkedService() (*SapBWLinkedService, bool) { + return nil, false +} + +// AsSftpServerLinkedService is the BasicLinkedService implementation for GoogleBigQueryLinkedService. +func (gbqls GoogleBigQueryLinkedService) AsSftpServerLinkedService() (*SftpServerLinkedService, bool) { + return nil, false +} + +// AsFtpServerLinkedService is the BasicLinkedService implementation for GoogleBigQueryLinkedService. +func (gbqls GoogleBigQueryLinkedService) AsFtpServerLinkedService() (*FtpServerLinkedService, bool) { + return nil, false +} + +// AsHTTPLinkedService is the BasicLinkedService implementation for GoogleBigQueryLinkedService. +func (gbqls GoogleBigQueryLinkedService) AsHTTPLinkedService() (*HTTPLinkedService, bool) { + return nil, false +} + +// AsAzureSearchLinkedService is the BasicLinkedService implementation for GoogleBigQueryLinkedService. +func (gbqls GoogleBigQueryLinkedService) AsAzureSearchLinkedService() (*AzureSearchLinkedService, bool) { + return nil, false +} + +// AsCustomDataSourceLinkedService is the BasicLinkedService implementation for GoogleBigQueryLinkedService. +func (gbqls GoogleBigQueryLinkedService) AsCustomDataSourceLinkedService() (*CustomDataSourceLinkedService, bool) { + return nil, false +} + +// AsAmazonRedshiftLinkedService is the BasicLinkedService implementation for GoogleBigQueryLinkedService. +func (gbqls GoogleBigQueryLinkedService) AsAmazonRedshiftLinkedService() (*AmazonRedshiftLinkedService, bool) { + return nil, false +} + +// AsAmazonS3LinkedService is the BasicLinkedService implementation for GoogleBigQueryLinkedService. +func (gbqls GoogleBigQueryLinkedService) AsAmazonS3LinkedService() (*AmazonS3LinkedService, bool) { + return nil, false +} + +// AsSapEccLinkedService is the BasicLinkedService implementation for GoogleBigQueryLinkedService. +func (gbqls GoogleBigQueryLinkedService) AsSapEccLinkedService() (*SapEccLinkedService, bool) { + return nil, false +} + +// AsSapCloudForCustomerLinkedService is the BasicLinkedService implementation for GoogleBigQueryLinkedService. +func (gbqls GoogleBigQueryLinkedService) AsSapCloudForCustomerLinkedService() (*SapCloudForCustomerLinkedService, bool) { + return nil, false +} + +// AsSalesforceLinkedService is the BasicLinkedService implementation for GoogleBigQueryLinkedService. +func (gbqls GoogleBigQueryLinkedService) AsSalesforceLinkedService() (*SalesforceLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeStoreLinkedService is the BasicLinkedService implementation for GoogleBigQueryLinkedService. +func (gbqls GoogleBigQueryLinkedService) AsAzureDataLakeStoreLinkedService() (*AzureDataLakeStoreLinkedService, bool) { + return nil, false +} + +// AsMongoDbLinkedService is the BasicLinkedService implementation for GoogleBigQueryLinkedService. +func (gbqls GoogleBigQueryLinkedService) AsMongoDbLinkedService() (*MongoDbLinkedService, bool) { + return nil, false +} + +// AsCassandraLinkedService is the BasicLinkedService implementation for GoogleBigQueryLinkedService. +func (gbqls GoogleBigQueryLinkedService) AsCassandraLinkedService() (*CassandraLinkedService, bool) { + return nil, false +} + +// AsWebLinkedService is the BasicLinkedService implementation for GoogleBigQueryLinkedService. +func (gbqls GoogleBigQueryLinkedService) AsWebLinkedService() (*WebLinkedService, bool) { + return nil, false +} + +// AsODataLinkedService is the BasicLinkedService implementation for GoogleBigQueryLinkedService. +func (gbqls GoogleBigQueryLinkedService) AsODataLinkedService() (*ODataLinkedService, bool) { + return nil, false +} + +// AsHdfsLinkedService is the BasicLinkedService implementation for GoogleBigQueryLinkedService. +func (gbqls GoogleBigQueryLinkedService) AsHdfsLinkedService() (*HdfsLinkedService, bool) { + return nil, false +} + +// AsOdbcLinkedService is the BasicLinkedService implementation for GoogleBigQueryLinkedService. +func (gbqls GoogleBigQueryLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, bool) { + return nil, false +} + +// AsAzureMLLinkedService is the BasicLinkedService implementation for GoogleBigQueryLinkedService. +func (gbqls GoogleBigQueryLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { + return nil, false +} + +// AsTeradataLinkedService is the BasicLinkedService implementation for GoogleBigQueryLinkedService. +func (gbqls GoogleBigQueryLinkedService) AsTeradataLinkedService() (*TeradataLinkedService, bool) { + return nil, false +} + +// AsDb2LinkedService is the BasicLinkedService implementation for GoogleBigQueryLinkedService. +func (gbqls GoogleBigQueryLinkedService) AsDb2LinkedService() (*Db2LinkedService, bool) { + return nil, false +} + +// AsSybaseLinkedService is the BasicLinkedService implementation for GoogleBigQueryLinkedService. +func (gbqls GoogleBigQueryLinkedService) AsSybaseLinkedService() (*SybaseLinkedService, bool) { + return nil, false +} + +// AsPostgreSQLLinkedService is the BasicLinkedService implementation for GoogleBigQueryLinkedService. +func (gbqls GoogleBigQueryLinkedService) AsPostgreSQLLinkedService() (*PostgreSQLLinkedService, bool) { + return nil, false +} + +// AsMySQLLinkedService is the BasicLinkedService implementation for GoogleBigQueryLinkedService. +func (gbqls GoogleBigQueryLinkedService) AsMySQLLinkedService() (*MySQLLinkedService, bool) { + return nil, false +} + +// AsAzureMySQLLinkedService is the BasicLinkedService implementation for GoogleBigQueryLinkedService. +func (gbqls GoogleBigQueryLinkedService) AsAzureMySQLLinkedService() (*AzureMySQLLinkedService, bool) { + return nil, false +} + +// AsOracleLinkedService is the BasicLinkedService implementation for GoogleBigQueryLinkedService. +func (gbqls GoogleBigQueryLinkedService) AsOracleLinkedService() (*OracleLinkedService, bool) { + return nil, false +} + +// AsFileServerLinkedService is the BasicLinkedService implementation for GoogleBigQueryLinkedService. +func (gbqls GoogleBigQueryLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { + return nil, false +} + +// AsHDInsightLinkedService is the BasicLinkedService implementation for GoogleBigQueryLinkedService. +func (gbqls GoogleBigQueryLinkedService) AsHDInsightLinkedService() (*HDInsightLinkedService, bool) { + return nil, false +} + +// AsDynamicsLinkedService is the BasicLinkedService implementation for GoogleBigQueryLinkedService. +func (gbqls GoogleBigQueryLinkedService) AsDynamicsLinkedService() (*DynamicsLinkedService, bool) { + return nil, false +} + +// AsCosmosDbLinkedService is the BasicLinkedService implementation for GoogleBigQueryLinkedService. +func (gbqls GoogleBigQueryLinkedService) AsCosmosDbLinkedService() (*CosmosDbLinkedService, bool) { + return nil, false +} + +// AsAzureKeyVaultLinkedService is the BasicLinkedService implementation for GoogleBigQueryLinkedService. +func (gbqls GoogleBigQueryLinkedService) AsAzureKeyVaultLinkedService() (*AzureKeyVaultLinkedService, bool) { + return nil, false +} + +// AsAzureBatchLinkedService is the BasicLinkedService implementation for GoogleBigQueryLinkedService. +func (gbqls GoogleBigQueryLinkedService) AsAzureBatchLinkedService() (*AzureBatchLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDatabaseLinkedService is the BasicLinkedService implementation for GoogleBigQueryLinkedService. +func (gbqls GoogleBigQueryLinkedService) AsAzureSQLDatabaseLinkedService() (*AzureSQLDatabaseLinkedService, bool) { + return nil, false +} + +// AsSQLServerLinkedService is the BasicLinkedService implementation for GoogleBigQueryLinkedService. +func (gbqls GoogleBigQueryLinkedService) AsSQLServerLinkedService() (*SQLServerLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDWLinkedService is the BasicLinkedService implementation for GoogleBigQueryLinkedService. +func (gbqls GoogleBigQueryLinkedService) AsAzureSQLDWLinkedService() (*AzureSQLDWLinkedService, bool) { + return nil, false +} + +// AsAzureStorageLinkedService is the BasicLinkedService implementation for GoogleBigQueryLinkedService. +func (gbqls GoogleBigQueryLinkedService) AsAzureStorageLinkedService() (*AzureStorageLinkedService, bool) { + return nil, false +} + +// AsLinkedService is the BasicLinkedService implementation for GoogleBigQueryLinkedService. +func (gbqls GoogleBigQueryLinkedService) AsLinkedService() (*LinkedService, bool) { + return nil, false +} + +// AsBasicLinkedService is the BasicLinkedService implementation for GoogleBigQueryLinkedService. +func (gbqls GoogleBigQueryLinkedService) AsBasicLinkedService() (BasicLinkedService, bool) { + return &gbqls, true +} + +// UnmarshalJSON is the custom unmarshaler for GoogleBigQueryLinkedService struct. +func (gbqls *GoogleBigQueryLinkedService) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "typeProperties": + if v != nil { + var googleBigQueryLinkedServiceTypeProperties GoogleBigQueryLinkedServiceTypeProperties + err = json.Unmarshal(*v, &googleBigQueryLinkedServiceTypeProperties) + if err != nil { + return err + } + gbqls.GoogleBigQueryLinkedServiceTypeProperties = &googleBigQueryLinkedServiceTypeProperties + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if gbqls.AdditionalProperties == nil { + gbqls.AdditionalProperties = make(map[string]interface{}) + } + gbqls.AdditionalProperties[k] = additionalProperties + } + case "connectVia": + if v != nil { + var connectVia IntegrationRuntimeReference + err = json.Unmarshal(*v, &connectVia) + if err != nil { + return err + } + gbqls.ConnectVia = &connectVia + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + gbqls.Description = &description + } + case "parameters": + if v != nil { + var parameters map[string]*ParameterSpecification + err = json.Unmarshal(*v, ¶meters) + if err != nil { + return err + } + gbqls.Parameters = parameters + } + case "annotations": + if v != nil { + var annotations []interface{} + err = json.Unmarshal(*v, &annotations) + if err != nil { + return err + } + gbqls.Annotations = &annotations + } + case "type": + if v != nil { + var typeVar TypeBasicLinkedService + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + gbqls.Type = typeVar + } + } + } + + return nil +} + +// GoogleBigQueryLinkedServiceTypeProperties google BigQuery service linked service properties. +type GoogleBigQueryLinkedServiceTypeProperties struct { + // Project - The default BigQuery project to query against. + Project interface{} `json:"project,omitempty"` + // AdditionalProjects - A comma-separated list of public BigQuery projects to access. + AdditionalProjects interface{} `json:"additionalProjects,omitempty"` + // RequestGoogleDriveScope - Whether to request access to Google Drive. Allowing Google Drive access enables support for federated tables that combine BigQuery data with data from Google Drive. The default value is false. + RequestGoogleDriveScope interface{} `json:"requestGoogleDriveScope,omitempty"` + // AuthenticationType - The OAuth 2.0 authentication mechanism used for authentication. ServiceAuthentication can only be used on self-hosted IR. Possible values include: 'ServiceAuthentication', 'UserAuthentication' + AuthenticationType GoogleBigQueryAuthenticationType `json:"authenticationType,omitempty"` + // RefreshToken - The refresh token obtained from Google for authorizing access to BigQuery for UserAuthentication. + RefreshToken BasicSecretBase `json:"refreshToken,omitempty"` + // ClientID - The client id of the google application used to acquire the refresh token. + ClientID BasicSecretBase `json:"clientId,omitempty"` + // ClientSecret - The client secret of the google application used to acquire the refresh token. + ClientSecret BasicSecretBase `json:"clientSecret,omitempty"` + // Email - The service account email ID that is used for ServiceAuthentication and can only be used on self-hosted IR. + Email interface{} `json:"email,omitempty"` + // KeyFilePath - The full path to the .p12 key file that is used to authenticate the service account email address and can only be used on self-hosted IR. + KeyFilePath interface{} `json:"keyFilePath,omitempty"` + // TrustedCertPath - The full path of the .pem file containing trusted CA certificates for verifying the server when connecting over SSL. This property can only be set when using SSL on self-hosted IR. The default value is the cacerts.pem file installed with the IR. + TrustedCertPath interface{} `json:"trustedCertPath,omitempty"` + // UseSystemTrustStore - Specifies whether to use a CA certificate from the system trust store or from a specified PEM file. The default value is false. + UseSystemTrustStore interface{} `json:"useSystemTrustStore,omitempty"` + // EncryptedCredential - The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string). + EncryptedCredential interface{} `json:"encryptedCredential,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for GoogleBigQueryLinkedServiceTypeProperties struct. +func (gbqlstp *GoogleBigQueryLinkedServiceTypeProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "project": + if v != nil { + var project interface{} + err = json.Unmarshal(*v, &project) + if err != nil { + return err + } + gbqlstp.Project = project + } + case "additionalProjects": + if v != nil { + var additionalProjects interface{} + err = json.Unmarshal(*v, &additionalProjects) + if err != nil { + return err + } + gbqlstp.AdditionalProjects = additionalProjects + } + case "requestGoogleDriveScope": + if v != nil { + var requestGoogleDriveScope interface{} + err = json.Unmarshal(*v, &requestGoogleDriveScope) + if err != nil { + return err + } + gbqlstp.RequestGoogleDriveScope = requestGoogleDriveScope + } + case "authenticationType": + if v != nil { + var authenticationType GoogleBigQueryAuthenticationType + err = json.Unmarshal(*v, &authenticationType) + if err != nil { + return err + } + gbqlstp.AuthenticationType = authenticationType + } + case "refreshToken": + if v != nil { + refreshToken, err := unmarshalBasicSecretBase(*v) + if err != nil { + return err + } + gbqlstp.RefreshToken = refreshToken + } + case "clientId": + if v != nil { + clientID, err := unmarshalBasicSecretBase(*v) + if err != nil { + return err + } + gbqlstp.ClientID = clientID + } + case "clientSecret": + if v != nil { + clientSecret, err := unmarshalBasicSecretBase(*v) + if err != nil { + return err + } + gbqlstp.ClientSecret = clientSecret + } + case "email": + if v != nil { + var email interface{} + err = json.Unmarshal(*v, &email) + if err != nil { + return err + } + gbqlstp.Email = email + } + case "keyFilePath": + if v != nil { + var keyFilePath interface{} + err = json.Unmarshal(*v, &keyFilePath) + if err != nil { + return err + } + gbqlstp.KeyFilePath = keyFilePath + } + case "trustedCertPath": + if v != nil { + var trustedCertPath interface{} + err = json.Unmarshal(*v, &trustedCertPath) + if err != nil { + return err + } + gbqlstp.TrustedCertPath = trustedCertPath + } + case "useSystemTrustStore": + if v != nil { + var useSystemTrustStore interface{} + err = json.Unmarshal(*v, &useSystemTrustStore) + if err != nil { + return err + } + gbqlstp.UseSystemTrustStore = useSystemTrustStore + } + case "encryptedCredential": + if v != nil { + var encryptedCredential interface{} + err = json.Unmarshal(*v, &encryptedCredential) + if err != nil { + return err + } + gbqlstp.EncryptedCredential = encryptedCredential + } + } + } + + return nil +} + +// GoogleBigQueryObjectDataset google BigQuery service dataset. +type GoogleBigQueryObjectDataset struct { + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Description - Dataset description. + Description *string `json:"description,omitempty"` + // Structure - Columns that define the structure of the dataset. Type: array (or Expression with resultType array), itemType: DatasetDataElement. + Structure interface{} `json:"structure,omitempty"` + // LinkedServiceName - Linked service reference. + LinkedServiceName *LinkedServiceReference `json:"linkedServiceName,omitempty"` + // Parameters - Parameters for dataset. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeDataset', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSQLServerTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSalesforceObject', 'TypeRelationalTable', 'TypeAzureMySQLTable', 'TypeOracleTable', 'TypeODataResource', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeAzureDataLakeStoreFile', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeAmazonS3Object' + Type TypeBasicDataset `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for GoogleBigQueryObjectDataset. +func (gbqod GoogleBigQueryObjectDataset) MarshalJSON() ([]byte, error) { + gbqod.Type = TypeGoogleBigQueryObject + objectMap := make(map[string]interface{}) + if gbqod.Description != nil { + objectMap["description"] = gbqod.Description + } + objectMap["structure"] = gbqod.Structure + if gbqod.LinkedServiceName != nil { + objectMap["linkedServiceName"] = gbqod.LinkedServiceName + } + if gbqod.Parameters != nil { + objectMap["parameters"] = gbqod.Parameters + } + if gbqod.Annotations != nil { + objectMap["annotations"] = gbqod.Annotations + } + if gbqod.Type != "" { + objectMap["type"] = gbqod.Type + } + for k, v := range gbqod.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysObjectDataset is the BasicDataset implementation for GoogleBigQueryObjectDataset. +func (gbqod GoogleBigQueryObjectDataset) AsResponsysObjectDataset() (*ResponsysObjectDataset, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudObjectDataset is the BasicDataset implementation for GoogleBigQueryObjectDataset. +func (gbqod GoogleBigQueryObjectDataset) AsSalesforceMarketingCloudObjectDataset() (*SalesforceMarketingCloudObjectDataset, bool) { + return nil, false +} + +// AsVerticaTableDataset is the BasicDataset implementation for GoogleBigQueryObjectDataset. +func (gbqod GoogleBigQueryObjectDataset) AsVerticaTableDataset() (*VerticaTableDataset, bool) { + return nil, false +} + +// AsNetezzaTableDataset is the BasicDataset implementation for GoogleBigQueryObjectDataset. +func (gbqod GoogleBigQueryObjectDataset) AsNetezzaTableDataset() (*NetezzaTableDataset, bool) { + return nil, false +} + +// AsZohoObjectDataset is the BasicDataset implementation for GoogleBigQueryObjectDataset. +func (gbqod GoogleBigQueryObjectDataset) AsZohoObjectDataset() (*ZohoObjectDataset, bool) { + return nil, false +} + +// AsXeroObjectDataset is the BasicDataset implementation for GoogleBigQueryObjectDataset. +func (gbqod GoogleBigQueryObjectDataset) AsXeroObjectDataset() (*XeroObjectDataset, bool) { + return nil, false +} + +// AsSquareObjectDataset is the BasicDataset implementation for GoogleBigQueryObjectDataset. +func (gbqod GoogleBigQueryObjectDataset) AsSquareObjectDataset() (*SquareObjectDataset, bool) { + return nil, false +} + +// AsSparkObjectDataset is the BasicDataset implementation for GoogleBigQueryObjectDataset. +func (gbqod GoogleBigQueryObjectDataset) AsSparkObjectDataset() (*SparkObjectDataset, bool) { + return nil, false +} + +// AsShopifyObjectDataset is the BasicDataset implementation for GoogleBigQueryObjectDataset. +func (gbqod GoogleBigQueryObjectDataset) AsShopifyObjectDataset() (*ShopifyObjectDataset, bool) { + return nil, false +} + +// AsServiceNowObjectDataset is the BasicDataset implementation for GoogleBigQueryObjectDataset. +func (gbqod GoogleBigQueryObjectDataset) AsServiceNowObjectDataset() (*ServiceNowObjectDataset, bool) { + return nil, false +} + +// AsQuickBooksObjectDataset is the BasicDataset implementation for GoogleBigQueryObjectDataset. +func (gbqod GoogleBigQueryObjectDataset) AsQuickBooksObjectDataset() (*QuickBooksObjectDataset, bool) { + return nil, false +} + +// AsPrestoObjectDataset is the BasicDataset implementation for GoogleBigQueryObjectDataset. +func (gbqod GoogleBigQueryObjectDataset) AsPrestoObjectDataset() (*PrestoObjectDataset, bool) { + return nil, false +} + +// AsPhoenixObjectDataset is the BasicDataset implementation for GoogleBigQueryObjectDataset. +func (gbqod GoogleBigQueryObjectDataset) AsPhoenixObjectDataset() (*PhoenixObjectDataset, bool) { + return nil, false +} + +// AsPaypalObjectDataset is the BasicDataset implementation for GoogleBigQueryObjectDataset. +func (gbqod GoogleBigQueryObjectDataset) AsPaypalObjectDataset() (*PaypalObjectDataset, bool) { + return nil, false +} + +// AsMarketoObjectDataset is the BasicDataset implementation for GoogleBigQueryObjectDataset. +func (gbqod GoogleBigQueryObjectDataset) AsMarketoObjectDataset() (*MarketoObjectDataset, bool) { + return nil, false +} + +// AsMariaDBTableDataset is the BasicDataset implementation for GoogleBigQueryObjectDataset. +func (gbqod GoogleBigQueryObjectDataset) AsMariaDBTableDataset() (*MariaDBTableDataset, bool) { + return nil, false +} + +// AsMagentoObjectDataset is the BasicDataset implementation for GoogleBigQueryObjectDataset. +func (gbqod GoogleBigQueryObjectDataset) AsMagentoObjectDataset() (*MagentoObjectDataset, bool) { + return nil, false +} + +// AsJiraObjectDataset is the BasicDataset implementation for GoogleBigQueryObjectDataset. +func (gbqod GoogleBigQueryObjectDataset) AsJiraObjectDataset() (*JiraObjectDataset, bool) { + return nil, false +} + +// AsImpalaObjectDataset is the BasicDataset implementation for GoogleBigQueryObjectDataset. +func (gbqod GoogleBigQueryObjectDataset) AsImpalaObjectDataset() (*ImpalaObjectDataset, bool) { + return nil, false +} + +// AsHubspotObjectDataset is the BasicDataset implementation for GoogleBigQueryObjectDataset. +func (gbqod GoogleBigQueryObjectDataset) AsHubspotObjectDataset() (*HubspotObjectDataset, bool) { + return nil, false +} + +// AsHiveObjectDataset is the BasicDataset implementation for GoogleBigQueryObjectDataset. +func (gbqod GoogleBigQueryObjectDataset) AsHiveObjectDataset() (*HiveObjectDataset, bool) { + return nil, false +} + +// AsHBaseObjectDataset is the BasicDataset implementation for GoogleBigQueryObjectDataset. +func (gbqod GoogleBigQueryObjectDataset) AsHBaseObjectDataset() (*HBaseObjectDataset, bool) { + return nil, false +} + +// AsGreenplumTableDataset is the BasicDataset implementation for GoogleBigQueryObjectDataset. +func (gbqod GoogleBigQueryObjectDataset) AsGreenplumTableDataset() (*GreenplumTableDataset, bool) { + return nil, false +} + +// AsGoogleBigQueryObjectDataset is the BasicDataset implementation for GoogleBigQueryObjectDataset. +func (gbqod GoogleBigQueryObjectDataset) AsGoogleBigQueryObjectDataset() (*GoogleBigQueryObjectDataset, bool) { + return &gbqod, true +} + +// AsEloquaObjectDataset is the BasicDataset implementation for GoogleBigQueryObjectDataset. +func (gbqod GoogleBigQueryObjectDataset) AsEloquaObjectDataset() (*EloquaObjectDataset, bool) { + return nil, false +} + +// AsDrillTableDataset is the BasicDataset implementation for GoogleBigQueryObjectDataset. +func (gbqod GoogleBigQueryObjectDataset) AsDrillTableDataset() (*DrillTableDataset, bool) { + return nil, false +} + +// AsCouchbaseTableDataset is the BasicDataset implementation for GoogleBigQueryObjectDataset. +func (gbqod GoogleBigQueryObjectDataset) AsCouchbaseTableDataset() (*CouchbaseTableDataset, bool) { + return nil, false +} + +// AsConcurObjectDataset is the BasicDataset implementation for GoogleBigQueryObjectDataset. +func (gbqod GoogleBigQueryObjectDataset) AsConcurObjectDataset() (*ConcurObjectDataset, bool) { + return nil, false +} + +// AsAzurePostgreSQLTableDataset is the BasicDataset implementation for GoogleBigQueryObjectDataset. +func (gbqod GoogleBigQueryObjectDataset) AsAzurePostgreSQLTableDataset() (*AzurePostgreSQLTableDataset, bool) { + return nil, false +} + +// AsAmazonMWSObjectDataset is the BasicDataset implementation for GoogleBigQueryObjectDataset. +func (gbqod GoogleBigQueryObjectDataset) AsAmazonMWSObjectDataset() (*AmazonMWSObjectDataset, bool) { + return nil, false +} + +// AsHTTPDataset is the BasicDataset implementation for GoogleBigQueryObjectDataset. +func (gbqod GoogleBigQueryObjectDataset) AsHTTPDataset() (*HTTPDataset, bool) { + return nil, false +} + +// AsAzureSearchIndexDataset is the BasicDataset implementation for GoogleBigQueryObjectDataset. +func (gbqod GoogleBigQueryObjectDataset) AsAzureSearchIndexDataset() (*AzureSearchIndexDataset, bool) { + return nil, false +} + +// AsWebTableDataset is the BasicDataset implementation for GoogleBigQueryObjectDataset. +func (gbqod GoogleBigQueryObjectDataset) AsWebTableDataset() (*WebTableDataset, bool) { + return nil, false +} + +// AsSQLServerTableDataset is the BasicDataset implementation for GoogleBigQueryObjectDataset. +func (gbqod GoogleBigQueryObjectDataset) AsSQLServerTableDataset() (*SQLServerTableDataset, bool) { + return nil, false +} + +// AsSapEccResourceDataset is the BasicDataset implementation for GoogleBigQueryObjectDataset. +func (gbqod GoogleBigQueryObjectDataset) AsSapEccResourceDataset() (*SapEccResourceDataset, bool) { + return nil, false +} + +// AsSapCloudForCustomerResourceDataset is the BasicDataset implementation for GoogleBigQueryObjectDataset. +func (gbqod GoogleBigQueryObjectDataset) AsSapCloudForCustomerResourceDataset() (*SapCloudForCustomerResourceDataset, bool) { + return nil, false +} + +// AsSalesforceObjectDataset is the BasicDataset implementation for GoogleBigQueryObjectDataset. +func (gbqod GoogleBigQueryObjectDataset) AsSalesforceObjectDataset() (*SalesforceObjectDataset, bool) { + return nil, false +} + +// AsRelationalTableDataset is the BasicDataset implementation for GoogleBigQueryObjectDataset. +func (gbqod GoogleBigQueryObjectDataset) AsRelationalTableDataset() (*RelationalTableDataset, bool) { + return nil, false +} + +// AsAzureMySQLTableDataset is the BasicDataset implementation for GoogleBigQueryObjectDataset. +func (gbqod GoogleBigQueryObjectDataset) AsAzureMySQLTableDataset() (*AzureMySQLTableDataset, bool) { + return nil, false +} + +// AsOracleTableDataset is the BasicDataset implementation for GoogleBigQueryObjectDataset. +func (gbqod GoogleBigQueryObjectDataset) AsOracleTableDataset() (*OracleTableDataset, bool) { + return nil, false +} + +// AsODataResourceDataset is the BasicDataset implementation for GoogleBigQueryObjectDataset. +func (gbqod GoogleBigQueryObjectDataset) AsODataResourceDataset() (*ODataResourceDataset, bool) { + return nil, false +} + +// AsMongoDbCollectionDataset is the BasicDataset implementation for GoogleBigQueryObjectDataset. +func (gbqod GoogleBigQueryObjectDataset) AsMongoDbCollectionDataset() (*MongoDbCollectionDataset, bool) { + return nil, false +} + +// AsFileShareDataset is the BasicDataset implementation for GoogleBigQueryObjectDataset. +func (gbqod GoogleBigQueryObjectDataset) AsFileShareDataset() (*FileShareDataset, bool) { + return nil, false +} + +// AsAzureDataLakeStoreDataset is the BasicDataset implementation for GoogleBigQueryObjectDataset. +func (gbqod GoogleBigQueryObjectDataset) AsAzureDataLakeStoreDataset() (*AzureDataLakeStoreDataset, bool) { + return nil, false +} + +// AsDynamicsEntityDataset is the BasicDataset implementation for GoogleBigQueryObjectDataset. +func (gbqod GoogleBigQueryObjectDataset) AsDynamicsEntityDataset() (*DynamicsEntityDataset, bool) { + return nil, false +} + +// AsDocumentDbCollectionDataset is the BasicDataset implementation for GoogleBigQueryObjectDataset. +func (gbqod GoogleBigQueryObjectDataset) AsDocumentDbCollectionDataset() (*DocumentDbCollectionDataset, bool) { + return nil, false +} + +// AsCustomDataset is the BasicDataset implementation for GoogleBigQueryObjectDataset. +func (gbqod GoogleBigQueryObjectDataset) AsCustomDataset() (*CustomDataset, bool) { + return nil, false +} + +// AsCassandraTableDataset is the BasicDataset implementation for GoogleBigQueryObjectDataset. +func (gbqod GoogleBigQueryObjectDataset) AsCassandraTableDataset() (*CassandraTableDataset, bool) { + return nil, false +} + +// AsAzureSQLDWTableDataset is the BasicDataset implementation for GoogleBigQueryObjectDataset. +func (gbqod GoogleBigQueryObjectDataset) AsAzureSQLDWTableDataset() (*AzureSQLDWTableDataset, bool) { + return nil, false +} + +// AsAzureSQLTableDataset is the BasicDataset implementation for GoogleBigQueryObjectDataset. +func (gbqod GoogleBigQueryObjectDataset) AsAzureSQLTableDataset() (*AzureSQLTableDataset, bool) { + return nil, false +} + +// AsAzureTableDataset is the BasicDataset implementation for GoogleBigQueryObjectDataset. +func (gbqod GoogleBigQueryObjectDataset) AsAzureTableDataset() (*AzureTableDataset, bool) { + return nil, false +} + +// AsAzureBlobDataset is the BasicDataset implementation for GoogleBigQueryObjectDataset. +func (gbqod GoogleBigQueryObjectDataset) AsAzureBlobDataset() (*AzureBlobDataset, bool) { + return nil, false +} + +// AsAmazonS3Dataset is the BasicDataset implementation for GoogleBigQueryObjectDataset. +func (gbqod GoogleBigQueryObjectDataset) AsAmazonS3Dataset() (*AmazonS3Dataset, bool) { + return nil, false +} + +// AsDataset is the BasicDataset implementation for GoogleBigQueryObjectDataset. +func (gbqod GoogleBigQueryObjectDataset) AsDataset() (*Dataset, bool) { + return nil, false +} + +// AsBasicDataset is the BasicDataset implementation for GoogleBigQueryObjectDataset. +func (gbqod GoogleBigQueryObjectDataset) AsBasicDataset() (BasicDataset, bool) { + return &gbqod, true +} + +// GoogleBigQuerySource a copy activity Google BigQuery service source. +type GoogleBigQuerySource struct { + // Query - A query to retrieve data from source. Type: string (or Expression with resultType string). + Query interface{} `json:"query,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // SourceRetryCount - Source retry count. Type: integer (or Expression with resultType integer). + SourceRetryCount interface{} `json:"sourceRetryCount,omitempty"` + // SourceRetryWait - Source retry wait. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` + // Type - Possible values include: 'TypeCopySource', 'TypeAmazonRedshiftSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeHTTPSource', 'TypeAzureDataLakeStoreSource', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeRelationalSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource' + Type TypeBasicCopySource `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for GoogleBigQuerySource. +func (gbqs GoogleBigQuerySource) MarshalJSON() ([]byte, error) { + gbqs.Type = TypeGoogleBigQuerySource + objectMap := make(map[string]interface{}) + objectMap["query"] = gbqs.Query + objectMap["sourceRetryCount"] = gbqs.SourceRetryCount + objectMap["sourceRetryWait"] = gbqs.SourceRetryWait + if gbqs.Type != "" { + objectMap["type"] = gbqs.Type + } + for k, v := range gbqs.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsAmazonRedshiftSource is the BasicCopySource implementation for GoogleBigQuerySource. +func (gbqs GoogleBigQuerySource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { + return nil, false +} + +// AsResponsysSource is the BasicCopySource implementation for GoogleBigQuerySource. +func (gbqs GoogleBigQuerySource) AsResponsysSource() (*ResponsysSource, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudSource is the BasicCopySource implementation for GoogleBigQuerySource. +func (gbqs GoogleBigQuerySource) AsSalesforceMarketingCloudSource() (*SalesforceMarketingCloudSource, bool) { + return nil, false +} + +// AsVerticaSource is the BasicCopySource implementation for GoogleBigQuerySource. +func (gbqs GoogleBigQuerySource) AsVerticaSource() (*VerticaSource, bool) { + return nil, false +} + +// AsNetezzaSource is the BasicCopySource implementation for GoogleBigQuerySource. +func (gbqs GoogleBigQuerySource) AsNetezzaSource() (*NetezzaSource, bool) { + return nil, false +} + +// AsZohoSource is the BasicCopySource implementation for GoogleBigQuerySource. +func (gbqs GoogleBigQuerySource) AsZohoSource() (*ZohoSource, bool) { + return nil, false +} + +// AsXeroSource is the BasicCopySource implementation for GoogleBigQuerySource. +func (gbqs GoogleBigQuerySource) AsXeroSource() (*XeroSource, bool) { + return nil, false +} + +// AsSquareSource is the BasicCopySource implementation for GoogleBigQuerySource. +func (gbqs GoogleBigQuerySource) AsSquareSource() (*SquareSource, bool) { + return nil, false +} + +// AsSparkSource is the BasicCopySource implementation for GoogleBigQuerySource. +func (gbqs GoogleBigQuerySource) AsSparkSource() (*SparkSource, bool) { + return nil, false +} + +// AsShopifySource is the BasicCopySource implementation for GoogleBigQuerySource. +func (gbqs GoogleBigQuerySource) AsShopifySource() (*ShopifySource, bool) { + return nil, false +} + +// AsServiceNowSource is the BasicCopySource implementation for GoogleBigQuerySource. +func (gbqs GoogleBigQuerySource) AsServiceNowSource() (*ServiceNowSource, bool) { + return nil, false +} + +// AsQuickBooksSource is the BasicCopySource implementation for GoogleBigQuerySource. +func (gbqs GoogleBigQuerySource) AsQuickBooksSource() (*QuickBooksSource, bool) { + return nil, false +} + +// AsPrestoSource is the BasicCopySource implementation for GoogleBigQuerySource. +func (gbqs GoogleBigQuerySource) AsPrestoSource() (*PrestoSource, bool) { + return nil, false +} + +// AsPhoenixSource is the BasicCopySource implementation for GoogleBigQuerySource. +func (gbqs GoogleBigQuerySource) AsPhoenixSource() (*PhoenixSource, bool) { + return nil, false +} + +// AsPaypalSource is the BasicCopySource implementation for GoogleBigQuerySource. +func (gbqs GoogleBigQuerySource) AsPaypalSource() (*PaypalSource, bool) { + return nil, false +} + +// AsMarketoSource is the BasicCopySource implementation for GoogleBigQuerySource. +func (gbqs GoogleBigQuerySource) AsMarketoSource() (*MarketoSource, bool) { + return nil, false +} + +// AsMariaDBSource is the BasicCopySource implementation for GoogleBigQuerySource. +func (gbqs GoogleBigQuerySource) AsMariaDBSource() (*MariaDBSource, bool) { + return nil, false +} + +// AsMagentoSource is the BasicCopySource implementation for GoogleBigQuerySource. +func (gbqs GoogleBigQuerySource) AsMagentoSource() (*MagentoSource, bool) { + return nil, false +} + +// AsJiraSource is the BasicCopySource implementation for GoogleBigQuerySource. +func (gbqs GoogleBigQuerySource) AsJiraSource() (*JiraSource, bool) { + return nil, false +} + +// AsImpalaSource is the BasicCopySource implementation for GoogleBigQuerySource. +func (gbqs GoogleBigQuerySource) AsImpalaSource() (*ImpalaSource, bool) { + return nil, false +} + +// AsHubspotSource is the BasicCopySource implementation for GoogleBigQuerySource. +func (gbqs GoogleBigQuerySource) AsHubspotSource() (*HubspotSource, bool) { + return nil, false +} + +// AsHiveSource is the BasicCopySource implementation for GoogleBigQuerySource. +func (gbqs GoogleBigQuerySource) AsHiveSource() (*HiveSource, bool) { + return nil, false +} + +// AsHBaseSource is the BasicCopySource implementation for GoogleBigQuerySource. +func (gbqs GoogleBigQuerySource) AsHBaseSource() (*HBaseSource, bool) { + return nil, false +} + +// AsGreenplumSource is the BasicCopySource implementation for GoogleBigQuerySource. +func (gbqs GoogleBigQuerySource) AsGreenplumSource() (*GreenplumSource, bool) { + return nil, false +} + +// AsGoogleBigQuerySource is the BasicCopySource implementation for GoogleBigQuerySource. +func (gbqs GoogleBigQuerySource) AsGoogleBigQuerySource() (*GoogleBigQuerySource, bool) { + return &gbqs, true +} + +// AsEloquaSource is the BasicCopySource implementation for GoogleBigQuerySource. +func (gbqs GoogleBigQuerySource) AsEloquaSource() (*EloquaSource, bool) { + return nil, false +} + +// AsDrillSource is the BasicCopySource implementation for GoogleBigQuerySource. +func (gbqs GoogleBigQuerySource) AsDrillSource() (*DrillSource, bool) { + return nil, false +} + +// AsCouchbaseSource is the BasicCopySource implementation for GoogleBigQuerySource. +func (gbqs GoogleBigQuerySource) AsCouchbaseSource() (*CouchbaseSource, bool) { + return nil, false +} + +// AsConcurSource is the BasicCopySource implementation for GoogleBigQuerySource. +func (gbqs GoogleBigQuerySource) AsConcurSource() (*ConcurSource, bool) { + return nil, false +} + +// AsAzurePostgreSQLSource is the BasicCopySource implementation for GoogleBigQuerySource. +func (gbqs GoogleBigQuerySource) AsAzurePostgreSQLSource() (*AzurePostgreSQLSource, bool) { + return nil, false +} + +// AsAmazonMWSSource is the BasicCopySource implementation for GoogleBigQuerySource. +func (gbqs GoogleBigQuerySource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { + return nil, false +} + +// AsHTTPSource is the BasicCopySource implementation for GoogleBigQuerySource. +func (gbqs GoogleBigQuerySource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for GoogleBigQuerySource. +func (gbqs GoogleBigQuerySource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for GoogleBigQuerySource. +func (gbqs GoogleBigQuerySource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsCassandraSource is the BasicCopySource implementation for GoogleBigQuerySource. +func (gbqs GoogleBigQuerySource) AsCassandraSource() (*CassandraSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for GoogleBigQuerySource. +func (gbqs GoogleBigQuerySource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for GoogleBigQuerySource. +func (gbqs GoogleBigQuerySource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureMySQLSource is the BasicCopySource implementation for GoogleBigQuerySource. +func (gbqs GoogleBigQuerySource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for GoogleBigQuerySource. +func (gbqs GoogleBigQuerySource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for GoogleBigQuerySource. +func (gbqs GoogleBigQuerySource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsSQLDWSource is the BasicCopySource implementation for GoogleBigQuerySource. +func (gbqs GoogleBigQuerySource) AsSQLDWSource() (*SQLDWSource, bool) { + return nil, false +} + +// AsSQLSource is the BasicCopySource implementation for GoogleBigQuerySource. +func (gbqs GoogleBigQuerySource) AsSQLSource() (*SQLSource, bool) { + return nil, false +} + +// AsSapEccSource is the BasicCopySource implementation for GoogleBigQuerySource. +func (gbqs GoogleBigQuerySource) AsSapEccSource() (*SapEccSource, bool) { + return nil, false +} + +// AsSapCloudForCustomerSource is the BasicCopySource implementation for GoogleBigQuerySource. +func (gbqs GoogleBigQuerySource) AsSapCloudForCustomerSource() (*SapCloudForCustomerSource, bool) { + return nil, false +} + +// AsSalesforceSource is the BasicCopySource implementation for GoogleBigQuerySource. +func (gbqs GoogleBigQuerySource) AsSalesforceSource() (*SalesforceSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for GoogleBigQuerySource. +func (gbqs GoogleBigQuerySource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for GoogleBigQuerySource. +func (gbqs GoogleBigQuerySource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for GoogleBigQuerySource. +func (gbqs GoogleBigQuerySource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for GoogleBigQuerySource. +func (gbqs GoogleBigQuerySource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + +// AsAzureTableSource is the BasicCopySource implementation for GoogleBigQuerySource. +func (gbqs GoogleBigQuerySource) AsAzureTableSource() (*AzureTableSource, bool) { + return nil, false +} + +// AsCopySource is the BasicCopySource implementation for GoogleBigQuerySource. +func (gbqs GoogleBigQuerySource) AsCopySource() (*CopySource, bool) { + return nil, false +} + +// AsBasicCopySource is the BasicCopySource implementation for GoogleBigQuerySource. +func (gbqs GoogleBigQuerySource) AsBasicCopySource() (BasicCopySource, bool) { + return &gbqs, true +} + +// GreenplumLinkedService greenplum Database linked service. +type GreenplumLinkedService struct { + // GreenplumLinkedServiceTypeProperties - Greenplum Database linked service properties. + *GreenplumLinkedServiceTypeProperties `json:"typeProperties,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // ConnectVia - The integration runtime reference. + ConnectVia *IntegrationRuntimeReference `json:"connectVia,omitempty"` + // Description - Linked service description. + Description *string `json:"description,omitempty"` + // Parameters - Parameters for linked service. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeLinkedService', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforce', 'TypeAzureDataLakeStore', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureStorage' + Type TypeBasicLinkedService `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for GreenplumLinkedService. +func (gls GreenplumLinkedService) MarshalJSON() ([]byte, error) { + gls.Type = TypeGreenplum + objectMap := make(map[string]interface{}) + if gls.GreenplumLinkedServiceTypeProperties != nil { + objectMap["typeProperties"] = gls.GreenplumLinkedServiceTypeProperties + } + if gls.ConnectVia != nil { + objectMap["connectVia"] = gls.ConnectVia + } + if gls.Description != nil { + objectMap["description"] = gls.Description + } + if gls.Parameters != nil { + objectMap["parameters"] = gls.Parameters + } + if gls.Annotations != nil { + objectMap["annotations"] = gls.Annotations + } + if gls.Type != "" { + objectMap["type"] = gls.Type + } + for k, v := range gls.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysLinkedService is the BasicLinkedService implementation for GreenplumLinkedService. +func (gls GreenplumLinkedService) AsResponsysLinkedService() (*ResponsysLinkedService, bool) { + return nil, false +} + +// AsAzureDatabricksLinkedService is the BasicLinkedService implementation for GreenplumLinkedService. +func (gls GreenplumLinkedService) AsAzureDatabricksLinkedService() (*AzureDatabricksLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeAnalyticsLinkedService is the BasicLinkedService implementation for GreenplumLinkedService. +func (gls GreenplumLinkedService) AsAzureDataLakeAnalyticsLinkedService() (*AzureDataLakeAnalyticsLinkedService, bool) { + return nil, false +} + +// AsHDInsightOnDemandLinkedService is the BasicLinkedService implementation for GreenplumLinkedService. +func (gls GreenplumLinkedService) AsHDInsightOnDemandLinkedService() (*HDInsightOnDemandLinkedService, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudLinkedService is the BasicLinkedService implementation for GreenplumLinkedService. +func (gls GreenplumLinkedService) AsSalesforceMarketingCloudLinkedService() (*SalesforceMarketingCloudLinkedService, bool) { + return nil, false +} + +// AsNetezzaLinkedService is the BasicLinkedService implementation for GreenplumLinkedService. +func (gls GreenplumLinkedService) AsNetezzaLinkedService() (*NetezzaLinkedService, bool) { + return nil, false +} + +// AsVerticaLinkedService is the BasicLinkedService implementation for GreenplumLinkedService. +func (gls GreenplumLinkedService) AsVerticaLinkedService() (*VerticaLinkedService, bool) { + return nil, false +} + +// AsZohoLinkedService is the BasicLinkedService implementation for GreenplumLinkedService. +func (gls GreenplumLinkedService) AsZohoLinkedService() (*ZohoLinkedService, bool) { + return nil, false +} + +// AsXeroLinkedService is the BasicLinkedService implementation for GreenplumLinkedService. +func (gls GreenplumLinkedService) AsXeroLinkedService() (*XeroLinkedService, bool) { + return nil, false +} + +// AsSquareLinkedService is the BasicLinkedService implementation for GreenplumLinkedService. +func (gls GreenplumLinkedService) AsSquareLinkedService() (*SquareLinkedService, bool) { + return nil, false +} + +// AsSparkLinkedService is the BasicLinkedService implementation for GreenplumLinkedService. +func (gls GreenplumLinkedService) AsSparkLinkedService() (*SparkLinkedService, bool) { + return nil, false +} + +// AsShopifyLinkedService is the BasicLinkedService implementation for GreenplumLinkedService. +func (gls GreenplumLinkedService) AsShopifyLinkedService() (*ShopifyLinkedService, bool) { + return nil, false +} + +// AsServiceNowLinkedService is the BasicLinkedService implementation for GreenplumLinkedService. +func (gls GreenplumLinkedService) AsServiceNowLinkedService() (*ServiceNowLinkedService, bool) { + return nil, false +} + +// AsQuickBooksLinkedService is the BasicLinkedService implementation for GreenplumLinkedService. +func (gls GreenplumLinkedService) AsQuickBooksLinkedService() (*QuickBooksLinkedService, bool) { + return nil, false +} + +// AsPrestoLinkedService is the BasicLinkedService implementation for GreenplumLinkedService. +func (gls GreenplumLinkedService) AsPrestoLinkedService() (*PrestoLinkedService, bool) { + return nil, false +} + +// AsPhoenixLinkedService is the BasicLinkedService implementation for GreenplumLinkedService. +func (gls GreenplumLinkedService) AsPhoenixLinkedService() (*PhoenixLinkedService, bool) { + return nil, false +} + +// AsPaypalLinkedService is the BasicLinkedService implementation for GreenplumLinkedService. +func (gls GreenplumLinkedService) AsPaypalLinkedService() (*PaypalLinkedService, bool) { + return nil, false +} + +// AsMarketoLinkedService is the BasicLinkedService implementation for GreenplumLinkedService. +func (gls GreenplumLinkedService) AsMarketoLinkedService() (*MarketoLinkedService, bool) { + return nil, false +} + +// AsMariaDBLinkedService is the BasicLinkedService implementation for GreenplumLinkedService. +func (gls GreenplumLinkedService) AsMariaDBLinkedService() (*MariaDBLinkedService, bool) { + return nil, false +} + +// AsMagentoLinkedService is the BasicLinkedService implementation for GreenplumLinkedService. +func (gls GreenplumLinkedService) AsMagentoLinkedService() (*MagentoLinkedService, bool) { + return nil, false +} + +// AsJiraLinkedService is the BasicLinkedService implementation for GreenplumLinkedService. +func (gls GreenplumLinkedService) AsJiraLinkedService() (*JiraLinkedService, bool) { + return nil, false +} + +// AsImpalaLinkedService is the BasicLinkedService implementation for GreenplumLinkedService. +func (gls GreenplumLinkedService) AsImpalaLinkedService() (*ImpalaLinkedService, bool) { + return nil, false +} + +// AsHubspotLinkedService is the BasicLinkedService implementation for GreenplumLinkedService. +func (gls GreenplumLinkedService) AsHubspotLinkedService() (*HubspotLinkedService, bool) { + return nil, false +} + +// AsHiveLinkedService is the BasicLinkedService implementation for GreenplumLinkedService. +func (gls GreenplumLinkedService) AsHiveLinkedService() (*HiveLinkedService, bool) { + return nil, false +} + +// AsHBaseLinkedService is the BasicLinkedService implementation for GreenplumLinkedService. +func (gls GreenplumLinkedService) AsHBaseLinkedService() (*HBaseLinkedService, bool) { + return nil, false +} + +// AsGreenplumLinkedService is the BasicLinkedService implementation for GreenplumLinkedService. +func (gls GreenplumLinkedService) AsGreenplumLinkedService() (*GreenplumLinkedService, bool) { + return &gls, true +} + +// AsGoogleBigQueryLinkedService is the BasicLinkedService implementation for GreenplumLinkedService. +func (gls GreenplumLinkedService) AsGoogleBigQueryLinkedService() (*GoogleBigQueryLinkedService, bool) { + return nil, false +} + +// AsEloquaLinkedService is the BasicLinkedService implementation for GreenplumLinkedService. +func (gls GreenplumLinkedService) AsEloquaLinkedService() (*EloquaLinkedService, bool) { + return nil, false +} + +// AsDrillLinkedService is the BasicLinkedService implementation for GreenplumLinkedService. +func (gls GreenplumLinkedService) AsDrillLinkedService() (*DrillLinkedService, bool) { + return nil, false +} + +// AsCouchbaseLinkedService is the BasicLinkedService implementation for GreenplumLinkedService. +func (gls GreenplumLinkedService) AsCouchbaseLinkedService() (*CouchbaseLinkedService, bool) { + return nil, false +} + +// AsConcurLinkedService is the BasicLinkedService implementation for GreenplumLinkedService. +func (gls GreenplumLinkedService) AsConcurLinkedService() (*ConcurLinkedService, bool) { + return nil, false +} + +// AsAzurePostgreSQLLinkedService is the BasicLinkedService implementation for GreenplumLinkedService. +func (gls GreenplumLinkedService) AsAzurePostgreSQLLinkedService() (*AzurePostgreSQLLinkedService, bool) { + return nil, false +} + +// AsAmazonMWSLinkedService is the BasicLinkedService implementation for GreenplumLinkedService. +func (gls GreenplumLinkedService) AsAmazonMWSLinkedService() (*AmazonMWSLinkedService, bool) { + return nil, false +} + +// AsSapHanaLinkedService is the BasicLinkedService implementation for GreenplumLinkedService. +func (gls GreenplumLinkedService) AsSapHanaLinkedService() (*SapHanaLinkedService, bool) { + return nil, false +} + +// AsSapBWLinkedService is the BasicLinkedService implementation for GreenplumLinkedService. +func (gls GreenplumLinkedService) AsSapBWLinkedService() (*SapBWLinkedService, bool) { + return nil, false +} + +// AsSftpServerLinkedService is the BasicLinkedService implementation for GreenplumLinkedService. +func (gls GreenplumLinkedService) AsSftpServerLinkedService() (*SftpServerLinkedService, bool) { + return nil, false +} + +// AsFtpServerLinkedService is the BasicLinkedService implementation for GreenplumLinkedService. +func (gls GreenplumLinkedService) AsFtpServerLinkedService() (*FtpServerLinkedService, bool) { + return nil, false +} + +// AsHTTPLinkedService is the BasicLinkedService implementation for GreenplumLinkedService. +func (gls GreenplumLinkedService) AsHTTPLinkedService() (*HTTPLinkedService, bool) { + return nil, false +} + +// AsAzureSearchLinkedService is the BasicLinkedService implementation for GreenplumLinkedService. +func (gls GreenplumLinkedService) AsAzureSearchLinkedService() (*AzureSearchLinkedService, bool) { + return nil, false +} + +// AsCustomDataSourceLinkedService is the BasicLinkedService implementation for GreenplumLinkedService. +func (gls GreenplumLinkedService) AsCustomDataSourceLinkedService() (*CustomDataSourceLinkedService, bool) { + return nil, false +} + +// AsAmazonRedshiftLinkedService is the BasicLinkedService implementation for GreenplumLinkedService. +func (gls GreenplumLinkedService) AsAmazonRedshiftLinkedService() (*AmazonRedshiftLinkedService, bool) { + return nil, false +} + +// AsAmazonS3LinkedService is the BasicLinkedService implementation for GreenplumLinkedService. +func (gls GreenplumLinkedService) AsAmazonS3LinkedService() (*AmazonS3LinkedService, bool) { + return nil, false +} + +// AsSapEccLinkedService is the BasicLinkedService implementation for GreenplumLinkedService. +func (gls GreenplumLinkedService) AsSapEccLinkedService() (*SapEccLinkedService, bool) { + return nil, false +} + +// AsSapCloudForCustomerLinkedService is the BasicLinkedService implementation for GreenplumLinkedService. +func (gls GreenplumLinkedService) AsSapCloudForCustomerLinkedService() (*SapCloudForCustomerLinkedService, bool) { + return nil, false +} + +// AsSalesforceLinkedService is the BasicLinkedService implementation for GreenplumLinkedService. +func (gls GreenplumLinkedService) AsSalesforceLinkedService() (*SalesforceLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeStoreLinkedService is the BasicLinkedService implementation for GreenplumLinkedService. +func (gls GreenplumLinkedService) AsAzureDataLakeStoreLinkedService() (*AzureDataLakeStoreLinkedService, bool) { + return nil, false +} + +// AsMongoDbLinkedService is the BasicLinkedService implementation for GreenplumLinkedService. +func (gls GreenplumLinkedService) AsMongoDbLinkedService() (*MongoDbLinkedService, bool) { + return nil, false +} + +// AsCassandraLinkedService is the BasicLinkedService implementation for GreenplumLinkedService. +func (gls GreenplumLinkedService) AsCassandraLinkedService() (*CassandraLinkedService, bool) { + return nil, false +} + +// AsWebLinkedService is the BasicLinkedService implementation for GreenplumLinkedService. +func (gls GreenplumLinkedService) AsWebLinkedService() (*WebLinkedService, bool) { + return nil, false +} + +// AsODataLinkedService is the BasicLinkedService implementation for GreenplumLinkedService. +func (gls GreenplumLinkedService) AsODataLinkedService() (*ODataLinkedService, bool) { + return nil, false +} + +// AsHdfsLinkedService is the BasicLinkedService implementation for GreenplumLinkedService. +func (gls GreenplumLinkedService) AsHdfsLinkedService() (*HdfsLinkedService, bool) { + return nil, false +} + +// AsOdbcLinkedService is the BasicLinkedService implementation for GreenplumLinkedService. +func (gls GreenplumLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, bool) { + return nil, false +} + +// AsAzureMLLinkedService is the BasicLinkedService implementation for GreenplumLinkedService. +func (gls GreenplumLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { + return nil, false +} + +// AsTeradataLinkedService is the BasicLinkedService implementation for GreenplumLinkedService. +func (gls GreenplumLinkedService) AsTeradataLinkedService() (*TeradataLinkedService, bool) { + return nil, false +} + +// AsDb2LinkedService is the BasicLinkedService implementation for GreenplumLinkedService. +func (gls GreenplumLinkedService) AsDb2LinkedService() (*Db2LinkedService, bool) { + return nil, false +} + +// AsSybaseLinkedService is the BasicLinkedService implementation for GreenplumLinkedService. +func (gls GreenplumLinkedService) AsSybaseLinkedService() (*SybaseLinkedService, bool) { + return nil, false +} + +// AsPostgreSQLLinkedService is the BasicLinkedService implementation for GreenplumLinkedService. +func (gls GreenplumLinkedService) AsPostgreSQLLinkedService() (*PostgreSQLLinkedService, bool) { + return nil, false +} + +// AsMySQLLinkedService is the BasicLinkedService implementation for GreenplumLinkedService. +func (gls GreenplumLinkedService) AsMySQLLinkedService() (*MySQLLinkedService, bool) { + return nil, false +} + +// AsAzureMySQLLinkedService is the BasicLinkedService implementation for GreenplumLinkedService. +func (gls GreenplumLinkedService) AsAzureMySQLLinkedService() (*AzureMySQLLinkedService, bool) { + return nil, false +} + +// AsOracleLinkedService is the BasicLinkedService implementation for GreenplumLinkedService. +func (gls GreenplumLinkedService) AsOracleLinkedService() (*OracleLinkedService, bool) { + return nil, false +} + +// AsFileServerLinkedService is the BasicLinkedService implementation for GreenplumLinkedService. +func (gls GreenplumLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { + return nil, false +} + +// AsHDInsightLinkedService is the BasicLinkedService implementation for GreenplumLinkedService. +func (gls GreenplumLinkedService) AsHDInsightLinkedService() (*HDInsightLinkedService, bool) { + return nil, false +} + +// AsDynamicsLinkedService is the BasicLinkedService implementation for GreenplumLinkedService. +func (gls GreenplumLinkedService) AsDynamicsLinkedService() (*DynamicsLinkedService, bool) { + return nil, false +} + +// AsCosmosDbLinkedService is the BasicLinkedService implementation for GreenplumLinkedService. +func (gls GreenplumLinkedService) AsCosmosDbLinkedService() (*CosmosDbLinkedService, bool) { + return nil, false +} + +// AsAzureKeyVaultLinkedService is the BasicLinkedService implementation for GreenplumLinkedService. +func (gls GreenplumLinkedService) AsAzureKeyVaultLinkedService() (*AzureKeyVaultLinkedService, bool) { + return nil, false +} + +// AsAzureBatchLinkedService is the BasicLinkedService implementation for GreenplumLinkedService. +func (gls GreenplumLinkedService) AsAzureBatchLinkedService() (*AzureBatchLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDatabaseLinkedService is the BasicLinkedService implementation for GreenplumLinkedService. +func (gls GreenplumLinkedService) AsAzureSQLDatabaseLinkedService() (*AzureSQLDatabaseLinkedService, bool) { + return nil, false +} + +// AsSQLServerLinkedService is the BasicLinkedService implementation for GreenplumLinkedService. +func (gls GreenplumLinkedService) AsSQLServerLinkedService() (*SQLServerLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDWLinkedService is the BasicLinkedService implementation for GreenplumLinkedService. +func (gls GreenplumLinkedService) AsAzureSQLDWLinkedService() (*AzureSQLDWLinkedService, bool) { + return nil, false +} + +// AsAzureStorageLinkedService is the BasicLinkedService implementation for GreenplumLinkedService. +func (gls GreenplumLinkedService) AsAzureStorageLinkedService() (*AzureStorageLinkedService, bool) { + return nil, false +} + +// AsLinkedService is the BasicLinkedService implementation for GreenplumLinkedService. +func (gls GreenplumLinkedService) AsLinkedService() (*LinkedService, bool) { + return nil, false +} + +// AsBasicLinkedService is the BasicLinkedService implementation for GreenplumLinkedService. +func (gls GreenplumLinkedService) AsBasicLinkedService() (BasicLinkedService, bool) { + return &gls, true +} + +// UnmarshalJSON is the custom unmarshaler for GreenplumLinkedService struct. +func (gls *GreenplumLinkedService) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "typeProperties": + if v != nil { + var greenplumLinkedServiceTypeProperties GreenplumLinkedServiceTypeProperties + err = json.Unmarshal(*v, &greenplumLinkedServiceTypeProperties) + if err != nil { + return err + } + gls.GreenplumLinkedServiceTypeProperties = &greenplumLinkedServiceTypeProperties + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if gls.AdditionalProperties == nil { + gls.AdditionalProperties = make(map[string]interface{}) + } + gls.AdditionalProperties[k] = additionalProperties + } + case "connectVia": + if v != nil { + var connectVia IntegrationRuntimeReference + err = json.Unmarshal(*v, &connectVia) + if err != nil { + return err + } + gls.ConnectVia = &connectVia + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + gls.Description = &description + } + case "parameters": + if v != nil { + var parameters map[string]*ParameterSpecification + err = json.Unmarshal(*v, ¶meters) + if err != nil { + return err + } + gls.Parameters = parameters + } + case "annotations": + if v != nil { + var annotations []interface{} + err = json.Unmarshal(*v, &annotations) + if err != nil { + return err + } + gls.Annotations = &annotations + } + case "type": + if v != nil { + var typeVar TypeBasicLinkedService + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + gls.Type = typeVar + } + } + } + + return nil +} + +// GreenplumLinkedServiceTypeProperties greenplum Database linked service properties. +type GreenplumLinkedServiceTypeProperties struct { + // ConnectionString - An ODBC connection string. Type: string, SecureString or AzureKeyVaultSecretReference. + ConnectionString interface{} `json:"connectionString,omitempty"` + // EncryptedCredential - The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string). + EncryptedCredential interface{} `json:"encryptedCredential,omitempty"` +} + +// GreenplumSource a copy activity Greenplum Database source. +type GreenplumSource struct { + // Query - A query to retrieve data from source. Type: string (or Expression with resultType string). + Query interface{} `json:"query,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // SourceRetryCount - Source retry count. Type: integer (or Expression with resultType integer). + SourceRetryCount interface{} `json:"sourceRetryCount,omitempty"` + // SourceRetryWait - Source retry wait. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` + // Type - Possible values include: 'TypeCopySource', 'TypeAmazonRedshiftSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeHTTPSource', 'TypeAzureDataLakeStoreSource', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeRelationalSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource' + Type TypeBasicCopySource `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for GreenplumSource. +func (gs GreenplumSource) MarshalJSON() ([]byte, error) { + gs.Type = TypeGreenplumSource + objectMap := make(map[string]interface{}) + objectMap["query"] = gs.Query + objectMap["sourceRetryCount"] = gs.SourceRetryCount + objectMap["sourceRetryWait"] = gs.SourceRetryWait + if gs.Type != "" { + objectMap["type"] = gs.Type + } + for k, v := range gs.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsAmazonRedshiftSource is the BasicCopySource implementation for GreenplumSource. +func (gs GreenplumSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { + return nil, false +} + +// AsResponsysSource is the BasicCopySource implementation for GreenplumSource. +func (gs GreenplumSource) AsResponsysSource() (*ResponsysSource, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudSource is the BasicCopySource implementation for GreenplumSource. +func (gs GreenplumSource) AsSalesforceMarketingCloudSource() (*SalesforceMarketingCloudSource, bool) { + return nil, false +} + +// AsVerticaSource is the BasicCopySource implementation for GreenplumSource. +func (gs GreenplumSource) AsVerticaSource() (*VerticaSource, bool) { + return nil, false +} + +// AsNetezzaSource is the BasicCopySource implementation for GreenplumSource. +func (gs GreenplumSource) AsNetezzaSource() (*NetezzaSource, bool) { + return nil, false +} + +// AsZohoSource is the BasicCopySource implementation for GreenplumSource. +func (gs GreenplumSource) AsZohoSource() (*ZohoSource, bool) { + return nil, false +} + +// AsXeroSource is the BasicCopySource implementation for GreenplumSource. +func (gs GreenplumSource) AsXeroSource() (*XeroSource, bool) { + return nil, false +} + +// AsSquareSource is the BasicCopySource implementation for GreenplumSource. +func (gs GreenplumSource) AsSquareSource() (*SquareSource, bool) { + return nil, false +} + +// AsSparkSource is the BasicCopySource implementation for GreenplumSource. +func (gs GreenplumSource) AsSparkSource() (*SparkSource, bool) { + return nil, false +} + +// AsShopifySource is the BasicCopySource implementation for GreenplumSource. +func (gs GreenplumSource) AsShopifySource() (*ShopifySource, bool) { + return nil, false +} + +// AsServiceNowSource is the BasicCopySource implementation for GreenplumSource. +func (gs GreenplumSource) AsServiceNowSource() (*ServiceNowSource, bool) { + return nil, false +} + +// AsQuickBooksSource is the BasicCopySource implementation for GreenplumSource. +func (gs GreenplumSource) AsQuickBooksSource() (*QuickBooksSource, bool) { + return nil, false +} + +// AsPrestoSource is the BasicCopySource implementation for GreenplumSource. +func (gs GreenplumSource) AsPrestoSource() (*PrestoSource, bool) { + return nil, false +} + +// AsPhoenixSource is the BasicCopySource implementation for GreenplumSource. +func (gs GreenplumSource) AsPhoenixSource() (*PhoenixSource, bool) { + return nil, false +} + +// AsPaypalSource is the BasicCopySource implementation for GreenplumSource. +func (gs GreenplumSource) AsPaypalSource() (*PaypalSource, bool) { + return nil, false +} + +// AsMarketoSource is the BasicCopySource implementation for GreenplumSource. +func (gs GreenplumSource) AsMarketoSource() (*MarketoSource, bool) { + return nil, false +} + +// AsMariaDBSource is the BasicCopySource implementation for GreenplumSource. +func (gs GreenplumSource) AsMariaDBSource() (*MariaDBSource, bool) { + return nil, false +} + +// AsMagentoSource is the BasicCopySource implementation for GreenplumSource. +func (gs GreenplumSource) AsMagentoSource() (*MagentoSource, bool) { + return nil, false +} + +// AsJiraSource is the BasicCopySource implementation for GreenplumSource. +func (gs GreenplumSource) AsJiraSource() (*JiraSource, bool) { + return nil, false +} + +// AsImpalaSource is the BasicCopySource implementation for GreenplumSource. +func (gs GreenplumSource) AsImpalaSource() (*ImpalaSource, bool) { + return nil, false +} + +// AsHubspotSource is the BasicCopySource implementation for GreenplumSource. +func (gs GreenplumSource) AsHubspotSource() (*HubspotSource, bool) { + return nil, false +} + +// AsHiveSource is the BasicCopySource implementation for GreenplumSource. +func (gs GreenplumSource) AsHiveSource() (*HiveSource, bool) { + return nil, false +} + +// AsHBaseSource is the BasicCopySource implementation for GreenplumSource. +func (gs GreenplumSource) AsHBaseSource() (*HBaseSource, bool) { + return nil, false +} + +// AsGreenplumSource is the BasicCopySource implementation for GreenplumSource. +func (gs GreenplumSource) AsGreenplumSource() (*GreenplumSource, bool) { + return &gs, true +} + +// AsGoogleBigQuerySource is the BasicCopySource implementation for GreenplumSource. +func (gs GreenplumSource) AsGoogleBigQuerySource() (*GoogleBigQuerySource, bool) { + return nil, false +} + +// AsEloquaSource is the BasicCopySource implementation for GreenplumSource. +func (gs GreenplumSource) AsEloquaSource() (*EloquaSource, bool) { + return nil, false +} + +// AsDrillSource is the BasicCopySource implementation for GreenplumSource. +func (gs GreenplumSource) AsDrillSource() (*DrillSource, bool) { + return nil, false +} + +// AsCouchbaseSource is the BasicCopySource implementation for GreenplumSource. +func (gs GreenplumSource) AsCouchbaseSource() (*CouchbaseSource, bool) { + return nil, false +} + +// AsConcurSource is the BasicCopySource implementation for GreenplumSource. +func (gs GreenplumSource) AsConcurSource() (*ConcurSource, bool) { + return nil, false +} + +// AsAzurePostgreSQLSource is the BasicCopySource implementation for GreenplumSource. +func (gs GreenplumSource) AsAzurePostgreSQLSource() (*AzurePostgreSQLSource, bool) { + return nil, false +} + +// AsAmazonMWSSource is the BasicCopySource implementation for GreenplumSource. +func (gs GreenplumSource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { + return nil, false +} + +// AsHTTPSource is the BasicCopySource implementation for GreenplumSource. +func (gs GreenplumSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for GreenplumSource. +func (gs GreenplumSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for GreenplumSource. +func (gs GreenplumSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsCassandraSource is the BasicCopySource implementation for GreenplumSource. +func (gs GreenplumSource) AsCassandraSource() (*CassandraSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for GreenplumSource. +func (gs GreenplumSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for GreenplumSource. +func (gs GreenplumSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureMySQLSource is the BasicCopySource implementation for GreenplumSource. +func (gs GreenplumSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for GreenplumSource. +func (gs GreenplumSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for GreenplumSource. +func (gs GreenplumSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsSQLDWSource is the BasicCopySource implementation for GreenplumSource. +func (gs GreenplumSource) AsSQLDWSource() (*SQLDWSource, bool) { + return nil, false +} + +// AsSQLSource is the BasicCopySource implementation for GreenplumSource. +func (gs GreenplumSource) AsSQLSource() (*SQLSource, bool) { + return nil, false +} + +// AsSapEccSource is the BasicCopySource implementation for GreenplumSource. +func (gs GreenplumSource) AsSapEccSource() (*SapEccSource, bool) { + return nil, false +} + +// AsSapCloudForCustomerSource is the BasicCopySource implementation for GreenplumSource. +func (gs GreenplumSource) AsSapCloudForCustomerSource() (*SapCloudForCustomerSource, bool) { + return nil, false +} + +// AsSalesforceSource is the BasicCopySource implementation for GreenplumSource. +func (gs GreenplumSource) AsSalesforceSource() (*SalesforceSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for GreenplumSource. +func (gs GreenplumSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for GreenplumSource. +func (gs GreenplumSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for GreenplumSource. +func (gs GreenplumSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for GreenplumSource. +func (gs GreenplumSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + +// AsAzureTableSource is the BasicCopySource implementation for GreenplumSource. +func (gs GreenplumSource) AsAzureTableSource() (*AzureTableSource, bool) { + return nil, false +} + +// AsCopySource is the BasicCopySource implementation for GreenplumSource. +func (gs GreenplumSource) AsCopySource() (*CopySource, bool) { + return nil, false +} + +// AsBasicCopySource is the BasicCopySource implementation for GreenplumSource. +func (gs GreenplumSource) AsBasicCopySource() (BasicCopySource, bool) { + return &gs, true +} + +// GreenplumTableDataset greenplum Database dataset. +type GreenplumTableDataset struct { + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Description - Dataset description. + Description *string `json:"description,omitempty"` + // Structure - Columns that define the structure of the dataset. Type: array (or Expression with resultType array), itemType: DatasetDataElement. + Structure interface{} `json:"structure,omitempty"` + // LinkedServiceName - Linked service reference. + LinkedServiceName *LinkedServiceReference `json:"linkedServiceName,omitempty"` + // Parameters - Parameters for dataset. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeDataset', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSQLServerTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSalesforceObject', 'TypeRelationalTable', 'TypeAzureMySQLTable', 'TypeOracleTable', 'TypeODataResource', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeAzureDataLakeStoreFile', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeAmazonS3Object' + Type TypeBasicDataset `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for GreenplumTableDataset. +func (gtd GreenplumTableDataset) MarshalJSON() ([]byte, error) { + gtd.Type = TypeGreenplumTable + objectMap := make(map[string]interface{}) + if gtd.Description != nil { + objectMap["description"] = gtd.Description + } + objectMap["structure"] = gtd.Structure + if gtd.LinkedServiceName != nil { + objectMap["linkedServiceName"] = gtd.LinkedServiceName + } + if gtd.Parameters != nil { + objectMap["parameters"] = gtd.Parameters + } + if gtd.Annotations != nil { + objectMap["annotations"] = gtd.Annotations + } + if gtd.Type != "" { + objectMap["type"] = gtd.Type + } + for k, v := range gtd.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysObjectDataset is the BasicDataset implementation for GreenplumTableDataset. +func (gtd GreenplumTableDataset) AsResponsysObjectDataset() (*ResponsysObjectDataset, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudObjectDataset is the BasicDataset implementation for GreenplumTableDataset. +func (gtd GreenplumTableDataset) AsSalesforceMarketingCloudObjectDataset() (*SalesforceMarketingCloudObjectDataset, bool) { + return nil, false +} + +// AsVerticaTableDataset is the BasicDataset implementation for GreenplumTableDataset. +func (gtd GreenplumTableDataset) AsVerticaTableDataset() (*VerticaTableDataset, bool) { + return nil, false +} + +// AsNetezzaTableDataset is the BasicDataset implementation for GreenplumTableDataset. +func (gtd GreenplumTableDataset) AsNetezzaTableDataset() (*NetezzaTableDataset, bool) { + return nil, false +} + +// AsZohoObjectDataset is the BasicDataset implementation for GreenplumTableDataset. +func (gtd GreenplumTableDataset) AsZohoObjectDataset() (*ZohoObjectDataset, bool) { + return nil, false +} + +// AsXeroObjectDataset is the BasicDataset implementation for GreenplumTableDataset. +func (gtd GreenplumTableDataset) AsXeroObjectDataset() (*XeroObjectDataset, bool) { + return nil, false +} + +// AsSquareObjectDataset is the BasicDataset implementation for GreenplumTableDataset. +func (gtd GreenplumTableDataset) AsSquareObjectDataset() (*SquareObjectDataset, bool) { + return nil, false +} + +// AsSparkObjectDataset is the BasicDataset implementation for GreenplumTableDataset. +func (gtd GreenplumTableDataset) AsSparkObjectDataset() (*SparkObjectDataset, bool) { + return nil, false +} + +// AsShopifyObjectDataset is the BasicDataset implementation for GreenplumTableDataset. +func (gtd GreenplumTableDataset) AsShopifyObjectDataset() (*ShopifyObjectDataset, bool) { + return nil, false +} + +// AsServiceNowObjectDataset is the BasicDataset implementation for GreenplumTableDataset. +func (gtd GreenplumTableDataset) AsServiceNowObjectDataset() (*ServiceNowObjectDataset, bool) { + return nil, false +} + +// AsQuickBooksObjectDataset is the BasicDataset implementation for GreenplumTableDataset. +func (gtd GreenplumTableDataset) AsQuickBooksObjectDataset() (*QuickBooksObjectDataset, bool) { + return nil, false +} + +// AsPrestoObjectDataset is the BasicDataset implementation for GreenplumTableDataset. +func (gtd GreenplumTableDataset) AsPrestoObjectDataset() (*PrestoObjectDataset, bool) { + return nil, false +} + +// AsPhoenixObjectDataset is the BasicDataset implementation for GreenplumTableDataset. +func (gtd GreenplumTableDataset) AsPhoenixObjectDataset() (*PhoenixObjectDataset, bool) { + return nil, false +} + +// AsPaypalObjectDataset is the BasicDataset implementation for GreenplumTableDataset. +func (gtd GreenplumTableDataset) AsPaypalObjectDataset() (*PaypalObjectDataset, bool) { + return nil, false +} + +// AsMarketoObjectDataset is the BasicDataset implementation for GreenplumTableDataset. +func (gtd GreenplumTableDataset) AsMarketoObjectDataset() (*MarketoObjectDataset, bool) { + return nil, false +} + +// AsMariaDBTableDataset is the BasicDataset implementation for GreenplumTableDataset. +func (gtd GreenplumTableDataset) AsMariaDBTableDataset() (*MariaDBTableDataset, bool) { + return nil, false +} + +// AsMagentoObjectDataset is the BasicDataset implementation for GreenplumTableDataset. +func (gtd GreenplumTableDataset) AsMagentoObjectDataset() (*MagentoObjectDataset, bool) { + return nil, false +} + +// AsJiraObjectDataset is the BasicDataset implementation for GreenplumTableDataset. +func (gtd GreenplumTableDataset) AsJiraObjectDataset() (*JiraObjectDataset, bool) { + return nil, false +} + +// AsImpalaObjectDataset is the BasicDataset implementation for GreenplumTableDataset. +func (gtd GreenplumTableDataset) AsImpalaObjectDataset() (*ImpalaObjectDataset, bool) { + return nil, false +} + +// AsHubspotObjectDataset is the BasicDataset implementation for GreenplumTableDataset. +func (gtd GreenplumTableDataset) AsHubspotObjectDataset() (*HubspotObjectDataset, bool) { + return nil, false +} + +// AsHiveObjectDataset is the BasicDataset implementation for GreenplumTableDataset. +func (gtd GreenplumTableDataset) AsHiveObjectDataset() (*HiveObjectDataset, bool) { + return nil, false +} + +// AsHBaseObjectDataset is the BasicDataset implementation for GreenplumTableDataset. +func (gtd GreenplumTableDataset) AsHBaseObjectDataset() (*HBaseObjectDataset, bool) { + return nil, false +} + +// AsGreenplumTableDataset is the BasicDataset implementation for GreenplumTableDataset. +func (gtd GreenplumTableDataset) AsGreenplumTableDataset() (*GreenplumTableDataset, bool) { + return >d, true +} + +// AsGoogleBigQueryObjectDataset is the BasicDataset implementation for GreenplumTableDataset. +func (gtd GreenplumTableDataset) AsGoogleBigQueryObjectDataset() (*GoogleBigQueryObjectDataset, bool) { + return nil, false +} + +// AsEloquaObjectDataset is the BasicDataset implementation for GreenplumTableDataset. +func (gtd GreenplumTableDataset) AsEloquaObjectDataset() (*EloquaObjectDataset, bool) { + return nil, false +} + +// AsDrillTableDataset is the BasicDataset implementation for GreenplumTableDataset. +func (gtd GreenplumTableDataset) AsDrillTableDataset() (*DrillTableDataset, bool) { + return nil, false +} + +// AsCouchbaseTableDataset is the BasicDataset implementation for GreenplumTableDataset. +func (gtd GreenplumTableDataset) AsCouchbaseTableDataset() (*CouchbaseTableDataset, bool) { + return nil, false +} + +// AsConcurObjectDataset is the BasicDataset implementation for GreenplumTableDataset. +func (gtd GreenplumTableDataset) AsConcurObjectDataset() (*ConcurObjectDataset, bool) { + return nil, false +} + +// AsAzurePostgreSQLTableDataset is the BasicDataset implementation for GreenplumTableDataset. +func (gtd GreenplumTableDataset) AsAzurePostgreSQLTableDataset() (*AzurePostgreSQLTableDataset, bool) { + return nil, false +} + +// AsAmazonMWSObjectDataset is the BasicDataset implementation for GreenplumTableDataset. +func (gtd GreenplumTableDataset) AsAmazonMWSObjectDataset() (*AmazonMWSObjectDataset, bool) { + return nil, false +} + +// AsHTTPDataset is the BasicDataset implementation for GreenplumTableDataset. +func (gtd GreenplumTableDataset) AsHTTPDataset() (*HTTPDataset, bool) { + return nil, false +} + +// AsAzureSearchIndexDataset is the BasicDataset implementation for GreenplumTableDataset. +func (gtd GreenplumTableDataset) AsAzureSearchIndexDataset() (*AzureSearchIndexDataset, bool) { + return nil, false +} + +// AsWebTableDataset is the BasicDataset implementation for GreenplumTableDataset. +func (gtd GreenplumTableDataset) AsWebTableDataset() (*WebTableDataset, bool) { + return nil, false +} + +// AsSQLServerTableDataset is the BasicDataset implementation for GreenplumTableDataset. +func (gtd GreenplumTableDataset) AsSQLServerTableDataset() (*SQLServerTableDataset, bool) { + return nil, false +} + +// AsSapEccResourceDataset is the BasicDataset implementation for GreenplumTableDataset. +func (gtd GreenplumTableDataset) AsSapEccResourceDataset() (*SapEccResourceDataset, bool) { + return nil, false +} + +// AsSapCloudForCustomerResourceDataset is the BasicDataset implementation for GreenplumTableDataset. +func (gtd GreenplumTableDataset) AsSapCloudForCustomerResourceDataset() (*SapCloudForCustomerResourceDataset, bool) { + return nil, false +} + +// AsSalesforceObjectDataset is the BasicDataset implementation for GreenplumTableDataset. +func (gtd GreenplumTableDataset) AsSalesforceObjectDataset() (*SalesforceObjectDataset, bool) { + return nil, false +} + +// AsRelationalTableDataset is the BasicDataset implementation for GreenplumTableDataset. +func (gtd GreenplumTableDataset) AsRelationalTableDataset() (*RelationalTableDataset, bool) { + return nil, false +} + +// AsAzureMySQLTableDataset is the BasicDataset implementation for GreenplumTableDataset. +func (gtd GreenplumTableDataset) AsAzureMySQLTableDataset() (*AzureMySQLTableDataset, bool) { + return nil, false +} + +// AsOracleTableDataset is the BasicDataset implementation for GreenplumTableDataset. +func (gtd GreenplumTableDataset) AsOracleTableDataset() (*OracleTableDataset, bool) { + return nil, false +} + +// AsODataResourceDataset is the BasicDataset implementation for GreenplumTableDataset. +func (gtd GreenplumTableDataset) AsODataResourceDataset() (*ODataResourceDataset, bool) { + return nil, false +} + +// AsMongoDbCollectionDataset is the BasicDataset implementation for GreenplumTableDataset. +func (gtd GreenplumTableDataset) AsMongoDbCollectionDataset() (*MongoDbCollectionDataset, bool) { + return nil, false +} + +// AsFileShareDataset is the BasicDataset implementation for GreenplumTableDataset. +func (gtd GreenplumTableDataset) AsFileShareDataset() (*FileShareDataset, bool) { + return nil, false +} + +// AsAzureDataLakeStoreDataset is the BasicDataset implementation for GreenplumTableDataset. +func (gtd GreenplumTableDataset) AsAzureDataLakeStoreDataset() (*AzureDataLakeStoreDataset, bool) { + return nil, false +} + +// AsDynamicsEntityDataset is the BasicDataset implementation for GreenplumTableDataset. +func (gtd GreenplumTableDataset) AsDynamicsEntityDataset() (*DynamicsEntityDataset, bool) { + return nil, false +} + +// AsDocumentDbCollectionDataset is the BasicDataset implementation for GreenplumTableDataset. +func (gtd GreenplumTableDataset) AsDocumentDbCollectionDataset() (*DocumentDbCollectionDataset, bool) { + return nil, false +} + +// AsCustomDataset is the BasicDataset implementation for GreenplumTableDataset. +func (gtd GreenplumTableDataset) AsCustomDataset() (*CustomDataset, bool) { + return nil, false +} + +// AsCassandraTableDataset is the BasicDataset implementation for GreenplumTableDataset. +func (gtd GreenplumTableDataset) AsCassandraTableDataset() (*CassandraTableDataset, bool) { + return nil, false +} + +// AsAzureSQLDWTableDataset is the BasicDataset implementation for GreenplumTableDataset. +func (gtd GreenplumTableDataset) AsAzureSQLDWTableDataset() (*AzureSQLDWTableDataset, bool) { + return nil, false +} + +// AsAzureSQLTableDataset is the BasicDataset implementation for GreenplumTableDataset. +func (gtd GreenplumTableDataset) AsAzureSQLTableDataset() (*AzureSQLTableDataset, bool) { + return nil, false +} + +// AsAzureTableDataset is the BasicDataset implementation for GreenplumTableDataset. +func (gtd GreenplumTableDataset) AsAzureTableDataset() (*AzureTableDataset, bool) { + return nil, false +} + +// AsAzureBlobDataset is the BasicDataset implementation for GreenplumTableDataset. +func (gtd GreenplumTableDataset) AsAzureBlobDataset() (*AzureBlobDataset, bool) { + return nil, false +} + +// AsAmazonS3Dataset is the BasicDataset implementation for GreenplumTableDataset. +func (gtd GreenplumTableDataset) AsAmazonS3Dataset() (*AmazonS3Dataset, bool) { + return nil, false +} + +// AsDataset is the BasicDataset implementation for GreenplumTableDataset. +func (gtd GreenplumTableDataset) AsDataset() (*Dataset, bool) { + return nil, false +} + +// AsBasicDataset is the BasicDataset implementation for GreenplumTableDataset. +func (gtd GreenplumTableDataset) AsBasicDataset() (BasicDataset, bool) { + return >d, true +} + +// HBaseLinkedService hBase server linked service. +type HBaseLinkedService struct { + // HBaseLinkedServiceTypeProperties - HBase server linked service properties. + *HBaseLinkedServiceTypeProperties `json:"typeProperties,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // ConnectVia - The integration runtime reference. + ConnectVia *IntegrationRuntimeReference `json:"connectVia,omitempty"` + // Description - Linked service description. + Description *string `json:"description,omitempty"` + // Parameters - Parameters for linked service. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeLinkedService', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforce', 'TypeAzureDataLakeStore', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureStorage' + Type TypeBasicLinkedService `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for HBaseLinkedService. +func (hbls HBaseLinkedService) MarshalJSON() ([]byte, error) { + hbls.Type = TypeHBase + objectMap := make(map[string]interface{}) + if hbls.HBaseLinkedServiceTypeProperties != nil { + objectMap["typeProperties"] = hbls.HBaseLinkedServiceTypeProperties + } + if hbls.ConnectVia != nil { + objectMap["connectVia"] = hbls.ConnectVia + } + if hbls.Description != nil { + objectMap["description"] = hbls.Description + } + if hbls.Parameters != nil { + objectMap["parameters"] = hbls.Parameters + } + if hbls.Annotations != nil { + objectMap["annotations"] = hbls.Annotations + } + if hbls.Type != "" { + objectMap["type"] = hbls.Type + } + for k, v := range hbls.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysLinkedService is the BasicLinkedService implementation for HBaseLinkedService. +func (hbls HBaseLinkedService) AsResponsysLinkedService() (*ResponsysLinkedService, bool) { + return nil, false +} + +// AsAzureDatabricksLinkedService is the BasicLinkedService implementation for HBaseLinkedService. +func (hbls HBaseLinkedService) AsAzureDatabricksLinkedService() (*AzureDatabricksLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeAnalyticsLinkedService is the BasicLinkedService implementation for HBaseLinkedService. +func (hbls HBaseLinkedService) AsAzureDataLakeAnalyticsLinkedService() (*AzureDataLakeAnalyticsLinkedService, bool) { + return nil, false +} + +// AsHDInsightOnDemandLinkedService is the BasicLinkedService implementation for HBaseLinkedService. +func (hbls HBaseLinkedService) AsHDInsightOnDemandLinkedService() (*HDInsightOnDemandLinkedService, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudLinkedService is the BasicLinkedService implementation for HBaseLinkedService. +func (hbls HBaseLinkedService) AsSalesforceMarketingCloudLinkedService() (*SalesforceMarketingCloudLinkedService, bool) { + return nil, false +} + +// AsNetezzaLinkedService is the BasicLinkedService implementation for HBaseLinkedService. +func (hbls HBaseLinkedService) AsNetezzaLinkedService() (*NetezzaLinkedService, bool) { + return nil, false +} + +// AsVerticaLinkedService is the BasicLinkedService implementation for HBaseLinkedService. +func (hbls HBaseLinkedService) AsVerticaLinkedService() (*VerticaLinkedService, bool) { + return nil, false +} + +// AsZohoLinkedService is the BasicLinkedService implementation for HBaseLinkedService. +func (hbls HBaseLinkedService) AsZohoLinkedService() (*ZohoLinkedService, bool) { + return nil, false +} + +// AsXeroLinkedService is the BasicLinkedService implementation for HBaseLinkedService. +func (hbls HBaseLinkedService) AsXeroLinkedService() (*XeroLinkedService, bool) { + return nil, false +} + +// AsSquareLinkedService is the BasicLinkedService implementation for HBaseLinkedService. +func (hbls HBaseLinkedService) AsSquareLinkedService() (*SquareLinkedService, bool) { + return nil, false +} + +// AsSparkLinkedService is the BasicLinkedService implementation for HBaseLinkedService. +func (hbls HBaseLinkedService) AsSparkLinkedService() (*SparkLinkedService, bool) { + return nil, false +} + +// AsShopifyLinkedService is the BasicLinkedService implementation for HBaseLinkedService. +func (hbls HBaseLinkedService) AsShopifyLinkedService() (*ShopifyLinkedService, bool) { + return nil, false +} + +// AsServiceNowLinkedService is the BasicLinkedService implementation for HBaseLinkedService. +func (hbls HBaseLinkedService) AsServiceNowLinkedService() (*ServiceNowLinkedService, bool) { + return nil, false +} + +// AsQuickBooksLinkedService is the BasicLinkedService implementation for HBaseLinkedService. +func (hbls HBaseLinkedService) AsQuickBooksLinkedService() (*QuickBooksLinkedService, bool) { + return nil, false +} + +// AsPrestoLinkedService is the BasicLinkedService implementation for HBaseLinkedService. +func (hbls HBaseLinkedService) AsPrestoLinkedService() (*PrestoLinkedService, bool) { + return nil, false +} + +// AsPhoenixLinkedService is the BasicLinkedService implementation for HBaseLinkedService. +func (hbls HBaseLinkedService) AsPhoenixLinkedService() (*PhoenixLinkedService, bool) { + return nil, false +} + +// AsPaypalLinkedService is the BasicLinkedService implementation for HBaseLinkedService. +func (hbls HBaseLinkedService) AsPaypalLinkedService() (*PaypalLinkedService, bool) { + return nil, false +} + +// AsMarketoLinkedService is the BasicLinkedService implementation for HBaseLinkedService. +func (hbls HBaseLinkedService) AsMarketoLinkedService() (*MarketoLinkedService, bool) { + return nil, false +} + +// AsMariaDBLinkedService is the BasicLinkedService implementation for HBaseLinkedService. +func (hbls HBaseLinkedService) AsMariaDBLinkedService() (*MariaDBLinkedService, bool) { + return nil, false +} + +// AsMagentoLinkedService is the BasicLinkedService implementation for HBaseLinkedService. +func (hbls HBaseLinkedService) AsMagentoLinkedService() (*MagentoLinkedService, bool) { + return nil, false +} + +// AsJiraLinkedService is the BasicLinkedService implementation for HBaseLinkedService. +func (hbls HBaseLinkedService) AsJiraLinkedService() (*JiraLinkedService, bool) { + return nil, false +} + +// AsImpalaLinkedService is the BasicLinkedService implementation for HBaseLinkedService. +func (hbls HBaseLinkedService) AsImpalaLinkedService() (*ImpalaLinkedService, bool) { + return nil, false +} + +// AsHubspotLinkedService is the BasicLinkedService implementation for HBaseLinkedService. +func (hbls HBaseLinkedService) AsHubspotLinkedService() (*HubspotLinkedService, bool) { + return nil, false +} + +// AsHiveLinkedService is the BasicLinkedService implementation for HBaseLinkedService. +func (hbls HBaseLinkedService) AsHiveLinkedService() (*HiveLinkedService, bool) { + return nil, false +} + +// AsHBaseLinkedService is the BasicLinkedService implementation for HBaseLinkedService. +func (hbls HBaseLinkedService) AsHBaseLinkedService() (*HBaseLinkedService, bool) { + return &hbls, true +} + +// AsGreenplumLinkedService is the BasicLinkedService implementation for HBaseLinkedService. +func (hbls HBaseLinkedService) AsGreenplumLinkedService() (*GreenplumLinkedService, bool) { + return nil, false +} + +// AsGoogleBigQueryLinkedService is the BasicLinkedService implementation for HBaseLinkedService. +func (hbls HBaseLinkedService) AsGoogleBigQueryLinkedService() (*GoogleBigQueryLinkedService, bool) { + return nil, false +} + +// AsEloquaLinkedService is the BasicLinkedService implementation for HBaseLinkedService. +func (hbls HBaseLinkedService) AsEloquaLinkedService() (*EloquaLinkedService, bool) { + return nil, false +} + +// AsDrillLinkedService is the BasicLinkedService implementation for HBaseLinkedService. +func (hbls HBaseLinkedService) AsDrillLinkedService() (*DrillLinkedService, bool) { + return nil, false +} + +// AsCouchbaseLinkedService is the BasicLinkedService implementation for HBaseLinkedService. +func (hbls HBaseLinkedService) AsCouchbaseLinkedService() (*CouchbaseLinkedService, bool) { + return nil, false +} + +// AsConcurLinkedService is the BasicLinkedService implementation for HBaseLinkedService. +func (hbls HBaseLinkedService) AsConcurLinkedService() (*ConcurLinkedService, bool) { + return nil, false +} + +// AsAzurePostgreSQLLinkedService is the BasicLinkedService implementation for HBaseLinkedService. +func (hbls HBaseLinkedService) AsAzurePostgreSQLLinkedService() (*AzurePostgreSQLLinkedService, bool) { + return nil, false +} + +// AsAmazonMWSLinkedService is the BasicLinkedService implementation for HBaseLinkedService. +func (hbls HBaseLinkedService) AsAmazonMWSLinkedService() (*AmazonMWSLinkedService, bool) { + return nil, false +} + +// AsSapHanaLinkedService is the BasicLinkedService implementation for HBaseLinkedService. +func (hbls HBaseLinkedService) AsSapHanaLinkedService() (*SapHanaLinkedService, bool) { + return nil, false +} + +// AsSapBWLinkedService is the BasicLinkedService implementation for HBaseLinkedService. +func (hbls HBaseLinkedService) AsSapBWLinkedService() (*SapBWLinkedService, bool) { + return nil, false +} + +// AsSftpServerLinkedService is the BasicLinkedService implementation for HBaseLinkedService. +func (hbls HBaseLinkedService) AsSftpServerLinkedService() (*SftpServerLinkedService, bool) { + return nil, false +} + +// AsFtpServerLinkedService is the BasicLinkedService implementation for HBaseLinkedService. +func (hbls HBaseLinkedService) AsFtpServerLinkedService() (*FtpServerLinkedService, bool) { + return nil, false +} + +// AsHTTPLinkedService is the BasicLinkedService implementation for HBaseLinkedService. +func (hbls HBaseLinkedService) AsHTTPLinkedService() (*HTTPLinkedService, bool) { + return nil, false +} + +// AsAzureSearchLinkedService is the BasicLinkedService implementation for HBaseLinkedService. +func (hbls HBaseLinkedService) AsAzureSearchLinkedService() (*AzureSearchLinkedService, bool) { + return nil, false +} + +// AsCustomDataSourceLinkedService is the BasicLinkedService implementation for HBaseLinkedService. +func (hbls HBaseLinkedService) AsCustomDataSourceLinkedService() (*CustomDataSourceLinkedService, bool) { + return nil, false +} + +// AsAmazonRedshiftLinkedService is the BasicLinkedService implementation for HBaseLinkedService. +func (hbls HBaseLinkedService) AsAmazonRedshiftLinkedService() (*AmazonRedshiftLinkedService, bool) { + return nil, false +} + +// AsAmazonS3LinkedService is the BasicLinkedService implementation for HBaseLinkedService. +func (hbls HBaseLinkedService) AsAmazonS3LinkedService() (*AmazonS3LinkedService, bool) { + return nil, false +} + +// AsSapEccLinkedService is the BasicLinkedService implementation for HBaseLinkedService. +func (hbls HBaseLinkedService) AsSapEccLinkedService() (*SapEccLinkedService, bool) { + return nil, false +} + +// AsSapCloudForCustomerLinkedService is the BasicLinkedService implementation for HBaseLinkedService. +func (hbls HBaseLinkedService) AsSapCloudForCustomerLinkedService() (*SapCloudForCustomerLinkedService, bool) { + return nil, false +} + +// AsSalesforceLinkedService is the BasicLinkedService implementation for HBaseLinkedService. +func (hbls HBaseLinkedService) AsSalesforceLinkedService() (*SalesforceLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeStoreLinkedService is the BasicLinkedService implementation for HBaseLinkedService. +func (hbls HBaseLinkedService) AsAzureDataLakeStoreLinkedService() (*AzureDataLakeStoreLinkedService, bool) { + return nil, false +} + +// AsMongoDbLinkedService is the BasicLinkedService implementation for HBaseLinkedService. +func (hbls HBaseLinkedService) AsMongoDbLinkedService() (*MongoDbLinkedService, bool) { + return nil, false +} + +// AsCassandraLinkedService is the BasicLinkedService implementation for HBaseLinkedService. +func (hbls HBaseLinkedService) AsCassandraLinkedService() (*CassandraLinkedService, bool) { + return nil, false +} + +// AsWebLinkedService is the BasicLinkedService implementation for HBaseLinkedService. +func (hbls HBaseLinkedService) AsWebLinkedService() (*WebLinkedService, bool) { + return nil, false +} + +// AsODataLinkedService is the BasicLinkedService implementation for HBaseLinkedService. +func (hbls HBaseLinkedService) AsODataLinkedService() (*ODataLinkedService, bool) { + return nil, false +} + +// AsHdfsLinkedService is the BasicLinkedService implementation for HBaseLinkedService. +func (hbls HBaseLinkedService) AsHdfsLinkedService() (*HdfsLinkedService, bool) { + return nil, false +} + +// AsOdbcLinkedService is the BasicLinkedService implementation for HBaseLinkedService. +func (hbls HBaseLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, bool) { + return nil, false +} + +// AsAzureMLLinkedService is the BasicLinkedService implementation for HBaseLinkedService. +func (hbls HBaseLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { + return nil, false +} + +// AsTeradataLinkedService is the BasicLinkedService implementation for HBaseLinkedService. +func (hbls HBaseLinkedService) AsTeradataLinkedService() (*TeradataLinkedService, bool) { + return nil, false +} + +// AsDb2LinkedService is the BasicLinkedService implementation for HBaseLinkedService. +func (hbls HBaseLinkedService) AsDb2LinkedService() (*Db2LinkedService, bool) { + return nil, false +} + +// AsSybaseLinkedService is the BasicLinkedService implementation for HBaseLinkedService. +func (hbls HBaseLinkedService) AsSybaseLinkedService() (*SybaseLinkedService, bool) { + return nil, false +} + +// AsPostgreSQLLinkedService is the BasicLinkedService implementation for HBaseLinkedService. +func (hbls HBaseLinkedService) AsPostgreSQLLinkedService() (*PostgreSQLLinkedService, bool) { + return nil, false +} + +// AsMySQLLinkedService is the BasicLinkedService implementation for HBaseLinkedService. +func (hbls HBaseLinkedService) AsMySQLLinkedService() (*MySQLLinkedService, bool) { + return nil, false +} + +// AsAzureMySQLLinkedService is the BasicLinkedService implementation for HBaseLinkedService. +func (hbls HBaseLinkedService) AsAzureMySQLLinkedService() (*AzureMySQLLinkedService, bool) { + return nil, false +} + +// AsOracleLinkedService is the BasicLinkedService implementation for HBaseLinkedService. +func (hbls HBaseLinkedService) AsOracleLinkedService() (*OracleLinkedService, bool) { + return nil, false +} + +// AsFileServerLinkedService is the BasicLinkedService implementation for HBaseLinkedService. +func (hbls HBaseLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { + return nil, false +} + +// AsHDInsightLinkedService is the BasicLinkedService implementation for HBaseLinkedService. +func (hbls HBaseLinkedService) AsHDInsightLinkedService() (*HDInsightLinkedService, bool) { + return nil, false +} + +// AsDynamicsLinkedService is the BasicLinkedService implementation for HBaseLinkedService. +func (hbls HBaseLinkedService) AsDynamicsLinkedService() (*DynamicsLinkedService, bool) { + return nil, false +} + +// AsCosmosDbLinkedService is the BasicLinkedService implementation for HBaseLinkedService. +func (hbls HBaseLinkedService) AsCosmosDbLinkedService() (*CosmosDbLinkedService, bool) { + return nil, false +} + +// AsAzureKeyVaultLinkedService is the BasicLinkedService implementation for HBaseLinkedService. +func (hbls HBaseLinkedService) AsAzureKeyVaultLinkedService() (*AzureKeyVaultLinkedService, bool) { + return nil, false +} + +// AsAzureBatchLinkedService is the BasicLinkedService implementation for HBaseLinkedService. +func (hbls HBaseLinkedService) AsAzureBatchLinkedService() (*AzureBatchLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDatabaseLinkedService is the BasicLinkedService implementation for HBaseLinkedService. +func (hbls HBaseLinkedService) AsAzureSQLDatabaseLinkedService() (*AzureSQLDatabaseLinkedService, bool) { + return nil, false +} + +// AsSQLServerLinkedService is the BasicLinkedService implementation for HBaseLinkedService. +func (hbls HBaseLinkedService) AsSQLServerLinkedService() (*SQLServerLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDWLinkedService is the BasicLinkedService implementation for HBaseLinkedService. +func (hbls HBaseLinkedService) AsAzureSQLDWLinkedService() (*AzureSQLDWLinkedService, bool) { + return nil, false +} + +// AsAzureStorageLinkedService is the BasicLinkedService implementation for HBaseLinkedService. +func (hbls HBaseLinkedService) AsAzureStorageLinkedService() (*AzureStorageLinkedService, bool) { + return nil, false +} + +// AsLinkedService is the BasicLinkedService implementation for HBaseLinkedService. +func (hbls HBaseLinkedService) AsLinkedService() (*LinkedService, bool) { + return nil, false +} + +// AsBasicLinkedService is the BasicLinkedService implementation for HBaseLinkedService. +func (hbls HBaseLinkedService) AsBasicLinkedService() (BasicLinkedService, bool) { + return &hbls, true +} + +// UnmarshalJSON is the custom unmarshaler for HBaseLinkedService struct. +func (hbls *HBaseLinkedService) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "typeProperties": + if v != nil { + var hBaseLinkedServiceTypeProperties HBaseLinkedServiceTypeProperties + err = json.Unmarshal(*v, &hBaseLinkedServiceTypeProperties) + if err != nil { + return err + } + hbls.HBaseLinkedServiceTypeProperties = &hBaseLinkedServiceTypeProperties + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if hbls.AdditionalProperties == nil { + hbls.AdditionalProperties = make(map[string]interface{}) + } + hbls.AdditionalProperties[k] = additionalProperties + } + case "connectVia": + if v != nil { + var connectVia IntegrationRuntimeReference + err = json.Unmarshal(*v, &connectVia) + if err != nil { + return err + } + hbls.ConnectVia = &connectVia + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + hbls.Description = &description + } + case "parameters": + if v != nil { + var parameters map[string]*ParameterSpecification + err = json.Unmarshal(*v, ¶meters) + if err != nil { + return err + } + hbls.Parameters = parameters + } + case "annotations": + if v != nil { + var annotations []interface{} + err = json.Unmarshal(*v, &annotations) + if err != nil { + return err + } + hbls.Annotations = &annotations + } + case "type": + if v != nil { + var typeVar TypeBasicLinkedService + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + hbls.Type = typeVar + } + } + } + + return nil +} + +// HBaseLinkedServiceTypeProperties hBase server linked service properties. +type HBaseLinkedServiceTypeProperties struct { + // Host - The IP address or host name of the HBase server. (i.e. 192.168.222.160) + Host interface{} `json:"host,omitempty"` + // Port - The TCP port that the HBase instance uses to listen for client connections. The default value is 9090. + Port interface{} `json:"port,omitempty"` + // HTTPPath - The partial URL corresponding to the HBase server. (i.e. /gateway/sandbox/hbase/version) + HTTPPath interface{} `json:"httpPath,omitempty"` + // AuthenticationType - The authentication mechanism to use to connect to the HBase server. Possible values include: 'HBaseAuthenticationTypeAnonymous', 'HBaseAuthenticationTypeBasic' + AuthenticationType HBaseAuthenticationType `json:"authenticationType,omitempty"` + // Username - The user name used to connect to the HBase instance. + Username interface{} `json:"username,omitempty"` + // Password - The password corresponding to the user name. + Password BasicSecretBase `json:"password,omitempty"` + // EnableSsl - Specifies whether the connections to the server are encrypted using SSL. The default value is false. + EnableSsl interface{} `json:"enableSsl,omitempty"` + // TrustedCertPath - The full path of the .pem file containing trusted CA certificates for verifying the server when connecting over SSL. This property can only be set when using SSL on self-hosted IR. The default value is the cacerts.pem file installed with the IR. + TrustedCertPath interface{} `json:"trustedCertPath,omitempty"` + // AllowHostNameCNMismatch - Specifies whether to require a CA-issued SSL certificate name to match the host name of the server when connecting over SSL. The default value is false. + AllowHostNameCNMismatch interface{} `json:"allowHostNameCNMismatch,omitempty"` + // AllowSelfSignedServerCert - Specifies whether to allow self-signed certificates from the server. The default value is false. + AllowSelfSignedServerCert interface{} `json:"allowSelfSignedServerCert,omitempty"` + // EncryptedCredential - The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string). + EncryptedCredential interface{} `json:"encryptedCredential,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for HBaseLinkedServiceTypeProperties struct. +func (hblstp *HBaseLinkedServiceTypeProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "host": + if v != nil { + var host interface{} + err = json.Unmarshal(*v, &host) + if err != nil { + return err + } + hblstp.Host = host + } + case "port": + if v != nil { + var port interface{} + err = json.Unmarshal(*v, &port) + if err != nil { + return err + } + hblstp.Port = port + } + case "httpPath": + if v != nil { + var HTTPPath interface{} + err = json.Unmarshal(*v, &HTTPPath) + if err != nil { + return err + } + hblstp.HTTPPath = HTTPPath + } + case "authenticationType": + if v != nil { + var authenticationType HBaseAuthenticationType + err = json.Unmarshal(*v, &authenticationType) + if err != nil { + return err + } + hblstp.AuthenticationType = authenticationType + } + case "username": + if v != nil { + var username interface{} + err = json.Unmarshal(*v, &username) + if err != nil { + return err + } + hblstp.Username = username + } + case "password": + if v != nil { + password, err := unmarshalBasicSecretBase(*v) + if err != nil { + return err + } + hblstp.Password = password + } + case "enableSsl": + if v != nil { + var enableSsl interface{} + err = json.Unmarshal(*v, &enableSsl) + if err != nil { + return err + } + hblstp.EnableSsl = enableSsl + } + case "trustedCertPath": + if v != nil { + var trustedCertPath interface{} + err = json.Unmarshal(*v, &trustedCertPath) + if err != nil { + return err + } + hblstp.TrustedCertPath = trustedCertPath + } + case "allowHostNameCNMismatch": + if v != nil { + var allowHostNameCNMismatch interface{} + err = json.Unmarshal(*v, &allowHostNameCNMismatch) + if err != nil { + return err + } + hblstp.AllowHostNameCNMismatch = allowHostNameCNMismatch + } + case "allowSelfSignedServerCert": + if v != nil { + var allowSelfSignedServerCert interface{} + err = json.Unmarshal(*v, &allowSelfSignedServerCert) + if err != nil { + return err + } + hblstp.AllowSelfSignedServerCert = allowSelfSignedServerCert + } + case "encryptedCredential": + if v != nil { + var encryptedCredential interface{} + err = json.Unmarshal(*v, &encryptedCredential) + if err != nil { + return err + } + hblstp.EncryptedCredential = encryptedCredential + } + } + } + + return nil +} + +// HBaseObjectDataset hBase server dataset. +type HBaseObjectDataset struct { + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Description - Dataset description. + Description *string `json:"description,omitempty"` + // Structure - Columns that define the structure of the dataset. Type: array (or Expression with resultType array), itemType: DatasetDataElement. + Structure interface{} `json:"structure,omitempty"` + // LinkedServiceName - Linked service reference. + LinkedServiceName *LinkedServiceReference `json:"linkedServiceName,omitempty"` + // Parameters - Parameters for dataset. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeDataset', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSQLServerTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSalesforceObject', 'TypeRelationalTable', 'TypeAzureMySQLTable', 'TypeOracleTable', 'TypeODataResource', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeAzureDataLakeStoreFile', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeAmazonS3Object' + Type TypeBasicDataset `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for HBaseObjectDataset. +func (hbod HBaseObjectDataset) MarshalJSON() ([]byte, error) { + hbod.Type = TypeHBaseObject + objectMap := make(map[string]interface{}) + if hbod.Description != nil { + objectMap["description"] = hbod.Description + } + objectMap["structure"] = hbod.Structure + if hbod.LinkedServiceName != nil { + objectMap["linkedServiceName"] = hbod.LinkedServiceName + } + if hbod.Parameters != nil { + objectMap["parameters"] = hbod.Parameters + } + if hbod.Annotations != nil { + objectMap["annotations"] = hbod.Annotations + } + if hbod.Type != "" { + objectMap["type"] = hbod.Type + } + for k, v := range hbod.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysObjectDataset is the BasicDataset implementation for HBaseObjectDataset. +func (hbod HBaseObjectDataset) AsResponsysObjectDataset() (*ResponsysObjectDataset, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudObjectDataset is the BasicDataset implementation for HBaseObjectDataset. +func (hbod HBaseObjectDataset) AsSalesforceMarketingCloudObjectDataset() (*SalesforceMarketingCloudObjectDataset, bool) { + return nil, false +} + +// AsVerticaTableDataset is the BasicDataset implementation for HBaseObjectDataset. +func (hbod HBaseObjectDataset) AsVerticaTableDataset() (*VerticaTableDataset, bool) { + return nil, false +} + +// AsNetezzaTableDataset is the BasicDataset implementation for HBaseObjectDataset. +func (hbod HBaseObjectDataset) AsNetezzaTableDataset() (*NetezzaTableDataset, bool) { + return nil, false +} + +// AsZohoObjectDataset is the BasicDataset implementation for HBaseObjectDataset. +func (hbod HBaseObjectDataset) AsZohoObjectDataset() (*ZohoObjectDataset, bool) { + return nil, false +} + +// AsXeroObjectDataset is the BasicDataset implementation for HBaseObjectDataset. +func (hbod HBaseObjectDataset) AsXeroObjectDataset() (*XeroObjectDataset, bool) { + return nil, false +} + +// AsSquareObjectDataset is the BasicDataset implementation for HBaseObjectDataset. +func (hbod HBaseObjectDataset) AsSquareObjectDataset() (*SquareObjectDataset, bool) { + return nil, false +} + +// AsSparkObjectDataset is the BasicDataset implementation for HBaseObjectDataset. +func (hbod HBaseObjectDataset) AsSparkObjectDataset() (*SparkObjectDataset, bool) { + return nil, false +} + +// AsShopifyObjectDataset is the BasicDataset implementation for HBaseObjectDataset. +func (hbod HBaseObjectDataset) AsShopifyObjectDataset() (*ShopifyObjectDataset, bool) { + return nil, false +} + +// AsServiceNowObjectDataset is the BasicDataset implementation for HBaseObjectDataset. +func (hbod HBaseObjectDataset) AsServiceNowObjectDataset() (*ServiceNowObjectDataset, bool) { + return nil, false +} + +// AsQuickBooksObjectDataset is the BasicDataset implementation for HBaseObjectDataset. +func (hbod HBaseObjectDataset) AsQuickBooksObjectDataset() (*QuickBooksObjectDataset, bool) { + return nil, false +} + +// AsPrestoObjectDataset is the BasicDataset implementation for HBaseObjectDataset. +func (hbod HBaseObjectDataset) AsPrestoObjectDataset() (*PrestoObjectDataset, bool) { + return nil, false +} + +// AsPhoenixObjectDataset is the BasicDataset implementation for HBaseObjectDataset. +func (hbod HBaseObjectDataset) AsPhoenixObjectDataset() (*PhoenixObjectDataset, bool) { + return nil, false +} + +// AsPaypalObjectDataset is the BasicDataset implementation for HBaseObjectDataset. +func (hbod HBaseObjectDataset) AsPaypalObjectDataset() (*PaypalObjectDataset, bool) { + return nil, false +} + +// AsMarketoObjectDataset is the BasicDataset implementation for HBaseObjectDataset. +func (hbod HBaseObjectDataset) AsMarketoObjectDataset() (*MarketoObjectDataset, bool) { + return nil, false +} + +// AsMariaDBTableDataset is the BasicDataset implementation for HBaseObjectDataset. +func (hbod HBaseObjectDataset) AsMariaDBTableDataset() (*MariaDBTableDataset, bool) { + return nil, false +} + +// AsMagentoObjectDataset is the BasicDataset implementation for HBaseObjectDataset. +func (hbod HBaseObjectDataset) AsMagentoObjectDataset() (*MagentoObjectDataset, bool) { + return nil, false +} + +// AsJiraObjectDataset is the BasicDataset implementation for HBaseObjectDataset. +func (hbod HBaseObjectDataset) AsJiraObjectDataset() (*JiraObjectDataset, bool) { + return nil, false +} + +// AsImpalaObjectDataset is the BasicDataset implementation for HBaseObjectDataset. +func (hbod HBaseObjectDataset) AsImpalaObjectDataset() (*ImpalaObjectDataset, bool) { + return nil, false +} + +// AsHubspotObjectDataset is the BasicDataset implementation for HBaseObjectDataset. +func (hbod HBaseObjectDataset) AsHubspotObjectDataset() (*HubspotObjectDataset, bool) { + return nil, false +} + +// AsHiveObjectDataset is the BasicDataset implementation for HBaseObjectDataset. +func (hbod HBaseObjectDataset) AsHiveObjectDataset() (*HiveObjectDataset, bool) { + return nil, false +} + +// AsHBaseObjectDataset is the BasicDataset implementation for HBaseObjectDataset. +func (hbod HBaseObjectDataset) AsHBaseObjectDataset() (*HBaseObjectDataset, bool) { + return &hbod, true +} + +// AsGreenplumTableDataset is the BasicDataset implementation for HBaseObjectDataset. +func (hbod HBaseObjectDataset) AsGreenplumTableDataset() (*GreenplumTableDataset, bool) { + return nil, false +} + +// AsGoogleBigQueryObjectDataset is the BasicDataset implementation for HBaseObjectDataset. +func (hbod HBaseObjectDataset) AsGoogleBigQueryObjectDataset() (*GoogleBigQueryObjectDataset, bool) { + return nil, false +} + +// AsEloquaObjectDataset is the BasicDataset implementation for HBaseObjectDataset. +func (hbod HBaseObjectDataset) AsEloquaObjectDataset() (*EloquaObjectDataset, bool) { + return nil, false +} + +// AsDrillTableDataset is the BasicDataset implementation for HBaseObjectDataset. +func (hbod HBaseObjectDataset) AsDrillTableDataset() (*DrillTableDataset, bool) { + return nil, false +} + +// AsCouchbaseTableDataset is the BasicDataset implementation for HBaseObjectDataset. +func (hbod HBaseObjectDataset) AsCouchbaseTableDataset() (*CouchbaseTableDataset, bool) { + return nil, false +} + +// AsConcurObjectDataset is the BasicDataset implementation for HBaseObjectDataset. +func (hbod HBaseObjectDataset) AsConcurObjectDataset() (*ConcurObjectDataset, bool) { + return nil, false +} + +// AsAzurePostgreSQLTableDataset is the BasicDataset implementation for HBaseObjectDataset. +func (hbod HBaseObjectDataset) AsAzurePostgreSQLTableDataset() (*AzurePostgreSQLTableDataset, bool) { + return nil, false +} + +// AsAmazonMWSObjectDataset is the BasicDataset implementation for HBaseObjectDataset. +func (hbod HBaseObjectDataset) AsAmazonMWSObjectDataset() (*AmazonMWSObjectDataset, bool) { + return nil, false +} + +// AsHTTPDataset is the BasicDataset implementation for HBaseObjectDataset. +func (hbod HBaseObjectDataset) AsHTTPDataset() (*HTTPDataset, bool) { + return nil, false +} + +// AsAzureSearchIndexDataset is the BasicDataset implementation for HBaseObjectDataset. +func (hbod HBaseObjectDataset) AsAzureSearchIndexDataset() (*AzureSearchIndexDataset, bool) { + return nil, false +} + +// AsWebTableDataset is the BasicDataset implementation for HBaseObjectDataset. +func (hbod HBaseObjectDataset) AsWebTableDataset() (*WebTableDataset, bool) { + return nil, false +} + +// AsSQLServerTableDataset is the BasicDataset implementation for HBaseObjectDataset. +func (hbod HBaseObjectDataset) AsSQLServerTableDataset() (*SQLServerTableDataset, bool) { + return nil, false +} + +// AsSapEccResourceDataset is the BasicDataset implementation for HBaseObjectDataset. +func (hbod HBaseObjectDataset) AsSapEccResourceDataset() (*SapEccResourceDataset, bool) { + return nil, false +} + +// AsSapCloudForCustomerResourceDataset is the BasicDataset implementation for HBaseObjectDataset. +func (hbod HBaseObjectDataset) AsSapCloudForCustomerResourceDataset() (*SapCloudForCustomerResourceDataset, bool) { + return nil, false +} + +// AsSalesforceObjectDataset is the BasicDataset implementation for HBaseObjectDataset. +func (hbod HBaseObjectDataset) AsSalesforceObjectDataset() (*SalesforceObjectDataset, bool) { + return nil, false +} + +// AsRelationalTableDataset is the BasicDataset implementation for HBaseObjectDataset. +func (hbod HBaseObjectDataset) AsRelationalTableDataset() (*RelationalTableDataset, bool) { + return nil, false +} + +// AsAzureMySQLTableDataset is the BasicDataset implementation for HBaseObjectDataset. +func (hbod HBaseObjectDataset) AsAzureMySQLTableDataset() (*AzureMySQLTableDataset, bool) { + return nil, false +} + +// AsOracleTableDataset is the BasicDataset implementation for HBaseObjectDataset. +func (hbod HBaseObjectDataset) AsOracleTableDataset() (*OracleTableDataset, bool) { + return nil, false +} + +// AsODataResourceDataset is the BasicDataset implementation for HBaseObjectDataset. +func (hbod HBaseObjectDataset) AsODataResourceDataset() (*ODataResourceDataset, bool) { + return nil, false +} + +// AsMongoDbCollectionDataset is the BasicDataset implementation for HBaseObjectDataset. +func (hbod HBaseObjectDataset) AsMongoDbCollectionDataset() (*MongoDbCollectionDataset, bool) { + return nil, false +} + +// AsFileShareDataset is the BasicDataset implementation for HBaseObjectDataset. +func (hbod HBaseObjectDataset) AsFileShareDataset() (*FileShareDataset, bool) { + return nil, false +} + +// AsAzureDataLakeStoreDataset is the BasicDataset implementation for HBaseObjectDataset. +func (hbod HBaseObjectDataset) AsAzureDataLakeStoreDataset() (*AzureDataLakeStoreDataset, bool) { + return nil, false +} + +// AsDynamicsEntityDataset is the BasicDataset implementation for HBaseObjectDataset. +func (hbod HBaseObjectDataset) AsDynamicsEntityDataset() (*DynamicsEntityDataset, bool) { + return nil, false +} + +// AsDocumentDbCollectionDataset is the BasicDataset implementation for HBaseObjectDataset. +func (hbod HBaseObjectDataset) AsDocumentDbCollectionDataset() (*DocumentDbCollectionDataset, bool) { + return nil, false +} + +// AsCustomDataset is the BasicDataset implementation for HBaseObjectDataset. +func (hbod HBaseObjectDataset) AsCustomDataset() (*CustomDataset, bool) { + return nil, false +} + +// AsCassandraTableDataset is the BasicDataset implementation for HBaseObjectDataset. +func (hbod HBaseObjectDataset) AsCassandraTableDataset() (*CassandraTableDataset, bool) { + return nil, false +} + +// AsAzureSQLDWTableDataset is the BasicDataset implementation for HBaseObjectDataset. +func (hbod HBaseObjectDataset) AsAzureSQLDWTableDataset() (*AzureSQLDWTableDataset, bool) { + return nil, false +} + +// AsAzureSQLTableDataset is the BasicDataset implementation for HBaseObjectDataset. +func (hbod HBaseObjectDataset) AsAzureSQLTableDataset() (*AzureSQLTableDataset, bool) { + return nil, false +} + +// AsAzureTableDataset is the BasicDataset implementation for HBaseObjectDataset. +func (hbod HBaseObjectDataset) AsAzureTableDataset() (*AzureTableDataset, bool) { + return nil, false +} + +// AsAzureBlobDataset is the BasicDataset implementation for HBaseObjectDataset. +func (hbod HBaseObjectDataset) AsAzureBlobDataset() (*AzureBlobDataset, bool) { + return nil, false +} + +// AsAmazonS3Dataset is the BasicDataset implementation for HBaseObjectDataset. +func (hbod HBaseObjectDataset) AsAmazonS3Dataset() (*AmazonS3Dataset, bool) { + return nil, false +} + +// AsDataset is the BasicDataset implementation for HBaseObjectDataset. +func (hbod HBaseObjectDataset) AsDataset() (*Dataset, bool) { + return nil, false +} + +// AsBasicDataset is the BasicDataset implementation for HBaseObjectDataset. +func (hbod HBaseObjectDataset) AsBasicDataset() (BasicDataset, bool) { + return &hbod, true +} + +// HBaseSource a copy activity HBase server source. +type HBaseSource struct { + // Query - A query to retrieve data from source. Type: string (or Expression with resultType string). + Query interface{} `json:"query,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // SourceRetryCount - Source retry count. Type: integer (or Expression with resultType integer). + SourceRetryCount interface{} `json:"sourceRetryCount,omitempty"` + // SourceRetryWait - Source retry wait. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` + // Type - Possible values include: 'TypeCopySource', 'TypeAmazonRedshiftSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeHTTPSource', 'TypeAzureDataLakeStoreSource', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeRelationalSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource' + Type TypeBasicCopySource `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for HBaseSource. +func (hbs HBaseSource) MarshalJSON() ([]byte, error) { + hbs.Type = TypeHBaseSource + objectMap := make(map[string]interface{}) + objectMap["query"] = hbs.Query + objectMap["sourceRetryCount"] = hbs.SourceRetryCount + objectMap["sourceRetryWait"] = hbs.SourceRetryWait + if hbs.Type != "" { + objectMap["type"] = hbs.Type + } + for k, v := range hbs.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsAmazonRedshiftSource is the BasicCopySource implementation for HBaseSource. +func (hbs HBaseSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { + return nil, false +} + +// AsResponsysSource is the BasicCopySource implementation for HBaseSource. +func (hbs HBaseSource) AsResponsysSource() (*ResponsysSource, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudSource is the BasicCopySource implementation for HBaseSource. +func (hbs HBaseSource) AsSalesforceMarketingCloudSource() (*SalesforceMarketingCloudSource, bool) { + return nil, false +} + +// AsVerticaSource is the BasicCopySource implementation for HBaseSource. +func (hbs HBaseSource) AsVerticaSource() (*VerticaSource, bool) { + return nil, false +} + +// AsNetezzaSource is the BasicCopySource implementation for HBaseSource. +func (hbs HBaseSource) AsNetezzaSource() (*NetezzaSource, bool) { + return nil, false +} + +// AsZohoSource is the BasicCopySource implementation for HBaseSource. +func (hbs HBaseSource) AsZohoSource() (*ZohoSource, bool) { + return nil, false +} + +// AsXeroSource is the BasicCopySource implementation for HBaseSource. +func (hbs HBaseSource) AsXeroSource() (*XeroSource, bool) { + return nil, false +} + +// AsSquareSource is the BasicCopySource implementation for HBaseSource. +func (hbs HBaseSource) AsSquareSource() (*SquareSource, bool) { + return nil, false +} + +// AsSparkSource is the BasicCopySource implementation for HBaseSource. +func (hbs HBaseSource) AsSparkSource() (*SparkSource, bool) { + return nil, false +} + +// AsShopifySource is the BasicCopySource implementation for HBaseSource. +func (hbs HBaseSource) AsShopifySource() (*ShopifySource, bool) { + return nil, false +} + +// AsServiceNowSource is the BasicCopySource implementation for HBaseSource. +func (hbs HBaseSource) AsServiceNowSource() (*ServiceNowSource, bool) { + return nil, false +} + +// AsQuickBooksSource is the BasicCopySource implementation for HBaseSource. +func (hbs HBaseSource) AsQuickBooksSource() (*QuickBooksSource, bool) { + return nil, false +} + +// AsPrestoSource is the BasicCopySource implementation for HBaseSource. +func (hbs HBaseSource) AsPrestoSource() (*PrestoSource, bool) { + return nil, false +} + +// AsPhoenixSource is the BasicCopySource implementation for HBaseSource. +func (hbs HBaseSource) AsPhoenixSource() (*PhoenixSource, bool) { + return nil, false +} + +// AsPaypalSource is the BasicCopySource implementation for HBaseSource. +func (hbs HBaseSource) AsPaypalSource() (*PaypalSource, bool) { + return nil, false +} + +// AsMarketoSource is the BasicCopySource implementation for HBaseSource. +func (hbs HBaseSource) AsMarketoSource() (*MarketoSource, bool) { + return nil, false +} + +// AsMariaDBSource is the BasicCopySource implementation for HBaseSource. +func (hbs HBaseSource) AsMariaDBSource() (*MariaDBSource, bool) { + return nil, false +} + +// AsMagentoSource is the BasicCopySource implementation for HBaseSource. +func (hbs HBaseSource) AsMagentoSource() (*MagentoSource, bool) { + return nil, false +} + +// AsJiraSource is the BasicCopySource implementation for HBaseSource. +func (hbs HBaseSource) AsJiraSource() (*JiraSource, bool) { + return nil, false +} + +// AsImpalaSource is the BasicCopySource implementation for HBaseSource. +func (hbs HBaseSource) AsImpalaSource() (*ImpalaSource, bool) { + return nil, false +} + +// AsHubspotSource is the BasicCopySource implementation for HBaseSource. +func (hbs HBaseSource) AsHubspotSource() (*HubspotSource, bool) { + return nil, false +} + +// AsHiveSource is the BasicCopySource implementation for HBaseSource. +func (hbs HBaseSource) AsHiveSource() (*HiveSource, bool) { + return nil, false +} + +// AsHBaseSource is the BasicCopySource implementation for HBaseSource. +func (hbs HBaseSource) AsHBaseSource() (*HBaseSource, bool) { + return &hbs, true +} + +// AsGreenplumSource is the BasicCopySource implementation for HBaseSource. +func (hbs HBaseSource) AsGreenplumSource() (*GreenplumSource, bool) { + return nil, false +} + +// AsGoogleBigQuerySource is the BasicCopySource implementation for HBaseSource. +func (hbs HBaseSource) AsGoogleBigQuerySource() (*GoogleBigQuerySource, bool) { + return nil, false +} + +// AsEloquaSource is the BasicCopySource implementation for HBaseSource. +func (hbs HBaseSource) AsEloquaSource() (*EloquaSource, bool) { + return nil, false +} + +// AsDrillSource is the BasicCopySource implementation for HBaseSource. +func (hbs HBaseSource) AsDrillSource() (*DrillSource, bool) { + return nil, false +} + +// AsCouchbaseSource is the BasicCopySource implementation for HBaseSource. +func (hbs HBaseSource) AsCouchbaseSource() (*CouchbaseSource, bool) { + return nil, false +} + +// AsConcurSource is the BasicCopySource implementation for HBaseSource. +func (hbs HBaseSource) AsConcurSource() (*ConcurSource, bool) { + return nil, false +} + +// AsAzurePostgreSQLSource is the BasicCopySource implementation for HBaseSource. +func (hbs HBaseSource) AsAzurePostgreSQLSource() (*AzurePostgreSQLSource, bool) { + return nil, false +} + +// AsAmazonMWSSource is the BasicCopySource implementation for HBaseSource. +func (hbs HBaseSource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { + return nil, false +} + +// AsHTTPSource is the BasicCopySource implementation for HBaseSource. +func (hbs HBaseSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for HBaseSource. +func (hbs HBaseSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for HBaseSource. +func (hbs HBaseSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsCassandraSource is the BasicCopySource implementation for HBaseSource. +func (hbs HBaseSource) AsCassandraSource() (*CassandraSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for HBaseSource. +func (hbs HBaseSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for HBaseSource. +func (hbs HBaseSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureMySQLSource is the BasicCopySource implementation for HBaseSource. +func (hbs HBaseSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for HBaseSource. +func (hbs HBaseSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for HBaseSource. +func (hbs HBaseSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsSQLDWSource is the BasicCopySource implementation for HBaseSource. +func (hbs HBaseSource) AsSQLDWSource() (*SQLDWSource, bool) { + return nil, false +} + +// AsSQLSource is the BasicCopySource implementation for HBaseSource. +func (hbs HBaseSource) AsSQLSource() (*SQLSource, bool) { + return nil, false +} + +// AsSapEccSource is the BasicCopySource implementation for HBaseSource. +func (hbs HBaseSource) AsSapEccSource() (*SapEccSource, bool) { + return nil, false +} + +// AsSapCloudForCustomerSource is the BasicCopySource implementation for HBaseSource. +func (hbs HBaseSource) AsSapCloudForCustomerSource() (*SapCloudForCustomerSource, bool) { + return nil, false +} + +// AsSalesforceSource is the BasicCopySource implementation for HBaseSource. +func (hbs HBaseSource) AsSalesforceSource() (*SalesforceSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for HBaseSource. +func (hbs HBaseSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for HBaseSource. +func (hbs HBaseSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for HBaseSource. +func (hbs HBaseSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for HBaseSource. +func (hbs HBaseSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + +// AsAzureTableSource is the BasicCopySource implementation for HBaseSource. +func (hbs HBaseSource) AsAzureTableSource() (*AzureTableSource, bool) { + return nil, false +} + +// AsCopySource is the BasicCopySource implementation for HBaseSource. +func (hbs HBaseSource) AsCopySource() (*CopySource, bool) { + return nil, false +} + +// AsBasicCopySource is the BasicCopySource implementation for HBaseSource. +func (hbs HBaseSource) AsBasicCopySource() (BasicCopySource, bool) { + return &hbs, true +} + +// HdfsLinkedService hadoop Distributed File System (HDFS) linked service. +type HdfsLinkedService struct { + // HdfsLinkedServiceTypeProperties - HDFS linked service properties. + *HdfsLinkedServiceTypeProperties `json:"typeProperties,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // ConnectVia - The integration runtime reference. + ConnectVia *IntegrationRuntimeReference `json:"connectVia,omitempty"` + // Description - Linked service description. + Description *string `json:"description,omitempty"` + // Parameters - Parameters for linked service. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeLinkedService', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforce', 'TypeAzureDataLakeStore', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureStorage' + Type TypeBasicLinkedService `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for HdfsLinkedService. +func (hls HdfsLinkedService) MarshalJSON() ([]byte, error) { + hls.Type = TypeHdfs + objectMap := make(map[string]interface{}) + if hls.HdfsLinkedServiceTypeProperties != nil { + objectMap["typeProperties"] = hls.HdfsLinkedServiceTypeProperties + } + if hls.ConnectVia != nil { + objectMap["connectVia"] = hls.ConnectVia + } + if hls.Description != nil { + objectMap["description"] = hls.Description + } + if hls.Parameters != nil { + objectMap["parameters"] = hls.Parameters + } + if hls.Annotations != nil { + objectMap["annotations"] = hls.Annotations + } + if hls.Type != "" { + objectMap["type"] = hls.Type + } + for k, v := range hls.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysLinkedService is the BasicLinkedService implementation for HdfsLinkedService. +func (hls HdfsLinkedService) AsResponsysLinkedService() (*ResponsysLinkedService, bool) { + return nil, false +} + +// AsAzureDatabricksLinkedService is the BasicLinkedService implementation for HdfsLinkedService. +func (hls HdfsLinkedService) AsAzureDatabricksLinkedService() (*AzureDatabricksLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeAnalyticsLinkedService is the BasicLinkedService implementation for HdfsLinkedService. +func (hls HdfsLinkedService) AsAzureDataLakeAnalyticsLinkedService() (*AzureDataLakeAnalyticsLinkedService, bool) { + return nil, false +} + +// AsHDInsightOnDemandLinkedService is the BasicLinkedService implementation for HdfsLinkedService. +func (hls HdfsLinkedService) AsHDInsightOnDemandLinkedService() (*HDInsightOnDemandLinkedService, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudLinkedService is the BasicLinkedService implementation for HdfsLinkedService. +func (hls HdfsLinkedService) AsSalesforceMarketingCloudLinkedService() (*SalesforceMarketingCloudLinkedService, bool) { + return nil, false +} + +// AsNetezzaLinkedService is the BasicLinkedService implementation for HdfsLinkedService. +func (hls HdfsLinkedService) AsNetezzaLinkedService() (*NetezzaLinkedService, bool) { + return nil, false +} + +// AsVerticaLinkedService is the BasicLinkedService implementation for HdfsLinkedService. +func (hls HdfsLinkedService) AsVerticaLinkedService() (*VerticaLinkedService, bool) { + return nil, false +} + +// AsZohoLinkedService is the BasicLinkedService implementation for HdfsLinkedService. +func (hls HdfsLinkedService) AsZohoLinkedService() (*ZohoLinkedService, bool) { + return nil, false +} + +// AsXeroLinkedService is the BasicLinkedService implementation for HdfsLinkedService. +func (hls HdfsLinkedService) AsXeroLinkedService() (*XeroLinkedService, bool) { + return nil, false +} + +// AsSquareLinkedService is the BasicLinkedService implementation for HdfsLinkedService. +func (hls HdfsLinkedService) AsSquareLinkedService() (*SquareLinkedService, bool) { + return nil, false +} + +// AsSparkLinkedService is the BasicLinkedService implementation for HdfsLinkedService. +func (hls HdfsLinkedService) AsSparkLinkedService() (*SparkLinkedService, bool) { + return nil, false +} + +// AsShopifyLinkedService is the BasicLinkedService implementation for HdfsLinkedService. +func (hls HdfsLinkedService) AsShopifyLinkedService() (*ShopifyLinkedService, bool) { + return nil, false +} + +// AsServiceNowLinkedService is the BasicLinkedService implementation for HdfsLinkedService. +func (hls HdfsLinkedService) AsServiceNowLinkedService() (*ServiceNowLinkedService, bool) { + return nil, false +} + +// AsQuickBooksLinkedService is the BasicLinkedService implementation for HdfsLinkedService. +func (hls HdfsLinkedService) AsQuickBooksLinkedService() (*QuickBooksLinkedService, bool) { + return nil, false +} + +// AsPrestoLinkedService is the BasicLinkedService implementation for HdfsLinkedService. +func (hls HdfsLinkedService) AsPrestoLinkedService() (*PrestoLinkedService, bool) { + return nil, false +} + +// AsPhoenixLinkedService is the BasicLinkedService implementation for HdfsLinkedService. +func (hls HdfsLinkedService) AsPhoenixLinkedService() (*PhoenixLinkedService, bool) { + return nil, false +} + +// AsPaypalLinkedService is the BasicLinkedService implementation for HdfsLinkedService. +func (hls HdfsLinkedService) AsPaypalLinkedService() (*PaypalLinkedService, bool) { + return nil, false +} + +// AsMarketoLinkedService is the BasicLinkedService implementation for HdfsLinkedService. +func (hls HdfsLinkedService) AsMarketoLinkedService() (*MarketoLinkedService, bool) { + return nil, false +} + +// AsMariaDBLinkedService is the BasicLinkedService implementation for HdfsLinkedService. +func (hls HdfsLinkedService) AsMariaDBLinkedService() (*MariaDBLinkedService, bool) { + return nil, false +} + +// AsMagentoLinkedService is the BasicLinkedService implementation for HdfsLinkedService. +func (hls HdfsLinkedService) AsMagentoLinkedService() (*MagentoLinkedService, bool) { + return nil, false +} + +// AsJiraLinkedService is the BasicLinkedService implementation for HdfsLinkedService. +func (hls HdfsLinkedService) AsJiraLinkedService() (*JiraLinkedService, bool) { + return nil, false +} + +// AsImpalaLinkedService is the BasicLinkedService implementation for HdfsLinkedService. +func (hls HdfsLinkedService) AsImpalaLinkedService() (*ImpalaLinkedService, bool) { + return nil, false +} + +// AsHubspotLinkedService is the BasicLinkedService implementation for HdfsLinkedService. +func (hls HdfsLinkedService) AsHubspotLinkedService() (*HubspotLinkedService, bool) { + return nil, false +} + +// AsHiveLinkedService is the BasicLinkedService implementation for HdfsLinkedService. +func (hls HdfsLinkedService) AsHiveLinkedService() (*HiveLinkedService, bool) { + return nil, false +} + +// AsHBaseLinkedService is the BasicLinkedService implementation for HdfsLinkedService. +func (hls HdfsLinkedService) AsHBaseLinkedService() (*HBaseLinkedService, bool) { + return nil, false +} + +// AsGreenplumLinkedService is the BasicLinkedService implementation for HdfsLinkedService. +func (hls HdfsLinkedService) AsGreenplumLinkedService() (*GreenplumLinkedService, bool) { + return nil, false +} + +// AsGoogleBigQueryLinkedService is the BasicLinkedService implementation for HdfsLinkedService. +func (hls HdfsLinkedService) AsGoogleBigQueryLinkedService() (*GoogleBigQueryLinkedService, bool) { + return nil, false +} + +// AsEloquaLinkedService is the BasicLinkedService implementation for HdfsLinkedService. +func (hls HdfsLinkedService) AsEloquaLinkedService() (*EloquaLinkedService, bool) { + return nil, false +} + +// AsDrillLinkedService is the BasicLinkedService implementation for HdfsLinkedService. +func (hls HdfsLinkedService) AsDrillLinkedService() (*DrillLinkedService, bool) { + return nil, false +} + +// AsCouchbaseLinkedService is the BasicLinkedService implementation for HdfsLinkedService. +func (hls HdfsLinkedService) AsCouchbaseLinkedService() (*CouchbaseLinkedService, bool) { + return nil, false +} + +// AsConcurLinkedService is the BasicLinkedService implementation for HdfsLinkedService. +func (hls HdfsLinkedService) AsConcurLinkedService() (*ConcurLinkedService, bool) { + return nil, false +} + +// AsAzurePostgreSQLLinkedService is the BasicLinkedService implementation for HdfsLinkedService. +func (hls HdfsLinkedService) AsAzurePostgreSQLLinkedService() (*AzurePostgreSQLLinkedService, bool) { + return nil, false +} + +// AsAmazonMWSLinkedService is the BasicLinkedService implementation for HdfsLinkedService. +func (hls HdfsLinkedService) AsAmazonMWSLinkedService() (*AmazonMWSLinkedService, bool) { + return nil, false +} + +// AsSapHanaLinkedService is the BasicLinkedService implementation for HdfsLinkedService. +func (hls HdfsLinkedService) AsSapHanaLinkedService() (*SapHanaLinkedService, bool) { + return nil, false +} + +// AsSapBWLinkedService is the BasicLinkedService implementation for HdfsLinkedService. +func (hls HdfsLinkedService) AsSapBWLinkedService() (*SapBWLinkedService, bool) { + return nil, false +} + +// AsSftpServerLinkedService is the BasicLinkedService implementation for HdfsLinkedService. +func (hls HdfsLinkedService) AsSftpServerLinkedService() (*SftpServerLinkedService, bool) { + return nil, false +} + +// AsFtpServerLinkedService is the BasicLinkedService implementation for HdfsLinkedService. +func (hls HdfsLinkedService) AsFtpServerLinkedService() (*FtpServerLinkedService, bool) { + return nil, false +} + +// AsHTTPLinkedService is the BasicLinkedService implementation for HdfsLinkedService. +func (hls HdfsLinkedService) AsHTTPLinkedService() (*HTTPLinkedService, bool) { + return nil, false +} + +// AsAzureSearchLinkedService is the BasicLinkedService implementation for HdfsLinkedService. +func (hls HdfsLinkedService) AsAzureSearchLinkedService() (*AzureSearchLinkedService, bool) { + return nil, false +} + +// AsCustomDataSourceLinkedService is the BasicLinkedService implementation for HdfsLinkedService. +func (hls HdfsLinkedService) AsCustomDataSourceLinkedService() (*CustomDataSourceLinkedService, bool) { + return nil, false +} + +// AsAmazonRedshiftLinkedService is the BasicLinkedService implementation for HdfsLinkedService. +func (hls HdfsLinkedService) AsAmazonRedshiftLinkedService() (*AmazonRedshiftLinkedService, bool) { + return nil, false +} + +// AsAmazonS3LinkedService is the BasicLinkedService implementation for HdfsLinkedService. +func (hls HdfsLinkedService) AsAmazonS3LinkedService() (*AmazonS3LinkedService, bool) { + return nil, false +} + +// AsSapEccLinkedService is the BasicLinkedService implementation for HdfsLinkedService. +func (hls HdfsLinkedService) AsSapEccLinkedService() (*SapEccLinkedService, bool) { + return nil, false +} + +// AsSapCloudForCustomerLinkedService is the BasicLinkedService implementation for HdfsLinkedService. +func (hls HdfsLinkedService) AsSapCloudForCustomerLinkedService() (*SapCloudForCustomerLinkedService, bool) { + return nil, false +} + +// AsSalesforceLinkedService is the BasicLinkedService implementation for HdfsLinkedService. +func (hls HdfsLinkedService) AsSalesforceLinkedService() (*SalesforceLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeStoreLinkedService is the BasicLinkedService implementation for HdfsLinkedService. +func (hls HdfsLinkedService) AsAzureDataLakeStoreLinkedService() (*AzureDataLakeStoreLinkedService, bool) { + return nil, false +} + +// AsMongoDbLinkedService is the BasicLinkedService implementation for HdfsLinkedService. +func (hls HdfsLinkedService) AsMongoDbLinkedService() (*MongoDbLinkedService, bool) { + return nil, false +} + +// AsCassandraLinkedService is the BasicLinkedService implementation for HdfsLinkedService. +func (hls HdfsLinkedService) AsCassandraLinkedService() (*CassandraLinkedService, bool) { + return nil, false +} + +// AsWebLinkedService is the BasicLinkedService implementation for HdfsLinkedService. +func (hls HdfsLinkedService) AsWebLinkedService() (*WebLinkedService, bool) { + return nil, false +} + +// AsODataLinkedService is the BasicLinkedService implementation for HdfsLinkedService. +func (hls HdfsLinkedService) AsODataLinkedService() (*ODataLinkedService, bool) { + return nil, false +} + +// AsHdfsLinkedService is the BasicLinkedService implementation for HdfsLinkedService. +func (hls HdfsLinkedService) AsHdfsLinkedService() (*HdfsLinkedService, bool) { + return &hls, true +} + +// AsOdbcLinkedService is the BasicLinkedService implementation for HdfsLinkedService. +func (hls HdfsLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, bool) { + return nil, false +} + +// AsAzureMLLinkedService is the BasicLinkedService implementation for HdfsLinkedService. +func (hls HdfsLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { + return nil, false +} + +// AsTeradataLinkedService is the BasicLinkedService implementation for HdfsLinkedService. +func (hls HdfsLinkedService) AsTeradataLinkedService() (*TeradataLinkedService, bool) { + return nil, false +} + +// AsDb2LinkedService is the BasicLinkedService implementation for HdfsLinkedService. +func (hls HdfsLinkedService) AsDb2LinkedService() (*Db2LinkedService, bool) { + return nil, false +} + +// AsSybaseLinkedService is the BasicLinkedService implementation for HdfsLinkedService. +func (hls HdfsLinkedService) AsSybaseLinkedService() (*SybaseLinkedService, bool) { + return nil, false +} + +// AsPostgreSQLLinkedService is the BasicLinkedService implementation for HdfsLinkedService. +func (hls HdfsLinkedService) AsPostgreSQLLinkedService() (*PostgreSQLLinkedService, bool) { + return nil, false +} + +// AsMySQLLinkedService is the BasicLinkedService implementation for HdfsLinkedService. +func (hls HdfsLinkedService) AsMySQLLinkedService() (*MySQLLinkedService, bool) { + return nil, false +} + +// AsAzureMySQLLinkedService is the BasicLinkedService implementation for HdfsLinkedService. +func (hls HdfsLinkedService) AsAzureMySQLLinkedService() (*AzureMySQLLinkedService, bool) { + return nil, false +} + +// AsOracleLinkedService is the BasicLinkedService implementation for HdfsLinkedService. +func (hls HdfsLinkedService) AsOracleLinkedService() (*OracleLinkedService, bool) { + return nil, false +} + +// AsFileServerLinkedService is the BasicLinkedService implementation for HdfsLinkedService. +func (hls HdfsLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { + return nil, false +} + +// AsHDInsightLinkedService is the BasicLinkedService implementation for HdfsLinkedService. +func (hls HdfsLinkedService) AsHDInsightLinkedService() (*HDInsightLinkedService, bool) { + return nil, false +} + +// AsDynamicsLinkedService is the BasicLinkedService implementation for HdfsLinkedService. +func (hls HdfsLinkedService) AsDynamicsLinkedService() (*DynamicsLinkedService, bool) { + return nil, false +} + +// AsCosmosDbLinkedService is the BasicLinkedService implementation for HdfsLinkedService. +func (hls HdfsLinkedService) AsCosmosDbLinkedService() (*CosmosDbLinkedService, bool) { + return nil, false +} + +// AsAzureKeyVaultLinkedService is the BasicLinkedService implementation for HdfsLinkedService. +func (hls HdfsLinkedService) AsAzureKeyVaultLinkedService() (*AzureKeyVaultLinkedService, bool) { + return nil, false +} + +// AsAzureBatchLinkedService is the BasicLinkedService implementation for HdfsLinkedService. +func (hls HdfsLinkedService) AsAzureBatchLinkedService() (*AzureBatchLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDatabaseLinkedService is the BasicLinkedService implementation for HdfsLinkedService. +func (hls HdfsLinkedService) AsAzureSQLDatabaseLinkedService() (*AzureSQLDatabaseLinkedService, bool) { + return nil, false +} + +// AsSQLServerLinkedService is the BasicLinkedService implementation for HdfsLinkedService. +func (hls HdfsLinkedService) AsSQLServerLinkedService() (*SQLServerLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDWLinkedService is the BasicLinkedService implementation for HdfsLinkedService. +func (hls HdfsLinkedService) AsAzureSQLDWLinkedService() (*AzureSQLDWLinkedService, bool) { + return nil, false +} + +// AsAzureStorageLinkedService is the BasicLinkedService implementation for HdfsLinkedService. +func (hls HdfsLinkedService) AsAzureStorageLinkedService() (*AzureStorageLinkedService, bool) { + return nil, false +} + +// AsLinkedService is the BasicLinkedService implementation for HdfsLinkedService. +func (hls HdfsLinkedService) AsLinkedService() (*LinkedService, bool) { + return nil, false +} + +// AsBasicLinkedService is the BasicLinkedService implementation for HdfsLinkedService. +func (hls HdfsLinkedService) AsBasicLinkedService() (BasicLinkedService, bool) { + return &hls, true +} + +// UnmarshalJSON is the custom unmarshaler for HdfsLinkedService struct. +func (hls *HdfsLinkedService) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "typeProperties": + if v != nil { + var hdfsLinkedServiceTypeProperties HdfsLinkedServiceTypeProperties + err = json.Unmarshal(*v, &hdfsLinkedServiceTypeProperties) + if err != nil { + return err + } + hls.HdfsLinkedServiceTypeProperties = &hdfsLinkedServiceTypeProperties + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if hls.AdditionalProperties == nil { + hls.AdditionalProperties = make(map[string]interface{}) + } + hls.AdditionalProperties[k] = additionalProperties + } + case "connectVia": + if v != nil { + var connectVia IntegrationRuntimeReference + err = json.Unmarshal(*v, &connectVia) + if err != nil { + return err + } + hls.ConnectVia = &connectVia + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + hls.Description = &description + } + case "parameters": + if v != nil { + var parameters map[string]*ParameterSpecification + err = json.Unmarshal(*v, ¶meters) + if err != nil { + return err + } + hls.Parameters = parameters + } + case "annotations": + if v != nil { + var annotations []interface{} + err = json.Unmarshal(*v, &annotations) + if err != nil { + return err + } + hls.Annotations = &annotations + } + case "type": + if v != nil { + var typeVar TypeBasicLinkedService + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + hls.Type = typeVar + } + } + } + + return nil +} + +// HdfsLinkedServiceTypeProperties HDFS linked service properties. +type HdfsLinkedServiceTypeProperties struct { + // URL - The URL of the HDFS service endpoint, e.g. http://myhostname:50070/webhdfs/v1 . Type: string (or Expression with resultType string). + URL interface{} `json:"url,omitempty"` + // AuthenticationType - Type of authentication used to connect to the HDFS. Possible values are: Anonymous and Windows. Type: string (or Expression with resultType string). + AuthenticationType interface{} `json:"authenticationType,omitempty"` + // EncryptedCredential - The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string). + EncryptedCredential interface{} `json:"encryptedCredential,omitempty"` + // UserName - User name for Windows authentication. Type: string (or Expression with resultType string). + UserName interface{} `json:"userName,omitempty"` + // Password - Password for Windows authentication. + Password BasicSecretBase `json:"password,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for HdfsLinkedServiceTypeProperties struct. +func (hlstp *HdfsLinkedServiceTypeProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "url": + if v != nil { + var URL interface{} + err = json.Unmarshal(*v, &URL) + if err != nil { + return err + } + hlstp.URL = URL + } + case "authenticationType": + if v != nil { + var authenticationType interface{} + err = json.Unmarshal(*v, &authenticationType) + if err != nil { + return err + } + hlstp.AuthenticationType = authenticationType + } + case "encryptedCredential": + if v != nil { + var encryptedCredential interface{} + err = json.Unmarshal(*v, &encryptedCredential) + if err != nil { + return err + } + hlstp.EncryptedCredential = encryptedCredential + } + case "userName": + if v != nil { + var userName interface{} + err = json.Unmarshal(*v, &userName) + if err != nil { + return err + } + hlstp.UserName = userName + } + case "password": + if v != nil { + password, err := unmarshalBasicSecretBase(*v) + if err != nil { + return err + } + hlstp.Password = password + } + } + } + + return nil +} + +// HdfsSource a copy activity HDFS source. +type HdfsSource struct { + // Recursive - If true, files under the folder path will be read recursively. Default is true. Type: boolean (or Expression with resultType boolean). + Recursive interface{} `json:"recursive,omitempty"` + // DistcpSettings - Specifies Distcp-related settings. + DistcpSettings *DistcpSettings `json:"distcpSettings,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // SourceRetryCount - Source retry count. Type: integer (or Expression with resultType integer). + SourceRetryCount interface{} `json:"sourceRetryCount,omitempty"` + // SourceRetryWait - Source retry wait. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` + // Type - Possible values include: 'TypeCopySource', 'TypeAmazonRedshiftSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeHTTPSource', 'TypeAzureDataLakeStoreSource', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeRelationalSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource' + Type TypeBasicCopySource `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for HdfsSource. +func (hs HdfsSource) MarshalJSON() ([]byte, error) { + hs.Type = TypeHdfsSource + objectMap := make(map[string]interface{}) + objectMap["recursive"] = hs.Recursive + if hs.DistcpSettings != nil { + objectMap["distcpSettings"] = hs.DistcpSettings + } + objectMap["sourceRetryCount"] = hs.SourceRetryCount + objectMap["sourceRetryWait"] = hs.SourceRetryWait + if hs.Type != "" { + objectMap["type"] = hs.Type + } + for k, v := range hs.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsAmazonRedshiftSource is the BasicCopySource implementation for HdfsSource. +func (hs HdfsSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { + return nil, false +} + +// AsResponsysSource is the BasicCopySource implementation for HdfsSource. +func (hs HdfsSource) AsResponsysSource() (*ResponsysSource, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudSource is the BasicCopySource implementation for HdfsSource. +func (hs HdfsSource) AsSalesforceMarketingCloudSource() (*SalesforceMarketingCloudSource, bool) { + return nil, false +} + +// AsVerticaSource is the BasicCopySource implementation for HdfsSource. +func (hs HdfsSource) AsVerticaSource() (*VerticaSource, bool) { + return nil, false +} + +// AsNetezzaSource is the BasicCopySource implementation for HdfsSource. +func (hs HdfsSource) AsNetezzaSource() (*NetezzaSource, bool) { + return nil, false +} + +// AsZohoSource is the BasicCopySource implementation for HdfsSource. +func (hs HdfsSource) AsZohoSource() (*ZohoSource, bool) { + return nil, false +} + +// AsXeroSource is the BasicCopySource implementation for HdfsSource. +func (hs HdfsSource) AsXeroSource() (*XeroSource, bool) { + return nil, false +} + +// AsSquareSource is the BasicCopySource implementation for HdfsSource. +func (hs HdfsSource) AsSquareSource() (*SquareSource, bool) { + return nil, false +} + +// AsSparkSource is the BasicCopySource implementation for HdfsSource. +func (hs HdfsSource) AsSparkSource() (*SparkSource, bool) { + return nil, false +} + +// AsShopifySource is the BasicCopySource implementation for HdfsSource. +func (hs HdfsSource) AsShopifySource() (*ShopifySource, bool) { + return nil, false +} + +// AsServiceNowSource is the BasicCopySource implementation for HdfsSource. +func (hs HdfsSource) AsServiceNowSource() (*ServiceNowSource, bool) { + return nil, false +} + +// AsQuickBooksSource is the BasicCopySource implementation for HdfsSource. +func (hs HdfsSource) AsQuickBooksSource() (*QuickBooksSource, bool) { + return nil, false +} + +// AsPrestoSource is the BasicCopySource implementation for HdfsSource. +func (hs HdfsSource) AsPrestoSource() (*PrestoSource, bool) { + return nil, false +} + +// AsPhoenixSource is the BasicCopySource implementation for HdfsSource. +func (hs HdfsSource) AsPhoenixSource() (*PhoenixSource, bool) { + return nil, false +} + +// AsPaypalSource is the BasicCopySource implementation for HdfsSource. +func (hs HdfsSource) AsPaypalSource() (*PaypalSource, bool) { + return nil, false +} + +// AsMarketoSource is the BasicCopySource implementation for HdfsSource. +func (hs HdfsSource) AsMarketoSource() (*MarketoSource, bool) { + return nil, false +} + +// AsMariaDBSource is the BasicCopySource implementation for HdfsSource. +func (hs HdfsSource) AsMariaDBSource() (*MariaDBSource, bool) { + return nil, false +} + +// AsMagentoSource is the BasicCopySource implementation for HdfsSource. +func (hs HdfsSource) AsMagentoSource() (*MagentoSource, bool) { + return nil, false +} + +// AsJiraSource is the BasicCopySource implementation for HdfsSource. +func (hs HdfsSource) AsJiraSource() (*JiraSource, bool) { + return nil, false +} + +// AsImpalaSource is the BasicCopySource implementation for HdfsSource. +func (hs HdfsSource) AsImpalaSource() (*ImpalaSource, bool) { + return nil, false +} + +// AsHubspotSource is the BasicCopySource implementation for HdfsSource. +func (hs HdfsSource) AsHubspotSource() (*HubspotSource, bool) { + return nil, false +} + +// AsHiveSource is the BasicCopySource implementation for HdfsSource. +func (hs HdfsSource) AsHiveSource() (*HiveSource, bool) { + return nil, false +} + +// AsHBaseSource is the BasicCopySource implementation for HdfsSource. +func (hs HdfsSource) AsHBaseSource() (*HBaseSource, bool) { + return nil, false +} + +// AsGreenplumSource is the BasicCopySource implementation for HdfsSource. +func (hs HdfsSource) AsGreenplumSource() (*GreenplumSource, bool) { + return nil, false +} + +// AsGoogleBigQuerySource is the BasicCopySource implementation for HdfsSource. +func (hs HdfsSource) AsGoogleBigQuerySource() (*GoogleBigQuerySource, bool) { + return nil, false +} + +// AsEloquaSource is the BasicCopySource implementation for HdfsSource. +func (hs HdfsSource) AsEloquaSource() (*EloquaSource, bool) { + return nil, false +} + +// AsDrillSource is the BasicCopySource implementation for HdfsSource. +func (hs HdfsSource) AsDrillSource() (*DrillSource, bool) { + return nil, false +} + +// AsCouchbaseSource is the BasicCopySource implementation for HdfsSource. +func (hs HdfsSource) AsCouchbaseSource() (*CouchbaseSource, bool) { + return nil, false +} + +// AsConcurSource is the BasicCopySource implementation for HdfsSource. +func (hs HdfsSource) AsConcurSource() (*ConcurSource, bool) { + return nil, false +} + +// AsAzurePostgreSQLSource is the BasicCopySource implementation for HdfsSource. +func (hs HdfsSource) AsAzurePostgreSQLSource() (*AzurePostgreSQLSource, bool) { + return nil, false +} + +// AsAmazonMWSSource is the BasicCopySource implementation for HdfsSource. +func (hs HdfsSource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { + return nil, false +} + +// AsHTTPSource is the BasicCopySource implementation for HdfsSource. +func (hs HdfsSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for HdfsSource. +func (hs HdfsSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for HdfsSource. +func (hs HdfsSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsCassandraSource is the BasicCopySource implementation for HdfsSource. +func (hs HdfsSource) AsCassandraSource() (*CassandraSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for HdfsSource. +func (hs HdfsSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for HdfsSource. +func (hs HdfsSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureMySQLSource is the BasicCopySource implementation for HdfsSource. +func (hs HdfsSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for HdfsSource. +func (hs HdfsSource) AsHdfsSource() (*HdfsSource, bool) { + return &hs, true +} + +// AsFileSystemSource is the BasicCopySource implementation for HdfsSource. +func (hs HdfsSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsSQLDWSource is the BasicCopySource implementation for HdfsSource. +func (hs HdfsSource) AsSQLDWSource() (*SQLDWSource, bool) { + return nil, false +} + +// AsSQLSource is the BasicCopySource implementation for HdfsSource. +func (hs HdfsSource) AsSQLSource() (*SQLSource, bool) { + return nil, false +} + +// AsSapEccSource is the BasicCopySource implementation for HdfsSource. +func (hs HdfsSource) AsSapEccSource() (*SapEccSource, bool) { + return nil, false +} + +// AsSapCloudForCustomerSource is the BasicCopySource implementation for HdfsSource. +func (hs HdfsSource) AsSapCloudForCustomerSource() (*SapCloudForCustomerSource, bool) { + return nil, false +} + +// AsSalesforceSource is the BasicCopySource implementation for HdfsSource. +func (hs HdfsSource) AsSalesforceSource() (*SalesforceSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for HdfsSource. +func (hs HdfsSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for HdfsSource. +func (hs HdfsSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for HdfsSource. +func (hs HdfsSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for HdfsSource. +func (hs HdfsSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + +// AsAzureTableSource is the BasicCopySource implementation for HdfsSource. +func (hs HdfsSource) AsAzureTableSource() (*AzureTableSource, bool) { + return nil, false +} + +// AsCopySource is the BasicCopySource implementation for HdfsSource. +func (hs HdfsSource) AsCopySource() (*CopySource, bool) { + return nil, false +} + +// AsBasicCopySource is the BasicCopySource implementation for HdfsSource. +func (hs HdfsSource) AsBasicCopySource() (BasicCopySource, bool) { + return &hs, true +} + +// HDInsightHiveActivity hDInsight Hive activity type. +type HDInsightHiveActivity struct { + // HDInsightHiveActivityTypeProperties - HDInsight Hive activity properties. + *HDInsightHiveActivityTypeProperties `json:"typeProperties,omitempty"` + // LinkedServiceName - Linked service reference. + LinkedServiceName *LinkedServiceReference `json:"linkedServiceName,omitempty"` + // Policy - Activity policy. + Policy *ActivityPolicy `json:"policy,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Name - Activity name. + Name *string `json:"name,omitempty"` + // Description - Activity description. + Description *string `json:"description,omitempty"` + // DependsOn - Activity depends on condition. + DependsOn *[]ActivityDependency `json:"dependsOn,omitempty"` + // UserProperties - Activity user properties. + UserProperties map[string]*string `json:"userProperties"` + // Type - Possible values include: 'TypeActivity', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLUpdateResource', 'TypeAzureMLBatchExecution', 'TypeGetMetadata', 'TypeWebActivity', 'TypeLookup', 'TypeSQLServerStoredProcedure', 'TypeCustom', 'TypeExecuteSSISPackage', 'TypeHDInsightSpark', 'TypeHDInsightStreaming', 'TypeHDInsightMapReduce', 'TypeHDInsightPig', 'TypeHDInsightHive', 'TypeCopy', 'TypeExecution', 'TypeFilter', 'TypeUntil', 'TypeWait', 'TypeForEach', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' + Type TypeBasicActivity `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for HDInsightHiveActivity. +func (hiha HDInsightHiveActivity) MarshalJSON() ([]byte, error) { + hiha.Type = TypeHDInsightHive + objectMap := make(map[string]interface{}) + if hiha.HDInsightHiveActivityTypeProperties != nil { + objectMap["typeProperties"] = hiha.HDInsightHiveActivityTypeProperties + } + if hiha.LinkedServiceName != nil { + objectMap["linkedServiceName"] = hiha.LinkedServiceName + } + if hiha.Policy != nil { + objectMap["policy"] = hiha.Policy + } + if hiha.Name != nil { + objectMap["name"] = hiha.Name + } + if hiha.Description != nil { + objectMap["description"] = hiha.Description + } + if hiha.DependsOn != nil { + objectMap["dependsOn"] = hiha.DependsOn + } + if hiha.UserProperties != nil { + objectMap["userProperties"] = hiha.UserProperties + } + if hiha.Type != "" { + objectMap["type"] = hiha.Type + } + for k, v := range hiha.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsDatabricksNotebookActivity is the BasicActivity implementation for HDInsightHiveActivity. +func (hiha HDInsightHiveActivity) AsDatabricksNotebookActivity() (*DatabricksNotebookActivity, bool) { + return nil, false +} + +// AsDataLakeAnalyticsUSQLActivity is the BasicActivity implementation for HDInsightHiveActivity. +func (hiha HDInsightHiveActivity) AsDataLakeAnalyticsUSQLActivity() (*DataLakeAnalyticsUSQLActivity, bool) { + return nil, false +} + +// AsAzureMLUpdateResourceActivity is the BasicActivity implementation for HDInsightHiveActivity. +func (hiha HDInsightHiveActivity) AsAzureMLUpdateResourceActivity() (*AzureMLUpdateResourceActivity, bool) { + return nil, false +} + +// AsAzureMLBatchExecutionActivity is the BasicActivity implementation for HDInsightHiveActivity. +func (hiha HDInsightHiveActivity) AsAzureMLBatchExecutionActivity() (*AzureMLBatchExecutionActivity, bool) { + return nil, false +} + +// AsGetMetadataActivity is the BasicActivity implementation for HDInsightHiveActivity. +func (hiha HDInsightHiveActivity) AsGetMetadataActivity() (*GetMetadataActivity, bool) { + return nil, false +} + +// AsWebActivity is the BasicActivity implementation for HDInsightHiveActivity. +func (hiha HDInsightHiveActivity) AsWebActivity() (*WebActivity, bool) { + return nil, false +} + +// AsLookupActivity is the BasicActivity implementation for HDInsightHiveActivity. +func (hiha HDInsightHiveActivity) AsLookupActivity() (*LookupActivity, bool) { + return nil, false +} + +// AsSQLServerStoredProcedureActivity is the BasicActivity implementation for HDInsightHiveActivity. +func (hiha HDInsightHiveActivity) AsSQLServerStoredProcedureActivity() (*SQLServerStoredProcedureActivity, bool) { + return nil, false +} + +// AsCustomActivity is the BasicActivity implementation for HDInsightHiveActivity. +func (hiha HDInsightHiveActivity) AsCustomActivity() (*CustomActivity, bool) { + return nil, false +} + +// AsExecuteSSISPackageActivity is the BasicActivity implementation for HDInsightHiveActivity. +func (hiha HDInsightHiveActivity) AsExecuteSSISPackageActivity() (*ExecuteSSISPackageActivity, bool) { + return nil, false +} + +// AsHDInsightSparkActivity is the BasicActivity implementation for HDInsightHiveActivity. +func (hiha HDInsightHiveActivity) AsHDInsightSparkActivity() (*HDInsightSparkActivity, bool) { + return nil, false +} + +// AsHDInsightStreamingActivity is the BasicActivity implementation for HDInsightHiveActivity. +func (hiha HDInsightHiveActivity) AsHDInsightStreamingActivity() (*HDInsightStreamingActivity, bool) { + return nil, false +} + +// AsHDInsightMapReduceActivity is the BasicActivity implementation for HDInsightHiveActivity. +func (hiha HDInsightHiveActivity) AsHDInsightMapReduceActivity() (*HDInsightMapReduceActivity, bool) { + return nil, false +} + +// AsHDInsightPigActivity is the BasicActivity implementation for HDInsightHiveActivity. +func (hiha HDInsightHiveActivity) AsHDInsightPigActivity() (*HDInsightPigActivity, bool) { + return nil, false +} + +// AsHDInsightHiveActivity is the BasicActivity implementation for HDInsightHiveActivity. +func (hiha HDInsightHiveActivity) AsHDInsightHiveActivity() (*HDInsightHiveActivity, bool) { + return &hiha, true +} + +// AsCopyActivity is the BasicActivity implementation for HDInsightHiveActivity. +func (hiha HDInsightHiveActivity) AsCopyActivity() (*CopyActivity, bool) { + return nil, false +} + +// AsExecutionActivity is the BasicActivity implementation for HDInsightHiveActivity. +func (hiha HDInsightHiveActivity) AsExecutionActivity() (*ExecutionActivity, bool) { + return nil, false +} + +// AsBasicExecutionActivity is the BasicActivity implementation for HDInsightHiveActivity. +func (hiha HDInsightHiveActivity) AsBasicExecutionActivity() (BasicExecutionActivity, bool) { + return &hiha, true +} + +// AsFilterActivity is the BasicActivity implementation for HDInsightHiveActivity. +func (hiha HDInsightHiveActivity) AsFilterActivity() (*FilterActivity, bool) { + return nil, false +} + +// AsUntilActivity is the BasicActivity implementation for HDInsightHiveActivity. +func (hiha HDInsightHiveActivity) AsUntilActivity() (*UntilActivity, bool) { + return nil, false +} + +// AsWaitActivity is the BasicActivity implementation for HDInsightHiveActivity. +func (hiha HDInsightHiveActivity) AsWaitActivity() (*WaitActivity, bool) { + return nil, false +} + +// AsForEachActivity is the BasicActivity implementation for HDInsightHiveActivity. +func (hiha HDInsightHiveActivity) AsForEachActivity() (*ForEachActivity, bool) { + return nil, false +} + +// AsIfConditionActivity is the BasicActivity implementation for HDInsightHiveActivity. +func (hiha HDInsightHiveActivity) AsIfConditionActivity() (*IfConditionActivity, bool) { + return nil, false +} + +// AsExecutePipelineActivity is the BasicActivity implementation for HDInsightHiveActivity. +func (hiha HDInsightHiveActivity) AsExecutePipelineActivity() (*ExecutePipelineActivity, bool) { + return nil, false +} + +// AsControlActivity is the BasicActivity implementation for HDInsightHiveActivity. +func (hiha HDInsightHiveActivity) AsControlActivity() (*ControlActivity, bool) { + return nil, false +} + +// AsBasicControlActivity is the BasicActivity implementation for HDInsightHiveActivity. +func (hiha HDInsightHiveActivity) AsBasicControlActivity() (BasicControlActivity, bool) { + return nil, false +} + +// AsActivity is the BasicActivity implementation for HDInsightHiveActivity. +func (hiha HDInsightHiveActivity) AsActivity() (*Activity, bool) { + return nil, false +} + +// AsBasicActivity is the BasicActivity implementation for HDInsightHiveActivity. +func (hiha HDInsightHiveActivity) AsBasicActivity() (BasicActivity, bool) { + return &hiha, true +} + +// UnmarshalJSON is the custom unmarshaler for HDInsightHiveActivity struct. +func (hiha *HDInsightHiveActivity) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "typeProperties": + if v != nil { + var hDInsightHiveActivityTypeProperties HDInsightHiveActivityTypeProperties + err = json.Unmarshal(*v, &hDInsightHiveActivityTypeProperties) + if err != nil { + return err + } + hiha.HDInsightHiveActivityTypeProperties = &hDInsightHiveActivityTypeProperties + } + case "linkedServiceName": + if v != nil { + var linkedServiceName LinkedServiceReference + err = json.Unmarshal(*v, &linkedServiceName) + if err != nil { + return err + } + hiha.LinkedServiceName = &linkedServiceName + } + case "policy": + if v != nil { + var policy ActivityPolicy + err = json.Unmarshal(*v, &policy) + if err != nil { + return err + } + hiha.Policy = &policy + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if hiha.AdditionalProperties == nil { + hiha.AdditionalProperties = make(map[string]interface{}) + } + hiha.AdditionalProperties[k] = additionalProperties + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + hiha.Name = &name + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + hiha.Description = &description + } + case "dependsOn": + if v != nil { + var dependsOn []ActivityDependency + err = json.Unmarshal(*v, &dependsOn) + if err != nil { + return err + } + hiha.DependsOn = &dependsOn + } + case "userProperties": + if v != nil { + var userProperties map[string]*string + err = json.Unmarshal(*v, &userProperties) + if err != nil { + return err + } + hiha.UserProperties = userProperties + } + case "type": + if v != nil { + var typeVar TypeBasicActivity + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + hiha.Type = typeVar + } + } + } + + return nil +} + +// HDInsightHiveActivityTypeProperties hDInsight Hive activity properties. +type HDInsightHiveActivityTypeProperties struct { + // StorageLinkedServices - Storage linked service references. + StorageLinkedServices *[]LinkedServiceReference `json:"storageLinkedServices,omitempty"` + // Arguments - User specified arguments to HDInsightActivity. + Arguments *[]interface{} `json:"arguments,omitempty"` + // GetDebugInfo - Debug info option. Possible values include: 'None', 'Always', 'Failure' + GetDebugInfo HDInsightActivityDebugInfoOption `json:"getDebugInfo,omitempty"` + // ScriptPath - Script path. Type: string (or Expression with resultType string). + ScriptPath interface{} `json:"scriptPath,omitempty"` + // ScriptLinkedService - Script linked service reference. + ScriptLinkedService *LinkedServiceReference `json:"scriptLinkedService,omitempty"` + // Defines - Allows user to specify defines for Hive job request. + Defines map[string]interface{} `json:"defines"` +} + +// MarshalJSON is the custom marshaler for HDInsightHiveActivityTypeProperties. +func (hihatp HDInsightHiveActivityTypeProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if hihatp.StorageLinkedServices != nil { + objectMap["storageLinkedServices"] = hihatp.StorageLinkedServices + } + if hihatp.Arguments != nil { + objectMap["arguments"] = hihatp.Arguments + } + if hihatp.GetDebugInfo != "" { + objectMap["getDebugInfo"] = hihatp.GetDebugInfo + } + objectMap["scriptPath"] = hihatp.ScriptPath + if hihatp.ScriptLinkedService != nil { + objectMap["scriptLinkedService"] = hihatp.ScriptLinkedService + } + if hihatp.Defines != nil { + objectMap["defines"] = hihatp.Defines + } + return json.Marshal(objectMap) +} + +// HDInsightLinkedService hDInsight linked service. +type HDInsightLinkedService struct { + // HDInsightLinkedServiceTypeProperties - HDInsight linked service properties. + *HDInsightLinkedServiceTypeProperties `json:"typeProperties,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // ConnectVia - The integration runtime reference. + ConnectVia *IntegrationRuntimeReference `json:"connectVia,omitempty"` + // Description - Linked service description. + Description *string `json:"description,omitempty"` + // Parameters - Parameters for linked service. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeLinkedService', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforce', 'TypeAzureDataLakeStore', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureStorage' + Type TypeBasicLinkedService `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for HDInsightLinkedService. +func (hils HDInsightLinkedService) MarshalJSON() ([]byte, error) { + hils.Type = TypeHDInsight + objectMap := make(map[string]interface{}) + if hils.HDInsightLinkedServiceTypeProperties != nil { + objectMap["typeProperties"] = hils.HDInsightLinkedServiceTypeProperties + } + if hils.ConnectVia != nil { + objectMap["connectVia"] = hils.ConnectVia + } + if hils.Description != nil { + objectMap["description"] = hils.Description + } + if hils.Parameters != nil { + objectMap["parameters"] = hils.Parameters + } + if hils.Annotations != nil { + objectMap["annotations"] = hils.Annotations + } + if hils.Type != "" { + objectMap["type"] = hils.Type + } + for k, v := range hils.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysLinkedService is the BasicLinkedService implementation for HDInsightLinkedService. +func (hils HDInsightLinkedService) AsResponsysLinkedService() (*ResponsysLinkedService, bool) { + return nil, false +} + +// AsAzureDatabricksLinkedService is the BasicLinkedService implementation for HDInsightLinkedService. +func (hils HDInsightLinkedService) AsAzureDatabricksLinkedService() (*AzureDatabricksLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeAnalyticsLinkedService is the BasicLinkedService implementation for HDInsightLinkedService. +func (hils HDInsightLinkedService) AsAzureDataLakeAnalyticsLinkedService() (*AzureDataLakeAnalyticsLinkedService, bool) { + return nil, false +} + +// AsHDInsightOnDemandLinkedService is the BasicLinkedService implementation for HDInsightLinkedService. +func (hils HDInsightLinkedService) AsHDInsightOnDemandLinkedService() (*HDInsightOnDemandLinkedService, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudLinkedService is the BasicLinkedService implementation for HDInsightLinkedService. +func (hils HDInsightLinkedService) AsSalesforceMarketingCloudLinkedService() (*SalesforceMarketingCloudLinkedService, bool) { + return nil, false +} + +// AsNetezzaLinkedService is the BasicLinkedService implementation for HDInsightLinkedService. +func (hils HDInsightLinkedService) AsNetezzaLinkedService() (*NetezzaLinkedService, bool) { + return nil, false +} + +// AsVerticaLinkedService is the BasicLinkedService implementation for HDInsightLinkedService. +func (hils HDInsightLinkedService) AsVerticaLinkedService() (*VerticaLinkedService, bool) { + return nil, false +} + +// AsZohoLinkedService is the BasicLinkedService implementation for HDInsightLinkedService. +func (hils HDInsightLinkedService) AsZohoLinkedService() (*ZohoLinkedService, bool) { + return nil, false +} + +// AsXeroLinkedService is the BasicLinkedService implementation for HDInsightLinkedService. +func (hils HDInsightLinkedService) AsXeroLinkedService() (*XeroLinkedService, bool) { + return nil, false +} + +// AsSquareLinkedService is the BasicLinkedService implementation for HDInsightLinkedService. +func (hils HDInsightLinkedService) AsSquareLinkedService() (*SquareLinkedService, bool) { + return nil, false +} + +// AsSparkLinkedService is the BasicLinkedService implementation for HDInsightLinkedService. +func (hils HDInsightLinkedService) AsSparkLinkedService() (*SparkLinkedService, bool) { + return nil, false +} + +// AsShopifyLinkedService is the BasicLinkedService implementation for HDInsightLinkedService. +func (hils HDInsightLinkedService) AsShopifyLinkedService() (*ShopifyLinkedService, bool) { + return nil, false +} + +// AsServiceNowLinkedService is the BasicLinkedService implementation for HDInsightLinkedService. +func (hils HDInsightLinkedService) AsServiceNowLinkedService() (*ServiceNowLinkedService, bool) { + return nil, false +} + +// AsQuickBooksLinkedService is the BasicLinkedService implementation for HDInsightLinkedService. +func (hils HDInsightLinkedService) AsQuickBooksLinkedService() (*QuickBooksLinkedService, bool) { + return nil, false +} + +// AsPrestoLinkedService is the BasicLinkedService implementation for HDInsightLinkedService. +func (hils HDInsightLinkedService) AsPrestoLinkedService() (*PrestoLinkedService, bool) { + return nil, false +} + +// AsPhoenixLinkedService is the BasicLinkedService implementation for HDInsightLinkedService. +func (hils HDInsightLinkedService) AsPhoenixLinkedService() (*PhoenixLinkedService, bool) { + return nil, false +} + +// AsPaypalLinkedService is the BasicLinkedService implementation for HDInsightLinkedService. +func (hils HDInsightLinkedService) AsPaypalLinkedService() (*PaypalLinkedService, bool) { + return nil, false +} + +// AsMarketoLinkedService is the BasicLinkedService implementation for HDInsightLinkedService. +func (hils HDInsightLinkedService) AsMarketoLinkedService() (*MarketoLinkedService, bool) { + return nil, false +} + +// AsMariaDBLinkedService is the BasicLinkedService implementation for HDInsightLinkedService. +func (hils HDInsightLinkedService) AsMariaDBLinkedService() (*MariaDBLinkedService, bool) { + return nil, false +} + +// AsMagentoLinkedService is the BasicLinkedService implementation for HDInsightLinkedService. +func (hils HDInsightLinkedService) AsMagentoLinkedService() (*MagentoLinkedService, bool) { + return nil, false +} + +// AsJiraLinkedService is the BasicLinkedService implementation for HDInsightLinkedService. +func (hils HDInsightLinkedService) AsJiraLinkedService() (*JiraLinkedService, bool) { + return nil, false +} + +// AsImpalaLinkedService is the BasicLinkedService implementation for HDInsightLinkedService. +func (hils HDInsightLinkedService) AsImpalaLinkedService() (*ImpalaLinkedService, bool) { + return nil, false +} + +// AsHubspotLinkedService is the BasicLinkedService implementation for HDInsightLinkedService. +func (hils HDInsightLinkedService) AsHubspotLinkedService() (*HubspotLinkedService, bool) { + return nil, false +} + +// AsHiveLinkedService is the BasicLinkedService implementation for HDInsightLinkedService. +func (hils HDInsightLinkedService) AsHiveLinkedService() (*HiveLinkedService, bool) { + return nil, false +} + +// AsHBaseLinkedService is the BasicLinkedService implementation for HDInsightLinkedService. +func (hils HDInsightLinkedService) AsHBaseLinkedService() (*HBaseLinkedService, bool) { + return nil, false +} + +// AsGreenplumLinkedService is the BasicLinkedService implementation for HDInsightLinkedService. +func (hils HDInsightLinkedService) AsGreenplumLinkedService() (*GreenplumLinkedService, bool) { + return nil, false +} + +// AsGoogleBigQueryLinkedService is the BasicLinkedService implementation for HDInsightLinkedService. +func (hils HDInsightLinkedService) AsGoogleBigQueryLinkedService() (*GoogleBigQueryLinkedService, bool) { + return nil, false +} + +// AsEloquaLinkedService is the BasicLinkedService implementation for HDInsightLinkedService. +func (hils HDInsightLinkedService) AsEloquaLinkedService() (*EloquaLinkedService, bool) { + return nil, false +} + +// AsDrillLinkedService is the BasicLinkedService implementation for HDInsightLinkedService. +func (hils HDInsightLinkedService) AsDrillLinkedService() (*DrillLinkedService, bool) { + return nil, false +} + +// AsCouchbaseLinkedService is the BasicLinkedService implementation for HDInsightLinkedService. +func (hils HDInsightLinkedService) AsCouchbaseLinkedService() (*CouchbaseLinkedService, bool) { + return nil, false +} + +// AsConcurLinkedService is the BasicLinkedService implementation for HDInsightLinkedService. +func (hils HDInsightLinkedService) AsConcurLinkedService() (*ConcurLinkedService, bool) { + return nil, false +} + +// AsAzurePostgreSQLLinkedService is the BasicLinkedService implementation for HDInsightLinkedService. +func (hils HDInsightLinkedService) AsAzurePostgreSQLLinkedService() (*AzurePostgreSQLLinkedService, bool) { + return nil, false +} + +// AsAmazonMWSLinkedService is the BasicLinkedService implementation for HDInsightLinkedService. +func (hils HDInsightLinkedService) AsAmazonMWSLinkedService() (*AmazonMWSLinkedService, bool) { + return nil, false +} + +// AsSapHanaLinkedService is the BasicLinkedService implementation for HDInsightLinkedService. +func (hils HDInsightLinkedService) AsSapHanaLinkedService() (*SapHanaLinkedService, bool) { + return nil, false +} + +// AsSapBWLinkedService is the BasicLinkedService implementation for HDInsightLinkedService. +func (hils HDInsightLinkedService) AsSapBWLinkedService() (*SapBWLinkedService, bool) { + return nil, false +} + +// AsSftpServerLinkedService is the BasicLinkedService implementation for HDInsightLinkedService. +func (hils HDInsightLinkedService) AsSftpServerLinkedService() (*SftpServerLinkedService, bool) { + return nil, false +} + +// AsFtpServerLinkedService is the BasicLinkedService implementation for HDInsightLinkedService. +func (hils HDInsightLinkedService) AsFtpServerLinkedService() (*FtpServerLinkedService, bool) { + return nil, false +} + +// AsHTTPLinkedService is the BasicLinkedService implementation for HDInsightLinkedService. +func (hils HDInsightLinkedService) AsHTTPLinkedService() (*HTTPLinkedService, bool) { + return nil, false +} + +// AsAzureSearchLinkedService is the BasicLinkedService implementation for HDInsightLinkedService. +func (hils HDInsightLinkedService) AsAzureSearchLinkedService() (*AzureSearchLinkedService, bool) { + return nil, false +} + +// AsCustomDataSourceLinkedService is the BasicLinkedService implementation for HDInsightLinkedService. +func (hils HDInsightLinkedService) AsCustomDataSourceLinkedService() (*CustomDataSourceLinkedService, bool) { + return nil, false +} + +// AsAmazonRedshiftLinkedService is the BasicLinkedService implementation for HDInsightLinkedService. +func (hils HDInsightLinkedService) AsAmazonRedshiftLinkedService() (*AmazonRedshiftLinkedService, bool) { + return nil, false +} + +// AsAmazonS3LinkedService is the BasicLinkedService implementation for HDInsightLinkedService. +func (hils HDInsightLinkedService) AsAmazonS3LinkedService() (*AmazonS3LinkedService, bool) { + return nil, false +} + +// AsSapEccLinkedService is the BasicLinkedService implementation for HDInsightLinkedService. +func (hils HDInsightLinkedService) AsSapEccLinkedService() (*SapEccLinkedService, bool) { + return nil, false +} + +// AsSapCloudForCustomerLinkedService is the BasicLinkedService implementation for HDInsightLinkedService. +func (hils HDInsightLinkedService) AsSapCloudForCustomerLinkedService() (*SapCloudForCustomerLinkedService, bool) { + return nil, false +} + +// AsSalesforceLinkedService is the BasicLinkedService implementation for HDInsightLinkedService. +func (hils HDInsightLinkedService) AsSalesforceLinkedService() (*SalesforceLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeStoreLinkedService is the BasicLinkedService implementation for HDInsightLinkedService. +func (hils HDInsightLinkedService) AsAzureDataLakeStoreLinkedService() (*AzureDataLakeStoreLinkedService, bool) { + return nil, false +} + +// AsMongoDbLinkedService is the BasicLinkedService implementation for HDInsightLinkedService. +func (hils HDInsightLinkedService) AsMongoDbLinkedService() (*MongoDbLinkedService, bool) { + return nil, false +} + +// AsCassandraLinkedService is the BasicLinkedService implementation for HDInsightLinkedService. +func (hils HDInsightLinkedService) AsCassandraLinkedService() (*CassandraLinkedService, bool) { + return nil, false +} + +// AsWebLinkedService is the BasicLinkedService implementation for HDInsightLinkedService. +func (hils HDInsightLinkedService) AsWebLinkedService() (*WebLinkedService, bool) { + return nil, false +} + +// AsODataLinkedService is the BasicLinkedService implementation for HDInsightLinkedService. +func (hils HDInsightLinkedService) AsODataLinkedService() (*ODataLinkedService, bool) { + return nil, false +} + +// AsHdfsLinkedService is the BasicLinkedService implementation for HDInsightLinkedService. +func (hils HDInsightLinkedService) AsHdfsLinkedService() (*HdfsLinkedService, bool) { + return nil, false +} + +// AsOdbcLinkedService is the BasicLinkedService implementation for HDInsightLinkedService. +func (hils HDInsightLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, bool) { + return nil, false +} + +// AsAzureMLLinkedService is the BasicLinkedService implementation for HDInsightLinkedService. +func (hils HDInsightLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { + return nil, false +} + +// AsTeradataLinkedService is the BasicLinkedService implementation for HDInsightLinkedService. +func (hils HDInsightLinkedService) AsTeradataLinkedService() (*TeradataLinkedService, bool) { + return nil, false +} + +// AsDb2LinkedService is the BasicLinkedService implementation for HDInsightLinkedService. +func (hils HDInsightLinkedService) AsDb2LinkedService() (*Db2LinkedService, bool) { + return nil, false +} + +// AsSybaseLinkedService is the BasicLinkedService implementation for HDInsightLinkedService. +func (hils HDInsightLinkedService) AsSybaseLinkedService() (*SybaseLinkedService, bool) { + return nil, false +} + +// AsPostgreSQLLinkedService is the BasicLinkedService implementation for HDInsightLinkedService. +func (hils HDInsightLinkedService) AsPostgreSQLLinkedService() (*PostgreSQLLinkedService, bool) { + return nil, false +} + +// AsMySQLLinkedService is the BasicLinkedService implementation for HDInsightLinkedService. +func (hils HDInsightLinkedService) AsMySQLLinkedService() (*MySQLLinkedService, bool) { + return nil, false +} + +// AsAzureMySQLLinkedService is the BasicLinkedService implementation for HDInsightLinkedService. +func (hils HDInsightLinkedService) AsAzureMySQLLinkedService() (*AzureMySQLLinkedService, bool) { + return nil, false +} + +// AsOracleLinkedService is the BasicLinkedService implementation for HDInsightLinkedService. +func (hils HDInsightLinkedService) AsOracleLinkedService() (*OracleLinkedService, bool) { + return nil, false +} + +// AsFileServerLinkedService is the BasicLinkedService implementation for HDInsightLinkedService. +func (hils HDInsightLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { + return nil, false +} + +// AsHDInsightLinkedService is the BasicLinkedService implementation for HDInsightLinkedService. +func (hils HDInsightLinkedService) AsHDInsightLinkedService() (*HDInsightLinkedService, bool) { + return &hils, true +} + +// AsDynamicsLinkedService is the BasicLinkedService implementation for HDInsightLinkedService. +func (hils HDInsightLinkedService) AsDynamicsLinkedService() (*DynamicsLinkedService, bool) { + return nil, false +} + +// AsCosmosDbLinkedService is the BasicLinkedService implementation for HDInsightLinkedService. +func (hils HDInsightLinkedService) AsCosmosDbLinkedService() (*CosmosDbLinkedService, bool) { + return nil, false +} + +// AsAzureKeyVaultLinkedService is the BasicLinkedService implementation for HDInsightLinkedService. +func (hils HDInsightLinkedService) AsAzureKeyVaultLinkedService() (*AzureKeyVaultLinkedService, bool) { + return nil, false +} + +// AsAzureBatchLinkedService is the BasicLinkedService implementation for HDInsightLinkedService. +func (hils HDInsightLinkedService) AsAzureBatchLinkedService() (*AzureBatchLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDatabaseLinkedService is the BasicLinkedService implementation for HDInsightLinkedService. +func (hils HDInsightLinkedService) AsAzureSQLDatabaseLinkedService() (*AzureSQLDatabaseLinkedService, bool) { + return nil, false +} + +// AsSQLServerLinkedService is the BasicLinkedService implementation for HDInsightLinkedService. +func (hils HDInsightLinkedService) AsSQLServerLinkedService() (*SQLServerLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDWLinkedService is the BasicLinkedService implementation for HDInsightLinkedService. +func (hils HDInsightLinkedService) AsAzureSQLDWLinkedService() (*AzureSQLDWLinkedService, bool) { + return nil, false +} + +// AsAzureStorageLinkedService is the BasicLinkedService implementation for HDInsightLinkedService. +func (hils HDInsightLinkedService) AsAzureStorageLinkedService() (*AzureStorageLinkedService, bool) { + return nil, false +} + +// AsLinkedService is the BasicLinkedService implementation for HDInsightLinkedService. +func (hils HDInsightLinkedService) AsLinkedService() (*LinkedService, bool) { + return nil, false +} + +// AsBasicLinkedService is the BasicLinkedService implementation for HDInsightLinkedService. +func (hils HDInsightLinkedService) AsBasicLinkedService() (BasicLinkedService, bool) { + return &hils, true +} + +// UnmarshalJSON is the custom unmarshaler for HDInsightLinkedService struct. +func (hils *HDInsightLinkedService) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "typeProperties": + if v != nil { + var hDInsightLinkedServiceTypeProperties HDInsightLinkedServiceTypeProperties + err = json.Unmarshal(*v, &hDInsightLinkedServiceTypeProperties) + if err != nil { + return err + } + hils.HDInsightLinkedServiceTypeProperties = &hDInsightLinkedServiceTypeProperties + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if hils.AdditionalProperties == nil { + hils.AdditionalProperties = make(map[string]interface{}) + } + hils.AdditionalProperties[k] = additionalProperties + } + case "connectVia": + if v != nil { + var connectVia IntegrationRuntimeReference + err = json.Unmarshal(*v, &connectVia) + if err != nil { + return err + } + hils.ConnectVia = &connectVia + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + hils.Description = &description + } + case "parameters": + if v != nil { + var parameters map[string]*ParameterSpecification + err = json.Unmarshal(*v, ¶meters) + if err != nil { + return err + } + hils.Parameters = parameters + } + case "annotations": + if v != nil { + var annotations []interface{} + err = json.Unmarshal(*v, &annotations) + if err != nil { + return err + } + hils.Annotations = &annotations + } + case "type": + if v != nil { + var typeVar TypeBasicLinkedService + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + hils.Type = typeVar + } + } + } + + return nil +} + +// HDInsightLinkedServiceTypeProperties hDInsight linked service properties. +type HDInsightLinkedServiceTypeProperties struct { + // ClusterURI - HDInsight cluster URI. Type: string (or Expression with resultType string). + ClusterURI interface{} `json:"clusterUri,omitempty"` + // UserName - HDInsight cluster user name. Type: string (or Expression with resultType string). + UserName interface{} `json:"userName,omitempty"` + // Password - HDInsight cluster password. + Password BasicSecretBase `json:"password,omitempty"` + // LinkedServiceName - The Azure Storage linked service reference. + LinkedServiceName *LinkedServiceReference `json:"linkedServiceName,omitempty"` + // HcatalogLinkedServiceName - A reference to the Azure SQL linked service that points to the HCatalog database. + HcatalogLinkedServiceName *LinkedServiceReference `json:"hcatalogLinkedServiceName,omitempty"` + // EncryptedCredential - The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string). + EncryptedCredential interface{} `json:"encryptedCredential,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for HDInsightLinkedServiceTypeProperties struct. +func (hilstp *HDInsightLinkedServiceTypeProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "clusterUri": + if v != nil { + var clusterURI interface{} + err = json.Unmarshal(*v, &clusterURI) + if err != nil { + return err + } + hilstp.ClusterURI = clusterURI + } + case "userName": + if v != nil { + var userName interface{} + err = json.Unmarshal(*v, &userName) + if err != nil { + return err + } + hilstp.UserName = userName + } + case "password": + if v != nil { + password, err := unmarshalBasicSecretBase(*v) + if err != nil { + return err + } + hilstp.Password = password + } + case "linkedServiceName": + if v != nil { + var linkedServiceName LinkedServiceReference + err = json.Unmarshal(*v, &linkedServiceName) + if err != nil { + return err + } + hilstp.LinkedServiceName = &linkedServiceName + } + case "hcatalogLinkedServiceName": + if v != nil { + var hcatalogLinkedServiceName LinkedServiceReference + err = json.Unmarshal(*v, &hcatalogLinkedServiceName) + if err != nil { + return err + } + hilstp.HcatalogLinkedServiceName = &hcatalogLinkedServiceName + } + case "encryptedCredential": + if v != nil { + var encryptedCredential interface{} + err = json.Unmarshal(*v, &encryptedCredential) + if err != nil { + return err + } + hilstp.EncryptedCredential = encryptedCredential + } + } + } + + return nil +} + +// HDInsightMapReduceActivity hDInsight MapReduce activity type. +type HDInsightMapReduceActivity struct { + // HDInsightMapReduceActivityTypeProperties - HDInsight MapReduce activity properties. + *HDInsightMapReduceActivityTypeProperties `json:"typeProperties,omitempty"` + // LinkedServiceName - Linked service reference. + LinkedServiceName *LinkedServiceReference `json:"linkedServiceName,omitempty"` + // Policy - Activity policy. + Policy *ActivityPolicy `json:"policy,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Name - Activity name. + Name *string `json:"name,omitempty"` + // Description - Activity description. + Description *string `json:"description,omitempty"` + // DependsOn - Activity depends on condition. + DependsOn *[]ActivityDependency `json:"dependsOn,omitempty"` + // UserProperties - Activity user properties. + UserProperties map[string]*string `json:"userProperties"` + // Type - Possible values include: 'TypeActivity', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLUpdateResource', 'TypeAzureMLBatchExecution', 'TypeGetMetadata', 'TypeWebActivity', 'TypeLookup', 'TypeSQLServerStoredProcedure', 'TypeCustom', 'TypeExecuteSSISPackage', 'TypeHDInsightSpark', 'TypeHDInsightStreaming', 'TypeHDInsightMapReduce', 'TypeHDInsightPig', 'TypeHDInsightHive', 'TypeCopy', 'TypeExecution', 'TypeFilter', 'TypeUntil', 'TypeWait', 'TypeForEach', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' + Type TypeBasicActivity `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for HDInsightMapReduceActivity. +func (himra HDInsightMapReduceActivity) MarshalJSON() ([]byte, error) { + himra.Type = TypeHDInsightMapReduce + objectMap := make(map[string]interface{}) + if himra.HDInsightMapReduceActivityTypeProperties != nil { + objectMap["typeProperties"] = himra.HDInsightMapReduceActivityTypeProperties + } + if himra.LinkedServiceName != nil { + objectMap["linkedServiceName"] = himra.LinkedServiceName + } + if himra.Policy != nil { + objectMap["policy"] = himra.Policy + } + if himra.Name != nil { + objectMap["name"] = himra.Name + } + if himra.Description != nil { + objectMap["description"] = himra.Description + } + if himra.DependsOn != nil { + objectMap["dependsOn"] = himra.DependsOn + } + if himra.UserProperties != nil { + objectMap["userProperties"] = himra.UserProperties + } + if himra.Type != "" { + objectMap["type"] = himra.Type + } + for k, v := range himra.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsDatabricksNotebookActivity is the BasicActivity implementation for HDInsightMapReduceActivity. +func (himra HDInsightMapReduceActivity) AsDatabricksNotebookActivity() (*DatabricksNotebookActivity, bool) { + return nil, false +} + +// AsDataLakeAnalyticsUSQLActivity is the BasicActivity implementation for HDInsightMapReduceActivity. +func (himra HDInsightMapReduceActivity) AsDataLakeAnalyticsUSQLActivity() (*DataLakeAnalyticsUSQLActivity, bool) { + return nil, false +} + +// AsAzureMLUpdateResourceActivity is the BasicActivity implementation for HDInsightMapReduceActivity. +func (himra HDInsightMapReduceActivity) AsAzureMLUpdateResourceActivity() (*AzureMLUpdateResourceActivity, bool) { + return nil, false +} + +// AsAzureMLBatchExecutionActivity is the BasicActivity implementation for HDInsightMapReduceActivity. +func (himra HDInsightMapReduceActivity) AsAzureMLBatchExecutionActivity() (*AzureMLBatchExecutionActivity, bool) { + return nil, false +} + +// AsGetMetadataActivity is the BasicActivity implementation for HDInsightMapReduceActivity. +func (himra HDInsightMapReduceActivity) AsGetMetadataActivity() (*GetMetadataActivity, bool) { + return nil, false +} + +// AsWebActivity is the BasicActivity implementation for HDInsightMapReduceActivity. +func (himra HDInsightMapReduceActivity) AsWebActivity() (*WebActivity, bool) { + return nil, false +} + +// AsLookupActivity is the BasicActivity implementation for HDInsightMapReduceActivity. +func (himra HDInsightMapReduceActivity) AsLookupActivity() (*LookupActivity, bool) { + return nil, false +} + +// AsSQLServerStoredProcedureActivity is the BasicActivity implementation for HDInsightMapReduceActivity. +func (himra HDInsightMapReduceActivity) AsSQLServerStoredProcedureActivity() (*SQLServerStoredProcedureActivity, bool) { + return nil, false +} + +// AsCustomActivity is the BasicActivity implementation for HDInsightMapReduceActivity. +func (himra HDInsightMapReduceActivity) AsCustomActivity() (*CustomActivity, bool) { + return nil, false +} + +// AsExecuteSSISPackageActivity is the BasicActivity implementation for HDInsightMapReduceActivity. +func (himra HDInsightMapReduceActivity) AsExecuteSSISPackageActivity() (*ExecuteSSISPackageActivity, bool) { + return nil, false +} + +// AsHDInsightSparkActivity is the BasicActivity implementation for HDInsightMapReduceActivity. +func (himra HDInsightMapReduceActivity) AsHDInsightSparkActivity() (*HDInsightSparkActivity, bool) { + return nil, false +} + +// AsHDInsightStreamingActivity is the BasicActivity implementation for HDInsightMapReduceActivity. +func (himra HDInsightMapReduceActivity) AsHDInsightStreamingActivity() (*HDInsightStreamingActivity, bool) { + return nil, false +} + +// AsHDInsightMapReduceActivity is the BasicActivity implementation for HDInsightMapReduceActivity. +func (himra HDInsightMapReduceActivity) AsHDInsightMapReduceActivity() (*HDInsightMapReduceActivity, bool) { + return &himra, true +} + +// AsHDInsightPigActivity is the BasicActivity implementation for HDInsightMapReduceActivity. +func (himra HDInsightMapReduceActivity) AsHDInsightPigActivity() (*HDInsightPigActivity, bool) { + return nil, false +} + +// AsHDInsightHiveActivity is the BasicActivity implementation for HDInsightMapReduceActivity. +func (himra HDInsightMapReduceActivity) AsHDInsightHiveActivity() (*HDInsightHiveActivity, bool) { + return nil, false +} + +// AsCopyActivity is the BasicActivity implementation for HDInsightMapReduceActivity. +func (himra HDInsightMapReduceActivity) AsCopyActivity() (*CopyActivity, bool) { + return nil, false +} + +// AsExecutionActivity is the BasicActivity implementation for HDInsightMapReduceActivity. +func (himra HDInsightMapReduceActivity) AsExecutionActivity() (*ExecutionActivity, bool) { + return nil, false +} + +// AsBasicExecutionActivity is the BasicActivity implementation for HDInsightMapReduceActivity. +func (himra HDInsightMapReduceActivity) AsBasicExecutionActivity() (BasicExecutionActivity, bool) { + return &himra, true +} + +// AsFilterActivity is the BasicActivity implementation for HDInsightMapReduceActivity. +func (himra HDInsightMapReduceActivity) AsFilterActivity() (*FilterActivity, bool) { + return nil, false +} + +// AsUntilActivity is the BasicActivity implementation for HDInsightMapReduceActivity. +func (himra HDInsightMapReduceActivity) AsUntilActivity() (*UntilActivity, bool) { + return nil, false +} + +// AsWaitActivity is the BasicActivity implementation for HDInsightMapReduceActivity. +func (himra HDInsightMapReduceActivity) AsWaitActivity() (*WaitActivity, bool) { + return nil, false +} + +// AsForEachActivity is the BasicActivity implementation for HDInsightMapReduceActivity. +func (himra HDInsightMapReduceActivity) AsForEachActivity() (*ForEachActivity, bool) { + return nil, false +} + +// AsIfConditionActivity is the BasicActivity implementation for HDInsightMapReduceActivity. +func (himra HDInsightMapReduceActivity) AsIfConditionActivity() (*IfConditionActivity, bool) { + return nil, false +} + +// AsExecutePipelineActivity is the BasicActivity implementation for HDInsightMapReduceActivity. +func (himra HDInsightMapReduceActivity) AsExecutePipelineActivity() (*ExecutePipelineActivity, bool) { + return nil, false +} + +// AsControlActivity is the BasicActivity implementation for HDInsightMapReduceActivity. +func (himra HDInsightMapReduceActivity) AsControlActivity() (*ControlActivity, bool) { + return nil, false +} + +// AsBasicControlActivity is the BasicActivity implementation for HDInsightMapReduceActivity. +func (himra HDInsightMapReduceActivity) AsBasicControlActivity() (BasicControlActivity, bool) { + return nil, false +} + +// AsActivity is the BasicActivity implementation for HDInsightMapReduceActivity. +func (himra HDInsightMapReduceActivity) AsActivity() (*Activity, bool) { + return nil, false +} + +// AsBasicActivity is the BasicActivity implementation for HDInsightMapReduceActivity. +func (himra HDInsightMapReduceActivity) AsBasicActivity() (BasicActivity, bool) { + return &himra, true +} + +// UnmarshalJSON is the custom unmarshaler for HDInsightMapReduceActivity struct. +func (himra *HDInsightMapReduceActivity) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "typeProperties": + if v != nil { + var hDInsightMapReduceActivityTypeProperties HDInsightMapReduceActivityTypeProperties + err = json.Unmarshal(*v, &hDInsightMapReduceActivityTypeProperties) + if err != nil { + return err + } + himra.HDInsightMapReduceActivityTypeProperties = &hDInsightMapReduceActivityTypeProperties + } + case "linkedServiceName": + if v != nil { + var linkedServiceName LinkedServiceReference + err = json.Unmarshal(*v, &linkedServiceName) + if err != nil { + return err + } + himra.LinkedServiceName = &linkedServiceName + } + case "policy": + if v != nil { + var policy ActivityPolicy + err = json.Unmarshal(*v, &policy) + if err != nil { + return err + } + himra.Policy = &policy + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if himra.AdditionalProperties == nil { + himra.AdditionalProperties = make(map[string]interface{}) + } + himra.AdditionalProperties[k] = additionalProperties + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + himra.Name = &name + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + himra.Description = &description + } + case "dependsOn": + if v != nil { + var dependsOn []ActivityDependency + err = json.Unmarshal(*v, &dependsOn) + if err != nil { + return err + } + himra.DependsOn = &dependsOn + } + case "userProperties": + if v != nil { + var userProperties map[string]*string + err = json.Unmarshal(*v, &userProperties) + if err != nil { + return err + } + himra.UserProperties = userProperties + } + case "type": + if v != nil { + var typeVar TypeBasicActivity + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + himra.Type = typeVar + } + } + } + + return nil +} + +// HDInsightMapReduceActivityTypeProperties hDInsight MapReduce activity properties. +type HDInsightMapReduceActivityTypeProperties struct { + // StorageLinkedServices - Storage linked service references. + StorageLinkedServices *[]LinkedServiceReference `json:"storageLinkedServices,omitempty"` + // Arguments - User specified arguments to HDInsightActivity. + Arguments *[]interface{} `json:"arguments,omitempty"` + // GetDebugInfo - Debug info option. Possible values include: 'None', 'Always', 'Failure' + GetDebugInfo HDInsightActivityDebugInfoOption `json:"getDebugInfo,omitempty"` + // ClassName - Class name. Type: string (or Expression with resultType string). + ClassName interface{} `json:"className,omitempty"` + // JarFilePath - Jar path. Type: string (or Expression with resultType string). + JarFilePath interface{} `json:"jarFilePath,omitempty"` + // JarLinkedService - Jar linked service reference. + JarLinkedService *LinkedServiceReference `json:"jarLinkedService,omitempty"` + // JarLibs - Jar libs. + JarLibs *[]interface{} `json:"jarLibs,omitempty"` + // Defines - Allows user to specify defines for the MapReduce job request. + Defines map[string]interface{} `json:"defines"` +} + +// MarshalJSON is the custom marshaler for HDInsightMapReduceActivityTypeProperties. +func (himratp HDInsightMapReduceActivityTypeProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if himratp.StorageLinkedServices != nil { + objectMap["storageLinkedServices"] = himratp.StorageLinkedServices + } + if himratp.Arguments != nil { + objectMap["arguments"] = himratp.Arguments + } + if himratp.GetDebugInfo != "" { + objectMap["getDebugInfo"] = himratp.GetDebugInfo + } + objectMap["className"] = himratp.ClassName + objectMap["jarFilePath"] = himratp.JarFilePath + if himratp.JarLinkedService != nil { + objectMap["jarLinkedService"] = himratp.JarLinkedService + } + if himratp.JarLibs != nil { + objectMap["jarLibs"] = himratp.JarLibs + } + if himratp.Defines != nil { + objectMap["defines"] = himratp.Defines + } + return json.Marshal(objectMap) +} + +// HDInsightOnDemandLinkedService hDInsight ondemand linked service. +type HDInsightOnDemandLinkedService struct { + // HDInsightOnDemandLinkedServiceTypeProperties - HDInsight ondemand linked service properties. + *HDInsightOnDemandLinkedServiceTypeProperties `json:"typeProperties,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // ConnectVia - The integration runtime reference. + ConnectVia *IntegrationRuntimeReference `json:"connectVia,omitempty"` + // Description - Linked service description. + Description *string `json:"description,omitempty"` + // Parameters - Parameters for linked service. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeLinkedService', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforce', 'TypeAzureDataLakeStore', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureStorage' + Type TypeBasicLinkedService `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for HDInsightOnDemandLinkedService. +func (hiodls HDInsightOnDemandLinkedService) MarshalJSON() ([]byte, error) { + hiodls.Type = TypeHDInsightOnDemand + objectMap := make(map[string]interface{}) + if hiodls.HDInsightOnDemandLinkedServiceTypeProperties != nil { + objectMap["typeProperties"] = hiodls.HDInsightOnDemandLinkedServiceTypeProperties + } + if hiodls.ConnectVia != nil { + objectMap["connectVia"] = hiodls.ConnectVia + } + if hiodls.Description != nil { + objectMap["description"] = hiodls.Description + } + if hiodls.Parameters != nil { + objectMap["parameters"] = hiodls.Parameters + } + if hiodls.Annotations != nil { + objectMap["annotations"] = hiodls.Annotations + } + if hiodls.Type != "" { + objectMap["type"] = hiodls.Type + } + for k, v := range hiodls.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysLinkedService is the BasicLinkedService implementation for HDInsightOnDemandLinkedService. +func (hiodls HDInsightOnDemandLinkedService) AsResponsysLinkedService() (*ResponsysLinkedService, bool) { + return nil, false +} + +// AsAzureDatabricksLinkedService is the BasicLinkedService implementation for HDInsightOnDemandLinkedService. +func (hiodls HDInsightOnDemandLinkedService) AsAzureDatabricksLinkedService() (*AzureDatabricksLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeAnalyticsLinkedService is the BasicLinkedService implementation for HDInsightOnDemandLinkedService. +func (hiodls HDInsightOnDemandLinkedService) AsAzureDataLakeAnalyticsLinkedService() (*AzureDataLakeAnalyticsLinkedService, bool) { + return nil, false +} + +// AsHDInsightOnDemandLinkedService is the BasicLinkedService implementation for HDInsightOnDemandLinkedService. +func (hiodls HDInsightOnDemandLinkedService) AsHDInsightOnDemandLinkedService() (*HDInsightOnDemandLinkedService, bool) { + return &hiodls, true +} + +// AsSalesforceMarketingCloudLinkedService is the BasicLinkedService implementation for HDInsightOnDemandLinkedService. +func (hiodls HDInsightOnDemandLinkedService) AsSalesforceMarketingCloudLinkedService() (*SalesforceMarketingCloudLinkedService, bool) { + return nil, false +} + +// AsNetezzaLinkedService is the BasicLinkedService implementation for HDInsightOnDemandLinkedService. +func (hiodls HDInsightOnDemandLinkedService) AsNetezzaLinkedService() (*NetezzaLinkedService, bool) { + return nil, false +} + +// AsVerticaLinkedService is the BasicLinkedService implementation for HDInsightOnDemandLinkedService. +func (hiodls HDInsightOnDemandLinkedService) AsVerticaLinkedService() (*VerticaLinkedService, bool) { + return nil, false +} + +// AsZohoLinkedService is the BasicLinkedService implementation for HDInsightOnDemandLinkedService. +func (hiodls HDInsightOnDemandLinkedService) AsZohoLinkedService() (*ZohoLinkedService, bool) { + return nil, false +} + +// AsXeroLinkedService is the BasicLinkedService implementation for HDInsightOnDemandLinkedService. +func (hiodls HDInsightOnDemandLinkedService) AsXeroLinkedService() (*XeroLinkedService, bool) { + return nil, false +} + +// AsSquareLinkedService is the BasicLinkedService implementation for HDInsightOnDemandLinkedService. +func (hiodls HDInsightOnDemandLinkedService) AsSquareLinkedService() (*SquareLinkedService, bool) { + return nil, false +} + +// AsSparkLinkedService is the BasicLinkedService implementation for HDInsightOnDemandLinkedService. +func (hiodls HDInsightOnDemandLinkedService) AsSparkLinkedService() (*SparkLinkedService, bool) { + return nil, false +} + +// AsShopifyLinkedService is the BasicLinkedService implementation for HDInsightOnDemandLinkedService. +func (hiodls HDInsightOnDemandLinkedService) AsShopifyLinkedService() (*ShopifyLinkedService, bool) { + return nil, false +} + +// AsServiceNowLinkedService is the BasicLinkedService implementation for HDInsightOnDemandLinkedService. +func (hiodls HDInsightOnDemandLinkedService) AsServiceNowLinkedService() (*ServiceNowLinkedService, bool) { + return nil, false +} + +// AsQuickBooksLinkedService is the BasicLinkedService implementation for HDInsightOnDemandLinkedService. +func (hiodls HDInsightOnDemandLinkedService) AsQuickBooksLinkedService() (*QuickBooksLinkedService, bool) { + return nil, false +} + +// AsPrestoLinkedService is the BasicLinkedService implementation for HDInsightOnDemandLinkedService. +func (hiodls HDInsightOnDemandLinkedService) AsPrestoLinkedService() (*PrestoLinkedService, bool) { + return nil, false +} + +// AsPhoenixLinkedService is the BasicLinkedService implementation for HDInsightOnDemandLinkedService. +func (hiodls HDInsightOnDemandLinkedService) AsPhoenixLinkedService() (*PhoenixLinkedService, bool) { + return nil, false +} + +// AsPaypalLinkedService is the BasicLinkedService implementation for HDInsightOnDemandLinkedService. +func (hiodls HDInsightOnDemandLinkedService) AsPaypalLinkedService() (*PaypalLinkedService, bool) { + return nil, false +} + +// AsMarketoLinkedService is the BasicLinkedService implementation for HDInsightOnDemandLinkedService. +func (hiodls HDInsightOnDemandLinkedService) AsMarketoLinkedService() (*MarketoLinkedService, bool) { + return nil, false +} + +// AsMariaDBLinkedService is the BasicLinkedService implementation for HDInsightOnDemandLinkedService. +func (hiodls HDInsightOnDemandLinkedService) AsMariaDBLinkedService() (*MariaDBLinkedService, bool) { + return nil, false +} + +// AsMagentoLinkedService is the BasicLinkedService implementation for HDInsightOnDemandLinkedService. +func (hiodls HDInsightOnDemandLinkedService) AsMagentoLinkedService() (*MagentoLinkedService, bool) { + return nil, false +} + +// AsJiraLinkedService is the BasicLinkedService implementation for HDInsightOnDemandLinkedService. +func (hiodls HDInsightOnDemandLinkedService) AsJiraLinkedService() (*JiraLinkedService, bool) { + return nil, false +} + +// AsImpalaLinkedService is the BasicLinkedService implementation for HDInsightOnDemandLinkedService. +func (hiodls HDInsightOnDemandLinkedService) AsImpalaLinkedService() (*ImpalaLinkedService, bool) { + return nil, false +} + +// AsHubspotLinkedService is the BasicLinkedService implementation for HDInsightOnDemandLinkedService. +func (hiodls HDInsightOnDemandLinkedService) AsHubspotLinkedService() (*HubspotLinkedService, bool) { + return nil, false +} + +// AsHiveLinkedService is the BasicLinkedService implementation for HDInsightOnDemandLinkedService. +func (hiodls HDInsightOnDemandLinkedService) AsHiveLinkedService() (*HiveLinkedService, bool) { + return nil, false +} + +// AsHBaseLinkedService is the BasicLinkedService implementation for HDInsightOnDemandLinkedService. +func (hiodls HDInsightOnDemandLinkedService) AsHBaseLinkedService() (*HBaseLinkedService, bool) { + return nil, false +} + +// AsGreenplumLinkedService is the BasicLinkedService implementation for HDInsightOnDemandLinkedService. +func (hiodls HDInsightOnDemandLinkedService) AsGreenplumLinkedService() (*GreenplumLinkedService, bool) { + return nil, false +} + +// AsGoogleBigQueryLinkedService is the BasicLinkedService implementation for HDInsightOnDemandLinkedService. +func (hiodls HDInsightOnDemandLinkedService) AsGoogleBigQueryLinkedService() (*GoogleBigQueryLinkedService, bool) { + return nil, false +} + +// AsEloquaLinkedService is the BasicLinkedService implementation for HDInsightOnDemandLinkedService. +func (hiodls HDInsightOnDemandLinkedService) AsEloquaLinkedService() (*EloquaLinkedService, bool) { + return nil, false +} + +// AsDrillLinkedService is the BasicLinkedService implementation for HDInsightOnDemandLinkedService. +func (hiodls HDInsightOnDemandLinkedService) AsDrillLinkedService() (*DrillLinkedService, bool) { + return nil, false +} + +// AsCouchbaseLinkedService is the BasicLinkedService implementation for HDInsightOnDemandLinkedService. +func (hiodls HDInsightOnDemandLinkedService) AsCouchbaseLinkedService() (*CouchbaseLinkedService, bool) { + return nil, false +} + +// AsConcurLinkedService is the BasicLinkedService implementation for HDInsightOnDemandLinkedService. +func (hiodls HDInsightOnDemandLinkedService) AsConcurLinkedService() (*ConcurLinkedService, bool) { + return nil, false +} + +// AsAzurePostgreSQLLinkedService is the BasicLinkedService implementation for HDInsightOnDemandLinkedService. +func (hiodls HDInsightOnDemandLinkedService) AsAzurePostgreSQLLinkedService() (*AzurePostgreSQLLinkedService, bool) { + return nil, false +} + +// AsAmazonMWSLinkedService is the BasicLinkedService implementation for HDInsightOnDemandLinkedService. +func (hiodls HDInsightOnDemandLinkedService) AsAmazonMWSLinkedService() (*AmazonMWSLinkedService, bool) { + return nil, false +} + +// AsSapHanaLinkedService is the BasicLinkedService implementation for HDInsightOnDemandLinkedService. +func (hiodls HDInsightOnDemandLinkedService) AsSapHanaLinkedService() (*SapHanaLinkedService, bool) { + return nil, false +} + +// AsSapBWLinkedService is the BasicLinkedService implementation for HDInsightOnDemandLinkedService. +func (hiodls HDInsightOnDemandLinkedService) AsSapBWLinkedService() (*SapBWLinkedService, bool) { + return nil, false +} + +// AsSftpServerLinkedService is the BasicLinkedService implementation for HDInsightOnDemandLinkedService. +func (hiodls HDInsightOnDemandLinkedService) AsSftpServerLinkedService() (*SftpServerLinkedService, bool) { + return nil, false +} + +// AsFtpServerLinkedService is the BasicLinkedService implementation for HDInsightOnDemandLinkedService. +func (hiodls HDInsightOnDemandLinkedService) AsFtpServerLinkedService() (*FtpServerLinkedService, bool) { + return nil, false +} + +// AsHTTPLinkedService is the BasicLinkedService implementation for HDInsightOnDemandLinkedService. +func (hiodls HDInsightOnDemandLinkedService) AsHTTPLinkedService() (*HTTPLinkedService, bool) { + return nil, false +} + +// AsAzureSearchLinkedService is the BasicLinkedService implementation for HDInsightOnDemandLinkedService. +func (hiodls HDInsightOnDemandLinkedService) AsAzureSearchLinkedService() (*AzureSearchLinkedService, bool) { + return nil, false +} + +// AsCustomDataSourceLinkedService is the BasicLinkedService implementation for HDInsightOnDemandLinkedService. +func (hiodls HDInsightOnDemandLinkedService) AsCustomDataSourceLinkedService() (*CustomDataSourceLinkedService, bool) { + return nil, false +} + +// AsAmazonRedshiftLinkedService is the BasicLinkedService implementation for HDInsightOnDemandLinkedService. +func (hiodls HDInsightOnDemandLinkedService) AsAmazonRedshiftLinkedService() (*AmazonRedshiftLinkedService, bool) { + return nil, false +} + +// AsAmazonS3LinkedService is the BasicLinkedService implementation for HDInsightOnDemandLinkedService. +func (hiodls HDInsightOnDemandLinkedService) AsAmazonS3LinkedService() (*AmazonS3LinkedService, bool) { + return nil, false +} + +// AsSapEccLinkedService is the BasicLinkedService implementation for HDInsightOnDemandLinkedService. +func (hiodls HDInsightOnDemandLinkedService) AsSapEccLinkedService() (*SapEccLinkedService, bool) { + return nil, false +} + +// AsSapCloudForCustomerLinkedService is the BasicLinkedService implementation for HDInsightOnDemandLinkedService. +func (hiodls HDInsightOnDemandLinkedService) AsSapCloudForCustomerLinkedService() (*SapCloudForCustomerLinkedService, bool) { + return nil, false +} + +// AsSalesforceLinkedService is the BasicLinkedService implementation for HDInsightOnDemandLinkedService. +func (hiodls HDInsightOnDemandLinkedService) AsSalesforceLinkedService() (*SalesforceLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeStoreLinkedService is the BasicLinkedService implementation for HDInsightOnDemandLinkedService. +func (hiodls HDInsightOnDemandLinkedService) AsAzureDataLakeStoreLinkedService() (*AzureDataLakeStoreLinkedService, bool) { + return nil, false +} + +// AsMongoDbLinkedService is the BasicLinkedService implementation for HDInsightOnDemandLinkedService. +func (hiodls HDInsightOnDemandLinkedService) AsMongoDbLinkedService() (*MongoDbLinkedService, bool) { + return nil, false +} + +// AsCassandraLinkedService is the BasicLinkedService implementation for HDInsightOnDemandLinkedService. +func (hiodls HDInsightOnDemandLinkedService) AsCassandraLinkedService() (*CassandraLinkedService, bool) { + return nil, false +} + +// AsWebLinkedService is the BasicLinkedService implementation for HDInsightOnDemandLinkedService. +func (hiodls HDInsightOnDemandLinkedService) AsWebLinkedService() (*WebLinkedService, bool) { + return nil, false +} + +// AsODataLinkedService is the BasicLinkedService implementation for HDInsightOnDemandLinkedService. +func (hiodls HDInsightOnDemandLinkedService) AsODataLinkedService() (*ODataLinkedService, bool) { + return nil, false +} + +// AsHdfsLinkedService is the BasicLinkedService implementation for HDInsightOnDemandLinkedService. +func (hiodls HDInsightOnDemandLinkedService) AsHdfsLinkedService() (*HdfsLinkedService, bool) { + return nil, false +} + +// AsOdbcLinkedService is the BasicLinkedService implementation for HDInsightOnDemandLinkedService. +func (hiodls HDInsightOnDemandLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, bool) { + return nil, false +} + +// AsAzureMLLinkedService is the BasicLinkedService implementation for HDInsightOnDemandLinkedService. +func (hiodls HDInsightOnDemandLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { + return nil, false +} + +// AsTeradataLinkedService is the BasicLinkedService implementation for HDInsightOnDemandLinkedService. +func (hiodls HDInsightOnDemandLinkedService) AsTeradataLinkedService() (*TeradataLinkedService, bool) { + return nil, false +} + +// AsDb2LinkedService is the BasicLinkedService implementation for HDInsightOnDemandLinkedService. +func (hiodls HDInsightOnDemandLinkedService) AsDb2LinkedService() (*Db2LinkedService, bool) { + return nil, false +} + +// AsSybaseLinkedService is the BasicLinkedService implementation for HDInsightOnDemandLinkedService. +func (hiodls HDInsightOnDemandLinkedService) AsSybaseLinkedService() (*SybaseLinkedService, bool) { + return nil, false +} + +// AsPostgreSQLLinkedService is the BasicLinkedService implementation for HDInsightOnDemandLinkedService. +func (hiodls HDInsightOnDemandLinkedService) AsPostgreSQLLinkedService() (*PostgreSQLLinkedService, bool) { + return nil, false +} + +// AsMySQLLinkedService is the BasicLinkedService implementation for HDInsightOnDemandLinkedService. +func (hiodls HDInsightOnDemandLinkedService) AsMySQLLinkedService() (*MySQLLinkedService, bool) { + return nil, false +} + +// AsAzureMySQLLinkedService is the BasicLinkedService implementation for HDInsightOnDemandLinkedService. +func (hiodls HDInsightOnDemandLinkedService) AsAzureMySQLLinkedService() (*AzureMySQLLinkedService, bool) { + return nil, false +} + +// AsOracleLinkedService is the BasicLinkedService implementation for HDInsightOnDemandLinkedService. +func (hiodls HDInsightOnDemandLinkedService) AsOracleLinkedService() (*OracleLinkedService, bool) { + return nil, false +} + +// AsFileServerLinkedService is the BasicLinkedService implementation for HDInsightOnDemandLinkedService. +func (hiodls HDInsightOnDemandLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { + return nil, false +} + +// AsHDInsightLinkedService is the BasicLinkedService implementation for HDInsightOnDemandLinkedService. +func (hiodls HDInsightOnDemandLinkedService) AsHDInsightLinkedService() (*HDInsightLinkedService, bool) { + return nil, false +} + +// AsDynamicsLinkedService is the BasicLinkedService implementation for HDInsightOnDemandLinkedService. +func (hiodls HDInsightOnDemandLinkedService) AsDynamicsLinkedService() (*DynamicsLinkedService, bool) { + return nil, false +} + +// AsCosmosDbLinkedService is the BasicLinkedService implementation for HDInsightOnDemandLinkedService. +func (hiodls HDInsightOnDemandLinkedService) AsCosmosDbLinkedService() (*CosmosDbLinkedService, bool) { + return nil, false +} + +// AsAzureKeyVaultLinkedService is the BasicLinkedService implementation for HDInsightOnDemandLinkedService. +func (hiodls HDInsightOnDemandLinkedService) AsAzureKeyVaultLinkedService() (*AzureKeyVaultLinkedService, bool) { + return nil, false +} + +// AsAzureBatchLinkedService is the BasicLinkedService implementation for HDInsightOnDemandLinkedService. +func (hiodls HDInsightOnDemandLinkedService) AsAzureBatchLinkedService() (*AzureBatchLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDatabaseLinkedService is the BasicLinkedService implementation for HDInsightOnDemandLinkedService. +func (hiodls HDInsightOnDemandLinkedService) AsAzureSQLDatabaseLinkedService() (*AzureSQLDatabaseLinkedService, bool) { + return nil, false +} + +// AsSQLServerLinkedService is the BasicLinkedService implementation for HDInsightOnDemandLinkedService. +func (hiodls HDInsightOnDemandLinkedService) AsSQLServerLinkedService() (*SQLServerLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDWLinkedService is the BasicLinkedService implementation for HDInsightOnDemandLinkedService. +func (hiodls HDInsightOnDemandLinkedService) AsAzureSQLDWLinkedService() (*AzureSQLDWLinkedService, bool) { + return nil, false +} + +// AsAzureStorageLinkedService is the BasicLinkedService implementation for HDInsightOnDemandLinkedService. +func (hiodls HDInsightOnDemandLinkedService) AsAzureStorageLinkedService() (*AzureStorageLinkedService, bool) { + return nil, false +} + +// AsLinkedService is the BasicLinkedService implementation for HDInsightOnDemandLinkedService. +func (hiodls HDInsightOnDemandLinkedService) AsLinkedService() (*LinkedService, bool) { + return nil, false +} + +// AsBasicLinkedService is the BasicLinkedService implementation for HDInsightOnDemandLinkedService. +func (hiodls HDInsightOnDemandLinkedService) AsBasicLinkedService() (BasicLinkedService, bool) { + return &hiodls, true +} + +// UnmarshalJSON is the custom unmarshaler for HDInsightOnDemandLinkedService struct. +func (hiodls *HDInsightOnDemandLinkedService) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "typeProperties": + if v != nil { + var hDInsightOnDemandLinkedServiceTypeProperties HDInsightOnDemandLinkedServiceTypeProperties + err = json.Unmarshal(*v, &hDInsightOnDemandLinkedServiceTypeProperties) + if err != nil { + return err + } + hiodls.HDInsightOnDemandLinkedServiceTypeProperties = &hDInsightOnDemandLinkedServiceTypeProperties + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if hiodls.AdditionalProperties == nil { + hiodls.AdditionalProperties = make(map[string]interface{}) + } + hiodls.AdditionalProperties[k] = additionalProperties + } + case "connectVia": + if v != nil { + var connectVia IntegrationRuntimeReference + err = json.Unmarshal(*v, &connectVia) + if err != nil { + return err + } + hiodls.ConnectVia = &connectVia + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + hiodls.Description = &description + } + case "parameters": + if v != nil { + var parameters map[string]*ParameterSpecification + err = json.Unmarshal(*v, ¶meters) + if err != nil { + return err + } + hiodls.Parameters = parameters + } + case "annotations": + if v != nil { + var annotations []interface{} + err = json.Unmarshal(*v, &annotations) + if err != nil { + return err + } + hiodls.Annotations = &annotations + } + case "type": + if v != nil { + var typeVar TypeBasicLinkedService + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + hiodls.Type = typeVar + } + } + } + + return nil +} + +// HDInsightOnDemandLinkedServiceTypeProperties hDInsight ondemand linked service properties. +type HDInsightOnDemandLinkedServiceTypeProperties struct { + // ClusterSize - Number of worker/data nodes in the cluster. Suggestion value: 4. Type: string (or Expression with resultType string). + ClusterSize interface{} `json:"clusterSize,omitempty"` + // TimeToLive - The allowed idle time for the on-demand HDInsight cluster. Specifies how long the on-demand HDInsight cluster stays alive after completion of an activity run if there are no other active jobs in the cluster. The minimum value is 5 mins. Type: string (or Expression with resultType string). + TimeToLive interface{} `json:"timeToLive,omitempty"` + // Version - Version of the HDInsight cluster.  Type: string (or Expression with resultType string). + Version interface{} `json:"version,omitempty"` + // LinkedServiceName - Azure Storage linked service to be used by the on-demand cluster for storing and processing data. + LinkedServiceName *LinkedServiceReference `json:"linkedServiceName,omitempty"` + // HostSubscriptionID - The customer’s subscription to host the cluster. Type: string (or Expression with resultType string). + HostSubscriptionID interface{} `json:"hostSubscriptionId,omitempty"` + // ServicePrincipalID - The service principal id for the hostSubscriptionId. Type: string (or Expression with resultType string). + ServicePrincipalID interface{} `json:"servicePrincipalId,omitempty"` + // ServicePrincipalKey - The key for the service principal id. + ServicePrincipalKey BasicSecretBase `json:"servicePrincipalKey,omitempty"` + // Tenant - The Tenant id/name to which the service principal belongs. Type: string (or Expression with resultType string). + Tenant interface{} `json:"tenant,omitempty"` + // ClusterResourceGroup - The resource group where the cluster belongs. Type: string (or Expression with resultType string). + ClusterResourceGroup interface{} `json:"clusterResourceGroup,omitempty"` + // ClusterNamePrefix - The prefix of cluster name, postfix will be distinct with timestamp. Type: string (or Expression with resultType string). + ClusterNamePrefix interface{} `json:"clusterNamePrefix,omitempty"` + // ClusterUserName - The username to access the cluster. Type: string (or Expression with resultType string). + ClusterUserName interface{} `json:"clusterUserName,omitempty"` + // ClusterPassword - The password to access the cluster. + ClusterPassword BasicSecretBase `json:"clusterPassword,omitempty"` + // ClusterSSHUserName - The username to SSH remotely connect to cluster’s node (for Linux). Type: string (or Expression with resultType string). + ClusterSSHUserName interface{} `json:"clusterSshUserName,omitempty"` + // ClusterSSHPassword - The password to SSH remotely connect cluster’s node (for Linux). + ClusterSSHPassword BasicSecretBase `json:"clusterSshPassword,omitempty"` + // AdditionalLinkedServiceNames - Specifies additional storage accounts for the HDInsight linked service so that the Data Factory service can register them on your behalf. + AdditionalLinkedServiceNames *[]LinkedServiceReference `json:"additionalLinkedServiceNames,omitempty"` + // HcatalogLinkedServiceName - The name of Azure SQL linked service that point to the HCatalog database. The on-demand HDInsight cluster is created by using the Azure SQL database as the metastore. + HcatalogLinkedServiceName *LinkedServiceReference `json:"hcatalogLinkedServiceName,omitempty"` + // ClusterType - The cluster type. Type: string (or Expression with resultType string). + ClusterType interface{} `json:"clusterType,omitempty"` + // SparkVersion - The version of spark if the cluster type is 'spark'. Type: string (or Expression with resultType string). + SparkVersion interface{} `json:"sparkVersion,omitempty"` + // CoreConfiguration - Specifies the core configuration parameters (as in core-site.xml) for the HDInsight cluster to be created. + CoreConfiguration interface{} `json:"coreConfiguration,omitempty"` + // HBaseConfiguration - Specifies the HBase configuration parameters (hbase-site.xml) for the HDInsight cluster. + HBaseConfiguration interface{} `json:"hBaseConfiguration,omitempty"` + // HdfsConfiguration - Specifies the HDFS configuration parameters (hdfs-site.xml) for the HDInsight cluster. + HdfsConfiguration interface{} `json:"hdfsConfiguration,omitempty"` + // HiveConfiguration - Specifies the hive configuration parameters (hive-site.xml) for the HDInsight cluster. + HiveConfiguration interface{} `json:"hiveConfiguration,omitempty"` + // MapReduceConfiguration - Specifies the MapReduce configuration parameters (mapred-site.xml) for the HDInsight cluster. + MapReduceConfiguration interface{} `json:"mapReduceConfiguration,omitempty"` + // OozieConfiguration - Specifies the Oozie configuration parameters (oozie-site.xml) for the HDInsight cluster. + OozieConfiguration interface{} `json:"oozieConfiguration,omitempty"` + // StormConfiguration - Specifies the Storm configuration parameters (storm-site.xml) for the HDInsight cluster. + StormConfiguration interface{} `json:"stormConfiguration,omitempty"` + // YarnConfiguration - Specifies the Yarn configuration parameters (yarn-site.xml) for the HDInsight cluster. + YarnConfiguration interface{} `json:"yarnConfiguration,omitempty"` + // EncryptedCredential - The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string). + EncryptedCredential interface{} `json:"encryptedCredential,omitempty"` + // HeadNodeSize - Specifies the size of the head node for the HDInsight cluster. + HeadNodeSize interface{} `json:"headNodeSize,omitempty"` + // DataNodeSize - Specifies the size of the data node for the HDInsight cluster. + DataNodeSize interface{} `json:"dataNodeSize,omitempty"` + // ZookeeperNodeSize - Specifies the size of the Zoo Keeper node for the HDInsight cluster. + ZookeeperNodeSize interface{} `json:"zookeeperNodeSize,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for HDInsightOnDemandLinkedServiceTypeProperties struct. +func (hiodlstp *HDInsightOnDemandLinkedServiceTypeProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "clusterSize": + if v != nil { + var clusterSize interface{} + err = json.Unmarshal(*v, &clusterSize) + if err != nil { + return err + } + hiodlstp.ClusterSize = clusterSize + } + case "timeToLive": + if v != nil { + var timeToLive interface{} + err = json.Unmarshal(*v, &timeToLive) + if err != nil { + return err + } + hiodlstp.TimeToLive = timeToLive + } + case "version": + if v != nil { + var version interface{} + err = json.Unmarshal(*v, &version) + if err != nil { + return err + } + hiodlstp.Version = version + } + case "linkedServiceName": + if v != nil { + var linkedServiceName LinkedServiceReference + err = json.Unmarshal(*v, &linkedServiceName) + if err != nil { + return err + } + hiodlstp.LinkedServiceName = &linkedServiceName + } + case "hostSubscriptionId": + if v != nil { + var hostSubscriptionID interface{} + err = json.Unmarshal(*v, &hostSubscriptionID) + if err != nil { + return err + } + hiodlstp.HostSubscriptionID = hostSubscriptionID + } + case "servicePrincipalId": + if v != nil { + var servicePrincipalID interface{} + err = json.Unmarshal(*v, &servicePrincipalID) + if err != nil { + return err + } + hiodlstp.ServicePrincipalID = servicePrincipalID + } + case "servicePrincipalKey": + if v != nil { + servicePrincipalKey, err := unmarshalBasicSecretBase(*v) + if err != nil { + return err + } + hiodlstp.ServicePrincipalKey = servicePrincipalKey + } + case "tenant": + if v != nil { + var tenant interface{} + err = json.Unmarshal(*v, &tenant) + if err != nil { + return err + } + hiodlstp.Tenant = tenant + } + case "clusterResourceGroup": + if v != nil { + var clusterResourceGroup interface{} + err = json.Unmarshal(*v, &clusterResourceGroup) + if err != nil { + return err + } + hiodlstp.ClusterResourceGroup = clusterResourceGroup + } + case "clusterNamePrefix": + if v != nil { + var clusterNamePrefix interface{} + err = json.Unmarshal(*v, &clusterNamePrefix) + if err != nil { + return err + } + hiodlstp.ClusterNamePrefix = clusterNamePrefix + } + case "clusterUserName": + if v != nil { + var clusterUserName interface{} + err = json.Unmarshal(*v, &clusterUserName) + if err != nil { + return err + } + hiodlstp.ClusterUserName = clusterUserName + } + case "clusterPassword": + if v != nil { + clusterPassword, err := unmarshalBasicSecretBase(*v) + if err != nil { + return err + } + hiodlstp.ClusterPassword = clusterPassword + } + case "clusterSshUserName": + if v != nil { + var clusterSSHUserName interface{} + err = json.Unmarshal(*v, &clusterSSHUserName) + if err != nil { + return err + } + hiodlstp.ClusterSSHUserName = clusterSSHUserName + } + case "clusterSshPassword": + if v != nil { + clusterSSHPassword, err := unmarshalBasicSecretBase(*v) + if err != nil { + return err + } + hiodlstp.ClusterSSHPassword = clusterSSHPassword + } + case "additionalLinkedServiceNames": + if v != nil { + var additionalLinkedServiceNames []LinkedServiceReference + err = json.Unmarshal(*v, &additionalLinkedServiceNames) + if err != nil { + return err + } + hiodlstp.AdditionalLinkedServiceNames = &additionalLinkedServiceNames + } + case "hcatalogLinkedServiceName": + if v != nil { + var hcatalogLinkedServiceName LinkedServiceReference + err = json.Unmarshal(*v, &hcatalogLinkedServiceName) + if err != nil { + return err + } + hiodlstp.HcatalogLinkedServiceName = &hcatalogLinkedServiceName + } + case "clusterType": + if v != nil { + var clusterType interface{} + err = json.Unmarshal(*v, &clusterType) + if err != nil { + return err + } + hiodlstp.ClusterType = clusterType + } + case "sparkVersion": + if v != nil { + var sparkVersion interface{} + err = json.Unmarshal(*v, &sparkVersion) + if err != nil { + return err + } + hiodlstp.SparkVersion = sparkVersion + } + case "coreConfiguration": + if v != nil { + var coreConfiguration interface{} + err = json.Unmarshal(*v, &coreConfiguration) + if err != nil { + return err + } + hiodlstp.CoreConfiguration = coreConfiguration + } + case "hBaseConfiguration": + if v != nil { + var hBaseConfiguration interface{} + err = json.Unmarshal(*v, &hBaseConfiguration) + if err != nil { + return err + } + hiodlstp.HBaseConfiguration = hBaseConfiguration + } + case "hdfsConfiguration": + if v != nil { + var hdfsConfiguration interface{} + err = json.Unmarshal(*v, &hdfsConfiguration) + if err != nil { + return err + } + hiodlstp.HdfsConfiguration = hdfsConfiguration + } + case "hiveConfiguration": + if v != nil { + var hiveConfiguration interface{} + err = json.Unmarshal(*v, &hiveConfiguration) + if err != nil { + return err + } + hiodlstp.HiveConfiguration = hiveConfiguration + } + case "mapReduceConfiguration": + if v != nil { + var mapReduceConfiguration interface{} + err = json.Unmarshal(*v, &mapReduceConfiguration) + if err != nil { + return err + } + hiodlstp.MapReduceConfiguration = mapReduceConfiguration + } + case "oozieConfiguration": + if v != nil { + var oozieConfiguration interface{} + err = json.Unmarshal(*v, &oozieConfiguration) + if err != nil { + return err + } + hiodlstp.OozieConfiguration = oozieConfiguration + } + case "stormConfiguration": + if v != nil { + var stormConfiguration interface{} + err = json.Unmarshal(*v, &stormConfiguration) + if err != nil { + return err + } + hiodlstp.StormConfiguration = stormConfiguration + } + case "yarnConfiguration": + if v != nil { + var yarnConfiguration interface{} + err = json.Unmarshal(*v, &yarnConfiguration) + if err != nil { + return err + } + hiodlstp.YarnConfiguration = yarnConfiguration + } + case "encryptedCredential": + if v != nil { + var encryptedCredential interface{} + err = json.Unmarshal(*v, &encryptedCredential) + if err != nil { + return err + } + hiodlstp.EncryptedCredential = encryptedCredential + } + case "headNodeSize": + if v != nil { + var headNodeSize interface{} + err = json.Unmarshal(*v, &headNodeSize) + if err != nil { + return err + } + hiodlstp.HeadNodeSize = headNodeSize + } + case "dataNodeSize": + if v != nil { + var dataNodeSize interface{} + err = json.Unmarshal(*v, &dataNodeSize) + if err != nil { + return err + } + hiodlstp.DataNodeSize = dataNodeSize + } + case "zookeeperNodeSize": + if v != nil { + var zookeeperNodeSize interface{} + err = json.Unmarshal(*v, &zookeeperNodeSize) + if err != nil { + return err + } + hiodlstp.ZookeeperNodeSize = zookeeperNodeSize + } + } + } + + return nil +} + +// HDInsightPigActivity hDInsight Pig activity type. +type HDInsightPigActivity struct { + // HDInsightPigActivityTypeProperties - HDInsight Pig activity properties. + *HDInsightPigActivityTypeProperties `json:"typeProperties,omitempty"` + // LinkedServiceName - Linked service reference. + LinkedServiceName *LinkedServiceReference `json:"linkedServiceName,omitempty"` + // Policy - Activity policy. + Policy *ActivityPolicy `json:"policy,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Name - Activity name. + Name *string `json:"name,omitempty"` + // Description - Activity description. + Description *string `json:"description,omitempty"` + // DependsOn - Activity depends on condition. + DependsOn *[]ActivityDependency `json:"dependsOn,omitempty"` + // UserProperties - Activity user properties. + UserProperties map[string]*string `json:"userProperties"` + // Type - Possible values include: 'TypeActivity', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLUpdateResource', 'TypeAzureMLBatchExecution', 'TypeGetMetadata', 'TypeWebActivity', 'TypeLookup', 'TypeSQLServerStoredProcedure', 'TypeCustom', 'TypeExecuteSSISPackage', 'TypeHDInsightSpark', 'TypeHDInsightStreaming', 'TypeHDInsightMapReduce', 'TypeHDInsightPig', 'TypeHDInsightHive', 'TypeCopy', 'TypeExecution', 'TypeFilter', 'TypeUntil', 'TypeWait', 'TypeForEach', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' + Type TypeBasicActivity `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for HDInsightPigActivity. +func (hipa HDInsightPigActivity) MarshalJSON() ([]byte, error) { + hipa.Type = TypeHDInsightPig + objectMap := make(map[string]interface{}) + if hipa.HDInsightPigActivityTypeProperties != nil { + objectMap["typeProperties"] = hipa.HDInsightPigActivityTypeProperties + } + if hipa.LinkedServiceName != nil { + objectMap["linkedServiceName"] = hipa.LinkedServiceName + } + if hipa.Policy != nil { + objectMap["policy"] = hipa.Policy + } + if hipa.Name != nil { + objectMap["name"] = hipa.Name + } + if hipa.Description != nil { + objectMap["description"] = hipa.Description + } + if hipa.DependsOn != nil { + objectMap["dependsOn"] = hipa.DependsOn + } + if hipa.UserProperties != nil { + objectMap["userProperties"] = hipa.UserProperties + } + if hipa.Type != "" { + objectMap["type"] = hipa.Type + } + for k, v := range hipa.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsDatabricksNotebookActivity is the BasicActivity implementation for HDInsightPigActivity. +func (hipa HDInsightPigActivity) AsDatabricksNotebookActivity() (*DatabricksNotebookActivity, bool) { + return nil, false +} + +// AsDataLakeAnalyticsUSQLActivity is the BasicActivity implementation for HDInsightPigActivity. +func (hipa HDInsightPigActivity) AsDataLakeAnalyticsUSQLActivity() (*DataLakeAnalyticsUSQLActivity, bool) { + return nil, false +} + +// AsAzureMLUpdateResourceActivity is the BasicActivity implementation for HDInsightPigActivity. +func (hipa HDInsightPigActivity) AsAzureMLUpdateResourceActivity() (*AzureMLUpdateResourceActivity, bool) { + return nil, false +} + +// AsAzureMLBatchExecutionActivity is the BasicActivity implementation for HDInsightPigActivity. +func (hipa HDInsightPigActivity) AsAzureMLBatchExecutionActivity() (*AzureMLBatchExecutionActivity, bool) { + return nil, false +} + +// AsGetMetadataActivity is the BasicActivity implementation for HDInsightPigActivity. +func (hipa HDInsightPigActivity) AsGetMetadataActivity() (*GetMetadataActivity, bool) { + return nil, false +} + +// AsWebActivity is the BasicActivity implementation for HDInsightPigActivity. +func (hipa HDInsightPigActivity) AsWebActivity() (*WebActivity, bool) { + return nil, false +} + +// AsLookupActivity is the BasicActivity implementation for HDInsightPigActivity. +func (hipa HDInsightPigActivity) AsLookupActivity() (*LookupActivity, bool) { + return nil, false +} + +// AsSQLServerStoredProcedureActivity is the BasicActivity implementation for HDInsightPigActivity. +func (hipa HDInsightPigActivity) AsSQLServerStoredProcedureActivity() (*SQLServerStoredProcedureActivity, bool) { + return nil, false +} + +// AsCustomActivity is the BasicActivity implementation for HDInsightPigActivity. +func (hipa HDInsightPigActivity) AsCustomActivity() (*CustomActivity, bool) { + return nil, false +} + +// AsExecuteSSISPackageActivity is the BasicActivity implementation for HDInsightPigActivity. +func (hipa HDInsightPigActivity) AsExecuteSSISPackageActivity() (*ExecuteSSISPackageActivity, bool) { + return nil, false +} + +// AsHDInsightSparkActivity is the BasicActivity implementation for HDInsightPigActivity. +func (hipa HDInsightPigActivity) AsHDInsightSparkActivity() (*HDInsightSparkActivity, bool) { + return nil, false +} + +// AsHDInsightStreamingActivity is the BasicActivity implementation for HDInsightPigActivity. +func (hipa HDInsightPigActivity) AsHDInsightStreamingActivity() (*HDInsightStreamingActivity, bool) { + return nil, false +} + +// AsHDInsightMapReduceActivity is the BasicActivity implementation for HDInsightPigActivity. +func (hipa HDInsightPigActivity) AsHDInsightMapReduceActivity() (*HDInsightMapReduceActivity, bool) { + return nil, false +} + +// AsHDInsightPigActivity is the BasicActivity implementation for HDInsightPigActivity. +func (hipa HDInsightPigActivity) AsHDInsightPigActivity() (*HDInsightPigActivity, bool) { + return &hipa, true +} + +// AsHDInsightHiveActivity is the BasicActivity implementation for HDInsightPigActivity. +func (hipa HDInsightPigActivity) AsHDInsightHiveActivity() (*HDInsightHiveActivity, bool) { + return nil, false +} + +// AsCopyActivity is the BasicActivity implementation for HDInsightPigActivity. +func (hipa HDInsightPigActivity) AsCopyActivity() (*CopyActivity, bool) { + return nil, false +} + +// AsExecutionActivity is the BasicActivity implementation for HDInsightPigActivity. +func (hipa HDInsightPigActivity) AsExecutionActivity() (*ExecutionActivity, bool) { + return nil, false +} + +// AsBasicExecutionActivity is the BasicActivity implementation for HDInsightPigActivity. +func (hipa HDInsightPigActivity) AsBasicExecutionActivity() (BasicExecutionActivity, bool) { + return &hipa, true +} + +// AsFilterActivity is the BasicActivity implementation for HDInsightPigActivity. +func (hipa HDInsightPigActivity) AsFilterActivity() (*FilterActivity, bool) { + return nil, false +} + +// AsUntilActivity is the BasicActivity implementation for HDInsightPigActivity. +func (hipa HDInsightPigActivity) AsUntilActivity() (*UntilActivity, bool) { + return nil, false +} + +// AsWaitActivity is the BasicActivity implementation for HDInsightPigActivity. +func (hipa HDInsightPigActivity) AsWaitActivity() (*WaitActivity, bool) { + return nil, false +} + +// AsForEachActivity is the BasicActivity implementation for HDInsightPigActivity. +func (hipa HDInsightPigActivity) AsForEachActivity() (*ForEachActivity, bool) { + return nil, false +} + +// AsIfConditionActivity is the BasicActivity implementation for HDInsightPigActivity. +func (hipa HDInsightPigActivity) AsIfConditionActivity() (*IfConditionActivity, bool) { + return nil, false +} + +// AsExecutePipelineActivity is the BasicActivity implementation for HDInsightPigActivity. +func (hipa HDInsightPigActivity) AsExecutePipelineActivity() (*ExecutePipelineActivity, bool) { + return nil, false +} + +// AsControlActivity is the BasicActivity implementation for HDInsightPigActivity. +func (hipa HDInsightPigActivity) AsControlActivity() (*ControlActivity, bool) { + return nil, false +} + +// AsBasicControlActivity is the BasicActivity implementation for HDInsightPigActivity. +func (hipa HDInsightPigActivity) AsBasicControlActivity() (BasicControlActivity, bool) { + return nil, false +} + +// AsActivity is the BasicActivity implementation for HDInsightPigActivity. +func (hipa HDInsightPigActivity) AsActivity() (*Activity, bool) { + return nil, false +} + +// AsBasicActivity is the BasicActivity implementation for HDInsightPigActivity. +func (hipa HDInsightPigActivity) AsBasicActivity() (BasicActivity, bool) { + return &hipa, true +} + +// UnmarshalJSON is the custom unmarshaler for HDInsightPigActivity struct. +func (hipa *HDInsightPigActivity) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "typeProperties": + if v != nil { + var hDInsightPigActivityTypeProperties HDInsightPigActivityTypeProperties + err = json.Unmarshal(*v, &hDInsightPigActivityTypeProperties) + if err != nil { + return err + } + hipa.HDInsightPigActivityTypeProperties = &hDInsightPigActivityTypeProperties + } + case "linkedServiceName": + if v != nil { + var linkedServiceName LinkedServiceReference + err = json.Unmarshal(*v, &linkedServiceName) + if err != nil { + return err + } + hipa.LinkedServiceName = &linkedServiceName + } + case "policy": + if v != nil { + var policy ActivityPolicy + err = json.Unmarshal(*v, &policy) + if err != nil { + return err + } + hipa.Policy = &policy + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if hipa.AdditionalProperties == nil { + hipa.AdditionalProperties = make(map[string]interface{}) + } + hipa.AdditionalProperties[k] = additionalProperties + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + hipa.Name = &name + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + hipa.Description = &description + } + case "dependsOn": + if v != nil { + var dependsOn []ActivityDependency + err = json.Unmarshal(*v, &dependsOn) + if err != nil { + return err + } + hipa.DependsOn = &dependsOn + } + case "userProperties": + if v != nil { + var userProperties map[string]*string + err = json.Unmarshal(*v, &userProperties) + if err != nil { + return err + } + hipa.UserProperties = userProperties + } + case "type": + if v != nil { + var typeVar TypeBasicActivity + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + hipa.Type = typeVar + } + } + } + + return nil +} + +// HDInsightPigActivityTypeProperties hDInsight Pig activity properties. +type HDInsightPigActivityTypeProperties struct { + // StorageLinkedServices - Storage linked service references. + StorageLinkedServices *[]LinkedServiceReference `json:"storageLinkedServices,omitempty"` + // Arguments - User specified arguments to HDInsightActivity. + Arguments *[]interface{} `json:"arguments,omitempty"` + // GetDebugInfo - Debug info option. Possible values include: 'None', 'Always', 'Failure' + GetDebugInfo HDInsightActivityDebugInfoOption `json:"getDebugInfo,omitempty"` + // ScriptPath - Script path. Type: string (or Expression with resultType string). + ScriptPath interface{} `json:"scriptPath,omitempty"` + // ScriptLinkedService - Script linked service reference. + ScriptLinkedService *LinkedServiceReference `json:"scriptLinkedService,omitempty"` + // Defines - Allows user to specify defines for Pig job request. + Defines map[string]interface{} `json:"defines"` +} + +// MarshalJSON is the custom marshaler for HDInsightPigActivityTypeProperties. +func (hipatp HDInsightPigActivityTypeProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if hipatp.StorageLinkedServices != nil { + objectMap["storageLinkedServices"] = hipatp.StorageLinkedServices + } + if hipatp.Arguments != nil { + objectMap["arguments"] = hipatp.Arguments + } + if hipatp.GetDebugInfo != "" { + objectMap["getDebugInfo"] = hipatp.GetDebugInfo + } + objectMap["scriptPath"] = hipatp.ScriptPath + if hipatp.ScriptLinkedService != nil { + objectMap["scriptLinkedService"] = hipatp.ScriptLinkedService + } + if hipatp.Defines != nil { + objectMap["defines"] = hipatp.Defines + } + return json.Marshal(objectMap) +} + +// HDInsightSparkActivity hDInsight Spark activity. +type HDInsightSparkActivity struct { + // HDInsightSparkActivityTypeProperties - HDInsight spark activity properties. + *HDInsightSparkActivityTypeProperties `json:"typeProperties,omitempty"` + // LinkedServiceName - Linked service reference. + LinkedServiceName *LinkedServiceReference `json:"linkedServiceName,omitempty"` + // Policy - Activity policy. + Policy *ActivityPolicy `json:"policy,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Name - Activity name. + Name *string `json:"name,omitempty"` + // Description - Activity description. + Description *string `json:"description,omitempty"` + // DependsOn - Activity depends on condition. + DependsOn *[]ActivityDependency `json:"dependsOn,omitempty"` + // UserProperties - Activity user properties. + UserProperties map[string]*string `json:"userProperties"` + // Type - Possible values include: 'TypeActivity', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLUpdateResource', 'TypeAzureMLBatchExecution', 'TypeGetMetadata', 'TypeWebActivity', 'TypeLookup', 'TypeSQLServerStoredProcedure', 'TypeCustom', 'TypeExecuteSSISPackage', 'TypeHDInsightSpark', 'TypeHDInsightStreaming', 'TypeHDInsightMapReduce', 'TypeHDInsightPig', 'TypeHDInsightHive', 'TypeCopy', 'TypeExecution', 'TypeFilter', 'TypeUntil', 'TypeWait', 'TypeForEach', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' + Type TypeBasicActivity `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for HDInsightSparkActivity. +func (hisa HDInsightSparkActivity) MarshalJSON() ([]byte, error) { + hisa.Type = TypeHDInsightSpark + objectMap := make(map[string]interface{}) + if hisa.HDInsightSparkActivityTypeProperties != nil { + objectMap["typeProperties"] = hisa.HDInsightSparkActivityTypeProperties + } + if hisa.LinkedServiceName != nil { + objectMap["linkedServiceName"] = hisa.LinkedServiceName + } + if hisa.Policy != nil { + objectMap["policy"] = hisa.Policy + } + if hisa.Name != nil { + objectMap["name"] = hisa.Name + } + if hisa.Description != nil { + objectMap["description"] = hisa.Description + } + if hisa.DependsOn != nil { + objectMap["dependsOn"] = hisa.DependsOn + } + if hisa.UserProperties != nil { + objectMap["userProperties"] = hisa.UserProperties + } + if hisa.Type != "" { + objectMap["type"] = hisa.Type + } + for k, v := range hisa.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsDatabricksNotebookActivity is the BasicActivity implementation for HDInsightSparkActivity. +func (hisa HDInsightSparkActivity) AsDatabricksNotebookActivity() (*DatabricksNotebookActivity, bool) { + return nil, false +} + +// AsDataLakeAnalyticsUSQLActivity is the BasicActivity implementation for HDInsightSparkActivity. +func (hisa HDInsightSparkActivity) AsDataLakeAnalyticsUSQLActivity() (*DataLakeAnalyticsUSQLActivity, bool) { + return nil, false +} + +// AsAzureMLUpdateResourceActivity is the BasicActivity implementation for HDInsightSparkActivity. +func (hisa HDInsightSparkActivity) AsAzureMLUpdateResourceActivity() (*AzureMLUpdateResourceActivity, bool) { + return nil, false +} + +// AsAzureMLBatchExecutionActivity is the BasicActivity implementation for HDInsightSparkActivity. +func (hisa HDInsightSparkActivity) AsAzureMLBatchExecutionActivity() (*AzureMLBatchExecutionActivity, bool) { + return nil, false +} + +// AsGetMetadataActivity is the BasicActivity implementation for HDInsightSparkActivity. +func (hisa HDInsightSparkActivity) AsGetMetadataActivity() (*GetMetadataActivity, bool) { + return nil, false +} + +// AsWebActivity is the BasicActivity implementation for HDInsightSparkActivity. +func (hisa HDInsightSparkActivity) AsWebActivity() (*WebActivity, bool) { + return nil, false +} + +// AsLookupActivity is the BasicActivity implementation for HDInsightSparkActivity. +func (hisa HDInsightSparkActivity) AsLookupActivity() (*LookupActivity, bool) { + return nil, false +} + +// AsSQLServerStoredProcedureActivity is the BasicActivity implementation for HDInsightSparkActivity. +func (hisa HDInsightSparkActivity) AsSQLServerStoredProcedureActivity() (*SQLServerStoredProcedureActivity, bool) { + return nil, false +} + +// AsCustomActivity is the BasicActivity implementation for HDInsightSparkActivity. +func (hisa HDInsightSparkActivity) AsCustomActivity() (*CustomActivity, bool) { + return nil, false +} + +// AsExecuteSSISPackageActivity is the BasicActivity implementation for HDInsightSparkActivity. +func (hisa HDInsightSparkActivity) AsExecuteSSISPackageActivity() (*ExecuteSSISPackageActivity, bool) { + return nil, false +} + +// AsHDInsightSparkActivity is the BasicActivity implementation for HDInsightSparkActivity. +func (hisa HDInsightSparkActivity) AsHDInsightSparkActivity() (*HDInsightSparkActivity, bool) { + return &hisa, true +} + +// AsHDInsightStreamingActivity is the BasicActivity implementation for HDInsightSparkActivity. +func (hisa HDInsightSparkActivity) AsHDInsightStreamingActivity() (*HDInsightStreamingActivity, bool) { + return nil, false +} + +// AsHDInsightMapReduceActivity is the BasicActivity implementation for HDInsightSparkActivity. +func (hisa HDInsightSparkActivity) AsHDInsightMapReduceActivity() (*HDInsightMapReduceActivity, bool) { + return nil, false +} + +// AsHDInsightPigActivity is the BasicActivity implementation for HDInsightSparkActivity. +func (hisa HDInsightSparkActivity) AsHDInsightPigActivity() (*HDInsightPigActivity, bool) { + return nil, false +} + +// AsHDInsightHiveActivity is the BasicActivity implementation for HDInsightSparkActivity. +func (hisa HDInsightSparkActivity) AsHDInsightHiveActivity() (*HDInsightHiveActivity, bool) { + return nil, false +} + +// AsCopyActivity is the BasicActivity implementation for HDInsightSparkActivity. +func (hisa HDInsightSparkActivity) AsCopyActivity() (*CopyActivity, bool) { + return nil, false +} + +// AsExecutionActivity is the BasicActivity implementation for HDInsightSparkActivity. +func (hisa HDInsightSparkActivity) AsExecutionActivity() (*ExecutionActivity, bool) { + return nil, false +} + +// AsBasicExecutionActivity is the BasicActivity implementation for HDInsightSparkActivity. +func (hisa HDInsightSparkActivity) AsBasicExecutionActivity() (BasicExecutionActivity, bool) { + return &hisa, true +} + +// AsFilterActivity is the BasicActivity implementation for HDInsightSparkActivity. +func (hisa HDInsightSparkActivity) AsFilterActivity() (*FilterActivity, bool) { + return nil, false +} + +// AsUntilActivity is the BasicActivity implementation for HDInsightSparkActivity. +func (hisa HDInsightSparkActivity) AsUntilActivity() (*UntilActivity, bool) { + return nil, false +} + +// AsWaitActivity is the BasicActivity implementation for HDInsightSparkActivity. +func (hisa HDInsightSparkActivity) AsWaitActivity() (*WaitActivity, bool) { + return nil, false +} + +// AsForEachActivity is the BasicActivity implementation for HDInsightSparkActivity. +func (hisa HDInsightSparkActivity) AsForEachActivity() (*ForEachActivity, bool) { + return nil, false +} + +// AsIfConditionActivity is the BasicActivity implementation for HDInsightSparkActivity. +func (hisa HDInsightSparkActivity) AsIfConditionActivity() (*IfConditionActivity, bool) { + return nil, false +} + +// AsExecutePipelineActivity is the BasicActivity implementation for HDInsightSparkActivity. +func (hisa HDInsightSparkActivity) AsExecutePipelineActivity() (*ExecutePipelineActivity, bool) { + return nil, false +} + +// AsControlActivity is the BasicActivity implementation for HDInsightSparkActivity. +func (hisa HDInsightSparkActivity) AsControlActivity() (*ControlActivity, bool) { + return nil, false +} + +// AsBasicControlActivity is the BasicActivity implementation for HDInsightSparkActivity. +func (hisa HDInsightSparkActivity) AsBasicControlActivity() (BasicControlActivity, bool) { + return nil, false +} + +// AsActivity is the BasicActivity implementation for HDInsightSparkActivity. +func (hisa HDInsightSparkActivity) AsActivity() (*Activity, bool) { + return nil, false +} + +// AsBasicActivity is the BasicActivity implementation for HDInsightSparkActivity. +func (hisa HDInsightSparkActivity) AsBasicActivity() (BasicActivity, bool) { + return &hisa, true +} + +// UnmarshalJSON is the custom unmarshaler for HDInsightSparkActivity struct. +func (hisa *HDInsightSparkActivity) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "typeProperties": + if v != nil { + var hDInsightSparkActivityTypeProperties HDInsightSparkActivityTypeProperties + err = json.Unmarshal(*v, &hDInsightSparkActivityTypeProperties) + if err != nil { + return err + } + hisa.HDInsightSparkActivityTypeProperties = &hDInsightSparkActivityTypeProperties + } + case "linkedServiceName": + if v != nil { + var linkedServiceName LinkedServiceReference + err = json.Unmarshal(*v, &linkedServiceName) + if err != nil { + return err + } + hisa.LinkedServiceName = &linkedServiceName + } + case "policy": + if v != nil { + var policy ActivityPolicy + err = json.Unmarshal(*v, &policy) + if err != nil { + return err + } + hisa.Policy = &policy + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if hisa.AdditionalProperties == nil { + hisa.AdditionalProperties = make(map[string]interface{}) + } + hisa.AdditionalProperties[k] = additionalProperties + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + hisa.Name = &name + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + hisa.Description = &description + } + case "dependsOn": + if v != nil { + var dependsOn []ActivityDependency + err = json.Unmarshal(*v, &dependsOn) + if err != nil { + return err + } + hisa.DependsOn = &dependsOn + } + case "userProperties": + if v != nil { + var userProperties map[string]*string + err = json.Unmarshal(*v, &userProperties) + if err != nil { + return err + } + hisa.UserProperties = userProperties + } + case "type": + if v != nil { + var typeVar TypeBasicActivity + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + hisa.Type = typeVar + } + } + } + + return nil +} + +// HDInsightSparkActivityTypeProperties hDInsight spark activity properties. +type HDInsightSparkActivityTypeProperties struct { + // RootPath - The root path in 'sparkJobLinkedService' for all the job’s files. Type: string (or Expression with resultType string). + RootPath interface{} `json:"rootPath,omitempty"` + // EntryFilePath - The relative path to the root folder of the code/package to be executed. Type: string (or Expression with resultType string). + EntryFilePath interface{} `json:"entryFilePath,omitempty"` + // Arguments - The user-specified arguments to HDInsightSparkActivity. + Arguments *[]interface{} `json:"arguments,omitempty"` + // GetDebugInfo - Debug info option. Possible values include: 'None', 'Always', 'Failure' + GetDebugInfo HDInsightActivityDebugInfoOption `json:"getDebugInfo,omitempty"` + // SparkJobLinkedService - The storage linked service for uploading the entry file and dependencies, and for receiving logs. + SparkJobLinkedService *LinkedServiceReference `json:"sparkJobLinkedService,omitempty"` + // ClassName - The application's Java/Spark main class. + ClassName *string `json:"className,omitempty"` + // ProxyUser - The user to impersonate that will execute the job. Type: string (or Expression with resultType string). + ProxyUser interface{} `json:"proxyUser,omitempty"` + // SparkConfig - Spark configuration property. + SparkConfig map[string]interface{} `json:"sparkConfig"` +} + +// MarshalJSON is the custom marshaler for HDInsightSparkActivityTypeProperties. +func (hisatp HDInsightSparkActivityTypeProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["rootPath"] = hisatp.RootPath + objectMap["entryFilePath"] = hisatp.EntryFilePath + if hisatp.Arguments != nil { + objectMap["arguments"] = hisatp.Arguments + } + if hisatp.GetDebugInfo != "" { + objectMap["getDebugInfo"] = hisatp.GetDebugInfo + } + if hisatp.SparkJobLinkedService != nil { + objectMap["sparkJobLinkedService"] = hisatp.SparkJobLinkedService + } + if hisatp.ClassName != nil { + objectMap["className"] = hisatp.ClassName + } + objectMap["proxyUser"] = hisatp.ProxyUser + if hisatp.SparkConfig != nil { + objectMap["sparkConfig"] = hisatp.SparkConfig + } + return json.Marshal(objectMap) +} + +// HDInsightStreamingActivity hDInsight streaming activity type. +type HDInsightStreamingActivity struct { + // HDInsightStreamingActivityTypeProperties - HDInsight streaming activity properties. + *HDInsightStreamingActivityTypeProperties `json:"typeProperties,omitempty"` + // LinkedServiceName - Linked service reference. + LinkedServiceName *LinkedServiceReference `json:"linkedServiceName,omitempty"` + // Policy - Activity policy. + Policy *ActivityPolicy `json:"policy,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Name - Activity name. + Name *string `json:"name,omitempty"` + // Description - Activity description. + Description *string `json:"description,omitempty"` + // DependsOn - Activity depends on condition. + DependsOn *[]ActivityDependency `json:"dependsOn,omitempty"` + // UserProperties - Activity user properties. + UserProperties map[string]*string `json:"userProperties"` + // Type - Possible values include: 'TypeActivity', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLUpdateResource', 'TypeAzureMLBatchExecution', 'TypeGetMetadata', 'TypeWebActivity', 'TypeLookup', 'TypeSQLServerStoredProcedure', 'TypeCustom', 'TypeExecuteSSISPackage', 'TypeHDInsightSpark', 'TypeHDInsightStreaming', 'TypeHDInsightMapReduce', 'TypeHDInsightPig', 'TypeHDInsightHive', 'TypeCopy', 'TypeExecution', 'TypeFilter', 'TypeUntil', 'TypeWait', 'TypeForEach', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' + Type TypeBasicActivity `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for HDInsightStreamingActivity. +func (hisa HDInsightStreamingActivity) MarshalJSON() ([]byte, error) { + hisa.Type = TypeHDInsightStreaming + objectMap := make(map[string]interface{}) + if hisa.HDInsightStreamingActivityTypeProperties != nil { + objectMap["typeProperties"] = hisa.HDInsightStreamingActivityTypeProperties + } + if hisa.LinkedServiceName != nil { + objectMap["linkedServiceName"] = hisa.LinkedServiceName + } + if hisa.Policy != nil { + objectMap["policy"] = hisa.Policy + } + if hisa.Name != nil { + objectMap["name"] = hisa.Name + } + if hisa.Description != nil { + objectMap["description"] = hisa.Description + } + if hisa.DependsOn != nil { + objectMap["dependsOn"] = hisa.DependsOn + } + if hisa.UserProperties != nil { + objectMap["userProperties"] = hisa.UserProperties + } + if hisa.Type != "" { + objectMap["type"] = hisa.Type + } + for k, v := range hisa.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsDatabricksNotebookActivity is the BasicActivity implementation for HDInsightStreamingActivity. +func (hisa HDInsightStreamingActivity) AsDatabricksNotebookActivity() (*DatabricksNotebookActivity, bool) { + return nil, false +} + +// AsDataLakeAnalyticsUSQLActivity is the BasicActivity implementation for HDInsightStreamingActivity. +func (hisa HDInsightStreamingActivity) AsDataLakeAnalyticsUSQLActivity() (*DataLakeAnalyticsUSQLActivity, bool) { + return nil, false +} + +// AsAzureMLUpdateResourceActivity is the BasicActivity implementation for HDInsightStreamingActivity. +func (hisa HDInsightStreamingActivity) AsAzureMLUpdateResourceActivity() (*AzureMLUpdateResourceActivity, bool) { + return nil, false +} + +// AsAzureMLBatchExecutionActivity is the BasicActivity implementation for HDInsightStreamingActivity. +func (hisa HDInsightStreamingActivity) AsAzureMLBatchExecutionActivity() (*AzureMLBatchExecutionActivity, bool) { + return nil, false +} + +// AsGetMetadataActivity is the BasicActivity implementation for HDInsightStreamingActivity. +func (hisa HDInsightStreamingActivity) AsGetMetadataActivity() (*GetMetadataActivity, bool) { + return nil, false +} + +// AsWebActivity is the BasicActivity implementation for HDInsightStreamingActivity. +func (hisa HDInsightStreamingActivity) AsWebActivity() (*WebActivity, bool) { + return nil, false +} + +// AsLookupActivity is the BasicActivity implementation for HDInsightStreamingActivity. +func (hisa HDInsightStreamingActivity) AsLookupActivity() (*LookupActivity, bool) { + return nil, false +} + +// AsSQLServerStoredProcedureActivity is the BasicActivity implementation for HDInsightStreamingActivity. +func (hisa HDInsightStreamingActivity) AsSQLServerStoredProcedureActivity() (*SQLServerStoredProcedureActivity, bool) { + return nil, false +} + +// AsCustomActivity is the BasicActivity implementation for HDInsightStreamingActivity. +func (hisa HDInsightStreamingActivity) AsCustomActivity() (*CustomActivity, bool) { + return nil, false +} + +// AsExecuteSSISPackageActivity is the BasicActivity implementation for HDInsightStreamingActivity. +func (hisa HDInsightStreamingActivity) AsExecuteSSISPackageActivity() (*ExecuteSSISPackageActivity, bool) { + return nil, false +} + +// AsHDInsightSparkActivity is the BasicActivity implementation for HDInsightStreamingActivity. +func (hisa HDInsightStreamingActivity) AsHDInsightSparkActivity() (*HDInsightSparkActivity, bool) { + return nil, false +} + +// AsHDInsightStreamingActivity is the BasicActivity implementation for HDInsightStreamingActivity. +func (hisa HDInsightStreamingActivity) AsHDInsightStreamingActivity() (*HDInsightStreamingActivity, bool) { + return &hisa, true +} + +// AsHDInsightMapReduceActivity is the BasicActivity implementation for HDInsightStreamingActivity. +func (hisa HDInsightStreamingActivity) AsHDInsightMapReduceActivity() (*HDInsightMapReduceActivity, bool) { + return nil, false +} + +// AsHDInsightPigActivity is the BasicActivity implementation for HDInsightStreamingActivity. +func (hisa HDInsightStreamingActivity) AsHDInsightPigActivity() (*HDInsightPigActivity, bool) { + return nil, false +} + +// AsHDInsightHiveActivity is the BasicActivity implementation for HDInsightStreamingActivity. +func (hisa HDInsightStreamingActivity) AsHDInsightHiveActivity() (*HDInsightHiveActivity, bool) { + return nil, false +} + +// AsCopyActivity is the BasicActivity implementation for HDInsightStreamingActivity. +func (hisa HDInsightStreamingActivity) AsCopyActivity() (*CopyActivity, bool) { + return nil, false +} + +// AsExecutionActivity is the BasicActivity implementation for HDInsightStreamingActivity. +func (hisa HDInsightStreamingActivity) AsExecutionActivity() (*ExecutionActivity, bool) { + return nil, false +} + +// AsBasicExecutionActivity is the BasicActivity implementation for HDInsightStreamingActivity. +func (hisa HDInsightStreamingActivity) AsBasicExecutionActivity() (BasicExecutionActivity, bool) { + return &hisa, true +} + +// AsFilterActivity is the BasicActivity implementation for HDInsightStreamingActivity. +func (hisa HDInsightStreamingActivity) AsFilterActivity() (*FilterActivity, bool) { + return nil, false +} + +// AsUntilActivity is the BasicActivity implementation for HDInsightStreamingActivity. +func (hisa HDInsightStreamingActivity) AsUntilActivity() (*UntilActivity, bool) { + return nil, false +} + +// AsWaitActivity is the BasicActivity implementation for HDInsightStreamingActivity. +func (hisa HDInsightStreamingActivity) AsWaitActivity() (*WaitActivity, bool) { + return nil, false +} + +// AsForEachActivity is the BasicActivity implementation for HDInsightStreamingActivity. +func (hisa HDInsightStreamingActivity) AsForEachActivity() (*ForEachActivity, bool) { + return nil, false +} + +// AsIfConditionActivity is the BasicActivity implementation for HDInsightStreamingActivity. +func (hisa HDInsightStreamingActivity) AsIfConditionActivity() (*IfConditionActivity, bool) { + return nil, false +} + +// AsExecutePipelineActivity is the BasicActivity implementation for HDInsightStreamingActivity. +func (hisa HDInsightStreamingActivity) AsExecutePipelineActivity() (*ExecutePipelineActivity, bool) { + return nil, false +} + +// AsControlActivity is the BasicActivity implementation for HDInsightStreamingActivity. +func (hisa HDInsightStreamingActivity) AsControlActivity() (*ControlActivity, bool) { + return nil, false +} + +// AsBasicControlActivity is the BasicActivity implementation for HDInsightStreamingActivity. +func (hisa HDInsightStreamingActivity) AsBasicControlActivity() (BasicControlActivity, bool) { + return nil, false +} + +// AsActivity is the BasicActivity implementation for HDInsightStreamingActivity. +func (hisa HDInsightStreamingActivity) AsActivity() (*Activity, bool) { + return nil, false +} + +// AsBasicActivity is the BasicActivity implementation for HDInsightStreamingActivity. +func (hisa HDInsightStreamingActivity) AsBasicActivity() (BasicActivity, bool) { + return &hisa, true +} + +// UnmarshalJSON is the custom unmarshaler for HDInsightStreamingActivity struct. +func (hisa *HDInsightStreamingActivity) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "typeProperties": + if v != nil { + var hDInsightStreamingActivityTypeProperties HDInsightStreamingActivityTypeProperties + err = json.Unmarshal(*v, &hDInsightStreamingActivityTypeProperties) + if err != nil { + return err + } + hisa.HDInsightStreamingActivityTypeProperties = &hDInsightStreamingActivityTypeProperties + } + case "linkedServiceName": + if v != nil { + var linkedServiceName LinkedServiceReference + err = json.Unmarshal(*v, &linkedServiceName) + if err != nil { + return err + } + hisa.LinkedServiceName = &linkedServiceName + } + case "policy": + if v != nil { + var policy ActivityPolicy + err = json.Unmarshal(*v, &policy) + if err != nil { + return err + } + hisa.Policy = &policy + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if hisa.AdditionalProperties == nil { + hisa.AdditionalProperties = make(map[string]interface{}) + } + hisa.AdditionalProperties[k] = additionalProperties + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + hisa.Name = &name + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + hisa.Description = &description + } + case "dependsOn": + if v != nil { + var dependsOn []ActivityDependency + err = json.Unmarshal(*v, &dependsOn) + if err != nil { + return err + } + hisa.DependsOn = &dependsOn + } + case "userProperties": + if v != nil { + var userProperties map[string]*string + err = json.Unmarshal(*v, &userProperties) + if err != nil { + return err + } + hisa.UserProperties = userProperties + } + case "type": + if v != nil { + var typeVar TypeBasicActivity + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + hisa.Type = typeVar + } + } + } + + return nil +} + +// HDInsightStreamingActivityTypeProperties hDInsight streaming activity properties. +type HDInsightStreamingActivityTypeProperties struct { + // StorageLinkedServices - Storage linked service references. + StorageLinkedServices *[]LinkedServiceReference `json:"storageLinkedServices,omitempty"` + // Arguments - User specified arguments to HDInsightActivity. + Arguments *[]interface{} `json:"arguments,omitempty"` + // GetDebugInfo - Debug info option. Possible values include: 'None', 'Always', 'Failure' + GetDebugInfo HDInsightActivityDebugInfoOption `json:"getDebugInfo,omitempty"` + // Mapper - Mapper executable name. Type: string (or Expression with resultType string). + Mapper interface{} `json:"mapper,omitempty"` + // Reducer - Reducer executable name. Type: string (or Expression with resultType string). + Reducer interface{} `json:"reducer,omitempty"` + // Input - Input blob path. Type: string (or Expression with resultType string). + Input interface{} `json:"input,omitempty"` + // Output - Output blob path. Type: string (or Expression with resultType string). + Output interface{} `json:"output,omitempty"` + // FilePaths - Paths to streaming job files. Can be directories. + FilePaths *[]interface{} `json:"filePaths,omitempty"` + // FileLinkedService - Linked service reference where the files are located. + FileLinkedService *LinkedServiceReference `json:"fileLinkedService,omitempty"` + // Combiner - Combiner executable name. Type: string (or Expression with resultType string). + Combiner interface{} `json:"combiner,omitempty"` + // CommandEnvironment - Command line environment values. + CommandEnvironment *[]interface{} `json:"commandEnvironment,omitempty"` + // Defines - Allows user to specify defines for streaming job request. + Defines map[string]interface{} `json:"defines"` +} + +// MarshalJSON is the custom marshaler for HDInsightStreamingActivityTypeProperties. +func (hisatp HDInsightStreamingActivityTypeProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if hisatp.StorageLinkedServices != nil { + objectMap["storageLinkedServices"] = hisatp.StorageLinkedServices + } + if hisatp.Arguments != nil { + objectMap["arguments"] = hisatp.Arguments + } + if hisatp.GetDebugInfo != "" { + objectMap["getDebugInfo"] = hisatp.GetDebugInfo + } + objectMap["mapper"] = hisatp.Mapper + objectMap["reducer"] = hisatp.Reducer + objectMap["input"] = hisatp.Input + objectMap["output"] = hisatp.Output + if hisatp.FilePaths != nil { + objectMap["filePaths"] = hisatp.FilePaths + } + if hisatp.FileLinkedService != nil { + objectMap["fileLinkedService"] = hisatp.FileLinkedService + } + objectMap["combiner"] = hisatp.Combiner + if hisatp.CommandEnvironment != nil { + objectMap["commandEnvironment"] = hisatp.CommandEnvironment + } + if hisatp.Defines != nil { + objectMap["defines"] = hisatp.Defines + } + return json.Marshal(objectMap) +} + +// HiveLinkedService hive Server linked service. +type HiveLinkedService struct { + // HiveLinkedServiceTypeProperties - Hive Server linked service properties. + *HiveLinkedServiceTypeProperties `json:"typeProperties,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // ConnectVia - The integration runtime reference. + ConnectVia *IntegrationRuntimeReference `json:"connectVia,omitempty"` + // Description - Linked service description. + Description *string `json:"description,omitempty"` + // Parameters - Parameters for linked service. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeLinkedService', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforce', 'TypeAzureDataLakeStore', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureStorage' + Type TypeBasicLinkedService `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for HiveLinkedService. +func (hls HiveLinkedService) MarshalJSON() ([]byte, error) { + hls.Type = TypeHive + objectMap := make(map[string]interface{}) + if hls.HiveLinkedServiceTypeProperties != nil { + objectMap["typeProperties"] = hls.HiveLinkedServiceTypeProperties + } + if hls.ConnectVia != nil { + objectMap["connectVia"] = hls.ConnectVia + } + if hls.Description != nil { + objectMap["description"] = hls.Description + } + if hls.Parameters != nil { + objectMap["parameters"] = hls.Parameters + } + if hls.Annotations != nil { + objectMap["annotations"] = hls.Annotations + } + if hls.Type != "" { + objectMap["type"] = hls.Type + } + for k, v := range hls.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysLinkedService is the BasicLinkedService implementation for HiveLinkedService. +func (hls HiveLinkedService) AsResponsysLinkedService() (*ResponsysLinkedService, bool) { + return nil, false +} + +// AsAzureDatabricksLinkedService is the BasicLinkedService implementation for HiveLinkedService. +func (hls HiveLinkedService) AsAzureDatabricksLinkedService() (*AzureDatabricksLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeAnalyticsLinkedService is the BasicLinkedService implementation for HiveLinkedService. +func (hls HiveLinkedService) AsAzureDataLakeAnalyticsLinkedService() (*AzureDataLakeAnalyticsLinkedService, bool) { + return nil, false +} + +// AsHDInsightOnDemandLinkedService is the BasicLinkedService implementation for HiveLinkedService. +func (hls HiveLinkedService) AsHDInsightOnDemandLinkedService() (*HDInsightOnDemandLinkedService, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudLinkedService is the BasicLinkedService implementation for HiveLinkedService. +func (hls HiveLinkedService) AsSalesforceMarketingCloudLinkedService() (*SalesforceMarketingCloudLinkedService, bool) { + return nil, false +} + +// AsNetezzaLinkedService is the BasicLinkedService implementation for HiveLinkedService. +func (hls HiveLinkedService) AsNetezzaLinkedService() (*NetezzaLinkedService, bool) { + return nil, false +} + +// AsVerticaLinkedService is the BasicLinkedService implementation for HiveLinkedService. +func (hls HiveLinkedService) AsVerticaLinkedService() (*VerticaLinkedService, bool) { + return nil, false +} + +// AsZohoLinkedService is the BasicLinkedService implementation for HiveLinkedService. +func (hls HiveLinkedService) AsZohoLinkedService() (*ZohoLinkedService, bool) { + return nil, false +} + +// AsXeroLinkedService is the BasicLinkedService implementation for HiveLinkedService. +func (hls HiveLinkedService) AsXeroLinkedService() (*XeroLinkedService, bool) { + return nil, false +} + +// AsSquareLinkedService is the BasicLinkedService implementation for HiveLinkedService. +func (hls HiveLinkedService) AsSquareLinkedService() (*SquareLinkedService, bool) { + return nil, false +} + +// AsSparkLinkedService is the BasicLinkedService implementation for HiveLinkedService. +func (hls HiveLinkedService) AsSparkLinkedService() (*SparkLinkedService, bool) { + return nil, false +} + +// AsShopifyLinkedService is the BasicLinkedService implementation for HiveLinkedService. +func (hls HiveLinkedService) AsShopifyLinkedService() (*ShopifyLinkedService, bool) { + return nil, false +} + +// AsServiceNowLinkedService is the BasicLinkedService implementation for HiveLinkedService. +func (hls HiveLinkedService) AsServiceNowLinkedService() (*ServiceNowLinkedService, bool) { + return nil, false +} + +// AsQuickBooksLinkedService is the BasicLinkedService implementation for HiveLinkedService. +func (hls HiveLinkedService) AsQuickBooksLinkedService() (*QuickBooksLinkedService, bool) { + return nil, false +} + +// AsPrestoLinkedService is the BasicLinkedService implementation for HiveLinkedService. +func (hls HiveLinkedService) AsPrestoLinkedService() (*PrestoLinkedService, bool) { + return nil, false +} + +// AsPhoenixLinkedService is the BasicLinkedService implementation for HiveLinkedService. +func (hls HiveLinkedService) AsPhoenixLinkedService() (*PhoenixLinkedService, bool) { + return nil, false +} + +// AsPaypalLinkedService is the BasicLinkedService implementation for HiveLinkedService. +func (hls HiveLinkedService) AsPaypalLinkedService() (*PaypalLinkedService, bool) { + return nil, false +} + +// AsMarketoLinkedService is the BasicLinkedService implementation for HiveLinkedService. +func (hls HiveLinkedService) AsMarketoLinkedService() (*MarketoLinkedService, bool) { + return nil, false +} + +// AsMariaDBLinkedService is the BasicLinkedService implementation for HiveLinkedService. +func (hls HiveLinkedService) AsMariaDBLinkedService() (*MariaDBLinkedService, bool) { + return nil, false +} + +// AsMagentoLinkedService is the BasicLinkedService implementation for HiveLinkedService. +func (hls HiveLinkedService) AsMagentoLinkedService() (*MagentoLinkedService, bool) { + return nil, false +} + +// AsJiraLinkedService is the BasicLinkedService implementation for HiveLinkedService. +func (hls HiveLinkedService) AsJiraLinkedService() (*JiraLinkedService, bool) { + return nil, false +} + +// AsImpalaLinkedService is the BasicLinkedService implementation for HiveLinkedService. +func (hls HiveLinkedService) AsImpalaLinkedService() (*ImpalaLinkedService, bool) { + return nil, false +} + +// AsHubspotLinkedService is the BasicLinkedService implementation for HiveLinkedService. +func (hls HiveLinkedService) AsHubspotLinkedService() (*HubspotLinkedService, bool) { + return nil, false +} + +// AsHiveLinkedService is the BasicLinkedService implementation for HiveLinkedService. +func (hls HiveLinkedService) AsHiveLinkedService() (*HiveLinkedService, bool) { + return &hls, true +} + +// AsHBaseLinkedService is the BasicLinkedService implementation for HiveLinkedService. +func (hls HiveLinkedService) AsHBaseLinkedService() (*HBaseLinkedService, bool) { + return nil, false +} + +// AsGreenplumLinkedService is the BasicLinkedService implementation for HiveLinkedService. +func (hls HiveLinkedService) AsGreenplumLinkedService() (*GreenplumLinkedService, bool) { + return nil, false +} + +// AsGoogleBigQueryLinkedService is the BasicLinkedService implementation for HiveLinkedService. +func (hls HiveLinkedService) AsGoogleBigQueryLinkedService() (*GoogleBigQueryLinkedService, bool) { + return nil, false +} + +// AsEloquaLinkedService is the BasicLinkedService implementation for HiveLinkedService. +func (hls HiveLinkedService) AsEloquaLinkedService() (*EloquaLinkedService, bool) { + return nil, false +} + +// AsDrillLinkedService is the BasicLinkedService implementation for HiveLinkedService. +func (hls HiveLinkedService) AsDrillLinkedService() (*DrillLinkedService, bool) { + return nil, false +} + +// AsCouchbaseLinkedService is the BasicLinkedService implementation for HiveLinkedService. +func (hls HiveLinkedService) AsCouchbaseLinkedService() (*CouchbaseLinkedService, bool) { + return nil, false +} + +// AsConcurLinkedService is the BasicLinkedService implementation for HiveLinkedService. +func (hls HiveLinkedService) AsConcurLinkedService() (*ConcurLinkedService, bool) { + return nil, false +} + +// AsAzurePostgreSQLLinkedService is the BasicLinkedService implementation for HiveLinkedService. +func (hls HiveLinkedService) AsAzurePostgreSQLLinkedService() (*AzurePostgreSQLLinkedService, bool) { + return nil, false +} + +// AsAmazonMWSLinkedService is the BasicLinkedService implementation for HiveLinkedService. +func (hls HiveLinkedService) AsAmazonMWSLinkedService() (*AmazonMWSLinkedService, bool) { + return nil, false +} + +// AsSapHanaLinkedService is the BasicLinkedService implementation for HiveLinkedService. +func (hls HiveLinkedService) AsSapHanaLinkedService() (*SapHanaLinkedService, bool) { + return nil, false +} + +// AsSapBWLinkedService is the BasicLinkedService implementation for HiveLinkedService. +func (hls HiveLinkedService) AsSapBWLinkedService() (*SapBWLinkedService, bool) { + return nil, false +} + +// AsSftpServerLinkedService is the BasicLinkedService implementation for HiveLinkedService. +func (hls HiveLinkedService) AsSftpServerLinkedService() (*SftpServerLinkedService, bool) { + return nil, false +} + +// AsFtpServerLinkedService is the BasicLinkedService implementation for HiveLinkedService. +func (hls HiveLinkedService) AsFtpServerLinkedService() (*FtpServerLinkedService, bool) { + return nil, false +} + +// AsHTTPLinkedService is the BasicLinkedService implementation for HiveLinkedService. +func (hls HiveLinkedService) AsHTTPLinkedService() (*HTTPLinkedService, bool) { + return nil, false +} + +// AsAzureSearchLinkedService is the BasicLinkedService implementation for HiveLinkedService. +func (hls HiveLinkedService) AsAzureSearchLinkedService() (*AzureSearchLinkedService, bool) { + return nil, false +} + +// AsCustomDataSourceLinkedService is the BasicLinkedService implementation for HiveLinkedService. +func (hls HiveLinkedService) AsCustomDataSourceLinkedService() (*CustomDataSourceLinkedService, bool) { + return nil, false +} + +// AsAmazonRedshiftLinkedService is the BasicLinkedService implementation for HiveLinkedService. +func (hls HiveLinkedService) AsAmazonRedshiftLinkedService() (*AmazonRedshiftLinkedService, bool) { + return nil, false +} + +// AsAmazonS3LinkedService is the BasicLinkedService implementation for HiveLinkedService. +func (hls HiveLinkedService) AsAmazonS3LinkedService() (*AmazonS3LinkedService, bool) { + return nil, false +} + +// AsSapEccLinkedService is the BasicLinkedService implementation for HiveLinkedService. +func (hls HiveLinkedService) AsSapEccLinkedService() (*SapEccLinkedService, bool) { + return nil, false +} + +// AsSapCloudForCustomerLinkedService is the BasicLinkedService implementation for HiveLinkedService. +func (hls HiveLinkedService) AsSapCloudForCustomerLinkedService() (*SapCloudForCustomerLinkedService, bool) { + return nil, false +} + +// AsSalesforceLinkedService is the BasicLinkedService implementation for HiveLinkedService. +func (hls HiveLinkedService) AsSalesforceLinkedService() (*SalesforceLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeStoreLinkedService is the BasicLinkedService implementation for HiveLinkedService. +func (hls HiveLinkedService) AsAzureDataLakeStoreLinkedService() (*AzureDataLakeStoreLinkedService, bool) { + return nil, false +} + +// AsMongoDbLinkedService is the BasicLinkedService implementation for HiveLinkedService. +func (hls HiveLinkedService) AsMongoDbLinkedService() (*MongoDbLinkedService, bool) { + return nil, false +} + +// AsCassandraLinkedService is the BasicLinkedService implementation for HiveLinkedService. +func (hls HiveLinkedService) AsCassandraLinkedService() (*CassandraLinkedService, bool) { + return nil, false +} + +// AsWebLinkedService is the BasicLinkedService implementation for HiveLinkedService. +func (hls HiveLinkedService) AsWebLinkedService() (*WebLinkedService, bool) { + return nil, false +} + +// AsODataLinkedService is the BasicLinkedService implementation for HiveLinkedService. +func (hls HiveLinkedService) AsODataLinkedService() (*ODataLinkedService, bool) { + return nil, false +} + +// AsHdfsLinkedService is the BasicLinkedService implementation for HiveLinkedService. +func (hls HiveLinkedService) AsHdfsLinkedService() (*HdfsLinkedService, bool) { + return nil, false +} + +// AsOdbcLinkedService is the BasicLinkedService implementation for HiveLinkedService. +func (hls HiveLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, bool) { + return nil, false +} + +// AsAzureMLLinkedService is the BasicLinkedService implementation for HiveLinkedService. +func (hls HiveLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { + return nil, false +} + +// AsTeradataLinkedService is the BasicLinkedService implementation for HiveLinkedService. +func (hls HiveLinkedService) AsTeradataLinkedService() (*TeradataLinkedService, bool) { + return nil, false +} + +// AsDb2LinkedService is the BasicLinkedService implementation for HiveLinkedService. +func (hls HiveLinkedService) AsDb2LinkedService() (*Db2LinkedService, bool) { + return nil, false +} + +// AsSybaseLinkedService is the BasicLinkedService implementation for HiveLinkedService. +func (hls HiveLinkedService) AsSybaseLinkedService() (*SybaseLinkedService, bool) { + return nil, false +} + +// AsPostgreSQLLinkedService is the BasicLinkedService implementation for HiveLinkedService. +func (hls HiveLinkedService) AsPostgreSQLLinkedService() (*PostgreSQLLinkedService, bool) { + return nil, false +} + +// AsMySQLLinkedService is the BasicLinkedService implementation for HiveLinkedService. +func (hls HiveLinkedService) AsMySQLLinkedService() (*MySQLLinkedService, bool) { + return nil, false +} + +// AsAzureMySQLLinkedService is the BasicLinkedService implementation for HiveLinkedService. +func (hls HiveLinkedService) AsAzureMySQLLinkedService() (*AzureMySQLLinkedService, bool) { + return nil, false +} + +// AsOracleLinkedService is the BasicLinkedService implementation for HiveLinkedService. +func (hls HiveLinkedService) AsOracleLinkedService() (*OracleLinkedService, bool) { + return nil, false +} + +// AsFileServerLinkedService is the BasicLinkedService implementation for HiveLinkedService. +func (hls HiveLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { + return nil, false +} + +// AsHDInsightLinkedService is the BasicLinkedService implementation for HiveLinkedService. +func (hls HiveLinkedService) AsHDInsightLinkedService() (*HDInsightLinkedService, bool) { + return nil, false +} + +// AsDynamicsLinkedService is the BasicLinkedService implementation for HiveLinkedService. +func (hls HiveLinkedService) AsDynamicsLinkedService() (*DynamicsLinkedService, bool) { + return nil, false +} + +// AsCosmosDbLinkedService is the BasicLinkedService implementation for HiveLinkedService. +func (hls HiveLinkedService) AsCosmosDbLinkedService() (*CosmosDbLinkedService, bool) { + return nil, false +} + +// AsAzureKeyVaultLinkedService is the BasicLinkedService implementation for HiveLinkedService. +func (hls HiveLinkedService) AsAzureKeyVaultLinkedService() (*AzureKeyVaultLinkedService, bool) { + return nil, false +} + +// AsAzureBatchLinkedService is the BasicLinkedService implementation for HiveLinkedService. +func (hls HiveLinkedService) AsAzureBatchLinkedService() (*AzureBatchLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDatabaseLinkedService is the BasicLinkedService implementation for HiveLinkedService. +func (hls HiveLinkedService) AsAzureSQLDatabaseLinkedService() (*AzureSQLDatabaseLinkedService, bool) { + return nil, false +} + +// AsSQLServerLinkedService is the BasicLinkedService implementation for HiveLinkedService. +func (hls HiveLinkedService) AsSQLServerLinkedService() (*SQLServerLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDWLinkedService is the BasicLinkedService implementation for HiveLinkedService. +func (hls HiveLinkedService) AsAzureSQLDWLinkedService() (*AzureSQLDWLinkedService, bool) { + return nil, false +} + +// AsAzureStorageLinkedService is the BasicLinkedService implementation for HiveLinkedService. +func (hls HiveLinkedService) AsAzureStorageLinkedService() (*AzureStorageLinkedService, bool) { + return nil, false +} + +// AsLinkedService is the BasicLinkedService implementation for HiveLinkedService. +func (hls HiveLinkedService) AsLinkedService() (*LinkedService, bool) { + return nil, false +} + +// AsBasicLinkedService is the BasicLinkedService implementation for HiveLinkedService. +func (hls HiveLinkedService) AsBasicLinkedService() (BasicLinkedService, bool) { + return &hls, true +} + +// UnmarshalJSON is the custom unmarshaler for HiveLinkedService struct. +func (hls *HiveLinkedService) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "typeProperties": + if v != nil { + var hiveLinkedServiceTypeProperties HiveLinkedServiceTypeProperties + err = json.Unmarshal(*v, &hiveLinkedServiceTypeProperties) + if err != nil { + return err + } + hls.HiveLinkedServiceTypeProperties = &hiveLinkedServiceTypeProperties + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if hls.AdditionalProperties == nil { + hls.AdditionalProperties = make(map[string]interface{}) + } + hls.AdditionalProperties[k] = additionalProperties + } + case "connectVia": + if v != nil { + var connectVia IntegrationRuntimeReference + err = json.Unmarshal(*v, &connectVia) + if err != nil { + return err + } + hls.ConnectVia = &connectVia + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + hls.Description = &description + } + case "parameters": + if v != nil { + var parameters map[string]*ParameterSpecification + err = json.Unmarshal(*v, ¶meters) + if err != nil { + return err + } + hls.Parameters = parameters + } + case "annotations": + if v != nil { + var annotations []interface{} + err = json.Unmarshal(*v, &annotations) + if err != nil { + return err + } + hls.Annotations = &annotations + } + case "type": + if v != nil { + var typeVar TypeBasicLinkedService + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + hls.Type = typeVar + } + } + } + + return nil +} + +// HiveLinkedServiceTypeProperties hive Server linked service properties. +type HiveLinkedServiceTypeProperties struct { + // Host - IP address or host name of the Hive server, separated by ';' for multiple hosts (only when serviceDiscoveryMode is enable). + Host interface{} `json:"host,omitempty"` + // Port - The TCP port that the Hive server uses to listen for client connections. + Port interface{} `json:"port,omitempty"` + // ServerType - The type of Hive server. Possible values include: 'HiveServer1', 'HiveServer2', 'HiveThriftServer' + ServerType HiveServerType `json:"serverType,omitempty"` + // ThriftTransportProtocol - The transport protocol to use in the Thrift layer. Possible values include: 'Binary', 'SASL', 'HTTP' + ThriftTransportProtocol HiveThriftTransportProtocol `json:"thriftTransportProtocol,omitempty"` + // AuthenticationType - The authentication method used to access the Hive server. Possible values include: 'Anonymous', 'Username', 'UsernameAndPassword', 'WindowsAzureHDInsightService' + AuthenticationType HiveAuthenticationType `json:"authenticationType,omitempty"` + // ServiceDiscoveryMode - true to indicate using the ZooKeeper service, false not. + ServiceDiscoveryMode interface{} `json:"serviceDiscoveryMode,omitempty"` + // ZooKeeperNameSpace - The namespace on ZooKeeper under which Hive Server 2 nodes are added. + ZooKeeperNameSpace interface{} `json:"zooKeeperNameSpace,omitempty"` + // UseNativeQuery - Specifies whether the driver uses native HiveQL queries,or converts them into an equivalent form in HiveQL. + UseNativeQuery interface{} `json:"useNativeQuery,omitempty"` + // Username - The user name that you use to access Hive Server. + Username interface{} `json:"username,omitempty"` + // Password - The password corresponding to the user name that you provided in the Username field + Password BasicSecretBase `json:"password,omitempty"` + // HTTPPath - The partial URL corresponding to the Hive server. + HTTPPath interface{} `json:"httpPath,omitempty"` + // EnableSsl - Specifies whether the connections to the server are encrypted using SSL. The default value is false. + EnableSsl interface{} `json:"enableSsl,omitempty"` + // TrustedCertPath - The full path of the .pem file containing trusted CA certificates for verifying the server when connecting over SSL. This property can only be set when using SSL on self-hosted IR. The default value is the cacerts.pem file installed with the IR. + TrustedCertPath interface{} `json:"trustedCertPath,omitempty"` + // UseSystemTrustStore - Specifies whether to use a CA certificate from the system trust store or from a specified PEM file. The default value is false. + UseSystemTrustStore interface{} `json:"useSystemTrustStore,omitempty"` + // AllowHostNameCNMismatch - Specifies whether to require a CA-issued SSL certificate name to match the host name of the server when connecting over SSL. The default value is false. + AllowHostNameCNMismatch interface{} `json:"allowHostNameCNMismatch,omitempty"` + // AllowSelfSignedServerCert - Specifies whether to allow self-signed certificates from the server. The default value is false. + AllowSelfSignedServerCert interface{} `json:"allowSelfSignedServerCert,omitempty"` + // EncryptedCredential - The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string). + EncryptedCredential interface{} `json:"encryptedCredential,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for HiveLinkedServiceTypeProperties struct. +func (hlstp *HiveLinkedServiceTypeProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "host": + if v != nil { + var host interface{} + err = json.Unmarshal(*v, &host) + if err != nil { + return err + } + hlstp.Host = host + } + case "port": + if v != nil { + var port interface{} + err = json.Unmarshal(*v, &port) + if err != nil { + return err + } + hlstp.Port = port + } + case "serverType": + if v != nil { + var serverType HiveServerType + err = json.Unmarshal(*v, &serverType) + if err != nil { + return err + } + hlstp.ServerType = serverType + } + case "thriftTransportProtocol": + if v != nil { + var thriftTransportProtocol HiveThriftTransportProtocol + err = json.Unmarshal(*v, &thriftTransportProtocol) + if err != nil { + return err + } + hlstp.ThriftTransportProtocol = thriftTransportProtocol + } + case "authenticationType": + if v != nil { + var authenticationType HiveAuthenticationType + err = json.Unmarshal(*v, &authenticationType) + if err != nil { + return err + } + hlstp.AuthenticationType = authenticationType + } + case "serviceDiscoveryMode": + if v != nil { + var serviceDiscoveryMode interface{} + err = json.Unmarshal(*v, &serviceDiscoveryMode) + if err != nil { + return err + } + hlstp.ServiceDiscoveryMode = serviceDiscoveryMode + } + case "zooKeeperNameSpace": + if v != nil { + var zooKeeperNameSpace interface{} + err = json.Unmarshal(*v, &zooKeeperNameSpace) + if err != nil { + return err + } + hlstp.ZooKeeperNameSpace = zooKeeperNameSpace + } + case "useNativeQuery": + if v != nil { + var useNativeQuery interface{} + err = json.Unmarshal(*v, &useNativeQuery) + if err != nil { + return err + } + hlstp.UseNativeQuery = useNativeQuery + } + case "username": + if v != nil { + var username interface{} + err = json.Unmarshal(*v, &username) + if err != nil { + return err + } + hlstp.Username = username + } + case "password": + if v != nil { + password, err := unmarshalBasicSecretBase(*v) + if err != nil { + return err + } + hlstp.Password = password + } + case "httpPath": + if v != nil { + var HTTPPath interface{} + err = json.Unmarshal(*v, &HTTPPath) + if err != nil { + return err + } + hlstp.HTTPPath = HTTPPath + } + case "enableSsl": + if v != nil { + var enableSsl interface{} + err = json.Unmarshal(*v, &enableSsl) + if err != nil { + return err + } + hlstp.EnableSsl = enableSsl + } + case "trustedCertPath": + if v != nil { + var trustedCertPath interface{} + err = json.Unmarshal(*v, &trustedCertPath) + if err != nil { + return err + } + hlstp.TrustedCertPath = trustedCertPath + } + case "useSystemTrustStore": + if v != nil { + var useSystemTrustStore interface{} + err = json.Unmarshal(*v, &useSystemTrustStore) + if err != nil { + return err + } + hlstp.UseSystemTrustStore = useSystemTrustStore + } + case "allowHostNameCNMismatch": + if v != nil { + var allowHostNameCNMismatch interface{} + err = json.Unmarshal(*v, &allowHostNameCNMismatch) + if err != nil { + return err + } + hlstp.AllowHostNameCNMismatch = allowHostNameCNMismatch + } + case "allowSelfSignedServerCert": + if v != nil { + var allowSelfSignedServerCert interface{} + err = json.Unmarshal(*v, &allowSelfSignedServerCert) + if err != nil { + return err + } + hlstp.AllowSelfSignedServerCert = allowSelfSignedServerCert + } + case "encryptedCredential": + if v != nil { + var encryptedCredential interface{} + err = json.Unmarshal(*v, &encryptedCredential) + if err != nil { + return err + } + hlstp.EncryptedCredential = encryptedCredential + } + } + } + + return nil +} + +// HiveObjectDataset hive Server dataset. +type HiveObjectDataset struct { + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Description - Dataset description. + Description *string `json:"description,omitempty"` + // Structure - Columns that define the structure of the dataset. Type: array (or Expression with resultType array), itemType: DatasetDataElement. + Structure interface{} `json:"structure,omitempty"` + // LinkedServiceName - Linked service reference. + LinkedServiceName *LinkedServiceReference `json:"linkedServiceName,omitempty"` + // Parameters - Parameters for dataset. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeDataset', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSQLServerTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSalesforceObject', 'TypeRelationalTable', 'TypeAzureMySQLTable', 'TypeOracleTable', 'TypeODataResource', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeAzureDataLakeStoreFile', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeAmazonS3Object' + Type TypeBasicDataset `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for HiveObjectDataset. +func (hod HiveObjectDataset) MarshalJSON() ([]byte, error) { + hod.Type = TypeHiveObject + objectMap := make(map[string]interface{}) + if hod.Description != nil { + objectMap["description"] = hod.Description + } + objectMap["structure"] = hod.Structure + if hod.LinkedServiceName != nil { + objectMap["linkedServiceName"] = hod.LinkedServiceName + } + if hod.Parameters != nil { + objectMap["parameters"] = hod.Parameters + } + if hod.Annotations != nil { + objectMap["annotations"] = hod.Annotations + } + if hod.Type != "" { + objectMap["type"] = hod.Type + } + for k, v := range hod.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysObjectDataset is the BasicDataset implementation for HiveObjectDataset. +func (hod HiveObjectDataset) AsResponsysObjectDataset() (*ResponsysObjectDataset, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudObjectDataset is the BasicDataset implementation for HiveObjectDataset. +func (hod HiveObjectDataset) AsSalesforceMarketingCloudObjectDataset() (*SalesforceMarketingCloudObjectDataset, bool) { + return nil, false +} + +// AsVerticaTableDataset is the BasicDataset implementation for HiveObjectDataset. +func (hod HiveObjectDataset) AsVerticaTableDataset() (*VerticaTableDataset, bool) { + return nil, false +} + +// AsNetezzaTableDataset is the BasicDataset implementation for HiveObjectDataset. +func (hod HiveObjectDataset) AsNetezzaTableDataset() (*NetezzaTableDataset, bool) { + return nil, false +} + +// AsZohoObjectDataset is the BasicDataset implementation for HiveObjectDataset. +func (hod HiveObjectDataset) AsZohoObjectDataset() (*ZohoObjectDataset, bool) { + return nil, false +} + +// AsXeroObjectDataset is the BasicDataset implementation for HiveObjectDataset. +func (hod HiveObjectDataset) AsXeroObjectDataset() (*XeroObjectDataset, bool) { + return nil, false +} + +// AsSquareObjectDataset is the BasicDataset implementation for HiveObjectDataset. +func (hod HiveObjectDataset) AsSquareObjectDataset() (*SquareObjectDataset, bool) { + return nil, false +} + +// AsSparkObjectDataset is the BasicDataset implementation for HiveObjectDataset. +func (hod HiveObjectDataset) AsSparkObjectDataset() (*SparkObjectDataset, bool) { + return nil, false +} + +// AsShopifyObjectDataset is the BasicDataset implementation for HiveObjectDataset. +func (hod HiveObjectDataset) AsShopifyObjectDataset() (*ShopifyObjectDataset, bool) { + return nil, false +} + +// AsServiceNowObjectDataset is the BasicDataset implementation for HiveObjectDataset. +func (hod HiveObjectDataset) AsServiceNowObjectDataset() (*ServiceNowObjectDataset, bool) { + return nil, false +} + +// AsQuickBooksObjectDataset is the BasicDataset implementation for HiveObjectDataset. +func (hod HiveObjectDataset) AsQuickBooksObjectDataset() (*QuickBooksObjectDataset, bool) { + return nil, false +} + +// AsPrestoObjectDataset is the BasicDataset implementation for HiveObjectDataset. +func (hod HiveObjectDataset) AsPrestoObjectDataset() (*PrestoObjectDataset, bool) { + return nil, false +} + +// AsPhoenixObjectDataset is the BasicDataset implementation for HiveObjectDataset. +func (hod HiveObjectDataset) AsPhoenixObjectDataset() (*PhoenixObjectDataset, bool) { + return nil, false +} + +// AsPaypalObjectDataset is the BasicDataset implementation for HiveObjectDataset. +func (hod HiveObjectDataset) AsPaypalObjectDataset() (*PaypalObjectDataset, bool) { + return nil, false +} + +// AsMarketoObjectDataset is the BasicDataset implementation for HiveObjectDataset. +func (hod HiveObjectDataset) AsMarketoObjectDataset() (*MarketoObjectDataset, bool) { + return nil, false +} + +// AsMariaDBTableDataset is the BasicDataset implementation for HiveObjectDataset. +func (hod HiveObjectDataset) AsMariaDBTableDataset() (*MariaDBTableDataset, bool) { + return nil, false +} + +// AsMagentoObjectDataset is the BasicDataset implementation for HiveObjectDataset. +func (hod HiveObjectDataset) AsMagentoObjectDataset() (*MagentoObjectDataset, bool) { + return nil, false +} + +// AsJiraObjectDataset is the BasicDataset implementation for HiveObjectDataset. +func (hod HiveObjectDataset) AsJiraObjectDataset() (*JiraObjectDataset, bool) { + return nil, false +} + +// AsImpalaObjectDataset is the BasicDataset implementation for HiveObjectDataset. +func (hod HiveObjectDataset) AsImpalaObjectDataset() (*ImpalaObjectDataset, bool) { + return nil, false +} + +// AsHubspotObjectDataset is the BasicDataset implementation for HiveObjectDataset. +func (hod HiveObjectDataset) AsHubspotObjectDataset() (*HubspotObjectDataset, bool) { + return nil, false +} + +// AsHiveObjectDataset is the BasicDataset implementation for HiveObjectDataset. +func (hod HiveObjectDataset) AsHiveObjectDataset() (*HiveObjectDataset, bool) { + return &hod, true +} + +// AsHBaseObjectDataset is the BasicDataset implementation for HiveObjectDataset. +func (hod HiveObjectDataset) AsHBaseObjectDataset() (*HBaseObjectDataset, bool) { + return nil, false +} + +// AsGreenplumTableDataset is the BasicDataset implementation for HiveObjectDataset. +func (hod HiveObjectDataset) AsGreenplumTableDataset() (*GreenplumTableDataset, bool) { + return nil, false +} + +// AsGoogleBigQueryObjectDataset is the BasicDataset implementation for HiveObjectDataset. +func (hod HiveObjectDataset) AsGoogleBigQueryObjectDataset() (*GoogleBigQueryObjectDataset, bool) { + return nil, false +} + +// AsEloquaObjectDataset is the BasicDataset implementation for HiveObjectDataset. +func (hod HiveObjectDataset) AsEloquaObjectDataset() (*EloquaObjectDataset, bool) { + return nil, false +} + +// AsDrillTableDataset is the BasicDataset implementation for HiveObjectDataset. +func (hod HiveObjectDataset) AsDrillTableDataset() (*DrillTableDataset, bool) { + return nil, false +} + +// AsCouchbaseTableDataset is the BasicDataset implementation for HiveObjectDataset. +func (hod HiveObjectDataset) AsCouchbaseTableDataset() (*CouchbaseTableDataset, bool) { + return nil, false +} + +// AsConcurObjectDataset is the BasicDataset implementation for HiveObjectDataset. +func (hod HiveObjectDataset) AsConcurObjectDataset() (*ConcurObjectDataset, bool) { + return nil, false +} + +// AsAzurePostgreSQLTableDataset is the BasicDataset implementation for HiveObjectDataset. +func (hod HiveObjectDataset) AsAzurePostgreSQLTableDataset() (*AzurePostgreSQLTableDataset, bool) { + return nil, false +} + +// AsAmazonMWSObjectDataset is the BasicDataset implementation for HiveObjectDataset. +func (hod HiveObjectDataset) AsAmazonMWSObjectDataset() (*AmazonMWSObjectDataset, bool) { + return nil, false +} + +// AsHTTPDataset is the BasicDataset implementation for HiveObjectDataset. +func (hod HiveObjectDataset) AsHTTPDataset() (*HTTPDataset, bool) { + return nil, false +} + +// AsAzureSearchIndexDataset is the BasicDataset implementation for HiveObjectDataset. +func (hod HiveObjectDataset) AsAzureSearchIndexDataset() (*AzureSearchIndexDataset, bool) { + return nil, false +} + +// AsWebTableDataset is the BasicDataset implementation for HiveObjectDataset. +func (hod HiveObjectDataset) AsWebTableDataset() (*WebTableDataset, bool) { + return nil, false +} + +// AsSQLServerTableDataset is the BasicDataset implementation for HiveObjectDataset. +func (hod HiveObjectDataset) AsSQLServerTableDataset() (*SQLServerTableDataset, bool) { + return nil, false +} + +// AsSapEccResourceDataset is the BasicDataset implementation for HiveObjectDataset. +func (hod HiveObjectDataset) AsSapEccResourceDataset() (*SapEccResourceDataset, bool) { + return nil, false +} + +// AsSapCloudForCustomerResourceDataset is the BasicDataset implementation for HiveObjectDataset. +func (hod HiveObjectDataset) AsSapCloudForCustomerResourceDataset() (*SapCloudForCustomerResourceDataset, bool) { + return nil, false +} + +// AsSalesforceObjectDataset is the BasicDataset implementation for HiveObjectDataset. +func (hod HiveObjectDataset) AsSalesforceObjectDataset() (*SalesforceObjectDataset, bool) { + return nil, false +} + +// AsRelationalTableDataset is the BasicDataset implementation for HiveObjectDataset. +func (hod HiveObjectDataset) AsRelationalTableDataset() (*RelationalTableDataset, bool) { + return nil, false +} + +// AsAzureMySQLTableDataset is the BasicDataset implementation for HiveObjectDataset. +func (hod HiveObjectDataset) AsAzureMySQLTableDataset() (*AzureMySQLTableDataset, bool) { + return nil, false +} + +// AsOracleTableDataset is the BasicDataset implementation for HiveObjectDataset. +func (hod HiveObjectDataset) AsOracleTableDataset() (*OracleTableDataset, bool) { + return nil, false +} + +// AsODataResourceDataset is the BasicDataset implementation for HiveObjectDataset. +func (hod HiveObjectDataset) AsODataResourceDataset() (*ODataResourceDataset, bool) { + return nil, false +} + +// AsMongoDbCollectionDataset is the BasicDataset implementation for HiveObjectDataset. +func (hod HiveObjectDataset) AsMongoDbCollectionDataset() (*MongoDbCollectionDataset, bool) { + return nil, false +} + +// AsFileShareDataset is the BasicDataset implementation for HiveObjectDataset. +func (hod HiveObjectDataset) AsFileShareDataset() (*FileShareDataset, bool) { + return nil, false +} + +// AsAzureDataLakeStoreDataset is the BasicDataset implementation for HiveObjectDataset. +func (hod HiveObjectDataset) AsAzureDataLakeStoreDataset() (*AzureDataLakeStoreDataset, bool) { + return nil, false +} + +// AsDynamicsEntityDataset is the BasicDataset implementation for HiveObjectDataset. +func (hod HiveObjectDataset) AsDynamicsEntityDataset() (*DynamicsEntityDataset, bool) { + return nil, false +} + +// AsDocumentDbCollectionDataset is the BasicDataset implementation for HiveObjectDataset. +func (hod HiveObjectDataset) AsDocumentDbCollectionDataset() (*DocumentDbCollectionDataset, bool) { + return nil, false +} + +// AsCustomDataset is the BasicDataset implementation for HiveObjectDataset. +func (hod HiveObjectDataset) AsCustomDataset() (*CustomDataset, bool) { + return nil, false +} + +// AsCassandraTableDataset is the BasicDataset implementation for HiveObjectDataset. +func (hod HiveObjectDataset) AsCassandraTableDataset() (*CassandraTableDataset, bool) { + return nil, false +} + +// AsAzureSQLDWTableDataset is the BasicDataset implementation for HiveObjectDataset. +func (hod HiveObjectDataset) AsAzureSQLDWTableDataset() (*AzureSQLDWTableDataset, bool) { + return nil, false +} + +// AsAzureSQLTableDataset is the BasicDataset implementation for HiveObjectDataset. +func (hod HiveObjectDataset) AsAzureSQLTableDataset() (*AzureSQLTableDataset, bool) { + return nil, false +} + +// AsAzureTableDataset is the BasicDataset implementation for HiveObjectDataset. +func (hod HiveObjectDataset) AsAzureTableDataset() (*AzureTableDataset, bool) { + return nil, false +} + +// AsAzureBlobDataset is the BasicDataset implementation for HiveObjectDataset. +func (hod HiveObjectDataset) AsAzureBlobDataset() (*AzureBlobDataset, bool) { + return nil, false +} + +// AsAmazonS3Dataset is the BasicDataset implementation for HiveObjectDataset. +func (hod HiveObjectDataset) AsAmazonS3Dataset() (*AmazonS3Dataset, bool) { + return nil, false +} + +// AsDataset is the BasicDataset implementation for HiveObjectDataset. +func (hod HiveObjectDataset) AsDataset() (*Dataset, bool) { + return nil, false +} + +// AsBasicDataset is the BasicDataset implementation for HiveObjectDataset. +func (hod HiveObjectDataset) AsBasicDataset() (BasicDataset, bool) { + return &hod, true +} + +// HiveSource a copy activity Hive Server source. +type HiveSource struct { + // Query - A query to retrieve data from source. Type: string (or Expression with resultType string). + Query interface{} `json:"query,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // SourceRetryCount - Source retry count. Type: integer (or Expression with resultType integer). + SourceRetryCount interface{} `json:"sourceRetryCount,omitempty"` + // SourceRetryWait - Source retry wait. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` + // Type - Possible values include: 'TypeCopySource', 'TypeAmazonRedshiftSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeHTTPSource', 'TypeAzureDataLakeStoreSource', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeRelationalSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource' + Type TypeBasicCopySource `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for HiveSource. +func (hs HiveSource) MarshalJSON() ([]byte, error) { + hs.Type = TypeHiveSource + objectMap := make(map[string]interface{}) + objectMap["query"] = hs.Query + objectMap["sourceRetryCount"] = hs.SourceRetryCount + objectMap["sourceRetryWait"] = hs.SourceRetryWait + if hs.Type != "" { + objectMap["type"] = hs.Type + } + for k, v := range hs.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsAmazonRedshiftSource is the BasicCopySource implementation for HiveSource. +func (hs HiveSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { + return nil, false +} + +// AsResponsysSource is the BasicCopySource implementation for HiveSource. +func (hs HiveSource) AsResponsysSource() (*ResponsysSource, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudSource is the BasicCopySource implementation for HiveSource. +func (hs HiveSource) AsSalesforceMarketingCloudSource() (*SalesforceMarketingCloudSource, bool) { + return nil, false +} + +// AsVerticaSource is the BasicCopySource implementation for HiveSource. +func (hs HiveSource) AsVerticaSource() (*VerticaSource, bool) { + return nil, false +} + +// AsNetezzaSource is the BasicCopySource implementation for HiveSource. +func (hs HiveSource) AsNetezzaSource() (*NetezzaSource, bool) { + return nil, false +} + +// AsZohoSource is the BasicCopySource implementation for HiveSource. +func (hs HiveSource) AsZohoSource() (*ZohoSource, bool) { + return nil, false +} + +// AsXeroSource is the BasicCopySource implementation for HiveSource. +func (hs HiveSource) AsXeroSource() (*XeroSource, bool) { + return nil, false +} + +// AsSquareSource is the BasicCopySource implementation for HiveSource. +func (hs HiveSource) AsSquareSource() (*SquareSource, bool) { + return nil, false +} + +// AsSparkSource is the BasicCopySource implementation for HiveSource. +func (hs HiveSource) AsSparkSource() (*SparkSource, bool) { + return nil, false +} + +// AsShopifySource is the BasicCopySource implementation for HiveSource. +func (hs HiveSource) AsShopifySource() (*ShopifySource, bool) { + return nil, false +} + +// AsServiceNowSource is the BasicCopySource implementation for HiveSource. +func (hs HiveSource) AsServiceNowSource() (*ServiceNowSource, bool) { + return nil, false +} + +// AsQuickBooksSource is the BasicCopySource implementation for HiveSource. +func (hs HiveSource) AsQuickBooksSource() (*QuickBooksSource, bool) { + return nil, false +} + +// AsPrestoSource is the BasicCopySource implementation for HiveSource. +func (hs HiveSource) AsPrestoSource() (*PrestoSource, bool) { + return nil, false +} + +// AsPhoenixSource is the BasicCopySource implementation for HiveSource. +func (hs HiveSource) AsPhoenixSource() (*PhoenixSource, bool) { + return nil, false +} + +// AsPaypalSource is the BasicCopySource implementation for HiveSource. +func (hs HiveSource) AsPaypalSource() (*PaypalSource, bool) { + return nil, false +} + +// AsMarketoSource is the BasicCopySource implementation for HiveSource. +func (hs HiveSource) AsMarketoSource() (*MarketoSource, bool) { + return nil, false +} + +// AsMariaDBSource is the BasicCopySource implementation for HiveSource. +func (hs HiveSource) AsMariaDBSource() (*MariaDBSource, bool) { + return nil, false +} + +// AsMagentoSource is the BasicCopySource implementation for HiveSource. +func (hs HiveSource) AsMagentoSource() (*MagentoSource, bool) { + return nil, false +} + +// AsJiraSource is the BasicCopySource implementation for HiveSource. +func (hs HiveSource) AsJiraSource() (*JiraSource, bool) { + return nil, false +} + +// AsImpalaSource is the BasicCopySource implementation for HiveSource. +func (hs HiveSource) AsImpalaSource() (*ImpalaSource, bool) { + return nil, false +} + +// AsHubspotSource is the BasicCopySource implementation for HiveSource. +func (hs HiveSource) AsHubspotSource() (*HubspotSource, bool) { + return nil, false +} + +// AsHiveSource is the BasicCopySource implementation for HiveSource. +func (hs HiveSource) AsHiveSource() (*HiveSource, bool) { + return &hs, true +} + +// AsHBaseSource is the BasicCopySource implementation for HiveSource. +func (hs HiveSource) AsHBaseSource() (*HBaseSource, bool) { + return nil, false +} + +// AsGreenplumSource is the BasicCopySource implementation for HiveSource. +func (hs HiveSource) AsGreenplumSource() (*GreenplumSource, bool) { + return nil, false +} + +// AsGoogleBigQuerySource is the BasicCopySource implementation for HiveSource. +func (hs HiveSource) AsGoogleBigQuerySource() (*GoogleBigQuerySource, bool) { + return nil, false +} + +// AsEloquaSource is the BasicCopySource implementation for HiveSource. +func (hs HiveSource) AsEloquaSource() (*EloquaSource, bool) { + return nil, false +} + +// AsDrillSource is the BasicCopySource implementation for HiveSource. +func (hs HiveSource) AsDrillSource() (*DrillSource, bool) { + return nil, false +} + +// AsCouchbaseSource is the BasicCopySource implementation for HiveSource. +func (hs HiveSource) AsCouchbaseSource() (*CouchbaseSource, bool) { + return nil, false +} + +// AsConcurSource is the BasicCopySource implementation for HiveSource. +func (hs HiveSource) AsConcurSource() (*ConcurSource, bool) { + return nil, false +} + +// AsAzurePostgreSQLSource is the BasicCopySource implementation for HiveSource. +func (hs HiveSource) AsAzurePostgreSQLSource() (*AzurePostgreSQLSource, bool) { + return nil, false +} + +// AsAmazonMWSSource is the BasicCopySource implementation for HiveSource. +func (hs HiveSource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { + return nil, false +} + +// AsHTTPSource is the BasicCopySource implementation for HiveSource. +func (hs HiveSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for HiveSource. +func (hs HiveSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for HiveSource. +func (hs HiveSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsCassandraSource is the BasicCopySource implementation for HiveSource. +func (hs HiveSource) AsCassandraSource() (*CassandraSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for HiveSource. +func (hs HiveSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for HiveSource. +func (hs HiveSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureMySQLSource is the BasicCopySource implementation for HiveSource. +func (hs HiveSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for HiveSource. +func (hs HiveSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for HiveSource. +func (hs HiveSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsSQLDWSource is the BasicCopySource implementation for HiveSource. +func (hs HiveSource) AsSQLDWSource() (*SQLDWSource, bool) { + return nil, false +} + +// AsSQLSource is the BasicCopySource implementation for HiveSource. +func (hs HiveSource) AsSQLSource() (*SQLSource, bool) { + return nil, false +} + +// AsSapEccSource is the BasicCopySource implementation for HiveSource. +func (hs HiveSource) AsSapEccSource() (*SapEccSource, bool) { + return nil, false +} + +// AsSapCloudForCustomerSource is the BasicCopySource implementation for HiveSource. +func (hs HiveSource) AsSapCloudForCustomerSource() (*SapCloudForCustomerSource, bool) { + return nil, false +} + +// AsSalesforceSource is the BasicCopySource implementation for HiveSource. +func (hs HiveSource) AsSalesforceSource() (*SalesforceSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for HiveSource. +func (hs HiveSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for HiveSource. +func (hs HiveSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for HiveSource. +func (hs HiveSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for HiveSource. +func (hs HiveSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + +// AsAzureTableSource is the BasicCopySource implementation for HiveSource. +func (hs HiveSource) AsAzureTableSource() (*AzureTableSource, bool) { + return nil, false +} + +// AsCopySource is the BasicCopySource implementation for HiveSource. +func (hs HiveSource) AsCopySource() (*CopySource, bool) { + return nil, false +} + +// AsBasicCopySource is the BasicCopySource implementation for HiveSource. +func (hs HiveSource) AsBasicCopySource() (BasicCopySource, bool) { + return &hs, true +} + +// HTTPDataset a file in an HTTP web server. +type HTTPDataset struct { + // HTTPDatasetTypeProperties - Properties specific to this dataset type. + *HTTPDatasetTypeProperties `json:"typeProperties,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Description - Dataset description. + Description *string `json:"description,omitempty"` + // Structure - Columns that define the structure of the dataset. Type: array (or Expression with resultType array), itemType: DatasetDataElement. + Structure interface{} `json:"structure,omitempty"` + // LinkedServiceName - Linked service reference. + LinkedServiceName *LinkedServiceReference `json:"linkedServiceName,omitempty"` + // Parameters - Parameters for dataset. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeDataset', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSQLServerTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSalesforceObject', 'TypeRelationalTable', 'TypeAzureMySQLTable', 'TypeOracleTable', 'TypeODataResource', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeAzureDataLakeStoreFile', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeAmazonS3Object' + Type TypeBasicDataset `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for HTTPDataset. +func (hd HTTPDataset) MarshalJSON() ([]byte, error) { + hd.Type = TypeHTTPFile + objectMap := make(map[string]interface{}) + if hd.HTTPDatasetTypeProperties != nil { + objectMap["typeProperties"] = hd.HTTPDatasetTypeProperties + } + if hd.Description != nil { + objectMap["description"] = hd.Description + } + objectMap["structure"] = hd.Structure + if hd.LinkedServiceName != nil { + objectMap["linkedServiceName"] = hd.LinkedServiceName + } + if hd.Parameters != nil { + objectMap["parameters"] = hd.Parameters + } + if hd.Annotations != nil { + objectMap["annotations"] = hd.Annotations + } + if hd.Type != "" { + objectMap["type"] = hd.Type + } + for k, v := range hd.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysObjectDataset is the BasicDataset implementation for HTTPDataset. +func (hd HTTPDataset) AsResponsysObjectDataset() (*ResponsysObjectDataset, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudObjectDataset is the BasicDataset implementation for HTTPDataset. +func (hd HTTPDataset) AsSalesforceMarketingCloudObjectDataset() (*SalesforceMarketingCloudObjectDataset, bool) { + return nil, false +} + +// AsVerticaTableDataset is the BasicDataset implementation for HTTPDataset. +func (hd HTTPDataset) AsVerticaTableDataset() (*VerticaTableDataset, bool) { + return nil, false +} + +// AsNetezzaTableDataset is the BasicDataset implementation for HTTPDataset. +func (hd HTTPDataset) AsNetezzaTableDataset() (*NetezzaTableDataset, bool) { + return nil, false +} + +// AsZohoObjectDataset is the BasicDataset implementation for HTTPDataset. +func (hd HTTPDataset) AsZohoObjectDataset() (*ZohoObjectDataset, bool) { + return nil, false +} + +// AsXeroObjectDataset is the BasicDataset implementation for HTTPDataset. +func (hd HTTPDataset) AsXeroObjectDataset() (*XeroObjectDataset, bool) { + return nil, false +} + +// AsSquareObjectDataset is the BasicDataset implementation for HTTPDataset. +func (hd HTTPDataset) AsSquareObjectDataset() (*SquareObjectDataset, bool) { + return nil, false +} + +// AsSparkObjectDataset is the BasicDataset implementation for HTTPDataset. +func (hd HTTPDataset) AsSparkObjectDataset() (*SparkObjectDataset, bool) { + return nil, false +} + +// AsShopifyObjectDataset is the BasicDataset implementation for HTTPDataset. +func (hd HTTPDataset) AsShopifyObjectDataset() (*ShopifyObjectDataset, bool) { + return nil, false +} + +// AsServiceNowObjectDataset is the BasicDataset implementation for HTTPDataset. +func (hd HTTPDataset) AsServiceNowObjectDataset() (*ServiceNowObjectDataset, bool) { + return nil, false +} + +// AsQuickBooksObjectDataset is the BasicDataset implementation for HTTPDataset. +func (hd HTTPDataset) AsQuickBooksObjectDataset() (*QuickBooksObjectDataset, bool) { + return nil, false +} + +// AsPrestoObjectDataset is the BasicDataset implementation for HTTPDataset. +func (hd HTTPDataset) AsPrestoObjectDataset() (*PrestoObjectDataset, bool) { + return nil, false +} + +// AsPhoenixObjectDataset is the BasicDataset implementation for HTTPDataset. +func (hd HTTPDataset) AsPhoenixObjectDataset() (*PhoenixObjectDataset, bool) { + return nil, false +} + +// AsPaypalObjectDataset is the BasicDataset implementation for HTTPDataset. +func (hd HTTPDataset) AsPaypalObjectDataset() (*PaypalObjectDataset, bool) { + return nil, false +} + +// AsMarketoObjectDataset is the BasicDataset implementation for HTTPDataset. +func (hd HTTPDataset) AsMarketoObjectDataset() (*MarketoObjectDataset, bool) { + return nil, false +} + +// AsMariaDBTableDataset is the BasicDataset implementation for HTTPDataset. +func (hd HTTPDataset) AsMariaDBTableDataset() (*MariaDBTableDataset, bool) { + return nil, false +} + +// AsMagentoObjectDataset is the BasicDataset implementation for HTTPDataset. +func (hd HTTPDataset) AsMagentoObjectDataset() (*MagentoObjectDataset, bool) { + return nil, false +} + +// AsJiraObjectDataset is the BasicDataset implementation for HTTPDataset. +func (hd HTTPDataset) AsJiraObjectDataset() (*JiraObjectDataset, bool) { + return nil, false +} + +// AsImpalaObjectDataset is the BasicDataset implementation for HTTPDataset. +func (hd HTTPDataset) AsImpalaObjectDataset() (*ImpalaObjectDataset, bool) { + return nil, false +} + +// AsHubspotObjectDataset is the BasicDataset implementation for HTTPDataset. +func (hd HTTPDataset) AsHubspotObjectDataset() (*HubspotObjectDataset, bool) { + return nil, false +} + +// AsHiveObjectDataset is the BasicDataset implementation for HTTPDataset. +func (hd HTTPDataset) AsHiveObjectDataset() (*HiveObjectDataset, bool) { + return nil, false +} + +// AsHBaseObjectDataset is the BasicDataset implementation for HTTPDataset. +func (hd HTTPDataset) AsHBaseObjectDataset() (*HBaseObjectDataset, bool) { + return nil, false +} + +// AsGreenplumTableDataset is the BasicDataset implementation for HTTPDataset. +func (hd HTTPDataset) AsGreenplumTableDataset() (*GreenplumTableDataset, bool) { + return nil, false +} + +// AsGoogleBigQueryObjectDataset is the BasicDataset implementation for HTTPDataset. +func (hd HTTPDataset) AsGoogleBigQueryObjectDataset() (*GoogleBigQueryObjectDataset, bool) { + return nil, false +} + +// AsEloquaObjectDataset is the BasicDataset implementation for HTTPDataset. +func (hd HTTPDataset) AsEloquaObjectDataset() (*EloquaObjectDataset, bool) { + return nil, false +} + +// AsDrillTableDataset is the BasicDataset implementation for HTTPDataset. +func (hd HTTPDataset) AsDrillTableDataset() (*DrillTableDataset, bool) { + return nil, false +} + +// AsCouchbaseTableDataset is the BasicDataset implementation for HTTPDataset. +func (hd HTTPDataset) AsCouchbaseTableDataset() (*CouchbaseTableDataset, bool) { + return nil, false +} + +// AsConcurObjectDataset is the BasicDataset implementation for HTTPDataset. +func (hd HTTPDataset) AsConcurObjectDataset() (*ConcurObjectDataset, bool) { + return nil, false +} + +// AsAzurePostgreSQLTableDataset is the BasicDataset implementation for HTTPDataset. +func (hd HTTPDataset) AsAzurePostgreSQLTableDataset() (*AzurePostgreSQLTableDataset, bool) { + return nil, false +} + +// AsAmazonMWSObjectDataset is the BasicDataset implementation for HTTPDataset. +func (hd HTTPDataset) AsAmazonMWSObjectDataset() (*AmazonMWSObjectDataset, bool) { + return nil, false +} + +// AsHTTPDataset is the BasicDataset implementation for HTTPDataset. +func (hd HTTPDataset) AsHTTPDataset() (*HTTPDataset, bool) { + return &hd, true +} + +// AsAzureSearchIndexDataset is the BasicDataset implementation for HTTPDataset. +func (hd HTTPDataset) AsAzureSearchIndexDataset() (*AzureSearchIndexDataset, bool) { + return nil, false +} + +// AsWebTableDataset is the BasicDataset implementation for HTTPDataset. +func (hd HTTPDataset) AsWebTableDataset() (*WebTableDataset, bool) { + return nil, false +} + +// AsSQLServerTableDataset is the BasicDataset implementation for HTTPDataset. +func (hd HTTPDataset) AsSQLServerTableDataset() (*SQLServerTableDataset, bool) { + return nil, false +} + +// AsSapEccResourceDataset is the BasicDataset implementation for HTTPDataset. +func (hd HTTPDataset) AsSapEccResourceDataset() (*SapEccResourceDataset, bool) { + return nil, false +} + +// AsSapCloudForCustomerResourceDataset is the BasicDataset implementation for HTTPDataset. +func (hd HTTPDataset) AsSapCloudForCustomerResourceDataset() (*SapCloudForCustomerResourceDataset, bool) { + return nil, false +} + +// AsSalesforceObjectDataset is the BasicDataset implementation for HTTPDataset. +func (hd HTTPDataset) AsSalesforceObjectDataset() (*SalesforceObjectDataset, bool) { + return nil, false +} + +// AsRelationalTableDataset is the BasicDataset implementation for HTTPDataset. +func (hd HTTPDataset) AsRelationalTableDataset() (*RelationalTableDataset, bool) { + return nil, false +} + +// AsAzureMySQLTableDataset is the BasicDataset implementation for HTTPDataset. +func (hd HTTPDataset) AsAzureMySQLTableDataset() (*AzureMySQLTableDataset, bool) { + return nil, false +} + +// AsOracleTableDataset is the BasicDataset implementation for HTTPDataset. +func (hd HTTPDataset) AsOracleTableDataset() (*OracleTableDataset, bool) { + return nil, false +} + +// AsODataResourceDataset is the BasicDataset implementation for HTTPDataset. +func (hd HTTPDataset) AsODataResourceDataset() (*ODataResourceDataset, bool) { + return nil, false +} + +// AsMongoDbCollectionDataset is the BasicDataset implementation for HTTPDataset. +func (hd HTTPDataset) AsMongoDbCollectionDataset() (*MongoDbCollectionDataset, bool) { + return nil, false +} + +// AsFileShareDataset is the BasicDataset implementation for HTTPDataset. +func (hd HTTPDataset) AsFileShareDataset() (*FileShareDataset, bool) { + return nil, false +} + +// AsAzureDataLakeStoreDataset is the BasicDataset implementation for HTTPDataset. +func (hd HTTPDataset) AsAzureDataLakeStoreDataset() (*AzureDataLakeStoreDataset, bool) { + return nil, false +} + +// AsDynamicsEntityDataset is the BasicDataset implementation for HTTPDataset. +func (hd HTTPDataset) AsDynamicsEntityDataset() (*DynamicsEntityDataset, bool) { + return nil, false +} + +// AsDocumentDbCollectionDataset is the BasicDataset implementation for HTTPDataset. +func (hd HTTPDataset) AsDocumentDbCollectionDataset() (*DocumentDbCollectionDataset, bool) { + return nil, false +} + +// AsCustomDataset is the BasicDataset implementation for HTTPDataset. +func (hd HTTPDataset) AsCustomDataset() (*CustomDataset, bool) { + return nil, false +} + +// AsCassandraTableDataset is the BasicDataset implementation for HTTPDataset. +func (hd HTTPDataset) AsCassandraTableDataset() (*CassandraTableDataset, bool) { + return nil, false +} + +// AsAzureSQLDWTableDataset is the BasicDataset implementation for HTTPDataset. +func (hd HTTPDataset) AsAzureSQLDWTableDataset() (*AzureSQLDWTableDataset, bool) { + return nil, false +} + +// AsAzureSQLTableDataset is the BasicDataset implementation for HTTPDataset. +func (hd HTTPDataset) AsAzureSQLTableDataset() (*AzureSQLTableDataset, bool) { + return nil, false +} + +// AsAzureTableDataset is the BasicDataset implementation for HTTPDataset. +func (hd HTTPDataset) AsAzureTableDataset() (*AzureTableDataset, bool) { + return nil, false +} + +// AsAzureBlobDataset is the BasicDataset implementation for HTTPDataset. +func (hd HTTPDataset) AsAzureBlobDataset() (*AzureBlobDataset, bool) { + return nil, false +} + +// AsAmazonS3Dataset is the BasicDataset implementation for HTTPDataset. +func (hd HTTPDataset) AsAmazonS3Dataset() (*AmazonS3Dataset, bool) { + return nil, false +} + +// AsDataset is the BasicDataset implementation for HTTPDataset. +func (hd HTTPDataset) AsDataset() (*Dataset, bool) { + return nil, false +} + +// AsBasicDataset is the BasicDataset implementation for HTTPDataset. +func (hd HTTPDataset) AsBasicDataset() (BasicDataset, bool) { + return &hd, true +} + +// UnmarshalJSON is the custom unmarshaler for HTTPDataset struct. +func (hd *HTTPDataset) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "typeProperties": + if v != nil { + var HTTPDatasetTypeProperties HTTPDatasetTypeProperties + err = json.Unmarshal(*v, &HTTPDatasetTypeProperties) + if err != nil { + return err + } + hd.HTTPDatasetTypeProperties = &HTTPDatasetTypeProperties + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if hd.AdditionalProperties == nil { + hd.AdditionalProperties = make(map[string]interface{}) + } + hd.AdditionalProperties[k] = additionalProperties + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + hd.Description = &description + } + case "structure": + if v != nil { + var structure interface{} + err = json.Unmarshal(*v, &structure) + if err != nil { + return err + } + hd.Structure = structure + } + case "linkedServiceName": + if v != nil { + var linkedServiceName LinkedServiceReference + err = json.Unmarshal(*v, &linkedServiceName) + if err != nil { + return err + } + hd.LinkedServiceName = &linkedServiceName + } + case "parameters": + if v != nil { + var parameters map[string]*ParameterSpecification + err = json.Unmarshal(*v, ¶meters) + if err != nil { + return err + } + hd.Parameters = parameters + } + case "annotations": + if v != nil { + var annotations []interface{} + err = json.Unmarshal(*v, &annotations) + if err != nil { + return err + } + hd.Annotations = &annotations + } + case "type": + if v != nil { + var typeVar TypeBasicDataset + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + hd.Type = typeVar + } + } + } + + return nil +} + +// HTTPDatasetTypeProperties properties specific to this dataset type. +type HTTPDatasetTypeProperties struct { + // RelativeURL - The relative URL based on the URL in the HttpLinkedService refers to an HTTP file Type: string (or Expression with resultType string). + RelativeURL interface{} `json:"relativeUrl,omitempty"` + // RequestMethod - The HTTP method for the HTTP request. Type: string (or Expression with resultType string). + RequestMethod interface{} `json:"requestMethod,omitempty"` + // RequestBody - The body for the HTTP request. Type: string (or Expression with resultType string). + RequestBody interface{} `json:"requestBody,omitempty"` + // AdditionalHeaders - The headers for the HTTP Request. e.g. request-header-name-1:request-header-value-1 + // ... + // request-header-name-n:request-header-value-n Type: string (or Expression with resultType string). + AdditionalHeaders interface{} `json:"additionalHeaders,omitempty"` + // Format - The format of files. + Format BasicDatasetStorageFormat `json:"format,omitempty"` + // Compression - The data compression method used on files. + Compression BasicDatasetCompression `json:"compression,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for HTTPDatasetTypeProperties struct. +func (hdtp *HTTPDatasetTypeProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "relativeUrl": + if v != nil { + var relativeURL interface{} + err = json.Unmarshal(*v, &relativeURL) + if err != nil { + return err + } + hdtp.RelativeURL = relativeURL + } + case "requestMethod": + if v != nil { + var requestMethod interface{} + err = json.Unmarshal(*v, &requestMethod) + if err != nil { + return err + } + hdtp.RequestMethod = requestMethod + } + case "requestBody": + if v != nil { + var requestBody interface{} + err = json.Unmarshal(*v, &requestBody) + if err != nil { + return err + } + hdtp.RequestBody = requestBody + } + case "additionalHeaders": + if v != nil { + var additionalHeaders interface{} + err = json.Unmarshal(*v, &additionalHeaders) + if err != nil { + return err + } + hdtp.AdditionalHeaders = additionalHeaders + } + case "format": + if v != nil { + formatVar, err := unmarshalBasicDatasetStorageFormat(*v) + if err != nil { + return err + } + hdtp.Format = formatVar + } + case "compression": + if v != nil { + compression, err := unmarshalBasicDatasetCompression(*v) + if err != nil { + return err + } + hdtp.Compression = compression + } + } + } + + return nil +} + +// HTTPLinkedService linked service for an HTTP source. +type HTTPLinkedService struct { + // HTTPLinkedServiceTypeProperties - Properties specific to this linked service type. + *HTTPLinkedServiceTypeProperties `json:"typeProperties,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // ConnectVia - The integration runtime reference. + ConnectVia *IntegrationRuntimeReference `json:"connectVia,omitempty"` + // Description - Linked service description. + Description *string `json:"description,omitempty"` + // Parameters - Parameters for linked service. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeLinkedService', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforce', 'TypeAzureDataLakeStore', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureStorage' + Type TypeBasicLinkedService `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for HTTPLinkedService. +func (hls HTTPLinkedService) MarshalJSON() ([]byte, error) { + hls.Type = TypeHTTPServer + objectMap := make(map[string]interface{}) + if hls.HTTPLinkedServiceTypeProperties != nil { + objectMap["typeProperties"] = hls.HTTPLinkedServiceTypeProperties + } + if hls.ConnectVia != nil { + objectMap["connectVia"] = hls.ConnectVia + } + if hls.Description != nil { + objectMap["description"] = hls.Description + } + if hls.Parameters != nil { + objectMap["parameters"] = hls.Parameters + } + if hls.Annotations != nil { + objectMap["annotations"] = hls.Annotations + } + if hls.Type != "" { + objectMap["type"] = hls.Type + } + for k, v := range hls.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysLinkedService is the BasicLinkedService implementation for HTTPLinkedService. +func (hls HTTPLinkedService) AsResponsysLinkedService() (*ResponsysLinkedService, bool) { + return nil, false +} + +// AsAzureDatabricksLinkedService is the BasicLinkedService implementation for HTTPLinkedService. +func (hls HTTPLinkedService) AsAzureDatabricksLinkedService() (*AzureDatabricksLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeAnalyticsLinkedService is the BasicLinkedService implementation for HTTPLinkedService. +func (hls HTTPLinkedService) AsAzureDataLakeAnalyticsLinkedService() (*AzureDataLakeAnalyticsLinkedService, bool) { + return nil, false +} + +// AsHDInsightOnDemandLinkedService is the BasicLinkedService implementation for HTTPLinkedService. +func (hls HTTPLinkedService) AsHDInsightOnDemandLinkedService() (*HDInsightOnDemandLinkedService, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudLinkedService is the BasicLinkedService implementation for HTTPLinkedService. +func (hls HTTPLinkedService) AsSalesforceMarketingCloudLinkedService() (*SalesforceMarketingCloudLinkedService, bool) { + return nil, false +} + +// AsNetezzaLinkedService is the BasicLinkedService implementation for HTTPLinkedService. +func (hls HTTPLinkedService) AsNetezzaLinkedService() (*NetezzaLinkedService, bool) { + return nil, false +} + +// AsVerticaLinkedService is the BasicLinkedService implementation for HTTPLinkedService. +func (hls HTTPLinkedService) AsVerticaLinkedService() (*VerticaLinkedService, bool) { + return nil, false +} + +// AsZohoLinkedService is the BasicLinkedService implementation for HTTPLinkedService. +func (hls HTTPLinkedService) AsZohoLinkedService() (*ZohoLinkedService, bool) { + return nil, false +} + +// AsXeroLinkedService is the BasicLinkedService implementation for HTTPLinkedService. +func (hls HTTPLinkedService) AsXeroLinkedService() (*XeroLinkedService, bool) { + return nil, false +} + +// AsSquareLinkedService is the BasicLinkedService implementation for HTTPLinkedService. +func (hls HTTPLinkedService) AsSquareLinkedService() (*SquareLinkedService, bool) { + return nil, false +} + +// AsSparkLinkedService is the BasicLinkedService implementation for HTTPLinkedService. +func (hls HTTPLinkedService) AsSparkLinkedService() (*SparkLinkedService, bool) { + return nil, false +} + +// AsShopifyLinkedService is the BasicLinkedService implementation for HTTPLinkedService. +func (hls HTTPLinkedService) AsShopifyLinkedService() (*ShopifyLinkedService, bool) { + return nil, false +} + +// AsServiceNowLinkedService is the BasicLinkedService implementation for HTTPLinkedService. +func (hls HTTPLinkedService) AsServiceNowLinkedService() (*ServiceNowLinkedService, bool) { + return nil, false +} + +// AsQuickBooksLinkedService is the BasicLinkedService implementation for HTTPLinkedService. +func (hls HTTPLinkedService) AsQuickBooksLinkedService() (*QuickBooksLinkedService, bool) { + return nil, false +} + +// AsPrestoLinkedService is the BasicLinkedService implementation for HTTPLinkedService. +func (hls HTTPLinkedService) AsPrestoLinkedService() (*PrestoLinkedService, bool) { + return nil, false +} + +// AsPhoenixLinkedService is the BasicLinkedService implementation for HTTPLinkedService. +func (hls HTTPLinkedService) AsPhoenixLinkedService() (*PhoenixLinkedService, bool) { + return nil, false +} + +// AsPaypalLinkedService is the BasicLinkedService implementation for HTTPLinkedService. +func (hls HTTPLinkedService) AsPaypalLinkedService() (*PaypalLinkedService, bool) { + return nil, false +} + +// AsMarketoLinkedService is the BasicLinkedService implementation for HTTPLinkedService. +func (hls HTTPLinkedService) AsMarketoLinkedService() (*MarketoLinkedService, bool) { + return nil, false +} + +// AsMariaDBLinkedService is the BasicLinkedService implementation for HTTPLinkedService. +func (hls HTTPLinkedService) AsMariaDBLinkedService() (*MariaDBLinkedService, bool) { + return nil, false +} + +// AsMagentoLinkedService is the BasicLinkedService implementation for HTTPLinkedService. +func (hls HTTPLinkedService) AsMagentoLinkedService() (*MagentoLinkedService, bool) { + return nil, false +} + +// AsJiraLinkedService is the BasicLinkedService implementation for HTTPLinkedService. +func (hls HTTPLinkedService) AsJiraLinkedService() (*JiraLinkedService, bool) { + return nil, false +} + +// AsImpalaLinkedService is the BasicLinkedService implementation for HTTPLinkedService. +func (hls HTTPLinkedService) AsImpalaLinkedService() (*ImpalaLinkedService, bool) { + return nil, false +} + +// AsHubspotLinkedService is the BasicLinkedService implementation for HTTPLinkedService. +func (hls HTTPLinkedService) AsHubspotLinkedService() (*HubspotLinkedService, bool) { + return nil, false +} + +// AsHiveLinkedService is the BasicLinkedService implementation for HTTPLinkedService. +func (hls HTTPLinkedService) AsHiveLinkedService() (*HiveLinkedService, bool) { + return nil, false +} + +// AsHBaseLinkedService is the BasicLinkedService implementation for HTTPLinkedService. +func (hls HTTPLinkedService) AsHBaseLinkedService() (*HBaseLinkedService, bool) { + return nil, false +} + +// AsGreenplumLinkedService is the BasicLinkedService implementation for HTTPLinkedService. +func (hls HTTPLinkedService) AsGreenplumLinkedService() (*GreenplumLinkedService, bool) { + return nil, false +} + +// AsGoogleBigQueryLinkedService is the BasicLinkedService implementation for HTTPLinkedService. +func (hls HTTPLinkedService) AsGoogleBigQueryLinkedService() (*GoogleBigQueryLinkedService, bool) { + return nil, false +} + +// AsEloquaLinkedService is the BasicLinkedService implementation for HTTPLinkedService. +func (hls HTTPLinkedService) AsEloquaLinkedService() (*EloquaLinkedService, bool) { + return nil, false +} + +// AsDrillLinkedService is the BasicLinkedService implementation for HTTPLinkedService. +func (hls HTTPLinkedService) AsDrillLinkedService() (*DrillLinkedService, bool) { + return nil, false +} + +// AsCouchbaseLinkedService is the BasicLinkedService implementation for HTTPLinkedService. +func (hls HTTPLinkedService) AsCouchbaseLinkedService() (*CouchbaseLinkedService, bool) { + return nil, false +} + +// AsConcurLinkedService is the BasicLinkedService implementation for HTTPLinkedService. +func (hls HTTPLinkedService) AsConcurLinkedService() (*ConcurLinkedService, bool) { + return nil, false +} + +// AsAzurePostgreSQLLinkedService is the BasicLinkedService implementation for HTTPLinkedService. +func (hls HTTPLinkedService) AsAzurePostgreSQLLinkedService() (*AzurePostgreSQLLinkedService, bool) { + return nil, false +} + +// AsAmazonMWSLinkedService is the BasicLinkedService implementation for HTTPLinkedService. +func (hls HTTPLinkedService) AsAmazonMWSLinkedService() (*AmazonMWSLinkedService, bool) { + return nil, false +} + +// AsSapHanaLinkedService is the BasicLinkedService implementation for HTTPLinkedService. +func (hls HTTPLinkedService) AsSapHanaLinkedService() (*SapHanaLinkedService, bool) { + return nil, false +} + +// AsSapBWLinkedService is the BasicLinkedService implementation for HTTPLinkedService. +func (hls HTTPLinkedService) AsSapBWLinkedService() (*SapBWLinkedService, bool) { + return nil, false +} + +// AsSftpServerLinkedService is the BasicLinkedService implementation for HTTPLinkedService. +func (hls HTTPLinkedService) AsSftpServerLinkedService() (*SftpServerLinkedService, bool) { + return nil, false +} + +// AsFtpServerLinkedService is the BasicLinkedService implementation for HTTPLinkedService. +func (hls HTTPLinkedService) AsFtpServerLinkedService() (*FtpServerLinkedService, bool) { + return nil, false +} + +// AsHTTPLinkedService is the BasicLinkedService implementation for HTTPLinkedService. +func (hls HTTPLinkedService) AsHTTPLinkedService() (*HTTPLinkedService, bool) { + return &hls, true +} + +// AsAzureSearchLinkedService is the BasicLinkedService implementation for HTTPLinkedService. +func (hls HTTPLinkedService) AsAzureSearchLinkedService() (*AzureSearchLinkedService, bool) { + return nil, false +} + +// AsCustomDataSourceLinkedService is the BasicLinkedService implementation for HTTPLinkedService. +func (hls HTTPLinkedService) AsCustomDataSourceLinkedService() (*CustomDataSourceLinkedService, bool) { + return nil, false +} + +// AsAmazonRedshiftLinkedService is the BasicLinkedService implementation for HTTPLinkedService. +func (hls HTTPLinkedService) AsAmazonRedshiftLinkedService() (*AmazonRedshiftLinkedService, bool) { + return nil, false +} + +// AsAmazonS3LinkedService is the BasicLinkedService implementation for HTTPLinkedService. +func (hls HTTPLinkedService) AsAmazonS3LinkedService() (*AmazonS3LinkedService, bool) { + return nil, false +} + +// AsSapEccLinkedService is the BasicLinkedService implementation for HTTPLinkedService. +func (hls HTTPLinkedService) AsSapEccLinkedService() (*SapEccLinkedService, bool) { + return nil, false +} + +// AsSapCloudForCustomerLinkedService is the BasicLinkedService implementation for HTTPLinkedService. +func (hls HTTPLinkedService) AsSapCloudForCustomerLinkedService() (*SapCloudForCustomerLinkedService, bool) { + return nil, false +} + +// AsSalesforceLinkedService is the BasicLinkedService implementation for HTTPLinkedService. +func (hls HTTPLinkedService) AsSalesforceLinkedService() (*SalesforceLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeStoreLinkedService is the BasicLinkedService implementation for HTTPLinkedService. +func (hls HTTPLinkedService) AsAzureDataLakeStoreLinkedService() (*AzureDataLakeStoreLinkedService, bool) { + return nil, false +} + +// AsMongoDbLinkedService is the BasicLinkedService implementation for HTTPLinkedService. +func (hls HTTPLinkedService) AsMongoDbLinkedService() (*MongoDbLinkedService, bool) { + return nil, false +} + +// AsCassandraLinkedService is the BasicLinkedService implementation for HTTPLinkedService. +func (hls HTTPLinkedService) AsCassandraLinkedService() (*CassandraLinkedService, bool) { + return nil, false +} + +// AsWebLinkedService is the BasicLinkedService implementation for HTTPLinkedService. +func (hls HTTPLinkedService) AsWebLinkedService() (*WebLinkedService, bool) { + return nil, false +} + +// AsODataLinkedService is the BasicLinkedService implementation for HTTPLinkedService. +func (hls HTTPLinkedService) AsODataLinkedService() (*ODataLinkedService, bool) { + return nil, false +} + +// AsHdfsLinkedService is the BasicLinkedService implementation for HTTPLinkedService. +func (hls HTTPLinkedService) AsHdfsLinkedService() (*HdfsLinkedService, bool) { + return nil, false +} + +// AsOdbcLinkedService is the BasicLinkedService implementation for HTTPLinkedService. +func (hls HTTPLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, bool) { + return nil, false +} + +// AsAzureMLLinkedService is the BasicLinkedService implementation for HTTPLinkedService. +func (hls HTTPLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { + return nil, false +} + +// AsTeradataLinkedService is the BasicLinkedService implementation for HTTPLinkedService. +func (hls HTTPLinkedService) AsTeradataLinkedService() (*TeradataLinkedService, bool) { + return nil, false +} + +// AsDb2LinkedService is the BasicLinkedService implementation for HTTPLinkedService. +func (hls HTTPLinkedService) AsDb2LinkedService() (*Db2LinkedService, bool) { + return nil, false +} + +// AsSybaseLinkedService is the BasicLinkedService implementation for HTTPLinkedService. +func (hls HTTPLinkedService) AsSybaseLinkedService() (*SybaseLinkedService, bool) { + return nil, false +} + +// AsPostgreSQLLinkedService is the BasicLinkedService implementation for HTTPLinkedService. +func (hls HTTPLinkedService) AsPostgreSQLLinkedService() (*PostgreSQLLinkedService, bool) { + return nil, false +} + +// AsMySQLLinkedService is the BasicLinkedService implementation for HTTPLinkedService. +func (hls HTTPLinkedService) AsMySQLLinkedService() (*MySQLLinkedService, bool) { + return nil, false +} + +// AsAzureMySQLLinkedService is the BasicLinkedService implementation for HTTPLinkedService. +func (hls HTTPLinkedService) AsAzureMySQLLinkedService() (*AzureMySQLLinkedService, bool) { + return nil, false +} + +// AsOracleLinkedService is the BasicLinkedService implementation for HTTPLinkedService. +func (hls HTTPLinkedService) AsOracleLinkedService() (*OracleLinkedService, bool) { + return nil, false +} + +// AsFileServerLinkedService is the BasicLinkedService implementation for HTTPLinkedService. +func (hls HTTPLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { + return nil, false +} + +// AsHDInsightLinkedService is the BasicLinkedService implementation for HTTPLinkedService. +func (hls HTTPLinkedService) AsHDInsightLinkedService() (*HDInsightLinkedService, bool) { + return nil, false +} + +// AsDynamicsLinkedService is the BasicLinkedService implementation for HTTPLinkedService. +func (hls HTTPLinkedService) AsDynamicsLinkedService() (*DynamicsLinkedService, bool) { + return nil, false +} + +// AsCosmosDbLinkedService is the BasicLinkedService implementation for HTTPLinkedService. +func (hls HTTPLinkedService) AsCosmosDbLinkedService() (*CosmosDbLinkedService, bool) { + return nil, false +} + +// AsAzureKeyVaultLinkedService is the BasicLinkedService implementation for HTTPLinkedService. +func (hls HTTPLinkedService) AsAzureKeyVaultLinkedService() (*AzureKeyVaultLinkedService, bool) { + return nil, false +} + +// AsAzureBatchLinkedService is the BasicLinkedService implementation for HTTPLinkedService. +func (hls HTTPLinkedService) AsAzureBatchLinkedService() (*AzureBatchLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDatabaseLinkedService is the BasicLinkedService implementation for HTTPLinkedService. +func (hls HTTPLinkedService) AsAzureSQLDatabaseLinkedService() (*AzureSQLDatabaseLinkedService, bool) { + return nil, false +} + +// AsSQLServerLinkedService is the BasicLinkedService implementation for HTTPLinkedService. +func (hls HTTPLinkedService) AsSQLServerLinkedService() (*SQLServerLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDWLinkedService is the BasicLinkedService implementation for HTTPLinkedService. +func (hls HTTPLinkedService) AsAzureSQLDWLinkedService() (*AzureSQLDWLinkedService, bool) { + return nil, false +} + +// AsAzureStorageLinkedService is the BasicLinkedService implementation for HTTPLinkedService. +func (hls HTTPLinkedService) AsAzureStorageLinkedService() (*AzureStorageLinkedService, bool) { + return nil, false +} + +// AsLinkedService is the BasicLinkedService implementation for HTTPLinkedService. +func (hls HTTPLinkedService) AsLinkedService() (*LinkedService, bool) { + return nil, false +} + +// AsBasicLinkedService is the BasicLinkedService implementation for HTTPLinkedService. +func (hls HTTPLinkedService) AsBasicLinkedService() (BasicLinkedService, bool) { + return &hls, true +} + +// UnmarshalJSON is the custom unmarshaler for HTTPLinkedService struct. +func (hls *HTTPLinkedService) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "typeProperties": + if v != nil { + var HTTPLinkedServiceTypeProperties HTTPLinkedServiceTypeProperties + err = json.Unmarshal(*v, &HTTPLinkedServiceTypeProperties) + if err != nil { + return err + } + hls.HTTPLinkedServiceTypeProperties = &HTTPLinkedServiceTypeProperties + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if hls.AdditionalProperties == nil { + hls.AdditionalProperties = make(map[string]interface{}) + } + hls.AdditionalProperties[k] = additionalProperties + } + case "connectVia": + if v != nil { + var connectVia IntegrationRuntimeReference + err = json.Unmarshal(*v, &connectVia) + if err != nil { + return err + } + hls.ConnectVia = &connectVia + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + hls.Description = &description + } + case "parameters": + if v != nil { + var parameters map[string]*ParameterSpecification + err = json.Unmarshal(*v, ¶meters) + if err != nil { + return err + } + hls.Parameters = parameters + } + case "annotations": + if v != nil { + var annotations []interface{} + err = json.Unmarshal(*v, &annotations) + if err != nil { + return err + } + hls.Annotations = &annotations + } + case "type": + if v != nil { + var typeVar TypeBasicLinkedService + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + hls.Type = typeVar + } + } + } + + return nil +} + +// HTTPLinkedServiceTypeProperties properties specific to this linked service type. +type HTTPLinkedServiceTypeProperties struct { + // URL - The base URL of the HTTP endpoint, e.g. http://www.microsoft.com. Type: string (or Expression with resultType string). + URL interface{} `json:"url,omitempty"` + // AuthenticationType - The authentication type to be used to connect to the HTTP server. Possible values include: 'HTTPAuthenticationTypeBasic', 'HTTPAuthenticationTypeAnonymous', 'HTTPAuthenticationTypeDigest', 'HTTPAuthenticationTypeWindows', 'HTTPAuthenticationTypeClientCertificate' + AuthenticationType HTTPAuthenticationType `json:"authenticationType,omitempty"` + // UserName - User name for Basic, Digest, or Windows authentication. Type: string (or Expression with resultType string). + UserName interface{} `json:"userName,omitempty"` + // Password - Password for Basic, Digest, Windows, or ClientCertificate with EmbeddedCertData authentication. + Password BasicSecretBase `json:"password,omitempty"` + // EmbeddedCertData - Base64 encoded certificate data for ClientCertificate authentication. For on-premises copy with ClientCertificate authentication, either CertThumbprint or EmbeddedCertData/Password should be specified. Type: string (or Expression with resultType string). + EmbeddedCertData interface{} `json:"embeddedCertData,omitempty"` + // CertThumbprint - Thumbprint of certificate for ClientCertificate authentication. Only valid for on-premises copy. For on-premises copy with ClientCertificate authentication, either CertThumbprint or EmbeddedCertData/Password should be specified. Type: string (or Expression with resultType string). + CertThumbprint interface{} `json:"certThumbprint,omitempty"` + // EncryptedCredential - The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string). + EncryptedCredential interface{} `json:"encryptedCredential,omitempty"` + // EnableServerCertificateValidation - If true, validate the HTTPS server SSL certificate. Default value is true. Type: boolean (or Expression with resultType boolean). + EnableServerCertificateValidation interface{} `json:"enableServerCertificateValidation,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for HTTPLinkedServiceTypeProperties struct. +func (hlstp *HTTPLinkedServiceTypeProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "url": + if v != nil { + var URL interface{} + err = json.Unmarshal(*v, &URL) + if err != nil { + return err + } + hlstp.URL = URL + } + case "authenticationType": + if v != nil { + var authenticationType HTTPAuthenticationType + err = json.Unmarshal(*v, &authenticationType) + if err != nil { + return err + } + hlstp.AuthenticationType = authenticationType + } + case "userName": + if v != nil { + var userName interface{} + err = json.Unmarshal(*v, &userName) + if err != nil { + return err + } + hlstp.UserName = userName + } + case "password": + if v != nil { + password, err := unmarshalBasicSecretBase(*v) + if err != nil { + return err + } + hlstp.Password = password + } + case "embeddedCertData": + if v != nil { + var embeddedCertData interface{} + err = json.Unmarshal(*v, &embeddedCertData) + if err != nil { + return err + } + hlstp.EmbeddedCertData = embeddedCertData + } + case "certThumbprint": + if v != nil { + var certThumbprint interface{} + err = json.Unmarshal(*v, &certThumbprint) + if err != nil { + return err + } + hlstp.CertThumbprint = certThumbprint + } + case "encryptedCredential": + if v != nil { + var encryptedCredential interface{} + err = json.Unmarshal(*v, &encryptedCredential) + if err != nil { + return err + } + hlstp.EncryptedCredential = encryptedCredential + } + case "enableServerCertificateValidation": + if v != nil { + var enableServerCertificateValidation interface{} + err = json.Unmarshal(*v, &enableServerCertificateValidation) + if err != nil { + return err + } + hlstp.EnableServerCertificateValidation = enableServerCertificateValidation + } + } + } + + return nil +} + +// HTTPSource a copy activity source for an HTTP file. +type HTTPSource struct { + // HTTPRequestTimeout - Specifies the timeout for a HTTP client to get HTTP response from HTTP server. The default value is equivalent to System.Net.HttpWebRequest.Timeout. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + HTTPRequestTimeout interface{} `json:"httpRequestTimeout,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // SourceRetryCount - Source retry count. Type: integer (or Expression with resultType integer). + SourceRetryCount interface{} `json:"sourceRetryCount,omitempty"` + // SourceRetryWait - Source retry wait. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` + // Type - Possible values include: 'TypeCopySource', 'TypeAmazonRedshiftSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeHTTPSource', 'TypeAzureDataLakeStoreSource', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeRelationalSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource' + Type TypeBasicCopySource `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for HTTPSource. +func (hs HTTPSource) MarshalJSON() ([]byte, error) { + hs.Type = TypeHTTPSource + objectMap := make(map[string]interface{}) + objectMap["httpRequestTimeout"] = hs.HTTPRequestTimeout + objectMap["sourceRetryCount"] = hs.SourceRetryCount + objectMap["sourceRetryWait"] = hs.SourceRetryWait + if hs.Type != "" { + objectMap["type"] = hs.Type + } + for k, v := range hs.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsAmazonRedshiftSource is the BasicCopySource implementation for HTTPSource. +func (hs HTTPSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { + return nil, false +} + +// AsResponsysSource is the BasicCopySource implementation for HTTPSource. +func (hs HTTPSource) AsResponsysSource() (*ResponsysSource, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudSource is the BasicCopySource implementation for HTTPSource. +func (hs HTTPSource) AsSalesforceMarketingCloudSource() (*SalesforceMarketingCloudSource, bool) { + return nil, false +} + +// AsVerticaSource is the BasicCopySource implementation for HTTPSource. +func (hs HTTPSource) AsVerticaSource() (*VerticaSource, bool) { + return nil, false +} + +// AsNetezzaSource is the BasicCopySource implementation for HTTPSource. +func (hs HTTPSource) AsNetezzaSource() (*NetezzaSource, bool) { + return nil, false +} + +// AsZohoSource is the BasicCopySource implementation for HTTPSource. +func (hs HTTPSource) AsZohoSource() (*ZohoSource, bool) { + return nil, false +} + +// AsXeroSource is the BasicCopySource implementation for HTTPSource. +func (hs HTTPSource) AsXeroSource() (*XeroSource, bool) { + return nil, false +} + +// AsSquareSource is the BasicCopySource implementation for HTTPSource. +func (hs HTTPSource) AsSquareSource() (*SquareSource, bool) { + return nil, false +} + +// AsSparkSource is the BasicCopySource implementation for HTTPSource. +func (hs HTTPSource) AsSparkSource() (*SparkSource, bool) { + return nil, false +} + +// AsShopifySource is the BasicCopySource implementation for HTTPSource. +func (hs HTTPSource) AsShopifySource() (*ShopifySource, bool) { + return nil, false +} + +// AsServiceNowSource is the BasicCopySource implementation for HTTPSource. +func (hs HTTPSource) AsServiceNowSource() (*ServiceNowSource, bool) { + return nil, false +} + +// AsQuickBooksSource is the BasicCopySource implementation for HTTPSource. +func (hs HTTPSource) AsQuickBooksSource() (*QuickBooksSource, bool) { + return nil, false +} + +// AsPrestoSource is the BasicCopySource implementation for HTTPSource. +func (hs HTTPSource) AsPrestoSource() (*PrestoSource, bool) { + return nil, false +} + +// AsPhoenixSource is the BasicCopySource implementation for HTTPSource. +func (hs HTTPSource) AsPhoenixSource() (*PhoenixSource, bool) { + return nil, false +} + +// AsPaypalSource is the BasicCopySource implementation for HTTPSource. +func (hs HTTPSource) AsPaypalSource() (*PaypalSource, bool) { + return nil, false +} + +// AsMarketoSource is the BasicCopySource implementation for HTTPSource. +func (hs HTTPSource) AsMarketoSource() (*MarketoSource, bool) { + return nil, false +} + +// AsMariaDBSource is the BasicCopySource implementation for HTTPSource. +func (hs HTTPSource) AsMariaDBSource() (*MariaDBSource, bool) { + return nil, false +} + +// AsMagentoSource is the BasicCopySource implementation for HTTPSource. +func (hs HTTPSource) AsMagentoSource() (*MagentoSource, bool) { + return nil, false +} + +// AsJiraSource is the BasicCopySource implementation for HTTPSource. +func (hs HTTPSource) AsJiraSource() (*JiraSource, bool) { + return nil, false +} + +// AsImpalaSource is the BasicCopySource implementation for HTTPSource. +func (hs HTTPSource) AsImpalaSource() (*ImpalaSource, bool) { + return nil, false +} + +// AsHubspotSource is the BasicCopySource implementation for HTTPSource. +func (hs HTTPSource) AsHubspotSource() (*HubspotSource, bool) { + return nil, false +} + +// AsHiveSource is the BasicCopySource implementation for HTTPSource. +func (hs HTTPSource) AsHiveSource() (*HiveSource, bool) { + return nil, false +} + +// AsHBaseSource is the BasicCopySource implementation for HTTPSource. +func (hs HTTPSource) AsHBaseSource() (*HBaseSource, bool) { + return nil, false +} + +// AsGreenplumSource is the BasicCopySource implementation for HTTPSource. +func (hs HTTPSource) AsGreenplumSource() (*GreenplumSource, bool) { + return nil, false +} + +// AsGoogleBigQuerySource is the BasicCopySource implementation for HTTPSource. +func (hs HTTPSource) AsGoogleBigQuerySource() (*GoogleBigQuerySource, bool) { + return nil, false +} + +// AsEloquaSource is the BasicCopySource implementation for HTTPSource. +func (hs HTTPSource) AsEloquaSource() (*EloquaSource, bool) { + return nil, false +} + +// AsDrillSource is the BasicCopySource implementation for HTTPSource. +func (hs HTTPSource) AsDrillSource() (*DrillSource, bool) { + return nil, false +} + +// AsCouchbaseSource is the BasicCopySource implementation for HTTPSource. +func (hs HTTPSource) AsCouchbaseSource() (*CouchbaseSource, bool) { + return nil, false +} + +// AsConcurSource is the BasicCopySource implementation for HTTPSource. +func (hs HTTPSource) AsConcurSource() (*ConcurSource, bool) { + return nil, false +} + +// AsAzurePostgreSQLSource is the BasicCopySource implementation for HTTPSource. +func (hs HTTPSource) AsAzurePostgreSQLSource() (*AzurePostgreSQLSource, bool) { + return nil, false +} + +// AsAmazonMWSSource is the BasicCopySource implementation for HTTPSource. +func (hs HTTPSource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { + return nil, false +} + +// AsHTTPSource is the BasicCopySource implementation for HTTPSource. +func (hs HTTPSource) AsHTTPSource() (*HTTPSource, bool) { + return &hs, true +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for HTTPSource. +func (hs HTTPSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for HTTPSource. +func (hs HTTPSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsCassandraSource is the BasicCopySource implementation for HTTPSource. +func (hs HTTPSource) AsCassandraSource() (*CassandraSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for HTTPSource. +func (hs HTTPSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for HTTPSource. +func (hs HTTPSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureMySQLSource is the BasicCopySource implementation for HTTPSource. +func (hs HTTPSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for HTTPSource. +func (hs HTTPSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for HTTPSource. +func (hs HTTPSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsSQLDWSource is the BasicCopySource implementation for HTTPSource. +func (hs HTTPSource) AsSQLDWSource() (*SQLDWSource, bool) { + return nil, false +} + +// AsSQLSource is the BasicCopySource implementation for HTTPSource. +func (hs HTTPSource) AsSQLSource() (*SQLSource, bool) { + return nil, false +} + +// AsSapEccSource is the BasicCopySource implementation for HTTPSource. +func (hs HTTPSource) AsSapEccSource() (*SapEccSource, bool) { + return nil, false +} + +// AsSapCloudForCustomerSource is the BasicCopySource implementation for HTTPSource. +func (hs HTTPSource) AsSapCloudForCustomerSource() (*SapCloudForCustomerSource, bool) { + return nil, false +} + +// AsSalesforceSource is the BasicCopySource implementation for HTTPSource. +func (hs HTTPSource) AsSalesforceSource() (*SalesforceSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for HTTPSource. +func (hs HTTPSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for HTTPSource. +func (hs HTTPSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for HTTPSource. +func (hs HTTPSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for HTTPSource. +func (hs HTTPSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + +// AsAzureTableSource is the BasicCopySource implementation for HTTPSource. +func (hs HTTPSource) AsAzureTableSource() (*AzureTableSource, bool) { + return nil, false +} + +// AsCopySource is the BasicCopySource implementation for HTTPSource. +func (hs HTTPSource) AsCopySource() (*CopySource, bool) { + return nil, false +} + +// AsBasicCopySource is the BasicCopySource implementation for HTTPSource. +func (hs HTTPSource) AsBasicCopySource() (BasicCopySource, bool) { + return &hs, true +} + +// HubspotLinkedService hubspot Serivce linked service. +type HubspotLinkedService struct { + // HubspotLinkedServiceTypeProperties - Hubspot Serivce linked service properties. + *HubspotLinkedServiceTypeProperties `json:"typeProperties,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // ConnectVia - The integration runtime reference. + ConnectVia *IntegrationRuntimeReference `json:"connectVia,omitempty"` + // Description - Linked service description. + Description *string `json:"description,omitempty"` + // Parameters - Parameters for linked service. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeLinkedService', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforce', 'TypeAzureDataLakeStore', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureStorage' + Type TypeBasicLinkedService `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for HubspotLinkedService. +func (hls HubspotLinkedService) MarshalJSON() ([]byte, error) { + hls.Type = TypeHubspot + objectMap := make(map[string]interface{}) + if hls.HubspotLinkedServiceTypeProperties != nil { + objectMap["typeProperties"] = hls.HubspotLinkedServiceTypeProperties + } + if hls.ConnectVia != nil { + objectMap["connectVia"] = hls.ConnectVia + } + if hls.Description != nil { + objectMap["description"] = hls.Description + } + if hls.Parameters != nil { + objectMap["parameters"] = hls.Parameters + } + if hls.Annotations != nil { + objectMap["annotations"] = hls.Annotations + } + if hls.Type != "" { + objectMap["type"] = hls.Type + } + for k, v := range hls.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysLinkedService is the BasicLinkedService implementation for HubspotLinkedService. +func (hls HubspotLinkedService) AsResponsysLinkedService() (*ResponsysLinkedService, bool) { + return nil, false +} + +// AsAzureDatabricksLinkedService is the BasicLinkedService implementation for HubspotLinkedService. +func (hls HubspotLinkedService) AsAzureDatabricksLinkedService() (*AzureDatabricksLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeAnalyticsLinkedService is the BasicLinkedService implementation for HubspotLinkedService. +func (hls HubspotLinkedService) AsAzureDataLakeAnalyticsLinkedService() (*AzureDataLakeAnalyticsLinkedService, bool) { + return nil, false +} + +// AsHDInsightOnDemandLinkedService is the BasicLinkedService implementation for HubspotLinkedService. +func (hls HubspotLinkedService) AsHDInsightOnDemandLinkedService() (*HDInsightOnDemandLinkedService, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudLinkedService is the BasicLinkedService implementation for HubspotLinkedService. +func (hls HubspotLinkedService) AsSalesforceMarketingCloudLinkedService() (*SalesforceMarketingCloudLinkedService, bool) { + return nil, false +} + +// AsNetezzaLinkedService is the BasicLinkedService implementation for HubspotLinkedService. +func (hls HubspotLinkedService) AsNetezzaLinkedService() (*NetezzaLinkedService, bool) { + return nil, false +} + +// AsVerticaLinkedService is the BasicLinkedService implementation for HubspotLinkedService. +func (hls HubspotLinkedService) AsVerticaLinkedService() (*VerticaLinkedService, bool) { + return nil, false +} + +// AsZohoLinkedService is the BasicLinkedService implementation for HubspotLinkedService. +func (hls HubspotLinkedService) AsZohoLinkedService() (*ZohoLinkedService, bool) { + return nil, false +} + +// AsXeroLinkedService is the BasicLinkedService implementation for HubspotLinkedService. +func (hls HubspotLinkedService) AsXeroLinkedService() (*XeroLinkedService, bool) { + return nil, false +} + +// AsSquareLinkedService is the BasicLinkedService implementation for HubspotLinkedService. +func (hls HubspotLinkedService) AsSquareLinkedService() (*SquareLinkedService, bool) { + return nil, false +} + +// AsSparkLinkedService is the BasicLinkedService implementation for HubspotLinkedService. +func (hls HubspotLinkedService) AsSparkLinkedService() (*SparkLinkedService, bool) { + return nil, false +} + +// AsShopifyLinkedService is the BasicLinkedService implementation for HubspotLinkedService. +func (hls HubspotLinkedService) AsShopifyLinkedService() (*ShopifyLinkedService, bool) { + return nil, false +} + +// AsServiceNowLinkedService is the BasicLinkedService implementation for HubspotLinkedService. +func (hls HubspotLinkedService) AsServiceNowLinkedService() (*ServiceNowLinkedService, bool) { + return nil, false +} + +// AsQuickBooksLinkedService is the BasicLinkedService implementation for HubspotLinkedService. +func (hls HubspotLinkedService) AsQuickBooksLinkedService() (*QuickBooksLinkedService, bool) { + return nil, false +} + +// AsPrestoLinkedService is the BasicLinkedService implementation for HubspotLinkedService. +func (hls HubspotLinkedService) AsPrestoLinkedService() (*PrestoLinkedService, bool) { + return nil, false +} + +// AsPhoenixLinkedService is the BasicLinkedService implementation for HubspotLinkedService. +func (hls HubspotLinkedService) AsPhoenixLinkedService() (*PhoenixLinkedService, bool) { + return nil, false +} + +// AsPaypalLinkedService is the BasicLinkedService implementation for HubspotLinkedService. +func (hls HubspotLinkedService) AsPaypalLinkedService() (*PaypalLinkedService, bool) { + return nil, false +} + +// AsMarketoLinkedService is the BasicLinkedService implementation for HubspotLinkedService. +func (hls HubspotLinkedService) AsMarketoLinkedService() (*MarketoLinkedService, bool) { + return nil, false +} + +// AsMariaDBLinkedService is the BasicLinkedService implementation for HubspotLinkedService. +func (hls HubspotLinkedService) AsMariaDBLinkedService() (*MariaDBLinkedService, bool) { + return nil, false +} + +// AsMagentoLinkedService is the BasicLinkedService implementation for HubspotLinkedService. +func (hls HubspotLinkedService) AsMagentoLinkedService() (*MagentoLinkedService, bool) { + return nil, false +} + +// AsJiraLinkedService is the BasicLinkedService implementation for HubspotLinkedService. +func (hls HubspotLinkedService) AsJiraLinkedService() (*JiraLinkedService, bool) { + return nil, false +} + +// AsImpalaLinkedService is the BasicLinkedService implementation for HubspotLinkedService. +func (hls HubspotLinkedService) AsImpalaLinkedService() (*ImpalaLinkedService, bool) { + return nil, false +} + +// AsHubspotLinkedService is the BasicLinkedService implementation for HubspotLinkedService. +func (hls HubspotLinkedService) AsHubspotLinkedService() (*HubspotLinkedService, bool) { + return &hls, true +} + +// AsHiveLinkedService is the BasicLinkedService implementation for HubspotLinkedService. +func (hls HubspotLinkedService) AsHiveLinkedService() (*HiveLinkedService, bool) { + return nil, false +} + +// AsHBaseLinkedService is the BasicLinkedService implementation for HubspotLinkedService. +func (hls HubspotLinkedService) AsHBaseLinkedService() (*HBaseLinkedService, bool) { + return nil, false +} + +// AsGreenplumLinkedService is the BasicLinkedService implementation for HubspotLinkedService. +func (hls HubspotLinkedService) AsGreenplumLinkedService() (*GreenplumLinkedService, bool) { + return nil, false +} + +// AsGoogleBigQueryLinkedService is the BasicLinkedService implementation for HubspotLinkedService. +func (hls HubspotLinkedService) AsGoogleBigQueryLinkedService() (*GoogleBigQueryLinkedService, bool) { + return nil, false +} + +// AsEloquaLinkedService is the BasicLinkedService implementation for HubspotLinkedService. +func (hls HubspotLinkedService) AsEloquaLinkedService() (*EloquaLinkedService, bool) { + return nil, false +} + +// AsDrillLinkedService is the BasicLinkedService implementation for HubspotLinkedService. +func (hls HubspotLinkedService) AsDrillLinkedService() (*DrillLinkedService, bool) { + return nil, false +} + +// AsCouchbaseLinkedService is the BasicLinkedService implementation for HubspotLinkedService. +func (hls HubspotLinkedService) AsCouchbaseLinkedService() (*CouchbaseLinkedService, bool) { + return nil, false +} + +// AsConcurLinkedService is the BasicLinkedService implementation for HubspotLinkedService. +func (hls HubspotLinkedService) AsConcurLinkedService() (*ConcurLinkedService, bool) { + return nil, false +} + +// AsAzurePostgreSQLLinkedService is the BasicLinkedService implementation for HubspotLinkedService. +func (hls HubspotLinkedService) AsAzurePostgreSQLLinkedService() (*AzurePostgreSQLLinkedService, bool) { + return nil, false +} + +// AsAmazonMWSLinkedService is the BasicLinkedService implementation for HubspotLinkedService. +func (hls HubspotLinkedService) AsAmazonMWSLinkedService() (*AmazonMWSLinkedService, bool) { + return nil, false +} + +// AsSapHanaLinkedService is the BasicLinkedService implementation for HubspotLinkedService. +func (hls HubspotLinkedService) AsSapHanaLinkedService() (*SapHanaLinkedService, bool) { + return nil, false +} + +// AsSapBWLinkedService is the BasicLinkedService implementation for HubspotLinkedService. +func (hls HubspotLinkedService) AsSapBWLinkedService() (*SapBWLinkedService, bool) { + return nil, false +} + +// AsSftpServerLinkedService is the BasicLinkedService implementation for HubspotLinkedService. +func (hls HubspotLinkedService) AsSftpServerLinkedService() (*SftpServerLinkedService, bool) { + return nil, false +} + +// AsFtpServerLinkedService is the BasicLinkedService implementation for HubspotLinkedService. +func (hls HubspotLinkedService) AsFtpServerLinkedService() (*FtpServerLinkedService, bool) { + return nil, false +} + +// AsHTTPLinkedService is the BasicLinkedService implementation for HubspotLinkedService. +func (hls HubspotLinkedService) AsHTTPLinkedService() (*HTTPLinkedService, bool) { + return nil, false +} + +// AsAzureSearchLinkedService is the BasicLinkedService implementation for HubspotLinkedService. +func (hls HubspotLinkedService) AsAzureSearchLinkedService() (*AzureSearchLinkedService, bool) { + return nil, false +} + +// AsCustomDataSourceLinkedService is the BasicLinkedService implementation for HubspotLinkedService. +func (hls HubspotLinkedService) AsCustomDataSourceLinkedService() (*CustomDataSourceLinkedService, bool) { + return nil, false +} + +// AsAmazonRedshiftLinkedService is the BasicLinkedService implementation for HubspotLinkedService. +func (hls HubspotLinkedService) AsAmazonRedshiftLinkedService() (*AmazonRedshiftLinkedService, bool) { + return nil, false +} + +// AsAmazonS3LinkedService is the BasicLinkedService implementation for HubspotLinkedService. +func (hls HubspotLinkedService) AsAmazonS3LinkedService() (*AmazonS3LinkedService, bool) { + return nil, false +} + +// AsSapEccLinkedService is the BasicLinkedService implementation for HubspotLinkedService. +func (hls HubspotLinkedService) AsSapEccLinkedService() (*SapEccLinkedService, bool) { + return nil, false +} + +// AsSapCloudForCustomerLinkedService is the BasicLinkedService implementation for HubspotLinkedService. +func (hls HubspotLinkedService) AsSapCloudForCustomerLinkedService() (*SapCloudForCustomerLinkedService, bool) { + return nil, false +} + +// AsSalesforceLinkedService is the BasicLinkedService implementation for HubspotLinkedService. +func (hls HubspotLinkedService) AsSalesforceLinkedService() (*SalesforceLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeStoreLinkedService is the BasicLinkedService implementation for HubspotLinkedService. +func (hls HubspotLinkedService) AsAzureDataLakeStoreLinkedService() (*AzureDataLakeStoreLinkedService, bool) { + return nil, false +} + +// AsMongoDbLinkedService is the BasicLinkedService implementation for HubspotLinkedService. +func (hls HubspotLinkedService) AsMongoDbLinkedService() (*MongoDbLinkedService, bool) { + return nil, false +} + +// AsCassandraLinkedService is the BasicLinkedService implementation for HubspotLinkedService. +func (hls HubspotLinkedService) AsCassandraLinkedService() (*CassandraLinkedService, bool) { + return nil, false +} + +// AsWebLinkedService is the BasicLinkedService implementation for HubspotLinkedService. +func (hls HubspotLinkedService) AsWebLinkedService() (*WebLinkedService, bool) { + return nil, false +} + +// AsODataLinkedService is the BasicLinkedService implementation for HubspotLinkedService. +func (hls HubspotLinkedService) AsODataLinkedService() (*ODataLinkedService, bool) { + return nil, false +} + +// AsHdfsLinkedService is the BasicLinkedService implementation for HubspotLinkedService. +func (hls HubspotLinkedService) AsHdfsLinkedService() (*HdfsLinkedService, bool) { + return nil, false +} + +// AsOdbcLinkedService is the BasicLinkedService implementation for HubspotLinkedService. +func (hls HubspotLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, bool) { + return nil, false +} + +// AsAzureMLLinkedService is the BasicLinkedService implementation for HubspotLinkedService. +func (hls HubspotLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { + return nil, false +} + +// AsTeradataLinkedService is the BasicLinkedService implementation for HubspotLinkedService. +func (hls HubspotLinkedService) AsTeradataLinkedService() (*TeradataLinkedService, bool) { + return nil, false +} + +// AsDb2LinkedService is the BasicLinkedService implementation for HubspotLinkedService. +func (hls HubspotLinkedService) AsDb2LinkedService() (*Db2LinkedService, bool) { + return nil, false +} + +// AsSybaseLinkedService is the BasicLinkedService implementation for HubspotLinkedService. +func (hls HubspotLinkedService) AsSybaseLinkedService() (*SybaseLinkedService, bool) { + return nil, false +} + +// AsPostgreSQLLinkedService is the BasicLinkedService implementation for HubspotLinkedService. +func (hls HubspotLinkedService) AsPostgreSQLLinkedService() (*PostgreSQLLinkedService, bool) { + return nil, false +} + +// AsMySQLLinkedService is the BasicLinkedService implementation for HubspotLinkedService. +func (hls HubspotLinkedService) AsMySQLLinkedService() (*MySQLLinkedService, bool) { + return nil, false +} + +// AsAzureMySQLLinkedService is the BasicLinkedService implementation for HubspotLinkedService. +func (hls HubspotLinkedService) AsAzureMySQLLinkedService() (*AzureMySQLLinkedService, bool) { + return nil, false +} + +// AsOracleLinkedService is the BasicLinkedService implementation for HubspotLinkedService. +func (hls HubspotLinkedService) AsOracleLinkedService() (*OracleLinkedService, bool) { + return nil, false +} + +// AsFileServerLinkedService is the BasicLinkedService implementation for HubspotLinkedService. +func (hls HubspotLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { + return nil, false +} + +// AsHDInsightLinkedService is the BasicLinkedService implementation for HubspotLinkedService. +func (hls HubspotLinkedService) AsHDInsightLinkedService() (*HDInsightLinkedService, bool) { + return nil, false +} + +// AsDynamicsLinkedService is the BasicLinkedService implementation for HubspotLinkedService. +func (hls HubspotLinkedService) AsDynamicsLinkedService() (*DynamicsLinkedService, bool) { + return nil, false +} + +// AsCosmosDbLinkedService is the BasicLinkedService implementation for HubspotLinkedService. +func (hls HubspotLinkedService) AsCosmosDbLinkedService() (*CosmosDbLinkedService, bool) { + return nil, false +} + +// AsAzureKeyVaultLinkedService is the BasicLinkedService implementation for HubspotLinkedService. +func (hls HubspotLinkedService) AsAzureKeyVaultLinkedService() (*AzureKeyVaultLinkedService, bool) { + return nil, false +} + +// AsAzureBatchLinkedService is the BasicLinkedService implementation for HubspotLinkedService. +func (hls HubspotLinkedService) AsAzureBatchLinkedService() (*AzureBatchLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDatabaseLinkedService is the BasicLinkedService implementation for HubspotLinkedService. +func (hls HubspotLinkedService) AsAzureSQLDatabaseLinkedService() (*AzureSQLDatabaseLinkedService, bool) { + return nil, false +} + +// AsSQLServerLinkedService is the BasicLinkedService implementation for HubspotLinkedService. +func (hls HubspotLinkedService) AsSQLServerLinkedService() (*SQLServerLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDWLinkedService is the BasicLinkedService implementation for HubspotLinkedService. +func (hls HubspotLinkedService) AsAzureSQLDWLinkedService() (*AzureSQLDWLinkedService, bool) { + return nil, false +} + +// AsAzureStorageLinkedService is the BasicLinkedService implementation for HubspotLinkedService. +func (hls HubspotLinkedService) AsAzureStorageLinkedService() (*AzureStorageLinkedService, bool) { + return nil, false +} + +// AsLinkedService is the BasicLinkedService implementation for HubspotLinkedService. +func (hls HubspotLinkedService) AsLinkedService() (*LinkedService, bool) { + return nil, false +} + +// AsBasicLinkedService is the BasicLinkedService implementation for HubspotLinkedService. +func (hls HubspotLinkedService) AsBasicLinkedService() (BasicLinkedService, bool) { + return &hls, true +} + +// UnmarshalJSON is the custom unmarshaler for HubspotLinkedService struct. +func (hls *HubspotLinkedService) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "typeProperties": + if v != nil { + var hubspotLinkedServiceTypeProperties HubspotLinkedServiceTypeProperties + err = json.Unmarshal(*v, &hubspotLinkedServiceTypeProperties) + if err != nil { + return err + } + hls.HubspotLinkedServiceTypeProperties = &hubspotLinkedServiceTypeProperties + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if hls.AdditionalProperties == nil { + hls.AdditionalProperties = make(map[string]interface{}) + } + hls.AdditionalProperties[k] = additionalProperties + } + case "connectVia": + if v != nil { + var connectVia IntegrationRuntimeReference + err = json.Unmarshal(*v, &connectVia) + if err != nil { + return err + } + hls.ConnectVia = &connectVia + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + hls.Description = &description + } + case "parameters": + if v != nil { + var parameters map[string]*ParameterSpecification + err = json.Unmarshal(*v, ¶meters) + if err != nil { + return err + } + hls.Parameters = parameters + } + case "annotations": + if v != nil { + var annotations []interface{} + err = json.Unmarshal(*v, &annotations) + if err != nil { + return err + } + hls.Annotations = &annotations + } + case "type": + if v != nil { + var typeVar TypeBasicLinkedService + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + hls.Type = typeVar + } + } + } + + return nil +} + +// HubspotLinkedServiceTypeProperties hubspot Serivce linked service properties. +type HubspotLinkedServiceTypeProperties struct { + // ClientID - The client ID associated with your Hubspot application. + ClientID interface{} `json:"clientId,omitempty"` + // ClientSecret - The client secret associated with your Hubspot application. + ClientSecret BasicSecretBase `json:"clientSecret,omitempty"` + // AccessToken - The access token obtained when initially authenticating your OAuth integration. + AccessToken BasicSecretBase `json:"accessToken,omitempty"` + // RefreshToken - The refresh token obtained when initially authenticating your OAuth integration. + RefreshToken BasicSecretBase `json:"refreshToken,omitempty"` + // UseEncryptedEndpoints - Specifies whether the data source endpoints are encrypted using HTTPS. The default value is true. + UseEncryptedEndpoints interface{} `json:"useEncryptedEndpoints,omitempty"` + // UseHostVerification - Specifies whether to require the host name in the server's certificate to match the host name of the server when connecting over SSL. The default value is true. + UseHostVerification interface{} `json:"useHostVerification,omitempty"` + // UsePeerVerification - Specifies whether to verify the identity of the server when connecting over SSL. The default value is true. + UsePeerVerification interface{} `json:"usePeerVerification,omitempty"` + // EncryptedCredential - The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string). + EncryptedCredential interface{} `json:"encryptedCredential,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for HubspotLinkedServiceTypeProperties struct. +func (hlstp *HubspotLinkedServiceTypeProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "clientId": + if v != nil { + var clientID interface{} + err = json.Unmarshal(*v, &clientID) + if err != nil { + return err + } + hlstp.ClientID = clientID + } + case "clientSecret": + if v != nil { + clientSecret, err := unmarshalBasicSecretBase(*v) + if err != nil { + return err + } + hlstp.ClientSecret = clientSecret + } + case "accessToken": + if v != nil { + accessToken, err := unmarshalBasicSecretBase(*v) + if err != nil { + return err + } + hlstp.AccessToken = accessToken + } + case "refreshToken": + if v != nil { + refreshToken, err := unmarshalBasicSecretBase(*v) + if err != nil { + return err + } + hlstp.RefreshToken = refreshToken + } + case "useEncryptedEndpoints": + if v != nil { + var useEncryptedEndpoints interface{} + err = json.Unmarshal(*v, &useEncryptedEndpoints) + if err != nil { + return err + } + hlstp.UseEncryptedEndpoints = useEncryptedEndpoints + } + case "useHostVerification": + if v != nil { + var useHostVerification interface{} + err = json.Unmarshal(*v, &useHostVerification) + if err != nil { + return err + } + hlstp.UseHostVerification = useHostVerification + } + case "usePeerVerification": + if v != nil { + var usePeerVerification interface{} + err = json.Unmarshal(*v, &usePeerVerification) + if err != nil { + return err + } + hlstp.UsePeerVerification = usePeerVerification + } + case "encryptedCredential": + if v != nil { + var encryptedCredential interface{} + err = json.Unmarshal(*v, &encryptedCredential) + if err != nil { + return err + } + hlstp.EncryptedCredential = encryptedCredential + } + } + } + + return nil +} + +// HubspotObjectDataset hubspot Serivce dataset. +type HubspotObjectDataset struct { + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Description - Dataset description. + Description *string `json:"description,omitempty"` + // Structure - Columns that define the structure of the dataset. Type: array (or Expression with resultType array), itemType: DatasetDataElement. + Structure interface{} `json:"structure,omitempty"` + // LinkedServiceName - Linked service reference. + LinkedServiceName *LinkedServiceReference `json:"linkedServiceName,omitempty"` + // Parameters - Parameters for dataset. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeDataset', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSQLServerTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSalesforceObject', 'TypeRelationalTable', 'TypeAzureMySQLTable', 'TypeOracleTable', 'TypeODataResource', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeAzureDataLakeStoreFile', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeAmazonS3Object' + Type TypeBasicDataset `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for HubspotObjectDataset. +func (hod HubspotObjectDataset) MarshalJSON() ([]byte, error) { + hod.Type = TypeHubspotObject + objectMap := make(map[string]interface{}) + if hod.Description != nil { + objectMap["description"] = hod.Description + } + objectMap["structure"] = hod.Structure + if hod.LinkedServiceName != nil { + objectMap["linkedServiceName"] = hod.LinkedServiceName + } + if hod.Parameters != nil { + objectMap["parameters"] = hod.Parameters + } + if hod.Annotations != nil { + objectMap["annotations"] = hod.Annotations + } + if hod.Type != "" { + objectMap["type"] = hod.Type + } + for k, v := range hod.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysObjectDataset is the BasicDataset implementation for HubspotObjectDataset. +func (hod HubspotObjectDataset) AsResponsysObjectDataset() (*ResponsysObjectDataset, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudObjectDataset is the BasicDataset implementation for HubspotObjectDataset. +func (hod HubspotObjectDataset) AsSalesforceMarketingCloudObjectDataset() (*SalesforceMarketingCloudObjectDataset, bool) { + return nil, false +} + +// AsVerticaTableDataset is the BasicDataset implementation for HubspotObjectDataset. +func (hod HubspotObjectDataset) AsVerticaTableDataset() (*VerticaTableDataset, bool) { + return nil, false +} + +// AsNetezzaTableDataset is the BasicDataset implementation for HubspotObjectDataset. +func (hod HubspotObjectDataset) AsNetezzaTableDataset() (*NetezzaTableDataset, bool) { + return nil, false +} + +// AsZohoObjectDataset is the BasicDataset implementation for HubspotObjectDataset. +func (hod HubspotObjectDataset) AsZohoObjectDataset() (*ZohoObjectDataset, bool) { + return nil, false +} + +// AsXeroObjectDataset is the BasicDataset implementation for HubspotObjectDataset. +func (hod HubspotObjectDataset) AsXeroObjectDataset() (*XeroObjectDataset, bool) { + return nil, false +} + +// AsSquareObjectDataset is the BasicDataset implementation for HubspotObjectDataset. +func (hod HubspotObjectDataset) AsSquareObjectDataset() (*SquareObjectDataset, bool) { + return nil, false +} + +// AsSparkObjectDataset is the BasicDataset implementation for HubspotObjectDataset. +func (hod HubspotObjectDataset) AsSparkObjectDataset() (*SparkObjectDataset, bool) { + return nil, false +} + +// AsShopifyObjectDataset is the BasicDataset implementation for HubspotObjectDataset. +func (hod HubspotObjectDataset) AsShopifyObjectDataset() (*ShopifyObjectDataset, bool) { + return nil, false +} + +// AsServiceNowObjectDataset is the BasicDataset implementation for HubspotObjectDataset. +func (hod HubspotObjectDataset) AsServiceNowObjectDataset() (*ServiceNowObjectDataset, bool) { + return nil, false +} + +// AsQuickBooksObjectDataset is the BasicDataset implementation for HubspotObjectDataset. +func (hod HubspotObjectDataset) AsQuickBooksObjectDataset() (*QuickBooksObjectDataset, bool) { + return nil, false +} + +// AsPrestoObjectDataset is the BasicDataset implementation for HubspotObjectDataset. +func (hod HubspotObjectDataset) AsPrestoObjectDataset() (*PrestoObjectDataset, bool) { + return nil, false +} + +// AsPhoenixObjectDataset is the BasicDataset implementation for HubspotObjectDataset. +func (hod HubspotObjectDataset) AsPhoenixObjectDataset() (*PhoenixObjectDataset, bool) { + return nil, false +} + +// AsPaypalObjectDataset is the BasicDataset implementation for HubspotObjectDataset. +func (hod HubspotObjectDataset) AsPaypalObjectDataset() (*PaypalObjectDataset, bool) { + return nil, false +} + +// AsMarketoObjectDataset is the BasicDataset implementation for HubspotObjectDataset. +func (hod HubspotObjectDataset) AsMarketoObjectDataset() (*MarketoObjectDataset, bool) { + return nil, false +} + +// AsMariaDBTableDataset is the BasicDataset implementation for HubspotObjectDataset. +func (hod HubspotObjectDataset) AsMariaDBTableDataset() (*MariaDBTableDataset, bool) { + return nil, false +} + +// AsMagentoObjectDataset is the BasicDataset implementation for HubspotObjectDataset. +func (hod HubspotObjectDataset) AsMagentoObjectDataset() (*MagentoObjectDataset, bool) { + return nil, false +} + +// AsJiraObjectDataset is the BasicDataset implementation for HubspotObjectDataset. +func (hod HubspotObjectDataset) AsJiraObjectDataset() (*JiraObjectDataset, bool) { + return nil, false +} + +// AsImpalaObjectDataset is the BasicDataset implementation for HubspotObjectDataset. +func (hod HubspotObjectDataset) AsImpalaObjectDataset() (*ImpalaObjectDataset, bool) { + return nil, false +} + +// AsHubspotObjectDataset is the BasicDataset implementation for HubspotObjectDataset. +func (hod HubspotObjectDataset) AsHubspotObjectDataset() (*HubspotObjectDataset, bool) { + return &hod, true +} + +// AsHiveObjectDataset is the BasicDataset implementation for HubspotObjectDataset. +func (hod HubspotObjectDataset) AsHiveObjectDataset() (*HiveObjectDataset, bool) { + return nil, false +} + +// AsHBaseObjectDataset is the BasicDataset implementation for HubspotObjectDataset. +func (hod HubspotObjectDataset) AsHBaseObjectDataset() (*HBaseObjectDataset, bool) { + return nil, false +} + +// AsGreenplumTableDataset is the BasicDataset implementation for HubspotObjectDataset. +func (hod HubspotObjectDataset) AsGreenplumTableDataset() (*GreenplumTableDataset, bool) { + return nil, false +} + +// AsGoogleBigQueryObjectDataset is the BasicDataset implementation for HubspotObjectDataset. +func (hod HubspotObjectDataset) AsGoogleBigQueryObjectDataset() (*GoogleBigQueryObjectDataset, bool) { + return nil, false +} + +// AsEloquaObjectDataset is the BasicDataset implementation for HubspotObjectDataset. +func (hod HubspotObjectDataset) AsEloquaObjectDataset() (*EloquaObjectDataset, bool) { + return nil, false +} + +// AsDrillTableDataset is the BasicDataset implementation for HubspotObjectDataset. +func (hod HubspotObjectDataset) AsDrillTableDataset() (*DrillTableDataset, bool) { + return nil, false +} + +// AsCouchbaseTableDataset is the BasicDataset implementation for HubspotObjectDataset. +func (hod HubspotObjectDataset) AsCouchbaseTableDataset() (*CouchbaseTableDataset, bool) { + return nil, false +} + +// AsConcurObjectDataset is the BasicDataset implementation for HubspotObjectDataset. +func (hod HubspotObjectDataset) AsConcurObjectDataset() (*ConcurObjectDataset, bool) { + return nil, false +} + +// AsAzurePostgreSQLTableDataset is the BasicDataset implementation for HubspotObjectDataset. +func (hod HubspotObjectDataset) AsAzurePostgreSQLTableDataset() (*AzurePostgreSQLTableDataset, bool) { + return nil, false +} + +// AsAmazonMWSObjectDataset is the BasicDataset implementation for HubspotObjectDataset. +func (hod HubspotObjectDataset) AsAmazonMWSObjectDataset() (*AmazonMWSObjectDataset, bool) { + return nil, false +} + +// AsHTTPDataset is the BasicDataset implementation for HubspotObjectDataset. +func (hod HubspotObjectDataset) AsHTTPDataset() (*HTTPDataset, bool) { + return nil, false +} + +// AsAzureSearchIndexDataset is the BasicDataset implementation for HubspotObjectDataset. +func (hod HubspotObjectDataset) AsAzureSearchIndexDataset() (*AzureSearchIndexDataset, bool) { + return nil, false +} + +// AsWebTableDataset is the BasicDataset implementation for HubspotObjectDataset. +func (hod HubspotObjectDataset) AsWebTableDataset() (*WebTableDataset, bool) { + return nil, false +} + +// AsSQLServerTableDataset is the BasicDataset implementation for HubspotObjectDataset. +func (hod HubspotObjectDataset) AsSQLServerTableDataset() (*SQLServerTableDataset, bool) { + return nil, false +} + +// AsSapEccResourceDataset is the BasicDataset implementation for HubspotObjectDataset. +func (hod HubspotObjectDataset) AsSapEccResourceDataset() (*SapEccResourceDataset, bool) { + return nil, false +} + +// AsSapCloudForCustomerResourceDataset is the BasicDataset implementation for HubspotObjectDataset. +func (hod HubspotObjectDataset) AsSapCloudForCustomerResourceDataset() (*SapCloudForCustomerResourceDataset, bool) { + return nil, false +} + +// AsSalesforceObjectDataset is the BasicDataset implementation for HubspotObjectDataset. +func (hod HubspotObjectDataset) AsSalesforceObjectDataset() (*SalesforceObjectDataset, bool) { + return nil, false +} + +// AsRelationalTableDataset is the BasicDataset implementation for HubspotObjectDataset. +func (hod HubspotObjectDataset) AsRelationalTableDataset() (*RelationalTableDataset, bool) { + return nil, false +} + +// AsAzureMySQLTableDataset is the BasicDataset implementation for HubspotObjectDataset. +func (hod HubspotObjectDataset) AsAzureMySQLTableDataset() (*AzureMySQLTableDataset, bool) { + return nil, false +} + +// AsOracleTableDataset is the BasicDataset implementation for HubspotObjectDataset. +func (hod HubspotObjectDataset) AsOracleTableDataset() (*OracleTableDataset, bool) { + return nil, false +} + +// AsODataResourceDataset is the BasicDataset implementation for HubspotObjectDataset. +func (hod HubspotObjectDataset) AsODataResourceDataset() (*ODataResourceDataset, bool) { + return nil, false +} + +// AsMongoDbCollectionDataset is the BasicDataset implementation for HubspotObjectDataset. +func (hod HubspotObjectDataset) AsMongoDbCollectionDataset() (*MongoDbCollectionDataset, bool) { + return nil, false +} + +// AsFileShareDataset is the BasicDataset implementation for HubspotObjectDataset. +func (hod HubspotObjectDataset) AsFileShareDataset() (*FileShareDataset, bool) { + return nil, false +} + +// AsAzureDataLakeStoreDataset is the BasicDataset implementation for HubspotObjectDataset. +func (hod HubspotObjectDataset) AsAzureDataLakeStoreDataset() (*AzureDataLakeStoreDataset, bool) { + return nil, false +} + +// AsDynamicsEntityDataset is the BasicDataset implementation for HubspotObjectDataset. +func (hod HubspotObjectDataset) AsDynamicsEntityDataset() (*DynamicsEntityDataset, bool) { + return nil, false +} + +// AsDocumentDbCollectionDataset is the BasicDataset implementation for HubspotObjectDataset. +func (hod HubspotObjectDataset) AsDocumentDbCollectionDataset() (*DocumentDbCollectionDataset, bool) { + return nil, false +} + +// AsCustomDataset is the BasicDataset implementation for HubspotObjectDataset. +func (hod HubspotObjectDataset) AsCustomDataset() (*CustomDataset, bool) { + return nil, false +} + +// AsCassandraTableDataset is the BasicDataset implementation for HubspotObjectDataset. +func (hod HubspotObjectDataset) AsCassandraTableDataset() (*CassandraTableDataset, bool) { + return nil, false +} + +// AsAzureSQLDWTableDataset is the BasicDataset implementation for HubspotObjectDataset. +func (hod HubspotObjectDataset) AsAzureSQLDWTableDataset() (*AzureSQLDWTableDataset, bool) { + return nil, false +} + +// AsAzureSQLTableDataset is the BasicDataset implementation for HubspotObjectDataset. +func (hod HubspotObjectDataset) AsAzureSQLTableDataset() (*AzureSQLTableDataset, bool) { + return nil, false +} + +// AsAzureTableDataset is the BasicDataset implementation for HubspotObjectDataset. +func (hod HubspotObjectDataset) AsAzureTableDataset() (*AzureTableDataset, bool) { + return nil, false +} + +// AsAzureBlobDataset is the BasicDataset implementation for HubspotObjectDataset. +func (hod HubspotObjectDataset) AsAzureBlobDataset() (*AzureBlobDataset, bool) { + return nil, false +} + +// AsAmazonS3Dataset is the BasicDataset implementation for HubspotObjectDataset. +func (hod HubspotObjectDataset) AsAmazonS3Dataset() (*AmazonS3Dataset, bool) { + return nil, false +} + +// AsDataset is the BasicDataset implementation for HubspotObjectDataset. +func (hod HubspotObjectDataset) AsDataset() (*Dataset, bool) { + return nil, false +} + +// AsBasicDataset is the BasicDataset implementation for HubspotObjectDataset. +func (hod HubspotObjectDataset) AsBasicDataset() (BasicDataset, bool) { + return &hod, true +} + +// HubspotSource a copy activity Hubspot Serivce source. +type HubspotSource struct { + // Query - A query to retrieve data from source. Type: string (or Expression with resultType string). + Query interface{} `json:"query,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // SourceRetryCount - Source retry count. Type: integer (or Expression with resultType integer). + SourceRetryCount interface{} `json:"sourceRetryCount,omitempty"` + // SourceRetryWait - Source retry wait. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` + // Type - Possible values include: 'TypeCopySource', 'TypeAmazonRedshiftSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeHTTPSource', 'TypeAzureDataLakeStoreSource', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeRelationalSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource' + Type TypeBasicCopySource `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for HubspotSource. +func (hs HubspotSource) MarshalJSON() ([]byte, error) { + hs.Type = TypeHubspotSource + objectMap := make(map[string]interface{}) + objectMap["query"] = hs.Query + objectMap["sourceRetryCount"] = hs.SourceRetryCount + objectMap["sourceRetryWait"] = hs.SourceRetryWait + if hs.Type != "" { + objectMap["type"] = hs.Type + } + for k, v := range hs.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsAmazonRedshiftSource is the BasicCopySource implementation for HubspotSource. +func (hs HubspotSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { + return nil, false +} + +// AsResponsysSource is the BasicCopySource implementation for HubspotSource. +func (hs HubspotSource) AsResponsysSource() (*ResponsysSource, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudSource is the BasicCopySource implementation for HubspotSource. +func (hs HubspotSource) AsSalesforceMarketingCloudSource() (*SalesforceMarketingCloudSource, bool) { + return nil, false +} + +// AsVerticaSource is the BasicCopySource implementation for HubspotSource. +func (hs HubspotSource) AsVerticaSource() (*VerticaSource, bool) { + return nil, false +} + +// AsNetezzaSource is the BasicCopySource implementation for HubspotSource. +func (hs HubspotSource) AsNetezzaSource() (*NetezzaSource, bool) { + return nil, false +} + +// AsZohoSource is the BasicCopySource implementation for HubspotSource. +func (hs HubspotSource) AsZohoSource() (*ZohoSource, bool) { + return nil, false +} + +// AsXeroSource is the BasicCopySource implementation for HubspotSource. +func (hs HubspotSource) AsXeroSource() (*XeroSource, bool) { + return nil, false +} + +// AsSquareSource is the BasicCopySource implementation for HubspotSource. +func (hs HubspotSource) AsSquareSource() (*SquareSource, bool) { + return nil, false +} + +// AsSparkSource is the BasicCopySource implementation for HubspotSource. +func (hs HubspotSource) AsSparkSource() (*SparkSource, bool) { + return nil, false +} + +// AsShopifySource is the BasicCopySource implementation for HubspotSource. +func (hs HubspotSource) AsShopifySource() (*ShopifySource, bool) { + return nil, false +} + +// AsServiceNowSource is the BasicCopySource implementation for HubspotSource. +func (hs HubspotSource) AsServiceNowSource() (*ServiceNowSource, bool) { + return nil, false +} + +// AsQuickBooksSource is the BasicCopySource implementation for HubspotSource. +func (hs HubspotSource) AsQuickBooksSource() (*QuickBooksSource, bool) { + return nil, false +} + +// AsPrestoSource is the BasicCopySource implementation for HubspotSource. +func (hs HubspotSource) AsPrestoSource() (*PrestoSource, bool) { + return nil, false +} + +// AsPhoenixSource is the BasicCopySource implementation for HubspotSource. +func (hs HubspotSource) AsPhoenixSource() (*PhoenixSource, bool) { + return nil, false +} + +// AsPaypalSource is the BasicCopySource implementation for HubspotSource. +func (hs HubspotSource) AsPaypalSource() (*PaypalSource, bool) { + return nil, false +} + +// AsMarketoSource is the BasicCopySource implementation for HubspotSource. +func (hs HubspotSource) AsMarketoSource() (*MarketoSource, bool) { + return nil, false +} + +// AsMariaDBSource is the BasicCopySource implementation for HubspotSource. +func (hs HubspotSource) AsMariaDBSource() (*MariaDBSource, bool) { + return nil, false +} + +// AsMagentoSource is the BasicCopySource implementation for HubspotSource. +func (hs HubspotSource) AsMagentoSource() (*MagentoSource, bool) { + return nil, false +} + +// AsJiraSource is the BasicCopySource implementation for HubspotSource. +func (hs HubspotSource) AsJiraSource() (*JiraSource, bool) { + return nil, false +} + +// AsImpalaSource is the BasicCopySource implementation for HubspotSource. +func (hs HubspotSource) AsImpalaSource() (*ImpalaSource, bool) { + return nil, false +} + +// AsHubspotSource is the BasicCopySource implementation for HubspotSource. +func (hs HubspotSource) AsHubspotSource() (*HubspotSource, bool) { + return &hs, true +} + +// AsHiveSource is the BasicCopySource implementation for HubspotSource. +func (hs HubspotSource) AsHiveSource() (*HiveSource, bool) { + return nil, false +} + +// AsHBaseSource is the BasicCopySource implementation for HubspotSource. +func (hs HubspotSource) AsHBaseSource() (*HBaseSource, bool) { + return nil, false +} + +// AsGreenplumSource is the BasicCopySource implementation for HubspotSource. +func (hs HubspotSource) AsGreenplumSource() (*GreenplumSource, bool) { + return nil, false +} + +// AsGoogleBigQuerySource is the BasicCopySource implementation for HubspotSource. +func (hs HubspotSource) AsGoogleBigQuerySource() (*GoogleBigQuerySource, bool) { + return nil, false +} + +// AsEloquaSource is the BasicCopySource implementation for HubspotSource. +func (hs HubspotSource) AsEloquaSource() (*EloquaSource, bool) { + return nil, false +} + +// AsDrillSource is the BasicCopySource implementation for HubspotSource. +func (hs HubspotSource) AsDrillSource() (*DrillSource, bool) { + return nil, false +} + +// AsCouchbaseSource is the BasicCopySource implementation for HubspotSource. +func (hs HubspotSource) AsCouchbaseSource() (*CouchbaseSource, bool) { + return nil, false +} + +// AsConcurSource is the BasicCopySource implementation for HubspotSource. +func (hs HubspotSource) AsConcurSource() (*ConcurSource, bool) { + return nil, false +} + +// AsAzurePostgreSQLSource is the BasicCopySource implementation for HubspotSource. +func (hs HubspotSource) AsAzurePostgreSQLSource() (*AzurePostgreSQLSource, bool) { + return nil, false +} + +// AsAmazonMWSSource is the BasicCopySource implementation for HubspotSource. +func (hs HubspotSource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { + return nil, false +} + +// AsHTTPSource is the BasicCopySource implementation for HubspotSource. +func (hs HubspotSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for HubspotSource. +func (hs HubspotSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for HubspotSource. +func (hs HubspotSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsCassandraSource is the BasicCopySource implementation for HubspotSource. +func (hs HubspotSource) AsCassandraSource() (*CassandraSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for HubspotSource. +func (hs HubspotSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for HubspotSource. +func (hs HubspotSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureMySQLSource is the BasicCopySource implementation for HubspotSource. +func (hs HubspotSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for HubspotSource. +func (hs HubspotSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for HubspotSource. +func (hs HubspotSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsSQLDWSource is the BasicCopySource implementation for HubspotSource. +func (hs HubspotSource) AsSQLDWSource() (*SQLDWSource, bool) { + return nil, false +} + +// AsSQLSource is the BasicCopySource implementation for HubspotSource. +func (hs HubspotSource) AsSQLSource() (*SQLSource, bool) { + return nil, false +} + +// AsSapEccSource is the BasicCopySource implementation for HubspotSource. +func (hs HubspotSource) AsSapEccSource() (*SapEccSource, bool) { + return nil, false +} + +// AsSapCloudForCustomerSource is the BasicCopySource implementation for HubspotSource. +func (hs HubspotSource) AsSapCloudForCustomerSource() (*SapCloudForCustomerSource, bool) { + return nil, false +} + +// AsSalesforceSource is the BasicCopySource implementation for HubspotSource. +func (hs HubspotSource) AsSalesforceSource() (*SalesforceSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for HubspotSource. +func (hs HubspotSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for HubspotSource. +func (hs HubspotSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for HubspotSource. +func (hs HubspotSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for HubspotSource. +func (hs HubspotSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + +// AsAzureTableSource is the BasicCopySource implementation for HubspotSource. +func (hs HubspotSource) AsAzureTableSource() (*AzureTableSource, bool) { + return nil, false +} + +// AsCopySource is the BasicCopySource implementation for HubspotSource. +func (hs HubspotSource) AsCopySource() (*CopySource, bool) { + return nil, false +} + +// AsBasicCopySource is the BasicCopySource implementation for HubspotSource. +func (hs HubspotSource) AsBasicCopySource() (BasicCopySource, bool) { + return &hs, true +} + +// IfConditionActivity this activity evaluates a boolean expression and executes either the activities under the +// ifTrueActivities property or the ifFalseActivities property depending on the result of the expression. +type IfConditionActivity struct { + // IfConditionActivityTypeProperties - IfCondition activity properties. + *IfConditionActivityTypeProperties `json:"typeProperties,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Name - Activity name. + Name *string `json:"name,omitempty"` + // Description - Activity description. + Description *string `json:"description,omitempty"` + // DependsOn - Activity depends on condition. + DependsOn *[]ActivityDependency `json:"dependsOn,omitempty"` + // UserProperties - Activity user properties. + UserProperties map[string]*string `json:"userProperties"` + // Type - Possible values include: 'TypeActivity', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLUpdateResource', 'TypeAzureMLBatchExecution', 'TypeGetMetadata', 'TypeWebActivity', 'TypeLookup', 'TypeSQLServerStoredProcedure', 'TypeCustom', 'TypeExecuteSSISPackage', 'TypeHDInsightSpark', 'TypeHDInsightStreaming', 'TypeHDInsightMapReduce', 'TypeHDInsightPig', 'TypeHDInsightHive', 'TypeCopy', 'TypeExecution', 'TypeFilter', 'TypeUntil', 'TypeWait', 'TypeForEach', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' + Type TypeBasicActivity `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for IfConditionActivity. +func (ica IfConditionActivity) MarshalJSON() ([]byte, error) { + ica.Type = TypeIfCondition + objectMap := make(map[string]interface{}) + if ica.IfConditionActivityTypeProperties != nil { + objectMap["typeProperties"] = ica.IfConditionActivityTypeProperties + } + if ica.Name != nil { + objectMap["name"] = ica.Name + } + if ica.Description != nil { + objectMap["description"] = ica.Description + } + if ica.DependsOn != nil { + objectMap["dependsOn"] = ica.DependsOn + } + if ica.UserProperties != nil { + objectMap["userProperties"] = ica.UserProperties + } + if ica.Type != "" { + objectMap["type"] = ica.Type + } + for k, v := range ica.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsDatabricksNotebookActivity is the BasicActivity implementation for IfConditionActivity. +func (ica IfConditionActivity) AsDatabricksNotebookActivity() (*DatabricksNotebookActivity, bool) { + return nil, false +} + +// AsDataLakeAnalyticsUSQLActivity is the BasicActivity implementation for IfConditionActivity. +func (ica IfConditionActivity) AsDataLakeAnalyticsUSQLActivity() (*DataLakeAnalyticsUSQLActivity, bool) { + return nil, false +} + +// AsAzureMLUpdateResourceActivity is the BasicActivity implementation for IfConditionActivity. +func (ica IfConditionActivity) AsAzureMLUpdateResourceActivity() (*AzureMLUpdateResourceActivity, bool) { + return nil, false +} + +// AsAzureMLBatchExecutionActivity is the BasicActivity implementation for IfConditionActivity. +func (ica IfConditionActivity) AsAzureMLBatchExecutionActivity() (*AzureMLBatchExecutionActivity, bool) { + return nil, false +} + +// AsGetMetadataActivity is the BasicActivity implementation for IfConditionActivity. +func (ica IfConditionActivity) AsGetMetadataActivity() (*GetMetadataActivity, bool) { + return nil, false +} + +// AsWebActivity is the BasicActivity implementation for IfConditionActivity. +func (ica IfConditionActivity) AsWebActivity() (*WebActivity, bool) { + return nil, false +} + +// AsLookupActivity is the BasicActivity implementation for IfConditionActivity. +func (ica IfConditionActivity) AsLookupActivity() (*LookupActivity, bool) { + return nil, false +} + +// AsSQLServerStoredProcedureActivity is the BasicActivity implementation for IfConditionActivity. +func (ica IfConditionActivity) AsSQLServerStoredProcedureActivity() (*SQLServerStoredProcedureActivity, bool) { + return nil, false +} + +// AsCustomActivity is the BasicActivity implementation for IfConditionActivity. +func (ica IfConditionActivity) AsCustomActivity() (*CustomActivity, bool) { + return nil, false +} + +// AsExecuteSSISPackageActivity is the BasicActivity implementation for IfConditionActivity. +func (ica IfConditionActivity) AsExecuteSSISPackageActivity() (*ExecuteSSISPackageActivity, bool) { + return nil, false +} + +// AsHDInsightSparkActivity is the BasicActivity implementation for IfConditionActivity. +func (ica IfConditionActivity) AsHDInsightSparkActivity() (*HDInsightSparkActivity, bool) { + return nil, false +} + +// AsHDInsightStreamingActivity is the BasicActivity implementation for IfConditionActivity. +func (ica IfConditionActivity) AsHDInsightStreamingActivity() (*HDInsightStreamingActivity, bool) { + return nil, false +} + +// AsHDInsightMapReduceActivity is the BasicActivity implementation for IfConditionActivity. +func (ica IfConditionActivity) AsHDInsightMapReduceActivity() (*HDInsightMapReduceActivity, bool) { + return nil, false +} + +// AsHDInsightPigActivity is the BasicActivity implementation for IfConditionActivity. +func (ica IfConditionActivity) AsHDInsightPigActivity() (*HDInsightPigActivity, bool) { + return nil, false +} + +// AsHDInsightHiveActivity is the BasicActivity implementation for IfConditionActivity. +func (ica IfConditionActivity) AsHDInsightHiveActivity() (*HDInsightHiveActivity, bool) { + return nil, false +} + +// AsCopyActivity is the BasicActivity implementation for IfConditionActivity. +func (ica IfConditionActivity) AsCopyActivity() (*CopyActivity, bool) { + return nil, false +} + +// AsExecutionActivity is the BasicActivity implementation for IfConditionActivity. +func (ica IfConditionActivity) AsExecutionActivity() (*ExecutionActivity, bool) { + return nil, false +} + +// AsBasicExecutionActivity is the BasicActivity implementation for IfConditionActivity. +func (ica IfConditionActivity) AsBasicExecutionActivity() (BasicExecutionActivity, bool) { + return nil, false +} + +// AsFilterActivity is the BasicActivity implementation for IfConditionActivity. +func (ica IfConditionActivity) AsFilterActivity() (*FilterActivity, bool) { + return nil, false +} + +// AsUntilActivity is the BasicActivity implementation for IfConditionActivity. +func (ica IfConditionActivity) AsUntilActivity() (*UntilActivity, bool) { + return nil, false +} + +// AsWaitActivity is the BasicActivity implementation for IfConditionActivity. +func (ica IfConditionActivity) AsWaitActivity() (*WaitActivity, bool) { + return nil, false +} + +// AsForEachActivity is the BasicActivity implementation for IfConditionActivity. +func (ica IfConditionActivity) AsForEachActivity() (*ForEachActivity, bool) { + return nil, false +} + +// AsIfConditionActivity is the BasicActivity implementation for IfConditionActivity. +func (ica IfConditionActivity) AsIfConditionActivity() (*IfConditionActivity, bool) { + return &ica, true +} + +// AsExecutePipelineActivity is the BasicActivity implementation for IfConditionActivity. +func (ica IfConditionActivity) AsExecutePipelineActivity() (*ExecutePipelineActivity, bool) { + return nil, false +} + +// AsControlActivity is the BasicActivity implementation for IfConditionActivity. +func (ica IfConditionActivity) AsControlActivity() (*ControlActivity, bool) { + return nil, false +} + +// AsBasicControlActivity is the BasicActivity implementation for IfConditionActivity. +func (ica IfConditionActivity) AsBasicControlActivity() (BasicControlActivity, bool) { + return &ica, true +} + +// AsActivity is the BasicActivity implementation for IfConditionActivity. +func (ica IfConditionActivity) AsActivity() (*Activity, bool) { + return nil, false +} + +// AsBasicActivity is the BasicActivity implementation for IfConditionActivity. +func (ica IfConditionActivity) AsBasicActivity() (BasicActivity, bool) { + return &ica, true +} + +// UnmarshalJSON is the custom unmarshaler for IfConditionActivity struct. +func (ica *IfConditionActivity) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "typeProperties": + if v != nil { + var ifConditionActivityTypeProperties IfConditionActivityTypeProperties + err = json.Unmarshal(*v, &ifConditionActivityTypeProperties) + if err != nil { + return err + } + ica.IfConditionActivityTypeProperties = &ifConditionActivityTypeProperties + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if ica.AdditionalProperties == nil { + ica.AdditionalProperties = make(map[string]interface{}) + } + ica.AdditionalProperties[k] = additionalProperties + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ica.Name = &name + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + ica.Description = &description + } + case "dependsOn": + if v != nil { + var dependsOn []ActivityDependency + err = json.Unmarshal(*v, &dependsOn) + if err != nil { + return err + } + ica.DependsOn = &dependsOn + } + case "userProperties": + if v != nil { + var userProperties map[string]*string + err = json.Unmarshal(*v, &userProperties) + if err != nil { + return err + } + ica.UserProperties = userProperties + } + case "type": + if v != nil { + var typeVar TypeBasicActivity + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ica.Type = typeVar + } + } + } + + return nil +} + +// IfConditionActivityTypeProperties ifCondition activity properties. +type IfConditionActivityTypeProperties struct { + // Expression - An expression that would evaluate to Boolean. This is used to determine the block of activities (ifTrueActivities or ifFalseActivities) that will be executed. + Expression *Expression `json:"expression,omitempty"` + // IfTrueActivities - List of activities to execute if expression is evaluated to true. This is an optional property and if not provided, the activity will exit without any action. + IfTrueActivities *[]BasicActivity `json:"ifTrueActivities,omitempty"` + // IfFalseActivities - List of activities to execute if expression is evaluated to false. This is an optional property and if not provided, the activity will exit without any action. + IfFalseActivities *[]BasicActivity `json:"ifFalseActivities,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for IfConditionActivityTypeProperties struct. +func (icatp *IfConditionActivityTypeProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "expression": + if v != nil { + var expression Expression + err = json.Unmarshal(*v, &expression) + if err != nil { + return err + } + icatp.Expression = &expression + } + case "ifTrueActivities": + if v != nil { + ifTrueActivities, err := unmarshalBasicActivityArray(*v) + if err != nil { + return err + } + icatp.IfTrueActivities = &ifTrueActivities + } + case "ifFalseActivities": + if v != nil { + ifFalseActivities, err := unmarshalBasicActivityArray(*v) + if err != nil { + return err + } + icatp.IfFalseActivities = &ifFalseActivities + } + } + } + + return nil +} + +// ImpalaLinkedService impala server linked service. +type ImpalaLinkedService struct { + // ImpalaLinkedServiceTypeProperties - Impala server linked service properties. + *ImpalaLinkedServiceTypeProperties `json:"typeProperties,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // ConnectVia - The integration runtime reference. + ConnectVia *IntegrationRuntimeReference `json:"connectVia,omitempty"` + // Description - Linked service description. + Description *string `json:"description,omitempty"` + // Parameters - Parameters for linked service. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeLinkedService', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforce', 'TypeAzureDataLakeStore', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureStorage' + Type TypeBasicLinkedService `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ImpalaLinkedService. +func (ils ImpalaLinkedService) MarshalJSON() ([]byte, error) { + ils.Type = TypeImpala + objectMap := make(map[string]interface{}) + if ils.ImpalaLinkedServiceTypeProperties != nil { + objectMap["typeProperties"] = ils.ImpalaLinkedServiceTypeProperties + } + if ils.ConnectVia != nil { + objectMap["connectVia"] = ils.ConnectVia + } + if ils.Description != nil { + objectMap["description"] = ils.Description + } + if ils.Parameters != nil { + objectMap["parameters"] = ils.Parameters + } + if ils.Annotations != nil { + objectMap["annotations"] = ils.Annotations + } + if ils.Type != "" { + objectMap["type"] = ils.Type + } + for k, v := range ils.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysLinkedService is the BasicLinkedService implementation for ImpalaLinkedService. +func (ils ImpalaLinkedService) AsResponsysLinkedService() (*ResponsysLinkedService, bool) { + return nil, false +} + +// AsAzureDatabricksLinkedService is the BasicLinkedService implementation for ImpalaLinkedService. +func (ils ImpalaLinkedService) AsAzureDatabricksLinkedService() (*AzureDatabricksLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeAnalyticsLinkedService is the BasicLinkedService implementation for ImpalaLinkedService. +func (ils ImpalaLinkedService) AsAzureDataLakeAnalyticsLinkedService() (*AzureDataLakeAnalyticsLinkedService, bool) { + return nil, false +} + +// AsHDInsightOnDemandLinkedService is the BasicLinkedService implementation for ImpalaLinkedService. +func (ils ImpalaLinkedService) AsHDInsightOnDemandLinkedService() (*HDInsightOnDemandLinkedService, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudLinkedService is the BasicLinkedService implementation for ImpalaLinkedService. +func (ils ImpalaLinkedService) AsSalesforceMarketingCloudLinkedService() (*SalesforceMarketingCloudLinkedService, bool) { + return nil, false +} + +// AsNetezzaLinkedService is the BasicLinkedService implementation for ImpalaLinkedService. +func (ils ImpalaLinkedService) AsNetezzaLinkedService() (*NetezzaLinkedService, bool) { + return nil, false +} + +// AsVerticaLinkedService is the BasicLinkedService implementation for ImpalaLinkedService. +func (ils ImpalaLinkedService) AsVerticaLinkedService() (*VerticaLinkedService, bool) { + return nil, false +} + +// AsZohoLinkedService is the BasicLinkedService implementation for ImpalaLinkedService. +func (ils ImpalaLinkedService) AsZohoLinkedService() (*ZohoLinkedService, bool) { + return nil, false +} + +// AsXeroLinkedService is the BasicLinkedService implementation for ImpalaLinkedService. +func (ils ImpalaLinkedService) AsXeroLinkedService() (*XeroLinkedService, bool) { + return nil, false +} + +// AsSquareLinkedService is the BasicLinkedService implementation for ImpalaLinkedService. +func (ils ImpalaLinkedService) AsSquareLinkedService() (*SquareLinkedService, bool) { + return nil, false +} + +// AsSparkLinkedService is the BasicLinkedService implementation for ImpalaLinkedService. +func (ils ImpalaLinkedService) AsSparkLinkedService() (*SparkLinkedService, bool) { + return nil, false +} + +// AsShopifyLinkedService is the BasicLinkedService implementation for ImpalaLinkedService. +func (ils ImpalaLinkedService) AsShopifyLinkedService() (*ShopifyLinkedService, bool) { + return nil, false +} + +// AsServiceNowLinkedService is the BasicLinkedService implementation for ImpalaLinkedService. +func (ils ImpalaLinkedService) AsServiceNowLinkedService() (*ServiceNowLinkedService, bool) { + return nil, false +} + +// AsQuickBooksLinkedService is the BasicLinkedService implementation for ImpalaLinkedService. +func (ils ImpalaLinkedService) AsQuickBooksLinkedService() (*QuickBooksLinkedService, bool) { + return nil, false +} + +// AsPrestoLinkedService is the BasicLinkedService implementation for ImpalaLinkedService. +func (ils ImpalaLinkedService) AsPrestoLinkedService() (*PrestoLinkedService, bool) { + return nil, false +} + +// AsPhoenixLinkedService is the BasicLinkedService implementation for ImpalaLinkedService. +func (ils ImpalaLinkedService) AsPhoenixLinkedService() (*PhoenixLinkedService, bool) { + return nil, false +} + +// AsPaypalLinkedService is the BasicLinkedService implementation for ImpalaLinkedService. +func (ils ImpalaLinkedService) AsPaypalLinkedService() (*PaypalLinkedService, bool) { + return nil, false +} + +// AsMarketoLinkedService is the BasicLinkedService implementation for ImpalaLinkedService. +func (ils ImpalaLinkedService) AsMarketoLinkedService() (*MarketoLinkedService, bool) { + return nil, false +} + +// AsMariaDBLinkedService is the BasicLinkedService implementation for ImpalaLinkedService. +func (ils ImpalaLinkedService) AsMariaDBLinkedService() (*MariaDBLinkedService, bool) { + return nil, false +} + +// AsMagentoLinkedService is the BasicLinkedService implementation for ImpalaLinkedService. +func (ils ImpalaLinkedService) AsMagentoLinkedService() (*MagentoLinkedService, bool) { + return nil, false +} + +// AsJiraLinkedService is the BasicLinkedService implementation for ImpalaLinkedService. +func (ils ImpalaLinkedService) AsJiraLinkedService() (*JiraLinkedService, bool) { + return nil, false +} + +// AsImpalaLinkedService is the BasicLinkedService implementation for ImpalaLinkedService. +func (ils ImpalaLinkedService) AsImpalaLinkedService() (*ImpalaLinkedService, bool) { + return &ils, true +} + +// AsHubspotLinkedService is the BasicLinkedService implementation for ImpalaLinkedService. +func (ils ImpalaLinkedService) AsHubspotLinkedService() (*HubspotLinkedService, bool) { + return nil, false +} + +// AsHiveLinkedService is the BasicLinkedService implementation for ImpalaLinkedService. +func (ils ImpalaLinkedService) AsHiveLinkedService() (*HiveLinkedService, bool) { + return nil, false +} + +// AsHBaseLinkedService is the BasicLinkedService implementation for ImpalaLinkedService. +func (ils ImpalaLinkedService) AsHBaseLinkedService() (*HBaseLinkedService, bool) { + return nil, false +} + +// AsGreenplumLinkedService is the BasicLinkedService implementation for ImpalaLinkedService. +func (ils ImpalaLinkedService) AsGreenplumLinkedService() (*GreenplumLinkedService, bool) { + return nil, false +} + +// AsGoogleBigQueryLinkedService is the BasicLinkedService implementation for ImpalaLinkedService. +func (ils ImpalaLinkedService) AsGoogleBigQueryLinkedService() (*GoogleBigQueryLinkedService, bool) { + return nil, false +} + +// AsEloquaLinkedService is the BasicLinkedService implementation for ImpalaLinkedService. +func (ils ImpalaLinkedService) AsEloquaLinkedService() (*EloquaLinkedService, bool) { + return nil, false +} + +// AsDrillLinkedService is the BasicLinkedService implementation for ImpalaLinkedService. +func (ils ImpalaLinkedService) AsDrillLinkedService() (*DrillLinkedService, bool) { + return nil, false +} + +// AsCouchbaseLinkedService is the BasicLinkedService implementation for ImpalaLinkedService. +func (ils ImpalaLinkedService) AsCouchbaseLinkedService() (*CouchbaseLinkedService, bool) { + return nil, false +} + +// AsConcurLinkedService is the BasicLinkedService implementation for ImpalaLinkedService. +func (ils ImpalaLinkedService) AsConcurLinkedService() (*ConcurLinkedService, bool) { + return nil, false +} + +// AsAzurePostgreSQLLinkedService is the BasicLinkedService implementation for ImpalaLinkedService. +func (ils ImpalaLinkedService) AsAzurePostgreSQLLinkedService() (*AzurePostgreSQLLinkedService, bool) { + return nil, false +} + +// AsAmazonMWSLinkedService is the BasicLinkedService implementation for ImpalaLinkedService. +func (ils ImpalaLinkedService) AsAmazonMWSLinkedService() (*AmazonMWSLinkedService, bool) { + return nil, false +} + +// AsSapHanaLinkedService is the BasicLinkedService implementation for ImpalaLinkedService. +func (ils ImpalaLinkedService) AsSapHanaLinkedService() (*SapHanaLinkedService, bool) { + return nil, false +} + +// AsSapBWLinkedService is the BasicLinkedService implementation for ImpalaLinkedService. +func (ils ImpalaLinkedService) AsSapBWLinkedService() (*SapBWLinkedService, bool) { + return nil, false +} + +// AsSftpServerLinkedService is the BasicLinkedService implementation for ImpalaLinkedService. +func (ils ImpalaLinkedService) AsSftpServerLinkedService() (*SftpServerLinkedService, bool) { + return nil, false +} + +// AsFtpServerLinkedService is the BasicLinkedService implementation for ImpalaLinkedService. +func (ils ImpalaLinkedService) AsFtpServerLinkedService() (*FtpServerLinkedService, bool) { + return nil, false +} + +// AsHTTPLinkedService is the BasicLinkedService implementation for ImpalaLinkedService. +func (ils ImpalaLinkedService) AsHTTPLinkedService() (*HTTPLinkedService, bool) { + return nil, false +} + +// AsAzureSearchLinkedService is the BasicLinkedService implementation for ImpalaLinkedService. +func (ils ImpalaLinkedService) AsAzureSearchLinkedService() (*AzureSearchLinkedService, bool) { + return nil, false +} + +// AsCustomDataSourceLinkedService is the BasicLinkedService implementation for ImpalaLinkedService. +func (ils ImpalaLinkedService) AsCustomDataSourceLinkedService() (*CustomDataSourceLinkedService, bool) { + return nil, false +} + +// AsAmazonRedshiftLinkedService is the BasicLinkedService implementation for ImpalaLinkedService. +func (ils ImpalaLinkedService) AsAmazonRedshiftLinkedService() (*AmazonRedshiftLinkedService, bool) { + return nil, false +} + +// AsAmazonS3LinkedService is the BasicLinkedService implementation for ImpalaLinkedService. +func (ils ImpalaLinkedService) AsAmazonS3LinkedService() (*AmazonS3LinkedService, bool) { + return nil, false +} + +// AsSapEccLinkedService is the BasicLinkedService implementation for ImpalaLinkedService. +func (ils ImpalaLinkedService) AsSapEccLinkedService() (*SapEccLinkedService, bool) { + return nil, false +} + +// AsSapCloudForCustomerLinkedService is the BasicLinkedService implementation for ImpalaLinkedService. +func (ils ImpalaLinkedService) AsSapCloudForCustomerLinkedService() (*SapCloudForCustomerLinkedService, bool) { + return nil, false +} + +// AsSalesforceLinkedService is the BasicLinkedService implementation for ImpalaLinkedService. +func (ils ImpalaLinkedService) AsSalesforceLinkedService() (*SalesforceLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeStoreLinkedService is the BasicLinkedService implementation for ImpalaLinkedService. +func (ils ImpalaLinkedService) AsAzureDataLakeStoreLinkedService() (*AzureDataLakeStoreLinkedService, bool) { + return nil, false +} + +// AsMongoDbLinkedService is the BasicLinkedService implementation for ImpalaLinkedService. +func (ils ImpalaLinkedService) AsMongoDbLinkedService() (*MongoDbLinkedService, bool) { + return nil, false +} + +// AsCassandraLinkedService is the BasicLinkedService implementation for ImpalaLinkedService. +func (ils ImpalaLinkedService) AsCassandraLinkedService() (*CassandraLinkedService, bool) { + return nil, false +} + +// AsWebLinkedService is the BasicLinkedService implementation for ImpalaLinkedService. +func (ils ImpalaLinkedService) AsWebLinkedService() (*WebLinkedService, bool) { + return nil, false +} + +// AsODataLinkedService is the BasicLinkedService implementation for ImpalaLinkedService. +func (ils ImpalaLinkedService) AsODataLinkedService() (*ODataLinkedService, bool) { + return nil, false +} + +// AsHdfsLinkedService is the BasicLinkedService implementation for ImpalaLinkedService. +func (ils ImpalaLinkedService) AsHdfsLinkedService() (*HdfsLinkedService, bool) { + return nil, false +} + +// AsOdbcLinkedService is the BasicLinkedService implementation for ImpalaLinkedService. +func (ils ImpalaLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, bool) { + return nil, false +} + +// AsAzureMLLinkedService is the BasicLinkedService implementation for ImpalaLinkedService. +func (ils ImpalaLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { + return nil, false +} + +// AsTeradataLinkedService is the BasicLinkedService implementation for ImpalaLinkedService. +func (ils ImpalaLinkedService) AsTeradataLinkedService() (*TeradataLinkedService, bool) { + return nil, false +} + +// AsDb2LinkedService is the BasicLinkedService implementation for ImpalaLinkedService. +func (ils ImpalaLinkedService) AsDb2LinkedService() (*Db2LinkedService, bool) { + return nil, false +} + +// AsSybaseLinkedService is the BasicLinkedService implementation for ImpalaLinkedService. +func (ils ImpalaLinkedService) AsSybaseLinkedService() (*SybaseLinkedService, bool) { + return nil, false +} + +// AsPostgreSQLLinkedService is the BasicLinkedService implementation for ImpalaLinkedService. +func (ils ImpalaLinkedService) AsPostgreSQLLinkedService() (*PostgreSQLLinkedService, bool) { + return nil, false +} + +// AsMySQLLinkedService is the BasicLinkedService implementation for ImpalaLinkedService. +func (ils ImpalaLinkedService) AsMySQLLinkedService() (*MySQLLinkedService, bool) { + return nil, false +} + +// AsAzureMySQLLinkedService is the BasicLinkedService implementation for ImpalaLinkedService. +func (ils ImpalaLinkedService) AsAzureMySQLLinkedService() (*AzureMySQLLinkedService, bool) { + return nil, false +} + +// AsOracleLinkedService is the BasicLinkedService implementation for ImpalaLinkedService. +func (ils ImpalaLinkedService) AsOracleLinkedService() (*OracleLinkedService, bool) { + return nil, false +} + +// AsFileServerLinkedService is the BasicLinkedService implementation for ImpalaLinkedService. +func (ils ImpalaLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { + return nil, false +} + +// AsHDInsightLinkedService is the BasicLinkedService implementation for ImpalaLinkedService. +func (ils ImpalaLinkedService) AsHDInsightLinkedService() (*HDInsightLinkedService, bool) { + return nil, false +} + +// AsDynamicsLinkedService is the BasicLinkedService implementation for ImpalaLinkedService. +func (ils ImpalaLinkedService) AsDynamicsLinkedService() (*DynamicsLinkedService, bool) { + return nil, false +} + +// AsCosmosDbLinkedService is the BasicLinkedService implementation for ImpalaLinkedService. +func (ils ImpalaLinkedService) AsCosmosDbLinkedService() (*CosmosDbLinkedService, bool) { + return nil, false +} + +// AsAzureKeyVaultLinkedService is the BasicLinkedService implementation for ImpalaLinkedService. +func (ils ImpalaLinkedService) AsAzureKeyVaultLinkedService() (*AzureKeyVaultLinkedService, bool) { + return nil, false +} + +// AsAzureBatchLinkedService is the BasicLinkedService implementation for ImpalaLinkedService. +func (ils ImpalaLinkedService) AsAzureBatchLinkedService() (*AzureBatchLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDatabaseLinkedService is the BasicLinkedService implementation for ImpalaLinkedService. +func (ils ImpalaLinkedService) AsAzureSQLDatabaseLinkedService() (*AzureSQLDatabaseLinkedService, bool) { + return nil, false +} + +// AsSQLServerLinkedService is the BasicLinkedService implementation for ImpalaLinkedService. +func (ils ImpalaLinkedService) AsSQLServerLinkedService() (*SQLServerLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDWLinkedService is the BasicLinkedService implementation for ImpalaLinkedService. +func (ils ImpalaLinkedService) AsAzureSQLDWLinkedService() (*AzureSQLDWLinkedService, bool) { + return nil, false +} + +// AsAzureStorageLinkedService is the BasicLinkedService implementation for ImpalaLinkedService. +func (ils ImpalaLinkedService) AsAzureStorageLinkedService() (*AzureStorageLinkedService, bool) { + return nil, false +} + +// AsLinkedService is the BasicLinkedService implementation for ImpalaLinkedService. +func (ils ImpalaLinkedService) AsLinkedService() (*LinkedService, bool) { + return nil, false +} + +// AsBasicLinkedService is the BasicLinkedService implementation for ImpalaLinkedService. +func (ils ImpalaLinkedService) AsBasicLinkedService() (BasicLinkedService, bool) { + return &ils, true +} + +// UnmarshalJSON is the custom unmarshaler for ImpalaLinkedService struct. +func (ils *ImpalaLinkedService) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "typeProperties": + if v != nil { + var impalaLinkedServiceTypeProperties ImpalaLinkedServiceTypeProperties + err = json.Unmarshal(*v, &impalaLinkedServiceTypeProperties) + if err != nil { + return err + } + ils.ImpalaLinkedServiceTypeProperties = &impalaLinkedServiceTypeProperties + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if ils.AdditionalProperties == nil { + ils.AdditionalProperties = make(map[string]interface{}) + } + ils.AdditionalProperties[k] = additionalProperties + } + case "connectVia": + if v != nil { + var connectVia IntegrationRuntimeReference + err = json.Unmarshal(*v, &connectVia) + if err != nil { + return err + } + ils.ConnectVia = &connectVia + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + ils.Description = &description + } + case "parameters": + if v != nil { + var parameters map[string]*ParameterSpecification + err = json.Unmarshal(*v, ¶meters) + if err != nil { + return err + } + ils.Parameters = parameters + } + case "annotations": + if v != nil { + var annotations []interface{} + err = json.Unmarshal(*v, &annotations) + if err != nil { + return err + } + ils.Annotations = &annotations + } + case "type": + if v != nil { + var typeVar TypeBasicLinkedService + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ils.Type = typeVar + } + } + } + + return nil +} + +// ImpalaLinkedServiceTypeProperties impala server linked service properties. +type ImpalaLinkedServiceTypeProperties struct { + // Host - The IP address or host name of the Impala server. (i.e. 192.168.222.160) + Host interface{} `json:"host,omitempty"` + // Port - The TCP port that the Impala server uses to listen for client connections. The default value is 21050. + Port interface{} `json:"port,omitempty"` + // AuthenticationType - The authentication type to use. Possible values include: 'ImpalaAuthenticationTypeAnonymous', 'ImpalaAuthenticationTypeSASLUsername', 'ImpalaAuthenticationTypeUsernameAndPassword' + AuthenticationType ImpalaAuthenticationType `json:"authenticationType,omitempty"` + // Username - The user name used to access the Impala server. The default value is anonymous when using SASLUsername. + Username interface{} `json:"username,omitempty"` + // Password - The password corresponding to the user name when using UsernameAndPassword. + Password BasicSecretBase `json:"password,omitempty"` + // EnableSsl - Specifies whether the connections to the server are encrypted using SSL. The default value is false. + EnableSsl interface{} `json:"enableSsl,omitempty"` + // TrustedCertPath - The full path of the .pem file containing trusted CA certificates for verifying the server when connecting over SSL. This property can only be set when using SSL on self-hosted IR. The default value is the cacerts.pem file installed with the IR. + TrustedCertPath interface{} `json:"trustedCertPath,omitempty"` + // UseSystemTrustStore - Specifies whether to use a CA certificate from the system trust store or from a specified PEM file. The default value is false. + UseSystemTrustStore interface{} `json:"useSystemTrustStore,omitempty"` + // AllowHostNameCNMismatch - Specifies whether to require a CA-issued SSL certificate name to match the host name of the server when connecting over SSL. The default value is false. + AllowHostNameCNMismatch interface{} `json:"allowHostNameCNMismatch,omitempty"` + // AllowSelfSignedServerCert - Specifies whether to allow self-signed certificates from the server. The default value is false. + AllowSelfSignedServerCert interface{} `json:"allowSelfSignedServerCert,omitempty"` + // EncryptedCredential - The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string). + EncryptedCredential interface{} `json:"encryptedCredential,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for ImpalaLinkedServiceTypeProperties struct. +func (ilstp *ImpalaLinkedServiceTypeProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "host": + if v != nil { + var host interface{} + err = json.Unmarshal(*v, &host) + if err != nil { + return err + } + ilstp.Host = host + } + case "port": + if v != nil { + var port interface{} + err = json.Unmarshal(*v, &port) + if err != nil { + return err + } + ilstp.Port = port + } + case "authenticationType": + if v != nil { + var authenticationType ImpalaAuthenticationType + err = json.Unmarshal(*v, &authenticationType) + if err != nil { + return err + } + ilstp.AuthenticationType = authenticationType + } + case "username": + if v != nil { + var username interface{} + err = json.Unmarshal(*v, &username) + if err != nil { + return err + } + ilstp.Username = username + } + case "password": + if v != nil { + password, err := unmarshalBasicSecretBase(*v) + if err != nil { + return err + } + ilstp.Password = password + } + case "enableSsl": + if v != nil { + var enableSsl interface{} + err = json.Unmarshal(*v, &enableSsl) + if err != nil { + return err + } + ilstp.EnableSsl = enableSsl + } + case "trustedCertPath": + if v != nil { + var trustedCertPath interface{} + err = json.Unmarshal(*v, &trustedCertPath) + if err != nil { + return err + } + ilstp.TrustedCertPath = trustedCertPath + } + case "useSystemTrustStore": + if v != nil { + var useSystemTrustStore interface{} + err = json.Unmarshal(*v, &useSystemTrustStore) + if err != nil { + return err + } + ilstp.UseSystemTrustStore = useSystemTrustStore + } + case "allowHostNameCNMismatch": + if v != nil { + var allowHostNameCNMismatch interface{} + err = json.Unmarshal(*v, &allowHostNameCNMismatch) + if err != nil { + return err + } + ilstp.AllowHostNameCNMismatch = allowHostNameCNMismatch + } + case "allowSelfSignedServerCert": + if v != nil { + var allowSelfSignedServerCert interface{} + err = json.Unmarshal(*v, &allowSelfSignedServerCert) + if err != nil { + return err + } + ilstp.AllowSelfSignedServerCert = allowSelfSignedServerCert + } + case "encryptedCredential": + if v != nil { + var encryptedCredential interface{} + err = json.Unmarshal(*v, &encryptedCredential) + if err != nil { + return err + } + ilstp.EncryptedCredential = encryptedCredential + } + } + } + + return nil +} + +// ImpalaObjectDataset impala server dataset. +type ImpalaObjectDataset struct { + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Description - Dataset description. + Description *string `json:"description,omitempty"` + // Structure - Columns that define the structure of the dataset. Type: array (or Expression with resultType array), itemType: DatasetDataElement. + Structure interface{} `json:"structure,omitempty"` + // LinkedServiceName - Linked service reference. + LinkedServiceName *LinkedServiceReference `json:"linkedServiceName,omitempty"` + // Parameters - Parameters for dataset. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeDataset', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSQLServerTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSalesforceObject', 'TypeRelationalTable', 'TypeAzureMySQLTable', 'TypeOracleTable', 'TypeODataResource', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeAzureDataLakeStoreFile', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeAmazonS3Object' + Type TypeBasicDataset `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ImpalaObjectDataset. +func (iod ImpalaObjectDataset) MarshalJSON() ([]byte, error) { + iod.Type = TypeImpalaObject + objectMap := make(map[string]interface{}) + if iod.Description != nil { + objectMap["description"] = iod.Description + } + objectMap["structure"] = iod.Structure + if iod.LinkedServiceName != nil { + objectMap["linkedServiceName"] = iod.LinkedServiceName + } + if iod.Parameters != nil { + objectMap["parameters"] = iod.Parameters + } + if iod.Annotations != nil { + objectMap["annotations"] = iod.Annotations + } + if iod.Type != "" { + objectMap["type"] = iod.Type + } + for k, v := range iod.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysObjectDataset is the BasicDataset implementation for ImpalaObjectDataset. +func (iod ImpalaObjectDataset) AsResponsysObjectDataset() (*ResponsysObjectDataset, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudObjectDataset is the BasicDataset implementation for ImpalaObjectDataset. +func (iod ImpalaObjectDataset) AsSalesforceMarketingCloudObjectDataset() (*SalesforceMarketingCloudObjectDataset, bool) { + return nil, false +} + +// AsVerticaTableDataset is the BasicDataset implementation for ImpalaObjectDataset. +func (iod ImpalaObjectDataset) AsVerticaTableDataset() (*VerticaTableDataset, bool) { + return nil, false +} + +// AsNetezzaTableDataset is the BasicDataset implementation for ImpalaObjectDataset. +func (iod ImpalaObjectDataset) AsNetezzaTableDataset() (*NetezzaTableDataset, bool) { + return nil, false +} + +// AsZohoObjectDataset is the BasicDataset implementation for ImpalaObjectDataset. +func (iod ImpalaObjectDataset) AsZohoObjectDataset() (*ZohoObjectDataset, bool) { + return nil, false +} + +// AsXeroObjectDataset is the BasicDataset implementation for ImpalaObjectDataset. +func (iod ImpalaObjectDataset) AsXeroObjectDataset() (*XeroObjectDataset, bool) { + return nil, false +} + +// AsSquareObjectDataset is the BasicDataset implementation for ImpalaObjectDataset. +func (iod ImpalaObjectDataset) AsSquareObjectDataset() (*SquareObjectDataset, bool) { + return nil, false +} + +// AsSparkObjectDataset is the BasicDataset implementation for ImpalaObjectDataset. +func (iod ImpalaObjectDataset) AsSparkObjectDataset() (*SparkObjectDataset, bool) { + return nil, false +} + +// AsShopifyObjectDataset is the BasicDataset implementation for ImpalaObjectDataset. +func (iod ImpalaObjectDataset) AsShopifyObjectDataset() (*ShopifyObjectDataset, bool) { + return nil, false +} + +// AsServiceNowObjectDataset is the BasicDataset implementation for ImpalaObjectDataset. +func (iod ImpalaObjectDataset) AsServiceNowObjectDataset() (*ServiceNowObjectDataset, bool) { + return nil, false +} + +// AsQuickBooksObjectDataset is the BasicDataset implementation for ImpalaObjectDataset. +func (iod ImpalaObjectDataset) AsQuickBooksObjectDataset() (*QuickBooksObjectDataset, bool) { + return nil, false +} + +// AsPrestoObjectDataset is the BasicDataset implementation for ImpalaObjectDataset. +func (iod ImpalaObjectDataset) AsPrestoObjectDataset() (*PrestoObjectDataset, bool) { + return nil, false +} + +// AsPhoenixObjectDataset is the BasicDataset implementation for ImpalaObjectDataset. +func (iod ImpalaObjectDataset) AsPhoenixObjectDataset() (*PhoenixObjectDataset, bool) { + return nil, false +} + +// AsPaypalObjectDataset is the BasicDataset implementation for ImpalaObjectDataset. +func (iod ImpalaObjectDataset) AsPaypalObjectDataset() (*PaypalObjectDataset, bool) { + return nil, false +} + +// AsMarketoObjectDataset is the BasicDataset implementation for ImpalaObjectDataset. +func (iod ImpalaObjectDataset) AsMarketoObjectDataset() (*MarketoObjectDataset, bool) { + return nil, false +} + +// AsMariaDBTableDataset is the BasicDataset implementation for ImpalaObjectDataset. +func (iod ImpalaObjectDataset) AsMariaDBTableDataset() (*MariaDBTableDataset, bool) { + return nil, false +} + +// AsMagentoObjectDataset is the BasicDataset implementation for ImpalaObjectDataset. +func (iod ImpalaObjectDataset) AsMagentoObjectDataset() (*MagentoObjectDataset, bool) { + return nil, false +} + +// AsJiraObjectDataset is the BasicDataset implementation for ImpalaObjectDataset. +func (iod ImpalaObjectDataset) AsJiraObjectDataset() (*JiraObjectDataset, bool) { + return nil, false +} + +// AsImpalaObjectDataset is the BasicDataset implementation for ImpalaObjectDataset. +func (iod ImpalaObjectDataset) AsImpalaObjectDataset() (*ImpalaObjectDataset, bool) { + return &iod, true +} + +// AsHubspotObjectDataset is the BasicDataset implementation for ImpalaObjectDataset. +func (iod ImpalaObjectDataset) AsHubspotObjectDataset() (*HubspotObjectDataset, bool) { + return nil, false +} + +// AsHiveObjectDataset is the BasicDataset implementation for ImpalaObjectDataset. +func (iod ImpalaObjectDataset) AsHiveObjectDataset() (*HiveObjectDataset, bool) { + return nil, false +} + +// AsHBaseObjectDataset is the BasicDataset implementation for ImpalaObjectDataset. +func (iod ImpalaObjectDataset) AsHBaseObjectDataset() (*HBaseObjectDataset, bool) { + return nil, false +} + +// AsGreenplumTableDataset is the BasicDataset implementation for ImpalaObjectDataset. +func (iod ImpalaObjectDataset) AsGreenplumTableDataset() (*GreenplumTableDataset, bool) { + return nil, false +} + +// AsGoogleBigQueryObjectDataset is the BasicDataset implementation for ImpalaObjectDataset. +func (iod ImpalaObjectDataset) AsGoogleBigQueryObjectDataset() (*GoogleBigQueryObjectDataset, bool) { + return nil, false +} + +// AsEloquaObjectDataset is the BasicDataset implementation for ImpalaObjectDataset. +func (iod ImpalaObjectDataset) AsEloquaObjectDataset() (*EloquaObjectDataset, bool) { + return nil, false +} + +// AsDrillTableDataset is the BasicDataset implementation for ImpalaObjectDataset. +func (iod ImpalaObjectDataset) AsDrillTableDataset() (*DrillTableDataset, bool) { + return nil, false +} + +// AsCouchbaseTableDataset is the BasicDataset implementation for ImpalaObjectDataset. +func (iod ImpalaObjectDataset) AsCouchbaseTableDataset() (*CouchbaseTableDataset, bool) { + return nil, false +} + +// AsConcurObjectDataset is the BasicDataset implementation for ImpalaObjectDataset. +func (iod ImpalaObjectDataset) AsConcurObjectDataset() (*ConcurObjectDataset, bool) { + return nil, false +} + +// AsAzurePostgreSQLTableDataset is the BasicDataset implementation for ImpalaObjectDataset. +func (iod ImpalaObjectDataset) AsAzurePostgreSQLTableDataset() (*AzurePostgreSQLTableDataset, bool) { + return nil, false +} + +// AsAmazonMWSObjectDataset is the BasicDataset implementation for ImpalaObjectDataset. +func (iod ImpalaObjectDataset) AsAmazonMWSObjectDataset() (*AmazonMWSObjectDataset, bool) { + return nil, false +} + +// AsHTTPDataset is the BasicDataset implementation for ImpalaObjectDataset. +func (iod ImpalaObjectDataset) AsHTTPDataset() (*HTTPDataset, bool) { + return nil, false +} + +// AsAzureSearchIndexDataset is the BasicDataset implementation for ImpalaObjectDataset. +func (iod ImpalaObjectDataset) AsAzureSearchIndexDataset() (*AzureSearchIndexDataset, bool) { + return nil, false +} + +// AsWebTableDataset is the BasicDataset implementation for ImpalaObjectDataset. +func (iod ImpalaObjectDataset) AsWebTableDataset() (*WebTableDataset, bool) { + return nil, false +} + +// AsSQLServerTableDataset is the BasicDataset implementation for ImpalaObjectDataset. +func (iod ImpalaObjectDataset) AsSQLServerTableDataset() (*SQLServerTableDataset, bool) { + return nil, false +} + +// AsSapEccResourceDataset is the BasicDataset implementation for ImpalaObjectDataset. +func (iod ImpalaObjectDataset) AsSapEccResourceDataset() (*SapEccResourceDataset, bool) { + return nil, false +} + +// AsSapCloudForCustomerResourceDataset is the BasicDataset implementation for ImpalaObjectDataset. +func (iod ImpalaObjectDataset) AsSapCloudForCustomerResourceDataset() (*SapCloudForCustomerResourceDataset, bool) { + return nil, false +} + +// AsSalesforceObjectDataset is the BasicDataset implementation for ImpalaObjectDataset. +func (iod ImpalaObjectDataset) AsSalesforceObjectDataset() (*SalesforceObjectDataset, bool) { + return nil, false +} + +// AsRelationalTableDataset is the BasicDataset implementation for ImpalaObjectDataset. +func (iod ImpalaObjectDataset) AsRelationalTableDataset() (*RelationalTableDataset, bool) { + return nil, false +} + +// AsAzureMySQLTableDataset is the BasicDataset implementation for ImpalaObjectDataset. +func (iod ImpalaObjectDataset) AsAzureMySQLTableDataset() (*AzureMySQLTableDataset, bool) { + return nil, false +} + +// AsOracleTableDataset is the BasicDataset implementation for ImpalaObjectDataset. +func (iod ImpalaObjectDataset) AsOracleTableDataset() (*OracleTableDataset, bool) { + return nil, false +} + +// AsODataResourceDataset is the BasicDataset implementation for ImpalaObjectDataset. +func (iod ImpalaObjectDataset) AsODataResourceDataset() (*ODataResourceDataset, bool) { + return nil, false +} + +// AsMongoDbCollectionDataset is the BasicDataset implementation for ImpalaObjectDataset. +func (iod ImpalaObjectDataset) AsMongoDbCollectionDataset() (*MongoDbCollectionDataset, bool) { + return nil, false +} + +// AsFileShareDataset is the BasicDataset implementation for ImpalaObjectDataset. +func (iod ImpalaObjectDataset) AsFileShareDataset() (*FileShareDataset, bool) { + return nil, false +} + +// AsAzureDataLakeStoreDataset is the BasicDataset implementation for ImpalaObjectDataset. +func (iod ImpalaObjectDataset) AsAzureDataLakeStoreDataset() (*AzureDataLakeStoreDataset, bool) { + return nil, false +} + +// AsDynamicsEntityDataset is the BasicDataset implementation for ImpalaObjectDataset. +func (iod ImpalaObjectDataset) AsDynamicsEntityDataset() (*DynamicsEntityDataset, bool) { + return nil, false +} + +// AsDocumentDbCollectionDataset is the BasicDataset implementation for ImpalaObjectDataset. +func (iod ImpalaObjectDataset) AsDocumentDbCollectionDataset() (*DocumentDbCollectionDataset, bool) { + return nil, false +} + +// AsCustomDataset is the BasicDataset implementation for ImpalaObjectDataset. +func (iod ImpalaObjectDataset) AsCustomDataset() (*CustomDataset, bool) { + return nil, false +} + +// AsCassandraTableDataset is the BasicDataset implementation for ImpalaObjectDataset. +func (iod ImpalaObjectDataset) AsCassandraTableDataset() (*CassandraTableDataset, bool) { + return nil, false +} + +// AsAzureSQLDWTableDataset is the BasicDataset implementation for ImpalaObjectDataset. +func (iod ImpalaObjectDataset) AsAzureSQLDWTableDataset() (*AzureSQLDWTableDataset, bool) { + return nil, false +} + +// AsAzureSQLTableDataset is the BasicDataset implementation for ImpalaObjectDataset. +func (iod ImpalaObjectDataset) AsAzureSQLTableDataset() (*AzureSQLTableDataset, bool) { + return nil, false +} + +// AsAzureTableDataset is the BasicDataset implementation for ImpalaObjectDataset. +func (iod ImpalaObjectDataset) AsAzureTableDataset() (*AzureTableDataset, bool) { + return nil, false +} + +// AsAzureBlobDataset is the BasicDataset implementation for ImpalaObjectDataset. +func (iod ImpalaObjectDataset) AsAzureBlobDataset() (*AzureBlobDataset, bool) { + return nil, false +} + +// AsAmazonS3Dataset is the BasicDataset implementation for ImpalaObjectDataset. +func (iod ImpalaObjectDataset) AsAmazonS3Dataset() (*AmazonS3Dataset, bool) { + return nil, false +} + +// AsDataset is the BasicDataset implementation for ImpalaObjectDataset. +func (iod ImpalaObjectDataset) AsDataset() (*Dataset, bool) { + return nil, false +} + +// AsBasicDataset is the BasicDataset implementation for ImpalaObjectDataset. +func (iod ImpalaObjectDataset) AsBasicDataset() (BasicDataset, bool) { + return &iod, true +} + +// ImpalaSource a copy activity Impala server source. +type ImpalaSource struct { + // Query - A query to retrieve data from source. Type: string (or Expression with resultType string). + Query interface{} `json:"query,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // SourceRetryCount - Source retry count. Type: integer (or Expression with resultType integer). + SourceRetryCount interface{} `json:"sourceRetryCount,omitempty"` + // SourceRetryWait - Source retry wait. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` + // Type - Possible values include: 'TypeCopySource', 'TypeAmazonRedshiftSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeHTTPSource', 'TypeAzureDataLakeStoreSource', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeRelationalSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource' + Type TypeBasicCopySource `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ImpalaSource. +func (is ImpalaSource) MarshalJSON() ([]byte, error) { + is.Type = TypeImpalaSource + objectMap := make(map[string]interface{}) + objectMap["query"] = is.Query + objectMap["sourceRetryCount"] = is.SourceRetryCount + objectMap["sourceRetryWait"] = is.SourceRetryWait + if is.Type != "" { + objectMap["type"] = is.Type + } + for k, v := range is.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsAmazonRedshiftSource is the BasicCopySource implementation for ImpalaSource. +func (is ImpalaSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { + return nil, false +} + +// AsResponsysSource is the BasicCopySource implementation for ImpalaSource. +func (is ImpalaSource) AsResponsysSource() (*ResponsysSource, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudSource is the BasicCopySource implementation for ImpalaSource. +func (is ImpalaSource) AsSalesforceMarketingCloudSource() (*SalesforceMarketingCloudSource, bool) { + return nil, false +} + +// AsVerticaSource is the BasicCopySource implementation for ImpalaSource. +func (is ImpalaSource) AsVerticaSource() (*VerticaSource, bool) { + return nil, false +} + +// AsNetezzaSource is the BasicCopySource implementation for ImpalaSource. +func (is ImpalaSource) AsNetezzaSource() (*NetezzaSource, bool) { + return nil, false +} + +// AsZohoSource is the BasicCopySource implementation for ImpalaSource. +func (is ImpalaSource) AsZohoSource() (*ZohoSource, bool) { + return nil, false +} + +// AsXeroSource is the BasicCopySource implementation for ImpalaSource. +func (is ImpalaSource) AsXeroSource() (*XeroSource, bool) { + return nil, false +} + +// AsSquareSource is the BasicCopySource implementation for ImpalaSource. +func (is ImpalaSource) AsSquareSource() (*SquareSource, bool) { + return nil, false +} + +// AsSparkSource is the BasicCopySource implementation for ImpalaSource. +func (is ImpalaSource) AsSparkSource() (*SparkSource, bool) { + return nil, false +} + +// AsShopifySource is the BasicCopySource implementation for ImpalaSource. +func (is ImpalaSource) AsShopifySource() (*ShopifySource, bool) { + return nil, false +} + +// AsServiceNowSource is the BasicCopySource implementation for ImpalaSource. +func (is ImpalaSource) AsServiceNowSource() (*ServiceNowSource, bool) { + return nil, false +} + +// AsQuickBooksSource is the BasicCopySource implementation for ImpalaSource. +func (is ImpalaSource) AsQuickBooksSource() (*QuickBooksSource, bool) { + return nil, false +} + +// AsPrestoSource is the BasicCopySource implementation for ImpalaSource. +func (is ImpalaSource) AsPrestoSource() (*PrestoSource, bool) { + return nil, false +} + +// AsPhoenixSource is the BasicCopySource implementation for ImpalaSource. +func (is ImpalaSource) AsPhoenixSource() (*PhoenixSource, bool) { + return nil, false +} + +// AsPaypalSource is the BasicCopySource implementation for ImpalaSource. +func (is ImpalaSource) AsPaypalSource() (*PaypalSource, bool) { + return nil, false +} + +// AsMarketoSource is the BasicCopySource implementation for ImpalaSource. +func (is ImpalaSource) AsMarketoSource() (*MarketoSource, bool) { + return nil, false +} + +// AsMariaDBSource is the BasicCopySource implementation for ImpalaSource. +func (is ImpalaSource) AsMariaDBSource() (*MariaDBSource, bool) { + return nil, false +} + +// AsMagentoSource is the BasicCopySource implementation for ImpalaSource. +func (is ImpalaSource) AsMagentoSource() (*MagentoSource, bool) { + return nil, false +} + +// AsJiraSource is the BasicCopySource implementation for ImpalaSource. +func (is ImpalaSource) AsJiraSource() (*JiraSource, bool) { + return nil, false +} + +// AsImpalaSource is the BasicCopySource implementation for ImpalaSource. +func (is ImpalaSource) AsImpalaSource() (*ImpalaSource, bool) { + return &is, true +} + +// AsHubspotSource is the BasicCopySource implementation for ImpalaSource. +func (is ImpalaSource) AsHubspotSource() (*HubspotSource, bool) { + return nil, false +} + +// AsHiveSource is the BasicCopySource implementation for ImpalaSource. +func (is ImpalaSource) AsHiveSource() (*HiveSource, bool) { + return nil, false +} + +// AsHBaseSource is the BasicCopySource implementation for ImpalaSource. +func (is ImpalaSource) AsHBaseSource() (*HBaseSource, bool) { + return nil, false +} + +// AsGreenplumSource is the BasicCopySource implementation for ImpalaSource. +func (is ImpalaSource) AsGreenplumSource() (*GreenplumSource, bool) { + return nil, false +} + +// AsGoogleBigQuerySource is the BasicCopySource implementation for ImpalaSource. +func (is ImpalaSource) AsGoogleBigQuerySource() (*GoogleBigQuerySource, bool) { + return nil, false +} + +// AsEloquaSource is the BasicCopySource implementation for ImpalaSource. +func (is ImpalaSource) AsEloquaSource() (*EloquaSource, bool) { + return nil, false +} + +// AsDrillSource is the BasicCopySource implementation for ImpalaSource. +func (is ImpalaSource) AsDrillSource() (*DrillSource, bool) { + return nil, false +} + +// AsCouchbaseSource is the BasicCopySource implementation for ImpalaSource. +func (is ImpalaSource) AsCouchbaseSource() (*CouchbaseSource, bool) { + return nil, false +} + +// AsConcurSource is the BasicCopySource implementation for ImpalaSource. +func (is ImpalaSource) AsConcurSource() (*ConcurSource, bool) { + return nil, false +} + +// AsAzurePostgreSQLSource is the BasicCopySource implementation for ImpalaSource. +func (is ImpalaSource) AsAzurePostgreSQLSource() (*AzurePostgreSQLSource, bool) { + return nil, false +} + +// AsAmazonMWSSource is the BasicCopySource implementation for ImpalaSource. +func (is ImpalaSource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { + return nil, false +} + +// AsHTTPSource is the BasicCopySource implementation for ImpalaSource. +func (is ImpalaSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for ImpalaSource. +func (is ImpalaSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for ImpalaSource. +func (is ImpalaSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsCassandraSource is the BasicCopySource implementation for ImpalaSource. +func (is ImpalaSource) AsCassandraSource() (*CassandraSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for ImpalaSource. +func (is ImpalaSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for ImpalaSource. +func (is ImpalaSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureMySQLSource is the BasicCopySource implementation for ImpalaSource. +func (is ImpalaSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for ImpalaSource. +func (is ImpalaSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for ImpalaSource. +func (is ImpalaSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsSQLDWSource is the BasicCopySource implementation for ImpalaSource. +func (is ImpalaSource) AsSQLDWSource() (*SQLDWSource, bool) { + return nil, false +} + +// AsSQLSource is the BasicCopySource implementation for ImpalaSource. +func (is ImpalaSource) AsSQLSource() (*SQLSource, bool) { + return nil, false +} + +// AsSapEccSource is the BasicCopySource implementation for ImpalaSource. +func (is ImpalaSource) AsSapEccSource() (*SapEccSource, bool) { + return nil, false +} + +// AsSapCloudForCustomerSource is the BasicCopySource implementation for ImpalaSource. +func (is ImpalaSource) AsSapCloudForCustomerSource() (*SapCloudForCustomerSource, bool) { + return nil, false +} + +// AsSalesforceSource is the BasicCopySource implementation for ImpalaSource. +func (is ImpalaSource) AsSalesforceSource() (*SalesforceSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for ImpalaSource. +func (is ImpalaSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for ImpalaSource. +func (is ImpalaSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for ImpalaSource. +func (is ImpalaSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for ImpalaSource. +func (is ImpalaSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + +// AsAzureTableSource is the BasicCopySource implementation for ImpalaSource. +func (is ImpalaSource) AsAzureTableSource() (*AzureTableSource, bool) { + return nil, false +} + +// AsCopySource is the BasicCopySource implementation for ImpalaSource. +func (is ImpalaSource) AsCopySource() (*CopySource, bool) { + return nil, false +} + +// AsBasicCopySource is the BasicCopySource implementation for ImpalaSource. +func (is ImpalaSource) AsBasicCopySource() (BasicCopySource, bool) { + return &is, true +} + +// BasicIntegrationRuntime azure Data Factory nested object which serves as a compute resource for activities. +type BasicIntegrationRuntime interface { + AsSelfHostedIntegrationRuntime() (*SelfHostedIntegrationRuntime, bool) + AsManagedIntegrationRuntime() (*ManagedIntegrationRuntime, bool) + AsIntegrationRuntime() (*IntegrationRuntime, bool) +} + +// IntegrationRuntime azure Data Factory nested object which serves as a compute resource for activities. +type IntegrationRuntime struct { + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Description - Integration runtime description. + Description *string `json:"description,omitempty"` + // Type - Possible values include: 'TypeIntegrationRuntime', 'TypeSelfHosted', 'TypeManaged' + Type TypeBasicIntegrationRuntime `json:"type,omitempty"` +} + +func unmarshalBasicIntegrationRuntime(body []byte) (BasicIntegrationRuntime, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["type"] { + case string(TypeSelfHosted): + var shir SelfHostedIntegrationRuntime + err := json.Unmarshal(body, &shir) + return shir, err + case string(TypeManaged): + var mir ManagedIntegrationRuntime + err := json.Unmarshal(body, &mir) + return mir, err + default: + var ir IntegrationRuntime + err := json.Unmarshal(body, &ir) + return ir, err + } +} +func unmarshalBasicIntegrationRuntimeArray(body []byte) ([]BasicIntegrationRuntime, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + irArray := make([]BasicIntegrationRuntime, len(rawMessages)) + + for index, rawMessage := range rawMessages { + ir, err := unmarshalBasicIntegrationRuntime(*rawMessage) + if err != nil { + return nil, err + } + irArray[index] = ir + } + return irArray, nil +} + +// MarshalJSON is the custom marshaler for IntegrationRuntime. +func (ir IntegrationRuntime) MarshalJSON() ([]byte, error) { + ir.Type = TypeIntegrationRuntime + objectMap := make(map[string]interface{}) + if ir.Description != nil { + objectMap["description"] = ir.Description + } + if ir.Type != "" { + objectMap["type"] = ir.Type + } + for k, v := range ir.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsSelfHostedIntegrationRuntime is the BasicIntegrationRuntime implementation for IntegrationRuntime. +func (ir IntegrationRuntime) AsSelfHostedIntegrationRuntime() (*SelfHostedIntegrationRuntime, bool) { + return nil, false +} + +// AsManagedIntegrationRuntime is the BasicIntegrationRuntime implementation for IntegrationRuntime. +func (ir IntegrationRuntime) AsManagedIntegrationRuntime() (*ManagedIntegrationRuntime, bool) { + return nil, false +} + +// AsIntegrationRuntime is the BasicIntegrationRuntime implementation for IntegrationRuntime. +func (ir IntegrationRuntime) AsIntegrationRuntime() (*IntegrationRuntime, bool) { + return &ir, true +} + +// AsBasicIntegrationRuntime is the BasicIntegrationRuntime implementation for IntegrationRuntime. +func (ir IntegrationRuntime) AsBasicIntegrationRuntime() (BasicIntegrationRuntime, bool) { + return &ir, true +} + +// IntegrationRuntimeAuthKeys the integration runtime authentication keys. +type IntegrationRuntimeAuthKeys struct { + autorest.Response `json:"-"` + // AuthKey1 - The primary integration runtime authentication key. + AuthKey1 *string `json:"authKey1,omitempty"` + // AuthKey2 - The secondary integration runtime authentication key. + AuthKey2 *string `json:"authKey2,omitempty"` +} + +// IntegrationRuntimeComputeProperties the compute resource properties for managed integration runtime. +type IntegrationRuntimeComputeProperties struct { + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Location - The location for managed integration runtime. The supported regions could be found on https://docs.microsoft.com/en-us/azure/data-factory/data-factory-data-movement-activities + Location *string `json:"location,omitempty"` + // NodeSize - The node size requirement to managed integration runtime. + NodeSize *string `json:"nodeSize,omitempty"` + // NumberOfNodes - The required number of nodes for managed integration runtime. + NumberOfNodes *int32 `json:"numberOfNodes,omitempty"` + // MaxParallelExecutionsPerNode - Maximum parallel executions count per node for managed integration runtime. + MaxParallelExecutionsPerNode *int32 `json:"maxParallelExecutionsPerNode,omitempty"` + // VNetProperties - VNet properties for managed integration runtime. + VNetProperties *IntegrationRuntimeVNetProperties `json:"vNetProperties,omitempty"` +} + +// MarshalJSON is the custom marshaler for IntegrationRuntimeComputeProperties. +func (ircp IntegrationRuntimeComputeProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ircp.Location != nil { + objectMap["location"] = ircp.Location + } + if ircp.NodeSize != nil { + objectMap["nodeSize"] = ircp.NodeSize + } + if ircp.NumberOfNodes != nil { + objectMap["numberOfNodes"] = ircp.NumberOfNodes + } + if ircp.MaxParallelExecutionsPerNode != nil { + objectMap["maxParallelExecutionsPerNode"] = ircp.MaxParallelExecutionsPerNode + } + if ircp.VNetProperties != nil { + objectMap["vNetProperties"] = ircp.VNetProperties + } + for k, v := range ircp.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// IntegrationRuntimeConnectionInfo connection information for encrypting the on-premises data source credentials. +type IntegrationRuntimeConnectionInfo struct { + autorest.Response `json:"-"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // ServiceToken - The token generated in service. Callers use this token to authenticate to integration runtime. + ServiceToken *string `json:"serviceToken,omitempty"` + // IdentityCertThumbprint - The integration runtime SSL certificate thumbprint. Click-Once application uses it to do server validation. + IdentityCertThumbprint *string `json:"identityCertThumbprint,omitempty"` + // HostServiceURI - The on-premises integration runtime host URL. + HostServiceURI *string `json:"hostServiceUri,omitempty"` + // Version - The integration runtime version. + Version *string `json:"version,omitempty"` + // PublicKey - The public key for encrypting a credential when transferring the credential to the integration runtime. + PublicKey *string `json:"publicKey,omitempty"` + // IsIdentityCertExprired - Whether the identity certificate is expired. + IsIdentityCertExprired *bool `json:"isIdentityCertExprired,omitempty"` +} + +// MarshalJSON is the custom marshaler for IntegrationRuntimeConnectionInfo. +func (irci IntegrationRuntimeConnectionInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if irci.ServiceToken != nil { + objectMap["serviceToken"] = irci.ServiceToken + } + if irci.IdentityCertThumbprint != nil { + objectMap["identityCertThumbprint"] = irci.IdentityCertThumbprint + } + if irci.HostServiceURI != nil { + objectMap["hostServiceUri"] = irci.HostServiceURI + } + if irci.Version != nil { + objectMap["version"] = irci.Version + } + if irci.PublicKey != nil { + objectMap["publicKey"] = irci.PublicKey + } + if irci.IsIdentityCertExprired != nil { + objectMap["isIdentityCertExprired"] = irci.IsIdentityCertExprired + } + for k, v := range irci.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// IntegrationRuntimeCustomSetupScriptProperties custom setup script properties for a managed dedicated integration +// runtime. +type IntegrationRuntimeCustomSetupScriptProperties struct { + // BlobContainerURI - The URI of the Azure blob container that contains the custom setup script. + BlobContainerURI *string `json:"blobContainerUri,omitempty"` + // SasToken - The SAS token of the Azure blob container. + SasToken *SecureString `json:"sasToken,omitempty"` +} + +// IntegrationRuntimeListResponse a list of integration runtime resources. +type IntegrationRuntimeListResponse struct { + autorest.Response `json:"-"` + // Value - List of integration runtimes. + Value *[]IntegrationRuntimeResource `json:"value,omitempty"` + // NextLink - The link to the next page of results, if any remaining results exist. + NextLink *string `json:"nextLink,omitempty"` +} + +// IntegrationRuntimeListResponseIterator provides access to a complete listing of IntegrationRuntimeResource +// values. +type IntegrationRuntimeListResponseIterator struct { + i int + page IntegrationRuntimeListResponsePage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *IntegrationRuntimeListResponseIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter IntegrationRuntimeListResponseIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter IntegrationRuntimeListResponseIterator) Response() IntegrationRuntimeListResponse { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter IntegrationRuntimeListResponseIterator) Value() IntegrationRuntimeResource { + if !iter.page.NotDone() { + return IntegrationRuntimeResource{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (irlr IntegrationRuntimeListResponse) IsEmpty() bool { + return irlr.Value == nil || len(*irlr.Value) == 0 +} + +// integrationRuntimeListResponsePreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (irlr IntegrationRuntimeListResponse) integrationRuntimeListResponsePreparer() (*http.Request, error) { + if irlr.NextLink == nil || len(to.String(irlr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(irlr.NextLink))) +} + +// IntegrationRuntimeListResponsePage contains a page of IntegrationRuntimeResource values. +type IntegrationRuntimeListResponsePage struct { + fn func(IntegrationRuntimeListResponse) (IntegrationRuntimeListResponse, error) + irlr IntegrationRuntimeListResponse +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *IntegrationRuntimeListResponsePage) Next() error { + next, err := page.fn(page.irlr) + if err != nil { + return err + } + page.irlr = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page IntegrationRuntimeListResponsePage) NotDone() bool { + return !page.irlr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page IntegrationRuntimeListResponsePage) Response() IntegrationRuntimeListResponse { + return page.irlr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page IntegrationRuntimeListResponsePage) Values() []IntegrationRuntimeResource { + if page.irlr.IsEmpty() { + return nil + } + return *page.irlr.Value +} + +// IntegrationRuntimeMonitoringData get monitoring data response. +type IntegrationRuntimeMonitoringData struct { + autorest.Response `json:"-"` + // Name - Integration runtime name. + Name *string `json:"name,omitempty"` + // Nodes - Integration runtime node monitoring data. + Nodes *[]IntegrationRuntimeNodeMonitoringData `json:"nodes,omitempty"` +} + +// IntegrationRuntimeNodeIPAddress the IP address of self-hosted integration runtime node. +type IntegrationRuntimeNodeIPAddress struct { + autorest.Response `json:"-"` + // IPAddress - The IP address of self-hosted integration runtime node. + IPAddress *string `json:"ipAddress,omitempty"` +} + +// IntegrationRuntimeNodeMonitoringData monitoring data for integration runtime node. +type IntegrationRuntimeNodeMonitoringData struct { + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // NodeName - Name of the integration runtime node. + NodeName *string `json:"nodeName,omitempty"` + // AvailableMemoryInMB - Available memory (MB) on the integration runtime node. + AvailableMemoryInMB *int32 `json:"availableMemoryInMB,omitempty"` + // CPUUtilization - CPU percentage on the integration runtime node. + CPUUtilization *int32 `json:"cpuUtilization,omitempty"` + // ConcurrentJobsLimit - Maximum concurrent jobs on the integration runtime node. + ConcurrentJobsLimit *int32 `json:"concurrentJobsLimit,omitempty"` + // ConcurrentJobsRunning - The number of jobs currently running on the integration runtime node. + ConcurrentJobsRunning *int32 `json:"concurrentJobsRunning,omitempty"` + // MaxConcurrentJobs - The maximum concurrent jobs in this integration runtime. + MaxConcurrentJobs *int32 `json:"maxConcurrentJobs,omitempty"` + // SentBytes - Sent bytes on the integration runtime node. + SentBytes *float64 `json:"sentBytes,omitempty"` + // ReceivedBytes - Received bytes on the integration runtime node. + ReceivedBytes *float64 `json:"receivedBytes,omitempty"` +} + +// MarshalJSON is the custom marshaler for IntegrationRuntimeNodeMonitoringData. +func (irnmd IntegrationRuntimeNodeMonitoringData) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if irnmd.NodeName != nil { + objectMap["nodeName"] = irnmd.NodeName + } + if irnmd.AvailableMemoryInMB != nil { + objectMap["availableMemoryInMB"] = irnmd.AvailableMemoryInMB + } + if irnmd.CPUUtilization != nil { + objectMap["cpuUtilization"] = irnmd.CPUUtilization + } + if irnmd.ConcurrentJobsLimit != nil { + objectMap["concurrentJobsLimit"] = irnmd.ConcurrentJobsLimit + } + if irnmd.ConcurrentJobsRunning != nil { + objectMap["concurrentJobsRunning"] = irnmd.ConcurrentJobsRunning + } + if irnmd.MaxConcurrentJobs != nil { + objectMap["maxConcurrentJobs"] = irnmd.MaxConcurrentJobs + } + if irnmd.SentBytes != nil { + objectMap["sentBytes"] = irnmd.SentBytes + } + if irnmd.ReceivedBytes != nil { + objectMap["receivedBytes"] = irnmd.ReceivedBytes + } + for k, v := range irnmd.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// IntegrationRuntimeReference integration runtime reference type. +type IntegrationRuntimeReference struct { + // Type - Type of integration runtime. + Type *string `json:"type,omitempty"` + // ReferenceName - Reference integration runtime name. + ReferenceName *string `json:"referenceName,omitempty"` + // Parameters - Arguments for integration runtime. + Parameters map[string]interface{} `json:"parameters"` +} + +// MarshalJSON is the custom marshaler for IntegrationRuntimeReference. +func (irr IntegrationRuntimeReference) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if irr.Type != nil { + objectMap["type"] = irr.Type + } + if irr.ReferenceName != nil { + objectMap["referenceName"] = irr.ReferenceName + } + if irr.Parameters != nil { + objectMap["parameters"] = irr.Parameters + } + return json.Marshal(objectMap) +} + +// IntegrationRuntimeRegenerateKeyParameters parameters to regenerate the authentication key. +type IntegrationRuntimeRegenerateKeyParameters struct { + // KeyName - The name of the authentication key to regenerate. Possible values include: 'AuthKey1', 'AuthKey2' + KeyName IntegrationRuntimeAuthKeyName `json:"keyName,omitempty"` +} + +// IntegrationRuntimeResource integration runtime resource type. +type IntegrationRuntimeResource struct { + autorest.Response `json:"-"` + // Properties - Integration runtime properties. + Properties BasicIntegrationRuntime `json:"properties,omitempty"` + // ID - The resource identifier. + ID *string `json:"id,omitempty"` + // Name - The resource name. + Name *string `json:"name,omitempty"` + // Type - The resource type. + Type *string `json:"type,omitempty"` + // Etag - Etag identifies change in the resource. + Etag *string `json:"etag,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for IntegrationRuntimeResource struct. +func (irr *IntegrationRuntimeResource) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + properties, err := unmarshalBasicIntegrationRuntime(*v) + if err != nil { + return err + } + irr.Properties = properties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + irr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + irr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + irr.Type = &typeVar + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + irr.Etag = &etag + } + } + } + + return nil +} + +// IntegrationRuntimeSsisCatalogInfo catalog information for managed dedicated integration runtime. +type IntegrationRuntimeSsisCatalogInfo struct { + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // CatalogServerEndpoint - The catalog database server URL. + CatalogServerEndpoint *string `json:"catalogServerEndpoint,omitempty"` + // CatalogAdminUserName - The administrator user name of catalog database. + CatalogAdminUserName *string `json:"catalogAdminUserName,omitempty"` + // CatalogAdminPassword - The password of the administrator user account of the catalog database. + CatalogAdminPassword *SecureString `json:"catalogAdminPassword,omitempty"` + // CatalogPricingTier - The pricing tier for the catalog database. The valid values could be found in https://azure.microsoft.com/en-us/pricing/details/sql-database/. Possible values include: 'IntegrationRuntimeSsisCatalogPricingTierBasic', 'IntegrationRuntimeSsisCatalogPricingTierStandard', 'IntegrationRuntimeSsisCatalogPricingTierPremium', 'IntegrationRuntimeSsisCatalogPricingTierPremiumRS' + CatalogPricingTier IntegrationRuntimeSsisCatalogPricingTier `json:"catalogPricingTier,omitempty"` +} + +// MarshalJSON is the custom marshaler for IntegrationRuntimeSsisCatalogInfo. +func (irsci IntegrationRuntimeSsisCatalogInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if irsci.CatalogServerEndpoint != nil { + objectMap["catalogServerEndpoint"] = irsci.CatalogServerEndpoint + } + if irsci.CatalogAdminUserName != nil { + objectMap["catalogAdminUserName"] = irsci.CatalogAdminUserName + } + if irsci.CatalogAdminPassword != nil { + objectMap["catalogAdminPassword"] = irsci.CatalogAdminPassword + } + if irsci.CatalogPricingTier != "" { + objectMap["catalogPricingTier"] = irsci.CatalogPricingTier + } + for k, v := range irsci.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// IntegrationRuntimeSsisProperties SSIS properties for managed integration runtime. +type IntegrationRuntimeSsisProperties struct { + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // CatalogInfo - Catalog information for managed dedicated integration runtime. + CatalogInfo *IntegrationRuntimeSsisCatalogInfo `json:"catalogInfo,omitempty"` + // LicenseType - License type for bringing your own license scenario. Possible values include: 'BasePrice', 'LicenseIncluded' + LicenseType IntegrationRuntimeLicenseType `json:"licenseType,omitempty"` + // CustomSetupScriptProperties - Custom setup script properties for a managed dedicated integration runtime. + CustomSetupScriptProperties *IntegrationRuntimeCustomSetupScriptProperties `json:"customSetupScriptProperties,omitempty"` + // Edition - The edition for the SSIS Integration Runtime. Possible values include: 'Standard', 'Enterprise' + Edition IntegrationRuntimeEdition `json:"edition,omitempty"` +} + +// MarshalJSON is the custom marshaler for IntegrationRuntimeSsisProperties. +func (irsp IntegrationRuntimeSsisProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if irsp.CatalogInfo != nil { + objectMap["catalogInfo"] = irsp.CatalogInfo + } + if irsp.LicenseType != "" { + objectMap["licenseType"] = irsp.LicenseType + } + if irsp.CustomSetupScriptProperties != nil { + objectMap["customSetupScriptProperties"] = irsp.CustomSetupScriptProperties + } + if irsp.Edition != "" { + objectMap["edition"] = irsp.Edition + } + for k, v := range irsp.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// IntegrationRuntimesStartFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type IntegrationRuntimesStartFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *IntegrationRuntimesStartFuture) Result(client IntegrationRuntimesClient) (irsr IntegrationRuntimeStatusResponse, err error) { + var done bool + done, err = future.Done(client) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.IntegrationRuntimesStartFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("datafactory.IntegrationRuntimesStartFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if irsr.Response.Response, err = future.GetResult(sender); err == nil && irsr.Response.Response.StatusCode != http.StatusNoContent { + irsr, err = client.StartResponder(irsr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.IntegrationRuntimesStartFuture", "Result", irsr.Response.Response, "Failure responding to request") + } + } + return +} + +// IntegrationRuntimesStopFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type IntegrationRuntimesStopFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *IntegrationRuntimesStopFuture) Result(client IntegrationRuntimesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.Done(client) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.IntegrationRuntimesStopFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("datafactory.IntegrationRuntimesStopFuture") + return + } + ar.Response = future.Response() + return +} + +// BasicIntegrationRuntimeStatus integration runtime status. +type BasicIntegrationRuntimeStatus interface { + AsSelfHostedIntegrationRuntimeStatus() (*SelfHostedIntegrationRuntimeStatus, bool) + AsManagedIntegrationRuntimeStatus() (*ManagedIntegrationRuntimeStatus, bool) + AsIntegrationRuntimeStatus() (*IntegrationRuntimeStatus, bool) +} + +// IntegrationRuntimeStatus integration runtime status. +type IntegrationRuntimeStatus struct { + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // DataFactoryName - The data factory name which the integration runtime belong to. + DataFactoryName *string `json:"dataFactoryName,omitempty"` + // State - The state of integration runtime. Possible values include: 'Initial', 'Stopped', 'Started', 'Starting', 'Stopping', 'NeedRegistration', 'Online', 'Limited', 'Offline' + State IntegrationRuntimeState `json:"state,omitempty"` + // Type - Possible values include: 'TypeBasicIntegrationRuntimeStatusTypeIntegrationRuntimeStatus', 'TypeBasicIntegrationRuntimeStatusTypeSelfHosted', 'TypeBasicIntegrationRuntimeStatusTypeManaged' + Type TypeBasicIntegrationRuntimeStatus `json:"type,omitempty"` +} + +func unmarshalBasicIntegrationRuntimeStatus(body []byte) (BasicIntegrationRuntimeStatus, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["type"] { + case string(TypeBasicIntegrationRuntimeStatusTypeSelfHosted): + var shirs SelfHostedIntegrationRuntimeStatus + err := json.Unmarshal(body, &shirs) + return shirs, err + case string(TypeBasicIntegrationRuntimeStatusTypeManaged): + var mirs ManagedIntegrationRuntimeStatus + err := json.Unmarshal(body, &mirs) + return mirs, err + default: + var irs IntegrationRuntimeStatus + err := json.Unmarshal(body, &irs) + return irs, err + } +} +func unmarshalBasicIntegrationRuntimeStatusArray(body []byte) ([]BasicIntegrationRuntimeStatus, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + irsArray := make([]BasicIntegrationRuntimeStatus, len(rawMessages)) + + for index, rawMessage := range rawMessages { + irs, err := unmarshalBasicIntegrationRuntimeStatus(*rawMessage) + if err != nil { + return nil, err + } + irsArray[index] = irs + } + return irsArray, nil +} + +// MarshalJSON is the custom marshaler for IntegrationRuntimeStatus. +func (irs IntegrationRuntimeStatus) MarshalJSON() ([]byte, error) { + irs.Type = TypeBasicIntegrationRuntimeStatusTypeIntegrationRuntimeStatus + objectMap := make(map[string]interface{}) + if irs.DataFactoryName != nil { + objectMap["dataFactoryName"] = irs.DataFactoryName + } + if irs.State != "" { + objectMap["state"] = irs.State + } + if irs.Type != "" { + objectMap["type"] = irs.Type + } + for k, v := range irs.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsSelfHostedIntegrationRuntimeStatus is the BasicIntegrationRuntimeStatus implementation for IntegrationRuntimeStatus. +func (irs IntegrationRuntimeStatus) AsSelfHostedIntegrationRuntimeStatus() (*SelfHostedIntegrationRuntimeStatus, bool) { + return nil, false +} + +// AsManagedIntegrationRuntimeStatus is the BasicIntegrationRuntimeStatus implementation for IntegrationRuntimeStatus. +func (irs IntegrationRuntimeStatus) AsManagedIntegrationRuntimeStatus() (*ManagedIntegrationRuntimeStatus, bool) { + return nil, false +} + +// AsIntegrationRuntimeStatus is the BasicIntegrationRuntimeStatus implementation for IntegrationRuntimeStatus. +func (irs IntegrationRuntimeStatus) AsIntegrationRuntimeStatus() (*IntegrationRuntimeStatus, bool) { + return &irs, true +} + +// AsBasicIntegrationRuntimeStatus is the BasicIntegrationRuntimeStatus implementation for IntegrationRuntimeStatus. +func (irs IntegrationRuntimeStatus) AsBasicIntegrationRuntimeStatus() (BasicIntegrationRuntimeStatus, bool) { + return &irs, true +} + +// IntegrationRuntimeStatusListResponse a list of integration runtime status. +type IntegrationRuntimeStatusListResponse struct { + // Value - List of integration runtime status. + Value *[]IntegrationRuntimeStatusResponse `json:"value,omitempty"` + // NextLink - The link to the next page of results, if any remaining results exist. + NextLink *string `json:"nextLink,omitempty"` +} + +// IntegrationRuntimeStatusResponse integration runtime status response. +type IntegrationRuntimeStatusResponse struct { + autorest.Response `json:"-"` + // Name - The integration runtime name. + Name *string `json:"name,omitempty"` + // Properties - Integration runtime properties. + Properties BasicIntegrationRuntimeStatus `json:"properties,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for IntegrationRuntimeStatusResponse struct. +func (irsr *IntegrationRuntimeStatusResponse) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + irsr.Name = &name + } + case "properties": + if v != nil { + properties, err := unmarshalBasicIntegrationRuntimeStatus(*v) + if err != nil { + return err + } + irsr.Properties = properties + } + } + } + + return nil +} + +// IntegrationRuntimeVNetProperties vNet properties for managed integration runtime. +type IntegrationRuntimeVNetProperties struct { + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // VNetID - The ID of the VNet that this integration runtime will join. + VNetID *string `json:"vNetId,omitempty"` + // Subnet - The name of the subnet this integration runtime will join. + Subnet *string `json:"subnet,omitempty"` +} + +// MarshalJSON is the custom marshaler for IntegrationRuntimeVNetProperties. +func (irvnp IntegrationRuntimeVNetProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if irvnp.VNetID != nil { + objectMap["vNetId"] = irvnp.VNetID + } + if irvnp.Subnet != nil { + objectMap["subnet"] = irvnp.Subnet + } + for k, v := range irvnp.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// JiraLinkedService jira Serivce linked service. +type JiraLinkedService struct { + // JiraLinkedServiceTypeProperties - Jira Serivce linked service properties. + *JiraLinkedServiceTypeProperties `json:"typeProperties,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // ConnectVia - The integration runtime reference. + ConnectVia *IntegrationRuntimeReference `json:"connectVia,omitempty"` + // Description - Linked service description. + Description *string `json:"description,omitempty"` + // Parameters - Parameters for linked service. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeLinkedService', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforce', 'TypeAzureDataLakeStore', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureStorage' + Type TypeBasicLinkedService `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for JiraLinkedService. +func (jls JiraLinkedService) MarshalJSON() ([]byte, error) { + jls.Type = TypeJira + objectMap := make(map[string]interface{}) + if jls.JiraLinkedServiceTypeProperties != nil { + objectMap["typeProperties"] = jls.JiraLinkedServiceTypeProperties + } + if jls.ConnectVia != nil { + objectMap["connectVia"] = jls.ConnectVia + } + if jls.Description != nil { + objectMap["description"] = jls.Description + } + if jls.Parameters != nil { + objectMap["parameters"] = jls.Parameters + } + if jls.Annotations != nil { + objectMap["annotations"] = jls.Annotations + } + if jls.Type != "" { + objectMap["type"] = jls.Type + } + for k, v := range jls.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysLinkedService is the BasicLinkedService implementation for JiraLinkedService. +func (jls JiraLinkedService) AsResponsysLinkedService() (*ResponsysLinkedService, bool) { + return nil, false +} + +// AsAzureDatabricksLinkedService is the BasicLinkedService implementation for JiraLinkedService. +func (jls JiraLinkedService) AsAzureDatabricksLinkedService() (*AzureDatabricksLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeAnalyticsLinkedService is the BasicLinkedService implementation for JiraLinkedService. +func (jls JiraLinkedService) AsAzureDataLakeAnalyticsLinkedService() (*AzureDataLakeAnalyticsLinkedService, bool) { + return nil, false +} + +// AsHDInsightOnDemandLinkedService is the BasicLinkedService implementation for JiraLinkedService. +func (jls JiraLinkedService) AsHDInsightOnDemandLinkedService() (*HDInsightOnDemandLinkedService, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudLinkedService is the BasicLinkedService implementation for JiraLinkedService. +func (jls JiraLinkedService) AsSalesforceMarketingCloudLinkedService() (*SalesforceMarketingCloudLinkedService, bool) { + return nil, false +} + +// AsNetezzaLinkedService is the BasicLinkedService implementation for JiraLinkedService. +func (jls JiraLinkedService) AsNetezzaLinkedService() (*NetezzaLinkedService, bool) { + return nil, false +} + +// AsVerticaLinkedService is the BasicLinkedService implementation for JiraLinkedService. +func (jls JiraLinkedService) AsVerticaLinkedService() (*VerticaLinkedService, bool) { + return nil, false +} + +// AsZohoLinkedService is the BasicLinkedService implementation for JiraLinkedService. +func (jls JiraLinkedService) AsZohoLinkedService() (*ZohoLinkedService, bool) { + return nil, false +} + +// AsXeroLinkedService is the BasicLinkedService implementation for JiraLinkedService. +func (jls JiraLinkedService) AsXeroLinkedService() (*XeroLinkedService, bool) { + return nil, false +} + +// AsSquareLinkedService is the BasicLinkedService implementation for JiraLinkedService. +func (jls JiraLinkedService) AsSquareLinkedService() (*SquareLinkedService, bool) { + return nil, false +} + +// AsSparkLinkedService is the BasicLinkedService implementation for JiraLinkedService. +func (jls JiraLinkedService) AsSparkLinkedService() (*SparkLinkedService, bool) { + return nil, false +} + +// AsShopifyLinkedService is the BasicLinkedService implementation for JiraLinkedService. +func (jls JiraLinkedService) AsShopifyLinkedService() (*ShopifyLinkedService, bool) { + return nil, false +} + +// AsServiceNowLinkedService is the BasicLinkedService implementation for JiraLinkedService. +func (jls JiraLinkedService) AsServiceNowLinkedService() (*ServiceNowLinkedService, bool) { + return nil, false +} + +// AsQuickBooksLinkedService is the BasicLinkedService implementation for JiraLinkedService. +func (jls JiraLinkedService) AsQuickBooksLinkedService() (*QuickBooksLinkedService, bool) { + return nil, false +} + +// AsPrestoLinkedService is the BasicLinkedService implementation for JiraLinkedService. +func (jls JiraLinkedService) AsPrestoLinkedService() (*PrestoLinkedService, bool) { + return nil, false +} + +// AsPhoenixLinkedService is the BasicLinkedService implementation for JiraLinkedService. +func (jls JiraLinkedService) AsPhoenixLinkedService() (*PhoenixLinkedService, bool) { + return nil, false +} + +// AsPaypalLinkedService is the BasicLinkedService implementation for JiraLinkedService. +func (jls JiraLinkedService) AsPaypalLinkedService() (*PaypalLinkedService, bool) { + return nil, false +} + +// AsMarketoLinkedService is the BasicLinkedService implementation for JiraLinkedService. +func (jls JiraLinkedService) AsMarketoLinkedService() (*MarketoLinkedService, bool) { + return nil, false +} + +// AsMariaDBLinkedService is the BasicLinkedService implementation for JiraLinkedService. +func (jls JiraLinkedService) AsMariaDBLinkedService() (*MariaDBLinkedService, bool) { + return nil, false +} + +// AsMagentoLinkedService is the BasicLinkedService implementation for JiraLinkedService. +func (jls JiraLinkedService) AsMagentoLinkedService() (*MagentoLinkedService, bool) { + return nil, false +} + +// AsJiraLinkedService is the BasicLinkedService implementation for JiraLinkedService. +func (jls JiraLinkedService) AsJiraLinkedService() (*JiraLinkedService, bool) { + return &jls, true +} + +// AsImpalaLinkedService is the BasicLinkedService implementation for JiraLinkedService. +func (jls JiraLinkedService) AsImpalaLinkedService() (*ImpalaLinkedService, bool) { + return nil, false +} + +// AsHubspotLinkedService is the BasicLinkedService implementation for JiraLinkedService. +func (jls JiraLinkedService) AsHubspotLinkedService() (*HubspotLinkedService, bool) { + return nil, false +} + +// AsHiveLinkedService is the BasicLinkedService implementation for JiraLinkedService. +func (jls JiraLinkedService) AsHiveLinkedService() (*HiveLinkedService, bool) { + return nil, false +} + +// AsHBaseLinkedService is the BasicLinkedService implementation for JiraLinkedService. +func (jls JiraLinkedService) AsHBaseLinkedService() (*HBaseLinkedService, bool) { + return nil, false +} + +// AsGreenplumLinkedService is the BasicLinkedService implementation for JiraLinkedService. +func (jls JiraLinkedService) AsGreenplumLinkedService() (*GreenplumLinkedService, bool) { + return nil, false +} + +// AsGoogleBigQueryLinkedService is the BasicLinkedService implementation for JiraLinkedService. +func (jls JiraLinkedService) AsGoogleBigQueryLinkedService() (*GoogleBigQueryLinkedService, bool) { + return nil, false +} + +// AsEloquaLinkedService is the BasicLinkedService implementation for JiraLinkedService. +func (jls JiraLinkedService) AsEloquaLinkedService() (*EloquaLinkedService, bool) { + return nil, false +} + +// AsDrillLinkedService is the BasicLinkedService implementation for JiraLinkedService. +func (jls JiraLinkedService) AsDrillLinkedService() (*DrillLinkedService, bool) { + return nil, false +} + +// AsCouchbaseLinkedService is the BasicLinkedService implementation for JiraLinkedService. +func (jls JiraLinkedService) AsCouchbaseLinkedService() (*CouchbaseLinkedService, bool) { + return nil, false +} + +// AsConcurLinkedService is the BasicLinkedService implementation for JiraLinkedService. +func (jls JiraLinkedService) AsConcurLinkedService() (*ConcurLinkedService, bool) { + return nil, false +} + +// AsAzurePostgreSQLLinkedService is the BasicLinkedService implementation for JiraLinkedService. +func (jls JiraLinkedService) AsAzurePostgreSQLLinkedService() (*AzurePostgreSQLLinkedService, bool) { + return nil, false +} + +// AsAmazonMWSLinkedService is the BasicLinkedService implementation for JiraLinkedService. +func (jls JiraLinkedService) AsAmazonMWSLinkedService() (*AmazonMWSLinkedService, bool) { + return nil, false +} + +// AsSapHanaLinkedService is the BasicLinkedService implementation for JiraLinkedService. +func (jls JiraLinkedService) AsSapHanaLinkedService() (*SapHanaLinkedService, bool) { + return nil, false +} + +// AsSapBWLinkedService is the BasicLinkedService implementation for JiraLinkedService. +func (jls JiraLinkedService) AsSapBWLinkedService() (*SapBWLinkedService, bool) { + return nil, false +} + +// AsSftpServerLinkedService is the BasicLinkedService implementation for JiraLinkedService. +func (jls JiraLinkedService) AsSftpServerLinkedService() (*SftpServerLinkedService, bool) { + return nil, false +} + +// AsFtpServerLinkedService is the BasicLinkedService implementation for JiraLinkedService. +func (jls JiraLinkedService) AsFtpServerLinkedService() (*FtpServerLinkedService, bool) { + return nil, false +} + +// AsHTTPLinkedService is the BasicLinkedService implementation for JiraLinkedService. +func (jls JiraLinkedService) AsHTTPLinkedService() (*HTTPLinkedService, bool) { + return nil, false +} + +// AsAzureSearchLinkedService is the BasicLinkedService implementation for JiraLinkedService. +func (jls JiraLinkedService) AsAzureSearchLinkedService() (*AzureSearchLinkedService, bool) { + return nil, false +} + +// AsCustomDataSourceLinkedService is the BasicLinkedService implementation for JiraLinkedService. +func (jls JiraLinkedService) AsCustomDataSourceLinkedService() (*CustomDataSourceLinkedService, bool) { + return nil, false +} + +// AsAmazonRedshiftLinkedService is the BasicLinkedService implementation for JiraLinkedService. +func (jls JiraLinkedService) AsAmazonRedshiftLinkedService() (*AmazonRedshiftLinkedService, bool) { + return nil, false +} + +// AsAmazonS3LinkedService is the BasicLinkedService implementation for JiraLinkedService. +func (jls JiraLinkedService) AsAmazonS3LinkedService() (*AmazonS3LinkedService, bool) { + return nil, false +} + +// AsSapEccLinkedService is the BasicLinkedService implementation for JiraLinkedService. +func (jls JiraLinkedService) AsSapEccLinkedService() (*SapEccLinkedService, bool) { + return nil, false +} + +// AsSapCloudForCustomerLinkedService is the BasicLinkedService implementation for JiraLinkedService. +func (jls JiraLinkedService) AsSapCloudForCustomerLinkedService() (*SapCloudForCustomerLinkedService, bool) { + return nil, false +} + +// AsSalesforceLinkedService is the BasicLinkedService implementation for JiraLinkedService. +func (jls JiraLinkedService) AsSalesforceLinkedService() (*SalesforceLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeStoreLinkedService is the BasicLinkedService implementation for JiraLinkedService. +func (jls JiraLinkedService) AsAzureDataLakeStoreLinkedService() (*AzureDataLakeStoreLinkedService, bool) { + return nil, false +} + +// AsMongoDbLinkedService is the BasicLinkedService implementation for JiraLinkedService. +func (jls JiraLinkedService) AsMongoDbLinkedService() (*MongoDbLinkedService, bool) { + return nil, false +} + +// AsCassandraLinkedService is the BasicLinkedService implementation for JiraLinkedService. +func (jls JiraLinkedService) AsCassandraLinkedService() (*CassandraLinkedService, bool) { + return nil, false +} + +// AsWebLinkedService is the BasicLinkedService implementation for JiraLinkedService. +func (jls JiraLinkedService) AsWebLinkedService() (*WebLinkedService, bool) { + return nil, false +} + +// AsODataLinkedService is the BasicLinkedService implementation for JiraLinkedService. +func (jls JiraLinkedService) AsODataLinkedService() (*ODataLinkedService, bool) { + return nil, false +} + +// AsHdfsLinkedService is the BasicLinkedService implementation for JiraLinkedService. +func (jls JiraLinkedService) AsHdfsLinkedService() (*HdfsLinkedService, bool) { + return nil, false +} + +// AsOdbcLinkedService is the BasicLinkedService implementation for JiraLinkedService. +func (jls JiraLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, bool) { + return nil, false +} + +// AsAzureMLLinkedService is the BasicLinkedService implementation for JiraLinkedService. +func (jls JiraLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { + return nil, false +} + +// AsTeradataLinkedService is the BasicLinkedService implementation for JiraLinkedService. +func (jls JiraLinkedService) AsTeradataLinkedService() (*TeradataLinkedService, bool) { + return nil, false +} + +// AsDb2LinkedService is the BasicLinkedService implementation for JiraLinkedService. +func (jls JiraLinkedService) AsDb2LinkedService() (*Db2LinkedService, bool) { + return nil, false +} + +// AsSybaseLinkedService is the BasicLinkedService implementation for JiraLinkedService. +func (jls JiraLinkedService) AsSybaseLinkedService() (*SybaseLinkedService, bool) { + return nil, false +} + +// AsPostgreSQLLinkedService is the BasicLinkedService implementation for JiraLinkedService. +func (jls JiraLinkedService) AsPostgreSQLLinkedService() (*PostgreSQLLinkedService, bool) { + return nil, false +} + +// AsMySQLLinkedService is the BasicLinkedService implementation for JiraLinkedService. +func (jls JiraLinkedService) AsMySQLLinkedService() (*MySQLLinkedService, bool) { + return nil, false +} + +// AsAzureMySQLLinkedService is the BasicLinkedService implementation for JiraLinkedService. +func (jls JiraLinkedService) AsAzureMySQLLinkedService() (*AzureMySQLLinkedService, bool) { + return nil, false +} + +// AsOracleLinkedService is the BasicLinkedService implementation for JiraLinkedService. +func (jls JiraLinkedService) AsOracleLinkedService() (*OracleLinkedService, bool) { + return nil, false +} + +// AsFileServerLinkedService is the BasicLinkedService implementation for JiraLinkedService. +func (jls JiraLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { + return nil, false +} + +// AsHDInsightLinkedService is the BasicLinkedService implementation for JiraLinkedService. +func (jls JiraLinkedService) AsHDInsightLinkedService() (*HDInsightLinkedService, bool) { + return nil, false +} + +// AsDynamicsLinkedService is the BasicLinkedService implementation for JiraLinkedService. +func (jls JiraLinkedService) AsDynamicsLinkedService() (*DynamicsLinkedService, bool) { + return nil, false +} + +// AsCosmosDbLinkedService is the BasicLinkedService implementation for JiraLinkedService. +func (jls JiraLinkedService) AsCosmosDbLinkedService() (*CosmosDbLinkedService, bool) { + return nil, false +} + +// AsAzureKeyVaultLinkedService is the BasicLinkedService implementation for JiraLinkedService. +func (jls JiraLinkedService) AsAzureKeyVaultLinkedService() (*AzureKeyVaultLinkedService, bool) { + return nil, false +} + +// AsAzureBatchLinkedService is the BasicLinkedService implementation for JiraLinkedService. +func (jls JiraLinkedService) AsAzureBatchLinkedService() (*AzureBatchLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDatabaseLinkedService is the BasicLinkedService implementation for JiraLinkedService. +func (jls JiraLinkedService) AsAzureSQLDatabaseLinkedService() (*AzureSQLDatabaseLinkedService, bool) { + return nil, false +} + +// AsSQLServerLinkedService is the BasicLinkedService implementation for JiraLinkedService. +func (jls JiraLinkedService) AsSQLServerLinkedService() (*SQLServerLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDWLinkedService is the BasicLinkedService implementation for JiraLinkedService. +func (jls JiraLinkedService) AsAzureSQLDWLinkedService() (*AzureSQLDWLinkedService, bool) { + return nil, false +} + +// AsAzureStorageLinkedService is the BasicLinkedService implementation for JiraLinkedService. +func (jls JiraLinkedService) AsAzureStorageLinkedService() (*AzureStorageLinkedService, bool) { + return nil, false +} + +// AsLinkedService is the BasicLinkedService implementation for JiraLinkedService. +func (jls JiraLinkedService) AsLinkedService() (*LinkedService, bool) { + return nil, false +} + +// AsBasicLinkedService is the BasicLinkedService implementation for JiraLinkedService. +func (jls JiraLinkedService) AsBasicLinkedService() (BasicLinkedService, bool) { + return &jls, true +} + +// UnmarshalJSON is the custom unmarshaler for JiraLinkedService struct. +func (jls *JiraLinkedService) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "typeProperties": + if v != nil { + var jiraLinkedServiceTypeProperties JiraLinkedServiceTypeProperties + err = json.Unmarshal(*v, &jiraLinkedServiceTypeProperties) + if err != nil { + return err + } + jls.JiraLinkedServiceTypeProperties = &jiraLinkedServiceTypeProperties + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if jls.AdditionalProperties == nil { + jls.AdditionalProperties = make(map[string]interface{}) + } + jls.AdditionalProperties[k] = additionalProperties + } + case "connectVia": + if v != nil { + var connectVia IntegrationRuntimeReference + err = json.Unmarshal(*v, &connectVia) + if err != nil { + return err + } + jls.ConnectVia = &connectVia + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + jls.Description = &description + } + case "parameters": + if v != nil { + var parameters map[string]*ParameterSpecification + err = json.Unmarshal(*v, ¶meters) + if err != nil { + return err + } + jls.Parameters = parameters + } + case "annotations": + if v != nil { + var annotations []interface{} + err = json.Unmarshal(*v, &annotations) + if err != nil { + return err + } + jls.Annotations = &annotations + } + case "type": + if v != nil { + var typeVar TypeBasicLinkedService + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + jls.Type = typeVar + } + } + } + + return nil +} + +// JiraLinkedServiceTypeProperties jira Serivce linked service properties. +type JiraLinkedServiceTypeProperties struct { + // Host - The IP address or host name of the Jira service. (e.g. jira.example.com) + Host interface{} `json:"host,omitempty"` + // Port - The TCP port that the Jira server uses to listen for client connections. The default value is 443 if connecting through HTTPS, or 8080 if connecting through HTTP. + Port interface{} `json:"port,omitempty"` + // Username - The user name that you use to access Jira Service. + Username interface{} `json:"username,omitempty"` + // Password - The password corresponding to the user name that you provided in the username field. + Password BasicSecretBase `json:"password,omitempty"` + // UseEncryptedEndpoints - Specifies whether the data source endpoints are encrypted using HTTPS. The default value is true. + UseEncryptedEndpoints interface{} `json:"useEncryptedEndpoints,omitempty"` + // UseHostVerification - Specifies whether to require the host name in the server's certificate to match the host name of the server when connecting over SSL. The default value is true. + UseHostVerification interface{} `json:"useHostVerification,omitempty"` + // UsePeerVerification - Specifies whether to verify the identity of the server when connecting over SSL. The default value is true. + UsePeerVerification interface{} `json:"usePeerVerification,omitempty"` + // EncryptedCredential - The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string). + EncryptedCredential interface{} `json:"encryptedCredential,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for JiraLinkedServiceTypeProperties struct. +func (jlstp *JiraLinkedServiceTypeProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "host": + if v != nil { + var host interface{} + err = json.Unmarshal(*v, &host) + if err != nil { + return err + } + jlstp.Host = host + } + case "port": + if v != nil { + var port interface{} + err = json.Unmarshal(*v, &port) + if err != nil { + return err + } + jlstp.Port = port + } + case "username": + if v != nil { + var username interface{} + err = json.Unmarshal(*v, &username) + if err != nil { + return err + } + jlstp.Username = username + } + case "password": + if v != nil { + password, err := unmarshalBasicSecretBase(*v) + if err != nil { + return err + } + jlstp.Password = password + } + case "useEncryptedEndpoints": + if v != nil { + var useEncryptedEndpoints interface{} + err = json.Unmarshal(*v, &useEncryptedEndpoints) + if err != nil { + return err + } + jlstp.UseEncryptedEndpoints = useEncryptedEndpoints + } + case "useHostVerification": + if v != nil { + var useHostVerification interface{} + err = json.Unmarshal(*v, &useHostVerification) + if err != nil { + return err + } + jlstp.UseHostVerification = useHostVerification + } + case "usePeerVerification": + if v != nil { + var usePeerVerification interface{} + err = json.Unmarshal(*v, &usePeerVerification) + if err != nil { + return err + } + jlstp.UsePeerVerification = usePeerVerification + } + case "encryptedCredential": + if v != nil { + var encryptedCredential interface{} + err = json.Unmarshal(*v, &encryptedCredential) + if err != nil { + return err + } + jlstp.EncryptedCredential = encryptedCredential + } + } + } + + return nil +} + +// JiraObjectDataset jira Serivce dataset. +type JiraObjectDataset struct { + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Description - Dataset description. + Description *string `json:"description,omitempty"` + // Structure - Columns that define the structure of the dataset. Type: array (or Expression with resultType array), itemType: DatasetDataElement. + Structure interface{} `json:"structure,omitempty"` + // LinkedServiceName - Linked service reference. + LinkedServiceName *LinkedServiceReference `json:"linkedServiceName,omitempty"` + // Parameters - Parameters for dataset. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeDataset', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSQLServerTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSalesforceObject', 'TypeRelationalTable', 'TypeAzureMySQLTable', 'TypeOracleTable', 'TypeODataResource', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeAzureDataLakeStoreFile', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeAmazonS3Object' + Type TypeBasicDataset `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for JiraObjectDataset. +func (jod JiraObjectDataset) MarshalJSON() ([]byte, error) { + jod.Type = TypeJiraObject + objectMap := make(map[string]interface{}) + if jod.Description != nil { + objectMap["description"] = jod.Description + } + objectMap["structure"] = jod.Structure + if jod.LinkedServiceName != nil { + objectMap["linkedServiceName"] = jod.LinkedServiceName + } + if jod.Parameters != nil { + objectMap["parameters"] = jod.Parameters + } + if jod.Annotations != nil { + objectMap["annotations"] = jod.Annotations + } + if jod.Type != "" { + objectMap["type"] = jod.Type + } + for k, v := range jod.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysObjectDataset is the BasicDataset implementation for JiraObjectDataset. +func (jod JiraObjectDataset) AsResponsysObjectDataset() (*ResponsysObjectDataset, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudObjectDataset is the BasicDataset implementation for JiraObjectDataset. +func (jod JiraObjectDataset) AsSalesforceMarketingCloudObjectDataset() (*SalesforceMarketingCloudObjectDataset, bool) { + return nil, false +} + +// AsVerticaTableDataset is the BasicDataset implementation for JiraObjectDataset. +func (jod JiraObjectDataset) AsVerticaTableDataset() (*VerticaTableDataset, bool) { + return nil, false +} + +// AsNetezzaTableDataset is the BasicDataset implementation for JiraObjectDataset. +func (jod JiraObjectDataset) AsNetezzaTableDataset() (*NetezzaTableDataset, bool) { + return nil, false +} + +// AsZohoObjectDataset is the BasicDataset implementation for JiraObjectDataset. +func (jod JiraObjectDataset) AsZohoObjectDataset() (*ZohoObjectDataset, bool) { + return nil, false +} + +// AsXeroObjectDataset is the BasicDataset implementation for JiraObjectDataset. +func (jod JiraObjectDataset) AsXeroObjectDataset() (*XeroObjectDataset, bool) { + return nil, false +} + +// AsSquareObjectDataset is the BasicDataset implementation for JiraObjectDataset. +func (jod JiraObjectDataset) AsSquareObjectDataset() (*SquareObjectDataset, bool) { + return nil, false +} + +// AsSparkObjectDataset is the BasicDataset implementation for JiraObjectDataset. +func (jod JiraObjectDataset) AsSparkObjectDataset() (*SparkObjectDataset, bool) { + return nil, false +} + +// AsShopifyObjectDataset is the BasicDataset implementation for JiraObjectDataset. +func (jod JiraObjectDataset) AsShopifyObjectDataset() (*ShopifyObjectDataset, bool) { + return nil, false +} + +// AsServiceNowObjectDataset is the BasicDataset implementation for JiraObjectDataset. +func (jod JiraObjectDataset) AsServiceNowObjectDataset() (*ServiceNowObjectDataset, bool) { + return nil, false +} + +// AsQuickBooksObjectDataset is the BasicDataset implementation for JiraObjectDataset. +func (jod JiraObjectDataset) AsQuickBooksObjectDataset() (*QuickBooksObjectDataset, bool) { + return nil, false +} + +// AsPrestoObjectDataset is the BasicDataset implementation for JiraObjectDataset. +func (jod JiraObjectDataset) AsPrestoObjectDataset() (*PrestoObjectDataset, bool) { + return nil, false +} + +// AsPhoenixObjectDataset is the BasicDataset implementation for JiraObjectDataset. +func (jod JiraObjectDataset) AsPhoenixObjectDataset() (*PhoenixObjectDataset, bool) { + return nil, false +} + +// AsPaypalObjectDataset is the BasicDataset implementation for JiraObjectDataset. +func (jod JiraObjectDataset) AsPaypalObjectDataset() (*PaypalObjectDataset, bool) { + return nil, false +} + +// AsMarketoObjectDataset is the BasicDataset implementation for JiraObjectDataset. +func (jod JiraObjectDataset) AsMarketoObjectDataset() (*MarketoObjectDataset, bool) { + return nil, false +} + +// AsMariaDBTableDataset is the BasicDataset implementation for JiraObjectDataset. +func (jod JiraObjectDataset) AsMariaDBTableDataset() (*MariaDBTableDataset, bool) { + return nil, false +} + +// AsMagentoObjectDataset is the BasicDataset implementation for JiraObjectDataset. +func (jod JiraObjectDataset) AsMagentoObjectDataset() (*MagentoObjectDataset, bool) { + return nil, false +} + +// AsJiraObjectDataset is the BasicDataset implementation for JiraObjectDataset. +func (jod JiraObjectDataset) AsJiraObjectDataset() (*JiraObjectDataset, bool) { + return &jod, true +} + +// AsImpalaObjectDataset is the BasicDataset implementation for JiraObjectDataset. +func (jod JiraObjectDataset) AsImpalaObjectDataset() (*ImpalaObjectDataset, bool) { + return nil, false +} + +// AsHubspotObjectDataset is the BasicDataset implementation for JiraObjectDataset. +func (jod JiraObjectDataset) AsHubspotObjectDataset() (*HubspotObjectDataset, bool) { + return nil, false +} + +// AsHiveObjectDataset is the BasicDataset implementation for JiraObjectDataset. +func (jod JiraObjectDataset) AsHiveObjectDataset() (*HiveObjectDataset, bool) { + return nil, false +} + +// AsHBaseObjectDataset is the BasicDataset implementation for JiraObjectDataset. +func (jod JiraObjectDataset) AsHBaseObjectDataset() (*HBaseObjectDataset, bool) { + return nil, false +} + +// AsGreenplumTableDataset is the BasicDataset implementation for JiraObjectDataset. +func (jod JiraObjectDataset) AsGreenplumTableDataset() (*GreenplumTableDataset, bool) { + return nil, false +} + +// AsGoogleBigQueryObjectDataset is the BasicDataset implementation for JiraObjectDataset. +func (jod JiraObjectDataset) AsGoogleBigQueryObjectDataset() (*GoogleBigQueryObjectDataset, bool) { + return nil, false +} + +// AsEloquaObjectDataset is the BasicDataset implementation for JiraObjectDataset. +func (jod JiraObjectDataset) AsEloquaObjectDataset() (*EloquaObjectDataset, bool) { + return nil, false +} + +// AsDrillTableDataset is the BasicDataset implementation for JiraObjectDataset. +func (jod JiraObjectDataset) AsDrillTableDataset() (*DrillTableDataset, bool) { + return nil, false +} + +// AsCouchbaseTableDataset is the BasicDataset implementation for JiraObjectDataset. +func (jod JiraObjectDataset) AsCouchbaseTableDataset() (*CouchbaseTableDataset, bool) { + return nil, false +} + +// AsConcurObjectDataset is the BasicDataset implementation for JiraObjectDataset. +func (jod JiraObjectDataset) AsConcurObjectDataset() (*ConcurObjectDataset, bool) { + return nil, false +} + +// AsAzurePostgreSQLTableDataset is the BasicDataset implementation for JiraObjectDataset. +func (jod JiraObjectDataset) AsAzurePostgreSQLTableDataset() (*AzurePostgreSQLTableDataset, bool) { + return nil, false +} + +// AsAmazonMWSObjectDataset is the BasicDataset implementation for JiraObjectDataset. +func (jod JiraObjectDataset) AsAmazonMWSObjectDataset() (*AmazonMWSObjectDataset, bool) { + return nil, false +} + +// AsHTTPDataset is the BasicDataset implementation for JiraObjectDataset. +func (jod JiraObjectDataset) AsHTTPDataset() (*HTTPDataset, bool) { + return nil, false +} + +// AsAzureSearchIndexDataset is the BasicDataset implementation for JiraObjectDataset. +func (jod JiraObjectDataset) AsAzureSearchIndexDataset() (*AzureSearchIndexDataset, bool) { + return nil, false +} + +// AsWebTableDataset is the BasicDataset implementation for JiraObjectDataset. +func (jod JiraObjectDataset) AsWebTableDataset() (*WebTableDataset, bool) { + return nil, false +} + +// AsSQLServerTableDataset is the BasicDataset implementation for JiraObjectDataset. +func (jod JiraObjectDataset) AsSQLServerTableDataset() (*SQLServerTableDataset, bool) { + return nil, false +} + +// AsSapEccResourceDataset is the BasicDataset implementation for JiraObjectDataset. +func (jod JiraObjectDataset) AsSapEccResourceDataset() (*SapEccResourceDataset, bool) { + return nil, false +} + +// AsSapCloudForCustomerResourceDataset is the BasicDataset implementation for JiraObjectDataset. +func (jod JiraObjectDataset) AsSapCloudForCustomerResourceDataset() (*SapCloudForCustomerResourceDataset, bool) { + return nil, false +} + +// AsSalesforceObjectDataset is the BasicDataset implementation for JiraObjectDataset. +func (jod JiraObjectDataset) AsSalesforceObjectDataset() (*SalesforceObjectDataset, bool) { + return nil, false +} + +// AsRelationalTableDataset is the BasicDataset implementation for JiraObjectDataset. +func (jod JiraObjectDataset) AsRelationalTableDataset() (*RelationalTableDataset, bool) { + return nil, false +} + +// AsAzureMySQLTableDataset is the BasicDataset implementation for JiraObjectDataset. +func (jod JiraObjectDataset) AsAzureMySQLTableDataset() (*AzureMySQLTableDataset, bool) { + return nil, false +} + +// AsOracleTableDataset is the BasicDataset implementation for JiraObjectDataset. +func (jod JiraObjectDataset) AsOracleTableDataset() (*OracleTableDataset, bool) { + return nil, false +} + +// AsODataResourceDataset is the BasicDataset implementation for JiraObjectDataset. +func (jod JiraObjectDataset) AsODataResourceDataset() (*ODataResourceDataset, bool) { + return nil, false +} + +// AsMongoDbCollectionDataset is the BasicDataset implementation for JiraObjectDataset. +func (jod JiraObjectDataset) AsMongoDbCollectionDataset() (*MongoDbCollectionDataset, bool) { + return nil, false +} + +// AsFileShareDataset is the BasicDataset implementation for JiraObjectDataset. +func (jod JiraObjectDataset) AsFileShareDataset() (*FileShareDataset, bool) { + return nil, false +} + +// AsAzureDataLakeStoreDataset is the BasicDataset implementation for JiraObjectDataset. +func (jod JiraObjectDataset) AsAzureDataLakeStoreDataset() (*AzureDataLakeStoreDataset, bool) { + return nil, false +} + +// AsDynamicsEntityDataset is the BasicDataset implementation for JiraObjectDataset. +func (jod JiraObjectDataset) AsDynamicsEntityDataset() (*DynamicsEntityDataset, bool) { + return nil, false +} + +// AsDocumentDbCollectionDataset is the BasicDataset implementation for JiraObjectDataset. +func (jod JiraObjectDataset) AsDocumentDbCollectionDataset() (*DocumentDbCollectionDataset, bool) { + return nil, false +} + +// AsCustomDataset is the BasicDataset implementation for JiraObjectDataset. +func (jod JiraObjectDataset) AsCustomDataset() (*CustomDataset, bool) { + return nil, false +} + +// AsCassandraTableDataset is the BasicDataset implementation for JiraObjectDataset. +func (jod JiraObjectDataset) AsCassandraTableDataset() (*CassandraTableDataset, bool) { + return nil, false +} + +// AsAzureSQLDWTableDataset is the BasicDataset implementation for JiraObjectDataset. +func (jod JiraObjectDataset) AsAzureSQLDWTableDataset() (*AzureSQLDWTableDataset, bool) { + return nil, false +} + +// AsAzureSQLTableDataset is the BasicDataset implementation for JiraObjectDataset. +func (jod JiraObjectDataset) AsAzureSQLTableDataset() (*AzureSQLTableDataset, bool) { + return nil, false +} + +// AsAzureTableDataset is the BasicDataset implementation for JiraObjectDataset. +func (jod JiraObjectDataset) AsAzureTableDataset() (*AzureTableDataset, bool) { + return nil, false +} + +// AsAzureBlobDataset is the BasicDataset implementation for JiraObjectDataset. +func (jod JiraObjectDataset) AsAzureBlobDataset() (*AzureBlobDataset, bool) { + return nil, false +} + +// AsAmazonS3Dataset is the BasicDataset implementation for JiraObjectDataset. +func (jod JiraObjectDataset) AsAmazonS3Dataset() (*AmazonS3Dataset, bool) { + return nil, false +} + +// AsDataset is the BasicDataset implementation for JiraObjectDataset. +func (jod JiraObjectDataset) AsDataset() (*Dataset, bool) { + return nil, false +} + +// AsBasicDataset is the BasicDataset implementation for JiraObjectDataset. +func (jod JiraObjectDataset) AsBasicDataset() (BasicDataset, bool) { + return &jod, true +} + +// JiraSource a copy activity Jira Serivce source. +type JiraSource struct { + // Query - A query to retrieve data from source. Type: string (or Expression with resultType string). + Query interface{} `json:"query,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // SourceRetryCount - Source retry count. Type: integer (or Expression with resultType integer). + SourceRetryCount interface{} `json:"sourceRetryCount,omitempty"` + // SourceRetryWait - Source retry wait. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` + // Type - Possible values include: 'TypeCopySource', 'TypeAmazonRedshiftSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeHTTPSource', 'TypeAzureDataLakeStoreSource', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeRelationalSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource' + Type TypeBasicCopySource `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for JiraSource. +func (js JiraSource) MarshalJSON() ([]byte, error) { + js.Type = TypeJiraSource + objectMap := make(map[string]interface{}) + objectMap["query"] = js.Query + objectMap["sourceRetryCount"] = js.SourceRetryCount + objectMap["sourceRetryWait"] = js.SourceRetryWait + if js.Type != "" { + objectMap["type"] = js.Type + } + for k, v := range js.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsAmazonRedshiftSource is the BasicCopySource implementation for JiraSource. +func (js JiraSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { + return nil, false +} + +// AsResponsysSource is the BasicCopySource implementation for JiraSource. +func (js JiraSource) AsResponsysSource() (*ResponsysSource, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudSource is the BasicCopySource implementation for JiraSource. +func (js JiraSource) AsSalesforceMarketingCloudSource() (*SalesforceMarketingCloudSource, bool) { + return nil, false +} + +// AsVerticaSource is the BasicCopySource implementation for JiraSource. +func (js JiraSource) AsVerticaSource() (*VerticaSource, bool) { + return nil, false +} + +// AsNetezzaSource is the BasicCopySource implementation for JiraSource. +func (js JiraSource) AsNetezzaSource() (*NetezzaSource, bool) { + return nil, false +} + +// AsZohoSource is the BasicCopySource implementation for JiraSource. +func (js JiraSource) AsZohoSource() (*ZohoSource, bool) { + return nil, false +} + +// AsXeroSource is the BasicCopySource implementation for JiraSource. +func (js JiraSource) AsXeroSource() (*XeroSource, bool) { + return nil, false +} + +// AsSquareSource is the BasicCopySource implementation for JiraSource. +func (js JiraSource) AsSquareSource() (*SquareSource, bool) { + return nil, false +} + +// AsSparkSource is the BasicCopySource implementation for JiraSource. +func (js JiraSource) AsSparkSource() (*SparkSource, bool) { + return nil, false +} + +// AsShopifySource is the BasicCopySource implementation for JiraSource. +func (js JiraSource) AsShopifySource() (*ShopifySource, bool) { + return nil, false +} + +// AsServiceNowSource is the BasicCopySource implementation for JiraSource. +func (js JiraSource) AsServiceNowSource() (*ServiceNowSource, bool) { + return nil, false +} + +// AsQuickBooksSource is the BasicCopySource implementation for JiraSource. +func (js JiraSource) AsQuickBooksSource() (*QuickBooksSource, bool) { + return nil, false +} + +// AsPrestoSource is the BasicCopySource implementation for JiraSource. +func (js JiraSource) AsPrestoSource() (*PrestoSource, bool) { + return nil, false +} + +// AsPhoenixSource is the BasicCopySource implementation for JiraSource. +func (js JiraSource) AsPhoenixSource() (*PhoenixSource, bool) { + return nil, false +} + +// AsPaypalSource is the BasicCopySource implementation for JiraSource. +func (js JiraSource) AsPaypalSource() (*PaypalSource, bool) { + return nil, false +} + +// AsMarketoSource is the BasicCopySource implementation for JiraSource. +func (js JiraSource) AsMarketoSource() (*MarketoSource, bool) { + return nil, false +} + +// AsMariaDBSource is the BasicCopySource implementation for JiraSource. +func (js JiraSource) AsMariaDBSource() (*MariaDBSource, bool) { + return nil, false +} + +// AsMagentoSource is the BasicCopySource implementation for JiraSource. +func (js JiraSource) AsMagentoSource() (*MagentoSource, bool) { + return nil, false +} + +// AsJiraSource is the BasicCopySource implementation for JiraSource. +func (js JiraSource) AsJiraSource() (*JiraSource, bool) { + return &js, true +} + +// AsImpalaSource is the BasicCopySource implementation for JiraSource. +func (js JiraSource) AsImpalaSource() (*ImpalaSource, bool) { + return nil, false +} + +// AsHubspotSource is the BasicCopySource implementation for JiraSource. +func (js JiraSource) AsHubspotSource() (*HubspotSource, bool) { + return nil, false +} + +// AsHiveSource is the BasicCopySource implementation for JiraSource. +func (js JiraSource) AsHiveSource() (*HiveSource, bool) { + return nil, false +} + +// AsHBaseSource is the BasicCopySource implementation for JiraSource. +func (js JiraSource) AsHBaseSource() (*HBaseSource, bool) { + return nil, false +} + +// AsGreenplumSource is the BasicCopySource implementation for JiraSource. +func (js JiraSource) AsGreenplumSource() (*GreenplumSource, bool) { + return nil, false +} + +// AsGoogleBigQuerySource is the BasicCopySource implementation for JiraSource. +func (js JiraSource) AsGoogleBigQuerySource() (*GoogleBigQuerySource, bool) { + return nil, false +} + +// AsEloquaSource is the BasicCopySource implementation for JiraSource. +func (js JiraSource) AsEloquaSource() (*EloquaSource, bool) { + return nil, false +} + +// AsDrillSource is the BasicCopySource implementation for JiraSource. +func (js JiraSource) AsDrillSource() (*DrillSource, bool) { + return nil, false +} + +// AsCouchbaseSource is the BasicCopySource implementation for JiraSource. +func (js JiraSource) AsCouchbaseSource() (*CouchbaseSource, bool) { + return nil, false +} + +// AsConcurSource is the BasicCopySource implementation for JiraSource. +func (js JiraSource) AsConcurSource() (*ConcurSource, bool) { + return nil, false +} + +// AsAzurePostgreSQLSource is the BasicCopySource implementation for JiraSource. +func (js JiraSource) AsAzurePostgreSQLSource() (*AzurePostgreSQLSource, bool) { + return nil, false +} + +// AsAmazonMWSSource is the BasicCopySource implementation for JiraSource. +func (js JiraSource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { + return nil, false +} + +// AsHTTPSource is the BasicCopySource implementation for JiraSource. +func (js JiraSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for JiraSource. +func (js JiraSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for JiraSource. +func (js JiraSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsCassandraSource is the BasicCopySource implementation for JiraSource. +func (js JiraSource) AsCassandraSource() (*CassandraSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for JiraSource. +func (js JiraSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for JiraSource. +func (js JiraSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureMySQLSource is the BasicCopySource implementation for JiraSource. +func (js JiraSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for JiraSource. +func (js JiraSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for JiraSource. +func (js JiraSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsSQLDWSource is the BasicCopySource implementation for JiraSource. +func (js JiraSource) AsSQLDWSource() (*SQLDWSource, bool) { + return nil, false +} + +// AsSQLSource is the BasicCopySource implementation for JiraSource. +func (js JiraSource) AsSQLSource() (*SQLSource, bool) { + return nil, false +} + +// AsSapEccSource is the BasicCopySource implementation for JiraSource. +func (js JiraSource) AsSapEccSource() (*SapEccSource, bool) { + return nil, false +} + +// AsSapCloudForCustomerSource is the BasicCopySource implementation for JiraSource. +func (js JiraSource) AsSapCloudForCustomerSource() (*SapCloudForCustomerSource, bool) { + return nil, false +} + +// AsSalesforceSource is the BasicCopySource implementation for JiraSource. +func (js JiraSource) AsSalesforceSource() (*SalesforceSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for JiraSource. +func (js JiraSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for JiraSource. +func (js JiraSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for JiraSource. +func (js JiraSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for JiraSource. +func (js JiraSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + +// AsAzureTableSource is the BasicCopySource implementation for JiraSource. +func (js JiraSource) AsAzureTableSource() (*AzureTableSource, bool) { + return nil, false +} + +// AsCopySource is the BasicCopySource implementation for JiraSource. +func (js JiraSource) AsCopySource() (*CopySource, bool) { + return nil, false +} + +// AsBasicCopySource is the BasicCopySource implementation for JiraSource. +func (js JiraSource) AsBasicCopySource() (BasicCopySource, bool) { + return &js, true +} + +// JSONFormat the data stored in JSON format. +type JSONFormat struct { + // FilePattern - File pattern of JSON. To be more specific, the way of separating a collection of JSON objects. The default value is 'setOfObjects'. It is case-sensitive. Possible values include: 'SetOfObjects', 'ArrayOfObjects' + FilePattern JSONFormatFilePattern `json:"filePattern,omitempty"` + // NestingSeparator - The character used to separate nesting levels. Default value is '.' (dot). Type: string (or Expression with resultType string). + NestingSeparator interface{} `json:"nestingSeparator,omitempty"` + // EncodingName - The code page name of the preferred encoding. If not provided, the default value is 'utf-8', unless the byte order mark (BOM) denotes another Unicode encoding. The full list of supported values can be found in the 'Name' column of the table of encodings in the following reference: https://go.microsoft.com/fwlink/?linkid=861078. Type: string (or Expression with resultType string). + EncodingName interface{} `json:"encodingName,omitempty"` + // JSONNodeReference - The JSONPath of the JSON array element to be flattened. Example: "$.ArrayPath". Type: string (or Expression with resultType string). + JSONNodeReference interface{} `json:"jsonNodeReference,omitempty"` + // JSONPathDefinition - The JSONPath definition for each column mapping with a customized column name to extract data from JSON file. For fields under root object, start with "$"; for fields inside the array chosen by jsonNodeReference property, start from the array element. Example: {"Column1": "$.Column1Path", "Column2": "Column2PathInArray"}. Type: object (or Expression with resultType object). + JSONPathDefinition interface{} `json:"jsonPathDefinition,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Serializer - Serializer. Type: string (or Expression with resultType string). + Serializer interface{} `json:"serializer,omitempty"` + // Deserializer - Deserializer. Type: string (or Expression with resultType string). + Deserializer interface{} `json:"deserializer,omitempty"` + // Type - Possible values include: 'TypeDatasetStorageFormat', 'TypeParquetFormat', 'TypeOrcFormat', 'TypeAvroFormat', 'TypeJSONFormat', 'TypeTextFormat' + Type TypeBasicDatasetStorageFormat `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for JSONFormat. +func (jf JSONFormat) MarshalJSON() ([]byte, error) { + jf.Type = TypeJSONFormat + objectMap := make(map[string]interface{}) + if jf.FilePattern != "" { + objectMap["filePattern"] = jf.FilePattern + } + objectMap["nestingSeparator"] = jf.NestingSeparator + objectMap["encodingName"] = jf.EncodingName + objectMap["jsonNodeReference"] = jf.JSONNodeReference + objectMap["jsonPathDefinition"] = jf.JSONPathDefinition + objectMap["serializer"] = jf.Serializer + objectMap["deserializer"] = jf.Deserializer + if jf.Type != "" { + objectMap["type"] = jf.Type + } + for k, v := range jf.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsParquetFormat is the BasicDatasetStorageFormat implementation for JSONFormat. +func (jf JSONFormat) AsParquetFormat() (*ParquetFormat, bool) { + return nil, false +} + +// AsOrcFormat is the BasicDatasetStorageFormat implementation for JSONFormat. +func (jf JSONFormat) AsOrcFormat() (*OrcFormat, bool) { + return nil, false +} + +// AsAvroFormat is the BasicDatasetStorageFormat implementation for JSONFormat. +func (jf JSONFormat) AsAvroFormat() (*AvroFormat, bool) { + return nil, false +} + +// AsJSONFormat is the BasicDatasetStorageFormat implementation for JSONFormat. +func (jf JSONFormat) AsJSONFormat() (*JSONFormat, bool) { + return &jf, true +} + +// AsTextFormat is the BasicDatasetStorageFormat implementation for JSONFormat. +func (jf JSONFormat) AsTextFormat() (*TextFormat, bool) { + return nil, false +} + +// AsDatasetStorageFormat is the BasicDatasetStorageFormat implementation for JSONFormat. +func (jf JSONFormat) AsDatasetStorageFormat() (*DatasetStorageFormat, bool) { + return nil, false +} + +// AsBasicDatasetStorageFormat is the BasicDatasetStorageFormat implementation for JSONFormat. +func (jf JSONFormat) AsBasicDatasetStorageFormat() (BasicDatasetStorageFormat, bool) { + return &jf, true +} + +// BasicLinkedService the Azure Data Factory nested object which contains the information and credential which can be +// used to connect with related store or compute resource. +type BasicLinkedService interface { + AsResponsysLinkedService() (*ResponsysLinkedService, bool) + AsAzureDatabricksLinkedService() (*AzureDatabricksLinkedService, bool) + AsAzureDataLakeAnalyticsLinkedService() (*AzureDataLakeAnalyticsLinkedService, bool) + AsHDInsightOnDemandLinkedService() (*HDInsightOnDemandLinkedService, bool) + AsSalesforceMarketingCloudLinkedService() (*SalesforceMarketingCloudLinkedService, bool) + AsNetezzaLinkedService() (*NetezzaLinkedService, bool) + AsVerticaLinkedService() (*VerticaLinkedService, bool) + AsZohoLinkedService() (*ZohoLinkedService, bool) + AsXeroLinkedService() (*XeroLinkedService, bool) + AsSquareLinkedService() (*SquareLinkedService, bool) + AsSparkLinkedService() (*SparkLinkedService, bool) + AsShopifyLinkedService() (*ShopifyLinkedService, bool) + AsServiceNowLinkedService() (*ServiceNowLinkedService, bool) + AsQuickBooksLinkedService() (*QuickBooksLinkedService, bool) + AsPrestoLinkedService() (*PrestoLinkedService, bool) + AsPhoenixLinkedService() (*PhoenixLinkedService, bool) + AsPaypalLinkedService() (*PaypalLinkedService, bool) + AsMarketoLinkedService() (*MarketoLinkedService, bool) + AsMariaDBLinkedService() (*MariaDBLinkedService, bool) + AsMagentoLinkedService() (*MagentoLinkedService, bool) + AsJiraLinkedService() (*JiraLinkedService, bool) + AsImpalaLinkedService() (*ImpalaLinkedService, bool) + AsHubspotLinkedService() (*HubspotLinkedService, bool) + AsHiveLinkedService() (*HiveLinkedService, bool) + AsHBaseLinkedService() (*HBaseLinkedService, bool) + AsGreenplumLinkedService() (*GreenplumLinkedService, bool) + AsGoogleBigQueryLinkedService() (*GoogleBigQueryLinkedService, bool) + AsEloquaLinkedService() (*EloquaLinkedService, bool) + AsDrillLinkedService() (*DrillLinkedService, bool) + AsCouchbaseLinkedService() (*CouchbaseLinkedService, bool) + AsConcurLinkedService() (*ConcurLinkedService, bool) + AsAzurePostgreSQLLinkedService() (*AzurePostgreSQLLinkedService, bool) + AsAmazonMWSLinkedService() (*AmazonMWSLinkedService, bool) + AsSapHanaLinkedService() (*SapHanaLinkedService, bool) + AsSapBWLinkedService() (*SapBWLinkedService, bool) + AsSftpServerLinkedService() (*SftpServerLinkedService, bool) + AsFtpServerLinkedService() (*FtpServerLinkedService, bool) + AsHTTPLinkedService() (*HTTPLinkedService, bool) + AsAzureSearchLinkedService() (*AzureSearchLinkedService, bool) + AsCustomDataSourceLinkedService() (*CustomDataSourceLinkedService, bool) + AsAmazonRedshiftLinkedService() (*AmazonRedshiftLinkedService, bool) + AsAmazonS3LinkedService() (*AmazonS3LinkedService, bool) + AsSapEccLinkedService() (*SapEccLinkedService, bool) + AsSapCloudForCustomerLinkedService() (*SapCloudForCustomerLinkedService, bool) + AsSalesforceLinkedService() (*SalesforceLinkedService, bool) + AsAzureDataLakeStoreLinkedService() (*AzureDataLakeStoreLinkedService, bool) + AsMongoDbLinkedService() (*MongoDbLinkedService, bool) + AsCassandraLinkedService() (*CassandraLinkedService, bool) + AsWebLinkedService() (*WebLinkedService, bool) + AsODataLinkedService() (*ODataLinkedService, bool) + AsHdfsLinkedService() (*HdfsLinkedService, bool) + AsOdbcLinkedService() (*OdbcLinkedService, bool) + AsAzureMLLinkedService() (*AzureMLLinkedService, bool) + AsTeradataLinkedService() (*TeradataLinkedService, bool) + AsDb2LinkedService() (*Db2LinkedService, bool) + AsSybaseLinkedService() (*SybaseLinkedService, bool) + AsPostgreSQLLinkedService() (*PostgreSQLLinkedService, bool) + AsMySQLLinkedService() (*MySQLLinkedService, bool) + AsAzureMySQLLinkedService() (*AzureMySQLLinkedService, bool) + AsOracleLinkedService() (*OracleLinkedService, bool) + AsFileServerLinkedService() (*FileServerLinkedService, bool) + AsHDInsightLinkedService() (*HDInsightLinkedService, bool) + AsDynamicsLinkedService() (*DynamicsLinkedService, bool) + AsCosmosDbLinkedService() (*CosmosDbLinkedService, bool) + AsAzureKeyVaultLinkedService() (*AzureKeyVaultLinkedService, bool) + AsAzureBatchLinkedService() (*AzureBatchLinkedService, bool) + AsAzureSQLDatabaseLinkedService() (*AzureSQLDatabaseLinkedService, bool) + AsSQLServerLinkedService() (*SQLServerLinkedService, bool) + AsAzureSQLDWLinkedService() (*AzureSQLDWLinkedService, bool) + AsAzureStorageLinkedService() (*AzureStorageLinkedService, bool) + AsLinkedService() (*LinkedService, bool) +} + +// LinkedService the Azure Data Factory nested object which contains the information and credential which can be +// used to connect with related store or compute resource. +type LinkedService struct { + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // ConnectVia - The integration runtime reference. + ConnectVia *IntegrationRuntimeReference `json:"connectVia,omitempty"` + // Description - Linked service description. + Description *string `json:"description,omitempty"` + // Parameters - Parameters for linked service. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeLinkedService', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforce', 'TypeAzureDataLakeStore', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureStorage' + Type TypeBasicLinkedService `json:"type,omitempty"` +} + +func unmarshalBasicLinkedService(body []byte) (BasicLinkedService, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["type"] { + case string(TypeResponsys): + var rls ResponsysLinkedService + err := json.Unmarshal(body, &rls) + return rls, err + case string(TypeAzureDatabricks): + var adls AzureDatabricksLinkedService + err := json.Unmarshal(body, &adls) + return adls, err + case string(TypeAzureDataLakeAnalytics): + var adlals AzureDataLakeAnalyticsLinkedService + err := json.Unmarshal(body, &adlals) + return adlals, err + case string(TypeHDInsightOnDemand): + var hiodls HDInsightOnDemandLinkedService + err := json.Unmarshal(body, &hiodls) + return hiodls, err + case string(TypeSalesforceMarketingCloud): + var smcls SalesforceMarketingCloudLinkedService + err := json.Unmarshal(body, &smcls) + return smcls, err + case string(TypeNetezza): + var nls NetezzaLinkedService + err := json.Unmarshal(body, &nls) + return nls, err + case string(TypeVertica): + var vls VerticaLinkedService + err := json.Unmarshal(body, &vls) + return vls, err + case string(TypeZoho): + var zls ZohoLinkedService + err := json.Unmarshal(body, &zls) + return zls, err + case string(TypeXero): + var xls XeroLinkedService + err := json.Unmarshal(body, &xls) + return xls, err + case string(TypeSquare): + var sls SquareLinkedService + err := json.Unmarshal(body, &sls) + return sls, err + case string(TypeSpark): + var sls SparkLinkedService + err := json.Unmarshal(body, &sls) + return sls, err + case string(TypeShopify): + var sls ShopifyLinkedService + err := json.Unmarshal(body, &sls) + return sls, err + case string(TypeServiceNow): + var snls ServiceNowLinkedService + err := json.Unmarshal(body, &snls) + return snls, err + case string(TypeQuickBooks): + var qbls QuickBooksLinkedService + err := json.Unmarshal(body, &qbls) + return qbls, err + case string(TypePresto): + var pls PrestoLinkedService + err := json.Unmarshal(body, &pls) + return pls, err + case string(TypePhoenix): + var pls PhoenixLinkedService + err := json.Unmarshal(body, &pls) + return pls, err + case string(TypePaypal): + var pls PaypalLinkedService + err := json.Unmarshal(body, &pls) + return pls, err + case string(TypeMarketo): + var mls MarketoLinkedService + err := json.Unmarshal(body, &mls) + return mls, err + case string(TypeMariaDB): + var mdls MariaDBLinkedService + err := json.Unmarshal(body, &mdls) + return mdls, err + case string(TypeMagento): + var mls MagentoLinkedService + err := json.Unmarshal(body, &mls) + return mls, err + case string(TypeJira): + var jls JiraLinkedService + err := json.Unmarshal(body, &jls) + return jls, err + case string(TypeImpala): + var ils ImpalaLinkedService + err := json.Unmarshal(body, &ils) + return ils, err + case string(TypeHubspot): + var hls HubspotLinkedService + err := json.Unmarshal(body, &hls) + return hls, err + case string(TypeHive): + var hls HiveLinkedService + err := json.Unmarshal(body, &hls) + return hls, err + case string(TypeHBase): + var hbls HBaseLinkedService + err := json.Unmarshal(body, &hbls) + return hbls, err + case string(TypeGreenplum): + var gls GreenplumLinkedService + err := json.Unmarshal(body, &gls) + return gls, err + case string(TypeGoogleBigQuery): + var gbqls GoogleBigQueryLinkedService + err := json.Unmarshal(body, &gbqls) + return gbqls, err + case string(TypeEloqua): + var els EloquaLinkedService + err := json.Unmarshal(body, &els) + return els, err + case string(TypeDrill): + var dls DrillLinkedService + err := json.Unmarshal(body, &dls) + return dls, err + case string(TypeCouchbase): + var cls CouchbaseLinkedService + err := json.Unmarshal(body, &cls) + return cls, err + case string(TypeConcur): + var cls ConcurLinkedService + err := json.Unmarshal(body, &cls) + return cls, err + case string(TypeAzurePostgreSQL): + var apsls AzurePostgreSQLLinkedService + err := json.Unmarshal(body, &apsls) + return apsls, err + case string(TypeAmazonMWS): + var amls AmazonMWSLinkedService + err := json.Unmarshal(body, &amls) + return amls, err + case string(TypeSapHana): + var shls SapHanaLinkedService + err := json.Unmarshal(body, &shls) + return shls, err + case string(TypeSapBW): + var sbls SapBWLinkedService + err := json.Unmarshal(body, &sbls) + return sbls, err + case string(TypeSftp): + var ssls SftpServerLinkedService + err := json.Unmarshal(body, &ssls) + return ssls, err + case string(TypeFtpServer): + var fsls FtpServerLinkedService + err := json.Unmarshal(body, &fsls) + return fsls, err + case string(TypeHTTPServer): + var hls HTTPLinkedService + err := json.Unmarshal(body, &hls) + return hls, err + case string(TypeAzureSearch): + var asls AzureSearchLinkedService + err := json.Unmarshal(body, &asls) + return asls, err + case string(TypeCustomDataSource): + var cdsls CustomDataSourceLinkedService + err := json.Unmarshal(body, &cdsls) + return cdsls, err + case string(TypeAmazonRedshift): + var arls AmazonRedshiftLinkedService + err := json.Unmarshal(body, &arls) + return arls, err + case string(TypeAmazonS3): + var asls AmazonS3LinkedService + err := json.Unmarshal(body, &asls) + return asls, err + case string(TypeSapEcc): + var sels SapEccLinkedService + err := json.Unmarshal(body, &sels) + return sels, err + case string(TypeSapCloudForCustomer): + var scfcls SapCloudForCustomerLinkedService + err := json.Unmarshal(body, &scfcls) + return scfcls, err + case string(TypeSalesforce): + var sls SalesforceLinkedService + err := json.Unmarshal(body, &sls) + return sls, err + case string(TypeAzureDataLakeStore): + var adlsls AzureDataLakeStoreLinkedService + err := json.Unmarshal(body, &adlsls) + return adlsls, err + case string(TypeMongoDb): + var mdls MongoDbLinkedService + err := json.Unmarshal(body, &mdls) + return mdls, err + case string(TypeCassandra): + var cls CassandraLinkedService + err := json.Unmarshal(body, &cls) + return cls, err + case string(TypeWeb): + var wls WebLinkedService + err := json.Unmarshal(body, &wls) + return wls, err + case string(TypeOData): + var odls ODataLinkedService + err := json.Unmarshal(body, &odls) + return odls, err + case string(TypeHdfs): + var hls HdfsLinkedService + err := json.Unmarshal(body, &hls) + return hls, err + case string(TypeOdbc): + var ols OdbcLinkedService + err := json.Unmarshal(body, &ols) + return ols, err + case string(TypeAzureML): + var amls AzureMLLinkedService + err := json.Unmarshal(body, &amls) + return amls, err + case string(TypeTeradata): + var TLSVar TeradataLinkedService + err := json.Unmarshal(body, &TLSVar) + return TLSVar, err + case string(TypeDb2): + var d2ls Db2LinkedService + err := json.Unmarshal(body, &d2ls) + return d2ls, err + case string(TypeSybase): + var sls SybaseLinkedService + err := json.Unmarshal(body, &sls) + return sls, err + case string(TypePostgreSQL): + var psls PostgreSQLLinkedService + err := json.Unmarshal(body, &psls) + return psls, err + case string(TypeMySQL): + var msls MySQLLinkedService + err := json.Unmarshal(body, &msls) + return msls, err + case string(TypeAzureMySQL): + var amsls AzureMySQLLinkedService + err := json.Unmarshal(body, &amsls) + return amsls, err + case string(TypeOracle): + var ols OracleLinkedService + err := json.Unmarshal(body, &ols) + return ols, err + case string(TypeFileServer): + var fsls FileServerLinkedService + err := json.Unmarshal(body, &fsls) + return fsls, err + case string(TypeHDInsight): + var hils HDInsightLinkedService + err := json.Unmarshal(body, &hils) + return hils, err + case string(TypeDynamics): + var dls DynamicsLinkedService + err := json.Unmarshal(body, &dls) + return dls, err + case string(TypeCosmosDb): + var cdls CosmosDbLinkedService + err := json.Unmarshal(body, &cdls) + return cdls, err + case string(TypeAzureKeyVault): + var akvls AzureKeyVaultLinkedService + err := json.Unmarshal(body, &akvls) + return akvls, err + case string(TypeAzureBatch): + var abls AzureBatchLinkedService + err := json.Unmarshal(body, &abls) + return abls, err + case string(TypeAzureSQLDatabase): + var asdls AzureSQLDatabaseLinkedService + err := json.Unmarshal(body, &asdls) + return asdls, err + case string(TypeSQLServer): + var ssls SQLServerLinkedService + err := json.Unmarshal(body, &ssls) + return ssls, err + case string(TypeAzureSQLDW): + var asdls AzureSQLDWLinkedService + err := json.Unmarshal(body, &asdls) + return asdls, err + case string(TypeAzureStorage): + var asls AzureStorageLinkedService + err := json.Unmarshal(body, &asls) + return asls, err + default: + var ls LinkedService + err := json.Unmarshal(body, &ls) + return ls, err + } +} +func unmarshalBasicLinkedServiceArray(body []byte) ([]BasicLinkedService, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + lsArray := make([]BasicLinkedService, len(rawMessages)) + + for index, rawMessage := range rawMessages { + ls, err := unmarshalBasicLinkedService(*rawMessage) + if err != nil { + return nil, err + } + lsArray[index] = ls + } + return lsArray, nil +} + +// MarshalJSON is the custom marshaler for LinkedService. +func (ls LinkedService) MarshalJSON() ([]byte, error) { + ls.Type = TypeLinkedService + objectMap := make(map[string]interface{}) + if ls.ConnectVia != nil { + objectMap["connectVia"] = ls.ConnectVia + } + if ls.Description != nil { + objectMap["description"] = ls.Description + } + if ls.Parameters != nil { + objectMap["parameters"] = ls.Parameters + } + if ls.Annotations != nil { + objectMap["annotations"] = ls.Annotations + } + if ls.Type != "" { + objectMap["type"] = ls.Type + } + for k, v := range ls.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysLinkedService is the BasicLinkedService implementation for LinkedService. +func (ls LinkedService) AsResponsysLinkedService() (*ResponsysLinkedService, bool) { + return nil, false +} + +// AsAzureDatabricksLinkedService is the BasicLinkedService implementation for LinkedService. +func (ls LinkedService) AsAzureDatabricksLinkedService() (*AzureDatabricksLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeAnalyticsLinkedService is the BasicLinkedService implementation for LinkedService. +func (ls LinkedService) AsAzureDataLakeAnalyticsLinkedService() (*AzureDataLakeAnalyticsLinkedService, bool) { + return nil, false +} + +// AsHDInsightOnDemandLinkedService is the BasicLinkedService implementation for LinkedService. +func (ls LinkedService) AsHDInsightOnDemandLinkedService() (*HDInsightOnDemandLinkedService, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudLinkedService is the BasicLinkedService implementation for LinkedService. +func (ls LinkedService) AsSalesforceMarketingCloudLinkedService() (*SalesforceMarketingCloudLinkedService, bool) { + return nil, false +} + +// AsNetezzaLinkedService is the BasicLinkedService implementation for LinkedService. +func (ls LinkedService) AsNetezzaLinkedService() (*NetezzaLinkedService, bool) { + return nil, false +} + +// AsVerticaLinkedService is the BasicLinkedService implementation for LinkedService. +func (ls LinkedService) AsVerticaLinkedService() (*VerticaLinkedService, bool) { + return nil, false +} + +// AsZohoLinkedService is the BasicLinkedService implementation for LinkedService. +func (ls LinkedService) AsZohoLinkedService() (*ZohoLinkedService, bool) { + return nil, false +} + +// AsXeroLinkedService is the BasicLinkedService implementation for LinkedService. +func (ls LinkedService) AsXeroLinkedService() (*XeroLinkedService, bool) { + return nil, false +} + +// AsSquareLinkedService is the BasicLinkedService implementation for LinkedService. +func (ls LinkedService) AsSquareLinkedService() (*SquareLinkedService, bool) { + return nil, false +} + +// AsSparkLinkedService is the BasicLinkedService implementation for LinkedService. +func (ls LinkedService) AsSparkLinkedService() (*SparkLinkedService, bool) { + return nil, false +} + +// AsShopifyLinkedService is the BasicLinkedService implementation for LinkedService. +func (ls LinkedService) AsShopifyLinkedService() (*ShopifyLinkedService, bool) { + return nil, false +} + +// AsServiceNowLinkedService is the BasicLinkedService implementation for LinkedService. +func (ls LinkedService) AsServiceNowLinkedService() (*ServiceNowLinkedService, bool) { + return nil, false +} + +// AsQuickBooksLinkedService is the BasicLinkedService implementation for LinkedService. +func (ls LinkedService) AsQuickBooksLinkedService() (*QuickBooksLinkedService, bool) { + return nil, false +} + +// AsPrestoLinkedService is the BasicLinkedService implementation for LinkedService. +func (ls LinkedService) AsPrestoLinkedService() (*PrestoLinkedService, bool) { + return nil, false +} + +// AsPhoenixLinkedService is the BasicLinkedService implementation for LinkedService. +func (ls LinkedService) AsPhoenixLinkedService() (*PhoenixLinkedService, bool) { + return nil, false +} + +// AsPaypalLinkedService is the BasicLinkedService implementation for LinkedService. +func (ls LinkedService) AsPaypalLinkedService() (*PaypalLinkedService, bool) { + return nil, false +} + +// AsMarketoLinkedService is the BasicLinkedService implementation for LinkedService. +func (ls LinkedService) AsMarketoLinkedService() (*MarketoLinkedService, bool) { + return nil, false +} + +// AsMariaDBLinkedService is the BasicLinkedService implementation for LinkedService. +func (ls LinkedService) AsMariaDBLinkedService() (*MariaDBLinkedService, bool) { + return nil, false +} + +// AsMagentoLinkedService is the BasicLinkedService implementation for LinkedService. +func (ls LinkedService) AsMagentoLinkedService() (*MagentoLinkedService, bool) { + return nil, false +} + +// AsJiraLinkedService is the BasicLinkedService implementation for LinkedService. +func (ls LinkedService) AsJiraLinkedService() (*JiraLinkedService, bool) { + return nil, false +} + +// AsImpalaLinkedService is the BasicLinkedService implementation for LinkedService. +func (ls LinkedService) AsImpalaLinkedService() (*ImpalaLinkedService, bool) { + return nil, false +} + +// AsHubspotLinkedService is the BasicLinkedService implementation for LinkedService. +func (ls LinkedService) AsHubspotLinkedService() (*HubspotLinkedService, bool) { + return nil, false +} + +// AsHiveLinkedService is the BasicLinkedService implementation for LinkedService. +func (ls LinkedService) AsHiveLinkedService() (*HiveLinkedService, bool) { + return nil, false +} + +// AsHBaseLinkedService is the BasicLinkedService implementation for LinkedService. +func (ls LinkedService) AsHBaseLinkedService() (*HBaseLinkedService, bool) { + return nil, false +} + +// AsGreenplumLinkedService is the BasicLinkedService implementation for LinkedService. +func (ls LinkedService) AsGreenplumLinkedService() (*GreenplumLinkedService, bool) { + return nil, false +} + +// AsGoogleBigQueryLinkedService is the BasicLinkedService implementation for LinkedService. +func (ls LinkedService) AsGoogleBigQueryLinkedService() (*GoogleBigQueryLinkedService, bool) { + return nil, false +} + +// AsEloquaLinkedService is the BasicLinkedService implementation for LinkedService. +func (ls LinkedService) AsEloquaLinkedService() (*EloquaLinkedService, bool) { + return nil, false +} + +// AsDrillLinkedService is the BasicLinkedService implementation for LinkedService. +func (ls LinkedService) AsDrillLinkedService() (*DrillLinkedService, bool) { + return nil, false +} + +// AsCouchbaseLinkedService is the BasicLinkedService implementation for LinkedService. +func (ls LinkedService) AsCouchbaseLinkedService() (*CouchbaseLinkedService, bool) { + return nil, false +} + +// AsConcurLinkedService is the BasicLinkedService implementation for LinkedService. +func (ls LinkedService) AsConcurLinkedService() (*ConcurLinkedService, bool) { + return nil, false +} + +// AsAzurePostgreSQLLinkedService is the BasicLinkedService implementation for LinkedService. +func (ls LinkedService) AsAzurePostgreSQLLinkedService() (*AzurePostgreSQLLinkedService, bool) { + return nil, false +} + +// AsAmazonMWSLinkedService is the BasicLinkedService implementation for LinkedService. +func (ls LinkedService) AsAmazonMWSLinkedService() (*AmazonMWSLinkedService, bool) { + return nil, false +} + +// AsSapHanaLinkedService is the BasicLinkedService implementation for LinkedService. +func (ls LinkedService) AsSapHanaLinkedService() (*SapHanaLinkedService, bool) { + return nil, false +} + +// AsSapBWLinkedService is the BasicLinkedService implementation for LinkedService. +func (ls LinkedService) AsSapBWLinkedService() (*SapBWLinkedService, bool) { + return nil, false +} + +// AsSftpServerLinkedService is the BasicLinkedService implementation for LinkedService. +func (ls LinkedService) AsSftpServerLinkedService() (*SftpServerLinkedService, bool) { + return nil, false +} + +// AsFtpServerLinkedService is the BasicLinkedService implementation for LinkedService. +func (ls LinkedService) AsFtpServerLinkedService() (*FtpServerLinkedService, bool) { + return nil, false +} + +// AsHTTPLinkedService is the BasicLinkedService implementation for LinkedService. +func (ls LinkedService) AsHTTPLinkedService() (*HTTPLinkedService, bool) { + return nil, false +} + +// AsAzureSearchLinkedService is the BasicLinkedService implementation for LinkedService. +func (ls LinkedService) AsAzureSearchLinkedService() (*AzureSearchLinkedService, bool) { + return nil, false +} + +// AsCustomDataSourceLinkedService is the BasicLinkedService implementation for LinkedService. +func (ls LinkedService) AsCustomDataSourceLinkedService() (*CustomDataSourceLinkedService, bool) { + return nil, false +} + +// AsAmazonRedshiftLinkedService is the BasicLinkedService implementation for LinkedService. +func (ls LinkedService) AsAmazonRedshiftLinkedService() (*AmazonRedshiftLinkedService, bool) { + return nil, false +} + +// AsAmazonS3LinkedService is the BasicLinkedService implementation for LinkedService. +func (ls LinkedService) AsAmazonS3LinkedService() (*AmazonS3LinkedService, bool) { + return nil, false +} + +// AsSapEccLinkedService is the BasicLinkedService implementation for LinkedService. +func (ls LinkedService) AsSapEccLinkedService() (*SapEccLinkedService, bool) { + return nil, false +} + +// AsSapCloudForCustomerLinkedService is the BasicLinkedService implementation for LinkedService. +func (ls LinkedService) AsSapCloudForCustomerLinkedService() (*SapCloudForCustomerLinkedService, bool) { + return nil, false +} + +// AsSalesforceLinkedService is the BasicLinkedService implementation for LinkedService. +func (ls LinkedService) AsSalesforceLinkedService() (*SalesforceLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeStoreLinkedService is the BasicLinkedService implementation for LinkedService. +func (ls LinkedService) AsAzureDataLakeStoreLinkedService() (*AzureDataLakeStoreLinkedService, bool) { + return nil, false +} + +// AsMongoDbLinkedService is the BasicLinkedService implementation for LinkedService. +func (ls LinkedService) AsMongoDbLinkedService() (*MongoDbLinkedService, bool) { + return nil, false +} + +// AsCassandraLinkedService is the BasicLinkedService implementation for LinkedService. +func (ls LinkedService) AsCassandraLinkedService() (*CassandraLinkedService, bool) { + return nil, false +} + +// AsWebLinkedService is the BasicLinkedService implementation for LinkedService. +func (ls LinkedService) AsWebLinkedService() (*WebLinkedService, bool) { + return nil, false +} + +// AsODataLinkedService is the BasicLinkedService implementation for LinkedService. +func (ls LinkedService) AsODataLinkedService() (*ODataLinkedService, bool) { + return nil, false +} + +// AsHdfsLinkedService is the BasicLinkedService implementation for LinkedService. +func (ls LinkedService) AsHdfsLinkedService() (*HdfsLinkedService, bool) { + return nil, false +} + +// AsOdbcLinkedService is the BasicLinkedService implementation for LinkedService. +func (ls LinkedService) AsOdbcLinkedService() (*OdbcLinkedService, bool) { + return nil, false +} + +// AsAzureMLLinkedService is the BasicLinkedService implementation for LinkedService. +func (ls LinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { + return nil, false +} + +// AsTeradataLinkedService is the BasicLinkedService implementation for LinkedService. +func (ls LinkedService) AsTeradataLinkedService() (*TeradataLinkedService, bool) { + return nil, false +} + +// AsDb2LinkedService is the BasicLinkedService implementation for LinkedService. +func (ls LinkedService) AsDb2LinkedService() (*Db2LinkedService, bool) { + return nil, false +} + +// AsSybaseLinkedService is the BasicLinkedService implementation for LinkedService. +func (ls LinkedService) AsSybaseLinkedService() (*SybaseLinkedService, bool) { + return nil, false +} + +// AsPostgreSQLLinkedService is the BasicLinkedService implementation for LinkedService. +func (ls LinkedService) AsPostgreSQLLinkedService() (*PostgreSQLLinkedService, bool) { + return nil, false +} + +// AsMySQLLinkedService is the BasicLinkedService implementation for LinkedService. +func (ls LinkedService) AsMySQLLinkedService() (*MySQLLinkedService, bool) { + return nil, false +} + +// AsAzureMySQLLinkedService is the BasicLinkedService implementation for LinkedService. +func (ls LinkedService) AsAzureMySQLLinkedService() (*AzureMySQLLinkedService, bool) { + return nil, false +} + +// AsOracleLinkedService is the BasicLinkedService implementation for LinkedService. +func (ls LinkedService) AsOracleLinkedService() (*OracleLinkedService, bool) { + return nil, false +} + +// AsFileServerLinkedService is the BasicLinkedService implementation for LinkedService. +func (ls LinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { + return nil, false +} + +// AsHDInsightLinkedService is the BasicLinkedService implementation for LinkedService. +func (ls LinkedService) AsHDInsightLinkedService() (*HDInsightLinkedService, bool) { + return nil, false +} + +// AsDynamicsLinkedService is the BasicLinkedService implementation for LinkedService. +func (ls LinkedService) AsDynamicsLinkedService() (*DynamicsLinkedService, bool) { + return nil, false +} + +// AsCosmosDbLinkedService is the BasicLinkedService implementation for LinkedService. +func (ls LinkedService) AsCosmosDbLinkedService() (*CosmosDbLinkedService, bool) { + return nil, false +} + +// AsAzureKeyVaultLinkedService is the BasicLinkedService implementation for LinkedService. +func (ls LinkedService) AsAzureKeyVaultLinkedService() (*AzureKeyVaultLinkedService, bool) { + return nil, false +} + +// AsAzureBatchLinkedService is the BasicLinkedService implementation for LinkedService. +func (ls LinkedService) AsAzureBatchLinkedService() (*AzureBatchLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDatabaseLinkedService is the BasicLinkedService implementation for LinkedService. +func (ls LinkedService) AsAzureSQLDatabaseLinkedService() (*AzureSQLDatabaseLinkedService, bool) { + return nil, false +} + +// AsSQLServerLinkedService is the BasicLinkedService implementation for LinkedService. +func (ls LinkedService) AsSQLServerLinkedService() (*SQLServerLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDWLinkedService is the BasicLinkedService implementation for LinkedService. +func (ls LinkedService) AsAzureSQLDWLinkedService() (*AzureSQLDWLinkedService, bool) { + return nil, false +} + +// AsAzureStorageLinkedService is the BasicLinkedService implementation for LinkedService. +func (ls LinkedService) AsAzureStorageLinkedService() (*AzureStorageLinkedService, bool) { + return nil, false +} + +// AsLinkedService is the BasicLinkedService implementation for LinkedService. +func (ls LinkedService) AsLinkedService() (*LinkedService, bool) { + return &ls, true +} + +// AsBasicLinkedService is the BasicLinkedService implementation for LinkedService. +func (ls LinkedService) AsBasicLinkedService() (BasicLinkedService, bool) { + return &ls, true +} + +// LinkedServiceListResponse a list of linked service resources. +type LinkedServiceListResponse struct { + autorest.Response `json:"-"` + // Value - List of linked services. + Value *[]LinkedServiceResource `json:"value,omitempty"` + // NextLink - The link to the next page of results, if any remaining results exist. + NextLink *string `json:"nextLink,omitempty"` +} + +// LinkedServiceListResponseIterator provides access to a complete listing of LinkedServiceResource values. +type LinkedServiceListResponseIterator struct { + i int + page LinkedServiceListResponsePage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *LinkedServiceListResponseIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter LinkedServiceListResponseIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter LinkedServiceListResponseIterator) Response() LinkedServiceListResponse { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter LinkedServiceListResponseIterator) Value() LinkedServiceResource { + if !iter.page.NotDone() { + return LinkedServiceResource{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (lslr LinkedServiceListResponse) IsEmpty() bool { + return lslr.Value == nil || len(*lslr.Value) == 0 +} + +// linkedServiceListResponsePreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (lslr LinkedServiceListResponse) linkedServiceListResponsePreparer() (*http.Request, error) { + if lslr.NextLink == nil || len(to.String(lslr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(lslr.NextLink))) +} + +// LinkedServiceListResponsePage contains a page of LinkedServiceResource values. +type LinkedServiceListResponsePage struct { + fn func(LinkedServiceListResponse) (LinkedServiceListResponse, error) + lslr LinkedServiceListResponse +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *LinkedServiceListResponsePage) Next() error { + next, err := page.fn(page.lslr) + if err != nil { + return err + } + page.lslr = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page LinkedServiceListResponsePage) NotDone() bool { + return !page.lslr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page LinkedServiceListResponsePage) Response() LinkedServiceListResponse { + return page.lslr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page LinkedServiceListResponsePage) Values() []LinkedServiceResource { + if page.lslr.IsEmpty() { + return nil + } + return *page.lslr.Value +} + +// LinkedServiceReference linked service reference type. +type LinkedServiceReference struct { + // Type - Linked service reference type. + Type *string `json:"type,omitempty"` + // ReferenceName - Reference LinkedService name. + ReferenceName *string `json:"referenceName,omitempty"` + // Parameters - Arguments for LinkedService. + Parameters map[string]interface{} `json:"parameters"` +} + +// MarshalJSON is the custom marshaler for LinkedServiceReference. +func (lsr LinkedServiceReference) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if lsr.Type != nil { + objectMap["type"] = lsr.Type + } + if lsr.ReferenceName != nil { + objectMap["referenceName"] = lsr.ReferenceName + } + if lsr.Parameters != nil { + objectMap["parameters"] = lsr.Parameters + } + return json.Marshal(objectMap) +} + +// LinkedServiceResource linked service resource type. +type LinkedServiceResource struct { + autorest.Response `json:"-"` + // Properties - Properties of linked service. + Properties BasicLinkedService `json:"properties,omitempty"` + // ID - The resource identifier. + ID *string `json:"id,omitempty"` + // Name - The resource name. + Name *string `json:"name,omitempty"` + // Type - The resource type. + Type *string `json:"type,omitempty"` + // Etag - Etag identifies change in the resource. + Etag *string `json:"etag,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for LinkedServiceResource struct. +func (lsr *LinkedServiceResource) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + properties, err := unmarshalBasicLinkedService(*v) + if err != nil { + return err + } + lsr.Properties = properties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + lsr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + lsr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + lsr.Type = &typeVar + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + lsr.Etag = &etag + } + } + } + + return nil +} + +// LookupActivity lookup activity. +type LookupActivity struct { + // LookupActivityTypeProperties - Lookup activity properties. + *LookupActivityTypeProperties `json:"typeProperties,omitempty"` + // LinkedServiceName - Linked service reference. + LinkedServiceName *LinkedServiceReference `json:"linkedServiceName,omitempty"` + // Policy - Activity policy. + Policy *ActivityPolicy `json:"policy,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Name - Activity name. + Name *string `json:"name,omitempty"` + // Description - Activity description. + Description *string `json:"description,omitempty"` + // DependsOn - Activity depends on condition. + DependsOn *[]ActivityDependency `json:"dependsOn,omitempty"` + // UserProperties - Activity user properties. + UserProperties map[string]*string `json:"userProperties"` + // Type - Possible values include: 'TypeActivity', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLUpdateResource', 'TypeAzureMLBatchExecution', 'TypeGetMetadata', 'TypeWebActivity', 'TypeLookup', 'TypeSQLServerStoredProcedure', 'TypeCustom', 'TypeExecuteSSISPackage', 'TypeHDInsightSpark', 'TypeHDInsightStreaming', 'TypeHDInsightMapReduce', 'TypeHDInsightPig', 'TypeHDInsightHive', 'TypeCopy', 'TypeExecution', 'TypeFilter', 'TypeUntil', 'TypeWait', 'TypeForEach', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' + Type TypeBasicActivity `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for LookupActivity. +func (la LookupActivity) MarshalJSON() ([]byte, error) { + la.Type = TypeLookup + objectMap := make(map[string]interface{}) + if la.LookupActivityTypeProperties != nil { + objectMap["typeProperties"] = la.LookupActivityTypeProperties + } + if la.LinkedServiceName != nil { + objectMap["linkedServiceName"] = la.LinkedServiceName + } + if la.Policy != nil { + objectMap["policy"] = la.Policy + } + if la.Name != nil { + objectMap["name"] = la.Name + } + if la.Description != nil { + objectMap["description"] = la.Description + } + if la.DependsOn != nil { + objectMap["dependsOn"] = la.DependsOn + } + if la.UserProperties != nil { + objectMap["userProperties"] = la.UserProperties + } + if la.Type != "" { + objectMap["type"] = la.Type + } + for k, v := range la.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsDatabricksNotebookActivity is the BasicActivity implementation for LookupActivity. +func (la LookupActivity) AsDatabricksNotebookActivity() (*DatabricksNotebookActivity, bool) { + return nil, false +} + +// AsDataLakeAnalyticsUSQLActivity is the BasicActivity implementation for LookupActivity. +func (la LookupActivity) AsDataLakeAnalyticsUSQLActivity() (*DataLakeAnalyticsUSQLActivity, bool) { + return nil, false +} + +// AsAzureMLUpdateResourceActivity is the BasicActivity implementation for LookupActivity. +func (la LookupActivity) AsAzureMLUpdateResourceActivity() (*AzureMLUpdateResourceActivity, bool) { + return nil, false +} + +// AsAzureMLBatchExecutionActivity is the BasicActivity implementation for LookupActivity. +func (la LookupActivity) AsAzureMLBatchExecutionActivity() (*AzureMLBatchExecutionActivity, bool) { + return nil, false +} + +// AsGetMetadataActivity is the BasicActivity implementation for LookupActivity. +func (la LookupActivity) AsGetMetadataActivity() (*GetMetadataActivity, bool) { + return nil, false +} + +// AsWebActivity is the BasicActivity implementation for LookupActivity. +func (la LookupActivity) AsWebActivity() (*WebActivity, bool) { + return nil, false +} + +// AsLookupActivity is the BasicActivity implementation for LookupActivity. +func (la LookupActivity) AsLookupActivity() (*LookupActivity, bool) { + return &la, true +} + +// AsSQLServerStoredProcedureActivity is the BasicActivity implementation for LookupActivity. +func (la LookupActivity) AsSQLServerStoredProcedureActivity() (*SQLServerStoredProcedureActivity, bool) { + return nil, false +} + +// AsCustomActivity is the BasicActivity implementation for LookupActivity. +func (la LookupActivity) AsCustomActivity() (*CustomActivity, bool) { + return nil, false +} + +// AsExecuteSSISPackageActivity is the BasicActivity implementation for LookupActivity. +func (la LookupActivity) AsExecuteSSISPackageActivity() (*ExecuteSSISPackageActivity, bool) { + return nil, false +} + +// AsHDInsightSparkActivity is the BasicActivity implementation for LookupActivity. +func (la LookupActivity) AsHDInsightSparkActivity() (*HDInsightSparkActivity, bool) { + return nil, false +} + +// AsHDInsightStreamingActivity is the BasicActivity implementation for LookupActivity. +func (la LookupActivity) AsHDInsightStreamingActivity() (*HDInsightStreamingActivity, bool) { + return nil, false +} + +// AsHDInsightMapReduceActivity is the BasicActivity implementation for LookupActivity. +func (la LookupActivity) AsHDInsightMapReduceActivity() (*HDInsightMapReduceActivity, bool) { + return nil, false +} + +// AsHDInsightPigActivity is the BasicActivity implementation for LookupActivity. +func (la LookupActivity) AsHDInsightPigActivity() (*HDInsightPigActivity, bool) { + return nil, false +} + +// AsHDInsightHiveActivity is the BasicActivity implementation for LookupActivity. +func (la LookupActivity) AsHDInsightHiveActivity() (*HDInsightHiveActivity, bool) { + return nil, false +} + +// AsCopyActivity is the BasicActivity implementation for LookupActivity. +func (la LookupActivity) AsCopyActivity() (*CopyActivity, bool) { + return nil, false +} + +// AsExecutionActivity is the BasicActivity implementation for LookupActivity. +func (la LookupActivity) AsExecutionActivity() (*ExecutionActivity, bool) { + return nil, false +} + +// AsBasicExecutionActivity is the BasicActivity implementation for LookupActivity. +func (la LookupActivity) AsBasicExecutionActivity() (BasicExecutionActivity, bool) { + return &la, true +} + +// AsFilterActivity is the BasicActivity implementation for LookupActivity. +func (la LookupActivity) AsFilterActivity() (*FilterActivity, bool) { + return nil, false +} + +// AsUntilActivity is the BasicActivity implementation for LookupActivity. +func (la LookupActivity) AsUntilActivity() (*UntilActivity, bool) { + return nil, false +} + +// AsWaitActivity is the BasicActivity implementation for LookupActivity. +func (la LookupActivity) AsWaitActivity() (*WaitActivity, bool) { + return nil, false +} + +// AsForEachActivity is the BasicActivity implementation for LookupActivity. +func (la LookupActivity) AsForEachActivity() (*ForEachActivity, bool) { + return nil, false +} + +// AsIfConditionActivity is the BasicActivity implementation for LookupActivity. +func (la LookupActivity) AsIfConditionActivity() (*IfConditionActivity, bool) { + return nil, false +} + +// AsExecutePipelineActivity is the BasicActivity implementation for LookupActivity. +func (la LookupActivity) AsExecutePipelineActivity() (*ExecutePipelineActivity, bool) { + return nil, false +} + +// AsControlActivity is the BasicActivity implementation for LookupActivity. +func (la LookupActivity) AsControlActivity() (*ControlActivity, bool) { + return nil, false +} + +// AsBasicControlActivity is the BasicActivity implementation for LookupActivity. +func (la LookupActivity) AsBasicControlActivity() (BasicControlActivity, bool) { + return nil, false +} + +// AsActivity is the BasicActivity implementation for LookupActivity. +func (la LookupActivity) AsActivity() (*Activity, bool) { + return nil, false +} + +// AsBasicActivity is the BasicActivity implementation for LookupActivity. +func (la LookupActivity) AsBasicActivity() (BasicActivity, bool) { + return &la, true +} + +// UnmarshalJSON is the custom unmarshaler for LookupActivity struct. +func (la *LookupActivity) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "typeProperties": + if v != nil { + var lookupActivityTypeProperties LookupActivityTypeProperties + err = json.Unmarshal(*v, &lookupActivityTypeProperties) + if err != nil { + return err + } + la.LookupActivityTypeProperties = &lookupActivityTypeProperties + } + case "linkedServiceName": + if v != nil { + var linkedServiceName LinkedServiceReference + err = json.Unmarshal(*v, &linkedServiceName) + if err != nil { + return err + } + la.LinkedServiceName = &linkedServiceName + } + case "policy": + if v != nil { + var policy ActivityPolicy + err = json.Unmarshal(*v, &policy) + if err != nil { + return err + } + la.Policy = &policy + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if la.AdditionalProperties == nil { + la.AdditionalProperties = make(map[string]interface{}) + } + la.AdditionalProperties[k] = additionalProperties + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + la.Name = &name + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + la.Description = &description + } + case "dependsOn": + if v != nil { + var dependsOn []ActivityDependency + err = json.Unmarshal(*v, &dependsOn) + if err != nil { + return err + } + la.DependsOn = &dependsOn + } + case "userProperties": + if v != nil { + var userProperties map[string]*string + err = json.Unmarshal(*v, &userProperties) + if err != nil { + return err + } + la.UserProperties = userProperties + } + case "type": + if v != nil { + var typeVar TypeBasicActivity + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + la.Type = typeVar + } + } + } + + return nil +} + +// LookupActivityTypeProperties lookup activity properties. +type LookupActivityTypeProperties struct { + // Source - Dataset-specific source properties, same as copy activity source. + Source BasicCopySource `json:"source,omitempty"` + // Dataset - Lookup activity dataset reference. + Dataset *DatasetReference `json:"dataset,omitempty"` + // FirstRowOnly - Whether to return first row or all rows. Default value is true. Type: boolean (or Expression with resultType boolean). + FirstRowOnly interface{} `json:"firstRowOnly,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for LookupActivityTypeProperties struct. +func (latp *LookupActivityTypeProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "source": + if v != nil { + source, err := unmarshalBasicCopySource(*v) + if err != nil { + return err + } + latp.Source = source + } + case "dataset": + if v != nil { + var dataset DatasetReference + err = json.Unmarshal(*v, &dataset) + if err != nil { + return err + } + latp.Dataset = &dataset + } + case "firstRowOnly": + if v != nil { + var firstRowOnly interface{} + err = json.Unmarshal(*v, &firstRowOnly) + if err != nil { + return err + } + latp.FirstRowOnly = firstRowOnly + } + } + } + + return nil +} + +// MagentoLinkedService magento server linked service. +type MagentoLinkedService struct { + // MagentoLinkedServiceTypeProperties - Magento server linked service properties. + *MagentoLinkedServiceTypeProperties `json:"typeProperties,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // ConnectVia - The integration runtime reference. + ConnectVia *IntegrationRuntimeReference `json:"connectVia,omitempty"` + // Description - Linked service description. + Description *string `json:"description,omitempty"` + // Parameters - Parameters for linked service. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeLinkedService', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforce', 'TypeAzureDataLakeStore', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureStorage' + Type TypeBasicLinkedService `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for MagentoLinkedService. +func (mls MagentoLinkedService) MarshalJSON() ([]byte, error) { + mls.Type = TypeMagento + objectMap := make(map[string]interface{}) + if mls.MagentoLinkedServiceTypeProperties != nil { + objectMap["typeProperties"] = mls.MagentoLinkedServiceTypeProperties + } + if mls.ConnectVia != nil { + objectMap["connectVia"] = mls.ConnectVia + } + if mls.Description != nil { + objectMap["description"] = mls.Description + } + if mls.Parameters != nil { + objectMap["parameters"] = mls.Parameters + } + if mls.Annotations != nil { + objectMap["annotations"] = mls.Annotations + } + if mls.Type != "" { + objectMap["type"] = mls.Type + } + for k, v := range mls.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysLinkedService is the BasicLinkedService implementation for MagentoLinkedService. +func (mls MagentoLinkedService) AsResponsysLinkedService() (*ResponsysLinkedService, bool) { + return nil, false +} + +// AsAzureDatabricksLinkedService is the BasicLinkedService implementation for MagentoLinkedService. +func (mls MagentoLinkedService) AsAzureDatabricksLinkedService() (*AzureDatabricksLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeAnalyticsLinkedService is the BasicLinkedService implementation for MagentoLinkedService. +func (mls MagentoLinkedService) AsAzureDataLakeAnalyticsLinkedService() (*AzureDataLakeAnalyticsLinkedService, bool) { + return nil, false +} + +// AsHDInsightOnDemandLinkedService is the BasicLinkedService implementation for MagentoLinkedService. +func (mls MagentoLinkedService) AsHDInsightOnDemandLinkedService() (*HDInsightOnDemandLinkedService, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudLinkedService is the BasicLinkedService implementation for MagentoLinkedService. +func (mls MagentoLinkedService) AsSalesforceMarketingCloudLinkedService() (*SalesforceMarketingCloudLinkedService, bool) { + return nil, false +} + +// AsNetezzaLinkedService is the BasicLinkedService implementation for MagentoLinkedService. +func (mls MagentoLinkedService) AsNetezzaLinkedService() (*NetezzaLinkedService, bool) { + return nil, false +} + +// AsVerticaLinkedService is the BasicLinkedService implementation for MagentoLinkedService. +func (mls MagentoLinkedService) AsVerticaLinkedService() (*VerticaLinkedService, bool) { + return nil, false +} + +// AsZohoLinkedService is the BasicLinkedService implementation for MagentoLinkedService. +func (mls MagentoLinkedService) AsZohoLinkedService() (*ZohoLinkedService, bool) { + return nil, false +} + +// AsXeroLinkedService is the BasicLinkedService implementation for MagentoLinkedService. +func (mls MagentoLinkedService) AsXeroLinkedService() (*XeroLinkedService, bool) { + return nil, false +} + +// AsSquareLinkedService is the BasicLinkedService implementation for MagentoLinkedService. +func (mls MagentoLinkedService) AsSquareLinkedService() (*SquareLinkedService, bool) { + return nil, false +} + +// AsSparkLinkedService is the BasicLinkedService implementation for MagentoLinkedService. +func (mls MagentoLinkedService) AsSparkLinkedService() (*SparkLinkedService, bool) { + return nil, false +} + +// AsShopifyLinkedService is the BasicLinkedService implementation for MagentoLinkedService. +func (mls MagentoLinkedService) AsShopifyLinkedService() (*ShopifyLinkedService, bool) { + return nil, false +} + +// AsServiceNowLinkedService is the BasicLinkedService implementation for MagentoLinkedService. +func (mls MagentoLinkedService) AsServiceNowLinkedService() (*ServiceNowLinkedService, bool) { + return nil, false +} + +// AsQuickBooksLinkedService is the BasicLinkedService implementation for MagentoLinkedService. +func (mls MagentoLinkedService) AsQuickBooksLinkedService() (*QuickBooksLinkedService, bool) { + return nil, false +} + +// AsPrestoLinkedService is the BasicLinkedService implementation for MagentoLinkedService. +func (mls MagentoLinkedService) AsPrestoLinkedService() (*PrestoLinkedService, bool) { + return nil, false +} + +// AsPhoenixLinkedService is the BasicLinkedService implementation for MagentoLinkedService. +func (mls MagentoLinkedService) AsPhoenixLinkedService() (*PhoenixLinkedService, bool) { + return nil, false +} + +// AsPaypalLinkedService is the BasicLinkedService implementation for MagentoLinkedService. +func (mls MagentoLinkedService) AsPaypalLinkedService() (*PaypalLinkedService, bool) { + return nil, false +} + +// AsMarketoLinkedService is the BasicLinkedService implementation for MagentoLinkedService. +func (mls MagentoLinkedService) AsMarketoLinkedService() (*MarketoLinkedService, bool) { + return nil, false +} + +// AsMariaDBLinkedService is the BasicLinkedService implementation for MagentoLinkedService. +func (mls MagentoLinkedService) AsMariaDBLinkedService() (*MariaDBLinkedService, bool) { + return nil, false +} + +// AsMagentoLinkedService is the BasicLinkedService implementation for MagentoLinkedService. +func (mls MagentoLinkedService) AsMagentoLinkedService() (*MagentoLinkedService, bool) { + return &mls, true +} + +// AsJiraLinkedService is the BasicLinkedService implementation for MagentoLinkedService. +func (mls MagentoLinkedService) AsJiraLinkedService() (*JiraLinkedService, bool) { + return nil, false +} + +// AsImpalaLinkedService is the BasicLinkedService implementation for MagentoLinkedService. +func (mls MagentoLinkedService) AsImpalaLinkedService() (*ImpalaLinkedService, bool) { + return nil, false +} + +// AsHubspotLinkedService is the BasicLinkedService implementation for MagentoLinkedService. +func (mls MagentoLinkedService) AsHubspotLinkedService() (*HubspotLinkedService, bool) { + return nil, false +} + +// AsHiveLinkedService is the BasicLinkedService implementation for MagentoLinkedService. +func (mls MagentoLinkedService) AsHiveLinkedService() (*HiveLinkedService, bool) { + return nil, false +} + +// AsHBaseLinkedService is the BasicLinkedService implementation for MagentoLinkedService. +func (mls MagentoLinkedService) AsHBaseLinkedService() (*HBaseLinkedService, bool) { + return nil, false +} + +// AsGreenplumLinkedService is the BasicLinkedService implementation for MagentoLinkedService. +func (mls MagentoLinkedService) AsGreenplumLinkedService() (*GreenplumLinkedService, bool) { + return nil, false +} + +// AsGoogleBigQueryLinkedService is the BasicLinkedService implementation for MagentoLinkedService. +func (mls MagentoLinkedService) AsGoogleBigQueryLinkedService() (*GoogleBigQueryLinkedService, bool) { + return nil, false +} + +// AsEloquaLinkedService is the BasicLinkedService implementation for MagentoLinkedService. +func (mls MagentoLinkedService) AsEloquaLinkedService() (*EloquaLinkedService, bool) { + return nil, false +} + +// AsDrillLinkedService is the BasicLinkedService implementation for MagentoLinkedService. +func (mls MagentoLinkedService) AsDrillLinkedService() (*DrillLinkedService, bool) { + return nil, false +} + +// AsCouchbaseLinkedService is the BasicLinkedService implementation for MagentoLinkedService. +func (mls MagentoLinkedService) AsCouchbaseLinkedService() (*CouchbaseLinkedService, bool) { + return nil, false +} + +// AsConcurLinkedService is the BasicLinkedService implementation for MagentoLinkedService. +func (mls MagentoLinkedService) AsConcurLinkedService() (*ConcurLinkedService, bool) { + return nil, false +} + +// AsAzurePostgreSQLLinkedService is the BasicLinkedService implementation for MagentoLinkedService. +func (mls MagentoLinkedService) AsAzurePostgreSQLLinkedService() (*AzurePostgreSQLLinkedService, bool) { + return nil, false +} + +// AsAmazonMWSLinkedService is the BasicLinkedService implementation for MagentoLinkedService. +func (mls MagentoLinkedService) AsAmazonMWSLinkedService() (*AmazonMWSLinkedService, bool) { + return nil, false +} + +// AsSapHanaLinkedService is the BasicLinkedService implementation for MagentoLinkedService. +func (mls MagentoLinkedService) AsSapHanaLinkedService() (*SapHanaLinkedService, bool) { + return nil, false +} + +// AsSapBWLinkedService is the BasicLinkedService implementation for MagentoLinkedService. +func (mls MagentoLinkedService) AsSapBWLinkedService() (*SapBWLinkedService, bool) { + return nil, false +} + +// AsSftpServerLinkedService is the BasicLinkedService implementation for MagentoLinkedService. +func (mls MagentoLinkedService) AsSftpServerLinkedService() (*SftpServerLinkedService, bool) { + return nil, false +} + +// AsFtpServerLinkedService is the BasicLinkedService implementation for MagentoLinkedService. +func (mls MagentoLinkedService) AsFtpServerLinkedService() (*FtpServerLinkedService, bool) { + return nil, false +} + +// AsHTTPLinkedService is the BasicLinkedService implementation for MagentoLinkedService. +func (mls MagentoLinkedService) AsHTTPLinkedService() (*HTTPLinkedService, bool) { + return nil, false +} + +// AsAzureSearchLinkedService is the BasicLinkedService implementation for MagentoLinkedService. +func (mls MagentoLinkedService) AsAzureSearchLinkedService() (*AzureSearchLinkedService, bool) { + return nil, false +} + +// AsCustomDataSourceLinkedService is the BasicLinkedService implementation for MagentoLinkedService. +func (mls MagentoLinkedService) AsCustomDataSourceLinkedService() (*CustomDataSourceLinkedService, bool) { + return nil, false +} + +// AsAmazonRedshiftLinkedService is the BasicLinkedService implementation for MagentoLinkedService. +func (mls MagentoLinkedService) AsAmazonRedshiftLinkedService() (*AmazonRedshiftLinkedService, bool) { + return nil, false +} + +// AsAmazonS3LinkedService is the BasicLinkedService implementation for MagentoLinkedService. +func (mls MagentoLinkedService) AsAmazonS3LinkedService() (*AmazonS3LinkedService, bool) { + return nil, false +} + +// AsSapEccLinkedService is the BasicLinkedService implementation for MagentoLinkedService. +func (mls MagentoLinkedService) AsSapEccLinkedService() (*SapEccLinkedService, bool) { + return nil, false +} + +// AsSapCloudForCustomerLinkedService is the BasicLinkedService implementation for MagentoLinkedService. +func (mls MagentoLinkedService) AsSapCloudForCustomerLinkedService() (*SapCloudForCustomerLinkedService, bool) { + return nil, false +} + +// AsSalesforceLinkedService is the BasicLinkedService implementation for MagentoLinkedService. +func (mls MagentoLinkedService) AsSalesforceLinkedService() (*SalesforceLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeStoreLinkedService is the BasicLinkedService implementation for MagentoLinkedService. +func (mls MagentoLinkedService) AsAzureDataLakeStoreLinkedService() (*AzureDataLakeStoreLinkedService, bool) { + return nil, false +} + +// AsMongoDbLinkedService is the BasicLinkedService implementation for MagentoLinkedService. +func (mls MagentoLinkedService) AsMongoDbLinkedService() (*MongoDbLinkedService, bool) { + return nil, false +} + +// AsCassandraLinkedService is the BasicLinkedService implementation for MagentoLinkedService. +func (mls MagentoLinkedService) AsCassandraLinkedService() (*CassandraLinkedService, bool) { + return nil, false +} + +// AsWebLinkedService is the BasicLinkedService implementation for MagentoLinkedService. +func (mls MagentoLinkedService) AsWebLinkedService() (*WebLinkedService, bool) { + return nil, false +} + +// AsODataLinkedService is the BasicLinkedService implementation for MagentoLinkedService. +func (mls MagentoLinkedService) AsODataLinkedService() (*ODataLinkedService, bool) { + return nil, false +} + +// AsHdfsLinkedService is the BasicLinkedService implementation for MagentoLinkedService. +func (mls MagentoLinkedService) AsHdfsLinkedService() (*HdfsLinkedService, bool) { + return nil, false +} + +// AsOdbcLinkedService is the BasicLinkedService implementation for MagentoLinkedService. +func (mls MagentoLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, bool) { + return nil, false +} + +// AsAzureMLLinkedService is the BasicLinkedService implementation for MagentoLinkedService. +func (mls MagentoLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { + return nil, false +} + +// AsTeradataLinkedService is the BasicLinkedService implementation for MagentoLinkedService. +func (mls MagentoLinkedService) AsTeradataLinkedService() (*TeradataLinkedService, bool) { + return nil, false +} + +// AsDb2LinkedService is the BasicLinkedService implementation for MagentoLinkedService. +func (mls MagentoLinkedService) AsDb2LinkedService() (*Db2LinkedService, bool) { + return nil, false +} + +// AsSybaseLinkedService is the BasicLinkedService implementation for MagentoLinkedService. +func (mls MagentoLinkedService) AsSybaseLinkedService() (*SybaseLinkedService, bool) { + return nil, false +} + +// AsPostgreSQLLinkedService is the BasicLinkedService implementation for MagentoLinkedService. +func (mls MagentoLinkedService) AsPostgreSQLLinkedService() (*PostgreSQLLinkedService, bool) { + return nil, false +} + +// AsMySQLLinkedService is the BasicLinkedService implementation for MagentoLinkedService. +func (mls MagentoLinkedService) AsMySQLLinkedService() (*MySQLLinkedService, bool) { + return nil, false +} + +// AsAzureMySQLLinkedService is the BasicLinkedService implementation for MagentoLinkedService. +func (mls MagentoLinkedService) AsAzureMySQLLinkedService() (*AzureMySQLLinkedService, bool) { + return nil, false +} + +// AsOracleLinkedService is the BasicLinkedService implementation for MagentoLinkedService. +func (mls MagentoLinkedService) AsOracleLinkedService() (*OracleLinkedService, bool) { + return nil, false +} + +// AsFileServerLinkedService is the BasicLinkedService implementation for MagentoLinkedService. +func (mls MagentoLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { + return nil, false +} + +// AsHDInsightLinkedService is the BasicLinkedService implementation for MagentoLinkedService. +func (mls MagentoLinkedService) AsHDInsightLinkedService() (*HDInsightLinkedService, bool) { + return nil, false +} + +// AsDynamicsLinkedService is the BasicLinkedService implementation for MagentoLinkedService. +func (mls MagentoLinkedService) AsDynamicsLinkedService() (*DynamicsLinkedService, bool) { + return nil, false +} + +// AsCosmosDbLinkedService is the BasicLinkedService implementation for MagentoLinkedService. +func (mls MagentoLinkedService) AsCosmosDbLinkedService() (*CosmosDbLinkedService, bool) { + return nil, false +} + +// AsAzureKeyVaultLinkedService is the BasicLinkedService implementation for MagentoLinkedService. +func (mls MagentoLinkedService) AsAzureKeyVaultLinkedService() (*AzureKeyVaultLinkedService, bool) { + return nil, false +} + +// AsAzureBatchLinkedService is the BasicLinkedService implementation for MagentoLinkedService. +func (mls MagentoLinkedService) AsAzureBatchLinkedService() (*AzureBatchLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDatabaseLinkedService is the BasicLinkedService implementation for MagentoLinkedService. +func (mls MagentoLinkedService) AsAzureSQLDatabaseLinkedService() (*AzureSQLDatabaseLinkedService, bool) { + return nil, false +} + +// AsSQLServerLinkedService is the BasicLinkedService implementation for MagentoLinkedService. +func (mls MagentoLinkedService) AsSQLServerLinkedService() (*SQLServerLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDWLinkedService is the BasicLinkedService implementation for MagentoLinkedService. +func (mls MagentoLinkedService) AsAzureSQLDWLinkedService() (*AzureSQLDWLinkedService, bool) { + return nil, false +} + +// AsAzureStorageLinkedService is the BasicLinkedService implementation for MagentoLinkedService. +func (mls MagentoLinkedService) AsAzureStorageLinkedService() (*AzureStorageLinkedService, bool) { + return nil, false +} + +// AsLinkedService is the BasicLinkedService implementation for MagentoLinkedService. +func (mls MagentoLinkedService) AsLinkedService() (*LinkedService, bool) { + return nil, false +} + +// AsBasicLinkedService is the BasicLinkedService implementation for MagentoLinkedService. +func (mls MagentoLinkedService) AsBasicLinkedService() (BasicLinkedService, bool) { + return &mls, true +} + +// UnmarshalJSON is the custom unmarshaler for MagentoLinkedService struct. +func (mls *MagentoLinkedService) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "typeProperties": + if v != nil { + var magentoLinkedServiceTypeProperties MagentoLinkedServiceTypeProperties + err = json.Unmarshal(*v, &magentoLinkedServiceTypeProperties) + if err != nil { + return err + } + mls.MagentoLinkedServiceTypeProperties = &magentoLinkedServiceTypeProperties + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if mls.AdditionalProperties == nil { + mls.AdditionalProperties = make(map[string]interface{}) + } + mls.AdditionalProperties[k] = additionalProperties + } + case "connectVia": + if v != nil { + var connectVia IntegrationRuntimeReference + err = json.Unmarshal(*v, &connectVia) + if err != nil { + return err + } + mls.ConnectVia = &connectVia + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + mls.Description = &description + } + case "parameters": + if v != nil { + var parameters map[string]*ParameterSpecification + err = json.Unmarshal(*v, ¶meters) + if err != nil { + return err + } + mls.Parameters = parameters + } + case "annotations": + if v != nil { + var annotations []interface{} + err = json.Unmarshal(*v, &annotations) + if err != nil { + return err + } + mls.Annotations = &annotations + } + case "type": + if v != nil { + var typeVar TypeBasicLinkedService + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + mls.Type = typeVar + } + } + } + + return nil +} + +// MagentoLinkedServiceTypeProperties magento server linked service properties. +type MagentoLinkedServiceTypeProperties struct { + // Host - The URL of the Magento instance. (i.e. 192.168.222.110/magento3) + Host interface{} `json:"host,omitempty"` + // AccessToken - The access token from Magento. + AccessToken BasicSecretBase `json:"accessToken,omitempty"` + // UseEncryptedEndpoints - Specifies whether the data source endpoints are encrypted using HTTPS. The default value is true. + UseEncryptedEndpoints interface{} `json:"useEncryptedEndpoints,omitempty"` + // UseHostVerification - Specifies whether to require the host name in the server's certificate to match the host name of the server when connecting over SSL. The default value is true. + UseHostVerification interface{} `json:"useHostVerification,omitempty"` + // UsePeerVerification - Specifies whether to verify the identity of the server when connecting over SSL. The default value is true. + UsePeerVerification interface{} `json:"usePeerVerification,omitempty"` + // EncryptedCredential - The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string). + EncryptedCredential interface{} `json:"encryptedCredential,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for MagentoLinkedServiceTypeProperties struct. +func (mlstp *MagentoLinkedServiceTypeProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "host": + if v != nil { + var host interface{} + err = json.Unmarshal(*v, &host) + if err != nil { + return err + } + mlstp.Host = host + } + case "accessToken": + if v != nil { + accessToken, err := unmarshalBasicSecretBase(*v) + if err != nil { + return err + } + mlstp.AccessToken = accessToken + } + case "useEncryptedEndpoints": + if v != nil { + var useEncryptedEndpoints interface{} + err = json.Unmarshal(*v, &useEncryptedEndpoints) + if err != nil { + return err + } + mlstp.UseEncryptedEndpoints = useEncryptedEndpoints + } + case "useHostVerification": + if v != nil { + var useHostVerification interface{} + err = json.Unmarshal(*v, &useHostVerification) + if err != nil { + return err + } + mlstp.UseHostVerification = useHostVerification + } + case "usePeerVerification": + if v != nil { + var usePeerVerification interface{} + err = json.Unmarshal(*v, &usePeerVerification) + if err != nil { + return err + } + mlstp.UsePeerVerification = usePeerVerification + } + case "encryptedCredential": + if v != nil { + var encryptedCredential interface{} + err = json.Unmarshal(*v, &encryptedCredential) + if err != nil { + return err + } + mlstp.EncryptedCredential = encryptedCredential + } + } + } + + return nil +} + +// MagentoObjectDataset magento server dataset. +type MagentoObjectDataset struct { + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Description - Dataset description. + Description *string `json:"description,omitempty"` + // Structure - Columns that define the structure of the dataset. Type: array (or Expression with resultType array), itemType: DatasetDataElement. + Structure interface{} `json:"structure,omitempty"` + // LinkedServiceName - Linked service reference. + LinkedServiceName *LinkedServiceReference `json:"linkedServiceName,omitempty"` + // Parameters - Parameters for dataset. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeDataset', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSQLServerTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSalesforceObject', 'TypeRelationalTable', 'TypeAzureMySQLTable', 'TypeOracleTable', 'TypeODataResource', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeAzureDataLakeStoreFile', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeAmazonS3Object' + Type TypeBasicDataset `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for MagentoObjectDataset. +func (mod MagentoObjectDataset) MarshalJSON() ([]byte, error) { + mod.Type = TypeMagentoObject + objectMap := make(map[string]interface{}) + if mod.Description != nil { + objectMap["description"] = mod.Description + } + objectMap["structure"] = mod.Structure + if mod.LinkedServiceName != nil { + objectMap["linkedServiceName"] = mod.LinkedServiceName + } + if mod.Parameters != nil { + objectMap["parameters"] = mod.Parameters + } + if mod.Annotations != nil { + objectMap["annotations"] = mod.Annotations + } + if mod.Type != "" { + objectMap["type"] = mod.Type + } + for k, v := range mod.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysObjectDataset is the BasicDataset implementation for MagentoObjectDataset. +func (mod MagentoObjectDataset) AsResponsysObjectDataset() (*ResponsysObjectDataset, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudObjectDataset is the BasicDataset implementation for MagentoObjectDataset. +func (mod MagentoObjectDataset) AsSalesforceMarketingCloudObjectDataset() (*SalesforceMarketingCloudObjectDataset, bool) { + return nil, false +} + +// AsVerticaTableDataset is the BasicDataset implementation for MagentoObjectDataset. +func (mod MagentoObjectDataset) AsVerticaTableDataset() (*VerticaTableDataset, bool) { + return nil, false +} + +// AsNetezzaTableDataset is the BasicDataset implementation for MagentoObjectDataset. +func (mod MagentoObjectDataset) AsNetezzaTableDataset() (*NetezzaTableDataset, bool) { + return nil, false +} + +// AsZohoObjectDataset is the BasicDataset implementation for MagentoObjectDataset. +func (mod MagentoObjectDataset) AsZohoObjectDataset() (*ZohoObjectDataset, bool) { + return nil, false +} + +// AsXeroObjectDataset is the BasicDataset implementation for MagentoObjectDataset. +func (mod MagentoObjectDataset) AsXeroObjectDataset() (*XeroObjectDataset, bool) { + return nil, false +} + +// AsSquareObjectDataset is the BasicDataset implementation for MagentoObjectDataset. +func (mod MagentoObjectDataset) AsSquareObjectDataset() (*SquareObjectDataset, bool) { + return nil, false +} + +// AsSparkObjectDataset is the BasicDataset implementation for MagentoObjectDataset. +func (mod MagentoObjectDataset) AsSparkObjectDataset() (*SparkObjectDataset, bool) { + return nil, false +} + +// AsShopifyObjectDataset is the BasicDataset implementation for MagentoObjectDataset. +func (mod MagentoObjectDataset) AsShopifyObjectDataset() (*ShopifyObjectDataset, bool) { + return nil, false +} + +// AsServiceNowObjectDataset is the BasicDataset implementation for MagentoObjectDataset. +func (mod MagentoObjectDataset) AsServiceNowObjectDataset() (*ServiceNowObjectDataset, bool) { + return nil, false +} + +// AsQuickBooksObjectDataset is the BasicDataset implementation for MagentoObjectDataset. +func (mod MagentoObjectDataset) AsQuickBooksObjectDataset() (*QuickBooksObjectDataset, bool) { + return nil, false +} + +// AsPrestoObjectDataset is the BasicDataset implementation for MagentoObjectDataset. +func (mod MagentoObjectDataset) AsPrestoObjectDataset() (*PrestoObjectDataset, bool) { + return nil, false +} + +// AsPhoenixObjectDataset is the BasicDataset implementation for MagentoObjectDataset. +func (mod MagentoObjectDataset) AsPhoenixObjectDataset() (*PhoenixObjectDataset, bool) { + return nil, false +} + +// AsPaypalObjectDataset is the BasicDataset implementation for MagentoObjectDataset. +func (mod MagentoObjectDataset) AsPaypalObjectDataset() (*PaypalObjectDataset, bool) { + return nil, false +} + +// AsMarketoObjectDataset is the BasicDataset implementation for MagentoObjectDataset. +func (mod MagentoObjectDataset) AsMarketoObjectDataset() (*MarketoObjectDataset, bool) { + return nil, false +} + +// AsMariaDBTableDataset is the BasicDataset implementation for MagentoObjectDataset. +func (mod MagentoObjectDataset) AsMariaDBTableDataset() (*MariaDBTableDataset, bool) { + return nil, false +} + +// AsMagentoObjectDataset is the BasicDataset implementation for MagentoObjectDataset. +func (mod MagentoObjectDataset) AsMagentoObjectDataset() (*MagentoObjectDataset, bool) { + return &mod, true +} + +// AsJiraObjectDataset is the BasicDataset implementation for MagentoObjectDataset. +func (mod MagentoObjectDataset) AsJiraObjectDataset() (*JiraObjectDataset, bool) { + return nil, false +} + +// AsImpalaObjectDataset is the BasicDataset implementation for MagentoObjectDataset. +func (mod MagentoObjectDataset) AsImpalaObjectDataset() (*ImpalaObjectDataset, bool) { + return nil, false +} + +// AsHubspotObjectDataset is the BasicDataset implementation for MagentoObjectDataset. +func (mod MagentoObjectDataset) AsHubspotObjectDataset() (*HubspotObjectDataset, bool) { + return nil, false +} + +// AsHiveObjectDataset is the BasicDataset implementation for MagentoObjectDataset. +func (mod MagentoObjectDataset) AsHiveObjectDataset() (*HiveObjectDataset, bool) { + return nil, false +} + +// AsHBaseObjectDataset is the BasicDataset implementation for MagentoObjectDataset. +func (mod MagentoObjectDataset) AsHBaseObjectDataset() (*HBaseObjectDataset, bool) { + return nil, false +} + +// AsGreenplumTableDataset is the BasicDataset implementation for MagentoObjectDataset. +func (mod MagentoObjectDataset) AsGreenplumTableDataset() (*GreenplumTableDataset, bool) { + return nil, false +} + +// AsGoogleBigQueryObjectDataset is the BasicDataset implementation for MagentoObjectDataset. +func (mod MagentoObjectDataset) AsGoogleBigQueryObjectDataset() (*GoogleBigQueryObjectDataset, bool) { + return nil, false +} + +// AsEloquaObjectDataset is the BasicDataset implementation for MagentoObjectDataset. +func (mod MagentoObjectDataset) AsEloquaObjectDataset() (*EloquaObjectDataset, bool) { + return nil, false +} + +// AsDrillTableDataset is the BasicDataset implementation for MagentoObjectDataset. +func (mod MagentoObjectDataset) AsDrillTableDataset() (*DrillTableDataset, bool) { + return nil, false +} + +// AsCouchbaseTableDataset is the BasicDataset implementation for MagentoObjectDataset. +func (mod MagentoObjectDataset) AsCouchbaseTableDataset() (*CouchbaseTableDataset, bool) { + return nil, false +} + +// AsConcurObjectDataset is the BasicDataset implementation for MagentoObjectDataset. +func (mod MagentoObjectDataset) AsConcurObjectDataset() (*ConcurObjectDataset, bool) { + return nil, false +} + +// AsAzurePostgreSQLTableDataset is the BasicDataset implementation for MagentoObjectDataset. +func (mod MagentoObjectDataset) AsAzurePostgreSQLTableDataset() (*AzurePostgreSQLTableDataset, bool) { + return nil, false +} + +// AsAmazonMWSObjectDataset is the BasicDataset implementation for MagentoObjectDataset. +func (mod MagentoObjectDataset) AsAmazonMWSObjectDataset() (*AmazonMWSObjectDataset, bool) { + return nil, false +} + +// AsHTTPDataset is the BasicDataset implementation for MagentoObjectDataset. +func (mod MagentoObjectDataset) AsHTTPDataset() (*HTTPDataset, bool) { + return nil, false +} + +// AsAzureSearchIndexDataset is the BasicDataset implementation for MagentoObjectDataset. +func (mod MagentoObjectDataset) AsAzureSearchIndexDataset() (*AzureSearchIndexDataset, bool) { + return nil, false +} + +// AsWebTableDataset is the BasicDataset implementation for MagentoObjectDataset. +func (mod MagentoObjectDataset) AsWebTableDataset() (*WebTableDataset, bool) { + return nil, false +} + +// AsSQLServerTableDataset is the BasicDataset implementation for MagentoObjectDataset. +func (mod MagentoObjectDataset) AsSQLServerTableDataset() (*SQLServerTableDataset, bool) { + return nil, false +} + +// AsSapEccResourceDataset is the BasicDataset implementation for MagentoObjectDataset. +func (mod MagentoObjectDataset) AsSapEccResourceDataset() (*SapEccResourceDataset, bool) { + return nil, false +} + +// AsSapCloudForCustomerResourceDataset is the BasicDataset implementation for MagentoObjectDataset. +func (mod MagentoObjectDataset) AsSapCloudForCustomerResourceDataset() (*SapCloudForCustomerResourceDataset, bool) { + return nil, false +} + +// AsSalesforceObjectDataset is the BasicDataset implementation for MagentoObjectDataset. +func (mod MagentoObjectDataset) AsSalesforceObjectDataset() (*SalesforceObjectDataset, bool) { + return nil, false +} + +// AsRelationalTableDataset is the BasicDataset implementation for MagentoObjectDataset. +func (mod MagentoObjectDataset) AsRelationalTableDataset() (*RelationalTableDataset, bool) { + return nil, false +} + +// AsAzureMySQLTableDataset is the BasicDataset implementation for MagentoObjectDataset. +func (mod MagentoObjectDataset) AsAzureMySQLTableDataset() (*AzureMySQLTableDataset, bool) { + return nil, false +} + +// AsOracleTableDataset is the BasicDataset implementation for MagentoObjectDataset. +func (mod MagentoObjectDataset) AsOracleTableDataset() (*OracleTableDataset, bool) { + return nil, false +} + +// AsODataResourceDataset is the BasicDataset implementation for MagentoObjectDataset. +func (mod MagentoObjectDataset) AsODataResourceDataset() (*ODataResourceDataset, bool) { + return nil, false +} + +// AsMongoDbCollectionDataset is the BasicDataset implementation for MagentoObjectDataset. +func (mod MagentoObjectDataset) AsMongoDbCollectionDataset() (*MongoDbCollectionDataset, bool) { + return nil, false +} + +// AsFileShareDataset is the BasicDataset implementation for MagentoObjectDataset. +func (mod MagentoObjectDataset) AsFileShareDataset() (*FileShareDataset, bool) { + return nil, false +} + +// AsAzureDataLakeStoreDataset is the BasicDataset implementation for MagentoObjectDataset. +func (mod MagentoObjectDataset) AsAzureDataLakeStoreDataset() (*AzureDataLakeStoreDataset, bool) { + return nil, false +} + +// AsDynamicsEntityDataset is the BasicDataset implementation for MagentoObjectDataset. +func (mod MagentoObjectDataset) AsDynamicsEntityDataset() (*DynamicsEntityDataset, bool) { + return nil, false +} + +// AsDocumentDbCollectionDataset is the BasicDataset implementation for MagentoObjectDataset. +func (mod MagentoObjectDataset) AsDocumentDbCollectionDataset() (*DocumentDbCollectionDataset, bool) { + return nil, false +} + +// AsCustomDataset is the BasicDataset implementation for MagentoObjectDataset. +func (mod MagentoObjectDataset) AsCustomDataset() (*CustomDataset, bool) { + return nil, false +} + +// AsCassandraTableDataset is the BasicDataset implementation for MagentoObjectDataset. +func (mod MagentoObjectDataset) AsCassandraTableDataset() (*CassandraTableDataset, bool) { + return nil, false +} + +// AsAzureSQLDWTableDataset is the BasicDataset implementation for MagentoObjectDataset. +func (mod MagentoObjectDataset) AsAzureSQLDWTableDataset() (*AzureSQLDWTableDataset, bool) { + return nil, false +} + +// AsAzureSQLTableDataset is the BasicDataset implementation for MagentoObjectDataset. +func (mod MagentoObjectDataset) AsAzureSQLTableDataset() (*AzureSQLTableDataset, bool) { + return nil, false +} + +// AsAzureTableDataset is the BasicDataset implementation for MagentoObjectDataset. +func (mod MagentoObjectDataset) AsAzureTableDataset() (*AzureTableDataset, bool) { + return nil, false +} + +// AsAzureBlobDataset is the BasicDataset implementation for MagentoObjectDataset. +func (mod MagentoObjectDataset) AsAzureBlobDataset() (*AzureBlobDataset, bool) { + return nil, false +} + +// AsAmazonS3Dataset is the BasicDataset implementation for MagentoObjectDataset. +func (mod MagentoObjectDataset) AsAmazonS3Dataset() (*AmazonS3Dataset, bool) { + return nil, false +} + +// AsDataset is the BasicDataset implementation for MagentoObjectDataset. +func (mod MagentoObjectDataset) AsDataset() (*Dataset, bool) { + return nil, false +} + +// AsBasicDataset is the BasicDataset implementation for MagentoObjectDataset. +func (mod MagentoObjectDataset) AsBasicDataset() (BasicDataset, bool) { + return &mod, true +} + +// MagentoSource a copy activity Magento server source. +type MagentoSource struct { + // Query - A query to retrieve data from source. Type: string (or Expression with resultType string). + Query interface{} `json:"query,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // SourceRetryCount - Source retry count. Type: integer (or Expression with resultType integer). + SourceRetryCount interface{} `json:"sourceRetryCount,omitempty"` + // SourceRetryWait - Source retry wait. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` + // Type - Possible values include: 'TypeCopySource', 'TypeAmazonRedshiftSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeHTTPSource', 'TypeAzureDataLakeStoreSource', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeRelationalSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource' + Type TypeBasicCopySource `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for MagentoSource. +func (ms MagentoSource) MarshalJSON() ([]byte, error) { + ms.Type = TypeMagentoSource + objectMap := make(map[string]interface{}) + objectMap["query"] = ms.Query + objectMap["sourceRetryCount"] = ms.SourceRetryCount + objectMap["sourceRetryWait"] = ms.SourceRetryWait + if ms.Type != "" { + objectMap["type"] = ms.Type + } + for k, v := range ms.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsAmazonRedshiftSource is the BasicCopySource implementation for MagentoSource. +func (ms MagentoSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { + return nil, false +} + +// AsResponsysSource is the BasicCopySource implementation for MagentoSource. +func (ms MagentoSource) AsResponsysSource() (*ResponsysSource, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudSource is the BasicCopySource implementation for MagentoSource. +func (ms MagentoSource) AsSalesforceMarketingCloudSource() (*SalesforceMarketingCloudSource, bool) { + return nil, false +} + +// AsVerticaSource is the BasicCopySource implementation for MagentoSource. +func (ms MagentoSource) AsVerticaSource() (*VerticaSource, bool) { + return nil, false +} + +// AsNetezzaSource is the BasicCopySource implementation for MagentoSource. +func (ms MagentoSource) AsNetezzaSource() (*NetezzaSource, bool) { + return nil, false +} + +// AsZohoSource is the BasicCopySource implementation for MagentoSource. +func (ms MagentoSource) AsZohoSource() (*ZohoSource, bool) { + return nil, false +} + +// AsXeroSource is the BasicCopySource implementation for MagentoSource. +func (ms MagentoSource) AsXeroSource() (*XeroSource, bool) { + return nil, false +} + +// AsSquareSource is the BasicCopySource implementation for MagentoSource. +func (ms MagentoSource) AsSquareSource() (*SquareSource, bool) { + return nil, false +} + +// AsSparkSource is the BasicCopySource implementation for MagentoSource. +func (ms MagentoSource) AsSparkSource() (*SparkSource, bool) { + return nil, false +} + +// AsShopifySource is the BasicCopySource implementation for MagentoSource. +func (ms MagentoSource) AsShopifySource() (*ShopifySource, bool) { + return nil, false +} + +// AsServiceNowSource is the BasicCopySource implementation for MagentoSource. +func (ms MagentoSource) AsServiceNowSource() (*ServiceNowSource, bool) { + return nil, false +} + +// AsQuickBooksSource is the BasicCopySource implementation for MagentoSource. +func (ms MagentoSource) AsQuickBooksSource() (*QuickBooksSource, bool) { + return nil, false +} + +// AsPrestoSource is the BasicCopySource implementation for MagentoSource. +func (ms MagentoSource) AsPrestoSource() (*PrestoSource, bool) { + return nil, false +} + +// AsPhoenixSource is the BasicCopySource implementation for MagentoSource. +func (ms MagentoSource) AsPhoenixSource() (*PhoenixSource, bool) { + return nil, false +} + +// AsPaypalSource is the BasicCopySource implementation for MagentoSource. +func (ms MagentoSource) AsPaypalSource() (*PaypalSource, bool) { + return nil, false +} + +// AsMarketoSource is the BasicCopySource implementation for MagentoSource. +func (ms MagentoSource) AsMarketoSource() (*MarketoSource, bool) { + return nil, false +} + +// AsMariaDBSource is the BasicCopySource implementation for MagentoSource. +func (ms MagentoSource) AsMariaDBSource() (*MariaDBSource, bool) { + return nil, false +} + +// AsMagentoSource is the BasicCopySource implementation for MagentoSource. +func (ms MagentoSource) AsMagentoSource() (*MagentoSource, bool) { + return &ms, true +} + +// AsJiraSource is the BasicCopySource implementation for MagentoSource. +func (ms MagentoSource) AsJiraSource() (*JiraSource, bool) { + return nil, false +} + +// AsImpalaSource is the BasicCopySource implementation for MagentoSource. +func (ms MagentoSource) AsImpalaSource() (*ImpalaSource, bool) { + return nil, false +} + +// AsHubspotSource is the BasicCopySource implementation for MagentoSource. +func (ms MagentoSource) AsHubspotSource() (*HubspotSource, bool) { + return nil, false +} + +// AsHiveSource is the BasicCopySource implementation for MagentoSource. +func (ms MagentoSource) AsHiveSource() (*HiveSource, bool) { + return nil, false +} + +// AsHBaseSource is the BasicCopySource implementation for MagentoSource. +func (ms MagentoSource) AsHBaseSource() (*HBaseSource, bool) { + return nil, false +} + +// AsGreenplumSource is the BasicCopySource implementation for MagentoSource. +func (ms MagentoSource) AsGreenplumSource() (*GreenplumSource, bool) { + return nil, false +} + +// AsGoogleBigQuerySource is the BasicCopySource implementation for MagentoSource. +func (ms MagentoSource) AsGoogleBigQuerySource() (*GoogleBigQuerySource, bool) { + return nil, false +} + +// AsEloquaSource is the BasicCopySource implementation for MagentoSource. +func (ms MagentoSource) AsEloquaSource() (*EloquaSource, bool) { + return nil, false +} + +// AsDrillSource is the BasicCopySource implementation for MagentoSource. +func (ms MagentoSource) AsDrillSource() (*DrillSource, bool) { + return nil, false +} + +// AsCouchbaseSource is the BasicCopySource implementation for MagentoSource. +func (ms MagentoSource) AsCouchbaseSource() (*CouchbaseSource, bool) { + return nil, false +} + +// AsConcurSource is the BasicCopySource implementation for MagentoSource. +func (ms MagentoSource) AsConcurSource() (*ConcurSource, bool) { + return nil, false +} + +// AsAzurePostgreSQLSource is the BasicCopySource implementation for MagentoSource. +func (ms MagentoSource) AsAzurePostgreSQLSource() (*AzurePostgreSQLSource, bool) { + return nil, false +} + +// AsAmazonMWSSource is the BasicCopySource implementation for MagentoSource. +func (ms MagentoSource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { + return nil, false +} + +// AsHTTPSource is the BasicCopySource implementation for MagentoSource. +func (ms MagentoSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for MagentoSource. +func (ms MagentoSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for MagentoSource. +func (ms MagentoSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsCassandraSource is the BasicCopySource implementation for MagentoSource. +func (ms MagentoSource) AsCassandraSource() (*CassandraSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for MagentoSource. +func (ms MagentoSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for MagentoSource. +func (ms MagentoSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureMySQLSource is the BasicCopySource implementation for MagentoSource. +func (ms MagentoSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for MagentoSource. +func (ms MagentoSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for MagentoSource. +func (ms MagentoSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsSQLDWSource is the BasicCopySource implementation for MagentoSource. +func (ms MagentoSource) AsSQLDWSource() (*SQLDWSource, bool) { + return nil, false +} + +// AsSQLSource is the BasicCopySource implementation for MagentoSource. +func (ms MagentoSource) AsSQLSource() (*SQLSource, bool) { + return nil, false +} + +// AsSapEccSource is the BasicCopySource implementation for MagentoSource. +func (ms MagentoSource) AsSapEccSource() (*SapEccSource, bool) { + return nil, false +} + +// AsSapCloudForCustomerSource is the BasicCopySource implementation for MagentoSource. +func (ms MagentoSource) AsSapCloudForCustomerSource() (*SapCloudForCustomerSource, bool) { + return nil, false +} + +// AsSalesforceSource is the BasicCopySource implementation for MagentoSource. +func (ms MagentoSource) AsSalesforceSource() (*SalesforceSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for MagentoSource. +func (ms MagentoSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for MagentoSource. +func (ms MagentoSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for MagentoSource. +func (ms MagentoSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for MagentoSource. +func (ms MagentoSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + +// AsAzureTableSource is the BasicCopySource implementation for MagentoSource. +func (ms MagentoSource) AsAzureTableSource() (*AzureTableSource, bool) { + return nil, false +} + +// AsCopySource is the BasicCopySource implementation for MagentoSource. +func (ms MagentoSource) AsCopySource() (*CopySource, bool) { + return nil, false +} + +// AsBasicCopySource is the BasicCopySource implementation for MagentoSource. +func (ms MagentoSource) AsBasicCopySource() (BasicCopySource, bool) { + return &ms, true +} + +// ManagedIntegrationRuntime managed integration runtime, including managed elastic and managed dedicated +// integration runtimes. +type ManagedIntegrationRuntime struct { + // State - Integration runtime state, only valid for managed dedicated integration runtime. Possible values include: 'Initial', 'Stopped', 'Started', 'Starting', 'Stopping', 'NeedRegistration', 'Online', 'Limited', 'Offline' + State IntegrationRuntimeState `json:"state,omitempty"` + // ManagedIntegrationRuntimeTypeProperties - Managed integration runtime properties. + *ManagedIntegrationRuntimeTypeProperties `json:"typeProperties,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Description - Integration runtime description. + Description *string `json:"description,omitempty"` + // Type - Possible values include: 'TypeIntegrationRuntime', 'TypeSelfHosted', 'TypeManaged' + Type TypeBasicIntegrationRuntime `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ManagedIntegrationRuntime. +func (mir ManagedIntegrationRuntime) MarshalJSON() ([]byte, error) { + mir.Type = TypeManaged + objectMap := make(map[string]interface{}) + if mir.State != "" { + objectMap["state"] = mir.State + } + if mir.ManagedIntegrationRuntimeTypeProperties != nil { + objectMap["typeProperties"] = mir.ManagedIntegrationRuntimeTypeProperties + } + if mir.Description != nil { + objectMap["description"] = mir.Description + } + if mir.Type != "" { + objectMap["type"] = mir.Type + } + for k, v := range mir.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsSelfHostedIntegrationRuntime is the BasicIntegrationRuntime implementation for ManagedIntegrationRuntime. +func (mir ManagedIntegrationRuntime) AsSelfHostedIntegrationRuntime() (*SelfHostedIntegrationRuntime, bool) { + return nil, false +} + +// AsManagedIntegrationRuntime is the BasicIntegrationRuntime implementation for ManagedIntegrationRuntime. +func (mir ManagedIntegrationRuntime) AsManagedIntegrationRuntime() (*ManagedIntegrationRuntime, bool) { + return &mir, true +} + +// AsIntegrationRuntime is the BasicIntegrationRuntime implementation for ManagedIntegrationRuntime. +func (mir ManagedIntegrationRuntime) AsIntegrationRuntime() (*IntegrationRuntime, bool) { + return nil, false +} + +// AsBasicIntegrationRuntime is the BasicIntegrationRuntime implementation for ManagedIntegrationRuntime. +func (mir ManagedIntegrationRuntime) AsBasicIntegrationRuntime() (BasicIntegrationRuntime, bool) { + return &mir, true +} + +// UnmarshalJSON is the custom unmarshaler for ManagedIntegrationRuntime struct. +func (mir *ManagedIntegrationRuntime) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "state": + if v != nil { + var state IntegrationRuntimeState + err = json.Unmarshal(*v, &state) + if err != nil { + return err + } + mir.State = state + } + case "typeProperties": + if v != nil { + var managedIntegrationRuntimeTypeProperties ManagedIntegrationRuntimeTypeProperties + err = json.Unmarshal(*v, &managedIntegrationRuntimeTypeProperties) + if err != nil { + return err + } + mir.ManagedIntegrationRuntimeTypeProperties = &managedIntegrationRuntimeTypeProperties + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if mir.AdditionalProperties == nil { + mir.AdditionalProperties = make(map[string]interface{}) + } + mir.AdditionalProperties[k] = additionalProperties + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + mir.Description = &description + } + case "type": + if v != nil { + var typeVar TypeBasicIntegrationRuntime + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + mir.Type = typeVar + } + } + } + + return nil +} + +// ManagedIntegrationRuntimeError error definition for managed integration runtime. +type ManagedIntegrationRuntimeError struct { + // Time - The time when the error occurred. + Time *date.Time `json:"time,omitempty"` + // Code - Error code. + Code *string `json:"code,omitempty"` + // Parameters - Managed integration runtime error parameters. + Parameters *[]string `json:"parameters,omitempty"` + // Message - Error message. + Message *string `json:"message,omitempty"` +} + +// ManagedIntegrationRuntimeNode properties of integration runtime node. +type ManagedIntegrationRuntimeNode struct { + // NodeID - The managed integration runtime node id. + NodeID *string `json:"nodeId,omitempty"` + // Status - The managed integration runtime node status. Possible values include: 'ManagedIntegrationRuntimeNodeStatusStarting', 'ManagedIntegrationRuntimeNodeStatusAvailable', 'ManagedIntegrationRuntimeNodeStatusRecycling', 'ManagedIntegrationRuntimeNodeStatusUnavailable' + Status ManagedIntegrationRuntimeNodeStatus `json:"status,omitempty"` + // Errors - The errors that occurred on this integration runtime node. + Errors *[]ManagedIntegrationRuntimeError `json:"errors,omitempty"` +} + +// ManagedIntegrationRuntimeOperationResult properties of managed integration runtime operation result. +type ManagedIntegrationRuntimeOperationResult struct { + // Type - The operation type. Could be start or stop. + Type *string `json:"type,omitempty"` + // StartTime - The start time of the operation. + StartTime *date.Time `json:"startTime,omitempty"` + // Result - The operation result. + Result *string `json:"result,omitempty"` + // ErrorCode - The error code. + ErrorCode *string `json:"errorCode,omitempty"` + // Parameters - Managed integration runtime error parameters. + Parameters *[]string `json:"parameters,omitempty"` + // ActivityID - The activity id for the operation request. + ActivityID *string `json:"activityId,omitempty"` +} + +// ManagedIntegrationRuntimeStatus managed integration runtime status. +type ManagedIntegrationRuntimeStatus struct { + // ManagedIntegrationRuntimeStatusTypeProperties - Managed integration runtime status type properties. + *ManagedIntegrationRuntimeStatusTypeProperties `json:"typeProperties,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // DataFactoryName - The data factory name which the integration runtime belong to. + DataFactoryName *string `json:"dataFactoryName,omitempty"` + // State - The state of integration runtime. Possible values include: 'Initial', 'Stopped', 'Started', 'Starting', 'Stopping', 'NeedRegistration', 'Online', 'Limited', 'Offline' + State IntegrationRuntimeState `json:"state,omitempty"` + // Type - Possible values include: 'TypeBasicIntegrationRuntimeStatusTypeIntegrationRuntimeStatus', 'TypeBasicIntegrationRuntimeStatusTypeSelfHosted', 'TypeBasicIntegrationRuntimeStatusTypeManaged' + Type TypeBasicIntegrationRuntimeStatus `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ManagedIntegrationRuntimeStatus. +func (mirs ManagedIntegrationRuntimeStatus) MarshalJSON() ([]byte, error) { + mirs.Type = TypeBasicIntegrationRuntimeStatusTypeManaged + objectMap := make(map[string]interface{}) + if mirs.ManagedIntegrationRuntimeStatusTypeProperties != nil { + objectMap["typeProperties"] = mirs.ManagedIntegrationRuntimeStatusTypeProperties + } + if mirs.DataFactoryName != nil { + objectMap["dataFactoryName"] = mirs.DataFactoryName + } + if mirs.State != "" { + objectMap["state"] = mirs.State + } + if mirs.Type != "" { + objectMap["type"] = mirs.Type + } + for k, v := range mirs.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsSelfHostedIntegrationRuntimeStatus is the BasicIntegrationRuntimeStatus implementation for ManagedIntegrationRuntimeStatus. +func (mirs ManagedIntegrationRuntimeStatus) AsSelfHostedIntegrationRuntimeStatus() (*SelfHostedIntegrationRuntimeStatus, bool) { + return nil, false +} + +// AsManagedIntegrationRuntimeStatus is the BasicIntegrationRuntimeStatus implementation for ManagedIntegrationRuntimeStatus. +func (mirs ManagedIntegrationRuntimeStatus) AsManagedIntegrationRuntimeStatus() (*ManagedIntegrationRuntimeStatus, bool) { + return &mirs, true +} + +// AsIntegrationRuntimeStatus is the BasicIntegrationRuntimeStatus implementation for ManagedIntegrationRuntimeStatus. +func (mirs ManagedIntegrationRuntimeStatus) AsIntegrationRuntimeStatus() (*IntegrationRuntimeStatus, bool) { + return nil, false +} + +// AsBasicIntegrationRuntimeStatus is the BasicIntegrationRuntimeStatus implementation for ManagedIntegrationRuntimeStatus. +func (mirs ManagedIntegrationRuntimeStatus) AsBasicIntegrationRuntimeStatus() (BasicIntegrationRuntimeStatus, bool) { + return &mirs, true +} + +// UnmarshalJSON is the custom unmarshaler for ManagedIntegrationRuntimeStatus struct. +func (mirs *ManagedIntegrationRuntimeStatus) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "typeProperties": + if v != nil { + var managedIntegrationRuntimeStatusTypeProperties ManagedIntegrationRuntimeStatusTypeProperties + err = json.Unmarshal(*v, &managedIntegrationRuntimeStatusTypeProperties) + if err != nil { + return err + } + mirs.ManagedIntegrationRuntimeStatusTypeProperties = &managedIntegrationRuntimeStatusTypeProperties + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if mirs.AdditionalProperties == nil { + mirs.AdditionalProperties = make(map[string]interface{}) + } + mirs.AdditionalProperties[k] = additionalProperties + } + case "dataFactoryName": + if v != nil { + var dataFactoryName string + err = json.Unmarshal(*v, &dataFactoryName) + if err != nil { + return err + } + mirs.DataFactoryName = &dataFactoryName + } + case "state": + if v != nil { + var state IntegrationRuntimeState + err = json.Unmarshal(*v, &state) + if err != nil { + return err + } + mirs.State = state + } + case "type": + if v != nil { + var typeVar TypeBasicIntegrationRuntimeStatus + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + mirs.Type = typeVar + } + } + } + + return nil +} + +// ManagedIntegrationRuntimeStatusTypeProperties managed integration runtime status type properties. +type ManagedIntegrationRuntimeStatusTypeProperties struct { + // CreateTime - The time at which the integration runtime was created, in ISO8601 format. + CreateTime *date.Time `json:"createTime,omitempty"` + // Nodes - The list of nodes for managed integration runtime. + Nodes *[]ManagedIntegrationRuntimeNode `json:"nodes,omitempty"` + // OtherErrors - The errors that occurred on this integration runtime. + OtherErrors *[]ManagedIntegrationRuntimeError `json:"otherErrors,omitempty"` + // LastOperation - The last operation result that occurred on this integration runtime. + LastOperation *ManagedIntegrationRuntimeOperationResult `json:"lastOperation,omitempty"` +} + +// ManagedIntegrationRuntimeTypeProperties managed integration runtime type properties. +type ManagedIntegrationRuntimeTypeProperties struct { + // ComputeProperties - The compute resource for managed integration runtime. + ComputeProperties *IntegrationRuntimeComputeProperties `json:"computeProperties,omitempty"` + // SsisProperties - SSIS properties for managed integration runtime. + SsisProperties *IntegrationRuntimeSsisProperties `json:"ssisProperties,omitempty"` +} + +// MariaDBLinkedService mariaDB server linked service. +type MariaDBLinkedService struct { + // MariaDBLinkedServiceTypeProperties - MariaDB server linked service properties. + *MariaDBLinkedServiceTypeProperties `json:"typeProperties,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // ConnectVia - The integration runtime reference. + ConnectVia *IntegrationRuntimeReference `json:"connectVia,omitempty"` + // Description - Linked service description. + Description *string `json:"description,omitempty"` + // Parameters - Parameters for linked service. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeLinkedService', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforce', 'TypeAzureDataLakeStore', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureStorage' + Type TypeBasicLinkedService `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for MariaDBLinkedService. +func (mdls MariaDBLinkedService) MarshalJSON() ([]byte, error) { + mdls.Type = TypeMariaDB + objectMap := make(map[string]interface{}) + if mdls.MariaDBLinkedServiceTypeProperties != nil { + objectMap["typeProperties"] = mdls.MariaDBLinkedServiceTypeProperties + } + if mdls.ConnectVia != nil { + objectMap["connectVia"] = mdls.ConnectVia + } + if mdls.Description != nil { + objectMap["description"] = mdls.Description + } + if mdls.Parameters != nil { + objectMap["parameters"] = mdls.Parameters + } + if mdls.Annotations != nil { + objectMap["annotations"] = mdls.Annotations + } + if mdls.Type != "" { + objectMap["type"] = mdls.Type + } + for k, v := range mdls.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysLinkedService is the BasicLinkedService implementation for MariaDBLinkedService. +func (mdls MariaDBLinkedService) AsResponsysLinkedService() (*ResponsysLinkedService, bool) { + return nil, false +} + +// AsAzureDatabricksLinkedService is the BasicLinkedService implementation for MariaDBLinkedService. +func (mdls MariaDBLinkedService) AsAzureDatabricksLinkedService() (*AzureDatabricksLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeAnalyticsLinkedService is the BasicLinkedService implementation for MariaDBLinkedService. +func (mdls MariaDBLinkedService) AsAzureDataLakeAnalyticsLinkedService() (*AzureDataLakeAnalyticsLinkedService, bool) { + return nil, false +} + +// AsHDInsightOnDemandLinkedService is the BasicLinkedService implementation for MariaDBLinkedService. +func (mdls MariaDBLinkedService) AsHDInsightOnDemandLinkedService() (*HDInsightOnDemandLinkedService, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudLinkedService is the BasicLinkedService implementation for MariaDBLinkedService. +func (mdls MariaDBLinkedService) AsSalesforceMarketingCloudLinkedService() (*SalesforceMarketingCloudLinkedService, bool) { + return nil, false +} + +// AsNetezzaLinkedService is the BasicLinkedService implementation for MariaDBLinkedService. +func (mdls MariaDBLinkedService) AsNetezzaLinkedService() (*NetezzaLinkedService, bool) { + return nil, false +} + +// AsVerticaLinkedService is the BasicLinkedService implementation for MariaDBLinkedService. +func (mdls MariaDBLinkedService) AsVerticaLinkedService() (*VerticaLinkedService, bool) { + return nil, false +} + +// AsZohoLinkedService is the BasicLinkedService implementation for MariaDBLinkedService. +func (mdls MariaDBLinkedService) AsZohoLinkedService() (*ZohoLinkedService, bool) { + return nil, false +} + +// AsXeroLinkedService is the BasicLinkedService implementation for MariaDBLinkedService. +func (mdls MariaDBLinkedService) AsXeroLinkedService() (*XeroLinkedService, bool) { + return nil, false +} + +// AsSquareLinkedService is the BasicLinkedService implementation for MariaDBLinkedService. +func (mdls MariaDBLinkedService) AsSquareLinkedService() (*SquareLinkedService, bool) { + return nil, false +} + +// AsSparkLinkedService is the BasicLinkedService implementation for MariaDBLinkedService. +func (mdls MariaDBLinkedService) AsSparkLinkedService() (*SparkLinkedService, bool) { + return nil, false +} + +// AsShopifyLinkedService is the BasicLinkedService implementation for MariaDBLinkedService. +func (mdls MariaDBLinkedService) AsShopifyLinkedService() (*ShopifyLinkedService, bool) { + return nil, false +} + +// AsServiceNowLinkedService is the BasicLinkedService implementation for MariaDBLinkedService. +func (mdls MariaDBLinkedService) AsServiceNowLinkedService() (*ServiceNowLinkedService, bool) { + return nil, false +} + +// AsQuickBooksLinkedService is the BasicLinkedService implementation for MariaDBLinkedService. +func (mdls MariaDBLinkedService) AsQuickBooksLinkedService() (*QuickBooksLinkedService, bool) { + return nil, false +} + +// AsPrestoLinkedService is the BasicLinkedService implementation for MariaDBLinkedService. +func (mdls MariaDBLinkedService) AsPrestoLinkedService() (*PrestoLinkedService, bool) { + return nil, false +} + +// AsPhoenixLinkedService is the BasicLinkedService implementation for MariaDBLinkedService. +func (mdls MariaDBLinkedService) AsPhoenixLinkedService() (*PhoenixLinkedService, bool) { + return nil, false +} + +// AsPaypalLinkedService is the BasicLinkedService implementation for MariaDBLinkedService. +func (mdls MariaDBLinkedService) AsPaypalLinkedService() (*PaypalLinkedService, bool) { + return nil, false +} + +// AsMarketoLinkedService is the BasicLinkedService implementation for MariaDBLinkedService. +func (mdls MariaDBLinkedService) AsMarketoLinkedService() (*MarketoLinkedService, bool) { + return nil, false +} + +// AsMariaDBLinkedService is the BasicLinkedService implementation for MariaDBLinkedService. +func (mdls MariaDBLinkedService) AsMariaDBLinkedService() (*MariaDBLinkedService, bool) { + return &mdls, true +} + +// AsMagentoLinkedService is the BasicLinkedService implementation for MariaDBLinkedService. +func (mdls MariaDBLinkedService) AsMagentoLinkedService() (*MagentoLinkedService, bool) { + return nil, false +} + +// AsJiraLinkedService is the BasicLinkedService implementation for MariaDBLinkedService. +func (mdls MariaDBLinkedService) AsJiraLinkedService() (*JiraLinkedService, bool) { + return nil, false +} + +// AsImpalaLinkedService is the BasicLinkedService implementation for MariaDBLinkedService. +func (mdls MariaDBLinkedService) AsImpalaLinkedService() (*ImpalaLinkedService, bool) { + return nil, false +} + +// AsHubspotLinkedService is the BasicLinkedService implementation for MariaDBLinkedService. +func (mdls MariaDBLinkedService) AsHubspotLinkedService() (*HubspotLinkedService, bool) { + return nil, false +} + +// AsHiveLinkedService is the BasicLinkedService implementation for MariaDBLinkedService. +func (mdls MariaDBLinkedService) AsHiveLinkedService() (*HiveLinkedService, bool) { + return nil, false +} + +// AsHBaseLinkedService is the BasicLinkedService implementation for MariaDBLinkedService. +func (mdls MariaDBLinkedService) AsHBaseLinkedService() (*HBaseLinkedService, bool) { + return nil, false +} + +// AsGreenplumLinkedService is the BasicLinkedService implementation for MariaDBLinkedService. +func (mdls MariaDBLinkedService) AsGreenplumLinkedService() (*GreenplumLinkedService, bool) { + return nil, false +} + +// AsGoogleBigQueryLinkedService is the BasicLinkedService implementation for MariaDBLinkedService. +func (mdls MariaDBLinkedService) AsGoogleBigQueryLinkedService() (*GoogleBigQueryLinkedService, bool) { + return nil, false +} + +// AsEloquaLinkedService is the BasicLinkedService implementation for MariaDBLinkedService. +func (mdls MariaDBLinkedService) AsEloquaLinkedService() (*EloquaLinkedService, bool) { + return nil, false +} + +// AsDrillLinkedService is the BasicLinkedService implementation for MariaDBLinkedService. +func (mdls MariaDBLinkedService) AsDrillLinkedService() (*DrillLinkedService, bool) { + return nil, false +} + +// AsCouchbaseLinkedService is the BasicLinkedService implementation for MariaDBLinkedService. +func (mdls MariaDBLinkedService) AsCouchbaseLinkedService() (*CouchbaseLinkedService, bool) { + return nil, false +} + +// AsConcurLinkedService is the BasicLinkedService implementation for MariaDBLinkedService. +func (mdls MariaDBLinkedService) AsConcurLinkedService() (*ConcurLinkedService, bool) { + return nil, false +} + +// AsAzurePostgreSQLLinkedService is the BasicLinkedService implementation for MariaDBLinkedService. +func (mdls MariaDBLinkedService) AsAzurePostgreSQLLinkedService() (*AzurePostgreSQLLinkedService, bool) { + return nil, false +} + +// AsAmazonMWSLinkedService is the BasicLinkedService implementation for MariaDBLinkedService. +func (mdls MariaDBLinkedService) AsAmazonMWSLinkedService() (*AmazonMWSLinkedService, bool) { + return nil, false +} + +// AsSapHanaLinkedService is the BasicLinkedService implementation for MariaDBLinkedService. +func (mdls MariaDBLinkedService) AsSapHanaLinkedService() (*SapHanaLinkedService, bool) { + return nil, false +} + +// AsSapBWLinkedService is the BasicLinkedService implementation for MariaDBLinkedService. +func (mdls MariaDBLinkedService) AsSapBWLinkedService() (*SapBWLinkedService, bool) { + return nil, false +} + +// AsSftpServerLinkedService is the BasicLinkedService implementation for MariaDBLinkedService. +func (mdls MariaDBLinkedService) AsSftpServerLinkedService() (*SftpServerLinkedService, bool) { + return nil, false +} + +// AsFtpServerLinkedService is the BasicLinkedService implementation for MariaDBLinkedService. +func (mdls MariaDBLinkedService) AsFtpServerLinkedService() (*FtpServerLinkedService, bool) { + return nil, false +} + +// AsHTTPLinkedService is the BasicLinkedService implementation for MariaDBLinkedService. +func (mdls MariaDBLinkedService) AsHTTPLinkedService() (*HTTPLinkedService, bool) { + return nil, false +} + +// AsAzureSearchLinkedService is the BasicLinkedService implementation for MariaDBLinkedService. +func (mdls MariaDBLinkedService) AsAzureSearchLinkedService() (*AzureSearchLinkedService, bool) { + return nil, false +} + +// AsCustomDataSourceLinkedService is the BasicLinkedService implementation for MariaDBLinkedService. +func (mdls MariaDBLinkedService) AsCustomDataSourceLinkedService() (*CustomDataSourceLinkedService, bool) { + return nil, false +} + +// AsAmazonRedshiftLinkedService is the BasicLinkedService implementation for MariaDBLinkedService. +func (mdls MariaDBLinkedService) AsAmazonRedshiftLinkedService() (*AmazonRedshiftLinkedService, bool) { + return nil, false +} + +// AsAmazonS3LinkedService is the BasicLinkedService implementation for MariaDBLinkedService. +func (mdls MariaDBLinkedService) AsAmazonS3LinkedService() (*AmazonS3LinkedService, bool) { + return nil, false +} + +// AsSapEccLinkedService is the BasicLinkedService implementation for MariaDBLinkedService. +func (mdls MariaDBLinkedService) AsSapEccLinkedService() (*SapEccLinkedService, bool) { + return nil, false +} + +// AsSapCloudForCustomerLinkedService is the BasicLinkedService implementation for MariaDBLinkedService. +func (mdls MariaDBLinkedService) AsSapCloudForCustomerLinkedService() (*SapCloudForCustomerLinkedService, bool) { + return nil, false +} + +// AsSalesforceLinkedService is the BasicLinkedService implementation for MariaDBLinkedService. +func (mdls MariaDBLinkedService) AsSalesforceLinkedService() (*SalesforceLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeStoreLinkedService is the BasicLinkedService implementation for MariaDBLinkedService. +func (mdls MariaDBLinkedService) AsAzureDataLakeStoreLinkedService() (*AzureDataLakeStoreLinkedService, bool) { + return nil, false +} + +// AsMongoDbLinkedService is the BasicLinkedService implementation for MariaDBLinkedService. +func (mdls MariaDBLinkedService) AsMongoDbLinkedService() (*MongoDbLinkedService, bool) { + return nil, false +} + +// AsCassandraLinkedService is the BasicLinkedService implementation for MariaDBLinkedService. +func (mdls MariaDBLinkedService) AsCassandraLinkedService() (*CassandraLinkedService, bool) { + return nil, false +} + +// AsWebLinkedService is the BasicLinkedService implementation for MariaDBLinkedService. +func (mdls MariaDBLinkedService) AsWebLinkedService() (*WebLinkedService, bool) { + return nil, false +} + +// AsODataLinkedService is the BasicLinkedService implementation for MariaDBLinkedService. +func (mdls MariaDBLinkedService) AsODataLinkedService() (*ODataLinkedService, bool) { + return nil, false +} + +// AsHdfsLinkedService is the BasicLinkedService implementation for MariaDBLinkedService. +func (mdls MariaDBLinkedService) AsHdfsLinkedService() (*HdfsLinkedService, bool) { + return nil, false +} + +// AsOdbcLinkedService is the BasicLinkedService implementation for MariaDBLinkedService. +func (mdls MariaDBLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, bool) { + return nil, false +} + +// AsAzureMLLinkedService is the BasicLinkedService implementation for MariaDBLinkedService. +func (mdls MariaDBLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { + return nil, false +} + +// AsTeradataLinkedService is the BasicLinkedService implementation for MariaDBLinkedService. +func (mdls MariaDBLinkedService) AsTeradataLinkedService() (*TeradataLinkedService, bool) { + return nil, false +} + +// AsDb2LinkedService is the BasicLinkedService implementation for MariaDBLinkedService. +func (mdls MariaDBLinkedService) AsDb2LinkedService() (*Db2LinkedService, bool) { + return nil, false +} + +// AsSybaseLinkedService is the BasicLinkedService implementation for MariaDBLinkedService. +func (mdls MariaDBLinkedService) AsSybaseLinkedService() (*SybaseLinkedService, bool) { + return nil, false +} + +// AsPostgreSQLLinkedService is the BasicLinkedService implementation for MariaDBLinkedService. +func (mdls MariaDBLinkedService) AsPostgreSQLLinkedService() (*PostgreSQLLinkedService, bool) { + return nil, false +} + +// AsMySQLLinkedService is the BasicLinkedService implementation for MariaDBLinkedService. +func (mdls MariaDBLinkedService) AsMySQLLinkedService() (*MySQLLinkedService, bool) { + return nil, false +} + +// AsAzureMySQLLinkedService is the BasicLinkedService implementation for MariaDBLinkedService. +func (mdls MariaDBLinkedService) AsAzureMySQLLinkedService() (*AzureMySQLLinkedService, bool) { + return nil, false +} + +// AsOracleLinkedService is the BasicLinkedService implementation for MariaDBLinkedService. +func (mdls MariaDBLinkedService) AsOracleLinkedService() (*OracleLinkedService, bool) { + return nil, false +} + +// AsFileServerLinkedService is the BasicLinkedService implementation for MariaDBLinkedService. +func (mdls MariaDBLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { + return nil, false +} + +// AsHDInsightLinkedService is the BasicLinkedService implementation for MariaDBLinkedService. +func (mdls MariaDBLinkedService) AsHDInsightLinkedService() (*HDInsightLinkedService, bool) { + return nil, false +} + +// AsDynamicsLinkedService is the BasicLinkedService implementation for MariaDBLinkedService. +func (mdls MariaDBLinkedService) AsDynamicsLinkedService() (*DynamicsLinkedService, bool) { + return nil, false +} + +// AsCosmosDbLinkedService is the BasicLinkedService implementation for MariaDBLinkedService. +func (mdls MariaDBLinkedService) AsCosmosDbLinkedService() (*CosmosDbLinkedService, bool) { + return nil, false +} + +// AsAzureKeyVaultLinkedService is the BasicLinkedService implementation for MariaDBLinkedService. +func (mdls MariaDBLinkedService) AsAzureKeyVaultLinkedService() (*AzureKeyVaultLinkedService, bool) { + return nil, false +} + +// AsAzureBatchLinkedService is the BasicLinkedService implementation for MariaDBLinkedService. +func (mdls MariaDBLinkedService) AsAzureBatchLinkedService() (*AzureBatchLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDatabaseLinkedService is the BasicLinkedService implementation for MariaDBLinkedService. +func (mdls MariaDBLinkedService) AsAzureSQLDatabaseLinkedService() (*AzureSQLDatabaseLinkedService, bool) { + return nil, false +} + +// AsSQLServerLinkedService is the BasicLinkedService implementation for MariaDBLinkedService. +func (mdls MariaDBLinkedService) AsSQLServerLinkedService() (*SQLServerLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDWLinkedService is the BasicLinkedService implementation for MariaDBLinkedService. +func (mdls MariaDBLinkedService) AsAzureSQLDWLinkedService() (*AzureSQLDWLinkedService, bool) { + return nil, false +} + +// AsAzureStorageLinkedService is the BasicLinkedService implementation for MariaDBLinkedService. +func (mdls MariaDBLinkedService) AsAzureStorageLinkedService() (*AzureStorageLinkedService, bool) { + return nil, false +} + +// AsLinkedService is the BasicLinkedService implementation for MariaDBLinkedService. +func (mdls MariaDBLinkedService) AsLinkedService() (*LinkedService, bool) { + return nil, false +} + +// AsBasicLinkedService is the BasicLinkedService implementation for MariaDBLinkedService. +func (mdls MariaDBLinkedService) AsBasicLinkedService() (BasicLinkedService, bool) { + return &mdls, true +} + +// UnmarshalJSON is the custom unmarshaler for MariaDBLinkedService struct. +func (mdls *MariaDBLinkedService) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "typeProperties": + if v != nil { + var mariaDBLinkedServiceTypeProperties MariaDBLinkedServiceTypeProperties + err = json.Unmarshal(*v, &mariaDBLinkedServiceTypeProperties) + if err != nil { + return err + } + mdls.MariaDBLinkedServiceTypeProperties = &mariaDBLinkedServiceTypeProperties + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if mdls.AdditionalProperties == nil { + mdls.AdditionalProperties = make(map[string]interface{}) + } + mdls.AdditionalProperties[k] = additionalProperties + } + case "connectVia": + if v != nil { + var connectVia IntegrationRuntimeReference + err = json.Unmarshal(*v, &connectVia) + if err != nil { + return err + } + mdls.ConnectVia = &connectVia + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + mdls.Description = &description + } + case "parameters": + if v != nil { + var parameters map[string]*ParameterSpecification + err = json.Unmarshal(*v, ¶meters) + if err != nil { + return err + } + mdls.Parameters = parameters + } + case "annotations": + if v != nil { + var annotations []interface{} + err = json.Unmarshal(*v, &annotations) + if err != nil { + return err + } + mdls.Annotations = &annotations + } + case "type": + if v != nil { + var typeVar TypeBasicLinkedService + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + mdls.Type = typeVar + } + } + } + + return nil +} + +// MariaDBLinkedServiceTypeProperties mariaDB server linked service properties. +type MariaDBLinkedServiceTypeProperties struct { + // ConnectionString - An ODBC connection string. Type: string, SecureString or AzureKeyVaultSecretReference. + ConnectionString interface{} `json:"connectionString,omitempty"` + // EncryptedCredential - The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string). + EncryptedCredential interface{} `json:"encryptedCredential,omitempty"` +} + +// MariaDBSource a copy activity MariaDB server source. +type MariaDBSource struct { + // Query - A query to retrieve data from source. Type: string (or Expression with resultType string). + Query interface{} `json:"query,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // SourceRetryCount - Source retry count. Type: integer (or Expression with resultType integer). + SourceRetryCount interface{} `json:"sourceRetryCount,omitempty"` + // SourceRetryWait - Source retry wait. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` + // Type - Possible values include: 'TypeCopySource', 'TypeAmazonRedshiftSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeHTTPSource', 'TypeAzureDataLakeStoreSource', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeRelationalSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource' + Type TypeBasicCopySource `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for MariaDBSource. +func (mds MariaDBSource) MarshalJSON() ([]byte, error) { + mds.Type = TypeMariaDBSource + objectMap := make(map[string]interface{}) + objectMap["query"] = mds.Query + objectMap["sourceRetryCount"] = mds.SourceRetryCount + objectMap["sourceRetryWait"] = mds.SourceRetryWait + if mds.Type != "" { + objectMap["type"] = mds.Type + } + for k, v := range mds.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsAmazonRedshiftSource is the BasicCopySource implementation for MariaDBSource. +func (mds MariaDBSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { + return nil, false +} + +// AsResponsysSource is the BasicCopySource implementation for MariaDBSource. +func (mds MariaDBSource) AsResponsysSource() (*ResponsysSource, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudSource is the BasicCopySource implementation for MariaDBSource. +func (mds MariaDBSource) AsSalesforceMarketingCloudSource() (*SalesforceMarketingCloudSource, bool) { + return nil, false +} + +// AsVerticaSource is the BasicCopySource implementation for MariaDBSource. +func (mds MariaDBSource) AsVerticaSource() (*VerticaSource, bool) { + return nil, false +} + +// AsNetezzaSource is the BasicCopySource implementation for MariaDBSource. +func (mds MariaDBSource) AsNetezzaSource() (*NetezzaSource, bool) { + return nil, false +} + +// AsZohoSource is the BasicCopySource implementation for MariaDBSource. +func (mds MariaDBSource) AsZohoSource() (*ZohoSource, bool) { + return nil, false +} + +// AsXeroSource is the BasicCopySource implementation for MariaDBSource. +func (mds MariaDBSource) AsXeroSource() (*XeroSource, bool) { + return nil, false +} + +// AsSquareSource is the BasicCopySource implementation for MariaDBSource. +func (mds MariaDBSource) AsSquareSource() (*SquareSource, bool) { + return nil, false +} + +// AsSparkSource is the BasicCopySource implementation for MariaDBSource. +func (mds MariaDBSource) AsSparkSource() (*SparkSource, bool) { + return nil, false +} + +// AsShopifySource is the BasicCopySource implementation for MariaDBSource. +func (mds MariaDBSource) AsShopifySource() (*ShopifySource, bool) { + return nil, false +} + +// AsServiceNowSource is the BasicCopySource implementation for MariaDBSource. +func (mds MariaDBSource) AsServiceNowSource() (*ServiceNowSource, bool) { + return nil, false +} + +// AsQuickBooksSource is the BasicCopySource implementation for MariaDBSource. +func (mds MariaDBSource) AsQuickBooksSource() (*QuickBooksSource, bool) { + return nil, false +} + +// AsPrestoSource is the BasicCopySource implementation for MariaDBSource. +func (mds MariaDBSource) AsPrestoSource() (*PrestoSource, bool) { + return nil, false +} + +// AsPhoenixSource is the BasicCopySource implementation for MariaDBSource. +func (mds MariaDBSource) AsPhoenixSource() (*PhoenixSource, bool) { + return nil, false +} + +// AsPaypalSource is the BasicCopySource implementation for MariaDBSource. +func (mds MariaDBSource) AsPaypalSource() (*PaypalSource, bool) { + return nil, false +} + +// AsMarketoSource is the BasicCopySource implementation for MariaDBSource. +func (mds MariaDBSource) AsMarketoSource() (*MarketoSource, bool) { + return nil, false +} + +// AsMariaDBSource is the BasicCopySource implementation for MariaDBSource. +func (mds MariaDBSource) AsMariaDBSource() (*MariaDBSource, bool) { + return &mds, true +} + +// AsMagentoSource is the BasicCopySource implementation for MariaDBSource. +func (mds MariaDBSource) AsMagentoSource() (*MagentoSource, bool) { + return nil, false +} + +// AsJiraSource is the BasicCopySource implementation for MariaDBSource. +func (mds MariaDBSource) AsJiraSource() (*JiraSource, bool) { + return nil, false +} + +// AsImpalaSource is the BasicCopySource implementation for MariaDBSource. +func (mds MariaDBSource) AsImpalaSource() (*ImpalaSource, bool) { + return nil, false +} + +// AsHubspotSource is the BasicCopySource implementation for MariaDBSource. +func (mds MariaDBSource) AsHubspotSource() (*HubspotSource, bool) { + return nil, false +} + +// AsHiveSource is the BasicCopySource implementation for MariaDBSource. +func (mds MariaDBSource) AsHiveSource() (*HiveSource, bool) { + return nil, false +} + +// AsHBaseSource is the BasicCopySource implementation for MariaDBSource. +func (mds MariaDBSource) AsHBaseSource() (*HBaseSource, bool) { + return nil, false +} + +// AsGreenplumSource is the BasicCopySource implementation for MariaDBSource. +func (mds MariaDBSource) AsGreenplumSource() (*GreenplumSource, bool) { + return nil, false +} + +// AsGoogleBigQuerySource is the BasicCopySource implementation for MariaDBSource. +func (mds MariaDBSource) AsGoogleBigQuerySource() (*GoogleBigQuerySource, bool) { + return nil, false +} + +// AsEloquaSource is the BasicCopySource implementation for MariaDBSource. +func (mds MariaDBSource) AsEloquaSource() (*EloquaSource, bool) { + return nil, false +} + +// AsDrillSource is the BasicCopySource implementation for MariaDBSource. +func (mds MariaDBSource) AsDrillSource() (*DrillSource, bool) { + return nil, false +} + +// AsCouchbaseSource is the BasicCopySource implementation for MariaDBSource. +func (mds MariaDBSource) AsCouchbaseSource() (*CouchbaseSource, bool) { + return nil, false +} + +// AsConcurSource is the BasicCopySource implementation for MariaDBSource. +func (mds MariaDBSource) AsConcurSource() (*ConcurSource, bool) { + return nil, false +} + +// AsAzurePostgreSQLSource is the BasicCopySource implementation for MariaDBSource. +func (mds MariaDBSource) AsAzurePostgreSQLSource() (*AzurePostgreSQLSource, bool) { + return nil, false +} + +// AsAmazonMWSSource is the BasicCopySource implementation for MariaDBSource. +func (mds MariaDBSource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { + return nil, false +} + +// AsHTTPSource is the BasicCopySource implementation for MariaDBSource. +func (mds MariaDBSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for MariaDBSource. +func (mds MariaDBSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for MariaDBSource. +func (mds MariaDBSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsCassandraSource is the BasicCopySource implementation for MariaDBSource. +func (mds MariaDBSource) AsCassandraSource() (*CassandraSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for MariaDBSource. +func (mds MariaDBSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for MariaDBSource. +func (mds MariaDBSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureMySQLSource is the BasicCopySource implementation for MariaDBSource. +func (mds MariaDBSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for MariaDBSource. +func (mds MariaDBSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for MariaDBSource. +func (mds MariaDBSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsSQLDWSource is the BasicCopySource implementation for MariaDBSource. +func (mds MariaDBSource) AsSQLDWSource() (*SQLDWSource, bool) { + return nil, false +} + +// AsSQLSource is the BasicCopySource implementation for MariaDBSource. +func (mds MariaDBSource) AsSQLSource() (*SQLSource, bool) { + return nil, false +} + +// AsSapEccSource is the BasicCopySource implementation for MariaDBSource. +func (mds MariaDBSource) AsSapEccSource() (*SapEccSource, bool) { + return nil, false +} + +// AsSapCloudForCustomerSource is the BasicCopySource implementation for MariaDBSource. +func (mds MariaDBSource) AsSapCloudForCustomerSource() (*SapCloudForCustomerSource, bool) { + return nil, false +} + +// AsSalesforceSource is the BasicCopySource implementation for MariaDBSource. +func (mds MariaDBSource) AsSalesforceSource() (*SalesforceSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for MariaDBSource. +func (mds MariaDBSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for MariaDBSource. +func (mds MariaDBSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for MariaDBSource. +func (mds MariaDBSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for MariaDBSource. +func (mds MariaDBSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + +// AsAzureTableSource is the BasicCopySource implementation for MariaDBSource. +func (mds MariaDBSource) AsAzureTableSource() (*AzureTableSource, bool) { + return nil, false +} + +// AsCopySource is the BasicCopySource implementation for MariaDBSource. +func (mds MariaDBSource) AsCopySource() (*CopySource, bool) { + return nil, false +} + +// AsBasicCopySource is the BasicCopySource implementation for MariaDBSource. +func (mds MariaDBSource) AsBasicCopySource() (BasicCopySource, bool) { + return &mds, true +} + +// MariaDBTableDataset mariaDB server dataset. +type MariaDBTableDataset struct { + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Description - Dataset description. + Description *string `json:"description,omitempty"` + // Structure - Columns that define the structure of the dataset. Type: array (or Expression with resultType array), itemType: DatasetDataElement. + Structure interface{} `json:"structure,omitempty"` + // LinkedServiceName - Linked service reference. + LinkedServiceName *LinkedServiceReference `json:"linkedServiceName,omitempty"` + // Parameters - Parameters for dataset. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeDataset', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSQLServerTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSalesforceObject', 'TypeRelationalTable', 'TypeAzureMySQLTable', 'TypeOracleTable', 'TypeODataResource', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeAzureDataLakeStoreFile', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeAmazonS3Object' + Type TypeBasicDataset `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for MariaDBTableDataset. +func (mdtd MariaDBTableDataset) MarshalJSON() ([]byte, error) { + mdtd.Type = TypeMariaDBTable + objectMap := make(map[string]interface{}) + if mdtd.Description != nil { + objectMap["description"] = mdtd.Description + } + objectMap["structure"] = mdtd.Structure + if mdtd.LinkedServiceName != nil { + objectMap["linkedServiceName"] = mdtd.LinkedServiceName + } + if mdtd.Parameters != nil { + objectMap["parameters"] = mdtd.Parameters + } + if mdtd.Annotations != nil { + objectMap["annotations"] = mdtd.Annotations + } + if mdtd.Type != "" { + objectMap["type"] = mdtd.Type + } + for k, v := range mdtd.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysObjectDataset is the BasicDataset implementation for MariaDBTableDataset. +func (mdtd MariaDBTableDataset) AsResponsysObjectDataset() (*ResponsysObjectDataset, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudObjectDataset is the BasicDataset implementation for MariaDBTableDataset. +func (mdtd MariaDBTableDataset) AsSalesforceMarketingCloudObjectDataset() (*SalesforceMarketingCloudObjectDataset, bool) { + return nil, false +} + +// AsVerticaTableDataset is the BasicDataset implementation for MariaDBTableDataset. +func (mdtd MariaDBTableDataset) AsVerticaTableDataset() (*VerticaTableDataset, bool) { + return nil, false +} + +// AsNetezzaTableDataset is the BasicDataset implementation for MariaDBTableDataset. +func (mdtd MariaDBTableDataset) AsNetezzaTableDataset() (*NetezzaTableDataset, bool) { + return nil, false +} + +// AsZohoObjectDataset is the BasicDataset implementation for MariaDBTableDataset. +func (mdtd MariaDBTableDataset) AsZohoObjectDataset() (*ZohoObjectDataset, bool) { + return nil, false +} + +// AsXeroObjectDataset is the BasicDataset implementation for MariaDBTableDataset. +func (mdtd MariaDBTableDataset) AsXeroObjectDataset() (*XeroObjectDataset, bool) { + return nil, false +} + +// AsSquareObjectDataset is the BasicDataset implementation for MariaDBTableDataset. +func (mdtd MariaDBTableDataset) AsSquareObjectDataset() (*SquareObjectDataset, bool) { + return nil, false +} + +// AsSparkObjectDataset is the BasicDataset implementation for MariaDBTableDataset. +func (mdtd MariaDBTableDataset) AsSparkObjectDataset() (*SparkObjectDataset, bool) { + return nil, false +} + +// AsShopifyObjectDataset is the BasicDataset implementation for MariaDBTableDataset. +func (mdtd MariaDBTableDataset) AsShopifyObjectDataset() (*ShopifyObjectDataset, bool) { + return nil, false +} + +// AsServiceNowObjectDataset is the BasicDataset implementation for MariaDBTableDataset. +func (mdtd MariaDBTableDataset) AsServiceNowObjectDataset() (*ServiceNowObjectDataset, bool) { + return nil, false +} + +// AsQuickBooksObjectDataset is the BasicDataset implementation for MariaDBTableDataset. +func (mdtd MariaDBTableDataset) AsQuickBooksObjectDataset() (*QuickBooksObjectDataset, bool) { + return nil, false +} + +// AsPrestoObjectDataset is the BasicDataset implementation for MariaDBTableDataset. +func (mdtd MariaDBTableDataset) AsPrestoObjectDataset() (*PrestoObjectDataset, bool) { + return nil, false +} + +// AsPhoenixObjectDataset is the BasicDataset implementation for MariaDBTableDataset. +func (mdtd MariaDBTableDataset) AsPhoenixObjectDataset() (*PhoenixObjectDataset, bool) { + return nil, false +} + +// AsPaypalObjectDataset is the BasicDataset implementation for MariaDBTableDataset. +func (mdtd MariaDBTableDataset) AsPaypalObjectDataset() (*PaypalObjectDataset, bool) { + return nil, false +} + +// AsMarketoObjectDataset is the BasicDataset implementation for MariaDBTableDataset. +func (mdtd MariaDBTableDataset) AsMarketoObjectDataset() (*MarketoObjectDataset, bool) { + return nil, false +} + +// AsMariaDBTableDataset is the BasicDataset implementation for MariaDBTableDataset. +func (mdtd MariaDBTableDataset) AsMariaDBTableDataset() (*MariaDBTableDataset, bool) { + return &mdtd, true +} + +// AsMagentoObjectDataset is the BasicDataset implementation for MariaDBTableDataset. +func (mdtd MariaDBTableDataset) AsMagentoObjectDataset() (*MagentoObjectDataset, bool) { + return nil, false +} + +// AsJiraObjectDataset is the BasicDataset implementation for MariaDBTableDataset. +func (mdtd MariaDBTableDataset) AsJiraObjectDataset() (*JiraObjectDataset, bool) { + return nil, false +} + +// AsImpalaObjectDataset is the BasicDataset implementation for MariaDBTableDataset. +func (mdtd MariaDBTableDataset) AsImpalaObjectDataset() (*ImpalaObjectDataset, bool) { + return nil, false +} + +// AsHubspotObjectDataset is the BasicDataset implementation for MariaDBTableDataset. +func (mdtd MariaDBTableDataset) AsHubspotObjectDataset() (*HubspotObjectDataset, bool) { + return nil, false +} + +// AsHiveObjectDataset is the BasicDataset implementation for MariaDBTableDataset. +func (mdtd MariaDBTableDataset) AsHiveObjectDataset() (*HiveObjectDataset, bool) { + return nil, false +} + +// AsHBaseObjectDataset is the BasicDataset implementation for MariaDBTableDataset. +func (mdtd MariaDBTableDataset) AsHBaseObjectDataset() (*HBaseObjectDataset, bool) { + return nil, false +} + +// AsGreenplumTableDataset is the BasicDataset implementation for MariaDBTableDataset. +func (mdtd MariaDBTableDataset) AsGreenplumTableDataset() (*GreenplumTableDataset, bool) { + return nil, false +} + +// AsGoogleBigQueryObjectDataset is the BasicDataset implementation for MariaDBTableDataset. +func (mdtd MariaDBTableDataset) AsGoogleBigQueryObjectDataset() (*GoogleBigQueryObjectDataset, bool) { + return nil, false +} + +// AsEloquaObjectDataset is the BasicDataset implementation for MariaDBTableDataset. +func (mdtd MariaDBTableDataset) AsEloquaObjectDataset() (*EloquaObjectDataset, bool) { + return nil, false +} + +// AsDrillTableDataset is the BasicDataset implementation for MariaDBTableDataset. +func (mdtd MariaDBTableDataset) AsDrillTableDataset() (*DrillTableDataset, bool) { + return nil, false +} + +// AsCouchbaseTableDataset is the BasicDataset implementation for MariaDBTableDataset. +func (mdtd MariaDBTableDataset) AsCouchbaseTableDataset() (*CouchbaseTableDataset, bool) { + return nil, false +} + +// AsConcurObjectDataset is the BasicDataset implementation for MariaDBTableDataset. +func (mdtd MariaDBTableDataset) AsConcurObjectDataset() (*ConcurObjectDataset, bool) { + return nil, false +} + +// AsAzurePostgreSQLTableDataset is the BasicDataset implementation for MariaDBTableDataset. +func (mdtd MariaDBTableDataset) AsAzurePostgreSQLTableDataset() (*AzurePostgreSQLTableDataset, bool) { + return nil, false +} + +// AsAmazonMWSObjectDataset is the BasicDataset implementation for MariaDBTableDataset. +func (mdtd MariaDBTableDataset) AsAmazonMWSObjectDataset() (*AmazonMWSObjectDataset, bool) { + return nil, false +} + +// AsHTTPDataset is the BasicDataset implementation for MariaDBTableDataset. +func (mdtd MariaDBTableDataset) AsHTTPDataset() (*HTTPDataset, bool) { + return nil, false +} + +// AsAzureSearchIndexDataset is the BasicDataset implementation for MariaDBTableDataset. +func (mdtd MariaDBTableDataset) AsAzureSearchIndexDataset() (*AzureSearchIndexDataset, bool) { + return nil, false +} + +// AsWebTableDataset is the BasicDataset implementation for MariaDBTableDataset. +func (mdtd MariaDBTableDataset) AsWebTableDataset() (*WebTableDataset, bool) { + return nil, false +} + +// AsSQLServerTableDataset is the BasicDataset implementation for MariaDBTableDataset. +func (mdtd MariaDBTableDataset) AsSQLServerTableDataset() (*SQLServerTableDataset, bool) { + return nil, false +} + +// AsSapEccResourceDataset is the BasicDataset implementation for MariaDBTableDataset. +func (mdtd MariaDBTableDataset) AsSapEccResourceDataset() (*SapEccResourceDataset, bool) { + return nil, false +} + +// AsSapCloudForCustomerResourceDataset is the BasicDataset implementation for MariaDBTableDataset. +func (mdtd MariaDBTableDataset) AsSapCloudForCustomerResourceDataset() (*SapCloudForCustomerResourceDataset, bool) { + return nil, false +} + +// AsSalesforceObjectDataset is the BasicDataset implementation for MariaDBTableDataset. +func (mdtd MariaDBTableDataset) AsSalesforceObjectDataset() (*SalesforceObjectDataset, bool) { + return nil, false +} + +// AsRelationalTableDataset is the BasicDataset implementation for MariaDBTableDataset. +func (mdtd MariaDBTableDataset) AsRelationalTableDataset() (*RelationalTableDataset, bool) { + return nil, false +} + +// AsAzureMySQLTableDataset is the BasicDataset implementation for MariaDBTableDataset. +func (mdtd MariaDBTableDataset) AsAzureMySQLTableDataset() (*AzureMySQLTableDataset, bool) { + return nil, false +} + +// AsOracleTableDataset is the BasicDataset implementation for MariaDBTableDataset. +func (mdtd MariaDBTableDataset) AsOracleTableDataset() (*OracleTableDataset, bool) { + return nil, false +} + +// AsODataResourceDataset is the BasicDataset implementation for MariaDBTableDataset. +func (mdtd MariaDBTableDataset) AsODataResourceDataset() (*ODataResourceDataset, bool) { + return nil, false +} + +// AsMongoDbCollectionDataset is the BasicDataset implementation for MariaDBTableDataset. +func (mdtd MariaDBTableDataset) AsMongoDbCollectionDataset() (*MongoDbCollectionDataset, bool) { + return nil, false +} + +// AsFileShareDataset is the BasicDataset implementation for MariaDBTableDataset. +func (mdtd MariaDBTableDataset) AsFileShareDataset() (*FileShareDataset, bool) { + return nil, false +} + +// AsAzureDataLakeStoreDataset is the BasicDataset implementation for MariaDBTableDataset. +func (mdtd MariaDBTableDataset) AsAzureDataLakeStoreDataset() (*AzureDataLakeStoreDataset, bool) { + return nil, false +} + +// AsDynamicsEntityDataset is the BasicDataset implementation for MariaDBTableDataset. +func (mdtd MariaDBTableDataset) AsDynamicsEntityDataset() (*DynamicsEntityDataset, bool) { + return nil, false +} + +// AsDocumentDbCollectionDataset is the BasicDataset implementation for MariaDBTableDataset. +func (mdtd MariaDBTableDataset) AsDocumentDbCollectionDataset() (*DocumentDbCollectionDataset, bool) { + return nil, false +} + +// AsCustomDataset is the BasicDataset implementation for MariaDBTableDataset. +func (mdtd MariaDBTableDataset) AsCustomDataset() (*CustomDataset, bool) { + return nil, false +} + +// AsCassandraTableDataset is the BasicDataset implementation for MariaDBTableDataset. +func (mdtd MariaDBTableDataset) AsCassandraTableDataset() (*CassandraTableDataset, bool) { + return nil, false +} + +// AsAzureSQLDWTableDataset is the BasicDataset implementation for MariaDBTableDataset. +func (mdtd MariaDBTableDataset) AsAzureSQLDWTableDataset() (*AzureSQLDWTableDataset, bool) { + return nil, false +} + +// AsAzureSQLTableDataset is the BasicDataset implementation for MariaDBTableDataset. +func (mdtd MariaDBTableDataset) AsAzureSQLTableDataset() (*AzureSQLTableDataset, bool) { + return nil, false +} + +// AsAzureTableDataset is the BasicDataset implementation for MariaDBTableDataset. +func (mdtd MariaDBTableDataset) AsAzureTableDataset() (*AzureTableDataset, bool) { + return nil, false +} + +// AsAzureBlobDataset is the BasicDataset implementation for MariaDBTableDataset. +func (mdtd MariaDBTableDataset) AsAzureBlobDataset() (*AzureBlobDataset, bool) { + return nil, false +} + +// AsAmazonS3Dataset is the BasicDataset implementation for MariaDBTableDataset. +func (mdtd MariaDBTableDataset) AsAmazonS3Dataset() (*AmazonS3Dataset, bool) { + return nil, false +} + +// AsDataset is the BasicDataset implementation for MariaDBTableDataset. +func (mdtd MariaDBTableDataset) AsDataset() (*Dataset, bool) { + return nil, false +} + +// AsBasicDataset is the BasicDataset implementation for MariaDBTableDataset. +func (mdtd MariaDBTableDataset) AsBasicDataset() (BasicDataset, bool) { + return &mdtd, true +} + +// MarketoLinkedService marketo server linked service. +type MarketoLinkedService struct { + // MarketoLinkedServiceTypeProperties - Marketo server linked service properties. + *MarketoLinkedServiceTypeProperties `json:"typeProperties,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // ConnectVia - The integration runtime reference. + ConnectVia *IntegrationRuntimeReference `json:"connectVia,omitempty"` + // Description - Linked service description. + Description *string `json:"description,omitempty"` + // Parameters - Parameters for linked service. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeLinkedService', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforce', 'TypeAzureDataLakeStore', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureStorage' + Type TypeBasicLinkedService `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for MarketoLinkedService. +func (mls MarketoLinkedService) MarshalJSON() ([]byte, error) { + mls.Type = TypeMarketo + objectMap := make(map[string]interface{}) + if mls.MarketoLinkedServiceTypeProperties != nil { + objectMap["typeProperties"] = mls.MarketoLinkedServiceTypeProperties + } + if mls.ConnectVia != nil { + objectMap["connectVia"] = mls.ConnectVia + } + if mls.Description != nil { + objectMap["description"] = mls.Description + } + if mls.Parameters != nil { + objectMap["parameters"] = mls.Parameters + } + if mls.Annotations != nil { + objectMap["annotations"] = mls.Annotations + } + if mls.Type != "" { + objectMap["type"] = mls.Type + } + for k, v := range mls.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysLinkedService is the BasicLinkedService implementation for MarketoLinkedService. +func (mls MarketoLinkedService) AsResponsysLinkedService() (*ResponsysLinkedService, bool) { + return nil, false +} + +// AsAzureDatabricksLinkedService is the BasicLinkedService implementation for MarketoLinkedService. +func (mls MarketoLinkedService) AsAzureDatabricksLinkedService() (*AzureDatabricksLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeAnalyticsLinkedService is the BasicLinkedService implementation for MarketoLinkedService. +func (mls MarketoLinkedService) AsAzureDataLakeAnalyticsLinkedService() (*AzureDataLakeAnalyticsLinkedService, bool) { + return nil, false +} + +// AsHDInsightOnDemandLinkedService is the BasicLinkedService implementation for MarketoLinkedService. +func (mls MarketoLinkedService) AsHDInsightOnDemandLinkedService() (*HDInsightOnDemandLinkedService, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudLinkedService is the BasicLinkedService implementation for MarketoLinkedService. +func (mls MarketoLinkedService) AsSalesforceMarketingCloudLinkedService() (*SalesforceMarketingCloudLinkedService, bool) { + return nil, false +} + +// AsNetezzaLinkedService is the BasicLinkedService implementation for MarketoLinkedService. +func (mls MarketoLinkedService) AsNetezzaLinkedService() (*NetezzaLinkedService, bool) { + return nil, false +} + +// AsVerticaLinkedService is the BasicLinkedService implementation for MarketoLinkedService. +func (mls MarketoLinkedService) AsVerticaLinkedService() (*VerticaLinkedService, bool) { + return nil, false +} + +// AsZohoLinkedService is the BasicLinkedService implementation for MarketoLinkedService. +func (mls MarketoLinkedService) AsZohoLinkedService() (*ZohoLinkedService, bool) { + return nil, false +} + +// AsXeroLinkedService is the BasicLinkedService implementation for MarketoLinkedService. +func (mls MarketoLinkedService) AsXeroLinkedService() (*XeroLinkedService, bool) { + return nil, false +} + +// AsSquareLinkedService is the BasicLinkedService implementation for MarketoLinkedService. +func (mls MarketoLinkedService) AsSquareLinkedService() (*SquareLinkedService, bool) { + return nil, false +} + +// AsSparkLinkedService is the BasicLinkedService implementation for MarketoLinkedService. +func (mls MarketoLinkedService) AsSparkLinkedService() (*SparkLinkedService, bool) { + return nil, false +} + +// AsShopifyLinkedService is the BasicLinkedService implementation for MarketoLinkedService. +func (mls MarketoLinkedService) AsShopifyLinkedService() (*ShopifyLinkedService, bool) { + return nil, false +} + +// AsServiceNowLinkedService is the BasicLinkedService implementation for MarketoLinkedService. +func (mls MarketoLinkedService) AsServiceNowLinkedService() (*ServiceNowLinkedService, bool) { + return nil, false +} + +// AsQuickBooksLinkedService is the BasicLinkedService implementation for MarketoLinkedService. +func (mls MarketoLinkedService) AsQuickBooksLinkedService() (*QuickBooksLinkedService, bool) { + return nil, false +} + +// AsPrestoLinkedService is the BasicLinkedService implementation for MarketoLinkedService. +func (mls MarketoLinkedService) AsPrestoLinkedService() (*PrestoLinkedService, bool) { + return nil, false +} + +// AsPhoenixLinkedService is the BasicLinkedService implementation for MarketoLinkedService. +func (mls MarketoLinkedService) AsPhoenixLinkedService() (*PhoenixLinkedService, bool) { + return nil, false +} + +// AsPaypalLinkedService is the BasicLinkedService implementation for MarketoLinkedService. +func (mls MarketoLinkedService) AsPaypalLinkedService() (*PaypalLinkedService, bool) { + return nil, false +} + +// AsMarketoLinkedService is the BasicLinkedService implementation for MarketoLinkedService. +func (mls MarketoLinkedService) AsMarketoLinkedService() (*MarketoLinkedService, bool) { + return &mls, true +} + +// AsMariaDBLinkedService is the BasicLinkedService implementation for MarketoLinkedService. +func (mls MarketoLinkedService) AsMariaDBLinkedService() (*MariaDBLinkedService, bool) { + return nil, false +} + +// AsMagentoLinkedService is the BasicLinkedService implementation for MarketoLinkedService. +func (mls MarketoLinkedService) AsMagentoLinkedService() (*MagentoLinkedService, bool) { + return nil, false +} + +// AsJiraLinkedService is the BasicLinkedService implementation for MarketoLinkedService. +func (mls MarketoLinkedService) AsJiraLinkedService() (*JiraLinkedService, bool) { + return nil, false +} + +// AsImpalaLinkedService is the BasicLinkedService implementation for MarketoLinkedService. +func (mls MarketoLinkedService) AsImpalaLinkedService() (*ImpalaLinkedService, bool) { + return nil, false +} + +// AsHubspotLinkedService is the BasicLinkedService implementation for MarketoLinkedService. +func (mls MarketoLinkedService) AsHubspotLinkedService() (*HubspotLinkedService, bool) { + return nil, false +} + +// AsHiveLinkedService is the BasicLinkedService implementation for MarketoLinkedService. +func (mls MarketoLinkedService) AsHiveLinkedService() (*HiveLinkedService, bool) { + return nil, false +} + +// AsHBaseLinkedService is the BasicLinkedService implementation for MarketoLinkedService. +func (mls MarketoLinkedService) AsHBaseLinkedService() (*HBaseLinkedService, bool) { + return nil, false +} + +// AsGreenplumLinkedService is the BasicLinkedService implementation for MarketoLinkedService. +func (mls MarketoLinkedService) AsGreenplumLinkedService() (*GreenplumLinkedService, bool) { + return nil, false +} + +// AsGoogleBigQueryLinkedService is the BasicLinkedService implementation for MarketoLinkedService. +func (mls MarketoLinkedService) AsGoogleBigQueryLinkedService() (*GoogleBigQueryLinkedService, bool) { + return nil, false +} + +// AsEloquaLinkedService is the BasicLinkedService implementation for MarketoLinkedService. +func (mls MarketoLinkedService) AsEloquaLinkedService() (*EloquaLinkedService, bool) { + return nil, false +} + +// AsDrillLinkedService is the BasicLinkedService implementation for MarketoLinkedService. +func (mls MarketoLinkedService) AsDrillLinkedService() (*DrillLinkedService, bool) { + return nil, false +} + +// AsCouchbaseLinkedService is the BasicLinkedService implementation for MarketoLinkedService. +func (mls MarketoLinkedService) AsCouchbaseLinkedService() (*CouchbaseLinkedService, bool) { + return nil, false +} + +// AsConcurLinkedService is the BasicLinkedService implementation for MarketoLinkedService. +func (mls MarketoLinkedService) AsConcurLinkedService() (*ConcurLinkedService, bool) { + return nil, false +} + +// AsAzurePostgreSQLLinkedService is the BasicLinkedService implementation for MarketoLinkedService. +func (mls MarketoLinkedService) AsAzurePostgreSQLLinkedService() (*AzurePostgreSQLLinkedService, bool) { + return nil, false +} + +// AsAmazonMWSLinkedService is the BasicLinkedService implementation for MarketoLinkedService. +func (mls MarketoLinkedService) AsAmazonMWSLinkedService() (*AmazonMWSLinkedService, bool) { + return nil, false +} + +// AsSapHanaLinkedService is the BasicLinkedService implementation for MarketoLinkedService. +func (mls MarketoLinkedService) AsSapHanaLinkedService() (*SapHanaLinkedService, bool) { + return nil, false +} + +// AsSapBWLinkedService is the BasicLinkedService implementation for MarketoLinkedService. +func (mls MarketoLinkedService) AsSapBWLinkedService() (*SapBWLinkedService, bool) { + return nil, false +} + +// AsSftpServerLinkedService is the BasicLinkedService implementation for MarketoLinkedService. +func (mls MarketoLinkedService) AsSftpServerLinkedService() (*SftpServerLinkedService, bool) { + return nil, false +} + +// AsFtpServerLinkedService is the BasicLinkedService implementation for MarketoLinkedService. +func (mls MarketoLinkedService) AsFtpServerLinkedService() (*FtpServerLinkedService, bool) { + return nil, false +} + +// AsHTTPLinkedService is the BasicLinkedService implementation for MarketoLinkedService. +func (mls MarketoLinkedService) AsHTTPLinkedService() (*HTTPLinkedService, bool) { + return nil, false +} + +// AsAzureSearchLinkedService is the BasicLinkedService implementation for MarketoLinkedService. +func (mls MarketoLinkedService) AsAzureSearchLinkedService() (*AzureSearchLinkedService, bool) { + return nil, false +} + +// AsCustomDataSourceLinkedService is the BasicLinkedService implementation for MarketoLinkedService. +func (mls MarketoLinkedService) AsCustomDataSourceLinkedService() (*CustomDataSourceLinkedService, bool) { + return nil, false +} + +// AsAmazonRedshiftLinkedService is the BasicLinkedService implementation for MarketoLinkedService. +func (mls MarketoLinkedService) AsAmazonRedshiftLinkedService() (*AmazonRedshiftLinkedService, bool) { + return nil, false +} + +// AsAmazonS3LinkedService is the BasicLinkedService implementation for MarketoLinkedService. +func (mls MarketoLinkedService) AsAmazonS3LinkedService() (*AmazonS3LinkedService, bool) { + return nil, false +} + +// AsSapEccLinkedService is the BasicLinkedService implementation for MarketoLinkedService. +func (mls MarketoLinkedService) AsSapEccLinkedService() (*SapEccLinkedService, bool) { + return nil, false +} + +// AsSapCloudForCustomerLinkedService is the BasicLinkedService implementation for MarketoLinkedService. +func (mls MarketoLinkedService) AsSapCloudForCustomerLinkedService() (*SapCloudForCustomerLinkedService, bool) { + return nil, false +} + +// AsSalesforceLinkedService is the BasicLinkedService implementation for MarketoLinkedService. +func (mls MarketoLinkedService) AsSalesforceLinkedService() (*SalesforceLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeStoreLinkedService is the BasicLinkedService implementation for MarketoLinkedService. +func (mls MarketoLinkedService) AsAzureDataLakeStoreLinkedService() (*AzureDataLakeStoreLinkedService, bool) { + return nil, false +} + +// AsMongoDbLinkedService is the BasicLinkedService implementation for MarketoLinkedService. +func (mls MarketoLinkedService) AsMongoDbLinkedService() (*MongoDbLinkedService, bool) { + return nil, false +} + +// AsCassandraLinkedService is the BasicLinkedService implementation for MarketoLinkedService. +func (mls MarketoLinkedService) AsCassandraLinkedService() (*CassandraLinkedService, bool) { + return nil, false +} + +// AsWebLinkedService is the BasicLinkedService implementation for MarketoLinkedService. +func (mls MarketoLinkedService) AsWebLinkedService() (*WebLinkedService, bool) { + return nil, false +} + +// AsODataLinkedService is the BasicLinkedService implementation for MarketoLinkedService. +func (mls MarketoLinkedService) AsODataLinkedService() (*ODataLinkedService, bool) { + return nil, false +} + +// AsHdfsLinkedService is the BasicLinkedService implementation for MarketoLinkedService. +func (mls MarketoLinkedService) AsHdfsLinkedService() (*HdfsLinkedService, bool) { + return nil, false +} + +// AsOdbcLinkedService is the BasicLinkedService implementation for MarketoLinkedService. +func (mls MarketoLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, bool) { + return nil, false +} + +// AsAzureMLLinkedService is the BasicLinkedService implementation for MarketoLinkedService. +func (mls MarketoLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { + return nil, false +} + +// AsTeradataLinkedService is the BasicLinkedService implementation for MarketoLinkedService. +func (mls MarketoLinkedService) AsTeradataLinkedService() (*TeradataLinkedService, bool) { + return nil, false +} + +// AsDb2LinkedService is the BasicLinkedService implementation for MarketoLinkedService. +func (mls MarketoLinkedService) AsDb2LinkedService() (*Db2LinkedService, bool) { + return nil, false +} + +// AsSybaseLinkedService is the BasicLinkedService implementation for MarketoLinkedService. +func (mls MarketoLinkedService) AsSybaseLinkedService() (*SybaseLinkedService, bool) { + return nil, false +} + +// AsPostgreSQLLinkedService is the BasicLinkedService implementation for MarketoLinkedService. +func (mls MarketoLinkedService) AsPostgreSQLLinkedService() (*PostgreSQLLinkedService, bool) { + return nil, false +} + +// AsMySQLLinkedService is the BasicLinkedService implementation for MarketoLinkedService. +func (mls MarketoLinkedService) AsMySQLLinkedService() (*MySQLLinkedService, bool) { + return nil, false +} + +// AsAzureMySQLLinkedService is the BasicLinkedService implementation for MarketoLinkedService. +func (mls MarketoLinkedService) AsAzureMySQLLinkedService() (*AzureMySQLLinkedService, bool) { + return nil, false +} + +// AsOracleLinkedService is the BasicLinkedService implementation for MarketoLinkedService. +func (mls MarketoLinkedService) AsOracleLinkedService() (*OracleLinkedService, bool) { + return nil, false +} + +// AsFileServerLinkedService is the BasicLinkedService implementation for MarketoLinkedService. +func (mls MarketoLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { + return nil, false +} + +// AsHDInsightLinkedService is the BasicLinkedService implementation for MarketoLinkedService. +func (mls MarketoLinkedService) AsHDInsightLinkedService() (*HDInsightLinkedService, bool) { + return nil, false +} + +// AsDynamicsLinkedService is the BasicLinkedService implementation for MarketoLinkedService. +func (mls MarketoLinkedService) AsDynamicsLinkedService() (*DynamicsLinkedService, bool) { + return nil, false +} + +// AsCosmosDbLinkedService is the BasicLinkedService implementation for MarketoLinkedService. +func (mls MarketoLinkedService) AsCosmosDbLinkedService() (*CosmosDbLinkedService, bool) { + return nil, false +} + +// AsAzureKeyVaultLinkedService is the BasicLinkedService implementation for MarketoLinkedService. +func (mls MarketoLinkedService) AsAzureKeyVaultLinkedService() (*AzureKeyVaultLinkedService, bool) { + return nil, false +} + +// AsAzureBatchLinkedService is the BasicLinkedService implementation for MarketoLinkedService. +func (mls MarketoLinkedService) AsAzureBatchLinkedService() (*AzureBatchLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDatabaseLinkedService is the BasicLinkedService implementation for MarketoLinkedService. +func (mls MarketoLinkedService) AsAzureSQLDatabaseLinkedService() (*AzureSQLDatabaseLinkedService, bool) { + return nil, false +} + +// AsSQLServerLinkedService is the BasicLinkedService implementation for MarketoLinkedService. +func (mls MarketoLinkedService) AsSQLServerLinkedService() (*SQLServerLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDWLinkedService is the BasicLinkedService implementation for MarketoLinkedService. +func (mls MarketoLinkedService) AsAzureSQLDWLinkedService() (*AzureSQLDWLinkedService, bool) { + return nil, false +} + +// AsAzureStorageLinkedService is the BasicLinkedService implementation for MarketoLinkedService. +func (mls MarketoLinkedService) AsAzureStorageLinkedService() (*AzureStorageLinkedService, bool) { + return nil, false +} + +// AsLinkedService is the BasicLinkedService implementation for MarketoLinkedService. +func (mls MarketoLinkedService) AsLinkedService() (*LinkedService, bool) { + return nil, false +} + +// AsBasicLinkedService is the BasicLinkedService implementation for MarketoLinkedService. +func (mls MarketoLinkedService) AsBasicLinkedService() (BasicLinkedService, bool) { + return &mls, true +} + +// UnmarshalJSON is the custom unmarshaler for MarketoLinkedService struct. +func (mls *MarketoLinkedService) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "typeProperties": + if v != nil { + var marketoLinkedServiceTypeProperties MarketoLinkedServiceTypeProperties + err = json.Unmarshal(*v, &marketoLinkedServiceTypeProperties) + if err != nil { + return err + } + mls.MarketoLinkedServiceTypeProperties = &marketoLinkedServiceTypeProperties + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if mls.AdditionalProperties == nil { + mls.AdditionalProperties = make(map[string]interface{}) + } + mls.AdditionalProperties[k] = additionalProperties + } + case "connectVia": + if v != nil { + var connectVia IntegrationRuntimeReference + err = json.Unmarshal(*v, &connectVia) + if err != nil { + return err + } + mls.ConnectVia = &connectVia + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + mls.Description = &description + } + case "parameters": + if v != nil { + var parameters map[string]*ParameterSpecification + err = json.Unmarshal(*v, ¶meters) + if err != nil { + return err + } + mls.Parameters = parameters + } + case "annotations": + if v != nil { + var annotations []interface{} + err = json.Unmarshal(*v, &annotations) + if err != nil { + return err + } + mls.Annotations = &annotations + } + case "type": + if v != nil { + var typeVar TypeBasicLinkedService + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + mls.Type = typeVar + } + } + } + + return nil +} + +// MarketoLinkedServiceTypeProperties marketo server linked service properties. +type MarketoLinkedServiceTypeProperties struct { + // Endpoint - The endpoint of the Marketo server. (i.e. 123-ABC-321.mktorest.com) + Endpoint interface{} `json:"endpoint,omitempty"` + // ClientID - The client Id of your Marketo service. + ClientID interface{} `json:"clientId,omitempty"` + // ClientSecret - The client secret of your Marketo service. + ClientSecret BasicSecretBase `json:"clientSecret,omitempty"` + // UseEncryptedEndpoints - Specifies whether the data source endpoints are encrypted using HTTPS. The default value is true. + UseEncryptedEndpoints interface{} `json:"useEncryptedEndpoints,omitempty"` + // UseHostVerification - Specifies whether to require the host name in the server's certificate to match the host name of the server when connecting over SSL. The default value is true. + UseHostVerification interface{} `json:"useHostVerification,omitempty"` + // UsePeerVerification - Specifies whether to verify the identity of the server when connecting over SSL. The default value is true. + UsePeerVerification interface{} `json:"usePeerVerification,omitempty"` + // EncryptedCredential - The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string). + EncryptedCredential interface{} `json:"encryptedCredential,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for MarketoLinkedServiceTypeProperties struct. +func (mlstp *MarketoLinkedServiceTypeProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "endpoint": + if v != nil { + var endpoint interface{} + err = json.Unmarshal(*v, &endpoint) + if err != nil { + return err + } + mlstp.Endpoint = endpoint + } + case "clientId": + if v != nil { + var clientID interface{} + err = json.Unmarshal(*v, &clientID) + if err != nil { + return err + } + mlstp.ClientID = clientID + } + case "clientSecret": + if v != nil { + clientSecret, err := unmarshalBasicSecretBase(*v) + if err != nil { + return err + } + mlstp.ClientSecret = clientSecret + } + case "useEncryptedEndpoints": + if v != nil { + var useEncryptedEndpoints interface{} + err = json.Unmarshal(*v, &useEncryptedEndpoints) + if err != nil { + return err + } + mlstp.UseEncryptedEndpoints = useEncryptedEndpoints + } + case "useHostVerification": + if v != nil { + var useHostVerification interface{} + err = json.Unmarshal(*v, &useHostVerification) + if err != nil { + return err + } + mlstp.UseHostVerification = useHostVerification + } + case "usePeerVerification": + if v != nil { + var usePeerVerification interface{} + err = json.Unmarshal(*v, &usePeerVerification) + if err != nil { + return err + } + mlstp.UsePeerVerification = usePeerVerification + } + case "encryptedCredential": + if v != nil { + var encryptedCredential interface{} + err = json.Unmarshal(*v, &encryptedCredential) + if err != nil { + return err + } + mlstp.EncryptedCredential = encryptedCredential + } + } + } + + return nil +} + +// MarketoObjectDataset marketo server dataset. +type MarketoObjectDataset struct { + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Description - Dataset description. + Description *string `json:"description,omitempty"` + // Structure - Columns that define the structure of the dataset. Type: array (or Expression with resultType array), itemType: DatasetDataElement. + Structure interface{} `json:"structure,omitempty"` + // LinkedServiceName - Linked service reference. + LinkedServiceName *LinkedServiceReference `json:"linkedServiceName,omitempty"` + // Parameters - Parameters for dataset. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeDataset', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSQLServerTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSalesforceObject', 'TypeRelationalTable', 'TypeAzureMySQLTable', 'TypeOracleTable', 'TypeODataResource', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeAzureDataLakeStoreFile', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeAmazonS3Object' + Type TypeBasicDataset `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for MarketoObjectDataset. +func (mod MarketoObjectDataset) MarshalJSON() ([]byte, error) { + mod.Type = TypeMarketoObject + objectMap := make(map[string]interface{}) + if mod.Description != nil { + objectMap["description"] = mod.Description + } + objectMap["structure"] = mod.Structure + if mod.LinkedServiceName != nil { + objectMap["linkedServiceName"] = mod.LinkedServiceName + } + if mod.Parameters != nil { + objectMap["parameters"] = mod.Parameters + } + if mod.Annotations != nil { + objectMap["annotations"] = mod.Annotations + } + if mod.Type != "" { + objectMap["type"] = mod.Type + } + for k, v := range mod.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysObjectDataset is the BasicDataset implementation for MarketoObjectDataset. +func (mod MarketoObjectDataset) AsResponsysObjectDataset() (*ResponsysObjectDataset, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudObjectDataset is the BasicDataset implementation for MarketoObjectDataset. +func (mod MarketoObjectDataset) AsSalesforceMarketingCloudObjectDataset() (*SalesforceMarketingCloudObjectDataset, bool) { + return nil, false +} + +// AsVerticaTableDataset is the BasicDataset implementation for MarketoObjectDataset. +func (mod MarketoObjectDataset) AsVerticaTableDataset() (*VerticaTableDataset, bool) { + return nil, false +} + +// AsNetezzaTableDataset is the BasicDataset implementation for MarketoObjectDataset. +func (mod MarketoObjectDataset) AsNetezzaTableDataset() (*NetezzaTableDataset, bool) { + return nil, false +} + +// AsZohoObjectDataset is the BasicDataset implementation for MarketoObjectDataset. +func (mod MarketoObjectDataset) AsZohoObjectDataset() (*ZohoObjectDataset, bool) { + return nil, false +} + +// AsXeroObjectDataset is the BasicDataset implementation for MarketoObjectDataset. +func (mod MarketoObjectDataset) AsXeroObjectDataset() (*XeroObjectDataset, bool) { + return nil, false +} + +// AsSquareObjectDataset is the BasicDataset implementation for MarketoObjectDataset. +func (mod MarketoObjectDataset) AsSquareObjectDataset() (*SquareObjectDataset, bool) { + return nil, false +} + +// AsSparkObjectDataset is the BasicDataset implementation for MarketoObjectDataset. +func (mod MarketoObjectDataset) AsSparkObjectDataset() (*SparkObjectDataset, bool) { + return nil, false +} + +// AsShopifyObjectDataset is the BasicDataset implementation for MarketoObjectDataset. +func (mod MarketoObjectDataset) AsShopifyObjectDataset() (*ShopifyObjectDataset, bool) { + return nil, false +} + +// AsServiceNowObjectDataset is the BasicDataset implementation for MarketoObjectDataset. +func (mod MarketoObjectDataset) AsServiceNowObjectDataset() (*ServiceNowObjectDataset, bool) { + return nil, false +} + +// AsQuickBooksObjectDataset is the BasicDataset implementation for MarketoObjectDataset. +func (mod MarketoObjectDataset) AsQuickBooksObjectDataset() (*QuickBooksObjectDataset, bool) { + return nil, false +} + +// AsPrestoObjectDataset is the BasicDataset implementation for MarketoObjectDataset. +func (mod MarketoObjectDataset) AsPrestoObjectDataset() (*PrestoObjectDataset, bool) { + return nil, false +} + +// AsPhoenixObjectDataset is the BasicDataset implementation for MarketoObjectDataset. +func (mod MarketoObjectDataset) AsPhoenixObjectDataset() (*PhoenixObjectDataset, bool) { + return nil, false +} + +// AsPaypalObjectDataset is the BasicDataset implementation for MarketoObjectDataset. +func (mod MarketoObjectDataset) AsPaypalObjectDataset() (*PaypalObjectDataset, bool) { + return nil, false +} + +// AsMarketoObjectDataset is the BasicDataset implementation for MarketoObjectDataset. +func (mod MarketoObjectDataset) AsMarketoObjectDataset() (*MarketoObjectDataset, bool) { + return &mod, true +} + +// AsMariaDBTableDataset is the BasicDataset implementation for MarketoObjectDataset. +func (mod MarketoObjectDataset) AsMariaDBTableDataset() (*MariaDBTableDataset, bool) { + return nil, false +} + +// AsMagentoObjectDataset is the BasicDataset implementation for MarketoObjectDataset. +func (mod MarketoObjectDataset) AsMagentoObjectDataset() (*MagentoObjectDataset, bool) { + return nil, false +} + +// AsJiraObjectDataset is the BasicDataset implementation for MarketoObjectDataset. +func (mod MarketoObjectDataset) AsJiraObjectDataset() (*JiraObjectDataset, bool) { + return nil, false +} + +// AsImpalaObjectDataset is the BasicDataset implementation for MarketoObjectDataset. +func (mod MarketoObjectDataset) AsImpalaObjectDataset() (*ImpalaObjectDataset, bool) { + return nil, false +} + +// AsHubspotObjectDataset is the BasicDataset implementation for MarketoObjectDataset. +func (mod MarketoObjectDataset) AsHubspotObjectDataset() (*HubspotObjectDataset, bool) { + return nil, false +} + +// AsHiveObjectDataset is the BasicDataset implementation for MarketoObjectDataset. +func (mod MarketoObjectDataset) AsHiveObjectDataset() (*HiveObjectDataset, bool) { + return nil, false +} + +// AsHBaseObjectDataset is the BasicDataset implementation for MarketoObjectDataset. +func (mod MarketoObjectDataset) AsHBaseObjectDataset() (*HBaseObjectDataset, bool) { + return nil, false +} + +// AsGreenplumTableDataset is the BasicDataset implementation for MarketoObjectDataset. +func (mod MarketoObjectDataset) AsGreenplumTableDataset() (*GreenplumTableDataset, bool) { + return nil, false +} + +// AsGoogleBigQueryObjectDataset is the BasicDataset implementation for MarketoObjectDataset. +func (mod MarketoObjectDataset) AsGoogleBigQueryObjectDataset() (*GoogleBigQueryObjectDataset, bool) { + return nil, false +} + +// AsEloquaObjectDataset is the BasicDataset implementation for MarketoObjectDataset. +func (mod MarketoObjectDataset) AsEloquaObjectDataset() (*EloquaObjectDataset, bool) { + return nil, false +} + +// AsDrillTableDataset is the BasicDataset implementation for MarketoObjectDataset. +func (mod MarketoObjectDataset) AsDrillTableDataset() (*DrillTableDataset, bool) { + return nil, false +} + +// AsCouchbaseTableDataset is the BasicDataset implementation for MarketoObjectDataset. +func (mod MarketoObjectDataset) AsCouchbaseTableDataset() (*CouchbaseTableDataset, bool) { + return nil, false +} + +// AsConcurObjectDataset is the BasicDataset implementation for MarketoObjectDataset. +func (mod MarketoObjectDataset) AsConcurObjectDataset() (*ConcurObjectDataset, bool) { + return nil, false +} + +// AsAzurePostgreSQLTableDataset is the BasicDataset implementation for MarketoObjectDataset. +func (mod MarketoObjectDataset) AsAzurePostgreSQLTableDataset() (*AzurePostgreSQLTableDataset, bool) { + return nil, false +} + +// AsAmazonMWSObjectDataset is the BasicDataset implementation for MarketoObjectDataset. +func (mod MarketoObjectDataset) AsAmazonMWSObjectDataset() (*AmazonMWSObjectDataset, bool) { + return nil, false +} + +// AsHTTPDataset is the BasicDataset implementation for MarketoObjectDataset. +func (mod MarketoObjectDataset) AsHTTPDataset() (*HTTPDataset, bool) { + return nil, false +} + +// AsAzureSearchIndexDataset is the BasicDataset implementation for MarketoObjectDataset. +func (mod MarketoObjectDataset) AsAzureSearchIndexDataset() (*AzureSearchIndexDataset, bool) { + return nil, false +} + +// AsWebTableDataset is the BasicDataset implementation for MarketoObjectDataset. +func (mod MarketoObjectDataset) AsWebTableDataset() (*WebTableDataset, bool) { + return nil, false +} + +// AsSQLServerTableDataset is the BasicDataset implementation for MarketoObjectDataset. +func (mod MarketoObjectDataset) AsSQLServerTableDataset() (*SQLServerTableDataset, bool) { + return nil, false +} + +// AsSapEccResourceDataset is the BasicDataset implementation for MarketoObjectDataset. +func (mod MarketoObjectDataset) AsSapEccResourceDataset() (*SapEccResourceDataset, bool) { + return nil, false +} + +// AsSapCloudForCustomerResourceDataset is the BasicDataset implementation for MarketoObjectDataset. +func (mod MarketoObjectDataset) AsSapCloudForCustomerResourceDataset() (*SapCloudForCustomerResourceDataset, bool) { + return nil, false +} + +// AsSalesforceObjectDataset is the BasicDataset implementation for MarketoObjectDataset. +func (mod MarketoObjectDataset) AsSalesforceObjectDataset() (*SalesforceObjectDataset, bool) { + return nil, false +} + +// AsRelationalTableDataset is the BasicDataset implementation for MarketoObjectDataset. +func (mod MarketoObjectDataset) AsRelationalTableDataset() (*RelationalTableDataset, bool) { + return nil, false +} + +// AsAzureMySQLTableDataset is the BasicDataset implementation for MarketoObjectDataset. +func (mod MarketoObjectDataset) AsAzureMySQLTableDataset() (*AzureMySQLTableDataset, bool) { + return nil, false +} + +// AsOracleTableDataset is the BasicDataset implementation for MarketoObjectDataset. +func (mod MarketoObjectDataset) AsOracleTableDataset() (*OracleTableDataset, bool) { + return nil, false +} + +// AsODataResourceDataset is the BasicDataset implementation for MarketoObjectDataset. +func (mod MarketoObjectDataset) AsODataResourceDataset() (*ODataResourceDataset, bool) { + return nil, false +} + +// AsMongoDbCollectionDataset is the BasicDataset implementation for MarketoObjectDataset. +func (mod MarketoObjectDataset) AsMongoDbCollectionDataset() (*MongoDbCollectionDataset, bool) { + return nil, false +} + +// AsFileShareDataset is the BasicDataset implementation for MarketoObjectDataset. +func (mod MarketoObjectDataset) AsFileShareDataset() (*FileShareDataset, bool) { + return nil, false +} + +// AsAzureDataLakeStoreDataset is the BasicDataset implementation for MarketoObjectDataset. +func (mod MarketoObjectDataset) AsAzureDataLakeStoreDataset() (*AzureDataLakeStoreDataset, bool) { + return nil, false +} + +// AsDynamicsEntityDataset is the BasicDataset implementation for MarketoObjectDataset. +func (mod MarketoObjectDataset) AsDynamicsEntityDataset() (*DynamicsEntityDataset, bool) { + return nil, false +} + +// AsDocumentDbCollectionDataset is the BasicDataset implementation for MarketoObjectDataset. +func (mod MarketoObjectDataset) AsDocumentDbCollectionDataset() (*DocumentDbCollectionDataset, bool) { + return nil, false +} + +// AsCustomDataset is the BasicDataset implementation for MarketoObjectDataset. +func (mod MarketoObjectDataset) AsCustomDataset() (*CustomDataset, bool) { + return nil, false +} + +// AsCassandraTableDataset is the BasicDataset implementation for MarketoObjectDataset. +func (mod MarketoObjectDataset) AsCassandraTableDataset() (*CassandraTableDataset, bool) { + return nil, false +} + +// AsAzureSQLDWTableDataset is the BasicDataset implementation for MarketoObjectDataset. +func (mod MarketoObjectDataset) AsAzureSQLDWTableDataset() (*AzureSQLDWTableDataset, bool) { + return nil, false +} + +// AsAzureSQLTableDataset is the BasicDataset implementation for MarketoObjectDataset. +func (mod MarketoObjectDataset) AsAzureSQLTableDataset() (*AzureSQLTableDataset, bool) { + return nil, false +} + +// AsAzureTableDataset is the BasicDataset implementation for MarketoObjectDataset. +func (mod MarketoObjectDataset) AsAzureTableDataset() (*AzureTableDataset, bool) { + return nil, false +} + +// AsAzureBlobDataset is the BasicDataset implementation for MarketoObjectDataset. +func (mod MarketoObjectDataset) AsAzureBlobDataset() (*AzureBlobDataset, bool) { + return nil, false +} + +// AsAmazonS3Dataset is the BasicDataset implementation for MarketoObjectDataset. +func (mod MarketoObjectDataset) AsAmazonS3Dataset() (*AmazonS3Dataset, bool) { + return nil, false +} + +// AsDataset is the BasicDataset implementation for MarketoObjectDataset. +func (mod MarketoObjectDataset) AsDataset() (*Dataset, bool) { + return nil, false +} + +// AsBasicDataset is the BasicDataset implementation for MarketoObjectDataset. +func (mod MarketoObjectDataset) AsBasicDataset() (BasicDataset, bool) { + return &mod, true +} + +// MarketoSource a copy activity Marketo server source. +type MarketoSource struct { + // Query - A query to retrieve data from source. Type: string (or Expression with resultType string). + Query interface{} `json:"query,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // SourceRetryCount - Source retry count. Type: integer (or Expression with resultType integer). + SourceRetryCount interface{} `json:"sourceRetryCount,omitempty"` + // SourceRetryWait - Source retry wait. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` + // Type - Possible values include: 'TypeCopySource', 'TypeAmazonRedshiftSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeHTTPSource', 'TypeAzureDataLakeStoreSource', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeRelationalSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource' + Type TypeBasicCopySource `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for MarketoSource. +func (ms MarketoSource) MarshalJSON() ([]byte, error) { + ms.Type = TypeMarketoSource + objectMap := make(map[string]interface{}) + objectMap["query"] = ms.Query + objectMap["sourceRetryCount"] = ms.SourceRetryCount + objectMap["sourceRetryWait"] = ms.SourceRetryWait + if ms.Type != "" { + objectMap["type"] = ms.Type + } + for k, v := range ms.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsAmazonRedshiftSource is the BasicCopySource implementation for MarketoSource. +func (ms MarketoSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { + return nil, false +} + +// AsResponsysSource is the BasicCopySource implementation for MarketoSource. +func (ms MarketoSource) AsResponsysSource() (*ResponsysSource, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudSource is the BasicCopySource implementation for MarketoSource. +func (ms MarketoSource) AsSalesforceMarketingCloudSource() (*SalesforceMarketingCloudSource, bool) { + return nil, false +} + +// AsVerticaSource is the BasicCopySource implementation for MarketoSource. +func (ms MarketoSource) AsVerticaSource() (*VerticaSource, bool) { + return nil, false +} + +// AsNetezzaSource is the BasicCopySource implementation for MarketoSource. +func (ms MarketoSource) AsNetezzaSource() (*NetezzaSource, bool) { + return nil, false +} + +// AsZohoSource is the BasicCopySource implementation for MarketoSource. +func (ms MarketoSource) AsZohoSource() (*ZohoSource, bool) { + return nil, false +} + +// AsXeroSource is the BasicCopySource implementation for MarketoSource. +func (ms MarketoSource) AsXeroSource() (*XeroSource, bool) { + return nil, false +} + +// AsSquareSource is the BasicCopySource implementation for MarketoSource. +func (ms MarketoSource) AsSquareSource() (*SquareSource, bool) { + return nil, false +} + +// AsSparkSource is the BasicCopySource implementation for MarketoSource. +func (ms MarketoSource) AsSparkSource() (*SparkSource, bool) { + return nil, false +} + +// AsShopifySource is the BasicCopySource implementation for MarketoSource. +func (ms MarketoSource) AsShopifySource() (*ShopifySource, bool) { + return nil, false +} + +// AsServiceNowSource is the BasicCopySource implementation for MarketoSource. +func (ms MarketoSource) AsServiceNowSource() (*ServiceNowSource, bool) { + return nil, false +} + +// AsQuickBooksSource is the BasicCopySource implementation for MarketoSource. +func (ms MarketoSource) AsQuickBooksSource() (*QuickBooksSource, bool) { + return nil, false +} + +// AsPrestoSource is the BasicCopySource implementation for MarketoSource. +func (ms MarketoSource) AsPrestoSource() (*PrestoSource, bool) { + return nil, false +} + +// AsPhoenixSource is the BasicCopySource implementation for MarketoSource. +func (ms MarketoSource) AsPhoenixSource() (*PhoenixSource, bool) { + return nil, false +} + +// AsPaypalSource is the BasicCopySource implementation for MarketoSource. +func (ms MarketoSource) AsPaypalSource() (*PaypalSource, bool) { + return nil, false +} + +// AsMarketoSource is the BasicCopySource implementation for MarketoSource. +func (ms MarketoSource) AsMarketoSource() (*MarketoSource, bool) { + return &ms, true +} + +// AsMariaDBSource is the BasicCopySource implementation for MarketoSource. +func (ms MarketoSource) AsMariaDBSource() (*MariaDBSource, bool) { + return nil, false +} + +// AsMagentoSource is the BasicCopySource implementation for MarketoSource. +func (ms MarketoSource) AsMagentoSource() (*MagentoSource, bool) { + return nil, false +} + +// AsJiraSource is the BasicCopySource implementation for MarketoSource. +func (ms MarketoSource) AsJiraSource() (*JiraSource, bool) { + return nil, false +} + +// AsImpalaSource is the BasicCopySource implementation for MarketoSource. +func (ms MarketoSource) AsImpalaSource() (*ImpalaSource, bool) { + return nil, false +} + +// AsHubspotSource is the BasicCopySource implementation for MarketoSource. +func (ms MarketoSource) AsHubspotSource() (*HubspotSource, bool) { + return nil, false +} + +// AsHiveSource is the BasicCopySource implementation for MarketoSource. +func (ms MarketoSource) AsHiveSource() (*HiveSource, bool) { + return nil, false +} + +// AsHBaseSource is the BasicCopySource implementation for MarketoSource. +func (ms MarketoSource) AsHBaseSource() (*HBaseSource, bool) { + return nil, false +} + +// AsGreenplumSource is the BasicCopySource implementation for MarketoSource. +func (ms MarketoSource) AsGreenplumSource() (*GreenplumSource, bool) { + return nil, false +} + +// AsGoogleBigQuerySource is the BasicCopySource implementation for MarketoSource. +func (ms MarketoSource) AsGoogleBigQuerySource() (*GoogleBigQuerySource, bool) { + return nil, false +} + +// AsEloquaSource is the BasicCopySource implementation for MarketoSource. +func (ms MarketoSource) AsEloquaSource() (*EloquaSource, bool) { + return nil, false +} + +// AsDrillSource is the BasicCopySource implementation for MarketoSource. +func (ms MarketoSource) AsDrillSource() (*DrillSource, bool) { + return nil, false +} + +// AsCouchbaseSource is the BasicCopySource implementation for MarketoSource. +func (ms MarketoSource) AsCouchbaseSource() (*CouchbaseSource, bool) { + return nil, false +} + +// AsConcurSource is the BasicCopySource implementation for MarketoSource. +func (ms MarketoSource) AsConcurSource() (*ConcurSource, bool) { + return nil, false +} + +// AsAzurePostgreSQLSource is the BasicCopySource implementation for MarketoSource. +func (ms MarketoSource) AsAzurePostgreSQLSource() (*AzurePostgreSQLSource, bool) { + return nil, false +} + +// AsAmazonMWSSource is the BasicCopySource implementation for MarketoSource. +func (ms MarketoSource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { + return nil, false +} + +// AsHTTPSource is the BasicCopySource implementation for MarketoSource. +func (ms MarketoSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for MarketoSource. +func (ms MarketoSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for MarketoSource. +func (ms MarketoSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsCassandraSource is the BasicCopySource implementation for MarketoSource. +func (ms MarketoSource) AsCassandraSource() (*CassandraSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for MarketoSource. +func (ms MarketoSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for MarketoSource. +func (ms MarketoSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureMySQLSource is the BasicCopySource implementation for MarketoSource. +func (ms MarketoSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for MarketoSource. +func (ms MarketoSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for MarketoSource. +func (ms MarketoSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsSQLDWSource is the BasicCopySource implementation for MarketoSource. +func (ms MarketoSource) AsSQLDWSource() (*SQLDWSource, bool) { + return nil, false +} + +// AsSQLSource is the BasicCopySource implementation for MarketoSource. +func (ms MarketoSource) AsSQLSource() (*SQLSource, bool) { + return nil, false +} + +// AsSapEccSource is the BasicCopySource implementation for MarketoSource. +func (ms MarketoSource) AsSapEccSource() (*SapEccSource, bool) { + return nil, false +} + +// AsSapCloudForCustomerSource is the BasicCopySource implementation for MarketoSource. +func (ms MarketoSource) AsSapCloudForCustomerSource() (*SapCloudForCustomerSource, bool) { + return nil, false +} + +// AsSalesforceSource is the BasicCopySource implementation for MarketoSource. +func (ms MarketoSource) AsSalesforceSource() (*SalesforceSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for MarketoSource. +func (ms MarketoSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for MarketoSource. +func (ms MarketoSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for MarketoSource. +func (ms MarketoSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for MarketoSource. +func (ms MarketoSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + +// AsAzureTableSource is the BasicCopySource implementation for MarketoSource. +func (ms MarketoSource) AsAzureTableSource() (*AzureTableSource, bool) { + return nil, false +} + +// AsCopySource is the BasicCopySource implementation for MarketoSource. +func (ms MarketoSource) AsCopySource() (*CopySource, bool) { + return nil, false +} + +// AsBasicCopySource is the BasicCopySource implementation for MarketoSource. +func (ms MarketoSource) AsBasicCopySource() (BasicCopySource, bool) { + return &ms, true +} + +// MongoDbCollectionDataset the MongoDB database dataset. +type MongoDbCollectionDataset struct { + // MongoDbCollectionDatasetTypeProperties - MongoDB database dataset properties. + *MongoDbCollectionDatasetTypeProperties `json:"typeProperties,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Description - Dataset description. + Description *string `json:"description,omitempty"` + // Structure - Columns that define the structure of the dataset. Type: array (or Expression with resultType array), itemType: DatasetDataElement. + Structure interface{} `json:"structure,omitempty"` + // LinkedServiceName - Linked service reference. + LinkedServiceName *LinkedServiceReference `json:"linkedServiceName,omitempty"` + // Parameters - Parameters for dataset. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeDataset', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSQLServerTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSalesforceObject', 'TypeRelationalTable', 'TypeAzureMySQLTable', 'TypeOracleTable', 'TypeODataResource', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeAzureDataLakeStoreFile', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeAmazonS3Object' + Type TypeBasicDataset `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for MongoDbCollectionDataset. +func (mdcd MongoDbCollectionDataset) MarshalJSON() ([]byte, error) { + mdcd.Type = TypeMongoDbCollection + objectMap := make(map[string]interface{}) + if mdcd.MongoDbCollectionDatasetTypeProperties != nil { + objectMap["typeProperties"] = mdcd.MongoDbCollectionDatasetTypeProperties + } + if mdcd.Description != nil { + objectMap["description"] = mdcd.Description + } + objectMap["structure"] = mdcd.Structure + if mdcd.LinkedServiceName != nil { + objectMap["linkedServiceName"] = mdcd.LinkedServiceName + } + if mdcd.Parameters != nil { + objectMap["parameters"] = mdcd.Parameters + } + if mdcd.Annotations != nil { + objectMap["annotations"] = mdcd.Annotations + } + if mdcd.Type != "" { + objectMap["type"] = mdcd.Type + } + for k, v := range mdcd.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysObjectDataset is the BasicDataset implementation for MongoDbCollectionDataset. +func (mdcd MongoDbCollectionDataset) AsResponsysObjectDataset() (*ResponsysObjectDataset, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudObjectDataset is the BasicDataset implementation for MongoDbCollectionDataset. +func (mdcd MongoDbCollectionDataset) AsSalesforceMarketingCloudObjectDataset() (*SalesforceMarketingCloudObjectDataset, bool) { + return nil, false +} + +// AsVerticaTableDataset is the BasicDataset implementation for MongoDbCollectionDataset. +func (mdcd MongoDbCollectionDataset) AsVerticaTableDataset() (*VerticaTableDataset, bool) { + return nil, false +} + +// AsNetezzaTableDataset is the BasicDataset implementation for MongoDbCollectionDataset. +func (mdcd MongoDbCollectionDataset) AsNetezzaTableDataset() (*NetezzaTableDataset, bool) { + return nil, false +} + +// AsZohoObjectDataset is the BasicDataset implementation for MongoDbCollectionDataset. +func (mdcd MongoDbCollectionDataset) AsZohoObjectDataset() (*ZohoObjectDataset, bool) { + return nil, false +} + +// AsXeroObjectDataset is the BasicDataset implementation for MongoDbCollectionDataset. +func (mdcd MongoDbCollectionDataset) AsXeroObjectDataset() (*XeroObjectDataset, bool) { + return nil, false +} + +// AsSquareObjectDataset is the BasicDataset implementation for MongoDbCollectionDataset. +func (mdcd MongoDbCollectionDataset) AsSquareObjectDataset() (*SquareObjectDataset, bool) { + return nil, false +} + +// AsSparkObjectDataset is the BasicDataset implementation for MongoDbCollectionDataset. +func (mdcd MongoDbCollectionDataset) AsSparkObjectDataset() (*SparkObjectDataset, bool) { + return nil, false +} + +// AsShopifyObjectDataset is the BasicDataset implementation for MongoDbCollectionDataset. +func (mdcd MongoDbCollectionDataset) AsShopifyObjectDataset() (*ShopifyObjectDataset, bool) { + return nil, false +} + +// AsServiceNowObjectDataset is the BasicDataset implementation for MongoDbCollectionDataset. +func (mdcd MongoDbCollectionDataset) AsServiceNowObjectDataset() (*ServiceNowObjectDataset, bool) { + return nil, false +} + +// AsQuickBooksObjectDataset is the BasicDataset implementation for MongoDbCollectionDataset. +func (mdcd MongoDbCollectionDataset) AsQuickBooksObjectDataset() (*QuickBooksObjectDataset, bool) { + return nil, false +} + +// AsPrestoObjectDataset is the BasicDataset implementation for MongoDbCollectionDataset. +func (mdcd MongoDbCollectionDataset) AsPrestoObjectDataset() (*PrestoObjectDataset, bool) { + return nil, false +} + +// AsPhoenixObjectDataset is the BasicDataset implementation for MongoDbCollectionDataset. +func (mdcd MongoDbCollectionDataset) AsPhoenixObjectDataset() (*PhoenixObjectDataset, bool) { + return nil, false +} + +// AsPaypalObjectDataset is the BasicDataset implementation for MongoDbCollectionDataset. +func (mdcd MongoDbCollectionDataset) AsPaypalObjectDataset() (*PaypalObjectDataset, bool) { + return nil, false +} + +// AsMarketoObjectDataset is the BasicDataset implementation for MongoDbCollectionDataset. +func (mdcd MongoDbCollectionDataset) AsMarketoObjectDataset() (*MarketoObjectDataset, bool) { + return nil, false +} + +// AsMariaDBTableDataset is the BasicDataset implementation for MongoDbCollectionDataset. +func (mdcd MongoDbCollectionDataset) AsMariaDBTableDataset() (*MariaDBTableDataset, bool) { + return nil, false +} + +// AsMagentoObjectDataset is the BasicDataset implementation for MongoDbCollectionDataset. +func (mdcd MongoDbCollectionDataset) AsMagentoObjectDataset() (*MagentoObjectDataset, bool) { + return nil, false +} + +// AsJiraObjectDataset is the BasicDataset implementation for MongoDbCollectionDataset. +func (mdcd MongoDbCollectionDataset) AsJiraObjectDataset() (*JiraObjectDataset, bool) { + return nil, false +} + +// AsImpalaObjectDataset is the BasicDataset implementation for MongoDbCollectionDataset. +func (mdcd MongoDbCollectionDataset) AsImpalaObjectDataset() (*ImpalaObjectDataset, bool) { + return nil, false +} + +// AsHubspotObjectDataset is the BasicDataset implementation for MongoDbCollectionDataset. +func (mdcd MongoDbCollectionDataset) AsHubspotObjectDataset() (*HubspotObjectDataset, bool) { + return nil, false +} + +// AsHiveObjectDataset is the BasicDataset implementation for MongoDbCollectionDataset. +func (mdcd MongoDbCollectionDataset) AsHiveObjectDataset() (*HiveObjectDataset, bool) { + return nil, false +} + +// AsHBaseObjectDataset is the BasicDataset implementation for MongoDbCollectionDataset. +func (mdcd MongoDbCollectionDataset) AsHBaseObjectDataset() (*HBaseObjectDataset, bool) { + return nil, false +} + +// AsGreenplumTableDataset is the BasicDataset implementation for MongoDbCollectionDataset. +func (mdcd MongoDbCollectionDataset) AsGreenplumTableDataset() (*GreenplumTableDataset, bool) { + return nil, false +} + +// AsGoogleBigQueryObjectDataset is the BasicDataset implementation for MongoDbCollectionDataset. +func (mdcd MongoDbCollectionDataset) AsGoogleBigQueryObjectDataset() (*GoogleBigQueryObjectDataset, bool) { + return nil, false +} + +// AsEloquaObjectDataset is the BasicDataset implementation for MongoDbCollectionDataset. +func (mdcd MongoDbCollectionDataset) AsEloquaObjectDataset() (*EloquaObjectDataset, bool) { + return nil, false +} + +// AsDrillTableDataset is the BasicDataset implementation for MongoDbCollectionDataset. +func (mdcd MongoDbCollectionDataset) AsDrillTableDataset() (*DrillTableDataset, bool) { + return nil, false +} + +// AsCouchbaseTableDataset is the BasicDataset implementation for MongoDbCollectionDataset. +func (mdcd MongoDbCollectionDataset) AsCouchbaseTableDataset() (*CouchbaseTableDataset, bool) { + return nil, false +} + +// AsConcurObjectDataset is the BasicDataset implementation for MongoDbCollectionDataset. +func (mdcd MongoDbCollectionDataset) AsConcurObjectDataset() (*ConcurObjectDataset, bool) { + return nil, false +} + +// AsAzurePostgreSQLTableDataset is the BasicDataset implementation for MongoDbCollectionDataset. +func (mdcd MongoDbCollectionDataset) AsAzurePostgreSQLTableDataset() (*AzurePostgreSQLTableDataset, bool) { + return nil, false +} + +// AsAmazonMWSObjectDataset is the BasicDataset implementation for MongoDbCollectionDataset. +func (mdcd MongoDbCollectionDataset) AsAmazonMWSObjectDataset() (*AmazonMWSObjectDataset, bool) { + return nil, false +} + +// AsHTTPDataset is the BasicDataset implementation for MongoDbCollectionDataset. +func (mdcd MongoDbCollectionDataset) AsHTTPDataset() (*HTTPDataset, bool) { + return nil, false +} + +// AsAzureSearchIndexDataset is the BasicDataset implementation for MongoDbCollectionDataset. +func (mdcd MongoDbCollectionDataset) AsAzureSearchIndexDataset() (*AzureSearchIndexDataset, bool) { + return nil, false +} + +// AsWebTableDataset is the BasicDataset implementation for MongoDbCollectionDataset. +func (mdcd MongoDbCollectionDataset) AsWebTableDataset() (*WebTableDataset, bool) { + return nil, false +} + +// AsSQLServerTableDataset is the BasicDataset implementation for MongoDbCollectionDataset. +func (mdcd MongoDbCollectionDataset) AsSQLServerTableDataset() (*SQLServerTableDataset, bool) { + return nil, false +} + +// AsSapEccResourceDataset is the BasicDataset implementation for MongoDbCollectionDataset. +func (mdcd MongoDbCollectionDataset) AsSapEccResourceDataset() (*SapEccResourceDataset, bool) { + return nil, false +} + +// AsSapCloudForCustomerResourceDataset is the BasicDataset implementation for MongoDbCollectionDataset. +func (mdcd MongoDbCollectionDataset) AsSapCloudForCustomerResourceDataset() (*SapCloudForCustomerResourceDataset, bool) { + return nil, false +} + +// AsSalesforceObjectDataset is the BasicDataset implementation for MongoDbCollectionDataset. +func (mdcd MongoDbCollectionDataset) AsSalesforceObjectDataset() (*SalesforceObjectDataset, bool) { + return nil, false +} + +// AsRelationalTableDataset is the BasicDataset implementation for MongoDbCollectionDataset. +func (mdcd MongoDbCollectionDataset) AsRelationalTableDataset() (*RelationalTableDataset, bool) { + return nil, false +} + +// AsAzureMySQLTableDataset is the BasicDataset implementation for MongoDbCollectionDataset. +func (mdcd MongoDbCollectionDataset) AsAzureMySQLTableDataset() (*AzureMySQLTableDataset, bool) { + return nil, false +} + +// AsOracleTableDataset is the BasicDataset implementation for MongoDbCollectionDataset. +func (mdcd MongoDbCollectionDataset) AsOracleTableDataset() (*OracleTableDataset, bool) { + return nil, false +} + +// AsODataResourceDataset is the BasicDataset implementation for MongoDbCollectionDataset. +func (mdcd MongoDbCollectionDataset) AsODataResourceDataset() (*ODataResourceDataset, bool) { + return nil, false +} + +// AsMongoDbCollectionDataset is the BasicDataset implementation for MongoDbCollectionDataset. +func (mdcd MongoDbCollectionDataset) AsMongoDbCollectionDataset() (*MongoDbCollectionDataset, bool) { + return &mdcd, true +} + +// AsFileShareDataset is the BasicDataset implementation for MongoDbCollectionDataset. +func (mdcd MongoDbCollectionDataset) AsFileShareDataset() (*FileShareDataset, bool) { + return nil, false +} + +// AsAzureDataLakeStoreDataset is the BasicDataset implementation for MongoDbCollectionDataset. +func (mdcd MongoDbCollectionDataset) AsAzureDataLakeStoreDataset() (*AzureDataLakeStoreDataset, bool) { + return nil, false +} + +// AsDynamicsEntityDataset is the BasicDataset implementation for MongoDbCollectionDataset. +func (mdcd MongoDbCollectionDataset) AsDynamicsEntityDataset() (*DynamicsEntityDataset, bool) { + return nil, false +} + +// AsDocumentDbCollectionDataset is the BasicDataset implementation for MongoDbCollectionDataset. +func (mdcd MongoDbCollectionDataset) AsDocumentDbCollectionDataset() (*DocumentDbCollectionDataset, bool) { + return nil, false +} + +// AsCustomDataset is the BasicDataset implementation for MongoDbCollectionDataset. +func (mdcd MongoDbCollectionDataset) AsCustomDataset() (*CustomDataset, bool) { + return nil, false +} + +// AsCassandraTableDataset is the BasicDataset implementation for MongoDbCollectionDataset. +func (mdcd MongoDbCollectionDataset) AsCassandraTableDataset() (*CassandraTableDataset, bool) { + return nil, false +} + +// AsAzureSQLDWTableDataset is the BasicDataset implementation for MongoDbCollectionDataset. +func (mdcd MongoDbCollectionDataset) AsAzureSQLDWTableDataset() (*AzureSQLDWTableDataset, bool) { + return nil, false +} + +// AsAzureSQLTableDataset is the BasicDataset implementation for MongoDbCollectionDataset. +func (mdcd MongoDbCollectionDataset) AsAzureSQLTableDataset() (*AzureSQLTableDataset, bool) { + return nil, false +} + +// AsAzureTableDataset is the BasicDataset implementation for MongoDbCollectionDataset. +func (mdcd MongoDbCollectionDataset) AsAzureTableDataset() (*AzureTableDataset, bool) { + return nil, false +} + +// AsAzureBlobDataset is the BasicDataset implementation for MongoDbCollectionDataset. +func (mdcd MongoDbCollectionDataset) AsAzureBlobDataset() (*AzureBlobDataset, bool) { + return nil, false +} + +// AsAmazonS3Dataset is the BasicDataset implementation for MongoDbCollectionDataset. +func (mdcd MongoDbCollectionDataset) AsAmazonS3Dataset() (*AmazonS3Dataset, bool) { + return nil, false +} + +// AsDataset is the BasicDataset implementation for MongoDbCollectionDataset. +func (mdcd MongoDbCollectionDataset) AsDataset() (*Dataset, bool) { + return nil, false +} + +// AsBasicDataset is the BasicDataset implementation for MongoDbCollectionDataset. +func (mdcd MongoDbCollectionDataset) AsBasicDataset() (BasicDataset, bool) { + return &mdcd, true +} + +// UnmarshalJSON is the custom unmarshaler for MongoDbCollectionDataset struct. +func (mdcd *MongoDbCollectionDataset) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "typeProperties": + if v != nil { + var mongoDbCollectionDatasetTypeProperties MongoDbCollectionDatasetTypeProperties + err = json.Unmarshal(*v, &mongoDbCollectionDatasetTypeProperties) + if err != nil { + return err + } + mdcd.MongoDbCollectionDatasetTypeProperties = &mongoDbCollectionDatasetTypeProperties + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if mdcd.AdditionalProperties == nil { + mdcd.AdditionalProperties = make(map[string]interface{}) + } + mdcd.AdditionalProperties[k] = additionalProperties + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + mdcd.Description = &description + } + case "structure": + if v != nil { + var structure interface{} + err = json.Unmarshal(*v, &structure) + if err != nil { + return err + } + mdcd.Structure = structure + } + case "linkedServiceName": + if v != nil { + var linkedServiceName LinkedServiceReference + err = json.Unmarshal(*v, &linkedServiceName) + if err != nil { + return err + } + mdcd.LinkedServiceName = &linkedServiceName + } + case "parameters": + if v != nil { + var parameters map[string]*ParameterSpecification + err = json.Unmarshal(*v, ¶meters) + if err != nil { + return err + } + mdcd.Parameters = parameters + } + case "annotations": + if v != nil { + var annotations []interface{} + err = json.Unmarshal(*v, &annotations) + if err != nil { + return err + } + mdcd.Annotations = &annotations + } + case "type": + if v != nil { + var typeVar TypeBasicDataset + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + mdcd.Type = typeVar + } + } + } + + return nil +} + +// MongoDbCollectionDatasetTypeProperties mongoDB database dataset properties. +type MongoDbCollectionDatasetTypeProperties struct { + // CollectionName - The table name of the MongoDB database. Type: string (or Expression with resultType string). + CollectionName interface{} `json:"collectionName,omitempty"` +} + +// MongoDbLinkedService linked service for MongoDb data source. +type MongoDbLinkedService struct { + // MongoDbLinkedServiceTypeProperties - MongoDB linked service properties. + *MongoDbLinkedServiceTypeProperties `json:"typeProperties,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // ConnectVia - The integration runtime reference. + ConnectVia *IntegrationRuntimeReference `json:"connectVia,omitempty"` + // Description - Linked service description. + Description *string `json:"description,omitempty"` + // Parameters - Parameters for linked service. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeLinkedService', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforce', 'TypeAzureDataLakeStore', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureStorage' + Type TypeBasicLinkedService `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for MongoDbLinkedService. +func (mdls MongoDbLinkedService) MarshalJSON() ([]byte, error) { + mdls.Type = TypeMongoDb + objectMap := make(map[string]interface{}) + if mdls.MongoDbLinkedServiceTypeProperties != nil { + objectMap["typeProperties"] = mdls.MongoDbLinkedServiceTypeProperties + } + if mdls.ConnectVia != nil { + objectMap["connectVia"] = mdls.ConnectVia + } + if mdls.Description != nil { + objectMap["description"] = mdls.Description + } + if mdls.Parameters != nil { + objectMap["parameters"] = mdls.Parameters + } + if mdls.Annotations != nil { + objectMap["annotations"] = mdls.Annotations + } + if mdls.Type != "" { + objectMap["type"] = mdls.Type + } + for k, v := range mdls.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysLinkedService is the BasicLinkedService implementation for MongoDbLinkedService. +func (mdls MongoDbLinkedService) AsResponsysLinkedService() (*ResponsysLinkedService, bool) { + return nil, false +} + +// AsAzureDatabricksLinkedService is the BasicLinkedService implementation for MongoDbLinkedService. +func (mdls MongoDbLinkedService) AsAzureDatabricksLinkedService() (*AzureDatabricksLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeAnalyticsLinkedService is the BasicLinkedService implementation for MongoDbLinkedService. +func (mdls MongoDbLinkedService) AsAzureDataLakeAnalyticsLinkedService() (*AzureDataLakeAnalyticsLinkedService, bool) { + return nil, false +} + +// AsHDInsightOnDemandLinkedService is the BasicLinkedService implementation for MongoDbLinkedService. +func (mdls MongoDbLinkedService) AsHDInsightOnDemandLinkedService() (*HDInsightOnDemandLinkedService, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudLinkedService is the BasicLinkedService implementation for MongoDbLinkedService. +func (mdls MongoDbLinkedService) AsSalesforceMarketingCloudLinkedService() (*SalesforceMarketingCloudLinkedService, bool) { + return nil, false +} + +// AsNetezzaLinkedService is the BasicLinkedService implementation for MongoDbLinkedService. +func (mdls MongoDbLinkedService) AsNetezzaLinkedService() (*NetezzaLinkedService, bool) { + return nil, false +} + +// AsVerticaLinkedService is the BasicLinkedService implementation for MongoDbLinkedService. +func (mdls MongoDbLinkedService) AsVerticaLinkedService() (*VerticaLinkedService, bool) { + return nil, false +} + +// AsZohoLinkedService is the BasicLinkedService implementation for MongoDbLinkedService. +func (mdls MongoDbLinkedService) AsZohoLinkedService() (*ZohoLinkedService, bool) { + return nil, false +} + +// AsXeroLinkedService is the BasicLinkedService implementation for MongoDbLinkedService. +func (mdls MongoDbLinkedService) AsXeroLinkedService() (*XeroLinkedService, bool) { + return nil, false +} + +// AsSquareLinkedService is the BasicLinkedService implementation for MongoDbLinkedService. +func (mdls MongoDbLinkedService) AsSquareLinkedService() (*SquareLinkedService, bool) { + return nil, false +} + +// AsSparkLinkedService is the BasicLinkedService implementation for MongoDbLinkedService. +func (mdls MongoDbLinkedService) AsSparkLinkedService() (*SparkLinkedService, bool) { + return nil, false +} + +// AsShopifyLinkedService is the BasicLinkedService implementation for MongoDbLinkedService. +func (mdls MongoDbLinkedService) AsShopifyLinkedService() (*ShopifyLinkedService, bool) { + return nil, false +} + +// AsServiceNowLinkedService is the BasicLinkedService implementation for MongoDbLinkedService. +func (mdls MongoDbLinkedService) AsServiceNowLinkedService() (*ServiceNowLinkedService, bool) { + return nil, false +} + +// AsQuickBooksLinkedService is the BasicLinkedService implementation for MongoDbLinkedService. +func (mdls MongoDbLinkedService) AsQuickBooksLinkedService() (*QuickBooksLinkedService, bool) { + return nil, false +} + +// AsPrestoLinkedService is the BasicLinkedService implementation for MongoDbLinkedService. +func (mdls MongoDbLinkedService) AsPrestoLinkedService() (*PrestoLinkedService, bool) { + return nil, false +} + +// AsPhoenixLinkedService is the BasicLinkedService implementation for MongoDbLinkedService. +func (mdls MongoDbLinkedService) AsPhoenixLinkedService() (*PhoenixLinkedService, bool) { + return nil, false +} + +// AsPaypalLinkedService is the BasicLinkedService implementation for MongoDbLinkedService. +func (mdls MongoDbLinkedService) AsPaypalLinkedService() (*PaypalLinkedService, bool) { + return nil, false +} + +// AsMarketoLinkedService is the BasicLinkedService implementation for MongoDbLinkedService. +func (mdls MongoDbLinkedService) AsMarketoLinkedService() (*MarketoLinkedService, bool) { + return nil, false +} + +// AsMariaDBLinkedService is the BasicLinkedService implementation for MongoDbLinkedService. +func (mdls MongoDbLinkedService) AsMariaDBLinkedService() (*MariaDBLinkedService, bool) { + return nil, false +} + +// AsMagentoLinkedService is the BasicLinkedService implementation for MongoDbLinkedService. +func (mdls MongoDbLinkedService) AsMagentoLinkedService() (*MagentoLinkedService, bool) { + return nil, false +} + +// AsJiraLinkedService is the BasicLinkedService implementation for MongoDbLinkedService. +func (mdls MongoDbLinkedService) AsJiraLinkedService() (*JiraLinkedService, bool) { + return nil, false +} + +// AsImpalaLinkedService is the BasicLinkedService implementation for MongoDbLinkedService. +func (mdls MongoDbLinkedService) AsImpalaLinkedService() (*ImpalaLinkedService, bool) { + return nil, false +} + +// AsHubspotLinkedService is the BasicLinkedService implementation for MongoDbLinkedService. +func (mdls MongoDbLinkedService) AsHubspotLinkedService() (*HubspotLinkedService, bool) { + return nil, false +} + +// AsHiveLinkedService is the BasicLinkedService implementation for MongoDbLinkedService. +func (mdls MongoDbLinkedService) AsHiveLinkedService() (*HiveLinkedService, bool) { + return nil, false +} + +// AsHBaseLinkedService is the BasicLinkedService implementation for MongoDbLinkedService. +func (mdls MongoDbLinkedService) AsHBaseLinkedService() (*HBaseLinkedService, bool) { + return nil, false +} + +// AsGreenplumLinkedService is the BasicLinkedService implementation for MongoDbLinkedService. +func (mdls MongoDbLinkedService) AsGreenplumLinkedService() (*GreenplumLinkedService, bool) { + return nil, false +} + +// AsGoogleBigQueryLinkedService is the BasicLinkedService implementation for MongoDbLinkedService. +func (mdls MongoDbLinkedService) AsGoogleBigQueryLinkedService() (*GoogleBigQueryLinkedService, bool) { + return nil, false +} + +// AsEloquaLinkedService is the BasicLinkedService implementation for MongoDbLinkedService. +func (mdls MongoDbLinkedService) AsEloquaLinkedService() (*EloquaLinkedService, bool) { + return nil, false +} + +// AsDrillLinkedService is the BasicLinkedService implementation for MongoDbLinkedService. +func (mdls MongoDbLinkedService) AsDrillLinkedService() (*DrillLinkedService, bool) { + return nil, false +} + +// AsCouchbaseLinkedService is the BasicLinkedService implementation for MongoDbLinkedService. +func (mdls MongoDbLinkedService) AsCouchbaseLinkedService() (*CouchbaseLinkedService, bool) { + return nil, false +} + +// AsConcurLinkedService is the BasicLinkedService implementation for MongoDbLinkedService. +func (mdls MongoDbLinkedService) AsConcurLinkedService() (*ConcurLinkedService, bool) { + return nil, false +} + +// AsAzurePostgreSQLLinkedService is the BasicLinkedService implementation for MongoDbLinkedService. +func (mdls MongoDbLinkedService) AsAzurePostgreSQLLinkedService() (*AzurePostgreSQLLinkedService, bool) { + return nil, false +} + +// AsAmazonMWSLinkedService is the BasicLinkedService implementation for MongoDbLinkedService. +func (mdls MongoDbLinkedService) AsAmazonMWSLinkedService() (*AmazonMWSLinkedService, bool) { + return nil, false +} + +// AsSapHanaLinkedService is the BasicLinkedService implementation for MongoDbLinkedService. +func (mdls MongoDbLinkedService) AsSapHanaLinkedService() (*SapHanaLinkedService, bool) { + return nil, false +} + +// AsSapBWLinkedService is the BasicLinkedService implementation for MongoDbLinkedService. +func (mdls MongoDbLinkedService) AsSapBWLinkedService() (*SapBWLinkedService, bool) { + return nil, false +} + +// AsSftpServerLinkedService is the BasicLinkedService implementation for MongoDbLinkedService. +func (mdls MongoDbLinkedService) AsSftpServerLinkedService() (*SftpServerLinkedService, bool) { + return nil, false +} + +// AsFtpServerLinkedService is the BasicLinkedService implementation for MongoDbLinkedService. +func (mdls MongoDbLinkedService) AsFtpServerLinkedService() (*FtpServerLinkedService, bool) { + return nil, false +} + +// AsHTTPLinkedService is the BasicLinkedService implementation for MongoDbLinkedService. +func (mdls MongoDbLinkedService) AsHTTPLinkedService() (*HTTPLinkedService, bool) { + return nil, false +} + +// AsAzureSearchLinkedService is the BasicLinkedService implementation for MongoDbLinkedService. +func (mdls MongoDbLinkedService) AsAzureSearchLinkedService() (*AzureSearchLinkedService, bool) { + return nil, false +} + +// AsCustomDataSourceLinkedService is the BasicLinkedService implementation for MongoDbLinkedService. +func (mdls MongoDbLinkedService) AsCustomDataSourceLinkedService() (*CustomDataSourceLinkedService, bool) { + return nil, false +} + +// AsAmazonRedshiftLinkedService is the BasicLinkedService implementation for MongoDbLinkedService. +func (mdls MongoDbLinkedService) AsAmazonRedshiftLinkedService() (*AmazonRedshiftLinkedService, bool) { + return nil, false +} + +// AsAmazonS3LinkedService is the BasicLinkedService implementation for MongoDbLinkedService. +func (mdls MongoDbLinkedService) AsAmazonS3LinkedService() (*AmazonS3LinkedService, bool) { + return nil, false +} + +// AsSapEccLinkedService is the BasicLinkedService implementation for MongoDbLinkedService. +func (mdls MongoDbLinkedService) AsSapEccLinkedService() (*SapEccLinkedService, bool) { + return nil, false +} + +// AsSapCloudForCustomerLinkedService is the BasicLinkedService implementation for MongoDbLinkedService. +func (mdls MongoDbLinkedService) AsSapCloudForCustomerLinkedService() (*SapCloudForCustomerLinkedService, bool) { + return nil, false +} + +// AsSalesforceLinkedService is the BasicLinkedService implementation for MongoDbLinkedService. +func (mdls MongoDbLinkedService) AsSalesforceLinkedService() (*SalesforceLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeStoreLinkedService is the BasicLinkedService implementation for MongoDbLinkedService. +func (mdls MongoDbLinkedService) AsAzureDataLakeStoreLinkedService() (*AzureDataLakeStoreLinkedService, bool) { + return nil, false +} + +// AsMongoDbLinkedService is the BasicLinkedService implementation for MongoDbLinkedService. +func (mdls MongoDbLinkedService) AsMongoDbLinkedService() (*MongoDbLinkedService, bool) { + return &mdls, true +} + +// AsCassandraLinkedService is the BasicLinkedService implementation for MongoDbLinkedService. +func (mdls MongoDbLinkedService) AsCassandraLinkedService() (*CassandraLinkedService, bool) { + return nil, false +} + +// AsWebLinkedService is the BasicLinkedService implementation for MongoDbLinkedService. +func (mdls MongoDbLinkedService) AsWebLinkedService() (*WebLinkedService, bool) { + return nil, false +} + +// AsODataLinkedService is the BasicLinkedService implementation for MongoDbLinkedService. +func (mdls MongoDbLinkedService) AsODataLinkedService() (*ODataLinkedService, bool) { + return nil, false +} + +// AsHdfsLinkedService is the BasicLinkedService implementation for MongoDbLinkedService. +func (mdls MongoDbLinkedService) AsHdfsLinkedService() (*HdfsLinkedService, bool) { + return nil, false +} + +// AsOdbcLinkedService is the BasicLinkedService implementation for MongoDbLinkedService. +func (mdls MongoDbLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, bool) { + return nil, false +} + +// AsAzureMLLinkedService is the BasicLinkedService implementation for MongoDbLinkedService. +func (mdls MongoDbLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { + return nil, false +} + +// AsTeradataLinkedService is the BasicLinkedService implementation for MongoDbLinkedService. +func (mdls MongoDbLinkedService) AsTeradataLinkedService() (*TeradataLinkedService, bool) { + return nil, false +} + +// AsDb2LinkedService is the BasicLinkedService implementation for MongoDbLinkedService. +func (mdls MongoDbLinkedService) AsDb2LinkedService() (*Db2LinkedService, bool) { + return nil, false +} + +// AsSybaseLinkedService is the BasicLinkedService implementation for MongoDbLinkedService. +func (mdls MongoDbLinkedService) AsSybaseLinkedService() (*SybaseLinkedService, bool) { + return nil, false +} + +// AsPostgreSQLLinkedService is the BasicLinkedService implementation for MongoDbLinkedService. +func (mdls MongoDbLinkedService) AsPostgreSQLLinkedService() (*PostgreSQLLinkedService, bool) { + return nil, false +} + +// AsMySQLLinkedService is the BasicLinkedService implementation for MongoDbLinkedService. +func (mdls MongoDbLinkedService) AsMySQLLinkedService() (*MySQLLinkedService, bool) { + return nil, false +} + +// AsAzureMySQLLinkedService is the BasicLinkedService implementation for MongoDbLinkedService. +func (mdls MongoDbLinkedService) AsAzureMySQLLinkedService() (*AzureMySQLLinkedService, bool) { + return nil, false +} + +// AsOracleLinkedService is the BasicLinkedService implementation for MongoDbLinkedService. +func (mdls MongoDbLinkedService) AsOracleLinkedService() (*OracleLinkedService, bool) { + return nil, false +} + +// AsFileServerLinkedService is the BasicLinkedService implementation for MongoDbLinkedService. +func (mdls MongoDbLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { + return nil, false +} + +// AsHDInsightLinkedService is the BasicLinkedService implementation for MongoDbLinkedService. +func (mdls MongoDbLinkedService) AsHDInsightLinkedService() (*HDInsightLinkedService, bool) { + return nil, false +} + +// AsDynamicsLinkedService is the BasicLinkedService implementation for MongoDbLinkedService. +func (mdls MongoDbLinkedService) AsDynamicsLinkedService() (*DynamicsLinkedService, bool) { + return nil, false +} + +// AsCosmosDbLinkedService is the BasicLinkedService implementation for MongoDbLinkedService. +func (mdls MongoDbLinkedService) AsCosmosDbLinkedService() (*CosmosDbLinkedService, bool) { + return nil, false +} + +// AsAzureKeyVaultLinkedService is the BasicLinkedService implementation for MongoDbLinkedService. +func (mdls MongoDbLinkedService) AsAzureKeyVaultLinkedService() (*AzureKeyVaultLinkedService, bool) { + return nil, false +} + +// AsAzureBatchLinkedService is the BasicLinkedService implementation for MongoDbLinkedService. +func (mdls MongoDbLinkedService) AsAzureBatchLinkedService() (*AzureBatchLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDatabaseLinkedService is the BasicLinkedService implementation for MongoDbLinkedService. +func (mdls MongoDbLinkedService) AsAzureSQLDatabaseLinkedService() (*AzureSQLDatabaseLinkedService, bool) { + return nil, false +} + +// AsSQLServerLinkedService is the BasicLinkedService implementation for MongoDbLinkedService. +func (mdls MongoDbLinkedService) AsSQLServerLinkedService() (*SQLServerLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDWLinkedService is the BasicLinkedService implementation for MongoDbLinkedService. +func (mdls MongoDbLinkedService) AsAzureSQLDWLinkedService() (*AzureSQLDWLinkedService, bool) { + return nil, false +} + +// AsAzureStorageLinkedService is the BasicLinkedService implementation for MongoDbLinkedService. +func (mdls MongoDbLinkedService) AsAzureStorageLinkedService() (*AzureStorageLinkedService, bool) { + return nil, false +} + +// AsLinkedService is the BasicLinkedService implementation for MongoDbLinkedService. +func (mdls MongoDbLinkedService) AsLinkedService() (*LinkedService, bool) { + return nil, false +} + +// AsBasicLinkedService is the BasicLinkedService implementation for MongoDbLinkedService. +func (mdls MongoDbLinkedService) AsBasicLinkedService() (BasicLinkedService, bool) { + return &mdls, true +} + +// UnmarshalJSON is the custom unmarshaler for MongoDbLinkedService struct. +func (mdls *MongoDbLinkedService) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "typeProperties": + if v != nil { + var mongoDbLinkedServiceTypeProperties MongoDbLinkedServiceTypeProperties + err = json.Unmarshal(*v, &mongoDbLinkedServiceTypeProperties) + if err != nil { + return err + } + mdls.MongoDbLinkedServiceTypeProperties = &mongoDbLinkedServiceTypeProperties + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if mdls.AdditionalProperties == nil { + mdls.AdditionalProperties = make(map[string]interface{}) + } + mdls.AdditionalProperties[k] = additionalProperties + } + case "connectVia": + if v != nil { + var connectVia IntegrationRuntimeReference + err = json.Unmarshal(*v, &connectVia) + if err != nil { + return err + } + mdls.ConnectVia = &connectVia + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + mdls.Description = &description + } + case "parameters": + if v != nil { + var parameters map[string]*ParameterSpecification + err = json.Unmarshal(*v, ¶meters) + if err != nil { + return err + } + mdls.Parameters = parameters + } + case "annotations": + if v != nil { + var annotations []interface{} + err = json.Unmarshal(*v, &annotations) + if err != nil { + return err + } + mdls.Annotations = &annotations + } + case "type": + if v != nil { + var typeVar TypeBasicLinkedService + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + mdls.Type = typeVar + } + } + } + + return nil +} + +// MongoDbLinkedServiceTypeProperties mongoDB linked service properties. +type MongoDbLinkedServiceTypeProperties struct { + // Server - The IP address or server name of the MongoDB server. Type: string (or Expression with resultType string). + Server interface{} `json:"server,omitempty"` + // AuthenticationType - The authentication type to be used to connect to the MongoDB database. Possible values include: 'MongoDbAuthenticationTypeBasic', 'MongoDbAuthenticationTypeAnonymous' + AuthenticationType MongoDbAuthenticationType `json:"authenticationType,omitempty"` + // DatabaseName - The name of the MongoDB database that you want to access. Type: string (or Expression with resultType string). + DatabaseName interface{} `json:"databaseName,omitempty"` + // Username - Username for authentication. Type: string (or Expression with resultType string). + Username interface{} `json:"username,omitempty"` + // Password - Password for authentication. + Password BasicSecretBase `json:"password,omitempty"` + // AuthSource - Database to verify the username and password. Type: string (or Expression with resultType string). + AuthSource interface{} `json:"authSource,omitempty"` + // Port - The TCP port number that the MongoDB server uses to listen for client connections. The default value is 27017. Type: integer (or Expression with resultType integer), minimum: 0. + Port interface{} `json:"port,omitempty"` + // EnableSsl - Specifies whether the connections to the server are encrypted using SSL. The default value is false. Type: boolean (or Expression with resultType boolean). + EnableSsl interface{} `json:"enableSsl,omitempty"` + // AllowSelfSignedServerCert - Specifies whether to allow self-signed certificates from the server. The default value is false. Type: boolean (or Expression with resultType boolean). + AllowSelfSignedServerCert interface{} `json:"allowSelfSignedServerCert,omitempty"` + // EncryptedCredential - The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string). + EncryptedCredential interface{} `json:"encryptedCredential,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for MongoDbLinkedServiceTypeProperties struct. +func (mdlstp *MongoDbLinkedServiceTypeProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "server": + if v != nil { + var server interface{} + err = json.Unmarshal(*v, &server) + if err != nil { + return err + } + mdlstp.Server = server + } + case "authenticationType": + if v != nil { + var authenticationType MongoDbAuthenticationType + err = json.Unmarshal(*v, &authenticationType) + if err != nil { + return err + } + mdlstp.AuthenticationType = authenticationType + } + case "databaseName": + if v != nil { + var databaseName interface{} + err = json.Unmarshal(*v, &databaseName) + if err != nil { + return err + } + mdlstp.DatabaseName = databaseName + } + case "username": + if v != nil { + var username interface{} + err = json.Unmarshal(*v, &username) + if err != nil { + return err + } + mdlstp.Username = username + } + case "password": + if v != nil { + password, err := unmarshalBasicSecretBase(*v) + if err != nil { + return err + } + mdlstp.Password = password + } + case "authSource": + if v != nil { + var authSource interface{} + err = json.Unmarshal(*v, &authSource) + if err != nil { + return err + } + mdlstp.AuthSource = authSource + } + case "port": + if v != nil { + var port interface{} + err = json.Unmarshal(*v, &port) + if err != nil { + return err + } + mdlstp.Port = port + } + case "enableSsl": + if v != nil { + var enableSsl interface{} + err = json.Unmarshal(*v, &enableSsl) + if err != nil { + return err + } + mdlstp.EnableSsl = enableSsl + } + case "allowSelfSignedServerCert": + if v != nil { + var allowSelfSignedServerCert interface{} + err = json.Unmarshal(*v, &allowSelfSignedServerCert) + if err != nil { + return err + } + mdlstp.AllowSelfSignedServerCert = allowSelfSignedServerCert + } + case "encryptedCredential": + if v != nil { + var encryptedCredential interface{} + err = json.Unmarshal(*v, &encryptedCredential) + if err != nil { + return err + } + mdlstp.EncryptedCredential = encryptedCredential + } + } + } + + return nil +} + +// MongoDbSource a copy activity source for a MongoDB database. +type MongoDbSource struct { + // Query - Database query. Should be a SQL-92 query expression. Type: string (or Expression with resultType string). + Query interface{} `json:"query,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // SourceRetryCount - Source retry count. Type: integer (or Expression with resultType integer). + SourceRetryCount interface{} `json:"sourceRetryCount,omitempty"` + // SourceRetryWait - Source retry wait. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` + // Type - Possible values include: 'TypeCopySource', 'TypeAmazonRedshiftSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeHTTPSource', 'TypeAzureDataLakeStoreSource', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeRelationalSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource' + Type TypeBasicCopySource `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for MongoDbSource. +func (mds MongoDbSource) MarshalJSON() ([]byte, error) { + mds.Type = TypeMongoDbSource + objectMap := make(map[string]interface{}) + objectMap["query"] = mds.Query + objectMap["sourceRetryCount"] = mds.SourceRetryCount + objectMap["sourceRetryWait"] = mds.SourceRetryWait + if mds.Type != "" { + objectMap["type"] = mds.Type + } + for k, v := range mds.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsAmazonRedshiftSource is the BasicCopySource implementation for MongoDbSource. +func (mds MongoDbSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { + return nil, false +} + +// AsResponsysSource is the BasicCopySource implementation for MongoDbSource. +func (mds MongoDbSource) AsResponsysSource() (*ResponsysSource, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudSource is the BasicCopySource implementation for MongoDbSource. +func (mds MongoDbSource) AsSalesforceMarketingCloudSource() (*SalesforceMarketingCloudSource, bool) { + return nil, false +} + +// AsVerticaSource is the BasicCopySource implementation for MongoDbSource. +func (mds MongoDbSource) AsVerticaSource() (*VerticaSource, bool) { + return nil, false +} + +// AsNetezzaSource is the BasicCopySource implementation for MongoDbSource. +func (mds MongoDbSource) AsNetezzaSource() (*NetezzaSource, bool) { + return nil, false +} + +// AsZohoSource is the BasicCopySource implementation for MongoDbSource. +func (mds MongoDbSource) AsZohoSource() (*ZohoSource, bool) { + return nil, false +} + +// AsXeroSource is the BasicCopySource implementation for MongoDbSource. +func (mds MongoDbSource) AsXeroSource() (*XeroSource, bool) { + return nil, false +} + +// AsSquareSource is the BasicCopySource implementation for MongoDbSource. +func (mds MongoDbSource) AsSquareSource() (*SquareSource, bool) { + return nil, false +} + +// AsSparkSource is the BasicCopySource implementation for MongoDbSource. +func (mds MongoDbSource) AsSparkSource() (*SparkSource, bool) { + return nil, false +} + +// AsShopifySource is the BasicCopySource implementation for MongoDbSource. +func (mds MongoDbSource) AsShopifySource() (*ShopifySource, bool) { + return nil, false +} + +// AsServiceNowSource is the BasicCopySource implementation for MongoDbSource. +func (mds MongoDbSource) AsServiceNowSource() (*ServiceNowSource, bool) { + return nil, false +} + +// AsQuickBooksSource is the BasicCopySource implementation for MongoDbSource. +func (mds MongoDbSource) AsQuickBooksSource() (*QuickBooksSource, bool) { + return nil, false +} + +// AsPrestoSource is the BasicCopySource implementation for MongoDbSource. +func (mds MongoDbSource) AsPrestoSource() (*PrestoSource, bool) { + return nil, false +} + +// AsPhoenixSource is the BasicCopySource implementation for MongoDbSource. +func (mds MongoDbSource) AsPhoenixSource() (*PhoenixSource, bool) { + return nil, false +} + +// AsPaypalSource is the BasicCopySource implementation for MongoDbSource. +func (mds MongoDbSource) AsPaypalSource() (*PaypalSource, bool) { + return nil, false +} + +// AsMarketoSource is the BasicCopySource implementation for MongoDbSource. +func (mds MongoDbSource) AsMarketoSource() (*MarketoSource, bool) { + return nil, false +} + +// AsMariaDBSource is the BasicCopySource implementation for MongoDbSource. +func (mds MongoDbSource) AsMariaDBSource() (*MariaDBSource, bool) { + return nil, false +} + +// AsMagentoSource is the BasicCopySource implementation for MongoDbSource. +func (mds MongoDbSource) AsMagentoSource() (*MagentoSource, bool) { + return nil, false +} + +// AsJiraSource is the BasicCopySource implementation for MongoDbSource. +func (mds MongoDbSource) AsJiraSource() (*JiraSource, bool) { + return nil, false +} + +// AsImpalaSource is the BasicCopySource implementation for MongoDbSource. +func (mds MongoDbSource) AsImpalaSource() (*ImpalaSource, bool) { + return nil, false +} + +// AsHubspotSource is the BasicCopySource implementation for MongoDbSource. +func (mds MongoDbSource) AsHubspotSource() (*HubspotSource, bool) { + return nil, false +} + +// AsHiveSource is the BasicCopySource implementation for MongoDbSource. +func (mds MongoDbSource) AsHiveSource() (*HiveSource, bool) { + return nil, false +} + +// AsHBaseSource is the BasicCopySource implementation for MongoDbSource. +func (mds MongoDbSource) AsHBaseSource() (*HBaseSource, bool) { + return nil, false +} + +// AsGreenplumSource is the BasicCopySource implementation for MongoDbSource. +func (mds MongoDbSource) AsGreenplumSource() (*GreenplumSource, bool) { + return nil, false +} + +// AsGoogleBigQuerySource is the BasicCopySource implementation for MongoDbSource. +func (mds MongoDbSource) AsGoogleBigQuerySource() (*GoogleBigQuerySource, bool) { + return nil, false +} + +// AsEloquaSource is the BasicCopySource implementation for MongoDbSource. +func (mds MongoDbSource) AsEloquaSource() (*EloquaSource, bool) { + return nil, false +} + +// AsDrillSource is the BasicCopySource implementation for MongoDbSource. +func (mds MongoDbSource) AsDrillSource() (*DrillSource, bool) { + return nil, false +} + +// AsCouchbaseSource is the BasicCopySource implementation for MongoDbSource. +func (mds MongoDbSource) AsCouchbaseSource() (*CouchbaseSource, bool) { + return nil, false +} + +// AsConcurSource is the BasicCopySource implementation for MongoDbSource. +func (mds MongoDbSource) AsConcurSource() (*ConcurSource, bool) { + return nil, false +} + +// AsAzurePostgreSQLSource is the BasicCopySource implementation for MongoDbSource. +func (mds MongoDbSource) AsAzurePostgreSQLSource() (*AzurePostgreSQLSource, bool) { + return nil, false +} + +// AsAmazonMWSSource is the BasicCopySource implementation for MongoDbSource. +func (mds MongoDbSource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { + return nil, false +} + +// AsHTTPSource is the BasicCopySource implementation for MongoDbSource. +func (mds MongoDbSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for MongoDbSource. +func (mds MongoDbSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for MongoDbSource. +func (mds MongoDbSource) AsMongoDbSource() (*MongoDbSource, bool) { + return &mds, true +} + +// AsCassandraSource is the BasicCopySource implementation for MongoDbSource. +func (mds MongoDbSource) AsCassandraSource() (*CassandraSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for MongoDbSource. +func (mds MongoDbSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for MongoDbSource. +func (mds MongoDbSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureMySQLSource is the BasicCopySource implementation for MongoDbSource. +func (mds MongoDbSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for MongoDbSource. +func (mds MongoDbSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for MongoDbSource. +func (mds MongoDbSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsSQLDWSource is the BasicCopySource implementation for MongoDbSource. +func (mds MongoDbSource) AsSQLDWSource() (*SQLDWSource, bool) { + return nil, false +} + +// AsSQLSource is the BasicCopySource implementation for MongoDbSource. +func (mds MongoDbSource) AsSQLSource() (*SQLSource, bool) { + return nil, false +} + +// AsSapEccSource is the BasicCopySource implementation for MongoDbSource. +func (mds MongoDbSource) AsSapEccSource() (*SapEccSource, bool) { + return nil, false +} + +// AsSapCloudForCustomerSource is the BasicCopySource implementation for MongoDbSource. +func (mds MongoDbSource) AsSapCloudForCustomerSource() (*SapCloudForCustomerSource, bool) { + return nil, false +} + +// AsSalesforceSource is the BasicCopySource implementation for MongoDbSource. +func (mds MongoDbSource) AsSalesforceSource() (*SalesforceSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for MongoDbSource. +func (mds MongoDbSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for MongoDbSource. +func (mds MongoDbSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for MongoDbSource. +func (mds MongoDbSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for MongoDbSource. +func (mds MongoDbSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + +// AsAzureTableSource is the BasicCopySource implementation for MongoDbSource. +func (mds MongoDbSource) AsAzureTableSource() (*AzureTableSource, bool) { + return nil, false +} + +// AsCopySource is the BasicCopySource implementation for MongoDbSource. +func (mds MongoDbSource) AsCopySource() (*CopySource, bool) { + return nil, false +} + +// AsBasicCopySource is the BasicCopySource implementation for MongoDbSource. +func (mds MongoDbSource) AsBasicCopySource() (BasicCopySource, bool) { + return &mds, true +} + +// BasicMultiplePipelineTrigger base class for all triggers that support one to many model for trigger to pipeline. +type BasicMultiplePipelineTrigger interface { + AsBlobEventsTrigger() (*BlobEventsTrigger, bool) + AsBlobTrigger() (*BlobTrigger, bool) + AsScheduleTrigger() (*ScheduleTrigger, bool) + AsMultiplePipelineTrigger() (*MultiplePipelineTrigger, bool) +} + +// MultiplePipelineTrigger base class for all triggers that support one to many model for trigger to pipeline. +type MultiplePipelineTrigger struct { + // Pipelines - Pipelines that need to be started. + Pipelines *[]TriggerPipelineReference `json:"pipelines,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Description - Trigger description. + Description *string `json:"description,omitempty"` + // RuntimeState - Indicates if trigger is running or not. Updated when Start/Stop APIs are called on the Trigger. Possible values include: 'TriggerRuntimeStateStarted', 'TriggerRuntimeStateStopped', 'TriggerRuntimeStateDisabled' + RuntimeState TriggerRuntimeState `json:"runtimeState,omitempty"` + // Type - Possible values include: 'TypeTrigger', 'TypeTumblingWindowTrigger', 'TypeBlobEventsTrigger', 'TypeBlobTrigger', 'TypeScheduleTrigger', 'TypeMultiplePipelineTrigger' + Type TypeBasicTrigger `json:"type,omitempty"` +} + +func unmarshalBasicMultiplePipelineTrigger(body []byte) (BasicMultiplePipelineTrigger, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["type"] { + case string(TypeBlobEventsTrigger): + var bet BlobEventsTrigger + err := json.Unmarshal(body, &bet) + return bet, err + case string(TypeBlobTrigger): + var bt BlobTrigger + err := json.Unmarshal(body, &bt) + return bt, err + case string(TypeScheduleTrigger): + var st ScheduleTrigger + err := json.Unmarshal(body, &st) + return st, err + default: + var mpt MultiplePipelineTrigger + err := json.Unmarshal(body, &mpt) + return mpt, err + } +} +func unmarshalBasicMultiplePipelineTriggerArray(body []byte) ([]BasicMultiplePipelineTrigger, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + mptArray := make([]BasicMultiplePipelineTrigger, len(rawMessages)) + + for index, rawMessage := range rawMessages { + mpt, err := unmarshalBasicMultiplePipelineTrigger(*rawMessage) + if err != nil { + return nil, err + } + mptArray[index] = mpt + } + return mptArray, nil +} + +// MarshalJSON is the custom marshaler for MultiplePipelineTrigger. +func (mpt MultiplePipelineTrigger) MarshalJSON() ([]byte, error) { + mpt.Type = TypeMultiplePipelineTrigger + objectMap := make(map[string]interface{}) + if mpt.Pipelines != nil { + objectMap["pipelines"] = mpt.Pipelines + } + if mpt.Description != nil { + objectMap["description"] = mpt.Description + } + if mpt.RuntimeState != "" { + objectMap["runtimeState"] = mpt.RuntimeState + } + if mpt.Type != "" { + objectMap["type"] = mpt.Type + } + for k, v := range mpt.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsTumblingWindowTrigger is the BasicTrigger implementation for MultiplePipelineTrigger. +func (mpt MultiplePipelineTrigger) AsTumblingWindowTrigger() (*TumblingWindowTrigger, bool) { + return nil, false +} + +// AsBlobEventsTrigger is the BasicTrigger implementation for MultiplePipelineTrigger. +func (mpt MultiplePipelineTrigger) AsBlobEventsTrigger() (*BlobEventsTrigger, bool) { + return nil, false +} + +// AsBlobTrigger is the BasicTrigger implementation for MultiplePipelineTrigger. +func (mpt MultiplePipelineTrigger) AsBlobTrigger() (*BlobTrigger, bool) { + return nil, false +} + +// AsScheduleTrigger is the BasicTrigger implementation for MultiplePipelineTrigger. +func (mpt MultiplePipelineTrigger) AsScheduleTrigger() (*ScheduleTrigger, bool) { + return nil, false +} + +// AsMultiplePipelineTrigger is the BasicTrigger implementation for MultiplePipelineTrigger. +func (mpt MultiplePipelineTrigger) AsMultiplePipelineTrigger() (*MultiplePipelineTrigger, bool) { + return &mpt, true +} + +// AsBasicMultiplePipelineTrigger is the BasicTrigger implementation for MultiplePipelineTrigger. +func (mpt MultiplePipelineTrigger) AsBasicMultiplePipelineTrigger() (BasicMultiplePipelineTrigger, bool) { + return &mpt, true +} + +// AsTrigger is the BasicTrigger implementation for MultiplePipelineTrigger. +func (mpt MultiplePipelineTrigger) AsTrigger() (*Trigger, bool) { + return nil, false +} + +// AsBasicTrigger is the BasicTrigger implementation for MultiplePipelineTrigger. +func (mpt MultiplePipelineTrigger) AsBasicTrigger() (BasicTrigger, bool) { + return &mpt, true +} + +// MySQLLinkedService linked service for MySQL data source. +type MySQLLinkedService struct { + // MySQLLinkedServiceTypeProperties - MySQL linked service properties. + *MySQLLinkedServiceTypeProperties `json:"typeProperties,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // ConnectVia - The integration runtime reference. + ConnectVia *IntegrationRuntimeReference `json:"connectVia,omitempty"` + // Description - Linked service description. + Description *string `json:"description,omitempty"` + // Parameters - Parameters for linked service. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeLinkedService', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforce', 'TypeAzureDataLakeStore', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureStorage' + Type TypeBasicLinkedService `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for MySQLLinkedService. +func (msls MySQLLinkedService) MarshalJSON() ([]byte, error) { + msls.Type = TypeMySQL + objectMap := make(map[string]interface{}) + if msls.MySQLLinkedServiceTypeProperties != nil { + objectMap["typeProperties"] = msls.MySQLLinkedServiceTypeProperties + } + if msls.ConnectVia != nil { + objectMap["connectVia"] = msls.ConnectVia + } + if msls.Description != nil { + objectMap["description"] = msls.Description + } + if msls.Parameters != nil { + objectMap["parameters"] = msls.Parameters + } + if msls.Annotations != nil { + objectMap["annotations"] = msls.Annotations + } + if msls.Type != "" { + objectMap["type"] = msls.Type + } + for k, v := range msls.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysLinkedService is the BasicLinkedService implementation for MySQLLinkedService. +func (msls MySQLLinkedService) AsResponsysLinkedService() (*ResponsysLinkedService, bool) { + return nil, false +} + +// AsAzureDatabricksLinkedService is the BasicLinkedService implementation for MySQLLinkedService. +func (msls MySQLLinkedService) AsAzureDatabricksLinkedService() (*AzureDatabricksLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeAnalyticsLinkedService is the BasicLinkedService implementation for MySQLLinkedService. +func (msls MySQLLinkedService) AsAzureDataLakeAnalyticsLinkedService() (*AzureDataLakeAnalyticsLinkedService, bool) { + return nil, false +} + +// AsHDInsightOnDemandLinkedService is the BasicLinkedService implementation for MySQLLinkedService. +func (msls MySQLLinkedService) AsHDInsightOnDemandLinkedService() (*HDInsightOnDemandLinkedService, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudLinkedService is the BasicLinkedService implementation for MySQLLinkedService. +func (msls MySQLLinkedService) AsSalesforceMarketingCloudLinkedService() (*SalesforceMarketingCloudLinkedService, bool) { + return nil, false +} + +// AsNetezzaLinkedService is the BasicLinkedService implementation for MySQLLinkedService. +func (msls MySQLLinkedService) AsNetezzaLinkedService() (*NetezzaLinkedService, bool) { + return nil, false +} + +// AsVerticaLinkedService is the BasicLinkedService implementation for MySQLLinkedService. +func (msls MySQLLinkedService) AsVerticaLinkedService() (*VerticaLinkedService, bool) { + return nil, false +} + +// AsZohoLinkedService is the BasicLinkedService implementation for MySQLLinkedService. +func (msls MySQLLinkedService) AsZohoLinkedService() (*ZohoLinkedService, bool) { + return nil, false +} + +// AsXeroLinkedService is the BasicLinkedService implementation for MySQLLinkedService. +func (msls MySQLLinkedService) AsXeroLinkedService() (*XeroLinkedService, bool) { + return nil, false +} + +// AsSquareLinkedService is the BasicLinkedService implementation for MySQLLinkedService. +func (msls MySQLLinkedService) AsSquareLinkedService() (*SquareLinkedService, bool) { + return nil, false +} + +// AsSparkLinkedService is the BasicLinkedService implementation for MySQLLinkedService. +func (msls MySQLLinkedService) AsSparkLinkedService() (*SparkLinkedService, bool) { + return nil, false +} + +// AsShopifyLinkedService is the BasicLinkedService implementation for MySQLLinkedService. +func (msls MySQLLinkedService) AsShopifyLinkedService() (*ShopifyLinkedService, bool) { + return nil, false +} + +// AsServiceNowLinkedService is the BasicLinkedService implementation for MySQLLinkedService. +func (msls MySQLLinkedService) AsServiceNowLinkedService() (*ServiceNowLinkedService, bool) { + return nil, false +} + +// AsQuickBooksLinkedService is the BasicLinkedService implementation for MySQLLinkedService. +func (msls MySQLLinkedService) AsQuickBooksLinkedService() (*QuickBooksLinkedService, bool) { + return nil, false +} + +// AsPrestoLinkedService is the BasicLinkedService implementation for MySQLLinkedService. +func (msls MySQLLinkedService) AsPrestoLinkedService() (*PrestoLinkedService, bool) { + return nil, false +} + +// AsPhoenixLinkedService is the BasicLinkedService implementation for MySQLLinkedService. +func (msls MySQLLinkedService) AsPhoenixLinkedService() (*PhoenixLinkedService, bool) { + return nil, false +} + +// AsPaypalLinkedService is the BasicLinkedService implementation for MySQLLinkedService. +func (msls MySQLLinkedService) AsPaypalLinkedService() (*PaypalLinkedService, bool) { + return nil, false +} + +// AsMarketoLinkedService is the BasicLinkedService implementation for MySQLLinkedService. +func (msls MySQLLinkedService) AsMarketoLinkedService() (*MarketoLinkedService, bool) { + return nil, false +} + +// AsMariaDBLinkedService is the BasicLinkedService implementation for MySQLLinkedService. +func (msls MySQLLinkedService) AsMariaDBLinkedService() (*MariaDBLinkedService, bool) { + return nil, false +} + +// AsMagentoLinkedService is the BasicLinkedService implementation for MySQLLinkedService. +func (msls MySQLLinkedService) AsMagentoLinkedService() (*MagentoLinkedService, bool) { + return nil, false +} + +// AsJiraLinkedService is the BasicLinkedService implementation for MySQLLinkedService. +func (msls MySQLLinkedService) AsJiraLinkedService() (*JiraLinkedService, bool) { + return nil, false +} + +// AsImpalaLinkedService is the BasicLinkedService implementation for MySQLLinkedService. +func (msls MySQLLinkedService) AsImpalaLinkedService() (*ImpalaLinkedService, bool) { + return nil, false +} + +// AsHubspotLinkedService is the BasicLinkedService implementation for MySQLLinkedService. +func (msls MySQLLinkedService) AsHubspotLinkedService() (*HubspotLinkedService, bool) { + return nil, false +} + +// AsHiveLinkedService is the BasicLinkedService implementation for MySQLLinkedService. +func (msls MySQLLinkedService) AsHiveLinkedService() (*HiveLinkedService, bool) { + return nil, false +} + +// AsHBaseLinkedService is the BasicLinkedService implementation for MySQLLinkedService. +func (msls MySQLLinkedService) AsHBaseLinkedService() (*HBaseLinkedService, bool) { + return nil, false +} + +// AsGreenplumLinkedService is the BasicLinkedService implementation for MySQLLinkedService. +func (msls MySQLLinkedService) AsGreenplumLinkedService() (*GreenplumLinkedService, bool) { + return nil, false +} + +// AsGoogleBigQueryLinkedService is the BasicLinkedService implementation for MySQLLinkedService. +func (msls MySQLLinkedService) AsGoogleBigQueryLinkedService() (*GoogleBigQueryLinkedService, bool) { + return nil, false +} + +// AsEloquaLinkedService is the BasicLinkedService implementation for MySQLLinkedService. +func (msls MySQLLinkedService) AsEloquaLinkedService() (*EloquaLinkedService, bool) { + return nil, false +} + +// AsDrillLinkedService is the BasicLinkedService implementation for MySQLLinkedService. +func (msls MySQLLinkedService) AsDrillLinkedService() (*DrillLinkedService, bool) { + return nil, false +} + +// AsCouchbaseLinkedService is the BasicLinkedService implementation for MySQLLinkedService. +func (msls MySQLLinkedService) AsCouchbaseLinkedService() (*CouchbaseLinkedService, bool) { + return nil, false +} + +// AsConcurLinkedService is the BasicLinkedService implementation for MySQLLinkedService. +func (msls MySQLLinkedService) AsConcurLinkedService() (*ConcurLinkedService, bool) { + return nil, false +} + +// AsAzurePostgreSQLLinkedService is the BasicLinkedService implementation for MySQLLinkedService. +func (msls MySQLLinkedService) AsAzurePostgreSQLLinkedService() (*AzurePostgreSQLLinkedService, bool) { + return nil, false +} + +// AsAmazonMWSLinkedService is the BasicLinkedService implementation for MySQLLinkedService. +func (msls MySQLLinkedService) AsAmazonMWSLinkedService() (*AmazonMWSLinkedService, bool) { + return nil, false +} + +// AsSapHanaLinkedService is the BasicLinkedService implementation for MySQLLinkedService. +func (msls MySQLLinkedService) AsSapHanaLinkedService() (*SapHanaLinkedService, bool) { + return nil, false +} + +// AsSapBWLinkedService is the BasicLinkedService implementation for MySQLLinkedService. +func (msls MySQLLinkedService) AsSapBWLinkedService() (*SapBWLinkedService, bool) { + return nil, false +} + +// AsSftpServerLinkedService is the BasicLinkedService implementation for MySQLLinkedService. +func (msls MySQLLinkedService) AsSftpServerLinkedService() (*SftpServerLinkedService, bool) { + return nil, false +} + +// AsFtpServerLinkedService is the BasicLinkedService implementation for MySQLLinkedService. +func (msls MySQLLinkedService) AsFtpServerLinkedService() (*FtpServerLinkedService, bool) { + return nil, false +} + +// AsHTTPLinkedService is the BasicLinkedService implementation for MySQLLinkedService. +func (msls MySQLLinkedService) AsHTTPLinkedService() (*HTTPLinkedService, bool) { + return nil, false +} + +// AsAzureSearchLinkedService is the BasicLinkedService implementation for MySQLLinkedService. +func (msls MySQLLinkedService) AsAzureSearchLinkedService() (*AzureSearchLinkedService, bool) { + return nil, false +} + +// AsCustomDataSourceLinkedService is the BasicLinkedService implementation for MySQLLinkedService. +func (msls MySQLLinkedService) AsCustomDataSourceLinkedService() (*CustomDataSourceLinkedService, bool) { + return nil, false +} + +// AsAmazonRedshiftLinkedService is the BasicLinkedService implementation for MySQLLinkedService. +func (msls MySQLLinkedService) AsAmazonRedshiftLinkedService() (*AmazonRedshiftLinkedService, bool) { + return nil, false +} + +// AsAmazonS3LinkedService is the BasicLinkedService implementation for MySQLLinkedService. +func (msls MySQLLinkedService) AsAmazonS3LinkedService() (*AmazonS3LinkedService, bool) { + return nil, false +} + +// AsSapEccLinkedService is the BasicLinkedService implementation for MySQLLinkedService. +func (msls MySQLLinkedService) AsSapEccLinkedService() (*SapEccLinkedService, bool) { + return nil, false +} + +// AsSapCloudForCustomerLinkedService is the BasicLinkedService implementation for MySQLLinkedService. +func (msls MySQLLinkedService) AsSapCloudForCustomerLinkedService() (*SapCloudForCustomerLinkedService, bool) { + return nil, false +} + +// AsSalesforceLinkedService is the BasicLinkedService implementation for MySQLLinkedService. +func (msls MySQLLinkedService) AsSalesforceLinkedService() (*SalesforceLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeStoreLinkedService is the BasicLinkedService implementation for MySQLLinkedService. +func (msls MySQLLinkedService) AsAzureDataLakeStoreLinkedService() (*AzureDataLakeStoreLinkedService, bool) { + return nil, false +} + +// AsMongoDbLinkedService is the BasicLinkedService implementation for MySQLLinkedService. +func (msls MySQLLinkedService) AsMongoDbLinkedService() (*MongoDbLinkedService, bool) { + return nil, false +} + +// AsCassandraLinkedService is the BasicLinkedService implementation for MySQLLinkedService. +func (msls MySQLLinkedService) AsCassandraLinkedService() (*CassandraLinkedService, bool) { + return nil, false +} + +// AsWebLinkedService is the BasicLinkedService implementation for MySQLLinkedService. +func (msls MySQLLinkedService) AsWebLinkedService() (*WebLinkedService, bool) { + return nil, false +} + +// AsODataLinkedService is the BasicLinkedService implementation for MySQLLinkedService. +func (msls MySQLLinkedService) AsODataLinkedService() (*ODataLinkedService, bool) { + return nil, false +} + +// AsHdfsLinkedService is the BasicLinkedService implementation for MySQLLinkedService. +func (msls MySQLLinkedService) AsHdfsLinkedService() (*HdfsLinkedService, bool) { + return nil, false +} + +// AsOdbcLinkedService is the BasicLinkedService implementation for MySQLLinkedService. +func (msls MySQLLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, bool) { + return nil, false +} + +// AsAzureMLLinkedService is the BasicLinkedService implementation for MySQLLinkedService. +func (msls MySQLLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { + return nil, false +} + +// AsTeradataLinkedService is the BasicLinkedService implementation for MySQLLinkedService. +func (msls MySQLLinkedService) AsTeradataLinkedService() (*TeradataLinkedService, bool) { + return nil, false +} + +// AsDb2LinkedService is the BasicLinkedService implementation for MySQLLinkedService. +func (msls MySQLLinkedService) AsDb2LinkedService() (*Db2LinkedService, bool) { + return nil, false +} + +// AsSybaseLinkedService is the BasicLinkedService implementation for MySQLLinkedService. +func (msls MySQLLinkedService) AsSybaseLinkedService() (*SybaseLinkedService, bool) { + return nil, false +} + +// AsPostgreSQLLinkedService is the BasicLinkedService implementation for MySQLLinkedService. +func (msls MySQLLinkedService) AsPostgreSQLLinkedService() (*PostgreSQLLinkedService, bool) { + return nil, false +} + +// AsMySQLLinkedService is the BasicLinkedService implementation for MySQLLinkedService. +func (msls MySQLLinkedService) AsMySQLLinkedService() (*MySQLLinkedService, bool) { + return &msls, true +} + +// AsAzureMySQLLinkedService is the BasicLinkedService implementation for MySQLLinkedService. +func (msls MySQLLinkedService) AsAzureMySQLLinkedService() (*AzureMySQLLinkedService, bool) { + return nil, false +} + +// AsOracleLinkedService is the BasicLinkedService implementation for MySQLLinkedService. +func (msls MySQLLinkedService) AsOracleLinkedService() (*OracleLinkedService, bool) { + return nil, false +} + +// AsFileServerLinkedService is the BasicLinkedService implementation for MySQLLinkedService. +func (msls MySQLLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { + return nil, false +} + +// AsHDInsightLinkedService is the BasicLinkedService implementation for MySQLLinkedService. +func (msls MySQLLinkedService) AsHDInsightLinkedService() (*HDInsightLinkedService, bool) { + return nil, false +} + +// AsDynamicsLinkedService is the BasicLinkedService implementation for MySQLLinkedService. +func (msls MySQLLinkedService) AsDynamicsLinkedService() (*DynamicsLinkedService, bool) { + return nil, false +} + +// AsCosmosDbLinkedService is the BasicLinkedService implementation for MySQLLinkedService. +func (msls MySQLLinkedService) AsCosmosDbLinkedService() (*CosmosDbLinkedService, bool) { + return nil, false +} + +// AsAzureKeyVaultLinkedService is the BasicLinkedService implementation for MySQLLinkedService. +func (msls MySQLLinkedService) AsAzureKeyVaultLinkedService() (*AzureKeyVaultLinkedService, bool) { + return nil, false +} + +// AsAzureBatchLinkedService is the BasicLinkedService implementation for MySQLLinkedService. +func (msls MySQLLinkedService) AsAzureBatchLinkedService() (*AzureBatchLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDatabaseLinkedService is the BasicLinkedService implementation for MySQLLinkedService. +func (msls MySQLLinkedService) AsAzureSQLDatabaseLinkedService() (*AzureSQLDatabaseLinkedService, bool) { + return nil, false +} + +// AsSQLServerLinkedService is the BasicLinkedService implementation for MySQLLinkedService. +func (msls MySQLLinkedService) AsSQLServerLinkedService() (*SQLServerLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDWLinkedService is the BasicLinkedService implementation for MySQLLinkedService. +func (msls MySQLLinkedService) AsAzureSQLDWLinkedService() (*AzureSQLDWLinkedService, bool) { + return nil, false +} + +// AsAzureStorageLinkedService is the BasicLinkedService implementation for MySQLLinkedService. +func (msls MySQLLinkedService) AsAzureStorageLinkedService() (*AzureStorageLinkedService, bool) { + return nil, false +} + +// AsLinkedService is the BasicLinkedService implementation for MySQLLinkedService. +func (msls MySQLLinkedService) AsLinkedService() (*LinkedService, bool) { + return nil, false +} + +// AsBasicLinkedService is the BasicLinkedService implementation for MySQLLinkedService. +func (msls MySQLLinkedService) AsBasicLinkedService() (BasicLinkedService, bool) { + return &msls, true +} + +// UnmarshalJSON is the custom unmarshaler for MySQLLinkedService struct. +func (msls *MySQLLinkedService) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "typeProperties": + if v != nil { + var mySQLLinkedServiceTypeProperties MySQLLinkedServiceTypeProperties + err = json.Unmarshal(*v, &mySQLLinkedServiceTypeProperties) + if err != nil { + return err + } + msls.MySQLLinkedServiceTypeProperties = &mySQLLinkedServiceTypeProperties + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if msls.AdditionalProperties == nil { + msls.AdditionalProperties = make(map[string]interface{}) + } + msls.AdditionalProperties[k] = additionalProperties + } + case "connectVia": + if v != nil { + var connectVia IntegrationRuntimeReference + err = json.Unmarshal(*v, &connectVia) + if err != nil { + return err + } + msls.ConnectVia = &connectVia + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + msls.Description = &description + } + case "parameters": + if v != nil { + var parameters map[string]*ParameterSpecification + err = json.Unmarshal(*v, ¶meters) + if err != nil { + return err + } + msls.Parameters = parameters + } + case "annotations": + if v != nil { + var annotations []interface{} + err = json.Unmarshal(*v, &annotations) + if err != nil { + return err + } + msls.Annotations = &annotations + } + case "type": + if v != nil { + var typeVar TypeBasicLinkedService + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + msls.Type = typeVar + } + } + } + + return nil +} + +// MySQLLinkedServiceTypeProperties mySQL linked service properties. +type MySQLLinkedServiceTypeProperties struct { + // ConnectionString - The connection string. + ConnectionString BasicSecretBase `json:"connectionString,omitempty"` + // EncryptedCredential - The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string). + EncryptedCredential interface{} `json:"encryptedCredential,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for MySQLLinkedServiceTypeProperties struct. +func (mslstp *MySQLLinkedServiceTypeProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "connectionString": + if v != nil { + connectionString, err := unmarshalBasicSecretBase(*v) + if err != nil { + return err + } + mslstp.ConnectionString = connectionString + } + case "encryptedCredential": + if v != nil { + var encryptedCredential interface{} + err = json.Unmarshal(*v, &encryptedCredential) + if err != nil { + return err + } + mslstp.EncryptedCredential = encryptedCredential + } + } + } + + return nil +} + +// NetezzaLinkedService netezza linked service. +type NetezzaLinkedService struct { + // NetezzaLinkedServiceTypeProperties - Netezza linked service properties. + *NetezzaLinkedServiceTypeProperties `json:"typeProperties,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // ConnectVia - The integration runtime reference. + ConnectVia *IntegrationRuntimeReference `json:"connectVia,omitempty"` + // Description - Linked service description. + Description *string `json:"description,omitempty"` + // Parameters - Parameters for linked service. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeLinkedService', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforce', 'TypeAzureDataLakeStore', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureStorage' + Type TypeBasicLinkedService `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for NetezzaLinkedService. +func (nls NetezzaLinkedService) MarshalJSON() ([]byte, error) { + nls.Type = TypeNetezza + objectMap := make(map[string]interface{}) + if nls.NetezzaLinkedServiceTypeProperties != nil { + objectMap["typeProperties"] = nls.NetezzaLinkedServiceTypeProperties + } + if nls.ConnectVia != nil { + objectMap["connectVia"] = nls.ConnectVia + } + if nls.Description != nil { + objectMap["description"] = nls.Description + } + if nls.Parameters != nil { + objectMap["parameters"] = nls.Parameters + } + if nls.Annotations != nil { + objectMap["annotations"] = nls.Annotations + } + if nls.Type != "" { + objectMap["type"] = nls.Type + } + for k, v := range nls.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysLinkedService is the BasicLinkedService implementation for NetezzaLinkedService. +func (nls NetezzaLinkedService) AsResponsysLinkedService() (*ResponsysLinkedService, bool) { + return nil, false +} + +// AsAzureDatabricksLinkedService is the BasicLinkedService implementation for NetezzaLinkedService. +func (nls NetezzaLinkedService) AsAzureDatabricksLinkedService() (*AzureDatabricksLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeAnalyticsLinkedService is the BasicLinkedService implementation for NetezzaLinkedService. +func (nls NetezzaLinkedService) AsAzureDataLakeAnalyticsLinkedService() (*AzureDataLakeAnalyticsLinkedService, bool) { + return nil, false +} + +// AsHDInsightOnDemandLinkedService is the BasicLinkedService implementation for NetezzaLinkedService. +func (nls NetezzaLinkedService) AsHDInsightOnDemandLinkedService() (*HDInsightOnDemandLinkedService, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudLinkedService is the BasicLinkedService implementation for NetezzaLinkedService. +func (nls NetezzaLinkedService) AsSalesforceMarketingCloudLinkedService() (*SalesforceMarketingCloudLinkedService, bool) { + return nil, false +} + +// AsNetezzaLinkedService is the BasicLinkedService implementation for NetezzaLinkedService. +func (nls NetezzaLinkedService) AsNetezzaLinkedService() (*NetezzaLinkedService, bool) { + return &nls, true +} + +// AsVerticaLinkedService is the BasicLinkedService implementation for NetezzaLinkedService. +func (nls NetezzaLinkedService) AsVerticaLinkedService() (*VerticaLinkedService, bool) { + return nil, false +} + +// AsZohoLinkedService is the BasicLinkedService implementation for NetezzaLinkedService. +func (nls NetezzaLinkedService) AsZohoLinkedService() (*ZohoLinkedService, bool) { + return nil, false +} + +// AsXeroLinkedService is the BasicLinkedService implementation for NetezzaLinkedService. +func (nls NetezzaLinkedService) AsXeroLinkedService() (*XeroLinkedService, bool) { + return nil, false +} + +// AsSquareLinkedService is the BasicLinkedService implementation for NetezzaLinkedService. +func (nls NetezzaLinkedService) AsSquareLinkedService() (*SquareLinkedService, bool) { + return nil, false +} + +// AsSparkLinkedService is the BasicLinkedService implementation for NetezzaLinkedService. +func (nls NetezzaLinkedService) AsSparkLinkedService() (*SparkLinkedService, bool) { + return nil, false +} + +// AsShopifyLinkedService is the BasicLinkedService implementation for NetezzaLinkedService. +func (nls NetezzaLinkedService) AsShopifyLinkedService() (*ShopifyLinkedService, bool) { + return nil, false +} + +// AsServiceNowLinkedService is the BasicLinkedService implementation for NetezzaLinkedService. +func (nls NetezzaLinkedService) AsServiceNowLinkedService() (*ServiceNowLinkedService, bool) { + return nil, false +} + +// AsQuickBooksLinkedService is the BasicLinkedService implementation for NetezzaLinkedService. +func (nls NetezzaLinkedService) AsQuickBooksLinkedService() (*QuickBooksLinkedService, bool) { + return nil, false +} + +// AsPrestoLinkedService is the BasicLinkedService implementation for NetezzaLinkedService. +func (nls NetezzaLinkedService) AsPrestoLinkedService() (*PrestoLinkedService, bool) { + return nil, false +} + +// AsPhoenixLinkedService is the BasicLinkedService implementation for NetezzaLinkedService. +func (nls NetezzaLinkedService) AsPhoenixLinkedService() (*PhoenixLinkedService, bool) { + return nil, false +} + +// AsPaypalLinkedService is the BasicLinkedService implementation for NetezzaLinkedService. +func (nls NetezzaLinkedService) AsPaypalLinkedService() (*PaypalLinkedService, bool) { + return nil, false +} + +// AsMarketoLinkedService is the BasicLinkedService implementation for NetezzaLinkedService. +func (nls NetezzaLinkedService) AsMarketoLinkedService() (*MarketoLinkedService, bool) { + return nil, false +} + +// AsMariaDBLinkedService is the BasicLinkedService implementation for NetezzaLinkedService. +func (nls NetezzaLinkedService) AsMariaDBLinkedService() (*MariaDBLinkedService, bool) { + return nil, false +} + +// AsMagentoLinkedService is the BasicLinkedService implementation for NetezzaLinkedService. +func (nls NetezzaLinkedService) AsMagentoLinkedService() (*MagentoLinkedService, bool) { + return nil, false +} + +// AsJiraLinkedService is the BasicLinkedService implementation for NetezzaLinkedService. +func (nls NetezzaLinkedService) AsJiraLinkedService() (*JiraLinkedService, bool) { + return nil, false +} + +// AsImpalaLinkedService is the BasicLinkedService implementation for NetezzaLinkedService. +func (nls NetezzaLinkedService) AsImpalaLinkedService() (*ImpalaLinkedService, bool) { + return nil, false +} + +// AsHubspotLinkedService is the BasicLinkedService implementation for NetezzaLinkedService. +func (nls NetezzaLinkedService) AsHubspotLinkedService() (*HubspotLinkedService, bool) { + return nil, false +} + +// AsHiveLinkedService is the BasicLinkedService implementation for NetezzaLinkedService. +func (nls NetezzaLinkedService) AsHiveLinkedService() (*HiveLinkedService, bool) { + return nil, false +} + +// AsHBaseLinkedService is the BasicLinkedService implementation for NetezzaLinkedService. +func (nls NetezzaLinkedService) AsHBaseLinkedService() (*HBaseLinkedService, bool) { + return nil, false +} + +// AsGreenplumLinkedService is the BasicLinkedService implementation for NetezzaLinkedService. +func (nls NetezzaLinkedService) AsGreenplumLinkedService() (*GreenplumLinkedService, bool) { + return nil, false +} + +// AsGoogleBigQueryLinkedService is the BasicLinkedService implementation for NetezzaLinkedService. +func (nls NetezzaLinkedService) AsGoogleBigQueryLinkedService() (*GoogleBigQueryLinkedService, bool) { + return nil, false +} + +// AsEloquaLinkedService is the BasicLinkedService implementation for NetezzaLinkedService. +func (nls NetezzaLinkedService) AsEloquaLinkedService() (*EloquaLinkedService, bool) { + return nil, false +} + +// AsDrillLinkedService is the BasicLinkedService implementation for NetezzaLinkedService. +func (nls NetezzaLinkedService) AsDrillLinkedService() (*DrillLinkedService, bool) { + return nil, false +} + +// AsCouchbaseLinkedService is the BasicLinkedService implementation for NetezzaLinkedService. +func (nls NetezzaLinkedService) AsCouchbaseLinkedService() (*CouchbaseLinkedService, bool) { + return nil, false +} + +// AsConcurLinkedService is the BasicLinkedService implementation for NetezzaLinkedService. +func (nls NetezzaLinkedService) AsConcurLinkedService() (*ConcurLinkedService, bool) { + return nil, false +} + +// AsAzurePostgreSQLLinkedService is the BasicLinkedService implementation for NetezzaLinkedService. +func (nls NetezzaLinkedService) AsAzurePostgreSQLLinkedService() (*AzurePostgreSQLLinkedService, bool) { + return nil, false +} + +// AsAmazonMWSLinkedService is the BasicLinkedService implementation for NetezzaLinkedService. +func (nls NetezzaLinkedService) AsAmazonMWSLinkedService() (*AmazonMWSLinkedService, bool) { + return nil, false +} + +// AsSapHanaLinkedService is the BasicLinkedService implementation for NetezzaLinkedService. +func (nls NetezzaLinkedService) AsSapHanaLinkedService() (*SapHanaLinkedService, bool) { + return nil, false +} + +// AsSapBWLinkedService is the BasicLinkedService implementation for NetezzaLinkedService. +func (nls NetezzaLinkedService) AsSapBWLinkedService() (*SapBWLinkedService, bool) { + return nil, false +} + +// AsSftpServerLinkedService is the BasicLinkedService implementation for NetezzaLinkedService. +func (nls NetezzaLinkedService) AsSftpServerLinkedService() (*SftpServerLinkedService, bool) { + return nil, false +} + +// AsFtpServerLinkedService is the BasicLinkedService implementation for NetezzaLinkedService. +func (nls NetezzaLinkedService) AsFtpServerLinkedService() (*FtpServerLinkedService, bool) { + return nil, false +} + +// AsHTTPLinkedService is the BasicLinkedService implementation for NetezzaLinkedService. +func (nls NetezzaLinkedService) AsHTTPLinkedService() (*HTTPLinkedService, bool) { + return nil, false +} + +// AsAzureSearchLinkedService is the BasicLinkedService implementation for NetezzaLinkedService. +func (nls NetezzaLinkedService) AsAzureSearchLinkedService() (*AzureSearchLinkedService, bool) { + return nil, false +} + +// AsCustomDataSourceLinkedService is the BasicLinkedService implementation for NetezzaLinkedService. +func (nls NetezzaLinkedService) AsCustomDataSourceLinkedService() (*CustomDataSourceLinkedService, bool) { + return nil, false +} + +// AsAmazonRedshiftLinkedService is the BasicLinkedService implementation for NetezzaLinkedService. +func (nls NetezzaLinkedService) AsAmazonRedshiftLinkedService() (*AmazonRedshiftLinkedService, bool) { + return nil, false +} + +// AsAmazonS3LinkedService is the BasicLinkedService implementation for NetezzaLinkedService. +func (nls NetezzaLinkedService) AsAmazonS3LinkedService() (*AmazonS3LinkedService, bool) { + return nil, false +} + +// AsSapEccLinkedService is the BasicLinkedService implementation for NetezzaLinkedService. +func (nls NetezzaLinkedService) AsSapEccLinkedService() (*SapEccLinkedService, bool) { + return nil, false +} + +// AsSapCloudForCustomerLinkedService is the BasicLinkedService implementation for NetezzaLinkedService. +func (nls NetezzaLinkedService) AsSapCloudForCustomerLinkedService() (*SapCloudForCustomerLinkedService, bool) { + return nil, false +} + +// AsSalesforceLinkedService is the BasicLinkedService implementation for NetezzaLinkedService. +func (nls NetezzaLinkedService) AsSalesforceLinkedService() (*SalesforceLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeStoreLinkedService is the BasicLinkedService implementation for NetezzaLinkedService. +func (nls NetezzaLinkedService) AsAzureDataLakeStoreLinkedService() (*AzureDataLakeStoreLinkedService, bool) { + return nil, false +} + +// AsMongoDbLinkedService is the BasicLinkedService implementation for NetezzaLinkedService. +func (nls NetezzaLinkedService) AsMongoDbLinkedService() (*MongoDbLinkedService, bool) { + return nil, false +} + +// AsCassandraLinkedService is the BasicLinkedService implementation for NetezzaLinkedService. +func (nls NetezzaLinkedService) AsCassandraLinkedService() (*CassandraLinkedService, bool) { + return nil, false +} + +// AsWebLinkedService is the BasicLinkedService implementation for NetezzaLinkedService. +func (nls NetezzaLinkedService) AsWebLinkedService() (*WebLinkedService, bool) { + return nil, false +} + +// AsODataLinkedService is the BasicLinkedService implementation for NetezzaLinkedService. +func (nls NetezzaLinkedService) AsODataLinkedService() (*ODataLinkedService, bool) { + return nil, false +} + +// AsHdfsLinkedService is the BasicLinkedService implementation for NetezzaLinkedService. +func (nls NetezzaLinkedService) AsHdfsLinkedService() (*HdfsLinkedService, bool) { + return nil, false +} + +// AsOdbcLinkedService is the BasicLinkedService implementation for NetezzaLinkedService. +func (nls NetezzaLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, bool) { + return nil, false +} + +// AsAzureMLLinkedService is the BasicLinkedService implementation for NetezzaLinkedService. +func (nls NetezzaLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { + return nil, false +} + +// AsTeradataLinkedService is the BasicLinkedService implementation for NetezzaLinkedService. +func (nls NetezzaLinkedService) AsTeradataLinkedService() (*TeradataLinkedService, bool) { + return nil, false +} + +// AsDb2LinkedService is the BasicLinkedService implementation for NetezzaLinkedService. +func (nls NetezzaLinkedService) AsDb2LinkedService() (*Db2LinkedService, bool) { + return nil, false +} + +// AsSybaseLinkedService is the BasicLinkedService implementation for NetezzaLinkedService. +func (nls NetezzaLinkedService) AsSybaseLinkedService() (*SybaseLinkedService, bool) { + return nil, false +} + +// AsPostgreSQLLinkedService is the BasicLinkedService implementation for NetezzaLinkedService. +func (nls NetezzaLinkedService) AsPostgreSQLLinkedService() (*PostgreSQLLinkedService, bool) { + return nil, false +} + +// AsMySQLLinkedService is the BasicLinkedService implementation for NetezzaLinkedService. +func (nls NetezzaLinkedService) AsMySQLLinkedService() (*MySQLLinkedService, bool) { + return nil, false +} + +// AsAzureMySQLLinkedService is the BasicLinkedService implementation for NetezzaLinkedService. +func (nls NetezzaLinkedService) AsAzureMySQLLinkedService() (*AzureMySQLLinkedService, bool) { + return nil, false +} + +// AsOracleLinkedService is the BasicLinkedService implementation for NetezzaLinkedService. +func (nls NetezzaLinkedService) AsOracleLinkedService() (*OracleLinkedService, bool) { + return nil, false +} + +// AsFileServerLinkedService is the BasicLinkedService implementation for NetezzaLinkedService. +func (nls NetezzaLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { + return nil, false +} + +// AsHDInsightLinkedService is the BasicLinkedService implementation for NetezzaLinkedService. +func (nls NetezzaLinkedService) AsHDInsightLinkedService() (*HDInsightLinkedService, bool) { + return nil, false +} + +// AsDynamicsLinkedService is the BasicLinkedService implementation for NetezzaLinkedService. +func (nls NetezzaLinkedService) AsDynamicsLinkedService() (*DynamicsLinkedService, bool) { + return nil, false +} + +// AsCosmosDbLinkedService is the BasicLinkedService implementation for NetezzaLinkedService. +func (nls NetezzaLinkedService) AsCosmosDbLinkedService() (*CosmosDbLinkedService, bool) { + return nil, false +} + +// AsAzureKeyVaultLinkedService is the BasicLinkedService implementation for NetezzaLinkedService. +func (nls NetezzaLinkedService) AsAzureKeyVaultLinkedService() (*AzureKeyVaultLinkedService, bool) { + return nil, false +} + +// AsAzureBatchLinkedService is the BasicLinkedService implementation for NetezzaLinkedService. +func (nls NetezzaLinkedService) AsAzureBatchLinkedService() (*AzureBatchLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDatabaseLinkedService is the BasicLinkedService implementation for NetezzaLinkedService. +func (nls NetezzaLinkedService) AsAzureSQLDatabaseLinkedService() (*AzureSQLDatabaseLinkedService, bool) { + return nil, false +} + +// AsSQLServerLinkedService is the BasicLinkedService implementation for NetezzaLinkedService. +func (nls NetezzaLinkedService) AsSQLServerLinkedService() (*SQLServerLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDWLinkedService is the BasicLinkedService implementation for NetezzaLinkedService. +func (nls NetezzaLinkedService) AsAzureSQLDWLinkedService() (*AzureSQLDWLinkedService, bool) { + return nil, false +} + +// AsAzureStorageLinkedService is the BasicLinkedService implementation for NetezzaLinkedService. +func (nls NetezzaLinkedService) AsAzureStorageLinkedService() (*AzureStorageLinkedService, bool) { + return nil, false +} + +// AsLinkedService is the BasicLinkedService implementation for NetezzaLinkedService. +func (nls NetezzaLinkedService) AsLinkedService() (*LinkedService, bool) { + return nil, false +} + +// AsBasicLinkedService is the BasicLinkedService implementation for NetezzaLinkedService. +func (nls NetezzaLinkedService) AsBasicLinkedService() (BasicLinkedService, bool) { + return &nls, true +} + +// UnmarshalJSON is the custom unmarshaler for NetezzaLinkedService struct. +func (nls *NetezzaLinkedService) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "typeProperties": + if v != nil { + var netezzaLinkedServiceTypeProperties NetezzaLinkedServiceTypeProperties + err = json.Unmarshal(*v, &netezzaLinkedServiceTypeProperties) + if err != nil { + return err + } + nls.NetezzaLinkedServiceTypeProperties = &netezzaLinkedServiceTypeProperties + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if nls.AdditionalProperties == nil { + nls.AdditionalProperties = make(map[string]interface{}) + } + nls.AdditionalProperties[k] = additionalProperties + } + case "connectVia": + if v != nil { + var connectVia IntegrationRuntimeReference + err = json.Unmarshal(*v, &connectVia) + if err != nil { + return err + } + nls.ConnectVia = &connectVia + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + nls.Description = &description + } + case "parameters": + if v != nil { + var parameters map[string]*ParameterSpecification + err = json.Unmarshal(*v, ¶meters) + if err != nil { + return err + } + nls.Parameters = parameters + } + case "annotations": + if v != nil { + var annotations []interface{} + err = json.Unmarshal(*v, &annotations) + if err != nil { + return err + } + nls.Annotations = &annotations + } + case "type": + if v != nil { + var typeVar TypeBasicLinkedService + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + nls.Type = typeVar + } + } + } + + return nil +} + +// NetezzaLinkedServiceTypeProperties netezza linked service properties. +type NetezzaLinkedServiceTypeProperties struct { + // ConnectionString - An ODBC connection string. Type: string, SecureString or AzureKeyVaultSecretReference. + ConnectionString interface{} `json:"connectionString,omitempty"` + // EncryptedCredential - The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string). + EncryptedCredential interface{} `json:"encryptedCredential,omitempty"` +} + +// NetezzaSource a copy activity Netezza source. +type NetezzaSource struct { + // Query - A query to retrieve data from source. Type: string (or Expression with resultType string). + Query interface{} `json:"query,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // SourceRetryCount - Source retry count. Type: integer (or Expression with resultType integer). + SourceRetryCount interface{} `json:"sourceRetryCount,omitempty"` + // SourceRetryWait - Source retry wait. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` + // Type - Possible values include: 'TypeCopySource', 'TypeAmazonRedshiftSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeHTTPSource', 'TypeAzureDataLakeStoreSource', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeRelationalSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource' + Type TypeBasicCopySource `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for NetezzaSource. +func (ns NetezzaSource) MarshalJSON() ([]byte, error) { + ns.Type = TypeNetezzaSource + objectMap := make(map[string]interface{}) + objectMap["query"] = ns.Query + objectMap["sourceRetryCount"] = ns.SourceRetryCount + objectMap["sourceRetryWait"] = ns.SourceRetryWait + if ns.Type != "" { + objectMap["type"] = ns.Type + } + for k, v := range ns.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsAmazonRedshiftSource is the BasicCopySource implementation for NetezzaSource. +func (ns NetezzaSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { + return nil, false +} + +// AsResponsysSource is the BasicCopySource implementation for NetezzaSource. +func (ns NetezzaSource) AsResponsysSource() (*ResponsysSource, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudSource is the BasicCopySource implementation for NetezzaSource. +func (ns NetezzaSource) AsSalesforceMarketingCloudSource() (*SalesforceMarketingCloudSource, bool) { + return nil, false +} + +// AsVerticaSource is the BasicCopySource implementation for NetezzaSource. +func (ns NetezzaSource) AsVerticaSource() (*VerticaSource, bool) { + return nil, false +} + +// AsNetezzaSource is the BasicCopySource implementation for NetezzaSource. +func (ns NetezzaSource) AsNetezzaSource() (*NetezzaSource, bool) { + return &ns, true +} + +// AsZohoSource is the BasicCopySource implementation for NetezzaSource. +func (ns NetezzaSource) AsZohoSource() (*ZohoSource, bool) { + return nil, false +} + +// AsXeroSource is the BasicCopySource implementation for NetezzaSource. +func (ns NetezzaSource) AsXeroSource() (*XeroSource, bool) { + return nil, false +} + +// AsSquareSource is the BasicCopySource implementation for NetezzaSource. +func (ns NetezzaSource) AsSquareSource() (*SquareSource, bool) { + return nil, false +} + +// AsSparkSource is the BasicCopySource implementation for NetezzaSource. +func (ns NetezzaSource) AsSparkSource() (*SparkSource, bool) { + return nil, false +} + +// AsShopifySource is the BasicCopySource implementation for NetezzaSource. +func (ns NetezzaSource) AsShopifySource() (*ShopifySource, bool) { + return nil, false +} + +// AsServiceNowSource is the BasicCopySource implementation for NetezzaSource. +func (ns NetezzaSource) AsServiceNowSource() (*ServiceNowSource, bool) { + return nil, false +} + +// AsQuickBooksSource is the BasicCopySource implementation for NetezzaSource. +func (ns NetezzaSource) AsQuickBooksSource() (*QuickBooksSource, bool) { + return nil, false +} + +// AsPrestoSource is the BasicCopySource implementation for NetezzaSource. +func (ns NetezzaSource) AsPrestoSource() (*PrestoSource, bool) { + return nil, false +} + +// AsPhoenixSource is the BasicCopySource implementation for NetezzaSource. +func (ns NetezzaSource) AsPhoenixSource() (*PhoenixSource, bool) { + return nil, false +} + +// AsPaypalSource is the BasicCopySource implementation for NetezzaSource. +func (ns NetezzaSource) AsPaypalSource() (*PaypalSource, bool) { + return nil, false +} + +// AsMarketoSource is the BasicCopySource implementation for NetezzaSource. +func (ns NetezzaSource) AsMarketoSource() (*MarketoSource, bool) { + return nil, false +} + +// AsMariaDBSource is the BasicCopySource implementation for NetezzaSource. +func (ns NetezzaSource) AsMariaDBSource() (*MariaDBSource, bool) { + return nil, false +} + +// AsMagentoSource is the BasicCopySource implementation for NetezzaSource. +func (ns NetezzaSource) AsMagentoSource() (*MagentoSource, bool) { + return nil, false +} + +// AsJiraSource is the BasicCopySource implementation for NetezzaSource. +func (ns NetezzaSource) AsJiraSource() (*JiraSource, bool) { + return nil, false +} + +// AsImpalaSource is the BasicCopySource implementation for NetezzaSource. +func (ns NetezzaSource) AsImpalaSource() (*ImpalaSource, bool) { + return nil, false +} + +// AsHubspotSource is the BasicCopySource implementation for NetezzaSource. +func (ns NetezzaSource) AsHubspotSource() (*HubspotSource, bool) { + return nil, false +} + +// AsHiveSource is the BasicCopySource implementation for NetezzaSource. +func (ns NetezzaSource) AsHiveSource() (*HiveSource, bool) { + return nil, false +} + +// AsHBaseSource is the BasicCopySource implementation for NetezzaSource. +func (ns NetezzaSource) AsHBaseSource() (*HBaseSource, bool) { + return nil, false +} + +// AsGreenplumSource is the BasicCopySource implementation for NetezzaSource. +func (ns NetezzaSource) AsGreenplumSource() (*GreenplumSource, bool) { + return nil, false +} + +// AsGoogleBigQuerySource is the BasicCopySource implementation for NetezzaSource. +func (ns NetezzaSource) AsGoogleBigQuerySource() (*GoogleBigQuerySource, bool) { + return nil, false +} + +// AsEloquaSource is the BasicCopySource implementation for NetezzaSource. +func (ns NetezzaSource) AsEloquaSource() (*EloquaSource, bool) { + return nil, false +} + +// AsDrillSource is the BasicCopySource implementation for NetezzaSource. +func (ns NetezzaSource) AsDrillSource() (*DrillSource, bool) { + return nil, false +} + +// AsCouchbaseSource is the BasicCopySource implementation for NetezzaSource. +func (ns NetezzaSource) AsCouchbaseSource() (*CouchbaseSource, bool) { + return nil, false +} + +// AsConcurSource is the BasicCopySource implementation for NetezzaSource. +func (ns NetezzaSource) AsConcurSource() (*ConcurSource, bool) { + return nil, false +} + +// AsAzurePostgreSQLSource is the BasicCopySource implementation for NetezzaSource. +func (ns NetezzaSource) AsAzurePostgreSQLSource() (*AzurePostgreSQLSource, bool) { + return nil, false +} + +// AsAmazonMWSSource is the BasicCopySource implementation for NetezzaSource. +func (ns NetezzaSource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { + return nil, false +} + +// AsHTTPSource is the BasicCopySource implementation for NetezzaSource. +func (ns NetezzaSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for NetezzaSource. +func (ns NetezzaSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for NetezzaSource. +func (ns NetezzaSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsCassandraSource is the BasicCopySource implementation for NetezzaSource. +func (ns NetezzaSource) AsCassandraSource() (*CassandraSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for NetezzaSource. +func (ns NetezzaSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for NetezzaSource. +func (ns NetezzaSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureMySQLSource is the BasicCopySource implementation for NetezzaSource. +func (ns NetezzaSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for NetezzaSource. +func (ns NetezzaSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for NetezzaSource. +func (ns NetezzaSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsSQLDWSource is the BasicCopySource implementation for NetezzaSource. +func (ns NetezzaSource) AsSQLDWSource() (*SQLDWSource, bool) { + return nil, false +} + +// AsSQLSource is the BasicCopySource implementation for NetezzaSource. +func (ns NetezzaSource) AsSQLSource() (*SQLSource, bool) { + return nil, false +} + +// AsSapEccSource is the BasicCopySource implementation for NetezzaSource. +func (ns NetezzaSource) AsSapEccSource() (*SapEccSource, bool) { + return nil, false +} + +// AsSapCloudForCustomerSource is the BasicCopySource implementation for NetezzaSource. +func (ns NetezzaSource) AsSapCloudForCustomerSource() (*SapCloudForCustomerSource, bool) { + return nil, false +} + +// AsSalesforceSource is the BasicCopySource implementation for NetezzaSource. +func (ns NetezzaSource) AsSalesforceSource() (*SalesforceSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for NetezzaSource. +func (ns NetezzaSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for NetezzaSource. +func (ns NetezzaSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for NetezzaSource. +func (ns NetezzaSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for NetezzaSource. +func (ns NetezzaSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + +// AsAzureTableSource is the BasicCopySource implementation for NetezzaSource. +func (ns NetezzaSource) AsAzureTableSource() (*AzureTableSource, bool) { + return nil, false +} + +// AsCopySource is the BasicCopySource implementation for NetezzaSource. +func (ns NetezzaSource) AsCopySource() (*CopySource, bool) { + return nil, false +} + +// AsBasicCopySource is the BasicCopySource implementation for NetezzaSource. +func (ns NetezzaSource) AsBasicCopySource() (BasicCopySource, bool) { + return &ns, true +} + +// NetezzaTableDataset netezza dataset. +type NetezzaTableDataset struct { + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Description - Dataset description. + Description *string `json:"description,omitempty"` + // Structure - Columns that define the structure of the dataset. Type: array (or Expression with resultType array), itemType: DatasetDataElement. + Structure interface{} `json:"structure,omitempty"` + // LinkedServiceName - Linked service reference. + LinkedServiceName *LinkedServiceReference `json:"linkedServiceName,omitempty"` + // Parameters - Parameters for dataset. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeDataset', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSQLServerTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSalesforceObject', 'TypeRelationalTable', 'TypeAzureMySQLTable', 'TypeOracleTable', 'TypeODataResource', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeAzureDataLakeStoreFile', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeAmazonS3Object' + Type TypeBasicDataset `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for NetezzaTableDataset. +func (ntd NetezzaTableDataset) MarshalJSON() ([]byte, error) { + ntd.Type = TypeNetezzaTable + objectMap := make(map[string]interface{}) + if ntd.Description != nil { + objectMap["description"] = ntd.Description + } + objectMap["structure"] = ntd.Structure + if ntd.LinkedServiceName != nil { + objectMap["linkedServiceName"] = ntd.LinkedServiceName + } + if ntd.Parameters != nil { + objectMap["parameters"] = ntd.Parameters + } + if ntd.Annotations != nil { + objectMap["annotations"] = ntd.Annotations + } + if ntd.Type != "" { + objectMap["type"] = ntd.Type + } + for k, v := range ntd.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysObjectDataset is the BasicDataset implementation for NetezzaTableDataset. +func (ntd NetezzaTableDataset) AsResponsysObjectDataset() (*ResponsysObjectDataset, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudObjectDataset is the BasicDataset implementation for NetezzaTableDataset. +func (ntd NetezzaTableDataset) AsSalesforceMarketingCloudObjectDataset() (*SalesforceMarketingCloudObjectDataset, bool) { + return nil, false +} + +// AsVerticaTableDataset is the BasicDataset implementation for NetezzaTableDataset. +func (ntd NetezzaTableDataset) AsVerticaTableDataset() (*VerticaTableDataset, bool) { + return nil, false +} + +// AsNetezzaTableDataset is the BasicDataset implementation for NetezzaTableDataset. +func (ntd NetezzaTableDataset) AsNetezzaTableDataset() (*NetezzaTableDataset, bool) { + return &ntd, true +} + +// AsZohoObjectDataset is the BasicDataset implementation for NetezzaTableDataset. +func (ntd NetezzaTableDataset) AsZohoObjectDataset() (*ZohoObjectDataset, bool) { + return nil, false +} + +// AsXeroObjectDataset is the BasicDataset implementation for NetezzaTableDataset. +func (ntd NetezzaTableDataset) AsXeroObjectDataset() (*XeroObjectDataset, bool) { + return nil, false +} + +// AsSquareObjectDataset is the BasicDataset implementation for NetezzaTableDataset. +func (ntd NetezzaTableDataset) AsSquareObjectDataset() (*SquareObjectDataset, bool) { + return nil, false +} + +// AsSparkObjectDataset is the BasicDataset implementation for NetezzaTableDataset. +func (ntd NetezzaTableDataset) AsSparkObjectDataset() (*SparkObjectDataset, bool) { + return nil, false +} + +// AsShopifyObjectDataset is the BasicDataset implementation for NetezzaTableDataset. +func (ntd NetezzaTableDataset) AsShopifyObjectDataset() (*ShopifyObjectDataset, bool) { + return nil, false +} + +// AsServiceNowObjectDataset is the BasicDataset implementation for NetezzaTableDataset. +func (ntd NetezzaTableDataset) AsServiceNowObjectDataset() (*ServiceNowObjectDataset, bool) { + return nil, false +} + +// AsQuickBooksObjectDataset is the BasicDataset implementation for NetezzaTableDataset. +func (ntd NetezzaTableDataset) AsQuickBooksObjectDataset() (*QuickBooksObjectDataset, bool) { + return nil, false +} + +// AsPrestoObjectDataset is the BasicDataset implementation for NetezzaTableDataset. +func (ntd NetezzaTableDataset) AsPrestoObjectDataset() (*PrestoObjectDataset, bool) { + return nil, false +} + +// AsPhoenixObjectDataset is the BasicDataset implementation for NetezzaTableDataset. +func (ntd NetezzaTableDataset) AsPhoenixObjectDataset() (*PhoenixObjectDataset, bool) { + return nil, false +} + +// AsPaypalObjectDataset is the BasicDataset implementation for NetezzaTableDataset. +func (ntd NetezzaTableDataset) AsPaypalObjectDataset() (*PaypalObjectDataset, bool) { + return nil, false +} + +// AsMarketoObjectDataset is the BasicDataset implementation for NetezzaTableDataset. +func (ntd NetezzaTableDataset) AsMarketoObjectDataset() (*MarketoObjectDataset, bool) { + return nil, false +} + +// AsMariaDBTableDataset is the BasicDataset implementation for NetezzaTableDataset. +func (ntd NetezzaTableDataset) AsMariaDBTableDataset() (*MariaDBTableDataset, bool) { + return nil, false +} + +// AsMagentoObjectDataset is the BasicDataset implementation for NetezzaTableDataset. +func (ntd NetezzaTableDataset) AsMagentoObjectDataset() (*MagentoObjectDataset, bool) { + return nil, false +} + +// AsJiraObjectDataset is the BasicDataset implementation for NetezzaTableDataset. +func (ntd NetezzaTableDataset) AsJiraObjectDataset() (*JiraObjectDataset, bool) { + return nil, false +} + +// AsImpalaObjectDataset is the BasicDataset implementation for NetezzaTableDataset. +func (ntd NetezzaTableDataset) AsImpalaObjectDataset() (*ImpalaObjectDataset, bool) { + return nil, false +} + +// AsHubspotObjectDataset is the BasicDataset implementation for NetezzaTableDataset. +func (ntd NetezzaTableDataset) AsHubspotObjectDataset() (*HubspotObjectDataset, bool) { + return nil, false +} + +// AsHiveObjectDataset is the BasicDataset implementation for NetezzaTableDataset. +func (ntd NetezzaTableDataset) AsHiveObjectDataset() (*HiveObjectDataset, bool) { + return nil, false +} + +// AsHBaseObjectDataset is the BasicDataset implementation for NetezzaTableDataset. +func (ntd NetezzaTableDataset) AsHBaseObjectDataset() (*HBaseObjectDataset, bool) { + return nil, false +} + +// AsGreenplumTableDataset is the BasicDataset implementation for NetezzaTableDataset. +func (ntd NetezzaTableDataset) AsGreenplumTableDataset() (*GreenplumTableDataset, bool) { + return nil, false +} + +// AsGoogleBigQueryObjectDataset is the BasicDataset implementation for NetezzaTableDataset. +func (ntd NetezzaTableDataset) AsGoogleBigQueryObjectDataset() (*GoogleBigQueryObjectDataset, bool) { + return nil, false +} + +// AsEloquaObjectDataset is the BasicDataset implementation for NetezzaTableDataset. +func (ntd NetezzaTableDataset) AsEloquaObjectDataset() (*EloquaObjectDataset, bool) { + return nil, false +} + +// AsDrillTableDataset is the BasicDataset implementation for NetezzaTableDataset. +func (ntd NetezzaTableDataset) AsDrillTableDataset() (*DrillTableDataset, bool) { + return nil, false +} + +// AsCouchbaseTableDataset is the BasicDataset implementation for NetezzaTableDataset. +func (ntd NetezzaTableDataset) AsCouchbaseTableDataset() (*CouchbaseTableDataset, bool) { + return nil, false +} + +// AsConcurObjectDataset is the BasicDataset implementation for NetezzaTableDataset. +func (ntd NetezzaTableDataset) AsConcurObjectDataset() (*ConcurObjectDataset, bool) { + return nil, false +} + +// AsAzurePostgreSQLTableDataset is the BasicDataset implementation for NetezzaTableDataset. +func (ntd NetezzaTableDataset) AsAzurePostgreSQLTableDataset() (*AzurePostgreSQLTableDataset, bool) { + return nil, false +} + +// AsAmazonMWSObjectDataset is the BasicDataset implementation for NetezzaTableDataset. +func (ntd NetezzaTableDataset) AsAmazonMWSObjectDataset() (*AmazonMWSObjectDataset, bool) { + return nil, false +} + +// AsHTTPDataset is the BasicDataset implementation for NetezzaTableDataset. +func (ntd NetezzaTableDataset) AsHTTPDataset() (*HTTPDataset, bool) { + return nil, false +} + +// AsAzureSearchIndexDataset is the BasicDataset implementation for NetezzaTableDataset. +func (ntd NetezzaTableDataset) AsAzureSearchIndexDataset() (*AzureSearchIndexDataset, bool) { + return nil, false +} + +// AsWebTableDataset is the BasicDataset implementation for NetezzaTableDataset. +func (ntd NetezzaTableDataset) AsWebTableDataset() (*WebTableDataset, bool) { + return nil, false +} + +// AsSQLServerTableDataset is the BasicDataset implementation for NetezzaTableDataset. +func (ntd NetezzaTableDataset) AsSQLServerTableDataset() (*SQLServerTableDataset, bool) { + return nil, false +} + +// AsSapEccResourceDataset is the BasicDataset implementation for NetezzaTableDataset. +func (ntd NetezzaTableDataset) AsSapEccResourceDataset() (*SapEccResourceDataset, bool) { + return nil, false +} + +// AsSapCloudForCustomerResourceDataset is the BasicDataset implementation for NetezzaTableDataset. +func (ntd NetezzaTableDataset) AsSapCloudForCustomerResourceDataset() (*SapCloudForCustomerResourceDataset, bool) { + return nil, false +} + +// AsSalesforceObjectDataset is the BasicDataset implementation for NetezzaTableDataset. +func (ntd NetezzaTableDataset) AsSalesforceObjectDataset() (*SalesforceObjectDataset, bool) { + return nil, false +} + +// AsRelationalTableDataset is the BasicDataset implementation for NetezzaTableDataset. +func (ntd NetezzaTableDataset) AsRelationalTableDataset() (*RelationalTableDataset, bool) { + return nil, false +} + +// AsAzureMySQLTableDataset is the BasicDataset implementation for NetezzaTableDataset. +func (ntd NetezzaTableDataset) AsAzureMySQLTableDataset() (*AzureMySQLTableDataset, bool) { + return nil, false +} + +// AsOracleTableDataset is the BasicDataset implementation for NetezzaTableDataset. +func (ntd NetezzaTableDataset) AsOracleTableDataset() (*OracleTableDataset, bool) { + return nil, false +} + +// AsODataResourceDataset is the BasicDataset implementation for NetezzaTableDataset. +func (ntd NetezzaTableDataset) AsODataResourceDataset() (*ODataResourceDataset, bool) { + return nil, false +} + +// AsMongoDbCollectionDataset is the BasicDataset implementation for NetezzaTableDataset. +func (ntd NetezzaTableDataset) AsMongoDbCollectionDataset() (*MongoDbCollectionDataset, bool) { + return nil, false +} + +// AsFileShareDataset is the BasicDataset implementation for NetezzaTableDataset. +func (ntd NetezzaTableDataset) AsFileShareDataset() (*FileShareDataset, bool) { + return nil, false +} + +// AsAzureDataLakeStoreDataset is the BasicDataset implementation for NetezzaTableDataset. +func (ntd NetezzaTableDataset) AsAzureDataLakeStoreDataset() (*AzureDataLakeStoreDataset, bool) { + return nil, false +} + +// AsDynamicsEntityDataset is the BasicDataset implementation for NetezzaTableDataset. +func (ntd NetezzaTableDataset) AsDynamicsEntityDataset() (*DynamicsEntityDataset, bool) { + return nil, false +} + +// AsDocumentDbCollectionDataset is the BasicDataset implementation for NetezzaTableDataset. +func (ntd NetezzaTableDataset) AsDocumentDbCollectionDataset() (*DocumentDbCollectionDataset, bool) { + return nil, false +} + +// AsCustomDataset is the BasicDataset implementation for NetezzaTableDataset. +func (ntd NetezzaTableDataset) AsCustomDataset() (*CustomDataset, bool) { + return nil, false +} + +// AsCassandraTableDataset is the BasicDataset implementation for NetezzaTableDataset. +func (ntd NetezzaTableDataset) AsCassandraTableDataset() (*CassandraTableDataset, bool) { + return nil, false +} + +// AsAzureSQLDWTableDataset is the BasicDataset implementation for NetezzaTableDataset. +func (ntd NetezzaTableDataset) AsAzureSQLDWTableDataset() (*AzureSQLDWTableDataset, bool) { + return nil, false +} + +// AsAzureSQLTableDataset is the BasicDataset implementation for NetezzaTableDataset. +func (ntd NetezzaTableDataset) AsAzureSQLTableDataset() (*AzureSQLTableDataset, bool) { + return nil, false +} + +// AsAzureTableDataset is the BasicDataset implementation for NetezzaTableDataset. +func (ntd NetezzaTableDataset) AsAzureTableDataset() (*AzureTableDataset, bool) { + return nil, false +} + +// AsAzureBlobDataset is the BasicDataset implementation for NetezzaTableDataset. +func (ntd NetezzaTableDataset) AsAzureBlobDataset() (*AzureBlobDataset, bool) { + return nil, false +} + +// AsAmazonS3Dataset is the BasicDataset implementation for NetezzaTableDataset. +func (ntd NetezzaTableDataset) AsAmazonS3Dataset() (*AmazonS3Dataset, bool) { + return nil, false +} + +// AsDataset is the BasicDataset implementation for NetezzaTableDataset. +func (ntd NetezzaTableDataset) AsDataset() (*Dataset, bool) { + return nil, false +} + +// AsBasicDataset is the BasicDataset implementation for NetezzaTableDataset. +func (ntd NetezzaTableDataset) AsBasicDataset() (BasicDataset, bool) { + return &ntd, true +} + +// ODataLinkedService open Data Protocol (OData) linked service. +type ODataLinkedService struct { + // ODataLinkedServiceTypeProperties - OData linked service properties. + *ODataLinkedServiceTypeProperties `json:"typeProperties,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // ConnectVia - The integration runtime reference. + ConnectVia *IntegrationRuntimeReference `json:"connectVia,omitempty"` + // Description - Linked service description. + Description *string `json:"description,omitempty"` + // Parameters - Parameters for linked service. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeLinkedService', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforce', 'TypeAzureDataLakeStore', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureStorage' + Type TypeBasicLinkedService `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ODataLinkedService. +func (odls ODataLinkedService) MarshalJSON() ([]byte, error) { + odls.Type = TypeOData + objectMap := make(map[string]interface{}) + if odls.ODataLinkedServiceTypeProperties != nil { + objectMap["typeProperties"] = odls.ODataLinkedServiceTypeProperties + } + if odls.ConnectVia != nil { + objectMap["connectVia"] = odls.ConnectVia + } + if odls.Description != nil { + objectMap["description"] = odls.Description + } + if odls.Parameters != nil { + objectMap["parameters"] = odls.Parameters + } + if odls.Annotations != nil { + objectMap["annotations"] = odls.Annotations + } + if odls.Type != "" { + objectMap["type"] = odls.Type + } + for k, v := range odls.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysLinkedService is the BasicLinkedService implementation for ODataLinkedService. +func (odls ODataLinkedService) AsResponsysLinkedService() (*ResponsysLinkedService, bool) { + return nil, false +} + +// AsAzureDatabricksLinkedService is the BasicLinkedService implementation for ODataLinkedService. +func (odls ODataLinkedService) AsAzureDatabricksLinkedService() (*AzureDatabricksLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeAnalyticsLinkedService is the BasicLinkedService implementation for ODataLinkedService. +func (odls ODataLinkedService) AsAzureDataLakeAnalyticsLinkedService() (*AzureDataLakeAnalyticsLinkedService, bool) { + return nil, false +} + +// AsHDInsightOnDemandLinkedService is the BasicLinkedService implementation for ODataLinkedService. +func (odls ODataLinkedService) AsHDInsightOnDemandLinkedService() (*HDInsightOnDemandLinkedService, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudLinkedService is the BasicLinkedService implementation for ODataLinkedService. +func (odls ODataLinkedService) AsSalesforceMarketingCloudLinkedService() (*SalesforceMarketingCloudLinkedService, bool) { + return nil, false +} + +// AsNetezzaLinkedService is the BasicLinkedService implementation for ODataLinkedService. +func (odls ODataLinkedService) AsNetezzaLinkedService() (*NetezzaLinkedService, bool) { + return nil, false +} + +// AsVerticaLinkedService is the BasicLinkedService implementation for ODataLinkedService. +func (odls ODataLinkedService) AsVerticaLinkedService() (*VerticaLinkedService, bool) { + return nil, false +} + +// AsZohoLinkedService is the BasicLinkedService implementation for ODataLinkedService. +func (odls ODataLinkedService) AsZohoLinkedService() (*ZohoLinkedService, bool) { + return nil, false +} + +// AsXeroLinkedService is the BasicLinkedService implementation for ODataLinkedService. +func (odls ODataLinkedService) AsXeroLinkedService() (*XeroLinkedService, bool) { + return nil, false +} + +// AsSquareLinkedService is the BasicLinkedService implementation for ODataLinkedService. +func (odls ODataLinkedService) AsSquareLinkedService() (*SquareLinkedService, bool) { + return nil, false +} + +// AsSparkLinkedService is the BasicLinkedService implementation for ODataLinkedService. +func (odls ODataLinkedService) AsSparkLinkedService() (*SparkLinkedService, bool) { + return nil, false +} + +// AsShopifyLinkedService is the BasicLinkedService implementation for ODataLinkedService. +func (odls ODataLinkedService) AsShopifyLinkedService() (*ShopifyLinkedService, bool) { + return nil, false +} + +// AsServiceNowLinkedService is the BasicLinkedService implementation for ODataLinkedService. +func (odls ODataLinkedService) AsServiceNowLinkedService() (*ServiceNowLinkedService, bool) { + return nil, false +} + +// AsQuickBooksLinkedService is the BasicLinkedService implementation for ODataLinkedService. +func (odls ODataLinkedService) AsQuickBooksLinkedService() (*QuickBooksLinkedService, bool) { + return nil, false +} + +// AsPrestoLinkedService is the BasicLinkedService implementation for ODataLinkedService. +func (odls ODataLinkedService) AsPrestoLinkedService() (*PrestoLinkedService, bool) { + return nil, false +} + +// AsPhoenixLinkedService is the BasicLinkedService implementation for ODataLinkedService. +func (odls ODataLinkedService) AsPhoenixLinkedService() (*PhoenixLinkedService, bool) { + return nil, false +} + +// AsPaypalLinkedService is the BasicLinkedService implementation for ODataLinkedService. +func (odls ODataLinkedService) AsPaypalLinkedService() (*PaypalLinkedService, bool) { + return nil, false +} + +// AsMarketoLinkedService is the BasicLinkedService implementation for ODataLinkedService. +func (odls ODataLinkedService) AsMarketoLinkedService() (*MarketoLinkedService, bool) { + return nil, false +} + +// AsMariaDBLinkedService is the BasicLinkedService implementation for ODataLinkedService. +func (odls ODataLinkedService) AsMariaDBLinkedService() (*MariaDBLinkedService, bool) { + return nil, false +} + +// AsMagentoLinkedService is the BasicLinkedService implementation for ODataLinkedService. +func (odls ODataLinkedService) AsMagentoLinkedService() (*MagentoLinkedService, bool) { + return nil, false +} + +// AsJiraLinkedService is the BasicLinkedService implementation for ODataLinkedService. +func (odls ODataLinkedService) AsJiraLinkedService() (*JiraLinkedService, bool) { + return nil, false +} + +// AsImpalaLinkedService is the BasicLinkedService implementation for ODataLinkedService. +func (odls ODataLinkedService) AsImpalaLinkedService() (*ImpalaLinkedService, bool) { + return nil, false +} + +// AsHubspotLinkedService is the BasicLinkedService implementation for ODataLinkedService. +func (odls ODataLinkedService) AsHubspotLinkedService() (*HubspotLinkedService, bool) { + return nil, false +} + +// AsHiveLinkedService is the BasicLinkedService implementation for ODataLinkedService. +func (odls ODataLinkedService) AsHiveLinkedService() (*HiveLinkedService, bool) { + return nil, false +} + +// AsHBaseLinkedService is the BasicLinkedService implementation for ODataLinkedService. +func (odls ODataLinkedService) AsHBaseLinkedService() (*HBaseLinkedService, bool) { + return nil, false +} + +// AsGreenplumLinkedService is the BasicLinkedService implementation for ODataLinkedService. +func (odls ODataLinkedService) AsGreenplumLinkedService() (*GreenplumLinkedService, bool) { + return nil, false +} + +// AsGoogleBigQueryLinkedService is the BasicLinkedService implementation for ODataLinkedService. +func (odls ODataLinkedService) AsGoogleBigQueryLinkedService() (*GoogleBigQueryLinkedService, bool) { + return nil, false +} + +// AsEloquaLinkedService is the BasicLinkedService implementation for ODataLinkedService. +func (odls ODataLinkedService) AsEloquaLinkedService() (*EloquaLinkedService, bool) { + return nil, false +} + +// AsDrillLinkedService is the BasicLinkedService implementation for ODataLinkedService. +func (odls ODataLinkedService) AsDrillLinkedService() (*DrillLinkedService, bool) { + return nil, false +} + +// AsCouchbaseLinkedService is the BasicLinkedService implementation for ODataLinkedService. +func (odls ODataLinkedService) AsCouchbaseLinkedService() (*CouchbaseLinkedService, bool) { + return nil, false +} + +// AsConcurLinkedService is the BasicLinkedService implementation for ODataLinkedService. +func (odls ODataLinkedService) AsConcurLinkedService() (*ConcurLinkedService, bool) { + return nil, false +} + +// AsAzurePostgreSQLLinkedService is the BasicLinkedService implementation for ODataLinkedService. +func (odls ODataLinkedService) AsAzurePostgreSQLLinkedService() (*AzurePostgreSQLLinkedService, bool) { + return nil, false +} + +// AsAmazonMWSLinkedService is the BasicLinkedService implementation for ODataLinkedService. +func (odls ODataLinkedService) AsAmazonMWSLinkedService() (*AmazonMWSLinkedService, bool) { + return nil, false +} + +// AsSapHanaLinkedService is the BasicLinkedService implementation for ODataLinkedService. +func (odls ODataLinkedService) AsSapHanaLinkedService() (*SapHanaLinkedService, bool) { + return nil, false +} + +// AsSapBWLinkedService is the BasicLinkedService implementation for ODataLinkedService. +func (odls ODataLinkedService) AsSapBWLinkedService() (*SapBWLinkedService, bool) { + return nil, false +} + +// AsSftpServerLinkedService is the BasicLinkedService implementation for ODataLinkedService. +func (odls ODataLinkedService) AsSftpServerLinkedService() (*SftpServerLinkedService, bool) { + return nil, false +} + +// AsFtpServerLinkedService is the BasicLinkedService implementation for ODataLinkedService. +func (odls ODataLinkedService) AsFtpServerLinkedService() (*FtpServerLinkedService, bool) { + return nil, false +} + +// AsHTTPLinkedService is the BasicLinkedService implementation for ODataLinkedService. +func (odls ODataLinkedService) AsHTTPLinkedService() (*HTTPLinkedService, bool) { + return nil, false +} + +// AsAzureSearchLinkedService is the BasicLinkedService implementation for ODataLinkedService. +func (odls ODataLinkedService) AsAzureSearchLinkedService() (*AzureSearchLinkedService, bool) { + return nil, false +} + +// AsCustomDataSourceLinkedService is the BasicLinkedService implementation for ODataLinkedService. +func (odls ODataLinkedService) AsCustomDataSourceLinkedService() (*CustomDataSourceLinkedService, bool) { + return nil, false +} + +// AsAmazonRedshiftLinkedService is the BasicLinkedService implementation for ODataLinkedService. +func (odls ODataLinkedService) AsAmazonRedshiftLinkedService() (*AmazonRedshiftLinkedService, bool) { + return nil, false +} + +// AsAmazonS3LinkedService is the BasicLinkedService implementation for ODataLinkedService. +func (odls ODataLinkedService) AsAmazonS3LinkedService() (*AmazonS3LinkedService, bool) { + return nil, false +} + +// AsSapEccLinkedService is the BasicLinkedService implementation for ODataLinkedService. +func (odls ODataLinkedService) AsSapEccLinkedService() (*SapEccLinkedService, bool) { + return nil, false +} + +// AsSapCloudForCustomerLinkedService is the BasicLinkedService implementation for ODataLinkedService. +func (odls ODataLinkedService) AsSapCloudForCustomerLinkedService() (*SapCloudForCustomerLinkedService, bool) { + return nil, false +} + +// AsSalesforceLinkedService is the BasicLinkedService implementation for ODataLinkedService. +func (odls ODataLinkedService) AsSalesforceLinkedService() (*SalesforceLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeStoreLinkedService is the BasicLinkedService implementation for ODataLinkedService. +func (odls ODataLinkedService) AsAzureDataLakeStoreLinkedService() (*AzureDataLakeStoreLinkedService, bool) { + return nil, false +} + +// AsMongoDbLinkedService is the BasicLinkedService implementation for ODataLinkedService. +func (odls ODataLinkedService) AsMongoDbLinkedService() (*MongoDbLinkedService, bool) { + return nil, false +} + +// AsCassandraLinkedService is the BasicLinkedService implementation for ODataLinkedService. +func (odls ODataLinkedService) AsCassandraLinkedService() (*CassandraLinkedService, bool) { + return nil, false +} + +// AsWebLinkedService is the BasicLinkedService implementation for ODataLinkedService. +func (odls ODataLinkedService) AsWebLinkedService() (*WebLinkedService, bool) { + return nil, false +} + +// AsODataLinkedService is the BasicLinkedService implementation for ODataLinkedService. +func (odls ODataLinkedService) AsODataLinkedService() (*ODataLinkedService, bool) { + return &odls, true +} + +// AsHdfsLinkedService is the BasicLinkedService implementation for ODataLinkedService. +func (odls ODataLinkedService) AsHdfsLinkedService() (*HdfsLinkedService, bool) { + return nil, false +} + +// AsOdbcLinkedService is the BasicLinkedService implementation for ODataLinkedService. +func (odls ODataLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, bool) { + return nil, false +} + +// AsAzureMLLinkedService is the BasicLinkedService implementation for ODataLinkedService. +func (odls ODataLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { + return nil, false +} + +// AsTeradataLinkedService is the BasicLinkedService implementation for ODataLinkedService. +func (odls ODataLinkedService) AsTeradataLinkedService() (*TeradataLinkedService, bool) { + return nil, false +} + +// AsDb2LinkedService is the BasicLinkedService implementation for ODataLinkedService. +func (odls ODataLinkedService) AsDb2LinkedService() (*Db2LinkedService, bool) { + return nil, false +} + +// AsSybaseLinkedService is the BasicLinkedService implementation for ODataLinkedService. +func (odls ODataLinkedService) AsSybaseLinkedService() (*SybaseLinkedService, bool) { + return nil, false +} + +// AsPostgreSQLLinkedService is the BasicLinkedService implementation for ODataLinkedService. +func (odls ODataLinkedService) AsPostgreSQLLinkedService() (*PostgreSQLLinkedService, bool) { + return nil, false +} + +// AsMySQLLinkedService is the BasicLinkedService implementation for ODataLinkedService. +func (odls ODataLinkedService) AsMySQLLinkedService() (*MySQLLinkedService, bool) { + return nil, false +} + +// AsAzureMySQLLinkedService is the BasicLinkedService implementation for ODataLinkedService. +func (odls ODataLinkedService) AsAzureMySQLLinkedService() (*AzureMySQLLinkedService, bool) { + return nil, false +} + +// AsOracleLinkedService is the BasicLinkedService implementation for ODataLinkedService. +func (odls ODataLinkedService) AsOracleLinkedService() (*OracleLinkedService, bool) { + return nil, false +} + +// AsFileServerLinkedService is the BasicLinkedService implementation for ODataLinkedService. +func (odls ODataLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { + return nil, false +} + +// AsHDInsightLinkedService is the BasicLinkedService implementation for ODataLinkedService. +func (odls ODataLinkedService) AsHDInsightLinkedService() (*HDInsightLinkedService, bool) { + return nil, false +} + +// AsDynamicsLinkedService is the BasicLinkedService implementation for ODataLinkedService. +func (odls ODataLinkedService) AsDynamicsLinkedService() (*DynamicsLinkedService, bool) { + return nil, false +} + +// AsCosmosDbLinkedService is the BasicLinkedService implementation for ODataLinkedService. +func (odls ODataLinkedService) AsCosmosDbLinkedService() (*CosmosDbLinkedService, bool) { + return nil, false +} + +// AsAzureKeyVaultLinkedService is the BasicLinkedService implementation for ODataLinkedService. +func (odls ODataLinkedService) AsAzureKeyVaultLinkedService() (*AzureKeyVaultLinkedService, bool) { + return nil, false +} + +// AsAzureBatchLinkedService is the BasicLinkedService implementation for ODataLinkedService. +func (odls ODataLinkedService) AsAzureBatchLinkedService() (*AzureBatchLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDatabaseLinkedService is the BasicLinkedService implementation for ODataLinkedService. +func (odls ODataLinkedService) AsAzureSQLDatabaseLinkedService() (*AzureSQLDatabaseLinkedService, bool) { + return nil, false +} + +// AsSQLServerLinkedService is the BasicLinkedService implementation for ODataLinkedService. +func (odls ODataLinkedService) AsSQLServerLinkedService() (*SQLServerLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDWLinkedService is the BasicLinkedService implementation for ODataLinkedService. +func (odls ODataLinkedService) AsAzureSQLDWLinkedService() (*AzureSQLDWLinkedService, bool) { + return nil, false +} + +// AsAzureStorageLinkedService is the BasicLinkedService implementation for ODataLinkedService. +func (odls ODataLinkedService) AsAzureStorageLinkedService() (*AzureStorageLinkedService, bool) { + return nil, false +} + +// AsLinkedService is the BasicLinkedService implementation for ODataLinkedService. +func (odls ODataLinkedService) AsLinkedService() (*LinkedService, bool) { + return nil, false +} + +// AsBasicLinkedService is the BasicLinkedService implementation for ODataLinkedService. +func (odls ODataLinkedService) AsBasicLinkedService() (BasicLinkedService, bool) { + return &odls, true +} + +// UnmarshalJSON is the custom unmarshaler for ODataLinkedService struct. +func (odls *ODataLinkedService) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "typeProperties": + if v != nil { + var oDataLinkedServiceTypeProperties ODataLinkedServiceTypeProperties + err = json.Unmarshal(*v, &oDataLinkedServiceTypeProperties) + if err != nil { + return err + } + odls.ODataLinkedServiceTypeProperties = &oDataLinkedServiceTypeProperties + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if odls.AdditionalProperties == nil { + odls.AdditionalProperties = make(map[string]interface{}) + } + odls.AdditionalProperties[k] = additionalProperties + } + case "connectVia": + if v != nil { + var connectVia IntegrationRuntimeReference + err = json.Unmarshal(*v, &connectVia) + if err != nil { + return err + } + odls.ConnectVia = &connectVia + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + odls.Description = &description + } + case "parameters": + if v != nil { + var parameters map[string]*ParameterSpecification + err = json.Unmarshal(*v, ¶meters) + if err != nil { + return err + } + odls.Parameters = parameters + } + case "annotations": + if v != nil { + var annotations []interface{} + err = json.Unmarshal(*v, &annotations) + if err != nil { + return err + } + odls.Annotations = &annotations + } + case "type": + if v != nil { + var typeVar TypeBasicLinkedService + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + odls.Type = typeVar + } + } + } + + return nil +} + +// ODataLinkedServiceTypeProperties oData linked service properties. +type ODataLinkedServiceTypeProperties struct { + // URL - The URL of the OData service endpoint. Type: string (or Expression with resultType string). + URL interface{} `json:"url,omitempty"` + // AuthenticationType - Type of authentication used to connect to the OData service. Possible values include: 'ODataAuthenticationTypeBasic', 'ODataAuthenticationTypeAnonymous' + AuthenticationType ODataAuthenticationType `json:"authenticationType,omitempty"` + // UserName - User name of the OData service. Type: string (or Expression with resultType string). + UserName interface{} `json:"userName,omitempty"` + // Password - Password of the OData service. + Password BasicSecretBase `json:"password,omitempty"` + // EncryptedCredential - The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string). + EncryptedCredential interface{} `json:"encryptedCredential,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for ODataLinkedServiceTypeProperties struct. +func (odlstp *ODataLinkedServiceTypeProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "url": + if v != nil { + var URL interface{} + err = json.Unmarshal(*v, &URL) + if err != nil { + return err + } + odlstp.URL = URL + } + case "authenticationType": + if v != nil { + var authenticationType ODataAuthenticationType + err = json.Unmarshal(*v, &authenticationType) + if err != nil { + return err + } + odlstp.AuthenticationType = authenticationType + } + case "userName": + if v != nil { + var userName interface{} + err = json.Unmarshal(*v, &userName) + if err != nil { + return err + } + odlstp.UserName = userName + } + case "password": + if v != nil { + password, err := unmarshalBasicSecretBase(*v) + if err != nil { + return err + } + odlstp.Password = password + } + case "encryptedCredential": + if v != nil { + var encryptedCredential interface{} + err = json.Unmarshal(*v, &encryptedCredential) + if err != nil { + return err + } + odlstp.EncryptedCredential = encryptedCredential + } + } + } + + return nil +} + +// ODataResourceDataset the Open Data Protocol (OData) resource dataset. +type ODataResourceDataset struct { + // ODataResourceDatasetTypeProperties - OData dataset properties. + *ODataResourceDatasetTypeProperties `json:"typeProperties,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Description - Dataset description. + Description *string `json:"description,omitempty"` + // Structure - Columns that define the structure of the dataset. Type: array (or Expression with resultType array), itemType: DatasetDataElement. + Structure interface{} `json:"structure,omitempty"` + // LinkedServiceName - Linked service reference. + LinkedServiceName *LinkedServiceReference `json:"linkedServiceName,omitempty"` + // Parameters - Parameters for dataset. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeDataset', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSQLServerTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSalesforceObject', 'TypeRelationalTable', 'TypeAzureMySQLTable', 'TypeOracleTable', 'TypeODataResource', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeAzureDataLakeStoreFile', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeAmazonS3Object' + Type TypeBasicDataset `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ODataResourceDataset. +func (odrd ODataResourceDataset) MarshalJSON() ([]byte, error) { + odrd.Type = TypeODataResource + objectMap := make(map[string]interface{}) + if odrd.ODataResourceDatasetTypeProperties != nil { + objectMap["typeProperties"] = odrd.ODataResourceDatasetTypeProperties + } + if odrd.Description != nil { + objectMap["description"] = odrd.Description + } + objectMap["structure"] = odrd.Structure + if odrd.LinkedServiceName != nil { + objectMap["linkedServiceName"] = odrd.LinkedServiceName + } + if odrd.Parameters != nil { + objectMap["parameters"] = odrd.Parameters + } + if odrd.Annotations != nil { + objectMap["annotations"] = odrd.Annotations + } + if odrd.Type != "" { + objectMap["type"] = odrd.Type + } + for k, v := range odrd.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysObjectDataset is the BasicDataset implementation for ODataResourceDataset. +func (odrd ODataResourceDataset) AsResponsysObjectDataset() (*ResponsysObjectDataset, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudObjectDataset is the BasicDataset implementation for ODataResourceDataset. +func (odrd ODataResourceDataset) AsSalesforceMarketingCloudObjectDataset() (*SalesforceMarketingCloudObjectDataset, bool) { + return nil, false +} + +// AsVerticaTableDataset is the BasicDataset implementation for ODataResourceDataset. +func (odrd ODataResourceDataset) AsVerticaTableDataset() (*VerticaTableDataset, bool) { + return nil, false +} + +// AsNetezzaTableDataset is the BasicDataset implementation for ODataResourceDataset. +func (odrd ODataResourceDataset) AsNetezzaTableDataset() (*NetezzaTableDataset, bool) { + return nil, false +} + +// AsZohoObjectDataset is the BasicDataset implementation for ODataResourceDataset. +func (odrd ODataResourceDataset) AsZohoObjectDataset() (*ZohoObjectDataset, bool) { + return nil, false +} + +// AsXeroObjectDataset is the BasicDataset implementation for ODataResourceDataset. +func (odrd ODataResourceDataset) AsXeroObjectDataset() (*XeroObjectDataset, bool) { + return nil, false +} + +// AsSquareObjectDataset is the BasicDataset implementation for ODataResourceDataset. +func (odrd ODataResourceDataset) AsSquareObjectDataset() (*SquareObjectDataset, bool) { + return nil, false +} + +// AsSparkObjectDataset is the BasicDataset implementation for ODataResourceDataset. +func (odrd ODataResourceDataset) AsSparkObjectDataset() (*SparkObjectDataset, bool) { + return nil, false +} + +// AsShopifyObjectDataset is the BasicDataset implementation for ODataResourceDataset. +func (odrd ODataResourceDataset) AsShopifyObjectDataset() (*ShopifyObjectDataset, bool) { + return nil, false +} + +// AsServiceNowObjectDataset is the BasicDataset implementation for ODataResourceDataset. +func (odrd ODataResourceDataset) AsServiceNowObjectDataset() (*ServiceNowObjectDataset, bool) { + return nil, false +} + +// AsQuickBooksObjectDataset is the BasicDataset implementation for ODataResourceDataset. +func (odrd ODataResourceDataset) AsQuickBooksObjectDataset() (*QuickBooksObjectDataset, bool) { + return nil, false +} + +// AsPrestoObjectDataset is the BasicDataset implementation for ODataResourceDataset. +func (odrd ODataResourceDataset) AsPrestoObjectDataset() (*PrestoObjectDataset, bool) { + return nil, false +} + +// AsPhoenixObjectDataset is the BasicDataset implementation for ODataResourceDataset. +func (odrd ODataResourceDataset) AsPhoenixObjectDataset() (*PhoenixObjectDataset, bool) { + return nil, false +} + +// AsPaypalObjectDataset is the BasicDataset implementation for ODataResourceDataset. +func (odrd ODataResourceDataset) AsPaypalObjectDataset() (*PaypalObjectDataset, bool) { + return nil, false +} + +// AsMarketoObjectDataset is the BasicDataset implementation for ODataResourceDataset. +func (odrd ODataResourceDataset) AsMarketoObjectDataset() (*MarketoObjectDataset, bool) { + return nil, false +} + +// AsMariaDBTableDataset is the BasicDataset implementation for ODataResourceDataset. +func (odrd ODataResourceDataset) AsMariaDBTableDataset() (*MariaDBTableDataset, bool) { + return nil, false +} + +// AsMagentoObjectDataset is the BasicDataset implementation for ODataResourceDataset. +func (odrd ODataResourceDataset) AsMagentoObjectDataset() (*MagentoObjectDataset, bool) { + return nil, false +} + +// AsJiraObjectDataset is the BasicDataset implementation for ODataResourceDataset. +func (odrd ODataResourceDataset) AsJiraObjectDataset() (*JiraObjectDataset, bool) { + return nil, false +} + +// AsImpalaObjectDataset is the BasicDataset implementation for ODataResourceDataset. +func (odrd ODataResourceDataset) AsImpalaObjectDataset() (*ImpalaObjectDataset, bool) { + return nil, false +} + +// AsHubspotObjectDataset is the BasicDataset implementation for ODataResourceDataset. +func (odrd ODataResourceDataset) AsHubspotObjectDataset() (*HubspotObjectDataset, bool) { + return nil, false +} + +// AsHiveObjectDataset is the BasicDataset implementation for ODataResourceDataset. +func (odrd ODataResourceDataset) AsHiveObjectDataset() (*HiveObjectDataset, bool) { + return nil, false +} + +// AsHBaseObjectDataset is the BasicDataset implementation for ODataResourceDataset. +func (odrd ODataResourceDataset) AsHBaseObjectDataset() (*HBaseObjectDataset, bool) { + return nil, false +} + +// AsGreenplumTableDataset is the BasicDataset implementation for ODataResourceDataset. +func (odrd ODataResourceDataset) AsGreenplumTableDataset() (*GreenplumTableDataset, bool) { + return nil, false +} + +// AsGoogleBigQueryObjectDataset is the BasicDataset implementation for ODataResourceDataset. +func (odrd ODataResourceDataset) AsGoogleBigQueryObjectDataset() (*GoogleBigQueryObjectDataset, bool) { + return nil, false +} + +// AsEloquaObjectDataset is the BasicDataset implementation for ODataResourceDataset. +func (odrd ODataResourceDataset) AsEloquaObjectDataset() (*EloquaObjectDataset, bool) { + return nil, false +} + +// AsDrillTableDataset is the BasicDataset implementation for ODataResourceDataset. +func (odrd ODataResourceDataset) AsDrillTableDataset() (*DrillTableDataset, bool) { + return nil, false +} + +// AsCouchbaseTableDataset is the BasicDataset implementation for ODataResourceDataset. +func (odrd ODataResourceDataset) AsCouchbaseTableDataset() (*CouchbaseTableDataset, bool) { + return nil, false +} + +// AsConcurObjectDataset is the BasicDataset implementation for ODataResourceDataset. +func (odrd ODataResourceDataset) AsConcurObjectDataset() (*ConcurObjectDataset, bool) { + return nil, false +} + +// AsAzurePostgreSQLTableDataset is the BasicDataset implementation for ODataResourceDataset. +func (odrd ODataResourceDataset) AsAzurePostgreSQLTableDataset() (*AzurePostgreSQLTableDataset, bool) { + return nil, false +} + +// AsAmazonMWSObjectDataset is the BasicDataset implementation for ODataResourceDataset. +func (odrd ODataResourceDataset) AsAmazonMWSObjectDataset() (*AmazonMWSObjectDataset, bool) { + return nil, false +} + +// AsHTTPDataset is the BasicDataset implementation for ODataResourceDataset. +func (odrd ODataResourceDataset) AsHTTPDataset() (*HTTPDataset, bool) { + return nil, false +} + +// AsAzureSearchIndexDataset is the BasicDataset implementation for ODataResourceDataset. +func (odrd ODataResourceDataset) AsAzureSearchIndexDataset() (*AzureSearchIndexDataset, bool) { + return nil, false +} + +// AsWebTableDataset is the BasicDataset implementation for ODataResourceDataset. +func (odrd ODataResourceDataset) AsWebTableDataset() (*WebTableDataset, bool) { + return nil, false +} + +// AsSQLServerTableDataset is the BasicDataset implementation for ODataResourceDataset. +func (odrd ODataResourceDataset) AsSQLServerTableDataset() (*SQLServerTableDataset, bool) { + return nil, false +} + +// AsSapEccResourceDataset is the BasicDataset implementation for ODataResourceDataset. +func (odrd ODataResourceDataset) AsSapEccResourceDataset() (*SapEccResourceDataset, bool) { + return nil, false +} + +// AsSapCloudForCustomerResourceDataset is the BasicDataset implementation for ODataResourceDataset. +func (odrd ODataResourceDataset) AsSapCloudForCustomerResourceDataset() (*SapCloudForCustomerResourceDataset, bool) { + return nil, false +} + +// AsSalesforceObjectDataset is the BasicDataset implementation for ODataResourceDataset. +func (odrd ODataResourceDataset) AsSalesforceObjectDataset() (*SalesforceObjectDataset, bool) { + return nil, false +} + +// AsRelationalTableDataset is the BasicDataset implementation for ODataResourceDataset. +func (odrd ODataResourceDataset) AsRelationalTableDataset() (*RelationalTableDataset, bool) { + return nil, false +} + +// AsAzureMySQLTableDataset is the BasicDataset implementation for ODataResourceDataset. +func (odrd ODataResourceDataset) AsAzureMySQLTableDataset() (*AzureMySQLTableDataset, bool) { + return nil, false +} + +// AsOracleTableDataset is the BasicDataset implementation for ODataResourceDataset. +func (odrd ODataResourceDataset) AsOracleTableDataset() (*OracleTableDataset, bool) { + return nil, false +} + +// AsODataResourceDataset is the BasicDataset implementation for ODataResourceDataset. +func (odrd ODataResourceDataset) AsODataResourceDataset() (*ODataResourceDataset, bool) { + return &odrd, true +} + +// AsMongoDbCollectionDataset is the BasicDataset implementation for ODataResourceDataset. +func (odrd ODataResourceDataset) AsMongoDbCollectionDataset() (*MongoDbCollectionDataset, bool) { + return nil, false +} + +// AsFileShareDataset is the BasicDataset implementation for ODataResourceDataset. +func (odrd ODataResourceDataset) AsFileShareDataset() (*FileShareDataset, bool) { + return nil, false +} + +// AsAzureDataLakeStoreDataset is the BasicDataset implementation for ODataResourceDataset. +func (odrd ODataResourceDataset) AsAzureDataLakeStoreDataset() (*AzureDataLakeStoreDataset, bool) { + return nil, false +} + +// AsDynamicsEntityDataset is the BasicDataset implementation for ODataResourceDataset. +func (odrd ODataResourceDataset) AsDynamicsEntityDataset() (*DynamicsEntityDataset, bool) { + return nil, false +} + +// AsDocumentDbCollectionDataset is the BasicDataset implementation for ODataResourceDataset. +func (odrd ODataResourceDataset) AsDocumentDbCollectionDataset() (*DocumentDbCollectionDataset, bool) { + return nil, false +} + +// AsCustomDataset is the BasicDataset implementation for ODataResourceDataset. +func (odrd ODataResourceDataset) AsCustomDataset() (*CustomDataset, bool) { + return nil, false +} + +// AsCassandraTableDataset is the BasicDataset implementation for ODataResourceDataset. +func (odrd ODataResourceDataset) AsCassandraTableDataset() (*CassandraTableDataset, bool) { + return nil, false +} + +// AsAzureSQLDWTableDataset is the BasicDataset implementation for ODataResourceDataset. +func (odrd ODataResourceDataset) AsAzureSQLDWTableDataset() (*AzureSQLDWTableDataset, bool) { + return nil, false +} + +// AsAzureSQLTableDataset is the BasicDataset implementation for ODataResourceDataset. +func (odrd ODataResourceDataset) AsAzureSQLTableDataset() (*AzureSQLTableDataset, bool) { + return nil, false +} + +// AsAzureTableDataset is the BasicDataset implementation for ODataResourceDataset. +func (odrd ODataResourceDataset) AsAzureTableDataset() (*AzureTableDataset, bool) { + return nil, false +} + +// AsAzureBlobDataset is the BasicDataset implementation for ODataResourceDataset. +func (odrd ODataResourceDataset) AsAzureBlobDataset() (*AzureBlobDataset, bool) { + return nil, false +} + +// AsAmazonS3Dataset is the BasicDataset implementation for ODataResourceDataset. +func (odrd ODataResourceDataset) AsAmazonS3Dataset() (*AmazonS3Dataset, bool) { + return nil, false +} + +// AsDataset is the BasicDataset implementation for ODataResourceDataset. +func (odrd ODataResourceDataset) AsDataset() (*Dataset, bool) { + return nil, false +} + +// AsBasicDataset is the BasicDataset implementation for ODataResourceDataset. +func (odrd ODataResourceDataset) AsBasicDataset() (BasicDataset, bool) { + return &odrd, true +} + +// UnmarshalJSON is the custom unmarshaler for ODataResourceDataset struct. +func (odrd *ODataResourceDataset) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "typeProperties": + if v != nil { + var oDataResourceDatasetTypeProperties ODataResourceDatasetTypeProperties + err = json.Unmarshal(*v, &oDataResourceDatasetTypeProperties) + if err != nil { + return err + } + odrd.ODataResourceDatasetTypeProperties = &oDataResourceDatasetTypeProperties + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if odrd.AdditionalProperties == nil { + odrd.AdditionalProperties = make(map[string]interface{}) + } + odrd.AdditionalProperties[k] = additionalProperties + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + odrd.Description = &description + } + case "structure": + if v != nil { + var structure interface{} + err = json.Unmarshal(*v, &structure) + if err != nil { + return err + } + odrd.Structure = structure + } + case "linkedServiceName": + if v != nil { + var linkedServiceName LinkedServiceReference + err = json.Unmarshal(*v, &linkedServiceName) + if err != nil { + return err + } + odrd.LinkedServiceName = &linkedServiceName + } + case "parameters": + if v != nil { + var parameters map[string]*ParameterSpecification + err = json.Unmarshal(*v, ¶meters) + if err != nil { + return err + } + odrd.Parameters = parameters + } + case "annotations": + if v != nil { + var annotations []interface{} + err = json.Unmarshal(*v, &annotations) + if err != nil { + return err + } + odrd.Annotations = &annotations + } + case "type": + if v != nil { + var typeVar TypeBasicDataset + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + odrd.Type = typeVar + } + } + } + + return nil +} + +// ODataResourceDatasetTypeProperties oData dataset properties. +type ODataResourceDatasetTypeProperties struct { + // Path - The OData resource path. Type: string (or Expression with resultType string). + Path interface{} `json:"path,omitempty"` +} + +// OdbcLinkedService open Database Connectivity (ODBC) linked service. +type OdbcLinkedService struct { + // OdbcLinkedServiceTypeProperties - ODBC linked service properties. + *OdbcLinkedServiceTypeProperties `json:"typeProperties,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // ConnectVia - The integration runtime reference. + ConnectVia *IntegrationRuntimeReference `json:"connectVia,omitempty"` + // Description - Linked service description. + Description *string `json:"description,omitempty"` + // Parameters - Parameters for linked service. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeLinkedService', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforce', 'TypeAzureDataLakeStore', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureStorage' + Type TypeBasicLinkedService `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for OdbcLinkedService. +func (ols OdbcLinkedService) MarshalJSON() ([]byte, error) { + ols.Type = TypeOdbc + objectMap := make(map[string]interface{}) + if ols.OdbcLinkedServiceTypeProperties != nil { + objectMap["typeProperties"] = ols.OdbcLinkedServiceTypeProperties + } + if ols.ConnectVia != nil { + objectMap["connectVia"] = ols.ConnectVia + } + if ols.Description != nil { + objectMap["description"] = ols.Description + } + if ols.Parameters != nil { + objectMap["parameters"] = ols.Parameters + } + if ols.Annotations != nil { + objectMap["annotations"] = ols.Annotations + } + if ols.Type != "" { + objectMap["type"] = ols.Type + } + for k, v := range ols.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysLinkedService is the BasicLinkedService implementation for OdbcLinkedService. +func (ols OdbcLinkedService) AsResponsysLinkedService() (*ResponsysLinkedService, bool) { + return nil, false +} + +// AsAzureDatabricksLinkedService is the BasicLinkedService implementation for OdbcLinkedService. +func (ols OdbcLinkedService) AsAzureDatabricksLinkedService() (*AzureDatabricksLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeAnalyticsLinkedService is the BasicLinkedService implementation for OdbcLinkedService. +func (ols OdbcLinkedService) AsAzureDataLakeAnalyticsLinkedService() (*AzureDataLakeAnalyticsLinkedService, bool) { + return nil, false +} + +// AsHDInsightOnDemandLinkedService is the BasicLinkedService implementation for OdbcLinkedService. +func (ols OdbcLinkedService) AsHDInsightOnDemandLinkedService() (*HDInsightOnDemandLinkedService, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudLinkedService is the BasicLinkedService implementation for OdbcLinkedService. +func (ols OdbcLinkedService) AsSalesforceMarketingCloudLinkedService() (*SalesforceMarketingCloudLinkedService, bool) { + return nil, false +} + +// AsNetezzaLinkedService is the BasicLinkedService implementation for OdbcLinkedService. +func (ols OdbcLinkedService) AsNetezzaLinkedService() (*NetezzaLinkedService, bool) { + return nil, false +} + +// AsVerticaLinkedService is the BasicLinkedService implementation for OdbcLinkedService. +func (ols OdbcLinkedService) AsVerticaLinkedService() (*VerticaLinkedService, bool) { + return nil, false +} + +// AsZohoLinkedService is the BasicLinkedService implementation for OdbcLinkedService. +func (ols OdbcLinkedService) AsZohoLinkedService() (*ZohoLinkedService, bool) { + return nil, false +} + +// AsXeroLinkedService is the BasicLinkedService implementation for OdbcLinkedService. +func (ols OdbcLinkedService) AsXeroLinkedService() (*XeroLinkedService, bool) { + return nil, false +} + +// AsSquareLinkedService is the BasicLinkedService implementation for OdbcLinkedService. +func (ols OdbcLinkedService) AsSquareLinkedService() (*SquareLinkedService, bool) { + return nil, false +} + +// AsSparkLinkedService is the BasicLinkedService implementation for OdbcLinkedService. +func (ols OdbcLinkedService) AsSparkLinkedService() (*SparkLinkedService, bool) { + return nil, false +} + +// AsShopifyLinkedService is the BasicLinkedService implementation for OdbcLinkedService. +func (ols OdbcLinkedService) AsShopifyLinkedService() (*ShopifyLinkedService, bool) { + return nil, false +} + +// AsServiceNowLinkedService is the BasicLinkedService implementation for OdbcLinkedService. +func (ols OdbcLinkedService) AsServiceNowLinkedService() (*ServiceNowLinkedService, bool) { + return nil, false +} + +// AsQuickBooksLinkedService is the BasicLinkedService implementation for OdbcLinkedService. +func (ols OdbcLinkedService) AsQuickBooksLinkedService() (*QuickBooksLinkedService, bool) { + return nil, false +} + +// AsPrestoLinkedService is the BasicLinkedService implementation for OdbcLinkedService. +func (ols OdbcLinkedService) AsPrestoLinkedService() (*PrestoLinkedService, bool) { + return nil, false +} + +// AsPhoenixLinkedService is the BasicLinkedService implementation for OdbcLinkedService. +func (ols OdbcLinkedService) AsPhoenixLinkedService() (*PhoenixLinkedService, bool) { + return nil, false +} + +// AsPaypalLinkedService is the BasicLinkedService implementation for OdbcLinkedService. +func (ols OdbcLinkedService) AsPaypalLinkedService() (*PaypalLinkedService, bool) { + return nil, false +} + +// AsMarketoLinkedService is the BasicLinkedService implementation for OdbcLinkedService. +func (ols OdbcLinkedService) AsMarketoLinkedService() (*MarketoLinkedService, bool) { + return nil, false +} + +// AsMariaDBLinkedService is the BasicLinkedService implementation for OdbcLinkedService. +func (ols OdbcLinkedService) AsMariaDBLinkedService() (*MariaDBLinkedService, bool) { + return nil, false +} + +// AsMagentoLinkedService is the BasicLinkedService implementation for OdbcLinkedService. +func (ols OdbcLinkedService) AsMagentoLinkedService() (*MagentoLinkedService, bool) { + return nil, false +} + +// AsJiraLinkedService is the BasicLinkedService implementation for OdbcLinkedService. +func (ols OdbcLinkedService) AsJiraLinkedService() (*JiraLinkedService, bool) { + return nil, false +} + +// AsImpalaLinkedService is the BasicLinkedService implementation for OdbcLinkedService. +func (ols OdbcLinkedService) AsImpalaLinkedService() (*ImpalaLinkedService, bool) { + return nil, false +} + +// AsHubspotLinkedService is the BasicLinkedService implementation for OdbcLinkedService. +func (ols OdbcLinkedService) AsHubspotLinkedService() (*HubspotLinkedService, bool) { + return nil, false +} + +// AsHiveLinkedService is the BasicLinkedService implementation for OdbcLinkedService. +func (ols OdbcLinkedService) AsHiveLinkedService() (*HiveLinkedService, bool) { + return nil, false +} + +// AsHBaseLinkedService is the BasicLinkedService implementation for OdbcLinkedService. +func (ols OdbcLinkedService) AsHBaseLinkedService() (*HBaseLinkedService, bool) { + return nil, false +} + +// AsGreenplumLinkedService is the BasicLinkedService implementation for OdbcLinkedService. +func (ols OdbcLinkedService) AsGreenplumLinkedService() (*GreenplumLinkedService, bool) { + return nil, false +} + +// AsGoogleBigQueryLinkedService is the BasicLinkedService implementation for OdbcLinkedService. +func (ols OdbcLinkedService) AsGoogleBigQueryLinkedService() (*GoogleBigQueryLinkedService, bool) { + return nil, false +} + +// AsEloquaLinkedService is the BasicLinkedService implementation for OdbcLinkedService. +func (ols OdbcLinkedService) AsEloquaLinkedService() (*EloquaLinkedService, bool) { + return nil, false +} + +// AsDrillLinkedService is the BasicLinkedService implementation for OdbcLinkedService. +func (ols OdbcLinkedService) AsDrillLinkedService() (*DrillLinkedService, bool) { + return nil, false +} + +// AsCouchbaseLinkedService is the BasicLinkedService implementation for OdbcLinkedService. +func (ols OdbcLinkedService) AsCouchbaseLinkedService() (*CouchbaseLinkedService, bool) { + return nil, false +} + +// AsConcurLinkedService is the BasicLinkedService implementation for OdbcLinkedService. +func (ols OdbcLinkedService) AsConcurLinkedService() (*ConcurLinkedService, bool) { + return nil, false +} + +// AsAzurePostgreSQLLinkedService is the BasicLinkedService implementation for OdbcLinkedService. +func (ols OdbcLinkedService) AsAzurePostgreSQLLinkedService() (*AzurePostgreSQLLinkedService, bool) { + return nil, false +} + +// AsAmazonMWSLinkedService is the BasicLinkedService implementation for OdbcLinkedService. +func (ols OdbcLinkedService) AsAmazonMWSLinkedService() (*AmazonMWSLinkedService, bool) { + return nil, false +} + +// AsSapHanaLinkedService is the BasicLinkedService implementation for OdbcLinkedService. +func (ols OdbcLinkedService) AsSapHanaLinkedService() (*SapHanaLinkedService, bool) { + return nil, false +} + +// AsSapBWLinkedService is the BasicLinkedService implementation for OdbcLinkedService. +func (ols OdbcLinkedService) AsSapBWLinkedService() (*SapBWLinkedService, bool) { + return nil, false +} + +// AsSftpServerLinkedService is the BasicLinkedService implementation for OdbcLinkedService. +func (ols OdbcLinkedService) AsSftpServerLinkedService() (*SftpServerLinkedService, bool) { + return nil, false +} + +// AsFtpServerLinkedService is the BasicLinkedService implementation for OdbcLinkedService. +func (ols OdbcLinkedService) AsFtpServerLinkedService() (*FtpServerLinkedService, bool) { + return nil, false +} + +// AsHTTPLinkedService is the BasicLinkedService implementation for OdbcLinkedService. +func (ols OdbcLinkedService) AsHTTPLinkedService() (*HTTPLinkedService, bool) { + return nil, false +} + +// AsAzureSearchLinkedService is the BasicLinkedService implementation for OdbcLinkedService. +func (ols OdbcLinkedService) AsAzureSearchLinkedService() (*AzureSearchLinkedService, bool) { + return nil, false +} + +// AsCustomDataSourceLinkedService is the BasicLinkedService implementation for OdbcLinkedService. +func (ols OdbcLinkedService) AsCustomDataSourceLinkedService() (*CustomDataSourceLinkedService, bool) { + return nil, false +} + +// AsAmazonRedshiftLinkedService is the BasicLinkedService implementation for OdbcLinkedService. +func (ols OdbcLinkedService) AsAmazonRedshiftLinkedService() (*AmazonRedshiftLinkedService, bool) { + return nil, false +} + +// AsAmazonS3LinkedService is the BasicLinkedService implementation for OdbcLinkedService. +func (ols OdbcLinkedService) AsAmazonS3LinkedService() (*AmazonS3LinkedService, bool) { + return nil, false +} + +// AsSapEccLinkedService is the BasicLinkedService implementation for OdbcLinkedService. +func (ols OdbcLinkedService) AsSapEccLinkedService() (*SapEccLinkedService, bool) { + return nil, false +} + +// AsSapCloudForCustomerLinkedService is the BasicLinkedService implementation for OdbcLinkedService. +func (ols OdbcLinkedService) AsSapCloudForCustomerLinkedService() (*SapCloudForCustomerLinkedService, bool) { + return nil, false +} + +// AsSalesforceLinkedService is the BasicLinkedService implementation for OdbcLinkedService. +func (ols OdbcLinkedService) AsSalesforceLinkedService() (*SalesforceLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeStoreLinkedService is the BasicLinkedService implementation for OdbcLinkedService. +func (ols OdbcLinkedService) AsAzureDataLakeStoreLinkedService() (*AzureDataLakeStoreLinkedService, bool) { + return nil, false +} + +// AsMongoDbLinkedService is the BasicLinkedService implementation for OdbcLinkedService. +func (ols OdbcLinkedService) AsMongoDbLinkedService() (*MongoDbLinkedService, bool) { + return nil, false +} + +// AsCassandraLinkedService is the BasicLinkedService implementation for OdbcLinkedService. +func (ols OdbcLinkedService) AsCassandraLinkedService() (*CassandraLinkedService, bool) { + return nil, false +} + +// AsWebLinkedService is the BasicLinkedService implementation for OdbcLinkedService. +func (ols OdbcLinkedService) AsWebLinkedService() (*WebLinkedService, bool) { + return nil, false +} + +// AsODataLinkedService is the BasicLinkedService implementation for OdbcLinkedService. +func (ols OdbcLinkedService) AsODataLinkedService() (*ODataLinkedService, bool) { + return nil, false +} + +// AsHdfsLinkedService is the BasicLinkedService implementation for OdbcLinkedService. +func (ols OdbcLinkedService) AsHdfsLinkedService() (*HdfsLinkedService, bool) { + return nil, false +} + +// AsOdbcLinkedService is the BasicLinkedService implementation for OdbcLinkedService. +func (ols OdbcLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, bool) { + return &ols, true +} + +// AsAzureMLLinkedService is the BasicLinkedService implementation for OdbcLinkedService. +func (ols OdbcLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { + return nil, false +} + +// AsTeradataLinkedService is the BasicLinkedService implementation for OdbcLinkedService. +func (ols OdbcLinkedService) AsTeradataLinkedService() (*TeradataLinkedService, bool) { + return nil, false +} + +// AsDb2LinkedService is the BasicLinkedService implementation for OdbcLinkedService. +func (ols OdbcLinkedService) AsDb2LinkedService() (*Db2LinkedService, bool) { + return nil, false +} + +// AsSybaseLinkedService is the BasicLinkedService implementation for OdbcLinkedService. +func (ols OdbcLinkedService) AsSybaseLinkedService() (*SybaseLinkedService, bool) { + return nil, false +} + +// AsPostgreSQLLinkedService is the BasicLinkedService implementation for OdbcLinkedService. +func (ols OdbcLinkedService) AsPostgreSQLLinkedService() (*PostgreSQLLinkedService, bool) { + return nil, false +} + +// AsMySQLLinkedService is the BasicLinkedService implementation for OdbcLinkedService. +func (ols OdbcLinkedService) AsMySQLLinkedService() (*MySQLLinkedService, bool) { + return nil, false +} + +// AsAzureMySQLLinkedService is the BasicLinkedService implementation for OdbcLinkedService. +func (ols OdbcLinkedService) AsAzureMySQLLinkedService() (*AzureMySQLLinkedService, bool) { + return nil, false +} + +// AsOracleLinkedService is the BasicLinkedService implementation for OdbcLinkedService. +func (ols OdbcLinkedService) AsOracleLinkedService() (*OracleLinkedService, bool) { + return nil, false +} + +// AsFileServerLinkedService is the BasicLinkedService implementation for OdbcLinkedService. +func (ols OdbcLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { + return nil, false +} + +// AsHDInsightLinkedService is the BasicLinkedService implementation for OdbcLinkedService. +func (ols OdbcLinkedService) AsHDInsightLinkedService() (*HDInsightLinkedService, bool) { + return nil, false +} + +// AsDynamicsLinkedService is the BasicLinkedService implementation for OdbcLinkedService. +func (ols OdbcLinkedService) AsDynamicsLinkedService() (*DynamicsLinkedService, bool) { + return nil, false +} + +// AsCosmosDbLinkedService is the BasicLinkedService implementation for OdbcLinkedService. +func (ols OdbcLinkedService) AsCosmosDbLinkedService() (*CosmosDbLinkedService, bool) { + return nil, false +} + +// AsAzureKeyVaultLinkedService is the BasicLinkedService implementation for OdbcLinkedService. +func (ols OdbcLinkedService) AsAzureKeyVaultLinkedService() (*AzureKeyVaultLinkedService, bool) { + return nil, false +} + +// AsAzureBatchLinkedService is the BasicLinkedService implementation for OdbcLinkedService. +func (ols OdbcLinkedService) AsAzureBatchLinkedService() (*AzureBatchLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDatabaseLinkedService is the BasicLinkedService implementation for OdbcLinkedService. +func (ols OdbcLinkedService) AsAzureSQLDatabaseLinkedService() (*AzureSQLDatabaseLinkedService, bool) { + return nil, false +} + +// AsSQLServerLinkedService is the BasicLinkedService implementation for OdbcLinkedService. +func (ols OdbcLinkedService) AsSQLServerLinkedService() (*SQLServerLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDWLinkedService is the BasicLinkedService implementation for OdbcLinkedService. +func (ols OdbcLinkedService) AsAzureSQLDWLinkedService() (*AzureSQLDWLinkedService, bool) { + return nil, false +} + +// AsAzureStorageLinkedService is the BasicLinkedService implementation for OdbcLinkedService. +func (ols OdbcLinkedService) AsAzureStorageLinkedService() (*AzureStorageLinkedService, bool) { + return nil, false +} + +// AsLinkedService is the BasicLinkedService implementation for OdbcLinkedService. +func (ols OdbcLinkedService) AsLinkedService() (*LinkedService, bool) { + return nil, false +} + +// AsBasicLinkedService is the BasicLinkedService implementation for OdbcLinkedService. +func (ols OdbcLinkedService) AsBasicLinkedService() (BasicLinkedService, bool) { + return &ols, true +} + +// UnmarshalJSON is the custom unmarshaler for OdbcLinkedService struct. +func (ols *OdbcLinkedService) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "typeProperties": + if v != nil { + var odbcLinkedServiceTypeProperties OdbcLinkedServiceTypeProperties + err = json.Unmarshal(*v, &odbcLinkedServiceTypeProperties) + if err != nil { + return err + } + ols.OdbcLinkedServiceTypeProperties = &odbcLinkedServiceTypeProperties + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if ols.AdditionalProperties == nil { + ols.AdditionalProperties = make(map[string]interface{}) + } + ols.AdditionalProperties[k] = additionalProperties + } + case "connectVia": + if v != nil { + var connectVia IntegrationRuntimeReference + err = json.Unmarshal(*v, &connectVia) + if err != nil { + return err + } + ols.ConnectVia = &connectVia + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + ols.Description = &description + } + case "parameters": + if v != nil { + var parameters map[string]*ParameterSpecification + err = json.Unmarshal(*v, ¶meters) + if err != nil { + return err + } + ols.Parameters = parameters + } + case "annotations": + if v != nil { + var annotations []interface{} + err = json.Unmarshal(*v, &annotations) + if err != nil { + return err + } + ols.Annotations = &annotations + } + case "type": + if v != nil { + var typeVar TypeBasicLinkedService + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ols.Type = typeVar + } + } + } + + return nil +} + +// OdbcLinkedServiceTypeProperties ODBC linked service properties. +type OdbcLinkedServiceTypeProperties struct { + // ConnectionString - The non-access credential portion of the connection string as well as an optional encrypted credential. Type: string, SecureString or AzureKeyVaultSecretReference. + ConnectionString interface{} `json:"connectionString,omitempty"` + // AuthenticationType - Type of authentication used to connect to the ODBC data store. Possible values are: Anonymous and Basic. Type: string (or Expression with resultType string). + AuthenticationType interface{} `json:"authenticationType,omitempty"` + // Credential - The access credential portion of the connection string specified in driver-specific property-value format. + Credential BasicSecretBase `json:"credential,omitempty"` + // UserName - User name for Basic authentication. Type: string (or Expression with resultType string). + UserName interface{} `json:"userName,omitempty"` + // Password - Password for Basic authentication. + Password BasicSecretBase `json:"password,omitempty"` + // EncryptedCredential - The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string). + EncryptedCredential interface{} `json:"encryptedCredential,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for OdbcLinkedServiceTypeProperties struct. +func (olstp *OdbcLinkedServiceTypeProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "connectionString": + if v != nil { + var connectionString interface{} + err = json.Unmarshal(*v, &connectionString) + if err != nil { + return err + } + olstp.ConnectionString = connectionString + } + case "authenticationType": + if v != nil { + var authenticationType interface{} + err = json.Unmarshal(*v, &authenticationType) + if err != nil { + return err + } + olstp.AuthenticationType = authenticationType + } + case "credential": + if v != nil { + credential, err := unmarshalBasicSecretBase(*v) + if err != nil { + return err + } + olstp.Credential = credential + } + case "userName": + if v != nil { + var userName interface{} + err = json.Unmarshal(*v, &userName) + if err != nil { + return err + } + olstp.UserName = userName + } + case "password": + if v != nil { + password, err := unmarshalBasicSecretBase(*v) + if err != nil { + return err + } + olstp.Password = password + } + case "encryptedCredential": + if v != nil { + var encryptedCredential interface{} + err = json.Unmarshal(*v, &encryptedCredential) + if err != nil { + return err + } + olstp.EncryptedCredential = encryptedCredential + } + } + } + + return nil +} + +// OdbcSink a copy activity ODBC sink. +type OdbcSink struct { + // PreCopyScript - A query to execute before starting the copy. Type: string (or Expression with resultType string). + PreCopyScript interface{} `json:"preCopyScript,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // WriteBatchSize - Write batch size. Type: integer (or Expression with resultType integer), minimum: 0. + WriteBatchSize interface{} `json:"writeBatchSize,omitempty"` + // WriteBatchTimeout - Write batch timeout. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + WriteBatchTimeout interface{} `json:"writeBatchTimeout,omitempty"` + // SinkRetryCount - Sink retry count. Type: integer (or Expression with resultType integer). + SinkRetryCount interface{} `json:"sinkRetryCount,omitempty"` + // SinkRetryWait - Sink retry wait. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + SinkRetryWait interface{} `json:"sinkRetryWait,omitempty"` + // Type - Possible values include: 'TypeCopySink', 'TypeSalesforceSink', 'TypeDynamicsSink', 'TypeOdbcSink', 'TypeAzureSearchIndexSink', 'TypeAzureDataLakeStoreSink', 'TypeOracleSink', 'TypeSQLDWSink', 'TypeSQLSink', 'TypeDocumentDbCollectionSink', 'TypeFileSystemSink', 'TypeBlobSink', 'TypeAzureTableSink', 'TypeAzureQueueSink', 'TypeSapCloudForCustomerSink' + Type TypeBasicCopySink `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for OdbcSink. +func (osVar OdbcSink) MarshalJSON() ([]byte, error) { + osVar.Type = TypeOdbcSink + objectMap := make(map[string]interface{}) + objectMap["preCopyScript"] = osVar.PreCopyScript + objectMap["writeBatchSize"] = osVar.WriteBatchSize + objectMap["writeBatchTimeout"] = osVar.WriteBatchTimeout + objectMap["sinkRetryCount"] = osVar.SinkRetryCount + objectMap["sinkRetryWait"] = osVar.SinkRetryWait + if osVar.Type != "" { + objectMap["type"] = osVar.Type + } + for k, v := range osVar.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsSalesforceSink is the BasicCopySink implementation for OdbcSink. +func (osVar OdbcSink) AsSalesforceSink() (*SalesforceSink, bool) { + return nil, false +} + +// AsDynamicsSink is the BasicCopySink implementation for OdbcSink. +func (osVar OdbcSink) AsDynamicsSink() (*DynamicsSink, bool) { + return nil, false +} + +// AsOdbcSink is the BasicCopySink implementation for OdbcSink. +func (osVar OdbcSink) AsOdbcSink() (*OdbcSink, bool) { + return &osVar, true +} + +// AsAzureSearchIndexSink is the BasicCopySink implementation for OdbcSink. +func (osVar OdbcSink) AsAzureSearchIndexSink() (*AzureSearchIndexSink, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSink is the BasicCopySink implementation for OdbcSink. +func (osVar OdbcSink) AsAzureDataLakeStoreSink() (*AzureDataLakeStoreSink, bool) { + return nil, false +} + +// AsOracleSink is the BasicCopySink implementation for OdbcSink. +func (osVar OdbcSink) AsOracleSink() (*OracleSink, bool) { + return nil, false +} + +// AsSQLDWSink is the BasicCopySink implementation for OdbcSink. +func (osVar OdbcSink) AsSQLDWSink() (*SQLDWSink, bool) { + return nil, false +} + +// AsSQLSink is the BasicCopySink implementation for OdbcSink. +func (osVar OdbcSink) AsSQLSink() (*SQLSink, bool) { + return nil, false +} + +// AsDocumentDbCollectionSink is the BasicCopySink implementation for OdbcSink. +func (osVar OdbcSink) AsDocumentDbCollectionSink() (*DocumentDbCollectionSink, bool) { + return nil, false +} + +// AsFileSystemSink is the BasicCopySink implementation for OdbcSink. +func (osVar OdbcSink) AsFileSystemSink() (*FileSystemSink, bool) { + return nil, false +} + +// AsBlobSink is the BasicCopySink implementation for OdbcSink. +func (osVar OdbcSink) AsBlobSink() (*BlobSink, bool) { + return nil, false +} + +// AsAzureTableSink is the BasicCopySink implementation for OdbcSink. +func (osVar OdbcSink) AsAzureTableSink() (*AzureTableSink, bool) { + return nil, false +} + +// AsAzureQueueSink is the BasicCopySink implementation for OdbcSink. +func (osVar OdbcSink) AsAzureQueueSink() (*AzureQueueSink, bool) { + return nil, false +} + +// AsSapCloudForCustomerSink is the BasicCopySink implementation for OdbcSink. +func (osVar OdbcSink) AsSapCloudForCustomerSink() (*SapCloudForCustomerSink, bool) { + return nil, false +} + +// AsCopySink is the BasicCopySink implementation for OdbcSink. +func (osVar OdbcSink) AsCopySink() (*CopySink, bool) { + return nil, false +} + +// AsBasicCopySink is the BasicCopySink implementation for OdbcSink. +func (osVar OdbcSink) AsBasicCopySink() (BasicCopySink, bool) { + return &osVar, true +} + +// Operation azure Data Factory API operation definition. +type Operation struct { + // Name - Operation name: {provider}/{resource}/{operation} + Name *string `json:"name,omitempty"` + // Origin - The intended executor of the operation. + Origin *string `json:"origin,omitempty"` + // Display - Metadata associated with the operation. + Display *OperationDisplay `json:"display,omitempty"` + // OperationProperties - Additional details about the operation. + *OperationProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for Operation. +func (o Operation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if o.Name != nil { + objectMap["name"] = o.Name + } + if o.Origin != nil { + objectMap["origin"] = o.Origin + } + if o.Display != nil { + objectMap["display"] = o.Display + } + if o.OperationProperties != nil { + objectMap["properties"] = o.OperationProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Operation struct. +func (o *Operation) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + o.Name = &name + } + case "origin": + if v != nil { + var origin string + err = json.Unmarshal(*v, &origin) + if err != nil { + return err + } + o.Origin = &origin + } + case "display": + if v != nil { + var display OperationDisplay + err = json.Unmarshal(*v, &display) + if err != nil { + return err + } + o.Display = &display + } + case "properties": + if v != nil { + var operationProperties OperationProperties + err = json.Unmarshal(*v, &operationProperties) + if err != nil { + return err + } + o.OperationProperties = &operationProperties + } + } + } + + return nil +} + +// OperationDisplay metadata associated with the operation. +type OperationDisplay struct { + // Description - The description of the operation. + Description *string `json:"description,omitempty"` + // Provider - The name of the provider. + Provider *string `json:"provider,omitempty"` + // Resource - The name of the resource type on which the operation is performed. + Resource *string `json:"resource,omitempty"` + // Operation - The type of operation: get, read, delete, etc. + Operation *string `json:"operation,omitempty"` +} + +// OperationListResponse a list of operations that can be performed by the Data Factory service. +type OperationListResponse struct { + autorest.Response `json:"-"` + // Value - List of Data Factory operations supported by the Data Factory resource provider. + Value *[]Operation `json:"value,omitempty"` + // NextLink - The link to the next page of results, if any remaining results exist. + NextLink *string `json:"nextLink,omitempty"` +} + +// OperationListResponseIterator provides access to a complete listing of Operation values. +type OperationListResponseIterator struct { + i int + page OperationListResponsePage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *OperationListResponseIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter OperationListResponseIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter OperationListResponseIterator) Response() OperationListResponse { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter OperationListResponseIterator) Value() Operation { + if !iter.page.NotDone() { + return Operation{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (olr OperationListResponse) IsEmpty() bool { + return olr.Value == nil || len(*olr.Value) == 0 +} + +// operationListResponsePreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (olr OperationListResponse) operationListResponsePreparer() (*http.Request, error) { + if olr.NextLink == nil || len(to.String(olr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(olr.NextLink))) +} + +// OperationListResponsePage contains a page of Operation values. +type OperationListResponsePage struct { + fn func(OperationListResponse) (OperationListResponse, error) + olr OperationListResponse +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *OperationListResponsePage) Next() error { + next, err := page.fn(page.olr) + if err != nil { + return err + } + page.olr = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page OperationListResponsePage) NotDone() bool { + return !page.olr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page OperationListResponsePage) Response() OperationListResponse { + return page.olr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page OperationListResponsePage) Values() []Operation { + if page.olr.IsEmpty() { + return nil + } + return *page.olr.Value +} + +// OperationLogSpecification details about an operation related to logs. +type OperationLogSpecification struct { + // Name - The name of the log category. + Name *string `json:"name,omitempty"` + // DisplayName - Localized display name. + DisplayName *string `json:"displayName,omitempty"` + // BlobDuration - Blobs created in the customer storage account, per hour. + BlobDuration *string `json:"blobDuration,omitempty"` +} + +// OperationMetricAvailability defines how often data for a metric becomes available. +type OperationMetricAvailability struct { + // TimeGrain - The granularity for the metric. + TimeGrain *string `json:"timeGrain,omitempty"` + // BlobDuration - Blob created in the customer storage account, per hour. + BlobDuration *string `json:"blobDuration,omitempty"` +} + +// OperationMetricDimension defines the metric dimension. +type OperationMetricDimension struct { + // Name - The name of the dimension for the metric. + Name *string `json:"name,omitempty"` + // DisplayName - The display name of the metric dimension. + DisplayName *string `json:"displayName,omitempty"` + // ToBeExportedForShoebox - Whether the dimension should be exported to Azure Monitor. + ToBeExportedForShoebox *bool `json:"toBeExportedForShoebox,omitempty"` +} + +// OperationMetricSpecification details about an operation related to metrics. +type OperationMetricSpecification struct { + // Name - The name of the metric. + Name *string `json:"name,omitempty"` + // DisplayName - Localized display name of the metric. + DisplayName *string `json:"displayName,omitempty"` + // DisplayDescription - The description of the metric. + DisplayDescription *string `json:"displayDescription,omitempty"` + // Unit - The unit that the metric is measured in. + Unit *string `json:"unit,omitempty"` + // AggregationType - The type of metric aggregation. + AggregationType *string `json:"aggregationType,omitempty"` + // EnableRegionalMdmAccount - Whether or not the service is using regional MDM accounts. + EnableRegionalMdmAccount *string `json:"enableRegionalMdmAccount,omitempty"` + // SourceMdmAccount - The name of the MDM account. + SourceMdmAccount *string `json:"sourceMdmAccount,omitempty"` + // SourceMdmNamespace - The name of the MDM namespace. + SourceMdmNamespace *string `json:"sourceMdmNamespace,omitempty"` + // Availabilities - Defines how often data for metrics becomes available. + Availabilities *[]OperationMetricAvailability `json:"availabilities,omitempty"` + // Dimensions - Defines the metric dimension. + Dimensions *[]OperationMetricDimension `json:"dimensions,omitempty"` +} + +// OperationProperties additional details about an operation. +type OperationProperties struct { + // ServiceSpecification - Details about a service operation. + ServiceSpecification *OperationServiceSpecification `json:"serviceSpecification,omitempty"` +} + +// OperationServiceSpecification details about a service operation. +type OperationServiceSpecification struct { + // LogSpecifications - Details about operations related to logs. + LogSpecifications *[]OperationLogSpecification `json:"logSpecifications,omitempty"` + // MetricSpecifications - Details about operations related to metrics. + MetricSpecifications *[]OperationMetricSpecification `json:"metricSpecifications,omitempty"` +} + +// OracleLinkedService oracle database. +type OracleLinkedService struct { + // OracleLinkedServiceTypeProperties - Oracle database linked service properties. + *OracleLinkedServiceTypeProperties `json:"typeProperties,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // ConnectVia - The integration runtime reference. + ConnectVia *IntegrationRuntimeReference `json:"connectVia,omitempty"` + // Description - Linked service description. + Description *string `json:"description,omitempty"` + // Parameters - Parameters for linked service. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeLinkedService', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforce', 'TypeAzureDataLakeStore', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureStorage' + Type TypeBasicLinkedService `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for OracleLinkedService. +func (ols OracleLinkedService) MarshalJSON() ([]byte, error) { + ols.Type = TypeOracle + objectMap := make(map[string]interface{}) + if ols.OracleLinkedServiceTypeProperties != nil { + objectMap["typeProperties"] = ols.OracleLinkedServiceTypeProperties + } + if ols.ConnectVia != nil { + objectMap["connectVia"] = ols.ConnectVia + } + if ols.Description != nil { + objectMap["description"] = ols.Description + } + if ols.Parameters != nil { + objectMap["parameters"] = ols.Parameters + } + if ols.Annotations != nil { + objectMap["annotations"] = ols.Annotations + } + if ols.Type != "" { + objectMap["type"] = ols.Type + } + for k, v := range ols.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysLinkedService is the BasicLinkedService implementation for OracleLinkedService. +func (ols OracleLinkedService) AsResponsysLinkedService() (*ResponsysLinkedService, bool) { + return nil, false +} + +// AsAzureDatabricksLinkedService is the BasicLinkedService implementation for OracleLinkedService. +func (ols OracleLinkedService) AsAzureDatabricksLinkedService() (*AzureDatabricksLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeAnalyticsLinkedService is the BasicLinkedService implementation for OracleLinkedService. +func (ols OracleLinkedService) AsAzureDataLakeAnalyticsLinkedService() (*AzureDataLakeAnalyticsLinkedService, bool) { + return nil, false +} + +// AsHDInsightOnDemandLinkedService is the BasicLinkedService implementation for OracleLinkedService. +func (ols OracleLinkedService) AsHDInsightOnDemandLinkedService() (*HDInsightOnDemandLinkedService, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudLinkedService is the BasicLinkedService implementation for OracleLinkedService. +func (ols OracleLinkedService) AsSalesforceMarketingCloudLinkedService() (*SalesforceMarketingCloudLinkedService, bool) { + return nil, false +} + +// AsNetezzaLinkedService is the BasicLinkedService implementation for OracleLinkedService. +func (ols OracleLinkedService) AsNetezzaLinkedService() (*NetezzaLinkedService, bool) { + return nil, false +} + +// AsVerticaLinkedService is the BasicLinkedService implementation for OracleLinkedService. +func (ols OracleLinkedService) AsVerticaLinkedService() (*VerticaLinkedService, bool) { + return nil, false +} + +// AsZohoLinkedService is the BasicLinkedService implementation for OracleLinkedService. +func (ols OracleLinkedService) AsZohoLinkedService() (*ZohoLinkedService, bool) { + return nil, false +} + +// AsXeroLinkedService is the BasicLinkedService implementation for OracleLinkedService. +func (ols OracleLinkedService) AsXeroLinkedService() (*XeroLinkedService, bool) { + return nil, false +} + +// AsSquareLinkedService is the BasicLinkedService implementation for OracleLinkedService. +func (ols OracleLinkedService) AsSquareLinkedService() (*SquareLinkedService, bool) { + return nil, false +} + +// AsSparkLinkedService is the BasicLinkedService implementation for OracleLinkedService. +func (ols OracleLinkedService) AsSparkLinkedService() (*SparkLinkedService, bool) { + return nil, false +} + +// AsShopifyLinkedService is the BasicLinkedService implementation for OracleLinkedService. +func (ols OracleLinkedService) AsShopifyLinkedService() (*ShopifyLinkedService, bool) { + return nil, false +} + +// AsServiceNowLinkedService is the BasicLinkedService implementation for OracleLinkedService. +func (ols OracleLinkedService) AsServiceNowLinkedService() (*ServiceNowLinkedService, bool) { + return nil, false +} + +// AsQuickBooksLinkedService is the BasicLinkedService implementation for OracleLinkedService. +func (ols OracleLinkedService) AsQuickBooksLinkedService() (*QuickBooksLinkedService, bool) { + return nil, false +} + +// AsPrestoLinkedService is the BasicLinkedService implementation for OracleLinkedService. +func (ols OracleLinkedService) AsPrestoLinkedService() (*PrestoLinkedService, bool) { + return nil, false +} + +// AsPhoenixLinkedService is the BasicLinkedService implementation for OracleLinkedService. +func (ols OracleLinkedService) AsPhoenixLinkedService() (*PhoenixLinkedService, bool) { + return nil, false +} + +// AsPaypalLinkedService is the BasicLinkedService implementation for OracleLinkedService. +func (ols OracleLinkedService) AsPaypalLinkedService() (*PaypalLinkedService, bool) { + return nil, false +} + +// AsMarketoLinkedService is the BasicLinkedService implementation for OracleLinkedService. +func (ols OracleLinkedService) AsMarketoLinkedService() (*MarketoLinkedService, bool) { + return nil, false +} + +// AsMariaDBLinkedService is the BasicLinkedService implementation for OracleLinkedService. +func (ols OracleLinkedService) AsMariaDBLinkedService() (*MariaDBLinkedService, bool) { + return nil, false +} + +// AsMagentoLinkedService is the BasicLinkedService implementation for OracleLinkedService. +func (ols OracleLinkedService) AsMagentoLinkedService() (*MagentoLinkedService, bool) { + return nil, false +} + +// AsJiraLinkedService is the BasicLinkedService implementation for OracleLinkedService. +func (ols OracleLinkedService) AsJiraLinkedService() (*JiraLinkedService, bool) { + return nil, false +} + +// AsImpalaLinkedService is the BasicLinkedService implementation for OracleLinkedService. +func (ols OracleLinkedService) AsImpalaLinkedService() (*ImpalaLinkedService, bool) { + return nil, false +} + +// AsHubspotLinkedService is the BasicLinkedService implementation for OracleLinkedService. +func (ols OracleLinkedService) AsHubspotLinkedService() (*HubspotLinkedService, bool) { + return nil, false +} + +// AsHiveLinkedService is the BasicLinkedService implementation for OracleLinkedService. +func (ols OracleLinkedService) AsHiveLinkedService() (*HiveLinkedService, bool) { + return nil, false +} + +// AsHBaseLinkedService is the BasicLinkedService implementation for OracleLinkedService. +func (ols OracleLinkedService) AsHBaseLinkedService() (*HBaseLinkedService, bool) { + return nil, false +} + +// AsGreenplumLinkedService is the BasicLinkedService implementation for OracleLinkedService. +func (ols OracleLinkedService) AsGreenplumLinkedService() (*GreenplumLinkedService, bool) { + return nil, false +} + +// AsGoogleBigQueryLinkedService is the BasicLinkedService implementation for OracleLinkedService. +func (ols OracleLinkedService) AsGoogleBigQueryLinkedService() (*GoogleBigQueryLinkedService, bool) { + return nil, false +} + +// AsEloquaLinkedService is the BasicLinkedService implementation for OracleLinkedService. +func (ols OracleLinkedService) AsEloquaLinkedService() (*EloquaLinkedService, bool) { + return nil, false +} + +// AsDrillLinkedService is the BasicLinkedService implementation for OracleLinkedService. +func (ols OracleLinkedService) AsDrillLinkedService() (*DrillLinkedService, bool) { + return nil, false +} + +// AsCouchbaseLinkedService is the BasicLinkedService implementation for OracleLinkedService. +func (ols OracleLinkedService) AsCouchbaseLinkedService() (*CouchbaseLinkedService, bool) { + return nil, false +} + +// AsConcurLinkedService is the BasicLinkedService implementation for OracleLinkedService. +func (ols OracleLinkedService) AsConcurLinkedService() (*ConcurLinkedService, bool) { + return nil, false +} + +// AsAzurePostgreSQLLinkedService is the BasicLinkedService implementation for OracleLinkedService. +func (ols OracleLinkedService) AsAzurePostgreSQLLinkedService() (*AzurePostgreSQLLinkedService, bool) { + return nil, false +} + +// AsAmazonMWSLinkedService is the BasicLinkedService implementation for OracleLinkedService. +func (ols OracleLinkedService) AsAmazonMWSLinkedService() (*AmazonMWSLinkedService, bool) { + return nil, false +} + +// AsSapHanaLinkedService is the BasicLinkedService implementation for OracleLinkedService. +func (ols OracleLinkedService) AsSapHanaLinkedService() (*SapHanaLinkedService, bool) { + return nil, false +} + +// AsSapBWLinkedService is the BasicLinkedService implementation for OracleLinkedService. +func (ols OracleLinkedService) AsSapBWLinkedService() (*SapBWLinkedService, bool) { + return nil, false +} + +// AsSftpServerLinkedService is the BasicLinkedService implementation for OracleLinkedService. +func (ols OracleLinkedService) AsSftpServerLinkedService() (*SftpServerLinkedService, bool) { + return nil, false +} + +// AsFtpServerLinkedService is the BasicLinkedService implementation for OracleLinkedService. +func (ols OracleLinkedService) AsFtpServerLinkedService() (*FtpServerLinkedService, bool) { + return nil, false +} + +// AsHTTPLinkedService is the BasicLinkedService implementation for OracleLinkedService. +func (ols OracleLinkedService) AsHTTPLinkedService() (*HTTPLinkedService, bool) { + return nil, false +} + +// AsAzureSearchLinkedService is the BasicLinkedService implementation for OracleLinkedService. +func (ols OracleLinkedService) AsAzureSearchLinkedService() (*AzureSearchLinkedService, bool) { + return nil, false +} + +// AsCustomDataSourceLinkedService is the BasicLinkedService implementation for OracleLinkedService. +func (ols OracleLinkedService) AsCustomDataSourceLinkedService() (*CustomDataSourceLinkedService, bool) { + return nil, false +} + +// AsAmazonRedshiftLinkedService is the BasicLinkedService implementation for OracleLinkedService. +func (ols OracleLinkedService) AsAmazonRedshiftLinkedService() (*AmazonRedshiftLinkedService, bool) { + return nil, false +} + +// AsAmazonS3LinkedService is the BasicLinkedService implementation for OracleLinkedService. +func (ols OracleLinkedService) AsAmazonS3LinkedService() (*AmazonS3LinkedService, bool) { + return nil, false +} + +// AsSapEccLinkedService is the BasicLinkedService implementation for OracleLinkedService. +func (ols OracleLinkedService) AsSapEccLinkedService() (*SapEccLinkedService, bool) { + return nil, false +} + +// AsSapCloudForCustomerLinkedService is the BasicLinkedService implementation for OracleLinkedService. +func (ols OracleLinkedService) AsSapCloudForCustomerLinkedService() (*SapCloudForCustomerLinkedService, bool) { + return nil, false +} + +// AsSalesforceLinkedService is the BasicLinkedService implementation for OracleLinkedService. +func (ols OracleLinkedService) AsSalesforceLinkedService() (*SalesforceLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeStoreLinkedService is the BasicLinkedService implementation for OracleLinkedService. +func (ols OracleLinkedService) AsAzureDataLakeStoreLinkedService() (*AzureDataLakeStoreLinkedService, bool) { + return nil, false +} + +// AsMongoDbLinkedService is the BasicLinkedService implementation for OracleLinkedService. +func (ols OracleLinkedService) AsMongoDbLinkedService() (*MongoDbLinkedService, bool) { + return nil, false +} + +// AsCassandraLinkedService is the BasicLinkedService implementation for OracleLinkedService. +func (ols OracleLinkedService) AsCassandraLinkedService() (*CassandraLinkedService, bool) { + return nil, false +} + +// AsWebLinkedService is the BasicLinkedService implementation for OracleLinkedService. +func (ols OracleLinkedService) AsWebLinkedService() (*WebLinkedService, bool) { + return nil, false +} + +// AsODataLinkedService is the BasicLinkedService implementation for OracleLinkedService. +func (ols OracleLinkedService) AsODataLinkedService() (*ODataLinkedService, bool) { + return nil, false +} + +// AsHdfsLinkedService is the BasicLinkedService implementation for OracleLinkedService. +func (ols OracleLinkedService) AsHdfsLinkedService() (*HdfsLinkedService, bool) { + return nil, false +} + +// AsOdbcLinkedService is the BasicLinkedService implementation for OracleLinkedService. +func (ols OracleLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, bool) { + return nil, false +} + +// AsAzureMLLinkedService is the BasicLinkedService implementation for OracleLinkedService. +func (ols OracleLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { + return nil, false +} + +// AsTeradataLinkedService is the BasicLinkedService implementation for OracleLinkedService. +func (ols OracleLinkedService) AsTeradataLinkedService() (*TeradataLinkedService, bool) { + return nil, false +} + +// AsDb2LinkedService is the BasicLinkedService implementation for OracleLinkedService. +func (ols OracleLinkedService) AsDb2LinkedService() (*Db2LinkedService, bool) { + return nil, false +} + +// AsSybaseLinkedService is the BasicLinkedService implementation for OracleLinkedService. +func (ols OracleLinkedService) AsSybaseLinkedService() (*SybaseLinkedService, bool) { + return nil, false +} + +// AsPostgreSQLLinkedService is the BasicLinkedService implementation for OracleLinkedService. +func (ols OracleLinkedService) AsPostgreSQLLinkedService() (*PostgreSQLLinkedService, bool) { + return nil, false +} + +// AsMySQLLinkedService is the BasicLinkedService implementation for OracleLinkedService. +func (ols OracleLinkedService) AsMySQLLinkedService() (*MySQLLinkedService, bool) { + return nil, false +} + +// AsAzureMySQLLinkedService is the BasicLinkedService implementation for OracleLinkedService. +func (ols OracleLinkedService) AsAzureMySQLLinkedService() (*AzureMySQLLinkedService, bool) { + return nil, false +} + +// AsOracleLinkedService is the BasicLinkedService implementation for OracleLinkedService. +func (ols OracleLinkedService) AsOracleLinkedService() (*OracleLinkedService, bool) { + return &ols, true +} + +// AsFileServerLinkedService is the BasicLinkedService implementation for OracleLinkedService. +func (ols OracleLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { + return nil, false +} + +// AsHDInsightLinkedService is the BasicLinkedService implementation for OracleLinkedService. +func (ols OracleLinkedService) AsHDInsightLinkedService() (*HDInsightLinkedService, bool) { + return nil, false +} + +// AsDynamicsLinkedService is the BasicLinkedService implementation for OracleLinkedService. +func (ols OracleLinkedService) AsDynamicsLinkedService() (*DynamicsLinkedService, bool) { + return nil, false +} + +// AsCosmosDbLinkedService is the BasicLinkedService implementation for OracleLinkedService. +func (ols OracleLinkedService) AsCosmosDbLinkedService() (*CosmosDbLinkedService, bool) { + return nil, false +} + +// AsAzureKeyVaultLinkedService is the BasicLinkedService implementation for OracleLinkedService. +func (ols OracleLinkedService) AsAzureKeyVaultLinkedService() (*AzureKeyVaultLinkedService, bool) { + return nil, false +} + +// AsAzureBatchLinkedService is the BasicLinkedService implementation for OracleLinkedService. +func (ols OracleLinkedService) AsAzureBatchLinkedService() (*AzureBatchLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDatabaseLinkedService is the BasicLinkedService implementation for OracleLinkedService. +func (ols OracleLinkedService) AsAzureSQLDatabaseLinkedService() (*AzureSQLDatabaseLinkedService, bool) { + return nil, false +} + +// AsSQLServerLinkedService is the BasicLinkedService implementation for OracleLinkedService. +func (ols OracleLinkedService) AsSQLServerLinkedService() (*SQLServerLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDWLinkedService is the BasicLinkedService implementation for OracleLinkedService. +func (ols OracleLinkedService) AsAzureSQLDWLinkedService() (*AzureSQLDWLinkedService, bool) { + return nil, false +} + +// AsAzureStorageLinkedService is the BasicLinkedService implementation for OracleLinkedService. +func (ols OracleLinkedService) AsAzureStorageLinkedService() (*AzureStorageLinkedService, bool) { + return nil, false +} + +// AsLinkedService is the BasicLinkedService implementation for OracleLinkedService. +func (ols OracleLinkedService) AsLinkedService() (*LinkedService, bool) { + return nil, false +} + +// AsBasicLinkedService is the BasicLinkedService implementation for OracleLinkedService. +func (ols OracleLinkedService) AsBasicLinkedService() (BasicLinkedService, bool) { + return &ols, true +} + +// UnmarshalJSON is the custom unmarshaler for OracleLinkedService struct. +func (ols *OracleLinkedService) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "typeProperties": + if v != nil { + var oracleLinkedServiceTypeProperties OracleLinkedServiceTypeProperties + err = json.Unmarshal(*v, &oracleLinkedServiceTypeProperties) + if err != nil { + return err + } + ols.OracleLinkedServiceTypeProperties = &oracleLinkedServiceTypeProperties + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if ols.AdditionalProperties == nil { + ols.AdditionalProperties = make(map[string]interface{}) + } + ols.AdditionalProperties[k] = additionalProperties + } + case "connectVia": + if v != nil { + var connectVia IntegrationRuntimeReference + err = json.Unmarshal(*v, &connectVia) + if err != nil { + return err + } + ols.ConnectVia = &connectVia + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + ols.Description = &description + } + case "parameters": + if v != nil { + var parameters map[string]*ParameterSpecification + err = json.Unmarshal(*v, ¶meters) + if err != nil { + return err + } + ols.Parameters = parameters + } + case "annotations": + if v != nil { + var annotations []interface{} + err = json.Unmarshal(*v, &annotations) + if err != nil { + return err + } + ols.Annotations = &annotations + } + case "type": + if v != nil { + var typeVar TypeBasicLinkedService + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ols.Type = typeVar + } + } + } + + return nil +} + +// OracleLinkedServiceTypeProperties oracle database linked service properties. +type OracleLinkedServiceTypeProperties struct { + // ConnectionString - The connection string. Type: string, SecureString or AzureKeyVaultSecretReference. + ConnectionString interface{} `json:"connectionString,omitempty"` + // EncryptedCredential - The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string). + EncryptedCredential interface{} `json:"encryptedCredential,omitempty"` +} + +// OracleSink a copy activity Oracle sink. +type OracleSink struct { + // PreCopyScript - SQL pre-copy script. Type: string (or Expression with resultType string). + PreCopyScript interface{} `json:"preCopyScript,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // WriteBatchSize - Write batch size. Type: integer (or Expression with resultType integer), minimum: 0. + WriteBatchSize interface{} `json:"writeBatchSize,omitempty"` + // WriteBatchTimeout - Write batch timeout. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + WriteBatchTimeout interface{} `json:"writeBatchTimeout,omitempty"` + // SinkRetryCount - Sink retry count. Type: integer (or Expression with resultType integer). + SinkRetryCount interface{} `json:"sinkRetryCount,omitempty"` + // SinkRetryWait - Sink retry wait. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + SinkRetryWait interface{} `json:"sinkRetryWait,omitempty"` + // Type - Possible values include: 'TypeCopySink', 'TypeSalesforceSink', 'TypeDynamicsSink', 'TypeOdbcSink', 'TypeAzureSearchIndexSink', 'TypeAzureDataLakeStoreSink', 'TypeOracleSink', 'TypeSQLDWSink', 'TypeSQLSink', 'TypeDocumentDbCollectionSink', 'TypeFileSystemSink', 'TypeBlobSink', 'TypeAzureTableSink', 'TypeAzureQueueSink', 'TypeSapCloudForCustomerSink' + Type TypeBasicCopySink `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for OracleSink. +func (osVar OracleSink) MarshalJSON() ([]byte, error) { + osVar.Type = TypeOracleSink + objectMap := make(map[string]interface{}) + objectMap["preCopyScript"] = osVar.PreCopyScript + objectMap["writeBatchSize"] = osVar.WriteBatchSize + objectMap["writeBatchTimeout"] = osVar.WriteBatchTimeout + objectMap["sinkRetryCount"] = osVar.SinkRetryCount + objectMap["sinkRetryWait"] = osVar.SinkRetryWait + if osVar.Type != "" { + objectMap["type"] = osVar.Type + } + for k, v := range osVar.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsSalesforceSink is the BasicCopySink implementation for OracleSink. +func (osVar OracleSink) AsSalesforceSink() (*SalesforceSink, bool) { + return nil, false +} + +// AsDynamicsSink is the BasicCopySink implementation for OracleSink. +func (osVar OracleSink) AsDynamicsSink() (*DynamicsSink, bool) { + return nil, false +} + +// AsOdbcSink is the BasicCopySink implementation for OracleSink. +func (osVar OracleSink) AsOdbcSink() (*OdbcSink, bool) { + return nil, false +} + +// AsAzureSearchIndexSink is the BasicCopySink implementation for OracleSink. +func (osVar OracleSink) AsAzureSearchIndexSink() (*AzureSearchIndexSink, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSink is the BasicCopySink implementation for OracleSink. +func (osVar OracleSink) AsAzureDataLakeStoreSink() (*AzureDataLakeStoreSink, bool) { + return nil, false +} + +// AsOracleSink is the BasicCopySink implementation for OracleSink. +func (osVar OracleSink) AsOracleSink() (*OracleSink, bool) { + return &osVar, true +} + +// AsSQLDWSink is the BasicCopySink implementation for OracleSink. +func (osVar OracleSink) AsSQLDWSink() (*SQLDWSink, bool) { + return nil, false +} + +// AsSQLSink is the BasicCopySink implementation for OracleSink. +func (osVar OracleSink) AsSQLSink() (*SQLSink, bool) { + return nil, false +} + +// AsDocumentDbCollectionSink is the BasicCopySink implementation for OracleSink. +func (osVar OracleSink) AsDocumentDbCollectionSink() (*DocumentDbCollectionSink, bool) { + return nil, false +} + +// AsFileSystemSink is the BasicCopySink implementation for OracleSink. +func (osVar OracleSink) AsFileSystemSink() (*FileSystemSink, bool) { + return nil, false +} + +// AsBlobSink is the BasicCopySink implementation for OracleSink. +func (osVar OracleSink) AsBlobSink() (*BlobSink, bool) { + return nil, false +} + +// AsAzureTableSink is the BasicCopySink implementation for OracleSink. +func (osVar OracleSink) AsAzureTableSink() (*AzureTableSink, bool) { + return nil, false +} + +// AsAzureQueueSink is the BasicCopySink implementation for OracleSink. +func (osVar OracleSink) AsAzureQueueSink() (*AzureQueueSink, bool) { + return nil, false +} + +// AsSapCloudForCustomerSink is the BasicCopySink implementation for OracleSink. +func (osVar OracleSink) AsSapCloudForCustomerSink() (*SapCloudForCustomerSink, bool) { + return nil, false +} + +// AsCopySink is the BasicCopySink implementation for OracleSink. +func (osVar OracleSink) AsCopySink() (*CopySink, bool) { + return nil, false +} + +// AsBasicCopySink is the BasicCopySink implementation for OracleSink. +func (osVar OracleSink) AsBasicCopySink() (BasicCopySink, bool) { + return &osVar, true +} + +// OracleSource a copy activity Oracle source. +type OracleSource struct { + // OracleReaderQuery - Oracle reader query. Type: string (or Expression with resultType string). + OracleReaderQuery interface{} `json:"oracleReaderQuery,omitempty"` + // QueryTimeout - Query timeout. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + QueryTimeout interface{} `json:"queryTimeout,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // SourceRetryCount - Source retry count. Type: integer (or Expression with resultType integer). + SourceRetryCount interface{} `json:"sourceRetryCount,omitempty"` + // SourceRetryWait - Source retry wait. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` + // Type - Possible values include: 'TypeCopySource', 'TypeAmazonRedshiftSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeHTTPSource', 'TypeAzureDataLakeStoreSource', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeRelationalSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource' + Type TypeBasicCopySource `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for OracleSource. +func (osVar OracleSource) MarshalJSON() ([]byte, error) { + osVar.Type = TypeOracleSource + objectMap := make(map[string]interface{}) + objectMap["oracleReaderQuery"] = osVar.OracleReaderQuery + objectMap["queryTimeout"] = osVar.QueryTimeout + objectMap["sourceRetryCount"] = osVar.SourceRetryCount + objectMap["sourceRetryWait"] = osVar.SourceRetryWait + if osVar.Type != "" { + objectMap["type"] = osVar.Type + } + for k, v := range osVar.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsAmazonRedshiftSource is the BasicCopySource implementation for OracleSource. +func (osVar OracleSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { + return nil, false +} + +// AsResponsysSource is the BasicCopySource implementation for OracleSource. +func (osVar OracleSource) AsResponsysSource() (*ResponsysSource, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudSource is the BasicCopySource implementation for OracleSource. +func (osVar OracleSource) AsSalesforceMarketingCloudSource() (*SalesforceMarketingCloudSource, bool) { + return nil, false +} + +// AsVerticaSource is the BasicCopySource implementation for OracleSource. +func (osVar OracleSource) AsVerticaSource() (*VerticaSource, bool) { + return nil, false +} + +// AsNetezzaSource is the BasicCopySource implementation for OracleSource. +func (osVar OracleSource) AsNetezzaSource() (*NetezzaSource, bool) { + return nil, false +} + +// AsZohoSource is the BasicCopySource implementation for OracleSource. +func (osVar OracleSource) AsZohoSource() (*ZohoSource, bool) { + return nil, false +} + +// AsXeroSource is the BasicCopySource implementation for OracleSource. +func (osVar OracleSource) AsXeroSource() (*XeroSource, bool) { + return nil, false +} + +// AsSquareSource is the BasicCopySource implementation for OracleSource. +func (osVar OracleSource) AsSquareSource() (*SquareSource, bool) { + return nil, false +} + +// AsSparkSource is the BasicCopySource implementation for OracleSource. +func (osVar OracleSource) AsSparkSource() (*SparkSource, bool) { + return nil, false +} + +// AsShopifySource is the BasicCopySource implementation for OracleSource. +func (osVar OracleSource) AsShopifySource() (*ShopifySource, bool) { + return nil, false +} + +// AsServiceNowSource is the BasicCopySource implementation for OracleSource. +func (osVar OracleSource) AsServiceNowSource() (*ServiceNowSource, bool) { + return nil, false +} + +// AsQuickBooksSource is the BasicCopySource implementation for OracleSource. +func (osVar OracleSource) AsQuickBooksSource() (*QuickBooksSource, bool) { + return nil, false +} + +// AsPrestoSource is the BasicCopySource implementation for OracleSource. +func (osVar OracleSource) AsPrestoSource() (*PrestoSource, bool) { + return nil, false +} + +// AsPhoenixSource is the BasicCopySource implementation for OracleSource. +func (osVar OracleSource) AsPhoenixSource() (*PhoenixSource, bool) { + return nil, false +} + +// AsPaypalSource is the BasicCopySource implementation for OracleSource. +func (osVar OracleSource) AsPaypalSource() (*PaypalSource, bool) { + return nil, false +} + +// AsMarketoSource is the BasicCopySource implementation for OracleSource. +func (osVar OracleSource) AsMarketoSource() (*MarketoSource, bool) { + return nil, false +} + +// AsMariaDBSource is the BasicCopySource implementation for OracleSource. +func (osVar OracleSource) AsMariaDBSource() (*MariaDBSource, bool) { + return nil, false +} + +// AsMagentoSource is the BasicCopySource implementation for OracleSource. +func (osVar OracleSource) AsMagentoSource() (*MagentoSource, bool) { + return nil, false +} + +// AsJiraSource is the BasicCopySource implementation for OracleSource. +func (osVar OracleSource) AsJiraSource() (*JiraSource, bool) { + return nil, false +} + +// AsImpalaSource is the BasicCopySource implementation for OracleSource. +func (osVar OracleSource) AsImpalaSource() (*ImpalaSource, bool) { + return nil, false +} + +// AsHubspotSource is the BasicCopySource implementation for OracleSource. +func (osVar OracleSource) AsHubspotSource() (*HubspotSource, bool) { + return nil, false +} + +// AsHiveSource is the BasicCopySource implementation for OracleSource. +func (osVar OracleSource) AsHiveSource() (*HiveSource, bool) { + return nil, false +} + +// AsHBaseSource is the BasicCopySource implementation for OracleSource. +func (osVar OracleSource) AsHBaseSource() (*HBaseSource, bool) { + return nil, false +} + +// AsGreenplumSource is the BasicCopySource implementation for OracleSource. +func (osVar OracleSource) AsGreenplumSource() (*GreenplumSource, bool) { + return nil, false +} + +// AsGoogleBigQuerySource is the BasicCopySource implementation for OracleSource. +func (osVar OracleSource) AsGoogleBigQuerySource() (*GoogleBigQuerySource, bool) { + return nil, false +} + +// AsEloquaSource is the BasicCopySource implementation for OracleSource. +func (osVar OracleSource) AsEloquaSource() (*EloquaSource, bool) { + return nil, false +} + +// AsDrillSource is the BasicCopySource implementation for OracleSource. +func (osVar OracleSource) AsDrillSource() (*DrillSource, bool) { + return nil, false +} + +// AsCouchbaseSource is the BasicCopySource implementation for OracleSource. +func (osVar OracleSource) AsCouchbaseSource() (*CouchbaseSource, bool) { + return nil, false +} + +// AsConcurSource is the BasicCopySource implementation for OracleSource. +func (osVar OracleSource) AsConcurSource() (*ConcurSource, bool) { + return nil, false +} + +// AsAzurePostgreSQLSource is the BasicCopySource implementation for OracleSource. +func (osVar OracleSource) AsAzurePostgreSQLSource() (*AzurePostgreSQLSource, bool) { + return nil, false +} + +// AsAmazonMWSSource is the BasicCopySource implementation for OracleSource. +func (osVar OracleSource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { + return nil, false +} + +// AsHTTPSource is the BasicCopySource implementation for OracleSource. +func (osVar OracleSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for OracleSource. +func (osVar OracleSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for OracleSource. +func (osVar OracleSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsCassandraSource is the BasicCopySource implementation for OracleSource. +func (osVar OracleSource) AsCassandraSource() (*CassandraSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for OracleSource. +func (osVar OracleSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for OracleSource. +func (osVar OracleSource) AsOracleSource() (*OracleSource, bool) { + return &osVar, true +} + +// AsAzureMySQLSource is the BasicCopySource implementation for OracleSource. +func (osVar OracleSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for OracleSource. +func (osVar OracleSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for OracleSource. +func (osVar OracleSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsSQLDWSource is the BasicCopySource implementation for OracleSource. +func (osVar OracleSource) AsSQLDWSource() (*SQLDWSource, bool) { + return nil, false +} + +// AsSQLSource is the BasicCopySource implementation for OracleSource. +func (osVar OracleSource) AsSQLSource() (*SQLSource, bool) { + return nil, false +} + +// AsSapEccSource is the BasicCopySource implementation for OracleSource. +func (osVar OracleSource) AsSapEccSource() (*SapEccSource, bool) { + return nil, false +} + +// AsSapCloudForCustomerSource is the BasicCopySource implementation for OracleSource. +func (osVar OracleSource) AsSapCloudForCustomerSource() (*SapCloudForCustomerSource, bool) { + return nil, false +} + +// AsSalesforceSource is the BasicCopySource implementation for OracleSource. +func (osVar OracleSource) AsSalesforceSource() (*SalesforceSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for OracleSource. +func (osVar OracleSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for OracleSource. +func (osVar OracleSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for OracleSource. +func (osVar OracleSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for OracleSource. +func (osVar OracleSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + +// AsAzureTableSource is the BasicCopySource implementation for OracleSource. +func (osVar OracleSource) AsAzureTableSource() (*AzureTableSource, bool) { + return nil, false +} + +// AsCopySource is the BasicCopySource implementation for OracleSource. +func (osVar OracleSource) AsCopySource() (*CopySource, bool) { + return nil, false +} + +// AsBasicCopySource is the BasicCopySource implementation for OracleSource. +func (osVar OracleSource) AsBasicCopySource() (BasicCopySource, bool) { + return &osVar, true +} + +// OracleTableDataset the on-premises Oracle database dataset. +type OracleTableDataset struct { + // OracleTableDatasetTypeProperties - On-premises Oracle dataset properties. + *OracleTableDatasetTypeProperties `json:"typeProperties,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Description - Dataset description. + Description *string `json:"description,omitempty"` + // Structure - Columns that define the structure of the dataset. Type: array (or Expression with resultType array), itemType: DatasetDataElement. + Structure interface{} `json:"structure,omitempty"` + // LinkedServiceName - Linked service reference. + LinkedServiceName *LinkedServiceReference `json:"linkedServiceName,omitempty"` + // Parameters - Parameters for dataset. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeDataset', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSQLServerTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSalesforceObject', 'TypeRelationalTable', 'TypeAzureMySQLTable', 'TypeOracleTable', 'TypeODataResource', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeAzureDataLakeStoreFile', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeAmazonS3Object' + Type TypeBasicDataset `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for OracleTableDataset. +func (otd OracleTableDataset) MarshalJSON() ([]byte, error) { + otd.Type = TypeOracleTable + objectMap := make(map[string]interface{}) + if otd.OracleTableDatasetTypeProperties != nil { + objectMap["typeProperties"] = otd.OracleTableDatasetTypeProperties + } + if otd.Description != nil { + objectMap["description"] = otd.Description + } + objectMap["structure"] = otd.Structure + if otd.LinkedServiceName != nil { + objectMap["linkedServiceName"] = otd.LinkedServiceName + } + if otd.Parameters != nil { + objectMap["parameters"] = otd.Parameters + } + if otd.Annotations != nil { + objectMap["annotations"] = otd.Annotations + } + if otd.Type != "" { + objectMap["type"] = otd.Type + } + for k, v := range otd.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysObjectDataset is the BasicDataset implementation for OracleTableDataset. +func (otd OracleTableDataset) AsResponsysObjectDataset() (*ResponsysObjectDataset, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudObjectDataset is the BasicDataset implementation for OracleTableDataset. +func (otd OracleTableDataset) AsSalesforceMarketingCloudObjectDataset() (*SalesforceMarketingCloudObjectDataset, bool) { + return nil, false +} + +// AsVerticaTableDataset is the BasicDataset implementation for OracleTableDataset. +func (otd OracleTableDataset) AsVerticaTableDataset() (*VerticaTableDataset, bool) { + return nil, false +} + +// AsNetezzaTableDataset is the BasicDataset implementation for OracleTableDataset. +func (otd OracleTableDataset) AsNetezzaTableDataset() (*NetezzaTableDataset, bool) { + return nil, false +} + +// AsZohoObjectDataset is the BasicDataset implementation for OracleTableDataset. +func (otd OracleTableDataset) AsZohoObjectDataset() (*ZohoObjectDataset, bool) { + return nil, false +} + +// AsXeroObjectDataset is the BasicDataset implementation for OracleTableDataset. +func (otd OracleTableDataset) AsXeroObjectDataset() (*XeroObjectDataset, bool) { + return nil, false +} + +// AsSquareObjectDataset is the BasicDataset implementation for OracleTableDataset. +func (otd OracleTableDataset) AsSquareObjectDataset() (*SquareObjectDataset, bool) { + return nil, false +} + +// AsSparkObjectDataset is the BasicDataset implementation for OracleTableDataset. +func (otd OracleTableDataset) AsSparkObjectDataset() (*SparkObjectDataset, bool) { + return nil, false +} + +// AsShopifyObjectDataset is the BasicDataset implementation for OracleTableDataset. +func (otd OracleTableDataset) AsShopifyObjectDataset() (*ShopifyObjectDataset, bool) { + return nil, false +} + +// AsServiceNowObjectDataset is the BasicDataset implementation for OracleTableDataset. +func (otd OracleTableDataset) AsServiceNowObjectDataset() (*ServiceNowObjectDataset, bool) { + return nil, false +} + +// AsQuickBooksObjectDataset is the BasicDataset implementation for OracleTableDataset. +func (otd OracleTableDataset) AsQuickBooksObjectDataset() (*QuickBooksObjectDataset, bool) { + return nil, false +} + +// AsPrestoObjectDataset is the BasicDataset implementation for OracleTableDataset. +func (otd OracleTableDataset) AsPrestoObjectDataset() (*PrestoObjectDataset, bool) { + return nil, false +} + +// AsPhoenixObjectDataset is the BasicDataset implementation for OracleTableDataset. +func (otd OracleTableDataset) AsPhoenixObjectDataset() (*PhoenixObjectDataset, bool) { + return nil, false +} + +// AsPaypalObjectDataset is the BasicDataset implementation for OracleTableDataset. +func (otd OracleTableDataset) AsPaypalObjectDataset() (*PaypalObjectDataset, bool) { + return nil, false +} + +// AsMarketoObjectDataset is the BasicDataset implementation for OracleTableDataset. +func (otd OracleTableDataset) AsMarketoObjectDataset() (*MarketoObjectDataset, bool) { + return nil, false +} + +// AsMariaDBTableDataset is the BasicDataset implementation for OracleTableDataset. +func (otd OracleTableDataset) AsMariaDBTableDataset() (*MariaDBTableDataset, bool) { + return nil, false +} + +// AsMagentoObjectDataset is the BasicDataset implementation for OracleTableDataset. +func (otd OracleTableDataset) AsMagentoObjectDataset() (*MagentoObjectDataset, bool) { + return nil, false +} + +// AsJiraObjectDataset is the BasicDataset implementation for OracleTableDataset. +func (otd OracleTableDataset) AsJiraObjectDataset() (*JiraObjectDataset, bool) { + return nil, false +} + +// AsImpalaObjectDataset is the BasicDataset implementation for OracleTableDataset. +func (otd OracleTableDataset) AsImpalaObjectDataset() (*ImpalaObjectDataset, bool) { + return nil, false +} + +// AsHubspotObjectDataset is the BasicDataset implementation for OracleTableDataset. +func (otd OracleTableDataset) AsHubspotObjectDataset() (*HubspotObjectDataset, bool) { + return nil, false +} + +// AsHiveObjectDataset is the BasicDataset implementation for OracleTableDataset. +func (otd OracleTableDataset) AsHiveObjectDataset() (*HiveObjectDataset, bool) { + return nil, false +} + +// AsHBaseObjectDataset is the BasicDataset implementation for OracleTableDataset. +func (otd OracleTableDataset) AsHBaseObjectDataset() (*HBaseObjectDataset, bool) { + return nil, false +} + +// AsGreenplumTableDataset is the BasicDataset implementation for OracleTableDataset. +func (otd OracleTableDataset) AsGreenplumTableDataset() (*GreenplumTableDataset, bool) { + return nil, false +} + +// AsGoogleBigQueryObjectDataset is the BasicDataset implementation for OracleTableDataset. +func (otd OracleTableDataset) AsGoogleBigQueryObjectDataset() (*GoogleBigQueryObjectDataset, bool) { + return nil, false +} + +// AsEloquaObjectDataset is the BasicDataset implementation for OracleTableDataset. +func (otd OracleTableDataset) AsEloquaObjectDataset() (*EloquaObjectDataset, bool) { + return nil, false +} + +// AsDrillTableDataset is the BasicDataset implementation for OracleTableDataset. +func (otd OracleTableDataset) AsDrillTableDataset() (*DrillTableDataset, bool) { + return nil, false +} + +// AsCouchbaseTableDataset is the BasicDataset implementation for OracleTableDataset. +func (otd OracleTableDataset) AsCouchbaseTableDataset() (*CouchbaseTableDataset, bool) { + return nil, false +} + +// AsConcurObjectDataset is the BasicDataset implementation for OracleTableDataset. +func (otd OracleTableDataset) AsConcurObjectDataset() (*ConcurObjectDataset, bool) { + return nil, false +} + +// AsAzurePostgreSQLTableDataset is the BasicDataset implementation for OracleTableDataset. +func (otd OracleTableDataset) AsAzurePostgreSQLTableDataset() (*AzurePostgreSQLTableDataset, bool) { + return nil, false +} + +// AsAmazonMWSObjectDataset is the BasicDataset implementation for OracleTableDataset. +func (otd OracleTableDataset) AsAmazonMWSObjectDataset() (*AmazonMWSObjectDataset, bool) { + return nil, false +} + +// AsHTTPDataset is the BasicDataset implementation for OracleTableDataset. +func (otd OracleTableDataset) AsHTTPDataset() (*HTTPDataset, bool) { + return nil, false +} + +// AsAzureSearchIndexDataset is the BasicDataset implementation for OracleTableDataset. +func (otd OracleTableDataset) AsAzureSearchIndexDataset() (*AzureSearchIndexDataset, bool) { + return nil, false +} + +// AsWebTableDataset is the BasicDataset implementation for OracleTableDataset. +func (otd OracleTableDataset) AsWebTableDataset() (*WebTableDataset, bool) { + return nil, false +} + +// AsSQLServerTableDataset is the BasicDataset implementation for OracleTableDataset. +func (otd OracleTableDataset) AsSQLServerTableDataset() (*SQLServerTableDataset, bool) { + return nil, false +} + +// AsSapEccResourceDataset is the BasicDataset implementation for OracleTableDataset. +func (otd OracleTableDataset) AsSapEccResourceDataset() (*SapEccResourceDataset, bool) { + return nil, false +} + +// AsSapCloudForCustomerResourceDataset is the BasicDataset implementation for OracleTableDataset. +func (otd OracleTableDataset) AsSapCloudForCustomerResourceDataset() (*SapCloudForCustomerResourceDataset, bool) { + return nil, false +} + +// AsSalesforceObjectDataset is the BasicDataset implementation for OracleTableDataset. +func (otd OracleTableDataset) AsSalesforceObjectDataset() (*SalesforceObjectDataset, bool) { + return nil, false +} + +// AsRelationalTableDataset is the BasicDataset implementation for OracleTableDataset. +func (otd OracleTableDataset) AsRelationalTableDataset() (*RelationalTableDataset, bool) { + return nil, false +} + +// AsAzureMySQLTableDataset is the BasicDataset implementation for OracleTableDataset. +func (otd OracleTableDataset) AsAzureMySQLTableDataset() (*AzureMySQLTableDataset, bool) { + return nil, false +} + +// AsOracleTableDataset is the BasicDataset implementation for OracleTableDataset. +func (otd OracleTableDataset) AsOracleTableDataset() (*OracleTableDataset, bool) { + return &otd, true +} + +// AsODataResourceDataset is the BasicDataset implementation for OracleTableDataset. +func (otd OracleTableDataset) AsODataResourceDataset() (*ODataResourceDataset, bool) { + return nil, false +} + +// AsMongoDbCollectionDataset is the BasicDataset implementation for OracleTableDataset. +func (otd OracleTableDataset) AsMongoDbCollectionDataset() (*MongoDbCollectionDataset, bool) { + return nil, false +} + +// AsFileShareDataset is the BasicDataset implementation for OracleTableDataset. +func (otd OracleTableDataset) AsFileShareDataset() (*FileShareDataset, bool) { + return nil, false +} + +// AsAzureDataLakeStoreDataset is the BasicDataset implementation for OracleTableDataset. +func (otd OracleTableDataset) AsAzureDataLakeStoreDataset() (*AzureDataLakeStoreDataset, bool) { + return nil, false +} + +// AsDynamicsEntityDataset is the BasicDataset implementation for OracleTableDataset. +func (otd OracleTableDataset) AsDynamicsEntityDataset() (*DynamicsEntityDataset, bool) { + return nil, false +} + +// AsDocumentDbCollectionDataset is the BasicDataset implementation for OracleTableDataset. +func (otd OracleTableDataset) AsDocumentDbCollectionDataset() (*DocumentDbCollectionDataset, bool) { + return nil, false +} + +// AsCustomDataset is the BasicDataset implementation for OracleTableDataset. +func (otd OracleTableDataset) AsCustomDataset() (*CustomDataset, bool) { + return nil, false +} + +// AsCassandraTableDataset is the BasicDataset implementation for OracleTableDataset. +func (otd OracleTableDataset) AsCassandraTableDataset() (*CassandraTableDataset, bool) { + return nil, false +} + +// AsAzureSQLDWTableDataset is the BasicDataset implementation for OracleTableDataset. +func (otd OracleTableDataset) AsAzureSQLDWTableDataset() (*AzureSQLDWTableDataset, bool) { + return nil, false +} + +// AsAzureSQLTableDataset is the BasicDataset implementation for OracleTableDataset. +func (otd OracleTableDataset) AsAzureSQLTableDataset() (*AzureSQLTableDataset, bool) { + return nil, false +} + +// AsAzureTableDataset is the BasicDataset implementation for OracleTableDataset. +func (otd OracleTableDataset) AsAzureTableDataset() (*AzureTableDataset, bool) { + return nil, false +} + +// AsAzureBlobDataset is the BasicDataset implementation for OracleTableDataset. +func (otd OracleTableDataset) AsAzureBlobDataset() (*AzureBlobDataset, bool) { + return nil, false +} + +// AsAmazonS3Dataset is the BasicDataset implementation for OracleTableDataset. +func (otd OracleTableDataset) AsAmazonS3Dataset() (*AmazonS3Dataset, bool) { + return nil, false +} + +// AsDataset is the BasicDataset implementation for OracleTableDataset. +func (otd OracleTableDataset) AsDataset() (*Dataset, bool) { + return nil, false +} + +// AsBasicDataset is the BasicDataset implementation for OracleTableDataset. +func (otd OracleTableDataset) AsBasicDataset() (BasicDataset, bool) { + return &otd, true +} + +// UnmarshalJSON is the custom unmarshaler for OracleTableDataset struct. +func (otd *OracleTableDataset) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "typeProperties": + if v != nil { + var oracleTableDatasetTypeProperties OracleTableDatasetTypeProperties + err = json.Unmarshal(*v, &oracleTableDatasetTypeProperties) + if err != nil { + return err + } + otd.OracleTableDatasetTypeProperties = &oracleTableDatasetTypeProperties + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if otd.AdditionalProperties == nil { + otd.AdditionalProperties = make(map[string]interface{}) + } + otd.AdditionalProperties[k] = additionalProperties + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + otd.Description = &description + } + case "structure": + if v != nil { + var structure interface{} + err = json.Unmarshal(*v, &structure) + if err != nil { + return err + } + otd.Structure = structure + } + case "linkedServiceName": + if v != nil { + var linkedServiceName LinkedServiceReference + err = json.Unmarshal(*v, &linkedServiceName) + if err != nil { + return err + } + otd.LinkedServiceName = &linkedServiceName + } + case "parameters": + if v != nil { + var parameters map[string]*ParameterSpecification + err = json.Unmarshal(*v, ¶meters) + if err != nil { + return err + } + otd.Parameters = parameters + } + case "annotations": + if v != nil { + var annotations []interface{} + err = json.Unmarshal(*v, &annotations) + if err != nil { + return err + } + otd.Annotations = &annotations + } + case "type": + if v != nil { + var typeVar TypeBasicDataset + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + otd.Type = typeVar + } + } + } + + return nil +} + +// OracleTableDatasetTypeProperties on-premises Oracle dataset properties. +type OracleTableDatasetTypeProperties struct { + // TableName - The table name of the on-premises Oracle database. Type: string (or Expression with resultType string). + TableName interface{} `json:"tableName,omitempty"` +} + +// OrcFormat the data stored in Optimized Row Columnar (ORC) format. +type OrcFormat struct { + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Serializer - Serializer. Type: string (or Expression with resultType string). + Serializer interface{} `json:"serializer,omitempty"` + // Deserializer - Deserializer. Type: string (or Expression with resultType string). + Deserializer interface{} `json:"deserializer,omitempty"` + // Type - Possible values include: 'TypeDatasetStorageFormat', 'TypeParquetFormat', 'TypeOrcFormat', 'TypeAvroFormat', 'TypeJSONFormat', 'TypeTextFormat' + Type TypeBasicDatasetStorageFormat `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for OrcFormat. +func (of OrcFormat) MarshalJSON() ([]byte, error) { + of.Type = TypeOrcFormat + objectMap := make(map[string]interface{}) + objectMap["serializer"] = of.Serializer + objectMap["deserializer"] = of.Deserializer + if of.Type != "" { + objectMap["type"] = of.Type + } + for k, v := range of.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsParquetFormat is the BasicDatasetStorageFormat implementation for OrcFormat. +func (of OrcFormat) AsParquetFormat() (*ParquetFormat, bool) { + return nil, false +} + +// AsOrcFormat is the BasicDatasetStorageFormat implementation for OrcFormat. +func (of OrcFormat) AsOrcFormat() (*OrcFormat, bool) { + return &of, true +} + +// AsAvroFormat is the BasicDatasetStorageFormat implementation for OrcFormat. +func (of OrcFormat) AsAvroFormat() (*AvroFormat, bool) { + return nil, false +} + +// AsJSONFormat is the BasicDatasetStorageFormat implementation for OrcFormat. +func (of OrcFormat) AsJSONFormat() (*JSONFormat, bool) { + return nil, false +} + +// AsTextFormat is the BasicDatasetStorageFormat implementation for OrcFormat. +func (of OrcFormat) AsTextFormat() (*TextFormat, bool) { + return nil, false +} + +// AsDatasetStorageFormat is the BasicDatasetStorageFormat implementation for OrcFormat. +func (of OrcFormat) AsDatasetStorageFormat() (*DatasetStorageFormat, bool) { + return nil, false +} + +// AsBasicDatasetStorageFormat is the BasicDatasetStorageFormat implementation for OrcFormat. +func (of OrcFormat) AsBasicDatasetStorageFormat() (BasicDatasetStorageFormat, bool) { + return &of, true +} + +// ParameterSpecification definition of a single parameter for an entity. +type ParameterSpecification struct { + // Type - Parameter type. Possible values include: 'ParameterTypeObject', 'ParameterTypeString', 'ParameterTypeInt', 'ParameterTypeFloat', 'ParameterTypeBool', 'ParameterTypeArray', 'ParameterTypeSecureString' + Type ParameterType `json:"type,omitempty"` + // DefaultValue - Default value of parameter. + DefaultValue interface{} `json:"defaultValue,omitempty"` +} + +// ParquetFormat the data stored in Parquet format. +type ParquetFormat struct { + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Serializer - Serializer. Type: string (or Expression with resultType string). + Serializer interface{} `json:"serializer,omitempty"` + // Deserializer - Deserializer. Type: string (or Expression with resultType string). + Deserializer interface{} `json:"deserializer,omitempty"` + // Type - Possible values include: 'TypeDatasetStorageFormat', 'TypeParquetFormat', 'TypeOrcFormat', 'TypeAvroFormat', 'TypeJSONFormat', 'TypeTextFormat' + Type TypeBasicDatasetStorageFormat `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ParquetFormat. +func (pf ParquetFormat) MarshalJSON() ([]byte, error) { + pf.Type = TypeParquetFormat + objectMap := make(map[string]interface{}) + objectMap["serializer"] = pf.Serializer + objectMap["deserializer"] = pf.Deserializer + if pf.Type != "" { + objectMap["type"] = pf.Type + } + for k, v := range pf.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsParquetFormat is the BasicDatasetStorageFormat implementation for ParquetFormat. +func (pf ParquetFormat) AsParquetFormat() (*ParquetFormat, bool) { + return &pf, true +} + +// AsOrcFormat is the BasicDatasetStorageFormat implementation for ParquetFormat. +func (pf ParquetFormat) AsOrcFormat() (*OrcFormat, bool) { + return nil, false +} + +// AsAvroFormat is the BasicDatasetStorageFormat implementation for ParquetFormat. +func (pf ParquetFormat) AsAvroFormat() (*AvroFormat, bool) { + return nil, false +} + +// AsJSONFormat is the BasicDatasetStorageFormat implementation for ParquetFormat. +func (pf ParquetFormat) AsJSONFormat() (*JSONFormat, bool) { + return nil, false +} + +// AsTextFormat is the BasicDatasetStorageFormat implementation for ParquetFormat. +func (pf ParquetFormat) AsTextFormat() (*TextFormat, bool) { + return nil, false +} + +// AsDatasetStorageFormat is the BasicDatasetStorageFormat implementation for ParquetFormat. +func (pf ParquetFormat) AsDatasetStorageFormat() (*DatasetStorageFormat, bool) { + return nil, false +} + +// AsBasicDatasetStorageFormat is the BasicDatasetStorageFormat implementation for ParquetFormat. +func (pf ParquetFormat) AsBasicDatasetStorageFormat() (BasicDatasetStorageFormat, bool) { + return &pf, true +} + +// PaypalLinkedService paypal Serivce linked service. +type PaypalLinkedService struct { + // PaypalLinkedServiceTypeProperties - Paypal Serivce linked service properties. + *PaypalLinkedServiceTypeProperties `json:"typeProperties,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // ConnectVia - The integration runtime reference. + ConnectVia *IntegrationRuntimeReference `json:"connectVia,omitempty"` + // Description - Linked service description. + Description *string `json:"description,omitempty"` + // Parameters - Parameters for linked service. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeLinkedService', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforce', 'TypeAzureDataLakeStore', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureStorage' + Type TypeBasicLinkedService `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for PaypalLinkedService. +func (pls PaypalLinkedService) MarshalJSON() ([]byte, error) { + pls.Type = TypePaypal + objectMap := make(map[string]interface{}) + if pls.PaypalLinkedServiceTypeProperties != nil { + objectMap["typeProperties"] = pls.PaypalLinkedServiceTypeProperties + } + if pls.ConnectVia != nil { + objectMap["connectVia"] = pls.ConnectVia + } + if pls.Description != nil { + objectMap["description"] = pls.Description + } + if pls.Parameters != nil { + objectMap["parameters"] = pls.Parameters + } + if pls.Annotations != nil { + objectMap["annotations"] = pls.Annotations + } + if pls.Type != "" { + objectMap["type"] = pls.Type + } + for k, v := range pls.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysLinkedService is the BasicLinkedService implementation for PaypalLinkedService. +func (pls PaypalLinkedService) AsResponsysLinkedService() (*ResponsysLinkedService, bool) { + return nil, false +} + +// AsAzureDatabricksLinkedService is the BasicLinkedService implementation for PaypalLinkedService. +func (pls PaypalLinkedService) AsAzureDatabricksLinkedService() (*AzureDatabricksLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeAnalyticsLinkedService is the BasicLinkedService implementation for PaypalLinkedService. +func (pls PaypalLinkedService) AsAzureDataLakeAnalyticsLinkedService() (*AzureDataLakeAnalyticsLinkedService, bool) { + return nil, false +} + +// AsHDInsightOnDemandLinkedService is the BasicLinkedService implementation for PaypalLinkedService. +func (pls PaypalLinkedService) AsHDInsightOnDemandLinkedService() (*HDInsightOnDemandLinkedService, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudLinkedService is the BasicLinkedService implementation for PaypalLinkedService. +func (pls PaypalLinkedService) AsSalesforceMarketingCloudLinkedService() (*SalesforceMarketingCloudLinkedService, bool) { + return nil, false +} + +// AsNetezzaLinkedService is the BasicLinkedService implementation for PaypalLinkedService. +func (pls PaypalLinkedService) AsNetezzaLinkedService() (*NetezzaLinkedService, bool) { + return nil, false +} + +// AsVerticaLinkedService is the BasicLinkedService implementation for PaypalLinkedService. +func (pls PaypalLinkedService) AsVerticaLinkedService() (*VerticaLinkedService, bool) { + return nil, false +} + +// AsZohoLinkedService is the BasicLinkedService implementation for PaypalLinkedService. +func (pls PaypalLinkedService) AsZohoLinkedService() (*ZohoLinkedService, bool) { + return nil, false +} + +// AsXeroLinkedService is the BasicLinkedService implementation for PaypalLinkedService. +func (pls PaypalLinkedService) AsXeroLinkedService() (*XeroLinkedService, bool) { + return nil, false +} + +// AsSquareLinkedService is the BasicLinkedService implementation for PaypalLinkedService. +func (pls PaypalLinkedService) AsSquareLinkedService() (*SquareLinkedService, bool) { + return nil, false +} + +// AsSparkLinkedService is the BasicLinkedService implementation for PaypalLinkedService. +func (pls PaypalLinkedService) AsSparkLinkedService() (*SparkLinkedService, bool) { + return nil, false +} + +// AsShopifyLinkedService is the BasicLinkedService implementation for PaypalLinkedService. +func (pls PaypalLinkedService) AsShopifyLinkedService() (*ShopifyLinkedService, bool) { + return nil, false +} + +// AsServiceNowLinkedService is the BasicLinkedService implementation for PaypalLinkedService. +func (pls PaypalLinkedService) AsServiceNowLinkedService() (*ServiceNowLinkedService, bool) { + return nil, false +} + +// AsQuickBooksLinkedService is the BasicLinkedService implementation for PaypalLinkedService. +func (pls PaypalLinkedService) AsQuickBooksLinkedService() (*QuickBooksLinkedService, bool) { + return nil, false +} + +// AsPrestoLinkedService is the BasicLinkedService implementation for PaypalLinkedService. +func (pls PaypalLinkedService) AsPrestoLinkedService() (*PrestoLinkedService, bool) { + return nil, false +} + +// AsPhoenixLinkedService is the BasicLinkedService implementation for PaypalLinkedService. +func (pls PaypalLinkedService) AsPhoenixLinkedService() (*PhoenixLinkedService, bool) { + return nil, false +} + +// AsPaypalLinkedService is the BasicLinkedService implementation for PaypalLinkedService. +func (pls PaypalLinkedService) AsPaypalLinkedService() (*PaypalLinkedService, bool) { + return &pls, true +} + +// AsMarketoLinkedService is the BasicLinkedService implementation for PaypalLinkedService. +func (pls PaypalLinkedService) AsMarketoLinkedService() (*MarketoLinkedService, bool) { + return nil, false +} + +// AsMariaDBLinkedService is the BasicLinkedService implementation for PaypalLinkedService. +func (pls PaypalLinkedService) AsMariaDBLinkedService() (*MariaDBLinkedService, bool) { + return nil, false +} + +// AsMagentoLinkedService is the BasicLinkedService implementation for PaypalLinkedService. +func (pls PaypalLinkedService) AsMagentoLinkedService() (*MagentoLinkedService, bool) { + return nil, false +} + +// AsJiraLinkedService is the BasicLinkedService implementation for PaypalLinkedService. +func (pls PaypalLinkedService) AsJiraLinkedService() (*JiraLinkedService, bool) { + return nil, false +} + +// AsImpalaLinkedService is the BasicLinkedService implementation for PaypalLinkedService. +func (pls PaypalLinkedService) AsImpalaLinkedService() (*ImpalaLinkedService, bool) { + return nil, false +} + +// AsHubspotLinkedService is the BasicLinkedService implementation for PaypalLinkedService. +func (pls PaypalLinkedService) AsHubspotLinkedService() (*HubspotLinkedService, bool) { + return nil, false +} + +// AsHiveLinkedService is the BasicLinkedService implementation for PaypalLinkedService. +func (pls PaypalLinkedService) AsHiveLinkedService() (*HiveLinkedService, bool) { + return nil, false +} + +// AsHBaseLinkedService is the BasicLinkedService implementation for PaypalLinkedService. +func (pls PaypalLinkedService) AsHBaseLinkedService() (*HBaseLinkedService, bool) { + return nil, false +} + +// AsGreenplumLinkedService is the BasicLinkedService implementation for PaypalLinkedService. +func (pls PaypalLinkedService) AsGreenplumLinkedService() (*GreenplumLinkedService, bool) { + return nil, false +} + +// AsGoogleBigQueryLinkedService is the BasicLinkedService implementation for PaypalLinkedService. +func (pls PaypalLinkedService) AsGoogleBigQueryLinkedService() (*GoogleBigQueryLinkedService, bool) { + return nil, false +} + +// AsEloquaLinkedService is the BasicLinkedService implementation for PaypalLinkedService. +func (pls PaypalLinkedService) AsEloquaLinkedService() (*EloquaLinkedService, bool) { + return nil, false +} + +// AsDrillLinkedService is the BasicLinkedService implementation for PaypalLinkedService. +func (pls PaypalLinkedService) AsDrillLinkedService() (*DrillLinkedService, bool) { + return nil, false +} + +// AsCouchbaseLinkedService is the BasicLinkedService implementation for PaypalLinkedService. +func (pls PaypalLinkedService) AsCouchbaseLinkedService() (*CouchbaseLinkedService, bool) { + return nil, false +} + +// AsConcurLinkedService is the BasicLinkedService implementation for PaypalLinkedService. +func (pls PaypalLinkedService) AsConcurLinkedService() (*ConcurLinkedService, bool) { + return nil, false +} + +// AsAzurePostgreSQLLinkedService is the BasicLinkedService implementation for PaypalLinkedService. +func (pls PaypalLinkedService) AsAzurePostgreSQLLinkedService() (*AzurePostgreSQLLinkedService, bool) { + return nil, false +} + +// AsAmazonMWSLinkedService is the BasicLinkedService implementation for PaypalLinkedService. +func (pls PaypalLinkedService) AsAmazonMWSLinkedService() (*AmazonMWSLinkedService, bool) { + return nil, false +} + +// AsSapHanaLinkedService is the BasicLinkedService implementation for PaypalLinkedService. +func (pls PaypalLinkedService) AsSapHanaLinkedService() (*SapHanaLinkedService, bool) { + return nil, false +} + +// AsSapBWLinkedService is the BasicLinkedService implementation for PaypalLinkedService. +func (pls PaypalLinkedService) AsSapBWLinkedService() (*SapBWLinkedService, bool) { + return nil, false +} + +// AsSftpServerLinkedService is the BasicLinkedService implementation for PaypalLinkedService. +func (pls PaypalLinkedService) AsSftpServerLinkedService() (*SftpServerLinkedService, bool) { + return nil, false +} + +// AsFtpServerLinkedService is the BasicLinkedService implementation for PaypalLinkedService. +func (pls PaypalLinkedService) AsFtpServerLinkedService() (*FtpServerLinkedService, bool) { + return nil, false +} + +// AsHTTPLinkedService is the BasicLinkedService implementation for PaypalLinkedService. +func (pls PaypalLinkedService) AsHTTPLinkedService() (*HTTPLinkedService, bool) { + return nil, false +} + +// AsAzureSearchLinkedService is the BasicLinkedService implementation for PaypalLinkedService. +func (pls PaypalLinkedService) AsAzureSearchLinkedService() (*AzureSearchLinkedService, bool) { + return nil, false +} + +// AsCustomDataSourceLinkedService is the BasicLinkedService implementation for PaypalLinkedService. +func (pls PaypalLinkedService) AsCustomDataSourceLinkedService() (*CustomDataSourceLinkedService, bool) { + return nil, false +} + +// AsAmazonRedshiftLinkedService is the BasicLinkedService implementation for PaypalLinkedService. +func (pls PaypalLinkedService) AsAmazonRedshiftLinkedService() (*AmazonRedshiftLinkedService, bool) { + return nil, false +} + +// AsAmazonS3LinkedService is the BasicLinkedService implementation for PaypalLinkedService. +func (pls PaypalLinkedService) AsAmazonS3LinkedService() (*AmazonS3LinkedService, bool) { + return nil, false +} + +// AsSapEccLinkedService is the BasicLinkedService implementation for PaypalLinkedService. +func (pls PaypalLinkedService) AsSapEccLinkedService() (*SapEccLinkedService, bool) { + return nil, false +} + +// AsSapCloudForCustomerLinkedService is the BasicLinkedService implementation for PaypalLinkedService. +func (pls PaypalLinkedService) AsSapCloudForCustomerLinkedService() (*SapCloudForCustomerLinkedService, bool) { + return nil, false +} + +// AsSalesforceLinkedService is the BasicLinkedService implementation for PaypalLinkedService. +func (pls PaypalLinkedService) AsSalesforceLinkedService() (*SalesforceLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeStoreLinkedService is the BasicLinkedService implementation for PaypalLinkedService. +func (pls PaypalLinkedService) AsAzureDataLakeStoreLinkedService() (*AzureDataLakeStoreLinkedService, bool) { + return nil, false +} + +// AsMongoDbLinkedService is the BasicLinkedService implementation for PaypalLinkedService. +func (pls PaypalLinkedService) AsMongoDbLinkedService() (*MongoDbLinkedService, bool) { + return nil, false +} + +// AsCassandraLinkedService is the BasicLinkedService implementation for PaypalLinkedService. +func (pls PaypalLinkedService) AsCassandraLinkedService() (*CassandraLinkedService, bool) { + return nil, false +} + +// AsWebLinkedService is the BasicLinkedService implementation for PaypalLinkedService. +func (pls PaypalLinkedService) AsWebLinkedService() (*WebLinkedService, bool) { + return nil, false +} + +// AsODataLinkedService is the BasicLinkedService implementation for PaypalLinkedService. +func (pls PaypalLinkedService) AsODataLinkedService() (*ODataLinkedService, bool) { + return nil, false +} + +// AsHdfsLinkedService is the BasicLinkedService implementation for PaypalLinkedService. +func (pls PaypalLinkedService) AsHdfsLinkedService() (*HdfsLinkedService, bool) { + return nil, false +} + +// AsOdbcLinkedService is the BasicLinkedService implementation for PaypalLinkedService. +func (pls PaypalLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, bool) { + return nil, false +} + +// AsAzureMLLinkedService is the BasicLinkedService implementation for PaypalLinkedService. +func (pls PaypalLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { + return nil, false +} + +// AsTeradataLinkedService is the BasicLinkedService implementation for PaypalLinkedService. +func (pls PaypalLinkedService) AsTeradataLinkedService() (*TeradataLinkedService, bool) { + return nil, false +} + +// AsDb2LinkedService is the BasicLinkedService implementation for PaypalLinkedService. +func (pls PaypalLinkedService) AsDb2LinkedService() (*Db2LinkedService, bool) { + return nil, false +} + +// AsSybaseLinkedService is the BasicLinkedService implementation for PaypalLinkedService. +func (pls PaypalLinkedService) AsSybaseLinkedService() (*SybaseLinkedService, bool) { + return nil, false +} + +// AsPostgreSQLLinkedService is the BasicLinkedService implementation for PaypalLinkedService. +func (pls PaypalLinkedService) AsPostgreSQLLinkedService() (*PostgreSQLLinkedService, bool) { + return nil, false +} + +// AsMySQLLinkedService is the BasicLinkedService implementation for PaypalLinkedService. +func (pls PaypalLinkedService) AsMySQLLinkedService() (*MySQLLinkedService, bool) { + return nil, false +} + +// AsAzureMySQLLinkedService is the BasicLinkedService implementation for PaypalLinkedService. +func (pls PaypalLinkedService) AsAzureMySQLLinkedService() (*AzureMySQLLinkedService, bool) { + return nil, false +} + +// AsOracleLinkedService is the BasicLinkedService implementation for PaypalLinkedService. +func (pls PaypalLinkedService) AsOracleLinkedService() (*OracleLinkedService, bool) { + return nil, false +} + +// AsFileServerLinkedService is the BasicLinkedService implementation for PaypalLinkedService. +func (pls PaypalLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { + return nil, false +} + +// AsHDInsightLinkedService is the BasicLinkedService implementation for PaypalLinkedService. +func (pls PaypalLinkedService) AsHDInsightLinkedService() (*HDInsightLinkedService, bool) { + return nil, false +} + +// AsDynamicsLinkedService is the BasicLinkedService implementation for PaypalLinkedService. +func (pls PaypalLinkedService) AsDynamicsLinkedService() (*DynamicsLinkedService, bool) { + return nil, false +} + +// AsCosmosDbLinkedService is the BasicLinkedService implementation for PaypalLinkedService. +func (pls PaypalLinkedService) AsCosmosDbLinkedService() (*CosmosDbLinkedService, bool) { + return nil, false +} + +// AsAzureKeyVaultLinkedService is the BasicLinkedService implementation for PaypalLinkedService. +func (pls PaypalLinkedService) AsAzureKeyVaultLinkedService() (*AzureKeyVaultLinkedService, bool) { + return nil, false +} + +// AsAzureBatchLinkedService is the BasicLinkedService implementation for PaypalLinkedService. +func (pls PaypalLinkedService) AsAzureBatchLinkedService() (*AzureBatchLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDatabaseLinkedService is the BasicLinkedService implementation for PaypalLinkedService. +func (pls PaypalLinkedService) AsAzureSQLDatabaseLinkedService() (*AzureSQLDatabaseLinkedService, bool) { + return nil, false +} + +// AsSQLServerLinkedService is the BasicLinkedService implementation for PaypalLinkedService. +func (pls PaypalLinkedService) AsSQLServerLinkedService() (*SQLServerLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDWLinkedService is the BasicLinkedService implementation for PaypalLinkedService. +func (pls PaypalLinkedService) AsAzureSQLDWLinkedService() (*AzureSQLDWLinkedService, bool) { + return nil, false +} + +// AsAzureStorageLinkedService is the BasicLinkedService implementation for PaypalLinkedService. +func (pls PaypalLinkedService) AsAzureStorageLinkedService() (*AzureStorageLinkedService, bool) { + return nil, false +} + +// AsLinkedService is the BasicLinkedService implementation for PaypalLinkedService. +func (pls PaypalLinkedService) AsLinkedService() (*LinkedService, bool) { + return nil, false +} + +// AsBasicLinkedService is the BasicLinkedService implementation for PaypalLinkedService. +func (pls PaypalLinkedService) AsBasicLinkedService() (BasicLinkedService, bool) { + return &pls, true +} + +// UnmarshalJSON is the custom unmarshaler for PaypalLinkedService struct. +func (pls *PaypalLinkedService) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "typeProperties": + if v != nil { + var paypalLinkedServiceTypeProperties PaypalLinkedServiceTypeProperties + err = json.Unmarshal(*v, &paypalLinkedServiceTypeProperties) + if err != nil { + return err + } + pls.PaypalLinkedServiceTypeProperties = &paypalLinkedServiceTypeProperties + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if pls.AdditionalProperties == nil { + pls.AdditionalProperties = make(map[string]interface{}) + } + pls.AdditionalProperties[k] = additionalProperties + } + case "connectVia": + if v != nil { + var connectVia IntegrationRuntimeReference + err = json.Unmarshal(*v, &connectVia) + if err != nil { + return err + } + pls.ConnectVia = &connectVia + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + pls.Description = &description + } + case "parameters": + if v != nil { + var parameters map[string]*ParameterSpecification + err = json.Unmarshal(*v, ¶meters) + if err != nil { + return err + } + pls.Parameters = parameters + } + case "annotations": + if v != nil { + var annotations []interface{} + err = json.Unmarshal(*v, &annotations) + if err != nil { + return err + } + pls.Annotations = &annotations + } + case "type": + if v != nil { + var typeVar TypeBasicLinkedService + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + pls.Type = typeVar + } + } + } + + return nil +} + +// PaypalLinkedServiceTypeProperties paypal Serivce linked service properties. +type PaypalLinkedServiceTypeProperties struct { + // Host - The URL of the PayPal instance. (i.e. api.sandbox.paypal.com) + Host interface{} `json:"host,omitempty"` + // ClientID - The client ID associated with your PayPal application. + ClientID interface{} `json:"clientId,omitempty"` + // ClientSecret - The client secret associated with your PayPal application. + ClientSecret BasicSecretBase `json:"clientSecret,omitempty"` + // UseEncryptedEndpoints - Specifies whether the data source endpoints are encrypted using HTTPS. The default value is true. + UseEncryptedEndpoints interface{} `json:"useEncryptedEndpoints,omitempty"` + // UseHostVerification - Specifies whether to require the host name in the server's certificate to match the host name of the server when connecting over SSL. The default value is true. + UseHostVerification interface{} `json:"useHostVerification,omitempty"` + // UsePeerVerification - Specifies whether to verify the identity of the server when connecting over SSL. The default value is true. + UsePeerVerification interface{} `json:"usePeerVerification,omitempty"` + // EncryptedCredential - The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string). + EncryptedCredential interface{} `json:"encryptedCredential,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for PaypalLinkedServiceTypeProperties struct. +func (plstp *PaypalLinkedServiceTypeProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "host": + if v != nil { + var host interface{} + err = json.Unmarshal(*v, &host) + if err != nil { + return err + } + plstp.Host = host + } + case "clientId": + if v != nil { + var clientID interface{} + err = json.Unmarshal(*v, &clientID) + if err != nil { + return err + } + plstp.ClientID = clientID + } + case "clientSecret": + if v != nil { + clientSecret, err := unmarshalBasicSecretBase(*v) + if err != nil { + return err + } + plstp.ClientSecret = clientSecret + } + case "useEncryptedEndpoints": + if v != nil { + var useEncryptedEndpoints interface{} + err = json.Unmarshal(*v, &useEncryptedEndpoints) + if err != nil { + return err + } + plstp.UseEncryptedEndpoints = useEncryptedEndpoints + } + case "useHostVerification": + if v != nil { + var useHostVerification interface{} + err = json.Unmarshal(*v, &useHostVerification) + if err != nil { + return err + } + plstp.UseHostVerification = useHostVerification + } + case "usePeerVerification": + if v != nil { + var usePeerVerification interface{} + err = json.Unmarshal(*v, &usePeerVerification) + if err != nil { + return err + } + plstp.UsePeerVerification = usePeerVerification + } + case "encryptedCredential": + if v != nil { + var encryptedCredential interface{} + err = json.Unmarshal(*v, &encryptedCredential) + if err != nil { + return err + } + plstp.EncryptedCredential = encryptedCredential + } + } + } + + return nil +} + +// PaypalObjectDataset paypal Serivce dataset. +type PaypalObjectDataset struct { + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Description - Dataset description. + Description *string `json:"description,omitempty"` + // Structure - Columns that define the structure of the dataset. Type: array (or Expression with resultType array), itemType: DatasetDataElement. + Structure interface{} `json:"structure,omitempty"` + // LinkedServiceName - Linked service reference. + LinkedServiceName *LinkedServiceReference `json:"linkedServiceName,omitempty"` + // Parameters - Parameters for dataset. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeDataset', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSQLServerTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSalesforceObject', 'TypeRelationalTable', 'TypeAzureMySQLTable', 'TypeOracleTable', 'TypeODataResource', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeAzureDataLakeStoreFile', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeAmazonS3Object' + Type TypeBasicDataset `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for PaypalObjectDataset. +func (pod PaypalObjectDataset) MarshalJSON() ([]byte, error) { + pod.Type = TypePaypalObject + objectMap := make(map[string]interface{}) + if pod.Description != nil { + objectMap["description"] = pod.Description + } + objectMap["structure"] = pod.Structure + if pod.LinkedServiceName != nil { + objectMap["linkedServiceName"] = pod.LinkedServiceName + } + if pod.Parameters != nil { + objectMap["parameters"] = pod.Parameters + } + if pod.Annotations != nil { + objectMap["annotations"] = pod.Annotations + } + if pod.Type != "" { + objectMap["type"] = pod.Type + } + for k, v := range pod.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysObjectDataset is the BasicDataset implementation for PaypalObjectDataset. +func (pod PaypalObjectDataset) AsResponsysObjectDataset() (*ResponsysObjectDataset, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudObjectDataset is the BasicDataset implementation for PaypalObjectDataset. +func (pod PaypalObjectDataset) AsSalesforceMarketingCloudObjectDataset() (*SalesforceMarketingCloudObjectDataset, bool) { + return nil, false +} + +// AsVerticaTableDataset is the BasicDataset implementation for PaypalObjectDataset. +func (pod PaypalObjectDataset) AsVerticaTableDataset() (*VerticaTableDataset, bool) { + return nil, false +} + +// AsNetezzaTableDataset is the BasicDataset implementation for PaypalObjectDataset. +func (pod PaypalObjectDataset) AsNetezzaTableDataset() (*NetezzaTableDataset, bool) { + return nil, false +} + +// AsZohoObjectDataset is the BasicDataset implementation for PaypalObjectDataset. +func (pod PaypalObjectDataset) AsZohoObjectDataset() (*ZohoObjectDataset, bool) { + return nil, false +} + +// AsXeroObjectDataset is the BasicDataset implementation for PaypalObjectDataset. +func (pod PaypalObjectDataset) AsXeroObjectDataset() (*XeroObjectDataset, bool) { + return nil, false +} + +// AsSquareObjectDataset is the BasicDataset implementation for PaypalObjectDataset. +func (pod PaypalObjectDataset) AsSquareObjectDataset() (*SquareObjectDataset, bool) { + return nil, false +} + +// AsSparkObjectDataset is the BasicDataset implementation for PaypalObjectDataset. +func (pod PaypalObjectDataset) AsSparkObjectDataset() (*SparkObjectDataset, bool) { + return nil, false +} + +// AsShopifyObjectDataset is the BasicDataset implementation for PaypalObjectDataset. +func (pod PaypalObjectDataset) AsShopifyObjectDataset() (*ShopifyObjectDataset, bool) { + return nil, false +} + +// AsServiceNowObjectDataset is the BasicDataset implementation for PaypalObjectDataset. +func (pod PaypalObjectDataset) AsServiceNowObjectDataset() (*ServiceNowObjectDataset, bool) { + return nil, false +} + +// AsQuickBooksObjectDataset is the BasicDataset implementation for PaypalObjectDataset. +func (pod PaypalObjectDataset) AsQuickBooksObjectDataset() (*QuickBooksObjectDataset, bool) { + return nil, false +} + +// AsPrestoObjectDataset is the BasicDataset implementation for PaypalObjectDataset. +func (pod PaypalObjectDataset) AsPrestoObjectDataset() (*PrestoObjectDataset, bool) { + return nil, false +} + +// AsPhoenixObjectDataset is the BasicDataset implementation for PaypalObjectDataset. +func (pod PaypalObjectDataset) AsPhoenixObjectDataset() (*PhoenixObjectDataset, bool) { + return nil, false +} + +// AsPaypalObjectDataset is the BasicDataset implementation for PaypalObjectDataset. +func (pod PaypalObjectDataset) AsPaypalObjectDataset() (*PaypalObjectDataset, bool) { + return &pod, true +} + +// AsMarketoObjectDataset is the BasicDataset implementation for PaypalObjectDataset. +func (pod PaypalObjectDataset) AsMarketoObjectDataset() (*MarketoObjectDataset, bool) { + return nil, false +} + +// AsMariaDBTableDataset is the BasicDataset implementation for PaypalObjectDataset. +func (pod PaypalObjectDataset) AsMariaDBTableDataset() (*MariaDBTableDataset, bool) { + return nil, false +} + +// AsMagentoObjectDataset is the BasicDataset implementation for PaypalObjectDataset. +func (pod PaypalObjectDataset) AsMagentoObjectDataset() (*MagentoObjectDataset, bool) { + return nil, false +} + +// AsJiraObjectDataset is the BasicDataset implementation for PaypalObjectDataset. +func (pod PaypalObjectDataset) AsJiraObjectDataset() (*JiraObjectDataset, bool) { + return nil, false +} + +// AsImpalaObjectDataset is the BasicDataset implementation for PaypalObjectDataset. +func (pod PaypalObjectDataset) AsImpalaObjectDataset() (*ImpalaObjectDataset, bool) { + return nil, false +} + +// AsHubspotObjectDataset is the BasicDataset implementation for PaypalObjectDataset. +func (pod PaypalObjectDataset) AsHubspotObjectDataset() (*HubspotObjectDataset, bool) { + return nil, false +} + +// AsHiveObjectDataset is the BasicDataset implementation for PaypalObjectDataset. +func (pod PaypalObjectDataset) AsHiveObjectDataset() (*HiveObjectDataset, bool) { + return nil, false +} + +// AsHBaseObjectDataset is the BasicDataset implementation for PaypalObjectDataset. +func (pod PaypalObjectDataset) AsHBaseObjectDataset() (*HBaseObjectDataset, bool) { + return nil, false +} + +// AsGreenplumTableDataset is the BasicDataset implementation for PaypalObjectDataset. +func (pod PaypalObjectDataset) AsGreenplumTableDataset() (*GreenplumTableDataset, bool) { + return nil, false +} + +// AsGoogleBigQueryObjectDataset is the BasicDataset implementation for PaypalObjectDataset. +func (pod PaypalObjectDataset) AsGoogleBigQueryObjectDataset() (*GoogleBigQueryObjectDataset, bool) { + return nil, false +} + +// AsEloquaObjectDataset is the BasicDataset implementation for PaypalObjectDataset. +func (pod PaypalObjectDataset) AsEloquaObjectDataset() (*EloquaObjectDataset, bool) { + return nil, false +} + +// AsDrillTableDataset is the BasicDataset implementation for PaypalObjectDataset. +func (pod PaypalObjectDataset) AsDrillTableDataset() (*DrillTableDataset, bool) { + return nil, false +} + +// AsCouchbaseTableDataset is the BasicDataset implementation for PaypalObjectDataset. +func (pod PaypalObjectDataset) AsCouchbaseTableDataset() (*CouchbaseTableDataset, bool) { + return nil, false +} + +// AsConcurObjectDataset is the BasicDataset implementation for PaypalObjectDataset. +func (pod PaypalObjectDataset) AsConcurObjectDataset() (*ConcurObjectDataset, bool) { + return nil, false +} + +// AsAzurePostgreSQLTableDataset is the BasicDataset implementation for PaypalObjectDataset. +func (pod PaypalObjectDataset) AsAzurePostgreSQLTableDataset() (*AzurePostgreSQLTableDataset, bool) { + return nil, false +} + +// AsAmazonMWSObjectDataset is the BasicDataset implementation for PaypalObjectDataset. +func (pod PaypalObjectDataset) AsAmazonMWSObjectDataset() (*AmazonMWSObjectDataset, bool) { + return nil, false +} + +// AsHTTPDataset is the BasicDataset implementation for PaypalObjectDataset. +func (pod PaypalObjectDataset) AsHTTPDataset() (*HTTPDataset, bool) { + return nil, false +} + +// AsAzureSearchIndexDataset is the BasicDataset implementation for PaypalObjectDataset. +func (pod PaypalObjectDataset) AsAzureSearchIndexDataset() (*AzureSearchIndexDataset, bool) { + return nil, false +} + +// AsWebTableDataset is the BasicDataset implementation for PaypalObjectDataset. +func (pod PaypalObjectDataset) AsWebTableDataset() (*WebTableDataset, bool) { + return nil, false +} + +// AsSQLServerTableDataset is the BasicDataset implementation for PaypalObjectDataset. +func (pod PaypalObjectDataset) AsSQLServerTableDataset() (*SQLServerTableDataset, bool) { + return nil, false +} + +// AsSapEccResourceDataset is the BasicDataset implementation for PaypalObjectDataset. +func (pod PaypalObjectDataset) AsSapEccResourceDataset() (*SapEccResourceDataset, bool) { + return nil, false +} + +// AsSapCloudForCustomerResourceDataset is the BasicDataset implementation for PaypalObjectDataset. +func (pod PaypalObjectDataset) AsSapCloudForCustomerResourceDataset() (*SapCloudForCustomerResourceDataset, bool) { + return nil, false +} + +// AsSalesforceObjectDataset is the BasicDataset implementation for PaypalObjectDataset. +func (pod PaypalObjectDataset) AsSalesforceObjectDataset() (*SalesforceObjectDataset, bool) { + return nil, false +} + +// AsRelationalTableDataset is the BasicDataset implementation for PaypalObjectDataset. +func (pod PaypalObjectDataset) AsRelationalTableDataset() (*RelationalTableDataset, bool) { + return nil, false +} + +// AsAzureMySQLTableDataset is the BasicDataset implementation for PaypalObjectDataset. +func (pod PaypalObjectDataset) AsAzureMySQLTableDataset() (*AzureMySQLTableDataset, bool) { + return nil, false +} + +// AsOracleTableDataset is the BasicDataset implementation for PaypalObjectDataset. +func (pod PaypalObjectDataset) AsOracleTableDataset() (*OracleTableDataset, bool) { + return nil, false +} + +// AsODataResourceDataset is the BasicDataset implementation for PaypalObjectDataset. +func (pod PaypalObjectDataset) AsODataResourceDataset() (*ODataResourceDataset, bool) { + return nil, false +} + +// AsMongoDbCollectionDataset is the BasicDataset implementation for PaypalObjectDataset. +func (pod PaypalObjectDataset) AsMongoDbCollectionDataset() (*MongoDbCollectionDataset, bool) { + return nil, false +} + +// AsFileShareDataset is the BasicDataset implementation for PaypalObjectDataset. +func (pod PaypalObjectDataset) AsFileShareDataset() (*FileShareDataset, bool) { + return nil, false +} + +// AsAzureDataLakeStoreDataset is the BasicDataset implementation for PaypalObjectDataset. +func (pod PaypalObjectDataset) AsAzureDataLakeStoreDataset() (*AzureDataLakeStoreDataset, bool) { + return nil, false +} + +// AsDynamicsEntityDataset is the BasicDataset implementation for PaypalObjectDataset. +func (pod PaypalObjectDataset) AsDynamicsEntityDataset() (*DynamicsEntityDataset, bool) { + return nil, false +} + +// AsDocumentDbCollectionDataset is the BasicDataset implementation for PaypalObjectDataset. +func (pod PaypalObjectDataset) AsDocumentDbCollectionDataset() (*DocumentDbCollectionDataset, bool) { + return nil, false +} + +// AsCustomDataset is the BasicDataset implementation for PaypalObjectDataset. +func (pod PaypalObjectDataset) AsCustomDataset() (*CustomDataset, bool) { + return nil, false +} + +// AsCassandraTableDataset is the BasicDataset implementation for PaypalObjectDataset. +func (pod PaypalObjectDataset) AsCassandraTableDataset() (*CassandraTableDataset, bool) { + return nil, false +} + +// AsAzureSQLDWTableDataset is the BasicDataset implementation for PaypalObjectDataset. +func (pod PaypalObjectDataset) AsAzureSQLDWTableDataset() (*AzureSQLDWTableDataset, bool) { + return nil, false +} + +// AsAzureSQLTableDataset is the BasicDataset implementation for PaypalObjectDataset. +func (pod PaypalObjectDataset) AsAzureSQLTableDataset() (*AzureSQLTableDataset, bool) { + return nil, false +} + +// AsAzureTableDataset is the BasicDataset implementation for PaypalObjectDataset. +func (pod PaypalObjectDataset) AsAzureTableDataset() (*AzureTableDataset, bool) { + return nil, false +} + +// AsAzureBlobDataset is the BasicDataset implementation for PaypalObjectDataset. +func (pod PaypalObjectDataset) AsAzureBlobDataset() (*AzureBlobDataset, bool) { + return nil, false +} + +// AsAmazonS3Dataset is the BasicDataset implementation for PaypalObjectDataset. +func (pod PaypalObjectDataset) AsAmazonS3Dataset() (*AmazonS3Dataset, bool) { + return nil, false +} + +// AsDataset is the BasicDataset implementation for PaypalObjectDataset. +func (pod PaypalObjectDataset) AsDataset() (*Dataset, bool) { + return nil, false +} + +// AsBasicDataset is the BasicDataset implementation for PaypalObjectDataset. +func (pod PaypalObjectDataset) AsBasicDataset() (BasicDataset, bool) { + return &pod, true +} + +// PaypalSource a copy activity Paypal Serivce source. +type PaypalSource struct { + // Query - A query to retrieve data from source. Type: string (or Expression with resultType string). + Query interface{} `json:"query,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // SourceRetryCount - Source retry count. Type: integer (or Expression with resultType integer). + SourceRetryCount interface{} `json:"sourceRetryCount,omitempty"` + // SourceRetryWait - Source retry wait. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` + // Type - Possible values include: 'TypeCopySource', 'TypeAmazonRedshiftSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeHTTPSource', 'TypeAzureDataLakeStoreSource', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeRelationalSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource' + Type TypeBasicCopySource `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for PaypalSource. +func (ps PaypalSource) MarshalJSON() ([]byte, error) { + ps.Type = TypePaypalSource + objectMap := make(map[string]interface{}) + objectMap["query"] = ps.Query + objectMap["sourceRetryCount"] = ps.SourceRetryCount + objectMap["sourceRetryWait"] = ps.SourceRetryWait + if ps.Type != "" { + objectMap["type"] = ps.Type + } + for k, v := range ps.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsAmazonRedshiftSource is the BasicCopySource implementation for PaypalSource. +func (ps PaypalSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { + return nil, false +} + +// AsResponsysSource is the BasicCopySource implementation for PaypalSource. +func (ps PaypalSource) AsResponsysSource() (*ResponsysSource, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudSource is the BasicCopySource implementation for PaypalSource. +func (ps PaypalSource) AsSalesforceMarketingCloudSource() (*SalesforceMarketingCloudSource, bool) { + return nil, false +} + +// AsVerticaSource is the BasicCopySource implementation for PaypalSource. +func (ps PaypalSource) AsVerticaSource() (*VerticaSource, bool) { + return nil, false +} + +// AsNetezzaSource is the BasicCopySource implementation for PaypalSource. +func (ps PaypalSource) AsNetezzaSource() (*NetezzaSource, bool) { + return nil, false +} + +// AsZohoSource is the BasicCopySource implementation for PaypalSource. +func (ps PaypalSource) AsZohoSource() (*ZohoSource, bool) { + return nil, false +} + +// AsXeroSource is the BasicCopySource implementation for PaypalSource. +func (ps PaypalSource) AsXeroSource() (*XeroSource, bool) { + return nil, false +} + +// AsSquareSource is the BasicCopySource implementation for PaypalSource. +func (ps PaypalSource) AsSquareSource() (*SquareSource, bool) { + return nil, false +} + +// AsSparkSource is the BasicCopySource implementation for PaypalSource. +func (ps PaypalSource) AsSparkSource() (*SparkSource, bool) { + return nil, false +} + +// AsShopifySource is the BasicCopySource implementation for PaypalSource. +func (ps PaypalSource) AsShopifySource() (*ShopifySource, bool) { + return nil, false +} + +// AsServiceNowSource is the BasicCopySource implementation for PaypalSource. +func (ps PaypalSource) AsServiceNowSource() (*ServiceNowSource, bool) { + return nil, false +} + +// AsQuickBooksSource is the BasicCopySource implementation for PaypalSource. +func (ps PaypalSource) AsQuickBooksSource() (*QuickBooksSource, bool) { + return nil, false +} + +// AsPrestoSource is the BasicCopySource implementation for PaypalSource. +func (ps PaypalSource) AsPrestoSource() (*PrestoSource, bool) { + return nil, false +} + +// AsPhoenixSource is the BasicCopySource implementation for PaypalSource. +func (ps PaypalSource) AsPhoenixSource() (*PhoenixSource, bool) { + return nil, false +} + +// AsPaypalSource is the BasicCopySource implementation for PaypalSource. +func (ps PaypalSource) AsPaypalSource() (*PaypalSource, bool) { + return &ps, true +} + +// AsMarketoSource is the BasicCopySource implementation for PaypalSource. +func (ps PaypalSource) AsMarketoSource() (*MarketoSource, bool) { + return nil, false +} + +// AsMariaDBSource is the BasicCopySource implementation for PaypalSource. +func (ps PaypalSource) AsMariaDBSource() (*MariaDBSource, bool) { + return nil, false +} + +// AsMagentoSource is the BasicCopySource implementation for PaypalSource. +func (ps PaypalSource) AsMagentoSource() (*MagentoSource, bool) { + return nil, false +} + +// AsJiraSource is the BasicCopySource implementation for PaypalSource. +func (ps PaypalSource) AsJiraSource() (*JiraSource, bool) { + return nil, false +} + +// AsImpalaSource is the BasicCopySource implementation for PaypalSource. +func (ps PaypalSource) AsImpalaSource() (*ImpalaSource, bool) { + return nil, false +} + +// AsHubspotSource is the BasicCopySource implementation for PaypalSource. +func (ps PaypalSource) AsHubspotSource() (*HubspotSource, bool) { + return nil, false +} + +// AsHiveSource is the BasicCopySource implementation for PaypalSource. +func (ps PaypalSource) AsHiveSource() (*HiveSource, bool) { + return nil, false +} + +// AsHBaseSource is the BasicCopySource implementation for PaypalSource. +func (ps PaypalSource) AsHBaseSource() (*HBaseSource, bool) { + return nil, false +} + +// AsGreenplumSource is the BasicCopySource implementation for PaypalSource. +func (ps PaypalSource) AsGreenplumSource() (*GreenplumSource, bool) { + return nil, false +} + +// AsGoogleBigQuerySource is the BasicCopySource implementation for PaypalSource. +func (ps PaypalSource) AsGoogleBigQuerySource() (*GoogleBigQuerySource, bool) { + return nil, false +} + +// AsEloquaSource is the BasicCopySource implementation for PaypalSource. +func (ps PaypalSource) AsEloquaSource() (*EloquaSource, bool) { + return nil, false +} + +// AsDrillSource is the BasicCopySource implementation for PaypalSource. +func (ps PaypalSource) AsDrillSource() (*DrillSource, bool) { + return nil, false +} + +// AsCouchbaseSource is the BasicCopySource implementation for PaypalSource. +func (ps PaypalSource) AsCouchbaseSource() (*CouchbaseSource, bool) { + return nil, false +} + +// AsConcurSource is the BasicCopySource implementation for PaypalSource. +func (ps PaypalSource) AsConcurSource() (*ConcurSource, bool) { + return nil, false +} + +// AsAzurePostgreSQLSource is the BasicCopySource implementation for PaypalSource. +func (ps PaypalSource) AsAzurePostgreSQLSource() (*AzurePostgreSQLSource, bool) { + return nil, false +} + +// AsAmazonMWSSource is the BasicCopySource implementation for PaypalSource. +func (ps PaypalSource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { + return nil, false +} + +// AsHTTPSource is the BasicCopySource implementation for PaypalSource. +func (ps PaypalSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for PaypalSource. +func (ps PaypalSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for PaypalSource. +func (ps PaypalSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsCassandraSource is the BasicCopySource implementation for PaypalSource. +func (ps PaypalSource) AsCassandraSource() (*CassandraSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for PaypalSource. +func (ps PaypalSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for PaypalSource. +func (ps PaypalSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureMySQLSource is the BasicCopySource implementation for PaypalSource. +func (ps PaypalSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for PaypalSource. +func (ps PaypalSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for PaypalSource. +func (ps PaypalSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsSQLDWSource is the BasicCopySource implementation for PaypalSource. +func (ps PaypalSource) AsSQLDWSource() (*SQLDWSource, bool) { + return nil, false +} + +// AsSQLSource is the BasicCopySource implementation for PaypalSource. +func (ps PaypalSource) AsSQLSource() (*SQLSource, bool) { + return nil, false +} + +// AsSapEccSource is the BasicCopySource implementation for PaypalSource. +func (ps PaypalSource) AsSapEccSource() (*SapEccSource, bool) { + return nil, false +} + +// AsSapCloudForCustomerSource is the BasicCopySource implementation for PaypalSource. +func (ps PaypalSource) AsSapCloudForCustomerSource() (*SapCloudForCustomerSource, bool) { + return nil, false +} + +// AsSalesforceSource is the BasicCopySource implementation for PaypalSource. +func (ps PaypalSource) AsSalesforceSource() (*SalesforceSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for PaypalSource. +func (ps PaypalSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for PaypalSource. +func (ps PaypalSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for PaypalSource. +func (ps PaypalSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for PaypalSource. +func (ps PaypalSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + +// AsAzureTableSource is the BasicCopySource implementation for PaypalSource. +func (ps PaypalSource) AsAzureTableSource() (*AzureTableSource, bool) { + return nil, false +} + +// AsCopySource is the BasicCopySource implementation for PaypalSource. +func (ps PaypalSource) AsCopySource() (*CopySource, bool) { + return nil, false +} + +// AsBasicCopySource is the BasicCopySource implementation for PaypalSource. +func (ps PaypalSource) AsBasicCopySource() (BasicCopySource, bool) { + return &ps, true +} + +// PhoenixLinkedService phoenix server linked service. +type PhoenixLinkedService struct { + // PhoenixLinkedServiceTypeProperties - Phoenix server linked service properties. + *PhoenixLinkedServiceTypeProperties `json:"typeProperties,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // ConnectVia - The integration runtime reference. + ConnectVia *IntegrationRuntimeReference `json:"connectVia,omitempty"` + // Description - Linked service description. + Description *string `json:"description,omitempty"` + // Parameters - Parameters for linked service. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeLinkedService', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforce', 'TypeAzureDataLakeStore', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureStorage' + Type TypeBasicLinkedService `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for PhoenixLinkedService. +func (pls PhoenixLinkedService) MarshalJSON() ([]byte, error) { + pls.Type = TypePhoenix + objectMap := make(map[string]interface{}) + if pls.PhoenixLinkedServiceTypeProperties != nil { + objectMap["typeProperties"] = pls.PhoenixLinkedServiceTypeProperties + } + if pls.ConnectVia != nil { + objectMap["connectVia"] = pls.ConnectVia + } + if pls.Description != nil { + objectMap["description"] = pls.Description + } + if pls.Parameters != nil { + objectMap["parameters"] = pls.Parameters + } + if pls.Annotations != nil { + objectMap["annotations"] = pls.Annotations + } + if pls.Type != "" { + objectMap["type"] = pls.Type + } + for k, v := range pls.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysLinkedService is the BasicLinkedService implementation for PhoenixLinkedService. +func (pls PhoenixLinkedService) AsResponsysLinkedService() (*ResponsysLinkedService, bool) { + return nil, false +} + +// AsAzureDatabricksLinkedService is the BasicLinkedService implementation for PhoenixLinkedService. +func (pls PhoenixLinkedService) AsAzureDatabricksLinkedService() (*AzureDatabricksLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeAnalyticsLinkedService is the BasicLinkedService implementation for PhoenixLinkedService. +func (pls PhoenixLinkedService) AsAzureDataLakeAnalyticsLinkedService() (*AzureDataLakeAnalyticsLinkedService, bool) { + return nil, false +} + +// AsHDInsightOnDemandLinkedService is the BasicLinkedService implementation for PhoenixLinkedService. +func (pls PhoenixLinkedService) AsHDInsightOnDemandLinkedService() (*HDInsightOnDemandLinkedService, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudLinkedService is the BasicLinkedService implementation for PhoenixLinkedService. +func (pls PhoenixLinkedService) AsSalesforceMarketingCloudLinkedService() (*SalesforceMarketingCloudLinkedService, bool) { + return nil, false +} + +// AsNetezzaLinkedService is the BasicLinkedService implementation for PhoenixLinkedService. +func (pls PhoenixLinkedService) AsNetezzaLinkedService() (*NetezzaLinkedService, bool) { + return nil, false +} + +// AsVerticaLinkedService is the BasicLinkedService implementation for PhoenixLinkedService. +func (pls PhoenixLinkedService) AsVerticaLinkedService() (*VerticaLinkedService, bool) { + return nil, false +} + +// AsZohoLinkedService is the BasicLinkedService implementation for PhoenixLinkedService. +func (pls PhoenixLinkedService) AsZohoLinkedService() (*ZohoLinkedService, bool) { + return nil, false +} + +// AsXeroLinkedService is the BasicLinkedService implementation for PhoenixLinkedService. +func (pls PhoenixLinkedService) AsXeroLinkedService() (*XeroLinkedService, bool) { + return nil, false +} + +// AsSquareLinkedService is the BasicLinkedService implementation for PhoenixLinkedService. +func (pls PhoenixLinkedService) AsSquareLinkedService() (*SquareLinkedService, bool) { + return nil, false +} + +// AsSparkLinkedService is the BasicLinkedService implementation for PhoenixLinkedService. +func (pls PhoenixLinkedService) AsSparkLinkedService() (*SparkLinkedService, bool) { + return nil, false +} + +// AsShopifyLinkedService is the BasicLinkedService implementation for PhoenixLinkedService. +func (pls PhoenixLinkedService) AsShopifyLinkedService() (*ShopifyLinkedService, bool) { + return nil, false +} + +// AsServiceNowLinkedService is the BasicLinkedService implementation for PhoenixLinkedService. +func (pls PhoenixLinkedService) AsServiceNowLinkedService() (*ServiceNowLinkedService, bool) { + return nil, false +} + +// AsQuickBooksLinkedService is the BasicLinkedService implementation for PhoenixLinkedService. +func (pls PhoenixLinkedService) AsQuickBooksLinkedService() (*QuickBooksLinkedService, bool) { + return nil, false +} + +// AsPrestoLinkedService is the BasicLinkedService implementation for PhoenixLinkedService. +func (pls PhoenixLinkedService) AsPrestoLinkedService() (*PrestoLinkedService, bool) { + return nil, false +} + +// AsPhoenixLinkedService is the BasicLinkedService implementation for PhoenixLinkedService. +func (pls PhoenixLinkedService) AsPhoenixLinkedService() (*PhoenixLinkedService, bool) { + return &pls, true +} + +// AsPaypalLinkedService is the BasicLinkedService implementation for PhoenixLinkedService. +func (pls PhoenixLinkedService) AsPaypalLinkedService() (*PaypalLinkedService, bool) { + return nil, false +} + +// AsMarketoLinkedService is the BasicLinkedService implementation for PhoenixLinkedService. +func (pls PhoenixLinkedService) AsMarketoLinkedService() (*MarketoLinkedService, bool) { + return nil, false +} + +// AsMariaDBLinkedService is the BasicLinkedService implementation for PhoenixLinkedService. +func (pls PhoenixLinkedService) AsMariaDBLinkedService() (*MariaDBLinkedService, bool) { + return nil, false +} + +// AsMagentoLinkedService is the BasicLinkedService implementation for PhoenixLinkedService. +func (pls PhoenixLinkedService) AsMagentoLinkedService() (*MagentoLinkedService, bool) { + return nil, false +} + +// AsJiraLinkedService is the BasicLinkedService implementation for PhoenixLinkedService. +func (pls PhoenixLinkedService) AsJiraLinkedService() (*JiraLinkedService, bool) { + return nil, false +} + +// AsImpalaLinkedService is the BasicLinkedService implementation for PhoenixLinkedService. +func (pls PhoenixLinkedService) AsImpalaLinkedService() (*ImpalaLinkedService, bool) { + return nil, false +} + +// AsHubspotLinkedService is the BasicLinkedService implementation for PhoenixLinkedService. +func (pls PhoenixLinkedService) AsHubspotLinkedService() (*HubspotLinkedService, bool) { + return nil, false +} + +// AsHiveLinkedService is the BasicLinkedService implementation for PhoenixLinkedService. +func (pls PhoenixLinkedService) AsHiveLinkedService() (*HiveLinkedService, bool) { + return nil, false +} + +// AsHBaseLinkedService is the BasicLinkedService implementation for PhoenixLinkedService. +func (pls PhoenixLinkedService) AsHBaseLinkedService() (*HBaseLinkedService, bool) { + return nil, false +} + +// AsGreenplumLinkedService is the BasicLinkedService implementation for PhoenixLinkedService. +func (pls PhoenixLinkedService) AsGreenplumLinkedService() (*GreenplumLinkedService, bool) { + return nil, false +} + +// AsGoogleBigQueryLinkedService is the BasicLinkedService implementation for PhoenixLinkedService. +func (pls PhoenixLinkedService) AsGoogleBigQueryLinkedService() (*GoogleBigQueryLinkedService, bool) { + return nil, false +} + +// AsEloquaLinkedService is the BasicLinkedService implementation for PhoenixLinkedService. +func (pls PhoenixLinkedService) AsEloquaLinkedService() (*EloquaLinkedService, bool) { + return nil, false +} + +// AsDrillLinkedService is the BasicLinkedService implementation for PhoenixLinkedService. +func (pls PhoenixLinkedService) AsDrillLinkedService() (*DrillLinkedService, bool) { + return nil, false +} + +// AsCouchbaseLinkedService is the BasicLinkedService implementation for PhoenixLinkedService. +func (pls PhoenixLinkedService) AsCouchbaseLinkedService() (*CouchbaseLinkedService, bool) { + return nil, false +} + +// AsConcurLinkedService is the BasicLinkedService implementation for PhoenixLinkedService. +func (pls PhoenixLinkedService) AsConcurLinkedService() (*ConcurLinkedService, bool) { + return nil, false +} + +// AsAzurePostgreSQLLinkedService is the BasicLinkedService implementation for PhoenixLinkedService. +func (pls PhoenixLinkedService) AsAzurePostgreSQLLinkedService() (*AzurePostgreSQLLinkedService, bool) { + return nil, false +} + +// AsAmazonMWSLinkedService is the BasicLinkedService implementation for PhoenixLinkedService. +func (pls PhoenixLinkedService) AsAmazonMWSLinkedService() (*AmazonMWSLinkedService, bool) { + return nil, false +} + +// AsSapHanaLinkedService is the BasicLinkedService implementation for PhoenixLinkedService. +func (pls PhoenixLinkedService) AsSapHanaLinkedService() (*SapHanaLinkedService, bool) { + return nil, false +} + +// AsSapBWLinkedService is the BasicLinkedService implementation for PhoenixLinkedService. +func (pls PhoenixLinkedService) AsSapBWLinkedService() (*SapBWLinkedService, bool) { + return nil, false +} + +// AsSftpServerLinkedService is the BasicLinkedService implementation for PhoenixLinkedService. +func (pls PhoenixLinkedService) AsSftpServerLinkedService() (*SftpServerLinkedService, bool) { + return nil, false +} + +// AsFtpServerLinkedService is the BasicLinkedService implementation for PhoenixLinkedService. +func (pls PhoenixLinkedService) AsFtpServerLinkedService() (*FtpServerLinkedService, bool) { + return nil, false +} + +// AsHTTPLinkedService is the BasicLinkedService implementation for PhoenixLinkedService. +func (pls PhoenixLinkedService) AsHTTPLinkedService() (*HTTPLinkedService, bool) { + return nil, false +} + +// AsAzureSearchLinkedService is the BasicLinkedService implementation for PhoenixLinkedService. +func (pls PhoenixLinkedService) AsAzureSearchLinkedService() (*AzureSearchLinkedService, bool) { + return nil, false +} + +// AsCustomDataSourceLinkedService is the BasicLinkedService implementation for PhoenixLinkedService. +func (pls PhoenixLinkedService) AsCustomDataSourceLinkedService() (*CustomDataSourceLinkedService, bool) { + return nil, false +} + +// AsAmazonRedshiftLinkedService is the BasicLinkedService implementation for PhoenixLinkedService. +func (pls PhoenixLinkedService) AsAmazonRedshiftLinkedService() (*AmazonRedshiftLinkedService, bool) { + return nil, false +} + +// AsAmazonS3LinkedService is the BasicLinkedService implementation for PhoenixLinkedService. +func (pls PhoenixLinkedService) AsAmazonS3LinkedService() (*AmazonS3LinkedService, bool) { + return nil, false +} + +// AsSapEccLinkedService is the BasicLinkedService implementation for PhoenixLinkedService. +func (pls PhoenixLinkedService) AsSapEccLinkedService() (*SapEccLinkedService, bool) { + return nil, false +} + +// AsSapCloudForCustomerLinkedService is the BasicLinkedService implementation for PhoenixLinkedService. +func (pls PhoenixLinkedService) AsSapCloudForCustomerLinkedService() (*SapCloudForCustomerLinkedService, bool) { + return nil, false +} + +// AsSalesforceLinkedService is the BasicLinkedService implementation for PhoenixLinkedService. +func (pls PhoenixLinkedService) AsSalesforceLinkedService() (*SalesforceLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeStoreLinkedService is the BasicLinkedService implementation for PhoenixLinkedService. +func (pls PhoenixLinkedService) AsAzureDataLakeStoreLinkedService() (*AzureDataLakeStoreLinkedService, bool) { + return nil, false +} + +// AsMongoDbLinkedService is the BasicLinkedService implementation for PhoenixLinkedService. +func (pls PhoenixLinkedService) AsMongoDbLinkedService() (*MongoDbLinkedService, bool) { + return nil, false +} + +// AsCassandraLinkedService is the BasicLinkedService implementation for PhoenixLinkedService. +func (pls PhoenixLinkedService) AsCassandraLinkedService() (*CassandraLinkedService, bool) { + return nil, false +} + +// AsWebLinkedService is the BasicLinkedService implementation for PhoenixLinkedService. +func (pls PhoenixLinkedService) AsWebLinkedService() (*WebLinkedService, bool) { + return nil, false +} + +// AsODataLinkedService is the BasicLinkedService implementation for PhoenixLinkedService. +func (pls PhoenixLinkedService) AsODataLinkedService() (*ODataLinkedService, bool) { + return nil, false +} + +// AsHdfsLinkedService is the BasicLinkedService implementation for PhoenixLinkedService. +func (pls PhoenixLinkedService) AsHdfsLinkedService() (*HdfsLinkedService, bool) { + return nil, false +} + +// AsOdbcLinkedService is the BasicLinkedService implementation for PhoenixLinkedService. +func (pls PhoenixLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, bool) { + return nil, false +} + +// AsAzureMLLinkedService is the BasicLinkedService implementation for PhoenixLinkedService. +func (pls PhoenixLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { + return nil, false +} + +// AsTeradataLinkedService is the BasicLinkedService implementation for PhoenixLinkedService. +func (pls PhoenixLinkedService) AsTeradataLinkedService() (*TeradataLinkedService, bool) { + return nil, false +} + +// AsDb2LinkedService is the BasicLinkedService implementation for PhoenixLinkedService. +func (pls PhoenixLinkedService) AsDb2LinkedService() (*Db2LinkedService, bool) { + return nil, false +} + +// AsSybaseLinkedService is the BasicLinkedService implementation for PhoenixLinkedService. +func (pls PhoenixLinkedService) AsSybaseLinkedService() (*SybaseLinkedService, bool) { + return nil, false +} + +// AsPostgreSQLLinkedService is the BasicLinkedService implementation for PhoenixLinkedService. +func (pls PhoenixLinkedService) AsPostgreSQLLinkedService() (*PostgreSQLLinkedService, bool) { + return nil, false +} + +// AsMySQLLinkedService is the BasicLinkedService implementation for PhoenixLinkedService. +func (pls PhoenixLinkedService) AsMySQLLinkedService() (*MySQLLinkedService, bool) { + return nil, false +} + +// AsAzureMySQLLinkedService is the BasicLinkedService implementation for PhoenixLinkedService. +func (pls PhoenixLinkedService) AsAzureMySQLLinkedService() (*AzureMySQLLinkedService, bool) { + return nil, false +} + +// AsOracleLinkedService is the BasicLinkedService implementation for PhoenixLinkedService. +func (pls PhoenixLinkedService) AsOracleLinkedService() (*OracleLinkedService, bool) { + return nil, false +} + +// AsFileServerLinkedService is the BasicLinkedService implementation for PhoenixLinkedService. +func (pls PhoenixLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { + return nil, false +} + +// AsHDInsightLinkedService is the BasicLinkedService implementation for PhoenixLinkedService. +func (pls PhoenixLinkedService) AsHDInsightLinkedService() (*HDInsightLinkedService, bool) { + return nil, false +} + +// AsDynamicsLinkedService is the BasicLinkedService implementation for PhoenixLinkedService. +func (pls PhoenixLinkedService) AsDynamicsLinkedService() (*DynamicsLinkedService, bool) { + return nil, false +} + +// AsCosmosDbLinkedService is the BasicLinkedService implementation for PhoenixLinkedService. +func (pls PhoenixLinkedService) AsCosmosDbLinkedService() (*CosmosDbLinkedService, bool) { + return nil, false +} + +// AsAzureKeyVaultLinkedService is the BasicLinkedService implementation for PhoenixLinkedService. +func (pls PhoenixLinkedService) AsAzureKeyVaultLinkedService() (*AzureKeyVaultLinkedService, bool) { + return nil, false +} + +// AsAzureBatchLinkedService is the BasicLinkedService implementation for PhoenixLinkedService. +func (pls PhoenixLinkedService) AsAzureBatchLinkedService() (*AzureBatchLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDatabaseLinkedService is the BasicLinkedService implementation for PhoenixLinkedService. +func (pls PhoenixLinkedService) AsAzureSQLDatabaseLinkedService() (*AzureSQLDatabaseLinkedService, bool) { + return nil, false +} + +// AsSQLServerLinkedService is the BasicLinkedService implementation for PhoenixLinkedService. +func (pls PhoenixLinkedService) AsSQLServerLinkedService() (*SQLServerLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDWLinkedService is the BasicLinkedService implementation for PhoenixLinkedService. +func (pls PhoenixLinkedService) AsAzureSQLDWLinkedService() (*AzureSQLDWLinkedService, bool) { + return nil, false +} + +// AsAzureStorageLinkedService is the BasicLinkedService implementation for PhoenixLinkedService. +func (pls PhoenixLinkedService) AsAzureStorageLinkedService() (*AzureStorageLinkedService, bool) { + return nil, false +} + +// AsLinkedService is the BasicLinkedService implementation for PhoenixLinkedService. +func (pls PhoenixLinkedService) AsLinkedService() (*LinkedService, bool) { + return nil, false +} + +// AsBasicLinkedService is the BasicLinkedService implementation for PhoenixLinkedService. +func (pls PhoenixLinkedService) AsBasicLinkedService() (BasicLinkedService, bool) { + return &pls, true +} + +// UnmarshalJSON is the custom unmarshaler for PhoenixLinkedService struct. +func (pls *PhoenixLinkedService) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "typeProperties": + if v != nil { + var phoenixLinkedServiceTypeProperties PhoenixLinkedServiceTypeProperties + err = json.Unmarshal(*v, &phoenixLinkedServiceTypeProperties) + if err != nil { + return err + } + pls.PhoenixLinkedServiceTypeProperties = &phoenixLinkedServiceTypeProperties + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if pls.AdditionalProperties == nil { + pls.AdditionalProperties = make(map[string]interface{}) + } + pls.AdditionalProperties[k] = additionalProperties + } + case "connectVia": + if v != nil { + var connectVia IntegrationRuntimeReference + err = json.Unmarshal(*v, &connectVia) + if err != nil { + return err + } + pls.ConnectVia = &connectVia + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + pls.Description = &description + } + case "parameters": + if v != nil { + var parameters map[string]*ParameterSpecification + err = json.Unmarshal(*v, ¶meters) + if err != nil { + return err + } + pls.Parameters = parameters + } + case "annotations": + if v != nil { + var annotations []interface{} + err = json.Unmarshal(*v, &annotations) + if err != nil { + return err + } + pls.Annotations = &annotations + } + case "type": + if v != nil { + var typeVar TypeBasicLinkedService + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + pls.Type = typeVar + } + } + } + + return nil +} + +// PhoenixLinkedServiceTypeProperties phoenix server linked service properties. +type PhoenixLinkedServiceTypeProperties struct { + // Host - The IP address or host name of the Phoenix server. (i.e. 192.168.222.160) + Host interface{} `json:"host,omitempty"` + // Port - The TCP port that the Phoenix server uses to listen for client connections. The default value is 8765. + Port interface{} `json:"port,omitempty"` + // HTTPPath - The partial URL corresponding to the Phoenix server. (i.e. /gateway/sandbox/phoenix/version). The default value is hbasephoenix if using WindowsAzureHDInsightService. + HTTPPath interface{} `json:"httpPath,omitempty"` + // AuthenticationType - The authentication mechanism used to connect to the Phoenix server. Possible values include: 'PhoenixAuthenticationTypeAnonymous', 'PhoenixAuthenticationTypeUsernameAndPassword', 'PhoenixAuthenticationTypeWindowsAzureHDInsightService' + AuthenticationType PhoenixAuthenticationType `json:"authenticationType,omitempty"` + // Username - The user name used to connect to the Phoenix server. + Username interface{} `json:"username,omitempty"` + // Password - The password corresponding to the user name. + Password BasicSecretBase `json:"password,omitempty"` + // EnableSsl - Specifies whether the connections to the server are encrypted using SSL. The default value is false. + EnableSsl interface{} `json:"enableSsl,omitempty"` + // TrustedCertPath - The full path of the .pem file containing trusted CA certificates for verifying the server when connecting over SSL. This property can only be set when using SSL on self-hosted IR. The default value is the cacerts.pem file installed with the IR. + TrustedCertPath interface{} `json:"trustedCertPath,omitempty"` + // UseSystemTrustStore - Specifies whether to use a CA certificate from the system trust store or from a specified PEM file. The default value is false. + UseSystemTrustStore interface{} `json:"useSystemTrustStore,omitempty"` + // AllowHostNameCNMismatch - Specifies whether to require a CA-issued SSL certificate name to match the host name of the server when connecting over SSL. The default value is false. + AllowHostNameCNMismatch interface{} `json:"allowHostNameCNMismatch,omitempty"` + // AllowSelfSignedServerCert - Specifies whether to allow self-signed certificates from the server. The default value is false. + AllowSelfSignedServerCert interface{} `json:"allowSelfSignedServerCert,omitempty"` + // EncryptedCredential - The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string). + EncryptedCredential interface{} `json:"encryptedCredential,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for PhoenixLinkedServiceTypeProperties struct. +func (plstp *PhoenixLinkedServiceTypeProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "host": + if v != nil { + var host interface{} + err = json.Unmarshal(*v, &host) + if err != nil { + return err + } + plstp.Host = host + } + case "port": + if v != nil { + var port interface{} + err = json.Unmarshal(*v, &port) + if err != nil { + return err + } + plstp.Port = port + } + case "httpPath": + if v != nil { + var HTTPPath interface{} + err = json.Unmarshal(*v, &HTTPPath) + if err != nil { + return err + } + plstp.HTTPPath = HTTPPath + } + case "authenticationType": + if v != nil { + var authenticationType PhoenixAuthenticationType + err = json.Unmarshal(*v, &authenticationType) + if err != nil { + return err + } + plstp.AuthenticationType = authenticationType + } + case "username": + if v != nil { + var username interface{} + err = json.Unmarshal(*v, &username) + if err != nil { + return err + } + plstp.Username = username + } + case "password": + if v != nil { + password, err := unmarshalBasicSecretBase(*v) + if err != nil { + return err + } + plstp.Password = password + } + case "enableSsl": + if v != nil { + var enableSsl interface{} + err = json.Unmarshal(*v, &enableSsl) + if err != nil { + return err + } + plstp.EnableSsl = enableSsl + } + case "trustedCertPath": + if v != nil { + var trustedCertPath interface{} + err = json.Unmarshal(*v, &trustedCertPath) + if err != nil { + return err + } + plstp.TrustedCertPath = trustedCertPath + } + case "useSystemTrustStore": + if v != nil { + var useSystemTrustStore interface{} + err = json.Unmarshal(*v, &useSystemTrustStore) + if err != nil { + return err + } + plstp.UseSystemTrustStore = useSystemTrustStore + } + case "allowHostNameCNMismatch": + if v != nil { + var allowHostNameCNMismatch interface{} + err = json.Unmarshal(*v, &allowHostNameCNMismatch) + if err != nil { + return err + } + plstp.AllowHostNameCNMismatch = allowHostNameCNMismatch + } + case "allowSelfSignedServerCert": + if v != nil { + var allowSelfSignedServerCert interface{} + err = json.Unmarshal(*v, &allowSelfSignedServerCert) + if err != nil { + return err + } + plstp.AllowSelfSignedServerCert = allowSelfSignedServerCert + } + case "encryptedCredential": + if v != nil { + var encryptedCredential interface{} + err = json.Unmarshal(*v, &encryptedCredential) + if err != nil { + return err + } + plstp.EncryptedCredential = encryptedCredential + } + } + } + + return nil +} + +// PhoenixObjectDataset phoenix server dataset. +type PhoenixObjectDataset struct { + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Description - Dataset description. + Description *string `json:"description,omitempty"` + // Structure - Columns that define the structure of the dataset. Type: array (or Expression with resultType array), itemType: DatasetDataElement. + Structure interface{} `json:"structure,omitempty"` + // LinkedServiceName - Linked service reference. + LinkedServiceName *LinkedServiceReference `json:"linkedServiceName,omitempty"` + // Parameters - Parameters for dataset. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeDataset', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSQLServerTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSalesforceObject', 'TypeRelationalTable', 'TypeAzureMySQLTable', 'TypeOracleTable', 'TypeODataResource', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeAzureDataLakeStoreFile', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeAmazonS3Object' + Type TypeBasicDataset `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for PhoenixObjectDataset. +func (pod PhoenixObjectDataset) MarshalJSON() ([]byte, error) { + pod.Type = TypePhoenixObject + objectMap := make(map[string]interface{}) + if pod.Description != nil { + objectMap["description"] = pod.Description + } + objectMap["structure"] = pod.Structure + if pod.LinkedServiceName != nil { + objectMap["linkedServiceName"] = pod.LinkedServiceName + } + if pod.Parameters != nil { + objectMap["parameters"] = pod.Parameters + } + if pod.Annotations != nil { + objectMap["annotations"] = pod.Annotations + } + if pod.Type != "" { + objectMap["type"] = pod.Type + } + for k, v := range pod.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysObjectDataset is the BasicDataset implementation for PhoenixObjectDataset. +func (pod PhoenixObjectDataset) AsResponsysObjectDataset() (*ResponsysObjectDataset, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudObjectDataset is the BasicDataset implementation for PhoenixObjectDataset. +func (pod PhoenixObjectDataset) AsSalesforceMarketingCloudObjectDataset() (*SalesforceMarketingCloudObjectDataset, bool) { + return nil, false +} + +// AsVerticaTableDataset is the BasicDataset implementation for PhoenixObjectDataset. +func (pod PhoenixObjectDataset) AsVerticaTableDataset() (*VerticaTableDataset, bool) { + return nil, false +} + +// AsNetezzaTableDataset is the BasicDataset implementation for PhoenixObjectDataset. +func (pod PhoenixObjectDataset) AsNetezzaTableDataset() (*NetezzaTableDataset, bool) { + return nil, false +} + +// AsZohoObjectDataset is the BasicDataset implementation for PhoenixObjectDataset. +func (pod PhoenixObjectDataset) AsZohoObjectDataset() (*ZohoObjectDataset, bool) { + return nil, false +} + +// AsXeroObjectDataset is the BasicDataset implementation for PhoenixObjectDataset. +func (pod PhoenixObjectDataset) AsXeroObjectDataset() (*XeroObjectDataset, bool) { + return nil, false +} + +// AsSquareObjectDataset is the BasicDataset implementation for PhoenixObjectDataset. +func (pod PhoenixObjectDataset) AsSquareObjectDataset() (*SquareObjectDataset, bool) { + return nil, false +} + +// AsSparkObjectDataset is the BasicDataset implementation for PhoenixObjectDataset. +func (pod PhoenixObjectDataset) AsSparkObjectDataset() (*SparkObjectDataset, bool) { + return nil, false +} + +// AsShopifyObjectDataset is the BasicDataset implementation for PhoenixObjectDataset. +func (pod PhoenixObjectDataset) AsShopifyObjectDataset() (*ShopifyObjectDataset, bool) { + return nil, false +} + +// AsServiceNowObjectDataset is the BasicDataset implementation for PhoenixObjectDataset. +func (pod PhoenixObjectDataset) AsServiceNowObjectDataset() (*ServiceNowObjectDataset, bool) { + return nil, false +} + +// AsQuickBooksObjectDataset is the BasicDataset implementation for PhoenixObjectDataset. +func (pod PhoenixObjectDataset) AsQuickBooksObjectDataset() (*QuickBooksObjectDataset, bool) { + return nil, false +} + +// AsPrestoObjectDataset is the BasicDataset implementation for PhoenixObjectDataset. +func (pod PhoenixObjectDataset) AsPrestoObjectDataset() (*PrestoObjectDataset, bool) { + return nil, false +} + +// AsPhoenixObjectDataset is the BasicDataset implementation for PhoenixObjectDataset. +func (pod PhoenixObjectDataset) AsPhoenixObjectDataset() (*PhoenixObjectDataset, bool) { + return &pod, true +} + +// AsPaypalObjectDataset is the BasicDataset implementation for PhoenixObjectDataset. +func (pod PhoenixObjectDataset) AsPaypalObjectDataset() (*PaypalObjectDataset, bool) { + return nil, false +} + +// AsMarketoObjectDataset is the BasicDataset implementation for PhoenixObjectDataset. +func (pod PhoenixObjectDataset) AsMarketoObjectDataset() (*MarketoObjectDataset, bool) { + return nil, false +} + +// AsMariaDBTableDataset is the BasicDataset implementation for PhoenixObjectDataset. +func (pod PhoenixObjectDataset) AsMariaDBTableDataset() (*MariaDBTableDataset, bool) { + return nil, false +} + +// AsMagentoObjectDataset is the BasicDataset implementation for PhoenixObjectDataset. +func (pod PhoenixObjectDataset) AsMagentoObjectDataset() (*MagentoObjectDataset, bool) { + return nil, false +} + +// AsJiraObjectDataset is the BasicDataset implementation for PhoenixObjectDataset. +func (pod PhoenixObjectDataset) AsJiraObjectDataset() (*JiraObjectDataset, bool) { + return nil, false +} + +// AsImpalaObjectDataset is the BasicDataset implementation for PhoenixObjectDataset. +func (pod PhoenixObjectDataset) AsImpalaObjectDataset() (*ImpalaObjectDataset, bool) { + return nil, false +} + +// AsHubspotObjectDataset is the BasicDataset implementation for PhoenixObjectDataset. +func (pod PhoenixObjectDataset) AsHubspotObjectDataset() (*HubspotObjectDataset, bool) { + return nil, false +} + +// AsHiveObjectDataset is the BasicDataset implementation for PhoenixObjectDataset. +func (pod PhoenixObjectDataset) AsHiveObjectDataset() (*HiveObjectDataset, bool) { + return nil, false +} + +// AsHBaseObjectDataset is the BasicDataset implementation for PhoenixObjectDataset. +func (pod PhoenixObjectDataset) AsHBaseObjectDataset() (*HBaseObjectDataset, bool) { + return nil, false +} + +// AsGreenplumTableDataset is the BasicDataset implementation for PhoenixObjectDataset. +func (pod PhoenixObjectDataset) AsGreenplumTableDataset() (*GreenplumTableDataset, bool) { + return nil, false +} + +// AsGoogleBigQueryObjectDataset is the BasicDataset implementation for PhoenixObjectDataset. +func (pod PhoenixObjectDataset) AsGoogleBigQueryObjectDataset() (*GoogleBigQueryObjectDataset, bool) { + return nil, false +} + +// AsEloquaObjectDataset is the BasicDataset implementation for PhoenixObjectDataset. +func (pod PhoenixObjectDataset) AsEloquaObjectDataset() (*EloquaObjectDataset, bool) { + return nil, false +} + +// AsDrillTableDataset is the BasicDataset implementation for PhoenixObjectDataset. +func (pod PhoenixObjectDataset) AsDrillTableDataset() (*DrillTableDataset, bool) { + return nil, false +} + +// AsCouchbaseTableDataset is the BasicDataset implementation for PhoenixObjectDataset. +func (pod PhoenixObjectDataset) AsCouchbaseTableDataset() (*CouchbaseTableDataset, bool) { + return nil, false +} + +// AsConcurObjectDataset is the BasicDataset implementation for PhoenixObjectDataset. +func (pod PhoenixObjectDataset) AsConcurObjectDataset() (*ConcurObjectDataset, bool) { + return nil, false +} + +// AsAzurePostgreSQLTableDataset is the BasicDataset implementation for PhoenixObjectDataset. +func (pod PhoenixObjectDataset) AsAzurePostgreSQLTableDataset() (*AzurePostgreSQLTableDataset, bool) { + return nil, false +} + +// AsAmazonMWSObjectDataset is the BasicDataset implementation for PhoenixObjectDataset. +func (pod PhoenixObjectDataset) AsAmazonMWSObjectDataset() (*AmazonMWSObjectDataset, bool) { + return nil, false +} + +// AsHTTPDataset is the BasicDataset implementation for PhoenixObjectDataset. +func (pod PhoenixObjectDataset) AsHTTPDataset() (*HTTPDataset, bool) { + return nil, false +} + +// AsAzureSearchIndexDataset is the BasicDataset implementation for PhoenixObjectDataset. +func (pod PhoenixObjectDataset) AsAzureSearchIndexDataset() (*AzureSearchIndexDataset, bool) { + return nil, false +} + +// AsWebTableDataset is the BasicDataset implementation for PhoenixObjectDataset. +func (pod PhoenixObjectDataset) AsWebTableDataset() (*WebTableDataset, bool) { + return nil, false +} + +// AsSQLServerTableDataset is the BasicDataset implementation for PhoenixObjectDataset. +func (pod PhoenixObjectDataset) AsSQLServerTableDataset() (*SQLServerTableDataset, bool) { + return nil, false +} + +// AsSapEccResourceDataset is the BasicDataset implementation for PhoenixObjectDataset. +func (pod PhoenixObjectDataset) AsSapEccResourceDataset() (*SapEccResourceDataset, bool) { + return nil, false +} + +// AsSapCloudForCustomerResourceDataset is the BasicDataset implementation for PhoenixObjectDataset. +func (pod PhoenixObjectDataset) AsSapCloudForCustomerResourceDataset() (*SapCloudForCustomerResourceDataset, bool) { + return nil, false +} + +// AsSalesforceObjectDataset is the BasicDataset implementation for PhoenixObjectDataset. +func (pod PhoenixObjectDataset) AsSalesforceObjectDataset() (*SalesforceObjectDataset, bool) { + return nil, false +} + +// AsRelationalTableDataset is the BasicDataset implementation for PhoenixObjectDataset. +func (pod PhoenixObjectDataset) AsRelationalTableDataset() (*RelationalTableDataset, bool) { + return nil, false +} + +// AsAzureMySQLTableDataset is the BasicDataset implementation for PhoenixObjectDataset. +func (pod PhoenixObjectDataset) AsAzureMySQLTableDataset() (*AzureMySQLTableDataset, bool) { + return nil, false +} + +// AsOracleTableDataset is the BasicDataset implementation for PhoenixObjectDataset. +func (pod PhoenixObjectDataset) AsOracleTableDataset() (*OracleTableDataset, bool) { + return nil, false +} + +// AsODataResourceDataset is the BasicDataset implementation for PhoenixObjectDataset. +func (pod PhoenixObjectDataset) AsODataResourceDataset() (*ODataResourceDataset, bool) { + return nil, false +} + +// AsMongoDbCollectionDataset is the BasicDataset implementation for PhoenixObjectDataset. +func (pod PhoenixObjectDataset) AsMongoDbCollectionDataset() (*MongoDbCollectionDataset, bool) { + return nil, false +} + +// AsFileShareDataset is the BasicDataset implementation for PhoenixObjectDataset. +func (pod PhoenixObjectDataset) AsFileShareDataset() (*FileShareDataset, bool) { + return nil, false +} + +// AsAzureDataLakeStoreDataset is the BasicDataset implementation for PhoenixObjectDataset. +func (pod PhoenixObjectDataset) AsAzureDataLakeStoreDataset() (*AzureDataLakeStoreDataset, bool) { + return nil, false +} + +// AsDynamicsEntityDataset is the BasicDataset implementation for PhoenixObjectDataset. +func (pod PhoenixObjectDataset) AsDynamicsEntityDataset() (*DynamicsEntityDataset, bool) { + return nil, false +} + +// AsDocumentDbCollectionDataset is the BasicDataset implementation for PhoenixObjectDataset. +func (pod PhoenixObjectDataset) AsDocumentDbCollectionDataset() (*DocumentDbCollectionDataset, bool) { + return nil, false +} + +// AsCustomDataset is the BasicDataset implementation for PhoenixObjectDataset. +func (pod PhoenixObjectDataset) AsCustomDataset() (*CustomDataset, bool) { + return nil, false +} + +// AsCassandraTableDataset is the BasicDataset implementation for PhoenixObjectDataset. +func (pod PhoenixObjectDataset) AsCassandraTableDataset() (*CassandraTableDataset, bool) { + return nil, false +} + +// AsAzureSQLDWTableDataset is the BasicDataset implementation for PhoenixObjectDataset. +func (pod PhoenixObjectDataset) AsAzureSQLDWTableDataset() (*AzureSQLDWTableDataset, bool) { + return nil, false +} + +// AsAzureSQLTableDataset is the BasicDataset implementation for PhoenixObjectDataset. +func (pod PhoenixObjectDataset) AsAzureSQLTableDataset() (*AzureSQLTableDataset, bool) { + return nil, false +} + +// AsAzureTableDataset is the BasicDataset implementation for PhoenixObjectDataset. +func (pod PhoenixObjectDataset) AsAzureTableDataset() (*AzureTableDataset, bool) { + return nil, false +} + +// AsAzureBlobDataset is the BasicDataset implementation for PhoenixObjectDataset. +func (pod PhoenixObjectDataset) AsAzureBlobDataset() (*AzureBlobDataset, bool) { + return nil, false +} + +// AsAmazonS3Dataset is the BasicDataset implementation for PhoenixObjectDataset. +func (pod PhoenixObjectDataset) AsAmazonS3Dataset() (*AmazonS3Dataset, bool) { + return nil, false +} + +// AsDataset is the BasicDataset implementation for PhoenixObjectDataset. +func (pod PhoenixObjectDataset) AsDataset() (*Dataset, bool) { + return nil, false +} + +// AsBasicDataset is the BasicDataset implementation for PhoenixObjectDataset. +func (pod PhoenixObjectDataset) AsBasicDataset() (BasicDataset, bool) { + return &pod, true +} + +// PhoenixSource a copy activity Phoenix server source. +type PhoenixSource struct { + // Query - A query to retrieve data from source. Type: string (or Expression with resultType string). + Query interface{} `json:"query,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // SourceRetryCount - Source retry count. Type: integer (or Expression with resultType integer). + SourceRetryCount interface{} `json:"sourceRetryCount,omitempty"` + // SourceRetryWait - Source retry wait. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` + // Type - Possible values include: 'TypeCopySource', 'TypeAmazonRedshiftSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeHTTPSource', 'TypeAzureDataLakeStoreSource', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeRelationalSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource' + Type TypeBasicCopySource `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for PhoenixSource. +func (ps PhoenixSource) MarshalJSON() ([]byte, error) { + ps.Type = TypePhoenixSource + objectMap := make(map[string]interface{}) + objectMap["query"] = ps.Query + objectMap["sourceRetryCount"] = ps.SourceRetryCount + objectMap["sourceRetryWait"] = ps.SourceRetryWait + if ps.Type != "" { + objectMap["type"] = ps.Type + } + for k, v := range ps.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsAmazonRedshiftSource is the BasicCopySource implementation for PhoenixSource. +func (ps PhoenixSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { + return nil, false +} + +// AsResponsysSource is the BasicCopySource implementation for PhoenixSource. +func (ps PhoenixSource) AsResponsysSource() (*ResponsysSource, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudSource is the BasicCopySource implementation for PhoenixSource. +func (ps PhoenixSource) AsSalesforceMarketingCloudSource() (*SalesforceMarketingCloudSource, bool) { + return nil, false +} + +// AsVerticaSource is the BasicCopySource implementation for PhoenixSource. +func (ps PhoenixSource) AsVerticaSource() (*VerticaSource, bool) { + return nil, false +} + +// AsNetezzaSource is the BasicCopySource implementation for PhoenixSource. +func (ps PhoenixSource) AsNetezzaSource() (*NetezzaSource, bool) { + return nil, false +} + +// AsZohoSource is the BasicCopySource implementation for PhoenixSource. +func (ps PhoenixSource) AsZohoSource() (*ZohoSource, bool) { + return nil, false +} + +// AsXeroSource is the BasicCopySource implementation for PhoenixSource. +func (ps PhoenixSource) AsXeroSource() (*XeroSource, bool) { + return nil, false +} + +// AsSquareSource is the BasicCopySource implementation for PhoenixSource. +func (ps PhoenixSource) AsSquareSource() (*SquareSource, bool) { + return nil, false +} + +// AsSparkSource is the BasicCopySource implementation for PhoenixSource. +func (ps PhoenixSource) AsSparkSource() (*SparkSource, bool) { + return nil, false +} + +// AsShopifySource is the BasicCopySource implementation for PhoenixSource. +func (ps PhoenixSource) AsShopifySource() (*ShopifySource, bool) { + return nil, false +} + +// AsServiceNowSource is the BasicCopySource implementation for PhoenixSource. +func (ps PhoenixSource) AsServiceNowSource() (*ServiceNowSource, bool) { + return nil, false +} + +// AsQuickBooksSource is the BasicCopySource implementation for PhoenixSource. +func (ps PhoenixSource) AsQuickBooksSource() (*QuickBooksSource, bool) { + return nil, false +} + +// AsPrestoSource is the BasicCopySource implementation for PhoenixSource. +func (ps PhoenixSource) AsPrestoSource() (*PrestoSource, bool) { + return nil, false +} + +// AsPhoenixSource is the BasicCopySource implementation for PhoenixSource. +func (ps PhoenixSource) AsPhoenixSource() (*PhoenixSource, bool) { + return &ps, true +} + +// AsPaypalSource is the BasicCopySource implementation for PhoenixSource. +func (ps PhoenixSource) AsPaypalSource() (*PaypalSource, bool) { + return nil, false +} + +// AsMarketoSource is the BasicCopySource implementation for PhoenixSource. +func (ps PhoenixSource) AsMarketoSource() (*MarketoSource, bool) { + return nil, false +} + +// AsMariaDBSource is the BasicCopySource implementation for PhoenixSource. +func (ps PhoenixSource) AsMariaDBSource() (*MariaDBSource, bool) { + return nil, false +} + +// AsMagentoSource is the BasicCopySource implementation for PhoenixSource. +func (ps PhoenixSource) AsMagentoSource() (*MagentoSource, bool) { + return nil, false +} + +// AsJiraSource is the BasicCopySource implementation for PhoenixSource. +func (ps PhoenixSource) AsJiraSource() (*JiraSource, bool) { + return nil, false +} + +// AsImpalaSource is the BasicCopySource implementation for PhoenixSource. +func (ps PhoenixSource) AsImpalaSource() (*ImpalaSource, bool) { + return nil, false +} + +// AsHubspotSource is the BasicCopySource implementation for PhoenixSource. +func (ps PhoenixSource) AsHubspotSource() (*HubspotSource, bool) { + return nil, false +} + +// AsHiveSource is the BasicCopySource implementation for PhoenixSource. +func (ps PhoenixSource) AsHiveSource() (*HiveSource, bool) { + return nil, false +} + +// AsHBaseSource is the BasicCopySource implementation for PhoenixSource. +func (ps PhoenixSource) AsHBaseSource() (*HBaseSource, bool) { + return nil, false +} + +// AsGreenplumSource is the BasicCopySource implementation for PhoenixSource. +func (ps PhoenixSource) AsGreenplumSource() (*GreenplumSource, bool) { + return nil, false +} + +// AsGoogleBigQuerySource is the BasicCopySource implementation for PhoenixSource. +func (ps PhoenixSource) AsGoogleBigQuerySource() (*GoogleBigQuerySource, bool) { + return nil, false +} + +// AsEloquaSource is the BasicCopySource implementation for PhoenixSource. +func (ps PhoenixSource) AsEloquaSource() (*EloquaSource, bool) { + return nil, false +} + +// AsDrillSource is the BasicCopySource implementation for PhoenixSource. +func (ps PhoenixSource) AsDrillSource() (*DrillSource, bool) { + return nil, false +} + +// AsCouchbaseSource is the BasicCopySource implementation for PhoenixSource. +func (ps PhoenixSource) AsCouchbaseSource() (*CouchbaseSource, bool) { + return nil, false +} + +// AsConcurSource is the BasicCopySource implementation for PhoenixSource. +func (ps PhoenixSource) AsConcurSource() (*ConcurSource, bool) { + return nil, false +} + +// AsAzurePostgreSQLSource is the BasicCopySource implementation for PhoenixSource. +func (ps PhoenixSource) AsAzurePostgreSQLSource() (*AzurePostgreSQLSource, bool) { + return nil, false +} + +// AsAmazonMWSSource is the BasicCopySource implementation for PhoenixSource. +func (ps PhoenixSource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { + return nil, false +} + +// AsHTTPSource is the BasicCopySource implementation for PhoenixSource. +func (ps PhoenixSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for PhoenixSource. +func (ps PhoenixSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for PhoenixSource. +func (ps PhoenixSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsCassandraSource is the BasicCopySource implementation for PhoenixSource. +func (ps PhoenixSource) AsCassandraSource() (*CassandraSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for PhoenixSource. +func (ps PhoenixSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for PhoenixSource. +func (ps PhoenixSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureMySQLSource is the BasicCopySource implementation for PhoenixSource. +func (ps PhoenixSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for PhoenixSource. +func (ps PhoenixSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for PhoenixSource. +func (ps PhoenixSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsSQLDWSource is the BasicCopySource implementation for PhoenixSource. +func (ps PhoenixSource) AsSQLDWSource() (*SQLDWSource, bool) { + return nil, false +} + +// AsSQLSource is the BasicCopySource implementation for PhoenixSource. +func (ps PhoenixSource) AsSQLSource() (*SQLSource, bool) { + return nil, false +} + +// AsSapEccSource is the BasicCopySource implementation for PhoenixSource. +func (ps PhoenixSource) AsSapEccSource() (*SapEccSource, bool) { + return nil, false +} + +// AsSapCloudForCustomerSource is the BasicCopySource implementation for PhoenixSource. +func (ps PhoenixSource) AsSapCloudForCustomerSource() (*SapCloudForCustomerSource, bool) { + return nil, false +} + +// AsSalesforceSource is the BasicCopySource implementation for PhoenixSource. +func (ps PhoenixSource) AsSalesforceSource() (*SalesforceSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for PhoenixSource. +func (ps PhoenixSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for PhoenixSource. +func (ps PhoenixSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for PhoenixSource. +func (ps PhoenixSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for PhoenixSource. +func (ps PhoenixSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + +// AsAzureTableSource is the BasicCopySource implementation for PhoenixSource. +func (ps PhoenixSource) AsAzureTableSource() (*AzureTableSource, bool) { + return nil, false +} + +// AsCopySource is the BasicCopySource implementation for PhoenixSource. +func (ps PhoenixSource) AsCopySource() (*CopySource, bool) { + return nil, false +} + +// AsBasicCopySource is the BasicCopySource implementation for PhoenixSource. +func (ps PhoenixSource) AsBasicCopySource() (BasicCopySource, bool) { + return &ps, true +} + +// Pipeline a data factory pipeline. +type Pipeline struct { + // Description - The description of the pipeline. + Description *string `json:"description,omitempty"` + // Activities - List of activities in pipeline. + Activities *[]BasicActivity `json:"activities,omitempty"` + // Parameters - List of parameters for pipeline. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Concurrency - The max number of concurrent runs for the pipeline. + Concurrency *int32 `json:"concurrency,omitempty"` + // Annotations - List of tags that can be used for describing the Pipeline. + Annotations *[]interface{} `json:"annotations,omitempty"` +} + +// MarshalJSON is the custom marshaler for Pipeline. +func (p Pipeline) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if p.Description != nil { + objectMap["description"] = p.Description + } + if p.Activities != nil { + objectMap["activities"] = p.Activities + } + if p.Parameters != nil { + objectMap["parameters"] = p.Parameters + } + if p.Concurrency != nil { + objectMap["concurrency"] = p.Concurrency + } + if p.Annotations != nil { + objectMap["annotations"] = p.Annotations + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Pipeline struct. +func (p *Pipeline) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + p.Description = &description + } + case "activities": + if v != nil { + activities, err := unmarshalBasicActivityArray(*v) + if err != nil { + return err + } + p.Activities = &activities + } + case "parameters": + if v != nil { + var parameters map[string]*ParameterSpecification + err = json.Unmarshal(*v, ¶meters) + if err != nil { + return err + } + p.Parameters = parameters + } + case "concurrency": + if v != nil { + var concurrency int32 + err = json.Unmarshal(*v, &concurrency) + if err != nil { + return err + } + p.Concurrency = &concurrency + } + case "annotations": + if v != nil { + var annotations []interface{} + err = json.Unmarshal(*v, &annotations) + if err != nil { + return err + } + p.Annotations = &annotations + } + } + } + + return nil +} + +// PipelineListResponse a list of pipeline resources. +type PipelineListResponse struct { + autorest.Response `json:"-"` + // Value - List of pipelines. + Value *[]PipelineResource `json:"value,omitempty"` + // NextLink - The link to the next page of results, if any remaining results exist. + NextLink *string `json:"nextLink,omitempty"` +} + +// PipelineListResponseIterator provides access to a complete listing of PipelineResource values. +type PipelineListResponseIterator struct { + i int + page PipelineListResponsePage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *PipelineListResponseIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter PipelineListResponseIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter PipelineListResponseIterator) Response() PipelineListResponse { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter PipelineListResponseIterator) Value() PipelineResource { + if !iter.page.NotDone() { + return PipelineResource{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (plr PipelineListResponse) IsEmpty() bool { + return plr.Value == nil || len(*plr.Value) == 0 +} + +// pipelineListResponsePreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (plr PipelineListResponse) pipelineListResponsePreparer() (*http.Request, error) { + if plr.NextLink == nil || len(to.String(plr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(plr.NextLink))) +} + +// PipelineListResponsePage contains a page of PipelineResource values. +type PipelineListResponsePage struct { + fn func(PipelineListResponse) (PipelineListResponse, error) + plr PipelineListResponse +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *PipelineListResponsePage) Next() error { + next, err := page.fn(page.plr) + if err != nil { + return err + } + page.plr = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page PipelineListResponsePage) NotDone() bool { + return !page.plr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page PipelineListResponsePage) Response() PipelineListResponse { + return page.plr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page PipelineListResponsePage) Values() []PipelineResource { + if page.plr.IsEmpty() { + return nil + } + return *page.plr.Value +} + +// PipelineReference pipeline reference type. +type PipelineReference struct { + // Type - Pipeline reference type. + Type *string `json:"type,omitempty"` + // ReferenceName - Reference pipeline name. + ReferenceName *string `json:"referenceName,omitempty"` + // Name - Reference name. + Name *string `json:"name,omitempty"` +} + +// PipelineResource pipeline resource type. +type PipelineResource struct { + autorest.Response `json:"-"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Pipeline - Properties of the pipeline. + *Pipeline `json:"properties,omitempty"` + // ID - The resource identifier. + ID *string `json:"id,omitempty"` + // Name - The resource name. + Name *string `json:"name,omitempty"` + // Type - The resource type. + Type *string `json:"type,omitempty"` + // Etag - Etag identifies change in the resource. + Etag *string `json:"etag,omitempty"` +} + +// MarshalJSON is the custom marshaler for PipelineResource. +func (pr PipelineResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pr.Pipeline != nil { + objectMap["properties"] = pr.Pipeline + } + if pr.ID != nil { + objectMap["id"] = pr.ID + } + if pr.Name != nil { + objectMap["name"] = pr.Name + } + if pr.Type != nil { + objectMap["type"] = pr.Type + } + if pr.Etag != nil { + objectMap["etag"] = pr.Etag + } + for k, v := range pr.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for PipelineResource struct. +func (pr *PipelineResource) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if pr.AdditionalProperties == nil { + pr.AdditionalProperties = make(map[string]interface{}) + } + pr.AdditionalProperties[k] = additionalProperties + } + case "properties": + if v != nil { + var pipeline Pipeline + err = json.Unmarshal(*v, &pipeline) + if err != nil { + return err + } + pr.Pipeline = &pipeline + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + pr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + pr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + pr.Type = &typeVar + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + pr.Etag = &etag + } + } + } + + return nil +} + +// PipelineRun information about a pipeline run. +type PipelineRun struct { + autorest.Response `json:"-"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // RunID - Identifier of a run. + RunID *string `json:"runId,omitempty"` + // PipelineName - The pipeline name. + PipelineName *string `json:"pipelineName,omitempty"` + // Parameters - The full or partial list of parameter name, value pair used in the pipeline run. + Parameters map[string]*string `json:"parameters"` + // InvokedBy - Entity that started the pipeline run. + InvokedBy *PipelineRunInvokedBy `json:"invokedBy,omitempty"` + // LastUpdated - The last updated timestamp for the pipeline run event in ISO8601 format. + LastUpdated *date.Time `json:"lastUpdated,omitempty"` + // RunStart - The start time of a pipeline run in ISO8601 format. + RunStart *date.Time `json:"runStart,omitempty"` + // RunEnd - The end time of a pipeline run in ISO8601 format. + RunEnd *date.Time `json:"runEnd,omitempty"` + // DurationInMs - The duration of a pipeline run. + DurationInMs *int32 `json:"durationInMs,omitempty"` + // Status - The status of a pipeline run. + Status *string `json:"status,omitempty"` + // Message - The message from a pipeline run. + Message *string `json:"message,omitempty"` +} + +// MarshalJSON is the custom marshaler for PipelineRun. +func (pr PipelineRun) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pr.RunID != nil { + objectMap["runId"] = pr.RunID + } + if pr.PipelineName != nil { + objectMap["pipelineName"] = pr.PipelineName + } + if pr.Parameters != nil { + objectMap["parameters"] = pr.Parameters + } + if pr.InvokedBy != nil { + objectMap["invokedBy"] = pr.InvokedBy + } + if pr.LastUpdated != nil { + objectMap["lastUpdated"] = pr.LastUpdated + } + if pr.RunStart != nil { + objectMap["runStart"] = pr.RunStart + } + if pr.RunEnd != nil { + objectMap["runEnd"] = pr.RunEnd + } + if pr.DurationInMs != nil { + objectMap["durationInMs"] = pr.DurationInMs + } + if pr.Status != nil { + objectMap["status"] = pr.Status + } + if pr.Message != nil { + objectMap["message"] = pr.Message + } + for k, v := range pr.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// PipelineRunInvokedBy provides entity name and id that started the pipeline run. +type PipelineRunInvokedBy struct { + // Name - Name of the entity that started the pipeline run. + Name *string `json:"name,omitempty"` + // ID - The ID of the entity that started the run. + ID *string `json:"id,omitempty"` + // InvokedByType - The type of the entity that started the run. + InvokedByType *string `json:"invokedByType,omitempty"` +} + +// PipelineRunsQueryResponse a list pipeline runs. +type PipelineRunsQueryResponse struct { + autorest.Response `json:"-"` + // Value - List of pipeline runs. + Value *[]PipelineRun `json:"value,omitempty"` + // ContinuationToken - The continuation token for getting the next page of results, if any remaining results exist, null otherwise. + ContinuationToken *string `json:"continuationToken,omitempty"` +} + +// PolybaseSettings polyBase settings. +type PolybaseSettings struct { + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // RejectType - Reject type. Possible values include: 'Value', 'Percentage' + RejectType PolybaseSettingsRejectType `json:"rejectType,omitempty"` + // RejectValue - Specifies the value or the percentage of rows that can be rejected before the query fails. Type: number (or Expression with resultType number), minimum: 0. + RejectValue interface{} `json:"rejectValue,omitempty"` + // RejectSampleValue - Determines the number of rows to attempt to retrieve before the PolyBase recalculates the percentage of rejected rows. Type: integer (or Expression with resultType integer), minimum: 0. + RejectSampleValue interface{} `json:"rejectSampleValue,omitempty"` + // UseTypeDefault - Specifies how to handle missing values in delimited text files when PolyBase retrieves data from the text file. Type: boolean (or Expression with resultType boolean). + UseTypeDefault interface{} `json:"useTypeDefault,omitempty"` +} + +// MarshalJSON is the custom marshaler for PolybaseSettings. +func (ps PolybaseSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ps.RejectType != "" { + objectMap["rejectType"] = ps.RejectType + } + objectMap["rejectValue"] = ps.RejectValue + objectMap["rejectSampleValue"] = ps.RejectSampleValue + objectMap["useTypeDefault"] = ps.UseTypeDefault + for k, v := range ps.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// PostgreSQLLinkedService linked service for PostgreSQL data source. +type PostgreSQLLinkedService struct { + // PostgreSQLLinkedServiceTypeProperties - PostgreSQL linked service properties. + *PostgreSQLLinkedServiceTypeProperties `json:"typeProperties,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // ConnectVia - The integration runtime reference. + ConnectVia *IntegrationRuntimeReference `json:"connectVia,omitempty"` + // Description - Linked service description. + Description *string `json:"description,omitempty"` + // Parameters - Parameters for linked service. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeLinkedService', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforce', 'TypeAzureDataLakeStore', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureStorage' + Type TypeBasicLinkedService `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for PostgreSQLLinkedService. +func (psls PostgreSQLLinkedService) MarshalJSON() ([]byte, error) { + psls.Type = TypePostgreSQL + objectMap := make(map[string]interface{}) + if psls.PostgreSQLLinkedServiceTypeProperties != nil { + objectMap["typeProperties"] = psls.PostgreSQLLinkedServiceTypeProperties + } + if psls.ConnectVia != nil { + objectMap["connectVia"] = psls.ConnectVia + } + if psls.Description != nil { + objectMap["description"] = psls.Description + } + if psls.Parameters != nil { + objectMap["parameters"] = psls.Parameters + } + if psls.Annotations != nil { + objectMap["annotations"] = psls.Annotations + } + if psls.Type != "" { + objectMap["type"] = psls.Type + } + for k, v := range psls.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysLinkedService is the BasicLinkedService implementation for PostgreSQLLinkedService. +func (psls PostgreSQLLinkedService) AsResponsysLinkedService() (*ResponsysLinkedService, bool) { + return nil, false +} + +// AsAzureDatabricksLinkedService is the BasicLinkedService implementation for PostgreSQLLinkedService. +func (psls PostgreSQLLinkedService) AsAzureDatabricksLinkedService() (*AzureDatabricksLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeAnalyticsLinkedService is the BasicLinkedService implementation for PostgreSQLLinkedService. +func (psls PostgreSQLLinkedService) AsAzureDataLakeAnalyticsLinkedService() (*AzureDataLakeAnalyticsLinkedService, bool) { + return nil, false +} + +// AsHDInsightOnDemandLinkedService is the BasicLinkedService implementation for PostgreSQLLinkedService. +func (psls PostgreSQLLinkedService) AsHDInsightOnDemandLinkedService() (*HDInsightOnDemandLinkedService, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudLinkedService is the BasicLinkedService implementation for PostgreSQLLinkedService. +func (psls PostgreSQLLinkedService) AsSalesforceMarketingCloudLinkedService() (*SalesforceMarketingCloudLinkedService, bool) { + return nil, false +} + +// AsNetezzaLinkedService is the BasicLinkedService implementation for PostgreSQLLinkedService. +func (psls PostgreSQLLinkedService) AsNetezzaLinkedService() (*NetezzaLinkedService, bool) { + return nil, false +} + +// AsVerticaLinkedService is the BasicLinkedService implementation for PostgreSQLLinkedService. +func (psls PostgreSQLLinkedService) AsVerticaLinkedService() (*VerticaLinkedService, bool) { + return nil, false +} + +// AsZohoLinkedService is the BasicLinkedService implementation for PostgreSQLLinkedService. +func (psls PostgreSQLLinkedService) AsZohoLinkedService() (*ZohoLinkedService, bool) { + return nil, false +} + +// AsXeroLinkedService is the BasicLinkedService implementation for PostgreSQLLinkedService. +func (psls PostgreSQLLinkedService) AsXeroLinkedService() (*XeroLinkedService, bool) { + return nil, false +} + +// AsSquareLinkedService is the BasicLinkedService implementation for PostgreSQLLinkedService. +func (psls PostgreSQLLinkedService) AsSquareLinkedService() (*SquareLinkedService, bool) { + return nil, false +} + +// AsSparkLinkedService is the BasicLinkedService implementation for PostgreSQLLinkedService. +func (psls PostgreSQLLinkedService) AsSparkLinkedService() (*SparkLinkedService, bool) { + return nil, false +} + +// AsShopifyLinkedService is the BasicLinkedService implementation for PostgreSQLLinkedService. +func (psls PostgreSQLLinkedService) AsShopifyLinkedService() (*ShopifyLinkedService, bool) { + return nil, false +} + +// AsServiceNowLinkedService is the BasicLinkedService implementation for PostgreSQLLinkedService. +func (psls PostgreSQLLinkedService) AsServiceNowLinkedService() (*ServiceNowLinkedService, bool) { + return nil, false +} + +// AsQuickBooksLinkedService is the BasicLinkedService implementation for PostgreSQLLinkedService. +func (psls PostgreSQLLinkedService) AsQuickBooksLinkedService() (*QuickBooksLinkedService, bool) { + return nil, false +} + +// AsPrestoLinkedService is the BasicLinkedService implementation for PostgreSQLLinkedService. +func (psls PostgreSQLLinkedService) AsPrestoLinkedService() (*PrestoLinkedService, bool) { + return nil, false +} + +// AsPhoenixLinkedService is the BasicLinkedService implementation for PostgreSQLLinkedService. +func (psls PostgreSQLLinkedService) AsPhoenixLinkedService() (*PhoenixLinkedService, bool) { + return nil, false +} + +// AsPaypalLinkedService is the BasicLinkedService implementation for PostgreSQLLinkedService. +func (psls PostgreSQLLinkedService) AsPaypalLinkedService() (*PaypalLinkedService, bool) { + return nil, false +} + +// AsMarketoLinkedService is the BasicLinkedService implementation for PostgreSQLLinkedService. +func (psls PostgreSQLLinkedService) AsMarketoLinkedService() (*MarketoLinkedService, bool) { + return nil, false +} + +// AsMariaDBLinkedService is the BasicLinkedService implementation for PostgreSQLLinkedService. +func (psls PostgreSQLLinkedService) AsMariaDBLinkedService() (*MariaDBLinkedService, bool) { + return nil, false +} + +// AsMagentoLinkedService is the BasicLinkedService implementation for PostgreSQLLinkedService. +func (psls PostgreSQLLinkedService) AsMagentoLinkedService() (*MagentoLinkedService, bool) { + return nil, false +} + +// AsJiraLinkedService is the BasicLinkedService implementation for PostgreSQLLinkedService. +func (psls PostgreSQLLinkedService) AsJiraLinkedService() (*JiraLinkedService, bool) { + return nil, false +} + +// AsImpalaLinkedService is the BasicLinkedService implementation for PostgreSQLLinkedService. +func (psls PostgreSQLLinkedService) AsImpalaLinkedService() (*ImpalaLinkedService, bool) { + return nil, false +} + +// AsHubspotLinkedService is the BasicLinkedService implementation for PostgreSQLLinkedService. +func (psls PostgreSQLLinkedService) AsHubspotLinkedService() (*HubspotLinkedService, bool) { + return nil, false +} + +// AsHiveLinkedService is the BasicLinkedService implementation for PostgreSQLLinkedService. +func (psls PostgreSQLLinkedService) AsHiveLinkedService() (*HiveLinkedService, bool) { + return nil, false +} + +// AsHBaseLinkedService is the BasicLinkedService implementation for PostgreSQLLinkedService. +func (psls PostgreSQLLinkedService) AsHBaseLinkedService() (*HBaseLinkedService, bool) { + return nil, false +} + +// AsGreenplumLinkedService is the BasicLinkedService implementation for PostgreSQLLinkedService. +func (psls PostgreSQLLinkedService) AsGreenplumLinkedService() (*GreenplumLinkedService, bool) { + return nil, false +} + +// AsGoogleBigQueryLinkedService is the BasicLinkedService implementation for PostgreSQLLinkedService. +func (psls PostgreSQLLinkedService) AsGoogleBigQueryLinkedService() (*GoogleBigQueryLinkedService, bool) { + return nil, false +} + +// AsEloquaLinkedService is the BasicLinkedService implementation for PostgreSQLLinkedService. +func (psls PostgreSQLLinkedService) AsEloquaLinkedService() (*EloquaLinkedService, bool) { + return nil, false +} + +// AsDrillLinkedService is the BasicLinkedService implementation for PostgreSQLLinkedService. +func (psls PostgreSQLLinkedService) AsDrillLinkedService() (*DrillLinkedService, bool) { + return nil, false +} + +// AsCouchbaseLinkedService is the BasicLinkedService implementation for PostgreSQLLinkedService. +func (psls PostgreSQLLinkedService) AsCouchbaseLinkedService() (*CouchbaseLinkedService, bool) { + return nil, false +} + +// AsConcurLinkedService is the BasicLinkedService implementation for PostgreSQLLinkedService. +func (psls PostgreSQLLinkedService) AsConcurLinkedService() (*ConcurLinkedService, bool) { + return nil, false +} + +// AsAzurePostgreSQLLinkedService is the BasicLinkedService implementation for PostgreSQLLinkedService. +func (psls PostgreSQLLinkedService) AsAzurePostgreSQLLinkedService() (*AzurePostgreSQLLinkedService, bool) { + return nil, false +} + +// AsAmazonMWSLinkedService is the BasicLinkedService implementation for PostgreSQLLinkedService. +func (psls PostgreSQLLinkedService) AsAmazonMWSLinkedService() (*AmazonMWSLinkedService, bool) { + return nil, false +} + +// AsSapHanaLinkedService is the BasicLinkedService implementation for PostgreSQLLinkedService. +func (psls PostgreSQLLinkedService) AsSapHanaLinkedService() (*SapHanaLinkedService, bool) { + return nil, false +} + +// AsSapBWLinkedService is the BasicLinkedService implementation for PostgreSQLLinkedService. +func (psls PostgreSQLLinkedService) AsSapBWLinkedService() (*SapBWLinkedService, bool) { + return nil, false +} + +// AsSftpServerLinkedService is the BasicLinkedService implementation for PostgreSQLLinkedService. +func (psls PostgreSQLLinkedService) AsSftpServerLinkedService() (*SftpServerLinkedService, bool) { + return nil, false +} + +// AsFtpServerLinkedService is the BasicLinkedService implementation for PostgreSQLLinkedService. +func (psls PostgreSQLLinkedService) AsFtpServerLinkedService() (*FtpServerLinkedService, bool) { + return nil, false +} + +// AsHTTPLinkedService is the BasicLinkedService implementation for PostgreSQLLinkedService. +func (psls PostgreSQLLinkedService) AsHTTPLinkedService() (*HTTPLinkedService, bool) { + return nil, false +} + +// AsAzureSearchLinkedService is the BasicLinkedService implementation for PostgreSQLLinkedService. +func (psls PostgreSQLLinkedService) AsAzureSearchLinkedService() (*AzureSearchLinkedService, bool) { + return nil, false +} + +// AsCustomDataSourceLinkedService is the BasicLinkedService implementation for PostgreSQLLinkedService. +func (psls PostgreSQLLinkedService) AsCustomDataSourceLinkedService() (*CustomDataSourceLinkedService, bool) { + return nil, false +} + +// AsAmazonRedshiftLinkedService is the BasicLinkedService implementation for PostgreSQLLinkedService. +func (psls PostgreSQLLinkedService) AsAmazonRedshiftLinkedService() (*AmazonRedshiftLinkedService, bool) { + return nil, false +} + +// AsAmazonS3LinkedService is the BasicLinkedService implementation for PostgreSQLLinkedService. +func (psls PostgreSQLLinkedService) AsAmazonS3LinkedService() (*AmazonS3LinkedService, bool) { + return nil, false +} + +// AsSapEccLinkedService is the BasicLinkedService implementation for PostgreSQLLinkedService. +func (psls PostgreSQLLinkedService) AsSapEccLinkedService() (*SapEccLinkedService, bool) { + return nil, false +} + +// AsSapCloudForCustomerLinkedService is the BasicLinkedService implementation for PostgreSQLLinkedService. +func (psls PostgreSQLLinkedService) AsSapCloudForCustomerLinkedService() (*SapCloudForCustomerLinkedService, bool) { + return nil, false +} + +// AsSalesforceLinkedService is the BasicLinkedService implementation for PostgreSQLLinkedService. +func (psls PostgreSQLLinkedService) AsSalesforceLinkedService() (*SalesforceLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeStoreLinkedService is the BasicLinkedService implementation for PostgreSQLLinkedService. +func (psls PostgreSQLLinkedService) AsAzureDataLakeStoreLinkedService() (*AzureDataLakeStoreLinkedService, bool) { + return nil, false +} + +// AsMongoDbLinkedService is the BasicLinkedService implementation for PostgreSQLLinkedService. +func (psls PostgreSQLLinkedService) AsMongoDbLinkedService() (*MongoDbLinkedService, bool) { + return nil, false +} + +// AsCassandraLinkedService is the BasicLinkedService implementation for PostgreSQLLinkedService. +func (psls PostgreSQLLinkedService) AsCassandraLinkedService() (*CassandraLinkedService, bool) { + return nil, false +} + +// AsWebLinkedService is the BasicLinkedService implementation for PostgreSQLLinkedService. +func (psls PostgreSQLLinkedService) AsWebLinkedService() (*WebLinkedService, bool) { + return nil, false +} + +// AsODataLinkedService is the BasicLinkedService implementation for PostgreSQLLinkedService. +func (psls PostgreSQLLinkedService) AsODataLinkedService() (*ODataLinkedService, bool) { + return nil, false +} + +// AsHdfsLinkedService is the BasicLinkedService implementation for PostgreSQLLinkedService. +func (psls PostgreSQLLinkedService) AsHdfsLinkedService() (*HdfsLinkedService, bool) { + return nil, false +} + +// AsOdbcLinkedService is the BasicLinkedService implementation for PostgreSQLLinkedService. +func (psls PostgreSQLLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, bool) { + return nil, false +} + +// AsAzureMLLinkedService is the BasicLinkedService implementation for PostgreSQLLinkedService. +func (psls PostgreSQLLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { + return nil, false +} + +// AsTeradataLinkedService is the BasicLinkedService implementation for PostgreSQLLinkedService. +func (psls PostgreSQLLinkedService) AsTeradataLinkedService() (*TeradataLinkedService, bool) { + return nil, false +} + +// AsDb2LinkedService is the BasicLinkedService implementation for PostgreSQLLinkedService. +func (psls PostgreSQLLinkedService) AsDb2LinkedService() (*Db2LinkedService, bool) { + return nil, false +} + +// AsSybaseLinkedService is the BasicLinkedService implementation for PostgreSQLLinkedService. +func (psls PostgreSQLLinkedService) AsSybaseLinkedService() (*SybaseLinkedService, bool) { + return nil, false +} + +// AsPostgreSQLLinkedService is the BasicLinkedService implementation for PostgreSQLLinkedService. +func (psls PostgreSQLLinkedService) AsPostgreSQLLinkedService() (*PostgreSQLLinkedService, bool) { + return &psls, true +} + +// AsMySQLLinkedService is the BasicLinkedService implementation for PostgreSQLLinkedService. +func (psls PostgreSQLLinkedService) AsMySQLLinkedService() (*MySQLLinkedService, bool) { + return nil, false +} + +// AsAzureMySQLLinkedService is the BasicLinkedService implementation for PostgreSQLLinkedService. +func (psls PostgreSQLLinkedService) AsAzureMySQLLinkedService() (*AzureMySQLLinkedService, bool) { + return nil, false +} + +// AsOracleLinkedService is the BasicLinkedService implementation for PostgreSQLLinkedService. +func (psls PostgreSQLLinkedService) AsOracleLinkedService() (*OracleLinkedService, bool) { + return nil, false +} + +// AsFileServerLinkedService is the BasicLinkedService implementation for PostgreSQLLinkedService. +func (psls PostgreSQLLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { + return nil, false +} + +// AsHDInsightLinkedService is the BasicLinkedService implementation for PostgreSQLLinkedService. +func (psls PostgreSQLLinkedService) AsHDInsightLinkedService() (*HDInsightLinkedService, bool) { + return nil, false +} + +// AsDynamicsLinkedService is the BasicLinkedService implementation for PostgreSQLLinkedService. +func (psls PostgreSQLLinkedService) AsDynamicsLinkedService() (*DynamicsLinkedService, bool) { + return nil, false +} + +// AsCosmosDbLinkedService is the BasicLinkedService implementation for PostgreSQLLinkedService. +func (psls PostgreSQLLinkedService) AsCosmosDbLinkedService() (*CosmosDbLinkedService, bool) { + return nil, false +} + +// AsAzureKeyVaultLinkedService is the BasicLinkedService implementation for PostgreSQLLinkedService. +func (psls PostgreSQLLinkedService) AsAzureKeyVaultLinkedService() (*AzureKeyVaultLinkedService, bool) { + return nil, false +} + +// AsAzureBatchLinkedService is the BasicLinkedService implementation for PostgreSQLLinkedService. +func (psls PostgreSQLLinkedService) AsAzureBatchLinkedService() (*AzureBatchLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDatabaseLinkedService is the BasicLinkedService implementation for PostgreSQLLinkedService. +func (psls PostgreSQLLinkedService) AsAzureSQLDatabaseLinkedService() (*AzureSQLDatabaseLinkedService, bool) { + return nil, false +} + +// AsSQLServerLinkedService is the BasicLinkedService implementation for PostgreSQLLinkedService. +func (psls PostgreSQLLinkedService) AsSQLServerLinkedService() (*SQLServerLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDWLinkedService is the BasicLinkedService implementation for PostgreSQLLinkedService. +func (psls PostgreSQLLinkedService) AsAzureSQLDWLinkedService() (*AzureSQLDWLinkedService, bool) { + return nil, false +} + +// AsAzureStorageLinkedService is the BasicLinkedService implementation for PostgreSQLLinkedService. +func (psls PostgreSQLLinkedService) AsAzureStorageLinkedService() (*AzureStorageLinkedService, bool) { + return nil, false +} + +// AsLinkedService is the BasicLinkedService implementation for PostgreSQLLinkedService. +func (psls PostgreSQLLinkedService) AsLinkedService() (*LinkedService, bool) { + return nil, false +} + +// AsBasicLinkedService is the BasicLinkedService implementation for PostgreSQLLinkedService. +func (psls PostgreSQLLinkedService) AsBasicLinkedService() (BasicLinkedService, bool) { + return &psls, true +} + +// UnmarshalJSON is the custom unmarshaler for PostgreSQLLinkedService struct. +func (psls *PostgreSQLLinkedService) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "typeProperties": + if v != nil { + var postgreSQLLinkedServiceTypeProperties PostgreSQLLinkedServiceTypeProperties + err = json.Unmarshal(*v, &postgreSQLLinkedServiceTypeProperties) + if err != nil { + return err + } + psls.PostgreSQLLinkedServiceTypeProperties = &postgreSQLLinkedServiceTypeProperties + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if psls.AdditionalProperties == nil { + psls.AdditionalProperties = make(map[string]interface{}) + } + psls.AdditionalProperties[k] = additionalProperties + } + case "connectVia": + if v != nil { + var connectVia IntegrationRuntimeReference + err = json.Unmarshal(*v, &connectVia) + if err != nil { + return err + } + psls.ConnectVia = &connectVia + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + psls.Description = &description + } + case "parameters": + if v != nil { + var parameters map[string]*ParameterSpecification + err = json.Unmarshal(*v, ¶meters) + if err != nil { + return err + } + psls.Parameters = parameters + } + case "annotations": + if v != nil { + var annotations []interface{} + err = json.Unmarshal(*v, &annotations) + if err != nil { + return err + } + psls.Annotations = &annotations + } + case "type": + if v != nil { + var typeVar TypeBasicLinkedService + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + psls.Type = typeVar + } + } + } + + return nil +} + +// PostgreSQLLinkedServiceTypeProperties postgreSQL linked service properties. +type PostgreSQLLinkedServiceTypeProperties struct { + // ConnectionString - The connection string. + ConnectionString BasicSecretBase `json:"connectionString,omitempty"` + // EncryptedCredential - The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string). + EncryptedCredential interface{} `json:"encryptedCredential,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for PostgreSQLLinkedServiceTypeProperties struct. +func (pslstp *PostgreSQLLinkedServiceTypeProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "connectionString": + if v != nil { + connectionString, err := unmarshalBasicSecretBase(*v) + if err != nil { + return err + } + pslstp.ConnectionString = connectionString + } + case "encryptedCredential": + if v != nil { + var encryptedCredential interface{} + err = json.Unmarshal(*v, &encryptedCredential) + if err != nil { + return err + } + pslstp.EncryptedCredential = encryptedCredential + } + } + } + + return nil +} + +// PrestoLinkedService presto server linked service. +type PrestoLinkedService struct { + // PrestoLinkedServiceTypeProperties - Presto server linked service properties. + *PrestoLinkedServiceTypeProperties `json:"typeProperties,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // ConnectVia - The integration runtime reference. + ConnectVia *IntegrationRuntimeReference `json:"connectVia,omitempty"` + // Description - Linked service description. + Description *string `json:"description,omitempty"` + // Parameters - Parameters for linked service. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeLinkedService', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforce', 'TypeAzureDataLakeStore', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureStorage' + Type TypeBasicLinkedService `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for PrestoLinkedService. +func (pls PrestoLinkedService) MarshalJSON() ([]byte, error) { + pls.Type = TypePresto + objectMap := make(map[string]interface{}) + if pls.PrestoLinkedServiceTypeProperties != nil { + objectMap["typeProperties"] = pls.PrestoLinkedServiceTypeProperties + } + if pls.ConnectVia != nil { + objectMap["connectVia"] = pls.ConnectVia + } + if pls.Description != nil { + objectMap["description"] = pls.Description + } + if pls.Parameters != nil { + objectMap["parameters"] = pls.Parameters + } + if pls.Annotations != nil { + objectMap["annotations"] = pls.Annotations + } + if pls.Type != "" { + objectMap["type"] = pls.Type + } + for k, v := range pls.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysLinkedService is the BasicLinkedService implementation for PrestoLinkedService. +func (pls PrestoLinkedService) AsResponsysLinkedService() (*ResponsysLinkedService, bool) { + return nil, false +} + +// AsAzureDatabricksLinkedService is the BasicLinkedService implementation for PrestoLinkedService. +func (pls PrestoLinkedService) AsAzureDatabricksLinkedService() (*AzureDatabricksLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeAnalyticsLinkedService is the BasicLinkedService implementation for PrestoLinkedService. +func (pls PrestoLinkedService) AsAzureDataLakeAnalyticsLinkedService() (*AzureDataLakeAnalyticsLinkedService, bool) { + return nil, false +} + +// AsHDInsightOnDemandLinkedService is the BasicLinkedService implementation for PrestoLinkedService. +func (pls PrestoLinkedService) AsHDInsightOnDemandLinkedService() (*HDInsightOnDemandLinkedService, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudLinkedService is the BasicLinkedService implementation for PrestoLinkedService. +func (pls PrestoLinkedService) AsSalesforceMarketingCloudLinkedService() (*SalesforceMarketingCloudLinkedService, bool) { + return nil, false +} + +// AsNetezzaLinkedService is the BasicLinkedService implementation for PrestoLinkedService. +func (pls PrestoLinkedService) AsNetezzaLinkedService() (*NetezzaLinkedService, bool) { + return nil, false +} + +// AsVerticaLinkedService is the BasicLinkedService implementation for PrestoLinkedService. +func (pls PrestoLinkedService) AsVerticaLinkedService() (*VerticaLinkedService, bool) { + return nil, false +} + +// AsZohoLinkedService is the BasicLinkedService implementation for PrestoLinkedService. +func (pls PrestoLinkedService) AsZohoLinkedService() (*ZohoLinkedService, bool) { + return nil, false +} + +// AsXeroLinkedService is the BasicLinkedService implementation for PrestoLinkedService. +func (pls PrestoLinkedService) AsXeroLinkedService() (*XeroLinkedService, bool) { + return nil, false +} + +// AsSquareLinkedService is the BasicLinkedService implementation for PrestoLinkedService. +func (pls PrestoLinkedService) AsSquareLinkedService() (*SquareLinkedService, bool) { + return nil, false +} + +// AsSparkLinkedService is the BasicLinkedService implementation for PrestoLinkedService. +func (pls PrestoLinkedService) AsSparkLinkedService() (*SparkLinkedService, bool) { + return nil, false +} + +// AsShopifyLinkedService is the BasicLinkedService implementation for PrestoLinkedService. +func (pls PrestoLinkedService) AsShopifyLinkedService() (*ShopifyLinkedService, bool) { + return nil, false +} + +// AsServiceNowLinkedService is the BasicLinkedService implementation for PrestoLinkedService. +func (pls PrestoLinkedService) AsServiceNowLinkedService() (*ServiceNowLinkedService, bool) { + return nil, false +} + +// AsQuickBooksLinkedService is the BasicLinkedService implementation for PrestoLinkedService. +func (pls PrestoLinkedService) AsQuickBooksLinkedService() (*QuickBooksLinkedService, bool) { + return nil, false +} + +// AsPrestoLinkedService is the BasicLinkedService implementation for PrestoLinkedService. +func (pls PrestoLinkedService) AsPrestoLinkedService() (*PrestoLinkedService, bool) { + return &pls, true +} + +// AsPhoenixLinkedService is the BasicLinkedService implementation for PrestoLinkedService. +func (pls PrestoLinkedService) AsPhoenixLinkedService() (*PhoenixLinkedService, bool) { + return nil, false +} + +// AsPaypalLinkedService is the BasicLinkedService implementation for PrestoLinkedService. +func (pls PrestoLinkedService) AsPaypalLinkedService() (*PaypalLinkedService, bool) { + return nil, false +} + +// AsMarketoLinkedService is the BasicLinkedService implementation for PrestoLinkedService. +func (pls PrestoLinkedService) AsMarketoLinkedService() (*MarketoLinkedService, bool) { + return nil, false +} + +// AsMariaDBLinkedService is the BasicLinkedService implementation for PrestoLinkedService. +func (pls PrestoLinkedService) AsMariaDBLinkedService() (*MariaDBLinkedService, bool) { + return nil, false +} + +// AsMagentoLinkedService is the BasicLinkedService implementation for PrestoLinkedService. +func (pls PrestoLinkedService) AsMagentoLinkedService() (*MagentoLinkedService, bool) { + return nil, false +} + +// AsJiraLinkedService is the BasicLinkedService implementation for PrestoLinkedService. +func (pls PrestoLinkedService) AsJiraLinkedService() (*JiraLinkedService, bool) { + return nil, false +} + +// AsImpalaLinkedService is the BasicLinkedService implementation for PrestoLinkedService. +func (pls PrestoLinkedService) AsImpalaLinkedService() (*ImpalaLinkedService, bool) { + return nil, false +} + +// AsHubspotLinkedService is the BasicLinkedService implementation for PrestoLinkedService. +func (pls PrestoLinkedService) AsHubspotLinkedService() (*HubspotLinkedService, bool) { + return nil, false +} + +// AsHiveLinkedService is the BasicLinkedService implementation for PrestoLinkedService. +func (pls PrestoLinkedService) AsHiveLinkedService() (*HiveLinkedService, bool) { + return nil, false +} + +// AsHBaseLinkedService is the BasicLinkedService implementation for PrestoLinkedService. +func (pls PrestoLinkedService) AsHBaseLinkedService() (*HBaseLinkedService, bool) { + return nil, false +} + +// AsGreenplumLinkedService is the BasicLinkedService implementation for PrestoLinkedService. +func (pls PrestoLinkedService) AsGreenplumLinkedService() (*GreenplumLinkedService, bool) { + return nil, false +} + +// AsGoogleBigQueryLinkedService is the BasicLinkedService implementation for PrestoLinkedService. +func (pls PrestoLinkedService) AsGoogleBigQueryLinkedService() (*GoogleBigQueryLinkedService, bool) { + return nil, false +} + +// AsEloquaLinkedService is the BasicLinkedService implementation for PrestoLinkedService. +func (pls PrestoLinkedService) AsEloquaLinkedService() (*EloquaLinkedService, bool) { + return nil, false +} + +// AsDrillLinkedService is the BasicLinkedService implementation for PrestoLinkedService. +func (pls PrestoLinkedService) AsDrillLinkedService() (*DrillLinkedService, bool) { + return nil, false +} + +// AsCouchbaseLinkedService is the BasicLinkedService implementation for PrestoLinkedService. +func (pls PrestoLinkedService) AsCouchbaseLinkedService() (*CouchbaseLinkedService, bool) { + return nil, false +} + +// AsConcurLinkedService is the BasicLinkedService implementation for PrestoLinkedService. +func (pls PrestoLinkedService) AsConcurLinkedService() (*ConcurLinkedService, bool) { + return nil, false +} + +// AsAzurePostgreSQLLinkedService is the BasicLinkedService implementation for PrestoLinkedService. +func (pls PrestoLinkedService) AsAzurePostgreSQLLinkedService() (*AzurePostgreSQLLinkedService, bool) { + return nil, false +} + +// AsAmazonMWSLinkedService is the BasicLinkedService implementation for PrestoLinkedService. +func (pls PrestoLinkedService) AsAmazonMWSLinkedService() (*AmazonMWSLinkedService, bool) { + return nil, false +} + +// AsSapHanaLinkedService is the BasicLinkedService implementation for PrestoLinkedService. +func (pls PrestoLinkedService) AsSapHanaLinkedService() (*SapHanaLinkedService, bool) { + return nil, false +} + +// AsSapBWLinkedService is the BasicLinkedService implementation for PrestoLinkedService. +func (pls PrestoLinkedService) AsSapBWLinkedService() (*SapBWLinkedService, bool) { + return nil, false +} + +// AsSftpServerLinkedService is the BasicLinkedService implementation for PrestoLinkedService. +func (pls PrestoLinkedService) AsSftpServerLinkedService() (*SftpServerLinkedService, bool) { + return nil, false +} + +// AsFtpServerLinkedService is the BasicLinkedService implementation for PrestoLinkedService. +func (pls PrestoLinkedService) AsFtpServerLinkedService() (*FtpServerLinkedService, bool) { + return nil, false +} + +// AsHTTPLinkedService is the BasicLinkedService implementation for PrestoLinkedService. +func (pls PrestoLinkedService) AsHTTPLinkedService() (*HTTPLinkedService, bool) { + return nil, false +} + +// AsAzureSearchLinkedService is the BasicLinkedService implementation for PrestoLinkedService. +func (pls PrestoLinkedService) AsAzureSearchLinkedService() (*AzureSearchLinkedService, bool) { + return nil, false +} + +// AsCustomDataSourceLinkedService is the BasicLinkedService implementation for PrestoLinkedService. +func (pls PrestoLinkedService) AsCustomDataSourceLinkedService() (*CustomDataSourceLinkedService, bool) { + return nil, false +} + +// AsAmazonRedshiftLinkedService is the BasicLinkedService implementation for PrestoLinkedService. +func (pls PrestoLinkedService) AsAmazonRedshiftLinkedService() (*AmazonRedshiftLinkedService, bool) { + return nil, false +} + +// AsAmazonS3LinkedService is the BasicLinkedService implementation for PrestoLinkedService. +func (pls PrestoLinkedService) AsAmazonS3LinkedService() (*AmazonS3LinkedService, bool) { + return nil, false +} + +// AsSapEccLinkedService is the BasicLinkedService implementation for PrestoLinkedService. +func (pls PrestoLinkedService) AsSapEccLinkedService() (*SapEccLinkedService, bool) { + return nil, false +} + +// AsSapCloudForCustomerLinkedService is the BasicLinkedService implementation for PrestoLinkedService. +func (pls PrestoLinkedService) AsSapCloudForCustomerLinkedService() (*SapCloudForCustomerLinkedService, bool) { + return nil, false +} + +// AsSalesforceLinkedService is the BasicLinkedService implementation for PrestoLinkedService. +func (pls PrestoLinkedService) AsSalesforceLinkedService() (*SalesforceLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeStoreLinkedService is the BasicLinkedService implementation for PrestoLinkedService. +func (pls PrestoLinkedService) AsAzureDataLakeStoreLinkedService() (*AzureDataLakeStoreLinkedService, bool) { + return nil, false +} + +// AsMongoDbLinkedService is the BasicLinkedService implementation for PrestoLinkedService. +func (pls PrestoLinkedService) AsMongoDbLinkedService() (*MongoDbLinkedService, bool) { + return nil, false +} + +// AsCassandraLinkedService is the BasicLinkedService implementation for PrestoLinkedService. +func (pls PrestoLinkedService) AsCassandraLinkedService() (*CassandraLinkedService, bool) { + return nil, false +} + +// AsWebLinkedService is the BasicLinkedService implementation for PrestoLinkedService. +func (pls PrestoLinkedService) AsWebLinkedService() (*WebLinkedService, bool) { + return nil, false +} + +// AsODataLinkedService is the BasicLinkedService implementation for PrestoLinkedService. +func (pls PrestoLinkedService) AsODataLinkedService() (*ODataLinkedService, bool) { + return nil, false +} + +// AsHdfsLinkedService is the BasicLinkedService implementation for PrestoLinkedService. +func (pls PrestoLinkedService) AsHdfsLinkedService() (*HdfsLinkedService, bool) { + return nil, false +} + +// AsOdbcLinkedService is the BasicLinkedService implementation for PrestoLinkedService. +func (pls PrestoLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, bool) { + return nil, false +} + +// AsAzureMLLinkedService is the BasicLinkedService implementation for PrestoLinkedService. +func (pls PrestoLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { + return nil, false +} + +// AsTeradataLinkedService is the BasicLinkedService implementation for PrestoLinkedService. +func (pls PrestoLinkedService) AsTeradataLinkedService() (*TeradataLinkedService, bool) { + return nil, false +} + +// AsDb2LinkedService is the BasicLinkedService implementation for PrestoLinkedService. +func (pls PrestoLinkedService) AsDb2LinkedService() (*Db2LinkedService, bool) { + return nil, false +} + +// AsSybaseLinkedService is the BasicLinkedService implementation for PrestoLinkedService. +func (pls PrestoLinkedService) AsSybaseLinkedService() (*SybaseLinkedService, bool) { + return nil, false +} + +// AsPostgreSQLLinkedService is the BasicLinkedService implementation for PrestoLinkedService. +func (pls PrestoLinkedService) AsPostgreSQLLinkedService() (*PostgreSQLLinkedService, bool) { + return nil, false +} + +// AsMySQLLinkedService is the BasicLinkedService implementation for PrestoLinkedService. +func (pls PrestoLinkedService) AsMySQLLinkedService() (*MySQLLinkedService, bool) { + return nil, false +} + +// AsAzureMySQLLinkedService is the BasicLinkedService implementation for PrestoLinkedService. +func (pls PrestoLinkedService) AsAzureMySQLLinkedService() (*AzureMySQLLinkedService, bool) { + return nil, false +} + +// AsOracleLinkedService is the BasicLinkedService implementation for PrestoLinkedService. +func (pls PrestoLinkedService) AsOracleLinkedService() (*OracleLinkedService, bool) { + return nil, false +} + +// AsFileServerLinkedService is the BasicLinkedService implementation for PrestoLinkedService. +func (pls PrestoLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { + return nil, false +} + +// AsHDInsightLinkedService is the BasicLinkedService implementation for PrestoLinkedService. +func (pls PrestoLinkedService) AsHDInsightLinkedService() (*HDInsightLinkedService, bool) { + return nil, false +} + +// AsDynamicsLinkedService is the BasicLinkedService implementation for PrestoLinkedService. +func (pls PrestoLinkedService) AsDynamicsLinkedService() (*DynamicsLinkedService, bool) { + return nil, false +} + +// AsCosmosDbLinkedService is the BasicLinkedService implementation for PrestoLinkedService. +func (pls PrestoLinkedService) AsCosmosDbLinkedService() (*CosmosDbLinkedService, bool) { + return nil, false +} + +// AsAzureKeyVaultLinkedService is the BasicLinkedService implementation for PrestoLinkedService. +func (pls PrestoLinkedService) AsAzureKeyVaultLinkedService() (*AzureKeyVaultLinkedService, bool) { + return nil, false +} + +// AsAzureBatchLinkedService is the BasicLinkedService implementation for PrestoLinkedService. +func (pls PrestoLinkedService) AsAzureBatchLinkedService() (*AzureBatchLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDatabaseLinkedService is the BasicLinkedService implementation for PrestoLinkedService. +func (pls PrestoLinkedService) AsAzureSQLDatabaseLinkedService() (*AzureSQLDatabaseLinkedService, bool) { + return nil, false +} + +// AsSQLServerLinkedService is the BasicLinkedService implementation for PrestoLinkedService. +func (pls PrestoLinkedService) AsSQLServerLinkedService() (*SQLServerLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDWLinkedService is the BasicLinkedService implementation for PrestoLinkedService. +func (pls PrestoLinkedService) AsAzureSQLDWLinkedService() (*AzureSQLDWLinkedService, bool) { + return nil, false +} + +// AsAzureStorageLinkedService is the BasicLinkedService implementation for PrestoLinkedService. +func (pls PrestoLinkedService) AsAzureStorageLinkedService() (*AzureStorageLinkedService, bool) { + return nil, false +} + +// AsLinkedService is the BasicLinkedService implementation for PrestoLinkedService. +func (pls PrestoLinkedService) AsLinkedService() (*LinkedService, bool) { + return nil, false +} + +// AsBasicLinkedService is the BasicLinkedService implementation for PrestoLinkedService. +func (pls PrestoLinkedService) AsBasicLinkedService() (BasicLinkedService, bool) { + return &pls, true +} + +// UnmarshalJSON is the custom unmarshaler for PrestoLinkedService struct. +func (pls *PrestoLinkedService) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "typeProperties": + if v != nil { + var prestoLinkedServiceTypeProperties PrestoLinkedServiceTypeProperties + err = json.Unmarshal(*v, &prestoLinkedServiceTypeProperties) + if err != nil { + return err + } + pls.PrestoLinkedServiceTypeProperties = &prestoLinkedServiceTypeProperties + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if pls.AdditionalProperties == nil { + pls.AdditionalProperties = make(map[string]interface{}) + } + pls.AdditionalProperties[k] = additionalProperties + } + case "connectVia": + if v != nil { + var connectVia IntegrationRuntimeReference + err = json.Unmarshal(*v, &connectVia) + if err != nil { + return err + } + pls.ConnectVia = &connectVia + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + pls.Description = &description + } + case "parameters": + if v != nil { + var parameters map[string]*ParameterSpecification + err = json.Unmarshal(*v, ¶meters) + if err != nil { + return err + } + pls.Parameters = parameters + } + case "annotations": + if v != nil { + var annotations []interface{} + err = json.Unmarshal(*v, &annotations) + if err != nil { + return err + } + pls.Annotations = &annotations + } + case "type": + if v != nil { + var typeVar TypeBasicLinkedService + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + pls.Type = typeVar + } + } + } + + return nil +} + +// PrestoLinkedServiceTypeProperties presto server linked service properties. +type PrestoLinkedServiceTypeProperties struct { + // Host - The IP address or host name of the Presto server. (i.e. 192.168.222.160) + Host interface{} `json:"host,omitempty"` + // ServerVersion - The version of the Presto server. (i.e. 0.148-t) + ServerVersion interface{} `json:"serverVersion,omitempty"` + // Catalog - The catalog context for all request against the server. + Catalog interface{} `json:"catalog,omitempty"` + // Port - The TCP port that the Presto server uses to listen for client connections. The default value is 8080. + Port interface{} `json:"port,omitempty"` + // AuthenticationType - The authentication mechanism used to connect to the Presto server. Possible values include: 'PrestoAuthenticationTypeAnonymous', 'PrestoAuthenticationTypeLDAP' + AuthenticationType PrestoAuthenticationType `json:"authenticationType,omitempty"` + // Username - The user name used to connect to the Presto server. + Username interface{} `json:"username,omitempty"` + // Password - The password corresponding to the user name. + Password BasicSecretBase `json:"password,omitempty"` + // EnableSsl - Specifies whether the connections to the server are encrypted using SSL. The default value is false. + EnableSsl interface{} `json:"enableSsl,omitempty"` + // TrustedCertPath - The full path of the .pem file containing trusted CA certificates for verifying the server when connecting over SSL. This property can only be set when using SSL on self-hosted IR. The default value is the cacerts.pem file installed with the IR. + TrustedCertPath interface{} `json:"trustedCertPath,omitempty"` + // UseSystemTrustStore - Specifies whether to use a CA certificate from the system trust store or from a specified PEM file. The default value is false. + UseSystemTrustStore interface{} `json:"useSystemTrustStore,omitempty"` + // AllowHostNameCNMismatch - Specifies whether to require a CA-issued SSL certificate name to match the host name of the server when connecting over SSL. The default value is false. + AllowHostNameCNMismatch interface{} `json:"allowHostNameCNMismatch,omitempty"` + // AllowSelfSignedServerCert - Specifies whether to allow self-signed certificates from the server. The default value is false. + AllowSelfSignedServerCert interface{} `json:"allowSelfSignedServerCert,omitempty"` + // TimeZoneID - The local time zone used by the connection. Valid values for this option are specified in the IANA Time Zone Database. The default value is the system time zone. + TimeZoneID interface{} `json:"timeZoneID,omitempty"` + // EncryptedCredential - The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string). + EncryptedCredential interface{} `json:"encryptedCredential,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for PrestoLinkedServiceTypeProperties struct. +func (plstp *PrestoLinkedServiceTypeProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "host": + if v != nil { + var host interface{} + err = json.Unmarshal(*v, &host) + if err != nil { + return err + } + plstp.Host = host + } + case "serverVersion": + if v != nil { + var serverVersion interface{} + err = json.Unmarshal(*v, &serverVersion) + if err != nil { + return err + } + plstp.ServerVersion = serverVersion + } + case "catalog": + if v != nil { + var catalog interface{} + err = json.Unmarshal(*v, &catalog) + if err != nil { + return err + } + plstp.Catalog = catalog + } + case "port": + if v != nil { + var port interface{} + err = json.Unmarshal(*v, &port) + if err != nil { + return err + } + plstp.Port = port + } + case "authenticationType": + if v != nil { + var authenticationType PrestoAuthenticationType + err = json.Unmarshal(*v, &authenticationType) + if err != nil { + return err + } + plstp.AuthenticationType = authenticationType + } + case "username": + if v != nil { + var username interface{} + err = json.Unmarshal(*v, &username) + if err != nil { + return err + } + plstp.Username = username + } + case "password": + if v != nil { + password, err := unmarshalBasicSecretBase(*v) + if err != nil { + return err + } + plstp.Password = password + } + case "enableSsl": + if v != nil { + var enableSsl interface{} + err = json.Unmarshal(*v, &enableSsl) + if err != nil { + return err + } + plstp.EnableSsl = enableSsl + } + case "trustedCertPath": + if v != nil { + var trustedCertPath interface{} + err = json.Unmarshal(*v, &trustedCertPath) + if err != nil { + return err + } + plstp.TrustedCertPath = trustedCertPath + } + case "useSystemTrustStore": + if v != nil { + var useSystemTrustStore interface{} + err = json.Unmarshal(*v, &useSystemTrustStore) + if err != nil { + return err + } + plstp.UseSystemTrustStore = useSystemTrustStore + } + case "allowHostNameCNMismatch": + if v != nil { + var allowHostNameCNMismatch interface{} + err = json.Unmarshal(*v, &allowHostNameCNMismatch) + if err != nil { + return err + } + plstp.AllowHostNameCNMismatch = allowHostNameCNMismatch + } + case "allowSelfSignedServerCert": + if v != nil { + var allowSelfSignedServerCert interface{} + err = json.Unmarshal(*v, &allowSelfSignedServerCert) + if err != nil { + return err + } + plstp.AllowSelfSignedServerCert = allowSelfSignedServerCert + } + case "timeZoneID": + if v != nil { + var timeZoneID interface{} + err = json.Unmarshal(*v, &timeZoneID) + if err != nil { + return err + } + plstp.TimeZoneID = timeZoneID + } + case "encryptedCredential": + if v != nil { + var encryptedCredential interface{} + err = json.Unmarshal(*v, &encryptedCredential) + if err != nil { + return err + } + plstp.EncryptedCredential = encryptedCredential + } + } + } + + return nil +} + +// PrestoObjectDataset presto server dataset. +type PrestoObjectDataset struct { + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Description - Dataset description. + Description *string `json:"description,omitempty"` + // Structure - Columns that define the structure of the dataset. Type: array (or Expression with resultType array), itemType: DatasetDataElement. + Structure interface{} `json:"structure,omitempty"` + // LinkedServiceName - Linked service reference. + LinkedServiceName *LinkedServiceReference `json:"linkedServiceName,omitempty"` + // Parameters - Parameters for dataset. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeDataset', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSQLServerTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSalesforceObject', 'TypeRelationalTable', 'TypeAzureMySQLTable', 'TypeOracleTable', 'TypeODataResource', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeAzureDataLakeStoreFile', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeAmazonS3Object' + Type TypeBasicDataset `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for PrestoObjectDataset. +func (pod PrestoObjectDataset) MarshalJSON() ([]byte, error) { + pod.Type = TypePrestoObject + objectMap := make(map[string]interface{}) + if pod.Description != nil { + objectMap["description"] = pod.Description + } + objectMap["structure"] = pod.Structure + if pod.LinkedServiceName != nil { + objectMap["linkedServiceName"] = pod.LinkedServiceName + } + if pod.Parameters != nil { + objectMap["parameters"] = pod.Parameters + } + if pod.Annotations != nil { + objectMap["annotations"] = pod.Annotations + } + if pod.Type != "" { + objectMap["type"] = pod.Type + } + for k, v := range pod.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysObjectDataset is the BasicDataset implementation for PrestoObjectDataset. +func (pod PrestoObjectDataset) AsResponsysObjectDataset() (*ResponsysObjectDataset, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudObjectDataset is the BasicDataset implementation for PrestoObjectDataset. +func (pod PrestoObjectDataset) AsSalesforceMarketingCloudObjectDataset() (*SalesforceMarketingCloudObjectDataset, bool) { + return nil, false +} + +// AsVerticaTableDataset is the BasicDataset implementation for PrestoObjectDataset. +func (pod PrestoObjectDataset) AsVerticaTableDataset() (*VerticaTableDataset, bool) { + return nil, false +} + +// AsNetezzaTableDataset is the BasicDataset implementation for PrestoObjectDataset. +func (pod PrestoObjectDataset) AsNetezzaTableDataset() (*NetezzaTableDataset, bool) { + return nil, false +} + +// AsZohoObjectDataset is the BasicDataset implementation for PrestoObjectDataset. +func (pod PrestoObjectDataset) AsZohoObjectDataset() (*ZohoObjectDataset, bool) { + return nil, false +} + +// AsXeroObjectDataset is the BasicDataset implementation for PrestoObjectDataset. +func (pod PrestoObjectDataset) AsXeroObjectDataset() (*XeroObjectDataset, bool) { + return nil, false +} + +// AsSquareObjectDataset is the BasicDataset implementation for PrestoObjectDataset. +func (pod PrestoObjectDataset) AsSquareObjectDataset() (*SquareObjectDataset, bool) { + return nil, false +} + +// AsSparkObjectDataset is the BasicDataset implementation for PrestoObjectDataset. +func (pod PrestoObjectDataset) AsSparkObjectDataset() (*SparkObjectDataset, bool) { + return nil, false +} + +// AsShopifyObjectDataset is the BasicDataset implementation for PrestoObjectDataset. +func (pod PrestoObjectDataset) AsShopifyObjectDataset() (*ShopifyObjectDataset, bool) { + return nil, false +} + +// AsServiceNowObjectDataset is the BasicDataset implementation for PrestoObjectDataset. +func (pod PrestoObjectDataset) AsServiceNowObjectDataset() (*ServiceNowObjectDataset, bool) { + return nil, false +} + +// AsQuickBooksObjectDataset is the BasicDataset implementation for PrestoObjectDataset. +func (pod PrestoObjectDataset) AsQuickBooksObjectDataset() (*QuickBooksObjectDataset, bool) { + return nil, false +} + +// AsPrestoObjectDataset is the BasicDataset implementation for PrestoObjectDataset. +func (pod PrestoObjectDataset) AsPrestoObjectDataset() (*PrestoObjectDataset, bool) { + return &pod, true +} + +// AsPhoenixObjectDataset is the BasicDataset implementation for PrestoObjectDataset. +func (pod PrestoObjectDataset) AsPhoenixObjectDataset() (*PhoenixObjectDataset, bool) { + return nil, false +} + +// AsPaypalObjectDataset is the BasicDataset implementation for PrestoObjectDataset. +func (pod PrestoObjectDataset) AsPaypalObjectDataset() (*PaypalObjectDataset, bool) { + return nil, false +} + +// AsMarketoObjectDataset is the BasicDataset implementation for PrestoObjectDataset. +func (pod PrestoObjectDataset) AsMarketoObjectDataset() (*MarketoObjectDataset, bool) { + return nil, false +} + +// AsMariaDBTableDataset is the BasicDataset implementation for PrestoObjectDataset. +func (pod PrestoObjectDataset) AsMariaDBTableDataset() (*MariaDBTableDataset, bool) { + return nil, false +} + +// AsMagentoObjectDataset is the BasicDataset implementation for PrestoObjectDataset. +func (pod PrestoObjectDataset) AsMagentoObjectDataset() (*MagentoObjectDataset, bool) { + return nil, false +} + +// AsJiraObjectDataset is the BasicDataset implementation for PrestoObjectDataset. +func (pod PrestoObjectDataset) AsJiraObjectDataset() (*JiraObjectDataset, bool) { + return nil, false +} + +// AsImpalaObjectDataset is the BasicDataset implementation for PrestoObjectDataset. +func (pod PrestoObjectDataset) AsImpalaObjectDataset() (*ImpalaObjectDataset, bool) { + return nil, false +} + +// AsHubspotObjectDataset is the BasicDataset implementation for PrestoObjectDataset. +func (pod PrestoObjectDataset) AsHubspotObjectDataset() (*HubspotObjectDataset, bool) { + return nil, false +} + +// AsHiveObjectDataset is the BasicDataset implementation for PrestoObjectDataset. +func (pod PrestoObjectDataset) AsHiveObjectDataset() (*HiveObjectDataset, bool) { + return nil, false +} + +// AsHBaseObjectDataset is the BasicDataset implementation for PrestoObjectDataset. +func (pod PrestoObjectDataset) AsHBaseObjectDataset() (*HBaseObjectDataset, bool) { + return nil, false +} + +// AsGreenplumTableDataset is the BasicDataset implementation for PrestoObjectDataset. +func (pod PrestoObjectDataset) AsGreenplumTableDataset() (*GreenplumTableDataset, bool) { + return nil, false +} + +// AsGoogleBigQueryObjectDataset is the BasicDataset implementation for PrestoObjectDataset. +func (pod PrestoObjectDataset) AsGoogleBigQueryObjectDataset() (*GoogleBigQueryObjectDataset, bool) { + return nil, false +} + +// AsEloquaObjectDataset is the BasicDataset implementation for PrestoObjectDataset. +func (pod PrestoObjectDataset) AsEloquaObjectDataset() (*EloquaObjectDataset, bool) { + return nil, false +} + +// AsDrillTableDataset is the BasicDataset implementation for PrestoObjectDataset. +func (pod PrestoObjectDataset) AsDrillTableDataset() (*DrillTableDataset, bool) { + return nil, false +} + +// AsCouchbaseTableDataset is the BasicDataset implementation for PrestoObjectDataset. +func (pod PrestoObjectDataset) AsCouchbaseTableDataset() (*CouchbaseTableDataset, bool) { + return nil, false +} + +// AsConcurObjectDataset is the BasicDataset implementation for PrestoObjectDataset. +func (pod PrestoObjectDataset) AsConcurObjectDataset() (*ConcurObjectDataset, bool) { + return nil, false +} + +// AsAzurePostgreSQLTableDataset is the BasicDataset implementation for PrestoObjectDataset. +func (pod PrestoObjectDataset) AsAzurePostgreSQLTableDataset() (*AzurePostgreSQLTableDataset, bool) { + return nil, false +} + +// AsAmazonMWSObjectDataset is the BasicDataset implementation for PrestoObjectDataset. +func (pod PrestoObjectDataset) AsAmazonMWSObjectDataset() (*AmazonMWSObjectDataset, bool) { + return nil, false +} + +// AsHTTPDataset is the BasicDataset implementation for PrestoObjectDataset. +func (pod PrestoObjectDataset) AsHTTPDataset() (*HTTPDataset, bool) { + return nil, false +} + +// AsAzureSearchIndexDataset is the BasicDataset implementation for PrestoObjectDataset. +func (pod PrestoObjectDataset) AsAzureSearchIndexDataset() (*AzureSearchIndexDataset, bool) { + return nil, false +} + +// AsWebTableDataset is the BasicDataset implementation for PrestoObjectDataset. +func (pod PrestoObjectDataset) AsWebTableDataset() (*WebTableDataset, bool) { + return nil, false +} + +// AsSQLServerTableDataset is the BasicDataset implementation for PrestoObjectDataset. +func (pod PrestoObjectDataset) AsSQLServerTableDataset() (*SQLServerTableDataset, bool) { + return nil, false +} + +// AsSapEccResourceDataset is the BasicDataset implementation for PrestoObjectDataset. +func (pod PrestoObjectDataset) AsSapEccResourceDataset() (*SapEccResourceDataset, bool) { + return nil, false +} + +// AsSapCloudForCustomerResourceDataset is the BasicDataset implementation for PrestoObjectDataset. +func (pod PrestoObjectDataset) AsSapCloudForCustomerResourceDataset() (*SapCloudForCustomerResourceDataset, bool) { + return nil, false +} + +// AsSalesforceObjectDataset is the BasicDataset implementation for PrestoObjectDataset. +func (pod PrestoObjectDataset) AsSalesforceObjectDataset() (*SalesforceObjectDataset, bool) { + return nil, false +} + +// AsRelationalTableDataset is the BasicDataset implementation for PrestoObjectDataset. +func (pod PrestoObjectDataset) AsRelationalTableDataset() (*RelationalTableDataset, bool) { + return nil, false +} + +// AsAzureMySQLTableDataset is the BasicDataset implementation for PrestoObjectDataset. +func (pod PrestoObjectDataset) AsAzureMySQLTableDataset() (*AzureMySQLTableDataset, bool) { + return nil, false +} + +// AsOracleTableDataset is the BasicDataset implementation for PrestoObjectDataset. +func (pod PrestoObjectDataset) AsOracleTableDataset() (*OracleTableDataset, bool) { + return nil, false +} + +// AsODataResourceDataset is the BasicDataset implementation for PrestoObjectDataset. +func (pod PrestoObjectDataset) AsODataResourceDataset() (*ODataResourceDataset, bool) { + return nil, false +} + +// AsMongoDbCollectionDataset is the BasicDataset implementation for PrestoObjectDataset. +func (pod PrestoObjectDataset) AsMongoDbCollectionDataset() (*MongoDbCollectionDataset, bool) { + return nil, false +} + +// AsFileShareDataset is the BasicDataset implementation for PrestoObjectDataset. +func (pod PrestoObjectDataset) AsFileShareDataset() (*FileShareDataset, bool) { + return nil, false +} + +// AsAzureDataLakeStoreDataset is the BasicDataset implementation for PrestoObjectDataset. +func (pod PrestoObjectDataset) AsAzureDataLakeStoreDataset() (*AzureDataLakeStoreDataset, bool) { + return nil, false +} + +// AsDynamicsEntityDataset is the BasicDataset implementation for PrestoObjectDataset. +func (pod PrestoObjectDataset) AsDynamicsEntityDataset() (*DynamicsEntityDataset, bool) { + return nil, false +} + +// AsDocumentDbCollectionDataset is the BasicDataset implementation for PrestoObjectDataset. +func (pod PrestoObjectDataset) AsDocumentDbCollectionDataset() (*DocumentDbCollectionDataset, bool) { + return nil, false +} + +// AsCustomDataset is the BasicDataset implementation for PrestoObjectDataset. +func (pod PrestoObjectDataset) AsCustomDataset() (*CustomDataset, bool) { + return nil, false +} + +// AsCassandraTableDataset is the BasicDataset implementation for PrestoObjectDataset. +func (pod PrestoObjectDataset) AsCassandraTableDataset() (*CassandraTableDataset, bool) { + return nil, false +} + +// AsAzureSQLDWTableDataset is the BasicDataset implementation for PrestoObjectDataset. +func (pod PrestoObjectDataset) AsAzureSQLDWTableDataset() (*AzureSQLDWTableDataset, bool) { + return nil, false +} + +// AsAzureSQLTableDataset is the BasicDataset implementation for PrestoObjectDataset. +func (pod PrestoObjectDataset) AsAzureSQLTableDataset() (*AzureSQLTableDataset, bool) { + return nil, false +} + +// AsAzureTableDataset is the BasicDataset implementation for PrestoObjectDataset. +func (pod PrestoObjectDataset) AsAzureTableDataset() (*AzureTableDataset, bool) { + return nil, false +} + +// AsAzureBlobDataset is the BasicDataset implementation for PrestoObjectDataset. +func (pod PrestoObjectDataset) AsAzureBlobDataset() (*AzureBlobDataset, bool) { + return nil, false +} + +// AsAmazonS3Dataset is the BasicDataset implementation for PrestoObjectDataset. +func (pod PrestoObjectDataset) AsAmazonS3Dataset() (*AmazonS3Dataset, bool) { + return nil, false +} + +// AsDataset is the BasicDataset implementation for PrestoObjectDataset. +func (pod PrestoObjectDataset) AsDataset() (*Dataset, bool) { + return nil, false +} + +// AsBasicDataset is the BasicDataset implementation for PrestoObjectDataset. +func (pod PrestoObjectDataset) AsBasicDataset() (BasicDataset, bool) { + return &pod, true +} + +// PrestoSource a copy activity Presto server source. +type PrestoSource struct { + // Query - A query to retrieve data from source. Type: string (or Expression with resultType string). + Query interface{} `json:"query,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // SourceRetryCount - Source retry count. Type: integer (or Expression with resultType integer). + SourceRetryCount interface{} `json:"sourceRetryCount,omitempty"` + // SourceRetryWait - Source retry wait. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` + // Type - Possible values include: 'TypeCopySource', 'TypeAmazonRedshiftSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeHTTPSource', 'TypeAzureDataLakeStoreSource', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeRelationalSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource' + Type TypeBasicCopySource `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for PrestoSource. +func (ps PrestoSource) MarshalJSON() ([]byte, error) { + ps.Type = TypePrestoSource + objectMap := make(map[string]interface{}) + objectMap["query"] = ps.Query + objectMap["sourceRetryCount"] = ps.SourceRetryCount + objectMap["sourceRetryWait"] = ps.SourceRetryWait + if ps.Type != "" { + objectMap["type"] = ps.Type + } + for k, v := range ps.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsAmazonRedshiftSource is the BasicCopySource implementation for PrestoSource. +func (ps PrestoSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { + return nil, false +} + +// AsResponsysSource is the BasicCopySource implementation for PrestoSource. +func (ps PrestoSource) AsResponsysSource() (*ResponsysSource, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudSource is the BasicCopySource implementation for PrestoSource. +func (ps PrestoSource) AsSalesforceMarketingCloudSource() (*SalesforceMarketingCloudSource, bool) { + return nil, false +} + +// AsVerticaSource is the BasicCopySource implementation for PrestoSource. +func (ps PrestoSource) AsVerticaSource() (*VerticaSource, bool) { + return nil, false +} + +// AsNetezzaSource is the BasicCopySource implementation for PrestoSource. +func (ps PrestoSource) AsNetezzaSource() (*NetezzaSource, bool) { + return nil, false +} + +// AsZohoSource is the BasicCopySource implementation for PrestoSource. +func (ps PrestoSource) AsZohoSource() (*ZohoSource, bool) { + return nil, false +} + +// AsXeroSource is the BasicCopySource implementation for PrestoSource. +func (ps PrestoSource) AsXeroSource() (*XeroSource, bool) { + return nil, false +} + +// AsSquareSource is the BasicCopySource implementation for PrestoSource. +func (ps PrestoSource) AsSquareSource() (*SquareSource, bool) { + return nil, false +} + +// AsSparkSource is the BasicCopySource implementation for PrestoSource. +func (ps PrestoSource) AsSparkSource() (*SparkSource, bool) { + return nil, false +} + +// AsShopifySource is the BasicCopySource implementation for PrestoSource. +func (ps PrestoSource) AsShopifySource() (*ShopifySource, bool) { + return nil, false +} + +// AsServiceNowSource is the BasicCopySource implementation for PrestoSource. +func (ps PrestoSource) AsServiceNowSource() (*ServiceNowSource, bool) { + return nil, false +} + +// AsQuickBooksSource is the BasicCopySource implementation for PrestoSource. +func (ps PrestoSource) AsQuickBooksSource() (*QuickBooksSource, bool) { + return nil, false +} + +// AsPrestoSource is the BasicCopySource implementation for PrestoSource. +func (ps PrestoSource) AsPrestoSource() (*PrestoSource, bool) { + return &ps, true +} + +// AsPhoenixSource is the BasicCopySource implementation for PrestoSource. +func (ps PrestoSource) AsPhoenixSource() (*PhoenixSource, bool) { + return nil, false +} + +// AsPaypalSource is the BasicCopySource implementation for PrestoSource. +func (ps PrestoSource) AsPaypalSource() (*PaypalSource, bool) { + return nil, false +} + +// AsMarketoSource is the BasicCopySource implementation for PrestoSource. +func (ps PrestoSource) AsMarketoSource() (*MarketoSource, bool) { + return nil, false +} + +// AsMariaDBSource is the BasicCopySource implementation for PrestoSource. +func (ps PrestoSource) AsMariaDBSource() (*MariaDBSource, bool) { + return nil, false +} + +// AsMagentoSource is the BasicCopySource implementation for PrestoSource. +func (ps PrestoSource) AsMagentoSource() (*MagentoSource, bool) { + return nil, false +} + +// AsJiraSource is the BasicCopySource implementation for PrestoSource. +func (ps PrestoSource) AsJiraSource() (*JiraSource, bool) { + return nil, false +} + +// AsImpalaSource is the BasicCopySource implementation for PrestoSource. +func (ps PrestoSource) AsImpalaSource() (*ImpalaSource, bool) { + return nil, false +} + +// AsHubspotSource is the BasicCopySource implementation for PrestoSource. +func (ps PrestoSource) AsHubspotSource() (*HubspotSource, bool) { + return nil, false +} + +// AsHiveSource is the BasicCopySource implementation for PrestoSource. +func (ps PrestoSource) AsHiveSource() (*HiveSource, bool) { + return nil, false +} + +// AsHBaseSource is the BasicCopySource implementation for PrestoSource. +func (ps PrestoSource) AsHBaseSource() (*HBaseSource, bool) { + return nil, false +} + +// AsGreenplumSource is the BasicCopySource implementation for PrestoSource. +func (ps PrestoSource) AsGreenplumSource() (*GreenplumSource, bool) { + return nil, false +} + +// AsGoogleBigQuerySource is the BasicCopySource implementation for PrestoSource. +func (ps PrestoSource) AsGoogleBigQuerySource() (*GoogleBigQuerySource, bool) { + return nil, false +} + +// AsEloquaSource is the BasicCopySource implementation for PrestoSource. +func (ps PrestoSource) AsEloquaSource() (*EloquaSource, bool) { + return nil, false +} + +// AsDrillSource is the BasicCopySource implementation for PrestoSource. +func (ps PrestoSource) AsDrillSource() (*DrillSource, bool) { + return nil, false +} + +// AsCouchbaseSource is the BasicCopySource implementation for PrestoSource. +func (ps PrestoSource) AsCouchbaseSource() (*CouchbaseSource, bool) { + return nil, false +} + +// AsConcurSource is the BasicCopySource implementation for PrestoSource. +func (ps PrestoSource) AsConcurSource() (*ConcurSource, bool) { + return nil, false +} + +// AsAzurePostgreSQLSource is the BasicCopySource implementation for PrestoSource. +func (ps PrestoSource) AsAzurePostgreSQLSource() (*AzurePostgreSQLSource, bool) { + return nil, false +} + +// AsAmazonMWSSource is the BasicCopySource implementation for PrestoSource. +func (ps PrestoSource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { + return nil, false +} + +// AsHTTPSource is the BasicCopySource implementation for PrestoSource. +func (ps PrestoSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for PrestoSource. +func (ps PrestoSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for PrestoSource. +func (ps PrestoSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsCassandraSource is the BasicCopySource implementation for PrestoSource. +func (ps PrestoSource) AsCassandraSource() (*CassandraSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for PrestoSource. +func (ps PrestoSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for PrestoSource. +func (ps PrestoSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureMySQLSource is the BasicCopySource implementation for PrestoSource. +func (ps PrestoSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for PrestoSource. +func (ps PrestoSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for PrestoSource. +func (ps PrestoSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsSQLDWSource is the BasicCopySource implementation for PrestoSource. +func (ps PrestoSource) AsSQLDWSource() (*SQLDWSource, bool) { + return nil, false +} + +// AsSQLSource is the BasicCopySource implementation for PrestoSource. +func (ps PrestoSource) AsSQLSource() (*SQLSource, bool) { + return nil, false +} + +// AsSapEccSource is the BasicCopySource implementation for PrestoSource. +func (ps PrestoSource) AsSapEccSource() (*SapEccSource, bool) { + return nil, false +} + +// AsSapCloudForCustomerSource is the BasicCopySource implementation for PrestoSource. +func (ps PrestoSource) AsSapCloudForCustomerSource() (*SapCloudForCustomerSource, bool) { + return nil, false +} + +// AsSalesforceSource is the BasicCopySource implementation for PrestoSource. +func (ps PrestoSource) AsSalesforceSource() (*SalesforceSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for PrestoSource. +func (ps PrestoSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for PrestoSource. +func (ps PrestoSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for PrestoSource. +func (ps PrestoSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for PrestoSource. +func (ps PrestoSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + +// AsAzureTableSource is the BasicCopySource implementation for PrestoSource. +func (ps PrestoSource) AsAzureTableSource() (*AzureTableSource, bool) { + return nil, false +} + +// AsCopySource is the BasicCopySource implementation for PrestoSource. +func (ps PrestoSource) AsCopySource() (*CopySource, bool) { + return nil, false +} + +// AsBasicCopySource is the BasicCopySource implementation for PrestoSource. +func (ps PrestoSource) AsBasicCopySource() (BasicCopySource, bool) { + return &ps, true +} + +// QuickBooksLinkedService quickBooks server linked service. +type QuickBooksLinkedService struct { + // QuickBooksLinkedServiceTypeProperties - QuickBooks server linked service properties. + *QuickBooksLinkedServiceTypeProperties `json:"typeProperties,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // ConnectVia - The integration runtime reference. + ConnectVia *IntegrationRuntimeReference `json:"connectVia,omitempty"` + // Description - Linked service description. + Description *string `json:"description,omitempty"` + // Parameters - Parameters for linked service. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeLinkedService', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforce', 'TypeAzureDataLakeStore', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureStorage' + Type TypeBasicLinkedService `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for QuickBooksLinkedService. +func (qbls QuickBooksLinkedService) MarshalJSON() ([]byte, error) { + qbls.Type = TypeQuickBooks + objectMap := make(map[string]interface{}) + if qbls.QuickBooksLinkedServiceTypeProperties != nil { + objectMap["typeProperties"] = qbls.QuickBooksLinkedServiceTypeProperties + } + if qbls.ConnectVia != nil { + objectMap["connectVia"] = qbls.ConnectVia + } + if qbls.Description != nil { + objectMap["description"] = qbls.Description + } + if qbls.Parameters != nil { + objectMap["parameters"] = qbls.Parameters + } + if qbls.Annotations != nil { + objectMap["annotations"] = qbls.Annotations + } + if qbls.Type != "" { + objectMap["type"] = qbls.Type + } + for k, v := range qbls.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysLinkedService is the BasicLinkedService implementation for QuickBooksLinkedService. +func (qbls QuickBooksLinkedService) AsResponsysLinkedService() (*ResponsysLinkedService, bool) { + return nil, false +} + +// AsAzureDatabricksLinkedService is the BasicLinkedService implementation for QuickBooksLinkedService. +func (qbls QuickBooksLinkedService) AsAzureDatabricksLinkedService() (*AzureDatabricksLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeAnalyticsLinkedService is the BasicLinkedService implementation for QuickBooksLinkedService. +func (qbls QuickBooksLinkedService) AsAzureDataLakeAnalyticsLinkedService() (*AzureDataLakeAnalyticsLinkedService, bool) { + return nil, false +} + +// AsHDInsightOnDemandLinkedService is the BasicLinkedService implementation for QuickBooksLinkedService. +func (qbls QuickBooksLinkedService) AsHDInsightOnDemandLinkedService() (*HDInsightOnDemandLinkedService, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudLinkedService is the BasicLinkedService implementation for QuickBooksLinkedService. +func (qbls QuickBooksLinkedService) AsSalesforceMarketingCloudLinkedService() (*SalesforceMarketingCloudLinkedService, bool) { + return nil, false +} + +// AsNetezzaLinkedService is the BasicLinkedService implementation for QuickBooksLinkedService. +func (qbls QuickBooksLinkedService) AsNetezzaLinkedService() (*NetezzaLinkedService, bool) { + return nil, false +} + +// AsVerticaLinkedService is the BasicLinkedService implementation for QuickBooksLinkedService. +func (qbls QuickBooksLinkedService) AsVerticaLinkedService() (*VerticaLinkedService, bool) { + return nil, false +} + +// AsZohoLinkedService is the BasicLinkedService implementation for QuickBooksLinkedService. +func (qbls QuickBooksLinkedService) AsZohoLinkedService() (*ZohoLinkedService, bool) { + return nil, false +} + +// AsXeroLinkedService is the BasicLinkedService implementation for QuickBooksLinkedService. +func (qbls QuickBooksLinkedService) AsXeroLinkedService() (*XeroLinkedService, bool) { + return nil, false +} + +// AsSquareLinkedService is the BasicLinkedService implementation for QuickBooksLinkedService. +func (qbls QuickBooksLinkedService) AsSquareLinkedService() (*SquareLinkedService, bool) { + return nil, false +} + +// AsSparkLinkedService is the BasicLinkedService implementation for QuickBooksLinkedService. +func (qbls QuickBooksLinkedService) AsSparkLinkedService() (*SparkLinkedService, bool) { + return nil, false +} + +// AsShopifyLinkedService is the BasicLinkedService implementation for QuickBooksLinkedService. +func (qbls QuickBooksLinkedService) AsShopifyLinkedService() (*ShopifyLinkedService, bool) { + return nil, false +} + +// AsServiceNowLinkedService is the BasicLinkedService implementation for QuickBooksLinkedService. +func (qbls QuickBooksLinkedService) AsServiceNowLinkedService() (*ServiceNowLinkedService, bool) { + return nil, false +} + +// AsQuickBooksLinkedService is the BasicLinkedService implementation for QuickBooksLinkedService. +func (qbls QuickBooksLinkedService) AsQuickBooksLinkedService() (*QuickBooksLinkedService, bool) { + return &qbls, true +} + +// AsPrestoLinkedService is the BasicLinkedService implementation for QuickBooksLinkedService. +func (qbls QuickBooksLinkedService) AsPrestoLinkedService() (*PrestoLinkedService, bool) { + return nil, false +} + +// AsPhoenixLinkedService is the BasicLinkedService implementation for QuickBooksLinkedService. +func (qbls QuickBooksLinkedService) AsPhoenixLinkedService() (*PhoenixLinkedService, bool) { + return nil, false +} + +// AsPaypalLinkedService is the BasicLinkedService implementation for QuickBooksLinkedService. +func (qbls QuickBooksLinkedService) AsPaypalLinkedService() (*PaypalLinkedService, bool) { + return nil, false +} + +// AsMarketoLinkedService is the BasicLinkedService implementation for QuickBooksLinkedService. +func (qbls QuickBooksLinkedService) AsMarketoLinkedService() (*MarketoLinkedService, bool) { + return nil, false +} + +// AsMariaDBLinkedService is the BasicLinkedService implementation for QuickBooksLinkedService. +func (qbls QuickBooksLinkedService) AsMariaDBLinkedService() (*MariaDBLinkedService, bool) { + return nil, false +} + +// AsMagentoLinkedService is the BasicLinkedService implementation for QuickBooksLinkedService. +func (qbls QuickBooksLinkedService) AsMagentoLinkedService() (*MagentoLinkedService, bool) { + return nil, false +} + +// AsJiraLinkedService is the BasicLinkedService implementation for QuickBooksLinkedService. +func (qbls QuickBooksLinkedService) AsJiraLinkedService() (*JiraLinkedService, bool) { + return nil, false +} + +// AsImpalaLinkedService is the BasicLinkedService implementation for QuickBooksLinkedService. +func (qbls QuickBooksLinkedService) AsImpalaLinkedService() (*ImpalaLinkedService, bool) { + return nil, false +} + +// AsHubspotLinkedService is the BasicLinkedService implementation for QuickBooksLinkedService. +func (qbls QuickBooksLinkedService) AsHubspotLinkedService() (*HubspotLinkedService, bool) { + return nil, false +} + +// AsHiveLinkedService is the BasicLinkedService implementation for QuickBooksLinkedService. +func (qbls QuickBooksLinkedService) AsHiveLinkedService() (*HiveLinkedService, bool) { + return nil, false +} + +// AsHBaseLinkedService is the BasicLinkedService implementation for QuickBooksLinkedService. +func (qbls QuickBooksLinkedService) AsHBaseLinkedService() (*HBaseLinkedService, bool) { + return nil, false +} + +// AsGreenplumLinkedService is the BasicLinkedService implementation for QuickBooksLinkedService. +func (qbls QuickBooksLinkedService) AsGreenplumLinkedService() (*GreenplumLinkedService, bool) { + return nil, false +} + +// AsGoogleBigQueryLinkedService is the BasicLinkedService implementation for QuickBooksLinkedService. +func (qbls QuickBooksLinkedService) AsGoogleBigQueryLinkedService() (*GoogleBigQueryLinkedService, bool) { + return nil, false +} + +// AsEloquaLinkedService is the BasicLinkedService implementation for QuickBooksLinkedService. +func (qbls QuickBooksLinkedService) AsEloquaLinkedService() (*EloquaLinkedService, bool) { + return nil, false +} + +// AsDrillLinkedService is the BasicLinkedService implementation for QuickBooksLinkedService. +func (qbls QuickBooksLinkedService) AsDrillLinkedService() (*DrillLinkedService, bool) { + return nil, false +} + +// AsCouchbaseLinkedService is the BasicLinkedService implementation for QuickBooksLinkedService. +func (qbls QuickBooksLinkedService) AsCouchbaseLinkedService() (*CouchbaseLinkedService, bool) { + return nil, false +} + +// AsConcurLinkedService is the BasicLinkedService implementation for QuickBooksLinkedService. +func (qbls QuickBooksLinkedService) AsConcurLinkedService() (*ConcurLinkedService, bool) { + return nil, false +} + +// AsAzurePostgreSQLLinkedService is the BasicLinkedService implementation for QuickBooksLinkedService. +func (qbls QuickBooksLinkedService) AsAzurePostgreSQLLinkedService() (*AzurePostgreSQLLinkedService, bool) { + return nil, false +} + +// AsAmazonMWSLinkedService is the BasicLinkedService implementation for QuickBooksLinkedService. +func (qbls QuickBooksLinkedService) AsAmazonMWSLinkedService() (*AmazonMWSLinkedService, bool) { + return nil, false +} + +// AsSapHanaLinkedService is the BasicLinkedService implementation for QuickBooksLinkedService. +func (qbls QuickBooksLinkedService) AsSapHanaLinkedService() (*SapHanaLinkedService, bool) { + return nil, false +} + +// AsSapBWLinkedService is the BasicLinkedService implementation for QuickBooksLinkedService. +func (qbls QuickBooksLinkedService) AsSapBWLinkedService() (*SapBWLinkedService, bool) { + return nil, false +} + +// AsSftpServerLinkedService is the BasicLinkedService implementation for QuickBooksLinkedService. +func (qbls QuickBooksLinkedService) AsSftpServerLinkedService() (*SftpServerLinkedService, bool) { + return nil, false +} + +// AsFtpServerLinkedService is the BasicLinkedService implementation for QuickBooksLinkedService. +func (qbls QuickBooksLinkedService) AsFtpServerLinkedService() (*FtpServerLinkedService, bool) { + return nil, false +} + +// AsHTTPLinkedService is the BasicLinkedService implementation for QuickBooksLinkedService. +func (qbls QuickBooksLinkedService) AsHTTPLinkedService() (*HTTPLinkedService, bool) { + return nil, false +} + +// AsAzureSearchLinkedService is the BasicLinkedService implementation for QuickBooksLinkedService. +func (qbls QuickBooksLinkedService) AsAzureSearchLinkedService() (*AzureSearchLinkedService, bool) { + return nil, false +} + +// AsCustomDataSourceLinkedService is the BasicLinkedService implementation for QuickBooksLinkedService. +func (qbls QuickBooksLinkedService) AsCustomDataSourceLinkedService() (*CustomDataSourceLinkedService, bool) { + return nil, false +} + +// AsAmazonRedshiftLinkedService is the BasicLinkedService implementation for QuickBooksLinkedService. +func (qbls QuickBooksLinkedService) AsAmazonRedshiftLinkedService() (*AmazonRedshiftLinkedService, bool) { + return nil, false +} + +// AsAmazonS3LinkedService is the BasicLinkedService implementation for QuickBooksLinkedService. +func (qbls QuickBooksLinkedService) AsAmazonS3LinkedService() (*AmazonS3LinkedService, bool) { + return nil, false +} + +// AsSapEccLinkedService is the BasicLinkedService implementation for QuickBooksLinkedService. +func (qbls QuickBooksLinkedService) AsSapEccLinkedService() (*SapEccLinkedService, bool) { + return nil, false +} + +// AsSapCloudForCustomerLinkedService is the BasicLinkedService implementation for QuickBooksLinkedService. +func (qbls QuickBooksLinkedService) AsSapCloudForCustomerLinkedService() (*SapCloudForCustomerLinkedService, bool) { + return nil, false +} + +// AsSalesforceLinkedService is the BasicLinkedService implementation for QuickBooksLinkedService. +func (qbls QuickBooksLinkedService) AsSalesforceLinkedService() (*SalesforceLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeStoreLinkedService is the BasicLinkedService implementation for QuickBooksLinkedService. +func (qbls QuickBooksLinkedService) AsAzureDataLakeStoreLinkedService() (*AzureDataLakeStoreLinkedService, bool) { + return nil, false +} + +// AsMongoDbLinkedService is the BasicLinkedService implementation for QuickBooksLinkedService. +func (qbls QuickBooksLinkedService) AsMongoDbLinkedService() (*MongoDbLinkedService, bool) { + return nil, false +} + +// AsCassandraLinkedService is the BasicLinkedService implementation for QuickBooksLinkedService. +func (qbls QuickBooksLinkedService) AsCassandraLinkedService() (*CassandraLinkedService, bool) { + return nil, false +} + +// AsWebLinkedService is the BasicLinkedService implementation for QuickBooksLinkedService. +func (qbls QuickBooksLinkedService) AsWebLinkedService() (*WebLinkedService, bool) { + return nil, false +} + +// AsODataLinkedService is the BasicLinkedService implementation for QuickBooksLinkedService. +func (qbls QuickBooksLinkedService) AsODataLinkedService() (*ODataLinkedService, bool) { + return nil, false +} + +// AsHdfsLinkedService is the BasicLinkedService implementation for QuickBooksLinkedService. +func (qbls QuickBooksLinkedService) AsHdfsLinkedService() (*HdfsLinkedService, bool) { + return nil, false +} + +// AsOdbcLinkedService is the BasicLinkedService implementation for QuickBooksLinkedService. +func (qbls QuickBooksLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, bool) { + return nil, false +} + +// AsAzureMLLinkedService is the BasicLinkedService implementation for QuickBooksLinkedService. +func (qbls QuickBooksLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { + return nil, false +} + +// AsTeradataLinkedService is the BasicLinkedService implementation for QuickBooksLinkedService. +func (qbls QuickBooksLinkedService) AsTeradataLinkedService() (*TeradataLinkedService, bool) { + return nil, false +} + +// AsDb2LinkedService is the BasicLinkedService implementation for QuickBooksLinkedService. +func (qbls QuickBooksLinkedService) AsDb2LinkedService() (*Db2LinkedService, bool) { + return nil, false +} + +// AsSybaseLinkedService is the BasicLinkedService implementation for QuickBooksLinkedService. +func (qbls QuickBooksLinkedService) AsSybaseLinkedService() (*SybaseLinkedService, bool) { + return nil, false +} + +// AsPostgreSQLLinkedService is the BasicLinkedService implementation for QuickBooksLinkedService. +func (qbls QuickBooksLinkedService) AsPostgreSQLLinkedService() (*PostgreSQLLinkedService, bool) { + return nil, false +} + +// AsMySQLLinkedService is the BasicLinkedService implementation for QuickBooksLinkedService. +func (qbls QuickBooksLinkedService) AsMySQLLinkedService() (*MySQLLinkedService, bool) { + return nil, false +} + +// AsAzureMySQLLinkedService is the BasicLinkedService implementation for QuickBooksLinkedService. +func (qbls QuickBooksLinkedService) AsAzureMySQLLinkedService() (*AzureMySQLLinkedService, bool) { + return nil, false +} + +// AsOracleLinkedService is the BasicLinkedService implementation for QuickBooksLinkedService. +func (qbls QuickBooksLinkedService) AsOracleLinkedService() (*OracleLinkedService, bool) { + return nil, false +} + +// AsFileServerLinkedService is the BasicLinkedService implementation for QuickBooksLinkedService. +func (qbls QuickBooksLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { + return nil, false +} + +// AsHDInsightLinkedService is the BasicLinkedService implementation for QuickBooksLinkedService. +func (qbls QuickBooksLinkedService) AsHDInsightLinkedService() (*HDInsightLinkedService, bool) { + return nil, false +} + +// AsDynamicsLinkedService is the BasicLinkedService implementation for QuickBooksLinkedService. +func (qbls QuickBooksLinkedService) AsDynamicsLinkedService() (*DynamicsLinkedService, bool) { + return nil, false +} + +// AsCosmosDbLinkedService is the BasicLinkedService implementation for QuickBooksLinkedService. +func (qbls QuickBooksLinkedService) AsCosmosDbLinkedService() (*CosmosDbLinkedService, bool) { + return nil, false +} + +// AsAzureKeyVaultLinkedService is the BasicLinkedService implementation for QuickBooksLinkedService. +func (qbls QuickBooksLinkedService) AsAzureKeyVaultLinkedService() (*AzureKeyVaultLinkedService, bool) { + return nil, false +} + +// AsAzureBatchLinkedService is the BasicLinkedService implementation for QuickBooksLinkedService. +func (qbls QuickBooksLinkedService) AsAzureBatchLinkedService() (*AzureBatchLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDatabaseLinkedService is the BasicLinkedService implementation for QuickBooksLinkedService. +func (qbls QuickBooksLinkedService) AsAzureSQLDatabaseLinkedService() (*AzureSQLDatabaseLinkedService, bool) { + return nil, false +} + +// AsSQLServerLinkedService is the BasicLinkedService implementation for QuickBooksLinkedService. +func (qbls QuickBooksLinkedService) AsSQLServerLinkedService() (*SQLServerLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDWLinkedService is the BasicLinkedService implementation for QuickBooksLinkedService. +func (qbls QuickBooksLinkedService) AsAzureSQLDWLinkedService() (*AzureSQLDWLinkedService, bool) { + return nil, false +} + +// AsAzureStorageLinkedService is the BasicLinkedService implementation for QuickBooksLinkedService. +func (qbls QuickBooksLinkedService) AsAzureStorageLinkedService() (*AzureStorageLinkedService, bool) { + return nil, false +} + +// AsLinkedService is the BasicLinkedService implementation for QuickBooksLinkedService. +func (qbls QuickBooksLinkedService) AsLinkedService() (*LinkedService, bool) { + return nil, false +} + +// AsBasicLinkedService is the BasicLinkedService implementation for QuickBooksLinkedService. +func (qbls QuickBooksLinkedService) AsBasicLinkedService() (BasicLinkedService, bool) { + return &qbls, true +} + +// UnmarshalJSON is the custom unmarshaler for QuickBooksLinkedService struct. +func (qbls *QuickBooksLinkedService) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "typeProperties": + if v != nil { + var quickBooksLinkedServiceTypeProperties QuickBooksLinkedServiceTypeProperties + err = json.Unmarshal(*v, &quickBooksLinkedServiceTypeProperties) + if err != nil { + return err + } + qbls.QuickBooksLinkedServiceTypeProperties = &quickBooksLinkedServiceTypeProperties + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if qbls.AdditionalProperties == nil { + qbls.AdditionalProperties = make(map[string]interface{}) + } + qbls.AdditionalProperties[k] = additionalProperties + } + case "connectVia": + if v != nil { + var connectVia IntegrationRuntimeReference + err = json.Unmarshal(*v, &connectVia) + if err != nil { + return err + } + qbls.ConnectVia = &connectVia + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + qbls.Description = &description + } + case "parameters": + if v != nil { + var parameters map[string]*ParameterSpecification + err = json.Unmarshal(*v, ¶meters) + if err != nil { + return err + } + qbls.Parameters = parameters + } + case "annotations": + if v != nil { + var annotations []interface{} + err = json.Unmarshal(*v, &annotations) + if err != nil { + return err + } + qbls.Annotations = &annotations + } + case "type": + if v != nil { + var typeVar TypeBasicLinkedService + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + qbls.Type = typeVar + } + } + } + + return nil +} + +// QuickBooksLinkedServiceTypeProperties quickBooks server linked service properties. +type QuickBooksLinkedServiceTypeProperties struct { + // Endpoint - The endpoint of the QuickBooks server. (i.e. quickbooks.api.intuit.com) + Endpoint interface{} `json:"endpoint,omitempty"` + // CompanyID - The company ID of the QuickBooks company to authorize. + CompanyID interface{} `json:"companyId,omitempty"` + // ConsumerKey - The consumer key for OAuth 1.0 authentication. + ConsumerKey interface{} `json:"consumerKey,omitempty"` + // ConsumerSecret - The consumer secret for OAuth 1.0 authentication. + ConsumerSecret BasicSecretBase `json:"consumerSecret,omitempty"` + // AccessToken - The access token for OAuth 1.0 authentication. + AccessToken BasicSecretBase `json:"accessToken,omitempty"` + // AccessTokenSecret - The access token secret for OAuth 1.0 authentication. + AccessTokenSecret BasicSecretBase `json:"accessTokenSecret,omitempty"` + // UseEncryptedEndpoints - Specifies whether the data source endpoints are encrypted using HTTPS. The default value is true. + UseEncryptedEndpoints interface{} `json:"useEncryptedEndpoints,omitempty"` + // EncryptedCredential - The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string). + EncryptedCredential interface{} `json:"encryptedCredential,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for QuickBooksLinkedServiceTypeProperties struct. +func (qblstp *QuickBooksLinkedServiceTypeProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "endpoint": + if v != nil { + var endpoint interface{} + err = json.Unmarshal(*v, &endpoint) + if err != nil { + return err + } + qblstp.Endpoint = endpoint + } + case "companyId": + if v != nil { + var companyID interface{} + err = json.Unmarshal(*v, &companyID) + if err != nil { + return err + } + qblstp.CompanyID = companyID + } + case "consumerKey": + if v != nil { + var consumerKey interface{} + err = json.Unmarshal(*v, &consumerKey) + if err != nil { + return err + } + qblstp.ConsumerKey = consumerKey + } + case "consumerSecret": + if v != nil { + consumerSecret, err := unmarshalBasicSecretBase(*v) + if err != nil { + return err + } + qblstp.ConsumerSecret = consumerSecret + } + case "accessToken": + if v != nil { + accessToken, err := unmarshalBasicSecretBase(*v) + if err != nil { + return err + } + qblstp.AccessToken = accessToken + } + case "accessTokenSecret": + if v != nil { + accessTokenSecret, err := unmarshalBasicSecretBase(*v) + if err != nil { + return err + } + qblstp.AccessTokenSecret = accessTokenSecret + } + case "useEncryptedEndpoints": + if v != nil { + var useEncryptedEndpoints interface{} + err = json.Unmarshal(*v, &useEncryptedEndpoints) + if err != nil { + return err + } + qblstp.UseEncryptedEndpoints = useEncryptedEndpoints + } + case "encryptedCredential": + if v != nil { + var encryptedCredential interface{} + err = json.Unmarshal(*v, &encryptedCredential) + if err != nil { + return err + } + qblstp.EncryptedCredential = encryptedCredential + } + } + } + + return nil +} + +// QuickBooksObjectDataset quickBooks server dataset. +type QuickBooksObjectDataset struct { + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Description - Dataset description. + Description *string `json:"description,omitempty"` + // Structure - Columns that define the structure of the dataset. Type: array (or Expression with resultType array), itemType: DatasetDataElement. + Structure interface{} `json:"structure,omitempty"` + // LinkedServiceName - Linked service reference. + LinkedServiceName *LinkedServiceReference `json:"linkedServiceName,omitempty"` + // Parameters - Parameters for dataset. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeDataset', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSQLServerTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSalesforceObject', 'TypeRelationalTable', 'TypeAzureMySQLTable', 'TypeOracleTable', 'TypeODataResource', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeAzureDataLakeStoreFile', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeAmazonS3Object' + Type TypeBasicDataset `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for QuickBooksObjectDataset. +func (qbod QuickBooksObjectDataset) MarshalJSON() ([]byte, error) { + qbod.Type = TypeQuickBooksObject + objectMap := make(map[string]interface{}) + if qbod.Description != nil { + objectMap["description"] = qbod.Description + } + objectMap["structure"] = qbod.Structure + if qbod.LinkedServiceName != nil { + objectMap["linkedServiceName"] = qbod.LinkedServiceName + } + if qbod.Parameters != nil { + objectMap["parameters"] = qbod.Parameters + } + if qbod.Annotations != nil { + objectMap["annotations"] = qbod.Annotations + } + if qbod.Type != "" { + objectMap["type"] = qbod.Type + } + for k, v := range qbod.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysObjectDataset is the BasicDataset implementation for QuickBooksObjectDataset. +func (qbod QuickBooksObjectDataset) AsResponsysObjectDataset() (*ResponsysObjectDataset, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudObjectDataset is the BasicDataset implementation for QuickBooksObjectDataset. +func (qbod QuickBooksObjectDataset) AsSalesforceMarketingCloudObjectDataset() (*SalesforceMarketingCloudObjectDataset, bool) { + return nil, false +} + +// AsVerticaTableDataset is the BasicDataset implementation for QuickBooksObjectDataset. +func (qbod QuickBooksObjectDataset) AsVerticaTableDataset() (*VerticaTableDataset, bool) { + return nil, false +} + +// AsNetezzaTableDataset is the BasicDataset implementation for QuickBooksObjectDataset. +func (qbod QuickBooksObjectDataset) AsNetezzaTableDataset() (*NetezzaTableDataset, bool) { + return nil, false +} + +// AsZohoObjectDataset is the BasicDataset implementation for QuickBooksObjectDataset. +func (qbod QuickBooksObjectDataset) AsZohoObjectDataset() (*ZohoObjectDataset, bool) { + return nil, false +} + +// AsXeroObjectDataset is the BasicDataset implementation for QuickBooksObjectDataset. +func (qbod QuickBooksObjectDataset) AsXeroObjectDataset() (*XeroObjectDataset, bool) { + return nil, false +} + +// AsSquareObjectDataset is the BasicDataset implementation for QuickBooksObjectDataset. +func (qbod QuickBooksObjectDataset) AsSquareObjectDataset() (*SquareObjectDataset, bool) { + return nil, false +} + +// AsSparkObjectDataset is the BasicDataset implementation for QuickBooksObjectDataset. +func (qbod QuickBooksObjectDataset) AsSparkObjectDataset() (*SparkObjectDataset, bool) { + return nil, false +} + +// AsShopifyObjectDataset is the BasicDataset implementation for QuickBooksObjectDataset. +func (qbod QuickBooksObjectDataset) AsShopifyObjectDataset() (*ShopifyObjectDataset, bool) { + return nil, false +} + +// AsServiceNowObjectDataset is the BasicDataset implementation for QuickBooksObjectDataset. +func (qbod QuickBooksObjectDataset) AsServiceNowObjectDataset() (*ServiceNowObjectDataset, bool) { + return nil, false +} + +// AsQuickBooksObjectDataset is the BasicDataset implementation for QuickBooksObjectDataset. +func (qbod QuickBooksObjectDataset) AsQuickBooksObjectDataset() (*QuickBooksObjectDataset, bool) { + return &qbod, true +} + +// AsPrestoObjectDataset is the BasicDataset implementation for QuickBooksObjectDataset. +func (qbod QuickBooksObjectDataset) AsPrestoObjectDataset() (*PrestoObjectDataset, bool) { + return nil, false +} + +// AsPhoenixObjectDataset is the BasicDataset implementation for QuickBooksObjectDataset. +func (qbod QuickBooksObjectDataset) AsPhoenixObjectDataset() (*PhoenixObjectDataset, bool) { + return nil, false +} + +// AsPaypalObjectDataset is the BasicDataset implementation for QuickBooksObjectDataset. +func (qbod QuickBooksObjectDataset) AsPaypalObjectDataset() (*PaypalObjectDataset, bool) { + return nil, false +} + +// AsMarketoObjectDataset is the BasicDataset implementation for QuickBooksObjectDataset. +func (qbod QuickBooksObjectDataset) AsMarketoObjectDataset() (*MarketoObjectDataset, bool) { + return nil, false +} + +// AsMariaDBTableDataset is the BasicDataset implementation for QuickBooksObjectDataset. +func (qbod QuickBooksObjectDataset) AsMariaDBTableDataset() (*MariaDBTableDataset, bool) { + return nil, false +} + +// AsMagentoObjectDataset is the BasicDataset implementation for QuickBooksObjectDataset. +func (qbod QuickBooksObjectDataset) AsMagentoObjectDataset() (*MagentoObjectDataset, bool) { + return nil, false +} + +// AsJiraObjectDataset is the BasicDataset implementation for QuickBooksObjectDataset. +func (qbod QuickBooksObjectDataset) AsJiraObjectDataset() (*JiraObjectDataset, bool) { + return nil, false +} + +// AsImpalaObjectDataset is the BasicDataset implementation for QuickBooksObjectDataset. +func (qbod QuickBooksObjectDataset) AsImpalaObjectDataset() (*ImpalaObjectDataset, bool) { + return nil, false +} + +// AsHubspotObjectDataset is the BasicDataset implementation for QuickBooksObjectDataset. +func (qbod QuickBooksObjectDataset) AsHubspotObjectDataset() (*HubspotObjectDataset, bool) { + return nil, false +} + +// AsHiveObjectDataset is the BasicDataset implementation for QuickBooksObjectDataset. +func (qbod QuickBooksObjectDataset) AsHiveObjectDataset() (*HiveObjectDataset, bool) { + return nil, false +} + +// AsHBaseObjectDataset is the BasicDataset implementation for QuickBooksObjectDataset. +func (qbod QuickBooksObjectDataset) AsHBaseObjectDataset() (*HBaseObjectDataset, bool) { + return nil, false +} + +// AsGreenplumTableDataset is the BasicDataset implementation for QuickBooksObjectDataset. +func (qbod QuickBooksObjectDataset) AsGreenplumTableDataset() (*GreenplumTableDataset, bool) { + return nil, false +} + +// AsGoogleBigQueryObjectDataset is the BasicDataset implementation for QuickBooksObjectDataset. +func (qbod QuickBooksObjectDataset) AsGoogleBigQueryObjectDataset() (*GoogleBigQueryObjectDataset, bool) { + return nil, false +} + +// AsEloquaObjectDataset is the BasicDataset implementation for QuickBooksObjectDataset. +func (qbod QuickBooksObjectDataset) AsEloquaObjectDataset() (*EloquaObjectDataset, bool) { + return nil, false +} + +// AsDrillTableDataset is the BasicDataset implementation for QuickBooksObjectDataset. +func (qbod QuickBooksObjectDataset) AsDrillTableDataset() (*DrillTableDataset, bool) { + return nil, false +} + +// AsCouchbaseTableDataset is the BasicDataset implementation for QuickBooksObjectDataset. +func (qbod QuickBooksObjectDataset) AsCouchbaseTableDataset() (*CouchbaseTableDataset, bool) { + return nil, false +} + +// AsConcurObjectDataset is the BasicDataset implementation for QuickBooksObjectDataset. +func (qbod QuickBooksObjectDataset) AsConcurObjectDataset() (*ConcurObjectDataset, bool) { + return nil, false +} + +// AsAzurePostgreSQLTableDataset is the BasicDataset implementation for QuickBooksObjectDataset. +func (qbod QuickBooksObjectDataset) AsAzurePostgreSQLTableDataset() (*AzurePostgreSQLTableDataset, bool) { + return nil, false +} + +// AsAmazonMWSObjectDataset is the BasicDataset implementation for QuickBooksObjectDataset. +func (qbod QuickBooksObjectDataset) AsAmazonMWSObjectDataset() (*AmazonMWSObjectDataset, bool) { + return nil, false +} + +// AsHTTPDataset is the BasicDataset implementation for QuickBooksObjectDataset. +func (qbod QuickBooksObjectDataset) AsHTTPDataset() (*HTTPDataset, bool) { + return nil, false +} + +// AsAzureSearchIndexDataset is the BasicDataset implementation for QuickBooksObjectDataset. +func (qbod QuickBooksObjectDataset) AsAzureSearchIndexDataset() (*AzureSearchIndexDataset, bool) { + return nil, false +} + +// AsWebTableDataset is the BasicDataset implementation for QuickBooksObjectDataset. +func (qbod QuickBooksObjectDataset) AsWebTableDataset() (*WebTableDataset, bool) { + return nil, false +} + +// AsSQLServerTableDataset is the BasicDataset implementation for QuickBooksObjectDataset. +func (qbod QuickBooksObjectDataset) AsSQLServerTableDataset() (*SQLServerTableDataset, bool) { + return nil, false +} + +// AsSapEccResourceDataset is the BasicDataset implementation for QuickBooksObjectDataset. +func (qbod QuickBooksObjectDataset) AsSapEccResourceDataset() (*SapEccResourceDataset, bool) { + return nil, false +} + +// AsSapCloudForCustomerResourceDataset is the BasicDataset implementation for QuickBooksObjectDataset. +func (qbod QuickBooksObjectDataset) AsSapCloudForCustomerResourceDataset() (*SapCloudForCustomerResourceDataset, bool) { + return nil, false +} + +// AsSalesforceObjectDataset is the BasicDataset implementation for QuickBooksObjectDataset. +func (qbod QuickBooksObjectDataset) AsSalesforceObjectDataset() (*SalesforceObjectDataset, bool) { + return nil, false +} + +// AsRelationalTableDataset is the BasicDataset implementation for QuickBooksObjectDataset. +func (qbod QuickBooksObjectDataset) AsRelationalTableDataset() (*RelationalTableDataset, bool) { + return nil, false +} + +// AsAzureMySQLTableDataset is the BasicDataset implementation for QuickBooksObjectDataset. +func (qbod QuickBooksObjectDataset) AsAzureMySQLTableDataset() (*AzureMySQLTableDataset, bool) { + return nil, false +} + +// AsOracleTableDataset is the BasicDataset implementation for QuickBooksObjectDataset. +func (qbod QuickBooksObjectDataset) AsOracleTableDataset() (*OracleTableDataset, bool) { + return nil, false +} + +// AsODataResourceDataset is the BasicDataset implementation for QuickBooksObjectDataset. +func (qbod QuickBooksObjectDataset) AsODataResourceDataset() (*ODataResourceDataset, bool) { + return nil, false +} + +// AsMongoDbCollectionDataset is the BasicDataset implementation for QuickBooksObjectDataset. +func (qbod QuickBooksObjectDataset) AsMongoDbCollectionDataset() (*MongoDbCollectionDataset, bool) { + return nil, false +} + +// AsFileShareDataset is the BasicDataset implementation for QuickBooksObjectDataset. +func (qbod QuickBooksObjectDataset) AsFileShareDataset() (*FileShareDataset, bool) { + return nil, false +} + +// AsAzureDataLakeStoreDataset is the BasicDataset implementation for QuickBooksObjectDataset. +func (qbod QuickBooksObjectDataset) AsAzureDataLakeStoreDataset() (*AzureDataLakeStoreDataset, bool) { + return nil, false +} + +// AsDynamicsEntityDataset is the BasicDataset implementation for QuickBooksObjectDataset. +func (qbod QuickBooksObjectDataset) AsDynamicsEntityDataset() (*DynamicsEntityDataset, bool) { + return nil, false +} + +// AsDocumentDbCollectionDataset is the BasicDataset implementation for QuickBooksObjectDataset. +func (qbod QuickBooksObjectDataset) AsDocumentDbCollectionDataset() (*DocumentDbCollectionDataset, bool) { + return nil, false +} + +// AsCustomDataset is the BasicDataset implementation for QuickBooksObjectDataset. +func (qbod QuickBooksObjectDataset) AsCustomDataset() (*CustomDataset, bool) { + return nil, false +} + +// AsCassandraTableDataset is the BasicDataset implementation for QuickBooksObjectDataset. +func (qbod QuickBooksObjectDataset) AsCassandraTableDataset() (*CassandraTableDataset, bool) { + return nil, false +} + +// AsAzureSQLDWTableDataset is the BasicDataset implementation for QuickBooksObjectDataset. +func (qbod QuickBooksObjectDataset) AsAzureSQLDWTableDataset() (*AzureSQLDWTableDataset, bool) { + return nil, false +} + +// AsAzureSQLTableDataset is the BasicDataset implementation for QuickBooksObjectDataset. +func (qbod QuickBooksObjectDataset) AsAzureSQLTableDataset() (*AzureSQLTableDataset, bool) { + return nil, false +} + +// AsAzureTableDataset is the BasicDataset implementation for QuickBooksObjectDataset. +func (qbod QuickBooksObjectDataset) AsAzureTableDataset() (*AzureTableDataset, bool) { + return nil, false +} + +// AsAzureBlobDataset is the BasicDataset implementation for QuickBooksObjectDataset. +func (qbod QuickBooksObjectDataset) AsAzureBlobDataset() (*AzureBlobDataset, bool) { + return nil, false +} + +// AsAmazonS3Dataset is the BasicDataset implementation for QuickBooksObjectDataset. +func (qbod QuickBooksObjectDataset) AsAmazonS3Dataset() (*AmazonS3Dataset, bool) { + return nil, false +} + +// AsDataset is the BasicDataset implementation for QuickBooksObjectDataset. +func (qbod QuickBooksObjectDataset) AsDataset() (*Dataset, bool) { + return nil, false +} + +// AsBasicDataset is the BasicDataset implementation for QuickBooksObjectDataset. +func (qbod QuickBooksObjectDataset) AsBasicDataset() (BasicDataset, bool) { + return &qbod, true +} + +// QuickBooksSource a copy activity QuickBooks server source. +type QuickBooksSource struct { + // Query - A query to retrieve data from source. Type: string (or Expression with resultType string). + Query interface{} `json:"query,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // SourceRetryCount - Source retry count. Type: integer (or Expression with resultType integer). + SourceRetryCount interface{} `json:"sourceRetryCount,omitempty"` + // SourceRetryWait - Source retry wait. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` + // Type - Possible values include: 'TypeCopySource', 'TypeAmazonRedshiftSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeHTTPSource', 'TypeAzureDataLakeStoreSource', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeRelationalSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource' + Type TypeBasicCopySource `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for QuickBooksSource. +func (qbs QuickBooksSource) MarshalJSON() ([]byte, error) { + qbs.Type = TypeQuickBooksSource + objectMap := make(map[string]interface{}) + objectMap["query"] = qbs.Query + objectMap["sourceRetryCount"] = qbs.SourceRetryCount + objectMap["sourceRetryWait"] = qbs.SourceRetryWait + if qbs.Type != "" { + objectMap["type"] = qbs.Type + } + for k, v := range qbs.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsAmazonRedshiftSource is the BasicCopySource implementation for QuickBooksSource. +func (qbs QuickBooksSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { + return nil, false +} + +// AsResponsysSource is the BasicCopySource implementation for QuickBooksSource. +func (qbs QuickBooksSource) AsResponsysSource() (*ResponsysSource, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudSource is the BasicCopySource implementation for QuickBooksSource. +func (qbs QuickBooksSource) AsSalesforceMarketingCloudSource() (*SalesforceMarketingCloudSource, bool) { + return nil, false +} + +// AsVerticaSource is the BasicCopySource implementation for QuickBooksSource. +func (qbs QuickBooksSource) AsVerticaSource() (*VerticaSource, bool) { + return nil, false +} + +// AsNetezzaSource is the BasicCopySource implementation for QuickBooksSource. +func (qbs QuickBooksSource) AsNetezzaSource() (*NetezzaSource, bool) { + return nil, false +} + +// AsZohoSource is the BasicCopySource implementation for QuickBooksSource. +func (qbs QuickBooksSource) AsZohoSource() (*ZohoSource, bool) { + return nil, false +} + +// AsXeroSource is the BasicCopySource implementation for QuickBooksSource. +func (qbs QuickBooksSource) AsXeroSource() (*XeroSource, bool) { + return nil, false +} + +// AsSquareSource is the BasicCopySource implementation for QuickBooksSource. +func (qbs QuickBooksSource) AsSquareSource() (*SquareSource, bool) { + return nil, false +} + +// AsSparkSource is the BasicCopySource implementation for QuickBooksSource. +func (qbs QuickBooksSource) AsSparkSource() (*SparkSource, bool) { + return nil, false +} + +// AsShopifySource is the BasicCopySource implementation for QuickBooksSource. +func (qbs QuickBooksSource) AsShopifySource() (*ShopifySource, bool) { + return nil, false +} + +// AsServiceNowSource is the BasicCopySource implementation for QuickBooksSource. +func (qbs QuickBooksSource) AsServiceNowSource() (*ServiceNowSource, bool) { + return nil, false +} + +// AsQuickBooksSource is the BasicCopySource implementation for QuickBooksSource. +func (qbs QuickBooksSource) AsQuickBooksSource() (*QuickBooksSource, bool) { + return &qbs, true +} + +// AsPrestoSource is the BasicCopySource implementation for QuickBooksSource. +func (qbs QuickBooksSource) AsPrestoSource() (*PrestoSource, bool) { + return nil, false +} + +// AsPhoenixSource is the BasicCopySource implementation for QuickBooksSource. +func (qbs QuickBooksSource) AsPhoenixSource() (*PhoenixSource, bool) { + return nil, false +} + +// AsPaypalSource is the BasicCopySource implementation for QuickBooksSource. +func (qbs QuickBooksSource) AsPaypalSource() (*PaypalSource, bool) { + return nil, false +} + +// AsMarketoSource is the BasicCopySource implementation for QuickBooksSource. +func (qbs QuickBooksSource) AsMarketoSource() (*MarketoSource, bool) { + return nil, false +} + +// AsMariaDBSource is the BasicCopySource implementation for QuickBooksSource. +func (qbs QuickBooksSource) AsMariaDBSource() (*MariaDBSource, bool) { + return nil, false +} + +// AsMagentoSource is the BasicCopySource implementation for QuickBooksSource. +func (qbs QuickBooksSource) AsMagentoSource() (*MagentoSource, bool) { + return nil, false +} + +// AsJiraSource is the BasicCopySource implementation for QuickBooksSource. +func (qbs QuickBooksSource) AsJiraSource() (*JiraSource, bool) { + return nil, false +} + +// AsImpalaSource is the BasicCopySource implementation for QuickBooksSource. +func (qbs QuickBooksSource) AsImpalaSource() (*ImpalaSource, bool) { + return nil, false +} + +// AsHubspotSource is the BasicCopySource implementation for QuickBooksSource. +func (qbs QuickBooksSource) AsHubspotSource() (*HubspotSource, bool) { + return nil, false +} + +// AsHiveSource is the BasicCopySource implementation for QuickBooksSource. +func (qbs QuickBooksSource) AsHiveSource() (*HiveSource, bool) { + return nil, false +} + +// AsHBaseSource is the BasicCopySource implementation for QuickBooksSource. +func (qbs QuickBooksSource) AsHBaseSource() (*HBaseSource, bool) { + return nil, false +} + +// AsGreenplumSource is the BasicCopySource implementation for QuickBooksSource. +func (qbs QuickBooksSource) AsGreenplumSource() (*GreenplumSource, bool) { + return nil, false +} + +// AsGoogleBigQuerySource is the BasicCopySource implementation for QuickBooksSource. +func (qbs QuickBooksSource) AsGoogleBigQuerySource() (*GoogleBigQuerySource, bool) { + return nil, false +} + +// AsEloquaSource is the BasicCopySource implementation for QuickBooksSource. +func (qbs QuickBooksSource) AsEloquaSource() (*EloquaSource, bool) { + return nil, false +} + +// AsDrillSource is the BasicCopySource implementation for QuickBooksSource. +func (qbs QuickBooksSource) AsDrillSource() (*DrillSource, bool) { + return nil, false +} + +// AsCouchbaseSource is the BasicCopySource implementation for QuickBooksSource. +func (qbs QuickBooksSource) AsCouchbaseSource() (*CouchbaseSource, bool) { + return nil, false +} + +// AsConcurSource is the BasicCopySource implementation for QuickBooksSource. +func (qbs QuickBooksSource) AsConcurSource() (*ConcurSource, bool) { + return nil, false +} + +// AsAzurePostgreSQLSource is the BasicCopySource implementation for QuickBooksSource. +func (qbs QuickBooksSource) AsAzurePostgreSQLSource() (*AzurePostgreSQLSource, bool) { + return nil, false +} + +// AsAmazonMWSSource is the BasicCopySource implementation for QuickBooksSource. +func (qbs QuickBooksSource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { + return nil, false +} + +// AsHTTPSource is the BasicCopySource implementation for QuickBooksSource. +func (qbs QuickBooksSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for QuickBooksSource. +func (qbs QuickBooksSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for QuickBooksSource. +func (qbs QuickBooksSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsCassandraSource is the BasicCopySource implementation for QuickBooksSource. +func (qbs QuickBooksSource) AsCassandraSource() (*CassandraSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for QuickBooksSource. +func (qbs QuickBooksSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for QuickBooksSource. +func (qbs QuickBooksSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureMySQLSource is the BasicCopySource implementation for QuickBooksSource. +func (qbs QuickBooksSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for QuickBooksSource. +func (qbs QuickBooksSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for QuickBooksSource. +func (qbs QuickBooksSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsSQLDWSource is the BasicCopySource implementation for QuickBooksSource. +func (qbs QuickBooksSource) AsSQLDWSource() (*SQLDWSource, bool) { + return nil, false +} + +// AsSQLSource is the BasicCopySource implementation for QuickBooksSource. +func (qbs QuickBooksSource) AsSQLSource() (*SQLSource, bool) { + return nil, false +} + +// AsSapEccSource is the BasicCopySource implementation for QuickBooksSource. +func (qbs QuickBooksSource) AsSapEccSource() (*SapEccSource, bool) { + return nil, false +} + +// AsSapCloudForCustomerSource is the BasicCopySource implementation for QuickBooksSource. +func (qbs QuickBooksSource) AsSapCloudForCustomerSource() (*SapCloudForCustomerSource, bool) { + return nil, false +} + +// AsSalesforceSource is the BasicCopySource implementation for QuickBooksSource. +func (qbs QuickBooksSource) AsSalesforceSource() (*SalesforceSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for QuickBooksSource. +func (qbs QuickBooksSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for QuickBooksSource. +func (qbs QuickBooksSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for QuickBooksSource. +func (qbs QuickBooksSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for QuickBooksSource. +func (qbs QuickBooksSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + +// AsAzureTableSource is the BasicCopySource implementation for QuickBooksSource. +func (qbs QuickBooksSource) AsAzureTableSource() (*AzureTableSource, bool) { + return nil, false +} + +// AsCopySource is the BasicCopySource implementation for QuickBooksSource. +func (qbs QuickBooksSource) AsCopySource() (*CopySource, bool) { + return nil, false +} + +// AsBasicCopySource is the BasicCopySource implementation for QuickBooksSource. +func (qbs QuickBooksSource) AsBasicCopySource() (BasicCopySource, bool) { + return &qbs, true +} + +// RecurrenceSchedule the recurrence schedule. +type RecurrenceSchedule struct { + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Minutes - The minutes. + Minutes *[]int32 `json:"minutes,omitempty"` + // Hours - The hours. + Hours *[]int32 `json:"hours,omitempty"` + // WeekDays - The days of the week. + WeekDays *[]DaysOfWeek `json:"weekDays,omitempty"` + // MonthDays - The month days. + MonthDays *[]int32 `json:"monthDays,omitempty"` + // MonthlyOccurrences - The monthly occurrences. + MonthlyOccurrences *[]RecurrenceScheduleOccurrence `json:"monthlyOccurrences,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecurrenceSchedule. +func (rs RecurrenceSchedule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rs.Minutes != nil { + objectMap["minutes"] = rs.Minutes + } + if rs.Hours != nil { + objectMap["hours"] = rs.Hours + } + if rs.WeekDays != nil { + objectMap["weekDays"] = rs.WeekDays + } + if rs.MonthDays != nil { + objectMap["monthDays"] = rs.MonthDays + } + if rs.MonthlyOccurrences != nil { + objectMap["monthlyOccurrences"] = rs.MonthlyOccurrences + } + for k, v := range rs.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// RecurrenceScheduleOccurrence the recurrence schedule occurence. +type RecurrenceScheduleOccurrence struct { + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Day - The day of the week. Possible values include: 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday' + Day DayOfWeek `json:"day,omitempty"` + // Occurrence - The occurrence. + Occurrence *int32 `json:"occurrence,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecurrenceScheduleOccurrence. +func (rso RecurrenceScheduleOccurrence) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rso.Day != "" { + objectMap["day"] = rso.Day + } + if rso.Occurrence != nil { + objectMap["occurrence"] = rso.Occurrence + } + for k, v := range rso.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// RedirectIncompatibleRowSettings redirect incompatible row settings +type RedirectIncompatibleRowSettings struct { + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // LinkedServiceName - Name of the Azure Storage, Storage SAS, or Azure Data Lake Store linked service used for redirecting incompatible row. Must be specified if redirectIncompatibleRowSettings is specified. Type: string (or Expression with resultType string). + LinkedServiceName interface{} `json:"linkedServiceName,omitempty"` + // Path - The path for storing the redirect incompatible row data. Type: string (or Expression with resultType string). + Path interface{} `json:"path,omitempty"` +} + +// MarshalJSON is the custom marshaler for RedirectIncompatibleRowSettings. +func (rirs RedirectIncompatibleRowSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["linkedServiceName"] = rirs.LinkedServiceName + objectMap["path"] = rirs.Path + for k, v := range rirs.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// RedshiftUnloadSettings the Amazon S3 settings needed for the interim Amazon S3 when copying from Amazon Redshift +// with unload. With this, data from Amazon Redshift source will be unloaded into S3 first and then copied into the +// targeted sink from the interim S3. +type RedshiftUnloadSettings struct { + // S3LinkedServiceName - The name of the Amazon S3 linked service which will be used for the unload operation when copying from the Amazon Redshift source. + S3LinkedServiceName *LinkedServiceReference `json:"s3LinkedServiceName,omitempty"` + // BucketName - The bucket of the interim Amazon S3 which will be used to store the unloaded data from Amazon Redshift source. The bucket must be in the same region as the Amazon Redshift source. Type: string (or Expression with resultType string). + BucketName interface{} `json:"bucketName,omitempty"` +} + +// RelationalSource a copy activity source for various relational databases. +type RelationalSource struct { + // Query - Database query. Type: string (or Expression with resultType string). + Query interface{} `json:"query,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // SourceRetryCount - Source retry count. Type: integer (or Expression with resultType integer). + SourceRetryCount interface{} `json:"sourceRetryCount,omitempty"` + // SourceRetryWait - Source retry wait. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` + // Type - Possible values include: 'TypeCopySource', 'TypeAmazonRedshiftSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeHTTPSource', 'TypeAzureDataLakeStoreSource', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeRelationalSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource' + Type TypeBasicCopySource `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for RelationalSource. +func (rs RelationalSource) MarshalJSON() ([]byte, error) { + rs.Type = TypeRelationalSource + objectMap := make(map[string]interface{}) + objectMap["query"] = rs.Query + objectMap["sourceRetryCount"] = rs.SourceRetryCount + objectMap["sourceRetryWait"] = rs.SourceRetryWait + if rs.Type != "" { + objectMap["type"] = rs.Type + } + for k, v := range rs.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsAmazonRedshiftSource is the BasicCopySource implementation for RelationalSource. +func (rs RelationalSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { + return nil, false +} + +// AsResponsysSource is the BasicCopySource implementation for RelationalSource. +func (rs RelationalSource) AsResponsysSource() (*ResponsysSource, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudSource is the BasicCopySource implementation for RelationalSource. +func (rs RelationalSource) AsSalesforceMarketingCloudSource() (*SalesforceMarketingCloudSource, bool) { + return nil, false +} + +// AsVerticaSource is the BasicCopySource implementation for RelationalSource. +func (rs RelationalSource) AsVerticaSource() (*VerticaSource, bool) { + return nil, false +} + +// AsNetezzaSource is the BasicCopySource implementation for RelationalSource. +func (rs RelationalSource) AsNetezzaSource() (*NetezzaSource, bool) { + return nil, false +} + +// AsZohoSource is the BasicCopySource implementation for RelationalSource. +func (rs RelationalSource) AsZohoSource() (*ZohoSource, bool) { + return nil, false +} + +// AsXeroSource is the BasicCopySource implementation for RelationalSource. +func (rs RelationalSource) AsXeroSource() (*XeroSource, bool) { + return nil, false +} + +// AsSquareSource is the BasicCopySource implementation for RelationalSource. +func (rs RelationalSource) AsSquareSource() (*SquareSource, bool) { + return nil, false +} + +// AsSparkSource is the BasicCopySource implementation for RelationalSource. +func (rs RelationalSource) AsSparkSource() (*SparkSource, bool) { + return nil, false +} + +// AsShopifySource is the BasicCopySource implementation for RelationalSource. +func (rs RelationalSource) AsShopifySource() (*ShopifySource, bool) { + return nil, false +} + +// AsServiceNowSource is the BasicCopySource implementation for RelationalSource. +func (rs RelationalSource) AsServiceNowSource() (*ServiceNowSource, bool) { + return nil, false +} + +// AsQuickBooksSource is the BasicCopySource implementation for RelationalSource. +func (rs RelationalSource) AsQuickBooksSource() (*QuickBooksSource, bool) { + return nil, false +} + +// AsPrestoSource is the BasicCopySource implementation for RelationalSource. +func (rs RelationalSource) AsPrestoSource() (*PrestoSource, bool) { + return nil, false +} + +// AsPhoenixSource is the BasicCopySource implementation for RelationalSource. +func (rs RelationalSource) AsPhoenixSource() (*PhoenixSource, bool) { + return nil, false +} + +// AsPaypalSource is the BasicCopySource implementation for RelationalSource. +func (rs RelationalSource) AsPaypalSource() (*PaypalSource, bool) { + return nil, false +} + +// AsMarketoSource is the BasicCopySource implementation for RelationalSource. +func (rs RelationalSource) AsMarketoSource() (*MarketoSource, bool) { + return nil, false +} + +// AsMariaDBSource is the BasicCopySource implementation for RelationalSource. +func (rs RelationalSource) AsMariaDBSource() (*MariaDBSource, bool) { + return nil, false +} + +// AsMagentoSource is the BasicCopySource implementation for RelationalSource. +func (rs RelationalSource) AsMagentoSource() (*MagentoSource, bool) { + return nil, false +} + +// AsJiraSource is the BasicCopySource implementation for RelationalSource. +func (rs RelationalSource) AsJiraSource() (*JiraSource, bool) { + return nil, false +} + +// AsImpalaSource is the BasicCopySource implementation for RelationalSource. +func (rs RelationalSource) AsImpalaSource() (*ImpalaSource, bool) { + return nil, false +} + +// AsHubspotSource is the BasicCopySource implementation for RelationalSource. +func (rs RelationalSource) AsHubspotSource() (*HubspotSource, bool) { + return nil, false +} + +// AsHiveSource is the BasicCopySource implementation for RelationalSource. +func (rs RelationalSource) AsHiveSource() (*HiveSource, bool) { + return nil, false +} + +// AsHBaseSource is the BasicCopySource implementation for RelationalSource. +func (rs RelationalSource) AsHBaseSource() (*HBaseSource, bool) { + return nil, false +} + +// AsGreenplumSource is the BasicCopySource implementation for RelationalSource. +func (rs RelationalSource) AsGreenplumSource() (*GreenplumSource, bool) { + return nil, false +} + +// AsGoogleBigQuerySource is the BasicCopySource implementation for RelationalSource. +func (rs RelationalSource) AsGoogleBigQuerySource() (*GoogleBigQuerySource, bool) { + return nil, false +} + +// AsEloquaSource is the BasicCopySource implementation for RelationalSource. +func (rs RelationalSource) AsEloquaSource() (*EloquaSource, bool) { + return nil, false +} + +// AsDrillSource is the BasicCopySource implementation for RelationalSource. +func (rs RelationalSource) AsDrillSource() (*DrillSource, bool) { + return nil, false +} + +// AsCouchbaseSource is the BasicCopySource implementation for RelationalSource. +func (rs RelationalSource) AsCouchbaseSource() (*CouchbaseSource, bool) { + return nil, false +} + +// AsConcurSource is the BasicCopySource implementation for RelationalSource. +func (rs RelationalSource) AsConcurSource() (*ConcurSource, bool) { + return nil, false +} + +// AsAzurePostgreSQLSource is the BasicCopySource implementation for RelationalSource. +func (rs RelationalSource) AsAzurePostgreSQLSource() (*AzurePostgreSQLSource, bool) { + return nil, false +} + +// AsAmazonMWSSource is the BasicCopySource implementation for RelationalSource. +func (rs RelationalSource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { + return nil, false +} + +// AsHTTPSource is the BasicCopySource implementation for RelationalSource. +func (rs RelationalSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for RelationalSource. +func (rs RelationalSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for RelationalSource. +func (rs RelationalSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsCassandraSource is the BasicCopySource implementation for RelationalSource. +func (rs RelationalSource) AsCassandraSource() (*CassandraSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for RelationalSource. +func (rs RelationalSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for RelationalSource. +func (rs RelationalSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureMySQLSource is the BasicCopySource implementation for RelationalSource. +func (rs RelationalSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for RelationalSource. +func (rs RelationalSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for RelationalSource. +func (rs RelationalSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsSQLDWSource is the BasicCopySource implementation for RelationalSource. +func (rs RelationalSource) AsSQLDWSource() (*SQLDWSource, bool) { + return nil, false +} + +// AsSQLSource is the BasicCopySource implementation for RelationalSource. +func (rs RelationalSource) AsSQLSource() (*SQLSource, bool) { + return nil, false +} + +// AsSapEccSource is the BasicCopySource implementation for RelationalSource. +func (rs RelationalSource) AsSapEccSource() (*SapEccSource, bool) { + return nil, false +} + +// AsSapCloudForCustomerSource is the BasicCopySource implementation for RelationalSource. +func (rs RelationalSource) AsSapCloudForCustomerSource() (*SapCloudForCustomerSource, bool) { + return nil, false +} + +// AsSalesforceSource is the BasicCopySource implementation for RelationalSource. +func (rs RelationalSource) AsSalesforceSource() (*SalesforceSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for RelationalSource. +func (rs RelationalSource) AsRelationalSource() (*RelationalSource, bool) { + return &rs, true +} + +// AsDynamicsSource is the BasicCopySource implementation for RelationalSource. +func (rs RelationalSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for RelationalSource. +func (rs RelationalSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for RelationalSource. +func (rs RelationalSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + +// AsAzureTableSource is the BasicCopySource implementation for RelationalSource. +func (rs RelationalSource) AsAzureTableSource() (*AzureTableSource, bool) { + return nil, false +} + +// AsCopySource is the BasicCopySource implementation for RelationalSource. +func (rs RelationalSource) AsCopySource() (*CopySource, bool) { + return nil, false +} + +// AsBasicCopySource is the BasicCopySource implementation for RelationalSource. +func (rs RelationalSource) AsBasicCopySource() (BasicCopySource, bool) { + return &rs, true +} + +// RelationalTableDataset the relational table dataset. +type RelationalTableDataset struct { + // RelationalTableDatasetTypeProperties - Relational table dataset properties. + *RelationalTableDatasetTypeProperties `json:"typeProperties,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Description - Dataset description. + Description *string `json:"description,omitempty"` + // Structure - Columns that define the structure of the dataset. Type: array (or Expression with resultType array), itemType: DatasetDataElement. + Structure interface{} `json:"structure,omitempty"` + // LinkedServiceName - Linked service reference. + LinkedServiceName *LinkedServiceReference `json:"linkedServiceName,omitempty"` + // Parameters - Parameters for dataset. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeDataset', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSQLServerTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSalesforceObject', 'TypeRelationalTable', 'TypeAzureMySQLTable', 'TypeOracleTable', 'TypeODataResource', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeAzureDataLakeStoreFile', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeAmazonS3Object' + Type TypeBasicDataset `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for RelationalTableDataset. +func (rtd RelationalTableDataset) MarshalJSON() ([]byte, error) { + rtd.Type = TypeRelationalTable + objectMap := make(map[string]interface{}) + if rtd.RelationalTableDatasetTypeProperties != nil { + objectMap["typeProperties"] = rtd.RelationalTableDatasetTypeProperties + } + if rtd.Description != nil { + objectMap["description"] = rtd.Description + } + objectMap["structure"] = rtd.Structure + if rtd.LinkedServiceName != nil { + objectMap["linkedServiceName"] = rtd.LinkedServiceName + } + if rtd.Parameters != nil { + objectMap["parameters"] = rtd.Parameters + } + if rtd.Annotations != nil { + objectMap["annotations"] = rtd.Annotations + } + if rtd.Type != "" { + objectMap["type"] = rtd.Type + } + for k, v := range rtd.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysObjectDataset is the BasicDataset implementation for RelationalTableDataset. +func (rtd RelationalTableDataset) AsResponsysObjectDataset() (*ResponsysObjectDataset, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudObjectDataset is the BasicDataset implementation for RelationalTableDataset. +func (rtd RelationalTableDataset) AsSalesforceMarketingCloudObjectDataset() (*SalesforceMarketingCloudObjectDataset, bool) { + return nil, false +} + +// AsVerticaTableDataset is the BasicDataset implementation for RelationalTableDataset. +func (rtd RelationalTableDataset) AsVerticaTableDataset() (*VerticaTableDataset, bool) { + return nil, false +} + +// AsNetezzaTableDataset is the BasicDataset implementation for RelationalTableDataset. +func (rtd RelationalTableDataset) AsNetezzaTableDataset() (*NetezzaTableDataset, bool) { + return nil, false +} + +// AsZohoObjectDataset is the BasicDataset implementation for RelationalTableDataset. +func (rtd RelationalTableDataset) AsZohoObjectDataset() (*ZohoObjectDataset, bool) { + return nil, false +} + +// AsXeroObjectDataset is the BasicDataset implementation for RelationalTableDataset. +func (rtd RelationalTableDataset) AsXeroObjectDataset() (*XeroObjectDataset, bool) { + return nil, false +} + +// AsSquareObjectDataset is the BasicDataset implementation for RelationalTableDataset. +func (rtd RelationalTableDataset) AsSquareObjectDataset() (*SquareObjectDataset, bool) { + return nil, false +} + +// AsSparkObjectDataset is the BasicDataset implementation for RelationalTableDataset. +func (rtd RelationalTableDataset) AsSparkObjectDataset() (*SparkObjectDataset, bool) { + return nil, false +} + +// AsShopifyObjectDataset is the BasicDataset implementation for RelationalTableDataset. +func (rtd RelationalTableDataset) AsShopifyObjectDataset() (*ShopifyObjectDataset, bool) { + return nil, false +} + +// AsServiceNowObjectDataset is the BasicDataset implementation for RelationalTableDataset. +func (rtd RelationalTableDataset) AsServiceNowObjectDataset() (*ServiceNowObjectDataset, bool) { + return nil, false +} + +// AsQuickBooksObjectDataset is the BasicDataset implementation for RelationalTableDataset. +func (rtd RelationalTableDataset) AsQuickBooksObjectDataset() (*QuickBooksObjectDataset, bool) { + return nil, false +} + +// AsPrestoObjectDataset is the BasicDataset implementation for RelationalTableDataset. +func (rtd RelationalTableDataset) AsPrestoObjectDataset() (*PrestoObjectDataset, bool) { + return nil, false +} + +// AsPhoenixObjectDataset is the BasicDataset implementation for RelationalTableDataset. +func (rtd RelationalTableDataset) AsPhoenixObjectDataset() (*PhoenixObjectDataset, bool) { + return nil, false +} + +// AsPaypalObjectDataset is the BasicDataset implementation for RelationalTableDataset. +func (rtd RelationalTableDataset) AsPaypalObjectDataset() (*PaypalObjectDataset, bool) { + return nil, false +} + +// AsMarketoObjectDataset is the BasicDataset implementation for RelationalTableDataset. +func (rtd RelationalTableDataset) AsMarketoObjectDataset() (*MarketoObjectDataset, bool) { + return nil, false +} + +// AsMariaDBTableDataset is the BasicDataset implementation for RelationalTableDataset. +func (rtd RelationalTableDataset) AsMariaDBTableDataset() (*MariaDBTableDataset, bool) { + return nil, false +} + +// AsMagentoObjectDataset is the BasicDataset implementation for RelationalTableDataset. +func (rtd RelationalTableDataset) AsMagentoObjectDataset() (*MagentoObjectDataset, bool) { + return nil, false +} + +// AsJiraObjectDataset is the BasicDataset implementation for RelationalTableDataset. +func (rtd RelationalTableDataset) AsJiraObjectDataset() (*JiraObjectDataset, bool) { + return nil, false +} + +// AsImpalaObjectDataset is the BasicDataset implementation for RelationalTableDataset. +func (rtd RelationalTableDataset) AsImpalaObjectDataset() (*ImpalaObjectDataset, bool) { + return nil, false +} + +// AsHubspotObjectDataset is the BasicDataset implementation for RelationalTableDataset. +func (rtd RelationalTableDataset) AsHubspotObjectDataset() (*HubspotObjectDataset, bool) { + return nil, false +} + +// AsHiveObjectDataset is the BasicDataset implementation for RelationalTableDataset. +func (rtd RelationalTableDataset) AsHiveObjectDataset() (*HiveObjectDataset, bool) { + return nil, false +} + +// AsHBaseObjectDataset is the BasicDataset implementation for RelationalTableDataset. +func (rtd RelationalTableDataset) AsHBaseObjectDataset() (*HBaseObjectDataset, bool) { + return nil, false +} + +// AsGreenplumTableDataset is the BasicDataset implementation for RelationalTableDataset. +func (rtd RelationalTableDataset) AsGreenplumTableDataset() (*GreenplumTableDataset, bool) { + return nil, false +} + +// AsGoogleBigQueryObjectDataset is the BasicDataset implementation for RelationalTableDataset. +func (rtd RelationalTableDataset) AsGoogleBigQueryObjectDataset() (*GoogleBigQueryObjectDataset, bool) { + return nil, false +} + +// AsEloquaObjectDataset is the BasicDataset implementation for RelationalTableDataset. +func (rtd RelationalTableDataset) AsEloquaObjectDataset() (*EloquaObjectDataset, bool) { + return nil, false +} + +// AsDrillTableDataset is the BasicDataset implementation for RelationalTableDataset. +func (rtd RelationalTableDataset) AsDrillTableDataset() (*DrillTableDataset, bool) { + return nil, false +} + +// AsCouchbaseTableDataset is the BasicDataset implementation for RelationalTableDataset. +func (rtd RelationalTableDataset) AsCouchbaseTableDataset() (*CouchbaseTableDataset, bool) { + return nil, false +} + +// AsConcurObjectDataset is the BasicDataset implementation for RelationalTableDataset. +func (rtd RelationalTableDataset) AsConcurObjectDataset() (*ConcurObjectDataset, bool) { + return nil, false +} + +// AsAzurePostgreSQLTableDataset is the BasicDataset implementation for RelationalTableDataset. +func (rtd RelationalTableDataset) AsAzurePostgreSQLTableDataset() (*AzurePostgreSQLTableDataset, bool) { + return nil, false +} + +// AsAmazonMWSObjectDataset is the BasicDataset implementation for RelationalTableDataset. +func (rtd RelationalTableDataset) AsAmazonMWSObjectDataset() (*AmazonMWSObjectDataset, bool) { + return nil, false +} + +// AsHTTPDataset is the BasicDataset implementation for RelationalTableDataset. +func (rtd RelationalTableDataset) AsHTTPDataset() (*HTTPDataset, bool) { + return nil, false +} + +// AsAzureSearchIndexDataset is the BasicDataset implementation for RelationalTableDataset. +func (rtd RelationalTableDataset) AsAzureSearchIndexDataset() (*AzureSearchIndexDataset, bool) { + return nil, false +} + +// AsWebTableDataset is the BasicDataset implementation for RelationalTableDataset. +func (rtd RelationalTableDataset) AsWebTableDataset() (*WebTableDataset, bool) { + return nil, false +} + +// AsSQLServerTableDataset is the BasicDataset implementation for RelationalTableDataset. +func (rtd RelationalTableDataset) AsSQLServerTableDataset() (*SQLServerTableDataset, bool) { + return nil, false +} + +// AsSapEccResourceDataset is the BasicDataset implementation for RelationalTableDataset. +func (rtd RelationalTableDataset) AsSapEccResourceDataset() (*SapEccResourceDataset, bool) { + return nil, false +} + +// AsSapCloudForCustomerResourceDataset is the BasicDataset implementation for RelationalTableDataset. +func (rtd RelationalTableDataset) AsSapCloudForCustomerResourceDataset() (*SapCloudForCustomerResourceDataset, bool) { + return nil, false +} + +// AsSalesforceObjectDataset is the BasicDataset implementation for RelationalTableDataset. +func (rtd RelationalTableDataset) AsSalesforceObjectDataset() (*SalesforceObjectDataset, bool) { + return nil, false +} + +// AsRelationalTableDataset is the BasicDataset implementation for RelationalTableDataset. +func (rtd RelationalTableDataset) AsRelationalTableDataset() (*RelationalTableDataset, bool) { + return &rtd, true +} + +// AsAzureMySQLTableDataset is the BasicDataset implementation for RelationalTableDataset. +func (rtd RelationalTableDataset) AsAzureMySQLTableDataset() (*AzureMySQLTableDataset, bool) { + return nil, false +} + +// AsOracleTableDataset is the BasicDataset implementation for RelationalTableDataset. +func (rtd RelationalTableDataset) AsOracleTableDataset() (*OracleTableDataset, bool) { + return nil, false +} + +// AsODataResourceDataset is the BasicDataset implementation for RelationalTableDataset. +func (rtd RelationalTableDataset) AsODataResourceDataset() (*ODataResourceDataset, bool) { + return nil, false +} + +// AsMongoDbCollectionDataset is the BasicDataset implementation for RelationalTableDataset. +func (rtd RelationalTableDataset) AsMongoDbCollectionDataset() (*MongoDbCollectionDataset, bool) { + return nil, false +} + +// AsFileShareDataset is the BasicDataset implementation for RelationalTableDataset. +func (rtd RelationalTableDataset) AsFileShareDataset() (*FileShareDataset, bool) { + return nil, false +} + +// AsAzureDataLakeStoreDataset is the BasicDataset implementation for RelationalTableDataset. +func (rtd RelationalTableDataset) AsAzureDataLakeStoreDataset() (*AzureDataLakeStoreDataset, bool) { + return nil, false +} + +// AsDynamicsEntityDataset is the BasicDataset implementation for RelationalTableDataset. +func (rtd RelationalTableDataset) AsDynamicsEntityDataset() (*DynamicsEntityDataset, bool) { + return nil, false +} + +// AsDocumentDbCollectionDataset is the BasicDataset implementation for RelationalTableDataset. +func (rtd RelationalTableDataset) AsDocumentDbCollectionDataset() (*DocumentDbCollectionDataset, bool) { + return nil, false +} + +// AsCustomDataset is the BasicDataset implementation for RelationalTableDataset. +func (rtd RelationalTableDataset) AsCustomDataset() (*CustomDataset, bool) { + return nil, false +} + +// AsCassandraTableDataset is the BasicDataset implementation for RelationalTableDataset. +func (rtd RelationalTableDataset) AsCassandraTableDataset() (*CassandraTableDataset, bool) { + return nil, false +} + +// AsAzureSQLDWTableDataset is the BasicDataset implementation for RelationalTableDataset. +func (rtd RelationalTableDataset) AsAzureSQLDWTableDataset() (*AzureSQLDWTableDataset, bool) { + return nil, false +} + +// AsAzureSQLTableDataset is the BasicDataset implementation for RelationalTableDataset. +func (rtd RelationalTableDataset) AsAzureSQLTableDataset() (*AzureSQLTableDataset, bool) { + return nil, false +} + +// AsAzureTableDataset is the BasicDataset implementation for RelationalTableDataset. +func (rtd RelationalTableDataset) AsAzureTableDataset() (*AzureTableDataset, bool) { + return nil, false +} + +// AsAzureBlobDataset is the BasicDataset implementation for RelationalTableDataset. +func (rtd RelationalTableDataset) AsAzureBlobDataset() (*AzureBlobDataset, bool) { + return nil, false +} + +// AsAmazonS3Dataset is the BasicDataset implementation for RelationalTableDataset. +func (rtd RelationalTableDataset) AsAmazonS3Dataset() (*AmazonS3Dataset, bool) { + return nil, false +} + +// AsDataset is the BasicDataset implementation for RelationalTableDataset. +func (rtd RelationalTableDataset) AsDataset() (*Dataset, bool) { + return nil, false +} + +// AsBasicDataset is the BasicDataset implementation for RelationalTableDataset. +func (rtd RelationalTableDataset) AsBasicDataset() (BasicDataset, bool) { + return &rtd, true +} + +// UnmarshalJSON is the custom unmarshaler for RelationalTableDataset struct. +func (rtd *RelationalTableDataset) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "typeProperties": + if v != nil { + var relationalTableDatasetTypeProperties RelationalTableDatasetTypeProperties + err = json.Unmarshal(*v, &relationalTableDatasetTypeProperties) + if err != nil { + return err + } + rtd.RelationalTableDatasetTypeProperties = &relationalTableDatasetTypeProperties + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if rtd.AdditionalProperties == nil { + rtd.AdditionalProperties = make(map[string]interface{}) + } + rtd.AdditionalProperties[k] = additionalProperties + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + rtd.Description = &description + } + case "structure": + if v != nil { + var structure interface{} + err = json.Unmarshal(*v, &structure) + if err != nil { + return err + } + rtd.Structure = structure + } + case "linkedServiceName": + if v != nil { + var linkedServiceName LinkedServiceReference + err = json.Unmarshal(*v, &linkedServiceName) + if err != nil { + return err + } + rtd.LinkedServiceName = &linkedServiceName + } + case "parameters": + if v != nil { + var parameters map[string]*ParameterSpecification + err = json.Unmarshal(*v, ¶meters) + if err != nil { + return err + } + rtd.Parameters = parameters + } + case "annotations": + if v != nil { + var annotations []interface{} + err = json.Unmarshal(*v, &annotations) + if err != nil { + return err + } + rtd.Annotations = &annotations + } + case "type": + if v != nil { + var typeVar TypeBasicDataset + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + rtd.Type = typeVar + } + } + } + + return nil +} + +// RelationalTableDatasetTypeProperties relational table dataset properties. +type RelationalTableDatasetTypeProperties struct { + // TableName - The relational table name. Type: string (or Expression with resultType string). + TableName interface{} `json:"tableName,omitempty"` +} + +// Resource azure Data Factory top-level resource. +type Resource struct { + // ID - The resource identifier. + ID *string `json:"id,omitempty"` + // Name - The resource name. + Name *string `json:"name,omitempty"` + // Type - The resource type. + Type *string `json:"type,omitempty"` + // Location - The resource location. + Location *string `json:"location,omitempty"` + // Tags - The resource tags. + Tags map[string]*string `json:"tags"` + // ETag - Etag identifies change in the resource. + ETag *string `json:"eTag,omitempty"` +} + +// MarshalJSON is the custom marshaler for Resource. +func (r Resource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if r.ID != nil { + objectMap["id"] = r.ID + } + if r.Name != nil { + objectMap["name"] = r.Name + } + if r.Type != nil { + objectMap["type"] = r.Type + } + if r.Location != nil { + objectMap["location"] = r.Location + } + if r.Tags != nil { + objectMap["tags"] = r.Tags + } + if r.ETag != nil { + objectMap["eTag"] = r.ETag + } + return json.Marshal(objectMap) +} + +// ResponsysLinkedService responsys linked service. +type ResponsysLinkedService struct { + // ResponsysLinkedServiceTypeProperties - Responsys linked service properties. + *ResponsysLinkedServiceTypeProperties `json:"typeProperties,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // ConnectVia - The integration runtime reference. + ConnectVia *IntegrationRuntimeReference `json:"connectVia,omitempty"` + // Description - Linked service description. + Description *string `json:"description,omitempty"` + // Parameters - Parameters for linked service. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeLinkedService', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforce', 'TypeAzureDataLakeStore', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureStorage' + Type TypeBasicLinkedService `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ResponsysLinkedService. +func (rls ResponsysLinkedService) MarshalJSON() ([]byte, error) { + rls.Type = TypeResponsys + objectMap := make(map[string]interface{}) + if rls.ResponsysLinkedServiceTypeProperties != nil { + objectMap["typeProperties"] = rls.ResponsysLinkedServiceTypeProperties + } + if rls.ConnectVia != nil { + objectMap["connectVia"] = rls.ConnectVia + } + if rls.Description != nil { + objectMap["description"] = rls.Description + } + if rls.Parameters != nil { + objectMap["parameters"] = rls.Parameters + } + if rls.Annotations != nil { + objectMap["annotations"] = rls.Annotations + } + if rls.Type != "" { + objectMap["type"] = rls.Type + } + for k, v := range rls.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysLinkedService is the BasicLinkedService implementation for ResponsysLinkedService. +func (rls ResponsysLinkedService) AsResponsysLinkedService() (*ResponsysLinkedService, bool) { + return &rls, true +} + +// AsAzureDatabricksLinkedService is the BasicLinkedService implementation for ResponsysLinkedService. +func (rls ResponsysLinkedService) AsAzureDatabricksLinkedService() (*AzureDatabricksLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeAnalyticsLinkedService is the BasicLinkedService implementation for ResponsysLinkedService. +func (rls ResponsysLinkedService) AsAzureDataLakeAnalyticsLinkedService() (*AzureDataLakeAnalyticsLinkedService, bool) { + return nil, false +} + +// AsHDInsightOnDemandLinkedService is the BasicLinkedService implementation for ResponsysLinkedService. +func (rls ResponsysLinkedService) AsHDInsightOnDemandLinkedService() (*HDInsightOnDemandLinkedService, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudLinkedService is the BasicLinkedService implementation for ResponsysLinkedService. +func (rls ResponsysLinkedService) AsSalesforceMarketingCloudLinkedService() (*SalesforceMarketingCloudLinkedService, bool) { + return nil, false +} + +// AsNetezzaLinkedService is the BasicLinkedService implementation for ResponsysLinkedService. +func (rls ResponsysLinkedService) AsNetezzaLinkedService() (*NetezzaLinkedService, bool) { + return nil, false +} + +// AsVerticaLinkedService is the BasicLinkedService implementation for ResponsysLinkedService. +func (rls ResponsysLinkedService) AsVerticaLinkedService() (*VerticaLinkedService, bool) { + return nil, false +} + +// AsZohoLinkedService is the BasicLinkedService implementation for ResponsysLinkedService. +func (rls ResponsysLinkedService) AsZohoLinkedService() (*ZohoLinkedService, bool) { + return nil, false +} + +// AsXeroLinkedService is the BasicLinkedService implementation for ResponsysLinkedService. +func (rls ResponsysLinkedService) AsXeroLinkedService() (*XeroLinkedService, bool) { + return nil, false +} + +// AsSquareLinkedService is the BasicLinkedService implementation for ResponsysLinkedService. +func (rls ResponsysLinkedService) AsSquareLinkedService() (*SquareLinkedService, bool) { + return nil, false +} + +// AsSparkLinkedService is the BasicLinkedService implementation for ResponsysLinkedService. +func (rls ResponsysLinkedService) AsSparkLinkedService() (*SparkLinkedService, bool) { + return nil, false +} + +// AsShopifyLinkedService is the BasicLinkedService implementation for ResponsysLinkedService. +func (rls ResponsysLinkedService) AsShopifyLinkedService() (*ShopifyLinkedService, bool) { + return nil, false +} + +// AsServiceNowLinkedService is the BasicLinkedService implementation for ResponsysLinkedService. +func (rls ResponsysLinkedService) AsServiceNowLinkedService() (*ServiceNowLinkedService, bool) { + return nil, false +} + +// AsQuickBooksLinkedService is the BasicLinkedService implementation for ResponsysLinkedService. +func (rls ResponsysLinkedService) AsQuickBooksLinkedService() (*QuickBooksLinkedService, bool) { + return nil, false +} + +// AsPrestoLinkedService is the BasicLinkedService implementation for ResponsysLinkedService. +func (rls ResponsysLinkedService) AsPrestoLinkedService() (*PrestoLinkedService, bool) { + return nil, false +} + +// AsPhoenixLinkedService is the BasicLinkedService implementation for ResponsysLinkedService. +func (rls ResponsysLinkedService) AsPhoenixLinkedService() (*PhoenixLinkedService, bool) { + return nil, false +} + +// AsPaypalLinkedService is the BasicLinkedService implementation for ResponsysLinkedService. +func (rls ResponsysLinkedService) AsPaypalLinkedService() (*PaypalLinkedService, bool) { + return nil, false +} + +// AsMarketoLinkedService is the BasicLinkedService implementation for ResponsysLinkedService. +func (rls ResponsysLinkedService) AsMarketoLinkedService() (*MarketoLinkedService, bool) { + return nil, false +} + +// AsMariaDBLinkedService is the BasicLinkedService implementation for ResponsysLinkedService. +func (rls ResponsysLinkedService) AsMariaDBLinkedService() (*MariaDBLinkedService, bool) { + return nil, false +} + +// AsMagentoLinkedService is the BasicLinkedService implementation for ResponsysLinkedService. +func (rls ResponsysLinkedService) AsMagentoLinkedService() (*MagentoLinkedService, bool) { + return nil, false +} + +// AsJiraLinkedService is the BasicLinkedService implementation for ResponsysLinkedService. +func (rls ResponsysLinkedService) AsJiraLinkedService() (*JiraLinkedService, bool) { + return nil, false +} + +// AsImpalaLinkedService is the BasicLinkedService implementation for ResponsysLinkedService. +func (rls ResponsysLinkedService) AsImpalaLinkedService() (*ImpalaLinkedService, bool) { + return nil, false +} + +// AsHubspotLinkedService is the BasicLinkedService implementation for ResponsysLinkedService. +func (rls ResponsysLinkedService) AsHubspotLinkedService() (*HubspotLinkedService, bool) { + return nil, false +} + +// AsHiveLinkedService is the BasicLinkedService implementation for ResponsysLinkedService. +func (rls ResponsysLinkedService) AsHiveLinkedService() (*HiveLinkedService, bool) { + return nil, false +} + +// AsHBaseLinkedService is the BasicLinkedService implementation for ResponsysLinkedService. +func (rls ResponsysLinkedService) AsHBaseLinkedService() (*HBaseLinkedService, bool) { + return nil, false +} + +// AsGreenplumLinkedService is the BasicLinkedService implementation for ResponsysLinkedService. +func (rls ResponsysLinkedService) AsGreenplumLinkedService() (*GreenplumLinkedService, bool) { + return nil, false +} + +// AsGoogleBigQueryLinkedService is the BasicLinkedService implementation for ResponsysLinkedService. +func (rls ResponsysLinkedService) AsGoogleBigQueryLinkedService() (*GoogleBigQueryLinkedService, bool) { + return nil, false +} + +// AsEloquaLinkedService is the BasicLinkedService implementation for ResponsysLinkedService. +func (rls ResponsysLinkedService) AsEloquaLinkedService() (*EloquaLinkedService, bool) { + return nil, false +} + +// AsDrillLinkedService is the BasicLinkedService implementation for ResponsysLinkedService. +func (rls ResponsysLinkedService) AsDrillLinkedService() (*DrillLinkedService, bool) { + return nil, false +} + +// AsCouchbaseLinkedService is the BasicLinkedService implementation for ResponsysLinkedService. +func (rls ResponsysLinkedService) AsCouchbaseLinkedService() (*CouchbaseLinkedService, bool) { + return nil, false +} + +// AsConcurLinkedService is the BasicLinkedService implementation for ResponsysLinkedService. +func (rls ResponsysLinkedService) AsConcurLinkedService() (*ConcurLinkedService, bool) { + return nil, false +} + +// AsAzurePostgreSQLLinkedService is the BasicLinkedService implementation for ResponsysLinkedService. +func (rls ResponsysLinkedService) AsAzurePostgreSQLLinkedService() (*AzurePostgreSQLLinkedService, bool) { + return nil, false +} + +// AsAmazonMWSLinkedService is the BasicLinkedService implementation for ResponsysLinkedService. +func (rls ResponsysLinkedService) AsAmazonMWSLinkedService() (*AmazonMWSLinkedService, bool) { + return nil, false +} + +// AsSapHanaLinkedService is the BasicLinkedService implementation for ResponsysLinkedService. +func (rls ResponsysLinkedService) AsSapHanaLinkedService() (*SapHanaLinkedService, bool) { + return nil, false +} + +// AsSapBWLinkedService is the BasicLinkedService implementation for ResponsysLinkedService. +func (rls ResponsysLinkedService) AsSapBWLinkedService() (*SapBWLinkedService, bool) { + return nil, false +} + +// AsSftpServerLinkedService is the BasicLinkedService implementation for ResponsysLinkedService. +func (rls ResponsysLinkedService) AsSftpServerLinkedService() (*SftpServerLinkedService, bool) { + return nil, false +} + +// AsFtpServerLinkedService is the BasicLinkedService implementation for ResponsysLinkedService. +func (rls ResponsysLinkedService) AsFtpServerLinkedService() (*FtpServerLinkedService, bool) { + return nil, false +} + +// AsHTTPLinkedService is the BasicLinkedService implementation for ResponsysLinkedService. +func (rls ResponsysLinkedService) AsHTTPLinkedService() (*HTTPLinkedService, bool) { + return nil, false +} + +// AsAzureSearchLinkedService is the BasicLinkedService implementation for ResponsysLinkedService. +func (rls ResponsysLinkedService) AsAzureSearchLinkedService() (*AzureSearchLinkedService, bool) { + return nil, false +} + +// AsCustomDataSourceLinkedService is the BasicLinkedService implementation for ResponsysLinkedService. +func (rls ResponsysLinkedService) AsCustomDataSourceLinkedService() (*CustomDataSourceLinkedService, bool) { + return nil, false +} + +// AsAmazonRedshiftLinkedService is the BasicLinkedService implementation for ResponsysLinkedService. +func (rls ResponsysLinkedService) AsAmazonRedshiftLinkedService() (*AmazonRedshiftLinkedService, bool) { + return nil, false +} + +// AsAmazonS3LinkedService is the BasicLinkedService implementation for ResponsysLinkedService. +func (rls ResponsysLinkedService) AsAmazonS3LinkedService() (*AmazonS3LinkedService, bool) { + return nil, false +} + +// AsSapEccLinkedService is the BasicLinkedService implementation for ResponsysLinkedService. +func (rls ResponsysLinkedService) AsSapEccLinkedService() (*SapEccLinkedService, bool) { + return nil, false +} + +// AsSapCloudForCustomerLinkedService is the BasicLinkedService implementation for ResponsysLinkedService. +func (rls ResponsysLinkedService) AsSapCloudForCustomerLinkedService() (*SapCloudForCustomerLinkedService, bool) { + return nil, false +} + +// AsSalesforceLinkedService is the BasicLinkedService implementation for ResponsysLinkedService. +func (rls ResponsysLinkedService) AsSalesforceLinkedService() (*SalesforceLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeStoreLinkedService is the BasicLinkedService implementation for ResponsysLinkedService. +func (rls ResponsysLinkedService) AsAzureDataLakeStoreLinkedService() (*AzureDataLakeStoreLinkedService, bool) { + return nil, false +} + +// AsMongoDbLinkedService is the BasicLinkedService implementation for ResponsysLinkedService. +func (rls ResponsysLinkedService) AsMongoDbLinkedService() (*MongoDbLinkedService, bool) { + return nil, false +} + +// AsCassandraLinkedService is the BasicLinkedService implementation for ResponsysLinkedService. +func (rls ResponsysLinkedService) AsCassandraLinkedService() (*CassandraLinkedService, bool) { + return nil, false +} + +// AsWebLinkedService is the BasicLinkedService implementation for ResponsysLinkedService. +func (rls ResponsysLinkedService) AsWebLinkedService() (*WebLinkedService, bool) { + return nil, false +} + +// AsODataLinkedService is the BasicLinkedService implementation for ResponsysLinkedService. +func (rls ResponsysLinkedService) AsODataLinkedService() (*ODataLinkedService, bool) { + return nil, false +} + +// AsHdfsLinkedService is the BasicLinkedService implementation for ResponsysLinkedService. +func (rls ResponsysLinkedService) AsHdfsLinkedService() (*HdfsLinkedService, bool) { + return nil, false +} + +// AsOdbcLinkedService is the BasicLinkedService implementation for ResponsysLinkedService. +func (rls ResponsysLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, bool) { + return nil, false +} + +// AsAzureMLLinkedService is the BasicLinkedService implementation for ResponsysLinkedService. +func (rls ResponsysLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { + return nil, false +} + +// AsTeradataLinkedService is the BasicLinkedService implementation for ResponsysLinkedService. +func (rls ResponsysLinkedService) AsTeradataLinkedService() (*TeradataLinkedService, bool) { + return nil, false +} + +// AsDb2LinkedService is the BasicLinkedService implementation for ResponsysLinkedService. +func (rls ResponsysLinkedService) AsDb2LinkedService() (*Db2LinkedService, bool) { + return nil, false +} + +// AsSybaseLinkedService is the BasicLinkedService implementation for ResponsysLinkedService. +func (rls ResponsysLinkedService) AsSybaseLinkedService() (*SybaseLinkedService, bool) { + return nil, false +} + +// AsPostgreSQLLinkedService is the BasicLinkedService implementation for ResponsysLinkedService. +func (rls ResponsysLinkedService) AsPostgreSQLLinkedService() (*PostgreSQLLinkedService, bool) { + return nil, false +} + +// AsMySQLLinkedService is the BasicLinkedService implementation for ResponsysLinkedService. +func (rls ResponsysLinkedService) AsMySQLLinkedService() (*MySQLLinkedService, bool) { + return nil, false +} + +// AsAzureMySQLLinkedService is the BasicLinkedService implementation for ResponsysLinkedService. +func (rls ResponsysLinkedService) AsAzureMySQLLinkedService() (*AzureMySQLLinkedService, bool) { + return nil, false +} + +// AsOracleLinkedService is the BasicLinkedService implementation for ResponsysLinkedService. +func (rls ResponsysLinkedService) AsOracleLinkedService() (*OracleLinkedService, bool) { + return nil, false +} + +// AsFileServerLinkedService is the BasicLinkedService implementation for ResponsysLinkedService. +func (rls ResponsysLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { + return nil, false +} + +// AsHDInsightLinkedService is the BasicLinkedService implementation for ResponsysLinkedService. +func (rls ResponsysLinkedService) AsHDInsightLinkedService() (*HDInsightLinkedService, bool) { + return nil, false +} + +// AsDynamicsLinkedService is the BasicLinkedService implementation for ResponsysLinkedService. +func (rls ResponsysLinkedService) AsDynamicsLinkedService() (*DynamicsLinkedService, bool) { + return nil, false +} + +// AsCosmosDbLinkedService is the BasicLinkedService implementation for ResponsysLinkedService. +func (rls ResponsysLinkedService) AsCosmosDbLinkedService() (*CosmosDbLinkedService, bool) { + return nil, false +} + +// AsAzureKeyVaultLinkedService is the BasicLinkedService implementation for ResponsysLinkedService. +func (rls ResponsysLinkedService) AsAzureKeyVaultLinkedService() (*AzureKeyVaultLinkedService, bool) { + return nil, false +} + +// AsAzureBatchLinkedService is the BasicLinkedService implementation for ResponsysLinkedService. +func (rls ResponsysLinkedService) AsAzureBatchLinkedService() (*AzureBatchLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDatabaseLinkedService is the BasicLinkedService implementation for ResponsysLinkedService. +func (rls ResponsysLinkedService) AsAzureSQLDatabaseLinkedService() (*AzureSQLDatabaseLinkedService, bool) { + return nil, false +} + +// AsSQLServerLinkedService is the BasicLinkedService implementation for ResponsysLinkedService. +func (rls ResponsysLinkedService) AsSQLServerLinkedService() (*SQLServerLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDWLinkedService is the BasicLinkedService implementation for ResponsysLinkedService. +func (rls ResponsysLinkedService) AsAzureSQLDWLinkedService() (*AzureSQLDWLinkedService, bool) { + return nil, false +} + +// AsAzureStorageLinkedService is the BasicLinkedService implementation for ResponsysLinkedService. +func (rls ResponsysLinkedService) AsAzureStorageLinkedService() (*AzureStorageLinkedService, bool) { + return nil, false +} + +// AsLinkedService is the BasicLinkedService implementation for ResponsysLinkedService. +func (rls ResponsysLinkedService) AsLinkedService() (*LinkedService, bool) { + return nil, false +} + +// AsBasicLinkedService is the BasicLinkedService implementation for ResponsysLinkedService. +func (rls ResponsysLinkedService) AsBasicLinkedService() (BasicLinkedService, bool) { + return &rls, true +} + +// UnmarshalJSON is the custom unmarshaler for ResponsysLinkedService struct. +func (rls *ResponsysLinkedService) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "typeProperties": + if v != nil { + var responsysLinkedServiceTypeProperties ResponsysLinkedServiceTypeProperties + err = json.Unmarshal(*v, &responsysLinkedServiceTypeProperties) + if err != nil { + return err + } + rls.ResponsysLinkedServiceTypeProperties = &responsysLinkedServiceTypeProperties + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if rls.AdditionalProperties == nil { + rls.AdditionalProperties = make(map[string]interface{}) + } + rls.AdditionalProperties[k] = additionalProperties + } + case "connectVia": + if v != nil { + var connectVia IntegrationRuntimeReference + err = json.Unmarshal(*v, &connectVia) + if err != nil { + return err + } + rls.ConnectVia = &connectVia + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + rls.Description = &description + } + case "parameters": + if v != nil { + var parameters map[string]*ParameterSpecification + err = json.Unmarshal(*v, ¶meters) + if err != nil { + return err + } + rls.Parameters = parameters + } + case "annotations": + if v != nil { + var annotations []interface{} + err = json.Unmarshal(*v, &annotations) + if err != nil { + return err + } + rls.Annotations = &annotations + } + case "type": + if v != nil { + var typeVar TypeBasicLinkedService + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + rls.Type = typeVar + } + } + } + + return nil +} + +// ResponsysLinkedServiceTypeProperties responsys linked service properties. +type ResponsysLinkedServiceTypeProperties struct { + // Endpoint - The endpoint of the Responsys server. + Endpoint interface{} `json:"endpoint,omitempty"` + // ClientID - The client ID associated with the Responsys application. Type: string (or Expression with resultType string). + ClientID interface{} `json:"clientId,omitempty"` + // ClientSecret - The client secret associated with the Responsys application. Type: string (or Expression with resultType string). + ClientSecret BasicSecretBase `json:"clientSecret,omitempty"` + // UseEncryptedEndpoints - Specifies whether the data source endpoints are encrypted using HTTPS. The default value is true. Type: boolean (or Expression with resultType boolean). + UseEncryptedEndpoints interface{} `json:"useEncryptedEndpoints,omitempty"` + // UseHostVerification - Specifies whether to require the host name in the server's certificate to match the host name of the server when connecting over SSL. The default value is true. Type: boolean (or Expression with resultType boolean). + UseHostVerification interface{} `json:"useHostVerification,omitempty"` + // UsePeerVerification - Specifies whether to verify the identity of the server when connecting over SSL. The default value is true. Type: boolean (or Expression with resultType boolean). + UsePeerVerification interface{} `json:"usePeerVerification,omitempty"` + // EncryptedCredential - The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string). + EncryptedCredential interface{} `json:"encryptedCredential,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for ResponsysLinkedServiceTypeProperties struct. +func (rlstp *ResponsysLinkedServiceTypeProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "endpoint": + if v != nil { + var endpoint interface{} + err = json.Unmarshal(*v, &endpoint) + if err != nil { + return err + } + rlstp.Endpoint = endpoint + } + case "clientId": + if v != nil { + var clientID interface{} + err = json.Unmarshal(*v, &clientID) + if err != nil { + return err + } + rlstp.ClientID = clientID + } + case "clientSecret": + if v != nil { + clientSecret, err := unmarshalBasicSecretBase(*v) + if err != nil { + return err + } + rlstp.ClientSecret = clientSecret + } + case "useEncryptedEndpoints": + if v != nil { + var useEncryptedEndpoints interface{} + err = json.Unmarshal(*v, &useEncryptedEndpoints) + if err != nil { + return err + } + rlstp.UseEncryptedEndpoints = useEncryptedEndpoints + } + case "useHostVerification": + if v != nil { + var useHostVerification interface{} + err = json.Unmarshal(*v, &useHostVerification) + if err != nil { + return err + } + rlstp.UseHostVerification = useHostVerification + } + case "usePeerVerification": + if v != nil { + var usePeerVerification interface{} + err = json.Unmarshal(*v, &usePeerVerification) + if err != nil { + return err + } + rlstp.UsePeerVerification = usePeerVerification + } + case "encryptedCredential": + if v != nil { + var encryptedCredential interface{} + err = json.Unmarshal(*v, &encryptedCredential) + if err != nil { + return err + } + rlstp.EncryptedCredential = encryptedCredential + } + } + } + + return nil +} + +// ResponsysObjectDataset responsys dataset. +type ResponsysObjectDataset struct { + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Description - Dataset description. + Description *string `json:"description,omitempty"` + // Structure - Columns that define the structure of the dataset. Type: array (or Expression with resultType array), itemType: DatasetDataElement. + Structure interface{} `json:"structure,omitempty"` + // LinkedServiceName - Linked service reference. + LinkedServiceName *LinkedServiceReference `json:"linkedServiceName,omitempty"` + // Parameters - Parameters for dataset. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeDataset', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSQLServerTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSalesforceObject', 'TypeRelationalTable', 'TypeAzureMySQLTable', 'TypeOracleTable', 'TypeODataResource', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeAzureDataLakeStoreFile', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeAmazonS3Object' + Type TypeBasicDataset `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ResponsysObjectDataset. +func (rod ResponsysObjectDataset) MarshalJSON() ([]byte, error) { + rod.Type = TypeResponsysObject + objectMap := make(map[string]interface{}) + if rod.Description != nil { + objectMap["description"] = rod.Description + } + objectMap["structure"] = rod.Structure + if rod.LinkedServiceName != nil { + objectMap["linkedServiceName"] = rod.LinkedServiceName + } + if rod.Parameters != nil { + objectMap["parameters"] = rod.Parameters + } + if rod.Annotations != nil { + objectMap["annotations"] = rod.Annotations + } + if rod.Type != "" { + objectMap["type"] = rod.Type + } + for k, v := range rod.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysObjectDataset is the BasicDataset implementation for ResponsysObjectDataset. +func (rod ResponsysObjectDataset) AsResponsysObjectDataset() (*ResponsysObjectDataset, bool) { + return &rod, true +} + +// AsSalesforceMarketingCloudObjectDataset is the BasicDataset implementation for ResponsysObjectDataset. +func (rod ResponsysObjectDataset) AsSalesforceMarketingCloudObjectDataset() (*SalesforceMarketingCloudObjectDataset, bool) { + return nil, false +} + +// AsVerticaTableDataset is the BasicDataset implementation for ResponsysObjectDataset. +func (rod ResponsysObjectDataset) AsVerticaTableDataset() (*VerticaTableDataset, bool) { + return nil, false +} + +// AsNetezzaTableDataset is the BasicDataset implementation for ResponsysObjectDataset. +func (rod ResponsysObjectDataset) AsNetezzaTableDataset() (*NetezzaTableDataset, bool) { + return nil, false +} + +// AsZohoObjectDataset is the BasicDataset implementation for ResponsysObjectDataset. +func (rod ResponsysObjectDataset) AsZohoObjectDataset() (*ZohoObjectDataset, bool) { + return nil, false +} + +// AsXeroObjectDataset is the BasicDataset implementation for ResponsysObjectDataset. +func (rod ResponsysObjectDataset) AsXeroObjectDataset() (*XeroObjectDataset, bool) { + return nil, false +} + +// AsSquareObjectDataset is the BasicDataset implementation for ResponsysObjectDataset. +func (rod ResponsysObjectDataset) AsSquareObjectDataset() (*SquareObjectDataset, bool) { + return nil, false +} + +// AsSparkObjectDataset is the BasicDataset implementation for ResponsysObjectDataset. +func (rod ResponsysObjectDataset) AsSparkObjectDataset() (*SparkObjectDataset, bool) { + return nil, false +} + +// AsShopifyObjectDataset is the BasicDataset implementation for ResponsysObjectDataset. +func (rod ResponsysObjectDataset) AsShopifyObjectDataset() (*ShopifyObjectDataset, bool) { + return nil, false +} + +// AsServiceNowObjectDataset is the BasicDataset implementation for ResponsysObjectDataset. +func (rod ResponsysObjectDataset) AsServiceNowObjectDataset() (*ServiceNowObjectDataset, bool) { + return nil, false +} + +// AsQuickBooksObjectDataset is the BasicDataset implementation for ResponsysObjectDataset. +func (rod ResponsysObjectDataset) AsQuickBooksObjectDataset() (*QuickBooksObjectDataset, bool) { + return nil, false +} + +// AsPrestoObjectDataset is the BasicDataset implementation for ResponsysObjectDataset. +func (rod ResponsysObjectDataset) AsPrestoObjectDataset() (*PrestoObjectDataset, bool) { + return nil, false +} + +// AsPhoenixObjectDataset is the BasicDataset implementation for ResponsysObjectDataset. +func (rod ResponsysObjectDataset) AsPhoenixObjectDataset() (*PhoenixObjectDataset, bool) { + return nil, false +} + +// AsPaypalObjectDataset is the BasicDataset implementation for ResponsysObjectDataset. +func (rod ResponsysObjectDataset) AsPaypalObjectDataset() (*PaypalObjectDataset, bool) { + return nil, false +} + +// AsMarketoObjectDataset is the BasicDataset implementation for ResponsysObjectDataset. +func (rod ResponsysObjectDataset) AsMarketoObjectDataset() (*MarketoObjectDataset, bool) { + return nil, false +} + +// AsMariaDBTableDataset is the BasicDataset implementation for ResponsysObjectDataset. +func (rod ResponsysObjectDataset) AsMariaDBTableDataset() (*MariaDBTableDataset, bool) { + return nil, false +} + +// AsMagentoObjectDataset is the BasicDataset implementation for ResponsysObjectDataset. +func (rod ResponsysObjectDataset) AsMagentoObjectDataset() (*MagentoObjectDataset, bool) { + return nil, false +} + +// AsJiraObjectDataset is the BasicDataset implementation for ResponsysObjectDataset. +func (rod ResponsysObjectDataset) AsJiraObjectDataset() (*JiraObjectDataset, bool) { + return nil, false +} + +// AsImpalaObjectDataset is the BasicDataset implementation for ResponsysObjectDataset. +func (rod ResponsysObjectDataset) AsImpalaObjectDataset() (*ImpalaObjectDataset, bool) { + return nil, false +} + +// AsHubspotObjectDataset is the BasicDataset implementation for ResponsysObjectDataset. +func (rod ResponsysObjectDataset) AsHubspotObjectDataset() (*HubspotObjectDataset, bool) { + return nil, false +} + +// AsHiveObjectDataset is the BasicDataset implementation for ResponsysObjectDataset. +func (rod ResponsysObjectDataset) AsHiveObjectDataset() (*HiveObjectDataset, bool) { + return nil, false +} + +// AsHBaseObjectDataset is the BasicDataset implementation for ResponsysObjectDataset. +func (rod ResponsysObjectDataset) AsHBaseObjectDataset() (*HBaseObjectDataset, bool) { + return nil, false +} + +// AsGreenplumTableDataset is the BasicDataset implementation for ResponsysObjectDataset. +func (rod ResponsysObjectDataset) AsGreenplumTableDataset() (*GreenplumTableDataset, bool) { + return nil, false +} + +// AsGoogleBigQueryObjectDataset is the BasicDataset implementation for ResponsysObjectDataset. +func (rod ResponsysObjectDataset) AsGoogleBigQueryObjectDataset() (*GoogleBigQueryObjectDataset, bool) { + return nil, false +} + +// AsEloquaObjectDataset is the BasicDataset implementation for ResponsysObjectDataset. +func (rod ResponsysObjectDataset) AsEloquaObjectDataset() (*EloquaObjectDataset, bool) { + return nil, false +} + +// AsDrillTableDataset is the BasicDataset implementation for ResponsysObjectDataset. +func (rod ResponsysObjectDataset) AsDrillTableDataset() (*DrillTableDataset, bool) { + return nil, false +} + +// AsCouchbaseTableDataset is the BasicDataset implementation for ResponsysObjectDataset. +func (rod ResponsysObjectDataset) AsCouchbaseTableDataset() (*CouchbaseTableDataset, bool) { + return nil, false +} + +// AsConcurObjectDataset is the BasicDataset implementation for ResponsysObjectDataset. +func (rod ResponsysObjectDataset) AsConcurObjectDataset() (*ConcurObjectDataset, bool) { + return nil, false +} + +// AsAzurePostgreSQLTableDataset is the BasicDataset implementation for ResponsysObjectDataset. +func (rod ResponsysObjectDataset) AsAzurePostgreSQLTableDataset() (*AzurePostgreSQLTableDataset, bool) { + return nil, false +} + +// AsAmazonMWSObjectDataset is the BasicDataset implementation for ResponsysObjectDataset. +func (rod ResponsysObjectDataset) AsAmazonMWSObjectDataset() (*AmazonMWSObjectDataset, bool) { + return nil, false +} + +// AsHTTPDataset is the BasicDataset implementation for ResponsysObjectDataset. +func (rod ResponsysObjectDataset) AsHTTPDataset() (*HTTPDataset, bool) { + return nil, false +} + +// AsAzureSearchIndexDataset is the BasicDataset implementation for ResponsysObjectDataset. +func (rod ResponsysObjectDataset) AsAzureSearchIndexDataset() (*AzureSearchIndexDataset, bool) { + return nil, false +} + +// AsWebTableDataset is the BasicDataset implementation for ResponsysObjectDataset. +func (rod ResponsysObjectDataset) AsWebTableDataset() (*WebTableDataset, bool) { + return nil, false +} + +// AsSQLServerTableDataset is the BasicDataset implementation for ResponsysObjectDataset. +func (rod ResponsysObjectDataset) AsSQLServerTableDataset() (*SQLServerTableDataset, bool) { + return nil, false +} + +// AsSapEccResourceDataset is the BasicDataset implementation for ResponsysObjectDataset. +func (rod ResponsysObjectDataset) AsSapEccResourceDataset() (*SapEccResourceDataset, bool) { + return nil, false +} + +// AsSapCloudForCustomerResourceDataset is the BasicDataset implementation for ResponsysObjectDataset. +func (rod ResponsysObjectDataset) AsSapCloudForCustomerResourceDataset() (*SapCloudForCustomerResourceDataset, bool) { + return nil, false +} + +// AsSalesforceObjectDataset is the BasicDataset implementation for ResponsysObjectDataset. +func (rod ResponsysObjectDataset) AsSalesforceObjectDataset() (*SalesforceObjectDataset, bool) { + return nil, false +} + +// AsRelationalTableDataset is the BasicDataset implementation for ResponsysObjectDataset. +func (rod ResponsysObjectDataset) AsRelationalTableDataset() (*RelationalTableDataset, bool) { + return nil, false +} + +// AsAzureMySQLTableDataset is the BasicDataset implementation for ResponsysObjectDataset. +func (rod ResponsysObjectDataset) AsAzureMySQLTableDataset() (*AzureMySQLTableDataset, bool) { + return nil, false +} + +// AsOracleTableDataset is the BasicDataset implementation for ResponsysObjectDataset. +func (rod ResponsysObjectDataset) AsOracleTableDataset() (*OracleTableDataset, bool) { + return nil, false +} + +// AsODataResourceDataset is the BasicDataset implementation for ResponsysObjectDataset. +func (rod ResponsysObjectDataset) AsODataResourceDataset() (*ODataResourceDataset, bool) { + return nil, false +} + +// AsMongoDbCollectionDataset is the BasicDataset implementation for ResponsysObjectDataset. +func (rod ResponsysObjectDataset) AsMongoDbCollectionDataset() (*MongoDbCollectionDataset, bool) { + return nil, false +} + +// AsFileShareDataset is the BasicDataset implementation for ResponsysObjectDataset. +func (rod ResponsysObjectDataset) AsFileShareDataset() (*FileShareDataset, bool) { + return nil, false +} + +// AsAzureDataLakeStoreDataset is the BasicDataset implementation for ResponsysObjectDataset. +func (rod ResponsysObjectDataset) AsAzureDataLakeStoreDataset() (*AzureDataLakeStoreDataset, bool) { + return nil, false +} + +// AsDynamicsEntityDataset is the BasicDataset implementation for ResponsysObjectDataset. +func (rod ResponsysObjectDataset) AsDynamicsEntityDataset() (*DynamicsEntityDataset, bool) { + return nil, false +} + +// AsDocumentDbCollectionDataset is the BasicDataset implementation for ResponsysObjectDataset. +func (rod ResponsysObjectDataset) AsDocumentDbCollectionDataset() (*DocumentDbCollectionDataset, bool) { + return nil, false +} + +// AsCustomDataset is the BasicDataset implementation for ResponsysObjectDataset. +func (rod ResponsysObjectDataset) AsCustomDataset() (*CustomDataset, bool) { + return nil, false +} + +// AsCassandraTableDataset is the BasicDataset implementation for ResponsysObjectDataset. +func (rod ResponsysObjectDataset) AsCassandraTableDataset() (*CassandraTableDataset, bool) { + return nil, false +} + +// AsAzureSQLDWTableDataset is the BasicDataset implementation for ResponsysObjectDataset. +func (rod ResponsysObjectDataset) AsAzureSQLDWTableDataset() (*AzureSQLDWTableDataset, bool) { + return nil, false +} + +// AsAzureSQLTableDataset is the BasicDataset implementation for ResponsysObjectDataset. +func (rod ResponsysObjectDataset) AsAzureSQLTableDataset() (*AzureSQLTableDataset, bool) { + return nil, false +} + +// AsAzureTableDataset is the BasicDataset implementation for ResponsysObjectDataset. +func (rod ResponsysObjectDataset) AsAzureTableDataset() (*AzureTableDataset, bool) { + return nil, false +} + +// AsAzureBlobDataset is the BasicDataset implementation for ResponsysObjectDataset. +func (rod ResponsysObjectDataset) AsAzureBlobDataset() (*AzureBlobDataset, bool) { + return nil, false +} + +// AsAmazonS3Dataset is the BasicDataset implementation for ResponsysObjectDataset. +func (rod ResponsysObjectDataset) AsAmazonS3Dataset() (*AmazonS3Dataset, bool) { + return nil, false +} + +// AsDataset is the BasicDataset implementation for ResponsysObjectDataset. +func (rod ResponsysObjectDataset) AsDataset() (*Dataset, bool) { + return nil, false +} + +// AsBasicDataset is the BasicDataset implementation for ResponsysObjectDataset. +func (rod ResponsysObjectDataset) AsBasicDataset() (BasicDataset, bool) { + return &rod, true +} + +// ResponsysSource a copy activity Responsys source. +type ResponsysSource struct { + // Query - A query to retrieve data from source. Type: string (or Expression with resultType string). + Query interface{} `json:"query,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // SourceRetryCount - Source retry count. Type: integer (or Expression with resultType integer). + SourceRetryCount interface{} `json:"sourceRetryCount,omitempty"` + // SourceRetryWait - Source retry wait. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` + // Type - Possible values include: 'TypeCopySource', 'TypeAmazonRedshiftSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeHTTPSource', 'TypeAzureDataLakeStoreSource', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeRelationalSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource' + Type TypeBasicCopySource `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ResponsysSource. +func (rs ResponsysSource) MarshalJSON() ([]byte, error) { + rs.Type = TypeResponsysSource + objectMap := make(map[string]interface{}) + objectMap["query"] = rs.Query + objectMap["sourceRetryCount"] = rs.SourceRetryCount + objectMap["sourceRetryWait"] = rs.SourceRetryWait + if rs.Type != "" { + objectMap["type"] = rs.Type + } + for k, v := range rs.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsAmazonRedshiftSource is the BasicCopySource implementation for ResponsysSource. +func (rs ResponsysSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { + return nil, false +} + +// AsResponsysSource is the BasicCopySource implementation for ResponsysSource. +func (rs ResponsysSource) AsResponsysSource() (*ResponsysSource, bool) { + return &rs, true +} + +// AsSalesforceMarketingCloudSource is the BasicCopySource implementation for ResponsysSource. +func (rs ResponsysSource) AsSalesforceMarketingCloudSource() (*SalesforceMarketingCloudSource, bool) { + return nil, false +} + +// AsVerticaSource is the BasicCopySource implementation for ResponsysSource. +func (rs ResponsysSource) AsVerticaSource() (*VerticaSource, bool) { + return nil, false +} + +// AsNetezzaSource is the BasicCopySource implementation for ResponsysSource. +func (rs ResponsysSource) AsNetezzaSource() (*NetezzaSource, bool) { + return nil, false +} + +// AsZohoSource is the BasicCopySource implementation for ResponsysSource. +func (rs ResponsysSource) AsZohoSource() (*ZohoSource, bool) { + return nil, false +} + +// AsXeroSource is the BasicCopySource implementation for ResponsysSource. +func (rs ResponsysSource) AsXeroSource() (*XeroSource, bool) { + return nil, false +} + +// AsSquareSource is the BasicCopySource implementation for ResponsysSource. +func (rs ResponsysSource) AsSquareSource() (*SquareSource, bool) { + return nil, false +} + +// AsSparkSource is the BasicCopySource implementation for ResponsysSource. +func (rs ResponsysSource) AsSparkSource() (*SparkSource, bool) { + return nil, false +} + +// AsShopifySource is the BasicCopySource implementation for ResponsysSource. +func (rs ResponsysSource) AsShopifySource() (*ShopifySource, bool) { + return nil, false +} + +// AsServiceNowSource is the BasicCopySource implementation for ResponsysSource. +func (rs ResponsysSource) AsServiceNowSource() (*ServiceNowSource, bool) { + return nil, false +} + +// AsQuickBooksSource is the BasicCopySource implementation for ResponsysSource. +func (rs ResponsysSource) AsQuickBooksSource() (*QuickBooksSource, bool) { + return nil, false +} + +// AsPrestoSource is the BasicCopySource implementation for ResponsysSource. +func (rs ResponsysSource) AsPrestoSource() (*PrestoSource, bool) { + return nil, false +} + +// AsPhoenixSource is the BasicCopySource implementation for ResponsysSource. +func (rs ResponsysSource) AsPhoenixSource() (*PhoenixSource, bool) { + return nil, false +} + +// AsPaypalSource is the BasicCopySource implementation for ResponsysSource. +func (rs ResponsysSource) AsPaypalSource() (*PaypalSource, bool) { + return nil, false +} + +// AsMarketoSource is the BasicCopySource implementation for ResponsysSource. +func (rs ResponsysSource) AsMarketoSource() (*MarketoSource, bool) { + return nil, false +} + +// AsMariaDBSource is the BasicCopySource implementation for ResponsysSource. +func (rs ResponsysSource) AsMariaDBSource() (*MariaDBSource, bool) { + return nil, false +} + +// AsMagentoSource is the BasicCopySource implementation for ResponsysSource. +func (rs ResponsysSource) AsMagentoSource() (*MagentoSource, bool) { + return nil, false +} + +// AsJiraSource is the BasicCopySource implementation for ResponsysSource. +func (rs ResponsysSource) AsJiraSource() (*JiraSource, bool) { + return nil, false +} + +// AsImpalaSource is the BasicCopySource implementation for ResponsysSource. +func (rs ResponsysSource) AsImpalaSource() (*ImpalaSource, bool) { + return nil, false +} + +// AsHubspotSource is the BasicCopySource implementation for ResponsysSource. +func (rs ResponsysSource) AsHubspotSource() (*HubspotSource, bool) { + return nil, false +} + +// AsHiveSource is the BasicCopySource implementation for ResponsysSource. +func (rs ResponsysSource) AsHiveSource() (*HiveSource, bool) { + return nil, false +} + +// AsHBaseSource is the BasicCopySource implementation for ResponsysSource. +func (rs ResponsysSource) AsHBaseSource() (*HBaseSource, bool) { + return nil, false +} + +// AsGreenplumSource is the BasicCopySource implementation for ResponsysSource. +func (rs ResponsysSource) AsGreenplumSource() (*GreenplumSource, bool) { + return nil, false +} + +// AsGoogleBigQuerySource is the BasicCopySource implementation for ResponsysSource. +func (rs ResponsysSource) AsGoogleBigQuerySource() (*GoogleBigQuerySource, bool) { + return nil, false +} + +// AsEloquaSource is the BasicCopySource implementation for ResponsysSource. +func (rs ResponsysSource) AsEloquaSource() (*EloquaSource, bool) { + return nil, false +} + +// AsDrillSource is the BasicCopySource implementation for ResponsysSource. +func (rs ResponsysSource) AsDrillSource() (*DrillSource, bool) { + return nil, false +} + +// AsCouchbaseSource is the BasicCopySource implementation for ResponsysSource. +func (rs ResponsysSource) AsCouchbaseSource() (*CouchbaseSource, bool) { + return nil, false +} + +// AsConcurSource is the BasicCopySource implementation for ResponsysSource. +func (rs ResponsysSource) AsConcurSource() (*ConcurSource, bool) { + return nil, false +} + +// AsAzurePostgreSQLSource is the BasicCopySource implementation for ResponsysSource. +func (rs ResponsysSource) AsAzurePostgreSQLSource() (*AzurePostgreSQLSource, bool) { + return nil, false +} + +// AsAmazonMWSSource is the BasicCopySource implementation for ResponsysSource. +func (rs ResponsysSource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { + return nil, false +} + +// AsHTTPSource is the BasicCopySource implementation for ResponsysSource. +func (rs ResponsysSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for ResponsysSource. +func (rs ResponsysSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for ResponsysSource. +func (rs ResponsysSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsCassandraSource is the BasicCopySource implementation for ResponsysSource. +func (rs ResponsysSource) AsCassandraSource() (*CassandraSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for ResponsysSource. +func (rs ResponsysSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for ResponsysSource. +func (rs ResponsysSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureMySQLSource is the BasicCopySource implementation for ResponsysSource. +func (rs ResponsysSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for ResponsysSource. +func (rs ResponsysSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for ResponsysSource. +func (rs ResponsysSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsSQLDWSource is the BasicCopySource implementation for ResponsysSource. +func (rs ResponsysSource) AsSQLDWSource() (*SQLDWSource, bool) { + return nil, false +} + +// AsSQLSource is the BasicCopySource implementation for ResponsysSource. +func (rs ResponsysSource) AsSQLSource() (*SQLSource, bool) { + return nil, false +} + +// AsSapEccSource is the BasicCopySource implementation for ResponsysSource. +func (rs ResponsysSource) AsSapEccSource() (*SapEccSource, bool) { + return nil, false +} + +// AsSapCloudForCustomerSource is the BasicCopySource implementation for ResponsysSource. +func (rs ResponsysSource) AsSapCloudForCustomerSource() (*SapCloudForCustomerSource, bool) { + return nil, false +} + +// AsSalesforceSource is the BasicCopySource implementation for ResponsysSource. +func (rs ResponsysSource) AsSalesforceSource() (*SalesforceSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for ResponsysSource. +func (rs ResponsysSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for ResponsysSource. +func (rs ResponsysSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for ResponsysSource. +func (rs ResponsysSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for ResponsysSource. +func (rs ResponsysSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + +// AsAzureTableSource is the BasicCopySource implementation for ResponsysSource. +func (rs ResponsysSource) AsAzureTableSource() (*AzureTableSource, bool) { + return nil, false +} + +// AsCopySource is the BasicCopySource implementation for ResponsysSource. +func (rs ResponsysSource) AsCopySource() (*CopySource, bool) { + return nil, false +} + +// AsBasicCopySource is the BasicCopySource implementation for ResponsysSource. +func (rs ResponsysSource) AsBasicCopySource() (BasicCopySource, bool) { + return &rs, true +} + +// RetryPolicy execution policy for an activity. +type RetryPolicy struct { + // Count - Maximum ordinary retry attempts. Default is 0. Type: integer (or Expression with resultType integer), minimum: 0. + Count interface{} `json:"count,omitempty"` + // IntervalInSeconds - Interval between retries in seconds. Default is 30. + IntervalInSeconds *int32 `json:"intervalInSeconds,omitempty"` +} + +// RunFilterParameters query parameters for listing runs. +type RunFilterParameters struct { + // ContinuationToken - The continuation token for getting the next page of results. Null for first page. + ContinuationToken *string `json:"continuationToken,omitempty"` + // LastUpdatedAfter - The time at or after which the run event was updated in 'ISO 8601' format. + LastUpdatedAfter *date.Time `json:"lastUpdatedAfter,omitempty"` + // LastUpdatedBefore - The time at or before which the run event was updated in 'ISO 8601' format. + LastUpdatedBefore *date.Time `json:"lastUpdatedBefore,omitempty"` + // Filters - List of filters. + Filters *[]RunQueryFilter `json:"filters,omitempty"` + // OrderBy - List of OrderBy option. + OrderBy *[]RunQueryOrderBy `json:"orderBy,omitempty"` +} + +// RunQueryFilter query filter option for listing runs. +type RunQueryFilter struct { + // Operand - Parameter name to be used for filter. The allowed operands to query pipeline runs are PipelineName, RunStart, RunEnd and Status; to query activity runs are ActivityName, ActivityRunStart, ActivityRunEnd, ActivityType and Status, and to query trigger runs are TriggerName, TriggerRunTimestamp and Status. Possible values include: 'PipelineName', 'Status', 'RunStart', 'RunEnd', 'ActivityName', 'ActivityRunStart', 'ActivityRunEnd', 'ActivityType', 'TriggerName', 'TriggerRunTimestamp' + Operand RunQueryFilterOperand `json:"operand,omitempty"` + // Operator - Operator to be used for filter. Possible values include: 'Equals', 'NotEquals', 'In', 'NotIn' + Operator RunQueryFilterOperator `json:"operator,omitempty"` + // Values - List of filter values. + Values *[]string `json:"values,omitempty"` +} + +// RunQueryOrderBy an object to provide order by options for listing runs. +type RunQueryOrderBy struct { + // OrderBy - Parameter name to be used for order by. The allowed parameters to order by for pipeline runs are PipelineName, RunStart, RunEnd and Status; for activity runs are ActivityName, ActivityRunStart, ActivityRunEnd and Status; for trigger runs are TriggerName, TriggerRunTimestamp and Status. Possible values include: 'RunQueryOrderByFieldRunStart', 'RunQueryOrderByFieldRunEnd', 'RunQueryOrderByFieldPipelineName', 'RunQueryOrderByFieldStatus', 'RunQueryOrderByFieldActivityName', 'RunQueryOrderByFieldActivityRunStart', 'RunQueryOrderByFieldActivityRunEnd', 'RunQueryOrderByFieldTriggerName', 'RunQueryOrderByFieldTriggerRunTimestamp' + OrderBy RunQueryOrderByField `json:"orderBy,omitempty"` + // Order - Sorting order of the parameter. Possible values include: 'ASC', 'DESC' + Order RunQueryOrder `json:"order,omitempty"` +} + +// SalesforceLinkedService linked service for Salesforce. +type SalesforceLinkedService struct { + // SalesforceLinkedServiceTypeProperties - Salesforce linked service properties. + *SalesforceLinkedServiceTypeProperties `json:"typeProperties,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // ConnectVia - The integration runtime reference. + ConnectVia *IntegrationRuntimeReference `json:"connectVia,omitempty"` + // Description - Linked service description. + Description *string `json:"description,omitempty"` + // Parameters - Parameters for linked service. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeLinkedService', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforce', 'TypeAzureDataLakeStore', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureStorage' + Type TypeBasicLinkedService `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for SalesforceLinkedService. +func (sls SalesforceLinkedService) MarshalJSON() ([]byte, error) { + sls.Type = TypeSalesforce + objectMap := make(map[string]interface{}) + if sls.SalesforceLinkedServiceTypeProperties != nil { + objectMap["typeProperties"] = sls.SalesforceLinkedServiceTypeProperties + } + if sls.ConnectVia != nil { + objectMap["connectVia"] = sls.ConnectVia + } + if sls.Description != nil { + objectMap["description"] = sls.Description + } + if sls.Parameters != nil { + objectMap["parameters"] = sls.Parameters + } + if sls.Annotations != nil { + objectMap["annotations"] = sls.Annotations + } + if sls.Type != "" { + objectMap["type"] = sls.Type + } + for k, v := range sls.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysLinkedService is the BasicLinkedService implementation for SalesforceLinkedService. +func (sls SalesforceLinkedService) AsResponsysLinkedService() (*ResponsysLinkedService, bool) { + return nil, false +} + +// AsAzureDatabricksLinkedService is the BasicLinkedService implementation for SalesforceLinkedService. +func (sls SalesforceLinkedService) AsAzureDatabricksLinkedService() (*AzureDatabricksLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeAnalyticsLinkedService is the BasicLinkedService implementation for SalesforceLinkedService. +func (sls SalesforceLinkedService) AsAzureDataLakeAnalyticsLinkedService() (*AzureDataLakeAnalyticsLinkedService, bool) { + return nil, false +} + +// AsHDInsightOnDemandLinkedService is the BasicLinkedService implementation for SalesforceLinkedService. +func (sls SalesforceLinkedService) AsHDInsightOnDemandLinkedService() (*HDInsightOnDemandLinkedService, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudLinkedService is the BasicLinkedService implementation for SalesforceLinkedService. +func (sls SalesforceLinkedService) AsSalesforceMarketingCloudLinkedService() (*SalesforceMarketingCloudLinkedService, bool) { + return nil, false +} + +// AsNetezzaLinkedService is the BasicLinkedService implementation for SalesforceLinkedService. +func (sls SalesforceLinkedService) AsNetezzaLinkedService() (*NetezzaLinkedService, bool) { + return nil, false +} + +// AsVerticaLinkedService is the BasicLinkedService implementation for SalesforceLinkedService. +func (sls SalesforceLinkedService) AsVerticaLinkedService() (*VerticaLinkedService, bool) { + return nil, false +} + +// AsZohoLinkedService is the BasicLinkedService implementation for SalesforceLinkedService. +func (sls SalesforceLinkedService) AsZohoLinkedService() (*ZohoLinkedService, bool) { + return nil, false +} + +// AsXeroLinkedService is the BasicLinkedService implementation for SalesforceLinkedService. +func (sls SalesforceLinkedService) AsXeroLinkedService() (*XeroLinkedService, bool) { + return nil, false +} + +// AsSquareLinkedService is the BasicLinkedService implementation for SalesforceLinkedService. +func (sls SalesforceLinkedService) AsSquareLinkedService() (*SquareLinkedService, bool) { + return nil, false +} + +// AsSparkLinkedService is the BasicLinkedService implementation for SalesforceLinkedService. +func (sls SalesforceLinkedService) AsSparkLinkedService() (*SparkLinkedService, bool) { + return nil, false +} + +// AsShopifyLinkedService is the BasicLinkedService implementation for SalesforceLinkedService. +func (sls SalesforceLinkedService) AsShopifyLinkedService() (*ShopifyLinkedService, bool) { + return nil, false +} + +// AsServiceNowLinkedService is the BasicLinkedService implementation for SalesforceLinkedService. +func (sls SalesforceLinkedService) AsServiceNowLinkedService() (*ServiceNowLinkedService, bool) { + return nil, false +} + +// AsQuickBooksLinkedService is the BasicLinkedService implementation for SalesforceLinkedService. +func (sls SalesforceLinkedService) AsQuickBooksLinkedService() (*QuickBooksLinkedService, bool) { + return nil, false +} + +// AsPrestoLinkedService is the BasicLinkedService implementation for SalesforceLinkedService. +func (sls SalesforceLinkedService) AsPrestoLinkedService() (*PrestoLinkedService, bool) { + return nil, false +} + +// AsPhoenixLinkedService is the BasicLinkedService implementation for SalesforceLinkedService. +func (sls SalesforceLinkedService) AsPhoenixLinkedService() (*PhoenixLinkedService, bool) { + return nil, false +} + +// AsPaypalLinkedService is the BasicLinkedService implementation for SalesforceLinkedService. +func (sls SalesforceLinkedService) AsPaypalLinkedService() (*PaypalLinkedService, bool) { + return nil, false +} + +// AsMarketoLinkedService is the BasicLinkedService implementation for SalesforceLinkedService. +func (sls SalesforceLinkedService) AsMarketoLinkedService() (*MarketoLinkedService, bool) { + return nil, false +} + +// AsMariaDBLinkedService is the BasicLinkedService implementation for SalesforceLinkedService. +func (sls SalesforceLinkedService) AsMariaDBLinkedService() (*MariaDBLinkedService, bool) { + return nil, false +} + +// AsMagentoLinkedService is the BasicLinkedService implementation for SalesforceLinkedService. +func (sls SalesforceLinkedService) AsMagentoLinkedService() (*MagentoLinkedService, bool) { + return nil, false +} + +// AsJiraLinkedService is the BasicLinkedService implementation for SalesforceLinkedService. +func (sls SalesforceLinkedService) AsJiraLinkedService() (*JiraLinkedService, bool) { + return nil, false +} + +// AsImpalaLinkedService is the BasicLinkedService implementation for SalesforceLinkedService. +func (sls SalesforceLinkedService) AsImpalaLinkedService() (*ImpalaLinkedService, bool) { + return nil, false +} + +// AsHubspotLinkedService is the BasicLinkedService implementation for SalesforceLinkedService. +func (sls SalesforceLinkedService) AsHubspotLinkedService() (*HubspotLinkedService, bool) { + return nil, false +} + +// AsHiveLinkedService is the BasicLinkedService implementation for SalesforceLinkedService. +func (sls SalesforceLinkedService) AsHiveLinkedService() (*HiveLinkedService, bool) { + return nil, false +} + +// AsHBaseLinkedService is the BasicLinkedService implementation for SalesforceLinkedService. +func (sls SalesforceLinkedService) AsHBaseLinkedService() (*HBaseLinkedService, bool) { + return nil, false +} + +// AsGreenplumLinkedService is the BasicLinkedService implementation for SalesforceLinkedService. +func (sls SalesforceLinkedService) AsGreenplumLinkedService() (*GreenplumLinkedService, bool) { + return nil, false +} + +// AsGoogleBigQueryLinkedService is the BasicLinkedService implementation for SalesforceLinkedService. +func (sls SalesforceLinkedService) AsGoogleBigQueryLinkedService() (*GoogleBigQueryLinkedService, bool) { + return nil, false +} + +// AsEloquaLinkedService is the BasicLinkedService implementation for SalesforceLinkedService. +func (sls SalesforceLinkedService) AsEloquaLinkedService() (*EloquaLinkedService, bool) { + return nil, false +} + +// AsDrillLinkedService is the BasicLinkedService implementation for SalesforceLinkedService. +func (sls SalesforceLinkedService) AsDrillLinkedService() (*DrillLinkedService, bool) { + return nil, false +} + +// AsCouchbaseLinkedService is the BasicLinkedService implementation for SalesforceLinkedService. +func (sls SalesforceLinkedService) AsCouchbaseLinkedService() (*CouchbaseLinkedService, bool) { + return nil, false +} + +// AsConcurLinkedService is the BasicLinkedService implementation for SalesforceLinkedService. +func (sls SalesforceLinkedService) AsConcurLinkedService() (*ConcurLinkedService, bool) { + return nil, false +} + +// AsAzurePostgreSQLLinkedService is the BasicLinkedService implementation for SalesforceLinkedService. +func (sls SalesforceLinkedService) AsAzurePostgreSQLLinkedService() (*AzurePostgreSQLLinkedService, bool) { + return nil, false +} + +// AsAmazonMWSLinkedService is the BasicLinkedService implementation for SalesforceLinkedService. +func (sls SalesforceLinkedService) AsAmazonMWSLinkedService() (*AmazonMWSLinkedService, bool) { + return nil, false +} + +// AsSapHanaLinkedService is the BasicLinkedService implementation for SalesforceLinkedService. +func (sls SalesforceLinkedService) AsSapHanaLinkedService() (*SapHanaLinkedService, bool) { + return nil, false +} + +// AsSapBWLinkedService is the BasicLinkedService implementation for SalesforceLinkedService. +func (sls SalesforceLinkedService) AsSapBWLinkedService() (*SapBWLinkedService, bool) { + return nil, false +} + +// AsSftpServerLinkedService is the BasicLinkedService implementation for SalesforceLinkedService. +func (sls SalesforceLinkedService) AsSftpServerLinkedService() (*SftpServerLinkedService, bool) { + return nil, false +} + +// AsFtpServerLinkedService is the BasicLinkedService implementation for SalesforceLinkedService. +func (sls SalesforceLinkedService) AsFtpServerLinkedService() (*FtpServerLinkedService, bool) { + return nil, false +} + +// AsHTTPLinkedService is the BasicLinkedService implementation for SalesforceLinkedService. +func (sls SalesforceLinkedService) AsHTTPLinkedService() (*HTTPLinkedService, bool) { + return nil, false +} + +// AsAzureSearchLinkedService is the BasicLinkedService implementation for SalesforceLinkedService. +func (sls SalesforceLinkedService) AsAzureSearchLinkedService() (*AzureSearchLinkedService, bool) { + return nil, false +} + +// AsCustomDataSourceLinkedService is the BasicLinkedService implementation for SalesforceLinkedService. +func (sls SalesforceLinkedService) AsCustomDataSourceLinkedService() (*CustomDataSourceLinkedService, bool) { + return nil, false +} + +// AsAmazonRedshiftLinkedService is the BasicLinkedService implementation for SalesforceLinkedService. +func (sls SalesforceLinkedService) AsAmazonRedshiftLinkedService() (*AmazonRedshiftLinkedService, bool) { + return nil, false +} + +// AsAmazonS3LinkedService is the BasicLinkedService implementation for SalesforceLinkedService. +func (sls SalesforceLinkedService) AsAmazonS3LinkedService() (*AmazonS3LinkedService, bool) { + return nil, false +} + +// AsSapEccLinkedService is the BasicLinkedService implementation for SalesforceLinkedService. +func (sls SalesforceLinkedService) AsSapEccLinkedService() (*SapEccLinkedService, bool) { + return nil, false +} + +// AsSapCloudForCustomerLinkedService is the BasicLinkedService implementation for SalesforceLinkedService. +func (sls SalesforceLinkedService) AsSapCloudForCustomerLinkedService() (*SapCloudForCustomerLinkedService, bool) { + return nil, false +} + +// AsSalesforceLinkedService is the BasicLinkedService implementation for SalesforceLinkedService. +func (sls SalesforceLinkedService) AsSalesforceLinkedService() (*SalesforceLinkedService, bool) { + return &sls, true +} + +// AsAzureDataLakeStoreLinkedService is the BasicLinkedService implementation for SalesforceLinkedService. +func (sls SalesforceLinkedService) AsAzureDataLakeStoreLinkedService() (*AzureDataLakeStoreLinkedService, bool) { + return nil, false +} + +// AsMongoDbLinkedService is the BasicLinkedService implementation for SalesforceLinkedService. +func (sls SalesforceLinkedService) AsMongoDbLinkedService() (*MongoDbLinkedService, bool) { + return nil, false +} + +// AsCassandraLinkedService is the BasicLinkedService implementation for SalesforceLinkedService. +func (sls SalesforceLinkedService) AsCassandraLinkedService() (*CassandraLinkedService, bool) { + return nil, false +} + +// AsWebLinkedService is the BasicLinkedService implementation for SalesforceLinkedService. +func (sls SalesforceLinkedService) AsWebLinkedService() (*WebLinkedService, bool) { + return nil, false +} + +// AsODataLinkedService is the BasicLinkedService implementation for SalesforceLinkedService. +func (sls SalesforceLinkedService) AsODataLinkedService() (*ODataLinkedService, bool) { + return nil, false +} + +// AsHdfsLinkedService is the BasicLinkedService implementation for SalesforceLinkedService. +func (sls SalesforceLinkedService) AsHdfsLinkedService() (*HdfsLinkedService, bool) { + return nil, false +} + +// AsOdbcLinkedService is the BasicLinkedService implementation for SalesforceLinkedService. +func (sls SalesforceLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, bool) { + return nil, false +} + +// AsAzureMLLinkedService is the BasicLinkedService implementation for SalesforceLinkedService. +func (sls SalesforceLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { + return nil, false +} + +// AsTeradataLinkedService is the BasicLinkedService implementation for SalesforceLinkedService. +func (sls SalesforceLinkedService) AsTeradataLinkedService() (*TeradataLinkedService, bool) { + return nil, false +} + +// AsDb2LinkedService is the BasicLinkedService implementation for SalesforceLinkedService. +func (sls SalesforceLinkedService) AsDb2LinkedService() (*Db2LinkedService, bool) { + return nil, false +} + +// AsSybaseLinkedService is the BasicLinkedService implementation for SalesforceLinkedService. +func (sls SalesforceLinkedService) AsSybaseLinkedService() (*SybaseLinkedService, bool) { + return nil, false +} + +// AsPostgreSQLLinkedService is the BasicLinkedService implementation for SalesforceLinkedService. +func (sls SalesforceLinkedService) AsPostgreSQLLinkedService() (*PostgreSQLLinkedService, bool) { + return nil, false +} + +// AsMySQLLinkedService is the BasicLinkedService implementation for SalesforceLinkedService. +func (sls SalesforceLinkedService) AsMySQLLinkedService() (*MySQLLinkedService, bool) { + return nil, false +} + +// AsAzureMySQLLinkedService is the BasicLinkedService implementation for SalesforceLinkedService. +func (sls SalesforceLinkedService) AsAzureMySQLLinkedService() (*AzureMySQLLinkedService, bool) { + return nil, false +} + +// AsOracleLinkedService is the BasicLinkedService implementation for SalesforceLinkedService. +func (sls SalesforceLinkedService) AsOracleLinkedService() (*OracleLinkedService, bool) { + return nil, false +} + +// AsFileServerLinkedService is the BasicLinkedService implementation for SalesforceLinkedService. +func (sls SalesforceLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { + return nil, false +} + +// AsHDInsightLinkedService is the BasicLinkedService implementation for SalesforceLinkedService. +func (sls SalesforceLinkedService) AsHDInsightLinkedService() (*HDInsightLinkedService, bool) { + return nil, false +} + +// AsDynamicsLinkedService is the BasicLinkedService implementation for SalesforceLinkedService. +func (sls SalesforceLinkedService) AsDynamicsLinkedService() (*DynamicsLinkedService, bool) { + return nil, false +} + +// AsCosmosDbLinkedService is the BasicLinkedService implementation for SalesforceLinkedService. +func (sls SalesforceLinkedService) AsCosmosDbLinkedService() (*CosmosDbLinkedService, bool) { + return nil, false +} + +// AsAzureKeyVaultLinkedService is the BasicLinkedService implementation for SalesforceLinkedService. +func (sls SalesforceLinkedService) AsAzureKeyVaultLinkedService() (*AzureKeyVaultLinkedService, bool) { + return nil, false +} + +// AsAzureBatchLinkedService is the BasicLinkedService implementation for SalesforceLinkedService. +func (sls SalesforceLinkedService) AsAzureBatchLinkedService() (*AzureBatchLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDatabaseLinkedService is the BasicLinkedService implementation for SalesforceLinkedService. +func (sls SalesforceLinkedService) AsAzureSQLDatabaseLinkedService() (*AzureSQLDatabaseLinkedService, bool) { + return nil, false +} + +// AsSQLServerLinkedService is the BasicLinkedService implementation for SalesforceLinkedService. +func (sls SalesforceLinkedService) AsSQLServerLinkedService() (*SQLServerLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDWLinkedService is the BasicLinkedService implementation for SalesforceLinkedService. +func (sls SalesforceLinkedService) AsAzureSQLDWLinkedService() (*AzureSQLDWLinkedService, bool) { + return nil, false +} + +// AsAzureStorageLinkedService is the BasicLinkedService implementation for SalesforceLinkedService. +func (sls SalesforceLinkedService) AsAzureStorageLinkedService() (*AzureStorageLinkedService, bool) { + return nil, false +} + +// AsLinkedService is the BasicLinkedService implementation for SalesforceLinkedService. +func (sls SalesforceLinkedService) AsLinkedService() (*LinkedService, bool) { + return nil, false +} + +// AsBasicLinkedService is the BasicLinkedService implementation for SalesforceLinkedService. +func (sls SalesforceLinkedService) AsBasicLinkedService() (BasicLinkedService, bool) { + return &sls, true +} + +// UnmarshalJSON is the custom unmarshaler for SalesforceLinkedService struct. +func (sls *SalesforceLinkedService) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "typeProperties": + if v != nil { + var salesforceLinkedServiceTypeProperties SalesforceLinkedServiceTypeProperties + err = json.Unmarshal(*v, &salesforceLinkedServiceTypeProperties) + if err != nil { + return err + } + sls.SalesforceLinkedServiceTypeProperties = &salesforceLinkedServiceTypeProperties + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if sls.AdditionalProperties == nil { + sls.AdditionalProperties = make(map[string]interface{}) + } + sls.AdditionalProperties[k] = additionalProperties + } + case "connectVia": + if v != nil { + var connectVia IntegrationRuntimeReference + err = json.Unmarshal(*v, &connectVia) + if err != nil { + return err + } + sls.ConnectVia = &connectVia + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + sls.Description = &description + } + case "parameters": + if v != nil { + var parameters map[string]*ParameterSpecification + err = json.Unmarshal(*v, ¶meters) + if err != nil { + return err + } + sls.Parameters = parameters + } + case "annotations": + if v != nil { + var annotations []interface{} + err = json.Unmarshal(*v, &annotations) + if err != nil { + return err + } + sls.Annotations = &annotations + } + case "type": + if v != nil { + var typeVar TypeBasicLinkedService + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + sls.Type = typeVar + } + } + } + + return nil +} + +// SalesforceLinkedServiceTypeProperties salesforce linked service properties. +type SalesforceLinkedServiceTypeProperties struct { + // EnvironmentURL - The URL of Salesforce instance. Default is 'https://login.salesforce.com'. To copy data from sandbox, specify 'https://test.salesforce.com'. To copy data from custom domain, specify, for example, 'https://[domain].my.salesforce.com'. Type: string (or Expression with resultType string). + EnvironmentURL interface{} `json:"environmentUrl,omitempty"` + // Username - The username for Basic authentication of the Salesforce instance. Type: string (or Expression with resultType string). + Username interface{} `json:"username,omitempty"` + // Password - The password for Basic authentication of the Salesforce instance. + Password BasicSecretBase `json:"password,omitempty"` + // SecurityToken - The security token is required to remotely access Salesforce instance. + SecurityToken BasicSecretBase `json:"securityToken,omitempty"` + // EncryptedCredential - The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string). + EncryptedCredential interface{} `json:"encryptedCredential,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for SalesforceLinkedServiceTypeProperties struct. +func (slstp *SalesforceLinkedServiceTypeProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "environmentUrl": + if v != nil { + var environmentURL interface{} + err = json.Unmarshal(*v, &environmentURL) + if err != nil { + return err + } + slstp.EnvironmentURL = environmentURL + } + case "username": + if v != nil { + var username interface{} + err = json.Unmarshal(*v, &username) + if err != nil { + return err + } + slstp.Username = username + } + case "password": + if v != nil { + password, err := unmarshalBasicSecretBase(*v) + if err != nil { + return err + } + slstp.Password = password + } + case "securityToken": + if v != nil { + securityToken, err := unmarshalBasicSecretBase(*v) + if err != nil { + return err + } + slstp.SecurityToken = securityToken + } + case "encryptedCredential": + if v != nil { + var encryptedCredential interface{} + err = json.Unmarshal(*v, &encryptedCredential) + if err != nil { + return err + } + slstp.EncryptedCredential = encryptedCredential + } + } + } + + return nil +} + +// SalesforceMarketingCloudLinkedService salesforce Marketing Cloud linked service. +type SalesforceMarketingCloudLinkedService struct { + // SalesforceMarketingCloudLinkedServiceTypeProperties - Salesforce Marketing Cloud linked service properties. + *SalesforceMarketingCloudLinkedServiceTypeProperties `json:"typeProperties,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // ConnectVia - The integration runtime reference. + ConnectVia *IntegrationRuntimeReference `json:"connectVia,omitempty"` + // Description - Linked service description. + Description *string `json:"description,omitempty"` + // Parameters - Parameters for linked service. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeLinkedService', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforce', 'TypeAzureDataLakeStore', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureStorage' + Type TypeBasicLinkedService `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for SalesforceMarketingCloudLinkedService. +func (smcls SalesforceMarketingCloudLinkedService) MarshalJSON() ([]byte, error) { + smcls.Type = TypeSalesforceMarketingCloud + objectMap := make(map[string]interface{}) + if smcls.SalesforceMarketingCloudLinkedServiceTypeProperties != nil { + objectMap["typeProperties"] = smcls.SalesforceMarketingCloudLinkedServiceTypeProperties + } + if smcls.ConnectVia != nil { + objectMap["connectVia"] = smcls.ConnectVia + } + if smcls.Description != nil { + objectMap["description"] = smcls.Description + } + if smcls.Parameters != nil { + objectMap["parameters"] = smcls.Parameters + } + if smcls.Annotations != nil { + objectMap["annotations"] = smcls.Annotations + } + if smcls.Type != "" { + objectMap["type"] = smcls.Type + } + for k, v := range smcls.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysLinkedService is the BasicLinkedService implementation for SalesforceMarketingCloudLinkedService. +func (smcls SalesforceMarketingCloudLinkedService) AsResponsysLinkedService() (*ResponsysLinkedService, bool) { + return nil, false +} + +// AsAzureDatabricksLinkedService is the BasicLinkedService implementation for SalesforceMarketingCloudLinkedService. +func (smcls SalesforceMarketingCloudLinkedService) AsAzureDatabricksLinkedService() (*AzureDatabricksLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeAnalyticsLinkedService is the BasicLinkedService implementation for SalesforceMarketingCloudLinkedService. +func (smcls SalesforceMarketingCloudLinkedService) AsAzureDataLakeAnalyticsLinkedService() (*AzureDataLakeAnalyticsLinkedService, bool) { + return nil, false +} + +// AsHDInsightOnDemandLinkedService is the BasicLinkedService implementation for SalesforceMarketingCloudLinkedService. +func (smcls SalesforceMarketingCloudLinkedService) AsHDInsightOnDemandLinkedService() (*HDInsightOnDemandLinkedService, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudLinkedService is the BasicLinkedService implementation for SalesforceMarketingCloudLinkedService. +func (smcls SalesforceMarketingCloudLinkedService) AsSalesforceMarketingCloudLinkedService() (*SalesforceMarketingCloudLinkedService, bool) { + return &smcls, true +} + +// AsNetezzaLinkedService is the BasicLinkedService implementation for SalesforceMarketingCloudLinkedService. +func (smcls SalesforceMarketingCloudLinkedService) AsNetezzaLinkedService() (*NetezzaLinkedService, bool) { + return nil, false +} + +// AsVerticaLinkedService is the BasicLinkedService implementation for SalesforceMarketingCloudLinkedService. +func (smcls SalesforceMarketingCloudLinkedService) AsVerticaLinkedService() (*VerticaLinkedService, bool) { + return nil, false +} + +// AsZohoLinkedService is the BasicLinkedService implementation for SalesforceMarketingCloudLinkedService. +func (smcls SalesforceMarketingCloudLinkedService) AsZohoLinkedService() (*ZohoLinkedService, bool) { + return nil, false +} + +// AsXeroLinkedService is the BasicLinkedService implementation for SalesforceMarketingCloudLinkedService. +func (smcls SalesforceMarketingCloudLinkedService) AsXeroLinkedService() (*XeroLinkedService, bool) { + return nil, false +} + +// AsSquareLinkedService is the BasicLinkedService implementation for SalesforceMarketingCloudLinkedService. +func (smcls SalesforceMarketingCloudLinkedService) AsSquareLinkedService() (*SquareLinkedService, bool) { + return nil, false +} + +// AsSparkLinkedService is the BasicLinkedService implementation for SalesforceMarketingCloudLinkedService. +func (smcls SalesforceMarketingCloudLinkedService) AsSparkLinkedService() (*SparkLinkedService, bool) { + return nil, false +} + +// AsShopifyLinkedService is the BasicLinkedService implementation for SalesforceMarketingCloudLinkedService. +func (smcls SalesforceMarketingCloudLinkedService) AsShopifyLinkedService() (*ShopifyLinkedService, bool) { + return nil, false +} + +// AsServiceNowLinkedService is the BasicLinkedService implementation for SalesforceMarketingCloudLinkedService. +func (smcls SalesforceMarketingCloudLinkedService) AsServiceNowLinkedService() (*ServiceNowLinkedService, bool) { + return nil, false +} + +// AsQuickBooksLinkedService is the BasicLinkedService implementation for SalesforceMarketingCloudLinkedService. +func (smcls SalesforceMarketingCloudLinkedService) AsQuickBooksLinkedService() (*QuickBooksLinkedService, bool) { + return nil, false +} + +// AsPrestoLinkedService is the BasicLinkedService implementation for SalesforceMarketingCloudLinkedService. +func (smcls SalesforceMarketingCloudLinkedService) AsPrestoLinkedService() (*PrestoLinkedService, bool) { + return nil, false +} + +// AsPhoenixLinkedService is the BasicLinkedService implementation for SalesforceMarketingCloudLinkedService. +func (smcls SalesforceMarketingCloudLinkedService) AsPhoenixLinkedService() (*PhoenixLinkedService, bool) { + return nil, false +} + +// AsPaypalLinkedService is the BasicLinkedService implementation for SalesforceMarketingCloudLinkedService. +func (smcls SalesforceMarketingCloudLinkedService) AsPaypalLinkedService() (*PaypalLinkedService, bool) { + return nil, false +} + +// AsMarketoLinkedService is the BasicLinkedService implementation for SalesforceMarketingCloudLinkedService. +func (smcls SalesforceMarketingCloudLinkedService) AsMarketoLinkedService() (*MarketoLinkedService, bool) { + return nil, false +} + +// AsMariaDBLinkedService is the BasicLinkedService implementation for SalesforceMarketingCloudLinkedService. +func (smcls SalesforceMarketingCloudLinkedService) AsMariaDBLinkedService() (*MariaDBLinkedService, bool) { + return nil, false +} + +// AsMagentoLinkedService is the BasicLinkedService implementation for SalesforceMarketingCloudLinkedService. +func (smcls SalesforceMarketingCloudLinkedService) AsMagentoLinkedService() (*MagentoLinkedService, bool) { + return nil, false +} + +// AsJiraLinkedService is the BasicLinkedService implementation for SalesforceMarketingCloudLinkedService. +func (smcls SalesforceMarketingCloudLinkedService) AsJiraLinkedService() (*JiraLinkedService, bool) { + return nil, false +} + +// AsImpalaLinkedService is the BasicLinkedService implementation for SalesforceMarketingCloudLinkedService. +func (smcls SalesforceMarketingCloudLinkedService) AsImpalaLinkedService() (*ImpalaLinkedService, bool) { + return nil, false +} + +// AsHubspotLinkedService is the BasicLinkedService implementation for SalesforceMarketingCloudLinkedService. +func (smcls SalesforceMarketingCloudLinkedService) AsHubspotLinkedService() (*HubspotLinkedService, bool) { + return nil, false +} + +// AsHiveLinkedService is the BasicLinkedService implementation for SalesforceMarketingCloudLinkedService. +func (smcls SalesforceMarketingCloudLinkedService) AsHiveLinkedService() (*HiveLinkedService, bool) { + return nil, false +} + +// AsHBaseLinkedService is the BasicLinkedService implementation for SalesforceMarketingCloudLinkedService. +func (smcls SalesforceMarketingCloudLinkedService) AsHBaseLinkedService() (*HBaseLinkedService, bool) { + return nil, false +} + +// AsGreenplumLinkedService is the BasicLinkedService implementation for SalesforceMarketingCloudLinkedService. +func (smcls SalesforceMarketingCloudLinkedService) AsGreenplumLinkedService() (*GreenplumLinkedService, bool) { + return nil, false +} + +// AsGoogleBigQueryLinkedService is the BasicLinkedService implementation for SalesforceMarketingCloudLinkedService. +func (smcls SalesforceMarketingCloudLinkedService) AsGoogleBigQueryLinkedService() (*GoogleBigQueryLinkedService, bool) { + return nil, false +} + +// AsEloquaLinkedService is the BasicLinkedService implementation for SalesforceMarketingCloudLinkedService. +func (smcls SalesforceMarketingCloudLinkedService) AsEloquaLinkedService() (*EloquaLinkedService, bool) { + return nil, false +} + +// AsDrillLinkedService is the BasicLinkedService implementation for SalesforceMarketingCloudLinkedService. +func (smcls SalesforceMarketingCloudLinkedService) AsDrillLinkedService() (*DrillLinkedService, bool) { + return nil, false +} + +// AsCouchbaseLinkedService is the BasicLinkedService implementation for SalesforceMarketingCloudLinkedService. +func (smcls SalesforceMarketingCloudLinkedService) AsCouchbaseLinkedService() (*CouchbaseLinkedService, bool) { + return nil, false +} + +// AsConcurLinkedService is the BasicLinkedService implementation for SalesforceMarketingCloudLinkedService. +func (smcls SalesforceMarketingCloudLinkedService) AsConcurLinkedService() (*ConcurLinkedService, bool) { + return nil, false +} + +// AsAzurePostgreSQLLinkedService is the BasicLinkedService implementation for SalesforceMarketingCloudLinkedService. +func (smcls SalesforceMarketingCloudLinkedService) AsAzurePostgreSQLLinkedService() (*AzurePostgreSQLLinkedService, bool) { + return nil, false +} + +// AsAmazonMWSLinkedService is the BasicLinkedService implementation for SalesforceMarketingCloudLinkedService. +func (smcls SalesforceMarketingCloudLinkedService) AsAmazonMWSLinkedService() (*AmazonMWSLinkedService, bool) { + return nil, false +} + +// AsSapHanaLinkedService is the BasicLinkedService implementation for SalesforceMarketingCloudLinkedService. +func (smcls SalesforceMarketingCloudLinkedService) AsSapHanaLinkedService() (*SapHanaLinkedService, bool) { + return nil, false +} + +// AsSapBWLinkedService is the BasicLinkedService implementation for SalesforceMarketingCloudLinkedService. +func (smcls SalesforceMarketingCloudLinkedService) AsSapBWLinkedService() (*SapBWLinkedService, bool) { + return nil, false +} + +// AsSftpServerLinkedService is the BasicLinkedService implementation for SalesforceMarketingCloudLinkedService. +func (smcls SalesforceMarketingCloudLinkedService) AsSftpServerLinkedService() (*SftpServerLinkedService, bool) { + return nil, false +} + +// AsFtpServerLinkedService is the BasicLinkedService implementation for SalesforceMarketingCloudLinkedService. +func (smcls SalesforceMarketingCloudLinkedService) AsFtpServerLinkedService() (*FtpServerLinkedService, bool) { + return nil, false +} + +// AsHTTPLinkedService is the BasicLinkedService implementation for SalesforceMarketingCloudLinkedService. +func (smcls SalesforceMarketingCloudLinkedService) AsHTTPLinkedService() (*HTTPLinkedService, bool) { + return nil, false +} + +// AsAzureSearchLinkedService is the BasicLinkedService implementation for SalesforceMarketingCloudLinkedService. +func (smcls SalesforceMarketingCloudLinkedService) AsAzureSearchLinkedService() (*AzureSearchLinkedService, bool) { + return nil, false +} + +// AsCustomDataSourceLinkedService is the BasicLinkedService implementation for SalesforceMarketingCloudLinkedService. +func (smcls SalesforceMarketingCloudLinkedService) AsCustomDataSourceLinkedService() (*CustomDataSourceLinkedService, bool) { + return nil, false +} + +// AsAmazonRedshiftLinkedService is the BasicLinkedService implementation for SalesforceMarketingCloudLinkedService. +func (smcls SalesforceMarketingCloudLinkedService) AsAmazonRedshiftLinkedService() (*AmazonRedshiftLinkedService, bool) { + return nil, false +} + +// AsAmazonS3LinkedService is the BasicLinkedService implementation for SalesforceMarketingCloudLinkedService. +func (smcls SalesforceMarketingCloudLinkedService) AsAmazonS3LinkedService() (*AmazonS3LinkedService, bool) { + return nil, false +} + +// AsSapEccLinkedService is the BasicLinkedService implementation for SalesforceMarketingCloudLinkedService. +func (smcls SalesforceMarketingCloudLinkedService) AsSapEccLinkedService() (*SapEccLinkedService, bool) { + return nil, false +} + +// AsSapCloudForCustomerLinkedService is the BasicLinkedService implementation for SalesforceMarketingCloudLinkedService. +func (smcls SalesforceMarketingCloudLinkedService) AsSapCloudForCustomerLinkedService() (*SapCloudForCustomerLinkedService, bool) { + return nil, false +} + +// AsSalesforceLinkedService is the BasicLinkedService implementation for SalesforceMarketingCloudLinkedService. +func (smcls SalesforceMarketingCloudLinkedService) AsSalesforceLinkedService() (*SalesforceLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeStoreLinkedService is the BasicLinkedService implementation for SalesforceMarketingCloudLinkedService. +func (smcls SalesforceMarketingCloudLinkedService) AsAzureDataLakeStoreLinkedService() (*AzureDataLakeStoreLinkedService, bool) { + return nil, false +} + +// AsMongoDbLinkedService is the BasicLinkedService implementation for SalesforceMarketingCloudLinkedService. +func (smcls SalesforceMarketingCloudLinkedService) AsMongoDbLinkedService() (*MongoDbLinkedService, bool) { + return nil, false +} + +// AsCassandraLinkedService is the BasicLinkedService implementation for SalesforceMarketingCloudLinkedService. +func (smcls SalesforceMarketingCloudLinkedService) AsCassandraLinkedService() (*CassandraLinkedService, bool) { + return nil, false +} + +// AsWebLinkedService is the BasicLinkedService implementation for SalesforceMarketingCloudLinkedService. +func (smcls SalesforceMarketingCloudLinkedService) AsWebLinkedService() (*WebLinkedService, bool) { + return nil, false +} + +// AsODataLinkedService is the BasicLinkedService implementation for SalesforceMarketingCloudLinkedService. +func (smcls SalesforceMarketingCloudLinkedService) AsODataLinkedService() (*ODataLinkedService, bool) { + return nil, false +} + +// AsHdfsLinkedService is the BasicLinkedService implementation for SalesforceMarketingCloudLinkedService. +func (smcls SalesforceMarketingCloudLinkedService) AsHdfsLinkedService() (*HdfsLinkedService, bool) { + return nil, false +} + +// AsOdbcLinkedService is the BasicLinkedService implementation for SalesforceMarketingCloudLinkedService. +func (smcls SalesforceMarketingCloudLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, bool) { + return nil, false +} + +// AsAzureMLLinkedService is the BasicLinkedService implementation for SalesforceMarketingCloudLinkedService. +func (smcls SalesforceMarketingCloudLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { + return nil, false +} + +// AsTeradataLinkedService is the BasicLinkedService implementation for SalesforceMarketingCloudLinkedService. +func (smcls SalesforceMarketingCloudLinkedService) AsTeradataLinkedService() (*TeradataLinkedService, bool) { + return nil, false +} + +// AsDb2LinkedService is the BasicLinkedService implementation for SalesforceMarketingCloudLinkedService. +func (smcls SalesforceMarketingCloudLinkedService) AsDb2LinkedService() (*Db2LinkedService, bool) { + return nil, false +} + +// AsSybaseLinkedService is the BasicLinkedService implementation for SalesforceMarketingCloudLinkedService. +func (smcls SalesforceMarketingCloudLinkedService) AsSybaseLinkedService() (*SybaseLinkedService, bool) { + return nil, false +} + +// AsPostgreSQLLinkedService is the BasicLinkedService implementation for SalesforceMarketingCloudLinkedService. +func (smcls SalesforceMarketingCloudLinkedService) AsPostgreSQLLinkedService() (*PostgreSQLLinkedService, bool) { + return nil, false +} + +// AsMySQLLinkedService is the BasicLinkedService implementation for SalesforceMarketingCloudLinkedService. +func (smcls SalesforceMarketingCloudLinkedService) AsMySQLLinkedService() (*MySQLLinkedService, bool) { + return nil, false +} + +// AsAzureMySQLLinkedService is the BasicLinkedService implementation for SalesforceMarketingCloudLinkedService. +func (smcls SalesforceMarketingCloudLinkedService) AsAzureMySQLLinkedService() (*AzureMySQLLinkedService, bool) { + return nil, false +} + +// AsOracleLinkedService is the BasicLinkedService implementation for SalesforceMarketingCloudLinkedService. +func (smcls SalesforceMarketingCloudLinkedService) AsOracleLinkedService() (*OracleLinkedService, bool) { + return nil, false +} + +// AsFileServerLinkedService is the BasicLinkedService implementation for SalesforceMarketingCloudLinkedService. +func (smcls SalesforceMarketingCloudLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { + return nil, false +} + +// AsHDInsightLinkedService is the BasicLinkedService implementation for SalesforceMarketingCloudLinkedService. +func (smcls SalesforceMarketingCloudLinkedService) AsHDInsightLinkedService() (*HDInsightLinkedService, bool) { + return nil, false +} + +// AsDynamicsLinkedService is the BasicLinkedService implementation for SalesforceMarketingCloudLinkedService. +func (smcls SalesforceMarketingCloudLinkedService) AsDynamicsLinkedService() (*DynamicsLinkedService, bool) { + return nil, false +} + +// AsCosmosDbLinkedService is the BasicLinkedService implementation for SalesforceMarketingCloudLinkedService. +func (smcls SalesforceMarketingCloudLinkedService) AsCosmosDbLinkedService() (*CosmosDbLinkedService, bool) { + return nil, false +} + +// AsAzureKeyVaultLinkedService is the BasicLinkedService implementation for SalesforceMarketingCloudLinkedService. +func (smcls SalesforceMarketingCloudLinkedService) AsAzureKeyVaultLinkedService() (*AzureKeyVaultLinkedService, bool) { + return nil, false +} + +// AsAzureBatchLinkedService is the BasicLinkedService implementation for SalesforceMarketingCloudLinkedService. +func (smcls SalesforceMarketingCloudLinkedService) AsAzureBatchLinkedService() (*AzureBatchLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDatabaseLinkedService is the BasicLinkedService implementation for SalesforceMarketingCloudLinkedService. +func (smcls SalesforceMarketingCloudLinkedService) AsAzureSQLDatabaseLinkedService() (*AzureSQLDatabaseLinkedService, bool) { + return nil, false +} + +// AsSQLServerLinkedService is the BasicLinkedService implementation for SalesforceMarketingCloudLinkedService. +func (smcls SalesforceMarketingCloudLinkedService) AsSQLServerLinkedService() (*SQLServerLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDWLinkedService is the BasicLinkedService implementation for SalesforceMarketingCloudLinkedService. +func (smcls SalesforceMarketingCloudLinkedService) AsAzureSQLDWLinkedService() (*AzureSQLDWLinkedService, bool) { + return nil, false +} + +// AsAzureStorageLinkedService is the BasicLinkedService implementation for SalesforceMarketingCloudLinkedService. +func (smcls SalesforceMarketingCloudLinkedService) AsAzureStorageLinkedService() (*AzureStorageLinkedService, bool) { + return nil, false +} + +// AsLinkedService is the BasicLinkedService implementation for SalesforceMarketingCloudLinkedService. +func (smcls SalesforceMarketingCloudLinkedService) AsLinkedService() (*LinkedService, bool) { + return nil, false +} + +// AsBasicLinkedService is the BasicLinkedService implementation for SalesforceMarketingCloudLinkedService. +func (smcls SalesforceMarketingCloudLinkedService) AsBasicLinkedService() (BasicLinkedService, bool) { + return &smcls, true +} + +// UnmarshalJSON is the custom unmarshaler for SalesforceMarketingCloudLinkedService struct. +func (smcls *SalesforceMarketingCloudLinkedService) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "typeProperties": + if v != nil { + var salesforceMarketingCloudLinkedServiceTypeProperties SalesforceMarketingCloudLinkedServiceTypeProperties + err = json.Unmarshal(*v, &salesforceMarketingCloudLinkedServiceTypeProperties) + if err != nil { + return err + } + smcls.SalesforceMarketingCloudLinkedServiceTypeProperties = &salesforceMarketingCloudLinkedServiceTypeProperties + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if smcls.AdditionalProperties == nil { + smcls.AdditionalProperties = make(map[string]interface{}) + } + smcls.AdditionalProperties[k] = additionalProperties + } + case "connectVia": + if v != nil { + var connectVia IntegrationRuntimeReference + err = json.Unmarshal(*v, &connectVia) + if err != nil { + return err + } + smcls.ConnectVia = &connectVia + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + smcls.Description = &description + } + case "parameters": + if v != nil { + var parameters map[string]*ParameterSpecification + err = json.Unmarshal(*v, ¶meters) + if err != nil { + return err + } + smcls.Parameters = parameters + } + case "annotations": + if v != nil { + var annotations []interface{} + err = json.Unmarshal(*v, &annotations) + if err != nil { + return err + } + smcls.Annotations = &annotations + } + case "type": + if v != nil { + var typeVar TypeBasicLinkedService + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + smcls.Type = typeVar + } + } + } + + return nil +} + +// SalesforceMarketingCloudLinkedServiceTypeProperties salesforce Marketing Cloud linked service properties. +type SalesforceMarketingCloudLinkedServiceTypeProperties struct { + // ClientID - The client ID associated with the Salesforce Marketing Cloud application. Type: string (or Expression with resultType string). + ClientID interface{} `json:"clientId,omitempty"` + // ClientSecret - The client secret associated with the Salesforce Marketing Cloud application. Type: string (or Expression with resultType string). + ClientSecret BasicSecretBase `json:"clientSecret,omitempty"` + // UseEncryptedEndpoints - Specifies whether the data source endpoints are encrypted using HTTPS. The default value is true. Type: boolean (or Expression with resultType boolean). + UseEncryptedEndpoints interface{} `json:"useEncryptedEndpoints,omitempty"` + // UseHostVerification - Specifies whether to require the host name in the server's certificate to match the host name of the server when connecting over SSL. The default value is true. Type: boolean (or Expression with resultType boolean). + UseHostVerification interface{} `json:"useHostVerification,omitempty"` + // UsePeerVerification - Specifies whether to verify the identity of the server when connecting over SSL. The default value is true. Type: boolean (or Expression with resultType boolean). + UsePeerVerification interface{} `json:"usePeerVerification,omitempty"` + // EncryptedCredential - The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string). + EncryptedCredential interface{} `json:"encryptedCredential,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for SalesforceMarketingCloudLinkedServiceTypeProperties struct. +func (smclstp *SalesforceMarketingCloudLinkedServiceTypeProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "clientId": + if v != nil { + var clientID interface{} + err = json.Unmarshal(*v, &clientID) + if err != nil { + return err + } + smclstp.ClientID = clientID + } + case "clientSecret": + if v != nil { + clientSecret, err := unmarshalBasicSecretBase(*v) + if err != nil { + return err + } + smclstp.ClientSecret = clientSecret + } + case "useEncryptedEndpoints": + if v != nil { + var useEncryptedEndpoints interface{} + err = json.Unmarshal(*v, &useEncryptedEndpoints) + if err != nil { + return err + } + smclstp.UseEncryptedEndpoints = useEncryptedEndpoints + } + case "useHostVerification": + if v != nil { + var useHostVerification interface{} + err = json.Unmarshal(*v, &useHostVerification) + if err != nil { + return err + } + smclstp.UseHostVerification = useHostVerification + } + case "usePeerVerification": + if v != nil { + var usePeerVerification interface{} + err = json.Unmarshal(*v, &usePeerVerification) + if err != nil { + return err + } + smclstp.UsePeerVerification = usePeerVerification + } + case "encryptedCredential": + if v != nil { + var encryptedCredential interface{} + err = json.Unmarshal(*v, &encryptedCredential) + if err != nil { + return err + } + smclstp.EncryptedCredential = encryptedCredential + } + } + } + + return nil +} + +// SalesforceMarketingCloudObjectDataset salesforce Marketing Cloud dataset. +type SalesforceMarketingCloudObjectDataset struct { + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Description - Dataset description. + Description *string `json:"description,omitempty"` + // Structure - Columns that define the structure of the dataset. Type: array (or Expression with resultType array), itemType: DatasetDataElement. + Structure interface{} `json:"structure,omitempty"` + // LinkedServiceName - Linked service reference. + LinkedServiceName *LinkedServiceReference `json:"linkedServiceName,omitempty"` + // Parameters - Parameters for dataset. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeDataset', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSQLServerTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSalesforceObject', 'TypeRelationalTable', 'TypeAzureMySQLTable', 'TypeOracleTable', 'TypeODataResource', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeAzureDataLakeStoreFile', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeAmazonS3Object' + Type TypeBasicDataset `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for SalesforceMarketingCloudObjectDataset. +func (smcod SalesforceMarketingCloudObjectDataset) MarshalJSON() ([]byte, error) { + smcod.Type = TypeSalesforceMarketingCloudObject + objectMap := make(map[string]interface{}) + if smcod.Description != nil { + objectMap["description"] = smcod.Description + } + objectMap["structure"] = smcod.Structure + if smcod.LinkedServiceName != nil { + objectMap["linkedServiceName"] = smcod.LinkedServiceName + } + if smcod.Parameters != nil { + objectMap["parameters"] = smcod.Parameters + } + if smcod.Annotations != nil { + objectMap["annotations"] = smcod.Annotations + } + if smcod.Type != "" { + objectMap["type"] = smcod.Type + } + for k, v := range smcod.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysObjectDataset is the BasicDataset implementation for SalesforceMarketingCloudObjectDataset. +func (smcod SalesforceMarketingCloudObjectDataset) AsResponsysObjectDataset() (*ResponsysObjectDataset, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudObjectDataset is the BasicDataset implementation for SalesforceMarketingCloudObjectDataset. +func (smcod SalesforceMarketingCloudObjectDataset) AsSalesforceMarketingCloudObjectDataset() (*SalesforceMarketingCloudObjectDataset, bool) { + return &smcod, true +} + +// AsVerticaTableDataset is the BasicDataset implementation for SalesforceMarketingCloudObjectDataset. +func (smcod SalesforceMarketingCloudObjectDataset) AsVerticaTableDataset() (*VerticaTableDataset, bool) { + return nil, false +} + +// AsNetezzaTableDataset is the BasicDataset implementation for SalesforceMarketingCloudObjectDataset. +func (smcod SalesforceMarketingCloudObjectDataset) AsNetezzaTableDataset() (*NetezzaTableDataset, bool) { + return nil, false +} + +// AsZohoObjectDataset is the BasicDataset implementation for SalesforceMarketingCloudObjectDataset. +func (smcod SalesforceMarketingCloudObjectDataset) AsZohoObjectDataset() (*ZohoObjectDataset, bool) { + return nil, false +} + +// AsXeroObjectDataset is the BasicDataset implementation for SalesforceMarketingCloudObjectDataset. +func (smcod SalesforceMarketingCloudObjectDataset) AsXeroObjectDataset() (*XeroObjectDataset, bool) { + return nil, false +} + +// AsSquareObjectDataset is the BasicDataset implementation for SalesforceMarketingCloudObjectDataset. +func (smcod SalesforceMarketingCloudObjectDataset) AsSquareObjectDataset() (*SquareObjectDataset, bool) { + return nil, false +} + +// AsSparkObjectDataset is the BasicDataset implementation for SalesforceMarketingCloudObjectDataset. +func (smcod SalesforceMarketingCloudObjectDataset) AsSparkObjectDataset() (*SparkObjectDataset, bool) { + return nil, false +} + +// AsShopifyObjectDataset is the BasicDataset implementation for SalesforceMarketingCloudObjectDataset. +func (smcod SalesforceMarketingCloudObjectDataset) AsShopifyObjectDataset() (*ShopifyObjectDataset, bool) { + return nil, false +} + +// AsServiceNowObjectDataset is the BasicDataset implementation for SalesforceMarketingCloudObjectDataset. +func (smcod SalesforceMarketingCloudObjectDataset) AsServiceNowObjectDataset() (*ServiceNowObjectDataset, bool) { + return nil, false +} + +// AsQuickBooksObjectDataset is the BasicDataset implementation for SalesforceMarketingCloudObjectDataset. +func (smcod SalesforceMarketingCloudObjectDataset) AsQuickBooksObjectDataset() (*QuickBooksObjectDataset, bool) { + return nil, false +} + +// AsPrestoObjectDataset is the BasicDataset implementation for SalesforceMarketingCloudObjectDataset. +func (smcod SalesforceMarketingCloudObjectDataset) AsPrestoObjectDataset() (*PrestoObjectDataset, bool) { + return nil, false +} + +// AsPhoenixObjectDataset is the BasicDataset implementation for SalesforceMarketingCloudObjectDataset. +func (smcod SalesforceMarketingCloudObjectDataset) AsPhoenixObjectDataset() (*PhoenixObjectDataset, bool) { + return nil, false +} + +// AsPaypalObjectDataset is the BasicDataset implementation for SalesforceMarketingCloudObjectDataset. +func (smcod SalesforceMarketingCloudObjectDataset) AsPaypalObjectDataset() (*PaypalObjectDataset, bool) { + return nil, false +} + +// AsMarketoObjectDataset is the BasicDataset implementation for SalesforceMarketingCloudObjectDataset. +func (smcod SalesforceMarketingCloudObjectDataset) AsMarketoObjectDataset() (*MarketoObjectDataset, bool) { + return nil, false +} + +// AsMariaDBTableDataset is the BasicDataset implementation for SalesforceMarketingCloudObjectDataset. +func (smcod SalesforceMarketingCloudObjectDataset) AsMariaDBTableDataset() (*MariaDBTableDataset, bool) { + return nil, false +} + +// AsMagentoObjectDataset is the BasicDataset implementation for SalesforceMarketingCloudObjectDataset. +func (smcod SalesforceMarketingCloudObjectDataset) AsMagentoObjectDataset() (*MagentoObjectDataset, bool) { + return nil, false +} + +// AsJiraObjectDataset is the BasicDataset implementation for SalesforceMarketingCloudObjectDataset. +func (smcod SalesforceMarketingCloudObjectDataset) AsJiraObjectDataset() (*JiraObjectDataset, bool) { + return nil, false +} + +// AsImpalaObjectDataset is the BasicDataset implementation for SalesforceMarketingCloudObjectDataset. +func (smcod SalesforceMarketingCloudObjectDataset) AsImpalaObjectDataset() (*ImpalaObjectDataset, bool) { + return nil, false +} + +// AsHubspotObjectDataset is the BasicDataset implementation for SalesforceMarketingCloudObjectDataset. +func (smcod SalesforceMarketingCloudObjectDataset) AsHubspotObjectDataset() (*HubspotObjectDataset, bool) { + return nil, false +} + +// AsHiveObjectDataset is the BasicDataset implementation for SalesforceMarketingCloudObjectDataset. +func (smcod SalesforceMarketingCloudObjectDataset) AsHiveObjectDataset() (*HiveObjectDataset, bool) { + return nil, false +} + +// AsHBaseObjectDataset is the BasicDataset implementation for SalesforceMarketingCloudObjectDataset. +func (smcod SalesforceMarketingCloudObjectDataset) AsHBaseObjectDataset() (*HBaseObjectDataset, bool) { + return nil, false +} + +// AsGreenplumTableDataset is the BasicDataset implementation for SalesforceMarketingCloudObjectDataset. +func (smcod SalesforceMarketingCloudObjectDataset) AsGreenplumTableDataset() (*GreenplumTableDataset, bool) { + return nil, false +} + +// AsGoogleBigQueryObjectDataset is the BasicDataset implementation for SalesforceMarketingCloudObjectDataset. +func (smcod SalesforceMarketingCloudObjectDataset) AsGoogleBigQueryObjectDataset() (*GoogleBigQueryObjectDataset, bool) { + return nil, false +} + +// AsEloquaObjectDataset is the BasicDataset implementation for SalesforceMarketingCloudObjectDataset. +func (smcod SalesforceMarketingCloudObjectDataset) AsEloquaObjectDataset() (*EloquaObjectDataset, bool) { + return nil, false +} + +// AsDrillTableDataset is the BasicDataset implementation for SalesforceMarketingCloudObjectDataset. +func (smcod SalesforceMarketingCloudObjectDataset) AsDrillTableDataset() (*DrillTableDataset, bool) { + return nil, false +} + +// AsCouchbaseTableDataset is the BasicDataset implementation for SalesforceMarketingCloudObjectDataset. +func (smcod SalesforceMarketingCloudObjectDataset) AsCouchbaseTableDataset() (*CouchbaseTableDataset, bool) { + return nil, false +} + +// AsConcurObjectDataset is the BasicDataset implementation for SalesforceMarketingCloudObjectDataset. +func (smcod SalesforceMarketingCloudObjectDataset) AsConcurObjectDataset() (*ConcurObjectDataset, bool) { + return nil, false +} + +// AsAzurePostgreSQLTableDataset is the BasicDataset implementation for SalesforceMarketingCloudObjectDataset. +func (smcod SalesforceMarketingCloudObjectDataset) AsAzurePostgreSQLTableDataset() (*AzurePostgreSQLTableDataset, bool) { + return nil, false +} + +// AsAmazonMWSObjectDataset is the BasicDataset implementation for SalesforceMarketingCloudObjectDataset. +func (smcod SalesforceMarketingCloudObjectDataset) AsAmazonMWSObjectDataset() (*AmazonMWSObjectDataset, bool) { + return nil, false +} + +// AsHTTPDataset is the BasicDataset implementation for SalesforceMarketingCloudObjectDataset. +func (smcod SalesforceMarketingCloudObjectDataset) AsHTTPDataset() (*HTTPDataset, bool) { + return nil, false +} + +// AsAzureSearchIndexDataset is the BasicDataset implementation for SalesforceMarketingCloudObjectDataset. +func (smcod SalesforceMarketingCloudObjectDataset) AsAzureSearchIndexDataset() (*AzureSearchIndexDataset, bool) { + return nil, false +} + +// AsWebTableDataset is the BasicDataset implementation for SalesforceMarketingCloudObjectDataset. +func (smcod SalesforceMarketingCloudObjectDataset) AsWebTableDataset() (*WebTableDataset, bool) { + return nil, false +} + +// AsSQLServerTableDataset is the BasicDataset implementation for SalesforceMarketingCloudObjectDataset. +func (smcod SalesforceMarketingCloudObjectDataset) AsSQLServerTableDataset() (*SQLServerTableDataset, bool) { + return nil, false +} + +// AsSapEccResourceDataset is the BasicDataset implementation for SalesforceMarketingCloudObjectDataset. +func (smcod SalesforceMarketingCloudObjectDataset) AsSapEccResourceDataset() (*SapEccResourceDataset, bool) { + return nil, false +} + +// AsSapCloudForCustomerResourceDataset is the BasicDataset implementation for SalesforceMarketingCloudObjectDataset. +func (smcod SalesforceMarketingCloudObjectDataset) AsSapCloudForCustomerResourceDataset() (*SapCloudForCustomerResourceDataset, bool) { + return nil, false +} + +// AsSalesforceObjectDataset is the BasicDataset implementation for SalesforceMarketingCloudObjectDataset. +func (smcod SalesforceMarketingCloudObjectDataset) AsSalesforceObjectDataset() (*SalesforceObjectDataset, bool) { + return nil, false +} + +// AsRelationalTableDataset is the BasicDataset implementation for SalesforceMarketingCloudObjectDataset. +func (smcod SalesforceMarketingCloudObjectDataset) AsRelationalTableDataset() (*RelationalTableDataset, bool) { + return nil, false +} + +// AsAzureMySQLTableDataset is the BasicDataset implementation for SalesforceMarketingCloudObjectDataset. +func (smcod SalesforceMarketingCloudObjectDataset) AsAzureMySQLTableDataset() (*AzureMySQLTableDataset, bool) { + return nil, false +} + +// AsOracleTableDataset is the BasicDataset implementation for SalesforceMarketingCloudObjectDataset. +func (smcod SalesforceMarketingCloudObjectDataset) AsOracleTableDataset() (*OracleTableDataset, bool) { + return nil, false +} + +// AsODataResourceDataset is the BasicDataset implementation for SalesforceMarketingCloudObjectDataset. +func (smcod SalesforceMarketingCloudObjectDataset) AsODataResourceDataset() (*ODataResourceDataset, bool) { + return nil, false +} + +// AsMongoDbCollectionDataset is the BasicDataset implementation for SalesforceMarketingCloudObjectDataset. +func (smcod SalesforceMarketingCloudObjectDataset) AsMongoDbCollectionDataset() (*MongoDbCollectionDataset, bool) { + return nil, false +} + +// AsFileShareDataset is the BasicDataset implementation for SalesforceMarketingCloudObjectDataset. +func (smcod SalesforceMarketingCloudObjectDataset) AsFileShareDataset() (*FileShareDataset, bool) { + return nil, false +} + +// AsAzureDataLakeStoreDataset is the BasicDataset implementation for SalesforceMarketingCloudObjectDataset. +func (smcod SalesforceMarketingCloudObjectDataset) AsAzureDataLakeStoreDataset() (*AzureDataLakeStoreDataset, bool) { + return nil, false +} + +// AsDynamicsEntityDataset is the BasicDataset implementation for SalesforceMarketingCloudObjectDataset. +func (smcod SalesforceMarketingCloudObjectDataset) AsDynamicsEntityDataset() (*DynamicsEntityDataset, bool) { + return nil, false +} + +// AsDocumentDbCollectionDataset is the BasicDataset implementation for SalesforceMarketingCloudObjectDataset. +func (smcod SalesforceMarketingCloudObjectDataset) AsDocumentDbCollectionDataset() (*DocumentDbCollectionDataset, bool) { + return nil, false +} + +// AsCustomDataset is the BasicDataset implementation for SalesforceMarketingCloudObjectDataset. +func (smcod SalesforceMarketingCloudObjectDataset) AsCustomDataset() (*CustomDataset, bool) { + return nil, false +} + +// AsCassandraTableDataset is the BasicDataset implementation for SalesforceMarketingCloudObjectDataset. +func (smcod SalesforceMarketingCloudObjectDataset) AsCassandraTableDataset() (*CassandraTableDataset, bool) { + return nil, false +} + +// AsAzureSQLDWTableDataset is the BasicDataset implementation for SalesforceMarketingCloudObjectDataset. +func (smcod SalesforceMarketingCloudObjectDataset) AsAzureSQLDWTableDataset() (*AzureSQLDWTableDataset, bool) { + return nil, false +} + +// AsAzureSQLTableDataset is the BasicDataset implementation for SalesforceMarketingCloudObjectDataset. +func (smcod SalesforceMarketingCloudObjectDataset) AsAzureSQLTableDataset() (*AzureSQLTableDataset, bool) { + return nil, false +} + +// AsAzureTableDataset is the BasicDataset implementation for SalesforceMarketingCloudObjectDataset. +func (smcod SalesforceMarketingCloudObjectDataset) AsAzureTableDataset() (*AzureTableDataset, bool) { + return nil, false +} + +// AsAzureBlobDataset is the BasicDataset implementation for SalesforceMarketingCloudObjectDataset. +func (smcod SalesforceMarketingCloudObjectDataset) AsAzureBlobDataset() (*AzureBlobDataset, bool) { + return nil, false +} + +// AsAmazonS3Dataset is the BasicDataset implementation for SalesforceMarketingCloudObjectDataset. +func (smcod SalesforceMarketingCloudObjectDataset) AsAmazonS3Dataset() (*AmazonS3Dataset, bool) { + return nil, false +} + +// AsDataset is the BasicDataset implementation for SalesforceMarketingCloudObjectDataset. +func (smcod SalesforceMarketingCloudObjectDataset) AsDataset() (*Dataset, bool) { + return nil, false +} + +// AsBasicDataset is the BasicDataset implementation for SalesforceMarketingCloudObjectDataset. +func (smcod SalesforceMarketingCloudObjectDataset) AsBasicDataset() (BasicDataset, bool) { + return &smcod, true +} + +// SalesforceMarketingCloudSource a copy activity Salesforce Marketing Cloud source. +type SalesforceMarketingCloudSource struct { + // Query - A query to retrieve data from source. Type: string (or Expression with resultType string). + Query interface{} `json:"query,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // SourceRetryCount - Source retry count. Type: integer (or Expression with resultType integer). + SourceRetryCount interface{} `json:"sourceRetryCount,omitempty"` + // SourceRetryWait - Source retry wait. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` + // Type - Possible values include: 'TypeCopySource', 'TypeAmazonRedshiftSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeHTTPSource', 'TypeAzureDataLakeStoreSource', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeRelationalSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource' + Type TypeBasicCopySource `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for SalesforceMarketingCloudSource. +func (smcs SalesforceMarketingCloudSource) MarshalJSON() ([]byte, error) { + smcs.Type = TypeSalesforceMarketingCloudSource + objectMap := make(map[string]interface{}) + objectMap["query"] = smcs.Query + objectMap["sourceRetryCount"] = smcs.SourceRetryCount + objectMap["sourceRetryWait"] = smcs.SourceRetryWait + if smcs.Type != "" { + objectMap["type"] = smcs.Type + } + for k, v := range smcs.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsAmazonRedshiftSource is the BasicCopySource implementation for SalesforceMarketingCloudSource. +func (smcs SalesforceMarketingCloudSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { + return nil, false +} + +// AsResponsysSource is the BasicCopySource implementation for SalesforceMarketingCloudSource. +func (smcs SalesforceMarketingCloudSource) AsResponsysSource() (*ResponsysSource, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudSource is the BasicCopySource implementation for SalesforceMarketingCloudSource. +func (smcs SalesforceMarketingCloudSource) AsSalesforceMarketingCloudSource() (*SalesforceMarketingCloudSource, bool) { + return &smcs, true +} + +// AsVerticaSource is the BasicCopySource implementation for SalesforceMarketingCloudSource. +func (smcs SalesforceMarketingCloudSource) AsVerticaSource() (*VerticaSource, bool) { + return nil, false +} + +// AsNetezzaSource is the BasicCopySource implementation for SalesforceMarketingCloudSource. +func (smcs SalesforceMarketingCloudSource) AsNetezzaSource() (*NetezzaSource, bool) { + return nil, false +} + +// AsZohoSource is the BasicCopySource implementation for SalesforceMarketingCloudSource. +func (smcs SalesforceMarketingCloudSource) AsZohoSource() (*ZohoSource, bool) { + return nil, false +} + +// AsXeroSource is the BasicCopySource implementation for SalesforceMarketingCloudSource. +func (smcs SalesforceMarketingCloudSource) AsXeroSource() (*XeroSource, bool) { + return nil, false +} + +// AsSquareSource is the BasicCopySource implementation for SalesforceMarketingCloudSource. +func (smcs SalesforceMarketingCloudSource) AsSquareSource() (*SquareSource, bool) { + return nil, false +} + +// AsSparkSource is the BasicCopySource implementation for SalesforceMarketingCloudSource. +func (smcs SalesforceMarketingCloudSource) AsSparkSource() (*SparkSource, bool) { + return nil, false +} + +// AsShopifySource is the BasicCopySource implementation for SalesforceMarketingCloudSource. +func (smcs SalesforceMarketingCloudSource) AsShopifySource() (*ShopifySource, bool) { + return nil, false +} + +// AsServiceNowSource is the BasicCopySource implementation for SalesforceMarketingCloudSource. +func (smcs SalesforceMarketingCloudSource) AsServiceNowSource() (*ServiceNowSource, bool) { + return nil, false +} + +// AsQuickBooksSource is the BasicCopySource implementation for SalesforceMarketingCloudSource. +func (smcs SalesforceMarketingCloudSource) AsQuickBooksSource() (*QuickBooksSource, bool) { + return nil, false +} + +// AsPrestoSource is the BasicCopySource implementation for SalesforceMarketingCloudSource. +func (smcs SalesforceMarketingCloudSource) AsPrestoSource() (*PrestoSource, bool) { + return nil, false +} + +// AsPhoenixSource is the BasicCopySource implementation for SalesforceMarketingCloudSource. +func (smcs SalesforceMarketingCloudSource) AsPhoenixSource() (*PhoenixSource, bool) { + return nil, false +} + +// AsPaypalSource is the BasicCopySource implementation for SalesforceMarketingCloudSource. +func (smcs SalesforceMarketingCloudSource) AsPaypalSource() (*PaypalSource, bool) { + return nil, false +} + +// AsMarketoSource is the BasicCopySource implementation for SalesforceMarketingCloudSource. +func (smcs SalesforceMarketingCloudSource) AsMarketoSource() (*MarketoSource, bool) { + return nil, false +} + +// AsMariaDBSource is the BasicCopySource implementation for SalesforceMarketingCloudSource. +func (smcs SalesforceMarketingCloudSource) AsMariaDBSource() (*MariaDBSource, bool) { + return nil, false +} + +// AsMagentoSource is the BasicCopySource implementation for SalesforceMarketingCloudSource. +func (smcs SalesforceMarketingCloudSource) AsMagentoSource() (*MagentoSource, bool) { + return nil, false +} + +// AsJiraSource is the BasicCopySource implementation for SalesforceMarketingCloudSource. +func (smcs SalesforceMarketingCloudSource) AsJiraSource() (*JiraSource, bool) { + return nil, false +} + +// AsImpalaSource is the BasicCopySource implementation for SalesforceMarketingCloudSource. +func (smcs SalesforceMarketingCloudSource) AsImpalaSource() (*ImpalaSource, bool) { + return nil, false +} + +// AsHubspotSource is the BasicCopySource implementation for SalesforceMarketingCloudSource. +func (smcs SalesforceMarketingCloudSource) AsHubspotSource() (*HubspotSource, bool) { + return nil, false +} + +// AsHiveSource is the BasicCopySource implementation for SalesforceMarketingCloudSource. +func (smcs SalesforceMarketingCloudSource) AsHiveSource() (*HiveSource, bool) { + return nil, false +} + +// AsHBaseSource is the BasicCopySource implementation for SalesforceMarketingCloudSource. +func (smcs SalesforceMarketingCloudSource) AsHBaseSource() (*HBaseSource, bool) { + return nil, false +} + +// AsGreenplumSource is the BasicCopySource implementation for SalesforceMarketingCloudSource. +func (smcs SalesforceMarketingCloudSource) AsGreenplumSource() (*GreenplumSource, bool) { + return nil, false +} + +// AsGoogleBigQuerySource is the BasicCopySource implementation for SalesforceMarketingCloudSource. +func (smcs SalesforceMarketingCloudSource) AsGoogleBigQuerySource() (*GoogleBigQuerySource, bool) { + return nil, false +} + +// AsEloquaSource is the BasicCopySource implementation for SalesforceMarketingCloudSource. +func (smcs SalesforceMarketingCloudSource) AsEloquaSource() (*EloquaSource, bool) { + return nil, false +} + +// AsDrillSource is the BasicCopySource implementation for SalesforceMarketingCloudSource. +func (smcs SalesforceMarketingCloudSource) AsDrillSource() (*DrillSource, bool) { + return nil, false +} + +// AsCouchbaseSource is the BasicCopySource implementation for SalesforceMarketingCloudSource. +func (smcs SalesforceMarketingCloudSource) AsCouchbaseSource() (*CouchbaseSource, bool) { + return nil, false +} + +// AsConcurSource is the BasicCopySource implementation for SalesforceMarketingCloudSource. +func (smcs SalesforceMarketingCloudSource) AsConcurSource() (*ConcurSource, bool) { + return nil, false +} + +// AsAzurePostgreSQLSource is the BasicCopySource implementation for SalesforceMarketingCloudSource. +func (smcs SalesforceMarketingCloudSource) AsAzurePostgreSQLSource() (*AzurePostgreSQLSource, bool) { + return nil, false +} + +// AsAmazonMWSSource is the BasicCopySource implementation for SalesforceMarketingCloudSource. +func (smcs SalesforceMarketingCloudSource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { + return nil, false +} + +// AsHTTPSource is the BasicCopySource implementation for SalesforceMarketingCloudSource. +func (smcs SalesforceMarketingCloudSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for SalesforceMarketingCloudSource. +func (smcs SalesforceMarketingCloudSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for SalesforceMarketingCloudSource. +func (smcs SalesforceMarketingCloudSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsCassandraSource is the BasicCopySource implementation for SalesforceMarketingCloudSource. +func (smcs SalesforceMarketingCloudSource) AsCassandraSource() (*CassandraSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for SalesforceMarketingCloudSource. +func (smcs SalesforceMarketingCloudSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for SalesforceMarketingCloudSource. +func (smcs SalesforceMarketingCloudSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureMySQLSource is the BasicCopySource implementation for SalesforceMarketingCloudSource. +func (smcs SalesforceMarketingCloudSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for SalesforceMarketingCloudSource. +func (smcs SalesforceMarketingCloudSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for SalesforceMarketingCloudSource. +func (smcs SalesforceMarketingCloudSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsSQLDWSource is the BasicCopySource implementation for SalesforceMarketingCloudSource. +func (smcs SalesforceMarketingCloudSource) AsSQLDWSource() (*SQLDWSource, bool) { + return nil, false +} + +// AsSQLSource is the BasicCopySource implementation for SalesforceMarketingCloudSource. +func (smcs SalesforceMarketingCloudSource) AsSQLSource() (*SQLSource, bool) { + return nil, false +} + +// AsSapEccSource is the BasicCopySource implementation for SalesforceMarketingCloudSource. +func (smcs SalesforceMarketingCloudSource) AsSapEccSource() (*SapEccSource, bool) { + return nil, false +} + +// AsSapCloudForCustomerSource is the BasicCopySource implementation for SalesforceMarketingCloudSource. +func (smcs SalesforceMarketingCloudSource) AsSapCloudForCustomerSource() (*SapCloudForCustomerSource, bool) { + return nil, false +} + +// AsSalesforceSource is the BasicCopySource implementation for SalesforceMarketingCloudSource. +func (smcs SalesforceMarketingCloudSource) AsSalesforceSource() (*SalesforceSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for SalesforceMarketingCloudSource. +func (smcs SalesforceMarketingCloudSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for SalesforceMarketingCloudSource. +func (smcs SalesforceMarketingCloudSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for SalesforceMarketingCloudSource. +func (smcs SalesforceMarketingCloudSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for SalesforceMarketingCloudSource. +func (smcs SalesforceMarketingCloudSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + +// AsAzureTableSource is the BasicCopySource implementation for SalesforceMarketingCloudSource. +func (smcs SalesforceMarketingCloudSource) AsAzureTableSource() (*AzureTableSource, bool) { + return nil, false +} + +// AsCopySource is the BasicCopySource implementation for SalesforceMarketingCloudSource. +func (smcs SalesforceMarketingCloudSource) AsCopySource() (*CopySource, bool) { + return nil, false +} + +// AsBasicCopySource is the BasicCopySource implementation for SalesforceMarketingCloudSource. +func (smcs SalesforceMarketingCloudSource) AsBasicCopySource() (BasicCopySource, bool) { + return &smcs, true +} + +// SalesforceObjectDataset the Salesforce object dataset. +type SalesforceObjectDataset struct { + // SalesforceObjectDatasetTypeProperties - Salesforce object dataset properties. + *SalesforceObjectDatasetTypeProperties `json:"typeProperties,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Description - Dataset description. + Description *string `json:"description,omitempty"` + // Structure - Columns that define the structure of the dataset. Type: array (or Expression with resultType array), itemType: DatasetDataElement. + Structure interface{} `json:"structure,omitempty"` + // LinkedServiceName - Linked service reference. + LinkedServiceName *LinkedServiceReference `json:"linkedServiceName,omitempty"` + // Parameters - Parameters for dataset. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeDataset', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSQLServerTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSalesforceObject', 'TypeRelationalTable', 'TypeAzureMySQLTable', 'TypeOracleTable', 'TypeODataResource', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeAzureDataLakeStoreFile', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeAmazonS3Object' + Type TypeBasicDataset `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for SalesforceObjectDataset. +func (sod SalesforceObjectDataset) MarshalJSON() ([]byte, error) { + sod.Type = TypeSalesforceObject + objectMap := make(map[string]interface{}) + if sod.SalesforceObjectDatasetTypeProperties != nil { + objectMap["typeProperties"] = sod.SalesforceObjectDatasetTypeProperties + } + if sod.Description != nil { + objectMap["description"] = sod.Description + } + objectMap["structure"] = sod.Structure + if sod.LinkedServiceName != nil { + objectMap["linkedServiceName"] = sod.LinkedServiceName + } + if sod.Parameters != nil { + objectMap["parameters"] = sod.Parameters + } + if sod.Annotations != nil { + objectMap["annotations"] = sod.Annotations + } + if sod.Type != "" { + objectMap["type"] = sod.Type + } + for k, v := range sod.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysObjectDataset is the BasicDataset implementation for SalesforceObjectDataset. +func (sod SalesforceObjectDataset) AsResponsysObjectDataset() (*ResponsysObjectDataset, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudObjectDataset is the BasicDataset implementation for SalesforceObjectDataset. +func (sod SalesforceObjectDataset) AsSalesforceMarketingCloudObjectDataset() (*SalesforceMarketingCloudObjectDataset, bool) { + return nil, false +} + +// AsVerticaTableDataset is the BasicDataset implementation for SalesforceObjectDataset. +func (sod SalesforceObjectDataset) AsVerticaTableDataset() (*VerticaTableDataset, bool) { + return nil, false +} + +// AsNetezzaTableDataset is the BasicDataset implementation for SalesforceObjectDataset. +func (sod SalesforceObjectDataset) AsNetezzaTableDataset() (*NetezzaTableDataset, bool) { + return nil, false +} + +// AsZohoObjectDataset is the BasicDataset implementation for SalesforceObjectDataset. +func (sod SalesforceObjectDataset) AsZohoObjectDataset() (*ZohoObjectDataset, bool) { + return nil, false +} + +// AsXeroObjectDataset is the BasicDataset implementation for SalesforceObjectDataset. +func (sod SalesforceObjectDataset) AsXeroObjectDataset() (*XeroObjectDataset, bool) { + return nil, false +} + +// AsSquareObjectDataset is the BasicDataset implementation for SalesforceObjectDataset. +func (sod SalesforceObjectDataset) AsSquareObjectDataset() (*SquareObjectDataset, bool) { + return nil, false +} + +// AsSparkObjectDataset is the BasicDataset implementation for SalesforceObjectDataset. +func (sod SalesforceObjectDataset) AsSparkObjectDataset() (*SparkObjectDataset, bool) { + return nil, false +} + +// AsShopifyObjectDataset is the BasicDataset implementation for SalesforceObjectDataset. +func (sod SalesforceObjectDataset) AsShopifyObjectDataset() (*ShopifyObjectDataset, bool) { + return nil, false +} + +// AsServiceNowObjectDataset is the BasicDataset implementation for SalesforceObjectDataset. +func (sod SalesforceObjectDataset) AsServiceNowObjectDataset() (*ServiceNowObjectDataset, bool) { + return nil, false +} + +// AsQuickBooksObjectDataset is the BasicDataset implementation for SalesforceObjectDataset. +func (sod SalesforceObjectDataset) AsQuickBooksObjectDataset() (*QuickBooksObjectDataset, bool) { + return nil, false +} + +// AsPrestoObjectDataset is the BasicDataset implementation for SalesforceObjectDataset. +func (sod SalesforceObjectDataset) AsPrestoObjectDataset() (*PrestoObjectDataset, bool) { + return nil, false +} + +// AsPhoenixObjectDataset is the BasicDataset implementation for SalesforceObjectDataset. +func (sod SalesforceObjectDataset) AsPhoenixObjectDataset() (*PhoenixObjectDataset, bool) { + return nil, false +} + +// AsPaypalObjectDataset is the BasicDataset implementation for SalesforceObjectDataset. +func (sod SalesforceObjectDataset) AsPaypalObjectDataset() (*PaypalObjectDataset, bool) { + return nil, false +} + +// AsMarketoObjectDataset is the BasicDataset implementation for SalesforceObjectDataset. +func (sod SalesforceObjectDataset) AsMarketoObjectDataset() (*MarketoObjectDataset, bool) { + return nil, false +} + +// AsMariaDBTableDataset is the BasicDataset implementation for SalesforceObjectDataset. +func (sod SalesforceObjectDataset) AsMariaDBTableDataset() (*MariaDBTableDataset, bool) { + return nil, false +} + +// AsMagentoObjectDataset is the BasicDataset implementation for SalesforceObjectDataset. +func (sod SalesforceObjectDataset) AsMagentoObjectDataset() (*MagentoObjectDataset, bool) { + return nil, false +} + +// AsJiraObjectDataset is the BasicDataset implementation for SalesforceObjectDataset. +func (sod SalesforceObjectDataset) AsJiraObjectDataset() (*JiraObjectDataset, bool) { + return nil, false +} + +// AsImpalaObjectDataset is the BasicDataset implementation for SalesforceObjectDataset. +func (sod SalesforceObjectDataset) AsImpalaObjectDataset() (*ImpalaObjectDataset, bool) { + return nil, false +} + +// AsHubspotObjectDataset is the BasicDataset implementation for SalesforceObjectDataset. +func (sod SalesforceObjectDataset) AsHubspotObjectDataset() (*HubspotObjectDataset, bool) { + return nil, false +} + +// AsHiveObjectDataset is the BasicDataset implementation for SalesforceObjectDataset. +func (sod SalesforceObjectDataset) AsHiveObjectDataset() (*HiveObjectDataset, bool) { + return nil, false +} + +// AsHBaseObjectDataset is the BasicDataset implementation for SalesforceObjectDataset. +func (sod SalesforceObjectDataset) AsHBaseObjectDataset() (*HBaseObjectDataset, bool) { + return nil, false +} + +// AsGreenplumTableDataset is the BasicDataset implementation for SalesforceObjectDataset. +func (sod SalesforceObjectDataset) AsGreenplumTableDataset() (*GreenplumTableDataset, bool) { + return nil, false +} + +// AsGoogleBigQueryObjectDataset is the BasicDataset implementation for SalesforceObjectDataset. +func (sod SalesforceObjectDataset) AsGoogleBigQueryObjectDataset() (*GoogleBigQueryObjectDataset, bool) { + return nil, false +} + +// AsEloquaObjectDataset is the BasicDataset implementation for SalesforceObjectDataset. +func (sod SalesforceObjectDataset) AsEloquaObjectDataset() (*EloquaObjectDataset, bool) { + return nil, false +} + +// AsDrillTableDataset is the BasicDataset implementation for SalesforceObjectDataset. +func (sod SalesforceObjectDataset) AsDrillTableDataset() (*DrillTableDataset, bool) { + return nil, false +} + +// AsCouchbaseTableDataset is the BasicDataset implementation for SalesforceObjectDataset. +func (sod SalesforceObjectDataset) AsCouchbaseTableDataset() (*CouchbaseTableDataset, bool) { + return nil, false +} + +// AsConcurObjectDataset is the BasicDataset implementation for SalesforceObjectDataset. +func (sod SalesforceObjectDataset) AsConcurObjectDataset() (*ConcurObjectDataset, bool) { + return nil, false +} + +// AsAzurePostgreSQLTableDataset is the BasicDataset implementation for SalesforceObjectDataset. +func (sod SalesforceObjectDataset) AsAzurePostgreSQLTableDataset() (*AzurePostgreSQLTableDataset, bool) { + return nil, false +} + +// AsAmazonMWSObjectDataset is the BasicDataset implementation for SalesforceObjectDataset. +func (sod SalesforceObjectDataset) AsAmazonMWSObjectDataset() (*AmazonMWSObjectDataset, bool) { + return nil, false +} + +// AsHTTPDataset is the BasicDataset implementation for SalesforceObjectDataset. +func (sod SalesforceObjectDataset) AsHTTPDataset() (*HTTPDataset, bool) { + return nil, false +} + +// AsAzureSearchIndexDataset is the BasicDataset implementation for SalesforceObjectDataset. +func (sod SalesforceObjectDataset) AsAzureSearchIndexDataset() (*AzureSearchIndexDataset, bool) { + return nil, false +} + +// AsWebTableDataset is the BasicDataset implementation for SalesforceObjectDataset. +func (sod SalesforceObjectDataset) AsWebTableDataset() (*WebTableDataset, bool) { + return nil, false +} + +// AsSQLServerTableDataset is the BasicDataset implementation for SalesforceObjectDataset. +func (sod SalesforceObjectDataset) AsSQLServerTableDataset() (*SQLServerTableDataset, bool) { + return nil, false +} + +// AsSapEccResourceDataset is the BasicDataset implementation for SalesforceObjectDataset. +func (sod SalesforceObjectDataset) AsSapEccResourceDataset() (*SapEccResourceDataset, bool) { + return nil, false +} + +// AsSapCloudForCustomerResourceDataset is the BasicDataset implementation for SalesforceObjectDataset. +func (sod SalesforceObjectDataset) AsSapCloudForCustomerResourceDataset() (*SapCloudForCustomerResourceDataset, bool) { + return nil, false +} + +// AsSalesforceObjectDataset is the BasicDataset implementation for SalesforceObjectDataset. +func (sod SalesforceObjectDataset) AsSalesforceObjectDataset() (*SalesforceObjectDataset, bool) { + return &sod, true +} + +// AsRelationalTableDataset is the BasicDataset implementation for SalesforceObjectDataset. +func (sod SalesforceObjectDataset) AsRelationalTableDataset() (*RelationalTableDataset, bool) { + return nil, false +} + +// AsAzureMySQLTableDataset is the BasicDataset implementation for SalesforceObjectDataset. +func (sod SalesforceObjectDataset) AsAzureMySQLTableDataset() (*AzureMySQLTableDataset, bool) { + return nil, false +} + +// AsOracleTableDataset is the BasicDataset implementation for SalesforceObjectDataset. +func (sod SalesforceObjectDataset) AsOracleTableDataset() (*OracleTableDataset, bool) { + return nil, false +} + +// AsODataResourceDataset is the BasicDataset implementation for SalesforceObjectDataset. +func (sod SalesforceObjectDataset) AsODataResourceDataset() (*ODataResourceDataset, bool) { + return nil, false +} + +// AsMongoDbCollectionDataset is the BasicDataset implementation for SalesforceObjectDataset. +func (sod SalesforceObjectDataset) AsMongoDbCollectionDataset() (*MongoDbCollectionDataset, bool) { + return nil, false +} + +// AsFileShareDataset is the BasicDataset implementation for SalesforceObjectDataset. +func (sod SalesforceObjectDataset) AsFileShareDataset() (*FileShareDataset, bool) { + return nil, false +} + +// AsAzureDataLakeStoreDataset is the BasicDataset implementation for SalesforceObjectDataset. +func (sod SalesforceObjectDataset) AsAzureDataLakeStoreDataset() (*AzureDataLakeStoreDataset, bool) { + return nil, false +} + +// AsDynamicsEntityDataset is the BasicDataset implementation for SalesforceObjectDataset. +func (sod SalesforceObjectDataset) AsDynamicsEntityDataset() (*DynamicsEntityDataset, bool) { + return nil, false +} + +// AsDocumentDbCollectionDataset is the BasicDataset implementation for SalesforceObjectDataset. +func (sod SalesforceObjectDataset) AsDocumentDbCollectionDataset() (*DocumentDbCollectionDataset, bool) { + return nil, false +} + +// AsCustomDataset is the BasicDataset implementation for SalesforceObjectDataset. +func (sod SalesforceObjectDataset) AsCustomDataset() (*CustomDataset, bool) { + return nil, false +} + +// AsCassandraTableDataset is the BasicDataset implementation for SalesforceObjectDataset. +func (sod SalesforceObjectDataset) AsCassandraTableDataset() (*CassandraTableDataset, bool) { + return nil, false +} + +// AsAzureSQLDWTableDataset is the BasicDataset implementation for SalesforceObjectDataset. +func (sod SalesforceObjectDataset) AsAzureSQLDWTableDataset() (*AzureSQLDWTableDataset, bool) { + return nil, false +} + +// AsAzureSQLTableDataset is the BasicDataset implementation for SalesforceObjectDataset. +func (sod SalesforceObjectDataset) AsAzureSQLTableDataset() (*AzureSQLTableDataset, bool) { + return nil, false +} + +// AsAzureTableDataset is the BasicDataset implementation for SalesforceObjectDataset. +func (sod SalesforceObjectDataset) AsAzureTableDataset() (*AzureTableDataset, bool) { + return nil, false +} + +// AsAzureBlobDataset is the BasicDataset implementation for SalesforceObjectDataset. +func (sod SalesforceObjectDataset) AsAzureBlobDataset() (*AzureBlobDataset, bool) { + return nil, false +} + +// AsAmazonS3Dataset is the BasicDataset implementation for SalesforceObjectDataset. +func (sod SalesforceObjectDataset) AsAmazonS3Dataset() (*AmazonS3Dataset, bool) { + return nil, false +} + +// AsDataset is the BasicDataset implementation for SalesforceObjectDataset. +func (sod SalesforceObjectDataset) AsDataset() (*Dataset, bool) { + return nil, false +} + +// AsBasicDataset is the BasicDataset implementation for SalesforceObjectDataset. +func (sod SalesforceObjectDataset) AsBasicDataset() (BasicDataset, bool) { + return &sod, true +} + +// UnmarshalJSON is the custom unmarshaler for SalesforceObjectDataset struct. +func (sod *SalesforceObjectDataset) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "typeProperties": + if v != nil { + var salesforceObjectDatasetTypeProperties SalesforceObjectDatasetTypeProperties + err = json.Unmarshal(*v, &salesforceObjectDatasetTypeProperties) + if err != nil { + return err + } + sod.SalesforceObjectDatasetTypeProperties = &salesforceObjectDatasetTypeProperties + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if sod.AdditionalProperties == nil { + sod.AdditionalProperties = make(map[string]interface{}) + } + sod.AdditionalProperties[k] = additionalProperties + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + sod.Description = &description + } + case "structure": + if v != nil { + var structure interface{} + err = json.Unmarshal(*v, &structure) + if err != nil { + return err + } + sod.Structure = structure + } + case "linkedServiceName": + if v != nil { + var linkedServiceName LinkedServiceReference + err = json.Unmarshal(*v, &linkedServiceName) + if err != nil { + return err + } + sod.LinkedServiceName = &linkedServiceName + } + case "parameters": + if v != nil { + var parameters map[string]*ParameterSpecification + err = json.Unmarshal(*v, ¶meters) + if err != nil { + return err + } + sod.Parameters = parameters + } + case "annotations": + if v != nil { + var annotations []interface{} + err = json.Unmarshal(*v, &annotations) + if err != nil { + return err + } + sod.Annotations = &annotations + } + case "type": + if v != nil { + var typeVar TypeBasicDataset + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + sod.Type = typeVar + } + } + } + + return nil +} + +// SalesforceObjectDatasetTypeProperties salesforce object dataset properties. +type SalesforceObjectDatasetTypeProperties struct { + // ObjectAPIName - The Salesforce object API name. Type: string (or Expression with resultType string). + ObjectAPIName interface{} `json:"objectApiName,omitempty"` +} + +// SalesforceSink a copy activity Salesforce sink. +type SalesforceSink struct { + // WriteBehavior - The write behavior for the operation. Default is Insert. Possible values include: 'Insert', 'Upsert' + WriteBehavior SalesforceSinkWriteBehavior `json:"writeBehavior,omitempty"` + // ExternalIDFieldName - The name of the external ID field for upsert operation. Default value is 'Id' column. Type: string (or Expression with resultType string). + ExternalIDFieldName interface{} `json:"externalIdFieldName,omitempty"` + // IgnoreNullValues - The flag indicating whether or not to ignore null values from input dataset (except key fields) during write operation. Default value is false. If set it to true, it means ADF will leave the data in the destination object unchanged when doing upsert/update operation and insert defined default value when doing insert operation, versus ADF will update the data in the destination object to NULL when doing upsert/update operation and insert NULL value when doing insert operation. Type: boolean (or Expression with resultType boolean). + IgnoreNullValues interface{} `json:"ignoreNullValues,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // WriteBatchSize - Write batch size. Type: integer (or Expression with resultType integer), minimum: 0. + WriteBatchSize interface{} `json:"writeBatchSize,omitempty"` + // WriteBatchTimeout - Write batch timeout. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + WriteBatchTimeout interface{} `json:"writeBatchTimeout,omitempty"` + // SinkRetryCount - Sink retry count. Type: integer (or Expression with resultType integer). + SinkRetryCount interface{} `json:"sinkRetryCount,omitempty"` + // SinkRetryWait - Sink retry wait. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + SinkRetryWait interface{} `json:"sinkRetryWait,omitempty"` + // Type - Possible values include: 'TypeCopySink', 'TypeSalesforceSink', 'TypeDynamicsSink', 'TypeOdbcSink', 'TypeAzureSearchIndexSink', 'TypeAzureDataLakeStoreSink', 'TypeOracleSink', 'TypeSQLDWSink', 'TypeSQLSink', 'TypeDocumentDbCollectionSink', 'TypeFileSystemSink', 'TypeBlobSink', 'TypeAzureTableSink', 'TypeAzureQueueSink', 'TypeSapCloudForCustomerSink' + Type TypeBasicCopySink `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for SalesforceSink. +func (ss SalesforceSink) MarshalJSON() ([]byte, error) { + ss.Type = TypeSalesforceSink + objectMap := make(map[string]interface{}) + if ss.WriteBehavior != "" { + objectMap["writeBehavior"] = ss.WriteBehavior + } + objectMap["externalIdFieldName"] = ss.ExternalIDFieldName + objectMap["ignoreNullValues"] = ss.IgnoreNullValues + objectMap["writeBatchSize"] = ss.WriteBatchSize + objectMap["writeBatchTimeout"] = ss.WriteBatchTimeout + objectMap["sinkRetryCount"] = ss.SinkRetryCount + objectMap["sinkRetryWait"] = ss.SinkRetryWait + if ss.Type != "" { + objectMap["type"] = ss.Type + } + for k, v := range ss.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsSalesforceSink is the BasicCopySink implementation for SalesforceSink. +func (ss SalesforceSink) AsSalesforceSink() (*SalesforceSink, bool) { + return &ss, true +} + +// AsDynamicsSink is the BasicCopySink implementation for SalesforceSink. +func (ss SalesforceSink) AsDynamicsSink() (*DynamicsSink, bool) { + return nil, false +} + +// AsOdbcSink is the BasicCopySink implementation for SalesforceSink. +func (ss SalesforceSink) AsOdbcSink() (*OdbcSink, bool) { + return nil, false +} + +// AsAzureSearchIndexSink is the BasicCopySink implementation for SalesforceSink. +func (ss SalesforceSink) AsAzureSearchIndexSink() (*AzureSearchIndexSink, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSink is the BasicCopySink implementation for SalesforceSink. +func (ss SalesforceSink) AsAzureDataLakeStoreSink() (*AzureDataLakeStoreSink, bool) { + return nil, false +} + +// AsOracleSink is the BasicCopySink implementation for SalesforceSink. +func (ss SalesforceSink) AsOracleSink() (*OracleSink, bool) { + return nil, false +} + +// AsSQLDWSink is the BasicCopySink implementation for SalesforceSink. +func (ss SalesforceSink) AsSQLDWSink() (*SQLDWSink, bool) { + return nil, false +} + +// AsSQLSink is the BasicCopySink implementation for SalesforceSink. +func (ss SalesforceSink) AsSQLSink() (*SQLSink, bool) { + return nil, false +} + +// AsDocumentDbCollectionSink is the BasicCopySink implementation for SalesforceSink. +func (ss SalesforceSink) AsDocumentDbCollectionSink() (*DocumentDbCollectionSink, bool) { + return nil, false +} + +// AsFileSystemSink is the BasicCopySink implementation for SalesforceSink. +func (ss SalesforceSink) AsFileSystemSink() (*FileSystemSink, bool) { + return nil, false +} + +// AsBlobSink is the BasicCopySink implementation for SalesforceSink. +func (ss SalesforceSink) AsBlobSink() (*BlobSink, bool) { + return nil, false +} + +// AsAzureTableSink is the BasicCopySink implementation for SalesforceSink. +func (ss SalesforceSink) AsAzureTableSink() (*AzureTableSink, bool) { + return nil, false +} + +// AsAzureQueueSink is the BasicCopySink implementation for SalesforceSink. +func (ss SalesforceSink) AsAzureQueueSink() (*AzureQueueSink, bool) { + return nil, false +} + +// AsSapCloudForCustomerSink is the BasicCopySink implementation for SalesforceSink. +func (ss SalesforceSink) AsSapCloudForCustomerSink() (*SapCloudForCustomerSink, bool) { + return nil, false +} + +// AsCopySink is the BasicCopySink implementation for SalesforceSink. +func (ss SalesforceSink) AsCopySink() (*CopySink, bool) { + return nil, false +} + +// AsBasicCopySink is the BasicCopySink implementation for SalesforceSink. +func (ss SalesforceSink) AsBasicCopySink() (BasicCopySink, bool) { + return &ss, true +} + +// SalesforceSource a copy activity Salesforce source. +type SalesforceSource struct { + // Query - Database query. Type: string (or Expression with resultType string). + Query interface{} `json:"query,omitempty"` + // ReadBehavior - The read behavior for the operation. Default is Query. Possible values include: 'Query', 'QueryAll' + ReadBehavior SalesforceSourceReadBehavior `json:"readBehavior,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // SourceRetryCount - Source retry count. Type: integer (or Expression with resultType integer). + SourceRetryCount interface{} `json:"sourceRetryCount,omitempty"` + // SourceRetryWait - Source retry wait. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` + // Type - Possible values include: 'TypeCopySource', 'TypeAmazonRedshiftSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeHTTPSource', 'TypeAzureDataLakeStoreSource', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeRelationalSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource' + Type TypeBasicCopySource `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for SalesforceSource. +func (ss SalesforceSource) MarshalJSON() ([]byte, error) { + ss.Type = TypeSalesforceSource + objectMap := make(map[string]interface{}) + objectMap["query"] = ss.Query + if ss.ReadBehavior != "" { + objectMap["readBehavior"] = ss.ReadBehavior + } + objectMap["sourceRetryCount"] = ss.SourceRetryCount + objectMap["sourceRetryWait"] = ss.SourceRetryWait + if ss.Type != "" { + objectMap["type"] = ss.Type + } + for k, v := range ss.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsAmazonRedshiftSource is the BasicCopySource implementation for SalesforceSource. +func (ss SalesforceSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { + return nil, false +} + +// AsResponsysSource is the BasicCopySource implementation for SalesforceSource. +func (ss SalesforceSource) AsResponsysSource() (*ResponsysSource, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudSource is the BasicCopySource implementation for SalesforceSource. +func (ss SalesforceSource) AsSalesforceMarketingCloudSource() (*SalesforceMarketingCloudSource, bool) { + return nil, false +} + +// AsVerticaSource is the BasicCopySource implementation for SalesforceSource. +func (ss SalesforceSource) AsVerticaSource() (*VerticaSource, bool) { + return nil, false +} + +// AsNetezzaSource is the BasicCopySource implementation for SalesforceSource. +func (ss SalesforceSource) AsNetezzaSource() (*NetezzaSource, bool) { + return nil, false +} + +// AsZohoSource is the BasicCopySource implementation for SalesforceSource. +func (ss SalesforceSource) AsZohoSource() (*ZohoSource, bool) { + return nil, false +} + +// AsXeroSource is the BasicCopySource implementation for SalesforceSource. +func (ss SalesforceSource) AsXeroSource() (*XeroSource, bool) { + return nil, false +} + +// AsSquareSource is the BasicCopySource implementation for SalesforceSource. +func (ss SalesforceSource) AsSquareSource() (*SquareSource, bool) { + return nil, false +} + +// AsSparkSource is the BasicCopySource implementation for SalesforceSource. +func (ss SalesforceSource) AsSparkSource() (*SparkSource, bool) { + return nil, false +} + +// AsShopifySource is the BasicCopySource implementation for SalesforceSource. +func (ss SalesforceSource) AsShopifySource() (*ShopifySource, bool) { + return nil, false +} + +// AsServiceNowSource is the BasicCopySource implementation for SalesforceSource. +func (ss SalesforceSource) AsServiceNowSource() (*ServiceNowSource, bool) { + return nil, false +} + +// AsQuickBooksSource is the BasicCopySource implementation for SalesforceSource. +func (ss SalesforceSource) AsQuickBooksSource() (*QuickBooksSource, bool) { + return nil, false +} + +// AsPrestoSource is the BasicCopySource implementation for SalesforceSource. +func (ss SalesforceSource) AsPrestoSource() (*PrestoSource, bool) { + return nil, false +} + +// AsPhoenixSource is the BasicCopySource implementation for SalesforceSource. +func (ss SalesforceSource) AsPhoenixSource() (*PhoenixSource, bool) { + return nil, false +} + +// AsPaypalSource is the BasicCopySource implementation for SalesforceSource. +func (ss SalesforceSource) AsPaypalSource() (*PaypalSource, bool) { + return nil, false +} + +// AsMarketoSource is the BasicCopySource implementation for SalesforceSource. +func (ss SalesforceSource) AsMarketoSource() (*MarketoSource, bool) { + return nil, false +} + +// AsMariaDBSource is the BasicCopySource implementation for SalesforceSource. +func (ss SalesforceSource) AsMariaDBSource() (*MariaDBSource, bool) { + return nil, false +} + +// AsMagentoSource is the BasicCopySource implementation for SalesforceSource. +func (ss SalesforceSource) AsMagentoSource() (*MagentoSource, bool) { + return nil, false +} + +// AsJiraSource is the BasicCopySource implementation for SalesforceSource. +func (ss SalesforceSource) AsJiraSource() (*JiraSource, bool) { + return nil, false +} + +// AsImpalaSource is the BasicCopySource implementation for SalesforceSource. +func (ss SalesforceSource) AsImpalaSource() (*ImpalaSource, bool) { + return nil, false +} + +// AsHubspotSource is the BasicCopySource implementation for SalesforceSource. +func (ss SalesforceSource) AsHubspotSource() (*HubspotSource, bool) { + return nil, false +} + +// AsHiveSource is the BasicCopySource implementation for SalesforceSource. +func (ss SalesforceSource) AsHiveSource() (*HiveSource, bool) { + return nil, false +} + +// AsHBaseSource is the BasicCopySource implementation for SalesforceSource. +func (ss SalesforceSource) AsHBaseSource() (*HBaseSource, bool) { + return nil, false +} + +// AsGreenplumSource is the BasicCopySource implementation for SalesforceSource. +func (ss SalesforceSource) AsGreenplumSource() (*GreenplumSource, bool) { + return nil, false +} + +// AsGoogleBigQuerySource is the BasicCopySource implementation for SalesforceSource. +func (ss SalesforceSource) AsGoogleBigQuerySource() (*GoogleBigQuerySource, bool) { + return nil, false +} + +// AsEloquaSource is the BasicCopySource implementation for SalesforceSource. +func (ss SalesforceSource) AsEloquaSource() (*EloquaSource, bool) { + return nil, false +} + +// AsDrillSource is the BasicCopySource implementation for SalesforceSource. +func (ss SalesforceSource) AsDrillSource() (*DrillSource, bool) { + return nil, false +} + +// AsCouchbaseSource is the BasicCopySource implementation for SalesforceSource. +func (ss SalesforceSource) AsCouchbaseSource() (*CouchbaseSource, bool) { + return nil, false +} + +// AsConcurSource is the BasicCopySource implementation for SalesforceSource. +func (ss SalesforceSource) AsConcurSource() (*ConcurSource, bool) { + return nil, false +} + +// AsAzurePostgreSQLSource is the BasicCopySource implementation for SalesforceSource. +func (ss SalesforceSource) AsAzurePostgreSQLSource() (*AzurePostgreSQLSource, bool) { + return nil, false +} + +// AsAmazonMWSSource is the BasicCopySource implementation for SalesforceSource. +func (ss SalesforceSource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { + return nil, false +} + +// AsHTTPSource is the BasicCopySource implementation for SalesforceSource. +func (ss SalesforceSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for SalesforceSource. +func (ss SalesforceSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for SalesforceSource. +func (ss SalesforceSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsCassandraSource is the BasicCopySource implementation for SalesforceSource. +func (ss SalesforceSource) AsCassandraSource() (*CassandraSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for SalesforceSource. +func (ss SalesforceSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for SalesforceSource. +func (ss SalesforceSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureMySQLSource is the BasicCopySource implementation for SalesforceSource. +func (ss SalesforceSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for SalesforceSource. +func (ss SalesforceSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for SalesforceSource. +func (ss SalesforceSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsSQLDWSource is the BasicCopySource implementation for SalesforceSource. +func (ss SalesforceSource) AsSQLDWSource() (*SQLDWSource, bool) { + return nil, false +} + +// AsSQLSource is the BasicCopySource implementation for SalesforceSource. +func (ss SalesforceSource) AsSQLSource() (*SQLSource, bool) { + return nil, false +} + +// AsSapEccSource is the BasicCopySource implementation for SalesforceSource. +func (ss SalesforceSource) AsSapEccSource() (*SapEccSource, bool) { + return nil, false +} + +// AsSapCloudForCustomerSource is the BasicCopySource implementation for SalesforceSource. +func (ss SalesforceSource) AsSapCloudForCustomerSource() (*SapCloudForCustomerSource, bool) { + return nil, false +} + +// AsSalesforceSource is the BasicCopySource implementation for SalesforceSource. +func (ss SalesforceSource) AsSalesforceSource() (*SalesforceSource, bool) { + return &ss, true +} + +// AsRelationalSource is the BasicCopySource implementation for SalesforceSource. +func (ss SalesforceSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for SalesforceSource. +func (ss SalesforceSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for SalesforceSource. +func (ss SalesforceSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for SalesforceSource. +func (ss SalesforceSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + +// AsAzureTableSource is the BasicCopySource implementation for SalesforceSource. +func (ss SalesforceSource) AsAzureTableSource() (*AzureTableSource, bool) { + return nil, false +} + +// AsCopySource is the BasicCopySource implementation for SalesforceSource. +func (ss SalesforceSource) AsCopySource() (*CopySource, bool) { + return nil, false +} + +// AsBasicCopySource is the BasicCopySource implementation for SalesforceSource. +func (ss SalesforceSource) AsBasicCopySource() (BasicCopySource, bool) { + return &ss, true +} + +// SapBWLinkedService SAP Business Warehouse Linked Service. +type SapBWLinkedService struct { + // SapBWLinkedServiceTypeProperties - Properties specific to this linked service type. + *SapBWLinkedServiceTypeProperties `json:"typeProperties,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // ConnectVia - The integration runtime reference. + ConnectVia *IntegrationRuntimeReference `json:"connectVia,omitempty"` + // Description - Linked service description. + Description *string `json:"description,omitempty"` + // Parameters - Parameters for linked service. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeLinkedService', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforce', 'TypeAzureDataLakeStore', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureStorage' + Type TypeBasicLinkedService `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for SapBWLinkedService. +func (sbls SapBWLinkedService) MarshalJSON() ([]byte, error) { + sbls.Type = TypeSapBW + objectMap := make(map[string]interface{}) + if sbls.SapBWLinkedServiceTypeProperties != nil { + objectMap["typeProperties"] = sbls.SapBWLinkedServiceTypeProperties + } + if sbls.ConnectVia != nil { + objectMap["connectVia"] = sbls.ConnectVia + } + if sbls.Description != nil { + objectMap["description"] = sbls.Description + } + if sbls.Parameters != nil { + objectMap["parameters"] = sbls.Parameters + } + if sbls.Annotations != nil { + objectMap["annotations"] = sbls.Annotations + } + if sbls.Type != "" { + objectMap["type"] = sbls.Type + } + for k, v := range sbls.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysLinkedService is the BasicLinkedService implementation for SapBWLinkedService. +func (sbls SapBWLinkedService) AsResponsysLinkedService() (*ResponsysLinkedService, bool) { + return nil, false +} + +// AsAzureDatabricksLinkedService is the BasicLinkedService implementation for SapBWLinkedService. +func (sbls SapBWLinkedService) AsAzureDatabricksLinkedService() (*AzureDatabricksLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeAnalyticsLinkedService is the BasicLinkedService implementation for SapBWLinkedService. +func (sbls SapBWLinkedService) AsAzureDataLakeAnalyticsLinkedService() (*AzureDataLakeAnalyticsLinkedService, bool) { + return nil, false +} + +// AsHDInsightOnDemandLinkedService is the BasicLinkedService implementation for SapBWLinkedService. +func (sbls SapBWLinkedService) AsHDInsightOnDemandLinkedService() (*HDInsightOnDemandLinkedService, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudLinkedService is the BasicLinkedService implementation for SapBWLinkedService. +func (sbls SapBWLinkedService) AsSalesforceMarketingCloudLinkedService() (*SalesforceMarketingCloudLinkedService, bool) { + return nil, false +} + +// AsNetezzaLinkedService is the BasicLinkedService implementation for SapBWLinkedService. +func (sbls SapBWLinkedService) AsNetezzaLinkedService() (*NetezzaLinkedService, bool) { + return nil, false +} + +// AsVerticaLinkedService is the BasicLinkedService implementation for SapBWLinkedService. +func (sbls SapBWLinkedService) AsVerticaLinkedService() (*VerticaLinkedService, bool) { + return nil, false +} + +// AsZohoLinkedService is the BasicLinkedService implementation for SapBWLinkedService. +func (sbls SapBWLinkedService) AsZohoLinkedService() (*ZohoLinkedService, bool) { + return nil, false +} + +// AsXeroLinkedService is the BasicLinkedService implementation for SapBWLinkedService. +func (sbls SapBWLinkedService) AsXeroLinkedService() (*XeroLinkedService, bool) { + return nil, false +} + +// AsSquareLinkedService is the BasicLinkedService implementation for SapBWLinkedService. +func (sbls SapBWLinkedService) AsSquareLinkedService() (*SquareLinkedService, bool) { + return nil, false +} + +// AsSparkLinkedService is the BasicLinkedService implementation for SapBWLinkedService. +func (sbls SapBWLinkedService) AsSparkLinkedService() (*SparkLinkedService, bool) { + return nil, false +} + +// AsShopifyLinkedService is the BasicLinkedService implementation for SapBWLinkedService. +func (sbls SapBWLinkedService) AsShopifyLinkedService() (*ShopifyLinkedService, bool) { + return nil, false +} + +// AsServiceNowLinkedService is the BasicLinkedService implementation for SapBWLinkedService. +func (sbls SapBWLinkedService) AsServiceNowLinkedService() (*ServiceNowLinkedService, bool) { + return nil, false +} + +// AsQuickBooksLinkedService is the BasicLinkedService implementation for SapBWLinkedService. +func (sbls SapBWLinkedService) AsQuickBooksLinkedService() (*QuickBooksLinkedService, bool) { + return nil, false +} + +// AsPrestoLinkedService is the BasicLinkedService implementation for SapBWLinkedService. +func (sbls SapBWLinkedService) AsPrestoLinkedService() (*PrestoLinkedService, bool) { + return nil, false +} + +// AsPhoenixLinkedService is the BasicLinkedService implementation for SapBWLinkedService. +func (sbls SapBWLinkedService) AsPhoenixLinkedService() (*PhoenixLinkedService, bool) { + return nil, false +} + +// AsPaypalLinkedService is the BasicLinkedService implementation for SapBWLinkedService. +func (sbls SapBWLinkedService) AsPaypalLinkedService() (*PaypalLinkedService, bool) { + return nil, false +} + +// AsMarketoLinkedService is the BasicLinkedService implementation for SapBWLinkedService. +func (sbls SapBWLinkedService) AsMarketoLinkedService() (*MarketoLinkedService, bool) { + return nil, false +} + +// AsMariaDBLinkedService is the BasicLinkedService implementation for SapBWLinkedService. +func (sbls SapBWLinkedService) AsMariaDBLinkedService() (*MariaDBLinkedService, bool) { + return nil, false +} + +// AsMagentoLinkedService is the BasicLinkedService implementation for SapBWLinkedService. +func (sbls SapBWLinkedService) AsMagentoLinkedService() (*MagentoLinkedService, bool) { + return nil, false +} + +// AsJiraLinkedService is the BasicLinkedService implementation for SapBWLinkedService. +func (sbls SapBWLinkedService) AsJiraLinkedService() (*JiraLinkedService, bool) { + return nil, false +} + +// AsImpalaLinkedService is the BasicLinkedService implementation for SapBWLinkedService. +func (sbls SapBWLinkedService) AsImpalaLinkedService() (*ImpalaLinkedService, bool) { + return nil, false +} + +// AsHubspotLinkedService is the BasicLinkedService implementation for SapBWLinkedService. +func (sbls SapBWLinkedService) AsHubspotLinkedService() (*HubspotLinkedService, bool) { + return nil, false +} + +// AsHiveLinkedService is the BasicLinkedService implementation for SapBWLinkedService. +func (sbls SapBWLinkedService) AsHiveLinkedService() (*HiveLinkedService, bool) { + return nil, false +} + +// AsHBaseLinkedService is the BasicLinkedService implementation for SapBWLinkedService. +func (sbls SapBWLinkedService) AsHBaseLinkedService() (*HBaseLinkedService, bool) { + return nil, false +} + +// AsGreenplumLinkedService is the BasicLinkedService implementation for SapBWLinkedService. +func (sbls SapBWLinkedService) AsGreenplumLinkedService() (*GreenplumLinkedService, bool) { + return nil, false +} + +// AsGoogleBigQueryLinkedService is the BasicLinkedService implementation for SapBWLinkedService. +func (sbls SapBWLinkedService) AsGoogleBigQueryLinkedService() (*GoogleBigQueryLinkedService, bool) { + return nil, false +} + +// AsEloquaLinkedService is the BasicLinkedService implementation for SapBWLinkedService. +func (sbls SapBWLinkedService) AsEloquaLinkedService() (*EloquaLinkedService, bool) { + return nil, false +} + +// AsDrillLinkedService is the BasicLinkedService implementation for SapBWLinkedService. +func (sbls SapBWLinkedService) AsDrillLinkedService() (*DrillLinkedService, bool) { + return nil, false +} + +// AsCouchbaseLinkedService is the BasicLinkedService implementation for SapBWLinkedService. +func (sbls SapBWLinkedService) AsCouchbaseLinkedService() (*CouchbaseLinkedService, bool) { + return nil, false +} + +// AsConcurLinkedService is the BasicLinkedService implementation for SapBWLinkedService. +func (sbls SapBWLinkedService) AsConcurLinkedService() (*ConcurLinkedService, bool) { + return nil, false +} + +// AsAzurePostgreSQLLinkedService is the BasicLinkedService implementation for SapBWLinkedService. +func (sbls SapBWLinkedService) AsAzurePostgreSQLLinkedService() (*AzurePostgreSQLLinkedService, bool) { + return nil, false +} + +// AsAmazonMWSLinkedService is the BasicLinkedService implementation for SapBWLinkedService. +func (sbls SapBWLinkedService) AsAmazonMWSLinkedService() (*AmazonMWSLinkedService, bool) { + return nil, false +} + +// AsSapHanaLinkedService is the BasicLinkedService implementation for SapBWLinkedService. +func (sbls SapBWLinkedService) AsSapHanaLinkedService() (*SapHanaLinkedService, bool) { + return nil, false +} + +// AsSapBWLinkedService is the BasicLinkedService implementation for SapBWLinkedService. +func (sbls SapBWLinkedService) AsSapBWLinkedService() (*SapBWLinkedService, bool) { + return &sbls, true +} + +// AsSftpServerLinkedService is the BasicLinkedService implementation for SapBWLinkedService. +func (sbls SapBWLinkedService) AsSftpServerLinkedService() (*SftpServerLinkedService, bool) { + return nil, false +} + +// AsFtpServerLinkedService is the BasicLinkedService implementation for SapBWLinkedService. +func (sbls SapBWLinkedService) AsFtpServerLinkedService() (*FtpServerLinkedService, bool) { + return nil, false +} + +// AsHTTPLinkedService is the BasicLinkedService implementation for SapBWLinkedService. +func (sbls SapBWLinkedService) AsHTTPLinkedService() (*HTTPLinkedService, bool) { + return nil, false +} + +// AsAzureSearchLinkedService is the BasicLinkedService implementation for SapBWLinkedService. +func (sbls SapBWLinkedService) AsAzureSearchLinkedService() (*AzureSearchLinkedService, bool) { + return nil, false +} + +// AsCustomDataSourceLinkedService is the BasicLinkedService implementation for SapBWLinkedService. +func (sbls SapBWLinkedService) AsCustomDataSourceLinkedService() (*CustomDataSourceLinkedService, bool) { + return nil, false +} + +// AsAmazonRedshiftLinkedService is the BasicLinkedService implementation for SapBWLinkedService. +func (sbls SapBWLinkedService) AsAmazonRedshiftLinkedService() (*AmazonRedshiftLinkedService, bool) { + return nil, false +} + +// AsAmazonS3LinkedService is the BasicLinkedService implementation for SapBWLinkedService. +func (sbls SapBWLinkedService) AsAmazonS3LinkedService() (*AmazonS3LinkedService, bool) { + return nil, false +} + +// AsSapEccLinkedService is the BasicLinkedService implementation for SapBWLinkedService. +func (sbls SapBWLinkedService) AsSapEccLinkedService() (*SapEccLinkedService, bool) { + return nil, false +} + +// AsSapCloudForCustomerLinkedService is the BasicLinkedService implementation for SapBWLinkedService. +func (sbls SapBWLinkedService) AsSapCloudForCustomerLinkedService() (*SapCloudForCustomerLinkedService, bool) { + return nil, false +} + +// AsSalesforceLinkedService is the BasicLinkedService implementation for SapBWLinkedService. +func (sbls SapBWLinkedService) AsSalesforceLinkedService() (*SalesforceLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeStoreLinkedService is the BasicLinkedService implementation for SapBWLinkedService. +func (sbls SapBWLinkedService) AsAzureDataLakeStoreLinkedService() (*AzureDataLakeStoreLinkedService, bool) { + return nil, false +} + +// AsMongoDbLinkedService is the BasicLinkedService implementation for SapBWLinkedService. +func (sbls SapBWLinkedService) AsMongoDbLinkedService() (*MongoDbLinkedService, bool) { + return nil, false +} + +// AsCassandraLinkedService is the BasicLinkedService implementation for SapBWLinkedService. +func (sbls SapBWLinkedService) AsCassandraLinkedService() (*CassandraLinkedService, bool) { + return nil, false +} + +// AsWebLinkedService is the BasicLinkedService implementation for SapBWLinkedService. +func (sbls SapBWLinkedService) AsWebLinkedService() (*WebLinkedService, bool) { + return nil, false +} + +// AsODataLinkedService is the BasicLinkedService implementation for SapBWLinkedService. +func (sbls SapBWLinkedService) AsODataLinkedService() (*ODataLinkedService, bool) { + return nil, false +} + +// AsHdfsLinkedService is the BasicLinkedService implementation for SapBWLinkedService. +func (sbls SapBWLinkedService) AsHdfsLinkedService() (*HdfsLinkedService, bool) { + return nil, false +} + +// AsOdbcLinkedService is the BasicLinkedService implementation for SapBWLinkedService. +func (sbls SapBWLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, bool) { + return nil, false +} + +// AsAzureMLLinkedService is the BasicLinkedService implementation for SapBWLinkedService. +func (sbls SapBWLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { + return nil, false +} + +// AsTeradataLinkedService is the BasicLinkedService implementation for SapBWLinkedService. +func (sbls SapBWLinkedService) AsTeradataLinkedService() (*TeradataLinkedService, bool) { + return nil, false +} + +// AsDb2LinkedService is the BasicLinkedService implementation for SapBWLinkedService. +func (sbls SapBWLinkedService) AsDb2LinkedService() (*Db2LinkedService, bool) { + return nil, false +} + +// AsSybaseLinkedService is the BasicLinkedService implementation for SapBWLinkedService. +func (sbls SapBWLinkedService) AsSybaseLinkedService() (*SybaseLinkedService, bool) { + return nil, false +} + +// AsPostgreSQLLinkedService is the BasicLinkedService implementation for SapBWLinkedService. +func (sbls SapBWLinkedService) AsPostgreSQLLinkedService() (*PostgreSQLLinkedService, bool) { + return nil, false +} + +// AsMySQLLinkedService is the BasicLinkedService implementation for SapBWLinkedService. +func (sbls SapBWLinkedService) AsMySQLLinkedService() (*MySQLLinkedService, bool) { + return nil, false +} + +// AsAzureMySQLLinkedService is the BasicLinkedService implementation for SapBWLinkedService. +func (sbls SapBWLinkedService) AsAzureMySQLLinkedService() (*AzureMySQLLinkedService, bool) { + return nil, false +} + +// AsOracleLinkedService is the BasicLinkedService implementation for SapBWLinkedService. +func (sbls SapBWLinkedService) AsOracleLinkedService() (*OracleLinkedService, bool) { + return nil, false +} + +// AsFileServerLinkedService is the BasicLinkedService implementation for SapBWLinkedService. +func (sbls SapBWLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { + return nil, false +} + +// AsHDInsightLinkedService is the BasicLinkedService implementation for SapBWLinkedService. +func (sbls SapBWLinkedService) AsHDInsightLinkedService() (*HDInsightLinkedService, bool) { + return nil, false +} + +// AsDynamicsLinkedService is the BasicLinkedService implementation for SapBWLinkedService. +func (sbls SapBWLinkedService) AsDynamicsLinkedService() (*DynamicsLinkedService, bool) { + return nil, false +} + +// AsCosmosDbLinkedService is the BasicLinkedService implementation for SapBWLinkedService. +func (sbls SapBWLinkedService) AsCosmosDbLinkedService() (*CosmosDbLinkedService, bool) { + return nil, false +} + +// AsAzureKeyVaultLinkedService is the BasicLinkedService implementation for SapBWLinkedService. +func (sbls SapBWLinkedService) AsAzureKeyVaultLinkedService() (*AzureKeyVaultLinkedService, bool) { + return nil, false +} + +// AsAzureBatchLinkedService is the BasicLinkedService implementation for SapBWLinkedService. +func (sbls SapBWLinkedService) AsAzureBatchLinkedService() (*AzureBatchLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDatabaseLinkedService is the BasicLinkedService implementation for SapBWLinkedService. +func (sbls SapBWLinkedService) AsAzureSQLDatabaseLinkedService() (*AzureSQLDatabaseLinkedService, bool) { + return nil, false +} + +// AsSQLServerLinkedService is the BasicLinkedService implementation for SapBWLinkedService. +func (sbls SapBWLinkedService) AsSQLServerLinkedService() (*SQLServerLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDWLinkedService is the BasicLinkedService implementation for SapBWLinkedService. +func (sbls SapBWLinkedService) AsAzureSQLDWLinkedService() (*AzureSQLDWLinkedService, bool) { + return nil, false +} + +// AsAzureStorageLinkedService is the BasicLinkedService implementation for SapBWLinkedService. +func (sbls SapBWLinkedService) AsAzureStorageLinkedService() (*AzureStorageLinkedService, bool) { + return nil, false +} + +// AsLinkedService is the BasicLinkedService implementation for SapBWLinkedService. +func (sbls SapBWLinkedService) AsLinkedService() (*LinkedService, bool) { + return nil, false +} + +// AsBasicLinkedService is the BasicLinkedService implementation for SapBWLinkedService. +func (sbls SapBWLinkedService) AsBasicLinkedService() (BasicLinkedService, bool) { + return &sbls, true +} + +// UnmarshalJSON is the custom unmarshaler for SapBWLinkedService struct. +func (sbls *SapBWLinkedService) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "typeProperties": + if v != nil { + var sapBWLinkedServiceTypeProperties SapBWLinkedServiceTypeProperties + err = json.Unmarshal(*v, &sapBWLinkedServiceTypeProperties) + if err != nil { + return err + } + sbls.SapBWLinkedServiceTypeProperties = &sapBWLinkedServiceTypeProperties + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if sbls.AdditionalProperties == nil { + sbls.AdditionalProperties = make(map[string]interface{}) + } + sbls.AdditionalProperties[k] = additionalProperties + } + case "connectVia": + if v != nil { + var connectVia IntegrationRuntimeReference + err = json.Unmarshal(*v, &connectVia) + if err != nil { + return err + } + sbls.ConnectVia = &connectVia + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + sbls.Description = &description + } + case "parameters": + if v != nil { + var parameters map[string]*ParameterSpecification + err = json.Unmarshal(*v, ¶meters) + if err != nil { + return err + } + sbls.Parameters = parameters + } + case "annotations": + if v != nil { + var annotations []interface{} + err = json.Unmarshal(*v, &annotations) + if err != nil { + return err + } + sbls.Annotations = &annotations + } + case "type": + if v != nil { + var typeVar TypeBasicLinkedService + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + sbls.Type = typeVar + } + } + } + + return nil +} + +// SapBWLinkedServiceTypeProperties properties specific to this linked service type. +type SapBWLinkedServiceTypeProperties struct { + // Server - Host name of the SAP BW instance. Type: string (or Expression with resultType string). + Server interface{} `json:"server,omitempty"` + // SystemNumber - System number of the BW system. (Usually a two-digit decimal number represented as a string.) Type: string (or Expression with resultType string). + SystemNumber interface{} `json:"systemNumber,omitempty"` + // ClientID - Client ID of the client on the BW system. (Usually a three-digit decimal number represented as a string) Type: string (or Expression with resultType string). + ClientID interface{} `json:"clientId,omitempty"` + // UserName - Username to access the SAP BW server. Type: string (or Expression with resultType string). + UserName interface{} `json:"userName,omitempty"` + // Password - Password to access the SAP BW server. + Password BasicSecretBase `json:"password,omitempty"` + // EncryptedCredential - The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string). + EncryptedCredential interface{} `json:"encryptedCredential,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for SapBWLinkedServiceTypeProperties struct. +func (sblstp *SapBWLinkedServiceTypeProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "server": + if v != nil { + var server interface{} + err = json.Unmarshal(*v, &server) + if err != nil { + return err + } + sblstp.Server = server + } + case "systemNumber": + if v != nil { + var systemNumber interface{} + err = json.Unmarshal(*v, &systemNumber) + if err != nil { + return err + } + sblstp.SystemNumber = systemNumber + } + case "clientId": + if v != nil { + var clientID interface{} + err = json.Unmarshal(*v, &clientID) + if err != nil { + return err + } + sblstp.ClientID = clientID + } + case "userName": + if v != nil { + var userName interface{} + err = json.Unmarshal(*v, &userName) + if err != nil { + return err + } + sblstp.UserName = userName + } + case "password": + if v != nil { + password, err := unmarshalBasicSecretBase(*v) + if err != nil { + return err + } + sblstp.Password = password + } + case "encryptedCredential": + if v != nil { + var encryptedCredential interface{} + err = json.Unmarshal(*v, &encryptedCredential) + if err != nil { + return err + } + sblstp.EncryptedCredential = encryptedCredential + } + } + } + + return nil +} + +// SapCloudForCustomerLinkedService linked service for SAP Cloud for Customer. +type SapCloudForCustomerLinkedService struct { + // SapCloudForCustomerLinkedServiceTypeProperties - SAP Cloud for Customer linked service properties. + *SapCloudForCustomerLinkedServiceTypeProperties `json:"typeProperties,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // ConnectVia - The integration runtime reference. + ConnectVia *IntegrationRuntimeReference `json:"connectVia,omitempty"` + // Description - Linked service description. + Description *string `json:"description,omitempty"` + // Parameters - Parameters for linked service. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeLinkedService', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforce', 'TypeAzureDataLakeStore', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureStorage' + Type TypeBasicLinkedService `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for SapCloudForCustomerLinkedService. +func (scfcls SapCloudForCustomerLinkedService) MarshalJSON() ([]byte, error) { + scfcls.Type = TypeSapCloudForCustomer + objectMap := make(map[string]interface{}) + if scfcls.SapCloudForCustomerLinkedServiceTypeProperties != nil { + objectMap["typeProperties"] = scfcls.SapCloudForCustomerLinkedServiceTypeProperties + } + if scfcls.ConnectVia != nil { + objectMap["connectVia"] = scfcls.ConnectVia + } + if scfcls.Description != nil { + objectMap["description"] = scfcls.Description + } + if scfcls.Parameters != nil { + objectMap["parameters"] = scfcls.Parameters + } + if scfcls.Annotations != nil { + objectMap["annotations"] = scfcls.Annotations + } + if scfcls.Type != "" { + objectMap["type"] = scfcls.Type + } + for k, v := range scfcls.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysLinkedService is the BasicLinkedService implementation for SapCloudForCustomerLinkedService. +func (scfcls SapCloudForCustomerLinkedService) AsResponsysLinkedService() (*ResponsysLinkedService, bool) { + return nil, false +} + +// AsAzureDatabricksLinkedService is the BasicLinkedService implementation for SapCloudForCustomerLinkedService. +func (scfcls SapCloudForCustomerLinkedService) AsAzureDatabricksLinkedService() (*AzureDatabricksLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeAnalyticsLinkedService is the BasicLinkedService implementation for SapCloudForCustomerLinkedService. +func (scfcls SapCloudForCustomerLinkedService) AsAzureDataLakeAnalyticsLinkedService() (*AzureDataLakeAnalyticsLinkedService, bool) { + return nil, false +} + +// AsHDInsightOnDemandLinkedService is the BasicLinkedService implementation for SapCloudForCustomerLinkedService. +func (scfcls SapCloudForCustomerLinkedService) AsHDInsightOnDemandLinkedService() (*HDInsightOnDemandLinkedService, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudLinkedService is the BasicLinkedService implementation for SapCloudForCustomerLinkedService. +func (scfcls SapCloudForCustomerLinkedService) AsSalesforceMarketingCloudLinkedService() (*SalesforceMarketingCloudLinkedService, bool) { + return nil, false +} + +// AsNetezzaLinkedService is the BasicLinkedService implementation for SapCloudForCustomerLinkedService. +func (scfcls SapCloudForCustomerLinkedService) AsNetezzaLinkedService() (*NetezzaLinkedService, bool) { + return nil, false +} + +// AsVerticaLinkedService is the BasicLinkedService implementation for SapCloudForCustomerLinkedService. +func (scfcls SapCloudForCustomerLinkedService) AsVerticaLinkedService() (*VerticaLinkedService, bool) { + return nil, false +} + +// AsZohoLinkedService is the BasicLinkedService implementation for SapCloudForCustomerLinkedService. +func (scfcls SapCloudForCustomerLinkedService) AsZohoLinkedService() (*ZohoLinkedService, bool) { + return nil, false +} + +// AsXeroLinkedService is the BasicLinkedService implementation for SapCloudForCustomerLinkedService. +func (scfcls SapCloudForCustomerLinkedService) AsXeroLinkedService() (*XeroLinkedService, bool) { + return nil, false +} + +// AsSquareLinkedService is the BasicLinkedService implementation for SapCloudForCustomerLinkedService. +func (scfcls SapCloudForCustomerLinkedService) AsSquareLinkedService() (*SquareLinkedService, bool) { + return nil, false +} + +// AsSparkLinkedService is the BasicLinkedService implementation for SapCloudForCustomerLinkedService. +func (scfcls SapCloudForCustomerLinkedService) AsSparkLinkedService() (*SparkLinkedService, bool) { + return nil, false +} + +// AsShopifyLinkedService is the BasicLinkedService implementation for SapCloudForCustomerLinkedService. +func (scfcls SapCloudForCustomerLinkedService) AsShopifyLinkedService() (*ShopifyLinkedService, bool) { + return nil, false +} + +// AsServiceNowLinkedService is the BasicLinkedService implementation for SapCloudForCustomerLinkedService. +func (scfcls SapCloudForCustomerLinkedService) AsServiceNowLinkedService() (*ServiceNowLinkedService, bool) { + return nil, false +} + +// AsQuickBooksLinkedService is the BasicLinkedService implementation for SapCloudForCustomerLinkedService. +func (scfcls SapCloudForCustomerLinkedService) AsQuickBooksLinkedService() (*QuickBooksLinkedService, bool) { + return nil, false +} + +// AsPrestoLinkedService is the BasicLinkedService implementation for SapCloudForCustomerLinkedService. +func (scfcls SapCloudForCustomerLinkedService) AsPrestoLinkedService() (*PrestoLinkedService, bool) { + return nil, false +} + +// AsPhoenixLinkedService is the BasicLinkedService implementation for SapCloudForCustomerLinkedService. +func (scfcls SapCloudForCustomerLinkedService) AsPhoenixLinkedService() (*PhoenixLinkedService, bool) { + return nil, false +} + +// AsPaypalLinkedService is the BasicLinkedService implementation for SapCloudForCustomerLinkedService. +func (scfcls SapCloudForCustomerLinkedService) AsPaypalLinkedService() (*PaypalLinkedService, bool) { + return nil, false +} + +// AsMarketoLinkedService is the BasicLinkedService implementation for SapCloudForCustomerLinkedService. +func (scfcls SapCloudForCustomerLinkedService) AsMarketoLinkedService() (*MarketoLinkedService, bool) { + return nil, false +} + +// AsMariaDBLinkedService is the BasicLinkedService implementation for SapCloudForCustomerLinkedService. +func (scfcls SapCloudForCustomerLinkedService) AsMariaDBLinkedService() (*MariaDBLinkedService, bool) { + return nil, false +} + +// AsMagentoLinkedService is the BasicLinkedService implementation for SapCloudForCustomerLinkedService. +func (scfcls SapCloudForCustomerLinkedService) AsMagentoLinkedService() (*MagentoLinkedService, bool) { + return nil, false +} + +// AsJiraLinkedService is the BasicLinkedService implementation for SapCloudForCustomerLinkedService. +func (scfcls SapCloudForCustomerLinkedService) AsJiraLinkedService() (*JiraLinkedService, bool) { + return nil, false +} + +// AsImpalaLinkedService is the BasicLinkedService implementation for SapCloudForCustomerLinkedService. +func (scfcls SapCloudForCustomerLinkedService) AsImpalaLinkedService() (*ImpalaLinkedService, bool) { + return nil, false +} + +// AsHubspotLinkedService is the BasicLinkedService implementation for SapCloudForCustomerLinkedService. +func (scfcls SapCloudForCustomerLinkedService) AsHubspotLinkedService() (*HubspotLinkedService, bool) { + return nil, false +} + +// AsHiveLinkedService is the BasicLinkedService implementation for SapCloudForCustomerLinkedService. +func (scfcls SapCloudForCustomerLinkedService) AsHiveLinkedService() (*HiveLinkedService, bool) { + return nil, false +} + +// AsHBaseLinkedService is the BasicLinkedService implementation for SapCloudForCustomerLinkedService. +func (scfcls SapCloudForCustomerLinkedService) AsHBaseLinkedService() (*HBaseLinkedService, bool) { + return nil, false +} + +// AsGreenplumLinkedService is the BasicLinkedService implementation for SapCloudForCustomerLinkedService. +func (scfcls SapCloudForCustomerLinkedService) AsGreenplumLinkedService() (*GreenplumLinkedService, bool) { + return nil, false +} + +// AsGoogleBigQueryLinkedService is the BasicLinkedService implementation for SapCloudForCustomerLinkedService. +func (scfcls SapCloudForCustomerLinkedService) AsGoogleBigQueryLinkedService() (*GoogleBigQueryLinkedService, bool) { + return nil, false +} + +// AsEloquaLinkedService is the BasicLinkedService implementation for SapCloudForCustomerLinkedService. +func (scfcls SapCloudForCustomerLinkedService) AsEloquaLinkedService() (*EloquaLinkedService, bool) { + return nil, false +} + +// AsDrillLinkedService is the BasicLinkedService implementation for SapCloudForCustomerLinkedService. +func (scfcls SapCloudForCustomerLinkedService) AsDrillLinkedService() (*DrillLinkedService, bool) { + return nil, false +} + +// AsCouchbaseLinkedService is the BasicLinkedService implementation for SapCloudForCustomerLinkedService. +func (scfcls SapCloudForCustomerLinkedService) AsCouchbaseLinkedService() (*CouchbaseLinkedService, bool) { + return nil, false +} + +// AsConcurLinkedService is the BasicLinkedService implementation for SapCloudForCustomerLinkedService. +func (scfcls SapCloudForCustomerLinkedService) AsConcurLinkedService() (*ConcurLinkedService, bool) { + return nil, false +} + +// AsAzurePostgreSQLLinkedService is the BasicLinkedService implementation for SapCloudForCustomerLinkedService. +func (scfcls SapCloudForCustomerLinkedService) AsAzurePostgreSQLLinkedService() (*AzurePostgreSQLLinkedService, bool) { + return nil, false +} + +// AsAmazonMWSLinkedService is the BasicLinkedService implementation for SapCloudForCustomerLinkedService. +func (scfcls SapCloudForCustomerLinkedService) AsAmazonMWSLinkedService() (*AmazonMWSLinkedService, bool) { + return nil, false +} + +// AsSapHanaLinkedService is the BasicLinkedService implementation for SapCloudForCustomerLinkedService. +func (scfcls SapCloudForCustomerLinkedService) AsSapHanaLinkedService() (*SapHanaLinkedService, bool) { + return nil, false +} + +// AsSapBWLinkedService is the BasicLinkedService implementation for SapCloudForCustomerLinkedService. +func (scfcls SapCloudForCustomerLinkedService) AsSapBWLinkedService() (*SapBWLinkedService, bool) { + return nil, false +} + +// AsSftpServerLinkedService is the BasicLinkedService implementation for SapCloudForCustomerLinkedService. +func (scfcls SapCloudForCustomerLinkedService) AsSftpServerLinkedService() (*SftpServerLinkedService, bool) { + return nil, false +} + +// AsFtpServerLinkedService is the BasicLinkedService implementation for SapCloudForCustomerLinkedService. +func (scfcls SapCloudForCustomerLinkedService) AsFtpServerLinkedService() (*FtpServerLinkedService, bool) { + return nil, false +} + +// AsHTTPLinkedService is the BasicLinkedService implementation for SapCloudForCustomerLinkedService. +func (scfcls SapCloudForCustomerLinkedService) AsHTTPLinkedService() (*HTTPLinkedService, bool) { + return nil, false +} + +// AsAzureSearchLinkedService is the BasicLinkedService implementation for SapCloudForCustomerLinkedService. +func (scfcls SapCloudForCustomerLinkedService) AsAzureSearchLinkedService() (*AzureSearchLinkedService, bool) { + return nil, false +} + +// AsCustomDataSourceLinkedService is the BasicLinkedService implementation for SapCloudForCustomerLinkedService. +func (scfcls SapCloudForCustomerLinkedService) AsCustomDataSourceLinkedService() (*CustomDataSourceLinkedService, bool) { + return nil, false +} + +// AsAmazonRedshiftLinkedService is the BasicLinkedService implementation for SapCloudForCustomerLinkedService. +func (scfcls SapCloudForCustomerLinkedService) AsAmazonRedshiftLinkedService() (*AmazonRedshiftLinkedService, bool) { + return nil, false +} + +// AsAmazonS3LinkedService is the BasicLinkedService implementation for SapCloudForCustomerLinkedService. +func (scfcls SapCloudForCustomerLinkedService) AsAmazonS3LinkedService() (*AmazonS3LinkedService, bool) { + return nil, false +} + +// AsSapEccLinkedService is the BasicLinkedService implementation for SapCloudForCustomerLinkedService. +func (scfcls SapCloudForCustomerLinkedService) AsSapEccLinkedService() (*SapEccLinkedService, bool) { + return nil, false +} + +// AsSapCloudForCustomerLinkedService is the BasicLinkedService implementation for SapCloudForCustomerLinkedService. +func (scfcls SapCloudForCustomerLinkedService) AsSapCloudForCustomerLinkedService() (*SapCloudForCustomerLinkedService, bool) { + return &scfcls, true +} + +// AsSalesforceLinkedService is the BasicLinkedService implementation for SapCloudForCustomerLinkedService. +func (scfcls SapCloudForCustomerLinkedService) AsSalesforceLinkedService() (*SalesforceLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeStoreLinkedService is the BasicLinkedService implementation for SapCloudForCustomerLinkedService. +func (scfcls SapCloudForCustomerLinkedService) AsAzureDataLakeStoreLinkedService() (*AzureDataLakeStoreLinkedService, bool) { + return nil, false +} + +// AsMongoDbLinkedService is the BasicLinkedService implementation for SapCloudForCustomerLinkedService. +func (scfcls SapCloudForCustomerLinkedService) AsMongoDbLinkedService() (*MongoDbLinkedService, bool) { + return nil, false +} + +// AsCassandraLinkedService is the BasicLinkedService implementation for SapCloudForCustomerLinkedService. +func (scfcls SapCloudForCustomerLinkedService) AsCassandraLinkedService() (*CassandraLinkedService, bool) { + return nil, false +} + +// AsWebLinkedService is the BasicLinkedService implementation for SapCloudForCustomerLinkedService. +func (scfcls SapCloudForCustomerLinkedService) AsWebLinkedService() (*WebLinkedService, bool) { + return nil, false +} + +// AsODataLinkedService is the BasicLinkedService implementation for SapCloudForCustomerLinkedService. +func (scfcls SapCloudForCustomerLinkedService) AsODataLinkedService() (*ODataLinkedService, bool) { + return nil, false +} + +// AsHdfsLinkedService is the BasicLinkedService implementation for SapCloudForCustomerLinkedService. +func (scfcls SapCloudForCustomerLinkedService) AsHdfsLinkedService() (*HdfsLinkedService, bool) { + return nil, false +} + +// AsOdbcLinkedService is the BasicLinkedService implementation for SapCloudForCustomerLinkedService. +func (scfcls SapCloudForCustomerLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, bool) { + return nil, false +} + +// AsAzureMLLinkedService is the BasicLinkedService implementation for SapCloudForCustomerLinkedService. +func (scfcls SapCloudForCustomerLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { + return nil, false +} + +// AsTeradataLinkedService is the BasicLinkedService implementation for SapCloudForCustomerLinkedService. +func (scfcls SapCloudForCustomerLinkedService) AsTeradataLinkedService() (*TeradataLinkedService, bool) { + return nil, false +} + +// AsDb2LinkedService is the BasicLinkedService implementation for SapCloudForCustomerLinkedService. +func (scfcls SapCloudForCustomerLinkedService) AsDb2LinkedService() (*Db2LinkedService, bool) { + return nil, false +} + +// AsSybaseLinkedService is the BasicLinkedService implementation for SapCloudForCustomerLinkedService. +func (scfcls SapCloudForCustomerLinkedService) AsSybaseLinkedService() (*SybaseLinkedService, bool) { + return nil, false +} + +// AsPostgreSQLLinkedService is the BasicLinkedService implementation for SapCloudForCustomerLinkedService. +func (scfcls SapCloudForCustomerLinkedService) AsPostgreSQLLinkedService() (*PostgreSQLLinkedService, bool) { + return nil, false +} + +// AsMySQLLinkedService is the BasicLinkedService implementation for SapCloudForCustomerLinkedService. +func (scfcls SapCloudForCustomerLinkedService) AsMySQLLinkedService() (*MySQLLinkedService, bool) { + return nil, false +} + +// AsAzureMySQLLinkedService is the BasicLinkedService implementation for SapCloudForCustomerLinkedService. +func (scfcls SapCloudForCustomerLinkedService) AsAzureMySQLLinkedService() (*AzureMySQLLinkedService, bool) { + return nil, false +} + +// AsOracleLinkedService is the BasicLinkedService implementation for SapCloudForCustomerLinkedService. +func (scfcls SapCloudForCustomerLinkedService) AsOracleLinkedService() (*OracleLinkedService, bool) { + return nil, false +} + +// AsFileServerLinkedService is the BasicLinkedService implementation for SapCloudForCustomerLinkedService. +func (scfcls SapCloudForCustomerLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { + return nil, false +} + +// AsHDInsightLinkedService is the BasicLinkedService implementation for SapCloudForCustomerLinkedService. +func (scfcls SapCloudForCustomerLinkedService) AsHDInsightLinkedService() (*HDInsightLinkedService, bool) { + return nil, false +} + +// AsDynamicsLinkedService is the BasicLinkedService implementation for SapCloudForCustomerLinkedService. +func (scfcls SapCloudForCustomerLinkedService) AsDynamicsLinkedService() (*DynamicsLinkedService, bool) { + return nil, false +} + +// AsCosmosDbLinkedService is the BasicLinkedService implementation for SapCloudForCustomerLinkedService. +func (scfcls SapCloudForCustomerLinkedService) AsCosmosDbLinkedService() (*CosmosDbLinkedService, bool) { + return nil, false +} + +// AsAzureKeyVaultLinkedService is the BasicLinkedService implementation for SapCloudForCustomerLinkedService. +func (scfcls SapCloudForCustomerLinkedService) AsAzureKeyVaultLinkedService() (*AzureKeyVaultLinkedService, bool) { + return nil, false +} + +// AsAzureBatchLinkedService is the BasicLinkedService implementation for SapCloudForCustomerLinkedService. +func (scfcls SapCloudForCustomerLinkedService) AsAzureBatchLinkedService() (*AzureBatchLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDatabaseLinkedService is the BasicLinkedService implementation for SapCloudForCustomerLinkedService. +func (scfcls SapCloudForCustomerLinkedService) AsAzureSQLDatabaseLinkedService() (*AzureSQLDatabaseLinkedService, bool) { + return nil, false +} + +// AsSQLServerLinkedService is the BasicLinkedService implementation for SapCloudForCustomerLinkedService. +func (scfcls SapCloudForCustomerLinkedService) AsSQLServerLinkedService() (*SQLServerLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDWLinkedService is the BasicLinkedService implementation for SapCloudForCustomerLinkedService. +func (scfcls SapCloudForCustomerLinkedService) AsAzureSQLDWLinkedService() (*AzureSQLDWLinkedService, bool) { + return nil, false +} + +// AsAzureStorageLinkedService is the BasicLinkedService implementation for SapCloudForCustomerLinkedService. +func (scfcls SapCloudForCustomerLinkedService) AsAzureStorageLinkedService() (*AzureStorageLinkedService, bool) { + return nil, false +} + +// AsLinkedService is the BasicLinkedService implementation for SapCloudForCustomerLinkedService. +func (scfcls SapCloudForCustomerLinkedService) AsLinkedService() (*LinkedService, bool) { + return nil, false +} + +// AsBasicLinkedService is the BasicLinkedService implementation for SapCloudForCustomerLinkedService. +func (scfcls SapCloudForCustomerLinkedService) AsBasicLinkedService() (BasicLinkedService, bool) { + return &scfcls, true +} + +// UnmarshalJSON is the custom unmarshaler for SapCloudForCustomerLinkedService struct. +func (scfcls *SapCloudForCustomerLinkedService) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "typeProperties": + if v != nil { + var sapCloudForCustomerLinkedServiceTypeProperties SapCloudForCustomerLinkedServiceTypeProperties + err = json.Unmarshal(*v, &sapCloudForCustomerLinkedServiceTypeProperties) + if err != nil { + return err + } + scfcls.SapCloudForCustomerLinkedServiceTypeProperties = &sapCloudForCustomerLinkedServiceTypeProperties + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if scfcls.AdditionalProperties == nil { + scfcls.AdditionalProperties = make(map[string]interface{}) + } + scfcls.AdditionalProperties[k] = additionalProperties + } + case "connectVia": + if v != nil { + var connectVia IntegrationRuntimeReference + err = json.Unmarshal(*v, &connectVia) + if err != nil { + return err + } + scfcls.ConnectVia = &connectVia + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + scfcls.Description = &description + } + case "parameters": + if v != nil { + var parameters map[string]*ParameterSpecification + err = json.Unmarshal(*v, ¶meters) + if err != nil { + return err + } + scfcls.Parameters = parameters + } + case "annotations": + if v != nil { + var annotations []interface{} + err = json.Unmarshal(*v, &annotations) + if err != nil { + return err + } + scfcls.Annotations = &annotations + } + case "type": + if v != nil { + var typeVar TypeBasicLinkedService + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + scfcls.Type = typeVar + } + } + } + + return nil +} + +// SapCloudForCustomerLinkedServiceTypeProperties SAP Cloud for Customer linked service properties. +type SapCloudForCustomerLinkedServiceTypeProperties struct { + // URL - The URL of SAP Cloud for Customer OData API. For example, '[https://[tenantname].crm.ondemand.com/sap/c4c/odata/v1]'. Type: string (or Expression with resultType string). + URL interface{} `json:"url,omitempty"` + // Username - The username for Basic authentication. Type: string (or Expression with resultType string). + Username interface{} `json:"username,omitempty"` + // Password - The password for Basic authentication. + Password BasicSecretBase `json:"password,omitempty"` + // EncryptedCredential - The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Either encryptedCredential or username/password must be provided. Type: string (or Expression with resultType string). + EncryptedCredential interface{} `json:"encryptedCredential,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for SapCloudForCustomerLinkedServiceTypeProperties struct. +func (scfclstp *SapCloudForCustomerLinkedServiceTypeProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "url": + if v != nil { + var URL interface{} + err = json.Unmarshal(*v, &URL) + if err != nil { + return err + } + scfclstp.URL = URL + } + case "username": + if v != nil { + var username interface{} + err = json.Unmarshal(*v, &username) + if err != nil { + return err + } + scfclstp.Username = username + } + case "password": + if v != nil { + password, err := unmarshalBasicSecretBase(*v) + if err != nil { + return err + } + scfclstp.Password = password + } + case "encryptedCredential": + if v != nil { + var encryptedCredential interface{} + err = json.Unmarshal(*v, &encryptedCredential) + if err != nil { + return err + } + scfclstp.EncryptedCredential = encryptedCredential + } + } + } + + return nil +} + +// SapCloudForCustomerResourceDataset the path of the SAP Cloud for Customer OData entity. +type SapCloudForCustomerResourceDataset struct { + // SapCloudForCustomerResourceDatasetTypeProperties - SAP Cloud For Customer OData resource dataset properties. + *SapCloudForCustomerResourceDatasetTypeProperties `json:"typeProperties,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Description - Dataset description. + Description *string `json:"description,omitempty"` + // Structure - Columns that define the structure of the dataset. Type: array (or Expression with resultType array), itemType: DatasetDataElement. + Structure interface{} `json:"structure,omitempty"` + // LinkedServiceName - Linked service reference. + LinkedServiceName *LinkedServiceReference `json:"linkedServiceName,omitempty"` + // Parameters - Parameters for dataset. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeDataset', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSQLServerTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSalesforceObject', 'TypeRelationalTable', 'TypeAzureMySQLTable', 'TypeOracleTable', 'TypeODataResource', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeAzureDataLakeStoreFile', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeAmazonS3Object' + Type TypeBasicDataset `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for SapCloudForCustomerResourceDataset. +func (scfcrd SapCloudForCustomerResourceDataset) MarshalJSON() ([]byte, error) { + scfcrd.Type = TypeSapCloudForCustomerResource + objectMap := make(map[string]interface{}) + if scfcrd.SapCloudForCustomerResourceDatasetTypeProperties != nil { + objectMap["typeProperties"] = scfcrd.SapCloudForCustomerResourceDatasetTypeProperties + } + if scfcrd.Description != nil { + objectMap["description"] = scfcrd.Description + } + objectMap["structure"] = scfcrd.Structure + if scfcrd.LinkedServiceName != nil { + objectMap["linkedServiceName"] = scfcrd.LinkedServiceName + } + if scfcrd.Parameters != nil { + objectMap["parameters"] = scfcrd.Parameters + } + if scfcrd.Annotations != nil { + objectMap["annotations"] = scfcrd.Annotations + } + if scfcrd.Type != "" { + objectMap["type"] = scfcrd.Type + } + for k, v := range scfcrd.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysObjectDataset is the BasicDataset implementation for SapCloudForCustomerResourceDataset. +func (scfcrd SapCloudForCustomerResourceDataset) AsResponsysObjectDataset() (*ResponsysObjectDataset, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudObjectDataset is the BasicDataset implementation for SapCloudForCustomerResourceDataset. +func (scfcrd SapCloudForCustomerResourceDataset) AsSalesforceMarketingCloudObjectDataset() (*SalesforceMarketingCloudObjectDataset, bool) { + return nil, false +} + +// AsVerticaTableDataset is the BasicDataset implementation for SapCloudForCustomerResourceDataset. +func (scfcrd SapCloudForCustomerResourceDataset) AsVerticaTableDataset() (*VerticaTableDataset, bool) { + return nil, false +} + +// AsNetezzaTableDataset is the BasicDataset implementation for SapCloudForCustomerResourceDataset. +func (scfcrd SapCloudForCustomerResourceDataset) AsNetezzaTableDataset() (*NetezzaTableDataset, bool) { + return nil, false +} + +// AsZohoObjectDataset is the BasicDataset implementation for SapCloudForCustomerResourceDataset. +func (scfcrd SapCloudForCustomerResourceDataset) AsZohoObjectDataset() (*ZohoObjectDataset, bool) { + return nil, false +} + +// AsXeroObjectDataset is the BasicDataset implementation for SapCloudForCustomerResourceDataset. +func (scfcrd SapCloudForCustomerResourceDataset) AsXeroObjectDataset() (*XeroObjectDataset, bool) { + return nil, false +} + +// AsSquareObjectDataset is the BasicDataset implementation for SapCloudForCustomerResourceDataset. +func (scfcrd SapCloudForCustomerResourceDataset) AsSquareObjectDataset() (*SquareObjectDataset, bool) { + return nil, false +} + +// AsSparkObjectDataset is the BasicDataset implementation for SapCloudForCustomerResourceDataset. +func (scfcrd SapCloudForCustomerResourceDataset) AsSparkObjectDataset() (*SparkObjectDataset, bool) { + return nil, false +} + +// AsShopifyObjectDataset is the BasicDataset implementation for SapCloudForCustomerResourceDataset. +func (scfcrd SapCloudForCustomerResourceDataset) AsShopifyObjectDataset() (*ShopifyObjectDataset, bool) { + return nil, false +} + +// AsServiceNowObjectDataset is the BasicDataset implementation for SapCloudForCustomerResourceDataset. +func (scfcrd SapCloudForCustomerResourceDataset) AsServiceNowObjectDataset() (*ServiceNowObjectDataset, bool) { + return nil, false +} + +// AsQuickBooksObjectDataset is the BasicDataset implementation for SapCloudForCustomerResourceDataset. +func (scfcrd SapCloudForCustomerResourceDataset) AsQuickBooksObjectDataset() (*QuickBooksObjectDataset, bool) { + return nil, false +} + +// AsPrestoObjectDataset is the BasicDataset implementation for SapCloudForCustomerResourceDataset. +func (scfcrd SapCloudForCustomerResourceDataset) AsPrestoObjectDataset() (*PrestoObjectDataset, bool) { + return nil, false +} + +// AsPhoenixObjectDataset is the BasicDataset implementation for SapCloudForCustomerResourceDataset. +func (scfcrd SapCloudForCustomerResourceDataset) AsPhoenixObjectDataset() (*PhoenixObjectDataset, bool) { + return nil, false +} + +// AsPaypalObjectDataset is the BasicDataset implementation for SapCloudForCustomerResourceDataset. +func (scfcrd SapCloudForCustomerResourceDataset) AsPaypalObjectDataset() (*PaypalObjectDataset, bool) { + return nil, false +} + +// AsMarketoObjectDataset is the BasicDataset implementation for SapCloudForCustomerResourceDataset. +func (scfcrd SapCloudForCustomerResourceDataset) AsMarketoObjectDataset() (*MarketoObjectDataset, bool) { + return nil, false +} + +// AsMariaDBTableDataset is the BasicDataset implementation for SapCloudForCustomerResourceDataset. +func (scfcrd SapCloudForCustomerResourceDataset) AsMariaDBTableDataset() (*MariaDBTableDataset, bool) { + return nil, false +} + +// AsMagentoObjectDataset is the BasicDataset implementation for SapCloudForCustomerResourceDataset. +func (scfcrd SapCloudForCustomerResourceDataset) AsMagentoObjectDataset() (*MagentoObjectDataset, bool) { + return nil, false +} + +// AsJiraObjectDataset is the BasicDataset implementation for SapCloudForCustomerResourceDataset. +func (scfcrd SapCloudForCustomerResourceDataset) AsJiraObjectDataset() (*JiraObjectDataset, bool) { + return nil, false +} + +// AsImpalaObjectDataset is the BasicDataset implementation for SapCloudForCustomerResourceDataset. +func (scfcrd SapCloudForCustomerResourceDataset) AsImpalaObjectDataset() (*ImpalaObjectDataset, bool) { + return nil, false +} + +// AsHubspotObjectDataset is the BasicDataset implementation for SapCloudForCustomerResourceDataset. +func (scfcrd SapCloudForCustomerResourceDataset) AsHubspotObjectDataset() (*HubspotObjectDataset, bool) { + return nil, false +} + +// AsHiveObjectDataset is the BasicDataset implementation for SapCloudForCustomerResourceDataset. +func (scfcrd SapCloudForCustomerResourceDataset) AsHiveObjectDataset() (*HiveObjectDataset, bool) { + return nil, false +} + +// AsHBaseObjectDataset is the BasicDataset implementation for SapCloudForCustomerResourceDataset. +func (scfcrd SapCloudForCustomerResourceDataset) AsHBaseObjectDataset() (*HBaseObjectDataset, bool) { + return nil, false +} + +// AsGreenplumTableDataset is the BasicDataset implementation for SapCloudForCustomerResourceDataset. +func (scfcrd SapCloudForCustomerResourceDataset) AsGreenplumTableDataset() (*GreenplumTableDataset, bool) { + return nil, false +} + +// AsGoogleBigQueryObjectDataset is the BasicDataset implementation for SapCloudForCustomerResourceDataset. +func (scfcrd SapCloudForCustomerResourceDataset) AsGoogleBigQueryObjectDataset() (*GoogleBigQueryObjectDataset, bool) { + return nil, false +} + +// AsEloquaObjectDataset is the BasicDataset implementation for SapCloudForCustomerResourceDataset. +func (scfcrd SapCloudForCustomerResourceDataset) AsEloquaObjectDataset() (*EloquaObjectDataset, bool) { + return nil, false +} + +// AsDrillTableDataset is the BasicDataset implementation for SapCloudForCustomerResourceDataset. +func (scfcrd SapCloudForCustomerResourceDataset) AsDrillTableDataset() (*DrillTableDataset, bool) { + return nil, false +} + +// AsCouchbaseTableDataset is the BasicDataset implementation for SapCloudForCustomerResourceDataset. +func (scfcrd SapCloudForCustomerResourceDataset) AsCouchbaseTableDataset() (*CouchbaseTableDataset, bool) { + return nil, false +} + +// AsConcurObjectDataset is the BasicDataset implementation for SapCloudForCustomerResourceDataset. +func (scfcrd SapCloudForCustomerResourceDataset) AsConcurObjectDataset() (*ConcurObjectDataset, bool) { + return nil, false +} + +// AsAzurePostgreSQLTableDataset is the BasicDataset implementation for SapCloudForCustomerResourceDataset. +func (scfcrd SapCloudForCustomerResourceDataset) AsAzurePostgreSQLTableDataset() (*AzurePostgreSQLTableDataset, bool) { + return nil, false +} + +// AsAmazonMWSObjectDataset is the BasicDataset implementation for SapCloudForCustomerResourceDataset. +func (scfcrd SapCloudForCustomerResourceDataset) AsAmazonMWSObjectDataset() (*AmazonMWSObjectDataset, bool) { + return nil, false +} + +// AsHTTPDataset is the BasicDataset implementation for SapCloudForCustomerResourceDataset. +func (scfcrd SapCloudForCustomerResourceDataset) AsHTTPDataset() (*HTTPDataset, bool) { + return nil, false +} + +// AsAzureSearchIndexDataset is the BasicDataset implementation for SapCloudForCustomerResourceDataset. +func (scfcrd SapCloudForCustomerResourceDataset) AsAzureSearchIndexDataset() (*AzureSearchIndexDataset, bool) { + return nil, false +} + +// AsWebTableDataset is the BasicDataset implementation for SapCloudForCustomerResourceDataset. +func (scfcrd SapCloudForCustomerResourceDataset) AsWebTableDataset() (*WebTableDataset, bool) { + return nil, false +} + +// AsSQLServerTableDataset is the BasicDataset implementation for SapCloudForCustomerResourceDataset. +func (scfcrd SapCloudForCustomerResourceDataset) AsSQLServerTableDataset() (*SQLServerTableDataset, bool) { + return nil, false +} + +// AsSapEccResourceDataset is the BasicDataset implementation for SapCloudForCustomerResourceDataset. +func (scfcrd SapCloudForCustomerResourceDataset) AsSapEccResourceDataset() (*SapEccResourceDataset, bool) { + return nil, false +} + +// AsSapCloudForCustomerResourceDataset is the BasicDataset implementation for SapCloudForCustomerResourceDataset. +func (scfcrd SapCloudForCustomerResourceDataset) AsSapCloudForCustomerResourceDataset() (*SapCloudForCustomerResourceDataset, bool) { + return &scfcrd, true +} + +// AsSalesforceObjectDataset is the BasicDataset implementation for SapCloudForCustomerResourceDataset. +func (scfcrd SapCloudForCustomerResourceDataset) AsSalesforceObjectDataset() (*SalesforceObjectDataset, bool) { + return nil, false +} + +// AsRelationalTableDataset is the BasicDataset implementation for SapCloudForCustomerResourceDataset. +func (scfcrd SapCloudForCustomerResourceDataset) AsRelationalTableDataset() (*RelationalTableDataset, bool) { + return nil, false +} + +// AsAzureMySQLTableDataset is the BasicDataset implementation for SapCloudForCustomerResourceDataset. +func (scfcrd SapCloudForCustomerResourceDataset) AsAzureMySQLTableDataset() (*AzureMySQLTableDataset, bool) { + return nil, false +} + +// AsOracleTableDataset is the BasicDataset implementation for SapCloudForCustomerResourceDataset. +func (scfcrd SapCloudForCustomerResourceDataset) AsOracleTableDataset() (*OracleTableDataset, bool) { + return nil, false +} + +// AsODataResourceDataset is the BasicDataset implementation for SapCloudForCustomerResourceDataset. +func (scfcrd SapCloudForCustomerResourceDataset) AsODataResourceDataset() (*ODataResourceDataset, bool) { + return nil, false +} + +// AsMongoDbCollectionDataset is the BasicDataset implementation for SapCloudForCustomerResourceDataset. +func (scfcrd SapCloudForCustomerResourceDataset) AsMongoDbCollectionDataset() (*MongoDbCollectionDataset, bool) { + return nil, false +} + +// AsFileShareDataset is the BasicDataset implementation for SapCloudForCustomerResourceDataset. +func (scfcrd SapCloudForCustomerResourceDataset) AsFileShareDataset() (*FileShareDataset, bool) { + return nil, false +} + +// AsAzureDataLakeStoreDataset is the BasicDataset implementation for SapCloudForCustomerResourceDataset. +func (scfcrd SapCloudForCustomerResourceDataset) AsAzureDataLakeStoreDataset() (*AzureDataLakeStoreDataset, bool) { + return nil, false +} + +// AsDynamicsEntityDataset is the BasicDataset implementation for SapCloudForCustomerResourceDataset. +func (scfcrd SapCloudForCustomerResourceDataset) AsDynamicsEntityDataset() (*DynamicsEntityDataset, bool) { + return nil, false +} + +// AsDocumentDbCollectionDataset is the BasicDataset implementation for SapCloudForCustomerResourceDataset. +func (scfcrd SapCloudForCustomerResourceDataset) AsDocumentDbCollectionDataset() (*DocumentDbCollectionDataset, bool) { + return nil, false +} + +// AsCustomDataset is the BasicDataset implementation for SapCloudForCustomerResourceDataset. +func (scfcrd SapCloudForCustomerResourceDataset) AsCustomDataset() (*CustomDataset, bool) { + return nil, false +} + +// AsCassandraTableDataset is the BasicDataset implementation for SapCloudForCustomerResourceDataset. +func (scfcrd SapCloudForCustomerResourceDataset) AsCassandraTableDataset() (*CassandraTableDataset, bool) { + return nil, false +} + +// AsAzureSQLDWTableDataset is the BasicDataset implementation for SapCloudForCustomerResourceDataset. +func (scfcrd SapCloudForCustomerResourceDataset) AsAzureSQLDWTableDataset() (*AzureSQLDWTableDataset, bool) { + return nil, false +} + +// AsAzureSQLTableDataset is the BasicDataset implementation for SapCloudForCustomerResourceDataset. +func (scfcrd SapCloudForCustomerResourceDataset) AsAzureSQLTableDataset() (*AzureSQLTableDataset, bool) { + return nil, false +} + +// AsAzureTableDataset is the BasicDataset implementation for SapCloudForCustomerResourceDataset. +func (scfcrd SapCloudForCustomerResourceDataset) AsAzureTableDataset() (*AzureTableDataset, bool) { + return nil, false +} + +// AsAzureBlobDataset is the BasicDataset implementation for SapCloudForCustomerResourceDataset. +func (scfcrd SapCloudForCustomerResourceDataset) AsAzureBlobDataset() (*AzureBlobDataset, bool) { + return nil, false +} + +// AsAmazonS3Dataset is the BasicDataset implementation for SapCloudForCustomerResourceDataset. +func (scfcrd SapCloudForCustomerResourceDataset) AsAmazonS3Dataset() (*AmazonS3Dataset, bool) { + return nil, false +} + +// AsDataset is the BasicDataset implementation for SapCloudForCustomerResourceDataset. +func (scfcrd SapCloudForCustomerResourceDataset) AsDataset() (*Dataset, bool) { + return nil, false +} + +// AsBasicDataset is the BasicDataset implementation for SapCloudForCustomerResourceDataset. +func (scfcrd SapCloudForCustomerResourceDataset) AsBasicDataset() (BasicDataset, bool) { + return &scfcrd, true +} + +// UnmarshalJSON is the custom unmarshaler for SapCloudForCustomerResourceDataset struct. +func (scfcrd *SapCloudForCustomerResourceDataset) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "typeProperties": + if v != nil { + var sapCloudForCustomerResourceDatasetTypeProperties SapCloudForCustomerResourceDatasetTypeProperties + err = json.Unmarshal(*v, &sapCloudForCustomerResourceDatasetTypeProperties) + if err != nil { + return err + } + scfcrd.SapCloudForCustomerResourceDatasetTypeProperties = &sapCloudForCustomerResourceDatasetTypeProperties + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if scfcrd.AdditionalProperties == nil { + scfcrd.AdditionalProperties = make(map[string]interface{}) + } + scfcrd.AdditionalProperties[k] = additionalProperties + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + scfcrd.Description = &description + } + case "structure": + if v != nil { + var structure interface{} + err = json.Unmarshal(*v, &structure) + if err != nil { + return err + } + scfcrd.Structure = structure + } + case "linkedServiceName": + if v != nil { + var linkedServiceName LinkedServiceReference + err = json.Unmarshal(*v, &linkedServiceName) + if err != nil { + return err + } + scfcrd.LinkedServiceName = &linkedServiceName + } + case "parameters": + if v != nil { + var parameters map[string]*ParameterSpecification + err = json.Unmarshal(*v, ¶meters) + if err != nil { + return err + } + scfcrd.Parameters = parameters + } + case "annotations": + if v != nil { + var annotations []interface{} + err = json.Unmarshal(*v, &annotations) + if err != nil { + return err + } + scfcrd.Annotations = &annotations + } + case "type": + if v != nil { + var typeVar TypeBasicDataset + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + scfcrd.Type = typeVar + } + } + } + + return nil +} + +// SapCloudForCustomerResourceDatasetTypeProperties sap Cloud For Customer OData resource dataset properties. +type SapCloudForCustomerResourceDatasetTypeProperties struct { + // Path - The path of the SAP Cloud for Customer OData entity. Type: string (or Expression with resultType string). + Path interface{} `json:"path,omitempty"` +} + +// SapCloudForCustomerSink a copy activity SAP Cloud for Customer sink. +type SapCloudForCustomerSink struct { + // WriteBehavior - The write behavior for the operation. Default is 'Insert'. Possible values include: 'SapCloudForCustomerSinkWriteBehaviorInsert', 'SapCloudForCustomerSinkWriteBehaviorUpdate' + WriteBehavior SapCloudForCustomerSinkWriteBehavior `json:"writeBehavior,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // WriteBatchSize - Write batch size. Type: integer (or Expression with resultType integer), minimum: 0. + WriteBatchSize interface{} `json:"writeBatchSize,omitempty"` + // WriteBatchTimeout - Write batch timeout. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + WriteBatchTimeout interface{} `json:"writeBatchTimeout,omitempty"` + // SinkRetryCount - Sink retry count. Type: integer (or Expression with resultType integer). + SinkRetryCount interface{} `json:"sinkRetryCount,omitempty"` + // SinkRetryWait - Sink retry wait. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + SinkRetryWait interface{} `json:"sinkRetryWait,omitempty"` + // Type - Possible values include: 'TypeCopySink', 'TypeSalesforceSink', 'TypeDynamicsSink', 'TypeOdbcSink', 'TypeAzureSearchIndexSink', 'TypeAzureDataLakeStoreSink', 'TypeOracleSink', 'TypeSQLDWSink', 'TypeSQLSink', 'TypeDocumentDbCollectionSink', 'TypeFileSystemSink', 'TypeBlobSink', 'TypeAzureTableSink', 'TypeAzureQueueSink', 'TypeSapCloudForCustomerSink' + Type TypeBasicCopySink `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for SapCloudForCustomerSink. +func (scfcs SapCloudForCustomerSink) MarshalJSON() ([]byte, error) { + scfcs.Type = TypeSapCloudForCustomerSink + objectMap := make(map[string]interface{}) + if scfcs.WriteBehavior != "" { + objectMap["writeBehavior"] = scfcs.WriteBehavior + } + objectMap["writeBatchSize"] = scfcs.WriteBatchSize + objectMap["writeBatchTimeout"] = scfcs.WriteBatchTimeout + objectMap["sinkRetryCount"] = scfcs.SinkRetryCount + objectMap["sinkRetryWait"] = scfcs.SinkRetryWait + if scfcs.Type != "" { + objectMap["type"] = scfcs.Type + } + for k, v := range scfcs.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsSalesforceSink is the BasicCopySink implementation for SapCloudForCustomerSink. +func (scfcs SapCloudForCustomerSink) AsSalesforceSink() (*SalesforceSink, bool) { + return nil, false +} + +// AsDynamicsSink is the BasicCopySink implementation for SapCloudForCustomerSink. +func (scfcs SapCloudForCustomerSink) AsDynamicsSink() (*DynamicsSink, bool) { + return nil, false +} + +// AsOdbcSink is the BasicCopySink implementation for SapCloudForCustomerSink. +func (scfcs SapCloudForCustomerSink) AsOdbcSink() (*OdbcSink, bool) { + return nil, false +} + +// AsAzureSearchIndexSink is the BasicCopySink implementation for SapCloudForCustomerSink. +func (scfcs SapCloudForCustomerSink) AsAzureSearchIndexSink() (*AzureSearchIndexSink, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSink is the BasicCopySink implementation for SapCloudForCustomerSink. +func (scfcs SapCloudForCustomerSink) AsAzureDataLakeStoreSink() (*AzureDataLakeStoreSink, bool) { + return nil, false +} + +// AsOracleSink is the BasicCopySink implementation for SapCloudForCustomerSink. +func (scfcs SapCloudForCustomerSink) AsOracleSink() (*OracleSink, bool) { + return nil, false +} + +// AsSQLDWSink is the BasicCopySink implementation for SapCloudForCustomerSink. +func (scfcs SapCloudForCustomerSink) AsSQLDWSink() (*SQLDWSink, bool) { + return nil, false +} + +// AsSQLSink is the BasicCopySink implementation for SapCloudForCustomerSink. +func (scfcs SapCloudForCustomerSink) AsSQLSink() (*SQLSink, bool) { + return nil, false +} + +// AsDocumentDbCollectionSink is the BasicCopySink implementation for SapCloudForCustomerSink. +func (scfcs SapCloudForCustomerSink) AsDocumentDbCollectionSink() (*DocumentDbCollectionSink, bool) { + return nil, false +} + +// AsFileSystemSink is the BasicCopySink implementation for SapCloudForCustomerSink. +func (scfcs SapCloudForCustomerSink) AsFileSystemSink() (*FileSystemSink, bool) { + return nil, false +} + +// AsBlobSink is the BasicCopySink implementation for SapCloudForCustomerSink. +func (scfcs SapCloudForCustomerSink) AsBlobSink() (*BlobSink, bool) { + return nil, false +} + +// AsAzureTableSink is the BasicCopySink implementation for SapCloudForCustomerSink. +func (scfcs SapCloudForCustomerSink) AsAzureTableSink() (*AzureTableSink, bool) { + return nil, false +} + +// AsAzureQueueSink is the BasicCopySink implementation for SapCloudForCustomerSink. +func (scfcs SapCloudForCustomerSink) AsAzureQueueSink() (*AzureQueueSink, bool) { + return nil, false +} + +// AsSapCloudForCustomerSink is the BasicCopySink implementation for SapCloudForCustomerSink. +func (scfcs SapCloudForCustomerSink) AsSapCloudForCustomerSink() (*SapCloudForCustomerSink, bool) { + return &scfcs, true +} + +// AsCopySink is the BasicCopySink implementation for SapCloudForCustomerSink. +func (scfcs SapCloudForCustomerSink) AsCopySink() (*CopySink, bool) { + return nil, false +} + +// AsBasicCopySink is the BasicCopySink implementation for SapCloudForCustomerSink. +func (scfcs SapCloudForCustomerSink) AsBasicCopySink() (BasicCopySink, bool) { + return &scfcs, true +} + +// SapCloudForCustomerSource a copy activity source for SAP Cloud for Customer source. +type SapCloudForCustomerSource struct { + // Query - SAP Cloud for Customer OData query. For example, "$top=1". Type: string (or Expression with resultType string). + Query interface{} `json:"query,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // SourceRetryCount - Source retry count. Type: integer (or Expression with resultType integer). + SourceRetryCount interface{} `json:"sourceRetryCount,omitempty"` + // SourceRetryWait - Source retry wait. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` + // Type - Possible values include: 'TypeCopySource', 'TypeAmazonRedshiftSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeHTTPSource', 'TypeAzureDataLakeStoreSource', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeRelationalSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource' + Type TypeBasicCopySource `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for SapCloudForCustomerSource. +func (scfcs SapCloudForCustomerSource) MarshalJSON() ([]byte, error) { + scfcs.Type = TypeSapCloudForCustomerSource + objectMap := make(map[string]interface{}) + objectMap["query"] = scfcs.Query + objectMap["sourceRetryCount"] = scfcs.SourceRetryCount + objectMap["sourceRetryWait"] = scfcs.SourceRetryWait + if scfcs.Type != "" { + objectMap["type"] = scfcs.Type + } + for k, v := range scfcs.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsAmazonRedshiftSource is the BasicCopySource implementation for SapCloudForCustomerSource. +func (scfcs SapCloudForCustomerSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { + return nil, false +} + +// AsResponsysSource is the BasicCopySource implementation for SapCloudForCustomerSource. +func (scfcs SapCloudForCustomerSource) AsResponsysSource() (*ResponsysSource, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudSource is the BasicCopySource implementation for SapCloudForCustomerSource. +func (scfcs SapCloudForCustomerSource) AsSalesforceMarketingCloudSource() (*SalesforceMarketingCloudSource, bool) { + return nil, false +} + +// AsVerticaSource is the BasicCopySource implementation for SapCloudForCustomerSource. +func (scfcs SapCloudForCustomerSource) AsVerticaSource() (*VerticaSource, bool) { + return nil, false +} + +// AsNetezzaSource is the BasicCopySource implementation for SapCloudForCustomerSource. +func (scfcs SapCloudForCustomerSource) AsNetezzaSource() (*NetezzaSource, bool) { + return nil, false +} + +// AsZohoSource is the BasicCopySource implementation for SapCloudForCustomerSource. +func (scfcs SapCloudForCustomerSource) AsZohoSource() (*ZohoSource, bool) { + return nil, false +} + +// AsXeroSource is the BasicCopySource implementation for SapCloudForCustomerSource. +func (scfcs SapCloudForCustomerSource) AsXeroSource() (*XeroSource, bool) { + return nil, false +} + +// AsSquareSource is the BasicCopySource implementation for SapCloudForCustomerSource. +func (scfcs SapCloudForCustomerSource) AsSquareSource() (*SquareSource, bool) { + return nil, false +} + +// AsSparkSource is the BasicCopySource implementation for SapCloudForCustomerSource. +func (scfcs SapCloudForCustomerSource) AsSparkSource() (*SparkSource, bool) { + return nil, false +} + +// AsShopifySource is the BasicCopySource implementation for SapCloudForCustomerSource. +func (scfcs SapCloudForCustomerSource) AsShopifySource() (*ShopifySource, bool) { + return nil, false +} + +// AsServiceNowSource is the BasicCopySource implementation for SapCloudForCustomerSource. +func (scfcs SapCloudForCustomerSource) AsServiceNowSource() (*ServiceNowSource, bool) { + return nil, false +} + +// AsQuickBooksSource is the BasicCopySource implementation for SapCloudForCustomerSource. +func (scfcs SapCloudForCustomerSource) AsQuickBooksSource() (*QuickBooksSource, bool) { + return nil, false +} + +// AsPrestoSource is the BasicCopySource implementation for SapCloudForCustomerSource. +func (scfcs SapCloudForCustomerSource) AsPrestoSource() (*PrestoSource, bool) { + return nil, false +} + +// AsPhoenixSource is the BasicCopySource implementation for SapCloudForCustomerSource. +func (scfcs SapCloudForCustomerSource) AsPhoenixSource() (*PhoenixSource, bool) { + return nil, false +} + +// AsPaypalSource is the BasicCopySource implementation for SapCloudForCustomerSource. +func (scfcs SapCloudForCustomerSource) AsPaypalSource() (*PaypalSource, bool) { + return nil, false +} + +// AsMarketoSource is the BasicCopySource implementation for SapCloudForCustomerSource. +func (scfcs SapCloudForCustomerSource) AsMarketoSource() (*MarketoSource, bool) { + return nil, false +} + +// AsMariaDBSource is the BasicCopySource implementation for SapCloudForCustomerSource. +func (scfcs SapCloudForCustomerSource) AsMariaDBSource() (*MariaDBSource, bool) { + return nil, false +} + +// AsMagentoSource is the BasicCopySource implementation for SapCloudForCustomerSource. +func (scfcs SapCloudForCustomerSource) AsMagentoSource() (*MagentoSource, bool) { + return nil, false +} + +// AsJiraSource is the BasicCopySource implementation for SapCloudForCustomerSource. +func (scfcs SapCloudForCustomerSource) AsJiraSource() (*JiraSource, bool) { + return nil, false +} + +// AsImpalaSource is the BasicCopySource implementation for SapCloudForCustomerSource. +func (scfcs SapCloudForCustomerSource) AsImpalaSource() (*ImpalaSource, bool) { + return nil, false +} + +// AsHubspotSource is the BasicCopySource implementation for SapCloudForCustomerSource. +func (scfcs SapCloudForCustomerSource) AsHubspotSource() (*HubspotSource, bool) { + return nil, false +} + +// AsHiveSource is the BasicCopySource implementation for SapCloudForCustomerSource. +func (scfcs SapCloudForCustomerSource) AsHiveSource() (*HiveSource, bool) { + return nil, false +} + +// AsHBaseSource is the BasicCopySource implementation for SapCloudForCustomerSource. +func (scfcs SapCloudForCustomerSource) AsHBaseSource() (*HBaseSource, bool) { + return nil, false +} + +// AsGreenplumSource is the BasicCopySource implementation for SapCloudForCustomerSource. +func (scfcs SapCloudForCustomerSource) AsGreenplumSource() (*GreenplumSource, bool) { + return nil, false +} + +// AsGoogleBigQuerySource is the BasicCopySource implementation for SapCloudForCustomerSource. +func (scfcs SapCloudForCustomerSource) AsGoogleBigQuerySource() (*GoogleBigQuerySource, bool) { + return nil, false +} + +// AsEloquaSource is the BasicCopySource implementation for SapCloudForCustomerSource. +func (scfcs SapCloudForCustomerSource) AsEloquaSource() (*EloquaSource, bool) { + return nil, false +} + +// AsDrillSource is the BasicCopySource implementation for SapCloudForCustomerSource. +func (scfcs SapCloudForCustomerSource) AsDrillSource() (*DrillSource, bool) { + return nil, false +} + +// AsCouchbaseSource is the BasicCopySource implementation for SapCloudForCustomerSource. +func (scfcs SapCloudForCustomerSource) AsCouchbaseSource() (*CouchbaseSource, bool) { + return nil, false +} + +// AsConcurSource is the BasicCopySource implementation for SapCloudForCustomerSource. +func (scfcs SapCloudForCustomerSource) AsConcurSource() (*ConcurSource, bool) { + return nil, false +} + +// AsAzurePostgreSQLSource is the BasicCopySource implementation for SapCloudForCustomerSource. +func (scfcs SapCloudForCustomerSource) AsAzurePostgreSQLSource() (*AzurePostgreSQLSource, bool) { + return nil, false +} + +// AsAmazonMWSSource is the BasicCopySource implementation for SapCloudForCustomerSource. +func (scfcs SapCloudForCustomerSource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { + return nil, false +} + +// AsHTTPSource is the BasicCopySource implementation for SapCloudForCustomerSource. +func (scfcs SapCloudForCustomerSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for SapCloudForCustomerSource. +func (scfcs SapCloudForCustomerSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for SapCloudForCustomerSource. +func (scfcs SapCloudForCustomerSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsCassandraSource is the BasicCopySource implementation for SapCloudForCustomerSource. +func (scfcs SapCloudForCustomerSource) AsCassandraSource() (*CassandraSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for SapCloudForCustomerSource. +func (scfcs SapCloudForCustomerSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for SapCloudForCustomerSource. +func (scfcs SapCloudForCustomerSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureMySQLSource is the BasicCopySource implementation for SapCloudForCustomerSource. +func (scfcs SapCloudForCustomerSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for SapCloudForCustomerSource. +func (scfcs SapCloudForCustomerSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for SapCloudForCustomerSource. +func (scfcs SapCloudForCustomerSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsSQLDWSource is the BasicCopySource implementation for SapCloudForCustomerSource. +func (scfcs SapCloudForCustomerSource) AsSQLDWSource() (*SQLDWSource, bool) { + return nil, false +} + +// AsSQLSource is the BasicCopySource implementation for SapCloudForCustomerSource. +func (scfcs SapCloudForCustomerSource) AsSQLSource() (*SQLSource, bool) { + return nil, false +} + +// AsSapEccSource is the BasicCopySource implementation for SapCloudForCustomerSource. +func (scfcs SapCloudForCustomerSource) AsSapEccSource() (*SapEccSource, bool) { + return nil, false +} + +// AsSapCloudForCustomerSource is the BasicCopySource implementation for SapCloudForCustomerSource. +func (scfcs SapCloudForCustomerSource) AsSapCloudForCustomerSource() (*SapCloudForCustomerSource, bool) { + return &scfcs, true +} + +// AsSalesforceSource is the BasicCopySource implementation for SapCloudForCustomerSource. +func (scfcs SapCloudForCustomerSource) AsSalesforceSource() (*SalesforceSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for SapCloudForCustomerSource. +func (scfcs SapCloudForCustomerSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for SapCloudForCustomerSource. +func (scfcs SapCloudForCustomerSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for SapCloudForCustomerSource. +func (scfcs SapCloudForCustomerSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for SapCloudForCustomerSource. +func (scfcs SapCloudForCustomerSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + +// AsAzureTableSource is the BasicCopySource implementation for SapCloudForCustomerSource. +func (scfcs SapCloudForCustomerSource) AsAzureTableSource() (*AzureTableSource, bool) { + return nil, false +} + +// AsCopySource is the BasicCopySource implementation for SapCloudForCustomerSource. +func (scfcs SapCloudForCustomerSource) AsCopySource() (*CopySource, bool) { + return nil, false +} + +// AsBasicCopySource is the BasicCopySource implementation for SapCloudForCustomerSource. +func (scfcs SapCloudForCustomerSource) AsBasicCopySource() (BasicCopySource, bool) { + return &scfcs, true +} + +// SapEccLinkedService linked service for SAP ERP Central Component(SAP ECC). +type SapEccLinkedService struct { + // SapEccLinkedServiceTypeProperties - SAP ECC linked service properties. + *SapEccLinkedServiceTypeProperties `json:"typeProperties,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // ConnectVia - The integration runtime reference. + ConnectVia *IntegrationRuntimeReference `json:"connectVia,omitempty"` + // Description - Linked service description. + Description *string `json:"description,omitempty"` + // Parameters - Parameters for linked service. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeLinkedService', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforce', 'TypeAzureDataLakeStore', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureStorage' + Type TypeBasicLinkedService `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for SapEccLinkedService. +func (sels SapEccLinkedService) MarshalJSON() ([]byte, error) { + sels.Type = TypeSapEcc + objectMap := make(map[string]interface{}) + if sels.SapEccLinkedServiceTypeProperties != nil { + objectMap["typeProperties"] = sels.SapEccLinkedServiceTypeProperties + } + if sels.ConnectVia != nil { + objectMap["connectVia"] = sels.ConnectVia + } + if sels.Description != nil { + objectMap["description"] = sels.Description + } + if sels.Parameters != nil { + objectMap["parameters"] = sels.Parameters + } + if sels.Annotations != nil { + objectMap["annotations"] = sels.Annotations + } + if sels.Type != "" { + objectMap["type"] = sels.Type + } + for k, v := range sels.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysLinkedService is the BasicLinkedService implementation for SapEccLinkedService. +func (sels SapEccLinkedService) AsResponsysLinkedService() (*ResponsysLinkedService, bool) { + return nil, false +} + +// AsAzureDatabricksLinkedService is the BasicLinkedService implementation for SapEccLinkedService. +func (sels SapEccLinkedService) AsAzureDatabricksLinkedService() (*AzureDatabricksLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeAnalyticsLinkedService is the BasicLinkedService implementation for SapEccLinkedService. +func (sels SapEccLinkedService) AsAzureDataLakeAnalyticsLinkedService() (*AzureDataLakeAnalyticsLinkedService, bool) { + return nil, false +} + +// AsHDInsightOnDemandLinkedService is the BasicLinkedService implementation for SapEccLinkedService. +func (sels SapEccLinkedService) AsHDInsightOnDemandLinkedService() (*HDInsightOnDemandLinkedService, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudLinkedService is the BasicLinkedService implementation for SapEccLinkedService. +func (sels SapEccLinkedService) AsSalesforceMarketingCloudLinkedService() (*SalesforceMarketingCloudLinkedService, bool) { + return nil, false +} + +// AsNetezzaLinkedService is the BasicLinkedService implementation for SapEccLinkedService. +func (sels SapEccLinkedService) AsNetezzaLinkedService() (*NetezzaLinkedService, bool) { + return nil, false +} + +// AsVerticaLinkedService is the BasicLinkedService implementation for SapEccLinkedService. +func (sels SapEccLinkedService) AsVerticaLinkedService() (*VerticaLinkedService, bool) { + return nil, false +} + +// AsZohoLinkedService is the BasicLinkedService implementation for SapEccLinkedService. +func (sels SapEccLinkedService) AsZohoLinkedService() (*ZohoLinkedService, bool) { + return nil, false +} + +// AsXeroLinkedService is the BasicLinkedService implementation for SapEccLinkedService. +func (sels SapEccLinkedService) AsXeroLinkedService() (*XeroLinkedService, bool) { + return nil, false +} + +// AsSquareLinkedService is the BasicLinkedService implementation for SapEccLinkedService. +func (sels SapEccLinkedService) AsSquareLinkedService() (*SquareLinkedService, bool) { + return nil, false +} + +// AsSparkLinkedService is the BasicLinkedService implementation for SapEccLinkedService. +func (sels SapEccLinkedService) AsSparkLinkedService() (*SparkLinkedService, bool) { + return nil, false +} + +// AsShopifyLinkedService is the BasicLinkedService implementation for SapEccLinkedService. +func (sels SapEccLinkedService) AsShopifyLinkedService() (*ShopifyLinkedService, bool) { + return nil, false +} + +// AsServiceNowLinkedService is the BasicLinkedService implementation for SapEccLinkedService. +func (sels SapEccLinkedService) AsServiceNowLinkedService() (*ServiceNowLinkedService, bool) { + return nil, false +} + +// AsQuickBooksLinkedService is the BasicLinkedService implementation for SapEccLinkedService. +func (sels SapEccLinkedService) AsQuickBooksLinkedService() (*QuickBooksLinkedService, bool) { + return nil, false +} + +// AsPrestoLinkedService is the BasicLinkedService implementation for SapEccLinkedService. +func (sels SapEccLinkedService) AsPrestoLinkedService() (*PrestoLinkedService, bool) { + return nil, false +} + +// AsPhoenixLinkedService is the BasicLinkedService implementation for SapEccLinkedService. +func (sels SapEccLinkedService) AsPhoenixLinkedService() (*PhoenixLinkedService, bool) { + return nil, false +} + +// AsPaypalLinkedService is the BasicLinkedService implementation for SapEccLinkedService. +func (sels SapEccLinkedService) AsPaypalLinkedService() (*PaypalLinkedService, bool) { + return nil, false +} + +// AsMarketoLinkedService is the BasicLinkedService implementation for SapEccLinkedService. +func (sels SapEccLinkedService) AsMarketoLinkedService() (*MarketoLinkedService, bool) { + return nil, false +} + +// AsMariaDBLinkedService is the BasicLinkedService implementation for SapEccLinkedService. +func (sels SapEccLinkedService) AsMariaDBLinkedService() (*MariaDBLinkedService, bool) { + return nil, false +} + +// AsMagentoLinkedService is the BasicLinkedService implementation for SapEccLinkedService. +func (sels SapEccLinkedService) AsMagentoLinkedService() (*MagentoLinkedService, bool) { + return nil, false +} + +// AsJiraLinkedService is the BasicLinkedService implementation for SapEccLinkedService. +func (sels SapEccLinkedService) AsJiraLinkedService() (*JiraLinkedService, bool) { + return nil, false +} + +// AsImpalaLinkedService is the BasicLinkedService implementation for SapEccLinkedService. +func (sels SapEccLinkedService) AsImpalaLinkedService() (*ImpalaLinkedService, bool) { + return nil, false +} + +// AsHubspotLinkedService is the BasicLinkedService implementation for SapEccLinkedService. +func (sels SapEccLinkedService) AsHubspotLinkedService() (*HubspotLinkedService, bool) { + return nil, false +} + +// AsHiveLinkedService is the BasicLinkedService implementation for SapEccLinkedService. +func (sels SapEccLinkedService) AsHiveLinkedService() (*HiveLinkedService, bool) { + return nil, false +} + +// AsHBaseLinkedService is the BasicLinkedService implementation for SapEccLinkedService. +func (sels SapEccLinkedService) AsHBaseLinkedService() (*HBaseLinkedService, bool) { + return nil, false +} + +// AsGreenplumLinkedService is the BasicLinkedService implementation for SapEccLinkedService. +func (sels SapEccLinkedService) AsGreenplumLinkedService() (*GreenplumLinkedService, bool) { + return nil, false +} + +// AsGoogleBigQueryLinkedService is the BasicLinkedService implementation for SapEccLinkedService. +func (sels SapEccLinkedService) AsGoogleBigQueryLinkedService() (*GoogleBigQueryLinkedService, bool) { + return nil, false +} + +// AsEloquaLinkedService is the BasicLinkedService implementation for SapEccLinkedService. +func (sels SapEccLinkedService) AsEloquaLinkedService() (*EloquaLinkedService, bool) { + return nil, false +} + +// AsDrillLinkedService is the BasicLinkedService implementation for SapEccLinkedService. +func (sels SapEccLinkedService) AsDrillLinkedService() (*DrillLinkedService, bool) { + return nil, false +} + +// AsCouchbaseLinkedService is the BasicLinkedService implementation for SapEccLinkedService. +func (sels SapEccLinkedService) AsCouchbaseLinkedService() (*CouchbaseLinkedService, bool) { + return nil, false +} + +// AsConcurLinkedService is the BasicLinkedService implementation for SapEccLinkedService. +func (sels SapEccLinkedService) AsConcurLinkedService() (*ConcurLinkedService, bool) { + return nil, false +} + +// AsAzurePostgreSQLLinkedService is the BasicLinkedService implementation for SapEccLinkedService. +func (sels SapEccLinkedService) AsAzurePostgreSQLLinkedService() (*AzurePostgreSQLLinkedService, bool) { + return nil, false +} + +// AsAmazonMWSLinkedService is the BasicLinkedService implementation for SapEccLinkedService. +func (sels SapEccLinkedService) AsAmazonMWSLinkedService() (*AmazonMWSLinkedService, bool) { + return nil, false +} + +// AsSapHanaLinkedService is the BasicLinkedService implementation for SapEccLinkedService. +func (sels SapEccLinkedService) AsSapHanaLinkedService() (*SapHanaLinkedService, bool) { + return nil, false +} + +// AsSapBWLinkedService is the BasicLinkedService implementation for SapEccLinkedService. +func (sels SapEccLinkedService) AsSapBWLinkedService() (*SapBWLinkedService, bool) { + return nil, false +} + +// AsSftpServerLinkedService is the BasicLinkedService implementation for SapEccLinkedService. +func (sels SapEccLinkedService) AsSftpServerLinkedService() (*SftpServerLinkedService, bool) { + return nil, false +} + +// AsFtpServerLinkedService is the BasicLinkedService implementation for SapEccLinkedService. +func (sels SapEccLinkedService) AsFtpServerLinkedService() (*FtpServerLinkedService, bool) { + return nil, false +} + +// AsHTTPLinkedService is the BasicLinkedService implementation for SapEccLinkedService. +func (sels SapEccLinkedService) AsHTTPLinkedService() (*HTTPLinkedService, bool) { + return nil, false +} + +// AsAzureSearchLinkedService is the BasicLinkedService implementation for SapEccLinkedService. +func (sels SapEccLinkedService) AsAzureSearchLinkedService() (*AzureSearchLinkedService, bool) { + return nil, false +} + +// AsCustomDataSourceLinkedService is the BasicLinkedService implementation for SapEccLinkedService. +func (sels SapEccLinkedService) AsCustomDataSourceLinkedService() (*CustomDataSourceLinkedService, bool) { + return nil, false +} + +// AsAmazonRedshiftLinkedService is the BasicLinkedService implementation for SapEccLinkedService. +func (sels SapEccLinkedService) AsAmazonRedshiftLinkedService() (*AmazonRedshiftLinkedService, bool) { + return nil, false +} + +// AsAmazonS3LinkedService is the BasicLinkedService implementation for SapEccLinkedService. +func (sels SapEccLinkedService) AsAmazonS3LinkedService() (*AmazonS3LinkedService, bool) { + return nil, false +} + +// AsSapEccLinkedService is the BasicLinkedService implementation for SapEccLinkedService. +func (sels SapEccLinkedService) AsSapEccLinkedService() (*SapEccLinkedService, bool) { + return &sels, true +} + +// AsSapCloudForCustomerLinkedService is the BasicLinkedService implementation for SapEccLinkedService. +func (sels SapEccLinkedService) AsSapCloudForCustomerLinkedService() (*SapCloudForCustomerLinkedService, bool) { + return nil, false +} + +// AsSalesforceLinkedService is the BasicLinkedService implementation for SapEccLinkedService. +func (sels SapEccLinkedService) AsSalesforceLinkedService() (*SalesforceLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeStoreLinkedService is the BasicLinkedService implementation for SapEccLinkedService. +func (sels SapEccLinkedService) AsAzureDataLakeStoreLinkedService() (*AzureDataLakeStoreLinkedService, bool) { + return nil, false +} + +// AsMongoDbLinkedService is the BasicLinkedService implementation for SapEccLinkedService. +func (sels SapEccLinkedService) AsMongoDbLinkedService() (*MongoDbLinkedService, bool) { + return nil, false +} + +// AsCassandraLinkedService is the BasicLinkedService implementation for SapEccLinkedService. +func (sels SapEccLinkedService) AsCassandraLinkedService() (*CassandraLinkedService, bool) { + return nil, false +} + +// AsWebLinkedService is the BasicLinkedService implementation for SapEccLinkedService. +func (sels SapEccLinkedService) AsWebLinkedService() (*WebLinkedService, bool) { + return nil, false +} + +// AsODataLinkedService is the BasicLinkedService implementation for SapEccLinkedService. +func (sels SapEccLinkedService) AsODataLinkedService() (*ODataLinkedService, bool) { + return nil, false +} + +// AsHdfsLinkedService is the BasicLinkedService implementation for SapEccLinkedService. +func (sels SapEccLinkedService) AsHdfsLinkedService() (*HdfsLinkedService, bool) { + return nil, false +} + +// AsOdbcLinkedService is the BasicLinkedService implementation for SapEccLinkedService. +func (sels SapEccLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, bool) { + return nil, false +} + +// AsAzureMLLinkedService is the BasicLinkedService implementation for SapEccLinkedService. +func (sels SapEccLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { + return nil, false +} + +// AsTeradataLinkedService is the BasicLinkedService implementation for SapEccLinkedService. +func (sels SapEccLinkedService) AsTeradataLinkedService() (*TeradataLinkedService, bool) { + return nil, false +} + +// AsDb2LinkedService is the BasicLinkedService implementation for SapEccLinkedService. +func (sels SapEccLinkedService) AsDb2LinkedService() (*Db2LinkedService, bool) { + return nil, false +} + +// AsSybaseLinkedService is the BasicLinkedService implementation for SapEccLinkedService. +func (sels SapEccLinkedService) AsSybaseLinkedService() (*SybaseLinkedService, bool) { + return nil, false +} + +// AsPostgreSQLLinkedService is the BasicLinkedService implementation for SapEccLinkedService. +func (sels SapEccLinkedService) AsPostgreSQLLinkedService() (*PostgreSQLLinkedService, bool) { + return nil, false +} + +// AsMySQLLinkedService is the BasicLinkedService implementation for SapEccLinkedService. +func (sels SapEccLinkedService) AsMySQLLinkedService() (*MySQLLinkedService, bool) { + return nil, false +} + +// AsAzureMySQLLinkedService is the BasicLinkedService implementation for SapEccLinkedService. +func (sels SapEccLinkedService) AsAzureMySQLLinkedService() (*AzureMySQLLinkedService, bool) { + return nil, false +} + +// AsOracleLinkedService is the BasicLinkedService implementation for SapEccLinkedService. +func (sels SapEccLinkedService) AsOracleLinkedService() (*OracleLinkedService, bool) { + return nil, false +} + +// AsFileServerLinkedService is the BasicLinkedService implementation for SapEccLinkedService. +func (sels SapEccLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { + return nil, false +} + +// AsHDInsightLinkedService is the BasicLinkedService implementation for SapEccLinkedService. +func (sels SapEccLinkedService) AsHDInsightLinkedService() (*HDInsightLinkedService, bool) { + return nil, false +} + +// AsDynamicsLinkedService is the BasicLinkedService implementation for SapEccLinkedService. +func (sels SapEccLinkedService) AsDynamicsLinkedService() (*DynamicsLinkedService, bool) { + return nil, false +} + +// AsCosmosDbLinkedService is the BasicLinkedService implementation for SapEccLinkedService. +func (sels SapEccLinkedService) AsCosmosDbLinkedService() (*CosmosDbLinkedService, bool) { + return nil, false +} + +// AsAzureKeyVaultLinkedService is the BasicLinkedService implementation for SapEccLinkedService. +func (sels SapEccLinkedService) AsAzureKeyVaultLinkedService() (*AzureKeyVaultLinkedService, bool) { + return nil, false +} + +// AsAzureBatchLinkedService is the BasicLinkedService implementation for SapEccLinkedService. +func (sels SapEccLinkedService) AsAzureBatchLinkedService() (*AzureBatchLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDatabaseLinkedService is the BasicLinkedService implementation for SapEccLinkedService. +func (sels SapEccLinkedService) AsAzureSQLDatabaseLinkedService() (*AzureSQLDatabaseLinkedService, bool) { + return nil, false +} + +// AsSQLServerLinkedService is the BasicLinkedService implementation for SapEccLinkedService. +func (sels SapEccLinkedService) AsSQLServerLinkedService() (*SQLServerLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDWLinkedService is the BasicLinkedService implementation for SapEccLinkedService. +func (sels SapEccLinkedService) AsAzureSQLDWLinkedService() (*AzureSQLDWLinkedService, bool) { + return nil, false +} + +// AsAzureStorageLinkedService is the BasicLinkedService implementation for SapEccLinkedService. +func (sels SapEccLinkedService) AsAzureStorageLinkedService() (*AzureStorageLinkedService, bool) { + return nil, false +} + +// AsLinkedService is the BasicLinkedService implementation for SapEccLinkedService. +func (sels SapEccLinkedService) AsLinkedService() (*LinkedService, bool) { + return nil, false +} + +// AsBasicLinkedService is the BasicLinkedService implementation for SapEccLinkedService. +func (sels SapEccLinkedService) AsBasicLinkedService() (BasicLinkedService, bool) { + return &sels, true +} + +// UnmarshalJSON is the custom unmarshaler for SapEccLinkedService struct. +func (sels *SapEccLinkedService) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "typeProperties": + if v != nil { + var sapEccLinkedServiceTypeProperties SapEccLinkedServiceTypeProperties + err = json.Unmarshal(*v, &sapEccLinkedServiceTypeProperties) + if err != nil { + return err + } + sels.SapEccLinkedServiceTypeProperties = &sapEccLinkedServiceTypeProperties + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if sels.AdditionalProperties == nil { + sels.AdditionalProperties = make(map[string]interface{}) + } + sels.AdditionalProperties[k] = additionalProperties + } + case "connectVia": + if v != nil { + var connectVia IntegrationRuntimeReference + err = json.Unmarshal(*v, &connectVia) + if err != nil { + return err + } + sels.ConnectVia = &connectVia + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + sels.Description = &description + } + case "parameters": + if v != nil { + var parameters map[string]*ParameterSpecification + err = json.Unmarshal(*v, ¶meters) + if err != nil { + return err + } + sels.Parameters = parameters + } + case "annotations": + if v != nil { + var annotations []interface{} + err = json.Unmarshal(*v, &annotations) + if err != nil { + return err + } + sels.Annotations = &annotations + } + case "type": + if v != nil { + var typeVar TypeBasicLinkedService + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + sels.Type = typeVar + } + } + } + + return nil +} + +// SapEccLinkedServiceTypeProperties SAP ECC linked service properties. +type SapEccLinkedServiceTypeProperties struct { + // URL - The URL of SAP ECC OData API. For example, '[https://hostname:port/sap/opu/odata/sap/servicename/]'. Type: string (or Expression with resultType string). + URL *string `json:"url,omitempty"` + // Username - The username for Basic authentication. Type: string (or Expression with resultType string). + Username *string `json:"username,omitempty"` + // Password - The password for Basic authentication. + Password BasicSecretBase `json:"password,omitempty"` + // EncryptedCredential - The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Either encryptedCredential or username/password must be provided. Type: string (or Expression with resultType string). + EncryptedCredential *string `json:"encryptedCredential,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for SapEccLinkedServiceTypeProperties struct. +func (selstp *SapEccLinkedServiceTypeProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "url": + if v != nil { + var URL string + err = json.Unmarshal(*v, &URL) + if err != nil { + return err + } + selstp.URL = &URL + } + case "username": + if v != nil { + var username string + err = json.Unmarshal(*v, &username) + if err != nil { + return err + } + selstp.Username = &username + } + case "password": + if v != nil { + password, err := unmarshalBasicSecretBase(*v) + if err != nil { + return err + } + selstp.Password = password + } + case "encryptedCredential": + if v != nil { + var encryptedCredential string + err = json.Unmarshal(*v, &encryptedCredential) + if err != nil { + return err + } + selstp.EncryptedCredential = &encryptedCredential + } + } + } + + return nil +} + +// SapEccResourceDataset the path of the SAP ECC OData entity. +type SapEccResourceDataset struct { + // SapEccResourceDatasetTypeProperties - SAP ECC OData resource dataset properties. + *SapEccResourceDatasetTypeProperties `json:"typeProperties,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Description - Dataset description. + Description *string `json:"description,omitempty"` + // Structure - Columns that define the structure of the dataset. Type: array (or Expression with resultType array), itemType: DatasetDataElement. + Structure interface{} `json:"structure,omitempty"` + // LinkedServiceName - Linked service reference. + LinkedServiceName *LinkedServiceReference `json:"linkedServiceName,omitempty"` + // Parameters - Parameters for dataset. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeDataset', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSQLServerTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSalesforceObject', 'TypeRelationalTable', 'TypeAzureMySQLTable', 'TypeOracleTable', 'TypeODataResource', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeAzureDataLakeStoreFile', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeAmazonS3Object' + Type TypeBasicDataset `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for SapEccResourceDataset. +func (serd SapEccResourceDataset) MarshalJSON() ([]byte, error) { + serd.Type = TypeSapEccResource + objectMap := make(map[string]interface{}) + if serd.SapEccResourceDatasetTypeProperties != nil { + objectMap["typeProperties"] = serd.SapEccResourceDatasetTypeProperties + } + if serd.Description != nil { + objectMap["description"] = serd.Description + } + objectMap["structure"] = serd.Structure + if serd.LinkedServiceName != nil { + objectMap["linkedServiceName"] = serd.LinkedServiceName + } + if serd.Parameters != nil { + objectMap["parameters"] = serd.Parameters + } + if serd.Annotations != nil { + objectMap["annotations"] = serd.Annotations + } + if serd.Type != "" { + objectMap["type"] = serd.Type + } + for k, v := range serd.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysObjectDataset is the BasicDataset implementation for SapEccResourceDataset. +func (serd SapEccResourceDataset) AsResponsysObjectDataset() (*ResponsysObjectDataset, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudObjectDataset is the BasicDataset implementation for SapEccResourceDataset. +func (serd SapEccResourceDataset) AsSalesforceMarketingCloudObjectDataset() (*SalesforceMarketingCloudObjectDataset, bool) { + return nil, false +} + +// AsVerticaTableDataset is the BasicDataset implementation for SapEccResourceDataset. +func (serd SapEccResourceDataset) AsVerticaTableDataset() (*VerticaTableDataset, bool) { + return nil, false +} + +// AsNetezzaTableDataset is the BasicDataset implementation for SapEccResourceDataset. +func (serd SapEccResourceDataset) AsNetezzaTableDataset() (*NetezzaTableDataset, bool) { + return nil, false +} + +// AsZohoObjectDataset is the BasicDataset implementation for SapEccResourceDataset. +func (serd SapEccResourceDataset) AsZohoObjectDataset() (*ZohoObjectDataset, bool) { + return nil, false +} + +// AsXeroObjectDataset is the BasicDataset implementation for SapEccResourceDataset. +func (serd SapEccResourceDataset) AsXeroObjectDataset() (*XeroObjectDataset, bool) { + return nil, false +} + +// AsSquareObjectDataset is the BasicDataset implementation for SapEccResourceDataset. +func (serd SapEccResourceDataset) AsSquareObjectDataset() (*SquareObjectDataset, bool) { + return nil, false +} + +// AsSparkObjectDataset is the BasicDataset implementation for SapEccResourceDataset. +func (serd SapEccResourceDataset) AsSparkObjectDataset() (*SparkObjectDataset, bool) { + return nil, false +} + +// AsShopifyObjectDataset is the BasicDataset implementation for SapEccResourceDataset. +func (serd SapEccResourceDataset) AsShopifyObjectDataset() (*ShopifyObjectDataset, bool) { + return nil, false +} + +// AsServiceNowObjectDataset is the BasicDataset implementation for SapEccResourceDataset. +func (serd SapEccResourceDataset) AsServiceNowObjectDataset() (*ServiceNowObjectDataset, bool) { + return nil, false +} + +// AsQuickBooksObjectDataset is the BasicDataset implementation for SapEccResourceDataset. +func (serd SapEccResourceDataset) AsQuickBooksObjectDataset() (*QuickBooksObjectDataset, bool) { + return nil, false +} + +// AsPrestoObjectDataset is the BasicDataset implementation for SapEccResourceDataset. +func (serd SapEccResourceDataset) AsPrestoObjectDataset() (*PrestoObjectDataset, bool) { + return nil, false +} + +// AsPhoenixObjectDataset is the BasicDataset implementation for SapEccResourceDataset. +func (serd SapEccResourceDataset) AsPhoenixObjectDataset() (*PhoenixObjectDataset, bool) { + return nil, false +} + +// AsPaypalObjectDataset is the BasicDataset implementation for SapEccResourceDataset. +func (serd SapEccResourceDataset) AsPaypalObjectDataset() (*PaypalObjectDataset, bool) { + return nil, false +} + +// AsMarketoObjectDataset is the BasicDataset implementation for SapEccResourceDataset. +func (serd SapEccResourceDataset) AsMarketoObjectDataset() (*MarketoObjectDataset, bool) { + return nil, false +} + +// AsMariaDBTableDataset is the BasicDataset implementation for SapEccResourceDataset. +func (serd SapEccResourceDataset) AsMariaDBTableDataset() (*MariaDBTableDataset, bool) { + return nil, false +} + +// AsMagentoObjectDataset is the BasicDataset implementation for SapEccResourceDataset. +func (serd SapEccResourceDataset) AsMagentoObjectDataset() (*MagentoObjectDataset, bool) { + return nil, false +} + +// AsJiraObjectDataset is the BasicDataset implementation for SapEccResourceDataset. +func (serd SapEccResourceDataset) AsJiraObjectDataset() (*JiraObjectDataset, bool) { + return nil, false +} + +// AsImpalaObjectDataset is the BasicDataset implementation for SapEccResourceDataset. +func (serd SapEccResourceDataset) AsImpalaObjectDataset() (*ImpalaObjectDataset, bool) { + return nil, false +} + +// AsHubspotObjectDataset is the BasicDataset implementation for SapEccResourceDataset. +func (serd SapEccResourceDataset) AsHubspotObjectDataset() (*HubspotObjectDataset, bool) { + return nil, false +} + +// AsHiveObjectDataset is the BasicDataset implementation for SapEccResourceDataset. +func (serd SapEccResourceDataset) AsHiveObjectDataset() (*HiveObjectDataset, bool) { + return nil, false +} + +// AsHBaseObjectDataset is the BasicDataset implementation for SapEccResourceDataset. +func (serd SapEccResourceDataset) AsHBaseObjectDataset() (*HBaseObjectDataset, bool) { + return nil, false +} + +// AsGreenplumTableDataset is the BasicDataset implementation for SapEccResourceDataset. +func (serd SapEccResourceDataset) AsGreenplumTableDataset() (*GreenplumTableDataset, bool) { + return nil, false +} + +// AsGoogleBigQueryObjectDataset is the BasicDataset implementation for SapEccResourceDataset. +func (serd SapEccResourceDataset) AsGoogleBigQueryObjectDataset() (*GoogleBigQueryObjectDataset, bool) { + return nil, false +} + +// AsEloquaObjectDataset is the BasicDataset implementation for SapEccResourceDataset. +func (serd SapEccResourceDataset) AsEloquaObjectDataset() (*EloquaObjectDataset, bool) { + return nil, false +} + +// AsDrillTableDataset is the BasicDataset implementation for SapEccResourceDataset. +func (serd SapEccResourceDataset) AsDrillTableDataset() (*DrillTableDataset, bool) { + return nil, false +} + +// AsCouchbaseTableDataset is the BasicDataset implementation for SapEccResourceDataset. +func (serd SapEccResourceDataset) AsCouchbaseTableDataset() (*CouchbaseTableDataset, bool) { + return nil, false +} + +// AsConcurObjectDataset is the BasicDataset implementation for SapEccResourceDataset. +func (serd SapEccResourceDataset) AsConcurObjectDataset() (*ConcurObjectDataset, bool) { + return nil, false +} + +// AsAzurePostgreSQLTableDataset is the BasicDataset implementation for SapEccResourceDataset. +func (serd SapEccResourceDataset) AsAzurePostgreSQLTableDataset() (*AzurePostgreSQLTableDataset, bool) { + return nil, false +} + +// AsAmazonMWSObjectDataset is the BasicDataset implementation for SapEccResourceDataset. +func (serd SapEccResourceDataset) AsAmazonMWSObjectDataset() (*AmazonMWSObjectDataset, bool) { + return nil, false +} + +// AsHTTPDataset is the BasicDataset implementation for SapEccResourceDataset. +func (serd SapEccResourceDataset) AsHTTPDataset() (*HTTPDataset, bool) { + return nil, false +} + +// AsAzureSearchIndexDataset is the BasicDataset implementation for SapEccResourceDataset. +func (serd SapEccResourceDataset) AsAzureSearchIndexDataset() (*AzureSearchIndexDataset, bool) { + return nil, false +} + +// AsWebTableDataset is the BasicDataset implementation for SapEccResourceDataset. +func (serd SapEccResourceDataset) AsWebTableDataset() (*WebTableDataset, bool) { + return nil, false +} + +// AsSQLServerTableDataset is the BasicDataset implementation for SapEccResourceDataset. +func (serd SapEccResourceDataset) AsSQLServerTableDataset() (*SQLServerTableDataset, bool) { + return nil, false +} + +// AsSapEccResourceDataset is the BasicDataset implementation for SapEccResourceDataset. +func (serd SapEccResourceDataset) AsSapEccResourceDataset() (*SapEccResourceDataset, bool) { + return &serd, true +} + +// AsSapCloudForCustomerResourceDataset is the BasicDataset implementation for SapEccResourceDataset. +func (serd SapEccResourceDataset) AsSapCloudForCustomerResourceDataset() (*SapCloudForCustomerResourceDataset, bool) { + return nil, false +} + +// AsSalesforceObjectDataset is the BasicDataset implementation for SapEccResourceDataset. +func (serd SapEccResourceDataset) AsSalesforceObjectDataset() (*SalesforceObjectDataset, bool) { + return nil, false +} + +// AsRelationalTableDataset is the BasicDataset implementation for SapEccResourceDataset. +func (serd SapEccResourceDataset) AsRelationalTableDataset() (*RelationalTableDataset, bool) { + return nil, false +} + +// AsAzureMySQLTableDataset is the BasicDataset implementation for SapEccResourceDataset. +func (serd SapEccResourceDataset) AsAzureMySQLTableDataset() (*AzureMySQLTableDataset, bool) { + return nil, false +} + +// AsOracleTableDataset is the BasicDataset implementation for SapEccResourceDataset. +func (serd SapEccResourceDataset) AsOracleTableDataset() (*OracleTableDataset, bool) { + return nil, false +} + +// AsODataResourceDataset is the BasicDataset implementation for SapEccResourceDataset. +func (serd SapEccResourceDataset) AsODataResourceDataset() (*ODataResourceDataset, bool) { + return nil, false +} + +// AsMongoDbCollectionDataset is the BasicDataset implementation for SapEccResourceDataset. +func (serd SapEccResourceDataset) AsMongoDbCollectionDataset() (*MongoDbCollectionDataset, bool) { + return nil, false +} + +// AsFileShareDataset is the BasicDataset implementation for SapEccResourceDataset. +func (serd SapEccResourceDataset) AsFileShareDataset() (*FileShareDataset, bool) { + return nil, false +} + +// AsAzureDataLakeStoreDataset is the BasicDataset implementation for SapEccResourceDataset. +func (serd SapEccResourceDataset) AsAzureDataLakeStoreDataset() (*AzureDataLakeStoreDataset, bool) { + return nil, false +} + +// AsDynamicsEntityDataset is the BasicDataset implementation for SapEccResourceDataset. +func (serd SapEccResourceDataset) AsDynamicsEntityDataset() (*DynamicsEntityDataset, bool) { + return nil, false +} + +// AsDocumentDbCollectionDataset is the BasicDataset implementation for SapEccResourceDataset. +func (serd SapEccResourceDataset) AsDocumentDbCollectionDataset() (*DocumentDbCollectionDataset, bool) { + return nil, false +} + +// AsCustomDataset is the BasicDataset implementation for SapEccResourceDataset. +func (serd SapEccResourceDataset) AsCustomDataset() (*CustomDataset, bool) { + return nil, false +} + +// AsCassandraTableDataset is the BasicDataset implementation for SapEccResourceDataset. +func (serd SapEccResourceDataset) AsCassandraTableDataset() (*CassandraTableDataset, bool) { + return nil, false +} + +// AsAzureSQLDWTableDataset is the BasicDataset implementation for SapEccResourceDataset. +func (serd SapEccResourceDataset) AsAzureSQLDWTableDataset() (*AzureSQLDWTableDataset, bool) { + return nil, false +} + +// AsAzureSQLTableDataset is the BasicDataset implementation for SapEccResourceDataset. +func (serd SapEccResourceDataset) AsAzureSQLTableDataset() (*AzureSQLTableDataset, bool) { + return nil, false +} + +// AsAzureTableDataset is the BasicDataset implementation for SapEccResourceDataset. +func (serd SapEccResourceDataset) AsAzureTableDataset() (*AzureTableDataset, bool) { + return nil, false +} + +// AsAzureBlobDataset is the BasicDataset implementation for SapEccResourceDataset. +func (serd SapEccResourceDataset) AsAzureBlobDataset() (*AzureBlobDataset, bool) { + return nil, false +} + +// AsAmazonS3Dataset is the BasicDataset implementation for SapEccResourceDataset. +func (serd SapEccResourceDataset) AsAmazonS3Dataset() (*AmazonS3Dataset, bool) { + return nil, false +} + +// AsDataset is the BasicDataset implementation for SapEccResourceDataset. +func (serd SapEccResourceDataset) AsDataset() (*Dataset, bool) { + return nil, false +} + +// AsBasicDataset is the BasicDataset implementation for SapEccResourceDataset. +func (serd SapEccResourceDataset) AsBasicDataset() (BasicDataset, bool) { + return &serd, true +} + +// UnmarshalJSON is the custom unmarshaler for SapEccResourceDataset struct. +func (serd *SapEccResourceDataset) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "typeProperties": + if v != nil { + var sapEccResourceDatasetTypeProperties SapEccResourceDatasetTypeProperties + err = json.Unmarshal(*v, &sapEccResourceDatasetTypeProperties) + if err != nil { + return err + } + serd.SapEccResourceDatasetTypeProperties = &sapEccResourceDatasetTypeProperties + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if serd.AdditionalProperties == nil { + serd.AdditionalProperties = make(map[string]interface{}) + } + serd.AdditionalProperties[k] = additionalProperties + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + serd.Description = &description + } + case "structure": + if v != nil { + var structure interface{} + err = json.Unmarshal(*v, &structure) + if err != nil { + return err + } + serd.Structure = structure + } + case "linkedServiceName": + if v != nil { + var linkedServiceName LinkedServiceReference + err = json.Unmarshal(*v, &linkedServiceName) + if err != nil { + return err + } + serd.LinkedServiceName = &linkedServiceName + } + case "parameters": + if v != nil { + var parameters map[string]*ParameterSpecification + err = json.Unmarshal(*v, ¶meters) + if err != nil { + return err + } + serd.Parameters = parameters + } + case "annotations": + if v != nil { + var annotations []interface{} + err = json.Unmarshal(*v, &annotations) + if err != nil { + return err + } + serd.Annotations = &annotations + } + case "type": + if v != nil { + var typeVar TypeBasicDataset + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + serd.Type = typeVar + } + } + } + + return nil +} + +// SapEccResourceDatasetTypeProperties sap ECC OData resource dataset properties. +type SapEccResourceDatasetTypeProperties struct { + // Path - The path of the SAP ECC OData entity. Type: string (or Expression with resultType string). + Path *string `json:"path,omitempty"` +} + +// SapEccSource a copy activity source for SAP ECC source. +type SapEccSource struct { + // Query - SAP ECC OData query. For example, "$top=1". Type: string (or Expression with resultType string). + Query *string `json:"query,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // SourceRetryCount - Source retry count. Type: integer (or Expression with resultType integer). + SourceRetryCount interface{} `json:"sourceRetryCount,omitempty"` + // SourceRetryWait - Source retry wait. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` + // Type - Possible values include: 'TypeCopySource', 'TypeAmazonRedshiftSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeHTTPSource', 'TypeAzureDataLakeStoreSource', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeRelationalSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource' + Type TypeBasicCopySource `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for SapEccSource. +func (ses SapEccSource) MarshalJSON() ([]byte, error) { + ses.Type = TypeSapEccSource + objectMap := make(map[string]interface{}) + if ses.Query != nil { + objectMap["query"] = ses.Query + } + objectMap["sourceRetryCount"] = ses.SourceRetryCount + objectMap["sourceRetryWait"] = ses.SourceRetryWait + if ses.Type != "" { + objectMap["type"] = ses.Type + } + for k, v := range ses.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsAmazonRedshiftSource is the BasicCopySource implementation for SapEccSource. +func (ses SapEccSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { + return nil, false +} + +// AsResponsysSource is the BasicCopySource implementation for SapEccSource. +func (ses SapEccSource) AsResponsysSource() (*ResponsysSource, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudSource is the BasicCopySource implementation for SapEccSource. +func (ses SapEccSource) AsSalesforceMarketingCloudSource() (*SalesforceMarketingCloudSource, bool) { + return nil, false +} + +// AsVerticaSource is the BasicCopySource implementation for SapEccSource. +func (ses SapEccSource) AsVerticaSource() (*VerticaSource, bool) { + return nil, false +} + +// AsNetezzaSource is the BasicCopySource implementation for SapEccSource. +func (ses SapEccSource) AsNetezzaSource() (*NetezzaSource, bool) { + return nil, false +} + +// AsZohoSource is the BasicCopySource implementation for SapEccSource. +func (ses SapEccSource) AsZohoSource() (*ZohoSource, bool) { + return nil, false +} + +// AsXeroSource is the BasicCopySource implementation for SapEccSource. +func (ses SapEccSource) AsXeroSource() (*XeroSource, bool) { + return nil, false +} + +// AsSquareSource is the BasicCopySource implementation for SapEccSource. +func (ses SapEccSource) AsSquareSource() (*SquareSource, bool) { + return nil, false +} + +// AsSparkSource is the BasicCopySource implementation for SapEccSource. +func (ses SapEccSource) AsSparkSource() (*SparkSource, bool) { + return nil, false +} + +// AsShopifySource is the BasicCopySource implementation for SapEccSource. +func (ses SapEccSource) AsShopifySource() (*ShopifySource, bool) { + return nil, false +} + +// AsServiceNowSource is the BasicCopySource implementation for SapEccSource. +func (ses SapEccSource) AsServiceNowSource() (*ServiceNowSource, bool) { + return nil, false +} + +// AsQuickBooksSource is the BasicCopySource implementation for SapEccSource. +func (ses SapEccSource) AsQuickBooksSource() (*QuickBooksSource, bool) { + return nil, false +} + +// AsPrestoSource is the BasicCopySource implementation for SapEccSource. +func (ses SapEccSource) AsPrestoSource() (*PrestoSource, bool) { + return nil, false +} + +// AsPhoenixSource is the BasicCopySource implementation for SapEccSource. +func (ses SapEccSource) AsPhoenixSource() (*PhoenixSource, bool) { + return nil, false +} + +// AsPaypalSource is the BasicCopySource implementation for SapEccSource. +func (ses SapEccSource) AsPaypalSource() (*PaypalSource, bool) { + return nil, false +} + +// AsMarketoSource is the BasicCopySource implementation for SapEccSource. +func (ses SapEccSource) AsMarketoSource() (*MarketoSource, bool) { + return nil, false +} + +// AsMariaDBSource is the BasicCopySource implementation for SapEccSource. +func (ses SapEccSource) AsMariaDBSource() (*MariaDBSource, bool) { + return nil, false +} + +// AsMagentoSource is the BasicCopySource implementation for SapEccSource. +func (ses SapEccSource) AsMagentoSource() (*MagentoSource, bool) { + return nil, false +} + +// AsJiraSource is the BasicCopySource implementation for SapEccSource. +func (ses SapEccSource) AsJiraSource() (*JiraSource, bool) { + return nil, false +} + +// AsImpalaSource is the BasicCopySource implementation for SapEccSource. +func (ses SapEccSource) AsImpalaSource() (*ImpalaSource, bool) { + return nil, false +} + +// AsHubspotSource is the BasicCopySource implementation for SapEccSource. +func (ses SapEccSource) AsHubspotSource() (*HubspotSource, bool) { + return nil, false +} + +// AsHiveSource is the BasicCopySource implementation for SapEccSource. +func (ses SapEccSource) AsHiveSource() (*HiveSource, bool) { + return nil, false +} + +// AsHBaseSource is the BasicCopySource implementation for SapEccSource. +func (ses SapEccSource) AsHBaseSource() (*HBaseSource, bool) { + return nil, false +} + +// AsGreenplumSource is the BasicCopySource implementation for SapEccSource. +func (ses SapEccSource) AsGreenplumSource() (*GreenplumSource, bool) { + return nil, false +} + +// AsGoogleBigQuerySource is the BasicCopySource implementation for SapEccSource. +func (ses SapEccSource) AsGoogleBigQuerySource() (*GoogleBigQuerySource, bool) { + return nil, false +} + +// AsEloquaSource is the BasicCopySource implementation for SapEccSource. +func (ses SapEccSource) AsEloquaSource() (*EloquaSource, bool) { + return nil, false +} + +// AsDrillSource is the BasicCopySource implementation for SapEccSource. +func (ses SapEccSource) AsDrillSource() (*DrillSource, bool) { + return nil, false +} + +// AsCouchbaseSource is the BasicCopySource implementation for SapEccSource. +func (ses SapEccSource) AsCouchbaseSource() (*CouchbaseSource, bool) { + return nil, false +} + +// AsConcurSource is the BasicCopySource implementation for SapEccSource. +func (ses SapEccSource) AsConcurSource() (*ConcurSource, bool) { + return nil, false +} + +// AsAzurePostgreSQLSource is the BasicCopySource implementation for SapEccSource. +func (ses SapEccSource) AsAzurePostgreSQLSource() (*AzurePostgreSQLSource, bool) { + return nil, false +} + +// AsAmazonMWSSource is the BasicCopySource implementation for SapEccSource. +func (ses SapEccSource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { + return nil, false +} + +// AsHTTPSource is the BasicCopySource implementation for SapEccSource. +func (ses SapEccSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for SapEccSource. +func (ses SapEccSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for SapEccSource. +func (ses SapEccSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsCassandraSource is the BasicCopySource implementation for SapEccSource. +func (ses SapEccSource) AsCassandraSource() (*CassandraSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for SapEccSource. +func (ses SapEccSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for SapEccSource. +func (ses SapEccSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureMySQLSource is the BasicCopySource implementation for SapEccSource. +func (ses SapEccSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for SapEccSource. +func (ses SapEccSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for SapEccSource. +func (ses SapEccSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsSQLDWSource is the BasicCopySource implementation for SapEccSource. +func (ses SapEccSource) AsSQLDWSource() (*SQLDWSource, bool) { + return nil, false +} + +// AsSQLSource is the BasicCopySource implementation for SapEccSource. +func (ses SapEccSource) AsSQLSource() (*SQLSource, bool) { + return nil, false +} + +// AsSapEccSource is the BasicCopySource implementation for SapEccSource. +func (ses SapEccSource) AsSapEccSource() (*SapEccSource, bool) { + return &ses, true +} + +// AsSapCloudForCustomerSource is the BasicCopySource implementation for SapEccSource. +func (ses SapEccSource) AsSapCloudForCustomerSource() (*SapCloudForCustomerSource, bool) { + return nil, false +} + +// AsSalesforceSource is the BasicCopySource implementation for SapEccSource. +func (ses SapEccSource) AsSalesforceSource() (*SalesforceSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for SapEccSource. +func (ses SapEccSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for SapEccSource. +func (ses SapEccSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for SapEccSource. +func (ses SapEccSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for SapEccSource. +func (ses SapEccSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + +// AsAzureTableSource is the BasicCopySource implementation for SapEccSource. +func (ses SapEccSource) AsAzureTableSource() (*AzureTableSource, bool) { + return nil, false +} + +// AsCopySource is the BasicCopySource implementation for SapEccSource. +func (ses SapEccSource) AsCopySource() (*CopySource, bool) { + return nil, false +} + +// AsBasicCopySource is the BasicCopySource implementation for SapEccSource. +func (ses SapEccSource) AsBasicCopySource() (BasicCopySource, bool) { + return &ses, true +} + +// SapHanaLinkedService SAP HANA Linked Service. +type SapHanaLinkedService struct { + // SapHanaLinkedServiceProperties - Properties specific to this linked service type. + *SapHanaLinkedServiceProperties `json:"typeProperties,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // ConnectVia - The integration runtime reference. + ConnectVia *IntegrationRuntimeReference `json:"connectVia,omitempty"` + // Description - Linked service description. + Description *string `json:"description,omitempty"` + // Parameters - Parameters for linked service. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeLinkedService', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforce', 'TypeAzureDataLakeStore', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureStorage' + Type TypeBasicLinkedService `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for SapHanaLinkedService. +func (shls SapHanaLinkedService) MarshalJSON() ([]byte, error) { + shls.Type = TypeSapHana + objectMap := make(map[string]interface{}) + if shls.SapHanaLinkedServiceProperties != nil { + objectMap["typeProperties"] = shls.SapHanaLinkedServiceProperties + } + if shls.ConnectVia != nil { + objectMap["connectVia"] = shls.ConnectVia + } + if shls.Description != nil { + objectMap["description"] = shls.Description + } + if shls.Parameters != nil { + objectMap["parameters"] = shls.Parameters + } + if shls.Annotations != nil { + objectMap["annotations"] = shls.Annotations + } + if shls.Type != "" { + objectMap["type"] = shls.Type + } + for k, v := range shls.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysLinkedService is the BasicLinkedService implementation for SapHanaLinkedService. +func (shls SapHanaLinkedService) AsResponsysLinkedService() (*ResponsysLinkedService, bool) { + return nil, false +} + +// AsAzureDatabricksLinkedService is the BasicLinkedService implementation for SapHanaLinkedService. +func (shls SapHanaLinkedService) AsAzureDatabricksLinkedService() (*AzureDatabricksLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeAnalyticsLinkedService is the BasicLinkedService implementation for SapHanaLinkedService. +func (shls SapHanaLinkedService) AsAzureDataLakeAnalyticsLinkedService() (*AzureDataLakeAnalyticsLinkedService, bool) { + return nil, false +} + +// AsHDInsightOnDemandLinkedService is the BasicLinkedService implementation for SapHanaLinkedService. +func (shls SapHanaLinkedService) AsHDInsightOnDemandLinkedService() (*HDInsightOnDemandLinkedService, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudLinkedService is the BasicLinkedService implementation for SapHanaLinkedService. +func (shls SapHanaLinkedService) AsSalesforceMarketingCloudLinkedService() (*SalesforceMarketingCloudLinkedService, bool) { + return nil, false +} + +// AsNetezzaLinkedService is the BasicLinkedService implementation for SapHanaLinkedService. +func (shls SapHanaLinkedService) AsNetezzaLinkedService() (*NetezzaLinkedService, bool) { + return nil, false +} + +// AsVerticaLinkedService is the BasicLinkedService implementation for SapHanaLinkedService. +func (shls SapHanaLinkedService) AsVerticaLinkedService() (*VerticaLinkedService, bool) { + return nil, false +} + +// AsZohoLinkedService is the BasicLinkedService implementation for SapHanaLinkedService. +func (shls SapHanaLinkedService) AsZohoLinkedService() (*ZohoLinkedService, bool) { + return nil, false +} + +// AsXeroLinkedService is the BasicLinkedService implementation for SapHanaLinkedService. +func (shls SapHanaLinkedService) AsXeroLinkedService() (*XeroLinkedService, bool) { + return nil, false +} + +// AsSquareLinkedService is the BasicLinkedService implementation for SapHanaLinkedService. +func (shls SapHanaLinkedService) AsSquareLinkedService() (*SquareLinkedService, bool) { + return nil, false +} + +// AsSparkLinkedService is the BasicLinkedService implementation for SapHanaLinkedService. +func (shls SapHanaLinkedService) AsSparkLinkedService() (*SparkLinkedService, bool) { + return nil, false +} + +// AsShopifyLinkedService is the BasicLinkedService implementation for SapHanaLinkedService. +func (shls SapHanaLinkedService) AsShopifyLinkedService() (*ShopifyLinkedService, bool) { + return nil, false +} + +// AsServiceNowLinkedService is the BasicLinkedService implementation for SapHanaLinkedService. +func (shls SapHanaLinkedService) AsServiceNowLinkedService() (*ServiceNowLinkedService, bool) { + return nil, false +} + +// AsQuickBooksLinkedService is the BasicLinkedService implementation for SapHanaLinkedService. +func (shls SapHanaLinkedService) AsQuickBooksLinkedService() (*QuickBooksLinkedService, bool) { + return nil, false +} + +// AsPrestoLinkedService is the BasicLinkedService implementation for SapHanaLinkedService. +func (shls SapHanaLinkedService) AsPrestoLinkedService() (*PrestoLinkedService, bool) { + return nil, false +} + +// AsPhoenixLinkedService is the BasicLinkedService implementation for SapHanaLinkedService. +func (shls SapHanaLinkedService) AsPhoenixLinkedService() (*PhoenixLinkedService, bool) { + return nil, false +} + +// AsPaypalLinkedService is the BasicLinkedService implementation for SapHanaLinkedService. +func (shls SapHanaLinkedService) AsPaypalLinkedService() (*PaypalLinkedService, bool) { + return nil, false +} + +// AsMarketoLinkedService is the BasicLinkedService implementation for SapHanaLinkedService. +func (shls SapHanaLinkedService) AsMarketoLinkedService() (*MarketoLinkedService, bool) { + return nil, false +} + +// AsMariaDBLinkedService is the BasicLinkedService implementation for SapHanaLinkedService. +func (shls SapHanaLinkedService) AsMariaDBLinkedService() (*MariaDBLinkedService, bool) { + return nil, false +} + +// AsMagentoLinkedService is the BasicLinkedService implementation for SapHanaLinkedService. +func (shls SapHanaLinkedService) AsMagentoLinkedService() (*MagentoLinkedService, bool) { + return nil, false +} + +// AsJiraLinkedService is the BasicLinkedService implementation for SapHanaLinkedService. +func (shls SapHanaLinkedService) AsJiraLinkedService() (*JiraLinkedService, bool) { + return nil, false +} + +// AsImpalaLinkedService is the BasicLinkedService implementation for SapHanaLinkedService. +func (shls SapHanaLinkedService) AsImpalaLinkedService() (*ImpalaLinkedService, bool) { + return nil, false +} + +// AsHubspotLinkedService is the BasicLinkedService implementation for SapHanaLinkedService. +func (shls SapHanaLinkedService) AsHubspotLinkedService() (*HubspotLinkedService, bool) { + return nil, false +} + +// AsHiveLinkedService is the BasicLinkedService implementation for SapHanaLinkedService. +func (shls SapHanaLinkedService) AsHiveLinkedService() (*HiveLinkedService, bool) { + return nil, false +} + +// AsHBaseLinkedService is the BasicLinkedService implementation for SapHanaLinkedService. +func (shls SapHanaLinkedService) AsHBaseLinkedService() (*HBaseLinkedService, bool) { + return nil, false +} + +// AsGreenplumLinkedService is the BasicLinkedService implementation for SapHanaLinkedService. +func (shls SapHanaLinkedService) AsGreenplumLinkedService() (*GreenplumLinkedService, bool) { + return nil, false +} + +// AsGoogleBigQueryLinkedService is the BasicLinkedService implementation for SapHanaLinkedService. +func (shls SapHanaLinkedService) AsGoogleBigQueryLinkedService() (*GoogleBigQueryLinkedService, bool) { + return nil, false +} + +// AsEloquaLinkedService is the BasicLinkedService implementation for SapHanaLinkedService. +func (shls SapHanaLinkedService) AsEloquaLinkedService() (*EloquaLinkedService, bool) { + return nil, false +} + +// AsDrillLinkedService is the BasicLinkedService implementation for SapHanaLinkedService. +func (shls SapHanaLinkedService) AsDrillLinkedService() (*DrillLinkedService, bool) { + return nil, false +} + +// AsCouchbaseLinkedService is the BasicLinkedService implementation for SapHanaLinkedService. +func (shls SapHanaLinkedService) AsCouchbaseLinkedService() (*CouchbaseLinkedService, bool) { + return nil, false +} + +// AsConcurLinkedService is the BasicLinkedService implementation for SapHanaLinkedService. +func (shls SapHanaLinkedService) AsConcurLinkedService() (*ConcurLinkedService, bool) { + return nil, false +} + +// AsAzurePostgreSQLLinkedService is the BasicLinkedService implementation for SapHanaLinkedService. +func (shls SapHanaLinkedService) AsAzurePostgreSQLLinkedService() (*AzurePostgreSQLLinkedService, bool) { + return nil, false +} + +// AsAmazonMWSLinkedService is the BasicLinkedService implementation for SapHanaLinkedService. +func (shls SapHanaLinkedService) AsAmazonMWSLinkedService() (*AmazonMWSLinkedService, bool) { + return nil, false +} + +// AsSapHanaLinkedService is the BasicLinkedService implementation for SapHanaLinkedService. +func (shls SapHanaLinkedService) AsSapHanaLinkedService() (*SapHanaLinkedService, bool) { + return &shls, true +} + +// AsSapBWLinkedService is the BasicLinkedService implementation for SapHanaLinkedService. +func (shls SapHanaLinkedService) AsSapBWLinkedService() (*SapBWLinkedService, bool) { + return nil, false +} + +// AsSftpServerLinkedService is the BasicLinkedService implementation for SapHanaLinkedService. +func (shls SapHanaLinkedService) AsSftpServerLinkedService() (*SftpServerLinkedService, bool) { + return nil, false +} + +// AsFtpServerLinkedService is the BasicLinkedService implementation for SapHanaLinkedService. +func (shls SapHanaLinkedService) AsFtpServerLinkedService() (*FtpServerLinkedService, bool) { + return nil, false +} + +// AsHTTPLinkedService is the BasicLinkedService implementation for SapHanaLinkedService. +func (shls SapHanaLinkedService) AsHTTPLinkedService() (*HTTPLinkedService, bool) { + return nil, false +} + +// AsAzureSearchLinkedService is the BasicLinkedService implementation for SapHanaLinkedService. +func (shls SapHanaLinkedService) AsAzureSearchLinkedService() (*AzureSearchLinkedService, bool) { + return nil, false +} + +// AsCustomDataSourceLinkedService is the BasicLinkedService implementation for SapHanaLinkedService. +func (shls SapHanaLinkedService) AsCustomDataSourceLinkedService() (*CustomDataSourceLinkedService, bool) { + return nil, false +} + +// AsAmazonRedshiftLinkedService is the BasicLinkedService implementation for SapHanaLinkedService. +func (shls SapHanaLinkedService) AsAmazonRedshiftLinkedService() (*AmazonRedshiftLinkedService, bool) { + return nil, false +} + +// AsAmazonS3LinkedService is the BasicLinkedService implementation for SapHanaLinkedService. +func (shls SapHanaLinkedService) AsAmazonS3LinkedService() (*AmazonS3LinkedService, bool) { + return nil, false +} + +// AsSapEccLinkedService is the BasicLinkedService implementation for SapHanaLinkedService. +func (shls SapHanaLinkedService) AsSapEccLinkedService() (*SapEccLinkedService, bool) { + return nil, false +} + +// AsSapCloudForCustomerLinkedService is the BasicLinkedService implementation for SapHanaLinkedService. +func (shls SapHanaLinkedService) AsSapCloudForCustomerLinkedService() (*SapCloudForCustomerLinkedService, bool) { + return nil, false +} + +// AsSalesforceLinkedService is the BasicLinkedService implementation for SapHanaLinkedService. +func (shls SapHanaLinkedService) AsSalesforceLinkedService() (*SalesforceLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeStoreLinkedService is the BasicLinkedService implementation for SapHanaLinkedService. +func (shls SapHanaLinkedService) AsAzureDataLakeStoreLinkedService() (*AzureDataLakeStoreLinkedService, bool) { + return nil, false +} + +// AsMongoDbLinkedService is the BasicLinkedService implementation for SapHanaLinkedService. +func (shls SapHanaLinkedService) AsMongoDbLinkedService() (*MongoDbLinkedService, bool) { + return nil, false +} + +// AsCassandraLinkedService is the BasicLinkedService implementation for SapHanaLinkedService. +func (shls SapHanaLinkedService) AsCassandraLinkedService() (*CassandraLinkedService, bool) { + return nil, false +} + +// AsWebLinkedService is the BasicLinkedService implementation for SapHanaLinkedService. +func (shls SapHanaLinkedService) AsWebLinkedService() (*WebLinkedService, bool) { + return nil, false +} + +// AsODataLinkedService is the BasicLinkedService implementation for SapHanaLinkedService. +func (shls SapHanaLinkedService) AsODataLinkedService() (*ODataLinkedService, bool) { + return nil, false +} + +// AsHdfsLinkedService is the BasicLinkedService implementation for SapHanaLinkedService. +func (shls SapHanaLinkedService) AsHdfsLinkedService() (*HdfsLinkedService, bool) { + return nil, false +} + +// AsOdbcLinkedService is the BasicLinkedService implementation for SapHanaLinkedService. +func (shls SapHanaLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, bool) { + return nil, false +} + +// AsAzureMLLinkedService is the BasicLinkedService implementation for SapHanaLinkedService. +func (shls SapHanaLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { + return nil, false +} + +// AsTeradataLinkedService is the BasicLinkedService implementation for SapHanaLinkedService. +func (shls SapHanaLinkedService) AsTeradataLinkedService() (*TeradataLinkedService, bool) { + return nil, false +} + +// AsDb2LinkedService is the BasicLinkedService implementation for SapHanaLinkedService. +func (shls SapHanaLinkedService) AsDb2LinkedService() (*Db2LinkedService, bool) { + return nil, false +} + +// AsSybaseLinkedService is the BasicLinkedService implementation for SapHanaLinkedService. +func (shls SapHanaLinkedService) AsSybaseLinkedService() (*SybaseLinkedService, bool) { + return nil, false +} + +// AsPostgreSQLLinkedService is the BasicLinkedService implementation for SapHanaLinkedService. +func (shls SapHanaLinkedService) AsPostgreSQLLinkedService() (*PostgreSQLLinkedService, bool) { + return nil, false +} + +// AsMySQLLinkedService is the BasicLinkedService implementation for SapHanaLinkedService. +func (shls SapHanaLinkedService) AsMySQLLinkedService() (*MySQLLinkedService, bool) { + return nil, false +} + +// AsAzureMySQLLinkedService is the BasicLinkedService implementation for SapHanaLinkedService. +func (shls SapHanaLinkedService) AsAzureMySQLLinkedService() (*AzureMySQLLinkedService, bool) { + return nil, false +} + +// AsOracleLinkedService is the BasicLinkedService implementation for SapHanaLinkedService. +func (shls SapHanaLinkedService) AsOracleLinkedService() (*OracleLinkedService, bool) { + return nil, false +} + +// AsFileServerLinkedService is the BasicLinkedService implementation for SapHanaLinkedService. +func (shls SapHanaLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { + return nil, false +} + +// AsHDInsightLinkedService is the BasicLinkedService implementation for SapHanaLinkedService. +func (shls SapHanaLinkedService) AsHDInsightLinkedService() (*HDInsightLinkedService, bool) { + return nil, false +} + +// AsDynamicsLinkedService is the BasicLinkedService implementation for SapHanaLinkedService. +func (shls SapHanaLinkedService) AsDynamicsLinkedService() (*DynamicsLinkedService, bool) { + return nil, false +} + +// AsCosmosDbLinkedService is the BasicLinkedService implementation for SapHanaLinkedService. +func (shls SapHanaLinkedService) AsCosmosDbLinkedService() (*CosmosDbLinkedService, bool) { + return nil, false +} + +// AsAzureKeyVaultLinkedService is the BasicLinkedService implementation for SapHanaLinkedService. +func (shls SapHanaLinkedService) AsAzureKeyVaultLinkedService() (*AzureKeyVaultLinkedService, bool) { + return nil, false +} + +// AsAzureBatchLinkedService is the BasicLinkedService implementation for SapHanaLinkedService. +func (shls SapHanaLinkedService) AsAzureBatchLinkedService() (*AzureBatchLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDatabaseLinkedService is the BasicLinkedService implementation for SapHanaLinkedService. +func (shls SapHanaLinkedService) AsAzureSQLDatabaseLinkedService() (*AzureSQLDatabaseLinkedService, bool) { + return nil, false +} + +// AsSQLServerLinkedService is the BasicLinkedService implementation for SapHanaLinkedService. +func (shls SapHanaLinkedService) AsSQLServerLinkedService() (*SQLServerLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDWLinkedService is the BasicLinkedService implementation for SapHanaLinkedService. +func (shls SapHanaLinkedService) AsAzureSQLDWLinkedService() (*AzureSQLDWLinkedService, bool) { + return nil, false +} + +// AsAzureStorageLinkedService is the BasicLinkedService implementation for SapHanaLinkedService. +func (shls SapHanaLinkedService) AsAzureStorageLinkedService() (*AzureStorageLinkedService, bool) { + return nil, false +} + +// AsLinkedService is the BasicLinkedService implementation for SapHanaLinkedService. +func (shls SapHanaLinkedService) AsLinkedService() (*LinkedService, bool) { + return nil, false +} + +// AsBasicLinkedService is the BasicLinkedService implementation for SapHanaLinkedService. +func (shls SapHanaLinkedService) AsBasicLinkedService() (BasicLinkedService, bool) { + return &shls, true +} + +// UnmarshalJSON is the custom unmarshaler for SapHanaLinkedService struct. +func (shls *SapHanaLinkedService) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "typeProperties": + if v != nil { + var sapHanaLinkedServiceProperties SapHanaLinkedServiceProperties + err = json.Unmarshal(*v, &sapHanaLinkedServiceProperties) + if err != nil { + return err + } + shls.SapHanaLinkedServiceProperties = &sapHanaLinkedServiceProperties + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if shls.AdditionalProperties == nil { + shls.AdditionalProperties = make(map[string]interface{}) + } + shls.AdditionalProperties[k] = additionalProperties + } + case "connectVia": + if v != nil { + var connectVia IntegrationRuntimeReference + err = json.Unmarshal(*v, &connectVia) + if err != nil { + return err + } + shls.ConnectVia = &connectVia + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + shls.Description = &description + } + case "parameters": + if v != nil { + var parameters map[string]*ParameterSpecification + err = json.Unmarshal(*v, ¶meters) + if err != nil { + return err + } + shls.Parameters = parameters + } + case "annotations": + if v != nil { + var annotations []interface{} + err = json.Unmarshal(*v, &annotations) + if err != nil { + return err + } + shls.Annotations = &annotations + } + case "type": + if v != nil { + var typeVar TypeBasicLinkedService + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + shls.Type = typeVar + } + } + } + + return nil +} + +// SapHanaLinkedServiceProperties properties specific to this linked service type. +type SapHanaLinkedServiceProperties struct { + // Server - Host name of the SAP HANA server. Type: string (or Expression with resultType string). + Server interface{} `json:"server,omitempty"` + // AuthenticationType - The authentication type to be used to connect to the SAP HANA server. Possible values include: 'SapHanaAuthenticationTypeBasic', 'SapHanaAuthenticationTypeWindows' + AuthenticationType SapHanaAuthenticationType `json:"authenticationType,omitempty"` + // UserName - Username to access the SAP HANA server. Type: string (or Expression with resultType string). + UserName interface{} `json:"userName,omitempty"` + // Password - Password to access the SAP HANA server. + Password BasicSecretBase `json:"password,omitempty"` + // EncryptedCredential - The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string). + EncryptedCredential interface{} `json:"encryptedCredential,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for SapHanaLinkedServiceProperties struct. +func (shlsp *SapHanaLinkedServiceProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "server": + if v != nil { + var server interface{} + err = json.Unmarshal(*v, &server) + if err != nil { + return err + } + shlsp.Server = server + } + case "authenticationType": + if v != nil { + var authenticationType SapHanaAuthenticationType + err = json.Unmarshal(*v, &authenticationType) + if err != nil { + return err + } + shlsp.AuthenticationType = authenticationType + } + case "userName": + if v != nil { + var userName interface{} + err = json.Unmarshal(*v, &userName) + if err != nil { + return err + } + shlsp.UserName = userName + } + case "password": + if v != nil { + password, err := unmarshalBasicSecretBase(*v) + if err != nil { + return err + } + shlsp.Password = password + } + case "encryptedCredential": + if v != nil { + var encryptedCredential interface{} + err = json.Unmarshal(*v, &encryptedCredential) + if err != nil { + return err + } + shlsp.EncryptedCredential = encryptedCredential + } + } + } + + return nil +} + +// ScheduleTrigger trigger that creates pipeline runs periodically, on schedule. +type ScheduleTrigger struct { + // ScheduleTriggerTypeProperties - Schedule Trigger properties. + *ScheduleTriggerTypeProperties `json:"typeProperties,omitempty"` + // Pipelines - Pipelines that need to be started. + Pipelines *[]TriggerPipelineReference `json:"pipelines,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Description - Trigger description. + Description *string `json:"description,omitempty"` + // RuntimeState - Indicates if trigger is running or not. Updated when Start/Stop APIs are called on the Trigger. Possible values include: 'TriggerRuntimeStateStarted', 'TriggerRuntimeStateStopped', 'TriggerRuntimeStateDisabled' + RuntimeState TriggerRuntimeState `json:"runtimeState,omitempty"` + // Type - Possible values include: 'TypeTrigger', 'TypeTumblingWindowTrigger', 'TypeBlobEventsTrigger', 'TypeBlobTrigger', 'TypeScheduleTrigger', 'TypeMultiplePipelineTrigger' + Type TypeBasicTrigger `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ScheduleTrigger. +func (st ScheduleTrigger) MarshalJSON() ([]byte, error) { + st.Type = TypeScheduleTrigger + objectMap := make(map[string]interface{}) + if st.ScheduleTriggerTypeProperties != nil { + objectMap["typeProperties"] = st.ScheduleTriggerTypeProperties + } + if st.Pipelines != nil { + objectMap["pipelines"] = st.Pipelines + } + if st.Description != nil { + objectMap["description"] = st.Description + } + if st.RuntimeState != "" { + objectMap["runtimeState"] = st.RuntimeState + } + if st.Type != "" { + objectMap["type"] = st.Type + } + for k, v := range st.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsTumblingWindowTrigger is the BasicTrigger implementation for ScheduleTrigger. +func (st ScheduleTrigger) AsTumblingWindowTrigger() (*TumblingWindowTrigger, bool) { + return nil, false +} + +// AsBlobEventsTrigger is the BasicTrigger implementation for ScheduleTrigger. +func (st ScheduleTrigger) AsBlobEventsTrigger() (*BlobEventsTrigger, bool) { + return nil, false +} + +// AsBlobTrigger is the BasicTrigger implementation for ScheduleTrigger. +func (st ScheduleTrigger) AsBlobTrigger() (*BlobTrigger, bool) { + return nil, false +} + +// AsScheduleTrigger is the BasicTrigger implementation for ScheduleTrigger. +func (st ScheduleTrigger) AsScheduleTrigger() (*ScheduleTrigger, bool) { + return &st, true +} + +// AsMultiplePipelineTrigger is the BasicTrigger implementation for ScheduleTrigger. +func (st ScheduleTrigger) AsMultiplePipelineTrigger() (*MultiplePipelineTrigger, bool) { + return nil, false +} + +// AsBasicMultiplePipelineTrigger is the BasicTrigger implementation for ScheduleTrigger. +func (st ScheduleTrigger) AsBasicMultiplePipelineTrigger() (BasicMultiplePipelineTrigger, bool) { + return &st, true +} + +// AsTrigger is the BasicTrigger implementation for ScheduleTrigger. +func (st ScheduleTrigger) AsTrigger() (*Trigger, bool) { + return nil, false +} + +// AsBasicTrigger is the BasicTrigger implementation for ScheduleTrigger. +func (st ScheduleTrigger) AsBasicTrigger() (BasicTrigger, bool) { + return &st, true +} + +// UnmarshalJSON is the custom unmarshaler for ScheduleTrigger struct. +func (st *ScheduleTrigger) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "typeProperties": + if v != nil { + var scheduleTriggerTypeProperties ScheduleTriggerTypeProperties + err = json.Unmarshal(*v, &scheduleTriggerTypeProperties) + if err != nil { + return err + } + st.ScheduleTriggerTypeProperties = &scheduleTriggerTypeProperties + } + case "pipelines": + if v != nil { + var pipelines []TriggerPipelineReference + err = json.Unmarshal(*v, &pipelines) + if err != nil { + return err + } + st.Pipelines = &pipelines + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if st.AdditionalProperties == nil { + st.AdditionalProperties = make(map[string]interface{}) + } + st.AdditionalProperties[k] = additionalProperties + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + st.Description = &description + } + case "runtimeState": + if v != nil { + var runtimeState TriggerRuntimeState + err = json.Unmarshal(*v, &runtimeState) + if err != nil { + return err + } + st.RuntimeState = runtimeState + } + case "type": + if v != nil { + var typeVar TypeBasicTrigger + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + st.Type = typeVar + } + } + } + + return nil +} + +// ScheduleTriggerRecurrence the workflow trigger recurrence. +type ScheduleTriggerRecurrence struct { + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Frequency - The frequency. Possible values include: 'NotSpecified', 'Minute', 'Hour', 'Day', 'Week', 'Month', 'Year' + Frequency RecurrenceFrequency `json:"frequency,omitempty"` + // Interval - The interval. + Interval *int32 `json:"interval,omitempty"` + // StartTime - The start time. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - The end time. + EndTime *date.Time `json:"endTime,omitempty"` + // TimeZone - The time zone. + TimeZone *string `json:"timeZone,omitempty"` + // Schedule - The recurrence schedule. + Schedule *RecurrenceSchedule `json:"schedule,omitempty"` +} + +// MarshalJSON is the custom marshaler for ScheduleTriggerRecurrence. +func (str ScheduleTriggerRecurrence) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if str.Frequency != "" { + objectMap["frequency"] = str.Frequency + } + if str.Interval != nil { + objectMap["interval"] = str.Interval + } + if str.StartTime != nil { + objectMap["startTime"] = str.StartTime + } + if str.EndTime != nil { + objectMap["endTime"] = str.EndTime + } + if str.TimeZone != nil { + objectMap["timeZone"] = str.TimeZone + } + if str.Schedule != nil { + objectMap["schedule"] = str.Schedule + } + for k, v := range str.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// ScheduleTriggerTypeProperties schedule Trigger properties. +type ScheduleTriggerTypeProperties struct { + // Recurrence - Recurrence schedule configuration. + Recurrence *ScheduleTriggerRecurrence `json:"recurrence,omitempty"` +} + +// BasicSecretBase the base definition of a secret type. +type BasicSecretBase interface { + AsSecureString() (*SecureString, bool) + AsAzureKeyVaultSecretReference() (*AzureKeyVaultSecretReference, bool) + AsSecretBase() (*SecretBase, bool) +} + +// SecretBase the base definition of a secret type. +type SecretBase struct { + // Type - Possible values include: 'TypeSecretBase', 'TypeSecureString', 'TypeAzureKeyVaultSecret' + Type Type `json:"type,omitempty"` +} + +func unmarshalBasicSecretBase(body []byte) (BasicSecretBase, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["type"] { + case string(TypeSecureString): + var ss SecureString + err := json.Unmarshal(body, &ss) + return ss, err + case string(TypeAzureKeyVaultSecret): + var akvsr AzureKeyVaultSecretReference + err := json.Unmarshal(body, &akvsr) + return akvsr, err + default: + var sb SecretBase + err := json.Unmarshal(body, &sb) + return sb, err + } +} +func unmarshalBasicSecretBaseArray(body []byte) ([]BasicSecretBase, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + sbArray := make([]BasicSecretBase, len(rawMessages)) + + for index, rawMessage := range rawMessages { + sb, err := unmarshalBasicSecretBase(*rawMessage) + if err != nil { + return nil, err + } + sbArray[index] = sb + } + return sbArray, nil +} + +// MarshalJSON is the custom marshaler for SecretBase. +func (sb SecretBase) MarshalJSON() ([]byte, error) { + sb.Type = TypeSecretBase + objectMap := make(map[string]interface{}) + if sb.Type != "" { + objectMap["type"] = sb.Type + } + return json.Marshal(objectMap) +} + +// AsSecureString is the BasicSecretBase implementation for SecretBase. +func (sb SecretBase) AsSecureString() (*SecureString, bool) { + return nil, false +} + +// AsAzureKeyVaultSecretReference is the BasicSecretBase implementation for SecretBase. +func (sb SecretBase) AsAzureKeyVaultSecretReference() (*AzureKeyVaultSecretReference, bool) { + return nil, false +} + +// AsSecretBase is the BasicSecretBase implementation for SecretBase. +func (sb SecretBase) AsSecretBase() (*SecretBase, bool) { + return &sb, true +} + +// AsBasicSecretBase is the BasicSecretBase implementation for SecretBase. +func (sb SecretBase) AsBasicSecretBase() (BasicSecretBase, bool) { + return &sb, true +} + +// SecureString azure Data Factory secure string definition. The string value will be masked with asterisks '*' +// during Get or List API calls. +type SecureString struct { + // Value - Value of secure string. + Value *string `json:"value,omitempty"` + // Type - Possible values include: 'TypeSecretBase', 'TypeSecureString', 'TypeAzureKeyVaultSecret' + Type Type `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for SecureString. +func (ss SecureString) MarshalJSON() ([]byte, error) { + ss.Type = TypeSecureString + objectMap := make(map[string]interface{}) + if ss.Value != nil { + objectMap["value"] = ss.Value + } + if ss.Type != "" { + objectMap["type"] = ss.Type + } + return json.Marshal(objectMap) +} + +// AsSecureString is the BasicSecretBase implementation for SecureString. +func (ss SecureString) AsSecureString() (*SecureString, bool) { + return &ss, true +} + +// AsAzureKeyVaultSecretReference is the BasicSecretBase implementation for SecureString. +func (ss SecureString) AsAzureKeyVaultSecretReference() (*AzureKeyVaultSecretReference, bool) { + return nil, false +} + +// AsSecretBase is the BasicSecretBase implementation for SecureString. +func (ss SecureString) AsSecretBase() (*SecretBase, bool) { + return nil, false +} + +// AsBasicSecretBase is the BasicSecretBase implementation for SecureString. +func (ss SecureString) AsBasicSecretBase() (BasicSecretBase, bool) { + return &ss, true +} + +// SelfHostedIntegrationRuntime self-hosted integration runtime. +type SelfHostedIntegrationRuntime struct { + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Description - Integration runtime description. + Description *string `json:"description,omitempty"` + // Type - Possible values include: 'TypeIntegrationRuntime', 'TypeSelfHosted', 'TypeManaged' + Type TypeBasicIntegrationRuntime `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for SelfHostedIntegrationRuntime. +func (shir SelfHostedIntegrationRuntime) MarshalJSON() ([]byte, error) { + shir.Type = TypeSelfHosted + objectMap := make(map[string]interface{}) + if shir.Description != nil { + objectMap["description"] = shir.Description + } + if shir.Type != "" { + objectMap["type"] = shir.Type + } + for k, v := range shir.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsSelfHostedIntegrationRuntime is the BasicIntegrationRuntime implementation for SelfHostedIntegrationRuntime. +func (shir SelfHostedIntegrationRuntime) AsSelfHostedIntegrationRuntime() (*SelfHostedIntegrationRuntime, bool) { + return &shir, true +} + +// AsManagedIntegrationRuntime is the BasicIntegrationRuntime implementation for SelfHostedIntegrationRuntime. +func (shir SelfHostedIntegrationRuntime) AsManagedIntegrationRuntime() (*ManagedIntegrationRuntime, bool) { + return nil, false +} + +// AsIntegrationRuntime is the BasicIntegrationRuntime implementation for SelfHostedIntegrationRuntime. +func (shir SelfHostedIntegrationRuntime) AsIntegrationRuntime() (*IntegrationRuntime, bool) { + return nil, false +} + +// AsBasicIntegrationRuntime is the BasicIntegrationRuntime implementation for SelfHostedIntegrationRuntime. +func (shir SelfHostedIntegrationRuntime) AsBasicIntegrationRuntime() (BasicIntegrationRuntime, bool) { + return &shir, true +} + +// SelfHostedIntegrationRuntimeNode properties of Self-hosted integration runtime node. +type SelfHostedIntegrationRuntimeNode struct { + autorest.Response `json:"-"` + // NodeName - Name of the integration runtime node. + NodeName *string `json:"nodeName,omitempty"` + // MachineName - Machine name of the integration runtime node. + MachineName *string `json:"machineName,omitempty"` + // HostServiceURI - URI for the host machine of the integration runtime. + HostServiceURI *string `json:"hostServiceUri,omitempty"` + // Status - Status of the integration runtime node. Possible values include: 'SelfHostedIntegrationRuntimeNodeStatusNeedRegistration', 'SelfHostedIntegrationRuntimeNodeStatusOnline', 'SelfHostedIntegrationRuntimeNodeStatusLimited', 'SelfHostedIntegrationRuntimeNodeStatusOffline', 'SelfHostedIntegrationRuntimeNodeStatusUpgrading', 'SelfHostedIntegrationRuntimeNodeStatusInitializing', 'SelfHostedIntegrationRuntimeNodeStatusInitializeFailed' + Status SelfHostedIntegrationRuntimeNodeStatus `json:"status,omitempty"` + // Capabilities - The integration runtime capabilities dictionary + Capabilities map[string]*string `json:"capabilities"` + // VersionStatus - Status of the integration runtime node version. + VersionStatus *string `json:"versionStatus,omitempty"` + // Version - Version of the integration runtime node. + Version *string `json:"version,omitempty"` + // RegisterTime - The time at which the integration runtime node was registered in ISO8601 format. + RegisterTime *date.Time `json:"registerTime,omitempty"` + // LastConnectTime - The most recent time at which the integration runtime was connected in ISO8601 format. + LastConnectTime *date.Time `json:"lastConnectTime,omitempty"` + // ExpiryTime - The time at which the integration runtime will expire in ISO8601 format. + ExpiryTime *date.Time `json:"expiryTime,omitempty"` + // LastStartTime - The time the node last started up. + LastStartTime *date.Time `json:"lastStartTime,omitempty"` + // LastStopTime - The integration runtime node last stop time. + LastStopTime *date.Time `json:"lastStopTime,omitempty"` + // LastUpdateResult - The result of the last integration runtime node update. Possible values include: 'Succeed', 'Fail' + LastUpdateResult IntegrationRuntimeUpdateResult `json:"lastUpdateResult,omitempty"` + // LastStartUpdateTime - The last time for the integration runtime node update start. + LastStartUpdateTime *date.Time `json:"lastStartUpdateTime,omitempty"` + // LastEndUpdateTime - The last time for the integration runtime node update end. + LastEndUpdateTime *date.Time `json:"lastEndUpdateTime,omitempty"` + // IsActiveDispatcher - Indicates whether this node is the active dispatcher for integration runtime requests. + IsActiveDispatcher *bool `json:"isActiveDispatcher,omitempty"` + // ConcurrentJobsLimit - Maximum concurrent jobs on the integration runtime node. + ConcurrentJobsLimit *int32 `json:"concurrentJobsLimit,omitempty"` + // MaxConcurrentJobs - The maximum concurrent jobs in this integration runtime. + MaxConcurrentJobs *int32 `json:"maxConcurrentJobs,omitempty"` +} + +// MarshalJSON is the custom marshaler for SelfHostedIntegrationRuntimeNode. +func (shirn SelfHostedIntegrationRuntimeNode) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if shirn.NodeName != nil { + objectMap["nodeName"] = shirn.NodeName + } + if shirn.MachineName != nil { + objectMap["machineName"] = shirn.MachineName + } + if shirn.HostServiceURI != nil { + objectMap["hostServiceUri"] = shirn.HostServiceURI + } + if shirn.Status != "" { + objectMap["status"] = shirn.Status + } + if shirn.Capabilities != nil { + objectMap["capabilities"] = shirn.Capabilities + } + if shirn.VersionStatus != nil { + objectMap["versionStatus"] = shirn.VersionStatus + } + if shirn.Version != nil { + objectMap["version"] = shirn.Version + } + if shirn.RegisterTime != nil { + objectMap["registerTime"] = shirn.RegisterTime + } + if shirn.LastConnectTime != nil { + objectMap["lastConnectTime"] = shirn.LastConnectTime + } + if shirn.ExpiryTime != nil { + objectMap["expiryTime"] = shirn.ExpiryTime + } + if shirn.LastStartTime != nil { + objectMap["lastStartTime"] = shirn.LastStartTime + } + if shirn.LastStopTime != nil { + objectMap["lastStopTime"] = shirn.LastStopTime + } + if shirn.LastUpdateResult != "" { + objectMap["lastUpdateResult"] = shirn.LastUpdateResult + } + if shirn.LastStartUpdateTime != nil { + objectMap["lastStartUpdateTime"] = shirn.LastStartUpdateTime + } + if shirn.LastEndUpdateTime != nil { + objectMap["lastEndUpdateTime"] = shirn.LastEndUpdateTime + } + if shirn.IsActiveDispatcher != nil { + objectMap["isActiveDispatcher"] = shirn.IsActiveDispatcher + } + if shirn.ConcurrentJobsLimit != nil { + objectMap["concurrentJobsLimit"] = shirn.ConcurrentJobsLimit + } + if shirn.MaxConcurrentJobs != nil { + objectMap["maxConcurrentJobs"] = shirn.MaxConcurrentJobs + } + return json.Marshal(objectMap) +} + +// SelfHostedIntegrationRuntimeStatus self-hosted integration runtime status. +type SelfHostedIntegrationRuntimeStatus struct { + // SelfHostedIntegrationRuntimeStatusTypeProperties - Self-hosted integration runtime status type properties. + *SelfHostedIntegrationRuntimeStatusTypeProperties `json:"typeProperties,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // DataFactoryName - The data factory name which the integration runtime belong to. + DataFactoryName *string `json:"dataFactoryName,omitempty"` + // State - The state of integration runtime. Possible values include: 'Initial', 'Stopped', 'Started', 'Starting', 'Stopping', 'NeedRegistration', 'Online', 'Limited', 'Offline' + State IntegrationRuntimeState `json:"state,omitempty"` + // Type - Possible values include: 'TypeBasicIntegrationRuntimeStatusTypeIntegrationRuntimeStatus', 'TypeBasicIntegrationRuntimeStatusTypeSelfHosted', 'TypeBasicIntegrationRuntimeStatusTypeManaged' + Type TypeBasicIntegrationRuntimeStatus `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for SelfHostedIntegrationRuntimeStatus. +func (shirs SelfHostedIntegrationRuntimeStatus) MarshalJSON() ([]byte, error) { + shirs.Type = TypeBasicIntegrationRuntimeStatusTypeSelfHosted + objectMap := make(map[string]interface{}) + if shirs.SelfHostedIntegrationRuntimeStatusTypeProperties != nil { + objectMap["typeProperties"] = shirs.SelfHostedIntegrationRuntimeStatusTypeProperties + } + if shirs.DataFactoryName != nil { + objectMap["dataFactoryName"] = shirs.DataFactoryName + } + if shirs.State != "" { + objectMap["state"] = shirs.State + } + if shirs.Type != "" { + objectMap["type"] = shirs.Type + } + for k, v := range shirs.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsSelfHostedIntegrationRuntimeStatus is the BasicIntegrationRuntimeStatus implementation for SelfHostedIntegrationRuntimeStatus. +func (shirs SelfHostedIntegrationRuntimeStatus) AsSelfHostedIntegrationRuntimeStatus() (*SelfHostedIntegrationRuntimeStatus, bool) { + return &shirs, true +} + +// AsManagedIntegrationRuntimeStatus is the BasicIntegrationRuntimeStatus implementation for SelfHostedIntegrationRuntimeStatus. +func (shirs SelfHostedIntegrationRuntimeStatus) AsManagedIntegrationRuntimeStatus() (*ManagedIntegrationRuntimeStatus, bool) { + return nil, false +} + +// AsIntegrationRuntimeStatus is the BasicIntegrationRuntimeStatus implementation for SelfHostedIntegrationRuntimeStatus. +func (shirs SelfHostedIntegrationRuntimeStatus) AsIntegrationRuntimeStatus() (*IntegrationRuntimeStatus, bool) { + return nil, false +} + +// AsBasicIntegrationRuntimeStatus is the BasicIntegrationRuntimeStatus implementation for SelfHostedIntegrationRuntimeStatus. +func (shirs SelfHostedIntegrationRuntimeStatus) AsBasicIntegrationRuntimeStatus() (BasicIntegrationRuntimeStatus, bool) { + return &shirs, true +} + +// UnmarshalJSON is the custom unmarshaler for SelfHostedIntegrationRuntimeStatus struct. +func (shirs *SelfHostedIntegrationRuntimeStatus) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "typeProperties": + if v != nil { + var selfHostedIntegrationRuntimeStatusTypeProperties SelfHostedIntegrationRuntimeStatusTypeProperties + err = json.Unmarshal(*v, &selfHostedIntegrationRuntimeStatusTypeProperties) + if err != nil { + return err + } + shirs.SelfHostedIntegrationRuntimeStatusTypeProperties = &selfHostedIntegrationRuntimeStatusTypeProperties + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if shirs.AdditionalProperties == nil { + shirs.AdditionalProperties = make(map[string]interface{}) + } + shirs.AdditionalProperties[k] = additionalProperties + } + case "dataFactoryName": + if v != nil { + var dataFactoryName string + err = json.Unmarshal(*v, &dataFactoryName) + if err != nil { + return err + } + shirs.DataFactoryName = &dataFactoryName + } + case "state": + if v != nil { + var state IntegrationRuntimeState + err = json.Unmarshal(*v, &state) + if err != nil { + return err + } + shirs.State = state + } + case "type": + if v != nil { + var typeVar TypeBasicIntegrationRuntimeStatus + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + shirs.Type = typeVar + } + } + } + + return nil +} + +// SelfHostedIntegrationRuntimeStatusTypeProperties self-hosted integration runtime status type properties. +type SelfHostedIntegrationRuntimeStatusTypeProperties struct { + // CreateTime - The time at which the integration runtime was created, in ISO8601 format. + CreateTime *date.Time `json:"createTime,omitempty"` + // TaskQueueID - The task queue id of the integration runtime. + TaskQueueID *string `json:"taskQueueId,omitempty"` + // InternalChannelEncryption - It is used to set the encryption mode for node-node communication channel (when more than 2 self-hosted integration runtime nodes exist). Possible values include: 'NotSet', 'SslEncrypted', 'NotEncrypted' + InternalChannelEncryption IntegrationRuntimeInternalChannelEncryptionMode `json:"internalChannelEncryption,omitempty"` + // Version - Version of the integration runtime. + Version *string `json:"version,omitempty"` + // Nodes - The list of nodes for this integration runtime. + Nodes *[]SelfHostedIntegrationRuntimeNode `json:"nodes,omitempty"` + // ScheduledUpdateDate - The date at which the integration runtime will be scheduled to update, in ISO8601 format. + ScheduledUpdateDate *date.Time `json:"scheduledUpdateDate,omitempty"` + // UpdateDelayOffset - The time in the date scheduled by service to update the integration runtime, e.g., PT03H is 3 hours + UpdateDelayOffset *string `json:"updateDelayOffset,omitempty"` + // LocalTimeZoneOffset - The local time zone offset in hours. + LocalTimeZoneOffset *string `json:"localTimeZoneOffset,omitempty"` + // Capabilities - Object with additional information about integration runtime capabilities. + Capabilities map[string]*string `json:"capabilities"` + // ServiceUrls - The URLs for the services used in integration runtime backend service. + ServiceUrls *[]string `json:"serviceUrls,omitempty"` + // AutoUpdate - Whether Self-hosted integration runtime auto update has been turned on. Possible values include: 'On', 'Off' + AutoUpdate IntegrationRuntimeAutoUpdate `json:"autoUpdate,omitempty"` + // VersionStatus - Status of the integration runtime version. + VersionStatus *string `json:"versionStatus,omitempty"` + // PushedVersion - The version that the integration runtime is going to update to. + PushedVersion *string `json:"pushedVersion,omitempty"` + // LatestVersion - The latest version on download center. + LatestVersion *string `json:"latestVersion,omitempty"` +} + +// MarshalJSON is the custom marshaler for SelfHostedIntegrationRuntimeStatusTypeProperties. +func (shirstp SelfHostedIntegrationRuntimeStatusTypeProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if shirstp.CreateTime != nil { + objectMap["createTime"] = shirstp.CreateTime + } + if shirstp.TaskQueueID != nil { + objectMap["taskQueueId"] = shirstp.TaskQueueID + } + if shirstp.InternalChannelEncryption != "" { + objectMap["internalChannelEncryption"] = shirstp.InternalChannelEncryption + } + if shirstp.Version != nil { + objectMap["version"] = shirstp.Version + } + if shirstp.Nodes != nil { + objectMap["nodes"] = shirstp.Nodes + } + if shirstp.ScheduledUpdateDate != nil { + objectMap["scheduledUpdateDate"] = shirstp.ScheduledUpdateDate + } + if shirstp.UpdateDelayOffset != nil { + objectMap["updateDelayOffset"] = shirstp.UpdateDelayOffset + } + if shirstp.LocalTimeZoneOffset != nil { + objectMap["localTimeZoneOffset"] = shirstp.LocalTimeZoneOffset + } + if shirstp.Capabilities != nil { + objectMap["capabilities"] = shirstp.Capabilities + } + if shirstp.ServiceUrls != nil { + objectMap["serviceUrls"] = shirstp.ServiceUrls + } + if shirstp.AutoUpdate != "" { + objectMap["autoUpdate"] = shirstp.AutoUpdate + } + if shirstp.VersionStatus != nil { + objectMap["versionStatus"] = shirstp.VersionStatus + } + if shirstp.PushedVersion != nil { + objectMap["pushedVersion"] = shirstp.PushedVersion + } + if shirstp.LatestVersion != nil { + objectMap["latestVersion"] = shirstp.LatestVersion + } + return json.Marshal(objectMap) +} + +// ServiceNowLinkedService serviceNow server linked service. +type ServiceNowLinkedService struct { + // ServiceNowLinkedServiceTypeProperties - ServiceNow server linked service properties. + *ServiceNowLinkedServiceTypeProperties `json:"typeProperties,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // ConnectVia - The integration runtime reference. + ConnectVia *IntegrationRuntimeReference `json:"connectVia,omitempty"` + // Description - Linked service description. + Description *string `json:"description,omitempty"` + // Parameters - Parameters for linked service. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeLinkedService', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforce', 'TypeAzureDataLakeStore', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureStorage' + Type TypeBasicLinkedService `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ServiceNowLinkedService. +func (snls ServiceNowLinkedService) MarshalJSON() ([]byte, error) { + snls.Type = TypeServiceNow + objectMap := make(map[string]interface{}) + if snls.ServiceNowLinkedServiceTypeProperties != nil { + objectMap["typeProperties"] = snls.ServiceNowLinkedServiceTypeProperties + } + if snls.ConnectVia != nil { + objectMap["connectVia"] = snls.ConnectVia + } + if snls.Description != nil { + objectMap["description"] = snls.Description + } + if snls.Parameters != nil { + objectMap["parameters"] = snls.Parameters + } + if snls.Annotations != nil { + objectMap["annotations"] = snls.Annotations + } + if snls.Type != "" { + objectMap["type"] = snls.Type + } + for k, v := range snls.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysLinkedService is the BasicLinkedService implementation for ServiceNowLinkedService. +func (snls ServiceNowLinkedService) AsResponsysLinkedService() (*ResponsysLinkedService, bool) { + return nil, false +} + +// AsAzureDatabricksLinkedService is the BasicLinkedService implementation for ServiceNowLinkedService. +func (snls ServiceNowLinkedService) AsAzureDatabricksLinkedService() (*AzureDatabricksLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeAnalyticsLinkedService is the BasicLinkedService implementation for ServiceNowLinkedService. +func (snls ServiceNowLinkedService) AsAzureDataLakeAnalyticsLinkedService() (*AzureDataLakeAnalyticsLinkedService, bool) { + return nil, false +} + +// AsHDInsightOnDemandLinkedService is the BasicLinkedService implementation for ServiceNowLinkedService. +func (snls ServiceNowLinkedService) AsHDInsightOnDemandLinkedService() (*HDInsightOnDemandLinkedService, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudLinkedService is the BasicLinkedService implementation for ServiceNowLinkedService. +func (snls ServiceNowLinkedService) AsSalesforceMarketingCloudLinkedService() (*SalesforceMarketingCloudLinkedService, bool) { + return nil, false +} + +// AsNetezzaLinkedService is the BasicLinkedService implementation for ServiceNowLinkedService. +func (snls ServiceNowLinkedService) AsNetezzaLinkedService() (*NetezzaLinkedService, bool) { + return nil, false +} + +// AsVerticaLinkedService is the BasicLinkedService implementation for ServiceNowLinkedService. +func (snls ServiceNowLinkedService) AsVerticaLinkedService() (*VerticaLinkedService, bool) { + return nil, false +} + +// AsZohoLinkedService is the BasicLinkedService implementation for ServiceNowLinkedService. +func (snls ServiceNowLinkedService) AsZohoLinkedService() (*ZohoLinkedService, bool) { + return nil, false +} + +// AsXeroLinkedService is the BasicLinkedService implementation for ServiceNowLinkedService. +func (snls ServiceNowLinkedService) AsXeroLinkedService() (*XeroLinkedService, bool) { + return nil, false +} + +// AsSquareLinkedService is the BasicLinkedService implementation for ServiceNowLinkedService. +func (snls ServiceNowLinkedService) AsSquareLinkedService() (*SquareLinkedService, bool) { + return nil, false +} + +// AsSparkLinkedService is the BasicLinkedService implementation for ServiceNowLinkedService. +func (snls ServiceNowLinkedService) AsSparkLinkedService() (*SparkLinkedService, bool) { + return nil, false +} + +// AsShopifyLinkedService is the BasicLinkedService implementation for ServiceNowLinkedService. +func (snls ServiceNowLinkedService) AsShopifyLinkedService() (*ShopifyLinkedService, bool) { + return nil, false +} + +// AsServiceNowLinkedService is the BasicLinkedService implementation for ServiceNowLinkedService. +func (snls ServiceNowLinkedService) AsServiceNowLinkedService() (*ServiceNowLinkedService, bool) { + return &snls, true +} + +// AsQuickBooksLinkedService is the BasicLinkedService implementation for ServiceNowLinkedService. +func (snls ServiceNowLinkedService) AsQuickBooksLinkedService() (*QuickBooksLinkedService, bool) { + return nil, false +} + +// AsPrestoLinkedService is the BasicLinkedService implementation for ServiceNowLinkedService. +func (snls ServiceNowLinkedService) AsPrestoLinkedService() (*PrestoLinkedService, bool) { + return nil, false +} + +// AsPhoenixLinkedService is the BasicLinkedService implementation for ServiceNowLinkedService. +func (snls ServiceNowLinkedService) AsPhoenixLinkedService() (*PhoenixLinkedService, bool) { + return nil, false +} + +// AsPaypalLinkedService is the BasicLinkedService implementation for ServiceNowLinkedService. +func (snls ServiceNowLinkedService) AsPaypalLinkedService() (*PaypalLinkedService, bool) { + return nil, false +} + +// AsMarketoLinkedService is the BasicLinkedService implementation for ServiceNowLinkedService. +func (snls ServiceNowLinkedService) AsMarketoLinkedService() (*MarketoLinkedService, bool) { + return nil, false +} + +// AsMariaDBLinkedService is the BasicLinkedService implementation for ServiceNowLinkedService. +func (snls ServiceNowLinkedService) AsMariaDBLinkedService() (*MariaDBLinkedService, bool) { + return nil, false +} + +// AsMagentoLinkedService is the BasicLinkedService implementation for ServiceNowLinkedService. +func (snls ServiceNowLinkedService) AsMagentoLinkedService() (*MagentoLinkedService, bool) { + return nil, false +} + +// AsJiraLinkedService is the BasicLinkedService implementation for ServiceNowLinkedService. +func (snls ServiceNowLinkedService) AsJiraLinkedService() (*JiraLinkedService, bool) { + return nil, false +} + +// AsImpalaLinkedService is the BasicLinkedService implementation for ServiceNowLinkedService. +func (snls ServiceNowLinkedService) AsImpalaLinkedService() (*ImpalaLinkedService, bool) { + return nil, false +} + +// AsHubspotLinkedService is the BasicLinkedService implementation for ServiceNowLinkedService. +func (snls ServiceNowLinkedService) AsHubspotLinkedService() (*HubspotLinkedService, bool) { + return nil, false +} + +// AsHiveLinkedService is the BasicLinkedService implementation for ServiceNowLinkedService. +func (snls ServiceNowLinkedService) AsHiveLinkedService() (*HiveLinkedService, bool) { + return nil, false +} + +// AsHBaseLinkedService is the BasicLinkedService implementation for ServiceNowLinkedService. +func (snls ServiceNowLinkedService) AsHBaseLinkedService() (*HBaseLinkedService, bool) { + return nil, false +} + +// AsGreenplumLinkedService is the BasicLinkedService implementation for ServiceNowLinkedService. +func (snls ServiceNowLinkedService) AsGreenplumLinkedService() (*GreenplumLinkedService, bool) { + return nil, false +} + +// AsGoogleBigQueryLinkedService is the BasicLinkedService implementation for ServiceNowLinkedService. +func (snls ServiceNowLinkedService) AsGoogleBigQueryLinkedService() (*GoogleBigQueryLinkedService, bool) { + return nil, false +} + +// AsEloquaLinkedService is the BasicLinkedService implementation for ServiceNowLinkedService. +func (snls ServiceNowLinkedService) AsEloquaLinkedService() (*EloquaLinkedService, bool) { + return nil, false +} + +// AsDrillLinkedService is the BasicLinkedService implementation for ServiceNowLinkedService. +func (snls ServiceNowLinkedService) AsDrillLinkedService() (*DrillLinkedService, bool) { + return nil, false +} + +// AsCouchbaseLinkedService is the BasicLinkedService implementation for ServiceNowLinkedService. +func (snls ServiceNowLinkedService) AsCouchbaseLinkedService() (*CouchbaseLinkedService, bool) { + return nil, false +} + +// AsConcurLinkedService is the BasicLinkedService implementation for ServiceNowLinkedService. +func (snls ServiceNowLinkedService) AsConcurLinkedService() (*ConcurLinkedService, bool) { + return nil, false +} + +// AsAzurePostgreSQLLinkedService is the BasicLinkedService implementation for ServiceNowLinkedService. +func (snls ServiceNowLinkedService) AsAzurePostgreSQLLinkedService() (*AzurePostgreSQLLinkedService, bool) { + return nil, false +} + +// AsAmazonMWSLinkedService is the BasicLinkedService implementation for ServiceNowLinkedService. +func (snls ServiceNowLinkedService) AsAmazonMWSLinkedService() (*AmazonMWSLinkedService, bool) { + return nil, false +} + +// AsSapHanaLinkedService is the BasicLinkedService implementation for ServiceNowLinkedService. +func (snls ServiceNowLinkedService) AsSapHanaLinkedService() (*SapHanaLinkedService, bool) { + return nil, false +} + +// AsSapBWLinkedService is the BasicLinkedService implementation for ServiceNowLinkedService. +func (snls ServiceNowLinkedService) AsSapBWLinkedService() (*SapBWLinkedService, bool) { + return nil, false +} + +// AsSftpServerLinkedService is the BasicLinkedService implementation for ServiceNowLinkedService. +func (snls ServiceNowLinkedService) AsSftpServerLinkedService() (*SftpServerLinkedService, bool) { + return nil, false +} + +// AsFtpServerLinkedService is the BasicLinkedService implementation for ServiceNowLinkedService. +func (snls ServiceNowLinkedService) AsFtpServerLinkedService() (*FtpServerLinkedService, bool) { + return nil, false +} + +// AsHTTPLinkedService is the BasicLinkedService implementation for ServiceNowLinkedService. +func (snls ServiceNowLinkedService) AsHTTPLinkedService() (*HTTPLinkedService, bool) { + return nil, false +} + +// AsAzureSearchLinkedService is the BasicLinkedService implementation for ServiceNowLinkedService. +func (snls ServiceNowLinkedService) AsAzureSearchLinkedService() (*AzureSearchLinkedService, bool) { + return nil, false +} + +// AsCustomDataSourceLinkedService is the BasicLinkedService implementation for ServiceNowLinkedService. +func (snls ServiceNowLinkedService) AsCustomDataSourceLinkedService() (*CustomDataSourceLinkedService, bool) { + return nil, false +} + +// AsAmazonRedshiftLinkedService is the BasicLinkedService implementation for ServiceNowLinkedService. +func (snls ServiceNowLinkedService) AsAmazonRedshiftLinkedService() (*AmazonRedshiftLinkedService, bool) { + return nil, false +} + +// AsAmazonS3LinkedService is the BasicLinkedService implementation for ServiceNowLinkedService. +func (snls ServiceNowLinkedService) AsAmazonS3LinkedService() (*AmazonS3LinkedService, bool) { + return nil, false +} + +// AsSapEccLinkedService is the BasicLinkedService implementation for ServiceNowLinkedService. +func (snls ServiceNowLinkedService) AsSapEccLinkedService() (*SapEccLinkedService, bool) { + return nil, false +} + +// AsSapCloudForCustomerLinkedService is the BasicLinkedService implementation for ServiceNowLinkedService. +func (snls ServiceNowLinkedService) AsSapCloudForCustomerLinkedService() (*SapCloudForCustomerLinkedService, bool) { + return nil, false +} + +// AsSalesforceLinkedService is the BasicLinkedService implementation for ServiceNowLinkedService. +func (snls ServiceNowLinkedService) AsSalesforceLinkedService() (*SalesforceLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeStoreLinkedService is the BasicLinkedService implementation for ServiceNowLinkedService. +func (snls ServiceNowLinkedService) AsAzureDataLakeStoreLinkedService() (*AzureDataLakeStoreLinkedService, bool) { + return nil, false +} + +// AsMongoDbLinkedService is the BasicLinkedService implementation for ServiceNowLinkedService. +func (snls ServiceNowLinkedService) AsMongoDbLinkedService() (*MongoDbLinkedService, bool) { + return nil, false +} + +// AsCassandraLinkedService is the BasicLinkedService implementation for ServiceNowLinkedService. +func (snls ServiceNowLinkedService) AsCassandraLinkedService() (*CassandraLinkedService, bool) { + return nil, false +} + +// AsWebLinkedService is the BasicLinkedService implementation for ServiceNowLinkedService. +func (snls ServiceNowLinkedService) AsWebLinkedService() (*WebLinkedService, bool) { + return nil, false +} + +// AsODataLinkedService is the BasicLinkedService implementation for ServiceNowLinkedService. +func (snls ServiceNowLinkedService) AsODataLinkedService() (*ODataLinkedService, bool) { + return nil, false +} + +// AsHdfsLinkedService is the BasicLinkedService implementation for ServiceNowLinkedService. +func (snls ServiceNowLinkedService) AsHdfsLinkedService() (*HdfsLinkedService, bool) { + return nil, false +} + +// AsOdbcLinkedService is the BasicLinkedService implementation for ServiceNowLinkedService. +func (snls ServiceNowLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, bool) { + return nil, false +} + +// AsAzureMLLinkedService is the BasicLinkedService implementation for ServiceNowLinkedService. +func (snls ServiceNowLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { + return nil, false +} + +// AsTeradataLinkedService is the BasicLinkedService implementation for ServiceNowLinkedService. +func (snls ServiceNowLinkedService) AsTeradataLinkedService() (*TeradataLinkedService, bool) { + return nil, false +} + +// AsDb2LinkedService is the BasicLinkedService implementation for ServiceNowLinkedService. +func (snls ServiceNowLinkedService) AsDb2LinkedService() (*Db2LinkedService, bool) { + return nil, false +} + +// AsSybaseLinkedService is the BasicLinkedService implementation for ServiceNowLinkedService. +func (snls ServiceNowLinkedService) AsSybaseLinkedService() (*SybaseLinkedService, bool) { + return nil, false +} + +// AsPostgreSQLLinkedService is the BasicLinkedService implementation for ServiceNowLinkedService. +func (snls ServiceNowLinkedService) AsPostgreSQLLinkedService() (*PostgreSQLLinkedService, bool) { + return nil, false +} + +// AsMySQLLinkedService is the BasicLinkedService implementation for ServiceNowLinkedService. +func (snls ServiceNowLinkedService) AsMySQLLinkedService() (*MySQLLinkedService, bool) { + return nil, false +} + +// AsAzureMySQLLinkedService is the BasicLinkedService implementation for ServiceNowLinkedService. +func (snls ServiceNowLinkedService) AsAzureMySQLLinkedService() (*AzureMySQLLinkedService, bool) { + return nil, false +} + +// AsOracleLinkedService is the BasicLinkedService implementation for ServiceNowLinkedService. +func (snls ServiceNowLinkedService) AsOracleLinkedService() (*OracleLinkedService, bool) { + return nil, false +} + +// AsFileServerLinkedService is the BasicLinkedService implementation for ServiceNowLinkedService. +func (snls ServiceNowLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { + return nil, false +} + +// AsHDInsightLinkedService is the BasicLinkedService implementation for ServiceNowLinkedService. +func (snls ServiceNowLinkedService) AsHDInsightLinkedService() (*HDInsightLinkedService, bool) { + return nil, false +} + +// AsDynamicsLinkedService is the BasicLinkedService implementation for ServiceNowLinkedService. +func (snls ServiceNowLinkedService) AsDynamicsLinkedService() (*DynamicsLinkedService, bool) { + return nil, false +} + +// AsCosmosDbLinkedService is the BasicLinkedService implementation for ServiceNowLinkedService. +func (snls ServiceNowLinkedService) AsCosmosDbLinkedService() (*CosmosDbLinkedService, bool) { + return nil, false +} + +// AsAzureKeyVaultLinkedService is the BasicLinkedService implementation for ServiceNowLinkedService. +func (snls ServiceNowLinkedService) AsAzureKeyVaultLinkedService() (*AzureKeyVaultLinkedService, bool) { + return nil, false +} + +// AsAzureBatchLinkedService is the BasicLinkedService implementation for ServiceNowLinkedService. +func (snls ServiceNowLinkedService) AsAzureBatchLinkedService() (*AzureBatchLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDatabaseLinkedService is the BasicLinkedService implementation for ServiceNowLinkedService. +func (snls ServiceNowLinkedService) AsAzureSQLDatabaseLinkedService() (*AzureSQLDatabaseLinkedService, bool) { + return nil, false +} + +// AsSQLServerLinkedService is the BasicLinkedService implementation for ServiceNowLinkedService. +func (snls ServiceNowLinkedService) AsSQLServerLinkedService() (*SQLServerLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDWLinkedService is the BasicLinkedService implementation for ServiceNowLinkedService. +func (snls ServiceNowLinkedService) AsAzureSQLDWLinkedService() (*AzureSQLDWLinkedService, bool) { + return nil, false +} + +// AsAzureStorageLinkedService is the BasicLinkedService implementation for ServiceNowLinkedService. +func (snls ServiceNowLinkedService) AsAzureStorageLinkedService() (*AzureStorageLinkedService, bool) { + return nil, false +} + +// AsLinkedService is the BasicLinkedService implementation for ServiceNowLinkedService. +func (snls ServiceNowLinkedService) AsLinkedService() (*LinkedService, bool) { + return nil, false +} + +// AsBasicLinkedService is the BasicLinkedService implementation for ServiceNowLinkedService. +func (snls ServiceNowLinkedService) AsBasicLinkedService() (BasicLinkedService, bool) { + return &snls, true +} + +// UnmarshalJSON is the custom unmarshaler for ServiceNowLinkedService struct. +func (snls *ServiceNowLinkedService) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "typeProperties": + if v != nil { + var serviceNowLinkedServiceTypeProperties ServiceNowLinkedServiceTypeProperties + err = json.Unmarshal(*v, &serviceNowLinkedServiceTypeProperties) + if err != nil { + return err + } + snls.ServiceNowLinkedServiceTypeProperties = &serviceNowLinkedServiceTypeProperties + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if snls.AdditionalProperties == nil { + snls.AdditionalProperties = make(map[string]interface{}) + } + snls.AdditionalProperties[k] = additionalProperties + } + case "connectVia": + if v != nil { + var connectVia IntegrationRuntimeReference + err = json.Unmarshal(*v, &connectVia) + if err != nil { + return err + } + snls.ConnectVia = &connectVia + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + snls.Description = &description + } + case "parameters": + if v != nil { + var parameters map[string]*ParameterSpecification + err = json.Unmarshal(*v, ¶meters) + if err != nil { + return err + } + snls.Parameters = parameters + } + case "annotations": + if v != nil { + var annotations []interface{} + err = json.Unmarshal(*v, &annotations) + if err != nil { + return err + } + snls.Annotations = &annotations + } + case "type": + if v != nil { + var typeVar TypeBasicLinkedService + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + snls.Type = typeVar + } + } + } + + return nil +} + +// ServiceNowLinkedServiceTypeProperties serviceNow server linked service properties. +type ServiceNowLinkedServiceTypeProperties struct { + // Endpoint - The endpoint of the ServiceNow server. (i.e. .service-now.com) + Endpoint interface{} `json:"endpoint,omitempty"` + // AuthenticationType - The authentication type to use. Possible values include: 'ServiceNowAuthenticationTypeBasic', 'ServiceNowAuthenticationTypeOAuth2' + AuthenticationType ServiceNowAuthenticationType `json:"authenticationType,omitempty"` + // Username - The user name used to connect to the ServiceNow server for Basic and OAuth2 authentication. + Username interface{} `json:"username,omitempty"` + // Password - The password corresponding to the user name for Basic and OAuth2 authentication. + Password BasicSecretBase `json:"password,omitempty"` + // ClientID - The client id for OAuth2 authentication. + ClientID interface{} `json:"clientId,omitempty"` + // ClientSecret - The client secret for OAuth2 authentication. + ClientSecret BasicSecretBase `json:"clientSecret,omitempty"` + // UseEncryptedEndpoints - Specifies whether the data source endpoints are encrypted using HTTPS. The default value is true. + UseEncryptedEndpoints interface{} `json:"useEncryptedEndpoints,omitempty"` + // UseHostVerification - Specifies whether to require the host name in the server's certificate to match the host name of the server when connecting over SSL. The default value is true. + UseHostVerification interface{} `json:"useHostVerification,omitempty"` + // UsePeerVerification - Specifies whether to verify the identity of the server when connecting over SSL. The default value is true. + UsePeerVerification interface{} `json:"usePeerVerification,omitempty"` + // EncryptedCredential - The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string). + EncryptedCredential interface{} `json:"encryptedCredential,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for ServiceNowLinkedServiceTypeProperties struct. +func (snlstp *ServiceNowLinkedServiceTypeProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "endpoint": + if v != nil { + var endpoint interface{} + err = json.Unmarshal(*v, &endpoint) + if err != nil { + return err + } + snlstp.Endpoint = endpoint + } + case "authenticationType": + if v != nil { + var authenticationType ServiceNowAuthenticationType + err = json.Unmarshal(*v, &authenticationType) + if err != nil { + return err + } + snlstp.AuthenticationType = authenticationType + } + case "username": + if v != nil { + var username interface{} + err = json.Unmarshal(*v, &username) + if err != nil { + return err + } + snlstp.Username = username + } + case "password": + if v != nil { + password, err := unmarshalBasicSecretBase(*v) + if err != nil { + return err + } + snlstp.Password = password + } + case "clientId": + if v != nil { + var clientID interface{} + err = json.Unmarshal(*v, &clientID) + if err != nil { + return err + } + snlstp.ClientID = clientID + } + case "clientSecret": + if v != nil { + clientSecret, err := unmarshalBasicSecretBase(*v) + if err != nil { + return err + } + snlstp.ClientSecret = clientSecret + } + case "useEncryptedEndpoints": + if v != nil { + var useEncryptedEndpoints interface{} + err = json.Unmarshal(*v, &useEncryptedEndpoints) + if err != nil { + return err + } + snlstp.UseEncryptedEndpoints = useEncryptedEndpoints + } + case "useHostVerification": + if v != nil { + var useHostVerification interface{} + err = json.Unmarshal(*v, &useHostVerification) + if err != nil { + return err + } + snlstp.UseHostVerification = useHostVerification + } + case "usePeerVerification": + if v != nil { + var usePeerVerification interface{} + err = json.Unmarshal(*v, &usePeerVerification) + if err != nil { + return err + } + snlstp.UsePeerVerification = usePeerVerification + } + case "encryptedCredential": + if v != nil { + var encryptedCredential interface{} + err = json.Unmarshal(*v, &encryptedCredential) + if err != nil { + return err + } + snlstp.EncryptedCredential = encryptedCredential + } + } + } + + return nil +} + +// ServiceNowObjectDataset serviceNow server dataset. +type ServiceNowObjectDataset struct { + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Description - Dataset description. + Description *string `json:"description,omitempty"` + // Structure - Columns that define the structure of the dataset. Type: array (or Expression with resultType array), itemType: DatasetDataElement. + Structure interface{} `json:"structure,omitempty"` + // LinkedServiceName - Linked service reference. + LinkedServiceName *LinkedServiceReference `json:"linkedServiceName,omitempty"` + // Parameters - Parameters for dataset. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeDataset', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSQLServerTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSalesforceObject', 'TypeRelationalTable', 'TypeAzureMySQLTable', 'TypeOracleTable', 'TypeODataResource', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeAzureDataLakeStoreFile', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeAmazonS3Object' + Type TypeBasicDataset `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ServiceNowObjectDataset. +func (snod ServiceNowObjectDataset) MarshalJSON() ([]byte, error) { + snod.Type = TypeServiceNowObject + objectMap := make(map[string]interface{}) + if snod.Description != nil { + objectMap["description"] = snod.Description + } + objectMap["structure"] = snod.Structure + if snod.LinkedServiceName != nil { + objectMap["linkedServiceName"] = snod.LinkedServiceName + } + if snod.Parameters != nil { + objectMap["parameters"] = snod.Parameters + } + if snod.Annotations != nil { + objectMap["annotations"] = snod.Annotations + } + if snod.Type != "" { + objectMap["type"] = snod.Type + } + for k, v := range snod.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysObjectDataset is the BasicDataset implementation for ServiceNowObjectDataset. +func (snod ServiceNowObjectDataset) AsResponsysObjectDataset() (*ResponsysObjectDataset, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudObjectDataset is the BasicDataset implementation for ServiceNowObjectDataset. +func (snod ServiceNowObjectDataset) AsSalesforceMarketingCloudObjectDataset() (*SalesforceMarketingCloudObjectDataset, bool) { + return nil, false +} + +// AsVerticaTableDataset is the BasicDataset implementation for ServiceNowObjectDataset. +func (snod ServiceNowObjectDataset) AsVerticaTableDataset() (*VerticaTableDataset, bool) { + return nil, false +} + +// AsNetezzaTableDataset is the BasicDataset implementation for ServiceNowObjectDataset. +func (snod ServiceNowObjectDataset) AsNetezzaTableDataset() (*NetezzaTableDataset, bool) { + return nil, false +} + +// AsZohoObjectDataset is the BasicDataset implementation for ServiceNowObjectDataset. +func (snod ServiceNowObjectDataset) AsZohoObjectDataset() (*ZohoObjectDataset, bool) { + return nil, false +} + +// AsXeroObjectDataset is the BasicDataset implementation for ServiceNowObjectDataset. +func (snod ServiceNowObjectDataset) AsXeroObjectDataset() (*XeroObjectDataset, bool) { + return nil, false +} + +// AsSquareObjectDataset is the BasicDataset implementation for ServiceNowObjectDataset. +func (snod ServiceNowObjectDataset) AsSquareObjectDataset() (*SquareObjectDataset, bool) { + return nil, false +} + +// AsSparkObjectDataset is the BasicDataset implementation for ServiceNowObjectDataset. +func (snod ServiceNowObjectDataset) AsSparkObjectDataset() (*SparkObjectDataset, bool) { + return nil, false +} + +// AsShopifyObjectDataset is the BasicDataset implementation for ServiceNowObjectDataset. +func (snod ServiceNowObjectDataset) AsShopifyObjectDataset() (*ShopifyObjectDataset, bool) { + return nil, false +} + +// AsServiceNowObjectDataset is the BasicDataset implementation for ServiceNowObjectDataset. +func (snod ServiceNowObjectDataset) AsServiceNowObjectDataset() (*ServiceNowObjectDataset, bool) { + return &snod, true +} + +// AsQuickBooksObjectDataset is the BasicDataset implementation for ServiceNowObjectDataset. +func (snod ServiceNowObjectDataset) AsQuickBooksObjectDataset() (*QuickBooksObjectDataset, bool) { + return nil, false +} + +// AsPrestoObjectDataset is the BasicDataset implementation for ServiceNowObjectDataset. +func (snod ServiceNowObjectDataset) AsPrestoObjectDataset() (*PrestoObjectDataset, bool) { + return nil, false +} + +// AsPhoenixObjectDataset is the BasicDataset implementation for ServiceNowObjectDataset. +func (snod ServiceNowObjectDataset) AsPhoenixObjectDataset() (*PhoenixObjectDataset, bool) { + return nil, false +} + +// AsPaypalObjectDataset is the BasicDataset implementation for ServiceNowObjectDataset. +func (snod ServiceNowObjectDataset) AsPaypalObjectDataset() (*PaypalObjectDataset, bool) { + return nil, false +} + +// AsMarketoObjectDataset is the BasicDataset implementation for ServiceNowObjectDataset. +func (snod ServiceNowObjectDataset) AsMarketoObjectDataset() (*MarketoObjectDataset, bool) { + return nil, false +} + +// AsMariaDBTableDataset is the BasicDataset implementation for ServiceNowObjectDataset. +func (snod ServiceNowObjectDataset) AsMariaDBTableDataset() (*MariaDBTableDataset, bool) { + return nil, false +} + +// AsMagentoObjectDataset is the BasicDataset implementation for ServiceNowObjectDataset. +func (snod ServiceNowObjectDataset) AsMagentoObjectDataset() (*MagentoObjectDataset, bool) { + return nil, false +} + +// AsJiraObjectDataset is the BasicDataset implementation for ServiceNowObjectDataset. +func (snod ServiceNowObjectDataset) AsJiraObjectDataset() (*JiraObjectDataset, bool) { + return nil, false +} + +// AsImpalaObjectDataset is the BasicDataset implementation for ServiceNowObjectDataset. +func (snod ServiceNowObjectDataset) AsImpalaObjectDataset() (*ImpalaObjectDataset, bool) { + return nil, false +} + +// AsHubspotObjectDataset is the BasicDataset implementation for ServiceNowObjectDataset. +func (snod ServiceNowObjectDataset) AsHubspotObjectDataset() (*HubspotObjectDataset, bool) { + return nil, false +} + +// AsHiveObjectDataset is the BasicDataset implementation for ServiceNowObjectDataset. +func (snod ServiceNowObjectDataset) AsHiveObjectDataset() (*HiveObjectDataset, bool) { + return nil, false +} + +// AsHBaseObjectDataset is the BasicDataset implementation for ServiceNowObjectDataset. +func (snod ServiceNowObjectDataset) AsHBaseObjectDataset() (*HBaseObjectDataset, bool) { + return nil, false +} + +// AsGreenplumTableDataset is the BasicDataset implementation for ServiceNowObjectDataset. +func (snod ServiceNowObjectDataset) AsGreenplumTableDataset() (*GreenplumTableDataset, bool) { + return nil, false +} + +// AsGoogleBigQueryObjectDataset is the BasicDataset implementation for ServiceNowObjectDataset. +func (snod ServiceNowObjectDataset) AsGoogleBigQueryObjectDataset() (*GoogleBigQueryObjectDataset, bool) { + return nil, false +} + +// AsEloquaObjectDataset is the BasicDataset implementation for ServiceNowObjectDataset. +func (snod ServiceNowObjectDataset) AsEloquaObjectDataset() (*EloquaObjectDataset, bool) { + return nil, false +} + +// AsDrillTableDataset is the BasicDataset implementation for ServiceNowObjectDataset. +func (snod ServiceNowObjectDataset) AsDrillTableDataset() (*DrillTableDataset, bool) { + return nil, false +} + +// AsCouchbaseTableDataset is the BasicDataset implementation for ServiceNowObjectDataset. +func (snod ServiceNowObjectDataset) AsCouchbaseTableDataset() (*CouchbaseTableDataset, bool) { + return nil, false +} + +// AsConcurObjectDataset is the BasicDataset implementation for ServiceNowObjectDataset. +func (snod ServiceNowObjectDataset) AsConcurObjectDataset() (*ConcurObjectDataset, bool) { + return nil, false +} + +// AsAzurePostgreSQLTableDataset is the BasicDataset implementation for ServiceNowObjectDataset. +func (snod ServiceNowObjectDataset) AsAzurePostgreSQLTableDataset() (*AzurePostgreSQLTableDataset, bool) { + return nil, false +} + +// AsAmazonMWSObjectDataset is the BasicDataset implementation for ServiceNowObjectDataset. +func (snod ServiceNowObjectDataset) AsAmazonMWSObjectDataset() (*AmazonMWSObjectDataset, bool) { + return nil, false +} + +// AsHTTPDataset is the BasicDataset implementation for ServiceNowObjectDataset. +func (snod ServiceNowObjectDataset) AsHTTPDataset() (*HTTPDataset, bool) { + return nil, false +} + +// AsAzureSearchIndexDataset is the BasicDataset implementation for ServiceNowObjectDataset. +func (snod ServiceNowObjectDataset) AsAzureSearchIndexDataset() (*AzureSearchIndexDataset, bool) { + return nil, false +} + +// AsWebTableDataset is the BasicDataset implementation for ServiceNowObjectDataset. +func (snod ServiceNowObjectDataset) AsWebTableDataset() (*WebTableDataset, bool) { + return nil, false +} + +// AsSQLServerTableDataset is the BasicDataset implementation for ServiceNowObjectDataset. +func (snod ServiceNowObjectDataset) AsSQLServerTableDataset() (*SQLServerTableDataset, bool) { + return nil, false +} + +// AsSapEccResourceDataset is the BasicDataset implementation for ServiceNowObjectDataset. +func (snod ServiceNowObjectDataset) AsSapEccResourceDataset() (*SapEccResourceDataset, bool) { + return nil, false +} + +// AsSapCloudForCustomerResourceDataset is the BasicDataset implementation for ServiceNowObjectDataset. +func (snod ServiceNowObjectDataset) AsSapCloudForCustomerResourceDataset() (*SapCloudForCustomerResourceDataset, bool) { + return nil, false +} + +// AsSalesforceObjectDataset is the BasicDataset implementation for ServiceNowObjectDataset. +func (snod ServiceNowObjectDataset) AsSalesforceObjectDataset() (*SalesforceObjectDataset, bool) { + return nil, false +} + +// AsRelationalTableDataset is the BasicDataset implementation for ServiceNowObjectDataset. +func (snod ServiceNowObjectDataset) AsRelationalTableDataset() (*RelationalTableDataset, bool) { + return nil, false +} + +// AsAzureMySQLTableDataset is the BasicDataset implementation for ServiceNowObjectDataset. +func (snod ServiceNowObjectDataset) AsAzureMySQLTableDataset() (*AzureMySQLTableDataset, bool) { + return nil, false +} + +// AsOracleTableDataset is the BasicDataset implementation for ServiceNowObjectDataset. +func (snod ServiceNowObjectDataset) AsOracleTableDataset() (*OracleTableDataset, bool) { + return nil, false +} + +// AsODataResourceDataset is the BasicDataset implementation for ServiceNowObjectDataset. +func (snod ServiceNowObjectDataset) AsODataResourceDataset() (*ODataResourceDataset, bool) { + return nil, false +} + +// AsMongoDbCollectionDataset is the BasicDataset implementation for ServiceNowObjectDataset. +func (snod ServiceNowObjectDataset) AsMongoDbCollectionDataset() (*MongoDbCollectionDataset, bool) { + return nil, false +} + +// AsFileShareDataset is the BasicDataset implementation for ServiceNowObjectDataset. +func (snod ServiceNowObjectDataset) AsFileShareDataset() (*FileShareDataset, bool) { + return nil, false +} + +// AsAzureDataLakeStoreDataset is the BasicDataset implementation for ServiceNowObjectDataset. +func (snod ServiceNowObjectDataset) AsAzureDataLakeStoreDataset() (*AzureDataLakeStoreDataset, bool) { + return nil, false +} + +// AsDynamicsEntityDataset is the BasicDataset implementation for ServiceNowObjectDataset. +func (snod ServiceNowObjectDataset) AsDynamicsEntityDataset() (*DynamicsEntityDataset, bool) { + return nil, false +} + +// AsDocumentDbCollectionDataset is the BasicDataset implementation for ServiceNowObjectDataset. +func (snod ServiceNowObjectDataset) AsDocumentDbCollectionDataset() (*DocumentDbCollectionDataset, bool) { + return nil, false +} + +// AsCustomDataset is the BasicDataset implementation for ServiceNowObjectDataset. +func (snod ServiceNowObjectDataset) AsCustomDataset() (*CustomDataset, bool) { + return nil, false +} + +// AsCassandraTableDataset is the BasicDataset implementation for ServiceNowObjectDataset. +func (snod ServiceNowObjectDataset) AsCassandraTableDataset() (*CassandraTableDataset, bool) { + return nil, false +} + +// AsAzureSQLDWTableDataset is the BasicDataset implementation for ServiceNowObjectDataset. +func (snod ServiceNowObjectDataset) AsAzureSQLDWTableDataset() (*AzureSQLDWTableDataset, bool) { + return nil, false +} + +// AsAzureSQLTableDataset is the BasicDataset implementation for ServiceNowObjectDataset. +func (snod ServiceNowObjectDataset) AsAzureSQLTableDataset() (*AzureSQLTableDataset, bool) { + return nil, false +} + +// AsAzureTableDataset is the BasicDataset implementation for ServiceNowObjectDataset. +func (snod ServiceNowObjectDataset) AsAzureTableDataset() (*AzureTableDataset, bool) { + return nil, false +} + +// AsAzureBlobDataset is the BasicDataset implementation for ServiceNowObjectDataset. +func (snod ServiceNowObjectDataset) AsAzureBlobDataset() (*AzureBlobDataset, bool) { + return nil, false +} + +// AsAmazonS3Dataset is the BasicDataset implementation for ServiceNowObjectDataset. +func (snod ServiceNowObjectDataset) AsAmazonS3Dataset() (*AmazonS3Dataset, bool) { + return nil, false +} + +// AsDataset is the BasicDataset implementation for ServiceNowObjectDataset. +func (snod ServiceNowObjectDataset) AsDataset() (*Dataset, bool) { + return nil, false +} + +// AsBasicDataset is the BasicDataset implementation for ServiceNowObjectDataset. +func (snod ServiceNowObjectDataset) AsBasicDataset() (BasicDataset, bool) { + return &snod, true +} + +// ServiceNowSource a copy activity ServiceNow server source. +type ServiceNowSource struct { + // Query - A query to retrieve data from source. Type: string (or Expression with resultType string). + Query interface{} `json:"query,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // SourceRetryCount - Source retry count. Type: integer (or Expression with resultType integer). + SourceRetryCount interface{} `json:"sourceRetryCount,omitempty"` + // SourceRetryWait - Source retry wait. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` + // Type - Possible values include: 'TypeCopySource', 'TypeAmazonRedshiftSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeHTTPSource', 'TypeAzureDataLakeStoreSource', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeRelationalSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource' + Type TypeBasicCopySource `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ServiceNowSource. +func (sns ServiceNowSource) MarshalJSON() ([]byte, error) { + sns.Type = TypeServiceNowSource + objectMap := make(map[string]interface{}) + objectMap["query"] = sns.Query + objectMap["sourceRetryCount"] = sns.SourceRetryCount + objectMap["sourceRetryWait"] = sns.SourceRetryWait + if sns.Type != "" { + objectMap["type"] = sns.Type + } + for k, v := range sns.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsAmazonRedshiftSource is the BasicCopySource implementation for ServiceNowSource. +func (sns ServiceNowSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { + return nil, false +} + +// AsResponsysSource is the BasicCopySource implementation for ServiceNowSource. +func (sns ServiceNowSource) AsResponsysSource() (*ResponsysSource, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudSource is the BasicCopySource implementation for ServiceNowSource. +func (sns ServiceNowSource) AsSalesforceMarketingCloudSource() (*SalesforceMarketingCloudSource, bool) { + return nil, false +} + +// AsVerticaSource is the BasicCopySource implementation for ServiceNowSource. +func (sns ServiceNowSource) AsVerticaSource() (*VerticaSource, bool) { + return nil, false +} + +// AsNetezzaSource is the BasicCopySource implementation for ServiceNowSource. +func (sns ServiceNowSource) AsNetezzaSource() (*NetezzaSource, bool) { + return nil, false +} + +// AsZohoSource is the BasicCopySource implementation for ServiceNowSource. +func (sns ServiceNowSource) AsZohoSource() (*ZohoSource, bool) { + return nil, false +} + +// AsXeroSource is the BasicCopySource implementation for ServiceNowSource. +func (sns ServiceNowSource) AsXeroSource() (*XeroSource, bool) { + return nil, false +} + +// AsSquareSource is the BasicCopySource implementation for ServiceNowSource. +func (sns ServiceNowSource) AsSquareSource() (*SquareSource, bool) { + return nil, false +} + +// AsSparkSource is the BasicCopySource implementation for ServiceNowSource. +func (sns ServiceNowSource) AsSparkSource() (*SparkSource, bool) { + return nil, false +} + +// AsShopifySource is the BasicCopySource implementation for ServiceNowSource. +func (sns ServiceNowSource) AsShopifySource() (*ShopifySource, bool) { + return nil, false +} + +// AsServiceNowSource is the BasicCopySource implementation for ServiceNowSource. +func (sns ServiceNowSource) AsServiceNowSource() (*ServiceNowSource, bool) { + return &sns, true +} + +// AsQuickBooksSource is the BasicCopySource implementation for ServiceNowSource. +func (sns ServiceNowSource) AsQuickBooksSource() (*QuickBooksSource, bool) { + return nil, false +} + +// AsPrestoSource is the BasicCopySource implementation for ServiceNowSource. +func (sns ServiceNowSource) AsPrestoSource() (*PrestoSource, bool) { + return nil, false +} + +// AsPhoenixSource is the BasicCopySource implementation for ServiceNowSource. +func (sns ServiceNowSource) AsPhoenixSource() (*PhoenixSource, bool) { + return nil, false +} + +// AsPaypalSource is the BasicCopySource implementation for ServiceNowSource. +func (sns ServiceNowSource) AsPaypalSource() (*PaypalSource, bool) { + return nil, false +} + +// AsMarketoSource is the BasicCopySource implementation for ServiceNowSource. +func (sns ServiceNowSource) AsMarketoSource() (*MarketoSource, bool) { + return nil, false +} + +// AsMariaDBSource is the BasicCopySource implementation for ServiceNowSource. +func (sns ServiceNowSource) AsMariaDBSource() (*MariaDBSource, bool) { + return nil, false +} + +// AsMagentoSource is the BasicCopySource implementation for ServiceNowSource. +func (sns ServiceNowSource) AsMagentoSource() (*MagentoSource, bool) { + return nil, false +} + +// AsJiraSource is the BasicCopySource implementation for ServiceNowSource. +func (sns ServiceNowSource) AsJiraSource() (*JiraSource, bool) { + return nil, false +} + +// AsImpalaSource is the BasicCopySource implementation for ServiceNowSource. +func (sns ServiceNowSource) AsImpalaSource() (*ImpalaSource, bool) { + return nil, false +} + +// AsHubspotSource is the BasicCopySource implementation for ServiceNowSource. +func (sns ServiceNowSource) AsHubspotSource() (*HubspotSource, bool) { + return nil, false +} + +// AsHiveSource is the BasicCopySource implementation for ServiceNowSource. +func (sns ServiceNowSource) AsHiveSource() (*HiveSource, bool) { + return nil, false +} + +// AsHBaseSource is the BasicCopySource implementation for ServiceNowSource. +func (sns ServiceNowSource) AsHBaseSource() (*HBaseSource, bool) { + return nil, false +} + +// AsGreenplumSource is the BasicCopySource implementation for ServiceNowSource. +func (sns ServiceNowSource) AsGreenplumSource() (*GreenplumSource, bool) { + return nil, false +} + +// AsGoogleBigQuerySource is the BasicCopySource implementation for ServiceNowSource. +func (sns ServiceNowSource) AsGoogleBigQuerySource() (*GoogleBigQuerySource, bool) { + return nil, false +} + +// AsEloquaSource is the BasicCopySource implementation for ServiceNowSource. +func (sns ServiceNowSource) AsEloquaSource() (*EloquaSource, bool) { + return nil, false +} + +// AsDrillSource is the BasicCopySource implementation for ServiceNowSource. +func (sns ServiceNowSource) AsDrillSource() (*DrillSource, bool) { + return nil, false +} + +// AsCouchbaseSource is the BasicCopySource implementation for ServiceNowSource. +func (sns ServiceNowSource) AsCouchbaseSource() (*CouchbaseSource, bool) { + return nil, false +} + +// AsConcurSource is the BasicCopySource implementation for ServiceNowSource. +func (sns ServiceNowSource) AsConcurSource() (*ConcurSource, bool) { + return nil, false +} + +// AsAzurePostgreSQLSource is the BasicCopySource implementation for ServiceNowSource. +func (sns ServiceNowSource) AsAzurePostgreSQLSource() (*AzurePostgreSQLSource, bool) { + return nil, false +} + +// AsAmazonMWSSource is the BasicCopySource implementation for ServiceNowSource. +func (sns ServiceNowSource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { + return nil, false +} + +// AsHTTPSource is the BasicCopySource implementation for ServiceNowSource. +func (sns ServiceNowSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for ServiceNowSource. +func (sns ServiceNowSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for ServiceNowSource. +func (sns ServiceNowSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsCassandraSource is the BasicCopySource implementation for ServiceNowSource. +func (sns ServiceNowSource) AsCassandraSource() (*CassandraSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for ServiceNowSource. +func (sns ServiceNowSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for ServiceNowSource. +func (sns ServiceNowSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureMySQLSource is the BasicCopySource implementation for ServiceNowSource. +func (sns ServiceNowSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for ServiceNowSource. +func (sns ServiceNowSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for ServiceNowSource. +func (sns ServiceNowSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsSQLDWSource is the BasicCopySource implementation for ServiceNowSource. +func (sns ServiceNowSource) AsSQLDWSource() (*SQLDWSource, bool) { + return nil, false +} + +// AsSQLSource is the BasicCopySource implementation for ServiceNowSource. +func (sns ServiceNowSource) AsSQLSource() (*SQLSource, bool) { + return nil, false +} + +// AsSapEccSource is the BasicCopySource implementation for ServiceNowSource. +func (sns ServiceNowSource) AsSapEccSource() (*SapEccSource, bool) { + return nil, false +} + +// AsSapCloudForCustomerSource is the BasicCopySource implementation for ServiceNowSource. +func (sns ServiceNowSource) AsSapCloudForCustomerSource() (*SapCloudForCustomerSource, bool) { + return nil, false +} + +// AsSalesforceSource is the BasicCopySource implementation for ServiceNowSource. +func (sns ServiceNowSource) AsSalesforceSource() (*SalesforceSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for ServiceNowSource. +func (sns ServiceNowSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for ServiceNowSource. +func (sns ServiceNowSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for ServiceNowSource. +func (sns ServiceNowSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for ServiceNowSource. +func (sns ServiceNowSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + +// AsAzureTableSource is the BasicCopySource implementation for ServiceNowSource. +func (sns ServiceNowSource) AsAzureTableSource() (*AzureTableSource, bool) { + return nil, false +} + +// AsCopySource is the BasicCopySource implementation for ServiceNowSource. +func (sns ServiceNowSource) AsCopySource() (*CopySource, bool) { + return nil, false +} + +// AsBasicCopySource is the BasicCopySource implementation for ServiceNowSource. +func (sns ServiceNowSource) AsBasicCopySource() (BasicCopySource, bool) { + return &sns, true +} + +// SftpServerLinkedService a linked service for an SSH File Transfer Protocol (SFTP) server. +type SftpServerLinkedService struct { + // SftpServerLinkedServiceTypeProperties - Properties specific to this linked service type. + *SftpServerLinkedServiceTypeProperties `json:"typeProperties,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // ConnectVia - The integration runtime reference. + ConnectVia *IntegrationRuntimeReference `json:"connectVia,omitempty"` + // Description - Linked service description. + Description *string `json:"description,omitempty"` + // Parameters - Parameters for linked service. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeLinkedService', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforce', 'TypeAzureDataLakeStore', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureStorage' + Type TypeBasicLinkedService `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for SftpServerLinkedService. +func (ssls SftpServerLinkedService) MarshalJSON() ([]byte, error) { + ssls.Type = TypeSftp + objectMap := make(map[string]interface{}) + if ssls.SftpServerLinkedServiceTypeProperties != nil { + objectMap["typeProperties"] = ssls.SftpServerLinkedServiceTypeProperties + } + if ssls.ConnectVia != nil { + objectMap["connectVia"] = ssls.ConnectVia + } + if ssls.Description != nil { + objectMap["description"] = ssls.Description + } + if ssls.Parameters != nil { + objectMap["parameters"] = ssls.Parameters + } + if ssls.Annotations != nil { + objectMap["annotations"] = ssls.Annotations + } + if ssls.Type != "" { + objectMap["type"] = ssls.Type + } + for k, v := range ssls.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysLinkedService is the BasicLinkedService implementation for SftpServerLinkedService. +func (ssls SftpServerLinkedService) AsResponsysLinkedService() (*ResponsysLinkedService, bool) { + return nil, false +} + +// AsAzureDatabricksLinkedService is the BasicLinkedService implementation for SftpServerLinkedService. +func (ssls SftpServerLinkedService) AsAzureDatabricksLinkedService() (*AzureDatabricksLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeAnalyticsLinkedService is the BasicLinkedService implementation for SftpServerLinkedService. +func (ssls SftpServerLinkedService) AsAzureDataLakeAnalyticsLinkedService() (*AzureDataLakeAnalyticsLinkedService, bool) { + return nil, false +} + +// AsHDInsightOnDemandLinkedService is the BasicLinkedService implementation for SftpServerLinkedService. +func (ssls SftpServerLinkedService) AsHDInsightOnDemandLinkedService() (*HDInsightOnDemandLinkedService, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudLinkedService is the BasicLinkedService implementation for SftpServerLinkedService. +func (ssls SftpServerLinkedService) AsSalesforceMarketingCloudLinkedService() (*SalesforceMarketingCloudLinkedService, bool) { + return nil, false +} + +// AsNetezzaLinkedService is the BasicLinkedService implementation for SftpServerLinkedService. +func (ssls SftpServerLinkedService) AsNetezzaLinkedService() (*NetezzaLinkedService, bool) { + return nil, false +} + +// AsVerticaLinkedService is the BasicLinkedService implementation for SftpServerLinkedService. +func (ssls SftpServerLinkedService) AsVerticaLinkedService() (*VerticaLinkedService, bool) { + return nil, false +} + +// AsZohoLinkedService is the BasicLinkedService implementation for SftpServerLinkedService. +func (ssls SftpServerLinkedService) AsZohoLinkedService() (*ZohoLinkedService, bool) { + return nil, false +} + +// AsXeroLinkedService is the BasicLinkedService implementation for SftpServerLinkedService. +func (ssls SftpServerLinkedService) AsXeroLinkedService() (*XeroLinkedService, bool) { + return nil, false +} + +// AsSquareLinkedService is the BasicLinkedService implementation for SftpServerLinkedService. +func (ssls SftpServerLinkedService) AsSquareLinkedService() (*SquareLinkedService, bool) { + return nil, false +} + +// AsSparkLinkedService is the BasicLinkedService implementation for SftpServerLinkedService. +func (ssls SftpServerLinkedService) AsSparkLinkedService() (*SparkLinkedService, bool) { + return nil, false +} + +// AsShopifyLinkedService is the BasicLinkedService implementation for SftpServerLinkedService. +func (ssls SftpServerLinkedService) AsShopifyLinkedService() (*ShopifyLinkedService, bool) { + return nil, false +} + +// AsServiceNowLinkedService is the BasicLinkedService implementation for SftpServerLinkedService. +func (ssls SftpServerLinkedService) AsServiceNowLinkedService() (*ServiceNowLinkedService, bool) { + return nil, false +} + +// AsQuickBooksLinkedService is the BasicLinkedService implementation for SftpServerLinkedService. +func (ssls SftpServerLinkedService) AsQuickBooksLinkedService() (*QuickBooksLinkedService, bool) { + return nil, false +} + +// AsPrestoLinkedService is the BasicLinkedService implementation for SftpServerLinkedService. +func (ssls SftpServerLinkedService) AsPrestoLinkedService() (*PrestoLinkedService, bool) { + return nil, false +} + +// AsPhoenixLinkedService is the BasicLinkedService implementation for SftpServerLinkedService. +func (ssls SftpServerLinkedService) AsPhoenixLinkedService() (*PhoenixLinkedService, bool) { + return nil, false +} + +// AsPaypalLinkedService is the BasicLinkedService implementation for SftpServerLinkedService. +func (ssls SftpServerLinkedService) AsPaypalLinkedService() (*PaypalLinkedService, bool) { + return nil, false +} + +// AsMarketoLinkedService is the BasicLinkedService implementation for SftpServerLinkedService. +func (ssls SftpServerLinkedService) AsMarketoLinkedService() (*MarketoLinkedService, bool) { + return nil, false +} + +// AsMariaDBLinkedService is the BasicLinkedService implementation for SftpServerLinkedService. +func (ssls SftpServerLinkedService) AsMariaDBLinkedService() (*MariaDBLinkedService, bool) { + return nil, false +} + +// AsMagentoLinkedService is the BasicLinkedService implementation for SftpServerLinkedService. +func (ssls SftpServerLinkedService) AsMagentoLinkedService() (*MagentoLinkedService, bool) { + return nil, false +} + +// AsJiraLinkedService is the BasicLinkedService implementation for SftpServerLinkedService. +func (ssls SftpServerLinkedService) AsJiraLinkedService() (*JiraLinkedService, bool) { + return nil, false +} + +// AsImpalaLinkedService is the BasicLinkedService implementation for SftpServerLinkedService. +func (ssls SftpServerLinkedService) AsImpalaLinkedService() (*ImpalaLinkedService, bool) { + return nil, false +} + +// AsHubspotLinkedService is the BasicLinkedService implementation for SftpServerLinkedService. +func (ssls SftpServerLinkedService) AsHubspotLinkedService() (*HubspotLinkedService, bool) { + return nil, false +} + +// AsHiveLinkedService is the BasicLinkedService implementation for SftpServerLinkedService. +func (ssls SftpServerLinkedService) AsHiveLinkedService() (*HiveLinkedService, bool) { + return nil, false +} + +// AsHBaseLinkedService is the BasicLinkedService implementation for SftpServerLinkedService. +func (ssls SftpServerLinkedService) AsHBaseLinkedService() (*HBaseLinkedService, bool) { + return nil, false +} + +// AsGreenplumLinkedService is the BasicLinkedService implementation for SftpServerLinkedService. +func (ssls SftpServerLinkedService) AsGreenplumLinkedService() (*GreenplumLinkedService, bool) { + return nil, false +} + +// AsGoogleBigQueryLinkedService is the BasicLinkedService implementation for SftpServerLinkedService. +func (ssls SftpServerLinkedService) AsGoogleBigQueryLinkedService() (*GoogleBigQueryLinkedService, bool) { + return nil, false +} + +// AsEloquaLinkedService is the BasicLinkedService implementation for SftpServerLinkedService. +func (ssls SftpServerLinkedService) AsEloquaLinkedService() (*EloquaLinkedService, bool) { + return nil, false +} + +// AsDrillLinkedService is the BasicLinkedService implementation for SftpServerLinkedService. +func (ssls SftpServerLinkedService) AsDrillLinkedService() (*DrillLinkedService, bool) { + return nil, false +} + +// AsCouchbaseLinkedService is the BasicLinkedService implementation for SftpServerLinkedService. +func (ssls SftpServerLinkedService) AsCouchbaseLinkedService() (*CouchbaseLinkedService, bool) { + return nil, false +} + +// AsConcurLinkedService is the BasicLinkedService implementation for SftpServerLinkedService. +func (ssls SftpServerLinkedService) AsConcurLinkedService() (*ConcurLinkedService, bool) { + return nil, false +} + +// AsAzurePostgreSQLLinkedService is the BasicLinkedService implementation for SftpServerLinkedService. +func (ssls SftpServerLinkedService) AsAzurePostgreSQLLinkedService() (*AzurePostgreSQLLinkedService, bool) { + return nil, false +} + +// AsAmazonMWSLinkedService is the BasicLinkedService implementation for SftpServerLinkedService. +func (ssls SftpServerLinkedService) AsAmazonMWSLinkedService() (*AmazonMWSLinkedService, bool) { + return nil, false +} + +// AsSapHanaLinkedService is the BasicLinkedService implementation for SftpServerLinkedService. +func (ssls SftpServerLinkedService) AsSapHanaLinkedService() (*SapHanaLinkedService, bool) { + return nil, false +} + +// AsSapBWLinkedService is the BasicLinkedService implementation for SftpServerLinkedService. +func (ssls SftpServerLinkedService) AsSapBWLinkedService() (*SapBWLinkedService, bool) { + return nil, false +} + +// AsSftpServerLinkedService is the BasicLinkedService implementation for SftpServerLinkedService. +func (ssls SftpServerLinkedService) AsSftpServerLinkedService() (*SftpServerLinkedService, bool) { + return &ssls, true +} + +// AsFtpServerLinkedService is the BasicLinkedService implementation for SftpServerLinkedService. +func (ssls SftpServerLinkedService) AsFtpServerLinkedService() (*FtpServerLinkedService, bool) { + return nil, false +} + +// AsHTTPLinkedService is the BasicLinkedService implementation for SftpServerLinkedService. +func (ssls SftpServerLinkedService) AsHTTPLinkedService() (*HTTPLinkedService, bool) { + return nil, false +} + +// AsAzureSearchLinkedService is the BasicLinkedService implementation for SftpServerLinkedService. +func (ssls SftpServerLinkedService) AsAzureSearchLinkedService() (*AzureSearchLinkedService, bool) { + return nil, false +} + +// AsCustomDataSourceLinkedService is the BasicLinkedService implementation for SftpServerLinkedService. +func (ssls SftpServerLinkedService) AsCustomDataSourceLinkedService() (*CustomDataSourceLinkedService, bool) { + return nil, false +} + +// AsAmazonRedshiftLinkedService is the BasicLinkedService implementation for SftpServerLinkedService. +func (ssls SftpServerLinkedService) AsAmazonRedshiftLinkedService() (*AmazonRedshiftLinkedService, bool) { + return nil, false +} + +// AsAmazonS3LinkedService is the BasicLinkedService implementation for SftpServerLinkedService. +func (ssls SftpServerLinkedService) AsAmazonS3LinkedService() (*AmazonS3LinkedService, bool) { + return nil, false +} + +// AsSapEccLinkedService is the BasicLinkedService implementation for SftpServerLinkedService. +func (ssls SftpServerLinkedService) AsSapEccLinkedService() (*SapEccLinkedService, bool) { + return nil, false +} + +// AsSapCloudForCustomerLinkedService is the BasicLinkedService implementation for SftpServerLinkedService. +func (ssls SftpServerLinkedService) AsSapCloudForCustomerLinkedService() (*SapCloudForCustomerLinkedService, bool) { + return nil, false +} + +// AsSalesforceLinkedService is the BasicLinkedService implementation for SftpServerLinkedService. +func (ssls SftpServerLinkedService) AsSalesforceLinkedService() (*SalesforceLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeStoreLinkedService is the BasicLinkedService implementation for SftpServerLinkedService. +func (ssls SftpServerLinkedService) AsAzureDataLakeStoreLinkedService() (*AzureDataLakeStoreLinkedService, bool) { + return nil, false +} + +// AsMongoDbLinkedService is the BasicLinkedService implementation for SftpServerLinkedService. +func (ssls SftpServerLinkedService) AsMongoDbLinkedService() (*MongoDbLinkedService, bool) { + return nil, false +} + +// AsCassandraLinkedService is the BasicLinkedService implementation for SftpServerLinkedService. +func (ssls SftpServerLinkedService) AsCassandraLinkedService() (*CassandraLinkedService, bool) { + return nil, false +} + +// AsWebLinkedService is the BasicLinkedService implementation for SftpServerLinkedService. +func (ssls SftpServerLinkedService) AsWebLinkedService() (*WebLinkedService, bool) { + return nil, false +} + +// AsODataLinkedService is the BasicLinkedService implementation for SftpServerLinkedService. +func (ssls SftpServerLinkedService) AsODataLinkedService() (*ODataLinkedService, bool) { + return nil, false +} + +// AsHdfsLinkedService is the BasicLinkedService implementation for SftpServerLinkedService. +func (ssls SftpServerLinkedService) AsHdfsLinkedService() (*HdfsLinkedService, bool) { + return nil, false +} + +// AsOdbcLinkedService is the BasicLinkedService implementation for SftpServerLinkedService. +func (ssls SftpServerLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, bool) { + return nil, false +} + +// AsAzureMLLinkedService is the BasicLinkedService implementation for SftpServerLinkedService. +func (ssls SftpServerLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { + return nil, false +} + +// AsTeradataLinkedService is the BasicLinkedService implementation for SftpServerLinkedService. +func (ssls SftpServerLinkedService) AsTeradataLinkedService() (*TeradataLinkedService, bool) { + return nil, false +} + +// AsDb2LinkedService is the BasicLinkedService implementation for SftpServerLinkedService. +func (ssls SftpServerLinkedService) AsDb2LinkedService() (*Db2LinkedService, bool) { + return nil, false +} + +// AsSybaseLinkedService is the BasicLinkedService implementation for SftpServerLinkedService. +func (ssls SftpServerLinkedService) AsSybaseLinkedService() (*SybaseLinkedService, bool) { + return nil, false +} + +// AsPostgreSQLLinkedService is the BasicLinkedService implementation for SftpServerLinkedService. +func (ssls SftpServerLinkedService) AsPostgreSQLLinkedService() (*PostgreSQLLinkedService, bool) { + return nil, false +} + +// AsMySQLLinkedService is the BasicLinkedService implementation for SftpServerLinkedService. +func (ssls SftpServerLinkedService) AsMySQLLinkedService() (*MySQLLinkedService, bool) { + return nil, false +} + +// AsAzureMySQLLinkedService is the BasicLinkedService implementation for SftpServerLinkedService. +func (ssls SftpServerLinkedService) AsAzureMySQLLinkedService() (*AzureMySQLLinkedService, bool) { + return nil, false +} + +// AsOracleLinkedService is the BasicLinkedService implementation for SftpServerLinkedService. +func (ssls SftpServerLinkedService) AsOracleLinkedService() (*OracleLinkedService, bool) { + return nil, false +} + +// AsFileServerLinkedService is the BasicLinkedService implementation for SftpServerLinkedService. +func (ssls SftpServerLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { + return nil, false +} + +// AsHDInsightLinkedService is the BasicLinkedService implementation for SftpServerLinkedService. +func (ssls SftpServerLinkedService) AsHDInsightLinkedService() (*HDInsightLinkedService, bool) { + return nil, false +} + +// AsDynamicsLinkedService is the BasicLinkedService implementation for SftpServerLinkedService. +func (ssls SftpServerLinkedService) AsDynamicsLinkedService() (*DynamicsLinkedService, bool) { + return nil, false +} + +// AsCosmosDbLinkedService is the BasicLinkedService implementation for SftpServerLinkedService. +func (ssls SftpServerLinkedService) AsCosmosDbLinkedService() (*CosmosDbLinkedService, bool) { + return nil, false +} + +// AsAzureKeyVaultLinkedService is the BasicLinkedService implementation for SftpServerLinkedService. +func (ssls SftpServerLinkedService) AsAzureKeyVaultLinkedService() (*AzureKeyVaultLinkedService, bool) { + return nil, false +} + +// AsAzureBatchLinkedService is the BasicLinkedService implementation for SftpServerLinkedService. +func (ssls SftpServerLinkedService) AsAzureBatchLinkedService() (*AzureBatchLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDatabaseLinkedService is the BasicLinkedService implementation for SftpServerLinkedService. +func (ssls SftpServerLinkedService) AsAzureSQLDatabaseLinkedService() (*AzureSQLDatabaseLinkedService, bool) { + return nil, false +} + +// AsSQLServerLinkedService is the BasicLinkedService implementation for SftpServerLinkedService. +func (ssls SftpServerLinkedService) AsSQLServerLinkedService() (*SQLServerLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDWLinkedService is the BasicLinkedService implementation for SftpServerLinkedService. +func (ssls SftpServerLinkedService) AsAzureSQLDWLinkedService() (*AzureSQLDWLinkedService, bool) { + return nil, false +} + +// AsAzureStorageLinkedService is the BasicLinkedService implementation for SftpServerLinkedService. +func (ssls SftpServerLinkedService) AsAzureStorageLinkedService() (*AzureStorageLinkedService, bool) { + return nil, false +} + +// AsLinkedService is the BasicLinkedService implementation for SftpServerLinkedService. +func (ssls SftpServerLinkedService) AsLinkedService() (*LinkedService, bool) { + return nil, false +} + +// AsBasicLinkedService is the BasicLinkedService implementation for SftpServerLinkedService. +func (ssls SftpServerLinkedService) AsBasicLinkedService() (BasicLinkedService, bool) { + return &ssls, true +} + +// UnmarshalJSON is the custom unmarshaler for SftpServerLinkedService struct. +func (ssls *SftpServerLinkedService) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "typeProperties": + if v != nil { + var sftpServerLinkedServiceTypeProperties SftpServerLinkedServiceTypeProperties + err = json.Unmarshal(*v, &sftpServerLinkedServiceTypeProperties) + if err != nil { + return err + } + ssls.SftpServerLinkedServiceTypeProperties = &sftpServerLinkedServiceTypeProperties + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if ssls.AdditionalProperties == nil { + ssls.AdditionalProperties = make(map[string]interface{}) + } + ssls.AdditionalProperties[k] = additionalProperties + } + case "connectVia": + if v != nil { + var connectVia IntegrationRuntimeReference + err = json.Unmarshal(*v, &connectVia) + if err != nil { + return err + } + ssls.ConnectVia = &connectVia + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + ssls.Description = &description + } + case "parameters": + if v != nil { + var parameters map[string]*ParameterSpecification + err = json.Unmarshal(*v, ¶meters) + if err != nil { + return err + } + ssls.Parameters = parameters + } + case "annotations": + if v != nil { + var annotations []interface{} + err = json.Unmarshal(*v, &annotations) + if err != nil { + return err + } + ssls.Annotations = &annotations + } + case "type": + if v != nil { + var typeVar TypeBasicLinkedService + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ssls.Type = typeVar + } + } + } + + return nil +} + +// SftpServerLinkedServiceTypeProperties properties specific to this linked service type. +type SftpServerLinkedServiceTypeProperties struct { + // Host - The SFTP server host name. Type: string (or Expression with resultType string). + Host interface{} `json:"host,omitempty"` + // Port - The TCP port number that the SFTP server uses to listen for client connections. Default value is 22. Type: integer (or Expression with resultType integer), minimum: 0. + Port interface{} `json:"port,omitempty"` + // AuthenticationType - The authentication type to be used to connect to the FTP server. Possible values include: 'SftpAuthenticationTypeBasic', 'SftpAuthenticationTypeSSHPublicKey' + AuthenticationType SftpAuthenticationType `json:"authenticationType,omitempty"` + // UserName - The username used to log on to the SFTP server. Type: string (or Expression with resultType string). + UserName interface{} `json:"userName,omitempty"` + // Password - Password to logon the SFTP server for Basic authentication. + Password BasicSecretBase `json:"password,omitempty"` + // EncryptedCredential - The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string). + EncryptedCredential interface{} `json:"encryptedCredential,omitempty"` + // PrivateKeyPath - The SSH private key file path for SshPublicKey authentication. Only valid for on-premises copy. For on-premises copy with SshPublicKey authentication, either PrivateKeyPath or PrivateKeyContent should be specified. SSH private key should be OpenSSH format. Type: string (or Expression with resultType string). + PrivateKeyPath interface{} `json:"privateKeyPath,omitempty"` + // PrivateKeyContent - Base64 encoded SSH private key content for SshPublicKey authentication. For on-premises copy with SshPublicKey authentication, either PrivateKeyPath or PrivateKeyContent should be specified. SSH private key should be OpenSSH format. + PrivateKeyContent BasicSecretBase `json:"privateKeyContent,omitempty"` + // PassPhrase - The password to decrypt the SSH private key if the SSH private key is encrypted. + PassPhrase BasicSecretBase `json:"passPhrase,omitempty"` + // SkipHostKeyValidation - If true, skip the SSH host key validation. Default value is false. Type: boolean (or Expression with resultType boolean). + SkipHostKeyValidation interface{} `json:"skipHostKeyValidation,omitempty"` + // HostKeyFingerprint - The host key finger-print of the SFTP server. When SkipHostKeyValidation is false, HostKeyFingerprint should be specified. Type: string (or Expression with resultType string). + HostKeyFingerprint interface{} `json:"hostKeyFingerprint,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for SftpServerLinkedServiceTypeProperties struct. +func (sslstp *SftpServerLinkedServiceTypeProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "host": + if v != nil { + var host interface{} + err = json.Unmarshal(*v, &host) + if err != nil { + return err + } + sslstp.Host = host + } + case "port": + if v != nil { + var port interface{} + err = json.Unmarshal(*v, &port) + if err != nil { + return err + } + sslstp.Port = port + } + case "authenticationType": + if v != nil { + var authenticationType SftpAuthenticationType + err = json.Unmarshal(*v, &authenticationType) + if err != nil { + return err + } + sslstp.AuthenticationType = authenticationType + } + case "userName": + if v != nil { + var userName interface{} + err = json.Unmarshal(*v, &userName) + if err != nil { + return err + } + sslstp.UserName = userName + } + case "password": + if v != nil { + password, err := unmarshalBasicSecretBase(*v) + if err != nil { + return err + } + sslstp.Password = password + } + case "encryptedCredential": + if v != nil { + var encryptedCredential interface{} + err = json.Unmarshal(*v, &encryptedCredential) + if err != nil { + return err + } + sslstp.EncryptedCredential = encryptedCredential + } + case "privateKeyPath": + if v != nil { + var privateKeyPath interface{} + err = json.Unmarshal(*v, &privateKeyPath) + if err != nil { + return err + } + sslstp.PrivateKeyPath = privateKeyPath + } + case "privateKeyContent": + if v != nil { + privateKeyContent, err := unmarshalBasicSecretBase(*v) + if err != nil { + return err + } + sslstp.PrivateKeyContent = privateKeyContent + } + case "passPhrase": + if v != nil { + passPhrase, err := unmarshalBasicSecretBase(*v) + if err != nil { + return err + } + sslstp.PassPhrase = passPhrase + } + case "skipHostKeyValidation": + if v != nil { + var skipHostKeyValidation interface{} + err = json.Unmarshal(*v, &skipHostKeyValidation) + if err != nil { + return err + } + sslstp.SkipHostKeyValidation = skipHostKeyValidation + } + case "hostKeyFingerprint": + if v != nil { + var hostKeyFingerprint interface{} + err = json.Unmarshal(*v, &hostKeyFingerprint) + if err != nil { + return err + } + sslstp.HostKeyFingerprint = hostKeyFingerprint + } + } + } + + return nil +} + +// ShopifyLinkedService shopify Serivce linked service. +type ShopifyLinkedService struct { + // ShopifyLinkedServiceTypeProperties - Shopify Serivce linked service properties. + *ShopifyLinkedServiceTypeProperties `json:"typeProperties,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // ConnectVia - The integration runtime reference. + ConnectVia *IntegrationRuntimeReference `json:"connectVia,omitempty"` + // Description - Linked service description. + Description *string `json:"description,omitempty"` + // Parameters - Parameters for linked service. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeLinkedService', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforce', 'TypeAzureDataLakeStore', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureStorage' + Type TypeBasicLinkedService `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ShopifyLinkedService. +func (sls ShopifyLinkedService) MarshalJSON() ([]byte, error) { + sls.Type = TypeShopify + objectMap := make(map[string]interface{}) + if sls.ShopifyLinkedServiceTypeProperties != nil { + objectMap["typeProperties"] = sls.ShopifyLinkedServiceTypeProperties + } + if sls.ConnectVia != nil { + objectMap["connectVia"] = sls.ConnectVia + } + if sls.Description != nil { + objectMap["description"] = sls.Description + } + if sls.Parameters != nil { + objectMap["parameters"] = sls.Parameters + } + if sls.Annotations != nil { + objectMap["annotations"] = sls.Annotations + } + if sls.Type != "" { + objectMap["type"] = sls.Type + } + for k, v := range sls.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysLinkedService is the BasicLinkedService implementation for ShopifyLinkedService. +func (sls ShopifyLinkedService) AsResponsysLinkedService() (*ResponsysLinkedService, bool) { + return nil, false +} + +// AsAzureDatabricksLinkedService is the BasicLinkedService implementation for ShopifyLinkedService. +func (sls ShopifyLinkedService) AsAzureDatabricksLinkedService() (*AzureDatabricksLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeAnalyticsLinkedService is the BasicLinkedService implementation for ShopifyLinkedService. +func (sls ShopifyLinkedService) AsAzureDataLakeAnalyticsLinkedService() (*AzureDataLakeAnalyticsLinkedService, bool) { + return nil, false +} + +// AsHDInsightOnDemandLinkedService is the BasicLinkedService implementation for ShopifyLinkedService. +func (sls ShopifyLinkedService) AsHDInsightOnDemandLinkedService() (*HDInsightOnDemandLinkedService, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudLinkedService is the BasicLinkedService implementation for ShopifyLinkedService. +func (sls ShopifyLinkedService) AsSalesforceMarketingCloudLinkedService() (*SalesforceMarketingCloudLinkedService, bool) { + return nil, false +} + +// AsNetezzaLinkedService is the BasicLinkedService implementation for ShopifyLinkedService. +func (sls ShopifyLinkedService) AsNetezzaLinkedService() (*NetezzaLinkedService, bool) { + return nil, false +} + +// AsVerticaLinkedService is the BasicLinkedService implementation for ShopifyLinkedService. +func (sls ShopifyLinkedService) AsVerticaLinkedService() (*VerticaLinkedService, bool) { + return nil, false +} + +// AsZohoLinkedService is the BasicLinkedService implementation for ShopifyLinkedService. +func (sls ShopifyLinkedService) AsZohoLinkedService() (*ZohoLinkedService, bool) { + return nil, false +} + +// AsXeroLinkedService is the BasicLinkedService implementation for ShopifyLinkedService. +func (sls ShopifyLinkedService) AsXeroLinkedService() (*XeroLinkedService, bool) { + return nil, false +} + +// AsSquareLinkedService is the BasicLinkedService implementation for ShopifyLinkedService. +func (sls ShopifyLinkedService) AsSquareLinkedService() (*SquareLinkedService, bool) { + return nil, false +} + +// AsSparkLinkedService is the BasicLinkedService implementation for ShopifyLinkedService. +func (sls ShopifyLinkedService) AsSparkLinkedService() (*SparkLinkedService, bool) { + return nil, false +} + +// AsShopifyLinkedService is the BasicLinkedService implementation for ShopifyLinkedService. +func (sls ShopifyLinkedService) AsShopifyLinkedService() (*ShopifyLinkedService, bool) { + return &sls, true +} + +// AsServiceNowLinkedService is the BasicLinkedService implementation for ShopifyLinkedService. +func (sls ShopifyLinkedService) AsServiceNowLinkedService() (*ServiceNowLinkedService, bool) { + return nil, false +} + +// AsQuickBooksLinkedService is the BasicLinkedService implementation for ShopifyLinkedService. +func (sls ShopifyLinkedService) AsQuickBooksLinkedService() (*QuickBooksLinkedService, bool) { + return nil, false +} + +// AsPrestoLinkedService is the BasicLinkedService implementation for ShopifyLinkedService. +func (sls ShopifyLinkedService) AsPrestoLinkedService() (*PrestoLinkedService, bool) { + return nil, false +} + +// AsPhoenixLinkedService is the BasicLinkedService implementation for ShopifyLinkedService. +func (sls ShopifyLinkedService) AsPhoenixLinkedService() (*PhoenixLinkedService, bool) { + return nil, false +} + +// AsPaypalLinkedService is the BasicLinkedService implementation for ShopifyLinkedService. +func (sls ShopifyLinkedService) AsPaypalLinkedService() (*PaypalLinkedService, bool) { + return nil, false +} + +// AsMarketoLinkedService is the BasicLinkedService implementation for ShopifyLinkedService. +func (sls ShopifyLinkedService) AsMarketoLinkedService() (*MarketoLinkedService, bool) { + return nil, false +} + +// AsMariaDBLinkedService is the BasicLinkedService implementation for ShopifyLinkedService. +func (sls ShopifyLinkedService) AsMariaDBLinkedService() (*MariaDBLinkedService, bool) { + return nil, false +} + +// AsMagentoLinkedService is the BasicLinkedService implementation for ShopifyLinkedService. +func (sls ShopifyLinkedService) AsMagentoLinkedService() (*MagentoLinkedService, bool) { + return nil, false +} + +// AsJiraLinkedService is the BasicLinkedService implementation for ShopifyLinkedService. +func (sls ShopifyLinkedService) AsJiraLinkedService() (*JiraLinkedService, bool) { + return nil, false +} + +// AsImpalaLinkedService is the BasicLinkedService implementation for ShopifyLinkedService. +func (sls ShopifyLinkedService) AsImpalaLinkedService() (*ImpalaLinkedService, bool) { + return nil, false +} + +// AsHubspotLinkedService is the BasicLinkedService implementation for ShopifyLinkedService. +func (sls ShopifyLinkedService) AsHubspotLinkedService() (*HubspotLinkedService, bool) { + return nil, false +} + +// AsHiveLinkedService is the BasicLinkedService implementation for ShopifyLinkedService. +func (sls ShopifyLinkedService) AsHiveLinkedService() (*HiveLinkedService, bool) { + return nil, false +} + +// AsHBaseLinkedService is the BasicLinkedService implementation for ShopifyLinkedService. +func (sls ShopifyLinkedService) AsHBaseLinkedService() (*HBaseLinkedService, bool) { + return nil, false +} + +// AsGreenplumLinkedService is the BasicLinkedService implementation for ShopifyLinkedService. +func (sls ShopifyLinkedService) AsGreenplumLinkedService() (*GreenplumLinkedService, bool) { + return nil, false +} + +// AsGoogleBigQueryLinkedService is the BasicLinkedService implementation for ShopifyLinkedService. +func (sls ShopifyLinkedService) AsGoogleBigQueryLinkedService() (*GoogleBigQueryLinkedService, bool) { + return nil, false +} + +// AsEloquaLinkedService is the BasicLinkedService implementation for ShopifyLinkedService. +func (sls ShopifyLinkedService) AsEloquaLinkedService() (*EloquaLinkedService, bool) { + return nil, false +} + +// AsDrillLinkedService is the BasicLinkedService implementation for ShopifyLinkedService. +func (sls ShopifyLinkedService) AsDrillLinkedService() (*DrillLinkedService, bool) { + return nil, false +} + +// AsCouchbaseLinkedService is the BasicLinkedService implementation for ShopifyLinkedService. +func (sls ShopifyLinkedService) AsCouchbaseLinkedService() (*CouchbaseLinkedService, bool) { + return nil, false +} + +// AsConcurLinkedService is the BasicLinkedService implementation for ShopifyLinkedService. +func (sls ShopifyLinkedService) AsConcurLinkedService() (*ConcurLinkedService, bool) { + return nil, false +} + +// AsAzurePostgreSQLLinkedService is the BasicLinkedService implementation for ShopifyLinkedService. +func (sls ShopifyLinkedService) AsAzurePostgreSQLLinkedService() (*AzurePostgreSQLLinkedService, bool) { + return nil, false +} + +// AsAmazonMWSLinkedService is the BasicLinkedService implementation for ShopifyLinkedService. +func (sls ShopifyLinkedService) AsAmazonMWSLinkedService() (*AmazonMWSLinkedService, bool) { + return nil, false +} + +// AsSapHanaLinkedService is the BasicLinkedService implementation for ShopifyLinkedService. +func (sls ShopifyLinkedService) AsSapHanaLinkedService() (*SapHanaLinkedService, bool) { + return nil, false +} + +// AsSapBWLinkedService is the BasicLinkedService implementation for ShopifyLinkedService. +func (sls ShopifyLinkedService) AsSapBWLinkedService() (*SapBWLinkedService, bool) { + return nil, false +} + +// AsSftpServerLinkedService is the BasicLinkedService implementation for ShopifyLinkedService. +func (sls ShopifyLinkedService) AsSftpServerLinkedService() (*SftpServerLinkedService, bool) { + return nil, false +} + +// AsFtpServerLinkedService is the BasicLinkedService implementation for ShopifyLinkedService. +func (sls ShopifyLinkedService) AsFtpServerLinkedService() (*FtpServerLinkedService, bool) { + return nil, false +} + +// AsHTTPLinkedService is the BasicLinkedService implementation for ShopifyLinkedService. +func (sls ShopifyLinkedService) AsHTTPLinkedService() (*HTTPLinkedService, bool) { + return nil, false +} + +// AsAzureSearchLinkedService is the BasicLinkedService implementation for ShopifyLinkedService. +func (sls ShopifyLinkedService) AsAzureSearchLinkedService() (*AzureSearchLinkedService, bool) { + return nil, false +} + +// AsCustomDataSourceLinkedService is the BasicLinkedService implementation for ShopifyLinkedService. +func (sls ShopifyLinkedService) AsCustomDataSourceLinkedService() (*CustomDataSourceLinkedService, bool) { + return nil, false +} + +// AsAmazonRedshiftLinkedService is the BasicLinkedService implementation for ShopifyLinkedService. +func (sls ShopifyLinkedService) AsAmazonRedshiftLinkedService() (*AmazonRedshiftLinkedService, bool) { + return nil, false +} + +// AsAmazonS3LinkedService is the BasicLinkedService implementation for ShopifyLinkedService. +func (sls ShopifyLinkedService) AsAmazonS3LinkedService() (*AmazonS3LinkedService, bool) { + return nil, false +} + +// AsSapEccLinkedService is the BasicLinkedService implementation for ShopifyLinkedService. +func (sls ShopifyLinkedService) AsSapEccLinkedService() (*SapEccLinkedService, bool) { + return nil, false +} + +// AsSapCloudForCustomerLinkedService is the BasicLinkedService implementation for ShopifyLinkedService. +func (sls ShopifyLinkedService) AsSapCloudForCustomerLinkedService() (*SapCloudForCustomerLinkedService, bool) { + return nil, false +} + +// AsSalesforceLinkedService is the BasicLinkedService implementation for ShopifyLinkedService. +func (sls ShopifyLinkedService) AsSalesforceLinkedService() (*SalesforceLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeStoreLinkedService is the BasicLinkedService implementation for ShopifyLinkedService. +func (sls ShopifyLinkedService) AsAzureDataLakeStoreLinkedService() (*AzureDataLakeStoreLinkedService, bool) { + return nil, false +} + +// AsMongoDbLinkedService is the BasicLinkedService implementation for ShopifyLinkedService. +func (sls ShopifyLinkedService) AsMongoDbLinkedService() (*MongoDbLinkedService, bool) { + return nil, false +} + +// AsCassandraLinkedService is the BasicLinkedService implementation for ShopifyLinkedService. +func (sls ShopifyLinkedService) AsCassandraLinkedService() (*CassandraLinkedService, bool) { + return nil, false +} + +// AsWebLinkedService is the BasicLinkedService implementation for ShopifyLinkedService. +func (sls ShopifyLinkedService) AsWebLinkedService() (*WebLinkedService, bool) { + return nil, false +} + +// AsODataLinkedService is the BasicLinkedService implementation for ShopifyLinkedService. +func (sls ShopifyLinkedService) AsODataLinkedService() (*ODataLinkedService, bool) { + return nil, false +} + +// AsHdfsLinkedService is the BasicLinkedService implementation for ShopifyLinkedService. +func (sls ShopifyLinkedService) AsHdfsLinkedService() (*HdfsLinkedService, bool) { + return nil, false +} + +// AsOdbcLinkedService is the BasicLinkedService implementation for ShopifyLinkedService. +func (sls ShopifyLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, bool) { + return nil, false +} + +// AsAzureMLLinkedService is the BasicLinkedService implementation for ShopifyLinkedService. +func (sls ShopifyLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { + return nil, false +} + +// AsTeradataLinkedService is the BasicLinkedService implementation for ShopifyLinkedService. +func (sls ShopifyLinkedService) AsTeradataLinkedService() (*TeradataLinkedService, bool) { + return nil, false +} + +// AsDb2LinkedService is the BasicLinkedService implementation for ShopifyLinkedService. +func (sls ShopifyLinkedService) AsDb2LinkedService() (*Db2LinkedService, bool) { + return nil, false +} + +// AsSybaseLinkedService is the BasicLinkedService implementation for ShopifyLinkedService. +func (sls ShopifyLinkedService) AsSybaseLinkedService() (*SybaseLinkedService, bool) { + return nil, false +} + +// AsPostgreSQLLinkedService is the BasicLinkedService implementation for ShopifyLinkedService. +func (sls ShopifyLinkedService) AsPostgreSQLLinkedService() (*PostgreSQLLinkedService, bool) { + return nil, false +} + +// AsMySQLLinkedService is the BasicLinkedService implementation for ShopifyLinkedService. +func (sls ShopifyLinkedService) AsMySQLLinkedService() (*MySQLLinkedService, bool) { + return nil, false +} + +// AsAzureMySQLLinkedService is the BasicLinkedService implementation for ShopifyLinkedService. +func (sls ShopifyLinkedService) AsAzureMySQLLinkedService() (*AzureMySQLLinkedService, bool) { + return nil, false +} + +// AsOracleLinkedService is the BasicLinkedService implementation for ShopifyLinkedService. +func (sls ShopifyLinkedService) AsOracleLinkedService() (*OracleLinkedService, bool) { + return nil, false +} + +// AsFileServerLinkedService is the BasicLinkedService implementation for ShopifyLinkedService. +func (sls ShopifyLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { + return nil, false +} + +// AsHDInsightLinkedService is the BasicLinkedService implementation for ShopifyLinkedService. +func (sls ShopifyLinkedService) AsHDInsightLinkedService() (*HDInsightLinkedService, bool) { + return nil, false +} + +// AsDynamicsLinkedService is the BasicLinkedService implementation for ShopifyLinkedService. +func (sls ShopifyLinkedService) AsDynamicsLinkedService() (*DynamicsLinkedService, bool) { + return nil, false +} + +// AsCosmosDbLinkedService is the BasicLinkedService implementation for ShopifyLinkedService. +func (sls ShopifyLinkedService) AsCosmosDbLinkedService() (*CosmosDbLinkedService, bool) { + return nil, false +} + +// AsAzureKeyVaultLinkedService is the BasicLinkedService implementation for ShopifyLinkedService. +func (sls ShopifyLinkedService) AsAzureKeyVaultLinkedService() (*AzureKeyVaultLinkedService, bool) { + return nil, false +} + +// AsAzureBatchLinkedService is the BasicLinkedService implementation for ShopifyLinkedService. +func (sls ShopifyLinkedService) AsAzureBatchLinkedService() (*AzureBatchLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDatabaseLinkedService is the BasicLinkedService implementation for ShopifyLinkedService. +func (sls ShopifyLinkedService) AsAzureSQLDatabaseLinkedService() (*AzureSQLDatabaseLinkedService, bool) { + return nil, false +} + +// AsSQLServerLinkedService is the BasicLinkedService implementation for ShopifyLinkedService. +func (sls ShopifyLinkedService) AsSQLServerLinkedService() (*SQLServerLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDWLinkedService is the BasicLinkedService implementation for ShopifyLinkedService. +func (sls ShopifyLinkedService) AsAzureSQLDWLinkedService() (*AzureSQLDWLinkedService, bool) { + return nil, false +} + +// AsAzureStorageLinkedService is the BasicLinkedService implementation for ShopifyLinkedService. +func (sls ShopifyLinkedService) AsAzureStorageLinkedService() (*AzureStorageLinkedService, bool) { + return nil, false +} + +// AsLinkedService is the BasicLinkedService implementation for ShopifyLinkedService. +func (sls ShopifyLinkedService) AsLinkedService() (*LinkedService, bool) { + return nil, false +} + +// AsBasicLinkedService is the BasicLinkedService implementation for ShopifyLinkedService. +func (sls ShopifyLinkedService) AsBasicLinkedService() (BasicLinkedService, bool) { + return &sls, true +} + +// UnmarshalJSON is the custom unmarshaler for ShopifyLinkedService struct. +func (sls *ShopifyLinkedService) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "typeProperties": + if v != nil { + var shopifyLinkedServiceTypeProperties ShopifyLinkedServiceTypeProperties + err = json.Unmarshal(*v, &shopifyLinkedServiceTypeProperties) + if err != nil { + return err + } + sls.ShopifyLinkedServiceTypeProperties = &shopifyLinkedServiceTypeProperties + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if sls.AdditionalProperties == nil { + sls.AdditionalProperties = make(map[string]interface{}) + } + sls.AdditionalProperties[k] = additionalProperties + } + case "connectVia": + if v != nil { + var connectVia IntegrationRuntimeReference + err = json.Unmarshal(*v, &connectVia) + if err != nil { + return err + } + sls.ConnectVia = &connectVia + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + sls.Description = &description + } + case "parameters": + if v != nil { + var parameters map[string]*ParameterSpecification + err = json.Unmarshal(*v, ¶meters) + if err != nil { + return err + } + sls.Parameters = parameters + } + case "annotations": + if v != nil { + var annotations []interface{} + err = json.Unmarshal(*v, &annotations) + if err != nil { + return err + } + sls.Annotations = &annotations + } + case "type": + if v != nil { + var typeVar TypeBasicLinkedService + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + sls.Type = typeVar + } + } + } + + return nil +} + +// ShopifyLinkedServiceTypeProperties shopify Serivce linked service properties. +type ShopifyLinkedServiceTypeProperties struct { + // Host - The endpoint of the Shopify server. (i.e. mystore.myshopify.com) + Host interface{} `json:"host,omitempty"` + // AccessToken - The API access token that can be used to access Shopify’s data. The token won't expire if it is offline mode. + AccessToken BasicSecretBase `json:"accessToken,omitempty"` + // UseEncryptedEndpoints - Specifies whether the data source endpoints are encrypted using HTTPS. The default value is true. + UseEncryptedEndpoints interface{} `json:"useEncryptedEndpoints,omitempty"` + // UseHostVerification - Specifies whether to require the host name in the server's certificate to match the host name of the server when connecting over SSL. The default value is true. + UseHostVerification interface{} `json:"useHostVerification,omitempty"` + // UsePeerVerification - Specifies whether to verify the identity of the server when connecting over SSL. The default value is true. + UsePeerVerification interface{} `json:"usePeerVerification,omitempty"` + // EncryptedCredential - The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string). + EncryptedCredential interface{} `json:"encryptedCredential,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for ShopifyLinkedServiceTypeProperties struct. +func (slstp *ShopifyLinkedServiceTypeProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "host": + if v != nil { + var host interface{} + err = json.Unmarshal(*v, &host) + if err != nil { + return err + } + slstp.Host = host + } + case "accessToken": + if v != nil { + accessToken, err := unmarshalBasicSecretBase(*v) + if err != nil { + return err + } + slstp.AccessToken = accessToken + } + case "useEncryptedEndpoints": + if v != nil { + var useEncryptedEndpoints interface{} + err = json.Unmarshal(*v, &useEncryptedEndpoints) + if err != nil { + return err + } + slstp.UseEncryptedEndpoints = useEncryptedEndpoints + } + case "useHostVerification": + if v != nil { + var useHostVerification interface{} + err = json.Unmarshal(*v, &useHostVerification) + if err != nil { + return err + } + slstp.UseHostVerification = useHostVerification + } + case "usePeerVerification": + if v != nil { + var usePeerVerification interface{} + err = json.Unmarshal(*v, &usePeerVerification) + if err != nil { + return err + } + slstp.UsePeerVerification = usePeerVerification + } + case "encryptedCredential": + if v != nil { + var encryptedCredential interface{} + err = json.Unmarshal(*v, &encryptedCredential) + if err != nil { + return err + } + slstp.EncryptedCredential = encryptedCredential + } + } + } + + return nil +} + +// ShopifyObjectDataset shopify Serivce dataset. +type ShopifyObjectDataset struct { + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Description - Dataset description. + Description *string `json:"description,omitempty"` + // Structure - Columns that define the structure of the dataset. Type: array (or Expression with resultType array), itemType: DatasetDataElement. + Structure interface{} `json:"structure,omitempty"` + // LinkedServiceName - Linked service reference. + LinkedServiceName *LinkedServiceReference `json:"linkedServiceName,omitempty"` + // Parameters - Parameters for dataset. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeDataset', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSQLServerTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSalesforceObject', 'TypeRelationalTable', 'TypeAzureMySQLTable', 'TypeOracleTable', 'TypeODataResource', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeAzureDataLakeStoreFile', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeAmazonS3Object' + Type TypeBasicDataset `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ShopifyObjectDataset. +func (sod ShopifyObjectDataset) MarshalJSON() ([]byte, error) { + sod.Type = TypeShopifyObject + objectMap := make(map[string]interface{}) + if sod.Description != nil { + objectMap["description"] = sod.Description + } + objectMap["structure"] = sod.Structure + if sod.LinkedServiceName != nil { + objectMap["linkedServiceName"] = sod.LinkedServiceName + } + if sod.Parameters != nil { + objectMap["parameters"] = sod.Parameters + } + if sod.Annotations != nil { + objectMap["annotations"] = sod.Annotations + } + if sod.Type != "" { + objectMap["type"] = sod.Type + } + for k, v := range sod.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysObjectDataset is the BasicDataset implementation for ShopifyObjectDataset. +func (sod ShopifyObjectDataset) AsResponsysObjectDataset() (*ResponsysObjectDataset, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudObjectDataset is the BasicDataset implementation for ShopifyObjectDataset. +func (sod ShopifyObjectDataset) AsSalesforceMarketingCloudObjectDataset() (*SalesforceMarketingCloudObjectDataset, bool) { + return nil, false +} + +// AsVerticaTableDataset is the BasicDataset implementation for ShopifyObjectDataset. +func (sod ShopifyObjectDataset) AsVerticaTableDataset() (*VerticaTableDataset, bool) { + return nil, false +} + +// AsNetezzaTableDataset is the BasicDataset implementation for ShopifyObjectDataset. +func (sod ShopifyObjectDataset) AsNetezzaTableDataset() (*NetezzaTableDataset, bool) { + return nil, false +} + +// AsZohoObjectDataset is the BasicDataset implementation for ShopifyObjectDataset. +func (sod ShopifyObjectDataset) AsZohoObjectDataset() (*ZohoObjectDataset, bool) { + return nil, false +} + +// AsXeroObjectDataset is the BasicDataset implementation for ShopifyObjectDataset. +func (sod ShopifyObjectDataset) AsXeroObjectDataset() (*XeroObjectDataset, bool) { + return nil, false +} + +// AsSquareObjectDataset is the BasicDataset implementation for ShopifyObjectDataset. +func (sod ShopifyObjectDataset) AsSquareObjectDataset() (*SquareObjectDataset, bool) { + return nil, false +} + +// AsSparkObjectDataset is the BasicDataset implementation for ShopifyObjectDataset. +func (sod ShopifyObjectDataset) AsSparkObjectDataset() (*SparkObjectDataset, bool) { + return nil, false +} + +// AsShopifyObjectDataset is the BasicDataset implementation for ShopifyObjectDataset. +func (sod ShopifyObjectDataset) AsShopifyObjectDataset() (*ShopifyObjectDataset, bool) { + return &sod, true +} + +// AsServiceNowObjectDataset is the BasicDataset implementation for ShopifyObjectDataset. +func (sod ShopifyObjectDataset) AsServiceNowObjectDataset() (*ServiceNowObjectDataset, bool) { + return nil, false +} + +// AsQuickBooksObjectDataset is the BasicDataset implementation for ShopifyObjectDataset. +func (sod ShopifyObjectDataset) AsQuickBooksObjectDataset() (*QuickBooksObjectDataset, bool) { + return nil, false +} + +// AsPrestoObjectDataset is the BasicDataset implementation for ShopifyObjectDataset. +func (sod ShopifyObjectDataset) AsPrestoObjectDataset() (*PrestoObjectDataset, bool) { + return nil, false +} + +// AsPhoenixObjectDataset is the BasicDataset implementation for ShopifyObjectDataset. +func (sod ShopifyObjectDataset) AsPhoenixObjectDataset() (*PhoenixObjectDataset, bool) { + return nil, false +} + +// AsPaypalObjectDataset is the BasicDataset implementation for ShopifyObjectDataset. +func (sod ShopifyObjectDataset) AsPaypalObjectDataset() (*PaypalObjectDataset, bool) { + return nil, false +} + +// AsMarketoObjectDataset is the BasicDataset implementation for ShopifyObjectDataset. +func (sod ShopifyObjectDataset) AsMarketoObjectDataset() (*MarketoObjectDataset, bool) { + return nil, false +} + +// AsMariaDBTableDataset is the BasicDataset implementation for ShopifyObjectDataset. +func (sod ShopifyObjectDataset) AsMariaDBTableDataset() (*MariaDBTableDataset, bool) { + return nil, false +} + +// AsMagentoObjectDataset is the BasicDataset implementation for ShopifyObjectDataset. +func (sod ShopifyObjectDataset) AsMagentoObjectDataset() (*MagentoObjectDataset, bool) { + return nil, false +} + +// AsJiraObjectDataset is the BasicDataset implementation for ShopifyObjectDataset. +func (sod ShopifyObjectDataset) AsJiraObjectDataset() (*JiraObjectDataset, bool) { + return nil, false +} + +// AsImpalaObjectDataset is the BasicDataset implementation for ShopifyObjectDataset. +func (sod ShopifyObjectDataset) AsImpalaObjectDataset() (*ImpalaObjectDataset, bool) { + return nil, false +} + +// AsHubspotObjectDataset is the BasicDataset implementation for ShopifyObjectDataset. +func (sod ShopifyObjectDataset) AsHubspotObjectDataset() (*HubspotObjectDataset, bool) { + return nil, false +} + +// AsHiveObjectDataset is the BasicDataset implementation for ShopifyObjectDataset. +func (sod ShopifyObjectDataset) AsHiveObjectDataset() (*HiveObjectDataset, bool) { + return nil, false +} + +// AsHBaseObjectDataset is the BasicDataset implementation for ShopifyObjectDataset. +func (sod ShopifyObjectDataset) AsHBaseObjectDataset() (*HBaseObjectDataset, bool) { + return nil, false +} + +// AsGreenplumTableDataset is the BasicDataset implementation for ShopifyObjectDataset. +func (sod ShopifyObjectDataset) AsGreenplumTableDataset() (*GreenplumTableDataset, bool) { + return nil, false +} + +// AsGoogleBigQueryObjectDataset is the BasicDataset implementation for ShopifyObjectDataset. +func (sod ShopifyObjectDataset) AsGoogleBigQueryObjectDataset() (*GoogleBigQueryObjectDataset, bool) { + return nil, false +} + +// AsEloquaObjectDataset is the BasicDataset implementation for ShopifyObjectDataset. +func (sod ShopifyObjectDataset) AsEloquaObjectDataset() (*EloquaObjectDataset, bool) { + return nil, false +} + +// AsDrillTableDataset is the BasicDataset implementation for ShopifyObjectDataset. +func (sod ShopifyObjectDataset) AsDrillTableDataset() (*DrillTableDataset, bool) { + return nil, false +} + +// AsCouchbaseTableDataset is the BasicDataset implementation for ShopifyObjectDataset. +func (sod ShopifyObjectDataset) AsCouchbaseTableDataset() (*CouchbaseTableDataset, bool) { + return nil, false +} + +// AsConcurObjectDataset is the BasicDataset implementation for ShopifyObjectDataset. +func (sod ShopifyObjectDataset) AsConcurObjectDataset() (*ConcurObjectDataset, bool) { + return nil, false +} + +// AsAzurePostgreSQLTableDataset is the BasicDataset implementation for ShopifyObjectDataset. +func (sod ShopifyObjectDataset) AsAzurePostgreSQLTableDataset() (*AzurePostgreSQLTableDataset, bool) { + return nil, false +} + +// AsAmazonMWSObjectDataset is the BasicDataset implementation for ShopifyObjectDataset. +func (sod ShopifyObjectDataset) AsAmazonMWSObjectDataset() (*AmazonMWSObjectDataset, bool) { + return nil, false +} + +// AsHTTPDataset is the BasicDataset implementation for ShopifyObjectDataset. +func (sod ShopifyObjectDataset) AsHTTPDataset() (*HTTPDataset, bool) { + return nil, false +} + +// AsAzureSearchIndexDataset is the BasicDataset implementation for ShopifyObjectDataset. +func (sod ShopifyObjectDataset) AsAzureSearchIndexDataset() (*AzureSearchIndexDataset, bool) { + return nil, false +} + +// AsWebTableDataset is the BasicDataset implementation for ShopifyObjectDataset. +func (sod ShopifyObjectDataset) AsWebTableDataset() (*WebTableDataset, bool) { + return nil, false +} + +// AsSQLServerTableDataset is the BasicDataset implementation for ShopifyObjectDataset. +func (sod ShopifyObjectDataset) AsSQLServerTableDataset() (*SQLServerTableDataset, bool) { + return nil, false +} + +// AsSapEccResourceDataset is the BasicDataset implementation for ShopifyObjectDataset. +func (sod ShopifyObjectDataset) AsSapEccResourceDataset() (*SapEccResourceDataset, bool) { + return nil, false +} + +// AsSapCloudForCustomerResourceDataset is the BasicDataset implementation for ShopifyObjectDataset. +func (sod ShopifyObjectDataset) AsSapCloudForCustomerResourceDataset() (*SapCloudForCustomerResourceDataset, bool) { + return nil, false +} + +// AsSalesforceObjectDataset is the BasicDataset implementation for ShopifyObjectDataset. +func (sod ShopifyObjectDataset) AsSalesforceObjectDataset() (*SalesforceObjectDataset, bool) { + return nil, false +} + +// AsRelationalTableDataset is the BasicDataset implementation for ShopifyObjectDataset. +func (sod ShopifyObjectDataset) AsRelationalTableDataset() (*RelationalTableDataset, bool) { + return nil, false +} + +// AsAzureMySQLTableDataset is the BasicDataset implementation for ShopifyObjectDataset. +func (sod ShopifyObjectDataset) AsAzureMySQLTableDataset() (*AzureMySQLTableDataset, bool) { + return nil, false +} + +// AsOracleTableDataset is the BasicDataset implementation for ShopifyObjectDataset. +func (sod ShopifyObjectDataset) AsOracleTableDataset() (*OracleTableDataset, bool) { + return nil, false +} + +// AsODataResourceDataset is the BasicDataset implementation for ShopifyObjectDataset. +func (sod ShopifyObjectDataset) AsODataResourceDataset() (*ODataResourceDataset, bool) { + return nil, false +} + +// AsMongoDbCollectionDataset is the BasicDataset implementation for ShopifyObjectDataset. +func (sod ShopifyObjectDataset) AsMongoDbCollectionDataset() (*MongoDbCollectionDataset, bool) { + return nil, false +} + +// AsFileShareDataset is the BasicDataset implementation for ShopifyObjectDataset. +func (sod ShopifyObjectDataset) AsFileShareDataset() (*FileShareDataset, bool) { + return nil, false +} + +// AsAzureDataLakeStoreDataset is the BasicDataset implementation for ShopifyObjectDataset. +func (sod ShopifyObjectDataset) AsAzureDataLakeStoreDataset() (*AzureDataLakeStoreDataset, bool) { + return nil, false +} + +// AsDynamicsEntityDataset is the BasicDataset implementation for ShopifyObjectDataset. +func (sod ShopifyObjectDataset) AsDynamicsEntityDataset() (*DynamicsEntityDataset, bool) { + return nil, false +} + +// AsDocumentDbCollectionDataset is the BasicDataset implementation for ShopifyObjectDataset. +func (sod ShopifyObjectDataset) AsDocumentDbCollectionDataset() (*DocumentDbCollectionDataset, bool) { + return nil, false +} + +// AsCustomDataset is the BasicDataset implementation for ShopifyObjectDataset. +func (sod ShopifyObjectDataset) AsCustomDataset() (*CustomDataset, bool) { + return nil, false +} + +// AsCassandraTableDataset is the BasicDataset implementation for ShopifyObjectDataset. +func (sod ShopifyObjectDataset) AsCassandraTableDataset() (*CassandraTableDataset, bool) { + return nil, false +} + +// AsAzureSQLDWTableDataset is the BasicDataset implementation for ShopifyObjectDataset. +func (sod ShopifyObjectDataset) AsAzureSQLDWTableDataset() (*AzureSQLDWTableDataset, bool) { + return nil, false +} + +// AsAzureSQLTableDataset is the BasicDataset implementation for ShopifyObjectDataset. +func (sod ShopifyObjectDataset) AsAzureSQLTableDataset() (*AzureSQLTableDataset, bool) { + return nil, false +} + +// AsAzureTableDataset is the BasicDataset implementation for ShopifyObjectDataset. +func (sod ShopifyObjectDataset) AsAzureTableDataset() (*AzureTableDataset, bool) { + return nil, false +} + +// AsAzureBlobDataset is the BasicDataset implementation for ShopifyObjectDataset. +func (sod ShopifyObjectDataset) AsAzureBlobDataset() (*AzureBlobDataset, bool) { + return nil, false +} + +// AsAmazonS3Dataset is the BasicDataset implementation for ShopifyObjectDataset. +func (sod ShopifyObjectDataset) AsAmazonS3Dataset() (*AmazonS3Dataset, bool) { + return nil, false +} + +// AsDataset is the BasicDataset implementation for ShopifyObjectDataset. +func (sod ShopifyObjectDataset) AsDataset() (*Dataset, bool) { + return nil, false +} + +// AsBasicDataset is the BasicDataset implementation for ShopifyObjectDataset. +func (sod ShopifyObjectDataset) AsBasicDataset() (BasicDataset, bool) { + return &sod, true +} + +// ShopifySource a copy activity Shopify Serivce source. +type ShopifySource struct { + // Query - A query to retrieve data from source. Type: string (or Expression with resultType string). + Query interface{} `json:"query,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // SourceRetryCount - Source retry count. Type: integer (or Expression with resultType integer). + SourceRetryCount interface{} `json:"sourceRetryCount,omitempty"` + // SourceRetryWait - Source retry wait. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` + // Type - Possible values include: 'TypeCopySource', 'TypeAmazonRedshiftSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeHTTPSource', 'TypeAzureDataLakeStoreSource', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeRelationalSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource' + Type TypeBasicCopySource `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ShopifySource. +func (ss ShopifySource) MarshalJSON() ([]byte, error) { + ss.Type = TypeShopifySource + objectMap := make(map[string]interface{}) + objectMap["query"] = ss.Query + objectMap["sourceRetryCount"] = ss.SourceRetryCount + objectMap["sourceRetryWait"] = ss.SourceRetryWait + if ss.Type != "" { + objectMap["type"] = ss.Type + } + for k, v := range ss.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsAmazonRedshiftSource is the BasicCopySource implementation for ShopifySource. +func (ss ShopifySource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { + return nil, false +} + +// AsResponsysSource is the BasicCopySource implementation for ShopifySource. +func (ss ShopifySource) AsResponsysSource() (*ResponsysSource, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudSource is the BasicCopySource implementation for ShopifySource. +func (ss ShopifySource) AsSalesforceMarketingCloudSource() (*SalesforceMarketingCloudSource, bool) { + return nil, false +} + +// AsVerticaSource is the BasicCopySource implementation for ShopifySource. +func (ss ShopifySource) AsVerticaSource() (*VerticaSource, bool) { + return nil, false +} + +// AsNetezzaSource is the BasicCopySource implementation for ShopifySource. +func (ss ShopifySource) AsNetezzaSource() (*NetezzaSource, bool) { + return nil, false +} + +// AsZohoSource is the BasicCopySource implementation for ShopifySource. +func (ss ShopifySource) AsZohoSource() (*ZohoSource, bool) { + return nil, false +} + +// AsXeroSource is the BasicCopySource implementation for ShopifySource. +func (ss ShopifySource) AsXeroSource() (*XeroSource, bool) { + return nil, false +} + +// AsSquareSource is the BasicCopySource implementation for ShopifySource. +func (ss ShopifySource) AsSquareSource() (*SquareSource, bool) { + return nil, false +} + +// AsSparkSource is the BasicCopySource implementation for ShopifySource. +func (ss ShopifySource) AsSparkSource() (*SparkSource, bool) { + return nil, false +} + +// AsShopifySource is the BasicCopySource implementation for ShopifySource. +func (ss ShopifySource) AsShopifySource() (*ShopifySource, bool) { + return &ss, true +} + +// AsServiceNowSource is the BasicCopySource implementation for ShopifySource. +func (ss ShopifySource) AsServiceNowSource() (*ServiceNowSource, bool) { + return nil, false +} + +// AsQuickBooksSource is the BasicCopySource implementation for ShopifySource. +func (ss ShopifySource) AsQuickBooksSource() (*QuickBooksSource, bool) { + return nil, false +} + +// AsPrestoSource is the BasicCopySource implementation for ShopifySource. +func (ss ShopifySource) AsPrestoSource() (*PrestoSource, bool) { + return nil, false +} + +// AsPhoenixSource is the BasicCopySource implementation for ShopifySource. +func (ss ShopifySource) AsPhoenixSource() (*PhoenixSource, bool) { + return nil, false +} + +// AsPaypalSource is the BasicCopySource implementation for ShopifySource. +func (ss ShopifySource) AsPaypalSource() (*PaypalSource, bool) { + return nil, false +} + +// AsMarketoSource is the BasicCopySource implementation for ShopifySource. +func (ss ShopifySource) AsMarketoSource() (*MarketoSource, bool) { + return nil, false +} + +// AsMariaDBSource is the BasicCopySource implementation for ShopifySource. +func (ss ShopifySource) AsMariaDBSource() (*MariaDBSource, bool) { + return nil, false +} + +// AsMagentoSource is the BasicCopySource implementation for ShopifySource. +func (ss ShopifySource) AsMagentoSource() (*MagentoSource, bool) { + return nil, false +} + +// AsJiraSource is the BasicCopySource implementation for ShopifySource. +func (ss ShopifySource) AsJiraSource() (*JiraSource, bool) { + return nil, false +} + +// AsImpalaSource is the BasicCopySource implementation for ShopifySource. +func (ss ShopifySource) AsImpalaSource() (*ImpalaSource, bool) { + return nil, false +} + +// AsHubspotSource is the BasicCopySource implementation for ShopifySource. +func (ss ShopifySource) AsHubspotSource() (*HubspotSource, bool) { + return nil, false +} + +// AsHiveSource is the BasicCopySource implementation for ShopifySource. +func (ss ShopifySource) AsHiveSource() (*HiveSource, bool) { + return nil, false +} + +// AsHBaseSource is the BasicCopySource implementation for ShopifySource. +func (ss ShopifySource) AsHBaseSource() (*HBaseSource, bool) { + return nil, false +} + +// AsGreenplumSource is the BasicCopySource implementation for ShopifySource. +func (ss ShopifySource) AsGreenplumSource() (*GreenplumSource, bool) { + return nil, false +} + +// AsGoogleBigQuerySource is the BasicCopySource implementation for ShopifySource. +func (ss ShopifySource) AsGoogleBigQuerySource() (*GoogleBigQuerySource, bool) { + return nil, false +} + +// AsEloquaSource is the BasicCopySource implementation for ShopifySource. +func (ss ShopifySource) AsEloquaSource() (*EloquaSource, bool) { + return nil, false +} + +// AsDrillSource is the BasicCopySource implementation for ShopifySource. +func (ss ShopifySource) AsDrillSource() (*DrillSource, bool) { + return nil, false +} + +// AsCouchbaseSource is the BasicCopySource implementation for ShopifySource. +func (ss ShopifySource) AsCouchbaseSource() (*CouchbaseSource, bool) { + return nil, false +} + +// AsConcurSource is the BasicCopySource implementation for ShopifySource. +func (ss ShopifySource) AsConcurSource() (*ConcurSource, bool) { + return nil, false +} + +// AsAzurePostgreSQLSource is the BasicCopySource implementation for ShopifySource. +func (ss ShopifySource) AsAzurePostgreSQLSource() (*AzurePostgreSQLSource, bool) { + return nil, false +} + +// AsAmazonMWSSource is the BasicCopySource implementation for ShopifySource. +func (ss ShopifySource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { + return nil, false +} + +// AsHTTPSource is the BasicCopySource implementation for ShopifySource. +func (ss ShopifySource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for ShopifySource. +func (ss ShopifySource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for ShopifySource. +func (ss ShopifySource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsCassandraSource is the BasicCopySource implementation for ShopifySource. +func (ss ShopifySource) AsCassandraSource() (*CassandraSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for ShopifySource. +func (ss ShopifySource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for ShopifySource. +func (ss ShopifySource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureMySQLSource is the BasicCopySource implementation for ShopifySource. +func (ss ShopifySource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for ShopifySource. +func (ss ShopifySource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for ShopifySource. +func (ss ShopifySource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsSQLDWSource is the BasicCopySource implementation for ShopifySource. +func (ss ShopifySource) AsSQLDWSource() (*SQLDWSource, bool) { + return nil, false +} + +// AsSQLSource is the BasicCopySource implementation for ShopifySource. +func (ss ShopifySource) AsSQLSource() (*SQLSource, bool) { + return nil, false +} + +// AsSapEccSource is the BasicCopySource implementation for ShopifySource. +func (ss ShopifySource) AsSapEccSource() (*SapEccSource, bool) { + return nil, false +} + +// AsSapCloudForCustomerSource is the BasicCopySource implementation for ShopifySource. +func (ss ShopifySource) AsSapCloudForCustomerSource() (*SapCloudForCustomerSource, bool) { + return nil, false +} + +// AsSalesforceSource is the BasicCopySource implementation for ShopifySource. +func (ss ShopifySource) AsSalesforceSource() (*SalesforceSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for ShopifySource. +func (ss ShopifySource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for ShopifySource. +func (ss ShopifySource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for ShopifySource. +func (ss ShopifySource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for ShopifySource. +func (ss ShopifySource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + +// AsAzureTableSource is the BasicCopySource implementation for ShopifySource. +func (ss ShopifySource) AsAzureTableSource() (*AzureTableSource, bool) { + return nil, false +} + +// AsCopySource is the BasicCopySource implementation for ShopifySource. +func (ss ShopifySource) AsCopySource() (*CopySource, bool) { + return nil, false +} + +// AsBasicCopySource is the BasicCopySource implementation for ShopifySource. +func (ss ShopifySource) AsBasicCopySource() (BasicCopySource, bool) { + return &ss, true +} + +// SparkLinkedService spark Server linked service. +type SparkLinkedService struct { + // SparkLinkedServiceTypeProperties - Spark Server linked service properties. + *SparkLinkedServiceTypeProperties `json:"typeProperties,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // ConnectVia - The integration runtime reference. + ConnectVia *IntegrationRuntimeReference `json:"connectVia,omitempty"` + // Description - Linked service description. + Description *string `json:"description,omitempty"` + // Parameters - Parameters for linked service. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeLinkedService', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforce', 'TypeAzureDataLakeStore', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureStorage' + Type TypeBasicLinkedService `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for SparkLinkedService. +func (sls SparkLinkedService) MarshalJSON() ([]byte, error) { + sls.Type = TypeSpark + objectMap := make(map[string]interface{}) + if sls.SparkLinkedServiceTypeProperties != nil { + objectMap["typeProperties"] = sls.SparkLinkedServiceTypeProperties + } + if sls.ConnectVia != nil { + objectMap["connectVia"] = sls.ConnectVia + } + if sls.Description != nil { + objectMap["description"] = sls.Description + } + if sls.Parameters != nil { + objectMap["parameters"] = sls.Parameters + } + if sls.Annotations != nil { + objectMap["annotations"] = sls.Annotations + } + if sls.Type != "" { + objectMap["type"] = sls.Type + } + for k, v := range sls.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysLinkedService is the BasicLinkedService implementation for SparkLinkedService. +func (sls SparkLinkedService) AsResponsysLinkedService() (*ResponsysLinkedService, bool) { + return nil, false +} + +// AsAzureDatabricksLinkedService is the BasicLinkedService implementation for SparkLinkedService. +func (sls SparkLinkedService) AsAzureDatabricksLinkedService() (*AzureDatabricksLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeAnalyticsLinkedService is the BasicLinkedService implementation for SparkLinkedService. +func (sls SparkLinkedService) AsAzureDataLakeAnalyticsLinkedService() (*AzureDataLakeAnalyticsLinkedService, bool) { + return nil, false +} + +// AsHDInsightOnDemandLinkedService is the BasicLinkedService implementation for SparkLinkedService. +func (sls SparkLinkedService) AsHDInsightOnDemandLinkedService() (*HDInsightOnDemandLinkedService, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudLinkedService is the BasicLinkedService implementation for SparkLinkedService. +func (sls SparkLinkedService) AsSalesforceMarketingCloudLinkedService() (*SalesforceMarketingCloudLinkedService, bool) { + return nil, false +} + +// AsNetezzaLinkedService is the BasicLinkedService implementation for SparkLinkedService. +func (sls SparkLinkedService) AsNetezzaLinkedService() (*NetezzaLinkedService, bool) { + return nil, false +} + +// AsVerticaLinkedService is the BasicLinkedService implementation for SparkLinkedService. +func (sls SparkLinkedService) AsVerticaLinkedService() (*VerticaLinkedService, bool) { + return nil, false +} + +// AsZohoLinkedService is the BasicLinkedService implementation for SparkLinkedService. +func (sls SparkLinkedService) AsZohoLinkedService() (*ZohoLinkedService, bool) { + return nil, false +} + +// AsXeroLinkedService is the BasicLinkedService implementation for SparkLinkedService. +func (sls SparkLinkedService) AsXeroLinkedService() (*XeroLinkedService, bool) { + return nil, false +} + +// AsSquareLinkedService is the BasicLinkedService implementation for SparkLinkedService. +func (sls SparkLinkedService) AsSquareLinkedService() (*SquareLinkedService, bool) { + return nil, false +} + +// AsSparkLinkedService is the BasicLinkedService implementation for SparkLinkedService. +func (sls SparkLinkedService) AsSparkLinkedService() (*SparkLinkedService, bool) { + return &sls, true +} + +// AsShopifyLinkedService is the BasicLinkedService implementation for SparkLinkedService. +func (sls SparkLinkedService) AsShopifyLinkedService() (*ShopifyLinkedService, bool) { + return nil, false +} + +// AsServiceNowLinkedService is the BasicLinkedService implementation for SparkLinkedService. +func (sls SparkLinkedService) AsServiceNowLinkedService() (*ServiceNowLinkedService, bool) { + return nil, false +} + +// AsQuickBooksLinkedService is the BasicLinkedService implementation for SparkLinkedService. +func (sls SparkLinkedService) AsQuickBooksLinkedService() (*QuickBooksLinkedService, bool) { + return nil, false +} + +// AsPrestoLinkedService is the BasicLinkedService implementation for SparkLinkedService. +func (sls SparkLinkedService) AsPrestoLinkedService() (*PrestoLinkedService, bool) { + return nil, false +} + +// AsPhoenixLinkedService is the BasicLinkedService implementation for SparkLinkedService. +func (sls SparkLinkedService) AsPhoenixLinkedService() (*PhoenixLinkedService, bool) { + return nil, false +} + +// AsPaypalLinkedService is the BasicLinkedService implementation for SparkLinkedService. +func (sls SparkLinkedService) AsPaypalLinkedService() (*PaypalLinkedService, bool) { + return nil, false +} + +// AsMarketoLinkedService is the BasicLinkedService implementation for SparkLinkedService. +func (sls SparkLinkedService) AsMarketoLinkedService() (*MarketoLinkedService, bool) { + return nil, false +} + +// AsMariaDBLinkedService is the BasicLinkedService implementation for SparkLinkedService. +func (sls SparkLinkedService) AsMariaDBLinkedService() (*MariaDBLinkedService, bool) { + return nil, false +} + +// AsMagentoLinkedService is the BasicLinkedService implementation for SparkLinkedService. +func (sls SparkLinkedService) AsMagentoLinkedService() (*MagentoLinkedService, bool) { + return nil, false +} + +// AsJiraLinkedService is the BasicLinkedService implementation for SparkLinkedService. +func (sls SparkLinkedService) AsJiraLinkedService() (*JiraLinkedService, bool) { + return nil, false +} + +// AsImpalaLinkedService is the BasicLinkedService implementation for SparkLinkedService. +func (sls SparkLinkedService) AsImpalaLinkedService() (*ImpalaLinkedService, bool) { + return nil, false +} + +// AsHubspotLinkedService is the BasicLinkedService implementation for SparkLinkedService. +func (sls SparkLinkedService) AsHubspotLinkedService() (*HubspotLinkedService, bool) { + return nil, false +} + +// AsHiveLinkedService is the BasicLinkedService implementation for SparkLinkedService. +func (sls SparkLinkedService) AsHiveLinkedService() (*HiveLinkedService, bool) { + return nil, false +} + +// AsHBaseLinkedService is the BasicLinkedService implementation for SparkLinkedService. +func (sls SparkLinkedService) AsHBaseLinkedService() (*HBaseLinkedService, bool) { + return nil, false +} + +// AsGreenplumLinkedService is the BasicLinkedService implementation for SparkLinkedService. +func (sls SparkLinkedService) AsGreenplumLinkedService() (*GreenplumLinkedService, bool) { + return nil, false +} + +// AsGoogleBigQueryLinkedService is the BasicLinkedService implementation for SparkLinkedService. +func (sls SparkLinkedService) AsGoogleBigQueryLinkedService() (*GoogleBigQueryLinkedService, bool) { + return nil, false +} + +// AsEloquaLinkedService is the BasicLinkedService implementation for SparkLinkedService. +func (sls SparkLinkedService) AsEloquaLinkedService() (*EloquaLinkedService, bool) { + return nil, false +} + +// AsDrillLinkedService is the BasicLinkedService implementation for SparkLinkedService. +func (sls SparkLinkedService) AsDrillLinkedService() (*DrillLinkedService, bool) { + return nil, false +} + +// AsCouchbaseLinkedService is the BasicLinkedService implementation for SparkLinkedService. +func (sls SparkLinkedService) AsCouchbaseLinkedService() (*CouchbaseLinkedService, bool) { + return nil, false +} + +// AsConcurLinkedService is the BasicLinkedService implementation for SparkLinkedService. +func (sls SparkLinkedService) AsConcurLinkedService() (*ConcurLinkedService, bool) { + return nil, false +} + +// AsAzurePostgreSQLLinkedService is the BasicLinkedService implementation for SparkLinkedService. +func (sls SparkLinkedService) AsAzurePostgreSQLLinkedService() (*AzurePostgreSQLLinkedService, bool) { + return nil, false +} + +// AsAmazonMWSLinkedService is the BasicLinkedService implementation for SparkLinkedService. +func (sls SparkLinkedService) AsAmazonMWSLinkedService() (*AmazonMWSLinkedService, bool) { + return nil, false +} + +// AsSapHanaLinkedService is the BasicLinkedService implementation for SparkLinkedService. +func (sls SparkLinkedService) AsSapHanaLinkedService() (*SapHanaLinkedService, bool) { + return nil, false +} + +// AsSapBWLinkedService is the BasicLinkedService implementation for SparkLinkedService. +func (sls SparkLinkedService) AsSapBWLinkedService() (*SapBWLinkedService, bool) { + return nil, false +} + +// AsSftpServerLinkedService is the BasicLinkedService implementation for SparkLinkedService. +func (sls SparkLinkedService) AsSftpServerLinkedService() (*SftpServerLinkedService, bool) { + return nil, false +} + +// AsFtpServerLinkedService is the BasicLinkedService implementation for SparkLinkedService. +func (sls SparkLinkedService) AsFtpServerLinkedService() (*FtpServerLinkedService, bool) { + return nil, false +} + +// AsHTTPLinkedService is the BasicLinkedService implementation for SparkLinkedService. +func (sls SparkLinkedService) AsHTTPLinkedService() (*HTTPLinkedService, bool) { + return nil, false +} + +// AsAzureSearchLinkedService is the BasicLinkedService implementation for SparkLinkedService. +func (sls SparkLinkedService) AsAzureSearchLinkedService() (*AzureSearchLinkedService, bool) { + return nil, false +} + +// AsCustomDataSourceLinkedService is the BasicLinkedService implementation for SparkLinkedService. +func (sls SparkLinkedService) AsCustomDataSourceLinkedService() (*CustomDataSourceLinkedService, bool) { + return nil, false +} + +// AsAmazonRedshiftLinkedService is the BasicLinkedService implementation for SparkLinkedService. +func (sls SparkLinkedService) AsAmazonRedshiftLinkedService() (*AmazonRedshiftLinkedService, bool) { + return nil, false +} + +// AsAmazonS3LinkedService is the BasicLinkedService implementation for SparkLinkedService. +func (sls SparkLinkedService) AsAmazonS3LinkedService() (*AmazonS3LinkedService, bool) { + return nil, false +} + +// AsSapEccLinkedService is the BasicLinkedService implementation for SparkLinkedService. +func (sls SparkLinkedService) AsSapEccLinkedService() (*SapEccLinkedService, bool) { + return nil, false +} + +// AsSapCloudForCustomerLinkedService is the BasicLinkedService implementation for SparkLinkedService. +func (sls SparkLinkedService) AsSapCloudForCustomerLinkedService() (*SapCloudForCustomerLinkedService, bool) { + return nil, false +} + +// AsSalesforceLinkedService is the BasicLinkedService implementation for SparkLinkedService. +func (sls SparkLinkedService) AsSalesforceLinkedService() (*SalesforceLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeStoreLinkedService is the BasicLinkedService implementation for SparkLinkedService. +func (sls SparkLinkedService) AsAzureDataLakeStoreLinkedService() (*AzureDataLakeStoreLinkedService, bool) { + return nil, false +} + +// AsMongoDbLinkedService is the BasicLinkedService implementation for SparkLinkedService. +func (sls SparkLinkedService) AsMongoDbLinkedService() (*MongoDbLinkedService, bool) { + return nil, false +} + +// AsCassandraLinkedService is the BasicLinkedService implementation for SparkLinkedService. +func (sls SparkLinkedService) AsCassandraLinkedService() (*CassandraLinkedService, bool) { + return nil, false +} + +// AsWebLinkedService is the BasicLinkedService implementation for SparkLinkedService. +func (sls SparkLinkedService) AsWebLinkedService() (*WebLinkedService, bool) { + return nil, false +} + +// AsODataLinkedService is the BasicLinkedService implementation for SparkLinkedService. +func (sls SparkLinkedService) AsODataLinkedService() (*ODataLinkedService, bool) { + return nil, false +} + +// AsHdfsLinkedService is the BasicLinkedService implementation for SparkLinkedService. +func (sls SparkLinkedService) AsHdfsLinkedService() (*HdfsLinkedService, bool) { + return nil, false +} + +// AsOdbcLinkedService is the BasicLinkedService implementation for SparkLinkedService. +func (sls SparkLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, bool) { + return nil, false +} + +// AsAzureMLLinkedService is the BasicLinkedService implementation for SparkLinkedService. +func (sls SparkLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { + return nil, false +} + +// AsTeradataLinkedService is the BasicLinkedService implementation for SparkLinkedService. +func (sls SparkLinkedService) AsTeradataLinkedService() (*TeradataLinkedService, bool) { + return nil, false +} + +// AsDb2LinkedService is the BasicLinkedService implementation for SparkLinkedService. +func (sls SparkLinkedService) AsDb2LinkedService() (*Db2LinkedService, bool) { + return nil, false +} + +// AsSybaseLinkedService is the BasicLinkedService implementation for SparkLinkedService. +func (sls SparkLinkedService) AsSybaseLinkedService() (*SybaseLinkedService, bool) { + return nil, false +} + +// AsPostgreSQLLinkedService is the BasicLinkedService implementation for SparkLinkedService. +func (sls SparkLinkedService) AsPostgreSQLLinkedService() (*PostgreSQLLinkedService, bool) { + return nil, false +} + +// AsMySQLLinkedService is the BasicLinkedService implementation for SparkLinkedService. +func (sls SparkLinkedService) AsMySQLLinkedService() (*MySQLLinkedService, bool) { + return nil, false +} + +// AsAzureMySQLLinkedService is the BasicLinkedService implementation for SparkLinkedService. +func (sls SparkLinkedService) AsAzureMySQLLinkedService() (*AzureMySQLLinkedService, bool) { + return nil, false +} + +// AsOracleLinkedService is the BasicLinkedService implementation for SparkLinkedService. +func (sls SparkLinkedService) AsOracleLinkedService() (*OracleLinkedService, bool) { + return nil, false +} + +// AsFileServerLinkedService is the BasicLinkedService implementation for SparkLinkedService. +func (sls SparkLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { + return nil, false +} + +// AsHDInsightLinkedService is the BasicLinkedService implementation for SparkLinkedService. +func (sls SparkLinkedService) AsHDInsightLinkedService() (*HDInsightLinkedService, bool) { + return nil, false +} + +// AsDynamicsLinkedService is the BasicLinkedService implementation for SparkLinkedService. +func (sls SparkLinkedService) AsDynamicsLinkedService() (*DynamicsLinkedService, bool) { + return nil, false +} + +// AsCosmosDbLinkedService is the BasicLinkedService implementation for SparkLinkedService. +func (sls SparkLinkedService) AsCosmosDbLinkedService() (*CosmosDbLinkedService, bool) { + return nil, false +} + +// AsAzureKeyVaultLinkedService is the BasicLinkedService implementation for SparkLinkedService. +func (sls SparkLinkedService) AsAzureKeyVaultLinkedService() (*AzureKeyVaultLinkedService, bool) { + return nil, false +} + +// AsAzureBatchLinkedService is the BasicLinkedService implementation for SparkLinkedService. +func (sls SparkLinkedService) AsAzureBatchLinkedService() (*AzureBatchLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDatabaseLinkedService is the BasicLinkedService implementation for SparkLinkedService. +func (sls SparkLinkedService) AsAzureSQLDatabaseLinkedService() (*AzureSQLDatabaseLinkedService, bool) { + return nil, false +} + +// AsSQLServerLinkedService is the BasicLinkedService implementation for SparkLinkedService. +func (sls SparkLinkedService) AsSQLServerLinkedService() (*SQLServerLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDWLinkedService is the BasicLinkedService implementation for SparkLinkedService. +func (sls SparkLinkedService) AsAzureSQLDWLinkedService() (*AzureSQLDWLinkedService, bool) { + return nil, false +} + +// AsAzureStorageLinkedService is the BasicLinkedService implementation for SparkLinkedService. +func (sls SparkLinkedService) AsAzureStorageLinkedService() (*AzureStorageLinkedService, bool) { + return nil, false +} + +// AsLinkedService is the BasicLinkedService implementation for SparkLinkedService. +func (sls SparkLinkedService) AsLinkedService() (*LinkedService, bool) { + return nil, false +} + +// AsBasicLinkedService is the BasicLinkedService implementation for SparkLinkedService. +func (sls SparkLinkedService) AsBasicLinkedService() (BasicLinkedService, bool) { + return &sls, true +} + +// UnmarshalJSON is the custom unmarshaler for SparkLinkedService struct. +func (sls *SparkLinkedService) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "typeProperties": + if v != nil { + var sparkLinkedServiceTypeProperties SparkLinkedServiceTypeProperties + err = json.Unmarshal(*v, &sparkLinkedServiceTypeProperties) + if err != nil { + return err + } + sls.SparkLinkedServiceTypeProperties = &sparkLinkedServiceTypeProperties + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if sls.AdditionalProperties == nil { + sls.AdditionalProperties = make(map[string]interface{}) + } + sls.AdditionalProperties[k] = additionalProperties + } + case "connectVia": + if v != nil { + var connectVia IntegrationRuntimeReference + err = json.Unmarshal(*v, &connectVia) + if err != nil { + return err + } + sls.ConnectVia = &connectVia + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + sls.Description = &description + } + case "parameters": + if v != nil { + var parameters map[string]*ParameterSpecification + err = json.Unmarshal(*v, ¶meters) + if err != nil { + return err + } + sls.Parameters = parameters + } + case "annotations": + if v != nil { + var annotations []interface{} + err = json.Unmarshal(*v, &annotations) + if err != nil { + return err + } + sls.Annotations = &annotations + } + case "type": + if v != nil { + var typeVar TypeBasicLinkedService + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + sls.Type = typeVar + } + } + } + + return nil +} + +// SparkLinkedServiceTypeProperties spark Server linked service properties. +type SparkLinkedServiceTypeProperties struct { + // Host - IP address or host name of the Spark server + Host interface{} `json:"host,omitempty"` + // Port - The TCP port that the Spark server uses to listen for client connections. + Port interface{} `json:"port,omitempty"` + // ServerType - The type of Spark server. Possible values include: 'SharkServer', 'SharkServer2', 'SparkThriftServer' + ServerType SparkServerType `json:"serverType,omitempty"` + // ThriftTransportProtocol - The transport protocol to use in the Thrift layer. Possible values include: 'SparkThriftTransportProtocolBinary', 'SparkThriftTransportProtocolSASL', 'SparkThriftTransportProtocolHTTP' + ThriftTransportProtocol SparkThriftTransportProtocol `json:"thriftTransportProtocol,omitempty"` + // AuthenticationType - The authentication method used to access the Spark server. Possible values include: 'SparkAuthenticationTypeAnonymous', 'SparkAuthenticationTypeUsername', 'SparkAuthenticationTypeUsernameAndPassword', 'SparkAuthenticationTypeWindowsAzureHDInsightService' + AuthenticationType SparkAuthenticationType `json:"authenticationType,omitempty"` + // Username - The user name that you use to access Spark Server. + Username interface{} `json:"username,omitempty"` + // Password - The password corresponding to the user name that you provided in the Username field + Password BasicSecretBase `json:"password,omitempty"` + // HTTPPath - The partial URL corresponding to the Spark server. + HTTPPath interface{} `json:"httpPath,omitempty"` + // EnableSsl - Specifies whether the connections to the server are encrypted using SSL. The default value is false. + EnableSsl interface{} `json:"enableSsl,omitempty"` + // TrustedCertPath - The full path of the .pem file containing trusted CA certificates for verifying the server when connecting over SSL. This property can only be set when using SSL on self-hosted IR. The default value is the cacerts.pem file installed with the IR. + TrustedCertPath interface{} `json:"trustedCertPath,omitempty"` + // UseSystemTrustStore - Specifies whether to use a CA certificate from the system trust store or from a specified PEM file. The default value is false. + UseSystemTrustStore interface{} `json:"useSystemTrustStore,omitempty"` + // AllowHostNameCNMismatch - Specifies whether to require a CA-issued SSL certificate name to match the host name of the server when connecting over SSL. The default value is false. + AllowHostNameCNMismatch interface{} `json:"allowHostNameCNMismatch,omitempty"` + // AllowSelfSignedServerCert - Specifies whether to allow self-signed certificates from the server. The default value is false. + AllowSelfSignedServerCert interface{} `json:"allowSelfSignedServerCert,omitempty"` + // EncryptedCredential - The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string). + EncryptedCredential interface{} `json:"encryptedCredential,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for SparkLinkedServiceTypeProperties struct. +func (slstp *SparkLinkedServiceTypeProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "host": + if v != nil { + var host interface{} + err = json.Unmarshal(*v, &host) + if err != nil { + return err + } + slstp.Host = host + } + case "port": + if v != nil { + var port interface{} + err = json.Unmarshal(*v, &port) + if err != nil { + return err + } + slstp.Port = port + } + case "serverType": + if v != nil { + var serverType SparkServerType + err = json.Unmarshal(*v, &serverType) + if err != nil { + return err + } + slstp.ServerType = serverType + } + case "thriftTransportProtocol": + if v != nil { + var thriftTransportProtocol SparkThriftTransportProtocol + err = json.Unmarshal(*v, &thriftTransportProtocol) + if err != nil { + return err + } + slstp.ThriftTransportProtocol = thriftTransportProtocol + } + case "authenticationType": + if v != nil { + var authenticationType SparkAuthenticationType + err = json.Unmarshal(*v, &authenticationType) + if err != nil { + return err + } + slstp.AuthenticationType = authenticationType + } + case "username": + if v != nil { + var username interface{} + err = json.Unmarshal(*v, &username) + if err != nil { + return err + } + slstp.Username = username + } + case "password": + if v != nil { + password, err := unmarshalBasicSecretBase(*v) + if err != nil { + return err + } + slstp.Password = password + } + case "httpPath": + if v != nil { + var HTTPPath interface{} + err = json.Unmarshal(*v, &HTTPPath) + if err != nil { + return err + } + slstp.HTTPPath = HTTPPath + } + case "enableSsl": + if v != nil { + var enableSsl interface{} + err = json.Unmarshal(*v, &enableSsl) + if err != nil { + return err + } + slstp.EnableSsl = enableSsl + } + case "trustedCertPath": + if v != nil { + var trustedCertPath interface{} + err = json.Unmarshal(*v, &trustedCertPath) + if err != nil { + return err + } + slstp.TrustedCertPath = trustedCertPath + } + case "useSystemTrustStore": + if v != nil { + var useSystemTrustStore interface{} + err = json.Unmarshal(*v, &useSystemTrustStore) + if err != nil { + return err + } + slstp.UseSystemTrustStore = useSystemTrustStore + } + case "allowHostNameCNMismatch": + if v != nil { + var allowHostNameCNMismatch interface{} + err = json.Unmarshal(*v, &allowHostNameCNMismatch) + if err != nil { + return err + } + slstp.AllowHostNameCNMismatch = allowHostNameCNMismatch + } + case "allowSelfSignedServerCert": + if v != nil { + var allowSelfSignedServerCert interface{} + err = json.Unmarshal(*v, &allowSelfSignedServerCert) + if err != nil { + return err + } + slstp.AllowSelfSignedServerCert = allowSelfSignedServerCert + } + case "encryptedCredential": + if v != nil { + var encryptedCredential interface{} + err = json.Unmarshal(*v, &encryptedCredential) + if err != nil { + return err + } + slstp.EncryptedCredential = encryptedCredential + } + } + } + + return nil +} + +// SparkObjectDataset spark Server dataset. +type SparkObjectDataset struct { + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Description - Dataset description. + Description *string `json:"description,omitempty"` + // Structure - Columns that define the structure of the dataset. Type: array (or Expression with resultType array), itemType: DatasetDataElement. + Structure interface{} `json:"structure,omitempty"` + // LinkedServiceName - Linked service reference. + LinkedServiceName *LinkedServiceReference `json:"linkedServiceName,omitempty"` + // Parameters - Parameters for dataset. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeDataset', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSQLServerTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSalesforceObject', 'TypeRelationalTable', 'TypeAzureMySQLTable', 'TypeOracleTable', 'TypeODataResource', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeAzureDataLakeStoreFile', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeAmazonS3Object' + Type TypeBasicDataset `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for SparkObjectDataset. +func (sod SparkObjectDataset) MarshalJSON() ([]byte, error) { + sod.Type = TypeSparkObject + objectMap := make(map[string]interface{}) + if sod.Description != nil { + objectMap["description"] = sod.Description + } + objectMap["structure"] = sod.Structure + if sod.LinkedServiceName != nil { + objectMap["linkedServiceName"] = sod.LinkedServiceName + } + if sod.Parameters != nil { + objectMap["parameters"] = sod.Parameters + } + if sod.Annotations != nil { + objectMap["annotations"] = sod.Annotations + } + if sod.Type != "" { + objectMap["type"] = sod.Type + } + for k, v := range sod.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysObjectDataset is the BasicDataset implementation for SparkObjectDataset. +func (sod SparkObjectDataset) AsResponsysObjectDataset() (*ResponsysObjectDataset, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudObjectDataset is the BasicDataset implementation for SparkObjectDataset. +func (sod SparkObjectDataset) AsSalesforceMarketingCloudObjectDataset() (*SalesforceMarketingCloudObjectDataset, bool) { + return nil, false +} + +// AsVerticaTableDataset is the BasicDataset implementation for SparkObjectDataset. +func (sod SparkObjectDataset) AsVerticaTableDataset() (*VerticaTableDataset, bool) { + return nil, false +} + +// AsNetezzaTableDataset is the BasicDataset implementation for SparkObjectDataset. +func (sod SparkObjectDataset) AsNetezzaTableDataset() (*NetezzaTableDataset, bool) { + return nil, false +} + +// AsZohoObjectDataset is the BasicDataset implementation for SparkObjectDataset. +func (sod SparkObjectDataset) AsZohoObjectDataset() (*ZohoObjectDataset, bool) { + return nil, false +} + +// AsXeroObjectDataset is the BasicDataset implementation for SparkObjectDataset. +func (sod SparkObjectDataset) AsXeroObjectDataset() (*XeroObjectDataset, bool) { + return nil, false +} + +// AsSquareObjectDataset is the BasicDataset implementation for SparkObjectDataset. +func (sod SparkObjectDataset) AsSquareObjectDataset() (*SquareObjectDataset, bool) { + return nil, false +} + +// AsSparkObjectDataset is the BasicDataset implementation for SparkObjectDataset. +func (sod SparkObjectDataset) AsSparkObjectDataset() (*SparkObjectDataset, bool) { + return &sod, true +} + +// AsShopifyObjectDataset is the BasicDataset implementation for SparkObjectDataset. +func (sod SparkObjectDataset) AsShopifyObjectDataset() (*ShopifyObjectDataset, bool) { + return nil, false +} + +// AsServiceNowObjectDataset is the BasicDataset implementation for SparkObjectDataset. +func (sod SparkObjectDataset) AsServiceNowObjectDataset() (*ServiceNowObjectDataset, bool) { + return nil, false +} + +// AsQuickBooksObjectDataset is the BasicDataset implementation for SparkObjectDataset. +func (sod SparkObjectDataset) AsQuickBooksObjectDataset() (*QuickBooksObjectDataset, bool) { + return nil, false +} + +// AsPrestoObjectDataset is the BasicDataset implementation for SparkObjectDataset. +func (sod SparkObjectDataset) AsPrestoObjectDataset() (*PrestoObjectDataset, bool) { + return nil, false +} + +// AsPhoenixObjectDataset is the BasicDataset implementation for SparkObjectDataset. +func (sod SparkObjectDataset) AsPhoenixObjectDataset() (*PhoenixObjectDataset, bool) { + return nil, false +} + +// AsPaypalObjectDataset is the BasicDataset implementation for SparkObjectDataset. +func (sod SparkObjectDataset) AsPaypalObjectDataset() (*PaypalObjectDataset, bool) { + return nil, false +} + +// AsMarketoObjectDataset is the BasicDataset implementation for SparkObjectDataset. +func (sod SparkObjectDataset) AsMarketoObjectDataset() (*MarketoObjectDataset, bool) { + return nil, false +} + +// AsMariaDBTableDataset is the BasicDataset implementation for SparkObjectDataset. +func (sod SparkObjectDataset) AsMariaDBTableDataset() (*MariaDBTableDataset, bool) { + return nil, false +} + +// AsMagentoObjectDataset is the BasicDataset implementation for SparkObjectDataset. +func (sod SparkObjectDataset) AsMagentoObjectDataset() (*MagentoObjectDataset, bool) { + return nil, false +} + +// AsJiraObjectDataset is the BasicDataset implementation for SparkObjectDataset. +func (sod SparkObjectDataset) AsJiraObjectDataset() (*JiraObjectDataset, bool) { + return nil, false +} + +// AsImpalaObjectDataset is the BasicDataset implementation for SparkObjectDataset. +func (sod SparkObjectDataset) AsImpalaObjectDataset() (*ImpalaObjectDataset, bool) { + return nil, false +} + +// AsHubspotObjectDataset is the BasicDataset implementation for SparkObjectDataset. +func (sod SparkObjectDataset) AsHubspotObjectDataset() (*HubspotObjectDataset, bool) { + return nil, false +} + +// AsHiveObjectDataset is the BasicDataset implementation for SparkObjectDataset. +func (sod SparkObjectDataset) AsHiveObjectDataset() (*HiveObjectDataset, bool) { + return nil, false +} + +// AsHBaseObjectDataset is the BasicDataset implementation for SparkObjectDataset. +func (sod SparkObjectDataset) AsHBaseObjectDataset() (*HBaseObjectDataset, bool) { + return nil, false +} + +// AsGreenplumTableDataset is the BasicDataset implementation for SparkObjectDataset. +func (sod SparkObjectDataset) AsGreenplumTableDataset() (*GreenplumTableDataset, bool) { + return nil, false +} + +// AsGoogleBigQueryObjectDataset is the BasicDataset implementation for SparkObjectDataset. +func (sod SparkObjectDataset) AsGoogleBigQueryObjectDataset() (*GoogleBigQueryObjectDataset, bool) { + return nil, false +} + +// AsEloquaObjectDataset is the BasicDataset implementation for SparkObjectDataset. +func (sod SparkObjectDataset) AsEloquaObjectDataset() (*EloquaObjectDataset, bool) { + return nil, false +} + +// AsDrillTableDataset is the BasicDataset implementation for SparkObjectDataset. +func (sod SparkObjectDataset) AsDrillTableDataset() (*DrillTableDataset, bool) { + return nil, false +} + +// AsCouchbaseTableDataset is the BasicDataset implementation for SparkObjectDataset. +func (sod SparkObjectDataset) AsCouchbaseTableDataset() (*CouchbaseTableDataset, bool) { + return nil, false +} + +// AsConcurObjectDataset is the BasicDataset implementation for SparkObjectDataset. +func (sod SparkObjectDataset) AsConcurObjectDataset() (*ConcurObjectDataset, bool) { + return nil, false +} + +// AsAzurePostgreSQLTableDataset is the BasicDataset implementation for SparkObjectDataset. +func (sod SparkObjectDataset) AsAzurePostgreSQLTableDataset() (*AzurePostgreSQLTableDataset, bool) { + return nil, false +} + +// AsAmazonMWSObjectDataset is the BasicDataset implementation for SparkObjectDataset. +func (sod SparkObjectDataset) AsAmazonMWSObjectDataset() (*AmazonMWSObjectDataset, bool) { + return nil, false +} + +// AsHTTPDataset is the BasicDataset implementation for SparkObjectDataset. +func (sod SparkObjectDataset) AsHTTPDataset() (*HTTPDataset, bool) { + return nil, false +} + +// AsAzureSearchIndexDataset is the BasicDataset implementation for SparkObjectDataset. +func (sod SparkObjectDataset) AsAzureSearchIndexDataset() (*AzureSearchIndexDataset, bool) { + return nil, false +} + +// AsWebTableDataset is the BasicDataset implementation for SparkObjectDataset. +func (sod SparkObjectDataset) AsWebTableDataset() (*WebTableDataset, bool) { + return nil, false +} + +// AsSQLServerTableDataset is the BasicDataset implementation for SparkObjectDataset. +func (sod SparkObjectDataset) AsSQLServerTableDataset() (*SQLServerTableDataset, bool) { + return nil, false +} + +// AsSapEccResourceDataset is the BasicDataset implementation for SparkObjectDataset. +func (sod SparkObjectDataset) AsSapEccResourceDataset() (*SapEccResourceDataset, bool) { + return nil, false +} + +// AsSapCloudForCustomerResourceDataset is the BasicDataset implementation for SparkObjectDataset. +func (sod SparkObjectDataset) AsSapCloudForCustomerResourceDataset() (*SapCloudForCustomerResourceDataset, bool) { + return nil, false +} + +// AsSalesforceObjectDataset is the BasicDataset implementation for SparkObjectDataset. +func (sod SparkObjectDataset) AsSalesforceObjectDataset() (*SalesforceObjectDataset, bool) { + return nil, false +} + +// AsRelationalTableDataset is the BasicDataset implementation for SparkObjectDataset. +func (sod SparkObjectDataset) AsRelationalTableDataset() (*RelationalTableDataset, bool) { + return nil, false +} + +// AsAzureMySQLTableDataset is the BasicDataset implementation for SparkObjectDataset. +func (sod SparkObjectDataset) AsAzureMySQLTableDataset() (*AzureMySQLTableDataset, bool) { + return nil, false +} + +// AsOracleTableDataset is the BasicDataset implementation for SparkObjectDataset. +func (sod SparkObjectDataset) AsOracleTableDataset() (*OracleTableDataset, bool) { + return nil, false +} + +// AsODataResourceDataset is the BasicDataset implementation for SparkObjectDataset. +func (sod SparkObjectDataset) AsODataResourceDataset() (*ODataResourceDataset, bool) { + return nil, false +} + +// AsMongoDbCollectionDataset is the BasicDataset implementation for SparkObjectDataset. +func (sod SparkObjectDataset) AsMongoDbCollectionDataset() (*MongoDbCollectionDataset, bool) { + return nil, false +} + +// AsFileShareDataset is the BasicDataset implementation for SparkObjectDataset. +func (sod SparkObjectDataset) AsFileShareDataset() (*FileShareDataset, bool) { + return nil, false +} + +// AsAzureDataLakeStoreDataset is the BasicDataset implementation for SparkObjectDataset. +func (sod SparkObjectDataset) AsAzureDataLakeStoreDataset() (*AzureDataLakeStoreDataset, bool) { + return nil, false +} + +// AsDynamicsEntityDataset is the BasicDataset implementation for SparkObjectDataset. +func (sod SparkObjectDataset) AsDynamicsEntityDataset() (*DynamicsEntityDataset, bool) { + return nil, false +} + +// AsDocumentDbCollectionDataset is the BasicDataset implementation for SparkObjectDataset. +func (sod SparkObjectDataset) AsDocumentDbCollectionDataset() (*DocumentDbCollectionDataset, bool) { + return nil, false +} + +// AsCustomDataset is the BasicDataset implementation for SparkObjectDataset. +func (sod SparkObjectDataset) AsCustomDataset() (*CustomDataset, bool) { + return nil, false +} + +// AsCassandraTableDataset is the BasicDataset implementation for SparkObjectDataset. +func (sod SparkObjectDataset) AsCassandraTableDataset() (*CassandraTableDataset, bool) { + return nil, false +} + +// AsAzureSQLDWTableDataset is the BasicDataset implementation for SparkObjectDataset. +func (sod SparkObjectDataset) AsAzureSQLDWTableDataset() (*AzureSQLDWTableDataset, bool) { + return nil, false +} + +// AsAzureSQLTableDataset is the BasicDataset implementation for SparkObjectDataset. +func (sod SparkObjectDataset) AsAzureSQLTableDataset() (*AzureSQLTableDataset, bool) { + return nil, false +} + +// AsAzureTableDataset is the BasicDataset implementation for SparkObjectDataset. +func (sod SparkObjectDataset) AsAzureTableDataset() (*AzureTableDataset, bool) { + return nil, false +} + +// AsAzureBlobDataset is the BasicDataset implementation for SparkObjectDataset. +func (sod SparkObjectDataset) AsAzureBlobDataset() (*AzureBlobDataset, bool) { + return nil, false +} + +// AsAmazonS3Dataset is the BasicDataset implementation for SparkObjectDataset. +func (sod SparkObjectDataset) AsAmazonS3Dataset() (*AmazonS3Dataset, bool) { + return nil, false +} + +// AsDataset is the BasicDataset implementation for SparkObjectDataset. +func (sod SparkObjectDataset) AsDataset() (*Dataset, bool) { + return nil, false +} + +// AsBasicDataset is the BasicDataset implementation for SparkObjectDataset. +func (sod SparkObjectDataset) AsBasicDataset() (BasicDataset, bool) { + return &sod, true +} + +// SparkSource a copy activity Spark Server source. +type SparkSource struct { + // Query - A query to retrieve data from source. Type: string (or Expression with resultType string). + Query interface{} `json:"query,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // SourceRetryCount - Source retry count. Type: integer (or Expression with resultType integer). + SourceRetryCount interface{} `json:"sourceRetryCount,omitempty"` + // SourceRetryWait - Source retry wait. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` + // Type - Possible values include: 'TypeCopySource', 'TypeAmazonRedshiftSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeHTTPSource', 'TypeAzureDataLakeStoreSource', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeRelationalSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource' + Type TypeBasicCopySource `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for SparkSource. +func (ss SparkSource) MarshalJSON() ([]byte, error) { + ss.Type = TypeSparkSource + objectMap := make(map[string]interface{}) + objectMap["query"] = ss.Query + objectMap["sourceRetryCount"] = ss.SourceRetryCount + objectMap["sourceRetryWait"] = ss.SourceRetryWait + if ss.Type != "" { + objectMap["type"] = ss.Type + } + for k, v := range ss.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsAmazonRedshiftSource is the BasicCopySource implementation for SparkSource. +func (ss SparkSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { + return nil, false +} + +// AsResponsysSource is the BasicCopySource implementation for SparkSource. +func (ss SparkSource) AsResponsysSource() (*ResponsysSource, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudSource is the BasicCopySource implementation for SparkSource. +func (ss SparkSource) AsSalesforceMarketingCloudSource() (*SalesforceMarketingCloudSource, bool) { + return nil, false +} + +// AsVerticaSource is the BasicCopySource implementation for SparkSource. +func (ss SparkSource) AsVerticaSource() (*VerticaSource, bool) { + return nil, false +} + +// AsNetezzaSource is the BasicCopySource implementation for SparkSource. +func (ss SparkSource) AsNetezzaSource() (*NetezzaSource, bool) { + return nil, false +} + +// AsZohoSource is the BasicCopySource implementation for SparkSource. +func (ss SparkSource) AsZohoSource() (*ZohoSource, bool) { + return nil, false +} + +// AsXeroSource is the BasicCopySource implementation for SparkSource. +func (ss SparkSource) AsXeroSource() (*XeroSource, bool) { + return nil, false +} + +// AsSquareSource is the BasicCopySource implementation for SparkSource. +func (ss SparkSource) AsSquareSource() (*SquareSource, bool) { + return nil, false +} + +// AsSparkSource is the BasicCopySource implementation for SparkSource. +func (ss SparkSource) AsSparkSource() (*SparkSource, bool) { + return &ss, true +} + +// AsShopifySource is the BasicCopySource implementation for SparkSource. +func (ss SparkSource) AsShopifySource() (*ShopifySource, bool) { + return nil, false +} + +// AsServiceNowSource is the BasicCopySource implementation for SparkSource. +func (ss SparkSource) AsServiceNowSource() (*ServiceNowSource, bool) { + return nil, false +} + +// AsQuickBooksSource is the BasicCopySource implementation for SparkSource. +func (ss SparkSource) AsQuickBooksSource() (*QuickBooksSource, bool) { + return nil, false +} + +// AsPrestoSource is the BasicCopySource implementation for SparkSource. +func (ss SparkSource) AsPrestoSource() (*PrestoSource, bool) { + return nil, false +} + +// AsPhoenixSource is the BasicCopySource implementation for SparkSource. +func (ss SparkSource) AsPhoenixSource() (*PhoenixSource, bool) { + return nil, false +} + +// AsPaypalSource is the BasicCopySource implementation for SparkSource. +func (ss SparkSource) AsPaypalSource() (*PaypalSource, bool) { + return nil, false +} + +// AsMarketoSource is the BasicCopySource implementation for SparkSource. +func (ss SparkSource) AsMarketoSource() (*MarketoSource, bool) { + return nil, false +} + +// AsMariaDBSource is the BasicCopySource implementation for SparkSource. +func (ss SparkSource) AsMariaDBSource() (*MariaDBSource, bool) { + return nil, false +} + +// AsMagentoSource is the BasicCopySource implementation for SparkSource. +func (ss SparkSource) AsMagentoSource() (*MagentoSource, bool) { + return nil, false +} + +// AsJiraSource is the BasicCopySource implementation for SparkSource. +func (ss SparkSource) AsJiraSource() (*JiraSource, bool) { + return nil, false +} + +// AsImpalaSource is the BasicCopySource implementation for SparkSource. +func (ss SparkSource) AsImpalaSource() (*ImpalaSource, bool) { + return nil, false +} + +// AsHubspotSource is the BasicCopySource implementation for SparkSource. +func (ss SparkSource) AsHubspotSource() (*HubspotSource, bool) { + return nil, false +} + +// AsHiveSource is the BasicCopySource implementation for SparkSource. +func (ss SparkSource) AsHiveSource() (*HiveSource, bool) { + return nil, false +} + +// AsHBaseSource is the BasicCopySource implementation for SparkSource. +func (ss SparkSource) AsHBaseSource() (*HBaseSource, bool) { + return nil, false +} + +// AsGreenplumSource is the BasicCopySource implementation for SparkSource. +func (ss SparkSource) AsGreenplumSource() (*GreenplumSource, bool) { + return nil, false +} + +// AsGoogleBigQuerySource is the BasicCopySource implementation for SparkSource. +func (ss SparkSource) AsGoogleBigQuerySource() (*GoogleBigQuerySource, bool) { + return nil, false +} + +// AsEloquaSource is the BasicCopySource implementation for SparkSource. +func (ss SparkSource) AsEloquaSource() (*EloquaSource, bool) { + return nil, false +} + +// AsDrillSource is the BasicCopySource implementation for SparkSource. +func (ss SparkSource) AsDrillSource() (*DrillSource, bool) { + return nil, false +} + +// AsCouchbaseSource is the BasicCopySource implementation for SparkSource. +func (ss SparkSource) AsCouchbaseSource() (*CouchbaseSource, bool) { + return nil, false +} + +// AsConcurSource is the BasicCopySource implementation for SparkSource. +func (ss SparkSource) AsConcurSource() (*ConcurSource, bool) { + return nil, false +} + +// AsAzurePostgreSQLSource is the BasicCopySource implementation for SparkSource. +func (ss SparkSource) AsAzurePostgreSQLSource() (*AzurePostgreSQLSource, bool) { + return nil, false +} + +// AsAmazonMWSSource is the BasicCopySource implementation for SparkSource. +func (ss SparkSource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { + return nil, false +} + +// AsHTTPSource is the BasicCopySource implementation for SparkSource. +func (ss SparkSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for SparkSource. +func (ss SparkSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for SparkSource. +func (ss SparkSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsCassandraSource is the BasicCopySource implementation for SparkSource. +func (ss SparkSource) AsCassandraSource() (*CassandraSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for SparkSource. +func (ss SparkSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for SparkSource. +func (ss SparkSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureMySQLSource is the BasicCopySource implementation for SparkSource. +func (ss SparkSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for SparkSource. +func (ss SparkSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for SparkSource. +func (ss SparkSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsSQLDWSource is the BasicCopySource implementation for SparkSource. +func (ss SparkSource) AsSQLDWSource() (*SQLDWSource, bool) { + return nil, false +} + +// AsSQLSource is the BasicCopySource implementation for SparkSource. +func (ss SparkSource) AsSQLSource() (*SQLSource, bool) { + return nil, false +} + +// AsSapEccSource is the BasicCopySource implementation for SparkSource. +func (ss SparkSource) AsSapEccSource() (*SapEccSource, bool) { + return nil, false +} + +// AsSapCloudForCustomerSource is the BasicCopySource implementation for SparkSource. +func (ss SparkSource) AsSapCloudForCustomerSource() (*SapCloudForCustomerSource, bool) { + return nil, false +} + +// AsSalesforceSource is the BasicCopySource implementation for SparkSource. +func (ss SparkSource) AsSalesforceSource() (*SalesforceSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for SparkSource. +func (ss SparkSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for SparkSource. +func (ss SparkSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for SparkSource. +func (ss SparkSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for SparkSource. +func (ss SparkSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + +// AsAzureTableSource is the BasicCopySource implementation for SparkSource. +func (ss SparkSource) AsAzureTableSource() (*AzureTableSource, bool) { + return nil, false +} + +// AsCopySource is the BasicCopySource implementation for SparkSource. +func (ss SparkSource) AsCopySource() (*CopySource, bool) { + return nil, false +} + +// AsBasicCopySource is the BasicCopySource implementation for SparkSource. +func (ss SparkSource) AsBasicCopySource() (BasicCopySource, bool) { + return &ss, true +} + +// SQLDWSink a copy activity SQL Data Warehouse sink. +type SQLDWSink struct { + // PreCopyScript - SQL pre-copy script. Type: string (or Expression with resultType string). + PreCopyScript interface{} `json:"preCopyScript,omitempty"` + // AllowPolyBase - Indicates to use PolyBase to copy data into SQL Data Warehouse when applicable. Type: boolean (or Expression with resultType boolean). + AllowPolyBase interface{} `json:"allowPolyBase,omitempty"` + // PolyBaseSettings - Specifies PolyBase-related settings when allowPolyBase is true. + PolyBaseSettings *PolybaseSettings `json:"polyBaseSettings,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // WriteBatchSize - Write batch size. Type: integer (or Expression with resultType integer), minimum: 0. + WriteBatchSize interface{} `json:"writeBatchSize,omitempty"` + // WriteBatchTimeout - Write batch timeout. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + WriteBatchTimeout interface{} `json:"writeBatchTimeout,omitempty"` + // SinkRetryCount - Sink retry count. Type: integer (or Expression with resultType integer). + SinkRetryCount interface{} `json:"sinkRetryCount,omitempty"` + // SinkRetryWait - Sink retry wait. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + SinkRetryWait interface{} `json:"sinkRetryWait,omitempty"` + // Type - Possible values include: 'TypeCopySink', 'TypeSalesforceSink', 'TypeDynamicsSink', 'TypeOdbcSink', 'TypeAzureSearchIndexSink', 'TypeAzureDataLakeStoreSink', 'TypeOracleSink', 'TypeSQLDWSink', 'TypeSQLSink', 'TypeDocumentDbCollectionSink', 'TypeFileSystemSink', 'TypeBlobSink', 'TypeAzureTableSink', 'TypeAzureQueueSink', 'TypeSapCloudForCustomerSink' + Type TypeBasicCopySink `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for SQLDWSink. +func (sds SQLDWSink) MarshalJSON() ([]byte, error) { + sds.Type = TypeSQLDWSink + objectMap := make(map[string]interface{}) + objectMap["preCopyScript"] = sds.PreCopyScript + objectMap["allowPolyBase"] = sds.AllowPolyBase + if sds.PolyBaseSettings != nil { + objectMap["polyBaseSettings"] = sds.PolyBaseSettings + } + objectMap["writeBatchSize"] = sds.WriteBatchSize + objectMap["writeBatchTimeout"] = sds.WriteBatchTimeout + objectMap["sinkRetryCount"] = sds.SinkRetryCount + objectMap["sinkRetryWait"] = sds.SinkRetryWait + if sds.Type != "" { + objectMap["type"] = sds.Type + } + for k, v := range sds.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsSalesforceSink is the BasicCopySink implementation for SQLDWSink. +func (sds SQLDWSink) AsSalesforceSink() (*SalesforceSink, bool) { + return nil, false +} + +// AsDynamicsSink is the BasicCopySink implementation for SQLDWSink. +func (sds SQLDWSink) AsDynamicsSink() (*DynamicsSink, bool) { + return nil, false +} + +// AsOdbcSink is the BasicCopySink implementation for SQLDWSink. +func (sds SQLDWSink) AsOdbcSink() (*OdbcSink, bool) { + return nil, false +} + +// AsAzureSearchIndexSink is the BasicCopySink implementation for SQLDWSink. +func (sds SQLDWSink) AsAzureSearchIndexSink() (*AzureSearchIndexSink, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSink is the BasicCopySink implementation for SQLDWSink. +func (sds SQLDWSink) AsAzureDataLakeStoreSink() (*AzureDataLakeStoreSink, bool) { + return nil, false +} + +// AsOracleSink is the BasicCopySink implementation for SQLDWSink. +func (sds SQLDWSink) AsOracleSink() (*OracleSink, bool) { + return nil, false +} + +// AsSQLDWSink is the BasicCopySink implementation for SQLDWSink. +func (sds SQLDWSink) AsSQLDWSink() (*SQLDWSink, bool) { + return &sds, true +} + +// AsSQLSink is the BasicCopySink implementation for SQLDWSink. +func (sds SQLDWSink) AsSQLSink() (*SQLSink, bool) { + return nil, false +} + +// AsDocumentDbCollectionSink is the BasicCopySink implementation for SQLDWSink. +func (sds SQLDWSink) AsDocumentDbCollectionSink() (*DocumentDbCollectionSink, bool) { + return nil, false +} + +// AsFileSystemSink is the BasicCopySink implementation for SQLDWSink. +func (sds SQLDWSink) AsFileSystemSink() (*FileSystemSink, bool) { + return nil, false +} + +// AsBlobSink is the BasicCopySink implementation for SQLDWSink. +func (sds SQLDWSink) AsBlobSink() (*BlobSink, bool) { + return nil, false +} + +// AsAzureTableSink is the BasicCopySink implementation for SQLDWSink. +func (sds SQLDWSink) AsAzureTableSink() (*AzureTableSink, bool) { + return nil, false +} + +// AsAzureQueueSink is the BasicCopySink implementation for SQLDWSink. +func (sds SQLDWSink) AsAzureQueueSink() (*AzureQueueSink, bool) { + return nil, false +} + +// AsSapCloudForCustomerSink is the BasicCopySink implementation for SQLDWSink. +func (sds SQLDWSink) AsSapCloudForCustomerSink() (*SapCloudForCustomerSink, bool) { + return nil, false +} + +// AsCopySink is the BasicCopySink implementation for SQLDWSink. +func (sds SQLDWSink) AsCopySink() (*CopySink, bool) { + return nil, false +} + +// AsBasicCopySink is the BasicCopySink implementation for SQLDWSink. +func (sds SQLDWSink) AsBasicCopySink() (BasicCopySink, bool) { + return &sds, true +} + +// SQLDWSource a copy activity SQL Data Warehouse source. +type SQLDWSource struct { + // SQLReaderQuery - SQL Data Warehouse reader query. Type: string (or Expression with resultType string). + SQLReaderQuery interface{} `json:"sqlReaderQuery,omitempty"` + // SQLReaderStoredProcedureName - Name of the stored procedure for a SQL Data Warehouse source. This cannot be used at the same time as SqlReaderQuery. Type: string (or Expression with resultType string). + SQLReaderStoredProcedureName interface{} `json:"sqlReaderStoredProcedureName,omitempty"` + // StoredProcedureParameters - Value and type setting for stored procedure parameters. Example: "{Parameter1: {value: "1", type: "int"}}". Type: object (or Expression with resultType object), itemType: StoredProcedureParameter. + StoredProcedureParameters interface{} `json:"storedProcedureParameters,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // SourceRetryCount - Source retry count. Type: integer (or Expression with resultType integer). + SourceRetryCount interface{} `json:"sourceRetryCount,omitempty"` + // SourceRetryWait - Source retry wait. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` + // Type - Possible values include: 'TypeCopySource', 'TypeAmazonRedshiftSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeHTTPSource', 'TypeAzureDataLakeStoreSource', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeRelationalSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource' + Type TypeBasicCopySource `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for SQLDWSource. +func (sds SQLDWSource) MarshalJSON() ([]byte, error) { + sds.Type = TypeSQLDWSource + objectMap := make(map[string]interface{}) + objectMap["sqlReaderQuery"] = sds.SQLReaderQuery + objectMap["sqlReaderStoredProcedureName"] = sds.SQLReaderStoredProcedureName + objectMap["storedProcedureParameters"] = sds.StoredProcedureParameters + objectMap["sourceRetryCount"] = sds.SourceRetryCount + objectMap["sourceRetryWait"] = sds.SourceRetryWait + if sds.Type != "" { + objectMap["type"] = sds.Type + } + for k, v := range sds.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsAmazonRedshiftSource is the BasicCopySource implementation for SQLDWSource. +func (sds SQLDWSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { + return nil, false +} + +// AsResponsysSource is the BasicCopySource implementation for SQLDWSource. +func (sds SQLDWSource) AsResponsysSource() (*ResponsysSource, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudSource is the BasicCopySource implementation for SQLDWSource. +func (sds SQLDWSource) AsSalesforceMarketingCloudSource() (*SalesforceMarketingCloudSource, bool) { + return nil, false +} + +// AsVerticaSource is the BasicCopySource implementation for SQLDWSource. +func (sds SQLDWSource) AsVerticaSource() (*VerticaSource, bool) { + return nil, false +} + +// AsNetezzaSource is the BasicCopySource implementation for SQLDWSource. +func (sds SQLDWSource) AsNetezzaSource() (*NetezzaSource, bool) { + return nil, false +} + +// AsZohoSource is the BasicCopySource implementation for SQLDWSource. +func (sds SQLDWSource) AsZohoSource() (*ZohoSource, bool) { + return nil, false +} + +// AsXeroSource is the BasicCopySource implementation for SQLDWSource. +func (sds SQLDWSource) AsXeroSource() (*XeroSource, bool) { + return nil, false +} + +// AsSquareSource is the BasicCopySource implementation for SQLDWSource. +func (sds SQLDWSource) AsSquareSource() (*SquareSource, bool) { + return nil, false +} + +// AsSparkSource is the BasicCopySource implementation for SQLDWSource. +func (sds SQLDWSource) AsSparkSource() (*SparkSource, bool) { + return nil, false +} + +// AsShopifySource is the BasicCopySource implementation for SQLDWSource. +func (sds SQLDWSource) AsShopifySource() (*ShopifySource, bool) { + return nil, false +} + +// AsServiceNowSource is the BasicCopySource implementation for SQLDWSource. +func (sds SQLDWSource) AsServiceNowSource() (*ServiceNowSource, bool) { + return nil, false +} + +// AsQuickBooksSource is the BasicCopySource implementation for SQLDWSource. +func (sds SQLDWSource) AsQuickBooksSource() (*QuickBooksSource, bool) { + return nil, false +} + +// AsPrestoSource is the BasicCopySource implementation for SQLDWSource. +func (sds SQLDWSource) AsPrestoSource() (*PrestoSource, bool) { + return nil, false +} + +// AsPhoenixSource is the BasicCopySource implementation for SQLDWSource. +func (sds SQLDWSource) AsPhoenixSource() (*PhoenixSource, bool) { + return nil, false +} + +// AsPaypalSource is the BasicCopySource implementation for SQLDWSource. +func (sds SQLDWSource) AsPaypalSource() (*PaypalSource, bool) { + return nil, false +} + +// AsMarketoSource is the BasicCopySource implementation for SQLDWSource. +func (sds SQLDWSource) AsMarketoSource() (*MarketoSource, bool) { + return nil, false +} + +// AsMariaDBSource is the BasicCopySource implementation for SQLDWSource. +func (sds SQLDWSource) AsMariaDBSource() (*MariaDBSource, bool) { + return nil, false +} + +// AsMagentoSource is the BasicCopySource implementation for SQLDWSource. +func (sds SQLDWSource) AsMagentoSource() (*MagentoSource, bool) { + return nil, false +} + +// AsJiraSource is the BasicCopySource implementation for SQLDWSource. +func (sds SQLDWSource) AsJiraSource() (*JiraSource, bool) { + return nil, false +} + +// AsImpalaSource is the BasicCopySource implementation for SQLDWSource. +func (sds SQLDWSource) AsImpalaSource() (*ImpalaSource, bool) { + return nil, false +} + +// AsHubspotSource is the BasicCopySource implementation for SQLDWSource. +func (sds SQLDWSource) AsHubspotSource() (*HubspotSource, bool) { + return nil, false +} + +// AsHiveSource is the BasicCopySource implementation for SQLDWSource. +func (sds SQLDWSource) AsHiveSource() (*HiveSource, bool) { + return nil, false +} + +// AsHBaseSource is the BasicCopySource implementation for SQLDWSource. +func (sds SQLDWSource) AsHBaseSource() (*HBaseSource, bool) { + return nil, false +} + +// AsGreenplumSource is the BasicCopySource implementation for SQLDWSource. +func (sds SQLDWSource) AsGreenplumSource() (*GreenplumSource, bool) { + return nil, false +} + +// AsGoogleBigQuerySource is the BasicCopySource implementation for SQLDWSource. +func (sds SQLDWSource) AsGoogleBigQuerySource() (*GoogleBigQuerySource, bool) { + return nil, false +} + +// AsEloquaSource is the BasicCopySource implementation for SQLDWSource. +func (sds SQLDWSource) AsEloquaSource() (*EloquaSource, bool) { + return nil, false +} + +// AsDrillSource is the BasicCopySource implementation for SQLDWSource. +func (sds SQLDWSource) AsDrillSource() (*DrillSource, bool) { + return nil, false +} + +// AsCouchbaseSource is the BasicCopySource implementation for SQLDWSource. +func (sds SQLDWSource) AsCouchbaseSource() (*CouchbaseSource, bool) { + return nil, false +} + +// AsConcurSource is the BasicCopySource implementation for SQLDWSource. +func (sds SQLDWSource) AsConcurSource() (*ConcurSource, bool) { + return nil, false +} + +// AsAzurePostgreSQLSource is the BasicCopySource implementation for SQLDWSource. +func (sds SQLDWSource) AsAzurePostgreSQLSource() (*AzurePostgreSQLSource, bool) { + return nil, false +} + +// AsAmazonMWSSource is the BasicCopySource implementation for SQLDWSource. +func (sds SQLDWSource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { + return nil, false +} + +// AsHTTPSource is the BasicCopySource implementation for SQLDWSource. +func (sds SQLDWSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for SQLDWSource. +func (sds SQLDWSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for SQLDWSource. +func (sds SQLDWSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsCassandraSource is the BasicCopySource implementation for SQLDWSource. +func (sds SQLDWSource) AsCassandraSource() (*CassandraSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for SQLDWSource. +func (sds SQLDWSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for SQLDWSource. +func (sds SQLDWSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureMySQLSource is the BasicCopySource implementation for SQLDWSource. +func (sds SQLDWSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for SQLDWSource. +func (sds SQLDWSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for SQLDWSource. +func (sds SQLDWSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsSQLDWSource is the BasicCopySource implementation for SQLDWSource. +func (sds SQLDWSource) AsSQLDWSource() (*SQLDWSource, bool) { + return &sds, true +} + +// AsSQLSource is the BasicCopySource implementation for SQLDWSource. +func (sds SQLDWSource) AsSQLSource() (*SQLSource, bool) { + return nil, false +} + +// AsSapEccSource is the BasicCopySource implementation for SQLDWSource. +func (sds SQLDWSource) AsSapEccSource() (*SapEccSource, bool) { + return nil, false +} + +// AsSapCloudForCustomerSource is the BasicCopySource implementation for SQLDWSource. +func (sds SQLDWSource) AsSapCloudForCustomerSource() (*SapCloudForCustomerSource, bool) { + return nil, false +} + +// AsSalesforceSource is the BasicCopySource implementation for SQLDWSource. +func (sds SQLDWSource) AsSalesforceSource() (*SalesforceSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for SQLDWSource. +func (sds SQLDWSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for SQLDWSource. +func (sds SQLDWSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for SQLDWSource. +func (sds SQLDWSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for SQLDWSource. +func (sds SQLDWSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + +// AsAzureTableSource is the BasicCopySource implementation for SQLDWSource. +func (sds SQLDWSource) AsAzureTableSource() (*AzureTableSource, bool) { + return nil, false +} + +// AsCopySource is the BasicCopySource implementation for SQLDWSource. +func (sds SQLDWSource) AsCopySource() (*CopySource, bool) { + return nil, false +} + +// AsBasicCopySource is the BasicCopySource implementation for SQLDWSource. +func (sds SQLDWSource) AsBasicCopySource() (BasicCopySource, bool) { + return &sds, true +} + +// SQLServerLinkedService SQL Server linked service. +type SQLServerLinkedService struct { + // SQLServerLinkedServiceTypeProperties - SQL Server linked service properties. + *SQLServerLinkedServiceTypeProperties `json:"typeProperties,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // ConnectVia - The integration runtime reference. + ConnectVia *IntegrationRuntimeReference `json:"connectVia,omitempty"` + // Description - Linked service description. + Description *string `json:"description,omitempty"` + // Parameters - Parameters for linked service. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeLinkedService', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforce', 'TypeAzureDataLakeStore', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureStorage' + Type TypeBasicLinkedService `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for SQLServerLinkedService. +func (ssls SQLServerLinkedService) MarshalJSON() ([]byte, error) { + ssls.Type = TypeSQLServer + objectMap := make(map[string]interface{}) + if ssls.SQLServerLinkedServiceTypeProperties != nil { + objectMap["typeProperties"] = ssls.SQLServerLinkedServiceTypeProperties + } + if ssls.ConnectVia != nil { + objectMap["connectVia"] = ssls.ConnectVia + } + if ssls.Description != nil { + objectMap["description"] = ssls.Description + } + if ssls.Parameters != nil { + objectMap["parameters"] = ssls.Parameters + } + if ssls.Annotations != nil { + objectMap["annotations"] = ssls.Annotations + } + if ssls.Type != "" { + objectMap["type"] = ssls.Type + } + for k, v := range ssls.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysLinkedService is the BasicLinkedService implementation for SQLServerLinkedService. +func (ssls SQLServerLinkedService) AsResponsysLinkedService() (*ResponsysLinkedService, bool) { + return nil, false +} + +// AsAzureDatabricksLinkedService is the BasicLinkedService implementation for SQLServerLinkedService. +func (ssls SQLServerLinkedService) AsAzureDatabricksLinkedService() (*AzureDatabricksLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeAnalyticsLinkedService is the BasicLinkedService implementation for SQLServerLinkedService. +func (ssls SQLServerLinkedService) AsAzureDataLakeAnalyticsLinkedService() (*AzureDataLakeAnalyticsLinkedService, bool) { + return nil, false +} + +// AsHDInsightOnDemandLinkedService is the BasicLinkedService implementation for SQLServerLinkedService. +func (ssls SQLServerLinkedService) AsHDInsightOnDemandLinkedService() (*HDInsightOnDemandLinkedService, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudLinkedService is the BasicLinkedService implementation for SQLServerLinkedService. +func (ssls SQLServerLinkedService) AsSalesforceMarketingCloudLinkedService() (*SalesforceMarketingCloudLinkedService, bool) { + return nil, false +} + +// AsNetezzaLinkedService is the BasicLinkedService implementation for SQLServerLinkedService. +func (ssls SQLServerLinkedService) AsNetezzaLinkedService() (*NetezzaLinkedService, bool) { + return nil, false +} + +// AsVerticaLinkedService is the BasicLinkedService implementation for SQLServerLinkedService. +func (ssls SQLServerLinkedService) AsVerticaLinkedService() (*VerticaLinkedService, bool) { + return nil, false +} + +// AsZohoLinkedService is the BasicLinkedService implementation for SQLServerLinkedService. +func (ssls SQLServerLinkedService) AsZohoLinkedService() (*ZohoLinkedService, bool) { + return nil, false +} + +// AsXeroLinkedService is the BasicLinkedService implementation for SQLServerLinkedService. +func (ssls SQLServerLinkedService) AsXeroLinkedService() (*XeroLinkedService, bool) { + return nil, false +} + +// AsSquareLinkedService is the BasicLinkedService implementation for SQLServerLinkedService. +func (ssls SQLServerLinkedService) AsSquareLinkedService() (*SquareLinkedService, bool) { + return nil, false +} + +// AsSparkLinkedService is the BasicLinkedService implementation for SQLServerLinkedService. +func (ssls SQLServerLinkedService) AsSparkLinkedService() (*SparkLinkedService, bool) { + return nil, false +} + +// AsShopifyLinkedService is the BasicLinkedService implementation for SQLServerLinkedService. +func (ssls SQLServerLinkedService) AsShopifyLinkedService() (*ShopifyLinkedService, bool) { + return nil, false +} + +// AsServiceNowLinkedService is the BasicLinkedService implementation for SQLServerLinkedService. +func (ssls SQLServerLinkedService) AsServiceNowLinkedService() (*ServiceNowLinkedService, bool) { + return nil, false +} + +// AsQuickBooksLinkedService is the BasicLinkedService implementation for SQLServerLinkedService. +func (ssls SQLServerLinkedService) AsQuickBooksLinkedService() (*QuickBooksLinkedService, bool) { + return nil, false +} + +// AsPrestoLinkedService is the BasicLinkedService implementation for SQLServerLinkedService. +func (ssls SQLServerLinkedService) AsPrestoLinkedService() (*PrestoLinkedService, bool) { + return nil, false +} + +// AsPhoenixLinkedService is the BasicLinkedService implementation for SQLServerLinkedService. +func (ssls SQLServerLinkedService) AsPhoenixLinkedService() (*PhoenixLinkedService, bool) { + return nil, false +} + +// AsPaypalLinkedService is the BasicLinkedService implementation for SQLServerLinkedService. +func (ssls SQLServerLinkedService) AsPaypalLinkedService() (*PaypalLinkedService, bool) { + return nil, false +} + +// AsMarketoLinkedService is the BasicLinkedService implementation for SQLServerLinkedService. +func (ssls SQLServerLinkedService) AsMarketoLinkedService() (*MarketoLinkedService, bool) { + return nil, false +} + +// AsMariaDBLinkedService is the BasicLinkedService implementation for SQLServerLinkedService. +func (ssls SQLServerLinkedService) AsMariaDBLinkedService() (*MariaDBLinkedService, bool) { + return nil, false +} + +// AsMagentoLinkedService is the BasicLinkedService implementation for SQLServerLinkedService. +func (ssls SQLServerLinkedService) AsMagentoLinkedService() (*MagentoLinkedService, bool) { + return nil, false +} + +// AsJiraLinkedService is the BasicLinkedService implementation for SQLServerLinkedService. +func (ssls SQLServerLinkedService) AsJiraLinkedService() (*JiraLinkedService, bool) { + return nil, false +} + +// AsImpalaLinkedService is the BasicLinkedService implementation for SQLServerLinkedService. +func (ssls SQLServerLinkedService) AsImpalaLinkedService() (*ImpalaLinkedService, bool) { + return nil, false +} + +// AsHubspotLinkedService is the BasicLinkedService implementation for SQLServerLinkedService. +func (ssls SQLServerLinkedService) AsHubspotLinkedService() (*HubspotLinkedService, bool) { + return nil, false +} + +// AsHiveLinkedService is the BasicLinkedService implementation for SQLServerLinkedService. +func (ssls SQLServerLinkedService) AsHiveLinkedService() (*HiveLinkedService, bool) { + return nil, false +} + +// AsHBaseLinkedService is the BasicLinkedService implementation for SQLServerLinkedService. +func (ssls SQLServerLinkedService) AsHBaseLinkedService() (*HBaseLinkedService, bool) { + return nil, false +} + +// AsGreenplumLinkedService is the BasicLinkedService implementation for SQLServerLinkedService. +func (ssls SQLServerLinkedService) AsGreenplumLinkedService() (*GreenplumLinkedService, bool) { + return nil, false +} + +// AsGoogleBigQueryLinkedService is the BasicLinkedService implementation for SQLServerLinkedService. +func (ssls SQLServerLinkedService) AsGoogleBigQueryLinkedService() (*GoogleBigQueryLinkedService, bool) { + return nil, false +} + +// AsEloquaLinkedService is the BasicLinkedService implementation for SQLServerLinkedService. +func (ssls SQLServerLinkedService) AsEloquaLinkedService() (*EloquaLinkedService, bool) { + return nil, false +} + +// AsDrillLinkedService is the BasicLinkedService implementation for SQLServerLinkedService. +func (ssls SQLServerLinkedService) AsDrillLinkedService() (*DrillLinkedService, bool) { + return nil, false +} + +// AsCouchbaseLinkedService is the BasicLinkedService implementation for SQLServerLinkedService. +func (ssls SQLServerLinkedService) AsCouchbaseLinkedService() (*CouchbaseLinkedService, bool) { + return nil, false +} + +// AsConcurLinkedService is the BasicLinkedService implementation for SQLServerLinkedService. +func (ssls SQLServerLinkedService) AsConcurLinkedService() (*ConcurLinkedService, bool) { + return nil, false +} + +// AsAzurePostgreSQLLinkedService is the BasicLinkedService implementation for SQLServerLinkedService. +func (ssls SQLServerLinkedService) AsAzurePostgreSQLLinkedService() (*AzurePostgreSQLLinkedService, bool) { + return nil, false +} + +// AsAmazonMWSLinkedService is the BasicLinkedService implementation for SQLServerLinkedService. +func (ssls SQLServerLinkedService) AsAmazonMWSLinkedService() (*AmazonMWSLinkedService, bool) { + return nil, false +} + +// AsSapHanaLinkedService is the BasicLinkedService implementation for SQLServerLinkedService. +func (ssls SQLServerLinkedService) AsSapHanaLinkedService() (*SapHanaLinkedService, bool) { + return nil, false +} + +// AsSapBWLinkedService is the BasicLinkedService implementation for SQLServerLinkedService. +func (ssls SQLServerLinkedService) AsSapBWLinkedService() (*SapBWLinkedService, bool) { + return nil, false +} + +// AsSftpServerLinkedService is the BasicLinkedService implementation for SQLServerLinkedService. +func (ssls SQLServerLinkedService) AsSftpServerLinkedService() (*SftpServerLinkedService, bool) { + return nil, false +} + +// AsFtpServerLinkedService is the BasicLinkedService implementation for SQLServerLinkedService. +func (ssls SQLServerLinkedService) AsFtpServerLinkedService() (*FtpServerLinkedService, bool) { + return nil, false +} + +// AsHTTPLinkedService is the BasicLinkedService implementation for SQLServerLinkedService. +func (ssls SQLServerLinkedService) AsHTTPLinkedService() (*HTTPLinkedService, bool) { + return nil, false +} + +// AsAzureSearchLinkedService is the BasicLinkedService implementation for SQLServerLinkedService. +func (ssls SQLServerLinkedService) AsAzureSearchLinkedService() (*AzureSearchLinkedService, bool) { + return nil, false +} + +// AsCustomDataSourceLinkedService is the BasicLinkedService implementation for SQLServerLinkedService. +func (ssls SQLServerLinkedService) AsCustomDataSourceLinkedService() (*CustomDataSourceLinkedService, bool) { + return nil, false +} + +// AsAmazonRedshiftLinkedService is the BasicLinkedService implementation for SQLServerLinkedService. +func (ssls SQLServerLinkedService) AsAmazonRedshiftLinkedService() (*AmazonRedshiftLinkedService, bool) { + return nil, false +} + +// AsAmazonS3LinkedService is the BasicLinkedService implementation for SQLServerLinkedService. +func (ssls SQLServerLinkedService) AsAmazonS3LinkedService() (*AmazonS3LinkedService, bool) { + return nil, false +} + +// AsSapEccLinkedService is the BasicLinkedService implementation for SQLServerLinkedService. +func (ssls SQLServerLinkedService) AsSapEccLinkedService() (*SapEccLinkedService, bool) { + return nil, false +} + +// AsSapCloudForCustomerLinkedService is the BasicLinkedService implementation for SQLServerLinkedService. +func (ssls SQLServerLinkedService) AsSapCloudForCustomerLinkedService() (*SapCloudForCustomerLinkedService, bool) { + return nil, false +} + +// AsSalesforceLinkedService is the BasicLinkedService implementation for SQLServerLinkedService. +func (ssls SQLServerLinkedService) AsSalesforceLinkedService() (*SalesforceLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeStoreLinkedService is the BasicLinkedService implementation for SQLServerLinkedService. +func (ssls SQLServerLinkedService) AsAzureDataLakeStoreLinkedService() (*AzureDataLakeStoreLinkedService, bool) { + return nil, false +} + +// AsMongoDbLinkedService is the BasicLinkedService implementation for SQLServerLinkedService. +func (ssls SQLServerLinkedService) AsMongoDbLinkedService() (*MongoDbLinkedService, bool) { + return nil, false +} + +// AsCassandraLinkedService is the BasicLinkedService implementation for SQLServerLinkedService. +func (ssls SQLServerLinkedService) AsCassandraLinkedService() (*CassandraLinkedService, bool) { + return nil, false +} + +// AsWebLinkedService is the BasicLinkedService implementation for SQLServerLinkedService. +func (ssls SQLServerLinkedService) AsWebLinkedService() (*WebLinkedService, bool) { + return nil, false +} + +// AsODataLinkedService is the BasicLinkedService implementation for SQLServerLinkedService. +func (ssls SQLServerLinkedService) AsODataLinkedService() (*ODataLinkedService, bool) { + return nil, false +} + +// AsHdfsLinkedService is the BasicLinkedService implementation for SQLServerLinkedService. +func (ssls SQLServerLinkedService) AsHdfsLinkedService() (*HdfsLinkedService, bool) { + return nil, false +} + +// AsOdbcLinkedService is the BasicLinkedService implementation for SQLServerLinkedService. +func (ssls SQLServerLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, bool) { + return nil, false +} + +// AsAzureMLLinkedService is the BasicLinkedService implementation for SQLServerLinkedService. +func (ssls SQLServerLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { + return nil, false +} + +// AsTeradataLinkedService is the BasicLinkedService implementation for SQLServerLinkedService. +func (ssls SQLServerLinkedService) AsTeradataLinkedService() (*TeradataLinkedService, bool) { + return nil, false +} + +// AsDb2LinkedService is the BasicLinkedService implementation for SQLServerLinkedService. +func (ssls SQLServerLinkedService) AsDb2LinkedService() (*Db2LinkedService, bool) { + return nil, false +} + +// AsSybaseLinkedService is the BasicLinkedService implementation for SQLServerLinkedService. +func (ssls SQLServerLinkedService) AsSybaseLinkedService() (*SybaseLinkedService, bool) { + return nil, false +} + +// AsPostgreSQLLinkedService is the BasicLinkedService implementation for SQLServerLinkedService. +func (ssls SQLServerLinkedService) AsPostgreSQLLinkedService() (*PostgreSQLLinkedService, bool) { + return nil, false +} + +// AsMySQLLinkedService is the BasicLinkedService implementation for SQLServerLinkedService. +func (ssls SQLServerLinkedService) AsMySQLLinkedService() (*MySQLLinkedService, bool) { + return nil, false +} + +// AsAzureMySQLLinkedService is the BasicLinkedService implementation for SQLServerLinkedService. +func (ssls SQLServerLinkedService) AsAzureMySQLLinkedService() (*AzureMySQLLinkedService, bool) { + return nil, false +} + +// AsOracleLinkedService is the BasicLinkedService implementation for SQLServerLinkedService. +func (ssls SQLServerLinkedService) AsOracleLinkedService() (*OracleLinkedService, bool) { + return nil, false +} + +// AsFileServerLinkedService is the BasicLinkedService implementation for SQLServerLinkedService. +func (ssls SQLServerLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { + return nil, false +} + +// AsHDInsightLinkedService is the BasicLinkedService implementation for SQLServerLinkedService. +func (ssls SQLServerLinkedService) AsHDInsightLinkedService() (*HDInsightLinkedService, bool) { + return nil, false +} + +// AsDynamicsLinkedService is the BasicLinkedService implementation for SQLServerLinkedService. +func (ssls SQLServerLinkedService) AsDynamicsLinkedService() (*DynamicsLinkedService, bool) { + return nil, false +} + +// AsCosmosDbLinkedService is the BasicLinkedService implementation for SQLServerLinkedService. +func (ssls SQLServerLinkedService) AsCosmosDbLinkedService() (*CosmosDbLinkedService, bool) { + return nil, false +} + +// AsAzureKeyVaultLinkedService is the BasicLinkedService implementation for SQLServerLinkedService. +func (ssls SQLServerLinkedService) AsAzureKeyVaultLinkedService() (*AzureKeyVaultLinkedService, bool) { + return nil, false +} + +// AsAzureBatchLinkedService is the BasicLinkedService implementation for SQLServerLinkedService. +func (ssls SQLServerLinkedService) AsAzureBatchLinkedService() (*AzureBatchLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDatabaseLinkedService is the BasicLinkedService implementation for SQLServerLinkedService. +func (ssls SQLServerLinkedService) AsAzureSQLDatabaseLinkedService() (*AzureSQLDatabaseLinkedService, bool) { + return nil, false +} + +// AsSQLServerLinkedService is the BasicLinkedService implementation for SQLServerLinkedService. +func (ssls SQLServerLinkedService) AsSQLServerLinkedService() (*SQLServerLinkedService, bool) { + return &ssls, true +} + +// AsAzureSQLDWLinkedService is the BasicLinkedService implementation for SQLServerLinkedService. +func (ssls SQLServerLinkedService) AsAzureSQLDWLinkedService() (*AzureSQLDWLinkedService, bool) { + return nil, false +} + +// AsAzureStorageLinkedService is the BasicLinkedService implementation for SQLServerLinkedService. +func (ssls SQLServerLinkedService) AsAzureStorageLinkedService() (*AzureStorageLinkedService, bool) { + return nil, false +} + +// AsLinkedService is the BasicLinkedService implementation for SQLServerLinkedService. +func (ssls SQLServerLinkedService) AsLinkedService() (*LinkedService, bool) { + return nil, false +} + +// AsBasicLinkedService is the BasicLinkedService implementation for SQLServerLinkedService. +func (ssls SQLServerLinkedService) AsBasicLinkedService() (BasicLinkedService, bool) { + return &ssls, true +} + +// UnmarshalJSON is the custom unmarshaler for SQLServerLinkedService struct. +func (ssls *SQLServerLinkedService) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "typeProperties": + if v != nil { + var SQLServerLinkedServiceTypeProperties SQLServerLinkedServiceTypeProperties + err = json.Unmarshal(*v, &SQLServerLinkedServiceTypeProperties) + if err != nil { + return err + } + ssls.SQLServerLinkedServiceTypeProperties = &SQLServerLinkedServiceTypeProperties + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if ssls.AdditionalProperties == nil { + ssls.AdditionalProperties = make(map[string]interface{}) + } + ssls.AdditionalProperties[k] = additionalProperties + } + case "connectVia": + if v != nil { + var connectVia IntegrationRuntimeReference + err = json.Unmarshal(*v, &connectVia) + if err != nil { + return err + } + ssls.ConnectVia = &connectVia + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + ssls.Description = &description + } + case "parameters": + if v != nil { + var parameters map[string]*ParameterSpecification + err = json.Unmarshal(*v, ¶meters) + if err != nil { + return err + } + ssls.Parameters = parameters + } + case "annotations": + if v != nil { + var annotations []interface{} + err = json.Unmarshal(*v, &annotations) + if err != nil { + return err + } + ssls.Annotations = &annotations + } + case "type": + if v != nil { + var typeVar TypeBasicLinkedService + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ssls.Type = typeVar + } + } + } + + return nil +} + +// SQLServerLinkedServiceTypeProperties SQL Server linked service properties. +type SQLServerLinkedServiceTypeProperties struct { + // ConnectionString - The connection string. Type: string, SecureString or AzureKeyVaultSecretReference. + ConnectionString interface{} `json:"connectionString,omitempty"` + // UserName - The on-premises Windows authentication user name. Type: string (or Expression with resultType string). + UserName interface{} `json:"userName,omitempty"` + // Password - The on-premises Windows authentication password. + Password BasicSecretBase `json:"password,omitempty"` + // EncryptedCredential - The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string). + EncryptedCredential interface{} `json:"encryptedCredential,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for SQLServerLinkedServiceTypeProperties struct. +func (sslstp *SQLServerLinkedServiceTypeProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "connectionString": + if v != nil { + var connectionString interface{} + err = json.Unmarshal(*v, &connectionString) + if err != nil { + return err + } + sslstp.ConnectionString = connectionString + } + case "userName": + if v != nil { + var userName interface{} + err = json.Unmarshal(*v, &userName) + if err != nil { + return err + } + sslstp.UserName = userName + } + case "password": + if v != nil { + password, err := unmarshalBasicSecretBase(*v) + if err != nil { + return err + } + sslstp.Password = password + } + case "encryptedCredential": + if v != nil { + var encryptedCredential interface{} + err = json.Unmarshal(*v, &encryptedCredential) + if err != nil { + return err + } + sslstp.EncryptedCredential = encryptedCredential + } + } + } + + return nil +} + +// SQLServerStoredProcedureActivity SQL stored procedure activity type. +type SQLServerStoredProcedureActivity struct { + // SQLServerStoredProcedureActivityTypeProperties - SQL stored procedure activity properties. + *SQLServerStoredProcedureActivityTypeProperties `json:"typeProperties,omitempty"` + // LinkedServiceName - Linked service reference. + LinkedServiceName *LinkedServiceReference `json:"linkedServiceName,omitempty"` + // Policy - Activity policy. + Policy *ActivityPolicy `json:"policy,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Name - Activity name. + Name *string `json:"name,omitempty"` + // Description - Activity description. + Description *string `json:"description,omitempty"` + // DependsOn - Activity depends on condition. + DependsOn *[]ActivityDependency `json:"dependsOn,omitempty"` + // UserProperties - Activity user properties. + UserProperties map[string]*string `json:"userProperties"` + // Type - Possible values include: 'TypeActivity', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLUpdateResource', 'TypeAzureMLBatchExecution', 'TypeGetMetadata', 'TypeWebActivity', 'TypeLookup', 'TypeSQLServerStoredProcedure', 'TypeCustom', 'TypeExecuteSSISPackage', 'TypeHDInsightSpark', 'TypeHDInsightStreaming', 'TypeHDInsightMapReduce', 'TypeHDInsightPig', 'TypeHDInsightHive', 'TypeCopy', 'TypeExecution', 'TypeFilter', 'TypeUntil', 'TypeWait', 'TypeForEach', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' + Type TypeBasicActivity `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for SQLServerStoredProcedureActivity. +func (ssspa SQLServerStoredProcedureActivity) MarshalJSON() ([]byte, error) { + ssspa.Type = TypeSQLServerStoredProcedure + objectMap := make(map[string]interface{}) + if ssspa.SQLServerStoredProcedureActivityTypeProperties != nil { + objectMap["typeProperties"] = ssspa.SQLServerStoredProcedureActivityTypeProperties + } + if ssspa.LinkedServiceName != nil { + objectMap["linkedServiceName"] = ssspa.LinkedServiceName + } + if ssspa.Policy != nil { + objectMap["policy"] = ssspa.Policy + } + if ssspa.Name != nil { + objectMap["name"] = ssspa.Name + } + if ssspa.Description != nil { + objectMap["description"] = ssspa.Description + } + if ssspa.DependsOn != nil { + objectMap["dependsOn"] = ssspa.DependsOn + } + if ssspa.UserProperties != nil { + objectMap["userProperties"] = ssspa.UserProperties + } + if ssspa.Type != "" { + objectMap["type"] = ssspa.Type + } + for k, v := range ssspa.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsDatabricksNotebookActivity is the BasicActivity implementation for SQLServerStoredProcedureActivity. +func (ssspa SQLServerStoredProcedureActivity) AsDatabricksNotebookActivity() (*DatabricksNotebookActivity, bool) { + return nil, false +} + +// AsDataLakeAnalyticsUSQLActivity is the BasicActivity implementation for SQLServerStoredProcedureActivity. +func (ssspa SQLServerStoredProcedureActivity) AsDataLakeAnalyticsUSQLActivity() (*DataLakeAnalyticsUSQLActivity, bool) { + return nil, false +} + +// AsAzureMLUpdateResourceActivity is the BasicActivity implementation for SQLServerStoredProcedureActivity. +func (ssspa SQLServerStoredProcedureActivity) AsAzureMLUpdateResourceActivity() (*AzureMLUpdateResourceActivity, bool) { + return nil, false +} + +// AsAzureMLBatchExecutionActivity is the BasicActivity implementation for SQLServerStoredProcedureActivity. +func (ssspa SQLServerStoredProcedureActivity) AsAzureMLBatchExecutionActivity() (*AzureMLBatchExecutionActivity, bool) { + return nil, false +} + +// AsGetMetadataActivity is the BasicActivity implementation for SQLServerStoredProcedureActivity. +func (ssspa SQLServerStoredProcedureActivity) AsGetMetadataActivity() (*GetMetadataActivity, bool) { + return nil, false +} + +// AsWebActivity is the BasicActivity implementation for SQLServerStoredProcedureActivity. +func (ssspa SQLServerStoredProcedureActivity) AsWebActivity() (*WebActivity, bool) { + return nil, false +} + +// AsLookupActivity is the BasicActivity implementation for SQLServerStoredProcedureActivity. +func (ssspa SQLServerStoredProcedureActivity) AsLookupActivity() (*LookupActivity, bool) { + return nil, false +} + +// AsSQLServerStoredProcedureActivity is the BasicActivity implementation for SQLServerStoredProcedureActivity. +func (ssspa SQLServerStoredProcedureActivity) AsSQLServerStoredProcedureActivity() (*SQLServerStoredProcedureActivity, bool) { + return &ssspa, true +} + +// AsCustomActivity is the BasicActivity implementation for SQLServerStoredProcedureActivity. +func (ssspa SQLServerStoredProcedureActivity) AsCustomActivity() (*CustomActivity, bool) { + return nil, false +} + +// AsExecuteSSISPackageActivity is the BasicActivity implementation for SQLServerStoredProcedureActivity. +func (ssspa SQLServerStoredProcedureActivity) AsExecuteSSISPackageActivity() (*ExecuteSSISPackageActivity, bool) { + return nil, false +} + +// AsHDInsightSparkActivity is the BasicActivity implementation for SQLServerStoredProcedureActivity. +func (ssspa SQLServerStoredProcedureActivity) AsHDInsightSparkActivity() (*HDInsightSparkActivity, bool) { + return nil, false +} + +// AsHDInsightStreamingActivity is the BasicActivity implementation for SQLServerStoredProcedureActivity. +func (ssspa SQLServerStoredProcedureActivity) AsHDInsightStreamingActivity() (*HDInsightStreamingActivity, bool) { + return nil, false +} + +// AsHDInsightMapReduceActivity is the BasicActivity implementation for SQLServerStoredProcedureActivity. +func (ssspa SQLServerStoredProcedureActivity) AsHDInsightMapReduceActivity() (*HDInsightMapReduceActivity, bool) { + return nil, false +} + +// AsHDInsightPigActivity is the BasicActivity implementation for SQLServerStoredProcedureActivity. +func (ssspa SQLServerStoredProcedureActivity) AsHDInsightPigActivity() (*HDInsightPigActivity, bool) { + return nil, false +} + +// AsHDInsightHiveActivity is the BasicActivity implementation for SQLServerStoredProcedureActivity. +func (ssspa SQLServerStoredProcedureActivity) AsHDInsightHiveActivity() (*HDInsightHiveActivity, bool) { + return nil, false +} + +// AsCopyActivity is the BasicActivity implementation for SQLServerStoredProcedureActivity. +func (ssspa SQLServerStoredProcedureActivity) AsCopyActivity() (*CopyActivity, bool) { + return nil, false +} + +// AsExecutionActivity is the BasicActivity implementation for SQLServerStoredProcedureActivity. +func (ssspa SQLServerStoredProcedureActivity) AsExecutionActivity() (*ExecutionActivity, bool) { + return nil, false +} + +// AsBasicExecutionActivity is the BasicActivity implementation for SQLServerStoredProcedureActivity. +func (ssspa SQLServerStoredProcedureActivity) AsBasicExecutionActivity() (BasicExecutionActivity, bool) { + return &ssspa, true +} + +// AsFilterActivity is the BasicActivity implementation for SQLServerStoredProcedureActivity. +func (ssspa SQLServerStoredProcedureActivity) AsFilterActivity() (*FilterActivity, bool) { + return nil, false +} + +// AsUntilActivity is the BasicActivity implementation for SQLServerStoredProcedureActivity. +func (ssspa SQLServerStoredProcedureActivity) AsUntilActivity() (*UntilActivity, bool) { + return nil, false +} + +// AsWaitActivity is the BasicActivity implementation for SQLServerStoredProcedureActivity. +func (ssspa SQLServerStoredProcedureActivity) AsWaitActivity() (*WaitActivity, bool) { + return nil, false +} + +// AsForEachActivity is the BasicActivity implementation for SQLServerStoredProcedureActivity. +func (ssspa SQLServerStoredProcedureActivity) AsForEachActivity() (*ForEachActivity, bool) { + return nil, false +} + +// AsIfConditionActivity is the BasicActivity implementation for SQLServerStoredProcedureActivity. +func (ssspa SQLServerStoredProcedureActivity) AsIfConditionActivity() (*IfConditionActivity, bool) { + return nil, false +} + +// AsExecutePipelineActivity is the BasicActivity implementation for SQLServerStoredProcedureActivity. +func (ssspa SQLServerStoredProcedureActivity) AsExecutePipelineActivity() (*ExecutePipelineActivity, bool) { + return nil, false +} + +// AsControlActivity is the BasicActivity implementation for SQLServerStoredProcedureActivity. +func (ssspa SQLServerStoredProcedureActivity) AsControlActivity() (*ControlActivity, bool) { + return nil, false +} + +// AsBasicControlActivity is the BasicActivity implementation for SQLServerStoredProcedureActivity. +func (ssspa SQLServerStoredProcedureActivity) AsBasicControlActivity() (BasicControlActivity, bool) { + return nil, false +} + +// AsActivity is the BasicActivity implementation for SQLServerStoredProcedureActivity. +func (ssspa SQLServerStoredProcedureActivity) AsActivity() (*Activity, bool) { + return nil, false +} + +// AsBasicActivity is the BasicActivity implementation for SQLServerStoredProcedureActivity. +func (ssspa SQLServerStoredProcedureActivity) AsBasicActivity() (BasicActivity, bool) { + return &ssspa, true +} + +// UnmarshalJSON is the custom unmarshaler for SQLServerStoredProcedureActivity struct. +func (ssspa *SQLServerStoredProcedureActivity) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "typeProperties": + if v != nil { + var SQLServerStoredProcedureActivityTypeProperties SQLServerStoredProcedureActivityTypeProperties + err = json.Unmarshal(*v, &SQLServerStoredProcedureActivityTypeProperties) + if err != nil { + return err + } + ssspa.SQLServerStoredProcedureActivityTypeProperties = &SQLServerStoredProcedureActivityTypeProperties + } + case "linkedServiceName": + if v != nil { + var linkedServiceName LinkedServiceReference + err = json.Unmarshal(*v, &linkedServiceName) + if err != nil { + return err + } + ssspa.LinkedServiceName = &linkedServiceName + } + case "policy": + if v != nil { + var policy ActivityPolicy + err = json.Unmarshal(*v, &policy) + if err != nil { + return err + } + ssspa.Policy = &policy + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if ssspa.AdditionalProperties == nil { + ssspa.AdditionalProperties = make(map[string]interface{}) + } + ssspa.AdditionalProperties[k] = additionalProperties + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ssspa.Name = &name + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + ssspa.Description = &description + } + case "dependsOn": + if v != nil { + var dependsOn []ActivityDependency + err = json.Unmarshal(*v, &dependsOn) + if err != nil { + return err + } + ssspa.DependsOn = &dependsOn + } + case "userProperties": + if v != nil { + var userProperties map[string]*string + err = json.Unmarshal(*v, &userProperties) + if err != nil { + return err + } + ssspa.UserProperties = userProperties + } + case "type": + if v != nil { + var typeVar TypeBasicActivity + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ssspa.Type = typeVar + } + } + } + + return nil +} + +// SQLServerStoredProcedureActivityTypeProperties SQL stored procedure activity properties. +type SQLServerStoredProcedureActivityTypeProperties struct { + // StoredProcedureName - Stored procedure name. Type: string (or Expression with resultType string). + StoredProcedureName interface{} `json:"storedProcedureName,omitempty"` + // StoredProcedureParameters - Value and type setting for stored procedure parameters. Example: "{Parameter1: {value: "1", type: "int"}}". + StoredProcedureParameters map[string]*StoredProcedureParameter `json:"storedProcedureParameters"` +} + +// MarshalJSON is the custom marshaler for SQLServerStoredProcedureActivityTypeProperties. +func (ssspatp SQLServerStoredProcedureActivityTypeProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["storedProcedureName"] = ssspatp.StoredProcedureName + if ssspatp.StoredProcedureParameters != nil { + objectMap["storedProcedureParameters"] = ssspatp.StoredProcedureParameters + } + return json.Marshal(objectMap) +} + +// SQLServerTableDataset the on-premises SQL Server dataset. +type SQLServerTableDataset struct { + // SQLServerTableDatasetTypeProperties - On-premises SQL Server dataset properties. + *SQLServerTableDatasetTypeProperties `json:"typeProperties,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Description - Dataset description. + Description *string `json:"description,omitempty"` + // Structure - Columns that define the structure of the dataset. Type: array (or Expression with resultType array), itemType: DatasetDataElement. + Structure interface{} `json:"structure,omitempty"` + // LinkedServiceName - Linked service reference. + LinkedServiceName *LinkedServiceReference `json:"linkedServiceName,omitempty"` + // Parameters - Parameters for dataset. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeDataset', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSQLServerTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSalesforceObject', 'TypeRelationalTable', 'TypeAzureMySQLTable', 'TypeOracleTable', 'TypeODataResource', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeAzureDataLakeStoreFile', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeAmazonS3Object' + Type TypeBasicDataset `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for SQLServerTableDataset. +func (sstd SQLServerTableDataset) MarshalJSON() ([]byte, error) { + sstd.Type = TypeSQLServerTable + objectMap := make(map[string]interface{}) + if sstd.SQLServerTableDatasetTypeProperties != nil { + objectMap["typeProperties"] = sstd.SQLServerTableDatasetTypeProperties + } + if sstd.Description != nil { + objectMap["description"] = sstd.Description + } + objectMap["structure"] = sstd.Structure + if sstd.LinkedServiceName != nil { + objectMap["linkedServiceName"] = sstd.LinkedServiceName + } + if sstd.Parameters != nil { + objectMap["parameters"] = sstd.Parameters + } + if sstd.Annotations != nil { + objectMap["annotations"] = sstd.Annotations + } + if sstd.Type != "" { + objectMap["type"] = sstd.Type + } + for k, v := range sstd.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysObjectDataset is the BasicDataset implementation for SQLServerTableDataset. +func (sstd SQLServerTableDataset) AsResponsysObjectDataset() (*ResponsysObjectDataset, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudObjectDataset is the BasicDataset implementation for SQLServerTableDataset. +func (sstd SQLServerTableDataset) AsSalesforceMarketingCloudObjectDataset() (*SalesforceMarketingCloudObjectDataset, bool) { + return nil, false +} + +// AsVerticaTableDataset is the BasicDataset implementation for SQLServerTableDataset. +func (sstd SQLServerTableDataset) AsVerticaTableDataset() (*VerticaTableDataset, bool) { + return nil, false +} + +// AsNetezzaTableDataset is the BasicDataset implementation for SQLServerTableDataset. +func (sstd SQLServerTableDataset) AsNetezzaTableDataset() (*NetezzaTableDataset, bool) { + return nil, false +} + +// AsZohoObjectDataset is the BasicDataset implementation for SQLServerTableDataset. +func (sstd SQLServerTableDataset) AsZohoObjectDataset() (*ZohoObjectDataset, bool) { + return nil, false +} + +// AsXeroObjectDataset is the BasicDataset implementation for SQLServerTableDataset. +func (sstd SQLServerTableDataset) AsXeroObjectDataset() (*XeroObjectDataset, bool) { + return nil, false +} + +// AsSquareObjectDataset is the BasicDataset implementation for SQLServerTableDataset. +func (sstd SQLServerTableDataset) AsSquareObjectDataset() (*SquareObjectDataset, bool) { + return nil, false +} + +// AsSparkObjectDataset is the BasicDataset implementation for SQLServerTableDataset. +func (sstd SQLServerTableDataset) AsSparkObjectDataset() (*SparkObjectDataset, bool) { + return nil, false +} + +// AsShopifyObjectDataset is the BasicDataset implementation for SQLServerTableDataset. +func (sstd SQLServerTableDataset) AsShopifyObjectDataset() (*ShopifyObjectDataset, bool) { + return nil, false +} + +// AsServiceNowObjectDataset is the BasicDataset implementation for SQLServerTableDataset. +func (sstd SQLServerTableDataset) AsServiceNowObjectDataset() (*ServiceNowObjectDataset, bool) { + return nil, false +} + +// AsQuickBooksObjectDataset is the BasicDataset implementation for SQLServerTableDataset. +func (sstd SQLServerTableDataset) AsQuickBooksObjectDataset() (*QuickBooksObjectDataset, bool) { + return nil, false +} + +// AsPrestoObjectDataset is the BasicDataset implementation for SQLServerTableDataset. +func (sstd SQLServerTableDataset) AsPrestoObjectDataset() (*PrestoObjectDataset, bool) { + return nil, false +} + +// AsPhoenixObjectDataset is the BasicDataset implementation for SQLServerTableDataset. +func (sstd SQLServerTableDataset) AsPhoenixObjectDataset() (*PhoenixObjectDataset, bool) { + return nil, false +} + +// AsPaypalObjectDataset is the BasicDataset implementation for SQLServerTableDataset. +func (sstd SQLServerTableDataset) AsPaypalObjectDataset() (*PaypalObjectDataset, bool) { + return nil, false +} + +// AsMarketoObjectDataset is the BasicDataset implementation for SQLServerTableDataset. +func (sstd SQLServerTableDataset) AsMarketoObjectDataset() (*MarketoObjectDataset, bool) { + return nil, false +} + +// AsMariaDBTableDataset is the BasicDataset implementation for SQLServerTableDataset. +func (sstd SQLServerTableDataset) AsMariaDBTableDataset() (*MariaDBTableDataset, bool) { + return nil, false +} + +// AsMagentoObjectDataset is the BasicDataset implementation for SQLServerTableDataset. +func (sstd SQLServerTableDataset) AsMagentoObjectDataset() (*MagentoObjectDataset, bool) { + return nil, false +} + +// AsJiraObjectDataset is the BasicDataset implementation for SQLServerTableDataset. +func (sstd SQLServerTableDataset) AsJiraObjectDataset() (*JiraObjectDataset, bool) { + return nil, false +} + +// AsImpalaObjectDataset is the BasicDataset implementation for SQLServerTableDataset. +func (sstd SQLServerTableDataset) AsImpalaObjectDataset() (*ImpalaObjectDataset, bool) { + return nil, false +} + +// AsHubspotObjectDataset is the BasicDataset implementation for SQLServerTableDataset. +func (sstd SQLServerTableDataset) AsHubspotObjectDataset() (*HubspotObjectDataset, bool) { + return nil, false +} + +// AsHiveObjectDataset is the BasicDataset implementation for SQLServerTableDataset. +func (sstd SQLServerTableDataset) AsHiveObjectDataset() (*HiveObjectDataset, bool) { + return nil, false +} + +// AsHBaseObjectDataset is the BasicDataset implementation for SQLServerTableDataset. +func (sstd SQLServerTableDataset) AsHBaseObjectDataset() (*HBaseObjectDataset, bool) { + return nil, false +} + +// AsGreenplumTableDataset is the BasicDataset implementation for SQLServerTableDataset. +func (sstd SQLServerTableDataset) AsGreenplumTableDataset() (*GreenplumTableDataset, bool) { + return nil, false +} + +// AsGoogleBigQueryObjectDataset is the BasicDataset implementation for SQLServerTableDataset. +func (sstd SQLServerTableDataset) AsGoogleBigQueryObjectDataset() (*GoogleBigQueryObjectDataset, bool) { + return nil, false +} + +// AsEloquaObjectDataset is the BasicDataset implementation for SQLServerTableDataset. +func (sstd SQLServerTableDataset) AsEloquaObjectDataset() (*EloquaObjectDataset, bool) { + return nil, false +} + +// AsDrillTableDataset is the BasicDataset implementation for SQLServerTableDataset. +func (sstd SQLServerTableDataset) AsDrillTableDataset() (*DrillTableDataset, bool) { + return nil, false +} + +// AsCouchbaseTableDataset is the BasicDataset implementation for SQLServerTableDataset. +func (sstd SQLServerTableDataset) AsCouchbaseTableDataset() (*CouchbaseTableDataset, bool) { + return nil, false +} + +// AsConcurObjectDataset is the BasicDataset implementation for SQLServerTableDataset. +func (sstd SQLServerTableDataset) AsConcurObjectDataset() (*ConcurObjectDataset, bool) { + return nil, false +} + +// AsAzurePostgreSQLTableDataset is the BasicDataset implementation for SQLServerTableDataset. +func (sstd SQLServerTableDataset) AsAzurePostgreSQLTableDataset() (*AzurePostgreSQLTableDataset, bool) { + return nil, false +} + +// AsAmazonMWSObjectDataset is the BasicDataset implementation for SQLServerTableDataset. +func (sstd SQLServerTableDataset) AsAmazonMWSObjectDataset() (*AmazonMWSObjectDataset, bool) { + return nil, false +} + +// AsHTTPDataset is the BasicDataset implementation for SQLServerTableDataset. +func (sstd SQLServerTableDataset) AsHTTPDataset() (*HTTPDataset, bool) { + return nil, false +} + +// AsAzureSearchIndexDataset is the BasicDataset implementation for SQLServerTableDataset. +func (sstd SQLServerTableDataset) AsAzureSearchIndexDataset() (*AzureSearchIndexDataset, bool) { + return nil, false +} + +// AsWebTableDataset is the BasicDataset implementation for SQLServerTableDataset. +func (sstd SQLServerTableDataset) AsWebTableDataset() (*WebTableDataset, bool) { + return nil, false +} + +// AsSQLServerTableDataset is the BasicDataset implementation for SQLServerTableDataset. +func (sstd SQLServerTableDataset) AsSQLServerTableDataset() (*SQLServerTableDataset, bool) { + return &sstd, true +} + +// AsSapEccResourceDataset is the BasicDataset implementation for SQLServerTableDataset. +func (sstd SQLServerTableDataset) AsSapEccResourceDataset() (*SapEccResourceDataset, bool) { + return nil, false +} + +// AsSapCloudForCustomerResourceDataset is the BasicDataset implementation for SQLServerTableDataset. +func (sstd SQLServerTableDataset) AsSapCloudForCustomerResourceDataset() (*SapCloudForCustomerResourceDataset, bool) { + return nil, false +} + +// AsSalesforceObjectDataset is the BasicDataset implementation for SQLServerTableDataset. +func (sstd SQLServerTableDataset) AsSalesforceObjectDataset() (*SalesforceObjectDataset, bool) { + return nil, false +} + +// AsRelationalTableDataset is the BasicDataset implementation for SQLServerTableDataset. +func (sstd SQLServerTableDataset) AsRelationalTableDataset() (*RelationalTableDataset, bool) { + return nil, false +} + +// AsAzureMySQLTableDataset is the BasicDataset implementation for SQLServerTableDataset. +func (sstd SQLServerTableDataset) AsAzureMySQLTableDataset() (*AzureMySQLTableDataset, bool) { + return nil, false +} + +// AsOracleTableDataset is the BasicDataset implementation for SQLServerTableDataset. +func (sstd SQLServerTableDataset) AsOracleTableDataset() (*OracleTableDataset, bool) { + return nil, false +} + +// AsODataResourceDataset is the BasicDataset implementation for SQLServerTableDataset. +func (sstd SQLServerTableDataset) AsODataResourceDataset() (*ODataResourceDataset, bool) { + return nil, false +} + +// AsMongoDbCollectionDataset is the BasicDataset implementation for SQLServerTableDataset. +func (sstd SQLServerTableDataset) AsMongoDbCollectionDataset() (*MongoDbCollectionDataset, bool) { + return nil, false +} + +// AsFileShareDataset is the BasicDataset implementation for SQLServerTableDataset. +func (sstd SQLServerTableDataset) AsFileShareDataset() (*FileShareDataset, bool) { + return nil, false +} + +// AsAzureDataLakeStoreDataset is the BasicDataset implementation for SQLServerTableDataset. +func (sstd SQLServerTableDataset) AsAzureDataLakeStoreDataset() (*AzureDataLakeStoreDataset, bool) { + return nil, false +} + +// AsDynamicsEntityDataset is the BasicDataset implementation for SQLServerTableDataset. +func (sstd SQLServerTableDataset) AsDynamicsEntityDataset() (*DynamicsEntityDataset, bool) { + return nil, false +} + +// AsDocumentDbCollectionDataset is the BasicDataset implementation for SQLServerTableDataset. +func (sstd SQLServerTableDataset) AsDocumentDbCollectionDataset() (*DocumentDbCollectionDataset, bool) { + return nil, false +} + +// AsCustomDataset is the BasicDataset implementation for SQLServerTableDataset. +func (sstd SQLServerTableDataset) AsCustomDataset() (*CustomDataset, bool) { + return nil, false +} + +// AsCassandraTableDataset is the BasicDataset implementation for SQLServerTableDataset. +func (sstd SQLServerTableDataset) AsCassandraTableDataset() (*CassandraTableDataset, bool) { + return nil, false +} + +// AsAzureSQLDWTableDataset is the BasicDataset implementation for SQLServerTableDataset. +func (sstd SQLServerTableDataset) AsAzureSQLDWTableDataset() (*AzureSQLDWTableDataset, bool) { + return nil, false +} + +// AsAzureSQLTableDataset is the BasicDataset implementation for SQLServerTableDataset. +func (sstd SQLServerTableDataset) AsAzureSQLTableDataset() (*AzureSQLTableDataset, bool) { + return nil, false +} + +// AsAzureTableDataset is the BasicDataset implementation for SQLServerTableDataset. +func (sstd SQLServerTableDataset) AsAzureTableDataset() (*AzureTableDataset, bool) { + return nil, false +} + +// AsAzureBlobDataset is the BasicDataset implementation for SQLServerTableDataset. +func (sstd SQLServerTableDataset) AsAzureBlobDataset() (*AzureBlobDataset, bool) { + return nil, false +} + +// AsAmazonS3Dataset is the BasicDataset implementation for SQLServerTableDataset. +func (sstd SQLServerTableDataset) AsAmazonS3Dataset() (*AmazonS3Dataset, bool) { + return nil, false +} + +// AsDataset is the BasicDataset implementation for SQLServerTableDataset. +func (sstd SQLServerTableDataset) AsDataset() (*Dataset, bool) { + return nil, false +} + +// AsBasicDataset is the BasicDataset implementation for SQLServerTableDataset. +func (sstd SQLServerTableDataset) AsBasicDataset() (BasicDataset, bool) { + return &sstd, true +} + +// UnmarshalJSON is the custom unmarshaler for SQLServerTableDataset struct. +func (sstd *SQLServerTableDataset) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "typeProperties": + if v != nil { + var SQLServerTableDatasetTypeProperties SQLServerTableDatasetTypeProperties + err = json.Unmarshal(*v, &SQLServerTableDatasetTypeProperties) + if err != nil { + return err + } + sstd.SQLServerTableDatasetTypeProperties = &SQLServerTableDatasetTypeProperties + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if sstd.AdditionalProperties == nil { + sstd.AdditionalProperties = make(map[string]interface{}) + } + sstd.AdditionalProperties[k] = additionalProperties + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + sstd.Description = &description + } + case "structure": + if v != nil { + var structure interface{} + err = json.Unmarshal(*v, &structure) + if err != nil { + return err + } + sstd.Structure = structure + } + case "linkedServiceName": + if v != nil { + var linkedServiceName LinkedServiceReference + err = json.Unmarshal(*v, &linkedServiceName) + if err != nil { + return err + } + sstd.LinkedServiceName = &linkedServiceName + } + case "parameters": + if v != nil { + var parameters map[string]*ParameterSpecification + err = json.Unmarshal(*v, ¶meters) + if err != nil { + return err + } + sstd.Parameters = parameters + } + case "annotations": + if v != nil { + var annotations []interface{} + err = json.Unmarshal(*v, &annotations) + if err != nil { + return err + } + sstd.Annotations = &annotations + } + case "type": + if v != nil { + var typeVar TypeBasicDataset + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + sstd.Type = typeVar + } + } + } + + return nil +} + +// SQLServerTableDatasetTypeProperties on-premises SQL Server dataset properties. +type SQLServerTableDatasetTypeProperties struct { + // TableName - The table name of the SQL Server dataset. Type: string (or Expression with resultType string). + TableName interface{} `json:"tableName,omitempty"` +} + +// SQLSink a copy activity SQL sink. +type SQLSink struct { + // SQLWriterStoredProcedureName - SQL writer stored procedure name. Type: string (or Expression with resultType string). + SQLWriterStoredProcedureName interface{} `json:"sqlWriterStoredProcedureName,omitempty"` + // SQLWriterTableType - SQL writer table type. Type: string (or Expression with resultType string). + SQLWriterTableType interface{} `json:"sqlWriterTableType,omitempty"` + // PreCopyScript - SQL pre-copy script. Type: string (or Expression with resultType string). + PreCopyScript interface{} `json:"preCopyScript,omitempty"` + // StoredProcedureParameters - SQL stored procedure parameters. + StoredProcedureParameters map[string]*StoredProcedureParameter `json:"storedProcedureParameters"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // WriteBatchSize - Write batch size. Type: integer (or Expression with resultType integer), minimum: 0. + WriteBatchSize interface{} `json:"writeBatchSize,omitempty"` + // WriteBatchTimeout - Write batch timeout. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + WriteBatchTimeout interface{} `json:"writeBatchTimeout,omitempty"` + // SinkRetryCount - Sink retry count. Type: integer (or Expression with resultType integer). + SinkRetryCount interface{} `json:"sinkRetryCount,omitempty"` + // SinkRetryWait - Sink retry wait. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + SinkRetryWait interface{} `json:"sinkRetryWait,omitempty"` + // Type - Possible values include: 'TypeCopySink', 'TypeSalesforceSink', 'TypeDynamicsSink', 'TypeOdbcSink', 'TypeAzureSearchIndexSink', 'TypeAzureDataLakeStoreSink', 'TypeOracleSink', 'TypeSQLDWSink', 'TypeSQLSink', 'TypeDocumentDbCollectionSink', 'TypeFileSystemSink', 'TypeBlobSink', 'TypeAzureTableSink', 'TypeAzureQueueSink', 'TypeSapCloudForCustomerSink' + Type TypeBasicCopySink `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for SQLSink. +func (ss SQLSink) MarshalJSON() ([]byte, error) { + ss.Type = TypeSQLSink + objectMap := make(map[string]interface{}) + objectMap["sqlWriterStoredProcedureName"] = ss.SQLWriterStoredProcedureName + objectMap["sqlWriterTableType"] = ss.SQLWriterTableType + objectMap["preCopyScript"] = ss.PreCopyScript + if ss.StoredProcedureParameters != nil { + objectMap["storedProcedureParameters"] = ss.StoredProcedureParameters + } + objectMap["writeBatchSize"] = ss.WriteBatchSize + objectMap["writeBatchTimeout"] = ss.WriteBatchTimeout + objectMap["sinkRetryCount"] = ss.SinkRetryCount + objectMap["sinkRetryWait"] = ss.SinkRetryWait + if ss.Type != "" { + objectMap["type"] = ss.Type + } + for k, v := range ss.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsSalesforceSink is the BasicCopySink implementation for SQLSink. +func (ss SQLSink) AsSalesforceSink() (*SalesforceSink, bool) { + return nil, false +} + +// AsDynamicsSink is the BasicCopySink implementation for SQLSink. +func (ss SQLSink) AsDynamicsSink() (*DynamicsSink, bool) { + return nil, false +} + +// AsOdbcSink is the BasicCopySink implementation for SQLSink. +func (ss SQLSink) AsOdbcSink() (*OdbcSink, bool) { + return nil, false +} + +// AsAzureSearchIndexSink is the BasicCopySink implementation for SQLSink. +func (ss SQLSink) AsAzureSearchIndexSink() (*AzureSearchIndexSink, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSink is the BasicCopySink implementation for SQLSink. +func (ss SQLSink) AsAzureDataLakeStoreSink() (*AzureDataLakeStoreSink, bool) { + return nil, false +} + +// AsOracleSink is the BasicCopySink implementation for SQLSink. +func (ss SQLSink) AsOracleSink() (*OracleSink, bool) { + return nil, false +} + +// AsSQLDWSink is the BasicCopySink implementation for SQLSink. +func (ss SQLSink) AsSQLDWSink() (*SQLDWSink, bool) { + return nil, false +} + +// AsSQLSink is the BasicCopySink implementation for SQLSink. +func (ss SQLSink) AsSQLSink() (*SQLSink, bool) { + return &ss, true +} + +// AsDocumentDbCollectionSink is the BasicCopySink implementation for SQLSink. +func (ss SQLSink) AsDocumentDbCollectionSink() (*DocumentDbCollectionSink, bool) { + return nil, false +} + +// AsFileSystemSink is the BasicCopySink implementation for SQLSink. +func (ss SQLSink) AsFileSystemSink() (*FileSystemSink, bool) { + return nil, false +} + +// AsBlobSink is the BasicCopySink implementation for SQLSink. +func (ss SQLSink) AsBlobSink() (*BlobSink, bool) { + return nil, false +} + +// AsAzureTableSink is the BasicCopySink implementation for SQLSink. +func (ss SQLSink) AsAzureTableSink() (*AzureTableSink, bool) { + return nil, false +} + +// AsAzureQueueSink is the BasicCopySink implementation for SQLSink. +func (ss SQLSink) AsAzureQueueSink() (*AzureQueueSink, bool) { + return nil, false +} + +// AsSapCloudForCustomerSink is the BasicCopySink implementation for SQLSink. +func (ss SQLSink) AsSapCloudForCustomerSink() (*SapCloudForCustomerSink, bool) { + return nil, false +} + +// AsCopySink is the BasicCopySink implementation for SQLSink. +func (ss SQLSink) AsCopySink() (*CopySink, bool) { + return nil, false +} + +// AsBasicCopySink is the BasicCopySink implementation for SQLSink. +func (ss SQLSink) AsBasicCopySink() (BasicCopySink, bool) { + return &ss, true +} + +// SQLSource a copy activity SQL source. +type SQLSource struct { + // SQLReaderQuery - SQL reader query. Type: string (or Expression with resultType string). + SQLReaderQuery interface{} `json:"sqlReaderQuery,omitempty"` + // SQLReaderStoredProcedureName - Name of the stored procedure for a SQL Database source. This cannot be used at the same time as SqlReaderQuery. Type: string (or Expression with resultType string). + SQLReaderStoredProcedureName interface{} `json:"sqlReaderStoredProcedureName,omitempty"` + // StoredProcedureParameters - Value and type setting for stored procedure parameters. Example: "{Parameter1: {value: "1", type: "int"}}". + StoredProcedureParameters map[string]*StoredProcedureParameter `json:"storedProcedureParameters"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // SourceRetryCount - Source retry count. Type: integer (or Expression with resultType integer). + SourceRetryCount interface{} `json:"sourceRetryCount,omitempty"` + // SourceRetryWait - Source retry wait. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` + // Type - Possible values include: 'TypeCopySource', 'TypeAmazonRedshiftSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeHTTPSource', 'TypeAzureDataLakeStoreSource', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeRelationalSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource' + Type TypeBasicCopySource `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for SQLSource. +func (ss SQLSource) MarshalJSON() ([]byte, error) { + ss.Type = TypeSQLSource + objectMap := make(map[string]interface{}) + objectMap["sqlReaderQuery"] = ss.SQLReaderQuery + objectMap["sqlReaderStoredProcedureName"] = ss.SQLReaderStoredProcedureName + if ss.StoredProcedureParameters != nil { + objectMap["storedProcedureParameters"] = ss.StoredProcedureParameters + } + objectMap["sourceRetryCount"] = ss.SourceRetryCount + objectMap["sourceRetryWait"] = ss.SourceRetryWait + if ss.Type != "" { + objectMap["type"] = ss.Type + } + for k, v := range ss.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsAmazonRedshiftSource is the BasicCopySource implementation for SQLSource. +func (ss SQLSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { + return nil, false +} + +// AsResponsysSource is the BasicCopySource implementation for SQLSource. +func (ss SQLSource) AsResponsysSource() (*ResponsysSource, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudSource is the BasicCopySource implementation for SQLSource. +func (ss SQLSource) AsSalesforceMarketingCloudSource() (*SalesforceMarketingCloudSource, bool) { + return nil, false +} + +// AsVerticaSource is the BasicCopySource implementation for SQLSource. +func (ss SQLSource) AsVerticaSource() (*VerticaSource, bool) { + return nil, false +} + +// AsNetezzaSource is the BasicCopySource implementation for SQLSource. +func (ss SQLSource) AsNetezzaSource() (*NetezzaSource, bool) { + return nil, false +} + +// AsZohoSource is the BasicCopySource implementation for SQLSource. +func (ss SQLSource) AsZohoSource() (*ZohoSource, bool) { + return nil, false +} + +// AsXeroSource is the BasicCopySource implementation for SQLSource. +func (ss SQLSource) AsXeroSource() (*XeroSource, bool) { + return nil, false +} + +// AsSquareSource is the BasicCopySource implementation for SQLSource. +func (ss SQLSource) AsSquareSource() (*SquareSource, bool) { + return nil, false +} + +// AsSparkSource is the BasicCopySource implementation for SQLSource. +func (ss SQLSource) AsSparkSource() (*SparkSource, bool) { + return nil, false +} + +// AsShopifySource is the BasicCopySource implementation for SQLSource. +func (ss SQLSource) AsShopifySource() (*ShopifySource, bool) { + return nil, false +} + +// AsServiceNowSource is the BasicCopySource implementation for SQLSource. +func (ss SQLSource) AsServiceNowSource() (*ServiceNowSource, bool) { + return nil, false +} + +// AsQuickBooksSource is the BasicCopySource implementation for SQLSource. +func (ss SQLSource) AsQuickBooksSource() (*QuickBooksSource, bool) { + return nil, false +} + +// AsPrestoSource is the BasicCopySource implementation for SQLSource. +func (ss SQLSource) AsPrestoSource() (*PrestoSource, bool) { + return nil, false +} + +// AsPhoenixSource is the BasicCopySource implementation for SQLSource. +func (ss SQLSource) AsPhoenixSource() (*PhoenixSource, bool) { + return nil, false +} + +// AsPaypalSource is the BasicCopySource implementation for SQLSource. +func (ss SQLSource) AsPaypalSource() (*PaypalSource, bool) { + return nil, false +} + +// AsMarketoSource is the BasicCopySource implementation for SQLSource. +func (ss SQLSource) AsMarketoSource() (*MarketoSource, bool) { + return nil, false +} + +// AsMariaDBSource is the BasicCopySource implementation for SQLSource. +func (ss SQLSource) AsMariaDBSource() (*MariaDBSource, bool) { + return nil, false +} + +// AsMagentoSource is the BasicCopySource implementation for SQLSource. +func (ss SQLSource) AsMagentoSource() (*MagentoSource, bool) { + return nil, false +} + +// AsJiraSource is the BasicCopySource implementation for SQLSource. +func (ss SQLSource) AsJiraSource() (*JiraSource, bool) { + return nil, false +} + +// AsImpalaSource is the BasicCopySource implementation for SQLSource. +func (ss SQLSource) AsImpalaSource() (*ImpalaSource, bool) { + return nil, false +} + +// AsHubspotSource is the BasicCopySource implementation for SQLSource. +func (ss SQLSource) AsHubspotSource() (*HubspotSource, bool) { + return nil, false +} + +// AsHiveSource is the BasicCopySource implementation for SQLSource. +func (ss SQLSource) AsHiveSource() (*HiveSource, bool) { + return nil, false +} + +// AsHBaseSource is the BasicCopySource implementation for SQLSource. +func (ss SQLSource) AsHBaseSource() (*HBaseSource, bool) { + return nil, false +} + +// AsGreenplumSource is the BasicCopySource implementation for SQLSource. +func (ss SQLSource) AsGreenplumSource() (*GreenplumSource, bool) { + return nil, false +} + +// AsGoogleBigQuerySource is the BasicCopySource implementation for SQLSource. +func (ss SQLSource) AsGoogleBigQuerySource() (*GoogleBigQuerySource, bool) { + return nil, false +} + +// AsEloquaSource is the BasicCopySource implementation for SQLSource. +func (ss SQLSource) AsEloquaSource() (*EloquaSource, bool) { + return nil, false +} + +// AsDrillSource is the BasicCopySource implementation for SQLSource. +func (ss SQLSource) AsDrillSource() (*DrillSource, bool) { + return nil, false +} + +// AsCouchbaseSource is the BasicCopySource implementation for SQLSource. +func (ss SQLSource) AsCouchbaseSource() (*CouchbaseSource, bool) { + return nil, false +} + +// AsConcurSource is the BasicCopySource implementation for SQLSource. +func (ss SQLSource) AsConcurSource() (*ConcurSource, bool) { + return nil, false +} + +// AsAzurePostgreSQLSource is the BasicCopySource implementation for SQLSource. +func (ss SQLSource) AsAzurePostgreSQLSource() (*AzurePostgreSQLSource, bool) { + return nil, false +} + +// AsAmazonMWSSource is the BasicCopySource implementation for SQLSource. +func (ss SQLSource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { + return nil, false +} + +// AsHTTPSource is the BasicCopySource implementation for SQLSource. +func (ss SQLSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for SQLSource. +func (ss SQLSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for SQLSource. +func (ss SQLSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsCassandraSource is the BasicCopySource implementation for SQLSource. +func (ss SQLSource) AsCassandraSource() (*CassandraSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for SQLSource. +func (ss SQLSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for SQLSource. +func (ss SQLSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureMySQLSource is the BasicCopySource implementation for SQLSource. +func (ss SQLSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for SQLSource. +func (ss SQLSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for SQLSource. +func (ss SQLSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsSQLDWSource is the BasicCopySource implementation for SQLSource. +func (ss SQLSource) AsSQLDWSource() (*SQLDWSource, bool) { + return nil, false +} + +// AsSQLSource is the BasicCopySource implementation for SQLSource. +func (ss SQLSource) AsSQLSource() (*SQLSource, bool) { + return &ss, true +} + +// AsSapEccSource is the BasicCopySource implementation for SQLSource. +func (ss SQLSource) AsSapEccSource() (*SapEccSource, bool) { + return nil, false +} + +// AsSapCloudForCustomerSource is the BasicCopySource implementation for SQLSource. +func (ss SQLSource) AsSapCloudForCustomerSource() (*SapCloudForCustomerSource, bool) { + return nil, false +} + +// AsSalesforceSource is the BasicCopySource implementation for SQLSource. +func (ss SQLSource) AsSalesforceSource() (*SalesforceSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for SQLSource. +func (ss SQLSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for SQLSource. +func (ss SQLSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for SQLSource. +func (ss SQLSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for SQLSource. +func (ss SQLSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + +// AsAzureTableSource is the BasicCopySource implementation for SQLSource. +func (ss SQLSource) AsAzureTableSource() (*AzureTableSource, bool) { + return nil, false +} + +// AsCopySource is the BasicCopySource implementation for SQLSource. +func (ss SQLSource) AsCopySource() (*CopySource, bool) { + return nil, false +} + +// AsBasicCopySource is the BasicCopySource implementation for SQLSource. +func (ss SQLSource) AsBasicCopySource() (BasicCopySource, bool) { + return &ss, true +} + +// SquareLinkedService square Serivce linked service. +type SquareLinkedService struct { + // SquareLinkedServiceTypeProperties - Square Serivce linked service properties. + *SquareLinkedServiceTypeProperties `json:"typeProperties,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // ConnectVia - The integration runtime reference. + ConnectVia *IntegrationRuntimeReference `json:"connectVia,omitempty"` + // Description - Linked service description. + Description *string `json:"description,omitempty"` + // Parameters - Parameters for linked service. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeLinkedService', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforce', 'TypeAzureDataLakeStore', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureStorage' + Type TypeBasicLinkedService `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for SquareLinkedService. +func (sls SquareLinkedService) MarshalJSON() ([]byte, error) { + sls.Type = TypeSquare + objectMap := make(map[string]interface{}) + if sls.SquareLinkedServiceTypeProperties != nil { + objectMap["typeProperties"] = sls.SquareLinkedServiceTypeProperties + } + if sls.ConnectVia != nil { + objectMap["connectVia"] = sls.ConnectVia + } + if sls.Description != nil { + objectMap["description"] = sls.Description + } + if sls.Parameters != nil { + objectMap["parameters"] = sls.Parameters + } + if sls.Annotations != nil { + objectMap["annotations"] = sls.Annotations + } + if sls.Type != "" { + objectMap["type"] = sls.Type + } + for k, v := range sls.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysLinkedService is the BasicLinkedService implementation for SquareLinkedService. +func (sls SquareLinkedService) AsResponsysLinkedService() (*ResponsysLinkedService, bool) { + return nil, false +} + +// AsAzureDatabricksLinkedService is the BasicLinkedService implementation for SquareLinkedService. +func (sls SquareLinkedService) AsAzureDatabricksLinkedService() (*AzureDatabricksLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeAnalyticsLinkedService is the BasicLinkedService implementation for SquareLinkedService. +func (sls SquareLinkedService) AsAzureDataLakeAnalyticsLinkedService() (*AzureDataLakeAnalyticsLinkedService, bool) { + return nil, false +} + +// AsHDInsightOnDemandLinkedService is the BasicLinkedService implementation for SquareLinkedService. +func (sls SquareLinkedService) AsHDInsightOnDemandLinkedService() (*HDInsightOnDemandLinkedService, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudLinkedService is the BasicLinkedService implementation for SquareLinkedService. +func (sls SquareLinkedService) AsSalesforceMarketingCloudLinkedService() (*SalesforceMarketingCloudLinkedService, bool) { + return nil, false +} + +// AsNetezzaLinkedService is the BasicLinkedService implementation for SquareLinkedService. +func (sls SquareLinkedService) AsNetezzaLinkedService() (*NetezzaLinkedService, bool) { + return nil, false +} + +// AsVerticaLinkedService is the BasicLinkedService implementation for SquareLinkedService. +func (sls SquareLinkedService) AsVerticaLinkedService() (*VerticaLinkedService, bool) { + return nil, false +} + +// AsZohoLinkedService is the BasicLinkedService implementation for SquareLinkedService. +func (sls SquareLinkedService) AsZohoLinkedService() (*ZohoLinkedService, bool) { + return nil, false +} + +// AsXeroLinkedService is the BasicLinkedService implementation for SquareLinkedService. +func (sls SquareLinkedService) AsXeroLinkedService() (*XeroLinkedService, bool) { + return nil, false +} + +// AsSquareLinkedService is the BasicLinkedService implementation for SquareLinkedService. +func (sls SquareLinkedService) AsSquareLinkedService() (*SquareLinkedService, bool) { + return &sls, true +} + +// AsSparkLinkedService is the BasicLinkedService implementation for SquareLinkedService. +func (sls SquareLinkedService) AsSparkLinkedService() (*SparkLinkedService, bool) { + return nil, false +} + +// AsShopifyLinkedService is the BasicLinkedService implementation for SquareLinkedService. +func (sls SquareLinkedService) AsShopifyLinkedService() (*ShopifyLinkedService, bool) { + return nil, false +} + +// AsServiceNowLinkedService is the BasicLinkedService implementation for SquareLinkedService. +func (sls SquareLinkedService) AsServiceNowLinkedService() (*ServiceNowLinkedService, bool) { + return nil, false +} + +// AsQuickBooksLinkedService is the BasicLinkedService implementation for SquareLinkedService. +func (sls SquareLinkedService) AsQuickBooksLinkedService() (*QuickBooksLinkedService, bool) { + return nil, false +} + +// AsPrestoLinkedService is the BasicLinkedService implementation for SquareLinkedService. +func (sls SquareLinkedService) AsPrestoLinkedService() (*PrestoLinkedService, bool) { + return nil, false +} + +// AsPhoenixLinkedService is the BasicLinkedService implementation for SquareLinkedService. +func (sls SquareLinkedService) AsPhoenixLinkedService() (*PhoenixLinkedService, bool) { + return nil, false +} + +// AsPaypalLinkedService is the BasicLinkedService implementation for SquareLinkedService. +func (sls SquareLinkedService) AsPaypalLinkedService() (*PaypalLinkedService, bool) { + return nil, false +} + +// AsMarketoLinkedService is the BasicLinkedService implementation for SquareLinkedService. +func (sls SquareLinkedService) AsMarketoLinkedService() (*MarketoLinkedService, bool) { + return nil, false +} + +// AsMariaDBLinkedService is the BasicLinkedService implementation for SquareLinkedService. +func (sls SquareLinkedService) AsMariaDBLinkedService() (*MariaDBLinkedService, bool) { + return nil, false +} + +// AsMagentoLinkedService is the BasicLinkedService implementation for SquareLinkedService. +func (sls SquareLinkedService) AsMagentoLinkedService() (*MagentoLinkedService, bool) { + return nil, false +} + +// AsJiraLinkedService is the BasicLinkedService implementation for SquareLinkedService. +func (sls SquareLinkedService) AsJiraLinkedService() (*JiraLinkedService, bool) { + return nil, false +} + +// AsImpalaLinkedService is the BasicLinkedService implementation for SquareLinkedService. +func (sls SquareLinkedService) AsImpalaLinkedService() (*ImpalaLinkedService, bool) { + return nil, false +} + +// AsHubspotLinkedService is the BasicLinkedService implementation for SquareLinkedService. +func (sls SquareLinkedService) AsHubspotLinkedService() (*HubspotLinkedService, bool) { + return nil, false +} + +// AsHiveLinkedService is the BasicLinkedService implementation for SquareLinkedService. +func (sls SquareLinkedService) AsHiveLinkedService() (*HiveLinkedService, bool) { + return nil, false +} + +// AsHBaseLinkedService is the BasicLinkedService implementation for SquareLinkedService. +func (sls SquareLinkedService) AsHBaseLinkedService() (*HBaseLinkedService, bool) { + return nil, false +} + +// AsGreenplumLinkedService is the BasicLinkedService implementation for SquareLinkedService. +func (sls SquareLinkedService) AsGreenplumLinkedService() (*GreenplumLinkedService, bool) { + return nil, false +} + +// AsGoogleBigQueryLinkedService is the BasicLinkedService implementation for SquareLinkedService. +func (sls SquareLinkedService) AsGoogleBigQueryLinkedService() (*GoogleBigQueryLinkedService, bool) { + return nil, false +} + +// AsEloquaLinkedService is the BasicLinkedService implementation for SquareLinkedService. +func (sls SquareLinkedService) AsEloquaLinkedService() (*EloquaLinkedService, bool) { + return nil, false +} + +// AsDrillLinkedService is the BasicLinkedService implementation for SquareLinkedService. +func (sls SquareLinkedService) AsDrillLinkedService() (*DrillLinkedService, bool) { + return nil, false +} + +// AsCouchbaseLinkedService is the BasicLinkedService implementation for SquareLinkedService. +func (sls SquareLinkedService) AsCouchbaseLinkedService() (*CouchbaseLinkedService, bool) { + return nil, false +} + +// AsConcurLinkedService is the BasicLinkedService implementation for SquareLinkedService. +func (sls SquareLinkedService) AsConcurLinkedService() (*ConcurLinkedService, bool) { + return nil, false +} + +// AsAzurePostgreSQLLinkedService is the BasicLinkedService implementation for SquareLinkedService. +func (sls SquareLinkedService) AsAzurePostgreSQLLinkedService() (*AzurePostgreSQLLinkedService, bool) { + return nil, false +} + +// AsAmazonMWSLinkedService is the BasicLinkedService implementation for SquareLinkedService. +func (sls SquareLinkedService) AsAmazonMWSLinkedService() (*AmazonMWSLinkedService, bool) { + return nil, false +} + +// AsSapHanaLinkedService is the BasicLinkedService implementation for SquareLinkedService. +func (sls SquareLinkedService) AsSapHanaLinkedService() (*SapHanaLinkedService, bool) { + return nil, false +} + +// AsSapBWLinkedService is the BasicLinkedService implementation for SquareLinkedService. +func (sls SquareLinkedService) AsSapBWLinkedService() (*SapBWLinkedService, bool) { + return nil, false +} + +// AsSftpServerLinkedService is the BasicLinkedService implementation for SquareLinkedService. +func (sls SquareLinkedService) AsSftpServerLinkedService() (*SftpServerLinkedService, bool) { + return nil, false +} + +// AsFtpServerLinkedService is the BasicLinkedService implementation for SquareLinkedService. +func (sls SquareLinkedService) AsFtpServerLinkedService() (*FtpServerLinkedService, bool) { + return nil, false +} + +// AsHTTPLinkedService is the BasicLinkedService implementation for SquareLinkedService. +func (sls SquareLinkedService) AsHTTPLinkedService() (*HTTPLinkedService, bool) { + return nil, false +} + +// AsAzureSearchLinkedService is the BasicLinkedService implementation for SquareLinkedService. +func (sls SquareLinkedService) AsAzureSearchLinkedService() (*AzureSearchLinkedService, bool) { + return nil, false +} + +// AsCustomDataSourceLinkedService is the BasicLinkedService implementation for SquareLinkedService. +func (sls SquareLinkedService) AsCustomDataSourceLinkedService() (*CustomDataSourceLinkedService, bool) { + return nil, false +} + +// AsAmazonRedshiftLinkedService is the BasicLinkedService implementation for SquareLinkedService. +func (sls SquareLinkedService) AsAmazonRedshiftLinkedService() (*AmazonRedshiftLinkedService, bool) { + return nil, false +} + +// AsAmazonS3LinkedService is the BasicLinkedService implementation for SquareLinkedService. +func (sls SquareLinkedService) AsAmazonS3LinkedService() (*AmazonS3LinkedService, bool) { + return nil, false +} + +// AsSapEccLinkedService is the BasicLinkedService implementation for SquareLinkedService. +func (sls SquareLinkedService) AsSapEccLinkedService() (*SapEccLinkedService, bool) { + return nil, false +} + +// AsSapCloudForCustomerLinkedService is the BasicLinkedService implementation for SquareLinkedService. +func (sls SquareLinkedService) AsSapCloudForCustomerLinkedService() (*SapCloudForCustomerLinkedService, bool) { + return nil, false +} + +// AsSalesforceLinkedService is the BasicLinkedService implementation for SquareLinkedService. +func (sls SquareLinkedService) AsSalesforceLinkedService() (*SalesforceLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeStoreLinkedService is the BasicLinkedService implementation for SquareLinkedService. +func (sls SquareLinkedService) AsAzureDataLakeStoreLinkedService() (*AzureDataLakeStoreLinkedService, bool) { + return nil, false +} + +// AsMongoDbLinkedService is the BasicLinkedService implementation for SquareLinkedService. +func (sls SquareLinkedService) AsMongoDbLinkedService() (*MongoDbLinkedService, bool) { + return nil, false +} + +// AsCassandraLinkedService is the BasicLinkedService implementation for SquareLinkedService. +func (sls SquareLinkedService) AsCassandraLinkedService() (*CassandraLinkedService, bool) { + return nil, false +} + +// AsWebLinkedService is the BasicLinkedService implementation for SquareLinkedService. +func (sls SquareLinkedService) AsWebLinkedService() (*WebLinkedService, bool) { + return nil, false +} + +// AsODataLinkedService is the BasicLinkedService implementation for SquareLinkedService. +func (sls SquareLinkedService) AsODataLinkedService() (*ODataLinkedService, bool) { + return nil, false +} + +// AsHdfsLinkedService is the BasicLinkedService implementation for SquareLinkedService. +func (sls SquareLinkedService) AsHdfsLinkedService() (*HdfsLinkedService, bool) { + return nil, false +} + +// AsOdbcLinkedService is the BasicLinkedService implementation for SquareLinkedService. +func (sls SquareLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, bool) { + return nil, false +} + +// AsAzureMLLinkedService is the BasicLinkedService implementation for SquareLinkedService. +func (sls SquareLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { + return nil, false +} + +// AsTeradataLinkedService is the BasicLinkedService implementation for SquareLinkedService. +func (sls SquareLinkedService) AsTeradataLinkedService() (*TeradataLinkedService, bool) { + return nil, false +} + +// AsDb2LinkedService is the BasicLinkedService implementation for SquareLinkedService. +func (sls SquareLinkedService) AsDb2LinkedService() (*Db2LinkedService, bool) { + return nil, false +} + +// AsSybaseLinkedService is the BasicLinkedService implementation for SquareLinkedService. +func (sls SquareLinkedService) AsSybaseLinkedService() (*SybaseLinkedService, bool) { + return nil, false +} + +// AsPostgreSQLLinkedService is the BasicLinkedService implementation for SquareLinkedService. +func (sls SquareLinkedService) AsPostgreSQLLinkedService() (*PostgreSQLLinkedService, bool) { + return nil, false +} + +// AsMySQLLinkedService is the BasicLinkedService implementation for SquareLinkedService. +func (sls SquareLinkedService) AsMySQLLinkedService() (*MySQLLinkedService, bool) { + return nil, false +} + +// AsAzureMySQLLinkedService is the BasicLinkedService implementation for SquareLinkedService. +func (sls SquareLinkedService) AsAzureMySQLLinkedService() (*AzureMySQLLinkedService, bool) { + return nil, false +} + +// AsOracleLinkedService is the BasicLinkedService implementation for SquareLinkedService. +func (sls SquareLinkedService) AsOracleLinkedService() (*OracleLinkedService, bool) { + return nil, false +} + +// AsFileServerLinkedService is the BasicLinkedService implementation for SquareLinkedService. +func (sls SquareLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { + return nil, false +} + +// AsHDInsightLinkedService is the BasicLinkedService implementation for SquareLinkedService. +func (sls SquareLinkedService) AsHDInsightLinkedService() (*HDInsightLinkedService, bool) { + return nil, false +} + +// AsDynamicsLinkedService is the BasicLinkedService implementation for SquareLinkedService. +func (sls SquareLinkedService) AsDynamicsLinkedService() (*DynamicsLinkedService, bool) { + return nil, false +} + +// AsCosmosDbLinkedService is the BasicLinkedService implementation for SquareLinkedService. +func (sls SquareLinkedService) AsCosmosDbLinkedService() (*CosmosDbLinkedService, bool) { + return nil, false +} + +// AsAzureKeyVaultLinkedService is the BasicLinkedService implementation for SquareLinkedService. +func (sls SquareLinkedService) AsAzureKeyVaultLinkedService() (*AzureKeyVaultLinkedService, bool) { + return nil, false +} + +// AsAzureBatchLinkedService is the BasicLinkedService implementation for SquareLinkedService. +func (sls SquareLinkedService) AsAzureBatchLinkedService() (*AzureBatchLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDatabaseLinkedService is the BasicLinkedService implementation for SquareLinkedService. +func (sls SquareLinkedService) AsAzureSQLDatabaseLinkedService() (*AzureSQLDatabaseLinkedService, bool) { + return nil, false +} + +// AsSQLServerLinkedService is the BasicLinkedService implementation for SquareLinkedService. +func (sls SquareLinkedService) AsSQLServerLinkedService() (*SQLServerLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDWLinkedService is the BasicLinkedService implementation for SquareLinkedService. +func (sls SquareLinkedService) AsAzureSQLDWLinkedService() (*AzureSQLDWLinkedService, bool) { + return nil, false +} + +// AsAzureStorageLinkedService is the BasicLinkedService implementation for SquareLinkedService. +func (sls SquareLinkedService) AsAzureStorageLinkedService() (*AzureStorageLinkedService, bool) { + return nil, false +} + +// AsLinkedService is the BasicLinkedService implementation for SquareLinkedService. +func (sls SquareLinkedService) AsLinkedService() (*LinkedService, bool) { + return nil, false +} + +// AsBasicLinkedService is the BasicLinkedService implementation for SquareLinkedService. +func (sls SquareLinkedService) AsBasicLinkedService() (BasicLinkedService, bool) { + return &sls, true +} + +// UnmarshalJSON is the custom unmarshaler for SquareLinkedService struct. +func (sls *SquareLinkedService) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "typeProperties": + if v != nil { + var squareLinkedServiceTypeProperties SquareLinkedServiceTypeProperties + err = json.Unmarshal(*v, &squareLinkedServiceTypeProperties) + if err != nil { + return err + } + sls.SquareLinkedServiceTypeProperties = &squareLinkedServiceTypeProperties + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if sls.AdditionalProperties == nil { + sls.AdditionalProperties = make(map[string]interface{}) + } + sls.AdditionalProperties[k] = additionalProperties + } + case "connectVia": + if v != nil { + var connectVia IntegrationRuntimeReference + err = json.Unmarshal(*v, &connectVia) + if err != nil { + return err + } + sls.ConnectVia = &connectVia + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + sls.Description = &description + } + case "parameters": + if v != nil { + var parameters map[string]*ParameterSpecification + err = json.Unmarshal(*v, ¶meters) + if err != nil { + return err + } + sls.Parameters = parameters + } + case "annotations": + if v != nil { + var annotations []interface{} + err = json.Unmarshal(*v, &annotations) + if err != nil { + return err + } + sls.Annotations = &annotations + } + case "type": + if v != nil { + var typeVar TypeBasicLinkedService + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + sls.Type = typeVar + } + } + } + + return nil +} + +// SquareLinkedServiceTypeProperties square Serivce linked service properties. +type SquareLinkedServiceTypeProperties struct { + // Host - The URL of the Square instance. (i.e. mystore.mysquare.com) + Host interface{} `json:"host,omitempty"` + // ClientID - The client ID associated with your Square application. + ClientID interface{} `json:"clientId,omitempty"` + // ClientSecret - The client secret associated with your Square application. + ClientSecret BasicSecretBase `json:"clientSecret,omitempty"` + // RedirectURI - The redirect URL assigned in the Square application dashboard. (i.e. http://localhost:2500) + RedirectURI interface{} `json:"redirectUri,omitempty"` + // UseEncryptedEndpoints - Specifies whether the data source endpoints are encrypted using HTTPS. The default value is true. + UseEncryptedEndpoints interface{} `json:"useEncryptedEndpoints,omitempty"` + // UseHostVerification - Specifies whether to require the host name in the server's certificate to match the host name of the server when connecting over SSL. The default value is true. + UseHostVerification interface{} `json:"useHostVerification,omitempty"` + // UsePeerVerification - Specifies whether to verify the identity of the server when connecting over SSL. The default value is true. + UsePeerVerification interface{} `json:"usePeerVerification,omitempty"` + // EncryptedCredential - The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string). + EncryptedCredential interface{} `json:"encryptedCredential,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for SquareLinkedServiceTypeProperties struct. +func (slstp *SquareLinkedServiceTypeProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "host": + if v != nil { + var host interface{} + err = json.Unmarshal(*v, &host) + if err != nil { + return err + } + slstp.Host = host + } + case "clientId": + if v != nil { + var clientID interface{} + err = json.Unmarshal(*v, &clientID) + if err != nil { + return err + } + slstp.ClientID = clientID + } + case "clientSecret": + if v != nil { + clientSecret, err := unmarshalBasicSecretBase(*v) + if err != nil { + return err + } + slstp.ClientSecret = clientSecret + } + case "redirectUri": + if v != nil { + var redirectURI interface{} + err = json.Unmarshal(*v, &redirectURI) + if err != nil { + return err + } + slstp.RedirectURI = redirectURI + } + case "useEncryptedEndpoints": + if v != nil { + var useEncryptedEndpoints interface{} + err = json.Unmarshal(*v, &useEncryptedEndpoints) + if err != nil { + return err + } + slstp.UseEncryptedEndpoints = useEncryptedEndpoints + } + case "useHostVerification": + if v != nil { + var useHostVerification interface{} + err = json.Unmarshal(*v, &useHostVerification) + if err != nil { + return err + } + slstp.UseHostVerification = useHostVerification + } + case "usePeerVerification": + if v != nil { + var usePeerVerification interface{} + err = json.Unmarshal(*v, &usePeerVerification) + if err != nil { + return err + } + slstp.UsePeerVerification = usePeerVerification + } + case "encryptedCredential": + if v != nil { + var encryptedCredential interface{} + err = json.Unmarshal(*v, &encryptedCredential) + if err != nil { + return err + } + slstp.EncryptedCredential = encryptedCredential + } + } + } + + return nil +} + +// SquareObjectDataset square Serivce dataset. +type SquareObjectDataset struct { + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Description - Dataset description. + Description *string `json:"description,omitempty"` + // Structure - Columns that define the structure of the dataset. Type: array (or Expression with resultType array), itemType: DatasetDataElement. + Structure interface{} `json:"structure,omitempty"` + // LinkedServiceName - Linked service reference. + LinkedServiceName *LinkedServiceReference `json:"linkedServiceName,omitempty"` + // Parameters - Parameters for dataset. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeDataset', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSQLServerTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSalesforceObject', 'TypeRelationalTable', 'TypeAzureMySQLTable', 'TypeOracleTable', 'TypeODataResource', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeAzureDataLakeStoreFile', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeAmazonS3Object' + Type TypeBasicDataset `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for SquareObjectDataset. +func (sod SquareObjectDataset) MarshalJSON() ([]byte, error) { + sod.Type = TypeSquareObject + objectMap := make(map[string]interface{}) + if sod.Description != nil { + objectMap["description"] = sod.Description + } + objectMap["structure"] = sod.Structure + if sod.LinkedServiceName != nil { + objectMap["linkedServiceName"] = sod.LinkedServiceName + } + if sod.Parameters != nil { + objectMap["parameters"] = sod.Parameters + } + if sod.Annotations != nil { + objectMap["annotations"] = sod.Annotations + } + if sod.Type != "" { + objectMap["type"] = sod.Type + } + for k, v := range sod.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysObjectDataset is the BasicDataset implementation for SquareObjectDataset. +func (sod SquareObjectDataset) AsResponsysObjectDataset() (*ResponsysObjectDataset, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudObjectDataset is the BasicDataset implementation for SquareObjectDataset. +func (sod SquareObjectDataset) AsSalesforceMarketingCloudObjectDataset() (*SalesforceMarketingCloudObjectDataset, bool) { + return nil, false +} + +// AsVerticaTableDataset is the BasicDataset implementation for SquareObjectDataset. +func (sod SquareObjectDataset) AsVerticaTableDataset() (*VerticaTableDataset, bool) { + return nil, false +} + +// AsNetezzaTableDataset is the BasicDataset implementation for SquareObjectDataset. +func (sod SquareObjectDataset) AsNetezzaTableDataset() (*NetezzaTableDataset, bool) { + return nil, false +} + +// AsZohoObjectDataset is the BasicDataset implementation for SquareObjectDataset. +func (sod SquareObjectDataset) AsZohoObjectDataset() (*ZohoObjectDataset, bool) { + return nil, false +} + +// AsXeroObjectDataset is the BasicDataset implementation for SquareObjectDataset. +func (sod SquareObjectDataset) AsXeroObjectDataset() (*XeroObjectDataset, bool) { + return nil, false +} + +// AsSquareObjectDataset is the BasicDataset implementation for SquareObjectDataset. +func (sod SquareObjectDataset) AsSquareObjectDataset() (*SquareObjectDataset, bool) { + return &sod, true +} + +// AsSparkObjectDataset is the BasicDataset implementation for SquareObjectDataset. +func (sod SquareObjectDataset) AsSparkObjectDataset() (*SparkObjectDataset, bool) { + return nil, false +} + +// AsShopifyObjectDataset is the BasicDataset implementation for SquareObjectDataset. +func (sod SquareObjectDataset) AsShopifyObjectDataset() (*ShopifyObjectDataset, bool) { + return nil, false +} + +// AsServiceNowObjectDataset is the BasicDataset implementation for SquareObjectDataset. +func (sod SquareObjectDataset) AsServiceNowObjectDataset() (*ServiceNowObjectDataset, bool) { + return nil, false +} + +// AsQuickBooksObjectDataset is the BasicDataset implementation for SquareObjectDataset. +func (sod SquareObjectDataset) AsQuickBooksObjectDataset() (*QuickBooksObjectDataset, bool) { + return nil, false +} + +// AsPrestoObjectDataset is the BasicDataset implementation for SquareObjectDataset. +func (sod SquareObjectDataset) AsPrestoObjectDataset() (*PrestoObjectDataset, bool) { + return nil, false +} + +// AsPhoenixObjectDataset is the BasicDataset implementation for SquareObjectDataset. +func (sod SquareObjectDataset) AsPhoenixObjectDataset() (*PhoenixObjectDataset, bool) { + return nil, false +} + +// AsPaypalObjectDataset is the BasicDataset implementation for SquareObjectDataset. +func (sod SquareObjectDataset) AsPaypalObjectDataset() (*PaypalObjectDataset, bool) { + return nil, false +} + +// AsMarketoObjectDataset is the BasicDataset implementation for SquareObjectDataset. +func (sod SquareObjectDataset) AsMarketoObjectDataset() (*MarketoObjectDataset, bool) { + return nil, false +} + +// AsMariaDBTableDataset is the BasicDataset implementation for SquareObjectDataset. +func (sod SquareObjectDataset) AsMariaDBTableDataset() (*MariaDBTableDataset, bool) { + return nil, false +} + +// AsMagentoObjectDataset is the BasicDataset implementation for SquareObjectDataset. +func (sod SquareObjectDataset) AsMagentoObjectDataset() (*MagentoObjectDataset, bool) { + return nil, false +} + +// AsJiraObjectDataset is the BasicDataset implementation for SquareObjectDataset. +func (sod SquareObjectDataset) AsJiraObjectDataset() (*JiraObjectDataset, bool) { + return nil, false +} + +// AsImpalaObjectDataset is the BasicDataset implementation for SquareObjectDataset. +func (sod SquareObjectDataset) AsImpalaObjectDataset() (*ImpalaObjectDataset, bool) { + return nil, false +} + +// AsHubspotObjectDataset is the BasicDataset implementation for SquareObjectDataset. +func (sod SquareObjectDataset) AsHubspotObjectDataset() (*HubspotObjectDataset, bool) { + return nil, false +} + +// AsHiveObjectDataset is the BasicDataset implementation for SquareObjectDataset. +func (sod SquareObjectDataset) AsHiveObjectDataset() (*HiveObjectDataset, bool) { + return nil, false +} + +// AsHBaseObjectDataset is the BasicDataset implementation for SquareObjectDataset. +func (sod SquareObjectDataset) AsHBaseObjectDataset() (*HBaseObjectDataset, bool) { + return nil, false +} + +// AsGreenplumTableDataset is the BasicDataset implementation for SquareObjectDataset. +func (sod SquareObjectDataset) AsGreenplumTableDataset() (*GreenplumTableDataset, bool) { + return nil, false +} + +// AsGoogleBigQueryObjectDataset is the BasicDataset implementation for SquareObjectDataset. +func (sod SquareObjectDataset) AsGoogleBigQueryObjectDataset() (*GoogleBigQueryObjectDataset, bool) { + return nil, false +} + +// AsEloquaObjectDataset is the BasicDataset implementation for SquareObjectDataset. +func (sod SquareObjectDataset) AsEloquaObjectDataset() (*EloquaObjectDataset, bool) { + return nil, false +} + +// AsDrillTableDataset is the BasicDataset implementation for SquareObjectDataset. +func (sod SquareObjectDataset) AsDrillTableDataset() (*DrillTableDataset, bool) { + return nil, false +} + +// AsCouchbaseTableDataset is the BasicDataset implementation for SquareObjectDataset. +func (sod SquareObjectDataset) AsCouchbaseTableDataset() (*CouchbaseTableDataset, bool) { + return nil, false +} + +// AsConcurObjectDataset is the BasicDataset implementation for SquareObjectDataset. +func (sod SquareObjectDataset) AsConcurObjectDataset() (*ConcurObjectDataset, bool) { + return nil, false +} + +// AsAzurePostgreSQLTableDataset is the BasicDataset implementation for SquareObjectDataset. +func (sod SquareObjectDataset) AsAzurePostgreSQLTableDataset() (*AzurePostgreSQLTableDataset, bool) { + return nil, false +} + +// AsAmazonMWSObjectDataset is the BasicDataset implementation for SquareObjectDataset. +func (sod SquareObjectDataset) AsAmazonMWSObjectDataset() (*AmazonMWSObjectDataset, bool) { + return nil, false +} + +// AsHTTPDataset is the BasicDataset implementation for SquareObjectDataset. +func (sod SquareObjectDataset) AsHTTPDataset() (*HTTPDataset, bool) { + return nil, false +} + +// AsAzureSearchIndexDataset is the BasicDataset implementation for SquareObjectDataset. +func (sod SquareObjectDataset) AsAzureSearchIndexDataset() (*AzureSearchIndexDataset, bool) { + return nil, false +} + +// AsWebTableDataset is the BasicDataset implementation for SquareObjectDataset. +func (sod SquareObjectDataset) AsWebTableDataset() (*WebTableDataset, bool) { + return nil, false +} + +// AsSQLServerTableDataset is the BasicDataset implementation for SquareObjectDataset. +func (sod SquareObjectDataset) AsSQLServerTableDataset() (*SQLServerTableDataset, bool) { + return nil, false +} + +// AsSapEccResourceDataset is the BasicDataset implementation for SquareObjectDataset. +func (sod SquareObjectDataset) AsSapEccResourceDataset() (*SapEccResourceDataset, bool) { + return nil, false +} + +// AsSapCloudForCustomerResourceDataset is the BasicDataset implementation for SquareObjectDataset. +func (sod SquareObjectDataset) AsSapCloudForCustomerResourceDataset() (*SapCloudForCustomerResourceDataset, bool) { + return nil, false +} + +// AsSalesforceObjectDataset is the BasicDataset implementation for SquareObjectDataset. +func (sod SquareObjectDataset) AsSalesforceObjectDataset() (*SalesforceObjectDataset, bool) { + return nil, false +} + +// AsRelationalTableDataset is the BasicDataset implementation for SquareObjectDataset. +func (sod SquareObjectDataset) AsRelationalTableDataset() (*RelationalTableDataset, bool) { + return nil, false +} + +// AsAzureMySQLTableDataset is the BasicDataset implementation for SquareObjectDataset. +func (sod SquareObjectDataset) AsAzureMySQLTableDataset() (*AzureMySQLTableDataset, bool) { + return nil, false +} + +// AsOracleTableDataset is the BasicDataset implementation for SquareObjectDataset. +func (sod SquareObjectDataset) AsOracleTableDataset() (*OracleTableDataset, bool) { + return nil, false +} + +// AsODataResourceDataset is the BasicDataset implementation for SquareObjectDataset. +func (sod SquareObjectDataset) AsODataResourceDataset() (*ODataResourceDataset, bool) { + return nil, false +} + +// AsMongoDbCollectionDataset is the BasicDataset implementation for SquareObjectDataset. +func (sod SquareObjectDataset) AsMongoDbCollectionDataset() (*MongoDbCollectionDataset, bool) { + return nil, false +} + +// AsFileShareDataset is the BasicDataset implementation for SquareObjectDataset. +func (sod SquareObjectDataset) AsFileShareDataset() (*FileShareDataset, bool) { + return nil, false +} + +// AsAzureDataLakeStoreDataset is the BasicDataset implementation for SquareObjectDataset. +func (sod SquareObjectDataset) AsAzureDataLakeStoreDataset() (*AzureDataLakeStoreDataset, bool) { + return nil, false +} + +// AsDynamicsEntityDataset is the BasicDataset implementation for SquareObjectDataset. +func (sod SquareObjectDataset) AsDynamicsEntityDataset() (*DynamicsEntityDataset, bool) { + return nil, false +} + +// AsDocumentDbCollectionDataset is the BasicDataset implementation for SquareObjectDataset. +func (sod SquareObjectDataset) AsDocumentDbCollectionDataset() (*DocumentDbCollectionDataset, bool) { + return nil, false +} + +// AsCustomDataset is the BasicDataset implementation for SquareObjectDataset. +func (sod SquareObjectDataset) AsCustomDataset() (*CustomDataset, bool) { + return nil, false +} + +// AsCassandraTableDataset is the BasicDataset implementation for SquareObjectDataset. +func (sod SquareObjectDataset) AsCassandraTableDataset() (*CassandraTableDataset, bool) { + return nil, false +} + +// AsAzureSQLDWTableDataset is the BasicDataset implementation for SquareObjectDataset. +func (sod SquareObjectDataset) AsAzureSQLDWTableDataset() (*AzureSQLDWTableDataset, bool) { + return nil, false +} + +// AsAzureSQLTableDataset is the BasicDataset implementation for SquareObjectDataset. +func (sod SquareObjectDataset) AsAzureSQLTableDataset() (*AzureSQLTableDataset, bool) { + return nil, false +} + +// AsAzureTableDataset is the BasicDataset implementation for SquareObjectDataset. +func (sod SquareObjectDataset) AsAzureTableDataset() (*AzureTableDataset, bool) { + return nil, false +} + +// AsAzureBlobDataset is the BasicDataset implementation for SquareObjectDataset. +func (sod SquareObjectDataset) AsAzureBlobDataset() (*AzureBlobDataset, bool) { + return nil, false +} + +// AsAmazonS3Dataset is the BasicDataset implementation for SquareObjectDataset. +func (sod SquareObjectDataset) AsAmazonS3Dataset() (*AmazonS3Dataset, bool) { + return nil, false +} + +// AsDataset is the BasicDataset implementation for SquareObjectDataset. +func (sod SquareObjectDataset) AsDataset() (*Dataset, bool) { + return nil, false +} + +// AsBasicDataset is the BasicDataset implementation for SquareObjectDataset. +func (sod SquareObjectDataset) AsBasicDataset() (BasicDataset, bool) { + return &sod, true +} + +// SquareSource a copy activity Square Serivce source. +type SquareSource struct { + // Query - A query to retrieve data from source. Type: string (or Expression with resultType string). + Query interface{} `json:"query,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // SourceRetryCount - Source retry count. Type: integer (or Expression with resultType integer). + SourceRetryCount interface{} `json:"sourceRetryCount,omitempty"` + // SourceRetryWait - Source retry wait. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` + // Type - Possible values include: 'TypeCopySource', 'TypeAmazonRedshiftSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeHTTPSource', 'TypeAzureDataLakeStoreSource', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeRelationalSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource' + Type TypeBasicCopySource `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for SquareSource. +func (ss SquareSource) MarshalJSON() ([]byte, error) { + ss.Type = TypeSquareSource + objectMap := make(map[string]interface{}) + objectMap["query"] = ss.Query + objectMap["sourceRetryCount"] = ss.SourceRetryCount + objectMap["sourceRetryWait"] = ss.SourceRetryWait + if ss.Type != "" { + objectMap["type"] = ss.Type + } + for k, v := range ss.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsAmazonRedshiftSource is the BasicCopySource implementation for SquareSource. +func (ss SquareSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { + return nil, false +} + +// AsResponsysSource is the BasicCopySource implementation for SquareSource. +func (ss SquareSource) AsResponsysSource() (*ResponsysSource, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudSource is the BasicCopySource implementation for SquareSource. +func (ss SquareSource) AsSalesforceMarketingCloudSource() (*SalesforceMarketingCloudSource, bool) { + return nil, false +} + +// AsVerticaSource is the BasicCopySource implementation for SquareSource. +func (ss SquareSource) AsVerticaSource() (*VerticaSource, bool) { + return nil, false +} + +// AsNetezzaSource is the BasicCopySource implementation for SquareSource. +func (ss SquareSource) AsNetezzaSource() (*NetezzaSource, bool) { + return nil, false +} + +// AsZohoSource is the BasicCopySource implementation for SquareSource. +func (ss SquareSource) AsZohoSource() (*ZohoSource, bool) { + return nil, false +} + +// AsXeroSource is the BasicCopySource implementation for SquareSource. +func (ss SquareSource) AsXeroSource() (*XeroSource, bool) { + return nil, false +} + +// AsSquareSource is the BasicCopySource implementation for SquareSource. +func (ss SquareSource) AsSquareSource() (*SquareSource, bool) { + return &ss, true +} + +// AsSparkSource is the BasicCopySource implementation for SquareSource. +func (ss SquareSource) AsSparkSource() (*SparkSource, bool) { + return nil, false +} + +// AsShopifySource is the BasicCopySource implementation for SquareSource. +func (ss SquareSource) AsShopifySource() (*ShopifySource, bool) { + return nil, false +} + +// AsServiceNowSource is the BasicCopySource implementation for SquareSource. +func (ss SquareSource) AsServiceNowSource() (*ServiceNowSource, bool) { + return nil, false +} + +// AsQuickBooksSource is the BasicCopySource implementation for SquareSource. +func (ss SquareSource) AsQuickBooksSource() (*QuickBooksSource, bool) { + return nil, false +} + +// AsPrestoSource is the BasicCopySource implementation for SquareSource. +func (ss SquareSource) AsPrestoSource() (*PrestoSource, bool) { + return nil, false +} + +// AsPhoenixSource is the BasicCopySource implementation for SquareSource. +func (ss SquareSource) AsPhoenixSource() (*PhoenixSource, bool) { + return nil, false +} + +// AsPaypalSource is the BasicCopySource implementation for SquareSource. +func (ss SquareSource) AsPaypalSource() (*PaypalSource, bool) { + return nil, false +} + +// AsMarketoSource is the BasicCopySource implementation for SquareSource. +func (ss SquareSource) AsMarketoSource() (*MarketoSource, bool) { + return nil, false +} + +// AsMariaDBSource is the BasicCopySource implementation for SquareSource. +func (ss SquareSource) AsMariaDBSource() (*MariaDBSource, bool) { + return nil, false +} + +// AsMagentoSource is the BasicCopySource implementation for SquareSource. +func (ss SquareSource) AsMagentoSource() (*MagentoSource, bool) { + return nil, false +} + +// AsJiraSource is the BasicCopySource implementation for SquareSource. +func (ss SquareSource) AsJiraSource() (*JiraSource, bool) { + return nil, false +} + +// AsImpalaSource is the BasicCopySource implementation for SquareSource. +func (ss SquareSource) AsImpalaSource() (*ImpalaSource, bool) { + return nil, false +} + +// AsHubspotSource is the BasicCopySource implementation for SquareSource. +func (ss SquareSource) AsHubspotSource() (*HubspotSource, bool) { + return nil, false +} + +// AsHiveSource is the BasicCopySource implementation for SquareSource. +func (ss SquareSource) AsHiveSource() (*HiveSource, bool) { + return nil, false +} + +// AsHBaseSource is the BasicCopySource implementation for SquareSource. +func (ss SquareSource) AsHBaseSource() (*HBaseSource, bool) { + return nil, false +} + +// AsGreenplumSource is the BasicCopySource implementation for SquareSource. +func (ss SquareSource) AsGreenplumSource() (*GreenplumSource, bool) { + return nil, false +} + +// AsGoogleBigQuerySource is the BasicCopySource implementation for SquareSource. +func (ss SquareSource) AsGoogleBigQuerySource() (*GoogleBigQuerySource, bool) { + return nil, false +} + +// AsEloquaSource is the BasicCopySource implementation for SquareSource. +func (ss SquareSource) AsEloquaSource() (*EloquaSource, bool) { + return nil, false +} + +// AsDrillSource is the BasicCopySource implementation for SquareSource. +func (ss SquareSource) AsDrillSource() (*DrillSource, bool) { + return nil, false +} + +// AsCouchbaseSource is the BasicCopySource implementation for SquareSource. +func (ss SquareSource) AsCouchbaseSource() (*CouchbaseSource, bool) { + return nil, false +} + +// AsConcurSource is the BasicCopySource implementation for SquareSource. +func (ss SquareSource) AsConcurSource() (*ConcurSource, bool) { + return nil, false +} + +// AsAzurePostgreSQLSource is the BasicCopySource implementation for SquareSource. +func (ss SquareSource) AsAzurePostgreSQLSource() (*AzurePostgreSQLSource, bool) { + return nil, false +} + +// AsAmazonMWSSource is the BasicCopySource implementation for SquareSource. +func (ss SquareSource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { + return nil, false +} + +// AsHTTPSource is the BasicCopySource implementation for SquareSource. +func (ss SquareSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for SquareSource. +func (ss SquareSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for SquareSource. +func (ss SquareSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsCassandraSource is the BasicCopySource implementation for SquareSource. +func (ss SquareSource) AsCassandraSource() (*CassandraSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for SquareSource. +func (ss SquareSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for SquareSource. +func (ss SquareSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureMySQLSource is the BasicCopySource implementation for SquareSource. +func (ss SquareSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for SquareSource. +func (ss SquareSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for SquareSource. +func (ss SquareSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsSQLDWSource is the BasicCopySource implementation for SquareSource. +func (ss SquareSource) AsSQLDWSource() (*SQLDWSource, bool) { + return nil, false +} + +// AsSQLSource is the BasicCopySource implementation for SquareSource. +func (ss SquareSource) AsSQLSource() (*SQLSource, bool) { + return nil, false +} + +// AsSapEccSource is the BasicCopySource implementation for SquareSource. +func (ss SquareSource) AsSapEccSource() (*SapEccSource, bool) { + return nil, false +} + +// AsSapCloudForCustomerSource is the BasicCopySource implementation for SquareSource. +func (ss SquareSource) AsSapCloudForCustomerSource() (*SapCloudForCustomerSource, bool) { + return nil, false +} + +// AsSalesforceSource is the BasicCopySource implementation for SquareSource. +func (ss SquareSource) AsSalesforceSource() (*SalesforceSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for SquareSource. +func (ss SquareSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for SquareSource. +func (ss SquareSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for SquareSource. +func (ss SquareSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for SquareSource. +func (ss SquareSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + +// AsAzureTableSource is the BasicCopySource implementation for SquareSource. +func (ss SquareSource) AsAzureTableSource() (*AzureTableSource, bool) { + return nil, false +} + +// AsCopySource is the BasicCopySource implementation for SquareSource. +func (ss SquareSource) AsCopySource() (*CopySource, bool) { + return nil, false +} + +// AsBasicCopySource is the BasicCopySource implementation for SquareSource. +func (ss SquareSource) AsBasicCopySource() (BasicCopySource, bool) { + return &ss, true +} + +// SSISExecutionParameter SSIS execution parameter. +type SSISExecutionParameter struct { + // Value - SSIS package execution parameter value. Type: string (or Expression with resultType string). + Value interface{} `json:"value,omitempty"` +} + +// SSISPackageLocation SSIS package location. +type SSISPackageLocation struct { + // PackagePath - The SSIS package path. + PackagePath *string `json:"packagePath,omitempty"` +} + +// SSISPropertyOverride SSIS property override. +type SSISPropertyOverride struct { + // Value - SSIS package property override value. Type: string (or Expression with resultType string). + Value interface{} `json:"value,omitempty"` + // IsSensitive - Whether SSIS package property override value is sensitive data. Value will be encrypted in SSISDB if it is true + IsSensitive *bool `json:"isSensitive,omitempty"` +} + +// StagingSettings staging settings. +type StagingSettings struct { + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // LinkedServiceName - Staging linked service reference. + LinkedServiceName *LinkedServiceReference `json:"linkedServiceName,omitempty"` + // Path - The path to storage for storing the interim data. Type: string (or Expression with resultType string). + Path interface{} `json:"path,omitempty"` + // EnableCompression - Specifies whether to use compression when copying data via an interim staging. Default value is false. Type: boolean (or Expression with resultType boolean). + EnableCompression interface{} `json:"enableCompression,omitempty"` +} + +// MarshalJSON is the custom marshaler for StagingSettings. +func (ss StagingSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ss.LinkedServiceName != nil { + objectMap["linkedServiceName"] = ss.LinkedServiceName + } + objectMap["path"] = ss.Path + objectMap["enableCompression"] = ss.EnableCompression + for k, v := range ss.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// StoredProcedureParameter SQL stored procedure parameter. +type StoredProcedureParameter struct { + // Value - Stored procedure parameter value. Type: string (or Expression with resultType string). + Value interface{} `json:"value,omitempty"` + // Type - Stored procedure parameter type. Possible values include: 'String', 'Int', 'Decimal', 'GUID', 'Boolean', 'Date' + Type StoredProcedureParameterType `json:"type,omitempty"` +} + +// SubResource azure Data Factory nested resource, which belongs to a factory. +type SubResource struct { + // ID - The resource identifier. + ID *string `json:"id,omitempty"` + // Name - The resource name. + Name *string `json:"name,omitempty"` + // Type - The resource type. + Type *string `json:"type,omitempty"` + // Etag - Etag identifies change in the resource. + Etag *string `json:"etag,omitempty"` +} + +// SybaseLinkedService linked service for Sybase data source. +type SybaseLinkedService struct { + // SybaseLinkedServiceTypeProperties - Sybase linked service properties. + *SybaseLinkedServiceTypeProperties `json:"typeProperties,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // ConnectVia - The integration runtime reference. + ConnectVia *IntegrationRuntimeReference `json:"connectVia,omitempty"` + // Description - Linked service description. + Description *string `json:"description,omitempty"` + // Parameters - Parameters for linked service. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeLinkedService', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforce', 'TypeAzureDataLakeStore', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureStorage' + Type TypeBasicLinkedService `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for SybaseLinkedService. +func (sls SybaseLinkedService) MarshalJSON() ([]byte, error) { + sls.Type = TypeSybase + objectMap := make(map[string]interface{}) + if sls.SybaseLinkedServiceTypeProperties != nil { + objectMap["typeProperties"] = sls.SybaseLinkedServiceTypeProperties + } + if sls.ConnectVia != nil { + objectMap["connectVia"] = sls.ConnectVia + } + if sls.Description != nil { + objectMap["description"] = sls.Description + } + if sls.Parameters != nil { + objectMap["parameters"] = sls.Parameters + } + if sls.Annotations != nil { + objectMap["annotations"] = sls.Annotations + } + if sls.Type != "" { + objectMap["type"] = sls.Type + } + for k, v := range sls.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysLinkedService is the BasicLinkedService implementation for SybaseLinkedService. +func (sls SybaseLinkedService) AsResponsysLinkedService() (*ResponsysLinkedService, bool) { + return nil, false +} + +// AsAzureDatabricksLinkedService is the BasicLinkedService implementation for SybaseLinkedService. +func (sls SybaseLinkedService) AsAzureDatabricksLinkedService() (*AzureDatabricksLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeAnalyticsLinkedService is the BasicLinkedService implementation for SybaseLinkedService. +func (sls SybaseLinkedService) AsAzureDataLakeAnalyticsLinkedService() (*AzureDataLakeAnalyticsLinkedService, bool) { + return nil, false +} + +// AsHDInsightOnDemandLinkedService is the BasicLinkedService implementation for SybaseLinkedService. +func (sls SybaseLinkedService) AsHDInsightOnDemandLinkedService() (*HDInsightOnDemandLinkedService, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudLinkedService is the BasicLinkedService implementation for SybaseLinkedService. +func (sls SybaseLinkedService) AsSalesforceMarketingCloudLinkedService() (*SalesforceMarketingCloudLinkedService, bool) { + return nil, false +} + +// AsNetezzaLinkedService is the BasicLinkedService implementation for SybaseLinkedService. +func (sls SybaseLinkedService) AsNetezzaLinkedService() (*NetezzaLinkedService, bool) { + return nil, false +} + +// AsVerticaLinkedService is the BasicLinkedService implementation for SybaseLinkedService. +func (sls SybaseLinkedService) AsVerticaLinkedService() (*VerticaLinkedService, bool) { + return nil, false +} + +// AsZohoLinkedService is the BasicLinkedService implementation for SybaseLinkedService. +func (sls SybaseLinkedService) AsZohoLinkedService() (*ZohoLinkedService, bool) { + return nil, false +} + +// AsXeroLinkedService is the BasicLinkedService implementation for SybaseLinkedService. +func (sls SybaseLinkedService) AsXeroLinkedService() (*XeroLinkedService, bool) { + return nil, false +} + +// AsSquareLinkedService is the BasicLinkedService implementation for SybaseLinkedService. +func (sls SybaseLinkedService) AsSquareLinkedService() (*SquareLinkedService, bool) { + return nil, false +} + +// AsSparkLinkedService is the BasicLinkedService implementation for SybaseLinkedService. +func (sls SybaseLinkedService) AsSparkLinkedService() (*SparkLinkedService, bool) { + return nil, false +} + +// AsShopifyLinkedService is the BasicLinkedService implementation for SybaseLinkedService. +func (sls SybaseLinkedService) AsShopifyLinkedService() (*ShopifyLinkedService, bool) { + return nil, false +} + +// AsServiceNowLinkedService is the BasicLinkedService implementation for SybaseLinkedService. +func (sls SybaseLinkedService) AsServiceNowLinkedService() (*ServiceNowLinkedService, bool) { + return nil, false +} + +// AsQuickBooksLinkedService is the BasicLinkedService implementation for SybaseLinkedService. +func (sls SybaseLinkedService) AsQuickBooksLinkedService() (*QuickBooksLinkedService, bool) { + return nil, false +} + +// AsPrestoLinkedService is the BasicLinkedService implementation for SybaseLinkedService. +func (sls SybaseLinkedService) AsPrestoLinkedService() (*PrestoLinkedService, bool) { + return nil, false +} + +// AsPhoenixLinkedService is the BasicLinkedService implementation for SybaseLinkedService. +func (sls SybaseLinkedService) AsPhoenixLinkedService() (*PhoenixLinkedService, bool) { + return nil, false +} + +// AsPaypalLinkedService is the BasicLinkedService implementation for SybaseLinkedService. +func (sls SybaseLinkedService) AsPaypalLinkedService() (*PaypalLinkedService, bool) { + return nil, false +} + +// AsMarketoLinkedService is the BasicLinkedService implementation for SybaseLinkedService. +func (sls SybaseLinkedService) AsMarketoLinkedService() (*MarketoLinkedService, bool) { + return nil, false +} + +// AsMariaDBLinkedService is the BasicLinkedService implementation for SybaseLinkedService. +func (sls SybaseLinkedService) AsMariaDBLinkedService() (*MariaDBLinkedService, bool) { + return nil, false +} + +// AsMagentoLinkedService is the BasicLinkedService implementation for SybaseLinkedService. +func (sls SybaseLinkedService) AsMagentoLinkedService() (*MagentoLinkedService, bool) { + return nil, false +} + +// AsJiraLinkedService is the BasicLinkedService implementation for SybaseLinkedService. +func (sls SybaseLinkedService) AsJiraLinkedService() (*JiraLinkedService, bool) { + return nil, false +} + +// AsImpalaLinkedService is the BasicLinkedService implementation for SybaseLinkedService. +func (sls SybaseLinkedService) AsImpalaLinkedService() (*ImpalaLinkedService, bool) { + return nil, false +} + +// AsHubspotLinkedService is the BasicLinkedService implementation for SybaseLinkedService. +func (sls SybaseLinkedService) AsHubspotLinkedService() (*HubspotLinkedService, bool) { + return nil, false +} + +// AsHiveLinkedService is the BasicLinkedService implementation for SybaseLinkedService. +func (sls SybaseLinkedService) AsHiveLinkedService() (*HiveLinkedService, bool) { + return nil, false +} + +// AsHBaseLinkedService is the BasicLinkedService implementation for SybaseLinkedService. +func (sls SybaseLinkedService) AsHBaseLinkedService() (*HBaseLinkedService, bool) { + return nil, false +} + +// AsGreenplumLinkedService is the BasicLinkedService implementation for SybaseLinkedService. +func (sls SybaseLinkedService) AsGreenplumLinkedService() (*GreenplumLinkedService, bool) { + return nil, false +} + +// AsGoogleBigQueryLinkedService is the BasicLinkedService implementation for SybaseLinkedService. +func (sls SybaseLinkedService) AsGoogleBigQueryLinkedService() (*GoogleBigQueryLinkedService, bool) { + return nil, false +} + +// AsEloquaLinkedService is the BasicLinkedService implementation for SybaseLinkedService. +func (sls SybaseLinkedService) AsEloquaLinkedService() (*EloquaLinkedService, bool) { + return nil, false +} + +// AsDrillLinkedService is the BasicLinkedService implementation for SybaseLinkedService. +func (sls SybaseLinkedService) AsDrillLinkedService() (*DrillLinkedService, bool) { + return nil, false +} + +// AsCouchbaseLinkedService is the BasicLinkedService implementation for SybaseLinkedService. +func (sls SybaseLinkedService) AsCouchbaseLinkedService() (*CouchbaseLinkedService, bool) { + return nil, false +} + +// AsConcurLinkedService is the BasicLinkedService implementation for SybaseLinkedService. +func (sls SybaseLinkedService) AsConcurLinkedService() (*ConcurLinkedService, bool) { + return nil, false +} + +// AsAzurePostgreSQLLinkedService is the BasicLinkedService implementation for SybaseLinkedService. +func (sls SybaseLinkedService) AsAzurePostgreSQLLinkedService() (*AzurePostgreSQLLinkedService, bool) { + return nil, false +} + +// AsAmazonMWSLinkedService is the BasicLinkedService implementation for SybaseLinkedService. +func (sls SybaseLinkedService) AsAmazonMWSLinkedService() (*AmazonMWSLinkedService, bool) { + return nil, false +} + +// AsSapHanaLinkedService is the BasicLinkedService implementation for SybaseLinkedService. +func (sls SybaseLinkedService) AsSapHanaLinkedService() (*SapHanaLinkedService, bool) { + return nil, false +} + +// AsSapBWLinkedService is the BasicLinkedService implementation for SybaseLinkedService. +func (sls SybaseLinkedService) AsSapBWLinkedService() (*SapBWLinkedService, bool) { + return nil, false +} + +// AsSftpServerLinkedService is the BasicLinkedService implementation for SybaseLinkedService. +func (sls SybaseLinkedService) AsSftpServerLinkedService() (*SftpServerLinkedService, bool) { + return nil, false +} + +// AsFtpServerLinkedService is the BasicLinkedService implementation for SybaseLinkedService. +func (sls SybaseLinkedService) AsFtpServerLinkedService() (*FtpServerLinkedService, bool) { + return nil, false +} + +// AsHTTPLinkedService is the BasicLinkedService implementation for SybaseLinkedService. +func (sls SybaseLinkedService) AsHTTPLinkedService() (*HTTPLinkedService, bool) { + return nil, false +} + +// AsAzureSearchLinkedService is the BasicLinkedService implementation for SybaseLinkedService. +func (sls SybaseLinkedService) AsAzureSearchLinkedService() (*AzureSearchLinkedService, bool) { + return nil, false +} + +// AsCustomDataSourceLinkedService is the BasicLinkedService implementation for SybaseLinkedService. +func (sls SybaseLinkedService) AsCustomDataSourceLinkedService() (*CustomDataSourceLinkedService, bool) { + return nil, false +} + +// AsAmazonRedshiftLinkedService is the BasicLinkedService implementation for SybaseLinkedService. +func (sls SybaseLinkedService) AsAmazonRedshiftLinkedService() (*AmazonRedshiftLinkedService, bool) { + return nil, false +} + +// AsAmazonS3LinkedService is the BasicLinkedService implementation for SybaseLinkedService. +func (sls SybaseLinkedService) AsAmazonS3LinkedService() (*AmazonS3LinkedService, bool) { + return nil, false +} + +// AsSapEccLinkedService is the BasicLinkedService implementation for SybaseLinkedService. +func (sls SybaseLinkedService) AsSapEccLinkedService() (*SapEccLinkedService, bool) { + return nil, false +} + +// AsSapCloudForCustomerLinkedService is the BasicLinkedService implementation for SybaseLinkedService. +func (sls SybaseLinkedService) AsSapCloudForCustomerLinkedService() (*SapCloudForCustomerLinkedService, bool) { + return nil, false +} + +// AsSalesforceLinkedService is the BasicLinkedService implementation for SybaseLinkedService. +func (sls SybaseLinkedService) AsSalesforceLinkedService() (*SalesforceLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeStoreLinkedService is the BasicLinkedService implementation for SybaseLinkedService. +func (sls SybaseLinkedService) AsAzureDataLakeStoreLinkedService() (*AzureDataLakeStoreLinkedService, bool) { + return nil, false +} + +// AsMongoDbLinkedService is the BasicLinkedService implementation for SybaseLinkedService. +func (sls SybaseLinkedService) AsMongoDbLinkedService() (*MongoDbLinkedService, bool) { + return nil, false +} + +// AsCassandraLinkedService is the BasicLinkedService implementation for SybaseLinkedService. +func (sls SybaseLinkedService) AsCassandraLinkedService() (*CassandraLinkedService, bool) { + return nil, false +} + +// AsWebLinkedService is the BasicLinkedService implementation for SybaseLinkedService. +func (sls SybaseLinkedService) AsWebLinkedService() (*WebLinkedService, bool) { + return nil, false +} + +// AsODataLinkedService is the BasicLinkedService implementation for SybaseLinkedService. +func (sls SybaseLinkedService) AsODataLinkedService() (*ODataLinkedService, bool) { + return nil, false +} + +// AsHdfsLinkedService is the BasicLinkedService implementation for SybaseLinkedService. +func (sls SybaseLinkedService) AsHdfsLinkedService() (*HdfsLinkedService, bool) { + return nil, false +} + +// AsOdbcLinkedService is the BasicLinkedService implementation for SybaseLinkedService. +func (sls SybaseLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, bool) { + return nil, false +} + +// AsAzureMLLinkedService is the BasicLinkedService implementation for SybaseLinkedService. +func (sls SybaseLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { + return nil, false +} + +// AsTeradataLinkedService is the BasicLinkedService implementation for SybaseLinkedService. +func (sls SybaseLinkedService) AsTeradataLinkedService() (*TeradataLinkedService, bool) { + return nil, false +} + +// AsDb2LinkedService is the BasicLinkedService implementation for SybaseLinkedService. +func (sls SybaseLinkedService) AsDb2LinkedService() (*Db2LinkedService, bool) { + return nil, false +} + +// AsSybaseLinkedService is the BasicLinkedService implementation for SybaseLinkedService. +func (sls SybaseLinkedService) AsSybaseLinkedService() (*SybaseLinkedService, bool) { + return &sls, true +} + +// AsPostgreSQLLinkedService is the BasicLinkedService implementation for SybaseLinkedService. +func (sls SybaseLinkedService) AsPostgreSQLLinkedService() (*PostgreSQLLinkedService, bool) { + return nil, false +} + +// AsMySQLLinkedService is the BasicLinkedService implementation for SybaseLinkedService. +func (sls SybaseLinkedService) AsMySQLLinkedService() (*MySQLLinkedService, bool) { + return nil, false +} + +// AsAzureMySQLLinkedService is the BasicLinkedService implementation for SybaseLinkedService. +func (sls SybaseLinkedService) AsAzureMySQLLinkedService() (*AzureMySQLLinkedService, bool) { + return nil, false +} + +// AsOracleLinkedService is the BasicLinkedService implementation for SybaseLinkedService. +func (sls SybaseLinkedService) AsOracleLinkedService() (*OracleLinkedService, bool) { + return nil, false +} + +// AsFileServerLinkedService is the BasicLinkedService implementation for SybaseLinkedService. +func (sls SybaseLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { + return nil, false +} + +// AsHDInsightLinkedService is the BasicLinkedService implementation for SybaseLinkedService. +func (sls SybaseLinkedService) AsHDInsightLinkedService() (*HDInsightLinkedService, bool) { + return nil, false +} + +// AsDynamicsLinkedService is the BasicLinkedService implementation for SybaseLinkedService. +func (sls SybaseLinkedService) AsDynamicsLinkedService() (*DynamicsLinkedService, bool) { + return nil, false +} + +// AsCosmosDbLinkedService is the BasicLinkedService implementation for SybaseLinkedService. +func (sls SybaseLinkedService) AsCosmosDbLinkedService() (*CosmosDbLinkedService, bool) { + return nil, false +} + +// AsAzureKeyVaultLinkedService is the BasicLinkedService implementation for SybaseLinkedService. +func (sls SybaseLinkedService) AsAzureKeyVaultLinkedService() (*AzureKeyVaultLinkedService, bool) { + return nil, false +} + +// AsAzureBatchLinkedService is the BasicLinkedService implementation for SybaseLinkedService. +func (sls SybaseLinkedService) AsAzureBatchLinkedService() (*AzureBatchLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDatabaseLinkedService is the BasicLinkedService implementation for SybaseLinkedService. +func (sls SybaseLinkedService) AsAzureSQLDatabaseLinkedService() (*AzureSQLDatabaseLinkedService, bool) { + return nil, false +} + +// AsSQLServerLinkedService is the BasicLinkedService implementation for SybaseLinkedService. +func (sls SybaseLinkedService) AsSQLServerLinkedService() (*SQLServerLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDWLinkedService is the BasicLinkedService implementation for SybaseLinkedService. +func (sls SybaseLinkedService) AsAzureSQLDWLinkedService() (*AzureSQLDWLinkedService, bool) { + return nil, false +} + +// AsAzureStorageLinkedService is the BasicLinkedService implementation for SybaseLinkedService. +func (sls SybaseLinkedService) AsAzureStorageLinkedService() (*AzureStorageLinkedService, bool) { + return nil, false +} + +// AsLinkedService is the BasicLinkedService implementation for SybaseLinkedService. +func (sls SybaseLinkedService) AsLinkedService() (*LinkedService, bool) { + return nil, false +} + +// AsBasicLinkedService is the BasicLinkedService implementation for SybaseLinkedService. +func (sls SybaseLinkedService) AsBasicLinkedService() (BasicLinkedService, bool) { + return &sls, true +} + +// UnmarshalJSON is the custom unmarshaler for SybaseLinkedService struct. +func (sls *SybaseLinkedService) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "typeProperties": + if v != nil { + var sybaseLinkedServiceTypeProperties SybaseLinkedServiceTypeProperties + err = json.Unmarshal(*v, &sybaseLinkedServiceTypeProperties) + if err != nil { + return err + } + sls.SybaseLinkedServiceTypeProperties = &sybaseLinkedServiceTypeProperties + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if sls.AdditionalProperties == nil { + sls.AdditionalProperties = make(map[string]interface{}) + } + sls.AdditionalProperties[k] = additionalProperties + } + case "connectVia": + if v != nil { + var connectVia IntegrationRuntimeReference + err = json.Unmarshal(*v, &connectVia) + if err != nil { + return err + } + sls.ConnectVia = &connectVia + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + sls.Description = &description + } + case "parameters": + if v != nil { + var parameters map[string]*ParameterSpecification + err = json.Unmarshal(*v, ¶meters) + if err != nil { + return err + } + sls.Parameters = parameters + } + case "annotations": + if v != nil { + var annotations []interface{} + err = json.Unmarshal(*v, &annotations) + if err != nil { + return err + } + sls.Annotations = &annotations + } + case "type": + if v != nil { + var typeVar TypeBasicLinkedService + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + sls.Type = typeVar + } + } + } + + return nil +} + +// SybaseLinkedServiceTypeProperties sybase linked service properties. +type SybaseLinkedServiceTypeProperties struct { + // Server - Server name for connection. Type: string (or Expression with resultType string). + Server interface{} `json:"server,omitempty"` + // Database - Database name for connection. Type: string (or Expression with resultType string). + Database interface{} `json:"database,omitempty"` + // Schema - Schema name for connection. Type: string (or Expression with resultType string). + Schema interface{} `json:"schema,omitempty"` + // AuthenticationType - AuthenticationType to be used for connection. Possible values include: 'SybaseAuthenticationTypeBasic', 'SybaseAuthenticationTypeWindows' + AuthenticationType SybaseAuthenticationType `json:"authenticationType,omitempty"` + // Username - Username for authentication. Type: string (or Expression with resultType string). + Username interface{} `json:"username,omitempty"` + // Password - Password for authentication. + Password BasicSecretBase `json:"password,omitempty"` + // EncryptedCredential - The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string). + EncryptedCredential interface{} `json:"encryptedCredential,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for SybaseLinkedServiceTypeProperties struct. +func (slstp *SybaseLinkedServiceTypeProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "server": + if v != nil { + var server interface{} + err = json.Unmarshal(*v, &server) + if err != nil { + return err + } + slstp.Server = server + } + case "database": + if v != nil { + var databaseVar interface{} + err = json.Unmarshal(*v, &databaseVar) + if err != nil { + return err + } + slstp.Database = databaseVar + } + case "schema": + if v != nil { + var schema interface{} + err = json.Unmarshal(*v, &schema) + if err != nil { + return err + } + slstp.Schema = schema + } + case "authenticationType": + if v != nil { + var authenticationType SybaseAuthenticationType + err = json.Unmarshal(*v, &authenticationType) + if err != nil { + return err + } + slstp.AuthenticationType = authenticationType + } + case "username": + if v != nil { + var username interface{} + err = json.Unmarshal(*v, &username) + if err != nil { + return err + } + slstp.Username = username + } + case "password": + if v != nil { + password, err := unmarshalBasicSecretBase(*v) + if err != nil { + return err + } + slstp.Password = password + } + case "encryptedCredential": + if v != nil { + var encryptedCredential interface{} + err = json.Unmarshal(*v, &encryptedCredential) + if err != nil { + return err + } + slstp.EncryptedCredential = encryptedCredential + } + } + } + + return nil +} + +// TabularTranslator a copy activity tabular translator. +type TabularTranslator struct { + // ColumnMappings - Column mappings. Example: "UserId: MyUserId, Group: MyGroup, Name: MyName" Type: string (or Expression with resultType string). + ColumnMappings interface{} `json:"columnMappings,omitempty"` + // SchemaMapping - The schema mapping to map between tabular data and hierarchical data. Example: {"Column1": "$.Column1", "Column2": "$.Column2.Property1", "Column3": "$.Column2.Property2"}. Type: object (or Expression with resultType object). + SchemaMapping interface{} `json:"schemaMapping,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Type - Possible values include: 'TypeCopyTranslator', 'TypeTabularTranslator' + Type TypeBasicCopyTranslator `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for TabularTranslator. +func (tt TabularTranslator) MarshalJSON() ([]byte, error) { + tt.Type = TypeTabularTranslator + objectMap := make(map[string]interface{}) + objectMap["columnMappings"] = tt.ColumnMappings + objectMap["schemaMapping"] = tt.SchemaMapping + if tt.Type != "" { + objectMap["type"] = tt.Type + } + for k, v := range tt.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsTabularTranslator is the BasicCopyTranslator implementation for TabularTranslator. +func (tt TabularTranslator) AsTabularTranslator() (*TabularTranslator, bool) { + return &tt, true +} + +// AsCopyTranslator is the BasicCopyTranslator implementation for TabularTranslator. +func (tt TabularTranslator) AsCopyTranslator() (*CopyTranslator, bool) { + return nil, false +} + +// AsBasicCopyTranslator is the BasicCopyTranslator implementation for TabularTranslator. +func (tt TabularTranslator) AsBasicCopyTranslator() (BasicCopyTranslator, bool) { + return &tt, true +} + +// TeradataLinkedService linked service for Teradata data source. +type TeradataLinkedService struct { + // TeradataLinkedServiceTypeProperties - Teradata linked service properties. + *TeradataLinkedServiceTypeProperties `json:"typeProperties,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // ConnectVia - The integration runtime reference. + ConnectVia *IntegrationRuntimeReference `json:"connectVia,omitempty"` + // Description - Linked service description. + Description *string `json:"description,omitempty"` + // Parameters - Parameters for linked service. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeLinkedService', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforce', 'TypeAzureDataLakeStore', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureStorage' + Type TypeBasicLinkedService `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for TeradataLinkedService. +func (TLSVar TeradataLinkedService) MarshalJSON() ([]byte, error) { + TLSVar.Type = TypeTeradata + objectMap := make(map[string]interface{}) + if TLSVar.TeradataLinkedServiceTypeProperties != nil { + objectMap["typeProperties"] = TLSVar.TeradataLinkedServiceTypeProperties + } + if TLSVar.ConnectVia != nil { + objectMap["connectVia"] = TLSVar.ConnectVia + } + if TLSVar.Description != nil { + objectMap["description"] = TLSVar.Description + } + if TLSVar.Parameters != nil { + objectMap["parameters"] = TLSVar.Parameters + } + if TLSVar.Annotations != nil { + objectMap["annotations"] = TLSVar.Annotations + } + if TLSVar.Type != "" { + objectMap["type"] = TLSVar.Type + } + for k, v := range TLSVar.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysLinkedService is the BasicLinkedService implementation for TeradataLinkedService. +func (TLSVar TeradataLinkedService) AsResponsysLinkedService() (*ResponsysLinkedService, bool) { + return nil, false +} + +// AsAzureDatabricksLinkedService is the BasicLinkedService implementation for TeradataLinkedService. +func (TLSVar TeradataLinkedService) AsAzureDatabricksLinkedService() (*AzureDatabricksLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeAnalyticsLinkedService is the BasicLinkedService implementation for TeradataLinkedService. +func (TLSVar TeradataLinkedService) AsAzureDataLakeAnalyticsLinkedService() (*AzureDataLakeAnalyticsLinkedService, bool) { + return nil, false +} + +// AsHDInsightOnDemandLinkedService is the BasicLinkedService implementation for TeradataLinkedService. +func (TLSVar TeradataLinkedService) AsHDInsightOnDemandLinkedService() (*HDInsightOnDemandLinkedService, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudLinkedService is the BasicLinkedService implementation for TeradataLinkedService. +func (TLSVar TeradataLinkedService) AsSalesforceMarketingCloudLinkedService() (*SalesforceMarketingCloudLinkedService, bool) { + return nil, false +} + +// AsNetezzaLinkedService is the BasicLinkedService implementation for TeradataLinkedService. +func (TLSVar TeradataLinkedService) AsNetezzaLinkedService() (*NetezzaLinkedService, bool) { + return nil, false +} + +// AsVerticaLinkedService is the BasicLinkedService implementation for TeradataLinkedService. +func (TLSVar TeradataLinkedService) AsVerticaLinkedService() (*VerticaLinkedService, bool) { + return nil, false +} + +// AsZohoLinkedService is the BasicLinkedService implementation for TeradataLinkedService. +func (TLSVar TeradataLinkedService) AsZohoLinkedService() (*ZohoLinkedService, bool) { + return nil, false +} + +// AsXeroLinkedService is the BasicLinkedService implementation for TeradataLinkedService. +func (TLSVar TeradataLinkedService) AsXeroLinkedService() (*XeroLinkedService, bool) { + return nil, false +} + +// AsSquareLinkedService is the BasicLinkedService implementation for TeradataLinkedService. +func (TLSVar TeradataLinkedService) AsSquareLinkedService() (*SquareLinkedService, bool) { + return nil, false +} + +// AsSparkLinkedService is the BasicLinkedService implementation for TeradataLinkedService. +func (TLSVar TeradataLinkedService) AsSparkLinkedService() (*SparkLinkedService, bool) { + return nil, false +} + +// AsShopifyLinkedService is the BasicLinkedService implementation for TeradataLinkedService. +func (TLSVar TeradataLinkedService) AsShopifyLinkedService() (*ShopifyLinkedService, bool) { + return nil, false +} + +// AsServiceNowLinkedService is the BasicLinkedService implementation for TeradataLinkedService. +func (TLSVar TeradataLinkedService) AsServiceNowLinkedService() (*ServiceNowLinkedService, bool) { + return nil, false +} + +// AsQuickBooksLinkedService is the BasicLinkedService implementation for TeradataLinkedService. +func (TLSVar TeradataLinkedService) AsQuickBooksLinkedService() (*QuickBooksLinkedService, bool) { + return nil, false +} + +// AsPrestoLinkedService is the BasicLinkedService implementation for TeradataLinkedService. +func (TLSVar TeradataLinkedService) AsPrestoLinkedService() (*PrestoLinkedService, bool) { + return nil, false +} + +// AsPhoenixLinkedService is the BasicLinkedService implementation for TeradataLinkedService. +func (TLSVar TeradataLinkedService) AsPhoenixLinkedService() (*PhoenixLinkedService, bool) { + return nil, false +} + +// AsPaypalLinkedService is the BasicLinkedService implementation for TeradataLinkedService. +func (TLSVar TeradataLinkedService) AsPaypalLinkedService() (*PaypalLinkedService, bool) { + return nil, false +} + +// AsMarketoLinkedService is the BasicLinkedService implementation for TeradataLinkedService. +func (TLSVar TeradataLinkedService) AsMarketoLinkedService() (*MarketoLinkedService, bool) { + return nil, false +} + +// AsMariaDBLinkedService is the BasicLinkedService implementation for TeradataLinkedService. +func (TLSVar TeradataLinkedService) AsMariaDBLinkedService() (*MariaDBLinkedService, bool) { + return nil, false +} + +// AsMagentoLinkedService is the BasicLinkedService implementation for TeradataLinkedService. +func (TLSVar TeradataLinkedService) AsMagentoLinkedService() (*MagentoLinkedService, bool) { + return nil, false +} + +// AsJiraLinkedService is the BasicLinkedService implementation for TeradataLinkedService. +func (TLSVar TeradataLinkedService) AsJiraLinkedService() (*JiraLinkedService, bool) { + return nil, false +} + +// AsImpalaLinkedService is the BasicLinkedService implementation for TeradataLinkedService. +func (TLSVar TeradataLinkedService) AsImpalaLinkedService() (*ImpalaLinkedService, bool) { + return nil, false +} + +// AsHubspotLinkedService is the BasicLinkedService implementation for TeradataLinkedService. +func (TLSVar TeradataLinkedService) AsHubspotLinkedService() (*HubspotLinkedService, bool) { + return nil, false +} + +// AsHiveLinkedService is the BasicLinkedService implementation for TeradataLinkedService. +func (TLSVar TeradataLinkedService) AsHiveLinkedService() (*HiveLinkedService, bool) { + return nil, false +} + +// AsHBaseLinkedService is the BasicLinkedService implementation for TeradataLinkedService. +func (TLSVar TeradataLinkedService) AsHBaseLinkedService() (*HBaseLinkedService, bool) { + return nil, false +} + +// AsGreenplumLinkedService is the BasicLinkedService implementation for TeradataLinkedService. +func (TLSVar TeradataLinkedService) AsGreenplumLinkedService() (*GreenplumLinkedService, bool) { + return nil, false +} + +// AsGoogleBigQueryLinkedService is the BasicLinkedService implementation for TeradataLinkedService. +func (TLSVar TeradataLinkedService) AsGoogleBigQueryLinkedService() (*GoogleBigQueryLinkedService, bool) { + return nil, false +} + +// AsEloquaLinkedService is the BasicLinkedService implementation for TeradataLinkedService. +func (TLSVar TeradataLinkedService) AsEloquaLinkedService() (*EloquaLinkedService, bool) { + return nil, false +} + +// AsDrillLinkedService is the BasicLinkedService implementation for TeradataLinkedService. +func (TLSVar TeradataLinkedService) AsDrillLinkedService() (*DrillLinkedService, bool) { + return nil, false +} + +// AsCouchbaseLinkedService is the BasicLinkedService implementation for TeradataLinkedService. +func (TLSVar TeradataLinkedService) AsCouchbaseLinkedService() (*CouchbaseLinkedService, bool) { + return nil, false +} + +// AsConcurLinkedService is the BasicLinkedService implementation for TeradataLinkedService. +func (TLSVar TeradataLinkedService) AsConcurLinkedService() (*ConcurLinkedService, bool) { + return nil, false +} + +// AsAzurePostgreSQLLinkedService is the BasicLinkedService implementation for TeradataLinkedService. +func (TLSVar TeradataLinkedService) AsAzurePostgreSQLLinkedService() (*AzurePostgreSQLLinkedService, bool) { + return nil, false +} + +// AsAmazonMWSLinkedService is the BasicLinkedService implementation for TeradataLinkedService. +func (TLSVar TeradataLinkedService) AsAmazonMWSLinkedService() (*AmazonMWSLinkedService, bool) { + return nil, false +} + +// AsSapHanaLinkedService is the BasicLinkedService implementation for TeradataLinkedService. +func (TLSVar TeradataLinkedService) AsSapHanaLinkedService() (*SapHanaLinkedService, bool) { + return nil, false +} + +// AsSapBWLinkedService is the BasicLinkedService implementation for TeradataLinkedService. +func (TLSVar TeradataLinkedService) AsSapBWLinkedService() (*SapBWLinkedService, bool) { + return nil, false +} + +// AsSftpServerLinkedService is the BasicLinkedService implementation for TeradataLinkedService. +func (TLSVar TeradataLinkedService) AsSftpServerLinkedService() (*SftpServerLinkedService, bool) { + return nil, false +} + +// AsFtpServerLinkedService is the BasicLinkedService implementation for TeradataLinkedService. +func (TLSVar TeradataLinkedService) AsFtpServerLinkedService() (*FtpServerLinkedService, bool) { + return nil, false +} + +// AsHTTPLinkedService is the BasicLinkedService implementation for TeradataLinkedService. +func (TLSVar TeradataLinkedService) AsHTTPLinkedService() (*HTTPLinkedService, bool) { + return nil, false +} + +// AsAzureSearchLinkedService is the BasicLinkedService implementation for TeradataLinkedService. +func (TLSVar TeradataLinkedService) AsAzureSearchLinkedService() (*AzureSearchLinkedService, bool) { + return nil, false +} + +// AsCustomDataSourceLinkedService is the BasicLinkedService implementation for TeradataLinkedService. +func (TLSVar TeradataLinkedService) AsCustomDataSourceLinkedService() (*CustomDataSourceLinkedService, bool) { + return nil, false +} + +// AsAmazonRedshiftLinkedService is the BasicLinkedService implementation for TeradataLinkedService. +func (TLSVar TeradataLinkedService) AsAmazonRedshiftLinkedService() (*AmazonRedshiftLinkedService, bool) { + return nil, false +} + +// AsAmazonS3LinkedService is the BasicLinkedService implementation for TeradataLinkedService. +func (TLSVar TeradataLinkedService) AsAmazonS3LinkedService() (*AmazonS3LinkedService, bool) { + return nil, false +} + +// AsSapEccLinkedService is the BasicLinkedService implementation for TeradataLinkedService. +func (TLSVar TeradataLinkedService) AsSapEccLinkedService() (*SapEccLinkedService, bool) { + return nil, false +} + +// AsSapCloudForCustomerLinkedService is the BasicLinkedService implementation for TeradataLinkedService. +func (TLSVar TeradataLinkedService) AsSapCloudForCustomerLinkedService() (*SapCloudForCustomerLinkedService, bool) { + return nil, false +} + +// AsSalesforceLinkedService is the BasicLinkedService implementation for TeradataLinkedService. +func (TLSVar TeradataLinkedService) AsSalesforceLinkedService() (*SalesforceLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeStoreLinkedService is the BasicLinkedService implementation for TeradataLinkedService. +func (TLSVar TeradataLinkedService) AsAzureDataLakeStoreLinkedService() (*AzureDataLakeStoreLinkedService, bool) { + return nil, false +} + +// AsMongoDbLinkedService is the BasicLinkedService implementation for TeradataLinkedService. +func (TLSVar TeradataLinkedService) AsMongoDbLinkedService() (*MongoDbLinkedService, bool) { + return nil, false +} + +// AsCassandraLinkedService is the BasicLinkedService implementation for TeradataLinkedService. +func (TLSVar TeradataLinkedService) AsCassandraLinkedService() (*CassandraLinkedService, bool) { + return nil, false +} + +// AsWebLinkedService is the BasicLinkedService implementation for TeradataLinkedService. +func (TLSVar TeradataLinkedService) AsWebLinkedService() (*WebLinkedService, bool) { + return nil, false +} + +// AsODataLinkedService is the BasicLinkedService implementation for TeradataLinkedService. +func (TLSVar TeradataLinkedService) AsODataLinkedService() (*ODataLinkedService, bool) { + return nil, false +} + +// AsHdfsLinkedService is the BasicLinkedService implementation for TeradataLinkedService. +func (TLSVar TeradataLinkedService) AsHdfsLinkedService() (*HdfsLinkedService, bool) { + return nil, false +} + +// AsOdbcLinkedService is the BasicLinkedService implementation for TeradataLinkedService. +func (TLSVar TeradataLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, bool) { + return nil, false +} + +// AsAzureMLLinkedService is the BasicLinkedService implementation for TeradataLinkedService. +func (TLSVar TeradataLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { + return nil, false +} + +// AsTeradataLinkedService is the BasicLinkedService implementation for TeradataLinkedService. +func (TLSVar TeradataLinkedService) AsTeradataLinkedService() (*TeradataLinkedService, bool) { + return &TLSVar, true +} + +// AsDb2LinkedService is the BasicLinkedService implementation for TeradataLinkedService. +func (TLSVar TeradataLinkedService) AsDb2LinkedService() (*Db2LinkedService, bool) { + return nil, false +} + +// AsSybaseLinkedService is the BasicLinkedService implementation for TeradataLinkedService. +func (TLSVar TeradataLinkedService) AsSybaseLinkedService() (*SybaseLinkedService, bool) { + return nil, false +} + +// AsPostgreSQLLinkedService is the BasicLinkedService implementation for TeradataLinkedService. +func (TLSVar TeradataLinkedService) AsPostgreSQLLinkedService() (*PostgreSQLLinkedService, bool) { + return nil, false +} + +// AsMySQLLinkedService is the BasicLinkedService implementation for TeradataLinkedService. +func (TLSVar TeradataLinkedService) AsMySQLLinkedService() (*MySQLLinkedService, bool) { + return nil, false +} + +// AsAzureMySQLLinkedService is the BasicLinkedService implementation for TeradataLinkedService. +func (TLSVar TeradataLinkedService) AsAzureMySQLLinkedService() (*AzureMySQLLinkedService, bool) { + return nil, false +} + +// AsOracleLinkedService is the BasicLinkedService implementation for TeradataLinkedService. +func (TLSVar TeradataLinkedService) AsOracleLinkedService() (*OracleLinkedService, bool) { + return nil, false +} + +// AsFileServerLinkedService is the BasicLinkedService implementation for TeradataLinkedService. +func (TLSVar TeradataLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { + return nil, false +} + +// AsHDInsightLinkedService is the BasicLinkedService implementation for TeradataLinkedService. +func (TLSVar TeradataLinkedService) AsHDInsightLinkedService() (*HDInsightLinkedService, bool) { + return nil, false +} + +// AsDynamicsLinkedService is the BasicLinkedService implementation for TeradataLinkedService. +func (TLSVar TeradataLinkedService) AsDynamicsLinkedService() (*DynamicsLinkedService, bool) { + return nil, false +} + +// AsCosmosDbLinkedService is the BasicLinkedService implementation for TeradataLinkedService. +func (TLSVar TeradataLinkedService) AsCosmosDbLinkedService() (*CosmosDbLinkedService, bool) { + return nil, false +} + +// AsAzureKeyVaultLinkedService is the BasicLinkedService implementation for TeradataLinkedService. +func (TLSVar TeradataLinkedService) AsAzureKeyVaultLinkedService() (*AzureKeyVaultLinkedService, bool) { + return nil, false +} + +// AsAzureBatchLinkedService is the BasicLinkedService implementation for TeradataLinkedService. +func (TLSVar TeradataLinkedService) AsAzureBatchLinkedService() (*AzureBatchLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDatabaseLinkedService is the BasicLinkedService implementation for TeradataLinkedService. +func (TLSVar TeradataLinkedService) AsAzureSQLDatabaseLinkedService() (*AzureSQLDatabaseLinkedService, bool) { + return nil, false +} + +// AsSQLServerLinkedService is the BasicLinkedService implementation for TeradataLinkedService. +func (TLSVar TeradataLinkedService) AsSQLServerLinkedService() (*SQLServerLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDWLinkedService is the BasicLinkedService implementation for TeradataLinkedService. +func (TLSVar TeradataLinkedService) AsAzureSQLDWLinkedService() (*AzureSQLDWLinkedService, bool) { + return nil, false +} + +// AsAzureStorageLinkedService is the BasicLinkedService implementation for TeradataLinkedService. +func (TLSVar TeradataLinkedService) AsAzureStorageLinkedService() (*AzureStorageLinkedService, bool) { + return nil, false +} + +// AsLinkedService is the BasicLinkedService implementation for TeradataLinkedService. +func (TLSVar TeradataLinkedService) AsLinkedService() (*LinkedService, bool) { + return nil, false +} + +// AsBasicLinkedService is the BasicLinkedService implementation for TeradataLinkedService. +func (TLSVar TeradataLinkedService) AsBasicLinkedService() (BasicLinkedService, bool) { + return &TLSVar, true +} + +// UnmarshalJSON is the custom unmarshaler for TeradataLinkedService struct. +func (TLSVar *TeradataLinkedService) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "typeProperties": + if v != nil { + var teradataLinkedServiceTypeProperties TeradataLinkedServiceTypeProperties + err = json.Unmarshal(*v, &teradataLinkedServiceTypeProperties) + if err != nil { + return err + } + TLSVar.TeradataLinkedServiceTypeProperties = &teradataLinkedServiceTypeProperties + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if TLSVar.AdditionalProperties == nil { + TLSVar.AdditionalProperties = make(map[string]interface{}) + } + TLSVar.AdditionalProperties[k] = additionalProperties + } + case "connectVia": + if v != nil { + var connectVia IntegrationRuntimeReference + err = json.Unmarshal(*v, &connectVia) + if err != nil { + return err + } + TLSVar.ConnectVia = &connectVia + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + TLSVar.Description = &description + } + case "parameters": + if v != nil { + var parameters map[string]*ParameterSpecification + err = json.Unmarshal(*v, ¶meters) + if err != nil { + return err + } + TLSVar.Parameters = parameters + } + case "annotations": + if v != nil { + var annotations []interface{} + err = json.Unmarshal(*v, &annotations) + if err != nil { + return err + } + TLSVar.Annotations = &annotations + } + case "type": + if v != nil { + var typeVar TypeBasicLinkedService + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + TLSVar.Type = typeVar + } + } + } + + return nil +} + +// TeradataLinkedServiceTypeProperties teradata linked service properties. +type TeradataLinkedServiceTypeProperties struct { + // Server - Server name for connection. Type: string (or Expression with resultType string). + Server interface{} `json:"server,omitempty"` + // AuthenticationType - AuthenticationType to be used for connection. Possible values include: 'TeradataAuthenticationTypeBasic', 'TeradataAuthenticationTypeWindows' + AuthenticationType TeradataAuthenticationType `json:"authenticationType,omitempty"` + // Username - Username for authentication. Type: string (or Expression with resultType string). + Username interface{} `json:"username,omitempty"` + // Password - Password for authentication. + Password BasicSecretBase `json:"password,omitempty"` + // EncryptedCredential - The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string). + EncryptedCredential interface{} `json:"encryptedCredential,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for TeradataLinkedServiceTypeProperties struct. +func (tlstp *TeradataLinkedServiceTypeProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "server": + if v != nil { + var server interface{} + err = json.Unmarshal(*v, &server) + if err != nil { + return err + } + tlstp.Server = server + } + case "authenticationType": + if v != nil { + var authenticationType TeradataAuthenticationType + err = json.Unmarshal(*v, &authenticationType) + if err != nil { + return err + } + tlstp.AuthenticationType = authenticationType + } + case "username": + if v != nil { + var username interface{} + err = json.Unmarshal(*v, &username) + if err != nil { + return err + } + tlstp.Username = username + } + case "password": + if v != nil { + password, err := unmarshalBasicSecretBase(*v) + if err != nil { + return err + } + tlstp.Password = password + } + case "encryptedCredential": + if v != nil { + var encryptedCredential interface{} + err = json.Unmarshal(*v, &encryptedCredential) + if err != nil { + return err + } + tlstp.EncryptedCredential = encryptedCredential + } + } + } + + return nil +} + +// TextFormat the data stored in text format. +type TextFormat struct { + // ColumnDelimiter - The column delimiter. Type: string (or Expression with resultType string). + ColumnDelimiter interface{} `json:"columnDelimiter,omitempty"` + // RowDelimiter - The row delimiter. Type: string (or Expression with resultType string). + RowDelimiter interface{} `json:"rowDelimiter,omitempty"` + // EscapeChar - The escape character. Type: string (or Expression with resultType string). + EscapeChar interface{} `json:"escapeChar,omitempty"` + // QuoteChar - The quote character. Type: string (or Expression with resultType string). + QuoteChar interface{} `json:"quoteChar,omitempty"` + // NullValue - The null value string. Type: string (or Expression with resultType string). + NullValue interface{} `json:"nullValue,omitempty"` + // EncodingName - The code page name of the preferred encoding. If miss, the default value is ΓÇ£utf-8ΓÇ¥, unless BOM denotes another Unicode encoding. Refer to the ΓÇ£NameΓÇ¥ column of the table in the following link to set supported values: https://msdn.microsoft.com/library/system.text.encoding.aspx. Type: string (or Expression with resultType string). + EncodingName interface{} `json:"encodingName,omitempty"` + // TreatEmptyAsNull - Treat empty column values in the text file as null. The default value is true. Type: boolean (or Expression with resultType boolean). + TreatEmptyAsNull interface{} `json:"treatEmptyAsNull,omitempty"` + // SkipLineCount - The number of lines/rows to be skipped when parsing text files. The default value is 0. Type: integer (or Expression with resultType integer). + SkipLineCount interface{} `json:"skipLineCount,omitempty"` + // FirstRowAsHeader - When used as input, treat the first row of data as headers. When used as output,write the headers into the output as the first row of data. The default value is false. Type: boolean (or Expression with resultType boolean). + FirstRowAsHeader interface{} `json:"firstRowAsHeader,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Serializer - Serializer. Type: string (or Expression with resultType string). + Serializer interface{} `json:"serializer,omitempty"` + // Deserializer - Deserializer. Type: string (or Expression with resultType string). + Deserializer interface{} `json:"deserializer,omitempty"` + // Type - Possible values include: 'TypeDatasetStorageFormat', 'TypeParquetFormat', 'TypeOrcFormat', 'TypeAvroFormat', 'TypeJSONFormat', 'TypeTextFormat' + Type TypeBasicDatasetStorageFormat `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for TextFormat. +func (tf TextFormat) MarshalJSON() ([]byte, error) { + tf.Type = TypeTextFormat + objectMap := make(map[string]interface{}) + objectMap["columnDelimiter"] = tf.ColumnDelimiter + objectMap["rowDelimiter"] = tf.RowDelimiter + objectMap["escapeChar"] = tf.EscapeChar + objectMap["quoteChar"] = tf.QuoteChar + objectMap["nullValue"] = tf.NullValue + objectMap["encodingName"] = tf.EncodingName + objectMap["treatEmptyAsNull"] = tf.TreatEmptyAsNull + objectMap["skipLineCount"] = tf.SkipLineCount + objectMap["firstRowAsHeader"] = tf.FirstRowAsHeader + objectMap["serializer"] = tf.Serializer + objectMap["deserializer"] = tf.Deserializer + if tf.Type != "" { + objectMap["type"] = tf.Type + } + for k, v := range tf.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsParquetFormat is the BasicDatasetStorageFormat implementation for TextFormat. +func (tf TextFormat) AsParquetFormat() (*ParquetFormat, bool) { + return nil, false +} + +// AsOrcFormat is the BasicDatasetStorageFormat implementation for TextFormat. +func (tf TextFormat) AsOrcFormat() (*OrcFormat, bool) { + return nil, false +} + +// AsAvroFormat is the BasicDatasetStorageFormat implementation for TextFormat. +func (tf TextFormat) AsAvroFormat() (*AvroFormat, bool) { + return nil, false +} + +// AsJSONFormat is the BasicDatasetStorageFormat implementation for TextFormat. +func (tf TextFormat) AsJSONFormat() (*JSONFormat, bool) { + return nil, false +} + +// AsTextFormat is the BasicDatasetStorageFormat implementation for TextFormat. +func (tf TextFormat) AsTextFormat() (*TextFormat, bool) { + return &tf, true +} + +// AsDatasetStorageFormat is the BasicDatasetStorageFormat implementation for TextFormat. +func (tf TextFormat) AsDatasetStorageFormat() (*DatasetStorageFormat, bool) { + return nil, false +} + +// AsBasicDatasetStorageFormat is the BasicDatasetStorageFormat implementation for TextFormat. +func (tf TextFormat) AsBasicDatasetStorageFormat() (BasicDatasetStorageFormat, bool) { + return &tf, true +} + +// BasicTrigger azure data factory nested object which contains information about creating pipeline run +type BasicTrigger interface { + AsTumblingWindowTrigger() (*TumblingWindowTrigger, bool) + AsBlobEventsTrigger() (*BlobEventsTrigger, bool) + AsBlobTrigger() (*BlobTrigger, bool) + AsScheduleTrigger() (*ScheduleTrigger, bool) + AsMultiplePipelineTrigger() (*MultiplePipelineTrigger, bool) + AsBasicMultiplePipelineTrigger() (BasicMultiplePipelineTrigger, bool) + AsTrigger() (*Trigger, bool) +} + +// Trigger azure data factory nested object which contains information about creating pipeline run +type Trigger struct { + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Description - Trigger description. + Description *string `json:"description,omitempty"` + // RuntimeState - Indicates if trigger is running or not. Updated when Start/Stop APIs are called on the Trigger. Possible values include: 'TriggerRuntimeStateStarted', 'TriggerRuntimeStateStopped', 'TriggerRuntimeStateDisabled' + RuntimeState TriggerRuntimeState `json:"runtimeState,omitempty"` + // Type - Possible values include: 'TypeTrigger', 'TypeTumblingWindowTrigger', 'TypeBlobEventsTrigger', 'TypeBlobTrigger', 'TypeScheduleTrigger', 'TypeMultiplePipelineTrigger' + Type TypeBasicTrigger `json:"type,omitempty"` +} + +func unmarshalBasicTrigger(body []byte) (BasicTrigger, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["type"] { + case string(TypeTumblingWindowTrigger): + var twt TumblingWindowTrigger + err := json.Unmarshal(body, &twt) + return twt, err + case string(TypeBlobEventsTrigger): + var bet BlobEventsTrigger + err := json.Unmarshal(body, &bet) + return bet, err + case string(TypeBlobTrigger): + var bt BlobTrigger + err := json.Unmarshal(body, &bt) + return bt, err + case string(TypeScheduleTrigger): + var st ScheduleTrigger + err := json.Unmarshal(body, &st) + return st, err + case string(TypeMultiplePipelineTrigger): + var mpt MultiplePipelineTrigger + err := json.Unmarshal(body, &mpt) + return mpt, err + default: + var t Trigger + err := json.Unmarshal(body, &t) + return t, err + } +} +func unmarshalBasicTriggerArray(body []byte) ([]BasicTrigger, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + tArray := make([]BasicTrigger, len(rawMessages)) + + for index, rawMessage := range rawMessages { + t, err := unmarshalBasicTrigger(*rawMessage) + if err != nil { + return nil, err + } + tArray[index] = t + } + return tArray, nil +} + +// MarshalJSON is the custom marshaler for Trigger. +func (t Trigger) MarshalJSON() ([]byte, error) { + t.Type = TypeTrigger + objectMap := make(map[string]interface{}) + if t.Description != nil { + objectMap["description"] = t.Description + } + if t.RuntimeState != "" { + objectMap["runtimeState"] = t.RuntimeState + } + if t.Type != "" { + objectMap["type"] = t.Type + } + for k, v := range t.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsTumblingWindowTrigger is the BasicTrigger implementation for Trigger. +func (t Trigger) AsTumblingWindowTrigger() (*TumblingWindowTrigger, bool) { + return nil, false +} + +// AsBlobEventsTrigger is the BasicTrigger implementation for Trigger. +func (t Trigger) AsBlobEventsTrigger() (*BlobEventsTrigger, bool) { + return nil, false +} + +// AsBlobTrigger is the BasicTrigger implementation for Trigger. +func (t Trigger) AsBlobTrigger() (*BlobTrigger, bool) { + return nil, false +} + +// AsScheduleTrigger is the BasicTrigger implementation for Trigger. +func (t Trigger) AsScheduleTrigger() (*ScheduleTrigger, bool) { + return nil, false +} + +// AsMultiplePipelineTrigger is the BasicTrigger implementation for Trigger. +func (t Trigger) AsMultiplePipelineTrigger() (*MultiplePipelineTrigger, bool) { + return nil, false +} + +// AsBasicMultiplePipelineTrigger is the BasicTrigger implementation for Trigger. +func (t Trigger) AsBasicMultiplePipelineTrigger() (BasicMultiplePipelineTrigger, bool) { + return nil, false +} + +// AsTrigger is the BasicTrigger implementation for Trigger. +func (t Trigger) AsTrigger() (*Trigger, bool) { + return &t, true +} + +// AsBasicTrigger is the BasicTrigger implementation for Trigger. +func (t Trigger) AsBasicTrigger() (BasicTrigger, bool) { + return &t, true +} + +// TriggerListResponse a list of trigger resources. +type TriggerListResponse struct { + autorest.Response `json:"-"` + // Value - List of triggers. + Value *[]TriggerResource `json:"value,omitempty"` + // NextLink - The link to the next page of results, if any remaining results exist. + NextLink *string `json:"nextLink,omitempty"` +} + +// TriggerListResponseIterator provides access to a complete listing of TriggerResource values. +type TriggerListResponseIterator struct { + i int + page TriggerListResponsePage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *TriggerListResponseIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter TriggerListResponseIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter TriggerListResponseIterator) Response() TriggerListResponse { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter TriggerListResponseIterator) Value() TriggerResource { + if !iter.page.NotDone() { + return TriggerResource{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (tlr TriggerListResponse) IsEmpty() bool { + return tlr.Value == nil || len(*tlr.Value) == 0 +} + +// triggerListResponsePreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (tlr TriggerListResponse) triggerListResponsePreparer() (*http.Request, error) { + if tlr.NextLink == nil || len(to.String(tlr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(tlr.NextLink))) +} + +// TriggerListResponsePage contains a page of TriggerResource values. +type TriggerListResponsePage struct { + fn func(TriggerListResponse) (TriggerListResponse, error) + tlr TriggerListResponse +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *TriggerListResponsePage) Next() error { + next, err := page.fn(page.tlr) + if err != nil { + return err + } + page.tlr = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page TriggerListResponsePage) NotDone() bool { + return !page.tlr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page TriggerListResponsePage) Response() TriggerListResponse { + return page.tlr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page TriggerListResponsePage) Values() []TriggerResource { + if page.tlr.IsEmpty() { + return nil + } + return *page.tlr.Value +} + +// TriggerPipelineReference pipeline that needs to be triggered with the given parameters. +type TriggerPipelineReference struct { + // PipelineReference - Pipeline reference. + PipelineReference *PipelineReference `json:"pipelineReference,omitempty"` + // Parameters - Pipeline parameters. + Parameters map[string]interface{} `json:"parameters"` +} + +// MarshalJSON is the custom marshaler for TriggerPipelineReference. +func (tpr TriggerPipelineReference) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if tpr.PipelineReference != nil { + objectMap["pipelineReference"] = tpr.PipelineReference + } + if tpr.Parameters != nil { + objectMap["parameters"] = tpr.Parameters + } + return json.Marshal(objectMap) +} + +// TriggerResource trigger resource type. +type TriggerResource struct { + autorest.Response `json:"-"` + // Properties - Properties of the trigger. + Properties BasicTrigger `json:"properties,omitempty"` + // ID - The resource identifier. + ID *string `json:"id,omitempty"` + // Name - The resource name. + Name *string `json:"name,omitempty"` + // Type - The resource type. + Type *string `json:"type,omitempty"` + // Etag - Etag identifies change in the resource. + Etag *string `json:"etag,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for TriggerResource struct. +func (tr *TriggerResource) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + properties, err := unmarshalBasicTrigger(*v) + if err != nil { + return err + } + tr.Properties = properties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + tr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + tr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + tr.Type = &typeVar + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + tr.Etag = &etag + } + } + } + + return nil +} + +// TriggerRun trigger runs. +type TriggerRun struct { + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // TriggerRunID - Trigger run id. + TriggerRunID *string `json:"triggerRunId,omitempty"` + // TriggerName - Trigger name. + TriggerName *string `json:"triggerName,omitempty"` + // TriggerType - Trigger type. + TriggerType *string `json:"triggerType,omitempty"` + // TriggerRunTimestamp - Trigger run start time. + TriggerRunTimestamp *date.Time `json:"triggerRunTimestamp,omitempty"` + // Status - Trigger run status. Possible values include: 'TriggerRunStatusSucceeded', 'TriggerRunStatusFailed', 'TriggerRunStatusInprogress' + Status TriggerRunStatus `json:"status,omitempty"` + // Message - Trigger error message. + Message *string `json:"message,omitempty"` + // Properties - List of property name and value related to trigger run. Name, value pair depends on type of trigger. + Properties map[string]*string `json:"properties"` + // TriggeredPipelines - List of pipeline name and run Id triggered by the trigger run. + TriggeredPipelines map[string]*string `json:"triggeredPipelines"` +} + +// MarshalJSON is the custom marshaler for TriggerRun. +func (tr TriggerRun) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if tr.TriggerRunID != nil { + objectMap["triggerRunId"] = tr.TriggerRunID + } + if tr.TriggerName != nil { + objectMap["triggerName"] = tr.TriggerName + } + if tr.TriggerType != nil { + objectMap["triggerType"] = tr.TriggerType + } + if tr.TriggerRunTimestamp != nil { + objectMap["triggerRunTimestamp"] = tr.TriggerRunTimestamp + } + if tr.Status != "" { + objectMap["status"] = tr.Status + } + if tr.Message != nil { + objectMap["message"] = tr.Message + } + if tr.Properties != nil { + objectMap["properties"] = tr.Properties + } + if tr.TriggeredPipelines != nil { + objectMap["triggeredPipelines"] = tr.TriggeredPipelines + } + for k, v := range tr.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// TriggerRunsQueryResponse a list of trigger runs. +type TriggerRunsQueryResponse struct { + autorest.Response `json:"-"` + // Value - List of trigger runs. + Value *[]TriggerRun `json:"value,omitempty"` + // ContinuationToken - The continuation token for getting the next page of results, if any remaining results exist, null otherwise. + ContinuationToken *string `json:"continuationToken,omitempty"` +} + +// TriggersStartFuture an abstraction for monitoring and retrieving the results of a long-running operation. +type TriggersStartFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *TriggersStartFuture) Result(client TriggersClient) (ar autorest.Response, err error) { + var done bool + done, err = future.Done(client) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.TriggersStartFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("datafactory.TriggersStartFuture") + return + } + ar.Response = future.Response() + return +} + +// TriggersStopFuture an abstraction for monitoring and retrieving the results of a long-running operation. +type TriggersStopFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *TriggersStopFuture) Result(client TriggersClient) (ar autorest.Response, err error) { + var done bool + done, err = future.Done(client) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.TriggersStopFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("datafactory.TriggersStopFuture") + return + } + ar.Response = future.Response() + return +} + +// TumblingWindowTrigger trigger that schedules pipeline runs for all fixed time interval windows from a start time +// without gaps and also supports backfill scenarios (when start time is in the past). +type TumblingWindowTrigger struct { + // Pipeline - Pipeline for which runs are created when an event is fired for trigger window that is ready. + Pipeline *TriggerPipelineReference `json:"pipeline,omitempty"` + // TumblingWindowTriggerTypeProperties - Tumbling Window Trigger properties. + *TumblingWindowTriggerTypeProperties `json:"typeProperties,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Description - Trigger description. + Description *string `json:"description,omitempty"` + // RuntimeState - Indicates if trigger is running or not. Updated when Start/Stop APIs are called on the Trigger. Possible values include: 'TriggerRuntimeStateStarted', 'TriggerRuntimeStateStopped', 'TriggerRuntimeStateDisabled' + RuntimeState TriggerRuntimeState `json:"runtimeState,omitempty"` + // Type - Possible values include: 'TypeTrigger', 'TypeTumblingWindowTrigger', 'TypeBlobEventsTrigger', 'TypeBlobTrigger', 'TypeScheduleTrigger', 'TypeMultiplePipelineTrigger' + Type TypeBasicTrigger `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for TumblingWindowTrigger. +func (twt TumblingWindowTrigger) MarshalJSON() ([]byte, error) { + twt.Type = TypeTumblingWindowTrigger + objectMap := make(map[string]interface{}) + if twt.Pipeline != nil { + objectMap["pipeline"] = twt.Pipeline + } + if twt.TumblingWindowTriggerTypeProperties != nil { + objectMap["typeProperties"] = twt.TumblingWindowTriggerTypeProperties + } + if twt.Description != nil { + objectMap["description"] = twt.Description + } + if twt.RuntimeState != "" { + objectMap["runtimeState"] = twt.RuntimeState + } + if twt.Type != "" { + objectMap["type"] = twt.Type + } + for k, v := range twt.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsTumblingWindowTrigger is the BasicTrigger implementation for TumblingWindowTrigger. +func (twt TumblingWindowTrigger) AsTumblingWindowTrigger() (*TumblingWindowTrigger, bool) { + return &twt, true +} + +// AsBlobEventsTrigger is the BasicTrigger implementation for TumblingWindowTrigger. +func (twt TumblingWindowTrigger) AsBlobEventsTrigger() (*BlobEventsTrigger, bool) { + return nil, false +} + +// AsBlobTrigger is the BasicTrigger implementation for TumblingWindowTrigger. +func (twt TumblingWindowTrigger) AsBlobTrigger() (*BlobTrigger, bool) { + return nil, false +} + +// AsScheduleTrigger is the BasicTrigger implementation for TumblingWindowTrigger. +func (twt TumblingWindowTrigger) AsScheduleTrigger() (*ScheduleTrigger, bool) { + return nil, false +} + +// AsMultiplePipelineTrigger is the BasicTrigger implementation for TumblingWindowTrigger. +func (twt TumblingWindowTrigger) AsMultiplePipelineTrigger() (*MultiplePipelineTrigger, bool) { + return nil, false +} + +// AsBasicMultiplePipelineTrigger is the BasicTrigger implementation for TumblingWindowTrigger. +func (twt TumblingWindowTrigger) AsBasicMultiplePipelineTrigger() (BasicMultiplePipelineTrigger, bool) { + return nil, false +} + +// AsTrigger is the BasicTrigger implementation for TumblingWindowTrigger. +func (twt TumblingWindowTrigger) AsTrigger() (*Trigger, bool) { + return nil, false +} + +// AsBasicTrigger is the BasicTrigger implementation for TumblingWindowTrigger. +func (twt TumblingWindowTrigger) AsBasicTrigger() (BasicTrigger, bool) { + return &twt, true +} + +// UnmarshalJSON is the custom unmarshaler for TumblingWindowTrigger struct. +func (twt *TumblingWindowTrigger) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "pipeline": + if v != nil { + var pipeline TriggerPipelineReference + err = json.Unmarshal(*v, &pipeline) + if err != nil { + return err + } + twt.Pipeline = &pipeline + } + case "typeProperties": + if v != nil { + var tumblingWindowTriggerTypeProperties TumblingWindowTriggerTypeProperties + err = json.Unmarshal(*v, &tumblingWindowTriggerTypeProperties) + if err != nil { + return err + } + twt.TumblingWindowTriggerTypeProperties = &tumblingWindowTriggerTypeProperties + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if twt.AdditionalProperties == nil { + twt.AdditionalProperties = make(map[string]interface{}) + } + twt.AdditionalProperties[k] = additionalProperties + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + twt.Description = &description + } + case "runtimeState": + if v != nil { + var runtimeState TriggerRuntimeState + err = json.Unmarshal(*v, &runtimeState) + if err != nil { + return err + } + twt.RuntimeState = runtimeState + } + case "type": + if v != nil { + var typeVar TypeBasicTrigger + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + twt.Type = typeVar + } + } + } + + return nil +} + +// TumblingWindowTriggerTypeProperties tumbling Window Trigger properties. +type TumblingWindowTriggerTypeProperties struct { + // Frequency - The frequency of the time windows. Possible values include: 'TumblingWindowFrequencyMinute', 'TumblingWindowFrequencyHour' + Frequency TumblingWindowFrequency `json:"frequency,omitempty"` + // Interval - The interval of the time windows. The minimum interval allowed is 15 Minutes. + Interval *int32 `json:"interval,omitempty"` + // StartTime - The start time for the time period for the trigger during which events are fired for windows that are ready. Only UTC time is currently supported. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - The end time for the time period for the trigger during which events are fired for windows that are ready. Only UTC time is currently supported. + EndTime *date.Time `json:"endTime,omitempty"` + // Delay - Specifies how long the trigger waits past due time before triggering new run. It doesn't alter window start and end time. The default is 0. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + Delay interface{} `json:"delay,omitempty"` + // MaxConcurrency - The max number of parallel time windows (ready for execution) for which a new run is triggered. + MaxConcurrency *int32 `json:"maxConcurrency,omitempty"` + // RetryPolicy - Retry policy that will be applied for failed pipeline runs. + RetryPolicy *RetryPolicy `json:"retryPolicy,omitempty"` +} + +// UntilActivity this activity executes inner activities until the specified boolean expression results to true or +// timeout is reached, whichever is earlier. +type UntilActivity struct { + // UntilActivityTypeProperties - Until activity properties. + *UntilActivityTypeProperties `json:"typeProperties,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Name - Activity name. + Name *string `json:"name,omitempty"` + // Description - Activity description. + Description *string `json:"description,omitempty"` + // DependsOn - Activity depends on condition. + DependsOn *[]ActivityDependency `json:"dependsOn,omitempty"` + // UserProperties - Activity user properties. + UserProperties map[string]*string `json:"userProperties"` + // Type - Possible values include: 'TypeActivity', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLUpdateResource', 'TypeAzureMLBatchExecution', 'TypeGetMetadata', 'TypeWebActivity', 'TypeLookup', 'TypeSQLServerStoredProcedure', 'TypeCustom', 'TypeExecuteSSISPackage', 'TypeHDInsightSpark', 'TypeHDInsightStreaming', 'TypeHDInsightMapReduce', 'TypeHDInsightPig', 'TypeHDInsightHive', 'TypeCopy', 'TypeExecution', 'TypeFilter', 'TypeUntil', 'TypeWait', 'TypeForEach', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' + Type TypeBasicActivity `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for UntilActivity. +func (ua UntilActivity) MarshalJSON() ([]byte, error) { + ua.Type = TypeUntil + objectMap := make(map[string]interface{}) + if ua.UntilActivityTypeProperties != nil { + objectMap["typeProperties"] = ua.UntilActivityTypeProperties + } + if ua.Name != nil { + objectMap["name"] = ua.Name + } + if ua.Description != nil { + objectMap["description"] = ua.Description + } + if ua.DependsOn != nil { + objectMap["dependsOn"] = ua.DependsOn + } + if ua.UserProperties != nil { + objectMap["userProperties"] = ua.UserProperties + } + if ua.Type != "" { + objectMap["type"] = ua.Type + } + for k, v := range ua.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsDatabricksNotebookActivity is the BasicActivity implementation for UntilActivity. +func (ua UntilActivity) AsDatabricksNotebookActivity() (*DatabricksNotebookActivity, bool) { + return nil, false +} + +// AsDataLakeAnalyticsUSQLActivity is the BasicActivity implementation for UntilActivity. +func (ua UntilActivity) AsDataLakeAnalyticsUSQLActivity() (*DataLakeAnalyticsUSQLActivity, bool) { + return nil, false +} + +// AsAzureMLUpdateResourceActivity is the BasicActivity implementation for UntilActivity. +func (ua UntilActivity) AsAzureMLUpdateResourceActivity() (*AzureMLUpdateResourceActivity, bool) { + return nil, false +} + +// AsAzureMLBatchExecutionActivity is the BasicActivity implementation for UntilActivity. +func (ua UntilActivity) AsAzureMLBatchExecutionActivity() (*AzureMLBatchExecutionActivity, bool) { + return nil, false +} + +// AsGetMetadataActivity is the BasicActivity implementation for UntilActivity. +func (ua UntilActivity) AsGetMetadataActivity() (*GetMetadataActivity, bool) { + return nil, false +} + +// AsWebActivity is the BasicActivity implementation for UntilActivity. +func (ua UntilActivity) AsWebActivity() (*WebActivity, bool) { + return nil, false +} + +// AsLookupActivity is the BasicActivity implementation for UntilActivity. +func (ua UntilActivity) AsLookupActivity() (*LookupActivity, bool) { + return nil, false +} + +// AsSQLServerStoredProcedureActivity is the BasicActivity implementation for UntilActivity. +func (ua UntilActivity) AsSQLServerStoredProcedureActivity() (*SQLServerStoredProcedureActivity, bool) { + return nil, false +} + +// AsCustomActivity is the BasicActivity implementation for UntilActivity. +func (ua UntilActivity) AsCustomActivity() (*CustomActivity, bool) { + return nil, false +} + +// AsExecuteSSISPackageActivity is the BasicActivity implementation for UntilActivity. +func (ua UntilActivity) AsExecuteSSISPackageActivity() (*ExecuteSSISPackageActivity, bool) { + return nil, false +} + +// AsHDInsightSparkActivity is the BasicActivity implementation for UntilActivity. +func (ua UntilActivity) AsHDInsightSparkActivity() (*HDInsightSparkActivity, bool) { + return nil, false +} + +// AsHDInsightStreamingActivity is the BasicActivity implementation for UntilActivity. +func (ua UntilActivity) AsHDInsightStreamingActivity() (*HDInsightStreamingActivity, bool) { + return nil, false +} + +// AsHDInsightMapReduceActivity is the BasicActivity implementation for UntilActivity. +func (ua UntilActivity) AsHDInsightMapReduceActivity() (*HDInsightMapReduceActivity, bool) { + return nil, false +} + +// AsHDInsightPigActivity is the BasicActivity implementation for UntilActivity. +func (ua UntilActivity) AsHDInsightPigActivity() (*HDInsightPigActivity, bool) { + return nil, false +} + +// AsHDInsightHiveActivity is the BasicActivity implementation for UntilActivity. +func (ua UntilActivity) AsHDInsightHiveActivity() (*HDInsightHiveActivity, bool) { + return nil, false +} + +// AsCopyActivity is the BasicActivity implementation for UntilActivity. +func (ua UntilActivity) AsCopyActivity() (*CopyActivity, bool) { + return nil, false +} + +// AsExecutionActivity is the BasicActivity implementation for UntilActivity. +func (ua UntilActivity) AsExecutionActivity() (*ExecutionActivity, bool) { + return nil, false +} + +// AsBasicExecutionActivity is the BasicActivity implementation for UntilActivity. +func (ua UntilActivity) AsBasicExecutionActivity() (BasicExecutionActivity, bool) { + return nil, false +} + +// AsFilterActivity is the BasicActivity implementation for UntilActivity. +func (ua UntilActivity) AsFilterActivity() (*FilterActivity, bool) { + return nil, false +} + +// AsUntilActivity is the BasicActivity implementation for UntilActivity. +func (ua UntilActivity) AsUntilActivity() (*UntilActivity, bool) { + return &ua, true +} + +// AsWaitActivity is the BasicActivity implementation for UntilActivity. +func (ua UntilActivity) AsWaitActivity() (*WaitActivity, bool) { + return nil, false +} + +// AsForEachActivity is the BasicActivity implementation for UntilActivity. +func (ua UntilActivity) AsForEachActivity() (*ForEachActivity, bool) { + return nil, false +} + +// AsIfConditionActivity is the BasicActivity implementation for UntilActivity. +func (ua UntilActivity) AsIfConditionActivity() (*IfConditionActivity, bool) { + return nil, false +} + +// AsExecutePipelineActivity is the BasicActivity implementation for UntilActivity. +func (ua UntilActivity) AsExecutePipelineActivity() (*ExecutePipelineActivity, bool) { + return nil, false +} + +// AsControlActivity is the BasicActivity implementation for UntilActivity. +func (ua UntilActivity) AsControlActivity() (*ControlActivity, bool) { + return nil, false +} + +// AsBasicControlActivity is the BasicActivity implementation for UntilActivity. +func (ua UntilActivity) AsBasicControlActivity() (BasicControlActivity, bool) { + return &ua, true +} + +// AsActivity is the BasicActivity implementation for UntilActivity. +func (ua UntilActivity) AsActivity() (*Activity, bool) { + return nil, false +} + +// AsBasicActivity is the BasicActivity implementation for UntilActivity. +func (ua UntilActivity) AsBasicActivity() (BasicActivity, bool) { + return &ua, true +} + +// UnmarshalJSON is the custom unmarshaler for UntilActivity struct. +func (ua *UntilActivity) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "typeProperties": + if v != nil { + var untilActivityTypeProperties UntilActivityTypeProperties + err = json.Unmarshal(*v, &untilActivityTypeProperties) + if err != nil { + return err + } + ua.UntilActivityTypeProperties = &untilActivityTypeProperties + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if ua.AdditionalProperties == nil { + ua.AdditionalProperties = make(map[string]interface{}) + } + ua.AdditionalProperties[k] = additionalProperties + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ua.Name = &name + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + ua.Description = &description + } + case "dependsOn": + if v != nil { + var dependsOn []ActivityDependency + err = json.Unmarshal(*v, &dependsOn) + if err != nil { + return err + } + ua.DependsOn = &dependsOn + } + case "userProperties": + if v != nil { + var userProperties map[string]*string + err = json.Unmarshal(*v, &userProperties) + if err != nil { + return err + } + ua.UserProperties = userProperties + } + case "type": + if v != nil { + var typeVar TypeBasicActivity + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ua.Type = typeVar + } + } + } + + return nil +} + +// UntilActivityTypeProperties until activity properties. +type UntilActivityTypeProperties struct { + // Expression - An expression that would evaluate to Boolean. The loop will continue until this expression evaluates to true + Expression *Expression `json:"expression,omitempty"` + // Timeout - Specifies the timeout for the activity to run. If there is no value specified, it takes the value of TimeSpan.FromDays(7) which is 1 week as default. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + Timeout interface{} `json:"timeout,omitempty"` + // Activities - List of activities to execute. + Activities *[]BasicActivity `json:"activities,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for UntilActivityTypeProperties struct. +func (uatp *UntilActivityTypeProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "expression": + if v != nil { + var expression Expression + err = json.Unmarshal(*v, &expression) + if err != nil { + return err + } + uatp.Expression = &expression + } + case "timeout": + if v != nil { + var timeout interface{} + err = json.Unmarshal(*v, &timeout) + if err != nil { + return err + } + uatp.Timeout = timeout + } + case "activities": + if v != nil { + activities, err := unmarshalBasicActivityArray(*v) + if err != nil { + return err + } + uatp.Activities = &activities + } + } + } + + return nil +} + +// UpdateIntegrationRuntimeNodeRequest update integration runtime node request. +type UpdateIntegrationRuntimeNodeRequest struct { + // ConcurrentJobsLimit - The number of concurrent jobs permitted to run on the integration runtime node. Values between 1 and maxConcurrentJobs(inclusive) are allowed. + ConcurrentJobsLimit *int32 `json:"concurrentJobsLimit,omitempty"` +} + +// UpdateIntegrationRuntimeRequest update integration runtime request. +type UpdateIntegrationRuntimeRequest struct { + // AutoUpdate - Enables or disables the auto-update feature of the self-hosted integration runtime. See https://go.microsoft.com/fwlink/?linkid=854189. Possible values include: 'On', 'Off' + AutoUpdate IntegrationRuntimeAutoUpdate `json:"autoUpdate,omitempty"` + // UpdateDelayOffset - The time offset (in hours) in the day, e.g., PT03H is 3 hours. The integration runtime auto update will happen on that time. + UpdateDelayOffset *string `json:"updateDelayOffset,omitempty"` +} + +// VerticaLinkedService vertica linked service. +type VerticaLinkedService struct { + // VerticaLinkedServiceTypeProperties - Vertica linked service properties. + *VerticaLinkedServiceTypeProperties `json:"typeProperties,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // ConnectVia - The integration runtime reference. + ConnectVia *IntegrationRuntimeReference `json:"connectVia,omitempty"` + // Description - Linked service description. + Description *string `json:"description,omitempty"` + // Parameters - Parameters for linked service. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeLinkedService', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforce', 'TypeAzureDataLakeStore', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureStorage' + Type TypeBasicLinkedService `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for VerticaLinkedService. +func (vls VerticaLinkedService) MarshalJSON() ([]byte, error) { + vls.Type = TypeVertica + objectMap := make(map[string]interface{}) + if vls.VerticaLinkedServiceTypeProperties != nil { + objectMap["typeProperties"] = vls.VerticaLinkedServiceTypeProperties + } + if vls.ConnectVia != nil { + objectMap["connectVia"] = vls.ConnectVia + } + if vls.Description != nil { + objectMap["description"] = vls.Description + } + if vls.Parameters != nil { + objectMap["parameters"] = vls.Parameters + } + if vls.Annotations != nil { + objectMap["annotations"] = vls.Annotations + } + if vls.Type != "" { + objectMap["type"] = vls.Type + } + for k, v := range vls.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysLinkedService is the BasicLinkedService implementation for VerticaLinkedService. +func (vls VerticaLinkedService) AsResponsysLinkedService() (*ResponsysLinkedService, bool) { + return nil, false +} + +// AsAzureDatabricksLinkedService is the BasicLinkedService implementation for VerticaLinkedService. +func (vls VerticaLinkedService) AsAzureDatabricksLinkedService() (*AzureDatabricksLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeAnalyticsLinkedService is the BasicLinkedService implementation for VerticaLinkedService. +func (vls VerticaLinkedService) AsAzureDataLakeAnalyticsLinkedService() (*AzureDataLakeAnalyticsLinkedService, bool) { + return nil, false +} + +// AsHDInsightOnDemandLinkedService is the BasicLinkedService implementation for VerticaLinkedService. +func (vls VerticaLinkedService) AsHDInsightOnDemandLinkedService() (*HDInsightOnDemandLinkedService, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudLinkedService is the BasicLinkedService implementation for VerticaLinkedService. +func (vls VerticaLinkedService) AsSalesforceMarketingCloudLinkedService() (*SalesforceMarketingCloudLinkedService, bool) { + return nil, false +} + +// AsNetezzaLinkedService is the BasicLinkedService implementation for VerticaLinkedService. +func (vls VerticaLinkedService) AsNetezzaLinkedService() (*NetezzaLinkedService, bool) { + return nil, false +} + +// AsVerticaLinkedService is the BasicLinkedService implementation for VerticaLinkedService. +func (vls VerticaLinkedService) AsVerticaLinkedService() (*VerticaLinkedService, bool) { + return &vls, true +} + +// AsZohoLinkedService is the BasicLinkedService implementation for VerticaLinkedService. +func (vls VerticaLinkedService) AsZohoLinkedService() (*ZohoLinkedService, bool) { + return nil, false +} + +// AsXeroLinkedService is the BasicLinkedService implementation for VerticaLinkedService. +func (vls VerticaLinkedService) AsXeroLinkedService() (*XeroLinkedService, bool) { + return nil, false +} + +// AsSquareLinkedService is the BasicLinkedService implementation for VerticaLinkedService. +func (vls VerticaLinkedService) AsSquareLinkedService() (*SquareLinkedService, bool) { + return nil, false +} + +// AsSparkLinkedService is the BasicLinkedService implementation for VerticaLinkedService. +func (vls VerticaLinkedService) AsSparkLinkedService() (*SparkLinkedService, bool) { + return nil, false +} + +// AsShopifyLinkedService is the BasicLinkedService implementation for VerticaLinkedService. +func (vls VerticaLinkedService) AsShopifyLinkedService() (*ShopifyLinkedService, bool) { + return nil, false +} + +// AsServiceNowLinkedService is the BasicLinkedService implementation for VerticaLinkedService. +func (vls VerticaLinkedService) AsServiceNowLinkedService() (*ServiceNowLinkedService, bool) { + return nil, false +} + +// AsQuickBooksLinkedService is the BasicLinkedService implementation for VerticaLinkedService. +func (vls VerticaLinkedService) AsQuickBooksLinkedService() (*QuickBooksLinkedService, bool) { + return nil, false +} + +// AsPrestoLinkedService is the BasicLinkedService implementation for VerticaLinkedService. +func (vls VerticaLinkedService) AsPrestoLinkedService() (*PrestoLinkedService, bool) { + return nil, false +} + +// AsPhoenixLinkedService is the BasicLinkedService implementation for VerticaLinkedService. +func (vls VerticaLinkedService) AsPhoenixLinkedService() (*PhoenixLinkedService, bool) { + return nil, false +} + +// AsPaypalLinkedService is the BasicLinkedService implementation for VerticaLinkedService. +func (vls VerticaLinkedService) AsPaypalLinkedService() (*PaypalLinkedService, bool) { + return nil, false +} + +// AsMarketoLinkedService is the BasicLinkedService implementation for VerticaLinkedService. +func (vls VerticaLinkedService) AsMarketoLinkedService() (*MarketoLinkedService, bool) { + return nil, false +} + +// AsMariaDBLinkedService is the BasicLinkedService implementation for VerticaLinkedService. +func (vls VerticaLinkedService) AsMariaDBLinkedService() (*MariaDBLinkedService, bool) { + return nil, false +} + +// AsMagentoLinkedService is the BasicLinkedService implementation for VerticaLinkedService. +func (vls VerticaLinkedService) AsMagentoLinkedService() (*MagentoLinkedService, bool) { + return nil, false +} + +// AsJiraLinkedService is the BasicLinkedService implementation for VerticaLinkedService. +func (vls VerticaLinkedService) AsJiraLinkedService() (*JiraLinkedService, bool) { + return nil, false +} + +// AsImpalaLinkedService is the BasicLinkedService implementation for VerticaLinkedService. +func (vls VerticaLinkedService) AsImpalaLinkedService() (*ImpalaLinkedService, bool) { + return nil, false +} + +// AsHubspotLinkedService is the BasicLinkedService implementation for VerticaLinkedService. +func (vls VerticaLinkedService) AsHubspotLinkedService() (*HubspotLinkedService, bool) { + return nil, false +} + +// AsHiveLinkedService is the BasicLinkedService implementation for VerticaLinkedService. +func (vls VerticaLinkedService) AsHiveLinkedService() (*HiveLinkedService, bool) { + return nil, false +} + +// AsHBaseLinkedService is the BasicLinkedService implementation for VerticaLinkedService. +func (vls VerticaLinkedService) AsHBaseLinkedService() (*HBaseLinkedService, bool) { + return nil, false +} + +// AsGreenplumLinkedService is the BasicLinkedService implementation for VerticaLinkedService. +func (vls VerticaLinkedService) AsGreenplumLinkedService() (*GreenplumLinkedService, bool) { + return nil, false +} + +// AsGoogleBigQueryLinkedService is the BasicLinkedService implementation for VerticaLinkedService. +func (vls VerticaLinkedService) AsGoogleBigQueryLinkedService() (*GoogleBigQueryLinkedService, bool) { + return nil, false +} + +// AsEloquaLinkedService is the BasicLinkedService implementation for VerticaLinkedService. +func (vls VerticaLinkedService) AsEloquaLinkedService() (*EloquaLinkedService, bool) { + return nil, false +} + +// AsDrillLinkedService is the BasicLinkedService implementation for VerticaLinkedService. +func (vls VerticaLinkedService) AsDrillLinkedService() (*DrillLinkedService, bool) { + return nil, false +} + +// AsCouchbaseLinkedService is the BasicLinkedService implementation for VerticaLinkedService. +func (vls VerticaLinkedService) AsCouchbaseLinkedService() (*CouchbaseLinkedService, bool) { + return nil, false +} + +// AsConcurLinkedService is the BasicLinkedService implementation for VerticaLinkedService. +func (vls VerticaLinkedService) AsConcurLinkedService() (*ConcurLinkedService, bool) { + return nil, false +} + +// AsAzurePostgreSQLLinkedService is the BasicLinkedService implementation for VerticaLinkedService. +func (vls VerticaLinkedService) AsAzurePostgreSQLLinkedService() (*AzurePostgreSQLLinkedService, bool) { + return nil, false +} + +// AsAmazonMWSLinkedService is the BasicLinkedService implementation for VerticaLinkedService. +func (vls VerticaLinkedService) AsAmazonMWSLinkedService() (*AmazonMWSLinkedService, bool) { + return nil, false +} + +// AsSapHanaLinkedService is the BasicLinkedService implementation for VerticaLinkedService. +func (vls VerticaLinkedService) AsSapHanaLinkedService() (*SapHanaLinkedService, bool) { + return nil, false +} + +// AsSapBWLinkedService is the BasicLinkedService implementation for VerticaLinkedService. +func (vls VerticaLinkedService) AsSapBWLinkedService() (*SapBWLinkedService, bool) { + return nil, false +} + +// AsSftpServerLinkedService is the BasicLinkedService implementation for VerticaLinkedService. +func (vls VerticaLinkedService) AsSftpServerLinkedService() (*SftpServerLinkedService, bool) { + return nil, false +} + +// AsFtpServerLinkedService is the BasicLinkedService implementation for VerticaLinkedService. +func (vls VerticaLinkedService) AsFtpServerLinkedService() (*FtpServerLinkedService, bool) { + return nil, false +} + +// AsHTTPLinkedService is the BasicLinkedService implementation for VerticaLinkedService. +func (vls VerticaLinkedService) AsHTTPLinkedService() (*HTTPLinkedService, bool) { + return nil, false +} + +// AsAzureSearchLinkedService is the BasicLinkedService implementation for VerticaLinkedService. +func (vls VerticaLinkedService) AsAzureSearchLinkedService() (*AzureSearchLinkedService, bool) { + return nil, false +} + +// AsCustomDataSourceLinkedService is the BasicLinkedService implementation for VerticaLinkedService. +func (vls VerticaLinkedService) AsCustomDataSourceLinkedService() (*CustomDataSourceLinkedService, bool) { + return nil, false +} + +// AsAmazonRedshiftLinkedService is the BasicLinkedService implementation for VerticaLinkedService. +func (vls VerticaLinkedService) AsAmazonRedshiftLinkedService() (*AmazonRedshiftLinkedService, bool) { + return nil, false +} + +// AsAmazonS3LinkedService is the BasicLinkedService implementation for VerticaLinkedService. +func (vls VerticaLinkedService) AsAmazonS3LinkedService() (*AmazonS3LinkedService, bool) { + return nil, false +} + +// AsSapEccLinkedService is the BasicLinkedService implementation for VerticaLinkedService. +func (vls VerticaLinkedService) AsSapEccLinkedService() (*SapEccLinkedService, bool) { + return nil, false +} + +// AsSapCloudForCustomerLinkedService is the BasicLinkedService implementation for VerticaLinkedService. +func (vls VerticaLinkedService) AsSapCloudForCustomerLinkedService() (*SapCloudForCustomerLinkedService, bool) { + return nil, false +} + +// AsSalesforceLinkedService is the BasicLinkedService implementation for VerticaLinkedService. +func (vls VerticaLinkedService) AsSalesforceLinkedService() (*SalesforceLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeStoreLinkedService is the BasicLinkedService implementation for VerticaLinkedService. +func (vls VerticaLinkedService) AsAzureDataLakeStoreLinkedService() (*AzureDataLakeStoreLinkedService, bool) { + return nil, false +} + +// AsMongoDbLinkedService is the BasicLinkedService implementation for VerticaLinkedService. +func (vls VerticaLinkedService) AsMongoDbLinkedService() (*MongoDbLinkedService, bool) { + return nil, false +} + +// AsCassandraLinkedService is the BasicLinkedService implementation for VerticaLinkedService. +func (vls VerticaLinkedService) AsCassandraLinkedService() (*CassandraLinkedService, bool) { + return nil, false +} + +// AsWebLinkedService is the BasicLinkedService implementation for VerticaLinkedService. +func (vls VerticaLinkedService) AsWebLinkedService() (*WebLinkedService, bool) { + return nil, false +} + +// AsODataLinkedService is the BasicLinkedService implementation for VerticaLinkedService. +func (vls VerticaLinkedService) AsODataLinkedService() (*ODataLinkedService, bool) { + return nil, false +} + +// AsHdfsLinkedService is the BasicLinkedService implementation for VerticaLinkedService. +func (vls VerticaLinkedService) AsHdfsLinkedService() (*HdfsLinkedService, bool) { + return nil, false +} + +// AsOdbcLinkedService is the BasicLinkedService implementation for VerticaLinkedService. +func (vls VerticaLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, bool) { + return nil, false +} + +// AsAzureMLLinkedService is the BasicLinkedService implementation for VerticaLinkedService. +func (vls VerticaLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { + return nil, false +} + +// AsTeradataLinkedService is the BasicLinkedService implementation for VerticaLinkedService. +func (vls VerticaLinkedService) AsTeradataLinkedService() (*TeradataLinkedService, bool) { + return nil, false +} + +// AsDb2LinkedService is the BasicLinkedService implementation for VerticaLinkedService. +func (vls VerticaLinkedService) AsDb2LinkedService() (*Db2LinkedService, bool) { + return nil, false +} + +// AsSybaseLinkedService is the BasicLinkedService implementation for VerticaLinkedService. +func (vls VerticaLinkedService) AsSybaseLinkedService() (*SybaseLinkedService, bool) { + return nil, false +} + +// AsPostgreSQLLinkedService is the BasicLinkedService implementation for VerticaLinkedService. +func (vls VerticaLinkedService) AsPostgreSQLLinkedService() (*PostgreSQLLinkedService, bool) { + return nil, false +} + +// AsMySQLLinkedService is the BasicLinkedService implementation for VerticaLinkedService. +func (vls VerticaLinkedService) AsMySQLLinkedService() (*MySQLLinkedService, bool) { + return nil, false +} + +// AsAzureMySQLLinkedService is the BasicLinkedService implementation for VerticaLinkedService. +func (vls VerticaLinkedService) AsAzureMySQLLinkedService() (*AzureMySQLLinkedService, bool) { + return nil, false +} + +// AsOracleLinkedService is the BasicLinkedService implementation for VerticaLinkedService. +func (vls VerticaLinkedService) AsOracleLinkedService() (*OracleLinkedService, bool) { + return nil, false +} + +// AsFileServerLinkedService is the BasicLinkedService implementation for VerticaLinkedService. +func (vls VerticaLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { + return nil, false +} + +// AsHDInsightLinkedService is the BasicLinkedService implementation for VerticaLinkedService. +func (vls VerticaLinkedService) AsHDInsightLinkedService() (*HDInsightLinkedService, bool) { + return nil, false +} + +// AsDynamicsLinkedService is the BasicLinkedService implementation for VerticaLinkedService. +func (vls VerticaLinkedService) AsDynamicsLinkedService() (*DynamicsLinkedService, bool) { + return nil, false +} + +// AsCosmosDbLinkedService is the BasicLinkedService implementation for VerticaLinkedService. +func (vls VerticaLinkedService) AsCosmosDbLinkedService() (*CosmosDbLinkedService, bool) { + return nil, false +} + +// AsAzureKeyVaultLinkedService is the BasicLinkedService implementation for VerticaLinkedService. +func (vls VerticaLinkedService) AsAzureKeyVaultLinkedService() (*AzureKeyVaultLinkedService, bool) { + return nil, false +} + +// AsAzureBatchLinkedService is the BasicLinkedService implementation for VerticaLinkedService. +func (vls VerticaLinkedService) AsAzureBatchLinkedService() (*AzureBatchLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDatabaseLinkedService is the BasicLinkedService implementation for VerticaLinkedService. +func (vls VerticaLinkedService) AsAzureSQLDatabaseLinkedService() (*AzureSQLDatabaseLinkedService, bool) { + return nil, false +} + +// AsSQLServerLinkedService is the BasicLinkedService implementation for VerticaLinkedService. +func (vls VerticaLinkedService) AsSQLServerLinkedService() (*SQLServerLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDWLinkedService is the BasicLinkedService implementation for VerticaLinkedService. +func (vls VerticaLinkedService) AsAzureSQLDWLinkedService() (*AzureSQLDWLinkedService, bool) { + return nil, false +} + +// AsAzureStorageLinkedService is the BasicLinkedService implementation for VerticaLinkedService. +func (vls VerticaLinkedService) AsAzureStorageLinkedService() (*AzureStorageLinkedService, bool) { + return nil, false +} + +// AsLinkedService is the BasicLinkedService implementation for VerticaLinkedService. +func (vls VerticaLinkedService) AsLinkedService() (*LinkedService, bool) { + return nil, false +} + +// AsBasicLinkedService is the BasicLinkedService implementation for VerticaLinkedService. +func (vls VerticaLinkedService) AsBasicLinkedService() (BasicLinkedService, bool) { + return &vls, true +} + +// UnmarshalJSON is the custom unmarshaler for VerticaLinkedService struct. +func (vls *VerticaLinkedService) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "typeProperties": + if v != nil { + var verticaLinkedServiceTypeProperties VerticaLinkedServiceTypeProperties + err = json.Unmarshal(*v, &verticaLinkedServiceTypeProperties) + if err != nil { + return err + } + vls.VerticaLinkedServiceTypeProperties = &verticaLinkedServiceTypeProperties + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if vls.AdditionalProperties == nil { + vls.AdditionalProperties = make(map[string]interface{}) + } + vls.AdditionalProperties[k] = additionalProperties + } + case "connectVia": + if v != nil { + var connectVia IntegrationRuntimeReference + err = json.Unmarshal(*v, &connectVia) + if err != nil { + return err + } + vls.ConnectVia = &connectVia + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + vls.Description = &description + } + case "parameters": + if v != nil { + var parameters map[string]*ParameterSpecification + err = json.Unmarshal(*v, ¶meters) + if err != nil { + return err + } + vls.Parameters = parameters + } + case "annotations": + if v != nil { + var annotations []interface{} + err = json.Unmarshal(*v, &annotations) + if err != nil { + return err + } + vls.Annotations = &annotations + } + case "type": + if v != nil { + var typeVar TypeBasicLinkedService + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + vls.Type = typeVar + } + } + } + + return nil +} + +// VerticaLinkedServiceTypeProperties vertica linked service properties. +type VerticaLinkedServiceTypeProperties struct { + // ConnectionString - An ODBC connection string. Type: string, SecureString or AzureKeyVaultSecretReference. + ConnectionString interface{} `json:"connectionString,omitempty"` + // EncryptedCredential - The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string). + EncryptedCredential interface{} `json:"encryptedCredential,omitempty"` +} + +// VerticaSource a copy activity Vertica source. +type VerticaSource struct { + // Query - A query to retrieve data from source. Type: string (or Expression with resultType string). + Query interface{} `json:"query,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // SourceRetryCount - Source retry count. Type: integer (or Expression with resultType integer). + SourceRetryCount interface{} `json:"sourceRetryCount,omitempty"` + // SourceRetryWait - Source retry wait. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` + // Type - Possible values include: 'TypeCopySource', 'TypeAmazonRedshiftSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeHTTPSource', 'TypeAzureDataLakeStoreSource', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeRelationalSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource' + Type TypeBasicCopySource `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for VerticaSource. +func (vs VerticaSource) MarshalJSON() ([]byte, error) { + vs.Type = TypeVerticaSource + objectMap := make(map[string]interface{}) + objectMap["query"] = vs.Query + objectMap["sourceRetryCount"] = vs.SourceRetryCount + objectMap["sourceRetryWait"] = vs.SourceRetryWait + if vs.Type != "" { + objectMap["type"] = vs.Type + } + for k, v := range vs.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsAmazonRedshiftSource is the BasicCopySource implementation for VerticaSource. +func (vs VerticaSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { + return nil, false +} + +// AsResponsysSource is the BasicCopySource implementation for VerticaSource. +func (vs VerticaSource) AsResponsysSource() (*ResponsysSource, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudSource is the BasicCopySource implementation for VerticaSource. +func (vs VerticaSource) AsSalesforceMarketingCloudSource() (*SalesforceMarketingCloudSource, bool) { + return nil, false +} + +// AsVerticaSource is the BasicCopySource implementation for VerticaSource. +func (vs VerticaSource) AsVerticaSource() (*VerticaSource, bool) { + return &vs, true +} + +// AsNetezzaSource is the BasicCopySource implementation for VerticaSource. +func (vs VerticaSource) AsNetezzaSource() (*NetezzaSource, bool) { + return nil, false +} + +// AsZohoSource is the BasicCopySource implementation for VerticaSource. +func (vs VerticaSource) AsZohoSource() (*ZohoSource, bool) { + return nil, false +} + +// AsXeroSource is the BasicCopySource implementation for VerticaSource. +func (vs VerticaSource) AsXeroSource() (*XeroSource, bool) { + return nil, false +} + +// AsSquareSource is the BasicCopySource implementation for VerticaSource. +func (vs VerticaSource) AsSquareSource() (*SquareSource, bool) { + return nil, false +} + +// AsSparkSource is the BasicCopySource implementation for VerticaSource. +func (vs VerticaSource) AsSparkSource() (*SparkSource, bool) { + return nil, false +} + +// AsShopifySource is the BasicCopySource implementation for VerticaSource. +func (vs VerticaSource) AsShopifySource() (*ShopifySource, bool) { + return nil, false +} + +// AsServiceNowSource is the BasicCopySource implementation for VerticaSource. +func (vs VerticaSource) AsServiceNowSource() (*ServiceNowSource, bool) { + return nil, false +} + +// AsQuickBooksSource is the BasicCopySource implementation for VerticaSource. +func (vs VerticaSource) AsQuickBooksSource() (*QuickBooksSource, bool) { + return nil, false +} + +// AsPrestoSource is the BasicCopySource implementation for VerticaSource. +func (vs VerticaSource) AsPrestoSource() (*PrestoSource, bool) { + return nil, false +} + +// AsPhoenixSource is the BasicCopySource implementation for VerticaSource. +func (vs VerticaSource) AsPhoenixSource() (*PhoenixSource, bool) { + return nil, false +} + +// AsPaypalSource is the BasicCopySource implementation for VerticaSource. +func (vs VerticaSource) AsPaypalSource() (*PaypalSource, bool) { + return nil, false +} + +// AsMarketoSource is the BasicCopySource implementation for VerticaSource. +func (vs VerticaSource) AsMarketoSource() (*MarketoSource, bool) { + return nil, false +} + +// AsMariaDBSource is the BasicCopySource implementation for VerticaSource. +func (vs VerticaSource) AsMariaDBSource() (*MariaDBSource, bool) { + return nil, false +} + +// AsMagentoSource is the BasicCopySource implementation for VerticaSource. +func (vs VerticaSource) AsMagentoSource() (*MagentoSource, bool) { + return nil, false +} + +// AsJiraSource is the BasicCopySource implementation for VerticaSource. +func (vs VerticaSource) AsJiraSource() (*JiraSource, bool) { + return nil, false +} + +// AsImpalaSource is the BasicCopySource implementation for VerticaSource. +func (vs VerticaSource) AsImpalaSource() (*ImpalaSource, bool) { + return nil, false +} + +// AsHubspotSource is the BasicCopySource implementation for VerticaSource. +func (vs VerticaSource) AsHubspotSource() (*HubspotSource, bool) { + return nil, false +} + +// AsHiveSource is the BasicCopySource implementation for VerticaSource. +func (vs VerticaSource) AsHiveSource() (*HiveSource, bool) { + return nil, false +} + +// AsHBaseSource is the BasicCopySource implementation for VerticaSource. +func (vs VerticaSource) AsHBaseSource() (*HBaseSource, bool) { + return nil, false +} + +// AsGreenplumSource is the BasicCopySource implementation for VerticaSource. +func (vs VerticaSource) AsGreenplumSource() (*GreenplumSource, bool) { + return nil, false +} + +// AsGoogleBigQuerySource is the BasicCopySource implementation for VerticaSource. +func (vs VerticaSource) AsGoogleBigQuerySource() (*GoogleBigQuerySource, bool) { + return nil, false +} + +// AsEloquaSource is the BasicCopySource implementation for VerticaSource. +func (vs VerticaSource) AsEloquaSource() (*EloquaSource, bool) { + return nil, false +} + +// AsDrillSource is the BasicCopySource implementation for VerticaSource. +func (vs VerticaSource) AsDrillSource() (*DrillSource, bool) { + return nil, false +} + +// AsCouchbaseSource is the BasicCopySource implementation for VerticaSource. +func (vs VerticaSource) AsCouchbaseSource() (*CouchbaseSource, bool) { + return nil, false +} + +// AsConcurSource is the BasicCopySource implementation for VerticaSource. +func (vs VerticaSource) AsConcurSource() (*ConcurSource, bool) { + return nil, false +} + +// AsAzurePostgreSQLSource is the BasicCopySource implementation for VerticaSource. +func (vs VerticaSource) AsAzurePostgreSQLSource() (*AzurePostgreSQLSource, bool) { + return nil, false +} + +// AsAmazonMWSSource is the BasicCopySource implementation for VerticaSource. +func (vs VerticaSource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { + return nil, false +} + +// AsHTTPSource is the BasicCopySource implementation for VerticaSource. +func (vs VerticaSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for VerticaSource. +func (vs VerticaSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for VerticaSource. +func (vs VerticaSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsCassandraSource is the BasicCopySource implementation for VerticaSource. +func (vs VerticaSource) AsCassandraSource() (*CassandraSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for VerticaSource. +func (vs VerticaSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for VerticaSource. +func (vs VerticaSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureMySQLSource is the BasicCopySource implementation for VerticaSource. +func (vs VerticaSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for VerticaSource. +func (vs VerticaSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for VerticaSource. +func (vs VerticaSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsSQLDWSource is the BasicCopySource implementation for VerticaSource. +func (vs VerticaSource) AsSQLDWSource() (*SQLDWSource, bool) { + return nil, false +} + +// AsSQLSource is the BasicCopySource implementation for VerticaSource. +func (vs VerticaSource) AsSQLSource() (*SQLSource, bool) { + return nil, false +} + +// AsSapEccSource is the BasicCopySource implementation for VerticaSource. +func (vs VerticaSource) AsSapEccSource() (*SapEccSource, bool) { + return nil, false +} + +// AsSapCloudForCustomerSource is the BasicCopySource implementation for VerticaSource. +func (vs VerticaSource) AsSapCloudForCustomerSource() (*SapCloudForCustomerSource, bool) { + return nil, false +} + +// AsSalesforceSource is the BasicCopySource implementation for VerticaSource. +func (vs VerticaSource) AsSalesforceSource() (*SalesforceSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for VerticaSource. +func (vs VerticaSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for VerticaSource. +func (vs VerticaSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for VerticaSource. +func (vs VerticaSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for VerticaSource. +func (vs VerticaSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + +// AsAzureTableSource is the BasicCopySource implementation for VerticaSource. +func (vs VerticaSource) AsAzureTableSource() (*AzureTableSource, bool) { + return nil, false +} + +// AsCopySource is the BasicCopySource implementation for VerticaSource. +func (vs VerticaSource) AsCopySource() (*CopySource, bool) { + return nil, false +} + +// AsBasicCopySource is the BasicCopySource implementation for VerticaSource. +func (vs VerticaSource) AsBasicCopySource() (BasicCopySource, bool) { + return &vs, true +} + +// VerticaTableDataset vertica dataset. +type VerticaTableDataset struct { + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Description - Dataset description. + Description *string `json:"description,omitempty"` + // Structure - Columns that define the structure of the dataset. Type: array (or Expression with resultType array), itemType: DatasetDataElement. + Structure interface{} `json:"structure,omitempty"` + // LinkedServiceName - Linked service reference. + LinkedServiceName *LinkedServiceReference `json:"linkedServiceName,omitempty"` + // Parameters - Parameters for dataset. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeDataset', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSQLServerTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSalesforceObject', 'TypeRelationalTable', 'TypeAzureMySQLTable', 'TypeOracleTable', 'TypeODataResource', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeAzureDataLakeStoreFile', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeAmazonS3Object' + Type TypeBasicDataset `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for VerticaTableDataset. +func (vtd VerticaTableDataset) MarshalJSON() ([]byte, error) { + vtd.Type = TypeVerticaTable + objectMap := make(map[string]interface{}) + if vtd.Description != nil { + objectMap["description"] = vtd.Description + } + objectMap["structure"] = vtd.Structure + if vtd.LinkedServiceName != nil { + objectMap["linkedServiceName"] = vtd.LinkedServiceName + } + if vtd.Parameters != nil { + objectMap["parameters"] = vtd.Parameters + } + if vtd.Annotations != nil { + objectMap["annotations"] = vtd.Annotations + } + if vtd.Type != "" { + objectMap["type"] = vtd.Type + } + for k, v := range vtd.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysObjectDataset is the BasicDataset implementation for VerticaTableDataset. +func (vtd VerticaTableDataset) AsResponsysObjectDataset() (*ResponsysObjectDataset, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudObjectDataset is the BasicDataset implementation for VerticaTableDataset. +func (vtd VerticaTableDataset) AsSalesforceMarketingCloudObjectDataset() (*SalesforceMarketingCloudObjectDataset, bool) { + return nil, false +} + +// AsVerticaTableDataset is the BasicDataset implementation for VerticaTableDataset. +func (vtd VerticaTableDataset) AsVerticaTableDataset() (*VerticaTableDataset, bool) { + return &vtd, true +} + +// AsNetezzaTableDataset is the BasicDataset implementation for VerticaTableDataset. +func (vtd VerticaTableDataset) AsNetezzaTableDataset() (*NetezzaTableDataset, bool) { + return nil, false +} + +// AsZohoObjectDataset is the BasicDataset implementation for VerticaTableDataset. +func (vtd VerticaTableDataset) AsZohoObjectDataset() (*ZohoObjectDataset, bool) { + return nil, false +} + +// AsXeroObjectDataset is the BasicDataset implementation for VerticaTableDataset. +func (vtd VerticaTableDataset) AsXeroObjectDataset() (*XeroObjectDataset, bool) { + return nil, false +} + +// AsSquareObjectDataset is the BasicDataset implementation for VerticaTableDataset. +func (vtd VerticaTableDataset) AsSquareObjectDataset() (*SquareObjectDataset, bool) { + return nil, false +} + +// AsSparkObjectDataset is the BasicDataset implementation for VerticaTableDataset. +func (vtd VerticaTableDataset) AsSparkObjectDataset() (*SparkObjectDataset, bool) { + return nil, false +} + +// AsShopifyObjectDataset is the BasicDataset implementation for VerticaTableDataset. +func (vtd VerticaTableDataset) AsShopifyObjectDataset() (*ShopifyObjectDataset, bool) { + return nil, false +} + +// AsServiceNowObjectDataset is the BasicDataset implementation for VerticaTableDataset. +func (vtd VerticaTableDataset) AsServiceNowObjectDataset() (*ServiceNowObjectDataset, bool) { + return nil, false +} + +// AsQuickBooksObjectDataset is the BasicDataset implementation for VerticaTableDataset. +func (vtd VerticaTableDataset) AsQuickBooksObjectDataset() (*QuickBooksObjectDataset, bool) { + return nil, false +} + +// AsPrestoObjectDataset is the BasicDataset implementation for VerticaTableDataset. +func (vtd VerticaTableDataset) AsPrestoObjectDataset() (*PrestoObjectDataset, bool) { + return nil, false +} + +// AsPhoenixObjectDataset is the BasicDataset implementation for VerticaTableDataset. +func (vtd VerticaTableDataset) AsPhoenixObjectDataset() (*PhoenixObjectDataset, bool) { + return nil, false +} + +// AsPaypalObjectDataset is the BasicDataset implementation for VerticaTableDataset. +func (vtd VerticaTableDataset) AsPaypalObjectDataset() (*PaypalObjectDataset, bool) { + return nil, false +} + +// AsMarketoObjectDataset is the BasicDataset implementation for VerticaTableDataset. +func (vtd VerticaTableDataset) AsMarketoObjectDataset() (*MarketoObjectDataset, bool) { + return nil, false +} + +// AsMariaDBTableDataset is the BasicDataset implementation for VerticaTableDataset. +func (vtd VerticaTableDataset) AsMariaDBTableDataset() (*MariaDBTableDataset, bool) { + return nil, false +} + +// AsMagentoObjectDataset is the BasicDataset implementation for VerticaTableDataset. +func (vtd VerticaTableDataset) AsMagentoObjectDataset() (*MagentoObjectDataset, bool) { + return nil, false +} + +// AsJiraObjectDataset is the BasicDataset implementation for VerticaTableDataset. +func (vtd VerticaTableDataset) AsJiraObjectDataset() (*JiraObjectDataset, bool) { + return nil, false +} + +// AsImpalaObjectDataset is the BasicDataset implementation for VerticaTableDataset. +func (vtd VerticaTableDataset) AsImpalaObjectDataset() (*ImpalaObjectDataset, bool) { + return nil, false +} + +// AsHubspotObjectDataset is the BasicDataset implementation for VerticaTableDataset. +func (vtd VerticaTableDataset) AsHubspotObjectDataset() (*HubspotObjectDataset, bool) { + return nil, false +} + +// AsHiveObjectDataset is the BasicDataset implementation for VerticaTableDataset. +func (vtd VerticaTableDataset) AsHiveObjectDataset() (*HiveObjectDataset, bool) { + return nil, false +} + +// AsHBaseObjectDataset is the BasicDataset implementation for VerticaTableDataset. +func (vtd VerticaTableDataset) AsHBaseObjectDataset() (*HBaseObjectDataset, bool) { + return nil, false +} + +// AsGreenplumTableDataset is the BasicDataset implementation for VerticaTableDataset. +func (vtd VerticaTableDataset) AsGreenplumTableDataset() (*GreenplumTableDataset, bool) { + return nil, false +} + +// AsGoogleBigQueryObjectDataset is the BasicDataset implementation for VerticaTableDataset. +func (vtd VerticaTableDataset) AsGoogleBigQueryObjectDataset() (*GoogleBigQueryObjectDataset, bool) { + return nil, false +} + +// AsEloquaObjectDataset is the BasicDataset implementation for VerticaTableDataset. +func (vtd VerticaTableDataset) AsEloquaObjectDataset() (*EloquaObjectDataset, bool) { + return nil, false +} + +// AsDrillTableDataset is the BasicDataset implementation for VerticaTableDataset. +func (vtd VerticaTableDataset) AsDrillTableDataset() (*DrillTableDataset, bool) { + return nil, false +} + +// AsCouchbaseTableDataset is the BasicDataset implementation for VerticaTableDataset. +func (vtd VerticaTableDataset) AsCouchbaseTableDataset() (*CouchbaseTableDataset, bool) { + return nil, false +} + +// AsConcurObjectDataset is the BasicDataset implementation for VerticaTableDataset. +func (vtd VerticaTableDataset) AsConcurObjectDataset() (*ConcurObjectDataset, bool) { + return nil, false +} + +// AsAzurePostgreSQLTableDataset is the BasicDataset implementation for VerticaTableDataset. +func (vtd VerticaTableDataset) AsAzurePostgreSQLTableDataset() (*AzurePostgreSQLTableDataset, bool) { + return nil, false +} + +// AsAmazonMWSObjectDataset is the BasicDataset implementation for VerticaTableDataset. +func (vtd VerticaTableDataset) AsAmazonMWSObjectDataset() (*AmazonMWSObjectDataset, bool) { + return nil, false +} + +// AsHTTPDataset is the BasicDataset implementation for VerticaTableDataset. +func (vtd VerticaTableDataset) AsHTTPDataset() (*HTTPDataset, bool) { + return nil, false +} + +// AsAzureSearchIndexDataset is the BasicDataset implementation for VerticaTableDataset. +func (vtd VerticaTableDataset) AsAzureSearchIndexDataset() (*AzureSearchIndexDataset, bool) { + return nil, false +} + +// AsWebTableDataset is the BasicDataset implementation for VerticaTableDataset. +func (vtd VerticaTableDataset) AsWebTableDataset() (*WebTableDataset, bool) { + return nil, false +} + +// AsSQLServerTableDataset is the BasicDataset implementation for VerticaTableDataset. +func (vtd VerticaTableDataset) AsSQLServerTableDataset() (*SQLServerTableDataset, bool) { + return nil, false +} + +// AsSapEccResourceDataset is the BasicDataset implementation for VerticaTableDataset. +func (vtd VerticaTableDataset) AsSapEccResourceDataset() (*SapEccResourceDataset, bool) { + return nil, false +} + +// AsSapCloudForCustomerResourceDataset is the BasicDataset implementation for VerticaTableDataset. +func (vtd VerticaTableDataset) AsSapCloudForCustomerResourceDataset() (*SapCloudForCustomerResourceDataset, bool) { + return nil, false +} + +// AsSalesforceObjectDataset is the BasicDataset implementation for VerticaTableDataset. +func (vtd VerticaTableDataset) AsSalesforceObjectDataset() (*SalesforceObjectDataset, bool) { + return nil, false +} + +// AsRelationalTableDataset is the BasicDataset implementation for VerticaTableDataset. +func (vtd VerticaTableDataset) AsRelationalTableDataset() (*RelationalTableDataset, bool) { + return nil, false +} + +// AsAzureMySQLTableDataset is the BasicDataset implementation for VerticaTableDataset. +func (vtd VerticaTableDataset) AsAzureMySQLTableDataset() (*AzureMySQLTableDataset, bool) { + return nil, false +} + +// AsOracleTableDataset is the BasicDataset implementation for VerticaTableDataset. +func (vtd VerticaTableDataset) AsOracleTableDataset() (*OracleTableDataset, bool) { + return nil, false +} + +// AsODataResourceDataset is the BasicDataset implementation for VerticaTableDataset. +func (vtd VerticaTableDataset) AsODataResourceDataset() (*ODataResourceDataset, bool) { + return nil, false +} + +// AsMongoDbCollectionDataset is the BasicDataset implementation for VerticaTableDataset. +func (vtd VerticaTableDataset) AsMongoDbCollectionDataset() (*MongoDbCollectionDataset, bool) { + return nil, false +} + +// AsFileShareDataset is the BasicDataset implementation for VerticaTableDataset. +func (vtd VerticaTableDataset) AsFileShareDataset() (*FileShareDataset, bool) { + return nil, false +} + +// AsAzureDataLakeStoreDataset is the BasicDataset implementation for VerticaTableDataset. +func (vtd VerticaTableDataset) AsAzureDataLakeStoreDataset() (*AzureDataLakeStoreDataset, bool) { + return nil, false +} + +// AsDynamicsEntityDataset is the BasicDataset implementation for VerticaTableDataset. +func (vtd VerticaTableDataset) AsDynamicsEntityDataset() (*DynamicsEntityDataset, bool) { + return nil, false +} + +// AsDocumentDbCollectionDataset is the BasicDataset implementation for VerticaTableDataset. +func (vtd VerticaTableDataset) AsDocumentDbCollectionDataset() (*DocumentDbCollectionDataset, bool) { + return nil, false +} + +// AsCustomDataset is the BasicDataset implementation for VerticaTableDataset. +func (vtd VerticaTableDataset) AsCustomDataset() (*CustomDataset, bool) { + return nil, false +} + +// AsCassandraTableDataset is the BasicDataset implementation for VerticaTableDataset. +func (vtd VerticaTableDataset) AsCassandraTableDataset() (*CassandraTableDataset, bool) { + return nil, false +} + +// AsAzureSQLDWTableDataset is the BasicDataset implementation for VerticaTableDataset. +func (vtd VerticaTableDataset) AsAzureSQLDWTableDataset() (*AzureSQLDWTableDataset, bool) { + return nil, false +} + +// AsAzureSQLTableDataset is the BasicDataset implementation for VerticaTableDataset. +func (vtd VerticaTableDataset) AsAzureSQLTableDataset() (*AzureSQLTableDataset, bool) { + return nil, false +} + +// AsAzureTableDataset is the BasicDataset implementation for VerticaTableDataset. +func (vtd VerticaTableDataset) AsAzureTableDataset() (*AzureTableDataset, bool) { + return nil, false +} + +// AsAzureBlobDataset is the BasicDataset implementation for VerticaTableDataset. +func (vtd VerticaTableDataset) AsAzureBlobDataset() (*AzureBlobDataset, bool) { + return nil, false +} + +// AsAmazonS3Dataset is the BasicDataset implementation for VerticaTableDataset. +func (vtd VerticaTableDataset) AsAmazonS3Dataset() (*AmazonS3Dataset, bool) { + return nil, false +} + +// AsDataset is the BasicDataset implementation for VerticaTableDataset. +func (vtd VerticaTableDataset) AsDataset() (*Dataset, bool) { + return nil, false +} + +// AsBasicDataset is the BasicDataset implementation for VerticaTableDataset. +func (vtd VerticaTableDataset) AsBasicDataset() (BasicDataset, bool) { + return &vtd, true +} + +// WaitActivity this activity suspends pipeline execution for the specified interval. +type WaitActivity struct { + // WaitActivityTypeProperties - Wait activity properties. + *WaitActivityTypeProperties `json:"typeProperties,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Name - Activity name. + Name *string `json:"name,omitempty"` + // Description - Activity description. + Description *string `json:"description,omitempty"` + // DependsOn - Activity depends on condition. + DependsOn *[]ActivityDependency `json:"dependsOn,omitempty"` + // UserProperties - Activity user properties. + UserProperties map[string]*string `json:"userProperties"` + // Type - Possible values include: 'TypeActivity', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLUpdateResource', 'TypeAzureMLBatchExecution', 'TypeGetMetadata', 'TypeWebActivity', 'TypeLookup', 'TypeSQLServerStoredProcedure', 'TypeCustom', 'TypeExecuteSSISPackage', 'TypeHDInsightSpark', 'TypeHDInsightStreaming', 'TypeHDInsightMapReduce', 'TypeHDInsightPig', 'TypeHDInsightHive', 'TypeCopy', 'TypeExecution', 'TypeFilter', 'TypeUntil', 'TypeWait', 'TypeForEach', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' + Type TypeBasicActivity `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for WaitActivity. +func (wa WaitActivity) MarshalJSON() ([]byte, error) { + wa.Type = TypeWait + objectMap := make(map[string]interface{}) + if wa.WaitActivityTypeProperties != nil { + objectMap["typeProperties"] = wa.WaitActivityTypeProperties + } + if wa.Name != nil { + objectMap["name"] = wa.Name + } + if wa.Description != nil { + objectMap["description"] = wa.Description + } + if wa.DependsOn != nil { + objectMap["dependsOn"] = wa.DependsOn + } + if wa.UserProperties != nil { + objectMap["userProperties"] = wa.UserProperties + } + if wa.Type != "" { + objectMap["type"] = wa.Type + } + for k, v := range wa.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsDatabricksNotebookActivity is the BasicActivity implementation for WaitActivity. +func (wa WaitActivity) AsDatabricksNotebookActivity() (*DatabricksNotebookActivity, bool) { + return nil, false +} + +// AsDataLakeAnalyticsUSQLActivity is the BasicActivity implementation for WaitActivity. +func (wa WaitActivity) AsDataLakeAnalyticsUSQLActivity() (*DataLakeAnalyticsUSQLActivity, bool) { + return nil, false +} + +// AsAzureMLUpdateResourceActivity is the BasicActivity implementation for WaitActivity. +func (wa WaitActivity) AsAzureMLUpdateResourceActivity() (*AzureMLUpdateResourceActivity, bool) { + return nil, false +} + +// AsAzureMLBatchExecutionActivity is the BasicActivity implementation for WaitActivity. +func (wa WaitActivity) AsAzureMLBatchExecutionActivity() (*AzureMLBatchExecutionActivity, bool) { + return nil, false +} + +// AsGetMetadataActivity is the BasicActivity implementation for WaitActivity. +func (wa WaitActivity) AsGetMetadataActivity() (*GetMetadataActivity, bool) { + return nil, false +} + +// AsWebActivity is the BasicActivity implementation for WaitActivity. +func (wa WaitActivity) AsWebActivity() (*WebActivity, bool) { + return nil, false +} + +// AsLookupActivity is the BasicActivity implementation for WaitActivity. +func (wa WaitActivity) AsLookupActivity() (*LookupActivity, bool) { + return nil, false +} + +// AsSQLServerStoredProcedureActivity is the BasicActivity implementation for WaitActivity. +func (wa WaitActivity) AsSQLServerStoredProcedureActivity() (*SQLServerStoredProcedureActivity, bool) { + return nil, false +} + +// AsCustomActivity is the BasicActivity implementation for WaitActivity. +func (wa WaitActivity) AsCustomActivity() (*CustomActivity, bool) { + return nil, false +} + +// AsExecuteSSISPackageActivity is the BasicActivity implementation for WaitActivity. +func (wa WaitActivity) AsExecuteSSISPackageActivity() (*ExecuteSSISPackageActivity, bool) { + return nil, false +} + +// AsHDInsightSparkActivity is the BasicActivity implementation for WaitActivity. +func (wa WaitActivity) AsHDInsightSparkActivity() (*HDInsightSparkActivity, bool) { + return nil, false +} + +// AsHDInsightStreamingActivity is the BasicActivity implementation for WaitActivity. +func (wa WaitActivity) AsHDInsightStreamingActivity() (*HDInsightStreamingActivity, bool) { + return nil, false +} + +// AsHDInsightMapReduceActivity is the BasicActivity implementation for WaitActivity. +func (wa WaitActivity) AsHDInsightMapReduceActivity() (*HDInsightMapReduceActivity, bool) { + return nil, false +} + +// AsHDInsightPigActivity is the BasicActivity implementation for WaitActivity. +func (wa WaitActivity) AsHDInsightPigActivity() (*HDInsightPigActivity, bool) { + return nil, false +} + +// AsHDInsightHiveActivity is the BasicActivity implementation for WaitActivity. +func (wa WaitActivity) AsHDInsightHiveActivity() (*HDInsightHiveActivity, bool) { + return nil, false +} + +// AsCopyActivity is the BasicActivity implementation for WaitActivity. +func (wa WaitActivity) AsCopyActivity() (*CopyActivity, bool) { + return nil, false +} + +// AsExecutionActivity is the BasicActivity implementation for WaitActivity. +func (wa WaitActivity) AsExecutionActivity() (*ExecutionActivity, bool) { + return nil, false +} + +// AsBasicExecutionActivity is the BasicActivity implementation for WaitActivity. +func (wa WaitActivity) AsBasicExecutionActivity() (BasicExecutionActivity, bool) { + return nil, false +} + +// AsFilterActivity is the BasicActivity implementation for WaitActivity. +func (wa WaitActivity) AsFilterActivity() (*FilterActivity, bool) { + return nil, false +} + +// AsUntilActivity is the BasicActivity implementation for WaitActivity. +func (wa WaitActivity) AsUntilActivity() (*UntilActivity, bool) { + return nil, false +} + +// AsWaitActivity is the BasicActivity implementation for WaitActivity. +func (wa WaitActivity) AsWaitActivity() (*WaitActivity, bool) { + return &wa, true +} + +// AsForEachActivity is the BasicActivity implementation for WaitActivity. +func (wa WaitActivity) AsForEachActivity() (*ForEachActivity, bool) { + return nil, false +} + +// AsIfConditionActivity is the BasicActivity implementation for WaitActivity. +func (wa WaitActivity) AsIfConditionActivity() (*IfConditionActivity, bool) { + return nil, false +} + +// AsExecutePipelineActivity is the BasicActivity implementation for WaitActivity. +func (wa WaitActivity) AsExecutePipelineActivity() (*ExecutePipelineActivity, bool) { + return nil, false +} + +// AsControlActivity is the BasicActivity implementation for WaitActivity. +func (wa WaitActivity) AsControlActivity() (*ControlActivity, bool) { + return nil, false +} + +// AsBasicControlActivity is the BasicActivity implementation for WaitActivity. +func (wa WaitActivity) AsBasicControlActivity() (BasicControlActivity, bool) { + return &wa, true +} + +// AsActivity is the BasicActivity implementation for WaitActivity. +func (wa WaitActivity) AsActivity() (*Activity, bool) { + return nil, false +} + +// AsBasicActivity is the BasicActivity implementation for WaitActivity. +func (wa WaitActivity) AsBasicActivity() (BasicActivity, bool) { + return &wa, true +} + +// UnmarshalJSON is the custom unmarshaler for WaitActivity struct. +func (wa *WaitActivity) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "typeProperties": + if v != nil { + var waitActivityTypeProperties WaitActivityTypeProperties + err = json.Unmarshal(*v, &waitActivityTypeProperties) + if err != nil { + return err + } + wa.WaitActivityTypeProperties = &waitActivityTypeProperties + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if wa.AdditionalProperties == nil { + wa.AdditionalProperties = make(map[string]interface{}) + } + wa.AdditionalProperties[k] = additionalProperties + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + wa.Name = &name + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + wa.Description = &description + } + case "dependsOn": + if v != nil { + var dependsOn []ActivityDependency + err = json.Unmarshal(*v, &dependsOn) + if err != nil { + return err + } + wa.DependsOn = &dependsOn + } + case "userProperties": + if v != nil { + var userProperties map[string]*string + err = json.Unmarshal(*v, &userProperties) + if err != nil { + return err + } + wa.UserProperties = userProperties + } + case "type": + if v != nil { + var typeVar TypeBasicActivity + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + wa.Type = typeVar + } + } + } + + return nil +} + +// WaitActivityTypeProperties wait activity properties. +type WaitActivityTypeProperties struct { + // WaitTimeInSeconds - Duration in seconds. + WaitTimeInSeconds *int32 `json:"waitTimeInSeconds,omitempty"` +} + +// WebActivity web activity. +type WebActivity struct { + // WebActivityTypeProperties - Web activity properties. + *WebActivityTypeProperties `json:"typeProperties,omitempty"` + // LinkedServiceName - Linked service reference. + LinkedServiceName *LinkedServiceReference `json:"linkedServiceName,omitempty"` + // Policy - Activity policy. + Policy *ActivityPolicy `json:"policy,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Name - Activity name. + Name *string `json:"name,omitempty"` + // Description - Activity description. + Description *string `json:"description,omitempty"` + // DependsOn - Activity depends on condition. + DependsOn *[]ActivityDependency `json:"dependsOn,omitempty"` + // UserProperties - Activity user properties. + UserProperties map[string]*string `json:"userProperties"` + // Type - Possible values include: 'TypeActivity', 'TypeDatabricksNotebook', 'TypeDataLakeAnalyticsUSQL', 'TypeAzureMLUpdateResource', 'TypeAzureMLBatchExecution', 'TypeGetMetadata', 'TypeWebActivity', 'TypeLookup', 'TypeSQLServerStoredProcedure', 'TypeCustom', 'TypeExecuteSSISPackage', 'TypeHDInsightSpark', 'TypeHDInsightStreaming', 'TypeHDInsightMapReduce', 'TypeHDInsightPig', 'TypeHDInsightHive', 'TypeCopy', 'TypeExecution', 'TypeFilter', 'TypeUntil', 'TypeWait', 'TypeForEach', 'TypeIfCondition', 'TypeExecutePipeline', 'TypeContainer' + Type TypeBasicActivity `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for WebActivity. +func (wa WebActivity) MarshalJSON() ([]byte, error) { + wa.Type = TypeWebActivity + objectMap := make(map[string]interface{}) + if wa.WebActivityTypeProperties != nil { + objectMap["typeProperties"] = wa.WebActivityTypeProperties + } + if wa.LinkedServiceName != nil { + objectMap["linkedServiceName"] = wa.LinkedServiceName + } + if wa.Policy != nil { + objectMap["policy"] = wa.Policy + } + if wa.Name != nil { + objectMap["name"] = wa.Name + } + if wa.Description != nil { + objectMap["description"] = wa.Description + } + if wa.DependsOn != nil { + objectMap["dependsOn"] = wa.DependsOn + } + if wa.UserProperties != nil { + objectMap["userProperties"] = wa.UserProperties + } + if wa.Type != "" { + objectMap["type"] = wa.Type + } + for k, v := range wa.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsDatabricksNotebookActivity is the BasicActivity implementation for WebActivity. +func (wa WebActivity) AsDatabricksNotebookActivity() (*DatabricksNotebookActivity, bool) { + return nil, false +} + +// AsDataLakeAnalyticsUSQLActivity is the BasicActivity implementation for WebActivity. +func (wa WebActivity) AsDataLakeAnalyticsUSQLActivity() (*DataLakeAnalyticsUSQLActivity, bool) { + return nil, false +} + +// AsAzureMLUpdateResourceActivity is the BasicActivity implementation for WebActivity. +func (wa WebActivity) AsAzureMLUpdateResourceActivity() (*AzureMLUpdateResourceActivity, bool) { + return nil, false +} + +// AsAzureMLBatchExecutionActivity is the BasicActivity implementation for WebActivity. +func (wa WebActivity) AsAzureMLBatchExecutionActivity() (*AzureMLBatchExecutionActivity, bool) { + return nil, false +} + +// AsGetMetadataActivity is the BasicActivity implementation for WebActivity. +func (wa WebActivity) AsGetMetadataActivity() (*GetMetadataActivity, bool) { + return nil, false +} + +// AsWebActivity is the BasicActivity implementation for WebActivity. +func (wa WebActivity) AsWebActivity() (*WebActivity, bool) { + return &wa, true +} + +// AsLookupActivity is the BasicActivity implementation for WebActivity. +func (wa WebActivity) AsLookupActivity() (*LookupActivity, bool) { + return nil, false +} + +// AsSQLServerStoredProcedureActivity is the BasicActivity implementation for WebActivity. +func (wa WebActivity) AsSQLServerStoredProcedureActivity() (*SQLServerStoredProcedureActivity, bool) { + return nil, false +} + +// AsCustomActivity is the BasicActivity implementation for WebActivity. +func (wa WebActivity) AsCustomActivity() (*CustomActivity, bool) { + return nil, false +} + +// AsExecuteSSISPackageActivity is the BasicActivity implementation for WebActivity. +func (wa WebActivity) AsExecuteSSISPackageActivity() (*ExecuteSSISPackageActivity, bool) { + return nil, false +} + +// AsHDInsightSparkActivity is the BasicActivity implementation for WebActivity. +func (wa WebActivity) AsHDInsightSparkActivity() (*HDInsightSparkActivity, bool) { + return nil, false +} + +// AsHDInsightStreamingActivity is the BasicActivity implementation for WebActivity. +func (wa WebActivity) AsHDInsightStreamingActivity() (*HDInsightStreamingActivity, bool) { + return nil, false +} + +// AsHDInsightMapReduceActivity is the BasicActivity implementation for WebActivity. +func (wa WebActivity) AsHDInsightMapReduceActivity() (*HDInsightMapReduceActivity, bool) { + return nil, false +} + +// AsHDInsightPigActivity is the BasicActivity implementation for WebActivity. +func (wa WebActivity) AsHDInsightPigActivity() (*HDInsightPigActivity, bool) { + return nil, false +} + +// AsHDInsightHiveActivity is the BasicActivity implementation for WebActivity. +func (wa WebActivity) AsHDInsightHiveActivity() (*HDInsightHiveActivity, bool) { + return nil, false +} + +// AsCopyActivity is the BasicActivity implementation for WebActivity. +func (wa WebActivity) AsCopyActivity() (*CopyActivity, bool) { + return nil, false +} + +// AsExecutionActivity is the BasicActivity implementation for WebActivity. +func (wa WebActivity) AsExecutionActivity() (*ExecutionActivity, bool) { + return nil, false +} + +// AsBasicExecutionActivity is the BasicActivity implementation for WebActivity. +func (wa WebActivity) AsBasicExecutionActivity() (BasicExecutionActivity, bool) { + return &wa, true +} + +// AsFilterActivity is the BasicActivity implementation for WebActivity. +func (wa WebActivity) AsFilterActivity() (*FilterActivity, bool) { + return nil, false +} + +// AsUntilActivity is the BasicActivity implementation for WebActivity. +func (wa WebActivity) AsUntilActivity() (*UntilActivity, bool) { + return nil, false +} + +// AsWaitActivity is the BasicActivity implementation for WebActivity. +func (wa WebActivity) AsWaitActivity() (*WaitActivity, bool) { + return nil, false +} + +// AsForEachActivity is the BasicActivity implementation for WebActivity. +func (wa WebActivity) AsForEachActivity() (*ForEachActivity, bool) { + return nil, false +} + +// AsIfConditionActivity is the BasicActivity implementation for WebActivity. +func (wa WebActivity) AsIfConditionActivity() (*IfConditionActivity, bool) { + return nil, false +} + +// AsExecutePipelineActivity is the BasicActivity implementation for WebActivity. +func (wa WebActivity) AsExecutePipelineActivity() (*ExecutePipelineActivity, bool) { + return nil, false +} + +// AsControlActivity is the BasicActivity implementation for WebActivity. +func (wa WebActivity) AsControlActivity() (*ControlActivity, bool) { + return nil, false +} + +// AsBasicControlActivity is the BasicActivity implementation for WebActivity. +func (wa WebActivity) AsBasicControlActivity() (BasicControlActivity, bool) { + return nil, false +} + +// AsActivity is the BasicActivity implementation for WebActivity. +func (wa WebActivity) AsActivity() (*Activity, bool) { + return nil, false +} + +// AsBasicActivity is the BasicActivity implementation for WebActivity. +func (wa WebActivity) AsBasicActivity() (BasicActivity, bool) { + return &wa, true +} + +// UnmarshalJSON is the custom unmarshaler for WebActivity struct. +func (wa *WebActivity) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "typeProperties": + if v != nil { + var webActivityTypeProperties WebActivityTypeProperties + err = json.Unmarshal(*v, &webActivityTypeProperties) + if err != nil { + return err + } + wa.WebActivityTypeProperties = &webActivityTypeProperties + } + case "linkedServiceName": + if v != nil { + var linkedServiceName LinkedServiceReference + err = json.Unmarshal(*v, &linkedServiceName) + if err != nil { + return err + } + wa.LinkedServiceName = &linkedServiceName + } + case "policy": + if v != nil { + var policy ActivityPolicy + err = json.Unmarshal(*v, &policy) + if err != nil { + return err + } + wa.Policy = &policy + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if wa.AdditionalProperties == nil { + wa.AdditionalProperties = make(map[string]interface{}) + } + wa.AdditionalProperties[k] = additionalProperties + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + wa.Name = &name + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + wa.Description = &description + } + case "dependsOn": + if v != nil { + var dependsOn []ActivityDependency + err = json.Unmarshal(*v, &dependsOn) + if err != nil { + return err + } + wa.DependsOn = &dependsOn + } + case "userProperties": + if v != nil { + var userProperties map[string]*string + err = json.Unmarshal(*v, &userProperties) + if err != nil { + return err + } + wa.UserProperties = userProperties + } + case "type": + if v != nil { + var typeVar TypeBasicActivity + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + wa.Type = typeVar + } + } + } + + return nil +} + +// WebActivityAuthentication web activity authentication properties. +type WebActivityAuthentication struct { + // Type - Web activity authentication (Basic/ClientCertificate/MSI) + Type *string `json:"type,omitempty"` + // Pfx - Base64-encoded contents of a PFX file. + Pfx *SecureString `json:"pfx,omitempty"` + // Username - Web activity authentication user name for basic authentication. + Username *string `json:"username,omitempty"` + // Password - Password for the PFX file or basic authentication. + Password *SecureString `json:"password,omitempty"` + // Resource - Resource for which Azure Auth token will be requested when using MSI Authentication. + Resource *string `json:"resource,omitempty"` +} + +// WebActivityTypeProperties web activity type properties. +type WebActivityTypeProperties struct { + // Method - Rest API method for target endpoint. Possible values include: 'GET', 'POST', 'PUT', 'DELETE' + Method WebActivityMethod `json:"method,omitempty"` + // URL - Web activity target endpoint and path. Type: string (or Expression with resultType string). + URL interface{} `json:"url,omitempty"` + // Headers - Represents the headers that will be sent to the request. For example, to set the language and type on a request: "headers" : { "Accept-Language": "en-us", "Content-Type": "application/json" }. Type: string (or Expression with resultType string). + Headers interface{} `json:"headers,omitempty"` + // Body - Represents the payload that will be sent to the endpoint. Required for POST/PUT method, not allowed for GET method Type: string (or Expression with resultType string). + Body interface{} `json:"body,omitempty"` + // Authentication - Authentication method used for calling the endpoint. + Authentication *WebActivityAuthentication `json:"authentication,omitempty"` + // Datasets - List of datasets passed to web endpoint. + Datasets *[]DatasetReference `json:"datasets,omitempty"` + // LinkedServices - List of linked services passed to web endpoint. + LinkedServices *[]LinkedServiceReference `json:"linkedServices,omitempty"` +} + +// WebAnonymousAuthentication a WebLinkedService that uses anonymous authentication to communicate with an HTTP +// endpoint. +type WebAnonymousAuthentication struct { + // URL - The URL of the web service endpoint, e.g. http://www.microsoft.com . Type: string (or Expression with resultType string). + URL interface{} `json:"url,omitempty"` + // AuthenticationType - Possible values include: 'AuthenticationTypeWebLinkedServiceTypeProperties', 'AuthenticationTypeClientCertificate', 'AuthenticationTypeBasic', 'AuthenticationTypeAnonymous' + AuthenticationType AuthenticationType `json:"authenticationType,omitempty"` +} + +// MarshalJSON is the custom marshaler for WebAnonymousAuthentication. +func (waa WebAnonymousAuthentication) MarshalJSON() ([]byte, error) { + waa.AuthenticationType = AuthenticationTypeAnonymous + objectMap := make(map[string]interface{}) + objectMap["url"] = waa.URL + if waa.AuthenticationType != "" { + objectMap["authenticationType"] = waa.AuthenticationType + } + return json.Marshal(objectMap) +} + +// AsWebClientCertificateAuthentication is the BasicWebLinkedServiceTypeProperties implementation for WebAnonymousAuthentication. +func (waa WebAnonymousAuthentication) AsWebClientCertificateAuthentication() (*WebClientCertificateAuthentication, bool) { + return nil, false +} + +// AsWebBasicAuthentication is the BasicWebLinkedServiceTypeProperties implementation for WebAnonymousAuthentication. +func (waa WebAnonymousAuthentication) AsWebBasicAuthentication() (*WebBasicAuthentication, bool) { + return nil, false +} + +// AsWebAnonymousAuthentication is the BasicWebLinkedServiceTypeProperties implementation for WebAnonymousAuthentication. +func (waa WebAnonymousAuthentication) AsWebAnonymousAuthentication() (*WebAnonymousAuthentication, bool) { + return &waa, true +} + +// AsWebLinkedServiceTypeProperties is the BasicWebLinkedServiceTypeProperties implementation for WebAnonymousAuthentication. +func (waa WebAnonymousAuthentication) AsWebLinkedServiceTypeProperties() (*WebLinkedServiceTypeProperties, bool) { + return nil, false +} + +// AsBasicWebLinkedServiceTypeProperties is the BasicWebLinkedServiceTypeProperties implementation for WebAnonymousAuthentication. +func (waa WebAnonymousAuthentication) AsBasicWebLinkedServiceTypeProperties() (BasicWebLinkedServiceTypeProperties, bool) { + return &waa, true +} + +// WebBasicAuthentication a WebLinkedService that uses basic authentication to communicate with an HTTP endpoint. +type WebBasicAuthentication struct { + // Username - User name for Basic authentication. Type: string (or Expression with resultType string). + Username interface{} `json:"username,omitempty"` + // Password - The password for Basic authentication. + Password BasicSecretBase `json:"password,omitempty"` + // URL - The URL of the web service endpoint, e.g. http://www.microsoft.com . Type: string (or Expression with resultType string). + URL interface{} `json:"url,omitempty"` + // AuthenticationType - Possible values include: 'AuthenticationTypeWebLinkedServiceTypeProperties', 'AuthenticationTypeClientCertificate', 'AuthenticationTypeBasic', 'AuthenticationTypeAnonymous' + AuthenticationType AuthenticationType `json:"authenticationType,omitempty"` +} + +// MarshalJSON is the custom marshaler for WebBasicAuthentication. +func (wba WebBasicAuthentication) MarshalJSON() ([]byte, error) { + wba.AuthenticationType = AuthenticationTypeBasic + objectMap := make(map[string]interface{}) + objectMap["username"] = wba.Username + objectMap["password"] = wba.Password + objectMap["url"] = wba.URL + if wba.AuthenticationType != "" { + objectMap["authenticationType"] = wba.AuthenticationType + } + return json.Marshal(objectMap) +} + +// AsWebClientCertificateAuthentication is the BasicWebLinkedServiceTypeProperties implementation for WebBasicAuthentication. +func (wba WebBasicAuthentication) AsWebClientCertificateAuthentication() (*WebClientCertificateAuthentication, bool) { + return nil, false +} + +// AsWebBasicAuthentication is the BasicWebLinkedServiceTypeProperties implementation for WebBasicAuthentication. +func (wba WebBasicAuthentication) AsWebBasicAuthentication() (*WebBasicAuthentication, bool) { + return &wba, true +} + +// AsWebAnonymousAuthentication is the BasicWebLinkedServiceTypeProperties implementation for WebBasicAuthentication. +func (wba WebBasicAuthentication) AsWebAnonymousAuthentication() (*WebAnonymousAuthentication, bool) { + return nil, false +} + +// AsWebLinkedServiceTypeProperties is the BasicWebLinkedServiceTypeProperties implementation for WebBasicAuthentication. +func (wba WebBasicAuthentication) AsWebLinkedServiceTypeProperties() (*WebLinkedServiceTypeProperties, bool) { + return nil, false +} + +// AsBasicWebLinkedServiceTypeProperties is the BasicWebLinkedServiceTypeProperties implementation for WebBasicAuthentication. +func (wba WebBasicAuthentication) AsBasicWebLinkedServiceTypeProperties() (BasicWebLinkedServiceTypeProperties, bool) { + return &wba, true +} + +// UnmarshalJSON is the custom unmarshaler for WebBasicAuthentication struct. +func (wba *WebBasicAuthentication) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "username": + if v != nil { + var username interface{} + err = json.Unmarshal(*v, &username) + if err != nil { + return err + } + wba.Username = username + } + case "password": + if v != nil { + password, err := unmarshalBasicSecretBase(*v) + if err != nil { + return err + } + wba.Password = password + } + case "url": + if v != nil { + var URL interface{} + err = json.Unmarshal(*v, &URL) + if err != nil { + return err + } + wba.URL = URL + } + case "authenticationType": + if v != nil { + var authenticationType AuthenticationType + err = json.Unmarshal(*v, &authenticationType) + if err != nil { + return err + } + wba.AuthenticationType = authenticationType + } + } + } + + return nil +} + +// WebClientCertificateAuthentication a WebLinkedService that uses client certificate based authentication to +// communicate with an HTTP endpoint. This scheme follows mutual authentication; the server must also provide valid +// credentials to the client. +type WebClientCertificateAuthentication struct { + // Pfx - Base64-encoded contents of a PFX file. + Pfx BasicSecretBase `json:"pfx,omitempty"` + // Password - Password for the PFX file. + Password BasicSecretBase `json:"password,omitempty"` + // URL - The URL of the web service endpoint, e.g. http://www.microsoft.com . Type: string (or Expression with resultType string). + URL interface{} `json:"url,omitempty"` + // AuthenticationType - Possible values include: 'AuthenticationTypeWebLinkedServiceTypeProperties', 'AuthenticationTypeClientCertificate', 'AuthenticationTypeBasic', 'AuthenticationTypeAnonymous' + AuthenticationType AuthenticationType `json:"authenticationType,omitempty"` +} + +// MarshalJSON is the custom marshaler for WebClientCertificateAuthentication. +func (wcca WebClientCertificateAuthentication) MarshalJSON() ([]byte, error) { + wcca.AuthenticationType = AuthenticationTypeClientCertificate + objectMap := make(map[string]interface{}) + objectMap["pfx"] = wcca.Pfx + objectMap["password"] = wcca.Password + objectMap["url"] = wcca.URL + if wcca.AuthenticationType != "" { + objectMap["authenticationType"] = wcca.AuthenticationType + } + return json.Marshal(objectMap) +} + +// AsWebClientCertificateAuthentication is the BasicWebLinkedServiceTypeProperties implementation for WebClientCertificateAuthentication. +func (wcca WebClientCertificateAuthentication) AsWebClientCertificateAuthentication() (*WebClientCertificateAuthentication, bool) { + return &wcca, true +} + +// AsWebBasicAuthentication is the BasicWebLinkedServiceTypeProperties implementation for WebClientCertificateAuthentication. +func (wcca WebClientCertificateAuthentication) AsWebBasicAuthentication() (*WebBasicAuthentication, bool) { + return nil, false +} + +// AsWebAnonymousAuthentication is the BasicWebLinkedServiceTypeProperties implementation for WebClientCertificateAuthentication. +func (wcca WebClientCertificateAuthentication) AsWebAnonymousAuthentication() (*WebAnonymousAuthentication, bool) { + return nil, false +} + +// AsWebLinkedServiceTypeProperties is the BasicWebLinkedServiceTypeProperties implementation for WebClientCertificateAuthentication. +func (wcca WebClientCertificateAuthentication) AsWebLinkedServiceTypeProperties() (*WebLinkedServiceTypeProperties, bool) { + return nil, false +} + +// AsBasicWebLinkedServiceTypeProperties is the BasicWebLinkedServiceTypeProperties implementation for WebClientCertificateAuthentication. +func (wcca WebClientCertificateAuthentication) AsBasicWebLinkedServiceTypeProperties() (BasicWebLinkedServiceTypeProperties, bool) { + return &wcca, true +} + +// UnmarshalJSON is the custom unmarshaler for WebClientCertificateAuthentication struct. +func (wcca *WebClientCertificateAuthentication) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "pfx": + if v != nil { + pfx, err := unmarshalBasicSecretBase(*v) + if err != nil { + return err + } + wcca.Pfx = pfx + } + case "password": + if v != nil { + password, err := unmarshalBasicSecretBase(*v) + if err != nil { + return err + } + wcca.Password = password + } + case "url": + if v != nil { + var URL interface{} + err = json.Unmarshal(*v, &URL) + if err != nil { + return err + } + wcca.URL = URL + } + case "authenticationType": + if v != nil { + var authenticationType AuthenticationType + err = json.Unmarshal(*v, &authenticationType) + if err != nil { + return err + } + wcca.AuthenticationType = authenticationType + } + } + } + + return nil +} + +// WebLinkedService web linked service. +type WebLinkedService struct { + // TypeProperties - Web linked service properties. + TypeProperties BasicWebLinkedServiceTypeProperties `json:"typeProperties,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // ConnectVia - The integration runtime reference. + ConnectVia *IntegrationRuntimeReference `json:"connectVia,omitempty"` + // Description - Linked service description. + Description *string `json:"description,omitempty"` + // Parameters - Parameters for linked service. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeLinkedService', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforce', 'TypeAzureDataLakeStore', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureStorage' + Type TypeBasicLinkedService `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for WebLinkedService. +func (wls WebLinkedService) MarshalJSON() ([]byte, error) { + wls.Type = TypeWeb + objectMap := make(map[string]interface{}) + objectMap["typeProperties"] = wls.TypeProperties + if wls.ConnectVia != nil { + objectMap["connectVia"] = wls.ConnectVia + } + if wls.Description != nil { + objectMap["description"] = wls.Description + } + if wls.Parameters != nil { + objectMap["parameters"] = wls.Parameters + } + if wls.Annotations != nil { + objectMap["annotations"] = wls.Annotations + } + if wls.Type != "" { + objectMap["type"] = wls.Type + } + for k, v := range wls.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysLinkedService is the BasicLinkedService implementation for WebLinkedService. +func (wls WebLinkedService) AsResponsysLinkedService() (*ResponsysLinkedService, bool) { + return nil, false +} + +// AsAzureDatabricksLinkedService is the BasicLinkedService implementation for WebLinkedService. +func (wls WebLinkedService) AsAzureDatabricksLinkedService() (*AzureDatabricksLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeAnalyticsLinkedService is the BasicLinkedService implementation for WebLinkedService. +func (wls WebLinkedService) AsAzureDataLakeAnalyticsLinkedService() (*AzureDataLakeAnalyticsLinkedService, bool) { + return nil, false +} + +// AsHDInsightOnDemandLinkedService is the BasicLinkedService implementation for WebLinkedService. +func (wls WebLinkedService) AsHDInsightOnDemandLinkedService() (*HDInsightOnDemandLinkedService, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudLinkedService is the BasicLinkedService implementation for WebLinkedService. +func (wls WebLinkedService) AsSalesforceMarketingCloudLinkedService() (*SalesforceMarketingCloudLinkedService, bool) { + return nil, false +} + +// AsNetezzaLinkedService is the BasicLinkedService implementation for WebLinkedService. +func (wls WebLinkedService) AsNetezzaLinkedService() (*NetezzaLinkedService, bool) { + return nil, false +} + +// AsVerticaLinkedService is the BasicLinkedService implementation for WebLinkedService. +func (wls WebLinkedService) AsVerticaLinkedService() (*VerticaLinkedService, bool) { + return nil, false +} + +// AsZohoLinkedService is the BasicLinkedService implementation for WebLinkedService. +func (wls WebLinkedService) AsZohoLinkedService() (*ZohoLinkedService, bool) { + return nil, false +} + +// AsXeroLinkedService is the BasicLinkedService implementation for WebLinkedService. +func (wls WebLinkedService) AsXeroLinkedService() (*XeroLinkedService, bool) { + return nil, false +} + +// AsSquareLinkedService is the BasicLinkedService implementation for WebLinkedService. +func (wls WebLinkedService) AsSquareLinkedService() (*SquareLinkedService, bool) { + return nil, false +} + +// AsSparkLinkedService is the BasicLinkedService implementation for WebLinkedService. +func (wls WebLinkedService) AsSparkLinkedService() (*SparkLinkedService, bool) { + return nil, false +} + +// AsShopifyLinkedService is the BasicLinkedService implementation for WebLinkedService. +func (wls WebLinkedService) AsShopifyLinkedService() (*ShopifyLinkedService, bool) { + return nil, false +} + +// AsServiceNowLinkedService is the BasicLinkedService implementation for WebLinkedService. +func (wls WebLinkedService) AsServiceNowLinkedService() (*ServiceNowLinkedService, bool) { + return nil, false +} + +// AsQuickBooksLinkedService is the BasicLinkedService implementation for WebLinkedService. +func (wls WebLinkedService) AsQuickBooksLinkedService() (*QuickBooksLinkedService, bool) { + return nil, false +} + +// AsPrestoLinkedService is the BasicLinkedService implementation for WebLinkedService. +func (wls WebLinkedService) AsPrestoLinkedService() (*PrestoLinkedService, bool) { + return nil, false +} + +// AsPhoenixLinkedService is the BasicLinkedService implementation for WebLinkedService. +func (wls WebLinkedService) AsPhoenixLinkedService() (*PhoenixLinkedService, bool) { + return nil, false +} + +// AsPaypalLinkedService is the BasicLinkedService implementation for WebLinkedService. +func (wls WebLinkedService) AsPaypalLinkedService() (*PaypalLinkedService, bool) { + return nil, false +} + +// AsMarketoLinkedService is the BasicLinkedService implementation for WebLinkedService. +func (wls WebLinkedService) AsMarketoLinkedService() (*MarketoLinkedService, bool) { + return nil, false +} + +// AsMariaDBLinkedService is the BasicLinkedService implementation for WebLinkedService. +func (wls WebLinkedService) AsMariaDBLinkedService() (*MariaDBLinkedService, bool) { + return nil, false +} + +// AsMagentoLinkedService is the BasicLinkedService implementation for WebLinkedService. +func (wls WebLinkedService) AsMagentoLinkedService() (*MagentoLinkedService, bool) { + return nil, false +} + +// AsJiraLinkedService is the BasicLinkedService implementation for WebLinkedService. +func (wls WebLinkedService) AsJiraLinkedService() (*JiraLinkedService, bool) { + return nil, false +} + +// AsImpalaLinkedService is the BasicLinkedService implementation for WebLinkedService. +func (wls WebLinkedService) AsImpalaLinkedService() (*ImpalaLinkedService, bool) { + return nil, false +} + +// AsHubspotLinkedService is the BasicLinkedService implementation for WebLinkedService. +func (wls WebLinkedService) AsHubspotLinkedService() (*HubspotLinkedService, bool) { + return nil, false +} + +// AsHiveLinkedService is the BasicLinkedService implementation for WebLinkedService. +func (wls WebLinkedService) AsHiveLinkedService() (*HiveLinkedService, bool) { + return nil, false +} + +// AsHBaseLinkedService is the BasicLinkedService implementation for WebLinkedService. +func (wls WebLinkedService) AsHBaseLinkedService() (*HBaseLinkedService, bool) { + return nil, false +} + +// AsGreenplumLinkedService is the BasicLinkedService implementation for WebLinkedService. +func (wls WebLinkedService) AsGreenplumLinkedService() (*GreenplumLinkedService, bool) { + return nil, false +} + +// AsGoogleBigQueryLinkedService is the BasicLinkedService implementation for WebLinkedService. +func (wls WebLinkedService) AsGoogleBigQueryLinkedService() (*GoogleBigQueryLinkedService, bool) { + return nil, false +} + +// AsEloquaLinkedService is the BasicLinkedService implementation for WebLinkedService. +func (wls WebLinkedService) AsEloquaLinkedService() (*EloquaLinkedService, bool) { + return nil, false +} + +// AsDrillLinkedService is the BasicLinkedService implementation for WebLinkedService. +func (wls WebLinkedService) AsDrillLinkedService() (*DrillLinkedService, bool) { + return nil, false +} + +// AsCouchbaseLinkedService is the BasicLinkedService implementation for WebLinkedService. +func (wls WebLinkedService) AsCouchbaseLinkedService() (*CouchbaseLinkedService, bool) { + return nil, false +} + +// AsConcurLinkedService is the BasicLinkedService implementation for WebLinkedService. +func (wls WebLinkedService) AsConcurLinkedService() (*ConcurLinkedService, bool) { + return nil, false +} + +// AsAzurePostgreSQLLinkedService is the BasicLinkedService implementation for WebLinkedService. +func (wls WebLinkedService) AsAzurePostgreSQLLinkedService() (*AzurePostgreSQLLinkedService, bool) { + return nil, false +} + +// AsAmazonMWSLinkedService is the BasicLinkedService implementation for WebLinkedService. +func (wls WebLinkedService) AsAmazonMWSLinkedService() (*AmazonMWSLinkedService, bool) { + return nil, false +} + +// AsSapHanaLinkedService is the BasicLinkedService implementation for WebLinkedService. +func (wls WebLinkedService) AsSapHanaLinkedService() (*SapHanaLinkedService, bool) { + return nil, false +} + +// AsSapBWLinkedService is the BasicLinkedService implementation for WebLinkedService. +func (wls WebLinkedService) AsSapBWLinkedService() (*SapBWLinkedService, bool) { + return nil, false +} + +// AsSftpServerLinkedService is the BasicLinkedService implementation for WebLinkedService. +func (wls WebLinkedService) AsSftpServerLinkedService() (*SftpServerLinkedService, bool) { + return nil, false +} + +// AsFtpServerLinkedService is the BasicLinkedService implementation for WebLinkedService. +func (wls WebLinkedService) AsFtpServerLinkedService() (*FtpServerLinkedService, bool) { + return nil, false +} + +// AsHTTPLinkedService is the BasicLinkedService implementation for WebLinkedService. +func (wls WebLinkedService) AsHTTPLinkedService() (*HTTPLinkedService, bool) { + return nil, false +} + +// AsAzureSearchLinkedService is the BasicLinkedService implementation for WebLinkedService. +func (wls WebLinkedService) AsAzureSearchLinkedService() (*AzureSearchLinkedService, bool) { + return nil, false +} + +// AsCustomDataSourceLinkedService is the BasicLinkedService implementation for WebLinkedService. +func (wls WebLinkedService) AsCustomDataSourceLinkedService() (*CustomDataSourceLinkedService, bool) { + return nil, false +} + +// AsAmazonRedshiftLinkedService is the BasicLinkedService implementation for WebLinkedService. +func (wls WebLinkedService) AsAmazonRedshiftLinkedService() (*AmazonRedshiftLinkedService, bool) { + return nil, false +} + +// AsAmazonS3LinkedService is the BasicLinkedService implementation for WebLinkedService. +func (wls WebLinkedService) AsAmazonS3LinkedService() (*AmazonS3LinkedService, bool) { + return nil, false +} + +// AsSapEccLinkedService is the BasicLinkedService implementation for WebLinkedService. +func (wls WebLinkedService) AsSapEccLinkedService() (*SapEccLinkedService, bool) { + return nil, false +} + +// AsSapCloudForCustomerLinkedService is the BasicLinkedService implementation for WebLinkedService. +func (wls WebLinkedService) AsSapCloudForCustomerLinkedService() (*SapCloudForCustomerLinkedService, bool) { + return nil, false +} + +// AsSalesforceLinkedService is the BasicLinkedService implementation for WebLinkedService. +func (wls WebLinkedService) AsSalesforceLinkedService() (*SalesforceLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeStoreLinkedService is the BasicLinkedService implementation for WebLinkedService. +func (wls WebLinkedService) AsAzureDataLakeStoreLinkedService() (*AzureDataLakeStoreLinkedService, bool) { + return nil, false +} + +// AsMongoDbLinkedService is the BasicLinkedService implementation for WebLinkedService. +func (wls WebLinkedService) AsMongoDbLinkedService() (*MongoDbLinkedService, bool) { + return nil, false +} + +// AsCassandraLinkedService is the BasicLinkedService implementation for WebLinkedService. +func (wls WebLinkedService) AsCassandraLinkedService() (*CassandraLinkedService, bool) { + return nil, false +} + +// AsWebLinkedService is the BasicLinkedService implementation for WebLinkedService. +func (wls WebLinkedService) AsWebLinkedService() (*WebLinkedService, bool) { + return &wls, true +} + +// AsODataLinkedService is the BasicLinkedService implementation for WebLinkedService. +func (wls WebLinkedService) AsODataLinkedService() (*ODataLinkedService, bool) { + return nil, false +} + +// AsHdfsLinkedService is the BasicLinkedService implementation for WebLinkedService. +func (wls WebLinkedService) AsHdfsLinkedService() (*HdfsLinkedService, bool) { + return nil, false +} + +// AsOdbcLinkedService is the BasicLinkedService implementation for WebLinkedService. +func (wls WebLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, bool) { + return nil, false +} + +// AsAzureMLLinkedService is the BasicLinkedService implementation for WebLinkedService. +func (wls WebLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { + return nil, false +} + +// AsTeradataLinkedService is the BasicLinkedService implementation for WebLinkedService. +func (wls WebLinkedService) AsTeradataLinkedService() (*TeradataLinkedService, bool) { + return nil, false +} + +// AsDb2LinkedService is the BasicLinkedService implementation for WebLinkedService. +func (wls WebLinkedService) AsDb2LinkedService() (*Db2LinkedService, bool) { + return nil, false +} + +// AsSybaseLinkedService is the BasicLinkedService implementation for WebLinkedService. +func (wls WebLinkedService) AsSybaseLinkedService() (*SybaseLinkedService, bool) { + return nil, false +} + +// AsPostgreSQLLinkedService is the BasicLinkedService implementation for WebLinkedService. +func (wls WebLinkedService) AsPostgreSQLLinkedService() (*PostgreSQLLinkedService, bool) { + return nil, false +} + +// AsMySQLLinkedService is the BasicLinkedService implementation for WebLinkedService. +func (wls WebLinkedService) AsMySQLLinkedService() (*MySQLLinkedService, bool) { + return nil, false +} + +// AsAzureMySQLLinkedService is the BasicLinkedService implementation for WebLinkedService. +func (wls WebLinkedService) AsAzureMySQLLinkedService() (*AzureMySQLLinkedService, bool) { + return nil, false +} + +// AsOracleLinkedService is the BasicLinkedService implementation for WebLinkedService. +func (wls WebLinkedService) AsOracleLinkedService() (*OracleLinkedService, bool) { + return nil, false +} + +// AsFileServerLinkedService is the BasicLinkedService implementation for WebLinkedService. +func (wls WebLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { + return nil, false +} + +// AsHDInsightLinkedService is the BasicLinkedService implementation for WebLinkedService. +func (wls WebLinkedService) AsHDInsightLinkedService() (*HDInsightLinkedService, bool) { + return nil, false +} + +// AsDynamicsLinkedService is the BasicLinkedService implementation for WebLinkedService. +func (wls WebLinkedService) AsDynamicsLinkedService() (*DynamicsLinkedService, bool) { + return nil, false +} + +// AsCosmosDbLinkedService is the BasicLinkedService implementation for WebLinkedService. +func (wls WebLinkedService) AsCosmosDbLinkedService() (*CosmosDbLinkedService, bool) { + return nil, false +} + +// AsAzureKeyVaultLinkedService is the BasicLinkedService implementation for WebLinkedService. +func (wls WebLinkedService) AsAzureKeyVaultLinkedService() (*AzureKeyVaultLinkedService, bool) { + return nil, false +} + +// AsAzureBatchLinkedService is the BasicLinkedService implementation for WebLinkedService. +func (wls WebLinkedService) AsAzureBatchLinkedService() (*AzureBatchLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDatabaseLinkedService is the BasicLinkedService implementation for WebLinkedService. +func (wls WebLinkedService) AsAzureSQLDatabaseLinkedService() (*AzureSQLDatabaseLinkedService, bool) { + return nil, false +} + +// AsSQLServerLinkedService is the BasicLinkedService implementation for WebLinkedService. +func (wls WebLinkedService) AsSQLServerLinkedService() (*SQLServerLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDWLinkedService is the BasicLinkedService implementation for WebLinkedService. +func (wls WebLinkedService) AsAzureSQLDWLinkedService() (*AzureSQLDWLinkedService, bool) { + return nil, false +} + +// AsAzureStorageLinkedService is the BasicLinkedService implementation for WebLinkedService. +func (wls WebLinkedService) AsAzureStorageLinkedService() (*AzureStorageLinkedService, bool) { + return nil, false +} + +// AsLinkedService is the BasicLinkedService implementation for WebLinkedService. +func (wls WebLinkedService) AsLinkedService() (*LinkedService, bool) { + return nil, false +} + +// AsBasicLinkedService is the BasicLinkedService implementation for WebLinkedService. +func (wls WebLinkedService) AsBasicLinkedService() (BasicLinkedService, bool) { + return &wls, true +} + +// UnmarshalJSON is the custom unmarshaler for WebLinkedService struct. +func (wls *WebLinkedService) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "typeProperties": + if v != nil { + typeProperties, err := unmarshalBasicWebLinkedServiceTypeProperties(*v) + if err != nil { + return err + } + wls.TypeProperties = typeProperties + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if wls.AdditionalProperties == nil { + wls.AdditionalProperties = make(map[string]interface{}) + } + wls.AdditionalProperties[k] = additionalProperties + } + case "connectVia": + if v != nil { + var connectVia IntegrationRuntimeReference + err = json.Unmarshal(*v, &connectVia) + if err != nil { + return err + } + wls.ConnectVia = &connectVia + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + wls.Description = &description + } + case "parameters": + if v != nil { + var parameters map[string]*ParameterSpecification + err = json.Unmarshal(*v, ¶meters) + if err != nil { + return err + } + wls.Parameters = parameters + } + case "annotations": + if v != nil { + var annotations []interface{} + err = json.Unmarshal(*v, &annotations) + if err != nil { + return err + } + wls.Annotations = &annotations + } + case "type": + if v != nil { + var typeVar TypeBasicLinkedService + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + wls.Type = typeVar + } + } + } + + return nil +} + +// BasicWebLinkedServiceTypeProperties base definition of WebLinkedServiceTypeProperties, this typeProperties is +// polymorphic based on authenticationType, so not flattened in SDK models. +type BasicWebLinkedServiceTypeProperties interface { + AsWebClientCertificateAuthentication() (*WebClientCertificateAuthentication, bool) + AsWebBasicAuthentication() (*WebBasicAuthentication, bool) + AsWebAnonymousAuthentication() (*WebAnonymousAuthentication, bool) + AsWebLinkedServiceTypeProperties() (*WebLinkedServiceTypeProperties, bool) +} + +// WebLinkedServiceTypeProperties base definition of WebLinkedServiceTypeProperties, this typeProperties is +// polymorphic based on authenticationType, so not flattened in SDK models. +type WebLinkedServiceTypeProperties struct { + // URL - The URL of the web service endpoint, e.g. http://www.microsoft.com . Type: string (or Expression with resultType string). + URL interface{} `json:"url,omitempty"` + // AuthenticationType - Possible values include: 'AuthenticationTypeWebLinkedServiceTypeProperties', 'AuthenticationTypeClientCertificate', 'AuthenticationTypeBasic', 'AuthenticationTypeAnonymous' + AuthenticationType AuthenticationType `json:"authenticationType,omitempty"` +} + +func unmarshalBasicWebLinkedServiceTypeProperties(body []byte) (BasicWebLinkedServiceTypeProperties, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["authenticationType"] { + case string(AuthenticationTypeClientCertificate): + var wcca WebClientCertificateAuthentication + err := json.Unmarshal(body, &wcca) + return wcca, err + case string(AuthenticationTypeBasic): + var wba WebBasicAuthentication + err := json.Unmarshal(body, &wba) + return wba, err + case string(AuthenticationTypeAnonymous): + var waa WebAnonymousAuthentication + err := json.Unmarshal(body, &waa) + return waa, err + default: + var wlstp WebLinkedServiceTypeProperties + err := json.Unmarshal(body, &wlstp) + return wlstp, err + } +} +func unmarshalBasicWebLinkedServiceTypePropertiesArray(body []byte) ([]BasicWebLinkedServiceTypeProperties, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + wlstpArray := make([]BasicWebLinkedServiceTypeProperties, len(rawMessages)) + + for index, rawMessage := range rawMessages { + wlstp, err := unmarshalBasicWebLinkedServiceTypeProperties(*rawMessage) + if err != nil { + return nil, err + } + wlstpArray[index] = wlstp + } + return wlstpArray, nil +} + +// MarshalJSON is the custom marshaler for WebLinkedServiceTypeProperties. +func (wlstp WebLinkedServiceTypeProperties) MarshalJSON() ([]byte, error) { + wlstp.AuthenticationType = AuthenticationTypeWebLinkedServiceTypeProperties + objectMap := make(map[string]interface{}) + objectMap["url"] = wlstp.URL + if wlstp.AuthenticationType != "" { + objectMap["authenticationType"] = wlstp.AuthenticationType + } + return json.Marshal(objectMap) +} + +// AsWebClientCertificateAuthentication is the BasicWebLinkedServiceTypeProperties implementation for WebLinkedServiceTypeProperties. +func (wlstp WebLinkedServiceTypeProperties) AsWebClientCertificateAuthentication() (*WebClientCertificateAuthentication, bool) { + return nil, false +} + +// AsWebBasicAuthentication is the BasicWebLinkedServiceTypeProperties implementation for WebLinkedServiceTypeProperties. +func (wlstp WebLinkedServiceTypeProperties) AsWebBasicAuthentication() (*WebBasicAuthentication, bool) { + return nil, false +} + +// AsWebAnonymousAuthentication is the BasicWebLinkedServiceTypeProperties implementation for WebLinkedServiceTypeProperties. +func (wlstp WebLinkedServiceTypeProperties) AsWebAnonymousAuthentication() (*WebAnonymousAuthentication, bool) { + return nil, false +} + +// AsWebLinkedServiceTypeProperties is the BasicWebLinkedServiceTypeProperties implementation for WebLinkedServiceTypeProperties. +func (wlstp WebLinkedServiceTypeProperties) AsWebLinkedServiceTypeProperties() (*WebLinkedServiceTypeProperties, bool) { + return &wlstp, true +} + +// AsBasicWebLinkedServiceTypeProperties is the BasicWebLinkedServiceTypeProperties implementation for WebLinkedServiceTypeProperties. +func (wlstp WebLinkedServiceTypeProperties) AsBasicWebLinkedServiceTypeProperties() (BasicWebLinkedServiceTypeProperties, bool) { + return &wlstp, true +} + +// WebSource a copy activity source for web page table. +type WebSource struct { + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // SourceRetryCount - Source retry count. Type: integer (or Expression with resultType integer). + SourceRetryCount interface{} `json:"sourceRetryCount,omitempty"` + // SourceRetryWait - Source retry wait. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` + // Type - Possible values include: 'TypeCopySource', 'TypeAmazonRedshiftSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeHTTPSource', 'TypeAzureDataLakeStoreSource', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeRelationalSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource' + Type TypeBasicCopySource `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for WebSource. +func (ws WebSource) MarshalJSON() ([]byte, error) { + ws.Type = TypeWebSource + objectMap := make(map[string]interface{}) + objectMap["sourceRetryCount"] = ws.SourceRetryCount + objectMap["sourceRetryWait"] = ws.SourceRetryWait + if ws.Type != "" { + objectMap["type"] = ws.Type + } + for k, v := range ws.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsAmazonRedshiftSource is the BasicCopySource implementation for WebSource. +func (ws WebSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { + return nil, false +} + +// AsResponsysSource is the BasicCopySource implementation for WebSource. +func (ws WebSource) AsResponsysSource() (*ResponsysSource, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudSource is the BasicCopySource implementation for WebSource. +func (ws WebSource) AsSalesforceMarketingCloudSource() (*SalesforceMarketingCloudSource, bool) { + return nil, false +} + +// AsVerticaSource is the BasicCopySource implementation for WebSource. +func (ws WebSource) AsVerticaSource() (*VerticaSource, bool) { + return nil, false +} + +// AsNetezzaSource is the BasicCopySource implementation for WebSource. +func (ws WebSource) AsNetezzaSource() (*NetezzaSource, bool) { + return nil, false +} + +// AsZohoSource is the BasicCopySource implementation for WebSource. +func (ws WebSource) AsZohoSource() (*ZohoSource, bool) { + return nil, false +} + +// AsXeroSource is the BasicCopySource implementation for WebSource. +func (ws WebSource) AsXeroSource() (*XeroSource, bool) { + return nil, false +} + +// AsSquareSource is the BasicCopySource implementation for WebSource. +func (ws WebSource) AsSquareSource() (*SquareSource, bool) { + return nil, false +} + +// AsSparkSource is the BasicCopySource implementation for WebSource. +func (ws WebSource) AsSparkSource() (*SparkSource, bool) { + return nil, false +} + +// AsShopifySource is the BasicCopySource implementation for WebSource. +func (ws WebSource) AsShopifySource() (*ShopifySource, bool) { + return nil, false +} + +// AsServiceNowSource is the BasicCopySource implementation for WebSource. +func (ws WebSource) AsServiceNowSource() (*ServiceNowSource, bool) { + return nil, false +} + +// AsQuickBooksSource is the BasicCopySource implementation for WebSource. +func (ws WebSource) AsQuickBooksSource() (*QuickBooksSource, bool) { + return nil, false +} + +// AsPrestoSource is the BasicCopySource implementation for WebSource. +func (ws WebSource) AsPrestoSource() (*PrestoSource, bool) { + return nil, false +} + +// AsPhoenixSource is the BasicCopySource implementation for WebSource. +func (ws WebSource) AsPhoenixSource() (*PhoenixSource, bool) { + return nil, false +} + +// AsPaypalSource is the BasicCopySource implementation for WebSource. +func (ws WebSource) AsPaypalSource() (*PaypalSource, bool) { + return nil, false +} + +// AsMarketoSource is the BasicCopySource implementation for WebSource. +func (ws WebSource) AsMarketoSource() (*MarketoSource, bool) { + return nil, false +} + +// AsMariaDBSource is the BasicCopySource implementation for WebSource. +func (ws WebSource) AsMariaDBSource() (*MariaDBSource, bool) { + return nil, false +} + +// AsMagentoSource is the BasicCopySource implementation for WebSource. +func (ws WebSource) AsMagentoSource() (*MagentoSource, bool) { + return nil, false +} + +// AsJiraSource is the BasicCopySource implementation for WebSource. +func (ws WebSource) AsJiraSource() (*JiraSource, bool) { + return nil, false +} + +// AsImpalaSource is the BasicCopySource implementation for WebSource. +func (ws WebSource) AsImpalaSource() (*ImpalaSource, bool) { + return nil, false +} + +// AsHubspotSource is the BasicCopySource implementation for WebSource. +func (ws WebSource) AsHubspotSource() (*HubspotSource, bool) { + return nil, false +} + +// AsHiveSource is the BasicCopySource implementation for WebSource. +func (ws WebSource) AsHiveSource() (*HiveSource, bool) { + return nil, false +} + +// AsHBaseSource is the BasicCopySource implementation for WebSource. +func (ws WebSource) AsHBaseSource() (*HBaseSource, bool) { + return nil, false +} + +// AsGreenplumSource is the BasicCopySource implementation for WebSource. +func (ws WebSource) AsGreenplumSource() (*GreenplumSource, bool) { + return nil, false +} + +// AsGoogleBigQuerySource is the BasicCopySource implementation for WebSource. +func (ws WebSource) AsGoogleBigQuerySource() (*GoogleBigQuerySource, bool) { + return nil, false +} + +// AsEloquaSource is the BasicCopySource implementation for WebSource. +func (ws WebSource) AsEloquaSource() (*EloquaSource, bool) { + return nil, false +} + +// AsDrillSource is the BasicCopySource implementation for WebSource. +func (ws WebSource) AsDrillSource() (*DrillSource, bool) { + return nil, false +} + +// AsCouchbaseSource is the BasicCopySource implementation for WebSource. +func (ws WebSource) AsCouchbaseSource() (*CouchbaseSource, bool) { + return nil, false +} + +// AsConcurSource is the BasicCopySource implementation for WebSource. +func (ws WebSource) AsConcurSource() (*ConcurSource, bool) { + return nil, false +} + +// AsAzurePostgreSQLSource is the BasicCopySource implementation for WebSource. +func (ws WebSource) AsAzurePostgreSQLSource() (*AzurePostgreSQLSource, bool) { + return nil, false +} + +// AsAmazonMWSSource is the BasicCopySource implementation for WebSource. +func (ws WebSource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { + return nil, false +} + +// AsHTTPSource is the BasicCopySource implementation for WebSource. +func (ws WebSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for WebSource. +func (ws WebSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for WebSource. +func (ws WebSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsCassandraSource is the BasicCopySource implementation for WebSource. +func (ws WebSource) AsCassandraSource() (*CassandraSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for WebSource. +func (ws WebSource) AsWebSource() (*WebSource, bool) { + return &ws, true +} + +// AsOracleSource is the BasicCopySource implementation for WebSource. +func (ws WebSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureMySQLSource is the BasicCopySource implementation for WebSource. +func (ws WebSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for WebSource. +func (ws WebSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for WebSource. +func (ws WebSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsSQLDWSource is the BasicCopySource implementation for WebSource. +func (ws WebSource) AsSQLDWSource() (*SQLDWSource, bool) { + return nil, false +} + +// AsSQLSource is the BasicCopySource implementation for WebSource. +func (ws WebSource) AsSQLSource() (*SQLSource, bool) { + return nil, false +} + +// AsSapEccSource is the BasicCopySource implementation for WebSource. +func (ws WebSource) AsSapEccSource() (*SapEccSource, bool) { + return nil, false +} + +// AsSapCloudForCustomerSource is the BasicCopySource implementation for WebSource. +func (ws WebSource) AsSapCloudForCustomerSource() (*SapCloudForCustomerSource, bool) { + return nil, false +} + +// AsSalesforceSource is the BasicCopySource implementation for WebSource. +func (ws WebSource) AsSalesforceSource() (*SalesforceSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for WebSource. +func (ws WebSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for WebSource. +func (ws WebSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for WebSource. +func (ws WebSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for WebSource. +func (ws WebSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + +// AsAzureTableSource is the BasicCopySource implementation for WebSource. +func (ws WebSource) AsAzureTableSource() (*AzureTableSource, bool) { + return nil, false +} + +// AsCopySource is the BasicCopySource implementation for WebSource. +func (ws WebSource) AsCopySource() (*CopySource, bool) { + return nil, false +} + +// AsBasicCopySource is the BasicCopySource implementation for WebSource. +func (ws WebSource) AsBasicCopySource() (BasicCopySource, bool) { + return &ws, true +} + +// WebTableDataset the dataset points to a HTML table in the web page. +type WebTableDataset struct { + // WebTableDatasetTypeProperties - Web table dataset properties. + *WebTableDatasetTypeProperties `json:"typeProperties,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Description - Dataset description. + Description *string `json:"description,omitempty"` + // Structure - Columns that define the structure of the dataset. Type: array (or Expression with resultType array), itemType: DatasetDataElement. + Structure interface{} `json:"structure,omitempty"` + // LinkedServiceName - Linked service reference. + LinkedServiceName *LinkedServiceReference `json:"linkedServiceName,omitempty"` + // Parameters - Parameters for dataset. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeDataset', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSQLServerTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSalesforceObject', 'TypeRelationalTable', 'TypeAzureMySQLTable', 'TypeOracleTable', 'TypeODataResource', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeAzureDataLakeStoreFile', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeAmazonS3Object' + Type TypeBasicDataset `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for WebTableDataset. +func (wtd WebTableDataset) MarshalJSON() ([]byte, error) { + wtd.Type = TypeWebTable + objectMap := make(map[string]interface{}) + if wtd.WebTableDatasetTypeProperties != nil { + objectMap["typeProperties"] = wtd.WebTableDatasetTypeProperties + } + if wtd.Description != nil { + objectMap["description"] = wtd.Description + } + objectMap["structure"] = wtd.Structure + if wtd.LinkedServiceName != nil { + objectMap["linkedServiceName"] = wtd.LinkedServiceName + } + if wtd.Parameters != nil { + objectMap["parameters"] = wtd.Parameters + } + if wtd.Annotations != nil { + objectMap["annotations"] = wtd.Annotations + } + if wtd.Type != "" { + objectMap["type"] = wtd.Type + } + for k, v := range wtd.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysObjectDataset is the BasicDataset implementation for WebTableDataset. +func (wtd WebTableDataset) AsResponsysObjectDataset() (*ResponsysObjectDataset, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudObjectDataset is the BasicDataset implementation for WebTableDataset. +func (wtd WebTableDataset) AsSalesforceMarketingCloudObjectDataset() (*SalesforceMarketingCloudObjectDataset, bool) { + return nil, false +} + +// AsVerticaTableDataset is the BasicDataset implementation for WebTableDataset. +func (wtd WebTableDataset) AsVerticaTableDataset() (*VerticaTableDataset, bool) { + return nil, false +} + +// AsNetezzaTableDataset is the BasicDataset implementation for WebTableDataset. +func (wtd WebTableDataset) AsNetezzaTableDataset() (*NetezzaTableDataset, bool) { + return nil, false +} + +// AsZohoObjectDataset is the BasicDataset implementation for WebTableDataset. +func (wtd WebTableDataset) AsZohoObjectDataset() (*ZohoObjectDataset, bool) { + return nil, false +} + +// AsXeroObjectDataset is the BasicDataset implementation for WebTableDataset. +func (wtd WebTableDataset) AsXeroObjectDataset() (*XeroObjectDataset, bool) { + return nil, false +} + +// AsSquareObjectDataset is the BasicDataset implementation for WebTableDataset. +func (wtd WebTableDataset) AsSquareObjectDataset() (*SquareObjectDataset, bool) { + return nil, false +} + +// AsSparkObjectDataset is the BasicDataset implementation for WebTableDataset. +func (wtd WebTableDataset) AsSparkObjectDataset() (*SparkObjectDataset, bool) { + return nil, false +} + +// AsShopifyObjectDataset is the BasicDataset implementation for WebTableDataset. +func (wtd WebTableDataset) AsShopifyObjectDataset() (*ShopifyObjectDataset, bool) { + return nil, false +} + +// AsServiceNowObjectDataset is the BasicDataset implementation for WebTableDataset. +func (wtd WebTableDataset) AsServiceNowObjectDataset() (*ServiceNowObjectDataset, bool) { + return nil, false +} + +// AsQuickBooksObjectDataset is the BasicDataset implementation for WebTableDataset. +func (wtd WebTableDataset) AsQuickBooksObjectDataset() (*QuickBooksObjectDataset, bool) { + return nil, false +} + +// AsPrestoObjectDataset is the BasicDataset implementation for WebTableDataset. +func (wtd WebTableDataset) AsPrestoObjectDataset() (*PrestoObjectDataset, bool) { + return nil, false +} + +// AsPhoenixObjectDataset is the BasicDataset implementation for WebTableDataset. +func (wtd WebTableDataset) AsPhoenixObjectDataset() (*PhoenixObjectDataset, bool) { + return nil, false +} + +// AsPaypalObjectDataset is the BasicDataset implementation for WebTableDataset. +func (wtd WebTableDataset) AsPaypalObjectDataset() (*PaypalObjectDataset, bool) { + return nil, false +} + +// AsMarketoObjectDataset is the BasicDataset implementation for WebTableDataset. +func (wtd WebTableDataset) AsMarketoObjectDataset() (*MarketoObjectDataset, bool) { + return nil, false +} + +// AsMariaDBTableDataset is the BasicDataset implementation for WebTableDataset. +func (wtd WebTableDataset) AsMariaDBTableDataset() (*MariaDBTableDataset, bool) { + return nil, false +} + +// AsMagentoObjectDataset is the BasicDataset implementation for WebTableDataset. +func (wtd WebTableDataset) AsMagentoObjectDataset() (*MagentoObjectDataset, bool) { + return nil, false +} + +// AsJiraObjectDataset is the BasicDataset implementation for WebTableDataset. +func (wtd WebTableDataset) AsJiraObjectDataset() (*JiraObjectDataset, bool) { + return nil, false +} + +// AsImpalaObjectDataset is the BasicDataset implementation for WebTableDataset. +func (wtd WebTableDataset) AsImpalaObjectDataset() (*ImpalaObjectDataset, bool) { + return nil, false +} + +// AsHubspotObjectDataset is the BasicDataset implementation for WebTableDataset. +func (wtd WebTableDataset) AsHubspotObjectDataset() (*HubspotObjectDataset, bool) { + return nil, false +} + +// AsHiveObjectDataset is the BasicDataset implementation for WebTableDataset. +func (wtd WebTableDataset) AsHiveObjectDataset() (*HiveObjectDataset, bool) { + return nil, false +} + +// AsHBaseObjectDataset is the BasicDataset implementation for WebTableDataset. +func (wtd WebTableDataset) AsHBaseObjectDataset() (*HBaseObjectDataset, bool) { + return nil, false +} + +// AsGreenplumTableDataset is the BasicDataset implementation for WebTableDataset. +func (wtd WebTableDataset) AsGreenplumTableDataset() (*GreenplumTableDataset, bool) { + return nil, false +} + +// AsGoogleBigQueryObjectDataset is the BasicDataset implementation for WebTableDataset. +func (wtd WebTableDataset) AsGoogleBigQueryObjectDataset() (*GoogleBigQueryObjectDataset, bool) { + return nil, false +} + +// AsEloquaObjectDataset is the BasicDataset implementation for WebTableDataset. +func (wtd WebTableDataset) AsEloquaObjectDataset() (*EloquaObjectDataset, bool) { + return nil, false +} + +// AsDrillTableDataset is the BasicDataset implementation for WebTableDataset. +func (wtd WebTableDataset) AsDrillTableDataset() (*DrillTableDataset, bool) { + return nil, false +} + +// AsCouchbaseTableDataset is the BasicDataset implementation for WebTableDataset. +func (wtd WebTableDataset) AsCouchbaseTableDataset() (*CouchbaseTableDataset, bool) { + return nil, false +} + +// AsConcurObjectDataset is the BasicDataset implementation for WebTableDataset. +func (wtd WebTableDataset) AsConcurObjectDataset() (*ConcurObjectDataset, bool) { + return nil, false +} + +// AsAzurePostgreSQLTableDataset is the BasicDataset implementation for WebTableDataset. +func (wtd WebTableDataset) AsAzurePostgreSQLTableDataset() (*AzurePostgreSQLTableDataset, bool) { + return nil, false +} + +// AsAmazonMWSObjectDataset is the BasicDataset implementation for WebTableDataset. +func (wtd WebTableDataset) AsAmazonMWSObjectDataset() (*AmazonMWSObjectDataset, bool) { + return nil, false +} + +// AsHTTPDataset is the BasicDataset implementation for WebTableDataset. +func (wtd WebTableDataset) AsHTTPDataset() (*HTTPDataset, bool) { + return nil, false +} + +// AsAzureSearchIndexDataset is the BasicDataset implementation for WebTableDataset. +func (wtd WebTableDataset) AsAzureSearchIndexDataset() (*AzureSearchIndexDataset, bool) { + return nil, false +} + +// AsWebTableDataset is the BasicDataset implementation for WebTableDataset. +func (wtd WebTableDataset) AsWebTableDataset() (*WebTableDataset, bool) { + return &wtd, true +} + +// AsSQLServerTableDataset is the BasicDataset implementation for WebTableDataset. +func (wtd WebTableDataset) AsSQLServerTableDataset() (*SQLServerTableDataset, bool) { + return nil, false +} + +// AsSapEccResourceDataset is the BasicDataset implementation for WebTableDataset. +func (wtd WebTableDataset) AsSapEccResourceDataset() (*SapEccResourceDataset, bool) { + return nil, false +} + +// AsSapCloudForCustomerResourceDataset is the BasicDataset implementation for WebTableDataset. +func (wtd WebTableDataset) AsSapCloudForCustomerResourceDataset() (*SapCloudForCustomerResourceDataset, bool) { + return nil, false +} + +// AsSalesforceObjectDataset is the BasicDataset implementation for WebTableDataset. +func (wtd WebTableDataset) AsSalesforceObjectDataset() (*SalesforceObjectDataset, bool) { + return nil, false +} + +// AsRelationalTableDataset is the BasicDataset implementation for WebTableDataset. +func (wtd WebTableDataset) AsRelationalTableDataset() (*RelationalTableDataset, bool) { + return nil, false +} + +// AsAzureMySQLTableDataset is the BasicDataset implementation for WebTableDataset. +func (wtd WebTableDataset) AsAzureMySQLTableDataset() (*AzureMySQLTableDataset, bool) { + return nil, false +} + +// AsOracleTableDataset is the BasicDataset implementation for WebTableDataset. +func (wtd WebTableDataset) AsOracleTableDataset() (*OracleTableDataset, bool) { + return nil, false +} + +// AsODataResourceDataset is the BasicDataset implementation for WebTableDataset. +func (wtd WebTableDataset) AsODataResourceDataset() (*ODataResourceDataset, bool) { + return nil, false +} + +// AsMongoDbCollectionDataset is the BasicDataset implementation for WebTableDataset. +func (wtd WebTableDataset) AsMongoDbCollectionDataset() (*MongoDbCollectionDataset, bool) { + return nil, false +} + +// AsFileShareDataset is the BasicDataset implementation for WebTableDataset. +func (wtd WebTableDataset) AsFileShareDataset() (*FileShareDataset, bool) { + return nil, false +} + +// AsAzureDataLakeStoreDataset is the BasicDataset implementation for WebTableDataset. +func (wtd WebTableDataset) AsAzureDataLakeStoreDataset() (*AzureDataLakeStoreDataset, bool) { + return nil, false +} + +// AsDynamicsEntityDataset is the BasicDataset implementation for WebTableDataset. +func (wtd WebTableDataset) AsDynamicsEntityDataset() (*DynamicsEntityDataset, bool) { + return nil, false +} + +// AsDocumentDbCollectionDataset is the BasicDataset implementation for WebTableDataset. +func (wtd WebTableDataset) AsDocumentDbCollectionDataset() (*DocumentDbCollectionDataset, bool) { + return nil, false +} + +// AsCustomDataset is the BasicDataset implementation for WebTableDataset. +func (wtd WebTableDataset) AsCustomDataset() (*CustomDataset, bool) { + return nil, false +} + +// AsCassandraTableDataset is the BasicDataset implementation for WebTableDataset. +func (wtd WebTableDataset) AsCassandraTableDataset() (*CassandraTableDataset, bool) { + return nil, false +} + +// AsAzureSQLDWTableDataset is the BasicDataset implementation for WebTableDataset. +func (wtd WebTableDataset) AsAzureSQLDWTableDataset() (*AzureSQLDWTableDataset, bool) { + return nil, false +} + +// AsAzureSQLTableDataset is the BasicDataset implementation for WebTableDataset. +func (wtd WebTableDataset) AsAzureSQLTableDataset() (*AzureSQLTableDataset, bool) { + return nil, false +} + +// AsAzureTableDataset is the BasicDataset implementation for WebTableDataset. +func (wtd WebTableDataset) AsAzureTableDataset() (*AzureTableDataset, bool) { + return nil, false +} + +// AsAzureBlobDataset is the BasicDataset implementation for WebTableDataset. +func (wtd WebTableDataset) AsAzureBlobDataset() (*AzureBlobDataset, bool) { + return nil, false +} + +// AsAmazonS3Dataset is the BasicDataset implementation for WebTableDataset. +func (wtd WebTableDataset) AsAmazonS3Dataset() (*AmazonS3Dataset, bool) { + return nil, false +} + +// AsDataset is the BasicDataset implementation for WebTableDataset. +func (wtd WebTableDataset) AsDataset() (*Dataset, bool) { + return nil, false +} + +// AsBasicDataset is the BasicDataset implementation for WebTableDataset. +func (wtd WebTableDataset) AsBasicDataset() (BasicDataset, bool) { + return &wtd, true +} + +// UnmarshalJSON is the custom unmarshaler for WebTableDataset struct. +func (wtd *WebTableDataset) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "typeProperties": + if v != nil { + var webTableDatasetTypeProperties WebTableDatasetTypeProperties + err = json.Unmarshal(*v, &webTableDatasetTypeProperties) + if err != nil { + return err + } + wtd.WebTableDatasetTypeProperties = &webTableDatasetTypeProperties + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if wtd.AdditionalProperties == nil { + wtd.AdditionalProperties = make(map[string]interface{}) + } + wtd.AdditionalProperties[k] = additionalProperties + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + wtd.Description = &description + } + case "structure": + if v != nil { + var structure interface{} + err = json.Unmarshal(*v, &structure) + if err != nil { + return err + } + wtd.Structure = structure + } + case "linkedServiceName": + if v != nil { + var linkedServiceName LinkedServiceReference + err = json.Unmarshal(*v, &linkedServiceName) + if err != nil { + return err + } + wtd.LinkedServiceName = &linkedServiceName + } + case "parameters": + if v != nil { + var parameters map[string]*ParameterSpecification + err = json.Unmarshal(*v, ¶meters) + if err != nil { + return err + } + wtd.Parameters = parameters + } + case "annotations": + if v != nil { + var annotations []interface{} + err = json.Unmarshal(*v, &annotations) + if err != nil { + return err + } + wtd.Annotations = &annotations + } + case "type": + if v != nil { + var typeVar TypeBasicDataset + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + wtd.Type = typeVar + } + } + } + + return nil +} + +// WebTableDatasetTypeProperties web table dataset properties. +type WebTableDatasetTypeProperties struct { + // Index - The zero-based index of the table in the web page. Type: integer (or Expression with resultType integer), minimum: 0. + Index interface{} `json:"index,omitempty"` + // Path - The relative URL to the web page from the linked service URL. Type: string (or Expression with resultType string). + Path interface{} `json:"path,omitempty"` +} + +// XeroLinkedService xero Serivce linked service. +type XeroLinkedService struct { + // XeroLinkedServiceTypeProperties - Xero Serivce linked service properties. + *XeroLinkedServiceTypeProperties `json:"typeProperties,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // ConnectVia - The integration runtime reference. + ConnectVia *IntegrationRuntimeReference `json:"connectVia,omitempty"` + // Description - Linked service description. + Description *string `json:"description,omitempty"` + // Parameters - Parameters for linked service. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeLinkedService', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforce', 'TypeAzureDataLakeStore', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureStorage' + Type TypeBasicLinkedService `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for XeroLinkedService. +func (xls XeroLinkedService) MarshalJSON() ([]byte, error) { + xls.Type = TypeXero + objectMap := make(map[string]interface{}) + if xls.XeroLinkedServiceTypeProperties != nil { + objectMap["typeProperties"] = xls.XeroLinkedServiceTypeProperties + } + if xls.ConnectVia != nil { + objectMap["connectVia"] = xls.ConnectVia + } + if xls.Description != nil { + objectMap["description"] = xls.Description + } + if xls.Parameters != nil { + objectMap["parameters"] = xls.Parameters + } + if xls.Annotations != nil { + objectMap["annotations"] = xls.Annotations + } + if xls.Type != "" { + objectMap["type"] = xls.Type + } + for k, v := range xls.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysLinkedService is the BasicLinkedService implementation for XeroLinkedService. +func (xls XeroLinkedService) AsResponsysLinkedService() (*ResponsysLinkedService, bool) { + return nil, false +} + +// AsAzureDatabricksLinkedService is the BasicLinkedService implementation for XeroLinkedService. +func (xls XeroLinkedService) AsAzureDatabricksLinkedService() (*AzureDatabricksLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeAnalyticsLinkedService is the BasicLinkedService implementation for XeroLinkedService. +func (xls XeroLinkedService) AsAzureDataLakeAnalyticsLinkedService() (*AzureDataLakeAnalyticsLinkedService, bool) { + return nil, false +} + +// AsHDInsightOnDemandLinkedService is the BasicLinkedService implementation for XeroLinkedService. +func (xls XeroLinkedService) AsHDInsightOnDemandLinkedService() (*HDInsightOnDemandLinkedService, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudLinkedService is the BasicLinkedService implementation for XeroLinkedService. +func (xls XeroLinkedService) AsSalesforceMarketingCloudLinkedService() (*SalesforceMarketingCloudLinkedService, bool) { + return nil, false +} + +// AsNetezzaLinkedService is the BasicLinkedService implementation for XeroLinkedService. +func (xls XeroLinkedService) AsNetezzaLinkedService() (*NetezzaLinkedService, bool) { + return nil, false +} + +// AsVerticaLinkedService is the BasicLinkedService implementation for XeroLinkedService. +func (xls XeroLinkedService) AsVerticaLinkedService() (*VerticaLinkedService, bool) { + return nil, false +} + +// AsZohoLinkedService is the BasicLinkedService implementation for XeroLinkedService. +func (xls XeroLinkedService) AsZohoLinkedService() (*ZohoLinkedService, bool) { + return nil, false +} + +// AsXeroLinkedService is the BasicLinkedService implementation for XeroLinkedService. +func (xls XeroLinkedService) AsXeroLinkedService() (*XeroLinkedService, bool) { + return &xls, true +} + +// AsSquareLinkedService is the BasicLinkedService implementation for XeroLinkedService. +func (xls XeroLinkedService) AsSquareLinkedService() (*SquareLinkedService, bool) { + return nil, false +} + +// AsSparkLinkedService is the BasicLinkedService implementation for XeroLinkedService. +func (xls XeroLinkedService) AsSparkLinkedService() (*SparkLinkedService, bool) { + return nil, false +} + +// AsShopifyLinkedService is the BasicLinkedService implementation for XeroLinkedService. +func (xls XeroLinkedService) AsShopifyLinkedService() (*ShopifyLinkedService, bool) { + return nil, false +} + +// AsServiceNowLinkedService is the BasicLinkedService implementation for XeroLinkedService. +func (xls XeroLinkedService) AsServiceNowLinkedService() (*ServiceNowLinkedService, bool) { + return nil, false +} + +// AsQuickBooksLinkedService is the BasicLinkedService implementation for XeroLinkedService. +func (xls XeroLinkedService) AsQuickBooksLinkedService() (*QuickBooksLinkedService, bool) { + return nil, false +} + +// AsPrestoLinkedService is the BasicLinkedService implementation for XeroLinkedService. +func (xls XeroLinkedService) AsPrestoLinkedService() (*PrestoLinkedService, bool) { + return nil, false +} + +// AsPhoenixLinkedService is the BasicLinkedService implementation for XeroLinkedService. +func (xls XeroLinkedService) AsPhoenixLinkedService() (*PhoenixLinkedService, bool) { + return nil, false +} + +// AsPaypalLinkedService is the BasicLinkedService implementation for XeroLinkedService. +func (xls XeroLinkedService) AsPaypalLinkedService() (*PaypalLinkedService, bool) { + return nil, false +} + +// AsMarketoLinkedService is the BasicLinkedService implementation for XeroLinkedService. +func (xls XeroLinkedService) AsMarketoLinkedService() (*MarketoLinkedService, bool) { + return nil, false +} + +// AsMariaDBLinkedService is the BasicLinkedService implementation for XeroLinkedService. +func (xls XeroLinkedService) AsMariaDBLinkedService() (*MariaDBLinkedService, bool) { + return nil, false +} + +// AsMagentoLinkedService is the BasicLinkedService implementation for XeroLinkedService. +func (xls XeroLinkedService) AsMagentoLinkedService() (*MagentoLinkedService, bool) { + return nil, false +} + +// AsJiraLinkedService is the BasicLinkedService implementation for XeroLinkedService. +func (xls XeroLinkedService) AsJiraLinkedService() (*JiraLinkedService, bool) { + return nil, false +} + +// AsImpalaLinkedService is the BasicLinkedService implementation for XeroLinkedService. +func (xls XeroLinkedService) AsImpalaLinkedService() (*ImpalaLinkedService, bool) { + return nil, false +} + +// AsHubspotLinkedService is the BasicLinkedService implementation for XeroLinkedService. +func (xls XeroLinkedService) AsHubspotLinkedService() (*HubspotLinkedService, bool) { + return nil, false +} + +// AsHiveLinkedService is the BasicLinkedService implementation for XeroLinkedService. +func (xls XeroLinkedService) AsHiveLinkedService() (*HiveLinkedService, bool) { + return nil, false +} + +// AsHBaseLinkedService is the BasicLinkedService implementation for XeroLinkedService. +func (xls XeroLinkedService) AsHBaseLinkedService() (*HBaseLinkedService, bool) { + return nil, false +} + +// AsGreenplumLinkedService is the BasicLinkedService implementation for XeroLinkedService. +func (xls XeroLinkedService) AsGreenplumLinkedService() (*GreenplumLinkedService, bool) { + return nil, false +} + +// AsGoogleBigQueryLinkedService is the BasicLinkedService implementation for XeroLinkedService. +func (xls XeroLinkedService) AsGoogleBigQueryLinkedService() (*GoogleBigQueryLinkedService, bool) { + return nil, false +} + +// AsEloquaLinkedService is the BasicLinkedService implementation for XeroLinkedService. +func (xls XeroLinkedService) AsEloquaLinkedService() (*EloquaLinkedService, bool) { + return nil, false +} + +// AsDrillLinkedService is the BasicLinkedService implementation for XeroLinkedService. +func (xls XeroLinkedService) AsDrillLinkedService() (*DrillLinkedService, bool) { + return nil, false +} + +// AsCouchbaseLinkedService is the BasicLinkedService implementation for XeroLinkedService. +func (xls XeroLinkedService) AsCouchbaseLinkedService() (*CouchbaseLinkedService, bool) { + return nil, false +} + +// AsConcurLinkedService is the BasicLinkedService implementation for XeroLinkedService. +func (xls XeroLinkedService) AsConcurLinkedService() (*ConcurLinkedService, bool) { + return nil, false +} + +// AsAzurePostgreSQLLinkedService is the BasicLinkedService implementation for XeroLinkedService. +func (xls XeroLinkedService) AsAzurePostgreSQLLinkedService() (*AzurePostgreSQLLinkedService, bool) { + return nil, false +} + +// AsAmazonMWSLinkedService is the BasicLinkedService implementation for XeroLinkedService. +func (xls XeroLinkedService) AsAmazonMWSLinkedService() (*AmazonMWSLinkedService, bool) { + return nil, false +} + +// AsSapHanaLinkedService is the BasicLinkedService implementation for XeroLinkedService. +func (xls XeroLinkedService) AsSapHanaLinkedService() (*SapHanaLinkedService, bool) { + return nil, false +} + +// AsSapBWLinkedService is the BasicLinkedService implementation for XeroLinkedService. +func (xls XeroLinkedService) AsSapBWLinkedService() (*SapBWLinkedService, bool) { + return nil, false +} + +// AsSftpServerLinkedService is the BasicLinkedService implementation for XeroLinkedService. +func (xls XeroLinkedService) AsSftpServerLinkedService() (*SftpServerLinkedService, bool) { + return nil, false +} + +// AsFtpServerLinkedService is the BasicLinkedService implementation for XeroLinkedService. +func (xls XeroLinkedService) AsFtpServerLinkedService() (*FtpServerLinkedService, bool) { + return nil, false +} + +// AsHTTPLinkedService is the BasicLinkedService implementation for XeroLinkedService. +func (xls XeroLinkedService) AsHTTPLinkedService() (*HTTPLinkedService, bool) { + return nil, false +} + +// AsAzureSearchLinkedService is the BasicLinkedService implementation for XeroLinkedService. +func (xls XeroLinkedService) AsAzureSearchLinkedService() (*AzureSearchLinkedService, bool) { + return nil, false +} + +// AsCustomDataSourceLinkedService is the BasicLinkedService implementation for XeroLinkedService. +func (xls XeroLinkedService) AsCustomDataSourceLinkedService() (*CustomDataSourceLinkedService, bool) { + return nil, false +} + +// AsAmazonRedshiftLinkedService is the BasicLinkedService implementation for XeroLinkedService. +func (xls XeroLinkedService) AsAmazonRedshiftLinkedService() (*AmazonRedshiftLinkedService, bool) { + return nil, false +} + +// AsAmazonS3LinkedService is the BasicLinkedService implementation for XeroLinkedService. +func (xls XeroLinkedService) AsAmazonS3LinkedService() (*AmazonS3LinkedService, bool) { + return nil, false +} + +// AsSapEccLinkedService is the BasicLinkedService implementation for XeroLinkedService. +func (xls XeroLinkedService) AsSapEccLinkedService() (*SapEccLinkedService, bool) { + return nil, false +} + +// AsSapCloudForCustomerLinkedService is the BasicLinkedService implementation for XeroLinkedService. +func (xls XeroLinkedService) AsSapCloudForCustomerLinkedService() (*SapCloudForCustomerLinkedService, bool) { + return nil, false +} + +// AsSalesforceLinkedService is the BasicLinkedService implementation for XeroLinkedService. +func (xls XeroLinkedService) AsSalesforceLinkedService() (*SalesforceLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeStoreLinkedService is the BasicLinkedService implementation for XeroLinkedService. +func (xls XeroLinkedService) AsAzureDataLakeStoreLinkedService() (*AzureDataLakeStoreLinkedService, bool) { + return nil, false +} + +// AsMongoDbLinkedService is the BasicLinkedService implementation for XeroLinkedService. +func (xls XeroLinkedService) AsMongoDbLinkedService() (*MongoDbLinkedService, bool) { + return nil, false +} + +// AsCassandraLinkedService is the BasicLinkedService implementation for XeroLinkedService. +func (xls XeroLinkedService) AsCassandraLinkedService() (*CassandraLinkedService, bool) { + return nil, false +} + +// AsWebLinkedService is the BasicLinkedService implementation for XeroLinkedService. +func (xls XeroLinkedService) AsWebLinkedService() (*WebLinkedService, bool) { + return nil, false +} + +// AsODataLinkedService is the BasicLinkedService implementation for XeroLinkedService. +func (xls XeroLinkedService) AsODataLinkedService() (*ODataLinkedService, bool) { + return nil, false +} + +// AsHdfsLinkedService is the BasicLinkedService implementation for XeroLinkedService. +func (xls XeroLinkedService) AsHdfsLinkedService() (*HdfsLinkedService, bool) { + return nil, false +} + +// AsOdbcLinkedService is the BasicLinkedService implementation for XeroLinkedService. +func (xls XeroLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, bool) { + return nil, false +} + +// AsAzureMLLinkedService is the BasicLinkedService implementation for XeroLinkedService. +func (xls XeroLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { + return nil, false +} + +// AsTeradataLinkedService is the BasicLinkedService implementation for XeroLinkedService. +func (xls XeroLinkedService) AsTeradataLinkedService() (*TeradataLinkedService, bool) { + return nil, false +} + +// AsDb2LinkedService is the BasicLinkedService implementation for XeroLinkedService. +func (xls XeroLinkedService) AsDb2LinkedService() (*Db2LinkedService, bool) { + return nil, false +} + +// AsSybaseLinkedService is the BasicLinkedService implementation for XeroLinkedService. +func (xls XeroLinkedService) AsSybaseLinkedService() (*SybaseLinkedService, bool) { + return nil, false +} + +// AsPostgreSQLLinkedService is the BasicLinkedService implementation for XeroLinkedService. +func (xls XeroLinkedService) AsPostgreSQLLinkedService() (*PostgreSQLLinkedService, bool) { + return nil, false +} + +// AsMySQLLinkedService is the BasicLinkedService implementation for XeroLinkedService. +func (xls XeroLinkedService) AsMySQLLinkedService() (*MySQLLinkedService, bool) { + return nil, false +} + +// AsAzureMySQLLinkedService is the BasicLinkedService implementation for XeroLinkedService. +func (xls XeroLinkedService) AsAzureMySQLLinkedService() (*AzureMySQLLinkedService, bool) { + return nil, false +} + +// AsOracleLinkedService is the BasicLinkedService implementation for XeroLinkedService. +func (xls XeroLinkedService) AsOracleLinkedService() (*OracleLinkedService, bool) { + return nil, false +} + +// AsFileServerLinkedService is the BasicLinkedService implementation for XeroLinkedService. +func (xls XeroLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { + return nil, false +} + +// AsHDInsightLinkedService is the BasicLinkedService implementation for XeroLinkedService. +func (xls XeroLinkedService) AsHDInsightLinkedService() (*HDInsightLinkedService, bool) { + return nil, false +} + +// AsDynamicsLinkedService is the BasicLinkedService implementation for XeroLinkedService. +func (xls XeroLinkedService) AsDynamicsLinkedService() (*DynamicsLinkedService, bool) { + return nil, false +} + +// AsCosmosDbLinkedService is the BasicLinkedService implementation for XeroLinkedService. +func (xls XeroLinkedService) AsCosmosDbLinkedService() (*CosmosDbLinkedService, bool) { + return nil, false +} + +// AsAzureKeyVaultLinkedService is the BasicLinkedService implementation for XeroLinkedService. +func (xls XeroLinkedService) AsAzureKeyVaultLinkedService() (*AzureKeyVaultLinkedService, bool) { + return nil, false +} + +// AsAzureBatchLinkedService is the BasicLinkedService implementation for XeroLinkedService. +func (xls XeroLinkedService) AsAzureBatchLinkedService() (*AzureBatchLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDatabaseLinkedService is the BasicLinkedService implementation for XeroLinkedService. +func (xls XeroLinkedService) AsAzureSQLDatabaseLinkedService() (*AzureSQLDatabaseLinkedService, bool) { + return nil, false +} + +// AsSQLServerLinkedService is the BasicLinkedService implementation for XeroLinkedService. +func (xls XeroLinkedService) AsSQLServerLinkedService() (*SQLServerLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDWLinkedService is the BasicLinkedService implementation for XeroLinkedService. +func (xls XeroLinkedService) AsAzureSQLDWLinkedService() (*AzureSQLDWLinkedService, bool) { + return nil, false +} + +// AsAzureStorageLinkedService is the BasicLinkedService implementation for XeroLinkedService. +func (xls XeroLinkedService) AsAzureStorageLinkedService() (*AzureStorageLinkedService, bool) { + return nil, false +} + +// AsLinkedService is the BasicLinkedService implementation for XeroLinkedService. +func (xls XeroLinkedService) AsLinkedService() (*LinkedService, bool) { + return nil, false +} + +// AsBasicLinkedService is the BasicLinkedService implementation for XeroLinkedService. +func (xls XeroLinkedService) AsBasicLinkedService() (BasicLinkedService, bool) { + return &xls, true +} + +// UnmarshalJSON is the custom unmarshaler for XeroLinkedService struct. +func (xls *XeroLinkedService) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "typeProperties": + if v != nil { + var xeroLinkedServiceTypeProperties XeroLinkedServiceTypeProperties + err = json.Unmarshal(*v, &xeroLinkedServiceTypeProperties) + if err != nil { + return err + } + xls.XeroLinkedServiceTypeProperties = &xeroLinkedServiceTypeProperties + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if xls.AdditionalProperties == nil { + xls.AdditionalProperties = make(map[string]interface{}) + } + xls.AdditionalProperties[k] = additionalProperties + } + case "connectVia": + if v != nil { + var connectVia IntegrationRuntimeReference + err = json.Unmarshal(*v, &connectVia) + if err != nil { + return err + } + xls.ConnectVia = &connectVia + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + xls.Description = &description + } + case "parameters": + if v != nil { + var parameters map[string]*ParameterSpecification + err = json.Unmarshal(*v, ¶meters) + if err != nil { + return err + } + xls.Parameters = parameters + } + case "annotations": + if v != nil { + var annotations []interface{} + err = json.Unmarshal(*v, &annotations) + if err != nil { + return err + } + xls.Annotations = &annotations + } + case "type": + if v != nil { + var typeVar TypeBasicLinkedService + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + xls.Type = typeVar + } + } + } + + return nil +} + +// XeroLinkedServiceTypeProperties xero Serivce linked service properties. +type XeroLinkedServiceTypeProperties struct { + // Host - The endpoint of the Xero server. (i.e. api.xero.com) + Host interface{} `json:"host,omitempty"` + // ConsumerKey - The consumer key associated with the Xero application. + ConsumerKey BasicSecretBase `json:"consumerKey,omitempty"` + // PrivateKey - The private key from the .pem file that was generated for your Xero private application. You must include all the text from the .pem file, including the Unix line endings( + // ). + PrivateKey BasicSecretBase `json:"privateKey,omitempty"` + // UseEncryptedEndpoints - Specifies whether the data source endpoints are encrypted using HTTPS. The default value is true. + UseEncryptedEndpoints interface{} `json:"useEncryptedEndpoints,omitempty"` + // UseHostVerification - Specifies whether to require the host name in the server's certificate to match the host name of the server when connecting over SSL. The default value is true. + UseHostVerification interface{} `json:"useHostVerification,omitempty"` + // UsePeerVerification - Specifies whether to verify the identity of the server when connecting over SSL. The default value is true. + UsePeerVerification interface{} `json:"usePeerVerification,omitempty"` + // EncryptedCredential - The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string). + EncryptedCredential interface{} `json:"encryptedCredential,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for XeroLinkedServiceTypeProperties struct. +func (xlstp *XeroLinkedServiceTypeProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "host": + if v != nil { + var host interface{} + err = json.Unmarshal(*v, &host) + if err != nil { + return err + } + xlstp.Host = host + } + case "consumerKey": + if v != nil { + consumerKey, err := unmarshalBasicSecretBase(*v) + if err != nil { + return err + } + xlstp.ConsumerKey = consumerKey + } + case "privateKey": + if v != nil { + privateKey, err := unmarshalBasicSecretBase(*v) + if err != nil { + return err + } + xlstp.PrivateKey = privateKey + } + case "useEncryptedEndpoints": + if v != nil { + var useEncryptedEndpoints interface{} + err = json.Unmarshal(*v, &useEncryptedEndpoints) + if err != nil { + return err + } + xlstp.UseEncryptedEndpoints = useEncryptedEndpoints + } + case "useHostVerification": + if v != nil { + var useHostVerification interface{} + err = json.Unmarshal(*v, &useHostVerification) + if err != nil { + return err + } + xlstp.UseHostVerification = useHostVerification + } + case "usePeerVerification": + if v != nil { + var usePeerVerification interface{} + err = json.Unmarshal(*v, &usePeerVerification) + if err != nil { + return err + } + xlstp.UsePeerVerification = usePeerVerification + } + case "encryptedCredential": + if v != nil { + var encryptedCredential interface{} + err = json.Unmarshal(*v, &encryptedCredential) + if err != nil { + return err + } + xlstp.EncryptedCredential = encryptedCredential + } + } + } + + return nil +} + +// XeroObjectDataset xero Serivce dataset. +type XeroObjectDataset struct { + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Description - Dataset description. + Description *string `json:"description,omitempty"` + // Structure - Columns that define the structure of the dataset. Type: array (or Expression with resultType array), itemType: DatasetDataElement. + Structure interface{} `json:"structure,omitempty"` + // LinkedServiceName - Linked service reference. + LinkedServiceName *LinkedServiceReference `json:"linkedServiceName,omitempty"` + // Parameters - Parameters for dataset. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeDataset', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSQLServerTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSalesforceObject', 'TypeRelationalTable', 'TypeAzureMySQLTable', 'TypeOracleTable', 'TypeODataResource', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeAzureDataLakeStoreFile', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeAmazonS3Object' + Type TypeBasicDataset `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for XeroObjectDataset. +func (xod XeroObjectDataset) MarshalJSON() ([]byte, error) { + xod.Type = TypeXeroObject + objectMap := make(map[string]interface{}) + if xod.Description != nil { + objectMap["description"] = xod.Description + } + objectMap["structure"] = xod.Structure + if xod.LinkedServiceName != nil { + objectMap["linkedServiceName"] = xod.LinkedServiceName + } + if xod.Parameters != nil { + objectMap["parameters"] = xod.Parameters + } + if xod.Annotations != nil { + objectMap["annotations"] = xod.Annotations + } + if xod.Type != "" { + objectMap["type"] = xod.Type + } + for k, v := range xod.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysObjectDataset is the BasicDataset implementation for XeroObjectDataset. +func (xod XeroObjectDataset) AsResponsysObjectDataset() (*ResponsysObjectDataset, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudObjectDataset is the BasicDataset implementation for XeroObjectDataset. +func (xod XeroObjectDataset) AsSalesforceMarketingCloudObjectDataset() (*SalesforceMarketingCloudObjectDataset, bool) { + return nil, false +} + +// AsVerticaTableDataset is the BasicDataset implementation for XeroObjectDataset. +func (xod XeroObjectDataset) AsVerticaTableDataset() (*VerticaTableDataset, bool) { + return nil, false +} + +// AsNetezzaTableDataset is the BasicDataset implementation for XeroObjectDataset. +func (xod XeroObjectDataset) AsNetezzaTableDataset() (*NetezzaTableDataset, bool) { + return nil, false +} + +// AsZohoObjectDataset is the BasicDataset implementation for XeroObjectDataset. +func (xod XeroObjectDataset) AsZohoObjectDataset() (*ZohoObjectDataset, bool) { + return nil, false +} + +// AsXeroObjectDataset is the BasicDataset implementation for XeroObjectDataset. +func (xod XeroObjectDataset) AsXeroObjectDataset() (*XeroObjectDataset, bool) { + return &xod, true +} + +// AsSquareObjectDataset is the BasicDataset implementation for XeroObjectDataset. +func (xod XeroObjectDataset) AsSquareObjectDataset() (*SquareObjectDataset, bool) { + return nil, false +} + +// AsSparkObjectDataset is the BasicDataset implementation for XeroObjectDataset. +func (xod XeroObjectDataset) AsSparkObjectDataset() (*SparkObjectDataset, bool) { + return nil, false +} + +// AsShopifyObjectDataset is the BasicDataset implementation for XeroObjectDataset. +func (xod XeroObjectDataset) AsShopifyObjectDataset() (*ShopifyObjectDataset, bool) { + return nil, false +} + +// AsServiceNowObjectDataset is the BasicDataset implementation for XeroObjectDataset. +func (xod XeroObjectDataset) AsServiceNowObjectDataset() (*ServiceNowObjectDataset, bool) { + return nil, false +} + +// AsQuickBooksObjectDataset is the BasicDataset implementation for XeroObjectDataset. +func (xod XeroObjectDataset) AsQuickBooksObjectDataset() (*QuickBooksObjectDataset, bool) { + return nil, false +} + +// AsPrestoObjectDataset is the BasicDataset implementation for XeroObjectDataset. +func (xod XeroObjectDataset) AsPrestoObjectDataset() (*PrestoObjectDataset, bool) { + return nil, false +} + +// AsPhoenixObjectDataset is the BasicDataset implementation for XeroObjectDataset. +func (xod XeroObjectDataset) AsPhoenixObjectDataset() (*PhoenixObjectDataset, bool) { + return nil, false +} + +// AsPaypalObjectDataset is the BasicDataset implementation for XeroObjectDataset. +func (xod XeroObjectDataset) AsPaypalObjectDataset() (*PaypalObjectDataset, bool) { + return nil, false +} + +// AsMarketoObjectDataset is the BasicDataset implementation for XeroObjectDataset. +func (xod XeroObjectDataset) AsMarketoObjectDataset() (*MarketoObjectDataset, bool) { + return nil, false +} + +// AsMariaDBTableDataset is the BasicDataset implementation for XeroObjectDataset. +func (xod XeroObjectDataset) AsMariaDBTableDataset() (*MariaDBTableDataset, bool) { + return nil, false +} + +// AsMagentoObjectDataset is the BasicDataset implementation for XeroObjectDataset. +func (xod XeroObjectDataset) AsMagentoObjectDataset() (*MagentoObjectDataset, bool) { + return nil, false +} + +// AsJiraObjectDataset is the BasicDataset implementation for XeroObjectDataset. +func (xod XeroObjectDataset) AsJiraObjectDataset() (*JiraObjectDataset, bool) { + return nil, false +} + +// AsImpalaObjectDataset is the BasicDataset implementation for XeroObjectDataset. +func (xod XeroObjectDataset) AsImpalaObjectDataset() (*ImpalaObjectDataset, bool) { + return nil, false +} + +// AsHubspotObjectDataset is the BasicDataset implementation for XeroObjectDataset. +func (xod XeroObjectDataset) AsHubspotObjectDataset() (*HubspotObjectDataset, bool) { + return nil, false +} + +// AsHiveObjectDataset is the BasicDataset implementation for XeroObjectDataset. +func (xod XeroObjectDataset) AsHiveObjectDataset() (*HiveObjectDataset, bool) { + return nil, false +} + +// AsHBaseObjectDataset is the BasicDataset implementation for XeroObjectDataset. +func (xod XeroObjectDataset) AsHBaseObjectDataset() (*HBaseObjectDataset, bool) { + return nil, false +} + +// AsGreenplumTableDataset is the BasicDataset implementation for XeroObjectDataset. +func (xod XeroObjectDataset) AsGreenplumTableDataset() (*GreenplumTableDataset, bool) { + return nil, false +} + +// AsGoogleBigQueryObjectDataset is the BasicDataset implementation for XeroObjectDataset. +func (xod XeroObjectDataset) AsGoogleBigQueryObjectDataset() (*GoogleBigQueryObjectDataset, bool) { + return nil, false +} + +// AsEloquaObjectDataset is the BasicDataset implementation for XeroObjectDataset. +func (xod XeroObjectDataset) AsEloquaObjectDataset() (*EloquaObjectDataset, bool) { + return nil, false +} + +// AsDrillTableDataset is the BasicDataset implementation for XeroObjectDataset. +func (xod XeroObjectDataset) AsDrillTableDataset() (*DrillTableDataset, bool) { + return nil, false +} + +// AsCouchbaseTableDataset is the BasicDataset implementation for XeroObjectDataset. +func (xod XeroObjectDataset) AsCouchbaseTableDataset() (*CouchbaseTableDataset, bool) { + return nil, false +} + +// AsConcurObjectDataset is the BasicDataset implementation for XeroObjectDataset. +func (xod XeroObjectDataset) AsConcurObjectDataset() (*ConcurObjectDataset, bool) { + return nil, false +} + +// AsAzurePostgreSQLTableDataset is the BasicDataset implementation for XeroObjectDataset. +func (xod XeroObjectDataset) AsAzurePostgreSQLTableDataset() (*AzurePostgreSQLTableDataset, bool) { + return nil, false +} + +// AsAmazonMWSObjectDataset is the BasicDataset implementation for XeroObjectDataset. +func (xod XeroObjectDataset) AsAmazonMWSObjectDataset() (*AmazonMWSObjectDataset, bool) { + return nil, false +} + +// AsHTTPDataset is the BasicDataset implementation for XeroObjectDataset. +func (xod XeroObjectDataset) AsHTTPDataset() (*HTTPDataset, bool) { + return nil, false +} + +// AsAzureSearchIndexDataset is the BasicDataset implementation for XeroObjectDataset. +func (xod XeroObjectDataset) AsAzureSearchIndexDataset() (*AzureSearchIndexDataset, bool) { + return nil, false +} + +// AsWebTableDataset is the BasicDataset implementation for XeroObjectDataset. +func (xod XeroObjectDataset) AsWebTableDataset() (*WebTableDataset, bool) { + return nil, false +} + +// AsSQLServerTableDataset is the BasicDataset implementation for XeroObjectDataset. +func (xod XeroObjectDataset) AsSQLServerTableDataset() (*SQLServerTableDataset, bool) { + return nil, false +} + +// AsSapEccResourceDataset is the BasicDataset implementation for XeroObjectDataset. +func (xod XeroObjectDataset) AsSapEccResourceDataset() (*SapEccResourceDataset, bool) { + return nil, false +} + +// AsSapCloudForCustomerResourceDataset is the BasicDataset implementation for XeroObjectDataset. +func (xod XeroObjectDataset) AsSapCloudForCustomerResourceDataset() (*SapCloudForCustomerResourceDataset, bool) { + return nil, false +} + +// AsSalesforceObjectDataset is the BasicDataset implementation for XeroObjectDataset. +func (xod XeroObjectDataset) AsSalesforceObjectDataset() (*SalesforceObjectDataset, bool) { + return nil, false +} + +// AsRelationalTableDataset is the BasicDataset implementation for XeroObjectDataset. +func (xod XeroObjectDataset) AsRelationalTableDataset() (*RelationalTableDataset, bool) { + return nil, false +} + +// AsAzureMySQLTableDataset is the BasicDataset implementation for XeroObjectDataset. +func (xod XeroObjectDataset) AsAzureMySQLTableDataset() (*AzureMySQLTableDataset, bool) { + return nil, false +} + +// AsOracleTableDataset is the BasicDataset implementation for XeroObjectDataset. +func (xod XeroObjectDataset) AsOracleTableDataset() (*OracleTableDataset, bool) { + return nil, false +} + +// AsODataResourceDataset is the BasicDataset implementation for XeroObjectDataset. +func (xod XeroObjectDataset) AsODataResourceDataset() (*ODataResourceDataset, bool) { + return nil, false +} + +// AsMongoDbCollectionDataset is the BasicDataset implementation for XeroObjectDataset. +func (xod XeroObjectDataset) AsMongoDbCollectionDataset() (*MongoDbCollectionDataset, bool) { + return nil, false +} + +// AsFileShareDataset is the BasicDataset implementation for XeroObjectDataset. +func (xod XeroObjectDataset) AsFileShareDataset() (*FileShareDataset, bool) { + return nil, false +} + +// AsAzureDataLakeStoreDataset is the BasicDataset implementation for XeroObjectDataset. +func (xod XeroObjectDataset) AsAzureDataLakeStoreDataset() (*AzureDataLakeStoreDataset, bool) { + return nil, false +} + +// AsDynamicsEntityDataset is the BasicDataset implementation for XeroObjectDataset. +func (xod XeroObjectDataset) AsDynamicsEntityDataset() (*DynamicsEntityDataset, bool) { + return nil, false +} + +// AsDocumentDbCollectionDataset is the BasicDataset implementation for XeroObjectDataset. +func (xod XeroObjectDataset) AsDocumentDbCollectionDataset() (*DocumentDbCollectionDataset, bool) { + return nil, false +} + +// AsCustomDataset is the BasicDataset implementation for XeroObjectDataset. +func (xod XeroObjectDataset) AsCustomDataset() (*CustomDataset, bool) { + return nil, false +} + +// AsCassandraTableDataset is the BasicDataset implementation for XeroObjectDataset. +func (xod XeroObjectDataset) AsCassandraTableDataset() (*CassandraTableDataset, bool) { + return nil, false +} + +// AsAzureSQLDWTableDataset is the BasicDataset implementation for XeroObjectDataset. +func (xod XeroObjectDataset) AsAzureSQLDWTableDataset() (*AzureSQLDWTableDataset, bool) { + return nil, false +} + +// AsAzureSQLTableDataset is the BasicDataset implementation for XeroObjectDataset. +func (xod XeroObjectDataset) AsAzureSQLTableDataset() (*AzureSQLTableDataset, bool) { + return nil, false +} + +// AsAzureTableDataset is the BasicDataset implementation for XeroObjectDataset. +func (xod XeroObjectDataset) AsAzureTableDataset() (*AzureTableDataset, bool) { + return nil, false +} + +// AsAzureBlobDataset is the BasicDataset implementation for XeroObjectDataset. +func (xod XeroObjectDataset) AsAzureBlobDataset() (*AzureBlobDataset, bool) { + return nil, false +} + +// AsAmazonS3Dataset is the BasicDataset implementation for XeroObjectDataset. +func (xod XeroObjectDataset) AsAmazonS3Dataset() (*AmazonS3Dataset, bool) { + return nil, false +} + +// AsDataset is the BasicDataset implementation for XeroObjectDataset. +func (xod XeroObjectDataset) AsDataset() (*Dataset, bool) { + return nil, false +} + +// AsBasicDataset is the BasicDataset implementation for XeroObjectDataset. +func (xod XeroObjectDataset) AsBasicDataset() (BasicDataset, bool) { + return &xod, true +} + +// XeroSource a copy activity Xero Serivce source. +type XeroSource struct { + // Query - A query to retrieve data from source. Type: string (or Expression with resultType string). + Query interface{} `json:"query,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // SourceRetryCount - Source retry count. Type: integer (or Expression with resultType integer). + SourceRetryCount interface{} `json:"sourceRetryCount,omitempty"` + // SourceRetryWait - Source retry wait. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` + // Type - Possible values include: 'TypeCopySource', 'TypeAmazonRedshiftSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeHTTPSource', 'TypeAzureDataLakeStoreSource', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeRelationalSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource' + Type TypeBasicCopySource `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for XeroSource. +func (xs XeroSource) MarshalJSON() ([]byte, error) { + xs.Type = TypeXeroSource + objectMap := make(map[string]interface{}) + objectMap["query"] = xs.Query + objectMap["sourceRetryCount"] = xs.SourceRetryCount + objectMap["sourceRetryWait"] = xs.SourceRetryWait + if xs.Type != "" { + objectMap["type"] = xs.Type + } + for k, v := range xs.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsAmazonRedshiftSource is the BasicCopySource implementation for XeroSource. +func (xs XeroSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { + return nil, false +} + +// AsResponsysSource is the BasicCopySource implementation for XeroSource. +func (xs XeroSource) AsResponsysSource() (*ResponsysSource, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudSource is the BasicCopySource implementation for XeroSource. +func (xs XeroSource) AsSalesforceMarketingCloudSource() (*SalesforceMarketingCloudSource, bool) { + return nil, false +} + +// AsVerticaSource is the BasicCopySource implementation for XeroSource. +func (xs XeroSource) AsVerticaSource() (*VerticaSource, bool) { + return nil, false +} + +// AsNetezzaSource is the BasicCopySource implementation for XeroSource. +func (xs XeroSource) AsNetezzaSource() (*NetezzaSource, bool) { + return nil, false +} + +// AsZohoSource is the BasicCopySource implementation for XeroSource. +func (xs XeroSource) AsZohoSource() (*ZohoSource, bool) { + return nil, false +} + +// AsXeroSource is the BasicCopySource implementation for XeroSource. +func (xs XeroSource) AsXeroSource() (*XeroSource, bool) { + return &xs, true +} + +// AsSquareSource is the BasicCopySource implementation for XeroSource. +func (xs XeroSource) AsSquareSource() (*SquareSource, bool) { + return nil, false +} + +// AsSparkSource is the BasicCopySource implementation for XeroSource. +func (xs XeroSource) AsSparkSource() (*SparkSource, bool) { + return nil, false +} + +// AsShopifySource is the BasicCopySource implementation for XeroSource. +func (xs XeroSource) AsShopifySource() (*ShopifySource, bool) { + return nil, false +} + +// AsServiceNowSource is the BasicCopySource implementation for XeroSource. +func (xs XeroSource) AsServiceNowSource() (*ServiceNowSource, bool) { + return nil, false +} + +// AsQuickBooksSource is the BasicCopySource implementation for XeroSource. +func (xs XeroSource) AsQuickBooksSource() (*QuickBooksSource, bool) { + return nil, false +} + +// AsPrestoSource is the BasicCopySource implementation for XeroSource. +func (xs XeroSource) AsPrestoSource() (*PrestoSource, bool) { + return nil, false +} + +// AsPhoenixSource is the BasicCopySource implementation for XeroSource. +func (xs XeroSource) AsPhoenixSource() (*PhoenixSource, bool) { + return nil, false +} + +// AsPaypalSource is the BasicCopySource implementation for XeroSource. +func (xs XeroSource) AsPaypalSource() (*PaypalSource, bool) { + return nil, false +} + +// AsMarketoSource is the BasicCopySource implementation for XeroSource. +func (xs XeroSource) AsMarketoSource() (*MarketoSource, bool) { + return nil, false +} + +// AsMariaDBSource is the BasicCopySource implementation for XeroSource. +func (xs XeroSource) AsMariaDBSource() (*MariaDBSource, bool) { + return nil, false +} + +// AsMagentoSource is the BasicCopySource implementation for XeroSource. +func (xs XeroSource) AsMagentoSource() (*MagentoSource, bool) { + return nil, false +} + +// AsJiraSource is the BasicCopySource implementation for XeroSource. +func (xs XeroSource) AsJiraSource() (*JiraSource, bool) { + return nil, false +} + +// AsImpalaSource is the BasicCopySource implementation for XeroSource. +func (xs XeroSource) AsImpalaSource() (*ImpalaSource, bool) { + return nil, false +} + +// AsHubspotSource is the BasicCopySource implementation for XeroSource. +func (xs XeroSource) AsHubspotSource() (*HubspotSource, bool) { + return nil, false +} + +// AsHiveSource is the BasicCopySource implementation for XeroSource. +func (xs XeroSource) AsHiveSource() (*HiveSource, bool) { + return nil, false +} + +// AsHBaseSource is the BasicCopySource implementation for XeroSource. +func (xs XeroSource) AsHBaseSource() (*HBaseSource, bool) { + return nil, false +} + +// AsGreenplumSource is the BasicCopySource implementation for XeroSource. +func (xs XeroSource) AsGreenplumSource() (*GreenplumSource, bool) { + return nil, false +} + +// AsGoogleBigQuerySource is the BasicCopySource implementation for XeroSource. +func (xs XeroSource) AsGoogleBigQuerySource() (*GoogleBigQuerySource, bool) { + return nil, false +} + +// AsEloquaSource is the BasicCopySource implementation for XeroSource. +func (xs XeroSource) AsEloquaSource() (*EloquaSource, bool) { + return nil, false +} + +// AsDrillSource is the BasicCopySource implementation for XeroSource. +func (xs XeroSource) AsDrillSource() (*DrillSource, bool) { + return nil, false +} + +// AsCouchbaseSource is the BasicCopySource implementation for XeroSource. +func (xs XeroSource) AsCouchbaseSource() (*CouchbaseSource, bool) { + return nil, false +} + +// AsConcurSource is the BasicCopySource implementation for XeroSource. +func (xs XeroSource) AsConcurSource() (*ConcurSource, bool) { + return nil, false +} + +// AsAzurePostgreSQLSource is the BasicCopySource implementation for XeroSource. +func (xs XeroSource) AsAzurePostgreSQLSource() (*AzurePostgreSQLSource, bool) { + return nil, false +} + +// AsAmazonMWSSource is the BasicCopySource implementation for XeroSource. +func (xs XeroSource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { + return nil, false +} + +// AsHTTPSource is the BasicCopySource implementation for XeroSource. +func (xs XeroSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for XeroSource. +func (xs XeroSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for XeroSource. +func (xs XeroSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsCassandraSource is the BasicCopySource implementation for XeroSource. +func (xs XeroSource) AsCassandraSource() (*CassandraSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for XeroSource. +func (xs XeroSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for XeroSource. +func (xs XeroSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureMySQLSource is the BasicCopySource implementation for XeroSource. +func (xs XeroSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for XeroSource. +func (xs XeroSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for XeroSource. +func (xs XeroSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsSQLDWSource is the BasicCopySource implementation for XeroSource. +func (xs XeroSource) AsSQLDWSource() (*SQLDWSource, bool) { + return nil, false +} + +// AsSQLSource is the BasicCopySource implementation for XeroSource. +func (xs XeroSource) AsSQLSource() (*SQLSource, bool) { + return nil, false +} + +// AsSapEccSource is the BasicCopySource implementation for XeroSource. +func (xs XeroSource) AsSapEccSource() (*SapEccSource, bool) { + return nil, false +} + +// AsSapCloudForCustomerSource is the BasicCopySource implementation for XeroSource. +func (xs XeroSource) AsSapCloudForCustomerSource() (*SapCloudForCustomerSource, bool) { + return nil, false +} + +// AsSalesforceSource is the BasicCopySource implementation for XeroSource. +func (xs XeroSource) AsSalesforceSource() (*SalesforceSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for XeroSource. +func (xs XeroSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for XeroSource. +func (xs XeroSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for XeroSource. +func (xs XeroSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for XeroSource. +func (xs XeroSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + +// AsAzureTableSource is the BasicCopySource implementation for XeroSource. +func (xs XeroSource) AsAzureTableSource() (*AzureTableSource, bool) { + return nil, false +} + +// AsCopySource is the BasicCopySource implementation for XeroSource. +func (xs XeroSource) AsCopySource() (*CopySource, bool) { + return nil, false +} + +// AsBasicCopySource is the BasicCopySource implementation for XeroSource. +func (xs XeroSource) AsBasicCopySource() (BasicCopySource, bool) { + return &xs, true +} + +// ZohoLinkedService zoho server linked service. +type ZohoLinkedService struct { + // ZohoLinkedServiceTypeProperties - Zoho server linked service properties. + *ZohoLinkedServiceTypeProperties `json:"typeProperties,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // ConnectVia - The integration runtime reference. + ConnectVia *IntegrationRuntimeReference `json:"connectVia,omitempty"` + // Description - Linked service description. + Description *string `json:"description,omitempty"` + // Parameters - Parameters for linked service. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeLinkedService', 'TypeResponsys', 'TypeAzureDatabricks', 'TypeAzureDataLakeAnalytics', 'TypeHDInsightOnDemand', 'TypeSalesforceMarketingCloud', 'TypeNetezza', 'TypeVertica', 'TypeZoho', 'TypeXero', 'TypeSquare', 'TypeSpark', 'TypeShopify', 'TypeServiceNow', 'TypeQuickBooks', 'TypePresto', 'TypePhoenix', 'TypePaypal', 'TypeMarketo', 'TypeMariaDB', 'TypeMagento', 'TypeJira', 'TypeImpala', 'TypeHubspot', 'TypeHive', 'TypeHBase', 'TypeGreenplum', 'TypeGoogleBigQuery', 'TypeEloqua', 'TypeDrill', 'TypeCouchbase', 'TypeConcur', 'TypeAzurePostgreSQL', 'TypeAmazonMWS', 'TypeSapHana', 'TypeSapBW', 'TypeSftp', 'TypeFtpServer', 'TypeHTTPServer', 'TypeAzureSearch', 'TypeCustomDataSource', 'TypeAmazonRedshift', 'TypeAmazonS3', 'TypeSapEcc', 'TypeSapCloudForCustomer', 'TypeSalesforce', 'TypeAzureDataLakeStore', 'TypeMongoDb', 'TypeCassandra', 'TypeWeb', 'TypeOData', 'TypeHdfs', 'TypeOdbc', 'TypeAzureML', 'TypeTeradata', 'TypeDb2', 'TypeSybase', 'TypePostgreSQL', 'TypeMySQL', 'TypeAzureMySQL', 'TypeOracle', 'TypeFileServer', 'TypeHDInsight', 'TypeDynamics', 'TypeCosmosDb', 'TypeAzureKeyVault', 'TypeAzureBatch', 'TypeAzureSQLDatabase', 'TypeSQLServer', 'TypeAzureSQLDW', 'TypeAzureStorage' + Type TypeBasicLinkedService `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ZohoLinkedService. +func (zls ZohoLinkedService) MarshalJSON() ([]byte, error) { + zls.Type = TypeZoho + objectMap := make(map[string]interface{}) + if zls.ZohoLinkedServiceTypeProperties != nil { + objectMap["typeProperties"] = zls.ZohoLinkedServiceTypeProperties + } + if zls.ConnectVia != nil { + objectMap["connectVia"] = zls.ConnectVia + } + if zls.Description != nil { + objectMap["description"] = zls.Description + } + if zls.Parameters != nil { + objectMap["parameters"] = zls.Parameters + } + if zls.Annotations != nil { + objectMap["annotations"] = zls.Annotations + } + if zls.Type != "" { + objectMap["type"] = zls.Type + } + for k, v := range zls.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysLinkedService is the BasicLinkedService implementation for ZohoLinkedService. +func (zls ZohoLinkedService) AsResponsysLinkedService() (*ResponsysLinkedService, bool) { + return nil, false +} + +// AsAzureDatabricksLinkedService is the BasicLinkedService implementation for ZohoLinkedService. +func (zls ZohoLinkedService) AsAzureDatabricksLinkedService() (*AzureDatabricksLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeAnalyticsLinkedService is the BasicLinkedService implementation for ZohoLinkedService. +func (zls ZohoLinkedService) AsAzureDataLakeAnalyticsLinkedService() (*AzureDataLakeAnalyticsLinkedService, bool) { + return nil, false +} + +// AsHDInsightOnDemandLinkedService is the BasicLinkedService implementation for ZohoLinkedService. +func (zls ZohoLinkedService) AsHDInsightOnDemandLinkedService() (*HDInsightOnDemandLinkedService, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudLinkedService is the BasicLinkedService implementation for ZohoLinkedService. +func (zls ZohoLinkedService) AsSalesforceMarketingCloudLinkedService() (*SalesforceMarketingCloudLinkedService, bool) { + return nil, false +} + +// AsNetezzaLinkedService is the BasicLinkedService implementation for ZohoLinkedService. +func (zls ZohoLinkedService) AsNetezzaLinkedService() (*NetezzaLinkedService, bool) { + return nil, false +} + +// AsVerticaLinkedService is the BasicLinkedService implementation for ZohoLinkedService. +func (zls ZohoLinkedService) AsVerticaLinkedService() (*VerticaLinkedService, bool) { + return nil, false +} + +// AsZohoLinkedService is the BasicLinkedService implementation for ZohoLinkedService. +func (zls ZohoLinkedService) AsZohoLinkedService() (*ZohoLinkedService, bool) { + return &zls, true +} + +// AsXeroLinkedService is the BasicLinkedService implementation for ZohoLinkedService. +func (zls ZohoLinkedService) AsXeroLinkedService() (*XeroLinkedService, bool) { + return nil, false +} + +// AsSquareLinkedService is the BasicLinkedService implementation for ZohoLinkedService. +func (zls ZohoLinkedService) AsSquareLinkedService() (*SquareLinkedService, bool) { + return nil, false +} + +// AsSparkLinkedService is the BasicLinkedService implementation for ZohoLinkedService. +func (zls ZohoLinkedService) AsSparkLinkedService() (*SparkLinkedService, bool) { + return nil, false +} + +// AsShopifyLinkedService is the BasicLinkedService implementation for ZohoLinkedService. +func (zls ZohoLinkedService) AsShopifyLinkedService() (*ShopifyLinkedService, bool) { + return nil, false +} + +// AsServiceNowLinkedService is the BasicLinkedService implementation for ZohoLinkedService. +func (zls ZohoLinkedService) AsServiceNowLinkedService() (*ServiceNowLinkedService, bool) { + return nil, false +} + +// AsQuickBooksLinkedService is the BasicLinkedService implementation for ZohoLinkedService. +func (zls ZohoLinkedService) AsQuickBooksLinkedService() (*QuickBooksLinkedService, bool) { + return nil, false +} + +// AsPrestoLinkedService is the BasicLinkedService implementation for ZohoLinkedService. +func (zls ZohoLinkedService) AsPrestoLinkedService() (*PrestoLinkedService, bool) { + return nil, false +} + +// AsPhoenixLinkedService is the BasicLinkedService implementation for ZohoLinkedService. +func (zls ZohoLinkedService) AsPhoenixLinkedService() (*PhoenixLinkedService, bool) { + return nil, false +} + +// AsPaypalLinkedService is the BasicLinkedService implementation for ZohoLinkedService. +func (zls ZohoLinkedService) AsPaypalLinkedService() (*PaypalLinkedService, bool) { + return nil, false +} + +// AsMarketoLinkedService is the BasicLinkedService implementation for ZohoLinkedService. +func (zls ZohoLinkedService) AsMarketoLinkedService() (*MarketoLinkedService, bool) { + return nil, false +} + +// AsMariaDBLinkedService is the BasicLinkedService implementation for ZohoLinkedService. +func (zls ZohoLinkedService) AsMariaDBLinkedService() (*MariaDBLinkedService, bool) { + return nil, false +} + +// AsMagentoLinkedService is the BasicLinkedService implementation for ZohoLinkedService. +func (zls ZohoLinkedService) AsMagentoLinkedService() (*MagentoLinkedService, bool) { + return nil, false +} + +// AsJiraLinkedService is the BasicLinkedService implementation for ZohoLinkedService. +func (zls ZohoLinkedService) AsJiraLinkedService() (*JiraLinkedService, bool) { + return nil, false +} + +// AsImpalaLinkedService is the BasicLinkedService implementation for ZohoLinkedService. +func (zls ZohoLinkedService) AsImpalaLinkedService() (*ImpalaLinkedService, bool) { + return nil, false +} + +// AsHubspotLinkedService is the BasicLinkedService implementation for ZohoLinkedService. +func (zls ZohoLinkedService) AsHubspotLinkedService() (*HubspotLinkedService, bool) { + return nil, false +} + +// AsHiveLinkedService is the BasicLinkedService implementation for ZohoLinkedService. +func (zls ZohoLinkedService) AsHiveLinkedService() (*HiveLinkedService, bool) { + return nil, false +} + +// AsHBaseLinkedService is the BasicLinkedService implementation for ZohoLinkedService. +func (zls ZohoLinkedService) AsHBaseLinkedService() (*HBaseLinkedService, bool) { + return nil, false +} + +// AsGreenplumLinkedService is the BasicLinkedService implementation for ZohoLinkedService. +func (zls ZohoLinkedService) AsGreenplumLinkedService() (*GreenplumLinkedService, bool) { + return nil, false +} + +// AsGoogleBigQueryLinkedService is the BasicLinkedService implementation for ZohoLinkedService. +func (zls ZohoLinkedService) AsGoogleBigQueryLinkedService() (*GoogleBigQueryLinkedService, bool) { + return nil, false +} + +// AsEloquaLinkedService is the BasicLinkedService implementation for ZohoLinkedService. +func (zls ZohoLinkedService) AsEloquaLinkedService() (*EloquaLinkedService, bool) { + return nil, false +} + +// AsDrillLinkedService is the BasicLinkedService implementation for ZohoLinkedService. +func (zls ZohoLinkedService) AsDrillLinkedService() (*DrillLinkedService, bool) { + return nil, false +} + +// AsCouchbaseLinkedService is the BasicLinkedService implementation for ZohoLinkedService. +func (zls ZohoLinkedService) AsCouchbaseLinkedService() (*CouchbaseLinkedService, bool) { + return nil, false +} + +// AsConcurLinkedService is the BasicLinkedService implementation for ZohoLinkedService. +func (zls ZohoLinkedService) AsConcurLinkedService() (*ConcurLinkedService, bool) { + return nil, false +} + +// AsAzurePostgreSQLLinkedService is the BasicLinkedService implementation for ZohoLinkedService. +func (zls ZohoLinkedService) AsAzurePostgreSQLLinkedService() (*AzurePostgreSQLLinkedService, bool) { + return nil, false +} + +// AsAmazonMWSLinkedService is the BasicLinkedService implementation for ZohoLinkedService. +func (zls ZohoLinkedService) AsAmazonMWSLinkedService() (*AmazonMWSLinkedService, bool) { + return nil, false +} + +// AsSapHanaLinkedService is the BasicLinkedService implementation for ZohoLinkedService. +func (zls ZohoLinkedService) AsSapHanaLinkedService() (*SapHanaLinkedService, bool) { + return nil, false +} + +// AsSapBWLinkedService is the BasicLinkedService implementation for ZohoLinkedService. +func (zls ZohoLinkedService) AsSapBWLinkedService() (*SapBWLinkedService, bool) { + return nil, false +} + +// AsSftpServerLinkedService is the BasicLinkedService implementation for ZohoLinkedService. +func (zls ZohoLinkedService) AsSftpServerLinkedService() (*SftpServerLinkedService, bool) { + return nil, false +} + +// AsFtpServerLinkedService is the BasicLinkedService implementation for ZohoLinkedService. +func (zls ZohoLinkedService) AsFtpServerLinkedService() (*FtpServerLinkedService, bool) { + return nil, false +} + +// AsHTTPLinkedService is the BasicLinkedService implementation for ZohoLinkedService. +func (zls ZohoLinkedService) AsHTTPLinkedService() (*HTTPLinkedService, bool) { + return nil, false +} + +// AsAzureSearchLinkedService is the BasicLinkedService implementation for ZohoLinkedService. +func (zls ZohoLinkedService) AsAzureSearchLinkedService() (*AzureSearchLinkedService, bool) { + return nil, false +} + +// AsCustomDataSourceLinkedService is the BasicLinkedService implementation for ZohoLinkedService. +func (zls ZohoLinkedService) AsCustomDataSourceLinkedService() (*CustomDataSourceLinkedService, bool) { + return nil, false +} + +// AsAmazonRedshiftLinkedService is the BasicLinkedService implementation for ZohoLinkedService. +func (zls ZohoLinkedService) AsAmazonRedshiftLinkedService() (*AmazonRedshiftLinkedService, bool) { + return nil, false +} + +// AsAmazonS3LinkedService is the BasicLinkedService implementation for ZohoLinkedService. +func (zls ZohoLinkedService) AsAmazonS3LinkedService() (*AmazonS3LinkedService, bool) { + return nil, false +} + +// AsSapEccLinkedService is the BasicLinkedService implementation for ZohoLinkedService. +func (zls ZohoLinkedService) AsSapEccLinkedService() (*SapEccLinkedService, bool) { + return nil, false +} + +// AsSapCloudForCustomerLinkedService is the BasicLinkedService implementation for ZohoLinkedService. +func (zls ZohoLinkedService) AsSapCloudForCustomerLinkedService() (*SapCloudForCustomerLinkedService, bool) { + return nil, false +} + +// AsSalesforceLinkedService is the BasicLinkedService implementation for ZohoLinkedService. +func (zls ZohoLinkedService) AsSalesforceLinkedService() (*SalesforceLinkedService, bool) { + return nil, false +} + +// AsAzureDataLakeStoreLinkedService is the BasicLinkedService implementation for ZohoLinkedService. +func (zls ZohoLinkedService) AsAzureDataLakeStoreLinkedService() (*AzureDataLakeStoreLinkedService, bool) { + return nil, false +} + +// AsMongoDbLinkedService is the BasicLinkedService implementation for ZohoLinkedService. +func (zls ZohoLinkedService) AsMongoDbLinkedService() (*MongoDbLinkedService, bool) { + return nil, false +} + +// AsCassandraLinkedService is the BasicLinkedService implementation for ZohoLinkedService. +func (zls ZohoLinkedService) AsCassandraLinkedService() (*CassandraLinkedService, bool) { + return nil, false +} + +// AsWebLinkedService is the BasicLinkedService implementation for ZohoLinkedService. +func (zls ZohoLinkedService) AsWebLinkedService() (*WebLinkedService, bool) { + return nil, false +} + +// AsODataLinkedService is the BasicLinkedService implementation for ZohoLinkedService. +func (zls ZohoLinkedService) AsODataLinkedService() (*ODataLinkedService, bool) { + return nil, false +} + +// AsHdfsLinkedService is the BasicLinkedService implementation for ZohoLinkedService. +func (zls ZohoLinkedService) AsHdfsLinkedService() (*HdfsLinkedService, bool) { + return nil, false +} + +// AsOdbcLinkedService is the BasicLinkedService implementation for ZohoLinkedService. +func (zls ZohoLinkedService) AsOdbcLinkedService() (*OdbcLinkedService, bool) { + return nil, false +} + +// AsAzureMLLinkedService is the BasicLinkedService implementation for ZohoLinkedService. +func (zls ZohoLinkedService) AsAzureMLLinkedService() (*AzureMLLinkedService, bool) { + return nil, false +} + +// AsTeradataLinkedService is the BasicLinkedService implementation for ZohoLinkedService. +func (zls ZohoLinkedService) AsTeradataLinkedService() (*TeradataLinkedService, bool) { + return nil, false +} + +// AsDb2LinkedService is the BasicLinkedService implementation for ZohoLinkedService. +func (zls ZohoLinkedService) AsDb2LinkedService() (*Db2LinkedService, bool) { + return nil, false +} + +// AsSybaseLinkedService is the BasicLinkedService implementation for ZohoLinkedService. +func (zls ZohoLinkedService) AsSybaseLinkedService() (*SybaseLinkedService, bool) { + return nil, false +} + +// AsPostgreSQLLinkedService is the BasicLinkedService implementation for ZohoLinkedService. +func (zls ZohoLinkedService) AsPostgreSQLLinkedService() (*PostgreSQLLinkedService, bool) { + return nil, false +} + +// AsMySQLLinkedService is the BasicLinkedService implementation for ZohoLinkedService. +func (zls ZohoLinkedService) AsMySQLLinkedService() (*MySQLLinkedService, bool) { + return nil, false +} + +// AsAzureMySQLLinkedService is the BasicLinkedService implementation for ZohoLinkedService. +func (zls ZohoLinkedService) AsAzureMySQLLinkedService() (*AzureMySQLLinkedService, bool) { + return nil, false +} + +// AsOracleLinkedService is the BasicLinkedService implementation for ZohoLinkedService. +func (zls ZohoLinkedService) AsOracleLinkedService() (*OracleLinkedService, bool) { + return nil, false +} + +// AsFileServerLinkedService is the BasicLinkedService implementation for ZohoLinkedService. +func (zls ZohoLinkedService) AsFileServerLinkedService() (*FileServerLinkedService, bool) { + return nil, false +} + +// AsHDInsightLinkedService is the BasicLinkedService implementation for ZohoLinkedService. +func (zls ZohoLinkedService) AsHDInsightLinkedService() (*HDInsightLinkedService, bool) { + return nil, false +} + +// AsDynamicsLinkedService is the BasicLinkedService implementation for ZohoLinkedService. +func (zls ZohoLinkedService) AsDynamicsLinkedService() (*DynamicsLinkedService, bool) { + return nil, false +} + +// AsCosmosDbLinkedService is the BasicLinkedService implementation for ZohoLinkedService. +func (zls ZohoLinkedService) AsCosmosDbLinkedService() (*CosmosDbLinkedService, bool) { + return nil, false +} + +// AsAzureKeyVaultLinkedService is the BasicLinkedService implementation for ZohoLinkedService. +func (zls ZohoLinkedService) AsAzureKeyVaultLinkedService() (*AzureKeyVaultLinkedService, bool) { + return nil, false +} + +// AsAzureBatchLinkedService is the BasicLinkedService implementation for ZohoLinkedService. +func (zls ZohoLinkedService) AsAzureBatchLinkedService() (*AzureBatchLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDatabaseLinkedService is the BasicLinkedService implementation for ZohoLinkedService. +func (zls ZohoLinkedService) AsAzureSQLDatabaseLinkedService() (*AzureSQLDatabaseLinkedService, bool) { + return nil, false +} + +// AsSQLServerLinkedService is the BasicLinkedService implementation for ZohoLinkedService. +func (zls ZohoLinkedService) AsSQLServerLinkedService() (*SQLServerLinkedService, bool) { + return nil, false +} + +// AsAzureSQLDWLinkedService is the BasicLinkedService implementation for ZohoLinkedService. +func (zls ZohoLinkedService) AsAzureSQLDWLinkedService() (*AzureSQLDWLinkedService, bool) { + return nil, false +} + +// AsAzureStorageLinkedService is the BasicLinkedService implementation for ZohoLinkedService. +func (zls ZohoLinkedService) AsAzureStorageLinkedService() (*AzureStorageLinkedService, bool) { + return nil, false +} + +// AsLinkedService is the BasicLinkedService implementation for ZohoLinkedService. +func (zls ZohoLinkedService) AsLinkedService() (*LinkedService, bool) { + return nil, false +} + +// AsBasicLinkedService is the BasicLinkedService implementation for ZohoLinkedService. +func (zls ZohoLinkedService) AsBasicLinkedService() (BasicLinkedService, bool) { + return &zls, true +} + +// UnmarshalJSON is the custom unmarshaler for ZohoLinkedService struct. +func (zls *ZohoLinkedService) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "typeProperties": + if v != nil { + var zohoLinkedServiceTypeProperties ZohoLinkedServiceTypeProperties + err = json.Unmarshal(*v, &zohoLinkedServiceTypeProperties) + if err != nil { + return err + } + zls.ZohoLinkedServiceTypeProperties = &zohoLinkedServiceTypeProperties + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if zls.AdditionalProperties == nil { + zls.AdditionalProperties = make(map[string]interface{}) + } + zls.AdditionalProperties[k] = additionalProperties + } + case "connectVia": + if v != nil { + var connectVia IntegrationRuntimeReference + err = json.Unmarshal(*v, &connectVia) + if err != nil { + return err + } + zls.ConnectVia = &connectVia + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + zls.Description = &description + } + case "parameters": + if v != nil { + var parameters map[string]*ParameterSpecification + err = json.Unmarshal(*v, ¶meters) + if err != nil { + return err + } + zls.Parameters = parameters + } + case "annotations": + if v != nil { + var annotations []interface{} + err = json.Unmarshal(*v, &annotations) + if err != nil { + return err + } + zls.Annotations = &annotations + } + case "type": + if v != nil { + var typeVar TypeBasicLinkedService + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + zls.Type = typeVar + } + } + } + + return nil +} + +// ZohoLinkedServiceTypeProperties zoho server linked service properties. +type ZohoLinkedServiceTypeProperties struct { + // Endpoint - The endpoint of the Zoho server. (i.e. crm.zoho.com/crm/private) + Endpoint interface{} `json:"endpoint,omitempty"` + // AccessToken - The access token for Zoho authentication. + AccessToken BasicSecretBase `json:"accessToken,omitempty"` + // UseEncryptedEndpoints - Specifies whether the data source endpoints are encrypted using HTTPS. The default value is true. + UseEncryptedEndpoints interface{} `json:"useEncryptedEndpoints,omitempty"` + // UseHostVerification - Specifies whether to require the host name in the server's certificate to match the host name of the server when connecting over SSL. The default value is true. + UseHostVerification interface{} `json:"useHostVerification,omitempty"` + // UsePeerVerification - Specifies whether to verify the identity of the server when connecting over SSL. The default value is true. + UsePeerVerification interface{} `json:"usePeerVerification,omitempty"` + // EncryptedCredential - The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string). + EncryptedCredential interface{} `json:"encryptedCredential,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for ZohoLinkedServiceTypeProperties struct. +func (zlstp *ZohoLinkedServiceTypeProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "endpoint": + if v != nil { + var endpoint interface{} + err = json.Unmarshal(*v, &endpoint) + if err != nil { + return err + } + zlstp.Endpoint = endpoint + } + case "accessToken": + if v != nil { + accessToken, err := unmarshalBasicSecretBase(*v) + if err != nil { + return err + } + zlstp.AccessToken = accessToken + } + case "useEncryptedEndpoints": + if v != nil { + var useEncryptedEndpoints interface{} + err = json.Unmarshal(*v, &useEncryptedEndpoints) + if err != nil { + return err + } + zlstp.UseEncryptedEndpoints = useEncryptedEndpoints + } + case "useHostVerification": + if v != nil { + var useHostVerification interface{} + err = json.Unmarshal(*v, &useHostVerification) + if err != nil { + return err + } + zlstp.UseHostVerification = useHostVerification + } + case "usePeerVerification": + if v != nil { + var usePeerVerification interface{} + err = json.Unmarshal(*v, &usePeerVerification) + if err != nil { + return err + } + zlstp.UsePeerVerification = usePeerVerification + } + case "encryptedCredential": + if v != nil { + var encryptedCredential interface{} + err = json.Unmarshal(*v, &encryptedCredential) + if err != nil { + return err + } + zlstp.EncryptedCredential = encryptedCredential + } + } + } + + return nil +} + +// ZohoObjectDataset zoho server dataset. +type ZohoObjectDataset struct { + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Description - Dataset description. + Description *string `json:"description,omitempty"` + // Structure - Columns that define the structure of the dataset. Type: array (or Expression with resultType array), itemType: DatasetDataElement. + Structure interface{} `json:"structure,omitempty"` + // LinkedServiceName - Linked service reference. + LinkedServiceName *LinkedServiceReference `json:"linkedServiceName,omitempty"` + // Parameters - Parameters for dataset. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Type - Possible values include: 'TypeDataset', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSQLServerTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSalesforceObject', 'TypeRelationalTable', 'TypeAzureMySQLTable', 'TypeOracleTable', 'TypeODataResource', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeAzureDataLakeStoreFile', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeAmazonS3Object' + Type TypeBasicDataset `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ZohoObjectDataset. +func (zod ZohoObjectDataset) MarshalJSON() ([]byte, error) { + zod.Type = TypeZohoObject + objectMap := make(map[string]interface{}) + if zod.Description != nil { + objectMap["description"] = zod.Description + } + objectMap["structure"] = zod.Structure + if zod.LinkedServiceName != nil { + objectMap["linkedServiceName"] = zod.LinkedServiceName + } + if zod.Parameters != nil { + objectMap["parameters"] = zod.Parameters + } + if zod.Annotations != nil { + objectMap["annotations"] = zod.Annotations + } + if zod.Type != "" { + objectMap["type"] = zod.Type + } + for k, v := range zod.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsResponsysObjectDataset is the BasicDataset implementation for ZohoObjectDataset. +func (zod ZohoObjectDataset) AsResponsysObjectDataset() (*ResponsysObjectDataset, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudObjectDataset is the BasicDataset implementation for ZohoObjectDataset. +func (zod ZohoObjectDataset) AsSalesforceMarketingCloudObjectDataset() (*SalesforceMarketingCloudObjectDataset, bool) { + return nil, false +} + +// AsVerticaTableDataset is the BasicDataset implementation for ZohoObjectDataset. +func (zod ZohoObjectDataset) AsVerticaTableDataset() (*VerticaTableDataset, bool) { + return nil, false +} + +// AsNetezzaTableDataset is the BasicDataset implementation for ZohoObjectDataset. +func (zod ZohoObjectDataset) AsNetezzaTableDataset() (*NetezzaTableDataset, bool) { + return nil, false +} + +// AsZohoObjectDataset is the BasicDataset implementation for ZohoObjectDataset. +func (zod ZohoObjectDataset) AsZohoObjectDataset() (*ZohoObjectDataset, bool) { + return &zod, true +} + +// AsXeroObjectDataset is the BasicDataset implementation for ZohoObjectDataset. +func (zod ZohoObjectDataset) AsXeroObjectDataset() (*XeroObjectDataset, bool) { + return nil, false +} + +// AsSquareObjectDataset is the BasicDataset implementation for ZohoObjectDataset. +func (zod ZohoObjectDataset) AsSquareObjectDataset() (*SquareObjectDataset, bool) { + return nil, false +} + +// AsSparkObjectDataset is the BasicDataset implementation for ZohoObjectDataset. +func (zod ZohoObjectDataset) AsSparkObjectDataset() (*SparkObjectDataset, bool) { + return nil, false +} + +// AsShopifyObjectDataset is the BasicDataset implementation for ZohoObjectDataset. +func (zod ZohoObjectDataset) AsShopifyObjectDataset() (*ShopifyObjectDataset, bool) { + return nil, false +} + +// AsServiceNowObjectDataset is the BasicDataset implementation for ZohoObjectDataset. +func (zod ZohoObjectDataset) AsServiceNowObjectDataset() (*ServiceNowObjectDataset, bool) { + return nil, false +} + +// AsQuickBooksObjectDataset is the BasicDataset implementation for ZohoObjectDataset. +func (zod ZohoObjectDataset) AsQuickBooksObjectDataset() (*QuickBooksObjectDataset, bool) { + return nil, false +} + +// AsPrestoObjectDataset is the BasicDataset implementation for ZohoObjectDataset. +func (zod ZohoObjectDataset) AsPrestoObjectDataset() (*PrestoObjectDataset, bool) { + return nil, false +} + +// AsPhoenixObjectDataset is the BasicDataset implementation for ZohoObjectDataset. +func (zod ZohoObjectDataset) AsPhoenixObjectDataset() (*PhoenixObjectDataset, bool) { + return nil, false +} + +// AsPaypalObjectDataset is the BasicDataset implementation for ZohoObjectDataset. +func (zod ZohoObjectDataset) AsPaypalObjectDataset() (*PaypalObjectDataset, bool) { + return nil, false +} + +// AsMarketoObjectDataset is the BasicDataset implementation for ZohoObjectDataset. +func (zod ZohoObjectDataset) AsMarketoObjectDataset() (*MarketoObjectDataset, bool) { + return nil, false +} + +// AsMariaDBTableDataset is the BasicDataset implementation for ZohoObjectDataset. +func (zod ZohoObjectDataset) AsMariaDBTableDataset() (*MariaDBTableDataset, bool) { + return nil, false +} + +// AsMagentoObjectDataset is the BasicDataset implementation for ZohoObjectDataset. +func (zod ZohoObjectDataset) AsMagentoObjectDataset() (*MagentoObjectDataset, bool) { + return nil, false +} + +// AsJiraObjectDataset is the BasicDataset implementation for ZohoObjectDataset. +func (zod ZohoObjectDataset) AsJiraObjectDataset() (*JiraObjectDataset, bool) { + return nil, false +} + +// AsImpalaObjectDataset is the BasicDataset implementation for ZohoObjectDataset. +func (zod ZohoObjectDataset) AsImpalaObjectDataset() (*ImpalaObjectDataset, bool) { + return nil, false +} + +// AsHubspotObjectDataset is the BasicDataset implementation for ZohoObjectDataset. +func (zod ZohoObjectDataset) AsHubspotObjectDataset() (*HubspotObjectDataset, bool) { + return nil, false +} + +// AsHiveObjectDataset is the BasicDataset implementation for ZohoObjectDataset. +func (zod ZohoObjectDataset) AsHiveObjectDataset() (*HiveObjectDataset, bool) { + return nil, false +} + +// AsHBaseObjectDataset is the BasicDataset implementation for ZohoObjectDataset. +func (zod ZohoObjectDataset) AsHBaseObjectDataset() (*HBaseObjectDataset, bool) { + return nil, false +} + +// AsGreenplumTableDataset is the BasicDataset implementation for ZohoObjectDataset. +func (zod ZohoObjectDataset) AsGreenplumTableDataset() (*GreenplumTableDataset, bool) { + return nil, false +} + +// AsGoogleBigQueryObjectDataset is the BasicDataset implementation for ZohoObjectDataset. +func (zod ZohoObjectDataset) AsGoogleBigQueryObjectDataset() (*GoogleBigQueryObjectDataset, bool) { + return nil, false +} + +// AsEloquaObjectDataset is the BasicDataset implementation for ZohoObjectDataset. +func (zod ZohoObjectDataset) AsEloquaObjectDataset() (*EloquaObjectDataset, bool) { + return nil, false +} + +// AsDrillTableDataset is the BasicDataset implementation for ZohoObjectDataset. +func (zod ZohoObjectDataset) AsDrillTableDataset() (*DrillTableDataset, bool) { + return nil, false +} + +// AsCouchbaseTableDataset is the BasicDataset implementation for ZohoObjectDataset. +func (zod ZohoObjectDataset) AsCouchbaseTableDataset() (*CouchbaseTableDataset, bool) { + return nil, false +} + +// AsConcurObjectDataset is the BasicDataset implementation for ZohoObjectDataset. +func (zod ZohoObjectDataset) AsConcurObjectDataset() (*ConcurObjectDataset, bool) { + return nil, false +} + +// AsAzurePostgreSQLTableDataset is the BasicDataset implementation for ZohoObjectDataset. +func (zod ZohoObjectDataset) AsAzurePostgreSQLTableDataset() (*AzurePostgreSQLTableDataset, bool) { + return nil, false +} + +// AsAmazonMWSObjectDataset is the BasicDataset implementation for ZohoObjectDataset. +func (zod ZohoObjectDataset) AsAmazonMWSObjectDataset() (*AmazonMWSObjectDataset, bool) { + return nil, false +} + +// AsHTTPDataset is the BasicDataset implementation for ZohoObjectDataset. +func (zod ZohoObjectDataset) AsHTTPDataset() (*HTTPDataset, bool) { + return nil, false +} + +// AsAzureSearchIndexDataset is the BasicDataset implementation for ZohoObjectDataset. +func (zod ZohoObjectDataset) AsAzureSearchIndexDataset() (*AzureSearchIndexDataset, bool) { + return nil, false +} + +// AsWebTableDataset is the BasicDataset implementation for ZohoObjectDataset. +func (zod ZohoObjectDataset) AsWebTableDataset() (*WebTableDataset, bool) { + return nil, false +} + +// AsSQLServerTableDataset is the BasicDataset implementation for ZohoObjectDataset. +func (zod ZohoObjectDataset) AsSQLServerTableDataset() (*SQLServerTableDataset, bool) { + return nil, false +} + +// AsSapEccResourceDataset is the BasicDataset implementation for ZohoObjectDataset. +func (zod ZohoObjectDataset) AsSapEccResourceDataset() (*SapEccResourceDataset, bool) { + return nil, false +} + +// AsSapCloudForCustomerResourceDataset is the BasicDataset implementation for ZohoObjectDataset. +func (zod ZohoObjectDataset) AsSapCloudForCustomerResourceDataset() (*SapCloudForCustomerResourceDataset, bool) { + return nil, false +} + +// AsSalesforceObjectDataset is the BasicDataset implementation for ZohoObjectDataset. +func (zod ZohoObjectDataset) AsSalesforceObjectDataset() (*SalesforceObjectDataset, bool) { + return nil, false +} + +// AsRelationalTableDataset is the BasicDataset implementation for ZohoObjectDataset. +func (zod ZohoObjectDataset) AsRelationalTableDataset() (*RelationalTableDataset, bool) { + return nil, false +} + +// AsAzureMySQLTableDataset is the BasicDataset implementation for ZohoObjectDataset. +func (zod ZohoObjectDataset) AsAzureMySQLTableDataset() (*AzureMySQLTableDataset, bool) { + return nil, false +} + +// AsOracleTableDataset is the BasicDataset implementation for ZohoObjectDataset. +func (zod ZohoObjectDataset) AsOracleTableDataset() (*OracleTableDataset, bool) { + return nil, false +} + +// AsODataResourceDataset is the BasicDataset implementation for ZohoObjectDataset. +func (zod ZohoObjectDataset) AsODataResourceDataset() (*ODataResourceDataset, bool) { + return nil, false +} + +// AsMongoDbCollectionDataset is the BasicDataset implementation for ZohoObjectDataset. +func (zod ZohoObjectDataset) AsMongoDbCollectionDataset() (*MongoDbCollectionDataset, bool) { + return nil, false +} + +// AsFileShareDataset is the BasicDataset implementation for ZohoObjectDataset. +func (zod ZohoObjectDataset) AsFileShareDataset() (*FileShareDataset, bool) { + return nil, false +} + +// AsAzureDataLakeStoreDataset is the BasicDataset implementation for ZohoObjectDataset. +func (zod ZohoObjectDataset) AsAzureDataLakeStoreDataset() (*AzureDataLakeStoreDataset, bool) { + return nil, false +} + +// AsDynamicsEntityDataset is the BasicDataset implementation for ZohoObjectDataset. +func (zod ZohoObjectDataset) AsDynamicsEntityDataset() (*DynamicsEntityDataset, bool) { + return nil, false +} + +// AsDocumentDbCollectionDataset is the BasicDataset implementation for ZohoObjectDataset. +func (zod ZohoObjectDataset) AsDocumentDbCollectionDataset() (*DocumentDbCollectionDataset, bool) { + return nil, false +} + +// AsCustomDataset is the BasicDataset implementation for ZohoObjectDataset. +func (zod ZohoObjectDataset) AsCustomDataset() (*CustomDataset, bool) { + return nil, false +} + +// AsCassandraTableDataset is the BasicDataset implementation for ZohoObjectDataset. +func (zod ZohoObjectDataset) AsCassandraTableDataset() (*CassandraTableDataset, bool) { + return nil, false +} + +// AsAzureSQLDWTableDataset is the BasicDataset implementation for ZohoObjectDataset. +func (zod ZohoObjectDataset) AsAzureSQLDWTableDataset() (*AzureSQLDWTableDataset, bool) { + return nil, false +} + +// AsAzureSQLTableDataset is the BasicDataset implementation for ZohoObjectDataset. +func (zod ZohoObjectDataset) AsAzureSQLTableDataset() (*AzureSQLTableDataset, bool) { + return nil, false +} + +// AsAzureTableDataset is the BasicDataset implementation for ZohoObjectDataset. +func (zod ZohoObjectDataset) AsAzureTableDataset() (*AzureTableDataset, bool) { + return nil, false +} + +// AsAzureBlobDataset is the BasicDataset implementation for ZohoObjectDataset. +func (zod ZohoObjectDataset) AsAzureBlobDataset() (*AzureBlobDataset, bool) { + return nil, false +} + +// AsAmazonS3Dataset is the BasicDataset implementation for ZohoObjectDataset. +func (zod ZohoObjectDataset) AsAmazonS3Dataset() (*AmazonS3Dataset, bool) { + return nil, false +} + +// AsDataset is the BasicDataset implementation for ZohoObjectDataset. +func (zod ZohoObjectDataset) AsDataset() (*Dataset, bool) { + return nil, false +} + +// AsBasicDataset is the BasicDataset implementation for ZohoObjectDataset. +func (zod ZohoObjectDataset) AsBasicDataset() (BasicDataset, bool) { + return &zod, true +} + +// ZohoSource a copy activity Zoho server source. +type ZohoSource struct { + // Query - A query to retrieve data from source. Type: string (or Expression with resultType string). + Query interface{} `json:"query,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // SourceRetryCount - Source retry count. Type: integer (or Expression with resultType integer). + SourceRetryCount interface{} `json:"sourceRetryCount,omitempty"` + // SourceRetryWait - Source retry wait. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` + // Type - Possible values include: 'TypeCopySource', 'TypeAmazonRedshiftSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeHTTPSource', 'TypeAzureDataLakeStoreSource', 'TypeMongoDbSource', 'TypeCassandraSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureMySQLSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeSQLDWSource', 'TypeSQLSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeRelationalSource', 'TypeDynamicsSource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAzureTableSource' + Type TypeBasicCopySource `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ZohoSource. +func (zs ZohoSource) MarshalJSON() ([]byte, error) { + zs.Type = TypeZohoSource + objectMap := make(map[string]interface{}) + objectMap["query"] = zs.Query + objectMap["sourceRetryCount"] = zs.SourceRetryCount + objectMap["sourceRetryWait"] = zs.SourceRetryWait + if zs.Type != "" { + objectMap["type"] = zs.Type + } + for k, v := range zs.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsAmazonRedshiftSource is the BasicCopySource implementation for ZohoSource. +func (zs ZohoSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { + return nil, false +} + +// AsResponsysSource is the BasicCopySource implementation for ZohoSource. +func (zs ZohoSource) AsResponsysSource() (*ResponsysSource, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudSource is the BasicCopySource implementation for ZohoSource. +func (zs ZohoSource) AsSalesforceMarketingCloudSource() (*SalesforceMarketingCloudSource, bool) { + return nil, false +} + +// AsVerticaSource is the BasicCopySource implementation for ZohoSource. +func (zs ZohoSource) AsVerticaSource() (*VerticaSource, bool) { + return nil, false +} + +// AsNetezzaSource is the BasicCopySource implementation for ZohoSource. +func (zs ZohoSource) AsNetezzaSource() (*NetezzaSource, bool) { + return nil, false +} + +// AsZohoSource is the BasicCopySource implementation for ZohoSource. +func (zs ZohoSource) AsZohoSource() (*ZohoSource, bool) { + return &zs, true +} + +// AsXeroSource is the BasicCopySource implementation for ZohoSource. +func (zs ZohoSource) AsXeroSource() (*XeroSource, bool) { + return nil, false +} + +// AsSquareSource is the BasicCopySource implementation for ZohoSource. +func (zs ZohoSource) AsSquareSource() (*SquareSource, bool) { + return nil, false +} + +// AsSparkSource is the BasicCopySource implementation for ZohoSource. +func (zs ZohoSource) AsSparkSource() (*SparkSource, bool) { + return nil, false +} + +// AsShopifySource is the BasicCopySource implementation for ZohoSource. +func (zs ZohoSource) AsShopifySource() (*ShopifySource, bool) { + return nil, false +} + +// AsServiceNowSource is the BasicCopySource implementation for ZohoSource. +func (zs ZohoSource) AsServiceNowSource() (*ServiceNowSource, bool) { + return nil, false +} + +// AsQuickBooksSource is the BasicCopySource implementation for ZohoSource. +func (zs ZohoSource) AsQuickBooksSource() (*QuickBooksSource, bool) { + return nil, false +} + +// AsPrestoSource is the BasicCopySource implementation for ZohoSource. +func (zs ZohoSource) AsPrestoSource() (*PrestoSource, bool) { + return nil, false +} + +// AsPhoenixSource is the BasicCopySource implementation for ZohoSource. +func (zs ZohoSource) AsPhoenixSource() (*PhoenixSource, bool) { + return nil, false +} + +// AsPaypalSource is the BasicCopySource implementation for ZohoSource. +func (zs ZohoSource) AsPaypalSource() (*PaypalSource, bool) { + return nil, false +} + +// AsMarketoSource is the BasicCopySource implementation for ZohoSource. +func (zs ZohoSource) AsMarketoSource() (*MarketoSource, bool) { + return nil, false +} + +// AsMariaDBSource is the BasicCopySource implementation for ZohoSource. +func (zs ZohoSource) AsMariaDBSource() (*MariaDBSource, bool) { + return nil, false +} + +// AsMagentoSource is the BasicCopySource implementation for ZohoSource. +func (zs ZohoSource) AsMagentoSource() (*MagentoSource, bool) { + return nil, false +} + +// AsJiraSource is the BasicCopySource implementation for ZohoSource. +func (zs ZohoSource) AsJiraSource() (*JiraSource, bool) { + return nil, false +} + +// AsImpalaSource is the BasicCopySource implementation for ZohoSource. +func (zs ZohoSource) AsImpalaSource() (*ImpalaSource, bool) { + return nil, false +} + +// AsHubspotSource is the BasicCopySource implementation for ZohoSource. +func (zs ZohoSource) AsHubspotSource() (*HubspotSource, bool) { + return nil, false +} + +// AsHiveSource is the BasicCopySource implementation for ZohoSource. +func (zs ZohoSource) AsHiveSource() (*HiveSource, bool) { + return nil, false +} + +// AsHBaseSource is the BasicCopySource implementation for ZohoSource. +func (zs ZohoSource) AsHBaseSource() (*HBaseSource, bool) { + return nil, false +} + +// AsGreenplumSource is the BasicCopySource implementation for ZohoSource. +func (zs ZohoSource) AsGreenplumSource() (*GreenplumSource, bool) { + return nil, false +} + +// AsGoogleBigQuerySource is the BasicCopySource implementation for ZohoSource. +func (zs ZohoSource) AsGoogleBigQuerySource() (*GoogleBigQuerySource, bool) { + return nil, false +} + +// AsEloquaSource is the BasicCopySource implementation for ZohoSource. +func (zs ZohoSource) AsEloquaSource() (*EloquaSource, bool) { + return nil, false +} + +// AsDrillSource is the BasicCopySource implementation for ZohoSource. +func (zs ZohoSource) AsDrillSource() (*DrillSource, bool) { + return nil, false +} + +// AsCouchbaseSource is the BasicCopySource implementation for ZohoSource. +func (zs ZohoSource) AsCouchbaseSource() (*CouchbaseSource, bool) { + return nil, false +} + +// AsConcurSource is the BasicCopySource implementation for ZohoSource. +func (zs ZohoSource) AsConcurSource() (*ConcurSource, bool) { + return nil, false +} + +// AsAzurePostgreSQLSource is the BasicCopySource implementation for ZohoSource. +func (zs ZohoSource) AsAzurePostgreSQLSource() (*AzurePostgreSQLSource, bool) { + return nil, false +} + +// AsAmazonMWSSource is the BasicCopySource implementation for ZohoSource. +func (zs ZohoSource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { + return nil, false +} + +// AsHTTPSource is the BasicCopySource implementation for ZohoSource. +func (zs ZohoSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for ZohoSource. +func (zs ZohoSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for ZohoSource. +func (zs ZohoSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsCassandraSource is the BasicCopySource implementation for ZohoSource. +func (zs ZohoSource) AsCassandraSource() (*CassandraSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for ZohoSource. +func (zs ZohoSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for ZohoSource. +func (zs ZohoSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureMySQLSource is the BasicCopySource implementation for ZohoSource. +func (zs ZohoSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for ZohoSource. +func (zs ZohoSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for ZohoSource. +func (zs ZohoSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsSQLDWSource is the BasicCopySource implementation for ZohoSource. +func (zs ZohoSource) AsSQLDWSource() (*SQLDWSource, bool) { + return nil, false +} + +// AsSQLSource is the BasicCopySource implementation for ZohoSource. +func (zs ZohoSource) AsSQLSource() (*SQLSource, bool) { + return nil, false +} + +// AsSapEccSource is the BasicCopySource implementation for ZohoSource. +func (zs ZohoSource) AsSapEccSource() (*SapEccSource, bool) { + return nil, false +} + +// AsSapCloudForCustomerSource is the BasicCopySource implementation for ZohoSource. +func (zs ZohoSource) AsSapCloudForCustomerSource() (*SapCloudForCustomerSource, bool) { + return nil, false +} + +// AsSalesforceSource is the BasicCopySource implementation for ZohoSource. +func (zs ZohoSource) AsSalesforceSource() (*SalesforceSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for ZohoSource. +func (zs ZohoSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for ZohoSource. +func (zs ZohoSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for ZohoSource. +func (zs ZohoSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for ZohoSource. +func (zs ZohoSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + +// AsAzureTableSource is the BasicCopySource implementation for ZohoSource. +func (zs ZohoSource) AsAzureTableSource() (*AzureTableSource, bool) { + return nil, false +} + +// AsCopySource is the BasicCopySource implementation for ZohoSource. +func (zs ZohoSource) AsCopySource() (*CopySource, bool) { + return nil, false +} + +// AsBasicCopySource is the BasicCopySource implementation for ZohoSource. +func (zs ZohoSource) AsBasicCopySource() (BasicCopySource, bool) { + return &zs, true +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory/operations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory/operations.go new file mode 100644 index 000000000..4a5bf7bfa --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory/operations.go @@ -0,0 +1,127 @@ +package datafactory + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "net/http" +) + +// OperationsClient is the the Azure Data Factory V2 management API provides a RESTful set of web services that +// interact with Azure Data Factory V2 services. +type OperationsClient struct { + BaseClient +} + +// NewOperationsClient creates an instance of the OperationsClient client. +func NewOperationsClient(subscriptionID string) OperationsClient { + return NewOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewOperationsClientWithBaseURI creates an instance of the OperationsClient client. +func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient { + return OperationsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// List lists the available Azure Data Factory API operations. +func (client OperationsClient) List(ctx context.Context) (result OperationListResponsePage, err error) { + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.OperationsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.olr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "datafactory.OperationsClient", "List", resp, "Failure sending request") + return + } + + result.olr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.OperationsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + const APIVersion = "2018-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/providers/Microsoft.DataFactory/operations"), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client OperationsClient) ListSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client OperationsClient) ListResponder(resp *http.Response) (result OperationListResponse, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client OperationsClient) listNextResults(lastResults OperationListResponse) (result OperationListResponse, err error) { + req, err := lastResults.operationListResponsePreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "datafactory.OperationsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "datafactory.OperationsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.OperationsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client OperationsClient) ListComplete(ctx context.Context) (result OperationListResponseIterator, err error) { + result.page, err = client.List(ctx) + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory/pipelineruns.go b/vendor/github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory/pipelineruns.go new file mode 100644 index 000000000..5c4057cca --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory/pipelineruns.go @@ -0,0 +1,288 @@ +package datafactory + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// PipelineRunsClient is the the Azure Data Factory V2 management API provides a RESTful set of web services that +// interact with Azure Data Factory V2 services. +type PipelineRunsClient struct { + BaseClient +} + +// NewPipelineRunsClient creates an instance of the PipelineRunsClient client. +func NewPipelineRunsClient(subscriptionID string) PipelineRunsClient { + return NewPipelineRunsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewPipelineRunsClientWithBaseURI creates an instance of the PipelineRunsClient client. +func NewPipelineRunsClientWithBaseURI(baseURI string, subscriptionID string) PipelineRunsClient { + return PipelineRunsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Cancel cancel a pipeline run by its run ID. +// Parameters: +// resourceGroupName - the resource group name. +// factoryName - the factory name. +// runID - the pipeline run identifier. +func (client PipelineRunsClient) Cancel(ctx context.Context, resourceGroupName string, factoryName string, runID string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: factoryName, + Constraints: []validation.Constraint{{Target: "factoryName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "factoryName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "factoryName", Name: validation.Pattern, Rule: `^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("datafactory.PipelineRunsClient", "Cancel", err.Error()) + } + + req, err := client.CancelPreparer(ctx, resourceGroupName, factoryName, runID) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.PipelineRunsClient", "Cancel", nil, "Failure preparing request") + return + } + + resp, err := client.CancelSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "datafactory.PipelineRunsClient", "Cancel", resp, "Failure sending request") + return + } + + result, err = client.CancelResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.PipelineRunsClient", "Cancel", resp, "Failure responding to request") + } + + return +} + +// CancelPreparer prepares the Cancel request. +func (client PipelineRunsClient) CancelPreparer(ctx context.Context, resourceGroupName string, factoryName string, runID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "factoryName": autorest.Encode("path", factoryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "runId": autorest.Encode("path", runID), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/pipelineruns/{runId}/cancel", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CancelSender sends the Cancel request. The method will close the +// http.Response Body if it receives an error. +func (client PipelineRunsClient) CancelSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// CancelResponder handles the response to the Cancel request. The method always +// closes the http.Response Body. +func (client PipelineRunsClient) CancelResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get get a pipeline run by its run ID. +// Parameters: +// resourceGroupName - the resource group name. +// factoryName - the factory name. +// runID - the pipeline run identifier. +func (client PipelineRunsClient) Get(ctx context.Context, resourceGroupName string, factoryName string, runID string) (result PipelineRun, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: factoryName, + Constraints: []validation.Constraint{{Target: "factoryName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "factoryName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "factoryName", Name: validation.Pattern, Rule: `^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("datafactory.PipelineRunsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, factoryName, runID) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.PipelineRunsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "datafactory.PipelineRunsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.PipelineRunsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client PipelineRunsClient) GetPreparer(ctx context.Context, resourceGroupName string, factoryName string, runID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "factoryName": autorest.Encode("path", factoryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "runId": autorest.Encode("path", runID), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/pipelineruns/{runId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client PipelineRunsClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client PipelineRunsClient) GetResponder(resp *http.Response) (result PipelineRun, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// QueryByFactory query pipeline runs in the factory based on input filter conditions. +// Parameters: +// resourceGroupName - the resource group name. +// factoryName - the factory name. +// filterParameters - parameters to filter the pipeline run. +func (client PipelineRunsClient) QueryByFactory(ctx context.Context, resourceGroupName string, factoryName string, filterParameters RunFilterParameters) (result PipelineRunsQueryResponse, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: factoryName, + Constraints: []validation.Constraint{{Target: "factoryName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "factoryName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "factoryName", Name: validation.Pattern, Rule: `^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$`, Chain: nil}}}, + {TargetValue: filterParameters, + Constraints: []validation.Constraint{{Target: "filterParameters.LastUpdatedAfter", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "filterParameters.LastUpdatedBefore", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("datafactory.PipelineRunsClient", "QueryByFactory", err.Error()) + } + + req, err := client.QueryByFactoryPreparer(ctx, resourceGroupName, factoryName, filterParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.PipelineRunsClient", "QueryByFactory", nil, "Failure preparing request") + return + } + + resp, err := client.QueryByFactorySender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "datafactory.PipelineRunsClient", "QueryByFactory", resp, "Failure sending request") + return + } + + result, err = client.QueryByFactoryResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.PipelineRunsClient", "QueryByFactory", resp, "Failure responding to request") + } + + return +} + +// QueryByFactoryPreparer prepares the QueryByFactory request. +func (client PipelineRunsClient) QueryByFactoryPreparer(ctx context.Context, resourceGroupName string, factoryName string, filterParameters RunFilterParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "factoryName": autorest.Encode("path", factoryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/queryPipelineRuns", pathParameters), + autorest.WithJSON(filterParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// QueryByFactorySender sends the QueryByFactory request. The method will close the +// http.Response Body if it receives an error. +func (client PipelineRunsClient) QueryByFactorySender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// QueryByFactoryResponder handles the response to the QueryByFactory request. The method always +// closes the http.Response Body. +func (client PipelineRunsClient) QueryByFactoryResponder(resp *http.Response) (result PipelineRunsQueryResponse, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory/pipelines.go b/vendor/github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory/pipelines.go new file mode 100644 index 000000000..036507052 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory/pipelines.go @@ -0,0 +1,520 @@ +package datafactory + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// PipelinesClient is the the Azure Data Factory V2 management API provides a RESTful set of web services that interact +// with Azure Data Factory V2 services. +type PipelinesClient struct { + BaseClient +} + +// NewPipelinesClient creates an instance of the PipelinesClient client. +func NewPipelinesClient(subscriptionID string) PipelinesClient { + return NewPipelinesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewPipelinesClientWithBaseURI creates an instance of the PipelinesClient client. +func NewPipelinesClientWithBaseURI(baseURI string, subscriptionID string) PipelinesClient { + return PipelinesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or updates a pipeline. +// Parameters: +// resourceGroupName - the resource group name. +// factoryName - the factory name. +// pipelineName - the pipeline name. +// pipeline - pipeline resource definition. +// ifMatch - eTag of the pipeline entity. Should only be specified for update, for which it should match +// existing entity or can be * for unconditional update. +func (client PipelinesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, factoryName string, pipelineName string, pipeline PipelineResource, ifMatch string) (result PipelineResource, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: factoryName, + Constraints: []validation.Constraint{{Target: "factoryName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "factoryName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "factoryName", Name: validation.Pattern, Rule: `^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$`, Chain: nil}}}, + {TargetValue: pipelineName, + Constraints: []validation.Constraint{{Target: "pipelineName", Name: validation.MaxLength, Rule: 260, Chain: nil}, + {Target: "pipelineName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "pipelineName", Name: validation.Pattern, Rule: `^[A-Za-z0-9_][^<>*#.%&:\\+?/]*$`, Chain: nil}}}, + {TargetValue: pipeline, + Constraints: []validation.Constraint{{Target: "pipeline.Pipeline", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "pipeline.Pipeline.Concurrency", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "pipeline.Pipeline.Concurrency", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}, + }}}}}); err != nil { + return result, validation.NewError("datafactory.PipelinesClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, factoryName, pipelineName, pipeline, ifMatch) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.PipelinesClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "datafactory.PipelinesClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.PipelinesClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client PipelinesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, factoryName string, pipelineName string, pipeline PipelineResource, ifMatch string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "factoryName": autorest.Encode("path", factoryName), + "pipelineName": autorest.Encode("path", pipelineName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/pipelines/{pipelineName}", pathParameters), + autorest.WithJSON(pipeline), + autorest.WithQueryParameters(queryParameters)) + if len(ifMatch) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client PipelinesClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client PipelinesClient) CreateOrUpdateResponder(resp *http.Response) (result PipelineResource, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CreateRun creates a run of a pipeline. +// Parameters: +// resourceGroupName - the resource group name. +// factoryName - the factory name. +// pipelineName - the pipeline name. +// referencePipelineRunID - the pipeline run identifier. If run ID is specified the parameters of the the +// specified run will be used to create a new run. +// parameters - parameters of the pipeline run. These parameters will be used only if the runId is not +// specified. +func (client PipelinesClient) CreateRun(ctx context.Context, resourceGroupName string, factoryName string, pipelineName string, referencePipelineRunID string, parameters map[string]interface{}) (result CreateRunResponse, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: factoryName, + Constraints: []validation.Constraint{{Target: "factoryName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "factoryName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "factoryName", Name: validation.Pattern, Rule: `^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$`, Chain: nil}}}, + {TargetValue: pipelineName, + Constraints: []validation.Constraint{{Target: "pipelineName", Name: validation.MaxLength, Rule: 260, Chain: nil}, + {Target: "pipelineName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "pipelineName", Name: validation.Pattern, Rule: `^[A-Za-z0-9_][^<>*#.%&:\\+?/]*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("datafactory.PipelinesClient", "CreateRun", err.Error()) + } + + req, err := client.CreateRunPreparer(ctx, resourceGroupName, factoryName, pipelineName, referencePipelineRunID, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.PipelinesClient", "CreateRun", nil, "Failure preparing request") + return + } + + resp, err := client.CreateRunSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "datafactory.PipelinesClient", "CreateRun", resp, "Failure sending request") + return + } + + result, err = client.CreateRunResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.PipelinesClient", "CreateRun", resp, "Failure responding to request") + } + + return +} + +// CreateRunPreparer prepares the CreateRun request. +func (client PipelinesClient) CreateRunPreparer(ctx context.Context, resourceGroupName string, factoryName string, pipelineName string, referencePipelineRunID string, parameters map[string]interface{}) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "factoryName": autorest.Encode("path", factoryName), + "pipelineName": autorest.Encode("path", pipelineName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(referencePipelineRunID) > 0 { + queryParameters["referencePipelineRunId"] = autorest.Encode("query", referencePipelineRunID) + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/pipelines/{pipelineName}/createRun", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if parameters != nil && len(parameters) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithJSON(parameters)) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateRunSender sends the CreateRun request. The method will close the +// http.Response Body if it receives an error. +func (client PipelinesClient) CreateRunSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// CreateRunResponder handles the response to the CreateRun request. The method always +// closes the http.Response Body. +func (client PipelinesClient) CreateRunResponder(resp *http.Response) (result CreateRunResponse, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes a pipeline. +// Parameters: +// resourceGroupName - the resource group name. +// factoryName - the factory name. +// pipelineName - the pipeline name. +func (client PipelinesClient) Delete(ctx context.Context, resourceGroupName string, factoryName string, pipelineName string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: factoryName, + Constraints: []validation.Constraint{{Target: "factoryName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "factoryName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "factoryName", Name: validation.Pattern, Rule: `^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$`, Chain: nil}}}, + {TargetValue: pipelineName, + Constraints: []validation.Constraint{{Target: "pipelineName", Name: validation.MaxLength, Rule: 260, Chain: nil}, + {Target: "pipelineName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "pipelineName", Name: validation.Pattern, Rule: `^[A-Za-z0-9_][^<>*#.%&:\\+?/]*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("datafactory.PipelinesClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, factoryName, pipelineName) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.PipelinesClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "datafactory.PipelinesClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.PipelinesClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client PipelinesClient) DeletePreparer(ctx context.Context, resourceGroupName string, factoryName string, pipelineName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "factoryName": autorest.Encode("path", factoryName), + "pipelineName": autorest.Encode("path", pipelineName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/pipelines/{pipelineName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client PipelinesClient) DeleteSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client PipelinesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets a pipeline. +// Parameters: +// resourceGroupName - the resource group name. +// factoryName - the factory name. +// pipelineName - the pipeline name. +// ifNoneMatch - eTag of the pipeline entity. Should only be specified for get. If the ETag matches the +// existing entity tag, or if * was provided, then no content will be returned. +func (client PipelinesClient) Get(ctx context.Context, resourceGroupName string, factoryName string, pipelineName string, ifNoneMatch string) (result PipelineResource, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: factoryName, + Constraints: []validation.Constraint{{Target: "factoryName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "factoryName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "factoryName", Name: validation.Pattern, Rule: `^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$`, Chain: nil}}}, + {TargetValue: pipelineName, + Constraints: []validation.Constraint{{Target: "pipelineName", Name: validation.MaxLength, Rule: 260, Chain: nil}, + {Target: "pipelineName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "pipelineName", Name: validation.Pattern, Rule: `^[A-Za-z0-9_][^<>*#.%&:\\+?/]*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("datafactory.PipelinesClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, factoryName, pipelineName, ifNoneMatch) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.PipelinesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "datafactory.PipelinesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.PipelinesClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client PipelinesClient) GetPreparer(ctx context.Context, resourceGroupName string, factoryName string, pipelineName string, ifNoneMatch string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "factoryName": autorest.Encode("path", factoryName), + "pipelineName": autorest.Encode("path", pipelineName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/pipelines/{pipelineName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if len(ifNoneMatch) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client PipelinesClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client PipelinesClient) GetResponder(resp *http.Response) (result PipelineResource, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotModified), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByFactory lists pipelines. +// Parameters: +// resourceGroupName - the resource group name. +// factoryName - the factory name. +func (client PipelinesClient) ListByFactory(ctx context.Context, resourceGroupName string, factoryName string) (result PipelineListResponsePage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: factoryName, + Constraints: []validation.Constraint{{Target: "factoryName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "factoryName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "factoryName", Name: validation.Pattern, Rule: `^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("datafactory.PipelinesClient", "ListByFactory", err.Error()) + } + + result.fn = client.listByFactoryNextResults + req, err := client.ListByFactoryPreparer(ctx, resourceGroupName, factoryName) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.PipelinesClient", "ListByFactory", nil, "Failure preparing request") + return + } + + resp, err := client.ListByFactorySender(req) + if err != nil { + result.plr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "datafactory.PipelinesClient", "ListByFactory", resp, "Failure sending request") + return + } + + result.plr, err = client.ListByFactoryResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.PipelinesClient", "ListByFactory", resp, "Failure responding to request") + } + + return +} + +// ListByFactoryPreparer prepares the ListByFactory request. +func (client PipelinesClient) ListByFactoryPreparer(ctx context.Context, resourceGroupName string, factoryName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "factoryName": autorest.Encode("path", factoryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/pipelines", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByFactorySender sends the ListByFactory request. The method will close the +// http.Response Body if it receives an error. +func (client PipelinesClient) ListByFactorySender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByFactoryResponder handles the response to the ListByFactory request. The method always +// closes the http.Response Body. +func (client PipelinesClient) ListByFactoryResponder(resp *http.Response) (result PipelineListResponse, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByFactoryNextResults retrieves the next set of results, if any. +func (client PipelinesClient) listByFactoryNextResults(lastResults PipelineListResponse) (result PipelineListResponse, err error) { + req, err := lastResults.pipelineListResponsePreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "datafactory.PipelinesClient", "listByFactoryNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByFactorySender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "datafactory.PipelinesClient", "listByFactoryNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByFactoryResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.PipelinesClient", "listByFactoryNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByFactoryComplete enumerates all values, automatically crossing page boundaries as required. +func (client PipelinesClient) ListByFactoryComplete(ctx context.Context, resourceGroupName string, factoryName string) (result PipelineListResponseIterator, err error) { + result.page, err = client.ListByFactory(ctx, resourceGroupName, factoryName) + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory/triggerruns.go b/vendor/github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory/triggerruns.go new file mode 100644 index 000000000..bdb8f2eb6 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory/triggerruns.go @@ -0,0 +1,127 @@ +package datafactory + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// TriggerRunsClient is the the Azure Data Factory V2 management API provides a RESTful set of web services that +// interact with Azure Data Factory V2 services. +type TriggerRunsClient struct { + BaseClient +} + +// NewTriggerRunsClient creates an instance of the TriggerRunsClient client. +func NewTriggerRunsClient(subscriptionID string) TriggerRunsClient { + return NewTriggerRunsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewTriggerRunsClientWithBaseURI creates an instance of the TriggerRunsClient client. +func NewTriggerRunsClientWithBaseURI(baseURI string, subscriptionID string) TriggerRunsClient { + return TriggerRunsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// QueryByFactory query trigger runs. +// Parameters: +// resourceGroupName - the resource group name. +// factoryName - the factory name. +// filterParameters - parameters to filter the pipeline run. +func (client TriggerRunsClient) QueryByFactory(ctx context.Context, resourceGroupName string, factoryName string, filterParameters RunFilterParameters) (result TriggerRunsQueryResponse, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: factoryName, + Constraints: []validation.Constraint{{Target: "factoryName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "factoryName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "factoryName", Name: validation.Pattern, Rule: `^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$`, Chain: nil}}}, + {TargetValue: filterParameters, + Constraints: []validation.Constraint{{Target: "filterParameters.LastUpdatedAfter", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "filterParameters.LastUpdatedBefore", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("datafactory.TriggerRunsClient", "QueryByFactory", err.Error()) + } + + req, err := client.QueryByFactoryPreparer(ctx, resourceGroupName, factoryName, filterParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.TriggerRunsClient", "QueryByFactory", nil, "Failure preparing request") + return + } + + resp, err := client.QueryByFactorySender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "datafactory.TriggerRunsClient", "QueryByFactory", resp, "Failure sending request") + return + } + + result, err = client.QueryByFactoryResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.TriggerRunsClient", "QueryByFactory", resp, "Failure responding to request") + } + + return +} + +// QueryByFactoryPreparer prepares the QueryByFactory request. +func (client TriggerRunsClient) QueryByFactoryPreparer(ctx context.Context, resourceGroupName string, factoryName string, filterParameters RunFilterParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "factoryName": autorest.Encode("path", factoryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/queryTriggerRuns", pathParameters), + autorest.WithJSON(filterParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// QueryByFactorySender sends the QueryByFactory request. The method will close the +// http.Response Body if it receives an error. +func (client TriggerRunsClient) QueryByFactorySender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// QueryByFactoryResponder handles the response to the QueryByFactory request. The method always +// closes the http.Response Body. +func (client TriggerRunsClient) QueryByFactoryResponder(resp *http.Response) (result TriggerRunsQueryResponse, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory/triggers.go b/vendor/github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory/triggers.go new file mode 100644 index 000000000..b55f3a4f7 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory/triggers.go @@ -0,0 +1,596 @@ +package datafactory + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// TriggersClient is the the Azure Data Factory V2 management API provides a RESTful set of web services that interact +// with Azure Data Factory V2 services. +type TriggersClient struct { + BaseClient +} + +// NewTriggersClient creates an instance of the TriggersClient client. +func NewTriggersClient(subscriptionID string) TriggersClient { + return NewTriggersClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewTriggersClientWithBaseURI creates an instance of the TriggersClient client. +func NewTriggersClientWithBaseURI(baseURI string, subscriptionID string) TriggersClient { + return TriggersClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or updates a trigger. +// Parameters: +// resourceGroupName - the resource group name. +// factoryName - the factory name. +// triggerName - the trigger name. +// trigger - trigger resource definition. +// ifMatch - eTag of the trigger entity. Should only be specified for update, for which it should match +// existing entity or can be * for unconditional update. +func (client TriggersClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, factoryName string, triggerName string, trigger TriggerResource, ifMatch string) (result TriggerResource, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: factoryName, + Constraints: []validation.Constraint{{Target: "factoryName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "factoryName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "factoryName", Name: validation.Pattern, Rule: `^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$`, Chain: nil}}}, + {TargetValue: triggerName, + Constraints: []validation.Constraint{{Target: "triggerName", Name: validation.MaxLength, Rule: 260, Chain: nil}, + {Target: "triggerName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "triggerName", Name: validation.Pattern, Rule: `^[A-Za-z0-9_][^<>*#.%&:\\+?/]*$`, Chain: nil}}}, + {TargetValue: trigger, + Constraints: []validation.Constraint{{Target: "trigger.Properties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("datafactory.TriggersClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, factoryName, triggerName, trigger, ifMatch) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.TriggersClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "datafactory.TriggersClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.TriggersClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client TriggersClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, factoryName string, triggerName string, trigger TriggerResource, ifMatch string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "factoryName": autorest.Encode("path", factoryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "triggerName": autorest.Encode("path", triggerName), + } + + const APIVersion = "2018-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/triggers/{triggerName}", pathParameters), + autorest.WithJSON(trigger), + autorest.WithQueryParameters(queryParameters)) + if len(ifMatch) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client TriggersClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client TriggersClient) CreateOrUpdateResponder(resp *http.Response) (result TriggerResource, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes a trigger. +// Parameters: +// resourceGroupName - the resource group name. +// factoryName - the factory name. +// triggerName - the trigger name. +func (client TriggersClient) Delete(ctx context.Context, resourceGroupName string, factoryName string, triggerName string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: factoryName, + Constraints: []validation.Constraint{{Target: "factoryName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "factoryName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "factoryName", Name: validation.Pattern, Rule: `^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$`, Chain: nil}}}, + {TargetValue: triggerName, + Constraints: []validation.Constraint{{Target: "triggerName", Name: validation.MaxLength, Rule: 260, Chain: nil}, + {Target: "triggerName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "triggerName", Name: validation.Pattern, Rule: `^[A-Za-z0-9_][^<>*#.%&:\\+?/]*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("datafactory.TriggersClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, factoryName, triggerName) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.TriggersClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "datafactory.TriggersClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.TriggersClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client TriggersClient) DeletePreparer(ctx context.Context, resourceGroupName string, factoryName string, triggerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "factoryName": autorest.Encode("path", factoryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "triggerName": autorest.Encode("path", triggerName), + } + + const APIVersion = "2018-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/triggers/{triggerName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client TriggersClient) DeleteSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client TriggersClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets a trigger. +// Parameters: +// resourceGroupName - the resource group name. +// factoryName - the factory name. +// triggerName - the trigger name. +// ifNoneMatch - eTag of the trigger entity. Should only be specified for get. If the ETag matches the existing +// entity tag, or if * was provided, then no content will be returned. +func (client TriggersClient) Get(ctx context.Context, resourceGroupName string, factoryName string, triggerName string, ifNoneMatch string) (result TriggerResource, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: factoryName, + Constraints: []validation.Constraint{{Target: "factoryName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "factoryName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "factoryName", Name: validation.Pattern, Rule: `^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$`, Chain: nil}}}, + {TargetValue: triggerName, + Constraints: []validation.Constraint{{Target: "triggerName", Name: validation.MaxLength, Rule: 260, Chain: nil}, + {Target: "triggerName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "triggerName", Name: validation.Pattern, Rule: `^[A-Za-z0-9_][^<>*#.%&:\\+?/]*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("datafactory.TriggersClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, factoryName, triggerName, ifNoneMatch) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.TriggersClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "datafactory.TriggersClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.TriggersClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client TriggersClient) GetPreparer(ctx context.Context, resourceGroupName string, factoryName string, triggerName string, ifNoneMatch string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "factoryName": autorest.Encode("path", factoryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "triggerName": autorest.Encode("path", triggerName), + } + + const APIVersion = "2018-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/triggers/{triggerName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if len(ifNoneMatch) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client TriggersClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client TriggersClient) GetResponder(resp *http.Response) (result TriggerResource, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotModified), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByFactory lists triggers. +// Parameters: +// resourceGroupName - the resource group name. +// factoryName - the factory name. +func (client TriggersClient) ListByFactory(ctx context.Context, resourceGroupName string, factoryName string) (result TriggerListResponsePage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: factoryName, + Constraints: []validation.Constraint{{Target: "factoryName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "factoryName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "factoryName", Name: validation.Pattern, Rule: `^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("datafactory.TriggersClient", "ListByFactory", err.Error()) + } + + result.fn = client.listByFactoryNextResults + req, err := client.ListByFactoryPreparer(ctx, resourceGroupName, factoryName) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.TriggersClient", "ListByFactory", nil, "Failure preparing request") + return + } + + resp, err := client.ListByFactorySender(req) + if err != nil { + result.tlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "datafactory.TriggersClient", "ListByFactory", resp, "Failure sending request") + return + } + + result.tlr, err = client.ListByFactoryResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.TriggersClient", "ListByFactory", resp, "Failure responding to request") + } + + return +} + +// ListByFactoryPreparer prepares the ListByFactory request. +func (client TriggersClient) ListByFactoryPreparer(ctx context.Context, resourceGroupName string, factoryName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "factoryName": autorest.Encode("path", factoryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/triggers", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByFactorySender sends the ListByFactory request. The method will close the +// http.Response Body if it receives an error. +func (client TriggersClient) ListByFactorySender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByFactoryResponder handles the response to the ListByFactory request. The method always +// closes the http.Response Body. +func (client TriggersClient) ListByFactoryResponder(resp *http.Response) (result TriggerListResponse, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByFactoryNextResults retrieves the next set of results, if any. +func (client TriggersClient) listByFactoryNextResults(lastResults TriggerListResponse) (result TriggerListResponse, err error) { + req, err := lastResults.triggerListResponsePreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "datafactory.TriggersClient", "listByFactoryNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByFactorySender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "datafactory.TriggersClient", "listByFactoryNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByFactoryResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.TriggersClient", "listByFactoryNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByFactoryComplete enumerates all values, automatically crossing page boundaries as required. +func (client TriggersClient) ListByFactoryComplete(ctx context.Context, resourceGroupName string, factoryName string) (result TriggerListResponseIterator, err error) { + result.page, err = client.ListByFactory(ctx, resourceGroupName, factoryName) + return +} + +// Start starts a trigger. +// Parameters: +// resourceGroupName - the resource group name. +// factoryName - the factory name. +// triggerName - the trigger name. +func (client TriggersClient) Start(ctx context.Context, resourceGroupName string, factoryName string, triggerName string) (result TriggersStartFuture, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: factoryName, + Constraints: []validation.Constraint{{Target: "factoryName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "factoryName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "factoryName", Name: validation.Pattern, Rule: `^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$`, Chain: nil}}}, + {TargetValue: triggerName, + Constraints: []validation.Constraint{{Target: "triggerName", Name: validation.MaxLength, Rule: 260, Chain: nil}, + {Target: "triggerName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "triggerName", Name: validation.Pattern, Rule: `^[A-Za-z0-9_][^<>*#.%&:\\+?/]*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("datafactory.TriggersClient", "Start", err.Error()) + } + + req, err := client.StartPreparer(ctx, resourceGroupName, factoryName, triggerName) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.TriggersClient", "Start", nil, "Failure preparing request") + return + } + + result, err = client.StartSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.TriggersClient", "Start", result.Response(), "Failure sending request") + return + } + + return +} + +// StartPreparer prepares the Start request. +func (client TriggersClient) StartPreparer(ctx context.Context, resourceGroupName string, factoryName string, triggerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "factoryName": autorest.Encode("path", factoryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "triggerName": autorest.Encode("path", triggerName), + } + + const APIVersion = "2018-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/triggers/{triggerName}/start", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// StartSender sends the Start request. The method will close the +// http.Response Body if it receives an error. +func (client TriggersClient) StartSender(req *http.Request) (future TriggersStartFuture, err error) { + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// StartResponder handles the response to the Start request. The method always +// closes the http.Response Body. +func (client TriggersClient) StartResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Stop stops a trigger. +// Parameters: +// resourceGroupName - the resource group name. +// factoryName - the factory name. +// triggerName - the trigger name. +func (client TriggersClient) Stop(ctx context.Context, resourceGroupName string, factoryName string, triggerName string) (result TriggersStopFuture, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: factoryName, + Constraints: []validation.Constraint{{Target: "factoryName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "factoryName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "factoryName", Name: validation.Pattern, Rule: `^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$`, Chain: nil}}}, + {TargetValue: triggerName, + Constraints: []validation.Constraint{{Target: "triggerName", Name: validation.MaxLength, Rule: 260, Chain: nil}, + {Target: "triggerName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "triggerName", Name: validation.Pattern, Rule: `^[A-Za-z0-9_][^<>*#.%&:\\+?/]*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("datafactory.TriggersClient", "Stop", err.Error()) + } + + req, err := client.StopPreparer(ctx, resourceGroupName, factoryName, triggerName) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.TriggersClient", "Stop", nil, "Failure preparing request") + return + } + + result, err = client.StopSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "datafactory.TriggersClient", "Stop", result.Response(), "Failure sending request") + return + } + + return +} + +// StopPreparer prepares the Stop request. +func (client TriggersClient) StopPreparer(ctx context.Context, resourceGroupName string, factoryName string, triggerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "factoryName": autorest.Encode("path", factoryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "triggerName": autorest.Encode("path", triggerName), + } + + const APIVersion = "2018-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/triggers/{triggerName}/stop", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// StopSender sends the Stop request. The method will close the +// http.Response Body if it receives an error. +func (client TriggersClient) StopSender(req *http.Request) (future TriggersStopFuture, err error) { + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// StopResponder handles the response to the Stop request. The method always +// closes the http.Response Body. +func (client TriggersClient) StopResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory/version.go b/vendor/github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory/version.go new file mode 100644 index 000000000..82d8ac7bd --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory/version.go @@ -0,0 +1,30 @@ +package datafactory + +import "github.com/Azure/azure-sdk-for-go/version" + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// UserAgent returns the UserAgent string to use when sending http.Requests. +func UserAgent() string { + return "Azure-SDK-For-Go/" + version.Number + " datafactory/2018-06-01" +} + +// Version returns the semantic version (see http://semver.org) of the client. +func Version() string { + return version.Number +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/datalake/analytics/mgmt/2016-11-01/account/accounts.go b/vendor/github.com/Azure/azure-sdk-for-go/services/datalake/analytics/mgmt/2016-11-01/account/accounts.go index a1b91e122..87a86a01a 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/datalake/analytics/mgmt/2016-11-01/account/accounts.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/datalake/analytics/mgmt/2016-11-01/account/accounts.go @@ -137,7 +137,7 @@ func (client AccountsClient) Create(ctx context.Context, resourceGroupName strin {Target: "parameters.CreateDataLakeAnalyticsAccountProperties.MinPriorityPerJob", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "parameters.CreateDataLakeAnalyticsAccountProperties.MinPriorityPerJob", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}, {Target: "parameters.CreateDataLakeAnalyticsAccountProperties.QueryStoreRetention", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.CreateDataLakeAnalyticsAccountProperties.QueryStoreRetention", Name: validation.InclusiveMaximum, Rule: 180, Chain: nil}, + Chain: []validation.Constraint{{Target: "parameters.CreateDataLakeAnalyticsAccountProperties.QueryStoreRetention", Name: validation.InclusiveMaximum, Rule: int64(180), Chain: nil}, {Target: "parameters.CreateDataLakeAnalyticsAccountProperties.QueryStoreRetention", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}, }}}}}); err != nil { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2016-04-01/dns/recordsets.go b/vendor/github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2016-04-01/dns/recordsets.go index cd10b4004..e3d2bc116 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2016-04-01/dns/recordsets.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2016-04-01/dns/recordsets.go @@ -21,6 +21,7 @@ import ( "context" "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" "net/http" ) @@ -41,7 +42,7 @@ func NewRecordSetsClientWithBaseURI(baseURI string, subscriptionID string) Recor // CreateOrUpdate creates or updates a record set within a DNS zone. // Parameters: -// resourceGroupName - the name of the resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // zoneName - the name of the DNS zone (without a terminating dot). // relativeRecordSetName - the name of the record set, relative to the name of the zone. // recordType - the type of DNS record in this record set. Record sets of type SOA can be updated but not @@ -52,6 +53,14 @@ func NewRecordSetsClientWithBaseURI(baseURI string, subscriptionID string) Recor // ifNoneMatch - set to '*' to allow a new record set to be created, but to prevent updating an existing record // set. Other values will be ignored. func (client RecordSetsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, zoneName string, relativeRecordSetName string, recordType RecordType, parameters RecordSet, ifMatch string, ifNoneMatch string) (result RecordSet, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("dns.RecordSetsClient", "CreateOrUpdate", err.Error()) + } + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, zoneName, relativeRecordSetName, recordType, parameters, ifMatch, ifNoneMatch) if err != nil { err = autorest.NewErrorWithError(err, "dns.RecordSetsClient", "CreateOrUpdate", nil, "Failure preparing request") @@ -128,7 +137,7 @@ func (client RecordSetsClient) CreateOrUpdateResponder(resp *http.Response) (res // Delete deletes a record set from a DNS zone. This operation cannot be undone. // Parameters: -// resourceGroupName - the name of the resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // zoneName - the name of the DNS zone (without a terminating dot). // relativeRecordSetName - the name of the record set, relative to the name of the zone. // recordType - the type of DNS record in this record set. Record sets of type SOA cannot be deleted (they are @@ -136,6 +145,14 @@ func (client RecordSetsClient) CreateOrUpdateResponder(resp *http.Response) (res // ifMatch - the etag of the record set. Omit this value to always delete the current record set. Specify the // last-seen etag value to prevent accidentally deleting any concurrent changes. func (client RecordSetsClient) Delete(ctx context.Context, resourceGroupName string, zoneName string, relativeRecordSetName string, recordType RecordType, ifMatch string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("dns.RecordSetsClient", "Delete", err.Error()) + } + req, err := client.DeletePreparer(ctx, resourceGroupName, zoneName, relativeRecordSetName, recordType, ifMatch) if err != nil { err = autorest.NewErrorWithError(err, "dns.RecordSetsClient", "Delete", nil, "Failure preparing request") @@ -205,11 +222,19 @@ func (client RecordSetsClient) DeleteResponder(resp *http.Response) (result auto // Get gets a record set. // Parameters: -// resourceGroupName - the name of the resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // zoneName - the name of the DNS zone (without a terminating dot). // relativeRecordSetName - the name of the record set, relative to the name of the zone. // recordType - the type of DNS record in this record set. func (client RecordSetsClient) Get(ctx context.Context, resourceGroupName string, zoneName string, relativeRecordSetName string, recordType RecordType) (result RecordSet, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("dns.RecordSetsClient", "Get", err.Error()) + } + req, err := client.GetPreparer(ctx, resourceGroupName, zoneName, relativeRecordSetName, recordType) if err != nil { err = autorest.NewErrorWithError(err, "dns.RecordSetsClient", "Get", nil, "Failure preparing request") @@ -276,13 +301,21 @@ func (client RecordSetsClient) GetResponder(resp *http.Response) (result RecordS // ListByDNSZone lists all record sets in a DNS zone. // Parameters: -// resourceGroupName - the name of the resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // zoneName - the name of the DNS zone (without a terminating dot). // top - the maximum number of record sets to return. If not specified, returns up to 100 record sets. // recordsetnamesuffix - the suffix label of the record set name that has to be used to filter the record set // enumerations. If this parameter is specified, Enumeration will return only records that end with // . func (client RecordSetsClient) ListByDNSZone(ctx context.Context, resourceGroupName string, zoneName string, top *int32, recordsetnamesuffix string) (result RecordSetListResultPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("dns.RecordSetsClient", "ListByDNSZone", err.Error()) + } + result.fn = client.listByDNSZoneNextResults req, err := client.ListByDNSZonePreparer(ctx, resourceGroupName, zoneName, top, recordsetnamesuffix) if err != nil { @@ -381,7 +414,7 @@ func (client RecordSetsClient) ListByDNSZoneComplete(ctx context.Context, resour // ListByType lists the record sets of a specified type in a DNS zone. // Parameters: -// resourceGroupName - the name of the resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // zoneName - the name of the DNS zone (without a terminating dot). // recordType - the type of record sets to enumerate. // top - the maximum number of record sets to return. If not specified, returns up to 100 record sets. @@ -389,6 +422,14 @@ func (client RecordSetsClient) ListByDNSZoneComplete(ctx context.Context, resour // enumerations. If this parameter is specified, Enumeration will return only records that end with // . func (client RecordSetsClient) ListByType(ctx context.Context, resourceGroupName string, zoneName string, recordType RecordType, top *int32, recordsetnamesuffix string) (result RecordSetListResultPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("dns.RecordSetsClient", "ListByType", err.Error()) + } + result.fn = client.listByTypeNextResults req, err := client.ListByTypePreparer(ctx, resourceGroupName, zoneName, recordType, top, recordsetnamesuffix) if err != nil { @@ -488,7 +529,7 @@ func (client RecordSetsClient) ListByTypeComplete(ctx context.Context, resourceG // Update updates a record set within a DNS zone. // Parameters: -// resourceGroupName - the name of the resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // zoneName - the name of the DNS zone (without a terminating dot). // relativeRecordSetName - the name of the record set, relative to the name of the zone. // recordType - the type of DNS record in this record set. @@ -496,6 +537,14 @@ func (client RecordSetsClient) ListByTypeComplete(ctx context.Context, resourceG // ifMatch - the etag of the record set. Omit this value to always overwrite the current record set. Specify // the last-seen etag value to prevent accidentally overwritting concurrent changes. func (client RecordSetsClient) Update(ctx context.Context, resourceGroupName string, zoneName string, relativeRecordSetName string, recordType RecordType, parameters RecordSet, ifMatch string) (result RecordSet, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("dns.RecordSetsClient", "Update", err.Error()) + } + req, err := client.UpdatePreparer(ctx, resourceGroupName, zoneName, relativeRecordSetName, recordType, parameters, ifMatch) if err != nil { err = autorest.NewErrorWithError(err, "dns.RecordSetsClient", "Update", nil, "Failure preparing request") diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2016-04-01/dns/zones.go b/vendor/github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2016-04-01/dns/zones.go index e6043c347..5e1737832 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2016-04-01/dns/zones.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2016-04-01/dns/zones.go @@ -21,6 +21,7 @@ import ( "context" "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" "net/http" ) @@ -41,7 +42,7 @@ func NewZonesClientWithBaseURI(baseURI string, subscriptionID string) ZonesClien // CreateOrUpdate creates or updates a DNS zone. Does not modify DNS records within the zone. // Parameters: -// resourceGroupName - the name of the resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // zoneName - the name of the DNS zone (without a terminating dot). // parameters - parameters supplied to the CreateOrUpdate operation. // ifMatch - the etag of the DNS zone. Omit this value to always overwrite the current zone. Specify the @@ -49,6 +50,14 @@ func NewZonesClientWithBaseURI(baseURI string, subscriptionID string) ZonesClien // ifNoneMatch - set to '*' to allow a new DNS zone to be created, but to prevent updating an existing zone. // Other values will be ignored. func (client ZonesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, zoneName string, parameters Zone, ifMatch string, ifNoneMatch string) (result Zone, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("dns.ZonesClient", "CreateOrUpdate", err.Error()) + } + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, zoneName, parameters, ifMatch, ifNoneMatch) if err != nil { err = autorest.NewErrorWithError(err, "dns.ZonesClient", "CreateOrUpdate", nil, "Failure preparing request") @@ -124,11 +133,19 @@ func (client ZonesClient) CreateOrUpdateResponder(resp *http.Response) (result Z // Delete deletes a DNS zone. WARNING: All DNS records in the zone will also be deleted. This operation cannot be // undone. // Parameters: -// resourceGroupName - the name of the resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // zoneName - the name of the DNS zone (without a terminating dot). // ifMatch - the etag of the DNS zone. Omit this value to always delete the current zone. Specify the last-seen // etag value to prevent accidentally deleting any concurrent changes. func (client ZonesClient) Delete(ctx context.Context, resourceGroupName string, zoneName string, ifMatch string) (result ZonesDeleteFuture, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("dns.ZonesClient", "Delete", err.Error()) + } + req, err := client.DeletePreparer(ctx, resourceGroupName, zoneName, ifMatch) if err != nil { err = autorest.NewErrorWithError(err, "dns.ZonesClient", "Delete", nil, "Failure preparing request") @@ -201,9 +218,17 @@ func (client ZonesClient) DeleteResponder(resp *http.Response) (result ZoneDelet // Get gets a DNS zone. Retrieves the zone properties, but not the record sets within the zone. // Parameters: -// resourceGroupName - the name of the resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // zoneName - the name of the DNS zone (without a terminating dot). func (client ZonesClient) Get(ctx context.Context, resourceGroupName string, zoneName string) (result Zone, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("dns.ZonesClient", "Get", err.Error()) + } + req, err := client.GetPreparer(ctx, resourceGroupName, zoneName) if err != nil { err = autorest.NewErrorWithError(err, "dns.ZonesClient", "Get", nil, "Failure preparing request") @@ -363,9 +388,17 @@ func (client ZonesClient) ListComplete(ctx context.Context, top *int32) (result // ListByResourceGroup lists the DNS zones within a resource group. // Parameters: -// resourceGroupName - the name of the resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // top - the maximum number of record sets to return. If not specified, returns up to 100 record sets. func (client ZonesClient) ListByResourceGroup(ctx context.Context, resourceGroupName string, top *int32) (result ZoneListResultPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("dns.ZonesClient", "ListByResourceGroup", err.Error()) + } + result.fn = client.listByResourceGroupNextResults req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName, top) if err != nil { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2017-09-01/dns/recordsets.go b/vendor/github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2017-09-01/dns/recordsets.go index 1ce4404c0..1bd1875dc 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2017-09-01/dns/recordsets.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2017-09-01/dns/recordsets.go @@ -21,6 +21,7 @@ import ( "context" "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" "net/http" ) @@ -41,7 +42,7 @@ func NewRecordSetsClientWithBaseURI(baseURI string, subscriptionID string) Recor // CreateOrUpdate creates or updates a record set within a DNS zone. // Parameters: -// resourceGroupName - the name of the resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // zoneName - the name of the DNS zone (without a terminating dot). // relativeRecordSetName - the name of the record set, relative to the name of the zone. // recordType - the type of DNS record in this record set. Record sets of type SOA can be updated but not @@ -52,6 +53,14 @@ func NewRecordSetsClientWithBaseURI(baseURI string, subscriptionID string) Recor // ifNoneMatch - set to '*' to allow a new record set to be created, but to prevent updating an existing record // set. Other values will be ignored. func (client RecordSetsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, zoneName string, relativeRecordSetName string, recordType RecordType, parameters RecordSet, ifMatch string, ifNoneMatch string) (result RecordSet, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("dns.RecordSetsClient", "CreateOrUpdate", err.Error()) + } + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, zoneName, relativeRecordSetName, recordType, parameters, ifMatch, ifNoneMatch) if err != nil { err = autorest.NewErrorWithError(err, "dns.RecordSetsClient", "CreateOrUpdate", nil, "Failure preparing request") @@ -128,7 +137,7 @@ func (client RecordSetsClient) CreateOrUpdateResponder(resp *http.Response) (res // Delete deletes a record set from a DNS zone. This operation cannot be undone. // Parameters: -// resourceGroupName - the name of the resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // zoneName - the name of the DNS zone (without a terminating dot). // relativeRecordSetName - the name of the record set, relative to the name of the zone. // recordType - the type of DNS record in this record set. Record sets of type SOA cannot be deleted (they are @@ -136,6 +145,14 @@ func (client RecordSetsClient) CreateOrUpdateResponder(resp *http.Response) (res // ifMatch - the etag of the record set. Omit this value to always delete the current record set. Specify the // last-seen etag value to prevent accidentally deleting any concurrent changes. func (client RecordSetsClient) Delete(ctx context.Context, resourceGroupName string, zoneName string, relativeRecordSetName string, recordType RecordType, ifMatch string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("dns.RecordSetsClient", "Delete", err.Error()) + } + req, err := client.DeletePreparer(ctx, resourceGroupName, zoneName, relativeRecordSetName, recordType, ifMatch) if err != nil { err = autorest.NewErrorWithError(err, "dns.RecordSetsClient", "Delete", nil, "Failure preparing request") @@ -205,11 +222,19 @@ func (client RecordSetsClient) DeleteResponder(resp *http.Response) (result auto // Get gets a record set. // Parameters: -// resourceGroupName - the name of the resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // zoneName - the name of the DNS zone (without a terminating dot). // relativeRecordSetName - the name of the record set, relative to the name of the zone. // recordType - the type of DNS record in this record set. func (client RecordSetsClient) Get(ctx context.Context, resourceGroupName string, zoneName string, relativeRecordSetName string, recordType RecordType) (result RecordSet, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("dns.RecordSetsClient", "Get", err.Error()) + } + req, err := client.GetPreparer(ctx, resourceGroupName, zoneName, relativeRecordSetName, recordType) if err != nil { err = autorest.NewErrorWithError(err, "dns.RecordSetsClient", "Get", nil, "Failure preparing request") @@ -276,13 +301,21 @@ func (client RecordSetsClient) GetResponder(resp *http.Response) (result RecordS // ListByDNSZone lists all record sets in a DNS zone. // Parameters: -// resourceGroupName - the name of the resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // zoneName - the name of the DNS zone (without a terminating dot). // top - the maximum number of record sets to return. If not specified, returns up to 100 record sets. // recordsetnamesuffix - the suffix label of the record set name that has to be used to filter the record set // enumerations. If this parameter is specified, Enumeration will return only records that end with // . func (client RecordSetsClient) ListByDNSZone(ctx context.Context, resourceGroupName string, zoneName string, top *int32, recordsetnamesuffix string) (result RecordSetListResultPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("dns.RecordSetsClient", "ListByDNSZone", err.Error()) + } + result.fn = client.listByDNSZoneNextResults req, err := client.ListByDNSZonePreparer(ctx, resourceGroupName, zoneName, top, recordsetnamesuffix) if err != nil { @@ -381,7 +414,7 @@ func (client RecordSetsClient) ListByDNSZoneComplete(ctx context.Context, resour // ListByType lists the record sets of a specified type in a DNS zone. // Parameters: -// resourceGroupName - the name of the resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // zoneName - the name of the DNS zone (without a terminating dot). // recordType - the type of record sets to enumerate. // top - the maximum number of record sets to return. If not specified, returns up to 100 record sets. @@ -389,6 +422,14 @@ func (client RecordSetsClient) ListByDNSZoneComplete(ctx context.Context, resour // enumerations. If this parameter is specified, Enumeration will return only records that end with // . func (client RecordSetsClient) ListByType(ctx context.Context, resourceGroupName string, zoneName string, recordType RecordType, top *int32, recordsetnamesuffix string) (result RecordSetListResultPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("dns.RecordSetsClient", "ListByType", err.Error()) + } + result.fn = client.listByTypeNextResults req, err := client.ListByTypePreparer(ctx, resourceGroupName, zoneName, recordType, top, recordsetnamesuffix) if err != nil { @@ -488,7 +529,7 @@ func (client RecordSetsClient) ListByTypeComplete(ctx context.Context, resourceG // Update updates a record set within a DNS zone. // Parameters: -// resourceGroupName - the name of the resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // zoneName - the name of the DNS zone (without a terminating dot). // relativeRecordSetName - the name of the record set, relative to the name of the zone. // recordType - the type of DNS record in this record set. @@ -496,6 +537,14 @@ func (client RecordSetsClient) ListByTypeComplete(ctx context.Context, resourceG // ifMatch - the etag of the record set. Omit this value to always overwrite the current record set. Specify // the last-seen etag value to prevent accidentally overwritting concurrent changes. func (client RecordSetsClient) Update(ctx context.Context, resourceGroupName string, zoneName string, relativeRecordSetName string, recordType RecordType, parameters RecordSet, ifMatch string) (result RecordSet, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("dns.RecordSetsClient", "Update", err.Error()) + } + req, err := client.UpdatePreparer(ctx, resourceGroupName, zoneName, relativeRecordSetName, recordType, parameters, ifMatch) if err != nil { err = autorest.NewErrorWithError(err, "dns.RecordSetsClient", "Update", nil, "Failure preparing request") diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2017-09-01/dns/zones.go b/vendor/github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2017-09-01/dns/zones.go index a54c1dcbb..4a0be76e1 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2017-09-01/dns/zones.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2017-09-01/dns/zones.go @@ -21,6 +21,7 @@ import ( "context" "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" "net/http" ) @@ -41,7 +42,7 @@ func NewZonesClientWithBaseURI(baseURI string, subscriptionID string) ZonesClien // CreateOrUpdate creates or updates a DNS zone. Does not modify DNS records within the zone. // Parameters: -// resourceGroupName - the name of the resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // zoneName - the name of the DNS zone (without a terminating dot). // parameters - parameters supplied to the CreateOrUpdate operation. // ifMatch - the etag of the DNS zone. Omit this value to always overwrite the current zone. Specify the @@ -49,6 +50,14 @@ func NewZonesClientWithBaseURI(baseURI string, subscriptionID string) ZonesClien // ifNoneMatch - set to '*' to allow a new DNS zone to be created, but to prevent updating an existing zone. // Other values will be ignored. func (client ZonesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, zoneName string, parameters Zone, ifMatch string, ifNoneMatch string) (result Zone, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("dns.ZonesClient", "CreateOrUpdate", err.Error()) + } + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, zoneName, parameters, ifMatch, ifNoneMatch) if err != nil { err = autorest.NewErrorWithError(err, "dns.ZonesClient", "CreateOrUpdate", nil, "Failure preparing request") @@ -124,11 +133,19 @@ func (client ZonesClient) CreateOrUpdateResponder(resp *http.Response) (result Z // Delete deletes a DNS zone. WARNING: All DNS records in the zone will also be deleted. This operation cannot be // undone. // Parameters: -// resourceGroupName - the name of the resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // zoneName - the name of the DNS zone (without a terminating dot). // ifMatch - the etag of the DNS zone. Omit this value to always delete the current zone. Specify the last-seen // etag value to prevent accidentally deleting any concurrent changes. func (client ZonesClient) Delete(ctx context.Context, resourceGroupName string, zoneName string, ifMatch string) (result ZonesDeleteFuture, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("dns.ZonesClient", "Delete", err.Error()) + } + req, err := client.DeletePreparer(ctx, resourceGroupName, zoneName, ifMatch) if err != nil { err = autorest.NewErrorWithError(err, "dns.ZonesClient", "Delete", nil, "Failure preparing request") @@ -200,9 +217,17 @@ func (client ZonesClient) DeleteResponder(resp *http.Response) (result autorest. // Get gets a DNS zone. Retrieves the zone properties, but not the record sets within the zone. // Parameters: -// resourceGroupName - the name of the resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // zoneName - the name of the DNS zone (without a terminating dot). func (client ZonesClient) Get(ctx context.Context, resourceGroupName string, zoneName string) (result Zone, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("dns.ZonesClient", "Get", err.Error()) + } + req, err := client.GetPreparer(ctx, resourceGroupName, zoneName) if err != nil { err = autorest.NewErrorWithError(err, "dns.ZonesClient", "Get", nil, "Failure preparing request") @@ -362,9 +387,17 @@ func (client ZonesClient) ListComplete(ctx context.Context, top *int32) (result // ListByResourceGroup lists the DNS zones within a resource group. // Parameters: -// resourceGroupName - the name of the resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // top - the maximum number of record sets to return. If not specified, returns up to 100 record sets. func (client ZonesClient) ListByResourceGroup(ctx context.Context, resourceGroupName string, top *int32) (result ZoneListResultPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("dns.ZonesClient", "ListByResourceGroup", err.Error()) + } + result.fn = client.listByResourceGroupNextResults req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName, top) if err != nil { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2017-10-01/dns/recordsets.go b/vendor/github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2017-10-01/dns/recordsets.go index 1bdb64dc6..1210b701d 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2017-10-01/dns/recordsets.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2017-10-01/dns/recordsets.go @@ -21,6 +21,7 @@ import ( "context" "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" "net/http" ) @@ -41,7 +42,7 @@ func NewRecordSetsClientWithBaseURI(baseURI string, subscriptionID string) Recor // CreateOrUpdate creates or updates a record set within a DNS zone. // Parameters: -// resourceGroupName - the name of the resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // zoneName - the name of the DNS zone (without a terminating dot). // relativeRecordSetName - the name of the record set, relative to the name of the zone. // recordType - the type of DNS record in this record set. Record sets of type SOA can be updated but not @@ -52,6 +53,14 @@ func NewRecordSetsClientWithBaseURI(baseURI string, subscriptionID string) Recor // ifNoneMatch - set to '*' to allow a new record set to be created, but to prevent updating an existing record // set. Other values will be ignored. func (client RecordSetsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, zoneName string, relativeRecordSetName string, recordType RecordType, parameters RecordSet, ifMatch string, ifNoneMatch string) (result RecordSet, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("dns.RecordSetsClient", "CreateOrUpdate", err.Error()) + } + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, zoneName, relativeRecordSetName, recordType, parameters, ifMatch, ifNoneMatch) if err != nil { err = autorest.NewErrorWithError(err, "dns.RecordSetsClient", "CreateOrUpdate", nil, "Failure preparing request") @@ -128,7 +137,7 @@ func (client RecordSetsClient) CreateOrUpdateResponder(resp *http.Response) (res // Delete deletes a record set from a DNS zone. This operation cannot be undone. // Parameters: -// resourceGroupName - the name of the resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // zoneName - the name of the DNS zone (without a terminating dot). // relativeRecordSetName - the name of the record set, relative to the name of the zone. // recordType - the type of DNS record in this record set. Record sets of type SOA cannot be deleted (they are @@ -136,6 +145,14 @@ func (client RecordSetsClient) CreateOrUpdateResponder(resp *http.Response) (res // ifMatch - the etag of the record set. Omit this value to always delete the current record set. Specify the // last-seen etag value to prevent accidentally deleting any concurrent changes. func (client RecordSetsClient) Delete(ctx context.Context, resourceGroupName string, zoneName string, relativeRecordSetName string, recordType RecordType, ifMatch string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("dns.RecordSetsClient", "Delete", err.Error()) + } + req, err := client.DeletePreparer(ctx, resourceGroupName, zoneName, relativeRecordSetName, recordType, ifMatch) if err != nil { err = autorest.NewErrorWithError(err, "dns.RecordSetsClient", "Delete", nil, "Failure preparing request") @@ -205,11 +222,19 @@ func (client RecordSetsClient) DeleteResponder(resp *http.Response) (result auto // Get gets a record set. // Parameters: -// resourceGroupName - the name of the resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // zoneName - the name of the DNS zone (without a terminating dot). // relativeRecordSetName - the name of the record set, relative to the name of the zone. // recordType - the type of DNS record in this record set. func (client RecordSetsClient) Get(ctx context.Context, resourceGroupName string, zoneName string, relativeRecordSetName string, recordType RecordType) (result RecordSet, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("dns.RecordSetsClient", "Get", err.Error()) + } + req, err := client.GetPreparer(ctx, resourceGroupName, zoneName, relativeRecordSetName, recordType) if err != nil { err = autorest.NewErrorWithError(err, "dns.RecordSetsClient", "Get", nil, "Failure preparing request") @@ -276,13 +301,21 @@ func (client RecordSetsClient) GetResponder(resp *http.Response) (result RecordS // ListAllByDNSZone lists all record sets in a DNS zone. // Parameters: -// resourceGroupName - the name of the resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // zoneName - the name of the DNS zone (without a terminating dot). // top - the maximum number of record sets to return. If not specified, returns up to 100 record sets. // recordSetNameSuffix - the suffix label of the record set name that has to be used to filter the record set // enumerations. If this parameter is specified, Enumeration will return only records that end with // . func (client RecordSetsClient) ListAllByDNSZone(ctx context.Context, resourceGroupName string, zoneName string, top *int32, recordSetNameSuffix string) (result RecordSetListResultPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("dns.RecordSetsClient", "ListAllByDNSZone", err.Error()) + } + result.fn = client.listAllByDNSZoneNextResults req, err := client.ListAllByDNSZonePreparer(ctx, resourceGroupName, zoneName, top, recordSetNameSuffix) if err != nil { @@ -381,13 +414,21 @@ func (client RecordSetsClient) ListAllByDNSZoneComplete(ctx context.Context, res // ListByDNSZone lists all record sets in a DNS zone. // Parameters: -// resourceGroupName - the name of the resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // zoneName - the name of the DNS zone (without a terminating dot). // top - the maximum number of record sets to return. If not specified, returns up to 100 record sets. // recordsetnamesuffix - the suffix label of the record set name that has to be used to filter the record set // enumerations. If this parameter is specified, Enumeration will return only records that end with // . func (client RecordSetsClient) ListByDNSZone(ctx context.Context, resourceGroupName string, zoneName string, top *int32, recordsetnamesuffix string) (result RecordSetListResultPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("dns.RecordSetsClient", "ListByDNSZone", err.Error()) + } + result.fn = client.listByDNSZoneNextResults req, err := client.ListByDNSZonePreparer(ctx, resourceGroupName, zoneName, top, recordsetnamesuffix) if err != nil { @@ -486,7 +527,7 @@ func (client RecordSetsClient) ListByDNSZoneComplete(ctx context.Context, resour // ListByType lists the record sets of a specified type in a DNS zone. // Parameters: -// resourceGroupName - the name of the resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // zoneName - the name of the DNS zone (without a terminating dot). // recordType - the type of record sets to enumerate. // top - the maximum number of record sets to return. If not specified, returns up to 100 record sets. @@ -494,6 +535,14 @@ func (client RecordSetsClient) ListByDNSZoneComplete(ctx context.Context, resour // enumerations. If this parameter is specified, Enumeration will return only records that end with // . func (client RecordSetsClient) ListByType(ctx context.Context, resourceGroupName string, zoneName string, recordType RecordType, top *int32, recordsetnamesuffix string) (result RecordSetListResultPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("dns.RecordSetsClient", "ListByType", err.Error()) + } + result.fn = client.listByTypeNextResults req, err := client.ListByTypePreparer(ctx, resourceGroupName, zoneName, recordType, top, recordsetnamesuffix) if err != nil { @@ -593,7 +642,7 @@ func (client RecordSetsClient) ListByTypeComplete(ctx context.Context, resourceG // Update updates a record set within a DNS zone. // Parameters: -// resourceGroupName - the name of the resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // zoneName - the name of the DNS zone (without a terminating dot). // relativeRecordSetName - the name of the record set, relative to the name of the zone. // recordType - the type of DNS record in this record set. @@ -601,6 +650,14 @@ func (client RecordSetsClient) ListByTypeComplete(ctx context.Context, resourceG // ifMatch - the etag of the record set. Omit this value to always overwrite the current record set. Specify // the last-seen etag value to prevent accidentally overwritting concurrent changes. func (client RecordSetsClient) Update(ctx context.Context, resourceGroupName string, zoneName string, relativeRecordSetName string, recordType RecordType, parameters RecordSet, ifMatch string) (result RecordSet, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("dns.RecordSetsClient", "Update", err.Error()) + } + req, err := client.UpdatePreparer(ctx, resourceGroupName, zoneName, relativeRecordSetName, recordType, parameters, ifMatch) if err != nil { err = autorest.NewErrorWithError(err, "dns.RecordSetsClient", "Update", nil, "Failure preparing request") diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2017-10-01/dns/zones.go b/vendor/github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2017-10-01/dns/zones.go index 40c2eedb5..45ff5fc80 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2017-10-01/dns/zones.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2017-10-01/dns/zones.go @@ -21,6 +21,7 @@ import ( "context" "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" "net/http" ) @@ -41,7 +42,7 @@ func NewZonesClientWithBaseURI(baseURI string, subscriptionID string) ZonesClien // CreateOrUpdate creates or updates a DNS zone. Does not modify DNS records within the zone. // Parameters: -// resourceGroupName - the name of the resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // zoneName - the name of the DNS zone (without a terminating dot). // parameters - parameters supplied to the CreateOrUpdate operation. // ifMatch - the etag of the DNS zone. Omit this value to always overwrite the current zone. Specify the @@ -49,6 +50,14 @@ func NewZonesClientWithBaseURI(baseURI string, subscriptionID string) ZonesClien // ifNoneMatch - set to '*' to allow a new DNS zone to be created, but to prevent updating an existing zone. // Other values will be ignored. func (client ZonesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, zoneName string, parameters Zone, ifMatch string, ifNoneMatch string) (result Zone, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("dns.ZonesClient", "CreateOrUpdate", err.Error()) + } + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, zoneName, parameters, ifMatch, ifNoneMatch) if err != nil { err = autorest.NewErrorWithError(err, "dns.ZonesClient", "CreateOrUpdate", nil, "Failure preparing request") @@ -124,11 +133,19 @@ func (client ZonesClient) CreateOrUpdateResponder(resp *http.Response) (result Z // Delete deletes a DNS zone. WARNING: All DNS records in the zone will also be deleted. This operation cannot be // undone. // Parameters: -// resourceGroupName - the name of the resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // zoneName - the name of the DNS zone (without a terminating dot). // ifMatch - the etag of the DNS zone. Omit this value to always delete the current zone. Specify the last-seen // etag value to prevent accidentally deleting any concurrent changes. func (client ZonesClient) Delete(ctx context.Context, resourceGroupName string, zoneName string, ifMatch string) (result ZonesDeleteFuture, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("dns.ZonesClient", "Delete", err.Error()) + } + req, err := client.DeletePreparer(ctx, resourceGroupName, zoneName, ifMatch) if err != nil { err = autorest.NewErrorWithError(err, "dns.ZonesClient", "Delete", nil, "Failure preparing request") @@ -200,9 +217,17 @@ func (client ZonesClient) DeleteResponder(resp *http.Response) (result autorest. // Get gets a DNS zone. Retrieves the zone properties, but not the record sets within the zone. // Parameters: -// resourceGroupName - the name of the resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // zoneName - the name of the DNS zone (without a terminating dot). func (client ZonesClient) Get(ctx context.Context, resourceGroupName string, zoneName string) (result Zone, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("dns.ZonesClient", "Get", err.Error()) + } + req, err := client.GetPreparer(ctx, resourceGroupName, zoneName) if err != nil { err = autorest.NewErrorWithError(err, "dns.ZonesClient", "Get", nil, "Failure preparing request") @@ -362,9 +387,17 @@ func (client ZonesClient) ListComplete(ctx context.Context, top *int32) (result // ListByResourceGroup lists the DNS zones within a resource group. // Parameters: -// resourceGroupName - the name of the resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // top - the maximum number of record sets to return. If not specified, returns up to 100 record sets. func (client ZonesClient) ListByResourceGroup(ctx context.Context, resourceGroupName string, top *int32) (result ZoneListResultPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("dns.ZonesClient", "ListByResourceGroup", err.Error()) + } + result.fn = client.listByResourceGroupNextResults req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName, top) if err != nil { @@ -459,12 +492,20 @@ func (client ZonesClient) ListByResourceGroupComplete(ctx context.Context, resou // Update updates a DNS zone. Does not modify DNS records within the zone. // Parameters: -// resourceGroupName - the name of the resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // zoneName - the name of the DNS zone (without a terminating dot). // parameters - parameters supplied to the Update operation. // ifMatch - the etag of the DNS zone. Omit this value to always overwrite the current zone. Specify the // last-seen etag value to prevent accidentally overwritting any concurrent changes. func (client ZonesClient) Update(ctx context.Context, resourceGroupName string, zoneName string, parameters ZoneUpdate, ifMatch string) (result Zone, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("dns.ZonesClient", "Update", err.Error()) + } + req, err := client.UpdatePreparer(ctx, resourceGroupName, zoneName, parameters, ifMatch) if err != nil { err = autorest.NewErrorWithError(err, "dns.ZonesClient", "Update", nil, "Failure preparing request") diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/eventhub/mgmt/2017-04-01/eventhub/consumergroups.go b/vendor/github.com/Azure/azure-sdk-for-go/services/eventhub/mgmt/2017-04-01/eventhub/consumergroups.go index 386d0c64b..95869944d 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/eventhub/mgmt/2017-04-01/eventhub/consumergroups.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/eventhub/mgmt/2017-04-01/eventhub/consumergroups.go @@ -322,12 +322,12 @@ func (client ConsumerGroupsClient) ListByEventHub(ctx context.Context, resourceG Constraints: []validation.Constraint{{Target: "eventHubName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: skip, Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, + Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMaximum, Rule: int64(1000), Chain: nil}, {Target: "skip", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, }}}}, {TargetValue: top, Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: int64(1000), Chain: nil}, {Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("eventhub.ConsumerGroupsClient", "ListByEventHub", err.Error()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/eventhub/mgmt/2017-04-01/eventhub/eventhubs.go b/vendor/github.com/Azure/azure-sdk-for-go/services/eventhub/mgmt/2017-04-01/eventhub/eventhubs.go index 7228f2e33..4f553202a 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/eventhub/mgmt/2017-04-01/eventhub/eventhubs.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/eventhub/mgmt/2017-04-01/eventhub/eventhubs.go @@ -64,11 +64,11 @@ func (client EventHubsClient) CreateOrUpdate(ctx context.Context, resourceGroupN Chain: []validation.Constraint{{Target: "parameters.Properties.PartitionCount", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}, {Target: "parameters.Properties.CaptureDescription", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "parameters.Properties.CaptureDescription.IntervalInSeconds", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.Properties.CaptureDescription.IntervalInSeconds", Name: validation.InclusiveMaximum, Rule: 900, Chain: nil}, + Chain: []validation.Constraint{{Target: "parameters.Properties.CaptureDescription.IntervalInSeconds", Name: validation.InclusiveMaximum, Rule: int64(900), Chain: nil}, {Target: "parameters.Properties.CaptureDescription.IntervalInSeconds", Name: validation.InclusiveMinimum, Rule: 60, Chain: nil}, }}, {Target: "parameters.Properties.CaptureDescription.SizeLimitInBytes", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.Properties.CaptureDescription.SizeLimitInBytes", Name: validation.InclusiveMaximum, Rule: 524288000, Chain: nil}, + Chain: []validation.Constraint{{Target: "parameters.Properties.CaptureDescription.SizeLimitInBytes", Name: validation.InclusiveMaximum, Rule: int64(524288000), Chain: nil}, {Target: "parameters.Properties.CaptureDescription.SizeLimitInBytes", Name: validation.InclusiveMinimum, Rule: 10485760, Chain: nil}, }}, }}, @@ -689,12 +689,12 @@ func (client EventHubsClient) ListByNamespace(ctx context.Context, resourceGroup {Target: "namespaceName", Name: validation.MinLength, Rule: 6, Chain: nil}}}, {TargetValue: skip, Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, + Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMaximum, Rule: int64(1000), Chain: nil}, {Target: "skip", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, }}}}, {TargetValue: top, Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: int64(1000), Chain: nil}, {Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("eventhub.EventHubsClient", "ListByNamespace", err.Error()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/eventhub/mgmt/2017-04-01/eventhub/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/eventhub/mgmt/2017-04-01/eventhub/models.go index 30cfd7c93..0cb524f67 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/eventhub/mgmt/2017-04-01/eventhub/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/eventhub/mgmt/2017-04-01/eventhub/models.go @@ -403,6 +403,8 @@ type ArmDisasterRecoveryProperties struct { AlternateName *string `json:"alternateName,omitempty"` // Role - role of namespace in GEO DR - possible values 'Primary' or 'PrimaryNotReplicating' or 'Secondary'. Possible values include: 'Primary', 'PrimaryNotReplicating', 'Secondary' Role RoleDisasterRecovery `json:"role,omitempty"` + // PendingReplicationOperationsCount - Number of entities pending to be replicated. + PendingReplicationOperationsCount *int64 `json:"pendingReplicationOperationsCount,omitempty"` } // AuthorizationRule single item in a List or Get AuthorizationRule operation diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/eventhub/mgmt/2017-04-01/eventhub/namespaces.go b/vendor/github.com/Azure/azure-sdk-for-go/services/eventhub/mgmt/2017-04-01/eventhub/namespaces.go index ee8818989..fb7ed1ddf 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/eventhub/mgmt/2017-04-01/eventhub/namespaces.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/eventhub/mgmt/2017-04-01/eventhub/namespaces.go @@ -129,13 +129,13 @@ func (client NamespacesClient) CreateOrUpdate(ctx context.Context, resourceGroup {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.Sku", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "parameters.Sku.Capacity", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.Sku.Capacity", Name: validation.InclusiveMaximum, Rule: 20, Chain: nil}, + Chain: []validation.Constraint{{Target: "parameters.Sku.Capacity", Name: validation.InclusiveMaximum, Rule: int64(20), Chain: nil}, {Target: "parameters.Sku.Capacity", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, }}, }}, {Target: "parameters.EHNamespaceProperties", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "parameters.EHNamespaceProperties.MaximumThroughputUnits", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.EHNamespaceProperties.MaximumThroughputUnits", Name: validation.InclusiveMaximum, Rule: 20, Chain: nil}, + Chain: []validation.Constraint{{Target: "parameters.EHNamespaceProperties.MaximumThroughputUnits", Name: validation.InclusiveMaximum, Rule: int64(20), Chain: nil}, {Target: "parameters.EHNamespaceProperties.MaximumThroughputUnits", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, }}, }}}}}); err != nil { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/iothub/mgmt/2016-02-03/devices/iothubresource.go b/vendor/github.com/Azure/azure-sdk-for-go/services/iothub/mgmt/2016-02-03/devices/iothubresource.go index 642c2a80f..35a5e7ecc 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/iothub/mgmt/2016-02-03/devices/iothubresource.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/iothub/mgmt/2016-02-03/devices/iothubresource.go @@ -199,12 +199,12 @@ func (client IotHubResourceClient) CreateOrUpdate(ctx context.Context, resourceG {Target: "iotHubDescription.Properties", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "iotHubDescription.Properties.CloudToDevice", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "iotHubDescription.Properties.CloudToDevice.MaxDeliveryCount", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "iotHubDescription.Properties.CloudToDevice.MaxDeliveryCount", Name: validation.InclusiveMaximum, Rule: 100, Chain: nil}, + Chain: []validation.Constraint{{Target: "iotHubDescription.Properties.CloudToDevice.MaxDeliveryCount", Name: validation.InclusiveMaximum, Rule: int64(100), Chain: nil}, {Target: "iotHubDescription.Properties.CloudToDevice.MaxDeliveryCount", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}, {Target: "iotHubDescription.Properties.CloudToDevice.Feedback", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "iotHubDescription.Properties.CloudToDevice.Feedback.MaxDeliveryCount", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "iotHubDescription.Properties.CloudToDevice.Feedback.MaxDeliveryCount", Name: validation.InclusiveMaximum, Rule: 100, Chain: nil}, + Chain: []validation.Constraint{{Target: "iotHubDescription.Properties.CloudToDevice.Feedback.MaxDeliveryCount", Name: validation.InclusiveMaximum, Rule: int64(100), Chain: nil}, {Target: "iotHubDescription.Properties.CloudToDevice.Feedback.MaxDeliveryCount", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}, }}, diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/iothub/mgmt/2017-01-19/devices/iothubresource.go b/vendor/github.com/Azure/azure-sdk-for-go/services/iothub/mgmt/2017-01-19/devices/iothubresource.go index fafb05710..7c8072d13 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/iothub/mgmt/2017-01-19/devices/iothubresource.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/iothub/mgmt/2017-01-19/devices/iothubresource.go @@ -209,12 +209,12 @@ func (client IotHubResourceClient) CreateOrUpdate(ctx context.Context, resourceG }}, {Target: "iotHubDescription.Properties.CloudToDevice", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "iotHubDescription.Properties.CloudToDevice.MaxDeliveryCount", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "iotHubDescription.Properties.CloudToDevice.MaxDeliveryCount", Name: validation.InclusiveMaximum, Rule: 100, Chain: nil}, + Chain: []validation.Constraint{{Target: "iotHubDescription.Properties.CloudToDevice.MaxDeliveryCount", Name: validation.InclusiveMaximum, Rule: int64(100), Chain: nil}, {Target: "iotHubDescription.Properties.CloudToDevice.MaxDeliveryCount", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}, {Target: "iotHubDescription.Properties.CloudToDevice.Feedback", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "iotHubDescription.Properties.CloudToDevice.Feedback.MaxDeliveryCount", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "iotHubDescription.Properties.CloudToDevice.Feedback.MaxDeliveryCount", Name: validation.InclusiveMaximum, Rule: 100, Chain: nil}, + Chain: []validation.Constraint{{Target: "iotHubDescription.Properties.CloudToDevice.Feedback.MaxDeliveryCount", Name: validation.InclusiveMaximum, Rule: int64(100), Chain: nil}, {Target: "iotHubDescription.Properties.CloudToDevice.Feedback.MaxDeliveryCount", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}, }}, diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/iothub/mgmt/2017-07-01/devices/iothubresource.go b/vendor/github.com/Azure/azure-sdk-for-go/services/iothub/mgmt/2017-07-01/devices/iothubresource.go index 591a82626..45879941d 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/iothub/mgmt/2017-07-01/devices/iothubresource.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/iothub/mgmt/2017-07-01/devices/iothubresource.go @@ -211,12 +211,12 @@ func (client IotHubResourceClient) CreateOrUpdate(ctx context.Context, resourceG }}, {Target: "iotHubDescription.Properties.CloudToDevice", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "iotHubDescription.Properties.CloudToDevice.MaxDeliveryCount", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "iotHubDescription.Properties.CloudToDevice.MaxDeliveryCount", Name: validation.InclusiveMaximum, Rule: 100, Chain: nil}, + Chain: []validation.Constraint{{Target: "iotHubDescription.Properties.CloudToDevice.MaxDeliveryCount", Name: validation.InclusiveMaximum, Rule: int64(100), Chain: nil}, {Target: "iotHubDescription.Properties.CloudToDevice.MaxDeliveryCount", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}, {Target: "iotHubDescription.Properties.CloudToDevice.Feedback", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "iotHubDescription.Properties.CloudToDevice.Feedback.MaxDeliveryCount", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "iotHubDescription.Properties.CloudToDevice.Feedback.MaxDeliveryCount", Name: validation.InclusiveMaximum, Rule: 100, Chain: nil}, + Chain: []validation.Constraint{{Target: "iotHubDescription.Properties.CloudToDevice.Feedback.MaxDeliveryCount", Name: validation.InclusiveMaximum, Rule: int64(100), Chain: nil}, {Target: "iotHubDescription.Properties.CloudToDevice.Feedback.MaxDeliveryCount", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}, }}, diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/iothub/mgmt/2018-01-22/devices/iothubresource.go b/vendor/github.com/Azure/azure-sdk-for-go/services/iothub/mgmt/2018-01-22/devices/iothubresource.go index 29da96f8a..5c4640f26 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/iothub/mgmt/2018-01-22/devices/iothubresource.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/iothub/mgmt/2018-01-22/devices/iothubresource.go @@ -209,12 +209,12 @@ func (client IotHubResourceClient) CreateOrUpdate(ctx context.Context, resourceG }}, {Target: "iotHubDescription.Properties.CloudToDevice", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "iotHubDescription.Properties.CloudToDevice.MaxDeliveryCount", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "iotHubDescription.Properties.CloudToDevice.MaxDeliveryCount", Name: validation.InclusiveMaximum, Rule: 100, Chain: nil}, + Chain: []validation.Constraint{{Target: "iotHubDescription.Properties.CloudToDevice.MaxDeliveryCount", Name: validation.InclusiveMaximum, Rule: int64(100), Chain: nil}, {Target: "iotHubDescription.Properties.CloudToDevice.MaxDeliveryCount", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}, {Target: "iotHubDescription.Properties.CloudToDevice.Feedback", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "iotHubDescription.Properties.CloudToDevice.Feedback.MaxDeliveryCount", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "iotHubDescription.Properties.CloudToDevice.Feedback.MaxDeliveryCount", Name: validation.InclusiveMaximum, Rule: 100, Chain: nil}, + Chain: []validation.Constraint{{Target: "iotHubDescription.Properties.CloudToDevice.Feedback.MaxDeliveryCount", Name: validation.InclusiveMaximum, Rule: int64(100), Chain: nil}, {Target: "iotHubDescription.Properties.CloudToDevice.Feedback.MaxDeliveryCount", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}, }}, diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/iothub/mgmt/2018-04-01/devices/iothubresource.go b/vendor/github.com/Azure/azure-sdk-for-go/services/iothub/mgmt/2018-04-01/devices/iothubresource.go index 901015054..3c5a515b9 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/iothub/mgmt/2018-04-01/devices/iothubresource.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/iothub/mgmt/2018-04-01/devices/iothubresource.go @@ -209,12 +209,12 @@ func (client IotHubResourceClient) CreateOrUpdate(ctx context.Context, resourceG }}, {Target: "iotHubDescription.Properties.CloudToDevice", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "iotHubDescription.Properties.CloudToDevice.MaxDeliveryCount", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "iotHubDescription.Properties.CloudToDevice.MaxDeliveryCount", Name: validation.InclusiveMaximum, Rule: 100, Chain: nil}, + Chain: []validation.Constraint{{Target: "iotHubDescription.Properties.CloudToDevice.MaxDeliveryCount", Name: validation.InclusiveMaximum, Rule: int64(100), Chain: nil}, {Target: "iotHubDescription.Properties.CloudToDevice.MaxDeliveryCount", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}, {Target: "iotHubDescription.Properties.CloudToDevice.Feedback", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "iotHubDescription.Properties.CloudToDevice.Feedback.MaxDeliveryCount", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "iotHubDescription.Properties.CloudToDevice.Feedback.MaxDeliveryCount", Name: validation.InclusiveMaximum, Rule: 100, Chain: nil}, + Chain: []validation.Constraint{{Target: "iotHubDescription.Properties.CloudToDevice.Feedback.MaxDeliveryCount", Name: validation.InclusiveMaximum, Rule: int64(100), Chain: nil}, {Target: "iotHubDescription.Properties.CloudToDevice.Feedback.MaxDeliveryCount", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}, }}, diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/keyvault/2015-06-01/keyvault/client.go b/vendor/github.com/Azure/azure-sdk-for-go/services/keyvault/2015-06-01/keyvault/client.go index a6b4b502d..c06855669 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/keyvault/2015-06-01/keyvault/client.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/keyvault/2015-06-01/keyvault/client.go @@ -1060,7 +1060,7 @@ func (client BaseClient) GetCertificateIssuers(ctx context.Context, vaultBaseURL if err := validation.Validate([]validation.Validation{ {TargetValue: maxresults, Constraints: []validation.Constraint{{Target: "maxresults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "maxresults", Name: validation.InclusiveMaximum, Rule: 25, Chain: nil}, + Chain: []validation.Constraint{{Target: "maxresults", Name: validation.InclusiveMaximum, Rule: int64(25), Chain: nil}, {Target: "maxresults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("keyvault.BaseClient", "GetCertificateIssuers", err.Error()) @@ -1304,7 +1304,7 @@ func (client BaseClient) GetCertificates(ctx context.Context, vaultBaseURL strin if err := validation.Validate([]validation.Validation{ {TargetValue: maxresults, Constraints: []validation.Constraint{{Target: "maxresults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "maxresults", Name: validation.InclusiveMaximum, Rule: 25, Chain: nil}, + Chain: []validation.Constraint{{Target: "maxresults", Name: validation.InclusiveMaximum, Rule: int64(25), Chain: nil}, {Target: "maxresults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("keyvault.BaseClient", "GetCertificates", err.Error()) @@ -1411,7 +1411,7 @@ func (client BaseClient) GetCertificateVersions(ctx context.Context, vaultBaseUR if err := validation.Validate([]validation.Validation{ {TargetValue: maxresults, Constraints: []validation.Constraint{{Target: "maxresults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "maxresults", Name: validation.InclusiveMaximum, Rule: 25, Chain: nil}, + Chain: []validation.Constraint{{Target: "maxresults", Name: validation.InclusiveMaximum, Rule: int64(25), Chain: nil}, {Target: "maxresults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("keyvault.BaseClient", "GetCertificateVersions", err.Error()) @@ -1592,7 +1592,7 @@ func (client BaseClient) GetKeys(ctx context.Context, vaultBaseURL string, maxre if err := validation.Validate([]validation.Validation{ {TargetValue: maxresults, Constraints: []validation.Constraint{{Target: "maxresults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "maxresults", Name: validation.InclusiveMaximum, Rule: 25, Chain: nil}, + Chain: []validation.Constraint{{Target: "maxresults", Name: validation.InclusiveMaximum, Rule: int64(25), Chain: nil}, {Target: "maxresults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("keyvault.BaseClient", "GetKeys", err.Error()) @@ -1699,7 +1699,7 @@ func (client BaseClient) GetKeyVersions(ctx context.Context, vaultBaseURL string if err := validation.Validate([]validation.Validation{ {TargetValue: maxresults, Constraints: []validation.Constraint{{Target: "maxresults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "maxresults", Name: validation.InclusiveMaximum, Rule: 25, Chain: nil}, + Chain: []validation.Constraint{{Target: "maxresults", Name: validation.InclusiveMaximum, Rule: int64(25), Chain: nil}, {Target: "maxresults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("keyvault.BaseClient", "GetKeyVersions", err.Error()) @@ -1880,7 +1880,7 @@ func (client BaseClient) GetSecrets(ctx context.Context, vaultBaseURL string, ma if err := validation.Validate([]validation.Validation{ {TargetValue: maxresults, Constraints: []validation.Constraint{{Target: "maxresults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "maxresults", Name: validation.InclusiveMaximum, Rule: 25, Chain: nil}, + Chain: []validation.Constraint{{Target: "maxresults", Name: validation.InclusiveMaximum, Rule: int64(25), Chain: nil}, {Target: "maxresults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("keyvault.BaseClient", "GetSecrets", err.Error()) @@ -1987,7 +1987,7 @@ func (client BaseClient) GetSecretVersions(ctx context.Context, vaultBaseURL str if err := validation.Validate([]validation.Validation{ {TargetValue: maxresults, Constraints: []validation.Constraint{{Target: "maxresults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "maxresults", Name: validation.InclusiveMaximum, Rule: 25, Chain: nil}, + Chain: []validation.Constraint{{Target: "maxresults", Name: validation.InclusiveMaximum, Rule: int64(25), Chain: nil}, {Target: "maxresults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("keyvault.BaseClient", "GetSecretVersions", err.Error()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/keyvault/2015-06-01/keyvault/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/keyvault/2015-06-01/keyvault/models.go index fa923c8e3..51232a99c 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/keyvault/2015-06-01/keyvault/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/keyvault/2015-06-01/keyvault/models.go @@ -188,7 +188,7 @@ type Attributes struct { // BackupKeyResult the backup key result, containing the backup blob type BackupKeyResult struct { autorest.Response `json:"-"` - // Value - The backup blob containing the backed up key + // Value - The backup blob containing the backed up key (a URL-encoded base64 string) Value *string `json:"value,omitempty"` } @@ -215,7 +215,7 @@ type CertificateBundle struct { Kid *string `json:"kid,omitempty"` // Sid - The secret id Sid *string `json:"sid,omitempty"` - // X509Thumbprint - Thumbprint of the certificate. + // X509Thumbprint - Thumbprint of the certificate. (a URL-encoded base64 string) X509Thumbprint *string `json:"x5t,omitempty"` // Policy - The management policy. Policy *CertificatePolicy `json:"policy,omitempty"` @@ -464,7 +464,7 @@ type CertificateItem struct { Attributes *CertificateAttributes `json:"attributes,omitempty"` // Tags - Application-specific metadata in the form of key-value pairs Tags map[string]*string `json:"tags"` - // X509Thumbprint - Thumbprint of the certificate. + // X509Thumbprint - Thumbprint of the certificate. (a URL-encoded base64 string) X509Thumbprint *string `json:"x5t,omitempty"` } @@ -766,25 +766,25 @@ type JSONWebKey struct { // Kty - Supported JsonWebKey key types (kty) for Elliptic Curve, RSA, HSM, Octet, usually RSA. Possible values include: 'EC', 'RSA', 'RSAHSM', 'Oct' Kty JSONWebKeyType `json:"kty,omitempty"` KeyOps *[]string `json:"key_ops,omitempty"` - // N - RSA modulus + // N - RSA modulus (a URL-encoded base64 string) N *string `json:"n,omitempty"` - // E - RSA public exponent + // E - RSA public exponent (a URL-encoded base64 string) E *string `json:"e,omitempty"` - // D - RSA private exponent + // D - RSA private exponent (a URL-encoded base64 string) D *string `json:"d,omitempty"` - // DP - RSA Private Key Parameter + // DP - RSA Private Key Parameter (a URL-encoded base64 string) DP *string `json:"dp,omitempty"` - // DQ - RSA Private Key Parameter + // DQ - RSA Private Key Parameter (a URL-encoded base64 string) DQ *string `json:"dq,omitempty"` - // QI - RSA Private Key Parameter + // QI - RSA Private Key Parameter (a URL-encoded base64 string) QI *string `json:"qi,omitempty"` - // P - RSA secret prime + // P - RSA secret prime (a URL-encoded base64 string) P *string `json:"p,omitempty"` - // Q - RSA secret prime, with p < q + // Q - RSA secret prime, with p < q (a URL-encoded base64 string) Q *string `json:"q,omitempty"` - // K - Symmetric key + // K - Symmetric key (a URL-encoded base64 string) K *string `json:"k,omitempty"` - // T - HSM Token, used with Bring Your Own Key + // T - HSM Token, used with Bring Your Own Key (a URL-encoded base64 string) T *string `json:"key_hsm,omitempty"` } @@ -837,7 +837,7 @@ func (kb KeyBundle) MarshalJSON() ([]byte, error) { type KeyCreateParameters struct { // Kty - The type of key to create. Valid key types, see JsonWebKeyType. Supported JsonWebKey key types (kty) for Elliptic Curve, RSA, HSM, Octet. Possible values include: 'EC', 'RSA', 'RSAHSM', 'Oct' Kty JSONWebKeyType `json:"kty,omitempty"` - // KeySize - The key size in bytes. e.g. 1024 or 2048. + // KeySize - The key size in bits. e.g. 1024 or 2048. KeySize *int32 `json:"key_size,omitempty"` KeyOps *[]JSONWebKeyOperation `json:"key_ops,omitempty"` KeyAttributes *KeyAttributes `json:"attributes,omitempty"` @@ -1032,7 +1032,8 @@ func (page KeyListResultPage) Values() []KeyItem { type KeyOperationResult struct { autorest.Response `json:"-"` // Kid - Key identifier - Kid *string `json:"kid,omitempty"` + Kid *string `json:"kid,omitempty"` + // Result - a URL-encoded base64 string Result *string `json:"value,omitempty"` } @@ -1040,7 +1041,8 @@ type KeyOperationResult struct { type KeyOperationsParameters struct { // Algorithm - algorithm identifier. Possible values include: 'RSAOAEP', 'RSAOAEP256', 'RSA15' Algorithm JSONWebKeyEncryptionAlgorithm `json:"alg,omitempty"` - Value *string `json:"value,omitempty"` + // Value - a URL-encoded base64 string + Value *string `json:"value,omitempty"` } // KeyProperties properties of the key pair backing a certificate. @@ -1049,7 +1051,7 @@ type KeyProperties struct { Exportable *bool `json:"exportable,omitempty"` // KeyType - The key type. KeyType *string `json:"kty,omitempty"` - // KeySize - The key size in bytes. e.g. 2048. + // KeySize - The key size in bits. e.g. 2048. KeySize *int32 `json:"key_size,omitempty"` // ReuseKey - Indicates if the same key pair will be used on certificate renewal. ReuseKey *bool `json:"reuse_key,omitempty"` @@ -1057,7 +1059,7 @@ type KeyProperties struct { // KeyRestoreParameters the key restore parameters type KeyRestoreParameters struct { - // KeyBundleBackup - the backup blob associated with a key bundle + // KeyBundleBackup - the backup blob associated with a key bundle (a URL-encoded base64 string) KeyBundleBackup *string `json:"value,omitempty"` } @@ -1065,7 +1067,8 @@ type KeyRestoreParameters struct { type KeySignParameters struct { // Algorithm - The signing/verification algorithm identifier. For more information on possible algorithm types, see JsonWebKeySignatureAlgorithm. Possible values include: 'PS256', 'PS384', 'PS512', 'RS256', 'RS384', 'RS512', 'RSNULL' Algorithm JSONWebKeySignatureAlgorithm `json:"alg,omitempty"` - Value *string `json:"value,omitempty"` + // Value - a URL-encoded base64 string + Value *string `json:"value,omitempty"` } // KeyUpdateParameters the key update parameters @@ -1096,9 +1099,9 @@ func (kup KeyUpdateParameters) MarshalJSON() ([]byte, error) { type KeyVerifyParameters struct { // Algorithm - The signing/verification algorithm. For more information on possible algorithm types, see JsonWebKeySignatureAlgorithm. Possible values include: 'PS256', 'PS384', 'PS512', 'RS256', 'RS384', 'RS512', 'RSNULL' Algorithm JSONWebKeySignatureAlgorithm `json:"alg,omitempty"` - // Digest - The digest used for signing + // Digest - The digest used for signing (a URL-encoded base64 string) Digest *string `json:"digest,omitempty"` - // Signature - The signature to be verified + // Signature - The signature to be verified (a URL-encoded base64 string) Signature *string `json:"value,omitempty"` } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/keyvault/2016-10-01/keyvault/client.go b/vendor/github.com/Azure/azure-sdk-for-go/services/keyvault/2016-10-01/keyvault/client.go index 73558939d..731e99857 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/keyvault/2016-10-01/keyvault/client.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/keyvault/2016-10-01/keyvault/client.go @@ -1316,7 +1316,7 @@ func (client BaseClient) GetCertificateIssuers(ctx context.Context, vaultBaseURL if err := validation.Validate([]validation.Validation{ {TargetValue: maxresults, Constraints: []validation.Constraint{{Target: "maxresults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "maxresults", Name: validation.InclusiveMaximum, Rule: 25, Chain: nil}, + Chain: []validation.Constraint{{Target: "maxresults", Name: validation.InclusiveMaximum, Rule: int64(25), Chain: nil}, {Target: "maxresults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("keyvault.BaseClient", "GetCertificateIssuers", err.Error()) @@ -1563,7 +1563,7 @@ func (client BaseClient) GetCertificates(ctx context.Context, vaultBaseURL strin if err := validation.Validate([]validation.Validation{ {TargetValue: maxresults, Constraints: []validation.Constraint{{Target: "maxresults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "maxresults", Name: validation.InclusiveMaximum, Rule: 25, Chain: nil}, + Chain: []validation.Constraint{{Target: "maxresults", Name: validation.InclusiveMaximum, Rule: int64(25), Chain: nil}, {Target: "maxresults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("keyvault.BaseClient", "GetCertificates", err.Error()) @@ -1671,7 +1671,7 @@ func (client BaseClient) GetCertificateVersions(ctx context.Context, vaultBaseUR if err := validation.Validate([]validation.Validation{ {TargetValue: maxresults, Constraints: []validation.Constraint{{Target: "maxresults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "maxresults", Name: validation.InclusiveMaximum, Rule: 25, Chain: nil}, + Chain: []validation.Constraint{{Target: "maxresults", Name: validation.InclusiveMaximum, Rule: int64(25), Chain: nil}, {Target: "maxresults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("keyvault.BaseClient", "GetCertificateVersions", err.Error()) @@ -1855,7 +1855,7 @@ func (client BaseClient) GetDeletedCertificates(ctx context.Context, vaultBaseUR if err := validation.Validate([]validation.Validation{ {TargetValue: maxresults, Constraints: []validation.Constraint{{Target: "maxresults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "maxresults", Name: validation.InclusiveMaximum, Rule: 25, Chain: nil}, + Chain: []validation.Constraint{{Target: "maxresults", Name: validation.InclusiveMaximum, Rule: int64(25), Chain: nil}, {Target: "maxresults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("keyvault.BaseClient", "GetDeletedCertificates", err.Error()) @@ -2035,7 +2035,7 @@ func (client BaseClient) GetDeletedKeys(ctx context.Context, vaultBaseURL string if err := validation.Validate([]validation.Validation{ {TargetValue: maxresults, Constraints: []validation.Constraint{{Target: "maxresults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "maxresults", Name: validation.InclusiveMaximum, Rule: 25, Chain: nil}, + Chain: []validation.Constraint{{Target: "maxresults", Name: validation.InclusiveMaximum, Rule: int64(25), Chain: nil}, {Target: "maxresults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("keyvault.BaseClient", "GetDeletedKeys", err.Error()) @@ -2212,7 +2212,7 @@ func (client BaseClient) GetDeletedSecrets(ctx context.Context, vaultBaseURL str if err := validation.Validate([]validation.Validation{ {TargetValue: maxresults, Constraints: []validation.Constraint{{Target: "maxresults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "maxresults", Name: validation.InclusiveMaximum, Rule: 25, Chain: nil}, + Chain: []validation.Constraint{{Target: "maxresults", Name: validation.InclusiveMaximum, Rule: int64(25), Chain: nil}, {Target: "maxresults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("keyvault.BaseClient", "GetDeletedSecrets", err.Error()) @@ -2393,7 +2393,7 @@ func (client BaseClient) GetKeys(ctx context.Context, vaultBaseURL string, maxre if err := validation.Validate([]validation.Validation{ {TargetValue: maxresults, Constraints: []validation.Constraint{{Target: "maxresults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "maxresults", Name: validation.InclusiveMaximum, Rule: 25, Chain: nil}, + Chain: []validation.Constraint{{Target: "maxresults", Name: validation.InclusiveMaximum, Rule: int64(25), Chain: nil}, {Target: "maxresults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("keyvault.BaseClient", "GetKeys", err.Error()) @@ -2501,7 +2501,7 @@ func (client BaseClient) GetKeyVersions(ctx context.Context, vaultBaseURL string if err := validation.Validate([]validation.Validation{ {TargetValue: maxresults, Constraints: []validation.Constraint{{Target: "maxresults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "maxresults", Name: validation.InclusiveMaximum, Rule: 25, Chain: nil}, + Chain: []validation.Constraint{{Target: "maxresults", Name: validation.InclusiveMaximum, Rule: int64(25), Chain: nil}, {Target: "maxresults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("keyvault.BaseClient", "GetKeyVersions", err.Error()) @@ -2695,7 +2695,7 @@ func (client BaseClient) GetSasDefinitions(ctx context.Context, vaultBaseURL str Constraints: []validation.Constraint{{Target: "storageAccountName", Name: validation.Pattern, Rule: `^[0-9a-zA-Z]+$`, Chain: nil}}}, {TargetValue: maxresults, Constraints: []validation.Constraint{{Target: "maxresults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "maxresults", Name: validation.InclusiveMaximum, Rule: 25, Chain: nil}, + Chain: []validation.Constraint{{Target: "maxresults", Name: validation.InclusiveMaximum, Rule: int64(25), Chain: nil}, {Target: "maxresults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("keyvault.BaseClient", "GetSasDefinitions", err.Error()) @@ -2879,7 +2879,7 @@ func (client BaseClient) GetSecrets(ctx context.Context, vaultBaseURL string, ma if err := validation.Validate([]validation.Validation{ {TargetValue: maxresults, Constraints: []validation.Constraint{{Target: "maxresults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "maxresults", Name: validation.InclusiveMaximum, Rule: 25, Chain: nil}, + Chain: []validation.Constraint{{Target: "maxresults", Name: validation.InclusiveMaximum, Rule: int64(25), Chain: nil}, {Target: "maxresults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("keyvault.BaseClient", "GetSecrets", err.Error()) @@ -2987,7 +2987,7 @@ func (client BaseClient) GetSecretVersions(ctx context.Context, vaultBaseURL str if err := validation.Validate([]validation.Validation{ {TargetValue: maxresults, Constraints: []validation.Constraint{{Target: "maxresults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "maxresults", Name: validation.InclusiveMaximum, Rule: 25, Chain: nil}, + Chain: []validation.Constraint{{Target: "maxresults", Name: validation.InclusiveMaximum, Rule: int64(25), Chain: nil}, {Target: "maxresults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("keyvault.BaseClient", "GetSecretVersions", err.Error()) @@ -3174,7 +3174,7 @@ func (client BaseClient) GetStorageAccounts(ctx context.Context, vaultBaseURL st if err := validation.Validate([]validation.Validation{ {TargetValue: maxresults, Constraints: []validation.Constraint{{Target: "maxresults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "maxresults", Name: validation.InclusiveMaximum, Rule: 25, Chain: nil}, + Chain: []validation.Constraint{{Target: "maxresults", Name: validation.InclusiveMaximum, Rule: int64(25), Chain: nil}, {Target: "maxresults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("keyvault.BaseClient", "GetStorageAccounts", err.Error()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/keyvault/2016-10-01/keyvault/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/keyvault/2016-10-01/keyvault/models.go index 399f50567..95fea5137 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/keyvault/2016-10-01/keyvault/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/keyvault/2016-10-01/keyvault/models.go @@ -240,14 +240,14 @@ type Attributes struct { // BackupKeyResult the backup key result, containing the backup blob. type BackupKeyResult struct { autorest.Response `json:"-"` - // Value - The backup blob containing the backed up key. + // Value - The backup blob containing the backed up key. (a URL-encoded base64 string) Value *string `json:"value,omitempty"` } // BackupSecretResult the backup secret result, containing the backup blob. type BackupSecretResult struct { autorest.Response `json:"-"` - // Value - The backup blob containing the backed up secret. + // Value - The backup blob containing the backed up secret. (a URL-encoded base64 string) Value *string `json:"value,omitempty"` } @@ -276,7 +276,7 @@ type CertificateBundle struct { Kid *string `json:"kid,omitempty"` // Sid - The secret id. Sid *string `json:"sid,omitempty"` - // X509Thumbprint - Thumbprint of the certificate. + // X509Thumbprint - Thumbprint of the certificate. (a URL-encoded base64 string) X509Thumbprint *string `json:"x5t,omitempty"` // Policy - The management policy. Policy *CertificatePolicy `json:"policy,omitempty"` @@ -525,7 +525,7 @@ type CertificateItem struct { Attributes *CertificateAttributes `json:"attributes,omitempty"` // Tags - Application specific metadata in the form of key-value pairs. Tags map[string]*string `json:"tags"` - // X509Thumbprint - Thumbprint of the certificate. + // X509Thumbprint - Thumbprint of the certificate. (a URL-encoded base64 string) X509Thumbprint *string `json:"x5t,omitempty"` } @@ -782,7 +782,7 @@ type DeletedCertificateBundle struct { Kid *string `json:"kid,omitempty"` // Sid - The secret id. Sid *string `json:"sid,omitempty"` - // X509Thumbprint - Thumbprint of the certificate. + // X509Thumbprint - Thumbprint of the certificate. (a URL-encoded base64 string) X509Thumbprint *string `json:"x5t,omitempty"` // Policy - The management policy. Policy *CertificatePolicy `json:"policy,omitempty"` @@ -852,7 +852,7 @@ type DeletedCertificateItem struct { Attributes *CertificateAttributes `json:"attributes,omitempty"` // Tags - Application specific metadata in the form of key-value pairs. Tags map[string]*string `json:"tags"` - // X509Thumbprint - Thumbprint of the certificate. + // X509Thumbprint - Thumbprint of the certificate. (a URL-encoded base64 string) X509Thumbprint *string `json:"x5t,omitempty"` } @@ -1454,31 +1454,31 @@ type JSONWebKey struct { // Kty - JsonWebKey key type (kty). Possible values include: 'EC', 'ECHSM', 'RSA', 'RSAHSM', 'Oct' Kty JSONWebKeyType `json:"kty,omitempty"` KeyOps *[]string `json:"key_ops,omitempty"` - // N - RSA modulus. + // N - RSA modulus. (a URL-encoded base64 string) N *string `json:"n,omitempty"` - // E - RSA public exponent. + // E - RSA public exponent. (a URL-encoded base64 string) E *string `json:"e,omitempty"` - // D - RSA private exponent, or the D component of an EC private key. + // D - RSA private exponent, or the D component of an EC private key. (a URL-encoded base64 string) D *string `json:"d,omitempty"` - // DP - RSA private key parameter. + // DP - RSA private key parameter. (a URL-encoded base64 string) DP *string `json:"dp,omitempty"` - // DQ - RSA private key parameter. + // DQ - RSA private key parameter. (a URL-encoded base64 string) DQ *string `json:"dq,omitempty"` - // QI - RSA private key parameter. + // QI - RSA private key parameter. (a URL-encoded base64 string) QI *string `json:"qi,omitempty"` - // P - RSA secret prime. + // P - RSA secret prime. (a URL-encoded base64 string) P *string `json:"p,omitempty"` - // Q - RSA secret prime, with p < q. + // Q - RSA secret prime, with p < q. (a URL-encoded base64 string) Q *string `json:"q,omitempty"` - // K - Symmetric key. + // K - Symmetric key. (a URL-encoded base64 string) K *string `json:"k,omitempty"` - // T - HSM Token, used with 'Bring Your Own Key'. + // T - HSM Token, used with 'Bring Your Own Key'. (a URL-encoded base64 string) T *string `json:"key_hsm,omitempty"` // Crv - Elliptic curve name. For valid values, see JsonWebKeyCurveName. Possible values include: 'P256', 'P384', 'P521', 'SECP256K1' Crv JSONWebKeyCurveName `json:"crv,omitempty"` - // X - X component of an EC public key. + // X - X component of an EC public key. (a URL-encoded base64 string) X *string `json:"x,omitempty"` - // Y - Y component of an EC public key. + // Y - Y component of an EC public key. (a URL-encoded base64 string) Y *string `json:"y,omitempty"` } @@ -1733,7 +1733,8 @@ func (page KeyListResultPage) Values() []KeyItem { type KeyOperationResult struct { autorest.Response `json:"-"` // Kid - Key identifier - Kid *string `json:"kid,omitempty"` + Kid *string `json:"kid,omitempty"` + // Result - a URL-encoded base64 string Result *string `json:"value,omitempty"` } @@ -1741,7 +1742,8 @@ type KeyOperationResult struct { type KeyOperationsParameters struct { // Algorithm - algorithm identifier. Possible values include: 'RSAOAEP', 'RSAOAEP256', 'RSA15' Algorithm JSONWebKeyEncryptionAlgorithm `json:"alg,omitempty"` - Value *string `json:"value,omitempty"` + // Value - a URL-encoded base64 string + Value *string `json:"value,omitempty"` } // KeyProperties properties of the key pair backing a certificate. @@ -1758,7 +1760,7 @@ type KeyProperties struct { // KeyRestoreParameters the key restore parameters. type KeyRestoreParameters struct { - // KeyBundleBackup - The backup blob associated with a key bundle. + // KeyBundleBackup - The backup blob associated with a key bundle. (a URL-encoded base64 string) KeyBundleBackup *string `json:"value,omitempty"` } @@ -1766,7 +1768,8 @@ type KeyRestoreParameters struct { type KeySignParameters struct { // Algorithm - The signing/verification algorithm identifier. For more information on possible algorithm types, see JsonWebKeySignatureAlgorithm. Possible values include: 'PS256', 'PS384', 'PS512', 'RS256', 'RS384', 'RS512', 'RSNULL', 'ES256', 'ES384', 'ES512', 'ECDSA256' Algorithm JSONWebKeySignatureAlgorithm `json:"alg,omitempty"` - Value *string `json:"value,omitempty"` + // Value - a URL-encoded base64 string + Value *string `json:"value,omitempty"` } // KeyUpdateParameters the key update parameters. @@ -1797,9 +1800,9 @@ func (kup KeyUpdateParameters) MarshalJSON() ([]byte, error) { type KeyVerifyParameters struct { // Algorithm - The signing/verification algorithm. For more information on possible algorithm types, see JsonWebKeySignatureAlgorithm. Possible values include: 'PS256', 'PS384', 'PS512', 'RS256', 'RS384', 'RS512', 'RSNULL', 'ES256', 'ES384', 'ES512', 'ECDSA256' Algorithm JSONWebKeySignatureAlgorithm `json:"alg,omitempty"` - // Digest - The digest used for signing. + // Digest - The digest used for signing. (a URL-encoded base64 string) Digest *string `json:"digest,omitempty"` - // Signature - The signature to be verified. + // Signature - The signature to be verified. (a URL-encoded base64 string) Signature *string `json:"value,omitempty"` } @@ -2267,7 +2270,7 @@ type SecretProperties struct { // SecretRestoreParameters the secret restore parameters. type SecretRestoreParameters struct { - // SecretBundleBackup - The backup blob associated with a secret bundle. + // SecretBundleBackup - The backup blob associated with a secret bundle. (a URL-encoded base64 string) SecretBundleBackup *string `json:"value,omitempty"` } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/keyvault/mgmt/2018-02-14/keyvault/client.go b/vendor/github.com/Azure/azure-sdk-for-go/services/keyvault/mgmt/2018-02-14/keyvault/client.go new file mode 100644 index 000000000..4491a9406 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/keyvault/mgmt/2018-02-14/keyvault/client.go @@ -0,0 +1,51 @@ +// Package keyvault implements the Azure ARM Keyvault service API version 2018-02-14. +// +// The Azure management API provides a RESTful set of web services that interact with Azure Key Vault. +package keyvault + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/Azure/go-autorest/autorest" +) + +const ( + // DefaultBaseURI is the default URI used for the service Keyvault + DefaultBaseURI = "https://management.azure.com" +) + +// BaseClient is the base client for Keyvault. +type BaseClient struct { + autorest.Client + BaseURI string + SubscriptionID string +} + +// New creates an instance of the BaseClient client. +func New(subscriptionID string) BaseClient { + return NewWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewWithBaseURI creates an instance of the BaseClient client. +func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { + return BaseClient{ + Client: autorest.NewClientWithUserAgent(UserAgent()), + BaseURI: baseURI, + SubscriptionID: subscriptionID, + } +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/keyvault/mgmt/2018-02-14/keyvault/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/keyvault/mgmt/2018-02-14/keyvault/models.go new file mode 100644 index 000000000..1c4cbca7a --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/keyvault/mgmt/2018-02-14/keyvault/models.go @@ -0,0 +1,1162 @@ +package keyvault + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "encoding/json" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/date" + "github.com/Azure/go-autorest/autorest/to" + "github.com/satori/go.uuid" + "net/http" +) + +// AccessPolicyUpdateKind enumerates the values for access policy update kind. +type AccessPolicyUpdateKind string + +const ( + // Add ... + Add AccessPolicyUpdateKind = "add" + // Remove ... + Remove AccessPolicyUpdateKind = "remove" + // Replace ... + Replace AccessPolicyUpdateKind = "replace" +) + +// PossibleAccessPolicyUpdateKindValues returns an array of possible values for the AccessPolicyUpdateKind const type. +func PossibleAccessPolicyUpdateKindValues() []AccessPolicyUpdateKind { + return []AccessPolicyUpdateKind{Add, Remove, Replace} +} + +// CertificatePermissions enumerates the values for certificate permissions. +type CertificatePermissions string + +const ( + // Backup ... + Backup CertificatePermissions = "backup" + // Create ... + Create CertificatePermissions = "create" + // Delete ... + Delete CertificatePermissions = "delete" + // Deleteissuers ... + Deleteissuers CertificatePermissions = "deleteissuers" + // Get ... + Get CertificatePermissions = "get" + // Getissuers ... + Getissuers CertificatePermissions = "getissuers" + // Import ... + Import CertificatePermissions = "import" + // List ... + List CertificatePermissions = "list" + // Listissuers ... + Listissuers CertificatePermissions = "listissuers" + // Managecontacts ... + Managecontacts CertificatePermissions = "managecontacts" + // Manageissuers ... + Manageissuers CertificatePermissions = "manageissuers" + // Purge ... + Purge CertificatePermissions = "purge" + // Recover ... + Recover CertificatePermissions = "recover" + // Restore ... + Restore CertificatePermissions = "restore" + // Setissuers ... + Setissuers CertificatePermissions = "setissuers" + // Update ... + Update CertificatePermissions = "update" +) + +// PossibleCertificatePermissionsValues returns an array of possible values for the CertificatePermissions const type. +func PossibleCertificatePermissionsValues() []CertificatePermissions { + return []CertificatePermissions{Backup, Create, Delete, Deleteissuers, Get, Getissuers, Import, List, Listissuers, Managecontacts, Manageissuers, Purge, Recover, Restore, Setissuers, Update} +} + +// CreateMode enumerates the values for create mode. +type CreateMode string + +const ( + // CreateModeDefault ... + CreateModeDefault CreateMode = "default" + // CreateModeRecover ... + CreateModeRecover CreateMode = "recover" +) + +// PossibleCreateModeValues returns an array of possible values for the CreateMode const type. +func PossibleCreateModeValues() []CreateMode { + return []CreateMode{CreateModeDefault, CreateModeRecover} +} + +// KeyPermissions enumerates the values for key permissions. +type KeyPermissions string + +const ( + // KeyPermissionsBackup ... + KeyPermissionsBackup KeyPermissions = "backup" + // KeyPermissionsCreate ... + KeyPermissionsCreate KeyPermissions = "create" + // KeyPermissionsDecrypt ... + KeyPermissionsDecrypt KeyPermissions = "decrypt" + // KeyPermissionsDelete ... + KeyPermissionsDelete KeyPermissions = "delete" + // KeyPermissionsEncrypt ... + KeyPermissionsEncrypt KeyPermissions = "encrypt" + // KeyPermissionsGet ... + KeyPermissionsGet KeyPermissions = "get" + // KeyPermissionsImport ... + KeyPermissionsImport KeyPermissions = "import" + // KeyPermissionsList ... + KeyPermissionsList KeyPermissions = "list" + // KeyPermissionsPurge ... + KeyPermissionsPurge KeyPermissions = "purge" + // KeyPermissionsRecover ... + KeyPermissionsRecover KeyPermissions = "recover" + // KeyPermissionsRestore ... + KeyPermissionsRestore KeyPermissions = "restore" + // KeyPermissionsSign ... + KeyPermissionsSign KeyPermissions = "sign" + // KeyPermissionsUnwrapKey ... + KeyPermissionsUnwrapKey KeyPermissions = "unwrapKey" + // KeyPermissionsUpdate ... + KeyPermissionsUpdate KeyPermissions = "update" + // KeyPermissionsVerify ... + KeyPermissionsVerify KeyPermissions = "verify" + // KeyPermissionsWrapKey ... + KeyPermissionsWrapKey KeyPermissions = "wrapKey" +) + +// PossibleKeyPermissionsValues returns an array of possible values for the KeyPermissions const type. +func PossibleKeyPermissionsValues() []KeyPermissions { + return []KeyPermissions{KeyPermissionsBackup, KeyPermissionsCreate, KeyPermissionsDecrypt, KeyPermissionsDelete, KeyPermissionsEncrypt, KeyPermissionsGet, KeyPermissionsImport, KeyPermissionsList, KeyPermissionsPurge, KeyPermissionsRecover, KeyPermissionsRestore, KeyPermissionsSign, KeyPermissionsUnwrapKey, KeyPermissionsUpdate, KeyPermissionsVerify, KeyPermissionsWrapKey} +} + +// NetworkRuleAction enumerates the values for network rule action. +type NetworkRuleAction string + +const ( + // Allow ... + Allow NetworkRuleAction = "Allow" + // Deny ... + Deny NetworkRuleAction = "Deny" +) + +// PossibleNetworkRuleActionValues returns an array of possible values for the NetworkRuleAction const type. +func PossibleNetworkRuleActionValues() []NetworkRuleAction { + return []NetworkRuleAction{Allow, Deny} +} + +// NetworkRuleBypassOptions enumerates the values for network rule bypass options. +type NetworkRuleBypassOptions string + +const ( + // AzureServices ... + AzureServices NetworkRuleBypassOptions = "AzureServices" + // None ... + None NetworkRuleBypassOptions = "None" +) + +// PossibleNetworkRuleBypassOptionsValues returns an array of possible values for the NetworkRuleBypassOptions const type. +func PossibleNetworkRuleBypassOptionsValues() []NetworkRuleBypassOptions { + return []NetworkRuleBypassOptions{AzureServices, None} +} + +// Reason enumerates the values for reason. +type Reason string + +const ( + // AccountNameInvalid ... + AccountNameInvalid Reason = "AccountNameInvalid" + // AlreadyExists ... + AlreadyExists Reason = "AlreadyExists" +) + +// PossibleReasonValues returns an array of possible values for the Reason const type. +func PossibleReasonValues() []Reason { + return []Reason{AccountNameInvalid, AlreadyExists} +} + +// SecretPermissions enumerates the values for secret permissions. +type SecretPermissions string + +const ( + // SecretPermissionsBackup ... + SecretPermissionsBackup SecretPermissions = "backup" + // SecretPermissionsDelete ... + SecretPermissionsDelete SecretPermissions = "delete" + // SecretPermissionsGet ... + SecretPermissionsGet SecretPermissions = "get" + // SecretPermissionsList ... + SecretPermissionsList SecretPermissions = "list" + // SecretPermissionsPurge ... + SecretPermissionsPurge SecretPermissions = "purge" + // SecretPermissionsRecover ... + SecretPermissionsRecover SecretPermissions = "recover" + // SecretPermissionsRestore ... + SecretPermissionsRestore SecretPermissions = "restore" + // SecretPermissionsSet ... + SecretPermissionsSet SecretPermissions = "set" +) + +// PossibleSecretPermissionsValues returns an array of possible values for the SecretPermissions const type. +func PossibleSecretPermissionsValues() []SecretPermissions { + return []SecretPermissions{SecretPermissionsBackup, SecretPermissionsDelete, SecretPermissionsGet, SecretPermissionsList, SecretPermissionsPurge, SecretPermissionsRecover, SecretPermissionsRestore, SecretPermissionsSet} +} + +// SkuName enumerates the values for sku name. +type SkuName string + +const ( + // Premium ... + Premium SkuName = "premium" + // Standard ... + Standard SkuName = "standard" +) + +// PossibleSkuNameValues returns an array of possible values for the SkuName const type. +func PossibleSkuNameValues() []SkuName { + return []SkuName{Premium, Standard} +} + +// StoragePermissions enumerates the values for storage permissions. +type StoragePermissions string + +const ( + // StoragePermissionsBackup ... + StoragePermissionsBackup StoragePermissions = "backup" + // StoragePermissionsDelete ... + StoragePermissionsDelete StoragePermissions = "delete" + // StoragePermissionsDeletesas ... + StoragePermissionsDeletesas StoragePermissions = "deletesas" + // StoragePermissionsGet ... + StoragePermissionsGet StoragePermissions = "get" + // StoragePermissionsGetsas ... + StoragePermissionsGetsas StoragePermissions = "getsas" + // StoragePermissionsList ... + StoragePermissionsList StoragePermissions = "list" + // StoragePermissionsListsas ... + StoragePermissionsListsas StoragePermissions = "listsas" + // StoragePermissionsPurge ... + StoragePermissionsPurge StoragePermissions = "purge" + // StoragePermissionsRecover ... + StoragePermissionsRecover StoragePermissions = "recover" + // StoragePermissionsRegeneratekey ... + StoragePermissionsRegeneratekey StoragePermissions = "regeneratekey" + // StoragePermissionsRestore ... + StoragePermissionsRestore StoragePermissions = "restore" + // StoragePermissionsSet ... + StoragePermissionsSet StoragePermissions = "set" + // StoragePermissionsSetsas ... + StoragePermissionsSetsas StoragePermissions = "setsas" + // StoragePermissionsUpdate ... + StoragePermissionsUpdate StoragePermissions = "update" +) + +// PossibleStoragePermissionsValues returns an array of possible values for the StoragePermissions const type. +func PossibleStoragePermissionsValues() []StoragePermissions { + return []StoragePermissions{StoragePermissionsBackup, StoragePermissionsDelete, StoragePermissionsDeletesas, StoragePermissionsGet, StoragePermissionsGetsas, StoragePermissionsList, StoragePermissionsListsas, StoragePermissionsPurge, StoragePermissionsRecover, StoragePermissionsRegeneratekey, StoragePermissionsRestore, StoragePermissionsSet, StoragePermissionsSetsas, StoragePermissionsUpdate} +} + +// AccessPolicyEntry an identity that have access to the key vault. All identities in the array must use the same +// tenant ID as the key vault's tenant ID. +type AccessPolicyEntry struct { + // TenantID - The Azure Active Directory tenant ID that should be used for authenticating requests to the key vault. + TenantID *uuid.UUID `json:"tenantId,omitempty"` + // ObjectID - The object ID of a user, service principal or security group in the Azure Active Directory tenant for the vault. The object ID must be unique for the list of access policies. + ObjectID *string `json:"objectId,omitempty"` + // ApplicationID - Application ID of the client making request on behalf of a principal + ApplicationID *uuid.UUID `json:"applicationId,omitempty"` + // Permissions - Permissions the identity has for keys, secrets and certificates. + Permissions *Permissions `json:"permissions,omitempty"` +} + +// CheckNameAvailabilityResult the CheckNameAvailability operation response. +type CheckNameAvailabilityResult struct { + autorest.Response `json:"-"` + // NameAvailable - A boolean value that indicates whether the name is available for you to use. If true, the name is available. If false, the name has already been taken or is invalid and cannot be used. + NameAvailable *bool `json:"nameAvailable,omitempty"` + // Reason - The reason that a vault name could not be used. The Reason element is only returned if NameAvailable is false. Possible values include: 'AccountNameInvalid', 'AlreadyExists' + Reason Reason `json:"reason,omitempty"` + // Message - An error message explaining the Reason value in more detail. + Message *string `json:"message,omitempty"` +} + +// DeletedVault deleted vault information with extended details. +type DeletedVault struct { + autorest.Response `json:"-"` + // ID - The resource ID for the deleted key vault. + ID *string `json:"id,omitempty"` + // Name - The name of the key vault. + Name *string `json:"name,omitempty"` + // Type - The resource type of the key vault. + Type *string `json:"type,omitempty"` + // Properties - Properties of the vault + Properties *DeletedVaultProperties `json:"properties,omitempty"` +} + +// DeletedVaultListResult list of vaults +type DeletedVaultListResult struct { + autorest.Response `json:"-"` + // Value - The list of deleted vaults. + Value *[]DeletedVault `json:"value,omitempty"` + // NextLink - The URL to get the next set of deleted vaults. + NextLink *string `json:"nextLink,omitempty"` +} + +// DeletedVaultListResultIterator provides access to a complete listing of DeletedVault values. +type DeletedVaultListResultIterator struct { + i int + page DeletedVaultListResultPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *DeletedVaultListResultIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter DeletedVaultListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter DeletedVaultListResultIterator) Response() DeletedVaultListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter DeletedVaultListResultIterator) Value() DeletedVault { + if !iter.page.NotDone() { + return DeletedVault{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (dvlr DeletedVaultListResult) IsEmpty() bool { + return dvlr.Value == nil || len(*dvlr.Value) == 0 +} + +// deletedVaultListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (dvlr DeletedVaultListResult) deletedVaultListResultPreparer() (*http.Request, error) { + if dvlr.NextLink == nil || len(to.String(dvlr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(dvlr.NextLink))) +} + +// DeletedVaultListResultPage contains a page of DeletedVault values. +type DeletedVaultListResultPage struct { + fn func(DeletedVaultListResult) (DeletedVaultListResult, error) + dvlr DeletedVaultListResult +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *DeletedVaultListResultPage) Next() error { + next, err := page.fn(page.dvlr) + if err != nil { + return err + } + page.dvlr = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page DeletedVaultListResultPage) NotDone() bool { + return !page.dvlr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page DeletedVaultListResultPage) Response() DeletedVaultListResult { + return page.dvlr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page DeletedVaultListResultPage) Values() []DeletedVault { + if page.dvlr.IsEmpty() { + return nil + } + return *page.dvlr.Value +} + +// DeletedVaultProperties properties of the deleted vault. +type DeletedVaultProperties struct { + // VaultID - The resource id of the original vault. + VaultID *string `json:"vaultId,omitempty"` + // Location - The location of the original vault. + Location *string `json:"location,omitempty"` + // DeletionDate - The deleted date. + DeletionDate *date.Time `json:"deletionDate,omitempty"` + // ScheduledPurgeDate - The scheduled purged date. + ScheduledPurgeDate *date.Time `json:"scheduledPurgeDate,omitempty"` + // Tags - Tags of the original vault. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for DeletedVaultProperties. +func (dvp DeletedVaultProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dvp.VaultID != nil { + objectMap["vaultId"] = dvp.VaultID + } + if dvp.Location != nil { + objectMap["location"] = dvp.Location + } + if dvp.DeletionDate != nil { + objectMap["deletionDate"] = dvp.DeletionDate + } + if dvp.ScheduledPurgeDate != nil { + objectMap["scheduledPurgeDate"] = dvp.ScheduledPurgeDate + } + if dvp.Tags != nil { + objectMap["tags"] = dvp.Tags + } + return json.Marshal(objectMap) +} + +// IPRule a rule governing the accesibility of a vault from a specific ip address or ip range. +type IPRule struct { + // Value - An IPv4 address range in CIDR notation, such as '124.56.78.91' (simple IP address) or '124.56.78.0/24' (all addresses that start with 124.56.78). + Value *string `json:"value,omitempty"` +} + +// LogSpecification log specification of operation. +type LogSpecification struct { + // Name - Name of log specification. + Name *string `json:"name,omitempty"` + // DisplayName - Display name of log specification. + DisplayName *string `json:"displayName,omitempty"` + // BlobDuration - Blob duration of specification. + BlobDuration *string `json:"blobDuration,omitempty"` +} + +// NetworkRuleSet a set of rules governing the network accessibility of a vault. +type NetworkRuleSet struct { + // Bypass - Tells what traffic can bypass network rules. This can be 'AzureServices' or 'None'. If not specified the default is 'AzureServices'. Possible values include: 'AzureServices', 'None' + Bypass NetworkRuleBypassOptions `json:"bypass,omitempty"` + // DefaultAction - The default action when no rule from ipRules and from virtualNetworkRules match. This is only used after the bypass property has been evaluated. Possible values include: 'Allow', 'Deny' + DefaultAction NetworkRuleAction `json:"defaultAction,omitempty"` + // IPRules - The list of IP address rules. + IPRules *[]IPRule `json:"ipRules,omitempty"` + // VirtualNetworkRules - The list of virtual network rules. + VirtualNetworkRules *[]VirtualNetworkRule `json:"virtualNetworkRules,omitempty"` +} + +// Operation key Vault REST API operation definition. +type Operation struct { + // Name - Operation name: {provider}/{resource}/{operation} + Name *string `json:"name,omitempty"` + // Display - Display metadata associated with the operation. + Display *OperationDisplay `json:"display,omitempty"` + // Origin - The origin of operations. + Origin *string `json:"origin,omitempty"` + // OperationProperties - Properties of operation, include metric specifications. + *OperationProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for Operation. +func (o Operation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if o.Name != nil { + objectMap["name"] = o.Name + } + if o.Display != nil { + objectMap["display"] = o.Display + } + if o.Origin != nil { + objectMap["origin"] = o.Origin + } + if o.OperationProperties != nil { + objectMap["properties"] = o.OperationProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Operation struct. +func (o *Operation) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + o.Name = &name + } + case "display": + if v != nil { + var display OperationDisplay + err = json.Unmarshal(*v, &display) + if err != nil { + return err + } + o.Display = &display + } + case "origin": + if v != nil { + var origin string + err = json.Unmarshal(*v, &origin) + if err != nil { + return err + } + o.Origin = &origin + } + case "properties": + if v != nil { + var operationProperties OperationProperties + err = json.Unmarshal(*v, &operationProperties) + if err != nil { + return err + } + o.OperationProperties = &operationProperties + } + } + } + + return nil +} + +// OperationDisplay display metadata associated with the operation. +type OperationDisplay struct { + // Provider - Service provider: Microsoft Key Vault. + Provider *string `json:"provider,omitempty"` + // Resource - Resource on which the operation is performed etc. + Resource *string `json:"resource,omitempty"` + // Operation - Type of operation: get, read, delete, etc. + Operation *string `json:"operation,omitempty"` + // Description - Decription of operation. + Description *string `json:"description,omitempty"` +} + +// OperationListResult result of the request to list Storage operations. It contains a list of operations and a URL +// link to get the next set of results. +type OperationListResult struct { + autorest.Response `json:"-"` + // Value - List of Storage operations supported by the Storage resource provider. + Value *[]Operation `json:"value,omitempty"` + // NextLink - The URL to get the next set of operations. + NextLink *string `json:"nextLink,omitempty"` +} + +// OperationListResultIterator provides access to a complete listing of Operation values. +type OperationListResultIterator struct { + i int + page OperationListResultPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *OperationListResultIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter OperationListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter OperationListResultIterator) Response() OperationListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter OperationListResultIterator) Value() Operation { + if !iter.page.NotDone() { + return Operation{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (olr OperationListResult) IsEmpty() bool { + return olr.Value == nil || len(*olr.Value) == 0 +} + +// operationListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (olr OperationListResult) operationListResultPreparer() (*http.Request, error) { + if olr.NextLink == nil || len(to.String(olr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(olr.NextLink))) +} + +// OperationListResultPage contains a page of Operation values. +type OperationListResultPage struct { + fn func(OperationListResult) (OperationListResult, error) + olr OperationListResult +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *OperationListResultPage) Next() error { + next, err := page.fn(page.olr) + if err != nil { + return err + } + page.olr = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page OperationListResultPage) NotDone() bool { + return !page.olr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page OperationListResultPage) Response() OperationListResult { + return page.olr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page OperationListResultPage) Values() []Operation { + if page.olr.IsEmpty() { + return nil + } + return *page.olr.Value +} + +// OperationProperties properties of operation, include metric specifications. +type OperationProperties struct { + // ServiceSpecification - One property of operation, include metric specifications. + ServiceSpecification *ServiceSpecification `json:"serviceSpecification,omitempty"` +} + +// Permissions permissions the identity has for keys, secrets, certificates and storage. +type Permissions struct { + // Keys - Permissions to keys + Keys *[]KeyPermissions `json:"keys,omitempty"` + // Secrets - Permissions to secrets + Secrets *[]SecretPermissions `json:"secrets,omitempty"` + // Certificates - Permissions to certificates + Certificates *[]CertificatePermissions `json:"certificates,omitempty"` + // Storage - Permissions to storage accounts + Storage *[]StoragePermissions `json:"storage,omitempty"` +} + +// Resource key Vault resource +type Resource struct { + // ID - The Azure Resource Manager resource ID for the key vault. + ID *string `json:"id,omitempty"` + // Name - The name of the key vault. + Name *string `json:"name,omitempty"` + // Type - The resource type of the key vault. + Type *string `json:"type,omitempty"` + // Location - The supported Azure location where the key vault should be created. + Location *string `json:"location,omitempty"` + // Tags - The tags that will be assigned to the key vault. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for Resource. +func (r Resource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if r.ID != nil { + objectMap["id"] = r.ID + } + if r.Name != nil { + objectMap["name"] = r.Name + } + if r.Type != nil { + objectMap["type"] = r.Type + } + if r.Location != nil { + objectMap["location"] = r.Location + } + if r.Tags != nil { + objectMap["tags"] = r.Tags + } + return json.Marshal(objectMap) +} + +// ResourceListResult list of vault resources. +type ResourceListResult struct { + autorest.Response `json:"-"` + // Value - The list of vault resources. + Value *[]Resource `json:"value,omitempty"` + // NextLink - The URL to get the next set of vault resources. + NextLink *string `json:"nextLink,omitempty"` +} + +// ResourceListResultIterator provides access to a complete listing of Resource values. +type ResourceListResultIterator struct { + i int + page ResourceListResultPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ResourceListResultIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ResourceListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ResourceListResultIterator) Response() ResourceListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ResourceListResultIterator) Value() Resource { + if !iter.page.NotDone() { + return Resource{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (rlr ResourceListResult) IsEmpty() bool { + return rlr.Value == nil || len(*rlr.Value) == 0 +} + +// resourceListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (rlr ResourceListResult) resourceListResultPreparer() (*http.Request, error) { + if rlr.NextLink == nil || len(to.String(rlr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(rlr.NextLink))) +} + +// ResourceListResultPage contains a page of Resource values. +type ResourceListResultPage struct { + fn func(ResourceListResult) (ResourceListResult, error) + rlr ResourceListResult +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ResourceListResultPage) Next() error { + next, err := page.fn(page.rlr) + if err != nil { + return err + } + page.rlr = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ResourceListResultPage) NotDone() bool { + return !page.rlr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ResourceListResultPage) Response() ResourceListResult { + return page.rlr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ResourceListResultPage) Values() []Resource { + if page.rlr.IsEmpty() { + return nil + } + return *page.rlr.Value +} + +// ServiceSpecification one property of operation, include log specifications. +type ServiceSpecification struct { + // LogSpecifications - Log specifications of operation. + LogSpecifications *[]LogSpecification `json:"logSpecifications,omitempty"` +} + +// Sku SKU details +type Sku struct { + // Family - SKU family name + Family *string `json:"family,omitempty"` + // Name - SKU name to specify whether the key vault is a standard vault or a premium vault. Possible values include: 'Standard', 'Premium' + Name SkuName `json:"name,omitempty"` +} + +// Vault resource information with extended details. +type Vault struct { + autorest.Response `json:"-"` + // Properties - Properties of the vault + Properties *VaultProperties `json:"properties,omitempty"` + // ID - The Azure Resource Manager resource ID for the key vault. + ID *string `json:"id,omitempty"` + // Name - The name of the key vault. + Name *string `json:"name,omitempty"` + // Type - The resource type of the key vault. + Type *string `json:"type,omitempty"` + // Location - The supported Azure location where the key vault should be created. + Location *string `json:"location,omitempty"` + // Tags - The tags that will be assigned to the key vault. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for Vault. +func (vVar Vault) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vVar.Properties != nil { + objectMap["properties"] = vVar.Properties + } + if vVar.ID != nil { + objectMap["id"] = vVar.ID + } + if vVar.Name != nil { + objectMap["name"] = vVar.Name + } + if vVar.Type != nil { + objectMap["type"] = vVar.Type + } + if vVar.Location != nil { + objectMap["location"] = vVar.Location + } + if vVar.Tags != nil { + objectMap["tags"] = vVar.Tags + } + return json.Marshal(objectMap) +} + +// VaultAccessPolicyParameters parameters for updating the access policy in a vault +type VaultAccessPolicyParameters struct { + autorest.Response `json:"-"` + // ID - The resource id of the access policy. + ID *string `json:"id,omitempty"` + // Name - The resource name of the access policy. + Name *string `json:"name,omitempty"` + // Type - The resource name of the access policy. + Type *string `json:"type,omitempty"` + // Location - The resource type of the the access policy. + Location *string `json:"location,omitempty"` + // Properties - Properties of the access policy + Properties *VaultAccessPolicyProperties `json:"properties,omitempty"` +} + +// VaultAccessPolicyProperties properties of the vault access policy +type VaultAccessPolicyProperties struct { + // AccessPolicies - An array of 0 to 16 identities that have access to the key vault. All identities in the array must use the same tenant ID as the key vault's tenant ID. + AccessPolicies *[]AccessPolicyEntry `json:"accessPolicies,omitempty"` +} + +// VaultCheckNameAvailabilityParameters the parameters used to check the availabity of the vault name. +type VaultCheckNameAvailabilityParameters struct { + // Name - The vault name. + Name *string `json:"name,omitempty"` + // Type - The type of resource, Microsoft.KeyVault/vaults + Type *string `json:"type,omitempty"` +} + +// VaultCreateOrUpdateParameters parameters for creating or updating a vault +type VaultCreateOrUpdateParameters struct { + // Location - The supported Azure location where the key vault should be created. + Location *string `json:"location,omitempty"` + // Tags - The tags that will be assigned to the key vault. + Tags map[string]*string `json:"tags"` + // Properties - Properties of the vault + Properties *VaultProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for VaultCreateOrUpdateParameters. +func (vcoup VaultCreateOrUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vcoup.Location != nil { + objectMap["location"] = vcoup.Location + } + if vcoup.Tags != nil { + objectMap["tags"] = vcoup.Tags + } + if vcoup.Properties != nil { + objectMap["properties"] = vcoup.Properties + } + return json.Marshal(objectMap) +} + +// VaultListResult list of vaults +type VaultListResult struct { + autorest.Response `json:"-"` + // Value - The list of vaults. + Value *[]Vault `json:"value,omitempty"` + // NextLink - The URL to get the next set of vaults. + NextLink *string `json:"nextLink,omitempty"` +} + +// VaultListResultIterator provides access to a complete listing of Vault values. +type VaultListResultIterator struct { + i int + page VaultListResultPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *VaultListResultIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter VaultListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter VaultListResultIterator) Response() VaultListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter VaultListResultIterator) Value() Vault { + if !iter.page.NotDone() { + return Vault{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (vlr VaultListResult) IsEmpty() bool { + return vlr.Value == nil || len(*vlr.Value) == 0 +} + +// vaultListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (vlr VaultListResult) vaultListResultPreparer() (*http.Request, error) { + if vlr.NextLink == nil || len(to.String(vlr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(vlr.NextLink))) +} + +// VaultListResultPage contains a page of Vault values. +type VaultListResultPage struct { + fn func(VaultListResult) (VaultListResult, error) + vlr VaultListResult +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *VaultListResultPage) Next() error { + next, err := page.fn(page.vlr) + if err != nil { + return err + } + page.vlr = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page VaultListResultPage) NotDone() bool { + return !page.vlr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page VaultListResultPage) Response() VaultListResult { + return page.vlr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page VaultListResultPage) Values() []Vault { + if page.vlr.IsEmpty() { + return nil + } + return *page.vlr.Value +} + +// VaultPatchParameters parameters for creating or updating a vault +type VaultPatchParameters struct { + // Tags - The tags that will be assigned to the key vault. + Tags map[string]*string `json:"tags"` + // Properties - Properties of the vault + Properties *VaultPatchProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for VaultPatchParameters. +func (vpp VaultPatchParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vpp.Tags != nil { + objectMap["tags"] = vpp.Tags + } + if vpp.Properties != nil { + objectMap["properties"] = vpp.Properties + } + return json.Marshal(objectMap) +} + +// VaultPatchProperties properties of the vault +type VaultPatchProperties struct { + // TenantID - The Azure Active Directory tenant ID that should be used for authenticating requests to the key vault. + TenantID *uuid.UUID `json:"tenantId,omitempty"` + // Sku - SKU details + Sku *Sku `json:"sku,omitempty"` + // AccessPolicies - An array of 0 to 16 identities that have access to the key vault. All identities in the array must use the same tenant ID as the key vault's tenant ID. + AccessPolicies *[]AccessPolicyEntry `json:"accessPolicies,omitempty"` + // EnabledForDeployment - Property to specify whether Azure Virtual Machines are permitted to retrieve certificates stored as secrets from the key vault. + EnabledForDeployment *bool `json:"enabledForDeployment,omitempty"` + // EnabledForDiskEncryption - Property to specify whether Azure Disk Encryption is permitted to retrieve secrets from the vault and unwrap keys. + EnabledForDiskEncryption *bool `json:"enabledForDiskEncryption,omitempty"` + // EnabledForTemplateDeployment - Property to specify whether Azure Resource Manager is permitted to retrieve secrets from the key vault. + EnabledForTemplateDeployment *bool `json:"enabledForTemplateDeployment,omitempty"` + // EnableSoftDelete - Property to specify whether the 'soft delete' functionality is enabled for this key vault. It does not accept false value. + EnableSoftDelete *bool `json:"enableSoftDelete,omitempty"` + // CreateMode - The vault's create mode to indicate whether the vault need to be recovered or not. Possible values include: 'CreateModeRecover', 'CreateModeDefault' + CreateMode CreateMode `json:"createMode,omitempty"` + // EnablePurgeProtection - Property specifying whether protection against purge is enabled for this vault. Setting this property to true activates protection against purge for this vault and its content - only the Key Vault service may initiate a hard, irrecoverable deletion. The setting is effective only if soft delete is also enabled. Enabling this functionality is irreversible - that is, the property does not accept false as its value. + EnablePurgeProtection *bool `json:"enablePurgeProtection,omitempty"` + // NetworkAcls - A collection of rules governing the accessibility of the vault from specific network locations. + NetworkAcls *NetworkRuleSet `json:"networkAcls,omitempty"` +} + +// VaultProperties properties of the vault +type VaultProperties struct { + // TenantID - The Azure Active Directory tenant ID that should be used for authenticating requests to the key vault. + TenantID *uuid.UUID `json:"tenantId,omitempty"` + // Sku - SKU details + Sku *Sku `json:"sku,omitempty"` + // AccessPolicies - An array of 0 to 16 identities that have access to the key vault. All identities in the array must use the same tenant ID as the key vault's tenant ID. + AccessPolicies *[]AccessPolicyEntry `json:"accessPolicies,omitempty"` + // VaultURI - The URI of the vault for performing operations on keys and secrets. + VaultURI *string `json:"vaultUri,omitempty"` + // EnabledForDeployment - Property to specify whether Azure Virtual Machines are permitted to retrieve certificates stored as secrets from the key vault. + EnabledForDeployment *bool `json:"enabledForDeployment,omitempty"` + // EnabledForDiskEncryption - Property to specify whether Azure Disk Encryption is permitted to retrieve secrets from the vault and unwrap keys. + EnabledForDiskEncryption *bool `json:"enabledForDiskEncryption,omitempty"` + // EnabledForTemplateDeployment - Property to specify whether Azure Resource Manager is permitted to retrieve secrets from the key vault. + EnabledForTemplateDeployment *bool `json:"enabledForTemplateDeployment,omitempty"` + // EnableSoftDelete - Property to specify whether the 'soft delete' functionality is enabled for this key vault. It does not accept false value. + EnableSoftDelete *bool `json:"enableSoftDelete,omitempty"` + // CreateMode - The vault's create mode to indicate whether the vault need to be recovered or not. Possible values include: 'CreateModeRecover', 'CreateModeDefault' + CreateMode CreateMode `json:"createMode,omitempty"` + // EnablePurgeProtection - Property specifying whether protection against purge is enabled for this vault. Setting this property to true activates protection against purge for this vault and its content - only the Key Vault service may initiate a hard, irrecoverable deletion. The setting is effective only if soft delete is also enabled. Enabling this functionality is irreversible - that is, the property does not accept false as its value. + EnablePurgeProtection *bool `json:"enablePurgeProtection,omitempty"` + // NetworkAcls - A collection of rules governing the accessibility of the vault from specific network locations. + NetworkAcls *NetworkRuleSet `json:"networkAcls,omitempty"` +} + +// VaultsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation. +type VaultsCreateOrUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *VaultsCreateOrUpdateFuture) Result(client VaultsClient) (vVar Vault, err error) { + var done bool + done, err = future.Done(client) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.VaultsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("keyvault.VaultsCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if vVar.Response.Response, err = future.GetResult(sender); err == nil && vVar.Response.Response.StatusCode != http.StatusNoContent { + vVar, err = client.CreateOrUpdateResponder(vVar.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.VaultsCreateOrUpdateFuture", "Result", vVar.Response.Response, "Failure responding to request") + } + } + return +} + +// VaultsPurgeDeletedFuture an abstraction for monitoring and retrieving the results of a long-running operation. +type VaultsPurgeDeletedFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *VaultsPurgeDeletedFuture) Result(client VaultsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.Done(client) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.VaultsPurgeDeletedFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("keyvault.VaultsPurgeDeletedFuture") + return + } + ar.Response = future.Response() + return +} + +// VirtualNetworkRule a rule governing the accesibility of a vault from a specific virtual network. +type VirtualNetworkRule struct { + // ID - Full resource id of a vnet subnet, such as '/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/subnet1'. + ID *string `json:"id,omitempty"` +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/keyvault/mgmt/2018-02-14/keyvault/operations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/keyvault/mgmt/2018-02-14/keyvault/operations.go new file mode 100644 index 000000000..13d26390d --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/keyvault/mgmt/2018-02-14/keyvault/operations.go @@ -0,0 +1,127 @@ +package keyvault + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "net/http" +) + +// OperationsClient is the the Azure management API provides a RESTful set of web services that interact with Azure Key +// Vault. +type OperationsClient struct { + BaseClient +} + +// NewOperationsClient creates an instance of the OperationsClient client. +func NewOperationsClient(subscriptionID string) OperationsClient { + return NewOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewOperationsClientWithBaseURI creates an instance of the OperationsClient client. +func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient { + return OperationsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// List lists all of the available Key Vault Rest API operations. +func (client OperationsClient) List(ctx context.Context) (result OperationListResultPage, err error) { + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.OperationsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.olr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "keyvault.OperationsClient", "List", resp, "Failure sending request") + return + } + + result.olr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.OperationsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + const APIVersion = "2018-02-14" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/providers/Microsoft.KeyVault/operations"), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client OperationsClient) ListSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client OperationsClient) ListResponder(resp *http.Response) (result OperationListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client OperationsClient) listNextResults(lastResults OperationListResult) (result OperationListResult, err error) { + req, err := lastResults.operationListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "keyvault.OperationsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "keyvault.OperationsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.OperationsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client OperationsClient) ListComplete(ctx context.Context) (result OperationListResultIterator, err error) { + result.page, err = client.List(ctx) + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/keyvault/mgmt/2018-02-14/keyvault/vaults.go b/vendor/github.com/Azure/azure-sdk-for-go/services/keyvault/mgmt/2018-02-14/keyvault/vaults.go new file mode 100644 index 000000000..826a1b38b --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/keyvault/mgmt/2018-02-14/keyvault/vaults.go @@ -0,0 +1,1008 @@ +package keyvault + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// VaultsClient is the the Azure management API provides a RESTful set of web services that interact with Azure Key +// Vault. +type VaultsClient struct { + BaseClient +} + +// NewVaultsClient creates an instance of the VaultsClient client. +func NewVaultsClient(subscriptionID string) VaultsClient { + return NewVaultsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewVaultsClientWithBaseURI creates an instance of the VaultsClient client. +func NewVaultsClientWithBaseURI(baseURI string, subscriptionID string) VaultsClient { + return VaultsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CheckNameAvailability checks that the vault name is valid and is not already in use. +// Parameters: +// vaultName - the name of the vault. +func (client VaultsClient) CheckNameAvailability(ctx context.Context, vaultName VaultCheckNameAvailabilityParameters) (result CheckNameAvailabilityResult, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: vaultName, + Constraints: []validation.Constraint{{Target: "vaultName.Name", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "vaultName.Type", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("keyvault.VaultsClient", "CheckNameAvailability", err.Error()) + } + + req, err := client.CheckNameAvailabilityPreparer(ctx, vaultName) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.VaultsClient", "CheckNameAvailability", nil, "Failure preparing request") + return + } + + resp, err := client.CheckNameAvailabilitySender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "keyvault.VaultsClient", "CheckNameAvailability", resp, "Failure sending request") + return + } + + result, err = client.CheckNameAvailabilityResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.VaultsClient", "CheckNameAvailability", resp, "Failure responding to request") + } + + return +} + +// CheckNameAvailabilityPreparer prepares the CheckNameAvailability request. +func (client VaultsClient) CheckNameAvailabilityPreparer(ctx context.Context, vaultName VaultCheckNameAvailabilityParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-02-14" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.KeyVault/checkNameAvailability", pathParameters), + autorest.WithJSON(vaultName), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CheckNameAvailabilitySender sends the CheckNameAvailability request. The method will close the +// http.Response Body if it receives an error. +func (client VaultsClient) CheckNameAvailabilitySender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// CheckNameAvailabilityResponder handles the response to the CheckNameAvailability request. The method always +// closes the http.Response Body. +func (client VaultsClient) CheckNameAvailabilityResponder(resp *http.Response) (result CheckNameAvailabilityResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CreateOrUpdate create or update a key vault in the specified subscription. +// Parameters: +// resourceGroupName - the name of the Resource Group to which the server belongs. +// vaultName - name of the vault +// parameters - parameters to create or update the vault +func (client VaultsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, vaultName string, parameters VaultCreateOrUpdateParameters) (result VaultsCreateOrUpdateFuture, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: vaultName, + Constraints: []validation.Constraint{{Target: "vaultName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9-]{3,24}$`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.Location", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.Properties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.Properties.TenantID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.Properties.Sku", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.Properties.Sku.Family", Name: validation.Null, Rule: true, Chain: nil}}}, + }}}}}); err != nil { + return result, validation.NewError("keyvault.VaultsClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, vaultName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.VaultsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.VaultsClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client VaultsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, vaultName string, parameters VaultCreateOrUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vaultName": autorest.Encode("path", vaultName), + } + + const APIVersion = "2018-02-14" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client VaultsClient) CreateOrUpdateSender(req *http.Request) (future VaultsCreateOrUpdateFuture, err error) { + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client VaultsClient) CreateOrUpdateResponder(resp *http.Response) (result Vault, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes the specified Azure key vault. +// Parameters: +// resourceGroupName - the name of the Resource Group to which the vault belongs. +// vaultName - the name of the vault to delete +func (client VaultsClient) Delete(ctx context.Context, resourceGroupName string, vaultName string) (result autorest.Response, err error) { + req, err := client.DeletePreparer(ctx, resourceGroupName, vaultName) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.VaultsClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "keyvault.VaultsClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.VaultsClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client VaultsClient) DeletePreparer(ctx context.Context, resourceGroupName string, vaultName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vaultName": autorest.Encode("path", vaultName), + } + + const APIVersion = "2018-02-14" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client VaultsClient) DeleteSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client VaultsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the specified Azure key vault. +// Parameters: +// resourceGroupName - the name of the Resource Group to which the vault belongs. +// vaultName - the name of the vault. +func (client VaultsClient) Get(ctx context.Context, resourceGroupName string, vaultName string) (result Vault, err error) { + req, err := client.GetPreparer(ctx, resourceGroupName, vaultName) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.VaultsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "keyvault.VaultsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.VaultsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client VaultsClient) GetPreparer(ctx context.Context, resourceGroupName string, vaultName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vaultName": autorest.Encode("path", vaultName), + } + + const APIVersion = "2018-02-14" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client VaultsClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client VaultsClient) GetResponder(resp *http.Response) (result Vault, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetDeleted gets the deleted Azure key vault. +// Parameters: +// vaultName - the name of the vault. +// location - the location of the deleted vault. +func (client VaultsClient) GetDeleted(ctx context.Context, vaultName string, location string) (result DeletedVault, err error) { + req, err := client.GetDeletedPreparer(ctx, vaultName, location) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.VaultsClient", "GetDeleted", nil, "Failure preparing request") + return + } + + resp, err := client.GetDeletedSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "keyvault.VaultsClient", "GetDeleted", resp, "Failure sending request") + return + } + + result, err = client.GetDeletedResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.VaultsClient", "GetDeleted", resp, "Failure responding to request") + } + + return +} + +// GetDeletedPreparer prepares the GetDeleted request. +func (client VaultsClient) GetDeletedPreparer(ctx context.Context, vaultName string, location string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "location": autorest.Encode("path", location), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vaultName": autorest.Encode("path", vaultName), + } + + const APIVersion = "2018-02-14" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.KeyVault/locations/{location}/deletedVaults/{vaultName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetDeletedSender sends the GetDeleted request. The method will close the +// http.Response Body if it receives an error. +func (client VaultsClient) GetDeletedSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetDeletedResponder handles the response to the GetDeleted request. The method always +// closes the http.Response Body. +func (client VaultsClient) GetDeletedResponder(resp *http.Response) (result DeletedVault, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List the List operation gets information about the vaults associated with the subscription. +// Parameters: +// top - maximum number of results to return. +func (client VaultsClient) List(ctx context.Context, top *int32) (result ResourceListResultPage, err error) { + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, top) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.VaultsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.rlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "keyvault.VaultsClient", "List", resp, "Failure sending request") + return + } + + result.rlr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.VaultsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client VaultsClient) ListPreparer(ctx context.Context, top *int32) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-11-01" + queryParameters := map[string]interface{}{ + "$filter": autorest.Encode("query", "resourceType eq 'Microsoft.KeyVault/vaults'"), + "api-version": APIVersion, + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resources", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client VaultsClient) ListSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client VaultsClient) ListResponder(resp *http.Response) (result ResourceListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client VaultsClient) listNextResults(lastResults ResourceListResult) (result ResourceListResult, err error) { + req, err := lastResults.resourceListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "keyvault.VaultsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "keyvault.VaultsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.VaultsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client VaultsClient) ListComplete(ctx context.Context, top *int32) (result ResourceListResultIterator, err error) { + result.page, err = client.List(ctx, top) + return +} + +// ListByResourceGroup the List operation gets information about the vaults associated with the subscription and within +// the specified resource group. +// Parameters: +// resourceGroupName - the name of the Resource Group to which the vault belongs. +// top - maximum number of results to return. +func (client VaultsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string, top *int32) (result VaultListResultPage, err error) { + result.fn = client.listByResourceGroupNextResults + req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName, top) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.VaultsClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.vlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "keyvault.VaultsClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result.vlr, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.VaultsClient", "ListByResourceGroup", resp, "Failure responding to request") + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client VaultsClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string, top *int32) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-02-14" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the +// http.Response Body if it receives an error. +func (client VaultsClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always +// closes the http.Response Body. +func (client VaultsClient) ListByResourceGroupResponder(resp *http.Response) (result VaultListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByResourceGroupNextResults retrieves the next set of results, if any. +func (client VaultsClient) listByResourceGroupNextResults(lastResults VaultListResult) (result VaultListResult, err error) { + req, err := lastResults.vaultListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "keyvault.VaultsClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "keyvault.VaultsClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.VaultsClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client VaultsClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string, top *int32) (result VaultListResultIterator, err error) { + result.page, err = client.ListByResourceGroup(ctx, resourceGroupName, top) + return +} + +// ListBySubscription the List operation gets information about the vaults associated with the subscription. +// Parameters: +// top - maximum number of results to return. +func (client VaultsClient) ListBySubscription(ctx context.Context, top *int32) (result VaultListResultPage, err error) { + result.fn = client.listBySubscriptionNextResults + req, err := client.ListBySubscriptionPreparer(ctx, top) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.VaultsClient", "ListBySubscription", nil, "Failure preparing request") + return + } + + resp, err := client.ListBySubscriptionSender(req) + if err != nil { + result.vlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "keyvault.VaultsClient", "ListBySubscription", resp, "Failure sending request") + return + } + + result.vlr, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.VaultsClient", "ListBySubscription", resp, "Failure responding to request") + } + + return +} + +// ListBySubscriptionPreparer prepares the ListBySubscription request. +func (client VaultsClient) ListBySubscriptionPreparer(ctx context.Context, top *int32) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-02-14" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.KeyVault/vaults", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListBySubscriptionSender sends the ListBySubscription request. The method will close the +// http.Response Body if it receives an error. +func (client VaultsClient) ListBySubscriptionSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListBySubscriptionResponder handles the response to the ListBySubscription request. The method always +// closes the http.Response Body. +func (client VaultsClient) ListBySubscriptionResponder(resp *http.Response) (result VaultListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listBySubscriptionNextResults retrieves the next set of results, if any. +func (client VaultsClient) listBySubscriptionNextResults(lastResults VaultListResult) (result VaultListResult, err error) { + req, err := lastResults.vaultListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "keyvault.VaultsClient", "listBySubscriptionNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListBySubscriptionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "keyvault.VaultsClient", "listBySubscriptionNextResults", resp, "Failure sending next results request") + } + result, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.VaultsClient", "listBySubscriptionNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required. +func (client VaultsClient) ListBySubscriptionComplete(ctx context.Context, top *int32) (result VaultListResultIterator, err error) { + result.page, err = client.ListBySubscription(ctx, top) + return +} + +// ListDeleted gets information about the deleted vaults in a subscription. +func (client VaultsClient) ListDeleted(ctx context.Context) (result DeletedVaultListResultPage, err error) { + result.fn = client.listDeletedNextResults + req, err := client.ListDeletedPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.VaultsClient", "ListDeleted", nil, "Failure preparing request") + return + } + + resp, err := client.ListDeletedSender(req) + if err != nil { + result.dvlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "keyvault.VaultsClient", "ListDeleted", resp, "Failure sending request") + return + } + + result.dvlr, err = client.ListDeletedResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.VaultsClient", "ListDeleted", resp, "Failure responding to request") + } + + return +} + +// ListDeletedPreparer prepares the ListDeleted request. +func (client VaultsClient) ListDeletedPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-02-14" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.KeyVault/deletedVaults", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListDeletedSender sends the ListDeleted request. The method will close the +// http.Response Body if it receives an error. +func (client VaultsClient) ListDeletedSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListDeletedResponder handles the response to the ListDeleted request. The method always +// closes the http.Response Body. +func (client VaultsClient) ListDeletedResponder(resp *http.Response) (result DeletedVaultListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listDeletedNextResults retrieves the next set of results, if any. +func (client VaultsClient) listDeletedNextResults(lastResults DeletedVaultListResult) (result DeletedVaultListResult, err error) { + req, err := lastResults.deletedVaultListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "keyvault.VaultsClient", "listDeletedNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListDeletedSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "keyvault.VaultsClient", "listDeletedNextResults", resp, "Failure sending next results request") + } + result, err = client.ListDeletedResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.VaultsClient", "listDeletedNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListDeletedComplete enumerates all values, automatically crossing page boundaries as required. +func (client VaultsClient) ListDeletedComplete(ctx context.Context) (result DeletedVaultListResultIterator, err error) { + result.page, err = client.ListDeleted(ctx) + return +} + +// PurgeDeleted permanently deletes the specified vault. aka Purges the deleted Azure key vault. +// Parameters: +// vaultName - the name of the soft-deleted vault. +// location - the location of the soft-deleted vault. +func (client VaultsClient) PurgeDeleted(ctx context.Context, vaultName string, location string) (result VaultsPurgeDeletedFuture, err error) { + req, err := client.PurgeDeletedPreparer(ctx, vaultName, location) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.VaultsClient", "PurgeDeleted", nil, "Failure preparing request") + return + } + + result, err = client.PurgeDeletedSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.VaultsClient", "PurgeDeleted", result.Response(), "Failure sending request") + return + } + + return +} + +// PurgeDeletedPreparer prepares the PurgeDeleted request. +func (client VaultsClient) PurgeDeletedPreparer(ctx context.Context, vaultName string, location string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "location": autorest.Encode("path", location), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vaultName": autorest.Encode("path", vaultName), + } + + const APIVersion = "2018-02-14" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.KeyVault/locations/{location}/deletedVaults/{vaultName}/purge", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// PurgeDeletedSender sends the PurgeDeleted request. The method will close the +// http.Response Body if it receives an error. +func (client VaultsClient) PurgeDeletedSender(req *http.Request) (future VaultsPurgeDeletedFuture, err error) { + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// PurgeDeletedResponder handles the response to the PurgeDeleted request. The method always +// closes the http.Response Body. +func (client VaultsClient) PurgeDeletedResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// Update update a key vault in the specified subscription. +// Parameters: +// resourceGroupName - the name of the Resource Group to which the server belongs. +// vaultName - name of the vault +// parameters - parameters to patch the vault +func (client VaultsClient) Update(ctx context.Context, resourceGroupName string, vaultName string, parameters VaultPatchParameters) (result Vault, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: vaultName, + Constraints: []validation.Constraint{{Target: "vaultName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9-]{3,24}$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("keyvault.VaultsClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, vaultName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.VaultsClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "keyvault.VaultsClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.VaultsClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client VaultsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, vaultName string, parameters VaultPatchParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vaultName": autorest.Encode("path", vaultName), + } + + const APIVersion = "2018-02-14" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client VaultsClient) UpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client VaultsClient) UpdateResponder(resp *http.Response) (result Vault, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UpdateAccessPolicy update access policies in a key vault in the specified subscription. +// Parameters: +// resourceGroupName - the name of the Resource Group to which the vault belongs. +// vaultName - name of the vault +// operationKind - name of the operation +// parameters - access policy to merge into the vault +func (client VaultsClient) UpdateAccessPolicy(ctx context.Context, resourceGroupName string, vaultName string, operationKind AccessPolicyUpdateKind, parameters VaultAccessPolicyParameters) (result VaultAccessPolicyParameters, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: vaultName, + Constraints: []validation.Constraint{{Target: "vaultName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9-]{3,24}$`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.Properties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.Properties.AccessPolicies", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("keyvault.VaultsClient", "UpdateAccessPolicy", err.Error()) + } + + req, err := client.UpdateAccessPolicyPreparer(ctx, resourceGroupName, vaultName, operationKind, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.VaultsClient", "UpdateAccessPolicy", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateAccessPolicySender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "keyvault.VaultsClient", "UpdateAccessPolicy", resp, "Failure sending request") + return + } + + result, err = client.UpdateAccessPolicyResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.VaultsClient", "UpdateAccessPolicy", resp, "Failure responding to request") + } + + return +} + +// UpdateAccessPolicyPreparer prepares the UpdateAccessPolicy request. +func (client VaultsClient) UpdateAccessPolicyPreparer(ctx context.Context, resourceGroupName string, vaultName string, operationKind AccessPolicyUpdateKind, parameters VaultAccessPolicyParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "operationKind": autorest.Encode("path", operationKind), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vaultName": autorest.Encode("path", vaultName), + } + + const APIVersion = "2018-02-14" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}/accessPolicies/{operationKind}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateAccessPolicySender sends the UpdateAccessPolicy request. The method will close the +// http.Response Body if it receives an error. +func (client VaultsClient) UpdateAccessPolicySender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateAccessPolicyResponder handles the response to the UpdateAccessPolicy request. The method always +// closes the http.Response Body. +func (client VaultsClient) UpdateAccessPolicyResponder(resp *http.Response) (result VaultAccessPolicyParameters, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/keyvault/mgmt/2018-02-14/keyvault/version.go b/vendor/github.com/Azure/azure-sdk-for-go/services/keyvault/mgmt/2018-02-14/keyvault/version.go new file mode 100644 index 000000000..c6119f5e9 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/keyvault/mgmt/2018-02-14/keyvault/version.go @@ -0,0 +1,30 @@ +package keyvault + +import "github.com/Azure/azure-sdk-for-go/version" + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// UserAgent returns the UserAgent string to use when sending http.Requests. +func UserAgent() string { + return "Azure-SDK-For-Go/" + version.Number + " keyvault/2018-02-14" +} + +// Version returns the semantic version (see http://semver.org) of the client. +func Version() string { + return version.Number +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/keyvault/v7.0/keyvault/client.go b/vendor/github.com/Azure/azure-sdk-for-go/services/keyvault/v7.0/keyvault/client.go new file mode 100644 index 000000000..76cfea00f --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/keyvault/v7.0/keyvault/client.go @@ -0,0 +1,6420 @@ +// Package keyvault implements the Azure ARM Keyvault service API version 7.0. +// +// The key vault client performs cryptographic key operations and vault operations against the Key Vault service. +package keyvault + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// BaseClient is the base client for Keyvault. +type BaseClient struct { + autorest.Client +} + +// New creates an instance of the BaseClient client. +func New() BaseClient { + return NewWithoutDefaults() +} + +// NewWithoutDefaults creates an instance of the BaseClient client. +func NewWithoutDefaults() BaseClient { + return BaseClient{ + Client: autorest.NewClientWithUserAgent(UserAgent()), + } +} + +// BackupCertificate requests that a backup of the specified certificate be downloaded to the client. All versions of +// the certificate will be downloaded. This operation requires the certificates/backup permission. +// Parameters: +// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net. +// certificateName - the name of the certificate. +func (client BaseClient) BackupCertificate(ctx context.Context, vaultBaseURL string, certificateName string) (result BackupCertificateResult, err error) { + req, err := client.BackupCertificatePreparer(ctx, vaultBaseURL, certificateName) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "BackupCertificate", nil, "Failure preparing request") + return + } + + resp, err := client.BackupCertificateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "BackupCertificate", resp, "Failure sending request") + return + } + + result, err = client.BackupCertificateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "BackupCertificate", resp, "Failure responding to request") + } + + return +} + +// BackupCertificatePreparer prepares the BackupCertificate request. +func (client BaseClient) BackupCertificatePreparer(ctx context.Context, vaultBaseURL string, certificateName string) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "vaultBaseUrl": vaultBaseURL, + } + + pathParameters := map[string]interface{}{ + "certificate-name": autorest.Encode("path", certificateName), + } + + const APIVersion = "7.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters), + autorest.WithPathParameters("/certificates/{certificate-name}/backup", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// BackupCertificateSender sends the BackupCertificate request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) BackupCertificateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// BackupCertificateResponder handles the response to the BackupCertificate request. The method always +// closes the http.Response Body. +func (client BaseClient) BackupCertificateResponder(resp *http.Response) (result BackupCertificateResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// BackupKey the Key Backup operation exports a key from Azure Key Vault in a protected form. Note that this operation +// does NOT return key material in a form that can be used outside the Azure Key Vault system, the returned key +// material is either protected to a Azure Key Vault HSM or to Azure Key Vault itself. The intent of this operation is +// to allow a client to GENERATE a key in one Azure Key Vault instance, BACKUP the key, and then RESTORE it into +// another Azure Key Vault instance. The BACKUP operation may be used to export, in protected form, any key type from +// Azure Key Vault. Individual versions of a key cannot be backed up. BACKUP / RESTORE can be performed within +// geographical boundaries only; meaning that a BACKUP from one geographical area cannot be restored to another +// geographical area. For example, a backup from the US geographical area cannot be restored in an EU geographical +// area. This operation requires the key/backup permission. +// Parameters: +// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net. +// keyName - the name of the key. +func (client BaseClient) BackupKey(ctx context.Context, vaultBaseURL string, keyName string) (result BackupKeyResult, err error) { + req, err := client.BackupKeyPreparer(ctx, vaultBaseURL, keyName) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "BackupKey", nil, "Failure preparing request") + return + } + + resp, err := client.BackupKeySender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "BackupKey", resp, "Failure sending request") + return + } + + result, err = client.BackupKeyResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "BackupKey", resp, "Failure responding to request") + } + + return +} + +// BackupKeyPreparer prepares the BackupKey request. +func (client BaseClient) BackupKeyPreparer(ctx context.Context, vaultBaseURL string, keyName string) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "vaultBaseUrl": vaultBaseURL, + } + + pathParameters := map[string]interface{}{ + "key-name": autorest.Encode("path", keyName), + } + + const APIVersion = "7.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters), + autorest.WithPathParameters("/keys/{key-name}/backup", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// BackupKeySender sends the BackupKey request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) BackupKeySender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// BackupKeyResponder handles the response to the BackupKey request. The method always +// closes the http.Response Body. +func (client BaseClient) BackupKeyResponder(resp *http.Response) (result BackupKeyResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// BackupSecret requests that a backup of the specified secret be downloaded to the client. All versions of the secret +// will be downloaded. This operation requires the secrets/backup permission. +// Parameters: +// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net. +// secretName - the name of the secret. +func (client BaseClient) BackupSecret(ctx context.Context, vaultBaseURL string, secretName string) (result BackupSecretResult, err error) { + req, err := client.BackupSecretPreparer(ctx, vaultBaseURL, secretName) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "BackupSecret", nil, "Failure preparing request") + return + } + + resp, err := client.BackupSecretSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "BackupSecret", resp, "Failure sending request") + return + } + + result, err = client.BackupSecretResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "BackupSecret", resp, "Failure responding to request") + } + + return +} + +// BackupSecretPreparer prepares the BackupSecret request. +func (client BaseClient) BackupSecretPreparer(ctx context.Context, vaultBaseURL string, secretName string) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "vaultBaseUrl": vaultBaseURL, + } + + pathParameters := map[string]interface{}{ + "secret-name": autorest.Encode("path", secretName), + } + + const APIVersion = "7.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters), + autorest.WithPathParameters("/secrets/{secret-name}/backup", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// BackupSecretSender sends the BackupSecret request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) BackupSecretSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// BackupSecretResponder handles the response to the BackupSecret request. The method always +// closes the http.Response Body. +func (client BaseClient) BackupSecretResponder(resp *http.Response) (result BackupSecretResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// BackupStorageAccount requests that a backup of the specified storage account be downloaded to the client. This +// operation requires the storage/backup permission. +// Parameters: +// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net. +// storageAccountName - the name of the storage account. +func (client BaseClient) BackupStorageAccount(ctx context.Context, vaultBaseURL string, storageAccountName string) (result BackupStorageResult, err error) { + req, err := client.BackupStorageAccountPreparer(ctx, vaultBaseURL, storageAccountName) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "BackupStorageAccount", nil, "Failure preparing request") + return + } + + resp, err := client.BackupStorageAccountSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "BackupStorageAccount", resp, "Failure sending request") + return + } + + result, err = client.BackupStorageAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "BackupStorageAccount", resp, "Failure responding to request") + } + + return +} + +// BackupStorageAccountPreparer prepares the BackupStorageAccount request. +func (client BaseClient) BackupStorageAccountPreparer(ctx context.Context, vaultBaseURL string, storageAccountName string) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "vaultBaseUrl": vaultBaseURL, + } + + pathParameters := map[string]interface{}{ + "storage-account-name": autorest.Encode("path", storageAccountName), + } + + const APIVersion = "7.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters), + autorest.WithPathParameters("/storage/{storage-account-name}/backup", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// BackupStorageAccountSender sends the BackupStorageAccount request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) BackupStorageAccountSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// BackupStorageAccountResponder handles the response to the BackupStorageAccount request. The method always +// closes the http.Response Body. +func (client BaseClient) BackupStorageAccountResponder(resp *http.Response) (result BackupStorageResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CreateCertificate if this is the first version, the certificate resource is created. This operation requires the +// certificates/create permission. +// Parameters: +// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net. +// certificateName - the name of the certificate. +// parameters - the parameters to create a certificate. +func (client BaseClient) CreateCertificate(ctx context.Context, vaultBaseURL string, certificateName string, parameters CertificateCreateParameters) (result CertificateOperation, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: certificateName, + Constraints: []validation.Constraint{{Target: "certificateName", Name: validation.Pattern, Rule: `^[0-9a-zA-Z-]+$`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.CertificatePolicy", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.CertificatePolicy.X509CertificateProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.CertificatePolicy.X509CertificateProperties.ValidityInMonths", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.CertificatePolicy.X509CertificateProperties.ValidityInMonths", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}, + }}, + }}}}}); err != nil { + return result, validation.NewError("keyvault.BaseClient", "CreateCertificate", err.Error()) + } + + req, err := client.CreateCertificatePreparer(ctx, vaultBaseURL, certificateName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "CreateCertificate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateCertificateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "CreateCertificate", resp, "Failure sending request") + return + } + + result, err = client.CreateCertificateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "CreateCertificate", resp, "Failure responding to request") + } + + return +} + +// CreateCertificatePreparer prepares the CreateCertificate request. +func (client BaseClient) CreateCertificatePreparer(ctx context.Context, vaultBaseURL string, certificateName string, parameters CertificateCreateParameters) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "vaultBaseUrl": vaultBaseURL, + } + + pathParameters := map[string]interface{}{ + "certificate-name": autorest.Encode("path", certificateName), + } + + const APIVersion = "7.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters), + autorest.WithPathParameters("/certificates/{certificate-name}/create", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateCertificateSender sends the CreateCertificate request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) CreateCertificateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// CreateCertificateResponder handles the response to the CreateCertificate request. The method always +// closes the http.Response Body. +func (client BaseClient) CreateCertificateResponder(resp *http.Response) (result CertificateOperation, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CreateKey the create key operation can be used to create any key type in Azure Key Vault. If the named key already +// exists, Azure Key Vault creates a new version of the key. It requires the keys/create permission. +// Parameters: +// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net. +// keyName - the name for the new key. The system will generate the version name for the new key. +// parameters - the parameters to create a key. +func (client BaseClient) CreateKey(ctx context.Context, vaultBaseURL string, keyName string, parameters KeyCreateParameters) (result KeyBundle, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: keyName, + Constraints: []validation.Constraint{{Target: "keyName", Name: validation.Pattern, Rule: `^[0-9a-zA-Z-]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("keyvault.BaseClient", "CreateKey", err.Error()) + } + + req, err := client.CreateKeyPreparer(ctx, vaultBaseURL, keyName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "CreateKey", nil, "Failure preparing request") + return + } + + resp, err := client.CreateKeySender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "CreateKey", resp, "Failure sending request") + return + } + + result, err = client.CreateKeyResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "CreateKey", resp, "Failure responding to request") + } + + return +} + +// CreateKeyPreparer prepares the CreateKey request. +func (client BaseClient) CreateKeyPreparer(ctx context.Context, vaultBaseURL string, keyName string, parameters KeyCreateParameters) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "vaultBaseUrl": vaultBaseURL, + } + + pathParameters := map[string]interface{}{ + "key-name": autorest.Encode("path", keyName), + } + + const APIVersion = "7.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters), + autorest.WithPathParameters("/keys/{key-name}/create", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateKeySender sends the CreateKey request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) CreateKeySender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// CreateKeyResponder handles the response to the CreateKey request. The method always +// closes the http.Response Body. +func (client BaseClient) CreateKeyResponder(resp *http.Response) (result KeyBundle, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Decrypt the DECRYPT operation decrypts a well-formed block of ciphertext using the target encryption key and +// specified algorithm. This operation is the reverse of the ENCRYPT operation; only a single block of data may be +// decrypted, the size of this block is dependent on the target key and the algorithm to be used. The DECRYPT operation +// applies to asymmetric and symmetric keys stored in Azure Key Vault since it uses the private portion of the key. +// This operation requires the keys/decrypt permission. +// Parameters: +// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net. +// keyName - the name of the key. +// keyVersion - the version of the key. +// parameters - the parameters for the decryption operation. +func (client BaseClient) Decrypt(ctx context.Context, vaultBaseURL string, keyName string, keyVersion string, parameters KeyOperationsParameters) (result KeyOperationResult, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.Value", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("keyvault.BaseClient", "Decrypt", err.Error()) + } + + req, err := client.DecryptPreparer(ctx, vaultBaseURL, keyName, keyVersion, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "Decrypt", nil, "Failure preparing request") + return + } + + resp, err := client.DecryptSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "Decrypt", resp, "Failure sending request") + return + } + + result, err = client.DecryptResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "Decrypt", resp, "Failure responding to request") + } + + return +} + +// DecryptPreparer prepares the Decrypt request. +func (client BaseClient) DecryptPreparer(ctx context.Context, vaultBaseURL string, keyName string, keyVersion string, parameters KeyOperationsParameters) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "vaultBaseUrl": vaultBaseURL, + } + + pathParameters := map[string]interface{}{ + "key-name": autorest.Encode("path", keyName), + "key-version": autorest.Encode("path", keyVersion), + } + + const APIVersion = "7.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters), + autorest.WithPathParameters("/keys/{key-name}/{key-version}/decrypt", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DecryptSender sends the Decrypt request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) DecryptSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// DecryptResponder handles the response to the Decrypt request. The method always +// closes the http.Response Body. +func (client BaseClient) DecryptResponder(resp *http.Response) (result KeyOperationResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// DeleteCertificate deletes all versions of a certificate object along with its associated policy. Delete certificate +// cannot be used to remove individual versions of a certificate object. This operation requires the +// certificates/delete permission. +// Parameters: +// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net. +// certificateName - the name of the certificate. +func (client BaseClient) DeleteCertificate(ctx context.Context, vaultBaseURL string, certificateName string) (result DeletedCertificateBundle, err error) { + req, err := client.DeleteCertificatePreparer(ctx, vaultBaseURL, certificateName) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "DeleteCertificate", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteCertificateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "DeleteCertificate", resp, "Failure sending request") + return + } + + result, err = client.DeleteCertificateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "DeleteCertificate", resp, "Failure responding to request") + } + + return +} + +// DeleteCertificatePreparer prepares the DeleteCertificate request. +func (client BaseClient) DeleteCertificatePreparer(ctx context.Context, vaultBaseURL string, certificateName string) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "vaultBaseUrl": vaultBaseURL, + } + + pathParameters := map[string]interface{}{ + "certificate-name": autorest.Encode("path", certificateName), + } + + const APIVersion = "7.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters), + autorest.WithPathParameters("/certificates/{certificate-name}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteCertificateSender sends the DeleteCertificate request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) DeleteCertificateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// DeleteCertificateResponder handles the response to the DeleteCertificate request. The method always +// closes the http.Response Body. +func (client BaseClient) DeleteCertificateResponder(resp *http.Response) (result DeletedCertificateBundle, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// DeleteCertificateContacts deletes the certificate contacts for a specified key vault certificate. This operation +// requires the certificates/managecontacts permission. +// Parameters: +// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net. +func (client BaseClient) DeleteCertificateContacts(ctx context.Context, vaultBaseURL string) (result Contacts, err error) { + req, err := client.DeleteCertificateContactsPreparer(ctx, vaultBaseURL) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "DeleteCertificateContacts", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteCertificateContactsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "DeleteCertificateContacts", resp, "Failure sending request") + return + } + + result, err = client.DeleteCertificateContactsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "DeleteCertificateContacts", resp, "Failure responding to request") + } + + return +} + +// DeleteCertificateContactsPreparer prepares the DeleteCertificateContacts request. +func (client BaseClient) DeleteCertificateContactsPreparer(ctx context.Context, vaultBaseURL string) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "vaultBaseUrl": vaultBaseURL, + } + + const APIVersion = "7.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters), + autorest.WithPath("/certificates/contacts"), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteCertificateContactsSender sends the DeleteCertificateContacts request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) DeleteCertificateContactsSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// DeleteCertificateContactsResponder handles the response to the DeleteCertificateContacts request. The method always +// closes the http.Response Body. +func (client BaseClient) DeleteCertificateContactsResponder(resp *http.Response) (result Contacts, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// DeleteCertificateIssuer the DeleteCertificateIssuer operation permanently removes the specified certificate issuer +// from the vault. This operation requires the certificates/manageissuers/deleteissuers permission. +// Parameters: +// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net. +// issuerName - the name of the issuer. +func (client BaseClient) DeleteCertificateIssuer(ctx context.Context, vaultBaseURL string, issuerName string) (result IssuerBundle, err error) { + req, err := client.DeleteCertificateIssuerPreparer(ctx, vaultBaseURL, issuerName) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "DeleteCertificateIssuer", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteCertificateIssuerSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "DeleteCertificateIssuer", resp, "Failure sending request") + return + } + + result, err = client.DeleteCertificateIssuerResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "DeleteCertificateIssuer", resp, "Failure responding to request") + } + + return +} + +// DeleteCertificateIssuerPreparer prepares the DeleteCertificateIssuer request. +func (client BaseClient) DeleteCertificateIssuerPreparer(ctx context.Context, vaultBaseURL string, issuerName string) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "vaultBaseUrl": vaultBaseURL, + } + + pathParameters := map[string]interface{}{ + "issuer-name": autorest.Encode("path", issuerName), + } + + const APIVersion = "7.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters), + autorest.WithPathParameters("/certificates/issuers/{issuer-name}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteCertificateIssuerSender sends the DeleteCertificateIssuer request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) DeleteCertificateIssuerSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// DeleteCertificateIssuerResponder handles the response to the DeleteCertificateIssuer request. The method always +// closes the http.Response Body. +func (client BaseClient) DeleteCertificateIssuerResponder(resp *http.Response) (result IssuerBundle, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// DeleteCertificateOperation deletes the creation operation for a specified certificate that is in the process of +// being created. The certificate is no longer created. This operation requires the certificates/update permission. +// Parameters: +// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net. +// certificateName - the name of the certificate. +func (client BaseClient) DeleteCertificateOperation(ctx context.Context, vaultBaseURL string, certificateName string) (result CertificateOperation, err error) { + req, err := client.DeleteCertificateOperationPreparer(ctx, vaultBaseURL, certificateName) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "DeleteCertificateOperation", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteCertificateOperationSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "DeleteCertificateOperation", resp, "Failure sending request") + return + } + + result, err = client.DeleteCertificateOperationResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "DeleteCertificateOperation", resp, "Failure responding to request") + } + + return +} + +// DeleteCertificateOperationPreparer prepares the DeleteCertificateOperation request. +func (client BaseClient) DeleteCertificateOperationPreparer(ctx context.Context, vaultBaseURL string, certificateName string) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "vaultBaseUrl": vaultBaseURL, + } + + pathParameters := map[string]interface{}{ + "certificate-name": autorest.Encode("path", certificateName), + } + + const APIVersion = "7.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters), + autorest.WithPathParameters("/certificates/{certificate-name}/pending", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteCertificateOperationSender sends the DeleteCertificateOperation request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) DeleteCertificateOperationSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// DeleteCertificateOperationResponder handles the response to the DeleteCertificateOperation request. The method always +// closes the http.Response Body. +func (client BaseClient) DeleteCertificateOperationResponder(resp *http.Response) (result CertificateOperation, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// DeleteKey the delete key operation cannot be used to remove individual versions of a key. This operation removes the +// cryptographic material associated with the key, which means the key is not usable for Sign/Verify, Wrap/Unwrap or +// Encrypt/Decrypt operations. This operation requires the keys/delete permission. +// Parameters: +// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net. +// keyName - the name of the key to delete. +func (client BaseClient) DeleteKey(ctx context.Context, vaultBaseURL string, keyName string) (result DeletedKeyBundle, err error) { + req, err := client.DeleteKeyPreparer(ctx, vaultBaseURL, keyName) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "DeleteKey", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteKeySender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "DeleteKey", resp, "Failure sending request") + return + } + + result, err = client.DeleteKeyResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "DeleteKey", resp, "Failure responding to request") + } + + return +} + +// DeleteKeyPreparer prepares the DeleteKey request. +func (client BaseClient) DeleteKeyPreparer(ctx context.Context, vaultBaseURL string, keyName string) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "vaultBaseUrl": vaultBaseURL, + } + + pathParameters := map[string]interface{}{ + "key-name": autorest.Encode("path", keyName), + } + + const APIVersion = "7.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters), + autorest.WithPathParameters("/keys/{key-name}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteKeySender sends the DeleteKey request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) DeleteKeySender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// DeleteKeyResponder handles the response to the DeleteKey request. The method always +// closes the http.Response Body. +func (client BaseClient) DeleteKeyResponder(resp *http.Response) (result DeletedKeyBundle, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// DeleteSasDefinition deletes a SAS definition from a specified storage account. This operation requires the +// storage/deletesas permission. +// Parameters: +// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net. +// storageAccountName - the name of the storage account. +// sasDefinitionName - the name of the SAS definition. +func (client BaseClient) DeleteSasDefinition(ctx context.Context, vaultBaseURL string, storageAccountName string, sasDefinitionName string) (result DeletedSasDefinitionBundle, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: storageAccountName, + Constraints: []validation.Constraint{{Target: "storageAccountName", Name: validation.Pattern, Rule: `^[0-9a-zA-Z]+$`, Chain: nil}}}, + {TargetValue: sasDefinitionName, + Constraints: []validation.Constraint{{Target: "sasDefinitionName", Name: validation.Pattern, Rule: `^[0-9a-zA-Z]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("keyvault.BaseClient", "DeleteSasDefinition", err.Error()) + } + + req, err := client.DeleteSasDefinitionPreparer(ctx, vaultBaseURL, storageAccountName, sasDefinitionName) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "DeleteSasDefinition", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSasDefinitionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "DeleteSasDefinition", resp, "Failure sending request") + return + } + + result, err = client.DeleteSasDefinitionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "DeleteSasDefinition", resp, "Failure responding to request") + } + + return +} + +// DeleteSasDefinitionPreparer prepares the DeleteSasDefinition request. +func (client BaseClient) DeleteSasDefinitionPreparer(ctx context.Context, vaultBaseURL string, storageAccountName string, sasDefinitionName string) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "vaultBaseUrl": vaultBaseURL, + } + + pathParameters := map[string]interface{}{ + "sas-definition-name": autorest.Encode("path", sasDefinitionName), + "storage-account-name": autorest.Encode("path", storageAccountName), + } + + const APIVersion = "7.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters), + autorest.WithPathParameters("/storage/{storage-account-name}/sas/{sas-definition-name}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSasDefinitionSender sends the DeleteSasDefinition request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) DeleteSasDefinitionSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// DeleteSasDefinitionResponder handles the response to the DeleteSasDefinition request. The method always +// closes the http.Response Body. +func (client BaseClient) DeleteSasDefinitionResponder(resp *http.Response) (result DeletedSasDefinitionBundle, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// DeleteSecret the DELETE operation applies to any secret stored in Azure Key Vault. DELETE cannot be applied to an +// individual version of a secret. This operation requires the secrets/delete permission. +// Parameters: +// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net. +// secretName - the name of the secret. +func (client BaseClient) DeleteSecret(ctx context.Context, vaultBaseURL string, secretName string) (result DeletedSecretBundle, err error) { + req, err := client.DeleteSecretPreparer(ctx, vaultBaseURL, secretName) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "DeleteSecret", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSecretSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "DeleteSecret", resp, "Failure sending request") + return + } + + result, err = client.DeleteSecretResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "DeleteSecret", resp, "Failure responding to request") + } + + return +} + +// DeleteSecretPreparer prepares the DeleteSecret request. +func (client BaseClient) DeleteSecretPreparer(ctx context.Context, vaultBaseURL string, secretName string) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "vaultBaseUrl": vaultBaseURL, + } + + pathParameters := map[string]interface{}{ + "secret-name": autorest.Encode("path", secretName), + } + + const APIVersion = "7.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters), + autorest.WithPathParameters("/secrets/{secret-name}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSecretSender sends the DeleteSecret request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) DeleteSecretSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// DeleteSecretResponder handles the response to the DeleteSecret request. The method always +// closes the http.Response Body. +func (client BaseClient) DeleteSecretResponder(resp *http.Response) (result DeletedSecretBundle, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// DeleteStorageAccount deletes a storage account. This operation requires the storage/delete permission. +// Parameters: +// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net. +// storageAccountName - the name of the storage account. +func (client BaseClient) DeleteStorageAccount(ctx context.Context, vaultBaseURL string, storageAccountName string) (result DeletedStorageBundle, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: storageAccountName, + Constraints: []validation.Constraint{{Target: "storageAccountName", Name: validation.Pattern, Rule: `^[0-9a-zA-Z]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("keyvault.BaseClient", "DeleteStorageAccount", err.Error()) + } + + req, err := client.DeleteStorageAccountPreparer(ctx, vaultBaseURL, storageAccountName) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "DeleteStorageAccount", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteStorageAccountSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "DeleteStorageAccount", resp, "Failure sending request") + return + } + + result, err = client.DeleteStorageAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "DeleteStorageAccount", resp, "Failure responding to request") + } + + return +} + +// DeleteStorageAccountPreparer prepares the DeleteStorageAccount request. +func (client BaseClient) DeleteStorageAccountPreparer(ctx context.Context, vaultBaseURL string, storageAccountName string) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "vaultBaseUrl": vaultBaseURL, + } + + pathParameters := map[string]interface{}{ + "storage-account-name": autorest.Encode("path", storageAccountName), + } + + const APIVersion = "7.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters), + autorest.WithPathParameters("/storage/{storage-account-name}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteStorageAccountSender sends the DeleteStorageAccount request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) DeleteStorageAccountSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// DeleteStorageAccountResponder handles the response to the DeleteStorageAccount request. The method always +// closes the http.Response Body. +func (client BaseClient) DeleteStorageAccountResponder(resp *http.Response) (result DeletedStorageBundle, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Encrypt the ENCRYPT operation encrypts an arbitrary sequence of bytes using an encryption key that is stored in +// Azure Key Vault. Note that the ENCRYPT operation only supports a single block of data, the size of which is +// dependent on the target key and the encryption algorithm to be used. The ENCRYPT operation is only strictly +// necessary for symmetric keys stored in Azure Key Vault since protection with an asymmetric key can be performed +// using public portion of the key. This operation is supported for asymmetric keys as a convenience for callers that +// have a key-reference but do not have access to the public key material. This operation requires the keys/encypt +// permission. +// Parameters: +// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net. +// keyName - the name of the key. +// keyVersion - the version of the key. +// parameters - the parameters for the encryption operation. +func (client BaseClient) Encrypt(ctx context.Context, vaultBaseURL string, keyName string, keyVersion string, parameters KeyOperationsParameters) (result KeyOperationResult, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.Value", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("keyvault.BaseClient", "Encrypt", err.Error()) + } + + req, err := client.EncryptPreparer(ctx, vaultBaseURL, keyName, keyVersion, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "Encrypt", nil, "Failure preparing request") + return + } + + resp, err := client.EncryptSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "Encrypt", resp, "Failure sending request") + return + } + + result, err = client.EncryptResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "Encrypt", resp, "Failure responding to request") + } + + return +} + +// EncryptPreparer prepares the Encrypt request. +func (client BaseClient) EncryptPreparer(ctx context.Context, vaultBaseURL string, keyName string, keyVersion string, parameters KeyOperationsParameters) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "vaultBaseUrl": vaultBaseURL, + } + + pathParameters := map[string]interface{}{ + "key-name": autorest.Encode("path", keyName), + "key-version": autorest.Encode("path", keyVersion), + } + + const APIVersion = "7.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters), + autorest.WithPathParameters("/keys/{key-name}/{key-version}/encrypt", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// EncryptSender sends the Encrypt request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) EncryptSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// EncryptResponder handles the response to the Encrypt request. The method always +// closes the http.Response Body. +func (client BaseClient) EncryptResponder(resp *http.Response) (result KeyOperationResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetCertificate gets information about a specific certificate. This operation requires the certificates/get +// permission. +// Parameters: +// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net. +// certificateName - the name of the certificate in the given vault. +// certificateVersion - the version of the certificate. +func (client BaseClient) GetCertificate(ctx context.Context, vaultBaseURL string, certificateName string, certificateVersion string) (result CertificateBundle, err error) { + req, err := client.GetCertificatePreparer(ctx, vaultBaseURL, certificateName, certificateVersion) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetCertificate", nil, "Failure preparing request") + return + } + + resp, err := client.GetCertificateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetCertificate", resp, "Failure sending request") + return + } + + result, err = client.GetCertificateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetCertificate", resp, "Failure responding to request") + } + + return +} + +// GetCertificatePreparer prepares the GetCertificate request. +func (client BaseClient) GetCertificatePreparer(ctx context.Context, vaultBaseURL string, certificateName string, certificateVersion string) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "vaultBaseUrl": vaultBaseURL, + } + + pathParameters := map[string]interface{}{ + "certificate-name": autorest.Encode("path", certificateName), + "certificate-version": autorest.Encode("path", certificateVersion), + } + + const APIVersion = "7.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters), + autorest.WithPathParameters("/certificates/{certificate-name}/{certificate-version}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetCertificateSender sends the GetCertificate request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GetCertificateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetCertificateResponder handles the response to the GetCertificate request. The method always +// closes the http.Response Body. +func (client BaseClient) GetCertificateResponder(resp *http.Response) (result CertificateBundle, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetCertificateContacts the GetCertificateContacts operation returns the set of certificate contact resources in the +// specified key vault. This operation requires the certificates/managecontacts permission. +// Parameters: +// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net. +func (client BaseClient) GetCertificateContacts(ctx context.Context, vaultBaseURL string) (result Contacts, err error) { + req, err := client.GetCertificateContactsPreparer(ctx, vaultBaseURL) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetCertificateContacts", nil, "Failure preparing request") + return + } + + resp, err := client.GetCertificateContactsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetCertificateContacts", resp, "Failure sending request") + return + } + + result, err = client.GetCertificateContactsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetCertificateContacts", resp, "Failure responding to request") + } + + return +} + +// GetCertificateContactsPreparer prepares the GetCertificateContacts request. +func (client BaseClient) GetCertificateContactsPreparer(ctx context.Context, vaultBaseURL string) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "vaultBaseUrl": vaultBaseURL, + } + + const APIVersion = "7.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters), + autorest.WithPath("/certificates/contacts"), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetCertificateContactsSender sends the GetCertificateContacts request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GetCertificateContactsSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetCertificateContactsResponder handles the response to the GetCertificateContacts request. The method always +// closes the http.Response Body. +func (client BaseClient) GetCertificateContactsResponder(resp *http.Response) (result Contacts, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetCertificateIssuer the GetCertificateIssuer operation returns the specified certificate issuer resources in the +// specified key vault. This operation requires the certificates/manageissuers/getissuers permission. +// Parameters: +// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net. +// issuerName - the name of the issuer. +func (client BaseClient) GetCertificateIssuer(ctx context.Context, vaultBaseURL string, issuerName string) (result IssuerBundle, err error) { + req, err := client.GetCertificateIssuerPreparer(ctx, vaultBaseURL, issuerName) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetCertificateIssuer", nil, "Failure preparing request") + return + } + + resp, err := client.GetCertificateIssuerSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetCertificateIssuer", resp, "Failure sending request") + return + } + + result, err = client.GetCertificateIssuerResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetCertificateIssuer", resp, "Failure responding to request") + } + + return +} + +// GetCertificateIssuerPreparer prepares the GetCertificateIssuer request. +func (client BaseClient) GetCertificateIssuerPreparer(ctx context.Context, vaultBaseURL string, issuerName string) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "vaultBaseUrl": vaultBaseURL, + } + + pathParameters := map[string]interface{}{ + "issuer-name": autorest.Encode("path", issuerName), + } + + const APIVersion = "7.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters), + autorest.WithPathParameters("/certificates/issuers/{issuer-name}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetCertificateIssuerSender sends the GetCertificateIssuer request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GetCertificateIssuerSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetCertificateIssuerResponder handles the response to the GetCertificateIssuer request. The method always +// closes the http.Response Body. +func (client BaseClient) GetCertificateIssuerResponder(resp *http.Response) (result IssuerBundle, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetCertificateIssuers the GetCertificateIssuers operation returns the set of certificate issuer resources in the +// specified key vault. This operation requires the certificates/manageissuers/getissuers permission. +// Parameters: +// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net. +// maxresults - maximum number of results to return in a page. If not specified the service will return up to +// 25 results. +func (client BaseClient) GetCertificateIssuers(ctx context.Context, vaultBaseURL string, maxresults *int32) (result CertificateIssuerListResultPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: maxresults, + Constraints: []validation.Constraint{{Target: "maxresults", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "maxresults", Name: validation.InclusiveMaximum, Rule: int64(25), Chain: nil}, + {Target: "maxresults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("keyvault.BaseClient", "GetCertificateIssuers", err.Error()) + } + + result.fn = client.getCertificateIssuersNextResults + req, err := client.GetCertificateIssuersPreparer(ctx, vaultBaseURL, maxresults) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetCertificateIssuers", nil, "Failure preparing request") + return + } + + resp, err := client.GetCertificateIssuersSender(req) + if err != nil { + result.cilr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetCertificateIssuers", resp, "Failure sending request") + return + } + + result.cilr, err = client.GetCertificateIssuersResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetCertificateIssuers", resp, "Failure responding to request") + } + + return +} + +// GetCertificateIssuersPreparer prepares the GetCertificateIssuers request. +func (client BaseClient) GetCertificateIssuersPreparer(ctx context.Context, vaultBaseURL string, maxresults *int32) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "vaultBaseUrl": vaultBaseURL, + } + + const APIVersion = "7.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if maxresults != nil { + queryParameters["maxresults"] = autorest.Encode("query", *maxresults) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters), + autorest.WithPath("/certificates/issuers"), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetCertificateIssuersSender sends the GetCertificateIssuers request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GetCertificateIssuersSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetCertificateIssuersResponder handles the response to the GetCertificateIssuers request. The method always +// closes the http.Response Body. +func (client BaseClient) GetCertificateIssuersResponder(resp *http.Response) (result CertificateIssuerListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// getCertificateIssuersNextResults retrieves the next set of results, if any. +func (client BaseClient) getCertificateIssuersNextResults(lastResults CertificateIssuerListResult) (result CertificateIssuerListResult, err error) { + req, err := lastResults.certificateIssuerListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "keyvault.BaseClient", "getCertificateIssuersNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.GetCertificateIssuersSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "keyvault.BaseClient", "getCertificateIssuersNextResults", resp, "Failure sending next results request") + } + result, err = client.GetCertificateIssuersResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "getCertificateIssuersNextResults", resp, "Failure responding to next results request") + } + return +} + +// GetCertificateIssuersComplete enumerates all values, automatically crossing page boundaries as required. +func (client BaseClient) GetCertificateIssuersComplete(ctx context.Context, vaultBaseURL string, maxresults *int32) (result CertificateIssuerListResultIterator, err error) { + result.page, err = client.GetCertificateIssuers(ctx, vaultBaseURL, maxresults) + return +} + +// GetCertificateOperation gets the creation operation associated with a specified certificate. This operation requires +// the certificates/get permission. +// Parameters: +// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net. +// certificateName - the name of the certificate. +func (client BaseClient) GetCertificateOperation(ctx context.Context, vaultBaseURL string, certificateName string) (result CertificateOperation, err error) { + req, err := client.GetCertificateOperationPreparer(ctx, vaultBaseURL, certificateName) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetCertificateOperation", nil, "Failure preparing request") + return + } + + resp, err := client.GetCertificateOperationSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetCertificateOperation", resp, "Failure sending request") + return + } + + result, err = client.GetCertificateOperationResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetCertificateOperation", resp, "Failure responding to request") + } + + return +} + +// GetCertificateOperationPreparer prepares the GetCertificateOperation request. +func (client BaseClient) GetCertificateOperationPreparer(ctx context.Context, vaultBaseURL string, certificateName string) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "vaultBaseUrl": vaultBaseURL, + } + + pathParameters := map[string]interface{}{ + "certificate-name": autorest.Encode("path", certificateName), + } + + const APIVersion = "7.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters), + autorest.WithPathParameters("/certificates/{certificate-name}/pending", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetCertificateOperationSender sends the GetCertificateOperation request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GetCertificateOperationSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetCertificateOperationResponder handles the response to the GetCertificateOperation request. The method always +// closes the http.Response Body. +func (client BaseClient) GetCertificateOperationResponder(resp *http.Response) (result CertificateOperation, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetCertificatePolicy the GetCertificatePolicy operation returns the specified certificate policy resources in the +// specified key vault. This operation requires the certificates/get permission. +// Parameters: +// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net. +// certificateName - the name of the certificate in a given key vault. +func (client BaseClient) GetCertificatePolicy(ctx context.Context, vaultBaseURL string, certificateName string) (result CertificatePolicy, err error) { + req, err := client.GetCertificatePolicyPreparer(ctx, vaultBaseURL, certificateName) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetCertificatePolicy", nil, "Failure preparing request") + return + } + + resp, err := client.GetCertificatePolicySender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetCertificatePolicy", resp, "Failure sending request") + return + } + + result, err = client.GetCertificatePolicyResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetCertificatePolicy", resp, "Failure responding to request") + } + + return +} + +// GetCertificatePolicyPreparer prepares the GetCertificatePolicy request. +func (client BaseClient) GetCertificatePolicyPreparer(ctx context.Context, vaultBaseURL string, certificateName string) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "vaultBaseUrl": vaultBaseURL, + } + + pathParameters := map[string]interface{}{ + "certificate-name": autorest.Encode("path", certificateName), + } + + const APIVersion = "7.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters), + autorest.WithPathParameters("/certificates/{certificate-name}/policy", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetCertificatePolicySender sends the GetCertificatePolicy request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GetCertificatePolicySender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetCertificatePolicyResponder handles the response to the GetCertificatePolicy request. The method always +// closes the http.Response Body. +func (client BaseClient) GetCertificatePolicyResponder(resp *http.Response) (result CertificatePolicy, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetCertificates the GetCertificates operation returns the set of certificates resources in the specified key vault. +// This operation requires the certificates/list permission. +// Parameters: +// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net. +// maxresults - maximum number of results to return in a page. If not specified the service will return up to +// 25 results. +// includePending - specifies whether to include certificates which are not completely provisioned. +func (client BaseClient) GetCertificates(ctx context.Context, vaultBaseURL string, maxresults *int32, includePending *bool) (result CertificateListResultPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: maxresults, + Constraints: []validation.Constraint{{Target: "maxresults", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "maxresults", Name: validation.InclusiveMaximum, Rule: int64(25), Chain: nil}, + {Target: "maxresults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("keyvault.BaseClient", "GetCertificates", err.Error()) + } + + result.fn = client.getCertificatesNextResults + req, err := client.GetCertificatesPreparer(ctx, vaultBaseURL, maxresults, includePending) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetCertificates", nil, "Failure preparing request") + return + } + + resp, err := client.GetCertificatesSender(req) + if err != nil { + result.clr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetCertificates", resp, "Failure sending request") + return + } + + result.clr, err = client.GetCertificatesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetCertificates", resp, "Failure responding to request") + } + + return +} + +// GetCertificatesPreparer prepares the GetCertificates request. +func (client BaseClient) GetCertificatesPreparer(ctx context.Context, vaultBaseURL string, maxresults *int32, includePending *bool) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "vaultBaseUrl": vaultBaseURL, + } + + const APIVersion = "7.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if maxresults != nil { + queryParameters["maxresults"] = autorest.Encode("query", *maxresults) + } + if includePending != nil { + queryParameters["includePending"] = autorest.Encode("query", *includePending) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters), + autorest.WithPath("/certificates"), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetCertificatesSender sends the GetCertificates request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GetCertificatesSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetCertificatesResponder handles the response to the GetCertificates request. The method always +// closes the http.Response Body. +func (client BaseClient) GetCertificatesResponder(resp *http.Response) (result CertificateListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// getCertificatesNextResults retrieves the next set of results, if any. +func (client BaseClient) getCertificatesNextResults(lastResults CertificateListResult) (result CertificateListResult, err error) { + req, err := lastResults.certificateListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "keyvault.BaseClient", "getCertificatesNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.GetCertificatesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "keyvault.BaseClient", "getCertificatesNextResults", resp, "Failure sending next results request") + } + result, err = client.GetCertificatesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "getCertificatesNextResults", resp, "Failure responding to next results request") + } + return +} + +// GetCertificatesComplete enumerates all values, automatically crossing page boundaries as required. +func (client BaseClient) GetCertificatesComplete(ctx context.Context, vaultBaseURL string, maxresults *int32, includePending *bool) (result CertificateListResultIterator, err error) { + result.page, err = client.GetCertificates(ctx, vaultBaseURL, maxresults, includePending) + return +} + +// GetCertificateVersions the GetCertificateVersions operation returns the versions of a certificate in the specified +// key vault. This operation requires the certificates/list permission. +// Parameters: +// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net. +// certificateName - the name of the certificate. +// maxresults - maximum number of results to return in a page. If not specified the service will return up to +// 25 results. +func (client BaseClient) GetCertificateVersions(ctx context.Context, vaultBaseURL string, certificateName string, maxresults *int32) (result CertificateListResultPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: maxresults, + Constraints: []validation.Constraint{{Target: "maxresults", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "maxresults", Name: validation.InclusiveMaximum, Rule: int64(25), Chain: nil}, + {Target: "maxresults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("keyvault.BaseClient", "GetCertificateVersions", err.Error()) + } + + result.fn = client.getCertificateVersionsNextResults + req, err := client.GetCertificateVersionsPreparer(ctx, vaultBaseURL, certificateName, maxresults) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetCertificateVersions", nil, "Failure preparing request") + return + } + + resp, err := client.GetCertificateVersionsSender(req) + if err != nil { + result.clr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetCertificateVersions", resp, "Failure sending request") + return + } + + result.clr, err = client.GetCertificateVersionsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetCertificateVersions", resp, "Failure responding to request") + } + + return +} + +// GetCertificateVersionsPreparer prepares the GetCertificateVersions request. +func (client BaseClient) GetCertificateVersionsPreparer(ctx context.Context, vaultBaseURL string, certificateName string, maxresults *int32) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "vaultBaseUrl": vaultBaseURL, + } + + pathParameters := map[string]interface{}{ + "certificate-name": autorest.Encode("path", certificateName), + } + + const APIVersion = "7.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if maxresults != nil { + queryParameters["maxresults"] = autorest.Encode("query", *maxresults) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters), + autorest.WithPathParameters("/certificates/{certificate-name}/versions", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetCertificateVersionsSender sends the GetCertificateVersions request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GetCertificateVersionsSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetCertificateVersionsResponder handles the response to the GetCertificateVersions request. The method always +// closes the http.Response Body. +func (client BaseClient) GetCertificateVersionsResponder(resp *http.Response) (result CertificateListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// getCertificateVersionsNextResults retrieves the next set of results, if any. +func (client BaseClient) getCertificateVersionsNextResults(lastResults CertificateListResult) (result CertificateListResult, err error) { + req, err := lastResults.certificateListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "keyvault.BaseClient", "getCertificateVersionsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.GetCertificateVersionsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "keyvault.BaseClient", "getCertificateVersionsNextResults", resp, "Failure sending next results request") + } + result, err = client.GetCertificateVersionsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "getCertificateVersionsNextResults", resp, "Failure responding to next results request") + } + return +} + +// GetCertificateVersionsComplete enumerates all values, automatically crossing page boundaries as required. +func (client BaseClient) GetCertificateVersionsComplete(ctx context.Context, vaultBaseURL string, certificateName string, maxresults *int32) (result CertificateListResultIterator, err error) { + result.page, err = client.GetCertificateVersions(ctx, vaultBaseURL, certificateName, maxresults) + return +} + +// GetDeletedCertificate the GetDeletedCertificate operation retrieves the deleted certificate information plus its +// attributes, such as retention interval, scheduled permanent deletion and the current deletion recovery level. This +// operation requires the certificates/get permission. +// Parameters: +// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net. +// certificateName - the name of the certificate +func (client BaseClient) GetDeletedCertificate(ctx context.Context, vaultBaseURL string, certificateName string) (result DeletedCertificateBundle, err error) { + req, err := client.GetDeletedCertificatePreparer(ctx, vaultBaseURL, certificateName) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetDeletedCertificate", nil, "Failure preparing request") + return + } + + resp, err := client.GetDeletedCertificateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetDeletedCertificate", resp, "Failure sending request") + return + } + + result, err = client.GetDeletedCertificateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetDeletedCertificate", resp, "Failure responding to request") + } + + return +} + +// GetDeletedCertificatePreparer prepares the GetDeletedCertificate request. +func (client BaseClient) GetDeletedCertificatePreparer(ctx context.Context, vaultBaseURL string, certificateName string) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "vaultBaseUrl": vaultBaseURL, + } + + pathParameters := map[string]interface{}{ + "certificate-name": autorest.Encode("path", certificateName), + } + + const APIVersion = "7.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters), + autorest.WithPathParameters("/deletedcertificates/{certificate-name}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetDeletedCertificateSender sends the GetDeletedCertificate request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GetDeletedCertificateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetDeletedCertificateResponder handles the response to the GetDeletedCertificate request. The method always +// closes the http.Response Body. +func (client BaseClient) GetDeletedCertificateResponder(resp *http.Response) (result DeletedCertificateBundle, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetDeletedCertificates the GetDeletedCertificates operation retrieves the certificates in the current vault which +// are in a deleted state and ready for recovery or purging. This operation includes deletion-specific information. +// This operation requires the certificates/get/list permission. This operation can only be enabled on soft-delete +// enabled vaults. +// Parameters: +// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net. +// maxresults - maximum number of results to return in a page. If not specified the service will return up to +// 25 results. +// includePending - specifies whether to include certificates which are not completely provisioned. +func (client BaseClient) GetDeletedCertificates(ctx context.Context, vaultBaseURL string, maxresults *int32, includePending *bool) (result DeletedCertificateListResultPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: maxresults, + Constraints: []validation.Constraint{{Target: "maxresults", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "maxresults", Name: validation.InclusiveMaximum, Rule: int64(25), Chain: nil}, + {Target: "maxresults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("keyvault.BaseClient", "GetDeletedCertificates", err.Error()) + } + + result.fn = client.getDeletedCertificatesNextResults + req, err := client.GetDeletedCertificatesPreparer(ctx, vaultBaseURL, maxresults, includePending) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetDeletedCertificates", nil, "Failure preparing request") + return + } + + resp, err := client.GetDeletedCertificatesSender(req) + if err != nil { + result.dclr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetDeletedCertificates", resp, "Failure sending request") + return + } + + result.dclr, err = client.GetDeletedCertificatesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetDeletedCertificates", resp, "Failure responding to request") + } + + return +} + +// GetDeletedCertificatesPreparer prepares the GetDeletedCertificates request. +func (client BaseClient) GetDeletedCertificatesPreparer(ctx context.Context, vaultBaseURL string, maxresults *int32, includePending *bool) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "vaultBaseUrl": vaultBaseURL, + } + + const APIVersion = "7.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if maxresults != nil { + queryParameters["maxresults"] = autorest.Encode("query", *maxresults) + } + if includePending != nil { + queryParameters["includePending"] = autorest.Encode("query", *includePending) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters), + autorest.WithPath("/deletedcertificates"), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetDeletedCertificatesSender sends the GetDeletedCertificates request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GetDeletedCertificatesSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetDeletedCertificatesResponder handles the response to the GetDeletedCertificates request. The method always +// closes the http.Response Body. +func (client BaseClient) GetDeletedCertificatesResponder(resp *http.Response) (result DeletedCertificateListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// getDeletedCertificatesNextResults retrieves the next set of results, if any. +func (client BaseClient) getDeletedCertificatesNextResults(lastResults DeletedCertificateListResult) (result DeletedCertificateListResult, err error) { + req, err := lastResults.deletedCertificateListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "keyvault.BaseClient", "getDeletedCertificatesNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.GetDeletedCertificatesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "keyvault.BaseClient", "getDeletedCertificatesNextResults", resp, "Failure sending next results request") + } + result, err = client.GetDeletedCertificatesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "getDeletedCertificatesNextResults", resp, "Failure responding to next results request") + } + return +} + +// GetDeletedCertificatesComplete enumerates all values, automatically crossing page boundaries as required. +func (client BaseClient) GetDeletedCertificatesComplete(ctx context.Context, vaultBaseURL string, maxresults *int32, includePending *bool) (result DeletedCertificateListResultIterator, err error) { + result.page, err = client.GetDeletedCertificates(ctx, vaultBaseURL, maxresults, includePending) + return +} + +// GetDeletedKey the Get Deleted Key operation is applicable for soft-delete enabled vaults. While the operation can be +// invoked on any vault, it will return an error if invoked on a non soft-delete enabled vault. This operation requires +// the keys/get permission. +// Parameters: +// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net. +// keyName - the name of the key. +func (client BaseClient) GetDeletedKey(ctx context.Context, vaultBaseURL string, keyName string) (result DeletedKeyBundle, err error) { + req, err := client.GetDeletedKeyPreparer(ctx, vaultBaseURL, keyName) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetDeletedKey", nil, "Failure preparing request") + return + } + + resp, err := client.GetDeletedKeySender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetDeletedKey", resp, "Failure sending request") + return + } + + result, err = client.GetDeletedKeyResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetDeletedKey", resp, "Failure responding to request") + } + + return +} + +// GetDeletedKeyPreparer prepares the GetDeletedKey request. +func (client BaseClient) GetDeletedKeyPreparer(ctx context.Context, vaultBaseURL string, keyName string) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "vaultBaseUrl": vaultBaseURL, + } + + pathParameters := map[string]interface{}{ + "key-name": autorest.Encode("path", keyName), + } + + const APIVersion = "7.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters), + autorest.WithPathParameters("/deletedkeys/{key-name}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetDeletedKeySender sends the GetDeletedKey request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GetDeletedKeySender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetDeletedKeyResponder handles the response to the GetDeletedKey request. The method always +// closes the http.Response Body. +func (client BaseClient) GetDeletedKeyResponder(resp *http.Response) (result DeletedKeyBundle, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetDeletedKeys retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the public part +// of a deleted key. This operation includes deletion-specific information. The Get Deleted Keys operation is +// applicable for vaults enabled for soft-delete. While the operation can be invoked on any vault, it will return an +// error if invoked on a non soft-delete enabled vault. This operation requires the keys/list permission. +// Parameters: +// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net. +// maxresults - maximum number of results to return in a page. If not specified the service will return up to +// 25 results. +func (client BaseClient) GetDeletedKeys(ctx context.Context, vaultBaseURL string, maxresults *int32) (result DeletedKeyListResultPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: maxresults, + Constraints: []validation.Constraint{{Target: "maxresults", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "maxresults", Name: validation.InclusiveMaximum, Rule: int64(25), Chain: nil}, + {Target: "maxresults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("keyvault.BaseClient", "GetDeletedKeys", err.Error()) + } + + result.fn = client.getDeletedKeysNextResults + req, err := client.GetDeletedKeysPreparer(ctx, vaultBaseURL, maxresults) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetDeletedKeys", nil, "Failure preparing request") + return + } + + resp, err := client.GetDeletedKeysSender(req) + if err != nil { + result.dklr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetDeletedKeys", resp, "Failure sending request") + return + } + + result.dklr, err = client.GetDeletedKeysResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetDeletedKeys", resp, "Failure responding to request") + } + + return +} + +// GetDeletedKeysPreparer prepares the GetDeletedKeys request. +func (client BaseClient) GetDeletedKeysPreparer(ctx context.Context, vaultBaseURL string, maxresults *int32) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "vaultBaseUrl": vaultBaseURL, + } + + const APIVersion = "7.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if maxresults != nil { + queryParameters["maxresults"] = autorest.Encode("query", *maxresults) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters), + autorest.WithPath("/deletedkeys"), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetDeletedKeysSender sends the GetDeletedKeys request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GetDeletedKeysSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetDeletedKeysResponder handles the response to the GetDeletedKeys request. The method always +// closes the http.Response Body. +func (client BaseClient) GetDeletedKeysResponder(resp *http.Response) (result DeletedKeyListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// getDeletedKeysNextResults retrieves the next set of results, if any. +func (client BaseClient) getDeletedKeysNextResults(lastResults DeletedKeyListResult) (result DeletedKeyListResult, err error) { + req, err := lastResults.deletedKeyListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "keyvault.BaseClient", "getDeletedKeysNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.GetDeletedKeysSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "keyvault.BaseClient", "getDeletedKeysNextResults", resp, "Failure sending next results request") + } + result, err = client.GetDeletedKeysResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "getDeletedKeysNextResults", resp, "Failure responding to next results request") + } + return +} + +// GetDeletedKeysComplete enumerates all values, automatically crossing page boundaries as required. +func (client BaseClient) GetDeletedKeysComplete(ctx context.Context, vaultBaseURL string, maxresults *int32) (result DeletedKeyListResultIterator, err error) { + result.page, err = client.GetDeletedKeys(ctx, vaultBaseURL, maxresults) + return +} + +// GetDeletedSasDefinition the Get Deleted SAS Definition operation returns the specified deleted SAS definition along +// with its attributes. This operation requires the storage/getsas permission. +// Parameters: +// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net. +// storageAccountName - the name of the storage account. +// sasDefinitionName - the name of the SAS definition. +func (client BaseClient) GetDeletedSasDefinition(ctx context.Context, vaultBaseURL string, storageAccountName string, sasDefinitionName string) (result DeletedSasDefinitionBundle, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: storageAccountName, + Constraints: []validation.Constraint{{Target: "storageAccountName", Name: validation.Pattern, Rule: `^[0-9a-zA-Z]+$`, Chain: nil}}}, + {TargetValue: sasDefinitionName, + Constraints: []validation.Constraint{{Target: "sasDefinitionName", Name: validation.Pattern, Rule: `^[0-9a-zA-Z]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("keyvault.BaseClient", "GetDeletedSasDefinition", err.Error()) + } + + req, err := client.GetDeletedSasDefinitionPreparer(ctx, vaultBaseURL, storageAccountName, sasDefinitionName) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetDeletedSasDefinition", nil, "Failure preparing request") + return + } + + resp, err := client.GetDeletedSasDefinitionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetDeletedSasDefinition", resp, "Failure sending request") + return + } + + result, err = client.GetDeletedSasDefinitionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetDeletedSasDefinition", resp, "Failure responding to request") + } + + return +} + +// GetDeletedSasDefinitionPreparer prepares the GetDeletedSasDefinition request. +func (client BaseClient) GetDeletedSasDefinitionPreparer(ctx context.Context, vaultBaseURL string, storageAccountName string, sasDefinitionName string) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "vaultBaseUrl": vaultBaseURL, + } + + pathParameters := map[string]interface{}{ + "sas-definition-name": autorest.Encode("path", sasDefinitionName), + "storage-account-name": autorest.Encode("path", storageAccountName), + } + + const APIVersion = "7.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters), + autorest.WithPathParameters("/deletedstorage/{storage-account-name}/sas/{sas-definition-name}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetDeletedSasDefinitionSender sends the GetDeletedSasDefinition request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GetDeletedSasDefinitionSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetDeletedSasDefinitionResponder handles the response to the GetDeletedSasDefinition request. The method always +// closes the http.Response Body. +func (client BaseClient) GetDeletedSasDefinitionResponder(resp *http.Response) (result DeletedSasDefinitionBundle, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetDeletedSasDefinitions the Get Deleted Sas Definitions operation returns the SAS definitions that have been +// deleted for a vault enabled for soft-delete. This operation requires the storage/listsas permission. +// Parameters: +// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net. +// storageAccountName - the name of the storage account. +// maxresults - maximum number of results to return in a page. If not specified the service will return up to +// 25 results. +func (client BaseClient) GetDeletedSasDefinitions(ctx context.Context, vaultBaseURL string, storageAccountName string, maxresults *int32) (result DeletedSasDefinitionListResultPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: storageAccountName, + Constraints: []validation.Constraint{{Target: "storageAccountName", Name: validation.Pattern, Rule: `^[0-9a-zA-Z]+$`, Chain: nil}}}, + {TargetValue: maxresults, + Constraints: []validation.Constraint{{Target: "maxresults", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "maxresults", Name: validation.InclusiveMaximum, Rule: int64(25), Chain: nil}, + {Target: "maxresults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("keyvault.BaseClient", "GetDeletedSasDefinitions", err.Error()) + } + + result.fn = client.getDeletedSasDefinitionsNextResults + req, err := client.GetDeletedSasDefinitionsPreparer(ctx, vaultBaseURL, storageAccountName, maxresults) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetDeletedSasDefinitions", nil, "Failure preparing request") + return + } + + resp, err := client.GetDeletedSasDefinitionsSender(req) + if err != nil { + result.dsdlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetDeletedSasDefinitions", resp, "Failure sending request") + return + } + + result.dsdlr, err = client.GetDeletedSasDefinitionsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetDeletedSasDefinitions", resp, "Failure responding to request") + } + + return +} + +// GetDeletedSasDefinitionsPreparer prepares the GetDeletedSasDefinitions request. +func (client BaseClient) GetDeletedSasDefinitionsPreparer(ctx context.Context, vaultBaseURL string, storageAccountName string, maxresults *int32) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "vaultBaseUrl": vaultBaseURL, + } + + pathParameters := map[string]interface{}{ + "storage-account-name": autorest.Encode("path", storageAccountName), + } + + const APIVersion = "7.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if maxresults != nil { + queryParameters["maxresults"] = autorest.Encode("query", *maxresults) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters), + autorest.WithPathParameters("/deletedstorage/{storage-account-name}/sas", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetDeletedSasDefinitionsSender sends the GetDeletedSasDefinitions request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GetDeletedSasDefinitionsSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetDeletedSasDefinitionsResponder handles the response to the GetDeletedSasDefinitions request. The method always +// closes the http.Response Body. +func (client BaseClient) GetDeletedSasDefinitionsResponder(resp *http.Response) (result DeletedSasDefinitionListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// getDeletedSasDefinitionsNextResults retrieves the next set of results, if any. +func (client BaseClient) getDeletedSasDefinitionsNextResults(lastResults DeletedSasDefinitionListResult) (result DeletedSasDefinitionListResult, err error) { + req, err := lastResults.deletedSasDefinitionListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "keyvault.BaseClient", "getDeletedSasDefinitionsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.GetDeletedSasDefinitionsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "keyvault.BaseClient", "getDeletedSasDefinitionsNextResults", resp, "Failure sending next results request") + } + result, err = client.GetDeletedSasDefinitionsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "getDeletedSasDefinitionsNextResults", resp, "Failure responding to next results request") + } + return +} + +// GetDeletedSasDefinitionsComplete enumerates all values, automatically crossing page boundaries as required. +func (client BaseClient) GetDeletedSasDefinitionsComplete(ctx context.Context, vaultBaseURL string, storageAccountName string, maxresults *int32) (result DeletedSasDefinitionListResultIterator, err error) { + result.page, err = client.GetDeletedSasDefinitions(ctx, vaultBaseURL, storageAccountName, maxresults) + return +} + +// GetDeletedSecret the Get Deleted Secret operation returns the specified deleted secret along with its attributes. +// This operation requires the secrets/get permission. +// Parameters: +// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net. +// secretName - the name of the secret. +func (client BaseClient) GetDeletedSecret(ctx context.Context, vaultBaseURL string, secretName string) (result DeletedSecretBundle, err error) { + req, err := client.GetDeletedSecretPreparer(ctx, vaultBaseURL, secretName) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetDeletedSecret", nil, "Failure preparing request") + return + } + + resp, err := client.GetDeletedSecretSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetDeletedSecret", resp, "Failure sending request") + return + } + + result, err = client.GetDeletedSecretResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetDeletedSecret", resp, "Failure responding to request") + } + + return +} + +// GetDeletedSecretPreparer prepares the GetDeletedSecret request. +func (client BaseClient) GetDeletedSecretPreparer(ctx context.Context, vaultBaseURL string, secretName string) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "vaultBaseUrl": vaultBaseURL, + } + + pathParameters := map[string]interface{}{ + "secret-name": autorest.Encode("path", secretName), + } + + const APIVersion = "7.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters), + autorest.WithPathParameters("/deletedsecrets/{secret-name}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetDeletedSecretSender sends the GetDeletedSecret request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GetDeletedSecretSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetDeletedSecretResponder handles the response to the GetDeletedSecret request. The method always +// closes the http.Response Body. +func (client BaseClient) GetDeletedSecretResponder(resp *http.Response) (result DeletedSecretBundle, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetDeletedSecrets the Get Deleted Secrets operation returns the secrets that have been deleted for a vault enabled +// for soft-delete. This operation requires the secrets/list permission. +// Parameters: +// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net. +// maxresults - maximum number of results to return in a page. If not specified the service will return up to +// 25 results. +func (client BaseClient) GetDeletedSecrets(ctx context.Context, vaultBaseURL string, maxresults *int32) (result DeletedSecretListResultPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: maxresults, + Constraints: []validation.Constraint{{Target: "maxresults", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "maxresults", Name: validation.InclusiveMaximum, Rule: int64(25), Chain: nil}, + {Target: "maxresults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("keyvault.BaseClient", "GetDeletedSecrets", err.Error()) + } + + result.fn = client.getDeletedSecretsNextResults + req, err := client.GetDeletedSecretsPreparer(ctx, vaultBaseURL, maxresults) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetDeletedSecrets", nil, "Failure preparing request") + return + } + + resp, err := client.GetDeletedSecretsSender(req) + if err != nil { + result.dslr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetDeletedSecrets", resp, "Failure sending request") + return + } + + result.dslr, err = client.GetDeletedSecretsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetDeletedSecrets", resp, "Failure responding to request") + } + + return +} + +// GetDeletedSecretsPreparer prepares the GetDeletedSecrets request. +func (client BaseClient) GetDeletedSecretsPreparer(ctx context.Context, vaultBaseURL string, maxresults *int32) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "vaultBaseUrl": vaultBaseURL, + } + + const APIVersion = "7.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if maxresults != nil { + queryParameters["maxresults"] = autorest.Encode("query", *maxresults) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters), + autorest.WithPath("/deletedsecrets"), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetDeletedSecretsSender sends the GetDeletedSecrets request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GetDeletedSecretsSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetDeletedSecretsResponder handles the response to the GetDeletedSecrets request. The method always +// closes the http.Response Body. +func (client BaseClient) GetDeletedSecretsResponder(resp *http.Response) (result DeletedSecretListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// getDeletedSecretsNextResults retrieves the next set of results, if any. +func (client BaseClient) getDeletedSecretsNextResults(lastResults DeletedSecretListResult) (result DeletedSecretListResult, err error) { + req, err := lastResults.deletedSecretListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "keyvault.BaseClient", "getDeletedSecretsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.GetDeletedSecretsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "keyvault.BaseClient", "getDeletedSecretsNextResults", resp, "Failure sending next results request") + } + result, err = client.GetDeletedSecretsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "getDeletedSecretsNextResults", resp, "Failure responding to next results request") + } + return +} + +// GetDeletedSecretsComplete enumerates all values, automatically crossing page boundaries as required. +func (client BaseClient) GetDeletedSecretsComplete(ctx context.Context, vaultBaseURL string, maxresults *int32) (result DeletedSecretListResultIterator, err error) { + result.page, err = client.GetDeletedSecrets(ctx, vaultBaseURL, maxresults) + return +} + +// GetDeletedStorageAccount the Get Deleted Storage Account operation returns the specified deleted storage account +// along with its attributes. This operation requires the storage/get permission. +// Parameters: +// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net. +// storageAccountName - the name of the storage account. +func (client BaseClient) GetDeletedStorageAccount(ctx context.Context, vaultBaseURL string, storageAccountName string) (result DeletedStorageBundle, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: storageAccountName, + Constraints: []validation.Constraint{{Target: "storageAccountName", Name: validation.Pattern, Rule: `^[0-9a-zA-Z]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("keyvault.BaseClient", "GetDeletedStorageAccount", err.Error()) + } + + req, err := client.GetDeletedStorageAccountPreparer(ctx, vaultBaseURL, storageAccountName) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetDeletedStorageAccount", nil, "Failure preparing request") + return + } + + resp, err := client.GetDeletedStorageAccountSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetDeletedStorageAccount", resp, "Failure sending request") + return + } + + result, err = client.GetDeletedStorageAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetDeletedStorageAccount", resp, "Failure responding to request") + } + + return +} + +// GetDeletedStorageAccountPreparer prepares the GetDeletedStorageAccount request. +func (client BaseClient) GetDeletedStorageAccountPreparer(ctx context.Context, vaultBaseURL string, storageAccountName string) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "vaultBaseUrl": vaultBaseURL, + } + + pathParameters := map[string]interface{}{ + "storage-account-name": autorest.Encode("path", storageAccountName), + } + + const APIVersion = "7.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters), + autorest.WithPathParameters("/deletedstorage/{storage-account-name}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetDeletedStorageAccountSender sends the GetDeletedStorageAccount request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GetDeletedStorageAccountSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetDeletedStorageAccountResponder handles the response to the GetDeletedStorageAccount request. The method always +// closes the http.Response Body. +func (client BaseClient) GetDeletedStorageAccountResponder(resp *http.Response) (result DeletedStorageBundle, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetDeletedStorageAccounts the Get Deleted Storage Accounts operation returns the storage accounts that have been +// deleted for a vault enabled for soft-delete. This operation requires the storage/list permission. +// Parameters: +// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net. +// maxresults - maximum number of results to return in a page. If not specified the service will return up to +// 25 results. +func (client BaseClient) GetDeletedStorageAccounts(ctx context.Context, vaultBaseURL string, maxresults *int32) (result DeletedStorageListResultPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: maxresults, + Constraints: []validation.Constraint{{Target: "maxresults", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "maxresults", Name: validation.InclusiveMaximum, Rule: int64(25), Chain: nil}, + {Target: "maxresults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("keyvault.BaseClient", "GetDeletedStorageAccounts", err.Error()) + } + + result.fn = client.getDeletedStorageAccountsNextResults + req, err := client.GetDeletedStorageAccountsPreparer(ctx, vaultBaseURL, maxresults) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetDeletedStorageAccounts", nil, "Failure preparing request") + return + } + + resp, err := client.GetDeletedStorageAccountsSender(req) + if err != nil { + result.dslr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetDeletedStorageAccounts", resp, "Failure sending request") + return + } + + result.dslr, err = client.GetDeletedStorageAccountsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetDeletedStorageAccounts", resp, "Failure responding to request") + } + + return +} + +// GetDeletedStorageAccountsPreparer prepares the GetDeletedStorageAccounts request. +func (client BaseClient) GetDeletedStorageAccountsPreparer(ctx context.Context, vaultBaseURL string, maxresults *int32) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "vaultBaseUrl": vaultBaseURL, + } + + const APIVersion = "7.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if maxresults != nil { + queryParameters["maxresults"] = autorest.Encode("query", *maxresults) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters), + autorest.WithPath("/deletedstorage"), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetDeletedStorageAccountsSender sends the GetDeletedStorageAccounts request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GetDeletedStorageAccountsSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetDeletedStorageAccountsResponder handles the response to the GetDeletedStorageAccounts request. The method always +// closes the http.Response Body. +func (client BaseClient) GetDeletedStorageAccountsResponder(resp *http.Response) (result DeletedStorageListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// getDeletedStorageAccountsNextResults retrieves the next set of results, if any. +func (client BaseClient) getDeletedStorageAccountsNextResults(lastResults DeletedStorageListResult) (result DeletedStorageListResult, err error) { + req, err := lastResults.deletedStorageListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "keyvault.BaseClient", "getDeletedStorageAccountsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.GetDeletedStorageAccountsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "keyvault.BaseClient", "getDeletedStorageAccountsNextResults", resp, "Failure sending next results request") + } + result, err = client.GetDeletedStorageAccountsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "getDeletedStorageAccountsNextResults", resp, "Failure responding to next results request") + } + return +} + +// GetDeletedStorageAccountsComplete enumerates all values, automatically crossing page boundaries as required. +func (client BaseClient) GetDeletedStorageAccountsComplete(ctx context.Context, vaultBaseURL string, maxresults *int32) (result DeletedStorageListResultIterator, err error) { + result.page, err = client.GetDeletedStorageAccounts(ctx, vaultBaseURL, maxresults) + return +} + +// GetKey the get key operation is applicable to all key types. If the requested key is symmetric, then no key material +// is released in the response. This operation requires the keys/get permission. +// Parameters: +// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net. +// keyName - the name of the key to get. +// keyVersion - adding the version parameter retrieves a specific version of a key. +func (client BaseClient) GetKey(ctx context.Context, vaultBaseURL string, keyName string, keyVersion string) (result KeyBundle, err error) { + req, err := client.GetKeyPreparer(ctx, vaultBaseURL, keyName, keyVersion) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetKey", nil, "Failure preparing request") + return + } + + resp, err := client.GetKeySender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetKey", resp, "Failure sending request") + return + } + + result, err = client.GetKeyResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetKey", resp, "Failure responding to request") + } + + return +} + +// GetKeyPreparer prepares the GetKey request. +func (client BaseClient) GetKeyPreparer(ctx context.Context, vaultBaseURL string, keyName string, keyVersion string) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "vaultBaseUrl": vaultBaseURL, + } + + pathParameters := map[string]interface{}{ + "key-name": autorest.Encode("path", keyName), + "key-version": autorest.Encode("path", keyVersion), + } + + const APIVersion = "7.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters), + autorest.WithPathParameters("/keys/{key-name}/{key-version}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetKeySender sends the GetKey request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GetKeySender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetKeyResponder handles the response to the GetKey request. The method always +// closes the http.Response Body. +func (client BaseClient) GetKeyResponder(resp *http.Response) (result KeyBundle, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetKeys retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the public part of a +// stored key. The LIST operation is applicable to all key types, however only the base key identifier, attributes, and +// tags are provided in the response. Individual versions of a key are not listed in the response. This operation +// requires the keys/list permission. +// Parameters: +// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net. +// maxresults - maximum number of results to return in a page. If not specified the service will return up to +// 25 results. +func (client BaseClient) GetKeys(ctx context.Context, vaultBaseURL string, maxresults *int32) (result KeyListResultPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: maxresults, + Constraints: []validation.Constraint{{Target: "maxresults", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "maxresults", Name: validation.InclusiveMaximum, Rule: int64(25), Chain: nil}, + {Target: "maxresults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("keyvault.BaseClient", "GetKeys", err.Error()) + } + + result.fn = client.getKeysNextResults + req, err := client.GetKeysPreparer(ctx, vaultBaseURL, maxresults) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetKeys", nil, "Failure preparing request") + return + } + + resp, err := client.GetKeysSender(req) + if err != nil { + result.klr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetKeys", resp, "Failure sending request") + return + } + + result.klr, err = client.GetKeysResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetKeys", resp, "Failure responding to request") + } + + return +} + +// GetKeysPreparer prepares the GetKeys request. +func (client BaseClient) GetKeysPreparer(ctx context.Context, vaultBaseURL string, maxresults *int32) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "vaultBaseUrl": vaultBaseURL, + } + + const APIVersion = "7.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if maxresults != nil { + queryParameters["maxresults"] = autorest.Encode("query", *maxresults) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters), + autorest.WithPath("/keys"), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetKeysSender sends the GetKeys request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GetKeysSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetKeysResponder handles the response to the GetKeys request. The method always +// closes the http.Response Body. +func (client BaseClient) GetKeysResponder(resp *http.Response) (result KeyListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// getKeysNextResults retrieves the next set of results, if any. +func (client BaseClient) getKeysNextResults(lastResults KeyListResult) (result KeyListResult, err error) { + req, err := lastResults.keyListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "keyvault.BaseClient", "getKeysNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.GetKeysSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "keyvault.BaseClient", "getKeysNextResults", resp, "Failure sending next results request") + } + result, err = client.GetKeysResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "getKeysNextResults", resp, "Failure responding to next results request") + } + return +} + +// GetKeysComplete enumerates all values, automatically crossing page boundaries as required. +func (client BaseClient) GetKeysComplete(ctx context.Context, vaultBaseURL string, maxresults *int32) (result KeyListResultIterator, err error) { + result.page, err = client.GetKeys(ctx, vaultBaseURL, maxresults) + return +} + +// GetKeyVersions the full key identifier, attributes, and tags are provided in the response. This operation requires +// the keys/list permission. +// Parameters: +// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net. +// keyName - the name of the key. +// maxresults - maximum number of results to return in a page. If not specified the service will return up to +// 25 results. +func (client BaseClient) GetKeyVersions(ctx context.Context, vaultBaseURL string, keyName string, maxresults *int32) (result KeyListResultPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: maxresults, + Constraints: []validation.Constraint{{Target: "maxresults", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "maxresults", Name: validation.InclusiveMaximum, Rule: int64(25), Chain: nil}, + {Target: "maxresults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("keyvault.BaseClient", "GetKeyVersions", err.Error()) + } + + result.fn = client.getKeyVersionsNextResults + req, err := client.GetKeyVersionsPreparer(ctx, vaultBaseURL, keyName, maxresults) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetKeyVersions", nil, "Failure preparing request") + return + } + + resp, err := client.GetKeyVersionsSender(req) + if err != nil { + result.klr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetKeyVersions", resp, "Failure sending request") + return + } + + result.klr, err = client.GetKeyVersionsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetKeyVersions", resp, "Failure responding to request") + } + + return +} + +// GetKeyVersionsPreparer prepares the GetKeyVersions request. +func (client BaseClient) GetKeyVersionsPreparer(ctx context.Context, vaultBaseURL string, keyName string, maxresults *int32) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "vaultBaseUrl": vaultBaseURL, + } + + pathParameters := map[string]interface{}{ + "key-name": autorest.Encode("path", keyName), + } + + const APIVersion = "7.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if maxresults != nil { + queryParameters["maxresults"] = autorest.Encode("query", *maxresults) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters), + autorest.WithPathParameters("/keys/{key-name}/versions", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetKeyVersionsSender sends the GetKeyVersions request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GetKeyVersionsSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetKeyVersionsResponder handles the response to the GetKeyVersions request. The method always +// closes the http.Response Body. +func (client BaseClient) GetKeyVersionsResponder(resp *http.Response) (result KeyListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// getKeyVersionsNextResults retrieves the next set of results, if any. +func (client BaseClient) getKeyVersionsNextResults(lastResults KeyListResult) (result KeyListResult, err error) { + req, err := lastResults.keyListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "keyvault.BaseClient", "getKeyVersionsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.GetKeyVersionsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "keyvault.BaseClient", "getKeyVersionsNextResults", resp, "Failure sending next results request") + } + result, err = client.GetKeyVersionsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "getKeyVersionsNextResults", resp, "Failure responding to next results request") + } + return +} + +// GetKeyVersionsComplete enumerates all values, automatically crossing page boundaries as required. +func (client BaseClient) GetKeyVersionsComplete(ctx context.Context, vaultBaseURL string, keyName string, maxresults *int32) (result KeyListResultIterator, err error) { + result.page, err = client.GetKeyVersions(ctx, vaultBaseURL, keyName, maxresults) + return +} + +// GetSasDefinition gets information about a SAS definition for the specified storage account. This operation requires +// the storage/getsas permission. +// Parameters: +// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net. +// storageAccountName - the name of the storage account. +// sasDefinitionName - the name of the SAS definition. +func (client BaseClient) GetSasDefinition(ctx context.Context, vaultBaseURL string, storageAccountName string, sasDefinitionName string) (result SasDefinitionBundle, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: storageAccountName, + Constraints: []validation.Constraint{{Target: "storageAccountName", Name: validation.Pattern, Rule: `^[0-9a-zA-Z]+$`, Chain: nil}}}, + {TargetValue: sasDefinitionName, + Constraints: []validation.Constraint{{Target: "sasDefinitionName", Name: validation.Pattern, Rule: `^[0-9a-zA-Z]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("keyvault.BaseClient", "GetSasDefinition", err.Error()) + } + + req, err := client.GetSasDefinitionPreparer(ctx, vaultBaseURL, storageAccountName, sasDefinitionName) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetSasDefinition", nil, "Failure preparing request") + return + } + + resp, err := client.GetSasDefinitionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetSasDefinition", resp, "Failure sending request") + return + } + + result, err = client.GetSasDefinitionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetSasDefinition", resp, "Failure responding to request") + } + + return +} + +// GetSasDefinitionPreparer prepares the GetSasDefinition request. +func (client BaseClient) GetSasDefinitionPreparer(ctx context.Context, vaultBaseURL string, storageAccountName string, sasDefinitionName string) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "vaultBaseUrl": vaultBaseURL, + } + + pathParameters := map[string]interface{}{ + "sas-definition-name": autorest.Encode("path", sasDefinitionName), + "storage-account-name": autorest.Encode("path", storageAccountName), + } + + const APIVersion = "7.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters), + autorest.WithPathParameters("/storage/{storage-account-name}/sas/{sas-definition-name}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSasDefinitionSender sends the GetSasDefinition request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GetSasDefinitionSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetSasDefinitionResponder handles the response to the GetSasDefinition request. The method always +// closes the http.Response Body. +func (client BaseClient) GetSasDefinitionResponder(resp *http.Response) (result SasDefinitionBundle, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetSasDefinitions list storage SAS definitions for the given storage account. This operation requires the +// storage/listsas permission. +// Parameters: +// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net. +// storageAccountName - the name of the storage account. +// maxresults - maximum number of results to return in a page. If not specified the service will return up to +// 25 results. +func (client BaseClient) GetSasDefinitions(ctx context.Context, vaultBaseURL string, storageAccountName string, maxresults *int32) (result SasDefinitionListResultPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: storageAccountName, + Constraints: []validation.Constraint{{Target: "storageAccountName", Name: validation.Pattern, Rule: `^[0-9a-zA-Z]+$`, Chain: nil}}}, + {TargetValue: maxresults, + Constraints: []validation.Constraint{{Target: "maxresults", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "maxresults", Name: validation.InclusiveMaximum, Rule: int64(25), Chain: nil}, + {Target: "maxresults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("keyvault.BaseClient", "GetSasDefinitions", err.Error()) + } + + result.fn = client.getSasDefinitionsNextResults + req, err := client.GetSasDefinitionsPreparer(ctx, vaultBaseURL, storageAccountName, maxresults) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetSasDefinitions", nil, "Failure preparing request") + return + } + + resp, err := client.GetSasDefinitionsSender(req) + if err != nil { + result.sdlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetSasDefinitions", resp, "Failure sending request") + return + } + + result.sdlr, err = client.GetSasDefinitionsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetSasDefinitions", resp, "Failure responding to request") + } + + return +} + +// GetSasDefinitionsPreparer prepares the GetSasDefinitions request. +func (client BaseClient) GetSasDefinitionsPreparer(ctx context.Context, vaultBaseURL string, storageAccountName string, maxresults *int32) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "vaultBaseUrl": vaultBaseURL, + } + + pathParameters := map[string]interface{}{ + "storage-account-name": autorest.Encode("path", storageAccountName), + } + + const APIVersion = "7.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if maxresults != nil { + queryParameters["maxresults"] = autorest.Encode("query", *maxresults) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters), + autorest.WithPathParameters("/storage/{storage-account-name}/sas", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSasDefinitionsSender sends the GetSasDefinitions request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GetSasDefinitionsSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetSasDefinitionsResponder handles the response to the GetSasDefinitions request. The method always +// closes the http.Response Body. +func (client BaseClient) GetSasDefinitionsResponder(resp *http.Response) (result SasDefinitionListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// getSasDefinitionsNextResults retrieves the next set of results, if any. +func (client BaseClient) getSasDefinitionsNextResults(lastResults SasDefinitionListResult) (result SasDefinitionListResult, err error) { + req, err := lastResults.sasDefinitionListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "keyvault.BaseClient", "getSasDefinitionsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.GetSasDefinitionsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "keyvault.BaseClient", "getSasDefinitionsNextResults", resp, "Failure sending next results request") + } + result, err = client.GetSasDefinitionsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "getSasDefinitionsNextResults", resp, "Failure responding to next results request") + } + return +} + +// GetSasDefinitionsComplete enumerates all values, automatically crossing page boundaries as required. +func (client BaseClient) GetSasDefinitionsComplete(ctx context.Context, vaultBaseURL string, storageAccountName string, maxresults *int32) (result SasDefinitionListResultIterator, err error) { + result.page, err = client.GetSasDefinitions(ctx, vaultBaseURL, storageAccountName, maxresults) + return +} + +// GetSecret the GET operation is applicable to any secret stored in Azure Key Vault. This operation requires the +// secrets/get permission. +// Parameters: +// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net. +// secretName - the name of the secret. +// secretVersion - the version of the secret. +func (client BaseClient) GetSecret(ctx context.Context, vaultBaseURL string, secretName string, secretVersion string) (result SecretBundle, err error) { + req, err := client.GetSecretPreparer(ctx, vaultBaseURL, secretName, secretVersion) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetSecret", nil, "Failure preparing request") + return + } + + resp, err := client.GetSecretSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetSecret", resp, "Failure sending request") + return + } + + result, err = client.GetSecretResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetSecret", resp, "Failure responding to request") + } + + return +} + +// GetSecretPreparer prepares the GetSecret request. +func (client BaseClient) GetSecretPreparer(ctx context.Context, vaultBaseURL string, secretName string, secretVersion string) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "vaultBaseUrl": vaultBaseURL, + } + + pathParameters := map[string]interface{}{ + "secret-name": autorest.Encode("path", secretName), + "secret-version": autorest.Encode("path", secretVersion), + } + + const APIVersion = "7.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters), + autorest.WithPathParameters("/secrets/{secret-name}/{secret-version}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSecretSender sends the GetSecret request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GetSecretSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetSecretResponder handles the response to the GetSecret request. The method always +// closes the http.Response Body. +func (client BaseClient) GetSecretResponder(resp *http.Response) (result SecretBundle, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetSecrets the Get Secrets operation is applicable to the entire vault. However, only the base secret identifier and +// its attributes are provided in the response. Individual secret versions are not listed in the response. This +// operation requires the secrets/list permission. +// Parameters: +// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net. +// maxresults - maximum number of results to return in a page. If not specified, the service will return up to +// 25 results. +func (client BaseClient) GetSecrets(ctx context.Context, vaultBaseURL string, maxresults *int32) (result SecretListResultPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: maxresults, + Constraints: []validation.Constraint{{Target: "maxresults", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "maxresults", Name: validation.InclusiveMaximum, Rule: int64(25), Chain: nil}, + {Target: "maxresults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("keyvault.BaseClient", "GetSecrets", err.Error()) + } + + result.fn = client.getSecretsNextResults + req, err := client.GetSecretsPreparer(ctx, vaultBaseURL, maxresults) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetSecrets", nil, "Failure preparing request") + return + } + + resp, err := client.GetSecretsSender(req) + if err != nil { + result.slr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetSecrets", resp, "Failure sending request") + return + } + + result.slr, err = client.GetSecretsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetSecrets", resp, "Failure responding to request") + } + + return +} + +// GetSecretsPreparer prepares the GetSecrets request. +func (client BaseClient) GetSecretsPreparer(ctx context.Context, vaultBaseURL string, maxresults *int32) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "vaultBaseUrl": vaultBaseURL, + } + + const APIVersion = "7.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if maxresults != nil { + queryParameters["maxresults"] = autorest.Encode("query", *maxresults) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters), + autorest.WithPath("/secrets"), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSecretsSender sends the GetSecrets request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GetSecretsSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetSecretsResponder handles the response to the GetSecrets request. The method always +// closes the http.Response Body. +func (client BaseClient) GetSecretsResponder(resp *http.Response) (result SecretListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// getSecretsNextResults retrieves the next set of results, if any. +func (client BaseClient) getSecretsNextResults(lastResults SecretListResult) (result SecretListResult, err error) { + req, err := lastResults.secretListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "keyvault.BaseClient", "getSecretsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.GetSecretsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "keyvault.BaseClient", "getSecretsNextResults", resp, "Failure sending next results request") + } + result, err = client.GetSecretsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "getSecretsNextResults", resp, "Failure responding to next results request") + } + return +} + +// GetSecretsComplete enumerates all values, automatically crossing page boundaries as required. +func (client BaseClient) GetSecretsComplete(ctx context.Context, vaultBaseURL string, maxresults *int32) (result SecretListResultIterator, err error) { + result.page, err = client.GetSecrets(ctx, vaultBaseURL, maxresults) + return +} + +// GetSecretVersions the full secret identifier and attributes are provided in the response. No values are returned for +// the secrets. This operations requires the secrets/list permission. +// Parameters: +// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net. +// secretName - the name of the secret. +// maxresults - maximum number of results to return in a page. If not specified, the service will return up to +// 25 results. +func (client BaseClient) GetSecretVersions(ctx context.Context, vaultBaseURL string, secretName string, maxresults *int32) (result SecretListResultPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: maxresults, + Constraints: []validation.Constraint{{Target: "maxresults", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "maxresults", Name: validation.InclusiveMaximum, Rule: int64(25), Chain: nil}, + {Target: "maxresults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("keyvault.BaseClient", "GetSecretVersions", err.Error()) + } + + result.fn = client.getSecretVersionsNextResults + req, err := client.GetSecretVersionsPreparer(ctx, vaultBaseURL, secretName, maxresults) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetSecretVersions", nil, "Failure preparing request") + return + } + + resp, err := client.GetSecretVersionsSender(req) + if err != nil { + result.slr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetSecretVersions", resp, "Failure sending request") + return + } + + result.slr, err = client.GetSecretVersionsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetSecretVersions", resp, "Failure responding to request") + } + + return +} + +// GetSecretVersionsPreparer prepares the GetSecretVersions request. +func (client BaseClient) GetSecretVersionsPreparer(ctx context.Context, vaultBaseURL string, secretName string, maxresults *int32) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "vaultBaseUrl": vaultBaseURL, + } + + pathParameters := map[string]interface{}{ + "secret-name": autorest.Encode("path", secretName), + } + + const APIVersion = "7.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if maxresults != nil { + queryParameters["maxresults"] = autorest.Encode("query", *maxresults) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters), + autorest.WithPathParameters("/secrets/{secret-name}/versions", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSecretVersionsSender sends the GetSecretVersions request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GetSecretVersionsSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetSecretVersionsResponder handles the response to the GetSecretVersions request. The method always +// closes the http.Response Body. +func (client BaseClient) GetSecretVersionsResponder(resp *http.Response) (result SecretListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// getSecretVersionsNextResults retrieves the next set of results, if any. +func (client BaseClient) getSecretVersionsNextResults(lastResults SecretListResult) (result SecretListResult, err error) { + req, err := lastResults.secretListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "keyvault.BaseClient", "getSecretVersionsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.GetSecretVersionsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "keyvault.BaseClient", "getSecretVersionsNextResults", resp, "Failure sending next results request") + } + result, err = client.GetSecretVersionsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "getSecretVersionsNextResults", resp, "Failure responding to next results request") + } + return +} + +// GetSecretVersionsComplete enumerates all values, automatically crossing page boundaries as required. +func (client BaseClient) GetSecretVersionsComplete(ctx context.Context, vaultBaseURL string, secretName string, maxresults *int32) (result SecretListResultIterator, err error) { + result.page, err = client.GetSecretVersions(ctx, vaultBaseURL, secretName, maxresults) + return +} + +// GetStorageAccount gets information about a specified storage account. This operation requires the storage/get +// permission. +// Parameters: +// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net. +// storageAccountName - the name of the storage account. +func (client BaseClient) GetStorageAccount(ctx context.Context, vaultBaseURL string, storageAccountName string) (result StorageBundle, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: storageAccountName, + Constraints: []validation.Constraint{{Target: "storageAccountName", Name: validation.Pattern, Rule: `^[0-9a-zA-Z]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("keyvault.BaseClient", "GetStorageAccount", err.Error()) + } + + req, err := client.GetStorageAccountPreparer(ctx, vaultBaseURL, storageAccountName) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetStorageAccount", nil, "Failure preparing request") + return + } + + resp, err := client.GetStorageAccountSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetStorageAccount", resp, "Failure sending request") + return + } + + result, err = client.GetStorageAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetStorageAccount", resp, "Failure responding to request") + } + + return +} + +// GetStorageAccountPreparer prepares the GetStorageAccount request. +func (client BaseClient) GetStorageAccountPreparer(ctx context.Context, vaultBaseURL string, storageAccountName string) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "vaultBaseUrl": vaultBaseURL, + } + + pathParameters := map[string]interface{}{ + "storage-account-name": autorest.Encode("path", storageAccountName), + } + + const APIVersion = "7.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters), + autorest.WithPathParameters("/storage/{storage-account-name}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetStorageAccountSender sends the GetStorageAccount request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GetStorageAccountSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetStorageAccountResponder handles the response to the GetStorageAccount request. The method always +// closes the http.Response Body. +func (client BaseClient) GetStorageAccountResponder(resp *http.Response) (result StorageBundle, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetStorageAccounts list storage accounts managed by the specified key vault. This operation requires the +// storage/list permission. +// Parameters: +// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net. +// maxresults - maximum number of results to return in a page. If not specified the service will return up to +// 25 results. +func (client BaseClient) GetStorageAccounts(ctx context.Context, vaultBaseURL string, maxresults *int32) (result StorageListResultPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: maxresults, + Constraints: []validation.Constraint{{Target: "maxresults", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "maxresults", Name: validation.InclusiveMaximum, Rule: int64(25), Chain: nil}, + {Target: "maxresults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("keyvault.BaseClient", "GetStorageAccounts", err.Error()) + } + + result.fn = client.getStorageAccountsNextResults + req, err := client.GetStorageAccountsPreparer(ctx, vaultBaseURL, maxresults) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetStorageAccounts", nil, "Failure preparing request") + return + } + + resp, err := client.GetStorageAccountsSender(req) + if err != nil { + result.slr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetStorageAccounts", resp, "Failure sending request") + return + } + + result.slr, err = client.GetStorageAccountsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetStorageAccounts", resp, "Failure responding to request") + } + + return +} + +// GetStorageAccountsPreparer prepares the GetStorageAccounts request. +func (client BaseClient) GetStorageAccountsPreparer(ctx context.Context, vaultBaseURL string, maxresults *int32) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "vaultBaseUrl": vaultBaseURL, + } + + const APIVersion = "7.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if maxresults != nil { + queryParameters["maxresults"] = autorest.Encode("query", *maxresults) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters), + autorest.WithPath("/storage"), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetStorageAccountsSender sends the GetStorageAccounts request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GetStorageAccountsSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetStorageAccountsResponder handles the response to the GetStorageAccounts request. The method always +// closes the http.Response Body. +func (client BaseClient) GetStorageAccountsResponder(resp *http.Response) (result StorageListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// getStorageAccountsNextResults retrieves the next set of results, if any. +func (client BaseClient) getStorageAccountsNextResults(lastResults StorageListResult) (result StorageListResult, err error) { + req, err := lastResults.storageListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "keyvault.BaseClient", "getStorageAccountsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.GetStorageAccountsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "keyvault.BaseClient", "getStorageAccountsNextResults", resp, "Failure sending next results request") + } + result, err = client.GetStorageAccountsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "getStorageAccountsNextResults", resp, "Failure responding to next results request") + } + return +} + +// GetStorageAccountsComplete enumerates all values, automatically crossing page boundaries as required. +func (client BaseClient) GetStorageAccountsComplete(ctx context.Context, vaultBaseURL string, maxresults *int32) (result StorageListResultIterator, err error) { + result.page, err = client.GetStorageAccounts(ctx, vaultBaseURL, maxresults) + return +} + +// ImportCertificate imports an existing valid certificate, containing a private key, into Azure Key Vault. The +// certificate to be imported can be in either PFX or PEM format. If the certificate is in PEM format the PEM file must +// contain the key as well as x509 certificates. This operation requires the certificates/import permission. +// Parameters: +// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net. +// certificateName - the name of the certificate. +// parameters - the parameters to import the certificate. +func (client BaseClient) ImportCertificate(ctx context.Context, vaultBaseURL string, certificateName string, parameters CertificateImportParameters) (result CertificateBundle, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: certificateName, + Constraints: []validation.Constraint{{Target: "certificateName", Name: validation.Pattern, Rule: `^[0-9a-zA-Z-]+$`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.Base64EncodedCertificate", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.CertificatePolicy", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.CertificatePolicy.X509CertificateProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.CertificatePolicy.X509CertificateProperties.ValidityInMonths", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.CertificatePolicy.X509CertificateProperties.ValidityInMonths", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}, + }}, + }}}}}); err != nil { + return result, validation.NewError("keyvault.BaseClient", "ImportCertificate", err.Error()) + } + + req, err := client.ImportCertificatePreparer(ctx, vaultBaseURL, certificateName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "ImportCertificate", nil, "Failure preparing request") + return + } + + resp, err := client.ImportCertificateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "ImportCertificate", resp, "Failure sending request") + return + } + + result, err = client.ImportCertificateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "ImportCertificate", resp, "Failure responding to request") + } + + return +} + +// ImportCertificatePreparer prepares the ImportCertificate request. +func (client BaseClient) ImportCertificatePreparer(ctx context.Context, vaultBaseURL string, certificateName string, parameters CertificateImportParameters) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "vaultBaseUrl": vaultBaseURL, + } + + pathParameters := map[string]interface{}{ + "certificate-name": autorest.Encode("path", certificateName), + } + + const APIVersion = "7.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters), + autorest.WithPathParameters("/certificates/{certificate-name}/import", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ImportCertificateSender sends the ImportCertificate request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) ImportCertificateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// ImportCertificateResponder handles the response to the ImportCertificate request. The method always +// closes the http.Response Body. +func (client BaseClient) ImportCertificateResponder(resp *http.Response) (result CertificateBundle, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ImportKey the import key operation may be used to import any key type into an Azure Key Vault. If the named key +// already exists, Azure Key Vault creates a new version of the key. This operation requires the keys/import +// permission. +// Parameters: +// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net. +// keyName - name for the imported key. +// parameters - the parameters to import a key. +func (client BaseClient) ImportKey(ctx context.Context, vaultBaseURL string, keyName string, parameters KeyImportParameters) (result KeyBundle, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: keyName, + Constraints: []validation.Constraint{{Target: "keyName", Name: validation.Pattern, Rule: `^[0-9a-zA-Z-]+$`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.Key", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("keyvault.BaseClient", "ImportKey", err.Error()) + } + + req, err := client.ImportKeyPreparer(ctx, vaultBaseURL, keyName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "ImportKey", nil, "Failure preparing request") + return + } + + resp, err := client.ImportKeySender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "ImportKey", resp, "Failure sending request") + return + } + + result, err = client.ImportKeyResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "ImportKey", resp, "Failure responding to request") + } + + return +} + +// ImportKeyPreparer prepares the ImportKey request. +func (client BaseClient) ImportKeyPreparer(ctx context.Context, vaultBaseURL string, keyName string, parameters KeyImportParameters) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "vaultBaseUrl": vaultBaseURL, + } + + pathParameters := map[string]interface{}{ + "key-name": autorest.Encode("path", keyName), + } + + const APIVersion = "7.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters), + autorest.WithPathParameters("/keys/{key-name}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ImportKeySender sends the ImportKey request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) ImportKeySender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// ImportKeyResponder handles the response to the ImportKey request. The method always +// closes the http.Response Body. +func (client BaseClient) ImportKeyResponder(resp *http.Response) (result KeyBundle, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// MergeCertificate the MergeCertificate operation performs the merging of a certificate or certificate chain with a +// key pair currently available in the service. This operation requires the certificates/create permission. +// Parameters: +// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net. +// certificateName - the name of the certificate. +// parameters - the parameters to merge certificate. +func (client BaseClient) MergeCertificate(ctx context.Context, vaultBaseURL string, certificateName string, parameters CertificateMergeParameters) (result CertificateBundle, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.X509Certificates", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("keyvault.BaseClient", "MergeCertificate", err.Error()) + } + + req, err := client.MergeCertificatePreparer(ctx, vaultBaseURL, certificateName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "MergeCertificate", nil, "Failure preparing request") + return + } + + resp, err := client.MergeCertificateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "MergeCertificate", resp, "Failure sending request") + return + } + + result, err = client.MergeCertificateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "MergeCertificate", resp, "Failure responding to request") + } + + return +} + +// MergeCertificatePreparer prepares the MergeCertificate request. +func (client BaseClient) MergeCertificatePreparer(ctx context.Context, vaultBaseURL string, certificateName string, parameters CertificateMergeParameters) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "vaultBaseUrl": vaultBaseURL, + } + + pathParameters := map[string]interface{}{ + "certificate-name": autorest.Encode("path", certificateName), + } + + const APIVersion = "7.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters), + autorest.WithPathParameters("/certificates/{certificate-name}/pending/merge", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// MergeCertificateSender sends the MergeCertificate request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) MergeCertificateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// MergeCertificateResponder handles the response to the MergeCertificate request. The method always +// closes the http.Response Body. +func (client BaseClient) MergeCertificateResponder(resp *http.Response) (result CertificateBundle, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// PurgeDeletedCertificate the PurgeDeletedCertificate operation performs an irreversible deletion of the specified +// certificate, without possibility for recovery. The operation is not available if the recovery level does not specify +// 'Purgeable'. This operation requires the certificate/purge permission. +// Parameters: +// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net. +// certificateName - the name of the certificate +func (client BaseClient) PurgeDeletedCertificate(ctx context.Context, vaultBaseURL string, certificateName string) (result autorest.Response, err error) { + req, err := client.PurgeDeletedCertificatePreparer(ctx, vaultBaseURL, certificateName) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "PurgeDeletedCertificate", nil, "Failure preparing request") + return + } + + resp, err := client.PurgeDeletedCertificateSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "PurgeDeletedCertificate", resp, "Failure sending request") + return + } + + result, err = client.PurgeDeletedCertificateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "PurgeDeletedCertificate", resp, "Failure responding to request") + } + + return +} + +// PurgeDeletedCertificatePreparer prepares the PurgeDeletedCertificate request. +func (client BaseClient) PurgeDeletedCertificatePreparer(ctx context.Context, vaultBaseURL string, certificateName string) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "vaultBaseUrl": vaultBaseURL, + } + + pathParameters := map[string]interface{}{ + "certificate-name": autorest.Encode("path", certificateName), + } + + const APIVersion = "7.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters), + autorest.WithPathParameters("/deletedcertificates/{certificate-name}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// PurgeDeletedCertificateSender sends the PurgeDeletedCertificate request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) PurgeDeletedCertificateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// PurgeDeletedCertificateResponder handles the response to the PurgeDeletedCertificate request. The method always +// closes the http.Response Body. +func (client BaseClient) PurgeDeletedCertificateResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// PurgeDeletedKey the Purge Deleted Key operation is applicable for soft-delete enabled vaults. While the operation +// can be invoked on any vault, it will return an error if invoked on a non soft-delete enabled vault. This operation +// requires the keys/purge permission. +// Parameters: +// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net. +// keyName - the name of the key +func (client BaseClient) PurgeDeletedKey(ctx context.Context, vaultBaseURL string, keyName string) (result autorest.Response, err error) { + req, err := client.PurgeDeletedKeyPreparer(ctx, vaultBaseURL, keyName) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "PurgeDeletedKey", nil, "Failure preparing request") + return + } + + resp, err := client.PurgeDeletedKeySender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "PurgeDeletedKey", resp, "Failure sending request") + return + } + + result, err = client.PurgeDeletedKeyResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "PurgeDeletedKey", resp, "Failure responding to request") + } + + return +} + +// PurgeDeletedKeyPreparer prepares the PurgeDeletedKey request. +func (client BaseClient) PurgeDeletedKeyPreparer(ctx context.Context, vaultBaseURL string, keyName string) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "vaultBaseUrl": vaultBaseURL, + } + + pathParameters := map[string]interface{}{ + "key-name": autorest.Encode("path", keyName), + } + + const APIVersion = "7.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters), + autorest.WithPathParameters("/deletedkeys/{key-name}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// PurgeDeletedKeySender sends the PurgeDeletedKey request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) PurgeDeletedKeySender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// PurgeDeletedKeyResponder handles the response to the PurgeDeletedKey request. The method always +// closes the http.Response Body. +func (client BaseClient) PurgeDeletedKeyResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// PurgeDeletedSecret the purge deleted secret operation removes the secret permanently, without the possibility of +// recovery. This operation can only be enabled on a soft-delete enabled vault. This operation requires the +// secrets/purge permission. +// Parameters: +// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net. +// secretName - the name of the secret. +func (client BaseClient) PurgeDeletedSecret(ctx context.Context, vaultBaseURL string, secretName string) (result autorest.Response, err error) { + req, err := client.PurgeDeletedSecretPreparer(ctx, vaultBaseURL, secretName) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "PurgeDeletedSecret", nil, "Failure preparing request") + return + } + + resp, err := client.PurgeDeletedSecretSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "PurgeDeletedSecret", resp, "Failure sending request") + return + } + + result, err = client.PurgeDeletedSecretResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "PurgeDeletedSecret", resp, "Failure responding to request") + } + + return +} + +// PurgeDeletedSecretPreparer prepares the PurgeDeletedSecret request. +func (client BaseClient) PurgeDeletedSecretPreparer(ctx context.Context, vaultBaseURL string, secretName string) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "vaultBaseUrl": vaultBaseURL, + } + + pathParameters := map[string]interface{}{ + "secret-name": autorest.Encode("path", secretName), + } + + const APIVersion = "7.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters), + autorest.WithPathParameters("/deletedsecrets/{secret-name}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// PurgeDeletedSecretSender sends the PurgeDeletedSecret request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) PurgeDeletedSecretSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// PurgeDeletedSecretResponder handles the response to the PurgeDeletedSecret request. The method always +// closes the http.Response Body. +func (client BaseClient) PurgeDeletedSecretResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// PurgeDeletedStorageAccount the purge deleted storage account operation removes the secret permanently, without the +// possibility of recovery. This operation can only be performed on a soft-delete enabled vault. This operation +// requires the storage/purge permission. +// Parameters: +// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net. +// storageAccountName - the name of the storage account. +func (client BaseClient) PurgeDeletedStorageAccount(ctx context.Context, vaultBaseURL string, storageAccountName string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: storageAccountName, + Constraints: []validation.Constraint{{Target: "storageAccountName", Name: validation.Pattern, Rule: `^[0-9a-zA-Z]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("keyvault.BaseClient", "PurgeDeletedStorageAccount", err.Error()) + } + + req, err := client.PurgeDeletedStorageAccountPreparer(ctx, vaultBaseURL, storageAccountName) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "PurgeDeletedStorageAccount", nil, "Failure preparing request") + return + } + + resp, err := client.PurgeDeletedStorageAccountSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "PurgeDeletedStorageAccount", resp, "Failure sending request") + return + } + + result, err = client.PurgeDeletedStorageAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "PurgeDeletedStorageAccount", resp, "Failure responding to request") + } + + return +} + +// PurgeDeletedStorageAccountPreparer prepares the PurgeDeletedStorageAccount request. +func (client BaseClient) PurgeDeletedStorageAccountPreparer(ctx context.Context, vaultBaseURL string, storageAccountName string) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "vaultBaseUrl": vaultBaseURL, + } + + pathParameters := map[string]interface{}{ + "storage-account-name": autorest.Encode("path", storageAccountName), + } + + const APIVersion = "7.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters), + autorest.WithPathParameters("/deletedstorage/{storage-account-name}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// PurgeDeletedStorageAccountSender sends the PurgeDeletedStorageAccount request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) PurgeDeletedStorageAccountSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// PurgeDeletedStorageAccountResponder handles the response to the PurgeDeletedStorageAccount request. The method always +// closes the http.Response Body. +func (client BaseClient) PurgeDeletedStorageAccountResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// RecoverDeletedCertificate the RecoverDeletedCertificate operation performs the reversal of the Delete operation. The +// operation is applicable in vaults enabled for soft-delete, and must be issued during the retention interval +// (available in the deleted certificate's attributes). This operation requires the certificates/recover permission. +// Parameters: +// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net. +// certificateName - the name of the deleted certificate +func (client BaseClient) RecoverDeletedCertificate(ctx context.Context, vaultBaseURL string, certificateName string) (result CertificateBundle, err error) { + req, err := client.RecoverDeletedCertificatePreparer(ctx, vaultBaseURL, certificateName) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "RecoverDeletedCertificate", nil, "Failure preparing request") + return + } + + resp, err := client.RecoverDeletedCertificateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "RecoverDeletedCertificate", resp, "Failure sending request") + return + } + + result, err = client.RecoverDeletedCertificateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "RecoverDeletedCertificate", resp, "Failure responding to request") + } + + return +} + +// RecoverDeletedCertificatePreparer prepares the RecoverDeletedCertificate request. +func (client BaseClient) RecoverDeletedCertificatePreparer(ctx context.Context, vaultBaseURL string, certificateName string) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "vaultBaseUrl": vaultBaseURL, + } + + pathParameters := map[string]interface{}{ + "certificate-name": autorest.Encode("path", certificateName), + } + + const APIVersion = "7.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters), + autorest.WithPathParameters("/deletedcertificates/{certificate-name}/recover", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RecoverDeletedCertificateSender sends the RecoverDeletedCertificate request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) RecoverDeletedCertificateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// RecoverDeletedCertificateResponder handles the response to the RecoverDeletedCertificate request. The method always +// closes the http.Response Body. +func (client BaseClient) RecoverDeletedCertificateResponder(resp *http.Response) (result CertificateBundle, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// RecoverDeletedKey the Recover Deleted Key operation is applicable for deleted keys in soft-delete enabled vaults. It +// recovers the deleted key back to its latest version under /keys. An attempt to recover an non-deleted key will +// return an error. Consider this the inverse of the delete operation on soft-delete enabled vaults. This operation +// requires the keys/recover permission. +// Parameters: +// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net. +// keyName - the name of the deleted key. +func (client BaseClient) RecoverDeletedKey(ctx context.Context, vaultBaseURL string, keyName string) (result KeyBundle, err error) { + req, err := client.RecoverDeletedKeyPreparer(ctx, vaultBaseURL, keyName) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "RecoverDeletedKey", nil, "Failure preparing request") + return + } + + resp, err := client.RecoverDeletedKeySender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "RecoverDeletedKey", resp, "Failure sending request") + return + } + + result, err = client.RecoverDeletedKeyResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "RecoverDeletedKey", resp, "Failure responding to request") + } + + return +} + +// RecoverDeletedKeyPreparer prepares the RecoverDeletedKey request. +func (client BaseClient) RecoverDeletedKeyPreparer(ctx context.Context, vaultBaseURL string, keyName string) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "vaultBaseUrl": vaultBaseURL, + } + + pathParameters := map[string]interface{}{ + "key-name": autorest.Encode("path", keyName), + } + + const APIVersion = "7.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters), + autorest.WithPathParameters("/deletedkeys/{key-name}/recover", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RecoverDeletedKeySender sends the RecoverDeletedKey request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) RecoverDeletedKeySender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// RecoverDeletedKeyResponder handles the response to the RecoverDeletedKey request. The method always +// closes the http.Response Body. +func (client BaseClient) RecoverDeletedKeyResponder(resp *http.Response) (result KeyBundle, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// RecoverDeletedSasDefinition recovers the deleted SAS definition for the specified storage account. This operation +// can only be performed on a soft-delete enabled vault. This operation requires the storage/recover permission. +// Parameters: +// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net. +// storageAccountName - the name of the storage account. +// sasDefinitionName - the name of the SAS definition. +func (client BaseClient) RecoverDeletedSasDefinition(ctx context.Context, vaultBaseURL string, storageAccountName string, sasDefinitionName string) (result SasDefinitionBundle, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: storageAccountName, + Constraints: []validation.Constraint{{Target: "storageAccountName", Name: validation.Pattern, Rule: `^[0-9a-zA-Z]+$`, Chain: nil}}}, + {TargetValue: sasDefinitionName, + Constraints: []validation.Constraint{{Target: "sasDefinitionName", Name: validation.Pattern, Rule: `^[0-9a-zA-Z]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("keyvault.BaseClient", "RecoverDeletedSasDefinition", err.Error()) + } + + req, err := client.RecoverDeletedSasDefinitionPreparer(ctx, vaultBaseURL, storageAccountName, sasDefinitionName) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "RecoverDeletedSasDefinition", nil, "Failure preparing request") + return + } + + resp, err := client.RecoverDeletedSasDefinitionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "RecoverDeletedSasDefinition", resp, "Failure sending request") + return + } + + result, err = client.RecoverDeletedSasDefinitionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "RecoverDeletedSasDefinition", resp, "Failure responding to request") + } + + return +} + +// RecoverDeletedSasDefinitionPreparer prepares the RecoverDeletedSasDefinition request. +func (client BaseClient) RecoverDeletedSasDefinitionPreparer(ctx context.Context, vaultBaseURL string, storageAccountName string, sasDefinitionName string) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "vaultBaseUrl": vaultBaseURL, + } + + pathParameters := map[string]interface{}{ + "sas-definition-name": autorest.Encode("path", sasDefinitionName), + "storage-account-name": autorest.Encode("path", storageAccountName), + } + + const APIVersion = "7.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters), + autorest.WithPathParameters("/deletedstorage/{storage-account-name}/sas/{sas-definition-name}/recover", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RecoverDeletedSasDefinitionSender sends the RecoverDeletedSasDefinition request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) RecoverDeletedSasDefinitionSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// RecoverDeletedSasDefinitionResponder handles the response to the RecoverDeletedSasDefinition request. The method always +// closes the http.Response Body. +func (client BaseClient) RecoverDeletedSasDefinitionResponder(resp *http.Response) (result SasDefinitionBundle, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// RecoverDeletedSecret recovers the deleted secret in the specified vault. This operation can only be performed on a +// soft-delete enabled vault. This operation requires the secrets/recover permission. +// Parameters: +// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net. +// secretName - the name of the deleted secret. +func (client BaseClient) RecoverDeletedSecret(ctx context.Context, vaultBaseURL string, secretName string) (result SecretBundle, err error) { + req, err := client.RecoverDeletedSecretPreparer(ctx, vaultBaseURL, secretName) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "RecoverDeletedSecret", nil, "Failure preparing request") + return + } + + resp, err := client.RecoverDeletedSecretSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "RecoverDeletedSecret", resp, "Failure sending request") + return + } + + result, err = client.RecoverDeletedSecretResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "RecoverDeletedSecret", resp, "Failure responding to request") + } + + return +} + +// RecoverDeletedSecretPreparer prepares the RecoverDeletedSecret request. +func (client BaseClient) RecoverDeletedSecretPreparer(ctx context.Context, vaultBaseURL string, secretName string) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "vaultBaseUrl": vaultBaseURL, + } + + pathParameters := map[string]interface{}{ + "secret-name": autorest.Encode("path", secretName), + } + + const APIVersion = "7.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters), + autorest.WithPathParameters("/deletedsecrets/{secret-name}/recover", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RecoverDeletedSecretSender sends the RecoverDeletedSecret request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) RecoverDeletedSecretSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// RecoverDeletedSecretResponder handles the response to the RecoverDeletedSecret request. The method always +// closes the http.Response Body. +func (client BaseClient) RecoverDeletedSecretResponder(resp *http.Response) (result SecretBundle, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// RecoverDeletedStorageAccount recovers the deleted storage account in the specified vault. This operation can only be +// performed on a soft-delete enabled vault. This operation requires the storage/recover permission. +// Parameters: +// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net. +// storageAccountName - the name of the storage account. +func (client BaseClient) RecoverDeletedStorageAccount(ctx context.Context, vaultBaseURL string, storageAccountName string) (result StorageBundle, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: storageAccountName, + Constraints: []validation.Constraint{{Target: "storageAccountName", Name: validation.Pattern, Rule: `^[0-9a-zA-Z]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("keyvault.BaseClient", "RecoverDeletedStorageAccount", err.Error()) + } + + req, err := client.RecoverDeletedStorageAccountPreparer(ctx, vaultBaseURL, storageAccountName) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "RecoverDeletedStorageAccount", nil, "Failure preparing request") + return + } + + resp, err := client.RecoverDeletedStorageAccountSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "RecoverDeletedStorageAccount", resp, "Failure sending request") + return + } + + result, err = client.RecoverDeletedStorageAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "RecoverDeletedStorageAccount", resp, "Failure responding to request") + } + + return +} + +// RecoverDeletedStorageAccountPreparer prepares the RecoverDeletedStorageAccount request. +func (client BaseClient) RecoverDeletedStorageAccountPreparer(ctx context.Context, vaultBaseURL string, storageAccountName string) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "vaultBaseUrl": vaultBaseURL, + } + + pathParameters := map[string]interface{}{ + "storage-account-name": autorest.Encode("path", storageAccountName), + } + + const APIVersion = "7.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters), + autorest.WithPathParameters("/deletedstorage/{storage-account-name}/recover", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RecoverDeletedStorageAccountSender sends the RecoverDeletedStorageAccount request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) RecoverDeletedStorageAccountSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// RecoverDeletedStorageAccountResponder handles the response to the RecoverDeletedStorageAccount request. The method always +// closes the http.Response Body. +func (client BaseClient) RecoverDeletedStorageAccountResponder(resp *http.Response) (result StorageBundle, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// RegenerateStorageAccountKey regenerates the specified key value for the given storage account. This operation +// requires the storage/regeneratekey permission. +// Parameters: +// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net. +// storageAccountName - the name of the storage account. +// parameters - the parameters to regenerate storage account key. +func (client BaseClient) RegenerateStorageAccountKey(ctx context.Context, vaultBaseURL string, storageAccountName string, parameters StorageAccountRegenerteKeyParameters) (result StorageBundle, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: storageAccountName, + Constraints: []validation.Constraint{{Target: "storageAccountName", Name: validation.Pattern, Rule: `^[0-9a-zA-Z]+$`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.KeyName", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("keyvault.BaseClient", "RegenerateStorageAccountKey", err.Error()) + } + + req, err := client.RegenerateStorageAccountKeyPreparer(ctx, vaultBaseURL, storageAccountName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "RegenerateStorageAccountKey", nil, "Failure preparing request") + return + } + + resp, err := client.RegenerateStorageAccountKeySender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "RegenerateStorageAccountKey", resp, "Failure sending request") + return + } + + result, err = client.RegenerateStorageAccountKeyResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "RegenerateStorageAccountKey", resp, "Failure responding to request") + } + + return +} + +// RegenerateStorageAccountKeyPreparer prepares the RegenerateStorageAccountKey request. +func (client BaseClient) RegenerateStorageAccountKeyPreparer(ctx context.Context, vaultBaseURL string, storageAccountName string, parameters StorageAccountRegenerteKeyParameters) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "vaultBaseUrl": vaultBaseURL, + } + + pathParameters := map[string]interface{}{ + "storage-account-name": autorest.Encode("path", storageAccountName), + } + + const APIVersion = "7.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters), + autorest.WithPathParameters("/storage/{storage-account-name}/regeneratekey", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RegenerateStorageAccountKeySender sends the RegenerateStorageAccountKey request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) RegenerateStorageAccountKeySender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// RegenerateStorageAccountKeyResponder handles the response to the RegenerateStorageAccountKey request. The method always +// closes the http.Response Body. +func (client BaseClient) RegenerateStorageAccountKeyResponder(resp *http.Response) (result StorageBundle, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// RestoreCertificate restores a backed up certificate, and all its versions, to a vault. This operation requires the +// certificates/restore permission. +// Parameters: +// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net. +// parameters - the parameters to restore the certificate. +func (client BaseClient) RestoreCertificate(ctx context.Context, vaultBaseURL string, parameters CertificateRestoreParameters) (result CertificateBundle, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.CertificateBundleBackup", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("keyvault.BaseClient", "RestoreCertificate", err.Error()) + } + + req, err := client.RestoreCertificatePreparer(ctx, vaultBaseURL, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "RestoreCertificate", nil, "Failure preparing request") + return + } + + resp, err := client.RestoreCertificateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "RestoreCertificate", resp, "Failure sending request") + return + } + + result, err = client.RestoreCertificateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "RestoreCertificate", resp, "Failure responding to request") + } + + return +} + +// RestoreCertificatePreparer prepares the RestoreCertificate request. +func (client BaseClient) RestoreCertificatePreparer(ctx context.Context, vaultBaseURL string, parameters CertificateRestoreParameters) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "vaultBaseUrl": vaultBaseURL, + } + + const APIVersion = "7.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters), + autorest.WithPath("/certificates/restore"), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RestoreCertificateSender sends the RestoreCertificate request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) RestoreCertificateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// RestoreCertificateResponder handles the response to the RestoreCertificate request. The method always +// closes the http.Response Body. +func (client BaseClient) RestoreCertificateResponder(resp *http.Response) (result CertificateBundle, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// RestoreKey imports a previously backed up key into Azure Key Vault, restoring the key, its key identifier, +// attributes and access control policies. The RESTORE operation may be used to import a previously backed up key. +// Individual versions of a key cannot be restored. The key is restored in its entirety with the same key name as it +// had when it was backed up. If the key name is not available in the target Key Vault, the RESTORE operation will be +// rejected. While the key name is retained during restore, the final key identifier will change if the key is restored +// to a different vault. Restore will restore all versions and preserve version identifiers. The RESTORE operation is +// subject to security constraints: The target Key Vault must be owned by the same Microsoft Azure Subscription as the +// source Key Vault The user must have RESTORE permission in the target Key Vault. This operation requires the +// keys/restore permission. +// Parameters: +// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net. +// parameters - the parameters to restore the key. +func (client BaseClient) RestoreKey(ctx context.Context, vaultBaseURL string, parameters KeyRestoreParameters) (result KeyBundle, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.KeyBundleBackup", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("keyvault.BaseClient", "RestoreKey", err.Error()) + } + + req, err := client.RestoreKeyPreparer(ctx, vaultBaseURL, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "RestoreKey", nil, "Failure preparing request") + return + } + + resp, err := client.RestoreKeySender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "RestoreKey", resp, "Failure sending request") + return + } + + result, err = client.RestoreKeyResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "RestoreKey", resp, "Failure responding to request") + } + + return +} + +// RestoreKeyPreparer prepares the RestoreKey request. +func (client BaseClient) RestoreKeyPreparer(ctx context.Context, vaultBaseURL string, parameters KeyRestoreParameters) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "vaultBaseUrl": vaultBaseURL, + } + + const APIVersion = "7.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters), + autorest.WithPath("/keys/restore"), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RestoreKeySender sends the RestoreKey request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) RestoreKeySender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// RestoreKeyResponder handles the response to the RestoreKey request. The method always +// closes the http.Response Body. +func (client BaseClient) RestoreKeyResponder(resp *http.Response) (result KeyBundle, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// RestoreSecret restores a backed up secret, and all its versions, to a vault. This operation requires the +// secrets/restore permission. +// Parameters: +// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net. +// parameters - the parameters to restore the secret. +func (client BaseClient) RestoreSecret(ctx context.Context, vaultBaseURL string, parameters SecretRestoreParameters) (result SecretBundle, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.SecretBundleBackup", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("keyvault.BaseClient", "RestoreSecret", err.Error()) + } + + req, err := client.RestoreSecretPreparer(ctx, vaultBaseURL, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "RestoreSecret", nil, "Failure preparing request") + return + } + + resp, err := client.RestoreSecretSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "RestoreSecret", resp, "Failure sending request") + return + } + + result, err = client.RestoreSecretResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "RestoreSecret", resp, "Failure responding to request") + } + + return +} + +// RestoreSecretPreparer prepares the RestoreSecret request. +func (client BaseClient) RestoreSecretPreparer(ctx context.Context, vaultBaseURL string, parameters SecretRestoreParameters) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "vaultBaseUrl": vaultBaseURL, + } + + const APIVersion = "7.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters), + autorest.WithPath("/secrets/restore"), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RestoreSecretSender sends the RestoreSecret request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) RestoreSecretSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// RestoreSecretResponder handles the response to the RestoreSecret request. The method always +// closes the http.Response Body. +func (client BaseClient) RestoreSecretResponder(resp *http.Response) (result SecretBundle, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// RestoreStorageAccount restores a backed up storage account to a vault. This operation requires the storage/restore +// permission. +// Parameters: +// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net. +// parameters - the parameters to restore the storage account. +func (client BaseClient) RestoreStorageAccount(ctx context.Context, vaultBaseURL string, parameters StorageRestoreParameters) (result StorageBundle, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.StorageBundleBackup", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("keyvault.BaseClient", "RestoreStorageAccount", err.Error()) + } + + req, err := client.RestoreStorageAccountPreparer(ctx, vaultBaseURL, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "RestoreStorageAccount", nil, "Failure preparing request") + return + } + + resp, err := client.RestoreStorageAccountSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "RestoreStorageAccount", resp, "Failure sending request") + return + } + + result, err = client.RestoreStorageAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "RestoreStorageAccount", resp, "Failure responding to request") + } + + return +} + +// RestoreStorageAccountPreparer prepares the RestoreStorageAccount request. +func (client BaseClient) RestoreStorageAccountPreparer(ctx context.Context, vaultBaseURL string, parameters StorageRestoreParameters) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "vaultBaseUrl": vaultBaseURL, + } + + const APIVersion = "7.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters), + autorest.WithPath("/storage/restore"), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RestoreStorageAccountSender sends the RestoreStorageAccount request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) RestoreStorageAccountSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// RestoreStorageAccountResponder handles the response to the RestoreStorageAccount request. The method always +// closes the http.Response Body. +func (client BaseClient) RestoreStorageAccountResponder(resp *http.Response) (result StorageBundle, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// SetCertificateContacts sets the certificate contacts for the specified key vault. This operation requires the +// certificates/managecontacts permission. +// Parameters: +// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net. +// contacts - the contacts for the key vault certificate. +func (client BaseClient) SetCertificateContacts(ctx context.Context, vaultBaseURL string, contacts Contacts) (result Contacts, err error) { + req, err := client.SetCertificateContactsPreparer(ctx, vaultBaseURL, contacts) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "SetCertificateContacts", nil, "Failure preparing request") + return + } + + resp, err := client.SetCertificateContactsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "SetCertificateContacts", resp, "Failure sending request") + return + } + + result, err = client.SetCertificateContactsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "SetCertificateContacts", resp, "Failure responding to request") + } + + return +} + +// SetCertificateContactsPreparer prepares the SetCertificateContacts request. +func (client BaseClient) SetCertificateContactsPreparer(ctx context.Context, vaultBaseURL string, contacts Contacts) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "vaultBaseUrl": vaultBaseURL, + } + + const APIVersion = "7.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters), + autorest.WithPath("/certificates/contacts"), + autorest.WithJSON(contacts), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// SetCertificateContactsSender sends the SetCertificateContacts request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) SetCertificateContactsSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// SetCertificateContactsResponder handles the response to the SetCertificateContacts request. The method always +// closes the http.Response Body. +func (client BaseClient) SetCertificateContactsResponder(resp *http.Response) (result Contacts, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// SetCertificateIssuer the SetCertificateIssuer operation adds or updates the specified certificate issuer. This +// operation requires the certificates/setissuers permission. +// Parameters: +// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net. +// issuerName - the name of the issuer. +// parameter - certificate issuer set parameter. +func (client BaseClient) SetCertificateIssuer(ctx context.Context, vaultBaseURL string, issuerName string, parameter CertificateIssuerSetParameters) (result IssuerBundle, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: parameter, + Constraints: []validation.Constraint{{Target: "parameter.Provider", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("keyvault.BaseClient", "SetCertificateIssuer", err.Error()) + } + + req, err := client.SetCertificateIssuerPreparer(ctx, vaultBaseURL, issuerName, parameter) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "SetCertificateIssuer", nil, "Failure preparing request") + return + } + + resp, err := client.SetCertificateIssuerSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "SetCertificateIssuer", resp, "Failure sending request") + return + } + + result, err = client.SetCertificateIssuerResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "SetCertificateIssuer", resp, "Failure responding to request") + } + + return +} + +// SetCertificateIssuerPreparer prepares the SetCertificateIssuer request. +func (client BaseClient) SetCertificateIssuerPreparer(ctx context.Context, vaultBaseURL string, issuerName string, parameter CertificateIssuerSetParameters) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "vaultBaseUrl": vaultBaseURL, + } + + pathParameters := map[string]interface{}{ + "issuer-name": autorest.Encode("path", issuerName), + } + + const APIVersion = "7.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters), + autorest.WithPathParameters("/certificates/issuers/{issuer-name}", pathParameters), + autorest.WithJSON(parameter), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// SetCertificateIssuerSender sends the SetCertificateIssuer request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) SetCertificateIssuerSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// SetCertificateIssuerResponder handles the response to the SetCertificateIssuer request. The method always +// closes the http.Response Body. +func (client BaseClient) SetCertificateIssuerResponder(resp *http.Response) (result IssuerBundle, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// SetSasDefinition creates or updates a new SAS definition for the specified storage account. This operation requires +// the storage/setsas permission. +// Parameters: +// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net. +// storageAccountName - the name of the storage account. +// sasDefinitionName - the name of the SAS definition. +// parameters - the parameters to create a SAS definition. +func (client BaseClient) SetSasDefinition(ctx context.Context, vaultBaseURL string, storageAccountName string, sasDefinitionName string, parameters SasDefinitionCreateParameters) (result SasDefinitionBundle, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: storageAccountName, + Constraints: []validation.Constraint{{Target: "storageAccountName", Name: validation.Pattern, Rule: `^[0-9a-zA-Z]+$`, Chain: nil}}}, + {TargetValue: sasDefinitionName, + Constraints: []validation.Constraint{{Target: "sasDefinitionName", Name: validation.Pattern, Rule: `^[0-9a-zA-Z]+$`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.TemplateURI", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.ValidityPeriod", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("keyvault.BaseClient", "SetSasDefinition", err.Error()) + } + + req, err := client.SetSasDefinitionPreparer(ctx, vaultBaseURL, storageAccountName, sasDefinitionName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "SetSasDefinition", nil, "Failure preparing request") + return + } + + resp, err := client.SetSasDefinitionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "SetSasDefinition", resp, "Failure sending request") + return + } + + result, err = client.SetSasDefinitionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "SetSasDefinition", resp, "Failure responding to request") + } + + return +} + +// SetSasDefinitionPreparer prepares the SetSasDefinition request. +func (client BaseClient) SetSasDefinitionPreparer(ctx context.Context, vaultBaseURL string, storageAccountName string, sasDefinitionName string, parameters SasDefinitionCreateParameters) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "vaultBaseUrl": vaultBaseURL, + } + + pathParameters := map[string]interface{}{ + "sas-definition-name": autorest.Encode("path", sasDefinitionName), + "storage-account-name": autorest.Encode("path", storageAccountName), + } + + const APIVersion = "7.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters), + autorest.WithPathParameters("/storage/{storage-account-name}/sas/{sas-definition-name}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// SetSasDefinitionSender sends the SetSasDefinition request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) SetSasDefinitionSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// SetSasDefinitionResponder handles the response to the SetSasDefinition request. The method always +// closes the http.Response Body. +func (client BaseClient) SetSasDefinitionResponder(resp *http.Response) (result SasDefinitionBundle, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// SetSecret the SET operation adds a secret to the Azure Key Vault. If the named secret already exists, Azure Key +// Vault creates a new version of that secret. This operation requires the secrets/set permission. +// Parameters: +// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net. +// secretName - the name of the secret. +// parameters - the parameters for setting the secret. +func (client BaseClient) SetSecret(ctx context.Context, vaultBaseURL string, secretName string, parameters SecretSetParameters) (result SecretBundle, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: secretName, + Constraints: []validation.Constraint{{Target: "secretName", Name: validation.Pattern, Rule: `^[0-9a-zA-Z-]+$`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.Value", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("keyvault.BaseClient", "SetSecret", err.Error()) + } + + req, err := client.SetSecretPreparer(ctx, vaultBaseURL, secretName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "SetSecret", nil, "Failure preparing request") + return + } + + resp, err := client.SetSecretSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "SetSecret", resp, "Failure sending request") + return + } + + result, err = client.SetSecretResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "SetSecret", resp, "Failure responding to request") + } + + return +} + +// SetSecretPreparer prepares the SetSecret request. +func (client BaseClient) SetSecretPreparer(ctx context.Context, vaultBaseURL string, secretName string, parameters SecretSetParameters) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "vaultBaseUrl": vaultBaseURL, + } + + pathParameters := map[string]interface{}{ + "secret-name": autorest.Encode("path", secretName), + } + + const APIVersion = "7.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters), + autorest.WithPathParameters("/secrets/{secret-name}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// SetSecretSender sends the SetSecret request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) SetSecretSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// SetSecretResponder handles the response to the SetSecret request. The method always +// closes the http.Response Body. +func (client BaseClient) SetSecretResponder(resp *http.Response) (result SecretBundle, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// SetStorageAccount creates or updates a new storage account. This operation requires the storage/set permission. +// Parameters: +// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net. +// storageAccountName - the name of the storage account. +// parameters - the parameters to create a storage account. +func (client BaseClient) SetStorageAccount(ctx context.Context, vaultBaseURL string, storageAccountName string, parameters StorageAccountCreateParameters) (result StorageBundle, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: storageAccountName, + Constraints: []validation.Constraint{{Target: "storageAccountName", Name: validation.Pattern, Rule: `^[0-9a-zA-Z]+$`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.ResourceID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.ActiveKeyName", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.AutoRegenerateKey", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("keyvault.BaseClient", "SetStorageAccount", err.Error()) + } + + req, err := client.SetStorageAccountPreparer(ctx, vaultBaseURL, storageAccountName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "SetStorageAccount", nil, "Failure preparing request") + return + } + + resp, err := client.SetStorageAccountSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "SetStorageAccount", resp, "Failure sending request") + return + } + + result, err = client.SetStorageAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "SetStorageAccount", resp, "Failure responding to request") + } + + return +} + +// SetStorageAccountPreparer prepares the SetStorageAccount request. +func (client BaseClient) SetStorageAccountPreparer(ctx context.Context, vaultBaseURL string, storageAccountName string, parameters StorageAccountCreateParameters) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "vaultBaseUrl": vaultBaseURL, + } + + pathParameters := map[string]interface{}{ + "storage-account-name": autorest.Encode("path", storageAccountName), + } + + const APIVersion = "7.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters), + autorest.WithPathParameters("/storage/{storage-account-name}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// SetStorageAccountSender sends the SetStorageAccount request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) SetStorageAccountSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// SetStorageAccountResponder handles the response to the SetStorageAccount request. The method always +// closes the http.Response Body. +func (client BaseClient) SetStorageAccountResponder(resp *http.Response) (result StorageBundle, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Sign the SIGN operation is applicable to asymmetric and symmetric keys stored in Azure Key Vault since this +// operation uses the private portion of the key. This operation requires the keys/sign permission. +// Parameters: +// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net. +// keyName - the name of the key. +// keyVersion - the version of the key. +// parameters - the parameters for the signing operation. +func (client BaseClient) Sign(ctx context.Context, vaultBaseURL string, keyName string, keyVersion string, parameters KeySignParameters) (result KeyOperationResult, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.Value", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("keyvault.BaseClient", "Sign", err.Error()) + } + + req, err := client.SignPreparer(ctx, vaultBaseURL, keyName, keyVersion, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "Sign", nil, "Failure preparing request") + return + } + + resp, err := client.SignSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "Sign", resp, "Failure sending request") + return + } + + result, err = client.SignResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "Sign", resp, "Failure responding to request") + } + + return +} + +// SignPreparer prepares the Sign request. +func (client BaseClient) SignPreparer(ctx context.Context, vaultBaseURL string, keyName string, keyVersion string, parameters KeySignParameters) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "vaultBaseUrl": vaultBaseURL, + } + + pathParameters := map[string]interface{}{ + "key-name": autorest.Encode("path", keyName), + "key-version": autorest.Encode("path", keyVersion), + } + + const APIVersion = "7.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters), + autorest.WithPathParameters("/keys/{key-name}/{key-version}/sign", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// SignSender sends the Sign request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) SignSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// SignResponder handles the response to the Sign request. The method always +// closes the http.Response Body. +func (client BaseClient) SignResponder(resp *http.Response) (result KeyOperationResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UnwrapKey the UNWRAP operation supports decryption of a symmetric key using the target key encryption key. This +// operation is the reverse of the WRAP operation. The UNWRAP operation applies to asymmetric and symmetric keys stored +// in Azure Key Vault since it uses the private portion of the key. This operation requires the keys/unwrapKey +// permission. +// Parameters: +// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net. +// keyName - the name of the key. +// keyVersion - the version of the key. +// parameters - the parameters for the key operation. +func (client BaseClient) UnwrapKey(ctx context.Context, vaultBaseURL string, keyName string, keyVersion string, parameters KeyOperationsParameters) (result KeyOperationResult, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.Value", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("keyvault.BaseClient", "UnwrapKey", err.Error()) + } + + req, err := client.UnwrapKeyPreparer(ctx, vaultBaseURL, keyName, keyVersion, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "UnwrapKey", nil, "Failure preparing request") + return + } + + resp, err := client.UnwrapKeySender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "UnwrapKey", resp, "Failure sending request") + return + } + + result, err = client.UnwrapKeyResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "UnwrapKey", resp, "Failure responding to request") + } + + return +} + +// UnwrapKeyPreparer prepares the UnwrapKey request. +func (client BaseClient) UnwrapKeyPreparer(ctx context.Context, vaultBaseURL string, keyName string, keyVersion string, parameters KeyOperationsParameters) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "vaultBaseUrl": vaultBaseURL, + } + + pathParameters := map[string]interface{}{ + "key-name": autorest.Encode("path", keyName), + "key-version": autorest.Encode("path", keyVersion), + } + + const APIVersion = "7.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters), + autorest.WithPathParameters("/keys/{key-name}/{key-version}/unwrapkey", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UnwrapKeySender sends the UnwrapKey request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) UnwrapKeySender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// UnwrapKeyResponder handles the response to the UnwrapKey request. The method always +// closes the http.Response Body. +func (client BaseClient) UnwrapKeyResponder(resp *http.Response) (result KeyOperationResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UpdateCertificate the UpdateCertificate operation applies the specified update on the given certificate; the only +// elements updated are the certificate's attributes. This operation requires the certificates/update permission. +// Parameters: +// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net. +// certificateName - the name of the certificate in the given key vault. +// certificateVersion - the version of the certificate. +// parameters - the parameters for certificate update. +func (client BaseClient) UpdateCertificate(ctx context.Context, vaultBaseURL string, certificateName string, certificateVersion string, parameters CertificateUpdateParameters) (result CertificateBundle, err error) { + req, err := client.UpdateCertificatePreparer(ctx, vaultBaseURL, certificateName, certificateVersion, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "UpdateCertificate", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateCertificateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "UpdateCertificate", resp, "Failure sending request") + return + } + + result, err = client.UpdateCertificateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "UpdateCertificate", resp, "Failure responding to request") + } + + return +} + +// UpdateCertificatePreparer prepares the UpdateCertificate request. +func (client BaseClient) UpdateCertificatePreparer(ctx context.Context, vaultBaseURL string, certificateName string, certificateVersion string, parameters CertificateUpdateParameters) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "vaultBaseUrl": vaultBaseURL, + } + + pathParameters := map[string]interface{}{ + "certificate-name": autorest.Encode("path", certificateName), + "certificate-version": autorest.Encode("path", certificateVersion), + } + + const APIVersion = "7.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters), + autorest.WithPathParameters("/certificates/{certificate-name}/{certificate-version}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateCertificateSender sends the UpdateCertificate request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) UpdateCertificateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// UpdateCertificateResponder handles the response to the UpdateCertificate request. The method always +// closes the http.Response Body. +func (client BaseClient) UpdateCertificateResponder(resp *http.Response) (result CertificateBundle, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UpdateCertificateIssuer the UpdateCertificateIssuer operation performs an update on the specified certificate issuer +// entity. This operation requires the certificates/setissuers permission. +// Parameters: +// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net. +// issuerName - the name of the issuer. +// parameter - certificate issuer update parameter. +func (client BaseClient) UpdateCertificateIssuer(ctx context.Context, vaultBaseURL string, issuerName string, parameter CertificateIssuerUpdateParameters) (result IssuerBundle, err error) { + req, err := client.UpdateCertificateIssuerPreparer(ctx, vaultBaseURL, issuerName, parameter) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "UpdateCertificateIssuer", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateCertificateIssuerSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "UpdateCertificateIssuer", resp, "Failure sending request") + return + } + + result, err = client.UpdateCertificateIssuerResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "UpdateCertificateIssuer", resp, "Failure responding to request") + } + + return +} + +// UpdateCertificateIssuerPreparer prepares the UpdateCertificateIssuer request. +func (client BaseClient) UpdateCertificateIssuerPreparer(ctx context.Context, vaultBaseURL string, issuerName string, parameter CertificateIssuerUpdateParameters) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "vaultBaseUrl": vaultBaseURL, + } + + pathParameters := map[string]interface{}{ + "issuer-name": autorest.Encode("path", issuerName), + } + + const APIVersion = "7.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters), + autorest.WithPathParameters("/certificates/issuers/{issuer-name}", pathParameters), + autorest.WithJSON(parameter), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateCertificateIssuerSender sends the UpdateCertificateIssuer request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) UpdateCertificateIssuerSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// UpdateCertificateIssuerResponder handles the response to the UpdateCertificateIssuer request. The method always +// closes the http.Response Body. +func (client BaseClient) UpdateCertificateIssuerResponder(resp *http.Response) (result IssuerBundle, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UpdateCertificateOperation updates a certificate creation operation that is already in progress. This operation +// requires the certificates/update permission. +// Parameters: +// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net. +// certificateName - the name of the certificate. +// certificateOperation - the certificate operation response. +func (client BaseClient) UpdateCertificateOperation(ctx context.Context, vaultBaseURL string, certificateName string, certificateOperation CertificateOperationUpdateParameter) (result CertificateOperation, err error) { + req, err := client.UpdateCertificateOperationPreparer(ctx, vaultBaseURL, certificateName, certificateOperation) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "UpdateCertificateOperation", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateCertificateOperationSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "UpdateCertificateOperation", resp, "Failure sending request") + return + } + + result, err = client.UpdateCertificateOperationResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "UpdateCertificateOperation", resp, "Failure responding to request") + } + + return +} + +// UpdateCertificateOperationPreparer prepares the UpdateCertificateOperation request. +func (client BaseClient) UpdateCertificateOperationPreparer(ctx context.Context, vaultBaseURL string, certificateName string, certificateOperation CertificateOperationUpdateParameter) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "vaultBaseUrl": vaultBaseURL, + } + + pathParameters := map[string]interface{}{ + "certificate-name": autorest.Encode("path", certificateName), + } + + const APIVersion = "7.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters), + autorest.WithPathParameters("/certificates/{certificate-name}/pending", pathParameters), + autorest.WithJSON(certificateOperation), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateCertificateOperationSender sends the UpdateCertificateOperation request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) UpdateCertificateOperationSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// UpdateCertificateOperationResponder handles the response to the UpdateCertificateOperation request. The method always +// closes the http.Response Body. +func (client BaseClient) UpdateCertificateOperationResponder(resp *http.Response) (result CertificateOperation, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UpdateCertificatePolicy set specified members in the certificate policy. Leave others as null. This operation +// requires the certificates/update permission. +// Parameters: +// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net. +// certificateName - the name of the certificate in the given vault. +// certificatePolicy - the policy for the certificate. +func (client BaseClient) UpdateCertificatePolicy(ctx context.Context, vaultBaseURL string, certificateName string, certificatePolicy CertificatePolicy) (result CertificatePolicy, err error) { + req, err := client.UpdateCertificatePolicyPreparer(ctx, vaultBaseURL, certificateName, certificatePolicy) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "UpdateCertificatePolicy", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateCertificatePolicySender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "UpdateCertificatePolicy", resp, "Failure sending request") + return + } + + result, err = client.UpdateCertificatePolicyResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "UpdateCertificatePolicy", resp, "Failure responding to request") + } + + return +} + +// UpdateCertificatePolicyPreparer prepares the UpdateCertificatePolicy request. +func (client BaseClient) UpdateCertificatePolicyPreparer(ctx context.Context, vaultBaseURL string, certificateName string, certificatePolicy CertificatePolicy) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "vaultBaseUrl": vaultBaseURL, + } + + pathParameters := map[string]interface{}{ + "certificate-name": autorest.Encode("path", certificateName), + } + + const APIVersion = "7.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters), + autorest.WithPathParameters("/certificates/{certificate-name}/policy", pathParameters), + autorest.WithJSON(certificatePolicy), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateCertificatePolicySender sends the UpdateCertificatePolicy request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) UpdateCertificatePolicySender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// UpdateCertificatePolicyResponder handles the response to the UpdateCertificatePolicy request. The method always +// closes the http.Response Body. +func (client BaseClient) UpdateCertificatePolicyResponder(resp *http.Response) (result CertificatePolicy, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UpdateKey in order to perform this operation, the key must already exist in the Key Vault. Note: The cryptographic +// material of a key itself cannot be changed. This operation requires the keys/update permission. +// Parameters: +// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net. +// keyName - the name of key to update. +// keyVersion - the version of the key to update. +// parameters - the parameters of the key to update. +func (client BaseClient) UpdateKey(ctx context.Context, vaultBaseURL string, keyName string, keyVersion string, parameters KeyUpdateParameters) (result KeyBundle, err error) { + req, err := client.UpdateKeyPreparer(ctx, vaultBaseURL, keyName, keyVersion, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "UpdateKey", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateKeySender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "UpdateKey", resp, "Failure sending request") + return + } + + result, err = client.UpdateKeyResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "UpdateKey", resp, "Failure responding to request") + } + + return +} + +// UpdateKeyPreparer prepares the UpdateKey request. +func (client BaseClient) UpdateKeyPreparer(ctx context.Context, vaultBaseURL string, keyName string, keyVersion string, parameters KeyUpdateParameters) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "vaultBaseUrl": vaultBaseURL, + } + + pathParameters := map[string]interface{}{ + "key-name": autorest.Encode("path", keyName), + "key-version": autorest.Encode("path", keyVersion), + } + + const APIVersion = "7.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters), + autorest.WithPathParameters("/keys/{key-name}/{key-version}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateKeySender sends the UpdateKey request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) UpdateKeySender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// UpdateKeyResponder handles the response to the UpdateKey request. The method always +// closes the http.Response Body. +func (client BaseClient) UpdateKeyResponder(resp *http.Response) (result KeyBundle, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UpdateSasDefinition updates the specified attributes associated with the given SAS definition. This operation +// requires the storage/setsas permission. +// Parameters: +// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net. +// storageAccountName - the name of the storage account. +// sasDefinitionName - the name of the SAS definition. +// parameters - the parameters to update a SAS definition. +func (client BaseClient) UpdateSasDefinition(ctx context.Context, vaultBaseURL string, storageAccountName string, sasDefinitionName string, parameters SasDefinitionUpdateParameters) (result SasDefinitionBundle, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: storageAccountName, + Constraints: []validation.Constraint{{Target: "storageAccountName", Name: validation.Pattern, Rule: `^[0-9a-zA-Z]+$`, Chain: nil}}}, + {TargetValue: sasDefinitionName, + Constraints: []validation.Constraint{{Target: "sasDefinitionName", Name: validation.Pattern, Rule: `^[0-9a-zA-Z]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("keyvault.BaseClient", "UpdateSasDefinition", err.Error()) + } + + req, err := client.UpdateSasDefinitionPreparer(ctx, vaultBaseURL, storageAccountName, sasDefinitionName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "UpdateSasDefinition", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSasDefinitionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "UpdateSasDefinition", resp, "Failure sending request") + return + } + + result, err = client.UpdateSasDefinitionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "UpdateSasDefinition", resp, "Failure responding to request") + } + + return +} + +// UpdateSasDefinitionPreparer prepares the UpdateSasDefinition request. +func (client BaseClient) UpdateSasDefinitionPreparer(ctx context.Context, vaultBaseURL string, storageAccountName string, sasDefinitionName string, parameters SasDefinitionUpdateParameters) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "vaultBaseUrl": vaultBaseURL, + } + + pathParameters := map[string]interface{}{ + "sas-definition-name": autorest.Encode("path", sasDefinitionName), + "storage-account-name": autorest.Encode("path", storageAccountName), + } + + const APIVersion = "7.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters), + autorest.WithPathParameters("/storage/{storage-account-name}/sas/{sas-definition-name}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSasDefinitionSender sends the UpdateSasDefinition request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) UpdateSasDefinitionSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// UpdateSasDefinitionResponder handles the response to the UpdateSasDefinition request. The method always +// closes the http.Response Body. +func (client BaseClient) UpdateSasDefinitionResponder(resp *http.Response) (result SasDefinitionBundle, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UpdateSecret the UPDATE operation changes specified attributes of an existing stored secret. Attributes that are not +// specified in the request are left unchanged. The value of a secret itself cannot be changed. This operation requires +// the secrets/set permission. +// Parameters: +// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net. +// secretName - the name of the secret. +// secretVersion - the version of the secret. +// parameters - the parameters for update secret operation. +func (client BaseClient) UpdateSecret(ctx context.Context, vaultBaseURL string, secretName string, secretVersion string, parameters SecretUpdateParameters) (result SecretBundle, err error) { + req, err := client.UpdateSecretPreparer(ctx, vaultBaseURL, secretName, secretVersion, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "UpdateSecret", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSecretSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "UpdateSecret", resp, "Failure sending request") + return + } + + result, err = client.UpdateSecretResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "UpdateSecret", resp, "Failure responding to request") + } + + return +} + +// UpdateSecretPreparer prepares the UpdateSecret request. +func (client BaseClient) UpdateSecretPreparer(ctx context.Context, vaultBaseURL string, secretName string, secretVersion string, parameters SecretUpdateParameters) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "vaultBaseUrl": vaultBaseURL, + } + + pathParameters := map[string]interface{}{ + "secret-name": autorest.Encode("path", secretName), + "secret-version": autorest.Encode("path", secretVersion), + } + + const APIVersion = "7.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters), + autorest.WithPathParameters("/secrets/{secret-name}/{secret-version}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSecretSender sends the UpdateSecret request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) UpdateSecretSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// UpdateSecretResponder handles the response to the UpdateSecret request. The method always +// closes the http.Response Body. +func (client BaseClient) UpdateSecretResponder(resp *http.Response) (result SecretBundle, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UpdateStorageAccount updates the specified attributes associated with the given storage account. This operation +// requires the storage/set/update permission. +// Parameters: +// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net. +// storageAccountName - the name of the storage account. +// parameters - the parameters to update a storage account. +func (client BaseClient) UpdateStorageAccount(ctx context.Context, vaultBaseURL string, storageAccountName string, parameters StorageAccountUpdateParameters) (result StorageBundle, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: storageAccountName, + Constraints: []validation.Constraint{{Target: "storageAccountName", Name: validation.Pattern, Rule: `^[0-9a-zA-Z]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("keyvault.BaseClient", "UpdateStorageAccount", err.Error()) + } + + req, err := client.UpdateStorageAccountPreparer(ctx, vaultBaseURL, storageAccountName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "UpdateStorageAccount", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateStorageAccountSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "UpdateStorageAccount", resp, "Failure sending request") + return + } + + result, err = client.UpdateStorageAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "UpdateStorageAccount", resp, "Failure responding to request") + } + + return +} + +// UpdateStorageAccountPreparer prepares the UpdateStorageAccount request. +func (client BaseClient) UpdateStorageAccountPreparer(ctx context.Context, vaultBaseURL string, storageAccountName string, parameters StorageAccountUpdateParameters) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "vaultBaseUrl": vaultBaseURL, + } + + pathParameters := map[string]interface{}{ + "storage-account-name": autorest.Encode("path", storageAccountName), + } + + const APIVersion = "7.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters), + autorest.WithPathParameters("/storage/{storage-account-name}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateStorageAccountSender sends the UpdateStorageAccount request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) UpdateStorageAccountSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// UpdateStorageAccountResponder handles the response to the UpdateStorageAccount request. The method always +// closes the http.Response Body. +func (client BaseClient) UpdateStorageAccountResponder(resp *http.Response) (result StorageBundle, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Verify the VERIFY operation is applicable to symmetric keys stored in Azure Key Vault. VERIFY is not strictly +// necessary for asymmetric keys stored in Azure Key Vault since signature verification can be performed using the +// public portion of the key but this operation is supported as a convenience for callers that only have a +// key-reference and not the public portion of the key. This operation requires the keys/verify permission. +// Parameters: +// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net. +// keyName - the name of the key. +// keyVersion - the version of the key. +// parameters - the parameters for verify operations. +func (client BaseClient) Verify(ctx context.Context, vaultBaseURL string, keyName string, keyVersion string, parameters KeyVerifyParameters) (result KeyVerifyResult, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.Digest", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.Signature", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("keyvault.BaseClient", "Verify", err.Error()) + } + + req, err := client.VerifyPreparer(ctx, vaultBaseURL, keyName, keyVersion, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "Verify", nil, "Failure preparing request") + return + } + + resp, err := client.VerifySender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "Verify", resp, "Failure sending request") + return + } + + result, err = client.VerifyResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "Verify", resp, "Failure responding to request") + } + + return +} + +// VerifyPreparer prepares the Verify request. +func (client BaseClient) VerifyPreparer(ctx context.Context, vaultBaseURL string, keyName string, keyVersion string, parameters KeyVerifyParameters) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "vaultBaseUrl": vaultBaseURL, + } + + pathParameters := map[string]interface{}{ + "key-name": autorest.Encode("path", keyName), + "key-version": autorest.Encode("path", keyVersion), + } + + const APIVersion = "7.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters), + autorest.WithPathParameters("/keys/{key-name}/{key-version}/verify", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// VerifySender sends the Verify request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) VerifySender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// VerifyResponder handles the response to the Verify request. The method always +// closes the http.Response Body. +func (client BaseClient) VerifyResponder(resp *http.Response) (result KeyVerifyResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// WrapKey the WRAP operation supports encryption of a symmetric key using a key encryption key that has previously +// been stored in an Azure Key Vault. The WRAP operation is only strictly necessary for symmetric keys stored in Azure +// Key Vault since protection with an asymmetric key can be performed using the public portion of the key. This +// operation is supported for asymmetric keys as a convenience for callers that have a key-reference but do not have +// access to the public key material. This operation requires the keys/wrapKey permission. +// Parameters: +// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net. +// keyName - the name of the key. +// keyVersion - the version of the key. +// parameters - the parameters for wrap operation. +func (client BaseClient) WrapKey(ctx context.Context, vaultBaseURL string, keyName string, keyVersion string, parameters KeyOperationsParameters) (result KeyOperationResult, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.Value", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("keyvault.BaseClient", "WrapKey", err.Error()) + } + + req, err := client.WrapKeyPreparer(ctx, vaultBaseURL, keyName, keyVersion, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "WrapKey", nil, "Failure preparing request") + return + } + + resp, err := client.WrapKeySender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "WrapKey", resp, "Failure sending request") + return + } + + result, err = client.WrapKeyResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "WrapKey", resp, "Failure responding to request") + } + + return +} + +// WrapKeyPreparer prepares the WrapKey request. +func (client BaseClient) WrapKeyPreparer(ctx context.Context, vaultBaseURL string, keyName string, keyVersion string, parameters KeyOperationsParameters) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "vaultBaseUrl": vaultBaseURL, + } + + pathParameters := map[string]interface{}{ + "key-name": autorest.Encode("path", keyName), + "key-version": autorest.Encode("path", keyVersion), + } + + const APIVersion = "7.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters), + autorest.WithPathParameters("/keys/{key-name}/{key-version}/wrapkey", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// WrapKeySender sends the WrapKey request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) WrapKeySender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// WrapKeyResponder handles the response to the WrapKey request. The method always +// closes the http.Response Body. +func (client BaseClient) WrapKeyResponder(resp *http.Response) (result KeyOperationResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/keyvault/v7.0/keyvault/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/keyvault/v7.0/keyvault/models.go new file mode 100644 index 000000000..c1a4f62a0 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/keyvault/v7.0/keyvault/models.go @@ -0,0 +1,3128 @@ +package keyvault + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "encoding/json" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/date" + "github.com/Azure/go-autorest/autorest/to" + "net/http" +) + +// ActionType enumerates the values for action type. +type ActionType string + +const ( + // AutoRenew ... + AutoRenew ActionType = "AutoRenew" + // EmailContacts ... + EmailContacts ActionType = "EmailContacts" +) + +// PossibleActionTypeValues returns an array of possible values for the ActionType const type. +func PossibleActionTypeValues() []ActionType { + return []ActionType{AutoRenew, EmailContacts} +} + +// DeletionRecoveryLevel enumerates the values for deletion recovery level. +type DeletionRecoveryLevel string + +const ( + // Purgeable ... + Purgeable DeletionRecoveryLevel = "Purgeable" + // Recoverable ... + Recoverable DeletionRecoveryLevel = "Recoverable" + // RecoverableProtectedSubscription ... + RecoverableProtectedSubscription DeletionRecoveryLevel = "Recoverable+ProtectedSubscription" + // RecoverablePurgeable ... + RecoverablePurgeable DeletionRecoveryLevel = "Recoverable+Purgeable" +) + +// PossibleDeletionRecoveryLevelValues returns an array of possible values for the DeletionRecoveryLevel const type. +func PossibleDeletionRecoveryLevelValues() []DeletionRecoveryLevel { + return []DeletionRecoveryLevel{Purgeable, Recoverable, RecoverableProtectedSubscription, RecoverablePurgeable} +} + +// JSONWebKeyCurveName enumerates the values for json web key curve name. +type JSONWebKeyCurveName string + +const ( + // P256 The NIST P-256 elliptic curve, AKA SECG curve SECP256R1. + P256 JSONWebKeyCurveName = "P-256" + // P256K The SECG SECP256K1 elliptic curve. + P256K JSONWebKeyCurveName = "P-256K" + // P384 The NIST P-384 elliptic curve, AKA SECG curve SECP384R1. + P384 JSONWebKeyCurveName = "P-384" + // P521 The NIST P-521 elliptic curve, AKA SECG curve SECP521R1. + P521 JSONWebKeyCurveName = "P-521" +) + +// PossibleJSONWebKeyCurveNameValues returns an array of possible values for the JSONWebKeyCurveName const type. +func PossibleJSONWebKeyCurveNameValues() []JSONWebKeyCurveName { + return []JSONWebKeyCurveName{P256, P256K, P384, P521} +} + +// JSONWebKeyEncryptionAlgorithm enumerates the values for json web key encryption algorithm. +type JSONWebKeyEncryptionAlgorithm string + +const ( + // RSA15 ... + RSA15 JSONWebKeyEncryptionAlgorithm = "RSA1_5" + // RSAOAEP ... + RSAOAEP JSONWebKeyEncryptionAlgorithm = "RSA-OAEP" + // RSAOAEP256 ... + RSAOAEP256 JSONWebKeyEncryptionAlgorithm = "RSA-OAEP-256" +) + +// PossibleJSONWebKeyEncryptionAlgorithmValues returns an array of possible values for the JSONWebKeyEncryptionAlgorithm const type. +func PossibleJSONWebKeyEncryptionAlgorithmValues() []JSONWebKeyEncryptionAlgorithm { + return []JSONWebKeyEncryptionAlgorithm{RSA15, RSAOAEP, RSAOAEP256} +} + +// JSONWebKeyOperation enumerates the values for json web key operation. +type JSONWebKeyOperation string + +const ( + // Decrypt ... + Decrypt JSONWebKeyOperation = "decrypt" + // Encrypt ... + Encrypt JSONWebKeyOperation = "encrypt" + // Sign ... + Sign JSONWebKeyOperation = "sign" + // UnwrapKey ... + UnwrapKey JSONWebKeyOperation = "unwrapKey" + // Verify ... + Verify JSONWebKeyOperation = "verify" + // WrapKey ... + WrapKey JSONWebKeyOperation = "wrapKey" +) + +// PossibleJSONWebKeyOperationValues returns an array of possible values for the JSONWebKeyOperation const type. +func PossibleJSONWebKeyOperationValues() []JSONWebKeyOperation { + return []JSONWebKeyOperation{Decrypt, Encrypt, Sign, UnwrapKey, Verify, WrapKey} +} + +// JSONWebKeySignatureAlgorithm enumerates the values for json web key signature algorithm. +type JSONWebKeySignatureAlgorithm string + +const ( + // ES256 ECDSA using P-256 and SHA-256, as described in https://tools.ietf.org/html/rfc7518. + ES256 JSONWebKeySignatureAlgorithm = "ES256" + // ES256K ECDSA using P-256K and SHA-256, as described in https://tools.ietf.org/html/rfc7518 + ES256K JSONWebKeySignatureAlgorithm = "ES256K" + // ES384 ECDSA using P-384 and SHA-384, as described in https://tools.ietf.org/html/rfc7518 + ES384 JSONWebKeySignatureAlgorithm = "ES384" + // ES512 ECDSA using P-521 and SHA-512, as described in https://tools.ietf.org/html/rfc7518 + ES512 JSONWebKeySignatureAlgorithm = "ES512" + // PS256 RSASSA-PSS using SHA-256 and MGF1 with SHA-256, as described in + // https://tools.ietf.org/html/rfc7518 + PS256 JSONWebKeySignatureAlgorithm = "PS256" + // PS384 RSASSA-PSS using SHA-384 and MGF1 with SHA-384, as described in + // https://tools.ietf.org/html/rfc7518 + PS384 JSONWebKeySignatureAlgorithm = "PS384" + // PS512 RSASSA-PSS using SHA-512 and MGF1 with SHA-512, as described in + // https://tools.ietf.org/html/rfc7518 + PS512 JSONWebKeySignatureAlgorithm = "PS512" + // RS256 RSASSA-PKCS1-v1_5 using SHA-256, as described in https://tools.ietf.org/html/rfc7518 + RS256 JSONWebKeySignatureAlgorithm = "RS256" + // RS384 RSASSA-PKCS1-v1_5 using SHA-384, as described in https://tools.ietf.org/html/rfc7518 + RS384 JSONWebKeySignatureAlgorithm = "RS384" + // RS512 RSASSA-PKCS1-v1_5 using SHA-512, as described in https://tools.ietf.org/html/rfc7518 + RS512 JSONWebKeySignatureAlgorithm = "RS512" + // RSNULL Reserved + RSNULL JSONWebKeySignatureAlgorithm = "RSNULL" +) + +// PossibleJSONWebKeySignatureAlgorithmValues returns an array of possible values for the JSONWebKeySignatureAlgorithm const type. +func PossibleJSONWebKeySignatureAlgorithmValues() []JSONWebKeySignatureAlgorithm { + return []JSONWebKeySignatureAlgorithm{ES256, ES256K, ES384, ES512, PS256, PS384, PS512, RS256, RS384, RS512, RSNULL} +} + +// JSONWebKeyType enumerates the values for json web key type. +type JSONWebKeyType string + +const ( + // EC Elliptic Curve. + EC JSONWebKeyType = "EC" + // ECHSM Elliptic Curve with a private key which is not exportable from the HSM. + ECHSM JSONWebKeyType = "EC-HSM" + // Oct Octet sequence (used to represent symmetric keys) + Oct JSONWebKeyType = "oct" + // RSA RSA (https://tools.ietf.org/html/rfc3447) + RSA JSONWebKeyType = "RSA" + // RSAHSM RSA with a private key which is not exportable from the HSM. + RSAHSM JSONWebKeyType = "RSA-HSM" +) + +// PossibleJSONWebKeyTypeValues returns an array of possible values for the JSONWebKeyType const type. +func PossibleJSONWebKeyTypeValues() []JSONWebKeyType { + return []JSONWebKeyType{EC, ECHSM, Oct, RSA, RSAHSM} +} + +// KeyUsageType enumerates the values for key usage type. +type KeyUsageType string + +const ( + // CRLSign ... + CRLSign KeyUsageType = "cRLSign" + // DataEncipherment ... + DataEncipherment KeyUsageType = "dataEncipherment" + // DecipherOnly ... + DecipherOnly KeyUsageType = "decipherOnly" + // DigitalSignature ... + DigitalSignature KeyUsageType = "digitalSignature" + // EncipherOnly ... + EncipherOnly KeyUsageType = "encipherOnly" + // KeyAgreement ... + KeyAgreement KeyUsageType = "keyAgreement" + // KeyCertSign ... + KeyCertSign KeyUsageType = "keyCertSign" + // KeyEncipherment ... + KeyEncipherment KeyUsageType = "keyEncipherment" + // NonRepudiation ... + NonRepudiation KeyUsageType = "nonRepudiation" +) + +// PossibleKeyUsageTypeValues returns an array of possible values for the KeyUsageType const type. +func PossibleKeyUsageTypeValues() []KeyUsageType { + return []KeyUsageType{CRLSign, DataEncipherment, DecipherOnly, DigitalSignature, EncipherOnly, KeyAgreement, KeyCertSign, KeyEncipherment, NonRepudiation} +} + +// SasTokenType enumerates the values for sas token type. +type SasTokenType string + +const ( + // Account ... + Account SasTokenType = "account" + // Service ... + Service SasTokenType = "service" +) + +// PossibleSasTokenTypeValues returns an array of possible values for the SasTokenType const type. +func PossibleSasTokenTypeValues() []SasTokenType { + return []SasTokenType{Account, Service} +} + +// Action the action that will be executed. +type Action struct { + // ActionType - The type of the action. Possible values include: 'EmailContacts', 'AutoRenew' + ActionType ActionType `json:"action_type,omitempty"` +} + +// AdministratorDetails details of the organization administrator of the certificate issuer. +type AdministratorDetails struct { + // FirstName - First name. + FirstName *string `json:"first_name,omitempty"` + // LastName - Last name. + LastName *string `json:"last_name,omitempty"` + // EmailAddress - Email addresss. + EmailAddress *string `json:"email,omitempty"` + // Phone - Phone number. + Phone *string `json:"phone,omitempty"` +} + +// Attributes the object attributes managed by the KeyVault service. +type Attributes struct { + // Enabled - Determines whether the object is enabled. + Enabled *bool `json:"enabled,omitempty"` + // NotBefore - Not before date in UTC. + NotBefore *date.UnixTime `json:"nbf,omitempty"` + // Expires - Expiry date in UTC. + Expires *date.UnixTime `json:"exp,omitempty"` + // Created - Creation time in UTC. + Created *date.UnixTime `json:"created,omitempty"` + // Updated - Last updated time in UTC. + Updated *date.UnixTime `json:"updated,omitempty"` +} + +// BackupCertificateResult the backup certificate result, containing the backup blob. +type BackupCertificateResult struct { + autorest.Response `json:"-"` + // Value - The backup blob containing the backed up certificate. (a URL-encoded base64 string) + Value *string `json:"value,omitempty"` +} + +// BackupKeyResult the backup key result, containing the backup blob. +type BackupKeyResult struct { + autorest.Response `json:"-"` + // Value - The backup blob containing the backed up key. (a URL-encoded base64 string) + Value *string `json:"value,omitempty"` +} + +// BackupSecretResult the backup secret result, containing the backup blob. +type BackupSecretResult struct { + autorest.Response `json:"-"` + // Value - The backup blob containing the backed up secret. (a URL-encoded base64 string) + Value *string `json:"value,omitempty"` +} + +// BackupStorageResult the backup storage result, containing the backup blob. +type BackupStorageResult struct { + autorest.Response `json:"-"` + // Value - The backup blob containing the backed up storage account. (a URL-encoded base64 string) + Value *string `json:"value,omitempty"` +} + +// CertificateAttributes the certificate management attributes. +type CertificateAttributes struct { + // RecoveryLevel - Reflects the deletion recovery level currently in effect for certificates in the current vault. If it contains 'Purgeable', the certificate can be permanently deleted by a privileged user; otherwise, only the system can purge the certificate, at the end of the retention interval. Possible values include: 'Purgeable', 'RecoverablePurgeable', 'Recoverable', 'RecoverableProtectedSubscription' + RecoveryLevel DeletionRecoveryLevel `json:"recoveryLevel,omitempty"` + // Enabled - Determines whether the object is enabled. + Enabled *bool `json:"enabled,omitempty"` + // NotBefore - Not before date in UTC. + NotBefore *date.UnixTime `json:"nbf,omitempty"` + // Expires - Expiry date in UTC. + Expires *date.UnixTime `json:"exp,omitempty"` + // Created - Creation time in UTC. + Created *date.UnixTime `json:"created,omitempty"` + // Updated - Last updated time in UTC. + Updated *date.UnixTime `json:"updated,omitempty"` +} + +// CertificateBundle a certificate bundle consists of a certificate (X509) plus its attributes. +type CertificateBundle struct { + autorest.Response `json:"-"` + // ID - The certificate id. + ID *string `json:"id,omitempty"` + // Kid - The key id. + Kid *string `json:"kid,omitempty"` + // Sid - The secret id. + Sid *string `json:"sid,omitempty"` + // X509Thumbprint - Thumbprint of the certificate. (a URL-encoded base64 string) + X509Thumbprint *string `json:"x5t,omitempty"` + // Policy - The management policy. + Policy *CertificatePolicy `json:"policy,omitempty"` + // Cer - CER contents of x509 certificate. + Cer *[]byte `json:"cer,omitempty"` + // ContentType - The content type of the secret. + ContentType *string `json:"contentType,omitempty"` + // Attributes - The certificate attributes. + Attributes *CertificateAttributes `json:"attributes,omitempty"` + // Tags - Application specific metadata in the form of key-value pairs + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for CertificateBundle. +func (cb CertificateBundle) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cb.ID != nil { + objectMap["id"] = cb.ID + } + if cb.Kid != nil { + objectMap["kid"] = cb.Kid + } + if cb.Sid != nil { + objectMap["sid"] = cb.Sid + } + if cb.X509Thumbprint != nil { + objectMap["x5t"] = cb.X509Thumbprint + } + if cb.Policy != nil { + objectMap["policy"] = cb.Policy + } + if cb.Cer != nil { + objectMap["cer"] = cb.Cer + } + if cb.ContentType != nil { + objectMap["contentType"] = cb.ContentType + } + if cb.Attributes != nil { + objectMap["attributes"] = cb.Attributes + } + if cb.Tags != nil { + objectMap["tags"] = cb.Tags + } + return json.Marshal(objectMap) +} + +// CertificateCreateParameters the certificate create parameters. +type CertificateCreateParameters struct { + // CertificatePolicy - The management policy for the certificate. + CertificatePolicy *CertificatePolicy `json:"policy,omitempty"` + // CertificateAttributes - The attributes of the certificate (optional). + CertificateAttributes *CertificateAttributes `json:"attributes,omitempty"` + // Tags - Application specific metadata in the form of key-value pairs. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for CertificateCreateParameters. +func (ccp CertificateCreateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ccp.CertificatePolicy != nil { + objectMap["policy"] = ccp.CertificatePolicy + } + if ccp.CertificateAttributes != nil { + objectMap["attributes"] = ccp.CertificateAttributes + } + if ccp.Tags != nil { + objectMap["tags"] = ccp.Tags + } + return json.Marshal(objectMap) +} + +// CertificateImportParameters the certificate import parameters. +type CertificateImportParameters struct { + // Base64EncodedCertificate - Base64 encoded representation of the certificate object to import. This certificate needs to contain the private key. + Base64EncodedCertificate *string `json:"value,omitempty"` + // Password - If the private key in base64EncodedCertificate is encrypted, the password used for encryption. + Password *string `json:"pwd,omitempty"` + // CertificatePolicy - The management policy for the certificate. + CertificatePolicy *CertificatePolicy `json:"policy,omitempty"` + // CertificateAttributes - The attributes of the certificate (optional). + CertificateAttributes *CertificateAttributes `json:"attributes,omitempty"` + // Tags - Application specific metadata in the form of key-value pairs. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for CertificateImportParameters. +func (cip CertificateImportParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cip.Base64EncodedCertificate != nil { + objectMap["value"] = cip.Base64EncodedCertificate + } + if cip.Password != nil { + objectMap["pwd"] = cip.Password + } + if cip.CertificatePolicy != nil { + objectMap["policy"] = cip.CertificatePolicy + } + if cip.CertificateAttributes != nil { + objectMap["attributes"] = cip.CertificateAttributes + } + if cip.Tags != nil { + objectMap["tags"] = cip.Tags + } + return json.Marshal(objectMap) +} + +// CertificateIssuerItem the certificate issuer item containing certificate issuer metadata. +type CertificateIssuerItem struct { + // ID - Certificate Identifier. + ID *string `json:"id,omitempty"` + // Provider - The issuer provider. + Provider *string `json:"provider,omitempty"` +} + +// CertificateIssuerListResult the certificate issuer list result. +type CertificateIssuerListResult struct { + autorest.Response `json:"-"` + // Value - A response message containing a list of certificate issuers in the key vault along with a link to the next page of certificate issuers. + Value *[]CertificateIssuerItem `json:"value,omitempty"` + // NextLink - The URL to get the next set of certificate issuers. + NextLink *string `json:"nextLink,omitempty"` +} + +// CertificateIssuerListResultIterator provides access to a complete listing of CertificateIssuerItem values. +type CertificateIssuerListResultIterator struct { + i int + page CertificateIssuerListResultPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *CertificateIssuerListResultIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter CertificateIssuerListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter CertificateIssuerListResultIterator) Response() CertificateIssuerListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter CertificateIssuerListResultIterator) Value() CertificateIssuerItem { + if !iter.page.NotDone() { + return CertificateIssuerItem{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (cilr CertificateIssuerListResult) IsEmpty() bool { + return cilr.Value == nil || len(*cilr.Value) == 0 +} + +// certificateIssuerListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (cilr CertificateIssuerListResult) certificateIssuerListResultPreparer() (*http.Request, error) { + if cilr.NextLink == nil || len(to.String(cilr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(cilr.NextLink))) +} + +// CertificateIssuerListResultPage contains a page of CertificateIssuerItem values. +type CertificateIssuerListResultPage struct { + fn func(CertificateIssuerListResult) (CertificateIssuerListResult, error) + cilr CertificateIssuerListResult +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *CertificateIssuerListResultPage) Next() error { + next, err := page.fn(page.cilr) + if err != nil { + return err + } + page.cilr = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page CertificateIssuerListResultPage) NotDone() bool { + return !page.cilr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page CertificateIssuerListResultPage) Response() CertificateIssuerListResult { + return page.cilr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page CertificateIssuerListResultPage) Values() []CertificateIssuerItem { + if page.cilr.IsEmpty() { + return nil + } + return *page.cilr.Value +} + +// CertificateIssuerSetParameters the certificate issuer set parameters. +type CertificateIssuerSetParameters struct { + // Provider - The issuer provider. + Provider *string `json:"provider,omitempty"` + // Credentials - The credentials to be used for the issuer. + Credentials *IssuerCredentials `json:"credentials,omitempty"` + // OrganizationDetails - Details of the organization as provided to the issuer. + OrganizationDetails *OrganizationDetails `json:"org_details,omitempty"` + // Attributes - Attributes of the issuer object. + Attributes *IssuerAttributes `json:"attributes,omitempty"` +} + +// CertificateIssuerUpdateParameters the certificate issuer update parameters. +type CertificateIssuerUpdateParameters struct { + // Provider - The issuer provider. + Provider *string `json:"provider,omitempty"` + // Credentials - The credentials to be used for the issuer. + Credentials *IssuerCredentials `json:"credentials,omitempty"` + // OrganizationDetails - Details of the organization as provided to the issuer. + OrganizationDetails *OrganizationDetails `json:"org_details,omitempty"` + // Attributes - Attributes of the issuer object. + Attributes *IssuerAttributes `json:"attributes,omitempty"` +} + +// CertificateItem the certificate item containing certificate metadata. +type CertificateItem struct { + // ID - Certificate identifier. + ID *string `json:"id,omitempty"` + // Attributes - The certificate management attributes. + Attributes *CertificateAttributes `json:"attributes,omitempty"` + // Tags - Application specific metadata in the form of key-value pairs. + Tags map[string]*string `json:"tags"` + // X509Thumbprint - Thumbprint of the certificate. (a URL-encoded base64 string) + X509Thumbprint *string `json:"x5t,omitempty"` +} + +// MarshalJSON is the custom marshaler for CertificateItem. +func (ci CertificateItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ci.ID != nil { + objectMap["id"] = ci.ID + } + if ci.Attributes != nil { + objectMap["attributes"] = ci.Attributes + } + if ci.Tags != nil { + objectMap["tags"] = ci.Tags + } + if ci.X509Thumbprint != nil { + objectMap["x5t"] = ci.X509Thumbprint + } + return json.Marshal(objectMap) +} + +// CertificateListResult the certificate list result. +type CertificateListResult struct { + autorest.Response `json:"-"` + // Value - A response message containing a list of certificates in the key vault along with a link to the next page of certificates. + Value *[]CertificateItem `json:"value,omitempty"` + // NextLink - The URL to get the next set of certificates. + NextLink *string `json:"nextLink,omitempty"` +} + +// CertificateListResultIterator provides access to a complete listing of CertificateItem values. +type CertificateListResultIterator struct { + i int + page CertificateListResultPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *CertificateListResultIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter CertificateListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter CertificateListResultIterator) Response() CertificateListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter CertificateListResultIterator) Value() CertificateItem { + if !iter.page.NotDone() { + return CertificateItem{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (clr CertificateListResult) IsEmpty() bool { + return clr.Value == nil || len(*clr.Value) == 0 +} + +// certificateListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (clr CertificateListResult) certificateListResultPreparer() (*http.Request, error) { + if clr.NextLink == nil || len(to.String(clr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(clr.NextLink))) +} + +// CertificateListResultPage contains a page of CertificateItem values. +type CertificateListResultPage struct { + fn func(CertificateListResult) (CertificateListResult, error) + clr CertificateListResult +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *CertificateListResultPage) Next() error { + next, err := page.fn(page.clr) + if err != nil { + return err + } + page.clr = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page CertificateListResultPage) NotDone() bool { + return !page.clr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page CertificateListResultPage) Response() CertificateListResult { + return page.clr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page CertificateListResultPage) Values() []CertificateItem { + if page.clr.IsEmpty() { + return nil + } + return *page.clr.Value +} + +// CertificateMergeParameters the certificate merge parameters +type CertificateMergeParameters struct { + // X509Certificates - The certificate or the certificate chain to merge. + X509Certificates *[][]byte `json:"x5c,omitempty"` + // CertificateAttributes - The attributes of the certificate (optional). + CertificateAttributes *CertificateAttributes `json:"attributes,omitempty"` + // Tags - Application specific metadata in the form of key-value pairs. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for CertificateMergeParameters. +func (cmp CertificateMergeParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cmp.X509Certificates != nil { + objectMap["x5c"] = cmp.X509Certificates + } + if cmp.CertificateAttributes != nil { + objectMap["attributes"] = cmp.CertificateAttributes + } + if cmp.Tags != nil { + objectMap["tags"] = cmp.Tags + } + return json.Marshal(objectMap) +} + +// CertificateOperation a certificate operation is returned in case of asynchronous requests. +type CertificateOperation struct { + autorest.Response `json:"-"` + // ID - The certificate id. + ID *string `json:"id,omitempty"` + // IssuerParameters - Parameters for the issuer of the X509 component of a certificate. + IssuerParameters *IssuerParameters `json:"issuer,omitempty"` + // Csr - The certificate signing request (CSR) that is being used in the certificate operation. + Csr *[]byte `json:"csr,omitempty"` + // CancellationRequested - Indicates if cancellation was requested on the certificate operation. + CancellationRequested *bool `json:"cancellation_requested,omitempty"` + // Status - Status of the certificate operation. + Status *string `json:"status,omitempty"` + // StatusDetails - The status details of the certificate operation. + StatusDetails *string `json:"status_details,omitempty"` + // Error - Error encountered, if any, during the certificate operation. + Error *Error `json:"error,omitempty"` + // Target - Location which contains the result of the certificate operation. + Target *string `json:"target,omitempty"` + // RequestID - Identifier for the certificate operation. + RequestID *string `json:"request_id,omitempty"` +} + +// CertificateOperationUpdateParameter the certificate operation update parameters. +type CertificateOperationUpdateParameter struct { + // CancellationRequested - Indicates if cancellation was requested on the certificate operation. + CancellationRequested *bool `json:"cancellation_requested,omitempty"` +} + +// CertificatePolicy management policy for a certificate. +type CertificatePolicy struct { + autorest.Response `json:"-"` + // ID - The certificate id. + ID *string `json:"id,omitempty"` + // KeyProperties - Properties of the key backing a certificate. + KeyProperties *KeyProperties `json:"key_props,omitempty"` + // SecretProperties - Properties of the secret backing a certificate. + SecretProperties *SecretProperties `json:"secret_props,omitempty"` + // X509CertificateProperties - Properties of the X509 component of a certificate. + X509CertificateProperties *X509CertificateProperties `json:"x509_props,omitempty"` + // LifetimeActions - Actions that will be performed by Key Vault over the lifetime of a certificate. + LifetimeActions *[]LifetimeAction `json:"lifetime_actions,omitempty"` + // IssuerParameters - Parameters for the issuer of the X509 component of a certificate. + IssuerParameters *IssuerParameters `json:"issuer,omitempty"` + // Attributes - The certificate attributes. + Attributes *CertificateAttributes `json:"attributes,omitempty"` +} + +// CertificateRestoreParameters the certificate restore parameters. +type CertificateRestoreParameters struct { + // CertificateBundleBackup - The backup blob associated with a certificate bundle. (a URL-encoded base64 string) + CertificateBundleBackup *string `json:"value,omitempty"` +} + +// CertificateUpdateParameters the certificate update parameters. +type CertificateUpdateParameters struct { + // CertificatePolicy - The management policy for the certificate. + CertificatePolicy *CertificatePolicy `json:"policy,omitempty"` + // CertificateAttributes - The attributes of the certificate (optional). + CertificateAttributes *CertificateAttributes `json:"attributes,omitempty"` + // Tags - Application specific metadata in the form of key-value pairs. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for CertificateUpdateParameters. +func (cup CertificateUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cup.CertificatePolicy != nil { + objectMap["policy"] = cup.CertificatePolicy + } + if cup.CertificateAttributes != nil { + objectMap["attributes"] = cup.CertificateAttributes + } + if cup.Tags != nil { + objectMap["tags"] = cup.Tags + } + return json.Marshal(objectMap) +} + +// Contact the contact information for the vault certificates. +type Contact struct { + // EmailAddress - Email addresss. + EmailAddress *string `json:"email,omitempty"` + // Name - Name. + Name *string `json:"name,omitempty"` + // Phone - Phone number. + Phone *string `json:"phone,omitempty"` +} + +// Contacts the contacts for the vault certificates. +type Contacts struct { + autorest.Response `json:"-"` + // ID - Identifier for the contacts collection. + ID *string `json:"id,omitempty"` + // ContactList - The contact list for the vault certificates. + ContactList *[]Contact `json:"contacts,omitempty"` +} + +// DeletedCertificateBundle a Deleted Certificate consisting of its previous id, attributes and its tags, as well +// as information on when it will be purged. +type DeletedCertificateBundle struct { + autorest.Response `json:"-"` + // RecoveryID - The url of the recovery object, used to identify and recover the deleted certificate. + RecoveryID *string `json:"recoveryId,omitempty"` + // ScheduledPurgeDate - The time when the certificate is scheduled to be purged, in UTC + ScheduledPurgeDate *date.UnixTime `json:"scheduledPurgeDate,omitempty"` + // DeletedDate - The time when the certificate was deleted, in UTC + DeletedDate *date.UnixTime `json:"deletedDate,omitempty"` + // ID - The certificate id. + ID *string `json:"id,omitempty"` + // Kid - The key id. + Kid *string `json:"kid,omitempty"` + // Sid - The secret id. + Sid *string `json:"sid,omitempty"` + // X509Thumbprint - Thumbprint of the certificate. (a URL-encoded base64 string) + X509Thumbprint *string `json:"x5t,omitempty"` + // Policy - The management policy. + Policy *CertificatePolicy `json:"policy,omitempty"` + // Cer - CER contents of x509 certificate. + Cer *[]byte `json:"cer,omitempty"` + // ContentType - The content type of the secret. + ContentType *string `json:"contentType,omitempty"` + // Attributes - The certificate attributes. + Attributes *CertificateAttributes `json:"attributes,omitempty"` + // Tags - Application specific metadata in the form of key-value pairs + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for DeletedCertificateBundle. +func (dcb DeletedCertificateBundle) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dcb.RecoveryID != nil { + objectMap["recoveryId"] = dcb.RecoveryID + } + if dcb.ScheduledPurgeDate != nil { + objectMap["scheduledPurgeDate"] = dcb.ScheduledPurgeDate + } + if dcb.DeletedDate != nil { + objectMap["deletedDate"] = dcb.DeletedDate + } + if dcb.ID != nil { + objectMap["id"] = dcb.ID + } + if dcb.Kid != nil { + objectMap["kid"] = dcb.Kid + } + if dcb.Sid != nil { + objectMap["sid"] = dcb.Sid + } + if dcb.X509Thumbprint != nil { + objectMap["x5t"] = dcb.X509Thumbprint + } + if dcb.Policy != nil { + objectMap["policy"] = dcb.Policy + } + if dcb.Cer != nil { + objectMap["cer"] = dcb.Cer + } + if dcb.ContentType != nil { + objectMap["contentType"] = dcb.ContentType + } + if dcb.Attributes != nil { + objectMap["attributes"] = dcb.Attributes + } + if dcb.Tags != nil { + objectMap["tags"] = dcb.Tags + } + return json.Marshal(objectMap) +} + +// DeletedCertificateItem the deleted certificate item containing metadata about the deleted certificate. +type DeletedCertificateItem struct { + // RecoveryID - The url of the recovery object, used to identify and recover the deleted certificate. + RecoveryID *string `json:"recoveryId,omitempty"` + // ScheduledPurgeDate - The time when the certificate is scheduled to be purged, in UTC + ScheduledPurgeDate *date.UnixTime `json:"scheduledPurgeDate,omitempty"` + // DeletedDate - The time when the certificate was deleted, in UTC + DeletedDate *date.UnixTime `json:"deletedDate,omitempty"` + // ID - Certificate identifier. + ID *string `json:"id,omitempty"` + // Attributes - The certificate management attributes. + Attributes *CertificateAttributes `json:"attributes,omitempty"` + // Tags - Application specific metadata in the form of key-value pairs. + Tags map[string]*string `json:"tags"` + // X509Thumbprint - Thumbprint of the certificate. (a URL-encoded base64 string) + X509Thumbprint *string `json:"x5t,omitempty"` +} + +// MarshalJSON is the custom marshaler for DeletedCertificateItem. +func (dci DeletedCertificateItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dci.RecoveryID != nil { + objectMap["recoveryId"] = dci.RecoveryID + } + if dci.ScheduledPurgeDate != nil { + objectMap["scheduledPurgeDate"] = dci.ScheduledPurgeDate + } + if dci.DeletedDate != nil { + objectMap["deletedDate"] = dci.DeletedDate + } + if dci.ID != nil { + objectMap["id"] = dci.ID + } + if dci.Attributes != nil { + objectMap["attributes"] = dci.Attributes + } + if dci.Tags != nil { + objectMap["tags"] = dci.Tags + } + if dci.X509Thumbprint != nil { + objectMap["x5t"] = dci.X509Thumbprint + } + return json.Marshal(objectMap) +} + +// DeletedCertificateListResult a list of certificates that have been deleted in this vault. +type DeletedCertificateListResult struct { + autorest.Response `json:"-"` + // Value - A response message containing a list of deleted certificates in the vault along with a link to the next page of deleted certificates + Value *[]DeletedCertificateItem `json:"value,omitempty"` + // NextLink - The URL to get the next set of deleted certificates. + NextLink *string `json:"nextLink,omitempty"` +} + +// DeletedCertificateListResultIterator provides access to a complete listing of DeletedCertificateItem values. +type DeletedCertificateListResultIterator struct { + i int + page DeletedCertificateListResultPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *DeletedCertificateListResultIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter DeletedCertificateListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter DeletedCertificateListResultIterator) Response() DeletedCertificateListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter DeletedCertificateListResultIterator) Value() DeletedCertificateItem { + if !iter.page.NotDone() { + return DeletedCertificateItem{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (dclr DeletedCertificateListResult) IsEmpty() bool { + return dclr.Value == nil || len(*dclr.Value) == 0 +} + +// deletedCertificateListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (dclr DeletedCertificateListResult) deletedCertificateListResultPreparer() (*http.Request, error) { + if dclr.NextLink == nil || len(to.String(dclr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(dclr.NextLink))) +} + +// DeletedCertificateListResultPage contains a page of DeletedCertificateItem values. +type DeletedCertificateListResultPage struct { + fn func(DeletedCertificateListResult) (DeletedCertificateListResult, error) + dclr DeletedCertificateListResult +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *DeletedCertificateListResultPage) Next() error { + next, err := page.fn(page.dclr) + if err != nil { + return err + } + page.dclr = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page DeletedCertificateListResultPage) NotDone() bool { + return !page.dclr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page DeletedCertificateListResultPage) Response() DeletedCertificateListResult { + return page.dclr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page DeletedCertificateListResultPage) Values() []DeletedCertificateItem { + if page.dclr.IsEmpty() { + return nil + } + return *page.dclr.Value +} + +// DeletedKeyBundle a DeletedKeyBundle consisting of a WebKey plus its Attributes and deletion info +type DeletedKeyBundle struct { + autorest.Response `json:"-"` + // RecoveryID - The url of the recovery object, used to identify and recover the deleted key. + RecoveryID *string `json:"recoveryId,omitempty"` + // ScheduledPurgeDate - The time when the key is scheduled to be purged, in UTC + ScheduledPurgeDate *date.UnixTime `json:"scheduledPurgeDate,omitempty"` + // DeletedDate - The time when the key was deleted, in UTC + DeletedDate *date.UnixTime `json:"deletedDate,omitempty"` + // Key - The Json web key. + Key *JSONWebKey `json:"key,omitempty"` + // Attributes - The key management attributes. + Attributes *KeyAttributes `json:"attributes,omitempty"` + // Tags - Application specific metadata in the form of key-value pairs. + Tags map[string]*string `json:"tags"` + // Managed - True if the key's lifetime is managed by key vault. If this is a key backing a certificate, then managed will be true. + Managed *bool `json:"managed,omitempty"` +} + +// MarshalJSON is the custom marshaler for DeletedKeyBundle. +func (dkb DeletedKeyBundle) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dkb.RecoveryID != nil { + objectMap["recoveryId"] = dkb.RecoveryID + } + if dkb.ScheduledPurgeDate != nil { + objectMap["scheduledPurgeDate"] = dkb.ScheduledPurgeDate + } + if dkb.DeletedDate != nil { + objectMap["deletedDate"] = dkb.DeletedDate + } + if dkb.Key != nil { + objectMap["key"] = dkb.Key + } + if dkb.Attributes != nil { + objectMap["attributes"] = dkb.Attributes + } + if dkb.Tags != nil { + objectMap["tags"] = dkb.Tags + } + if dkb.Managed != nil { + objectMap["managed"] = dkb.Managed + } + return json.Marshal(objectMap) +} + +// DeletedKeyItem the deleted key item containing the deleted key metadata and information about deletion. +type DeletedKeyItem struct { + // RecoveryID - The url of the recovery object, used to identify and recover the deleted key. + RecoveryID *string `json:"recoveryId,omitempty"` + // ScheduledPurgeDate - The time when the key is scheduled to be purged, in UTC + ScheduledPurgeDate *date.UnixTime `json:"scheduledPurgeDate,omitempty"` + // DeletedDate - The time when the key was deleted, in UTC + DeletedDate *date.UnixTime `json:"deletedDate,omitempty"` + // Kid - Key identifier. + Kid *string `json:"kid,omitempty"` + // Attributes - The key management attributes. + Attributes *KeyAttributes `json:"attributes,omitempty"` + // Tags - Application specific metadata in the form of key-value pairs. + Tags map[string]*string `json:"tags"` + // Managed - True if the key's lifetime is managed by key vault. If this is a key backing a certificate, then managed will be true. + Managed *bool `json:"managed,omitempty"` +} + +// MarshalJSON is the custom marshaler for DeletedKeyItem. +func (dki DeletedKeyItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dki.RecoveryID != nil { + objectMap["recoveryId"] = dki.RecoveryID + } + if dki.ScheduledPurgeDate != nil { + objectMap["scheduledPurgeDate"] = dki.ScheduledPurgeDate + } + if dki.DeletedDate != nil { + objectMap["deletedDate"] = dki.DeletedDate + } + if dki.Kid != nil { + objectMap["kid"] = dki.Kid + } + if dki.Attributes != nil { + objectMap["attributes"] = dki.Attributes + } + if dki.Tags != nil { + objectMap["tags"] = dki.Tags + } + if dki.Managed != nil { + objectMap["managed"] = dki.Managed + } + return json.Marshal(objectMap) +} + +// DeletedKeyListResult a list of keys that have been deleted in this vault. +type DeletedKeyListResult struct { + autorest.Response `json:"-"` + // Value - A response message containing a list of deleted keys in the vault along with a link to the next page of deleted keys + Value *[]DeletedKeyItem `json:"value,omitempty"` + // NextLink - The URL to get the next set of deleted keys. + NextLink *string `json:"nextLink,omitempty"` +} + +// DeletedKeyListResultIterator provides access to a complete listing of DeletedKeyItem values. +type DeletedKeyListResultIterator struct { + i int + page DeletedKeyListResultPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *DeletedKeyListResultIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter DeletedKeyListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter DeletedKeyListResultIterator) Response() DeletedKeyListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter DeletedKeyListResultIterator) Value() DeletedKeyItem { + if !iter.page.NotDone() { + return DeletedKeyItem{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (dklr DeletedKeyListResult) IsEmpty() bool { + return dklr.Value == nil || len(*dklr.Value) == 0 +} + +// deletedKeyListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (dklr DeletedKeyListResult) deletedKeyListResultPreparer() (*http.Request, error) { + if dklr.NextLink == nil || len(to.String(dklr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(dklr.NextLink))) +} + +// DeletedKeyListResultPage contains a page of DeletedKeyItem values. +type DeletedKeyListResultPage struct { + fn func(DeletedKeyListResult) (DeletedKeyListResult, error) + dklr DeletedKeyListResult +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *DeletedKeyListResultPage) Next() error { + next, err := page.fn(page.dklr) + if err != nil { + return err + } + page.dklr = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page DeletedKeyListResultPage) NotDone() bool { + return !page.dklr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page DeletedKeyListResultPage) Response() DeletedKeyListResult { + return page.dklr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page DeletedKeyListResultPage) Values() []DeletedKeyItem { + if page.dklr.IsEmpty() { + return nil + } + return *page.dklr.Value +} + +// DeletedSasDefinitionBundle a deleted SAS definition bundle consisting of its previous id, attributes and its +// tags, as well as information on when it will be purged. +type DeletedSasDefinitionBundle struct { + autorest.Response `json:"-"` + // RecoveryID - The url of the recovery object, used to identify and recover the deleted SAS definition. + RecoveryID *string `json:"recoveryId,omitempty"` + // ScheduledPurgeDate - The time when the SAS definition is scheduled to be purged, in UTC + ScheduledPurgeDate *date.UnixTime `json:"scheduledPurgeDate,omitempty"` + // DeletedDate - The time when the SAS definition was deleted, in UTC + DeletedDate *date.UnixTime `json:"deletedDate,omitempty"` + // ID - The SAS definition id. + ID *string `json:"id,omitempty"` + // SecretID - Storage account SAS definition secret id. + SecretID *string `json:"sid,omitempty"` + // TemplateURI - The SAS definition token template signed with an arbitrary key. Tokens created according to the SAS definition will have the same properties as the template. + TemplateURI *string `json:"templateUri,omitempty"` + // SasType - The type of SAS token the SAS definition will create. Possible values include: 'Account', 'Service' + SasType SasTokenType `json:"sasType,omitempty"` + // ValidityPeriod - The validity period of SAS tokens created according to the SAS definition. + ValidityPeriod *string `json:"validityPeriod,omitempty"` + // Attributes - The SAS definition attributes. + Attributes *SasDefinitionAttributes `json:"attributes,omitempty"` + // Tags - Application specific metadata in the form of key-value pairs + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for DeletedSasDefinitionBundle. +func (dsdb DeletedSasDefinitionBundle) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dsdb.RecoveryID != nil { + objectMap["recoveryId"] = dsdb.RecoveryID + } + if dsdb.ScheduledPurgeDate != nil { + objectMap["scheduledPurgeDate"] = dsdb.ScheduledPurgeDate + } + if dsdb.DeletedDate != nil { + objectMap["deletedDate"] = dsdb.DeletedDate + } + if dsdb.ID != nil { + objectMap["id"] = dsdb.ID + } + if dsdb.SecretID != nil { + objectMap["sid"] = dsdb.SecretID + } + if dsdb.TemplateURI != nil { + objectMap["templateUri"] = dsdb.TemplateURI + } + if dsdb.SasType != "" { + objectMap["sasType"] = dsdb.SasType + } + if dsdb.ValidityPeriod != nil { + objectMap["validityPeriod"] = dsdb.ValidityPeriod + } + if dsdb.Attributes != nil { + objectMap["attributes"] = dsdb.Attributes + } + if dsdb.Tags != nil { + objectMap["tags"] = dsdb.Tags + } + return json.Marshal(objectMap) +} + +// DeletedSasDefinitionItem the deleted SAS definition item containing metadata about the deleted SAS definition. +type DeletedSasDefinitionItem struct { + // RecoveryID - The url of the recovery object, used to identify and recover the deleted SAS definition. + RecoveryID *string `json:"recoveryId,omitempty"` + // ScheduledPurgeDate - The time when the SAS definition is scheduled to be purged, in UTC + ScheduledPurgeDate *date.UnixTime `json:"scheduledPurgeDate,omitempty"` + // DeletedDate - The time when the SAS definition was deleted, in UTC + DeletedDate *date.UnixTime `json:"deletedDate,omitempty"` + // ID - The storage SAS identifier. + ID *string `json:"id,omitempty"` + // SecretID - The storage account SAS definition secret id. + SecretID *string `json:"sid,omitempty"` + // Attributes - The SAS definition management attributes. + Attributes *SasDefinitionAttributes `json:"attributes,omitempty"` + // Tags - Application specific metadata in the form of key-value pairs. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for DeletedSasDefinitionItem. +func (dsdi DeletedSasDefinitionItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dsdi.RecoveryID != nil { + objectMap["recoveryId"] = dsdi.RecoveryID + } + if dsdi.ScheduledPurgeDate != nil { + objectMap["scheduledPurgeDate"] = dsdi.ScheduledPurgeDate + } + if dsdi.DeletedDate != nil { + objectMap["deletedDate"] = dsdi.DeletedDate + } + if dsdi.ID != nil { + objectMap["id"] = dsdi.ID + } + if dsdi.SecretID != nil { + objectMap["sid"] = dsdi.SecretID + } + if dsdi.Attributes != nil { + objectMap["attributes"] = dsdi.Attributes + } + if dsdi.Tags != nil { + objectMap["tags"] = dsdi.Tags + } + return json.Marshal(objectMap) +} + +// DeletedSasDefinitionListResult the deleted SAS definition list result +type DeletedSasDefinitionListResult struct { + autorest.Response `json:"-"` + // Value - A response message containing a list of the deleted SAS definitions in the vault along with a link to the next page of deleted sas definitions + Value *[]DeletedSasDefinitionItem `json:"value,omitempty"` + // NextLink - The URL to get the next set of deleted SAS definitions. + NextLink *string `json:"nextLink,omitempty"` +} + +// DeletedSasDefinitionListResultIterator provides access to a complete listing of DeletedSasDefinitionItem values. +type DeletedSasDefinitionListResultIterator struct { + i int + page DeletedSasDefinitionListResultPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *DeletedSasDefinitionListResultIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter DeletedSasDefinitionListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter DeletedSasDefinitionListResultIterator) Response() DeletedSasDefinitionListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter DeletedSasDefinitionListResultIterator) Value() DeletedSasDefinitionItem { + if !iter.page.NotDone() { + return DeletedSasDefinitionItem{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (dsdlr DeletedSasDefinitionListResult) IsEmpty() bool { + return dsdlr.Value == nil || len(*dsdlr.Value) == 0 +} + +// deletedSasDefinitionListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (dsdlr DeletedSasDefinitionListResult) deletedSasDefinitionListResultPreparer() (*http.Request, error) { + if dsdlr.NextLink == nil || len(to.String(dsdlr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(dsdlr.NextLink))) +} + +// DeletedSasDefinitionListResultPage contains a page of DeletedSasDefinitionItem values. +type DeletedSasDefinitionListResultPage struct { + fn func(DeletedSasDefinitionListResult) (DeletedSasDefinitionListResult, error) + dsdlr DeletedSasDefinitionListResult +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *DeletedSasDefinitionListResultPage) Next() error { + next, err := page.fn(page.dsdlr) + if err != nil { + return err + } + page.dsdlr = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page DeletedSasDefinitionListResultPage) NotDone() bool { + return !page.dsdlr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page DeletedSasDefinitionListResultPage) Response() DeletedSasDefinitionListResult { + return page.dsdlr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page DeletedSasDefinitionListResultPage) Values() []DeletedSasDefinitionItem { + if page.dsdlr.IsEmpty() { + return nil + } + return *page.dsdlr.Value +} + +// DeletedSecretBundle a Deleted Secret consisting of its previous id, attributes and its tags, as well as +// information on when it will be purged. +type DeletedSecretBundle struct { + autorest.Response `json:"-"` + // RecoveryID - The url of the recovery object, used to identify and recover the deleted secret. + RecoveryID *string `json:"recoveryId,omitempty"` + // ScheduledPurgeDate - The time when the secret is scheduled to be purged, in UTC + ScheduledPurgeDate *date.UnixTime `json:"scheduledPurgeDate,omitempty"` + // DeletedDate - The time when the secret was deleted, in UTC + DeletedDate *date.UnixTime `json:"deletedDate,omitempty"` + // Value - The secret value. + Value *string `json:"value,omitempty"` + // ID - The secret id. + ID *string `json:"id,omitempty"` + // ContentType - The content type of the secret. + ContentType *string `json:"contentType,omitempty"` + // Attributes - The secret management attributes. + Attributes *SecretAttributes `json:"attributes,omitempty"` + // Tags - Application specific metadata in the form of key-value pairs. + Tags map[string]*string `json:"tags"` + // Kid - If this is a secret backing a KV certificate, then this field specifies the corresponding key backing the KV certificate. + Kid *string `json:"kid,omitempty"` + // Managed - True if the secret's lifetime is managed by key vault. If this is a secret backing a certificate, then managed will be true. + Managed *bool `json:"managed,omitempty"` +} + +// MarshalJSON is the custom marshaler for DeletedSecretBundle. +func (dsb DeletedSecretBundle) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dsb.RecoveryID != nil { + objectMap["recoveryId"] = dsb.RecoveryID + } + if dsb.ScheduledPurgeDate != nil { + objectMap["scheduledPurgeDate"] = dsb.ScheduledPurgeDate + } + if dsb.DeletedDate != nil { + objectMap["deletedDate"] = dsb.DeletedDate + } + if dsb.Value != nil { + objectMap["value"] = dsb.Value + } + if dsb.ID != nil { + objectMap["id"] = dsb.ID + } + if dsb.ContentType != nil { + objectMap["contentType"] = dsb.ContentType + } + if dsb.Attributes != nil { + objectMap["attributes"] = dsb.Attributes + } + if dsb.Tags != nil { + objectMap["tags"] = dsb.Tags + } + if dsb.Kid != nil { + objectMap["kid"] = dsb.Kid + } + if dsb.Managed != nil { + objectMap["managed"] = dsb.Managed + } + return json.Marshal(objectMap) +} + +// DeletedSecretItem the deleted secret item containing metadata about the deleted secret. +type DeletedSecretItem struct { + // RecoveryID - The url of the recovery object, used to identify and recover the deleted secret. + RecoveryID *string `json:"recoveryId,omitempty"` + // ScheduledPurgeDate - The time when the secret is scheduled to be purged, in UTC + ScheduledPurgeDate *date.UnixTime `json:"scheduledPurgeDate,omitempty"` + // DeletedDate - The time when the secret was deleted, in UTC + DeletedDate *date.UnixTime `json:"deletedDate,omitempty"` + // ID - Secret identifier. + ID *string `json:"id,omitempty"` + // Attributes - The secret management attributes. + Attributes *SecretAttributes `json:"attributes,omitempty"` + // Tags - Application specific metadata in the form of key-value pairs. + Tags map[string]*string `json:"tags"` + // ContentType - Type of the secret value such as a password. + ContentType *string `json:"contentType,omitempty"` + // Managed - True if the secret's lifetime is managed by key vault. If this is a key backing a certificate, then managed will be true. + Managed *bool `json:"managed,omitempty"` +} + +// MarshalJSON is the custom marshaler for DeletedSecretItem. +func (dsi DeletedSecretItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dsi.RecoveryID != nil { + objectMap["recoveryId"] = dsi.RecoveryID + } + if dsi.ScheduledPurgeDate != nil { + objectMap["scheduledPurgeDate"] = dsi.ScheduledPurgeDate + } + if dsi.DeletedDate != nil { + objectMap["deletedDate"] = dsi.DeletedDate + } + if dsi.ID != nil { + objectMap["id"] = dsi.ID + } + if dsi.Attributes != nil { + objectMap["attributes"] = dsi.Attributes + } + if dsi.Tags != nil { + objectMap["tags"] = dsi.Tags + } + if dsi.ContentType != nil { + objectMap["contentType"] = dsi.ContentType + } + if dsi.Managed != nil { + objectMap["managed"] = dsi.Managed + } + return json.Marshal(objectMap) +} + +// DeletedSecretListResult the deleted secret list result +type DeletedSecretListResult struct { + autorest.Response `json:"-"` + // Value - A response message containing a list of the deleted secrets in the vault along with a link to the next page of deleted secrets + Value *[]DeletedSecretItem `json:"value,omitempty"` + // NextLink - The URL to get the next set of deleted secrets. + NextLink *string `json:"nextLink,omitempty"` +} + +// DeletedSecretListResultIterator provides access to a complete listing of DeletedSecretItem values. +type DeletedSecretListResultIterator struct { + i int + page DeletedSecretListResultPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *DeletedSecretListResultIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter DeletedSecretListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter DeletedSecretListResultIterator) Response() DeletedSecretListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter DeletedSecretListResultIterator) Value() DeletedSecretItem { + if !iter.page.NotDone() { + return DeletedSecretItem{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (dslr DeletedSecretListResult) IsEmpty() bool { + return dslr.Value == nil || len(*dslr.Value) == 0 +} + +// deletedSecretListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (dslr DeletedSecretListResult) deletedSecretListResultPreparer() (*http.Request, error) { + if dslr.NextLink == nil || len(to.String(dslr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(dslr.NextLink))) +} + +// DeletedSecretListResultPage contains a page of DeletedSecretItem values. +type DeletedSecretListResultPage struct { + fn func(DeletedSecretListResult) (DeletedSecretListResult, error) + dslr DeletedSecretListResult +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *DeletedSecretListResultPage) Next() error { + next, err := page.fn(page.dslr) + if err != nil { + return err + } + page.dslr = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page DeletedSecretListResultPage) NotDone() bool { + return !page.dslr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page DeletedSecretListResultPage) Response() DeletedSecretListResult { + return page.dslr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page DeletedSecretListResultPage) Values() []DeletedSecretItem { + if page.dslr.IsEmpty() { + return nil + } + return *page.dslr.Value +} + +// DeletedStorageAccountItem the deleted storage account item containing metadata about the deleted storage +// account. +type DeletedStorageAccountItem struct { + // RecoveryID - The url of the recovery object, used to identify and recover the deleted storage account. + RecoveryID *string `json:"recoveryId,omitempty"` + // ScheduledPurgeDate - The time when the storage account is scheduled to be purged, in UTC + ScheduledPurgeDate *date.UnixTime `json:"scheduledPurgeDate,omitempty"` + // DeletedDate - The time when the storage account was deleted, in UTC + DeletedDate *date.UnixTime `json:"deletedDate,omitempty"` + // ID - Storage identifier. + ID *string `json:"id,omitempty"` + // ResourceID - Storage account resource Id. + ResourceID *string `json:"resourceId,omitempty"` + // Attributes - The storage account management attributes. + Attributes *StorageAccountAttributes `json:"attributes,omitempty"` + // Tags - Application specific metadata in the form of key-value pairs. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for DeletedStorageAccountItem. +func (dsai DeletedStorageAccountItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dsai.RecoveryID != nil { + objectMap["recoveryId"] = dsai.RecoveryID + } + if dsai.ScheduledPurgeDate != nil { + objectMap["scheduledPurgeDate"] = dsai.ScheduledPurgeDate + } + if dsai.DeletedDate != nil { + objectMap["deletedDate"] = dsai.DeletedDate + } + if dsai.ID != nil { + objectMap["id"] = dsai.ID + } + if dsai.ResourceID != nil { + objectMap["resourceId"] = dsai.ResourceID + } + if dsai.Attributes != nil { + objectMap["attributes"] = dsai.Attributes + } + if dsai.Tags != nil { + objectMap["tags"] = dsai.Tags + } + return json.Marshal(objectMap) +} + +// DeletedStorageBundle a deleted storage account bundle consisting of its previous id, attributes and its tags, as +// well as information on when it will be purged. +type DeletedStorageBundle struct { + autorest.Response `json:"-"` + // RecoveryID - The url of the recovery object, used to identify and recover the deleted storage account. + RecoveryID *string `json:"recoveryId,omitempty"` + // ScheduledPurgeDate - The time when the storage account is scheduled to be purged, in UTC + ScheduledPurgeDate *date.UnixTime `json:"scheduledPurgeDate,omitempty"` + // DeletedDate - The time when the storage account was deleted, in UTC + DeletedDate *date.UnixTime `json:"deletedDate,omitempty"` + // ID - The storage account id. + ID *string `json:"id,omitempty"` + // ResourceID - The storage account resource id. + ResourceID *string `json:"resourceId,omitempty"` + // ActiveKeyName - The current active storage account key name. + ActiveKeyName *string `json:"activeKeyName,omitempty"` + // AutoRegenerateKey - whether keyvault should manage the storage account for the user. + AutoRegenerateKey *bool `json:"autoRegenerateKey,omitempty"` + // RegenerationPeriod - The key regeneration time duration specified in ISO-8601 format. + RegenerationPeriod *string `json:"regenerationPeriod,omitempty"` + // Attributes - The storage account attributes. + Attributes *StorageAccountAttributes `json:"attributes,omitempty"` + // Tags - Application specific metadata in the form of key-value pairs + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for DeletedStorageBundle. +func (dsb DeletedStorageBundle) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dsb.RecoveryID != nil { + objectMap["recoveryId"] = dsb.RecoveryID + } + if dsb.ScheduledPurgeDate != nil { + objectMap["scheduledPurgeDate"] = dsb.ScheduledPurgeDate + } + if dsb.DeletedDate != nil { + objectMap["deletedDate"] = dsb.DeletedDate + } + if dsb.ID != nil { + objectMap["id"] = dsb.ID + } + if dsb.ResourceID != nil { + objectMap["resourceId"] = dsb.ResourceID + } + if dsb.ActiveKeyName != nil { + objectMap["activeKeyName"] = dsb.ActiveKeyName + } + if dsb.AutoRegenerateKey != nil { + objectMap["autoRegenerateKey"] = dsb.AutoRegenerateKey + } + if dsb.RegenerationPeriod != nil { + objectMap["regenerationPeriod"] = dsb.RegenerationPeriod + } + if dsb.Attributes != nil { + objectMap["attributes"] = dsb.Attributes + } + if dsb.Tags != nil { + objectMap["tags"] = dsb.Tags + } + return json.Marshal(objectMap) +} + +// DeletedStorageListResult the deleted storage account list result +type DeletedStorageListResult struct { + autorest.Response `json:"-"` + // Value - A response message containing a list of the deleted storage accounts in the vault along with a link to the next page of deleted storage accounts + Value *[]DeletedStorageAccountItem `json:"value,omitempty"` + // NextLink - The URL to get the next set of deleted storage accounts. + NextLink *string `json:"nextLink,omitempty"` +} + +// DeletedStorageListResultIterator provides access to a complete listing of DeletedStorageAccountItem values. +type DeletedStorageListResultIterator struct { + i int + page DeletedStorageListResultPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *DeletedStorageListResultIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter DeletedStorageListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter DeletedStorageListResultIterator) Response() DeletedStorageListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter DeletedStorageListResultIterator) Value() DeletedStorageAccountItem { + if !iter.page.NotDone() { + return DeletedStorageAccountItem{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (dslr DeletedStorageListResult) IsEmpty() bool { + return dslr.Value == nil || len(*dslr.Value) == 0 +} + +// deletedStorageListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (dslr DeletedStorageListResult) deletedStorageListResultPreparer() (*http.Request, error) { + if dslr.NextLink == nil || len(to.String(dslr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(dslr.NextLink))) +} + +// DeletedStorageListResultPage contains a page of DeletedStorageAccountItem values. +type DeletedStorageListResultPage struct { + fn func(DeletedStorageListResult) (DeletedStorageListResult, error) + dslr DeletedStorageListResult +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *DeletedStorageListResultPage) Next() error { + next, err := page.fn(page.dslr) + if err != nil { + return err + } + page.dslr = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page DeletedStorageListResultPage) NotDone() bool { + return !page.dslr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page DeletedStorageListResultPage) Response() DeletedStorageListResult { + return page.dslr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page DeletedStorageListResultPage) Values() []DeletedStorageAccountItem { + if page.dslr.IsEmpty() { + return nil + } + return *page.dslr.Value +} + +// Error the key vault server error. +type Error struct { + // Code - The error code. + Code *string `json:"code,omitempty"` + // Message - The error message. + Message *string `json:"message,omitempty"` + InnerError *Error `json:"innererror,omitempty"` +} + +// ErrorType the key vault error exception. +type ErrorType struct { + Error *Error `json:"error,omitempty"` +} + +// IssuerAttributes the attributes of an issuer managed by the Key Vault service. +type IssuerAttributes struct { + // Enabled - Determines whether the issuer is enabled. + Enabled *bool `json:"enabled,omitempty"` + // Created - Creation time in UTC. + Created *date.UnixTime `json:"created,omitempty"` + // Updated - Last updated time in UTC. + Updated *date.UnixTime `json:"updated,omitempty"` +} + +// IssuerBundle the issuer for Key Vault certificate. +type IssuerBundle struct { + autorest.Response `json:"-"` + // ID - Identifier for the issuer object. + ID *string `json:"id,omitempty"` + // Provider - The issuer provider. + Provider *string `json:"provider,omitempty"` + // Credentials - The credentials to be used for the issuer. + Credentials *IssuerCredentials `json:"credentials,omitempty"` + // OrganizationDetails - Details of the organization as provided to the issuer. + OrganizationDetails *OrganizationDetails `json:"org_details,omitempty"` + // Attributes - Attributes of the issuer object. + Attributes *IssuerAttributes `json:"attributes,omitempty"` +} + +// IssuerCredentials the credentials to be used for the certificate issuer. +type IssuerCredentials struct { + // AccountID - The user name/account name/account id. + AccountID *string `json:"account_id,omitempty"` + // Password - The password/secret/account key. + Password *string `json:"pwd,omitempty"` +} + +// IssuerParameters parameters for the issuer of the X509 component of a certificate. +type IssuerParameters struct { + // Name - Name of the referenced issuer object or reserved names; for example, 'Self' or 'Unknown'. + Name *string `json:"name,omitempty"` + // CertificateType - Type of certificate to be requested from the issuer provider. + CertificateType *string `json:"cty,omitempty"` + // CertificateTransparency - Indicates if the certificates generated under this policy should be published to certificate transparency logs. + CertificateTransparency *bool `json:"cert_transparency,omitempty"` +} + +// JSONWebKey as of http://tools.ietf.org/html/draft-ietf-jose-json-web-key-18 +type JSONWebKey struct { + // Kid - Key identifier. + Kid *string `json:"kid,omitempty"` + // Kty - JsonWebKey Key Type (kty), as defined in https://tools.ietf.org/html/draft-ietf-jose-json-web-algorithms-40. Possible values include: 'EC', 'ECHSM', 'RSA', 'RSAHSM', 'Oct' + Kty JSONWebKeyType `json:"kty,omitempty"` + KeyOps *[]string `json:"key_ops,omitempty"` + // N - RSA modulus. (a URL-encoded base64 string) + N *string `json:"n,omitempty"` + // E - RSA public exponent. (a URL-encoded base64 string) + E *string `json:"e,omitempty"` + // D - RSA private exponent, or the D component of an EC private key. (a URL-encoded base64 string) + D *string `json:"d,omitempty"` + // DP - RSA private key parameter. (a URL-encoded base64 string) + DP *string `json:"dp,omitempty"` + // DQ - RSA private key parameter. (a URL-encoded base64 string) + DQ *string `json:"dq,omitempty"` + // QI - RSA private key parameter. (a URL-encoded base64 string) + QI *string `json:"qi,omitempty"` + // P - RSA secret prime. (a URL-encoded base64 string) + P *string `json:"p,omitempty"` + // Q - RSA secret prime, with p < q. (a URL-encoded base64 string) + Q *string `json:"q,omitempty"` + // K - Symmetric key. (a URL-encoded base64 string) + K *string `json:"k,omitempty"` + // T - HSM Token, used with 'Bring Your Own Key'. (a URL-encoded base64 string) + T *string `json:"key_hsm,omitempty"` + // Crv - Elliptic curve name. For valid values, see JsonWebKeyCurveName. Possible values include: 'P256', 'P384', 'P521', 'P256K' + Crv JSONWebKeyCurveName `json:"crv,omitempty"` + // X - X component of an EC public key. (a URL-encoded base64 string) + X *string `json:"x,omitempty"` + // Y - Y component of an EC public key. (a URL-encoded base64 string) + Y *string `json:"y,omitempty"` +} + +// KeyAttributes the attributes of a key managed by the key vault service. +type KeyAttributes struct { + // RecoveryLevel - Reflects the deletion recovery level currently in effect for keys in the current vault. If it contains 'Purgeable' the key can be permanently deleted by a privileged user; otherwise, only the system can purge the key, at the end of the retention interval. Possible values include: 'Purgeable', 'RecoverablePurgeable', 'Recoverable', 'RecoverableProtectedSubscription' + RecoveryLevel DeletionRecoveryLevel `json:"recoveryLevel,omitempty"` + // Enabled - Determines whether the object is enabled. + Enabled *bool `json:"enabled,omitempty"` + // NotBefore - Not before date in UTC. + NotBefore *date.UnixTime `json:"nbf,omitempty"` + // Expires - Expiry date in UTC. + Expires *date.UnixTime `json:"exp,omitempty"` + // Created - Creation time in UTC. + Created *date.UnixTime `json:"created,omitempty"` + // Updated - Last updated time in UTC. + Updated *date.UnixTime `json:"updated,omitempty"` +} + +// KeyBundle a KeyBundle consisting of a WebKey plus its attributes. +type KeyBundle struct { + autorest.Response `json:"-"` + // Key - The Json web key. + Key *JSONWebKey `json:"key,omitempty"` + // Attributes - The key management attributes. + Attributes *KeyAttributes `json:"attributes,omitempty"` + // Tags - Application specific metadata in the form of key-value pairs. + Tags map[string]*string `json:"tags"` + // Managed - True if the key's lifetime is managed by key vault. If this is a key backing a certificate, then managed will be true. + Managed *bool `json:"managed,omitempty"` +} + +// MarshalJSON is the custom marshaler for KeyBundle. +func (kb KeyBundle) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if kb.Key != nil { + objectMap["key"] = kb.Key + } + if kb.Attributes != nil { + objectMap["attributes"] = kb.Attributes + } + if kb.Tags != nil { + objectMap["tags"] = kb.Tags + } + if kb.Managed != nil { + objectMap["managed"] = kb.Managed + } + return json.Marshal(objectMap) +} + +// KeyCreateParameters the key create parameters. +type KeyCreateParameters struct { + // Kty - The type of key to create. For valid values, see JsonWebKeyType. Possible values include: 'EC', 'ECHSM', 'RSA', 'RSAHSM', 'Oct' + Kty JSONWebKeyType `json:"kty,omitempty"` + // KeySize - The key size in bits. For example: 2048, 3072, or 4096 for RSA. + KeySize *int32 `json:"key_size,omitempty"` + KeyOps *[]JSONWebKeyOperation `json:"key_ops,omitempty"` + KeyAttributes *KeyAttributes `json:"attributes,omitempty"` + // Tags - Application specific metadata in the form of key-value pairs. + Tags map[string]*string `json:"tags"` + // Curve - Elliptic curve name. For valid values, see JsonWebKeyCurveName. Possible values include: 'P256', 'P384', 'P521', 'P256K' + Curve JSONWebKeyCurveName `json:"crv,omitempty"` +} + +// MarshalJSON is the custom marshaler for KeyCreateParameters. +func (kcp KeyCreateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if kcp.Kty != "" { + objectMap["kty"] = kcp.Kty + } + if kcp.KeySize != nil { + objectMap["key_size"] = kcp.KeySize + } + if kcp.KeyOps != nil { + objectMap["key_ops"] = kcp.KeyOps + } + if kcp.KeyAttributes != nil { + objectMap["attributes"] = kcp.KeyAttributes + } + if kcp.Tags != nil { + objectMap["tags"] = kcp.Tags + } + if kcp.Curve != "" { + objectMap["crv"] = kcp.Curve + } + return json.Marshal(objectMap) +} + +// KeyImportParameters the key import parameters. +type KeyImportParameters struct { + // Hsm - Whether to import as a hardware key (HSM) or software key. + Hsm *bool `json:"Hsm,omitempty"` + // Key - The Json web key + Key *JSONWebKey `json:"key,omitempty"` + // KeyAttributes - The key management attributes. + KeyAttributes *KeyAttributes `json:"attributes,omitempty"` + // Tags - Application specific metadata in the form of key-value pairs. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for KeyImportParameters. +func (kip KeyImportParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if kip.Hsm != nil { + objectMap["Hsm"] = kip.Hsm + } + if kip.Key != nil { + objectMap["key"] = kip.Key + } + if kip.KeyAttributes != nil { + objectMap["attributes"] = kip.KeyAttributes + } + if kip.Tags != nil { + objectMap["tags"] = kip.Tags + } + return json.Marshal(objectMap) +} + +// KeyItem the key item containing key metadata. +type KeyItem struct { + // Kid - Key identifier. + Kid *string `json:"kid,omitempty"` + // Attributes - The key management attributes. + Attributes *KeyAttributes `json:"attributes,omitempty"` + // Tags - Application specific metadata in the form of key-value pairs. + Tags map[string]*string `json:"tags"` + // Managed - True if the key's lifetime is managed by key vault. If this is a key backing a certificate, then managed will be true. + Managed *bool `json:"managed,omitempty"` +} + +// MarshalJSON is the custom marshaler for KeyItem. +func (ki KeyItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ki.Kid != nil { + objectMap["kid"] = ki.Kid + } + if ki.Attributes != nil { + objectMap["attributes"] = ki.Attributes + } + if ki.Tags != nil { + objectMap["tags"] = ki.Tags + } + if ki.Managed != nil { + objectMap["managed"] = ki.Managed + } + return json.Marshal(objectMap) +} + +// KeyListResult the key list result. +type KeyListResult struct { + autorest.Response `json:"-"` + // Value - A response message containing a list of keys in the key vault along with a link to the next page of keys. + Value *[]KeyItem `json:"value,omitempty"` + // NextLink - The URL to get the next set of keys. + NextLink *string `json:"nextLink,omitempty"` +} + +// KeyListResultIterator provides access to a complete listing of KeyItem values. +type KeyListResultIterator struct { + i int + page KeyListResultPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *KeyListResultIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter KeyListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter KeyListResultIterator) Response() KeyListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter KeyListResultIterator) Value() KeyItem { + if !iter.page.NotDone() { + return KeyItem{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (klr KeyListResult) IsEmpty() bool { + return klr.Value == nil || len(*klr.Value) == 0 +} + +// keyListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (klr KeyListResult) keyListResultPreparer() (*http.Request, error) { + if klr.NextLink == nil || len(to.String(klr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(klr.NextLink))) +} + +// KeyListResultPage contains a page of KeyItem values. +type KeyListResultPage struct { + fn func(KeyListResult) (KeyListResult, error) + klr KeyListResult +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *KeyListResultPage) Next() error { + next, err := page.fn(page.klr) + if err != nil { + return err + } + page.klr = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page KeyListResultPage) NotDone() bool { + return !page.klr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page KeyListResultPage) Response() KeyListResult { + return page.klr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page KeyListResultPage) Values() []KeyItem { + if page.klr.IsEmpty() { + return nil + } + return *page.klr.Value +} + +// KeyOperationResult the key operation result. +type KeyOperationResult struct { + autorest.Response `json:"-"` + // Kid - Key identifier + Kid *string `json:"kid,omitempty"` + // Result - a URL-encoded base64 string + Result *string `json:"value,omitempty"` +} + +// KeyOperationsParameters the key operations parameters. +type KeyOperationsParameters struct { + // Algorithm - algorithm identifier. Possible values include: 'RSAOAEP', 'RSAOAEP256', 'RSA15' + Algorithm JSONWebKeyEncryptionAlgorithm `json:"alg,omitempty"` + // Value - a URL-encoded base64 string + Value *string `json:"value,omitempty"` +} + +// KeyProperties properties of the key pair backing a certificate. +type KeyProperties struct { + // Exportable - Indicates if the private key can be exported. + Exportable *bool `json:"exportable,omitempty"` + // KeyType - The type of key pair to be used for the certificate. Possible values include: 'EC', 'ECHSM', 'RSA', 'RSAHSM', 'Oct' + KeyType JSONWebKeyType `json:"kty,omitempty"` + // KeySize - The key size in bits. For example: 2048, 3072, or 4096 for RSA. + KeySize *int32 `json:"key_size,omitempty"` + // ReuseKey - Indicates if the same key pair will be used on certificate renewal. + ReuseKey *bool `json:"reuse_key,omitempty"` + // Curve - Elliptic curve name. For valid values, see JsonWebKeyCurveName. Possible values include: 'P256', 'P384', 'P521', 'P256K' + Curve JSONWebKeyCurveName `json:"crv,omitempty"` +} + +// KeyRestoreParameters the key restore parameters. +type KeyRestoreParameters struct { + // KeyBundleBackup - The backup blob associated with a key bundle. (a URL-encoded base64 string) + KeyBundleBackup *string `json:"value,omitempty"` +} + +// KeySignParameters the key operations parameters. +type KeySignParameters struct { + // Algorithm - The signing/verification algorithm identifier. For more information on possible algorithm types, see JsonWebKeySignatureAlgorithm. Possible values include: 'PS256', 'PS384', 'PS512', 'RS256', 'RS384', 'RS512', 'RSNULL', 'ES256', 'ES384', 'ES512', 'ES256K' + Algorithm JSONWebKeySignatureAlgorithm `json:"alg,omitempty"` + // Value - a URL-encoded base64 string + Value *string `json:"value,omitempty"` +} + +// KeyUpdateParameters the key update parameters. +type KeyUpdateParameters struct { + // KeyOps - Json web key operations. For more information on possible key operations, see JsonWebKeyOperation. + KeyOps *[]JSONWebKeyOperation `json:"key_ops,omitempty"` + KeyAttributes *KeyAttributes `json:"attributes,omitempty"` + // Tags - Application specific metadata in the form of key-value pairs. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for KeyUpdateParameters. +func (kup KeyUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if kup.KeyOps != nil { + objectMap["key_ops"] = kup.KeyOps + } + if kup.KeyAttributes != nil { + objectMap["attributes"] = kup.KeyAttributes + } + if kup.Tags != nil { + objectMap["tags"] = kup.Tags + } + return json.Marshal(objectMap) +} + +// KeyVerifyParameters the key verify parameters. +type KeyVerifyParameters struct { + // Algorithm - The signing/verification algorithm. For more information on possible algorithm types, see JsonWebKeySignatureAlgorithm. Possible values include: 'PS256', 'PS384', 'PS512', 'RS256', 'RS384', 'RS512', 'RSNULL', 'ES256', 'ES384', 'ES512', 'ES256K' + Algorithm JSONWebKeySignatureAlgorithm `json:"alg,omitempty"` + // Digest - The digest used for signing. (a URL-encoded base64 string) + Digest *string `json:"digest,omitempty"` + // Signature - The signature to be verified. (a URL-encoded base64 string) + Signature *string `json:"value,omitempty"` +} + +// KeyVerifyResult the key verify result. +type KeyVerifyResult struct { + autorest.Response `json:"-"` + // Value - True if the signature is verified, otherwise false. + Value *bool `json:"value,omitempty"` +} + +// LifetimeAction action and its trigger that will be performed by Key Vault over the lifetime of a certificate. +type LifetimeAction struct { + // Trigger - The condition that will execute the action. + Trigger *Trigger `json:"trigger,omitempty"` + // Action - The action that will be executed. + Action *Action `json:"action,omitempty"` +} + +// OrganizationDetails details of the organization of the certificate issuer. +type OrganizationDetails struct { + // ID - Id of the organization. + ID *string `json:"id,omitempty"` + // AdminDetails - Details of the organization administrator. + AdminDetails *[]AdministratorDetails `json:"admin_details,omitempty"` +} + +// PendingCertificateSigningRequestResult the pending certificate signing request result. +type PendingCertificateSigningRequestResult struct { + // Value - The pending certificate signing request as Base64 encoded string. + Value *string `json:"value,omitempty"` +} + +// SasDefinitionAttributes the SAS definition management attributes. +type SasDefinitionAttributes struct { + // Enabled - the enabled state of the object. + Enabled *bool `json:"enabled,omitempty"` + // Created - Creation time in UTC. + Created *date.UnixTime `json:"created,omitempty"` + // Updated - Last updated time in UTC. + Updated *date.UnixTime `json:"updated,omitempty"` + // RecoveryLevel - Reflects the deletion recovery level currently in effect for SAS definitions in the current vault. If it contains 'Purgeable' the SAS definition can be permanently deleted by a privileged user; otherwise, only the system can purge the SAS definition, at the end of the retention interval. Possible values include: 'Purgeable', 'RecoverablePurgeable', 'Recoverable', 'RecoverableProtectedSubscription' + RecoveryLevel DeletionRecoveryLevel `json:"recoveryLevel,omitempty"` +} + +// SasDefinitionBundle a SAS definition bundle consists of key vault SAS definition details plus its attributes. +type SasDefinitionBundle struct { + autorest.Response `json:"-"` + // ID - The SAS definition id. + ID *string `json:"id,omitempty"` + // SecretID - Storage account SAS definition secret id. + SecretID *string `json:"sid,omitempty"` + // TemplateURI - The SAS definition token template signed with an arbitrary key. Tokens created according to the SAS definition will have the same properties as the template. + TemplateURI *string `json:"templateUri,omitempty"` + // SasType - The type of SAS token the SAS definition will create. Possible values include: 'Account', 'Service' + SasType SasTokenType `json:"sasType,omitempty"` + // ValidityPeriod - The validity period of SAS tokens created according to the SAS definition. + ValidityPeriod *string `json:"validityPeriod,omitempty"` + // Attributes - The SAS definition attributes. + Attributes *SasDefinitionAttributes `json:"attributes,omitempty"` + // Tags - Application specific metadata in the form of key-value pairs + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for SasDefinitionBundle. +func (sdb SasDefinitionBundle) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sdb.ID != nil { + objectMap["id"] = sdb.ID + } + if sdb.SecretID != nil { + objectMap["sid"] = sdb.SecretID + } + if sdb.TemplateURI != nil { + objectMap["templateUri"] = sdb.TemplateURI + } + if sdb.SasType != "" { + objectMap["sasType"] = sdb.SasType + } + if sdb.ValidityPeriod != nil { + objectMap["validityPeriod"] = sdb.ValidityPeriod + } + if sdb.Attributes != nil { + objectMap["attributes"] = sdb.Attributes + } + if sdb.Tags != nil { + objectMap["tags"] = sdb.Tags + } + return json.Marshal(objectMap) +} + +// SasDefinitionCreateParameters the SAS definition create parameters. +type SasDefinitionCreateParameters struct { + // TemplateURI - The SAS definition token template signed with an arbitrary key. Tokens created according to the SAS definition will have the same properties as the template. + TemplateURI *string `json:"templateUri,omitempty"` + // SasType - The type of SAS token the SAS definition will create. Possible values include: 'Account', 'Service' + SasType SasTokenType `json:"sasType,omitempty"` + // ValidityPeriod - The validity period of SAS tokens created according to the SAS definition. + ValidityPeriod *string `json:"validityPeriod,omitempty"` + // SasDefinitionAttributes - The attributes of the SAS definition. + SasDefinitionAttributes *SasDefinitionAttributes `json:"attributes,omitempty"` + // Tags - Application specific metadata in the form of key-value pairs. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for SasDefinitionCreateParameters. +func (sdcp SasDefinitionCreateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sdcp.TemplateURI != nil { + objectMap["templateUri"] = sdcp.TemplateURI + } + if sdcp.SasType != "" { + objectMap["sasType"] = sdcp.SasType + } + if sdcp.ValidityPeriod != nil { + objectMap["validityPeriod"] = sdcp.ValidityPeriod + } + if sdcp.SasDefinitionAttributes != nil { + objectMap["attributes"] = sdcp.SasDefinitionAttributes + } + if sdcp.Tags != nil { + objectMap["tags"] = sdcp.Tags + } + return json.Marshal(objectMap) +} + +// SasDefinitionItem the SAS definition item containing storage SAS definition metadata. +type SasDefinitionItem struct { + // ID - The storage SAS identifier. + ID *string `json:"id,omitempty"` + // SecretID - The storage account SAS definition secret id. + SecretID *string `json:"sid,omitempty"` + // Attributes - The SAS definition management attributes. + Attributes *SasDefinitionAttributes `json:"attributes,omitempty"` + // Tags - Application specific metadata in the form of key-value pairs. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for SasDefinitionItem. +func (sdi SasDefinitionItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sdi.ID != nil { + objectMap["id"] = sdi.ID + } + if sdi.SecretID != nil { + objectMap["sid"] = sdi.SecretID + } + if sdi.Attributes != nil { + objectMap["attributes"] = sdi.Attributes + } + if sdi.Tags != nil { + objectMap["tags"] = sdi.Tags + } + return json.Marshal(objectMap) +} + +// SasDefinitionListResult the storage account SAS definition list result. +type SasDefinitionListResult struct { + autorest.Response `json:"-"` + // Value - A response message containing a list of SAS definitions along with a link to the next page of SAS definitions. + Value *[]SasDefinitionItem `json:"value,omitempty"` + // NextLink - The URL to get the next set of SAS defintions. + NextLink *string `json:"nextLink,omitempty"` +} + +// SasDefinitionListResultIterator provides access to a complete listing of SasDefinitionItem values. +type SasDefinitionListResultIterator struct { + i int + page SasDefinitionListResultPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *SasDefinitionListResultIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter SasDefinitionListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter SasDefinitionListResultIterator) Response() SasDefinitionListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter SasDefinitionListResultIterator) Value() SasDefinitionItem { + if !iter.page.NotDone() { + return SasDefinitionItem{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (sdlr SasDefinitionListResult) IsEmpty() bool { + return sdlr.Value == nil || len(*sdlr.Value) == 0 +} + +// sasDefinitionListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (sdlr SasDefinitionListResult) sasDefinitionListResultPreparer() (*http.Request, error) { + if sdlr.NextLink == nil || len(to.String(sdlr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(sdlr.NextLink))) +} + +// SasDefinitionListResultPage contains a page of SasDefinitionItem values. +type SasDefinitionListResultPage struct { + fn func(SasDefinitionListResult) (SasDefinitionListResult, error) + sdlr SasDefinitionListResult +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *SasDefinitionListResultPage) Next() error { + next, err := page.fn(page.sdlr) + if err != nil { + return err + } + page.sdlr = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page SasDefinitionListResultPage) NotDone() bool { + return !page.sdlr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page SasDefinitionListResultPage) Response() SasDefinitionListResult { + return page.sdlr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page SasDefinitionListResultPage) Values() []SasDefinitionItem { + if page.sdlr.IsEmpty() { + return nil + } + return *page.sdlr.Value +} + +// SasDefinitionUpdateParameters the SAS definition update parameters. +type SasDefinitionUpdateParameters struct { + // TemplateURI - The SAS definition token template signed with an arbitrary key. Tokens created according to the SAS definition will have the same properties as the template. + TemplateURI *string `json:"templateUri,omitempty"` + // SasType - The type of SAS token the SAS definition will create. Possible values include: 'Account', 'Service' + SasType SasTokenType `json:"sasType,omitempty"` + // ValidityPeriod - The validity period of SAS tokens created according to the SAS definition. + ValidityPeriod *string `json:"validityPeriod,omitempty"` + // SasDefinitionAttributes - The attributes of the SAS definition. + SasDefinitionAttributes *SasDefinitionAttributes `json:"attributes,omitempty"` + // Tags - Application specific metadata in the form of key-value pairs. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for SasDefinitionUpdateParameters. +func (sdup SasDefinitionUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sdup.TemplateURI != nil { + objectMap["templateUri"] = sdup.TemplateURI + } + if sdup.SasType != "" { + objectMap["sasType"] = sdup.SasType + } + if sdup.ValidityPeriod != nil { + objectMap["validityPeriod"] = sdup.ValidityPeriod + } + if sdup.SasDefinitionAttributes != nil { + objectMap["attributes"] = sdup.SasDefinitionAttributes + } + if sdup.Tags != nil { + objectMap["tags"] = sdup.Tags + } + return json.Marshal(objectMap) +} + +// SecretAttributes the secret management attributes. +type SecretAttributes struct { + // RecoveryLevel - Reflects the deletion recovery level currently in effect for secrets in the current vault. If it contains 'Purgeable', the secret can be permanently deleted by a privileged user; otherwise, only the system can purge the secret, at the end of the retention interval. Possible values include: 'Purgeable', 'RecoverablePurgeable', 'Recoverable', 'RecoverableProtectedSubscription' + RecoveryLevel DeletionRecoveryLevel `json:"recoveryLevel,omitempty"` + // Enabled - Determines whether the object is enabled. + Enabled *bool `json:"enabled,omitempty"` + // NotBefore - Not before date in UTC. + NotBefore *date.UnixTime `json:"nbf,omitempty"` + // Expires - Expiry date in UTC. + Expires *date.UnixTime `json:"exp,omitempty"` + // Created - Creation time in UTC. + Created *date.UnixTime `json:"created,omitempty"` + // Updated - Last updated time in UTC. + Updated *date.UnixTime `json:"updated,omitempty"` +} + +// SecretBundle a secret consisting of a value, id and its attributes. +type SecretBundle struct { + autorest.Response `json:"-"` + // Value - The secret value. + Value *string `json:"value,omitempty"` + // ID - The secret id. + ID *string `json:"id,omitempty"` + // ContentType - The content type of the secret. + ContentType *string `json:"contentType,omitempty"` + // Attributes - The secret management attributes. + Attributes *SecretAttributes `json:"attributes,omitempty"` + // Tags - Application specific metadata in the form of key-value pairs. + Tags map[string]*string `json:"tags"` + // Kid - If this is a secret backing a KV certificate, then this field specifies the corresponding key backing the KV certificate. + Kid *string `json:"kid,omitempty"` + // Managed - True if the secret's lifetime is managed by key vault. If this is a secret backing a certificate, then managed will be true. + Managed *bool `json:"managed,omitempty"` +} + +// MarshalJSON is the custom marshaler for SecretBundle. +func (sb SecretBundle) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sb.Value != nil { + objectMap["value"] = sb.Value + } + if sb.ID != nil { + objectMap["id"] = sb.ID + } + if sb.ContentType != nil { + objectMap["contentType"] = sb.ContentType + } + if sb.Attributes != nil { + objectMap["attributes"] = sb.Attributes + } + if sb.Tags != nil { + objectMap["tags"] = sb.Tags + } + if sb.Kid != nil { + objectMap["kid"] = sb.Kid + } + if sb.Managed != nil { + objectMap["managed"] = sb.Managed + } + return json.Marshal(objectMap) +} + +// SecretItem the secret item containing secret metadata. +type SecretItem struct { + // ID - Secret identifier. + ID *string `json:"id,omitempty"` + // Attributes - The secret management attributes. + Attributes *SecretAttributes `json:"attributes,omitempty"` + // Tags - Application specific metadata in the form of key-value pairs. + Tags map[string]*string `json:"tags"` + // ContentType - Type of the secret value such as a password. + ContentType *string `json:"contentType,omitempty"` + // Managed - True if the secret's lifetime is managed by key vault. If this is a key backing a certificate, then managed will be true. + Managed *bool `json:"managed,omitempty"` +} + +// MarshalJSON is the custom marshaler for SecretItem. +func (si SecretItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if si.ID != nil { + objectMap["id"] = si.ID + } + if si.Attributes != nil { + objectMap["attributes"] = si.Attributes + } + if si.Tags != nil { + objectMap["tags"] = si.Tags + } + if si.ContentType != nil { + objectMap["contentType"] = si.ContentType + } + if si.Managed != nil { + objectMap["managed"] = si.Managed + } + return json.Marshal(objectMap) +} + +// SecretListResult the secret list result. +type SecretListResult struct { + autorest.Response `json:"-"` + // Value - A response message containing a list of secrets in the key vault along with a link to the next page of secrets. + Value *[]SecretItem `json:"value,omitempty"` + // NextLink - The URL to get the next set of secrets. + NextLink *string `json:"nextLink,omitempty"` +} + +// SecretListResultIterator provides access to a complete listing of SecretItem values. +type SecretListResultIterator struct { + i int + page SecretListResultPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *SecretListResultIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter SecretListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter SecretListResultIterator) Response() SecretListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter SecretListResultIterator) Value() SecretItem { + if !iter.page.NotDone() { + return SecretItem{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (slr SecretListResult) IsEmpty() bool { + return slr.Value == nil || len(*slr.Value) == 0 +} + +// secretListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (slr SecretListResult) secretListResultPreparer() (*http.Request, error) { + if slr.NextLink == nil || len(to.String(slr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(slr.NextLink))) +} + +// SecretListResultPage contains a page of SecretItem values. +type SecretListResultPage struct { + fn func(SecretListResult) (SecretListResult, error) + slr SecretListResult +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *SecretListResultPage) Next() error { + next, err := page.fn(page.slr) + if err != nil { + return err + } + page.slr = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page SecretListResultPage) NotDone() bool { + return !page.slr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page SecretListResultPage) Response() SecretListResult { + return page.slr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page SecretListResultPage) Values() []SecretItem { + if page.slr.IsEmpty() { + return nil + } + return *page.slr.Value +} + +// SecretProperties properties of the key backing a certificate. +type SecretProperties struct { + // ContentType - The media type (MIME type). + ContentType *string `json:"contentType,omitempty"` +} + +// SecretRestoreParameters the secret restore parameters. +type SecretRestoreParameters struct { + // SecretBundleBackup - The backup blob associated with a secret bundle. (a URL-encoded base64 string) + SecretBundleBackup *string `json:"value,omitempty"` +} + +// SecretSetParameters the secret set parameters. +type SecretSetParameters struct { + // Value - The value of the secret. + Value *string `json:"value,omitempty"` + // Tags - Application specific metadata in the form of key-value pairs. + Tags map[string]*string `json:"tags"` + // ContentType - Type of the secret value such as a password. + ContentType *string `json:"contentType,omitempty"` + // SecretAttributes - The secret management attributes. + SecretAttributes *SecretAttributes `json:"attributes,omitempty"` +} + +// MarshalJSON is the custom marshaler for SecretSetParameters. +func (ssp SecretSetParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ssp.Value != nil { + objectMap["value"] = ssp.Value + } + if ssp.Tags != nil { + objectMap["tags"] = ssp.Tags + } + if ssp.ContentType != nil { + objectMap["contentType"] = ssp.ContentType + } + if ssp.SecretAttributes != nil { + objectMap["attributes"] = ssp.SecretAttributes + } + return json.Marshal(objectMap) +} + +// SecretUpdateParameters the secret update parameters. +type SecretUpdateParameters struct { + // ContentType - Type of the secret value such as a password. + ContentType *string `json:"contentType,omitempty"` + // SecretAttributes - The secret management attributes. + SecretAttributes *SecretAttributes `json:"attributes,omitempty"` + // Tags - Application specific metadata in the form of key-value pairs. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for SecretUpdateParameters. +func (sup SecretUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sup.ContentType != nil { + objectMap["contentType"] = sup.ContentType + } + if sup.SecretAttributes != nil { + objectMap["attributes"] = sup.SecretAttributes + } + if sup.Tags != nil { + objectMap["tags"] = sup.Tags + } + return json.Marshal(objectMap) +} + +// StorageAccountAttributes the storage account management attributes. +type StorageAccountAttributes struct { + // Enabled - the enabled state of the object. + Enabled *bool `json:"enabled,omitempty"` + // Created - Creation time in UTC. + Created *date.UnixTime `json:"created,omitempty"` + // Updated - Last updated time in UTC. + Updated *date.UnixTime `json:"updated,omitempty"` + // RecoveryLevel - Reflects the deletion recovery level currently in effect for storage accounts in the current vault. If it contains 'Purgeable' the storage account can be permanently deleted by a privileged user; otherwise, only the system can purge the storage account, at the end of the retention interval. Possible values include: 'Purgeable', 'RecoverablePurgeable', 'Recoverable', 'RecoverableProtectedSubscription' + RecoveryLevel DeletionRecoveryLevel `json:"recoveryLevel,omitempty"` +} + +// StorageAccountCreateParameters the storage account create parameters. +type StorageAccountCreateParameters struct { + // ResourceID - Storage account resource id. + ResourceID *string `json:"resourceId,omitempty"` + // ActiveKeyName - Current active storage account key name. + ActiveKeyName *string `json:"activeKeyName,omitempty"` + // AutoRegenerateKey - whether keyvault should manage the storage account for the user. + AutoRegenerateKey *bool `json:"autoRegenerateKey,omitempty"` + // RegenerationPeriod - The key regeneration time duration specified in ISO-8601 format. + RegenerationPeriod *string `json:"regenerationPeriod,omitempty"` + // StorageAccountAttributes - The attributes of the storage account. + StorageAccountAttributes *StorageAccountAttributes `json:"attributes,omitempty"` + // Tags - Application specific metadata in the form of key-value pairs. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for StorageAccountCreateParameters. +func (sacp StorageAccountCreateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sacp.ResourceID != nil { + objectMap["resourceId"] = sacp.ResourceID + } + if sacp.ActiveKeyName != nil { + objectMap["activeKeyName"] = sacp.ActiveKeyName + } + if sacp.AutoRegenerateKey != nil { + objectMap["autoRegenerateKey"] = sacp.AutoRegenerateKey + } + if sacp.RegenerationPeriod != nil { + objectMap["regenerationPeriod"] = sacp.RegenerationPeriod + } + if sacp.StorageAccountAttributes != nil { + objectMap["attributes"] = sacp.StorageAccountAttributes + } + if sacp.Tags != nil { + objectMap["tags"] = sacp.Tags + } + return json.Marshal(objectMap) +} + +// StorageAccountItem the storage account item containing storage account metadata. +type StorageAccountItem struct { + // ID - Storage identifier. + ID *string `json:"id,omitempty"` + // ResourceID - Storage account resource Id. + ResourceID *string `json:"resourceId,omitempty"` + // Attributes - The storage account management attributes. + Attributes *StorageAccountAttributes `json:"attributes,omitempty"` + // Tags - Application specific metadata in the form of key-value pairs. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for StorageAccountItem. +func (sai StorageAccountItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sai.ID != nil { + objectMap["id"] = sai.ID + } + if sai.ResourceID != nil { + objectMap["resourceId"] = sai.ResourceID + } + if sai.Attributes != nil { + objectMap["attributes"] = sai.Attributes + } + if sai.Tags != nil { + objectMap["tags"] = sai.Tags + } + return json.Marshal(objectMap) +} + +// StorageAccountRegenerteKeyParameters the storage account key regenerate parameters. +type StorageAccountRegenerteKeyParameters struct { + // KeyName - The storage account key name. + KeyName *string `json:"keyName,omitempty"` +} + +// StorageAccountUpdateParameters the storage account update parameters. +type StorageAccountUpdateParameters struct { + // ActiveKeyName - The current active storage account key name. + ActiveKeyName *string `json:"activeKeyName,omitempty"` + // AutoRegenerateKey - whether keyvault should manage the storage account for the user. + AutoRegenerateKey *bool `json:"autoRegenerateKey,omitempty"` + // RegenerationPeriod - The key regeneration time duration specified in ISO-8601 format. + RegenerationPeriod *string `json:"regenerationPeriod,omitempty"` + // StorageAccountAttributes - The attributes of the storage account. + StorageAccountAttributes *StorageAccountAttributes `json:"attributes,omitempty"` + // Tags - Application specific metadata in the form of key-value pairs. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for StorageAccountUpdateParameters. +func (saup StorageAccountUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if saup.ActiveKeyName != nil { + objectMap["activeKeyName"] = saup.ActiveKeyName + } + if saup.AutoRegenerateKey != nil { + objectMap["autoRegenerateKey"] = saup.AutoRegenerateKey + } + if saup.RegenerationPeriod != nil { + objectMap["regenerationPeriod"] = saup.RegenerationPeriod + } + if saup.StorageAccountAttributes != nil { + objectMap["attributes"] = saup.StorageAccountAttributes + } + if saup.Tags != nil { + objectMap["tags"] = saup.Tags + } + return json.Marshal(objectMap) +} + +// StorageBundle a Storage account bundle consists of key vault storage account details plus its attributes. +type StorageBundle struct { + autorest.Response `json:"-"` + // ID - The storage account id. + ID *string `json:"id,omitempty"` + // ResourceID - The storage account resource id. + ResourceID *string `json:"resourceId,omitempty"` + // ActiveKeyName - The current active storage account key name. + ActiveKeyName *string `json:"activeKeyName,omitempty"` + // AutoRegenerateKey - whether keyvault should manage the storage account for the user. + AutoRegenerateKey *bool `json:"autoRegenerateKey,omitempty"` + // RegenerationPeriod - The key regeneration time duration specified in ISO-8601 format. + RegenerationPeriod *string `json:"regenerationPeriod,omitempty"` + // Attributes - The storage account attributes. + Attributes *StorageAccountAttributes `json:"attributes,omitempty"` + // Tags - Application specific metadata in the form of key-value pairs + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for StorageBundle. +func (sb StorageBundle) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sb.ID != nil { + objectMap["id"] = sb.ID + } + if sb.ResourceID != nil { + objectMap["resourceId"] = sb.ResourceID + } + if sb.ActiveKeyName != nil { + objectMap["activeKeyName"] = sb.ActiveKeyName + } + if sb.AutoRegenerateKey != nil { + objectMap["autoRegenerateKey"] = sb.AutoRegenerateKey + } + if sb.RegenerationPeriod != nil { + objectMap["regenerationPeriod"] = sb.RegenerationPeriod + } + if sb.Attributes != nil { + objectMap["attributes"] = sb.Attributes + } + if sb.Tags != nil { + objectMap["tags"] = sb.Tags + } + return json.Marshal(objectMap) +} + +// StorageListResult the storage accounts list result. +type StorageListResult struct { + autorest.Response `json:"-"` + // Value - A response message containing a list of storage accounts in the key vault along with a link to the next page of storage accounts. + Value *[]StorageAccountItem `json:"value,omitempty"` + // NextLink - The URL to get the next set of storage accounts. + NextLink *string `json:"nextLink,omitempty"` +} + +// StorageListResultIterator provides access to a complete listing of StorageAccountItem values. +type StorageListResultIterator struct { + i int + page StorageListResultPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *StorageListResultIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter StorageListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter StorageListResultIterator) Response() StorageListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter StorageListResultIterator) Value() StorageAccountItem { + if !iter.page.NotDone() { + return StorageAccountItem{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (slr StorageListResult) IsEmpty() bool { + return slr.Value == nil || len(*slr.Value) == 0 +} + +// storageListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (slr StorageListResult) storageListResultPreparer() (*http.Request, error) { + if slr.NextLink == nil || len(to.String(slr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(slr.NextLink))) +} + +// StorageListResultPage contains a page of StorageAccountItem values. +type StorageListResultPage struct { + fn func(StorageListResult) (StorageListResult, error) + slr StorageListResult +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *StorageListResultPage) Next() error { + next, err := page.fn(page.slr) + if err != nil { + return err + } + page.slr = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page StorageListResultPage) NotDone() bool { + return !page.slr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page StorageListResultPage) Response() StorageListResult { + return page.slr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page StorageListResultPage) Values() []StorageAccountItem { + if page.slr.IsEmpty() { + return nil + } + return *page.slr.Value +} + +// StorageRestoreParameters the secret restore parameters. +type StorageRestoreParameters struct { + // StorageBundleBackup - The backup blob associated with a storage account. (a URL-encoded base64 string) + StorageBundleBackup *string `json:"value,omitempty"` +} + +// SubjectAlternativeNames the subject alternate names of a X509 object. +type SubjectAlternativeNames struct { + // Emails - Email addresses. + Emails *[]string `json:"emails,omitempty"` + // DNSNames - Domain names. + DNSNames *[]string `json:"dns_names,omitempty"` + // Upns - User principal names. + Upns *[]string `json:"upns,omitempty"` +} + +// Trigger a condition to be satisfied for an action to be executed. +type Trigger struct { + // LifetimePercentage - Percentage of lifetime at which to trigger. Value should be between 1 and 99. + LifetimePercentage *int32 `json:"lifetime_percentage,omitempty"` + // DaysBeforeExpiry - Days before expiry to attempt renewal. Value should be between 1 and validity_in_months multiplied by 27. If validity_in_months is 36, then value should be between 1 and 972 (36 * 27). + DaysBeforeExpiry *int32 `json:"days_before_expiry,omitempty"` +} + +// X509CertificateProperties properties of the X509 component of a certificate. +type X509CertificateProperties struct { + // Subject - The subject name. Should be a valid X509 distinguished Name. + Subject *string `json:"subject,omitempty"` + // Ekus - The enhanced key usage. + Ekus *[]string `json:"ekus,omitempty"` + // SubjectAlternativeNames - The subject alternative names. + SubjectAlternativeNames *SubjectAlternativeNames `json:"sans,omitempty"` + // KeyUsage - List of key usages. + KeyUsage *[]KeyUsageType `json:"key_usage,omitempty"` + // ValidityInMonths - The duration that the ceritifcate is valid in months. + ValidityInMonths *int32 `json:"validity_months,omitempty"` +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/keyvault/v7.0/keyvault/version.go b/vendor/github.com/Azure/azure-sdk-for-go/services/keyvault/v7.0/keyvault/version.go new file mode 100644 index 000000000..2db61adc2 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/keyvault/v7.0/keyvault/version.go @@ -0,0 +1,30 @@ +package keyvault + +import "github.com/Azure/azure-sdk-for-go/version" + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// UserAgent returns the UserAgent string to use when sending http.Requests. +func UserAgent() string { + return "Azure-SDK-For-Go/" + version.Number + " keyvault/7.0" +} + +// Version returns the semantic version (see http://semver.org) of the client. +func Version() string { + return version.Number +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic/agreements.go b/vendor/github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic/agreements.go index 78a062dd9..4188de4e2 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic/agreements.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic/agreements.go @@ -689,7 +689,7 @@ func (client AgreementsClient) GetResponder(resp *http.Response) (result Integra // resourceGroupName - the resource group name. // integrationAccountName - the integration account name. // top - the number of items to be included in the result. -// filter - the filter to apply on the operation. +// filter - the filter to apply on the operation. Options for filters include: AgreementType. func (client AgreementsClient) ListByIntegrationAccounts(ctx context.Context, resourceGroupName string, integrationAccountName string, top *int32, filter string) (result IntegrationAccountAgreementListResultPage, err error) { result.fn = client.listByIntegrationAccountsNextResults req, err := client.ListByIntegrationAccountsPreparer(ctx, resourceGroupName, integrationAccountName, top, filter) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic/maps.go b/vendor/github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic/maps.go index f05aac39f..21b1ab162 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic/maps.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic/maps.go @@ -260,7 +260,7 @@ func (client MapsClient) GetResponder(resp *http.Response) (result IntegrationAc // resourceGroupName - the resource group name. // integrationAccountName - the integration account name. // top - the number of items to be included in the result. -// filter - the filter to apply on the operation. +// filter - the filter to apply on the operation. Options for filters include: MapType. func (client MapsClient) ListByIntegrationAccounts(ctx context.Context, resourceGroupName string, integrationAccountName string, top *int32, filter string) (result IntegrationAccountMapListResultPage, err error) { result.fn = client.listByIntegrationAccountsNextResults req, err := client.ListByIntegrationAccountsPreparer(ctx, resourceGroupName, integrationAccountName, top, filter) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic/partners.go b/vendor/github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic/partners.go index 297a94275..08c28d46b 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic/partners.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic/partners.go @@ -261,7 +261,7 @@ func (client PartnersClient) GetResponder(resp *http.Response) (result Integrati // resourceGroupName - the resource group name. // integrationAccountName - the integration account name. // top - the number of items to be included in the result. -// filter - the filter to apply on the operation. +// filter - the filter to apply on the operation. Options for filters include: PartnerType. func (client PartnersClient) ListByIntegrationAccounts(ctx context.Context, resourceGroupName string, integrationAccountName string, top *int32, filter string) (result IntegrationAccountPartnerListResultPage, err error) { result.fn = client.listByIntegrationAccountsNextResults req, err := client.ListByIntegrationAccountsPreparer(ctx, resourceGroupName, integrationAccountName, top, filter) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic/schemas.go b/vendor/github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic/schemas.go index 66b790200..36d2fbae2 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic/schemas.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic/schemas.go @@ -260,7 +260,7 @@ func (client SchemasClient) GetResponder(resp *http.Response) (result Integratio // resourceGroupName - the resource group name. // integrationAccountName - the integration account name. // top - the number of items to be included in the result. -// filter - the filter to apply on the operation. +// filter - the filter to apply on the operation. Options for filters include: SchemaType. func (client SchemasClient) ListByIntegrationAccounts(ctx context.Context, resourceGroupName string, integrationAccountName string, top *int32, filter string) (result IntegrationAccountSchemaListResultPage, err error) { result.fn = client.listByIntegrationAccountsNextResults req, err := client.ListByIntegrationAccountsPreparer(ctx, resourceGroupName, integrationAccountName, top, filter) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic/sessions.go b/vendor/github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic/sessions.go index f270af168..72fe4038d 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic/sessions.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic/sessions.go @@ -260,7 +260,7 @@ func (client SessionsClient) GetResponder(resp *http.Response) (result Integrati // resourceGroupName - the resource group name. // integrationAccountName - the integration account name. // top - the number of items to be included in the result. -// filter - the filter to apply on the operation. +// filter - the filter to apply on the operation. Options for filters include: ChangedTime. func (client SessionsClient) ListByIntegrationAccounts(ctx context.Context, resourceGroupName string, integrationAccountName string, top *int32, filter string) (result IntegrationAccountSessionListResultPage, err error) { result.fn = client.listByIntegrationAccountsNextResults req, err := client.ListByIntegrationAccountsPreparer(ctx, resourceGroupName, integrationAccountName, top, filter) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic/workflowrunactions.go b/vendor/github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic/workflowrunactions.go index cd0b1b6ce..b55cf9e5e 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic/workflowrunactions.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic/workflowrunactions.go @@ -116,7 +116,7 @@ func (client WorkflowRunActionsClient) GetResponder(resp *http.Response) (result // workflowName - the workflow name. // runName - the workflow run name. // top - the number of items to be included in the result. -// filter - the filter to apply on the operation. +// filter - the filter to apply on the operation. Options for filters include: Status. func (client WorkflowRunActionsClient) List(ctx context.Context, resourceGroupName string, workflowName string, runName string, top *int32, filter string) (result WorkflowRunActionListResultPage, err error) { result.fn = client.listNextResults req, err := client.ListPreparer(ctx, resourceGroupName, workflowName, runName, top, filter) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic/workflowruns.go b/vendor/github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic/workflowruns.go index 162f377e1..91af4bb42 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic/workflowruns.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic/workflowruns.go @@ -181,7 +181,8 @@ func (client WorkflowRunsClient) GetResponder(resp *http.Response) (result Workf // resourceGroupName - the resource group name. // workflowName - the workflow name. // top - the number of items to be included in the result. -// filter - the filter to apply on the operation. +// filter - the filter to apply on the operation. Options for filters include: Status, StartTime, and +// ClientTrackingId. func (client WorkflowRunsClient) List(ctx context.Context, resourceGroupName string, workflowName string, top *int32, filter string) (result WorkflowRunListResultPage, err error) { result.fn = client.listNextResults req, err := client.ListPreparer(ctx, resourceGroupName, workflowName, top, filter) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic/workflows.go b/vendor/github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic/workflows.go index f5c38750a..12f1c2c74 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic/workflows.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic/workflows.go @@ -448,7 +448,8 @@ func (client WorkflowsClient) GetResponder(resp *http.Response) (result Workflow // Parameters: // resourceGroupName - the resource group name. // top - the number of items to be included in the result. -// filter - the filter to apply on the operation. +// filter - the filter to apply on the operation. Options for filters include: State, Trigger, and +// ReferencedResourceId. func (client WorkflowsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string, top *int32, filter string) (result WorkflowListResultPage, err error) { result.fn = client.listByResourceGroupNextResults req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName, top, filter) @@ -548,7 +549,8 @@ func (client WorkflowsClient) ListByResourceGroupComplete(ctx context.Context, r // ListBySubscription gets a list of workflows by subscription. // Parameters: // top - the number of items to be included in the result. -// filter - the filter to apply on the operation. +// filter - the filter to apply on the operation. Options for filters include: State, Trigger, and +// ReferencedResourceId. func (client WorkflowsClient) ListBySubscription(ctx context.Context, top *int32, filter string) (result WorkflowListResultPage, err error) { result.fn = client.listBySubscriptionNextResults req, err := client.ListBySubscriptionPreparer(ctx, top, filter) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic/workflowtriggerhistories.go b/vendor/github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic/workflowtriggerhistories.go index c469952e1..7cb25db4d 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic/workflowtriggerhistories.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic/workflowtriggerhistories.go @@ -117,7 +117,8 @@ func (client WorkflowTriggerHistoriesClient) GetResponder(resp *http.Response) ( // workflowName - the workflow name. // triggerName - the workflow trigger name. // top - the number of items to be included in the result. -// filter - the filter to apply on the operation. +// filter - the filter to apply on the operation. Options for filters include: Status, StartTime, and +// ClientTrackingId. func (client WorkflowTriggerHistoriesClient) List(ctx context.Context, resourceGroupName string, workflowName string, triggerName string, top *int32, filter string) (result WorkflowTriggerHistoryListResultPage, err error) { result.fn = client.listNextResults req, err := client.ListPreparer(ctx, resourceGroupName, workflowName, triggerName, top, filter) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/machinelearning/mgmt/2017-01-01/webservices/webservices.go b/vendor/github.com/Azure/azure-sdk-for-go/services/machinelearning/mgmt/2017-01-01/webservices/webservices.go index e91ea0e4c..1598b003c 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/machinelearning/mgmt/2017-01-01/webservices/webservices.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/machinelearning/mgmt/2017-01-01/webservices/webservices.go @@ -56,7 +56,7 @@ func (client Client) CreateOrUpdate(ctx context.Context, resourceGroupName strin Constraints: []validation.Constraint{{Target: "createOrUpdatePayload.Properties", Name: validation.Null, Rule: true, Chain: []validation.Constraint{{Target: "createOrUpdatePayload.Properties.RealtimeConfiguration", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "createOrUpdatePayload.Properties.RealtimeConfiguration.MaxConcurrentCalls", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "createOrUpdatePayload.Properties.RealtimeConfiguration.MaxConcurrentCalls", Name: validation.InclusiveMaximum, Rule: 200, Chain: nil}, + Chain: []validation.Constraint{{Target: "createOrUpdatePayload.Properties.RealtimeConfiguration.MaxConcurrentCalls", Name: validation.InclusiveMaximum, Rule: int64(200), Chain: nil}, {Target: "createOrUpdatePayload.Properties.RealtimeConfiguration.MaxConcurrentCalls", Name: validation.InclusiveMinimum, Rule: 4, Chain: nil}, }}, }}, diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2016-09-01/network/virtualnetworkgatewayconnections.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2016-09-01/network/virtualnetworkgatewayconnections.go index fcf14901f..af098ee98 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2016-09-01/network/virtualnetworkgatewayconnections.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2016-09-01/network/virtualnetworkgatewayconnections.go @@ -445,7 +445,7 @@ func (client VirtualNetworkGatewayConnectionsClient) ResetSharedKey(ctx context. if err := validation.Validate([]validation.Validation{ {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.KeyLength", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.KeyLength", Name: validation.InclusiveMaximum, Rule: 128, Chain: nil}, + Chain: []validation.Constraint{{Target: "parameters.KeyLength", Name: validation.InclusiveMaximum, Rule: int64(128), Chain: nil}, {Target: "parameters.KeyLength", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("network.VirtualNetworkGatewayConnectionsClient", "ResetSharedKey", err.Error()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2016-12-01/network/virtualnetworkgatewayconnections.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2016-12-01/network/virtualnetworkgatewayconnections.go index a4498937e..6446f085b 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2016-12-01/network/virtualnetworkgatewayconnections.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2016-12-01/network/virtualnetworkgatewayconnections.go @@ -439,7 +439,7 @@ func (client VirtualNetworkGatewayConnectionsClient) ResetSharedKey(ctx context. if err := validation.Validate([]validation.Validation{ {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.KeyLength", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.KeyLength", Name: validation.InclusiveMaximum, Rule: 128, Chain: nil}, + Chain: []validation.Constraint{{Target: "parameters.KeyLength", Name: validation.InclusiveMaximum, Rule: int64(128), Chain: nil}, {Target: "parameters.KeyLength", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("network.VirtualNetworkGatewayConnectionsClient", "ResetSharedKey", err.Error()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-03-01/network/virtualnetworkgatewayconnections.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-03-01/network/virtualnetworkgatewayconnections.go index aa8537c97..17aa16e8f 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-03-01/network/virtualnetworkgatewayconnections.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-03-01/network/virtualnetworkgatewayconnections.go @@ -439,7 +439,7 @@ func (client VirtualNetworkGatewayConnectionsClient) ResetSharedKey(ctx context. if err := validation.Validate([]validation.Validation{ {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.KeyLength", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.KeyLength", Name: validation.InclusiveMaximum, Rule: 128, Chain: nil}, + Chain: []validation.Constraint{{Target: "parameters.KeyLength", Name: validation.InclusiveMaximum, Rule: int64(128), Chain: nil}, {Target: "parameters.KeyLength", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("network.VirtualNetworkGatewayConnectionsClient", "ResetSharedKey", err.Error()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-06-01/network/virtualnetworkgatewayconnections.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-06-01/network/virtualnetworkgatewayconnections.go index bc7979add..6b8f121fa 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-06-01/network/virtualnetworkgatewayconnections.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-06-01/network/virtualnetworkgatewayconnections.go @@ -439,7 +439,7 @@ func (client VirtualNetworkGatewayConnectionsClient) ResetSharedKey(ctx context. if err := validation.Validate([]validation.Validation{ {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.KeyLength", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.KeyLength", Name: validation.InclusiveMaximum, Rule: 128, Chain: nil}, + Chain: []validation.Constraint{{Target: "parameters.KeyLength", Name: validation.InclusiveMaximum, Rule: int64(128), Chain: nil}, {Target: "parameters.KeyLength", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("network.VirtualNetworkGatewayConnectionsClient", "ResetSharedKey", err.Error()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-08-01/network/virtualnetworkgatewayconnections.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-08-01/network/virtualnetworkgatewayconnections.go index 29bdb1d00..9b4d05fef 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-08-01/network/virtualnetworkgatewayconnections.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-08-01/network/virtualnetworkgatewayconnections.go @@ -439,7 +439,7 @@ func (client VirtualNetworkGatewayConnectionsClient) ResetSharedKey(ctx context. if err := validation.Validate([]validation.Validation{ {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.KeyLength", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.KeyLength", Name: validation.InclusiveMaximum, Rule: 128, Chain: nil}, + Chain: []validation.Constraint{{Target: "parameters.KeyLength", Name: validation.InclusiveMaximum, Rule: int64(128), Chain: nil}, {Target: "parameters.KeyLength", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("network.VirtualNetworkGatewayConnectionsClient", "ResetSharedKey", err.Error()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network/virtualnetworkgatewayconnections.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network/virtualnetworkgatewayconnections.go index 694d1f4f4..5facf960e 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network/virtualnetworkgatewayconnections.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network/virtualnetworkgatewayconnections.go @@ -439,7 +439,7 @@ func (client VirtualNetworkGatewayConnectionsClient) ResetSharedKey(ctx context. if err := validation.Validate([]validation.Validation{ {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.KeyLength", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.KeyLength", Name: validation.InclusiveMaximum, Rule: 128, Chain: nil}, + Chain: []validation.Constraint{{Target: "parameters.KeyLength", Name: validation.InclusiveMaximum, Rule: int64(128), Chain: nil}, {Target: "parameters.KeyLength", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("network.VirtualNetworkGatewayConnectionsClient", "ResetSharedKey", err.Error()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-10-01/network/expressroutecircuitpeerings.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-10-01/network/expressroutecircuitpeerings.go index facb493d8..cdcf91b84 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-10-01/network/expressroutecircuitpeerings.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-10-01/network/expressroutecircuitpeerings.go @@ -51,7 +51,7 @@ func (client ExpressRouteCircuitPeeringsClient) CreateOrUpdate(ctx context.Conte {TargetValue: peeringParameters, Constraints: []validation.Constraint{{Target: "peeringParameters.ExpressRouteCircuitPeeringPropertiesFormat", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "peeringParameters.ExpressRouteCircuitPeeringPropertiesFormat.PeerASN", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "peeringParameters.ExpressRouteCircuitPeeringPropertiesFormat.PeerASN", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "peeringParameters.ExpressRouteCircuitPeeringPropertiesFormat.PeerASN", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "peeringParameters.ExpressRouteCircuitPeeringPropertiesFormat.PeerASN", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}, }}}}}); err != nil { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-10-01/network/virtualnetworkgatewayconnections.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-10-01/network/virtualnetworkgatewayconnections.go index 7b2b49229..0dfb8265d 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-10-01/network/virtualnetworkgatewayconnections.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-10-01/network/virtualnetworkgatewayconnections.go @@ -439,7 +439,7 @@ func (client VirtualNetworkGatewayConnectionsClient) ResetSharedKey(ctx context. if err := validation.Validate([]validation.Validation{ {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.KeyLength", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.KeyLength", Name: validation.InclusiveMaximum, Rule: 128, Chain: nil}, + Chain: []validation.Constraint{{Target: "parameters.KeyLength", Name: validation.InclusiveMaximum, Rule: int64(128), Chain: nil}, {Target: "parameters.KeyLength", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("network.VirtualNetworkGatewayConnectionsClient", "ResetSharedKey", err.Error()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-11-01/network/expressroutecircuitpeerings.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-11-01/network/expressroutecircuitpeerings.go index 77e5c4a62..6d284f691 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-11-01/network/expressroutecircuitpeerings.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-11-01/network/expressroutecircuitpeerings.go @@ -51,7 +51,7 @@ func (client ExpressRouteCircuitPeeringsClient) CreateOrUpdate(ctx context.Conte {TargetValue: peeringParameters, Constraints: []validation.Constraint{{Target: "peeringParameters.ExpressRouteCircuitPeeringPropertiesFormat", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "peeringParameters.ExpressRouteCircuitPeeringPropertiesFormat.PeerASN", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "peeringParameters.ExpressRouteCircuitPeeringPropertiesFormat.PeerASN", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "peeringParameters.ExpressRouteCircuitPeeringPropertiesFormat.PeerASN", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "peeringParameters.ExpressRouteCircuitPeeringPropertiesFormat.PeerASN", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}, }}}}}); err != nil { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-11-01/network/virtualnetworkgatewayconnections.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-11-01/network/virtualnetworkgatewayconnections.go index a3d2b79b0..4e5ad9cff 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-11-01/network/virtualnetworkgatewayconnections.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-11-01/network/virtualnetworkgatewayconnections.go @@ -439,7 +439,7 @@ func (client VirtualNetworkGatewayConnectionsClient) ResetSharedKey(ctx context. if err := validation.Validate([]validation.Validation{ {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.KeyLength", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.KeyLength", Name: validation.InclusiveMaximum, Rule: 128, Chain: nil}, + Chain: []validation.Constraint{{Target: "parameters.KeyLength", Name: validation.InclusiveMaximum, Rule: int64(128), Chain: nil}, {Target: "parameters.KeyLength", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("network.VirtualNetworkGatewayConnectionsClient", "ResetSharedKey", err.Error()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-01-01/network/applicationgateways.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-01-01/network/applicationgateways.go index bee104bec..e6dae5df9 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-01-01/network/applicationgateways.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-01-01/network/applicationgateways.go @@ -129,7 +129,7 @@ func (client ApplicationGatewaysClient) CreateOrUpdate(ctx context.Context, reso {Target: "parameters.ApplicationGatewayPropertiesFormat.WebApplicationFirewallConfiguration.RuleSetType", Name: validation.Null, Rule: true, Chain: nil}, {Target: "parameters.ApplicationGatewayPropertiesFormat.WebApplicationFirewallConfiguration.RuleSetVersion", Name: validation.Null, Rule: true, Chain: nil}, {Target: "parameters.ApplicationGatewayPropertiesFormat.WebApplicationFirewallConfiguration.MaxRequestBodySize", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.ApplicationGatewayPropertiesFormat.WebApplicationFirewallConfiguration.MaxRequestBodySize", Name: validation.InclusiveMaximum, Rule: 128, Chain: nil}, + Chain: []validation.Constraint{{Target: "parameters.ApplicationGatewayPropertiesFormat.WebApplicationFirewallConfiguration.MaxRequestBodySize", Name: validation.InclusiveMaximum, Rule: int64(128), Chain: nil}, {Target: "parameters.ApplicationGatewayPropertiesFormat.WebApplicationFirewallConfiguration.MaxRequestBodySize", Name: validation.InclusiveMinimum, Rule: 8, Chain: nil}, }}, }}, diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-01-01/network/expressroutecircuitpeerings.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-01-01/network/expressroutecircuitpeerings.go index ae71fb22a..8a33a4337 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-01-01/network/expressroutecircuitpeerings.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-01-01/network/expressroutecircuitpeerings.go @@ -19,10 +19,11 @@ package network import ( "context" + "net/http" + "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" "github.com/Azure/go-autorest/autorest/validation" - "net/http" ) // ExpressRouteCircuitPeeringsClient is the network Client @@ -51,7 +52,7 @@ func (client ExpressRouteCircuitPeeringsClient) CreateOrUpdate(ctx context.Conte {TargetValue: peeringParameters, Constraints: []validation.Constraint{{Target: "peeringParameters.ExpressRouteCircuitPeeringPropertiesFormat", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "peeringParameters.ExpressRouteCircuitPeeringPropertiesFormat.PeerASN", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "peeringParameters.ExpressRouteCircuitPeeringPropertiesFormat.PeerASN", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "peeringParameters.ExpressRouteCircuitPeeringPropertiesFormat.PeerASN", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "peeringParameters.ExpressRouteCircuitPeeringPropertiesFormat.PeerASN", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}, }}}}}); err != nil { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-01-01/network/virtualnetworkgatewayconnections.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-01-01/network/virtualnetworkgatewayconnections.go index d7a1d50a6..968880fcc 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-01-01/network/virtualnetworkgatewayconnections.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-01-01/network/virtualnetworkgatewayconnections.go @@ -439,7 +439,7 @@ func (client VirtualNetworkGatewayConnectionsClient) ResetSharedKey(ctx context. if err := validation.Validate([]validation.Validation{ {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.KeyLength", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.KeyLength", Name: validation.InclusiveMaximum, Rule: 128, Chain: nil}, + Chain: []validation.Constraint{{Target: "parameters.KeyLength", Name: validation.InclusiveMaximum, Rule: int64(128), Chain: nil}, {Target: "parameters.KeyLength", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("network.VirtualNetworkGatewayConnectionsClient", "ResetSharedKey", err.Error()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-02-01/network/applicationgateways.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-02-01/network/applicationgateways.go index e4f3bb709..09ad5253b 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-02-01/network/applicationgateways.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-02-01/network/applicationgateways.go @@ -129,7 +129,7 @@ func (client ApplicationGatewaysClient) CreateOrUpdate(ctx context.Context, reso {Target: "parameters.ApplicationGatewayPropertiesFormat.WebApplicationFirewallConfiguration.RuleSetType", Name: validation.Null, Rule: true, Chain: nil}, {Target: "parameters.ApplicationGatewayPropertiesFormat.WebApplicationFirewallConfiguration.RuleSetVersion", Name: validation.Null, Rule: true, Chain: nil}, {Target: "parameters.ApplicationGatewayPropertiesFormat.WebApplicationFirewallConfiguration.MaxRequestBodySize", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.ApplicationGatewayPropertiesFormat.WebApplicationFirewallConfiguration.MaxRequestBodySize", Name: validation.InclusiveMaximum, Rule: 128, Chain: nil}, + Chain: []validation.Constraint{{Target: "parameters.ApplicationGatewayPropertiesFormat.WebApplicationFirewallConfiguration.MaxRequestBodySize", Name: validation.InclusiveMaximum, Rule: int64(128), Chain: nil}, {Target: "parameters.ApplicationGatewayPropertiesFormat.WebApplicationFirewallConfiguration.MaxRequestBodySize", Name: validation.InclusiveMinimum, Rule: 8, Chain: nil}, }}, }}, diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-02-01/network/expressroutecircuitpeerings.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-02-01/network/expressroutecircuitpeerings.go index c34b65266..4a247669c 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-02-01/network/expressroutecircuitpeerings.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-02-01/network/expressroutecircuitpeerings.go @@ -51,7 +51,7 @@ func (client ExpressRouteCircuitPeeringsClient) CreateOrUpdate(ctx context.Conte {TargetValue: peeringParameters, Constraints: []validation.Constraint{{Target: "peeringParameters.ExpressRouteCircuitPeeringPropertiesFormat", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "peeringParameters.ExpressRouteCircuitPeeringPropertiesFormat.PeerASN", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "peeringParameters.ExpressRouteCircuitPeeringPropertiesFormat.PeerASN", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "peeringParameters.ExpressRouteCircuitPeeringPropertiesFormat.PeerASN", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "peeringParameters.ExpressRouteCircuitPeeringPropertiesFormat.PeerASN", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}, }}}}}); err != nil { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-02-01/network/expressroutecrossconnectionpeerings.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-02-01/network/expressroutecrossconnectionpeerings.go index 4b165d1be..3b6c275ab 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-02-01/network/expressroutecrossconnectionpeerings.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-02-01/network/expressroutecrossconnectionpeerings.go @@ -54,7 +54,7 @@ func (client ExpressRouteCrossConnectionPeeringsClient) CreateOrUpdate(ctx conte {TargetValue: peeringParameters, Constraints: []validation.Constraint{{Target: "peeringParameters.ExpressRouteCrossConnectionPeeringProperties", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "peeringParameters.ExpressRouteCrossConnectionPeeringProperties.PeerASN", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "peeringParameters.ExpressRouteCrossConnectionPeeringProperties.PeerASN", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "peeringParameters.ExpressRouteCrossConnectionPeeringProperties.PeerASN", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "peeringParameters.ExpressRouteCrossConnectionPeeringProperties.PeerASN", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}, }}}}}); err != nil { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-02-01/network/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-02-01/network/models.go index cc7612e6e..9ed51cb96 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-02-01/network/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-02-01/network/models.go @@ -1021,13 +1021,15 @@ type ProbeProtocol string const ( // ProbeProtocolHTTP ... ProbeProtocolHTTP ProbeProtocol = "Http" + // ProbeProtocolHTTPS ... + ProbeProtocolHTTPS ProbeProtocol = "Https" // ProbeProtocolTCP ... ProbeProtocolTCP ProbeProtocol = "Tcp" ) // PossibleProbeProtocolValues returns an array of possible values for the ProbeProtocol const type. func PossibleProbeProtocolValues() []ProbeProtocol { - return []ProbeProtocol{ProbeProtocolHTTP, ProbeProtocolTCP} + return []ProbeProtocol{ProbeProtocolHTTP, ProbeProtocolHTTPS, ProbeProtocolTCP} } // ProcessorArchitecture enumerates the values for processor architecture. @@ -11302,7 +11304,7 @@ func (p *Probe) UnmarshalJSON(body []byte) error { type ProbePropertiesFormat struct { // LoadBalancingRules - The load balancer rules that use this probe. LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` - // Protocol - The protocol of the end point. Possible values are: 'Http' or 'Tcp'. If 'Tcp' is specified, a received ACK is required for the probe to be successful. If 'Http' is specified, a 200 OK response from the specifies URI is required for the probe to be successful. Possible values include: 'ProbeProtocolHTTP', 'ProbeProtocolTCP' + // Protocol - The protocol of the end point. Possible values are: 'Http', 'Tcp' or 'Https'. If 'Tcp' is specified, a received ACK is required for the probe to be successful. If 'Http' or 'Https' is specified, a 200 OK response from the specifies URI is required for the probe to be successful. Possible values include: 'ProbeProtocolHTTP', 'ProbeProtocolTCP', 'ProbeProtocolHTTPS' Protocol ProbeProtocol `json:"protocol,omitempty"` // Port - The port for communicating the probe. Possible values range from 1 to 65535, inclusive. Port *int32 `json:"port,omitempty"` diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-02-01/network/virtualnetworkgatewayconnections.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-02-01/network/virtualnetworkgatewayconnections.go index 5b7906bfc..1f5ef55d9 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-02-01/network/virtualnetworkgatewayconnections.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-02-01/network/virtualnetworkgatewayconnections.go @@ -439,7 +439,7 @@ func (client VirtualNetworkGatewayConnectionsClient) ResetSharedKey(ctx context. if err := validation.Validate([]validation.Validation{ {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.KeyLength", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.KeyLength", Name: validation.InclusiveMaximum, Rule: 128, Chain: nil}, + Chain: []validation.Constraint{{Target: "parameters.KeyLength", Name: validation.InclusiveMaximum, Rule: int64(128), Chain: nil}, {Target: "parameters.KeyLength", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("network.VirtualNetworkGatewayConnectionsClient", "ResetSharedKey", err.Error()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-04-01/network/applicationgateways.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-04-01/network/applicationgateways.go index e697a3fe0..b1eb5106c 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-04-01/network/applicationgateways.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-04-01/network/applicationgateways.go @@ -129,10 +129,16 @@ func (client ApplicationGatewaysClient) CreateOrUpdate(ctx context.Context, reso {Target: "parameters.ApplicationGatewayPropertiesFormat.WebApplicationFirewallConfiguration.RuleSetType", Name: validation.Null, Rule: true, Chain: nil}, {Target: "parameters.ApplicationGatewayPropertiesFormat.WebApplicationFirewallConfiguration.RuleSetVersion", Name: validation.Null, Rule: true, Chain: nil}, {Target: "parameters.ApplicationGatewayPropertiesFormat.WebApplicationFirewallConfiguration.MaxRequestBodySize", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.ApplicationGatewayPropertiesFormat.WebApplicationFirewallConfiguration.MaxRequestBodySize", Name: validation.InclusiveMaximum, Rule: 128, Chain: nil}, + Chain: []validation.Constraint{{Target: "parameters.ApplicationGatewayPropertiesFormat.WebApplicationFirewallConfiguration.MaxRequestBodySize", Name: validation.InclusiveMaximum, Rule: int64(128), Chain: nil}, {Target: "parameters.ApplicationGatewayPropertiesFormat.WebApplicationFirewallConfiguration.MaxRequestBodySize", Name: validation.InclusiveMinimum, Rule: 8, Chain: nil}, }}, }}, + {Target: "parameters.ApplicationGatewayPropertiesFormat.AutoscaleConfiguration", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ApplicationGatewayPropertiesFormat.AutoscaleConfiguration.Bounds", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.ApplicationGatewayPropertiesFormat.AutoscaleConfiguration.Bounds.Min", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.ApplicationGatewayPropertiesFormat.AutoscaleConfiguration.Bounds.Max", Name: validation.Null, Rule: true, Chain: nil}, + }}, + }}, }}}}}); err != nil { return result, validation.NewError("network.ApplicationGatewaysClient", "CreateOrUpdate", err.Error()) } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-04-01/network/azurefirewalls.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-04-01/network/azurefirewalls.go new file mode 100644 index 000000000..fd16f434a --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-04-01/network/azurefirewalls.go @@ -0,0 +1,434 @@ +package network + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "net/http" +) + +// AzureFirewallsClient is the network Client +type AzureFirewallsClient struct { + BaseClient +} + +// NewAzureFirewallsClient creates an instance of the AzureFirewallsClient client. +func NewAzureFirewallsClient(subscriptionID string) AzureFirewallsClient { + return NewAzureFirewallsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewAzureFirewallsClientWithBaseURI creates an instance of the AzureFirewallsClient client. +func NewAzureFirewallsClientWithBaseURI(baseURI string, subscriptionID string) AzureFirewallsClient { + return AzureFirewallsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or updates the specified Azure Firewall. +// Parameters: +// resourceGroupName - the name of the resource group. +// azureFirewallName - the name of the Azure Firewall. +// parameters - parameters supplied to the create or update Azure Firewall operation. +func (client AzureFirewallsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, azureFirewallName string, parameters AzureFirewall) (result AzureFirewallsCreateOrUpdateFuture, err error) { + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, azureFirewallName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "network.AzureFirewallsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "network.AzureFirewallsClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client AzureFirewallsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, azureFirewallName string, parameters AzureFirewall) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "azureFirewallName": autorest.Encode("path", azureFirewallName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-04-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/azureFirewalls/{azureFirewallName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client AzureFirewallsClient) CreateOrUpdateSender(req *http.Request) (future AzureFirewallsCreateOrUpdateFuture, err error) { + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client AzureFirewallsClient) CreateOrUpdateResponder(resp *http.Response) (result AzureFirewall, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes the specified Azure Firewall. +// Parameters: +// resourceGroupName - the name of the resource group. +// azureFirewallName - the name of the Azure Firewall. +func (client AzureFirewallsClient) Delete(ctx context.Context, resourceGroupName string, azureFirewallName string) (result AzureFirewallsDeleteFuture, err error) { + req, err := client.DeletePreparer(ctx, resourceGroupName, azureFirewallName) + if err != nil { + err = autorest.NewErrorWithError(err, "network.AzureFirewallsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "network.AzureFirewallsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client AzureFirewallsClient) DeletePreparer(ctx context.Context, resourceGroupName string, azureFirewallName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "azureFirewallName": autorest.Encode("path", azureFirewallName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-04-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/azureFirewalls/{azureFirewallName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client AzureFirewallsClient) DeleteSender(req *http.Request) (future AzureFirewallsDeleteFuture, err error) { + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client AzureFirewallsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the specified Azure Firewall. +// Parameters: +// resourceGroupName - the name of the resource group. +// azureFirewallName - the name of the Azure Firewall. +func (client AzureFirewallsClient) Get(ctx context.Context, resourceGroupName string, azureFirewallName string) (result AzureFirewall, err error) { + req, err := client.GetPreparer(ctx, resourceGroupName, azureFirewallName) + if err != nil { + err = autorest.NewErrorWithError(err, "network.AzureFirewallsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "network.AzureFirewallsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.AzureFirewallsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client AzureFirewallsClient) GetPreparer(ctx context.Context, resourceGroupName string, azureFirewallName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "azureFirewallName": autorest.Encode("path", azureFirewallName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-04-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/azureFirewalls/{azureFirewallName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client AzureFirewallsClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client AzureFirewallsClient) GetResponder(resp *http.Response) (result AzureFirewall, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists all Azure Firewalls in a resource group. +// Parameters: +// resourceGroupName - the name of the resource group. +func (client AzureFirewallsClient) List(ctx context.Context, resourceGroupName string) (result AzureFirewallListResultPage, err error) { + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "network.AzureFirewallsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.aflr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "network.AzureFirewallsClient", "List", resp, "Failure sending request") + return + } + + result.aflr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.AzureFirewallsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client AzureFirewallsClient) ListPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-04-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/azureFirewalls", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client AzureFirewallsClient) ListSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client AzureFirewallsClient) ListResponder(resp *http.Response) (result AzureFirewallListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client AzureFirewallsClient) listNextResults(lastResults AzureFirewallListResult) (result AzureFirewallListResult, err error) { + req, err := lastResults.azureFirewallListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "network.AzureFirewallsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "network.AzureFirewallsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.AzureFirewallsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client AzureFirewallsClient) ListComplete(ctx context.Context, resourceGroupName string) (result AzureFirewallListResultIterator, err error) { + result.page, err = client.List(ctx, resourceGroupName) + return +} + +// ListAll gets all the Azure Firewalls in a subscription. +func (client AzureFirewallsClient) ListAll(ctx context.Context) (result AzureFirewallListResultPage, err error) { + result.fn = client.listAllNextResults + req, err := client.ListAllPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "network.AzureFirewallsClient", "ListAll", nil, "Failure preparing request") + return + } + + resp, err := client.ListAllSender(req) + if err != nil { + result.aflr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "network.AzureFirewallsClient", "ListAll", resp, "Failure sending request") + return + } + + result.aflr, err = client.ListAllResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.AzureFirewallsClient", "ListAll", resp, "Failure responding to request") + } + + return +} + +// ListAllPreparer prepares the ListAll request. +func (client AzureFirewallsClient) ListAllPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-04-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/azureFirewalls", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListAllSender sends the ListAll request. The method will close the +// http.Response Body if it receives an error. +func (client AzureFirewallsClient) ListAllSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListAllResponder handles the response to the ListAll request. The method always +// closes the http.Response Body. +func (client AzureFirewallsClient) ListAllResponder(resp *http.Response) (result AzureFirewallListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listAllNextResults retrieves the next set of results, if any. +func (client AzureFirewallsClient) listAllNextResults(lastResults AzureFirewallListResult) (result AzureFirewallListResult, err error) { + req, err := lastResults.azureFirewallListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "network.AzureFirewallsClient", "listAllNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListAllSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "network.AzureFirewallsClient", "listAllNextResults", resp, "Failure sending next results request") + } + result, err = client.ListAllResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.AzureFirewallsClient", "listAllNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListAllComplete enumerates all values, automatically crossing page boundaries as required. +func (client AzureFirewallsClient) ListAllComplete(ctx context.Context) (result AzureFirewallListResultIterator, err error) { + result.page, err = client.ListAll(ctx) + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-04-01/network/expressroutecircuitpeerings.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-04-01/network/expressroutecircuitpeerings.go index af6b0c2c3..acc737358 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-04-01/network/expressroutecircuitpeerings.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-04-01/network/expressroutecircuitpeerings.go @@ -51,7 +51,7 @@ func (client ExpressRouteCircuitPeeringsClient) CreateOrUpdate(ctx context.Conte {TargetValue: peeringParameters, Constraints: []validation.Constraint{{Target: "peeringParameters.ExpressRouteCircuitPeeringPropertiesFormat", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "peeringParameters.ExpressRouteCircuitPeeringPropertiesFormat.PeerASN", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "peeringParameters.ExpressRouteCircuitPeeringPropertiesFormat.PeerASN", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "peeringParameters.ExpressRouteCircuitPeeringPropertiesFormat.PeerASN", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "peeringParameters.ExpressRouteCircuitPeeringPropertiesFormat.PeerASN", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}, }}}}}); err != nil { @@ -199,7 +199,7 @@ func (client ExpressRouteCircuitPeeringsClient) DeleteResponder(resp *http.Respo return } -// Get gets the specified authorization from the specified express route circuit. +// Get gets the specified peering for the express route circuit. // Parameters: // resourceGroupName - the name of the resource group. // circuitName - the name of the express route circuit. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-04-01/network/expressroutecrossconnectionpeerings.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-04-01/network/expressroutecrossconnectionpeerings.go index 314d902cb..207b272ff 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-04-01/network/expressroutecrossconnectionpeerings.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-04-01/network/expressroutecrossconnectionpeerings.go @@ -54,7 +54,7 @@ func (client ExpressRouteCrossConnectionPeeringsClient) CreateOrUpdate(ctx conte {TargetValue: peeringParameters, Constraints: []validation.Constraint{{Target: "peeringParameters.ExpressRouteCrossConnectionPeeringProperties", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "peeringParameters.ExpressRouteCrossConnectionPeeringProperties.PeerASN", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "peeringParameters.ExpressRouteCrossConnectionPeeringProperties.PeerASN", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "peeringParameters.ExpressRouteCrossConnectionPeeringProperties.PeerASN", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "peeringParameters.ExpressRouteCrossConnectionPeeringProperties.PeerASN", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}, }}}}}); err != nil { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-04-01/network/hubvirtualnetworkconnections.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-04-01/network/hubvirtualnetworkconnections.go new file mode 100644 index 000000000..3d0779e17 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-04-01/network/hubvirtualnetworkconnections.go @@ -0,0 +1,205 @@ +package network + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "net/http" +) + +// HubVirtualNetworkConnectionsClient is the network Client +type HubVirtualNetworkConnectionsClient struct { + BaseClient +} + +// NewHubVirtualNetworkConnectionsClient creates an instance of the HubVirtualNetworkConnectionsClient client. +func NewHubVirtualNetworkConnectionsClient(subscriptionID string) HubVirtualNetworkConnectionsClient { + return NewHubVirtualNetworkConnectionsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewHubVirtualNetworkConnectionsClientWithBaseURI creates an instance of the HubVirtualNetworkConnectionsClient +// client. +func NewHubVirtualNetworkConnectionsClientWithBaseURI(baseURI string, subscriptionID string) HubVirtualNetworkConnectionsClient { + return HubVirtualNetworkConnectionsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get retrieves the details of a HubVirtualNetworkConnection. +// Parameters: +// resourceGroupName - the resource group name of the VirtualHub. +// virtualHubName - the name of the VirtualHub. +// connectionName - the name of the vpn connection. +func (client HubVirtualNetworkConnectionsClient) Get(ctx context.Context, resourceGroupName string, virtualHubName string, connectionName string) (result HubVirtualNetworkConnection, err error) { + req, err := client.GetPreparer(ctx, resourceGroupName, virtualHubName, connectionName) + if err != nil { + err = autorest.NewErrorWithError(err, "network.HubVirtualNetworkConnectionsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "network.HubVirtualNetworkConnectionsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.HubVirtualNetworkConnectionsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client HubVirtualNetworkConnectionsClient) GetPreparer(ctx context.Context, resourceGroupName string, virtualHubName string, connectionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "connectionName": autorest.Encode("path", connectionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "virtualHubName": autorest.Encode("path", virtualHubName), + } + + const APIVersion = "2018-04-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/hubVirtualNetworkConnections/{connectionName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client HubVirtualNetworkConnectionsClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client HubVirtualNetworkConnectionsClient) GetResponder(resp *http.Response) (result HubVirtualNetworkConnection, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List retrieves the details of all HubVirtualNetworkConnections. +// Parameters: +// resourceGroupName - the resource group name of the VirtualHub. +// virtualHubName - the name of the VirtualHub. +func (client HubVirtualNetworkConnectionsClient) List(ctx context.Context, resourceGroupName string, virtualHubName string) (result ListHubVirtualNetworkConnectionsResultPage, err error) { + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName, virtualHubName) + if err != nil { + err = autorest.NewErrorWithError(err, "network.HubVirtualNetworkConnectionsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.lhvncr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "network.HubVirtualNetworkConnectionsClient", "List", resp, "Failure sending request") + return + } + + result.lhvncr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.HubVirtualNetworkConnectionsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client HubVirtualNetworkConnectionsClient) ListPreparer(ctx context.Context, resourceGroupName string, virtualHubName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "virtualHubName": autorest.Encode("path", virtualHubName), + } + + const APIVersion = "2018-04-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/hubVirtualNetworkConnections", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client HubVirtualNetworkConnectionsClient) ListSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client HubVirtualNetworkConnectionsClient) ListResponder(resp *http.Response) (result ListHubVirtualNetworkConnectionsResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client HubVirtualNetworkConnectionsClient) listNextResults(lastResults ListHubVirtualNetworkConnectionsResult) (result ListHubVirtualNetworkConnectionsResult, err error) { + req, err := lastResults.listHubVirtualNetworkConnectionsResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "network.HubVirtualNetworkConnectionsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "network.HubVirtualNetworkConnectionsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.HubVirtualNetworkConnectionsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client HubVirtualNetworkConnectionsClient) ListComplete(ctx context.Context, resourceGroupName string, virtualHubName string) (result ListHubVirtualNetworkConnectionsResultIterator, err error) { + result.page, err = client.List(ctx, resourceGroupName, virtualHubName) + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-04-01/network/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-04-01/network/models.go index 10f6868e5..f2488eb15 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-04-01/network/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-04-01/network/models.go @@ -172,15 +172,19 @@ const ( StandardMedium ApplicationGatewaySkuName = "Standard_Medium" // StandardSmall ... StandardSmall ApplicationGatewaySkuName = "Standard_Small" + // StandardV2 ... + StandardV2 ApplicationGatewaySkuName = "Standard_v2" // WAFLarge ... WAFLarge ApplicationGatewaySkuName = "WAF_Large" // WAFMedium ... WAFMedium ApplicationGatewaySkuName = "WAF_Medium" + // WAFV2 ... + WAFV2 ApplicationGatewaySkuName = "WAF_v2" ) // PossibleApplicationGatewaySkuNameValues returns an array of possible values for the ApplicationGatewaySkuName const type. func PossibleApplicationGatewaySkuNameValues() []ApplicationGatewaySkuName { - return []ApplicationGatewaySkuName{StandardLarge, StandardMedium, StandardSmall, WAFLarge, WAFMedium} + return []ApplicationGatewaySkuName{StandardLarge, StandardMedium, StandardSmall, StandardV2, WAFLarge, WAFMedium, WAFV2} } // ApplicationGatewaySslCipherSuite enumerates the values for application gateway ssl cipher suite. @@ -297,15 +301,19 @@ func PossibleApplicationGatewaySslProtocolValues() []ApplicationGatewaySslProtoc type ApplicationGatewayTier string const ( - // Standard ... - Standard ApplicationGatewayTier = "Standard" - // WAF ... - WAF ApplicationGatewayTier = "WAF" + // ApplicationGatewayTierStandard ... + ApplicationGatewayTierStandard ApplicationGatewayTier = "Standard" + // ApplicationGatewayTierStandardV2 ... + ApplicationGatewayTierStandardV2 ApplicationGatewayTier = "Standard_v2" + // ApplicationGatewayTierWAF ... + ApplicationGatewayTierWAF ApplicationGatewayTier = "WAF" + // ApplicationGatewayTierWAFV2 ... + ApplicationGatewayTierWAFV2 ApplicationGatewayTier = "WAF_v2" ) // PossibleApplicationGatewayTierValues returns an array of possible values for the ApplicationGatewayTier const type. func PossibleApplicationGatewayTierValues() []ApplicationGatewayTier { - return []ApplicationGatewayTier{Standard, WAF} + return []ApplicationGatewayTier{ApplicationGatewayTierStandard, ApplicationGatewayTierStandardV2, ApplicationGatewayTierWAF, ApplicationGatewayTierWAFV2} } // AssociationType enumerates the values for association type. @@ -353,6 +361,56 @@ func PossibleAuthorizationUseStatusValues() []AuthorizationUseStatus { return []AuthorizationUseStatus{Available, InUse} } +// AzureFirewallApplicationRuleProtocolType enumerates the values for azure firewall application rule protocol +// type. +type AzureFirewallApplicationRuleProtocolType string + +const ( + // AzureFirewallApplicationRuleProtocolTypeHTTP ... + AzureFirewallApplicationRuleProtocolTypeHTTP AzureFirewallApplicationRuleProtocolType = "Http" + // AzureFirewallApplicationRuleProtocolTypeHTTPS ... + AzureFirewallApplicationRuleProtocolTypeHTTPS AzureFirewallApplicationRuleProtocolType = "Https" +) + +// PossibleAzureFirewallApplicationRuleProtocolTypeValues returns an array of possible values for the AzureFirewallApplicationRuleProtocolType const type. +func PossibleAzureFirewallApplicationRuleProtocolTypeValues() []AzureFirewallApplicationRuleProtocolType { + return []AzureFirewallApplicationRuleProtocolType{AzureFirewallApplicationRuleProtocolTypeHTTP, AzureFirewallApplicationRuleProtocolTypeHTTPS} +} + +// AzureFirewallNetworkRuleProtocol enumerates the values for azure firewall network rule protocol. +type AzureFirewallNetworkRuleProtocol string + +const ( + // Any ... + Any AzureFirewallNetworkRuleProtocol = "Any" + // ICMP ... + ICMP AzureFirewallNetworkRuleProtocol = "ICMP" + // TCP ... + TCP AzureFirewallNetworkRuleProtocol = "TCP" + // UDP ... + UDP AzureFirewallNetworkRuleProtocol = "UDP" +) + +// PossibleAzureFirewallNetworkRuleProtocolValues returns an array of possible values for the AzureFirewallNetworkRuleProtocol const type. +func PossibleAzureFirewallNetworkRuleProtocolValues() []AzureFirewallNetworkRuleProtocol { + return []AzureFirewallNetworkRuleProtocol{Any, ICMP, TCP, UDP} +} + +// AzureFirewallRCActionType enumerates the values for azure firewall rc action type. +type AzureFirewallRCActionType string + +const ( + // AzureFirewallRCActionTypeAllow ... + AzureFirewallRCActionTypeAllow AzureFirewallRCActionType = "Allow" + // AzureFirewallRCActionTypeDeny ... + AzureFirewallRCActionTypeDeny AzureFirewallRCActionType = "Deny" +) + +// PossibleAzureFirewallRCActionTypeValues returns an array of possible values for the AzureFirewallRCActionType const type. +func PossibleAzureFirewallRCActionTypeValues() []AzureFirewallRCActionType { + return []AzureFirewallRCActionType{AzureFirewallRCActionTypeAllow, AzureFirewallRCActionTypeDeny} +} + // BgpPeerState enumerates the values for bgp peer state. type BgpPeerState string @@ -524,17 +582,17 @@ func PossibleEffectiveRouteStateValues() []EffectiveRouteState { type EffectiveSecurityRuleProtocol string const ( - // All ... - All EffectiveSecurityRuleProtocol = "All" - // TCP ... - TCP EffectiveSecurityRuleProtocol = "Tcp" - // UDP ... - UDP EffectiveSecurityRuleProtocol = "Udp" + // EffectiveSecurityRuleProtocolAll ... + EffectiveSecurityRuleProtocolAll EffectiveSecurityRuleProtocol = "All" + // EffectiveSecurityRuleProtocolTCP ... + EffectiveSecurityRuleProtocolTCP EffectiveSecurityRuleProtocol = "Tcp" + // EffectiveSecurityRuleProtocolUDP ... + EffectiveSecurityRuleProtocolUDP EffectiveSecurityRuleProtocol = "Udp" ) // PossibleEffectiveSecurityRuleProtocolValues returns an array of possible values for the EffectiveSecurityRuleProtocol const type. func PossibleEffectiveSecurityRuleProtocolValues() []EffectiveSecurityRuleProtocol { - return []EffectiveSecurityRuleProtocol{All, TCP, UDP} + return []EffectiveSecurityRuleProtocol{EffectiveSecurityRuleProtocolAll, EffectiveSecurityRuleProtocolTCP, EffectiveSecurityRuleProtocolUDP} } // EvaluationState enumerates the values for evaluation state. @@ -608,15 +666,15 @@ func PossibleExpressRouteCircuitSkuFamilyValues() []ExpressRouteCircuitSkuFamily type ExpressRouteCircuitSkuTier string const ( - // ExpressRouteCircuitSkuTierPremium ... - ExpressRouteCircuitSkuTierPremium ExpressRouteCircuitSkuTier = "Premium" - // ExpressRouteCircuitSkuTierStandard ... - ExpressRouteCircuitSkuTierStandard ExpressRouteCircuitSkuTier = "Standard" + // Premium ... + Premium ExpressRouteCircuitSkuTier = "Premium" + // Standard ... + Standard ExpressRouteCircuitSkuTier = "Standard" ) // PossibleExpressRouteCircuitSkuTierValues returns an array of possible values for the ExpressRouteCircuitSkuTier const type. func PossibleExpressRouteCircuitSkuTierValues() []ExpressRouteCircuitSkuTier { - return []ExpressRouteCircuitSkuTier{ExpressRouteCircuitSkuTierPremium, ExpressRouteCircuitSkuTierStandard} + return []ExpressRouteCircuitSkuTier{Premium, Standard} } // ExpressRoutePeeringState enumerates the values for express route peering state. @@ -664,6 +722,25 @@ func PossibleHTTPMethodValues() []HTTPMethod { return []HTTPMethod{Get} } +// HubVirtualNetworkConnectionStatus enumerates the values for hub virtual network connection status. +type HubVirtualNetworkConnectionStatus string + +const ( + // HubVirtualNetworkConnectionStatusConnected ... + HubVirtualNetworkConnectionStatusConnected HubVirtualNetworkConnectionStatus = "Connected" + // HubVirtualNetworkConnectionStatusConnecting ... + HubVirtualNetworkConnectionStatusConnecting HubVirtualNetworkConnectionStatus = "Connecting" + // HubVirtualNetworkConnectionStatusNotConnected ... + HubVirtualNetworkConnectionStatusNotConnected HubVirtualNetworkConnectionStatus = "NotConnected" + // HubVirtualNetworkConnectionStatusUnknown ... + HubVirtualNetworkConnectionStatusUnknown HubVirtualNetworkConnectionStatus = "Unknown" +) + +// PossibleHubVirtualNetworkConnectionStatusValues returns an array of possible values for the HubVirtualNetworkConnectionStatus const type. +func PossibleHubVirtualNetworkConnectionStatusValues() []HubVirtualNetworkConnectionStatus { + return []HubVirtualNetworkConnectionStatus{HubVirtualNetworkConnectionStatusConnected, HubVirtualNetworkConnectionStatusConnecting, HubVirtualNetworkConnectionStatusNotConnected, HubVirtualNetworkConnectionStatusUnknown} +} + // IkeEncryption enumerates the values for ike encryption. type IkeEncryption string @@ -1021,13 +1098,15 @@ type ProbeProtocol string const ( // ProbeProtocolHTTP ... ProbeProtocolHTTP ProbeProtocol = "Http" + // ProbeProtocolHTTPS ... + ProbeProtocolHTTPS ProbeProtocol = "Https" // ProbeProtocolTCP ... ProbeProtocolTCP ProbeProtocol = "Tcp" ) // PossibleProbeProtocolValues returns an array of possible values for the ProbeProtocol const type. func PossibleProbeProtocolValues() []ProbeProtocol { - return []ProbeProtocol{ProbeProtocolHTTP, ProbeProtocolTCP} + return []ProbeProtocol{ProbeProtocolHTTP, ProbeProtocolHTTPS, ProbeProtocolTCP} } // ProcessorArchitecture enumerates the values for processor architecture. @@ -1217,6 +1296,25 @@ func PossibleTransportProtocolValues() []TransportProtocol { return []TransportProtocol{TransportProtocolAll, TransportProtocolTCP, TransportProtocolUDP} } +// TunnelConnectionStatus enumerates the values for tunnel connection status. +type TunnelConnectionStatus string + +const ( + // TunnelConnectionStatusConnected ... + TunnelConnectionStatusConnected TunnelConnectionStatus = "Connected" + // TunnelConnectionStatusConnecting ... + TunnelConnectionStatusConnecting TunnelConnectionStatus = "Connecting" + // TunnelConnectionStatusNotConnected ... + TunnelConnectionStatusNotConnected TunnelConnectionStatus = "NotConnected" + // TunnelConnectionStatusUnknown ... + TunnelConnectionStatusUnknown TunnelConnectionStatus = "Unknown" +) + +// PossibleTunnelConnectionStatusValues returns an array of possible values for the TunnelConnectionStatus const type. +func PossibleTunnelConnectionStatusValues() []TunnelConnectionStatus { + return []TunnelConnectionStatus{TunnelConnectionStatusConnected, TunnelConnectionStatusConnecting, TunnelConnectionStatusNotConnected, TunnelConnectionStatusUnknown} +} + // VirtualNetworkGatewayConnectionStatus enumerates the values for virtual network gateway connection status. type VirtualNetworkGatewayConnectionStatus string @@ -1367,13 +1465,34 @@ type VpnClientProtocol string const ( // IkeV2 ... IkeV2 VpnClientProtocol = "IkeV2" + // OpenVPN ... + OpenVPN VpnClientProtocol = "OpenVPN" // SSTP ... SSTP VpnClientProtocol = "SSTP" ) // PossibleVpnClientProtocolValues returns an array of possible values for the VpnClientProtocol const type. func PossibleVpnClientProtocolValues() []VpnClientProtocol { - return []VpnClientProtocol{IkeV2, SSTP} + return []VpnClientProtocol{IkeV2, OpenVPN, SSTP} +} + +// VpnConnectionStatus enumerates the values for vpn connection status. +type VpnConnectionStatus string + +const ( + // VpnConnectionStatusConnected ... + VpnConnectionStatusConnected VpnConnectionStatus = "Connected" + // VpnConnectionStatusConnecting ... + VpnConnectionStatusConnecting VpnConnectionStatus = "Connecting" + // VpnConnectionStatusNotConnected ... + VpnConnectionStatusNotConnected VpnConnectionStatus = "NotConnected" + // VpnConnectionStatusUnknown ... + VpnConnectionStatusUnknown VpnConnectionStatus = "Unknown" +) + +// PossibleVpnConnectionStatusValues returns an array of possible values for the VpnConnectionStatus const type. +func PossibleVpnConnectionStatusValues() []VpnConnectionStatus { + return []VpnConnectionStatus{VpnConnectionStatusConnected, VpnConnectionStatusConnecting, VpnConnectionStatusNotConnected, VpnConnectionStatusUnknown} } // VpnType enumerates the values for vpn type. @@ -1404,6 +1523,8 @@ type ApplicationGateway struct { *ApplicationGatewayPropertiesFormat `json:"properties,omitempty"` // Etag - A unique read-only string that changes whenever the resource is updated. Etag *string `json:"etag,omitempty"` + // Zones - A list of availability zones denoting where the resource needs to come from. + Zones *[]string `json:"zones,omitempty"` // ID - Resource ID. ID *string `json:"id,omitempty"` // Name - Resource name. @@ -1425,6 +1546,9 @@ func (ag ApplicationGateway) MarshalJSON() ([]byte, error) { if ag.Etag != nil { objectMap["etag"] = ag.Etag } + if ag.Zones != nil { + objectMap["zones"] = ag.Zones + } if ag.ID != nil { objectMap["id"] = ag.ID } @@ -1470,6 +1594,15 @@ func (ag *ApplicationGateway) UnmarshalJSON(body []byte) error { } ag.Etag = &etag } + case "zones": + if v != nil { + var zones []string + err = json.Unmarshal(*v, &zones) + if err != nil { + return err + } + ag.Zones = &zones + } case "id": if v != nil { var ID string @@ -1624,6 +1757,21 @@ type ApplicationGatewayAuthenticationCertificatePropertiesFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` } +// ApplicationGatewayAutoscaleBounds application Gateway autoscale bounds on number of Application Gateway +// instance. +type ApplicationGatewayAutoscaleBounds struct { + // Min - Lower bound on number of Application Gateway instances. + Min *int32 `json:"min,omitempty"` + // Max - Upper bound on number of Application Gateway instances. + Max *int32 `json:"max,omitempty"` +} + +// ApplicationGatewayAutoscaleConfiguration application Gateway autoscale configuration. +type ApplicationGatewayAutoscaleConfiguration struct { + // Bounds - Autoscale bounds + Bounds *ApplicationGatewayAutoscaleBounds `json:"bounds,omitempty"` +} + // ApplicationGatewayAvailableSslOptions response for ApplicationGatewayAvailableSslOptions API service call. type ApplicationGatewayAvailableSslOptions struct { autorest.Response `json:"-"` @@ -3081,6 +3229,10 @@ type ApplicationGatewayPropertiesFormat struct { WebApplicationFirewallConfiguration *ApplicationGatewayWebApplicationFirewallConfiguration `json:"webApplicationFirewallConfiguration,omitempty"` // EnableHTTP2 - Whether HTTP2 is enabled on the application gateway resource. EnableHTTP2 *bool `json:"enableHttp2,omitempty"` + // EnableFips - Whether FIPS is enabled on the application gateway resource. + EnableFips *bool `json:"enableFips,omitempty"` + // AutoscaleConfiguration - Autoscale Configuration. + AutoscaleConfiguration *ApplicationGatewayAutoscaleConfiguration `json:"autoscaleConfiguration,omitempty"` // ResourceGUID - Resource GUID property of the application gateway resource. ResourceGUID *string `json:"resourceGuid,omitempty"` // ProvisioningState - Provisioning state of the application gateway resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. @@ -3398,9 +3550,9 @@ func (future *ApplicationGatewaysDeleteFuture) Result(client ApplicationGateways // ApplicationGatewaySku SKU of an application gateway type ApplicationGatewaySku struct { - // Name - Name of an application gateway SKU. Possible values include: 'StandardSmall', 'StandardMedium', 'StandardLarge', 'WAFMedium', 'WAFLarge' + // Name - Name of an application gateway SKU. Possible values include: 'StandardSmall', 'StandardMedium', 'StandardLarge', 'WAFMedium', 'WAFLarge', 'StandardV2', 'WAFV2' Name ApplicationGatewaySkuName `json:"name,omitempty"` - // Tier - Tier of an application gateway. Possible values include: 'Standard', 'WAF' + // Tier - Tier of an application gateway. Possible values include: 'ApplicationGatewayTierStandard', 'ApplicationGatewayTierWAF', 'ApplicationGatewayTierStandardV2', 'ApplicationGatewayTierWAFV2' Tier ApplicationGatewayTier `json:"tier,omitempty"` // Capacity - Capacity (instance count) of an application gateway. Capacity *int32 `json:"capacity,omitempty"` @@ -4274,6 +4426,616 @@ type AzureAsyncOperationResult struct { Error *Error `json:"error,omitempty"` } +// AzureFirewall azure Firewall resource +type AzureFirewall struct { + autorest.Response `json:"-"` + *AzureFirewallPropertiesFormat `json:"properties,omitempty"` + // Etag - Gets a unique read-only string that changes whenever the resource is updated. + Etag *string `json:"etag,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` + // Name - Resource name. + Name *string `json:"name,omitempty"` + // Type - Resource type. + Type *string `json:"type,omitempty"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for AzureFirewall. +func (af AzureFirewall) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if af.AzureFirewallPropertiesFormat != nil { + objectMap["properties"] = af.AzureFirewallPropertiesFormat + } + if af.Etag != nil { + objectMap["etag"] = af.Etag + } + if af.ID != nil { + objectMap["id"] = af.ID + } + if af.Name != nil { + objectMap["name"] = af.Name + } + if af.Type != nil { + objectMap["type"] = af.Type + } + if af.Location != nil { + objectMap["location"] = af.Location + } + if af.Tags != nil { + objectMap["tags"] = af.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for AzureFirewall struct. +func (af *AzureFirewall) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var azureFirewallPropertiesFormat AzureFirewallPropertiesFormat + err = json.Unmarshal(*v, &azureFirewallPropertiesFormat) + if err != nil { + return err + } + af.AzureFirewallPropertiesFormat = &azureFirewallPropertiesFormat + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + af.Etag = &etag + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + af.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + af.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + af.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + af.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + af.Tags = tags + } + } + } + + return nil +} + +// AzureFirewallApplicationRule properties of an application rule. +type AzureFirewallApplicationRule struct { + // Name - Name of the application rule. + Name *string `json:"name,omitempty"` + // Description - Description of the rule. + Description *string `json:"description,omitempty"` + // SourceAddresses - List of source IP addresses for this rule. + SourceAddresses *[]string `json:"sourceAddresses,omitempty"` + // Protocols - Array of ApplicationRuleProtocols. + Protocols *[]AzureFirewallApplicationRuleProtocol `json:"protocols,omitempty"` + // TargetUrls - List of URLs for this rule. + TargetUrls *[]string `json:"targetUrls,omitempty"` +} + +// AzureFirewallApplicationRuleCollection application rule collection resource +type AzureFirewallApplicationRuleCollection struct { + *AzureFirewallApplicationRuleCollectionPropertiesFormat `json:"properties,omitempty"` + // Name - Gets name of the resource that is unique within a resource group. This name can be used to access the resource. + Name *string `json:"name,omitempty"` + // Etag - Gets a unique read-only string that changes whenever the resource is updated. + Etag *string `json:"etag,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureFirewallApplicationRuleCollection. +func (afarc AzureFirewallApplicationRuleCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if afarc.AzureFirewallApplicationRuleCollectionPropertiesFormat != nil { + objectMap["properties"] = afarc.AzureFirewallApplicationRuleCollectionPropertiesFormat + } + if afarc.Name != nil { + objectMap["name"] = afarc.Name + } + if afarc.Etag != nil { + objectMap["etag"] = afarc.Etag + } + if afarc.ID != nil { + objectMap["id"] = afarc.ID + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for AzureFirewallApplicationRuleCollection struct. +func (afarc *AzureFirewallApplicationRuleCollection) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var azureFirewallApplicationRuleCollectionPropertiesFormat AzureFirewallApplicationRuleCollectionPropertiesFormat + err = json.Unmarshal(*v, &azureFirewallApplicationRuleCollectionPropertiesFormat) + if err != nil { + return err + } + afarc.AzureFirewallApplicationRuleCollectionPropertiesFormat = &azureFirewallApplicationRuleCollectionPropertiesFormat + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + afarc.Name = &name + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + afarc.Etag = &etag + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + afarc.ID = &ID + } + } + } + + return nil +} + +// AzureFirewallApplicationRuleCollectionPropertiesFormat properties of the application rule collection. +type AzureFirewallApplicationRuleCollectionPropertiesFormat struct { + // Priority - Priority of the application rule collection resource. + Priority *int32 `json:"priority,omitempty"` + // Action - The action type of a rule collection + Action *AzureFirewallRCAction `json:"action,omitempty"` + // Rules - Collection of rules used by a application rule collection. + Rules *[]AzureFirewallApplicationRule `json:"rules,omitempty"` + // ProvisioningState - The provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` +} + +// AzureFirewallApplicationRuleProtocol properties of the application rule protocol. +type AzureFirewallApplicationRuleProtocol struct { + // ProtocolType - Protocol type. Possible values include: 'AzureFirewallApplicationRuleProtocolTypeHTTP', 'AzureFirewallApplicationRuleProtocolTypeHTTPS' + ProtocolType AzureFirewallApplicationRuleProtocolType `json:"protocolType,omitempty"` + // Port - Port number for the protocol, cannot be greater than 64000. This field is optional. + Port *int32 `json:"port,omitempty"` +} + +// AzureFirewallIPConfiguration IP configuration of an Azure Firewall. +type AzureFirewallIPConfiguration struct { + *AzureFirewallIPConfigurationPropertiesFormat `json:"properties,omitempty"` + // Name - Name of the resource that is unique within a resource group. This name can be used to access the resource. + Name *string `json:"name,omitempty"` + // Etag - A unique read-only string that changes whenever the resource is updated. + Etag *string `json:"etag,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureFirewallIPConfiguration. +func (afic AzureFirewallIPConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if afic.AzureFirewallIPConfigurationPropertiesFormat != nil { + objectMap["properties"] = afic.AzureFirewallIPConfigurationPropertiesFormat + } + if afic.Name != nil { + objectMap["name"] = afic.Name + } + if afic.Etag != nil { + objectMap["etag"] = afic.Etag + } + if afic.ID != nil { + objectMap["id"] = afic.ID + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for AzureFirewallIPConfiguration struct. +func (afic *AzureFirewallIPConfiguration) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var azureFirewallIPConfigurationPropertiesFormat AzureFirewallIPConfigurationPropertiesFormat + err = json.Unmarshal(*v, &azureFirewallIPConfigurationPropertiesFormat) + if err != nil { + return err + } + afic.AzureFirewallIPConfigurationPropertiesFormat = &azureFirewallIPConfigurationPropertiesFormat + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + afic.Name = &name + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + afic.Etag = &etag + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + afic.ID = &ID + } + } + } + + return nil +} + +// AzureFirewallIPConfigurationPropertiesFormat properties of IP configuration of an Azure Firewall. +type AzureFirewallIPConfigurationPropertiesFormat struct { + // PrivateIPAddress - The Firewall Internal Load Balancer IP to be used as the next hop in User Defined Routes. + PrivateIPAddress *string `json:"privateIPAddress,omitempty"` + // Subnet - Reference of the subnet resource. This resource must be named 'AzureFirewallSubnet'. + Subnet *SubResource `json:"subnet,omitempty"` + // InternalPublicIPAddress - Reference of the PublicIP resource. This field is a mandatory input. + InternalPublicIPAddress *SubResource `json:"internalPublicIpAddress,omitempty"` + // PublicIPAddress - Reference of the PublicIP resource. This field is populated in the output. + PublicIPAddress *SubResource `json:"publicIPAddress,omitempty"` + // ProvisioningState - The provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` +} + +// AzureFirewallListResult response for ListAzureFirewalls API service call. +type AzureFirewallListResult struct { + autorest.Response `json:"-"` + // Value - List of a Azure Firewalls in a resource group. + Value *[]AzureFirewall `json:"value,omitempty"` + // NextLink - URL to get the next set of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// AzureFirewallListResultIterator provides access to a complete listing of AzureFirewall values. +type AzureFirewallListResultIterator struct { + i int + page AzureFirewallListResultPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *AzureFirewallListResultIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter AzureFirewallListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter AzureFirewallListResultIterator) Response() AzureFirewallListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter AzureFirewallListResultIterator) Value() AzureFirewall { + if !iter.page.NotDone() { + return AzureFirewall{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (aflr AzureFirewallListResult) IsEmpty() bool { + return aflr.Value == nil || len(*aflr.Value) == 0 +} + +// azureFirewallListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (aflr AzureFirewallListResult) azureFirewallListResultPreparer() (*http.Request, error) { + if aflr.NextLink == nil || len(to.String(aflr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(aflr.NextLink))) +} + +// AzureFirewallListResultPage contains a page of AzureFirewall values. +type AzureFirewallListResultPage struct { + fn func(AzureFirewallListResult) (AzureFirewallListResult, error) + aflr AzureFirewallListResult +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *AzureFirewallListResultPage) Next() error { + next, err := page.fn(page.aflr) + if err != nil { + return err + } + page.aflr = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page AzureFirewallListResultPage) NotDone() bool { + return !page.aflr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page AzureFirewallListResultPage) Response() AzureFirewallListResult { + return page.aflr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page AzureFirewallListResultPage) Values() []AzureFirewall { + if page.aflr.IsEmpty() { + return nil + } + return *page.aflr.Value +} + +// AzureFirewallNetworkRule properties of the network rule. +type AzureFirewallNetworkRule struct { + // Name - Name of the network rule. + Name *string `json:"name,omitempty"` + // Description - Description of the rule. + Description *string `json:"description,omitempty"` + // Protocols - Array of AzureFirewallNetworkRuleProtocols. + Protocols *[]AzureFirewallNetworkRuleProtocol `json:"protocols,omitempty"` + // SourceAddresses - List of source IP addresses for this rule. + SourceAddresses *[]string `json:"sourceAddresses,omitempty"` + // DestinationAddresses - List of destination IP addresses. + DestinationAddresses *[]string `json:"destinationAddresses,omitempty"` + // DestinationPorts - List of destination ports. + DestinationPorts *[]string `json:"destinationPorts,omitempty"` +} + +// AzureFirewallNetworkRuleCollection network rule collection resource +type AzureFirewallNetworkRuleCollection struct { + *AzureFirewallNetworkRuleCollectionPropertiesFormat `json:"properties,omitempty"` + // Name - Gets name of the resource that is unique within a resource group. This name can be used to access the resource. + Name *string `json:"name,omitempty"` + // Etag - Gets a unique read-only string that changes whenever the resource is updated. + Etag *string `json:"etag,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureFirewallNetworkRuleCollection. +func (afnrc AzureFirewallNetworkRuleCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if afnrc.AzureFirewallNetworkRuleCollectionPropertiesFormat != nil { + objectMap["properties"] = afnrc.AzureFirewallNetworkRuleCollectionPropertiesFormat + } + if afnrc.Name != nil { + objectMap["name"] = afnrc.Name + } + if afnrc.Etag != nil { + objectMap["etag"] = afnrc.Etag + } + if afnrc.ID != nil { + objectMap["id"] = afnrc.ID + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for AzureFirewallNetworkRuleCollection struct. +func (afnrc *AzureFirewallNetworkRuleCollection) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var azureFirewallNetworkRuleCollectionPropertiesFormat AzureFirewallNetworkRuleCollectionPropertiesFormat + err = json.Unmarshal(*v, &azureFirewallNetworkRuleCollectionPropertiesFormat) + if err != nil { + return err + } + afnrc.AzureFirewallNetworkRuleCollectionPropertiesFormat = &azureFirewallNetworkRuleCollectionPropertiesFormat + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + afnrc.Name = &name + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + afnrc.Etag = &etag + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + afnrc.ID = &ID + } + } + } + + return nil +} + +// AzureFirewallNetworkRuleCollectionPropertiesFormat properties of the network rule collection. +type AzureFirewallNetworkRuleCollectionPropertiesFormat struct { + // Priority - Priority of the network rule collection resource. + Priority *int32 `json:"priority,omitempty"` + // Action - The action type of a rule collection + Action *AzureFirewallRCAction `json:"action,omitempty"` + // Rules - Collection of rules used by a network rule collection. + Rules *[]AzureFirewallNetworkRule `json:"rules,omitempty"` + // ProvisioningState - The provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` +} + +// AzureFirewallPropertiesFormat properties of the Azure Firewall. +type AzureFirewallPropertiesFormat struct { + // ApplicationRuleCollections - Collection of application rule collections used by a Azure Firewall. + ApplicationRuleCollections *[]AzureFirewallApplicationRuleCollection `json:"applicationRuleCollections,omitempty"` + // NetworkRuleCollections - Collection of network rule collections used by a Azure Firewall. + NetworkRuleCollections *[]AzureFirewallNetworkRuleCollection `json:"networkRuleCollections,omitempty"` + // IPConfigurations - IP configuration of the Azure Firewall resource. + IPConfigurations *[]AzureFirewallIPConfiguration `json:"ipConfigurations,omitempty"` + // ProvisioningState - The provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` +} + +// AzureFirewallRCAction properties of the AzureFirewallRCAction. +type AzureFirewallRCAction struct { + // Type - The type of action. Possible values include: 'AzureFirewallRCActionTypeAllow', 'AzureFirewallRCActionTypeDeny' + Type AzureFirewallRCActionType `json:"type,omitempty"` +} + +// AzureFirewallsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type AzureFirewallsCreateOrUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *AzureFirewallsCreateOrUpdateFuture) Result(client AzureFirewallsClient) (af AzureFirewall, err error) { + var done bool + done, err = future.Done(client) + if err != nil { + err = autorest.NewErrorWithError(err, "network.AzureFirewallsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("network.AzureFirewallsCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if af.Response.Response, err = future.GetResult(sender); err == nil && af.Response.Response.StatusCode != http.StatusNoContent { + af, err = client.CreateOrUpdateResponder(af.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "network.AzureFirewallsCreateOrUpdateFuture", "Result", af.Response.Response, "Failure responding to request") + } + } + return +} + +// AzureFirewallsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. +type AzureFirewallsDeleteFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *AzureFirewallsDeleteFuture) Result(client AzureFirewallsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.Done(client) + if err != nil { + err = autorest.NewErrorWithError(err, "network.AzureFirewallsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("network.AzureFirewallsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + // AzureReachabilityReport azure reachability report details. type AzureReachabilityReport struct { autorest.Response `json:"-"` @@ -5077,6 +5839,8 @@ type ConnectionSharedKey struct { autorest.Response `json:"-"` // Value - The virtual network connection shared key value. Value *string `json:"value,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` } // ConnectionStateSnapshot connection state snapshot. @@ -5455,6 +6219,16 @@ func (future *DdosProtectionPlansDeleteFuture) Result(client DdosProtectionPlans return } +// DeviceProperties list of properties of the device. +type DeviceProperties struct { + // DeviceVendor - Name of the device Vendor. + DeviceVendor *string `json:"deviceVendor,omitempty"` + // DeviceModel - Model of the device. + DeviceModel *string `json:"deviceModel,omitempty"` + // LinkSpeedInMbps - Link speed. + LinkSpeedInMbps *int32 `json:"linkSpeedInMbps,omitempty"` +} + // DhcpOptions dhcpOptions contains an array of DNS servers available to VMs deployed in the virtual network. // Standard DHCP option for a subnet overrides VNET DHCP options. type DhcpOptions struct { @@ -5530,7 +6304,7 @@ type EffectiveNetworkSecurityGroupListResult struct { type EffectiveNetworkSecurityRule struct { // Name - The name of the security rule specified by the user (if created by the user). Name *string `json:"name,omitempty"` - // Protocol - The network protocol this rule applies to. Possible values are: 'Tcp', 'Udp', and 'All'. Possible values include: 'TCP', 'UDP', 'All' + // Protocol - The network protocol this rule applies to. Possible values are: 'Tcp', 'Udp', and 'All'. Possible values include: 'EffectiveSecurityRuleProtocolTCP', 'EffectiveSecurityRuleProtocolUDP', 'EffectiveSecurityRuleProtocolAll' Protocol EffectiveSecurityRuleProtocol `json:"protocol,omitempty"` // SourcePortRange - The source port or range. SourcePortRange *string `json:"sourcePortRange,omitempty"` @@ -6672,7 +7446,7 @@ type ExpressRouteCircuitServiceProviderProperties struct { type ExpressRouteCircuitSku struct { // Name - The name of the SKU. Name *string `json:"name,omitempty"` - // Tier - The tier of the SKU. Possible values are 'Standard' and 'Premium'. Possible values include: 'ExpressRouteCircuitSkuTierStandard', 'ExpressRouteCircuitSkuTierPremium' + // Tier - The tier of the SKU. Possible values are 'Standard' and 'Premium'. Possible values include: 'Standard', 'Premium' Tier ExpressRouteCircuitSkuTier `json:"tier,omitempty"` // Family - The family of the SKU. Possible values are: 'UnlimitedData' and 'MeteredData'. Possible values include: 'UnlimitedData', 'MeteredData' Family ExpressRouteCircuitSkuFamily `json:"family,omitempty"` @@ -7970,6 +8744,14 @@ type GatewayRouteListResult struct { Value *[]GatewayRoute `json:"value,omitempty"` } +// GetVpnSitesConfigurationRequest list of Vpn-Sites +type GetVpnSitesConfigurationRequest struct { + // VpnSites - List of resource-ids of the vpn-sites for which config is to be downloaded. + VpnSites *[]SubResource `json:"vpnSites,omitempty"` + // OutputBlobSasURL - The sas-url to download the configurations for vpn-sites + OutputBlobSasURL *string `json:"outputBlobSasUrl,omitempty"` +} + // HTTPConfiguration HTTP configuration of the connectivity check. type HTTPConfiguration struct { // Method - HTTP method. Possible values include: 'Get' @@ -7988,6 +8770,141 @@ type HTTPHeader struct { Value *string `json:"value,omitempty"` } +// HubVirtualNetworkConnection hubVirtualNetworkConnection Resource. +type HubVirtualNetworkConnection struct { + autorest.Response `json:"-"` + *HubVirtualNetworkConnectionProperties `json:"properties,omitempty"` + // Etag - Gets a unique read-only string that changes whenever the resource is updated. + Etag *string `json:"etag,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` + // Name - Resource name. + Name *string `json:"name,omitempty"` + // Type - Resource type. + Type *string `json:"type,omitempty"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for HubVirtualNetworkConnection. +func (hvnc HubVirtualNetworkConnection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if hvnc.HubVirtualNetworkConnectionProperties != nil { + objectMap["properties"] = hvnc.HubVirtualNetworkConnectionProperties + } + if hvnc.Etag != nil { + objectMap["etag"] = hvnc.Etag + } + if hvnc.ID != nil { + objectMap["id"] = hvnc.ID + } + if hvnc.Name != nil { + objectMap["name"] = hvnc.Name + } + if hvnc.Type != nil { + objectMap["type"] = hvnc.Type + } + if hvnc.Location != nil { + objectMap["location"] = hvnc.Location + } + if hvnc.Tags != nil { + objectMap["tags"] = hvnc.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for HubVirtualNetworkConnection struct. +func (hvnc *HubVirtualNetworkConnection) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var hubVirtualNetworkConnectionProperties HubVirtualNetworkConnectionProperties + err = json.Unmarshal(*v, &hubVirtualNetworkConnectionProperties) + if err != nil { + return err + } + hvnc.HubVirtualNetworkConnectionProperties = &hubVirtualNetworkConnectionProperties + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + hvnc.Etag = &etag + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + hvnc.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + hvnc.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + hvnc.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + hvnc.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + hvnc.Tags = tags + } + } + } + + return nil +} + +// HubVirtualNetworkConnectionProperties parameters for HubVirtualNetworkConnection +type HubVirtualNetworkConnectionProperties struct { + // RemoteVirtualNetwork - Reference to the remote virtual network. + RemoteVirtualNetwork *SubResource `json:"remoteVirtualNetwork,omitempty"` + // AllowHubToRemoteVnetTransit - VirtualHub to RemoteVnet transit to enabled or not. + AllowHubToRemoteVnetTransit *bool `json:"allowHubToRemoteVnetTransit,omitempty"` + // AllowRemoteVnetToUseHubVnetGateways - Allow RemoteVnet to use Virtual Hub's gateways. + AllowRemoteVnetToUseHubVnetGateways *bool `json:"allowRemoteVnetToUseHubVnetGateways,omitempty"` + // ProvisioningState - The provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` +} + // InboundNatPool inbound NAT pool of the load balancer. type InboundNatPool struct { // InboundNatPoolPropertiesFormat - Properties of load balancer inbound nat pool. @@ -9213,6 +10130,625 @@ type Ipv6ExpressRouteCircuitPeeringConfig struct { State ExpressRouteCircuitPeeringState `json:"state,omitempty"` } +// ListHubVirtualNetworkConnectionsResult list of HubVirtualNetworkConnections and a URL nextLink to get the next +// set of results. +type ListHubVirtualNetworkConnectionsResult struct { + autorest.Response `json:"-"` + // Value - List of HubVirtualNetworkConnections. + Value *[]HubVirtualNetworkConnection `json:"value,omitempty"` + // NextLink - URL to get the next set of operation list results if there are any. + NextLink *string `json:"nextLink,omitempty"` +} + +// ListHubVirtualNetworkConnectionsResultIterator provides access to a complete listing of +// HubVirtualNetworkConnection values. +type ListHubVirtualNetworkConnectionsResultIterator struct { + i int + page ListHubVirtualNetworkConnectionsResultPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ListHubVirtualNetworkConnectionsResultIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ListHubVirtualNetworkConnectionsResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ListHubVirtualNetworkConnectionsResultIterator) Response() ListHubVirtualNetworkConnectionsResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ListHubVirtualNetworkConnectionsResultIterator) Value() HubVirtualNetworkConnection { + if !iter.page.NotDone() { + return HubVirtualNetworkConnection{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (lhvncr ListHubVirtualNetworkConnectionsResult) IsEmpty() bool { + return lhvncr.Value == nil || len(*lhvncr.Value) == 0 +} + +// listHubVirtualNetworkConnectionsResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (lhvncr ListHubVirtualNetworkConnectionsResult) listHubVirtualNetworkConnectionsResultPreparer() (*http.Request, error) { + if lhvncr.NextLink == nil || len(to.String(lhvncr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(lhvncr.NextLink))) +} + +// ListHubVirtualNetworkConnectionsResultPage contains a page of HubVirtualNetworkConnection values. +type ListHubVirtualNetworkConnectionsResultPage struct { + fn func(ListHubVirtualNetworkConnectionsResult) (ListHubVirtualNetworkConnectionsResult, error) + lhvncr ListHubVirtualNetworkConnectionsResult +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ListHubVirtualNetworkConnectionsResultPage) Next() error { + next, err := page.fn(page.lhvncr) + if err != nil { + return err + } + page.lhvncr = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ListHubVirtualNetworkConnectionsResultPage) NotDone() bool { + return !page.lhvncr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ListHubVirtualNetworkConnectionsResultPage) Response() ListHubVirtualNetworkConnectionsResult { + return page.lhvncr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ListHubVirtualNetworkConnectionsResultPage) Values() []HubVirtualNetworkConnection { + if page.lhvncr.IsEmpty() { + return nil + } + return *page.lhvncr.Value +} + +// ListVirtualHubsResult result of the request to list VirtualHubs. It contains a list of VirtualHubs and a URL +// nextLink to get the next set of results. +type ListVirtualHubsResult struct { + autorest.Response `json:"-"` + // Value - List of VirtualHubs. + Value *[]VirtualHub `json:"value,omitempty"` + // NextLink - URL to get the next set of operation list results if there are any. + NextLink *string `json:"nextLink,omitempty"` +} + +// ListVirtualHubsResultIterator provides access to a complete listing of VirtualHub values. +type ListVirtualHubsResultIterator struct { + i int + page ListVirtualHubsResultPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ListVirtualHubsResultIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ListVirtualHubsResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ListVirtualHubsResultIterator) Response() ListVirtualHubsResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ListVirtualHubsResultIterator) Value() VirtualHub { + if !iter.page.NotDone() { + return VirtualHub{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (lvhr ListVirtualHubsResult) IsEmpty() bool { + return lvhr.Value == nil || len(*lvhr.Value) == 0 +} + +// listVirtualHubsResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (lvhr ListVirtualHubsResult) listVirtualHubsResultPreparer() (*http.Request, error) { + if lvhr.NextLink == nil || len(to.String(lvhr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(lvhr.NextLink))) +} + +// ListVirtualHubsResultPage contains a page of VirtualHub values. +type ListVirtualHubsResultPage struct { + fn func(ListVirtualHubsResult) (ListVirtualHubsResult, error) + lvhr ListVirtualHubsResult +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ListVirtualHubsResultPage) Next() error { + next, err := page.fn(page.lvhr) + if err != nil { + return err + } + page.lvhr = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ListVirtualHubsResultPage) NotDone() bool { + return !page.lvhr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ListVirtualHubsResultPage) Response() ListVirtualHubsResult { + return page.lvhr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ListVirtualHubsResultPage) Values() []VirtualHub { + if page.lvhr.IsEmpty() { + return nil + } + return *page.lvhr.Value +} + +// ListVirtualWANsResult result of the request to list VirtualWANs. It contains a list of VirtualWANs and a URL +// nextLink to get the next set of results. +type ListVirtualWANsResult struct { + autorest.Response `json:"-"` + // Value - List of VirtualWANs. + Value *[]VirtualWAN `json:"value,omitempty"` + // NextLink - URL to get the next set of operation list results if there are any. + NextLink *string `json:"nextLink,omitempty"` +} + +// ListVirtualWANsResultIterator provides access to a complete listing of VirtualWAN values. +type ListVirtualWANsResultIterator struct { + i int + page ListVirtualWANsResultPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ListVirtualWANsResultIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ListVirtualWANsResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ListVirtualWANsResultIterator) Response() ListVirtualWANsResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ListVirtualWANsResultIterator) Value() VirtualWAN { + if !iter.page.NotDone() { + return VirtualWAN{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (lvwnr ListVirtualWANsResult) IsEmpty() bool { + return lvwnr.Value == nil || len(*lvwnr.Value) == 0 +} + +// listVirtualWANsResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (lvwnr ListVirtualWANsResult) listVirtualWANsResultPreparer() (*http.Request, error) { + if lvwnr.NextLink == nil || len(to.String(lvwnr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(lvwnr.NextLink))) +} + +// ListVirtualWANsResultPage contains a page of VirtualWAN values. +type ListVirtualWANsResultPage struct { + fn func(ListVirtualWANsResult) (ListVirtualWANsResult, error) + lvwnr ListVirtualWANsResult +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ListVirtualWANsResultPage) Next() error { + next, err := page.fn(page.lvwnr) + if err != nil { + return err + } + page.lvwnr = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ListVirtualWANsResultPage) NotDone() bool { + return !page.lvwnr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ListVirtualWANsResultPage) Response() ListVirtualWANsResult { + return page.lvwnr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ListVirtualWANsResultPage) Values() []VirtualWAN { + if page.lvwnr.IsEmpty() { + return nil + } + return *page.lvwnr.Value +} + +// ListVpnConnectionsResult result of the request to list all vpn connections to a virtual wan vpn gateway. It +// contains a list of Vpn Connections and a URL nextLink to get the next set of results. +type ListVpnConnectionsResult struct { + autorest.Response `json:"-"` + // Value - List of Vpn Connections. + Value *[]VpnConnection `json:"value,omitempty"` + // NextLink - URL to get the next set of operation list results if there are any. + NextLink *string `json:"nextLink,omitempty"` +} + +// ListVpnConnectionsResultIterator provides access to a complete listing of VpnConnection values. +type ListVpnConnectionsResultIterator struct { + i int + page ListVpnConnectionsResultPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ListVpnConnectionsResultIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ListVpnConnectionsResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ListVpnConnectionsResultIterator) Response() ListVpnConnectionsResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ListVpnConnectionsResultIterator) Value() VpnConnection { + if !iter.page.NotDone() { + return VpnConnection{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (lvcr ListVpnConnectionsResult) IsEmpty() bool { + return lvcr.Value == nil || len(*lvcr.Value) == 0 +} + +// listVpnConnectionsResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (lvcr ListVpnConnectionsResult) listVpnConnectionsResultPreparer() (*http.Request, error) { + if lvcr.NextLink == nil || len(to.String(lvcr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(lvcr.NextLink))) +} + +// ListVpnConnectionsResultPage contains a page of VpnConnection values. +type ListVpnConnectionsResultPage struct { + fn func(ListVpnConnectionsResult) (ListVpnConnectionsResult, error) + lvcr ListVpnConnectionsResult +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ListVpnConnectionsResultPage) Next() error { + next, err := page.fn(page.lvcr) + if err != nil { + return err + } + page.lvcr = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ListVpnConnectionsResultPage) NotDone() bool { + return !page.lvcr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ListVpnConnectionsResultPage) Response() ListVpnConnectionsResult { + return page.lvcr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ListVpnConnectionsResultPage) Values() []VpnConnection { + if page.lvcr.IsEmpty() { + return nil + } + return *page.lvcr.Value +} + +// ListVpnGatewaysResult result of the request to list VpnGateways. It contains a list of VpnGateways and a URL +// nextLink to get the next set of results. +type ListVpnGatewaysResult struct { + autorest.Response `json:"-"` + // Value - List of VpnGateways. + Value *[]VpnGateway `json:"value,omitempty"` + // NextLink - URL to get the next set of operation list results if there are any. + NextLink *string `json:"nextLink,omitempty"` +} + +// ListVpnGatewaysResultIterator provides access to a complete listing of VpnGateway values. +type ListVpnGatewaysResultIterator struct { + i int + page ListVpnGatewaysResultPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ListVpnGatewaysResultIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ListVpnGatewaysResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ListVpnGatewaysResultIterator) Response() ListVpnGatewaysResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ListVpnGatewaysResultIterator) Value() VpnGateway { + if !iter.page.NotDone() { + return VpnGateway{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (lvgr ListVpnGatewaysResult) IsEmpty() bool { + return lvgr.Value == nil || len(*lvgr.Value) == 0 +} + +// listVpnGatewaysResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (lvgr ListVpnGatewaysResult) listVpnGatewaysResultPreparer() (*http.Request, error) { + if lvgr.NextLink == nil || len(to.String(lvgr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(lvgr.NextLink))) +} + +// ListVpnGatewaysResultPage contains a page of VpnGateway values. +type ListVpnGatewaysResultPage struct { + fn func(ListVpnGatewaysResult) (ListVpnGatewaysResult, error) + lvgr ListVpnGatewaysResult +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ListVpnGatewaysResultPage) Next() error { + next, err := page.fn(page.lvgr) + if err != nil { + return err + } + page.lvgr = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ListVpnGatewaysResultPage) NotDone() bool { + return !page.lvgr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ListVpnGatewaysResultPage) Response() ListVpnGatewaysResult { + return page.lvgr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ListVpnGatewaysResultPage) Values() []VpnGateway { + if page.lvgr.IsEmpty() { + return nil + } + return *page.lvgr.Value +} + +// ListVpnSitesResult result of the request to list VpnSites. It contains a list of VpnSites and a URL nextLink to +// get the next set of results. +type ListVpnSitesResult struct { + autorest.Response `json:"-"` + // Value - List of VpnSites. + Value *[]VpnSite `json:"value,omitempty"` + // NextLink - URL to get the next set of operation list results if there are any. + NextLink *string `json:"nextLink,omitempty"` +} + +// ListVpnSitesResultIterator provides access to a complete listing of VpnSite values. +type ListVpnSitesResultIterator struct { + i int + page ListVpnSitesResultPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ListVpnSitesResultIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ListVpnSitesResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ListVpnSitesResultIterator) Response() ListVpnSitesResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ListVpnSitesResultIterator) Value() VpnSite { + if !iter.page.NotDone() { + return VpnSite{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (lvsr ListVpnSitesResult) IsEmpty() bool { + return lvsr.Value == nil || len(*lvsr.Value) == 0 +} + +// listVpnSitesResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (lvsr ListVpnSitesResult) listVpnSitesResultPreparer() (*http.Request, error) { + if lvsr.NextLink == nil || len(to.String(lvsr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(lvsr.NextLink))) +} + +// ListVpnSitesResultPage contains a page of VpnSite values. +type ListVpnSitesResultPage struct { + fn func(ListVpnSitesResult) (ListVpnSitesResult, error) + lvsr ListVpnSitesResult +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ListVpnSitesResultPage) Next() error { + next, err := page.fn(page.lvsr) + if err != nil { + return err + } + page.lvsr = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ListVpnSitesResultPage) NotDone() bool { + return !page.lvsr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ListVpnSitesResultPage) Response() ListVpnSitesResult { + return page.lvsr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ListVpnSitesResultPage) Values() []VpnSite { + if page.lvsr.IsEmpty() { + return nil + } + return *page.lvsr.Value +} + // LoadBalancer loadBalancer resource type LoadBalancer struct { autorest.Response `json:"-"` @@ -11254,6 +12790,14 @@ func (prfr *PatchRouteFilterRule) UnmarshalJSON(body []byte) error { return nil } +// Policies policies for vpn gateway. +type Policies struct { + // AllowBranchToBranchTraffic - True if branch to branch traffic is allowed. + AllowBranchToBranchTraffic *bool `json:"allowBranchToBranchTraffic,omitempty"` + // AllowVnetToVnetTraffic - True if Vnet to Vnet traffic is allowed. + AllowVnetToVnetTraffic *bool `json:"allowVnetToVnetTraffic,omitempty"` +} + // Probe a load balancer probe. type Probe struct { autorest.Response `json:"-"` @@ -11340,7 +12884,7 @@ func (p *Probe) UnmarshalJSON(body []byte) error { type ProbePropertiesFormat struct { // LoadBalancingRules - The load balancer rules that use this probe. LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` - // Protocol - The protocol of the end point. Possible values are: 'Http' or 'Tcp'. If 'Tcp' is specified, a received ACK is required for the probe to be successful. If 'Http' is specified, a 200 OK response from the specifies URI is required for the probe to be successful. Possible values include: 'ProbeProtocolHTTP', 'ProbeProtocolTCP' + // Protocol - The protocol of the end point. Possible values are: 'Http', 'Tcp', or 'Https'. If 'Tcp' is specified, a received ACK is required for the probe to be successful. If 'Http' or 'Https' is specified, a 200 OK response from the specifies URI is required for the probe to be successful. Possible values include: 'ProbeProtocolHTTP', 'ProbeProtocolTCP', 'ProbeProtocolHTTPS' Protocol ProbeProtocol `json:"protocol,omitempty"` // Port - The port for communicating the probe. Possible values range from 1 to 65535, inclusive. Port *int32 `json:"port,omitempty"` @@ -14289,6 +15833,221 @@ type VerificationIPFlowResult struct { RuleName *string `json:"ruleName,omitempty"` } +// VirtualHub virtualHub Resource. +type VirtualHub struct { + autorest.Response `json:"-"` + *VirtualHubProperties `json:"properties,omitempty"` + // Etag - Gets a unique read-only string that changes whenever the resource is updated. + Etag *string `json:"etag,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` + // Name - Resource name. + Name *string `json:"name,omitempty"` + // Type - Resource type. + Type *string `json:"type,omitempty"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for VirtualHub. +func (vh VirtualHub) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vh.VirtualHubProperties != nil { + objectMap["properties"] = vh.VirtualHubProperties + } + if vh.Etag != nil { + objectMap["etag"] = vh.Etag + } + if vh.ID != nil { + objectMap["id"] = vh.ID + } + if vh.Name != nil { + objectMap["name"] = vh.Name + } + if vh.Type != nil { + objectMap["type"] = vh.Type + } + if vh.Location != nil { + objectMap["location"] = vh.Location + } + if vh.Tags != nil { + objectMap["tags"] = vh.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for VirtualHub struct. +func (vh *VirtualHub) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var virtualHubProperties VirtualHubProperties + err = json.Unmarshal(*v, &virtualHubProperties) + if err != nil { + return err + } + vh.VirtualHubProperties = &virtualHubProperties + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + vh.Etag = &etag + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + vh.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + vh.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + vh.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + vh.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + vh.Tags = tags + } + } + } + + return nil +} + +// VirtualHubProperties parameters for VirtualHub +type VirtualHubProperties struct { + // VirtualWan - The VirtualWAN to which the VirtualHub belongs + VirtualWan *SubResource `json:"virtualWan,omitempty"` + // HubVirtualNetworkConnections - list of all vnet connections with this VirtualHub. + HubVirtualNetworkConnections *[]HubVirtualNetworkConnection `json:"hubVirtualNetworkConnections,omitempty"` + // AddressPrefix - Address-prefix for this VirtualHub. + AddressPrefix *string `json:"addressPrefix,omitempty"` + // ProvisioningState - The provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` +} + +// VirtualHubsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type VirtualHubsCreateOrUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *VirtualHubsCreateOrUpdateFuture) Result(client VirtualHubsClient) (vh VirtualHub, err error) { + var done bool + done, err = future.Done(client) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualHubsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("network.VirtualHubsCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if vh.Response.Response, err = future.GetResult(sender); err == nil && vh.Response.Response.StatusCode != http.StatusNoContent { + vh, err = client.CreateOrUpdateResponder(vh.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualHubsCreateOrUpdateFuture", "Result", vh.Response.Response, "Failure responding to request") + } + } + return +} + +// VirtualHubsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. +type VirtualHubsDeleteFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *VirtualHubsDeleteFuture) Result(client VirtualHubsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.Done(client) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualHubsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("network.VirtualHubsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// VirtualHubsUpdateTagsFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type VirtualHubsUpdateTagsFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *VirtualHubsUpdateTagsFuture) Result(client VirtualHubsClient) (vh VirtualHub, err error) { + var done bool + done, err = future.Done(client) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualHubsUpdateTagsFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("network.VirtualHubsUpdateTagsFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if vh.Response.Response, err = future.GetResult(sender); err == nil && vh.Response.Response.StatusCode != http.StatusNoContent { + vh, err = client.UpdateTagsResponder(vh.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualHubsUpdateTagsFuture", "Result", vh.Response.Response, "Failure responding to request") + } + } + return +} + // VirtualNetwork virtual Network resource. type VirtualNetwork struct { autorest.Response `json:"-"` @@ -14669,7 +16428,6 @@ func (vngc *VirtualNetworkGatewayConnection) UnmarshalJSON(body []byte) error { // VirtualNetworkGatewayConnectionListEntity a common class for general resource information type VirtualNetworkGatewayConnectionListEntity struct { - autorest.Response `json:"-"` // VirtualNetworkGatewayConnectionListEntityPropertiesFormat - Properties of the virtual network gateway connection. *VirtualNetworkGatewayConnectionListEntityPropertiesFormat `json:"properties,omitempty"` // Etag - Gets a unique read-only string that changes whenever the resource is updated. @@ -15088,7 +16846,7 @@ type VirtualNetworkGatewayConnectionsUpdateTagsFuture struct { // Result returns the result of the asynchronous operation. // If the operation has not completed it will return an error. -func (future *VirtualNetworkGatewayConnectionsUpdateTagsFuture) Result(client VirtualNetworkGatewayConnectionsClient) (vngcle VirtualNetworkGatewayConnectionListEntity, err error) { +func (future *VirtualNetworkGatewayConnectionsUpdateTagsFuture) Result(client VirtualNetworkGatewayConnectionsClient) (vngc VirtualNetworkGatewayConnection, err error) { var done bool done, err = future.Done(client) if err != nil { @@ -15100,10 +16858,10 @@ func (future *VirtualNetworkGatewayConnectionsUpdateTagsFuture) Result(client Vi return } sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if vngcle.Response.Response, err = future.GetResult(sender); err == nil && vngcle.Response.Response.StatusCode != http.StatusNoContent { - vngcle, err = client.UpdateTagsResponder(vngcle.Response.Response) + if vngc.Response.Response, err = future.GetResult(sender); err == nil && vngc.Response.Response.StatusCode != http.StatusNoContent { + vngc, err = client.UpdateTagsResponder(vngc.Response.Response) if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsUpdateTagsFuture", "Result", vngcle.Response.Response, "Failure responding to request") + err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsUpdateTagsFuture", "Result", vngc.Response.Response, "Failure responding to request") } } return @@ -16373,6 +18131,220 @@ type VirtualNetworkUsageName struct { Value *string `json:"value,omitempty"` } +// VirtualWAN virtualWAN Resource. +type VirtualWAN struct { + autorest.Response `json:"-"` + *VirtualWanProperties `json:"properties,omitempty"` + // Etag - Gets a unique read-only string that changes whenever the resource is updated. + Etag *string `json:"etag,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` + // Name - Resource name. + Name *string `json:"name,omitempty"` + // Type - Resource type. + Type *string `json:"type,omitempty"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for VirtualWAN. +func (vw VirtualWAN) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vw.VirtualWanProperties != nil { + objectMap["properties"] = vw.VirtualWanProperties + } + if vw.Etag != nil { + objectMap["etag"] = vw.Etag + } + if vw.ID != nil { + objectMap["id"] = vw.ID + } + if vw.Name != nil { + objectMap["name"] = vw.Name + } + if vw.Type != nil { + objectMap["type"] = vw.Type + } + if vw.Location != nil { + objectMap["location"] = vw.Location + } + if vw.Tags != nil { + objectMap["tags"] = vw.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for VirtualWAN struct. +func (vw *VirtualWAN) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var virtualWanProperties VirtualWanProperties + err = json.Unmarshal(*v, &virtualWanProperties) + if err != nil { + return err + } + vw.VirtualWanProperties = &virtualWanProperties + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + vw.Etag = &etag + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + vw.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + vw.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + vw.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + vw.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + vw.Tags = tags + } + } + } + + return nil +} + +// VirtualWanProperties parameters for VirtualWAN +type VirtualWanProperties struct { + // DisableVpnEncryption - Vpn encryption to be disabled or not. + DisableVpnEncryption *bool `json:"disableVpnEncryption,omitempty"` + // VirtualHubs - List of VirtualHubs in the VirtualWAN. + VirtualHubs *[]SubResource `json:"virtualHubs,omitempty"` + VpnSites *[]SubResource `json:"vpnSites,omitempty"` + // ProvisioningState - The provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` +} + +// VirtualWANsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type VirtualWANsCreateOrUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *VirtualWANsCreateOrUpdateFuture) Result(client VirtualWANsClient) (vw VirtualWAN, err error) { + var done bool + done, err = future.Done(client) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualWANsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("network.VirtualWANsCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if vw.Response.Response, err = future.GetResult(sender); err == nil && vw.Response.Response.StatusCode != http.StatusNoContent { + vw, err = client.CreateOrUpdateResponder(vw.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualWANsCreateOrUpdateFuture", "Result", vw.Response.Response, "Failure responding to request") + } + } + return +} + +// VirtualWANsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. +type VirtualWANsDeleteFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *VirtualWANsDeleteFuture) Result(client VirtualWANsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.Done(client) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualWANsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("network.VirtualWANsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// VirtualWANsUpdateTagsFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type VirtualWANsUpdateTagsFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *VirtualWANsUpdateTagsFuture) Result(client VirtualWANsClient) (vw VirtualWAN, err error) { + var done bool + done, err = future.Done(client) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualWANsUpdateTagsFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("network.VirtualWANsUpdateTagsFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if vw.Response.Response, err = future.GetResult(sender); err == nil && vw.Response.Response.StatusCode != http.StatusNoContent { + vw, err = client.UpdateTagsResponder(vw.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualWANsUpdateTagsFuture", "Result", vw.Response.Response, "Failure responding to request") + } + } + return +} + // VpnClientConfiguration vpnClientConfiguration for P2S client. type VpnClientConfiguration struct { // VpnClientAddressPool - The reference of the address space resource which represents Address space for P2S VpnClient. @@ -16603,6 +18575,204 @@ type VpnClientRootCertificatePropertiesFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` } +// VpnConnection vpnConnection Resource. +type VpnConnection struct { + autorest.Response `json:"-"` + *VpnConnectionProperties `json:"properties,omitempty"` + // Etag - Gets a unique read-only string that changes whenever the resource is updated. + Etag *string `json:"etag,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` + // Name - Resource name. + Name *string `json:"name,omitempty"` + // Type - Resource type. + Type *string `json:"type,omitempty"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for VpnConnection. +func (vc VpnConnection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vc.VpnConnectionProperties != nil { + objectMap["properties"] = vc.VpnConnectionProperties + } + if vc.Etag != nil { + objectMap["etag"] = vc.Etag + } + if vc.ID != nil { + objectMap["id"] = vc.ID + } + if vc.Name != nil { + objectMap["name"] = vc.Name + } + if vc.Type != nil { + objectMap["type"] = vc.Type + } + if vc.Location != nil { + objectMap["location"] = vc.Location + } + if vc.Tags != nil { + objectMap["tags"] = vc.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for VpnConnection struct. +func (vc *VpnConnection) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var vpnConnectionProperties VpnConnectionProperties + err = json.Unmarshal(*v, &vpnConnectionProperties) + if err != nil { + return err + } + vc.VpnConnectionProperties = &vpnConnectionProperties + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + vc.Etag = &etag + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + vc.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + vc.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + vc.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + vc.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + vc.Tags = tags + } + } + } + + return nil +} + +// VpnConnectionProperties parameters for VpnConnection +type VpnConnectionProperties struct { + // RemoteVpnSite - Id of the connected vpn site. + RemoteVpnSite *SubResource `json:"remoteVpnSite,omitempty"` + // RoutingWeight - routing weight for vpn connection. + RoutingWeight *int32 `json:"routingWeight,omitempty"` + // ConnectionStatus - The connection status. Possible values include: 'VpnConnectionStatusUnknown', 'VpnConnectionStatusConnecting', 'VpnConnectionStatusConnected', 'VpnConnectionStatusNotConnected' + ConnectionStatus VpnConnectionStatus `json:"connectionStatus,omitempty"` + // IngressBytesTransferred - Ingress bytes transferred. + IngressBytesTransferred *int64 `json:"ingressBytesTransferred,omitempty"` + // EgressBytesTransferred - Egress bytes transferred. + EgressBytesTransferred *int64 `json:"egressBytesTransferred,omitempty"` + // ConnectionBandwidthInMbps - Expected bandwidth in MBPS. + ConnectionBandwidthInMbps *int32 `json:"connectionBandwidthInMbps,omitempty"` + // SharedKey - SharedKey for the vpn connection. + SharedKey *string `json:"sharedKey,omitempty"` + // EnableBgp - EnableBgp flag + EnableBgp *bool `json:"enableBgp,omitempty"` + // IpsecPolicies - The IPSec Policies to be considered by this connection. + IpsecPolicies *[]IpsecPolicy `json:"ipsecPolicies,omitempty"` + // ProvisioningState - The provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` +} + +// VpnConnectionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type VpnConnectionsCreateOrUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *VpnConnectionsCreateOrUpdateFuture) Result(client VpnConnectionsClient) (vc VpnConnection, err error) { + var done bool + done, err = future.Done(client) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VpnConnectionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("network.VpnConnectionsCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if vc.Response.Response, err = future.GetResult(sender); err == nil && vc.Response.Response.StatusCode != http.StatusNoContent { + vc, err = client.CreateOrUpdateResponder(vc.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VpnConnectionsCreateOrUpdateFuture", "Result", vc.Response.Response, "Failure responding to request") + } + } + return +} + +// VpnConnectionsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. +type VpnConnectionsDeleteFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *VpnConnectionsDeleteFuture) Result(client VpnConnectionsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.Done(client) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VpnConnectionsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("network.VpnConnectionsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + // VpnDeviceScriptParameters vpn device configuration script generation parameters type VpnDeviceScriptParameters struct { // Vendor - The vendor for the vpn device. @@ -16613,6 +18783,472 @@ type VpnDeviceScriptParameters struct { FirmwareVersion *string `json:"firmwareVersion,omitempty"` } +// VpnGateway vpnGateway Resource. +type VpnGateway struct { + autorest.Response `json:"-"` + *VpnGatewayProperties `json:"properties,omitempty"` + // Etag - Gets a unique read-only string that changes whenever the resource is updated. + Etag *string `json:"etag,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` + // Name - Resource name. + Name *string `json:"name,omitempty"` + // Type - Resource type. + Type *string `json:"type,omitempty"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for VpnGateway. +func (vg VpnGateway) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vg.VpnGatewayProperties != nil { + objectMap["properties"] = vg.VpnGatewayProperties + } + if vg.Etag != nil { + objectMap["etag"] = vg.Etag + } + if vg.ID != nil { + objectMap["id"] = vg.ID + } + if vg.Name != nil { + objectMap["name"] = vg.Name + } + if vg.Type != nil { + objectMap["type"] = vg.Type + } + if vg.Location != nil { + objectMap["location"] = vg.Location + } + if vg.Tags != nil { + objectMap["tags"] = vg.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for VpnGateway struct. +func (vg *VpnGateway) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var vpnGatewayProperties VpnGatewayProperties + err = json.Unmarshal(*v, &vpnGatewayProperties) + if err != nil { + return err + } + vg.VpnGatewayProperties = &vpnGatewayProperties + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + vg.Etag = &etag + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + vg.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + vg.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + vg.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + vg.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + vg.Tags = tags + } + } + } + + return nil +} + +// VpnGatewayProperties parameters for VpnGateway +type VpnGatewayProperties struct { + // VirtualHub - The VirtualHub to which the gateway belongs + VirtualHub *SubResource `json:"virtualHub,omitempty"` + // Connections - list of all vpn connections to the gateway. + Connections *[]VpnConnection `json:"connections,omitempty"` + // BgpSettings - Local network gateway's BGP speaker settings. + BgpSettings *BgpSettings `json:"bgpSettings,omitempty"` + // ProvisioningState - The provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // Policies - The policies applied to this vpn gateway. + Policies *Policies `json:"policies,omitempty"` +} + +// VpnGatewaysCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type VpnGatewaysCreateOrUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *VpnGatewaysCreateOrUpdateFuture) Result(client VpnGatewaysClient) (vg VpnGateway, err error) { + var done bool + done, err = future.Done(client) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VpnGatewaysCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("network.VpnGatewaysCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if vg.Response.Response, err = future.GetResult(sender); err == nil && vg.Response.Response.StatusCode != http.StatusNoContent { + vg, err = client.CreateOrUpdateResponder(vg.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VpnGatewaysCreateOrUpdateFuture", "Result", vg.Response.Response, "Failure responding to request") + } + } + return +} + +// VpnGatewaysDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. +type VpnGatewaysDeleteFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *VpnGatewaysDeleteFuture) Result(client VpnGatewaysClient) (ar autorest.Response, err error) { + var done bool + done, err = future.Done(client) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VpnGatewaysDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("network.VpnGatewaysDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// VpnGatewaysUpdateTagsFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type VpnGatewaysUpdateTagsFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *VpnGatewaysUpdateTagsFuture) Result(client VpnGatewaysClient) (vg VpnGateway, err error) { + var done bool + done, err = future.Done(client) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VpnGatewaysUpdateTagsFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("network.VpnGatewaysUpdateTagsFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if vg.Response.Response, err = future.GetResult(sender); err == nil && vg.Response.Response.StatusCode != http.StatusNoContent { + vg, err = client.UpdateTagsResponder(vg.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VpnGatewaysUpdateTagsFuture", "Result", vg.Response.Response, "Failure responding to request") + } + } + return +} + +// VpnSite vpnSite Resource. +type VpnSite struct { + autorest.Response `json:"-"` + *VpnSiteProperties `json:"properties,omitempty"` + // Etag - Gets a unique read-only string that changes whenever the resource is updated. + Etag *string `json:"etag,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` + // Name - Resource name. + Name *string `json:"name,omitempty"` + // Type - Resource type. + Type *string `json:"type,omitempty"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for VpnSite. +func (vs VpnSite) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vs.VpnSiteProperties != nil { + objectMap["properties"] = vs.VpnSiteProperties + } + if vs.Etag != nil { + objectMap["etag"] = vs.Etag + } + if vs.ID != nil { + objectMap["id"] = vs.ID + } + if vs.Name != nil { + objectMap["name"] = vs.Name + } + if vs.Type != nil { + objectMap["type"] = vs.Type + } + if vs.Location != nil { + objectMap["location"] = vs.Location + } + if vs.Tags != nil { + objectMap["tags"] = vs.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for VpnSite struct. +func (vs *VpnSite) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var vpnSiteProperties VpnSiteProperties + err = json.Unmarshal(*v, &vpnSiteProperties) + if err != nil { + return err + } + vs.VpnSiteProperties = &vpnSiteProperties + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + vs.Etag = &etag + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + vs.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + vs.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + vs.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + vs.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + vs.Tags = tags + } + } + } + + return nil +} + +// VpnSiteID vpnSite Resource. +type VpnSiteID struct { + // VpnSite - The resource-uri of the vpn-site for which config is to be fetched. + VpnSite *string `json:"vpnSite,omitempty"` +} + +// VpnSiteProperties parameters for VpnSite +type VpnSiteProperties struct { + // VirtualWAN - The VirtualWAN to which the vpnSite belongs + VirtualWAN *SubResource `json:"virtualWAN,omitempty"` + // DeviceProperties - The device properties + DeviceProperties *DeviceProperties `json:"deviceProperties,omitempty"` + // IPAddress - The ip-address for the vpn-site. + IPAddress *string `json:"ipAddress,omitempty"` + // SiteKey - The key for vpn-site that can be used for connections. + SiteKey *string `json:"siteKey,omitempty"` + // AddressSpace - The AddressSpace that contains an array of IP address ranges. + AddressSpace *AddressSpace `json:"addressSpace,omitempty"` + // BgpProperties - The set of bgp properties. + BgpProperties *BgpSettings `json:"bgpProperties,omitempty"` + // ProvisioningState - The provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` +} + +// VpnSitesConfigurationDownloadFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type VpnSitesConfigurationDownloadFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *VpnSitesConfigurationDownloadFuture) Result(client VpnSitesConfigurationClient) (ar autorest.Response, err error) { + var done bool + done, err = future.Done(client) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VpnSitesConfigurationDownloadFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("network.VpnSitesConfigurationDownloadFuture") + return + } + ar.Response = future.Response() + return +} + +// VpnSitesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type VpnSitesCreateOrUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *VpnSitesCreateOrUpdateFuture) Result(client VpnSitesClient) (vs VpnSite, err error) { + var done bool + done, err = future.Done(client) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VpnSitesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("network.VpnSitesCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if vs.Response.Response, err = future.GetResult(sender); err == nil && vs.Response.Response.StatusCode != http.StatusNoContent { + vs, err = client.CreateOrUpdateResponder(vs.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VpnSitesCreateOrUpdateFuture", "Result", vs.Response.Response, "Failure responding to request") + } + } + return +} + +// VpnSitesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. +type VpnSitesDeleteFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *VpnSitesDeleteFuture) Result(client VpnSitesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.Done(client) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VpnSitesDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("network.VpnSitesDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// VpnSitesUpdateTagsFuture an abstraction for monitoring and retrieving the results of a long-running operation. +type VpnSitesUpdateTagsFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *VpnSitesUpdateTagsFuture) Result(client VpnSitesClient) (vs VpnSite, err error) { + var done bool + done, err = future.Done(client) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VpnSitesUpdateTagsFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("network.VpnSitesUpdateTagsFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if vs.Response.Response, err = future.GetResult(sender); err == nil && vs.Response.Response.StatusCode != http.StatusNoContent { + vs, err = client.UpdateTagsResponder(vs.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VpnSitesUpdateTagsFuture", "Result", vs.Response.Response, "Failure responding to request") + } + } + return +} + // Watcher network watcher in a resource group. type Watcher struct { autorest.Response `json:"-"` diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-04-01/network/virtualhubs.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-04-01/network/virtualhubs.go new file mode 100644 index 000000000..af9b21e1f --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-04-01/network/virtualhubs.go @@ -0,0 +1,508 @@ +package network + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "net/http" +) + +// VirtualHubsClient is the network Client +type VirtualHubsClient struct { + BaseClient +} + +// NewVirtualHubsClient creates an instance of the VirtualHubsClient client. +func NewVirtualHubsClient(subscriptionID string) VirtualHubsClient { + return NewVirtualHubsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewVirtualHubsClientWithBaseURI creates an instance of the VirtualHubsClient client. +func NewVirtualHubsClientWithBaseURI(baseURI string, subscriptionID string) VirtualHubsClient { + return VirtualHubsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub. +// Parameters: +// resourceGroupName - the resource group name of the VirtualHub. +// virtualHubName - the name of the VirtualHub. +// virtualHubParameters - parameters supplied to create or update VirtualHub. +func (client VirtualHubsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, virtualHubName string, virtualHubParameters VirtualHub) (result VirtualHubsCreateOrUpdateFuture, err error) { + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, virtualHubName, virtualHubParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualHubsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualHubsClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client VirtualHubsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, virtualHubName string, virtualHubParameters VirtualHub) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "virtualHubName": autorest.Encode("path", virtualHubName), + } + + const APIVersion = "2018-04-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}", pathParameters), + autorest.WithJSON(virtualHubParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualHubsClient) CreateOrUpdateSender(req *http.Request) (future VirtualHubsCreateOrUpdateFuture, err error) { + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client VirtualHubsClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualHub, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes a VirtualHub. +// Parameters: +// resourceGroupName - the resource group name of the VirtualHub. +// virtualHubName - the name of the VirtualHub. +func (client VirtualHubsClient) Delete(ctx context.Context, resourceGroupName string, virtualHubName string) (result VirtualHubsDeleteFuture, err error) { + req, err := client.DeletePreparer(ctx, resourceGroupName, virtualHubName) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualHubsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualHubsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client VirtualHubsClient) DeletePreparer(ctx context.Context, resourceGroupName string, virtualHubName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "virtualHubName": autorest.Encode("path", virtualHubName), + } + + const APIVersion = "2018-04-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualHubsClient) DeleteSender(req *http.Request) (future VirtualHubsDeleteFuture, err error) { + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client VirtualHubsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get retrieves the details of a VirtualHub. +// Parameters: +// resourceGroupName - the resource group name of the VirtualHub. +// virtualHubName - the name of the VirtualHub. +func (client VirtualHubsClient) Get(ctx context.Context, resourceGroupName string, virtualHubName string) (result VirtualHub, err error) { + req, err := client.GetPreparer(ctx, resourceGroupName, virtualHubName) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualHubsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "network.VirtualHubsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualHubsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client VirtualHubsClient) GetPreparer(ctx context.Context, resourceGroupName string, virtualHubName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "virtualHubName": autorest.Encode("path", virtualHubName), + } + + const APIVersion = "2018-04-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualHubsClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client VirtualHubsClient) GetResponder(resp *http.Response) (result VirtualHub, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists all the VirtualHubs in a subscription. +func (client VirtualHubsClient) List(ctx context.Context) (result ListVirtualHubsResultPage, err error) { + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualHubsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.lvhr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "network.VirtualHubsClient", "List", resp, "Failure sending request") + return + } + + result.lvhr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualHubsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client VirtualHubsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-04-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualHubs", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualHubsClient) ListSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client VirtualHubsClient) ListResponder(resp *http.Response) (result ListVirtualHubsResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client VirtualHubsClient) listNextResults(lastResults ListVirtualHubsResult) (result ListVirtualHubsResult, err error) { + req, err := lastResults.listVirtualHubsResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "network.VirtualHubsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "network.VirtualHubsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualHubsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client VirtualHubsClient) ListComplete(ctx context.Context) (result ListVirtualHubsResultIterator, err error) { + result.page, err = client.List(ctx) + return +} + +// ListByResourceGroup lists all the VirtualHubs in a resource group. +// Parameters: +// resourceGroupName - the resource group name of the VirtualHub. +func (client VirtualHubsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result ListVirtualHubsResultPage, err error) { + result.fn = client.listByResourceGroupNextResults + req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualHubsClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.lvhr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "network.VirtualHubsClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result.lvhr, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualHubsClient", "ListByResourceGroup", resp, "Failure responding to request") + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client VirtualHubsClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-04-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualHubsClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always +// closes the http.Response Body. +func (client VirtualHubsClient) ListByResourceGroupResponder(resp *http.Response) (result ListVirtualHubsResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByResourceGroupNextResults retrieves the next set of results, if any. +func (client VirtualHubsClient) listByResourceGroupNextResults(lastResults ListVirtualHubsResult) (result ListVirtualHubsResult, err error) { + req, err := lastResults.listVirtualHubsResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "network.VirtualHubsClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "network.VirtualHubsClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualHubsClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client VirtualHubsClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result ListVirtualHubsResultIterator, err error) { + result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) + return +} + +// UpdateTags updates VirtualHub tags. +// Parameters: +// resourceGroupName - the resource group name of the VirtualHub. +// virtualHubName - the name of the VirtualHub. +// virtualHubParameters - parameters supplied to update VirtualHub tags. +func (client VirtualHubsClient) UpdateTags(ctx context.Context, resourceGroupName string, virtualHubName string, virtualHubParameters TagsObject) (result VirtualHubsUpdateTagsFuture, err error) { + req, err := client.UpdateTagsPreparer(ctx, resourceGroupName, virtualHubName, virtualHubParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualHubsClient", "UpdateTags", nil, "Failure preparing request") + return + } + + result, err = client.UpdateTagsSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualHubsClient", "UpdateTags", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdateTagsPreparer prepares the UpdateTags request. +func (client VirtualHubsClient) UpdateTagsPreparer(ctx context.Context, resourceGroupName string, virtualHubName string, virtualHubParameters TagsObject) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "virtualHubName": autorest.Encode("path", virtualHubName), + } + + const APIVersion = "2018-04-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}", pathParameters), + autorest.WithJSON(virtualHubParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateTagsSender sends the UpdateTags request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualHubsClient) UpdateTagsSender(req *http.Request) (future VirtualHubsUpdateTagsFuture, err error) { + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// UpdateTagsResponder handles the response to the UpdateTags request. The method always +// closes the http.Response Body. +func (client VirtualHubsClient) UpdateTagsResponder(resp *http.Response) (result VirtualHub, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-04-01/network/virtualnetworkgatewayconnections.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-04-01/network/virtualnetworkgatewayconnections.go index 047ad1232..1cee6c001 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-04-01/network/virtualnetworkgatewayconnections.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-04-01/network/virtualnetworkgatewayconnections.go @@ -439,7 +439,7 @@ func (client VirtualNetworkGatewayConnectionsClient) ResetSharedKey(ctx context. if err := validation.Validate([]validation.Validation{ {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.KeyLength", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.KeyLength", Name: validation.InclusiveMaximum, Rule: 128, Chain: nil}, + Chain: []validation.Constraint{{Target: "parameters.KeyLength", Name: validation.InclusiveMaximum, Rule: int64(128), Chain: nil}, {Target: "parameters.KeyLength", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("network.VirtualNetworkGatewayConnectionsClient", "ResetSharedKey", err.Error()) @@ -659,7 +659,7 @@ func (client VirtualNetworkGatewayConnectionsClient) UpdateTagsSender(req *http. // UpdateTagsResponder handles the response to the UpdateTags request. The method always // closes the http.Response Body. -func (client VirtualNetworkGatewayConnectionsClient) UpdateTagsResponder(resp *http.Response) (result VirtualNetworkGatewayConnectionListEntity, err error) { +func (client VirtualNetworkGatewayConnectionsClient) UpdateTagsResponder(resp *http.Response) (result VirtualNetworkGatewayConnection, err error) { err = autorest.Respond( resp, client.ByInspecting(), diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-04-01/network/virtualwans.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-04-01/network/virtualwans.go new file mode 100644 index 000000000..0f06b6121 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-04-01/network/virtualwans.go @@ -0,0 +1,508 @@ +package network + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "net/http" +) + +// VirtualWANsClient is the network Client +type VirtualWANsClient struct { + BaseClient +} + +// NewVirtualWANsClient creates an instance of the VirtualWANsClient client. +func NewVirtualWANsClient(subscriptionID string) VirtualWANsClient { + return NewVirtualWANsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewVirtualWANsClientWithBaseURI creates an instance of the VirtualWANsClient client. +func NewVirtualWANsClientWithBaseURI(baseURI string, subscriptionID string) VirtualWANsClient { + return VirtualWANsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates a VirtualWAN resource if it doesn't exist else updates the existing VirtualWAN. +// Parameters: +// resourceGroupName - the resource group name of the VirtualWan. +// virtualWANName - the name of the VirtualWAN being created or updated. +// wANParameters - parameters supplied to create or update VirtualWAN. +func (client VirtualWANsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, virtualWANName string, wANParameters VirtualWAN) (result VirtualWANsCreateOrUpdateFuture, err error) { + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, virtualWANName, wANParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualWANsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualWANsClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client VirtualWANsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, virtualWANName string, wANParameters VirtualWAN) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "VirtualWANName": autorest.Encode("path", virtualWANName), + } + + const APIVersion = "2018-04-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{VirtualWANName}", pathParameters), + autorest.WithJSON(wANParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualWANsClient) CreateOrUpdateSender(req *http.Request) (future VirtualWANsCreateOrUpdateFuture, err error) { + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client VirtualWANsClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualWAN, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes a VirtualWAN. +// Parameters: +// resourceGroupName - the resource group name of the VirtualWan. +// virtualWANName - the name of the VirtualWAN being deleted. +func (client VirtualWANsClient) Delete(ctx context.Context, resourceGroupName string, virtualWANName string) (result VirtualWANsDeleteFuture, err error) { + req, err := client.DeletePreparer(ctx, resourceGroupName, virtualWANName) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualWANsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualWANsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client VirtualWANsClient) DeletePreparer(ctx context.Context, resourceGroupName string, virtualWANName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "VirtualWANName": autorest.Encode("path", virtualWANName), + } + + const APIVersion = "2018-04-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{VirtualWANName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualWANsClient) DeleteSender(req *http.Request) (future VirtualWANsDeleteFuture, err error) { + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client VirtualWANsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get retrieves the details of a VirtualWAN. +// Parameters: +// resourceGroupName - the resource group name of the VirtualWan. +// virtualWANName - the name of the VirtualWAN being retrieved. +func (client VirtualWANsClient) Get(ctx context.Context, resourceGroupName string, virtualWANName string) (result VirtualWAN, err error) { + req, err := client.GetPreparer(ctx, resourceGroupName, virtualWANName) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualWANsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "network.VirtualWANsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualWANsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client VirtualWANsClient) GetPreparer(ctx context.Context, resourceGroupName string, virtualWANName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "VirtualWANName": autorest.Encode("path", virtualWANName), + } + + const APIVersion = "2018-04-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{VirtualWANName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualWANsClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client VirtualWANsClient) GetResponder(resp *http.Response) (result VirtualWAN, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists all the VirtualWANs in a subscription. +func (client VirtualWANsClient) List(ctx context.Context) (result ListVirtualWANsResultPage, err error) { + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualWANsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.lvwnr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "network.VirtualWANsClient", "List", resp, "Failure sending request") + return + } + + result.lvwnr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualWANsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client VirtualWANsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-04-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualWans", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualWANsClient) ListSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client VirtualWANsClient) ListResponder(resp *http.Response) (result ListVirtualWANsResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client VirtualWANsClient) listNextResults(lastResults ListVirtualWANsResult) (result ListVirtualWANsResult, err error) { + req, err := lastResults.listVirtualWANsResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "network.VirtualWANsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "network.VirtualWANsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualWANsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client VirtualWANsClient) ListComplete(ctx context.Context) (result ListVirtualWANsResultIterator, err error) { + result.page, err = client.List(ctx) + return +} + +// ListByResourceGroup lists all the VirtualWANs in a resource group. +// Parameters: +// resourceGroupName - the resource group name of the VirtualWan. +func (client VirtualWANsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result ListVirtualWANsResultPage, err error) { + result.fn = client.listByResourceGroupNextResults + req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualWANsClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.lvwnr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "network.VirtualWANsClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result.lvwnr, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualWANsClient", "ListByResourceGroup", resp, "Failure responding to request") + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client VirtualWANsClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-04-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualWANsClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always +// closes the http.Response Body. +func (client VirtualWANsClient) ListByResourceGroupResponder(resp *http.Response) (result ListVirtualWANsResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByResourceGroupNextResults retrieves the next set of results, if any. +func (client VirtualWANsClient) listByResourceGroupNextResults(lastResults ListVirtualWANsResult) (result ListVirtualWANsResult, err error) { + req, err := lastResults.listVirtualWANsResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "network.VirtualWANsClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "network.VirtualWANsClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualWANsClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client VirtualWANsClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result ListVirtualWANsResultIterator, err error) { + result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) + return +} + +// UpdateTags updates a VirtualWAN tags. +// Parameters: +// resourceGroupName - the resource group name of the VirtualWan. +// virtualWANName - the name of the VirtualWAN being updated. +// wANParameters - parameters supplied to Update VirtualWAN tags. +func (client VirtualWANsClient) UpdateTags(ctx context.Context, resourceGroupName string, virtualWANName string, wANParameters TagsObject) (result VirtualWANsUpdateTagsFuture, err error) { + req, err := client.UpdateTagsPreparer(ctx, resourceGroupName, virtualWANName, wANParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualWANsClient", "UpdateTags", nil, "Failure preparing request") + return + } + + result, err = client.UpdateTagsSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualWANsClient", "UpdateTags", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdateTagsPreparer prepares the UpdateTags request. +func (client VirtualWANsClient) UpdateTagsPreparer(ctx context.Context, resourceGroupName string, virtualWANName string, wANParameters TagsObject) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "VirtualWANName": autorest.Encode("path", virtualWANName), + } + + const APIVersion = "2018-04-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{VirtualWANName}", pathParameters), + autorest.WithJSON(wANParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateTagsSender sends the UpdateTags request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualWANsClient) UpdateTagsSender(req *http.Request) (future VirtualWANsUpdateTagsFuture, err error) { + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// UpdateTagsResponder handles the response to the UpdateTags request. The method always +// closes the http.Response Body. +func (client VirtualWANsClient) UpdateTagsResponder(resp *http.Response) (result VirtualWAN, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-04-01/network/vpnconnections.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-04-01/network/vpnconnections.go new file mode 100644 index 000000000..d63d33a82 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-04-01/network/vpnconnections.go @@ -0,0 +1,351 @@ +package network + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "net/http" +) + +// VpnConnectionsClient is the network Client +type VpnConnectionsClient struct { + BaseClient +} + +// NewVpnConnectionsClient creates an instance of the VpnConnectionsClient client. +func NewVpnConnectionsClient(subscriptionID string) VpnConnectionsClient { + return NewVpnConnectionsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewVpnConnectionsClientWithBaseURI creates an instance of the VpnConnectionsClient client. +func NewVpnConnectionsClientWithBaseURI(baseURI string, subscriptionID string) VpnConnectionsClient { + return VpnConnectionsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing +// connection. +// Parameters: +// resourceGroupName - the resource group name of the VpnGateway. +// gatewayName - the name of the gateway. +// connectionName - the name of the connection. +// vpnConnectionParameters - parameters supplied to create or Update a VPN Connection. +func (client VpnConnectionsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, gatewayName string, connectionName string, vpnConnectionParameters VpnConnection) (result VpnConnectionsCreateOrUpdateFuture, err error) { + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, gatewayName, connectionName, vpnConnectionParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VpnConnectionsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VpnConnectionsClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client VpnConnectionsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, gatewayName string, connectionName string, vpnConnectionParameters VpnConnection) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "connectionName": autorest.Encode("path", connectionName), + "gatewayName": autorest.Encode("path", gatewayName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-04-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections/{connectionName}", pathParameters), + autorest.WithJSON(vpnConnectionParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client VpnConnectionsClient) CreateOrUpdateSender(req *http.Request) (future VpnConnectionsCreateOrUpdateFuture, err error) { + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client VpnConnectionsClient) CreateOrUpdateResponder(resp *http.Response) (result VpnConnection, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes a vpn connection. +// Parameters: +// resourceGroupName - the resource group name of the VpnGateway. +// gatewayName - the name of the gateway. +// connectionName - the name of the connection. +func (client VpnConnectionsClient) Delete(ctx context.Context, resourceGroupName string, gatewayName string, connectionName string) (result VpnConnectionsDeleteFuture, err error) { + req, err := client.DeletePreparer(ctx, resourceGroupName, gatewayName, connectionName) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VpnConnectionsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VpnConnectionsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client VpnConnectionsClient) DeletePreparer(ctx context.Context, resourceGroupName string, gatewayName string, connectionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "connectionName": autorest.Encode("path", connectionName), + "gatewayName": autorest.Encode("path", gatewayName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-04-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections/{connectionName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client VpnConnectionsClient) DeleteSender(req *http.Request) (future VpnConnectionsDeleteFuture, err error) { + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client VpnConnectionsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get retrieves the details of a vpn connection. +// Parameters: +// resourceGroupName - the resource group name of the VpnGateway. +// gatewayName - the name of the gateway. +// connectionName - the name of the vpn connection. +func (client VpnConnectionsClient) Get(ctx context.Context, resourceGroupName string, gatewayName string, connectionName string) (result VpnConnection, err error) { + req, err := client.GetPreparer(ctx, resourceGroupName, gatewayName, connectionName) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VpnConnectionsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "network.VpnConnectionsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VpnConnectionsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client VpnConnectionsClient) GetPreparer(ctx context.Context, resourceGroupName string, gatewayName string, connectionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "connectionName": autorest.Encode("path", connectionName), + "gatewayName": autorest.Encode("path", gatewayName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-04-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections/{connectionName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client VpnConnectionsClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client VpnConnectionsClient) GetResponder(resp *http.Response) (result VpnConnection, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByVpnGateway retrieves all vpn connections for a particular virtual wan vpn gateway. +// Parameters: +// gatewayName - the name of the gateway. +func (client VpnConnectionsClient) ListByVpnGateway(ctx context.Context, gatewayName string) (result ListVpnConnectionsResultPage, err error) { + result.fn = client.listByVpnGatewayNextResults + req, err := client.ListByVpnGatewayPreparer(ctx, gatewayName) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VpnConnectionsClient", "ListByVpnGateway", nil, "Failure preparing request") + return + } + + resp, err := client.ListByVpnGatewaySender(req) + if err != nil { + result.lvcr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "network.VpnConnectionsClient", "ListByVpnGateway", resp, "Failure sending request") + return + } + + result.lvcr, err = client.ListByVpnGatewayResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VpnConnectionsClient", "ListByVpnGateway", resp, "Failure responding to request") + } + + return +} + +// ListByVpnGatewayPreparer prepares the ListByVpnGateway request. +func (client VpnConnectionsClient) ListByVpnGatewayPreparer(ctx context.Context, gatewayName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "gatewayName": autorest.Encode("path", gatewayName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-04-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByVpnGatewaySender sends the ListByVpnGateway request. The method will close the +// http.Response Body if it receives an error. +func (client VpnConnectionsClient) ListByVpnGatewaySender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByVpnGatewayResponder handles the response to the ListByVpnGateway request. The method always +// closes the http.Response Body. +func (client VpnConnectionsClient) ListByVpnGatewayResponder(resp *http.Response) (result ListVpnConnectionsResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByVpnGatewayNextResults retrieves the next set of results, if any. +func (client VpnConnectionsClient) listByVpnGatewayNextResults(lastResults ListVpnConnectionsResult) (result ListVpnConnectionsResult, err error) { + req, err := lastResults.listVpnConnectionsResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "network.VpnConnectionsClient", "listByVpnGatewayNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByVpnGatewaySender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "network.VpnConnectionsClient", "listByVpnGatewayNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByVpnGatewayResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VpnConnectionsClient", "listByVpnGatewayNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByVpnGatewayComplete enumerates all values, automatically crossing page boundaries as required. +func (client VpnConnectionsClient) ListByVpnGatewayComplete(ctx context.Context, gatewayName string) (result ListVpnConnectionsResultIterator, err error) { + result.page, err = client.ListByVpnGateway(ctx, gatewayName) + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-04-01/network/vpngateways.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-04-01/network/vpngateways.go new file mode 100644 index 000000000..516cec4a1 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-04-01/network/vpngateways.go @@ -0,0 +1,508 @@ +package network + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "net/http" +) + +// VpnGatewaysClient is the network Client +type VpnGatewaysClient struct { + BaseClient +} + +// NewVpnGatewaysClient creates an instance of the VpnGatewaysClient client. +func NewVpnGatewaysClient(subscriptionID string) VpnGatewaysClient { + return NewVpnGatewaysClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewVpnGatewaysClientWithBaseURI creates an instance of the VpnGatewaysClient client. +func NewVpnGatewaysClientWithBaseURI(baseURI string, subscriptionID string) VpnGatewaysClient { + return VpnGatewaysClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway. +// Parameters: +// resourceGroupName - the resource group name of the VpnGateway. +// gatewayName - the name of the gateway. +// vpnGatewayParameters - parameters supplied to create or Update a virtual wan vpn gateway. +func (client VpnGatewaysClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, gatewayName string, vpnGatewayParameters VpnGateway) (result VpnGatewaysCreateOrUpdateFuture, err error) { + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, gatewayName, vpnGatewayParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VpnGatewaysClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VpnGatewaysClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client VpnGatewaysClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, gatewayName string, vpnGatewayParameters VpnGateway) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "gatewayName": autorest.Encode("path", gatewayName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-04-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}", pathParameters), + autorest.WithJSON(vpnGatewayParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client VpnGatewaysClient) CreateOrUpdateSender(req *http.Request) (future VpnGatewaysCreateOrUpdateFuture, err error) { + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client VpnGatewaysClient) CreateOrUpdateResponder(resp *http.Response) (result VpnGateway, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes a virtual wan vpn gateway. +// Parameters: +// resourceGroupName - the resource group name of the VpnGateway. +// gatewayName - the name of the gateway. +func (client VpnGatewaysClient) Delete(ctx context.Context, resourceGroupName string, gatewayName string) (result VpnGatewaysDeleteFuture, err error) { + req, err := client.DeletePreparer(ctx, resourceGroupName, gatewayName) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VpnGatewaysClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VpnGatewaysClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client VpnGatewaysClient) DeletePreparer(ctx context.Context, resourceGroupName string, gatewayName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "gatewayName": autorest.Encode("path", gatewayName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-04-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client VpnGatewaysClient) DeleteSender(req *http.Request) (future VpnGatewaysDeleteFuture, err error) { + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client VpnGatewaysClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get retrieves the details of a virtual wan vpn gateway. +// Parameters: +// resourceGroupName - the resource group name of the VpnGateway. +// gatewayName - the name of the gateway. +func (client VpnGatewaysClient) Get(ctx context.Context, resourceGroupName string, gatewayName string) (result VpnGateway, err error) { + req, err := client.GetPreparer(ctx, resourceGroupName, gatewayName) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VpnGatewaysClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "network.VpnGatewaysClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VpnGatewaysClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client VpnGatewaysClient) GetPreparer(ctx context.Context, resourceGroupName string, gatewayName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "gatewayName": autorest.Encode("path", gatewayName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-04-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client VpnGatewaysClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client VpnGatewaysClient) GetResponder(resp *http.Response) (result VpnGateway, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists all the VpnGateways in a subscription. +func (client VpnGatewaysClient) List(ctx context.Context) (result ListVpnGatewaysResultPage, err error) { + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VpnGatewaysClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.lvgr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "network.VpnGatewaysClient", "List", resp, "Failure sending request") + return + } + + result.lvgr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VpnGatewaysClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client VpnGatewaysClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-04-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/vpnGateways", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client VpnGatewaysClient) ListSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client VpnGatewaysClient) ListResponder(resp *http.Response) (result ListVpnGatewaysResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client VpnGatewaysClient) listNextResults(lastResults ListVpnGatewaysResult) (result ListVpnGatewaysResult, err error) { + req, err := lastResults.listVpnGatewaysResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "network.VpnGatewaysClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "network.VpnGatewaysClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VpnGatewaysClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client VpnGatewaysClient) ListComplete(ctx context.Context) (result ListVpnGatewaysResultIterator, err error) { + result.page, err = client.List(ctx) + return +} + +// ListByResourceGroup lists all the VpnGateways in a resource group. +// Parameters: +// resourceGroupName - the resource group name of the VpnGateway. +func (client VpnGatewaysClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result ListVpnGatewaysResultPage, err error) { + result.fn = client.listByResourceGroupNextResults + req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VpnGatewaysClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.lvgr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "network.VpnGatewaysClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result.lvgr, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VpnGatewaysClient", "ListByResourceGroup", resp, "Failure responding to request") + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client VpnGatewaysClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-04-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the +// http.Response Body if it receives an error. +func (client VpnGatewaysClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always +// closes the http.Response Body. +func (client VpnGatewaysClient) ListByResourceGroupResponder(resp *http.Response) (result ListVpnGatewaysResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByResourceGroupNextResults retrieves the next set of results, if any. +func (client VpnGatewaysClient) listByResourceGroupNextResults(lastResults ListVpnGatewaysResult) (result ListVpnGatewaysResult, err error) { + req, err := lastResults.listVpnGatewaysResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "network.VpnGatewaysClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "network.VpnGatewaysClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VpnGatewaysClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client VpnGatewaysClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result ListVpnGatewaysResultIterator, err error) { + result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) + return +} + +// UpdateTags updates virtual wan vpn gateway tags. +// Parameters: +// resourceGroupName - the resource group name of the VpnGateway. +// gatewayName - the name of the gateway. +// vpnGatewayParameters - parameters supplied to update a virtual wan vpn gateway tags. +func (client VpnGatewaysClient) UpdateTags(ctx context.Context, resourceGroupName string, gatewayName string, vpnGatewayParameters TagsObject) (result VpnGatewaysUpdateTagsFuture, err error) { + req, err := client.UpdateTagsPreparer(ctx, resourceGroupName, gatewayName, vpnGatewayParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VpnGatewaysClient", "UpdateTags", nil, "Failure preparing request") + return + } + + result, err = client.UpdateTagsSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VpnGatewaysClient", "UpdateTags", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdateTagsPreparer prepares the UpdateTags request. +func (client VpnGatewaysClient) UpdateTagsPreparer(ctx context.Context, resourceGroupName string, gatewayName string, vpnGatewayParameters TagsObject) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "gatewayName": autorest.Encode("path", gatewayName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-04-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}", pathParameters), + autorest.WithJSON(vpnGatewayParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateTagsSender sends the UpdateTags request. The method will close the +// http.Response Body if it receives an error. +func (client VpnGatewaysClient) UpdateTagsSender(req *http.Request) (future VpnGatewaysUpdateTagsFuture, err error) { + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// UpdateTagsResponder handles the response to the UpdateTags request. The method always +// closes the http.Response Body. +func (client VpnGatewaysClient) UpdateTagsResponder(resp *http.Response) (result VpnGateway, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-04-01/network/vpnsites.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-04-01/network/vpnsites.go new file mode 100644 index 000000000..825232b5a --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-04-01/network/vpnsites.go @@ -0,0 +1,508 @@ +package network + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "net/http" +) + +// VpnSitesClient is the network Client +type VpnSitesClient struct { + BaseClient +} + +// NewVpnSitesClient creates an instance of the VpnSitesClient client. +func NewVpnSitesClient(subscriptionID string) VpnSitesClient { + return NewVpnSitesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewVpnSitesClientWithBaseURI creates an instance of the VpnSitesClient client. +func NewVpnSitesClientWithBaseURI(baseURI string, subscriptionID string) VpnSitesClient { + return VpnSitesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates a VpnSite resource if it doesn't exist else updates the existing VpnSite. +// Parameters: +// resourceGroupName - the resource group name of the VpnSite. +// vpnSiteName - the name of the VpnSite being created or updated. +// vpnSiteParameters - parameters supplied to create or update VpnSite. +func (client VpnSitesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, vpnSiteName string, vpnSiteParameters VpnSite) (result VpnSitesCreateOrUpdateFuture, err error) { + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, vpnSiteName, vpnSiteParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VpnSitesClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VpnSitesClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client VpnSitesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, vpnSiteName string, vpnSiteParameters VpnSite) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vpnSiteName": autorest.Encode("path", vpnSiteName), + } + + const APIVersion = "2018-04-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites/{vpnSiteName}", pathParameters), + autorest.WithJSON(vpnSiteParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client VpnSitesClient) CreateOrUpdateSender(req *http.Request) (future VpnSitesCreateOrUpdateFuture, err error) { + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client VpnSitesClient) CreateOrUpdateResponder(resp *http.Response) (result VpnSite, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes a VpnSite. +// Parameters: +// resourceGroupName - the resource group name of the VpnSite. +// vpnSiteName - the name of the VpnSite being deleted. +func (client VpnSitesClient) Delete(ctx context.Context, resourceGroupName string, vpnSiteName string) (result VpnSitesDeleteFuture, err error) { + req, err := client.DeletePreparer(ctx, resourceGroupName, vpnSiteName) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VpnSitesClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VpnSitesClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client VpnSitesClient) DeletePreparer(ctx context.Context, resourceGroupName string, vpnSiteName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vpnSiteName": autorest.Encode("path", vpnSiteName), + } + + const APIVersion = "2018-04-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites/{vpnSiteName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client VpnSitesClient) DeleteSender(req *http.Request) (future VpnSitesDeleteFuture, err error) { + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client VpnSitesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get retrieves the details of a VPNsite. +// Parameters: +// resourceGroupName - the resource group name of the VpnSite. +// vpnSiteName - the name of the VpnSite being retrieved. +func (client VpnSitesClient) Get(ctx context.Context, resourceGroupName string, vpnSiteName string) (result VpnSite, err error) { + req, err := client.GetPreparer(ctx, resourceGroupName, vpnSiteName) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VpnSitesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "network.VpnSitesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VpnSitesClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client VpnSitesClient) GetPreparer(ctx context.Context, resourceGroupName string, vpnSiteName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vpnSiteName": autorest.Encode("path", vpnSiteName), + } + + const APIVersion = "2018-04-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites/{vpnSiteName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client VpnSitesClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client VpnSitesClient) GetResponder(resp *http.Response) (result VpnSite, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists all the VpnSites in a subscription. +func (client VpnSitesClient) List(ctx context.Context) (result ListVpnSitesResultPage, err error) { + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VpnSitesClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.lvsr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "network.VpnSitesClient", "List", resp, "Failure sending request") + return + } + + result.lvsr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VpnSitesClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client VpnSitesClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-04-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/vpnSites", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client VpnSitesClient) ListSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client VpnSitesClient) ListResponder(resp *http.Response) (result ListVpnSitesResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client VpnSitesClient) listNextResults(lastResults ListVpnSitesResult) (result ListVpnSitesResult, err error) { + req, err := lastResults.listVpnSitesResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "network.VpnSitesClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "network.VpnSitesClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VpnSitesClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client VpnSitesClient) ListComplete(ctx context.Context) (result ListVpnSitesResultIterator, err error) { + result.page, err = client.List(ctx) + return +} + +// ListByResourceGroup lists all the vpnSites in a resource group. +// Parameters: +// resourceGroupName - the resource group name of the VpnSite. +func (client VpnSitesClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result ListVpnSitesResultPage, err error) { + result.fn = client.listByResourceGroupNextResults + req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VpnSitesClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.lvsr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "network.VpnSitesClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result.lvsr, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VpnSitesClient", "ListByResourceGroup", resp, "Failure responding to request") + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client VpnSitesClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-04-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the +// http.Response Body if it receives an error. +func (client VpnSitesClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always +// closes the http.Response Body. +func (client VpnSitesClient) ListByResourceGroupResponder(resp *http.Response) (result ListVpnSitesResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByResourceGroupNextResults retrieves the next set of results, if any. +func (client VpnSitesClient) listByResourceGroupNextResults(lastResults ListVpnSitesResult) (result ListVpnSitesResult, err error) { + req, err := lastResults.listVpnSitesResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "network.VpnSitesClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "network.VpnSitesClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VpnSitesClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client VpnSitesClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result ListVpnSitesResultIterator, err error) { + result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) + return +} + +// UpdateTags updates VpnSite tags. +// Parameters: +// resourceGroupName - the resource group name of the VpnSite. +// vpnSiteName - the name of the VpnSite being updated. +// vpnSiteParameters - parameters supplied to update VpnSite tags. +func (client VpnSitesClient) UpdateTags(ctx context.Context, resourceGroupName string, vpnSiteName string, vpnSiteParameters TagsObject) (result VpnSitesUpdateTagsFuture, err error) { + req, err := client.UpdateTagsPreparer(ctx, resourceGroupName, vpnSiteName, vpnSiteParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VpnSitesClient", "UpdateTags", nil, "Failure preparing request") + return + } + + result, err = client.UpdateTagsSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VpnSitesClient", "UpdateTags", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdateTagsPreparer prepares the UpdateTags request. +func (client VpnSitesClient) UpdateTagsPreparer(ctx context.Context, resourceGroupName string, vpnSiteName string, vpnSiteParameters TagsObject) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vpnSiteName": autorest.Encode("path", vpnSiteName), + } + + const APIVersion = "2018-04-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites/{vpnSiteName}", pathParameters), + autorest.WithJSON(vpnSiteParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateTagsSender sends the UpdateTags request. The method will close the +// http.Response Body if it receives an error. +func (client VpnSitesClient) UpdateTagsSender(req *http.Request) (future VpnSitesUpdateTagsFuture, err error) { + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// UpdateTagsResponder handles the response to the UpdateTags request. The method always +// closes the http.Response Body. +func (client VpnSitesClient) UpdateTagsResponder(resp *http.Response) (result VpnSite, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-04-01/network/vpnsitesconfiguration.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-04-01/network/vpnsitesconfiguration.go new file mode 100644 index 000000000..05a935570 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-04-01/network/vpnsitesconfiguration.go @@ -0,0 +1,113 @@ +package network + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "net/http" +) + +// VpnSitesConfigurationClient is the network Client +type VpnSitesConfigurationClient struct { + BaseClient +} + +// NewVpnSitesConfigurationClient creates an instance of the VpnSitesConfigurationClient client. +func NewVpnSitesConfigurationClient(subscriptionID string) VpnSitesConfigurationClient { + return NewVpnSitesConfigurationClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewVpnSitesConfigurationClientWithBaseURI creates an instance of the VpnSitesConfigurationClient client. +func NewVpnSitesConfigurationClientWithBaseURI(baseURI string, subscriptionID string) VpnSitesConfigurationClient { + return VpnSitesConfigurationClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Download gives the sas-url to download the configurations for vpn-sites in a resource group. +// Parameters: +// resourceGroupName - the resource group name. +// virtualWANName - the name of the VirtualWAN for which configuration of all vpn-sites is needed. +// request - parameters supplied to download vpn-sites configuration. +func (client VpnSitesConfigurationClient) Download(ctx context.Context, resourceGroupName string, virtualWANName string, request GetVpnSitesConfigurationRequest) (result VpnSitesConfigurationDownloadFuture, err error) { + req, err := client.DownloadPreparer(ctx, resourceGroupName, virtualWANName, request) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VpnSitesConfigurationClient", "Download", nil, "Failure preparing request") + return + } + + result, err = client.DownloadSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VpnSitesConfigurationClient", "Download", result.Response(), "Failure sending request") + return + } + + return +} + +// DownloadPreparer prepares the Download request. +func (client VpnSitesConfigurationClient) DownloadPreparer(ctx context.Context, resourceGroupName string, virtualWANName string, request GetVpnSitesConfigurationRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "virtualWANName": autorest.Encode("path", virtualWANName), + } + + const APIVersion = "2018-04-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{virtualWANName}/vpnConfiguration", pathParameters), + autorest.WithJSON(request), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DownloadSender sends the Download request. The method will close the +// http.Response Body if it receives an error. +func (client VpnSitesConfigurationClient) DownloadSender(req *http.Request) (future VpnSitesConfigurationDownloadFuture, err error) { + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// DownloadResponder handles the response to the Download request. The method always +// closes the http.Response Body. +func (client VpnSitesConfigurationClient) DownloadResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-05-01/network/applicationgateways.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-05-01/network/applicationgateways.go index 9a27f3644..003eee7a1 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-05-01/network/applicationgateways.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-05-01/network/applicationgateways.go @@ -129,7 +129,7 @@ func (client ApplicationGatewaysClient) CreateOrUpdate(ctx context.Context, reso {Target: "parameters.ApplicationGatewayPropertiesFormat.WebApplicationFirewallConfiguration.RuleSetType", Name: validation.Null, Rule: true, Chain: nil}, {Target: "parameters.ApplicationGatewayPropertiesFormat.WebApplicationFirewallConfiguration.RuleSetVersion", Name: validation.Null, Rule: true, Chain: nil}, {Target: "parameters.ApplicationGatewayPropertiesFormat.WebApplicationFirewallConfiguration.MaxRequestBodySize", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.ApplicationGatewayPropertiesFormat.WebApplicationFirewallConfiguration.MaxRequestBodySize", Name: validation.InclusiveMaximum, Rule: 128, Chain: nil}, + Chain: []validation.Constraint{{Target: "parameters.ApplicationGatewayPropertiesFormat.WebApplicationFirewallConfiguration.MaxRequestBodySize", Name: validation.InclusiveMaximum, Rule: int64(128), Chain: nil}, {Target: "parameters.ApplicationGatewayPropertiesFormat.WebApplicationFirewallConfiguration.MaxRequestBodySize", Name: validation.InclusiveMinimum, Rule: 8, Chain: nil}, }}, }}, diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-05-01/network/expressroutecircuitpeerings.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-05-01/network/expressroutecircuitpeerings.go index c373161e0..7de5b1a38 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-05-01/network/expressroutecircuitpeerings.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-05-01/network/expressroutecircuitpeerings.go @@ -51,7 +51,7 @@ func (client ExpressRouteCircuitPeeringsClient) CreateOrUpdate(ctx context.Conte {TargetValue: peeringParameters, Constraints: []validation.Constraint{{Target: "peeringParameters.ExpressRouteCircuitPeeringPropertiesFormat", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "peeringParameters.ExpressRouteCircuitPeeringPropertiesFormat.PeerASN", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "peeringParameters.ExpressRouteCircuitPeeringPropertiesFormat.PeerASN", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "peeringParameters.ExpressRouteCircuitPeeringPropertiesFormat.PeerASN", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "peeringParameters.ExpressRouteCircuitPeeringPropertiesFormat.PeerASN", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}, }}}}}); err != nil { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-05-01/network/expressroutecrossconnectionpeerings.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-05-01/network/expressroutecrossconnectionpeerings.go index 822da3e66..7b578e6bb 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-05-01/network/expressroutecrossconnectionpeerings.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-05-01/network/expressroutecrossconnectionpeerings.go @@ -54,7 +54,7 @@ func (client ExpressRouteCrossConnectionPeeringsClient) CreateOrUpdate(ctx conte {TargetValue: peeringParameters, Constraints: []validation.Constraint{{Target: "peeringParameters.ExpressRouteCrossConnectionPeeringProperties", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "peeringParameters.ExpressRouteCrossConnectionPeeringProperties.PeerASN", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "peeringParameters.ExpressRouteCrossConnectionPeeringProperties.PeerASN", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "peeringParameters.ExpressRouteCrossConnectionPeeringProperties.PeerASN", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "peeringParameters.ExpressRouteCrossConnectionPeeringProperties.PeerASN", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}, }}}}}); err != nil { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-05-01/network/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-05-01/network/models.go index 5af210af2..dae30be02 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-05-01/network/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-05-01/network/models.go @@ -1021,13 +1021,15 @@ type ProbeProtocol string const ( // ProbeProtocolHTTP ... ProbeProtocolHTTP ProbeProtocol = "Http" + // ProbeProtocolHTTPS ... + ProbeProtocolHTTPS ProbeProtocol = "Https" // ProbeProtocolTCP ... ProbeProtocolTCP ProbeProtocol = "Tcp" ) // PossibleProbeProtocolValues returns an array of possible values for the ProbeProtocol const type. func PossibleProbeProtocolValues() []ProbeProtocol { - return []ProbeProtocol{ProbeProtocolHTTP, ProbeProtocolTCP} + return []ProbeProtocol{ProbeProtocolHTTP, ProbeProtocolHTTPS, ProbeProtocolTCP} } // ProcessorArchitecture enumerates the values for processor architecture. @@ -11340,7 +11342,7 @@ func (p *Probe) UnmarshalJSON(body []byte) error { type ProbePropertiesFormat struct { // LoadBalancingRules - The load balancer rules that use this probe. LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` - // Protocol - The protocol of the end point. Possible values are: 'Http' or 'Tcp'. If 'Tcp' is specified, a received ACK is required for the probe to be successful. If 'Http' is specified, a 200 OK response from the specifies URI is required for the probe to be successful. Possible values include: 'ProbeProtocolHTTP', 'ProbeProtocolTCP' + // Protocol - The protocol of the end point. Possible values are: 'Http', 'Tcp' or 'Https'. If 'Tcp' is specified, a received ACK is required for the probe to be successful. If 'Http' or 'Https' is specified, a 200 OK response from the specifies URI is required for the probe to be successful. Possible values include: 'ProbeProtocolHTTP', 'ProbeProtocolTCP', 'ProbeProtocolHTTPS' Protocol ProbeProtocol `json:"protocol,omitempty"` // Port - The port for communicating the probe. Possible values range from 1 to 65535, inclusive. Port *int32 `json:"port,omitempty"` diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-05-01/network/virtualnetworkgatewayconnections.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-05-01/network/virtualnetworkgatewayconnections.go index b9cebc6ef..a81142789 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-05-01/network/virtualnetworkgatewayconnections.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-05-01/network/virtualnetworkgatewayconnections.go @@ -439,7 +439,7 @@ func (client VirtualNetworkGatewayConnectionsClient) ResetSharedKey(ctx context. if err := validation.Validate([]validation.Validation{ {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.KeyLength", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.KeyLength", Name: validation.InclusiveMaximum, Rule: 128, Chain: nil}, + Chain: []validation.Constraint{{Target: "parameters.KeyLength", Name: validation.InclusiveMaximum, Rule: int64(128), Chain: nil}, {Target: "parameters.KeyLength", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("network.VirtualNetworkGatewayConnectionsClient", "ResetSharedKey", err.Error()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/notificationhubs/mgmt/2017-04-01/notificationhubs/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/notificationhubs/mgmt/2017-04-01/notificationhubs/models.go index 06e9cbb75..82520f63c 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/notificationhubs/mgmt/2017-04-01/notificationhubs/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/notificationhubs/mgmt/2017-04-01/notificationhubs/models.go @@ -447,6 +447,140 @@ func (coup *CreateOrUpdateParameters) UnmarshalJSON(body []byte) error { return nil } +// DebugSendResponse description of a NotificationHub Resource. +type DebugSendResponse struct { + autorest.Response `json:"-"` + // DebugSendResult - Properties of the NotificationHub. + *DebugSendResult `json:"properties,omitempty"` + // ID - Resource Id + ID *string `json:"id,omitempty"` + // Name - Resource name + Name *string `json:"name,omitempty"` + // Type - Resource type + Type *string `json:"type,omitempty"` + // Location - Resource location + Location *string `json:"location,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` + // Sku - The sku of the created namespace + Sku *Sku `json:"sku,omitempty"` +} + +// MarshalJSON is the custom marshaler for DebugSendResponse. +func (dsr DebugSendResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dsr.DebugSendResult != nil { + objectMap["properties"] = dsr.DebugSendResult + } + if dsr.ID != nil { + objectMap["id"] = dsr.ID + } + if dsr.Name != nil { + objectMap["name"] = dsr.Name + } + if dsr.Type != nil { + objectMap["type"] = dsr.Type + } + if dsr.Location != nil { + objectMap["location"] = dsr.Location + } + if dsr.Tags != nil { + objectMap["tags"] = dsr.Tags + } + if dsr.Sku != nil { + objectMap["sku"] = dsr.Sku + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for DebugSendResponse struct. +func (dsr *DebugSendResponse) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var debugSendResult DebugSendResult + err = json.Unmarshal(*v, &debugSendResult) + if err != nil { + return err + } + dsr.DebugSendResult = &debugSendResult + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + dsr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + dsr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + dsr.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + dsr.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + dsr.Tags = tags + } + case "sku": + if v != nil { + var sku Sku + err = json.Unmarshal(*v, &sku) + if err != nil { + return err + } + dsr.Sku = &sku + } + } + } + + return nil +} + +// DebugSendResult ... +type DebugSendResult struct { + // Success - successful send + Success *float64 `json:"success,omitempty"` + // Failure - send failure + Failure *float64 `json:"failure,omitempty"` + // Results - actual failure description + Results interface{} `json:"results,omitempty"` +} + // ErrorResponse error reponse indicates NotificationHubs service is not able to process the incoming request. The // reason is provided in the error message. type ErrorResponse struct { @@ -1198,6 +1332,129 @@ func (page OperationListResultPage) Values() []Operation { return *page.olr.Value } +// PatchParameters parameters supplied to the patch NotificationHub operation. +type PatchParameters struct { + // Properties - Properties of the NotificationHub. + *Properties `json:"properties,omitempty"` + // ID - Resource Id + ID *string `json:"id,omitempty"` + // Name - Resource name + Name *string `json:"name,omitempty"` + // Type - Resource type + Type *string `json:"type,omitempty"` + // Location - Resource location + Location *string `json:"location,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` + // Sku - The sku of the created namespace + Sku *Sku `json:"sku,omitempty"` +} + +// MarshalJSON is the custom marshaler for PatchParameters. +func (pp PatchParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pp.Properties != nil { + objectMap["properties"] = pp.Properties + } + if pp.ID != nil { + objectMap["id"] = pp.ID + } + if pp.Name != nil { + objectMap["name"] = pp.Name + } + if pp.Type != nil { + objectMap["type"] = pp.Type + } + if pp.Location != nil { + objectMap["location"] = pp.Location + } + if pp.Tags != nil { + objectMap["tags"] = pp.Tags + } + if pp.Sku != nil { + objectMap["sku"] = pp.Sku + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for PatchParameters struct. +func (pp *PatchParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var properties Properties + err = json.Unmarshal(*v, &properties) + if err != nil { + return err + } + pp.Properties = &properties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + pp.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + pp.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + pp.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + pp.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + pp.Tags = tags + } + case "sku": + if v != nil { + var sku Sku + err = json.Unmarshal(*v, &sku) + if err != nil { + return err + } + pp.Sku = &sku + } + } + } + + return nil +} + // PnsCredentialsProperties description of a NotificationHub PNS Credentials. type PnsCredentialsProperties struct { // ApnsCredential - The ApnsCredential of the created NotificationHub diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/notificationhubs/mgmt/2017-04-01/notificationhubs/namespaces.go b/vendor/github.com/Azure/azure-sdk-for-go/services/notificationhubs/mgmt/2017-04-01/notificationhubs/namespaces.go index c14964081..e7362a7a0 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/notificationhubs/mgmt/2017-04-01/notificationhubs/namespaces.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/notificationhubs/mgmt/2017-04-01/notificationhubs/namespaces.go @@ -47,8 +47,7 @@ func NewNamespacesClientWithBaseURI(baseURI string, subscriptionID string) Names func (client NamespacesClient) CheckAvailability(ctx context.Context, parameters CheckAvailabilityParameters) (result CheckAvailabilityResult, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.Name", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.Location", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "parameters.Name", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { return result, validation.NewError("notificationhubs.NamespacesClient", "CheckAvailability", err.Error()) } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/notificationhubs/mgmt/2017-04-01/notificationhubs/notificationhubs.go b/vendor/github.com/Azure/azure-sdk-for-go/services/notificationhubs/mgmt/2017-04-01/notificationhubs/notificationhubs.go index 736636e46..29e1e678b 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/notificationhubs/mgmt/2017-04-01/notificationhubs/notificationhubs.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/notificationhubs/mgmt/2017-04-01/notificationhubs/notificationhubs.go @@ -48,8 +48,7 @@ func NewClientWithBaseURI(baseURI string, subscriptionID string) Client { func (client Client) CheckNotificationHubAvailability(ctx context.Context, resourceGroupName string, namespaceName string, parameters CheckAvailabilityParameters) (result CheckAvailabilityResult, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.Name", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.Location", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "parameters.Name", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { return result, validation.NewError("notificationhubs.Client", "CheckNotificationHubAvailability", err.Error()) } @@ -275,6 +274,81 @@ func (client Client) CreateOrUpdateAuthorizationRuleResponder(resp *http.Respons return } +// DebugSend test send a push notification +// Parameters: +// resourceGroupName - the name of the resource group. +// namespaceName - the namespace name. +// notificationHubName - the notification hub name. +// parameters - debug send parameters +func (client Client) DebugSend(ctx context.Context, resourceGroupName string, namespaceName string, notificationHubName string, parameters *interface{}) (result DebugSendResponse, err error) { + req, err := client.DebugSendPreparer(ctx, resourceGroupName, namespaceName, notificationHubName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "notificationhubs.Client", "DebugSend", nil, "Failure preparing request") + return + } + + resp, err := client.DebugSendSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "notificationhubs.Client", "DebugSend", resp, "Failure sending request") + return + } + + result, err = client.DebugSendResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "notificationhubs.Client", "DebugSend", resp, "Failure responding to request") + } + + return +} + +// DebugSendPreparer prepares the DebugSend request. +func (client Client) DebugSendPreparer(ctx context.Context, resourceGroupName string, namespaceName string, notificationHubName string, parameters *interface{}) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "namespaceName": autorest.Encode("path", namespaceName), + "notificationHubName": autorest.Encode("path", notificationHubName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-04-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/debugsend", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if parameters != nil { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithJSON(parameters)) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DebugSendSender sends the DebugSend request. The method will close the +// http.Response Body if it receives an error. +func (client Client) DebugSendSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// DebugSendResponder handles the response to the DebugSend request. The method always +// closes the http.Response Body. +func (client Client) DebugSendResponder(resp *http.Response) (result DebugSendResponse, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + // Delete deletes a notification hub associated with a namespace. // Parameters: // resourceGroupName - the name of the resource group. @@ -885,6 +959,81 @@ func (client Client) ListKeysResponder(resp *http.Response) (result ResourceList return } +// Patch patch a NotificationHub in a namespace. +// Parameters: +// resourceGroupName - the name of the resource group. +// namespaceName - the namespace name. +// notificationHubName - the notification hub name. +// parameters - parameters supplied to patch a NotificationHub Resource. +func (client Client) Patch(ctx context.Context, resourceGroupName string, namespaceName string, notificationHubName string, parameters *PatchParameters) (result ResourceType, err error) { + req, err := client.PatchPreparer(ctx, resourceGroupName, namespaceName, notificationHubName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "notificationhubs.Client", "Patch", nil, "Failure preparing request") + return + } + + resp, err := client.PatchSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "notificationhubs.Client", "Patch", resp, "Failure sending request") + return + } + + result, err = client.PatchResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "notificationhubs.Client", "Patch", resp, "Failure responding to request") + } + + return +} + +// PatchPreparer prepares the Patch request. +func (client Client) PatchPreparer(ctx context.Context, resourceGroupName string, namespaceName string, notificationHubName string, parameters *PatchParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "namespaceName": autorest.Encode("path", namespaceName), + "notificationHubName": autorest.Encode("path", notificationHubName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-04-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if parameters != nil { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithJSON(parameters)) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// PatchSender sends the Patch request. The method will close the +// http.Response Body if it receives an error. +func (client Client) PatchSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// PatchResponder handles the response to the Patch request. The method always +// closes the http.Response Body. +func (client Client) PatchResponder(resp *http.Response) (result ResourceType, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + // RegenerateKeys regenerates the Primary/Secondary Keys to the NotificationHub Authorization Rule // Parameters: // resourceGroupName - the name of the resource group. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/operationalinsights/mgmt/2015-03-20/operationalinsights/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/operationalinsights/mgmt/2015-03-20/operationalinsights/models.go index cc5236d55..c2ea9fe0d 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/operationalinsights/mgmt/2015-03-20/operationalinsights/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/operationalinsights/mgmt/2015-03-20/operationalinsights/models.go @@ -31,9 +31,9 @@ type PurgeState string const ( // Completed ... - Completed PurgeState = "Completed" + Completed PurgeState = "completed" // Pending ... - Pending PurgeState = "Pending" + Pending PurgeState = "pending" ) // PossiblePurgeStateValues returns an array of possible values for the PurgeState const type. @@ -430,12 +430,6 @@ type SearchSort struct { Order SearchSortEnum `json:"order,omitempty"` } -// SetObject ... -type SetObject struct { - autorest.Response `json:"-"` - Value interface{} `json:"value,omitempty"` -} - // StorageAccount describes a storage account connection. type StorageAccount struct { // ID - The Azure Resource Manager ID of the storage account resource. @@ -704,12 +698,14 @@ type WorkspacePurgeBodyFilters struct { // WorkspacePurgeResponse response containing operationId for a specific purge action. type WorkspacePurgeResponse struct { + autorest.Response `json:"-"` // OperationID - Id to use when querying for status for a particular purge operation. OperationID *string `json:"operationId,omitempty"` } // WorkspacePurgeStatusResponse response containing status for a specific purge operation. type WorkspacePurgeStatusResponse struct { + autorest.Response `json:"-"` // Status - Status of the operation represented by the requested Id. Possible values include: 'Pending', 'Completed' Status PurgeState `json:"status,omitempty"` } @@ -742,31 +738,3 @@ func (future *WorkspacesGetSearchResultsFuture) Result(client WorkspacesClient) } return } - -// WorkspacesPurgeFuture an abstraction for monitoring and retrieving the results of a long-running operation. -type WorkspacesPurgeFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *WorkspacesPurgeFuture) Result(client WorkspacesClient) (so SetObject, err error) { - var done bool - done, err = future.Done(client) - if err != nil { - err = autorest.NewErrorWithError(err, "operationalinsights.WorkspacesPurgeFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("operationalinsights.WorkspacesPurgeFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if so.Response.Response, err = future.GetResult(sender); err == nil && so.Response.Response.StatusCode != http.StatusNoContent { - so, err = client.PurgeResponder(so.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "operationalinsights.WorkspacesPurgeFuture", "Result", so.Response.Response, "Failure responding to request") - } - } - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/operationalinsights/mgmt/2015-03-20/operationalinsights/savedsearches.go b/vendor/github.com/Azure/azure-sdk-for-go/services/operationalinsights/mgmt/2015-03-20/operationalinsights/savedsearches.go index 333d14dc5..4a8581178 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/operationalinsights/mgmt/2015-03-20/operationalinsights/savedsearches.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/operationalinsights/mgmt/2015-03-20/operationalinsights/savedsearches.go @@ -58,7 +58,7 @@ func (client SavedSearchesClient) CreateOrUpdate(ctx context.Context, resourceGr {Target: "parameters.SavedSearchProperties.DisplayName", Name: validation.Null, Rule: true, Chain: nil}, {Target: "parameters.SavedSearchProperties.Query", Name: validation.Null, Rule: true, Chain: nil}, {Target: "parameters.SavedSearchProperties.Version", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.SavedSearchProperties.Version", Name: validation.InclusiveMaximum, Rule: 1, Chain: nil}, + Chain: []validation.Constraint{{Target: "parameters.SavedSearchProperties.Version", Name: validation.InclusiveMaximum, Rule: int64(1), Chain: nil}, {Target: "parameters.SavedSearchProperties.Version", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}, }}}}}); err != nil { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/operationalinsights/mgmt/2015-03-20/operationalinsights/workspaces.go b/vendor/github.com/Azure/azure-sdk-for-go/services/operationalinsights/mgmt/2015-03-20/operationalinsights/workspaces.go index e0a97bde4..6344b140f 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/operationalinsights/mgmt/2015-03-20/operationalinsights/workspaces.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/operationalinsights/mgmt/2015-03-20/operationalinsights/workspaces.go @@ -40,6 +40,82 @@ func NewWorkspacesClientWithBaseURI(baseURI string, subscriptionID string, purge return WorkspacesClient{NewWithBaseURI(baseURI, subscriptionID, purgeID)} } +// GetPurgeStatus gets status of an ongoing purge operation. +// Parameters: +// resourceGroupName - the name of the resource group to get. The name is case insensitive. +// workspaceName - log Analytics workspace name +func (client WorkspacesClient) GetPurgeStatus(ctx context.Context, resourceGroupName string, workspaceName string) (result WorkspacePurgeStatusResponse, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("operationalinsights.WorkspacesClient", "GetPurgeStatus", err.Error()) + } + + req, err := client.GetPurgeStatusPreparer(ctx, resourceGroupName, workspaceName) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.WorkspacesClient", "GetPurgeStatus", nil, "Failure preparing request") + return + } + + resp, err := client.GetPurgeStatusSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "operationalinsights.WorkspacesClient", "GetPurgeStatus", resp, "Failure sending request") + return + } + + result, err = client.GetPurgeStatusResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.WorkspacesClient", "GetPurgeStatus", resp, "Failure responding to request") + } + + return +} + +// GetPurgeStatusPreparer prepares the GetPurgeStatus request. +func (client WorkspacesClient) GetPurgeStatusPreparer(ctx context.Context, resourceGroupName string, workspaceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "purgeId": autorest.Encode("path", client.PurgeID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2015-03-20" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/operations/{purgeId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetPurgeStatusSender sends the GetPurgeStatus request. The method will close the +// http.Response Body if it receives an error. +func (client WorkspacesClient) GetPurgeStatusSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetPurgeStatusResponder handles the response to the GetPurgeStatus request. The method always +// closes the http.Response Body. +func (client WorkspacesClient) GetPurgeStatusResponder(resp *http.Response) (result WorkspacePurgeStatusResponse, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + // GetSchema gets the schema for a given workspace. // Parameters: // resourceGroupName - the name of the resource group to get. The name is case insensitive. @@ -269,7 +345,7 @@ func (client WorkspacesClient) ListLinkTargetsResponder(resp *http.Response) (re // resourceGroupName - the name of the resource group to get. The name is case insensitive. // workspaceName - log Analytics workspace name // body - describes the body of a request to purge data in a single table of an Log Analytics Workspace -func (client WorkspacesClient) Purge(ctx context.Context, resourceGroupName string, workspaceName string, body WorkspacePurgeBody) (result WorkspacesPurgeFuture, err error) { +func (client WorkspacesClient) Purge(ctx context.Context, resourceGroupName string, workspaceName string, body WorkspacePurgeBody) (result WorkspacePurgeResponse, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, @@ -287,12 +363,18 @@ func (client WorkspacesClient) Purge(ctx context.Context, resourceGroupName stri return } - result, err = client.PurgeSender(req) + resp, err := client.PurgeSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "operationalinsights.WorkspacesClient", "Purge", result.Response(), "Failure sending request") + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "operationalinsights.WorkspacesClient", "Purge", resp, "Failure sending request") return } + result, err = client.PurgeResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.WorkspacesClient", "Purge", resp, "Failure responding to request") + } + return } @@ -321,24 +403,14 @@ func (client WorkspacesClient) PurgePreparer(ctx context.Context, resourceGroupN // PurgeSender sends the Purge request. The method will close the // http.Response Body if it receives an error. -func (client WorkspacesClient) PurgeSender(req *http.Request) (future WorkspacesPurgeFuture, err error) { - var resp *http.Response - resp, err = autorest.SendWithSender(client, req, +func (client WorkspacesClient) PurgeSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted)) - if err != nil { - return - } - future.Future, err = azure.NewFutureFromResponse(resp) - return } // PurgeResponder handles the response to the Purge request. The method always // closes the http.Response Body. -func (client WorkspacesClient) PurgeResponder(resp *http.Response) (result SetObject, err error) { +func (client WorkspacesClient) PurgeResponder(resp *http.Response) (result WorkspacePurgeResponse, err error) { err = autorest.Respond( resp, client.ByInspecting(), diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/operationalinsights/v1/operationalinsights/client.go b/vendor/github.com/Azure/azure-sdk-for-go/services/operationalinsights/v1/operationalinsights/client.go index 35c4c3389..d1a5699b7 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/operationalinsights/v1/operationalinsights/client.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/operationalinsights/v1/operationalinsights/client.go @@ -1,6 +1,6 @@ // Package operationalinsights implements the Azure ARM Operationalinsights service API version v1. // -// Operational Insights Data Client +// Log Analytics Data Plane Client package operationalinsights // Copyright (c) Microsoft and contributors. All rights reserved. @@ -36,37 +36,36 @@ const ( // BaseClient is the base client for Operationalinsights. type BaseClient struct { autorest.Client - BaseURI string - WorkspaceID string + BaseURI string } // New creates an instance of the BaseClient client. -func New(workspaceID string) BaseClient { - return NewWithBaseURI(DefaultBaseURI, workspaceID) +func New() BaseClient { + return NewWithBaseURI(DefaultBaseURI) } // NewWithBaseURI creates an instance of the BaseClient client. -func NewWithBaseURI(baseURI string, workspaceID string) BaseClient { +func NewWithBaseURI(baseURI string) BaseClient { return BaseClient{ - Client: autorest.NewClientWithUserAgent(UserAgent()), - BaseURI: baseURI, - WorkspaceID: workspaceID, + Client: autorest.NewClientWithUserAgent(UserAgent()), + BaseURI: baseURI, } } -// Query executes an Analytics query for data. [Here](/documentation/2-Using-the-API/Query) is an example for using -// POST with an Analytics query. +// Query executes an Analytics query for data. [Here](https://dev.loganalytics.io/documentation/Using-the-API) is an +// example for using POST with an Analytics query. // Parameters: +// workspaceID - ID of the workspace. This is Workspace ID from the Properties blade in the Azure portal. // body - the Analytics query. Learn more about the [Analytics query // syntax](https://azure.microsoft.com/documentation/articles/app-insights-analytics-reference/) -func (client BaseClient) Query(ctx context.Context, body QueryBody) (result QueryResults, err error) { +func (client BaseClient) Query(ctx context.Context, workspaceID string, body QueryBody) (result QueryResults, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: body, Constraints: []validation.Constraint{{Target: "body.Query", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { return result, validation.NewError("operationalinsights.BaseClient", "Query", err.Error()) } - req, err := client.QueryPreparer(ctx, body) + req, err := client.QueryPreparer(ctx, workspaceID, body) if err != nil { err = autorest.NewErrorWithError(err, "operationalinsights.BaseClient", "Query", nil, "Failure preparing request") return @@ -88,9 +87,9 @@ func (client BaseClient) Query(ctx context.Context, body QueryBody) (result Quer } // QueryPreparer prepares the Query request. -func (client BaseClient) QueryPreparer(ctx context.Context, body QueryBody) (*http.Request, error) { +func (client BaseClient) QueryPreparer(ctx context.Context, workspaceID string, body QueryBody) (*http.Request, error) { pathParameters := map[string]interface{}{ - "workspaceId": autorest.Encode("path", client.WorkspaceID), + "workspaceId": autorest.Encode("path", workspaceID), } preparer := autorest.CreatePreparer( diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-01-01/apimanagement/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-01-01/apimanagement/models.go index 3c554d361..a30257e6d 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-01-01/apimanagement/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-01-01/apimanagement/models.go @@ -5692,7 +5692,7 @@ type OperationResultContract struct { // ResultInfo - Optional result info. ResultInfo *string `json:"resultInfo,omitempty"` // Error - Error Body Contract - Error *ErrorResponse `json:"error,omitempty"` + Error *ErrorResponseBody `json:"error,omitempty"` // ActionLog - This property if only provided as part of the TenantConfiguration_Validate operation. It contains the log the entities which will be updated/created/deleted as part of the TenantConfiguration_Deploy operation. ActionLog *[]OperationResultLogItemContract `json:"actionLog,omitempty"` } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-01-01/apimanagement/productapi.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-01-01/apimanagement/productapi.go index ac8974749..1a773b7d4 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-01-01/apimanagement/productapi.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-01-01/apimanagement/productapi.go @@ -45,7 +45,8 @@ func NewProductAPIClientWithBaseURI(baseURI string, subscriptionID string) Produ // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. // productID - product identifier. Must be unique in the current API Management service instance. -// apiid - API identifier. Must be unique in the current API Management service instance. +// apiid - API revision identifier. Must be unique in the current API Management service instance. Non-current +// revision has ;rev=n as a suffix where n is the revision number. func (client ProductAPIClient) CheckEntityExists(ctx context.Context, resourceGroupName string, serviceName string, productID string, apiid string) (result autorest.Response, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: serviceName, @@ -57,9 +58,9 @@ func (client ProductAPIClient) CheckEntityExists(ctx context.Context, resourceGr {Target: "productID", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "productID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, {TargetValue: apiid, - Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 80, Chain: nil}, + Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 256, Chain: nil}, {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "apiid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {Target: "apiid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.ProductAPIClient", "CheckEntityExists", err.Error()) } @@ -131,7 +132,8 @@ func (client ProductAPIClient) CheckEntityExistsResponder(resp *http.Response) ( // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. // productID - product identifier. Must be unique in the current API Management service instance. -// apiid - API identifier. Must be unique in the current API Management service instance. +// apiid - API revision identifier. Must be unique in the current API Management service instance. Non-current +// revision has ;rev=n as a suffix where n is the revision number. func (client ProductAPIClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, productID string, apiid string) (result APIContract, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: serviceName, @@ -143,9 +145,9 @@ func (client ProductAPIClient) CreateOrUpdate(ctx context.Context, resourceGroup {Target: "productID", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "productID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, {TargetValue: apiid, - Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 80, Chain: nil}, + Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 256, Chain: nil}, {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "apiid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {Target: "apiid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.ProductAPIClient", "CreateOrUpdate", err.Error()) } @@ -218,7 +220,8 @@ func (client ProductAPIClient) CreateOrUpdateResponder(resp *http.Response) (res // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. // productID - product identifier. Must be unique in the current API Management service instance. -// apiid - API identifier. Must be unique in the current API Management service instance. +// apiid - API revision identifier. Must be unique in the current API Management service instance. Non-current +// revision has ;rev=n as a suffix where n is the revision number. func (client ProductAPIClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, productID string, apiid string) (result autorest.Response, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: serviceName, @@ -230,9 +233,9 @@ func (client ProductAPIClient) Delete(ctx context.Context, resourceGroupName str {Target: "productID", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "productID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, {TargetValue: apiid, - Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 80, Chain: nil}, + Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 256, Chain: nil}, {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "apiid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {Target: "apiid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.ProductAPIClient", "Delete", err.Error()) } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/api.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/api.go new file mode 100644 index 000000000..be6c84fb5 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/api.go @@ -0,0 +1,732 @@ +package apimanagement + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// APIClient is the apiManagement Client +type APIClient struct { + BaseClient +} + +// NewAPIClient creates an instance of the APIClient client. +func NewAPIClient(subscriptionID string) APIClient { + return NewAPIClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewAPIClientWithBaseURI creates an instance of the APIClient client. +func NewAPIClientWithBaseURI(baseURI string, subscriptionID string) APIClient { + return APIClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates new or updates existing specified API of the API Management service instance. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// apiid - API revision identifier. Must be unique in the current API Management service instance. Non-current +// revision has ;rev=n as a suffix where n is the revision number. +// parameters - create or update parameters. +// ifMatch - eTag of the Entity. Not required when creating an entity, but required when updating an entity. +func (client APIClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, apiid string, parameters APICreateOrUpdateParameter, ifMatch string) (result APIContract, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: apiid, + Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "apiid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.APIClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serviceName, apiid, parameters, ifMatch) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.APIClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client APIClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, parameters APICreateOrUpdateParameter, ifMatch string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "apiId": autorest.Encode("path", apiid), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + if len(ifMatch) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client APIClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client APIClient) CreateOrUpdateResponder(resp *http.Response) (result APIContract, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes the specified API of the API Management service instance. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// apiid - API revision identifier. Must be unique in the current API Management service instance. Non-current +// revision has ;rev=n as a suffix where n is the revision number. +// ifMatch - eTag of the Entity. ETag should match the current entity state from the header response of the GET +// request or it should be * for unconditional update. +// deleteRevisions - delete all revisions of the Api. +func (client APIClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, apiid string, ifMatch string, deleteRevisions *bool) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: apiid, + Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "apiid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.APIClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, serviceName, apiid, ifMatch, deleteRevisions) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.APIClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client APIClient) DeletePreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, ifMatch string, deleteRevisions *bool) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "apiId": autorest.Encode("path", apiid), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if deleteRevisions != nil { + queryParameters["deleteRevisions"] = autorest.Encode("query", *deleteRevisions) + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}", pathParameters), + autorest.WithQueryParameters(queryParameters), + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client APIClient) DeleteSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client APIClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the details of the API specified by its identifier. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// apiid - API revision identifier. Must be unique in the current API Management service instance. Non-current +// revision has ;rev=n as a suffix where n is the revision number. +func (client APIClient) Get(ctx context.Context, resourceGroupName string, serviceName string, apiid string) (result APIContract, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: apiid, + Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "apiid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.APIClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, serviceName, apiid) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.APIClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client APIClient) GetPreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "apiId": autorest.Encode("path", apiid), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client APIClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client APIClient) GetResponder(resp *http.Response) (result APIContract, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetEntityTag gets the entity state (Etag) version of the API specified by its identifier. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// apiid - API revision identifier. Must be unique in the current API Management service instance. Non-current +// revision has ;rev=n as a suffix where n is the revision number. +func (client APIClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, apiid string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: apiid, + Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "apiid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.APIClient", "GetEntityTag", err.Error()) + } + + req, err := client.GetEntityTagPreparer(ctx, resourceGroupName, serviceName, apiid) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIClient", "GetEntityTag", nil, "Failure preparing request") + return + } + + resp, err := client.GetEntityTagSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.APIClient", "GetEntityTag", resp, "Failure sending request") + return + } + + result, err = client.GetEntityTagResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIClient", "GetEntityTag", resp, "Failure responding to request") + } + + return +} + +// GetEntityTagPreparer prepares the GetEntityTag request. +func (client APIClient) GetEntityTagPreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "apiId": autorest.Encode("path", apiid), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsHead(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetEntityTagSender sends the GetEntityTag request. The method will close the +// http.Response Body if it receives an error. +func (client APIClient) GetEntityTagSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetEntityTagResponder handles the response to the GetEntityTag request. The method always +// closes the http.Response Body. +func (client APIClient) GetEntityTagResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// ListByService lists all APIs of the API Management service instance. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// filter - | Field | Supported operators | Supported functions | +// |-------------|------------------------|-----------------------------------| +// | id | ge, le, eq, ne, gt, lt | substringof, startswith, endswith | +// | name | ge, le, eq, ne, gt, lt | substringof, startswith, endswith | +// | description | ge, le, eq, ne, gt, lt | substringof, startswith, endswith | +// | serviceUrl | ge, le, eq, ne, gt, lt | substringof, startswith, endswith | +// | path | ge, le, eq, ne, gt, lt | substringof, startswith, endswith | +// top - number of records to return. +// skip - number of records to skip. +// expandAPIVersionSet - include full ApiVersionSet resource in response +func (client APIClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32, expandAPIVersionSet *bool) (result APICollectionPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: top, + Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}}}, + {TargetValue: skip, + Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("apimanagement.APIClient", "ListByService", err.Error()) + } + + result.fn = client.listByServiceNextResults + req, err := client.ListByServicePreparer(ctx, resourceGroupName, serviceName, filter, top, skip, expandAPIVersionSet) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIClient", "ListByService", nil, "Failure preparing request") + return + } + + resp, err := client.ListByServiceSender(req) + if err != nil { + result.ac.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.APIClient", "ListByService", resp, "Failure sending request") + return + } + + result.ac, err = client.ListByServiceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIClient", "ListByService", resp, "Failure responding to request") + } + + return +} + +// ListByServicePreparer prepares the ListByService request. +func (client APIClient) ListByServicePreparer(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32, expandAPIVersionSet *bool) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + if skip != nil { + queryParameters["$skip"] = autorest.Encode("query", *skip) + } + if expandAPIVersionSet != nil { + queryParameters["expandApiVersionSet"] = autorest.Encode("query", *expandAPIVersionSet) + } else { + queryParameters["expandApiVersionSet"] = autorest.Encode("query", false) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByServiceSender sends the ListByService request. The method will close the +// http.Response Body if it receives an error. +func (client APIClient) ListByServiceSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByServiceResponder handles the response to the ListByService request. The method always +// closes the http.Response Body. +func (client APIClient) ListByServiceResponder(resp *http.Response) (result APICollection, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByServiceNextResults retrieves the next set of results, if any. +func (client APIClient) listByServiceNextResults(lastResults APICollection) (result APICollection, err error) { + req, err := lastResults.aPICollectionPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "apimanagement.APIClient", "listByServiceNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByServiceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "apimanagement.APIClient", "listByServiceNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByServiceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIClient", "listByServiceNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByServiceComplete enumerates all values, automatically crossing page boundaries as required. +func (client APIClient) ListByServiceComplete(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32, expandAPIVersionSet *bool) (result APICollectionIterator, err error) { + result.page, err = client.ListByService(ctx, resourceGroupName, serviceName, filter, top, skip, expandAPIVersionSet) + return +} + +// ListByTags lists a collection of apis associated with tags. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// filter - | Field | Supported operators | Supported functions | +// |-------------|------------------------|---------------------------------------------| +// | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// | aid | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// | apiRevision | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// | path | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// | description | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// | serviceUrl | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// | isCurrent | eq | substringof, contains, startswith, endswith | +// top - number of records to return. +// skip - number of records to skip. +func (client APIClient) ListByTags(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (result TagResourceCollectionPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: top, + Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}}}, + {TargetValue: skip, + Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("apimanagement.APIClient", "ListByTags", err.Error()) + } + + result.fn = client.listByTagsNextResults + req, err := client.ListByTagsPreparer(ctx, resourceGroupName, serviceName, filter, top, skip) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIClient", "ListByTags", nil, "Failure preparing request") + return + } + + resp, err := client.ListByTagsSender(req) + if err != nil { + result.trc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.APIClient", "ListByTags", resp, "Failure sending request") + return + } + + result.trc, err = client.ListByTagsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIClient", "ListByTags", resp, "Failure responding to request") + } + + return +} + +// ListByTagsPreparer prepares the ListByTags request. +func (client APIClient) ListByTagsPreparer(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + if skip != nil { + queryParameters["$skip"] = autorest.Encode("query", *skip) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apisByTags", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByTagsSender sends the ListByTags request. The method will close the +// http.Response Body if it receives an error. +func (client APIClient) ListByTagsSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByTagsResponder handles the response to the ListByTags request. The method always +// closes the http.Response Body. +func (client APIClient) ListByTagsResponder(resp *http.Response) (result TagResourceCollection, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByTagsNextResults retrieves the next set of results, if any. +func (client APIClient) listByTagsNextResults(lastResults TagResourceCollection) (result TagResourceCollection, err error) { + req, err := lastResults.tagResourceCollectionPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "apimanagement.APIClient", "listByTagsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByTagsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "apimanagement.APIClient", "listByTagsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByTagsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIClient", "listByTagsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByTagsComplete enumerates all values, automatically crossing page boundaries as required. +func (client APIClient) ListByTagsComplete(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (result TagResourceCollectionIterator, err error) { + result.page, err = client.ListByTags(ctx, resourceGroupName, serviceName, filter, top, skip) + return +} + +// Update updates the specified API of the API Management service instance. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// apiid - API revision identifier. Must be unique in the current API Management service instance. Non-current +// revision has ;rev=n as a suffix where n is the revision number. +// parameters - API Update Contract parameters. +// ifMatch - eTag of the Entity. ETag should match the current entity state from the header response of the GET +// request or it should be * for unconditional update. +func (client APIClient) Update(ctx context.Context, resourceGroupName string, serviceName string, apiid string, parameters APIUpdateContract, ifMatch string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: apiid, + Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "apiid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.APIClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, serviceName, apiid, parameters, ifMatch) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.APIClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client APIClient) UpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, parameters APIUpdateContract, ifMatch string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "apiId": autorest.Encode("path", apiid), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters), + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client APIClient) UpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client APIClient) UpdateResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/apidiagnostic.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/apidiagnostic.go new file mode 100644 index 000000000..ccd57cfc6 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/apidiagnostic.go @@ -0,0 +1,657 @@ +package apimanagement + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// APIDiagnosticClient is the apiManagement Client +type APIDiagnosticClient struct { + BaseClient +} + +// NewAPIDiagnosticClient creates an instance of the APIDiagnosticClient client. +func NewAPIDiagnosticClient(subscriptionID string) APIDiagnosticClient { + return NewAPIDiagnosticClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewAPIDiagnosticClientWithBaseURI creates an instance of the APIDiagnosticClient client. +func NewAPIDiagnosticClientWithBaseURI(baseURI string, subscriptionID string) APIDiagnosticClient { + return APIDiagnosticClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates a new Diagnostic for an API or updates an existing one. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// apiid - API identifier. Must be unique in the current API Management service instance. +// diagnosticID - diagnostic identifier. Must be unique in the current API Management service instance. +// parameters - create parameters. +// ifMatch - eTag of the Entity. Not required when creating an entity, but required when updating an entity. +func (client APIDiagnosticClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, apiid string, diagnosticID string, parameters DiagnosticContract, ifMatch string) (result DiagnosticContract, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: apiid, + Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "apiid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {TargetValue: diagnosticID, + Constraints: []validation.Constraint{{Target: "diagnosticID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "diagnosticID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "diagnosticID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.DiagnosticContractProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.DiagnosticContractProperties.LoggerID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.DiagnosticContractProperties.Sampling", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.DiagnosticContractProperties.Sampling.Percentage", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.DiagnosticContractProperties.Sampling.Percentage", Name: validation.InclusiveMaximum, Rule: int64(100), Chain: nil}, + {Target: "parameters.DiagnosticContractProperties.Sampling.Percentage", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, + }}, + }}, + {Target: "parameters.DiagnosticContractProperties.Frontend", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.DiagnosticContractProperties.Frontend.Request", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.DiagnosticContractProperties.Frontend.Request.Body", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.DiagnosticContractProperties.Frontend.Request.Body.Bytes", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.DiagnosticContractProperties.Frontend.Request.Body.Bytes", Name: validation.InclusiveMaximum, Rule: int64(8192), Chain: nil}}}, + }}, + }}, + {Target: "parameters.DiagnosticContractProperties.Frontend.Response", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.DiagnosticContractProperties.Frontend.Response.Body", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.DiagnosticContractProperties.Frontend.Response.Body.Bytes", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.DiagnosticContractProperties.Frontend.Response.Body.Bytes", Name: validation.InclusiveMaximum, Rule: int64(8192), Chain: nil}}}, + }}, + }}, + }}, + {Target: "parameters.DiagnosticContractProperties.Backend", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.DiagnosticContractProperties.Backend.Request", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.DiagnosticContractProperties.Backend.Request.Body", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.DiagnosticContractProperties.Backend.Request.Body.Bytes", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.DiagnosticContractProperties.Backend.Request.Body.Bytes", Name: validation.InclusiveMaximum, Rule: int64(8192), Chain: nil}}}, + }}, + }}, + {Target: "parameters.DiagnosticContractProperties.Backend.Response", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.DiagnosticContractProperties.Backend.Response.Body", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.DiagnosticContractProperties.Backend.Response.Body.Bytes", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.DiagnosticContractProperties.Backend.Response.Body.Bytes", Name: validation.InclusiveMaximum, Rule: int64(8192), Chain: nil}}}, + }}, + }}, + }}, + }}}}}); err != nil { + return result, validation.NewError("apimanagement.APIDiagnosticClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serviceName, apiid, diagnosticID, parameters, ifMatch) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIDiagnosticClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.APIDiagnosticClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIDiagnosticClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client APIDiagnosticClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, diagnosticID string, parameters DiagnosticContract, ifMatch string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "apiId": autorest.Encode("path", apiid), + "diagnosticId": autorest.Encode("path", diagnosticID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/diagnostics/{diagnosticId}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + if len(ifMatch) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client APIDiagnosticClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client APIDiagnosticClient) CreateOrUpdateResponder(resp *http.Response) (result DiagnosticContract, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes the specified Diagnostic from an API. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// apiid - API identifier. Must be unique in the current API Management service instance. +// diagnosticID - diagnostic identifier. Must be unique in the current API Management service instance. +// ifMatch - eTag of the Entity. ETag should match the current entity state from the header response of the GET +// request or it should be * for unconditional update. +func (client APIDiagnosticClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, apiid string, diagnosticID string, ifMatch string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: apiid, + Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "apiid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {TargetValue: diagnosticID, + Constraints: []validation.Constraint{{Target: "diagnosticID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "diagnosticID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "diagnosticID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.APIDiagnosticClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, serviceName, apiid, diagnosticID, ifMatch) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIDiagnosticClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.APIDiagnosticClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIDiagnosticClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client APIDiagnosticClient) DeletePreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, diagnosticID string, ifMatch string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "apiId": autorest.Encode("path", apiid), + "diagnosticId": autorest.Encode("path", diagnosticID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/diagnostics/{diagnosticId}", pathParameters), + autorest.WithQueryParameters(queryParameters), + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client APIDiagnosticClient) DeleteSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client APIDiagnosticClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the details of the Diagnostic for an API specified by its identifier. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// apiid - API identifier. Must be unique in the current API Management service instance. +// diagnosticID - diagnostic identifier. Must be unique in the current API Management service instance. +func (client APIDiagnosticClient) Get(ctx context.Context, resourceGroupName string, serviceName string, apiid string, diagnosticID string) (result DiagnosticContract, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: apiid, + Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "apiid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {TargetValue: diagnosticID, + Constraints: []validation.Constraint{{Target: "diagnosticID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "diagnosticID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "diagnosticID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.APIDiagnosticClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, serviceName, apiid, diagnosticID) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIDiagnosticClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.APIDiagnosticClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIDiagnosticClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client APIDiagnosticClient) GetPreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, diagnosticID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "apiId": autorest.Encode("path", apiid), + "diagnosticId": autorest.Encode("path", diagnosticID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/diagnostics/{diagnosticId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client APIDiagnosticClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client APIDiagnosticClient) GetResponder(resp *http.Response) (result DiagnosticContract, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetEntityTag gets the entity state (Etag) version of the Diagnostic for an API specified by its identifier. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// apiid - API identifier. Must be unique in the current API Management service instance. +// diagnosticID - diagnostic identifier. Must be unique in the current API Management service instance. +func (client APIDiagnosticClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, apiid string, diagnosticID string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: apiid, + Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "apiid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {TargetValue: diagnosticID, + Constraints: []validation.Constraint{{Target: "diagnosticID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "diagnosticID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "diagnosticID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.APIDiagnosticClient", "GetEntityTag", err.Error()) + } + + req, err := client.GetEntityTagPreparer(ctx, resourceGroupName, serviceName, apiid, diagnosticID) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIDiagnosticClient", "GetEntityTag", nil, "Failure preparing request") + return + } + + resp, err := client.GetEntityTagSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.APIDiagnosticClient", "GetEntityTag", resp, "Failure sending request") + return + } + + result, err = client.GetEntityTagResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIDiagnosticClient", "GetEntityTag", resp, "Failure responding to request") + } + + return +} + +// GetEntityTagPreparer prepares the GetEntityTag request. +func (client APIDiagnosticClient) GetEntityTagPreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, diagnosticID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "apiId": autorest.Encode("path", apiid), + "diagnosticId": autorest.Encode("path", diagnosticID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsHead(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/diagnostics/{diagnosticId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetEntityTagSender sends the GetEntityTag request. The method will close the +// http.Response Body if it receives an error. +func (client APIDiagnosticClient) GetEntityTagSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetEntityTagResponder handles the response to the GetEntityTag request. The method always +// closes the http.Response Body. +func (client APIDiagnosticClient) GetEntityTagResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// ListByService lists all diagnostics of an API. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// apiid - API identifier. Must be unique in the current API Management service instance. +// filter - | Field | Supported operators | Supported functions | +// |-------------|------------------------|-----------------------------------| +// | id | ge, le, eq, ne, gt, lt | substringof, startswith, endswith | +// top - number of records to return. +// skip - number of records to skip. +func (client APIDiagnosticClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, apiid string, filter string, top *int32, skip *int32) (result DiagnosticCollectionPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: apiid, + Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "apiid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {TargetValue: top, + Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}}}, + {TargetValue: skip, + Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("apimanagement.APIDiagnosticClient", "ListByService", err.Error()) + } + + result.fn = client.listByServiceNextResults + req, err := client.ListByServicePreparer(ctx, resourceGroupName, serviceName, apiid, filter, top, skip) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIDiagnosticClient", "ListByService", nil, "Failure preparing request") + return + } + + resp, err := client.ListByServiceSender(req) + if err != nil { + result.dc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.APIDiagnosticClient", "ListByService", resp, "Failure sending request") + return + } + + result.dc, err = client.ListByServiceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIDiagnosticClient", "ListByService", resp, "Failure responding to request") + } + + return +} + +// ListByServicePreparer prepares the ListByService request. +func (client APIDiagnosticClient) ListByServicePreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, filter string, top *int32, skip *int32) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "apiId": autorest.Encode("path", apiid), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + if skip != nil { + queryParameters["$skip"] = autorest.Encode("query", *skip) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/diagnostics", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByServiceSender sends the ListByService request. The method will close the +// http.Response Body if it receives an error. +func (client APIDiagnosticClient) ListByServiceSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByServiceResponder handles the response to the ListByService request. The method always +// closes the http.Response Body. +func (client APIDiagnosticClient) ListByServiceResponder(resp *http.Response) (result DiagnosticCollection, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByServiceNextResults retrieves the next set of results, if any. +func (client APIDiagnosticClient) listByServiceNextResults(lastResults DiagnosticCollection) (result DiagnosticCollection, err error) { + req, err := lastResults.diagnosticCollectionPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "apimanagement.APIDiagnosticClient", "listByServiceNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByServiceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "apimanagement.APIDiagnosticClient", "listByServiceNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByServiceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIDiagnosticClient", "listByServiceNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByServiceComplete enumerates all values, automatically crossing page boundaries as required. +func (client APIDiagnosticClient) ListByServiceComplete(ctx context.Context, resourceGroupName string, serviceName string, apiid string, filter string, top *int32, skip *int32) (result DiagnosticCollectionIterator, err error) { + result.page, err = client.ListByService(ctx, resourceGroupName, serviceName, apiid, filter, top, skip) + return +} + +// Update updates the details of the Diagnostic for an API specified by its identifier. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// apiid - API identifier. Must be unique in the current API Management service instance. +// diagnosticID - diagnostic identifier. Must be unique in the current API Management service instance. +// parameters - diagnostic Update parameters. +// ifMatch - eTag of the Entity. ETag should match the current entity state from the header response of the GET +// request or it should be * for unconditional update. +func (client APIDiagnosticClient) Update(ctx context.Context, resourceGroupName string, serviceName string, apiid string, diagnosticID string, parameters DiagnosticContract, ifMatch string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: apiid, + Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "apiid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {TargetValue: diagnosticID, + Constraints: []validation.Constraint{{Target: "diagnosticID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "diagnosticID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "diagnosticID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.APIDiagnosticClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, serviceName, apiid, diagnosticID, parameters, ifMatch) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIDiagnosticClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.APIDiagnosticClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIDiagnosticClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client APIDiagnosticClient) UpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, diagnosticID string, parameters DiagnosticContract, ifMatch string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "apiId": autorest.Encode("path", apiid), + "diagnosticId": autorest.Encode("path", diagnosticID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/diagnostics/{diagnosticId}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters), + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client APIDiagnosticClient) UpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client APIDiagnosticClient) UpdateResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/apiexport.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/apiexport.go new file mode 100644 index 000000000..526e07f9b --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/apiexport.go @@ -0,0 +1,128 @@ +package apimanagement + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// APIExportClient is the apiManagement Client +type APIExportClient struct { + BaseClient +} + +// NewAPIExportClient creates an instance of the APIExportClient client. +func NewAPIExportClient(subscriptionID string) APIExportClient { + return NewAPIExportClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewAPIExportClientWithBaseURI creates an instance of the APIExportClient client. +func NewAPIExportClientWithBaseURI(baseURI string, subscriptionID string) APIExportClient { + return APIExportClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get gets the details of the API specified by its identifier in the format specified to the Storage Blob with SAS Key +// valid for 5 minutes. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// apiid - API revision identifier. Must be unique in the current API Management service instance. Non-current +// revision has ;rev=n as a suffix where n is the revision number. +// formatParameter - format in which to export the Api Details to the Storage Blob with Sas Key valid for 5 +// minutes. +func (client APIExportClient) Get(ctx context.Context, resourceGroupName string, serviceName string, apiid string, formatParameter ExportFormat) (result APIExportResult, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: apiid, + Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "apiid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.APIExportClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, serviceName, apiid, formatParameter) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIExportClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.APIExportClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIExportClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client APIExportClient) GetPreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, formatParameter ExportFormat) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "apiId": autorest.Encode("path", apiid), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + "export": autorest.Encode("query", "true"), + "format": autorest.Encode("query", formatParameter), + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client APIExportClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client APIExportClient) GetResponder(resp *http.Response) (result APIExportResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/apiissue.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/apiissue.go new file mode 100644 index 000000000..cd258e265 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/apiissue.go @@ -0,0 +1,536 @@ +package apimanagement + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// APIIssueClient is the apiManagement Client +type APIIssueClient struct { + BaseClient +} + +// NewAPIIssueClient creates an instance of the APIIssueClient client. +func NewAPIIssueClient(subscriptionID string) APIIssueClient { + return NewAPIIssueClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewAPIIssueClientWithBaseURI creates an instance of the APIIssueClient client. +func NewAPIIssueClientWithBaseURI(baseURI string, subscriptionID string) APIIssueClient { + return APIIssueClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates a new Issue for an API or updates an existing one. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// apiid - API identifier. Must be unique in the current API Management service instance. +// issueID - issue identifier. Must be unique in the current API Management service instance. +// parameters - create parameters. +// ifMatch - eTag of the Issue Entity. ETag should match the current entity state from the header response of +// the GET request or it should be * for unconditional update. +func (client APIIssueClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, apiid string, issueID string, parameters IssueContract, ifMatch string) (result IssueContract, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: apiid, + Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "apiid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {TargetValue: issueID, + Constraints: []validation.Constraint{{Target: "issueID", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "issueID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "issueID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.IssueContractProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.IssueContractProperties.Title", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.IssueContractProperties.Description", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.IssueContractProperties.UserID", Name: validation.Null, Rule: true, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("apimanagement.APIIssueClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serviceName, apiid, issueID, parameters, ifMatch) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIIssueClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.APIIssueClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIIssueClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client APIIssueClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, issueID string, parameters IssueContract, ifMatch string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "apiId": autorest.Encode("path", apiid), + "issueId": autorest.Encode("path", issueID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + if len(ifMatch) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client APIIssueClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client APIIssueClient) CreateOrUpdateResponder(resp *http.Response) (result IssueContract, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes the specified Issue from an API. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// apiid - API identifier. Must be unique in the current API Management service instance. +// issueID - issue identifier. Must be unique in the current API Management service instance. +// ifMatch - eTag of the Issue Entity. ETag should match the current entity state from the header response of +// the GET request or it should be * for unconditional update. +func (client APIIssueClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, apiid string, issueID string, ifMatch string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: apiid, + Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "apiid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {TargetValue: issueID, + Constraints: []validation.Constraint{{Target: "issueID", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "issueID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "issueID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.APIIssueClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, serviceName, apiid, issueID, ifMatch) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIIssueClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.APIIssueClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIIssueClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client APIIssueClient) DeletePreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, issueID string, ifMatch string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "apiId": autorest.Encode("path", apiid), + "issueId": autorest.Encode("path", issueID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}", pathParameters), + autorest.WithQueryParameters(queryParameters), + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client APIIssueClient) DeleteSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client APIIssueClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the details of the Issue for an API specified by its identifier. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// apiid - API identifier. Must be unique in the current API Management service instance. +// issueID - issue identifier. Must be unique in the current API Management service instance. +func (client APIIssueClient) Get(ctx context.Context, resourceGroupName string, serviceName string, apiid string, issueID string) (result IssueContract, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: apiid, + Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "apiid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {TargetValue: issueID, + Constraints: []validation.Constraint{{Target: "issueID", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "issueID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "issueID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.APIIssueClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, serviceName, apiid, issueID) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIIssueClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.APIIssueClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIIssueClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client APIIssueClient) GetPreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, issueID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "apiId": autorest.Encode("path", apiid), + "issueId": autorest.Encode("path", issueID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client APIIssueClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client APIIssueClient) GetResponder(resp *http.Response) (result IssueContract, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetEntityTag gets the entity state (Etag) version of the Issue for an API specified by its identifier. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// apiid - API identifier. Must be unique in the current API Management service instance. +// issueID - issue identifier. Must be unique in the current API Management service instance. +func (client APIIssueClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, apiid string, issueID string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: apiid, + Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "apiid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {TargetValue: issueID, + Constraints: []validation.Constraint{{Target: "issueID", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "issueID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "issueID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.APIIssueClient", "GetEntityTag", err.Error()) + } + + req, err := client.GetEntityTagPreparer(ctx, resourceGroupName, serviceName, apiid, issueID) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIIssueClient", "GetEntityTag", nil, "Failure preparing request") + return + } + + resp, err := client.GetEntityTagSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.APIIssueClient", "GetEntityTag", resp, "Failure sending request") + return + } + + result, err = client.GetEntityTagResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIIssueClient", "GetEntityTag", resp, "Failure responding to request") + } + + return +} + +// GetEntityTagPreparer prepares the GetEntityTag request. +func (client APIIssueClient) GetEntityTagPreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, issueID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "apiId": autorest.Encode("path", apiid), + "issueId": autorest.Encode("path", issueID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsHead(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetEntityTagSender sends the GetEntityTag request. The method will close the +// http.Response Body if it receives an error. +func (client APIIssueClient) GetEntityTagSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetEntityTagResponder handles the response to the GetEntityTag request. The method always +// closes the http.Response Body. +func (client APIIssueClient) GetEntityTagResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// ListByService lists all issues assosiated with the specified API. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// apiid - API identifier. Must be unique in the current API Management service instance. +// filter - | Field | Supported operators | Supported functions | +// |-------------|------------------------|-----------------------------------| +// | id | ge, le, eq, ne, gt, lt | substringof, startswith, endswith | +// | state | eq | | +// | userId | ge, le, eq, ne, gt, lt | substringof, startswith, endswith | +// top - number of records to return. +// skip - number of records to skip. +func (client APIIssueClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, apiid string, filter string, top *int32, skip *int32) (result IssueCollectionPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: apiid, + Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "apiid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {TargetValue: top, + Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}}}, + {TargetValue: skip, + Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("apimanagement.APIIssueClient", "ListByService", err.Error()) + } + + result.fn = client.listByServiceNextResults + req, err := client.ListByServicePreparer(ctx, resourceGroupName, serviceName, apiid, filter, top, skip) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIIssueClient", "ListByService", nil, "Failure preparing request") + return + } + + resp, err := client.ListByServiceSender(req) + if err != nil { + result.ic.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.APIIssueClient", "ListByService", resp, "Failure sending request") + return + } + + result.ic, err = client.ListByServiceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIIssueClient", "ListByService", resp, "Failure responding to request") + } + + return +} + +// ListByServicePreparer prepares the ListByService request. +func (client APIIssueClient) ListByServicePreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, filter string, top *int32, skip *int32) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "apiId": autorest.Encode("path", apiid), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + if skip != nil { + queryParameters["$skip"] = autorest.Encode("query", *skip) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByServiceSender sends the ListByService request. The method will close the +// http.Response Body if it receives an error. +func (client APIIssueClient) ListByServiceSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByServiceResponder handles the response to the ListByService request. The method always +// closes the http.Response Body. +func (client APIIssueClient) ListByServiceResponder(resp *http.Response) (result IssueCollection, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByServiceNextResults retrieves the next set of results, if any. +func (client APIIssueClient) listByServiceNextResults(lastResults IssueCollection) (result IssueCollection, err error) { + req, err := lastResults.issueCollectionPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "apimanagement.APIIssueClient", "listByServiceNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByServiceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "apimanagement.APIIssueClient", "listByServiceNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByServiceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIIssueClient", "listByServiceNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByServiceComplete enumerates all values, automatically crossing page boundaries as required. +func (client APIIssueClient) ListByServiceComplete(ctx context.Context, resourceGroupName string, serviceName string, apiid string, filter string, top *int32, skip *int32) (result IssueCollectionIterator, err error) { + result.page, err = client.ListByService(ctx, resourceGroupName, serviceName, apiid, filter, top, skip) + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/apiissueattachment.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/apiissueattachment.go new file mode 100644 index 000000000..cbb5f1fa7 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/apiissueattachment.go @@ -0,0 +1,565 @@ +package apimanagement + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// APIIssueAttachmentClient is the apiManagement Client +type APIIssueAttachmentClient struct { + BaseClient +} + +// NewAPIIssueAttachmentClient creates an instance of the APIIssueAttachmentClient client. +func NewAPIIssueAttachmentClient(subscriptionID string) APIIssueAttachmentClient { + return NewAPIIssueAttachmentClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewAPIIssueAttachmentClientWithBaseURI creates an instance of the APIIssueAttachmentClient client. +func NewAPIIssueAttachmentClientWithBaseURI(baseURI string, subscriptionID string) APIIssueAttachmentClient { + return APIIssueAttachmentClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates a new Attachment for the Issue in an API or updates an existing one. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// apiid - API identifier. Must be unique in the current API Management service instance. +// issueID - issue identifier. Must be unique in the current API Management service instance. +// attachmentID - attachment identifier within an Issue. Must be unique in the current Issue. +// parameters - create parameters. +// ifMatch - eTag of the Issue Entity. ETag should match the current entity state from the header response of +// the GET request or it should be * for unconditional update. +func (client APIIssueAttachmentClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, apiid string, issueID string, attachmentID string, parameters IssueAttachmentContract, ifMatch string) (result IssueAttachmentContract, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: apiid, + Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "apiid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {TargetValue: issueID, + Constraints: []validation.Constraint{{Target: "issueID", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "issueID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "issueID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}, + {TargetValue: attachmentID, + Constraints: []validation.Constraint{{Target: "attachmentID", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "attachmentID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "attachmentID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.IssueAttachmentContractProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.IssueAttachmentContractProperties.Title", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.IssueAttachmentContractProperties.ContentFormat", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.IssueAttachmentContractProperties.Content", Name: validation.Null, Rule: true, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("apimanagement.APIIssueAttachmentClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serviceName, apiid, issueID, attachmentID, parameters, ifMatch) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIIssueAttachmentClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.APIIssueAttachmentClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIIssueAttachmentClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client APIIssueAttachmentClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, issueID string, attachmentID string, parameters IssueAttachmentContract, ifMatch string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "apiId": autorest.Encode("path", apiid), + "attachmentId": autorest.Encode("path", attachmentID), + "issueId": autorest.Encode("path", issueID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}/attachments/{attachmentId}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + if len(ifMatch) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client APIIssueAttachmentClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client APIIssueAttachmentClient) CreateOrUpdateResponder(resp *http.Response) (result IssueAttachmentContract, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes the specified comment from an Issue. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// apiid - API identifier. Must be unique in the current API Management service instance. +// issueID - issue identifier. Must be unique in the current API Management service instance. +// attachmentID - attachment identifier within an Issue. Must be unique in the current Issue. +// ifMatch - eTag of the Issue Entity. ETag should match the current entity state from the header response of +// the GET request or it should be * for unconditional update. +func (client APIIssueAttachmentClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, apiid string, issueID string, attachmentID string, ifMatch string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: apiid, + Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "apiid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {TargetValue: issueID, + Constraints: []validation.Constraint{{Target: "issueID", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "issueID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "issueID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}, + {TargetValue: attachmentID, + Constraints: []validation.Constraint{{Target: "attachmentID", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "attachmentID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "attachmentID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.APIIssueAttachmentClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, serviceName, apiid, issueID, attachmentID, ifMatch) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIIssueAttachmentClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.APIIssueAttachmentClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIIssueAttachmentClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client APIIssueAttachmentClient) DeletePreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, issueID string, attachmentID string, ifMatch string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "apiId": autorest.Encode("path", apiid), + "attachmentId": autorest.Encode("path", attachmentID), + "issueId": autorest.Encode("path", issueID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}/attachments/{attachmentId}", pathParameters), + autorest.WithQueryParameters(queryParameters), + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client APIIssueAttachmentClient) DeleteSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client APIIssueAttachmentClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the details of the issue Attachment for an API specified by its identifier. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// apiid - API identifier. Must be unique in the current API Management service instance. +// issueID - issue identifier. Must be unique in the current API Management service instance. +// attachmentID - attachment identifier within an Issue. Must be unique in the current Issue. +func (client APIIssueAttachmentClient) Get(ctx context.Context, resourceGroupName string, serviceName string, apiid string, issueID string, attachmentID string) (result IssueAttachmentContract, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: apiid, + Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "apiid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {TargetValue: issueID, + Constraints: []validation.Constraint{{Target: "issueID", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "issueID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "issueID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}, + {TargetValue: attachmentID, + Constraints: []validation.Constraint{{Target: "attachmentID", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "attachmentID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "attachmentID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.APIIssueAttachmentClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, serviceName, apiid, issueID, attachmentID) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIIssueAttachmentClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.APIIssueAttachmentClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIIssueAttachmentClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client APIIssueAttachmentClient) GetPreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, issueID string, attachmentID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "apiId": autorest.Encode("path", apiid), + "attachmentId": autorest.Encode("path", attachmentID), + "issueId": autorest.Encode("path", issueID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}/attachments/{attachmentId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client APIIssueAttachmentClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client APIIssueAttachmentClient) GetResponder(resp *http.Response) (result IssueAttachmentContract, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetEntityTag gets the entity state (Etag) version of the issue Attachment for an API specified by its identifier. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// apiid - API identifier. Must be unique in the current API Management service instance. +// issueID - issue identifier. Must be unique in the current API Management service instance. +// attachmentID - attachment identifier within an Issue. Must be unique in the current Issue. +func (client APIIssueAttachmentClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, apiid string, issueID string, attachmentID string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: apiid, + Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "apiid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {TargetValue: issueID, + Constraints: []validation.Constraint{{Target: "issueID", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "issueID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "issueID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}, + {TargetValue: attachmentID, + Constraints: []validation.Constraint{{Target: "attachmentID", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "attachmentID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "attachmentID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.APIIssueAttachmentClient", "GetEntityTag", err.Error()) + } + + req, err := client.GetEntityTagPreparer(ctx, resourceGroupName, serviceName, apiid, issueID, attachmentID) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIIssueAttachmentClient", "GetEntityTag", nil, "Failure preparing request") + return + } + + resp, err := client.GetEntityTagSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.APIIssueAttachmentClient", "GetEntityTag", resp, "Failure sending request") + return + } + + result, err = client.GetEntityTagResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIIssueAttachmentClient", "GetEntityTag", resp, "Failure responding to request") + } + + return +} + +// GetEntityTagPreparer prepares the GetEntityTag request. +func (client APIIssueAttachmentClient) GetEntityTagPreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, issueID string, attachmentID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "apiId": autorest.Encode("path", apiid), + "attachmentId": autorest.Encode("path", attachmentID), + "issueId": autorest.Encode("path", issueID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsHead(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}/attachments/{attachmentId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetEntityTagSender sends the GetEntityTag request. The method will close the +// http.Response Body if it receives an error. +func (client APIIssueAttachmentClient) GetEntityTagSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetEntityTagResponder handles the response to the GetEntityTag request. The method always +// closes the http.Response Body. +func (client APIIssueAttachmentClient) GetEntityTagResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// ListByService lists all comments for the Issue assosiated with the specified API. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// apiid - API identifier. Must be unique in the current API Management service instance. +// issueID - issue identifier. Must be unique in the current API Management service instance. +// filter - | Field | Supported operators | Supported functions | +// |-------------|------------------------|-----------------------------------| +// | id | ge, le, eq, ne, gt, lt | substringof, startswith, endswith | +// | userId | ge, le, eq, ne, gt, lt | substringof, startswith, endswith | +// top - number of records to return. +// skip - number of records to skip. +func (client APIIssueAttachmentClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, apiid string, issueID string, filter string, top *int32, skip *int32) (result IssueAttachmentCollectionPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: apiid, + Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "apiid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {TargetValue: issueID, + Constraints: []validation.Constraint{{Target: "issueID", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "issueID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "issueID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}, + {TargetValue: top, + Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}}}, + {TargetValue: skip, + Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("apimanagement.APIIssueAttachmentClient", "ListByService", err.Error()) + } + + result.fn = client.listByServiceNextResults + req, err := client.ListByServicePreparer(ctx, resourceGroupName, serviceName, apiid, issueID, filter, top, skip) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIIssueAttachmentClient", "ListByService", nil, "Failure preparing request") + return + } + + resp, err := client.ListByServiceSender(req) + if err != nil { + result.iac.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.APIIssueAttachmentClient", "ListByService", resp, "Failure sending request") + return + } + + result.iac, err = client.ListByServiceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIIssueAttachmentClient", "ListByService", resp, "Failure responding to request") + } + + return +} + +// ListByServicePreparer prepares the ListByService request. +func (client APIIssueAttachmentClient) ListByServicePreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, issueID string, filter string, top *int32, skip *int32) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "apiId": autorest.Encode("path", apiid), + "issueId": autorest.Encode("path", issueID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + if skip != nil { + queryParameters["$skip"] = autorest.Encode("query", *skip) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}/attachments", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByServiceSender sends the ListByService request. The method will close the +// http.Response Body if it receives an error. +func (client APIIssueAttachmentClient) ListByServiceSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByServiceResponder handles the response to the ListByService request. The method always +// closes the http.Response Body. +func (client APIIssueAttachmentClient) ListByServiceResponder(resp *http.Response) (result IssueAttachmentCollection, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByServiceNextResults retrieves the next set of results, if any. +func (client APIIssueAttachmentClient) listByServiceNextResults(lastResults IssueAttachmentCollection) (result IssueAttachmentCollection, err error) { + req, err := lastResults.issueAttachmentCollectionPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "apimanagement.APIIssueAttachmentClient", "listByServiceNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByServiceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "apimanagement.APIIssueAttachmentClient", "listByServiceNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByServiceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIIssueAttachmentClient", "listByServiceNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByServiceComplete enumerates all values, automatically crossing page boundaries as required. +func (client APIIssueAttachmentClient) ListByServiceComplete(ctx context.Context, resourceGroupName string, serviceName string, apiid string, issueID string, filter string, top *int32, skip *int32) (result IssueAttachmentCollectionIterator, err error) { + result.page, err = client.ListByService(ctx, resourceGroupName, serviceName, apiid, issueID, filter, top, skip) + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/apiissuecomment.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/apiissuecomment.go new file mode 100644 index 000000000..17798beb1 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/apiissuecomment.go @@ -0,0 +1,564 @@ +package apimanagement + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// APIIssueCommentClient is the apiManagement Client +type APIIssueCommentClient struct { + BaseClient +} + +// NewAPIIssueCommentClient creates an instance of the APIIssueCommentClient client. +func NewAPIIssueCommentClient(subscriptionID string) APIIssueCommentClient { + return NewAPIIssueCommentClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewAPIIssueCommentClientWithBaseURI creates an instance of the APIIssueCommentClient client. +func NewAPIIssueCommentClientWithBaseURI(baseURI string, subscriptionID string) APIIssueCommentClient { + return APIIssueCommentClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates a new Comment for the Issue in an API or updates an existing one. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// apiid - API identifier. Must be unique in the current API Management service instance. +// issueID - issue identifier. Must be unique in the current API Management service instance. +// commentID - comment identifier within an Issue. Must be unique in the current Issue. +// parameters - create parameters. +// ifMatch - eTag of the Issue Entity. ETag should match the current entity state from the header response of +// the GET request or it should be * for unconditional update. +func (client APIIssueCommentClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, apiid string, issueID string, commentID string, parameters IssueCommentContract, ifMatch string) (result IssueCommentContract, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: apiid, + Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "apiid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {TargetValue: issueID, + Constraints: []validation.Constraint{{Target: "issueID", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "issueID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "issueID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}, + {TargetValue: commentID, + Constraints: []validation.Constraint{{Target: "commentID", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "commentID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "commentID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.IssueCommentContractProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.IssueCommentContractProperties.Text", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.IssueCommentContractProperties.UserID", Name: validation.Null, Rule: true, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("apimanagement.APIIssueCommentClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serviceName, apiid, issueID, commentID, parameters, ifMatch) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIIssueCommentClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.APIIssueCommentClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIIssueCommentClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client APIIssueCommentClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, issueID string, commentID string, parameters IssueCommentContract, ifMatch string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "apiId": autorest.Encode("path", apiid), + "commentId": autorest.Encode("path", commentID), + "issueId": autorest.Encode("path", issueID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}/comments/{commentId}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + if len(ifMatch) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client APIIssueCommentClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client APIIssueCommentClient) CreateOrUpdateResponder(resp *http.Response) (result IssueCommentContract, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes the specified comment from an Issue. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// apiid - API identifier. Must be unique in the current API Management service instance. +// issueID - issue identifier. Must be unique in the current API Management service instance. +// commentID - comment identifier within an Issue. Must be unique in the current Issue. +// ifMatch - eTag of the Issue Entity. ETag should match the current entity state from the header response of +// the GET request or it should be * for unconditional update. +func (client APIIssueCommentClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, apiid string, issueID string, commentID string, ifMatch string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: apiid, + Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "apiid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {TargetValue: issueID, + Constraints: []validation.Constraint{{Target: "issueID", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "issueID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "issueID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}, + {TargetValue: commentID, + Constraints: []validation.Constraint{{Target: "commentID", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "commentID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "commentID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.APIIssueCommentClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, serviceName, apiid, issueID, commentID, ifMatch) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIIssueCommentClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.APIIssueCommentClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIIssueCommentClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client APIIssueCommentClient) DeletePreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, issueID string, commentID string, ifMatch string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "apiId": autorest.Encode("path", apiid), + "commentId": autorest.Encode("path", commentID), + "issueId": autorest.Encode("path", issueID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}/comments/{commentId}", pathParameters), + autorest.WithQueryParameters(queryParameters), + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client APIIssueCommentClient) DeleteSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client APIIssueCommentClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the details of the issue Comment for an API specified by its identifier. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// apiid - API identifier. Must be unique in the current API Management service instance. +// issueID - issue identifier. Must be unique in the current API Management service instance. +// commentID - comment identifier within an Issue. Must be unique in the current Issue. +func (client APIIssueCommentClient) Get(ctx context.Context, resourceGroupName string, serviceName string, apiid string, issueID string, commentID string) (result IssueCommentContract, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: apiid, + Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "apiid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {TargetValue: issueID, + Constraints: []validation.Constraint{{Target: "issueID", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "issueID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "issueID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}, + {TargetValue: commentID, + Constraints: []validation.Constraint{{Target: "commentID", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "commentID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "commentID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.APIIssueCommentClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, serviceName, apiid, issueID, commentID) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIIssueCommentClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.APIIssueCommentClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIIssueCommentClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client APIIssueCommentClient) GetPreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, issueID string, commentID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "apiId": autorest.Encode("path", apiid), + "commentId": autorest.Encode("path", commentID), + "issueId": autorest.Encode("path", issueID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}/comments/{commentId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client APIIssueCommentClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client APIIssueCommentClient) GetResponder(resp *http.Response) (result IssueCommentContract, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetEntityTag gets the entity state (Etag) version of the issue Comment for an API specified by its identifier. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// apiid - API identifier. Must be unique in the current API Management service instance. +// issueID - issue identifier. Must be unique in the current API Management service instance. +// commentID - comment identifier within an Issue. Must be unique in the current Issue. +func (client APIIssueCommentClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, apiid string, issueID string, commentID string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: apiid, + Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "apiid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {TargetValue: issueID, + Constraints: []validation.Constraint{{Target: "issueID", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "issueID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "issueID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}, + {TargetValue: commentID, + Constraints: []validation.Constraint{{Target: "commentID", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "commentID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "commentID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.APIIssueCommentClient", "GetEntityTag", err.Error()) + } + + req, err := client.GetEntityTagPreparer(ctx, resourceGroupName, serviceName, apiid, issueID, commentID) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIIssueCommentClient", "GetEntityTag", nil, "Failure preparing request") + return + } + + resp, err := client.GetEntityTagSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.APIIssueCommentClient", "GetEntityTag", resp, "Failure sending request") + return + } + + result, err = client.GetEntityTagResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIIssueCommentClient", "GetEntityTag", resp, "Failure responding to request") + } + + return +} + +// GetEntityTagPreparer prepares the GetEntityTag request. +func (client APIIssueCommentClient) GetEntityTagPreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, issueID string, commentID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "apiId": autorest.Encode("path", apiid), + "commentId": autorest.Encode("path", commentID), + "issueId": autorest.Encode("path", issueID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsHead(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}/comments/{commentId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetEntityTagSender sends the GetEntityTag request. The method will close the +// http.Response Body if it receives an error. +func (client APIIssueCommentClient) GetEntityTagSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetEntityTagResponder handles the response to the GetEntityTag request. The method always +// closes the http.Response Body. +func (client APIIssueCommentClient) GetEntityTagResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// ListByService lists all comments for the Issue assosiated with the specified API. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// apiid - API identifier. Must be unique in the current API Management service instance. +// issueID - issue identifier. Must be unique in the current API Management service instance. +// filter - | Field | Supported operators | Supported functions | +// |-------------|------------------------|-----------------------------------| +// | id | ge, le, eq, ne, gt, lt | substringof, startswith, endswith | +// | userId | ge, le, eq, ne, gt, lt | substringof, startswith, endswith | +// top - number of records to return. +// skip - number of records to skip. +func (client APIIssueCommentClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, apiid string, issueID string, filter string, top *int32, skip *int32) (result IssueCommentCollectionPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: apiid, + Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "apiid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {TargetValue: issueID, + Constraints: []validation.Constraint{{Target: "issueID", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "issueID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "issueID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}, + {TargetValue: top, + Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}}}, + {TargetValue: skip, + Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("apimanagement.APIIssueCommentClient", "ListByService", err.Error()) + } + + result.fn = client.listByServiceNextResults + req, err := client.ListByServicePreparer(ctx, resourceGroupName, serviceName, apiid, issueID, filter, top, skip) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIIssueCommentClient", "ListByService", nil, "Failure preparing request") + return + } + + resp, err := client.ListByServiceSender(req) + if err != nil { + result.icc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.APIIssueCommentClient", "ListByService", resp, "Failure sending request") + return + } + + result.icc, err = client.ListByServiceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIIssueCommentClient", "ListByService", resp, "Failure responding to request") + } + + return +} + +// ListByServicePreparer prepares the ListByService request. +func (client APIIssueCommentClient) ListByServicePreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, issueID string, filter string, top *int32, skip *int32) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "apiId": autorest.Encode("path", apiid), + "issueId": autorest.Encode("path", issueID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + if skip != nil { + queryParameters["$skip"] = autorest.Encode("query", *skip) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}/comments", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByServiceSender sends the ListByService request. The method will close the +// http.Response Body if it receives an error. +func (client APIIssueCommentClient) ListByServiceSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByServiceResponder handles the response to the ListByService request. The method always +// closes the http.Response Body. +func (client APIIssueCommentClient) ListByServiceResponder(resp *http.Response) (result IssueCommentCollection, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByServiceNextResults retrieves the next set of results, if any. +func (client APIIssueCommentClient) listByServiceNextResults(lastResults IssueCommentCollection) (result IssueCommentCollection, err error) { + req, err := lastResults.issueCommentCollectionPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "apimanagement.APIIssueCommentClient", "listByServiceNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByServiceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "apimanagement.APIIssueCommentClient", "listByServiceNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByServiceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIIssueCommentClient", "listByServiceNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByServiceComplete enumerates all values, automatically crossing page boundaries as required. +func (client APIIssueCommentClient) ListByServiceComplete(ctx context.Context, resourceGroupName string, serviceName string, apiid string, issueID string, filter string, top *int32, skip *int32) (result IssueCommentCollectionIterator, err error) { + result.page, err = client.ListByService(ctx, resourceGroupName, serviceName, apiid, issueID, filter, top, skip) + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/apioperation.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/apioperation.go new file mode 100644 index 000000000..ff402bd3b --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/apioperation.go @@ -0,0 +1,645 @@ +package apimanagement + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// APIOperationClient is the apiManagement Client +type APIOperationClient struct { + BaseClient +} + +// NewAPIOperationClient creates an instance of the APIOperationClient client. +func NewAPIOperationClient(subscriptionID string) APIOperationClient { + return NewAPIOperationClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewAPIOperationClientWithBaseURI creates an instance of the APIOperationClient client. +func NewAPIOperationClientWithBaseURI(baseURI string, subscriptionID string) APIOperationClient { + return APIOperationClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates a new operation in the API or updates an existing one. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// apiid - API revision identifier. Must be unique in the current API Management service instance. Non-current +// revision has ;rev=n as a suffix where n is the revision number. +// operationID - operation identifier within an API. Must be unique in the current API Management service +// instance. +// parameters - create parameters. +// ifMatch - eTag of the Entity. Not required when creating an entity, but required when updating an entity. +func (client APIOperationClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, apiid string, operationID string, parameters OperationContract, ifMatch string) (result OperationContract, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: apiid, + Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "apiid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}, + {TargetValue: operationID, + Constraints: []validation.Constraint{{Target: "operationID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "operationID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "operationID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.OperationContractProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.OperationContractProperties.DisplayName", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.OperationContractProperties.DisplayName", Name: validation.MaxLength, Rule: 300, Chain: nil}, + {Target: "parameters.OperationContractProperties.DisplayName", Name: validation.MinLength, Rule: 1, Chain: nil}, + }}, + {Target: "parameters.OperationContractProperties.Method", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.OperationContractProperties.URLTemplate", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.OperationContractProperties.URLTemplate", Name: validation.MaxLength, Rule: 1000, Chain: nil}, + {Target: "parameters.OperationContractProperties.URLTemplate", Name: validation.MinLength, Rule: 1, Chain: nil}, + }}, + }}}}}); err != nil { + return result, validation.NewError("apimanagement.APIOperationClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serviceName, apiid, operationID, parameters, ifMatch) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIOperationClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.APIOperationClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIOperationClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client APIOperationClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, operationID string, parameters OperationContract, ifMatch string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "apiId": autorest.Encode("path", apiid), + "operationId": autorest.Encode("path", operationID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + if len(ifMatch) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client APIOperationClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client APIOperationClient) CreateOrUpdateResponder(resp *http.Response) (result OperationContract, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes the specified operation in the API. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// apiid - API revision identifier. Must be unique in the current API Management service instance. Non-current +// revision has ;rev=n as a suffix where n is the revision number. +// operationID - operation identifier within an API. Must be unique in the current API Management service +// instance. +// ifMatch - eTag of the Entity. ETag should match the current entity state from the header response of the GET +// request or it should be * for unconditional update. +func (client APIOperationClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, apiid string, operationID string, ifMatch string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: apiid, + Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "apiid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}, + {TargetValue: operationID, + Constraints: []validation.Constraint{{Target: "operationID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "operationID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "operationID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.APIOperationClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, serviceName, apiid, operationID, ifMatch) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIOperationClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.APIOperationClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIOperationClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client APIOperationClient) DeletePreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, operationID string, ifMatch string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "apiId": autorest.Encode("path", apiid), + "operationId": autorest.Encode("path", operationID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}", pathParameters), + autorest.WithQueryParameters(queryParameters), + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client APIOperationClient) DeleteSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client APIOperationClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the details of the API Operation specified by its identifier. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// apiid - API revision identifier. Must be unique in the current API Management service instance. Non-current +// revision has ;rev=n as a suffix where n is the revision number. +// operationID - operation identifier within an API. Must be unique in the current API Management service +// instance. +func (client APIOperationClient) Get(ctx context.Context, resourceGroupName string, serviceName string, apiid string, operationID string) (result OperationContract, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: apiid, + Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "apiid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}, + {TargetValue: operationID, + Constraints: []validation.Constraint{{Target: "operationID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "operationID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "operationID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.APIOperationClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, serviceName, apiid, operationID) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIOperationClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.APIOperationClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIOperationClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client APIOperationClient) GetPreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, operationID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "apiId": autorest.Encode("path", apiid), + "operationId": autorest.Encode("path", operationID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client APIOperationClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client APIOperationClient) GetResponder(resp *http.Response) (result OperationContract, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetEntityTag gets the entity state (Etag) version of the API operation specified by its identifier. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// apiid - API revision identifier. Must be unique in the current API Management service instance. Non-current +// revision has ;rev=n as a suffix where n is the revision number. +// operationID - operation identifier within an API. Must be unique in the current API Management service +// instance. +func (client APIOperationClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, apiid string, operationID string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: apiid, + Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "apiid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}, + {TargetValue: operationID, + Constraints: []validation.Constraint{{Target: "operationID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "operationID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "operationID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.APIOperationClient", "GetEntityTag", err.Error()) + } + + req, err := client.GetEntityTagPreparer(ctx, resourceGroupName, serviceName, apiid, operationID) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIOperationClient", "GetEntityTag", nil, "Failure preparing request") + return + } + + resp, err := client.GetEntityTagSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.APIOperationClient", "GetEntityTag", resp, "Failure sending request") + return + } + + result, err = client.GetEntityTagResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIOperationClient", "GetEntityTag", resp, "Failure responding to request") + } + + return +} + +// GetEntityTagPreparer prepares the GetEntityTag request. +func (client APIOperationClient) GetEntityTagPreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, operationID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "apiId": autorest.Encode("path", apiid), + "operationId": autorest.Encode("path", operationID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsHead(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetEntityTagSender sends the GetEntityTag request. The method will close the +// http.Response Body if it receives an error. +func (client APIOperationClient) GetEntityTagSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetEntityTagResponder handles the response to the GetEntityTag request. The method always +// closes the http.Response Body. +func (client APIOperationClient) GetEntityTagResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// ListByAPI lists a collection of the operations for the specified API. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// apiid - API revision identifier. Must be unique in the current API Management service instance. Non-current +// revision has ;rev=n as a suffix where n is the revision number. +// filter - | Field | Supported operators | Supported functions | +// |-------------|------------------------|-----------------------------------| +// | name | ge, le, eq, ne, gt, lt | substringof, startswith, endswith | +// | method | ge, le, eq, ne, gt, lt | substringof, startswith, endswith | +// | description | ge, le, eq, ne, gt, lt | substringof, startswith, endswith | +// | urlTemplate | ge, le, eq, ne, gt, lt | substringof, startswith, endswith | +// top - number of records to return. +// skip - number of records to skip. +func (client APIOperationClient) ListByAPI(ctx context.Context, resourceGroupName string, serviceName string, apiid string, filter string, top *int32, skip *int32) (result OperationCollectionPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: apiid, + Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "apiid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}, + {TargetValue: top, + Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}}}, + {TargetValue: skip, + Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("apimanagement.APIOperationClient", "ListByAPI", err.Error()) + } + + result.fn = client.listByAPINextResults + req, err := client.ListByAPIPreparer(ctx, resourceGroupName, serviceName, apiid, filter, top, skip) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIOperationClient", "ListByAPI", nil, "Failure preparing request") + return + } + + resp, err := client.ListByAPISender(req) + if err != nil { + result.oc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.APIOperationClient", "ListByAPI", resp, "Failure sending request") + return + } + + result.oc, err = client.ListByAPIResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIOperationClient", "ListByAPI", resp, "Failure responding to request") + } + + return +} + +// ListByAPIPreparer prepares the ListByAPI request. +func (client APIOperationClient) ListByAPIPreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, filter string, top *int32, skip *int32) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "apiId": autorest.Encode("path", apiid), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + if skip != nil { + queryParameters["$skip"] = autorest.Encode("query", *skip) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByAPISender sends the ListByAPI request. The method will close the +// http.Response Body if it receives an error. +func (client APIOperationClient) ListByAPISender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByAPIResponder handles the response to the ListByAPI request. The method always +// closes the http.Response Body. +func (client APIOperationClient) ListByAPIResponder(resp *http.Response) (result OperationCollection, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByAPINextResults retrieves the next set of results, if any. +func (client APIOperationClient) listByAPINextResults(lastResults OperationCollection) (result OperationCollection, err error) { + req, err := lastResults.operationCollectionPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "apimanagement.APIOperationClient", "listByAPINextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByAPISender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "apimanagement.APIOperationClient", "listByAPINextResults", resp, "Failure sending next results request") + } + result, err = client.ListByAPIResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIOperationClient", "listByAPINextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByAPIComplete enumerates all values, automatically crossing page boundaries as required. +func (client APIOperationClient) ListByAPIComplete(ctx context.Context, resourceGroupName string, serviceName string, apiid string, filter string, top *int32, skip *int32) (result OperationCollectionIterator, err error) { + result.page, err = client.ListByAPI(ctx, resourceGroupName, serviceName, apiid, filter, top, skip) + return +} + +// Update updates the details of the operation in the API specified by its identifier. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// apiid - API revision identifier. Must be unique in the current API Management service instance. Non-current +// revision has ;rev=n as a suffix where n is the revision number. +// operationID - operation identifier within an API. Must be unique in the current API Management service +// instance. +// parameters - API Operation Update parameters. +// ifMatch - eTag of the Entity. ETag should match the current entity state from the header response of the GET +// request or it should be * for unconditional update. +func (client APIOperationClient) Update(ctx context.Context, resourceGroupName string, serviceName string, apiid string, operationID string, parameters OperationUpdateContract, ifMatch string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: apiid, + Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "apiid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}, + {TargetValue: operationID, + Constraints: []validation.Constraint{{Target: "operationID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "operationID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "operationID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.APIOperationClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, serviceName, apiid, operationID, parameters, ifMatch) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIOperationClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.APIOperationClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIOperationClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client APIOperationClient) UpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, operationID string, parameters OperationUpdateContract, ifMatch string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "apiId": autorest.Encode("path", apiid), + "operationId": autorest.Encode("path", operationID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters), + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client APIOperationClient) UpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client APIOperationClient) UpdateResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/apioperationpolicy.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/apioperationpolicy.go new file mode 100644 index 000000000..cb88f8c28 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/apioperationpolicy.go @@ -0,0 +1,502 @@ +package apimanagement + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// APIOperationPolicyClient is the apiManagement Client +type APIOperationPolicyClient struct { + BaseClient +} + +// NewAPIOperationPolicyClient creates an instance of the APIOperationPolicyClient client. +func NewAPIOperationPolicyClient(subscriptionID string) APIOperationPolicyClient { + return NewAPIOperationPolicyClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewAPIOperationPolicyClientWithBaseURI creates an instance of the APIOperationPolicyClient client. +func NewAPIOperationPolicyClientWithBaseURI(baseURI string, subscriptionID string) APIOperationPolicyClient { + return APIOperationPolicyClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or updates policy configuration for the API Operation level. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// apiid - API revision identifier. Must be unique in the current API Management service instance. Non-current +// revision has ;rev=n as a suffix where n is the revision number. +// operationID - operation identifier within an API. Must be unique in the current API Management service +// instance. +// parameters - the policy contents to apply. +// ifMatch - eTag of the Entity. Not required when creating an entity, but required when updating an entity. +func (client APIOperationPolicyClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, apiid string, operationID string, parameters PolicyContract, ifMatch string) (result PolicyContract, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: apiid, + Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "apiid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}, + {TargetValue: operationID, + Constraints: []validation.Constraint{{Target: "operationID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "operationID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "operationID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.PolicyContractProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.PolicyContractProperties.PolicyContent", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("apimanagement.APIOperationPolicyClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serviceName, apiid, operationID, parameters, ifMatch) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIOperationPolicyClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.APIOperationPolicyClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIOperationPolicyClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client APIOperationPolicyClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, operationID string, parameters PolicyContract, ifMatch string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "apiId": autorest.Encode("path", apiid), + "operationId": autorest.Encode("path", operationID), + "policyId": autorest.Encode("path", "policy"), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}/policies/{policyId}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + if len(ifMatch) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client APIOperationPolicyClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client APIOperationPolicyClient) CreateOrUpdateResponder(resp *http.Response) (result PolicyContract, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes the policy configuration at the Api Operation. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// apiid - API revision identifier. Must be unique in the current API Management service instance. Non-current +// revision has ;rev=n as a suffix where n is the revision number. +// operationID - operation identifier within an API. Must be unique in the current API Management service +// instance. +// ifMatch - eTag of the Entity. ETag should match the current entity state from the header response of the GET +// request or it should be * for unconditional update. +func (client APIOperationPolicyClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, apiid string, operationID string, ifMatch string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: apiid, + Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "apiid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}, + {TargetValue: operationID, + Constraints: []validation.Constraint{{Target: "operationID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "operationID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "operationID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.APIOperationPolicyClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, serviceName, apiid, operationID, ifMatch) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIOperationPolicyClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.APIOperationPolicyClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIOperationPolicyClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client APIOperationPolicyClient) DeletePreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, operationID string, ifMatch string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "apiId": autorest.Encode("path", apiid), + "operationId": autorest.Encode("path", operationID), + "policyId": autorest.Encode("path", "policy"), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}/policies/{policyId}", pathParameters), + autorest.WithQueryParameters(queryParameters), + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client APIOperationPolicyClient) DeleteSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client APIOperationPolicyClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get get the policy configuration at the API Operation level. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// apiid - API revision identifier. Must be unique in the current API Management service instance. Non-current +// revision has ;rev=n as a suffix where n is the revision number. +// operationID - operation identifier within an API. Must be unique in the current API Management service +// instance. +func (client APIOperationPolicyClient) Get(ctx context.Context, resourceGroupName string, serviceName string, apiid string, operationID string) (result PolicyContract, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: apiid, + Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "apiid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}, + {TargetValue: operationID, + Constraints: []validation.Constraint{{Target: "operationID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "operationID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "operationID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.APIOperationPolicyClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, serviceName, apiid, operationID) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIOperationPolicyClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.APIOperationPolicyClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIOperationPolicyClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client APIOperationPolicyClient) GetPreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, operationID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "apiId": autorest.Encode("path", apiid), + "operationId": autorest.Encode("path", operationID), + "policyId": autorest.Encode("path", "policy"), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}/policies/{policyId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client APIOperationPolicyClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client APIOperationPolicyClient) GetResponder(resp *http.Response) (result PolicyContract, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetEntityTag gets the entity state (Etag) version of the API operation policy specified by its identifier. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// apiid - API revision identifier. Must be unique in the current API Management service instance. Non-current +// revision has ;rev=n as a suffix where n is the revision number. +// operationID - operation identifier within an API. Must be unique in the current API Management service +// instance. +func (client APIOperationPolicyClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, apiid string, operationID string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: apiid, + Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "apiid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}, + {TargetValue: operationID, + Constraints: []validation.Constraint{{Target: "operationID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "operationID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "operationID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.APIOperationPolicyClient", "GetEntityTag", err.Error()) + } + + req, err := client.GetEntityTagPreparer(ctx, resourceGroupName, serviceName, apiid, operationID) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIOperationPolicyClient", "GetEntityTag", nil, "Failure preparing request") + return + } + + resp, err := client.GetEntityTagSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.APIOperationPolicyClient", "GetEntityTag", resp, "Failure sending request") + return + } + + result, err = client.GetEntityTagResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIOperationPolicyClient", "GetEntityTag", resp, "Failure responding to request") + } + + return +} + +// GetEntityTagPreparer prepares the GetEntityTag request. +func (client APIOperationPolicyClient) GetEntityTagPreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, operationID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "apiId": autorest.Encode("path", apiid), + "operationId": autorest.Encode("path", operationID), + "policyId": autorest.Encode("path", "policy"), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsHead(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}/policies/{policyId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetEntityTagSender sends the GetEntityTag request. The method will close the +// http.Response Body if it receives an error. +func (client APIOperationPolicyClient) GetEntityTagSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetEntityTagResponder handles the response to the GetEntityTag request. The method always +// closes the http.Response Body. +func (client APIOperationPolicyClient) GetEntityTagResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// ListByOperation get the list of policy configuration at the API Operation level. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// apiid - API revision identifier. Must be unique in the current API Management service instance. Non-current +// revision has ;rev=n as a suffix where n is the revision number. +// operationID - operation identifier within an API. Must be unique in the current API Management service +// instance. +func (client APIOperationPolicyClient) ListByOperation(ctx context.Context, resourceGroupName string, serviceName string, apiid string, operationID string) (result PolicyCollection, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: apiid, + Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "apiid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}, + {TargetValue: operationID, + Constraints: []validation.Constraint{{Target: "operationID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "operationID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "operationID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.APIOperationPolicyClient", "ListByOperation", err.Error()) + } + + req, err := client.ListByOperationPreparer(ctx, resourceGroupName, serviceName, apiid, operationID) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIOperationPolicyClient", "ListByOperation", nil, "Failure preparing request") + return + } + + resp, err := client.ListByOperationSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.APIOperationPolicyClient", "ListByOperation", resp, "Failure sending request") + return + } + + result, err = client.ListByOperationResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIOperationPolicyClient", "ListByOperation", resp, "Failure responding to request") + } + + return +} + +// ListByOperationPreparer prepares the ListByOperation request. +func (client APIOperationPolicyClient) ListByOperationPreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, operationID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "apiId": autorest.Encode("path", apiid), + "operationId": autorest.Encode("path", operationID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}/policies", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByOperationSender sends the ListByOperation request. The method will close the +// http.Response Body if it receives an error. +func (client APIOperationPolicyClient) ListByOperationSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByOperationResponder handles the response to the ListByOperation request. The method always +// closes the http.Response Body. +func (client APIOperationPolicyClient) ListByOperationResponder(resp *http.Response) (result PolicyCollection, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/apipolicy.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/apipolicy.go new file mode 100644 index 000000000..67959ec76 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/apipolicy.go @@ -0,0 +1,467 @@ +package apimanagement + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// APIPolicyClient is the apiManagement Client +type APIPolicyClient struct { + BaseClient +} + +// NewAPIPolicyClient creates an instance of the APIPolicyClient client. +func NewAPIPolicyClient(subscriptionID string) APIPolicyClient { + return NewAPIPolicyClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewAPIPolicyClientWithBaseURI creates an instance of the APIPolicyClient client. +func NewAPIPolicyClientWithBaseURI(baseURI string, subscriptionID string) APIPolicyClient { + return APIPolicyClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or updates policy configuration for the API. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// apiid - API revision identifier. Must be unique in the current API Management service instance. Non-current +// revision has ;rev=n as a suffix where n is the revision number. +// parameters - the policy contents to apply. +// ifMatch - eTag of the Entity. Not required when creating an entity, but required when updating an entity. +func (client APIPolicyClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, apiid string, parameters PolicyContract, ifMatch string) (result PolicyContract, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: apiid, + Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "apiid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.PolicyContractProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.PolicyContractProperties.PolicyContent", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("apimanagement.APIPolicyClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serviceName, apiid, parameters, ifMatch) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIPolicyClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.APIPolicyClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIPolicyClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client APIPolicyClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, parameters PolicyContract, ifMatch string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "apiId": autorest.Encode("path", apiid), + "policyId": autorest.Encode("path", "policy"), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/policies/{policyId}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + if len(ifMatch) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client APIPolicyClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client APIPolicyClient) CreateOrUpdateResponder(resp *http.Response) (result PolicyContract, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes the policy configuration at the Api. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// apiid - API revision identifier. Must be unique in the current API Management service instance. Non-current +// revision has ;rev=n as a suffix where n is the revision number. +// ifMatch - eTag of the Entity. ETag should match the current entity state from the header response of the GET +// request or it should be * for unconditional update. +func (client APIPolicyClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, apiid string, ifMatch string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: apiid, + Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "apiid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.APIPolicyClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, serviceName, apiid, ifMatch) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIPolicyClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.APIPolicyClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIPolicyClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client APIPolicyClient) DeletePreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, ifMatch string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "apiId": autorest.Encode("path", apiid), + "policyId": autorest.Encode("path", "policy"), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/policies/{policyId}", pathParameters), + autorest.WithQueryParameters(queryParameters), + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client APIPolicyClient) DeleteSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client APIPolicyClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get get the policy configuration at the API level. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// apiid - API revision identifier. Must be unique in the current API Management service instance. Non-current +// revision has ;rev=n as a suffix where n is the revision number. +func (client APIPolicyClient) Get(ctx context.Context, resourceGroupName string, serviceName string, apiid string) (result PolicyContract, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: apiid, + Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "apiid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.APIPolicyClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, serviceName, apiid) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIPolicyClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.APIPolicyClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIPolicyClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client APIPolicyClient) GetPreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "apiId": autorest.Encode("path", apiid), + "policyId": autorest.Encode("path", "policy"), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/policies/{policyId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client APIPolicyClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client APIPolicyClient) GetResponder(resp *http.Response) (result PolicyContract, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetEntityTag gets the entity state (Etag) version of the API policy specified by its identifier. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// apiid - API revision identifier. Must be unique in the current API Management service instance. Non-current +// revision has ;rev=n as a suffix where n is the revision number. +func (client APIPolicyClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, apiid string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: apiid, + Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "apiid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.APIPolicyClient", "GetEntityTag", err.Error()) + } + + req, err := client.GetEntityTagPreparer(ctx, resourceGroupName, serviceName, apiid) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIPolicyClient", "GetEntityTag", nil, "Failure preparing request") + return + } + + resp, err := client.GetEntityTagSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.APIPolicyClient", "GetEntityTag", resp, "Failure sending request") + return + } + + result, err = client.GetEntityTagResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIPolicyClient", "GetEntityTag", resp, "Failure responding to request") + } + + return +} + +// GetEntityTagPreparer prepares the GetEntityTag request. +func (client APIPolicyClient) GetEntityTagPreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "apiId": autorest.Encode("path", apiid), + "policyId": autorest.Encode("path", "policy"), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsHead(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/policies/{policyId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetEntityTagSender sends the GetEntityTag request. The method will close the +// http.Response Body if it receives an error. +func (client APIPolicyClient) GetEntityTagSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetEntityTagResponder handles the response to the GetEntityTag request. The method always +// closes the http.Response Body. +func (client APIPolicyClient) GetEntityTagResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// ListByAPI get the policy configuration at the API level. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// apiid - API revision identifier. Must be unique in the current API Management service instance. Non-current +// revision has ;rev=n as a suffix where n is the revision number. +func (client APIPolicyClient) ListByAPI(ctx context.Context, resourceGroupName string, serviceName string, apiid string) (result PolicyCollection, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: apiid, + Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "apiid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.APIPolicyClient", "ListByAPI", err.Error()) + } + + req, err := client.ListByAPIPreparer(ctx, resourceGroupName, serviceName, apiid) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIPolicyClient", "ListByAPI", nil, "Failure preparing request") + return + } + + resp, err := client.ListByAPISender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.APIPolicyClient", "ListByAPI", resp, "Failure sending request") + return + } + + result, err = client.ListByAPIResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIPolicyClient", "ListByAPI", resp, "Failure responding to request") + } + + return +} + +// ListByAPIPreparer prepares the ListByAPI request. +func (client APIPolicyClient) ListByAPIPreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "apiId": autorest.Encode("path", apiid), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/policies", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByAPISender sends the ListByAPI request. The method will close the +// http.Response Body if it receives an error. +func (client APIPolicyClient) ListByAPISender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByAPIResponder handles the response to the ListByAPI request. The method always +// closes the http.Response Body. +func (client APIPolicyClient) ListByAPIResponder(resp *http.Response) (result PolicyCollection, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/apiproduct.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/apiproduct.go new file mode 100644 index 000000000..98defef02 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/apiproduct.go @@ -0,0 +1,170 @@ +package apimanagement + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// APIProductClient is the apiManagement Client +type APIProductClient struct { + BaseClient +} + +// NewAPIProductClient creates an instance of the APIProductClient client. +func NewAPIProductClient(subscriptionID string) APIProductClient { + return NewAPIProductClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewAPIProductClientWithBaseURI creates an instance of the APIProductClient client. +func NewAPIProductClientWithBaseURI(baseURI string, subscriptionID string) APIProductClient { + return APIProductClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// ListByApis lists all Products, which the API is part of. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// apiid - API identifier. Must be unique in the current API Management service instance. +// filter - | Field | Supported operators | Supported functions | +// |-------|------------------------|---------------------------------------------| +// | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// top - number of records to return. +// skip - number of records to skip. +func (client APIProductClient) ListByApis(ctx context.Context, resourceGroupName string, serviceName string, apiid string, filter string, top *int32, skip *int32) (result ProductCollectionPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: apiid, + Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "apiid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {TargetValue: top, + Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}}}, + {TargetValue: skip, + Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("apimanagement.APIProductClient", "ListByApis", err.Error()) + } + + result.fn = client.listByApisNextResults + req, err := client.ListByApisPreparer(ctx, resourceGroupName, serviceName, apiid, filter, top, skip) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIProductClient", "ListByApis", nil, "Failure preparing request") + return + } + + resp, err := client.ListByApisSender(req) + if err != nil { + result.pc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.APIProductClient", "ListByApis", resp, "Failure sending request") + return + } + + result.pc, err = client.ListByApisResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIProductClient", "ListByApis", resp, "Failure responding to request") + } + + return +} + +// ListByApisPreparer prepares the ListByApis request. +func (client APIProductClient) ListByApisPreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, filter string, top *int32, skip *int32) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "apiId": autorest.Encode("path", apiid), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + if skip != nil { + queryParameters["$skip"] = autorest.Encode("query", *skip) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/products", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByApisSender sends the ListByApis request. The method will close the +// http.Response Body if it receives an error. +func (client APIProductClient) ListByApisSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByApisResponder handles the response to the ListByApis request. The method always +// closes the http.Response Body. +func (client APIProductClient) ListByApisResponder(resp *http.Response) (result ProductCollection, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByApisNextResults retrieves the next set of results, if any. +func (client APIProductClient) listByApisNextResults(lastResults ProductCollection) (result ProductCollection, err error) { + req, err := lastResults.productCollectionPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "apimanagement.APIProductClient", "listByApisNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByApisSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "apimanagement.APIProductClient", "listByApisNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByApisResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIProductClient", "listByApisNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByApisComplete enumerates all values, automatically crossing page boundaries as required. +func (client APIProductClient) ListByApisComplete(ctx context.Context, resourceGroupName string, serviceName string, apiid string, filter string, top *int32, skip *int32) (result ProductCollectionIterator, err error) { + result.page, err = client.ListByApis(ctx, resourceGroupName, serviceName, apiid, filter, top, skip) + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/apirelease.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/apirelease.go new file mode 100644 index 000000000..f2a2d9439 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/apirelease.go @@ -0,0 +1,617 @@ +package apimanagement + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// APIReleaseClient is the apiManagement Client +type APIReleaseClient struct { + BaseClient +} + +// NewAPIReleaseClient creates an instance of the APIReleaseClient client. +func NewAPIReleaseClient(subscriptionID string) APIReleaseClient { + return NewAPIReleaseClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewAPIReleaseClientWithBaseURI creates an instance of the APIReleaseClient client. +func NewAPIReleaseClientWithBaseURI(baseURI string, subscriptionID string) APIReleaseClient { + return APIReleaseClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Create creates a new Release for the API. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// apiid - API identifier. Must be unique in the current API Management service instance. +// releaseID - release identifier within an API. Must be unique in the current API Management service instance. +// parameters - create parameters. +func (client APIReleaseClient) Create(ctx context.Context, resourceGroupName string, serviceName string, apiid string, releaseID string, parameters APIReleaseContract) (result APIReleaseContract, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: apiid, + Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "apiid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {TargetValue: releaseID, + Constraints: []validation.Constraint{{Target: "releaseID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "releaseID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "releaseID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.APIReleaseClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, resourceGroupName, serviceName, apiid, releaseID, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIReleaseClient", "Create", nil, "Failure preparing request") + return + } + + resp, err := client.CreateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.APIReleaseClient", "Create", resp, "Failure sending request") + return + } + + result, err = client.CreateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIReleaseClient", "Create", resp, "Failure responding to request") + } + + return +} + +// CreatePreparer prepares the Create request. +func (client APIReleaseClient) CreatePreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, releaseID string, parameters APIReleaseContract) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "apiId": autorest.Encode("path", apiid), + "releaseId": autorest.Encode("path", releaseID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/releases/{releaseId}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client APIReleaseClient) CreateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client APIReleaseClient) CreateResponder(resp *http.Response) (result APIReleaseContract, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes the specified release in the API. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// apiid - API identifier. Must be unique in the current API Management service instance. +// releaseID - release identifier within an API. Must be unique in the current API Management service instance. +// ifMatch - eTag of the Entity. ETag should match the current entity state from the header response of the GET +// request or it should be * for unconditional update. +func (client APIReleaseClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, apiid string, releaseID string, ifMatch string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: apiid, + Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "apiid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {TargetValue: releaseID, + Constraints: []validation.Constraint{{Target: "releaseID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "releaseID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "releaseID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.APIReleaseClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, serviceName, apiid, releaseID, ifMatch) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIReleaseClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.APIReleaseClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIReleaseClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client APIReleaseClient) DeletePreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, releaseID string, ifMatch string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "apiId": autorest.Encode("path", apiid), + "releaseId": autorest.Encode("path", releaseID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/releases/{releaseId}", pathParameters), + autorest.WithQueryParameters(queryParameters), + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client APIReleaseClient) DeleteSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client APIReleaseClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get returns the details of an API release. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// apiid - API identifier. Must be unique in the current API Management service instance. +// releaseID - release identifier within an API. Must be unique in the current API Management service instance. +func (client APIReleaseClient) Get(ctx context.Context, resourceGroupName string, serviceName string, apiid string, releaseID string) (result APIReleaseContract, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: apiid, + Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "apiid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {TargetValue: releaseID, + Constraints: []validation.Constraint{{Target: "releaseID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "releaseID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "releaseID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.APIReleaseClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, serviceName, apiid, releaseID) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIReleaseClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.APIReleaseClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIReleaseClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client APIReleaseClient) GetPreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, releaseID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "apiId": autorest.Encode("path", apiid), + "releaseId": autorest.Encode("path", releaseID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/releases/{releaseId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client APIReleaseClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client APIReleaseClient) GetResponder(resp *http.Response) (result APIReleaseContract, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetEntityTag returns the etag of an API release. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// apiid - API identifier. Must be unique in the current API Management service instance. +// releaseID - release identifier within an API. Must be unique in the current API Management service instance. +func (client APIReleaseClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, apiid string, releaseID string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: apiid, + Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "apiid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {TargetValue: releaseID, + Constraints: []validation.Constraint{{Target: "releaseID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "releaseID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "releaseID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.APIReleaseClient", "GetEntityTag", err.Error()) + } + + req, err := client.GetEntityTagPreparer(ctx, resourceGroupName, serviceName, apiid, releaseID) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIReleaseClient", "GetEntityTag", nil, "Failure preparing request") + return + } + + resp, err := client.GetEntityTagSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.APIReleaseClient", "GetEntityTag", resp, "Failure sending request") + return + } + + result, err = client.GetEntityTagResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIReleaseClient", "GetEntityTag", resp, "Failure responding to request") + } + + return +} + +// GetEntityTagPreparer prepares the GetEntityTag request. +func (client APIReleaseClient) GetEntityTagPreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, releaseID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "apiId": autorest.Encode("path", apiid), + "releaseId": autorest.Encode("path", releaseID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsHead(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/releases/{releaseId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetEntityTagSender sends the GetEntityTag request. The method will close the +// http.Response Body if it receives an error. +func (client APIReleaseClient) GetEntityTagSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetEntityTagResponder handles the response to the GetEntityTag request. The method always +// closes the http.Response Body. +func (client APIReleaseClient) GetEntityTagResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// List lists all releases of an API. An API release is created when making an API Revision current. Releases are also +// used to rollback to previous revisions. Results will be paged and can be constrained by the $top and $skip +// parameters. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// apiid - API identifier. Must be unique in the current API Management service instance. +// filter - | Field | Supported operators | Supported functions | +// |-------|------------------------|---------------------------------------------| +// | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// |notes|ge le eq ne gt lt|substringof contains startswith endswith| +// top - number of records to return. +// skip - number of records to skip. +func (client APIReleaseClient) List(ctx context.Context, resourceGroupName string, serviceName string, apiid string, filter string, top *int32, skip *int32) (result APIReleaseCollectionPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: apiid, + Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "apiid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {TargetValue: top, + Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}}}, + {TargetValue: skip, + Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("apimanagement.APIReleaseClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName, serviceName, apiid, filter, top, skip) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIReleaseClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.arc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.APIReleaseClient", "List", resp, "Failure sending request") + return + } + + result.arc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIReleaseClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client APIReleaseClient) ListPreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, filter string, top *int32, skip *int32) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "apiId": autorest.Encode("path", apiid), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + if skip != nil { + queryParameters["$skip"] = autorest.Encode("query", *skip) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/releases", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client APIReleaseClient) ListSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client APIReleaseClient) ListResponder(resp *http.Response) (result APIReleaseCollection, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client APIReleaseClient) listNextResults(lastResults APIReleaseCollection) (result APIReleaseCollection, err error) { + req, err := lastResults.aPIReleaseCollectionPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "apimanagement.APIReleaseClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "apimanagement.APIReleaseClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIReleaseClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client APIReleaseClient) ListComplete(ctx context.Context, resourceGroupName string, serviceName string, apiid string, filter string, top *int32, skip *int32) (result APIReleaseCollectionIterator, err error) { + result.page, err = client.List(ctx, resourceGroupName, serviceName, apiid, filter, top, skip) + return +} + +// Update updates the details of the release of the API specified by its identifier. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// apiid - API identifier. Must be unique in the current API Management service instance. +// releaseID - release identifier within an API. Must be unique in the current API Management service instance. +// parameters - API Release Update parameters. +// ifMatch - eTag of the Entity. ETag should match the current entity state from the header response of the GET +// request or it should be * for unconditional update. +func (client APIReleaseClient) Update(ctx context.Context, resourceGroupName string, serviceName string, apiid string, releaseID string, parameters APIReleaseContract, ifMatch string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: apiid, + Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "apiid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {TargetValue: releaseID, + Constraints: []validation.Constraint{{Target: "releaseID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "releaseID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "releaseID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.APIReleaseClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, serviceName, apiid, releaseID, parameters, ifMatch) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIReleaseClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.APIReleaseClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIReleaseClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client APIReleaseClient) UpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, releaseID string, parameters APIReleaseContract, ifMatch string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "apiId": autorest.Encode("path", apiid), + "releaseId": autorest.Encode("path", releaseID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/releases/{releaseId}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters), + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client APIReleaseClient) UpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client APIReleaseClient) UpdateResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/apirevisions.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/apirevisions.go new file mode 100644 index 000000000..7f4468392 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/apirevisions.go @@ -0,0 +1,171 @@ +package apimanagement + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// APIRevisionsClient is the apiManagement Client +type APIRevisionsClient struct { + BaseClient +} + +// NewAPIRevisionsClient creates an instance of the APIRevisionsClient client. +func NewAPIRevisionsClient(subscriptionID string) APIRevisionsClient { + return NewAPIRevisionsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewAPIRevisionsClientWithBaseURI creates an instance of the APIRevisionsClient client. +func NewAPIRevisionsClientWithBaseURI(baseURI string, subscriptionID string) APIRevisionsClient { + return APIRevisionsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// List lists all revisions of an API. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// apiid - API identifier. Must be unique in the current API Management service instance. +// filter - | Field | Supported operators | Supported functions | +// |-------------|------------------------|-----------------------------------| +// +// |apiRevision | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith| +// top - number of records to return. +// skip - number of records to skip. +func (client APIRevisionsClient) List(ctx context.Context, resourceGroupName string, serviceName string, apiid string, filter string, top *int32, skip *int32) (result APIRevisionCollectionPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: apiid, + Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "apiid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {TargetValue: top, + Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}}}, + {TargetValue: skip, + Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("apimanagement.APIRevisionsClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName, serviceName, apiid, filter, top, skip) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIRevisionsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.arc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.APIRevisionsClient", "List", resp, "Failure sending request") + return + } + + result.arc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIRevisionsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client APIRevisionsClient) ListPreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, filter string, top *int32, skip *int32) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "apiId": autorest.Encode("path", apiid), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + if skip != nil { + queryParameters["$skip"] = autorest.Encode("query", *skip) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/revisions", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client APIRevisionsClient) ListSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client APIRevisionsClient) ListResponder(resp *http.Response) (result APIRevisionCollection, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client APIRevisionsClient) listNextResults(lastResults APIRevisionCollection) (result APIRevisionCollection, err error) { + req, err := lastResults.aPIRevisionCollectionPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "apimanagement.APIRevisionsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "apimanagement.APIRevisionsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIRevisionsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client APIRevisionsClient) ListComplete(ctx context.Context, resourceGroupName string, serviceName string, apiid string, filter string, top *int32, skip *int32) (result APIRevisionCollectionIterator, err error) { + result.page, err = client.List(ctx, resourceGroupName, serviceName, apiid, filter, top, skip) + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/apischema.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/apischema.go new file mode 100644 index 000000000..1d099efc0 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/apischema.go @@ -0,0 +1,515 @@ +package apimanagement + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// APISchemaClient is the apiManagement Client +type APISchemaClient struct { + BaseClient +} + +// NewAPISchemaClient creates an instance of the APISchemaClient client. +func NewAPISchemaClient(subscriptionID string) APISchemaClient { + return NewAPISchemaClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewAPISchemaClientWithBaseURI creates an instance of the APISchemaClient client. +func NewAPISchemaClientWithBaseURI(baseURI string, subscriptionID string) APISchemaClient { + return APISchemaClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or updates schema configuration for the API. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// apiid - API revision identifier. Must be unique in the current API Management service instance. Non-current +// revision has ;rev=n as a suffix where n is the revision number. +// schemaID - schema identifier within an API. Must be unique in the current API Management service instance. +// parameters - the schema contents to apply. +// ifMatch - eTag of the Entity. Not required when creating an entity, but required when updating an entity. +func (client APISchemaClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, apiid string, schemaID string, parameters SchemaContract, ifMatch string) (result SchemaContract, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: apiid, + Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "apiid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}, + {TargetValue: schemaID, + Constraints: []validation.Constraint{{Target: "schemaID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "schemaID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "schemaID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.SchemaContractProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.SchemaContractProperties.ContentType", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("apimanagement.APISchemaClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serviceName, apiid, schemaID, parameters, ifMatch) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APISchemaClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.APISchemaClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APISchemaClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client APISchemaClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, schemaID string, parameters SchemaContract, ifMatch string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "apiId": autorest.Encode("path", apiid), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "schemaId": autorest.Encode("path", schemaID), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/schemas/{schemaId}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + if len(ifMatch) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client APISchemaClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client APISchemaClient) CreateOrUpdateResponder(resp *http.Response) (result SchemaContract, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes the schema configuration at the Api. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// apiid - API revision identifier. Must be unique in the current API Management service instance. Non-current +// revision has ;rev=n as a suffix where n is the revision number. +// schemaID - schema identifier within an API. Must be unique in the current API Management service instance. +// ifMatch - eTag of the Entity. ETag should match the current entity state from the header response of the GET +// request or it should be * for unconditional update. +func (client APISchemaClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, apiid string, schemaID string, ifMatch string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: apiid, + Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "apiid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}, + {TargetValue: schemaID, + Constraints: []validation.Constraint{{Target: "schemaID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "schemaID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "schemaID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.APISchemaClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, serviceName, apiid, schemaID, ifMatch) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APISchemaClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.APISchemaClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APISchemaClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client APISchemaClient) DeletePreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, schemaID string, ifMatch string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "apiId": autorest.Encode("path", apiid), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "schemaId": autorest.Encode("path", schemaID), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/schemas/{schemaId}", pathParameters), + autorest.WithQueryParameters(queryParameters), + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client APISchemaClient) DeleteSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client APISchemaClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get get the schema configuration at the API level. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// apiid - API revision identifier. Must be unique in the current API Management service instance. Non-current +// revision has ;rev=n as a suffix where n is the revision number. +// schemaID - schema identifier within an API. Must be unique in the current API Management service instance. +func (client APISchemaClient) Get(ctx context.Context, resourceGroupName string, serviceName string, apiid string, schemaID string) (result SchemaContract, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: apiid, + Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "apiid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}, + {TargetValue: schemaID, + Constraints: []validation.Constraint{{Target: "schemaID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "schemaID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "schemaID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.APISchemaClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, serviceName, apiid, schemaID) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APISchemaClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.APISchemaClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APISchemaClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client APISchemaClient) GetPreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, schemaID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "apiId": autorest.Encode("path", apiid), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "schemaId": autorest.Encode("path", schemaID), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/schemas/{schemaId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client APISchemaClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client APISchemaClient) GetResponder(resp *http.Response) (result SchemaContract, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetEntityTag gets the entity state (Etag) version of the schema specified by its identifier. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// apiid - API revision identifier. Must be unique in the current API Management service instance. Non-current +// revision has ;rev=n as a suffix where n is the revision number. +// schemaID - schema identifier within an API. Must be unique in the current API Management service instance. +func (client APISchemaClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, apiid string, schemaID string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: apiid, + Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "apiid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}, + {TargetValue: schemaID, + Constraints: []validation.Constraint{{Target: "schemaID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "schemaID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "schemaID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.APISchemaClient", "GetEntityTag", err.Error()) + } + + req, err := client.GetEntityTagPreparer(ctx, resourceGroupName, serviceName, apiid, schemaID) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APISchemaClient", "GetEntityTag", nil, "Failure preparing request") + return + } + + resp, err := client.GetEntityTagSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.APISchemaClient", "GetEntityTag", resp, "Failure sending request") + return + } + + result, err = client.GetEntityTagResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APISchemaClient", "GetEntityTag", resp, "Failure responding to request") + } + + return +} + +// GetEntityTagPreparer prepares the GetEntityTag request. +func (client APISchemaClient) GetEntityTagPreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, schemaID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "apiId": autorest.Encode("path", apiid), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "schemaId": autorest.Encode("path", schemaID), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsHead(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/schemas/{schemaId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetEntityTagSender sends the GetEntityTag request. The method will close the +// http.Response Body if it receives an error. +func (client APISchemaClient) GetEntityTagSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetEntityTagResponder handles the response to the GetEntityTag request. The method always +// closes the http.Response Body. +func (client APISchemaClient) GetEntityTagResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// ListByAPI get the schema configuration at the API level. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// apiid - API revision identifier. Must be unique in the current API Management service instance. Non-current +// revision has ;rev=n as a suffix where n is the revision number. +func (client APISchemaClient) ListByAPI(ctx context.Context, resourceGroupName string, serviceName string, apiid string) (result SchemaCollectionPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: apiid, + Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "apiid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.APISchemaClient", "ListByAPI", err.Error()) + } + + result.fn = client.listByAPINextResults + req, err := client.ListByAPIPreparer(ctx, resourceGroupName, serviceName, apiid) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APISchemaClient", "ListByAPI", nil, "Failure preparing request") + return + } + + resp, err := client.ListByAPISender(req) + if err != nil { + result.sc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.APISchemaClient", "ListByAPI", resp, "Failure sending request") + return + } + + result.sc, err = client.ListByAPIResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APISchemaClient", "ListByAPI", resp, "Failure responding to request") + } + + return +} + +// ListByAPIPreparer prepares the ListByAPI request. +func (client APISchemaClient) ListByAPIPreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "apiId": autorest.Encode("path", apiid), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/schemas", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByAPISender sends the ListByAPI request. The method will close the +// http.Response Body if it receives an error. +func (client APISchemaClient) ListByAPISender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByAPIResponder handles the response to the ListByAPI request. The method always +// closes the http.Response Body. +func (client APISchemaClient) ListByAPIResponder(resp *http.Response) (result SchemaCollection, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByAPINextResults retrieves the next set of results, if any. +func (client APISchemaClient) listByAPINextResults(lastResults SchemaCollection) (result SchemaCollection, err error) { + req, err := lastResults.schemaCollectionPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "apimanagement.APISchemaClient", "listByAPINextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByAPISender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "apimanagement.APISchemaClient", "listByAPINextResults", resp, "Failure sending next results request") + } + result, err = client.ListByAPIResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APISchemaClient", "listByAPINextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByAPIComplete enumerates all values, automatically crossing page boundaries as required. +func (client APISchemaClient) ListByAPIComplete(ctx context.Context, resourceGroupName string, serviceName string, apiid string) (result SchemaCollectionIterator, err error) { + result.page, err = client.ListByAPI(ctx, resourceGroupName, serviceName, apiid) + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/apiversionset.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/apiversionset.go new file mode 100644 index 000000000..b82f1c2bc --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/apiversionset.go @@ -0,0 +1,596 @@ +package apimanagement + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// APIVersionSetClient is the apiManagement Client +type APIVersionSetClient struct { + BaseClient +} + +// NewAPIVersionSetClient creates an instance of the APIVersionSetClient client. +func NewAPIVersionSetClient(subscriptionID string) APIVersionSetClient { + return NewAPIVersionSetClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewAPIVersionSetClientWithBaseURI creates an instance of the APIVersionSetClient client. +func NewAPIVersionSetClientWithBaseURI(baseURI string, subscriptionID string) APIVersionSetClient { + return APIVersionSetClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or Updates a Api Version Set. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// versionSetID - api Version Set identifier. Must be unique in the current API Management service instance. +// parameters - create or update parameters. +// ifMatch - eTag of the Entity. Not required when creating an entity, but required when updating an entity. +func (client APIVersionSetClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, versionSetID string, parameters APIVersionSetContract, ifMatch string) (result APIVersionSetContract, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: versionSetID, + Constraints: []validation.Constraint{{Target: "versionSetID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "versionSetID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "versionSetID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.APIVersionSetContractProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.APIVersionSetContractProperties.DisplayName", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.APIVersionSetContractProperties.DisplayName", Name: validation.MaxLength, Rule: 100, Chain: nil}, + {Target: "parameters.APIVersionSetContractProperties.DisplayName", Name: validation.MinLength, Rule: 1, Chain: nil}, + }}, + }}}}}); err != nil { + return result, validation.NewError("apimanagement.APIVersionSetClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serviceName, versionSetID, parameters, ifMatch) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIVersionSetClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.APIVersionSetClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIVersionSetClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client APIVersionSetClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, versionSetID string, parameters APIVersionSetContract, ifMatch string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "versionSetId": autorest.Encode("path", versionSetID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/api-version-sets/{versionSetId}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + if len(ifMatch) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client APIVersionSetClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client APIVersionSetClient) CreateOrUpdateResponder(resp *http.Response) (result APIVersionSetContract, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes specific Api Version Set. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// versionSetID - api Version Set identifier. Must be unique in the current API Management service instance. +// ifMatch - eTag of the Entity. ETag should match the current entity state from the header response of the GET +// request or it should be * for unconditional update. +func (client APIVersionSetClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, versionSetID string, ifMatch string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: versionSetID, + Constraints: []validation.Constraint{{Target: "versionSetID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "versionSetID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "versionSetID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.APIVersionSetClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, serviceName, versionSetID, ifMatch) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIVersionSetClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.APIVersionSetClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIVersionSetClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client APIVersionSetClient) DeletePreparer(ctx context.Context, resourceGroupName string, serviceName string, versionSetID string, ifMatch string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "versionSetId": autorest.Encode("path", versionSetID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/api-version-sets/{versionSetId}", pathParameters), + autorest.WithQueryParameters(queryParameters), + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client APIVersionSetClient) DeleteSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client APIVersionSetClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the details of the Api Version Set specified by its identifier. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// versionSetID - api Version Set identifier. Must be unique in the current API Management service instance. +func (client APIVersionSetClient) Get(ctx context.Context, resourceGroupName string, serviceName string, versionSetID string) (result APIVersionSetContract, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: versionSetID, + Constraints: []validation.Constraint{{Target: "versionSetID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "versionSetID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "versionSetID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.APIVersionSetClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, serviceName, versionSetID) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIVersionSetClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.APIVersionSetClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIVersionSetClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client APIVersionSetClient) GetPreparer(ctx context.Context, resourceGroupName string, serviceName string, versionSetID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "versionSetId": autorest.Encode("path", versionSetID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/api-version-sets/{versionSetId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client APIVersionSetClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client APIVersionSetClient) GetResponder(resp *http.Response) (result APIVersionSetContract, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetEntityTag gets the entity state (Etag) version of the Api Version Set specified by its identifier. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// versionSetID - api Version Set identifier. Must be unique in the current API Management service instance. +func (client APIVersionSetClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, versionSetID string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: versionSetID, + Constraints: []validation.Constraint{{Target: "versionSetID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "versionSetID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "versionSetID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.APIVersionSetClient", "GetEntityTag", err.Error()) + } + + req, err := client.GetEntityTagPreparer(ctx, resourceGroupName, serviceName, versionSetID) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIVersionSetClient", "GetEntityTag", nil, "Failure preparing request") + return + } + + resp, err := client.GetEntityTagSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.APIVersionSetClient", "GetEntityTag", resp, "Failure sending request") + return + } + + result, err = client.GetEntityTagResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIVersionSetClient", "GetEntityTag", resp, "Failure responding to request") + } + + return +} + +// GetEntityTagPreparer prepares the GetEntityTag request. +func (client APIVersionSetClient) GetEntityTagPreparer(ctx context.Context, resourceGroupName string, serviceName string, versionSetID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "versionSetId": autorest.Encode("path", versionSetID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsHead(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/api-version-sets/{versionSetId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetEntityTagSender sends the GetEntityTag request. The method will close the +// http.Response Body if it receives an error. +func (client APIVersionSetClient) GetEntityTagSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetEntityTagResponder handles the response to the GetEntityTag request. The method always +// closes the http.Response Body. +func (client APIVersionSetClient) GetEntityTagResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// ListByService lists a collection of API Version Sets in the specified service instance. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// filter - | Field | Supported operators | Supported functions | +// |------------------|------------------------|-----------------------------------| +// | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// | firstName | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// | lastName | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// | email | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// | state | eq | N/A | +// | registrationDate | ge, le, eq, ne, gt, lt | N/A | +// | note | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// top - number of records to return. +// skip - number of records to skip. +func (client APIVersionSetClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (result APIVersionSetCollectionPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: top, + Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}}}, + {TargetValue: skip, + Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("apimanagement.APIVersionSetClient", "ListByService", err.Error()) + } + + result.fn = client.listByServiceNextResults + req, err := client.ListByServicePreparer(ctx, resourceGroupName, serviceName, filter, top, skip) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIVersionSetClient", "ListByService", nil, "Failure preparing request") + return + } + + resp, err := client.ListByServiceSender(req) + if err != nil { + result.avsc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.APIVersionSetClient", "ListByService", resp, "Failure sending request") + return + } + + result.avsc, err = client.ListByServiceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIVersionSetClient", "ListByService", resp, "Failure responding to request") + } + + return +} + +// ListByServicePreparer prepares the ListByService request. +func (client APIVersionSetClient) ListByServicePreparer(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + if skip != nil { + queryParameters["$skip"] = autorest.Encode("query", *skip) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/api-version-sets", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByServiceSender sends the ListByService request. The method will close the +// http.Response Body if it receives an error. +func (client APIVersionSetClient) ListByServiceSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByServiceResponder handles the response to the ListByService request. The method always +// closes the http.Response Body. +func (client APIVersionSetClient) ListByServiceResponder(resp *http.Response) (result APIVersionSetCollection, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByServiceNextResults retrieves the next set of results, if any. +func (client APIVersionSetClient) listByServiceNextResults(lastResults APIVersionSetCollection) (result APIVersionSetCollection, err error) { + req, err := lastResults.aPIVersionSetCollectionPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "apimanagement.APIVersionSetClient", "listByServiceNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByServiceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "apimanagement.APIVersionSetClient", "listByServiceNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByServiceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIVersionSetClient", "listByServiceNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByServiceComplete enumerates all values, automatically crossing page boundaries as required. +func (client APIVersionSetClient) ListByServiceComplete(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (result APIVersionSetCollectionIterator, err error) { + result.page, err = client.ListByService(ctx, resourceGroupName, serviceName, filter, top, skip) + return +} + +// Update updates the details of the Api VersionSet specified by its identifier. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// versionSetID - api Version Set identifier. Must be unique in the current API Management service instance. +// parameters - update parameters. +// ifMatch - eTag of the Entity. ETag should match the current entity state from the header response of the GET +// request or it should be * for unconditional update. +func (client APIVersionSetClient) Update(ctx context.Context, resourceGroupName string, serviceName string, versionSetID string, parameters APIVersionSetUpdateParameters, ifMatch string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: versionSetID, + Constraints: []validation.Constraint{{Target: "versionSetID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "versionSetID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "versionSetID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.APIVersionSetClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, serviceName, versionSetID, parameters, ifMatch) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIVersionSetClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.APIVersionSetClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIVersionSetClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client APIVersionSetClient) UpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, versionSetID string, parameters APIVersionSetUpdateParameters, ifMatch string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "versionSetId": autorest.Encode("path", versionSetID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/api-version-sets/{versionSetId}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters), + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client APIVersionSetClient) UpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client APIVersionSetClient) UpdateResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/authorizationserver.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/authorizationserver.go new file mode 100644 index 000000000..81ada6c53 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/authorizationserver.go @@ -0,0 +1,595 @@ +package apimanagement + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// AuthorizationServerClient is the apiManagement Client +type AuthorizationServerClient struct { + BaseClient +} + +// NewAuthorizationServerClient creates an instance of the AuthorizationServerClient client. +func NewAuthorizationServerClient(subscriptionID string) AuthorizationServerClient { + return NewAuthorizationServerClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewAuthorizationServerClientWithBaseURI creates an instance of the AuthorizationServerClient client. +func NewAuthorizationServerClientWithBaseURI(baseURI string, subscriptionID string) AuthorizationServerClient { + return AuthorizationServerClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates new authorization server or updates an existing authorization server. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// authsid - identifier of the authorization server. +// parameters - create or update parameters. +// ifMatch - eTag of the Entity. Not required when creating an entity, but required when updating an entity. +func (client AuthorizationServerClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, authsid string, parameters AuthorizationServerContract, ifMatch string) (result AuthorizationServerContract, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: authsid, + Constraints: []validation.Constraint{{Target: "authsid", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "authsid", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "authsid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.AuthorizationServerContractProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.AuthorizationServerContractProperties.DisplayName", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.AuthorizationServerContractProperties.DisplayName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "parameters.AuthorizationServerContractProperties.DisplayName", Name: validation.MinLength, Rule: 1, Chain: nil}, + }}, + {Target: "parameters.AuthorizationServerContractProperties.ClientRegistrationEndpoint", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.AuthorizationServerContractProperties.AuthorizationEndpoint", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.AuthorizationServerContractProperties.GrantTypes", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.AuthorizationServerContractProperties.ClientID", Name: validation.Null, Rule: true, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("apimanagement.AuthorizationServerClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serviceName, authsid, parameters, ifMatch) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.AuthorizationServerClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.AuthorizationServerClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.AuthorizationServerClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client AuthorizationServerClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, authsid string, parameters AuthorizationServerContract, ifMatch string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "authsid": autorest.Encode("path", authsid), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/authorizationServers/{authsid}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + if len(ifMatch) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client AuthorizationServerClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client AuthorizationServerClient) CreateOrUpdateResponder(resp *http.Response) (result AuthorizationServerContract, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes specific authorization server instance. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// authsid - identifier of the authorization server. +// ifMatch - eTag of the Entity. ETag should match the current entity state from the header response of the GET +// request or it should be * for unconditional update. +func (client AuthorizationServerClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, authsid string, ifMatch string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: authsid, + Constraints: []validation.Constraint{{Target: "authsid", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "authsid", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "authsid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.AuthorizationServerClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, serviceName, authsid, ifMatch) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.AuthorizationServerClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.AuthorizationServerClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.AuthorizationServerClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client AuthorizationServerClient) DeletePreparer(ctx context.Context, resourceGroupName string, serviceName string, authsid string, ifMatch string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "authsid": autorest.Encode("path", authsid), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/authorizationServers/{authsid}", pathParameters), + autorest.WithQueryParameters(queryParameters), + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client AuthorizationServerClient) DeleteSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client AuthorizationServerClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the details of the authorization server specified by its identifier. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// authsid - identifier of the authorization server. +func (client AuthorizationServerClient) Get(ctx context.Context, resourceGroupName string, serviceName string, authsid string) (result AuthorizationServerContract, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: authsid, + Constraints: []validation.Constraint{{Target: "authsid", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "authsid", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "authsid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.AuthorizationServerClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, serviceName, authsid) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.AuthorizationServerClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.AuthorizationServerClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.AuthorizationServerClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client AuthorizationServerClient) GetPreparer(ctx context.Context, resourceGroupName string, serviceName string, authsid string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "authsid": autorest.Encode("path", authsid), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/authorizationServers/{authsid}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client AuthorizationServerClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client AuthorizationServerClient) GetResponder(resp *http.Response) (result AuthorizationServerContract, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetEntityTag gets the entity state (Etag) version of the authorizationServer specified by its identifier. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// authsid - identifier of the authorization server. +func (client AuthorizationServerClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, authsid string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: authsid, + Constraints: []validation.Constraint{{Target: "authsid", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "authsid", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "authsid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.AuthorizationServerClient", "GetEntityTag", err.Error()) + } + + req, err := client.GetEntityTagPreparer(ctx, resourceGroupName, serviceName, authsid) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.AuthorizationServerClient", "GetEntityTag", nil, "Failure preparing request") + return + } + + resp, err := client.GetEntityTagSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.AuthorizationServerClient", "GetEntityTag", resp, "Failure sending request") + return + } + + result, err = client.GetEntityTagResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.AuthorizationServerClient", "GetEntityTag", resp, "Failure responding to request") + } + + return +} + +// GetEntityTagPreparer prepares the GetEntityTag request. +func (client AuthorizationServerClient) GetEntityTagPreparer(ctx context.Context, resourceGroupName string, serviceName string, authsid string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "authsid": autorest.Encode("path", authsid), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsHead(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/authorizationServers/{authsid}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetEntityTagSender sends the GetEntityTag request. The method will close the +// http.Response Body if it receives an error. +func (client AuthorizationServerClient) GetEntityTagSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetEntityTagResponder handles the response to the GetEntityTag request. The method always +// closes the http.Response Body. +func (client AuthorizationServerClient) GetEntityTagResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// ListByService lists a collection of authorization servers defined within a service instance. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// filter - | Field | Supported operators | Supported functions | +// |-------|------------------------|---------------------------------------------| +// | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// top - number of records to return. +// skip - number of records to skip. +func (client AuthorizationServerClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (result AuthorizationServerCollectionPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: top, + Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}}}, + {TargetValue: skip, + Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("apimanagement.AuthorizationServerClient", "ListByService", err.Error()) + } + + result.fn = client.listByServiceNextResults + req, err := client.ListByServicePreparer(ctx, resourceGroupName, serviceName, filter, top, skip) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.AuthorizationServerClient", "ListByService", nil, "Failure preparing request") + return + } + + resp, err := client.ListByServiceSender(req) + if err != nil { + result.asc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.AuthorizationServerClient", "ListByService", resp, "Failure sending request") + return + } + + result.asc, err = client.ListByServiceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.AuthorizationServerClient", "ListByService", resp, "Failure responding to request") + } + + return +} + +// ListByServicePreparer prepares the ListByService request. +func (client AuthorizationServerClient) ListByServicePreparer(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + if skip != nil { + queryParameters["$skip"] = autorest.Encode("query", *skip) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/authorizationServers", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByServiceSender sends the ListByService request. The method will close the +// http.Response Body if it receives an error. +func (client AuthorizationServerClient) ListByServiceSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByServiceResponder handles the response to the ListByService request. The method always +// closes the http.Response Body. +func (client AuthorizationServerClient) ListByServiceResponder(resp *http.Response) (result AuthorizationServerCollection, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByServiceNextResults retrieves the next set of results, if any. +func (client AuthorizationServerClient) listByServiceNextResults(lastResults AuthorizationServerCollection) (result AuthorizationServerCollection, err error) { + req, err := lastResults.authorizationServerCollectionPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "apimanagement.AuthorizationServerClient", "listByServiceNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByServiceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "apimanagement.AuthorizationServerClient", "listByServiceNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByServiceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.AuthorizationServerClient", "listByServiceNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByServiceComplete enumerates all values, automatically crossing page boundaries as required. +func (client AuthorizationServerClient) ListByServiceComplete(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (result AuthorizationServerCollectionIterator, err error) { + result.page, err = client.ListByService(ctx, resourceGroupName, serviceName, filter, top, skip) + return +} + +// Update updates the details of the authorization server specified by its identifier. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// authsid - identifier of the authorization server. +// parameters - oAuth2 Server settings Update parameters. +// ifMatch - eTag of the Entity. ETag should match the current entity state from the header response of the GET +// request or it should be * for unconditional update. +func (client AuthorizationServerClient) Update(ctx context.Context, resourceGroupName string, serviceName string, authsid string, parameters AuthorizationServerUpdateContract, ifMatch string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: authsid, + Constraints: []validation.Constraint{{Target: "authsid", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "authsid", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "authsid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.AuthorizationServerClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, serviceName, authsid, parameters, ifMatch) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.AuthorizationServerClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.AuthorizationServerClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.AuthorizationServerClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client AuthorizationServerClient) UpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, authsid string, parameters AuthorizationServerUpdateContract, ifMatch string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "authsid": autorest.Encode("path", authsid), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/authorizationServers/{authsid}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters), + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client AuthorizationServerClient) UpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client AuthorizationServerClient) UpdateResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/backend.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/backend.go new file mode 100644 index 000000000..322362e05 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/backend.go @@ -0,0 +1,678 @@ +package apimanagement + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// BackendClient is the apiManagement Client +type BackendClient struct { + BaseClient +} + +// NewBackendClient creates an instance of the BackendClient client. +func NewBackendClient(subscriptionID string) BackendClient { + return NewBackendClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewBackendClientWithBaseURI creates an instance of the BackendClient client. +func NewBackendClientWithBaseURI(baseURI string, subscriptionID string) BackendClient { + return BackendClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or Updates a backend. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// backendid - identifier of the Backend entity. Must be unique in the current API Management service instance. +// parameters - create parameters. +// ifMatch - eTag of the Entity. Not required when creating an entity, but required when updating an entity. +func (client BackendClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, backendid string, parameters BackendContract, ifMatch string) (result BackendContract, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: backendid, + Constraints: []validation.Constraint{{Target: "backendid", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "backendid", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "backendid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.BackendContractProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.BackendContractProperties.URL", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.BackendContractProperties.URL", Name: validation.MaxLength, Rule: 2000, Chain: nil}, + {Target: "parameters.BackendContractProperties.URL", Name: validation.MinLength, Rule: 1, Chain: nil}, + }}, + }}}}}); err != nil { + return result, validation.NewError("apimanagement.BackendClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serviceName, backendid, parameters, ifMatch) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.BackendClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.BackendClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.BackendClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client BackendClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, backendid string, parameters BackendContract, ifMatch string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "backendid": autorest.Encode("path", backendid), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/backends/{backendid}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + if len(ifMatch) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client BackendClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client BackendClient) CreateOrUpdateResponder(resp *http.Response) (result BackendContract, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes the specified backend. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// backendid - identifier of the Backend entity. Must be unique in the current API Management service instance. +// ifMatch - eTag of the Entity. ETag should match the current entity state from the header response of the GET +// request or it should be * for unconditional update. +func (client BackendClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, backendid string, ifMatch string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: backendid, + Constraints: []validation.Constraint{{Target: "backendid", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "backendid", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "backendid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.BackendClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, serviceName, backendid, ifMatch) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.BackendClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.BackendClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.BackendClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client BackendClient) DeletePreparer(ctx context.Context, resourceGroupName string, serviceName string, backendid string, ifMatch string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "backendid": autorest.Encode("path", backendid), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/backends/{backendid}", pathParameters), + autorest.WithQueryParameters(queryParameters), + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client BackendClient) DeleteSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client BackendClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the details of the backend specified by its identifier. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// backendid - identifier of the Backend entity. Must be unique in the current API Management service instance. +func (client BackendClient) Get(ctx context.Context, resourceGroupName string, serviceName string, backendid string) (result BackendContract, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: backendid, + Constraints: []validation.Constraint{{Target: "backendid", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "backendid", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "backendid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.BackendClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, serviceName, backendid) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.BackendClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.BackendClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.BackendClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client BackendClient) GetPreparer(ctx context.Context, resourceGroupName string, serviceName string, backendid string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "backendid": autorest.Encode("path", backendid), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/backends/{backendid}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client BackendClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client BackendClient) GetResponder(resp *http.Response) (result BackendContract, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetEntityTag gets the entity state (Etag) version of the backend specified by its identifier. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// backendid - identifier of the Backend entity. Must be unique in the current API Management service instance. +func (client BackendClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, backendid string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: backendid, + Constraints: []validation.Constraint{{Target: "backendid", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "backendid", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "backendid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.BackendClient", "GetEntityTag", err.Error()) + } + + req, err := client.GetEntityTagPreparer(ctx, resourceGroupName, serviceName, backendid) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.BackendClient", "GetEntityTag", nil, "Failure preparing request") + return + } + + resp, err := client.GetEntityTagSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.BackendClient", "GetEntityTag", resp, "Failure sending request") + return + } + + result, err = client.GetEntityTagResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.BackendClient", "GetEntityTag", resp, "Failure responding to request") + } + + return +} + +// GetEntityTagPreparer prepares the GetEntityTag request. +func (client BackendClient) GetEntityTagPreparer(ctx context.Context, resourceGroupName string, serviceName string, backendid string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "backendid": autorest.Encode("path", backendid), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsHead(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/backends/{backendid}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetEntityTagSender sends the GetEntityTag request. The method will close the +// http.Response Body if it receives an error. +func (client BackendClient) GetEntityTagSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetEntityTagResponder handles the response to the GetEntityTag request. The method always +// closes the http.Response Body. +func (client BackendClient) GetEntityTagResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// ListByService lists a collection of backends in the specified service instance. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// filter - | Field | Supported operators | Supported functions | +// |-------|------------------------|---------------------------------------------| +// | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// | host | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// top - number of records to return. +// skip - number of records to skip. +func (client BackendClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (result BackendCollectionPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: top, + Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}}}, + {TargetValue: skip, + Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("apimanagement.BackendClient", "ListByService", err.Error()) + } + + result.fn = client.listByServiceNextResults + req, err := client.ListByServicePreparer(ctx, resourceGroupName, serviceName, filter, top, skip) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.BackendClient", "ListByService", nil, "Failure preparing request") + return + } + + resp, err := client.ListByServiceSender(req) + if err != nil { + result.bc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.BackendClient", "ListByService", resp, "Failure sending request") + return + } + + result.bc, err = client.ListByServiceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.BackendClient", "ListByService", resp, "Failure responding to request") + } + + return +} + +// ListByServicePreparer prepares the ListByService request. +func (client BackendClient) ListByServicePreparer(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + if skip != nil { + queryParameters["$skip"] = autorest.Encode("query", *skip) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/backends", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByServiceSender sends the ListByService request. The method will close the +// http.Response Body if it receives an error. +func (client BackendClient) ListByServiceSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByServiceResponder handles the response to the ListByService request. The method always +// closes the http.Response Body. +func (client BackendClient) ListByServiceResponder(resp *http.Response) (result BackendCollection, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByServiceNextResults retrieves the next set of results, if any. +func (client BackendClient) listByServiceNextResults(lastResults BackendCollection) (result BackendCollection, err error) { + req, err := lastResults.backendCollectionPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "apimanagement.BackendClient", "listByServiceNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByServiceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "apimanagement.BackendClient", "listByServiceNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByServiceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.BackendClient", "listByServiceNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByServiceComplete enumerates all values, automatically crossing page boundaries as required. +func (client BackendClient) ListByServiceComplete(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (result BackendCollectionIterator, err error) { + result.page, err = client.ListByService(ctx, resourceGroupName, serviceName, filter, top, skip) + return +} + +// Reconnect notifies the APIM proxy to create a new connection to the backend after the specified timeout. If no +// timeout was specified, timeout of 2 minutes is used. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// backendid - identifier of the Backend entity. Must be unique in the current API Management service instance. +// parameters - reconnect request parameters. +func (client BackendClient) Reconnect(ctx context.Context, resourceGroupName string, serviceName string, backendid string, parameters *BackendReconnectContract) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: backendid, + Constraints: []validation.Constraint{{Target: "backendid", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "backendid", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "backendid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.BackendClient", "Reconnect", err.Error()) + } + + req, err := client.ReconnectPreparer(ctx, resourceGroupName, serviceName, backendid, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.BackendClient", "Reconnect", nil, "Failure preparing request") + return + } + + resp, err := client.ReconnectSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.BackendClient", "Reconnect", resp, "Failure sending request") + return + } + + result, err = client.ReconnectResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.BackendClient", "Reconnect", resp, "Failure responding to request") + } + + return +} + +// ReconnectPreparer prepares the Reconnect request. +func (client BackendClient) ReconnectPreparer(ctx context.Context, resourceGroupName string, serviceName string, backendid string, parameters *BackendReconnectContract) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "backendid": autorest.Encode("path", backendid), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/backends/{backendid}/reconnect", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if parameters != nil { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithJSON(parameters)) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ReconnectSender sends the Reconnect request. The method will close the +// http.Response Body if it receives an error. +func (client BackendClient) ReconnectSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ReconnectResponder handles the response to the Reconnect request. The method always +// closes the http.Response Body. +func (client BackendClient) ReconnectResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// Update updates an existing backend. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// backendid - identifier of the Backend entity. Must be unique in the current API Management service instance. +// parameters - update parameters. +// ifMatch - eTag of the Entity. ETag should match the current entity state from the header response of the GET +// request or it should be * for unconditional update. +func (client BackendClient) Update(ctx context.Context, resourceGroupName string, serviceName string, backendid string, parameters BackendUpdateParameters, ifMatch string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: backendid, + Constraints: []validation.Constraint{{Target: "backendid", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "backendid", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "backendid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.BackendClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, serviceName, backendid, parameters, ifMatch) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.BackendClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.BackendClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.BackendClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client BackendClient) UpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, backendid string, parameters BackendUpdateParameters, ifMatch string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "backendid": autorest.Encode("path", backendid), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/backends/{backendid}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters), + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client BackendClient) UpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client BackendClient) UpdateResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/certificate.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/certificate.go new file mode 100644 index 000000000..239fbe59c --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/certificate.go @@ -0,0 +1,509 @@ +package apimanagement + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// CertificateClient is the apiManagement Client +type CertificateClient struct { + BaseClient +} + +// NewCertificateClient creates an instance of the CertificateClient client. +func NewCertificateClient(subscriptionID string) CertificateClient { + return NewCertificateClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewCertificateClientWithBaseURI creates an instance of the CertificateClient client. +func NewCertificateClientWithBaseURI(baseURI string, subscriptionID string) CertificateClient { + return CertificateClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or updates the certificate being used for authentication with the backend. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// certificateID - identifier of the certificate entity. Must be unique in the current API Management service +// instance. +// parameters - create or Update parameters. +// ifMatch - eTag of the Entity. Not required when creating an entity, but required when updating an entity. +func (client CertificateClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, certificateID string, parameters CertificateCreateOrUpdateParameters, ifMatch string) (result CertificateContract, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: certificateID, + Constraints: []validation.Constraint{{Target: "certificateID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "certificateID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "certificateID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.CertificateCreateOrUpdateProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.CertificateCreateOrUpdateProperties.Data", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.CertificateCreateOrUpdateProperties.Password", Name: validation.Null, Rule: true, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("apimanagement.CertificateClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serviceName, certificateID, parameters, ifMatch) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.CertificateClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.CertificateClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.CertificateClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client CertificateClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, certificateID string, parameters CertificateCreateOrUpdateParameters, ifMatch string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "certificateId": autorest.Encode("path", certificateID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/certificates/{certificateId}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + if len(ifMatch) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client CertificateClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client CertificateClient) CreateOrUpdateResponder(resp *http.Response) (result CertificateContract, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes specific certificate. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// certificateID - identifier of the certificate entity. Must be unique in the current API Management service +// instance. +// ifMatch - eTag of the Entity. ETag should match the current entity state from the header response of the GET +// request or it should be * for unconditional update. +func (client CertificateClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, certificateID string, ifMatch string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: certificateID, + Constraints: []validation.Constraint{{Target: "certificateID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "certificateID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "certificateID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.CertificateClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, serviceName, certificateID, ifMatch) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.CertificateClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.CertificateClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.CertificateClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client CertificateClient) DeletePreparer(ctx context.Context, resourceGroupName string, serviceName string, certificateID string, ifMatch string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "certificateId": autorest.Encode("path", certificateID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/certificates/{certificateId}", pathParameters), + autorest.WithQueryParameters(queryParameters), + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client CertificateClient) DeleteSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client CertificateClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the details of the certificate specified by its identifier. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// certificateID - identifier of the certificate entity. Must be unique in the current API Management service +// instance. +func (client CertificateClient) Get(ctx context.Context, resourceGroupName string, serviceName string, certificateID string) (result CertificateContract, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: certificateID, + Constraints: []validation.Constraint{{Target: "certificateID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "certificateID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "certificateID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.CertificateClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, serviceName, certificateID) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.CertificateClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.CertificateClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.CertificateClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client CertificateClient) GetPreparer(ctx context.Context, resourceGroupName string, serviceName string, certificateID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "certificateId": autorest.Encode("path", certificateID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/certificates/{certificateId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client CertificateClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client CertificateClient) GetResponder(resp *http.Response) (result CertificateContract, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetEntityTag gets the entity state (Etag) version of the certificate specified by its identifier. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// certificateID - identifier of the certificate entity. Must be unique in the current API Management service +// instance. +func (client CertificateClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, certificateID string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: certificateID, + Constraints: []validation.Constraint{{Target: "certificateID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "certificateID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "certificateID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.CertificateClient", "GetEntityTag", err.Error()) + } + + req, err := client.GetEntityTagPreparer(ctx, resourceGroupName, serviceName, certificateID) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.CertificateClient", "GetEntityTag", nil, "Failure preparing request") + return + } + + resp, err := client.GetEntityTagSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.CertificateClient", "GetEntityTag", resp, "Failure sending request") + return + } + + result, err = client.GetEntityTagResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.CertificateClient", "GetEntityTag", resp, "Failure responding to request") + } + + return +} + +// GetEntityTagPreparer prepares the GetEntityTag request. +func (client CertificateClient) GetEntityTagPreparer(ctx context.Context, resourceGroupName string, serviceName string, certificateID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "certificateId": autorest.Encode("path", certificateID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsHead(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/certificates/{certificateId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetEntityTagSender sends the GetEntityTag request. The method will close the +// http.Response Body if it receives an error. +func (client CertificateClient) GetEntityTagSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetEntityTagResponder handles the response to the GetEntityTag request. The method always +// closes the http.Response Body. +func (client CertificateClient) GetEntityTagResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// ListByService lists a collection of all certificates in the specified service instance. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// filter - | Field | Supported operators | Supported functions | +// |----------------|------------------------|---------------------------------------------| +// | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// | subject | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// | thumbprint | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// | expirationDate | ge, le, eq, ne, gt, lt | N/A | +// top - number of records to return. +// skip - number of records to skip. +func (client CertificateClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (result CertificateCollectionPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: top, + Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}}}, + {TargetValue: skip, + Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("apimanagement.CertificateClient", "ListByService", err.Error()) + } + + result.fn = client.listByServiceNextResults + req, err := client.ListByServicePreparer(ctx, resourceGroupName, serviceName, filter, top, skip) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.CertificateClient", "ListByService", nil, "Failure preparing request") + return + } + + resp, err := client.ListByServiceSender(req) + if err != nil { + result.cc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.CertificateClient", "ListByService", resp, "Failure sending request") + return + } + + result.cc, err = client.ListByServiceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.CertificateClient", "ListByService", resp, "Failure responding to request") + } + + return +} + +// ListByServicePreparer prepares the ListByService request. +func (client CertificateClient) ListByServicePreparer(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + if skip != nil { + queryParameters["$skip"] = autorest.Encode("query", *skip) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/certificates", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByServiceSender sends the ListByService request. The method will close the +// http.Response Body if it receives an error. +func (client CertificateClient) ListByServiceSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByServiceResponder handles the response to the ListByService request. The method always +// closes the http.Response Body. +func (client CertificateClient) ListByServiceResponder(resp *http.Response) (result CertificateCollection, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByServiceNextResults retrieves the next set of results, if any. +func (client CertificateClient) listByServiceNextResults(lastResults CertificateCollection) (result CertificateCollection, err error) { + req, err := lastResults.certificateCollectionPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "apimanagement.CertificateClient", "listByServiceNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByServiceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "apimanagement.CertificateClient", "listByServiceNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByServiceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.CertificateClient", "listByServiceNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByServiceComplete enumerates all values, automatically crossing page boundaries as required. +func (client CertificateClient) ListByServiceComplete(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (result CertificateCollectionIterator, err error) { + result.page, err = client.ListByService(ctx, resourceGroupName, serviceName, filter, top, skip) + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/client.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/client.go new file mode 100644 index 000000000..6f9a3b876 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/client.go @@ -0,0 +1,51 @@ +// Package apimanagement implements the Azure ARM Apimanagement service API version 2018-06-01-preview. +// +// ApiManagement Client +package apimanagement + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/Azure/go-autorest/autorest" +) + +const ( + // DefaultBaseURI is the default URI used for the service Apimanagement + DefaultBaseURI = "https://management.azure.com" +) + +// BaseClient is the base client for Apimanagement. +type BaseClient struct { + autorest.Client + BaseURI string + SubscriptionID string +} + +// New creates an instance of the BaseClient client. +func New(subscriptionID string) BaseClient { + return NewWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewWithBaseURI creates an instance of the BaseClient client. +func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { + return BaseClient{ + Client: autorest.NewClientWithUserAgent(UserAgent()), + BaseURI: baseURI, + SubscriptionID: subscriptionID, + } +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/delegationsettings.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/delegationsettings.go new file mode 100644 index 000000000..e4dd04a25 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/delegationsettings.go @@ -0,0 +1,348 @@ +package apimanagement + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// DelegationSettingsClient is the apiManagement Client +type DelegationSettingsClient struct { + BaseClient +} + +// NewDelegationSettingsClient creates an instance of the DelegationSettingsClient client. +func NewDelegationSettingsClient(subscriptionID string) DelegationSettingsClient { + return NewDelegationSettingsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewDelegationSettingsClientWithBaseURI creates an instance of the DelegationSettingsClient client. +func NewDelegationSettingsClientWithBaseURI(baseURI string, subscriptionID string) DelegationSettingsClient { + return DelegationSettingsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate create or Update Delegation settings. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// parameters - create or update parameters. +func (client DelegationSettingsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, parameters PortalDelegationSettings) (result PortalDelegationSettings, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.DelegationSettingsClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serviceName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.DelegationSettingsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.DelegationSettingsClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.DelegationSettingsClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client DelegationSettingsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, parameters PortalDelegationSettings) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/delegation", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client DelegationSettingsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client DelegationSettingsClient) CreateOrUpdateResponder(resp *http.Response) (result PortalDelegationSettings, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get get Delegation settings. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +func (client DelegationSettingsClient) Get(ctx context.Context, resourceGroupName string, serviceName string) (result PortalDelegationSettings, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.DelegationSettingsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, serviceName) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.DelegationSettingsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.DelegationSettingsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.DelegationSettingsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client DelegationSettingsClient) GetPreparer(ctx context.Context, resourceGroupName string, serviceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/delegation", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client DelegationSettingsClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client DelegationSettingsClient) GetResponder(resp *http.Response) (result PortalDelegationSettings, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetEntityTag gets the entity state (Etag) version of the DelegationSettings. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +func (client DelegationSettingsClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.DelegationSettingsClient", "GetEntityTag", err.Error()) + } + + req, err := client.GetEntityTagPreparer(ctx, resourceGroupName, serviceName) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.DelegationSettingsClient", "GetEntityTag", nil, "Failure preparing request") + return + } + + resp, err := client.GetEntityTagSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.DelegationSettingsClient", "GetEntityTag", resp, "Failure sending request") + return + } + + result, err = client.GetEntityTagResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.DelegationSettingsClient", "GetEntityTag", resp, "Failure responding to request") + } + + return +} + +// GetEntityTagPreparer prepares the GetEntityTag request. +func (client DelegationSettingsClient) GetEntityTagPreparer(ctx context.Context, resourceGroupName string, serviceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsHead(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/delegation", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetEntityTagSender sends the GetEntityTag request. The method will close the +// http.Response Body if it receives an error. +func (client DelegationSettingsClient) GetEntityTagSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetEntityTagResponder handles the response to the GetEntityTag request. The method always +// closes the http.Response Body. +func (client DelegationSettingsClient) GetEntityTagResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Update update Delegation settings. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// parameters - update Delegation settings. +// ifMatch - eTag of the Entity. ETag should match the current entity state from the header response of the GET +// request or it should be * for unconditional update. +func (client DelegationSettingsClient) Update(ctx context.Context, resourceGroupName string, serviceName string, parameters PortalDelegationSettings, ifMatch string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.DelegationSettingsClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, serviceName, parameters, ifMatch) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.DelegationSettingsClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.DelegationSettingsClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.DelegationSettingsClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client DelegationSettingsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, parameters PortalDelegationSettings, ifMatch string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/delegation", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters), + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client DelegationSettingsClient) UpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client DelegationSettingsClient) UpdateResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/diagnostic.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/diagnostic.go new file mode 100644 index 000000000..97cba40b1 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/diagnostic.go @@ -0,0 +1,621 @@ +package apimanagement + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// DiagnosticClient is the apiManagement Client +type DiagnosticClient struct { + BaseClient +} + +// NewDiagnosticClient creates an instance of the DiagnosticClient client. +func NewDiagnosticClient(subscriptionID string) DiagnosticClient { + return NewDiagnosticClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewDiagnosticClientWithBaseURI creates an instance of the DiagnosticClient client. +func NewDiagnosticClientWithBaseURI(baseURI string, subscriptionID string) DiagnosticClient { + return DiagnosticClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates a new Diagnostic or updates an existing one. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// diagnosticID - diagnostic identifier. Must be unique in the current API Management service instance. +// parameters - create parameters. +// ifMatch - eTag of the Entity. Not required when creating an entity, but required when updating an entity. +func (client DiagnosticClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, diagnosticID string, parameters DiagnosticContract, ifMatch string) (result DiagnosticContract, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: diagnosticID, + Constraints: []validation.Constraint{{Target: "diagnosticID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "diagnosticID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "diagnosticID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.DiagnosticContractProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.DiagnosticContractProperties.LoggerID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.DiagnosticContractProperties.Sampling", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.DiagnosticContractProperties.Sampling.Percentage", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.DiagnosticContractProperties.Sampling.Percentage", Name: validation.InclusiveMaximum, Rule: int64(100), Chain: nil}, + {Target: "parameters.DiagnosticContractProperties.Sampling.Percentage", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, + }}, + }}, + {Target: "parameters.DiagnosticContractProperties.Frontend", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.DiagnosticContractProperties.Frontend.Request", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.DiagnosticContractProperties.Frontend.Request.Body", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.DiagnosticContractProperties.Frontend.Request.Body.Bytes", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.DiagnosticContractProperties.Frontend.Request.Body.Bytes", Name: validation.InclusiveMaximum, Rule: int64(8192), Chain: nil}}}, + }}, + }}, + {Target: "parameters.DiagnosticContractProperties.Frontend.Response", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.DiagnosticContractProperties.Frontend.Response.Body", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.DiagnosticContractProperties.Frontend.Response.Body.Bytes", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.DiagnosticContractProperties.Frontend.Response.Body.Bytes", Name: validation.InclusiveMaximum, Rule: int64(8192), Chain: nil}}}, + }}, + }}, + }}, + {Target: "parameters.DiagnosticContractProperties.Backend", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.DiagnosticContractProperties.Backend.Request", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.DiagnosticContractProperties.Backend.Request.Body", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.DiagnosticContractProperties.Backend.Request.Body.Bytes", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.DiagnosticContractProperties.Backend.Request.Body.Bytes", Name: validation.InclusiveMaximum, Rule: int64(8192), Chain: nil}}}, + }}, + }}, + {Target: "parameters.DiagnosticContractProperties.Backend.Response", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.DiagnosticContractProperties.Backend.Response.Body", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.DiagnosticContractProperties.Backend.Response.Body.Bytes", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.DiagnosticContractProperties.Backend.Response.Body.Bytes", Name: validation.InclusiveMaximum, Rule: int64(8192), Chain: nil}}}, + }}, + }}, + }}, + }}}}}); err != nil { + return result, validation.NewError("apimanagement.DiagnosticClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serviceName, diagnosticID, parameters, ifMatch) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.DiagnosticClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.DiagnosticClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.DiagnosticClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client DiagnosticClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, diagnosticID string, parameters DiagnosticContract, ifMatch string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "diagnosticId": autorest.Encode("path", diagnosticID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/diagnostics/{diagnosticId}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + if len(ifMatch) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client DiagnosticClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client DiagnosticClient) CreateOrUpdateResponder(resp *http.Response) (result DiagnosticContract, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes the specified Diagnostic. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// diagnosticID - diagnostic identifier. Must be unique in the current API Management service instance. +// ifMatch - eTag of the Entity. ETag should match the current entity state from the header response of the GET +// request or it should be * for unconditional update. +func (client DiagnosticClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, diagnosticID string, ifMatch string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: diagnosticID, + Constraints: []validation.Constraint{{Target: "diagnosticID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "diagnosticID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "diagnosticID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.DiagnosticClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, serviceName, diagnosticID, ifMatch) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.DiagnosticClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.DiagnosticClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.DiagnosticClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client DiagnosticClient) DeletePreparer(ctx context.Context, resourceGroupName string, serviceName string, diagnosticID string, ifMatch string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "diagnosticId": autorest.Encode("path", diagnosticID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/diagnostics/{diagnosticId}", pathParameters), + autorest.WithQueryParameters(queryParameters), + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client DiagnosticClient) DeleteSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client DiagnosticClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the details of the Diagnostic specified by its identifier. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// diagnosticID - diagnostic identifier. Must be unique in the current API Management service instance. +func (client DiagnosticClient) Get(ctx context.Context, resourceGroupName string, serviceName string, diagnosticID string) (result DiagnosticContract, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: diagnosticID, + Constraints: []validation.Constraint{{Target: "diagnosticID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "diagnosticID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "diagnosticID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.DiagnosticClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, serviceName, diagnosticID) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.DiagnosticClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.DiagnosticClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.DiagnosticClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client DiagnosticClient) GetPreparer(ctx context.Context, resourceGroupName string, serviceName string, diagnosticID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "diagnosticId": autorest.Encode("path", diagnosticID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/diagnostics/{diagnosticId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client DiagnosticClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client DiagnosticClient) GetResponder(resp *http.Response) (result DiagnosticContract, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetEntityTag gets the entity state (Etag) version of the Diagnostic specified by its identifier. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// diagnosticID - diagnostic identifier. Must be unique in the current API Management service instance. +func (client DiagnosticClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, diagnosticID string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: diagnosticID, + Constraints: []validation.Constraint{{Target: "diagnosticID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "diagnosticID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "diagnosticID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.DiagnosticClient", "GetEntityTag", err.Error()) + } + + req, err := client.GetEntityTagPreparer(ctx, resourceGroupName, serviceName, diagnosticID) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.DiagnosticClient", "GetEntityTag", nil, "Failure preparing request") + return + } + + resp, err := client.GetEntityTagSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.DiagnosticClient", "GetEntityTag", resp, "Failure sending request") + return + } + + result, err = client.GetEntityTagResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.DiagnosticClient", "GetEntityTag", resp, "Failure responding to request") + } + + return +} + +// GetEntityTagPreparer prepares the GetEntityTag request. +func (client DiagnosticClient) GetEntityTagPreparer(ctx context.Context, resourceGroupName string, serviceName string, diagnosticID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "diagnosticId": autorest.Encode("path", diagnosticID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsHead(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/diagnostics/{diagnosticId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetEntityTagSender sends the GetEntityTag request. The method will close the +// http.Response Body if it receives an error. +func (client DiagnosticClient) GetEntityTagSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetEntityTagResponder handles the response to the GetEntityTag request. The method always +// closes the http.Response Body. +func (client DiagnosticClient) GetEntityTagResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// ListByService lists all diagnostics of the API Management service instance. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// filter - | Field | Supported operators | Supported functions | +// |-------------|------------------------|-----------------------------------| +// | id | ge, le, eq, ne, gt, lt | substringof, startswith, endswith | +// top - number of records to return. +// skip - number of records to skip. +func (client DiagnosticClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (result DiagnosticCollectionPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: top, + Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}}}, + {TargetValue: skip, + Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("apimanagement.DiagnosticClient", "ListByService", err.Error()) + } + + result.fn = client.listByServiceNextResults + req, err := client.ListByServicePreparer(ctx, resourceGroupName, serviceName, filter, top, skip) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.DiagnosticClient", "ListByService", nil, "Failure preparing request") + return + } + + resp, err := client.ListByServiceSender(req) + if err != nil { + result.dc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.DiagnosticClient", "ListByService", resp, "Failure sending request") + return + } + + result.dc, err = client.ListByServiceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.DiagnosticClient", "ListByService", resp, "Failure responding to request") + } + + return +} + +// ListByServicePreparer prepares the ListByService request. +func (client DiagnosticClient) ListByServicePreparer(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + if skip != nil { + queryParameters["$skip"] = autorest.Encode("query", *skip) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/diagnostics", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByServiceSender sends the ListByService request. The method will close the +// http.Response Body if it receives an error. +func (client DiagnosticClient) ListByServiceSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByServiceResponder handles the response to the ListByService request. The method always +// closes the http.Response Body. +func (client DiagnosticClient) ListByServiceResponder(resp *http.Response) (result DiagnosticCollection, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByServiceNextResults retrieves the next set of results, if any. +func (client DiagnosticClient) listByServiceNextResults(lastResults DiagnosticCollection) (result DiagnosticCollection, err error) { + req, err := lastResults.diagnosticCollectionPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "apimanagement.DiagnosticClient", "listByServiceNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByServiceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "apimanagement.DiagnosticClient", "listByServiceNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByServiceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.DiagnosticClient", "listByServiceNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByServiceComplete enumerates all values, automatically crossing page boundaries as required. +func (client DiagnosticClient) ListByServiceComplete(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (result DiagnosticCollectionIterator, err error) { + result.page, err = client.ListByService(ctx, resourceGroupName, serviceName, filter, top, skip) + return +} + +// Update updates the details of the Diagnostic specified by its identifier. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// diagnosticID - diagnostic identifier. Must be unique in the current API Management service instance. +// parameters - diagnostic Update parameters. +// ifMatch - eTag of the Entity. ETag should match the current entity state from the header response of the GET +// request or it should be * for unconditional update. +func (client DiagnosticClient) Update(ctx context.Context, resourceGroupName string, serviceName string, diagnosticID string, parameters DiagnosticContract, ifMatch string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: diagnosticID, + Constraints: []validation.Constraint{{Target: "diagnosticID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "diagnosticID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "diagnosticID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.DiagnosticClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, serviceName, diagnosticID, parameters, ifMatch) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.DiagnosticClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.DiagnosticClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.DiagnosticClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client DiagnosticClient) UpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, diagnosticID string, parameters DiagnosticContract, ifMatch string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "diagnosticId": autorest.Encode("path", diagnosticID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/diagnostics/{diagnosticId}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters), + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client DiagnosticClient) UpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client DiagnosticClient) UpdateResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/emailtemplate.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/emailtemplate.go new file mode 100644 index 000000000..d5d063297 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/emailtemplate.go @@ -0,0 +1,563 @@ +package apimanagement + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// EmailTemplateClient is the apiManagement Client +type EmailTemplateClient struct { + BaseClient +} + +// NewEmailTemplateClient creates an instance of the EmailTemplateClient client. +func NewEmailTemplateClient(subscriptionID string) EmailTemplateClient { + return NewEmailTemplateClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewEmailTemplateClientWithBaseURI creates an instance of the EmailTemplateClient client. +func NewEmailTemplateClientWithBaseURI(baseURI string, subscriptionID string) EmailTemplateClient { + return EmailTemplateClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate updates an Email Template. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// templateName - email Template Name Identifier. +// parameters - email Template update parameters. +// ifMatch - eTag of the Entity. Not required when creating an entity, but required when updating an entity. +func (client EmailTemplateClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, templateName TemplateName, parameters EmailTemplateUpdateParameters, ifMatch string) (result EmailTemplateContract, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.EmailTemplateUpdateParameterProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.EmailTemplateUpdateParameterProperties.Subject", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.EmailTemplateUpdateParameterProperties.Subject", Name: validation.MaxLength, Rule: 1000, Chain: nil}, + {Target: "parameters.EmailTemplateUpdateParameterProperties.Subject", Name: validation.MinLength, Rule: 1, Chain: nil}, + }}, + {Target: "parameters.EmailTemplateUpdateParameterProperties.Body", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.EmailTemplateUpdateParameterProperties.Body", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + }}}}}); err != nil { + return result, validation.NewError("apimanagement.EmailTemplateClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serviceName, templateName, parameters, ifMatch) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.EmailTemplateClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.EmailTemplateClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.EmailTemplateClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client EmailTemplateClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, templateName TemplateName, parameters EmailTemplateUpdateParameters, ifMatch string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "templateName": autorest.Encode("path", templateName), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/templates/{templateName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + if len(ifMatch) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client EmailTemplateClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client EmailTemplateClient) CreateOrUpdateResponder(resp *http.Response) (result EmailTemplateContract, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete reset the Email Template to default template provided by the API Management service instance. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// templateName - email Template Name Identifier. +// ifMatch - eTag of the Entity. ETag should match the current entity state from the header response of the GET +// request or it should be * for unconditional update. +func (client EmailTemplateClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, templateName TemplateName, ifMatch string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.EmailTemplateClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, serviceName, templateName, ifMatch) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.EmailTemplateClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.EmailTemplateClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.EmailTemplateClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client EmailTemplateClient) DeletePreparer(ctx context.Context, resourceGroupName string, serviceName string, templateName TemplateName, ifMatch string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "templateName": autorest.Encode("path", templateName), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/templates/{templateName}", pathParameters), + autorest.WithQueryParameters(queryParameters), + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client EmailTemplateClient) DeleteSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client EmailTemplateClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the details of the email template specified by its identifier. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// templateName - email Template Name Identifier. +func (client EmailTemplateClient) Get(ctx context.Context, resourceGroupName string, serviceName string, templateName TemplateName) (result EmailTemplateContract, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.EmailTemplateClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, serviceName, templateName) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.EmailTemplateClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.EmailTemplateClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.EmailTemplateClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client EmailTemplateClient) GetPreparer(ctx context.Context, resourceGroupName string, serviceName string, templateName TemplateName) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "templateName": autorest.Encode("path", templateName), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/templates/{templateName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client EmailTemplateClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client EmailTemplateClient) GetResponder(resp *http.Response) (result EmailTemplateContract, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetEntityTag gets the entity state (Etag) version of the email template specified by its identifier. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// templateName - email Template Name Identifier. +func (client EmailTemplateClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, templateName TemplateName) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.EmailTemplateClient", "GetEntityTag", err.Error()) + } + + req, err := client.GetEntityTagPreparer(ctx, resourceGroupName, serviceName, templateName) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.EmailTemplateClient", "GetEntityTag", nil, "Failure preparing request") + return + } + + resp, err := client.GetEntityTagSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.EmailTemplateClient", "GetEntityTag", resp, "Failure sending request") + return + } + + result, err = client.GetEntityTagResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.EmailTemplateClient", "GetEntityTag", resp, "Failure responding to request") + } + + return +} + +// GetEntityTagPreparer prepares the GetEntityTag request. +func (client EmailTemplateClient) GetEntityTagPreparer(ctx context.Context, resourceGroupName string, serviceName string, templateName TemplateName) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "templateName": autorest.Encode("path", templateName), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsHead(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/templates/{templateName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetEntityTagSender sends the GetEntityTag request. The method will close the +// http.Response Body if it receives an error. +func (client EmailTemplateClient) GetEntityTagSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetEntityTagResponder handles the response to the GetEntityTag request. The method always +// closes the http.Response Body. +func (client EmailTemplateClient) GetEntityTagResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// ListByService lists a collection of properties defined within a service instance. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// top - number of records to return. +// skip - number of records to skip. +func (client EmailTemplateClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, top *int32, skip *int32) (result EmailTemplateCollectionPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: top, + Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}}}, + {TargetValue: skip, + Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("apimanagement.EmailTemplateClient", "ListByService", err.Error()) + } + + result.fn = client.listByServiceNextResults + req, err := client.ListByServicePreparer(ctx, resourceGroupName, serviceName, top, skip) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.EmailTemplateClient", "ListByService", nil, "Failure preparing request") + return + } + + resp, err := client.ListByServiceSender(req) + if err != nil { + result.etc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.EmailTemplateClient", "ListByService", resp, "Failure sending request") + return + } + + result.etc, err = client.ListByServiceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.EmailTemplateClient", "ListByService", resp, "Failure responding to request") + } + + return +} + +// ListByServicePreparer prepares the ListByService request. +func (client EmailTemplateClient) ListByServicePreparer(ctx context.Context, resourceGroupName string, serviceName string, top *int32, skip *int32) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + if skip != nil { + queryParameters["$skip"] = autorest.Encode("query", *skip) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/templates", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByServiceSender sends the ListByService request. The method will close the +// http.Response Body if it receives an error. +func (client EmailTemplateClient) ListByServiceSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByServiceResponder handles the response to the ListByService request. The method always +// closes the http.Response Body. +func (client EmailTemplateClient) ListByServiceResponder(resp *http.Response) (result EmailTemplateCollection, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByServiceNextResults retrieves the next set of results, if any. +func (client EmailTemplateClient) listByServiceNextResults(lastResults EmailTemplateCollection) (result EmailTemplateCollection, err error) { + req, err := lastResults.emailTemplateCollectionPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "apimanagement.EmailTemplateClient", "listByServiceNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByServiceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "apimanagement.EmailTemplateClient", "listByServiceNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByServiceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.EmailTemplateClient", "listByServiceNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByServiceComplete enumerates all values, automatically crossing page boundaries as required. +func (client EmailTemplateClient) ListByServiceComplete(ctx context.Context, resourceGroupName string, serviceName string, top *int32, skip *int32) (result EmailTemplateCollectionIterator, err error) { + result.page, err = client.ListByService(ctx, resourceGroupName, serviceName, top, skip) + return +} + +// Update updates the specific Email Template. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// templateName - email Template Name Identifier. +// parameters - update parameters. +func (client EmailTemplateClient) Update(ctx context.Context, resourceGroupName string, serviceName string, templateName TemplateName, parameters EmailTemplateUpdateParameters) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.EmailTemplateClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, serviceName, templateName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.EmailTemplateClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.EmailTemplateClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.EmailTemplateClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client EmailTemplateClient) UpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, templateName TemplateName, parameters EmailTemplateUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "templateName": autorest.Encode("path", templateName), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/templates/{templateName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client EmailTemplateClient) UpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client EmailTemplateClient) UpdateResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/group.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/group.go new file mode 100644 index 000000000..563c7e3ca --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/group.go @@ -0,0 +1,593 @@ +package apimanagement + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// GroupClient is the apiManagement Client +type GroupClient struct { + BaseClient +} + +// NewGroupClient creates an instance of the GroupClient client. +func NewGroupClient(subscriptionID string) GroupClient { + return NewGroupClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewGroupClientWithBaseURI creates an instance of the GroupClient client. +func NewGroupClientWithBaseURI(baseURI string, subscriptionID string) GroupClient { + return GroupClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or Updates a group. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// groupID - group identifier. Must be unique in the current API Management service instance. +// parameters - create parameters. +// ifMatch - eTag of the Entity. Not required when creating an entity, but required when updating an entity. +func (client GroupClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, groupID string, parameters GroupCreateParameters, ifMatch string) (result GroupContract, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: groupID, + Constraints: []validation.Constraint{{Target: "groupID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "groupID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "groupID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.GroupCreateParametersProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.GroupCreateParametersProperties.DisplayName", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.GroupCreateParametersProperties.DisplayName", Name: validation.MaxLength, Rule: 300, Chain: nil}, + {Target: "parameters.GroupCreateParametersProperties.DisplayName", Name: validation.MinLength, Rule: 1, Chain: nil}, + }}, + }}}}}); err != nil { + return result, validation.NewError("apimanagement.GroupClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serviceName, groupID, parameters, ifMatch) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.GroupClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.GroupClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.GroupClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client GroupClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, groupID string, parameters GroupCreateParameters, ifMatch string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "groupId": autorest.Encode("path", groupID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/groups/{groupId}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + if len(ifMatch) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client GroupClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client GroupClient) CreateOrUpdateResponder(resp *http.Response) (result GroupContract, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes specific group of the API Management service instance. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// groupID - group identifier. Must be unique in the current API Management service instance. +// ifMatch - eTag of the Entity. ETag should match the current entity state from the header response of the GET +// request or it should be * for unconditional update. +func (client GroupClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, groupID string, ifMatch string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: groupID, + Constraints: []validation.Constraint{{Target: "groupID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "groupID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "groupID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.GroupClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, serviceName, groupID, ifMatch) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.GroupClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.GroupClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.GroupClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client GroupClient) DeletePreparer(ctx context.Context, resourceGroupName string, serviceName string, groupID string, ifMatch string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "groupId": autorest.Encode("path", groupID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/groups/{groupId}", pathParameters), + autorest.WithQueryParameters(queryParameters), + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client GroupClient) DeleteSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client GroupClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the details of the group specified by its identifier. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// groupID - group identifier. Must be unique in the current API Management service instance. +func (client GroupClient) Get(ctx context.Context, resourceGroupName string, serviceName string, groupID string) (result GroupContract, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: groupID, + Constraints: []validation.Constraint{{Target: "groupID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "groupID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "groupID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.GroupClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, serviceName, groupID) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.GroupClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.GroupClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.GroupClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client GroupClient) GetPreparer(ctx context.Context, resourceGroupName string, serviceName string, groupID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "groupId": autorest.Encode("path", groupID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/groups/{groupId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client GroupClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client GroupClient) GetResponder(resp *http.Response) (result GroupContract, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetEntityTag gets the entity state (Etag) version of the group specified by its identifier. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// groupID - group identifier. Must be unique in the current API Management service instance. +func (client GroupClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, groupID string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: groupID, + Constraints: []validation.Constraint{{Target: "groupID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "groupID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "groupID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.GroupClient", "GetEntityTag", err.Error()) + } + + req, err := client.GetEntityTagPreparer(ctx, resourceGroupName, serviceName, groupID) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.GroupClient", "GetEntityTag", nil, "Failure preparing request") + return + } + + resp, err := client.GetEntityTagSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.GroupClient", "GetEntityTag", resp, "Failure sending request") + return + } + + result, err = client.GetEntityTagResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.GroupClient", "GetEntityTag", resp, "Failure responding to request") + } + + return +} + +// GetEntityTagPreparer prepares the GetEntityTag request. +func (client GroupClient) GetEntityTagPreparer(ctx context.Context, resourceGroupName string, serviceName string, groupID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "groupId": autorest.Encode("path", groupID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsHead(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/groups/{groupId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetEntityTagSender sends the GetEntityTag request. The method will close the +// http.Response Body if it receives an error. +func (client GroupClient) GetEntityTagSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetEntityTagResponder handles the response to the GetEntityTag request. The method always +// closes the http.Response Body. +func (client GroupClient) GetEntityTagResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// ListByService lists a collection of groups defined within a service instance. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// filter - | Field | Supported operators | Supported functions | +// |-------------|------------------------|---------------------------------------------| +// | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// | description | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// | type | eq, ne | N/A | +// top - number of records to return. +// skip - number of records to skip. +func (client GroupClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (result GroupCollectionPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: top, + Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}}}, + {TargetValue: skip, + Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("apimanagement.GroupClient", "ListByService", err.Error()) + } + + result.fn = client.listByServiceNextResults + req, err := client.ListByServicePreparer(ctx, resourceGroupName, serviceName, filter, top, skip) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.GroupClient", "ListByService", nil, "Failure preparing request") + return + } + + resp, err := client.ListByServiceSender(req) + if err != nil { + result.gc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.GroupClient", "ListByService", resp, "Failure sending request") + return + } + + result.gc, err = client.ListByServiceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.GroupClient", "ListByService", resp, "Failure responding to request") + } + + return +} + +// ListByServicePreparer prepares the ListByService request. +func (client GroupClient) ListByServicePreparer(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + if skip != nil { + queryParameters["$skip"] = autorest.Encode("query", *skip) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/groups", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByServiceSender sends the ListByService request. The method will close the +// http.Response Body if it receives an error. +func (client GroupClient) ListByServiceSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByServiceResponder handles the response to the ListByService request. The method always +// closes the http.Response Body. +func (client GroupClient) ListByServiceResponder(resp *http.Response) (result GroupCollection, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByServiceNextResults retrieves the next set of results, if any. +func (client GroupClient) listByServiceNextResults(lastResults GroupCollection) (result GroupCollection, err error) { + req, err := lastResults.groupCollectionPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "apimanagement.GroupClient", "listByServiceNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByServiceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "apimanagement.GroupClient", "listByServiceNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByServiceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.GroupClient", "listByServiceNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByServiceComplete enumerates all values, automatically crossing page boundaries as required. +func (client GroupClient) ListByServiceComplete(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (result GroupCollectionIterator, err error) { + result.page, err = client.ListByService(ctx, resourceGroupName, serviceName, filter, top, skip) + return +} + +// Update updates the details of the group specified by its identifier. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// groupID - group identifier. Must be unique in the current API Management service instance. +// parameters - update parameters. +// ifMatch - eTag of the Entity. ETag should match the current entity state from the header response of the GET +// request or it should be * for unconditional update. +func (client GroupClient) Update(ctx context.Context, resourceGroupName string, serviceName string, groupID string, parameters GroupUpdateParameters, ifMatch string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: groupID, + Constraints: []validation.Constraint{{Target: "groupID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "groupID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "groupID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.GroupClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, serviceName, groupID, parameters, ifMatch) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.GroupClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.GroupClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.GroupClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client GroupClient) UpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, groupID string, parameters GroupUpdateParameters, ifMatch string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "groupId": autorest.Encode("path", groupID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/groups/{groupId}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters), + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client GroupClient) UpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client GroupClient) UpdateResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/groupuser.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/groupuser.go new file mode 100644 index 000000000..4c246c4e4 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/groupuser.go @@ -0,0 +1,435 @@ +package apimanagement + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// GroupUserClient is the apiManagement Client +type GroupUserClient struct { + BaseClient +} + +// NewGroupUserClient creates an instance of the GroupUserClient client. +func NewGroupUserClient(subscriptionID string) GroupUserClient { + return NewGroupUserClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewGroupUserClientWithBaseURI creates an instance of the GroupUserClient client. +func NewGroupUserClientWithBaseURI(baseURI string, subscriptionID string) GroupUserClient { + return GroupUserClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CheckEntityExists checks that user entity specified by identifier is associated with the group entity. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// groupID - group identifier. Must be unique in the current API Management service instance. +// UID - user identifier. Must be unique in the current API Management service instance. +func (client GroupUserClient) CheckEntityExists(ctx context.Context, resourceGroupName string, serviceName string, groupID string, UID string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: groupID, + Constraints: []validation.Constraint{{Target: "groupID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "groupID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "groupID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {TargetValue: UID, + Constraints: []validation.Constraint{{Target: "UID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "UID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "UID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.GroupUserClient", "CheckEntityExists", err.Error()) + } + + req, err := client.CheckEntityExistsPreparer(ctx, resourceGroupName, serviceName, groupID, UID) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.GroupUserClient", "CheckEntityExists", nil, "Failure preparing request") + return + } + + resp, err := client.CheckEntityExistsSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.GroupUserClient", "CheckEntityExists", resp, "Failure sending request") + return + } + + result, err = client.CheckEntityExistsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.GroupUserClient", "CheckEntityExists", resp, "Failure responding to request") + } + + return +} + +// CheckEntityExistsPreparer prepares the CheckEntityExists request. +func (client GroupUserClient) CheckEntityExistsPreparer(ctx context.Context, resourceGroupName string, serviceName string, groupID string, UID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "groupId": autorest.Encode("path", groupID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "uid": autorest.Encode("path", UID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsHead(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/groups/{groupId}/users/{uid}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CheckEntityExistsSender sends the CheckEntityExists request. The method will close the +// http.Response Body if it receives an error. +func (client GroupUserClient) CheckEntityExistsSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// CheckEntityExistsResponder handles the response to the CheckEntityExists request. The method always +// closes the http.Response Body. +func (client GroupUserClient) CheckEntityExistsResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent, http.StatusNotFound), + autorest.ByClosing()) + result.Response = resp + return +} + +// Create adds a user to the specified group. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// groupID - group identifier. Must be unique in the current API Management service instance. +// UID - user identifier. Must be unique in the current API Management service instance. +func (client GroupUserClient) Create(ctx context.Context, resourceGroupName string, serviceName string, groupID string, UID string) (result UserContract, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: groupID, + Constraints: []validation.Constraint{{Target: "groupID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "groupID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "groupID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {TargetValue: UID, + Constraints: []validation.Constraint{{Target: "UID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "UID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "UID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.GroupUserClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, resourceGroupName, serviceName, groupID, UID) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.GroupUserClient", "Create", nil, "Failure preparing request") + return + } + + resp, err := client.CreateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.GroupUserClient", "Create", resp, "Failure sending request") + return + } + + result, err = client.CreateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.GroupUserClient", "Create", resp, "Failure responding to request") + } + + return +} + +// CreatePreparer prepares the Create request. +func (client GroupUserClient) CreatePreparer(ctx context.Context, resourceGroupName string, serviceName string, groupID string, UID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "groupId": autorest.Encode("path", groupID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "uid": autorest.Encode("path", UID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/groups/{groupId}/users/{uid}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client GroupUserClient) CreateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client GroupUserClient) CreateResponder(resp *http.Response) (result UserContract, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete remove existing user from existing group. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// groupID - group identifier. Must be unique in the current API Management service instance. +// UID - user identifier. Must be unique in the current API Management service instance. +func (client GroupUserClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, groupID string, UID string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: groupID, + Constraints: []validation.Constraint{{Target: "groupID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "groupID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "groupID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {TargetValue: UID, + Constraints: []validation.Constraint{{Target: "UID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "UID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "UID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.GroupUserClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, serviceName, groupID, UID) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.GroupUserClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.GroupUserClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.GroupUserClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client GroupUserClient) DeletePreparer(ctx context.Context, resourceGroupName string, serviceName string, groupID string, UID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "groupId": autorest.Encode("path", groupID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "uid": autorest.Encode("path", UID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/groups/{groupId}/users/{uid}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client GroupUserClient) DeleteSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client GroupUserClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// List lists a collection of the members of the group, specified by its identifier. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// groupID - group identifier. Must be unique in the current API Management service instance. +// filter - | Field | Supported operators | Supported functions | +// |------------------|------------------------|-----------------------------------| +// | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// | firstName | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// | lastName | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// | email | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// | state | eq | N/A | +// | registrationDate | ge, le, eq, ne, gt, lt | N/A | +// | note | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// top - number of records to return. +// skip - number of records to skip. +func (client GroupUserClient) List(ctx context.Context, resourceGroupName string, serviceName string, groupID string, filter string, top *int32, skip *int32) (result UserCollectionPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: groupID, + Constraints: []validation.Constraint{{Target: "groupID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "groupID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "groupID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {TargetValue: top, + Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}}}, + {TargetValue: skip, + Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("apimanagement.GroupUserClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName, serviceName, groupID, filter, top, skip) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.GroupUserClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.uc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.GroupUserClient", "List", resp, "Failure sending request") + return + } + + result.uc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.GroupUserClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client GroupUserClient) ListPreparer(ctx context.Context, resourceGroupName string, serviceName string, groupID string, filter string, top *int32, skip *int32) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "groupId": autorest.Encode("path", groupID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + if skip != nil { + queryParameters["$skip"] = autorest.Encode("query", *skip) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/groups/{groupId}/users", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client GroupUserClient) ListSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client GroupUserClient) ListResponder(resp *http.Response) (result UserCollection, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client GroupUserClient) listNextResults(lastResults UserCollection) (result UserCollection, err error) { + req, err := lastResults.userCollectionPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "apimanagement.GroupUserClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "apimanagement.GroupUserClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.GroupUserClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client GroupUserClient) ListComplete(ctx context.Context, resourceGroupName string, serviceName string, groupID string, filter string, top *int32, skip *int32) (result UserCollectionIterator, err error) { + result.page, err = client.List(ctx, resourceGroupName, serviceName, groupID, filter, top, skip) + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/identityprovider.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/identityprovider.go new file mode 100644 index 000000000..ee8945c37 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/identityprovider.go @@ -0,0 +1,550 @@ +package apimanagement + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// IdentityProviderClient is the apiManagement Client +type IdentityProviderClient struct { + BaseClient +} + +// NewIdentityProviderClient creates an instance of the IdentityProviderClient client. +func NewIdentityProviderClient(subscriptionID string) IdentityProviderClient { + return NewIdentityProviderClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewIdentityProviderClientWithBaseURI creates an instance of the IdentityProviderClient client. +func NewIdentityProviderClientWithBaseURI(baseURI string, subscriptionID string) IdentityProviderClient { + return IdentityProviderClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or Updates the IdentityProvider configuration. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// identityProviderName - identity Provider Type identifier. +// parameters - create parameters. +// ifMatch - eTag of the Entity. Not required when creating an entity, but required when updating an entity. +func (client IdentityProviderClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, identityProviderName IdentityProviderType, parameters IdentityProviderContract, ifMatch string) (result IdentityProviderContract, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.IdentityProviderContractProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.IdentityProviderContractProperties.ClientID", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.IdentityProviderContractProperties.ClientID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {Target: "parameters.IdentityProviderContractProperties.ClientSecret", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.IdentityProviderContractProperties.ClientSecret", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + }}}}}); err != nil { + return result, validation.NewError("apimanagement.IdentityProviderClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serviceName, identityProviderName, parameters, ifMatch) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.IdentityProviderClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.IdentityProviderClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.IdentityProviderClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client IdentityProviderClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, identityProviderName IdentityProviderType, parameters IdentityProviderContract, ifMatch string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "identityProviderName": autorest.Encode("path", identityProviderName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/identityProviders/{identityProviderName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + if len(ifMatch) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client IdentityProviderClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client IdentityProviderClient) CreateOrUpdateResponder(resp *http.Response) (result IdentityProviderContract, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes the specified identity provider configuration. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// identityProviderName - identity Provider Type identifier. +// ifMatch - eTag of the Entity. ETag should match the current entity state from the header response of the GET +// request or it should be * for unconditional update. +func (client IdentityProviderClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, identityProviderName IdentityProviderType, ifMatch string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.IdentityProviderClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, serviceName, identityProviderName, ifMatch) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.IdentityProviderClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.IdentityProviderClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.IdentityProviderClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client IdentityProviderClient) DeletePreparer(ctx context.Context, resourceGroupName string, serviceName string, identityProviderName IdentityProviderType, ifMatch string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "identityProviderName": autorest.Encode("path", identityProviderName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/identityProviders/{identityProviderName}", pathParameters), + autorest.WithQueryParameters(queryParameters), + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client IdentityProviderClient) DeleteSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client IdentityProviderClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the configuration details of the identity Provider configured in specified service instance. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// identityProviderName - identity Provider Type identifier. +func (client IdentityProviderClient) Get(ctx context.Context, resourceGroupName string, serviceName string, identityProviderName IdentityProviderType) (result IdentityProviderContract, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.IdentityProviderClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, serviceName, identityProviderName) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.IdentityProviderClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.IdentityProviderClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.IdentityProviderClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client IdentityProviderClient) GetPreparer(ctx context.Context, resourceGroupName string, serviceName string, identityProviderName IdentityProviderType) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "identityProviderName": autorest.Encode("path", identityProviderName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/identityProviders/{identityProviderName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client IdentityProviderClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client IdentityProviderClient) GetResponder(resp *http.Response) (result IdentityProviderContract, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetEntityTag gets the entity state (Etag) version of the identityProvider specified by its identifier. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// identityProviderName - identity Provider Type identifier. +func (client IdentityProviderClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, identityProviderName IdentityProviderType) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.IdentityProviderClient", "GetEntityTag", err.Error()) + } + + req, err := client.GetEntityTagPreparer(ctx, resourceGroupName, serviceName, identityProviderName) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.IdentityProviderClient", "GetEntityTag", nil, "Failure preparing request") + return + } + + resp, err := client.GetEntityTagSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.IdentityProviderClient", "GetEntityTag", resp, "Failure sending request") + return + } + + result, err = client.GetEntityTagResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.IdentityProviderClient", "GetEntityTag", resp, "Failure responding to request") + } + + return +} + +// GetEntityTagPreparer prepares the GetEntityTag request. +func (client IdentityProviderClient) GetEntityTagPreparer(ctx context.Context, resourceGroupName string, serviceName string, identityProviderName IdentityProviderType) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "identityProviderName": autorest.Encode("path", identityProviderName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsHead(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/identityProviders/{identityProviderName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetEntityTagSender sends the GetEntityTag request. The method will close the +// http.Response Body if it receives an error. +func (client IdentityProviderClient) GetEntityTagSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetEntityTagResponder handles the response to the GetEntityTag request. The method always +// closes the http.Response Body. +func (client IdentityProviderClient) GetEntityTagResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// ListByService lists a collection of Identity Provider configured in the specified service instance. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +func (client IdentityProviderClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string) (result IdentityProviderListPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.IdentityProviderClient", "ListByService", err.Error()) + } + + result.fn = client.listByServiceNextResults + req, err := client.ListByServicePreparer(ctx, resourceGroupName, serviceName) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.IdentityProviderClient", "ListByService", nil, "Failure preparing request") + return + } + + resp, err := client.ListByServiceSender(req) + if err != nil { + result.ipl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.IdentityProviderClient", "ListByService", resp, "Failure sending request") + return + } + + result.ipl, err = client.ListByServiceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.IdentityProviderClient", "ListByService", resp, "Failure responding to request") + } + + return +} + +// ListByServicePreparer prepares the ListByService request. +func (client IdentityProviderClient) ListByServicePreparer(ctx context.Context, resourceGroupName string, serviceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/identityProviders", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByServiceSender sends the ListByService request. The method will close the +// http.Response Body if it receives an error. +func (client IdentityProviderClient) ListByServiceSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByServiceResponder handles the response to the ListByService request. The method always +// closes the http.Response Body. +func (client IdentityProviderClient) ListByServiceResponder(resp *http.Response) (result IdentityProviderList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByServiceNextResults retrieves the next set of results, if any. +func (client IdentityProviderClient) listByServiceNextResults(lastResults IdentityProviderList) (result IdentityProviderList, err error) { + req, err := lastResults.identityProviderListPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "apimanagement.IdentityProviderClient", "listByServiceNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByServiceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "apimanagement.IdentityProviderClient", "listByServiceNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByServiceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.IdentityProviderClient", "listByServiceNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByServiceComplete enumerates all values, automatically crossing page boundaries as required. +func (client IdentityProviderClient) ListByServiceComplete(ctx context.Context, resourceGroupName string, serviceName string) (result IdentityProviderListIterator, err error) { + result.page, err = client.ListByService(ctx, resourceGroupName, serviceName) + return +} + +// Update updates an existing IdentityProvider configuration. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// identityProviderName - identity Provider Type identifier. +// parameters - update parameters. +// ifMatch - eTag of the Entity. ETag should match the current entity state from the header response of the GET +// request or it should be * for unconditional update. +func (client IdentityProviderClient) Update(ctx context.Context, resourceGroupName string, serviceName string, identityProviderName IdentityProviderType, parameters IdentityProviderUpdateParameters, ifMatch string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.IdentityProviderClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, serviceName, identityProviderName, parameters, ifMatch) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.IdentityProviderClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.IdentityProviderClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.IdentityProviderClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client IdentityProviderClient) UpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, identityProviderName IdentityProviderType, parameters IdentityProviderUpdateParameters, ifMatch string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "identityProviderName": autorest.Encode("path", identityProviderName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/identityProviders/{identityProviderName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters), + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client IdentityProviderClient) UpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client IdentityProviderClient) UpdateResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/logger.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/logger.go new file mode 100644 index 000000000..3a33baf86 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/logger.go @@ -0,0 +1,585 @@ +package apimanagement + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// LoggerClient is the apiManagement Client +type LoggerClient struct { + BaseClient +} + +// NewLoggerClient creates an instance of the LoggerClient client. +func NewLoggerClient(subscriptionID string) LoggerClient { + return NewLoggerClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewLoggerClientWithBaseURI creates an instance of the LoggerClient client. +func NewLoggerClientWithBaseURI(baseURI string, subscriptionID string) LoggerClient { + return LoggerClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or Updates a logger. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// loggerid - logger identifier. Must be unique in the API Management service instance. +// parameters - create parameters. +// ifMatch - eTag of the Entity. Not required when creating an entity, but required when updating an entity. +func (client LoggerClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, loggerid string, parameters LoggerContract, ifMatch string) (result LoggerContract, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: loggerid, + Constraints: []validation.Constraint{{Target: "loggerid", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "loggerid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.LoggerContractProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.LoggerContractProperties.Description", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.LoggerContractProperties.Description", Name: validation.MaxLength, Rule: 256, Chain: nil}}}, + {Target: "parameters.LoggerContractProperties.Credentials", Name: validation.Null, Rule: true, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("apimanagement.LoggerClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serviceName, loggerid, parameters, ifMatch) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.LoggerClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.LoggerClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.LoggerClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client LoggerClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, loggerid string, parameters LoggerContract, ifMatch string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "loggerid": autorest.Encode("path", loggerid), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/loggers/{loggerid}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + if len(ifMatch) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client LoggerClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client LoggerClient) CreateOrUpdateResponder(resp *http.Response) (result LoggerContract, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes the specified logger. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// loggerid - logger identifier. Must be unique in the API Management service instance. +// ifMatch - eTag of the Entity. ETag should match the current entity state from the header response of the GET +// request or it should be * for unconditional update. +func (client LoggerClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, loggerid string, ifMatch string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: loggerid, + Constraints: []validation.Constraint{{Target: "loggerid", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "loggerid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.LoggerClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, serviceName, loggerid, ifMatch) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.LoggerClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.LoggerClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.LoggerClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client LoggerClient) DeletePreparer(ctx context.Context, resourceGroupName string, serviceName string, loggerid string, ifMatch string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "loggerid": autorest.Encode("path", loggerid), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/loggers/{loggerid}", pathParameters), + autorest.WithQueryParameters(queryParameters), + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client LoggerClient) DeleteSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client LoggerClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the details of the logger specified by its identifier. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// loggerid - logger identifier. Must be unique in the API Management service instance. +func (client LoggerClient) Get(ctx context.Context, resourceGroupName string, serviceName string, loggerid string) (result LoggerContract, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: loggerid, + Constraints: []validation.Constraint{{Target: "loggerid", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "loggerid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.LoggerClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, serviceName, loggerid) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.LoggerClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.LoggerClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.LoggerClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client LoggerClient) GetPreparer(ctx context.Context, resourceGroupName string, serviceName string, loggerid string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "loggerid": autorest.Encode("path", loggerid), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/loggers/{loggerid}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client LoggerClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client LoggerClient) GetResponder(resp *http.Response) (result LoggerContract, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetEntityTag gets the entity state (Etag) version of the logger specified by its identifier. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// loggerid - logger identifier. Must be unique in the API Management service instance. +func (client LoggerClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, loggerid string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: loggerid, + Constraints: []validation.Constraint{{Target: "loggerid", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "loggerid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.LoggerClient", "GetEntityTag", err.Error()) + } + + req, err := client.GetEntityTagPreparer(ctx, resourceGroupName, serviceName, loggerid) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.LoggerClient", "GetEntityTag", nil, "Failure preparing request") + return + } + + resp, err := client.GetEntityTagSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.LoggerClient", "GetEntityTag", resp, "Failure sending request") + return + } + + result, err = client.GetEntityTagResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.LoggerClient", "GetEntityTag", resp, "Failure responding to request") + } + + return +} + +// GetEntityTagPreparer prepares the GetEntityTag request. +func (client LoggerClient) GetEntityTagPreparer(ctx context.Context, resourceGroupName string, serviceName string, loggerid string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "loggerid": autorest.Encode("path", loggerid), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsHead(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/loggers/{loggerid}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetEntityTagSender sends the GetEntityTag request. The method will close the +// http.Response Body if it receives an error. +func (client LoggerClient) GetEntityTagSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetEntityTagResponder handles the response to the GetEntityTag request. The method always +// closes the http.Response Body. +func (client LoggerClient) GetEntityTagResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// ListByService lists a collection of loggers in the specified service instance. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// filter - | Field | Supported operators | Supported functions | +// |-------|------------------------|---------------------------------------------| +// | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// | type | eq | | +// top - number of records to return. +// skip - number of records to skip. +func (client LoggerClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (result LoggerCollectionPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: top, + Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}}}, + {TargetValue: skip, + Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("apimanagement.LoggerClient", "ListByService", err.Error()) + } + + result.fn = client.listByServiceNextResults + req, err := client.ListByServicePreparer(ctx, resourceGroupName, serviceName, filter, top, skip) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.LoggerClient", "ListByService", nil, "Failure preparing request") + return + } + + resp, err := client.ListByServiceSender(req) + if err != nil { + result.lc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.LoggerClient", "ListByService", resp, "Failure sending request") + return + } + + result.lc, err = client.ListByServiceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.LoggerClient", "ListByService", resp, "Failure responding to request") + } + + return +} + +// ListByServicePreparer prepares the ListByService request. +func (client LoggerClient) ListByServicePreparer(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + if skip != nil { + queryParameters["$skip"] = autorest.Encode("query", *skip) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/loggers", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByServiceSender sends the ListByService request. The method will close the +// http.Response Body if it receives an error. +func (client LoggerClient) ListByServiceSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByServiceResponder handles the response to the ListByService request. The method always +// closes the http.Response Body. +func (client LoggerClient) ListByServiceResponder(resp *http.Response) (result LoggerCollection, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByServiceNextResults retrieves the next set of results, if any. +func (client LoggerClient) listByServiceNextResults(lastResults LoggerCollection) (result LoggerCollection, err error) { + req, err := lastResults.loggerCollectionPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "apimanagement.LoggerClient", "listByServiceNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByServiceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "apimanagement.LoggerClient", "listByServiceNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByServiceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.LoggerClient", "listByServiceNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByServiceComplete enumerates all values, automatically crossing page boundaries as required. +func (client LoggerClient) ListByServiceComplete(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (result LoggerCollectionIterator, err error) { + result.page, err = client.ListByService(ctx, resourceGroupName, serviceName, filter, top, skip) + return +} + +// Update updates an existing logger. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// loggerid - logger identifier. Must be unique in the API Management service instance. +// parameters - update parameters. +// ifMatch - eTag of the Entity. ETag should match the current entity state from the header response of the GET +// request or it should be * for unconditional update. +func (client LoggerClient) Update(ctx context.Context, resourceGroupName string, serviceName string, loggerid string, parameters LoggerUpdateContract, ifMatch string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: loggerid, + Constraints: []validation.Constraint{{Target: "loggerid", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "loggerid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.LoggerClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, serviceName, loggerid, parameters, ifMatch) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.LoggerClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.LoggerClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.LoggerClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client LoggerClient) UpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, loggerid string, parameters LoggerUpdateContract, ifMatch string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "loggerid": autorest.Encode("path", loggerid), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/loggers/{loggerid}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters), + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client LoggerClient) UpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client LoggerClient) UpdateResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/models.go new file mode 100644 index 000000000..40a7277ec --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/models.go @@ -0,0 +1,10198 @@ +package apimanagement + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "encoding/json" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/date" + "github.com/Azure/go-autorest/autorest/to" + "github.com/satori/go.uuid" + "net/http" +) + +// AlwaysLog enumerates the values for always log. +type AlwaysLog string + +const ( + // AllErrors Always log all erroneous request regardless of sampling settings. + AllErrors AlwaysLog = "allErrors" +) + +// PossibleAlwaysLogValues returns an array of possible values for the AlwaysLog const type. +func PossibleAlwaysLogValues() []AlwaysLog { + return []AlwaysLog{AllErrors} +} + +// APIType enumerates the values for api type. +type APIType string + +const ( + // HTTP ... + HTTP APIType = "http" + // Soap ... + Soap APIType = "soap" +) + +// PossibleAPITypeValues returns an array of possible values for the APIType const type. +func PossibleAPITypeValues() []APIType { + return []APIType{HTTP, Soap} +} + +// AsyncOperationStatus enumerates the values for async operation status. +type AsyncOperationStatus string + +const ( + // Failed ... + Failed AsyncOperationStatus = "Failed" + // InProgress ... + InProgress AsyncOperationStatus = "InProgress" + // Started ... + Started AsyncOperationStatus = "Started" + // Succeeded ... + Succeeded AsyncOperationStatus = "Succeeded" +) + +// PossibleAsyncOperationStatusValues returns an array of possible values for the AsyncOperationStatus const type. +func PossibleAsyncOperationStatusValues() []AsyncOperationStatus { + return []AsyncOperationStatus{Failed, InProgress, Started, Succeeded} +} + +// AuthorizationMethod enumerates the values for authorization method. +type AuthorizationMethod string + +const ( + // DELETE ... + DELETE AuthorizationMethod = "DELETE" + // GET ... + GET AuthorizationMethod = "GET" + // HEAD ... + HEAD AuthorizationMethod = "HEAD" + // OPTIONS ... + OPTIONS AuthorizationMethod = "OPTIONS" + // PATCH ... + PATCH AuthorizationMethod = "PATCH" + // POST ... + POST AuthorizationMethod = "POST" + // PUT ... + PUT AuthorizationMethod = "PUT" + // TRACE ... + TRACE AuthorizationMethod = "TRACE" +) + +// PossibleAuthorizationMethodValues returns an array of possible values for the AuthorizationMethod const type. +func PossibleAuthorizationMethodValues() []AuthorizationMethod { + return []AuthorizationMethod{DELETE, GET, HEAD, OPTIONS, PATCH, POST, PUT, TRACE} +} + +// BackendProtocol enumerates the values for backend protocol. +type BackendProtocol string + +const ( + // BackendProtocolHTTP The Backend is a RESTful service. + BackendProtocolHTTP BackendProtocol = "http" + // BackendProtocolSoap The Backend is a SOAP service. + BackendProtocolSoap BackendProtocol = "soap" +) + +// PossibleBackendProtocolValues returns an array of possible values for the BackendProtocol const type. +func PossibleBackendProtocolValues() []BackendProtocol { + return []BackendProtocol{BackendProtocolHTTP, BackendProtocolSoap} +} + +// BearerTokenSendingMethod enumerates the values for bearer token sending method. +type BearerTokenSendingMethod string + +const ( + // AuthorizationHeader ... + AuthorizationHeader BearerTokenSendingMethod = "authorizationHeader" + // Query ... + Query BearerTokenSendingMethod = "query" +) + +// PossibleBearerTokenSendingMethodValues returns an array of possible values for the BearerTokenSendingMethod const type. +func PossibleBearerTokenSendingMethodValues() []BearerTokenSendingMethod { + return []BearerTokenSendingMethod{AuthorizationHeader, Query} +} + +// ClientAuthenticationMethod enumerates the values for client authentication method. +type ClientAuthenticationMethod string + +const ( + // Basic Basic Client Authentication method. + Basic ClientAuthenticationMethod = "Basic" + // Body Body based Authentication method. + Body ClientAuthenticationMethod = "Body" +) + +// PossibleClientAuthenticationMethodValues returns an array of possible values for the ClientAuthenticationMethod const type. +func PossibleClientAuthenticationMethodValues() []ClientAuthenticationMethod { + return []ClientAuthenticationMethod{Basic, Body} +} + +// Confirmation enumerates the values for confirmation. +type Confirmation string + +const ( + // Invite Send an e-mail inviting the user to sign-up and complete registration. + Invite Confirmation = "invite" + // Signup Send an e-mail to the user confirming they have successfully signed up. + Signup Confirmation = "signup" +) + +// PossibleConfirmationValues returns an array of possible values for the Confirmation const type. +func PossibleConfirmationValues() []Confirmation { + return []Confirmation{Invite, Signup} +} + +// ConnectivityStatusType enumerates the values for connectivity status type. +type ConnectivityStatusType string + +const ( + // Failure ... + Failure ConnectivityStatusType = "failure" + // Initializing ... + Initializing ConnectivityStatusType = "initializing" + // Success ... + Success ConnectivityStatusType = "success" +) + +// PossibleConnectivityStatusTypeValues returns an array of possible values for the ConnectivityStatusType const type. +func PossibleConnectivityStatusTypeValues() []ConnectivityStatusType { + return []ConnectivityStatusType{Failure, Initializing, Success} +} + +// ContentFormat enumerates the values for content format. +type ContentFormat string + +const ( + // SwaggerJSON The contents are inline and Content Type is a OpenApi 2.0 Document. + SwaggerJSON ContentFormat = "swagger-json" + // SwaggerLinkJSON The Open Api 2.0 document is hosted on a publicly accessible internet address. + SwaggerLinkJSON ContentFormat = "swagger-link-json" + // WadlLinkJSON The WADL document is hosted on a publicly accessible internet address. + WadlLinkJSON ContentFormat = "wadl-link-json" + // WadlXML The contents are inline and Content type is a WADL document. + WadlXML ContentFormat = "wadl-xml" + // Wsdl The contents are inline and the document is a WSDL/Soap document. + Wsdl ContentFormat = "wsdl" + // WsdlLink The WSDL document is hosted on a publicly accessible internet address. + WsdlLink ContentFormat = "wsdl-link" +) + +// PossibleContentFormatValues returns an array of possible values for the ContentFormat const type. +func PossibleContentFormatValues() []ContentFormat { + return []ContentFormat{SwaggerJSON, SwaggerLinkJSON, WadlLinkJSON, WadlXML, Wsdl, WsdlLink} +} + +// ExportFormat enumerates the values for export format. +type ExportFormat string + +const ( + // ExportFormatSwagger Export the Api Definition in OpenApi Specification 2.0 format to the Storage Blob. + ExportFormatSwagger ExportFormat = "swagger-link" + // ExportFormatWadl Export the Api Definition in WADL Schema to Storage Blob. + ExportFormatWadl ExportFormat = "wadl-link" + // ExportFormatWsdl Export the Api Definition in WSDL Schema to Storage Blob. This is only supported for + // APIs of Type `soap` + ExportFormatWsdl ExportFormat = "wsdl-link" +) + +// PossibleExportFormatValues returns an array of possible values for the ExportFormat const type. +func PossibleExportFormatValues() []ExportFormat { + return []ExportFormat{ExportFormatSwagger, ExportFormatWadl, ExportFormatWsdl} +} + +// GrantType enumerates the values for grant type. +type GrantType string + +const ( + // AuthorizationCode Authorization Code Grant flow as described + // https://tools.ietf.org/html/rfc6749#section-4.1. + AuthorizationCode GrantType = "authorizationCode" + // ClientCredentials Client Credentials Grant flow as described + // https://tools.ietf.org/html/rfc6749#section-4.4. + ClientCredentials GrantType = "clientCredentials" + // Implicit Implicit Code Grant flow as described https://tools.ietf.org/html/rfc6749#section-4.2. + Implicit GrantType = "implicit" + // ResourceOwnerPassword Resource Owner Password Grant flow as described + // https://tools.ietf.org/html/rfc6749#section-4.3. + ResourceOwnerPassword GrantType = "resourceOwnerPassword" +) + +// PossibleGrantTypeValues returns an array of possible values for the GrantType const type. +func PossibleGrantTypeValues() []GrantType { + return []GrantType{AuthorizationCode, ClientCredentials, Implicit, ResourceOwnerPassword} +} + +// GroupType enumerates the values for group type. +type GroupType string + +const ( + // Custom ... + Custom GroupType = "custom" + // External ... + External GroupType = "external" + // System ... + System GroupType = "system" +) + +// PossibleGroupTypeValues returns an array of possible values for the GroupType const type. +func PossibleGroupTypeValues() []GroupType { + return []GroupType{Custom, External, System} +} + +// HostnameType enumerates the values for hostname type. +type HostnameType string + +const ( + // Management ... + Management HostnameType = "Management" + // Portal ... + Portal HostnameType = "Portal" + // Proxy ... + Proxy HostnameType = "Proxy" + // Scm ... + Scm HostnameType = "Scm" +) + +// PossibleHostnameTypeValues returns an array of possible values for the HostnameType const type. +func PossibleHostnameTypeValues() []HostnameType { + return []HostnameType{Management, Portal, Proxy, Scm} +} + +// IdentityProviderType enumerates the values for identity provider type. +type IdentityProviderType string + +const ( + // Aad Azure Active Directory as Identity provider. + Aad IdentityProviderType = "aad" + // AadB2C Azure Active Directory B2C as Identity provider. + AadB2C IdentityProviderType = "aadB2C" + // Facebook Facebook as Identity provider. + Facebook IdentityProviderType = "facebook" + // Google Google as Identity provider. + Google IdentityProviderType = "google" + // Microsoft Microsoft Live as Identity provider. + Microsoft IdentityProviderType = "microsoft" + // Twitter Twitter as Identity provider. + Twitter IdentityProviderType = "twitter" +) + +// PossibleIdentityProviderTypeValues returns an array of possible values for the IdentityProviderType const type. +func PossibleIdentityProviderTypeValues() []IdentityProviderType { + return []IdentityProviderType{Aad, AadB2C, Facebook, Google, Microsoft, Twitter} +} + +// KeyType enumerates the values for key type. +type KeyType string + +const ( + // Primary ... + Primary KeyType = "primary" + // Secondary ... + Secondary KeyType = "secondary" +) + +// PossibleKeyTypeValues returns an array of possible values for the KeyType const type. +func PossibleKeyTypeValues() []KeyType { + return []KeyType{Primary, Secondary} +} + +// LoggerType enumerates the values for logger type. +type LoggerType string + +const ( + // ApplicationInsights Azure Application Insights as log destination. + ApplicationInsights LoggerType = "applicationInsights" + // AzureEventHub Azure Event Hub as log destination. + AzureEventHub LoggerType = "azureEventHub" +) + +// PossibleLoggerTypeValues returns an array of possible values for the LoggerType const type. +func PossibleLoggerTypeValues() []LoggerType { + return []LoggerType{ApplicationInsights, AzureEventHub} +} + +// NameAvailabilityReason enumerates the values for name availability reason. +type NameAvailabilityReason string + +const ( + // AlreadyExists ... + AlreadyExists NameAvailabilityReason = "AlreadyExists" + // Invalid ... + Invalid NameAvailabilityReason = "Invalid" + // Valid ... + Valid NameAvailabilityReason = "Valid" +) + +// PossibleNameAvailabilityReasonValues returns an array of possible values for the NameAvailabilityReason const type. +func PossibleNameAvailabilityReasonValues() []NameAvailabilityReason { + return []NameAvailabilityReason{AlreadyExists, Invalid, Valid} +} + +// NotificationName enumerates the values for notification name. +type NotificationName string + +const ( + // AccountClosedPublisher The following email recipients and users will receive email notifications when + // developer closes his account. + AccountClosedPublisher NotificationName = "AccountClosedPublisher" + // BCC The following recipients will receive blind carbon copies of all emails sent to developers. + BCC NotificationName = "BCC" + // NewApplicationNotificationMessage The following email recipients and users will receive email + // notifications when new applications are submitted to the application gallery. + NewApplicationNotificationMessage NotificationName = "NewApplicationNotificationMessage" + // NewIssuePublisherNotificationMessage The following email recipients and users will receive email + // notifications when a new issue or comment is submitted on the developer portal. + NewIssuePublisherNotificationMessage NotificationName = "NewIssuePublisherNotificationMessage" + // PurchasePublisherNotificationMessage The following email recipients and users will receive email + // notifications about new API product subscriptions. + PurchasePublisherNotificationMessage NotificationName = "PurchasePublisherNotificationMessage" + // QuotaLimitApproachingPublisherNotificationMessage The following email recipients and users will receive + // email notifications when subscription usage gets close to usage quota. + QuotaLimitApproachingPublisherNotificationMessage NotificationName = "QuotaLimitApproachingPublisherNotificationMessage" + // RequestPublisherNotificationMessage The following email recipients and users will receive email + // notifications about subscription requests for API products requiring approval. + RequestPublisherNotificationMessage NotificationName = "RequestPublisherNotificationMessage" +) + +// PossibleNotificationNameValues returns an array of possible values for the NotificationName const type. +func PossibleNotificationNameValues() []NotificationName { + return []NotificationName{AccountClosedPublisher, BCC, NewApplicationNotificationMessage, NewIssuePublisherNotificationMessage, PurchasePublisherNotificationMessage, QuotaLimitApproachingPublisherNotificationMessage, RequestPublisherNotificationMessage} +} + +// PolicyContentFormat enumerates the values for policy content format. +type PolicyContentFormat string + +const ( + // Rawxml The contents are inline and Content type is a non XML encoded policy document. + Rawxml PolicyContentFormat = "rawxml" + // RawxmlLink The policy document is not Xml encoded and is hosted on a http endpoint accessible from the + // API Management service. + RawxmlLink PolicyContentFormat = "rawxml-link" + // XML The contents are inline and Content type is an XML document. + XML PolicyContentFormat = "xml" + // XMLLink The policy XML document is hosted on a http endpoint accessible from the API Management service. + XMLLink PolicyContentFormat = "xml-link" +) + +// PossiblePolicyContentFormatValues returns an array of possible values for the PolicyContentFormat const type. +func PossiblePolicyContentFormatValues() []PolicyContentFormat { + return []PolicyContentFormat{Rawxml, RawxmlLink, XML, XMLLink} +} + +// PolicyScopeContract enumerates the values for policy scope contract. +type PolicyScopeContract string + +const ( + // PolicyScopeContractAll ... + PolicyScopeContractAll PolicyScopeContract = "All" + // PolicyScopeContractAPI ... + PolicyScopeContractAPI PolicyScopeContract = "Api" + // PolicyScopeContractOperation ... + PolicyScopeContractOperation PolicyScopeContract = "Operation" + // PolicyScopeContractProduct ... + PolicyScopeContractProduct PolicyScopeContract = "Product" + // PolicyScopeContractTenant ... + PolicyScopeContractTenant PolicyScopeContract = "Tenant" +) + +// PossiblePolicyScopeContractValues returns an array of possible values for the PolicyScopeContract const type. +func PossiblePolicyScopeContractValues() []PolicyScopeContract { + return []PolicyScopeContract{PolicyScopeContractAll, PolicyScopeContractAPI, PolicyScopeContractOperation, PolicyScopeContractProduct, PolicyScopeContractTenant} +} + +// ProductState enumerates the values for product state. +type ProductState string + +const ( + // NotPublished ... + NotPublished ProductState = "notPublished" + // Published ... + Published ProductState = "published" +) + +// PossibleProductStateValues returns an array of possible values for the ProductState const type. +func PossibleProductStateValues() []ProductState { + return []ProductState{NotPublished, Published} +} + +// Protocol enumerates the values for protocol. +type Protocol string + +const ( + // ProtocolHTTP ... + ProtocolHTTP Protocol = "http" + // ProtocolHTTPS ... + ProtocolHTTPS Protocol = "https" +) + +// PossibleProtocolValues returns an array of possible values for the Protocol const type. +func PossibleProtocolValues() []Protocol { + return []Protocol{ProtocolHTTP, ProtocolHTTPS} +} + +// SamplingType enumerates the values for sampling type. +type SamplingType string + +const ( + // Fixed Fixed-rate sampling. + Fixed SamplingType = "fixed" +) + +// PossibleSamplingTypeValues returns an array of possible values for the SamplingType const type. +func PossibleSamplingTypeValues() []SamplingType { + return []SamplingType{Fixed} +} + +// SkuType enumerates the values for sku type. +type SkuType string + +const ( + // SkuTypeBasic Basic SKU of Api Management. + SkuTypeBasic SkuType = "Basic" + // SkuTypeDeveloper Developer SKU of Api Management. + SkuTypeDeveloper SkuType = "Developer" + // SkuTypePremium Premium SKU of Api Management. + SkuTypePremium SkuType = "Premium" + // SkuTypeStandard Standard SKU of Api Management. + SkuTypeStandard SkuType = "Standard" +) + +// PossibleSkuTypeValues returns an array of possible values for the SkuType const type. +func PossibleSkuTypeValues() []SkuType { + return []SkuType{SkuTypeBasic, SkuTypeDeveloper, SkuTypePremium, SkuTypeStandard} +} + +// SoapAPIType enumerates the values for soap api type. +type SoapAPIType string + +const ( + // SoapPassThrough Imports the Soap API having a SOAP front end. + SoapPassThrough SoapAPIType = "soap" + // SoapToRest Imports a SOAP API having a RESTful front end. + SoapToRest SoapAPIType = "http" +) + +// PossibleSoapAPITypeValues returns an array of possible values for the SoapAPIType const type. +func PossibleSoapAPITypeValues() []SoapAPIType { + return []SoapAPIType{SoapPassThrough, SoapToRest} +} + +// State enumerates the values for state. +type State string + +const ( + // Closed The issue was closed. + Closed State = "closed" + // Open The issue is opened. + Open State = "open" + // Proposed The issue is proposed. + Proposed State = "proposed" + // Removed The issue was removed. + Removed State = "removed" + // Resolved The issue is now resolved. + Resolved State = "resolved" +) + +// PossibleStateValues returns an array of possible values for the State const type. +func PossibleStateValues() []State { + return []State{Closed, Open, Proposed, Removed, Resolved} +} + +// StoreName enumerates the values for store name. +type StoreName string + +const ( + // CertificateAuthority ... + CertificateAuthority StoreName = "CertificateAuthority" + // Root ... + Root StoreName = "Root" +) + +// PossibleStoreNameValues returns an array of possible values for the StoreName const type. +func PossibleStoreNameValues() []StoreName { + return []StoreName{CertificateAuthority, Root} +} + +// SubscriptionState enumerates the values for subscription state. +type SubscriptionState string + +const ( + // Active ... + Active SubscriptionState = "active" + // Cancelled ... + Cancelled SubscriptionState = "cancelled" + // Expired ... + Expired SubscriptionState = "expired" + // Rejected ... + Rejected SubscriptionState = "rejected" + // Submitted ... + Submitted SubscriptionState = "submitted" + // Suspended ... + Suspended SubscriptionState = "suspended" +) + +// PossibleSubscriptionStateValues returns an array of possible values for the SubscriptionState const type. +func PossibleSubscriptionStateValues() []SubscriptionState { + return []SubscriptionState{Active, Cancelled, Expired, Rejected, Submitted, Suspended} +} + +// TemplateName enumerates the values for template name. +type TemplateName string + +const ( + // AccountClosedDeveloper ... + AccountClosedDeveloper TemplateName = "accountClosedDeveloper" + // ApplicationApprovedNotificationMessage ... + ApplicationApprovedNotificationMessage TemplateName = "applicationApprovedNotificationMessage" + // ConfirmSignUpIdentityDefault ... + ConfirmSignUpIdentityDefault TemplateName = "confirmSignUpIdentityDefault" + // EmailChangeIdentityDefault ... + EmailChangeIdentityDefault TemplateName = "emailChangeIdentityDefault" + // InviteUserNotificationMessage ... + InviteUserNotificationMessage TemplateName = "inviteUserNotificationMessage" + // NewCommentNotificationMessage ... + NewCommentNotificationMessage TemplateName = "newCommentNotificationMessage" + // NewDeveloperNotificationMessage ... + NewDeveloperNotificationMessage TemplateName = "newDeveloperNotificationMessage" + // NewIssueNotificationMessage ... + NewIssueNotificationMessage TemplateName = "newIssueNotificationMessage" + // PasswordResetByAdminNotificationMessage ... + PasswordResetByAdminNotificationMessage TemplateName = "passwordResetByAdminNotificationMessage" + // PasswordResetIdentityDefault ... + PasswordResetIdentityDefault TemplateName = "passwordResetIdentityDefault" + // PurchaseDeveloperNotificationMessage ... + PurchaseDeveloperNotificationMessage TemplateName = "purchaseDeveloperNotificationMessage" + // QuotaLimitApproachingDeveloperNotificationMessage ... + QuotaLimitApproachingDeveloperNotificationMessage TemplateName = "quotaLimitApproachingDeveloperNotificationMessage" + // RejectDeveloperNotificationMessage ... + RejectDeveloperNotificationMessage TemplateName = "rejectDeveloperNotificationMessage" + // RequestDeveloperNotificationMessage ... + RequestDeveloperNotificationMessage TemplateName = "requestDeveloperNotificationMessage" +) + +// PossibleTemplateNameValues returns an array of possible values for the TemplateName const type. +func PossibleTemplateNameValues() []TemplateName { + return []TemplateName{AccountClosedDeveloper, ApplicationApprovedNotificationMessage, ConfirmSignUpIdentityDefault, EmailChangeIdentityDefault, InviteUserNotificationMessage, NewCommentNotificationMessage, NewDeveloperNotificationMessage, NewIssueNotificationMessage, PasswordResetByAdminNotificationMessage, PasswordResetIdentityDefault, PurchaseDeveloperNotificationMessage, QuotaLimitApproachingDeveloperNotificationMessage, RejectDeveloperNotificationMessage, RequestDeveloperNotificationMessage} +} + +// UserState enumerates the values for user state. +type UserState string + +const ( + // UserStateActive User state is active. + UserStateActive UserState = "active" + // UserStateBlocked User is blocked. Blocked users cannot authenticate at developer portal or call API. + UserStateBlocked UserState = "blocked" + // UserStateDeleted User account is closed. All identities and related entities are removed. + UserStateDeleted UserState = "deleted" + // UserStatePending User account is pending. Requires identity confirmation before it can be made active. + UserStatePending UserState = "pending" +) + +// PossibleUserStateValues returns an array of possible values for the UserState const type. +func PossibleUserStateValues() []UserState { + return []UserState{UserStateActive, UserStateBlocked, UserStateDeleted, UserStatePending} +} + +// VersioningScheme enumerates the values for versioning scheme. +type VersioningScheme string + +const ( + // VersioningSchemeHeader The API Version is passed in a HTTP header. + VersioningSchemeHeader VersioningScheme = "Header" + // VersioningSchemeQuery The API Version is passed in a query parameter. + VersioningSchemeQuery VersioningScheme = "Query" + // VersioningSchemeSegment The API Version is passed in a path segment. + VersioningSchemeSegment VersioningScheme = "Segment" +) + +// PossibleVersioningSchemeValues returns an array of possible values for the VersioningScheme const type. +func PossibleVersioningSchemeValues() []VersioningScheme { + return []VersioningScheme{VersioningSchemeHeader, VersioningSchemeQuery, VersioningSchemeSegment} +} + +// VersioningScheme1 enumerates the values for versioning scheme 1. +type VersioningScheme1 string + +const ( + // VersioningScheme1Header ... + VersioningScheme1Header VersioningScheme1 = "Header" + // VersioningScheme1Query ... + VersioningScheme1Query VersioningScheme1 = "Query" + // VersioningScheme1Segment ... + VersioningScheme1Segment VersioningScheme1 = "Segment" +) + +// PossibleVersioningScheme1Values returns an array of possible values for the VersioningScheme1 const type. +func PossibleVersioningScheme1Values() []VersioningScheme1 { + return []VersioningScheme1{VersioningScheme1Header, VersioningScheme1Query, VersioningScheme1Segment} +} + +// VirtualNetworkType enumerates the values for virtual network type. +type VirtualNetworkType string + +const ( + // VirtualNetworkTypeExternal The service is part of Virtual Network and it is accessible from Internet. + VirtualNetworkTypeExternal VirtualNetworkType = "External" + // VirtualNetworkTypeInternal The service is part of Virtual Network and it is only accessible from within + // the virtual network. + VirtualNetworkTypeInternal VirtualNetworkType = "Internal" + // VirtualNetworkTypeNone The service is not part of any Virtual Network. + VirtualNetworkTypeNone VirtualNetworkType = "None" +) + +// PossibleVirtualNetworkTypeValues returns an array of possible values for the VirtualNetworkType const type. +func PossibleVirtualNetworkTypeValues() []VirtualNetworkType { + return []VirtualNetworkType{VirtualNetworkTypeExternal, VirtualNetworkTypeInternal, VirtualNetworkTypeNone} +} + +// AccessInformationContract tenant access information contract of the API Management service. +type AccessInformationContract struct { + autorest.Response `json:"-"` + // ID - Identifier. + ID *string `json:"id,omitempty"` + // PrimaryKey - Primary access key. + PrimaryKey *string `json:"primaryKey,omitempty"` + // SecondaryKey - Secondary access key. + SecondaryKey *string `json:"secondaryKey,omitempty"` + // Enabled - Tenant access information of the API Management service. + Enabled *bool `json:"enabled,omitempty"` +} + +// AccessInformationUpdateParameters tenant access information update parameters of the API Management service. +type AccessInformationUpdateParameters struct { + // Enabled - Tenant access information of the API Management service. + Enabled *bool `json:"enabled,omitempty"` +} + +// AdditionalLocation description of an additional API Management resource location. +type AdditionalLocation struct { + // Location - The location name of the additional region among Azure Data center regions. + Location *string `json:"location,omitempty"` + // Sku - SKU properties of the API Management service. + Sku *ServiceSkuProperties `json:"sku,omitempty"` + // PublicIPAddresses - Public Static Load Balanced IP addresses of the API Management service in the additional location. Available only for Basic, Standard and Premium SKU. + PublicIPAddresses *[]string `json:"publicIPAddresses,omitempty"` + // PrivateIPAddresses - Private Static Load Balanced IP addresses of the API Management service which is deployed in an Internal Virtual Network in a particular additional location. Available only for Basic, Standard and Premium SKU. + PrivateIPAddresses *[]string `json:"privateIPAddresses,omitempty"` + // VirtualNetworkConfiguration - Virtual network configuration for the location. + VirtualNetworkConfiguration *VirtualNetworkConfiguration `json:"virtualNetworkConfiguration,omitempty"` + // GatewayRegionalURL - Gateway URL of the API Management service in the Region. + GatewayRegionalURL *string `json:"gatewayRegionalUrl,omitempty"` +} + +// APICollection paged Api list representation. +type APICollection struct { + autorest.Response `json:"-"` + // Value - Page values. + Value *[]APIContract `json:"value,omitempty"` + // NextLink - Next page link if any. + NextLink *string `json:"nextLink,omitempty"` +} + +// APICollectionIterator provides access to a complete listing of APIContract values. +type APICollectionIterator struct { + i int + page APICollectionPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *APICollectionIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter APICollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter APICollectionIterator) Response() APICollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter APICollectionIterator) Value() APIContract { + if !iter.page.NotDone() { + return APIContract{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (ac APICollection) IsEmpty() bool { + return ac.Value == nil || len(*ac.Value) == 0 +} + +// aPICollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (ac APICollection) aPICollectionPreparer() (*http.Request, error) { + if ac.NextLink == nil || len(to.String(ac.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(ac.NextLink))) +} + +// APICollectionPage contains a page of APIContract values. +type APICollectionPage struct { + fn func(APICollection) (APICollection, error) + ac APICollection +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *APICollectionPage) Next() error { + next, err := page.fn(page.ac) + if err != nil { + return err + } + page.ac = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page APICollectionPage) NotDone() bool { + return !page.ac.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page APICollectionPage) Response() APICollection { + return page.ac +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page APICollectionPage) Values() []APIContract { + if page.ac.IsEmpty() { + return nil + } + return *page.ac.Value +} + +// APIContract API details. +type APIContract struct { + autorest.Response `json:"-"` + // APIContractProperties - Api entity contract properties. + *APIContractProperties `json:"properties,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` + // Name - Resource name. + Name *string `json:"name,omitempty"` + // Type - Resource type for API Management resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for APIContract. +func (ac APIContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ac.APIContractProperties != nil { + objectMap["properties"] = ac.APIContractProperties + } + if ac.ID != nil { + objectMap["id"] = ac.ID + } + if ac.Name != nil { + objectMap["name"] = ac.Name + } + if ac.Type != nil { + objectMap["type"] = ac.Type + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for APIContract struct. +func (ac *APIContract) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var APIContractProperties APIContractProperties + err = json.Unmarshal(*v, &APIContractProperties) + if err != nil { + return err + } + ac.APIContractProperties = &APIContractProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ac.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ac.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ac.Type = &typeVar + } + } + } + + return nil +} + +// APIContractProperties api Entity Properties +type APIContractProperties struct { + // DisplayName - API name. + DisplayName *string `json:"displayName,omitempty"` + // ServiceURL - Absolute URL of the backend service implementing this API. + ServiceURL *string `json:"serviceUrl,omitempty"` + // Path - Relative URL uniquely identifying this API and all of its resource paths within the API Management service instance. It is appended to the API endpoint base URL specified during the service instance creation to form a public URL for this API. + Path *string `json:"path,omitempty"` + // Protocols - Describes on which protocols the operations in this API can be invoked. + Protocols *[]Protocol `json:"protocols,omitempty"` + APIVersionSet *APIVersionSetContractDetails `json:"apiVersionSet,omitempty"` + // Description - Description of the API. May include HTML formatting tags. + Description *string `json:"description,omitempty"` + // AuthenticationSettings - Collection of authentication settings included into this API. + AuthenticationSettings *AuthenticationSettingsContract `json:"authenticationSettings,omitempty"` + // SubscriptionKeyParameterNames - Protocols over which API is made available. + SubscriptionKeyParameterNames *SubscriptionKeyParameterNamesContract `json:"subscriptionKeyParameterNames,omitempty"` + // APIType - Type of API. Possible values include: 'HTTP', 'Soap' + APIType APIType `json:"type,omitempty"` + // APIRevision - Describes the Revision of the Api. If no value is provided, default revision 1 is created + APIRevision *string `json:"apiRevision,omitempty"` + // APIVersion - Indicates the Version identifier of the API if the API is versioned + APIVersion *string `json:"apiVersion,omitempty"` + // IsCurrent - Indicates if API revision is current api revision. + IsCurrent *bool `json:"isCurrent,omitempty"` + // IsOnline - Indicates if API revision is accessible via the gateway. + IsOnline *bool `json:"isOnline,omitempty"` + // APIVersionSetID - A resource identifier for the related ApiVersionSet. + APIVersionSetID *string `json:"apiVersionSetId,omitempty"` +} + +// APIContractUpdateProperties API update contract properties. +type APIContractUpdateProperties struct { + // DisplayName - API name. + DisplayName *string `json:"displayName,omitempty"` + // ServiceURL - Absolute URL of the backend service implementing this API. + ServiceURL *string `json:"serviceUrl,omitempty"` + // Path - Relative URL uniquely identifying this API and all of its resource paths within the API Management service instance. It is appended to the API endpoint base URL specified during the service instance creation to form a public URL for this API. + Path *string `json:"path,omitempty"` + // Protocols - Describes on which protocols the operations in this API can be invoked. + Protocols *[]Protocol `json:"protocols,omitempty"` + // Description - Description of the API. May include HTML formatting tags. + Description *string `json:"description,omitempty"` + // AuthenticationSettings - Collection of authentication settings included into this API. + AuthenticationSettings *AuthenticationSettingsContract `json:"authenticationSettings,omitempty"` + // SubscriptionKeyParameterNames - Protocols over which API is made available. + SubscriptionKeyParameterNames *SubscriptionKeyParameterNamesContract `json:"subscriptionKeyParameterNames,omitempty"` + // APIType - Type of API. Possible values include: 'HTTP', 'Soap' + APIType APIType `json:"type,omitempty"` + // APIRevision - Describes the Revision of the Api. If no value is provided, default revision 1 is created + APIRevision *string `json:"apiRevision,omitempty"` + // APIVersion - Indicates the Version identifier of the API if the API is versioned + APIVersion *string `json:"apiVersion,omitempty"` + // IsCurrent - Indicates if API revision is current api revision. + IsCurrent *bool `json:"isCurrent,omitempty"` + // IsOnline - Indicates if API revision is accessible via the gateway. + IsOnline *bool `json:"isOnline,omitempty"` + // APIVersionSetID - A resource identifier for the related ApiVersionSet. + APIVersionSetID *string `json:"apiVersionSetId,omitempty"` +} + +// APICreateOrUpdateParameter API Create or Update Parameters. +type APICreateOrUpdateParameter struct { + // APICreateOrUpdateProperties - Api entity create of update properties. + *APICreateOrUpdateProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for APICreateOrUpdateParameter. +func (acoup APICreateOrUpdateParameter) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if acoup.APICreateOrUpdateProperties != nil { + objectMap["properties"] = acoup.APICreateOrUpdateProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for APICreateOrUpdateParameter struct. +func (acoup *APICreateOrUpdateParameter) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var APICreateOrUpdateProperties APICreateOrUpdateProperties + err = json.Unmarshal(*v, &APICreateOrUpdateProperties) + if err != nil { + return err + } + acoup.APICreateOrUpdateProperties = &APICreateOrUpdateProperties + } + } + } + + return nil +} + +// APICreateOrUpdateProperties api Create or Update Properties. +type APICreateOrUpdateProperties struct { + // ContentValue - Content value when Importing an API. + ContentValue *string `json:"contentValue,omitempty"` + // ContentFormat - Format of the Content in which the API is getting imported. Possible values include: 'WadlXML', 'WadlLinkJSON', 'SwaggerJSON', 'SwaggerLinkJSON', 'Wsdl', 'WsdlLink' + ContentFormat ContentFormat `json:"contentFormat,omitempty"` + // WsdlSelector - Criteria to limit import of WSDL to a subset of the document. + WsdlSelector *APICreateOrUpdatePropertiesWsdlSelector `json:"wsdlSelector,omitempty"` + // SoapAPIType - Type of Api to create. + // * `http` creates a SOAP to REST API + // * `soap` creates a SOAP pass-through API. Possible values include: 'SoapToRest', 'SoapPassThrough' + SoapAPIType SoapAPIType `json:"apiType,omitempty"` + // DisplayName - API name. + DisplayName *string `json:"displayName,omitempty"` + // ServiceURL - Absolute URL of the backend service implementing this API. + ServiceURL *string `json:"serviceUrl,omitempty"` + // Path - Relative URL uniquely identifying this API and all of its resource paths within the API Management service instance. It is appended to the API endpoint base URL specified during the service instance creation to form a public URL for this API. + Path *string `json:"path,omitempty"` + // Protocols - Describes on which protocols the operations in this API can be invoked. + Protocols *[]Protocol `json:"protocols,omitempty"` + APIVersionSet *APIVersionSetContractDetails `json:"apiVersionSet,omitempty"` + // Description - Description of the API. May include HTML formatting tags. + Description *string `json:"description,omitempty"` + // AuthenticationSettings - Collection of authentication settings included into this API. + AuthenticationSettings *AuthenticationSettingsContract `json:"authenticationSettings,omitempty"` + // SubscriptionKeyParameterNames - Protocols over which API is made available. + SubscriptionKeyParameterNames *SubscriptionKeyParameterNamesContract `json:"subscriptionKeyParameterNames,omitempty"` + // APIType - Type of API. Possible values include: 'HTTP', 'Soap' + APIType APIType `json:"type,omitempty"` + // APIRevision - Describes the Revision of the Api. If no value is provided, default revision 1 is created + APIRevision *string `json:"apiRevision,omitempty"` + // APIVersion - Indicates the Version identifier of the API if the API is versioned + APIVersion *string `json:"apiVersion,omitempty"` + // IsCurrent - Indicates if API revision is current api revision. + IsCurrent *bool `json:"isCurrent,omitempty"` + // IsOnline - Indicates if API revision is accessible via the gateway. + IsOnline *bool `json:"isOnline,omitempty"` + // APIVersionSetID - A resource identifier for the related ApiVersionSet. + APIVersionSetID *string `json:"apiVersionSetId,omitempty"` +} + +// APICreateOrUpdatePropertiesWsdlSelector criteria to limit import of WSDL to a subset of the document. +type APICreateOrUpdatePropertiesWsdlSelector struct { + // WsdlServiceName - Name of service to import from WSDL + WsdlServiceName *string `json:"wsdlServiceName,omitempty"` + // WsdlEndpointName - Name of endpoint(port) to import from WSDL + WsdlEndpointName *string `json:"wsdlEndpointName,omitempty"` +} + +// APIEntityBaseContract API base contract details. +type APIEntityBaseContract struct { + // Description - Description of the API. May include HTML formatting tags. + Description *string `json:"description,omitempty"` + // AuthenticationSettings - Collection of authentication settings included into this API. + AuthenticationSettings *AuthenticationSettingsContract `json:"authenticationSettings,omitempty"` + // SubscriptionKeyParameterNames - Protocols over which API is made available. + SubscriptionKeyParameterNames *SubscriptionKeyParameterNamesContract `json:"subscriptionKeyParameterNames,omitempty"` + // APIType - Type of API. Possible values include: 'HTTP', 'Soap' + APIType APIType `json:"type,omitempty"` + // APIRevision - Describes the Revision of the Api. If no value is provided, default revision 1 is created + APIRevision *string `json:"apiRevision,omitempty"` + // APIVersion - Indicates the Version identifier of the API if the API is versioned + APIVersion *string `json:"apiVersion,omitempty"` + // IsCurrent - Indicates if API revision is current api revision. + IsCurrent *bool `json:"isCurrent,omitempty"` + // IsOnline - Indicates if API revision is accessible via the gateway. + IsOnline *bool `json:"isOnline,omitempty"` + // APIVersionSetID - A resource identifier for the related ApiVersionSet. + APIVersionSetID *string `json:"apiVersionSetId,omitempty"` +} + +// APIExportResult API Export result Blob Uri. +type APIExportResult struct { + autorest.Response `json:"-"` + // Link - Link to the Storage Blob containing the result of the export operation. The Blob Uri is only valid for 5 minutes. + Link *string `json:"link,omitempty"` +} + +// ApimResource the Resource definition. +type ApimResource struct { + // ID - Resource ID. + ID *string `json:"id,omitempty"` + // Name - Resource name. + Name *string `json:"name,omitempty"` + // Type - Resource type for API Management resource is set to Microsoft.ApiManagement. + Type *string `json:"type,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for ApimResource. +func (ar ApimResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ar.ID != nil { + objectMap["id"] = ar.ID + } + if ar.Name != nil { + objectMap["name"] = ar.Name + } + if ar.Type != nil { + objectMap["type"] = ar.Type + } + if ar.Tags != nil { + objectMap["tags"] = ar.Tags + } + return json.Marshal(objectMap) +} + +// APIReleaseCollection paged Api Revision list representation. +type APIReleaseCollection struct { + autorest.Response `json:"-"` + // Value - Page values. + Value *[]APIReleaseContract `json:"value,omitempty"` + // NextLink - Next page link if any. + NextLink *string `json:"nextLink,omitempty"` +} + +// APIReleaseCollectionIterator provides access to a complete listing of APIReleaseContract values. +type APIReleaseCollectionIterator struct { + i int + page APIReleaseCollectionPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *APIReleaseCollectionIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter APIReleaseCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter APIReleaseCollectionIterator) Response() APIReleaseCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter APIReleaseCollectionIterator) Value() APIReleaseContract { + if !iter.page.NotDone() { + return APIReleaseContract{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (arc APIReleaseCollection) IsEmpty() bool { + return arc.Value == nil || len(*arc.Value) == 0 +} + +// aPIReleaseCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (arc APIReleaseCollection) aPIReleaseCollectionPreparer() (*http.Request, error) { + if arc.NextLink == nil || len(to.String(arc.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(arc.NextLink))) +} + +// APIReleaseCollectionPage contains a page of APIReleaseContract values. +type APIReleaseCollectionPage struct { + fn func(APIReleaseCollection) (APIReleaseCollection, error) + arc APIReleaseCollection +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *APIReleaseCollectionPage) Next() error { + next, err := page.fn(page.arc) + if err != nil { + return err + } + page.arc = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page APIReleaseCollectionPage) NotDone() bool { + return !page.arc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page APIReleaseCollectionPage) Response() APIReleaseCollection { + return page.arc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page APIReleaseCollectionPage) Values() []APIReleaseContract { + if page.arc.IsEmpty() { + return nil + } + return *page.arc.Value +} + +// APIReleaseContract api Release details. +type APIReleaseContract struct { + autorest.Response `json:"-"` + // APIReleaseContractProperties - Properties of the Api Release Contract. + *APIReleaseContractProperties `json:"properties,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` + // Name - Resource name. + Name *string `json:"name,omitempty"` + // Type - Resource type for API Management resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for APIReleaseContract. +func (arc APIReleaseContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if arc.APIReleaseContractProperties != nil { + objectMap["properties"] = arc.APIReleaseContractProperties + } + if arc.ID != nil { + objectMap["id"] = arc.ID + } + if arc.Name != nil { + objectMap["name"] = arc.Name + } + if arc.Type != nil { + objectMap["type"] = arc.Type + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for APIReleaseContract struct. +func (arc *APIReleaseContract) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var APIReleaseContractProperties APIReleaseContractProperties + err = json.Unmarshal(*v, &APIReleaseContractProperties) + if err != nil { + return err + } + arc.APIReleaseContractProperties = &APIReleaseContractProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + arc.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + arc.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + arc.Type = &typeVar + } + } + } + + return nil +} + +// APIReleaseContractProperties API Release details +type APIReleaseContractProperties struct { + // APIID - Identifier of the API the release belongs to. + APIID *string `json:"apiId,omitempty"` + // CreatedDateTime - The time the API was released. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601 standard. + CreatedDateTime *date.Time `json:"createdDateTime,omitempty"` + // UpdatedDateTime - The time the API release was updated. + UpdatedDateTime *date.Time `json:"updatedDateTime,omitempty"` + // Notes - Release Notes + Notes *string `json:"notes,omitempty"` +} + +// APIRevisionCollection paged Api Revision list representation. +type APIRevisionCollection struct { + autorest.Response `json:"-"` + // Value - Page values. + Value *[]APIRevisionContract `json:"value,omitempty"` + // NextLink - Next page link if any. + NextLink *string `json:"nextLink,omitempty"` +} + +// APIRevisionCollectionIterator provides access to a complete listing of APIRevisionContract values. +type APIRevisionCollectionIterator struct { + i int + page APIRevisionCollectionPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *APIRevisionCollectionIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter APIRevisionCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter APIRevisionCollectionIterator) Response() APIRevisionCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter APIRevisionCollectionIterator) Value() APIRevisionContract { + if !iter.page.NotDone() { + return APIRevisionContract{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (arc APIRevisionCollection) IsEmpty() bool { + return arc.Value == nil || len(*arc.Value) == 0 +} + +// aPIRevisionCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (arc APIRevisionCollection) aPIRevisionCollectionPreparer() (*http.Request, error) { + if arc.NextLink == nil || len(to.String(arc.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(arc.NextLink))) +} + +// APIRevisionCollectionPage contains a page of APIRevisionContract values. +type APIRevisionCollectionPage struct { + fn func(APIRevisionCollection) (APIRevisionCollection, error) + arc APIRevisionCollection +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *APIRevisionCollectionPage) Next() error { + next, err := page.fn(page.arc) + if err != nil { + return err + } + page.arc = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page APIRevisionCollectionPage) NotDone() bool { + return !page.arc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page APIRevisionCollectionPage) Response() APIRevisionCollection { + return page.arc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page APIRevisionCollectionPage) Values() []APIRevisionContract { + if page.arc.IsEmpty() { + return nil + } + return *page.arc.Value +} + +// APIRevisionContract summary of revision metadata. +type APIRevisionContract struct { + // APIID - Identifier of the API Revision. + APIID *string `json:"apiId,omitempty"` + // APIRevision - Revision number of API. + APIRevision *string `json:"apiRevision,omitempty"` + // CreatedDateTime - The time the API Revision was created. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601 standard. + CreatedDateTime *date.Time `json:"createdDateTime,omitempty"` + // UpdatedDateTime - The time the API Revision were updated. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601 standard. + UpdatedDateTime *date.Time `json:"updatedDateTime,omitempty"` + // Description - Description of the API Revision. + Description *string `json:"description,omitempty"` + // PrivateURL - Gateway URL for accessing the non-current API Revision. + PrivateURL *string `json:"privateUrl,omitempty"` + // IsOnline - Indicates if API revision is the current api revision. + IsOnline *bool `json:"isOnline,omitempty"` + // IsCurrent - Indicates if API revision is accessible via the gateway. + IsCurrent *bool `json:"isCurrent,omitempty"` +} + +// APIRevisionInfoContract object used to create an API Revision or Version based on an existing API Revision +type APIRevisionInfoContract struct { + // SourceAPIID - Resource identifier of API to be used to create the revision from. + SourceAPIID *string `json:"sourceApiId,omitempty"` + // APIVersionName - Version identifier for the new API Version. + APIVersionName *string `json:"apiVersionName,omitempty"` + // APIRevisionDescription - Description of new API Revision. + APIRevisionDescription *string `json:"apiRevisionDescription,omitempty"` + // APIVersionSet - Version set details + APIVersionSet *APIVersionSetContractDetails `json:"apiVersionSet,omitempty"` +} + +// APITagResourceContractProperties API contract properties for the Tag Resources. +type APITagResourceContractProperties struct { + // ID - API identifier in the form /apis/{apiId}. + ID *string `json:"id,omitempty"` + // Name - API name. + Name *string `json:"name,omitempty"` + // ServiceURL - Absolute URL of the backend service implementing this API. + ServiceURL *string `json:"serviceUrl,omitempty"` + // Path - Relative URL uniquely identifying this API and all of its resource paths within the API Management service instance. It is appended to the API endpoint base URL specified during the service instance creation to form a public URL for this API. + Path *string `json:"path,omitempty"` + // Protocols - Describes on which protocols the operations in this API can be invoked. + Protocols *[]Protocol `json:"protocols,omitempty"` + // Description - Description of the API. May include HTML formatting tags. + Description *string `json:"description,omitempty"` + // AuthenticationSettings - Collection of authentication settings included into this API. + AuthenticationSettings *AuthenticationSettingsContract `json:"authenticationSettings,omitempty"` + // SubscriptionKeyParameterNames - Protocols over which API is made available. + SubscriptionKeyParameterNames *SubscriptionKeyParameterNamesContract `json:"subscriptionKeyParameterNames,omitempty"` + // APIType - Type of API. Possible values include: 'HTTP', 'Soap' + APIType APIType `json:"type,omitempty"` + // APIRevision - Describes the Revision of the Api. If no value is provided, default revision 1 is created + APIRevision *string `json:"apiRevision,omitempty"` + // APIVersion - Indicates the Version identifier of the API if the API is versioned + APIVersion *string `json:"apiVersion,omitempty"` + // IsCurrent - Indicates if API revision is current api revision. + IsCurrent *bool `json:"isCurrent,omitempty"` + // IsOnline - Indicates if API revision is accessible via the gateway. + IsOnline *bool `json:"isOnline,omitempty"` + // APIVersionSetID - A resource identifier for the related ApiVersionSet. + APIVersionSetID *string `json:"apiVersionSetId,omitempty"` +} + +// APIUpdateContract API update contract details. +type APIUpdateContract struct { + // APIContractUpdateProperties - Properties of the API entity that can be updated. + *APIContractUpdateProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for APIUpdateContract. +func (auc APIUpdateContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if auc.APIContractUpdateProperties != nil { + objectMap["properties"] = auc.APIContractUpdateProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for APIUpdateContract struct. +func (auc *APIUpdateContract) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var APIContractUpdateProperties APIContractUpdateProperties + err = json.Unmarshal(*v, &APIContractUpdateProperties) + if err != nil { + return err + } + auc.APIContractUpdateProperties = &APIContractUpdateProperties + } + } + } + + return nil +} + +// APIVersionSetCollection paged Api Version Set list representation. +type APIVersionSetCollection struct { + autorest.Response `json:"-"` + // Value - Page values. + Value *[]APIVersionSetContract `json:"value,omitempty"` + // NextLink - Next page link if any. + NextLink *string `json:"nextLink,omitempty"` +} + +// APIVersionSetCollectionIterator provides access to a complete listing of APIVersionSetContract values. +type APIVersionSetCollectionIterator struct { + i int + page APIVersionSetCollectionPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *APIVersionSetCollectionIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter APIVersionSetCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter APIVersionSetCollectionIterator) Response() APIVersionSetCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter APIVersionSetCollectionIterator) Value() APIVersionSetContract { + if !iter.page.NotDone() { + return APIVersionSetContract{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (avsc APIVersionSetCollection) IsEmpty() bool { + return avsc.Value == nil || len(*avsc.Value) == 0 +} + +// aPIVersionSetCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (avsc APIVersionSetCollection) aPIVersionSetCollectionPreparer() (*http.Request, error) { + if avsc.NextLink == nil || len(to.String(avsc.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(avsc.NextLink))) +} + +// APIVersionSetCollectionPage contains a page of APIVersionSetContract values. +type APIVersionSetCollectionPage struct { + fn func(APIVersionSetCollection) (APIVersionSetCollection, error) + avsc APIVersionSetCollection +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *APIVersionSetCollectionPage) Next() error { + next, err := page.fn(page.avsc) + if err != nil { + return err + } + page.avsc = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page APIVersionSetCollectionPage) NotDone() bool { + return !page.avsc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page APIVersionSetCollectionPage) Response() APIVersionSetCollection { + return page.avsc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page APIVersionSetCollectionPage) Values() []APIVersionSetContract { + if page.avsc.IsEmpty() { + return nil + } + return *page.avsc.Value +} + +// APIVersionSetContract api Version Set Contract details. +type APIVersionSetContract struct { + autorest.Response `json:"-"` + // APIVersionSetContractProperties - Api VersionSet contract properties. + *APIVersionSetContractProperties `json:"properties,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` + // Name - Resource name. + Name *string `json:"name,omitempty"` + // Type - Resource type for API Management resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for APIVersionSetContract. +func (avsc APIVersionSetContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if avsc.APIVersionSetContractProperties != nil { + objectMap["properties"] = avsc.APIVersionSetContractProperties + } + if avsc.ID != nil { + objectMap["id"] = avsc.ID + } + if avsc.Name != nil { + objectMap["name"] = avsc.Name + } + if avsc.Type != nil { + objectMap["type"] = avsc.Type + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for APIVersionSetContract struct. +func (avsc *APIVersionSetContract) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var APIVersionSetContractProperties APIVersionSetContractProperties + err = json.Unmarshal(*v, &APIVersionSetContractProperties) + if err != nil { + return err + } + avsc.APIVersionSetContractProperties = &APIVersionSetContractProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + avsc.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + avsc.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + avsc.Type = &typeVar + } + } + } + + return nil +} + +// APIVersionSetContractDetails an API Version Set contains the common configuration for a set of API Versions +// relating +type APIVersionSetContractDetails struct { + // ID - Identifier for existing API Version Set. Omit this value to create a new Version Set. + ID *string `json:"id,omitempty"` + // Description - Description of API Version Set. + Description *string `json:"description,omitempty"` + // VersioningScheme - An value that determines where the API Version identifer will be located in a HTTP request. Possible values include: 'VersioningScheme1Segment', 'VersioningScheme1Query', 'VersioningScheme1Header' + VersioningScheme VersioningScheme1 `json:"versioningScheme,omitempty"` + // VersionQueryName - Name of query parameter that indicates the API Version if versioningScheme is set to `query`. + VersionQueryName *string `json:"versionQueryName,omitempty"` + // VersionHeaderName - Name of HTTP header parameter that indicates the API Version if versioningScheme is set to `header`. + VersionHeaderName *string `json:"versionHeaderName,omitempty"` +} + +// APIVersionSetContractProperties properties of an API Version Set. +type APIVersionSetContractProperties struct { + // DisplayName - Name of API Version Set + DisplayName *string `json:"displayName,omitempty"` + // VersioningScheme - An value that determines where the API Version identifer will be located in a HTTP request. Possible values include: 'VersioningSchemeSegment', 'VersioningSchemeQuery', 'VersioningSchemeHeader' + VersioningScheme VersioningScheme `json:"versioningScheme,omitempty"` + // Description - Description of API Version Set. + Description *string `json:"description,omitempty"` + // VersionQueryName - Name of query parameter that indicates the API Version if versioningScheme is set to `query`. + VersionQueryName *string `json:"versionQueryName,omitempty"` + // VersionHeaderName - Name of HTTP header parameter that indicates the API Version if versioningScheme is set to `header`. + VersionHeaderName *string `json:"versionHeaderName,omitempty"` +} + +// APIVersionSetEntityBase api Version set base parameters +type APIVersionSetEntityBase struct { + // Description - Description of API Version Set. + Description *string `json:"description,omitempty"` + // VersionQueryName - Name of query parameter that indicates the API Version if versioningScheme is set to `query`. + VersionQueryName *string `json:"versionQueryName,omitempty"` + // VersionHeaderName - Name of HTTP header parameter that indicates the API Version if versioningScheme is set to `header`. + VersionHeaderName *string `json:"versionHeaderName,omitempty"` +} + +// APIVersionSetUpdateParameters parameters to update or create an Api Version Set Contract. +type APIVersionSetUpdateParameters struct { + // APIVersionSetUpdateParametersProperties - Parameters to update or create an Api Version Set Contract. + *APIVersionSetUpdateParametersProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for APIVersionSetUpdateParameters. +func (avsup APIVersionSetUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if avsup.APIVersionSetUpdateParametersProperties != nil { + objectMap["properties"] = avsup.APIVersionSetUpdateParametersProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for APIVersionSetUpdateParameters struct. +func (avsup *APIVersionSetUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var APIVersionSetUpdateParametersProperties APIVersionSetUpdateParametersProperties + err = json.Unmarshal(*v, &APIVersionSetUpdateParametersProperties) + if err != nil { + return err + } + avsup.APIVersionSetUpdateParametersProperties = &APIVersionSetUpdateParametersProperties + } + } + } + + return nil +} + +// APIVersionSetUpdateParametersProperties properties used to create or update an API Version Set. +type APIVersionSetUpdateParametersProperties struct { + // DisplayName - Name of API Version Set + DisplayName *string `json:"displayName,omitempty"` + // VersioningScheme - An value that determines where the API Version identifer will be located in a HTTP request. Possible values include: 'VersioningSchemeSegment', 'VersioningSchemeQuery', 'VersioningSchemeHeader' + VersioningScheme VersioningScheme `json:"versioningScheme,omitempty"` + // Description - Description of API Version Set. + Description *string `json:"description,omitempty"` + // VersionQueryName - Name of query parameter that indicates the API Version if versioningScheme is set to `query`. + VersionQueryName *string `json:"versionQueryName,omitempty"` + // VersionHeaderName - Name of HTTP header parameter that indicates the API Version if versioningScheme is set to `header`. + VersionHeaderName *string `json:"versionHeaderName,omitempty"` +} + +// AuthenticationSettingsContract API Authentication Settings. +type AuthenticationSettingsContract struct { + // OAuth2 - OAuth2 Authentication settings + OAuth2 *OAuth2AuthenticationSettingsContract `json:"oAuth2,omitempty"` +} + +// AuthorizationServerCollection paged OAuth2 Authorization Servers list representation. +type AuthorizationServerCollection struct { + autorest.Response `json:"-"` + // Value - Page values. + Value *[]AuthorizationServerContract `json:"value,omitempty"` + // Count - Total record count number across all pages. + Count *int64 `json:"count,omitempty"` + // NextLink - Next page link if any. + NextLink *string `json:"nextLink,omitempty"` +} + +// AuthorizationServerCollectionIterator provides access to a complete listing of AuthorizationServerContract +// values. +type AuthorizationServerCollectionIterator struct { + i int + page AuthorizationServerCollectionPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *AuthorizationServerCollectionIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter AuthorizationServerCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter AuthorizationServerCollectionIterator) Response() AuthorizationServerCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter AuthorizationServerCollectionIterator) Value() AuthorizationServerContract { + if !iter.page.NotDone() { + return AuthorizationServerContract{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (asc AuthorizationServerCollection) IsEmpty() bool { + return asc.Value == nil || len(*asc.Value) == 0 +} + +// authorizationServerCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (asc AuthorizationServerCollection) authorizationServerCollectionPreparer() (*http.Request, error) { + if asc.NextLink == nil || len(to.String(asc.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(asc.NextLink))) +} + +// AuthorizationServerCollectionPage contains a page of AuthorizationServerContract values. +type AuthorizationServerCollectionPage struct { + fn func(AuthorizationServerCollection) (AuthorizationServerCollection, error) + asc AuthorizationServerCollection +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *AuthorizationServerCollectionPage) Next() error { + next, err := page.fn(page.asc) + if err != nil { + return err + } + page.asc = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page AuthorizationServerCollectionPage) NotDone() bool { + return !page.asc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page AuthorizationServerCollectionPage) Response() AuthorizationServerCollection { + return page.asc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page AuthorizationServerCollectionPage) Values() []AuthorizationServerContract { + if page.asc.IsEmpty() { + return nil + } + return *page.asc.Value +} + +// AuthorizationServerContract external OAuth authorization server settings. +type AuthorizationServerContract struct { + autorest.Response `json:"-"` + // AuthorizationServerContractProperties - Properties of the External OAuth authorization server Contract. + *AuthorizationServerContractProperties `json:"properties,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` + // Name - Resource name. + Name *string `json:"name,omitempty"` + // Type - Resource type for API Management resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for AuthorizationServerContract. +func (asc AuthorizationServerContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if asc.AuthorizationServerContractProperties != nil { + objectMap["properties"] = asc.AuthorizationServerContractProperties + } + if asc.ID != nil { + objectMap["id"] = asc.ID + } + if asc.Name != nil { + objectMap["name"] = asc.Name + } + if asc.Type != nil { + objectMap["type"] = asc.Type + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for AuthorizationServerContract struct. +func (asc *AuthorizationServerContract) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var authorizationServerContractProperties AuthorizationServerContractProperties + err = json.Unmarshal(*v, &authorizationServerContractProperties) + if err != nil { + return err + } + asc.AuthorizationServerContractProperties = &authorizationServerContractProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + asc.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + asc.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + asc.Type = &typeVar + } + } + } + + return nil +} + +// AuthorizationServerContractBaseProperties external OAuth authorization server Update settings contract. +type AuthorizationServerContractBaseProperties struct { + // Description - Description of the authorization server. Can contain HTML formatting tags. + Description *string `json:"description,omitempty"` + // AuthorizationMethods - HTTP verbs supported by the authorization endpoint. GET must be always present. POST is optional. + AuthorizationMethods *[]AuthorizationMethod `json:"authorizationMethods,omitempty"` + // ClientAuthenticationMethod - Method of authentication supported by the token endpoint of this authorization server. Possible values are Basic and/or Body. When Body is specified, client credentials and other parameters are passed within the request body in the application/x-www-form-urlencoded format. + ClientAuthenticationMethod *[]ClientAuthenticationMethod `json:"clientAuthenticationMethod,omitempty"` + // TokenBodyParameters - Additional parameters required by the token endpoint of this authorization server represented as an array of JSON objects with name and value string properties, i.e. {"name" : "name value", "value": "a value"}. + TokenBodyParameters *[]TokenBodyParameterContract `json:"tokenBodyParameters,omitempty"` + // TokenEndpoint - OAuth token endpoint. Contains absolute URI to entity being referenced. + TokenEndpoint *string `json:"tokenEndpoint,omitempty"` + // SupportState - If true, authorization server will include state parameter from the authorization request to its response. Client may use state parameter to raise protocol security. + SupportState *bool `json:"supportState,omitempty"` + // DefaultScope - Access token scope that is going to be requested by default. Can be overridden at the API level. Should be provided in the form of a string containing space-delimited values. + DefaultScope *string `json:"defaultScope,omitempty"` + // BearerTokenSendingMethods - Specifies the mechanism by which access token is passed to the API. + BearerTokenSendingMethods *[]BearerTokenSendingMethod `json:"bearerTokenSendingMethods,omitempty"` + // ClientSecret - Client or app secret registered with this authorization server. + ClientSecret *string `json:"clientSecret,omitempty"` + // ResourceOwnerUsername - Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner username. + ResourceOwnerUsername *string `json:"resourceOwnerUsername,omitempty"` + // ResourceOwnerPassword - Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner password. + ResourceOwnerPassword *string `json:"resourceOwnerPassword,omitempty"` +} + +// AuthorizationServerContractProperties external OAuth authorization server settings Properties. +type AuthorizationServerContractProperties struct { + // DisplayName - User-friendly authorization server name. + DisplayName *string `json:"displayName,omitempty"` + // ClientRegistrationEndpoint - Optional reference to a page where client or app registration for this authorization server is performed. Contains absolute URL to entity being referenced. + ClientRegistrationEndpoint *string `json:"clientRegistrationEndpoint,omitempty"` + // AuthorizationEndpoint - OAuth authorization endpoint. See http://tools.ietf.org/html/rfc6749#section-3.2. + AuthorizationEndpoint *string `json:"authorizationEndpoint,omitempty"` + // GrantTypes - Form of an authorization grant, which the client uses to request the access token. + GrantTypes *[]GrantType `json:"grantTypes,omitempty"` + // ClientID - Client or app id registered with this authorization server. + ClientID *string `json:"clientId,omitempty"` + // Description - Description of the authorization server. Can contain HTML formatting tags. + Description *string `json:"description,omitempty"` + // AuthorizationMethods - HTTP verbs supported by the authorization endpoint. GET must be always present. POST is optional. + AuthorizationMethods *[]AuthorizationMethod `json:"authorizationMethods,omitempty"` + // ClientAuthenticationMethod - Method of authentication supported by the token endpoint of this authorization server. Possible values are Basic and/or Body. When Body is specified, client credentials and other parameters are passed within the request body in the application/x-www-form-urlencoded format. + ClientAuthenticationMethod *[]ClientAuthenticationMethod `json:"clientAuthenticationMethod,omitempty"` + // TokenBodyParameters - Additional parameters required by the token endpoint of this authorization server represented as an array of JSON objects with name and value string properties, i.e. {"name" : "name value", "value": "a value"}. + TokenBodyParameters *[]TokenBodyParameterContract `json:"tokenBodyParameters,omitempty"` + // TokenEndpoint - OAuth token endpoint. Contains absolute URI to entity being referenced. + TokenEndpoint *string `json:"tokenEndpoint,omitempty"` + // SupportState - If true, authorization server will include state parameter from the authorization request to its response. Client may use state parameter to raise protocol security. + SupportState *bool `json:"supportState,omitempty"` + // DefaultScope - Access token scope that is going to be requested by default. Can be overridden at the API level. Should be provided in the form of a string containing space-delimited values. + DefaultScope *string `json:"defaultScope,omitempty"` + // BearerTokenSendingMethods - Specifies the mechanism by which access token is passed to the API. + BearerTokenSendingMethods *[]BearerTokenSendingMethod `json:"bearerTokenSendingMethods,omitempty"` + // ClientSecret - Client or app secret registered with this authorization server. + ClientSecret *string `json:"clientSecret,omitempty"` + // ResourceOwnerUsername - Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner username. + ResourceOwnerUsername *string `json:"resourceOwnerUsername,omitempty"` + // ResourceOwnerPassword - Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner password. + ResourceOwnerPassword *string `json:"resourceOwnerPassword,omitempty"` +} + +// AuthorizationServerUpdateContract external OAuth authorization server settings. +type AuthorizationServerUpdateContract struct { + // AuthorizationServerUpdateContractProperties - Properties of the External OAuth authorization server update Contract. + *AuthorizationServerUpdateContractProperties `json:"properties,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` + // Name - Resource name. + Name *string `json:"name,omitempty"` + // Type - Resource type for API Management resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for AuthorizationServerUpdateContract. +func (asuc AuthorizationServerUpdateContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if asuc.AuthorizationServerUpdateContractProperties != nil { + objectMap["properties"] = asuc.AuthorizationServerUpdateContractProperties + } + if asuc.ID != nil { + objectMap["id"] = asuc.ID + } + if asuc.Name != nil { + objectMap["name"] = asuc.Name + } + if asuc.Type != nil { + objectMap["type"] = asuc.Type + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for AuthorizationServerUpdateContract struct. +func (asuc *AuthorizationServerUpdateContract) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var authorizationServerUpdateContractProperties AuthorizationServerUpdateContractProperties + err = json.Unmarshal(*v, &authorizationServerUpdateContractProperties) + if err != nil { + return err + } + asuc.AuthorizationServerUpdateContractProperties = &authorizationServerUpdateContractProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + asuc.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + asuc.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + asuc.Type = &typeVar + } + } + } + + return nil +} + +// AuthorizationServerUpdateContractProperties external OAuth authorization server Update settings contract. +type AuthorizationServerUpdateContractProperties struct { + // DisplayName - User-friendly authorization server name. + DisplayName *string `json:"displayName,omitempty"` + // ClientRegistrationEndpoint - Optional reference to a page where client or app registration for this authorization server is performed. Contains absolute URL to entity being referenced. + ClientRegistrationEndpoint *string `json:"clientRegistrationEndpoint,omitempty"` + // AuthorizationEndpoint - OAuth authorization endpoint. See http://tools.ietf.org/html/rfc6749#section-3.2. + AuthorizationEndpoint *string `json:"authorizationEndpoint,omitempty"` + // GrantTypes - Form of an authorization grant, which the client uses to request the access token. + GrantTypes *[]GrantType `json:"grantTypes,omitempty"` + // ClientID - Client or app id registered with this authorization server. + ClientID *string `json:"clientId,omitempty"` + // Description - Description of the authorization server. Can contain HTML formatting tags. + Description *string `json:"description,omitempty"` + // AuthorizationMethods - HTTP verbs supported by the authorization endpoint. GET must be always present. POST is optional. + AuthorizationMethods *[]AuthorizationMethod `json:"authorizationMethods,omitempty"` + // ClientAuthenticationMethod - Method of authentication supported by the token endpoint of this authorization server. Possible values are Basic and/or Body. When Body is specified, client credentials and other parameters are passed within the request body in the application/x-www-form-urlencoded format. + ClientAuthenticationMethod *[]ClientAuthenticationMethod `json:"clientAuthenticationMethod,omitempty"` + // TokenBodyParameters - Additional parameters required by the token endpoint of this authorization server represented as an array of JSON objects with name and value string properties, i.e. {"name" : "name value", "value": "a value"}. + TokenBodyParameters *[]TokenBodyParameterContract `json:"tokenBodyParameters,omitempty"` + // TokenEndpoint - OAuth token endpoint. Contains absolute URI to entity being referenced. + TokenEndpoint *string `json:"tokenEndpoint,omitempty"` + // SupportState - If true, authorization server will include state parameter from the authorization request to its response. Client may use state parameter to raise protocol security. + SupportState *bool `json:"supportState,omitempty"` + // DefaultScope - Access token scope that is going to be requested by default. Can be overridden at the API level. Should be provided in the form of a string containing space-delimited values. + DefaultScope *string `json:"defaultScope,omitempty"` + // BearerTokenSendingMethods - Specifies the mechanism by which access token is passed to the API. + BearerTokenSendingMethods *[]BearerTokenSendingMethod `json:"bearerTokenSendingMethods,omitempty"` + // ClientSecret - Client or app secret registered with this authorization server. + ClientSecret *string `json:"clientSecret,omitempty"` + // ResourceOwnerUsername - Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner username. + ResourceOwnerUsername *string `json:"resourceOwnerUsername,omitempty"` + // ResourceOwnerPassword - Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner password. + ResourceOwnerPassword *string `json:"resourceOwnerPassword,omitempty"` +} + +// BackendAuthorizationHeaderCredentials authorization header information. +type BackendAuthorizationHeaderCredentials struct { + // Scheme - Authentication Scheme name. + Scheme *string `json:"scheme,omitempty"` + // Parameter - Authentication Parameter value. + Parameter *string `json:"parameter,omitempty"` +} + +// BackendBaseParameters backend entity base Parameter set. +type BackendBaseParameters struct { + // Title - Backend Title. + Title *string `json:"title,omitempty"` + // Description - Backend Description. + Description *string `json:"description,omitempty"` + // ResourceID - Management Uri of the Resource in External System. This url can be the Arm Resource Id of Logic Apps, Function Apps or Api Apps. + ResourceID *string `json:"resourceId,omitempty"` + // Properties - Backend Properties contract + Properties *BackendProperties `json:"properties,omitempty"` + // Credentials - Backend Credentials Contract Properties + Credentials *BackendCredentialsContract `json:"credentials,omitempty"` + // Proxy - Backend Proxy Contract Properties + Proxy *BackendProxyContract `json:"proxy,omitempty"` + // TLS - Backend TLS Properties + TLS *BackendTLSProperties `json:"tls,omitempty"` +} + +// BackendCollection paged Backend list representation. +type BackendCollection struct { + autorest.Response `json:"-"` + // Value - Backend values. + Value *[]BackendContract `json:"value,omitempty"` + // NextLink - Next page link if any. + NextLink *string `json:"nextLink,omitempty"` +} + +// BackendCollectionIterator provides access to a complete listing of BackendContract values. +type BackendCollectionIterator struct { + i int + page BackendCollectionPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *BackendCollectionIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter BackendCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter BackendCollectionIterator) Response() BackendCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter BackendCollectionIterator) Value() BackendContract { + if !iter.page.NotDone() { + return BackendContract{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (bc BackendCollection) IsEmpty() bool { + return bc.Value == nil || len(*bc.Value) == 0 +} + +// backendCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (bc BackendCollection) backendCollectionPreparer() (*http.Request, error) { + if bc.NextLink == nil || len(to.String(bc.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(bc.NextLink))) +} + +// BackendCollectionPage contains a page of BackendContract values. +type BackendCollectionPage struct { + fn func(BackendCollection) (BackendCollection, error) + bc BackendCollection +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *BackendCollectionPage) Next() error { + next, err := page.fn(page.bc) + if err != nil { + return err + } + page.bc = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page BackendCollectionPage) NotDone() bool { + return !page.bc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page BackendCollectionPage) Response() BackendCollection { + return page.bc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page BackendCollectionPage) Values() []BackendContract { + if page.bc.IsEmpty() { + return nil + } + return *page.bc.Value +} + +// BackendContract backend details. +type BackendContract struct { + autorest.Response `json:"-"` + // BackendContractProperties - Backend entity contract properties. + *BackendContractProperties `json:"properties,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` + // Name - Resource name. + Name *string `json:"name,omitempty"` + // Type - Resource type for API Management resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for BackendContract. +func (bc BackendContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if bc.BackendContractProperties != nil { + objectMap["properties"] = bc.BackendContractProperties + } + if bc.ID != nil { + objectMap["id"] = bc.ID + } + if bc.Name != nil { + objectMap["name"] = bc.Name + } + if bc.Type != nil { + objectMap["type"] = bc.Type + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for BackendContract struct. +func (bc *BackendContract) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var backendContractProperties BackendContractProperties + err = json.Unmarshal(*v, &backendContractProperties) + if err != nil { + return err + } + bc.BackendContractProperties = &backendContractProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + bc.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + bc.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + bc.Type = &typeVar + } + } + } + + return nil +} + +// BackendContractProperties parameters supplied to the Create Backend operation. +type BackendContractProperties struct { + // URL - Runtime Url of the Backend. + URL *string `json:"url,omitempty"` + // Protocol - Backend communication protocol. Possible values include: 'BackendProtocolHTTP', 'BackendProtocolSoap' + Protocol BackendProtocol `json:"protocol,omitempty"` + // Title - Backend Title. + Title *string `json:"title,omitempty"` + // Description - Backend Description. + Description *string `json:"description,omitempty"` + // ResourceID - Management Uri of the Resource in External System. This url can be the Arm Resource Id of Logic Apps, Function Apps or Api Apps. + ResourceID *string `json:"resourceId,omitempty"` + // Properties - Backend Properties contract + Properties *BackendProperties `json:"properties,omitempty"` + // Credentials - Backend Credentials Contract Properties + Credentials *BackendCredentialsContract `json:"credentials,omitempty"` + // Proxy - Backend Proxy Contract Properties + Proxy *BackendProxyContract `json:"proxy,omitempty"` + // TLS - Backend TLS Properties + TLS *BackendTLSProperties `json:"tls,omitempty"` +} + +// BackendCredentialsContract details of the Credentials used to connect to Backend. +type BackendCredentialsContract struct { + // Certificate - List of Client Certificate Thumbprint. + Certificate *[]string `json:"certificate,omitempty"` + // Query - Query Parameter description. + Query map[string][]string `json:"query"` + // Header - Header Parameter description. + Header map[string][]string `json:"header"` + // Authorization - Authorization header authentication + Authorization *BackendAuthorizationHeaderCredentials `json:"authorization,omitempty"` +} + +// MarshalJSON is the custom marshaler for BackendCredentialsContract. +func (bcc BackendCredentialsContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if bcc.Certificate != nil { + objectMap["certificate"] = bcc.Certificate + } + if bcc.Query != nil { + objectMap["query"] = bcc.Query + } + if bcc.Header != nil { + objectMap["header"] = bcc.Header + } + if bcc.Authorization != nil { + objectMap["authorization"] = bcc.Authorization + } + return json.Marshal(objectMap) +} + +// BackendProperties properties specific to the Backend Type. +type BackendProperties struct { + // ServiceFabricCluster - Backend Service Fabric Cluster Properties + ServiceFabricCluster *BackendServiceFabricClusterProperties `json:"serviceFabricCluster,omitempty"` +} + +// BackendProxyContract details of the Backend WebProxy Server to use in the Request to Backend. +type BackendProxyContract struct { + // URL - WebProxy Server AbsoluteUri property which includes the entire URI stored in the Uri instance, including all fragments and query strings. + URL *string `json:"url,omitempty"` + // Username - Username to connect to the WebProxy server + Username *string `json:"username,omitempty"` + // Password - Password to connect to the WebProxy Server + Password *string `json:"password,omitempty"` +} + +// BackendReconnectContract reconnect request parameters. +type BackendReconnectContract struct { + // BackendReconnectProperties - Reconnect request properties. + *BackendReconnectProperties `json:"properties,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` + // Name - Resource name. + Name *string `json:"name,omitempty"` + // Type - Resource type for API Management resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for BackendReconnectContract. +func (brc BackendReconnectContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if brc.BackendReconnectProperties != nil { + objectMap["properties"] = brc.BackendReconnectProperties + } + if brc.ID != nil { + objectMap["id"] = brc.ID + } + if brc.Name != nil { + objectMap["name"] = brc.Name + } + if brc.Type != nil { + objectMap["type"] = brc.Type + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for BackendReconnectContract struct. +func (brc *BackendReconnectContract) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var backendReconnectProperties BackendReconnectProperties + err = json.Unmarshal(*v, &backendReconnectProperties) + if err != nil { + return err + } + brc.BackendReconnectProperties = &backendReconnectProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + brc.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + brc.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + brc.Type = &typeVar + } + } + } + + return nil +} + +// BackendReconnectProperties properties to control reconnect requests. +type BackendReconnectProperties struct { + // After - Duration in ISO8601 format after which reconnect will be initiated. Minimum duration of the Reconect is PT2M. + After *string `json:"after,omitempty"` +} + +// BackendServiceFabricClusterProperties properties of the Service Fabric Type Backend. +type BackendServiceFabricClusterProperties struct { + // ClientCertificatethumbprint - The client certificate thumbprint for the management endpoint. + ClientCertificatethumbprint *string `json:"clientCertificatethumbprint,omitempty"` + // MaxPartitionResolutionRetries - Maximum number of retries while attempting resolve the parition. + MaxPartitionResolutionRetries *int32 `json:"maxPartitionResolutionRetries,omitempty"` + // ManagementEndpoints - The cluster management endpoint. + ManagementEndpoints *[]string `json:"managementEndpoints,omitempty"` + // ServerCertificateThumbprints - Thumbprints of certificates cluster management service uses for tls communication + ServerCertificateThumbprints *[]string `json:"serverCertificateThumbprints,omitempty"` + // ServerX509Names - Server X509 Certificate Names Collection + ServerX509Names *[]X509CertificateName `json:"serverX509Names,omitempty"` +} + +// BackendTLSProperties properties controlling TLS Certificate Validation. +type BackendTLSProperties struct { + // ValidateCertificateChain - Flag indicating whether SSL certificate chain validation should be done when using self-signed certificates for this backend host. + ValidateCertificateChain *bool `json:"validateCertificateChain,omitempty"` + // ValidateCertificateName - Flag indicating whether SSL certificate name validation should be done when using self-signed certificates for this backend host. + ValidateCertificateName *bool `json:"validateCertificateName,omitempty"` +} + +// BackendUpdateParameterProperties parameters supplied to the Update Backend operation. +type BackendUpdateParameterProperties struct { + // URL - Runtime Url of the Backend. + URL *string `json:"url,omitempty"` + // Protocol - Backend communication protocol. Possible values include: 'BackendProtocolHTTP', 'BackendProtocolSoap' + Protocol BackendProtocol `json:"protocol,omitempty"` + // Title - Backend Title. + Title *string `json:"title,omitempty"` + // Description - Backend Description. + Description *string `json:"description,omitempty"` + // ResourceID - Management Uri of the Resource in External System. This url can be the Arm Resource Id of Logic Apps, Function Apps or Api Apps. + ResourceID *string `json:"resourceId,omitempty"` + // Properties - Backend Properties contract + Properties *BackendProperties `json:"properties,omitempty"` + // Credentials - Backend Credentials Contract Properties + Credentials *BackendCredentialsContract `json:"credentials,omitempty"` + // Proxy - Backend Proxy Contract Properties + Proxy *BackendProxyContract `json:"proxy,omitempty"` + // TLS - Backend TLS Properties + TLS *BackendTLSProperties `json:"tls,omitempty"` +} + +// BackendUpdateParameters backend update parameters. +type BackendUpdateParameters struct { + // BackendUpdateParameterProperties - Backend entity update contract properties. + *BackendUpdateParameterProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for BackendUpdateParameters. +func (bup BackendUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if bup.BackendUpdateParameterProperties != nil { + objectMap["properties"] = bup.BackendUpdateParameterProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for BackendUpdateParameters struct. +func (bup *BackendUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var backendUpdateParameterProperties BackendUpdateParameterProperties + err = json.Unmarshal(*v, &backendUpdateParameterProperties) + if err != nil { + return err + } + bup.BackendUpdateParameterProperties = &backendUpdateParameterProperties + } + } + } + + return nil +} + +// BodyDiagnosticSettings body logging settings. +type BodyDiagnosticSettings struct { + // Bytes - Number of request body bytes to log. + Bytes *int32 `json:"bytes,omitempty"` +} + +// CertificateCollection paged Certificates list representation. +type CertificateCollection struct { + autorest.Response `json:"-"` + // Value - Page values. + Value *[]CertificateContract `json:"value,omitempty"` + // NextLink - Next page link if any. + NextLink *string `json:"nextLink,omitempty"` +} + +// CertificateCollectionIterator provides access to a complete listing of CertificateContract values. +type CertificateCollectionIterator struct { + i int + page CertificateCollectionPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *CertificateCollectionIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter CertificateCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter CertificateCollectionIterator) Response() CertificateCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter CertificateCollectionIterator) Value() CertificateContract { + if !iter.page.NotDone() { + return CertificateContract{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (cc CertificateCollection) IsEmpty() bool { + return cc.Value == nil || len(*cc.Value) == 0 +} + +// certificateCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (cc CertificateCollection) certificateCollectionPreparer() (*http.Request, error) { + if cc.NextLink == nil || len(to.String(cc.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(cc.NextLink))) +} + +// CertificateCollectionPage contains a page of CertificateContract values. +type CertificateCollectionPage struct { + fn func(CertificateCollection) (CertificateCollection, error) + cc CertificateCollection +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *CertificateCollectionPage) Next() error { + next, err := page.fn(page.cc) + if err != nil { + return err + } + page.cc = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page CertificateCollectionPage) NotDone() bool { + return !page.cc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page CertificateCollectionPage) Response() CertificateCollection { + return page.cc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page CertificateCollectionPage) Values() []CertificateContract { + if page.cc.IsEmpty() { + return nil + } + return *page.cc.Value +} + +// CertificateConfiguration certificate configuration which consist of non-trusted intermediates and root +// certificates. +type CertificateConfiguration struct { + // EncodedCertificate - Base64 Encoded certificate. + EncodedCertificate *string `json:"encodedCertificate,omitempty"` + // CertificatePassword - Certificate Password. + CertificatePassword *string `json:"certificatePassword,omitempty"` + // StoreName - The System.Security.Cryptography.x509certificates.Storename certificate store location. Only Root and CertificateAuthority are valid locations. Possible values include: 'CertificateAuthority', 'Root' + StoreName StoreName `json:"storeName,omitempty"` + // Certificate - Certificate information. + Certificate *CertificateInformation `json:"certificate,omitempty"` +} + +// CertificateContract certificate details. +type CertificateContract struct { + autorest.Response `json:"-"` + // CertificateContractProperties - Certificate properties details. + *CertificateContractProperties `json:"properties,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` + // Name - Resource name. + Name *string `json:"name,omitempty"` + // Type - Resource type for API Management resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for CertificateContract. +func (cc CertificateContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cc.CertificateContractProperties != nil { + objectMap["properties"] = cc.CertificateContractProperties + } + if cc.ID != nil { + objectMap["id"] = cc.ID + } + if cc.Name != nil { + objectMap["name"] = cc.Name + } + if cc.Type != nil { + objectMap["type"] = cc.Type + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for CertificateContract struct. +func (cc *CertificateContract) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var certificateContractProperties CertificateContractProperties + err = json.Unmarshal(*v, &certificateContractProperties) + if err != nil { + return err + } + cc.CertificateContractProperties = &certificateContractProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + cc.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + cc.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + cc.Type = &typeVar + } + } + } + + return nil +} + +// CertificateContractProperties properties of the Certificate contract. +type CertificateContractProperties struct { + // Subject - Subject attribute of the certificate. + Subject *string `json:"subject,omitempty"` + // Thumbprint - Thumbprint of the certificate. + Thumbprint *string `json:"thumbprint,omitempty"` + // ExpirationDate - Expiration date of the certificate. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + ExpirationDate *date.Time `json:"expirationDate,omitempty"` +} + +// CertificateCreateOrUpdateParameters certificate create or update details. +type CertificateCreateOrUpdateParameters struct { + // CertificateCreateOrUpdateProperties - Certificate create or update properties details. + *CertificateCreateOrUpdateProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for CertificateCreateOrUpdateParameters. +func (ccoup CertificateCreateOrUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ccoup.CertificateCreateOrUpdateProperties != nil { + objectMap["properties"] = ccoup.CertificateCreateOrUpdateProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for CertificateCreateOrUpdateParameters struct. +func (ccoup *CertificateCreateOrUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var certificateCreateOrUpdateProperties CertificateCreateOrUpdateProperties + err = json.Unmarshal(*v, &certificateCreateOrUpdateProperties) + if err != nil { + return err + } + ccoup.CertificateCreateOrUpdateProperties = &certificateCreateOrUpdateProperties + } + } + } + + return nil +} + +// CertificateCreateOrUpdateProperties parameters supplied to the CreateOrUpdate certificate operation. +type CertificateCreateOrUpdateProperties struct { + // Data - Base 64 encoded certificate using the application/x-pkcs12 representation. + Data *string `json:"data,omitempty"` + // Password - Password for the Certificate + Password *string `json:"password,omitempty"` +} + +// CertificateInformation SSL certificate information. +type CertificateInformation struct { + autorest.Response `json:"-"` + // Expiry - Expiration date of the certificate. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + Expiry *date.Time `json:"expiry,omitempty"` + // Thumbprint - Thumbprint of the certificate. + Thumbprint *string `json:"thumbprint,omitempty"` + // Subject - Subject of the certificate. + Subject *string `json:"subject,omitempty"` +} + +// ConnectivityStatusContract details about connectivity to a resource. +type ConnectivityStatusContract struct { + // Name - The hostname of the resource which the service depends on. This can be the database, storage or any other azure resource on which the service depends upon. + Name *string `json:"name,omitempty"` + // Status - Resource Connectivity Status Type identifier. Possible values include: 'Initializing', 'Success', 'Failure' + Status ConnectivityStatusType `json:"status,omitempty"` + // Error - Error details of the connectivity to the resource. + Error *string `json:"error,omitempty"` + // LastUpdated - The date when the resource connectivity status was last updated. This status should be updated every 15 minutes. If this status has not been updated, then it means that the service has lost network connectivity to the resource, from inside the Virtual Network.The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + LastUpdated *date.Time `json:"lastUpdated,omitempty"` + // LastStatusChange - The date when the resource connectivity status last Changed from success to failure or vice-versa. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + LastStatusChange *date.Time `json:"lastStatusChange,omitempty"` +} + +// DeployConfigurationParameters parameters supplied to the Deploy Configuration operation. +type DeployConfigurationParameters struct { + // Branch - The name of the Git branch from which the configuration is to be deployed to the configuration database. + Branch *string `json:"branch,omitempty"` + // Force - The value enforcing deleting subscriptions to products that are deleted in this update. + Force *bool `json:"force,omitempty"` +} + +// DiagnosticCollection paged Diagnostic list representation. +type DiagnosticCollection struct { + autorest.Response `json:"-"` + // Value - Page values. + Value *[]DiagnosticContract `json:"value,omitempty"` + // NextLink - Next page link if any. + NextLink *string `json:"nextLink,omitempty"` +} + +// DiagnosticCollectionIterator provides access to a complete listing of DiagnosticContract values. +type DiagnosticCollectionIterator struct { + i int + page DiagnosticCollectionPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *DiagnosticCollectionIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter DiagnosticCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter DiagnosticCollectionIterator) Response() DiagnosticCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter DiagnosticCollectionIterator) Value() DiagnosticContract { + if !iter.page.NotDone() { + return DiagnosticContract{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (dc DiagnosticCollection) IsEmpty() bool { + return dc.Value == nil || len(*dc.Value) == 0 +} + +// diagnosticCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (dc DiagnosticCollection) diagnosticCollectionPreparer() (*http.Request, error) { + if dc.NextLink == nil || len(to.String(dc.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(dc.NextLink))) +} + +// DiagnosticCollectionPage contains a page of DiagnosticContract values. +type DiagnosticCollectionPage struct { + fn func(DiagnosticCollection) (DiagnosticCollection, error) + dc DiagnosticCollection +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *DiagnosticCollectionPage) Next() error { + next, err := page.fn(page.dc) + if err != nil { + return err + } + page.dc = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page DiagnosticCollectionPage) NotDone() bool { + return !page.dc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page DiagnosticCollectionPage) Response() DiagnosticCollection { + return page.dc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page DiagnosticCollectionPage) Values() []DiagnosticContract { + if page.dc.IsEmpty() { + return nil + } + return *page.dc.Value +} + +// DiagnosticContract diagnostic details. +type DiagnosticContract struct { + autorest.Response `json:"-"` + // DiagnosticContractProperties - Diagnostic entity contract properties. + *DiagnosticContractProperties `json:"properties,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` + // Name - Resource name. + Name *string `json:"name,omitempty"` + // Type - Resource type for API Management resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for DiagnosticContract. +func (dc DiagnosticContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dc.DiagnosticContractProperties != nil { + objectMap["properties"] = dc.DiagnosticContractProperties + } + if dc.ID != nil { + objectMap["id"] = dc.ID + } + if dc.Name != nil { + objectMap["name"] = dc.Name + } + if dc.Type != nil { + objectMap["type"] = dc.Type + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for DiagnosticContract struct. +func (dc *DiagnosticContract) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var diagnosticContractProperties DiagnosticContractProperties + err = json.Unmarshal(*v, &diagnosticContractProperties) + if err != nil { + return err + } + dc.DiagnosticContractProperties = &diagnosticContractProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + dc.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + dc.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + dc.Type = &typeVar + } + } + } + + return nil +} + +// DiagnosticContractProperties diagnostic Entity Properties +type DiagnosticContractProperties struct { + // AlwaysLog - Specifies for what type of messages sampling settings should not apply. Possible values include: 'AllErrors' + AlwaysLog AlwaysLog `json:"alwaysLog,omitempty"` + // LoggerID - Resource Id of a target logger. + LoggerID *string `json:"loggerId,omitempty"` + // Sampling - Sampling settings for Diagnostic. + Sampling *SamplingSettings `json:"sampling,omitempty"` + // Frontend - Diagnostic settings for incoming/outcoming HTTP messages to the Gateway. + Frontend *PipelineDiagnosticSettings `json:"frontend,omitempty"` + // Backend - Diagnostic settings for incoming/outcoming HTTP messages to the Backend + Backend *PipelineDiagnosticSettings `json:"backend,omitempty"` +} + +// EmailTemplateCollection paged email template list representation. +type EmailTemplateCollection struct { + autorest.Response `json:"-"` + // Value - Page values. + Value *[]EmailTemplateContract `json:"value,omitempty"` + // NextLink - Next page link if any. + NextLink *string `json:"nextLink,omitempty"` +} + +// EmailTemplateCollectionIterator provides access to a complete listing of EmailTemplateContract values. +type EmailTemplateCollectionIterator struct { + i int + page EmailTemplateCollectionPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *EmailTemplateCollectionIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter EmailTemplateCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter EmailTemplateCollectionIterator) Response() EmailTemplateCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter EmailTemplateCollectionIterator) Value() EmailTemplateContract { + if !iter.page.NotDone() { + return EmailTemplateContract{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (etc EmailTemplateCollection) IsEmpty() bool { + return etc.Value == nil || len(*etc.Value) == 0 +} + +// emailTemplateCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (etc EmailTemplateCollection) emailTemplateCollectionPreparer() (*http.Request, error) { + if etc.NextLink == nil || len(to.String(etc.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(etc.NextLink))) +} + +// EmailTemplateCollectionPage contains a page of EmailTemplateContract values. +type EmailTemplateCollectionPage struct { + fn func(EmailTemplateCollection) (EmailTemplateCollection, error) + etc EmailTemplateCollection +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *EmailTemplateCollectionPage) Next() error { + next, err := page.fn(page.etc) + if err != nil { + return err + } + page.etc = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page EmailTemplateCollectionPage) NotDone() bool { + return !page.etc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page EmailTemplateCollectionPage) Response() EmailTemplateCollection { + return page.etc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page EmailTemplateCollectionPage) Values() []EmailTemplateContract { + if page.etc.IsEmpty() { + return nil + } + return *page.etc.Value +} + +// EmailTemplateContract email Template details. +type EmailTemplateContract struct { + autorest.Response `json:"-"` + // EmailTemplateContractProperties - Email Template entity contract properties. + *EmailTemplateContractProperties `json:"properties,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` + // Name - Resource name. + Name *string `json:"name,omitempty"` + // Type - Resource type for API Management resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for EmailTemplateContract. +func (etc EmailTemplateContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if etc.EmailTemplateContractProperties != nil { + objectMap["properties"] = etc.EmailTemplateContractProperties + } + if etc.ID != nil { + objectMap["id"] = etc.ID + } + if etc.Name != nil { + objectMap["name"] = etc.Name + } + if etc.Type != nil { + objectMap["type"] = etc.Type + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for EmailTemplateContract struct. +func (etc *EmailTemplateContract) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var emailTemplateContractProperties EmailTemplateContractProperties + err = json.Unmarshal(*v, &emailTemplateContractProperties) + if err != nil { + return err + } + etc.EmailTemplateContractProperties = &emailTemplateContractProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + etc.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + etc.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + etc.Type = &typeVar + } + } + } + + return nil +} + +// EmailTemplateContractProperties email Template Contract properties. +type EmailTemplateContractProperties struct { + // Subject - Subject of the Template. + Subject *string `json:"subject,omitempty"` + // Body - Email Template Body. This should be a valid XDocument + Body *string `json:"body,omitempty"` + // Title - Title of the Template. + Title *string `json:"title,omitempty"` + // Description - Description of the Email Template. + Description *string `json:"description,omitempty"` + // IsDefault - Whether the template is the default template provided by Api Management or has been edited. + IsDefault *bool `json:"isDefault,omitempty"` + // Parameters - Email Template Parameter values. + Parameters *[]EmailTemplateParametersContractProperties `json:"parameters,omitempty"` +} + +// EmailTemplateParametersContractProperties email Template Parameter contract. +type EmailTemplateParametersContractProperties struct { + // Name - Template parameter name. + Name *string `json:"name,omitempty"` + // Title - Template parameter title. + Title *string `json:"title,omitempty"` + // Description - Template parameter description. + Description *string `json:"description,omitempty"` +} + +// EmailTemplateUpdateParameterProperties email Template Update Contract properties. +type EmailTemplateUpdateParameterProperties struct { + // Subject - Subject of the Template. + Subject *string `json:"subject,omitempty"` + // Title - Title of the Template. + Title *string `json:"title,omitempty"` + // Description - Description of the Email Template. + Description *string `json:"description,omitempty"` + // Body - Email Template Body. This should be a valid XDocument + Body *string `json:"body,omitempty"` + // Parameters - Email Template Parameter values. + Parameters *[]EmailTemplateParametersContractProperties `json:"parameters,omitempty"` +} + +// EmailTemplateUpdateParameters email Template update Parameters. +type EmailTemplateUpdateParameters struct { + // EmailTemplateUpdateParameterProperties - Email Template Update contract properties. + *EmailTemplateUpdateParameterProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for EmailTemplateUpdateParameters. +func (etup EmailTemplateUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if etup.EmailTemplateUpdateParameterProperties != nil { + objectMap["properties"] = etup.EmailTemplateUpdateParameterProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for EmailTemplateUpdateParameters struct. +func (etup *EmailTemplateUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var emailTemplateUpdateParameterProperties EmailTemplateUpdateParameterProperties + err = json.Unmarshal(*v, &emailTemplateUpdateParameterProperties) + if err != nil { + return err + } + etup.EmailTemplateUpdateParameterProperties = &emailTemplateUpdateParameterProperties + } + } + } + + return nil +} + +// ErrorFieldContract error Field contract. +type ErrorFieldContract struct { + // Code - Property level error code. + Code *string `json:"code,omitempty"` + // Message - Human-readable representation of property-level error. + Message *string `json:"message,omitempty"` + // Target - Property name. + Target *string `json:"target,omitempty"` +} + +// ErrorResponse error Response. +type ErrorResponse struct { + // ErrorResponseBody - Properties of the Error Response. + *ErrorResponseBody `json:"error,omitempty"` +} + +// MarshalJSON is the custom marshaler for ErrorResponse. +func (er ErrorResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if er.ErrorResponseBody != nil { + objectMap["error"] = er.ErrorResponseBody + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ErrorResponse struct. +func (er *ErrorResponse) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "error": + if v != nil { + var errorResponseBody ErrorResponseBody + err = json.Unmarshal(*v, &errorResponseBody) + if err != nil { + return err + } + er.ErrorResponseBody = &errorResponseBody + } + } + } + + return nil +} + +// ErrorResponseBody error Body contract. +type ErrorResponseBody struct { + // Code - Service-defined error code. This code serves as a sub-status for the HTTP error code specified in the response. + Code *string `json:"code,omitempty"` + // Message - Human-readable representation of the error. + Message *string `json:"message,omitempty"` + // Details - The list of invalid fields send in request, in case of validation error. + Details *[]ErrorFieldContract `json:"details,omitempty"` +} + +// GenerateSsoURLResult generate SSO Url operations response details. +type GenerateSsoURLResult struct { + autorest.Response `json:"-"` + // Value - Redirect Url containing the SSO URL value. + Value *string `json:"value,omitempty"` +} + +// GroupCollection paged Group list representation. +type GroupCollection struct { + autorest.Response `json:"-"` + // Value - Page values. + Value *[]GroupContract `json:"value,omitempty"` + // NextLink - Next page link if any. + NextLink *string `json:"nextLink,omitempty"` +} + +// GroupCollectionIterator provides access to a complete listing of GroupContract values. +type GroupCollectionIterator struct { + i int + page GroupCollectionPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *GroupCollectionIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter GroupCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter GroupCollectionIterator) Response() GroupCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter GroupCollectionIterator) Value() GroupContract { + if !iter.page.NotDone() { + return GroupContract{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (gc GroupCollection) IsEmpty() bool { + return gc.Value == nil || len(*gc.Value) == 0 +} + +// groupCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (gc GroupCollection) groupCollectionPreparer() (*http.Request, error) { + if gc.NextLink == nil || len(to.String(gc.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(gc.NextLink))) +} + +// GroupCollectionPage contains a page of GroupContract values. +type GroupCollectionPage struct { + fn func(GroupCollection) (GroupCollection, error) + gc GroupCollection +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *GroupCollectionPage) Next() error { + next, err := page.fn(page.gc) + if err != nil { + return err + } + page.gc = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page GroupCollectionPage) NotDone() bool { + return !page.gc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page GroupCollectionPage) Response() GroupCollection { + return page.gc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page GroupCollectionPage) Values() []GroupContract { + if page.gc.IsEmpty() { + return nil + } + return *page.gc.Value +} + +// GroupContract contract details. +type GroupContract struct { + autorest.Response `json:"-"` + // GroupContractProperties - Group entity contract properties. + *GroupContractProperties `json:"properties,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` + // Name - Resource name. + Name *string `json:"name,omitempty"` + // Type - Resource type for API Management resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for GroupContract. +func (gc GroupContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if gc.GroupContractProperties != nil { + objectMap["properties"] = gc.GroupContractProperties + } + if gc.ID != nil { + objectMap["id"] = gc.ID + } + if gc.Name != nil { + objectMap["name"] = gc.Name + } + if gc.Type != nil { + objectMap["type"] = gc.Type + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for GroupContract struct. +func (gc *GroupContract) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var groupContractProperties GroupContractProperties + err = json.Unmarshal(*v, &groupContractProperties) + if err != nil { + return err + } + gc.GroupContractProperties = &groupContractProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + gc.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + gc.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + gc.Type = &typeVar + } + } + } + + return nil +} + +// GroupContractProperties group contract Properties. +type GroupContractProperties struct { + // DisplayName - Group name. + DisplayName *string `json:"displayName,omitempty"` + // Description - Group description. Can contain HTML formatting tags. + Description *string `json:"description,omitempty"` + // BuiltIn - true if the group is one of the three system groups (Administrators, Developers, or Guests); otherwise false. + BuiltIn *bool `json:"builtIn,omitempty"` + // Type - Group type. Possible values include: 'Custom', 'System', 'External' + Type GroupType `json:"type,omitempty"` + // ExternalID - For external groups, this property contains the id of the group from the external identity provider, e.g. for Azure Active Directory aad://.onmicrosoft.com/groups/; otherwise the value is null. + ExternalID *string `json:"externalId,omitempty"` +} + +// GroupCreateParameters parameters supplied to the Create Group operation. +type GroupCreateParameters struct { + // GroupCreateParametersProperties - Properties supplied to Create Group operation. + *GroupCreateParametersProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for GroupCreateParameters. +func (gcp GroupCreateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if gcp.GroupCreateParametersProperties != nil { + objectMap["properties"] = gcp.GroupCreateParametersProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for GroupCreateParameters struct. +func (gcp *GroupCreateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var groupCreateParametersProperties GroupCreateParametersProperties + err = json.Unmarshal(*v, &groupCreateParametersProperties) + if err != nil { + return err + } + gcp.GroupCreateParametersProperties = &groupCreateParametersProperties + } + } + } + + return nil +} + +// GroupCreateParametersProperties parameters supplied to the Create Group operation. +type GroupCreateParametersProperties struct { + // DisplayName - Group name. + DisplayName *string `json:"displayName,omitempty"` + // Description - Group description. + Description *string `json:"description,omitempty"` + // Type - Group type. Possible values include: 'Custom', 'System', 'External' + Type GroupType `json:"type,omitempty"` + // ExternalID - Identifier of the external groups, this property contains the id of the group from the external identity provider, e.g. for Azure Active Directory aad://.onmicrosoft.com/groups/; otherwise the value is null. + ExternalID *string `json:"externalId,omitempty"` +} + +// GroupUpdateParameters parameters supplied to the Update Group operation. +type GroupUpdateParameters struct { + // GroupUpdateParametersProperties - Group entity update contract properties. + *GroupUpdateParametersProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for GroupUpdateParameters. +func (gup GroupUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if gup.GroupUpdateParametersProperties != nil { + objectMap["properties"] = gup.GroupUpdateParametersProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for GroupUpdateParameters struct. +func (gup *GroupUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var groupUpdateParametersProperties GroupUpdateParametersProperties + err = json.Unmarshal(*v, &groupUpdateParametersProperties) + if err != nil { + return err + } + gup.GroupUpdateParametersProperties = &groupUpdateParametersProperties + } + } + } + + return nil +} + +// GroupUpdateParametersProperties parameters supplied to the Update Group operation. +type GroupUpdateParametersProperties struct { + // DisplayName - Group name. + DisplayName *string `json:"displayName,omitempty"` + // Description - Group description. + Description *string `json:"description,omitempty"` + // Type - Group type. Possible values include: 'Custom', 'System', 'External' + Type GroupType `json:"type,omitempty"` + // ExternalID - Identifier of the external groups, this property contains the id of the group from the external identity provider, e.g. for Azure Active Directory aad://.onmicrosoft.com/groups/; otherwise the value is null. + ExternalID *string `json:"externalId,omitempty"` +} + +// HostnameConfiguration custom hostname configuration. +type HostnameConfiguration struct { + // Type - Hostname type. Possible values include: 'Proxy', 'Portal', 'Management', 'Scm' + Type HostnameType `json:"type,omitempty"` + // HostName - Hostname to configure on the Api Management service. + HostName *string `json:"hostName,omitempty"` + // KeyVaultID - Url to the KeyVault Secret containing the Ssl Certificate. If absolute Url containing version is provided, auto-update of ssl certificate will not work. This requires Api Management service to be configured with MSI. The secret should be of type *application/x-pkcs12* + KeyVaultID *string `json:"keyVaultId,omitempty"` + // EncodedCertificate - Base64 Encoded certificate. + EncodedCertificate *string `json:"encodedCertificate,omitempty"` + // CertificatePassword - Certificate Password. + CertificatePassword *string `json:"certificatePassword,omitempty"` + // DefaultSslBinding - Specify true to setup the certificate associated with this Hostname as the Default SSL Certificate. If a client does not send the SNI header, then this will be the certificate that will be challenged. The property is useful if a service has multiple custom hostname enabled and it needs to decide on the default ssl certificate. The setting only applied to Proxy Hostname Type. + DefaultSslBinding *bool `json:"defaultSslBinding,omitempty"` + // NegotiateClientCertificate - Specify true to always negotiate client certificate on the hostname. Default Value is false. + NegotiateClientCertificate *bool `json:"negotiateClientCertificate,omitempty"` + // Certificate - Certificate information. + Certificate *CertificateInformation `json:"certificate,omitempty"` +} + +// HostnameConfigurationOld custom hostname configuration. +type HostnameConfigurationOld struct { + // Type - Hostname type. Possible values include: 'Proxy', 'Portal', 'Management', 'Scm' + Type HostnameType `json:"type,omitempty"` + // Hostname - Hostname to configure. + Hostname *string `json:"hostname,omitempty"` + // Certificate - Certificate information. + Certificate *CertificateInformation `json:"certificate,omitempty"` +} + +// HTTPMessageDiagnostic http message diagnostic settings. +type HTTPMessageDiagnostic struct { + // Headers - Array of HTTP Headers to log. + Headers *[]string `json:"headers,omitempty"` + // Body - Body logging settings. + Body *BodyDiagnosticSettings `json:"body,omitempty"` +} + +// IdentityProviderBaseParameters identity Provider Base Parameter Properties. +type IdentityProviderBaseParameters struct { + // Type - Identity Provider Type identifier. Possible values include: 'Facebook', 'Google', 'Microsoft', 'Twitter', 'Aad', 'AadB2C' + Type IdentityProviderType `json:"type,omitempty"` + // AllowedTenants - List of Allowed Tenants when configuring Azure Active Directory login. + AllowedTenants *[]string `json:"allowedTenants,omitempty"` + // SignupPolicyName - Signup Policy Name. Only applies to AAD B2C Identity Provider. + SignupPolicyName *string `json:"signupPolicyName,omitempty"` + // SigninPolicyName - Signin Policy Name. Only applies to AAD B2C Identity Provider. + SigninPolicyName *string `json:"signinPolicyName,omitempty"` + // ProfileEditingPolicyName - Profile Editing Policy Name. Only applies to AAD B2C Identity Provider. + ProfileEditingPolicyName *string `json:"profileEditingPolicyName,omitempty"` + // PasswordResetPolicyName - Password Reset Policy Name. Only applies to AAD B2C Identity Provider. + PasswordResetPolicyName *string `json:"passwordResetPolicyName,omitempty"` +} + +// IdentityProviderContract identity Provider details. +type IdentityProviderContract struct { + autorest.Response `json:"-"` + // IdentityProviderContractProperties - Identity Provider contract properties. + *IdentityProviderContractProperties `json:"properties,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` + // Name - Resource name. + Name *string `json:"name,omitempty"` + // Type - Resource type for API Management resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for IdentityProviderContract. +func (ipc IdentityProviderContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ipc.IdentityProviderContractProperties != nil { + objectMap["properties"] = ipc.IdentityProviderContractProperties + } + if ipc.ID != nil { + objectMap["id"] = ipc.ID + } + if ipc.Name != nil { + objectMap["name"] = ipc.Name + } + if ipc.Type != nil { + objectMap["type"] = ipc.Type + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for IdentityProviderContract struct. +func (ipc *IdentityProviderContract) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var identityProviderContractProperties IdentityProviderContractProperties + err = json.Unmarshal(*v, &identityProviderContractProperties) + if err != nil { + return err + } + ipc.IdentityProviderContractProperties = &identityProviderContractProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ipc.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ipc.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ipc.Type = &typeVar + } + } + } + + return nil +} + +// IdentityProviderContractProperties the external Identity Providers like Facebook, Google, Microsoft, Twitter or +// Azure Active Directory which can be used to enable access to the API Management service developer portal for all +// users. +type IdentityProviderContractProperties struct { + // ClientID - Client Id of the Application in the external Identity Provider. It is App ID for Facebook login, Client ID for Google login, App ID for Microsoft. + ClientID *string `json:"clientId,omitempty"` + // ClientSecret - Client secret of the Application in external Identity Provider, used to authenticate login request. For example, it is App Secret for Facebook login, API Key for Google login, Public Key for Microsoft. + ClientSecret *string `json:"clientSecret,omitempty"` + // Type - Identity Provider Type identifier. Possible values include: 'Facebook', 'Google', 'Microsoft', 'Twitter', 'Aad', 'AadB2C' + Type IdentityProviderType `json:"type,omitempty"` + // AllowedTenants - List of Allowed Tenants when configuring Azure Active Directory login. + AllowedTenants *[]string `json:"allowedTenants,omitempty"` + // SignupPolicyName - Signup Policy Name. Only applies to AAD B2C Identity Provider. + SignupPolicyName *string `json:"signupPolicyName,omitempty"` + // SigninPolicyName - Signin Policy Name. Only applies to AAD B2C Identity Provider. + SigninPolicyName *string `json:"signinPolicyName,omitempty"` + // ProfileEditingPolicyName - Profile Editing Policy Name. Only applies to AAD B2C Identity Provider. + ProfileEditingPolicyName *string `json:"profileEditingPolicyName,omitempty"` + // PasswordResetPolicyName - Password Reset Policy Name. Only applies to AAD B2C Identity Provider. + PasswordResetPolicyName *string `json:"passwordResetPolicyName,omitempty"` +} + +// IdentityProviderList list of all the Identity Providers configured on the service instance. +type IdentityProviderList struct { + autorest.Response `json:"-"` + // Value - Identity Provider configuration values. + Value *[]IdentityProviderContract `json:"value,omitempty"` + // NextLink - Next page link if any. + NextLink *string `json:"nextLink,omitempty"` +} + +// IdentityProviderListIterator provides access to a complete listing of IdentityProviderContract values. +type IdentityProviderListIterator struct { + i int + page IdentityProviderListPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *IdentityProviderListIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter IdentityProviderListIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter IdentityProviderListIterator) Response() IdentityProviderList { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter IdentityProviderListIterator) Value() IdentityProviderContract { + if !iter.page.NotDone() { + return IdentityProviderContract{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (ipl IdentityProviderList) IsEmpty() bool { + return ipl.Value == nil || len(*ipl.Value) == 0 +} + +// identityProviderListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (ipl IdentityProviderList) identityProviderListPreparer() (*http.Request, error) { + if ipl.NextLink == nil || len(to.String(ipl.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(ipl.NextLink))) +} + +// IdentityProviderListPage contains a page of IdentityProviderContract values. +type IdentityProviderListPage struct { + fn func(IdentityProviderList) (IdentityProviderList, error) + ipl IdentityProviderList +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *IdentityProviderListPage) Next() error { + next, err := page.fn(page.ipl) + if err != nil { + return err + } + page.ipl = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page IdentityProviderListPage) NotDone() bool { + return !page.ipl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page IdentityProviderListPage) Response() IdentityProviderList { + return page.ipl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page IdentityProviderListPage) Values() []IdentityProviderContract { + if page.ipl.IsEmpty() { + return nil + } + return *page.ipl.Value +} + +// IdentityProviderUpdateParameters parameters supplied to update Identity Provider +type IdentityProviderUpdateParameters struct { + // IdentityProviderUpdateProperties - Identity Provider update properties. + *IdentityProviderUpdateProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for IdentityProviderUpdateParameters. +func (ipup IdentityProviderUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ipup.IdentityProviderUpdateProperties != nil { + objectMap["properties"] = ipup.IdentityProviderUpdateProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for IdentityProviderUpdateParameters struct. +func (ipup *IdentityProviderUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var identityProviderUpdateProperties IdentityProviderUpdateProperties + err = json.Unmarshal(*v, &identityProviderUpdateProperties) + if err != nil { + return err + } + ipup.IdentityProviderUpdateProperties = &identityProviderUpdateProperties + } + } + } + + return nil +} + +// IdentityProviderUpdateProperties parameters supplied to the Update Identity Provider operation. +type IdentityProviderUpdateProperties struct { + // ClientID - Client Id of the Application in the external Identity Provider. It is App ID for Facebook login, Client ID for Google login, App ID for Microsoft. + ClientID *string `json:"clientId,omitempty"` + // ClientSecret - Client secret of the Application in external Identity Provider, used to authenticate login request. For example, it is App Secret for Facebook login, API Key for Google login, Public Key for Microsoft. + ClientSecret *string `json:"clientSecret,omitempty"` + // Type - Identity Provider Type identifier. Possible values include: 'Facebook', 'Google', 'Microsoft', 'Twitter', 'Aad', 'AadB2C' + Type IdentityProviderType `json:"type,omitempty"` + // AllowedTenants - List of Allowed Tenants when configuring Azure Active Directory login. + AllowedTenants *[]string `json:"allowedTenants,omitempty"` + // SignupPolicyName - Signup Policy Name. Only applies to AAD B2C Identity Provider. + SignupPolicyName *string `json:"signupPolicyName,omitempty"` + // SigninPolicyName - Signin Policy Name. Only applies to AAD B2C Identity Provider. + SigninPolicyName *string `json:"signinPolicyName,omitempty"` + // ProfileEditingPolicyName - Profile Editing Policy Name. Only applies to AAD B2C Identity Provider. + ProfileEditingPolicyName *string `json:"profileEditingPolicyName,omitempty"` + // PasswordResetPolicyName - Password Reset Policy Name. Only applies to AAD B2C Identity Provider. + PasswordResetPolicyName *string `json:"passwordResetPolicyName,omitempty"` +} + +// IssueAttachmentCollection paged Issue Attachment list representation. +type IssueAttachmentCollection struct { + autorest.Response `json:"-"` + // Value - Issue Attachment values. + Value *[]IssueAttachmentContract `json:"value,omitempty"` + // NextLink - Next page link if any. + NextLink *string `json:"nextLink,omitempty"` +} + +// IssueAttachmentCollectionIterator provides access to a complete listing of IssueAttachmentContract values. +type IssueAttachmentCollectionIterator struct { + i int + page IssueAttachmentCollectionPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *IssueAttachmentCollectionIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter IssueAttachmentCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter IssueAttachmentCollectionIterator) Response() IssueAttachmentCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter IssueAttachmentCollectionIterator) Value() IssueAttachmentContract { + if !iter.page.NotDone() { + return IssueAttachmentContract{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (iac IssueAttachmentCollection) IsEmpty() bool { + return iac.Value == nil || len(*iac.Value) == 0 +} + +// issueAttachmentCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (iac IssueAttachmentCollection) issueAttachmentCollectionPreparer() (*http.Request, error) { + if iac.NextLink == nil || len(to.String(iac.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(iac.NextLink))) +} + +// IssueAttachmentCollectionPage contains a page of IssueAttachmentContract values. +type IssueAttachmentCollectionPage struct { + fn func(IssueAttachmentCollection) (IssueAttachmentCollection, error) + iac IssueAttachmentCollection +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *IssueAttachmentCollectionPage) Next() error { + next, err := page.fn(page.iac) + if err != nil { + return err + } + page.iac = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page IssueAttachmentCollectionPage) NotDone() bool { + return !page.iac.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page IssueAttachmentCollectionPage) Response() IssueAttachmentCollection { + return page.iac +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page IssueAttachmentCollectionPage) Values() []IssueAttachmentContract { + if page.iac.IsEmpty() { + return nil + } + return *page.iac.Value +} + +// IssueAttachmentContract issue Attachment Contract details. +type IssueAttachmentContract struct { + autorest.Response `json:"-"` + // IssueAttachmentContractProperties - Properties of the Issue Attachment. + *IssueAttachmentContractProperties `json:"properties,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` + // Name - Resource name. + Name *string `json:"name,omitempty"` + // Type - Resource type for API Management resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for IssueAttachmentContract. +func (iac IssueAttachmentContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if iac.IssueAttachmentContractProperties != nil { + objectMap["properties"] = iac.IssueAttachmentContractProperties + } + if iac.ID != nil { + objectMap["id"] = iac.ID + } + if iac.Name != nil { + objectMap["name"] = iac.Name + } + if iac.Type != nil { + objectMap["type"] = iac.Type + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for IssueAttachmentContract struct. +func (iac *IssueAttachmentContract) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var issueAttachmentContractProperties IssueAttachmentContractProperties + err = json.Unmarshal(*v, &issueAttachmentContractProperties) + if err != nil { + return err + } + iac.IssueAttachmentContractProperties = &issueAttachmentContractProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + iac.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + iac.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + iac.Type = &typeVar + } + } + } + + return nil +} + +// IssueAttachmentContractProperties issue Attachment contract Properties. +type IssueAttachmentContractProperties struct { + // Title - Filename by which the binary data will be saved. + Title *string `json:"title,omitempty"` + // ContentFormat - Either 'link' if content is provided via an HTTP link or the MIME type of the Base64-encoded binary data provided in the 'content' property. + ContentFormat *string `json:"contentFormat,omitempty"` + // Content - An HTTP link or Base64-encoded binary data. + Content *string `json:"content,omitempty"` +} + +// IssueCollection paged Issue list representation. +type IssueCollection struct { + autorest.Response `json:"-"` + // Value - Issue values. + Value *[]IssueContract `json:"value,omitempty"` + // NextLink - Next page link if any. + NextLink *string `json:"nextLink,omitempty"` +} + +// IssueCollectionIterator provides access to a complete listing of IssueContract values. +type IssueCollectionIterator struct { + i int + page IssueCollectionPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *IssueCollectionIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter IssueCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter IssueCollectionIterator) Response() IssueCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter IssueCollectionIterator) Value() IssueContract { + if !iter.page.NotDone() { + return IssueContract{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (ic IssueCollection) IsEmpty() bool { + return ic.Value == nil || len(*ic.Value) == 0 +} + +// issueCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (ic IssueCollection) issueCollectionPreparer() (*http.Request, error) { + if ic.NextLink == nil || len(to.String(ic.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(ic.NextLink))) +} + +// IssueCollectionPage contains a page of IssueContract values. +type IssueCollectionPage struct { + fn func(IssueCollection) (IssueCollection, error) + ic IssueCollection +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *IssueCollectionPage) Next() error { + next, err := page.fn(page.ic) + if err != nil { + return err + } + page.ic = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page IssueCollectionPage) NotDone() bool { + return !page.ic.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page IssueCollectionPage) Response() IssueCollection { + return page.ic +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page IssueCollectionPage) Values() []IssueContract { + if page.ic.IsEmpty() { + return nil + } + return *page.ic.Value +} + +// IssueCommentCollection paged Issue Comment list representation. +type IssueCommentCollection struct { + autorest.Response `json:"-"` + // Value - Issue Comment values. + Value *[]IssueCommentContract `json:"value,omitempty"` + // NextLink - Next page link if any. + NextLink *string `json:"nextLink,omitempty"` +} + +// IssueCommentCollectionIterator provides access to a complete listing of IssueCommentContract values. +type IssueCommentCollectionIterator struct { + i int + page IssueCommentCollectionPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *IssueCommentCollectionIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter IssueCommentCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter IssueCommentCollectionIterator) Response() IssueCommentCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter IssueCommentCollectionIterator) Value() IssueCommentContract { + if !iter.page.NotDone() { + return IssueCommentContract{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (icc IssueCommentCollection) IsEmpty() bool { + return icc.Value == nil || len(*icc.Value) == 0 +} + +// issueCommentCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (icc IssueCommentCollection) issueCommentCollectionPreparer() (*http.Request, error) { + if icc.NextLink == nil || len(to.String(icc.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(icc.NextLink))) +} + +// IssueCommentCollectionPage contains a page of IssueCommentContract values. +type IssueCommentCollectionPage struct { + fn func(IssueCommentCollection) (IssueCommentCollection, error) + icc IssueCommentCollection +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *IssueCommentCollectionPage) Next() error { + next, err := page.fn(page.icc) + if err != nil { + return err + } + page.icc = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page IssueCommentCollectionPage) NotDone() bool { + return !page.icc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page IssueCommentCollectionPage) Response() IssueCommentCollection { + return page.icc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page IssueCommentCollectionPage) Values() []IssueCommentContract { + if page.icc.IsEmpty() { + return nil + } + return *page.icc.Value +} + +// IssueCommentContract issue Comment Contract details. +type IssueCommentContract struct { + autorest.Response `json:"-"` + // IssueCommentContractProperties - Properties of the Issue Comment. + *IssueCommentContractProperties `json:"properties,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` + // Name - Resource name. + Name *string `json:"name,omitempty"` + // Type - Resource type for API Management resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for IssueCommentContract. +func (icc IssueCommentContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if icc.IssueCommentContractProperties != nil { + objectMap["properties"] = icc.IssueCommentContractProperties + } + if icc.ID != nil { + objectMap["id"] = icc.ID + } + if icc.Name != nil { + objectMap["name"] = icc.Name + } + if icc.Type != nil { + objectMap["type"] = icc.Type + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for IssueCommentContract struct. +func (icc *IssueCommentContract) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var issueCommentContractProperties IssueCommentContractProperties + err = json.Unmarshal(*v, &issueCommentContractProperties) + if err != nil { + return err + } + icc.IssueCommentContractProperties = &issueCommentContractProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + icc.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + icc.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + icc.Type = &typeVar + } + } + } + + return nil +} + +// IssueCommentContractProperties issue Comment contract Properties. +type IssueCommentContractProperties struct { + // Text - Comment text. + Text *string `json:"text,omitempty"` + // CreatedDate - Date and time when the comment was created. + CreatedDate *date.Time `json:"createdDate,omitempty"` + // UserID - A resource identifier for the user who left the comment. + UserID *string `json:"userId,omitempty"` +} + +// IssueContract issue Contract details. +type IssueContract struct { + autorest.Response `json:"-"` + // IssueContractProperties - Properties of the Issue. + *IssueContractProperties `json:"properties,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` + // Name - Resource name. + Name *string `json:"name,omitempty"` + // Type - Resource type for API Management resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for IssueContract. +func (ic IssueContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ic.IssueContractProperties != nil { + objectMap["properties"] = ic.IssueContractProperties + } + if ic.ID != nil { + objectMap["id"] = ic.ID + } + if ic.Name != nil { + objectMap["name"] = ic.Name + } + if ic.Type != nil { + objectMap["type"] = ic.Type + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for IssueContract struct. +func (ic *IssueContract) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var issueContractProperties IssueContractProperties + err = json.Unmarshal(*v, &issueContractProperties) + if err != nil { + return err + } + ic.IssueContractProperties = &issueContractProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ic.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ic.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ic.Type = &typeVar + } + } + } + + return nil +} + +// IssueContractProperties issue contract Properties. +type IssueContractProperties struct { + // Title - The issue title. + Title *string `json:"title,omitempty"` + // Description - Text describing the issue. + Description *string `json:"description,omitempty"` + // CreatedDate - Date and time when the issue was created. + CreatedDate *date.Time `json:"createdDate,omitempty"` + // State - Status of the issue. Possible values include: 'Proposed', 'Open', 'Removed', 'Resolved', 'Closed' + State State `json:"state,omitempty"` + // UserID - A resource identifier for the user created the issue. + UserID *string `json:"userId,omitempty"` + // APIID - A resource identifier for the API the issue was created for. + APIID *string `json:"apiId,omitempty"` +} + +// ListNetworkStatusContractByLocation ... +type ListNetworkStatusContractByLocation struct { + autorest.Response `json:"-"` + Value *[]NetworkStatusContractByLocation `json:"value,omitempty"` +} + +// LoggerCollection paged Logger list representation. +type LoggerCollection struct { + autorest.Response `json:"-"` + // Value - Logger values. + Value *[]LoggerContract `json:"value,omitempty"` + // Count - Total record count number across all pages. + Count *int64 `json:"count,omitempty"` + // NextLink - Next page link if any. + NextLink *string `json:"nextLink,omitempty"` +} + +// LoggerCollectionIterator provides access to a complete listing of LoggerContract values. +type LoggerCollectionIterator struct { + i int + page LoggerCollectionPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *LoggerCollectionIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter LoggerCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter LoggerCollectionIterator) Response() LoggerCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter LoggerCollectionIterator) Value() LoggerContract { + if !iter.page.NotDone() { + return LoggerContract{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (lc LoggerCollection) IsEmpty() bool { + return lc.Value == nil || len(*lc.Value) == 0 +} + +// loggerCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (lc LoggerCollection) loggerCollectionPreparer() (*http.Request, error) { + if lc.NextLink == nil || len(to.String(lc.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(lc.NextLink))) +} + +// LoggerCollectionPage contains a page of LoggerContract values. +type LoggerCollectionPage struct { + fn func(LoggerCollection) (LoggerCollection, error) + lc LoggerCollection +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *LoggerCollectionPage) Next() error { + next, err := page.fn(page.lc) + if err != nil { + return err + } + page.lc = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page LoggerCollectionPage) NotDone() bool { + return !page.lc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page LoggerCollectionPage) Response() LoggerCollection { + return page.lc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page LoggerCollectionPage) Values() []LoggerContract { + if page.lc.IsEmpty() { + return nil + } + return *page.lc.Value +} + +// LoggerContract logger details. +type LoggerContract struct { + autorest.Response `json:"-"` + // LoggerContractProperties - Logger entity contract properties. + *LoggerContractProperties `json:"properties,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` + // Name - Resource name. + Name *string `json:"name,omitempty"` + // Type - Resource type for API Management resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for LoggerContract. +func (lc LoggerContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if lc.LoggerContractProperties != nil { + objectMap["properties"] = lc.LoggerContractProperties + } + if lc.ID != nil { + objectMap["id"] = lc.ID + } + if lc.Name != nil { + objectMap["name"] = lc.Name + } + if lc.Type != nil { + objectMap["type"] = lc.Type + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for LoggerContract struct. +func (lc *LoggerContract) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var loggerContractProperties LoggerContractProperties + err = json.Unmarshal(*v, &loggerContractProperties) + if err != nil { + return err + } + lc.LoggerContractProperties = &loggerContractProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + lc.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + lc.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + lc.Type = &typeVar + } + } + } + + return nil +} + +// LoggerContractProperties the Logger entity in API Management represents an event sink that you can use to log +// API Management events. Currently the Logger entity supports logging API Management events to Azure Event Hubs. +type LoggerContractProperties struct { + // LoggerType - Logger type. Possible values include: 'AzureEventHub', 'ApplicationInsights' + LoggerType LoggerType `json:"loggerType,omitempty"` + // Description - Logger description. + Description *string `json:"description,omitempty"` + // Credentials - The name and SendRule connection string of the event hub for azureEventHub logger. + // Instrumentation key for applicationInsights logger. + Credentials map[string]*string `json:"credentials"` + // IsBuffered - Whether records are buffered in the logger before publishing. Default is assumed to be true. + IsBuffered *bool `json:"isBuffered,omitempty"` + // ResourceID - Azure Resource Id of a log target (either Azure Event Hub resource or Azure Application Insights resource). + ResourceID *string `json:"resourceId,omitempty"` +} + +// MarshalJSON is the custom marshaler for LoggerContractProperties. +func (lcp LoggerContractProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if lcp.LoggerType != "" { + objectMap["loggerType"] = lcp.LoggerType + } + if lcp.Description != nil { + objectMap["description"] = lcp.Description + } + if lcp.Credentials != nil { + objectMap["credentials"] = lcp.Credentials + } + if lcp.IsBuffered != nil { + objectMap["isBuffered"] = lcp.IsBuffered + } + if lcp.ResourceID != nil { + objectMap["resourceId"] = lcp.ResourceID + } + return json.Marshal(objectMap) +} + +// LoggerUpdateContract logger update contract. +type LoggerUpdateContract struct { + // LoggerUpdateParameters - Logger entity update contract properties. + *LoggerUpdateParameters `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for LoggerUpdateContract. +func (luc LoggerUpdateContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if luc.LoggerUpdateParameters != nil { + objectMap["properties"] = luc.LoggerUpdateParameters + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for LoggerUpdateContract struct. +func (luc *LoggerUpdateContract) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var loggerUpdateParameters LoggerUpdateParameters + err = json.Unmarshal(*v, &loggerUpdateParameters) + if err != nil { + return err + } + luc.LoggerUpdateParameters = &loggerUpdateParameters + } + } + } + + return nil +} + +// LoggerUpdateParameters parameters supplied to the Update Logger operation. +type LoggerUpdateParameters struct { + // LoggerType - Logger type. Possible values include: 'AzureEventHub', 'ApplicationInsights' + LoggerType LoggerType `json:"loggerType,omitempty"` + // Description - Logger description. + Description *string `json:"description,omitempty"` + // Credentials - Logger credentials. + Credentials map[string]*string `json:"credentials"` + // IsBuffered - Whether records are buffered in the logger before publishing. Default is assumed to be true. + IsBuffered *bool `json:"isBuffered,omitempty"` +} + +// MarshalJSON is the custom marshaler for LoggerUpdateParameters. +func (lup LoggerUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if lup.LoggerType != "" { + objectMap["loggerType"] = lup.LoggerType + } + if lup.Description != nil { + objectMap["description"] = lup.Description + } + if lup.Credentials != nil { + objectMap["credentials"] = lup.Credentials + } + if lup.IsBuffered != nil { + objectMap["isBuffered"] = lup.IsBuffered + } + return json.Marshal(objectMap) +} + +// NetworkStatusContract network Status details. +type NetworkStatusContract struct { + autorest.Response `json:"-"` + // DNSServers - Gets the list of DNS servers IPV4 addresses. + DNSServers *[]string `json:"dnsServers,omitempty"` + // ConnectivityStatus - Gets the list of Connectivity Status to the Resources on which the service depends upon. + ConnectivityStatus *[]ConnectivityStatusContract `json:"connectivityStatus,omitempty"` +} + +// NetworkStatusContractByLocation network Status in the Location +type NetworkStatusContractByLocation struct { + // Location - Location of service + Location *string `json:"location,omitempty"` + // NetworkStatus - Network status in Location + NetworkStatus *NetworkStatusContract `json:"networkStatus,omitempty"` +} + +// NotificationCollection paged Notification list representation. +type NotificationCollection struct { + autorest.Response `json:"-"` + // Value - Page values. + Value *[]NotificationContract `json:"value,omitempty"` + // NextLink - Next page link if any. + NextLink *string `json:"nextLink,omitempty"` +} + +// NotificationCollectionIterator provides access to a complete listing of NotificationContract values. +type NotificationCollectionIterator struct { + i int + page NotificationCollectionPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *NotificationCollectionIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter NotificationCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter NotificationCollectionIterator) Response() NotificationCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter NotificationCollectionIterator) Value() NotificationContract { + if !iter.page.NotDone() { + return NotificationContract{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (nc NotificationCollection) IsEmpty() bool { + return nc.Value == nil || len(*nc.Value) == 0 +} + +// notificationCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (nc NotificationCollection) notificationCollectionPreparer() (*http.Request, error) { + if nc.NextLink == nil || len(to.String(nc.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(nc.NextLink))) +} + +// NotificationCollectionPage contains a page of NotificationContract values. +type NotificationCollectionPage struct { + fn func(NotificationCollection) (NotificationCollection, error) + nc NotificationCollection +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *NotificationCollectionPage) Next() error { + next, err := page.fn(page.nc) + if err != nil { + return err + } + page.nc = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page NotificationCollectionPage) NotDone() bool { + return !page.nc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page NotificationCollectionPage) Response() NotificationCollection { + return page.nc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page NotificationCollectionPage) Values() []NotificationContract { + if page.nc.IsEmpty() { + return nil + } + return *page.nc.Value +} + +// NotificationContract notification details. +type NotificationContract struct { + autorest.Response `json:"-"` + // NotificationContractProperties - Notification entity contract properties. + *NotificationContractProperties `json:"properties,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` + // Name - Resource name. + Name *string `json:"name,omitempty"` + // Type - Resource type for API Management resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for NotificationContract. +func (nc NotificationContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if nc.NotificationContractProperties != nil { + objectMap["properties"] = nc.NotificationContractProperties + } + if nc.ID != nil { + objectMap["id"] = nc.ID + } + if nc.Name != nil { + objectMap["name"] = nc.Name + } + if nc.Type != nil { + objectMap["type"] = nc.Type + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for NotificationContract struct. +func (nc *NotificationContract) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var notificationContractProperties NotificationContractProperties + err = json.Unmarshal(*v, ¬ificationContractProperties) + if err != nil { + return err + } + nc.NotificationContractProperties = ¬ificationContractProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + nc.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + nc.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + nc.Type = &typeVar + } + } + } + + return nil +} + +// NotificationContractProperties notification Contract properties. +type NotificationContractProperties struct { + // Title - Title of the Notification. + Title *string `json:"title,omitempty"` + // Description - Description of the Notification. + Description *string `json:"description,omitempty"` + // Recipients - Recipient Parameter values. + Recipients *RecipientsContractProperties `json:"recipients,omitempty"` +} + +// OAuth2AuthenticationSettingsContract API OAuth2 Authentication settings details. +type OAuth2AuthenticationSettingsContract struct { + // AuthorizationServerID - OAuth authorization server identifier. + AuthorizationServerID *string `json:"authorizationServerId,omitempty"` + // Scope - operations scope. + Scope *string `json:"scope,omitempty"` +} + +// OpenIDConnectProviderCollection paged OpenIdProviders list representation. +type OpenIDConnectProviderCollection struct { + autorest.Response `json:"-"` + // Value - Page values. + Value *[]OpenidConnectProviderContract `json:"value,omitempty"` + // NextLink - Next page link if any. + NextLink *string `json:"nextLink,omitempty"` +} + +// OpenIDConnectProviderCollectionIterator provides access to a complete listing of OpenidConnectProviderContract +// values. +type OpenIDConnectProviderCollectionIterator struct { + i int + page OpenIDConnectProviderCollectionPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *OpenIDConnectProviderCollectionIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter OpenIDConnectProviderCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter OpenIDConnectProviderCollectionIterator) Response() OpenIDConnectProviderCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter OpenIDConnectProviderCollectionIterator) Value() OpenidConnectProviderContract { + if !iter.page.NotDone() { + return OpenidConnectProviderContract{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (oicpc OpenIDConnectProviderCollection) IsEmpty() bool { + return oicpc.Value == nil || len(*oicpc.Value) == 0 +} + +// openIDConnectProviderCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (oicpc OpenIDConnectProviderCollection) openIDConnectProviderCollectionPreparer() (*http.Request, error) { + if oicpc.NextLink == nil || len(to.String(oicpc.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(oicpc.NextLink))) +} + +// OpenIDConnectProviderCollectionPage contains a page of OpenidConnectProviderContract values. +type OpenIDConnectProviderCollectionPage struct { + fn func(OpenIDConnectProviderCollection) (OpenIDConnectProviderCollection, error) + oicpc OpenIDConnectProviderCollection +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *OpenIDConnectProviderCollectionPage) Next() error { + next, err := page.fn(page.oicpc) + if err != nil { + return err + } + page.oicpc = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page OpenIDConnectProviderCollectionPage) NotDone() bool { + return !page.oicpc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page OpenIDConnectProviderCollectionPage) Response() OpenIDConnectProviderCollection { + return page.oicpc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page OpenIDConnectProviderCollectionPage) Values() []OpenidConnectProviderContract { + if page.oicpc.IsEmpty() { + return nil + } + return *page.oicpc.Value +} + +// OpenidConnectProviderContract openId Connect Provider details. +type OpenidConnectProviderContract struct { + autorest.Response `json:"-"` + // OpenidConnectProviderContractProperties - OpenId Connect Provider contract properties. + *OpenidConnectProviderContractProperties `json:"properties,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` + // Name - Resource name. + Name *string `json:"name,omitempty"` + // Type - Resource type for API Management resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for OpenidConnectProviderContract. +func (ocpc OpenidConnectProviderContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ocpc.OpenidConnectProviderContractProperties != nil { + objectMap["properties"] = ocpc.OpenidConnectProviderContractProperties + } + if ocpc.ID != nil { + objectMap["id"] = ocpc.ID + } + if ocpc.Name != nil { + objectMap["name"] = ocpc.Name + } + if ocpc.Type != nil { + objectMap["type"] = ocpc.Type + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for OpenidConnectProviderContract struct. +func (ocpc *OpenidConnectProviderContract) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var openidConnectProviderContractProperties OpenidConnectProviderContractProperties + err = json.Unmarshal(*v, &openidConnectProviderContractProperties) + if err != nil { + return err + } + ocpc.OpenidConnectProviderContractProperties = &openidConnectProviderContractProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ocpc.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ocpc.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ocpc.Type = &typeVar + } + } + } + + return nil +} + +// OpenidConnectProviderContractProperties openID Connect Providers Contract. +type OpenidConnectProviderContractProperties struct { + // DisplayName - User-friendly OpenID Connect Provider name. + DisplayName *string `json:"displayName,omitempty"` + // Description - User-friendly description of OpenID Connect Provider. + Description *string `json:"description,omitempty"` + // MetadataEndpoint - Metadata endpoint URI. + MetadataEndpoint *string `json:"metadataEndpoint,omitempty"` + // ClientID - Client ID of developer console which is the client application. + ClientID *string `json:"clientId,omitempty"` + // ClientSecret - Client Secret of developer console which is the client application. + ClientSecret *string `json:"clientSecret,omitempty"` +} + +// OpenidConnectProviderUpdateContract parameters supplied to the Update OpenID Connect Provider operation. +type OpenidConnectProviderUpdateContract struct { + // OpenidConnectProviderUpdateContractProperties - OpenId Connect Provider Update contract properties. + *OpenidConnectProviderUpdateContractProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for OpenidConnectProviderUpdateContract. +func (ocpuc OpenidConnectProviderUpdateContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ocpuc.OpenidConnectProviderUpdateContractProperties != nil { + objectMap["properties"] = ocpuc.OpenidConnectProviderUpdateContractProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for OpenidConnectProviderUpdateContract struct. +func (ocpuc *OpenidConnectProviderUpdateContract) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var openidConnectProviderUpdateContractProperties OpenidConnectProviderUpdateContractProperties + err = json.Unmarshal(*v, &openidConnectProviderUpdateContractProperties) + if err != nil { + return err + } + ocpuc.OpenidConnectProviderUpdateContractProperties = &openidConnectProviderUpdateContractProperties + } + } + } + + return nil +} + +// OpenidConnectProviderUpdateContractProperties parameters supplied to the Update OpenID Connect Provider +// operation. +type OpenidConnectProviderUpdateContractProperties struct { + // DisplayName - User-friendly OpenID Connect Provider name. + DisplayName *string `json:"displayName,omitempty"` + // Description - User-friendly description of OpenID Connect Provider. + Description *string `json:"description,omitempty"` + // MetadataEndpoint - Metadata endpoint URI. + MetadataEndpoint *string `json:"metadataEndpoint,omitempty"` + // ClientID - Client ID of developer console which is the client application. + ClientID *string `json:"clientId,omitempty"` + // ClientSecret - Client Secret of developer console which is the client application. + ClientSecret *string `json:"clientSecret,omitempty"` +} + +// Operation REST API operation +type Operation struct { + // Name - Operation name: {provider}/{resource}/{operation} + Name *string `json:"name,omitempty"` + // Display - The object that describes the operation. + Display *OperationDisplay `json:"display,omitempty"` + // Origin - The operation origin. + Origin *string `json:"origin,omitempty"` + // Properties - The operation properties. + Properties interface{} `json:"properties,omitempty"` +} + +// OperationCollection paged Operation list representation. +type OperationCollection struct { + autorest.Response `json:"-"` + // Value - Page values. + Value *[]OperationContract `json:"value,omitempty"` + // NextLink - Next page link if any. + NextLink *string `json:"nextLink,omitempty"` +} + +// OperationCollectionIterator provides access to a complete listing of OperationContract values. +type OperationCollectionIterator struct { + i int + page OperationCollectionPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *OperationCollectionIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter OperationCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter OperationCollectionIterator) Response() OperationCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter OperationCollectionIterator) Value() OperationContract { + if !iter.page.NotDone() { + return OperationContract{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (oc OperationCollection) IsEmpty() bool { + return oc.Value == nil || len(*oc.Value) == 0 +} + +// operationCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (oc OperationCollection) operationCollectionPreparer() (*http.Request, error) { + if oc.NextLink == nil || len(to.String(oc.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(oc.NextLink))) +} + +// OperationCollectionPage contains a page of OperationContract values. +type OperationCollectionPage struct { + fn func(OperationCollection) (OperationCollection, error) + oc OperationCollection +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *OperationCollectionPage) Next() error { + next, err := page.fn(page.oc) + if err != nil { + return err + } + page.oc = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page OperationCollectionPage) NotDone() bool { + return !page.oc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page OperationCollectionPage) Response() OperationCollection { + return page.oc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page OperationCollectionPage) Values() []OperationContract { + if page.oc.IsEmpty() { + return nil + } + return *page.oc.Value +} + +// OperationContract api Operation details. +type OperationContract struct { + autorest.Response `json:"-"` + // OperationContractProperties - Properties of the Operation Contract. + *OperationContractProperties `json:"properties,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` + // Name - Resource name. + Name *string `json:"name,omitempty"` + // Type - Resource type for API Management resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for OperationContract. +func (oc OperationContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if oc.OperationContractProperties != nil { + objectMap["properties"] = oc.OperationContractProperties + } + if oc.ID != nil { + objectMap["id"] = oc.ID + } + if oc.Name != nil { + objectMap["name"] = oc.Name + } + if oc.Type != nil { + objectMap["type"] = oc.Type + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for OperationContract struct. +func (oc *OperationContract) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var operationContractProperties OperationContractProperties + err = json.Unmarshal(*v, &operationContractProperties) + if err != nil { + return err + } + oc.OperationContractProperties = &operationContractProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + oc.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + oc.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + oc.Type = &typeVar + } + } + } + + return nil +} + +// OperationContractProperties operation Contract Properties +type OperationContractProperties struct { + // DisplayName - Operation Name. + DisplayName *string `json:"displayName,omitempty"` + // Method - A Valid HTTP Operation Method. Typical Http Methods like GET, PUT, POST but not limited by only them. + Method *string `json:"method,omitempty"` + // URLTemplate - Relative URL template identifying the target resource for this operation. May include parameters. Example: /customers/{cid}/orders/{oid}/?date={date} + URLTemplate *string `json:"urlTemplate,omitempty"` + // TemplateParameters - Collection of URL template parameters. + TemplateParameters *[]ParameterContract `json:"templateParameters,omitempty"` + // Description - Description of the operation. May include HTML formatting tags. + Description *string `json:"description,omitempty"` + // Request - An entity containing request details. + Request *RequestContract `json:"request,omitempty"` + // Responses - Array of Operation responses. + Responses *[]ResponseContract `json:"responses,omitempty"` + // Policies - Operation Policies + Policies *string `json:"policies,omitempty"` +} + +// OperationDisplay the object that describes the operation. +type OperationDisplay struct { + // Provider - Friendly name of the resource provider + Provider *string `json:"provider,omitempty"` + // Operation - Operation type: read, write, delete, listKeys/action, etc. + Operation *string `json:"operation,omitempty"` + // Resource - Resource type on which the operation is performed. + Resource *string `json:"resource,omitempty"` + // Description - Friendly name of the operation + Description *string `json:"description,omitempty"` +} + +// OperationEntityBaseContract api Operation Entity Base Contract details. +type OperationEntityBaseContract struct { + // TemplateParameters - Collection of URL template parameters. + TemplateParameters *[]ParameterContract `json:"templateParameters,omitempty"` + // Description - Description of the operation. May include HTML formatting tags. + Description *string `json:"description,omitempty"` + // Request - An entity containing request details. + Request *RequestContract `json:"request,omitempty"` + // Responses - Array of Operation responses. + Responses *[]ResponseContract `json:"responses,omitempty"` + // Policies - Operation Policies + Policies *string `json:"policies,omitempty"` +} + +// OperationListResult result of the request to list REST API operations. It contains a list of operations and a +// URL nextLink to get the next set of results. +type OperationListResult struct { + autorest.Response `json:"-"` + // Value - List of operations supported by the resource provider. + Value *[]Operation `json:"value,omitempty"` + // NextLink - URL to get the next set of operation list results if there are any. + NextLink *string `json:"nextLink,omitempty"` +} + +// OperationListResultIterator provides access to a complete listing of Operation values. +type OperationListResultIterator struct { + i int + page OperationListResultPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *OperationListResultIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter OperationListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter OperationListResultIterator) Response() OperationListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter OperationListResultIterator) Value() Operation { + if !iter.page.NotDone() { + return Operation{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (olr OperationListResult) IsEmpty() bool { + return olr.Value == nil || len(*olr.Value) == 0 +} + +// operationListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (olr OperationListResult) operationListResultPreparer() (*http.Request, error) { + if olr.NextLink == nil || len(to.String(olr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(olr.NextLink))) +} + +// OperationListResultPage contains a page of Operation values. +type OperationListResultPage struct { + fn func(OperationListResult) (OperationListResult, error) + olr OperationListResult +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *OperationListResultPage) Next() error { + next, err := page.fn(page.olr) + if err != nil { + return err + } + page.olr = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page OperationListResultPage) NotDone() bool { + return !page.olr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page OperationListResultPage) Response() OperationListResult { + return page.olr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page OperationListResultPage) Values() []Operation { + if page.olr.IsEmpty() { + return nil + } + return *page.olr.Value +} + +// OperationResultContract operation Result. +type OperationResultContract struct { + autorest.Response `json:"-"` + // ID - Operation result identifier. + ID *string `json:"id,omitempty"` + // Status - Status of an async operation. Possible values include: 'Started', 'InProgress', 'Succeeded', 'Failed' + Status AsyncOperationStatus `json:"status,omitempty"` + // Started - Start time of an async operation. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + Started *date.Time `json:"started,omitempty"` + // Updated - Last update time of an async operation. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + Updated *date.Time `json:"updated,omitempty"` + // ResultInfo - Optional result info. + ResultInfo *string `json:"resultInfo,omitempty"` + // Error - Error Body Contract + Error *ErrorResponseBody `json:"error,omitempty"` + // ActionLog - This property if only provided as part of the TenantConfiguration_Validate operation. It contains the log the entities which will be updated/created/deleted as part of the TenantConfiguration_Deploy operation. + ActionLog *[]OperationResultLogItemContract `json:"actionLog,omitempty"` +} + +// OperationResultLogItemContract log of the entity being created, updated or deleted. +type OperationResultLogItemContract struct { + // ObjectType - The type of entity contract. + ObjectType *string `json:"objectType,omitempty"` + // Action - Action like create/update/delete. + Action *string `json:"action,omitempty"` + // ObjectKey - Identifier of the entity being created/updated/deleted. + ObjectKey *string `json:"objectKey,omitempty"` +} + +// OperationTagResourceContractProperties operation Entity contract Properties. +type OperationTagResourceContractProperties struct { + // ID - Identifier of the operation in form /operations/{operationId}. + ID *string `json:"id,omitempty"` + // Name - Operation name. + Name *string `json:"name,omitempty"` + // APIName - Api Name. + APIName *string `json:"apiName,omitempty"` + // APIRevision - Api Revision. + APIRevision *string `json:"apiRevision,omitempty"` + // APIVersion - Api Version. + APIVersion *string `json:"apiVersion,omitempty"` + // Description - Operation Description. + Description *string `json:"description,omitempty"` + // Method - A Valid HTTP Operation Method. Typical Http Methods like GET, PUT, POST but not limited by only them. + Method *string `json:"method,omitempty"` + // URLTemplate - Relative URL template identifying the target resource for this operation. May include parameters. Example: /customers/{cid}/orders/{oid}/?date={date} + URLTemplate *string `json:"urlTemplate,omitempty"` +} + +// OperationUpdateContract api Operation Update Contract details. +type OperationUpdateContract struct { + // OperationUpdateContractProperties - Properties of the API Operation entity that can be updated. + *OperationUpdateContractProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for OperationUpdateContract. +func (ouc OperationUpdateContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ouc.OperationUpdateContractProperties != nil { + objectMap["properties"] = ouc.OperationUpdateContractProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for OperationUpdateContract struct. +func (ouc *OperationUpdateContract) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var operationUpdateContractProperties OperationUpdateContractProperties + err = json.Unmarshal(*v, &operationUpdateContractProperties) + if err != nil { + return err + } + ouc.OperationUpdateContractProperties = &operationUpdateContractProperties + } + } + } + + return nil +} + +// OperationUpdateContractProperties operation Update Contract Properties. +type OperationUpdateContractProperties struct { + // DisplayName - Operation Name. + DisplayName *string `json:"displayName,omitempty"` + // Method - A Valid HTTP Operation Method. Typical Http Methods like GET, PUT, POST but not limited by only them. + Method *string `json:"method,omitempty"` + // URLTemplate - Relative URL template identifying the target resource for this operation. May include parameters. Example: /customers/{cid}/orders/{oid}/?date={date} + URLTemplate *string `json:"urlTemplate,omitempty"` + // TemplateParameters - Collection of URL template parameters. + TemplateParameters *[]ParameterContract `json:"templateParameters,omitempty"` + // Description - Description of the operation. May include HTML formatting tags. + Description *string `json:"description,omitempty"` + // Request - An entity containing request details. + Request *RequestContract `json:"request,omitempty"` + // Responses - Array of Operation responses. + Responses *[]ResponseContract `json:"responses,omitempty"` + // Policies - Operation Policies + Policies *string `json:"policies,omitempty"` +} + +// ParameterContract operation parameters details. +type ParameterContract struct { + // Name - Parameter name. + Name *string `json:"name,omitempty"` + // Description - Parameter description. + Description *string `json:"description,omitempty"` + // Type - Parameter type. + Type *string `json:"type,omitempty"` + // DefaultValue - Default parameter value. + DefaultValue *string `json:"defaultValue,omitempty"` + // Required - whether parameter is required or not. + Required *bool `json:"required,omitempty"` + // Values - Parameter values. + Values *[]string `json:"values,omitempty"` +} + +// PipelineDiagnosticSettings diagnostic settings for incoming/outcoming HTTP messages to the Gateway. +type PipelineDiagnosticSettings struct { + // Request - Diagnostic settings for request. + Request *HTTPMessageDiagnostic `json:"request,omitempty"` + // Response - Diagnostic settings for response. + Response *HTTPMessageDiagnostic `json:"response,omitempty"` +} + +// PolicyCollection the response of the list policy operation. +type PolicyCollection struct { + autorest.Response `json:"-"` + // Value - Policy Contract value. + Value *[]PolicyContract `json:"value,omitempty"` + // NextLink - Next page link if any. + NextLink *string `json:"nextLink,omitempty"` +} + +// PolicyContract policy Contract details. +type PolicyContract struct { + autorest.Response `json:"-"` + // PolicyContractProperties - Properties of the Policy. + *PolicyContractProperties `json:"properties,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` + // Name - Resource name. + Name *string `json:"name,omitempty"` + // Type - Resource type for API Management resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for PolicyContract. +func (pc PolicyContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pc.PolicyContractProperties != nil { + objectMap["properties"] = pc.PolicyContractProperties + } + if pc.ID != nil { + objectMap["id"] = pc.ID + } + if pc.Name != nil { + objectMap["name"] = pc.Name + } + if pc.Type != nil { + objectMap["type"] = pc.Type + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for PolicyContract struct. +func (pc *PolicyContract) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var policyContractProperties PolicyContractProperties + err = json.Unmarshal(*v, &policyContractProperties) + if err != nil { + return err + } + pc.PolicyContractProperties = &policyContractProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + pc.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + pc.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + pc.Type = &typeVar + } + } + } + + return nil +} + +// PolicyContractProperties policy contract Properties. +type PolicyContractProperties struct { + // PolicyContent - Json escaped Xml Encoded contents of the Policy. + PolicyContent *string `json:"policyContent,omitempty"` + // ContentFormat - Format of the policyContent. Possible values include: 'XML', 'XMLLink', 'Rawxml', 'RawxmlLink' + ContentFormat PolicyContentFormat `json:"contentFormat,omitempty"` +} + +// PolicySnippetContract policy snippet. +type PolicySnippetContract struct { + // Name - Snippet name. + Name *string `json:"name,omitempty"` + // Content - Snippet content. + Content *string `json:"content,omitempty"` + // ToolTip - Snippet toolTip. + ToolTip *string `json:"toolTip,omitempty"` + // Scope - Binary OR value of the Snippet scope. + Scope *int32 `json:"scope,omitempty"` +} + +// PolicySnippetsCollection the response of the list policy snippets operation. +type PolicySnippetsCollection struct { + autorest.Response `json:"-"` + // Value - Policy snippet value. + Value *[]PolicySnippetContract `json:"value,omitempty"` +} + +// PortalDelegationSettings delegation settings for a developer portal. +type PortalDelegationSettings struct { + autorest.Response `json:"-"` + // PortalDelegationSettingsProperties - Delegation settings contract properties. + *PortalDelegationSettingsProperties `json:"properties,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` + // Name - Resource name. + Name *string `json:"name,omitempty"` + // Type - Resource type for API Management resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for PortalDelegationSettings. +func (pds PortalDelegationSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pds.PortalDelegationSettingsProperties != nil { + objectMap["properties"] = pds.PortalDelegationSettingsProperties + } + if pds.ID != nil { + objectMap["id"] = pds.ID + } + if pds.Name != nil { + objectMap["name"] = pds.Name + } + if pds.Type != nil { + objectMap["type"] = pds.Type + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for PortalDelegationSettings struct. +func (pds *PortalDelegationSettings) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var portalDelegationSettingsProperties PortalDelegationSettingsProperties + err = json.Unmarshal(*v, &portalDelegationSettingsProperties) + if err != nil { + return err + } + pds.PortalDelegationSettingsProperties = &portalDelegationSettingsProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + pds.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + pds.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + pds.Type = &typeVar + } + } + } + + return nil +} + +// PortalDelegationSettingsProperties delegation settings contract properties. +type PortalDelegationSettingsProperties struct { + // URL - A delegation Url. + URL *string `json:"url,omitempty"` + // ValidationKey - A base64-encoded validation key to validate, that a request is coming from Azure API Management. + ValidationKey *string `json:"validationKey,omitempty"` + // Subscriptions - Subscriptions delegation settings. + Subscriptions *SubscriptionsDelegationSettingsProperties `json:"subscriptions,omitempty"` + // UserRegistration - User registration delegation settings. + UserRegistration *RegistrationDelegationSettingsProperties `json:"userRegistration,omitempty"` +} + +// PortalSigninSettingProperties sign-in settings contract properties. +type PortalSigninSettingProperties struct { + // Enabled - Redirect Anonymous users to the Sign-In page. + Enabled *bool `json:"enabled,omitempty"` +} + +// PortalSigninSettings sign-In settings for the Developer Portal. +type PortalSigninSettings struct { + autorest.Response `json:"-"` + // PortalSigninSettingProperties - Sign-in settings contract properties. + *PortalSigninSettingProperties `json:"properties,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` + // Name - Resource name. + Name *string `json:"name,omitempty"` + // Type - Resource type for API Management resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for PortalSigninSettings. +func (pss PortalSigninSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pss.PortalSigninSettingProperties != nil { + objectMap["properties"] = pss.PortalSigninSettingProperties + } + if pss.ID != nil { + objectMap["id"] = pss.ID + } + if pss.Name != nil { + objectMap["name"] = pss.Name + } + if pss.Type != nil { + objectMap["type"] = pss.Type + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for PortalSigninSettings struct. +func (pss *PortalSigninSettings) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var portalSigninSettingProperties PortalSigninSettingProperties + err = json.Unmarshal(*v, &portalSigninSettingProperties) + if err != nil { + return err + } + pss.PortalSigninSettingProperties = &portalSigninSettingProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + pss.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + pss.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + pss.Type = &typeVar + } + } + } + + return nil +} + +// PortalSignupSettings sign-Up settings for a developer portal. +type PortalSignupSettings struct { + autorest.Response `json:"-"` + // PortalSignupSettingsProperties - Sign-up settings contract properties. + *PortalSignupSettingsProperties `json:"properties,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` + // Name - Resource name. + Name *string `json:"name,omitempty"` + // Type - Resource type for API Management resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for PortalSignupSettings. +func (pss PortalSignupSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pss.PortalSignupSettingsProperties != nil { + objectMap["properties"] = pss.PortalSignupSettingsProperties + } + if pss.ID != nil { + objectMap["id"] = pss.ID + } + if pss.Name != nil { + objectMap["name"] = pss.Name + } + if pss.Type != nil { + objectMap["type"] = pss.Type + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for PortalSignupSettings struct. +func (pss *PortalSignupSettings) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var portalSignupSettingsProperties PortalSignupSettingsProperties + err = json.Unmarshal(*v, &portalSignupSettingsProperties) + if err != nil { + return err + } + pss.PortalSignupSettingsProperties = &portalSignupSettingsProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + pss.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + pss.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + pss.Type = &typeVar + } + } + } + + return nil +} + +// PortalSignupSettingsProperties sign-up settings contract properties. +type PortalSignupSettingsProperties struct { + // Enabled - Allow users to sign up on a developer portal. + Enabled *bool `json:"enabled,omitempty"` + // TermsOfService - Terms of service contract properties. + TermsOfService *TermsOfServiceProperties `json:"termsOfService,omitempty"` +} + +// ProductCollection paged Products list representation. +type ProductCollection struct { + autorest.Response `json:"-"` + // Value - Page values. + Value *[]ProductContract `json:"value,omitempty"` + // NextLink - Next page link if any. + NextLink *string `json:"nextLink,omitempty"` +} + +// ProductCollectionIterator provides access to a complete listing of ProductContract values. +type ProductCollectionIterator struct { + i int + page ProductCollectionPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ProductCollectionIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ProductCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ProductCollectionIterator) Response() ProductCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ProductCollectionIterator) Value() ProductContract { + if !iter.page.NotDone() { + return ProductContract{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (pc ProductCollection) IsEmpty() bool { + return pc.Value == nil || len(*pc.Value) == 0 +} + +// productCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (pc ProductCollection) productCollectionPreparer() (*http.Request, error) { + if pc.NextLink == nil || len(to.String(pc.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(pc.NextLink))) +} + +// ProductCollectionPage contains a page of ProductContract values. +type ProductCollectionPage struct { + fn func(ProductCollection) (ProductCollection, error) + pc ProductCollection +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ProductCollectionPage) Next() error { + next, err := page.fn(page.pc) + if err != nil { + return err + } + page.pc = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ProductCollectionPage) NotDone() bool { + return !page.pc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ProductCollectionPage) Response() ProductCollection { + return page.pc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ProductCollectionPage) Values() []ProductContract { + if page.pc.IsEmpty() { + return nil + } + return *page.pc.Value +} + +// ProductContract product details. +type ProductContract struct { + autorest.Response `json:"-"` + // ProductContractProperties - Product entity contract properties. + *ProductContractProperties `json:"properties,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` + // Name - Resource name. + Name *string `json:"name,omitempty"` + // Type - Resource type for API Management resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ProductContract. +func (pc ProductContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pc.ProductContractProperties != nil { + objectMap["properties"] = pc.ProductContractProperties + } + if pc.ID != nil { + objectMap["id"] = pc.ID + } + if pc.Name != nil { + objectMap["name"] = pc.Name + } + if pc.Type != nil { + objectMap["type"] = pc.Type + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ProductContract struct. +func (pc *ProductContract) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var productContractProperties ProductContractProperties + err = json.Unmarshal(*v, &productContractProperties) + if err != nil { + return err + } + pc.ProductContractProperties = &productContractProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + pc.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + pc.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + pc.Type = &typeVar + } + } + } + + return nil +} + +// ProductContractProperties product profile. +type ProductContractProperties struct { + // DisplayName - Product name. + DisplayName *string `json:"displayName,omitempty"` + // Description - Product description. May include HTML formatting tags. + Description *string `json:"description,omitempty"` + // Terms - Product terms of use. Developers trying to subscribe to the product will be presented and required to accept these terms before they can complete the subscription process. + Terms *string `json:"terms,omitempty"` + // SubscriptionRequired - Whether a product subscription is required for accessing APIs included in this product. If true, the product is referred to as "protected" and a valid subscription key is required for a request to an API included in the product to succeed. If false, the product is referred to as "open" and requests to an API included in the product can be made without a subscription key. If property is omitted when creating a new product it's value is assumed to be true. + SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` + // ApprovalRequired - whether subscription approval is required. If false, new subscriptions will be approved automatically enabling developers to call the product’s APIs immediately after subscribing. If true, administrators must manually approve the subscription before the developer can any of the product’s APIs. Can be present only if subscriptionRequired property is present and has a value of false. + ApprovalRequired *bool `json:"approvalRequired,omitempty"` + // SubscriptionsLimit - Whether the number of subscriptions a user can have to this product at the same time. Set to null or omit to allow unlimited per user subscriptions. Can be present only if subscriptionRequired property is present and has a value of false. + SubscriptionsLimit *int32 `json:"subscriptionsLimit,omitempty"` + // State - whether product is published or not. Published products are discoverable by users of developer portal. Non published products are visible only to administrators. Default state of Product is notPublished. Possible values include: 'NotPublished', 'Published' + State ProductState `json:"state,omitempty"` +} + +// ProductEntityBaseParameters product Entity Base Parameters +type ProductEntityBaseParameters struct { + // Description - Product description. May include HTML formatting tags. + Description *string `json:"description,omitempty"` + // Terms - Product terms of use. Developers trying to subscribe to the product will be presented and required to accept these terms before they can complete the subscription process. + Terms *string `json:"terms,omitempty"` + // SubscriptionRequired - Whether a product subscription is required for accessing APIs included in this product. If true, the product is referred to as "protected" and a valid subscription key is required for a request to an API included in the product to succeed. If false, the product is referred to as "open" and requests to an API included in the product can be made without a subscription key. If property is omitted when creating a new product it's value is assumed to be true. + SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` + // ApprovalRequired - whether subscription approval is required. If false, new subscriptions will be approved automatically enabling developers to call the product’s APIs immediately after subscribing. If true, administrators must manually approve the subscription before the developer can any of the product’s APIs. Can be present only if subscriptionRequired property is present and has a value of false. + ApprovalRequired *bool `json:"approvalRequired,omitempty"` + // SubscriptionsLimit - Whether the number of subscriptions a user can have to this product at the same time. Set to null or omit to allow unlimited per user subscriptions. Can be present only if subscriptionRequired property is present and has a value of false. + SubscriptionsLimit *int32 `json:"subscriptionsLimit,omitempty"` + // State - whether product is published or not. Published products are discoverable by users of developer portal. Non published products are visible only to administrators. Default state of Product is notPublished. Possible values include: 'NotPublished', 'Published' + State ProductState `json:"state,omitempty"` +} + +// ProductTagResourceContractProperties product profile. +type ProductTagResourceContractProperties struct { + // ID - Identifier of the product in the form of /products/{productId} + ID *string `json:"id,omitempty"` + // Name - Product name. + Name *string `json:"name,omitempty"` + // Description - Product description. May include HTML formatting tags. + Description *string `json:"description,omitempty"` + // Terms - Product terms of use. Developers trying to subscribe to the product will be presented and required to accept these terms before they can complete the subscription process. + Terms *string `json:"terms,omitempty"` + // SubscriptionRequired - Whether a product subscription is required for accessing APIs included in this product. If true, the product is referred to as "protected" and a valid subscription key is required for a request to an API included in the product to succeed. If false, the product is referred to as "open" and requests to an API included in the product can be made without a subscription key. If property is omitted when creating a new product it's value is assumed to be true. + SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` + // ApprovalRequired - whether subscription approval is required. If false, new subscriptions will be approved automatically enabling developers to call the product’s APIs immediately after subscribing. If true, administrators must manually approve the subscription before the developer can any of the product’s APIs. Can be present only if subscriptionRequired property is present and has a value of false. + ApprovalRequired *bool `json:"approvalRequired,omitempty"` + // SubscriptionsLimit - Whether the number of subscriptions a user can have to this product at the same time. Set to null or omit to allow unlimited per user subscriptions. Can be present only if subscriptionRequired property is present and has a value of false. + SubscriptionsLimit *int32 `json:"subscriptionsLimit,omitempty"` + // State - whether product is published or not. Published products are discoverable by users of developer portal. Non published products are visible only to administrators. Default state of Product is notPublished. Possible values include: 'NotPublished', 'Published' + State ProductState `json:"state,omitempty"` +} + +// ProductUpdateParameters product Update parameters. +type ProductUpdateParameters struct { + // ProductUpdateProperties - Product entity Update contract properties. + *ProductUpdateProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for ProductUpdateParameters. +func (pup ProductUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pup.ProductUpdateProperties != nil { + objectMap["properties"] = pup.ProductUpdateProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ProductUpdateParameters struct. +func (pup *ProductUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var productUpdateProperties ProductUpdateProperties + err = json.Unmarshal(*v, &productUpdateProperties) + if err != nil { + return err + } + pup.ProductUpdateProperties = &productUpdateProperties + } + } + } + + return nil +} + +// ProductUpdateProperties parameters supplied to the Update Product operation. +type ProductUpdateProperties struct { + // DisplayName - Product name. + DisplayName *string `json:"displayName,omitempty"` + // Description - Product description. May include HTML formatting tags. + Description *string `json:"description,omitempty"` + // Terms - Product terms of use. Developers trying to subscribe to the product will be presented and required to accept these terms before they can complete the subscription process. + Terms *string `json:"terms,omitempty"` + // SubscriptionRequired - Whether a product subscription is required for accessing APIs included in this product. If true, the product is referred to as "protected" and a valid subscription key is required for a request to an API included in the product to succeed. If false, the product is referred to as "open" and requests to an API included in the product can be made without a subscription key. If property is omitted when creating a new product it's value is assumed to be true. + SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` + // ApprovalRequired - whether subscription approval is required. If false, new subscriptions will be approved automatically enabling developers to call the product’s APIs immediately after subscribing. If true, administrators must manually approve the subscription before the developer can any of the product’s APIs. Can be present only if subscriptionRequired property is present and has a value of false. + ApprovalRequired *bool `json:"approvalRequired,omitempty"` + // SubscriptionsLimit - Whether the number of subscriptions a user can have to this product at the same time. Set to null or omit to allow unlimited per user subscriptions. Can be present only if subscriptionRequired property is present and has a value of false. + SubscriptionsLimit *int32 `json:"subscriptionsLimit,omitempty"` + // State - whether product is published or not. Published products are discoverable by users of developer portal. Non published products are visible only to administrators. Default state of Product is notPublished. Possible values include: 'NotPublished', 'Published' + State ProductState `json:"state,omitempty"` +} + +// PropertyCollection paged Property list representation. +type PropertyCollection struct { + autorest.Response `json:"-"` + // Value - Page values. + Value *[]PropertyContract `json:"value,omitempty"` + // NextLink - Next page link if any. + NextLink *string `json:"nextLink,omitempty"` +} + +// PropertyCollectionIterator provides access to a complete listing of PropertyContract values. +type PropertyCollectionIterator struct { + i int + page PropertyCollectionPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *PropertyCollectionIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter PropertyCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter PropertyCollectionIterator) Response() PropertyCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter PropertyCollectionIterator) Value() PropertyContract { + if !iter.page.NotDone() { + return PropertyContract{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (pc PropertyCollection) IsEmpty() bool { + return pc.Value == nil || len(*pc.Value) == 0 +} + +// propertyCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (pc PropertyCollection) propertyCollectionPreparer() (*http.Request, error) { + if pc.NextLink == nil || len(to.String(pc.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(pc.NextLink))) +} + +// PropertyCollectionPage contains a page of PropertyContract values. +type PropertyCollectionPage struct { + fn func(PropertyCollection) (PropertyCollection, error) + pc PropertyCollection +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *PropertyCollectionPage) Next() error { + next, err := page.fn(page.pc) + if err != nil { + return err + } + page.pc = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page PropertyCollectionPage) NotDone() bool { + return !page.pc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page PropertyCollectionPage) Response() PropertyCollection { + return page.pc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page PropertyCollectionPage) Values() []PropertyContract { + if page.pc.IsEmpty() { + return nil + } + return *page.pc.Value +} + +// PropertyContract property details. +type PropertyContract struct { + autorest.Response `json:"-"` + // PropertyContractProperties - Property entity contract properties. + *PropertyContractProperties `json:"properties,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` + // Name - Resource name. + Name *string `json:"name,omitempty"` + // Type - Resource type for API Management resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for PropertyContract. +func (pc PropertyContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pc.PropertyContractProperties != nil { + objectMap["properties"] = pc.PropertyContractProperties + } + if pc.ID != nil { + objectMap["id"] = pc.ID + } + if pc.Name != nil { + objectMap["name"] = pc.Name + } + if pc.Type != nil { + objectMap["type"] = pc.Type + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for PropertyContract struct. +func (pc *PropertyContract) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var propertyContractProperties PropertyContractProperties + err = json.Unmarshal(*v, &propertyContractProperties) + if err != nil { + return err + } + pc.PropertyContractProperties = &propertyContractProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + pc.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + pc.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + pc.Type = &typeVar + } + } + } + + return nil +} + +// PropertyContractProperties property Contract properties. +type PropertyContractProperties struct { + // DisplayName - Unique name of Property. It may contain only letters, digits, period, dash, and underscore characters. + DisplayName *string `json:"displayName,omitempty"` + // Value - Value of the property. Can contain policy expressions. It may not be empty or consist only of whitespace. + Value *string `json:"value,omitempty"` + // Tags - Optional tags that when provided can be used to filter the property list. + Tags *[]string `json:"tags,omitempty"` + // Secret - Determines whether the value is a secret and should be encrypted or not. Default value is false. + Secret *bool `json:"secret,omitempty"` +} + +// PropertyEntityBaseParameters property Entity Base Parameters set. +type PropertyEntityBaseParameters struct { + // Tags - Optional tags that when provided can be used to filter the property list. + Tags *[]string `json:"tags,omitempty"` + // Secret - Determines whether the value is a secret and should be encrypted or not. Default value is false. + Secret *bool `json:"secret,omitempty"` +} + +// PropertyUpdateParameterProperties property Contract properties. +type PropertyUpdateParameterProperties struct { + // DisplayName - Unique name of Property. It may contain only letters, digits, period, dash, and underscore characters. + DisplayName *string `json:"displayName,omitempty"` + // Value - Value of the property. Can contain policy expressions. It may not be empty or consist only of whitespace. + Value *string `json:"value,omitempty"` + // Tags - Optional tags that when provided can be used to filter the property list. + Tags *[]string `json:"tags,omitempty"` + // Secret - Determines whether the value is a secret and should be encrypted or not. Default value is false. + Secret *bool `json:"secret,omitempty"` +} + +// PropertyUpdateParameters property update Parameters. +type PropertyUpdateParameters struct { + // PropertyUpdateParameterProperties - Property entity Update contract properties. + *PropertyUpdateParameterProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for PropertyUpdateParameters. +func (pup PropertyUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pup.PropertyUpdateParameterProperties != nil { + objectMap["properties"] = pup.PropertyUpdateParameterProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for PropertyUpdateParameters struct. +func (pup *PropertyUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var propertyUpdateParameterProperties PropertyUpdateParameterProperties + err = json.Unmarshal(*v, &propertyUpdateParameterProperties) + if err != nil { + return err + } + pup.PropertyUpdateParameterProperties = &propertyUpdateParameterProperties + } + } + } + + return nil +} + +// QuotaCounterCollection paged Quota Counter list representation. +type QuotaCounterCollection struct { + autorest.Response `json:"-"` + // Value - Quota counter values. + Value *[]QuotaCounterContract `json:"value,omitempty"` + // Count - Total record count number across all pages. + Count *int64 `json:"count,omitempty"` + // NextLink - Next page link if any. + NextLink *string `json:"nextLink,omitempty"` +} + +// QuotaCounterContract quota counter details. +type QuotaCounterContract struct { + autorest.Response `json:"-"` + // CounterKey - The Key value of the Counter. Must not be empty. + CounterKey *string `json:"counterKey,omitempty"` + // PeriodKey - Identifier of the Period for which the counter was collected. Must not be empty. + PeriodKey *string `json:"periodKey,omitempty"` + // PeriodStartTime - The date of the start of Counter Period. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + PeriodStartTime *date.Time `json:"periodStartTime,omitempty"` + // PeriodEndTime - The date of the end of Counter Period. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + PeriodEndTime *date.Time `json:"periodEndTime,omitempty"` + // Value - Quota Value Properties + Value *QuotaCounterValueContractProperties `json:"value,omitempty"` +} + +// QuotaCounterValueContract quota counter value details. +type QuotaCounterValueContract struct { + // QuotaCounterValueContractProperties - Quota counter Value Properties. + *QuotaCounterValueContractProperties `json:"value,omitempty"` +} + +// MarshalJSON is the custom marshaler for QuotaCounterValueContract. +func (qcvc QuotaCounterValueContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if qcvc.QuotaCounterValueContractProperties != nil { + objectMap["value"] = qcvc.QuotaCounterValueContractProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for QuotaCounterValueContract struct. +func (qcvc *QuotaCounterValueContract) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "value": + if v != nil { + var quotaCounterValueContractProperties QuotaCounterValueContractProperties + err = json.Unmarshal(*v, "aCounterValueContractProperties) + if err != nil { + return err + } + qcvc.QuotaCounterValueContractProperties = "aCounterValueContractProperties + } + } + } + + return nil +} + +// QuotaCounterValueContractProperties quota counter value details. +type QuotaCounterValueContractProperties struct { + // CallsCount - Number of times Counter was called. + CallsCount *int32 `json:"callsCount,omitempty"` + // KbTransferred - Data Transferred in KiloBytes. + KbTransferred *float64 `json:"kbTransferred,omitempty"` +} + +// RecipientEmailCollection paged Recipient User list representation. +type RecipientEmailCollection struct { + autorest.Response `json:"-"` + // Value - Page values. + Value *[]RecipientEmailContract `json:"value,omitempty"` + // NextLink - Next page link if any. + NextLink *string `json:"nextLink,omitempty"` +} + +// RecipientEmailContract recipient Email details. +type RecipientEmailContract struct { + autorest.Response `json:"-"` + // RecipientEmailContractProperties - Recipient Email contract properties. + *RecipientEmailContractProperties `json:"properties,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` + // Name - Resource name. + Name *string `json:"name,omitempty"` + // Type - Resource type for API Management resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecipientEmailContract. +func (rec RecipientEmailContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rec.RecipientEmailContractProperties != nil { + objectMap["properties"] = rec.RecipientEmailContractProperties + } + if rec.ID != nil { + objectMap["id"] = rec.ID + } + if rec.Name != nil { + objectMap["name"] = rec.Name + } + if rec.Type != nil { + objectMap["type"] = rec.Type + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for RecipientEmailContract struct. +func (rec *RecipientEmailContract) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var recipientEmailContractProperties RecipientEmailContractProperties + err = json.Unmarshal(*v, &recipientEmailContractProperties) + if err != nil { + return err + } + rec.RecipientEmailContractProperties = &recipientEmailContractProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + rec.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + rec.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + rec.Type = &typeVar + } + } + } + + return nil +} + +// RecipientEmailContractProperties recipient Email Contract Properties. +type RecipientEmailContractProperties struct { + // Email - User Email subscribed to notification. + Email *string `json:"email,omitempty"` +} + +// RecipientsContractProperties notification Parameter contract. +type RecipientsContractProperties struct { + // Emails - List of Emails subscribed for the notification. + Emails *[]string `json:"emails,omitempty"` + // Users - List of Users subscribed for the notification. + Users *[]string `json:"users,omitempty"` +} + +// RecipientUserCollection paged Recipient User list representation. +type RecipientUserCollection struct { + autorest.Response `json:"-"` + // Value - Page values. + Value *[]RecipientUserContract `json:"value,omitempty"` + // NextLink - Next page link if any. + NextLink *string `json:"nextLink,omitempty"` +} + +// RecipientUserContract recipient User details. +type RecipientUserContract struct { + autorest.Response `json:"-"` + // RecipientUsersContractProperties - Recipient User entity contract properties. + *RecipientUsersContractProperties `json:"properties,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` + // Name - Resource name. + Name *string `json:"name,omitempty"` + // Type - Resource type for API Management resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecipientUserContract. +func (ruc RecipientUserContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ruc.RecipientUsersContractProperties != nil { + objectMap["properties"] = ruc.RecipientUsersContractProperties + } + if ruc.ID != nil { + objectMap["id"] = ruc.ID + } + if ruc.Name != nil { + objectMap["name"] = ruc.Name + } + if ruc.Type != nil { + objectMap["type"] = ruc.Type + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for RecipientUserContract struct. +func (ruc *RecipientUserContract) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var recipientUsersContractProperties RecipientUsersContractProperties + err = json.Unmarshal(*v, &recipientUsersContractProperties) + if err != nil { + return err + } + ruc.RecipientUsersContractProperties = &recipientUsersContractProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ruc.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ruc.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ruc.Type = &typeVar + } + } + } + + return nil +} + +// RecipientUsersContractProperties recipient User Contract Properties. +type RecipientUsersContractProperties struct { + // UserID - API Management UserId subscribed to notification. + UserID *string `json:"userId,omitempty"` +} + +// RegionContract region profile. +type RegionContract struct { + // Name - Region name. + Name *string `json:"name,omitempty"` + // IsMasterRegion - whether Region is the master region. + IsMasterRegion *bool `json:"isMasterRegion,omitempty"` + // IsDeleted - whether Region is deleted. + IsDeleted *bool `json:"isDeleted,omitempty"` +} + +// RegionListResult lists Regions operation response details. +type RegionListResult struct { + autorest.Response `json:"-"` + // Value - Lists of Regions. + Value *[]RegionContract `json:"value,omitempty"` + // Count - Total record count number across all pages. + Count *int64 `json:"count,omitempty"` + // NextLink - Next page link if any. + NextLink *string `json:"nextLink,omitempty"` +} + +// RegionListResultIterator provides access to a complete listing of RegionContract values. +type RegionListResultIterator struct { + i int + page RegionListResultPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *RegionListResultIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter RegionListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter RegionListResultIterator) Response() RegionListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter RegionListResultIterator) Value() RegionContract { + if !iter.page.NotDone() { + return RegionContract{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (rlr RegionListResult) IsEmpty() bool { + return rlr.Value == nil || len(*rlr.Value) == 0 +} + +// regionListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (rlr RegionListResult) regionListResultPreparer() (*http.Request, error) { + if rlr.NextLink == nil || len(to.String(rlr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(rlr.NextLink))) +} + +// RegionListResultPage contains a page of RegionContract values. +type RegionListResultPage struct { + fn func(RegionListResult) (RegionListResult, error) + rlr RegionListResult +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *RegionListResultPage) Next() error { + next, err := page.fn(page.rlr) + if err != nil { + return err + } + page.rlr = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page RegionListResultPage) NotDone() bool { + return !page.rlr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page RegionListResultPage) Response() RegionListResult { + return page.rlr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page RegionListResultPage) Values() []RegionContract { + if page.rlr.IsEmpty() { + return nil + } + return *page.rlr.Value +} + +// RegistrationDelegationSettingsProperties user registration delegation settings properties. +type RegistrationDelegationSettingsProperties struct { + // Enabled - Enable or disable delegation for user registration. + Enabled *bool `json:"enabled,omitempty"` +} + +// ReportCollection paged Report records list representation. +type ReportCollection struct { + autorest.Response `json:"-"` + // Value - Page values. + Value *[]ReportRecordContract `json:"value,omitempty"` + // Count - Total record count number across all pages. + Count *int64 `json:"count,omitempty"` + // NextLink - Next page link if any. + NextLink *string `json:"nextLink,omitempty"` +} + +// ReportCollectionIterator provides access to a complete listing of ReportRecordContract values. +type ReportCollectionIterator struct { + i int + page ReportCollectionPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ReportCollectionIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ReportCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ReportCollectionIterator) Response() ReportCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ReportCollectionIterator) Value() ReportRecordContract { + if !iter.page.NotDone() { + return ReportRecordContract{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (rc ReportCollection) IsEmpty() bool { + return rc.Value == nil || len(*rc.Value) == 0 +} + +// reportCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (rc ReportCollection) reportCollectionPreparer() (*http.Request, error) { + if rc.NextLink == nil || len(to.String(rc.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(rc.NextLink))) +} + +// ReportCollectionPage contains a page of ReportRecordContract values. +type ReportCollectionPage struct { + fn func(ReportCollection) (ReportCollection, error) + rc ReportCollection +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ReportCollectionPage) Next() error { + next, err := page.fn(page.rc) + if err != nil { + return err + } + page.rc = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ReportCollectionPage) NotDone() bool { + return !page.rc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ReportCollectionPage) Response() ReportCollection { + return page.rc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ReportCollectionPage) Values() []ReportRecordContract { + if page.rc.IsEmpty() { + return nil + } + return *page.rc.Value +} + +// ReportRecordContract report data. +type ReportRecordContract struct { + // Name - Name depending on report endpoint specifies product, API, operation or developer name. + Name *string `json:"name,omitempty"` + // Timestamp - Start of aggregation period. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + Timestamp *date.Time `json:"timestamp,omitempty"` + // Interval - Length of agregation period. Interval must be multiple of 15 minutes and may not be zero. The value should be in ISO 8601 format (http://en.wikipedia.org/wiki/ISO_8601#Durations). + Interval *string `json:"interval,omitempty"` + // Country - Country to which this record data is related. + Country *string `json:"country,omitempty"` + // Region - Country region to which this record data is related. + Region *string `json:"region,omitempty"` + // Zip - Zip code to which this record data is related. + Zip *string `json:"zip,omitempty"` + // UserID - User identifier path. /users/{userId} + UserID *string `json:"userId,omitempty"` + // ProductID - Product identifier path. /products/{productId} + ProductID *string `json:"productId,omitempty"` + // APIID - API identifier path. /apis/{apiId} + APIID *string `json:"apiId,omitempty"` + // OperationID - Operation identifier path. /apis/{apiId}/operations/{operationId} + OperationID *string `json:"operationId,omitempty"` + // APIRegion - API region identifier. + APIRegion *string `json:"apiRegion,omitempty"` + // SubscriptionID - Subscription identifier path. /subscriptions/{subscriptionId} + SubscriptionID *string `json:"subscriptionId,omitempty"` + // CallCountSuccess - Number of succesful calls. This includes calls returning HttpStatusCode <= 301 and HttpStatusCode.NotModified and HttpStatusCode.TemporaryRedirect + CallCountSuccess *int32 `json:"callCountSuccess,omitempty"` + // CallCountBlocked - Number of calls blocked due to invalid credentials. This includes calls returning HttpStatusCode.Unauthorize and HttpStatusCode.Forbidden and HttpStatusCode.TooManyRequests + CallCountBlocked *int32 `json:"callCountBlocked,omitempty"` + // CallCountFailed - Number of calls failed due to proxy or backend errors. This includes calls returning HttpStatusCode.BadRequest(400) and any Code between HttpStatusCode.InternalServerError (500) and 600 + CallCountFailed *int32 `json:"callCountFailed,omitempty"` + // CallCountOther - Number of other calls. + CallCountOther *int32 `json:"callCountOther,omitempty"` + // CallCountTotal - Total number of calls. + CallCountTotal *int32 `json:"callCountTotal,omitempty"` + // Bandwidth - Bandwidth consumed. + Bandwidth *int64 `json:"bandwidth,omitempty"` + // CacheHitCount - Number of times when content was served from cache policy. + CacheHitCount *int32 `json:"cacheHitCount,omitempty"` + // CacheMissCount - Number of times content was fetched from backend. + CacheMissCount *int32 `json:"cacheMissCount,omitempty"` + // APITimeAvg - Average time it took to process request. + APITimeAvg *float64 `json:"apiTimeAvg,omitempty"` + // APITimeMin - Minimum time it took to process request. + APITimeMin *float64 `json:"apiTimeMin,omitempty"` + // APITimeMax - Maximum time it took to process request. + APITimeMax *float64 `json:"apiTimeMax,omitempty"` + // ServiceTimeAvg - Average time it took to process request on backend. + ServiceTimeAvg *float64 `json:"serviceTimeAvg,omitempty"` + // ServiceTimeMin - Minimum time it took to process request on backend. + ServiceTimeMin *float64 `json:"serviceTimeMin,omitempty"` + // ServiceTimeMax - Maximum time it took to process request on backend. + ServiceTimeMax *float64 `json:"serviceTimeMax,omitempty"` +} + +// RepresentationContract operation request/response representation details. +type RepresentationContract struct { + // ContentType - Specifies a registered or custom content type for this representation, e.g. application/xml. + ContentType *string `json:"contentType,omitempty"` + // Sample - An example of the representation. + Sample *string `json:"sample,omitempty"` + // SchemaID - Schema identifier. Applicable only if 'contentType' value is neither 'application/x-www-form-urlencoded' nor 'multipart/form-data'. + SchemaID *string `json:"schemaId,omitempty"` + // TypeName - Type name defined by the schema. Applicable only if 'contentType' value is neither 'application/x-www-form-urlencoded' nor 'multipart/form-data'. + TypeName *string `json:"typeName,omitempty"` + // FormParameters - Collection of form parameters. Required if 'contentType' value is either 'application/x-www-form-urlencoded' or 'multipart/form-data'.. + FormParameters *[]ParameterContract `json:"formParameters,omitempty"` +} + +// RequestContract operation request details. +type RequestContract struct { + // Description - Operation request description. + Description *string `json:"description,omitempty"` + // QueryParameters - Collection of operation request query parameters. + QueryParameters *[]ParameterContract `json:"queryParameters,omitempty"` + // Headers - Collection of operation request headers. + Headers *[]ParameterContract `json:"headers,omitempty"` + // Representations - Collection of operation request representations. + Representations *[]RepresentationContract `json:"representations,omitempty"` +} + +// RequestReportCollection paged Report records list representation. +type RequestReportCollection struct { + autorest.Response `json:"-"` + // Value - Page values. + Value *[]RequestReportRecordContract `json:"value,omitempty"` + // Count - Total record count number across all pages. + Count *int64 `json:"count,omitempty"` +} + +// RequestReportRecordContract request Report data. +type RequestReportRecordContract struct { + // APIID - API identifier path. /apis/{apiId} + APIID *string `json:"apiId,omitempty"` + // OperationID - Operation identifier path. /apis/{apiId}/operations/{operationId} + OperationID *string `json:"operationId,omitempty"` + // ProductID - Product identifier path. /products/{productId} + ProductID *string `json:"productId,omitempty"` + // UserID - User identifier path. /users/{userId} + UserID *string `json:"userId,omitempty"` + // Method - The HTTP method associated with this request.. + Method *string `json:"method,omitempty"` + // URL - The full URL associated with this request. + URL *string `json:"url,omitempty"` + // IPAddress - The client IP address associated with this request. + IPAddress *string `json:"ipAddress,omitempty"` + // BackendResponseCode - The HTTP status code received by the gateway as a result of forwarding this request to the backend. + BackendResponseCode *string `json:"backendResponseCode,omitempty"` + // ResponseCode - The HTTP status code returned by the gateway. + ResponseCode *int32 `json:"responseCode,omitempty"` + // ResponseSize - The size of the response returned by the gateway. + ResponseSize *int32 `json:"responseSize,omitempty"` + // Timestamp - The date and time when this request was received by the gateway in ISO 8601 format. + Timestamp *date.Time `json:"timestamp,omitempty"` + // Cache - Specifies if response cache was involved in generating the response. If the value is none, the cache was not used. If the value is hit, cached response was returned. If the value is miss, the cache was used but lookup resulted in a miss and request was fullfilled by the backend. + Cache *string `json:"cache,omitempty"` + // APITime - The total time it took to process this request. + APITime *float64 `json:"apiTime,omitempty"` + // ServiceTime - he time it took to forward this request to the backend and get the response back. + ServiceTime *float64 `json:"serviceTime,omitempty"` + // APIRegion - Azure region where the gateway that processed this request is located. + APIRegion *string `json:"apiRegion,omitempty"` + // SubscriptionID - Subscription identifier path. /subscriptions/{subscriptionId} + SubscriptionID *string `json:"subscriptionId,omitempty"` + // RequestID - Request Identifier. + RequestID *string `json:"requestId,omitempty"` + // RequestSize - The size of this request.. + RequestSize *int32 `json:"requestSize,omitempty"` +} + +// Resource the Resource definition. +type Resource struct { + // ID - Resource ID. + ID *string `json:"id,omitempty"` + // Name - Resource name. + Name *string `json:"name,omitempty"` + // Type - Resource type for API Management resource. + Type *string `json:"type,omitempty"` +} + +// ResponseContract operation response details. +type ResponseContract struct { + // StatusCode - Operation response HTTP status code. + StatusCode *int32 `json:"statusCode,omitempty"` + // Description - Operation response description. + Description *string `json:"description,omitempty"` + // Representations - Collection of operation response representations. + Representations *[]RepresentationContract `json:"representations,omitempty"` + // Headers - Collection of operation response headers. + Headers *[]ParameterContract `json:"headers,omitempty"` +} + +// SamplingSettings sampling settings for Diagnostic. +type SamplingSettings struct { + // SamplingType - Sampling type. Possible values include: 'Fixed' + SamplingType SamplingType `json:"samplingType,omitempty"` + // Percentage - Rate of sampling for fixed-rate sampling. + Percentage *float64 `json:"percentage,omitempty"` +} + +// SaveConfigurationParameter parameters supplied to the Save Tenant Configuration operation. +type SaveConfigurationParameter struct { + // Branch - The name of the Git branch in which to commit the current configuration snapshot. + Branch *string `json:"branch,omitempty"` + // Force - The value if true, the current configuration database is committed to the Git repository, even if the Git repository has newer changes that would be overwritten. + Force *bool `json:"force,omitempty"` +} + +// SchemaCollection the response of the list schema operation. +type SchemaCollection struct { + autorest.Response `json:"-"` + // Value - Api Schema Contract value. + Value *[]SchemaContract `json:"value,omitempty"` + // NextLink - Next page link if any. + NextLink *string `json:"nextLink,omitempty"` +} + +// SchemaCollectionIterator provides access to a complete listing of SchemaContract values. +type SchemaCollectionIterator struct { + i int + page SchemaCollectionPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *SchemaCollectionIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter SchemaCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter SchemaCollectionIterator) Response() SchemaCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter SchemaCollectionIterator) Value() SchemaContract { + if !iter.page.NotDone() { + return SchemaContract{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (sc SchemaCollection) IsEmpty() bool { + return sc.Value == nil || len(*sc.Value) == 0 +} + +// schemaCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (sc SchemaCollection) schemaCollectionPreparer() (*http.Request, error) { + if sc.NextLink == nil || len(to.String(sc.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(sc.NextLink))) +} + +// SchemaCollectionPage contains a page of SchemaContract values. +type SchemaCollectionPage struct { + fn func(SchemaCollection) (SchemaCollection, error) + sc SchemaCollection +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *SchemaCollectionPage) Next() error { + next, err := page.fn(page.sc) + if err != nil { + return err + } + page.sc = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page SchemaCollectionPage) NotDone() bool { + return !page.sc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page SchemaCollectionPage) Response() SchemaCollection { + return page.sc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page SchemaCollectionPage) Values() []SchemaContract { + if page.sc.IsEmpty() { + return nil + } + return *page.sc.Value +} + +// SchemaContract schema Contract details. +type SchemaContract struct { + autorest.Response `json:"-"` + // SchemaContractProperties - Properties of the Schema. + *SchemaContractProperties `json:"properties,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` + // Name - Resource name. + Name *string `json:"name,omitempty"` + // Type - Resource type for API Management resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for SchemaContract. +func (sc SchemaContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sc.SchemaContractProperties != nil { + objectMap["properties"] = sc.SchemaContractProperties + } + if sc.ID != nil { + objectMap["id"] = sc.ID + } + if sc.Name != nil { + objectMap["name"] = sc.Name + } + if sc.Type != nil { + objectMap["type"] = sc.Type + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SchemaContract struct. +func (sc *SchemaContract) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var schemaContractProperties SchemaContractProperties + err = json.Unmarshal(*v, &schemaContractProperties) + if err != nil { + return err + } + sc.SchemaContractProperties = &schemaContractProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + sc.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + sc.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + sc.Type = &typeVar + } + } + } + + return nil +} + +// SchemaContractProperties schema contract Properties. +type SchemaContractProperties struct { + // ContentType - Must be a valid a media type used in a Content-Type header as defined in the RFC 2616. Media type of the schema document (e.g. application/json, application/xml). + ContentType *string `json:"contentType,omitempty"` + // SchemaDocumentProperties - Properties of the Schema Document. + *SchemaDocumentProperties `json:"document,omitempty"` +} + +// MarshalJSON is the custom marshaler for SchemaContractProperties. +func (scp SchemaContractProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if scp.ContentType != nil { + objectMap["contentType"] = scp.ContentType + } + if scp.SchemaDocumentProperties != nil { + objectMap["document"] = scp.SchemaDocumentProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SchemaContractProperties struct. +func (scp *SchemaContractProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "contentType": + if v != nil { + var contentType string + err = json.Unmarshal(*v, &contentType) + if err != nil { + return err + } + scp.ContentType = &contentType + } + case "document": + if v != nil { + var schemaDocumentProperties SchemaDocumentProperties + err = json.Unmarshal(*v, &schemaDocumentProperties) + if err != nil { + return err + } + scp.SchemaDocumentProperties = &schemaDocumentProperties + } + } + } + + return nil +} + +// SchemaDocumentProperties schema Document Properties. +type SchemaDocumentProperties struct { + // Value - Json escaped string defining the document representing the Schema. + Value *string `json:"value,omitempty"` +} + +// ServiceApplyNetworkConfigurationParameters parameter supplied to the Apply Network configuration operation. +type ServiceApplyNetworkConfigurationParameters struct { + // Location - Location of the Api Management service to update for a multi-region service. For a service deployed in a single region, this parameter is not required. + Location *string `json:"location,omitempty"` +} + +// ServiceApplyNetworkConfigurationUpdatesFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ServiceApplyNetworkConfigurationUpdatesFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ServiceApplyNetworkConfigurationUpdatesFuture) Result(client ServiceClient) (sr ServiceResource, err error) { + var done bool + done, err = future.Done(client) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.ServiceApplyNetworkConfigurationUpdatesFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("apimanagement.ServiceApplyNetworkConfigurationUpdatesFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if sr.Response.Response, err = future.GetResult(sender); err == nil && sr.Response.Response.StatusCode != http.StatusNoContent { + sr, err = client.ApplyNetworkConfigurationUpdatesResponder(sr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.ServiceApplyNetworkConfigurationUpdatesFuture", "Result", sr.Response.Response, "Failure responding to request") + } + } + return +} + +// ServiceBackupFuture an abstraction for monitoring and retrieving the results of a long-running operation. +type ServiceBackupFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ServiceBackupFuture) Result(client ServiceClient) (sr ServiceResource, err error) { + var done bool + done, err = future.Done(client) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.ServiceBackupFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("apimanagement.ServiceBackupFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if sr.Response.Response, err = future.GetResult(sender); err == nil && sr.Response.Response.StatusCode != http.StatusNoContent { + sr, err = client.BackupResponder(sr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.ServiceBackupFuture", "Result", sr.Response.Response, "Failure responding to request") + } + } + return +} + +// ServiceBackupRestoreParameters parameters supplied to the Backup/Restore of an API Management service operation. +type ServiceBackupRestoreParameters struct { + // StorageAccount - Azure Cloud Storage account (used to place/retrieve the backup) name. + StorageAccount *string `json:"storageAccount,omitempty"` + // AccessKey - Azure Cloud Storage account (used to place/retrieve the backup) access key. + AccessKey *string `json:"accessKey,omitempty"` + // ContainerName - Azure Cloud Storage blob container name used to place/retrieve the backup. + ContainerName *string `json:"containerName,omitempty"` + // BackupName - The name of the backup file to create. + BackupName *string `json:"backupName,omitempty"` +} + +// ServiceBaseProperties base Properties of an API Management service resource description. +type ServiceBaseProperties struct { + // NotificationSenderEmail - Email address from which the notification will be sent. + NotificationSenderEmail *string `json:"notificationSenderEmail,omitempty"` + // ProvisioningState - The current provisioning state of the API Management service which can be one of the following: Created/Activating/Succeeded/Updating/Failed/Stopped/Terminating/TerminationFailed/Deleted. + ProvisioningState *string `json:"provisioningState,omitempty"` + // TargetProvisioningState - The provisioning state of the API Management service, which is targeted by the long running operation started on the service. + TargetProvisioningState *string `json:"targetProvisioningState,omitempty"` + // CreatedAtUtc - Creation UTC date of the API Management service.The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + CreatedAtUtc *date.Time `json:"createdAtUtc,omitempty"` + // GatewayURL - Gateway URL of the API Management service. + GatewayURL *string `json:"gatewayUrl,omitempty"` + // GatewayRegionalURL - Gateway URL of the API Management service in the Default Region. + GatewayRegionalURL *string `json:"gatewayRegionalUrl,omitempty"` + // PortalURL - Publisher portal endpoint Url of the API Management service. + PortalURL *string `json:"portalUrl,omitempty"` + // ManagementAPIURL - Management API endpoint URL of the API Management service. + ManagementAPIURL *string `json:"managementApiUrl,omitempty"` + // ScmURL - SCM endpoint URL of the API Management service. + ScmURL *string `json:"scmUrl,omitempty"` + // HostnameConfigurations - Custom hostname configuration of the API Management service. + HostnameConfigurations *[]HostnameConfiguration `json:"hostnameConfigurations,omitempty"` + // PublicIPAddresses - Public Static Load Balanced IP addresses of the API Management service in Primary region. Available only for Basic, Standard and Premium SKU. + PublicIPAddresses *[]string `json:"publicIPAddresses,omitempty"` + // PrivateIPAddresses - Private Static Load Balanced IP addresses of the API Management service in Primary region which is deployed in an Internal Virtual Network. Available only for Basic, Standard and Premium SKU. + PrivateIPAddresses *[]string `json:"privateIPAddresses,omitempty"` + // VirtualNetworkConfiguration - Virtual network configuration of the API Management service. + VirtualNetworkConfiguration *VirtualNetworkConfiguration `json:"virtualNetworkConfiguration,omitempty"` + // AdditionalLocations - Additional datacenter locations of the API Management service. + AdditionalLocations *[]AdditionalLocation `json:"additionalLocations,omitempty"` + // CustomProperties - Custom properties of the API Management service. Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168` will disable the cipher TLS_RSA_WITH_3DES_EDE_CBC_SHA for all TLS(1.0, 1.1 and 1.2). Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11` can be used to disable just TLS 1.1 and setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10` can be used to disable TLS 1.0 on an API Management service. + CustomProperties map[string]*string `json:"customProperties"` + // Certificates - List of Certificates that need to be installed in the API Management service. Max supported certificates that can be installed is 10. + Certificates *[]CertificateConfiguration `json:"certificates,omitempty"` + // VirtualNetworkType - The type of VPN in which API Managemet service needs to be configured in. None (Default Value) means the API Management service is not part of any Virtual Network, External means the API Management deployment is set up inside a Virtual Network having an Internet Facing Endpoint, and Internal means that API Management deployment is setup inside a Virtual Network having an Intranet Facing Endpoint only. Possible values include: 'VirtualNetworkTypeNone', 'VirtualNetworkTypeExternal', 'VirtualNetworkTypeInternal' + VirtualNetworkType VirtualNetworkType `json:"virtualNetworkType,omitempty"` +} + +// MarshalJSON is the custom marshaler for ServiceBaseProperties. +func (sbp ServiceBaseProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sbp.NotificationSenderEmail != nil { + objectMap["notificationSenderEmail"] = sbp.NotificationSenderEmail + } + if sbp.ProvisioningState != nil { + objectMap["provisioningState"] = sbp.ProvisioningState + } + if sbp.TargetProvisioningState != nil { + objectMap["targetProvisioningState"] = sbp.TargetProvisioningState + } + if sbp.CreatedAtUtc != nil { + objectMap["createdAtUtc"] = sbp.CreatedAtUtc + } + if sbp.GatewayURL != nil { + objectMap["gatewayUrl"] = sbp.GatewayURL + } + if sbp.GatewayRegionalURL != nil { + objectMap["gatewayRegionalUrl"] = sbp.GatewayRegionalURL + } + if sbp.PortalURL != nil { + objectMap["portalUrl"] = sbp.PortalURL + } + if sbp.ManagementAPIURL != nil { + objectMap["managementApiUrl"] = sbp.ManagementAPIURL + } + if sbp.ScmURL != nil { + objectMap["scmUrl"] = sbp.ScmURL + } + if sbp.HostnameConfigurations != nil { + objectMap["hostnameConfigurations"] = sbp.HostnameConfigurations + } + if sbp.PublicIPAddresses != nil { + objectMap["publicIPAddresses"] = sbp.PublicIPAddresses + } + if sbp.PrivateIPAddresses != nil { + objectMap["privateIPAddresses"] = sbp.PrivateIPAddresses + } + if sbp.VirtualNetworkConfiguration != nil { + objectMap["virtualNetworkConfiguration"] = sbp.VirtualNetworkConfiguration + } + if sbp.AdditionalLocations != nil { + objectMap["additionalLocations"] = sbp.AdditionalLocations + } + if sbp.CustomProperties != nil { + objectMap["customProperties"] = sbp.CustomProperties + } + if sbp.Certificates != nil { + objectMap["certificates"] = sbp.Certificates + } + if sbp.VirtualNetworkType != "" { + objectMap["virtualNetworkType"] = sbp.VirtualNetworkType + } + return json.Marshal(objectMap) +} + +// ServiceCheckNameAvailabilityParameters parameters supplied to the CheckNameAvailability operation. +type ServiceCheckNameAvailabilityParameters struct { + // Name - The name to check for availability. + Name *string `json:"name,omitempty"` +} + +// ServiceCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ServiceCreateOrUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ServiceCreateOrUpdateFuture) Result(client ServiceClient) (sr ServiceResource, err error) { + var done bool + done, err = future.Done(client) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.ServiceCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("apimanagement.ServiceCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if sr.Response.Response, err = future.GetResult(sender); err == nil && sr.Response.Response.StatusCode != http.StatusNoContent { + sr, err = client.CreateOrUpdateResponder(sr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.ServiceCreateOrUpdateFuture", "Result", sr.Response.Response, "Failure responding to request") + } + } + return +} + +// ServiceGetSsoTokenResult the response of the GetSsoToken operation. +type ServiceGetSsoTokenResult struct { + autorest.Response `json:"-"` + // RedirectURI - Redirect URL to the Publisher Portal containing the SSO token. + RedirectURI *string `json:"redirectUri,omitempty"` +} + +// ServiceIdentity identity properties of the Api Management service resource. +type ServiceIdentity struct { + // Type - The identity type. Currently the only supported type is 'SystemAssigned'. + Type *string `json:"type,omitempty"` + // PrincipalID - The principal id of the identity. + PrincipalID *uuid.UUID `json:"principalId,omitempty"` + // TenantID - The client tenant id of the identity. + TenantID *uuid.UUID `json:"tenantId,omitempty"` +} + +// ServiceListResult the response of the List API Management services operation. +type ServiceListResult struct { + autorest.Response `json:"-"` + // Value - Result of the List API Management services operation. + Value *[]ServiceResource `json:"value,omitempty"` + // NextLink - Link to the next set of results. Not empty if Value contains incomplete list of API Management services. + NextLink *string `json:"nextLink,omitempty"` +} + +// ServiceListResultIterator provides access to a complete listing of ServiceResource values. +type ServiceListResultIterator struct { + i int + page ServiceListResultPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ServiceListResultIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ServiceListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ServiceListResultIterator) Response() ServiceListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ServiceListResultIterator) Value() ServiceResource { + if !iter.page.NotDone() { + return ServiceResource{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (slr ServiceListResult) IsEmpty() bool { + return slr.Value == nil || len(*slr.Value) == 0 +} + +// serviceListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (slr ServiceListResult) serviceListResultPreparer() (*http.Request, error) { + if slr.NextLink == nil || len(to.String(slr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(slr.NextLink))) +} + +// ServiceListResultPage contains a page of ServiceResource values. +type ServiceListResultPage struct { + fn func(ServiceListResult) (ServiceListResult, error) + slr ServiceListResult +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ServiceListResultPage) Next() error { + next, err := page.fn(page.slr) + if err != nil { + return err + } + page.slr = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ServiceListResultPage) NotDone() bool { + return !page.slr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ServiceListResultPage) Response() ServiceListResult { + return page.slr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ServiceListResultPage) Values() []ServiceResource { + if page.slr.IsEmpty() { + return nil + } + return *page.slr.Value +} + +// ServiceNameAvailabilityResult response of the CheckNameAvailability operation. +type ServiceNameAvailabilityResult struct { + autorest.Response `json:"-"` + // NameAvailable - True if the name is available and can be used to create a new API Management service; otherwise false. + NameAvailable *bool `json:"nameAvailable,omitempty"` + // Message - If reason == invalid, provide the user with the reason why the given name is invalid, and provide the resource naming requirements so that the user can select a valid name. If reason == AlreadyExists, explain that is already in use, and direct them to select a different name. + Message *string `json:"message,omitempty"` + // Reason - Invalid indicates the name provided does not match the resource provider’s naming requirements (incorrect length, unsupported characters, etc.) AlreadyExists indicates that the name is already in use and is therefore unavailable. Possible values include: 'Valid', 'Invalid', 'AlreadyExists' + Reason NameAvailabilityReason `json:"reason,omitempty"` +} + +// ServiceProperties properties of an API Management service resource description. +type ServiceProperties struct { + // PublisherEmail - Publisher email. + PublisherEmail *string `json:"publisherEmail,omitempty"` + // PublisherName - Publisher name. + PublisherName *string `json:"publisherName,omitempty"` + // NotificationSenderEmail - Email address from which the notification will be sent. + NotificationSenderEmail *string `json:"notificationSenderEmail,omitempty"` + // ProvisioningState - The current provisioning state of the API Management service which can be one of the following: Created/Activating/Succeeded/Updating/Failed/Stopped/Terminating/TerminationFailed/Deleted. + ProvisioningState *string `json:"provisioningState,omitempty"` + // TargetProvisioningState - The provisioning state of the API Management service, which is targeted by the long running operation started on the service. + TargetProvisioningState *string `json:"targetProvisioningState,omitempty"` + // CreatedAtUtc - Creation UTC date of the API Management service.The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + CreatedAtUtc *date.Time `json:"createdAtUtc,omitempty"` + // GatewayURL - Gateway URL of the API Management service. + GatewayURL *string `json:"gatewayUrl,omitempty"` + // GatewayRegionalURL - Gateway URL of the API Management service in the Default Region. + GatewayRegionalURL *string `json:"gatewayRegionalUrl,omitempty"` + // PortalURL - Publisher portal endpoint Url of the API Management service. + PortalURL *string `json:"portalUrl,omitempty"` + // ManagementAPIURL - Management API endpoint URL of the API Management service. + ManagementAPIURL *string `json:"managementApiUrl,omitempty"` + // ScmURL - SCM endpoint URL of the API Management service. + ScmURL *string `json:"scmUrl,omitempty"` + // HostnameConfigurations - Custom hostname configuration of the API Management service. + HostnameConfigurations *[]HostnameConfiguration `json:"hostnameConfigurations,omitempty"` + // PublicIPAddresses - Public Static Load Balanced IP addresses of the API Management service in Primary region. Available only for Basic, Standard and Premium SKU. + PublicIPAddresses *[]string `json:"publicIPAddresses,omitempty"` + // PrivateIPAddresses - Private Static Load Balanced IP addresses of the API Management service in Primary region which is deployed in an Internal Virtual Network. Available only for Basic, Standard and Premium SKU. + PrivateIPAddresses *[]string `json:"privateIPAddresses,omitempty"` + // VirtualNetworkConfiguration - Virtual network configuration of the API Management service. + VirtualNetworkConfiguration *VirtualNetworkConfiguration `json:"virtualNetworkConfiguration,omitempty"` + // AdditionalLocations - Additional datacenter locations of the API Management service. + AdditionalLocations *[]AdditionalLocation `json:"additionalLocations,omitempty"` + // CustomProperties - Custom properties of the API Management service. Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168` will disable the cipher TLS_RSA_WITH_3DES_EDE_CBC_SHA for all TLS(1.0, 1.1 and 1.2). Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11` can be used to disable just TLS 1.1 and setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10` can be used to disable TLS 1.0 on an API Management service. + CustomProperties map[string]*string `json:"customProperties"` + // Certificates - List of Certificates that need to be installed in the API Management service. Max supported certificates that can be installed is 10. + Certificates *[]CertificateConfiguration `json:"certificates,omitempty"` + // VirtualNetworkType - The type of VPN in which API Managemet service needs to be configured in. None (Default Value) means the API Management service is not part of any Virtual Network, External means the API Management deployment is set up inside a Virtual Network having an Internet Facing Endpoint, and Internal means that API Management deployment is setup inside a Virtual Network having an Intranet Facing Endpoint only. Possible values include: 'VirtualNetworkTypeNone', 'VirtualNetworkTypeExternal', 'VirtualNetworkTypeInternal' + VirtualNetworkType VirtualNetworkType `json:"virtualNetworkType,omitempty"` +} + +// MarshalJSON is the custom marshaler for ServiceProperties. +func (sp ServiceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sp.PublisherEmail != nil { + objectMap["publisherEmail"] = sp.PublisherEmail + } + if sp.PublisherName != nil { + objectMap["publisherName"] = sp.PublisherName + } + if sp.NotificationSenderEmail != nil { + objectMap["notificationSenderEmail"] = sp.NotificationSenderEmail + } + if sp.ProvisioningState != nil { + objectMap["provisioningState"] = sp.ProvisioningState + } + if sp.TargetProvisioningState != nil { + objectMap["targetProvisioningState"] = sp.TargetProvisioningState + } + if sp.CreatedAtUtc != nil { + objectMap["createdAtUtc"] = sp.CreatedAtUtc + } + if sp.GatewayURL != nil { + objectMap["gatewayUrl"] = sp.GatewayURL + } + if sp.GatewayRegionalURL != nil { + objectMap["gatewayRegionalUrl"] = sp.GatewayRegionalURL + } + if sp.PortalURL != nil { + objectMap["portalUrl"] = sp.PortalURL + } + if sp.ManagementAPIURL != nil { + objectMap["managementApiUrl"] = sp.ManagementAPIURL + } + if sp.ScmURL != nil { + objectMap["scmUrl"] = sp.ScmURL + } + if sp.HostnameConfigurations != nil { + objectMap["hostnameConfigurations"] = sp.HostnameConfigurations + } + if sp.PublicIPAddresses != nil { + objectMap["publicIPAddresses"] = sp.PublicIPAddresses + } + if sp.PrivateIPAddresses != nil { + objectMap["privateIPAddresses"] = sp.PrivateIPAddresses + } + if sp.VirtualNetworkConfiguration != nil { + objectMap["virtualNetworkConfiguration"] = sp.VirtualNetworkConfiguration + } + if sp.AdditionalLocations != nil { + objectMap["additionalLocations"] = sp.AdditionalLocations + } + if sp.CustomProperties != nil { + objectMap["customProperties"] = sp.CustomProperties + } + if sp.Certificates != nil { + objectMap["certificates"] = sp.Certificates + } + if sp.VirtualNetworkType != "" { + objectMap["virtualNetworkType"] = sp.VirtualNetworkType + } + return json.Marshal(objectMap) +} + +// ServiceResource a single API Management service resource in List or Get response. +type ServiceResource struct { + autorest.Response `json:"-"` + // ServiceProperties - Properties of the API Management service. + *ServiceProperties `json:"properties,omitempty"` + // Sku - SKU properties of the API Management service. + Sku *ServiceSkuProperties `json:"sku,omitempty"` + // Identity - Managed service identity of the Api Management service. + Identity *ServiceIdentity `json:"identity,omitempty"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Etag - ETag of the resource. + Etag *string `json:"etag,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` + // Name - Resource name. + Name *string `json:"name,omitempty"` + // Type - Resource type for API Management resource is set to Microsoft.ApiManagement. + Type *string `json:"type,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for ServiceResource. +func (sr ServiceResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sr.ServiceProperties != nil { + objectMap["properties"] = sr.ServiceProperties + } + if sr.Sku != nil { + objectMap["sku"] = sr.Sku + } + if sr.Identity != nil { + objectMap["identity"] = sr.Identity + } + if sr.Location != nil { + objectMap["location"] = sr.Location + } + if sr.Etag != nil { + objectMap["etag"] = sr.Etag + } + if sr.ID != nil { + objectMap["id"] = sr.ID + } + if sr.Name != nil { + objectMap["name"] = sr.Name + } + if sr.Type != nil { + objectMap["type"] = sr.Type + } + if sr.Tags != nil { + objectMap["tags"] = sr.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ServiceResource struct. +func (sr *ServiceResource) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var serviceProperties ServiceProperties + err = json.Unmarshal(*v, &serviceProperties) + if err != nil { + return err + } + sr.ServiceProperties = &serviceProperties + } + case "sku": + if v != nil { + var sku ServiceSkuProperties + err = json.Unmarshal(*v, &sku) + if err != nil { + return err + } + sr.Sku = &sku + } + case "identity": + if v != nil { + var identity ServiceIdentity + err = json.Unmarshal(*v, &identity) + if err != nil { + return err + } + sr.Identity = &identity + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + sr.Location = &location + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + sr.Etag = &etag + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + sr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + sr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + sr.Type = &typeVar + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + sr.Tags = tags + } + } + } + + return nil +} + +// ServiceRestoreFuture an abstraction for monitoring and retrieving the results of a long-running operation. +type ServiceRestoreFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ServiceRestoreFuture) Result(client ServiceClient) (sr ServiceResource, err error) { + var done bool + done, err = future.Done(client) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.ServiceRestoreFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("apimanagement.ServiceRestoreFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if sr.Response.Response, err = future.GetResult(sender); err == nil && sr.Response.Response.StatusCode != http.StatusNoContent { + sr, err = client.RestoreResponder(sr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.ServiceRestoreFuture", "Result", sr.Response.Response, "Failure responding to request") + } + } + return +} + +// ServiceSkuProperties API Management service resource SKU properties. +type ServiceSkuProperties struct { + // Name - Name of the Sku. Possible values include: 'SkuTypeDeveloper', 'SkuTypeStandard', 'SkuTypePremium', 'SkuTypeBasic' + Name SkuType `json:"name,omitempty"` + // Capacity - Capacity of the SKU (number of deployed units of the SKU). The default value is 1. + Capacity *int32 `json:"capacity,omitempty"` +} + +// ServiceUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation. +type ServiceUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ServiceUpdateFuture) Result(client ServiceClient) (sr ServiceResource, err error) { + var done bool + done, err = future.Done(client) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.ServiceUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("apimanagement.ServiceUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if sr.Response.Response, err = future.GetResult(sender); err == nil && sr.Response.Response.StatusCode != http.StatusNoContent { + sr, err = client.UpdateResponder(sr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.ServiceUpdateFuture", "Result", sr.Response.Response, "Failure responding to request") + } + } + return +} + +// ServiceUpdateHostnameFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ServiceUpdateHostnameFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ServiceUpdateHostnameFuture) Result(client ServiceClient) (sr ServiceResource, err error) { + var done bool + done, err = future.Done(client) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.ServiceUpdateHostnameFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("apimanagement.ServiceUpdateHostnameFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if sr.Response.Response, err = future.GetResult(sender); err == nil && sr.Response.Response.StatusCode != http.StatusNoContent { + sr, err = client.UpdateHostnameResponder(sr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.ServiceUpdateHostnameFuture", "Result", sr.Response.Response, "Failure responding to request") + } + } + return +} + +// ServiceUpdateHostnameParameters parameters supplied to the UpdateHostname operation. +type ServiceUpdateHostnameParameters struct { + // Update - Hostnames to create or update. + Update *[]HostnameConfigurationOld `json:"update,omitempty"` + // Delete - Hostnames types to delete. + Delete *[]HostnameType `json:"delete,omitempty"` +} + +// ServiceUpdateParameters parameter supplied to Update Api Management Service. +type ServiceUpdateParameters struct { + // ServiceUpdateProperties - Properties of the API Management service. + *ServiceUpdateProperties `json:"properties,omitempty"` + // Sku - SKU properties of the API Management service. + Sku *ServiceSkuProperties `json:"sku,omitempty"` + // Identity - Managed service identity of the Api Management service. + Identity *ServiceIdentity `json:"identity,omitempty"` + // Etag - ETag of the resource. + Etag *string `json:"etag,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` + // Name - Resource name. + Name *string `json:"name,omitempty"` + // Type - Resource type for API Management resource is set to Microsoft.ApiManagement. + Type *string `json:"type,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for ServiceUpdateParameters. +func (sup ServiceUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sup.ServiceUpdateProperties != nil { + objectMap["properties"] = sup.ServiceUpdateProperties + } + if sup.Sku != nil { + objectMap["sku"] = sup.Sku + } + if sup.Identity != nil { + objectMap["identity"] = sup.Identity + } + if sup.Etag != nil { + objectMap["etag"] = sup.Etag + } + if sup.ID != nil { + objectMap["id"] = sup.ID + } + if sup.Name != nil { + objectMap["name"] = sup.Name + } + if sup.Type != nil { + objectMap["type"] = sup.Type + } + if sup.Tags != nil { + objectMap["tags"] = sup.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ServiceUpdateParameters struct. +func (sup *ServiceUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var serviceUpdateProperties ServiceUpdateProperties + err = json.Unmarshal(*v, &serviceUpdateProperties) + if err != nil { + return err + } + sup.ServiceUpdateProperties = &serviceUpdateProperties + } + case "sku": + if v != nil { + var sku ServiceSkuProperties + err = json.Unmarshal(*v, &sku) + if err != nil { + return err + } + sup.Sku = &sku + } + case "identity": + if v != nil { + var identity ServiceIdentity + err = json.Unmarshal(*v, &identity) + if err != nil { + return err + } + sup.Identity = &identity + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + sup.Etag = &etag + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + sup.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + sup.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + sup.Type = &typeVar + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + sup.Tags = tags + } + } + } + + return nil +} + +// ServiceUpdateProperties properties of an API Management service resource description. +type ServiceUpdateProperties struct { + // PublisherEmail - Publisher email. + PublisherEmail *string `json:"publisherEmail,omitempty"` + // PublisherName - Publisher name. + PublisherName *string `json:"publisherName,omitempty"` + // NotificationSenderEmail - Email address from which the notification will be sent. + NotificationSenderEmail *string `json:"notificationSenderEmail,omitempty"` + // ProvisioningState - The current provisioning state of the API Management service which can be one of the following: Created/Activating/Succeeded/Updating/Failed/Stopped/Terminating/TerminationFailed/Deleted. + ProvisioningState *string `json:"provisioningState,omitempty"` + // TargetProvisioningState - The provisioning state of the API Management service, which is targeted by the long running operation started on the service. + TargetProvisioningState *string `json:"targetProvisioningState,omitempty"` + // CreatedAtUtc - Creation UTC date of the API Management service.The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + CreatedAtUtc *date.Time `json:"createdAtUtc,omitempty"` + // GatewayURL - Gateway URL of the API Management service. + GatewayURL *string `json:"gatewayUrl,omitempty"` + // GatewayRegionalURL - Gateway URL of the API Management service in the Default Region. + GatewayRegionalURL *string `json:"gatewayRegionalUrl,omitempty"` + // PortalURL - Publisher portal endpoint Url of the API Management service. + PortalURL *string `json:"portalUrl,omitempty"` + // ManagementAPIURL - Management API endpoint URL of the API Management service. + ManagementAPIURL *string `json:"managementApiUrl,omitempty"` + // ScmURL - SCM endpoint URL of the API Management service. + ScmURL *string `json:"scmUrl,omitempty"` + // HostnameConfigurations - Custom hostname configuration of the API Management service. + HostnameConfigurations *[]HostnameConfiguration `json:"hostnameConfigurations,omitempty"` + // PublicIPAddresses - Public Static Load Balanced IP addresses of the API Management service in Primary region. Available only for Basic, Standard and Premium SKU. + PublicIPAddresses *[]string `json:"publicIPAddresses,omitempty"` + // PrivateIPAddresses - Private Static Load Balanced IP addresses of the API Management service in Primary region which is deployed in an Internal Virtual Network. Available only for Basic, Standard and Premium SKU. + PrivateIPAddresses *[]string `json:"privateIPAddresses,omitempty"` + // VirtualNetworkConfiguration - Virtual network configuration of the API Management service. + VirtualNetworkConfiguration *VirtualNetworkConfiguration `json:"virtualNetworkConfiguration,omitempty"` + // AdditionalLocations - Additional datacenter locations of the API Management service. + AdditionalLocations *[]AdditionalLocation `json:"additionalLocations,omitempty"` + // CustomProperties - Custom properties of the API Management service. Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168` will disable the cipher TLS_RSA_WITH_3DES_EDE_CBC_SHA for all TLS(1.0, 1.1 and 1.2). Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11` can be used to disable just TLS 1.1 and setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10` can be used to disable TLS 1.0 on an API Management service. + CustomProperties map[string]*string `json:"customProperties"` + // Certificates - List of Certificates that need to be installed in the API Management service. Max supported certificates that can be installed is 10. + Certificates *[]CertificateConfiguration `json:"certificates,omitempty"` + // VirtualNetworkType - The type of VPN in which API Managemet service needs to be configured in. None (Default Value) means the API Management service is not part of any Virtual Network, External means the API Management deployment is set up inside a Virtual Network having an Internet Facing Endpoint, and Internal means that API Management deployment is setup inside a Virtual Network having an Intranet Facing Endpoint only. Possible values include: 'VirtualNetworkTypeNone', 'VirtualNetworkTypeExternal', 'VirtualNetworkTypeInternal' + VirtualNetworkType VirtualNetworkType `json:"virtualNetworkType,omitempty"` +} + +// MarshalJSON is the custom marshaler for ServiceUpdateProperties. +func (sup ServiceUpdateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sup.PublisherEmail != nil { + objectMap["publisherEmail"] = sup.PublisherEmail + } + if sup.PublisherName != nil { + objectMap["publisherName"] = sup.PublisherName + } + if sup.NotificationSenderEmail != nil { + objectMap["notificationSenderEmail"] = sup.NotificationSenderEmail + } + if sup.ProvisioningState != nil { + objectMap["provisioningState"] = sup.ProvisioningState + } + if sup.TargetProvisioningState != nil { + objectMap["targetProvisioningState"] = sup.TargetProvisioningState + } + if sup.CreatedAtUtc != nil { + objectMap["createdAtUtc"] = sup.CreatedAtUtc + } + if sup.GatewayURL != nil { + objectMap["gatewayUrl"] = sup.GatewayURL + } + if sup.GatewayRegionalURL != nil { + objectMap["gatewayRegionalUrl"] = sup.GatewayRegionalURL + } + if sup.PortalURL != nil { + objectMap["portalUrl"] = sup.PortalURL + } + if sup.ManagementAPIURL != nil { + objectMap["managementApiUrl"] = sup.ManagementAPIURL + } + if sup.ScmURL != nil { + objectMap["scmUrl"] = sup.ScmURL + } + if sup.HostnameConfigurations != nil { + objectMap["hostnameConfigurations"] = sup.HostnameConfigurations + } + if sup.PublicIPAddresses != nil { + objectMap["publicIPAddresses"] = sup.PublicIPAddresses + } + if sup.PrivateIPAddresses != nil { + objectMap["privateIPAddresses"] = sup.PrivateIPAddresses + } + if sup.VirtualNetworkConfiguration != nil { + objectMap["virtualNetworkConfiguration"] = sup.VirtualNetworkConfiguration + } + if sup.AdditionalLocations != nil { + objectMap["additionalLocations"] = sup.AdditionalLocations + } + if sup.CustomProperties != nil { + objectMap["customProperties"] = sup.CustomProperties + } + if sup.Certificates != nil { + objectMap["certificates"] = sup.Certificates + } + if sup.VirtualNetworkType != "" { + objectMap["virtualNetworkType"] = sup.VirtualNetworkType + } + return json.Marshal(objectMap) +} + +// ServiceUploadCertificateParameters parameters supplied to the Upload SSL certificate for an API Management +// service operation. +type ServiceUploadCertificateParameters struct { + // Type - Hostname type. Possible values include: 'Proxy', 'Portal', 'Management', 'Scm' + Type HostnameType `json:"type,omitempty"` + // Certificate - Base64 Encoded certificate. + Certificate *string `json:"certificate,omitempty"` + // CertificatePassword - Certificate password. + CertificatePassword *string `json:"certificate_password,omitempty"` +} + +// SubscriptionCollection paged Subscriptions list representation. +type SubscriptionCollection struct { + autorest.Response `json:"-"` + // Value - Page values. + Value *[]SubscriptionContract `json:"value,omitempty"` + // NextLink - Next page link if any. + NextLink *string `json:"nextLink,omitempty"` +} + +// SubscriptionCollectionIterator provides access to a complete listing of SubscriptionContract values. +type SubscriptionCollectionIterator struct { + i int + page SubscriptionCollectionPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *SubscriptionCollectionIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter SubscriptionCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter SubscriptionCollectionIterator) Response() SubscriptionCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter SubscriptionCollectionIterator) Value() SubscriptionContract { + if !iter.page.NotDone() { + return SubscriptionContract{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (sc SubscriptionCollection) IsEmpty() bool { + return sc.Value == nil || len(*sc.Value) == 0 +} + +// subscriptionCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (sc SubscriptionCollection) subscriptionCollectionPreparer() (*http.Request, error) { + if sc.NextLink == nil || len(to.String(sc.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(sc.NextLink))) +} + +// SubscriptionCollectionPage contains a page of SubscriptionContract values. +type SubscriptionCollectionPage struct { + fn func(SubscriptionCollection) (SubscriptionCollection, error) + sc SubscriptionCollection +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *SubscriptionCollectionPage) Next() error { + next, err := page.fn(page.sc) + if err != nil { + return err + } + page.sc = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page SubscriptionCollectionPage) NotDone() bool { + return !page.sc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page SubscriptionCollectionPage) Response() SubscriptionCollection { + return page.sc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page SubscriptionCollectionPage) Values() []SubscriptionContract { + if page.sc.IsEmpty() { + return nil + } + return *page.sc.Value +} + +// SubscriptionContract subscription details. +type SubscriptionContract struct { + autorest.Response `json:"-"` + // SubscriptionContractProperties - Subscription contract properties. + *SubscriptionContractProperties `json:"properties,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` + // Name - Resource name. + Name *string `json:"name,omitempty"` + // Type - Resource type for API Management resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for SubscriptionContract. +func (sc SubscriptionContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sc.SubscriptionContractProperties != nil { + objectMap["properties"] = sc.SubscriptionContractProperties + } + if sc.ID != nil { + objectMap["id"] = sc.ID + } + if sc.Name != nil { + objectMap["name"] = sc.Name + } + if sc.Type != nil { + objectMap["type"] = sc.Type + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SubscriptionContract struct. +func (sc *SubscriptionContract) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var subscriptionContractProperties SubscriptionContractProperties + err = json.Unmarshal(*v, &subscriptionContractProperties) + if err != nil { + return err + } + sc.SubscriptionContractProperties = &subscriptionContractProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + sc.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + sc.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + sc.Type = &typeVar + } + } + } + + return nil +} + +// SubscriptionContractProperties subscription details. +type SubscriptionContractProperties struct { + // UserID - The user resource identifier of the subscription owner. The value is a valid relative URL in the format of /users/{uid} where {uid} is a user identifier. + UserID *string `json:"userId,omitempty"` + // ProductID - The product resource identifier of the subscribed product. The value is a valid relative URL in the format of /products/{productId} where {productId} is a product identifier. + ProductID *string `json:"productId,omitempty"` + // DisplayName - The name of the subscription, or null if the subscription has no name. + DisplayName *string `json:"displayName,omitempty"` + // State - Subscription state. Possible states are * active – the subscription is active, * suspended – the subscription is blocked, and the subscriber cannot call any APIs of the product, * submitted – the subscription request has been made by the developer, but has not yet been approved or rejected, * rejected – the subscription request has been denied by an administrator, * cancelled – the subscription has been cancelled by the developer or administrator, * expired – the subscription reached its expiration date and was deactivated. Possible values include: 'Suspended', 'Active', 'Expired', 'Submitted', 'Rejected', 'Cancelled' + State SubscriptionState `json:"state,omitempty"` + // CreatedDate - Subscription creation date. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + CreatedDate *date.Time `json:"createdDate,omitempty"` + // StartDate - Subscription activation date. The setting is for audit purposes only and the subscription is not automatically activated. The subscription lifecycle can be managed by using the `state` property. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + StartDate *date.Time `json:"startDate,omitempty"` + // ExpirationDate - Subscription expiration date. The setting is for audit purposes only and the subscription is not automatically expired. The subscription lifecycle can be managed by using the `state` property. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + ExpirationDate *date.Time `json:"expirationDate,omitempty"` + // EndDate - Date when subscription was cancelled or expired. The setting is for audit purposes only and the subscription is not automatically cancelled. The subscription lifecycle can be managed by using the `state` property. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + EndDate *date.Time `json:"endDate,omitempty"` + // NotificationDate - Upcoming subscription expiration notification date. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + NotificationDate *date.Time `json:"notificationDate,omitempty"` + // PrimaryKey - Subscription primary key. + PrimaryKey *string `json:"primaryKey,omitempty"` + // SecondaryKey - Subscription secondary key. + SecondaryKey *string `json:"secondaryKey,omitempty"` + // StateComment - Optional subscription comment added by an administrator. + StateComment *string `json:"stateComment,omitempty"` +} + +// SubscriptionCreateParameterProperties parameters supplied to the Create subscription operation. +type SubscriptionCreateParameterProperties struct { + // UserID - User (user id path) for whom subscription is being created in form /users/{uid} + UserID *string `json:"userId,omitempty"` + // ProductID - Product (product id path) for which subscription is being created in form /products/{productid} + ProductID *string `json:"productId,omitempty"` + // DisplayName - Subscription name. + DisplayName *string `json:"displayName,omitempty"` + // PrimaryKey - Primary subscription key. If not specified during request key will be generated automatically. + PrimaryKey *string `json:"primaryKey,omitempty"` + // SecondaryKey - Secondary subscription key. If not specified during request key will be generated automatically. + SecondaryKey *string `json:"secondaryKey,omitempty"` + // State - Initial subscription state. If no value is specified, subscription is created with Submitted state. Possible states are * active – the subscription is active, * suspended – the subscription is blocked, and the subscriber cannot call any APIs of the product, * submitted – the subscription request has been made by the developer, but has not yet been approved or rejected, * rejected – the subscription request has been denied by an administrator, * cancelled – the subscription has been cancelled by the developer or administrator, * expired – the subscription reached its expiration date and was deactivated. Possible values include: 'Suspended', 'Active', 'Expired', 'Submitted', 'Rejected', 'Cancelled' + State SubscriptionState `json:"state,omitempty"` +} + +// SubscriptionCreateParameters subscription create details. +type SubscriptionCreateParameters struct { + // SubscriptionCreateParameterProperties - Subscription contract properties. + *SubscriptionCreateParameterProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for SubscriptionCreateParameters. +func (scp SubscriptionCreateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if scp.SubscriptionCreateParameterProperties != nil { + objectMap["properties"] = scp.SubscriptionCreateParameterProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SubscriptionCreateParameters struct. +func (scp *SubscriptionCreateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var subscriptionCreateParameterProperties SubscriptionCreateParameterProperties + err = json.Unmarshal(*v, &subscriptionCreateParameterProperties) + if err != nil { + return err + } + scp.SubscriptionCreateParameterProperties = &subscriptionCreateParameterProperties + } + } + } + + return nil +} + +// SubscriptionKeyParameterNamesContract subscription key parameter names details. +type SubscriptionKeyParameterNamesContract struct { + // Header - Subscription key header name. + Header *string `json:"header,omitempty"` + // Query - Subscription key query string parameter name. + Query *string `json:"query,omitempty"` +} + +// SubscriptionsDelegationSettingsProperties subscriptions delegation settings properties. +type SubscriptionsDelegationSettingsProperties struct { + // Enabled - Enable or disable delegation for subscriptions. + Enabled *bool `json:"enabled,omitempty"` +} + +// SubscriptionUpdateParameterProperties parameters supplied to the Update subscription operation. +type SubscriptionUpdateParameterProperties struct { + // UserID - User identifier path: /users/{uid} + UserID *string `json:"userId,omitempty"` + // ProductID - Product identifier path: /products/{productId} + ProductID *string `json:"productId,omitempty"` + // ExpirationDate - Subscription expiration date. The setting is for audit purposes only and the subscription is not automatically expired. The subscription lifecycle can be managed by using the `state` property. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + ExpirationDate *date.Time `json:"expirationDate,omitempty"` + // DisplayName - Subscription name. + DisplayName *string `json:"displayName,omitempty"` + // PrimaryKey - Primary subscription key. + PrimaryKey *string `json:"primaryKey,omitempty"` + // SecondaryKey - Secondary subscription key. + SecondaryKey *string `json:"secondaryKey,omitempty"` + // State - Subscription state. Possible states are * active – the subscription is active, * suspended – the subscription is blocked, and the subscriber cannot call any APIs of the product, * submitted – the subscription request has been made by the developer, but has not yet been approved or rejected, * rejected – the subscription request has been denied by an administrator, * cancelled – the subscription has been cancelled by the developer or administrator, * expired – the subscription reached its expiration date and was deactivated. Possible values include: 'Suspended', 'Active', 'Expired', 'Submitted', 'Rejected', 'Cancelled' + State SubscriptionState `json:"state,omitempty"` + // StateComment - Comments describing subscription state change by the administrator. + StateComment *string `json:"stateComment,omitempty"` +} + +// SubscriptionUpdateParameters subscription update details. +type SubscriptionUpdateParameters struct { + // SubscriptionUpdateParameterProperties - Subscription Update contract properties. + *SubscriptionUpdateParameterProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for SubscriptionUpdateParameters. +func (sup SubscriptionUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sup.SubscriptionUpdateParameterProperties != nil { + objectMap["properties"] = sup.SubscriptionUpdateParameterProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SubscriptionUpdateParameters struct. +func (sup *SubscriptionUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var subscriptionUpdateParameterProperties SubscriptionUpdateParameterProperties + err = json.Unmarshal(*v, &subscriptionUpdateParameterProperties) + if err != nil { + return err + } + sup.SubscriptionUpdateParameterProperties = &subscriptionUpdateParameterProperties + } + } + } + + return nil +} + +// TagCollection paged Tag list representation. +type TagCollection struct { + autorest.Response `json:"-"` + // Value - Page values. + Value *[]TagContract `json:"value,omitempty"` + // NextLink - Next page link if any. + NextLink *string `json:"nextLink,omitempty"` +} + +// TagCollectionIterator provides access to a complete listing of TagContract values. +type TagCollectionIterator struct { + i int + page TagCollectionPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *TagCollectionIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter TagCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter TagCollectionIterator) Response() TagCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter TagCollectionIterator) Value() TagContract { + if !iter.page.NotDone() { + return TagContract{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (tc TagCollection) IsEmpty() bool { + return tc.Value == nil || len(*tc.Value) == 0 +} + +// tagCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (tc TagCollection) tagCollectionPreparer() (*http.Request, error) { + if tc.NextLink == nil || len(to.String(tc.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(tc.NextLink))) +} + +// TagCollectionPage contains a page of TagContract values. +type TagCollectionPage struct { + fn func(TagCollection) (TagCollection, error) + tc TagCollection +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *TagCollectionPage) Next() error { + next, err := page.fn(page.tc) + if err != nil { + return err + } + page.tc = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page TagCollectionPage) NotDone() bool { + return !page.tc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page TagCollectionPage) Response() TagCollection { + return page.tc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page TagCollectionPage) Values() []TagContract { + if page.tc.IsEmpty() { + return nil + } + return *page.tc.Value +} + +// TagContract tag Contract details. +type TagContract struct { + autorest.Response `json:"-"` + // TagContractProperties - Tag entity contract properties. + *TagContractProperties `json:"properties,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` + // Name - Resource name. + Name *string `json:"name,omitempty"` + // Type - Resource type for API Management resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for TagContract. +func (tc TagContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if tc.TagContractProperties != nil { + objectMap["properties"] = tc.TagContractProperties + } + if tc.ID != nil { + objectMap["id"] = tc.ID + } + if tc.Name != nil { + objectMap["name"] = tc.Name + } + if tc.Type != nil { + objectMap["type"] = tc.Type + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for TagContract struct. +func (tc *TagContract) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var tagContractProperties TagContractProperties + err = json.Unmarshal(*v, &tagContractProperties) + if err != nil { + return err + } + tc.TagContractProperties = &tagContractProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + tc.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + tc.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + tc.Type = &typeVar + } + } + } + + return nil +} + +// TagContractProperties tag contract Properties. +type TagContractProperties struct { + // DisplayName - Tag name. + DisplayName *string `json:"displayName,omitempty"` +} + +// TagCreateUpdateParameters parameters supplied to Create/Update Tag operations. +type TagCreateUpdateParameters struct { + // TagContractProperties - Properties supplied to Create Tag operation. + *TagContractProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for TagCreateUpdateParameters. +func (tcup TagCreateUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if tcup.TagContractProperties != nil { + objectMap["properties"] = tcup.TagContractProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for TagCreateUpdateParameters struct. +func (tcup *TagCreateUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var tagContractProperties TagContractProperties + err = json.Unmarshal(*v, &tagContractProperties) + if err != nil { + return err + } + tcup.TagContractProperties = &tagContractProperties + } + } + } + + return nil +} + +// TagDescriptionBaseProperties parameters supplied to the Create TagDescription operation. +type TagDescriptionBaseProperties struct { + // Description - Description of the Tag. + Description *string `json:"description,omitempty"` + // ExternalDocsURL - Absolute URL of external resources describing the tag. + ExternalDocsURL *string `json:"externalDocsUrl,omitempty"` + // ExternalDocsDescription - Description of the external resources describing the tag. + ExternalDocsDescription *string `json:"externalDocsDescription,omitempty"` +} + +// TagDescriptionCollection paged TagDescription list representation. +type TagDescriptionCollection struct { + autorest.Response `json:"-"` + // Value - Page values. + Value *[]TagDescriptionContract `json:"value,omitempty"` + // NextLink - Next page link if any. + NextLink *string `json:"nextLink,omitempty"` +} + +// TagDescriptionCollectionIterator provides access to a complete listing of TagDescriptionContract values. +type TagDescriptionCollectionIterator struct { + i int + page TagDescriptionCollectionPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *TagDescriptionCollectionIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter TagDescriptionCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter TagDescriptionCollectionIterator) Response() TagDescriptionCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter TagDescriptionCollectionIterator) Value() TagDescriptionContract { + if !iter.page.NotDone() { + return TagDescriptionContract{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (tdc TagDescriptionCollection) IsEmpty() bool { + return tdc.Value == nil || len(*tdc.Value) == 0 +} + +// tagDescriptionCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (tdc TagDescriptionCollection) tagDescriptionCollectionPreparer() (*http.Request, error) { + if tdc.NextLink == nil || len(to.String(tdc.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(tdc.NextLink))) +} + +// TagDescriptionCollectionPage contains a page of TagDescriptionContract values. +type TagDescriptionCollectionPage struct { + fn func(TagDescriptionCollection) (TagDescriptionCollection, error) + tdc TagDescriptionCollection +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *TagDescriptionCollectionPage) Next() error { + next, err := page.fn(page.tdc) + if err != nil { + return err + } + page.tdc = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page TagDescriptionCollectionPage) NotDone() bool { + return !page.tdc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page TagDescriptionCollectionPage) Response() TagDescriptionCollection { + return page.tdc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page TagDescriptionCollectionPage) Values() []TagDescriptionContract { + if page.tdc.IsEmpty() { + return nil + } + return *page.tdc.Value +} + +// TagDescriptionContract contract details. +type TagDescriptionContract struct { + autorest.Response `json:"-"` + // TagDescriptionContractProperties - TagDescription entity contract properties. + *TagDescriptionContractProperties `json:"properties,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` + // Name - Resource name. + Name *string `json:"name,omitempty"` + // Type - Resource type for API Management resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for TagDescriptionContract. +func (tdc TagDescriptionContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if tdc.TagDescriptionContractProperties != nil { + objectMap["properties"] = tdc.TagDescriptionContractProperties + } + if tdc.ID != nil { + objectMap["id"] = tdc.ID + } + if tdc.Name != nil { + objectMap["name"] = tdc.Name + } + if tdc.Type != nil { + objectMap["type"] = tdc.Type + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for TagDescriptionContract struct. +func (tdc *TagDescriptionContract) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var tagDescriptionContractProperties TagDescriptionContractProperties + err = json.Unmarshal(*v, &tagDescriptionContractProperties) + if err != nil { + return err + } + tdc.TagDescriptionContractProperties = &tagDescriptionContractProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + tdc.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + tdc.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + tdc.Type = &typeVar + } + } + } + + return nil +} + +// TagDescriptionContractProperties tagDescription contract Properties. +type TagDescriptionContractProperties struct { + // DisplayName - Tag name. + DisplayName *string `json:"displayName,omitempty"` + // Description - Description of the Tag. + Description *string `json:"description,omitempty"` + // ExternalDocsURL - Absolute URL of external resources describing the tag. + ExternalDocsURL *string `json:"externalDocsUrl,omitempty"` + // ExternalDocsDescription - Description of the external resources describing the tag. + ExternalDocsDescription *string `json:"externalDocsDescription,omitempty"` +} + +// TagDescriptionCreateParameters parameters supplied to the Create TagDescription operation. +type TagDescriptionCreateParameters struct { + // TagDescriptionBaseProperties - Properties supplied to Create TagDescription operation. + *TagDescriptionBaseProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for TagDescriptionCreateParameters. +func (tdcp TagDescriptionCreateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if tdcp.TagDescriptionBaseProperties != nil { + objectMap["properties"] = tdcp.TagDescriptionBaseProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for TagDescriptionCreateParameters struct. +func (tdcp *TagDescriptionCreateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var tagDescriptionBaseProperties TagDescriptionBaseProperties + err = json.Unmarshal(*v, &tagDescriptionBaseProperties) + if err != nil { + return err + } + tdcp.TagDescriptionBaseProperties = &tagDescriptionBaseProperties + } + } + } + + return nil +} + +// TagResourceCollection paged Tag list representation. +type TagResourceCollection struct { + autorest.Response `json:"-"` + // Value - Page values. + Value *[]TagResourceContract `json:"value,omitempty"` + // Count - Total record count number across all pages. + Count *int64 `json:"count,omitempty"` + // NextLink - Next page link if any. + NextLink *string `json:"nextLink,omitempty"` +} + +// TagResourceCollectionIterator provides access to a complete listing of TagResourceContract values. +type TagResourceCollectionIterator struct { + i int + page TagResourceCollectionPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *TagResourceCollectionIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter TagResourceCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter TagResourceCollectionIterator) Response() TagResourceCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter TagResourceCollectionIterator) Value() TagResourceContract { + if !iter.page.NotDone() { + return TagResourceContract{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (trc TagResourceCollection) IsEmpty() bool { + return trc.Value == nil || len(*trc.Value) == 0 +} + +// tagResourceCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (trc TagResourceCollection) tagResourceCollectionPreparer() (*http.Request, error) { + if trc.NextLink == nil || len(to.String(trc.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(trc.NextLink))) +} + +// TagResourceCollectionPage contains a page of TagResourceContract values. +type TagResourceCollectionPage struct { + fn func(TagResourceCollection) (TagResourceCollection, error) + trc TagResourceCollection +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *TagResourceCollectionPage) Next() error { + next, err := page.fn(page.trc) + if err != nil { + return err + } + page.trc = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page TagResourceCollectionPage) NotDone() bool { + return !page.trc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page TagResourceCollectionPage) Response() TagResourceCollection { + return page.trc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page TagResourceCollectionPage) Values() []TagResourceContract { + if page.trc.IsEmpty() { + return nil + } + return *page.trc.Value +} + +// TagResourceContract tagResource contract properties. +type TagResourceContract struct { + // Tag - Tag associated with the resource. + Tag *TagTagResourceContractProperties `json:"tag,omitempty"` + // API - Api associated with the tag. + API *APITagResourceContractProperties `json:"api,omitempty"` + // Operation - Operation associated with the tag. + Operation *OperationTagResourceContractProperties `json:"operation,omitempty"` + // Product - Product associated with the tag. + Product *ProductTagResourceContractProperties `json:"product,omitempty"` +} + +// TagTagResourceContractProperties contract defining the Tag property in the Tag Resource Contract +type TagTagResourceContractProperties struct { + // ID - Tag identifier + ID *string `json:"id,omitempty"` + // Name - Tag Name + Name *string `json:"name,omitempty"` +} + +// TenantConfigurationDeployFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type TenantConfigurationDeployFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *TenantConfigurationDeployFuture) Result(client TenantConfigurationClient) (orc OperationResultContract, err error) { + var done bool + done, err = future.Done(client) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.TenantConfigurationDeployFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("apimanagement.TenantConfigurationDeployFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if orc.Response.Response, err = future.GetResult(sender); err == nil && orc.Response.Response.StatusCode != http.StatusNoContent { + orc, err = client.DeployResponder(orc.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.TenantConfigurationDeployFuture", "Result", orc.Response.Response, "Failure responding to request") + } + } + return +} + +// TenantConfigurationSaveFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type TenantConfigurationSaveFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *TenantConfigurationSaveFuture) Result(client TenantConfigurationClient) (orc OperationResultContract, err error) { + var done bool + done, err = future.Done(client) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.TenantConfigurationSaveFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("apimanagement.TenantConfigurationSaveFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if orc.Response.Response, err = future.GetResult(sender); err == nil && orc.Response.Response.StatusCode != http.StatusNoContent { + orc, err = client.SaveResponder(orc.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.TenantConfigurationSaveFuture", "Result", orc.Response.Response, "Failure responding to request") + } + } + return +} + +// TenantConfigurationSyncStateContract tenant Configuration Synchronization State. +type TenantConfigurationSyncStateContract struct { + autorest.Response `json:"-"` + // Branch - The name of Git branch. + Branch *string `json:"branch,omitempty"` + // CommitID - The latest commit Id. + CommitID *string `json:"commitId,omitempty"` + // IsExport - value indicating if last sync was save (true) or deploy (false) operation. + IsExport *bool `json:"isExport,omitempty"` + // IsSynced - value indicating if last synchronization was later than the configuration change. + IsSynced *bool `json:"isSynced,omitempty"` + // IsGitEnabled - value indicating whether Git configuration access is enabled. + IsGitEnabled *bool `json:"isGitEnabled,omitempty"` + // SyncDate - The date of the latest synchronization. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + SyncDate *date.Time `json:"syncDate,omitempty"` + // ConfigurationChangeDate - The date of the latest configuration change. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + ConfigurationChangeDate *date.Time `json:"configurationChangeDate,omitempty"` +} + +// TenantConfigurationValidateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type TenantConfigurationValidateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *TenantConfigurationValidateFuture) Result(client TenantConfigurationClient) (orc OperationResultContract, err error) { + var done bool + done, err = future.Done(client) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.TenantConfigurationValidateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("apimanagement.TenantConfigurationValidateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if orc.Response.Response, err = future.GetResult(sender); err == nil && orc.Response.Response.StatusCode != http.StatusNoContent { + orc, err = client.ValidateResponder(orc.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.TenantConfigurationValidateFuture", "Result", orc.Response.Response, "Failure responding to request") + } + } + return +} + +// TermsOfServiceProperties terms of service contract properties. +type TermsOfServiceProperties struct { + // Text - A terms of service text. + Text *string `json:"text,omitempty"` + // Enabled - Display terms of service during a sign-up process. + Enabled *bool `json:"enabled,omitempty"` + // ConsentRequired - Ask user for consent to the terms of service. + ConsentRequired *bool `json:"consentRequired,omitempty"` +} + +// TokenBodyParameterContract oAuth acquire token request body parameter (www-url-form-encoded). +type TokenBodyParameterContract struct { + // Name - body parameter name. + Name *string `json:"name,omitempty"` + // Value - body parameter value. + Value *string `json:"value,omitempty"` +} + +// UserCollection paged Users list representation. +type UserCollection struct { + autorest.Response `json:"-"` + // Value - Page values. + Value *[]UserContract `json:"value,omitempty"` + // NextLink - Next page link if any. + NextLink *string `json:"nextLink,omitempty"` +} + +// UserCollectionIterator provides access to a complete listing of UserContract values. +type UserCollectionIterator struct { + i int + page UserCollectionPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *UserCollectionIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter UserCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter UserCollectionIterator) Response() UserCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter UserCollectionIterator) Value() UserContract { + if !iter.page.NotDone() { + return UserContract{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (uc UserCollection) IsEmpty() bool { + return uc.Value == nil || len(*uc.Value) == 0 +} + +// userCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (uc UserCollection) userCollectionPreparer() (*http.Request, error) { + if uc.NextLink == nil || len(to.String(uc.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(uc.NextLink))) +} + +// UserCollectionPage contains a page of UserContract values. +type UserCollectionPage struct { + fn func(UserCollection) (UserCollection, error) + uc UserCollection +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *UserCollectionPage) Next() error { + next, err := page.fn(page.uc) + if err != nil { + return err + } + page.uc = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page UserCollectionPage) NotDone() bool { + return !page.uc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page UserCollectionPage) Response() UserCollection { + return page.uc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page UserCollectionPage) Values() []UserContract { + if page.uc.IsEmpty() { + return nil + } + return *page.uc.Value +} + +// UserContract user details. +type UserContract struct { + autorest.Response `json:"-"` + // UserContractProperties - User entity contract properties. + *UserContractProperties `json:"properties,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` + // Name - Resource name. + Name *string `json:"name,omitempty"` + // Type - Resource type for API Management resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for UserContract. +func (uc UserContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if uc.UserContractProperties != nil { + objectMap["properties"] = uc.UserContractProperties + } + if uc.ID != nil { + objectMap["id"] = uc.ID + } + if uc.Name != nil { + objectMap["name"] = uc.Name + } + if uc.Type != nil { + objectMap["type"] = uc.Type + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for UserContract struct. +func (uc *UserContract) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var userContractProperties UserContractProperties + err = json.Unmarshal(*v, &userContractProperties) + if err != nil { + return err + } + uc.UserContractProperties = &userContractProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + uc.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + uc.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + uc.Type = &typeVar + } + } + } + + return nil +} + +// UserContractProperties user profile. +type UserContractProperties struct { + // FirstName - First name. + FirstName *string `json:"firstName,omitempty"` + // LastName - Last name. + LastName *string `json:"lastName,omitempty"` + // Email - Email address. + Email *string `json:"email,omitempty"` + // RegistrationDate - Date of user registration. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + RegistrationDate *date.Time `json:"registrationDate,omitempty"` + // Groups - Collection of groups user is part of. + Groups *[]GroupContractProperties `json:"groups,omitempty"` + // State - Account state. Specifies whether the user is active or not. Blocked users are unable to sign into the developer portal or call any APIs of subscribed products. Default state is Active. Possible values include: 'UserStateActive', 'UserStateBlocked', 'UserStatePending', 'UserStateDeleted' + State UserState `json:"state,omitempty"` + // Note - Optional note about a user set by the administrator. + Note *string `json:"note,omitempty"` + // Identities - Collection of user identities. + Identities *[]UserIdentityContract `json:"identities,omitempty"` +} + +// UserCreateParameterProperties parameters supplied to the Create User operation. +type UserCreateParameterProperties struct { + // Email - Email address. Must not be empty and must be unique within the service instance. + Email *string `json:"email,omitempty"` + // FirstName - First name. + FirstName *string `json:"firstName,omitempty"` + // LastName - Last name. + LastName *string `json:"lastName,omitempty"` + // Password - User Password. If no value is provided, a default password is generated. + Password *string `json:"password,omitempty"` + // Confirmation - Determines the type of confirmation e-mail that will be sent to the newly created user. Possible values include: 'Signup', 'Invite' + Confirmation Confirmation `json:"confirmation,omitempty"` + // State - Account state. Specifies whether the user is active or not. Blocked users are unable to sign into the developer portal or call any APIs of subscribed products. Default state is Active. Possible values include: 'UserStateActive', 'UserStateBlocked', 'UserStatePending', 'UserStateDeleted' + State UserState `json:"state,omitempty"` + // Note - Optional note about a user set by the administrator. + Note *string `json:"note,omitempty"` + // Identities - Collection of user identities. + Identities *[]UserIdentityContract `json:"identities,omitempty"` +} + +// UserCreateParameters user create details. +type UserCreateParameters struct { + // UserCreateParameterProperties - User entity create contract properties. + *UserCreateParameterProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for UserCreateParameters. +func (ucp UserCreateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ucp.UserCreateParameterProperties != nil { + objectMap["properties"] = ucp.UserCreateParameterProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for UserCreateParameters struct. +func (ucp *UserCreateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var userCreateParameterProperties UserCreateParameterProperties + err = json.Unmarshal(*v, &userCreateParameterProperties) + if err != nil { + return err + } + ucp.UserCreateParameterProperties = &userCreateParameterProperties + } + } + } + + return nil +} + +// UserEntityBaseParameters user Entity Base Parameters set. +type UserEntityBaseParameters struct { + // State - Account state. Specifies whether the user is active or not. Blocked users are unable to sign into the developer portal or call any APIs of subscribed products. Default state is Active. Possible values include: 'UserStateActive', 'UserStateBlocked', 'UserStatePending', 'UserStateDeleted' + State UserState `json:"state,omitempty"` + // Note - Optional note about a user set by the administrator. + Note *string `json:"note,omitempty"` + // Identities - Collection of user identities. + Identities *[]UserIdentityContract `json:"identities,omitempty"` +} + +// UserIdentityCollection list of Users Identity list representation. +type UserIdentityCollection struct { + autorest.Response `json:"-"` + // Value - User Identity values. + Value *[]UserIdentityContract `json:"value,omitempty"` + // Count - Total record count number across all pages. + Count *int64 `json:"count,omitempty"` + // NextLink - Next page link if any. + NextLink *string `json:"nextLink,omitempty"` +} + +// UserIdentityCollectionIterator provides access to a complete listing of UserIdentityContract values. +type UserIdentityCollectionIterator struct { + i int + page UserIdentityCollectionPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *UserIdentityCollectionIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter UserIdentityCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter UserIdentityCollectionIterator) Response() UserIdentityCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter UserIdentityCollectionIterator) Value() UserIdentityContract { + if !iter.page.NotDone() { + return UserIdentityContract{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (uic UserIdentityCollection) IsEmpty() bool { + return uic.Value == nil || len(*uic.Value) == 0 +} + +// userIdentityCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (uic UserIdentityCollection) userIdentityCollectionPreparer() (*http.Request, error) { + if uic.NextLink == nil || len(to.String(uic.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(uic.NextLink))) +} + +// UserIdentityCollectionPage contains a page of UserIdentityContract values. +type UserIdentityCollectionPage struct { + fn func(UserIdentityCollection) (UserIdentityCollection, error) + uic UserIdentityCollection +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *UserIdentityCollectionPage) Next() error { + next, err := page.fn(page.uic) + if err != nil { + return err + } + page.uic = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page UserIdentityCollectionPage) NotDone() bool { + return !page.uic.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page UserIdentityCollectionPage) Response() UserIdentityCollection { + return page.uic +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page UserIdentityCollectionPage) Values() []UserIdentityContract { + if page.uic.IsEmpty() { + return nil + } + return *page.uic.Value +} + +// UserIdentityContract user identity details. +type UserIdentityContract struct { + // Provider - Identity provider name. + Provider *string `json:"provider,omitempty"` + // ID - Identifier value within provider. + ID *string `json:"id,omitempty"` +} + +// UserTokenParameters parameters supplied to the Get User Token operation. +type UserTokenParameters struct { + // KeyType - The Key to be used to generate token for user. Possible values include: 'Primary', 'Secondary' + KeyType KeyType `json:"keyType,omitempty"` + // Expiry - The Expiry time of the Token. Maximum token expiry time is set to 30 days. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + Expiry *date.Time `json:"expiry,omitempty"` +} + +// UserTokenResult get User Token response details. +type UserTokenResult struct { + autorest.Response `json:"-"` + // Value - Shared Access Authorization token for the User. + Value *string `json:"value,omitempty"` +} + +// UserUpdateParameters user update parameters. +type UserUpdateParameters struct { + // UserUpdateParametersProperties - User entity update contract properties. + *UserUpdateParametersProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for UserUpdateParameters. +func (uup UserUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if uup.UserUpdateParametersProperties != nil { + objectMap["properties"] = uup.UserUpdateParametersProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for UserUpdateParameters struct. +func (uup *UserUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var userUpdateParametersProperties UserUpdateParametersProperties + err = json.Unmarshal(*v, &userUpdateParametersProperties) + if err != nil { + return err + } + uup.UserUpdateParametersProperties = &userUpdateParametersProperties + } + } + } + + return nil +} + +// UserUpdateParametersProperties parameters supplied to the Update User operation. +type UserUpdateParametersProperties struct { + // Email - Email address. Must not be empty and must be unique within the service instance. + Email *string `json:"email,omitempty"` + // Password - User Password. + Password *string `json:"password,omitempty"` + // FirstName - First name. + FirstName *string `json:"firstName,omitempty"` + // LastName - Last name. + LastName *string `json:"lastName,omitempty"` + // State - Account state. Specifies whether the user is active or not. Blocked users are unable to sign into the developer portal or call any APIs of subscribed products. Default state is Active. Possible values include: 'UserStateActive', 'UserStateBlocked', 'UserStatePending', 'UserStateDeleted' + State UserState `json:"state,omitempty"` + // Note - Optional note about a user set by the administrator. + Note *string `json:"note,omitempty"` + // Identities - Collection of user identities. + Identities *[]UserIdentityContract `json:"identities,omitempty"` +} + +// VirtualNetworkConfiguration configuration of a virtual network to which API Management service is deployed. +type VirtualNetworkConfiguration struct { + // Vnetid - The virtual network ID. This is typically a GUID. Expect a null GUID by default. + Vnetid *string `json:"vnetid,omitempty"` + // Subnetname - The name of the subnet. + Subnetname *string `json:"subnetname,omitempty"` + // SubnetResourceID - The full resource ID of a subnet in a virtual network to deploy the API Management service in. + SubnetResourceID *string `json:"subnetResourceId,omitempty"` +} + +// X509CertificateName properties of server X509Names. +type X509CertificateName struct { + // Name - Common Name of the Certificate. + Name *string `json:"name,omitempty"` + // IssuerCertificateThumbprint - Thumbprint for the Issuer of the Certificate. + IssuerCertificateThumbprint *string `json:"issuerCertificateThumbprint,omitempty"` +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/networkstatus.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/networkstatus.go new file mode 100644 index 000000000..292afc598 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/networkstatus.go @@ -0,0 +1,198 @@ +package apimanagement + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// NetworkStatusClient is the apiManagement Client +type NetworkStatusClient struct { + BaseClient +} + +// NewNetworkStatusClient creates an instance of the NetworkStatusClient client. +func NewNetworkStatusClient(subscriptionID string) NetworkStatusClient { + return NewNetworkStatusClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewNetworkStatusClientWithBaseURI creates an instance of the NetworkStatusClient client. +func NewNetworkStatusClientWithBaseURI(baseURI string, subscriptionID string) NetworkStatusClient { + return NetworkStatusClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// ListByLocation gets the Connectivity Status to the external resources on which the Api Management service depends +// from inside the Cloud Service. This also returns the DNS Servers as visible to the CloudService. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// locationName - location in which the API Management service is deployed. This is one of the Azure Regions +// like West US, East US, South Central US. +func (client NetworkStatusClient) ListByLocation(ctx context.Context, resourceGroupName string, serviceName string, locationName string) (result NetworkStatusContract, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: locationName, + Constraints: []validation.Constraint{{Target: "locationName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.NetworkStatusClient", "ListByLocation", err.Error()) + } + + req, err := client.ListByLocationPreparer(ctx, resourceGroupName, serviceName, locationName) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.NetworkStatusClient", "ListByLocation", nil, "Failure preparing request") + return + } + + resp, err := client.ListByLocationSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.NetworkStatusClient", "ListByLocation", resp, "Failure sending request") + return + } + + result, err = client.ListByLocationResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.NetworkStatusClient", "ListByLocation", resp, "Failure responding to request") + } + + return +} + +// ListByLocationPreparer prepares the ListByLocation request. +func (client NetworkStatusClient) ListByLocationPreparer(ctx context.Context, resourceGroupName string, serviceName string, locationName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "locationName": autorest.Encode("path", locationName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/locations/{locationName}/networkstatus", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByLocationSender sends the ListByLocation request. The method will close the +// http.Response Body if it receives an error. +func (client NetworkStatusClient) ListByLocationSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByLocationResponder handles the response to the ListByLocation request. The method always +// closes the http.Response Body. +func (client NetworkStatusClient) ListByLocationResponder(resp *http.Response) (result NetworkStatusContract, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByService gets the Connectivity Status to the external resources on which the Api Management service depends +// from inside the Cloud Service. This also returns the DNS Servers as visible to the CloudService. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +func (client NetworkStatusClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string) (result ListNetworkStatusContractByLocation, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.NetworkStatusClient", "ListByService", err.Error()) + } + + req, err := client.ListByServicePreparer(ctx, resourceGroupName, serviceName) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.NetworkStatusClient", "ListByService", nil, "Failure preparing request") + return + } + + resp, err := client.ListByServiceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.NetworkStatusClient", "ListByService", resp, "Failure sending request") + return + } + + result, err = client.ListByServiceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.NetworkStatusClient", "ListByService", resp, "Failure responding to request") + } + + return +} + +// ListByServicePreparer prepares the ListByService request. +func (client NetworkStatusClient) ListByServicePreparer(ctx context.Context, resourceGroupName string, serviceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/networkstatus", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByServiceSender sends the ListByService request. The method will close the +// http.Response Body if it receives an error. +func (client NetworkStatusClient) ListByServiceSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByServiceResponder handles the response to the ListByService request. The method always +// closes the http.Response Body. +func (client NetworkStatusClient) ListByServiceResponder(resp *http.Response) (result ListNetworkStatusContractByLocation, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/notification.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/notification.go new file mode 100644 index 000000000..61c347f32 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/notification.go @@ -0,0 +1,317 @@ +package apimanagement + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// NotificationClient is the apiManagement Client +type NotificationClient struct { + BaseClient +} + +// NewNotificationClient creates an instance of the NotificationClient client. +func NewNotificationClient(subscriptionID string) NotificationClient { + return NewNotificationClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewNotificationClientWithBaseURI creates an instance of the NotificationClient client. +func NewNotificationClientWithBaseURI(baseURI string, subscriptionID string) NotificationClient { + return NotificationClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate updates an Notification. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// notificationName - notification Name Identifier. +// ifMatch - eTag of the Entity. Not required when creating an entity, but required when updating an entity. +func (client NotificationClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, notificationName NotificationName, ifMatch string) (result NotificationContract, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.NotificationClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serviceName, notificationName, ifMatch) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.NotificationClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.NotificationClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.NotificationClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client NotificationClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, notificationName NotificationName, ifMatch string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "notificationName": autorest.Encode("path", notificationName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/notifications/{notificationName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if len(ifMatch) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client NotificationClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client NotificationClient) CreateOrUpdateResponder(resp *http.Response) (result NotificationContract, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get gets the details of the Notification specified by its identifier. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// notificationName - notification Name Identifier. +func (client NotificationClient) Get(ctx context.Context, resourceGroupName string, serviceName string, notificationName NotificationName) (result NotificationContract, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.NotificationClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, serviceName, notificationName) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.NotificationClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.NotificationClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.NotificationClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client NotificationClient) GetPreparer(ctx context.Context, resourceGroupName string, serviceName string, notificationName NotificationName) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "notificationName": autorest.Encode("path", notificationName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/notifications/{notificationName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client NotificationClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client NotificationClient) GetResponder(resp *http.Response) (result NotificationContract, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByService lists a collection of properties defined within a service instance. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// top - number of records to return. +// skip - number of records to skip. +func (client NotificationClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, top *int32, skip *int32) (result NotificationCollectionPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: top, + Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}}}, + {TargetValue: skip, + Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("apimanagement.NotificationClient", "ListByService", err.Error()) + } + + result.fn = client.listByServiceNextResults + req, err := client.ListByServicePreparer(ctx, resourceGroupName, serviceName, top, skip) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.NotificationClient", "ListByService", nil, "Failure preparing request") + return + } + + resp, err := client.ListByServiceSender(req) + if err != nil { + result.nc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.NotificationClient", "ListByService", resp, "Failure sending request") + return + } + + result.nc, err = client.ListByServiceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.NotificationClient", "ListByService", resp, "Failure responding to request") + } + + return +} + +// ListByServicePreparer prepares the ListByService request. +func (client NotificationClient) ListByServicePreparer(ctx context.Context, resourceGroupName string, serviceName string, top *int32, skip *int32) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + if skip != nil { + queryParameters["$skip"] = autorest.Encode("query", *skip) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/notifications", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByServiceSender sends the ListByService request. The method will close the +// http.Response Body if it receives an error. +func (client NotificationClient) ListByServiceSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByServiceResponder handles the response to the ListByService request. The method always +// closes the http.Response Body. +func (client NotificationClient) ListByServiceResponder(resp *http.Response) (result NotificationCollection, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByServiceNextResults retrieves the next set of results, if any. +func (client NotificationClient) listByServiceNextResults(lastResults NotificationCollection) (result NotificationCollection, err error) { + req, err := lastResults.notificationCollectionPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "apimanagement.NotificationClient", "listByServiceNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByServiceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "apimanagement.NotificationClient", "listByServiceNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByServiceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.NotificationClient", "listByServiceNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByServiceComplete enumerates all values, automatically crossing page boundaries as required. +func (client NotificationClient) ListByServiceComplete(ctx context.Context, resourceGroupName string, serviceName string, top *int32, skip *int32) (result NotificationCollectionIterator, err error) { + result.page, err = client.ListByService(ctx, resourceGroupName, serviceName, top, skip) + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/notificationrecipientemail.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/notificationrecipientemail.go new file mode 100644 index 000000000..79dc89378 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/notificationrecipientemail.go @@ -0,0 +1,353 @@ +package apimanagement + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// NotificationRecipientEmailClient is the apiManagement Client +type NotificationRecipientEmailClient struct { + BaseClient +} + +// NewNotificationRecipientEmailClient creates an instance of the NotificationRecipientEmailClient client. +func NewNotificationRecipientEmailClient(subscriptionID string) NotificationRecipientEmailClient { + return NewNotificationRecipientEmailClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewNotificationRecipientEmailClientWithBaseURI creates an instance of the NotificationRecipientEmailClient client. +func NewNotificationRecipientEmailClientWithBaseURI(baseURI string, subscriptionID string) NotificationRecipientEmailClient { + return NotificationRecipientEmailClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CheckEntityExists determine if Notification Recipient Email subscribed to the notification. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// notificationName - notification Name Identifier. +// email - email identifier. +func (client NotificationRecipientEmailClient) CheckEntityExists(ctx context.Context, resourceGroupName string, serviceName string, notificationName NotificationName, email string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.NotificationRecipientEmailClient", "CheckEntityExists", err.Error()) + } + + req, err := client.CheckEntityExistsPreparer(ctx, resourceGroupName, serviceName, notificationName, email) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.NotificationRecipientEmailClient", "CheckEntityExists", nil, "Failure preparing request") + return + } + + resp, err := client.CheckEntityExistsSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.NotificationRecipientEmailClient", "CheckEntityExists", resp, "Failure sending request") + return + } + + result, err = client.CheckEntityExistsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.NotificationRecipientEmailClient", "CheckEntityExists", resp, "Failure responding to request") + } + + return +} + +// CheckEntityExistsPreparer prepares the CheckEntityExists request. +func (client NotificationRecipientEmailClient) CheckEntityExistsPreparer(ctx context.Context, resourceGroupName string, serviceName string, notificationName NotificationName, email string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "email": autorest.Encode("path", email), + "notificationName": autorest.Encode("path", notificationName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsHead(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/notifications/{notificationName}/recipientEmails/{email}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CheckEntityExistsSender sends the CheckEntityExists request. The method will close the +// http.Response Body if it receives an error. +func (client NotificationRecipientEmailClient) CheckEntityExistsSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// CheckEntityExistsResponder handles the response to the CheckEntityExists request. The method always +// closes the http.Response Body. +func (client NotificationRecipientEmailClient) CheckEntityExistsResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent, http.StatusNotFound), + autorest.ByClosing()) + result.Response = resp + return +} + +// CreateOrUpdate adds the Email address to the list of Recipients for the Notification. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// notificationName - notification Name Identifier. +// email - email identifier. +func (client NotificationRecipientEmailClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, notificationName NotificationName, email string) (result RecipientEmailContract, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.NotificationRecipientEmailClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serviceName, notificationName, email) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.NotificationRecipientEmailClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.NotificationRecipientEmailClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.NotificationRecipientEmailClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client NotificationRecipientEmailClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, notificationName NotificationName, email string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "email": autorest.Encode("path", email), + "notificationName": autorest.Encode("path", notificationName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/notifications/{notificationName}/recipientEmails/{email}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client NotificationRecipientEmailClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client NotificationRecipientEmailClient) CreateOrUpdateResponder(resp *http.Response) (result RecipientEmailContract, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete removes the email from the list of Notification. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// notificationName - notification Name Identifier. +// email - email identifier. +func (client NotificationRecipientEmailClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, notificationName NotificationName, email string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.NotificationRecipientEmailClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, serviceName, notificationName, email) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.NotificationRecipientEmailClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.NotificationRecipientEmailClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.NotificationRecipientEmailClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client NotificationRecipientEmailClient) DeletePreparer(ctx context.Context, resourceGroupName string, serviceName string, notificationName NotificationName, email string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "email": autorest.Encode("path", email), + "notificationName": autorest.Encode("path", notificationName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/notifications/{notificationName}/recipientEmails/{email}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client NotificationRecipientEmailClient) DeleteSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client NotificationRecipientEmailClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// ListByNotification gets the list of the Notification Recipient Emails subscribed to a notification. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// notificationName - notification Name Identifier. +func (client NotificationRecipientEmailClient) ListByNotification(ctx context.Context, resourceGroupName string, serviceName string, notificationName NotificationName) (result RecipientEmailCollection, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.NotificationRecipientEmailClient", "ListByNotification", err.Error()) + } + + req, err := client.ListByNotificationPreparer(ctx, resourceGroupName, serviceName, notificationName) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.NotificationRecipientEmailClient", "ListByNotification", nil, "Failure preparing request") + return + } + + resp, err := client.ListByNotificationSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.NotificationRecipientEmailClient", "ListByNotification", resp, "Failure sending request") + return + } + + result, err = client.ListByNotificationResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.NotificationRecipientEmailClient", "ListByNotification", resp, "Failure responding to request") + } + + return +} + +// ListByNotificationPreparer prepares the ListByNotification request. +func (client NotificationRecipientEmailClient) ListByNotificationPreparer(ctx context.Context, resourceGroupName string, serviceName string, notificationName NotificationName) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "notificationName": autorest.Encode("path", notificationName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/notifications/{notificationName}/recipientEmails", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByNotificationSender sends the ListByNotification request. The method will close the +// http.Response Body if it receives an error. +func (client NotificationRecipientEmailClient) ListByNotificationSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByNotificationResponder handles the response to the ListByNotification request. The method always +// closes the http.Response Body. +func (client NotificationRecipientEmailClient) ListByNotificationResponder(resp *http.Response) (result RecipientEmailCollection, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/notificationrecipientuser.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/notificationrecipientuser.go new file mode 100644 index 000000000..10a381906 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/notificationrecipientuser.go @@ -0,0 +1,365 @@ +package apimanagement + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// NotificationRecipientUserClient is the apiManagement Client +type NotificationRecipientUserClient struct { + BaseClient +} + +// NewNotificationRecipientUserClient creates an instance of the NotificationRecipientUserClient client. +func NewNotificationRecipientUserClient(subscriptionID string) NotificationRecipientUserClient { + return NewNotificationRecipientUserClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewNotificationRecipientUserClientWithBaseURI creates an instance of the NotificationRecipientUserClient client. +func NewNotificationRecipientUserClientWithBaseURI(baseURI string, subscriptionID string) NotificationRecipientUserClient { + return NotificationRecipientUserClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CheckEntityExists determine if the Notification Recipient User is subscribed to the notification. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// notificationName - notification Name Identifier. +// UID - user identifier. Must be unique in the current API Management service instance. +func (client NotificationRecipientUserClient) CheckEntityExists(ctx context.Context, resourceGroupName string, serviceName string, notificationName NotificationName, UID string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: UID, + Constraints: []validation.Constraint{{Target: "UID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "UID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "UID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.NotificationRecipientUserClient", "CheckEntityExists", err.Error()) + } + + req, err := client.CheckEntityExistsPreparer(ctx, resourceGroupName, serviceName, notificationName, UID) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.NotificationRecipientUserClient", "CheckEntityExists", nil, "Failure preparing request") + return + } + + resp, err := client.CheckEntityExistsSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.NotificationRecipientUserClient", "CheckEntityExists", resp, "Failure sending request") + return + } + + result, err = client.CheckEntityExistsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.NotificationRecipientUserClient", "CheckEntityExists", resp, "Failure responding to request") + } + + return +} + +// CheckEntityExistsPreparer prepares the CheckEntityExists request. +func (client NotificationRecipientUserClient) CheckEntityExistsPreparer(ctx context.Context, resourceGroupName string, serviceName string, notificationName NotificationName, UID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "notificationName": autorest.Encode("path", notificationName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "uid": autorest.Encode("path", UID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsHead(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/notifications/{notificationName}/recipientUsers/{uid}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CheckEntityExistsSender sends the CheckEntityExists request. The method will close the +// http.Response Body if it receives an error. +func (client NotificationRecipientUserClient) CheckEntityExistsSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// CheckEntityExistsResponder handles the response to the CheckEntityExists request. The method always +// closes the http.Response Body. +func (client NotificationRecipientUserClient) CheckEntityExistsResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent, http.StatusNotFound), + autorest.ByClosing()) + result.Response = resp + return +} + +// CreateOrUpdate adds the API Management User to the list of Recipients for the Notification. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// notificationName - notification Name Identifier. +// UID - user identifier. Must be unique in the current API Management service instance. +func (client NotificationRecipientUserClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, notificationName NotificationName, UID string) (result RecipientUserContract, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: UID, + Constraints: []validation.Constraint{{Target: "UID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "UID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "UID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.NotificationRecipientUserClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serviceName, notificationName, UID) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.NotificationRecipientUserClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.NotificationRecipientUserClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.NotificationRecipientUserClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client NotificationRecipientUserClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, notificationName NotificationName, UID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "notificationName": autorest.Encode("path", notificationName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "uid": autorest.Encode("path", UID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/notifications/{notificationName}/recipientUsers/{uid}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client NotificationRecipientUserClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client NotificationRecipientUserClient) CreateOrUpdateResponder(resp *http.Response) (result RecipientUserContract, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete removes the API Management user from the list of Notification. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// notificationName - notification Name Identifier. +// UID - user identifier. Must be unique in the current API Management service instance. +func (client NotificationRecipientUserClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, notificationName NotificationName, UID string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: UID, + Constraints: []validation.Constraint{{Target: "UID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "UID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "UID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.NotificationRecipientUserClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, serviceName, notificationName, UID) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.NotificationRecipientUserClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.NotificationRecipientUserClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.NotificationRecipientUserClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client NotificationRecipientUserClient) DeletePreparer(ctx context.Context, resourceGroupName string, serviceName string, notificationName NotificationName, UID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "notificationName": autorest.Encode("path", notificationName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "uid": autorest.Encode("path", UID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/notifications/{notificationName}/recipientUsers/{uid}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client NotificationRecipientUserClient) DeleteSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client NotificationRecipientUserClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// ListByNotification gets the list of the Notification Recipient User subscribed to the notification. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// notificationName - notification Name Identifier. +func (client NotificationRecipientUserClient) ListByNotification(ctx context.Context, resourceGroupName string, serviceName string, notificationName NotificationName) (result RecipientUserCollection, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.NotificationRecipientUserClient", "ListByNotification", err.Error()) + } + + req, err := client.ListByNotificationPreparer(ctx, resourceGroupName, serviceName, notificationName) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.NotificationRecipientUserClient", "ListByNotification", nil, "Failure preparing request") + return + } + + resp, err := client.ListByNotificationSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.NotificationRecipientUserClient", "ListByNotification", resp, "Failure sending request") + return + } + + result, err = client.ListByNotificationResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.NotificationRecipientUserClient", "ListByNotification", resp, "Failure responding to request") + } + + return +} + +// ListByNotificationPreparer prepares the ListByNotification request. +func (client NotificationRecipientUserClient) ListByNotificationPreparer(ctx context.Context, resourceGroupName string, serviceName string, notificationName NotificationName) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "notificationName": autorest.Encode("path", notificationName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/notifications/{notificationName}/recipientUsers", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByNotificationSender sends the ListByNotification request. The method will close the +// http.Response Body if it receives an error. +func (client NotificationRecipientUserClient) ListByNotificationSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByNotificationResponder handles the response to the ListByNotification request. The method always +// closes the http.Response Body. +func (client NotificationRecipientUserClient) ListByNotificationResponder(resp *http.Response) (result RecipientUserCollection, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/openidconnectprovider.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/openidconnectprovider.go new file mode 100644 index 000000000..ba48ba87d --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/openidconnectprovider.go @@ -0,0 +1,586 @@ +package apimanagement + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// OpenIDConnectProviderClient is the apiManagement Client +type OpenIDConnectProviderClient struct { + BaseClient +} + +// NewOpenIDConnectProviderClient creates an instance of the OpenIDConnectProviderClient client. +func NewOpenIDConnectProviderClient(subscriptionID string) OpenIDConnectProviderClient { + return NewOpenIDConnectProviderClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewOpenIDConnectProviderClientWithBaseURI creates an instance of the OpenIDConnectProviderClient client. +func NewOpenIDConnectProviderClientWithBaseURI(baseURI string, subscriptionID string) OpenIDConnectProviderClient { + return OpenIDConnectProviderClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or updates the OpenID Connect Provider. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// opid - identifier of the OpenID Connect Provider. +// parameters - create parameters. +// ifMatch - eTag of the Entity. Not required when creating an entity, but required when updating an entity. +func (client OpenIDConnectProviderClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, opid string, parameters OpenidConnectProviderContract, ifMatch string) (result OpenidConnectProviderContract, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: opid, + Constraints: []validation.Constraint{{Target: "opid", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "opid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.OpenidConnectProviderContractProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.OpenidConnectProviderContractProperties.DisplayName", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.OpenidConnectProviderContractProperties.DisplayName", Name: validation.MaxLength, Rule: 50, Chain: nil}}}, + {Target: "parameters.OpenidConnectProviderContractProperties.MetadataEndpoint", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.OpenidConnectProviderContractProperties.ClientID", Name: validation.Null, Rule: true, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("apimanagement.OpenIDConnectProviderClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serviceName, opid, parameters, ifMatch) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.OpenIDConnectProviderClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.OpenIDConnectProviderClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.OpenIDConnectProviderClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client OpenIDConnectProviderClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, opid string, parameters OpenidConnectProviderContract, ifMatch string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "opid": autorest.Encode("path", opid), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/openidConnectProviders/{opid}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + if len(ifMatch) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client OpenIDConnectProviderClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client OpenIDConnectProviderClient) CreateOrUpdateResponder(resp *http.Response) (result OpenidConnectProviderContract, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes specific OpenID Connect Provider of the API Management service instance. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// opid - identifier of the OpenID Connect Provider. +// ifMatch - eTag of the Entity. ETag should match the current entity state from the header response of the GET +// request or it should be * for unconditional update. +func (client OpenIDConnectProviderClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, opid string, ifMatch string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: opid, + Constraints: []validation.Constraint{{Target: "opid", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "opid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.OpenIDConnectProviderClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, serviceName, opid, ifMatch) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.OpenIDConnectProviderClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.OpenIDConnectProviderClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.OpenIDConnectProviderClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client OpenIDConnectProviderClient) DeletePreparer(ctx context.Context, resourceGroupName string, serviceName string, opid string, ifMatch string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "opid": autorest.Encode("path", opid), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/openidConnectProviders/{opid}", pathParameters), + autorest.WithQueryParameters(queryParameters), + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client OpenIDConnectProviderClient) DeleteSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client OpenIDConnectProviderClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets specific OpenID Connect Provider. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// opid - identifier of the OpenID Connect Provider. +func (client OpenIDConnectProviderClient) Get(ctx context.Context, resourceGroupName string, serviceName string, opid string) (result OpenidConnectProviderContract, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: opid, + Constraints: []validation.Constraint{{Target: "opid", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "opid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.OpenIDConnectProviderClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, serviceName, opid) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.OpenIDConnectProviderClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.OpenIDConnectProviderClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.OpenIDConnectProviderClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client OpenIDConnectProviderClient) GetPreparer(ctx context.Context, resourceGroupName string, serviceName string, opid string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "opid": autorest.Encode("path", opid), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/openidConnectProviders/{opid}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client OpenIDConnectProviderClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client OpenIDConnectProviderClient) GetResponder(resp *http.Response) (result OpenidConnectProviderContract, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetEntityTag gets the entity state (Etag) version of the openIdConnectProvider specified by its identifier. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// opid - identifier of the OpenID Connect Provider. +func (client OpenIDConnectProviderClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, opid string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: opid, + Constraints: []validation.Constraint{{Target: "opid", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "opid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.OpenIDConnectProviderClient", "GetEntityTag", err.Error()) + } + + req, err := client.GetEntityTagPreparer(ctx, resourceGroupName, serviceName, opid) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.OpenIDConnectProviderClient", "GetEntityTag", nil, "Failure preparing request") + return + } + + resp, err := client.GetEntityTagSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.OpenIDConnectProviderClient", "GetEntityTag", resp, "Failure sending request") + return + } + + result, err = client.GetEntityTagResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.OpenIDConnectProviderClient", "GetEntityTag", resp, "Failure responding to request") + } + + return +} + +// GetEntityTagPreparer prepares the GetEntityTag request. +func (client OpenIDConnectProviderClient) GetEntityTagPreparer(ctx context.Context, resourceGroupName string, serviceName string, opid string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "opid": autorest.Encode("path", opid), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsHead(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/openidConnectProviders/{opid}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetEntityTagSender sends the GetEntityTag request. The method will close the +// http.Response Body if it receives an error. +func (client OpenIDConnectProviderClient) GetEntityTagSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetEntityTagResponder handles the response to the GetEntityTag request. The method always +// closes the http.Response Body. +func (client OpenIDConnectProviderClient) GetEntityTagResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// ListByService lists all OpenID Connect Providers. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// filter - | Field | Supported operators | Supported functions | +// |-------|------------------------|---------------------------------------------| +// | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// top - number of records to return. +// skip - number of records to skip. +func (client OpenIDConnectProviderClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (result OpenIDConnectProviderCollectionPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: top, + Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}}}, + {TargetValue: skip, + Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("apimanagement.OpenIDConnectProviderClient", "ListByService", err.Error()) + } + + result.fn = client.listByServiceNextResults + req, err := client.ListByServicePreparer(ctx, resourceGroupName, serviceName, filter, top, skip) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.OpenIDConnectProviderClient", "ListByService", nil, "Failure preparing request") + return + } + + resp, err := client.ListByServiceSender(req) + if err != nil { + result.oicpc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.OpenIDConnectProviderClient", "ListByService", resp, "Failure sending request") + return + } + + result.oicpc, err = client.ListByServiceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.OpenIDConnectProviderClient", "ListByService", resp, "Failure responding to request") + } + + return +} + +// ListByServicePreparer prepares the ListByService request. +func (client OpenIDConnectProviderClient) ListByServicePreparer(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + if skip != nil { + queryParameters["$skip"] = autorest.Encode("query", *skip) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/openidConnectProviders", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByServiceSender sends the ListByService request. The method will close the +// http.Response Body if it receives an error. +func (client OpenIDConnectProviderClient) ListByServiceSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByServiceResponder handles the response to the ListByService request. The method always +// closes the http.Response Body. +func (client OpenIDConnectProviderClient) ListByServiceResponder(resp *http.Response) (result OpenIDConnectProviderCollection, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByServiceNextResults retrieves the next set of results, if any. +func (client OpenIDConnectProviderClient) listByServiceNextResults(lastResults OpenIDConnectProviderCollection) (result OpenIDConnectProviderCollection, err error) { + req, err := lastResults.openIDConnectProviderCollectionPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "apimanagement.OpenIDConnectProviderClient", "listByServiceNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByServiceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "apimanagement.OpenIDConnectProviderClient", "listByServiceNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByServiceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.OpenIDConnectProviderClient", "listByServiceNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByServiceComplete enumerates all values, automatically crossing page boundaries as required. +func (client OpenIDConnectProviderClient) ListByServiceComplete(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (result OpenIDConnectProviderCollectionIterator, err error) { + result.page, err = client.ListByService(ctx, resourceGroupName, serviceName, filter, top, skip) + return +} + +// Update updates the specific OpenID Connect Provider. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// opid - identifier of the OpenID Connect Provider. +// parameters - update parameters. +// ifMatch - eTag of the Entity. ETag should match the current entity state from the header response of the GET +// request or it should be * for unconditional update. +func (client OpenIDConnectProviderClient) Update(ctx context.Context, resourceGroupName string, serviceName string, opid string, parameters OpenidConnectProviderUpdateContract, ifMatch string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: opid, + Constraints: []validation.Constraint{{Target: "opid", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "opid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.OpenIDConnectProviderClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, serviceName, opid, parameters, ifMatch) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.OpenIDConnectProviderClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.OpenIDConnectProviderClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.OpenIDConnectProviderClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client OpenIDConnectProviderClient) UpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, opid string, parameters OpenidConnectProviderUpdateContract, ifMatch string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "opid": autorest.Encode("path", opid), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/openidConnectProviders/{opid}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters), + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client OpenIDConnectProviderClient) UpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client OpenIDConnectProviderClient) UpdateResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/operation.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/operation.go new file mode 100644 index 000000000..9d066c25f --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/operation.go @@ -0,0 +1,176 @@ +package apimanagement + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// OperationClient is the apiManagement Client +type OperationClient struct { + BaseClient +} + +// NewOperationClient creates an instance of the OperationClient client. +func NewOperationClient(subscriptionID string) OperationClient { + return NewOperationClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewOperationClientWithBaseURI creates an instance of the OperationClient client. +func NewOperationClientWithBaseURI(baseURI string, subscriptionID string) OperationClient { + return OperationClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// ListByTags lists a collection of operations associated with tags. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// apiid - API revision identifier. Must be unique in the current API Management service instance. Non-current +// revision has ;rev=n as a suffix where n is the revision number. +// filter - | Field | Supported operators | Supported functions | +// |-------------|------------------------|---------------------------------------------| +// | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// | apiName | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// | description | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// | method | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// | urlTemplate | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// top - number of records to return. +// skip - number of records to skip. +func (client OperationClient) ListByTags(ctx context.Context, resourceGroupName string, serviceName string, apiid string, filter string, top *int32, skip *int32) (result TagResourceCollectionPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: apiid, + Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "apiid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}, + {TargetValue: top, + Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}}}, + {TargetValue: skip, + Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("apimanagement.OperationClient", "ListByTags", err.Error()) + } + + result.fn = client.listByTagsNextResults + req, err := client.ListByTagsPreparer(ctx, resourceGroupName, serviceName, apiid, filter, top, skip) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.OperationClient", "ListByTags", nil, "Failure preparing request") + return + } + + resp, err := client.ListByTagsSender(req) + if err != nil { + result.trc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.OperationClient", "ListByTags", resp, "Failure sending request") + return + } + + result.trc, err = client.ListByTagsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.OperationClient", "ListByTags", resp, "Failure responding to request") + } + + return +} + +// ListByTagsPreparer prepares the ListByTags request. +func (client OperationClient) ListByTagsPreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, filter string, top *int32, skip *int32) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "apiId": autorest.Encode("path", apiid), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + if skip != nil { + queryParameters["$skip"] = autorest.Encode("query", *skip) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operationsByTags", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByTagsSender sends the ListByTags request. The method will close the +// http.Response Body if it receives an error. +func (client OperationClient) ListByTagsSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByTagsResponder handles the response to the ListByTags request. The method always +// closes the http.Response Body. +func (client OperationClient) ListByTagsResponder(resp *http.Response) (result TagResourceCollection, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByTagsNextResults retrieves the next set of results, if any. +func (client OperationClient) listByTagsNextResults(lastResults TagResourceCollection) (result TagResourceCollection, err error) { + req, err := lastResults.tagResourceCollectionPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "apimanagement.OperationClient", "listByTagsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByTagsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "apimanagement.OperationClient", "listByTagsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByTagsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.OperationClient", "listByTagsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByTagsComplete enumerates all values, automatically crossing page boundaries as required. +func (client OperationClient) ListByTagsComplete(ctx context.Context, resourceGroupName string, serviceName string, apiid string, filter string, top *int32, skip *int32) (result TagResourceCollectionIterator, err error) { + result.page, err = client.ListByTags(ctx, resourceGroupName, serviceName, apiid, filter, top, skip) + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/operations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/operations.go new file mode 100644 index 000000000..036c3ce11 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/operations.go @@ -0,0 +1,126 @@ +package apimanagement + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "net/http" +) + +// OperationsClient is the apiManagement Client +type OperationsClient struct { + BaseClient +} + +// NewOperationsClient creates an instance of the OperationsClient client. +func NewOperationsClient(subscriptionID string) OperationsClient { + return NewOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewOperationsClientWithBaseURI creates an instance of the OperationsClient client. +func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient { + return OperationsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// List lists all of the available REST API operations of the Microsoft.ApiManagement provider. +func (client OperationsClient) List(ctx context.Context) (result OperationListResultPage, err error) { + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.OperationsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.olr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.OperationsClient", "List", resp, "Failure sending request") + return + } + + result.olr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.OperationsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/providers/Microsoft.ApiManagement/operations"), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client OperationsClient) ListSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client OperationsClient) ListResponder(resp *http.Response) (result OperationListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client OperationsClient) listNextResults(lastResults OperationListResult) (result OperationListResult, err error) { + req, err := lastResults.operationListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "apimanagement.OperationsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "apimanagement.OperationsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.OperationsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client OperationsClient) ListComplete(ctx context.Context) (result OperationListResultIterator, err error) { + result.page, err = client.List(ctx) + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/policy.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/policy.go new file mode 100644 index 000000000..70f6acdf3 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/policy.go @@ -0,0 +1,431 @@ +package apimanagement + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// PolicyClient is the apiManagement Client +type PolicyClient struct { + BaseClient +} + +// NewPolicyClient creates an instance of the PolicyClient client. +func NewPolicyClient(subscriptionID string) PolicyClient { + return NewPolicyClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewPolicyClientWithBaseURI creates an instance of the PolicyClient client. +func NewPolicyClientWithBaseURI(baseURI string, subscriptionID string) PolicyClient { + return PolicyClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or updates the global policy configuration of the Api Management service. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// parameters - the policy contents to apply. +func (client PolicyClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, parameters PolicyContract) (result PolicyContract, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.PolicyContractProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.PolicyContractProperties.PolicyContent", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("apimanagement.PolicyClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serviceName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.PolicyClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.PolicyClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.PolicyClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client PolicyClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, parameters PolicyContract) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "policyId": autorest.Encode("path", "policy"), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/policies/{policyId}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client PolicyClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client PolicyClient) CreateOrUpdateResponder(resp *http.Response) (result PolicyContract, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes the global policy configuration of the Api Management Service. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// ifMatch - eTag of the Entity. ETag should match the current entity state from the header response of the GET +// request or it should be * for unconditional update. +func (client PolicyClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, ifMatch string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.PolicyClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, serviceName, ifMatch) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.PolicyClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.PolicyClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.PolicyClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client PolicyClient) DeletePreparer(ctx context.Context, resourceGroupName string, serviceName string, ifMatch string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "policyId": autorest.Encode("path", "policy"), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/policies/{policyId}", pathParameters), + autorest.WithQueryParameters(queryParameters), + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client PolicyClient) DeleteSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client PolicyClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get get the Global policy definition of the Api Management service. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +func (client PolicyClient) Get(ctx context.Context, resourceGroupName string, serviceName string) (result PolicyContract, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.PolicyClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, serviceName) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.PolicyClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.PolicyClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.PolicyClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client PolicyClient) GetPreparer(ctx context.Context, resourceGroupName string, serviceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "policyId": autorest.Encode("path", "policy"), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/policies/{policyId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client PolicyClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client PolicyClient) GetResponder(resp *http.Response) (result PolicyContract, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetEntityTag gets the entity state (Etag) version of the Global policy definition in the Api Management service. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +func (client PolicyClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.PolicyClient", "GetEntityTag", err.Error()) + } + + req, err := client.GetEntityTagPreparer(ctx, resourceGroupName, serviceName) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.PolicyClient", "GetEntityTag", nil, "Failure preparing request") + return + } + + resp, err := client.GetEntityTagSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.PolicyClient", "GetEntityTag", resp, "Failure sending request") + return + } + + result, err = client.GetEntityTagResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.PolicyClient", "GetEntityTag", resp, "Failure responding to request") + } + + return +} + +// GetEntityTagPreparer prepares the GetEntityTag request. +func (client PolicyClient) GetEntityTagPreparer(ctx context.Context, resourceGroupName string, serviceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "policyId": autorest.Encode("path", "policy"), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsHead(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/policies/{policyId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetEntityTagSender sends the GetEntityTag request. The method will close the +// http.Response Body if it receives an error. +func (client PolicyClient) GetEntityTagSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetEntityTagResponder handles the response to the GetEntityTag request. The method always +// closes the http.Response Body. +func (client PolicyClient) GetEntityTagResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// ListByService lists all the Global Policy definitions of the Api Management service. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// scope - policy scope. +func (client PolicyClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, scope PolicyScopeContract) (result PolicyCollection, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.PolicyClient", "ListByService", err.Error()) + } + + req, err := client.ListByServicePreparer(ctx, resourceGroupName, serviceName, scope) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.PolicyClient", "ListByService", nil, "Failure preparing request") + return + } + + resp, err := client.ListByServiceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.PolicyClient", "ListByService", resp, "Failure sending request") + return + } + + result, err = client.ListByServiceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.PolicyClient", "ListByService", resp, "Failure responding to request") + } + + return +} + +// ListByServicePreparer prepares the ListByService request. +func (client PolicyClient) ListByServicePreparer(ctx context.Context, resourceGroupName string, serviceName string, scope PolicyScopeContract) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(string(scope)) > 0 { + queryParameters["scope"] = autorest.Encode("query", scope) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/policies", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByServiceSender sends the ListByService request. The method will close the +// http.Response Body if it receives an error. +func (client PolicyClient) ListByServiceSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByServiceResponder handles the response to the ListByService request. The method always +// closes the http.Response Body. +func (client PolicyClient) ListByServiceResponder(resp *http.Response) (result PolicyCollection, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/policysnippets.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/policysnippets.go new file mode 100644 index 000000000..5737d5ba8 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/policysnippets.go @@ -0,0 +1,120 @@ +package apimanagement + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// PolicySnippetsClient is the apiManagement Client +type PolicySnippetsClient struct { + BaseClient +} + +// NewPolicySnippetsClient creates an instance of the PolicySnippetsClient client. +func NewPolicySnippetsClient(subscriptionID string) PolicySnippetsClient { + return NewPolicySnippetsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewPolicySnippetsClientWithBaseURI creates an instance of the PolicySnippetsClient client. +func NewPolicySnippetsClientWithBaseURI(baseURI string, subscriptionID string) PolicySnippetsClient { + return PolicySnippetsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// ListByService lists all policy snippets. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// scope - policy scope. +func (client PolicySnippetsClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, scope PolicyScopeContract) (result PolicySnippetsCollection, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.PolicySnippetsClient", "ListByService", err.Error()) + } + + req, err := client.ListByServicePreparer(ctx, resourceGroupName, serviceName, scope) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.PolicySnippetsClient", "ListByService", nil, "Failure preparing request") + return + } + + resp, err := client.ListByServiceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.PolicySnippetsClient", "ListByService", resp, "Failure sending request") + return + } + + result, err = client.ListByServiceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.PolicySnippetsClient", "ListByService", resp, "Failure responding to request") + } + + return +} + +// ListByServicePreparer prepares the ListByService request. +func (client PolicySnippetsClient) ListByServicePreparer(ctx context.Context, resourceGroupName string, serviceName string, scope PolicyScopeContract) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(string(scope)) > 0 { + queryParameters["scope"] = autorest.Encode("query", scope) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/policySnippets", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByServiceSender sends the ListByService request. The method will close the +// http.Response Body if it receives an error. +func (client PolicySnippetsClient) ListByServiceSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByServiceResponder handles the response to the ListByService request. The method always +// closes the http.Response Body. +func (client PolicySnippetsClient) ListByServiceResponder(resp *http.Response) (result PolicySnippetsCollection, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/product.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/product.go new file mode 100644 index 000000000..92a3ea46f --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/product.go @@ -0,0 +1,603 @@ +package apimanagement + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// ProductClient is the apiManagement Client +type ProductClient struct { + BaseClient +} + +// NewProductClient creates an instance of the ProductClient client. +func NewProductClient(subscriptionID string) ProductClient { + return NewProductClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewProductClientWithBaseURI creates an instance of the ProductClient client. +func NewProductClientWithBaseURI(baseURI string, subscriptionID string) ProductClient { + return ProductClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or Updates a product. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// productID - product identifier. Must be unique in the current API Management service instance. +// parameters - create or update parameters. +// ifMatch - eTag of the Entity. Not required when creating an entity, but required when updating an entity. +func (client ProductClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, productID string, parameters ProductContract, ifMatch string) (result ProductContract, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: productID, + Constraints: []validation.Constraint{{Target: "productID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "productID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "productID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.ProductContractProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ProductContractProperties.DisplayName", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.ProductContractProperties.DisplayName", Name: validation.MaxLength, Rule: 300, Chain: nil}, + {Target: "parameters.ProductContractProperties.DisplayName", Name: validation.MinLength, Rule: 1, Chain: nil}, + }}, + }}}}}); err != nil { + return result, validation.NewError("apimanagement.ProductClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serviceName, productID, parameters, ifMatch) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.ProductClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.ProductClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.ProductClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client ProductClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, productID string, parameters ProductContract, ifMatch string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "productId": autorest.Encode("path", productID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + if len(ifMatch) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client ProductClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client ProductClient) CreateOrUpdateResponder(resp *http.Response) (result ProductContract, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete delete product. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// productID - product identifier. Must be unique in the current API Management service instance. +// ifMatch - eTag of the Entity. ETag should match the current entity state from the header response of the GET +// request or it should be * for unconditional update. +// deleteSubscriptions - delete existing subscriptions associated with the product or not. +func (client ProductClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, productID string, ifMatch string, deleteSubscriptions *bool) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: productID, + Constraints: []validation.Constraint{{Target: "productID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "productID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "productID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.ProductClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, serviceName, productID, ifMatch, deleteSubscriptions) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.ProductClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.ProductClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.ProductClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ProductClient) DeletePreparer(ctx context.Context, resourceGroupName string, serviceName string, productID string, ifMatch string, deleteSubscriptions *bool) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "productId": autorest.Encode("path", productID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if deleteSubscriptions != nil { + queryParameters["deleteSubscriptions"] = autorest.Encode("query", *deleteSubscriptions) + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}", pathParameters), + autorest.WithQueryParameters(queryParameters), + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ProductClient) DeleteSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ProductClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the details of the product specified by its identifier. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// productID - product identifier. Must be unique in the current API Management service instance. +func (client ProductClient) Get(ctx context.Context, resourceGroupName string, serviceName string, productID string) (result ProductContract, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: productID, + Constraints: []validation.Constraint{{Target: "productID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "productID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "productID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.ProductClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, serviceName, productID) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.ProductClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.ProductClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.ProductClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client ProductClient) GetPreparer(ctx context.Context, resourceGroupName string, serviceName string, productID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "productId": autorest.Encode("path", productID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ProductClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ProductClient) GetResponder(resp *http.Response) (result ProductContract, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetEntityTag gets the entity state (Etag) version of the product specified by its identifier. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// productID - product identifier. Must be unique in the current API Management service instance. +func (client ProductClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, productID string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: productID, + Constraints: []validation.Constraint{{Target: "productID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "productID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "productID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.ProductClient", "GetEntityTag", err.Error()) + } + + req, err := client.GetEntityTagPreparer(ctx, resourceGroupName, serviceName, productID) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.ProductClient", "GetEntityTag", nil, "Failure preparing request") + return + } + + resp, err := client.GetEntityTagSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.ProductClient", "GetEntityTag", resp, "Failure sending request") + return + } + + result, err = client.GetEntityTagResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.ProductClient", "GetEntityTag", resp, "Failure responding to request") + } + + return +} + +// GetEntityTagPreparer prepares the GetEntityTag request. +func (client ProductClient) GetEntityTagPreparer(ctx context.Context, resourceGroupName string, serviceName string, productID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "productId": autorest.Encode("path", productID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsHead(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetEntityTagSender sends the GetEntityTag request. The method will close the +// http.Response Body if it receives an error. +func (client ProductClient) GetEntityTagSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetEntityTagResponder handles the response to the GetEntityTag request. The method always +// closes the http.Response Body. +func (client ProductClient) GetEntityTagResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// ListByService lists a collection of products in the specified service instance. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// filter - | Field | Supported operators | Supported functions | +// |-------------|------------------------|---------------------------------------------| +// | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// | description | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// | terms | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// | state | eq | | +// top - number of records to return. +// skip - number of records to skip. +// expandGroups - when set to true, the response contains an array of groups that have visibility to the +// product. The default is false. +func (client ProductClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32, expandGroups *bool) (result ProductCollectionPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: top, + Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}}}, + {TargetValue: skip, + Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("apimanagement.ProductClient", "ListByService", err.Error()) + } + + result.fn = client.listByServiceNextResults + req, err := client.ListByServicePreparer(ctx, resourceGroupName, serviceName, filter, top, skip, expandGroups) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.ProductClient", "ListByService", nil, "Failure preparing request") + return + } + + resp, err := client.ListByServiceSender(req) + if err != nil { + result.pc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.ProductClient", "ListByService", resp, "Failure sending request") + return + } + + result.pc, err = client.ListByServiceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.ProductClient", "ListByService", resp, "Failure responding to request") + } + + return +} + +// ListByServicePreparer prepares the ListByService request. +func (client ProductClient) ListByServicePreparer(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32, expandGroups *bool) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + if skip != nil { + queryParameters["$skip"] = autorest.Encode("query", *skip) + } + if expandGroups != nil { + queryParameters["expandGroups"] = autorest.Encode("query", *expandGroups) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByServiceSender sends the ListByService request. The method will close the +// http.Response Body if it receives an error. +func (client ProductClient) ListByServiceSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByServiceResponder handles the response to the ListByService request. The method always +// closes the http.Response Body. +func (client ProductClient) ListByServiceResponder(resp *http.Response) (result ProductCollection, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByServiceNextResults retrieves the next set of results, if any. +func (client ProductClient) listByServiceNextResults(lastResults ProductCollection) (result ProductCollection, err error) { + req, err := lastResults.productCollectionPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "apimanagement.ProductClient", "listByServiceNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByServiceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "apimanagement.ProductClient", "listByServiceNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByServiceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.ProductClient", "listByServiceNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByServiceComplete enumerates all values, automatically crossing page boundaries as required. +func (client ProductClient) ListByServiceComplete(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32, expandGroups *bool) (result ProductCollectionIterator, err error) { + result.page, err = client.ListByService(ctx, resourceGroupName, serviceName, filter, top, skip, expandGroups) + return +} + +// Update update product. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// productID - product identifier. Must be unique in the current API Management service instance. +// parameters - update parameters. +// ifMatch - eTag of the Entity. ETag should match the current entity state from the header response of the GET +// request or it should be * for unconditional update. +func (client ProductClient) Update(ctx context.Context, resourceGroupName string, serviceName string, productID string, parameters ProductUpdateParameters, ifMatch string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: productID, + Constraints: []validation.Constraint{{Target: "productID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "productID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "productID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.ProductClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, serviceName, productID, parameters, ifMatch) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.ProductClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.ProductClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.ProductClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client ProductClient) UpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, productID string, parameters ProductUpdateParameters, ifMatch string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "productId": autorest.Encode("path", productID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters), + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client ProductClient) UpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client ProductClient) UpdateResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/productapi.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/productapi.go new file mode 100644 index 000000000..3d3311579 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/productapi.go @@ -0,0 +1,436 @@ +package apimanagement + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// ProductAPIClient is the apiManagement Client +type ProductAPIClient struct { + BaseClient +} + +// NewProductAPIClient creates an instance of the ProductAPIClient client. +func NewProductAPIClient(subscriptionID string) ProductAPIClient { + return NewProductAPIClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewProductAPIClientWithBaseURI creates an instance of the ProductAPIClient client. +func NewProductAPIClientWithBaseURI(baseURI string, subscriptionID string) ProductAPIClient { + return ProductAPIClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CheckEntityExists checks that API entity specified by identifier is associated with the Product entity. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// productID - product identifier. Must be unique in the current API Management service instance. +// apiid - API revision identifier. Must be unique in the current API Management service instance. Non-current +// revision has ;rev=n as a suffix where n is the revision number. +func (client ProductAPIClient) CheckEntityExists(ctx context.Context, resourceGroupName string, serviceName string, productID string, apiid string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: productID, + Constraints: []validation.Constraint{{Target: "productID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "productID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "productID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {TargetValue: apiid, + Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "apiid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.ProductAPIClient", "CheckEntityExists", err.Error()) + } + + req, err := client.CheckEntityExistsPreparer(ctx, resourceGroupName, serviceName, productID, apiid) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.ProductAPIClient", "CheckEntityExists", nil, "Failure preparing request") + return + } + + resp, err := client.CheckEntityExistsSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.ProductAPIClient", "CheckEntityExists", resp, "Failure sending request") + return + } + + result, err = client.CheckEntityExistsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.ProductAPIClient", "CheckEntityExists", resp, "Failure responding to request") + } + + return +} + +// CheckEntityExistsPreparer prepares the CheckEntityExists request. +func (client ProductAPIClient) CheckEntityExistsPreparer(ctx context.Context, resourceGroupName string, serviceName string, productID string, apiid string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "apiId": autorest.Encode("path", apiid), + "productId": autorest.Encode("path", productID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsHead(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/apis/{apiId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CheckEntityExistsSender sends the CheckEntityExists request. The method will close the +// http.Response Body if it receives an error. +func (client ProductAPIClient) CheckEntityExistsSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// CheckEntityExistsResponder handles the response to the CheckEntityExists request. The method always +// closes the http.Response Body. +func (client ProductAPIClient) CheckEntityExistsResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent, http.StatusNotFound), + autorest.ByClosing()) + result.Response = resp + return +} + +// CreateOrUpdate adds an API to the specified product. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// productID - product identifier. Must be unique in the current API Management service instance. +// apiid - API revision identifier. Must be unique in the current API Management service instance. Non-current +// revision has ;rev=n as a suffix where n is the revision number. +func (client ProductAPIClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, productID string, apiid string) (result APIContract, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: productID, + Constraints: []validation.Constraint{{Target: "productID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "productID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "productID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {TargetValue: apiid, + Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "apiid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.ProductAPIClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serviceName, productID, apiid) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.ProductAPIClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.ProductAPIClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.ProductAPIClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client ProductAPIClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, productID string, apiid string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "apiId": autorest.Encode("path", apiid), + "productId": autorest.Encode("path", productID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/apis/{apiId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client ProductAPIClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client ProductAPIClient) CreateOrUpdateResponder(resp *http.Response) (result APIContract, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes the specified API from the specified product. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// productID - product identifier. Must be unique in the current API Management service instance. +// apiid - API revision identifier. Must be unique in the current API Management service instance. Non-current +// revision has ;rev=n as a suffix where n is the revision number. +func (client ProductAPIClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, productID string, apiid string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: productID, + Constraints: []validation.Constraint{{Target: "productID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "productID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "productID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {TargetValue: apiid, + Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "apiid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.ProductAPIClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, serviceName, productID, apiid) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.ProductAPIClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.ProductAPIClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.ProductAPIClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ProductAPIClient) DeletePreparer(ctx context.Context, resourceGroupName string, serviceName string, productID string, apiid string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "apiId": autorest.Encode("path", apiid), + "productId": autorest.Encode("path", productID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/apis/{apiId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ProductAPIClient) DeleteSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ProductAPIClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// ListByProduct lists a collection of the APIs associated with a product. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// productID - product identifier. Must be unique in the current API Management service instance. +// filter - | Field | Supported operators | Supported functions | +// |-------------|------------------------|---------------------------------------------| +// | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// | description | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// | serviceUrl | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// | path | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// top - number of records to return. +// skip - number of records to skip. +func (client ProductAPIClient) ListByProduct(ctx context.Context, resourceGroupName string, serviceName string, productID string, filter string, top *int32, skip *int32) (result APICollectionPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: productID, + Constraints: []validation.Constraint{{Target: "productID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "productID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "productID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {TargetValue: top, + Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}}}, + {TargetValue: skip, + Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("apimanagement.ProductAPIClient", "ListByProduct", err.Error()) + } + + result.fn = client.listByProductNextResults + req, err := client.ListByProductPreparer(ctx, resourceGroupName, serviceName, productID, filter, top, skip) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.ProductAPIClient", "ListByProduct", nil, "Failure preparing request") + return + } + + resp, err := client.ListByProductSender(req) + if err != nil { + result.ac.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.ProductAPIClient", "ListByProduct", resp, "Failure sending request") + return + } + + result.ac, err = client.ListByProductResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.ProductAPIClient", "ListByProduct", resp, "Failure responding to request") + } + + return +} + +// ListByProductPreparer prepares the ListByProduct request. +func (client ProductAPIClient) ListByProductPreparer(ctx context.Context, resourceGroupName string, serviceName string, productID string, filter string, top *int32, skip *int32) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "productId": autorest.Encode("path", productID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + if skip != nil { + queryParameters["$skip"] = autorest.Encode("query", *skip) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/apis", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByProductSender sends the ListByProduct request. The method will close the +// http.Response Body if it receives an error. +func (client ProductAPIClient) ListByProductSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByProductResponder handles the response to the ListByProduct request. The method always +// closes the http.Response Body. +func (client ProductAPIClient) ListByProductResponder(resp *http.Response) (result APICollection, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByProductNextResults retrieves the next set of results, if any. +func (client ProductAPIClient) listByProductNextResults(lastResults APICollection) (result APICollection, err error) { + req, err := lastResults.aPICollectionPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "apimanagement.ProductAPIClient", "listByProductNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByProductSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "apimanagement.ProductAPIClient", "listByProductNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByProductResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.ProductAPIClient", "listByProductNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByProductComplete enumerates all values, automatically crossing page boundaries as required. +func (client ProductAPIClient) ListByProductComplete(ctx context.Context, resourceGroupName string, serviceName string, productID string, filter string, top *int32, skip *int32) (result APICollectionIterator, err error) { + result.page, err = client.ListByProduct(ctx, resourceGroupName, serviceName, productID, filter, top, skip) + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/productgroup.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/productgroup.go new file mode 100644 index 000000000..482bbe6f4 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/productgroup.go @@ -0,0 +1,432 @@ +package apimanagement + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// ProductGroupClient is the apiManagement Client +type ProductGroupClient struct { + BaseClient +} + +// NewProductGroupClient creates an instance of the ProductGroupClient client. +func NewProductGroupClient(subscriptionID string) ProductGroupClient { + return NewProductGroupClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewProductGroupClientWithBaseURI creates an instance of the ProductGroupClient client. +func NewProductGroupClientWithBaseURI(baseURI string, subscriptionID string) ProductGroupClient { + return ProductGroupClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CheckEntityExists checks that Group entity specified by identifier is associated with the Product entity. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// productID - product identifier. Must be unique in the current API Management service instance. +// groupID - group identifier. Must be unique in the current API Management service instance. +func (client ProductGroupClient) CheckEntityExists(ctx context.Context, resourceGroupName string, serviceName string, productID string, groupID string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: productID, + Constraints: []validation.Constraint{{Target: "productID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "productID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "productID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {TargetValue: groupID, + Constraints: []validation.Constraint{{Target: "groupID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "groupID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "groupID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.ProductGroupClient", "CheckEntityExists", err.Error()) + } + + req, err := client.CheckEntityExistsPreparer(ctx, resourceGroupName, serviceName, productID, groupID) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.ProductGroupClient", "CheckEntityExists", nil, "Failure preparing request") + return + } + + resp, err := client.CheckEntityExistsSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.ProductGroupClient", "CheckEntityExists", resp, "Failure sending request") + return + } + + result, err = client.CheckEntityExistsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.ProductGroupClient", "CheckEntityExists", resp, "Failure responding to request") + } + + return +} + +// CheckEntityExistsPreparer prepares the CheckEntityExists request. +func (client ProductGroupClient) CheckEntityExistsPreparer(ctx context.Context, resourceGroupName string, serviceName string, productID string, groupID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "groupId": autorest.Encode("path", groupID), + "productId": autorest.Encode("path", productID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsHead(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/groups/{groupId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CheckEntityExistsSender sends the CheckEntityExists request. The method will close the +// http.Response Body if it receives an error. +func (client ProductGroupClient) CheckEntityExistsSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// CheckEntityExistsResponder handles the response to the CheckEntityExists request. The method always +// closes the http.Response Body. +func (client ProductGroupClient) CheckEntityExistsResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent, http.StatusNotFound), + autorest.ByClosing()) + result.Response = resp + return +} + +// CreateOrUpdate adds the association between the specified developer group with the specified product. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// productID - product identifier. Must be unique in the current API Management service instance. +// groupID - group identifier. Must be unique in the current API Management service instance. +func (client ProductGroupClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, productID string, groupID string) (result GroupContract, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: productID, + Constraints: []validation.Constraint{{Target: "productID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "productID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "productID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {TargetValue: groupID, + Constraints: []validation.Constraint{{Target: "groupID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "groupID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "groupID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.ProductGroupClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serviceName, productID, groupID) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.ProductGroupClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.ProductGroupClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.ProductGroupClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client ProductGroupClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, productID string, groupID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "groupId": autorest.Encode("path", groupID), + "productId": autorest.Encode("path", productID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/groups/{groupId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client ProductGroupClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client ProductGroupClient) CreateOrUpdateResponder(resp *http.Response) (result GroupContract, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes the association between the specified group and product. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// productID - product identifier. Must be unique in the current API Management service instance. +// groupID - group identifier. Must be unique in the current API Management service instance. +func (client ProductGroupClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, productID string, groupID string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: productID, + Constraints: []validation.Constraint{{Target: "productID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "productID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "productID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {TargetValue: groupID, + Constraints: []validation.Constraint{{Target: "groupID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "groupID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "groupID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.ProductGroupClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, serviceName, productID, groupID) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.ProductGroupClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.ProductGroupClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.ProductGroupClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ProductGroupClient) DeletePreparer(ctx context.Context, resourceGroupName string, serviceName string, productID string, groupID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "groupId": autorest.Encode("path", groupID), + "productId": autorest.Encode("path", productID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/groups/{groupId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ProductGroupClient) DeleteSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ProductGroupClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// ListByProduct lists the collection of developer groups associated with the specified product. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// productID - product identifier. Must be unique in the current API Management service instance. +// filter - | Field | Supported operators | Supported functions | +// |-------------|------------------------|---------------------------------------------| +// | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// | description | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// | type | eq, ne | N/A | +// top - number of records to return. +// skip - number of records to skip. +func (client ProductGroupClient) ListByProduct(ctx context.Context, resourceGroupName string, serviceName string, productID string, filter string, top *int32, skip *int32) (result GroupCollectionPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: productID, + Constraints: []validation.Constraint{{Target: "productID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "productID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "productID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {TargetValue: top, + Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}}}, + {TargetValue: skip, + Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("apimanagement.ProductGroupClient", "ListByProduct", err.Error()) + } + + result.fn = client.listByProductNextResults + req, err := client.ListByProductPreparer(ctx, resourceGroupName, serviceName, productID, filter, top, skip) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.ProductGroupClient", "ListByProduct", nil, "Failure preparing request") + return + } + + resp, err := client.ListByProductSender(req) + if err != nil { + result.gc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.ProductGroupClient", "ListByProduct", resp, "Failure sending request") + return + } + + result.gc, err = client.ListByProductResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.ProductGroupClient", "ListByProduct", resp, "Failure responding to request") + } + + return +} + +// ListByProductPreparer prepares the ListByProduct request. +func (client ProductGroupClient) ListByProductPreparer(ctx context.Context, resourceGroupName string, serviceName string, productID string, filter string, top *int32, skip *int32) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "productId": autorest.Encode("path", productID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + if skip != nil { + queryParameters["$skip"] = autorest.Encode("query", *skip) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/groups", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByProductSender sends the ListByProduct request. The method will close the +// http.Response Body if it receives an error. +func (client ProductGroupClient) ListByProductSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByProductResponder handles the response to the ListByProduct request. The method always +// closes the http.Response Body. +func (client ProductGroupClient) ListByProductResponder(resp *http.Response) (result GroupCollection, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByProductNextResults retrieves the next set of results, if any. +func (client ProductGroupClient) listByProductNextResults(lastResults GroupCollection) (result GroupCollection, err error) { + req, err := lastResults.groupCollectionPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "apimanagement.ProductGroupClient", "listByProductNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByProductSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "apimanagement.ProductGroupClient", "listByProductNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByProductResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.ProductGroupClient", "listByProductNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByProductComplete enumerates all values, automatically crossing page boundaries as required. +func (client ProductGroupClient) ListByProductComplete(ctx context.Context, resourceGroupName string, serviceName string, productID string, filter string, top *int32, skip *int32) (result GroupCollectionIterator, err error) { + result.page, err = client.ListByProduct(ctx, resourceGroupName, serviceName, productID, filter, top, skip) + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/productpolicy.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/productpolicy.go new file mode 100644 index 000000000..490f44715 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/productpolicy.go @@ -0,0 +1,462 @@ +package apimanagement + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// ProductPolicyClient is the apiManagement Client +type ProductPolicyClient struct { + BaseClient +} + +// NewProductPolicyClient creates an instance of the ProductPolicyClient client. +func NewProductPolicyClient(subscriptionID string) ProductPolicyClient { + return NewProductPolicyClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewProductPolicyClientWithBaseURI creates an instance of the ProductPolicyClient client. +func NewProductPolicyClientWithBaseURI(baseURI string, subscriptionID string) ProductPolicyClient { + return ProductPolicyClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or updates policy configuration for the Product. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// productID - product identifier. Must be unique in the current API Management service instance. +// parameters - the policy contents to apply. +// ifMatch - eTag of the Entity. Not required when creating an entity, but required when updating an entity. +func (client ProductPolicyClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, productID string, parameters PolicyContract, ifMatch string) (result PolicyContract, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: productID, + Constraints: []validation.Constraint{{Target: "productID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "productID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "productID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.PolicyContractProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.PolicyContractProperties.PolicyContent", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("apimanagement.ProductPolicyClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serviceName, productID, parameters, ifMatch) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.ProductPolicyClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.ProductPolicyClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.ProductPolicyClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client ProductPolicyClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, productID string, parameters PolicyContract, ifMatch string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "policyId": autorest.Encode("path", "policy"), + "productId": autorest.Encode("path", productID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/policies/{policyId}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + if len(ifMatch) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client ProductPolicyClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client ProductPolicyClient) CreateOrUpdateResponder(resp *http.Response) (result PolicyContract, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes the policy configuration at the Product. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// productID - product identifier. Must be unique in the current API Management service instance. +// ifMatch - eTag of the Entity. ETag should match the current entity state from the header response of the GET +// request or it should be * for unconditional update. +func (client ProductPolicyClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, productID string, ifMatch string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: productID, + Constraints: []validation.Constraint{{Target: "productID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "productID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "productID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.ProductPolicyClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, serviceName, productID, ifMatch) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.ProductPolicyClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.ProductPolicyClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.ProductPolicyClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ProductPolicyClient) DeletePreparer(ctx context.Context, resourceGroupName string, serviceName string, productID string, ifMatch string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "policyId": autorest.Encode("path", "policy"), + "productId": autorest.Encode("path", productID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/policies/{policyId}", pathParameters), + autorest.WithQueryParameters(queryParameters), + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ProductPolicyClient) DeleteSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ProductPolicyClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get get the policy configuration at the Product level. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// productID - product identifier. Must be unique in the current API Management service instance. +func (client ProductPolicyClient) Get(ctx context.Context, resourceGroupName string, serviceName string, productID string) (result PolicyContract, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: productID, + Constraints: []validation.Constraint{{Target: "productID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "productID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "productID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.ProductPolicyClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, serviceName, productID) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.ProductPolicyClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.ProductPolicyClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.ProductPolicyClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client ProductPolicyClient) GetPreparer(ctx context.Context, resourceGroupName string, serviceName string, productID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "policyId": autorest.Encode("path", "policy"), + "productId": autorest.Encode("path", productID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/policies/{policyId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ProductPolicyClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ProductPolicyClient) GetResponder(resp *http.Response) (result PolicyContract, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetEntityTag get the ETag of the policy configuration at the Product level. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// productID - product identifier. Must be unique in the current API Management service instance. +func (client ProductPolicyClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, productID string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: productID, + Constraints: []validation.Constraint{{Target: "productID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "productID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "productID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.ProductPolicyClient", "GetEntityTag", err.Error()) + } + + req, err := client.GetEntityTagPreparer(ctx, resourceGroupName, serviceName, productID) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.ProductPolicyClient", "GetEntityTag", nil, "Failure preparing request") + return + } + + resp, err := client.GetEntityTagSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.ProductPolicyClient", "GetEntityTag", resp, "Failure sending request") + return + } + + result, err = client.GetEntityTagResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.ProductPolicyClient", "GetEntityTag", resp, "Failure responding to request") + } + + return +} + +// GetEntityTagPreparer prepares the GetEntityTag request. +func (client ProductPolicyClient) GetEntityTagPreparer(ctx context.Context, resourceGroupName string, serviceName string, productID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "policyId": autorest.Encode("path", "policy"), + "productId": autorest.Encode("path", productID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsHead(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/policies/{policyId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetEntityTagSender sends the GetEntityTag request. The method will close the +// http.Response Body if it receives an error. +func (client ProductPolicyClient) GetEntityTagSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetEntityTagResponder handles the response to the GetEntityTag request. The method always +// closes the http.Response Body. +func (client ProductPolicyClient) GetEntityTagResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// ListByProduct get the policy configuration at the Product level. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// productID - product identifier. Must be unique in the current API Management service instance. +func (client ProductPolicyClient) ListByProduct(ctx context.Context, resourceGroupName string, serviceName string, productID string) (result PolicyCollection, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: productID, + Constraints: []validation.Constraint{{Target: "productID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "productID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "productID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.ProductPolicyClient", "ListByProduct", err.Error()) + } + + req, err := client.ListByProductPreparer(ctx, resourceGroupName, serviceName, productID) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.ProductPolicyClient", "ListByProduct", nil, "Failure preparing request") + return + } + + resp, err := client.ListByProductSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.ProductPolicyClient", "ListByProduct", resp, "Failure sending request") + return + } + + result, err = client.ListByProductResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.ProductPolicyClient", "ListByProduct", resp, "Failure responding to request") + } + + return +} + +// ListByProductPreparer prepares the ListByProduct request. +func (client ProductPolicyClient) ListByProductPreparer(ctx context.Context, resourceGroupName string, serviceName string, productID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "productId": autorest.Encode("path", productID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/policies", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByProductSender sends the ListByProduct request. The method will close the +// http.Response Body if it receives an error. +func (client ProductPolicyClient) ListByProductSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByProductResponder handles the response to the ListByProduct request. The method always +// closes the http.Response Body. +func (client ProductPolicyClient) ListByProductResponder(resp *http.Response) (result PolicyCollection, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/productsubscriptions.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/productsubscriptions.go new file mode 100644 index 000000000..f8d8171a3 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/productsubscriptions.go @@ -0,0 +1,175 @@ +package apimanagement + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// ProductSubscriptionsClient is the apiManagement Client +type ProductSubscriptionsClient struct { + BaseClient +} + +// NewProductSubscriptionsClient creates an instance of the ProductSubscriptionsClient client. +func NewProductSubscriptionsClient(subscriptionID string) ProductSubscriptionsClient { + return NewProductSubscriptionsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewProductSubscriptionsClientWithBaseURI creates an instance of the ProductSubscriptionsClient client. +func NewProductSubscriptionsClientWithBaseURI(baseURI string, subscriptionID string) ProductSubscriptionsClient { + return ProductSubscriptionsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// List lists the collection of subscriptions to the specified product. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// productID - product identifier. Must be unique in the current API Management service instance. +// filter - | Field | Supported operators | Supported functions | +// |--------------|------------------------|---------------------------------------------| +// | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// | stateComment | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// | userId | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// | productId | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// | state | eq | | +// top - number of records to return. +// skip - number of records to skip. +func (client ProductSubscriptionsClient) List(ctx context.Context, resourceGroupName string, serviceName string, productID string, filter string, top *int32, skip *int32) (result SubscriptionCollectionPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: productID, + Constraints: []validation.Constraint{{Target: "productID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "productID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "productID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {TargetValue: top, + Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}}}, + {TargetValue: skip, + Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("apimanagement.ProductSubscriptionsClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName, serviceName, productID, filter, top, skip) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.ProductSubscriptionsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.sc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.ProductSubscriptionsClient", "List", resp, "Failure sending request") + return + } + + result.sc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.ProductSubscriptionsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client ProductSubscriptionsClient) ListPreparer(ctx context.Context, resourceGroupName string, serviceName string, productID string, filter string, top *int32, skip *int32) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "productId": autorest.Encode("path", productID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + if skip != nil { + queryParameters["$skip"] = autorest.Encode("query", *skip) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/subscriptions", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ProductSubscriptionsClient) ListSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ProductSubscriptionsClient) ListResponder(resp *http.Response) (result SubscriptionCollection, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ProductSubscriptionsClient) listNextResults(lastResults SubscriptionCollection) (result SubscriptionCollection, err error) { + req, err := lastResults.subscriptionCollectionPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "apimanagement.ProductSubscriptionsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "apimanagement.ProductSubscriptionsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.ProductSubscriptionsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ProductSubscriptionsClient) ListComplete(ctx context.Context, resourceGroupName string, serviceName string, productID string, filter string, top *int32, skip *int32) (result SubscriptionCollectionIterator, err error) { + result.page, err = client.List(ctx, resourceGroupName, serviceName, productID, filter, top, skip) + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/property.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/property.go new file mode 100644 index 000000000..67a80a5c0 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/property.go @@ -0,0 +1,591 @@ +package apimanagement + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// PropertyClient is the apiManagement Client +type PropertyClient struct { + BaseClient +} + +// NewPropertyClient creates an instance of the PropertyClient client. +func NewPropertyClient(subscriptionID string) PropertyClient { + return NewPropertyClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewPropertyClientWithBaseURI creates an instance of the PropertyClient client. +func NewPropertyClientWithBaseURI(baseURI string, subscriptionID string) PropertyClient { + return PropertyClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or updates a property. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// propID - identifier of the property. +// parameters - create parameters. +// ifMatch - eTag of the Entity. Not required when creating an entity, but required when updating an entity. +func (client PropertyClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, propID string, parameters PropertyContract, ifMatch string) (result PropertyContract, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: propID, + Constraints: []validation.Constraint{{Target: "propID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "propID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.PropertyContractProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.PropertyContractProperties.DisplayName", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.PropertyContractProperties.DisplayName", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "parameters.PropertyContractProperties.DisplayName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "parameters.PropertyContractProperties.DisplayName", Name: validation.Pattern, Rule: `^[A-Za-z0-9-._]+$`, Chain: nil}, + }}, + {Target: "parameters.PropertyContractProperties.Value", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.PropertyContractProperties.Value", Name: validation.MaxLength, Rule: 4096, Chain: nil}, + {Target: "parameters.PropertyContractProperties.Value", Name: validation.MinLength, Rule: 1, Chain: nil}, + }}, + }}}}}); err != nil { + return result, validation.NewError("apimanagement.PropertyClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serviceName, propID, parameters, ifMatch) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.PropertyClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.PropertyClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.PropertyClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client PropertyClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, propID string, parameters PropertyContract, ifMatch string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "propId": autorest.Encode("path", propID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/properties/{propId}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + if len(ifMatch) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client PropertyClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client PropertyClient) CreateOrUpdateResponder(resp *http.Response) (result PropertyContract, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes specific property from the the API Management service instance. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// propID - identifier of the property. +// ifMatch - eTag of the Entity. ETag should match the current entity state from the header response of the GET +// request or it should be * for unconditional update. +func (client PropertyClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, propID string, ifMatch string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: propID, + Constraints: []validation.Constraint{{Target: "propID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "propID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.PropertyClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, serviceName, propID, ifMatch) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.PropertyClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.PropertyClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.PropertyClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client PropertyClient) DeletePreparer(ctx context.Context, resourceGroupName string, serviceName string, propID string, ifMatch string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "propId": autorest.Encode("path", propID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/properties/{propId}", pathParameters), + autorest.WithQueryParameters(queryParameters), + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client PropertyClient) DeleteSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client PropertyClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the details of the property specified by its identifier. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// propID - identifier of the property. +func (client PropertyClient) Get(ctx context.Context, resourceGroupName string, serviceName string, propID string) (result PropertyContract, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: propID, + Constraints: []validation.Constraint{{Target: "propID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "propID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.PropertyClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, serviceName, propID) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.PropertyClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.PropertyClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.PropertyClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client PropertyClient) GetPreparer(ctx context.Context, resourceGroupName string, serviceName string, propID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "propId": autorest.Encode("path", propID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/properties/{propId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client PropertyClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client PropertyClient) GetResponder(resp *http.Response) (result PropertyContract, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetEntityTag gets the entity state (Etag) version of the property specified by its identifier. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// propID - identifier of the property. +func (client PropertyClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, propID string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: propID, + Constraints: []validation.Constraint{{Target: "propID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "propID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.PropertyClient", "GetEntityTag", err.Error()) + } + + req, err := client.GetEntityTagPreparer(ctx, resourceGroupName, serviceName, propID) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.PropertyClient", "GetEntityTag", nil, "Failure preparing request") + return + } + + resp, err := client.GetEntityTagSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.PropertyClient", "GetEntityTag", resp, "Failure sending request") + return + } + + result, err = client.GetEntityTagResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.PropertyClient", "GetEntityTag", resp, "Failure responding to request") + } + + return +} + +// GetEntityTagPreparer prepares the GetEntityTag request. +func (client PropertyClient) GetEntityTagPreparer(ctx context.Context, resourceGroupName string, serviceName string, propID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "propId": autorest.Encode("path", propID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsHead(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/properties/{propId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetEntityTagSender sends the GetEntityTag request. The method will close the +// http.Response Body if it receives an error. +func (client PropertyClient) GetEntityTagSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetEntityTagResponder handles the response to the GetEntityTag request. The method always +// closes the http.Response Body. +func (client PropertyClient) GetEntityTagResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// ListByService lists a collection of properties defined within a service instance. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// filter - | Field | Supported operators | Supported functions | +// |-------|------------------------|-------------------------------------------------------| +// | tags | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith, any, all | +// | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// top - number of records to return. +// skip - number of records to skip. +func (client PropertyClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (result PropertyCollectionPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: top, + Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}}}, + {TargetValue: skip, + Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("apimanagement.PropertyClient", "ListByService", err.Error()) + } + + result.fn = client.listByServiceNextResults + req, err := client.ListByServicePreparer(ctx, resourceGroupName, serviceName, filter, top, skip) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.PropertyClient", "ListByService", nil, "Failure preparing request") + return + } + + resp, err := client.ListByServiceSender(req) + if err != nil { + result.pc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.PropertyClient", "ListByService", resp, "Failure sending request") + return + } + + result.pc, err = client.ListByServiceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.PropertyClient", "ListByService", resp, "Failure responding to request") + } + + return +} + +// ListByServicePreparer prepares the ListByService request. +func (client PropertyClient) ListByServicePreparer(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + if skip != nil { + queryParameters["$skip"] = autorest.Encode("query", *skip) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/properties", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByServiceSender sends the ListByService request. The method will close the +// http.Response Body if it receives an error. +func (client PropertyClient) ListByServiceSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByServiceResponder handles the response to the ListByService request. The method always +// closes the http.Response Body. +func (client PropertyClient) ListByServiceResponder(resp *http.Response) (result PropertyCollection, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByServiceNextResults retrieves the next set of results, if any. +func (client PropertyClient) listByServiceNextResults(lastResults PropertyCollection) (result PropertyCollection, err error) { + req, err := lastResults.propertyCollectionPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "apimanagement.PropertyClient", "listByServiceNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByServiceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "apimanagement.PropertyClient", "listByServiceNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByServiceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.PropertyClient", "listByServiceNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByServiceComplete enumerates all values, automatically crossing page boundaries as required. +func (client PropertyClient) ListByServiceComplete(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (result PropertyCollectionIterator, err error) { + result.page, err = client.ListByService(ctx, resourceGroupName, serviceName, filter, top, skip) + return +} + +// Update updates the specific property. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// propID - identifier of the property. +// parameters - update parameters. +// ifMatch - eTag of the Entity. ETag should match the current entity state from the header response of the GET +// request or it should be * for unconditional update. +func (client PropertyClient) Update(ctx context.Context, resourceGroupName string, serviceName string, propID string, parameters PropertyUpdateParameters, ifMatch string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: propID, + Constraints: []validation.Constraint{{Target: "propID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "propID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.PropertyClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, serviceName, propID, parameters, ifMatch) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.PropertyClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.PropertyClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.PropertyClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client PropertyClient) UpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, propID string, parameters PropertyUpdateParameters, ifMatch string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "propId": autorest.Encode("path", propID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/properties/{propId}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters), + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client PropertyClient) UpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client PropertyClient) UpdateResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/quotabycounterkeys.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/quotabycounterkeys.go new file mode 100644 index 000000000..1feada368 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/quotabycounterkeys.go @@ -0,0 +1,205 @@ +package apimanagement + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// QuotaByCounterKeysClient is the apiManagement Client +type QuotaByCounterKeysClient struct { + BaseClient +} + +// NewQuotaByCounterKeysClient creates an instance of the QuotaByCounterKeysClient client. +func NewQuotaByCounterKeysClient(subscriptionID string) QuotaByCounterKeysClient { + return NewQuotaByCounterKeysClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewQuotaByCounterKeysClientWithBaseURI creates an instance of the QuotaByCounterKeysClient client. +func NewQuotaByCounterKeysClientWithBaseURI(baseURI string, subscriptionID string) QuotaByCounterKeysClient { + return QuotaByCounterKeysClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// ListByService lists a collection of current quota counter periods associated with the counter-key configured in the +// policy on the specified service instance. The api does not support paging yet. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// quotaCounterKey - quota counter key identifier.This is the result of expression defined in counter-key +// attribute of the quota-by-key policy.For Example, if you specify counter-key="boo" in the policy, then it’s +// accessible by "boo" counter key. But if it’s defined as counter-key="@("b"+"a")" then it will be accessible +// by "ba" key +func (client QuotaByCounterKeysClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, quotaCounterKey string) (result QuotaCounterCollection, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.QuotaByCounterKeysClient", "ListByService", err.Error()) + } + + req, err := client.ListByServicePreparer(ctx, resourceGroupName, serviceName, quotaCounterKey) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.QuotaByCounterKeysClient", "ListByService", nil, "Failure preparing request") + return + } + + resp, err := client.ListByServiceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.QuotaByCounterKeysClient", "ListByService", resp, "Failure sending request") + return + } + + result, err = client.ListByServiceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.QuotaByCounterKeysClient", "ListByService", resp, "Failure responding to request") + } + + return +} + +// ListByServicePreparer prepares the ListByService request. +func (client QuotaByCounterKeysClient) ListByServicePreparer(ctx context.Context, resourceGroupName string, serviceName string, quotaCounterKey string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "quotaCounterKey": autorest.Encode("path", quotaCounterKey), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/quotas/{quotaCounterKey}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByServiceSender sends the ListByService request. The method will close the +// http.Response Body if it receives an error. +func (client QuotaByCounterKeysClient) ListByServiceSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByServiceResponder handles the response to the ListByService request. The method always +// closes the http.Response Body. +func (client QuotaByCounterKeysClient) ListByServiceResponder(resp *http.Response) (result QuotaCounterCollection, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Update updates all the quota counter values specified with the existing quota counter key to a value in the +// specified service instance. This should be used for reset of the quota counter values. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// quotaCounterKey - quota counter key identifier.This is the result of expression defined in counter-key +// attribute of the quota-by-key policy.For Example, if you specify counter-key="boo" in the policy, then it’s +// accessible by "boo" counter key. But if it’s defined as counter-key="@("b"+"a")" then it will be accessible +// by "ba" key +// parameters - the value of the quota counter to be applied to all quota counter periods. +func (client QuotaByCounterKeysClient) Update(ctx context.Context, resourceGroupName string, serviceName string, quotaCounterKey string, parameters QuotaCounterValueContractProperties) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.QuotaByCounterKeysClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, serviceName, quotaCounterKey, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.QuotaByCounterKeysClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.QuotaByCounterKeysClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.QuotaByCounterKeysClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client QuotaByCounterKeysClient) UpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, quotaCounterKey string, parameters QuotaCounterValueContractProperties) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "quotaCounterKey": autorest.Encode("path", quotaCounterKey), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/quotas/{quotaCounterKey}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client QuotaByCounterKeysClient) UpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client QuotaByCounterKeysClient) UpdateResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/quotabyperiodkeys.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/quotabyperiodkeys.go new file mode 100644 index 000000000..60b29ea2c --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/quotabyperiodkeys.go @@ -0,0 +1,208 @@ +package apimanagement + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// QuotaByPeriodKeysClient is the apiManagement Client +type QuotaByPeriodKeysClient struct { + BaseClient +} + +// NewQuotaByPeriodKeysClient creates an instance of the QuotaByPeriodKeysClient client. +func NewQuotaByPeriodKeysClient(subscriptionID string) QuotaByPeriodKeysClient { + return NewQuotaByPeriodKeysClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewQuotaByPeriodKeysClientWithBaseURI creates an instance of the QuotaByPeriodKeysClient client. +func NewQuotaByPeriodKeysClientWithBaseURI(baseURI string, subscriptionID string) QuotaByPeriodKeysClient { + return QuotaByPeriodKeysClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get gets the value of the quota counter associated with the counter-key in the policy for the specific period in +// service instance. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// quotaCounterKey - quota counter key identifier.This is the result of expression defined in counter-key +// attribute of the quota-by-key policy.For Example, if you specify counter-key="boo" in the policy, then it’s +// accessible by "boo" counter key. But if it’s defined as counter-key="@("b"+"a")" then it will be accessible +// by "ba" key +// quotaPeriodKey - quota period key identifier. +func (client QuotaByPeriodKeysClient) Get(ctx context.Context, resourceGroupName string, serviceName string, quotaCounterKey string, quotaPeriodKey string) (result QuotaCounterContract, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.QuotaByPeriodKeysClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, serviceName, quotaCounterKey, quotaPeriodKey) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.QuotaByPeriodKeysClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.QuotaByPeriodKeysClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.QuotaByPeriodKeysClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client QuotaByPeriodKeysClient) GetPreparer(ctx context.Context, resourceGroupName string, serviceName string, quotaCounterKey string, quotaPeriodKey string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "quotaCounterKey": autorest.Encode("path", quotaCounterKey), + "quotaPeriodKey": autorest.Encode("path", quotaPeriodKey), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/quotas/{quotaCounterKey}/periods/{quotaPeriodKey}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client QuotaByPeriodKeysClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client QuotaByPeriodKeysClient) GetResponder(resp *http.Response) (result QuotaCounterContract, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Update updates an existing quota counter value in the specified service instance. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// quotaCounterKey - quota counter key identifier.This is the result of expression defined in counter-key +// attribute of the quota-by-key policy.For Example, if you specify counter-key="boo" in the policy, then it’s +// accessible by "boo" counter key. But if it’s defined as counter-key="@("b"+"a")" then it will be accessible +// by "ba" key +// quotaPeriodKey - quota period key identifier. +// parameters - the value of the Quota counter to be applied on the specified period. +func (client QuotaByPeriodKeysClient) Update(ctx context.Context, resourceGroupName string, serviceName string, quotaCounterKey string, quotaPeriodKey string, parameters QuotaCounterValueContractProperties) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.QuotaByPeriodKeysClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, serviceName, quotaCounterKey, quotaPeriodKey, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.QuotaByPeriodKeysClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.QuotaByPeriodKeysClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.QuotaByPeriodKeysClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client QuotaByPeriodKeysClient) UpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, quotaCounterKey string, quotaPeriodKey string, parameters QuotaCounterValueContractProperties) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "quotaCounterKey": autorest.Encode("path", quotaCounterKey), + "quotaPeriodKey": autorest.Encode("path", quotaPeriodKey), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/quotas/{quotaCounterKey}/periods/{quotaPeriodKey}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client QuotaByPeriodKeysClient) UpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client QuotaByPeriodKeysClient) UpdateResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/regions.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/regions.go new file mode 100644 index 000000000..b8cd2d706 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/regions.go @@ -0,0 +1,144 @@ +package apimanagement + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// RegionsClient is the apiManagement Client +type RegionsClient struct { + BaseClient +} + +// NewRegionsClient creates an instance of the RegionsClient client. +func NewRegionsClient(subscriptionID string) RegionsClient { + return NewRegionsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewRegionsClientWithBaseURI creates an instance of the RegionsClient client. +func NewRegionsClientWithBaseURI(baseURI string, subscriptionID string) RegionsClient { + return RegionsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// ListByService lists all azure regions in which the service exists. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +func (client RegionsClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string) (result RegionListResultPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.RegionsClient", "ListByService", err.Error()) + } + + result.fn = client.listByServiceNextResults + req, err := client.ListByServicePreparer(ctx, resourceGroupName, serviceName) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.RegionsClient", "ListByService", nil, "Failure preparing request") + return + } + + resp, err := client.ListByServiceSender(req) + if err != nil { + result.rlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.RegionsClient", "ListByService", resp, "Failure sending request") + return + } + + result.rlr, err = client.ListByServiceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.RegionsClient", "ListByService", resp, "Failure responding to request") + } + + return +} + +// ListByServicePreparer prepares the ListByService request. +func (client RegionsClient) ListByServicePreparer(ctx context.Context, resourceGroupName string, serviceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/regions", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByServiceSender sends the ListByService request. The method will close the +// http.Response Body if it receives an error. +func (client RegionsClient) ListByServiceSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByServiceResponder handles the response to the ListByService request. The method always +// closes the http.Response Body. +func (client RegionsClient) ListByServiceResponder(resp *http.Response) (result RegionListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByServiceNextResults retrieves the next set of results, if any. +func (client RegionsClient) listByServiceNextResults(lastResults RegionListResult) (result RegionListResult, err error) { + req, err := lastResults.regionListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "apimanagement.RegionsClient", "listByServiceNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByServiceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "apimanagement.RegionsClient", "listByServiceNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByServiceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.RegionsClient", "listByServiceNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByServiceComplete enumerates all values, automatically crossing page boundaries as required. +func (client RegionsClient) ListByServiceComplete(ctx context.Context, resourceGroupName string, serviceName string) (result RegionListResultIterator, err error) { + result.page, err = client.ListByService(ctx, resourceGroupName, serviceName) + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/reports.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/reports.go new file mode 100644 index 000000000..ca18484bc --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/reports.go @@ -0,0 +1,975 @@ +package apimanagement + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// ReportsClient is the apiManagement Client +type ReportsClient struct { + BaseClient +} + +// NewReportsClient creates an instance of the ReportsClient client. +func NewReportsClient(subscriptionID string) ReportsClient { + return NewReportsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewReportsClientWithBaseURI creates an instance of the ReportsClient client. +func NewReportsClientWithBaseURI(baseURI string, subscriptionID string) ReportsClient { + return ReportsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// ListByAPI lists report records by API. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// filter - the filter to apply on the operation. +// top - number of records to return. +// skip - number of records to skip. +func (client ReportsClient) ListByAPI(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (result ReportCollectionPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: top, + Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}}}, + {TargetValue: skip, + Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("apimanagement.ReportsClient", "ListByAPI", err.Error()) + } + + result.fn = client.listByAPINextResults + req, err := client.ListByAPIPreparer(ctx, resourceGroupName, serviceName, filter, top, skip) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.ReportsClient", "ListByAPI", nil, "Failure preparing request") + return + } + + resp, err := client.ListByAPISender(req) + if err != nil { + result.rc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.ReportsClient", "ListByAPI", resp, "Failure sending request") + return + } + + result.rc, err = client.ListByAPIResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.ReportsClient", "ListByAPI", resp, "Failure responding to request") + } + + return +} + +// ListByAPIPreparer prepares the ListByAPI request. +func (client ReportsClient) ListByAPIPreparer(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "$filter": autorest.Encode("query", filter), + "api-version": APIVersion, + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + if skip != nil { + queryParameters["$skip"] = autorest.Encode("query", *skip) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/reports/byApi", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByAPISender sends the ListByAPI request. The method will close the +// http.Response Body if it receives an error. +func (client ReportsClient) ListByAPISender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByAPIResponder handles the response to the ListByAPI request. The method always +// closes the http.Response Body. +func (client ReportsClient) ListByAPIResponder(resp *http.Response) (result ReportCollection, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByAPINextResults retrieves the next set of results, if any. +func (client ReportsClient) listByAPINextResults(lastResults ReportCollection) (result ReportCollection, err error) { + req, err := lastResults.reportCollectionPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "apimanagement.ReportsClient", "listByAPINextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByAPISender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "apimanagement.ReportsClient", "listByAPINextResults", resp, "Failure sending next results request") + } + result, err = client.ListByAPIResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.ReportsClient", "listByAPINextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByAPIComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReportsClient) ListByAPIComplete(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (result ReportCollectionIterator, err error) { + result.page, err = client.ListByAPI(ctx, resourceGroupName, serviceName, filter, top, skip) + return +} + +// ListByGeo lists report records by GeoGraphy. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// filter - the filter to apply on the operation. +// top - number of records to return. +// skip - number of records to skip. +func (client ReportsClient) ListByGeo(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (result ReportCollectionPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: top, + Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}}}, + {TargetValue: skip, + Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("apimanagement.ReportsClient", "ListByGeo", err.Error()) + } + + result.fn = client.listByGeoNextResults + req, err := client.ListByGeoPreparer(ctx, resourceGroupName, serviceName, filter, top, skip) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.ReportsClient", "ListByGeo", nil, "Failure preparing request") + return + } + + resp, err := client.ListByGeoSender(req) + if err != nil { + result.rc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.ReportsClient", "ListByGeo", resp, "Failure sending request") + return + } + + result.rc, err = client.ListByGeoResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.ReportsClient", "ListByGeo", resp, "Failure responding to request") + } + + return +} + +// ListByGeoPreparer prepares the ListByGeo request. +func (client ReportsClient) ListByGeoPreparer(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + if skip != nil { + queryParameters["$skip"] = autorest.Encode("query", *skip) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/reports/byGeo", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByGeoSender sends the ListByGeo request. The method will close the +// http.Response Body if it receives an error. +func (client ReportsClient) ListByGeoSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByGeoResponder handles the response to the ListByGeo request. The method always +// closes the http.Response Body. +func (client ReportsClient) ListByGeoResponder(resp *http.Response) (result ReportCollection, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByGeoNextResults retrieves the next set of results, if any. +func (client ReportsClient) listByGeoNextResults(lastResults ReportCollection) (result ReportCollection, err error) { + req, err := lastResults.reportCollectionPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "apimanagement.ReportsClient", "listByGeoNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByGeoSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "apimanagement.ReportsClient", "listByGeoNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByGeoResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.ReportsClient", "listByGeoNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByGeoComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReportsClient) ListByGeoComplete(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (result ReportCollectionIterator, err error) { + result.page, err = client.ListByGeo(ctx, resourceGroupName, serviceName, filter, top, skip) + return +} + +// ListByOperation lists report records by API Operations. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// filter - the filter to apply on the operation. +// top - number of records to return. +// skip - number of records to skip. +func (client ReportsClient) ListByOperation(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (result ReportCollectionPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: top, + Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}}}, + {TargetValue: skip, + Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("apimanagement.ReportsClient", "ListByOperation", err.Error()) + } + + result.fn = client.listByOperationNextResults + req, err := client.ListByOperationPreparer(ctx, resourceGroupName, serviceName, filter, top, skip) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.ReportsClient", "ListByOperation", nil, "Failure preparing request") + return + } + + resp, err := client.ListByOperationSender(req) + if err != nil { + result.rc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.ReportsClient", "ListByOperation", resp, "Failure sending request") + return + } + + result.rc, err = client.ListByOperationResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.ReportsClient", "ListByOperation", resp, "Failure responding to request") + } + + return +} + +// ListByOperationPreparer prepares the ListByOperation request. +func (client ReportsClient) ListByOperationPreparer(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "$filter": autorest.Encode("query", filter), + "api-version": APIVersion, + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + if skip != nil { + queryParameters["$skip"] = autorest.Encode("query", *skip) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/reports/byOperation", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByOperationSender sends the ListByOperation request. The method will close the +// http.Response Body if it receives an error. +func (client ReportsClient) ListByOperationSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByOperationResponder handles the response to the ListByOperation request. The method always +// closes the http.Response Body. +func (client ReportsClient) ListByOperationResponder(resp *http.Response) (result ReportCollection, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByOperationNextResults retrieves the next set of results, if any. +func (client ReportsClient) listByOperationNextResults(lastResults ReportCollection) (result ReportCollection, err error) { + req, err := lastResults.reportCollectionPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "apimanagement.ReportsClient", "listByOperationNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByOperationSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "apimanagement.ReportsClient", "listByOperationNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByOperationResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.ReportsClient", "listByOperationNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByOperationComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReportsClient) ListByOperationComplete(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (result ReportCollectionIterator, err error) { + result.page, err = client.ListByOperation(ctx, resourceGroupName, serviceName, filter, top, skip) + return +} + +// ListByProduct lists report records by Product. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// filter - the filter to apply on the operation. +// top - number of records to return. +// skip - number of records to skip. +func (client ReportsClient) ListByProduct(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (result ReportCollectionPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: top, + Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}}}, + {TargetValue: skip, + Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("apimanagement.ReportsClient", "ListByProduct", err.Error()) + } + + result.fn = client.listByProductNextResults + req, err := client.ListByProductPreparer(ctx, resourceGroupName, serviceName, filter, top, skip) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.ReportsClient", "ListByProduct", nil, "Failure preparing request") + return + } + + resp, err := client.ListByProductSender(req) + if err != nil { + result.rc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.ReportsClient", "ListByProduct", resp, "Failure sending request") + return + } + + result.rc, err = client.ListByProductResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.ReportsClient", "ListByProduct", resp, "Failure responding to request") + } + + return +} + +// ListByProductPreparer prepares the ListByProduct request. +func (client ReportsClient) ListByProductPreparer(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "$filter": autorest.Encode("query", filter), + "api-version": APIVersion, + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + if skip != nil { + queryParameters["$skip"] = autorest.Encode("query", *skip) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/reports/byProduct", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByProductSender sends the ListByProduct request. The method will close the +// http.Response Body if it receives an error. +func (client ReportsClient) ListByProductSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByProductResponder handles the response to the ListByProduct request. The method always +// closes the http.Response Body. +func (client ReportsClient) ListByProductResponder(resp *http.Response) (result ReportCollection, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByProductNextResults retrieves the next set of results, if any. +func (client ReportsClient) listByProductNextResults(lastResults ReportCollection) (result ReportCollection, err error) { + req, err := lastResults.reportCollectionPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "apimanagement.ReportsClient", "listByProductNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByProductSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "apimanagement.ReportsClient", "listByProductNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByProductResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.ReportsClient", "listByProductNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByProductComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReportsClient) ListByProductComplete(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (result ReportCollectionIterator, err error) { + result.page, err = client.ListByProduct(ctx, resourceGroupName, serviceName, filter, top, skip) + return +} + +// ListByRequest lists report records by Request. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// filter - the filter to apply on the operation. +// top - number of records to return. +// skip - number of records to skip. +func (client ReportsClient) ListByRequest(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (result RequestReportCollection, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: top, + Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}}}, + {TargetValue: skip, + Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("apimanagement.ReportsClient", "ListByRequest", err.Error()) + } + + req, err := client.ListByRequestPreparer(ctx, resourceGroupName, serviceName, filter, top, skip) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.ReportsClient", "ListByRequest", nil, "Failure preparing request") + return + } + + resp, err := client.ListByRequestSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.ReportsClient", "ListByRequest", resp, "Failure sending request") + return + } + + result, err = client.ListByRequestResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.ReportsClient", "ListByRequest", resp, "Failure responding to request") + } + + return +} + +// ListByRequestPreparer prepares the ListByRequest request. +func (client ReportsClient) ListByRequestPreparer(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "$filter": autorest.Encode("query", filter), + "api-version": APIVersion, + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + if skip != nil { + queryParameters["$skip"] = autorest.Encode("query", *skip) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/reports/byRequest", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByRequestSender sends the ListByRequest request. The method will close the +// http.Response Body if it receives an error. +func (client ReportsClient) ListByRequestSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByRequestResponder handles the response to the ListByRequest request. The method always +// closes the http.Response Body. +func (client ReportsClient) ListByRequestResponder(resp *http.Response) (result RequestReportCollection, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListBySubscription lists report records by subscription. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// filter - the filter to apply on the operation. +// top - number of records to return. +// skip - number of records to skip. +func (client ReportsClient) ListBySubscription(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (result ReportCollectionPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: top, + Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}}}, + {TargetValue: skip, + Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("apimanagement.ReportsClient", "ListBySubscription", err.Error()) + } + + result.fn = client.listBySubscriptionNextResults + req, err := client.ListBySubscriptionPreparer(ctx, resourceGroupName, serviceName, filter, top, skip) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.ReportsClient", "ListBySubscription", nil, "Failure preparing request") + return + } + + resp, err := client.ListBySubscriptionSender(req) + if err != nil { + result.rc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.ReportsClient", "ListBySubscription", resp, "Failure sending request") + return + } + + result.rc, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.ReportsClient", "ListBySubscription", resp, "Failure responding to request") + } + + return +} + +// ListBySubscriptionPreparer prepares the ListBySubscription request. +func (client ReportsClient) ListBySubscriptionPreparer(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + if skip != nil { + queryParameters["$skip"] = autorest.Encode("query", *skip) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/reports/bySubscription", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListBySubscriptionSender sends the ListBySubscription request. The method will close the +// http.Response Body if it receives an error. +func (client ReportsClient) ListBySubscriptionSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListBySubscriptionResponder handles the response to the ListBySubscription request. The method always +// closes the http.Response Body. +func (client ReportsClient) ListBySubscriptionResponder(resp *http.Response) (result ReportCollection, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listBySubscriptionNextResults retrieves the next set of results, if any. +func (client ReportsClient) listBySubscriptionNextResults(lastResults ReportCollection) (result ReportCollection, err error) { + req, err := lastResults.reportCollectionPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "apimanagement.ReportsClient", "listBySubscriptionNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListBySubscriptionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "apimanagement.ReportsClient", "listBySubscriptionNextResults", resp, "Failure sending next results request") + } + result, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.ReportsClient", "listBySubscriptionNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReportsClient) ListBySubscriptionComplete(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (result ReportCollectionIterator, err error) { + result.page, err = client.ListBySubscription(ctx, resourceGroupName, serviceName, filter, top, skip) + return +} + +// ListByTime lists report records by Time. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// interval - by time interval. Interval must be multiple of 15 minutes and may not be zero. The value should +// be in ISO 8601 format (http://en.wikipedia.org/wiki/ISO_8601#Durations).This code can be used to convert +// TimeSpan to a valid interval string: XmlConvert.ToString(new TimeSpan(hours, minutes, secconds)) +// filter - the filter to apply on the operation. +// top - number of records to return. +// skip - number of records to skip. +func (client ReportsClient) ListByTime(ctx context.Context, resourceGroupName string, serviceName string, interval string, filter string, top *int32, skip *int32) (result ReportCollectionPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: top, + Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}}}, + {TargetValue: skip, + Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("apimanagement.ReportsClient", "ListByTime", err.Error()) + } + + result.fn = client.listByTimeNextResults + req, err := client.ListByTimePreparer(ctx, resourceGroupName, serviceName, interval, filter, top, skip) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.ReportsClient", "ListByTime", nil, "Failure preparing request") + return + } + + resp, err := client.ListByTimeSender(req) + if err != nil { + result.rc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.ReportsClient", "ListByTime", resp, "Failure sending request") + return + } + + result.rc, err = client.ListByTimeResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.ReportsClient", "ListByTime", resp, "Failure responding to request") + } + + return +} + +// ListByTimePreparer prepares the ListByTime request. +func (client ReportsClient) ListByTimePreparer(ctx context.Context, resourceGroupName string, serviceName string, interval string, filter string, top *int32, skip *int32) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + "interval": autorest.Encode("query", interval), + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + if skip != nil { + queryParameters["$skip"] = autorest.Encode("query", *skip) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/reports/byTime", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByTimeSender sends the ListByTime request. The method will close the +// http.Response Body if it receives an error. +func (client ReportsClient) ListByTimeSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByTimeResponder handles the response to the ListByTime request. The method always +// closes the http.Response Body. +func (client ReportsClient) ListByTimeResponder(resp *http.Response) (result ReportCollection, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByTimeNextResults retrieves the next set of results, if any. +func (client ReportsClient) listByTimeNextResults(lastResults ReportCollection) (result ReportCollection, err error) { + req, err := lastResults.reportCollectionPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "apimanagement.ReportsClient", "listByTimeNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByTimeSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "apimanagement.ReportsClient", "listByTimeNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByTimeResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.ReportsClient", "listByTimeNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByTimeComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReportsClient) ListByTimeComplete(ctx context.Context, resourceGroupName string, serviceName string, interval string, filter string, top *int32, skip *int32) (result ReportCollectionIterator, err error) { + result.page, err = client.ListByTime(ctx, resourceGroupName, serviceName, interval, filter, top, skip) + return +} + +// ListByUser lists report records by User. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// filter - the filter to apply on the operation. +// top - number of records to return. +// skip - number of records to skip. +func (client ReportsClient) ListByUser(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (result ReportCollectionPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: top, + Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}}}, + {TargetValue: skip, + Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("apimanagement.ReportsClient", "ListByUser", err.Error()) + } + + result.fn = client.listByUserNextResults + req, err := client.ListByUserPreparer(ctx, resourceGroupName, serviceName, filter, top, skip) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.ReportsClient", "ListByUser", nil, "Failure preparing request") + return + } + + resp, err := client.ListByUserSender(req) + if err != nil { + result.rc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.ReportsClient", "ListByUser", resp, "Failure sending request") + return + } + + result.rc, err = client.ListByUserResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.ReportsClient", "ListByUser", resp, "Failure responding to request") + } + + return +} + +// ListByUserPreparer prepares the ListByUser request. +func (client ReportsClient) ListByUserPreparer(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "$filter": autorest.Encode("query", filter), + "api-version": APIVersion, + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + if skip != nil { + queryParameters["$skip"] = autorest.Encode("query", *skip) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/reports/byUser", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByUserSender sends the ListByUser request. The method will close the +// http.Response Body if it receives an error. +func (client ReportsClient) ListByUserSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByUserResponder handles the response to the ListByUser request. The method always +// closes the http.Response Body. +func (client ReportsClient) ListByUserResponder(resp *http.Response) (result ReportCollection, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByUserNextResults retrieves the next set of results, if any. +func (client ReportsClient) listByUserNextResults(lastResults ReportCollection) (result ReportCollection, err error) { + req, err := lastResults.reportCollectionPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "apimanagement.ReportsClient", "listByUserNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByUserSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "apimanagement.ReportsClient", "listByUserNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByUserResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.ReportsClient", "listByUserNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByUserComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReportsClient) ListByUserComplete(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (result ReportCollectionIterator, err error) { + result.page, err = client.ListByUser(ctx, resourceGroupName, serviceName, filter, top, skip) + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/service.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/service.go new file mode 100644 index 000000000..05459a906 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/service.go @@ -0,0 +1,1126 @@ +package apimanagement + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// ServiceClient is the apiManagement Client +type ServiceClient struct { + BaseClient +} + +// NewServiceClient creates an instance of the ServiceClient client. +func NewServiceClient(subscriptionID string) ServiceClient { + return NewServiceClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewServiceClientWithBaseURI creates an instance of the ServiceClient client. +func NewServiceClientWithBaseURI(baseURI string, subscriptionID string) ServiceClient { + return ServiceClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// ApplyNetworkConfigurationUpdates updates the Microsoft.ApiManagement resource running in the Virtual network to pick +// the updated network settings. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// parameters - parameters supplied to the Apply Network Configuration operation. If the parameters are empty, +// all the regions in which the Api Management service is deployed will be updated sequentially without +// incurring downtime in the region. +func (client ServiceClient) ApplyNetworkConfigurationUpdates(ctx context.Context, resourceGroupName string, serviceName string, parameters *ServiceApplyNetworkConfigurationParameters) (result ServiceApplyNetworkConfigurationUpdatesFuture, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.ServiceClient", "ApplyNetworkConfigurationUpdates", err.Error()) + } + + req, err := client.ApplyNetworkConfigurationUpdatesPreparer(ctx, resourceGroupName, serviceName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.ServiceClient", "ApplyNetworkConfigurationUpdates", nil, "Failure preparing request") + return + } + + result, err = client.ApplyNetworkConfigurationUpdatesSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.ServiceClient", "ApplyNetworkConfigurationUpdates", result.Response(), "Failure sending request") + return + } + + return +} + +// ApplyNetworkConfigurationUpdatesPreparer prepares the ApplyNetworkConfigurationUpdates request. +func (client ServiceClient) ApplyNetworkConfigurationUpdatesPreparer(ctx context.Context, resourceGroupName string, serviceName string, parameters *ServiceApplyNetworkConfigurationParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/applynetworkconfigurationupdates", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if parameters != nil { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithJSON(parameters)) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ApplyNetworkConfigurationUpdatesSender sends the ApplyNetworkConfigurationUpdates request. The method will close the +// http.Response Body if it receives an error. +func (client ServiceClient) ApplyNetworkConfigurationUpdatesSender(req *http.Request) (future ServiceApplyNetworkConfigurationUpdatesFuture, err error) { + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// ApplyNetworkConfigurationUpdatesResponder handles the response to the ApplyNetworkConfigurationUpdates request. The method always +// closes the http.Response Body. +func (client ServiceClient) ApplyNetworkConfigurationUpdatesResponder(resp *http.Response) (result ServiceResource, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Backup creates a backup of the API Management service to the given Azure Storage Account. This is long running +// operation and could take several minutes to complete. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// parameters - parameters supplied to the ApiManagementService_Backup operation. +func (client ServiceClient) Backup(ctx context.Context, resourceGroupName string, serviceName string, parameters ServiceBackupRestoreParameters) (result ServiceBackupFuture, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.StorageAccount", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.AccessKey", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.ContainerName", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.BackupName", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.ServiceClient", "Backup", err.Error()) + } + + req, err := client.BackupPreparer(ctx, resourceGroupName, serviceName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.ServiceClient", "Backup", nil, "Failure preparing request") + return + } + + result, err = client.BackupSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.ServiceClient", "Backup", result.Response(), "Failure sending request") + return + } + + return +} + +// BackupPreparer prepares the Backup request. +func (client ServiceClient) BackupPreparer(ctx context.Context, resourceGroupName string, serviceName string, parameters ServiceBackupRestoreParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/backup", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// BackupSender sends the Backup request. The method will close the +// http.Response Body if it receives an error. +func (client ServiceClient) BackupSender(req *http.Request) (future ServiceBackupFuture, err error) { + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// BackupResponder handles the response to the Backup request. The method always +// closes the http.Response Body. +func (client ServiceClient) BackupResponder(resp *http.Response) (result ServiceResource, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CheckNameAvailability checks availability and correctness of a name for an API Management service. +// Parameters: +// parameters - parameters supplied to the CheckNameAvailability operation. +func (client ServiceClient) CheckNameAvailability(ctx context.Context, parameters ServiceCheckNameAvailabilityParameters) (result ServiceNameAvailabilityResult, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.Name", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.ServiceClient", "CheckNameAvailability", err.Error()) + } + + req, err := client.CheckNameAvailabilityPreparer(ctx, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.ServiceClient", "CheckNameAvailability", nil, "Failure preparing request") + return + } + + resp, err := client.CheckNameAvailabilitySender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.ServiceClient", "CheckNameAvailability", resp, "Failure sending request") + return + } + + result, err = client.CheckNameAvailabilityResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.ServiceClient", "CheckNameAvailability", resp, "Failure responding to request") + } + + return +} + +// CheckNameAvailabilityPreparer prepares the CheckNameAvailability request. +func (client ServiceClient) CheckNameAvailabilityPreparer(ctx context.Context, parameters ServiceCheckNameAvailabilityParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.ApiManagement/checkNameAvailability", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CheckNameAvailabilitySender sends the CheckNameAvailability request. The method will close the +// http.Response Body if it receives an error. +func (client ServiceClient) CheckNameAvailabilitySender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// CheckNameAvailabilityResponder handles the response to the CheckNameAvailability request. The method always +// closes the http.Response Body. +func (client ServiceClient) CheckNameAvailabilityResponder(resp *http.Response) (result ServiceNameAvailabilityResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CreateOrUpdate creates or updates an API Management service. This is long running operation and could take several +// minutes to complete. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// parameters - parameters supplied to the CreateOrUpdate API Management service operation. +func (client ServiceClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, parameters ServiceResource) (result ServiceCreateOrUpdateFuture, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.ServiceProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.ServiceProperties.PublisherEmail", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.ServiceProperties.PublisherEmail", Name: validation.MaxLength, Rule: 100, Chain: nil}}}, + {Target: "parameters.ServiceProperties.PublisherName", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.ServiceProperties.PublisherName", Name: validation.MaxLength, Rule: 100, Chain: nil}}}, + }}, + {Target: "parameters.Sku", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.Identity", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.Identity.Type", Name: validation.Null, Rule: true, Chain: nil}}}, + {Target: "parameters.Location", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.ServiceClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serviceName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.ServiceClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.ServiceClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client ServiceClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, parameters ServiceResource) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client ServiceClient) CreateOrUpdateSender(req *http.Request) (future ServiceCreateOrUpdateFuture, err error) { + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client ServiceClient) CreateOrUpdateResponder(resp *http.Response) (result ServiceResource, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes an existing API Management service. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +func (client ServiceClient) Delete(ctx context.Context, resourceGroupName string, serviceName string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.ServiceClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, serviceName) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.ServiceClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.ServiceClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.ServiceClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ServiceClient) DeletePreparer(ctx context.Context, resourceGroupName string, serviceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ServiceClient) DeleteSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ServiceClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets an API Management service resource description. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +func (client ServiceClient) Get(ctx context.Context, resourceGroupName string, serviceName string) (result ServiceResource, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.ServiceClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, serviceName) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.ServiceClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.ServiceClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.ServiceClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client ServiceClient) GetPreparer(ctx context.Context, resourceGroupName string, serviceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ServiceClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ServiceClient) GetResponder(resp *http.Response) (result ServiceResource, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetSsoToken gets the Single-Sign-On token for the API Management Service which is valid for 5 Minutes. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +func (client ServiceClient) GetSsoToken(ctx context.Context, resourceGroupName string, serviceName string) (result ServiceGetSsoTokenResult, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.ServiceClient", "GetSsoToken", err.Error()) + } + + req, err := client.GetSsoTokenPreparer(ctx, resourceGroupName, serviceName) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.ServiceClient", "GetSsoToken", nil, "Failure preparing request") + return + } + + resp, err := client.GetSsoTokenSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.ServiceClient", "GetSsoToken", resp, "Failure sending request") + return + } + + result, err = client.GetSsoTokenResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.ServiceClient", "GetSsoToken", resp, "Failure responding to request") + } + + return +} + +// GetSsoTokenPreparer prepares the GetSsoToken request. +func (client ServiceClient) GetSsoTokenPreparer(ctx context.Context, resourceGroupName string, serviceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/getssotoken", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSsoTokenSender sends the GetSsoToken request. The method will close the +// http.Response Body if it receives an error. +func (client ServiceClient) GetSsoTokenSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetSsoTokenResponder handles the response to the GetSsoToken request. The method always +// closes the http.Response Body. +func (client ServiceClient) GetSsoTokenResponder(resp *http.Response) (result ServiceGetSsoTokenResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists all API Management services within an Azure subscription. +func (client ServiceClient) List(ctx context.Context) (result ServiceListResultPage, err error) { + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.ServiceClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.slr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.ServiceClient", "List", resp, "Failure sending request") + return + } + + result.slr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.ServiceClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client ServiceClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.ApiManagement/service", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ServiceClient) ListSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ServiceClient) ListResponder(resp *http.Response) (result ServiceListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ServiceClient) listNextResults(lastResults ServiceListResult) (result ServiceListResult, err error) { + req, err := lastResults.serviceListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "apimanagement.ServiceClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "apimanagement.ServiceClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.ServiceClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ServiceClient) ListComplete(ctx context.Context) (result ServiceListResultIterator, err error) { + result.page, err = client.List(ctx) + return +} + +// ListByResourceGroup list all API Management services within a resource group. +// Parameters: +// resourceGroupName - the name of the resource group. +func (client ServiceClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result ServiceListResultPage, err error) { + result.fn = client.listByResourceGroupNextResults + req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.ServiceClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.slr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.ServiceClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result.slr, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.ServiceClient", "ListByResourceGroup", resp, "Failure responding to request") + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client ServiceClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the +// http.Response Body if it receives an error. +func (client ServiceClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always +// closes the http.Response Body. +func (client ServiceClient) ListByResourceGroupResponder(resp *http.Response) (result ServiceListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByResourceGroupNextResults retrieves the next set of results, if any. +func (client ServiceClient) listByResourceGroupNextResults(lastResults ServiceListResult) (result ServiceListResult, err error) { + req, err := lastResults.serviceListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "apimanagement.ServiceClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "apimanagement.ServiceClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.ServiceClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client ServiceClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result ServiceListResultIterator, err error) { + result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) + return +} + +// Restore restores a backup of an API Management service created using the ApiManagementService_Backup operation on +// the current service. This is a long running operation and could take several minutes to complete. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// parameters - parameters supplied to the Restore API Management service from backup operation. +func (client ServiceClient) Restore(ctx context.Context, resourceGroupName string, serviceName string, parameters ServiceBackupRestoreParameters) (result ServiceRestoreFuture, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.StorageAccount", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.AccessKey", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.ContainerName", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.BackupName", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.ServiceClient", "Restore", err.Error()) + } + + req, err := client.RestorePreparer(ctx, resourceGroupName, serviceName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.ServiceClient", "Restore", nil, "Failure preparing request") + return + } + + result, err = client.RestoreSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.ServiceClient", "Restore", result.Response(), "Failure sending request") + return + } + + return +} + +// RestorePreparer prepares the Restore request. +func (client ServiceClient) RestorePreparer(ctx context.Context, resourceGroupName string, serviceName string, parameters ServiceBackupRestoreParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/restore", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RestoreSender sends the Restore request. The method will close the +// http.Response Body if it receives an error. +func (client ServiceClient) RestoreSender(req *http.Request) (future ServiceRestoreFuture, err error) { + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// RestoreResponder handles the response to the Restore request. The method always +// closes the http.Response Body. +func (client ServiceClient) RestoreResponder(resp *http.Response) (result ServiceResource, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Update updates an existing API Management service. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// parameters - parameters supplied to the CreateOrUpdate API Management service operation. +func (client ServiceClient) Update(ctx context.Context, resourceGroupName string, serviceName string, parameters ServiceUpdateParameters) (result ServiceUpdateFuture, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.ServiceClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, serviceName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.ServiceClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.ServiceClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client ServiceClient) UpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, parameters ServiceUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client ServiceClient) UpdateSender(req *http.Request) (future ServiceUpdateFuture, err error) { + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client ServiceClient) UpdateResponder(resp *http.Response) (result ServiceResource, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UpdateHostname creates, updates, or deletes the custom hostnames for an API Management service. The custom hostname +// can be applied to the Proxy and Portal endpoint. This is a long running operation and could take several minutes to +// complete. This operation will be deprecated in the next version update. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// parameters - parameters supplied to the UpdateHostname operation. +func (client ServiceClient) UpdateHostname(ctx context.Context, resourceGroupName string, serviceName string, parameters ServiceUpdateHostnameParameters) (result ServiceUpdateHostnameFuture, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.ServiceClient", "UpdateHostname", err.Error()) + } + + req, err := client.UpdateHostnamePreparer(ctx, resourceGroupName, serviceName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.ServiceClient", "UpdateHostname", nil, "Failure preparing request") + return + } + + result, err = client.UpdateHostnameSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.ServiceClient", "UpdateHostname", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdateHostnamePreparer prepares the UpdateHostname request. +func (client ServiceClient) UpdateHostnamePreparer(ctx context.Context, resourceGroupName string, serviceName string, parameters ServiceUpdateHostnameParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/updatehostname", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateHostnameSender sends the UpdateHostname request. The method will close the +// http.Response Body if it receives an error. +func (client ServiceClient) UpdateHostnameSender(req *http.Request) (future ServiceUpdateHostnameFuture, err error) { + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// UpdateHostnameResponder handles the response to the UpdateHostname request. The method always +// closes the http.Response Body. +func (client ServiceClient) UpdateHostnameResponder(resp *http.Response) (result ServiceResource, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UploadCertificate upload Custom Domain SSL certificate for an API Management service. This operation will be +// deprecated in future releases. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// parameters - parameters supplied to the Upload SSL certificate for an API Management service operation. +func (client ServiceClient) UploadCertificate(ctx context.Context, resourceGroupName string, serviceName string, parameters ServiceUploadCertificateParameters) (result CertificateInformation, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.Certificate", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.CertificatePassword", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.ServiceClient", "UploadCertificate", err.Error()) + } + + req, err := client.UploadCertificatePreparer(ctx, resourceGroupName, serviceName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.ServiceClient", "UploadCertificate", nil, "Failure preparing request") + return + } + + resp, err := client.UploadCertificateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.ServiceClient", "UploadCertificate", resp, "Failure sending request") + return + } + + result, err = client.UploadCertificateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.ServiceClient", "UploadCertificate", resp, "Failure responding to request") + } + + return +} + +// UploadCertificatePreparer prepares the UploadCertificate request. +func (client ServiceClient) UploadCertificatePreparer(ctx context.Context, resourceGroupName string, serviceName string, parameters ServiceUploadCertificateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/updatecertificate", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UploadCertificateSender sends the UploadCertificate request. The method will close the +// http.Response Body if it receives an error. +func (client ServiceClient) UploadCertificateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// UploadCertificateResponder handles the response to the UploadCertificate request. The method always +// closes the http.Response Body. +func (client ServiceClient) UploadCertificateResponder(resp *http.Response) (result CertificateInformation, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/signinsettings.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/signinsettings.go new file mode 100644 index 000000000..f83dd4fa8 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/signinsettings.go @@ -0,0 +1,348 @@ +package apimanagement + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// SignInSettingsClient is the apiManagement Client +type SignInSettingsClient struct { + BaseClient +} + +// NewSignInSettingsClient creates an instance of the SignInSettingsClient client. +func NewSignInSettingsClient(subscriptionID string) SignInSettingsClient { + return NewSignInSettingsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewSignInSettingsClientWithBaseURI creates an instance of the SignInSettingsClient client. +func NewSignInSettingsClientWithBaseURI(baseURI string, subscriptionID string) SignInSettingsClient { + return SignInSettingsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate create or Update Sign-In settings. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// parameters - create or update parameters. +func (client SignInSettingsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, parameters PortalSigninSettings) (result PortalSigninSettings, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.SignInSettingsClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serviceName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.SignInSettingsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.SignInSettingsClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.SignInSettingsClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client SignInSettingsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, parameters PortalSigninSettings) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/signin", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client SignInSettingsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client SignInSettingsClient) CreateOrUpdateResponder(resp *http.Response) (result PortalSigninSettings, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get get Sign-In settings. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +func (client SignInSettingsClient) Get(ctx context.Context, resourceGroupName string, serviceName string) (result PortalSigninSettings, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.SignInSettingsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, serviceName) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.SignInSettingsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.SignInSettingsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.SignInSettingsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client SignInSettingsClient) GetPreparer(ctx context.Context, resourceGroupName string, serviceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/signin", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client SignInSettingsClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client SignInSettingsClient) GetResponder(resp *http.Response) (result PortalSigninSettings, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetEntityTag gets the entity state (Etag) version of the SignInSettings. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +func (client SignInSettingsClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.SignInSettingsClient", "GetEntityTag", err.Error()) + } + + req, err := client.GetEntityTagPreparer(ctx, resourceGroupName, serviceName) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.SignInSettingsClient", "GetEntityTag", nil, "Failure preparing request") + return + } + + resp, err := client.GetEntityTagSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.SignInSettingsClient", "GetEntityTag", resp, "Failure sending request") + return + } + + result, err = client.GetEntityTagResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.SignInSettingsClient", "GetEntityTag", resp, "Failure responding to request") + } + + return +} + +// GetEntityTagPreparer prepares the GetEntityTag request. +func (client SignInSettingsClient) GetEntityTagPreparer(ctx context.Context, resourceGroupName string, serviceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsHead(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/signin", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetEntityTagSender sends the GetEntityTag request. The method will close the +// http.Response Body if it receives an error. +func (client SignInSettingsClient) GetEntityTagSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetEntityTagResponder handles the response to the GetEntityTag request. The method always +// closes the http.Response Body. +func (client SignInSettingsClient) GetEntityTagResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Update update Sign-In settings. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// parameters - update Sign-In settings. +// ifMatch - eTag of the Entity. ETag should match the current entity state from the header response of the GET +// request or it should be * for unconditional update. +func (client SignInSettingsClient) Update(ctx context.Context, resourceGroupName string, serviceName string, parameters PortalSigninSettings, ifMatch string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.SignInSettingsClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, serviceName, parameters, ifMatch) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.SignInSettingsClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.SignInSettingsClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.SignInSettingsClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client SignInSettingsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, parameters PortalSigninSettings, ifMatch string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/signin", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters), + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client SignInSettingsClient) UpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client SignInSettingsClient) UpdateResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/signupsettings.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/signupsettings.go new file mode 100644 index 000000000..944ff5399 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/signupsettings.go @@ -0,0 +1,348 @@ +package apimanagement + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// SignUpSettingsClient is the apiManagement Client +type SignUpSettingsClient struct { + BaseClient +} + +// NewSignUpSettingsClient creates an instance of the SignUpSettingsClient client. +func NewSignUpSettingsClient(subscriptionID string) SignUpSettingsClient { + return NewSignUpSettingsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewSignUpSettingsClientWithBaseURI creates an instance of the SignUpSettingsClient client. +func NewSignUpSettingsClientWithBaseURI(baseURI string, subscriptionID string) SignUpSettingsClient { + return SignUpSettingsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate create or Update Sign-Up settings. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// parameters - create or update parameters. +func (client SignUpSettingsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, parameters PortalSignupSettings) (result PortalSignupSettings, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.SignUpSettingsClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serviceName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.SignUpSettingsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.SignUpSettingsClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.SignUpSettingsClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client SignUpSettingsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, parameters PortalSignupSettings) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/signup", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client SignUpSettingsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client SignUpSettingsClient) CreateOrUpdateResponder(resp *http.Response) (result PortalSignupSettings, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get get Sign-Up settings. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +func (client SignUpSettingsClient) Get(ctx context.Context, resourceGroupName string, serviceName string) (result PortalSignupSettings, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.SignUpSettingsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, serviceName) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.SignUpSettingsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.SignUpSettingsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.SignUpSettingsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client SignUpSettingsClient) GetPreparer(ctx context.Context, resourceGroupName string, serviceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/signup", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client SignUpSettingsClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client SignUpSettingsClient) GetResponder(resp *http.Response) (result PortalSignupSettings, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetEntityTag gets the entity state (Etag) version of the SignUpSettings. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +func (client SignUpSettingsClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.SignUpSettingsClient", "GetEntityTag", err.Error()) + } + + req, err := client.GetEntityTagPreparer(ctx, resourceGroupName, serviceName) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.SignUpSettingsClient", "GetEntityTag", nil, "Failure preparing request") + return + } + + resp, err := client.GetEntityTagSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.SignUpSettingsClient", "GetEntityTag", resp, "Failure sending request") + return + } + + result, err = client.GetEntityTagResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.SignUpSettingsClient", "GetEntityTag", resp, "Failure responding to request") + } + + return +} + +// GetEntityTagPreparer prepares the GetEntityTag request. +func (client SignUpSettingsClient) GetEntityTagPreparer(ctx context.Context, resourceGroupName string, serviceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsHead(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/signup", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetEntityTagSender sends the GetEntityTag request. The method will close the +// http.Response Body if it receives an error. +func (client SignUpSettingsClient) GetEntityTagSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetEntityTagResponder handles the response to the GetEntityTag request. The method always +// closes the http.Response Body. +func (client SignUpSettingsClient) GetEntityTagResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Update update Sign-Up settings. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// parameters - update Sign-Up settings. +// ifMatch - eTag of the Entity. ETag should match the current entity state from the header response of the GET +// request or it should be * for unconditional update. +func (client SignUpSettingsClient) Update(ctx context.Context, resourceGroupName string, serviceName string, parameters PortalSignupSettings, ifMatch string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.SignUpSettingsClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, serviceName, parameters, ifMatch) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.SignUpSettingsClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.SignUpSettingsClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.SignUpSettingsClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client SignUpSettingsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, parameters PortalSignupSettings, ifMatch string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/signup", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters), + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client SignUpSettingsClient) UpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client SignUpSettingsClient) UpdateResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/subscription.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/subscription.go new file mode 100644 index 000000000..f36daa5ce --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/subscription.go @@ -0,0 +1,777 @@ +package apimanagement + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// SubscriptionClient is the apiManagement Client +type SubscriptionClient struct { + BaseClient +} + +// NewSubscriptionClient creates an instance of the SubscriptionClient client. +func NewSubscriptionClient(subscriptionID string) SubscriptionClient { + return NewSubscriptionClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewSubscriptionClientWithBaseURI creates an instance of the SubscriptionClient client. +func NewSubscriptionClientWithBaseURI(baseURI string, subscriptionID string) SubscriptionClient { + return SubscriptionClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or updates the subscription of specified user to the specified product. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// sid - subscription entity Identifier. The entity represents the association between a user and a product in +// API Management. +// parameters - create parameters. +// notify - notify change in Subscription State. +// - If false, do not send any email notification for change of state of subscription +// - If true, send email notification of change of state of subscription +// ifMatch - eTag of the Entity. Not required when creating an entity, but required when updating an entity. +func (client SubscriptionClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, sid string, parameters SubscriptionCreateParameters, notify *bool, ifMatch string) (result SubscriptionContract, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: sid, + Constraints: []validation.Constraint{{Target: "sid", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "sid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.SubscriptionCreateParameterProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.SubscriptionCreateParameterProperties.UserID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.SubscriptionCreateParameterProperties.ProductID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.SubscriptionCreateParameterProperties.DisplayName", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.SubscriptionCreateParameterProperties.DisplayName", Name: validation.MaxLength, Rule: 100, Chain: nil}, + {Target: "parameters.SubscriptionCreateParameterProperties.DisplayName", Name: validation.MinLength, Rule: 1, Chain: nil}, + }}, + {Target: "parameters.SubscriptionCreateParameterProperties.PrimaryKey", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.SubscriptionCreateParameterProperties.PrimaryKey", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "parameters.SubscriptionCreateParameterProperties.PrimaryKey", Name: validation.MinLength, Rule: 1, Chain: nil}, + }}, + {Target: "parameters.SubscriptionCreateParameterProperties.SecondaryKey", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.SubscriptionCreateParameterProperties.SecondaryKey", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "parameters.SubscriptionCreateParameterProperties.SecondaryKey", Name: validation.MinLength, Rule: 1, Chain: nil}, + }}, + }}}}}); err != nil { + return result, validation.NewError("apimanagement.SubscriptionClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serviceName, sid, parameters, notify, ifMatch) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.SubscriptionClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.SubscriptionClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.SubscriptionClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client SubscriptionClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, sid string, parameters SubscriptionCreateParameters, notify *bool, ifMatch string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "sid": autorest.Encode("path", sid), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if notify != nil { + queryParameters["notify"] = autorest.Encode("query", *notify) + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/subscriptions/{sid}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + if len(ifMatch) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client SubscriptionClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client SubscriptionClient) CreateOrUpdateResponder(resp *http.Response) (result SubscriptionContract, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes the specified subscription. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// sid - subscription entity Identifier. The entity represents the association between a user and a product in +// API Management. +// ifMatch - eTag of the Entity. ETag should match the current entity state from the header response of the GET +// request or it should be * for unconditional update. +func (client SubscriptionClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, sid string, ifMatch string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: sid, + Constraints: []validation.Constraint{{Target: "sid", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "sid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.SubscriptionClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, serviceName, sid, ifMatch) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.SubscriptionClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.SubscriptionClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.SubscriptionClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client SubscriptionClient) DeletePreparer(ctx context.Context, resourceGroupName string, serviceName string, sid string, ifMatch string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "sid": autorest.Encode("path", sid), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/subscriptions/{sid}", pathParameters), + autorest.WithQueryParameters(queryParameters), + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client SubscriptionClient) DeleteSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client SubscriptionClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the specified Subscription entity. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// sid - subscription entity Identifier. The entity represents the association between a user and a product in +// API Management. +func (client SubscriptionClient) Get(ctx context.Context, resourceGroupName string, serviceName string, sid string) (result SubscriptionContract, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: sid, + Constraints: []validation.Constraint{{Target: "sid", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "sid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.SubscriptionClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, serviceName, sid) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.SubscriptionClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.SubscriptionClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.SubscriptionClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client SubscriptionClient) GetPreparer(ctx context.Context, resourceGroupName string, serviceName string, sid string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "sid": autorest.Encode("path", sid), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/subscriptions/{sid}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client SubscriptionClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client SubscriptionClient) GetResponder(resp *http.Response) (result SubscriptionContract, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetEntityTag gets the entity state (Etag) version of the apimanagement subscription specified by its identifier. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// sid - subscription entity Identifier. The entity represents the association between a user and a product in +// API Management. +func (client SubscriptionClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, sid string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: sid, + Constraints: []validation.Constraint{{Target: "sid", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "sid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.SubscriptionClient", "GetEntityTag", err.Error()) + } + + req, err := client.GetEntityTagPreparer(ctx, resourceGroupName, serviceName, sid) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.SubscriptionClient", "GetEntityTag", nil, "Failure preparing request") + return + } + + resp, err := client.GetEntityTagSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.SubscriptionClient", "GetEntityTag", resp, "Failure sending request") + return + } + + result, err = client.GetEntityTagResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.SubscriptionClient", "GetEntityTag", resp, "Failure responding to request") + } + + return +} + +// GetEntityTagPreparer prepares the GetEntityTag request. +func (client SubscriptionClient) GetEntityTagPreparer(ctx context.Context, resourceGroupName string, serviceName string, sid string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "sid": autorest.Encode("path", sid), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsHead(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/subscriptions/{sid}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetEntityTagSender sends the GetEntityTag request. The method will close the +// http.Response Body if it receives an error. +func (client SubscriptionClient) GetEntityTagSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetEntityTagResponder handles the response to the GetEntityTag request. The method always +// closes the http.Response Body. +func (client SubscriptionClient) GetEntityTagResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// List lists all subscriptions of the API Management service instance. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// filter - | Field | Supported operators | Supported functions | +// |--------------|------------------------|---------------------------------------------| +// | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// | stateComment | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// | userId | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// | productId | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// | state | eq | | +// top - number of records to return. +// skip - number of records to skip. +func (client SubscriptionClient) List(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (result SubscriptionCollectionPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: top, + Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}}}, + {TargetValue: skip, + Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("apimanagement.SubscriptionClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName, serviceName, filter, top, skip) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.SubscriptionClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.sc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.SubscriptionClient", "List", resp, "Failure sending request") + return + } + + result.sc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.SubscriptionClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client SubscriptionClient) ListPreparer(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + if skip != nil { + queryParameters["$skip"] = autorest.Encode("query", *skip) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/subscriptions", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client SubscriptionClient) ListSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client SubscriptionClient) ListResponder(resp *http.Response) (result SubscriptionCollection, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client SubscriptionClient) listNextResults(lastResults SubscriptionCollection) (result SubscriptionCollection, err error) { + req, err := lastResults.subscriptionCollectionPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "apimanagement.SubscriptionClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "apimanagement.SubscriptionClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.SubscriptionClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client SubscriptionClient) ListComplete(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (result SubscriptionCollectionIterator, err error) { + result.page, err = client.List(ctx, resourceGroupName, serviceName, filter, top, skip) + return +} + +// RegeneratePrimaryKey regenerates primary key of existing subscription of the API Management service instance. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// sid - subscription entity Identifier. The entity represents the association between a user and a product in +// API Management. +func (client SubscriptionClient) RegeneratePrimaryKey(ctx context.Context, resourceGroupName string, serviceName string, sid string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: sid, + Constraints: []validation.Constraint{{Target: "sid", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "sid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.SubscriptionClient", "RegeneratePrimaryKey", err.Error()) + } + + req, err := client.RegeneratePrimaryKeyPreparer(ctx, resourceGroupName, serviceName, sid) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.SubscriptionClient", "RegeneratePrimaryKey", nil, "Failure preparing request") + return + } + + resp, err := client.RegeneratePrimaryKeySender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.SubscriptionClient", "RegeneratePrimaryKey", resp, "Failure sending request") + return + } + + result, err = client.RegeneratePrimaryKeyResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.SubscriptionClient", "RegeneratePrimaryKey", resp, "Failure responding to request") + } + + return +} + +// RegeneratePrimaryKeyPreparer prepares the RegeneratePrimaryKey request. +func (client SubscriptionClient) RegeneratePrimaryKeyPreparer(ctx context.Context, resourceGroupName string, serviceName string, sid string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "sid": autorest.Encode("path", sid), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/subscriptions/{sid}/regeneratePrimaryKey", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RegeneratePrimaryKeySender sends the RegeneratePrimaryKey request. The method will close the +// http.Response Body if it receives an error. +func (client SubscriptionClient) RegeneratePrimaryKeySender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// RegeneratePrimaryKeyResponder handles the response to the RegeneratePrimaryKey request. The method always +// closes the http.Response Body. +func (client SubscriptionClient) RegeneratePrimaryKeyResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// RegenerateSecondaryKey regenerates secondary key of existing subscription of the API Management service instance. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// sid - subscription entity Identifier. The entity represents the association between a user and a product in +// API Management. +func (client SubscriptionClient) RegenerateSecondaryKey(ctx context.Context, resourceGroupName string, serviceName string, sid string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: sid, + Constraints: []validation.Constraint{{Target: "sid", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "sid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.SubscriptionClient", "RegenerateSecondaryKey", err.Error()) + } + + req, err := client.RegenerateSecondaryKeyPreparer(ctx, resourceGroupName, serviceName, sid) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.SubscriptionClient", "RegenerateSecondaryKey", nil, "Failure preparing request") + return + } + + resp, err := client.RegenerateSecondaryKeySender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.SubscriptionClient", "RegenerateSecondaryKey", resp, "Failure sending request") + return + } + + result, err = client.RegenerateSecondaryKeyResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.SubscriptionClient", "RegenerateSecondaryKey", resp, "Failure responding to request") + } + + return +} + +// RegenerateSecondaryKeyPreparer prepares the RegenerateSecondaryKey request. +func (client SubscriptionClient) RegenerateSecondaryKeyPreparer(ctx context.Context, resourceGroupName string, serviceName string, sid string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "sid": autorest.Encode("path", sid), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/subscriptions/{sid}/regenerateSecondaryKey", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RegenerateSecondaryKeySender sends the RegenerateSecondaryKey request. The method will close the +// http.Response Body if it receives an error. +func (client SubscriptionClient) RegenerateSecondaryKeySender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// RegenerateSecondaryKeyResponder handles the response to the RegenerateSecondaryKey request. The method always +// closes the http.Response Body. +func (client SubscriptionClient) RegenerateSecondaryKeyResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Update updates the details of a subscription specificied by its identifier. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// sid - subscription entity Identifier. The entity represents the association between a user and a product in +// API Management. +// parameters - update parameters. +// ifMatch - eTag of the Entity. ETag should match the current entity state from the header response of the GET +// request or it should be * for unconditional update. +// notify - notify change in Subscription State. +// - If false, do not send any email notification for change of state of subscription +// - If true, send email notification of change of state of subscription +func (client SubscriptionClient) Update(ctx context.Context, resourceGroupName string, serviceName string, sid string, parameters SubscriptionUpdateParameters, ifMatch string, notify *bool) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: sid, + Constraints: []validation.Constraint{{Target: "sid", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "sid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.SubscriptionClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, serviceName, sid, parameters, ifMatch, notify) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.SubscriptionClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.SubscriptionClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.SubscriptionClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client SubscriptionClient) UpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, sid string, parameters SubscriptionUpdateParameters, ifMatch string, notify *bool) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "sid": autorest.Encode("path", sid), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if notify != nil { + queryParameters["notify"] = autorest.Encode("query", *notify) + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/subscriptions/{sid}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters), + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client SubscriptionClient) UpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client SubscriptionClient) UpdateResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/tag.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/tag.go new file mode 100644 index 000000000..3c52f09ae --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/tag.go @@ -0,0 +1,2086 @@ +package apimanagement + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// TagClient is the apiManagement Client +type TagClient struct { + BaseClient +} + +// NewTagClient creates an instance of the TagClient client. +func NewTagClient(subscriptionID string) TagClient { + return NewTagClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewTagClientWithBaseURI creates an instance of the TagClient client. +func NewTagClientWithBaseURI(baseURI string, subscriptionID string) TagClient { + return TagClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// AssignToAPI assign tag to the Api. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// apiid - API revision identifier. Must be unique in the current API Management service instance. Non-current +// revision has ;rev=n as a suffix where n is the revision number. +// tagID - tag identifier. Must be unique in the current API Management service instance. +// ifMatch - eTag of the Entity. Not required when creating an entity, but required when updating an entity. +func (client TagClient) AssignToAPI(ctx context.Context, resourceGroupName string, serviceName string, apiid string, tagID string, ifMatch string) (result TagContract, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: apiid, + Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "apiid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}, + {TargetValue: tagID, + Constraints: []validation.Constraint{{Target: "tagID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "tagID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "tagID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.TagClient", "AssignToAPI", err.Error()) + } + + req, err := client.AssignToAPIPreparer(ctx, resourceGroupName, serviceName, apiid, tagID, ifMatch) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.TagClient", "AssignToAPI", nil, "Failure preparing request") + return + } + + resp, err := client.AssignToAPISender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.TagClient", "AssignToAPI", resp, "Failure sending request") + return + } + + result, err = client.AssignToAPIResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.TagClient", "AssignToAPI", resp, "Failure responding to request") + } + + return +} + +// AssignToAPIPreparer prepares the AssignToAPI request. +func (client TagClient) AssignToAPIPreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, tagID string, ifMatch string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "apiId": autorest.Encode("path", apiid), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "tagId": autorest.Encode("path", tagID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tags/{tagId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if len(ifMatch) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// AssignToAPISender sends the AssignToAPI request. The method will close the +// http.Response Body if it receives an error. +func (client TagClient) AssignToAPISender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// AssignToAPIResponder handles the response to the AssignToAPI request. The method always +// closes the http.Response Body. +func (client TagClient) AssignToAPIResponder(resp *http.Response) (result TagContract, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// AssignToOperation assign tag to the Operation. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// apiid - API revision identifier. Must be unique in the current API Management service instance. Non-current +// revision has ;rev=n as a suffix where n is the revision number. +// operationID - operation identifier within an API. Must be unique in the current API Management service +// instance. +// tagID - tag identifier. Must be unique in the current API Management service instance. +// ifMatch - eTag of the Entity. Not required when creating an entity, but required when updating an entity. +func (client TagClient) AssignToOperation(ctx context.Context, resourceGroupName string, serviceName string, apiid string, operationID string, tagID string, ifMatch string) (result TagContract, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: apiid, + Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "apiid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}, + {TargetValue: operationID, + Constraints: []validation.Constraint{{Target: "operationID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "operationID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "operationID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {TargetValue: tagID, + Constraints: []validation.Constraint{{Target: "tagID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "tagID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "tagID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.TagClient", "AssignToOperation", err.Error()) + } + + req, err := client.AssignToOperationPreparer(ctx, resourceGroupName, serviceName, apiid, operationID, tagID, ifMatch) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.TagClient", "AssignToOperation", nil, "Failure preparing request") + return + } + + resp, err := client.AssignToOperationSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.TagClient", "AssignToOperation", resp, "Failure sending request") + return + } + + result, err = client.AssignToOperationResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.TagClient", "AssignToOperation", resp, "Failure responding to request") + } + + return +} + +// AssignToOperationPreparer prepares the AssignToOperation request. +func (client TagClient) AssignToOperationPreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, operationID string, tagID string, ifMatch string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "apiId": autorest.Encode("path", apiid), + "operationId": autorest.Encode("path", operationID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "tagId": autorest.Encode("path", tagID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}/tags/{tagId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if len(ifMatch) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// AssignToOperationSender sends the AssignToOperation request. The method will close the +// http.Response Body if it receives an error. +func (client TagClient) AssignToOperationSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// AssignToOperationResponder handles the response to the AssignToOperation request. The method always +// closes the http.Response Body. +func (client TagClient) AssignToOperationResponder(resp *http.Response) (result TagContract, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// AssignToProduct assign tag to the Product. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// productID - product identifier. Must be unique in the current API Management service instance. +// tagID - tag identifier. Must be unique in the current API Management service instance. +// ifMatch - eTag of the Entity. Not required when creating an entity, but required when updating an entity. +func (client TagClient) AssignToProduct(ctx context.Context, resourceGroupName string, serviceName string, productID string, tagID string, ifMatch string) (result TagContract, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: productID, + Constraints: []validation.Constraint{{Target: "productID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "productID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "productID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {TargetValue: tagID, + Constraints: []validation.Constraint{{Target: "tagID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "tagID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "tagID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.TagClient", "AssignToProduct", err.Error()) + } + + req, err := client.AssignToProductPreparer(ctx, resourceGroupName, serviceName, productID, tagID, ifMatch) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.TagClient", "AssignToProduct", nil, "Failure preparing request") + return + } + + resp, err := client.AssignToProductSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.TagClient", "AssignToProduct", resp, "Failure sending request") + return + } + + result, err = client.AssignToProductResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.TagClient", "AssignToProduct", resp, "Failure responding to request") + } + + return +} + +// AssignToProductPreparer prepares the AssignToProduct request. +func (client TagClient) AssignToProductPreparer(ctx context.Context, resourceGroupName string, serviceName string, productID string, tagID string, ifMatch string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "productId": autorest.Encode("path", productID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "tagId": autorest.Encode("path", tagID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/tags/{tagId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if len(ifMatch) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// AssignToProductSender sends the AssignToProduct request. The method will close the +// http.Response Body if it receives an error. +func (client TagClient) AssignToProductSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// AssignToProductResponder handles the response to the AssignToProduct request. The method always +// closes the http.Response Body. +func (client TagClient) AssignToProductResponder(resp *http.Response) (result TagContract, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CreateOrUpdate creates a tag. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// tagID - tag identifier. Must be unique in the current API Management service instance. +// parameters - create parameters. +func (client TagClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, tagID string, parameters TagCreateUpdateParameters) (result TagContract, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: tagID, + Constraints: []validation.Constraint{{Target: "tagID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "tagID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "tagID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.TagContractProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.TagContractProperties.DisplayName", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.TagContractProperties.DisplayName", Name: validation.MaxLength, Rule: 160, Chain: nil}, + {Target: "parameters.TagContractProperties.DisplayName", Name: validation.MinLength, Rule: 1, Chain: nil}, + }}, + }}}}}); err != nil { + return result, validation.NewError("apimanagement.TagClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serviceName, tagID, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.TagClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.TagClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.TagClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client TagClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, tagID string, parameters TagCreateUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "tagId": autorest.Encode("path", tagID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tags/{tagId}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client TagClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client TagClient) CreateOrUpdateResponder(resp *http.Response) (result TagContract, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes specific tag of the API Management service instance. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// tagID - tag identifier. Must be unique in the current API Management service instance. +// ifMatch - eTag of the Entity. ETag should match the current entity state from the header response of the GET +// request or it should be * for unconditional update. +func (client TagClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, tagID string, ifMatch string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: tagID, + Constraints: []validation.Constraint{{Target: "tagID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "tagID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "tagID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.TagClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, serviceName, tagID, ifMatch) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.TagClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.TagClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.TagClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client TagClient) DeletePreparer(ctx context.Context, resourceGroupName string, serviceName string, tagID string, ifMatch string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "tagId": autorest.Encode("path", tagID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tags/{tagId}", pathParameters), + autorest.WithQueryParameters(queryParameters), + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client TagClient) DeleteSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client TagClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// DetachFromAPI detach the tag from the Api. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// apiid - API revision identifier. Must be unique in the current API Management service instance. Non-current +// revision has ;rev=n as a suffix where n is the revision number. +// tagID - tag identifier. Must be unique in the current API Management service instance. +// ifMatch - eTag of the Entity. ETag should match the current entity state from the header response of the GET +// request or it should be * for unconditional update. +func (client TagClient) DetachFromAPI(ctx context.Context, resourceGroupName string, serviceName string, apiid string, tagID string, ifMatch string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: apiid, + Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "apiid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}, + {TargetValue: tagID, + Constraints: []validation.Constraint{{Target: "tagID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "tagID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "tagID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.TagClient", "DetachFromAPI", err.Error()) + } + + req, err := client.DetachFromAPIPreparer(ctx, resourceGroupName, serviceName, apiid, tagID, ifMatch) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.TagClient", "DetachFromAPI", nil, "Failure preparing request") + return + } + + resp, err := client.DetachFromAPISender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.TagClient", "DetachFromAPI", resp, "Failure sending request") + return + } + + result, err = client.DetachFromAPIResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.TagClient", "DetachFromAPI", resp, "Failure responding to request") + } + + return +} + +// DetachFromAPIPreparer prepares the DetachFromAPI request. +func (client TagClient) DetachFromAPIPreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, tagID string, ifMatch string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "apiId": autorest.Encode("path", apiid), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "tagId": autorest.Encode("path", tagID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tags/{tagId}", pathParameters), + autorest.WithQueryParameters(queryParameters), + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DetachFromAPISender sends the DetachFromAPI request. The method will close the +// http.Response Body if it receives an error. +func (client TagClient) DetachFromAPISender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// DetachFromAPIResponder handles the response to the DetachFromAPI request. The method always +// closes the http.Response Body. +func (client TagClient) DetachFromAPIResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// DetachFromOperation detach the tag from the Operation. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// apiid - API revision identifier. Must be unique in the current API Management service instance. Non-current +// revision has ;rev=n as a suffix where n is the revision number. +// operationID - operation identifier within an API. Must be unique in the current API Management service +// instance. +// tagID - tag identifier. Must be unique in the current API Management service instance. +// ifMatch - eTag of the Entity. ETag should match the current entity state from the header response of the GET +// request or it should be * for unconditional update. +func (client TagClient) DetachFromOperation(ctx context.Context, resourceGroupName string, serviceName string, apiid string, operationID string, tagID string, ifMatch string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: apiid, + Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "apiid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}, + {TargetValue: operationID, + Constraints: []validation.Constraint{{Target: "operationID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "operationID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "operationID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {TargetValue: tagID, + Constraints: []validation.Constraint{{Target: "tagID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "tagID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "tagID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.TagClient", "DetachFromOperation", err.Error()) + } + + req, err := client.DetachFromOperationPreparer(ctx, resourceGroupName, serviceName, apiid, operationID, tagID, ifMatch) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.TagClient", "DetachFromOperation", nil, "Failure preparing request") + return + } + + resp, err := client.DetachFromOperationSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.TagClient", "DetachFromOperation", resp, "Failure sending request") + return + } + + result, err = client.DetachFromOperationResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.TagClient", "DetachFromOperation", resp, "Failure responding to request") + } + + return +} + +// DetachFromOperationPreparer prepares the DetachFromOperation request. +func (client TagClient) DetachFromOperationPreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, operationID string, tagID string, ifMatch string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "apiId": autorest.Encode("path", apiid), + "operationId": autorest.Encode("path", operationID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "tagId": autorest.Encode("path", tagID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}/tags/{tagId}", pathParameters), + autorest.WithQueryParameters(queryParameters), + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DetachFromOperationSender sends the DetachFromOperation request. The method will close the +// http.Response Body if it receives an error. +func (client TagClient) DetachFromOperationSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// DetachFromOperationResponder handles the response to the DetachFromOperation request. The method always +// closes the http.Response Body. +func (client TagClient) DetachFromOperationResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// DetachFromProduct detach the tag from the Product. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// productID - product identifier. Must be unique in the current API Management service instance. +// tagID - tag identifier. Must be unique in the current API Management service instance. +// ifMatch - eTag of the Entity. ETag should match the current entity state from the header response of the GET +// request or it should be * for unconditional update. +func (client TagClient) DetachFromProduct(ctx context.Context, resourceGroupName string, serviceName string, productID string, tagID string, ifMatch string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: productID, + Constraints: []validation.Constraint{{Target: "productID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "productID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "productID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {TargetValue: tagID, + Constraints: []validation.Constraint{{Target: "tagID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "tagID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "tagID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.TagClient", "DetachFromProduct", err.Error()) + } + + req, err := client.DetachFromProductPreparer(ctx, resourceGroupName, serviceName, productID, tagID, ifMatch) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.TagClient", "DetachFromProduct", nil, "Failure preparing request") + return + } + + resp, err := client.DetachFromProductSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.TagClient", "DetachFromProduct", resp, "Failure sending request") + return + } + + result, err = client.DetachFromProductResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.TagClient", "DetachFromProduct", resp, "Failure responding to request") + } + + return +} + +// DetachFromProductPreparer prepares the DetachFromProduct request. +func (client TagClient) DetachFromProductPreparer(ctx context.Context, resourceGroupName string, serviceName string, productID string, tagID string, ifMatch string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "productId": autorest.Encode("path", productID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "tagId": autorest.Encode("path", tagID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/tags/{tagId}", pathParameters), + autorest.WithQueryParameters(queryParameters), + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DetachFromProductSender sends the DetachFromProduct request. The method will close the +// http.Response Body if it receives an error. +func (client TagClient) DetachFromProductSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// DetachFromProductResponder handles the response to the DetachFromProduct request. The method always +// closes the http.Response Body. +func (client TagClient) DetachFromProductResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the details of the tag specified by its identifier. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// tagID - tag identifier. Must be unique in the current API Management service instance. +func (client TagClient) Get(ctx context.Context, resourceGroupName string, serviceName string, tagID string) (result TagContract, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: tagID, + Constraints: []validation.Constraint{{Target: "tagID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "tagID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "tagID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.TagClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, serviceName, tagID) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.TagClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.TagClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.TagClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client TagClient) GetPreparer(ctx context.Context, resourceGroupName string, serviceName string, tagID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "tagId": autorest.Encode("path", tagID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tags/{tagId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client TagClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client TagClient) GetResponder(resp *http.Response) (result TagContract, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetByAPI get tag associated with the API. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// apiid - API revision identifier. Must be unique in the current API Management service instance. Non-current +// revision has ;rev=n as a suffix where n is the revision number. +// tagID - tag identifier. Must be unique in the current API Management service instance. +func (client TagClient) GetByAPI(ctx context.Context, resourceGroupName string, serviceName string, apiid string, tagID string) (result TagContract, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: apiid, + Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "apiid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}, + {TargetValue: tagID, + Constraints: []validation.Constraint{{Target: "tagID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "tagID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "tagID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.TagClient", "GetByAPI", err.Error()) + } + + req, err := client.GetByAPIPreparer(ctx, resourceGroupName, serviceName, apiid, tagID) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.TagClient", "GetByAPI", nil, "Failure preparing request") + return + } + + resp, err := client.GetByAPISender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.TagClient", "GetByAPI", resp, "Failure sending request") + return + } + + result, err = client.GetByAPIResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.TagClient", "GetByAPI", resp, "Failure responding to request") + } + + return +} + +// GetByAPIPreparer prepares the GetByAPI request. +func (client TagClient) GetByAPIPreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, tagID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "apiId": autorest.Encode("path", apiid), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "tagId": autorest.Encode("path", tagID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tags/{tagId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetByAPISender sends the GetByAPI request. The method will close the +// http.Response Body if it receives an error. +func (client TagClient) GetByAPISender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetByAPIResponder handles the response to the GetByAPI request. The method always +// closes the http.Response Body. +func (client TagClient) GetByAPIResponder(resp *http.Response) (result TagContract, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetByOperation get tag associated with the Operation. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// apiid - API revision identifier. Must be unique in the current API Management service instance. Non-current +// revision has ;rev=n as a suffix where n is the revision number. +// operationID - operation identifier within an API. Must be unique in the current API Management service +// instance. +// tagID - tag identifier. Must be unique in the current API Management service instance. +func (client TagClient) GetByOperation(ctx context.Context, resourceGroupName string, serviceName string, apiid string, operationID string, tagID string) (result TagContract, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: apiid, + Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "apiid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}, + {TargetValue: operationID, + Constraints: []validation.Constraint{{Target: "operationID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "operationID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "operationID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {TargetValue: tagID, + Constraints: []validation.Constraint{{Target: "tagID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "tagID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "tagID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.TagClient", "GetByOperation", err.Error()) + } + + req, err := client.GetByOperationPreparer(ctx, resourceGroupName, serviceName, apiid, operationID, tagID) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.TagClient", "GetByOperation", nil, "Failure preparing request") + return + } + + resp, err := client.GetByOperationSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.TagClient", "GetByOperation", resp, "Failure sending request") + return + } + + result, err = client.GetByOperationResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.TagClient", "GetByOperation", resp, "Failure responding to request") + } + + return +} + +// GetByOperationPreparer prepares the GetByOperation request. +func (client TagClient) GetByOperationPreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, operationID string, tagID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "apiId": autorest.Encode("path", apiid), + "operationId": autorest.Encode("path", operationID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "tagId": autorest.Encode("path", tagID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}/tags/{tagId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetByOperationSender sends the GetByOperation request. The method will close the +// http.Response Body if it receives an error. +func (client TagClient) GetByOperationSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetByOperationResponder handles the response to the GetByOperation request. The method always +// closes the http.Response Body. +func (client TagClient) GetByOperationResponder(resp *http.Response) (result TagContract, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetByProduct get tag associated with the Product. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// productID - product identifier. Must be unique in the current API Management service instance. +// tagID - tag identifier. Must be unique in the current API Management service instance. +func (client TagClient) GetByProduct(ctx context.Context, resourceGroupName string, serviceName string, productID string, tagID string) (result TagContract, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: productID, + Constraints: []validation.Constraint{{Target: "productID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "productID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "productID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {TargetValue: tagID, + Constraints: []validation.Constraint{{Target: "tagID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "tagID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "tagID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.TagClient", "GetByProduct", err.Error()) + } + + req, err := client.GetByProductPreparer(ctx, resourceGroupName, serviceName, productID, tagID) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.TagClient", "GetByProduct", nil, "Failure preparing request") + return + } + + resp, err := client.GetByProductSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.TagClient", "GetByProduct", resp, "Failure sending request") + return + } + + result, err = client.GetByProductResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.TagClient", "GetByProduct", resp, "Failure responding to request") + } + + return +} + +// GetByProductPreparer prepares the GetByProduct request. +func (client TagClient) GetByProductPreparer(ctx context.Context, resourceGroupName string, serviceName string, productID string, tagID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "productId": autorest.Encode("path", productID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "tagId": autorest.Encode("path", tagID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/tags/{tagId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetByProductSender sends the GetByProduct request. The method will close the +// http.Response Body if it receives an error. +func (client TagClient) GetByProductSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetByProductResponder handles the response to the GetByProduct request. The method always +// closes the http.Response Body. +func (client TagClient) GetByProductResponder(resp *http.Response) (result TagContract, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetEntityState gets the entity state version of the tag specified by its identifier. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// tagID - tag identifier. Must be unique in the current API Management service instance. +func (client TagClient) GetEntityState(ctx context.Context, resourceGroupName string, serviceName string, tagID string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: tagID, + Constraints: []validation.Constraint{{Target: "tagID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "tagID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "tagID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.TagClient", "GetEntityState", err.Error()) + } + + req, err := client.GetEntityStatePreparer(ctx, resourceGroupName, serviceName, tagID) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.TagClient", "GetEntityState", nil, "Failure preparing request") + return + } + + resp, err := client.GetEntityStateSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.TagClient", "GetEntityState", resp, "Failure sending request") + return + } + + result, err = client.GetEntityStateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.TagClient", "GetEntityState", resp, "Failure responding to request") + } + + return +} + +// GetEntityStatePreparer prepares the GetEntityState request. +func (client TagClient) GetEntityStatePreparer(ctx context.Context, resourceGroupName string, serviceName string, tagID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "tagId": autorest.Encode("path", tagID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsHead(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tags/{tagId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetEntityStateSender sends the GetEntityState request. The method will close the +// http.Response Body if it receives an error. +func (client TagClient) GetEntityStateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetEntityStateResponder handles the response to the GetEntityState request. The method always +// closes the http.Response Body. +func (client TagClient) GetEntityStateResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// GetEntityStateByAPI gets the entity state version of the tag specified by its identifier. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// apiid - API revision identifier. Must be unique in the current API Management service instance. Non-current +// revision has ;rev=n as a suffix where n is the revision number. +// tagID - tag identifier. Must be unique in the current API Management service instance. +func (client TagClient) GetEntityStateByAPI(ctx context.Context, resourceGroupName string, serviceName string, apiid string, tagID string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: apiid, + Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "apiid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}, + {TargetValue: tagID, + Constraints: []validation.Constraint{{Target: "tagID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "tagID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "tagID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.TagClient", "GetEntityStateByAPI", err.Error()) + } + + req, err := client.GetEntityStateByAPIPreparer(ctx, resourceGroupName, serviceName, apiid, tagID) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.TagClient", "GetEntityStateByAPI", nil, "Failure preparing request") + return + } + + resp, err := client.GetEntityStateByAPISender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.TagClient", "GetEntityStateByAPI", resp, "Failure sending request") + return + } + + result, err = client.GetEntityStateByAPIResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.TagClient", "GetEntityStateByAPI", resp, "Failure responding to request") + } + + return +} + +// GetEntityStateByAPIPreparer prepares the GetEntityStateByAPI request. +func (client TagClient) GetEntityStateByAPIPreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, tagID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "apiId": autorest.Encode("path", apiid), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "tagId": autorest.Encode("path", tagID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsHead(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tags/{tagId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetEntityStateByAPISender sends the GetEntityStateByAPI request. The method will close the +// http.Response Body if it receives an error. +func (client TagClient) GetEntityStateByAPISender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetEntityStateByAPIResponder handles the response to the GetEntityStateByAPI request. The method always +// closes the http.Response Body. +func (client TagClient) GetEntityStateByAPIResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// GetEntityStateByOperation gets the entity state version of the tag specified by its identifier. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// apiid - API revision identifier. Must be unique in the current API Management service instance. Non-current +// revision has ;rev=n as a suffix where n is the revision number. +// operationID - operation identifier within an API. Must be unique in the current API Management service +// instance. +// tagID - tag identifier. Must be unique in the current API Management service instance. +func (client TagClient) GetEntityStateByOperation(ctx context.Context, resourceGroupName string, serviceName string, apiid string, operationID string, tagID string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: apiid, + Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "apiid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}, + {TargetValue: operationID, + Constraints: []validation.Constraint{{Target: "operationID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "operationID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "operationID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {TargetValue: tagID, + Constraints: []validation.Constraint{{Target: "tagID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "tagID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "tagID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.TagClient", "GetEntityStateByOperation", err.Error()) + } + + req, err := client.GetEntityStateByOperationPreparer(ctx, resourceGroupName, serviceName, apiid, operationID, tagID) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.TagClient", "GetEntityStateByOperation", nil, "Failure preparing request") + return + } + + resp, err := client.GetEntityStateByOperationSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.TagClient", "GetEntityStateByOperation", resp, "Failure sending request") + return + } + + result, err = client.GetEntityStateByOperationResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.TagClient", "GetEntityStateByOperation", resp, "Failure responding to request") + } + + return +} + +// GetEntityStateByOperationPreparer prepares the GetEntityStateByOperation request. +func (client TagClient) GetEntityStateByOperationPreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, operationID string, tagID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "apiId": autorest.Encode("path", apiid), + "operationId": autorest.Encode("path", operationID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "tagId": autorest.Encode("path", tagID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsHead(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}/tags/{tagId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetEntityStateByOperationSender sends the GetEntityStateByOperation request. The method will close the +// http.Response Body if it receives an error. +func (client TagClient) GetEntityStateByOperationSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetEntityStateByOperationResponder handles the response to the GetEntityStateByOperation request. The method always +// closes the http.Response Body. +func (client TagClient) GetEntityStateByOperationResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// GetEntityStateByProduct gets the entity state version of the tag specified by its identifier. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// productID - product identifier. Must be unique in the current API Management service instance. +// tagID - tag identifier. Must be unique in the current API Management service instance. +func (client TagClient) GetEntityStateByProduct(ctx context.Context, resourceGroupName string, serviceName string, productID string, tagID string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: productID, + Constraints: []validation.Constraint{{Target: "productID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "productID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "productID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {TargetValue: tagID, + Constraints: []validation.Constraint{{Target: "tagID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "tagID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "tagID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.TagClient", "GetEntityStateByProduct", err.Error()) + } + + req, err := client.GetEntityStateByProductPreparer(ctx, resourceGroupName, serviceName, productID, tagID) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.TagClient", "GetEntityStateByProduct", nil, "Failure preparing request") + return + } + + resp, err := client.GetEntityStateByProductSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.TagClient", "GetEntityStateByProduct", resp, "Failure sending request") + return + } + + result, err = client.GetEntityStateByProductResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.TagClient", "GetEntityStateByProduct", resp, "Failure responding to request") + } + + return +} + +// GetEntityStateByProductPreparer prepares the GetEntityStateByProduct request. +func (client TagClient) GetEntityStateByProductPreparer(ctx context.Context, resourceGroupName string, serviceName string, productID string, tagID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "productId": autorest.Encode("path", productID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "tagId": autorest.Encode("path", tagID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsHead(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/tags/{tagId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetEntityStateByProductSender sends the GetEntityStateByProduct request. The method will close the +// http.Response Body if it receives an error. +func (client TagClient) GetEntityStateByProductSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetEntityStateByProductResponder handles the response to the GetEntityStateByProduct request. The method always +// closes the http.Response Body. +func (client TagClient) GetEntityStateByProductResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// ListByAPI lists all Tags associated with the API. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// apiid - API revision identifier. Must be unique in the current API Management service instance. Non-current +// revision has ;rev=n as a suffix where n is the revision number. +// filter - | Field | Supported operators | Supported functions | +// |-------------|------------------------|---------------------------------------------| +// | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// top - number of records to return. +// skip - number of records to skip. +func (client TagClient) ListByAPI(ctx context.Context, resourceGroupName string, serviceName string, apiid string, filter string, top *int32, skip *int32) (result TagCollectionPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: apiid, + Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "apiid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}, + {TargetValue: top, + Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}}}, + {TargetValue: skip, + Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("apimanagement.TagClient", "ListByAPI", err.Error()) + } + + result.fn = client.listByAPINextResults + req, err := client.ListByAPIPreparer(ctx, resourceGroupName, serviceName, apiid, filter, top, skip) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.TagClient", "ListByAPI", nil, "Failure preparing request") + return + } + + resp, err := client.ListByAPISender(req) + if err != nil { + result.tc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.TagClient", "ListByAPI", resp, "Failure sending request") + return + } + + result.tc, err = client.ListByAPIResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.TagClient", "ListByAPI", resp, "Failure responding to request") + } + + return +} + +// ListByAPIPreparer prepares the ListByAPI request. +func (client TagClient) ListByAPIPreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, filter string, top *int32, skip *int32) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "apiId": autorest.Encode("path", apiid), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + if skip != nil { + queryParameters["$skip"] = autorest.Encode("query", *skip) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tags", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByAPISender sends the ListByAPI request. The method will close the +// http.Response Body if it receives an error. +func (client TagClient) ListByAPISender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByAPIResponder handles the response to the ListByAPI request. The method always +// closes the http.Response Body. +func (client TagClient) ListByAPIResponder(resp *http.Response) (result TagCollection, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByAPINextResults retrieves the next set of results, if any. +func (client TagClient) listByAPINextResults(lastResults TagCollection) (result TagCollection, err error) { + req, err := lastResults.tagCollectionPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "apimanagement.TagClient", "listByAPINextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByAPISender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "apimanagement.TagClient", "listByAPINextResults", resp, "Failure sending next results request") + } + result, err = client.ListByAPIResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.TagClient", "listByAPINextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByAPIComplete enumerates all values, automatically crossing page boundaries as required. +func (client TagClient) ListByAPIComplete(ctx context.Context, resourceGroupName string, serviceName string, apiid string, filter string, top *int32, skip *int32) (result TagCollectionIterator, err error) { + result.page, err = client.ListByAPI(ctx, resourceGroupName, serviceName, apiid, filter, top, skip) + return +} + +// ListByOperation lists all Tags associated with the Operation. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// apiid - API revision identifier. Must be unique in the current API Management service instance. Non-current +// revision has ;rev=n as a suffix where n is the revision number. +// operationID - operation identifier within an API. Must be unique in the current API Management service +// instance. +// filter - | Field | Supported operators | Supported functions | +// |-------------|------------------------|---------------------------------------------| +// | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// | method | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// | description | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// | urlTemplate | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// top - number of records to return. +// skip - number of records to skip. +func (client TagClient) ListByOperation(ctx context.Context, resourceGroupName string, serviceName string, apiid string, operationID string, filter string, top *int32, skip *int32) (result TagCollectionPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: apiid, + Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "apiid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}, + {TargetValue: operationID, + Constraints: []validation.Constraint{{Target: "operationID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "operationID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "operationID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {TargetValue: top, + Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}}}, + {TargetValue: skip, + Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("apimanagement.TagClient", "ListByOperation", err.Error()) + } + + result.fn = client.listByOperationNextResults + req, err := client.ListByOperationPreparer(ctx, resourceGroupName, serviceName, apiid, operationID, filter, top, skip) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.TagClient", "ListByOperation", nil, "Failure preparing request") + return + } + + resp, err := client.ListByOperationSender(req) + if err != nil { + result.tc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.TagClient", "ListByOperation", resp, "Failure sending request") + return + } + + result.tc, err = client.ListByOperationResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.TagClient", "ListByOperation", resp, "Failure responding to request") + } + + return +} + +// ListByOperationPreparer prepares the ListByOperation request. +func (client TagClient) ListByOperationPreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, operationID string, filter string, top *int32, skip *int32) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "apiId": autorest.Encode("path", apiid), + "operationId": autorest.Encode("path", operationID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + if skip != nil { + queryParameters["$skip"] = autorest.Encode("query", *skip) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}/tags", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByOperationSender sends the ListByOperation request. The method will close the +// http.Response Body if it receives an error. +func (client TagClient) ListByOperationSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByOperationResponder handles the response to the ListByOperation request. The method always +// closes the http.Response Body. +func (client TagClient) ListByOperationResponder(resp *http.Response) (result TagCollection, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByOperationNextResults retrieves the next set of results, if any. +func (client TagClient) listByOperationNextResults(lastResults TagCollection) (result TagCollection, err error) { + req, err := lastResults.tagCollectionPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "apimanagement.TagClient", "listByOperationNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByOperationSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "apimanagement.TagClient", "listByOperationNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByOperationResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.TagClient", "listByOperationNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByOperationComplete enumerates all values, automatically crossing page boundaries as required. +func (client TagClient) ListByOperationComplete(ctx context.Context, resourceGroupName string, serviceName string, apiid string, operationID string, filter string, top *int32, skip *int32) (result TagCollectionIterator, err error) { + result.page, err = client.ListByOperation(ctx, resourceGroupName, serviceName, apiid, operationID, filter, top, skip) + return +} + +// ListByProduct lists all Tags associated with the Product. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// productID - product identifier. Must be unique in the current API Management service instance. +// filter - | Field | Supported operators | Supported functions | +// |-------------|------------------------|---------------------------------------------| +// | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// top - number of records to return. +// skip - number of records to skip. +func (client TagClient) ListByProduct(ctx context.Context, resourceGroupName string, serviceName string, productID string, filter string, top *int32, skip *int32) (result TagCollectionPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: productID, + Constraints: []validation.Constraint{{Target: "productID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "productID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "productID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {TargetValue: top, + Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}}}, + {TargetValue: skip, + Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("apimanagement.TagClient", "ListByProduct", err.Error()) + } + + result.fn = client.listByProductNextResults + req, err := client.ListByProductPreparer(ctx, resourceGroupName, serviceName, productID, filter, top, skip) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.TagClient", "ListByProduct", nil, "Failure preparing request") + return + } + + resp, err := client.ListByProductSender(req) + if err != nil { + result.tc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.TagClient", "ListByProduct", resp, "Failure sending request") + return + } + + result.tc, err = client.ListByProductResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.TagClient", "ListByProduct", resp, "Failure responding to request") + } + + return +} + +// ListByProductPreparer prepares the ListByProduct request. +func (client TagClient) ListByProductPreparer(ctx context.Context, resourceGroupName string, serviceName string, productID string, filter string, top *int32, skip *int32) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "productId": autorest.Encode("path", productID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + if skip != nil { + queryParameters["$skip"] = autorest.Encode("query", *skip) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/tags", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByProductSender sends the ListByProduct request. The method will close the +// http.Response Body if it receives an error. +func (client TagClient) ListByProductSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByProductResponder handles the response to the ListByProduct request. The method always +// closes the http.Response Body. +func (client TagClient) ListByProductResponder(resp *http.Response) (result TagCollection, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByProductNextResults retrieves the next set of results, if any. +func (client TagClient) listByProductNextResults(lastResults TagCollection) (result TagCollection, err error) { + req, err := lastResults.tagCollectionPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "apimanagement.TagClient", "listByProductNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByProductSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "apimanagement.TagClient", "listByProductNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByProductResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.TagClient", "listByProductNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByProductComplete enumerates all values, automatically crossing page boundaries as required. +func (client TagClient) ListByProductComplete(ctx context.Context, resourceGroupName string, serviceName string, productID string, filter string, top *int32, skip *int32) (result TagCollectionIterator, err error) { + result.page, err = client.ListByProduct(ctx, resourceGroupName, serviceName, productID, filter, top, skip) + return +} + +// ListByService lists a collection of tags defined within a service instance. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// filter - | Field | Supported operators | Supported functions | +// |-------------|------------------------|---------------------------------------------| +// | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// top - number of records to return. +// skip - number of records to skip. +func (client TagClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (result TagCollectionPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: top, + Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}}}, + {TargetValue: skip, + Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("apimanagement.TagClient", "ListByService", err.Error()) + } + + result.fn = client.listByServiceNextResults + req, err := client.ListByServicePreparer(ctx, resourceGroupName, serviceName, filter, top, skip) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.TagClient", "ListByService", nil, "Failure preparing request") + return + } + + resp, err := client.ListByServiceSender(req) + if err != nil { + result.tc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.TagClient", "ListByService", resp, "Failure sending request") + return + } + + result.tc, err = client.ListByServiceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.TagClient", "ListByService", resp, "Failure responding to request") + } + + return +} + +// ListByServicePreparer prepares the ListByService request. +func (client TagClient) ListByServicePreparer(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + if skip != nil { + queryParameters["$skip"] = autorest.Encode("query", *skip) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tags", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByServiceSender sends the ListByService request. The method will close the +// http.Response Body if it receives an error. +func (client TagClient) ListByServiceSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByServiceResponder handles the response to the ListByService request. The method always +// closes the http.Response Body. +func (client TagClient) ListByServiceResponder(resp *http.Response) (result TagCollection, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByServiceNextResults retrieves the next set of results, if any. +func (client TagClient) listByServiceNextResults(lastResults TagCollection) (result TagCollection, err error) { + req, err := lastResults.tagCollectionPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "apimanagement.TagClient", "listByServiceNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByServiceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "apimanagement.TagClient", "listByServiceNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByServiceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.TagClient", "listByServiceNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByServiceComplete enumerates all values, automatically crossing page boundaries as required. +func (client TagClient) ListByServiceComplete(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (result TagCollectionIterator, err error) { + result.page, err = client.ListByService(ctx, resourceGroupName, serviceName, filter, top, skip) + return +} + +// Update updates the details of the tag specified by its identifier. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// tagID - tag identifier. Must be unique in the current API Management service instance. +// parameters - update parameters. +// ifMatch - eTag of the Entity. ETag should match the current entity state from the header response of the GET +// request or it should be * for unconditional update. +func (client TagClient) Update(ctx context.Context, resourceGroupName string, serviceName string, tagID string, parameters TagCreateUpdateParameters, ifMatch string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: tagID, + Constraints: []validation.Constraint{{Target: "tagID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "tagID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "tagID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.TagClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, serviceName, tagID, parameters, ifMatch) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.TagClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.TagClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.TagClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client TagClient) UpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, tagID string, parameters TagCreateUpdateParameters, ifMatch string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "tagId": autorest.Encode("path", tagID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tags/{tagId}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters), + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client TagClient) UpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client TagClient) UpdateResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/tagdescription.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/tagdescription.go new file mode 100644 index 000000000..fbd95fb62 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/tagdescription.go @@ -0,0 +1,539 @@ +package apimanagement + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// TagDescriptionClient is the apiManagement Client +type TagDescriptionClient struct { + BaseClient +} + +// NewTagDescriptionClient creates an instance of the TagDescriptionClient client. +func NewTagDescriptionClient(subscriptionID string) TagDescriptionClient { + return NewTagDescriptionClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewTagDescriptionClientWithBaseURI creates an instance of the TagDescriptionClient client. +func NewTagDescriptionClientWithBaseURI(baseURI string, subscriptionID string) TagDescriptionClient { + return TagDescriptionClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate create/Update tag fescription in scope of the Api. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// apiid - API revision identifier. Must be unique in the current API Management service instance. Non-current +// revision has ;rev=n as a suffix where n is the revision number. +// tagID - tag identifier. Must be unique in the current API Management service instance. +// parameters - create parameters. +// ifMatch - eTag of the Entity. Not required when creating an entity, but required when updating an entity. +func (client TagDescriptionClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, apiid string, tagID string, parameters TagDescriptionCreateParameters, ifMatch string) (result TagDescriptionContract, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: apiid, + Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "apiid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}, + {TargetValue: tagID, + Constraints: []validation.Constraint{{Target: "tagID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "tagID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "tagID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.TagDescriptionBaseProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.TagDescriptionBaseProperties.ExternalDocsURL", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.TagDescriptionBaseProperties.ExternalDocsURL", Name: validation.MaxLength, Rule: 2000, Chain: nil}}}, + }}}}}); err != nil { + return result, validation.NewError("apimanagement.TagDescriptionClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serviceName, apiid, tagID, parameters, ifMatch) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.TagDescriptionClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.TagDescriptionClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.TagDescriptionClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client TagDescriptionClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, tagID string, parameters TagDescriptionCreateParameters, ifMatch string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "apiId": autorest.Encode("path", apiid), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "tagId": autorest.Encode("path", tagID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tagDescriptions/{tagId}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + if len(ifMatch) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client TagDescriptionClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client TagDescriptionClient) CreateOrUpdateResponder(resp *http.Response) (result TagDescriptionContract, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete delete tag description for the Api. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// apiid - API revision identifier. Must be unique in the current API Management service instance. Non-current +// revision has ;rev=n as a suffix where n is the revision number. +// tagID - tag identifier. Must be unique in the current API Management service instance. +// ifMatch - eTag of the Entity. ETag should match the current entity state from the header response of the GET +// request or it should be * for unconditional update. +func (client TagDescriptionClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, apiid string, tagID string, ifMatch string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: apiid, + Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "apiid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}, + {TargetValue: tagID, + Constraints: []validation.Constraint{{Target: "tagID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "tagID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "tagID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.TagDescriptionClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, serviceName, apiid, tagID, ifMatch) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.TagDescriptionClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.TagDescriptionClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.TagDescriptionClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client TagDescriptionClient) DeletePreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, tagID string, ifMatch string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "apiId": autorest.Encode("path", apiid), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "tagId": autorest.Encode("path", tagID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tagDescriptions/{tagId}", pathParameters), + autorest.WithQueryParameters(queryParameters), + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client TagDescriptionClient) DeleteSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client TagDescriptionClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get get tag associated with the API. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// apiid - API revision identifier. Must be unique in the current API Management service instance. Non-current +// revision has ;rev=n as a suffix where n is the revision number. +// tagID - tag identifier. Must be unique in the current API Management service instance. +func (client TagDescriptionClient) Get(ctx context.Context, resourceGroupName string, serviceName string, apiid string, tagID string) (result TagDescriptionContract, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: apiid, + Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "apiid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}, + {TargetValue: tagID, + Constraints: []validation.Constraint{{Target: "tagID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "tagID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "tagID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.TagDescriptionClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, serviceName, apiid, tagID) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.TagDescriptionClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.TagDescriptionClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.TagDescriptionClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client TagDescriptionClient) GetPreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, tagID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "apiId": autorest.Encode("path", apiid), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "tagId": autorest.Encode("path", tagID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tagDescriptions/{tagId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client TagDescriptionClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client TagDescriptionClient) GetResponder(resp *http.Response) (result TagDescriptionContract, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetEntityState gets the entity state version of the tag specified by its identifier. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// apiid - API revision identifier. Must be unique in the current API Management service instance. Non-current +// revision has ;rev=n as a suffix where n is the revision number. +// tagID - tag identifier. Must be unique in the current API Management service instance. +func (client TagDescriptionClient) GetEntityState(ctx context.Context, resourceGroupName string, serviceName string, apiid string, tagID string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: apiid, + Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "apiid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}, + {TargetValue: tagID, + Constraints: []validation.Constraint{{Target: "tagID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "tagID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "tagID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.TagDescriptionClient", "GetEntityState", err.Error()) + } + + req, err := client.GetEntityStatePreparer(ctx, resourceGroupName, serviceName, apiid, tagID) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.TagDescriptionClient", "GetEntityState", nil, "Failure preparing request") + return + } + + resp, err := client.GetEntityStateSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.TagDescriptionClient", "GetEntityState", resp, "Failure sending request") + return + } + + result, err = client.GetEntityStateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.TagDescriptionClient", "GetEntityState", resp, "Failure responding to request") + } + + return +} + +// GetEntityStatePreparer prepares the GetEntityState request. +func (client TagDescriptionClient) GetEntityStatePreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, tagID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "apiId": autorest.Encode("path", apiid), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "tagId": autorest.Encode("path", tagID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsHead(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tagDescriptions/{tagId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetEntityStateSender sends the GetEntityState request. The method will close the +// http.Response Body if it receives an error. +func (client TagDescriptionClient) GetEntityStateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetEntityStateResponder handles the response to the GetEntityState request. The method always +// closes the http.Response Body. +func (client TagDescriptionClient) GetEntityStateResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// ListByAPI lists all Tags descriptions in scope of API. Model similar to swagger - tagDescription is defined on API +// level but tag may be assigned to the Operations +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// apiid - API revision identifier. Must be unique in the current API Management service instance. Non-current +// revision has ;rev=n as a suffix where n is the revision number. +// filter - | Field | Supported operators | Supported functions | +// |-------------|------------------------|---------------------------------------------| +// | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// top - number of records to return. +// skip - number of records to skip. +func (client TagDescriptionClient) ListByAPI(ctx context.Context, resourceGroupName string, serviceName string, apiid string, filter string, top *int32, skip *int32) (result TagDescriptionCollectionPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: apiid, + Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "apiid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}, + {TargetValue: top, + Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}}}, + {TargetValue: skip, + Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("apimanagement.TagDescriptionClient", "ListByAPI", err.Error()) + } + + result.fn = client.listByAPINextResults + req, err := client.ListByAPIPreparer(ctx, resourceGroupName, serviceName, apiid, filter, top, skip) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.TagDescriptionClient", "ListByAPI", nil, "Failure preparing request") + return + } + + resp, err := client.ListByAPISender(req) + if err != nil { + result.tdc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.TagDescriptionClient", "ListByAPI", resp, "Failure sending request") + return + } + + result.tdc, err = client.ListByAPIResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.TagDescriptionClient", "ListByAPI", resp, "Failure responding to request") + } + + return +} + +// ListByAPIPreparer prepares the ListByAPI request. +func (client TagDescriptionClient) ListByAPIPreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, filter string, top *int32, skip *int32) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "apiId": autorest.Encode("path", apiid), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + if skip != nil { + queryParameters["$skip"] = autorest.Encode("query", *skip) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tagDescriptions", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByAPISender sends the ListByAPI request. The method will close the +// http.Response Body if it receives an error. +func (client TagDescriptionClient) ListByAPISender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByAPIResponder handles the response to the ListByAPI request. The method always +// closes the http.Response Body. +func (client TagDescriptionClient) ListByAPIResponder(resp *http.Response) (result TagDescriptionCollection, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByAPINextResults retrieves the next set of results, if any. +func (client TagDescriptionClient) listByAPINextResults(lastResults TagDescriptionCollection) (result TagDescriptionCollection, err error) { + req, err := lastResults.tagDescriptionCollectionPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "apimanagement.TagDescriptionClient", "listByAPINextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByAPISender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "apimanagement.TagDescriptionClient", "listByAPINextResults", resp, "Failure sending next results request") + } + result, err = client.ListByAPIResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.TagDescriptionClient", "listByAPINextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByAPIComplete enumerates all values, automatically crossing page boundaries as required. +func (client TagDescriptionClient) ListByAPIComplete(ctx context.Context, resourceGroupName string, serviceName string, apiid string, filter string, top *int32, skip *int32) (result TagDescriptionCollectionIterator, err error) { + result.page, err = client.ListByAPI(ctx, resourceGroupName, serviceName, apiid, filter, top, skip) + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/tagresource.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/tagresource.go new file mode 100644 index 000000000..30d624e1f --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/tagresource.go @@ -0,0 +1,176 @@ +package apimanagement + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// TagResourceClient is the apiManagement Client +type TagResourceClient struct { + BaseClient +} + +// NewTagResourceClient creates an instance of the TagResourceClient client. +func NewTagResourceClient(subscriptionID string) TagResourceClient { + return NewTagResourceClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewTagResourceClientWithBaseURI creates an instance of the TagResourceClient client. +func NewTagResourceClientWithBaseURI(baseURI string, subscriptionID string) TagResourceClient { + return TagResourceClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// ListByService lists a collection of resources associated with tags. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// filter - | Field | Supported operators | Supported functions | +// |-------------|------------------------|---------------------------------------------| +// | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// | aid | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// | apiName | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// | apiRevision | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// | path | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// | description | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// | serviceUrl | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// | method | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// | urlTemplate | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// | terms | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// | state | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// | isCurrent | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// top - number of records to return. +// skip - number of records to skip. +func (client TagResourceClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (result TagResourceCollectionPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: top, + Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}}}, + {TargetValue: skip, + Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("apimanagement.TagResourceClient", "ListByService", err.Error()) + } + + result.fn = client.listByServiceNextResults + req, err := client.ListByServicePreparer(ctx, resourceGroupName, serviceName, filter, top, skip) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.TagResourceClient", "ListByService", nil, "Failure preparing request") + return + } + + resp, err := client.ListByServiceSender(req) + if err != nil { + result.trc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.TagResourceClient", "ListByService", resp, "Failure sending request") + return + } + + result.trc, err = client.ListByServiceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.TagResourceClient", "ListByService", resp, "Failure responding to request") + } + + return +} + +// ListByServicePreparer prepares the ListByService request. +func (client TagResourceClient) ListByServicePreparer(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + if skip != nil { + queryParameters["$skip"] = autorest.Encode("query", *skip) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tagResources", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByServiceSender sends the ListByService request. The method will close the +// http.Response Body if it receives an error. +func (client TagResourceClient) ListByServiceSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByServiceResponder handles the response to the ListByService request. The method always +// closes the http.Response Body. +func (client TagResourceClient) ListByServiceResponder(resp *http.Response) (result TagResourceCollection, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByServiceNextResults retrieves the next set of results, if any. +func (client TagResourceClient) listByServiceNextResults(lastResults TagResourceCollection) (result TagResourceCollection, err error) { + req, err := lastResults.tagResourceCollectionPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "apimanagement.TagResourceClient", "listByServiceNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByServiceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "apimanagement.TagResourceClient", "listByServiceNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByServiceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.TagResourceClient", "listByServiceNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByServiceComplete enumerates all values, automatically crossing page boundaries as required. +func (client TagResourceClient) ListByServiceComplete(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (result TagResourceCollectionIterator, err error) { + result.page, err = client.ListByService(ctx, resourceGroupName, serviceName, filter, top, skip) + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/tenantaccess.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/tenantaccess.go new file mode 100644 index 000000000..4f75d4985 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/tenantaccess.go @@ -0,0 +1,348 @@ +package apimanagement + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// TenantAccessClient is the apiManagement Client +type TenantAccessClient struct { + BaseClient +} + +// NewTenantAccessClient creates an instance of the TenantAccessClient client. +func NewTenantAccessClient(subscriptionID string) TenantAccessClient { + return NewTenantAccessClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewTenantAccessClientWithBaseURI creates an instance of the TenantAccessClient client. +func NewTenantAccessClientWithBaseURI(baseURI string, subscriptionID string) TenantAccessClient { + return TenantAccessClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get get tenant access information details. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +func (client TenantAccessClient) Get(ctx context.Context, resourceGroupName string, serviceName string) (result AccessInformationContract, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.TenantAccessClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, serviceName) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.TenantAccessClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.TenantAccessClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.TenantAccessClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client TenantAccessClient) GetPreparer(ctx context.Context, resourceGroupName string, serviceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accessName": autorest.Encode("path", "access"), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{accessName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client TenantAccessClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client TenantAccessClient) GetResponder(resp *http.Response) (result AccessInformationContract, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// RegeneratePrimaryKey regenerate primary access key. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +func (client TenantAccessClient) RegeneratePrimaryKey(ctx context.Context, resourceGroupName string, serviceName string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.TenantAccessClient", "RegeneratePrimaryKey", err.Error()) + } + + req, err := client.RegeneratePrimaryKeyPreparer(ctx, resourceGroupName, serviceName) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.TenantAccessClient", "RegeneratePrimaryKey", nil, "Failure preparing request") + return + } + + resp, err := client.RegeneratePrimaryKeySender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.TenantAccessClient", "RegeneratePrimaryKey", resp, "Failure sending request") + return + } + + result, err = client.RegeneratePrimaryKeyResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.TenantAccessClient", "RegeneratePrimaryKey", resp, "Failure responding to request") + } + + return +} + +// RegeneratePrimaryKeyPreparer prepares the RegeneratePrimaryKey request. +func (client TenantAccessClient) RegeneratePrimaryKeyPreparer(ctx context.Context, resourceGroupName string, serviceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accessName": autorest.Encode("path", "access"), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{accessName}/regeneratePrimaryKey", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RegeneratePrimaryKeySender sends the RegeneratePrimaryKey request. The method will close the +// http.Response Body if it receives an error. +func (client TenantAccessClient) RegeneratePrimaryKeySender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// RegeneratePrimaryKeyResponder handles the response to the RegeneratePrimaryKey request. The method always +// closes the http.Response Body. +func (client TenantAccessClient) RegeneratePrimaryKeyResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// RegenerateSecondaryKey regenerate secondary access key. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +func (client TenantAccessClient) RegenerateSecondaryKey(ctx context.Context, resourceGroupName string, serviceName string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.TenantAccessClient", "RegenerateSecondaryKey", err.Error()) + } + + req, err := client.RegenerateSecondaryKeyPreparer(ctx, resourceGroupName, serviceName) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.TenantAccessClient", "RegenerateSecondaryKey", nil, "Failure preparing request") + return + } + + resp, err := client.RegenerateSecondaryKeySender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.TenantAccessClient", "RegenerateSecondaryKey", resp, "Failure sending request") + return + } + + result, err = client.RegenerateSecondaryKeyResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.TenantAccessClient", "RegenerateSecondaryKey", resp, "Failure responding to request") + } + + return +} + +// RegenerateSecondaryKeyPreparer prepares the RegenerateSecondaryKey request. +func (client TenantAccessClient) RegenerateSecondaryKeyPreparer(ctx context.Context, resourceGroupName string, serviceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accessName": autorest.Encode("path", "access"), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{accessName}/regenerateSecondaryKey", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RegenerateSecondaryKeySender sends the RegenerateSecondaryKey request. The method will close the +// http.Response Body if it receives an error. +func (client TenantAccessClient) RegenerateSecondaryKeySender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// RegenerateSecondaryKeyResponder handles the response to the RegenerateSecondaryKey request. The method always +// closes the http.Response Body. +func (client TenantAccessClient) RegenerateSecondaryKeyResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Update update tenant access information details. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// parameters - parameters supplied to retrieve the Tenant Access Information. +// ifMatch - eTag of the Entity. ETag should match the current entity state from the header response of the GET +// request or it should be * for unconditional update. +func (client TenantAccessClient) Update(ctx context.Context, resourceGroupName string, serviceName string, parameters AccessInformationUpdateParameters, ifMatch string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.TenantAccessClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, serviceName, parameters, ifMatch) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.TenantAccessClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.TenantAccessClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.TenantAccessClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client TenantAccessClient) UpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, parameters AccessInformationUpdateParameters, ifMatch string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accessName": autorest.Encode("path", "access"), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{accessName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters), + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client TenantAccessClient) UpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client TenantAccessClient) UpdateResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/tenantaccessgit.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/tenantaccessgit.go new file mode 100644 index 000000000..87a1816e9 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/tenantaccessgit.go @@ -0,0 +1,267 @@ +package apimanagement + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// TenantAccessGitClient is the apiManagement Client +type TenantAccessGitClient struct { + BaseClient +} + +// NewTenantAccessGitClient creates an instance of the TenantAccessGitClient client. +func NewTenantAccessGitClient(subscriptionID string) TenantAccessGitClient { + return NewTenantAccessGitClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewTenantAccessGitClientWithBaseURI creates an instance of the TenantAccessGitClient client. +func NewTenantAccessGitClientWithBaseURI(baseURI string, subscriptionID string) TenantAccessGitClient { + return TenantAccessGitClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get gets the Git access configuration for the tenant. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +func (client TenantAccessGitClient) Get(ctx context.Context, resourceGroupName string, serviceName string) (result AccessInformationContract, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.TenantAccessGitClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, serviceName) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.TenantAccessGitClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.TenantAccessGitClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.TenantAccessGitClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client TenantAccessGitClient) GetPreparer(ctx context.Context, resourceGroupName string, serviceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accessName": autorest.Encode("path", "access"), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{accessName}/git", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client TenantAccessGitClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client TenantAccessGitClient) GetResponder(resp *http.Response) (result AccessInformationContract, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// RegeneratePrimaryKey regenerate primary access key for GIT. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +func (client TenantAccessGitClient) RegeneratePrimaryKey(ctx context.Context, resourceGroupName string, serviceName string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.TenantAccessGitClient", "RegeneratePrimaryKey", err.Error()) + } + + req, err := client.RegeneratePrimaryKeyPreparer(ctx, resourceGroupName, serviceName) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.TenantAccessGitClient", "RegeneratePrimaryKey", nil, "Failure preparing request") + return + } + + resp, err := client.RegeneratePrimaryKeySender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.TenantAccessGitClient", "RegeneratePrimaryKey", resp, "Failure sending request") + return + } + + result, err = client.RegeneratePrimaryKeyResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.TenantAccessGitClient", "RegeneratePrimaryKey", resp, "Failure responding to request") + } + + return +} + +// RegeneratePrimaryKeyPreparer prepares the RegeneratePrimaryKey request. +func (client TenantAccessGitClient) RegeneratePrimaryKeyPreparer(ctx context.Context, resourceGroupName string, serviceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accessName": autorest.Encode("path", "access"), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{accessName}/git/regeneratePrimaryKey", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RegeneratePrimaryKeySender sends the RegeneratePrimaryKey request. The method will close the +// http.Response Body if it receives an error. +func (client TenantAccessGitClient) RegeneratePrimaryKeySender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// RegeneratePrimaryKeyResponder handles the response to the RegeneratePrimaryKey request. The method always +// closes the http.Response Body. +func (client TenantAccessGitClient) RegeneratePrimaryKeyResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// RegenerateSecondaryKey regenerate secondary access key for GIT. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +func (client TenantAccessGitClient) RegenerateSecondaryKey(ctx context.Context, resourceGroupName string, serviceName string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.TenantAccessGitClient", "RegenerateSecondaryKey", err.Error()) + } + + req, err := client.RegenerateSecondaryKeyPreparer(ctx, resourceGroupName, serviceName) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.TenantAccessGitClient", "RegenerateSecondaryKey", nil, "Failure preparing request") + return + } + + resp, err := client.RegenerateSecondaryKeySender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.TenantAccessGitClient", "RegenerateSecondaryKey", resp, "Failure sending request") + return + } + + result, err = client.RegenerateSecondaryKeyResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.TenantAccessGitClient", "RegenerateSecondaryKey", resp, "Failure responding to request") + } + + return +} + +// RegenerateSecondaryKeyPreparer prepares the RegenerateSecondaryKey request. +func (client TenantAccessGitClient) RegenerateSecondaryKeyPreparer(ctx context.Context, resourceGroupName string, serviceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accessName": autorest.Encode("path", "access"), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{accessName}/git/regenerateSecondaryKey", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RegenerateSecondaryKeySender sends the RegenerateSecondaryKey request. The method will close the +// http.Response Body if it receives an error. +func (client TenantAccessGitClient) RegenerateSecondaryKeySender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// RegenerateSecondaryKeyResponder handles the response to the RegenerateSecondaryKey request. The method always +// closes the http.Response Body. +func (client TenantAccessGitClient) RegenerateSecondaryKeyResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/tenantconfiguration.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/tenantconfiguration.go new file mode 100644 index 000000000..133f64021 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/tenantconfiguration.go @@ -0,0 +1,376 @@ +package apimanagement + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// TenantConfigurationClient is the apiManagement Client +type TenantConfigurationClient struct { + BaseClient +} + +// NewTenantConfigurationClient creates an instance of the TenantConfigurationClient client. +func NewTenantConfigurationClient(subscriptionID string) TenantConfigurationClient { + return NewTenantConfigurationClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewTenantConfigurationClientWithBaseURI creates an instance of the TenantConfigurationClient client. +func NewTenantConfigurationClientWithBaseURI(baseURI string, subscriptionID string) TenantConfigurationClient { + return TenantConfigurationClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Deploy this operation applies changes from the specified Git branch to the configuration database. This is a long +// running operation and could take several minutes to complete. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// parameters - deploy Configuration parameters. +func (client TenantConfigurationClient) Deploy(ctx context.Context, resourceGroupName string, serviceName string, parameters DeployConfigurationParameters) (result TenantConfigurationDeployFuture, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.Branch", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.TenantConfigurationClient", "Deploy", err.Error()) + } + + req, err := client.DeployPreparer(ctx, resourceGroupName, serviceName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.TenantConfigurationClient", "Deploy", nil, "Failure preparing request") + return + } + + result, err = client.DeploySender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.TenantConfigurationClient", "Deploy", result.Response(), "Failure sending request") + return + } + + return +} + +// DeployPreparer prepares the Deploy request. +func (client TenantConfigurationClient) DeployPreparer(ctx context.Context, resourceGroupName string, serviceName string, parameters DeployConfigurationParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "configurationName": autorest.Encode("path", "configuration"), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{configurationName}/deploy", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeploySender sends the Deploy request. The method will close the +// http.Response Body if it receives an error. +func (client TenantConfigurationClient) DeploySender(req *http.Request) (future TenantConfigurationDeployFuture, err error) { + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// DeployResponder handles the response to the Deploy request. The method always +// closes the http.Response Body. +func (client TenantConfigurationClient) DeployResponder(resp *http.Response) (result OperationResultContract, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetSyncState gets the status of the most recent synchronization between the configuration database and the Git +// repository. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +func (client TenantConfigurationClient) GetSyncState(ctx context.Context, resourceGroupName string, serviceName string) (result TenantConfigurationSyncStateContract, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.TenantConfigurationClient", "GetSyncState", err.Error()) + } + + req, err := client.GetSyncStatePreparer(ctx, resourceGroupName, serviceName) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.TenantConfigurationClient", "GetSyncState", nil, "Failure preparing request") + return + } + + resp, err := client.GetSyncStateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.TenantConfigurationClient", "GetSyncState", resp, "Failure sending request") + return + } + + result, err = client.GetSyncStateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.TenantConfigurationClient", "GetSyncState", resp, "Failure responding to request") + } + + return +} + +// GetSyncStatePreparer prepares the GetSyncState request. +func (client TenantConfigurationClient) GetSyncStatePreparer(ctx context.Context, resourceGroupName string, serviceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "configurationName": autorest.Encode("path", "configuration"), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{configurationName}/syncState", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSyncStateSender sends the GetSyncState request. The method will close the +// http.Response Body if it receives an error. +func (client TenantConfigurationClient) GetSyncStateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetSyncStateResponder handles the response to the GetSyncState request. The method always +// closes the http.Response Body. +func (client TenantConfigurationClient) GetSyncStateResponder(resp *http.Response) (result TenantConfigurationSyncStateContract, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Save this operation creates a commit with the current configuration snapshot to the specified branch in the +// repository. This is a long running operation and could take several minutes to complete. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// parameters - save Configuration parameters. +func (client TenantConfigurationClient) Save(ctx context.Context, resourceGroupName string, serviceName string, parameters SaveConfigurationParameter) (result TenantConfigurationSaveFuture, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.Branch", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.TenantConfigurationClient", "Save", err.Error()) + } + + req, err := client.SavePreparer(ctx, resourceGroupName, serviceName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.TenantConfigurationClient", "Save", nil, "Failure preparing request") + return + } + + result, err = client.SaveSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.TenantConfigurationClient", "Save", result.Response(), "Failure sending request") + return + } + + return +} + +// SavePreparer prepares the Save request. +func (client TenantConfigurationClient) SavePreparer(ctx context.Context, resourceGroupName string, serviceName string, parameters SaveConfigurationParameter) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "configurationName": autorest.Encode("path", "configuration"), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{configurationName}/save", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// SaveSender sends the Save request. The method will close the +// http.Response Body if it receives an error. +func (client TenantConfigurationClient) SaveSender(req *http.Request) (future TenantConfigurationSaveFuture, err error) { + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// SaveResponder handles the response to the Save request. The method always +// closes the http.Response Body. +func (client TenantConfigurationClient) SaveResponder(resp *http.Response) (result OperationResultContract, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Validate this operation validates the changes in the specified Git branch. This is a long running operation and +// could take several minutes to complete. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// parameters - validate Configuration parameters. +func (client TenantConfigurationClient) Validate(ctx context.Context, resourceGroupName string, serviceName string, parameters DeployConfigurationParameters) (result TenantConfigurationValidateFuture, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.Branch", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.TenantConfigurationClient", "Validate", err.Error()) + } + + req, err := client.ValidatePreparer(ctx, resourceGroupName, serviceName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.TenantConfigurationClient", "Validate", nil, "Failure preparing request") + return + } + + result, err = client.ValidateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.TenantConfigurationClient", "Validate", result.Response(), "Failure sending request") + return + } + + return +} + +// ValidatePreparer prepares the Validate request. +func (client TenantConfigurationClient) ValidatePreparer(ctx context.Context, resourceGroupName string, serviceName string, parameters DeployConfigurationParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "configurationName": autorest.Encode("path", "configuration"), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{configurationName}/validate", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ValidateSender sends the Validate request. The method will close the +// http.Response Body if it receives an error. +func (client TenantConfigurationClient) ValidateSender(req *http.Request) (future TenantConfigurationValidateFuture, err error) { + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// ValidateResponder handles the response to the Validate request. The method always +// closes the http.Response Body. +func (client TenantConfigurationClient) ValidateResponder(resp *http.Response) (result OperationResultContract, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/user.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/user.go new file mode 100644 index 000000000..801303186 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/user.go @@ -0,0 +1,780 @@ +package apimanagement + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// UserClient is the apiManagement Client +type UserClient struct { + BaseClient +} + +// NewUserClient creates an instance of the UserClient client. +func NewUserClient(subscriptionID string) UserClient { + return NewUserClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewUserClientWithBaseURI creates an instance of the UserClient client. +func NewUserClientWithBaseURI(baseURI string, subscriptionID string) UserClient { + return UserClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or Updates a user. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// UID - user identifier. Must be unique in the current API Management service instance. +// parameters - create or update parameters. +// ifMatch - eTag of the Entity. Not required when creating an entity, but required when updating an entity. +func (client UserClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, UID string, parameters UserCreateParameters, ifMatch string) (result UserContract, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: UID, + Constraints: []validation.Constraint{{Target: "UID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "UID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "UID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.UserCreateParameterProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.UserCreateParameterProperties.Email", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.UserCreateParameterProperties.Email", Name: validation.MaxLength, Rule: 254, Chain: nil}, + {Target: "parameters.UserCreateParameterProperties.Email", Name: validation.MinLength, Rule: 1, Chain: nil}, + }}, + {Target: "parameters.UserCreateParameterProperties.FirstName", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.UserCreateParameterProperties.FirstName", Name: validation.MaxLength, Rule: 100, Chain: nil}, + {Target: "parameters.UserCreateParameterProperties.FirstName", Name: validation.MinLength, Rule: 1, Chain: nil}, + }}, + {Target: "parameters.UserCreateParameterProperties.LastName", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.UserCreateParameterProperties.LastName", Name: validation.MaxLength, Rule: 100, Chain: nil}, + {Target: "parameters.UserCreateParameterProperties.LastName", Name: validation.MinLength, Rule: 1, Chain: nil}, + }}, + }}}}}); err != nil { + return result, validation.NewError("apimanagement.UserClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serviceName, UID, parameters, ifMatch) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.UserClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.UserClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.UserClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client UserClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, UID string, parameters UserCreateParameters, ifMatch string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "uid": autorest.Encode("path", UID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{uid}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + if len(ifMatch) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client UserClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client UserClient) CreateOrUpdateResponder(resp *http.Response) (result UserContract, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes specific user. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// UID - user identifier. Must be unique in the current API Management service instance. +// ifMatch - eTag of the Entity. ETag should match the current entity state from the header response of the GET +// request or it should be * for unconditional update. +// deleteSubscriptions - whether to delete user's subscription or not. +// notify - send an Account Closed Email notification to the User. +func (client UserClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, UID string, ifMatch string, deleteSubscriptions *bool, notify *bool) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: UID, + Constraints: []validation.Constraint{{Target: "UID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "UID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "UID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.UserClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, serviceName, UID, ifMatch, deleteSubscriptions, notify) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.UserClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.UserClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.UserClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client UserClient) DeletePreparer(ctx context.Context, resourceGroupName string, serviceName string, UID string, ifMatch string, deleteSubscriptions *bool, notify *bool) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "uid": autorest.Encode("path", UID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if deleteSubscriptions != nil { + queryParameters["deleteSubscriptions"] = autorest.Encode("query", *deleteSubscriptions) + } + if notify != nil { + queryParameters["notify"] = autorest.Encode("query", *notify) + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{uid}", pathParameters), + autorest.WithQueryParameters(queryParameters), + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client UserClient) DeleteSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client UserClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// GenerateSsoURL retrieves a redirection URL containing an authentication token for signing a given user into the +// developer portal. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// UID - user identifier. Must be unique in the current API Management service instance. +func (client UserClient) GenerateSsoURL(ctx context.Context, resourceGroupName string, serviceName string, UID string) (result GenerateSsoURLResult, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: UID, + Constraints: []validation.Constraint{{Target: "UID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "UID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "UID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.UserClient", "GenerateSsoURL", err.Error()) + } + + req, err := client.GenerateSsoURLPreparer(ctx, resourceGroupName, serviceName, UID) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.UserClient", "GenerateSsoURL", nil, "Failure preparing request") + return + } + + resp, err := client.GenerateSsoURLSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.UserClient", "GenerateSsoURL", resp, "Failure sending request") + return + } + + result, err = client.GenerateSsoURLResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.UserClient", "GenerateSsoURL", resp, "Failure responding to request") + } + + return +} + +// GenerateSsoURLPreparer prepares the GenerateSsoURL request. +func (client UserClient) GenerateSsoURLPreparer(ctx context.Context, resourceGroupName string, serviceName string, UID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "uid": autorest.Encode("path", UID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{uid}/generateSsoUrl", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GenerateSsoURLSender sends the GenerateSsoURL request. The method will close the +// http.Response Body if it receives an error. +func (client UserClient) GenerateSsoURLSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GenerateSsoURLResponder handles the response to the GenerateSsoURL request. The method always +// closes the http.Response Body. +func (client UserClient) GenerateSsoURLResponder(resp *http.Response) (result GenerateSsoURLResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get gets the details of the user specified by its identifier. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// UID - user identifier. Must be unique in the current API Management service instance. +func (client UserClient) Get(ctx context.Context, resourceGroupName string, serviceName string, UID string) (result UserContract, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: UID, + Constraints: []validation.Constraint{{Target: "UID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "UID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "UID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.UserClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, serviceName, UID) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.UserClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.UserClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.UserClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client UserClient) GetPreparer(ctx context.Context, resourceGroupName string, serviceName string, UID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "uid": autorest.Encode("path", UID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{uid}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client UserClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client UserClient) GetResponder(resp *http.Response) (result UserContract, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetEntityTag gets the entity state (Etag) version of the user specified by its identifier. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// UID - user identifier. Must be unique in the current API Management service instance. +func (client UserClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, UID string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: UID, + Constraints: []validation.Constraint{{Target: "UID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "UID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "UID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.UserClient", "GetEntityTag", err.Error()) + } + + req, err := client.GetEntityTagPreparer(ctx, resourceGroupName, serviceName, UID) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.UserClient", "GetEntityTag", nil, "Failure preparing request") + return + } + + resp, err := client.GetEntityTagSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.UserClient", "GetEntityTag", resp, "Failure sending request") + return + } + + result, err = client.GetEntityTagResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.UserClient", "GetEntityTag", resp, "Failure responding to request") + } + + return +} + +// GetEntityTagPreparer prepares the GetEntityTag request. +func (client UserClient) GetEntityTagPreparer(ctx context.Context, resourceGroupName string, serviceName string, UID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "uid": autorest.Encode("path", UID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsHead(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{uid}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetEntityTagSender sends the GetEntityTag request. The method will close the +// http.Response Body if it receives an error. +func (client UserClient) GetEntityTagSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetEntityTagResponder handles the response to the GetEntityTag request. The method always +// closes the http.Response Body. +func (client UserClient) GetEntityTagResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// GetSharedAccessToken gets the Shared Access Authorization Token for the User. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// UID - user identifier. Must be unique in the current API Management service instance. +// parameters - create Authorization Token parameters. +func (client UserClient) GetSharedAccessToken(ctx context.Context, resourceGroupName string, serviceName string, UID string, parameters UserTokenParameters) (result UserTokenResult, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: UID, + Constraints: []validation.Constraint{{Target: "UID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "UID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "UID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.Expiry", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.UserClient", "GetSharedAccessToken", err.Error()) + } + + req, err := client.GetSharedAccessTokenPreparer(ctx, resourceGroupName, serviceName, UID, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.UserClient", "GetSharedAccessToken", nil, "Failure preparing request") + return + } + + resp, err := client.GetSharedAccessTokenSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.UserClient", "GetSharedAccessToken", resp, "Failure sending request") + return + } + + result, err = client.GetSharedAccessTokenResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.UserClient", "GetSharedAccessToken", resp, "Failure responding to request") + } + + return +} + +// GetSharedAccessTokenPreparer prepares the GetSharedAccessToken request. +func (client UserClient) GetSharedAccessTokenPreparer(ctx context.Context, resourceGroupName string, serviceName string, UID string, parameters UserTokenParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "uid": autorest.Encode("path", UID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{uid}/token", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSharedAccessTokenSender sends the GetSharedAccessToken request. The method will close the +// http.Response Body if it receives an error. +func (client UserClient) GetSharedAccessTokenSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetSharedAccessTokenResponder handles the response to the GetSharedAccessToken request. The method always +// closes the http.Response Body. +func (client UserClient) GetSharedAccessTokenResponder(resp *http.Response) (result UserTokenResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByService lists a collection of registered users in the specified service instance. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// filter - | Field | Supported operators | Supported functions | +// |------------------|------------------------|-----------------------------------| +// | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// | firstName | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// | lastName | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// | email | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// | state | eq | N/A | +// | registrationDate | ge, le, eq, ne, gt, lt | N/A | +// | note | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// top - number of records to return. +// skip - number of records to skip. +func (client UserClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (result UserCollectionPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: top, + Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}}}, + {TargetValue: skip, + Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("apimanagement.UserClient", "ListByService", err.Error()) + } + + result.fn = client.listByServiceNextResults + req, err := client.ListByServicePreparer(ctx, resourceGroupName, serviceName, filter, top, skip) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.UserClient", "ListByService", nil, "Failure preparing request") + return + } + + resp, err := client.ListByServiceSender(req) + if err != nil { + result.uc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.UserClient", "ListByService", resp, "Failure sending request") + return + } + + result.uc, err = client.ListByServiceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.UserClient", "ListByService", resp, "Failure responding to request") + } + + return +} + +// ListByServicePreparer prepares the ListByService request. +func (client UserClient) ListByServicePreparer(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + if skip != nil { + queryParameters["$skip"] = autorest.Encode("query", *skip) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByServiceSender sends the ListByService request. The method will close the +// http.Response Body if it receives an error. +func (client UserClient) ListByServiceSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByServiceResponder handles the response to the ListByService request. The method always +// closes the http.Response Body. +func (client UserClient) ListByServiceResponder(resp *http.Response) (result UserCollection, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByServiceNextResults retrieves the next set of results, if any. +func (client UserClient) listByServiceNextResults(lastResults UserCollection) (result UserCollection, err error) { + req, err := lastResults.userCollectionPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "apimanagement.UserClient", "listByServiceNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByServiceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "apimanagement.UserClient", "listByServiceNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByServiceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.UserClient", "listByServiceNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByServiceComplete enumerates all values, automatically crossing page boundaries as required. +func (client UserClient) ListByServiceComplete(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (result UserCollectionIterator, err error) { + result.page, err = client.ListByService(ctx, resourceGroupName, serviceName, filter, top, skip) + return +} + +// Update updates the details of the user specified by its identifier. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// UID - user identifier. Must be unique in the current API Management service instance. +// parameters - update parameters. +// ifMatch - eTag of the Entity. ETag should match the current entity state from the header response of the GET +// request or it should be * for unconditional update. +func (client UserClient) Update(ctx context.Context, resourceGroupName string, serviceName string, UID string, parameters UserUpdateParameters, ifMatch string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: UID, + Constraints: []validation.Constraint{{Target: "UID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "UID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "UID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.UserClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, serviceName, UID, parameters, ifMatch) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.UserClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.UserClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.UserClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client UserClient) UpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, UID string, parameters UserUpdateParameters, ifMatch string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "uid": autorest.Encode("path", UID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{uid}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters), + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client UserClient) UpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client UserClient) UpdateResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/usergroup.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/usergroup.go new file mode 100644 index 000000000..cf68f0b65 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/usergroup.go @@ -0,0 +1,172 @@ +package apimanagement + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// UserGroupClient is the apiManagement Client +type UserGroupClient struct { + BaseClient +} + +// NewUserGroupClient creates an instance of the UserGroupClient client. +func NewUserGroupClient(subscriptionID string) UserGroupClient { + return NewUserGroupClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewUserGroupClientWithBaseURI creates an instance of the UserGroupClient client. +func NewUserGroupClientWithBaseURI(baseURI string, subscriptionID string) UserGroupClient { + return UserGroupClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// List lists all user groups. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// UID - user identifier. Must be unique in the current API Management service instance. +// filter - | Field | Supported operators | Supported functions | +// |-------------|------------------------|---------------------------------------------| +// | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// | description | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// top - number of records to return. +// skip - number of records to skip. +func (client UserGroupClient) List(ctx context.Context, resourceGroupName string, serviceName string, UID string, filter string, top *int32, skip *int32) (result GroupCollectionPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: UID, + Constraints: []validation.Constraint{{Target: "UID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "UID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "UID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {TargetValue: top, + Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}}}, + {TargetValue: skip, + Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("apimanagement.UserGroupClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName, serviceName, UID, filter, top, skip) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.UserGroupClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.gc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.UserGroupClient", "List", resp, "Failure sending request") + return + } + + result.gc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.UserGroupClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client UserGroupClient) ListPreparer(ctx context.Context, resourceGroupName string, serviceName string, UID string, filter string, top *int32, skip *int32) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "uid": autorest.Encode("path", UID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + if skip != nil { + queryParameters["$skip"] = autorest.Encode("query", *skip) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{uid}/groups", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client UserGroupClient) ListSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client UserGroupClient) ListResponder(resp *http.Response) (result GroupCollection, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client UserGroupClient) listNextResults(lastResults GroupCollection) (result GroupCollection, err error) { + req, err := lastResults.groupCollectionPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "apimanagement.UserGroupClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "apimanagement.UserGroupClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.UserGroupClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client UserGroupClient) ListComplete(ctx context.Context, resourceGroupName string, serviceName string, UID string, filter string, top *int32, skip *int32) (result GroupCollectionIterator, err error) { + result.page, err = client.List(ctx, resourceGroupName, serviceName, UID, filter, top, skip) + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/useridentities.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/useridentities.go new file mode 100644 index 000000000..5e354a9c4 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/useridentities.go @@ -0,0 +1,150 @@ +package apimanagement + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// UserIdentitiesClient is the apiManagement Client +type UserIdentitiesClient struct { + BaseClient +} + +// NewUserIdentitiesClient creates an instance of the UserIdentitiesClient client. +func NewUserIdentitiesClient(subscriptionID string) UserIdentitiesClient { + return NewUserIdentitiesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewUserIdentitiesClientWithBaseURI creates an instance of the UserIdentitiesClient client. +func NewUserIdentitiesClientWithBaseURI(baseURI string, subscriptionID string) UserIdentitiesClient { + return UserIdentitiesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// List lists all user identities. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// UID - user identifier. Must be unique in the current API Management service instance. +func (client UserIdentitiesClient) List(ctx context.Context, resourceGroupName string, serviceName string, UID string) (result UserIdentityCollectionPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: UID, + Constraints: []validation.Constraint{{Target: "UID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "UID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "UID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.UserIdentitiesClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName, serviceName, UID) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.UserIdentitiesClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.uic.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.UserIdentitiesClient", "List", resp, "Failure sending request") + return + } + + result.uic, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.UserIdentitiesClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client UserIdentitiesClient) ListPreparer(ctx context.Context, resourceGroupName string, serviceName string, UID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "uid": autorest.Encode("path", UID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{uid}/identities", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client UserIdentitiesClient) ListSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client UserIdentitiesClient) ListResponder(resp *http.Response) (result UserIdentityCollection, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client UserIdentitiesClient) listNextResults(lastResults UserIdentityCollection) (result UserIdentityCollection, err error) { + req, err := lastResults.userIdentityCollectionPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "apimanagement.UserIdentitiesClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "apimanagement.UserIdentitiesClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.UserIdentitiesClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client UserIdentitiesClient) ListComplete(ctx context.Context, resourceGroupName string, serviceName string, UID string) (result UserIdentityCollectionIterator, err error) { + result.page, err = client.List(ctx, resourceGroupName, serviceName, UID) + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/usersubscription.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/usersubscription.go new file mode 100644 index 000000000..afa0bf1b1 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/usersubscription.go @@ -0,0 +1,175 @@ +package apimanagement + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// UserSubscriptionClient is the apiManagement Client +type UserSubscriptionClient struct { + BaseClient +} + +// NewUserSubscriptionClient creates an instance of the UserSubscriptionClient client. +func NewUserSubscriptionClient(subscriptionID string) UserSubscriptionClient { + return NewUserSubscriptionClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewUserSubscriptionClientWithBaseURI creates an instance of the UserSubscriptionClient client. +func NewUserSubscriptionClientWithBaseURI(baseURI string, subscriptionID string) UserSubscriptionClient { + return UserSubscriptionClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// List lists the collection of subscriptions of the specified user. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// UID - user identifier. Must be unique in the current API Management service instance. +// filter - | Field | Supported operators | Supported functions | +// |--------------|------------------------|---------------------------------------------| +// | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// | stateComment | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// | userId | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// | productId | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// | state | eq | | +// top - number of records to return. +// skip - number of records to skip. +func (client UserSubscriptionClient) List(ctx context.Context, resourceGroupName string, serviceName string, UID string, filter string, top *int32, skip *int32) (result SubscriptionCollectionPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: UID, + Constraints: []validation.Constraint{{Target: "UID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "UID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "UID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {TargetValue: top, + Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}}}, + {TargetValue: skip, + Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("apimanagement.UserSubscriptionClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName, serviceName, UID, filter, top, skip) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.UserSubscriptionClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.sc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.UserSubscriptionClient", "List", resp, "Failure sending request") + return + } + + result.sc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.UserSubscriptionClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client UserSubscriptionClient) ListPreparer(ctx context.Context, resourceGroupName string, serviceName string, UID string, filter string, top *int32, skip *int32) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "uid": autorest.Encode("path", UID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + if skip != nil { + queryParameters["$skip"] = autorest.Encode("query", *skip) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{uid}/subscriptions", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client UserSubscriptionClient) ListSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client UserSubscriptionClient) ListResponder(resp *http.Response) (result SubscriptionCollection, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client UserSubscriptionClient) listNextResults(lastResults SubscriptionCollection) (result SubscriptionCollection, err error) { + req, err := lastResults.subscriptionCollectionPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "apimanagement.UserSubscriptionClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "apimanagement.UserSubscriptionClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.UserSubscriptionClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client UserSubscriptionClient) ListComplete(ctx context.Context, resourceGroupName string, serviceName string, UID string, filter string, top *int32, skip *int32) (result SubscriptionCollectionIterator, err error) { + result.page, err = client.List(ctx, resourceGroupName, serviceName, UID, filter, top, skip) + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/version.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/version.go new file mode 100644 index 000000000..337037a77 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/version.go @@ -0,0 +1,30 @@ +package apimanagement + +import "github.com/Azure/azure-sdk-for-go/version" + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// UserAgent returns the UserAgent string to use when sending http.Requests. +func UserAgent() string { + return "Azure-SDK-For-Go/" + version.Number + " apimanagement/2018-06-01-preview" +} + +// Version returns the semantic version (see http://semver.org) of the client. +func Version() string { + return version.Number +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/account.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/account.go new file mode 100644 index 000000000..5d3b9f1d1 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/account.go @@ -0,0 +1,537 @@ +package automation + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// AccountClient is the automation Client +type AccountClient struct { + BaseClient +} + +// NewAccountClient creates an instance of the AccountClient client. +func NewAccountClient(subscriptionID string) AccountClient { + return NewAccountClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewAccountClientWithBaseURI creates an instance of the AccountClient client. +func NewAccountClientWithBaseURI(baseURI string, subscriptionID string) AccountClient { + return AccountClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate create or update automation account. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// parameters - parameters supplied to the create or update automation account. +func (client AccountClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, automationAccountName string, parameters AccountCreateOrUpdateParameters) (result Account, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.AccountClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, automationAccountName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.AccountClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.AccountClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.AccountClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client AccountClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, parameters AccountCreateOrUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client AccountClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client AccountClient) CreateOrUpdateResponder(resp *http.Response) (result Account, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete delete an automation account. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +func (client AccountClient) Delete(ctx context.Context, resourceGroupName string, automationAccountName string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.AccountClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, automationAccountName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.AccountClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "automation.AccountClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.AccountClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client AccountClient) DeletePreparer(ctx context.Context, resourceGroupName string, automationAccountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client AccountClient) DeleteSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client AccountClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get get information about an Automation Account. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +func (client AccountClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string) (result Account, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.AccountClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.AccountClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.AccountClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.AccountClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client AccountClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client AccountClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client AccountClient) GetResponder(resp *http.Response) (result Account, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List retrieve a list of accounts within a given subscription. +func (client AccountClient) List(ctx context.Context) (result AccountListResultPage, err error) { + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.AccountClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.alr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.AccountClient", "List", resp, "Failure sending request") + return + } + + result.alr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.AccountClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client AccountClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Automation/automationAccounts", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client AccountClient) ListSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client AccountClient) ListResponder(resp *http.Response) (result AccountListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client AccountClient) listNextResults(lastResults AccountListResult) (result AccountListResult, err error) { + req, err := lastResults.accountListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "automation.AccountClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "automation.AccountClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.AccountClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client AccountClient) ListComplete(ctx context.Context) (result AccountListResultIterator, err error) { + result.page, err = client.List(ctx) + return +} + +// ListByResourceGroup retrieve a list of accounts within a given resource group. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +func (client AccountClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result AccountListResultPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.AccountClient", "ListByResourceGroup", err.Error()) + } + + result.fn = client.listByResourceGroupNextResults + req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.AccountClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.alr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.AccountClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result.alr, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.AccountClient", "ListByResourceGroup", resp, "Failure responding to request") + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client AccountClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the +// http.Response Body if it receives an error. +func (client AccountClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always +// closes the http.Response Body. +func (client AccountClient) ListByResourceGroupResponder(resp *http.Response) (result AccountListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByResourceGroupNextResults retrieves the next set of results, if any. +func (client AccountClient) listByResourceGroupNextResults(lastResults AccountListResult) (result AccountListResult, err error) { + req, err := lastResults.accountListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "automation.AccountClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "automation.AccountClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.AccountClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client AccountClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result AccountListResultIterator, err error) { + result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) + return +} + +// Update update an automation account. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// parameters - parameters supplied to the update automation account. +func (client AccountClient) Update(ctx context.Context, resourceGroupName string, automationAccountName string, parameters AccountUpdateParameters) (result Account, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.AccountClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, automationAccountName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.AccountClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.AccountClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.AccountClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client AccountClient) UpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, parameters AccountUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client AccountClient) UpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client AccountClient) UpdateResponder(resp *http.Response) (result Account, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/activity.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/activity.go new file mode 100644 index 000000000..9cb37f954 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/activity.go @@ -0,0 +1,225 @@ +package automation + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// ActivityClient is the automation Client +type ActivityClient struct { + BaseClient +} + +// NewActivityClient creates an instance of the ActivityClient client. +func NewActivityClient(subscriptionID string) ActivityClient { + return NewActivityClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewActivityClientWithBaseURI creates an instance of the ActivityClient client. +func NewActivityClientWithBaseURI(baseURI string, subscriptionID string) ActivityClient { + return ActivityClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get retrieve the activity in the module identified by module name and activity name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// moduleName - the name of module. +// activityName - the name of activity. +func (client ActivityClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, moduleName string, activityName string) (result Activity, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.ActivityClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, moduleName, activityName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ActivityClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.ActivityClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ActivityClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client ActivityClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, moduleName string, activityName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "activityName": autorest.Encode("path", activityName), + "automationAccountName": autorest.Encode("path", automationAccountName), + "moduleName": autorest.Encode("path", moduleName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/modules/{moduleName}/activities/{activityName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ActivityClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ActivityClient) GetResponder(resp *http.Response) (result Activity, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByModule retrieve a list of activities in the module identified by module name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// moduleName - the name of module. +func (client ActivityClient) ListByModule(ctx context.Context, resourceGroupName string, automationAccountName string, moduleName string) (result ActivityListResultPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.ActivityClient", "ListByModule", err.Error()) + } + + result.fn = client.listByModuleNextResults + req, err := client.ListByModulePreparer(ctx, resourceGroupName, automationAccountName, moduleName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ActivityClient", "ListByModule", nil, "Failure preparing request") + return + } + + resp, err := client.ListByModuleSender(req) + if err != nil { + result.alr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.ActivityClient", "ListByModule", resp, "Failure sending request") + return + } + + result.alr, err = client.ListByModuleResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ActivityClient", "ListByModule", resp, "Failure responding to request") + } + + return +} + +// ListByModulePreparer prepares the ListByModule request. +func (client ActivityClient) ListByModulePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, moduleName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "moduleName": autorest.Encode("path", moduleName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/modules/{moduleName}/activities", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByModuleSender sends the ListByModule request. The method will close the +// http.Response Body if it receives an error. +func (client ActivityClient) ListByModuleSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByModuleResponder handles the response to the ListByModule request. The method always +// closes the http.Response Body. +func (client ActivityClient) ListByModuleResponder(resp *http.Response) (result ActivityListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByModuleNextResults retrieves the next set of results, if any. +func (client ActivityClient) listByModuleNextResults(lastResults ActivityListResult) (result ActivityListResult, err error) { + req, err := lastResults.activityListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "automation.ActivityClient", "listByModuleNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByModuleSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "automation.ActivityClient", "listByModuleNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByModuleResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ActivityClient", "listByModuleNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByModuleComplete enumerates all values, automatically crossing page boundaries as required. +func (client ActivityClient) ListByModuleComplete(ctx context.Context, resourceGroupName string, automationAccountName string, moduleName string) (result ActivityListResultIterator, err error) { + result.page, err = client.ListByModule(ctx, resourceGroupName, automationAccountName, moduleName) + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/agentregistrationinformation.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/agentregistrationinformation.go new file mode 100644 index 000000000..ac1fc3e08 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/agentregistrationinformation.go @@ -0,0 +1,195 @@ +package automation + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// AgentRegistrationInformationClient is the automation Client +type AgentRegistrationInformationClient struct { + BaseClient +} + +// NewAgentRegistrationInformationClient creates an instance of the AgentRegistrationInformationClient client. +func NewAgentRegistrationInformationClient(subscriptionID string) AgentRegistrationInformationClient { + return NewAgentRegistrationInformationClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewAgentRegistrationInformationClientWithBaseURI creates an instance of the AgentRegistrationInformationClient +// client. +func NewAgentRegistrationInformationClientWithBaseURI(baseURI string, subscriptionID string) AgentRegistrationInformationClient { + return AgentRegistrationInformationClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get retrieve the automation agent registration information. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +func (client AgentRegistrationInformationClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string) (result AgentRegistration, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.AgentRegistrationInformationClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.AgentRegistrationInformationClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.AgentRegistrationInformationClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.AgentRegistrationInformationClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client AgentRegistrationInformationClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/agentRegistrationInformation", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client AgentRegistrationInformationClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client AgentRegistrationInformationClient) GetResponder(resp *http.Response) (result AgentRegistration, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// RegenerateKey regenerate a primary or secondary agent registration key +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// parameters - the name of the agent registration key to be regenerated +func (client AgentRegistrationInformationClient) RegenerateKey(ctx context.Context, resourceGroupName string, automationAccountName string, parameters AgentRegistrationRegenerateKeyParameter) (result AgentRegistration, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.AgentRegistrationInformationClient", "RegenerateKey", err.Error()) + } + + req, err := client.RegenerateKeyPreparer(ctx, resourceGroupName, automationAccountName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.AgentRegistrationInformationClient", "RegenerateKey", nil, "Failure preparing request") + return + } + + resp, err := client.RegenerateKeySender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.AgentRegistrationInformationClient", "RegenerateKey", resp, "Failure sending request") + return + } + + result, err = client.RegenerateKeyResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.AgentRegistrationInformationClient", "RegenerateKey", resp, "Failure responding to request") + } + + return +} + +// RegenerateKeyPreparer prepares the RegenerateKey request. +func (client AgentRegistrationInformationClient) RegenerateKeyPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, parameters AgentRegistrationRegenerateKeyParameter) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/agentRegistrationInformation/regenerateKey", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RegenerateKeySender sends the RegenerateKey request. The method will close the +// http.Response Body if it receives an error. +func (client AgentRegistrationInformationClient) RegenerateKeySender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// RegenerateKeyResponder handles the response to the RegenerateKey request. The method always +// closes the http.Response Body. +func (client AgentRegistrationInformationClient) RegenerateKeyResponder(resp *http.Response) (result AgentRegistration, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/certificate.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/certificate.go new file mode 100644 index 000000000..bb46d3d1e --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/certificate.go @@ -0,0 +1,461 @@ +package automation + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// CertificateClient is the automation Client +type CertificateClient struct { + BaseClient +} + +// NewCertificateClient creates an instance of the CertificateClient client. +func NewCertificateClient(subscriptionID string) CertificateClient { + return NewCertificateClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewCertificateClientWithBaseURI creates an instance of the CertificateClient client. +func NewCertificateClientWithBaseURI(baseURI string, subscriptionID string) CertificateClient { + return CertificateClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate create a certificate. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// certificateName - the parameters supplied to the create or update certificate operation. +// parameters - the parameters supplied to the create or update certificate operation. +func (client CertificateClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, automationAccountName string, certificateName string, parameters CertificateCreateOrUpdateParameters) (result Certificate, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.Name", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.CertificateCreateOrUpdateProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.CertificateCreateOrUpdateProperties.Base64Value", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("automation.CertificateClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, automationAccountName, certificateName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.CertificateClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.CertificateClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.CertificateClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client CertificateClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, certificateName string, parameters CertificateCreateOrUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "certificateName": autorest.Encode("path", certificateName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/certificates/{certificateName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client CertificateClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client CertificateClient) CreateOrUpdateResponder(resp *http.Response) (result Certificate, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete delete the certificate. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// certificateName - the name of certificate. +func (client CertificateClient) Delete(ctx context.Context, resourceGroupName string, automationAccountName string, certificateName string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.CertificateClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, automationAccountName, certificateName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.CertificateClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "automation.CertificateClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.CertificateClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client CertificateClient) DeletePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, certificateName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "certificateName": autorest.Encode("path", certificateName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/certificates/{certificateName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client CertificateClient) DeleteSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client CertificateClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get retrieve the certificate identified by certificate name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// certificateName - the name of certificate. +func (client CertificateClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, certificateName string) (result Certificate, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.CertificateClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, certificateName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.CertificateClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.CertificateClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.CertificateClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client CertificateClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, certificateName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "certificateName": autorest.Encode("path", certificateName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/certificates/{certificateName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client CertificateClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client CertificateClient) GetResponder(resp *http.Response) (result Certificate, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByAutomationAccount retrieve a list of certificates. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +func (client CertificateClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string) (result CertificateListResultPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.CertificateClient", "ListByAutomationAccount", err.Error()) + } + + result.fn = client.listByAutomationAccountNextResults + req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.CertificateClient", "ListByAutomationAccount", nil, "Failure preparing request") + return + } + + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.clr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.CertificateClient", "ListByAutomationAccount", resp, "Failure sending request") + return + } + + result.clr, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.CertificateClient", "ListByAutomationAccount", resp, "Failure responding to request") + } + + return +} + +// ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. +func (client CertificateClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/certificates", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByAutomationAccountSender sends the ListByAutomationAccount request. The method will close the +// http.Response Body if it receives an error. +func (client CertificateClient) ListByAutomationAccountSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByAutomationAccountResponder handles the response to the ListByAutomationAccount request. The method always +// closes the http.Response Body. +func (client CertificateClient) ListByAutomationAccountResponder(resp *http.Response) (result CertificateListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByAutomationAccountNextResults retrieves the next set of results, if any. +func (client CertificateClient) listByAutomationAccountNextResults(lastResults CertificateListResult) (result CertificateListResult, err error) { + req, err := lastResults.certificateListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "automation.CertificateClient", "listByAutomationAccountNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "automation.CertificateClient", "listByAutomationAccountNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.CertificateClient", "listByAutomationAccountNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByAutomationAccountComplete enumerates all values, automatically crossing page boundaries as required. +func (client CertificateClient) ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string) (result CertificateListResultIterator, err error) { + result.page, err = client.ListByAutomationAccount(ctx, resourceGroupName, automationAccountName) + return +} + +// Update update a certificate. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// certificateName - the parameters supplied to the update certificate operation. +// parameters - the parameters supplied to the update certificate operation. +func (client CertificateClient) Update(ctx context.Context, resourceGroupName string, automationAccountName string, certificateName string, parameters CertificateUpdateParameters) (result Certificate, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.CertificateClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, automationAccountName, certificateName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.CertificateClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.CertificateClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.CertificateClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client CertificateClient) UpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, certificateName string, parameters CertificateUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "certificateName": autorest.Encode("path", certificateName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/certificates/{certificateName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client CertificateClient) UpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client CertificateClient) UpdateResponder(resp *http.Response) (result Certificate, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/client.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/client.go new file mode 100644 index 000000000..71700fb23 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/client.go @@ -0,0 +1,51 @@ +// Package automation implements the Azure ARM Automation service API version . +// +// Automation Client +package automation + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/Azure/go-autorest/autorest" +) + +const ( + // DefaultBaseURI is the default URI used for the service Automation + DefaultBaseURI = "https://management.azure.com" +) + +// BaseClient is the base client for Automation. +type BaseClient struct { + autorest.Client + BaseURI string + SubscriptionID string +} + +// New creates an instance of the BaseClient client. +func New(subscriptionID string) BaseClient { + return NewWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewWithBaseURI creates an instance of the BaseClient client. +func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { + return BaseClient{ + Client: autorest.NewClientWithUserAgent(UserAgent()), + BaseURI: baseURI, + SubscriptionID: subscriptionID, + } +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/connection.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/connection.go new file mode 100644 index 000000000..f29f93593 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/connection.go @@ -0,0 +1,462 @@ +package automation + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// ConnectionClient is the automation Client +type ConnectionClient struct { + BaseClient +} + +// NewConnectionClient creates an instance of the ConnectionClient client. +func NewConnectionClient(subscriptionID string) ConnectionClient { + return NewConnectionClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewConnectionClientWithBaseURI creates an instance of the ConnectionClient client. +func NewConnectionClientWithBaseURI(baseURI string, subscriptionID string) ConnectionClient { + return ConnectionClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate create or update a connection. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// connectionName - the parameters supplied to the create or update connection operation. +// parameters - the parameters supplied to the create or update connection operation. +func (client ConnectionClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, automationAccountName string, connectionName string, parameters ConnectionCreateOrUpdateParameters) (result Connection, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.Name", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.ConnectionCreateOrUpdateProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.ConnectionCreateOrUpdateProperties.ConnectionType", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("automation.ConnectionClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, automationAccountName, connectionName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ConnectionClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.ConnectionClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ConnectionClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client ConnectionClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, connectionName string, parameters ConnectionCreateOrUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "connectionName": autorest.Encode("path", connectionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/connections/{connectionName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client ConnectionClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client ConnectionClient) CreateOrUpdateResponder(resp *http.Response) (result Connection, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete delete the connection. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// connectionName - the name of connection. +func (client ConnectionClient) Delete(ctx context.Context, resourceGroupName string, automationAccountName string, connectionName string) (result Connection, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.ConnectionClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, automationAccountName, connectionName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ConnectionClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.ConnectionClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ConnectionClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ConnectionClient) DeletePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, connectionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "connectionName": autorest.Encode("path", connectionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/connections/{connectionName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ConnectionClient) DeleteSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ConnectionClient) DeleteResponder(resp *http.Response) (result Connection, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get retrieve the connection identified by connection name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// connectionName - the name of connection. +func (client ConnectionClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, connectionName string) (result Connection, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.ConnectionClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, connectionName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ConnectionClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.ConnectionClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ConnectionClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client ConnectionClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, connectionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "connectionName": autorest.Encode("path", connectionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/connections/{connectionName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ConnectionClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ConnectionClient) GetResponder(resp *http.Response) (result Connection, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByAutomationAccount retrieve a list of connections. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +func (client ConnectionClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string) (result ConnectionListResultPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.ConnectionClient", "ListByAutomationAccount", err.Error()) + } + + result.fn = client.listByAutomationAccountNextResults + req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ConnectionClient", "ListByAutomationAccount", nil, "Failure preparing request") + return + } + + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.clr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.ConnectionClient", "ListByAutomationAccount", resp, "Failure sending request") + return + } + + result.clr, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ConnectionClient", "ListByAutomationAccount", resp, "Failure responding to request") + } + + return +} + +// ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. +func (client ConnectionClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/connections", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByAutomationAccountSender sends the ListByAutomationAccount request. The method will close the +// http.Response Body if it receives an error. +func (client ConnectionClient) ListByAutomationAccountSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByAutomationAccountResponder handles the response to the ListByAutomationAccount request. The method always +// closes the http.Response Body. +func (client ConnectionClient) ListByAutomationAccountResponder(resp *http.Response) (result ConnectionListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByAutomationAccountNextResults retrieves the next set of results, if any. +func (client ConnectionClient) listByAutomationAccountNextResults(lastResults ConnectionListResult) (result ConnectionListResult, err error) { + req, err := lastResults.connectionListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "automation.ConnectionClient", "listByAutomationAccountNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "automation.ConnectionClient", "listByAutomationAccountNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ConnectionClient", "listByAutomationAccountNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByAutomationAccountComplete enumerates all values, automatically crossing page boundaries as required. +func (client ConnectionClient) ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string) (result ConnectionListResultIterator, err error) { + result.page, err = client.ListByAutomationAccount(ctx, resourceGroupName, automationAccountName) + return +} + +// Update update a connection. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// connectionName - the parameters supplied to the update a connection operation. +// parameters - the parameters supplied to the update a connection operation. +func (client ConnectionClient) Update(ctx context.Context, resourceGroupName string, automationAccountName string, connectionName string, parameters ConnectionUpdateParameters) (result Connection, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.ConnectionClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, automationAccountName, connectionName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ConnectionClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.ConnectionClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ConnectionClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client ConnectionClient) UpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, connectionName string, parameters ConnectionUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "connectionName": autorest.Encode("path", connectionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/connections/{connectionName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client ConnectionClient) UpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client ConnectionClient) UpdateResponder(resp *http.Response) (result Connection, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/connectiontype.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/connectiontype.go new file mode 100644 index 000000000..7ec6c994a --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/connectiontype.go @@ -0,0 +1,381 @@ +package automation + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// ConnectionTypeClient is the automation Client +type ConnectionTypeClient struct { + BaseClient +} + +// NewConnectionTypeClient creates an instance of the ConnectionTypeClient client. +func NewConnectionTypeClient(subscriptionID string) ConnectionTypeClient { + return NewConnectionTypeClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewConnectionTypeClientWithBaseURI creates an instance of the ConnectionTypeClient client. +func NewConnectionTypeClientWithBaseURI(baseURI string, subscriptionID string) ConnectionTypeClient { + return ConnectionTypeClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate create a connectiontype. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// connectionTypeName - the parameters supplied to the create or update connectiontype operation. +// parameters - the parameters supplied to the create or update connectiontype operation. +func (client ConnectionTypeClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, automationAccountName string, connectionTypeName string, parameters ConnectionTypeCreateOrUpdateParameters) (result ConnectionType, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.Name", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.ConnectionTypeCreateOrUpdateProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.ConnectionTypeCreateOrUpdateProperties.FieldDefinitions", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("automation.ConnectionTypeClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, automationAccountName, connectionTypeName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ConnectionTypeClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.ConnectionTypeClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ConnectionTypeClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client ConnectionTypeClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, connectionTypeName string, parameters ConnectionTypeCreateOrUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "connectionTypeName": autorest.Encode("path", connectionTypeName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/connectionTypes/{connectionTypeName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client ConnectionTypeClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client ConnectionTypeClient) CreateOrUpdateResponder(resp *http.Response) (result ConnectionType, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusConflict), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete delete the connectiontype. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// connectionTypeName - the name of connectiontype. +func (client ConnectionTypeClient) Delete(ctx context.Context, resourceGroupName string, automationAccountName string, connectionTypeName string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.ConnectionTypeClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, automationAccountName, connectionTypeName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ConnectionTypeClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "automation.ConnectionTypeClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ConnectionTypeClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ConnectionTypeClient) DeletePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, connectionTypeName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "connectionTypeName": autorest.Encode("path", connectionTypeName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/connectionTypes/{connectionTypeName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ConnectionTypeClient) DeleteSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ConnectionTypeClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get retrieve the connectiontype identified by connectiontype name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// connectionTypeName - the name of connectiontype. +func (client ConnectionTypeClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, connectionTypeName string) (result ConnectionType, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.ConnectionTypeClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, connectionTypeName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ConnectionTypeClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.ConnectionTypeClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ConnectionTypeClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client ConnectionTypeClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, connectionTypeName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "connectionTypeName": autorest.Encode("path", connectionTypeName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/connectionTypes/{connectionTypeName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ConnectionTypeClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ConnectionTypeClient) GetResponder(resp *http.Response) (result ConnectionType, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByAutomationAccount retrieve a list of connectiontypes. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +func (client ConnectionTypeClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string) (result ConnectionTypeListResultPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.ConnectionTypeClient", "ListByAutomationAccount", err.Error()) + } + + result.fn = client.listByAutomationAccountNextResults + req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ConnectionTypeClient", "ListByAutomationAccount", nil, "Failure preparing request") + return + } + + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.ctlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.ConnectionTypeClient", "ListByAutomationAccount", resp, "Failure sending request") + return + } + + result.ctlr, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ConnectionTypeClient", "ListByAutomationAccount", resp, "Failure responding to request") + } + + return +} + +// ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. +func (client ConnectionTypeClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/connectionTypes", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByAutomationAccountSender sends the ListByAutomationAccount request. The method will close the +// http.Response Body if it receives an error. +func (client ConnectionTypeClient) ListByAutomationAccountSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByAutomationAccountResponder handles the response to the ListByAutomationAccount request. The method always +// closes the http.Response Body. +func (client ConnectionTypeClient) ListByAutomationAccountResponder(resp *http.Response) (result ConnectionTypeListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByAutomationAccountNextResults retrieves the next set of results, if any. +func (client ConnectionTypeClient) listByAutomationAccountNextResults(lastResults ConnectionTypeListResult) (result ConnectionTypeListResult, err error) { + req, err := lastResults.connectionTypeListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "automation.ConnectionTypeClient", "listByAutomationAccountNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "automation.ConnectionTypeClient", "listByAutomationAccountNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ConnectionTypeClient", "listByAutomationAccountNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByAutomationAccountComplete enumerates all values, automatically crossing page boundaries as required. +func (client ConnectionTypeClient) ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string) (result ConnectionTypeListResultIterator, err error) { + result.page, err = client.ListByAutomationAccount(ctx, resourceGroupName, automationAccountName) + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/credential.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/credential.go new file mode 100644 index 000000000..c54ccec48 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/credential.go @@ -0,0 +1,463 @@ +package automation + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// CredentialClient is the automation Client +type CredentialClient struct { + BaseClient +} + +// NewCredentialClient creates an instance of the CredentialClient client. +func NewCredentialClient(subscriptionID string) CredentialClient { + return NewCredentialClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewCredentialClientWithBaseURI creates an instance of the CredentialClient client. +func NewCredentialClientWithBaseURI(baseURI string, subscriptionID string) CredentialClient { + return CredentialClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate create a credential. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// credentialName - the parameters supplied to the create or update credential operation. +// parameters - the parameters supplied to the create or update credential operation. +func (client CredentialClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, automationAccountName string, credentialName string, parameters CredentialCreateOrUpdateParameters) (result Credential, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.Name", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.CredentialCreateOrUpdateProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.CredentialCreateOrUpdateProperties.UserName", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.CredentialCreateOrUpdateProperties.Password", Name: validation.Null, Rule: true, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("automation.CredentialClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, automationAccountName, credentialName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.CredentialClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.CredentialClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.CredentialClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client CredentialClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, credentialName string, parameters CredentialCreateOrUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "credentialName": autorest.Encode("path", credentialName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/credentials/{credentialName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client CredentialClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client CredentialClient) CreateOrUpdateResponder(resp *http.Response) (result Credential, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete delete the credential. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// credentialName - the name of credential. +func (client CredentialClient) Delete(ctx context.Context, resourceGroupName string, automationAccountName string, credentialName string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.CredentialClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, automationAccountName, credentialName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.CredentialClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "automation.CredentialClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.CredentialClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client CredentialClient) DeletePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, credentialName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "credentialName": autorest.Encode("path", credentialName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/credentials/{credentialName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client CredentialClient) DeleteSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client CredentialClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get retrieve the credential identified by credential name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// credentialName - the name of credential. +func (client CredentialClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, credentialName string) (result Credential, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.CredentialClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, credentialName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.CredentialClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.CredentialClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.CredentialClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client CredentialClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, credentialName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "credentialName": autorest.Encode("path", credentialName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/credentials/{credentialName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client CredentialClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client CredentialClient) GetResponder(resp *http.Response) (result Credential, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByAutomationAccount retrieve a list of credentials. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +func (client CredentialClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string) (result CredentialListResultPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.CredentialClient", "ListByAutomationAccount", err.Error()) + } + + result.fn = client.listByAutomationAccountNextResults + req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.CredentialClient", "ListByAutomationAccount", nil, "Failure preparing request") + return + } + + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.clr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.CredentialClient", "ListByAutomationAccount", resp, "Failure sending request") + return + } + + result.clr, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.CredentialClient", "ListByAutomationAccount", resp, "Failure responding to request") + } + + return +} + +// ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. +func (client CredentialClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/credentials", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByAutomationAccountSender sends the ListByAutomationAccount request. The method will close the +// http.Response Body if it receives an error. +func (client CredentialClient) ListByAutomationAccountSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByAutomationAccountResponder handles the response to the ListByAutomationAccount request. The method always +// closes the http.Response Body. +func (client CredentialClient) ListByAutomationAccountResponder(resp *http.Response) (result CredentialListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByAutomationAccountNextResults retrieves the next set of results, if any. +func (client CredentialClient) listByAutomationAccountNextResults(lastResults CredentialListResult) (result CredentialListResult, err error) { + req, err := lastResults.credentialListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "automation.CredentialClient", "listByAutomationAccountNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "automation.CredentialClient", "listByAutomationAccountNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.CredentialClient", "listByAutomationAccountNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByAutomationAccountComplete enumerates all values, automatically crossing page boundaries as required. +func (client CredentialClient) ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string) (result CredentialListResultIterator, err error) { + result.page, err = client.ListByAutomationAccount(ctx, resourceGroupName, automationAccountName) + return +} + +// Update update a credential. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// credentialName - the parameters supplied to the Update credential operation. +// parameters - the parameters supplied to the Update credential operation. +func (client CredentialClient) Update(ctx context.Context, resourceGroupName string, automationAccountName string, credentialName string, parameters CredentialUpdateParameters) (result Credential, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.CredentialClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, automationAccountName, credentialName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.CredentialClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.CredentialClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.CredentialClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client CredentialClient) UpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, credentialName string, parameters CredentialUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "credentialName": autorest.Encode("path", credentialName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/credentials/{credentialName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client CredentialClient) UpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client CredentialClient) UpdateResponder(resp *http.Response) (result Credential, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/dsccompilationjob.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/dsccompilationjob.go new file mode 100644 index 000000000..3ed11e06b --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/dsccompilationjob.go @@ -0,0 +1,388 @@ +package automation + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/satori/go.uuid" + "net/http" +) + +// DscCompilationJobClient is the automation Client +type DscCompilationJobClient struct { + BaseClient +} + +// NewDscCompilationJobClient creates an instance of the DscCompilationJobClient client. +func NewDscCompilationJobClient(subscriptionID string) DscCompilationJobClient { + return NewDscCompilationJobClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewDscCompilationJobClientWithBaseURI creates an instance of the DscCompilationJobClient client. +func NewDscCompilationJobClientWithBaseURI(baseURI string, subscriptionID string) DscCompilationJobClient { + return DscCompilationJobClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Create creates the Dsc compilation job of the configuration. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// compilationJobID - the the DSC configuration Id. +// parameters - the parameters supplied to the create compilation job operation. +func (client DscCompilationJobClient) Create(ctx context.Context, resourceGroupName string, automationAccountName string, compilationJobID uuid.UUID, parameters DscCompilationJobCreateParameters) (result DscCompilationJob, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.DscCompilationJobCreateProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.DscCompilationJobCreateProperties.Configuration", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("automation.DscCompilationJobClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, resourceGroupName, automationAccountName, compilationJobID, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscCompilationJobClient", "Create", nil, "Failure preparing request") + return + } + + resp, err := client.CreateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.DscCompilationJobClient", "Create", resp, "Failure sending request") + return + } + + result, err = client.CreateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscCompilationJobClient", "Create", resp, "Failure responding to request") + } + + return +} + +// CreatePreparer prepares the Create request. +func (client DscCompilationJobClient) CreatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, compilationJobID uuid.UUID, parameters DscCompilationJobCreateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "compilationJobId": autorest.Encode("path", compilationJobID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/compilationjobs/{compilationJobId}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client DscCompilationJobClient) CreateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client DscCompilationJobClient) CreateResponder(resp *http.Response) (result DscCompilationJob, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get retrieve the Dsc configuration compilation job identified by job id. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// compilationJobID - the Dsc configuration compilation job id. +func (client DscCompilationJobClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, compilationJobID uuid.UUID) (result DscCompilationJob, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.DscCompilationJobClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, compilationJobID) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscCompilationJobClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.DscCompilationJobClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscCompilationJobClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client DscCompilationJobClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, compilationJobID uuid.UUID) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "compilationJobId": autorest.Encode("path", compilationJobID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/compilationjobs/{compilationJobId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client DscCompilationJobClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client DscCompilationJobClient) GetResponder(resp *http.Response) (result DscCompilationJob, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetStream retrieve the job stream identified by job stream id. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// jobID - the job id. +// jobStreamID - the job stream id. +func (client DscCompilationJobClient) GetStream(ctx context.Context, resourceGroupName string, automationAccountName string, jobID uuid.UUID, jobStreamID string) (result JobStream, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.DscCompilationJobClient", "GetStream", err.Error()) + } + + req, err := client.GetStreamPreparer(ctx, resourceGroupName, automationAccountName, jobID, jobStreamID) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscCompilationJobClient", "GetStream", nil, "Failure preparing request") + return + } + + resp, err := client.GetStreamSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.DscCompilationJobClient", "GetStream", resp, "Failure sending request") + return + } + + result, err = client.GetStreamResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscCompilationJobClient", "GetStream", resp, "Failure responding to request") + } + + return +} + +// GetStreamPreparer prepares the GetStream request. +func (client DscCompilationJobClient) GetStreamPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, jobID uuid.UUID, jobStreamID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "jobId": autorest.Encode("path", jobID), + "jobStreamId": autorest.Encode("path", jobStreamID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/compilationjobs/{jobId}/streams/{jobStreamId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetStreamSender sends the GetStream request. The method will close the +// http.Response Body if it receives an error. +func (client DscCompilationJobClient) GetStreamSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetStreamResponder handles the response to the GetStream request. The method always +// closes the http.Response Body. +func (client DscCompilationJobClient) GetStreamResponder(resp *http.Response) (result JobStream, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByAutomationAccount retrieve a list of dsc compilation jobs. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// filter - the filter to apply on the operation. +func (client DscCompilationJobClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (result DscCompilationJobListResultPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.DscCompilationJobClient", "ListByAutomationAccount", err.Error()) + } + + result.fn = client.listByAutomationAccountNextResults + req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscCompilationJobClient", "ListByAutomationAccount", nil, "Failure preparing request") + return + } + + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.dcjlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.DscCompilationJobClient", "ListByAutomationAccount", resp, "Failure sending request") + return + } + + result.dcjlr, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscCompilationJobClient", "ListByAutomationAccount", resp, "Failure responding to request") + } + + return +} + +// ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. +func (client DscCompilationJobClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/compilationjobs", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByAutomationAccountSender sends the ListByAutomationAccount request. The method will close the +// http.Response Body if it receives an error. +func (client DscCompilationJobClient) ListByAutomationAccountSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByAutomationAccountResponder handles the response to the ListByAutomationAccount request. The method always +// closes the http.Response Body. +func (client DscCompilationJobClient) ListByAutomationAccountResponder(resp *http.Response) (result DscCompilationJobListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByAutomationAccountNextResults retrieves the next set of results, if any. +func (client DscCompilationJobClient) listByAutomationAccountNextResults(lastResults DscCompilationJobListResult) (result DscCompilationJobListResult, err error) { + req, err := lastResults.dscCompilationJobListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "automation.DscCompilationJobClient", "listByAutomationAccountNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "automation.DscCompilationJobClient", "listByAutomationAccountNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscCompilationJobClient", "listByAutomationAccountNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByAutomationAccountComplete enumerates all values, automatically crossing page boundaries as required. +func (client DscCompilationJobClient) ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (result DscCompilationJobListResultIterator, err error) { + result.page, err = client.ListByAutomationAccount(ctx, resourceGroupName, automationAccountName, filter) + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/dsccompilationjobstream.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/dsccompilationjobstream.go new file mode 100644 index 000000000..4b3723035 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/dsccompilationjobstream.go @@ -0,0 +1,119 @@ +package automation + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/satori/go.uuid" + "net/http" +) + +// DscCompilationJobStreamClient is the automation Client +type DscCompilationJobStreamClient struct { + BaseClient +} + +// NewDscCompilationJobStreamClient creates an instance of the DscCompilationJobStreamClient client. +func NewDscCompilationJobStreamClient(subscriptionID string) DscCompilationJobStreamClient { + return NewDscCompilationJobStreamClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewDscCompilationJobStreamClientWithBaseURI creates an instance of the DscCompilationJobStreamClient client. +func NewDscCompilationJobStreamClientWithBaseURI(baseURI string, subscriptionID string) DscCompilationJobStreamClient { + return DscCompilationJobStreamClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// ListByJob retrieve all the job streams for the compilation Job. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// jobID - the job id. +func (client DscCompilationJobStreamClient) ListByJob(ctx context.Context, resourceGroupName string, automationAccountName string, jobID uuid.UUID) (result JobStreamListResult, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.DscCompilationJobStreamClient", "ListByJob", err.Error()) + } + + req, err := client.ListByJobPreparer(ctx, resourceGroupName, automationAccountName, jobID) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscCompilationJobStreamClient", "ListByJob", nil, "Failure preparing request") + return + } + + resp, err := client.ListByJobSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.DscCompilationJobStreamClient", "ListByJob", resp, "Failure sending request") + return + } + + result, err = client.ListByJobResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscCompilationJobStreamClient", "ListByJob", resp, "Failure responding to request") + } + + return +} + +// ListByJobPreparer prepares the ListByJob request. +func (client DscCompilationJobStreamClient) ListByJobPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, jobID uuid.UUID) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "jobId": autorest.Encode("path", jobID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/compilationjobs/{jobId}/streams/", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByJobSender sends the ListByJob request. The method will close the +// http.Response Body if it receives an error. +func (client DscCompilationJobStreamClient) ListByJobSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByJobResponder handles the response to the ListByJob request. The method always +// closes the http.Response Body. +func (client DscCompilationJobStreamClient) ListByJobResponder(resp *http.Response) (result JobStreamListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/dscconfiguration.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/dscconfiguration.go new file mode 100644 index 000000000..72c361a04 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/dscconfiguration.go @@ -0,0 +1,562 @@ +package automation + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// DscConfigurationClient is the automation Client +type DscConfigurationClient struct { + BaseClient +} + +// NewDscConfigurationClient creates an instance of the DscConfigurationClient client. +func NewDscConfigurationClient(subscriptionID string) DscConfigurationClient { + return NewDscConfigurationClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewDscConfigurationClientWithBaseURI creates an instance of the DscConfigurationClient client. +func NewDscConfigurationClientWithBaseURI(baseURI string, subscriptionID string) DscConfigurationClient { + return DscConfigurationClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate create the configuration identified by configuration name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// configurationName - the create or update parameters for configuration. +// parameters - the create or update parameters for configuration. +func (client DscConfigurationClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, automationAccountName string, configurationName string, parameters DscConfigurationCreateOrUpdateParameters) (result DscConfiguration, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.DscConfigurationCreateOrUpdateProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.DscConfigurationCreateOrUpdateProperties.Source", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.DscConfigurationCreateOrUpdateProperties.Source.Hash", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.DscConfigurationCreateOrUpdateProperties.Source.Hash.Algorithm", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.DscConfigurationCreateOrUpdateProperties.Source.Hash.Value", Name: validation.Null, Rule: true, Chain: nil}, + }}, + }}, + }}}}}); err != nil { + return result, validation.NewError("automation.DscConfigurationClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, automationAccountName, configurationName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscConfigurationClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.DscConfigurationClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscConfigurationClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client DscConfigurationClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, configurationName string, parameters DscConfigurationCreateOrUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "configurationName": autorest.Encode("path", configurationName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/configurations/{configurationName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client DscConfigurationClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client DscConfigurationClient) CreateOrUpdateResponder(resp *http.Response) (result DscConfiguration, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete delete the dsc configuration identified by configuration name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// configurationName - the configuration name. +func (client DscConfigurationClient) Delete(ctx context.Context, resourceGroupName string, automationAccountName string, configurationName string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.DscConfigurationClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, automationAccountName, configurationName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscConfigurationClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "automation.DscConfigurationClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscConfigurationClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client DscConfigurationClient) DeletePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, configurationName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "configurationName": autorest.Encode("path", configurationName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/configurations/{configurationName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client DscConfigurationClient) DeleteSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client DscConfigurationClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get retrieve the configuration identified by configuration name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// configurationName - the configuration name. +func (client DscConfigurationClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, configurationName string) (result DscConfiguration, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.DscConfigurationClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, configurationName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscConfigurationClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.DscConfigurationClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscConfigurationClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client DscConfigurationClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, configurationName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "configurationName": autorest.Encode("path", configurationName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/configurations/{configurationName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client DscConfigurationClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client DscConfigurationClient) GetResponder(resp *http.Response) (result DscConfiguration, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetContent retrieve the configuration script identified by configuration name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// configurationName - the configuration name. +func (client DscConfigurationClient) GetContent(ctx context.Context, resourceGroupName string, automationAccountName string, configurationName string) (result String, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.DscConfigurationClient", "GetContent", err.Error()) + } + + req, err := client.GetContentPreparer(ctx, resourceGroupName, automationAccountName, configurationName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscConfigurationClient", "GetContent", nil, "Failure preparing request") + return + } + + resp, err := client.GetContentSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.DscConfigurationClient", "GetContent", resp, "Failure sending request") + return + } + + result, err = client.GetContentResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscConfigurationClient", "GetContent", resp, "Failure responding to request") + } + + return +} + +// GetContentPreparer prepares the GetContent request. +func (client DscConfigurationClient) GetContentPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, configurationName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "configurationName": autorest.Encode("path", configurationName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/configurations/{configurationName}/content", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetContentSender sends the GetContent request. The method will close the +// http.Response Body if it receives an error. +func (client DscConfigurationClient) GetContentSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetContentResponder handles the response to the GetContent request. The method always +// closes the http.Response Body. +func (client DscConfigurationClient) GetContentResponder(resp *http.Response) (result String, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByAutomationAccount retrieve a list of configurations. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// filter - the filter to apply on the operation. +// skip - the number of rows to skip. +// top - the the number of rows to take. +// inlinecount - return total rows. +func (client DscConfigurationClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string, filter string, skip *int32, top *int32, inlinecount string) (result DscConfigurationListResultPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.DscConfigurationClient", "ListByAutomationAccount", err.Error()) + } + + result.fn = client.listByAutomationAccountNextResults + req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName, filter, skip, top, inlinecount) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscConfigurationClient", "ListByAutomationAccount", nil, "Failure preparing request") + return + } + + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.dclr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.DscConfigurationClient", "ListByAutomationAccount", resp, "Failure sending request") + return + } + + result.dclr, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscConfigurationClient", "ListByAutomationAccount", resp, "Failure responding to request") + } + + return +} + +// ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. +func (client DscConfigurationClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, filter string, skip *int32, top *int32, inlinecount string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if skip != nil { + queryParameters["$skip"] = autorest.Encode("query", *skip) + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + if len(inlinecount) > 0 { + queryParameters["$inlinecount"] = autorest.Encode("query", inlinecount) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/configurations", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByAutomationAccountSender sends the ListByAutomationAccount request. The method will close the +// http.Response Body if it receives an error. +func (client DscConfigurationClient) ListByAutomationAccountSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByAutomationAccountResponder handles the response to the ListByAutomationAccount request. The method always +// closes the http.Response Body. +func (client DscConfigurationClient) ListByAutomationAccountResponder(resp *http.Response) (result DscConfigurationListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByAutomationAccountNextResults retrieves the next set of results, if any. +func (client DscConfigurationClient) listByAutomationAccountNextResults(lastResults DscConfigurationListResult) (result DscConfigurationListResult, err error) { + req, err := lastResults.dscConfigurationListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "automation.DscConfigurationClient", "listByAutomationAccountNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "automation.DscConfigurationClient", "listByAutomationAccountNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscConfigurationClient", "listByAutomationAccountNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByAutomationAccountComplete enumerates all values, automatically crossing page boundaries as required. +func (client DscConfigurationClient) ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string, filter string, skip *int32, top *int32, inlinecount string) (result DscConfigurationListResultIterator, err error) { + result.page, err = client.ListByAutomationAccount(ctx, resourceGroupName, automationAccountName, filter, skip, top, inlinecount) + return +} + +// Update create the configuration identified by configuration name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// configurationName - the create or update parameters for configuration. +// parameters - the create or update parameters for configuration. +func (client DscConfigurationClient) Update(ctx context.Context, resourceGroupName string, automationAccountName string, configurationName string, parameters *DscConfigurationUpdateParameters) (result DscConfiguration, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.DscConfigurationClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, automationAccountName, configurationName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscConfigurationClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.DscConfigurationClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscConfigurationClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client DscConfigurationClient) UpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, configurationName string, parameters *DscConfigurationUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "configurationName": autorest.Encode("path", configurationName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/configurations/{configurationName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if parameters != nil { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithJSON(parameters)) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client DscConfigurationClient) UpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client DscConfigurationClient) UpdateResponder(resp *http.Response) (result DscConfiguration, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/dscnode.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/dscnode.go new file mode 100644 index 000000000..e61c56e58 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/dscnode.go @@ -0,0 +1,382 @@ +package automation + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// DscNodeClient is the automation Client +type DscNodeClient struct { + BaseClient +} + +// NewDscNodeClient creates an instance of the DscNodeClient client. +func NewDscNodeClient(subscriptionID string) DscNodeClient { + return NewDscNodeClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewDscNodeClientWithBaseURI creates an instance of the DscNodeClient client. +func NewDscNodeClientWithBaseURI(baseURI string, subscriptionID string) DscNodeClient { + return DscNodeClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Delete delete the dsc node identified by node id. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// nodeID - the node id. +func (client DscNodeClient) Delete(ctx context.Context, resourceGroupName string, automationAccountName string, nodeID string) (result DscNode, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.DscNodeClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, automationAccountName, nodeID) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscNodeClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.DscNodeClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscNodeClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client DscNodeClient) DeletePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, nodeID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "nodeId": autorest.Encode("path", nodeID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodes/{nodeId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client DscNodeClient) DeleteSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client DscNodeClient) DeleteResponder(resp *http.Response) (result DscNode, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get retrieve the dsc node identified by node id. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// nodeID - the node id. +func (client DscNodeClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, nodeID string) (result DscNode, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.DscNodeClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, nodeID) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscNodeClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.DscNodeClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscNodeClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client DscNodeClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, nodeID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "nodeId": autorest.Encode("path", nodeID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodes/{nodeId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client DscNodeClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client DscNodeClient) GetResponder(resp *http.Response) (result DscNode, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByAutomationAccount retrieve a list of dsc nodes. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// filter - the filter to apply on the operation. +func (client DscNodeClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (result DscNodeListResultPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.DscNodeClient", "ListByAutomationAccount", err.Error()) + } + + result.fn = client.listByAutomationAccountNextResults + req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscNodeClient", "ListByAutomationAccount", nil, "Failure preparing request") + return + } + + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.dnlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.DscNodeClient", "ListByAutomationAccount", resp, "Failure sending request") + return + } + + result.dnlr, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscNodeClient", "ListByAutomationAccount", resp, "Failure responding to request") + } + + return +} + +// ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. +func (client DscNodeClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodes", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByAutomationAccountSender sends the ListByAutomationAccount request. The method will close the +// http.Response Body if it receives an error. +func (client DscNodeClient) ListByAutomationAccountSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByAutomationAccountResponder handles the response to the ListByAutomationAccount request. The method always +// closes the http.Response Body. +func (client DscNodeClient) ListByAutomationAccountResponder(resp *http.Response) (result DscNodeListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByAutomationAccountNextResults retrieves the next set of results, if any. +func (client DscNodeClient) listByAutomationAccountNextResults(lastResults DscNodeListResult) (result DscNodeListResult, err error) { + req, err := lastResults.dscNodeListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "automation.DscNodeClient", "listByAutomationAccountNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "automation.DscNodeClient", "listByAutomationAccountNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscNodeClient", "listByAutomationAccountNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByAutomationAccountComplete enumerates all values, automatically crossing page boundaries as required. +func (client DscNodeClient) ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (result DscNodeListResultIterator, err error) { + result.page, err = client.ListByAutomationAccount(ctx, resourceGroupName, automationAccountName, filter) + return +} + +// Update update the dsc node. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// nodeID - parameters supplied to the update dsc node. +// parameters - parameters supplied to the update dsc node. +func (client DscNodeClient) Update(ctx context.Context, resourceGroupName string, automationAccountName string, nodeID string, parameters DscNodeUpdateParameters) (result DscNode, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.DscNodeClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, automationAccountName, nodeID, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscNodeClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.DscNodeClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscNodeClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client DscNodeClient) UpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, nodeID string, parameters DscNodeUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "nodeId": autorest.Encode("path", nodeID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodes/{nodeId}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client DscNodeClient) UpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client DscNodeClient) UpdateResponder(resp *http.Response) (result DscNode, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/dscnodeconfiguration.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/dscnodeconfiguration.go new file mode 100644 index 000000000..dc292bbd8 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/dscnodeconfiguration.go @@ -0,0 +1,390 @@ +package automation + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// DscNodeConfigurationClient is the automation Client +type DscNodeConfigurationClient struct { + BaseClient +} + +// NewDscNodeConfigurationClient creates an instance of the DscNodeConfigurationClient client. +func NewDscNodeConfigurationClient(subscriptionID string) DscNodeConfigurationClient { + return NewDscNodeConfigurationClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewDscNodeConfigurationClientWithBaseURI creates an instance of the DscNodeConfigurationClient client. +func NewDscNodeConfigurationClientWithBaseURI(baseURI string, subscriptionID string) DscNodeConfigurationClient { + return DscNodeConfigurationClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate create the node configuration identified by node configuration name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// nodeConfigurationName - the create or update parameters for configuration. +// parameters - the create or update parameters for configuration. +func (client DscNodeConfigurationClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, automationAccountName string, nodeConfigurationName string, parameters DscNodeConfigurationCreateOrUpdateParameters) (result DscNodeConfiguration, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.Source", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.Source.Hash", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.Source.Hash.Algorithm", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.Source.Hash.Value", Name: validation.Null, Rule: true, Chain: nil}, + }}, + }}, + {Target: "parameters.Name", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.Configuration", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.DscNodeConfigurationClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, automationAccountName, nodeConfigurationName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscNodeConfigurationClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.DscNodeConfigurationClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscNodeConfigurationClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client DscNodeConfigurationClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, nodeConfigurationName string, parameters DscNodeConfigurationCreateOrUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "nodeConfigurationName": autorest.Encode("path", nodeConfigurationName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodeConfigurations/{nodeConfigurationName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client DscNodeConfigurationClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client DscNodeConfigurationClient) CreateOrUpdateResponder(resp *http.Response) (result DscNodeConfiguration, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete delete the Dsc node configurations by node configuration. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// nodeConfigurationName - the Dsc node configuration name. +func (client DscNodeConfigurationClient) Delete(ctx context.Context, resourceGroupName string, automationAccountName string, nodeConfigurationName string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.DscNodeConfigurationClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, automationAccountName, nodeConfigurationName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscNodeConfigurationClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "automation.DscNodeConfigurationClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscNodeConfigurationClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client DscNodeConfigurationClient) DeletePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, nodeConfigurationName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "nodeConfigurationName": autorest.Encode("path", nodeConfigurationName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodeConfigurations/{nodeConfigurationName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client DscNodeConfigurationClient) DeleteSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client DscNodeConfigurationClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get retrieve the Dsc node configurations by node configuration. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// nodeConfigurationName - the Dsc node configuration name. +func (client DscNodeConfigurationClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, nodeConfigurationName string) (result DscNodeConfiguration, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.DscNodeConfigurationClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, nodeConfigurationName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscNodeConfigurationClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.DscNodeConfigurationClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscNodeConfigurationClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client DscNodeConfigurationClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, nodeConfigurationName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "nodeConfigurationName": autorest.Encode("path", nodeConfigurationName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodeConfigurations/{nodeConfigurationName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client DscNodeConfigurationClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client DscNodeConfigurationClient) GetResponder(resp *http.Response) (result DscNodeConfiguration, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByAutomationAccount retrieve a list of dsc node configurations. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// filter - the filter to apply on the operation. +func (client DscNodeConfigurationClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (result DscNodeConfigurationListResultPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.DscNodeConfigurationClient", "ListByAutomationAccount", err.Error()) + } + + result.fn = client.listByAutomationAccountNextResults + req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscNodeConfigurationClient", "ListByAutomationAccount", nil, "Failure preparing request") + return + } + + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.dnclr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.DscNodeConfigurationClient", "ListByAutomationAccount", resp, "Failure sending request") + return + } + + result.dnclr, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscNodeConfigurationClient", "ListByAutomationAccount", resp, "Failure responding to request") + } + + return +} + +// ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. +func (client DscNodeConfigurationClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodeConfigurations", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByAutomationAccountSender sends the ListByAutomationAccount request. The method will close the +// http.Response Body if it receives an error. +func (client DscNodeConfigurationClient) ListByAutomationAccountSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByAutomationAccountResponder handles the response to the ListByAutomationAccount request. The method always +// closes the http.Response Body. +func (client DscNodeConfigurationClient) ListByAutomationAccountResponder(resp *http.Response) (result DscNodeConfigurationListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByAutomationAccountNextResults retrieves the next set of results, if any. +func (client DscNodeConfigurationClient) listByAutomationAccountNextResults(lastResults DscNodeConfigurationListResult) (result DscNodeConfigurationListResult, err error) { + req, err := lastResults.dscNodeConfigurationListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "automation.DscNodeConfigurationClient", "listByAutomationAccountNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "automation.DscNodeConfigurationClient", "listByAutomationAccountNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscNodeConfigurationClient", "listByAutomationAccountNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByAutomationAccountComplete enumerates all values, automatically crossing page boundaries as required. +func (client DscNodeConfigurationClient) ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (result DscNodeConfigurationListResultIterator, err error) { + result.page, err = client.ListByAutomationAccount(ctx, resourceGroupName, automationAccountName, filter) + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/fields.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/fields.go new file mode 100644 index 000000000..61c80c6eb --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/fields.go @@ -0,0 +1,120 @@ +package automation + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// FieldsClient is the automation Client +type FieldsClient struct { + BaseClient +} + +// NewFieldsClient creates an instance of the FieldsClient client. +func NewFieldsClient(subscriptionID string) FieldsClient { + return NewFieldsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewFieldsClientWithBaseURI creates an instance of the FieldsClient client. +func NewFieldsClientWithBaseURI(baseURI string, subscriptionID string) FieldsClient { + return FieldsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// ListByType retrieve a list of fields of a given type identified by module name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// moduleName - the name of module. +// typeName - the name of type. +func (client FieldsClient) ListByType(ctx context.Context, resourceGroupName string, automationAccountName string, moduleName string, typeName string) (result TypeFieldListResult, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.FieldsClient", "ListByType", err.Error()) + } + + req, err := client.ListByTypePreparer(ctx, resourceGroupName, automationAccountName, moduleName, typeName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.FieldsClient", "ListByType", nil, "Failure preparing request") + return + } + + resp, err := client.ListByTypeSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.FieldsClient", "ListByType", resp, "Failure sending request") + return + } + + result, err = client.ListByTypeResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.FieldsClient", "ListByType", resp, "Failure responding to request") + } + + return +} + +// ListByTypePreparer prepares the ListByType request. +func (client FieldsClient) ListByTypePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, moduleName string, typeName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "moduleName": autorest.Encode("path", moduleName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "typeName": autorest.Encode("path", typeName), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/modules/{moduleName}/types/{typeName}/fields", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByTypeSender sends the ListByType request. The method will close the +// http.Response Body if it receives an error. +func (client FieldsClient) ListByTypeSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByTypeResponder handles the response to the ListByType request. The method always +// closes the http.Response Body. +func (client FieldsClient) ListByTypeResponder(resp *http.Response) (result TypeFieldListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/hybridrunbookworkergroup.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/hybridrunbookworkergroup.go new file mode 100644 index 000000000..86bd913bf --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/hybridrunbookworkergroup.go @@ -0,0 +1,381 @@ +package automation + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// HybridRunbookWorkerGroupClient is the automation Client +type HybridRunbookWorkerGroupClient struct { + BaseClient +} + +// NewHybridRunbookWorkerGroupClient creates an instance of the HybridRunbookWorkerGroupClient client. +func NewHybridRunbookWorkerGroupClient(subscriptionID string) HybridRunbookWorkerGroupClient { + return NewHybridRunbookWorkerGroupClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewHybridRunbookWorkerGroupClientWithBaseURI creates an instance of the HybridRunbookWorkerGroupClient client. +func NewHybridRunbookWorkerGroupClientWithBaseURI(baseURI string, subscriptionID string) HybridRunbookWorkerGroupClient { + return HybridRunbookWorkerGroupClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Delete delete a hybrid runbook worker group. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// hybridRunbookWorkerGroupName - the hybrid runbook worker group name +func (client HybridRunbookWorkerGroupClient) Delete(ctx context.Context, resourceGroupName string, automationAccountName string, hybridRunbookWorkerGroupName string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.HybridRunbookWorkerGroupClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, automationAccountName, hybridRunbookWorkerGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.HybridRunbookWorkerGroupClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "automation.HybridRunbookWorkerGroupClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.HybridRunbookWorkerGroupClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client HybridRunbookWorkerGroupClient) DeletePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, hybridRunbookWorkerGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "hybridRunbookWorkerGroupName": autorest.Encode("path", hybridRunbookWorkerGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/hybridRunbookWorkerGroups/{hybridRunbookWorkerGroupName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client HybridRunbookWorkerGroupClient) DeleteSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client HybridRunbookWorkerGroupClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get retrieve a hybrid runbook worker group. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// hybridRunbookWorkerGroupName - the hybrid runbook worker group name +func (client HybridRunbookWorkerGroupClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, hybridRunbookWorkerGroupName string) (result HybridRunbookWorkerGroup, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.HybridRunbookWorkerGroupClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, hybridRunbookWorkerGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.HybridRunbookWorkerGroupClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.HybridRunbookWorkerGroupClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.HybridRunbookWorkerGroupClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client HybridRunbookWorkerGroupClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, hybridRunbookWorkerGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "hybridRunbookWorkerGroupName": autorest.Encode("path", hybridRunbookWorkerGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/hybridRunbookWorkerGroups/{hybridRunbookWorkerGroupName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client HybridRunbookWorkerGroupClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client HybridRunbookWorkerGroupClient) GetResponder(resp *http.Response) (result HybridRunbookWorkerGroup, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByAutomationAccount retrieve a list of hybrid runbook worker groups. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// filter - the filter to apply on the operation. +func (client HybridRunbookWorkerGroupClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (result HybridRunbookWorkerGroupsListResultPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.HybridRunbookWorkerGroupClient", "ListByAutomationAccount", err.Error()) + } + + result.fn = client.listByAutomationAccountNextResults + req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.HybridRunbookWorkerGroupClient", "ListByAutomationAccount", nil, "Failure preparing request") + return + } + + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.hrwglr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.HybridRunbookWorkerGroupClient", "ListByAutomationAccount", resp, "Failure sending request") + return + } + + result.hrwglr, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.HybridRunbookWorkerGroupClient", "ListByAutomationAccount", resp, "Failure responding to request") + } + + return +} + +// ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. +func (client HybridRunbookWorkerGroupClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/hybridRunbookWorkerGroups", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByAutomationAccountSender sends the ListByAutomationAccount request. The method will close the +// http.Response Body if it receives an error. +func (client HybridRunbookWorkerGroupClient) ListByAutomationAccountSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByAutomationAccountResponder handles the response to the ListByAutomationAccount request. The method always +// closes the http.Response Body. +func (client HybridRunbookWorkerGroupClient) ListByAutomationAccountResponder(resp *http.Response) (result HybridRunbookWorkerGroupsListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByAutomationAccountNextResults retrieves the next set of results, if any. +func (client HybridRunbookWorkerGroupClient) listByAutomationAccountNextResults(lastResults HybridRunbookWorkerGroupsListResult) (result HybridRunbookWorkerGroupsListResult, err error) { + req, err := lastResults.hybridRunbookWorkerGroupsListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "automation.HybridRunbookWorkerGroupClient", "listByAutomationAccountNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "automation.HybridRunbookWorkerGroupClient", "listByAutomationAccountNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.HybridRunbookWorkerGroupClient", "listByAutomationAccountNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByAutomationAccountComplete enumerates all values, automatically crossing page boundaries as required. +func (client HybridRunbookWorkerGroupClient) ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (result HybridRunbookWorkerGroupsListResultIterator, err error) { + result.page, err = client.ListByAutomationAccount(ctx, resourceGroupName, automationAccountName, filter) + return +} + +// Update update a hybrid runbook worker group. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// hybridRunbookWorkerGroupName - the hybrid runbook worker group name +// parameters - the hybrid runbook worker group +func (client HybridRunbookWorkerGroupClient) Update(ctx context.Context, resourceGroupName string, automationAccountName string, hybridRunbookWorkerGroupName string, parameters HybridRunbookWorkerGroupUpdateParameters) (result HybridRunbookWorkerGroup, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.HybridRunbookWorkerGroupClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, automationAccountName, hybridRunbookWorkerGroupName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.HybridRunbookWorkerGroupClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.HybridRunbookWorkerGroupClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.HybridRunbookWorkerGroupClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client HybridRunbookWorkerGroupClient) UpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, hybridRunbookWorkerGroupName string, parameters HybridRunbookWorkerGroupUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "hybridRunbookWorkerGroupName": autorest.Encode("path", hybridRunbookWorkerGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/hybridRunbookWorkerGroups/{hybridRunbookWorkerGroupName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client HybridRunbookWorkerGroupClient) UpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client HybridRunbookWorkerGroupClient) UpdateResponder(resp *http.Response) (result HybridRunbookWorkerGroup, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/job.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/job.go new file mode 100644 index 000000000..2333affa4 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/job.go @@ -0,0 +1,729 @@ +package automation + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// JobClient is the automation Client +type JobClient struct { + BaseClient +} + +// NewJobClient creates an instance of the JobClient client. +func NewJobClient(subscriptionID string) JobClient { + return NewJobClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewJobClientWithBaseURI creates an instance of the JobClient client. +func NewJobClientWithBaseURI(baseURI string, subscriptionID string) JobClient { + return JobClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Create create a job of the runbook. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// jobName - the job name. +// parameters - the parameters supplied to the create job operation. +// clientRequestID - identifies this specific client request. +func (client JobClient) Create(ctx context.Context, resourceGroupName string, automationAccountName string, jobName string, parameters JobCreateParameters, clientRequestID string) (result Job, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.JobCreateProperties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.JobClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, resourceGroupName, automationAccountName, jobName, parameters, clientRequestID) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.JobClient", "Create", nil, "Failure preparing request") + return + } + + resp, err := client.CreateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.JobClient", "Create", resp, "Failure sending request") + return + } + + result, err = client.CreateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.JobClient", "Create", resp, "Failure responding to request") + } + + return +} + +// CreatePreparer prepares the Create request. +func (client JobClient) CreatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, jobName string, parameters JobCreateParameters, clientRequestID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "jobName": autorest.Encode("path", jobName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-05-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + if len(clientRequestID) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("clientRequestId", autorest.String(clientRequestID))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client JobClient) CreateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client JobClient) CreateResponder(resp *http.Response) (result Job, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get retrieve the job identified by job name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// jobName - the job name. +// clientRequestID - identifies this specific client request. +func (client JobClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, jobName string, clientRequestID string) (result Job, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.JobClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, jobName, clientRequestID) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.JobClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.JobClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.JobClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client JobClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, jobName string, clientRequestID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "jobName": autorest.Encode("path", jobName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-05-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if len(clientRequestID) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("clientRequestId", autorest.String(clientRequestID))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client JobClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client JobClient) GetResponder(resp *http.Response) (result Job, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetOutput retrieve the job output identified by job name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// jobName - the name of the job to be created. +// clientRequestID - identifies this specific client request. +func (client JobClient) GetOutput(ctx context.Context, resourceGroupName string, automationAccountName string, jobName string, clientRequestID string) (result String, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.JobClient", "GetOutput", err.Error()) + } + + req, err := client.GetOutputPreparer(ctx, resourceGroupName, automationAccountName, jobName, clientRequestID) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.JobClient", "GetOutput", nil, "Failure preparing request") + return + } + + resp, err := client.GetOutputSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.JobClient", "GetOutput", resp, "Failure sending request") + return + } + + result, err = client.GetOutputResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.JobClient", "GetOutput", resp, "Failure responding to request") + } + + return +} + +// GetOutputPreparer prepares the GetOutput request. +func (client JobClient) GetOutputPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, jobName string, clientRequestID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "jobName": autorest.Encode("path", jobName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-05-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobName}/output", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if len(clientRequestID) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("clientRequestId", autorest.String(clientRequestID))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetOutputSender sends the GetOutput request. The method will close the +// http.Response Body if it receives an error. +func (client JobClient) GetOutputSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetOutputResponder handles the response to the GetOutput request. The method always +// closes the http.Response Body. +func (client JobClient) GetOutputResponder(resp *http.Response) (result String, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetRunbookContent retrieve the runbook content of the job identified by job name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// jobName - the job name. +// clientRequestID - identifies this specific client request. +func (client JobClient) GetRunbookContent(ctx context.Context, resourceGroupName string, automationAccountName string, jobName string, clientRequestID string) (result String, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.JobClient", "GetRunbookContent", err.Error()) + } + + req, err := client.GetRunbookContentPreparer(ctx, resourceGroupName, automationAccountName, jobName, clientRequestID) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.JobClient", "GetRunbookContent", nil, "Failure preparing request") + return + } + + resp, err := client.GetRunbookContentSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.JobClient", "GetRunbookContent", resp, "Failure sending request") + return + } + + result, err = client.GetRunbookContentResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.JobClient", "GetRunbookContent", resp, "Failure responding to request") + } + + return +} + +// GetRunbookContentPreparer prepares the GetRunbookContent request. +func (client JobClient) GetRunbookContentPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, jobName string, clientRequestID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "jobName": autorest.Encode("path", jobName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-05-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobName}/runbookContent", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if len(clientRequestID) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("clientRequestId", autorest.String(clientRequestID))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetRunbookContentSender sends the GetRunbookContent request. The method will close the +// http.Response Body if it receives an error. +func (client JobClient) GetRunbookContentSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetRunbookContentResponder handles the response to the GetRunbookContent request. The method always +// closes the http.Response Body. +func (client JobClient) GetRunbookContentResponder(resp *http.Response) (result String, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByAutomationAccount retrieve a list of jobs. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// filter - the filter to apply on the operation. +// clientRequestID - identifies this specific client request. +func (client JobClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string, filter string, clientRequestID string) (result JobListResultV2Page, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.JobClient", "ListByAutomationAccount", err.Error()) + } + + result.fn = client.listByAutomationAccountNextResults + req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName, filter, clientRequestID) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.JobClient", "ListByAutomationAccount", nil, "Failure preparing request") + return + } + + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.jlrv.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.JobClient", "ListByAutomationAccount", resp, "Failure sending request") + return + } + + result.jlrv, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.JobClient", "ListByAutomationAccount", resp, "Failure responding to request") + } + + return +} + +// ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. +func (client JobClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, filter string, clientRequestID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-05-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if len(clientRequestID) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("clientRequestId", autorest.String(clientRequestID))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByAutomationAccountSender sends the ListByAutomationAccount request. The method will close the +// http.Response Body if it receives an error. +func (client JobClient) ListByAutomationAccountSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByAutomationAccountResponder handles the response to the ListByAutomationAccount request. The method always +// closes the http.Response Body. +func (client JobClient) ListByAutomationAccountResponder(resp *http.Response) (result JobListResultV2, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByAutomationAccountNextResults retrieves the next set of results, if any. +func (client JobClient) listByAutomationAccountNextResults(lastResults JobListResultV2) (result JobListResultV2, err error) { + req, err := lastResults.jobListResultV2Preparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "automation.JobClient", "listByAutomationAccountNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "automation.JobClient", "listByAutomationAccountNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.JobClient", "listByAutomationAccountNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByAutomationAccountComplete enumerates all values, automatically crossing page boundaries as required. +func (client JobClient) ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string, filter string, clientRequestID string) (result JobListResultV2Iterator, err error) { + result.page, err = client.ListByAutomationAccount(ctx, resourceGroupName, automationAccountName, filter, clientRequestID) + return +} + +// Resume resume the job identified by jobName. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// jobName - the job name. +// clientRequestID - identifies this specific client request. +func (client JobClient) Resume(ctx context.Context, resourceGroupName string, automationAccountName string, jobName string, clientRequestID string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.JobClient", "Resume", err.Error()) + } + + req, err := client.ResumePreparer(ctx, resourceGroupName, automationAccountName, jobName, clientRequestID) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.JobClient", "Resume", nil, "Failure preparing request") + return + } + + resp, err := client.ResumeSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "automation.JobClient", "Resume", resp, "Failure sending request") + return + } + + result, err = client.ResumeResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.JobClient", "Resume", resp, "Failure responding to request") + } + + return +} + +// ResumePreparer prepares the Resume request. +func (client JobClient) ResumePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, jobName string, clientRequestID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "jobName": autorest.Encode("path", jobName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-05-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobName}/resume", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if len(clientRequestID) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("clientRequestId", autorest.String(clientRequestID))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ResumeSender sends the Resume request. The method will close the +// http.Response Body if it receives an error. +func (client JobClient) ResumeSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ResumeResponder handles the response to the Resume request. The method always +// closes the http.Response Body. +func (client JobClient) ResumeResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Stop stop the job identified by jobName. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// jobName - the job name. +// clientRequestID - identifies this specific client request. +func (client JobClient) Stop(ctx context.Context, resourceGroupName string, automationAccountName string, jobName string, clientRequestID string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.JobClient", "Stop", err.Error()) + } + + req, err := client.StopPreparer(ctx, resourceGroupName, automationAccountName, jobName, clientRequestID) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.JobClient", "Stop", nil, "Failure preparing request") + return + } + + resp, err := client.StopSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "automation.JobClient", "Stop", resp, "Failure sending request") + return + } + + result, err = client.StopResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.JobClient", "Stop", resp, "Failure responding to request") + } + + return +} + +// StopPreparer prepares the Stop request. +func (client JobClient) StopPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, jobName string, clientRequestID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "jobName": autorest.Encode("path", jobName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-05-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobName}/stop", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if len(clientRequestID) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("clientRequestId", autorest.String(clientRequestID))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// StopSender sends the Stop request. The method will close the +// http.Response Body if it receives an error. +func (client JobClient) StopSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// StopResponder handles the response to the Stop request. The method always +// closes the http.Response Body. +func (client JobClient) StopResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Suspend suspend the job identified by job name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// jobName - the job name. +// clientRequestID - identifies this specific client request. +func (client JobClient) Suspend(ctx context.Context, resourceGroupName string, automationAccountName string, jobName string, clientRequestID string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.JobClient", "Suspend", err.Error()) + } + + req, err := client.SuspendPreparer(ctx, resourceGroupName, automationAccountName, jobName, clientRequestID) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.JobClient", "Suspend", nil, "Failure preparing request") + return + } + + resp, err := client.SuspendSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "automation.JobClient", "Suspend", resp, "Failure sending request") + return + } + + result, err = client.SuspendResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.JobClient", "Suspend", resp, "Failure responding to request") + } + + return +} + +// SuspendPreparer prepares the Suspend request. +func (client JobClient) SuspendPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, jobName string, clientRequestID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "jobName": autorest.Encode("path", jobName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-05-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobName}/suspend", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if len(clientRequestID) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("clientRequestId", autorest.String(clientRequestID))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// SuspendSender sends the Suspend request. The method will close the +// http.Response Body if it receives an error. +func (client JobClient) SuspendSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// SuspendResponder handles the response to the Suspend request. The method always +// closes the http.Response Body. +func (client JobClient) SuspendResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/jobschedule.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/jobschedule.go new file mode 100644 index 000000000..a08bccbd6 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/jobschedule.go @@ -0,0 +1,387 @@ +package automation + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/satori/go.uuid" + "net/http" +) + +// JobScheduleClient is the automation Client +type JobScheduleClient struct { + BaseClient +} + +// NewJobScheduleClient creates an instance of the JobScheduleClient client. +func NewJobScheduleClient(subscriptionID string) JobScheduleClient { + return NewJobScheduleClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewJobScheduleClientWithBaseURI creates an instance of the JobScheduleClient client. +func NewJobScheduleClientWithBaseURI(baseURI string, subscriptionID string) JobScheduleClient { + return JobScheduleClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Create create a job schedule. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// jobScheduleID - the job schedule name. +// parameters - the parameters supplied to the create job schedule operation. +func (client JobScheduleClient) Create(ctx context.Context, resourceGroupName string, automationAccountName string, jobScheduleID uuid.UUID, parameters JobScheduleCreateParameters) (result JobSchedule, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.JobScheduleCreateProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.JobScheduleCreateProperties.Schedule", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.JobScheduleCreateProperties.Runbook", Name: validation.Null, Rule: true, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("automation.JobScheduleClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, resourceGroupName, automationAccountName, jobScheduleID, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.JobScheduleClient", "Create", nil, "Failure preparing request") + return + } + + resp, err := client.CreateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.JobScheduleClient", "Create", resp, "Failure sending request") + return + } + + result, err = client.CreateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.JobScheduleClient", "Create", resp, "Failure responding to request") + } + + return +} + +// CreatePreparer prepares the Create request. +func (client JobScheduleClient) CreatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, jobScheduleID uuid.UUID, parameters JobScheduleCreateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "jobScheduleId": autorest.Encode("path", jobScheduleID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobSchedules/{jobScheduleId}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client JobScheduleClient) CreateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client JobScheduleClient) CreateResponder(resp *http.Response) (result JobSchedule, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete delete the job schedule identified by job schedule name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// jobScheduleID - the job schedule name. +func (client JobScheduleClient) Delete(ctx context.Context, resourceGroupName string, automationAccountName string, jobScheduleID uuid.UUID) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.JobScheduleClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, automationAccountName, jobScheduleID) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.JobScheduleClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "automation.JobScheduleClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.JobScheduleClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client JobScheduleClient) DeletePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, jobScheduleID uuid.UUID) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "jobScheduleId": autorest.Encode("path", jobScheduleID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobSchedules/{jobScheduleId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client JobScheduleClient) DeleteSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client JobScheduleClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get retrieve the job schedule identified by job schedule name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// jobScheduleID - the job schedule name. +func (client JobScheduleClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, jobScheduleID uuid.UUID) (result JobSchedule, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.JobScheduleClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, jobScheduleID) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.JobScheduleClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.JobScheduleClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.JobScheduleClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client JobScheduleClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, jobScheduleID uuid.UUID) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "jobScheduleId": autorest.Encode("path", jobScheduleID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobSchedules/{jobScheduleId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client JobScheduleClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client JobScheduleClient) GetResponder(resp *http.Response) (result JobSchedule, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByAutomationAccount retrieve a list of job schedules. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// filter - the filter to apply on the operation. +func (client JobScheduleClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (result JobScheduleListResultPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.JobScheduleClient", "ListByAutomationAccount", err.Error()) + } + + result.fn = client.listByAutomationAccountNextResults + req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.JobScheduleClient", "ListByAutomationAccount", nil, "Failure preparing request") + return + } + + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.jslr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.JobScheduleClient", "ListByAutomationAccount", resp, "Failure sending request") + return + } + + result.jslr, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.JobScheduleClient", "ListByAutomationAccount", resp, "Failure responding to request") + } + + return +} + +// ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. +func (client JobScheduleClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobSchedules", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByAutomationAccountSender sends the ListByAutomationAccount request. The method will close the +// http.Response Body if it receives an error. +func (client JobScheduleClient) ListByAutomationAccountSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByAutomationAccountResponder handles the response to the ListByAutomationAccount request. The method always +// closes the http.Response Body. +func (client JobScheduleClient) ListByAutomationAccountResponder(resp *http.Response) (result JobScheduleListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByAutomationAccountNextResults retrieves the next set of results, if any. +func (client JobScheduleClient) listByAutomationAccountNextResults(lastResults JobScheduleListResult) (result JobScheduleListResult, err error) { + req, err := lastResults.jobScheduleListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "automation.JobScheduleClient", "listByAutomationAccountNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "automation.JobScheduleClient", "listByAutomationAccountNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.JobScheduleClient", "listByAutomationAccountNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByAutomationAccountComplete enumerates all values, automatically crossing page boundaries as required. +func (client JobScheduleClient) ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (result JobScheduleListResultIterator, err error) { + result.page, err = client.ListByAutomationAccount(ctx, resourceGroupName, automationAccountName, filter) + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/jobstream.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/jobstream.go new file mode 100644 index 000000000..9ea7cb274 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/jobstream.go @@ -0,0 +1,239 @@ +package automation + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// JobStreamClient is the automation Client +type JobStreamClient struct { + BaseClient +} + +// NewJobStreamClient creates an instance of the JobStreamClient client. +func NewJobStreamClient(subscriptionID string) JobStreamClient { + return NewJobStreamClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewJobStreamClientWithBaseURI creates an instance of the JobStreamClient client. +func NewJobStreamClientWithBaseURI(baseURI string, subscriptionID string) JobStreamClient { + return JobStreamClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get retrieve the job stream identified by job stream id. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// jobName - the job name. +// jobStreamID - the job stream id. +// clientRequestID - identifies this specific client request. +func (client JobStreamClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, jobName string, jobStreamID string, clientRequestID string) (result JobStream, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.JobStreamClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, jobName, jobStreamID, clientRequestID) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.JobStreamClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.JobStreamClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.JobStreamClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client JobStreamClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, jobName string, jobStreamID string, clientRequestID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "jobName": autorest.Encode("path", jobName), + "jobStreamId": autorest.Encode("path", jobStreamID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-05-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobName}/streams/{jobStreamId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if len(clientRequestID) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("clientRequestId", autorest.String(clientRequestID))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client JobStreamClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client JobStreamClient) GetResponder(resp *http.Response) (result JobStream, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByJob retrieve a list of jobs streams identified by job name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// jobName - the job name. +// filter - the filter to apply on the operation. +// clientRequestID - identifies this specific client request. +func (client JobStreamClient) ListByJob(ctx context.Context, resourceGroupName string, automationAccountName string, jobName string, filter string, clientRequestID string) (result JobStreamListResultPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.JobStreamClient", "ListByJob", err.Error()) + } + + result.fn = client.listByJobNextResults + req, err := client.ListByJobPreparer(ctx, resourceGroupName, automationAccountName, jobName, filter, clientRequestID) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.JobStreamClient", "ListByJob", nil, "Failure preparing request") + return + } + + resp, err := client.ListByJobSender(req) + if err != nil { + result.jslr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.JobStreamClient", "ListByJob", resp, "Failure sending request") + return + } + + result.jslr, err = client.ListByJobResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.JobStreamClient", "ListByJob", resp, "Failure responding to request") + } + + return +} + +// ListByJobPreparer prepares the ListByJob request. +func (client JobStreamClient) ListByJobPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, jobName string, filter string, clientRequestID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "jobName": autorest.Encode("path", jobName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-05-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobName}/streams", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if len(clientRequestID) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("clientRequestId", autorest.String(clientRequestID))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByJobSender sends the ListByJob request. The method will close the +// http.Response Body if it receives an error. +func (client JobStreamClient) ListByJobSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByJobResponder handles the response to the ListByJob request. The method always +// closes the http.Response Body. +func (client JobStreamClient) ListByJobResponder(resp *http.Response) (result JobStreamListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByJobNextResults retrieves the next set of results, if any. +func (client JobStreamClient) listByJobNextResults(lastResults JobStreamListResult) (result JobStreamListResult, err error) { + req, err := lastResults.jobStreamListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "automation.JobStreamClient", "listByJobNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByJobSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "automation.JobStreamClient", "listByJobNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByJobResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.JobStreamClient", "listByJobNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByJobComplete enumerates all values, automatically crossing page boundaries as required. +func (client JobStreamClient) ListByJobComplete(ctx context.Context, resourceGroupName string, automationAccountName string, jobName string, filter string, clientRequestID string) (result JobStreamListResultIterator, err error) { + result.page, err = client.ListByJob(ctx, resourceGroupName, automationAccountName, jobName, filter, clientRequestID) + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/keys.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/keys.go new file mode 100644 index 000000000..a063a20de --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/keys.go @@ -0,0 +1,116 @@ +package automation + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// KeysClient is the automation Client +type KeysClient struct { + BaseClient +} + +// NewKeysClient creates an instance of the KeysClient client. +func NewKeysClient(subscriptionID string) KeysClient { + return NewKeysClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewKeysClientWithBaseURI creates an instance of the KeysClient client. +func NewKeysClientWithBaseURI(baseURI string, subscriptionID string) KeysClient { + return KeysClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// ListByAutomationAccount retrieve the automation keys for an account. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +func (client KeysClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string) (result KeyListResult, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.KeysClient", "ListByAutomationAccount", err.Error()) + } + + req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.KeysClient", "ListByAutomationAccount", nil, "Failure preparing request") + return + } + + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.KeysClient", "ListByAutomationAccount", resp, "Failure sending request") + return + } + + result, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.KeysClient", "ListByAutomationAccount", resp, "Failure responding to request") + } + + return +} + +// ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. +func (client KeysClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/listKeys", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByAutomationAccountSender sends the ListByAutomationAccount request. The method will close the +// http.Response Body if it receives an error. +func (client KeysClient) ListByAutomationAccountSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByAutomationAccountResponder handles the response to the ListByAutomationAccount request. The method always +// closes the http.Response Body. +func (client KeysClient) ListByAutomationAccountResponder(resp *http.Response) (result KeyListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/linkedworkspace.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/linkedworkspace.go new file mode 100644 index 000000000..0ddea23c6 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/linkedworkspace.go @@ -0,0 +1,116 @@ +package automation + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// LinkedWorkspaceClient is the automation Client +type LinkedWorkspaceClient struct { + BaseClient +} + +// NewLinkedWorkspaceClient creates an instance of the LinkedWorkspaceClient client. +func NewLinkedWorkspaceClient(subscriptionID string) LinkedWorkspaceClient { + return NewLinkedWorkspaceClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewLinkedWorkspaceClientWithBaseURI creates an instance of the LinkedWorkspaceClient client. +func NewLinkedWorkspaceClientWithBaseURI(baseURI string, subscriptionID string) LinkedWorkspaceClient { + return LinkedWorkspaceClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get retrieve the linked workspace for the account id. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +func (client LinkedWorkspaceClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string) (result LinkedWorkspace, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.LinkedWorkspaceClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.LinkedWorkspaceClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.LinkedWorkspaceClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.LinkedWorkspaceClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client LinkedWorkspaceClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/linkedWorkspace", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client LinkedWorkspaceClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client LinkedWorkspaceClient) GetResponder(resp *http.Response) (result LinkedWorkspace, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/models.go new file mode 100644 index 000000000..a40d1a886 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/models.go @@ -0,0 +1,8915 @@ +package automation + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "encoding/json" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/date" + "github.com/Azure/go-autorest/autorest/to" + "github.com/satori/go.uuid" + "net/http" +) + +// AccountState enumerates the values for account state. +type AccountState string + +const ( + // Ok ... + Ok AccountState = "Ok" + // Suspended ... + Suspended AccountState = "Suspended" + // Unavailable ... + Unavailable AccountState = "Unavailable" +) + +// PossibleAccountStateValues returns an array of possible values for the AccountState const type. +func PossibleAccountStateValues() []AccountState { + return []AccountState{Ok, Suspended, Unavailable} +} + +// AgentRegistrationKeyName enumerates the values for agent registration key name. +type AgentRegistrationKeyName string + +const ( + // Primary ... + Primary AgentRegistrationKeyName = "primary" + // Secondary ... + Secondary AgentRegistrationKeyName = "secondary" +) + +// PossibleAgentRegistrationKeyNameValues returns an array of possible values for the AgentRegistrationKeyName const type. +func PossibleAgentRegistrationKeyNameValues() []AgentRegistrationKeyName { + return []AgentRegistrationKeyName{Primary, Secondary} +} + +// ContentSourceType enumerates the values for content source type. +type ContentSourceType string + +const ( + // EmbeddedContent ... + EmbeddedContent ContentSourceType = "embeddedContent" + // URI ... + URI ContentSourceType = "uri" +) + +// PossibleContentSourceTypeValues returns an array of possible values for the ContentSourceType const type. +func PossibleContentSourceTypeValues() []ContentSourceType { + return []ContentSourceType{EmbeddedContent, URI} +} + +// DscConfigurationProvisioningState enumerates the values for dsc configuration provisioning state. +type DscConfigurationProvisioningState string + +const ( + // Succeeded ... + Succeeded DscConfigurationProvisioningState = "Succeeded" +) + +// PossibleDscConfigurationProvisioningStateValues returns an array of possible values for the DscConfigurationProvisioningState const type. +func PossibleDscConfigurationProvisioningStateValues() []DscConfigurationProvisioningState { + return []DscConfigurationProvisioningState{Succeeded} +} + +// DscConfigurationState enumerates the values for dsc configuration state. +type DscConfigurationState string + +const ( + // DscConfigurationStateEdit ... + DscConfigurationStateEdit DscConfigurationState = "Edit" + // DscConfigurationStateNew ... + DscConfigurationStateNew DscConfigurationState = "New" + // DscConfigurationStatePublished ... + DscConfigurationStatePublished DscConfigurationState = "Published" +) + +// PossibleDscConfigurationStateValues returns an array of possible values for the DscConfigurationState const type. +func PossibleDscConfigurationStateValues() []DscConfigurationState { + return []DscConfigurationState{DscConfigurationStateEdit, DscConfigurationStateNew, DscConfigurationStatePublished} +} + +// GroupTypeEnum enumerates the values for group type enum. +type GroupTypeEnum string + +const ( + // System ... + System GroupTypeEnum = "System" + // User ... + User GroupTypeEnum = "User" +) + +// PossibleGroupTypeEnumValues returns an array of possible values for the GroupTypeEnum const type. +func PossibleGroupTypeEnumValues() []GroupTypeEnum { + return []GroupTypeEnum{System, User} +} + +// HTTPStatusCode enumerates the values for http status code. +type HTTPStatusCode string + +const ( + // Accepted ... + Accepted HTTPStatusCode = "Accepted" + // Ambiguous ... + Ambiguous HTTPStatusCode = "Ambiguous" + // BadGateway ... + BadGateway HTTPStatusCode = "BadGateway" + // BadRequest ... + BadRequest HTTPStatusCode = "BadRequest" + // Conflict ... + Conflict HTTPStatusCode = "Conflict" + // Continue ... + Continue HTTPStatusCode = "Continue" + // Created ... + Created HTTPStatusCode = "Created" + // ExpectationFailed ... + ExpectationFailed HTTPStatusCode = "ExpectationFailed" + // Forbidden ... + Forbidden HTTPStatusCode = "Forbidden" + // Found ... + Found HTTPStatusCode = "Found" + // GatewayTimeout ... + GatewayTimeout HTTPStatusCode = "GatewayTimeout" + // Gone ... + Gone HTTPStatusCode = "Gone" + // HTTPVersionNotSupported ... + HTTPVersionNotSupported HTTPStatusCode = "HttpVersionNotSupported" + // InternalServerError ... + InternalServerError HTTPStatusCode = "InternalServerError" + // LengthRequired ... + LengthRequired HTTPStatusCode = "LengthRequired" + // MethodNotAllowed ... + MethodNotAllowed HTTPStatusCode = "MethodNotAllowed" + // Moved ... + Moved HTTPStatusCode = "Moved" + // MovedPermanently ... + MovedPermanently HTTPStatusCode = "MovedPermanently" + // MultipleChoices ... + MultipleChoices HTTPStatusCode = "MultipleChoices" + // NoContent ... + NoContent HTTPStatusCode = "NoContent" + // NonAuthoritativeInformation ... + NonAuthoritativeInformation HTTPStatusCode = "NonAuthoritativeInformation" + // NotAcceptable ... + NotAcceptable HTTPStatusCode = "NotAcceptable" + // NotFound ... + NotFound HTTPStatusCode = "NotFound" + // NotImplemented ... + NotImplemented HTTPStatusCode = "NotImplemented" + // NotModified ... + NotModified HTTPStatusCode = "NotModified" + // OK ... + OK HTTPStatusCode = "OK" + // PartialContent ... + PartialContent HTTPStatusCode = "PartialContent" + // PaymentRequired ... + PaymentRequired HTTPStatusCode = "PaymentRequired" + // PreconditionFailed ... + PreconditionFailed HTTPStatusCode = "PreconditionFailed" + // ProxyAuthenticationRequired ... + ProxyAuthenticationRequired HTTPStatusCode = "ProxyAuthenticationRequired" + // Redirect ... + Redirect HTTPStatusCode = "Redirect" + // RedirectKeepVerb ... + RedirectKeepVerb HTTPStatusCode = "RedirectKeepVerb" + // RedirectMethod ... + RedirectMethod HTTPStatusCode = "RedirectMethod" + // RequestedRangeNotSatisfiable ... + RequestedRangeNotSatisfiable HTTPStatusCode = "RequestedRangeNotSatisfiable" + // RequestEntityTooLarge ... + RequestEntityTooLarge HTTPStatusCode = "RequestEntityTooLarge" + // RequestTimeout ... + RequestTimeout HTTPStatusCode = "RequestTimeout" + // RequestURITooLong ... + RequestURITooLong HTTPStatusCode = "RequestUriTooLong" + // ResetContent ... + ResetContent HTTPStatusCode = "ResetContent" + // SeeOther ... + SeeOther HTTPStatusCode = "SeeOther" + // ServiceUnavailable ... + ServiceUnavailable HTTPStatusCode = "ServiceUnavailable" + // SwitchingProtocols ... + SwitchingProtocols HTTPStatusCode = "SwitchingProtocols" + // TemporaryRedirect ... + TemporaryRedirect HTTPStatusCode = "TemporaryRedirect" + // Unauthorized ... + Unauthorized HTTPStatusCode = "Unauthorized" + // UnsupportedMediaType ... + UnsupportedMediaType HTTPStatusCode = "UnsupportedMediaType" + // Unused ... + Unused HTTPStatusCode = "Unused" + // UpgradeRequired ... + UpgradeRequired HTTPStatusCode = "UpgradeRequired" + // UseProxy ... + UseProxy HTTPStatusCode = "UseProxy" +) + +// PossibleHTTPStatusCodeValues returns an array of possible values for the HTTPStatusCode const type. +func PossibleHTTPStatusCodeValues() []HTTPStatusCode { + return []HTTPStatusCode{Accepted, Ambiguous, BadGateway, BadRequest, Conflict, Continue, Created, ExpectationFailed, Forbidden, Found, GatewayTimeout, Gone, HTTPVersionNotSupported, InternalServerError, LengthRequired, MethodNotAllowed, Moved, MovedPermanently, MultipleChoices, NoContent, NonAuthoritativeInformation, NotAcceptable, NotFound, NotImplemented, NotModified, OK, PartialContent, PaymentRequired, PreconditionFailed, ProxyAuthenticationRequired, Redirect, RedirectKeepVerb, RedirectMethod, RequestedRangeNotSatisfiable, RequestEntityTooLarge, RequestTimeout, RequestURITooLong, ResetContent, SeeOther, ServiceUnavailable, SwitchingProtocols, TemporaryRedirect, Unauthorized, UnsupportedMediaType, Unused, UpgradeRequired, UseProxy} +} + +// JobProvisioningState enumerates the values for job provisioning state. +type JobProvisioningState string + +const ( + // JobProvisioningStateFailed ... + JobProvisioningStateFailed JobProvisioningState = "Failed" + // JobProvisioningStateProcessing ... + JobProvisioningStateProcessing JobProvisioningState = "Processing" + // JobProvisioningStateSucceeded ... + JobProvisioningStateSucceeded JobProvisioningState = "Succeeded" + // JobProvisioningStateSuspended ... + JobProvisioningStateSuspended JobProvisioningState = "Suspended" +) + +// PossibleJobProvisioningStateValues returns an array of possible values for the JobProvisioningState const type. +func PossibleJobProvisioningStateValues() []JobProvisioningState { + return []JobProvisioningState{JobProvisioningStateFailed, JobProvisioningStateProcessing, JobProvisioningStateSucceeded, JobProvisioningStateSuspended} +} + +// JobStatus enumerates the values for job status. +type JobStatus string + +const ( + // JobStatusActivating ... + JobStatusActivating JobStatus = "Activating" + // JobStatusBlocked ... + JobStatusBlocked JobStatus = "Blocked" + // JobStatusCompleted ... + JobStatusCompleted JobStatus = "Completed" + // JobStatusDisconnected ... + JobStatusDisconnected JobStatus = "Disconnected" + // JobStatusFailed ... + JobStatusFailed JobStatus = "Failed" + // JobStatusNew ... + JobStatusNew JobStatus = "New" + // JobStatusRemoving ... + JobStatusRemoving JobStatus = "Removing" + // JobStatusResuming ... + JobStatusResuming JobStatus = "Resuming" + // JobStatusRunning ... + JobStatusRunning JobStatus = "Running" + // JobStatusStopped ... + JobStatusStopped JobStatus = "Stopped" + // JobStatusStopping ... + JobStatusStopping JobStatus = "Stopping" + // JobStatusSuspended ... + JobStatusSuspended JobStatus = "Suspended" + // JobStatusSuspending ... + JobStatusSuspending JobStatus = "Suspending" +) + +// PossibleJobStatusValues returns an array of possible values for the JobStatus const type. +func PossibleJobStatusValues() []JobStatus { + return []JobStatus{JobStatusActivating, JobStatusBlocked, JobStatusCompleted, JobStatusDisconnected, JobStatusFailed, JobStatusNew, JobStatusRemoving, JobStatusResuming, JobStatusRunning, JobStatusStopped, JobStatusStopping, JobStatusSuspended, JobStatusSuspending} +} + +// JobStreamType enumerates the values for job stream type. +type JobStreamType string + +const ( + // Any ... + Any JobStreamType = "Any" + // Debug ... + Debug JobStreamType = "Debug" + // Error ... + Error JobStreamType = "Error" + // Output ... + Output JobStreamType = "Output" + // Progress ... + Progress JobStreamType = "Progress" + // Verbose ... + Verbose JobStreamType = "Verbose" + // Warning ... + Warning JobStreamType = "Warning" +) + +// PossibleJobStreamTypeValues returns an array of possible values for the JobStreamType const type. +func PossibleJobStreamTypeValues() []JobStreamType { + return []JobStreamType{Any, Debug, Error, Output, Progress, Verbose, Warning} +} + +// KeyName enumerates the values for key name. +type KeyName string + +const ( + // KeyNamePrimary ... + KeyNamePrimary KeyName = "Primary" + // KeyNameSecondary ... + KeyNameSecondary KeyName = "Secondary" +) + +// PossibleKeyNameValues returns an array of possible values for the KeyName const type. +func PossibleKeyNameValues() []KeyName { + return []KeyName{KeyNamePrimary, KeyNameSecondary} +} + +// KeyPermissions enumerates the values for key permissions. +type KeyPermissions string + +const ( + // Full ... + Full KeyPermissions = "Full" + // Read ... + Read KeyPermissions = "Read" +) + +// PossibleKeyPermissionsValues returns an array of possible values for the KeyPermissions const type. +func PossibleKeyPermissionsValues() []KeyPermissions { + return []KeyPermissions{Full, Read} +} + +// LinuxUpdateClasses enumerates the values for linux update classes. +type LinuxUpdateClasses string + +const ( + // Critical ... + Critical LinuxUpdateClasses = "Critical" + // Other ... + Other LinuxUpdateClasses = "Other" + // Security ... + Security LinuxUpdateClasses = "Security" + // Unclassified ... + Unclassified LinuxUpdateClasses = "Unclassified" +) + +// PossibleLinuxUpdateClassesValues returns an array of possible values for the LinuxUpdateClasses const type. +func PossibleLinuxUpdateClassesValues() []LinuxUpdateClasses { + return []LinuxUpdateClasses{Critical, Other, Security, Unclassified} +} + +// ModuleProvisioningState enumerates the values for module provisioning state. +type ModuleProvisioningState string + +const ( + // ModuleProvisioningStateActivitiesStored ... + ModuleProvisioningStateActivitiesStored ModuleProvisioningState = "ActivitiesStored" + // ModuleProvisioningStateCancelled ... + ModuleProvisioningStateCancelled ModuleProvisioningState = "Cancelled" + // ModuleProvisioningStateConnectionTypeImported ... + ModuleProvisioningStateConnectionTypeImported ModuleProvisioningState = "ConnectionTypeImported" + // ModuleProvisioningStateContentDownloaded ... + ModuleProvisioningStateContentDownloaded ModuleProvisioningState = "ContentDownloaded" + // ModuleProvisioningStateContentRetrieved ... + ModuleProvisioningStateContentRetrieved ModuleProvisioningState = "ContentRetrieved" + // ModuleProvisioningStateContentStored ... + ModuleProvisioningStateContentStored ModuleProvisioningState = "ContentStored" + // ModuleProvisioningStateContentValidated ... + ModuleProvisioningStateContentValidated ModuleProvisioningState = "ContentValidated" + // ModuleProvisioningStateCreated ... + ModuleProvisioningStateCreated ModuleProvisioningState = "Created" + // ModuleProvisioningStateCreating ... + ModuleProvisioningStateCreating ModuleProvisioningState = "Creating" + // ModuleProvisioningStateFailed ... + ModuleProvisioningStateFailed ModuleProvisioningState = "Failed" + // ModuleProvisioningStateModuleDataStored ... + ModuleProvisioningStateModuleDataStored ModuleProvisioningState = "ModuleDataStored" + // ModuleProvisioningStateModuleImportRunbookComplete ... + ModuleProvisioningStateModuleImportRunbookComplete ModuleProvisioningState = "ModuleImportRunbookComplete" + // ModuleProvisioningStateRunningImportModuleRunbook ... + ModuleProvisioningStateRunningImportModuleRunbook ModuleProvisioningState = "RunningImportModuleRunbook" + // ModuleProvisioningStateStartingImportModuleRunbook ... + ModuleProvisioningStateStartingImportModuleRunbook ModuleProvisioningState = "StartingImportModuleRunbook" + // ModuleProvisioningStateSucceeded ... + ModuleProvisioningStateSucceeded ModuleProvisioningState = "Succeeded" + // ModuleProvisioningStateUpdating ... + ModuleProvisioningStateUpdating ModuleProvisioningState = "Updating" +) + +// PossibleModuleProvisioningStateValues returns an array of possible values for the ModuleProvisioningState const type. +func PossibleModuleProvisioningStateValues() []ModuleProvisioningState { + return []ModuleProvisioningState{ModuleProvisioningStateActivitiesStored, ModuleProvisioningStateCancelled, ModuleProvisioningStateConnectionTypeImported, ModuleProvisioningStateContentDownloaded, ModuleProvisioningStateContentRetrieved, ModuleProvisioningStateContentStored, ModuleProvisioningStateContentValidated, ModuleProvisioningStateCreated, ModuleProvisioningStateCreating, ModuleProvisioningStateFailed, ModuleProvisioningStateModuleDataStored, ModuleProvisioningStateModuleImportRunbookComplete, ModuleProvisioningStateRunningImportModuleRunbook, ModuleProvisioningStateStartingImportModuleRunbook, ModuleProvisioningStateSucceeded, ModuleProvisioningStateUpdating} +} + +// OperatingSystemType enumerates the values for operating system type. +type OperatingSystemType string + +const ( + // Linux ... + Linux OperatingSystemType = "Linux" + // Windows ... + Windows OperatingSystemType = "Windows" +) + +// PossibleOperatingSystemTypeValues returns an array of possible values for the OperatingSystemType const type. +func PossibleOperatingSystemTypeValues() []OperatingSystemType { + return []OperatingSystemType{Linux, Windows} +} + +// ProvisioningState enumerates the values for provisioning state. +type ProvisioningState string + +const ( + // Completed ... + Completed ProvisioningState = "Completed" + // Failed ... + Failed ProvisioningState = "Failed" + // Running ... + Running ProvisioningState = "Running" +) + +// PossibleProvisioningStateValues returns an array of possible values for the ProvisioningState const type. +func PossibleProvisioningStateValues() []ProvisioningState { + return []ProvisioningState{Completed, Failed, Running} +} + +// RunbookProvisioningState enumerates the values for runbook provisioning state. +type RunbookProvisioningState string + +const ( + // RunbookProvisioningStateSucceeded ... + RunbookProvisioningStateSucceeded RunbookProvisioningState = "Succeeded" +) + +// PossibleRunbookProvisioningStateValues returns an array of possible values for the RunbookProvisioningState const type. +func PossibleRunbookProvisioningStateValues() []RunbookProvisioningState { + return []RunbookProvisioningState{RunbookProvisioningStateSucceeded} +} + +// RunbookState enumerates the values for runbook state. +type RunbookState string + +const ( + // RunbookStateEdit ... + RunbookStateEdit RunbookState = "Edit" + // RunbookStateNew ... + RunbookStateNew RunbookState = "New" + // RunbookStatePublished ... + RunbookStatePublished RunbookState = "Published" +) + +// PossibleRunbookStateValues returns an array of possible values for the RunbookState const type. +func PossibleRunbookStateValues() []RunbookState { + return []RunbookState{RunbookStateEdit, RunbookStateNew, RunbookStatePublished} +} + +// RunbookTypeEnum enumerates the values for runbook type enum. +type RunbookTypeEnum string + +const ( + // Graph ... + Graph RunbookTypeEnum = "Graph" + // GraphPowerShell ... + GraphPowerShell RunbookTypeEnum = "GraphPowerShell" + // GraphPowerShellWorkflow ... + GraphPowerShellWorkflow RunbookTypeEnum = "GraphPowerShellWorkflow" + // PowerShell ... + PowerShell RunbookTypeEnum = "PowerShell" + // PowerShellWorkflow ... + PowerShellWorkflow RunbookTypeEnum = "PowerShellWorkflow" + // Script ... + Script RunbookTypeEnum = "Script" +) + +// PossibleRunbookTypeEnumValues returns an array of possible values for the RunbookTypeEnum const type. +func PossibleRunbookTypeEnumValues() []RunbookTypeEnum { + return []RunbookTypeEnum{Graph, GraphPowerShell, GraphPowerShellWorkflow, PowerShell, PowerShellWorkflow, Script} +} + +// ScheduleDay enumerates the values for schedule day. +type ScheduleDay string + +const ( + // Friday ... + Friday ScheduleDay = "Friday" + // Monday ... + Monday ScheduleDay = "Monday" + // Saturday ... + Saturday ScheduleDay = "Saturday" + // Sunday ... + Sunday ScheduleDay = "Sunday" + // Thursday ... + Thursday ScheduleDay = "Thursday" + // Tuesday ... + Tuesday ScheduleDay = "Tuesday" + // Wednesday ... + Wednesday ScheduleDay = "Wednesday" +) + +// PossibleScheduleDayValues returns an array of possible values for the ScheduleDay const type. +func PossibleScheduleDayValues() []ScheduleDay { + return []ScheduleDay{Friday, Monday, Saturday, Sunday, Thursday, Tuesday, Wednesday} +} + +// ScheduleFrequency enumerates the values for schedule frequency. +type ScheduleFrequency string + +const ( + // Day ... + Day ScheduleFrequency = "Day" + // Hour ... + Hour ScheduleFrequency = "Hour" + // Month ... + Month ScheduleFrequency = "Month" + // OneTime ... + OneTime ScheduleFrequency = "OneTime" + // Week ... + Week ScheduleFrequency = "Week" +) + +// PossibleScheduleFrequencyValues returns an array of possible values for the ScheduleFrequency const type. +func PossibleScheduleFrequencyValues() []ScheduleFrequency { + return []ScheduleFrequency{Day, Hour, Month, OneTime, Week} +} + +// SkuNameEnum enumerates the values for sku name enum. +type SkuNameEnum string + +const ( + // Basic ... + Basic SkuNameEnum = "Basic" + // Free ... + Free SkuNameEnum = "Free" +) + +// PossibleSkuNameEnumValues returns an array of possible values for the SkuNameEnum const type. +func PossibleSkuNameEnumValues() []SkuNameEnum { + return []SkuNameEnum{Basic, Free} +} + +// SourceType enumerates the values for source type. +type SourceType string + +const ( + // GitHub ... + GitHub SourceType = "GitHub" + // VsoGit ... + VsoGit SourceType = "VsoGit" + // VsoTfvc ... + VsoTfvc SourceType = "VsoTfvc" +) + +// PossibleSourceTypeValues returns an array of possible values for the SourceType const type. +func PossibleSourceTypeValues() []SourceType { + return []SourceType{GitHub, VsoGit, VsoTfvc} +} + +// StartType enumerates the values for start type. +type StartType string + +const ( + // AutoSync ... + AutoSync StartType = "AutoSync" + // ManualSync ... + ManualSync StartType = "ManualSync" +) + +// PossibleStartTypeValues returns an array of possible values for the StartType const type. +func PossibleStartTypeValues() []StartType { + return []StartType{AutoSync, ManualSync} +} + +// StreamType enumerates the values for stream type. +type StreamType string + +const ( + // StreamTypeError ... + StreamTypeError StreamType = "Error" + // StreamTypeOutput ... + StreamTypeOutput StreamType = "Output" +) + +// PossibleStreamTypeValues returns an array of possible values for the StreamType const type. +func PossibleStreamTypeValues() []StreamType { + return []StreamType{StreamTypeError, StreamTypeOutput} +} + +// WindowsUpdateClasses enumerates the values for windows update classes. +type WindowsUpdateClasses string + +const ( + // WindowsUpdateClassesCritical ... + WindowsUpdateClassesCritical WindowsUpdateClasses = "Critical" + // WindowsUpdateClassesDefinition ... + WindowsUpdateClassesDefinition WindowsUpdateClasses = "Definition" + // WindowsUpdateClassesFeaturePack ... + WindowsUpdateClassesFeaturePack WindowsUpdateClasses = "FeaturePack" + // WindowsUpdateClassesSecurity ... + WindowsUpdateClassesSecurity WindowsUpdateClasses = "Security" + // WindowsUpdateClassesServicePack ... + WindowsUpdateClassesServicePack WindowsUpdateClasses = "ServicePack" + // WindowsUpdateClassesTools ... + WindowsUpdateClassesTools WindowsUpdateClasses = "Tools" + // WindowsUpdateClassesUnclassified ... + WindowsUpdateClassesUnclassified WindowsUpdateClasses = "Unclassified" + // WindowsUpdateClassesUpdateRollup ... + WindowsUpdateClassesUpdateRollup WindowsUpdateClasses = "UpdateRollup" + // WindowsUpdateClassesUpdates ... + WindowsUpdateClassesUpdates WindowsUpdateClasses = "Updates" +) + +// PossibleWindowsUpdateClassesValues returns an array of possible values for the WindowsUpdateClasses const type. +func PossibleWindowsUpdateClassesValues() []WindowsUpdateClasses { + return []WindowsUpdateClasses{WindowsUpdateClassesCritical, WindowsUpdateClassesDefinition, WindowsUpdateClassesFeaturePack, WindowsUpdateClassesSecurity, WindowsUpdateClassesServicePack, WindowsUpdateClassesTools, WindowsUpdateClassesUnclassified, WindowsUpdateClassesUpdateRollup, WindowsUpdateClassesUpdates} +} + +// Account definition of the automation account type. +type Account struct { + autorest.Response `json:"-"` + // AccountProperties - Gets or sets the automation account properties. + *AccountProperties `json:"properties,omitempty"` + // Etag - Gets or sets the etag of the resource. + Etag *string `json:"etag,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // Location - The Azure Region where the resource lives + Location *string `json:"location,omitempty"` + // ID - Fully qualified resource Id for the resource + ID *string `json:"id,omitempty"` + // Name - The name of the resource + Name *string `json:"name,omitempty"` + // Type - The type of the resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Account. +func (a Account) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if a.AccountProperties != nil { + objectMap["properties"] = a.AccountProperties + } + if a.Etag != nil { + objectMap["etag"] = a.Etag + } + if a.Tags != nil { + objectMap["tags"] = a.Tags + } + if a.Location != nil { + objectMap["location"] = a.Location + } + if a.ID != nil { + objectMap["id"] = a.ID + } + if a.Name != nil { + objectMap["name"] = a.Name + } + if a.Type != nil { + objectMap["type"] = a.Type + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Account struct. +func (a *Account) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var accountProperties AccountProperties + err = json.Unmarshal(*v, &accountProperties) + if err != nil { + return err + } + a.AccountProperties = &accountProperties + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + a.Etag = &etag + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + a.Tags = tags + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + a.Location = &location + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + a.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + a.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + a.Type = &typeVar + } + } + } + + return nil +} + +// AccountCreateOrUpdateParameters the parameters supplied to the create or update automation account operation. +type AccountCreateOrUpdateParameters struct { + // AccountCreateOrUpdateProperties - Gets or sets account create or update properties. + *AccountCreateOrUpdateProperties `json:"properties,omitempty"` + // Name - Gets or sets name of the resource. + Name *string `json:"name,omitempty"` + // Location - Gets or sets the location of the resource. + Location *string `json:"location,omitempty"` + // Tags - Gets or sets the tags attached to the resource. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for AccountCreateOrUpdateParameters. +func (acoup AccountCreateOrUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if acoup.AccountCreateOrUpdateProperties != nil { + objectMap["properties"] = acoup.AccountCreateOrUpdateProperties + } + if acoup.Name != nil { + objectMap["name"] = acoup.Name + } + if acoup.Location != nil { + objectMap["location"] = acoup.Location + } + if acoup.Tags != nil { + objectMap["tags"] = acoup.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for AccountCreateOrUpdateParameters struct. +func (acoup *AccountCreateOrUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var accountCreateOrUpdateProperties AccountCreateOrUpdateProperties + err = json.Unmarshal(*v, &accountCreateOrUpdateProperties) + if err != nil { + return err + } + acoup.AccountCreateOrUpdateProperties = &accountCreateOrUpdateProperties + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + acoup.Name = &name + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + acoup.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + acoup.Tags = tags + } + } + } + + return nil +} + +// AccountCreateOrUpdateProperties the parameters supplied to the create or update account properties. +type AccountCreateOrUpdateProperties struct { + // Sku - Gets or sets account SKU. + Sku *Sku `json:"sku,omitempty"` +} + +// AccountListResult the response model for the list account operation. +type AccountListResult struct { + autorest.Response `json:"-"` + // Value - Gets or sets list of accounts. + Value *[]Account `json:"value,omitempty"` + // NextLink - Gets or sets the next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// AccountListResultIterator provides access to a complete listing of Account values. +type AccountListResultIterator struct { + i int + page AccountListResultPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *AccountListResultIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter AccountListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter AccountListResultIterator) Response() AccountListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter AccountListResultIterator) Value() Account { + if !iter.page.NotDone() { + return Account{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (alr AccountListResult) IsEmpty() bool { + return alr.Value == nil || len(*alr.Value) == 0 +} + +// accountListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (alr AccountListResult) accountListResultPreparer() (*http.Request, error) { + if alr.NextLink == nil || len(to.String(alr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(alr.NextLink))) +} + +// AccountListResultPage contains a page of Account values. +type AccountListResultPage struct { + fn func(AccountListResult) (AccountListResult, error) + alr AccountListResult +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *AccountListResultPage) Next() error { + next, err := page.fn(page.alr) + if err != nil { + return err + } + page.alr = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page AccountListResultPage) NotDone() bool { + return !page.alr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page AccountListResultPage) Response() AccountListResult { + return page.alr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page AccountListResultPage) Values() []Account { + if page.alr.IsEmpty() { + return nil + } + return *page.alr.Value +} + +// AccountProperties definition of the account property. +type AccountProperties struct { + // Sku - Gets or sets the SKU of account. + Sku *Sku `json:"sku,omitempty"` + // LastModifiedBy - Gets or sets the last modified by. + LastModifiedBy *string `json:"lastModifiedBy,omitempty"` + // State - Gets status of account. Possible values include: 'Ok', 'Unavailable', 'Suspended' + State AccountState `json:"state,omitempty"` + // CreationTime - Gets the creation time. + CreationTime *date.Time `json:"creationTime,omitempty"` + // LastModifiedTime - Gets the last modified time. + LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` + // Description - Gets or sets the description. + Description *string `json:"description,omitempty"` +} + +// AccountUpdateParameters the parameters supplied to the update automation account operation. +type AccountUpdateParameters struct { + // AccountUpdateProperties - Gets or sets account update properties. + *AccountUpdateProperties `json:"properties,omitempty"` + // Name - Gets or sets the name of the resource. + Name *string `json:"name,omitempty"` + // Location - Gets or sets the location of the resource. + Location *string `json:"location,omitempty"` + // Tags - Gets or sets the tags attached to the resource. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for AccountUpdateParameters. +func (aup AccountUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if aup.AccountUpdateProperties != nil { + objectMap["properties"] = aup.AccountUpdateProperties + } + if aup.Name != nil { + objectMap["name"] = aup.Name + } + if aup.Location != nil { + objectMap["location"] = aup.Location + } + if aup.Tags != nil { + objectMap["tags"] = aup.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for AccountUpdateParameters struct. +func (aup *AccountUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var accountUpdateProperties AccountUpdateProperties + err = json.Unmarshal(*v, &accountUpdateProperties) + if err != nil { + return err + } + aup.AccountUpdateProperties = &accountUpdateProperties + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + aup.Name = &name + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + aup.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + aup.Tags = tags + } + } + } + + return nil +} + +// AccountUpdateProperties the parameters supplied to the update account properties. +type AccountUpdateProperties struct { + // Sku - Gets or sets account SKU. + Sku *Sku `json:"sku,omitempty"` +} + +// Activity definition of the activity. +type Activity struct { + autorest.Response `json:"-"` + // ID - Gets or sets the id of the resource. + ID *string `json:"id,omitempty"` + // Name - Gets the name of the activity. + Name *string `json:"name,omitempty"` + // ActivityProperties - Gets or sets the properties of the activity. + *ActivityProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for Activity. +func (a Activity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if a.ID != nil { + objectMap["id"] = a.ID + } + if a.Name != nil { + objectMap["name"] = a.Name + } + if a.ActivityProperties != nil { + objectMap["properties"] = a.ActivityProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Activity struct. +func (a *Activity) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + a.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + a.Name = &name + } + case "properties": + if v != nil { + var activityProperties ActivityProperties + err = json.Unmarshal(*v, &activityProperties) + if err != nil { + return err + } + a.ActivityProperties = &activityProperties + } + } + } + + return nil +} + +// ActivityListResult the response model for the list activity operation. +type ActivityListResult struct { + autorest.Response `json:"-"` + // Value - Gets or sets a list of activities. + Value *[]Activity `json:"value,omitempty"` + // NextLink - Gets or sets the next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// ActivityListResultIterator provides access to a complete listing of Activity values. +type ActivityListResultIterator struct { + i int + page ActivityListResultPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ActivityListResultIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ActivityListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ActivityListResultIterator) Response() ActivityListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ActivityListResultIterator) Value() Activity { + if !iter.page.NotDone() { + return Activity{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (alr ActivityListResult) IsEmpty() bool { + return alr.Value == nil || len(*alr.Value) == 0 +} + +// activityListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (alr ActivityListResult) activityListResultPreparer() (*http.Request, error) { + if alr.NextLink == nil || len(to.String(alr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(alr.NextLink))) +} + +// ActivityListResultPage contains a page of Activity values. +type ActivityListResultPage struct { + fn func(ActivityListResult) (ActivityListResult, error) + alr ActivityListResult +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ActivityListResultPage) Next() error { + next, err := page.fn(page.alr) + if err != nil { + return err + } + page.alr = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ActivityListResultPage) NotDone() bool { + return !page.alr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ActivityListResultPage) Response() ActivityListResult { + return page.alr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ActivityListResultPage) Values() []Activity { + if page.alr.IsEmpty() { + return nil + } + return *page.alr.Value +} + +// ActivityOutputType definition of the activity output type. +type ActivityOutputType struct { + // Name - Gets or sets the name of the activity output type. + Name *string `json:"name,omitempty"` + // Type - Gets or sets the type of the activity output type. + Type *string `json:"type,omitempty"` +} + +// ActivityParameter definition of the activity parameter. +type ActivityParameter struct { + // Name - Gets or sets the name of the activity parameter. + Name *string `json:"name,omitempty"` + // Type - Gets or sets the type of the activity parameter. + Type *string `json:"type,omitempty"` + // IsMandatory - Gets or sets a Boolean value that indicates true if the parameter is required. If the value is false, the parameter is optional. + IsMandatory *bool `json:"isMandatory,omitempty"` + // IsDynamic - Gets or sets a Boolean value that indicates true if the parameter is dynamic. + IsDynamic *bool `json:"isDynamic,omitempty"` + // Position - Gets or sets the position of the activity parameter. + Position *int64 `json:"position,omitempty"` + // ValueFromPipeline - Gets or sets a Boolean value that indicates true if the parameter can take values from the incoming pipeline objects. This setting is used if the cmdlet must access the complete input object. false indicates that the parameter cannot take values from the complete input object. + ValueFromPipeline *bool `json:"valueFromPipeline,omitempty"` + // ValueFromPipelineByPropertyName - Gets or sets a Boolean value that indicates true if the parameter can be filled from a property of the incoming pipeline object that has the same name as this parameter. false indicates that the parameter cannot be filled from the incoming pipeline object property with the same name. + ValueFromPipelineByPropertyName *bool `json:"valueFromPipelineByPropertyName,omitempty"` + // ValueFromRemainingArguments - Gets or sets a Boolean value that indicates true if the cmdlet parameter accepts all the remaining command-line arguments that are associated with this parameter in the form of an array. false if the cmdlet parameter does not accept all the remaining argument values. + ValueFromRemainingArguments *bool `json:"valueFromRemainingArguments,omitempty"` + // Description - Gets or sets the description of the activity parameter. + Description *string `json:"description,omitempty"` + // ValidationSet - Gets or sets the validation set of activity parameter. + ValidationSet *[]ActivityParameterValidationSet `json:"validationSet,omitempty"` +} + +// ActivityParameterSet definition of the activity parameter set. +type ActivityParameterSet struct { + // Name - Gets or sets the name of the activity parameter set. + Name *string `json:"name,omitempty"` + // Parameters - Gets or sets the parameters of the activity parameter set. + Parameters *[]ActivityParameter `json:"parameters,omitempty"` +} + +// ActivityParameterValidationSet definition of the activity parameter validation set. +type ActivityParameterValidationSet struct { + // MemberValue - Gets or sets the name of the activity parameter validation set member. + MemberValue *string `json:"memberValue,omitempty"` +} + +// ActivityProperties properties of the activity. +type ActivityProperties struct { + // Definition - Gets or sets the user name of the activity. + Definition *string `json:"definition,omitempty"` + // ParameterSets - Gets or sets the parameter sets of the activity. + ParameterSets *[]ActivityParameterSet `json:"parameterSets,omitempty"` + // OutputTypes - Gets or sets the output types of the activity. + OutputTypes *[]ActivityOutputType `json:"outputTypes,omitempty"` + // CreationTime - Gets or sets the creation time. + CreationTime *date.Time `json:"creationTime,omitempty"` + // LastModifiedTime - Gets or sets the last modified time. + LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` + // Description - Gets or sets the description. + Description *string `json:"description,omitempty"` +} + +// AdvancedSchedule the properties of the create Advanced Schedule. +type AdvancedSchedule struct { + // WeekDays - Days of the week that the job should execute on. + WeekDays *[]string `json:"weekDays,omitempty"` + // MonthDays - Days of the month that the job should execute on. Must be between 1 and 31. + MonthDays *[]int32 `json:"monthDays,omitempty"` + // MonthlyOccurrences - Occurrences of days within a month. + MonthlyOccurrences *[]AdvancedScheduleMonthlyOccurrence `json:"monthlyOccurrences,omitempty"` +} + +// AdvancedScheduleMonthlyOccurrence the properties of the create advanced schedule monthly occurrence. +type AdvancedScheduleMonthlyOccurrence struct { + // Occurrence - Occurrence of the week within the month. Must be between 1 and 5 + Occurrence *int32 `json:"occurrence,omitempty"` + // Day - Day of the occurrence. Must be one of monday, tuesday, wednesday, thursday, friday, saturday, sunday. Possible values include: 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday' + Day ScheduleDay `json:"day,omitempty"` +} + +// AgentRegistration definition of the agent registration infomration type. +type AgentRegistration struct { + autorest.Response `json:"-"` + // DscMetaConfiguration - Gets or sets the dsc meta configuration. + DscMetaConfiguration *string `json:"dscMetaConfiguration,omitempty"` + // Endpoint - Gets or sets the dsc server endpoint. + Endpoint *string `json:"endpoint,omitempty"` + // Keys - Gets or sets the agent registration keys. + Keys *AgentRegistrationKeys `json:"keys,omitempty"` + // ID - Gets or sets the id. + ID *string `json:"id,omitempty"` +} + +// AgentRegistrationKeys definition of the agent registration keys. +type AgentRegistrationKeys struct { + // Primary - Gets or sets the primary key. + Primary *string `json:"primary,omitempty"` + // Secondary - Gets or sets the secondary key. + Secondary *string `json:"secondary,omitempty"` +} + +// AgentRegistrationRegenerateKeyParameter the parameters supplied to the regenerate keys operation. +type AgentRegistrationRegenerateKeyParameter struct { + // KeyName - Gets or sets the agent registration key name - primary or secondary. Possible values include: 'Primary', 'Secondary' + KeyName AgentRegistrationKeyName `json:"keyName,omitempty"` + // Name - Gets or sets the name of the resource. + Name *string `json:"name,omitempty"` + // Location - Gets or sets the location of the resource. + Location *string `json:"location,omitempty"` + // Tags - Gets or sets the tags attached to the resource. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for AgentRegistrationRegenerateKeyParameter. +func (arrkp AgentRegistrationRegenerateKeyParameter) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if arrkp.KeyName != "" { + objectMap["keyName"] = arrkp.KeyName + } + if arrkp.Name != nil { + objectMap["name"] = arrkp.Name + } + if arrkp.Location != nil { + objectMap["location"] = arrkp.Location + } + if arrkp.Tags != nil { + objectMap["tags"] = arrkp.Tags + } + return json.Marshal(objectMap) +} + +// Certificate definition of the certificate. +type Certificate struct { + autorest.Response `json:"-"` + // CertificateProperties - Gets or sets the properties of the certificate. + *CertificateProperties `json:"properties,omitempty"` + // ID - Fully qualified resource Id for the resource + ID *string `json:"id,omitempty"` + // Name - The name of the resource + Name *string `json:"name,omitempty"` + // Type - The type of the resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Certificate. +func (c Certificate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if c.CertificateProperties != nil { + objectMap["properties"] = c.CertificateProperties + } + if c.ID != nil { + objectMap["id"] = c.ID + } + if c.Name != nil { + objectMap["name"] = c.Name + } + if c.Type != nil { + objectMap["type"] = c.Type + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Certificate struct. +func (c *Certificate) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var certificateProperties CertificateProperties + err = json.Unmarshal(*v, &certificateProperties) + if err != nil { + return err + } + c.CertificateProperties = &certificateProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + c.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + c.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + c.Type = &typeVar + } + } + } + + return nil +} + +// CertificateCreateOrUpdateParameters the parameters supplied to the create or update or replace certificate +// operation. +type CertificateCreateOrUpdateParameters struct { + // Name - Gets or sets the name of the certificate. + Name *string `json:"name,omitempty"` + // CertificateCreateOrUpdateProperties - Gets or sets the properties of the certificate. + *CertificateCreateOrUpdateProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for CertificateCreateOrUpdateParameters. +func (ccoup CertificateCreateOrUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ccoup.Name != nil { + objectMap["name"] = ccoup.Name + } + if ccoup.CertificateCreateOrUpdateProperties != nil { + objectMap["properties"] = ccoup.CertificateCreateOrUpdateProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for CertificateCreateOrUpdateParameters struct. +func (ccoup *CertificateCreateOrUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ccoup.Name = &name + } + case "properties": + if v != nil { + var certificateCreateOrUpdateProperties CertificateCreateOrUpdateProperties + err = json.Unmarshal(*v, &certificateCreateOrUpdateProperties) + if err != nil { + return err + } + ccoup.CertificateCreateOrUpdateProperties = &certificateCreateOrUpdateProperties + } + } + } + + return nil +} + +// CertificateCreateOrUpdateProperties the properties of the create certificate operation. +type CertificateCreateOrUpdateProperties struct { + // Base64Value - Gets or sets the base64 encoded value of the certificate. + Base64Value *string `json:"base64Value,omitempty"` + // Description - Gets or sets the description of the certificate. + Description *string `json:"description,omitempty"` + // Thumbprint - Gets or sets the thumbprint of the certificate. + Thumbprint *string `json:"thumbprint,omitempty"` + // IsExportable - Gets or sets the is exportable flag of the certificate. + IsExportable *bool `json:"isExportable,omitempty"` +} + +// CertificateListResult the response model for the list certificate operation. +type CertificateListResult struct { + autorest.Response `json:"-"` + // Value - Gets or sets a list of certificates. + Value *[]Certificate `json:"value,omitempty"` + // NextLink - Gets or sets the next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// CertificateListResultIterator provides access to a complete listing of Certificate values. +type CertificateListResultIterator struct { + i int + page CertificateListResultPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *CertificateListResultIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter CertificateListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter CertificateListResultIterator) Response() CertificateListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter CertificateListResultIterator) Value() Certificate { + if !iter.page.NotDone() { + return Certificate{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (clr CertificateListResult) IsEmpty() bool { + return clr.Value == nil || len(*clr.Value) == 0 +} + +// certificateListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (clr CertificateListResult) certificateListResultPreparer() (*http.Request, error) { + if clr.NextLink == nil || len(to.String(clr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(clr.NextLink))) +} + +// CertificateListResultPage contains a page of Certificate values. +type CertificateListResultPage struct { + fn func(CertificateListResult) (CertificateListResult, error) + clr CertificateListResult +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *CertificateListResultPage) Next() error { + next, err := page.fn(page.clr) + if err != nil { + return err + } + page.clr = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page CertificateListResultPage) NotDone() bool { + return !page.clr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page CertificateListResultPage) Response() CertificateListResult { + return page.clr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page CertificateListResultPage) Values() []Certificate { + if page.clr.IsEmpty() { + return nil + } + return *page.clr.Value +} + +// CertificateProperties properties of the certificate. +type CertificateProperties struct { + // Thumbprint - Gets the thumbprint of the certificate. + Thumbprint *string `json:"thumbprint,omitempty"` + // ExpiryTime - Gets the expiry time of the certificate. + ExpiryTime *date.Time `json:"expiryTime,omitempty"` + // IsExportable - Gets the is exportable flag of the certificate. + IsExportable *bool `json:"isExportable,omitempty"` + // CreationTime - Gets the creation time. + CreationTime *date.Time `json:"creationTime,omitempty"` + // LastModifiedTime - Gets the last modified time. + LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` + // Description - Gets or sets the description. + Description *string `json:"description,omitempty"` +} + +// CertificateUpdateParameters the parameters supplied to the update certificate operation. +type CertificateUpdateParameters struct { + // Name - Gets or sets the name of the certificate. + Name *string `json:"name,omitempty"` + // CertificateUpdateProperties - Gets or sets the properties of the certificate. + *CertificateUpdateProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for CertificateUpdateParameters. +func (cup CertificateUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cup.Name != nil { + objectMap["name"] = cup.Name + } + if cup.CertificateUpdateProperties != nil { + objectMap["properties"] = cup.CertificateUpdateProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for CertificateUpdateParameters struct. +func (cup *CertificateUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + cup.Name = &name + } + case "properties": + if v != nil { + var certificateUpdateProperties CertificateUpdateProperties + err = json.Unmarshal(*v, &certificateUpdateProperties) + if err != nil { + return err + } + cup.CertificateUpdateProperties = &certificateUpdateProperties + } + } + } + + return nil +} + +// CertificateUpdateProperties the properties of the update certificate operation +type CertificateUpdateProperties struct { + // Description - Gets or sets the description of the certificate. + Description *string `json:"description,omitempty"` +} + +// CollectionItemUpdateConfiguration object returned when requesting a collection of software update configuration +type CollectionItemUpdateConfiguration struct { + // AzureVirtualMachines - List of azure resource Ids for azure virtual machines targeted by the software update configuration. + AzureVirtualMachines *[]string `json:"azureVirtualMachines,omitempty"` + // Duration - Maximum time allowed for the software update configuration run. Duration needs to be specified using the format PT[n]H[n]M[n]S as per ISO8601 + Duration *string `json:"duration,omitempty"` +} + +// Connection definition of the connection. +type Connection struct { + autorest.Response `json:"-"` + // ConnectionProperties - Gets or sets the properties of the connection. + *ConnectionProperties `json:"properties,omitempty"` + // ID - Fully qualified resource Id for the resource + ID *string `json:"id,omitempty"` + // Name - The name of the resource + Name *string `json:"name,omitempty"` + // Type - The type of the resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Connection. +func (c Connection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if c.ConnectionProperties != nil { + objectMap["properties"] = c.ConnectionProperties + } + if c.ID != nil { + objectMap["id"] = c.ID + } + if c.Name != nil { + objectMap["name"] = c.Name + } + if c.Type != nil { + objectMap["type"] = c.Type + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Connection struct. +func (c *Connection) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var connectionProperties ConnectionProperties + err = json.Unmarshal(*v, &connectionProperties) + if err != nil { + return err + } + c.ConnectionProperties = &connectionProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + c.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + c.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + c.Type = &typeVar + } + } + } + + return nil +} + +// ConnectionCreateOrUpdateParameters the parameters supplied to the create or update connection operation. +type ConnectionCreateOrUpdateParameters struct { + // Name - Gets or sets the name of the connection. + Name *string `json:"name,omitempty"` + // ConnectionCreateOrUpdateProperties - Gets or sets the properties of the connection. + *ConnectionCreateOrUpdateProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for ConnectionCreateOrUpdateParameters. +func (ccoup ConnectionCreateOrUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ccoup.Name != nil { + objectMap["name"] = ccoup.Name + } + if ccoup.ConnectionCreateOrUpdateProperties != nil { + objectMap["properties"] = ccoup.ConnectionCreateOrUpdateProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ConnectionCreateOrUpdateParameters struct. +func (ccoup *ConnectionCreateOrUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ccoup.Name = &name + } + case "properties": + if v != nil { + var connectionCreateOrUpdateProperties ConnectionCreateOrUpdateProperties + err = json.Unmarshal(*v, &connectionCreateOrUpdateProperties) + if err != nil { + return err + } + ccoup.ConnectionCreateOrUpdateProperties = &connectionCreateOrUpdateProperties + } + } + } + + return nil +} + +// ConnectionCreateOrUpdateProperties the properties of the create connection properties +type ConnectionCreateOrUpdateProperties struct { + // Description - Gets or sets the description of the connection. + Description *string `json:"description,omitempty"` + // ConnectionType - Gets or sets the connectionType of the connection. + ConnectionType *ConnectionTypeAssociationProperty `json:"connectionType,omitempty"` + // FieldDefinitionValues - Gets or sets the field definition properties of the connection. + FieldDefinitionValues map[string]*string `json:"fieldDefinitionValues"` +} + +// MarshalJSON is the custom marshaler for ConnectionCreateOrUpdateProperties. +func (ccoup ConnectionCreateOrUpdateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ccoup.Description != nil { + objectMap["description"] = ccoup.Description + } + if ccoup.ConnectionType != nil { + objectMap["connectionType"] = ccoup.ConnectionType + } + if ccoup.FieldDefinitionValues != nil { + objectMap["fieldDefinitionValues"] = ccoup.FieldDefinitionValues + } + return json.Marshal(objectMap) +} + +// ConnectionListResult the response model for the list connection operation. +type ConnectionListResult struct { + autorest.Response `json:"-"` + // Value - Gets or sets a list of connection. + Value *[]Connection `json:"value,omitempty"` + // NextLink - Gets or sets the next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// ConnectionListResultIterator provides access to a complete listing of Connection values. +type ConnectionListResultIterator struct { + i int + page ConnectionListResultPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ConnectionListResultIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ConnectionListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ConnectionListResultIterator) Response() ConnectionListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ConnectionListResultIterator) Value() Connection { + if !iter.page.NotDone() { + return Connection{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (clr ConnectionListResult) IsEmpty() bool { + return clr.Value == nil || len(*clr.Value) == 0 +} + +// connectionListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (clr ConnectionListResult) connectionListResultPreparer() (*http.Request, error) { + if clr.NextLink == nil || len(to.String(clr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(clr.NextLink))) +} + +// ConnectionListResultPage contains a page of Connection values. +type ConnectionListResultPage struct { + fn func(ConnectionListResult) (ConnectionListResult, error) + clr ConnectionListResult +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ConnectionListResultPage) Next() error { + next, err := page.fn(page.clr) + if err != nil { + return err + } + page.clr = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ConnectionListResultPage) NotDone() bool { + return !page.clr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ConnectionListResultPage) Response() ConnectionListResult { + return page.clr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ConnectionListResultPage) Values() []Connection { + if page.clr.IsEmpty() { + return nil + } + return *page.clr.Value +} + +// ConnectionProperties definition of the connection properties. +type ConnectionProperties struct { + // ConnectionType - Gets or sets the connectionType of the connection. + ConnectionType *ConnectionTypeAssociationProperty `json:"connectionType,omitempty"` + // FieldDefinitionValues - Gets the field definition values of the connection. + FieldDefinitionValues map[string]*string `json:"fieldDefinitionValues"` + // CreationTime - Gets the creation time. + CreationTime *date.Time `json:"creationTime,omitempty"` + // LastModifiedTime - Gets the last modified time. + LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` + // Description - Gets or sets the description. + Description *string `json:"description,omitempty"` +} + +// MarshalJSON is the custom marshaler for ConnectionProperties. +func (cp ConnectionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cp.ConnectionType != nil { + objectMap["connectionType"] = cp.ConnectionType + } + if cp.FieldDefinitionValues != nil { + objectMap["fieldDefinitionValues"] = cp.FieldDefinitionValues + } + if cp.CreationTime != nil { + objectMap["creationTime"] = cp.CreationTime + } + if cp.LastModifiedTime != nil { + objectMap["lastModifiedTime"] = cp.LastModifiedTime + } + if cp.Description != nil { + objectMap["description"] = cp.Description + } + return json.Marshal(objectMap) +} + +// ConnectionType definition of the connection type. +type ConnectionType struct { + autorest.Response `json:"-"` + // ID - Gets the id of the resource. + ID *string `json:"id,omitempty"` + // Name - Gets the name of the connection type. + Name *string `json:"name,omitempty"` + // Type - Resource type + Type *string `json:"type,omitempty"` + // ConnectionTypeProperties - Gets or sets the properties of the connection type. + *ConnectionTypeProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for ConnectionType. +func (ct ConnectionType) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ct.ID != nil { + objectMap["id"] = ct.ID + } + if ct.Name != nil { + objectMap["name"] = ct.Name + } + if ct.Type != nil { + objectMap["type"] = ct.Type + } + if ct.ConnectionTypeProperties != nil { + objectMap["properties"] = ct.ConnectionTypeProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ConnectionType struct. +func (ct *ConnectionType) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ct.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ct.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ct.Type = &typeVar + } + case "properties": + if v != nil { + var connectionTypeProperties ConnectionTypeProperties + err = json.Unmarshal(*v, &connectionTypeProperties) + if err != nil { + return err + } + ct.ConnectionTypeProperties = &connectionTypeProperties + } + } + } + + return nil +} + +// ConnectionTypeAssociationProperty the connection type property associated with the entity. +type ConnectionTypeAssociationProperty struct { + // Name - Gets or sets the name of the connection type. + Name *string `json:"name,omitempty"` +} + +// ConnectionTypeCreateOrUpdateParameters the parameters supplied to the create or update connection type +// operation. +type ConnectionTypeCreateOrUpdateParameters struct { + // Name - Gets or sets the name of the connection type. + Name *string `json:"name,omitempty"` + // ConnectionTypeCreateOrUpdateProperties - Gets or sets the value of the connection type. + *ConnectionTypeCreateOrUpdateProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for ConnectionTypeCreateOrUpdateParameters. +func (ctcoup ConnectionTypeCreateOrUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ctcoup.Name != nil { + objectMap["name"] = ctcoup.Name + } + if ctcoup.ConnectionTypeCreateOrUpdateProperties != nil { + objectMap["properties"] = ctcoup.ConnectionTypeCreateOrUpdateProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ConnectionTypeCreateOrUpdateParameters struct. +func (ctcoup *ConnectionTypeCreateOrUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ctcoup.Name = &name + } + case "properties": + if v != nil { + var connectionTypeCreateOrUpdateProperties ConnectionTypeCreateOrUpdateProperties + err = json.Unmarshal(*v, &connectionTypeCreateOrUpdateProperties) + if err != nil { + return err + } + ctcoup.ConnectionTypeCreateOrUpdateProperties = &connectionTypeCreateOrUpdateProperties + } + } + } + + return nil +} + +// ConnectionTypeCreateOrUpdateProperties the properties of the create connection type. +type ConnectionTypeCreateOrUpdateProperties struct { + // IsGlobal - Gets or sets a Boolean value to indicate if the connection type is global. + IsGlobal *bool `json:"isGlobal,omitempty"` + // FieldDefinitions - Gets or sets the field definitions of the connection type. + FieldDefinitions map[string]*FieldDefinition `json:"fieldDefinitions"` +} + +// MarshalJSON is the custom marshaler for ConnectionTypeCreateOrUpdateProperties. +func (ctcoup ConnectionTypeCreateOrUpdateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ctcoup.IsGlobal != nil { + objectMap["isGlobal"] = ctcoup.IsGlobal + } + if ctcoup.FieldDefinitions != nil { + objectMap["fieldDefinitions"] = ctcoup.FieldDefinitions + } + return json.Marshal(objectMap) +} + +// ConnectionTypeListResult the response model for the list connection type operation. +type ConnectionTypeListResult struct { + autorest.Response `json:"-"` + // Value - Gets or sets a list of connection types. + Value *[]ConnectionType `json:"value,omitempty"` + // NextLink - Gets or sets the next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// ConnectionTypeListResultIterator provides access to a complete listing of ConnectionType values. +type ConnectionTypeListResultIterator struct { + i int + page ConnectionTypeListResultPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ConnectionTypeListResultIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ConnectionTypeListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ConnectionTypeListResultIterator) Response() ConnectionTypeListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ConnectionTypeListResultIterator) Value() ConnectionType { + if !iter.page.NotDone() { + return ConnectionType{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (ctlr ConnectionTypeListResult) IsEmpty() bool { + return ctlr.Value == nil || len(*ctlr.Value) == 0 +} + +// connectionTypeListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (ctlr ConnectionTypeListResult) connectionTypeListResultPreparer() (*http.Request, error) { + if ctlr.NextLink == nil || len(to.String(ctlr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(ctlr.NextLink))) +} + +// ConnectionTypeListResultPage contains a page of ConnectionType values. +type ConnectionTypeListResultPage struct { + fn func(ConnectionTypeListResult) (ConnectionTypeListResult, error) + ctlr ConnectionTypeListResult +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ConnectionTypeListResultPage) Next() error { + next, err := page.fn(page.ctlr) + if err != nil { + return err + } + page.ctlr = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ConnectionTypeListResultPage) NotDone() bool { + return !page.ctlr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ConnectionTypeListResultPage) Response() ConnectionTypeListResult { + return page.ctlr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ConnectionTypeListResultPage) Values() []ConnectionType { + if page.ctlr.IsEmpty() { + return nil + } + return *page.ctlr.Value +} + +// ConnectionTypeProperties properties of the connection type. +type ConnectionTypeProperties struct { + // IsGlobal - Gets or sets a Boolean value to indicate if the connection type is global. + IsGlobal *bool `json:"isGlobal,omitempty"` + // FieldDefinitions - Gets the field definitions of the connection type. + FieldDefinitions map[string]*FieldDefinition `json:"fieldDefinitions"` + // CreationTime - Gets the creation time. + CreationTime *date.Time `json:"creationTime,omitempty"` + // LastModifiedTime - Gets or sets the last modified time. + LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` + // Description - Gets or sets the description. + Description *string `json:"description,omitempty"` +} + +// MarshalJSON is the custom marshaler for ConnectionTypeProperties. +func (ctp ConnectionTypeProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ctp.IsGlobal != nil { + objectMap["isGlobal"] = ctp.IsGlobal + } + if ctp.FieldDefinitions != nil { + objectMap["fieldDefinitions"] = ctp.FieldDefinitions + } + if ctp.CreationTime != nil { + objectMap["creationTime"] = ctp.CreationTime + } + if ctp.LastModifiedTime != nil { + objectMap["lastModifiedTime"] = ctp.LastModifiedTime + } + if ctp.Description != nil { + objectMap["description"] = ctp.Description + } + return json.Marshal(objectMap) +} + +// ConnectionUpdateParameters the parameters supplied to the update connection operation. +type ConnectionUpdateParameters struct { + // Name - Gets or sets the name of the connection. + Name *string `json:"name,omitempty"` + // ConnectionUpdateProperties - Gets or sets the properties of the connection. + *ConnectionUpdateProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for ConnectionUpdateParameters. +func (cup ConnectionUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cup.Name != nil { + objectMap["name"] = cup.Name + } + if cup.ConnectionUpdateProperties != nil { + objectMap["properties"] = cup.ConnectionUpdateProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ConnectionUpdateParameters struct. +func (cup *ConnectionUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + cup.Name = &name + } + case "properties": + if v != nil { + var connectionUpdateProperties ConnectionUpdateProperties + err = json.Unmarshal(*v, &connectionUpdateProperties) + if err != nil { + return err + } + cup.ConnectionUpdateProperties = &connectionUpdateProperties + } + } + } + + return nil +} + +// ConnectionUpdateProperties the properties of the update connection operation. +type ConnectionUpdateProperties struct { + // Description - Gets or sets the description of the connection. + Description *string `json:"description,omitempty"` + // FieldDefinitionValues - Gets or sets the field definition values of the connection. + FieldDefinitionValues map[string]*string `json:"fieldDefinitionValues"` +} + +// MarshalJSON is the custom marshaler for ConnectionUpdateProperties. +func (cup ConnectionUpdateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cup.Description != nil { + objectMap["description"] = cup.Description + } + if cup.FieldDefinitionValues != nil { + objectMap["fieldDefinitionValues"] = cup.FieldDefinitionValues + } + return json.Marshal(objectMap) +} + +// ContentHash definition of the runbook property type. +type ContentHash struct { + // Algorithm - Gets or sets the content hash algorithm used to hash the content. + Algorithm *string `json:"algorithm,omitempty"` + // Value - Gets or sets expected hash value of the content. + Value *string `json:"value,omitempty"` +} + +// ContentLink definition of the content link. +type ContentLink struct { + // URI - Gets or sets the uri of the runbook content. + URI *string `json:"uri,omitempty"` + // ContentHash - Gets or sets the hash. + ContentHash *ContentHash `json:"contentHash,omitempty"` + // Version - Gets or sets the version of the content. + Version *string `json:"version,omitempty"` +} + +// ContentSource definition of the content source. +type ContentSource struct { + // Hash - Gets or sets the hash. + Hash *ContentHash `json:"hash,omitempty"` + // Type - Gets or sets the content source type. Possible values include: 'EmbeddedContent', 'URI' + Type ContentSourceType `json:"type,omitempty"` + // Value - Gets or sets the value of the content. This is based on the content source type. + Value *string `json:"value,omitempty"` + // Version - Gets or sets the version of the content. + Version *string `json:"version,omitempty"` +} + +// Credential definition of the credential. +type Credential struct { + autorest.Response `json:"-"` + // CredentialProperties - Gets or sets the properties of the credential. + *CredentialProperties `json:"properties,omitempty"` + // ID - Fully qualified resource Id for the resource + ID *string `json:"id,omitempty"` + // Name - The name of the resource + Name *string `json:"name,omitempty"` + // Type - The type of the resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Credential. +func (c Credential) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if c.CredentialProperties != nil { + objectMap["properties"] = c.CredentialProperties + } + if c.ID != nil { + objectMap["id"] = c.ID + } + if c.Name != nil { + objectMap["name"] = c.Name + } + if c.Type != nil { + objectMap["type"] = c.Type + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Credential struct. +func (c *Credential) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var credentialProperties CredentialProperties + err = json.Unmarshal(*v, &credentialProperties) + if err != nil { + return err + } + c.CredentialProperties = &credentialProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + c.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + c.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + c.Type = &typeVar + } + } + } + + return nil +} + +// CredentialCreateOrUpdateParameters the parameters supplied to the create or update credential operation. +type CredentialCreateOrUpdateParameters struct { + // Name - Gets or sets the name of the credential. + Name *string `json:"name,omitempty"` + // CredentialCreateOrUpdateProperties - Gets or sets the properties of the credential. + *CredentialCreateOrUpdateProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for CredentialCreateOrUpdateParameters. +func (ccoup CredentialCreateOrUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ccoup.Name != nil { + objectMap["name"] = ccoup.Name + } + if ccoup.CredentialCreateOrUpdateProperties != nil { + objectMap["properties"] = ccoup.CredentialCreateOrUpdateProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for CredentialCreateOrUpdateParameters struct. +func (ccoup *CredentialCreateOrUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ccoup.Name = &name + } + case "properties": + if v != nil { + var credentialCreateOrUpdateProperties CredentialCreateOrUpdateProperties + err = json.Unmarshal(*v, &credentialCreateOrUpdateProperties) + if err != nil { + return err + } + ccoup.CredentialCreateOrUpdateProperties = &credentialCreateOrUpdateProperties + } + } + } + + return nil +} + +// CredentialCreateOrUpdateProperties the properties of the create cerdential operation. +type CredentialCreateOrUpdateProperties struct { + // UserName - Gets or sets the user name of the credential. + UserName *string `json:"userName,omitempty"` + // Password - Gets or sets the password of the credential. + Password *string `json:"password,omitempty"` + // Description - Gets or sets the description of the credential. + Description *string `json:"description,omitempty"` +} + +// CredentialListResult the response model for the list credential operation. +type CredentialListResult struct { + autorest.Response `json:"-"` + // Value - Gets or sets a list of credentials. + Value *[]Credential `json:"value,omitempty"` + // NextLink - Gets or sets the next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// CredentialListResultIterator provides access to a complete listing of Credential values. +type CredentialListResultIterator struct { + i int + page CredentialListResultPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *CredentialListResultIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter CredentialListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter CredentialListResultIterator) Response() CredentialListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter CredentialListResultIterator) Value() Credential { + if !iter.page.NotDone() { + return Credential{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (clr CredentialListResult) IsEmpty() bool { + return clr.Value == nil || len(*clr.Value) == 0 +} + +// credentialListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (clr CredentialListResult) credentialListResultPreparer() (*http.Request, error) { + if clr.NextLink == nil || len(to.String(clr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(clr.NextLink))) +} + +// CredentialListResultPage contains a page of Credential values. +type CredentialListResultPage struct { + fn func(CredentialListResult) (CredentialListResult, error) + clr CredentialListResult +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *CredentialListResultPage) Next() error { + next, err := page.fn(page.clr) + if err != nil { + return err + } + page.clr = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page CredentialListResultPage) NotDone() bool { + return !page.clr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page CredentialListResultPage) Response() CredentialListResult { + return page.clr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page CredentialListResultPage) Values() []Credential { + if page.clr.IsEmpty() { + return nil + } + return *page.clr.Value +} + +// CredentialProperties definition of the credential properties +type CredentialProperties struct { + // UserName - Gets the user name of the credential. + UserName *string `json:"userName,omitempty"` + // CreationTime - Gets the creation time. + CreationTime *date.Time `json:"creationTime,omitempty"` + // LastModifiedTime - Gets the last modified time. + LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` + // Description - Gets or sets the description. + Description *string `json:"description,omitempty"` +} + +// CredentialUpdateParameters the parameters supplied to the Update credential operation. +type CredentialUpdateParameters struct { + // Name - Gets or sets the name of the credential. + Name *string `json:"name,omitempty"` + // CredentialUpdateProperties - Gets or sets the properties of the variable. + *CredentialUpdateProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for CredentialUpdateParameters. +func (cup CredentialUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cup.Name != nil { + objectMap["name"] = cup.Name + } + if cup.CredentialUpdateProperties != nil { + objectMap["properties"] = cup.CredentialUpdateProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for CredentialUpdateParameters struct. +func (cup *CredentialUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + cup.Name = &name + } + case "properties": + if v != nil { + var credentialUpdateProperties CredentialUpdateProperties + err = json.Unmarshal(*v, &credentialUpdateProperties) + if err != nil { + return err + } + cup.CredentialUpdateProperties = &credentialUpdateProperties + } + } + } + + return nil +} + +// CredentialUpdateProperties the properties of the Update credential +type CredentialUpdateProperties struct { + // UserName - Gets or sets the user name of the credential. + UserName *string `json:"userName,omitempty"` + // Password - Gets or sets the password of the credential. + Password *string `json:"password,omitempty"` + // Description - Gets or sets the description of the credential. + Description *string `json:"description,omitempty"` +} + +// DscCompilationJob definition of the Dsc Compilation job. +type DscCompilationJob struct { + autorest.Response `json:"-"` + // DscCompilationJobProperties - Gets or sets the properties of the Dsc Compilation job. + *DscCompilationJobProperties `json:"properties,omitempty"` + // ID - Fully qualified resource Id for the resource + ID *string `json:"id,omitempty"` + // Name - The name of the resource + Name *string `json:"name,omitempty"` + // Type - The type of the resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for DscCompilationJob. +func (dcj DscCompilationJob) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dcj.DscCompilationJobProperties != nil { + objectMap["properties"] = dcj.DscCompilationJobProperties + } + if dcj.ID != nil { + objectMap["id"] = dcj.ID + } + if dcj.Name != nil { + objectMap["name"] = dcj.Name + } + if dcj.Type != nil { + objectMap["type"] = dcj.Type + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for DscCompilationJob struct. +func (dcj *DscCompilationJob) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var dscCompilationJobProperties DscCompilationJobProperties + err = json.Unmarshal(*v, &dscCompilationJobProperties) + if err != nil { + return err + } + dcj.DscCompilationJobProperties = &dscCompilationJobProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + dcj.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + dcj.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + dcj.Type = &typeVar + } + } + } + + return nil +} + +// DscCompilationJobCreateParameters the parameters supplied to the create compilation job operation. +type DscCompilationJobCreateParameters struct { + // DscCompilationJobCreateProperties - Gets or sets the list of compilation job properties. + *DscCompilationJobCreateProperties `json:"properties,omitempty"` + // Name - Gets or sets name of the resource. + Name *string `json:"name,omitempty"` + // Location - Gets or sets the location of the resource. + Location *string `json:"location,omitempty"` + // Tags - Gets or sets the tags attached to the resource. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for DscCompilationJobCreateParameters. +func (dcjcp DscCompilationJobCreateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dcjcp.DscCompilationJobCreateProperties != nil { + objectMap["properties"] = dcjcp.DscCompilationJobCreateProperties + } + if dcjcp.Name != nil { + objectMap["name"] = dcjcp.Name + } + if dcjcp.Location != nil { + objectMap["location"] = dcjcp.Location + } + if dcjcp.Tags != nil { + objectMap["tags"] = dcjcp.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for DscCompilationJobCreateParameters struct. +func (dcjcp *DscCompilationJobCreateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var dscCompilationJobCreateProperties DscCompilationJobCreateProperties + err = json.Unmarshal(*v, &dscCompilationJobCreateProperties) + if err != nil { + return err + } + dcjcp.DscCompilationJobCreateProperties = &dscCompilationJobCreateProperties + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + dcjcp.Name = &name + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + dcjcp.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + dcjcp.Tags = tags + } + } + } + + return nil +} + +// DscCompilationJobCreateProperties the parameters supplied to the create compilation job operation. +type DscCompilationJobCreateProperties struct { + // Configuration - Gets or sets the configuration. + Configuration *DscConfigurationAssociationProperty `json:"configuration,omitempty"` + // Parameters - Gets or sets the parameters of the job. + Parameters map[string]*string `json:"parameters"` + // IncrementNodeConfigurationBuild - If a new build version of NodeConfiguration is required. + IncrementNodeConfigurationBuild *bool `json:"incrementNodeConfigurationBuild,omitempty"` +} + +// MarshalJSON is the custom marshaler for DscCompilationJobCreateProperties. +func (dcjcp DscCompilationJobCreateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dcjcp.Configuration != nil { + objectMap["configuration"] = dcjcp.Configuration + } + if dcjcp.Parameters != nil { + objectMap["parameters"] = dcjcp.Parameters + } + if dcjcp.IncrementNodeConfigurationBuild != nil { + objectMap["incrementNodeConfigurationBuild"] = dcjcp.IncrementNodeConfigurationBuild + } + return json.Marshal(objectMap) +} + +// DscCompilationJobListResult the response model for the list job operation. +type DscCompilationJobListResult struct { + autorest.Response `json:"-"` + // Value - Gets or sets a list of Dsc Compilation jobs. + Value *[]DscCompilationJob `json:"value,omitempty"` + // NextLink - Gets or sets the next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// DscCompilationJobListResultIterator provides access to a complete listing of DscCompilationJob values. +type DscCompilationJobListResultIterator struct { + i int + page DscCompilationJobListResultPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *DscCompilationJobListResultIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter DscCompilationJobListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter DscCompilationJobListResultIterator) Response() DscCompilationJobListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter DscCompilationJobListResultIterator) Value() DscCompilationJob { + if !iter.page.NotDone() { + return DscCompilationJob{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (dcjlr DscCompilationJobListResult) IsEmpty() bool { + return dcjlr.Value == nil || len(*dcjlr.Value) == 0 +} + +// dscCompilationJobListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (dcjlr DscCompilationJobListResult) dscCompilationJobListResultPreparer() (*http.Request, error) { + if dcjlr.NextLink == nil || len(to.String(dcjlr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(dcjlr.NextLink))) +} + +// DscCompilationJobListResultPage contains a page of DscCompilationJob values. +type DscCompilationJobListResultPage struct { + fn func(DscCompilationJobListResult) (DscCompilationJobListResult, error) + dcjlr DscCompilationJobListResult +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *DscCompilationJobListResultPage) Next() error { + next, err := page.fn(page.dcjlr) + if err != nil { + return err + } + page.dcjlr = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page DscCompilationJobListResultPage) NotDone() bool { + return !page.dcjlr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page DscCompilationJobListResultPage) Response() DscCompilationJobListResult { + return page.dcjlr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page DscCompilationJobListResultPage) Values() []DscCompilationJob { + if page.dcjlr.IsEmpty() { + return nil + } + return *page.dcjlr.Value +} + +// DscCompilationJobProperties definition of Dsc Compilation job properties. +type DscCompilationJobProperties struct { + // Configuration - Gets or sets the configuration. + Configuration *DscConfigurationAssociationProperty `json:"configuration,omitempty"` + // StartedBy - Gets the compilation job started by. + StartedBy *string `json:"startedBy,omitempty"` + // JobID - Gets the id of the job. + JobID *uuid.UUID `json:"jobId,omitempty"` + // CreationTime - Gets the creation time of the job. + CreationTime *date.Time `json:"creationTime,omitempty"` + // ProvisioningState - The current provisioning state of the job. Possible values include: 'JobProvisioningStateFailed', 'JobProvisioningStateSucceeded', 'JobProvisioningStateSuspended', 'JobProvisioningStateProcessing' + ProvisioningState JobProvisioningState `json:"provisioningState,omitempty"` + // RunOn - Gets or sets the runOn which specifies the group name where the job is to be executed. + RunOn *string `json:"runOn,omitempty"` + // Status - Gets or sets the status of the job. Possible values include: 'JobStatusNew', 'JobStatusActivating', 'JobStatusRunning', 'JobStatusCompleted', 'JobStatusFailed', 'JobStatusStopped', 'JobStatusBlocked', 'JobStatusSuspended', 'JobStatusDisconnected', 'JobStatusSuspending', 'JobStatusStopping', 'JobStatusResuming', 'JobStatusRemoving' + Status JobStatus `json:"status,omitempty"` + // StatusDetails - Gets or sets the status details of the job. + StatusDetails *string `json:"statusDetails,omitempty"` + // StartTime - Gets the start time of the job. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - Gets the end time of the job. + EndTime *date.Time `json:"endTime,omitempty"` + // Exception - Gets the exception of the job. + Exception *string `json:"exception,omitempty"` + // LastModifiedTime - Gets the last modified time of the job. + LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` + // LastStatusModifiedTime - Gets the last status modified time of the job. + LastStatusModifiedTime *date.Time `json:"lastStatusModifiedTime,omitempty"` + // Parameters - Gets or sets the parameters of the job. + Parameters map[string]*string `json:"parameters"` +} + +// MarshalJSON is the custom marshaler for DscCompilationJobProperties. +func (dcjp DscCompilationJobProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dcjp.Configuration != nil { + objectMap["configuration"] = dcjp.Configuration + } + if dcjp.StartedBy != nil { + objectMap["startedBy"] = dcjp.StartedBy + } + if dcjp.JobID != nil { + objectMap["jobId"] = dcjp.JobID + } + if dcjp.CreationTime != nil { + objectMap["creationTime"] = dcjp.CreationTime + } + if dcjp.ProvisioningState != "" { + objectMap["provisioningState"] = dcjp.ProvisioningState + } + if dcjp.RunOn != nil { + objectMap["runOn"] = dcjp.RunOn + } + if dcjp.Status != "" { + objectMap["status"] = dcjp.Status + } + if dcjp.StatusDetails != nil { + objectMap["statusDetails"] = dcjp.StatusDetails + } + if dcjp.StartTime != nil { + objectMap["startTime"] = dcjp.StartTime + } + if dcjp.EndTime != nil { + objectMap["endTime"] = dcjp.EndTime + } + if dcjp.Exception != nil { + objectMap["exception"] = dcjp.Exception + } + if dcjp.LastModifiedTime != nil { + objectMap["lastModifiedTime"] = dcjp.LastModifiedTime + } + if dcjp.LastStatusModifiedTime != nil { + objectMap["lastStatusModifiedTime"] = dcjp.LastStatusModifiedTime + } + if dcjp.Parameters != nil { + objectMap["parameters"] = dcjp.Parameters + } + return json.Marshal(objectMap) +} + +// DscConfiguration definition of the configuration type. +type DscConfiguration struct { + autorest.Response `json:"-"` + // DscConfigurationProperties - Gets or sets the configuration properties. + *DscConfigurationProperties `json:"properties,omitempty"` + // Etag - Gets or sets the etag of the resource. + Etag *string `json:"etag,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // Location - The Azure Region where the resource lives + Location *string `json:"location,omitempty"` + // ID - Fully qualified resource Id for the resource + ID *string `json:"id,omitempty"` + // Name - The name of the resource + Name *string `json:"name,omitempty"` + // Type - The type of the resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for DscConfiguration. +func (dc DscConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dc.DscConfigurationProperties != nil { + objectMap["properties"] = dc.DscConfigurationProperties + } + if dc.Etag != nil { + objectMap["etag"] = dc.Etag + } + if dc.Tags != nil { + objectMap["tags"] = dc.Tags + } + if dc.Location != nil { + objectMap["location"] = dc.Location + } + if dc.ID != nil { + objectMap["id"] = dc.ID + } + if dc.Name != nil { + objectMap["name"] = dc.Name + } + if dc.Type != nil { + objectMap["type"] = dc.Type + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for DscConfiguration struct. +func (dc *DscConfiguration) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var dscConfigurationProperties DscConfigurationProperties + err = json.Unmarshal(*v, &dscConfigurationProperties) + if err != nil { + return err + } + dc.DscConfigurationProperties = &dscConfigurationProperties + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + dc.Etag = &etag + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + dc.Tags = tags + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + dc.Location = &location + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + dc.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + dc.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + dc.Type = &typeVar + } + } + } + + return nil +} + +// DscConfigurationAssociationProperty the Dsc configuration property associated with the entity. +type DscConfigurationAssociationProperty struct { + // Name - Gets or sets the name of the Dsc configuration. + Name *string `json:"name,omitempty"` +} + +// DscConfigurationCreateOrUpdateParameters the parameters supplied to the create or update configuration +// operation. +type DscConfigurationCreateOrUpdateParameters struct { + // DscConfigurationCreateOrUpdateProperties - Gets or sets configuration create or update properties. + *DscConfigurationCreateOrUpdateProperties `json:"properties,omitempty"` + // Name - Gets or sets name of the resource. + Name *string `json:"name,omitempty"` + // Location - Gets or sets the location of the resource. + Location *string `json:"location,omitempty"` + // Tags - Gets or sets the tags attached to the resource. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for DscConfigurationCreateOrUpdateParameters. +func (dccoup DscConfigurationCreateOrUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dccoup.DscConfigurationCreateOrUpdateProperties != nil { + objectMap["properties"] = dccoup.DscConfigurationCreateOrUpdateProperties + } + if dccoup.Name != nil { + objectMap["name"] = dccoup.Name + } + if dccoup.Location != nil { + objectMap["location"] = dccoup.Location + } + if dccoup.Tags != nil { + objectMap["tags"] = dccoup.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for DscConfigurationCreateOrUpdateParameters struct. +func (dccoup *DscConfigurationCreateOrUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var dscConfigurationCreateOrUpdateProperties DscConfigurationCreateOrUpdateProperties + err = json.Unmarshal(*v, &dscConfigurationCreateOrUpdateProperties) + if err != nil { + return err + } + dccoup.DscConfigurationCreateOrUpdateProperties = &dscConfigurationCreateOrUpdateProperties + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + dccoup.Name = &name + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + dccoup.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + dccoup.Tags = tags + } + } + } + + return nil +} + +// DscConfigurationCreateOrUpdateProperties the properties to create or update configuration. +type DscConfigurationCreateOrUpdateProperties struct { + // LogVerbose - Gets or sets verbose log option. + LogVerbose *bool `json:"logVerbose,omitempty"` + // LogProgress - Gets or sets progress log option. + LogProgress *bool `json:"logProgress,omitempty"` + // Source - Gets or sets the source. + Source *ContentSource `json:"source,omitempty"` + // Parameters - Gets or sets the configuration parameters. + Parameters map[string]*DscConfigurationParameter `json:"parameters"` + // Description - Gets or sets the description of the configuration. + Description *string `json:"description,omitempty"` +} + +// MarshalJSON is the custom marshaler for DscConfigurationCreateOrUpdateProperties. +func (dccoup DscConfigurationCreateOrUpdateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dccoup.LogVerbose != nil { + objectMap["logVerbose"] = dccoup.LogVerbose + } + if dccoup.LogProgress != nil { + objectMap["logProgress"] = dccoup.LogProgress + } + if dccoup.Source != nil { + objectMap["source"] = dccoup.Source + } + if dccoup.Parameters != nil { + objectMap["parameters"] = dccoup.Parameters + } + if dccoup.Description != nil { + objectMap["description"] = dccoup.Description + } + return json.Marshal(objectMap) +} + +// DscConfigurationListResult the response model for the list configuration operation. +type DscConfigurationListResult struct { + autorest.Response `json:"-"` + // Value - Gets or sets a list of configurations. + Value *[]DscConfiguration `json:"value,omitempty"` + // NextLink - Gets or sets the next link. + NextLink *string `json:"nextLink,omitempty"` + // TotalCount - Gets the total number of configurations matching filter criteria. + TotalCount *int32 `json:"totalCount,omitempty"` +} + +// DscConfigurationListResultIterator provides access to a complete listing of DscConfiguration values. +type DscConfigurationListResultIterator struct { + i int + page DscConfigurationListResultPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *DscConfigurationListResultIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter DscConfigurationListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter DscConfigurationListResultIterator) Response() DscConfigurationListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter DscConfigurationListResultIterator) Value() DscConfiguration { + if !iter.page.NotDone() { + return DscConfiguration{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (dclr DscConfigurationListResult) IsEmpty() bool { + return dclr.Value == nil || len(*dclr.Value) == 0 +} + +// dscConfigurationListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (dclr DscConfigurationListResult) dscConfigurationListResultPreparer() (*http.Request, error) { + if dclr.NextLink == nil || len(to.String(dclr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(dclr.NextLink))) +} + +// DscConfigurationListResultPage contains a page of DscConfiguration values. +type DscConfigurationListResultPage struct { + fn func(DscConfigurationListResult) (DscConfigurationListResult, error) + dclr DscConfigurationListResult +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *DscConfigurationListResultPage) Next() error { + next, err := page.fn(page.dclr) + if err != nil { + return err + } + page.dclr = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page DscConfigurationListResultPage) NotDone() bool { + return !page.dclr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page DscConfigurationListResultPage) Response() DscConfigurationListResult { + return page.dclr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page DscConfigurationListResultPage) Values() []DscConfiguration { + if page.dclr.IsEmpty() { + return nil + } + return *page.dclr.Value +} + +// DscConfigurationParameter definition of the configuration parameter type. +type DscConfigurationParameter struct { + // Type - Gets or sets the type of the parameter. + Type *string `json:"type,omitempty"` + // IsMandatory - Gets or sets a Boolean value to indicate whether the parameter is madatory or not. + IsMandatory *bool `json:"isMandatory,omitempty"` + // Position - Get or sets the position of the parameter. + Position *int32 `json:"position,omitempty"` + // DefaultValue - Gets or sets the default value of parameter. + DefaultValue *string `json:"defaultValue,omitempty"` +} + +// DscConfigurationProperties definition of the configuration property type. +type DscConfigurationProperties struct { + // ProvisioningState - Gets or sets the provisioning state of the configuration. Possible values include: 'Succeeded' + ProvisioningState DscConfigurationProvisioningState `json:"provisioningState,omitempty"` + // JobCount - Gets or sets the job count of the configuration. + JobCount *int32 `json:"jobCount,omitempty"` + // Parameters - Gets or sets the configuration parameters. + Parameters map[string]*DscConfigurationParameter `json:"parameters"` + // Source - Gets or sets the source. + Source *ContentSource `json:"source,omitempty"` + // State - Gets or sets the state of the configuration. Possible values include: 'DscConfigurationStateNew', 'DscConfigurationStateEdit', 'DscConfigurationStatePublished' + State DscConfigurationState `json:"state,omitempty"` + // LogVerbose - Gets or sets verbose log option. + LogVerbose *bool `json:"logVerbose,omitempty"` + // CreationTime - Gets or sets the creation time. + CreationTime *date.Time `json:"creationTime,omitempty"` + // LastModifiedTime - Gets or sets the last modified time. + LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` + // NodeConfigurationCount - Gets the number of compiled node configurations. + NodeConfigurationCount *int32 `json:"nodeConfigurationCount,omitempty"` + // Description - Gets or sets the description. + Description *string `json:"description,omitempty"` +} + +// MarshalJSON is the custom marshaler for DscConfigurationProperties. +func (dcp DscConfigurationProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dcp.ProvisioningState != "" { + objectMap["provisioningState"] = dcp.ProvisioningState + } + if dcp.JobCount != nil { + objectMap["jobCount"] = dcp.JobCount + } + if dcp.Parameters != nil { + objectMap["parameters"] = dcp.Parameters + } + if dcp.Source != nil { + objectMap["source"] = dcp.Source + } + if dcp.State != "" { + objectMap["state"] = dcp.State + } + if dcp.LogVerbose != nil { + objectMap["logVerbose"] = dcp.LogVerbose + } + if dcp.CreationTime != nil { + objectMap["creationTime"] = dcp.CreationTime + } + if dcp.LastModifiedTime != nil { + objectMap["lastModifiedTime"] = dcp.LastModifiedTime + } + if dcp.NodeConfigurationCount != nil { + objectMap["nodeConfigurationCount"] = dcp.NodeConfigurationCount + } + if dcp.Description != nil { + objectMap["description"] = dcp.Description + } + return json.Marshal(objectMap) +} + +// DscConfigurationUpdateParameters the parameters supplied to the create or update configuration operation. +type DscConfigurationUpdateParameters struct { + // DscConfigurationCreateOrUpdateProperties - Gets or sets configuration create or update properties. + *DscConfigurationCreateOrUpdateProperties `json:"properties,omitempty"` + // Name - Gets or sets name of the resource. + Name *string `json:"name,omitempty"` + // Tags - Gets or sets the tags attached to the resource. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for DscConfigurationUpdateParameters. +func (dcup DscConfigurationUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dcup.DscConfigurationCreateOrUpdateProperties != nil { + objectMap["properties"] = dcup.DscConfigurationCreateOrUpdateProperties + } + if dcup.Name != nil { + objectMap["name"] = dcup.Name + } + if dcup.Tags != nil { + objectMap["tags"] = dcup.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for DscConfigurationUpdateParameters struct. +func (dcup *DscConfigurationUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var dscConfigurationCreateOrUpdateProperties DscConfigurationCreateOrUpdateProperties + err = json.Unmarshal(*v, &dscConfigurationCreateOrUpdateProperties) + if err != nil { + return err + } + dcup.DscConfigurationCreateOrUpdateProperties = &dscConfigurationCreateOrUpdateProperties + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + dcup.Name = &name + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + dcup.Tags = tags + } + } + } + + return nil +} + +// DscMetaConfiguration definition of the DSC Meta Configuration. +type DscMetaConfiguration struct { + // ConfigurationModeFrequencyMins - Gets or sets the ConfigurationModeFrequencyMins value of the meta configuration. + ConfigurationModeFrequencyMins *int32 `json:"configurationModeFrequencyMins,omitempty"` + // RebootNodeIfNeeded - Gets or sets the RebootNodeIfNeeded value of the meta configuration. + RebootNodeIfNeeded *bool `json:"rebootNodeIfNeeded,omitempty"` + // ConfigurationMode - Gets or sets the ConfigurationMode value of the meta configuration. + ConfigurationMode *string `json:"configurationMode,omitempty"` + // ActionAfterReboot - Gets or sets the ActionAfterReboot value of the meta configuration. + ActionAfterReboot *string `json:"actionAfterReboot,omitempty"` + // CertificateID - Gets or sets the CertificateId value of the meta configuration. + CertificateID *string `json:"certificateId,omitempty"` + // RefreshFrequencyMins - Gets or sets the RefreshFrequencyMins value of the meta configuration. + RefreshFrequencyMins *int32 `json:"refreshFrequencyMins,omitempty"` + // AllowModuleOverwrite - Gets or sets the AllowModuleOverwrite value of the meta configuration. + AllowModuleOverwrite *bool `json:"allowModuleOverwrite,omitempty"` +} + +// DscNode definition of the dsc node type. +type DscNode struct { + autorest.Response `json:"-"` + // LastSeen - Gets or sets the last seen time of the node. + LastSeen *date.Time `json:"lastSeen,omitempty"` + // RegistrationTime - Gets or sets the registration time of the node. + RegistrationTime *date.Time `json:"registrationTime,omitempty"` + // IP - Gets or sets the ip of the node. + IP *string `json:"ip,omitempty"` + // AccountID - Gets or sets the account id of the node. + AccountID *string `json:"accountId,omitempty"` + // NodeConfiguration - Gets or sets the configuration of the node. + NodeConfiguration *DscNodeConfigurationAssociationProperty `json:"nodeConfiguration,omitempty"` + // Status - Gets or sets the status of the node. + Status *string `json:"status,omitempty"` + // NodeID - Gets or sets the node id. + NodeID *string `json:"nodeId,omitempty"` + // Etag - Gets or sets the etag of the resource. + Etag *string `json:"etag,omitempty"` + // ExtensionHandler - Gets or sets the list of extensionHandler properties for a Node. + ExtensionHandler *[]DscNodeExtensionHandlerAssociationProperty `json:"extensionHandler,omitempty"` + // ID - Fully qualified resource Id for the resource + ID *string `json:"id,omitempty"` + // Name - The name of the resource + Name *string `json:"name,omitempty"` + // Type - The type of the resource. + Type *string `json:"type,omitempty"` +} + +// DscNodeConfiguration definition of the dsc node configuration. +type DscNodeConfiguration struct { + autorest.Response `json:"-"` + // LastModifiedTime - Gets or sets the last modified time. + LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` + // CreationTime - Gets or sets creation time. + CreationTime *date.Time `json:"creationTime,omitempty"` + // Configuration - Gets or sets the configuration of the node. + Configuration *DscConfigurationAssociationProperty `json:"configuration,omitempty"` + // ID - Fully qualified resource Id for the resource + ID *string `json:"id,omitempty"` + // Name - The name of the resource + Name *string `json:"name,omitempty"` + // Type - The type of the resource. + Type *string `json:"type,omitempty"` +} + +// DscNodeConfigurationAssociationProperty the dsc nodeconfiguration property associated with the entity. +type DscNodeConfigurationAssociationProperty struct { + // Name - Gets or sets the name of the dsc nodeconfiguration. + Name *string `json:"name,omitempty"` +} + +// DscNodeConfigurationCreateOrUpdateParameters the parameters supplied to the create or update node configuration +// operation. +type DscNodeConfigurationCreateOrUpdateParameters struct { + // Source - Gets or sets the source. + Source *ContentSource `json:"source,omitempty"` + // Name - Name of the node configuration. + Name *string `json:"name,omitempty"` + // Configuration - Gets or sets the configuration of the node. + Configuration *DscConfigurationAssociationProperty `json:"configuration,omitempty"` + // IncrementNodeConfigurationBuild - If a new build version of NodeConfiguration is required. + IncrementNodeConfigurationBuild *bool `json:"incrementNodeConfigurationBuild,omitempty"` +} + +// DscNodeConfigurationListResult the response model for the list job operation. +type DscNodeConfigurationListResult struct { + autorest.Response `json:"-"` + // Value - Gets or sets a list of Dsc node configurations. + Value *[]DscNodeConfiguration `json:"value,omitempty"` + // NextLink - Gets or sets the next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// DscNodeConfigurationListResultIterator provides access to a complete listing of DscNodeConfiguration values. +type DscNodeConfigurationListResultIterator struct { + i int + page DscNodeConfigurationListResultPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *DscNodeConfigurationListResultIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter DscNodeConfigurationListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter DscNodeConfigurationListResultIterator) Response() DscNodeConfigurationListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter DscNodeConfigurationListResultIterator) Value() DscNodeConfiguration { + if !iter.page.NotDone() { + return DscNodeConfiguration{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (dnclr DscNodeConfigurationListResult) IsEmpty() bool { + return dnclr.Value == nil || len(*dnclr.Value) == 0 +} + +// dscNodeConfigurationListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (dnclr DscNodeConfigurationListResult) dscNodeConfigurationListResultPreparer() (*http.Request, error) { + if dnclr.NextLink == nil || len(to.String(dnclr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(dnclr.NextLink))) +} + +// DscNodeConfigurationListResultPage contains a page of DscNodeConfiguration values. +type DscNodeConfigurationListResultPage struct { + fn func(DscNodeConfigurationListResult) (DscNodeConfigurationListResult, error) + dnclr DscNodeConfigurationListResult +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *DscNodeConfigurationListResultPage) Next() error { + next, err := page.fn(page.dnclr) + if err != nil { + return err + } + page.dnclr = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page DscNodeConfigurationListResultPage) NotDone() bool { + return !page.dnclr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page DscNodeConfigurationListResultPage) Response() DscNodeConfigurationListResult { + return page.dnclr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page DscNodeConfigurationListResultPage) Values() []DscNodeConfiguration { + if page.dnclr.IsEmpty() { + return nil + } + return *page.dnclr.Value +} + +// DscNodeExtensionHandlerAssociationProperty the dsc extensionHandler property associated with the node +type DscNodeExtensionHandlerAssociationProperty struct { + // Name - Gets or sets the name of the extension handler. + Name *string `json:"name,omitempty"` + // Version - Gets or sets the version of the extension handler. + Version *string `json:"version,omitempty"` +} + +// DscNodeListResult the response model for the list dsc nodes operation. +type DscNodeListResult struct { + autorest.Response `json:"-"` + // Value - Gets or sets a list of dsc nodes. + Value *[]DscNode `json:"value,omitempty"` + // NextLink - Gets or sets the next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// DscNodeListResultIterator provides access to a complete listing of DscNode values. +type DscNodeListResultIterator struct { + i int + page DscNodeListResultPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *DscNodeListResultIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter DscNodeListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter DscNodeListResultIterator) Response() DscNodeListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter DscNodeListResultIterator) Value() DscNode { + if !iter.page.NotDone() { + return DscNode{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (dnlr DscNodeListResult) IsEmpty() bool { + return dnlr.Value == nil || len(*dnlr.Value) == 0 +} + +// dscNodeListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (dnlr DscNodeListResult) dscNodeListResultPreparer() (*http.Request, error) { + if dnlr.NextLink == nil || len(to.String(dnlr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(dnlr.NextLink))) +} + +// DscNodeListResultPage contains a page of DscNode values. +type DscNodeListResultPage struct { + fn func(DscNodeListResult) (DscNodeListResult, error) + dnlr DscNodeListResult +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *DscNodeListResultPage) Next() error { + next, err := page.fn(page.dnlr) + if err != nil { + return err + } + page.dnlr = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page DscNodeListResultPage) NotDone() bool { + return !page.dnlr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page DscNodeListResultPage) Response() DscNodeListResult { + return page.dnlr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page DscNodeListResultPage) Values() []DscNode { + if page.dnlr.IsEmpty() { + return nil + } + return *page.dnlr.Value +} + +// DscNodeReport definition of the dsc node report type. +type DscNodeReport struct { + autorest.Response `json:"-"` + // EndTime - Gets or sets the end time of the node report. + EndTime *date.Time `json:"endTime,omitempty"` + // LastModifiedTime - Gets or sets the lastModifiedTime of the node report. + LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` + // StartTime - Gets or sets the start time of the node report. + StartTime *date.Time `json:"startTime,omitempty"` + // Type - Gets or sets the type of the node report. + Type *string `json:"type,omitempty"` + // ReportID - Gets or sets the id of the node report. + ReportID *string `json:"reportId,omitempty"` + // Status - Gets or sets the status of the node report. + Status *string `json:"status,omitempty"` + // RefreshMode - Gets or sets the refreshMode of the node report. + RefreshMode *string `json:"refreshMode,omitempty"` + // RebootRequested - Gets or sets the rebootRequested of the node report. + RebootRequested *string `json:"rebootRequested,omitempty"` + // ReportFormatVersion - Gets or sets the reportFormatVersion of the node report. + ReportFormatVersion *string `json:"reportFormatVersion,omitempty"` + // ConfigurationVersion - Gets or sets the configurationVersion of the node report. + ConfigurationVersion *string `json:"configurationVersion,omitempty"` + // ID - Gets or sets the id. + ID *string `json:"id,omitempty"` + // Errors - Gets or sets the errors for the node report. + Errors *[]DscReportError `json:"errors,omitempty"` + // Resources - Gets or sets the resource for the node report. + Resources *[]DscReportResource `json:"resources,omitempty"` + // MetaConfiguration - Gets or sets the metaConfiguration of the node at the time of the report. + MetaConfiguration *DscMetaConfiguration `json:"metaConfiguration,omitempty"` + // HostName - Gets or sets the hostname of the node that sent the report. + HostName *string `json:"hostName,omitempty"` + // IPV4Addresses - Gets or sets the IPv4 address of the node that sent the report. + IPV4Addresses *[]string `json:"iPV4Addresses,omitempty"` + // IPV6Addresses - Gets or sets the IPv6 address of the node that sent the report. + IPV6Addresses *[]string `json:"iPV6Addresses,omitempty"` + // NumberOfResources - Gets or sets the number of resource in the node report. + NumberOfResources *int32 `json:"numberOfResources,omitempty"` + // RawErrors - Gets or sets the unparsed errors for the node report. + RawErrors *string `json:"rawErrors,omitempty"` +} + +// DscNodeReportListResult the response model for the list dsc nodes operation. +type DscNodeReportListResult struct { + autorest.Response `json:"-"` + // Value - Gets or sets a list of dsc node reports. + Value *[]DscNodeReport `json:"value,omitempty"` + // NextLink - Gets or sets the next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// DscNodeReportListResultIterator provides access to a complete listing of DscNodeReport values. +type DscNodeReportListResultIterator struct { + i int + page DscNodeReportListResultPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *DscNodeReportListResultIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter DscNodeReportListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter DscNodeReportListResultIterator) Response() DscNodeReportListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter DscNodeReportListResultIterator) Value() DscNodeReport { + if !iter.page.NotDone() { + return DscNodeReport{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (dnrlr DscNodeReportListResult) IsEmpty() bool { + return dnrlr.Value == nil || len(*dnrlr.Value) == 0 +} + +// dscNodeReportListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (dnrlr DscNodeReportListResult) dscNodeReportListResultPreparer() (*http.Request, error) { + if dnrlr.NextLink == nil || len(to.String(dnrlr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(dnrlr.NextLink))) +} + +// DscNodeReportListResultPage contains a page of DscNodeReport values. +type DscNodeReportListResultPage struct { + fn func(DscNodeReportListResult) (DscNodeReportListResult, error) + dnrlr DscNodeReportListResult +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *DscNodeReportListResultPage) Next() error { + next, err := page.fn(page.dnrlr) + if err != nil { + return err + } + page.dnrlr = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page DscNodeReportListResultPage) NotDone() bool { + return !page.dnrlr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page DscNodeReportListResultPage) Response() DscNodeReportListResult { + return page.dnrlr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page DscNodeReportListResultPage) Values() []DscNodeReport { + if page.dnrlr.IsEmpty() { + return nil + } + return *page.dnrlr.Value +} + +// DscNodeUpdateParameters the parameters supplied to the update dsc node operation. +type DscNodeUpdateParameters struct { + // NodeID - Gets or sets the id of the dsc node. + NodeID *string `json:"nodeId,omitempty"` + // NodeConfiguration - Gets or sets the configuration of the node. + NodeConfiguration *DscNodeConfigurationAssociationProperty `json:"nodeConfiguration,omitempty"` +} + +// DscReportError definition of the dsc node report error type. +type DscReportError struct { + // ErrorSource - Gets or sets the source of the error. + ErrorSource *string `json:"errorSource,omitempty"` + // ResourceID - Gets or sets the resource ID which generated the error. + ResourceID *string `json:"resourceId,omitempty"` + // ErrorCode - Gets or sets the error code. + ErrorCode *string `json:"errorCode,omitempty"` + // ErrorMessage - Gets or sets the error message. + ErrorMessage *string `json:"errorMessage,omitempty"` + // Locale - Gets or sets the locale of the error. + Locale *string `json:"locale,omitempty"` + // ErrorDetails - Gets or sets the error details. + ErrorDetails *string `json:"errorDetails,omitempty"` +} + +// DscReportResource definition of the DSC Report Resource. +type DscReportResource struct { + // ResourceID - Gets or sets the ID of the resource. + ResourceID *string `json:"resourceId,omitempty"` + // SourceInfo - Gets or sets the source info of the resource. + SourceInfo *string `json:"sourceInfo,omitempty"` + // DependsOn - Gets or sets the Resource Navigation values for resources the resource depends on. + DependsOn *[]DscReportResourceNavigation `json:"dependsOn,omitempty"` + // ModuleName - Gets or sets the module name of the resource. + ModuleName *string `json:"moduleName,omitempty"` + // ModuleVersion - Gets or sets the module version of the resource. + ModuleVersion *string `json:"moduleVersion,omitempty"` + // ResourceName - Gets or sets the name of the resource. + ResourceName *string `json:"resourceName,omitempty"` + // Error - Gets or sets the error of the resource. + Error *string `json:"error,omitempty"` + // Status - Gets or sets the status of the resource. + Status *string `json:"status,omitempty"` + // DurationInSeconds - Gets or sets the duration in seconds for the resource. + DurationInSeconds *float64 `json:"durationInSeconds,omitempty"` + // StartDate - Gets or sets the start date of the resource. + StartDate *date.Time `json:"startDate,omitempty"` +} + +// DscReportResourceNavigation navigation for DSC Report Resource. +type DscReportResourceNavigation struct { + // ResourceID - Gets or sets the ID of the resource to navigate to. + ResourceID *string `json:"resourceId,omitempty"` +} + +// ErrorResponse error response of an operation failure +type ErrorResponse struct { + // Code - Error code + Code *string `json:"code,omitempty"` + // Message - Error message indicating why the operation failed. + Message *string `json:"message,omitempty"` +} + +// FieldDefinition definition of the connection fields. +type FieldDefinition struct { + // IsEncrypted - Gets or sets the isEncrypted flag of the connection field definition. + IsEncrypted *bool `json:"isEncrypted,omitempty"` + // IsOptional - Gets or sets the isOptional flag of the connection field definition. + IsOptional *bool `json:"isOptional,omitempty"` + // Type - Gets or sets the type of the connection field definition. + Type *string `json:"type,omitempty"` +} + +// HybridRunbookWorker definition of hybrid runbook worker. +type HybridRunbookWorker struct { + // Name - Gets or sets the worker machine name. + Name *string `json:"name,omitempty"` + // IP - Gets or sets the assigned machine IP address. + IP *string `json:"ip,omitempty"` + // RegistrationTime - Gets or sets the registration time of the worker machine. + RegistrationTime *date.Time `json:"registrationTime,omitempty"` + // LastSeenDateTime - Last Heartbeat from the Worker + LastSeenDateTime *date.Time `json:"lastSeenDateTime,omitempty"` +} + +// HybridRunbookWorkerGroup definition of hybrid runbook worker group. +type HybridRunbookWorkerGroup struct { + autorest.Response `json:"-"` + // ID - Gets or sets the id of the resource. + ID *string `json:"id,omitempty"` + // Name - Gets or sets the name of the group. + Name *string `json:"name,omitempty"` + // HybridRunbookWorkers - Gets or sets the list of hybrid runbook workers. + HybridRunbookWorkers *[]HybridRunbookWorker `json:"hybridRunbookWorkers,omitempty"` + // Credential - Sets the credential of a worker group. + Credential *RunAsCredentialAssociationProperty `json:"credential,omitempty"` + // GroupType - Type of the HybridWorkerGroup. Possible values include: 'User', 'System' + GroupType GroupTypeEnum `json:"groupType,omitempty"` +} + +// HybridRunbookWorkerGroupsListResult the response model for the list hybrid runbook worker groups. +type HybridRunbookWorkerGroupsListResult struct { + autorest.Response `json:"-"` + // Value - Gets or sets a list of hybrid runbook worker groups. + Value *[]HybridRunbookWorkerGroup `json:"value,omitempty"` + // NextLink - Gets or sets the next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// HybridRunbookWorkerGroupsListResultIterator provides access to a complete listing of HybridRunbookWorkerGroup +// values. +type HybridRunbookWorkerGroupsListResultIterator struct { + i int + page HybridRunbookWorkerGroupsListResultPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *HybridRunbookWorkerGroupsListResultIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter HybridRunbookWorkerGroupsListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter HybridRunbookWorkerGroupsListResultIterator) Response() HybridRunbookWorkerGroupsListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter HybridRunbookWorkerGroupsListResultIterator) Value() HybridRunbookWorkerGroup { + if !iter.page.NotDone() { + return HybridRunbookWorkerGroup{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (hrwglr HybridRunbookWorkerGroupsListResult) IsEmpty() bool { + return hrwglr.Value == nil || len(*hrwglr.Value) == 0 +} + +// hybridRunbookWorkerGroupsListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (hrwglr HybridRunbookWorkerGroupsListResult) hybridRunbookWorkerGroupsListResultPreparer() (*http.Request, error) { + if hrwglr.NextLink == nil || len(to.String(hrwglr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(hrwglr.NextLink))) +} + +// HybridRunbookWorkerGroupsListResultPage contains a page of HybridRunbookWorkerGroup values. +type HybridRunbookWorkerGroupsListResultPage struct { + fn func(HybridRunbookWorkerGroupsListResult) (HybridRunbookWorkerGroupsListResult, error) + hrwglr HybridRunbookWorkerGroupsListResult +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *HybridRunbookWorkerGroupsListResultPage) Next() error { + next, err := page.fn(page.hrwglr) + if err != nil { + return err + } + page.hrwglr = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page HybridRunbookWorkerGroupsListResultPage) NotDone() bool { + return !page.hrwglr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page HybridRunbookWorkerGroupsListResultPage) Response() HybridRunbookWorkerGroupsListResult { + return page.hrwglr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page HybridRunbookWorkerGroupsListResultPage) Values() []HybridRunbookWorkerGroup { + if page.hrwglr.IsEmpty() { + return nil + } + return *page.hrwglr.Value +} + +// HybridRunbookWorkerGroupUpdateParameters parameters supplied to the update operation. +type HybridRunbookWorkerGroupUpdateParameters struct { + // Credential - Sets the credential of a worker group. + Credential *RunAsCredentialAssociationProperty `json:"credential,omitempty"` +} + +// Job definition of the job. +type Job struct { + autorest.Response `json:"-"` + // JobProperties - The properties of the job. + *JobProperties `json:"properties,omitempty"` + // ID - Fully qualified resource Id for the resource + ID *string `json:"id,omitempty"` + // Name - The name of the resource + Name *string `json:"name,omitempty"` + // Type - The type of the resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Job. +func (j Job) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if j.JobProperties != nil { + objectMap["properties"] = j.JobProperties + } + if j.ID != nil { + objectMap["id"] = j.ID + } + if j.Name != nil { + objectMap["name"] = j.Name + } + if j.Type != nil { + objectMap["type"] = j.Type + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Job struct. +func (j *Job) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var jobProperties JobProperties + err = json.Unmarshal(*v, &jobProperties) + if err != nil { + return err + } + j.JobProperties = &jobProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + j.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + j.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + j.Type = &typeVar + } + } + } + + return nil +} + +// JobCollectionItem job collection item properties. +type JobCollectionItem struct { + // JobCollectionItemProperties - Job properties. + *JobCollectionItemProperties `json:"properties,omitempty"` + // ID - Fully qualified resource Id for the resource + ID *string `json:"id,omitempty"` + // Name - The name of the resource + Name *string `json:"name,omitempty"` + // Type - The type of the resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for JobCollectionItem. +func (jci JobCollectionItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if jci.JobCollectionItemProperties != nil { + objectMap["properties"] = jci.JobCollectionItemProperties + } + if jci.ID != nil { + objectMap["id"] = jci.ID + } + if jci.Name != nil { + objectMap["name"] = jci.Name + } + if jci.Type != nil { + objectMap["type"] = jci.Type + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for JobCollectionItem struct. +func (jci *JobCollectionItem) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var jobCollectionItemProperties JobCollectionItemProperties + err = json.Unmarshal(*v, &jobCollectionItemProperties) + if err != nil { + return err + } + jci.JobCollectionItemProperties = &jobCollectionItemProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + jci.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + jci.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + jci.Type = &typeVar + } + } + } + + return nil +} + +// JobCollectionItemProperties job collection item properties. +type JobCollectionItemProperties struct { + // Runbook - The runbook association. + Runbook *RunbookAssociationProperty `json:"runbook,omitempty"` + // JobID - The id of the job. + JobID *uuid.UUID `json:"jobId,omitempty"` + // CreationTime - The creation time of the job. + CreationTime *date.Time `json:"creationTime,omitempty"` + // Status - The status of the job. Possible values include: 'JobStatusNew', 'JobStatusActivating', 'JobStatusRunning', 'JobStatusCompleted', 'JobStatusFailed', 'JobStatusStopped', 'JobStatusBlocked', 'JobStatusSuspended', 'JobStatusDisconnected', 'JobStatusSuspending', 'JobStatusStopping', 'JobStatusResuming', 'JobStatusRemoving' + Status JobStatus `json:"status,omitempty"` + // StartTime - The start time of the job. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - The end time of the job. + EndTime *date.Time `json:"endTime,omitempty"` + // LastModifiedTime - The last modified time of the job. + LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` + // ProvisioningState - The provisioning state of a resource. + ProvisioningState *string `json:"provisioningState,omitempty"` + // RunOn - Specifies the runOn group name where the job was executed. + RunOn *string `json:"runOn,omitempty"` +} + +// JobCreateParameters the parameters supplied to the create job operation. +type JobCreateParameters struct { + // JobCreateProperties - Gets or sets the list of job properties. + *JobCreateProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for JobCreateParameters. +func (jcp JobCreateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if jcp.JobCreateProperties != nil { + objectMap["properties"] = jcp.JobCreateProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for JobCreateParameters struct. +func (jcp *JobCreateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var jobCreateProperties JobCreateProperties + err = json.Unmarshal(*v, &jobCreateProperties) + if err != nil { + return err + } + jcp.JobCreateProperties = &jobCreateProperties + } + } + } + + return nil +} + +// JobCreateProperties ... +type JobCreateProperties struct { + // Runbook - Gets or sets the runbook. + Runbook *RunbookAssociationProperty `json:"runbook,omitempty"` + // Parameters - Gets or sets the parameters of the job. + Parameters map[string]*string `json:"parameters"` + // RunOn - Gets or sets the runOn which specifies the group name where the job is to be executed. + RunOn *string `json:"runOn,omitempty"` +} + +// MarshalJSON is the custom marshaler for JobCreateProperties. +func (jcp JobCreateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if jcp.Runbook != nil { + objectMap["runbook"] = jcp.Runbook + } + if jcp.Parameters != nil { + objectMap["parameters"] = jcp.Parameters + } + if jcp.RunOn != nil { + objectMap["runOn"] = jcp.RunOn + } + return json.Marshal(objectMap) +} + +// JobListResultV2 the response model for the list job operation. +type JobListResultV2 struct { + autorest.Response `json:"-"` + // Value - List of jobs. + Value *[]JobCollectionItem `json:"value,omitempty"` + // NextLink - The link to the next page. + NextLink *string `json:"nextLink,omitempty"` +} + +// JobListResultV2Iterator provides access to a complete listing of JobCollectionItem values. +type JobListResultV2Iterator struct { + i int + page JobListResultV2Page +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *JobListResultV2Iterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter JobListResultV2Iterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter JobListResultV2Iterator) Response() JobListResultV2 { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter JobListResultV2Iterator) Value() JobCollectionItem { + if !iter.page.NotDone() { + return JobCollectionItem{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (jlrv JobListResultV2) IsEmpty() bool { + return jlrv.Value == nil || len(*jlrv.Value) == 0 +} + +// jobListResultV2Preparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (jlrv JobListResultV2) jobListResultV2Preparer() (*http.Request, error) { + if jlrv.NextLink == nil || len(to.String(jlrv.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(jlrv.NextLink))) +} + +// JobListResultV2Page contains a page of JobCollectionItem values. +type JobListResultV2Page struct { + fn func(JobListResultV2) (JobListResultV2, error) + jlrv JobListResultV2 +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *JobListResultV2Page) Next() error { + next, err := page.fn(page.jlrv) + if err != nil { + return err + } + page.jlrv = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page JobListResultV2Page) NotDone() bool { + return !page.jlrv.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page JobListResultV2Page) Response() JobListResultV2 { + return page.jlrv +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page JobListResultV2Page) Values() []JobCollectionItem { + if page.jlrv.IsEmpty() { + return nil + } + return *page.jlrv.Value +} + +// JobNavigation software update configuration machine run job navigation properties. +type JobNavigation struct { + // ID - Id of the job associated with the software update configuration run + ID *string `json:"id,omitempty"` +} + +// JobProperties definition of job properties. +type JobProperties struct { + // Runbook - Gets or sets the runbook. + Runbook *RunbookAssociationProperty `json:"runbook,omitempty"` + // StartedBy - Gets or sets the job started by. + StartedBy *string `json:"startedBy,omitempty"` + // RunOn - Gets or sets the runOn which specifies the group name where the job is to be executed. + RunOn *string `json:"runOn,omitempty"` + // JobID - Gets or sets the id of the job. + JobID *uuid.UUID `json:"jobId,omitempty"` + // CreationTime - Gets or sets the creation time of the job. + CreationTime *date.Time `json:"creationTime,omitempty"` + // Status - Gets or sets the status of the job. Possible values include: 'JobStatusNew', 'JobStatusActivating', 'JobStatusRunning', 'JobStatusCompleted', 'JobStatusFailed', 'JobStatusStopped', 'JobStatusBlocked', 'JobStatusSuspended', 'JobStatusDisconnected', 'JobStatusSuspending', 'JobStatusStopping', 'JobStatusResuming', 'JobStatusRemoving' + Status JobStatus `json:"status,omitempty"` + // StatusDetails - Gets or sets the status details of the job. + StatusDetails *string `json:"statusDetails,omitempty"` + // StartTime - Gets or sets the start time of the job. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - Gets or sets the end time of the job. + EndTime *date.Time `json:"endTime,omitempty"` + // Exception - Gets or sets the exception of the job. + Exception *string `json:"exception,omitempty"` + // LastModifiedTime - Gets or sets the last modified time of the job. + LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` + // LastStatusModifiedTime - Gets or sets the last status modified time of the job. + LastStatusModifiedTime *date.Time `json:"lastStatusModifiedTime,omitempty"` + // Parameters - Gets or sets the parameters of the job. + Parameters map[string]*string `json:"parameters"` + // ProvisioningState - The current provisioning state of the job. Possible values include: 'JobProvisioningStateFailed', 'JobProvisioningStateSucceeded', 'JobProvisioningStateSuspended', 'JobProvisioningStateProcessing' + ProvisioningState JobProvisioningState `json:"provisioningState,omitempty"` +} + +// MarshalJSON is the custom marshaler for JobProperties. +func (jp JobProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if jp.Runbook != nil { + objectMap["runbook"] = jp.Runbook + } + if jp.StartedBy != nil { + objectMap["startedBy"] = jp.StartedBy + } + if jp.RunOn != nil { + objectMap["runOn"] = jp.RunOn + } + if jp.JobID != nil { + objectMap["jobId"] = jp.JobID + } + if jp.CreationTime != nil { + objectMap["creationTime"] = jp.CreationTime + } + if jp.Status != "" { + objectMap["status"] = jp.Status + } + if jp.StatusDetails != nil { + objectMap["statusDetails"] = jp.StatusDetails + } + if jp.StartTime != nil { + objectMap["startTime"] = jp.StartTime + } + if jp.EndTime != nil { + objectMap["endTime"] = jp.EndTime + } + if jp.Exception != nil { + objectMap["exception"] = jp.Exception + } + if jp.LastModifiedTime != nil { + objectMap["lastModifiedTime"] = jp.LastModifiedTime + } + if jp.LastStatusModifiedTime != nil { + objectMap["lastStatusModifiedTime"] = jp.LastStatusModifiedTime + } + if jp.Parameters != nil { + objectMap["parameters"] = jp.Parameters + } + if jp.ProvisioningState != "" { + objectMap["provisioningState"] = jp.ProvisioningState + } + return json.Marshal(objectMap) +} + +// JobSchedule definition of the job schedule. +type JobSchedule struct { + autorest.Response `json:"-"` + // ID - Gets the id of the resource. + ID *string `json:"id,omitempty"` + // Name - Gets the name of the variable. + Name *string `json:"name,omitempty"` + // Type - Resource type + Type *string `json:"type,omitempty"` + // JobScheduleProperties - Gets or sets the properties of the job schedule. + *JobScheduleProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for JobSchedule. +func (js JobSchedule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if js.ID != nil { + objectMap["id"] = js.ID + } + if js.Name != nil { + objectMap["name"] = js.Name + } + if js.Type != nil { + objectMap["type"] = js.Type + } + if js.JobScheduleProperties != nil { + objectMap["properties"] = js.JobScheduleProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for JobSchedule struct. +func (js *JobSchedule) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + js.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + js.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + js.Type = &typeVar + } + case "properties": + if v != nil { + var jobScheduleProperties JobScheduleProperties + err = json.Unmarshal(*v, &jobScheduleProperties) + if err != nil { + return err + } + js.JobScheduleProperties = &jobScheduleProperties + } + } + } + + return nil +} + +// JobScheduleCreateParameters the parameters supplied to the create job schedule operation. +type JobScheduleCreateParameters struct { + // JobScheduleCreateProperties - Gets or sets the list of job schedule properties. + *JobScheduleCreateProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for JobScheduleCreateParameters. +func (jscp JobScheduleCreateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if jscp.JobScheduleCreateProperties != nil { + objectMap["properties"] = jscp.JobScheduleCreateProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for JobScheduleCreateParameters struct. +func (jscp *JobScheduleCreateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var jobScheduleCreateProperties JobScheduleCreateProperties + err = json.Unmarshal(*v, &jobScheduleCreateProperties) + if err != nil { + return err + } + jscp.JobScheduleCreateProperties = &jobScheduleCreateProperties + } + } + } + + return nil +} + +// JobScheduleCreateProperties the parameters supplied to the create job schedule operation. +type JobScheduleCreateProperties struct { + // Schedule - Gets or sets the schedule. + Schedule *ScheduleAssociationProperty `json:"schedule,omitempty"` + // Runbook - Gets or sets the runbook. + Runbook *RunbookAssociationProperty `json:"runbook,omitempty"` + // RunOn - Gets or sets the hybrid worker group that the scheduled job should run on. + RunOn *string `json:"runOn,omitempty"` + // Parameters - Gets or sets a list of job properties. + Parameters map[string]*string `json:"parameters"` +} + +// MarshalJSON is the custom marshaler for JobScheduleCreateProperties. +func (jscp JobScheduleCreateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if jscp.Schedule != nil { + objectMap["schedule"] = jscp.Schedule + } + if jscp.Runbook != nil { + objectMap["runbook"] = jscp.Runbook + } + if jscp.RunOn != nil { + objectMap["runOn"] = jscp.RunOn + } + if jscp.Parameters != nil { + objectMap["parameters"] = jscp.Parameters + } + return json.Marshal(objectMap) +} + +// JobScheduleListResult the response model for the list job schedule operation. +type JobScheduleListResult struct { + autorest.Response `json:"-"` + // Value - Gets or sets a list of job schedules. + Value *[]JobSchedule `json:"value,omitempty"` + // NextLink - Gets or sets the next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// JobScheduleListResultIterator provides access to a complete listing of JobSchedule values. +type JobScheduleListResultIterator struct { + i int + page JobScheduleListResultPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *JobScheduleListResultIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter JobScheduleListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter JobScheduleListResultIterator) Response() JobScheduleListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter JobScheduleListResultIterator) Value() JobSchedule { + if !iter.page.NotDone() { + return JobSchedule{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (jslr JobScheduleListResult) IsEmpty() bool { + return jslr.Value == nil || len(*jslr.Value) == 0 +} + +// jobScheduleListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (jslr JobScheduleListResult) jobScheduleListResultPreparer() (*http.Request, error) { + if jslr.NextLink == nil || len(to.String(jslr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(jslr.NextLink))) +} + +// JobScheduleListResultPage contains a page of JobSchedule values. +type JobScheduleListResultPage struct { + fn func(JobScheduleListResult) (JobScheduleListResult, error) + jslr JobScheduleListResult +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *JobScheduleListResultPage) Next() error { + next, err := page.fn(page.jslr) + if err != nil { + return err + } + page.jslr = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page JobScheduleListResultPage) NotDone() bool { + return !page.jslr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page JobScheduleListResultPage) Response() JobScheduleListResult { + return page.jslr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page JobScheduleListResultPage) Values() []JobSchedule { + if page.jslr.IsEmpty() { + return nil + } + return *page.jslr.Value +} + +// JobScheduleProperties definition of job schedule parameters. +type JobScheduleProperties struct { + // JobScheduleID - Gets or sets the id of job schedule. + JobScheduleID *string `json:"jobScheduleId,omitempty"` + // Schedule - Gets or sets the schedule. + Schedule *ScheduleAssociationProperty `json:"schedule,omitempty"` + // Runbook - Gets or sets the runbook. + Runbook *RunbookAssociationProperty `json:"runbook,omitempty"` + // RunOn - Gets or sets the hybrid worker group that the scheduled job should run on. + RunOn *string `json:"runOn,omitempty"` + // Parameters - Gets or sets the parameters of the job schedule. + Parameters map[string]*string `json:"parameters"` +} + +// MarshalJSON is the custom marshaler for JobScheduleProperties. +func (jsp JobScheduleProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if jsp.JobScheduleID != nil { + objectMap["jobScheduleId"] = jsp.JobScheduleID + } + if jsp.Schedule != nil { + objectMap["schedule"] = jsp.Schedule + } + if jsp.Runbook != nil { + objectMap["runbook"] = jsp.Runbook + } + if jsp.RunOn != nil { + objectMap["runOn"] = jsp.RunOn + } + if jsp.Parameters != nil { + objectMap["parameters"] = jsp.Parameters + } + return json.Marshal(objectMap) +} + +// JobStream definition of the job stream. +type JobStream struct { + autorest.Response `json:"-"` + // ID - Gets or sets the id of the resource. + ID *string `json:"id,omitempty"` + // JobStreamProperties - Gets or sets the id of the job stream. + *JobStreamProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for JobStream. +func (js JobStream) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if js.ID != nil { + objectMap["id"] = js.ID + } + if js.JobStreamProperties != nil { + objectMap["properties"] = js.JobStreamProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for JobStream struct. +func (js *JobStream) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + js.ID = &ID + } + case "properties": + if v != nil { + var jobStreamProperties JobStreamProperties + err = json.Unmarshal(*v, &jobStreamProperties) + if err != nil { + return err + } + js.JobStreamProperties = &jobStreamProperties + } + } + } + + return nil +} + +// JobStreamListResult the response model for the list job stream operation. +type JobStreamListResult struct { + autorest.Response `json:"-"` + // Value - A list of job streams. + Value *[]JobStream `json:"value,omitempty"` + // NextLink - Gets or sets the next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// JobStreamListResultIterator provides access to a complete listing of JobStream values. +type JobStreamListResultIterator struct { + i int + page JobStreamListResultPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *JobStreamListResultIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter JobStreamListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter JobStreamListResultIterator) Response() JobStreamListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter JobStreamListResultIterator) Value() JobStream { + if !iter.page.NotDone() { + return JobStream{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (jslr JobStreamListResult) IsEmpty() bool { + return jslr.Value == nil || len(*jslr.Value) == 0 +} + +// jobStreamListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (jslr JobStreamListResult) jobStreamListResultPreparer() (*http.Request, error) { + if jslr.NextLink == nil || len(to.String(jslr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(jslr.NextLink))) +} + +// JobStreamListResultPage contains a page of JobStream values. +type JobStreamListResultPage struct { + fn func(JobStreamListResult) (JobStreamListResult, error) + jslr JobStreamListResult +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *JobStreamListResultPage) Next() error { + next, err := page.fn(page.jslr) + if err != nil { + return err + } + page.jslr = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page JobStreamListResultPage) NotDone() bool { + return !page.jslr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page JobStreamListResultPage) Response() JobStreamListResult { + return page.jslr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page JobStreamListResultPage) Values() []JobStream { + if page.jslr.IsEmpty() { + return nil + } + return *page.jslr.Value +} + +// JobStreamProperties definition of the job stream. +type JobStreamProperties struct { + // JobStreamID - Gets or sets the id of the job stream. + JobStreamID *string `json:"jobStreamId,omitempty"` + // Time - Gets or sets the creation time of the job. + Time *date.Time `json:"time,omitempty"` + // StreamType - Gets or sets the stream type. Possible values include: 'Progress', 'Output', 'Warning', 'Error', 'Debug', 'Verbose', 'Any' + StreamType JobStreamType `json:"streamType,omitempty"` + // StreamText - Gets or sets the stream text. + StreamText *string `json:"streamText,omitempty"` + // Summary - Gets or sets the summary. + Summary *string `json:"summary,omitempty"` + // Value - Gets or sets the values of the job stream. + Value map[string]interface{} `json:"value"` +} + +// MarshalJSON is the custom marshaler for JobStreamProperties. +func (jsp JobStreamProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if jsp.JobStreamID != nil { + objectMap["jobStreamId"] = jsp.JobStreamID + } + if jsp.Time != nil { + objectMap["time"] = jsp.Time + } + if jsp.StreamType != "" { + objectMap["streamType"] = jsp.StreamType + } + if jsp.StreamText != nil { + objectMap["streamText"] = jsp.StreamText + } + if jsp.Summary != nil { + objectMap["summary"] = jsp.Summary + } + if jsp.Value != nil { + objectMap["value"] = jsp.Value + } + return json.Marshal(objectMap) +} + +// Key automation key which is used to register a DSC Node +type Key struct { + // KeyName - Automation key name. Possible values include: 'KeyNamePrimary', 'KeyNameSecondary' + KeyName KeyName `json:"KeyName,omitempty"` + // Permissions - Automation key permissions. Possible values include: 'Read', 'Full' + Permissions KeyPermissions `json:"Permissions,omitempty"` + // Value - Value of the Automation Key used for registration. + Value *string `json:"Value,omitempty"` +} + +// KeyListResult ... +type KeyListResult struct { + autorest.Response `json:"-"` + // Keys - Lists the automation keys. + Keys *[]Key `json:"keys,omitempty"` +} + +// LinkedWorkspace definition of the linked workspace. +type LinkedWorkspace struct { + autorest.Response `json:"-"` + // ID - Gets the id of the linked workspace. + ID *string `json:"id,omitempty"` +} + +// LinuxProperties linux specific update configuration. +type LinuxProperties struct { + // IncludedPackageClassifications - Update classifications included in the software update configuration. Possible values include: 'Unclassified', 'Critical', 'Security', 'Other' + IncludedPackageClassifications LinuxUpdateClasses `json:"includedPackageClassifications,omitempty"` + // ExcludedPackageNameMasks - packages excluded from the software update configuration. + ExcludedPackageNameMasks *[]string `json:"excludedPackageNameMasks,omitempty"` + // IncludedPackageNameMasks - packages included from the software update configuration. + IncludedPackageNameMasks *[]string `json:"includedPackageNameMasks,omitempty"` + // RebootSetting - Reboot setting for the software update configuration. + RebootSetting *string `json:"rebootSetting,omitempty"` +} + +// Module definition of the module type. +type Module struct { + autorest.Response `json:"-"` + // ModuleProperties - Gets or sets the module properties. + *ModuleProperties `json:"properties,omitempty"` + // Etag - Gets or sets the etag of the resource. + Etag *string `json:"etag,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // Location - The Azure Region where the resource lives + Location *string `json:"location,omitempty"` + // ID - Fully qualified resource Id for the resource + ID *string `json:"id,omitempty"` + // Name - The name of the resource + Name *string `json:"name,omitempty"` + // Type - The type of the resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Module. +func (mVar Module) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mVar.ModuleProperties != nil { + objectMap["properties"] = mVar.ModuleProperties + } + if mVar.Etag != nil { + objectMap["etag"] = mVar.Etag + } + if mVar.Tags != nil { + objectMap["tags"] = mVar.Tags + } + if mVar.Location != nil { + objectMap["location"] = mVar.Location + } + if mVar.ID != nil { + objectMap["id"] = mVar.ID + } + if mVar.Name != nil { + objectMap["name"] = mVar.Name + } + if mVar.Type != nil { + objectMap["type"] = mVar.Type + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Module struct. +func (mVar *Module) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var moduleProperties ModuleProperties + err = json.Unmarshal(*v, &moduleProperties) + if err != nil { + return err + } + mVar.ModuleProperties = &moduleProperties + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + mVar.Etag = &etag + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + mVar.Tags = tags + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + mVar.Location = &location + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + mVar.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + mVar.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + mVar.Type = &typeVar + } + } + } + + return nil +} + +// ModuleCreateOrUpdateParameters the parameters supplied to the create or update module operation. +type ModuleCreateOrUpdateParameters struct { + // ModuleCreateOrUpdateProperties - Gets or sets the module create properties. + *ModuleCreateOrUpdateProperties `json:"properties,omitempty"` + // Name - Gets or sets name of the resource. + Name *string `json:"name,omitempty"` + // Location - Gets or sets the location of the resource. + Location *string `json:"location,omitempty"` + // Tags - Gets or sets the tags attached to the resource. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for ModuleCreateOrUpdateParameters. +func (mcoup ModuleCreateOrUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mcoup.ModuleCreateOrUpdateProperties != nil { + objectMap["properties"] = mcoup.ModuleCreateOrUpdateProperties + } + if mcoup.Name != nil { + objectMap["name"] = mcoup.Name + } + if mcoup.Location != nil { + objectMap["location"] = mcoup.Location + } + if mcoup.Tags != nil { + objectMap["tags"] = mcoup.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ModuleCreateOrUpdateParameters struct. +func (mcoup *ModuleCreateOrUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var moduleCreateOrUpdateProperties ModuleCreateOrUpdateProperties + err = json.Unmarshal(*v, &moduleCreateOrUpdateProperties) + if err != nil { + return err + } + mcoup.ModuleCreateOrUpdateProperties = &moduleCreateOrUpdateProperties + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + mcoup.Name = &name + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + mcoup.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + mcoup.Tags = tags + } + } + } + + return nil +} + +// ModuleCreateOrUpdateProperties the parameters supplied to the create or update module properties. +type ModuleCreateOrUpdateProperties struct { + // ContentLink - Gets or sets the module content link. + ContentLink *ContentLink `json:"contentLink,omitempty"` +} + +// ModuleErrorInfo definition of the module error info type. +type ModuleErrorInfo struct { + // Code - Gets or sets the error code. + Code *string `json:"code,omitempty"` + // Message - Gets or sets the error message. + Message *string `json:"message,omitempty"` +} + +// ModuleListResult the response model for the list module operation. +type ModuleListResult struct { + autorest.Response `json:"-"` + // Value - Gets or sets a list of modules. + Value *[]Module `json:"value,omitempty"` + // NextLink - Gets or sets the next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// ModuleListResultIterator provides access to a complete listing of Module values. +type ModuleListResultIterator struct { + i int + page ModuleListResultPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ModuleListResultIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ModuleListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ModuleListResultIterator) Response() ModuleListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ModuleListResultIterator) Value() Module { + if !iter.page.NotDone() { + return Module{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (mlr ModuleListResult) IsEmpty() bool { + return mlr.Value == nil || len(*mlr.Value) == 0 +} + +// moduleListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (mlr ModuleListResult) moduleListResultPreparer() (*http.Request, error) { + if mlr.NextLink == nil || len(to.String(mlr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(mlr.NextLink))) +} + +// ModuleListResultPage contains a page of Module values. +type ModuleListResultPage struct { + fn func(ModuleListResult) (ModuleListResult, error) + mlr ModuleListResult +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ModuleListResultPage) Next() error { + next, err := page.fn(page.mlr) + if err != nil { + return err + } + page.mlr = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ModuleListResultPage) NotDone() bool { + return !page.mlr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ModuleListResultPage) Response() ModuleListResult { + return page.mlr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ModuleListResultPage) Values() []Module { + if page.mlr.IsEmpty() { + return nil + } + return *page.mlr.Value +} + +// ModuleProperties definition of the module property type. +type ModuleProperties struct { + // IsGlobal - Gets or sets the isGlobal flag of the module. + IsGlobal *bool `json:"isGlobal,omitempty"` + // Version - Gets or sets the version of the module. + Version *string `json:"version,omitempty"` + // SizeInBytes - Gets or sets the size in bytes of the module. + SizeInBytes *int64 `json:"sizeInBytes,omitempty"` + // ActivityCount - Gets or sets the activity count of the module. + ActivityCount *int32 `json:"activityCount,omitempty"` + // ProvisioningState - Gets or sets the provisioning state of the module. Possible values include: 'ModuleProvisioningStateCreated', 'ModuleProvisioningStateCreating', 'ModuleProvisioningStateStartingImportModuleRunbook', 'ModuleProvisioningStateRunningImportModuleRunbook', 'ModuleProvisioningStateContentRetrieved', 'ModuleProvisioningStateContentDownloaded', 'ModuleProvisioningStateContentValidated', 'ModuleProvisioningStateConnectionTypeImported', 'ModuleProvisioningStateContentStored', 'ModuleProvisioningStateModuleDataStored', 'ModuleProvisioningStateActivitiesStored', 'ModuleProvisioningStateModuleImportRunbookComplete', 'ModuleProvisioningStateSucceeded', 'ModuleProvisioningStateFailed', 'ModuleProvisioningStateCancelled', 'ModuleProvisioningStateUpdating' + ProvisioningState ModuleProvisioningState `json:"provisioningState,omitempty"` + // ContentLink - Gets or sets the contentLink of the module. + ContentLink *ContentLink `json:"contentLink,omitempty"` + // Error - Gets or sets the error info of the module. + Error *ModuleErrorInfo `json:"error,omitempty"` + // CreationTime - Gets or sets the creation time. + CreationTime *date.Time `json:"creationTime,omitempty"` + // LastModifiedTime - Gets or sets the last modified time. + LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` + // Description - Gets or sets the description. + Description *string `json:"description,omitempty"` + // IsComposite - Gets or sets type of module, if its composite or not. + IsComposite *bool `json:"isComposite,omitempty"` +} + +// ModuleUpdateParameters the parameters supplied to the update module operation. +type ModuleUpdateParameters struct { + // ModuleUpdateProperties - Gets or sets the module update properties. + *ModuleUpdateProperties `json:"properties,omitempty"` + // Name - Gets or sets name of the resource. + Name *string `json:"name,omitempty"` + // Location - Gets or sets the location of the resource. + Location *string `json:"location,omitempty"` + // Tags - Gets or sets the tags attached to the resource. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for ModuleUpdateParameters. +func (mup ModuleUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mup.ModuleUpdateProperties != nil { + objectMap["properties"] = mup.ModuleUpdateProperties + } + if mup.Name != nil { + objectMap["name"] = mup.Name + } + if mup.Location != nil { + objectMap["location"] = mup.Location + } + if mup.Tags != nil { + objectMap["tags"] = mup.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ModuleUpdateParameters struct. +func (mup *ModuleUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var moduleUpdateProperties ModuleUpdateProperties + err = json.Unmarshal(*v, &moduleUpdateProperties) + if err != nil { + return err + } + mup.ModuleUpdateProperties = &moduleUpdateProperties + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + mup.Name = &name + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + mup.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + mup.Tags = tags + } + } + } + + return nil +} + +// ModuleUpdateProperties the parameters supplied to the update properties. +type ModuleUpdateProperties struct { + // ContentLink - Gets or sets the module content link. + ContentLink *ContentLink `json:"contentLink,omitempty"` +} + +// Operation automation REST API operation +type Operation struct { + // Name - Operation name: {provider}/{resource}/{operation} + Name *string `json:"name,omitempty"` + // Display - Provider, Resource and Operation values + Display *OperationDisplay `json:"display,omitempty"` +} + +// OperationDisplay provider, Resource and Operation values +type OperationDisplay struct { + // Provider - Service provider: Microsoft.Automation + Provider *string `json:"provider,omitempty"` + // Resource - Resource on which the operation is performed: Runbooks, Jobs etc. + Resource *string `json:"resource,omitempty"` + // Operation - Operation type: Read, write, delete, etc. + Operation *string `json:"operation,omitempty"` +} + +// OperationListResult the response model for the list of Automation operations +type OperationListResult struct { + autorest.Response `json:"-"` + // Value - List of Automation operations supported by the Automation resource provider. + Value *[]Operation `json:"value,omitempty"` +} + +// ProxyResource ARM proxy resource. +type ProxyResource struct { + // ID - Fully qualified resource Id for the resource + ID *string `json:"id,omitempty"` + // Name - The name of the resource + Name *string `json:"name,omitempty"` + // Type - The type of the resource. + Type *string `json:"type,omitempty"` +} + +// Resource the core properties of ARM resources +type Resource struct { + // ID - Fully qualified resource Id for the resource + ID *string `json:"id,omitempty"` + // Name - The name of the resource + Name *string `json:"name,omitempty"` + // Type - The type of the resource. + Type *string `json:"type,omitempty"` +} + +// RunAsCredentialAssociationProperty definition of runas credential to use for hybrid worker. +type RunAsCredentialAssociationProperty struct { + // Name - Gets or sets the name of the credential. + Name *string `json:"name,omitempty"` +} + +// Runbook definition of the runbook type. +type Runbook struct { + autorest.Response `json:"-"` + // RunbookProperties - Gets or sets the runbook properties. + *RunbookProperties `json:"properties,omitempty"` + // Etag - Gets or sets the etag of the resource. + Etag *string `json:"etag,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // Location - The Azure Region where the resource lives + Location *string `json:"location,omitempty"` + // ID - Fully qualified resource Id for the resource + ID *string `json:"id,omitempty"` + // Name - The name of the resource + Name *string `json:"name,omitempty"` + // Type - The type of the resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Runbook. +func (r Runbook) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if r.RunbookProperties != nil { + objectMap["properties"] = r.RunbookProperties + } + if r.Etag != nil { + objectMap["etag"] = r.Etag + } + if r.Tags != nil { + objectMap["tags"] = r.Tags + } + if r.Location != nil { + objectMap["location"] = r.Location + } + if r.ID != nil { + objectMap["id"] = r.ID + } + if r.Name != nil { + objectMap["name"] = r.Name + } + if r.Type != nil { + objectMap["type"] = r.Type + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Runbook struct. +func (r *Runbook) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var runbookProperties RunbookProperties + err = json.Unmarshal(*v, &runbookProperties) + if err != nil { + return err + } + r.RunbookProperties = &runbookProperties + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + r.Etag = &etag + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + r.Tags = tags + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + r.Location = &location + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + r.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + r.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + r.Type = &typeVar + } + } + } + + return nil +} + +// RunbookAssociationProperty the runbook property associated with the entity. +type RunbookAssociationProperty struct { + // Name - Gets or sets the name of the runbook. + Name *string `json:"name,omitempty"` +} + +// RunbookCreateOrUpdateDraftParameters the parameters supplied to the create or update runbook operation. +type RunbookCreateOrUpdateDraftParameters struct { + // RunbookContent - Content of the Runbook. + RunbookContent *string `json:"runbookContent,omitempty"` +} + +// RunbookCreateOrUpdateDraftProperties the parameters supplied to the create or update dratft runbook properties. +type RunbookCreateOrUpdateDraftProperties struct { + // LogVerbose - Gets or sets verbose log option. + LogVerbose *bool `json:"logVerbose,omitempty"` + // LogProgress - Gets or sets progress log option. + LogProgress *bool `json:"logProgress,omitempty"` + // RunbookType - Gets or sets the type of the runbook. Possible values include: 'Script', 'Graph', 'PowerShellWorkflow', 'PowerShell', 'GraphPowerShellWorkflow', 'GraphPowerShell' + RunbookType RunbookTypeEnum `json:"runbookType,omitempty"` + // Draft - Gets or sets the draft runbook properties. + Draft *RunbookDraft `json:"draft,omitempty"` + // Description - Gets or sets the description of the runbook. + Description *string `json:"description,omitempty"` + // LogActivityTrace - Gets or sets the activity-level tracing options of the runbook. + LogActivityTrace *int32 `json:"logActivityTrace,omitempty"` +} + +// RunbookCreateOrUpdateParameters the parameters supplied to the create or update runbook operation. +type RunbookCreateOrUpdateParameters struct { + // RunbookCreateOrUpdateProperties - Gets or sets runbook create or update properties. + *RunbookCreateOrUpdateProperties `json:"properties,omitempty"` + // Name - Gets or sets the name of the resource. + Name *string `json:"name,omitempty"` + // Location - Gets or sets the location of the resource. + Location *string `json:"location,omitempty"` + // Tags - Gets or sets the tags attached to the resource. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for RunbookCreateOrUpdateParameters. +func (rcoup RunbookCreateOrUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rcoup.RunbookCreateOrUpdateProperties != nil { + objectMap["properties"] = rcoup.RunbookCreateOrUpdateProperties + } + if rcoup.Name != nil { + objectMap["name"] = rcoup.Name + } + if rcoup.Location != nil { + objectMap["location"] = rcoup.Location + } + if rcoup.Tags != nil { + objectMap["tags"] = rcoup.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for RunbookCreateOrUpdateParameters struct. +func (rcoup *RunbookCreateOrUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var runbookCreateOrUpdateProperties RunbookCreateOrUpdateProperties + err = json.Unmarshal(*v, &runbookCreateOrUpdateProperties) + if err != nil { + return err + } + rcoup.RunbookCreateOrUpdateProperties = &runbookCreateOrUpdateProperties + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + rcoup.Name = &name + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + rcoup.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + rcoup.Tags = tags + } + } + } + + return nil +} + +// RunbookCreateOrUpdateProperties the parameters supplied to the create or update runbook properties. +type RunbookCreateOrUpdateProperties struct { + // LogVerbose - Gets or sets verbose log option. + LogVerbose *bool `json:"logVerbose,omitempty"` + // LogProgress - Gets or sets progress log option. + LogProgress *bool `json:"logProgress,omitempty"` + // RunbookType - Gets or sets the type of the runbook. Possible values include: 'Script', 'Graph', 'PowerShellWorkflow', 'PowerShell', 'GraphPowerShellWorkflow', 'GraphPowerShell' + RunbookType RunbookTypeEnum `json:"runbookType,omitempty"` + // Draft - Gets or sets the draft runbook properties. + Draft *RunbookDraft `json:"draft,omitempty"` + // PublishContentLink - Gets or sets the published runbook content link. + PublishContentLink *ContentLink `json:"publishContentLink,omitempty"` + // Description - Gets or sets the description of the runbook. + Description *string `json:"description,omitempty"` + // LogActivityTrace - Gets or sets the activity-level tracing options of the runbook. + LogActivityTrace *int32 `json:"logActivityTrace,omitempty"` +} + +// RunbookDraft ... +type RunbookDraft struct { + autorest.Response `json:"-"` + // InEdit - Gets or sets whether runbook is in edit mode. + InEdit *bool `json:"inEdit,omitempty"` + // DraftContentLink - Gets or sets the draft runbook content link. + DraftContentLink *ContentLink `json:"draftContentLink,omitempty"` + // CreationTime - Gets or sets the creation time of the runbook draft. + CreationTime *date.Time `json:"creationTime,omitempty"` + // LastModifiedTime - Gets or sets the last modified time of the runbook draft. + LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` + // Parameters - Gets or sets the runbook draft parameters. + Parameters map[string]*RunbookParameter `json:"parameters"` + // OutputTypes - Gets or sets the runbook output types. + OutputTypes *[]string `json:"outputTypes,omitempty"` +} + +// MarshalJSON is the custom marshaler for RunbookDraft. +func (rd RunbookDraft) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rd.InEdit != nil { + objectMap["inEdit"] = rd.InEdit + } + if rd.DraftContentLink != nil { + objectMap["draftContentLink"] = rd.DraftContentLink + } + if rd.CreationTime != nil { + objectMap["creationTime"] = rd.CreationTime + } + if rd.LastModifiedTime != nil { + objectMap["lastModifiedTime"] = rd.LastModifiedTime + } + if rd.Parameters != nil { + objectMap["parameters"] = rd.Parameters + } + if rd.OutputTypes != nil { + objectMap["outputTypes"] = rd.OutputTypes + } + return json.Marshal(objectMap) +} + +// RunbookDraftPublishFuture an abstraction for monitoring and retrieving the results of a long-running operation. +type RunbookDraftPublishFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *RunbookDraftPublishFuture) Result(client RunbookDraftClient) (ar autorest.Response, err error) { + var done bool + done, err = future.Done(client) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.RunbookDraftPublishFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("automation.RunbookDraftPublishFuture") + return + } + ar.Response = future.Response() + return +} + +// RunbookDraftReplaceContentFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type RunbookDraftReplaceContentFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *RunbookDraftReplaceContentFuture) Result(client RunbookDraftClient) (s String, err error) { + var done bool + done, err = future.Done(client) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.RunbookDraftReplaceContentFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("automation.RunbookDraftReplaceContentFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if s.Response.Response, err = future.GetResult(sender); err == nil && s.Response.Response.StatusCode != http.StatusNoContent { + s, err = client.ReplaceContentResponder(s.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.RunbookDraftReplaceContentFuture", "Result", s.Response.Response, "Failure responding to request") + } + } + return +} + +// RunbookDraftUndoEditResult the response model for the undoedit runbook operation. +type RunbookDraftUndoEditResult struct { + autorest.Response `json:"-"` + // StatusCode - Possible values include: 'Continue', 'SwitchingProtocols', 'OK', 'Created', 'Accepted', 'NonAuthoritativeInformation', 'NoContent', 'ResetContent', 'PartialContent', 'MultipleChoices', 'Ambiguous', 'MovedPermanently', 'Moved', 'Found', 'Redirect', 'SeeOther', 'RedirectMethod', 'NotModified', 'UseProxy', 'Unused', 'TemporaryRedirect', 'RedirectKeepVerb', 'BadRequest', 'Unauthorized', 'PaymentRequired', 'Forbidden', 'NotFound', 'MethodNotAllowed', 'NotAcceptable', 'ProxyAuthenticationRequired', 'RequestTimeout', 'Conflict', 'Gone', 'LengthRequired', 'PreconditionFailed', 'RequestEntityTooLarge', 'RequestURITooLong', 'UnsupportedMediaType', 'RequestedRangeNotSatisfiable', 'ExpectationFailed', 'UpgradeRequired', 'InternalServerError', 'NotImplemented', 'BadGateway', 'ServiceUnavailable', 'GatewayTimeout', 'HTTPVersionNotSupported' + StatusCode HTTPStatusCode `json:"statusCode,omitempty"` + RequestID *string `json:"requestId,omitempty"` +} + +// RunbookListResult the response model for the list runbook operation. +type RunbookListResult struct { + autorest.Response `json:"-"` + // Value - Gets or sets a list of runbooks. + Value *[]Runbook `json:"value,omitempty"` + // NextLink - Gets or sets the next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// RunbookListResultIterator provides access to a complete listing of Runbook values. +type RunbookListResultIterator struct { + i int + page RunbookListResultPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *RunbookListResultIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter RunbookListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter RunbookListResultIterator) Response() RunbookListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter RunbookListResultIterator) Value() Runbook { + if !iter.page.NotDone() { + return Runbook{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (rlr RunbookListResult) IsEmpty() bool { + return rlr.Value == nil || len(*rlr.Value) == 0 +} + +// runbookListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (rlr RunbookListResult) runbookListResultPreparer() (*http.Request, error) { + if rlr.NextLink == nil || len(to.String(rlr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(rlr.NextLink))) +} + +// RunbookListResultPage contains a page of Runbook values. +type RunbookListResultPage struct { + fn func(RunbookListResult) (RunbookListResult, error) + rlr RunbookListResult +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *RunbookListResultPage) Next() error { + next, err := page.fn(page.rlr) + if err != nil { + return err + } + page.rlr = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page RunbookListResultPage) NotDone() bool { + return !page.rlr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page RunbookListResultPage) Response() RunbookListResult { + return page.rlr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page RunbookListResultPage) Values() []Runbook { + if page.rlr.IsEmpty() { + return nil + } + return *page.rlr.Value +} + +// RunbookParameter definition of the runbook parameter type. +type RunbookParameter struct { + // Type - Gets or sets the type of the parameter. + Type *string `json:"type,omitempty"` + // IsMandatory - Gets or sets a Boolean value to indicate whether the parameter is madatory or not. + IsMandatory *bool `json:"isMandatory,omitempty"` + // Position - Get or sets the position of the parameter. + Position *int32 `json:"position,omitempty"` + // DefaultValue - Gets or sets the default value of parameter. + DefaultValue *string `json:"defaultValue,omitempty"` +} + +// RunbookProperties definition of the runbook property type. +type RunbookProperties struct { + // RunbookType - Gets or sets the type of the runbook. Possible values include: 'Script', 'Graph', 'PowerShellWorkflow', 'PowerShell', 'GraphPowerShellWorkflow', 'GraphPowerShell' + RunbookType RunbookTypeEnum `json:"runbookType,omitempty"` + // PublishContentLink - Gets or sets the published runbook content link. + PublishContentLink *ContentLink `json:"publishContentLink,omitempty"` + // State - Gets or sets the state of the runbook. Possible values include: 'RunbookStateNew', 'RunbookStateEdit', 'RunbookStatePublished' + State RunbookState `json:"state,omitempty"` + // LogVerbose - Gets or sets verbose log option. + LogVerbose *bool `json:"logVerbose,omitempty"` + // LogProgress - Gets or sets progress log option. + LogProgress *bool `json:"logProgress,omitempty"` + // LogActivityTrace - Gets or sets the option to log activity trace of the runbook. + LogActivityTrace *int32 `json:"logActivityTrace,omitempty"` + // JobCount - Gets or sets the job count of the runbook. + JobCount *int32 `json:"jobCount,omitempty"` + // Parameters - Gets or sets the runbook parameters. + Parameters map[string]*RunbookParameter `json:"parameters"` + // OutputTypes - Gets or sets the runbook output types. + OutputTypes *[]string `json:"outputTypes,omitempty"` + // Draft - Gets or sets the draft runbook properties. + Draft *RunbookDraft `json:"draft,omitempty"` + // ProvisioningState - Gets or sets the provisioning state of the runbook. Possible values include: 'RunbookProvisioningStateSucceeded' + ProvisioningState RunbookProvisioningState `json:"provisioningState,omitempty"` + // LastModifiedBy - Gets or sets the last modified by. + LastModifiedBy *string `json:"lastModifiedBy,omitempty"` + // CreationTime - Gets or sets the creation time. + CreationTime *date.Time `json:"creationTime,omitempty"` + // LastModifiedTime - Gets or sets the last modified time. + LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` + // Description - Gets or sets the description. + Description *string `json:"description,omitempty"` +} + +// MarshalJSON is the custom marshaler for RunbookProperties. +func (rp RunbookProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rp.RunbookType != "" { + objectMap["runbookType"] = rp.RunbookType + } + if rp.PublishContentLink != nil { + objectMap["publishContentLink"] = rp.PublishContentLink + } + if rp.State != "" { + objectMap["state"] = rp.State + } + if rp.LogVerbose != nil { + objectMap["logVerbose"] = rp.LogVerbose + } + if rp.LogProgress != nil { + objectMap["logProgress"] = rp.LogProgress + } + if rp.LogActivityTrace != nil { + objectMap["logActivityTrace"] = rp.LogActivityTrace + } + if rp.JobCount != nil { + objectMap["jobCount"] = rp.JobCount + } + if rp.Parameters != nil { + objectMap["parameters"] = rp.Parameters + } + if rp.OutputTypes != nil { + objectMap["outputTypes"] = rp.OutputTypes + } + if rp.Draft != nil { + objectMap["draft"] = rp.Draft + } + if rp.ProvisioningState != "" { + objectMap["provisioningState"] = rp.ProvisioningState + } + if rp.LastModifiedBy != nil { + objectMap["lastModifiedBy"] = rp.LastModifiedBy + } + if rp.CreationTime != nil { + objectMap["creationTime"] = rp.CreationTime + } + if rp.LastModifiedTime != nil { + objectMap["lastModifiedTime"] = rp.LastModifiedTime + } + if rp.Description != nil { + objectMap["description"] = rp.Description + } + return json.Marshal(objectMap) +} + +// RunbookUpdateParameters the parameters supplied to the update runbook operation. +type RunbookUpdateParameters struct { + // RunbookUpdateProperties - Gets or sets the runbook update properties. + *RunbookUpdateProperties `json:"properties,omitempty"` + // Name - Gets or sets the name of the resource. + Name *string `json:"name,omitempty"` + // Location - Gets or sets the location of the resource. + Location *string `json:"location,omitempty"` + // Tags - Gets or sets the tags attached to the resource. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for RunbookUpdateParameters. +func (rup RunbookUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rup.RunbookUpdateProperties != nil { + objectMap["properties"] = rup.RunbookUpdateProperties + } + if rup.Name != nil { + objectMap["name"] = rup.Name + } + if rup.Location != nil { + objectMap["location"] = rup.Location + } + if rup.Tags != nil { + objectMap["tags"] = rup.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for RunbookUpdateParameters struct. +func (rup *RunbookUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var runbookUpdateProperties RunbookUpdateProperties + err = json.Unmarshal(*v, &runbookUpdateProperties) + if err != nil { + return err + } + rup.RunbookUpdateProperties = &runbookUpdateProperties + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + rup.Name = &name + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + rup.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + rup.Tags = tags + } + } + } + + return nil +} + +// RunbookUpdateProperties the parameters supplied to the update runbook properties. +type RunbookUpdateProperties struct { + // Description - Gets or sets the description of the runbook. + Description *string `json:"description,omitempty"` + // LogVerbose - Gets or sets verbose log option. + LogVerbose *bool `json:"logVerbose,omitempty"` + // LogProgress - Gets or sets progress log option. + LogProgress *bool `json:"logProgress,omitempty"` + // LogActivityTrace - Gets or sets the activity-level tracing options of the runbook. + LogActivityTrace *int32 `json:"logActivityTrace,omitempty"` +} + +// Schedule definition of the schedule. +type Schedule struct { + autorest.Response `json:"-"` + // ScheduleProperties - Gets or sets the properties of the schedule. + *ScheduleProperties `json:"properties,omitempty"` + // ID - Fully qualified resource Id for the resource + ID *string `json:"id,omitempty"` + // Name - The name of the resource + Name *string `json:"name,omitempty"` + // Type - The type of the resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Schedule. +func (s Schedule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if s.ScheduleProperties != nil { + objectMap["properties"] = s.ScheduleProperties + } + if s.ID != nil { + objectMap["id"] = s.ID + } + if s.Name != nil { + objectMap["name"] = s.Name + } + if s.Type != nil { + objectMap["type"] = s.Type + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Schedule struct. +func (s *Schedule) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var scheduleProperties ScheduleProperties + err = json.Unmarshal(*v, &scheduleProperties) + if err != nil { + return err + } + s.ScheduleProperties = &scheduleProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + s.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + s.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + s.Type = &typeVar + } + } + } + + return nil +} + +// ScheduleAssociationProperty the schedule property associated with the entity. +type ScheduleAssociationProperty struct { + // Name - Gets or sets the name of the Schedule. + Name *string `json:"name,omitempty"` +} + +// ScheduleCreateOrUpdateParameters the parameters supplied to the create or update schedule operation. +type ScheduleCreateOrUpdateParameters struct { + // Name - Gets or sets the name of the Schedule. + Name *string `json:"name,omitempty"` + // ScheduleCreateOrUpdateProperties - Gets or sets the list of schedule properties. + *ScheduleCreateOrUpdateProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for ScheduleCreateOrUpdateParameters. +func (scoup ScheduleCreateOrUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if scoup.Name != nil { + objectMap["name"] = scoup.Name + } + if scoup.ScheduleCreateOrUpdateProperties != nil { + objectMap["properties"] = scoup.ScheduleCreateOrUpdateProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ScheduleCreateOrUpdateParameters struct. +func (scoup *ScheduleCreateOrUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + scoup.Name = &name + } + case "properties": + if v != nil { + var scheduleCreateOrUpdateProperties ScheduleCreateOrUpdateProperties + err = json.Unmarshal(*v, &scheduleCreateOrUpdateProperties) + if err != nil { + return err + } + scoup.ScheduleCreateOrUpdateProperties = &scheduleCreateOrUpdateProperties + } + } + } + + return nil +} + +// ScheduleCreateOrUpdateProperties the parameters supplied to the create or update schedule operation. +type ScheduleCreateOrUpdateProperties struct { + // Description - Gets or sets the description of the schedule. + Description *string `json:"description,omitempty"` + // StartTime - Gets or sets the start time of the schedule. + StartTime *date.Time `json:"startTime,omitempty"` + // ExpiryTime - Gets or sets the end time of the schedule. + ExpiryTime *date.Time `json:"expiryTime,omitempty"` + // Interval - Gets or sets the interval of the schedule. + Interval interface{} `json:"interval,omitempty"` + // Frequency - Possible values include: 'OneTime', 'Day', 'Hour', 'Week', 'Month' + Frequency ScheduleFrequency `json:"frequency,omitempty"` + // TimeZone - Gets or sets the time zone of the schedule. + TimeZone *string `json:"timeZone,omitempty"` + // AdvancedSchedule - Gets or sets the AdvancedSchedule. + AdvancedSchedule *AdvancedSchedule `json:"advancedSchedule,omitempty"` +} + +// ScheduleListResult the response model for the list schedule operation. +type ScheduleListResult struct { + autorest.Response `json:"-"` + // Value - Gets or sets a list of schedules. + Value *[]Schedule `json:"value,omitempty"` + // NextLink - Gets or sets the next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// ScheduleListResultIterator provides access to a complete listing of Schedule values. +type ScheduleListResultIterator struct { + i int + page ScheduleListResultPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ScheduleListResultIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ScheduleListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ScheduleListResultIterator) Response() ScheduleListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ScheduleListResultIterator) Value() Schedule { + if !iter.page.NotDone() { + return Schedule{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (slr ScheduleListResult) IsEmpty() bool { + return slr.Value == nil || len(*slr.Value) == 0 +} + +// scheduleListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (slr ScheduleListResult) scheduleListResultPreparer() (*http.Request, error) { + if slr.NextLink == nil || len(to.String(slr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(slr.NextLink))) +} + +// ScheduleListResultPage contains a page of Schedule values. +type ScheduleListResultPage struct { + fn func(ScheduleListResult) (ScheduleListResult, error) + slr ScheduleListResult +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ScheduleListResultPage) Next() error { + next, err := page.fn(page.slr) + if err != nil { + return err + } + page.slr = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ScheduleListResultPage) NotDone() bool { + return !page.slr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ScheduleListResultPage) Response() ScheduleListResult { + return page.slr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ScheduleListResultPage) Values() []Schedule { + if page.slr.IsEmpty() { + return nil + } + return *page.slr.Value +} + +// ScheduleProperties definition of schedule parameters. +type ScheduleProperties struct { + // StartTime - Gets or sets the start time of the schedule. + StartTime *date.Time `json:"startTime,omitempty"` + // StartTimeOffsetMinutes - Gets the start time's offset in minutes. + StartTimeOffsetMinutes *float64 `json:"startTimeOffsetMinutes,omitempty"` + // ExpiryTime - Gets or sets the end time of the schedule. + ExpiryTime *date.Time `json:"expiryTime,omitempty"` + // ExpiryTimeOffsetMinutes - Gets or sets the expiry time's offset in minutes. + ExpiryTimeOffsetMinutes *float64 `json:"expiryTimeOffsetMinutes,omitempty"` + // IsEnabled - Gets or sets a value indicating whether this schedule is enabled. + IsEnabled *bool `json:"isEnabled,omitempty"` + // NextRun - Gets or sets the next run time of the schedule. + NextRun *date.Time `json:"nextRun,omitempty"` + // NextRunOffsetMinutes - Gets or sets the next run time's offset in minutes. + NextRunOffsetMinutes *float64 `json:"nextRunOffsetMinutes,omitempty"` + // Interval - Gets or sets the interval of the schedule. + Interval *int32 `json:"interval,omitempty"` + // Frequency - Gets or sets the frequency of the schedule. Possible values include: 'OneTime', 'Day', 'Hour', 'Week', 'Month' + Frequency ScheduleFrequency `json:"frequency,omitempty"` + // TimeZone - Gets or sets the time zone of the schedule. + TimeZone *string `json:"timeZone,omitempty"` + // AdvancedSchedule - Gets or sets the advanced schedule. + AdvancedSchedule *AdvancedSchedule `json:"advancedSchedule,omitempty"` + // CreationTime - Gets or sets the creation time. + CreationTime *date.Time `json:"creationTime,omitempty"` + // LastModifiedTime - Gets or sets the last modified time. + LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` + // Description - Gets or sets the description. + Description *string `json:"description,omitempty"` +} + +// ScheduleUpdateParameters the parameters supplied to the update schedule operation. +type ScheduleUpdateParameters struct { + // Name - Gets or sets the name of the Schedule. + Name *string `json:"name,omitempty"` + // ScheduleUpdateProperties - Gets or sets the list of schedule properties. + *ScheduleUpdateProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for ScheduleUpdateParameters. +func (sup ScheduleUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sup.Name != nil { + objectMap["name"] = sup.Name + } + if sup.ScheduleUpdateProperties != nil { + objectMap["properties"] = sup.ScheduleUpdateProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ScheduleUpdateParameters struct. +func (sup *ScheduleUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + sup.Name = &name + } + case "properties": + if v != nil { + var scheduleUpdateProperties ScheduleUpdateProperties + err = json.Unmarshal(*v, &scheduleUpdateProperties) + if err != nil { + return err + } + sup.ScheduleUpdateProperties = &scheduleUpdateProperties + } + } + } + + return nil +} + +// ScheduleUpdateProperties the parameters supplied to the update schedule operation. +type ScheduleUpdateProperties struct { + // Description - Gets or sets the description of the schedule. + Description *string `json:"description,omitempty"` + // IsEnabled - Gets or sets a value indicating whether this schedule is enabled. + IsEnabled *bool `json:"isEnabled,omitempty"` +} + +// SetObject ... +type SetObject struct { + autorest.Response `json:"-"` + Value interface{} `json:"value,omitempty"` +} + +// Sku the account SKU. +type Sku struct { + // Name - Gets or sets the SKU name of the account. Possible values include: 'Free', 'Basic' + Name SkuNameEnum `json:"name,omitempty"` + // Family - Gets or sets the SKU family. + Family *string `json:"family,omitempty"` + // Capacity - Gets or sets the SKU capacity. + Capacity *int32 `json:"capacity,omitempty"` +} + +// SoftwareUpdateConfiguration software update configuration properties. +type SoftwareUpdateConfiguration struct { + autorest.Response `json:"-"` + // Name - Resource name. + Name *string `json:"name,omitempty"` + // ID - Resource Id. + ID *string `json:"id,omitempty"` + // Type - Resource type + Type *string `json:"type,omitempty"` + // SoftwareUpdateConfigurationProperties - Software update configuration properties. + *SoftwareUpdateConfigurationProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for SoftwareUpdateConfiguration. +func (suc SoftwareUpdateConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if suc.Name != nil { + objectMap["name"] = suc.Name + } + if suc.ID != nil { + objectMap["id"] = suc.ID + } + if suc.Type != nil { + objectMap["type"] = suc.Type + } + if suc.SoftwareUpdateConfigurationProperties != nil { + objectMap["properties"] = suc.SoftwareUpdateConfigurationProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SoftwareUpdateConfiguration struct. +func (suc *SoftwareUpdateConfiguration) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + suc.Name = &name + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + suc.ID = &ID + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + suc.Type = &typeVar + } + case "properties": + if v != nil { + var softwareUpdateConfigurationProperties SoftwareUpdateConfigurationProperties + err = json.Unmarshal(*v, &softwareUpdateConfigurationProperties) + if err != nil { + return err + } + suc.SoftwareUpdateConfigurationProperties = &softwareUpdateConfigurationProperties + } + } + } + + return nil +} + +// SoftwareUpdateConfigurationCollectionItem software update configuration collection item properties. +type SoftwareUpdateConfigurationCollectionItem struct { + // Name - Name of the software update configuration. + Name *string `json:"name,omitempty"` + // ID - Resource Id of the software update configuration + ID *string `json:"id,omitempty"` + // SoftwareUpdateConfigurationCollectionItemProperties - Software update configuration properties. + *SoftwareUpdateConfigurationCollectionItemProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for SoftwareUpdateConfigurationCollectionItem. +func (succi SoftwareUpdateConfigurationCollectionItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if succi.Name != nil { + objectMap["name"] = succi.Name + } + if succi.ID != nil { + objectMap["id"] = succi.ID + } + if succi.SoftwareUpdateConfigurationCollectionItemProperties != nil { + objectMap["properties"] = succi.SoftwareUpdateConfigurationCollectionItemProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SoftwareUpdateConfigurationCollectionItem struct. +func (succi *SoftwareUpdateConfigurationCollectionItem) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + succi.Name = &name + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + succi.ID = &ID + } + case "properties": + if v != nil { + var softwareUpdateConfigurationCollectionItemProperties SoftwareUpdateConfigurationCollectionItemProperties + err = json.Unmarshal(*v, &softwareUpdateConfigurationCollectionItemProperties) + if err != nil { + return err + } + succi.SoftwareUpdateConfigurationCollectionItemProperties = &softwareUpdateConfigurationCollectionItemProperties + } + } + } + + return nil +} + +// SoftwareUpdateConfigurationCollectionItemProperties software update configuration collection item properties. +type SoftwareUpdateConfigurationCollectionItemProperties struct { + // UpdateConfiguration - Update specific properties of the software update configuration. + UpdateConfiguration *CollectionItemUpdateConfiguration `json:"updateConfiguration,omitempty"` + // Frequency - execution frequency of the schedule associated with the software update configuration. Possible values include: 'OneTime', 'Day', 'Hour', 'Week', 'Month' + Frequency ScheduleFrequency `json:"frequency,omitempty"` + // StartTime - the start time of the update. + StartTime *date.Time `json:"startTime,omitempty"` + // CreationTime - Creation time of the software update configuration, which only appears in the response. + CreationTime *date.Time `json:"creationTime,omitempty"` + // LastModifiedTime - Last time software update configuration was modified, which only appears in the response. + LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` + // ProvisioningState - Provisioning state for the software update configuration, which only appears in the response. + ProvisioningState *string `json:"provisioningState,omitempty"` + // NextRun - ext run time of the update. + NextRun *date.Time `json:"nextRun,omitempty"` +} + +// SoftwareUpdateConfigurationListResult result of listing all software update configuration +type SoftwareUpdateConfigurationListResult struct { + autorest.Response `json:"-"` + // Value - outer object returned when listing all software update configurations + Value *[]SoftwareUpdateConfigurationCollectionItem `json:"value,omitempty"` +} + +// SoftwareUpdateConfigurationMachineRun software update configuration machine run model. +type SoftwareUpdateConfigurationMachineRun struct { + autorest.Response `json:"-"` + // Name - Name of the software update configuration machine run + Name *string `json:"name,omitempty"` + // ID - Resource Id of the software update configuration machine run + ID *string `json:"id,omitempty"` + // UpdateConfigurationMachineRunProperties - Software update configuration machine run properties. + *UpdateConfigurationMachineRunProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for SoftwareUpdateConfigurationMachineRun. +func (sucmr SoftwareUpdateConfigurationMachineRun) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sucmr.Name != nil { + objectMap["name"] = sucmr.Name + } + if sucmr.ID != nil { + objectMap["id"] = sucmr.ID + } + if sucmr.UpdateConfigurationMachineRunProperties != nil { + objectMap["properties"] = sucmr.UpdateConfigurationMachineRunProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SoftwareUpdateConfigurationMachineRun struct. +func (sucmr *SoftwareUpdateConfigurationMachineRun) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + sucmr.Name = &name + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + sucmr.ID = &ID + } + case "properties": + if v != nil { + var updateConfigurationMachineRunProperties UpdateConfigurationMachineRunProperties + err = json.Unmarshal(*v, &updateConfigurationMachineRunProperties) + if err != nil { + return err + } + sucmr.UpdateConfigurationMachineRunProperties = &updateConfigurationMachineRunProperties + } + } + } + + return nil +} + +// SoftwareUpdateConfigurationMachineRunListResult result of listing all software update configuration machine runs +type SoftwareUpdateConfigurationMachineRunListResult struct { + autorest.Response `json:"-"` + // Value - outer object returned when listing all software update configuration machine runs + Value *[]SoftwareUpdateConfigurationMachineRun `json:"value,omitempty"` + // NextLink - link to next page of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// SoftwareUpdateConfigurationProperties software update configuration properties. +type SoftwareUpdateConfigurationProperties struct { + // UpdateConfiguration - update specific properties for the Software update configuration + UpdateConfiguration *UpdateConfiguration `json:"updateConfiguration,omitempty"` + // ScheduleInfo - Schedule information for the Software update configuration + ScheduleInfo *ScheduleProperties `json:"scheduleInfo,omitempty"` + // ProvisioningState - Provisioning state for the software update configuration, which only appears in the response. + ProvisioningState *string `json:"provisioningState,omitempty"` + // Error - detailes of provisioning error + Error *ErrorResponse `json:"error,omitempty"` + // CreationTime - Creation time of theresource, which only appears in the response. + CreationTime *date.Time `json:"creationTime,omitempty"` + // CreatedBy - createdBy property, which only appears in the response. + CreatedBy *string `json:"createdBy,omitempty"` + // LastModifiedTime - Last time resource was modified, which only appears in the response. + LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` + // LastModifiedBy - lastModifiedBy property, which only appears in the response. + LastModifiedBy *string `json:"lastModifiedBy,omitempty"` +} + +// SoftwareUpdateConfigurationRun software update configuration Run properties. +type SoftwareUpdateConfigurationRun struct { + autorest.Response `json:"-"` + // Name - Name of the software update configuration run. + Name *string `json:"name,omitempty"` + // ID - Resource Id of the software update configuration run + ID *string `json:"id,omitempty"` + // SoftwareUpdateConfigurationRunProperties - Software update configuration Run properties. + *SoftwareUpdateConfigurationRunProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for SoftwareUpdateConfigurationRun. +func (sucr SoftwareUpdateConfigurationRun) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sucr.Name != nil { + objectMap["name"] = sucr.Name + } + if sucr.ID != nil { + objectMap["id"] = sucr.ID + } + if sucr.SoftwareUpdateConfigurationRunProperties != nil { + objectMap["properties"] = sucr.SoftwareUpdateConfigurationRunProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SoftwareUpdateConfigurationRun struct. +func (sucr *SoftwareUpdateConfigurationRun) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + sucr.Name = &name + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + sucr.ID = &ID + } + case "properties": + if v != nil { + var softwareUpdateConfigurationRunProperties SoftwareUpdateConfigurationRunProperties + err = json.Unmarshal(*v, &softwareUpdateConfigurationRunProperties) + if err != nil { + return err + } + sucr.SoftwareUpdateConfigurationRunProperties = &softwareUpdateConfigurationRunProperties + } + } + } + + return nil +} + +// SoftwareUpdateConfigurationRunListResult result of listing all software update configuration runs +type SoftwareUpdateConfigurationRunListResult struct { + autorest.Response `json:"-"` + // Value - outer object returned when listing all software update configuration runs + Value *[]SoftwareUpdateConfigurationRun `json:"value,omitempty"` + // NextLink - link to next page of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// SoftwareUpdateConfigurationRunProperties software update configuration properties. +type SoftwareUpdateConfigurationRunProperties struct { + // SoftwareUpdateConfiguration - software update configuration triggered this run + SoftwareUpdateConfiguration *UpdateConfigurationNavigation `json:"softwareUpdateConfiguration,omitempty"` + // Status - Status of the software update configuration run. + Status *string `json:"status,omitempty"` + // ConfiguredDuration - configured duration for the software update configuration run. + ConfiguredDuration *string `json:"configuredDuration,omitempty"` + // OsType - Operating system target of the software update configuration triggered this run + OsType *string `json:"osType,omitempty"` + // StartTime - Etart time of the software update configuration run. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - End time of the software update configuration run. + EndTime *date.Time `json:"endTime,omitempty"` + // ComputerCount - Number of computers in the software update configuration run. + ComputerCount *int32 `json:"computerCount,omitempty"` + // FailedCount - Number of computers with failed status. + FailedCount *int32 `json:"failedCount,omitempty"` + // CreationTime - Creation time of theresource, which only appears in the response. + CreationTime *date.Time `json:"creationTime,omitempty"` + // CreatedBy - createdBy property, which only appears in the response. + CreatedBy *string `json:"createdBy,omitempty"` + // LastModifiedTime - Last time resource was modified, which only appears in the response. + LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` + // LastModifiedBy - lastModifiedBy property, which only appears in the response. + LastModifiedBy *string `json:"lastModifiedBy,omitempty"` +} + +// SourceControl definition of the source control. +type SourceControl struct { + autorest.Response `json:"-"` + // SourceControlProperties - Gets or sets the properties of the source control. + *SourceControlProperties `json:"properties,omitempty"` + // ID - Fully qualified resource Id for the resource + ID *string `json:"id,omitempty"` + // Name - The name of the resource + Name *string `json:"name,omitempty"` + // Type - The type of the resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for SourceControl. +func (sc SourceControl) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sc.SourceControlProperties != nil { + objectMap["properties"] = sc.SourceControlProperties + } + if sc.ID != nil { + objectMap["id"] = sc.ID + } + if sc.Name != nil { + objectMap["name"] = sc.Name + } + if sc.Type != nil { + objectMap["type"] = sc.Type + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SourceControl struct. +func (sc *SourceControl) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var sourceControlProperties SourceControlProperties + err = json.Unmarshal(*v, &sourceControlProperties) + if err != nil { + return err + } + sc.SourceControlProperties = &sourceControlProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + sc.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + sc.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + sc.Type = &typeVar + } + } + } + + return nil +} + +// SourceControlCreateOrUpdateParameters the parameters supplied to the create or update source control operation. +type SourceControlCreateOrUpdateParameters struct { + // SourceControlCreateOrUpdateProperties - Gets or sets the properties of the source control. + *SourceControlCreateOrUpdateProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for SourceControlCreateOrUpdateParameters. +func (sccoup SourceControlCreateOrUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sccoup.SourceControlCreateOrUpdateProperties != nil { + objectMap["properties"] = sccoup.SourceControlCreateOrUpdateProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SourceControlCreateOrUpdateParameters struct. +func (sccoup *SourceControlCreateOrUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var sourceControlCreateOrUpdateProperties SourceControlCreateOrUpdateProperties + err = json.Unmarshal(*v, &sourceControlCreateOrUpdateProperties) + if err != nil { + return err + } + sccoup.SourceControlCreateOrUpdateProperties = &sourceControlCreateOrUpdateProperties + } + } + } + + return nil +} + +// SourceControlCreateOrUpdateProperties the properties of the create source control operation. +type SourceControlCreateOrUpdateProperties struct { + // RepoURL - Gets or sets the repo url of the source control. + RepoURL *string `json:"repoUrl,omitempty"` + // Branch - Gets or sets the repo branch of the source control. Include branch as empty string for VsoTfvc. + Branch *string `json:"branch,omitempty"` + // FolderPath - Gets or sets the folder path of the source control. Path must be relative. + FolderPath *string `json:"folderPath,omitempty"` + // AutoSync - Gets or sets auto async of the source control. Default is false. + AutoSync *bool `json:"autoSync,omitempty"` + // PublishRunbook - Gets or sets the auto publish of the source control. Default is true. + PublishRunbook *bool `json:"publishRunbook,omitempty"` + // SourceType - The source type. Must be one of VsoGit, VsoTfvc, GitHub, case sensitive. Possible values include: 'VsoGit', 'VsoTfvc', 'GitHub' + SourceType SourceType `json:"sourceType,omitempty"` + // SecurityToken - Gets or sets the authorization token for the repo of the source control. + SecurityToken *string `json:"securityToken,omitempty"` + // Description - Gets or sets the user description of the source control. + Description *string `json:"description,omitempty"` +} + +// SourceControlListResult the response model for the list source controls operation. +type SourceControlListResult struct { + autorest.Response `json:"-"` + // Value - Gets or sets a list of souce controls. + Value *[]SourceControl `json:"value,omitempty"` + // NextLink - Gets or sets the next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// SourceControlListResultIterator provides access to a complete listing of SourceControl values. +type SourceControlListResultIterator struct { + i int + page SourceControlListResultPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *SourceControlListResultIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter SourceControlListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter SourceControlListResultIterator) Response() SourceControlListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter SourceControlListResultIterator) Value() SourceControl { + if !iter.page.NotDone() { + return SourceControl{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (sclr SourceControlListResult) IsEmpty() bool { + return sclr.Value == nil || len(*sclr.Value) == 0 +} + +// sourceControlListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (sclr SourceControlListResult) sourceControlListResultPreparer() (*http.Request, error) { + if sclr.NextLink == nil || len(to.String(sclr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(sclr.NextLink))) +} + +// SourceControlListResultPage contains a page of SourceControl values. +type SourceControlListResultPage struct { + fn func(SourceControlListResult) (SourceControlListResult, error) + sclr SourceControlListResult +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *SourceControlListResultPage) Next() error { + next, err := page.fn(page.sclr) + if err != nil { + return err + } + page.sclr = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page SourceControlListResultPage) NotDone() bool { + return !page.sclr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page SourceControlListResultPage) Response() SourceControlListResult { + return page.sclr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page SourceControlListResultPage) Values() []SourceControl { + if page.sclr.IsEmpty() { + return nil + } + return *page.sclr.Value +} + +// SourceControlProperties definition of the source control properties +type SourceControlProperties struct { + // RepoURL - Gets or sets the repo url of the source control. + RepoURL *string `json:"repoUrl,omitempty"` + // Branch - Gets or sets the repo branch of the source control. Include branch as empty string for VsoTfvc. + Branch *string `json:"branch,omitempty"` + // FolderPath - Gets or sets the folder path of the source control. + FolderPath *string `json:"folderPath,omitempty"` + // AutoSync - Gets or sets auto async of the source control. Default is false. + AutoSync *bool `json:"autoSync,omitempty"` + // PublishRunbook - Gets or sets the auto publish of the source control. Default is true. + PublishRunbook *bool `json:"publishRunbook,omitempty"` + // SourceType - The source type. Must be one of VsoGit, VsoTfvc, GitHub. Possible values include: 'VsoGit', 'VsoTfvc', 'GitHub' + SourceType SourceType `json:"sourceType,omitempty"` + // Description - Gets or sets the description. + Description *string `json:"description,omitempty"` + // CreationTime - Gets or sets the creation time. + CreationTime *date.Time `json:"creationTime,omitempty"` + // LastModifiedTime - Gets or sets the last modified time. + LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` +} + +// SourceControlSyncJob definition of the source control sync job. +type SourceControlSyncJob struct { + autorest.Response `json:"-"` + // Name - Resource name. + Name *string `json:"name,omitempty"` + // Type - Resource type. + Type *string `json:"type,omitempty"` + // ID - Resource id. + ID *string `json:"id,omitempty"` + // SourceControlSyncJobProperties - Gets the properties of the source control sync job. + *SourceControlSyncJobProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for SourceControlSyncJob. +func (scsj SourceControlSyncJob) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if scsj.Name != nil { + objectMap["name"] = scsj.Name + } + if scsj.Type != nil { + objectMap["type"] = scsj.Type + } + if scsj.ID != nil { + objectMap["id"] = scsj.ID + } + if scsj.SourceControlSyncJobProperties != nil { + objectMap["properties"] = scsj.SourceControlSyncJobProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SourceControlSyncJob struct. +func (scsj *SourceControlSyncJob) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + scsj.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + scsj.Type = &typeVar + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + scsj.ID = &ID + } + case "properties": + if v != nil { + var sourceControlSyncJobProperties SourceControlSyncJobProperties + err = json.Unmarshal(*v, &sourceControlSyncJobProperties) + if err != nil { + return err + } + scsj.SourceControlSyncJobProperties = &sourceControlSyncJobProperties + } + } + } + + return nil +} + +// SourceControlSyncJobByID definition of the source control sync job. +type SourceControlSyncJobByID struct { + autorest.Response `json:"-"` + // ID - Gets the id of the job. + ID *string `json:"id,omitempty"` + // SourceControlSyncJobByIDProperties - Gets the properties of the source control sync job. + *SourceControlSyncJobByIDProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for SourceControlSyncJobByID. +func (scsjbi SourceControlSyncJobByID) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if scsjbi.ID != nil { + objectMap["id"] = scsjbi.ID + } + if scsjbi.SourceControlSyncJobByIDProperties != nil { + objectMap["properties"] = scsjbi.SourceControlSyncJobByIDProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SourceControlSyncJobByID struct. +func (scsjbi *SourceControlSyncJobByID) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + scsjbi.ID = &ID + } + case "properties": + if v != nil { + var sourceControlSyncJobByIDProperties SourceControlSyncJobByIDProperties + err = json.Unmarshal(*v, &sourceControlSyncJobByIDProperties) + if err != nil { + return err + } + scsjbi.SourceControlSyncJobByIDProperties = &sourceControlSyncJobByIDProperties + } + } + } + + return nil +} + +// SourceControlSyncJobByIDProperties definition of source control sync job properties. +type SourceControlSyncJobByIDProperties struct { + // SyncJobID - Gets the source control sync job id. + SyncJobID *string `json:"syncJobId,omitempty"` + // CreationTime - Gets the creation time of the job. + CreationTime *date.Time `json:"creationTime,omitempty"` + // ProvisioningState - Gets the provisioning state of the job. Possible values include: 'Completed', 'Failed', 'Running' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // StartTime - Gets the start time of the job. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - Gets the end time of the job. + EndTime *date.Time `json:"endTime,omitempty"` + // StartType - Gets the type of start for the sync job. Possible values include: 'AutoSync', 'ManualSync' + StartType StartType `json:"startType,omitempty"` + // Exception - Gets the exceptions that occured while running the sync job. + Exception *string `json:"exception,omitempty"` +} + +// SourceControlSyncJobCreateParameters the parameters supplied to the create source control sync job operation. +type SourceControlSyncJobCreateParameters struct { + // SourceControlSyncJobCreateProperties - Sets the properties of the source control sync job. + *SourceControlSyncJobCreateProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for SourceControlSyncJobCreateParameters. +func (scsjcp SourceControlSyncJobCreateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if scsjcp.SourceControlSyncJobCreateProperties != nil { + objectMap["properties"] = scsjcp.SourceControlSyncJobCreateProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SourceControlSyncJobCreateParameters struct. +func (scsjcp *SourceControlSyncJobCreateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var sourceControlSyncJobCreateProperties SourceControlSyncJobCreateProperties + err = json.Unmarshal(*v, &sourceControlSyncJobCreateProperties) + if err != nil { + return err + } + scsjcp.SourceControlSyncJobCreateProperties = &sourceControlSyncJobCreateProperties + } + } + } + + return nil +} + +// SourceControlSyncJobCreateProperties definition of create source control sync job properties. +type SourceControlSyncJobCreateProperties struct { + // CommitID - Sets the commit id of the source control sync job. + CommitID *string `json:"commitId,omitempty"` +} + +// SourceControlSyncJobListResult the response model for the list source control sync jobs operation. +type SourceControlSyncJobListResult struct { + autorest.Response `json:"-"` + // Value - Gets a list of source control sync jobs. + Value *[]SourceControlSyncJob `json:"value,omitempty"` + // NextLink - Gets or sets the next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// SourceControlSyncJobListResultIterator provides access to a complete listing of SourceControlSyncJob values. +type SourceControlSyncJobListResultIterator struct { + i int + page SourceControlSyncJobListResultPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *SourceControlSyncJobListResultIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter SourceControlSyncJobListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter SourceControlSyncJobListResultIterator) Response() SourceControlSyncJobListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter SourceControlSyncJobListResultIterator) Value() SourceControlSyncJob { + if !iter.page.NotDone() { + return SourceControlSyncJob{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (scsjlr SourceControlSyncJobListResult) IsEmpty() bool { + return scsjlr.Value == nil || len(*scsjlr.Value) == 0 +} + +// sourceControlSyncJobListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (scsjlr SourceControlSyncJobListResult) sourceControlSyncJobListResultPreparer() (*http.Request, error) { + if scsjlr.NextLink == nil || len(to.String(scsjlr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(scsjlr.NextLink))) +} + +// SourceControlSyncJobListResultPage contains a page of SourceControlSyncJob values. +type SourceControlSyncJobListResultPage struct { + fn func(SourceControlSyncJobListResult) (SourceControlSyncJobListResult, error) + scsjlr SourceControlSyncJobListResult +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *SourceControlSyncJobListResultPage) Next() error { + next, err := page.fn(page.scsjlr) + if err != nil { + return err + } + page.scsjlr = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page SourceControlSyncJobListResultPage) NotDone() bool { + return !page.scsjlr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page SourceControlSyncJobListResultPage) Response() SourceControlSyncJobListResult { + return page.scsjlr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page SourceControlSyncJobListResultPage) Values() []SourceControlSyncJob { + if page.scsjlr.IsEmpty() { + return nil + } + return *page.scsjlr.Value +} + +// SourceControlSyncJobProperties definition of source control sync job properties. +type SourceControlSyncJobProperties struct { + // SyncJobID - Gets the source control sync job id. + SyncJobID *string `json:"syncJobId,omitempty"` + // CreationTime - Gets the creation time of the job. + CreationTime *date.Time `json:"creationTime,omitempty"` + // ProvisioningState - Gets the provisioning state of the job. Possible values include: 'Completed', 'Failed', 'Running' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // StartTime - Gets the start time of the job. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - Gets the end time of the job. + EndTime *date.Time `json:"endTime,omitempty"` + // StartType - Gets the type of start for the sync job. Possible values include: 'AutoSync', 'ManualSync' + StartType StartType `json:"startType,omitempty"` +} + +// SourceControlSyncJobStream definition of the source control sync job stream. +type SourceControlSyncJobStream struct { + // ID - Resource id. + ID *string `json:"id,omitempty"` + // SourceControlSyncJobStreamProperties - Gets the properties of the source control sync job stream. + *SourceControlSyncJobStreamProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for SourceControlSyncJobStream. +func (scsjs SourceControlSyncJobStream) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if scsjs.ID != nil { + objectMap["id"] = scsjs.ID + } + if scsjs.SourceControlSyncJobStreamProperties != nil { + objectMap["properties"] = scsjs.SourceControlSyncJobStreamProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SourceControlSyncJobStream struct. +func (scsjs *SourceControlSyncJobStream) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + scsjs.ID = &ID + } + case "properties": + if v != nil { + var sourceControlSyncJobStreamProperties SourceControlSyncJobStreamProperties + err = json.Unmarshal(*v, &sourceControlSyncJobStreamProperties) + if err != nil { + return err + } + scsjs.SourceControlSyncJobStreamProperties = &sourceControlSyncJobStreamProperties + } + } + } + + return nil +} + +// SourceControlSyncJobStreamByID definition of the source control sync job stream by id. +type SourceControlSyncJobStreamByID struct { + autorest.Response `json:"-"` + // ID - Resource id. + ID *string `json:"id,omitempty"` + // SourceControlSyncJobStreamByIDProperties - Gets the properties of the source control sync job stream. + *SourceControlSyncJobStreamByIDProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for SourceControlSyncJobStreamByID. +func (scsjsbi SourceControlSyncJobStreamByID) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if scsjsbi.ID != nil { + objectMap["id"] = scsjsbi.ID + } + if scsjsbi.SourceControlSyncJobStreamByIDProperties != nil { + objectMap["properties"] = scsjsbi.SourceControlSyncJobStreamByIDProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SourceControlSyncJobStreamByID struct. +func (scsjsbi *SourceControlSyncJobStreamByID) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + scsjsbi.ID = &ID + } + case "properties": + if v != nil { + var sourceControlSyncJobStreamByIDProperties SourceControlSyncJobStreamByIDProperties + err = json.Unmarshal(*v, &sourceControlSyncJobStreamByIDProperties) + if err != nil { + return err + } + scsjsbi.SourceControlSyncJobStreamByIDProperties = &sourceControlSyncJobStreamByIDProperties + } + } + } + + return nil +} + +// SourceControlSyncJobStreamByIDProperties definition of source control sync job stream by id properties. +type SourceControlSyncJobStreamByIDProperties struct { + // SyncJobStreamID - Gets the sync job stream id. + SyncJobStreamID *string `json:"syncJobStreamId,omitempty"` + // Summary - Gets the summary of the sync job stream. + Summary *string `json:"summary,omitempty"` + // Time - Gets the time of the sync job stream. + Time *date.Time `json:"time,omitempty"` + // StreamType - Gets the type of the sync job stream. Possible values include: 'StreamTypeError', 'StreamTypeOutput' + StreamType StreamType `json:"streamType,omitempty"` + // StreamText - Gets the text of the sync job stream. + StreamText *string `json:"streamText,omitempty"` + // Value - Gets the value of the sync job stream. + Value *string `json:"value,omitempty"` +} + +// SourceControlSyncJobStreamProperties definition of source control sync job stream properties. +type SourceControlSyncJobStreamProperties struct { + // SyncJobStreamID - Gets the sync job stream id. + SyncJobStreamID *string `json:"syncJobStreamId,omitempty"` + // Summary - Gets the summary of the sync job stream. + Summary *string `json:"summary,omitempty"` + // Time - Gets the time of the sync job stream. + Time *date.Time `json:"time,omitempty"` + // StreamType - Gets the type of the sync job stream. Possible values include: 'StreamTypeError', 'StreamTypeOutput' + StreamType StreamType `json:"streamType,omitempty"` +} + +// SourceControlSyncJobStreamsListBySyncJob the response model for the list source control sync job streams +// operation. +type SourceControlSyncJobStreamsListBySyncJob struct { + autorest.Response `json:"-"` + // Value - Gets a list of source control sync job streams. + Value *[]SourceControlSyncJobStream `json:"value,omitempty"` + // NextLink - Gets or sets the next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// SourceControlSyncJobStreamsListBySyncJobIterator provides access to a complete listing of +// SourceControlSyncJobStream values. +type SourceControlSyncJobStreamsListBySyncJobIterator struct { + i int + page SourceControlSyncJobStreamsListBySyncJobPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *SourceControlSyncJobStreamsListBySyncJobIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter SourceControlSyncJobStreamsListBySyncJobIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter SourceControlSyncJobStreamsListBySyncJobIterator) Response() SourceControlSyncJobStreamsListBySyncJob { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter SourceControlSyncJobStreamsListBySyncJobIterator) Value() SourceControlSyncJobStream { + if !iter.page.NotDone() { + return SourceControlSyncJobStream{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (scsjslbsj SourceControlSyncJobStreamsListBySyncJob) IsEmpty() bool { + return scsjslbsj.Value == nil || len(*scsjslbsj.Value) == 0 +} + +// sourceControlSyncJobStreamsListBySyncJobPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (scsjslbsj SourceControlSyncJobStreamsListBySyncJob) sourceControlSyncJobStreamsListBySyncJobPreparer() (*http.Request, error) { + if scsjslbsj.NextLink == nil || len(to.String(scsjslbsj.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(scsjslbsj.NextLink))) +} + +// SourceControlSyncJobStreamsListBySyncJobPage contains a page of SourceControlSyncJobStream values. +type SourceControlSyncJobStreamsListBySyncJobPage struct { + fn func(SourceControlSyncJobStreamsListBySyncJob) (SourceControlSyncJobStreamsListBySyncJob, error) + scsjslbsj SourceControlSyncJobStreamsListBySyncJob +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *SourceControlSyncJobStreamsListBySyncJobPage) Next() error { + next, err := page.fn(page.scsjslbsj) + if err != nil { + return err + } + page.scsjslbsj = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page SourceControlSyncJobStreamsListBySyncJobPage) NotDone() bool { + return !page.scsjslbsj.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page SourceControlSyncJobStreamsListBySyncJobPage) Response() SourceControlSyncJobStreamsListBySyncJob { + return page.scsjslbsj +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page SourceControlSyncJobStreamsListBySyncJobPage) Values() []SourceControlSyncJobStream { + if page.scsjslbsj.IsEmpty() { + return nil + } + return *page.scsjslbsj.Value +} + +// SourceControlUpdateParameters the parameters supplied to the update source control operation. +type SourceControlUpdateParameters struct { + // SourceControlUpdateProperties - Gets or sets the value of the source control. + *SourceControlUpdateProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for SourceControlUpdateParameters. +func (scup SourceControlUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if scup.SourceControlUpdateProperties != nil { + objectMap["properties"] = scup.SourceControlUpdateProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SourceControlUpdateParameters struct. +func (scup *SourceControlUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var sourceControlUpdateProperties SourceControlUpdateProperties + err = json.Unmarshal(*v, &sourceControlUpdateProperties) + if err != nil { + return err + } + scup.SourceControlUpdateProperties = &sourceControlUpdateProperties + } + } + } + + return nil +} + +// SourceControlUpdateProperties the properties of the update source control +type SourceControlUpdateProperties struct { + // Branch - Gets or sets the repo branch of the source control. + Branch *string `json:"branch,omitempty"` + // FolderPath - Gets or sets the folder path of the source control. Path must be relative. + FolderPath *string `json:"folderPath,omitempty"` + // AutoSync - Gets or sets auto async of the source control. Default is false. + AutoSync *bool `json:"autoSync,omitempty"` + // PublishRunbook - Gets or sets the auto publish of the source control. Default is true. + PublishRunbook *bool `json:"publishRunbook,omitempty"` + // SecurityToken - Gets or sets the authorization token for the repo of the source control. + SecurityToken *string `json:"securityToken,omitempty"` + // Description - Gets or sets the user description of the source control. + Description *string `json:"description,omitempty"` +} + +// Statistics definition of the statistic. +type Statistics struct { + // CounterProperty - Gets the property value of the statistic. + CounterProperty *string `json:"counterProperty,omitempty"` + // CounterValue - Gets the value of the statistic. + CounterValue *int64 `json:"counterValue,omitempty"` + // StartTime - Gets the startTime of the statistic. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - Gets the endTime of the statistic. + EndTime *date.Time `json:"endTime,omitempty"` + // ID - Gets the id. + ID *string `json:"id,omitempty"` +} + +// StatisticsListResult the response model for the list statistics operation. +type StatisticsListResult struct { + autorest.Response `json:"-"` + // Value - Gets or sets a list of statistics. + Value *[]Statistics `json:"value,omitempty"` +} + +// String ... +type String struct { + autorest.Response `json:"-"` + Value *string `json:"value,omitempty"` +} + +// TestJob definition of the test job. +type TestJob struct { + autorest.Response `json:"-"` + // CreationTime - Gets or sets the creation time of the test job. + CreationTime *date.Time `json:"creationTime,omitempty"` + // Status - Gets or sets the status of the test job. + Status *string `json:"status,omitempty"` + // StatusDetails - Gets or sets the status details of the test job. + StatusDetails *string `json:"statusDetails,omitempty"` + // RunOn - Gets or sets the runOn which specifies the group name where the job is to be executed. + RunOn *string `json:"runOn,omitempty"` + // StartTime - Gets or sets the start time of the test job. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - Gets or sets the end time of the test job. + EndTime *date.Time `json:"endTime,omitempty"` + // Exception - Gets or sets the exception of the test job. + Exception *string `json:"exception,omitempty"` + // LastModifiedTime - Gets or sets the last modified time of the test job. + LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` + // LastStatusModifiedTime - Gets or sets the last status modified time of the test job. + LastStatusModifiedTime *date.Time `json:"lastStatusModifiedTime,omitempty"` + // Parameters - Gets or sets the parameters of the test job. + Parameters map[string]*string `json:"parameters"` + // LogActivityTrace - The activity-level tracing options of the runbook. + LogActivityTrace *int32 `json:"logActivityTrace,omitempty"` +} + +// MarshalJSON is the custom marshaler for TestJob. +func (tj TestJob) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if tj.CreationTime != nil { + objectMap["creationTime"] = tj.CreationTime + } + if tj.Status != nil { + objectMap["status"] = tj.Status + } + if tj.StatusDetails != nil { + objectMap["statusDetails"] = tj.StatusDetails + } + if tj.RunOn != nil { + objectMap["runOn"] = tj.RunOn + } + if tj.StartTime != nil { + objectMap["startTime"] = tj.StartTime + } + if tj.EndTime != nil { + objectMap["endTime"] = tj.EndTime + } + if tj.Exception != nil { + objectMap["exception"] = tj.Exception + } + if tj.LastModifiedTime != nil { + objectMap["lastModifiedTime"] = tj.LastModifiedTime + } + if tj.LastStatusModifiedTime != nil { + objectMap["lastStatusModifiedTime"] = tj.LastStatusModifiedTime + } + if tj.Parameters != nil { + objectMap["parameters"] = tj.Parameters + } + if tj.LogActivityTrace != nil { + objectMap["logActivityTrace"] = tj.LogActivityTrace + } + return json.Marshal(objectMap) +} + +// TestJobCreateParameters the parameters supplied to the create test job operation. +type TestJobCreateParameters struct { + // Parameters - Gets or sets the parameters of the test job. + Parameters map[string]*string `json:"parameters"` + // RunOn - Gets or sets the runOn which specifies the group name where the job is to be executed. + RunOn *string `json:"runOn,omitempty"` +} + +// MarshalJSON is the custom marshaler for TestJobCreateParameters. +func (tjcp TestJobCreateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if tjcp.Parameters != nil { + objectMap["parameters"] = tjcp.Parameters + } + if tjcp.RunOn != nil { + objectMap["runOn"] = tjcp.RunOn + } + return json.Marshal(objectMap) +} + +// TrackedResource the resource model definition for a ARM tracked top level resource +type TrackedResource struct { + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // Location - The Azure Region where the resource lives + Location *string `json:"location,omitempty"` + // ID - Fully qualified resource Id for the resource + ID *string `json:"id,omitempty"` + // Name - The name of the resource + Name *string `json:"name,omitempty"` + // Type - The type of the resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for TrackedResource. +func (tr TrackedResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if tr.Tags != nil { + objectMap["tags"] = tr.Tags + } + if tr.Location != nil { + objectMap["location"] = tr.Location + } + if tr.ID != nil { + objectMap["id"] = tr.ID + } + if tr.Name != nil { + objectMap["name"] = tr.Name + } + if tr.Type != nil { + objectMap["type"] = tr.Type + } + return json.Marshal(objectMap) +} + +// TypeField information about a field of a type. +type TypeField struct { + // Name - Gets or sets the name of the field. + Name *string `json:"name,omitempty"` + // Type - Gets or sets the type of the field. + Type *string `json:"type,omitempty"` +} + +// TypeFieldListResult the response model for the list fields operation. +type TypeFieldListResult struct { + autorest.Response `json:"-"` + // Value - Gets or sets a list of fields. + Value *[]TypeField `json:"value,omitempty"` +} + +// UpdateConfiguration update specifc properties of the software update configuration. +type UpdateConfiguration struct { + // OperatingSystem - operating system of target machines. Possible values include: 'Windows', 'Linux' + OperatingSystem OperatingSystemType `json:"operatingSystem,omitempty"` + // Windows - Windows specific update configuration. + Windows *WindowsProperties `json:"windows,omitempty"` + // Linux - Linux specific update configuration. + Linux *LinuxProperties `json:"linux,omitempty"` + // Duration - Maximum time allowed for the software update configuration run. Duration needs to be specified using the format PT[n]H[n]M[n]S as per ISO8601 + Duration *string `json:"duration,omitempty"` + // AzureVirtualMachines - List of azure resource Ids for azure virtual machines targeted by the software update configuration. + AzureVirtualMachines *[]string `json:"azureVirtualMachines,omitempty"` + // NonAzureComputerNames - List of names of non-azure machines targeted by the software update configuration. + NonAzureComputerNames *[]string `json:"nonAzureComputerNames,omitempty"` +} + +// UpdateConfigurationMachineRunProperties software update configuration machine run properties. +type UpdateConfigurationMachineRunProperties struct { + // TargetComputer - name of the updated computer + TargetComputer *string `json:"targetComputer,omitempty"` + // TargetComputerType - type of the updated computer. + TargetComputerType *string `json:"targetComputerType,omitempty"` + // SoftwareUpdateConfiguration - software update configuration triggered this run + SoftwareUpdateConfiguration *UpdateConfigurationNavigation `json:"softwareUpdateConfiguration,omitempty"` + // Status - Status of the software update configuration machine run. + Status *string `json:"status,omitempty"` + // OsType - Operating system target of the software update configuration triggered this run + OsType *string `json:"osType,omitempty"` + // CorrelationID - correlation id of the software update configuration machine run + CorrelationID *uuid.UUID `json:"correlationId,omitempty"` + // SourceComputerID - source computer id of the software update configuration machine run + SourceComputerID *uuid.UUID `json:"sourceComputerId,omitempty"` + // StartTime - Start time of the software update configuration machine run. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - End time of the software update configuration machine run. + EndTime *date.Time `json:"endTime,omitempty"` + // ConfiguredDuration - configured duration for the software update configuration run. + ConfiguredDuration *string `json:"configuredDuration,omitempty"` + // Job - Job associated with the software update configuration machine run + Job *JobNavigation `json:"job,omitempty"` + // CreationTime - Creation time of theresource, which only appears in the response. + CreationTime *date.Time `json:"creationTime,omitempty"` + // CreatedBy - createdBy property, which only appears in the response. + CreatedBy *string `json:"createdBy,omitempty"` + // LastModifiedTime - Last time resource was modified, which only appears in the response. + LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` + // LastModifiedBy - lastModifiedBy property, which only appears in the response. + LastModifiedBy *string `json:"lastModifiedBy,omitempty"` +} + +// UpdateConfigurationNavigation software update configuration Run Navigation model. +type UpdateConfigurationNavigation struct { + // Name - Name of the software update configuration triggered the software update configuration run + Name *string `json:"name,omitempty"` +} + +// Usage definition of Usage. +type Usage struct { + // ID - Gets or sets the id of the resource. + ID *string `json:"id,omitempty"` + // Name - Gets or sets the usage counter name. + Name *UsageCounterName `json:"name,omitempty"` + // Unit - Gets or sets the usage unit name. + Unit *string `json:"unit,omitempty"` + // CurrentValue - Gets or sets the current usage value. + CurrentValue *float64 `json:"currentValue,omitempty"` + // Limit - Gets or sets max limit. -1 for unlimited + Limit *int64 `json:"limit,omitempty"` + // ThrottleStatus - Gets or sets the throttle status. + ThrottleStatus *string `json:"throttleStatus,omitempty"` +} + +// UsageCounterName definition of usage counter name. +type UsageCounterName struct { + // Value - Gets or sets the usage counter name. + Value *string `json:"value,omitempty"` + // LocalizedValue - Gets or sets the localized usage counter name. + LocalizedValue *string `json:"localizedValue,omitempty"` +} + +// UsageListResult the response model for the get usage operation. +type UsageListResult struct { + autorest.Response `json:"-"` + // Value - Gets or sets usage. + Value *[]Usage `json:"value,omitempty"` +} + +// Variable definition of the varible. +type Variable struct { + autorest.Response `json:"-"` + // VariableProperties - Gets or sets the properties of the variable. + *VariableProperties `json:"properties,omitempty"` + // ID - Fully qualified resource Id for the resource + ID *string `json:"id,omitempty"` + // Name - The name of the resource + Name *string `json:"name,omitempty"` + // Type - The type of the resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Variable. +func (vVar Variable) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vVar.VariableProperties != nil { + objectMap["properties"] = vVar.VariableProperties + } + if vVar.ID != nil { + objectMap["id"] = vVar.ID + } + if vVar.Name != nil { + objectMap["name"] = vVar.Name + } + if vVar.Type != nil { + objectMap["type"] = vVar.Type + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Variable struct. +func (vVar *Variable) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var variableProperties VariableProperties + err = json.Unmarshal(*v, &variableProperties) + if err != nil { + return err + } + vVar.VariableProperties = &variableProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + vVar.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + vVar.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + vVar.Type = &typeVar + } + } + } + + return nil +} + +// VariableCreateOrUpdateParameters the parameters supplied to the create or update variable operation. +type VariableCreateOrUpdateParameters struct { + // Name - Gets or sets the name of the variable. + Name *string `json:"name,omitempty"` + // VariableCreateOrUpdateProperties - Gets or sets the properties of the variable. + *VariableCreateOrUpdateProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for VariableCreateOrUpdateParameters. +func (vcoup VariableCreateOrUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vcoup.Name != nil { + objectMap["name"] = vcoup.Name + } + if vcoup.VariableCreateOrUpdateProperties != nil { + objectMap["properties"] = vcoup.VariableCreateOrUpdateProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for VariableCreateOrUpdateParameters struct. +func (vcoup *VariableCreateOrUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + vcoup.Name = &name + } + case "properties": + if v != nil { + var variableCreateOrUpdateProperties VariableCreateOrUpdateProperties + err = json.Unmarshal(*v, &variableCreateOrUpdateProperties) + if err != nil { + return err + } + vcoup.VariableCreateOrUpdateProperties = &variableCreateOrUpdateProperties + } + } + } + + return nil +} + +// VariableCreateOrUpdateProperties the properties of the create variable operation. +type VariableCreateOrUpdateProperties struct { + // Value - Gets or sets the value of the variable. + Value *string `json:"value,omitempty"` + // Description - Gets or sets the description of the variable. + Description *string `json:"description,omitempty"` + // IsEncrypted - Gets or sets the encrypted flag of the variable. + IsEncrypted *bool `json:"isEncrypted,omitempty"` +} + +// VariableListResult the response model for the list variables operation. +type VariableListResult struct { + autorest.Response `json:"-"` + // Value - Gets or sets a list of variables. + Value *[]Variable `json:"value,omitempty"` + // NextLink - Gets or sets the next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// VariableListResultIterator provides access to a complete listing of Variable values. +type VariableListResultIterator struct { + i int + page VariableListResultPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *VariableListResultIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter VariableListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter VariableListResultIterator) Response() VariableListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter VariableListResultIterator) Value() Variable { + if !iter.page.NotDone() { + return Variable{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (vlr VariableListResult) IsEmpty() bool { + return vlr.Value == nil || len(*vlr.Value) == 0 +} + +// variableListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (vlr VariableListResult) variableListResultPreparer() (*http.Request, error) { + if vlr.NextLink == nil || len(to.String(vlr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(vlr.NextLink))) +} + +// VariableListResultPage contains a page of Variable values. +type VariableListResultPage struct { + fn func(VariableListResult) (VariableListResult, error) + vlr VariableListResult +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *VariableListResultPage) Next() error { + next, err := page.fn(page.vlr) + if err != nil { + return err + } + page.vlr = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page VariableListResultPage) NotDone() bool { + return !page.vlr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page VariableListResultPage) Response() VariableListResult { + return page.vlr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page VariableListResultPage) Values() []Variable { + if page.vlr.IsEmpty() { + return nil + } + return *page.vlr.Value +} + +// VariableProperties definition of the varible properties +type VariableProperties struct { + // Value - Gets or sets the value of the variable. + Value *string `json:"value,omitempty"` + // IsEncrypted - Gets or sets the encrypted flag of the variable. + IsEncrypted *bool `json:"isEncrypted,omitempty"` + // CreationTime - Gets or sets the creation time. + CreationTime *date.Time `json:"creationTime,omitempty"` + // LastModifiedTime - Gets or sets the last modified time. + LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` + // Description - Gets or sets the description. + Description *string `json:"description,omitempty"` +} + +// VariableUpdateParameters the parameters supplied to the update variable operation. +type VariableUpdateParameters struct { + // Name - Gets or sets the name of the variable. + Name *string `json:"name,omitempty"` + // VariableUpdateProperties - Gets or sets the value of the variable. + *VariableUpdateProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for VariableUpdateParameters. +func (vup VariableUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vup.Name != nil { + objectMap["name"] = vup.Name + } + if vup.VariableUpdateProperties != nil { + objectMap["properties"] = vup.VariableUpdateProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for VariableUpdateParameters struct. +func (vup *VariableUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + vup.Name = &name + } + case "properties": + if v != nil { + var variableUpdateProperties VariableUpdateProperties + err = json.Unmarshal(*v, &variableUpdateProperties) + if err != nil { + return err + } + vup.VariableUpdateProperties = &variableUpdateProperties + } + } + } + + return nil +} + +// VariableUpdateProperties the properties of the update variable +type VariableUpdateProperties struct { + // Value - Gets or sets the value of the variable. + Value *string `json:"value,omitempty"` + // Description - Gets or sets the description of the variable. + Description *string `json:"description,omitempty"` +} + +// Webhook definition of the webhook type. +type Webhook struct { + autorest.Response `json:"-"` + // WebhookProperties - Gets or sets the webhook properties. + *WebhookProperties `json:"properties,omitempty"` + // ID - Fully qualified resource Id for the resource + ID *string `json:"id,omitempty"` + // Name - The name of the resource + Name *string `json:"name,omitempty"` + // Type - The type of the resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Webhook. +func (w Webhook) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if w.WebhookProperties != nil { + objectMap["properties"] = w.WebhookProperties + } + if w.ID != nil { + objectMap["id"] = w.ID + } + if w.Name != nil { + objectMap["name"] = w.Name + } + if w.Type != nil { + objectMap["type"] = w.Type + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Webhook struct. +func (w *Webhook) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var webhookProperties WebhookProperties + err = json.Unmarshal(*v, &webhookProperties) + if err != nil { + return err + } + w.WebhookProperties = &webhookProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + w.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + w.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + w.Type = &typeVar + } + } + } + + return nil +} + +// WebhookCreateOrUpdateParameters the parameters supplied to the create or update webhook operation. +type WebhookCreateOrUpdateParameters struct { + // Name - Gets or sets the name of the webhook. + Name *string `json:"name,omitempty"` + // WebhookCreateOrUpdateProperties - Gets or sets the properties of the webhook. + *WebhookCreateOrUpdateProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for WebhookCreateOrUpdateParameters. +func (wcoup WebhookCreateOrUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if wcoup.Name != nil { + objectMap["name"] = wcoup.Name + } + if wcoup.WebhookCreateOrUpdateProperties != nil { + objectMap["properties"] = wcoup.WebhookCreateOrUpdateProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for WebhookCreateOrUpdateParameters struct. +func (wcoup *WebhookCreateOrUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + wcoup.Name = &name + } + case "properties": + if v != nil { + var webhookCreateOrUpdateProperties WebhookCreateOrUpdateProperties + err = json.Unmarshal(*v, &webhookCreateOrUpdateProperties) + if err != nil { + return err + } + wcoup.WebhookCreateOrUpdateProperties = &webhookCreateOrUpdateProperties + } + } + } + + return nil +} + +// WebhookCreateOrUpdateProperties the properties of the create webhook operation. +type WebhookCreateOrUpdateProperties struct { + // IsEnabled - Gets or sets the value of the enabled flag of webhook. + IsEnabled *bool `json:"isEnabled,omitempty"` + // URI - Gets or sets the uri. + URI *string `json:"uri,omitempty"` + // ExpiryTime - Gets or sets the expiry time. + ExpiryTime *date.Time `json:"expiryTime,omitempty"` + // Parameters - Gets or sets the parameters of the job. + Parameters map[string]*string `json:"parameters"` + // Runbook - Gets or sets the runbook. + Runbook *RunbookAssociationProperty `json:"runbook,omitempty"` + // RunOn - Gets or sets the name of the hybrid worker group the webhook job will run on. + RunOn *string `json:"runOn,omitempty"` +} + +// MarshalJSON is the custom marshaler for WebhookCreateOrUpdateProperties. +func (wcoup WebhookCreateOrUpdateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if wcoup.IsEnabled != nil { + objectMap["isEnabled"] = wcoup.IsEnabled + } + if wcoup.URI != nil { + objectMap["uri"] = wcoup.URI + } + if wcoup.ExpiryTime != nil { + objectMap["expiryTime"] = wcoup.ExpiryTime + } + if wcoup.Parameters != nil { + objectMap["parameters"] = wcoup.Parameters + } + if wcoup.Runbook != nil { + objectMap["runbook"] = wcoup.Runbook + } + if wcoup.RunOn != nil { + objectMap["runOn"] = wcoup.RunOn + } + return json.Marshal(objectMap) +} + +// WebhookListResult the response model for the list webhook operation. +type WebhookListResult struct { + autorest.Response `json:"-"` + // Value - Gets or sets a list of webhooks. + Value *[]Webhook `json:"value,omitempty"` + // NextLink - Gets or sets the next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// WebhookListResultIterator provides access to a complete listing of Webhook values. +type WebhookListResultIterator struct { + i int + page WebhookListResultPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *WebhookListResultIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter WebhookListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter WebhookListResultIterator) Response() WebhookListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter WebhookListResultIterator) Value() Webhook { + if !iter.page.NotDone() { + return Webhook{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (wlr WebhookListResult) IsEmpty() bool { + return wlr.Value == nil || len(*wlr.Value) == 0 +} + +// webhookListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (wlr WebhookListResult) webhookListResultPreparer() (*http.Request, error) { + if wlr.NextLink == nil || len(to.String(wlr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(wlr.NextLink))) +} + +// WebhookListResultPage contains a page of Webhook values. +type WebhookListResultPage struct { + fn func(WebhookListResult) (WebhookListResult, error) + wlr WebhookListResult +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *WebhookListResultPage) Next() error { + next, err := page.fn(page.wlr) + if err != nil { + return err + } + page.wlr = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page WebhookListResultPage) NotDone() bool { + return !page.wlr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page WebhookListResultPage) Response() WebhookListResult { + return page.wlr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page WebhookListResultPage) Values() []Webhook { + if page.wlr.IsEmpty() { + return nil + } + return *page.wlr.Value +} + +// WebhookProperties definition of the webhook properties +type WebhookProperties struct { + // IsEnabled - Gets or sets the value of the enabled flag of the webhook. + IsEnabled *bool `json:"isEnabled,omitempty"` + // URI - Gets or sets the webhook uri. + URI *string `json:"uri,omitempty"` + // ExpiryTime - Gets or sets the expiry time. + ExpiryTime *date.Time `json:"expiryTime,omitempty"` + // LastInvokedTime - Gets or sets the last invoked time. + LastInvokedTime *date.Time `json:"lastInvokedTime,omitempty"` + // Parameters - Gets or sets the parameters of the job that is created when the webhook calls the runbook it is associated with. + Parameters map[string]*string `json:"parameters"` + // Runbook - Gets or sets the runbook the webhook is associated with. + Runbook *RunbookAssociationProperty `json:"runbook,omitempty"` + // RunOn - Gets or sets the name of the hybrid worker group the webhook job will run on. + RunOn *string `json:"runOn,omitempty"` + // CreationTime - Gets or sets the creation time. + CreationTime *date.Time `json:"creationTime,omitempty"` + // LastModifiedTime - Gets or sets the last modified time. + LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` + // LastModifiedBy - Details of the user who last modified the Webhook + LastModifiedBy *string `json:"lastModifiedBy,omitempty"` + // Description - Gets or sets the description. + Description *string `json:"description,omitempty"` +} + +// MarshalJSON is the custom marshaler for WebhookProperties. +func (wp WebhookProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if wp.IsEnabled != nil { + objectMap["isEnabled"] = wp.IsEnabled + } + if wp.URI != nil { + objectMap["uri"] = wp.URI + } + if wp.ExpiryTime != nil { + objectMap["expiryTime"] = wp.ExpiryTime + } + if wp.LastInvokedTime != nil { + objectMap["lastInvokedTime"] = wp.LastInvokedTime + } + if wp.Parameters != nil { + objectMap["parameters"] = wp.Parameters + } + if wp.Runbook != nil { + objectMap["runbook"] = wp.Runbook + } + if wp.RunOn != nil { + objectMap["runOn"] = wp.RunOn + } + if wp.CreationTime != nil { + objectMap["creationTime"] = wp.CreationTime + } + if wp.LastModifiedTime != nil { + objectMap["lastModifiedTime"] = wp.LastModifiedTime + } + if wp.LastModifiedBy != nil { + objectMap["lastModifiedBy"] = wp.LastModifiedBy + } + if wp.Description != nil { + objectMap["description"] = wp.Description + } + return json.Marshal(objectMap) +} + +// WebhookUpdateParameters the parameters supplied to the update webhook operation. +type WebhookUpdateParameters struct { + // Name - Gets or sets the name of the webhook. + Name *string `json:"name,omitempty"` + // WebhookUpdateProperties - Gets or sets the value of the webhook. + *WebhookUpdateProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for WebhookUpdateParameters. +func (wup WebhookUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if wup.Name != nil { + objectMap["name"] = wup.Name + } + if wup.WebhookUpdateProperties != nil { + objectMap["properties"] = wup.WebhookUpdateProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for WebhookUpdateParameters struct. +func (wup *WebhookUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + wup.Name = &name + } + case "properties": + if v != nil { + var webhookUpdateProperties WebhookUpdateProperties + err = json.Unmarshal(*v, &webhookUpdateProperties) + if err != nil { + return err + } + wup.WebhookUpdateProperties = &webhookUpdateProperties + } + } + } + + return nil +} + +// WebhookUpdateProperties the properties of the update webhook. +type WebhookUpdateProperties struct { + // IsEnabled - Gets or sets the value of the enabled flag of webhook. + IsEnabled *bool `json:"isEnabled,omitempty"` + // RunOn - Gets or sets the name of the hybrid worker group the webhook job will run on. + RunOn *string `json:"runOn,omitempty"` + // Parameters - Gets or sets the parameters of the job. + Parameters map[string]*string `json:"parameters"` + // Description - Gets or sets the description of the webhook. + Description *string `json:"description,omitempty"` +} + +// MarshalJSON is the custom marshaler for WebhookUpdateProperties. +func (wup WebhookUpdateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if wup.IsEnabled != nil { + objectMap["isEnabled"] = wup.IsEnabled + } + if wup.RunOn != nil { + objectMap["runOn"] = wup.RunOn + } + if wup.Parameters != nil { + objectMap["parameters"] = wup.Parameters + } + if wup.Description != nil { + objectMap["description"] = wup.Description + } + return json.Marshal(objectMap) +} + +// WindowsProperties windows specific update configuration. +type WindowsProperties struct { + // IncludedUpdateClassifications - Update classification included in the software update configuration. A comma separated string with required values. Possible values include: 'WindowsUpdateClassesUnclassified', 'WindowsUpdateClassesCritical', 'WindowsUpdateClassesSecurity', 'WindowsUpdateClassesUpdateRollup', 'WindowsUpdateClassesFeaturePack', 'WindowsUpdateClassesServicePack', 'WindowsUpdateClassesDefinition', 'WindowsUpdateClassesTools', 'WindowsUpdateClassesUpdates' + IncludedUpdateClassifications WindowsUpdateClasses `json:"includedUpdateClassifications,omitempty"` + // ExcludedKbNumbers - KB numbers excluded from the software update configuration. + ExcludedKbNumbers *[]string `json:"excludedKbNumbers,omitempty"` + // IncludedKbNumbers - KB numbers included from the software update configuration. + IncludedKbNumbers *[]string `json:"includedKbNumbers,omitempty"` + // RebootSetting - Reboot setting for the software update configuration. + RebootSetting *string `json:"rebootSetting,omitempty"` +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/module.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/module.go new file mode 100644 index 000000000..d75a0d02f --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/module.go @@ -0,0 +1,466 @@ +package automation + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// ModuleClient is the automation Client +type ModuleClient struct { + BaseClient +} + +// NewModuleClient creates an instance of the ModuleClient client. +func NewModuleClient(subscriptionID string) ModuleClient { + return NewModuleClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewModuleClientWithBaseURI creates an instance of the ModuleClient client. +func NewModuleClientWithBaseURI(baseURI string, subscriptionID string) ModuleClient { + return ModuleClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate create or Update the module identified by module name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// moduleName - the name of module. +// parameters - the create or update parameters for module. +func (client ModuleClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, automationAccountName string, moduleName string, parameters ModuleCreateOrUpdateParameters) (result Module, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.ModuleCreateOrUpdateProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.ModuleCreateOrUpdateProperties.ContentLink", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.ModuleCreateOrUpdateProperties.ContentLink.ContentHash", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ModuleCreateOrUpdateProperties.ContentLink.ContentHash.Algorithm", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.ModuleCreateOrUpdateProperties.ContentLink.ContentHash.Value", Name: validation.Null, Rule: true, Chain: nil}, + }}, + }}, + }}}}}); err != nil { + return result, validation.NewError("automation.ModuleClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, automationAccountName, moduleName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ModuleClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.ModuleClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ModuleClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client ModuleClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, moduleName string, parameters ModuleCreateOrUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "moduleName": autorest.Encode("path", moduleName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/modules/{moduleName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client ModuleClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client ModuleClient) CreateOrUpdateResponder(resp *http.Response) (result Module, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete delete the module by name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// moduleName - the module name. +func (client ModuleClient) Delete(ctx context.Context, resourceGroupName string, automationAccountName string, moduleName string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.ModuleClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, automationAccountName, moduleName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ModuleClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "automation.ModuleClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ModuleClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ModuleClient) DeletePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, moduleName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "moduleName": autorest.Encode("path", moduleName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/modules/{moduleName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ModuleClient) DeleteSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ModuleClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get retrieve the module identified by module name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// moduleName - the module name. +func (client ModuleClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, moduleName string) (result Module, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.ModuleClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, moduleName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ModuleClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.ModuleClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ModuleClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client ModuleClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, moduleName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "moduleName": autorest.Encode("path", moduleName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/modules/{moduleName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ModuleClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ModuleClient) GetResponder(resp *http.Response) (result Module, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByAutomationAccount retrieve a list of modules. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +func (client ModuleClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string) (result ModuleListResultPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.ModuleClient", "ListByAutomationAccount", err.Error()) + } + + result.fn = client.listByAutomationAccountNextResults + req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ModuleClient", "ListByAutomationAccount", nil, "Failure preparing request") + return + } + + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.mlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.ModuleClient", "ListByAutomationAccount", resp, "Failure sending request") + return + } + + result.mlr, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ModuleClient", "ListByAutomationAccount", resp, "Failure responding to request") + } + + return +} + +// ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. +func (client ModuleClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/modules", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByAutomationAccountSender sends the ListByAutomationAccount request. The method will close the +// http.Response Body if it receives an error. +func (client ModuleClient) ListByAutomationAccountSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByAutomationAccountResponder handles the response to the ListByAutomationAccount request. The method always +// closes the http.Response Body. +func (client ModuleClient) ListByAutomationAccountResponder(resp *http.Response) (result ModuleListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByAutomationAccountNextResults retrieves the next set of results, if any. +func (client ModuleClient) listByAutomationAccountNextResults(lastResults ModuleListResult) (result ModuleListResult, err error) { + req, err := lastResults.moduleListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "automation.ModuleClient", "listByAutomationAccountNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "automation.ModuleClient", "listByAutomationAccountNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ModuleClient", "listByAutomationAccountNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByAutomationAccountComplete enumerates all values, automatically crossing page boundaries as required. +func (client ModuleClient) ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string) (result ModuleListResultIterator, err error) { + result.page, err = client.ListByAutomationAccount(ctx, resourceGroupName, automationAccountName) + return +} + +// Update update the module identified by module name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// moduleName - the name of module. +// parameters - the update parameters for module. +func (client ModuleClient) Update(ctx context.Context, resourceGroupName string, automationAccountName string, moduleName string, parameters ModuleUpdateParameters) (result Module, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.ModuleClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, automationAccountName, moduleName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ModuleClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.ModuleClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ModuleClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client ModuleClient) UpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, moduleName string, parameters ModuleUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "moduleName": autorest.Encode("path", moduleName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/modules/{moduleName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client ModuleClient) UpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client ModuleClient) UpdateResponder(resp *http.Response) (result Module, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/nodereports.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/nodereports.go new file mode 100644 index 000000000..32a8f9af7 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/nodereports.go @@ -0,0 +1,308 @@ +package automation + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// NodeReportsClient is the automation Client +type NodeReportsClient struct { + BaseClient +} + +// NewNodeReportsClient creates an instance of the NodeReportsClient client. +func NewNodeReportsClient(subscriptionID string) NodeReportsClient { + return NewNodeReportsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewNodeReportsClientWithBaseURI creates an instance of the NodeReportsClient client. +func NewNodeReportsClientWithBaseURI(baseURI string, subscriptionID string) NodeReportsClient { + return NodeReportsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get retrieve the Dsc node report data by node id and report id. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// nodeID - the Dsc node id. +// reportID - the report id. +func (client NodeReportsClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, nodeID string, reportID string) (result DscNodeReport, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.NodeReportsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, nodeID, reportID) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.NodeReportsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.NodeReportsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.NodeReportsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client NodeReportsClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, nodeID string, reportID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "nodeId": autorest.Encode("path", nodeID), + "reportId": autorest.Encode("path", reportID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodes/{nodeId}/reports/{reportId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client NodeReportsClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client NodeReportsClient) GetResponder(resp *http.Response) (result DscNodeReport, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetContent retrieve the Dsc node reports by node id and report id. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// nodeID - the Dsc node id. +// reportID - the report id. +func (client NodeReportsClient) GetContent(ctx context.Context, resourceGroupName string, automationAccountName string, nodeID string, reportID string) (result SetObject, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.NodeReportsClient", "GetContent", err.Error()) + } + + req, err := client.GetContentPreparer(ctx, resourceGroupName, automationAccountName, nodeID, reportID) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.NodeReportsClient", "GetContent", nil, "Failure preparing request") + return + } + + resp, err := client.GetContentSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.NodeReportsClient", "GetContent", resp, "Failure sending request") + return + } + + result, err = client.GetContentResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.NodeReportsClient", "GetContent", resp, "Failure responding to request") + } + + return +} + +// GetContentPreparer prepares the GetContent request. +func (client NodeReportsClient) GetContentPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, nodeID string, reportID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "nodeId": autorest.Encode("path", nodeID), + "reportId": autorest.Encode("path", reportID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodes/{nodeId}/reports/{reportId}/content", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetContentSender sends the GetContent request. The method will close the +// http.Response Body if it receives an error. +func (client NodeReportsClient) GetContentSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetContentResponder handles the response to the GetContent request. The method always +// closes the http.Response Body. +func (client NodeReportsClient) GetContentResponder(resp *http.Response) (result SetObject, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByNode retrieve the Dsc node report list by node id. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// nodeID - the parameters supplied to the list operation. +// filter - the filter to apply on the operation. +func (client NodeReportsClient) ListByNode(ctx context.Context, resourceGroupName string, automationAccountName string, nodeID string, filter string) (result DscNodeReportListResultPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.NodeReportsClient", "ListByNode", err.Error()) + } + + result.fn = client.listByNodeNextResults + req, err := client.ListByNodePreparer(ctx, resourceGroupName, automationAccountName, nodeID, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.NodeReportsClient", "ListByNode", nil, "Failure preparing request") + return + } + + resp, err := client.ListByNodeSender(req) + if err != nil { + result.dnrlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.NodeReportsClient", "ListByNode", resp, "Failure sending request") + return + } + + result.dnrlr, err = client.ListByNodeResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.NodeReportsClient", "ListByNode", resp, "Failure responding to request") + } + + return +} + +// ListByNodePreparer prepares the ListByNode request. +func (client NodeReportsClient) ListByNodePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, nodeID string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "nodeId": autorest.Encode("path", nodeID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodes/{nodeId}/reports", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByNodeSender sends the ListByNode request. The method will close the +// http.Response Body if it receives an error. +func (client NodeReportsClient) ListByNodeSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByNodeResponder handles the response to the ListByNode request. The method always +// closes the http.Response Body. +func (client NodeReportsClient) ListByNodeResponder(resp *http.Response) (result DscNodeReportListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByNodeNextResults retrieves the next set of results, if any. +func (client NodeReportsClient) listByNodeNextResults(lastResults DscNodeReportListResult) (result DscNodeReportListResult, err error) { + req, err := lastResults.dscNodeReportListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "automation.NodeReportsClient", "listByNodeNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByNodeSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "automation.NodeReportsClient", "listByNodeNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByNodeResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.NodeReportsClient", "listByNodeNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByNodeComplete enumerates all values, automatically crossing page boundaries as required. +func (client NodeReportsClient) ListByNodeComplete(ctx context.Context, resourceGroupName string, automationAccountName string, nodeID string, filter string) (result DscNodeReportListResultIterator, err error) { + result.page, err = client.ListByNode(ctx, resourceGroupName, automationAccountName, nodeID, filter) + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/objectdatatypes.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/objectdatatypes.go new file mode 100644 index 000000000..04791f5ad --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/objectdatatypes.go @@ -0,0 +1,197 @@ +package automation + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// ObjectDataTypesClient is the automation Client +type ObjectDataTypesClient struct { + BaseClient +} + +// NewObjectDataTypesClient creates an instance of the ObjectDataTypesClient client. +func NewObjectDataTypesClient(subscriptionID string) ObjectDataTypesClient { + return NewObjectDataTypesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewObjectDataTypesClientWithBaseURI creates an instance of the ObjectDataTypesClient client. +func NewObjectDataTypesClientWithBaseURI(baseURI string, subscriptionID string) ObjectDataTypesClient { + return ObjectDataTypesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// ListFieldsByModuleAndType retrieve a list of fields of a given type identified by module name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// moduleName - the name of module. +// typeName - the name of type. +func (client ObjectDataTypesClient) ListFieldsByModuleAndType(ctx context.Context, resourceGroupName string, automationAccountName string, moduleName string, typeName string) (result TypeFieldListResult, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.ObjectDataTypesClient", "ListFieldsByModuleAndType", err.Error()) + } + + req, err := client.ListFieldsByModuleAndTypePreparer(ctx, resourceGroupName, automationAccountName, moduleName, typeName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ObjectDataTypesClient", "ListFieldsByModuleAndType", nil, "Failure preparing request") + return + } + + resp, err := client.ListFieldsByModuleAndTypeSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.ObjectDataTypesClient", "ListFieldsByModuleAndType", resp, "Failure sending request") + return + } + + result, err = client.ListFieldsByModuleAndTypeResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ObjectDataTypesClient", "ListFieldsByModuleAndType", resp, "Failure responding to request") + } + + return +} + +// ListFieldsByModuleAndTypePreparer prepares the ListFieldsByModuleAndType request. +func (client ObjectDataTypesClient) ListFieldsByModuleAndTypePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, moduleName string, typeName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "moduleName": autorest.Encode("path", moduleName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "typeName": autorest.Encode("path", typeName), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/modules/{moduleName}/objectDataTypes/{typeName}/fields", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListFieldsByModuleAndTypeSender sends the ListFieldsByModuleAndType request. The method will close the +// http.Response Body if it receives an error. +func (client ObjectDataTypesClient) ListFieldsByModuleAndTypeSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListFieldsByModuleAndTypeResponder handles the response to the ListFieldsByModuleAndType request. The method always +// closes the http.Response Body. +func (client ObjectDataTypesClient) ListFieldsByModuleAndTypeResponder(resp *http.Response) (result TypeFieldListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListFieldsByType retrieve a list of fields of a given type across all accessible modules. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// typeName - the name of type. +func (client ObjectDataTypesClient) ListFieldsByType(ctx context.Context, resourceGroupName string, automationAccountName string, typeName string) (result TypeFieldListResult, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.ObjectDataTypesClient", "ListFieldsByType", err.Error()) + } + + req, err := client.ListFieldsByTypePreparer(ctx, resourceGroupName, automationAccountName, typeName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ObjectDataTypesClient", "ListFieldsByType", nil, "Failure preparing request") + return + } + + resp, err := client.ListFieldsByTypeSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.ObjectDataTypesClient", "ListFieldsByType", resp, "Failure sending request") + return + } + + result, err = client.ListFieldsByTypeResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ObjectDataTypesClient", "ListFieldsByType", resp, "Failure responding to request") + } + + return +} + +// ListFieldsByTypePreparer prepares the ListFieldsByType request. +func (client ObjectDataTypesClient) ListFieldsByTypePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, typeName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "typeName": autorest.Encode("path", typeName), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/objectDataTypes/{typeName}/fields", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListFieldsByTypeSender sends the ListFieldsByType request. The method will close the +// http.Response Body if it receives an error. +func (client ObjectDataTypesClient) ListFieldsByTypeSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListFieldsByTypeResponder handles the response to the ListFieldsByType request. The method always +// closes the http.Response Body. +func (client ObjectDataTypesClient) ListFieldsByTypeResponder(resp *http.Response) (result TypeFieldListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/operations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/operations.go new file mode 100644 index 000000000..b731c2d30 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/operations.go @@ -0,0 +1,98 @@ +package automation + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "net/http" +) + +// OperationsClient is the automation Client +type OperationsClient struct { + BaseClient +} + +// NewOperationsClient creates an instance of the OperationsClient client. +func NewOperationsClient(subscriptionID string) OperationsClient { + return NewOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewOperationsClientWithBaseURI creates an instance of the OperationsClient client. +func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient { + return OperationsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// List lists all of the available Automation REST API operations. +func (client OperationsClient) List(ctx context.Context) (result OperationListResult, err error) { + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.OperationsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.OperationsClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.OperationsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/providers/Microsoft.Automation/operations"), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client OperationsClient) ListSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client OperationsClient) ListResponder(resp *http.Response) (result OperationListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/runbook.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/runbook.go new file mode 100644 index 000000000..af0abb990 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/runbook.go @@ -0,0 +1,552 @@ +package automation + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// RunbookClient is the automation Client +type RunbookClient struct { + BaseClient +} + +// NewRunbookClient creates an instance of the RunbookClient client. +func NewRunbookClient(subscriptionID string) RunbookClient { + return NewRunbookClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewRunbookClientWithBaseURI creates an instance of the RunbookClient client. +func NewRunbookClientWithBaseURI(baseURI string, subscriptionID string) RunbookClient { + return RunbookClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate create the runbook identified by runbook name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// runbookName - the runbook name. +// parameters - the create or update parameters for runbook. Provide either content link for a published +// runbook or draft, not both. +func (client RunbookClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string, parameters RunbookCreateOrUpdateParameters) (result Runbook, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.RunbookCreateOrUpdateProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.RunbookCreateOrUpdateProperties.Draft", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.RunbookCreateOrUpdateProperties.Draft.DraftContentLink", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.RunbookCreateOrUpdateProperties.Draft.DraftContentLink.ContentHash", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.RunbookCreateOrUpdateProperties.Draft.DraftContentLink.ContentHash.Algorithm", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.RunbookCreateOrUpdateProperties.Draft.DraftContentLink.ContentHash.Value", Name: validation.Null, Rule: true, Chain: nil}, + }}, + }}, + }}, + {Target: "parameters.RunbookCreateOrUpdateProperties.PublishContentLink", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.RunbookCreateOrUpdateProperties.PublishContentLink.ContentHash", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.RunbookCreateOrUpdateProperties.PublishContentLink.ContentHash.Algorithm", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.RunbookCreateOrUpdateProperties.PublishContentLink.ContentHash.Value", Name: validation.Null, Rule: true, Chain: nil}, + }}, + }}, + }}}}}); err != nil { + return result, validation.NewError("automation.RunbookClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, automationAccountName, runbookName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.RunbookClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.RunbookClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.RunbookClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client RunbookClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string, parameters RunbookCreateOrUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "runbookName": autorest.Encode("path", runbookName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client RunbookClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client RunbookClient) CreateOrUpdateResponder(resp *http.Response) (result Runbook, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusBadRequest), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete delete the runbook by name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// runbookName - the runbook name. +func (client RunbookClient) Delete(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.RunbookClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, automationAccountName, runbookName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.RunbookClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "automation.RunbookClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.RunbookClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client RunbookClient) DeletePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "runbookName": autorest.Encode("path", runbookName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client RunbookClient) DeleteSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client RunbookClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get retrieve the runbook identified by runbook name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// runbookName - the runbook name. +func (client RunbookClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (result Runbook, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.RunbookClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, runbookName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.RunbookClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.RunbookClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.RunbookClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client RunbookClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "runbookName": autorest.Encode("path", runbookName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client RunbookClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client RunbookClient) GetResponder(resp *http.Response) (result Runbook, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetContent retrieve the content of runbook identified by runbook name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// runbookName - the runbook name. +func (client RunbookClient) GetContent(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (result String, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.RunbookClient", "GetContent", err.Error()) + } + + req, err := client.GetContentPreparer(ctx, resourceGroupName, automationAccountName, runbookName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.RunbookClient", "GetContent", nil, "Failure preparing request") + return + } + + resp, err := client.GetContentSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.RunbookClient", "GetContent", resp, "Failure sending request") + return + } + + result, err = client.GetContentResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.RunbookClient", "GetContent", resp, "Failure responding to request") + } + + return +} + +// GetContentPreparer prepares the GetContent request. +func (client RunbookClient) GetContentPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "runbookName": autorest.Encode("path", runbookName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/content", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetContentSender sends the GetContent request. The method will close the +// http.Response Body if it receives an error. +func (client RunbookClient) GetContentSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetContentResponder handles the response to the GetContent request. The method always +// closes the http.Response Body. +func (client RunbookClient) GetContentResponder(resp *http.Response) (result String, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByAutomationAccount retrieve a list of runbooks. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +func (client RunbookClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string) (result RunbookListResultPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.RunbookClient", "ListByAutomationAccount", err.Error()) + } + + result.fn = client.listByAutomationAccountNextResults + req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.RunbookClient", "ListByAutomationAccount", nil, "Failure preparing request") + return + } + + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.rlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.RunbookClient", "ListByAutomationAccount", resp, "Failure sending request") + return + } + + result.rlr, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.RunbookClient", "ListByAutomationAccount", resp, "Failure responding to request") + } + + return +} + +// ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. +func (client RunbookClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByAutomationAccountSender sends the ListByAutomationAccount request. The method will close the +// http.Response Body if it receives an error. +func (client RunbookClient) ListByAutomationAccountSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByAutomationAccountResponder handles the response to the ListByAutomationAccount request. The method always +// closes the http.Response Body. +func (client RunbookClient) ListByAutomationAccountResponder(resp *http.Response) (result RunbookListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByAutomationAccountNextResults retrieves the next set of results, if any. +func (client RunbookClient) listByAutomationAccountNextResults(lastResults RunbookListResult) (result RunbookListResult, err error) { + req, err := lastResults.runbookListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "automation.RunbookClient", "listByAutomationAccountNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "automation.RunbookClient", "listByAutomationAccountNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.RunbookClient", "listByAutomationAccountNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByAutomationAccountComplete enumerates all values, automatically crossing page boundaries as required. +func (client RunbookClient) ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string) (result RunbookListResultIterator, err error) { + result.page, err = client.ListByAutomationAccount(ctx, resourceGroupName, automationAccountName) + return +} + +// Update update the runbook identified by runbook name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// runbookName - the runbook name. +// parameters - the update parameters for runbook. +func (client RunbookClient) Update(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string, parameters RunbookUpdateParameters) (result Runbook, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.RunbookClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, automationAccountName, runbookName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.RunbookClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.RunbookClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.RunbookClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client RunbookClient) UpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string, parameters RunbookUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "runbookName": autorest.Encode("path", runbookName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client RunbookClient) UpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client RunbookClient) UpdateResponder(resp *http.Response) (result Runbook, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/runbookdraft.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/runbookdraft.go new file mode 100644 index 000000000..b3c0c9ad8 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/runbookdraft.go @@ -0,0 +1,436 @@ +package automation + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// RunbookDraftClient is the automation Client +type RunbookDraftClient struct { + BaseClient +} + +// NewRunbookDraftClient creates an instance of the RunbookDraftClient client. +func NewRunbookDraftClient(subscriptionID string) RunbookDraftClient { + return NewRunbookDraftClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewRunbookDraftClientWithBaseURI creates an instance of the RunbookDraftClient client. +func NewRunbookDraftClientWithBaseURI(baseURI string, subscriptionID string) RunbookDraftClient { + return RunbookDraftClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get retrieve the runbook draft identified by runbook name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// runbookName - the runbook name. +func (client RunbookDraftClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (result RunbookDraft, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.RunbookDraftClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, runbookName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.RunbookDraftClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.RunbookDraftClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.RunbookDraftClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client RunbookDraftClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "runbookName": autorest.Encode("path", runbookName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client RunbookDraftClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client RunbookDraftClient) GetResponder(resp *http.Response) (result RunbookDraft, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetContent retrieve the content of runbook draft identified by runbook name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// runbookName - the runbook name. +func (client RunbookDraftClient) GetContent(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (result String, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.RunbookDraftClient", "GetContent", err.Error()) + } + + req, err := client.GetContentPreparer(ctx, resourceGroupName, automationAccountName, runbookName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.RunbookDraftClient", "GetContent", nil, "Failure preparing request") + return + } + + resp, err := client.GetContentSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.RunbookDraftClient", "GetContent", resp, "Failure sending request") + return + } + + result, err = client.GetContentResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.RunbookDraftClient", "GetContent", resp, "Failure responding to request") + } + + return +} + +// GetContentPreparer prepares the GetContent request. +func (client RunbookDraftClient) GetContentPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "runbookName": autorest.Encode("path", runbookName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/content", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetContentSender sends the GetContent request. The method will close the +// http.Response Body if it receives an error. +func (client RunbookDraftClient) GetContentSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetContentResponder handles the response to the GetContent request. The method always +// closes the http.Response Body. +func (client RunbookDraftClient) GetContentResponder(resp *http.Response) (result String, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Publish publish runbook draft. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// runbookName - the parameters supplied to the publish runbook operation. +func (client RunbookDraftClient) Publish(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (result RunbookDraftPublishFuture, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.RunbookDraftClient", "Publish", err.Error()) + } + + req, err := client.PublishPreparer(ctx, resourceGroupName, automationAccountName, runbookName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.RunbookDraftClient", "Publish", nil, "Failure preparing request") + return + } + + result, err = client.PublishSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.RunbookDraftClient", "Publish", result.Response(), "Failure sending request") + return + } + + return +} + +// PublishPreparer prepares the Publish request. +func (client RunbookDraftClient) PublishPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "runbookName": autorest.Encode("path", runbookName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/publish", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// PublishSender sends the Publish request. The method will close the +// http.Response Body if it receives an error. +func (client RunbookDraftClient) PublishSender(req *http.Request) (future RunbookDraftPublishFuture, err error) { + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// PublishResponder handles the response to the Publish request. The method always +// closes the http.Response Body. +func (client RunbookDraftClient) PublishResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// ReplaceContent replaces the runbook draft content. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// runbookName - the runbook name. +// runbookContent - the runbook draft content. +func (client RunbookDraftClient) ReplaceContent(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string, runbookContent string) (result RunbookDraftReplaceContentFuture, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.RunbookDraftClient", "ReplaceContent", err.Error()) + } + + req, err := client.ReplaceContentPreparer(ctx, resourceGroupName, automationAccountName, runbookName, runbookContent) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.RunbookDraftClient", "ReplaceContent", nil, "Failure preparing request") + return + } + + result, err = client.ReplaceContentSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.RunbookDraftClient", "ReplaceContent", result.Response(), "Failure sending request") + return + } + + return +} + +// ReplaceContentPreparer prepares the ReplaceContent request. +func (client RunbookDraftClient) ReplaceContentPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string, runbookContent string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "runbookName": autorest.Encode("path", runbookName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("text/powershell"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/content", pathParameters), + autorest.WithJSON(runbookContent), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ReplaceContentSender sends the ReplaceContent request. The method will close the +// http.Response Body if it receives an error. +func (client RunbookDraftClient) ReplaceContentSender(req *http.Request) (future RunbookDraftReplaceContentFuture, err error) { + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// ReplaceContentResponder handles the response to the ReplaceContent request. The method always +// closes the http.Response Body. +func (client RunbookDraftClient) ReplaceContentResponder(resp *http.Response) (result String, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UndoEdit undo draft edit to last known published state identified by runbook name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// runbookName - the runbook name. +func (client RunbookDraftClient) UndoEdit(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (result RunbookDraftUndoEditResult, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.RunbookDraftClient", "UndoEdit", err.Error()) + } + + req, err := client.UndoEditPreparer(ctx, resourceGroupName, automationAccountName, runbookName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.RunbookDraftClient", "UndoEdit", nil, "Failure preparing request") + return + } + + resp, err := client.UndoEditSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.RunbookDraftClient", "UndoEdit", resp, "Failure sending request") + return + } + + result, err = client.UndoEditResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.RunbookDraftClient", "UndoEdit", resp, "Failure responding to request") + } + + return +} + +// UndoEditPreparer prepares the UndoEdit request. +func (client RunbookDraftClient) UndoEditPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "runbookName": autorest.Encode("path", runbookName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/undoEdit", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UndoEditSender sends the UndoEdit request. The method will close the +// http.Response Body if it receives an error. +func (client RunbookDraftClient) UndoEditSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// UndoEditResponder handles the response to the UndoEdit request. The method always +// closes the http.Response Body. +func (client RunbookDraftClient) UndoEditResponder(resp *http.Response) (result RunbookDraftUndoEditResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/schedule.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/schedule.go new file mode 100644 index 000000000..c6635f076 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/schedule.go @@ -0,0 +1,461 @@ +package automation + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// ScheduleClient is the automation Client +type ScheduleClient struct { + BaseClient +} + +// NewScheduleClient creates an instance of the ScheduleClient client. +func NewScheduleClient(subscriptionID string) ScheduleClient { + return NewScheduleClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewScheduleClientWithBaseURI creates an instance of the ScheduleClient client. +func NewScheduleClientWithBaseURI(baseURI string, subscriptionID string) ScheduleClient { + return ScheduleClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate create a schedule. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// scheduleName - the schedule name. +// parameters - the parameters supplied to the create or update schedule operation. +func (client ScheduleClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, automationAccountName string, scheduleName string, parameters ScheduleCreateOrUpdateParameters) (result Schedule, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.Name", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.ScheduleCreateOrUpdateProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.ScheduleCreateOrUpdateProperties.StartTime", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("automation.ScheduleClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, automationAccountName, scheduleName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ScheduleClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.ScheduleClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ScheduleClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client ScheduleClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, scheduleName string, parameters ScheduleCreateOrUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "scheduleName": autorest.Encode("path", scheduleName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/schedules/{scheduleName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client ScheduleClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client ScheduleClient) CreateOrUpdateResponder(resp *http.Response) (result Schedule, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusConflict), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete delete the schedule identified by schedule name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// scheduleName - the schedule name. +func (client ScheduleClient) Delete(ctx context.Context, resourceGroupName string, automationAccountName string, scheduleName string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.ScheduleClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, automationAccountName, scheduleName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ScheduleClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "automation.ScheduleClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ScheduleClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ScheduleClient) DeletePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, scheduleName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "scheduleName": autorest.Encode("path", scheduleName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/schedules/{scheduleName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ScheduleClient) DeleteSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ScheduleClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get retrieve the schedule identified by schedule name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// scheduleName - the schedule name. +func (client ScheduleClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, scheduleName string) (result Schedule, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.ScheduleClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, scheduleName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ScheduleClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.ScheduleClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ScheduleClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client ScheduleClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, scheduleName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "scheduleName": autorest.Encode("path", scheduleName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/schedules/{scheduleName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ScheduleClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ScheduleClient) GetResponder(resp *http.Response) (result Schedule, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByAutomationAccount retrieve a list of schedules. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +func (client ScheduleClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string) (result ScheduleListResultPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.ScheduleClient", "ListByAutomationAccount", err.Error()) + } + + result.fn = client.listByAutomationAccountNextResults + req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ScheduleClient", "ListByAutomationAccount", nil, "Failure preparing request") + return + } + + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.slr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.ScheduleClient", "ListByAutomationAccount", resp, "Failure sending request") + return + } + + result.slr, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ScheduleClient", "ListByAutomationAccount", resp, "Failure responding to request") + } + + return +} + +// ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. +func (client ScheduleClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/schedules", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByAutomationAccountSender sends the ListByAutomationAccount request. The method will close the +// http.Response Body if it receives an error. +func (client ScheduleClient) ListByAutomationAccountSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByAutomationAccountResponder handles the response to the ListByAutomationAccount request. The method always +// closes the http.Response Body. +func (client ScheduleClient) ListByAutomationAccountResponder(resp *http.Response) (result ScheduleListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByAutomationAccountNextResults retrieves the next set of results, if any. +func (client ScheduleClient) listByAutomationAccountNextResults(lastResults ScheduleListResult) (result ScheduleListResult, err error) { + req, err := lastResults.scheduleListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "automation.ScheduleClient", "listByAutomationAccountNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "automation.ScheduleClient", "listByAutomationAccountNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ScheduleClient", "listByAutomationAccountNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByAutomationAccountComplete enumerates all values, automatically crossing page boundaries as required. +func (client ScheduleClient) ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string) (result ScheduleListResultIterator, err error) { + result.page, err = client.ListByAutomationAccount(ctx, resourceGroupName, automationAccountName) + return +} + +// Update update the schedule identified by schedule name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// scheduleName - the schedule name. +// parameters - the parameters supplied to the update schedule operation. +func (client ScheduleClient) Update(ctx context.Context, resourceGroupName string, automationAccountName string, scheduleName string, parameters ScheduleUpdateParameters) (result Schedule, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.ScheduleClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, automationAccountName, scheduleName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ScheduleClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.ScheduleClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ScheduleClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client ScheduleClient) UpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, scheduleName string, parameters ScheduleUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "scheduleName": autorest.Encode("path", scheduleName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/schedules/{scheduleName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client ScheduleClient) UpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client ScheduleClient) UpdateResponder(resp *http.Response) (result Schedule, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/softwareupdateconfigurationmachineruns.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/softwareupdateconfigurationmachineruns.go new file mode 100644 index 000000000..2afdb29b7 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/softwareupdateconfigurationmachineruns.go @@ -0,0 +1,219 @@ +package automation + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/satori/go.uuid" + "net/http" +) + +// SoftwareUpdateConfigurationMachineRunsClient is the automation Client +type SoftwareUpdateConfigurationMachineRunsClient struct { + BaseClient +} + +// NewSoftwareUpdateConfigurationMachineRunsClient creates an instance of the +// SoftwareUpdateConfigurationMachineRunsClient client. +func NewSoftwareUpdateConfigurationMachineRunsClient(subscriptionID string) SoftwareUpdateConfigurationMachineRunsClient { + return NewSoftwareUpdateConfigurationMachineRunsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewSoftwareUpdateConfigurationMachineRunsClientWithBaseURI creates an instance of the +// SoftwareUpdateConfigurationMachineRunsClient client. +func NewSoftwareUpdateConfigurationMachineRunsClientWithBaseURI(baseURI string, subscriptionID string) SoftwareUpdateConfigurationMachineRunsClient { + return SoftwareUpdateConfigurationMachineRunsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// GetByID get a single software update configuration machine run by Id. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// softwareUpdateConfigurationMachineRunID - the Id of the software update configuration machine run. +// clientRequestID - identifies this specific client request. +func (client SoftwareUpdateConfigurationMachineRunsClient) GetByID(ctx context.Context, resourceGroupName string, automationAccountName string, softwareUpdateConfigurationMachineRunID uuid.UUID, clientRequestID string) (result SoftwareUpdateConfigurationMachineRun, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.SoftwareUpdateConfigurationMachineRunsClient", "GetByID", err.Error()) + } + + req, err := client.GetByIDPreparer(ctx, resourceGroupName, automationAccountName, softwareUpdateConfigurationMachineRunID, clientRequestID) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SoftwareUpdateConfigurationMachineRunsClient", "GetByID", nil, "Failure preparing request") + return + } + + resp, err := client.GetByIDSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.SoftwareUpdateConfigurationMachineRunsClient", "GetByID", resp, "Failure sending request") + return + } + + result, err = client.GetByIDResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SoftwareUpdateConfigurationMachineRunsClient", "GetByID", resp, "Failure responding to request") + } + + return +} + +// GetByIDPreparer prepares the GetByID request. +func (client SoftwareUpdateConfigurationMachineRunsClient) GetByIDPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, softwareUpdateConfigurationMachineRunID uuid.UUID, clientRequestID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "softwareUpdateConfigurationMachineRunId": autorest.Encode("path", softwareUpdateConfigurationMachineRunID), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-05-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/softwareUpdateConfigurationMachineRuns/{softwareUpdateConfigurationMachineRunId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if len(clientRequestID) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("clientRequestId", autorest.String(clientRequestID))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetByIDSender sends the GetByID request. The method will close the +// http.Response Body if it receives an error. +func (client SoftwareUpdateConfigurationMachineRunsClient) GetByIDSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetByIDResponder handles the response to the GetByID request. The method always +// closes the http.Response Body. +func (client SoftwareUpdateConfigurationMachineRunsClient) GetByIDResponder(resp *http.Response) (result SoftwareUpdateConfigurationMachineRun, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List return list of software update configuration machine runs +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// clientRequestID - identifies this specific client request. +// filter - the filter to apply on the operation. You can use the following filters: 'properties/osType', +// 'properties/status', 'properties/startTime', and 'properties/softwareUpdateConfiguration/name' +// skip - number of entries you skip before returning results +// top - maximum number of entries returned in the results collection +func (client SoftwareUpdateConfigurationMachineRunsClient) List(ctx context.Context, resourceGroupName string, automationAccountName string, clientRequestID string, filter string, skip string, top string) (result SoftwareUpdateConfigurationMachineRunListResult, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.SoftwareUpdateConfigurationMachineRunsClient", "List", err.Error()) + } + + req, err := client.ListPreparer(ctx, resourceGroupName, automationAccountName, clientRequestID, filter, skip, top) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SoftwareUpdateConfigurationMachineRunsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.SoftwareUpdateConfigurationMachineRunsClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SoftwareUpdateConfigurationMachineRunsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client SoftwareUpdateConfigurationMachineRunsClient) ListPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, clientRequestID string, filter string, skip string, top string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-05-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if len(skip) > 0 { + queryParameters["$skip"] = autorest.Encode("query", skip) + } + if len(top) > 0 { + queryParameters["$top"] = autorest.Encode("query", top) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/softwareUpdateConfigurationMachineRuns", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if len(clientRequestID) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("clientRequestId", autorest.String(clientRequestID))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client SoftwareUpdateConfigurationMachineRunsClient) ListSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client SoftwareUpdateConfigurationMachineRunsClient) ListResponder(resp *http.Response) (result SoftwareUpdateConfigurationMachineRunListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/softwareupdateconfigurationruns.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/softwareupdateconfigurationruns.go new file mode 100644 index 000000000..b50019691 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/softwareupdateconfigurationruns.go @@ -0,0 +1,218 @@ +package automation + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/satori/go.uuid" + "net/http" +) + +// SoftwareUpdateConfigurationRunsClient is the automation Client +type SoftwareUpdateConfigurationRunsClient struct { + BaseClient +} + +// NewSoftwareUpdateConfigurationRunsClient creates an instance of the SoftwareUpdateConfigurationRunsClient client. +func NewSoftwareUpdateConfigurationRunsClient(subscriptionID string) SoftwareUpdateConfigurationRunsClient { + return NewSoftwareUpdateConfigurationRunsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewSoftwareUpdateConfigurationRunsClientWithBaseURI creates an instance of the SoftwareUpdateConfigurationRunsClient +// client. +func NewSoftwareUpdateConfigurationRunsClientWithBaseURI(baseURI string, subscriptionID string) SoftwareUpdateConfigurationRunsClient { + return SoftwareUpdateConfigurationRunsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// GetByID get a single software update configuration Run by Id. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// softwareUpdateConfigurationRunID - the Id of the software update configuration run. +// clientRequestID - identifies this specific client request. +func (client SoftwareUpdateConfigurationRunsClient) GetByID(ctx context.Context, resourceGroupName string, automationAccountName string, softwareUpdateConfigurationRunID uuid.UUID, clientRequestID string) (result SoftwareUpdateConfigurationRun, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.SoftwareUpdateConfigurationRunsClient", "GetByID", err.Error()) + } + + req, err := client.GetByIDPreparer(ctx, resourceGroupName, automationAccountName, softwareUpdateConfigurationRunID, clientRequestID) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SoftwareUpdateConfigurationRunsClient", "GetByID", nil, "Failure preparing request") + return + } + + resp, err := client.GetByIDSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.SoftwareUpdateConfigurationRunsClient", "GetByID", resp, "Failure sending request") + return + } + + result, err = client.GetByIDResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SoftwareUpdateConfigurationRunsClient", "GetByID", resp, "Failure responding to request") + } + + return +} + +// GetByIDPreparer prepares the GetByID request. +func (client SoftwareUpdateConfigurationRunsClient) GetByIDPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, softwareUpdateConfigurationRunID uuid.UUID, clientRequestID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "softwareUpdateConfigurationRunId": autorest.Encode("path", softwareUpdateConfigurationRunID), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-05-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/softwareUpdateConfigurationRuns/{softwareUpdateConfigurationRunId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if len(clientRequestID) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("clientRequestId", autorest.String(clientRequestID))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetByIDSender sends the GetByID request. The method will close the +// http.Response Body if it receives an error. +func (client SoftwareUpdateConfigurationRunsClient) GetByIDSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetByIDResponder handles the response to the GetByID request. The method always +// closes the http.Response Body. +func (client SoftwareUpdateConfigurationRunsClient) GetByIDResponder(resp *http.Response) (result SoftwareUpdateConfigurationRun, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List return list of software update configuration runs +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// clientRequestID - identifies this specific client request. +// filter - the filter to apply on the operation. You can use the following filters: 'properties/osType', +// 'properties/status', 'properties/startTime', and 'properties/softwareUpdateConfiguration/name' +// skip - number of entries you skip before returning results +// top - maximum number of entries returned in the results collection +func (client SoftwareUpdateConfigurationRunsClient) List(ctx context.Context, resourceGroupName string, automationAccountName string, clientRequestID string, filter string, skip string, top string) (result SoftwareUpdateConfigurationRunListResult, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.SoftwareUpdateConfigurationRunsClient", "List", err.Error()) + } + + req, err := client.ListPreparer(ctx, resourceGroupName, automationAccountName, clientRequestID, filter, skip, top) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SoftwareUpdateConfigurationRunsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.SoftwareUpdateConfigurationRunsClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SoftwareUpdateConfigurationRunsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client SoftwareUpdateConfigurationRunsClient) ListPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, clientRequestID string, filter string, skip string, top string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-05-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if len(skip) > 0 { + queryParameters["$skip"] = autorest.Encode("query", skip) + } + if len(top) > 0 { + queryParameters["$top"] = autorest.Encode("query", top) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/softwareUpdateConfigurationRuns", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if len(clientRequestID) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("clientRequestId", autorest.String(clientRequestID))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client SoftwareUpdateConfigurationRunsClient) ListSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client SoftwareUpdateConfigurationRunsClient) ListResponder(resp *http.Response) (result SoftwareUpdateConfigurationRunListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/softwareupdateconfigurations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/softwareupdateconfigurations.go new file mode 100644 index 000000000..881683dc7 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/softwareupdateconfigurations.go @@ -0,0 +1,379 @@ +package automation + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// SoftwareUpdateConfigurationsClient is the automation Client +type SoftwareUpdateConfigurationsClient struct { + BaseClient +} + +// NewSoftwareUpdateConfigurationsClient creates an instance of the SoftwareUpdateConfigurationsClient client. +func NewSoftwareUpdateConfigurationsClient(subscriptionID string) SoftwareUpdateConfigurationsClient { + return NewSoftwareUpdateConfigurationsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewSoftwareUpdateConfigurationsClientWithBaseURI creates an instance of the SoftwareUpdateConfigurationsClient +// client. +func NewSoftwareUpdateConfigurationsClientWithBaseURI(baseURI string, subscriptionID string) SoftwareUpdateConfigurationsClient { + return SoftwareUpdateConfigurationsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Create create a new software update configuration with the name given in the URI. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// softwareUpdateConfigurationName - the name of the software update configuration to be created. +// parameters - request body. +// clientRequestID - identifies this specific client request. +func (client SoftwareUpdateConfigurationsClient) Create(ctx context.Context, resourceGroupName string, automationAccountName string, softwareUpdateConfigurationName string, parameters SoftwareUpdateConfiguration, clientRequestID string) (result SoftwareUpdateConfiguration, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.SoftwareUpdateConfigurationProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.SoftwareUpdateConfigurationProperties.UpdateConfiguration", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.SoftwareUpdateConfigurationProperties.ScheduleInfo", Name: validation.Null, Rule: true, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("automation.SoftwareUpdateConfigurationsClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, resourceGroupName, automationAccountName, softwareUpdateConfigurationName, parameters, clientRequestID) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SoftwareUpdateConfigurationsClient", "Create", nil, "Failure preparing request") + return + } + + resp, err := client.CreateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.SoftwareUpdateConfigurationsClient", "Create", resp, "Failure sending request") + return + } + + result, err = client.CreateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SoftwareUpdateConfigurationsClient", "Create", resp, "Failure responding to request") + } + + return +} + +// CreatePreparer prepares the Create request. +func (client SoftwareUpdateConfigurationsClient) CreatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, softwareUpdateConfigurationName string, parameters SoftwareUpdateConfiguration, clientRequestID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "softwareUpdateConfigurationName": autorest.Encode("path", softwareUpdateConfigurationName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-05-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/softwareUpdateConfigurations/{softwareUpdateConfigurationName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + if len(clientRequestID) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("clientRequestId", autorest.String(clientRequestID))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client SoftwareUpdateConfigurationsClient) CreateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client SoftwareUpdateConfigurationsClient) CreateResponder(resp *http.Response) (result SoftwareUpdateConfiguration, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete delete a specific software update configuration. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// softwareUpdateConfigurationName - the name of the software update configuration to be created. +// clientRequestID - identifies this specific client request. +func (client SoftwareUpdateConfigurationsClient) Delete(ctx context.Context, resourceGroupName string, automationAccountName string, softwareUpdateConfigurationName string, clientRequestID string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.SoftwareUpdateConfigurationsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, automationAccountName, softwareUpdateConfigurationName, clientRequestID) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SoftwareUpdateConfigurationsClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "automation.SoftwareUpdateConfigurationsClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SoftwareUpdateConfigurationsClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client SoftwareUpdateConfigurationsClient) DeletePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, softwareUpdateConfigurationName string, clientRequestID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "softwareUpdateConfigurationName": autorest.Encode("path", softwareUpdateConfigurationName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-05-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/softwareUpdateConfigurations/{softwareUpdateConfigurationName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if len(clientRequestID) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("clientRequestId", autorest.String(clientRequestID))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client SoftwareUpdateConfigurationsClient) DeleteSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client SoftwareUpdateConfigurationsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// GetByName get a single software update configuration by name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// softwareUpdateConfigurationName - the name of the software update configuration to be created. +// clientRequestID - identifies this specific client request. +func (client SoftwareUpdateConfigurationsClient) GetByName(ctx context.Context, resourceGroupName string, automationAccountName string, softwareUpdateConfigurationName string, clientRequestID string) (result SoftwareUpdateConfiguration, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.SoftwareUpdateConfigurationsClient", "GetByName", err.Error()) + } + + req, err := client.GetByNamePreparer(ctx, resourceGroupName, automationAccountName, softwareUpdateConfigurationName, clientRequestID) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SoftwareUpdateConfigurationsClient", "GetByName", nil, "Failure preparing request") + return + } + + resp, err := client.GetByNameSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.SoftwareUpdateConfigurationsClient", "GetByName", resp, "Failure sending request") + return + } + + result, err = client.GetByNameResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SoftwareUpdateConfigurationsClient", "GetByName", resp, "Failure responding to request") + } + + return +} + +// GetByNamePreparer prepares the GetByName request. +func (client SoftwareUpdateConfigurationsClient) GetByNamePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, softwareUpdateConfigurationName string, clientRequestID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "softwareUpdateConfigurationName": autorest.Encode("path", softwareUpdateConfigurationName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-05-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/softwareUpdateConfigurations/{softwareUpdateConfigurationName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if len(clientRequestID) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("clientRequestId", autorest.String(clientRequestID))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetByNameSender sends the GetByName request. The method will close the +// http.Response Body if it receives an error. +func (client SoftwareUpdateConfigurationsClient) GetByNameSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetByNameResponder handles the response to the GetByName request. The method always +// closes the http.Response Body. +func (client SoftwareUpdateConfigurationsClient) GetByNameResponder(resp *http.Response) (result SoftwareUpdateConfiguration, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List get all software update configurations for the account. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// clientRequestID - identifies this specific client request. +// filter - the filter to apply on the operation. +func (client SoftwareUpdateConfigurationsClient) List(ctx context.Context, resourceGroupName string, automationAccountName string, clientRequestID string, filter string) (result SoftwareUpdateConfigurationListResult, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.SoftwareUpdateConfigurationsClient", "List", err.Error()) + } + + req, err := client.ListPreparer(ctx, resourceGroupName, automationAccountName, clientRequestID, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SoftwareUpdateConfigurationsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.SoftwareUpdateConfigurationsClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SoftwareUpdateConfigurationsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client SoftwareUpdateConfigurationsClient) ListPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, clientRequestID string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-05-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/softwareUpdateConfigurations", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if len(clientRequestID) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("clientRequestId", autorest.String(clientRequestID))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client SoftwareUpdateConfigurationsClient) ListSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client SoftwareUpdateConfigurationsClient) ListResponder(resp *http.Response) (result SoftwareUpdateConfigurationListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/sourcecontrol.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/sourcecontrol.go new file mode 100644 index 000000000..68b7b10c0 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/sourcecontrol.go @@ -0,0 +1,474 @@ +package automation + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// SourceControlClient is the automation Client +type SourceControlClient struct { + BaseClient +} + +// NewSourceControlClient creates an instance of the SourceControlClient client. +func NewSourceControlClient(subscriptionID string) SourceControlClient { + return NewSourceControlClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewSourceControlClientWithBaseURI creates an instance of the SourceControlClient client. +func NewSourceControlClientWithBaseURI(baseURI string, subscriptionID string) SourceControlClient { + return SourceControlClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate create a source control. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// sourceControlName - the source control name. +// parameters - the parameters supplied to the create or update source control operation. +func (client SourceControlClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, automationAccountName string, sourceControlName string, parameters SourceControlCreateOrUpdateParameters) (result SourceControl, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.SourceControlCreateOrUpdateProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.SourceControlCreateOrUpdateProperties.RepoURL", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.SourceControlCreateOrUpdateProperties.RepoURL", Name: validation.MaxLength, Rule: 2000, Chain: nil}}}, + {Target: "parameters.SourceControlCreateOrUpdateProperties.Branch", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.SourceControlCreateOrUpdateProperties.Branch", Name: validation.MaxLength, Rule: 255, Chain: nil}}}, + {Target: "parameters.SourceControlCreateOrUpdateProperties.FolderPath", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.SourceControlCreateOrUpdateProperties.FolderPath", Name: validation.MaxLength, Rule: 255, Chain: nil}}}, + {Target: "parameters.SourceControlCreateOrUpdateProperties.SecurityToken", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.SourceControlCreateOrUpdateProperties.SecurityToken", Name: validation.MaxLength, Rule: 1024, Chain: nil}}}, + {Target: "parameters.SourceControlCreateOrUpdateProperties.Description", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.SourceControlCreateOrUpdateProperties.Description", Name: validation.MaxLength, Rule: 512, Chain: nil}}}, + }}}}}); err != nil { + return result, validation.NewError("automation.SourceControlClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, automationAccountName, sourceControlName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SourceControlClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.SourceControlClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SourceControlClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client SourceControlClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, sourceControlName string, parameters SourceControlCreateOrUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "sourceControlName": autorest.Encode("path", sourceControlName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-05-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/sourceControls/{sourceControlName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client SourceControlClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client SourceControlClient) CreateOrUpdateResponder(resp *http.Response) (result SourceControl, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete delete the source control. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// sourceControlName - the name of source control. +func (client SourceControlClient) Delete(ctx context.Context, resourceGroupName string, automationAccountName string, sourceControlName string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.SourceControlClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, automationAccountName, sourceControlName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SourceControlClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "automation.SourceControlClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SourceControlClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client SourceControlClient) DeletePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, sourceControlName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "sourceControlName": autorest.Encode("path", sourceControlName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-05-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/sourceControls/{sourceControlName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client SourceControlClient) DeleteSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client SourceControlClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get retrieve the source control identified by source control name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// sourceControlName - the name of source control. +func (client SourceControlClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, sourceControlName string) (result SourceControl, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.SourceControlClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, sourceControlName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SourceControlClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.SourceControlClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SourceControlClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client SourceControlClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, sourceControlName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "sourceControlName": autorest.Encode("path", sourceControlName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-05-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/sourceControls/{sourceControlName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client SourceControlClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client SourceControlClient) GetResponder(resp *http.Response) (result SourceControl, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByAutomationAccount retrieve a list of source controls. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// filter - the filter to apply on the operation. +func (client SourceControlClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (result SourceControlListResultPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.SourceControlClient", "ListByAutomationAccount", err.Error()) + } + + result.fn = client.listByAutomationAccountNextResults + req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SourceControlClient", "ListByAutomationAccount", nil, "Failure preparing request") + return + } + + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.sclr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.SourceControlClient", "ListByAutomationAccount", resp, "Failure sending request") + return + } + + result.sclr, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SourceControlClient", "ListByAutomationAccount", resp, "Failure responding to request") + } + + return +} + +// ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. +func (client SourceControlClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-05-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/sourceControls", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByAutomationAccountSender sends the ListByAutomationAccount request. The method will close the +// http.Response Body if it receives an error. +func (client SourceControlClient) ListByAutomationAccountSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByAutomationAccountResponder handles the response to the ListByAutomationAccount request. The method always +// closes the http.Response Body. +func (client SourceControlClient) ListByAutomationAccountResponder(resp *http.Response) (result SourceControlListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByAutomationAccountNextResults retrieves the next set of results, if any. +func (client SourceControlClient) listByAutomationAccountNextResults(lastResults SourceControlListResult) (result SourceControlListResult, err error) { + req, err := lastResults.sourceControlListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "automation.SourceControlClient", "listByAutomationAccountNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "automation.SourceControlClient", "listByAutomationAccountNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SourceControlClient", "listByAutomationAccountNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByAutomationAccountComplete enumerates all values, automatically crossing page boundaries as required. +func (client SourceControlClient) ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (result SourceControlListResultIterator, err error) { + result.page, err = client.ListByAutomationAccount(ctx, resourceGroupName, automationAccountName, filter) + return +} + +// Update update a source control. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// sourceControlName - the source control name. +// parameters - the parameters supplied to the update source control operation. +func (client SourceControlClient) Update(ctx context.Context, resourceGroupName string, automationAccountName string, sourceControlName string, parameters SourceControlUpdateParameters) (result SourceControl, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.SourceControlClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, automationAccountName, sourceControlName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SourceControlClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.SourceControlClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SourceControlClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client SourceControlClient) UpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, sourceControlName string, parameters SourceControlUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "sourceControlName": autorest.Encode("path", sourceControlName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-05-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/sourceControls/{sourceControlName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client SourceControlClient) UpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client SourceControlClient) UpdateResponder(resp *http.Response) (result SourceControl, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/sourcecontrolsyncjob.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/sourcecontrolsyncjob.go new file mode 100644 index 000000000..42dab933c --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/sourcecontrolsyncjob.go @@ -0,0 +1,314 @@ +package automation + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/satori/go.uuid" + "net/http" +) + +// SourceControlSyncJobClient is the automation Client +type SourceControlSyncJobClient struct { + BaseClient +} + +// NewSourceControlSyncJobClient creates an instance of the SourceControlSyncJobClient client. +func NewSourceControlSyncJobClient(subscriptionID string) SourceControlSyncJobClient { + return NewSourceControlSyncJobClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewSourceControlSyncJobClientWithBaseURI creates an instance of the SourceControlSyncJobClient client. +func NewSourceControlSyncJobClientWithBaseURI(baseURI string, subscriptionID string) SourceControlSyncJobClient { + return SourceControlSyncJobClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Create creates the sync job for a source control. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// sourceControlName - the source control name. +// sourceControlSyncJobID - the source control sync job id. +// parameters - the parameters supplied to the create source control sync job operation. +func (client SourceControlSyncJobClient) Create(ctx context.Context, resourceGroupName string, automationAccountName string, sourceControlName string, sourceControlSyncJobID uuid.UUID, parameters SourceControlSyncJobCreateParameters) (result SourceControlSyncJob, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.SourceControlSyncJobCreateProperties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.SourceControlSyncJobClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, resourceGroupName, automationAccountName, sourceControlName, sourceControlSyncJobID, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SourceControlSyncJobClient", "Create", nil, "Failure preparing request") + return + } + + resp, err := client.CreateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.SourceControlSyncJobClient", "Create", resp, "Failure sending request") + return + } + + result, err = client.CreateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SourceControlSyncJobClient", "Create", resp, "Failure responding to request") + } + + return +} + +// CreatePreparer prepares the Create request. +func (client SourceControlSyncJobClient) CreatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, sourceControlName string, sourceControlSyncJobID uuid.UUID, parameters SourceControlSyncJobCreateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "sourceControlName": autorest.Encode("path", sourceControlName), + "sourceControlSyncJobId": autorest.Encode("path", sourceControlSyncJobID), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-05-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/sourceControls/{sourceControlName}/sourceControlSyncJobs/{sourceControlSyncJobId}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client SourceControlSyncJobClient) CreateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client SourceControlSyncJobClient) CreateResponder(resp *http.Response) (result SourceControlSyncJob, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get retrieve the source control sync job identified by job id. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// sourceControlName - the source control name. +// sourceControlSyncJobID - the source control sync job id. +func (client SourceControlSyncJobClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, sourceControlName string, sourceControlSyncJobID uuid.UUID) (result SourceControlSyncJobByID, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.SourceControlSyncJobClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, sourceControlName, sourceControlSyncJobID) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SourceControlSyncJobClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.SourceControlSyncJobClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SourceControlSyncJobClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client SourceControlSyncJobClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, sourceControlName string, sourceControlSyncJobID uuid.UUID) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "sourceControlName": autorest.Encode("path", sourceControlName), + "sourceControlSyncJobId": autorest.Encode("path", sourceControlSyncJobID), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-05-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/sourceControls/{sourceControlName}/sourceControlSyncJobs/{sourceControlSyncJobId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client SourceControlSyncJobClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client SourceControlSyncJobClient) GetResponder(resp *http.Response) (result SourceControlSyncJobByID, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByAutomationAccount retrieve a list of source control sync jobs. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// sourceControlName - the source control name. +// filter - the filter to apply on the operation. +func (client SourceControlSyncJobClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string, sourceControlName string, filter string) (result SourceControlSyncJobListResultPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.SourceControlSyncJobClient", "ListByAutomationAccount", err.Error()) + } + + result.fn = client.listByAutomationAccountNextResults + req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName, sourceControlName, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SourceControlSyncJobClient", "ListByAutomationAccount", nil, "Failure preparing request") + return + } + + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.scsjlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.SourceControlSyncJobClient", "ListByAutomationAccount", resp, "Failure sending request") + return + } + + result.scsjlr, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SourceControlSyncJobClient", "ListByAutomationAccount", resp, "Failure responding to request") + } + + return +} + +// ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. +func (client SourceControlSyncJobClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, sourceControlName string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "sourceControlName": autorest.Encode("path", sourceControlName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-05-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/sourceControls/{sourceControlName}/sourceControlSyncJobs", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByAutomationAccountSender sends the ListByAutomationAccount request. The method will close the +// http.Response Body if it receives an error. +func (client SourceControlSyncJobClient) ListByAutomationAccountSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByAutomationAccountResponder handles the response to the ListByAutomationAccount request. The method always +// closes the http.Response Body. +func (client SourceControlSyncJobClient) ListByAutomationAccountResponder(resp *http.Response) (result SourceControlSyncJobListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByAutomationAccountNextResults retrieves the next set of results, if any. +func (client SourceControlSyncJobClient) listByAutomationAccountNextResults(lastResults SourceControlSyncJobListResult) (result SourceControlSyncJobListResult, err error) { + req, err := lastResults.sourceControlSyncJobListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "automation.SourceControlSyncJobClient", "listByAutomationAccountNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "automation.SourceControlSyncJobClient", "listByAutomationAccountNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SourceControlSyncJobClient", "listByAutomationAccountNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByAutomationAccountComplete enumerates all values, automatically crossing page boundaries as required. +func (client SourceControlSyncJobClient) ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string, sourceControlName string, filter string) (result SourceControlSyncJobListResultIterator, err error) { + result.page, err = client.ListByAutomationAccount(ctx, resourceGroupName, automationAccountName, sourceControlName, filter) + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/sourcecontrolsyncjobstreams.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/sourcecontrolsyncjobstreams.go new file mode 100644 index 000000000..00ce3d696 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/sourcecontrolsyncjobstreams.go @@ -0,0 +1,234 @@ +package automation + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/satori/go.uuid" + "net/http" +) + +// SourceControlSyncJobStreamsClient is the automation Client +type SourceControlSyncJobStreamsClient struct { + BaseClient +} + +// NewSourceControlSyncJobStreamsClient creates an instance of the SourceControlSyncJobStreamsClient client. +func NewSourceControlSyncJobStreamsClient(subscriptionID string) SourceControlSyncJobStreamsClient { + return NewSourceControlSyncJobStreamsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewSourceControlSyncJobStreamsClientWithBaseURI creates an instance of the SourceControlSyncJobStreamsClient client. +func NewSourceControlSyncJobStreamsClientWithBaseURI(baseURI string, subscriptionID string) SourceControlSyncJobStreamsClient { + return SourceControlSyncJobStreamsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get retrieve a sync job stream identified by stream id. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// sourceControlName - the source control name. +// sourceControlSyncJobID - the source control sync job id. +// streamID - the id of the sync job stream. +func (client SourceControlSyncJobStreamsClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, sourceControlName string, sourceControlSyncJobID uuid.UUID, streamID string) (result SourceControlSyncJobStreamByID, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.SourceControlSyncJobStreamsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, sourceControlName, sourceControlSyncJobID, streamID) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SourceControlSyncJobStreamsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.SourceControlSyncJobStreamsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SourceControlSyncJobStreamsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client SourceControlSyncJobStreamsClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, sourceControlName string, sourceControlSyncJobID uuid.UUID, streamID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "sourceControlName": autorest.Encode("path", sourceControlName), + "sourceControlSyncJobId": autorest.Encode("path", sourceControlSyncJobID), + "streamId": autorest.Encode("path", streamID), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-05-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/sourceControls/{sourceControlName}/sourceControlSyncJobs/{sourceControlSyncJobId}/streams/{streamId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client SourceControlSyncJobStreamsClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client SourceControlSyncJobStreamsClient) GetResponder(resp *http.Response) (result SourceControlSyncJobStreamByID, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListBySyncJob retrieve a list of sync job streams identified by sync job id. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// sourceControlName - the source control name. +// sourceControlSyncJobID - the source control sync job id. +// filter - the filter to apply on the operation. +func (client SourceControlSyncJobStreamsClient) ListBySyncJob(ctx context.Context, resourceGroupName string, automationAccountName string, sourceControlName string, sourceControlSyncJobID uuid.UUID, filter string) (result SourceControlSyncJobStreamsListBySyncJobPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.SourceControlSyncJobStreamsClient", "ListBySyncJob", err.Error()) + } + + result.fn = client.listBySyncJobNextResults + req, err := client.ListBySyncJobPreparer(ctx, resourceGroupName, automationAccountName, sourceControlName, sourceControlSyncJobID, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SourceControlSyncJobStreamsClient", "ListBySyncJob", nil, "Failure preparing request") + return + } + + resp, err := client.ListBySyncJobSender(req) + if err != nil { + result.scsjslbsj.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.SourceControlSyncJobStreamsClient", "ListBySyncJob", resp, "Failure sending request") + return + } + + result.scsjslbsj, err = client.ListBySyncJobResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SourceControlSyncJobStreamsClient", "ListBySyncJob", resp, "Failure responding to request") + } + + return +} + +// ListBySyncJobPreparer prepares the ListBySyncJob request. +func (client SourceControlSyncJobStreamsClient) ListBySyncJobPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, sourceControlName string, sourceControlSyncJobID uuid.UUID, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "sourceControlName": autorest.Encode("path", sourceControlName), + "sourceControlSyncJobId": autorest.Encode("path", sourceControlSyncJobID), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-05-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/sourceControls/{sourceControlName}/sourceControlSyncJobs/{sourceControlSyncJobId}/streams", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListBySyncJobSender sends the ListBySyncJob request. The method will close the +// http.Response Body if it receives an error. +func (client SourceControlSyncJobStreamsClient) ListBySyncJobSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListBySyncJobResponder handles the response to the ListBySyncJob request. The method always +// closes the http.Response Body. +func (client SourceControlSyncJobStreamsClient) ListBySyncJobResponder(resp *http.Response) (result SourceControlSyncJobStreamsListBySyncJob, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listBySyncJobNextResults retrieves the next set of results, if any. +func (client SourceControlSyncJobStreamsClient) listBySyncJobNextResults(lastResults SourceControlSyncJobStreamsListBySyncJob) (result SourceControlSyncJobStreamsListBySyncJob, err error) { + req, err := lastResults.sourceControlSyncJobStreamsListBySyncJobPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "automation.SourceControlSyncJobStreamsClient", "listBySyncJobNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListBySyncJobSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "automation.SourceControlSyncJobStreamsClient", "listBySyncJobNextResults", resp, "Failure sending next results request") + } + result, err = client.ListBySyncJobResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SourceControlSyncJobStreamsClient", "listBySyncJobNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListBySyncJobComplete enumerates all values, automatically crossing page boundaries as required. +func (client SourceControlSyncJobStreamsClient) ListBySyncJobComplete(ctx context.Context, resourceGroupName string, automationAccountName string, sourceControlName string, sourceControlSyncJobID uuid.UUID, filter string) (result SourceControlSyncJobStreamsListBySyncJobIterator, err error) { + result.page, err = client.ListBySyncJob(ctx, resourceGroupName, automationAccountName, sourceControlName, sourceControlSyncJobID, filter) + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/statistics.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/statistics.go new file mode 100644 index 000000000..94c03fd22 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/statistics.go @@ -0,0 +1,120 @@ +package automation + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// StatisticsClient is the automation Client +type StatisticsClient struct { + BaseClient +} + +// NewStatisticsClient creates an instance of the StatisticsClient client. +func NewStatisticsClient(subscriptionID string) StatisticsClient { + return NewStatisticsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewStatisticsClientWithBaseURI creates an instance of the StatisticsClient client. +func NewStatisticsClientWithBaseURI(baseURI string, subscriptionID string) StatisticsClient { + return StatisticsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// ListByAutomationAccount retrieve the statistics for the account. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// filter - the filter to apply on the operation. +func (client StatisticsClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (result StatisticsListResult, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.StatisticsClient", "ListByAutomationAccount", err.Error()) + } + + req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.StatisticsClient", "ListByAutomationAccount", nil, "Failure preparing request") + return + } + + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.StatisticsClient", "ListByAutomationAccount", resp, "Failure sending request") + return + } + + result, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.StatisticsClient", "ListByAutomationAccount", resp, "Failure responding to request") + } + + return +} + +// ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. +func (client StatisticsClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/statistics", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByAutomationAccountSender sends the ListByAutomationAccount request. The method will close the +// http.Response Body if it receives an error. +func (client StatisticsClient) ListByAutomationAccountSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByAutomationAccountResponder handles the response to the ListByAutomationAccount request. The method always +// closes the http.Response Body. +func (client StatisticsClient) ListByAutomationAccountResponder(resp *http.Response) (result StatisticsListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/testjob.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/testjob.go new file mode 100644 index 000000000..38da3d182 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/testjob.go @@ -0,0 +1,426 @@ +package automation + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// TestJobClient is the automation Client +type TestJobClient struct { + BaseClient +} + +// NewTestJobClient creates an instance of the TestJobClient client. +func NewTestJobClient(subscriptionID string) TestJobClient { + return NewTestJobClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewTestJobClientWithBaseURI creates an instance of the TestJobClient client. +func NewTestJobClientWithBaseURI(baseURI string, subscriptionID string) TestJobClient { + return TestJobClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Create create a test job of the runbook. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// runbookName - the parameters supplied to the create test job operation. +// parameters - the parameters supplied to the create test job operation. +func (client TestJobClient) Create(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string, parameters TestJobCreateParameters) (result TestJob, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.TestJobClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, resourceGroupName, automationAccountName, runbookName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.TestJobClient", "Create", nil, "Failure preparing request") + return + } + + resp, err := client.CreateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.TestJobClient", "Create", resp, "Failure sending request") + return + } + + result, err = client.CreateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.TestJobClient", "Create", resp, "Failure responding to request") + } + + return +} + +// CreatePreparer prepares the Create request. +func (client TestJobClient) CreatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string, parameters TestJobCreateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "runbookName": autorest.Encode("path", runbookName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/testJob", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client TestJobClient) CreateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client TestJobClient) CreateResponder(resp *http.Response) (result TestJob, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get retrieve the test job for the specified runbook. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// runbookName - the runbook name. +func (client TestJobClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (result TestJob, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.TestJobClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, runbookName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.TestJobClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.TestJobClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.TestJobClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client TestJobClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "runbookName": autorest.Encode("path", runbookName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/testJob", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client TestJobClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client TestJobClient) GetResponder(resp *http.Response) (result TestJob, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Resume resume the test job. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// runbookName - the runbook name. +func (client TestJobClient) Resume(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.TestJobClient", "Resume", err.Error()) + } + + req, err := client.ResumePreparer(ctx, resourceGroupName, automationAccountName, runbookName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.TestJobClient", "Resume", nil, "Failure preparing request") + return + } + + resp, err := client.ResumeSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "automation.TestJobClient", "Resume", resp, "Failure sending request") + return + } + + result, err = client.ResumeResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.TestJobClient", "Resume", resp, "Failure responding to request") + } + + return +} + +// ResumePreparer prepares the Resume request. +func (client TestJobClient) ResumePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "runbookName": autorest.Encode("path", runbookName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/testJob/resume", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ResumeSender sends the Resume request. The method will close the +// http.Response Body if it receives an error. +func (client TestJobClient) ResumeSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ResumeResponder handles the response to the Resume request. The method always +// closes the http.Response Body. +func (client TestJobClient) ResumeResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Stop stop the test job. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// runbookName - the runbook name. +func (client TestJobClient) Stop(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.TestJobClient", "Stop", err.Error()) + } + + req, err := client.StopPreparer(ctx, resourceGroupName, automationAccountName, runbookName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.TestJobClient", "Stop", nil, "Failure preparing request") + return + } + + resp, err := client.StopSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "automation.TestJobClient", "Stop", resp, "Failure sending request") + return + } + + result, err = client.StopResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.TestJobClient", "Stop", resp, "Failure responding to request") + } + + return +} + +// StopPreparer prepares the Stop request. +func (client TestJobClient) StopPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "runbookName": autorest.Encode("path", runbookName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/testJob/stop", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// StopSender sends the Stop request. The method will close the +// http.Response Body if it receives an error. +func (client TestJobClient) StopSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// StopResponder handles the response to the Stop request. The method always +// closes the http.Response Body. +func (client TestJobClient) StopResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Suspend suspend the test job. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// runbookName - the runbook name. +func (client TestJobClient) Suspend(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.TestJobClient", "Suspend", err.Error()) + } + + req, err := client.SuspendPreparer(ctx, resourceGroupName, automationAccountName, runbookName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.TestJobClient", "Suspend", nil, "Failure preparing request") + return + } + + resp, err := client.SuspendSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "automation.TestJobClient", "Suspend", resp, "Failure sending request") + return + } + + result, err = client.SuspendResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.TestJobClient", "Suspend", resp, "Failure responding to request") + } + + return +} + +// SuspendPreparer prepares the Suspend request. +func (client TestJobClient) SuspendPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "runbookName": autorest.Encode("path", runbookName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/testJob/suspend", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// SuspendSender sends the Suspend request. The method will close the +// http.Response Body if it receives an error. +func (client TestJobClient) SuspendSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// SuspendResponder handles the response to the Suspend request. The method always +// closes the http.Response Body. +func (client TestJobClient) SuspendResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/testjobstreams.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/testjobstreams.go new file mode 100644 index 000000000..3e6219040 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/testjobstreams.go @@ -0,0 +1,229 @@ +package automation + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// TestJobStreamsClient is the automation Client +type TestJobStreamsClient struct { + BaseClient +} + +// NewTestJobStreamsClient creates an instance of the TestJobStreamsClient client. +func NewTestJobStreamsClient(subscriptionID string) TestJobStreamsClient { + return NewTestJobStreamsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewTestJobStreamsClientWithBaseURI creates an instance of the TestJobStreamsClient client. +func NewTestJobStreamsClientWithBaseURI(baseURI string, subscriptionID string) TestJobStreamsClient { + return TestJobStreamsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get retrieve a test job stream of the test job identified by runbook name and stream id. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// runbookName - the runbook name. +// jobStreamID - the job stream id. +func (client TestJobStreamsClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string, jobStreamID string) (result JobStream, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.TestJobStreamsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, runbookName, jobStreamID) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.TestJobStreamsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.TestJobStreamsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.TestJobStreamsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client TestJobStreamsClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string, jobStreamID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "jobStreamId": autorest.Encode("path", jobStreamID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "runbookName": autorest.Encode("path", runbookName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/testJob/streams/{jobStreamId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client TestJobStreamsClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client TestJobStreamsClient) GetResponder(resp *http.Response) (result JobStream, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByTestJob retrieve a list of test job streams identified by runbook name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// runbookName - the runbook name. +// filter - the filter to apply on the operation. +func (client TestJobStreamsClient) ListByTestJob(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string, filter string) (result JobStreamListResultPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.TestJobStreamsClient", "ListByTestJob", err.Error()) + } + + result.fn = client.listByTestJobNextResults + req, err := client.ListByTestJobPreparer(ctx, resourceGroupName, automationAccountName, runbookName, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.TestJobStreamsClient", "ListByTestJob", nil, "Failure preparing request") + return + } + + resp, err := client.ListByTestJobSender(req) + if err != nil { + result.jslr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.TestJobStreamsClient", "ListByTestJob", resp, "Failure sending request") + return + } + + result.jslr, err = client.ListByTestJobResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.TestJobStreamsClient", "ListByTestJob", resp, "Failure responding to request") + } + + return +} + +// ListByTestJobPreparer prepares the ListByTestJob request. +func (client TestJobStreamsClient) ListByTestJobPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "runbookName": autorest.Encode("path", runbookName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/testJob/streams", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByTestJobSender sends the ListByTestJob request. The method will close the +// http.Response Body if it receives an error. +func (client TestJobStreamsClient) ListByTestJobSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByTestJobResponder handles the response to the ListByTestJob request. The method always +// closes the http.Response Body. +func (client TestJobStreamsClient) ListByTestJobResponder(resp *http.Response) (result JobStreamListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByTestJobNextResults retrieves the next set of results, if any. +func (client TestJobStreamsClient) listByTestJobNextResults(lastResults JobStreamListResult) (result JobStreamListResult, err error) { + req, err := lastResults.jobStreamListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "automation.TestJobStreamsClient", "listByTestJobNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByTestJobSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "automation.TestJobStreamsClient", "listByTestJobNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByTestJobResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.TestJobStreamsClient", "listByTestJobNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByTestJobComplete enumerates all values, automatically crossing page boundaries as required. +func (client TestJobStreamsClient) ListByTestJobComplete(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string, filter string) (result JobStreamListResultIterator, err error) { + result.page, err = client.ListByTestJob(ctx, resourceGroupName, automationAccountName, runbookName, filter) + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/usages.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/usages.go new file mode 100644 index 000000000..39f4e6b68 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/usages.go @@ -0,0 +1,116 @@ +package automation + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// UsagesClient is the automation Client +type UsagesClient struct { + BaseClient +} + +// NewUsagesClient creates an instance of the UsagesClient client. +func NewUsagesClient(subscriptionID string) UsagesClient { + return NewUsagesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewUsagesClientWithBaseURI creates an instance of the UsagesClient client. +func NewUsagesClientWithBaseURI(baseURI string, subscriptionID string) UsagesClient { + return UsagesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// ListByAutomationAccount retrieve the usage for the account id. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +func (client UsagesClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string) (result UsageListResult, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.UsagesClient", "ListByAutomationAccount", err.Error()) + } + + req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.UsagesClient", "ListByAutomationAccount", nil, "Failure preparing request") + return + } + + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.UsagesClient", "ListByAutomationAccount", resp, "Failure sending request") + return + } + + result, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.UsagesClient", "ListByAutomationAccount", resp, "Failure responding to request") + } + + return +} + +// ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. +func (client UsagesClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/usages", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByAutomationAccountSender sends the ListByAutomationAccount request. The method will close the +// http.Response Body if it receives an error. +func (client UsagesClient) ListByAutomationAccountSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByAutomationAccountResponder handles the response to the ListByAutomationAccount request. The method always +// closes the http.Response Body. +func (client UsagesClient) ListByAutomationAccountResponder(resp *http.Response) (result UsageListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/variable.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/variable.go new file mode 100644 index 000000000..df53908db --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/variable.go @@ -0,0 +1,460 @@ +package automation + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// VariableClient is the automation Client +type VariableClient struct { + BaseClient +} + +// NewVariableClient creates an instance of the VariableClient client. +func NewVariableClient(subscriptionID string) VariableClient { + return NewVariableClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewVariableClientWithBaseURI creates an instance of the VariableClient client. +func NewVariableClientWithBaseURI(baseURI string, subscriptionID string) VariableClient { + return VariableClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate create a variable. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// variableName - the variable name. +// parameters - the parameters supplied to the create or update variable operation. +func (client VariableClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, automationAccountName string, variableName string, parameters VariableCreateOrUpdateParameters) (result Variable, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.Name", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.VariableCreateOrUpdateProperties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.VariableClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, automationAccountName, variableName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.VariableClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.VariableClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.VariableClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client VariableClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, variableName string, parameters VariableCreateOrUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "variableName": autorest.Encode("path", variableName), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/variables/{variableName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client VariableClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client VariableClient) CreateOrUpdateResponder(resp *http.Response) (result Variable, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete delete the variable. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// variableName - the name of variable. +func (client VariableClient) Delete(ctx context.Context, resourceGroupName string, automationAccountName string, variableName string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.VariableClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, automationAccountName, variableName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.VariableClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "automation.VariableClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.VariableClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client VariableClient) DeletePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, variableName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "variableName": autorest.Encode("path", variableName), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/variables/{variableName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client VariableClient) DeleteSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client VariableClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get retrieve the variable identified by variable name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// variableName - the name of variable. +func (client VariableClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, variableName string) (result Variable, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.VariableClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, variableName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.VariableClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.VariableClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.VariableClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client VariableClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, variableName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "variableName": autorest.Encode("path", variableName), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/variables/{variableName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client VariableClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client VariableClient) GetResponder(resp *http.Response) (result Variable, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByAutomationAccount retrieve a list of variables. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +func (client VariableClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string) (result VariableListResultPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.VariableClient", "ListByAutomationAccount", err.Error()) + } + + result.fn = client.listByAutomationAccountNextResults + req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.VariableClient", "ListByAutomationAccount", nil, "Failure preparing request") + return + } + + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.vlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.VariableClient", "ListByAutomationAccount", resp, "Failure sending request") + return + } + + result.vlr, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.VariableClient", "ListByAutomationAccount", resp, "Failure responding to request") + } + + return +} + +// ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. +func (client VariableClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/variables", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByAutomationAccountSender sends the ListByAutomationAccount request. The method will close the +// http.Response Body if it receives an error. +func (client VariableClient) ListByAutomationAccountSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByAutomationAccountResponder handles the response to the ListByAutomationAccount request. The method always +// closes the http.Response Body. +func (client VariableClient) ListByAutomationAccountResponder(resp *http.Response) (result VariableListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByAutomationAccountNextResults retrieves the next set of results, if any. +func (client VariableClient) listByAutomationAccountNextResults(lastResults VariableListResult) (result VariableListResult, err error) { + req, err := lastResults.variableListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "automation.VariableClient", "listByAutomationAccountNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "automation.VariableClient", "listByAutomationAccountNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.VariableClient", "listByAutomationAccountNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByAutomationAccountComplete enumerates all values, automatically crossing page boundaries as required. +func (client VariableClient) ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string) (result VariableListResultIterator, err error) { + result.page, err = client.ListByAutomationAccount(ctx, resourceGroupName, automationAccountName) + return +} + +// Update update a variable. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// variableName - the variable name. +// parameters - the parameters supplied to the update variable operation. +func (client VariableClient) Update(ctx context.Context, resourceGroupName string, automationAccountName string, variableName string, parameters VariableUpdateParameters) (result Variable, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.VariableClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, automationAccountName, variableName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.VariableClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.VariableClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.VariableClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client VariableClient) UpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, variableName string, parameters VariableUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "variableName": autorest.Encode("path", variableName), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/variables/{variableName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client VariableClient) UpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client VariableClient) UpdateResponder(resp *http.Response) (result Variable, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/version.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/version.go new file mode 100644 index 000000000..e2fa1c4c5 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/version.go @@ -0,0 +1,30 @@ +package automation + +import "github.com/Azure/azure-sdk-for-go/version" + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// UserAgent returns the UserAgent string to use when sending http.Requests. +func UserAgent() string { + return "Azure-SDK-For-Go/" + version.Number + " automation/2017-05-15-preview" +} + +// Version returns the semantic version (see http://semver.org) of the client. +func Version() string { + return version.Number +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/webhook.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/webhook.go new file mode 100644 index 000000000..186ab20e4 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation/webhook.go @@ -0,0 +1,539 @@ +package automation + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// WebhookClient is the automation Client +type WebhookClient struct { + BaseClient +} + +// NewWebhookClient creates an instance of the WebhookClient client. +func NewWebhookClient(subscriptionID string) WebhookClient { + return NewWebhookClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewWebhookClientWithBaseURI creates an instance of the WebhookClient client. +func NewWebhookClientWithBaseURI(baseURI string, subscriptionID string) WebhookClient { + return WebhookClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate create the webhook identified by webhook name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// webhookName - the webhook name. +// parameters - the create or update parameters for webhook. +func (client WebhookClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, automationAccountName string, webhookName string, parameters WebhookCreateOrUpdateParameters) (result Webhook, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.Name", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.WebhookCreateOrUpdateProperties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.WebhookClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, automationAccountName, webhookName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.WebhookClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.WebhookClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.WebhookClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client WebhookClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, webhookName string, parameters WebhookCreateOrUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "webhookName": autorest.Encode("path", webhookName), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/webhooks/{webhookName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client WebhookClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client WebhookClient) CreateOrUpdateResponder(resp *http.Response) (result Webhook, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete delete the webhook by name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// webhookName - the webhook name. +func (client WebhookClient) Delete(ctx context.Context, resourceGroupName string, automationAccountName string, webhookName string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.WebhookClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, automationAccountName, webhookName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.WebhookClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "automation.WebhookClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.WebhookClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client WebhookClient) DeletePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, webhookName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "webhookName": autorest.Encode("path", webhookName), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/webhooks/{webhookName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client WebhookClient) DeleteSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client WebhookClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// GenerateURI generates a Uri for use in creating a webhook. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +func (client WebhookClient) GenerateURI(ctx context.Context, resourceGroupName string, automationAccountName string) (result String, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.WebhookClient", "GenerateURI", err.Error()) + } + + req, err := client.GenerateURIPreparer(ctx, resourceGroupName, automationAccountName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.WebhookClient", "GenerateURI", nil, "Failure preparing request") + return + } + + resp, err := client.GenerateURISender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.WebhookClient", "GenerateURI", resp, "Failure sending request") + return + } + + result, err = client.GenerateURIResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.WebhookClient", "GenerateURI", resp, "Failure responding to request") + } + + return +} + +// GenerateURIPreparer prepares the GenerateURI request. +func (client WebhookClient) GenerateURIPreparer(ctx context.Context, resourceGroupName string, automationAccountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/webhooks/generateUri", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GenerateURISender sends the GenerateURI request. The method will close the +// http.Response Body if it receives an error. +func (client WebhookClient) GenerateURISender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GenerateURIResponder handles the response to the GenerateURI request. The method always +// closes the http.Response Body. +func (client WebhookClient) GenerateURIResponder(resp *http.Response) (result String, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get retrieve the webhook identified by webhook name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// webhookName - the webhook name. +func (client WebhookClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, webhookName string) (result Webhook, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.WebhookClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, webhookName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.WebhookClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.WebhookClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.WebhookClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client WebhookClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, webhookName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "webhookName": autorest.Encode("path", webhookName), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/webhooks/{webhookName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client WebhookClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client WebhookClient) GetResponder(resp *http.Response) (result Webhook, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByAutomationAccount retrieve a list of webhooks. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// filter - the filter to apply on the operation. +func (client WebhookClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (result WebhookListResultPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.WebhookClient", "ListByAutomationAccount", err.Error()) + } + + result.fn = client.listByAutomationAccountNextResults + req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.WebhookClient", "ListByAutomationAccount", nil, "Failure preparing request") + return + } + + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.wlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.WebhookClient", "ListByAutomationAccount", resp, "Failure sending request") + return + } + + result.wlr, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.WebhookClient", "ListByAutomationAccount", resp, "Failure responding to request") + } + + return +} + +// ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. +func (client WebhookClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/webhooks", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByAutomationAccountSender sends the ListByAutomationAccount request. The method will close the +// http.Response Body if it receives an error. +func (client WebhookClient) ListByAutomationAccountSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByAutomationAccountResponder handles the response to the ListByAutomationAccount request. The method always +// closes the http.Response Body. +func (client WebhookClient) ListByAutomationAccountResponder(resp *http.Response) (result WebhookListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByAutomationAccountNextResults retrieves the next set of results, if any. +func (client WebhookClient) listByAutomationAccountNextResults(lastResults WebhookListResult) (result WebhookListResult, err error) { + req, err := lastResults.webhookListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "automation.WebhookClient", "listByAutomationAccountNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "automation.WebhookClient", "listByAutomationAccountNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.WebhookClient", "listByAutomationAccountNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByAutomationAccountComplete enumerates all values, automatically crossing page boundaries as required. +func (client WebhookClient) ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (result WebhookListResultIterator, err error) { + result.page, err = client.ListByAutomationAccount(ctx, resourceGroupName, automationAccountName, filter) + return +} + +// Update update the webhook identified by webhook name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// webhookName - the webhook name. +// parameters - the update parameters for webhook. +func (client WebhookClient) Update(ctx context.Context, resourceGroupName string, automationAccountName string, webhookName string, parameters WebhookUpdateParameters) (result Webhook, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.WebhookClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, automationAccountName, webhookName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.WebhookClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.WebhookClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.WebhookClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client WebhookClient) UpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, webhookName string, parameters WebhookUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "webhookName": autorest.Encode("path", webhookName), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/webhooks/{webhookName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client WebhookClient) UpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client WebhookClient) UpdateResponder(resp *http.Response) (result Webhook, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/account.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/account.go new file mode 100644 index 000000000..ca92a9118 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/account.go @@ -0,0 +1,537 @@ +package automation + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// AccountClient is the automation Client +type AccountClient struct { + BaseClient +} + +// NewAccountClient creates an instance of the AccountClient client. +func NewAccountClient(subscriptionID string, countType1 CountType) AccountClient { + return NewAccountClientWithBaseURI(DefaultBaseURI, subscriptionID, countType1) +} + +// NewAccountClientWithBaseURI creates an instance of the AccountClient client. +func NewAccountClientWithBaseURI(baseURI string, subscriptionID string, countType1 CountType) AccountClient { + return AccountClient{NewWithBaseURI(baseURI, subscriptionID, countType1)} +} + +// CreateOrUpdate create or update automation account. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// parameters - parameters supplied to the create or update automation account. +func (client AccountClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, automationAccountName string, parameters AccountCreateOrUpdateParameters) (result Account, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.AccountClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, automationAccountName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.AccountClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.AccountClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.AccountClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client AccountClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, parameters AccountCreateOrUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client AccountClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client AccountClient) CreateOrUpdateResponder(resp *http.Response) (result Account, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete delete an automation account. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +func (client AccountClient) Delete(ctx context.Context, resourceGroupName string, automationAccountName string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.AccountClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, automationAccountName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.AccountClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "automation.AccountClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.AccountClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client AccountClient) DeletePreparer(ctx context.Context, resourceGroupName string, automationAccountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client AccountClient) DeleteSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client AccountClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get get information about an Automation Account. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +func (client AccountClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string) (result Account, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.AccountClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.AccountClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.AccountClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.AccountClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client AccountClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client AccountClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client AccountClient) GetResponder(resp *http.Response) (result Account, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List retrieve a list of accounts within a given subscription. +func (client AccountClient) List(ctx context.Context) (result AccountListResultPage, err error) { + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.AccountClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.alr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.AccountClient", "List", resp, "Failure sending request") + return + } + + result.alr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.AccountClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client AccountClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Automation/automationAccounts", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client AccountClient) ListSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client AccountClient) ListResponder(resp *http.Response) (result AccountListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client AccountClient) listNextResults(lastResults AccountListResult) (result AccountListResult, err error) { + req, err := lastResults.accountListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "automation.AccountClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "automation.AccountClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.AccountClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client AccountClient) ListComplete(ctx context.Context) (result AccountListResultIterator, err error) { + result.page, err = client.List(ctx) + return +} + +// ListByResourceGroup retrieve a list of accounts within a given resource group. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +func (client AccountClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result AccountListResultPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.AccountClient", "ListByResourceGroup", err.Error()) + } + + result.fn = client.listByResourceGroupNextResults + req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.AccountClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.alr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.AccountClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result.alr, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.AccountClient", "ListByResourceGroup", resp, "Failure responding to request") + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client AccountClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the +// http.Response Body if it receives an error. +func (client AccountClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always +// closes the http.Response Body. +func (client AccountClient) ListByResourceGroupResponder(resp *http.Response) (result AccountListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByResourceGroupNextResults retrieves the next set of results, if any. +func (client AccountClient) listByResourceGroupNextResults(lastResults AccountListResult) (result AccountListResult, err error) { + req, err := lastResults.accountListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "automation.AccountClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "automation.AccountClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.AccountClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client AccountClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result AccountListResultIterator, err error) { + result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) + return +} + +// Update update an automation account. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// parameters - parameters supplied to the update automation account. +func (client AccountClient) Update(ctx context.Context, resourceGroupName string, automationAccountName string, parameters AccountUpdateParameters) (result Account, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.AccountClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, automationAccountName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.AccountClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.AccountClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.AccountClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client AccountClient) UpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, parameters AccountUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client AccountClient) UpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client AccountClient) UpdateResponder(resp *http.Response) (result Account, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/activity.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/activity.go new file mode 100644 index 000000000..e81a3d901 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/activity.go @@ -0,0 +1,225 @@ +package automation + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// ActivityClient is the automation Client +type ActivityClient struct { + BaseClient +} + +// NewActivityClient creates an instance of the ActivityClient client. +func NewActivityClient(subscriptionID string, countType1 CountType) ActivityClient { + return NewActivityClientWithBaseURI(DefaultBaseURI, subscriptionID, countType1) +} + +// NewActivityClientWithBaseURI creates an instance of the ActivityClient client. +func NewActivityClientWithBaseURI(baseURI string, subscriptionID string, countType1 CountType) ActivityClient { + return ActivityClient{NewWithBaseURI(baseURI, subscriptionID, countType1)} +} + +// Get retrieve the activity in the module identified by module name and activity name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// moduleName - the name of module. +// activityName - the name of activity. +func (client ActivityClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, moduleName string, activityName string) (result Activity, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.ActivityClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, moduleName, activityName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ActivityClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.ActivityClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ActivityClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client ActivityClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, moduleName string, activityName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "activityName": autorest.Encode("path", activityName), + "automationAccountName": autorest.Encode("path", automationAccountName), + "moduleName": autorest.Encode("path", moduleName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/modules/{moduleName}/activities/{activityName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ActivityClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ActivityClient) GetResponder(resp *http.Response) (result Activity, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByModule retrieve a list of activities in the module identified by module name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// moduleName - the name of module. +func (client ActivityClient) ListByModule(ctx context.Context, resourceGroupName string, automationAccountName string, moduleName string) (result ActivityListResultPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.ActivityClient", "ListByModule", err.Error()) + } + + result.fn = client.listByModuleNextResults + req, err := client.ListByModulePreparer(ctx, resourceGroupName, automationAccountName, moduleName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ActivityClient", "ListByModule", nil, "Failure preparing request") + return + } + + resp, err := client.ListByModuleSender(req) + if err != nil { + result.alr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.ActivityClient", "ListByModule", resp, "Failure sending request") + return + } + + result.alr, err = client.ListByModuleResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ActivityClient", "ListByModule", resp, "Failure responding to request") + } + + return +} + +// ListByModulePreparer prepares the ListByModule request. +func (client ActivityClient) ListByModulePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, moduleName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "moduleName": autorest.Encode("path", moduleName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/modules/{moduleName}/activities", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByModuleSender sends the ListByModule request. The method will close the +// http.Response Body if it receives an error. +func (client ActivityClient) ListByModuleSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByModuleResponder handles the response to the ListByModule request. The method always +// closes the http.Response Body. +func (client ActivityClient) ListByModuleResponder(resp *http.Response) (result ActivityListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByModuleNextResults retrieves the next set of results, if any. +func (client ActivityClient) listByModuleNextResults(lastResults ActivityListResult) (result ActivityListResult, err error) { + req, err := lastResults.activityListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "automation.ActivityClient", "listByModuleNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByModuleSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "automation.ActivityClient", "listByModuleNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByModuleResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ActivityClient", "listByModuleNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByModuleComplete enumerates all values, automatically crossing page boundaries as required. +func (client ActivityClient) ListByModuleComplete(ctx context.Context, resourceGroupName string, automationAccountName string, moduleName string) (result ActivityListResultIterator, err error) { + result.page, err = client.ListByModule(ctx, resourceGroupName, automationAccountName, moduleName) + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/agentregistrationinformation.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/agentregistrationinformation.go new file mode 100644 index 000000000..02d73956c --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/agentregistrationinformation.go @@ -0,0 +1,195 @@ +package automation + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// AgentRegistrationInformationClient is the automation Client +type AgentRegistrationInformationClient struct { + BaseClient +} + +// NewAgentRegistrationInformationClient creates an instance of the AgentRegistrationInformationClient client. +func NewAgentRegistrationInformationClient(subscriptionID string, countType1 CountType) AgentRegistrationInformationClient { + return NewAgentRegistrationInformationClientWithBaseURI(DefaultBaseURI, subscriptionID, countType1) +} + +// NewAgentRegistrationInformationClientWithBaseURI creates an instance of the AgentRegistrationInformationClient +// client. +func NewAgentRegistrationInformationClientWithBaseURI(baseURI string, subscriptionID string, countType1 CountType) AgentRegistrationInformationClient { + return AgentRegistrationInformationClient{NewWithBaseURI(baseURI, subscriptionID, countType1)} +} + +// Get retrieve the automation agent registration information. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +func (client AgentRegistrationInformationClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string) (result AgentRegistration, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.AgentRegistrationInformationClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.AgentRegistrationInformationClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.AgentRegistrationInformationClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.AgentRegistrationInformationClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client AgentRegistrationInformationClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-01-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/agentRegistrationInformation", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client AgentRegistrationInformationClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client AgentRegistrationInformationClient) GetResponder(resp *http.Response) (result AgentRegistration, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// RegenerateKey regenerate a primary or secondary agent registration key +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// parameters - the name of the agent registration key to be regenerated +func (client AgentRegistrationInformationClient) RegenerateKey(ctx context.Context, resourceGroupName string, automationAccountName string, parameters AgentRegistrationRegenerateKeyParameter) (result AgentRegistration, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.AgentRegistrationInformationClient", "RegenerateKey", err.Error()) + } + + req, err := client.RegenerateKeyPreparer(ctx, resourceGroupName, automationAccountName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.AgentRegistrationInformationClient", "RegenerateKey", nil, "Failure preparing request") + return + } + + resp, err := client.RegenerateKeySender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.AgentRegistrationInformationClient", "RegenerateKey", resp, "Failure sending request") + return + } + + result, err = client.RegenerateKeyResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.AgentRegistrationInformationClient", "RegenerateKey", resp, "Failure responding to request") + } + + return +} + +// RegenerateKeyPreparer prepares the RegenerateKey request. +func (client AgentRegistrationInformationClient) RegenerateKeyPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, parameters AgentRegistrationRegenerateKeyParameter) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-01-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/agentRegistrationInformation/regenerateKey", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RegenerateKeySender sends the RegenerateKey request. The method will close the +// http.Response Body if it receives an error. +func (client AgentRegistrationInformationClient) RegenerateKeySender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// RegenerateKeyResponder handles the response to the RegenerateKey request. The method always +// closes the http.Response Body. +func (client AgentRegistrationInformationClient) RegenerateKeyResponder(resp *http.Response) (result AgentRegistration, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/certificate.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/certificate.go new file mode 100644 index 000000000..d0124ad01 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/certificate.go @@ -0,0 +1,461 @@ +package automation + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// CertificateClient is the automation Client +type CertificateClient struct { + BaseClient +} + +// NewCertificateClient creates an instance of the CertificateClient client. +func NewCertificateClient(subscriptionID string, countType1 CountType) CertificateClient { + return NewCertificateClientWithBaseURI(DefaultBaseURI, subscriptionID, countType1) +} + +// NewCertificateClientWithBaseURI creates an instance of the CertificateClient client. +func NewCertificateClientWithBaseURI(baseURI string, subscriptionID string, countType1 CountType) CertificateClient { + return CertificateClient{NewWithBaseURI(baseURI, subscriptionID, countType1)} +} + +// CreateOrUpdate create a certificate. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// certificateName - the parameters supplied to the create or update certificate operation. +// parameters - the parameters supplied to the create or update certificate operation. +func (client CertificateClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, automationAccountName string, certificateName string, parameters CertificateCreateOrUpdateParameters) (result Certificate, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.Name", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.CertificateCreateOrUpdateProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.CertificateCreateOrUpdateProperties.Base64Value", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("automation.CertificateClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, automationAccountName, certificateName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.CertificateClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.CertificateClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.CertificateClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client CertificateClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, certificateName string, parameters CertificateCreateOrUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "certificateName": autorest.Encode("path", certificateName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/certificates/{certificateName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client CertificateClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client CertificateClient) CreateOrUpdateResponder(resp *http.Response) (result Certificate, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete delete the certificate. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// certificateName - the name of certificate. +func (client CertificateClient) Delete(ctx context.Context, resourceGroupName string, automationAccountName string, certificateName string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.CertificateClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, automationAccountName, certificateName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.CertificateClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "automation.CertificateClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.CertificateClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client CertificateClient) DeletePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, certificateName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "certificateName": autorest.Encode("path", certificateName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/certificates/{certificateName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client CertificateClient) DeleteSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client CertificateClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get retrieve the certificate identified by certificate name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// certificateName - the name of certificate. +func (client CertificateClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, certificateName string) (result Certificate, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.CertificateClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, certificateName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.CertificateClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.CertificateClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.CertificateClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client CertificateClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, certificateName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "certificateName": autorest.Encode("path", certificateName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/certificates/{certificateName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client CertificateClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client CertificateClient) GetResponder(resp *http.Response) (result Certificate, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByAutomationAccount retrieve a list of certificates. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +func (client CertificateClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string) (result CertificateListResultPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.CertificateClient", "ListByAutomationAccount", err.Error()) + } + + result.fn = client.listByAutomationAccountNextResults + req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.CertificateClient", "ListByAutomationAccount", nil, "Failure preparing request") + return + } + + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.clr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.CertificateClient", "ListByAutomationAccount", resp, "Failure sending request") + return + } + + result.clr, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.CertificateClient", "ListByAutomationAccount", resp, "Failure responding to request") + } + + return +} + +// ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. +func (client CertificateClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/certificates", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByAutomationAccountSender sends the ListByAutomationAccount request. The method will close the +// http.Response Body if it receives an error. +func (client CertificateClient) ListByAutomationAccountSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByAutomationAccountResponder handles the response to the ListByAutomationAccount request. The method always +// closes the http.Response Body. +func (client CertificateClient) ListByAutomationAccountResponder(resp *http.Response) (result CertificateListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByAutomationAccountNextResults retrieves the next set of results, if any. +func (client CertificateClient) listByAutomationAccountNextResults(lastResults CertificateListResult) (result CertificateListResult, err error) { + req, err := lastResults.certificateListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "automation.CertificateClient", "listByAutomationAccountNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "automation.CertificateClient", "listByAutomationAccountNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.CertificateClient", "listByAutomationAccountNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByAutomationAccountComplete enumerates all values, automatically crossing page boundaries as required. +func (client CertificateClient) ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string) (result CertificateListResultIterator, err error) { + result.page, err = client.ListByAutomationAccount(ctx, resourceGroupName, automationAccountName) + return +} + +// Update update a certificate. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// certificateName - the parameters supplied to the update certificate operation. +// parameters - the parameters supplied to the update certificate operation. +func (client CertificateClient) Update(ctx context.Context, resourceGroupName string, automationAccountName string, certificateName string, parameters CertificateUpdateParameters) (result Certificate, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.CertificateClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, automationAccountName, certificateName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.CertificateClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.CertificateClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.CertificateClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client CertificateClient) UpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, certificateName string, parameters CertificateUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "certificateName": autorest.Encode("path", certificateName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/certificates/{certificateName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client CertificateClient) UpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client CertificateClient) UpdateResponder(resp *http.Response) (result Certificate, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/client.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/client.go new file mode 100644 index 000000000..35ec8db36 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/client.go @@ -0,0 +1,53 @@ +// Package automation implements the Azure ARM Automation service API version . +// +// Automation Client +package automation + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/Azure/go-autorest/autorest" +) + +const ( + // DefaultBaseURI is the default URI used for the service Automation + DefaultBaseURI = "https://management.azure.com" +) + +// BaseClient is the base client for Automation. +type BaseClient struct { + autorest.Client + BaseURI string + SubscriptionID string + CountType1 CountType +} + +// New creates an instance of the BaseClient client. +func New(subscriptionID string, countType1 CountType) BaseClient { + return NewWithBaseURI(DefaultBaseURI, subscriptionID, countType1) +} + +// NewWithBaseURI creates an instance of the BaseClient client. +func NewWithBaseURI(baseURI string, subscriptionID string, countType1 CountType) BaseClient { + return BaseClient{ + Client: autorest.NewClientWithUserAgent(UserAgent()), + BaseURI: baseURI, + SubscriptionID: subscriptionID, + CountType1: countType1, + } +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/connection.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/connection.go new file mode 100644 index 000000000..34ebae556 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/connection.go @@ -0,0 +1,462 @@ +package automation + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// ConnectionClient is the automation Client +type ConnectionClient struct { + BaseClient +} + +// NewConnectionClient creates an instance of the ConnectionClient client. +func NewConnectionClient(subscriptionID string, countType1 CountType) ConnectionClient { + return NewConnectionClientWithBaseURI(DefaultBaseURI, subscriptionID, countType1) +} + +// NewConnectionClientWithBaseURI creates an instance of the ConnectionClient client. +func NewConnectionClientWithBaseURI(baseURI string, subscriptionID string, countType1 CountType) ConnectionClient { + return ConnectionClient{NewWithBaseURI(baseURI, subscriptionID, countType1)} +} + +// CreateOrUpdate create or update a connection. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// connectionName - the parameters supplied to the create or update connection operation. +// parameters - the parameters supplied to the create or update connection operation. +func (client ConnectionClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, automationAccountName string, connectionName string, parameters ConnectionCreateOrUpdateParameters) (result Connection, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.Name", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.ConnectionCreateOrUpdateProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.ConnectionCreateOrUpdateProperties.ConnectionType", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("automation.ConnectionClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, automationAccountName, connectionName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ConnectionClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.ConnectionClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ConnectionClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client ConnectionClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, connectionName string, parameters ConnectionCreateOrUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "connectionName": autorest.Encode("path", connectionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/connections/{connectionName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client ConnectionClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client ConnectionClient) CreateOrUpdateResponder(resp *http.Response) (result Connection, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete delete the connection. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// connectionName - the name of connection. +func (client ConnectionClient) Delete(ctx context.Context, resourceGroupName string, automationAccountName string, connectionName string) (result Connection, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.ConnectionClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, automationAccountName, connectionName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ConnectionClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.ConnectionClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ConnectionClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ConnectionClient) DeletePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, connectionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "connectionName": autorest.Encode("path", connectionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/connections/{connectionName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ConnectionClient) DeleteSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ConnectionClient) DeleteResponder(resp *http.Response) (result Connection, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get retrieve the connection identified by connection name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// connectionName - the name of connection. +func (client ConnectionClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, connectionName string) (result Connection, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.ConnectionClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, connectionName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ConnectionClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.ConnectionClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ConnectionClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client ConnectionClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, connectionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "connectionName": autorest.Encode("path", connectionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/connections/{connectionName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ConnectionClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ConnectionClient) GetResponder(resp *http.Response) (result Connection, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByAutomationAccount retrieve a list of connections. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +func (client ConnectionClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string) (result ConnectionListResultPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.ConnectionClient", "ListByAutomationAccount", err.Error()) + } + + result.fn = client.listByAutomationAccountNextResults + req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ConnectionClient", "ListByAutomationAccount", nil, "Failure preparing request") + return + } + + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.clr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.ConnectionClient", "ListByAutomationAccount", resp, "Failure sending request") + return + } + + result.clr, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ConnectionClient", "ListByAutomationAccount", resp, "Failure responding to request") + } + + return +} + +// ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. +func (client ConnectionClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/connections", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByAutomationAccountSender sends the ListByAutomationAccount request. The method will close the +// http.Response Body if it receives an error. +func (client ConnectionClient) ListByAutomationAccountSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByAutomationAccountResponder handles the response to the ListByAutomationAccount request. The method always +// closes the http.Response Body. +func (client ConnectionClient) ListByAutomationAccountResponder(resp *http.Response) (result ConnectionListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByAutomationAccountNextResults retrieves the next set of results, if any. +func (client ConnectionClient) listByAutomationAccountNextResults(lastResults ConnectionListResult) (result ConnectionListResult, err error) { + req, err := lastResults.connectionListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "automation.ConnectionClient", "listByAutomationAccountNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "automation.ConnectionClient", "listByAutomationAccountNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ConnectionClient", "listByAutomationAccountNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByAutomationAccountComplete enumerates all values, automatically crossing page boundaries as required. +func (client ConnectionClient) ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string) (result ConnectionListResultIterator, err error) { + result.page, err = client.ListByAutomationAccount(ctx, resourceGroupName, automationAccountName) + return +} + +// Update update a connection. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// connectionName - the parameters supplied to the update a connection operation. +// parameters - the parameters supplied to the update a connection operation. +func (client ConnectionClient) Update(ctx context.Context, resourceGroupName string, automationAccountName string, connectionName string, parameters ConnectionUpdateParameters) (result Connection, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.ConnectionClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, automationAccountName, connectionName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ConnectionClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.ConnectionClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ConnectionClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client ConnectionClient) UpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, connectionName string, parameters ConnectionUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "connectionName": autorest.Encode("path", connectionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/connections/{connectionName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client ConnectionClient) UpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client ConnectionClient) UpdateResponder(resp *http.Response) (result Connection, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/connectiontype.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/connectiontype.go new file mode 100644 index 000000000..d4277e164 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/connectiontype.go @@ -0,0 +1,381 @@ +package automation + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// ConnectionTypeClient is the automation Client +type ConnectionTypeClient struct { + BaseClient +} + +// NewConnectionTypeClient creates an instance of the ConnectionTypeClient client. +func NewConnectionTypeClient(subscriptionID string, countType1 CountType) ConnectionTypeClient { + return NewConnectionTypeClientWithBaseURI(DefaultBaseURI, subscriptionID, countType1) +} + +// NewConnectionTypeClientWithBaseURI creates an instance of the ConnectionTypeClient client. +func NewConnectionTypeClientWithBaseURI(baseURI string, subscriptionID string, countType1 CountType) ConnectionTypeClient { + return ConnectionTypeClient{NewWithBaseURI(baseURI, subscriptionID, countType1)} +} + +// CreateOrUpdate create a connectiontype. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// connectionTypeName - the parameters supplied to the create or update connectiontype operation. +// parameters - the parameters supplied to the create or update connectiontype operation. +func (client ConnectionTypeClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, automationAccountName string, connectionTypeName string, parameters ConnectionTypeCreateOrUpdateParameters) (result ConnectionType, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.Name", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.ConnectionTypeCreateOrUpdateProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.ConnectionTypeCreateOrUpdateProperties.FieldDefinitions", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("automation.ConnectionTypeClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, automationAccountName, connectionTypeName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ConnectionTypeClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.ConnectionTypeClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ConnectionTypeClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client ConnectionTypeClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, connectionTypeName string, parameters ConnectionTypeCreateOrUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "connectionTypeName": autorest.Encode("path", connectionTypeName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/connectionTypes/{connectionTypeName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client ConnectionTypeClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client ConnectionTypeClient) CreateOrUpdateResponder(resp *http.Response) (result ConnectionType, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusConflict), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete delete the connectiontype. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// connectionTypeName - the name of connectiontype. +func (client ConnectionTypeClient) Delete(ctx context.Context, resourceGroupName string, automationAccountName string, connectionTypeName string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.ConnectionTypeClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, automationAccountName, connectionTypeName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ConnectionTypeClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "automation.ConnectionTypeClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ConnectionTypeClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ConnectionTypeClient) DeletePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, connectionTypeName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "connectionTypeName": autorest.Encode("path", connectionTypeName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/connectionTypes/{connectionTypeName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ConnectionTypeClient) DeleteSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ConnectionTypeClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get retrieve the connectiontype identified by connectiontype name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// connectionTypeName - the name of connectiontype. +func (client ConnectionTypeClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, connectionTypeName string) (result ConnectionType, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.ConnectionTypeClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, connectionTypeName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ConnectionTypeClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.ConnectionTypeClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ConnectionTypeClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client ConnectionTypeClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, connectionTypeName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "connectionTypeName": autorest.Encode("path", connectionTypeName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/connectionTypes/{connectionTypeName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ConnectionTypeClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ConnectionTypeClient) GetResponder(resp *http.Response) (result ConnectionType, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByAutomationAccount retrieve a list of connectiontypes. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +func (client ConnectionTypeClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string) (result ConnectionTypeListResultPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.ConnectionTypeClient", "ListByAutomationAccount", err.Error()) + } + + result.fn = client.listByAutomationAccountNextResults + req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ConnectionTypeClient", "ListByAutomationAccount", nil, "Failure preparing request") + return + } + + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.ctlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.ConnectionTypeClient", "ListByAutomationAccount", resp, "Failure sending request") + return + } + + result.ctlr, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ConnectionTypeClient", "ListByAutomationAccount", resp, "Failure responding to request") + } + + return +} + +// ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. +func (client ConnectionTypeClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/connectionTypes", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByAutomationAccountSender sends the ListByAutomationAccount request. The method will close the +// http.Response Body if it receives an error. +func (client ConnectionTypeClient) ListByAutomationAccountSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByAutomationAccountResponder handles the response to the ListByAutomationAccount request. The method always +// closes the http.Response Body. +func (client ConnectionTypeClient) ListByAutomationAccountResponder(resp *http.Response) (result ConnectionTypeListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByAutomationAccountNextResults retrieves the next set of results, if any. +func (client ConnectionTypeClient) listByAutomationAccountNextResults(lastResults ConnectionTypeListResult) (result ConnectionTypeListResult, err error) { + req, err := lastResults.connectionTypeListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "automation.ConnectionTypeClient", "listByAutomationAccountNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "automation.ConnectionTypeClient", "listByAutomationAccountNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ConnectionTypeClient", "listByAutomationAccountNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByAutomationAccountComplete enumerates all values, automatically crossing page boundaries as required. +func (client ConnectionTypeClient) ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string) (result ConnectionTypeListResultIterator, err error) { + result.page, err = client.ListByAutomationAccount(ctx, resourceGroupName, automationAccountName) + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/credential.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/credential.go new file mode 100644 index 000000000..ae5410ab9 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/credential.go @@ -0,0 +1,463 @@ +package automation + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// CredentialClient is the automation Client +type CredentialClient struct { + BaseClient +} + +// NewCredentialClient creates an instance of the CredentialClient client. +func NewCredentialClient(subscriptionID string, countType1 CountType) CredentialClient { + return NewCredentialClientWithBaseURI(DefaultBaseURI, subscriptionID, countType1) +} + +// NewCredentialClientWithBaseURI creates an instance of the CredentialClient client. +func NewCredentialClientWithBaseURI(baseURI string, subscriptionID string, countType1 CountType) CredentialClient { + return CredentialClient{NewWithBaseURI(baseURI, subscriptionID, countType1)} +} + +// CreateOrUpdate create a credential. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// credentialName - the parameters supplied to the create or update credential operation. +// parameters - the parameters supplied to the create or update credential operation. +func (client CredentialClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, automationAccountName string, credentialName string, parameters CredentialCreateOrUpdateParameters) (result Credential, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.Name", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.CredentialCreateOrUpdateProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.CredentialCreateOrUpdateProperties.UserName", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.CredentialCreateOrUpdateProperties.Password", Name: validation.Null, Rule: true, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("automation.CredentialClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, automationAccountName, credentialName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.CredentialClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.CredentialClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.CredentialClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client CredentialClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, credentialName string, parameters CredentialCreateOrUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "credentialName": autorest.Encode("path", credentialName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/credentials/{credentialName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client CredentialClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client CredentialClient) CreateOrUpdateResponder(resp *http.Response) (result Credential, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete delete the credential. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// credentialName - the name of credential. +func (client CredentialClient) Delete(ctx context.Context, resourceGroupName string, automationAccountName string, credentialName string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.CredentialClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, automationAccountName, credentialName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.CredentialClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "automation.CredentialClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.CredentialClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client CredentialClient) DeletePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, credentialName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "credentialName": autorest.Encode("path", credentialName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/credentials/{credentialName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client CredentialClient) DeleteSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client CredentialClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get retrieve the credential identified by credential name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// credentialName - the name of credential. +func (client CredentialClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, credentialName string) (result Credential, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.CredentialClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, credentialName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.CredentialClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.CredentialClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.CredentialClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client CredentialClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, credentialName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "credentialName": autorest.Encode("path", credentialName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/credentials/{credentialName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client CredentialClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client CredentialClient) GetResponder(resp *http.Response) (result Credential, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByAutomationAccount retrieve a list of credentials. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +func (client CredentialClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string) (result CredentialListResultPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.CredentialClient", "ListByAutomationAccount", err.Error()) + } + + result.fn = client.listByAutomationAccountNextResults + req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.CredentialClient", "ListByAutomationAccount", nil, "Failure preparing request") + return + } + + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.clr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.CredentialClient", "ListByAutomationAccount", resp, "Failure sending request") + return + } + + result.clr, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.CredentialClient", "ListByAutomationAccount", resp, "Failure responding to request") + } + + return +} + +// ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. +func (client CredentialClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/credentials", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByAutomationAccountSender sends the ListByAutomationAccount request. The method will close the +// http.Response Body if it receives an error. +func (client CredentialClient) ListByAutomationAccountSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByAutomationAccountResponder handles the response to the ListByAutomationAccount request. The method always +// closes the http.Response Body. +func (client CredentialClient) ListByAutomationAccountResponder(resp *http.Response) (result CredentialListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByAutomationAccountNextResults retrieves the next set of results, if any. +func (client CredentialClient) listByAutomationAccountNextResults(lastResults CredentialListResult) (result CredentialListResult, err error) { + req, err := lastResults.credentialListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "automation.CredentialClient", "listByAutomationAccountNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "automation.CredentialClient", "listByAutomationAccountNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.CredentialClient", "listByAutomationAccountNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByAutomationAccountComplete enumerates all values, automatically crossing page boundaries as required. +func (client CredentialClient) ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string) (result CredentialListResultIterator, err error) { + result.page, err = client.ListByAutomationAccount(ctx, resourceGroupName, automationAccountName) + return +} + +// Update update a credential. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// credentialName - the parameters supplied to the Update credential operation. +// parameters - the parameters supplied to the Update credential operation. +func (client CredentialClient) Update(ctx context.Context, resourceGroupName string, automationAccountName string, credentialName string, parameters CredentialUpdateParameters) (result Credential, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.CredentialClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, automationAccountName, credentialName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.CredentialClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.CredentialClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.CredentialClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client CredentialClient) UpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, credentialName string, parameters CredentialUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "credentialName": autorest.Encode("path", credentialName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/credentials/{credentialName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client CredentialClient) UpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client CredentialClient) UpdateResponder(resp *http.Response) (result Credential, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/dsccompilationjob.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/dsccompilationjob.go new file mode 100644 index 000000000..673577eaa --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/dsccompilationjob.go @@ -0,0 +1,392 @@ +package automation + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/satori/go.uuid" + "net/http" +) + +// DscCompilationJobClient is the automation Client +type DscCompilationJobClient struct { + BaseClient +} + +// NewDscCompilationJobClient creates an instance of the DscCompilationJobClient client. +func NewDscCompilationJobClient(subscriptionID string, countType1 CountType) DscCompilationJobClient { + return NewDscCompilationJobClientWithBaseURI(DefaultBaseURI, subscriptionID, countType1) +} + +// NewDscCompilationJobClientWithBaseURI creates an instance of the DscCompilationJobClient client. +func NewDscCompilationJobClientWithBaseURI(baseURI string, subscriptionID string, countType1 CountType) DscCompilationJobClient { + return DscCompilationJobClient{NewWithBaseURI(baseURI, subscriptionID, countType1)} +} + +// Create creates the Dsc compilation job of the configuration. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// compilationJobName - the the DSC configuration Id. +// parameters - the parameters supplied to the create compilation job operation. +func (client DscCompilationJobClient) Create(ctx context.Context, resourceGroupName string, automationAccountName string, compilationJobName string, parameters DscCompilationJobCreateParameters) (result DscCompilationJobCreateFuture, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.DscCompilationJobCreateProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.DscCompilationJobCreateProperties.Configuration", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("automation.DscCompilationJobClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, resourceGroupName, automationAccountName, compilationJobName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscCompilationJobClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscCompilationJobClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client DscCompilationJobClient) CreatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, compilationJobName string, parameters DscCompilationJobCreateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "compilationJobName": autorest.Encode("path", compilationJobName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-01-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/compilationjobs/{compilationJobName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client DscCompilationJobClient) CreateSender(req *http.Request) (future DscCompilationJobCreateFuture, err error) { + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client DscCompilationJobClient) CreateResponder(resp *http.Response) (result DscCompilationJob, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get retrieve the Dsc configuration compilation job identified by job id. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// compilationJobName - the the DSC configuration Id. +func (client DscCompilationJobClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, compilationJobName string) (result DscCompilationJob, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.DscCompilationJobClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, compilationJobName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscCompilationJobClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.DscCompilationJobClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscCompilationJobClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client DscCompilationJobClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, compilationJobName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "compilationJobName": autorest.Encode("path", compilationJobName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-01-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/compilationjobs/{compilationJobName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client DscCompilationJobClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client DscCompilationJobClient) GetResponder(resp *http.Response) (result DscCompilationJob, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetStream retrieve the job stream identified by job stream id. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// jobID - the job id. +// jobStreamID - the job stream id. +func (client DscCompilationJobClient) GetStream(ctx context.Context, resourceGroupName string, automationAccountName string, jobID uuid.UUID, jobStreamID string) (result JobStream, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.DscCompilationJobClient", "GetStream", err.Error()) + } + + req, err := client.GetStreamPreparer(ctx, resourceGroupName, automationAccountName, jobID, jobStreamID) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscCompilationJobClient", "GetStream", nil, "Failure preparing request") + return + } + + resp, err := client.GetStreamSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.DscCompilationJobClient", "GetStream", resp, "Failure sending request") + return + } + + result, err = client.GetStreamResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscCompilationJobClient", "GetStream", resp, "Failure responding to request") + } + + return +} + +// GetStreamPreparer prepares the GetStream request. +func (client DscCompilationJobClient) GetStreamPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, jobID uuid.UUID, jobStreamID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "jobId": autorest.Encode("path", jobID), + "jobStreamId": autorest.Encode("path", jobStreamID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-01-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/compilationjobs/{jobId}/streams/{jobStreamId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetStreamSender sends the GetStream request. The method will close the +// http.Response Body if it receives an error. +func (client DscCompilationJobClient) GetStreamSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetStreamResponder handles the response to the GetStream request. The method always +// closes the http.Response Body. +func (client DscCompilationJobClient) GetStreamResponder(resp *http.Response) (result JobStream, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByAutomationAccount retrieve a list of dsc compilation jobs. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// filter - the filter to apply on the operation. +func (client DscCompilationJobClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (result DscCompilationJobListResultPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.DscCompilationJobClient", "ListByAutomationAccount", err.Error()) + } + + result.fn = client.listByAutomationAccountNextResults + req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscCompilationJobClient", "ListByAutomationAccount", nil, "Failure preparing request") + return + } + + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.dcjlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.DscCompilationJobClient", "ListByAutomationAccount", resp, "Failure sending request") + return + } + + result.dcjlr, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscCompilationJobClient", "ListByAutomationAccount", resp, "Failure responding to request") + } + + return +} + +// ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. +func (client DscCompilationJobClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-01-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/compilationjobs", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByAutomationAccountSender sends the ListByAutomationAccount request. The method will close the +// http.Response Body if it receives an error. +func (client DscCompilationJobClient) ListByAutomationAccountSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByAutomationAccountResponder handles the response to the ListByAutomationAccount request. The method always +// closes the http.Response Body. +func (client DscCompilationJobClient) ListByAutomationAccountResponder(resp *http.Response) (result DscCompilationJobListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByAutomationAccountNextResults retrieves the next set of results, if any. +func (client DscCompilationJobClient) listByAutomationAccountNextResults(lastResults DscCompilationJobListResult) (result DscCompilationJobListResult, err error) { + req, err := lastResults.dscCompilationJobListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "automation.DscCompilationJobClient", "listByAutomationAccountNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "automation.DscCompilationJobClient", "listByAutomationAccountNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscCompilationJobClient", "listByAutomationAccountNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByAutomationAccountComplete enumerates all values, automatically crossing page boundaries as required. +func (client DscCompilationJobClient) ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (result DscCompilationJobListResultIterator, err error) { + result.page, err = client.ListByAutomationAccount(ctx, resourceGroupName, automationAccountName, filter) + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/dsccompilationjobstream.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/dsccompilationjobstream.go new file mode 100644 index 000000000..19ecbc9d0 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/dsccompilationjobstream.go @@ -0,0 +1,119 @@ +package automation + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/satori/go.uuid" + "net/http" +) + +// DscCompilationJobStreamClient is the automation Client +type DscCompilationJobStreamClient struct { + BaseClient +} + +// NewDscCompilationJobStreamClient creates an instance of the DscCompilationJobStreamClient client. +func NewDscCompilationJobStreamClient(subscriptionID string, countType1 CountType) DscCompilationJobStreamClient { + return NewDscCompilationJobStreamClientWithBaseURI(DefaultBaseURI, subscriptionID, countType1) +} + +// NewDscCompilationJobStreamClientWithBaseURI creates an instance of the DscCompilationJobStreamClient client. +func NewDscCompilationJobStreamClientWithBaseURI(baseURI string, subscriptionID string, countType1 CountType) DscCompilationJobStreamClient { + return DscCompilationJobStreamClient{NewWithBaseURI(baseURI, subscriptionID, countType1)} +} + +// ListByJob retrieve all the job streams for the compilation Job. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// jobID - the job id. +func (client DscCompilationJobStreamClient) ListByJob(ctx context.Context, resourceGroupName string, automationAccountName string, jobID uuid.UUID) (result JobStreamListResult, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.DscCompilationJobStreamClient", "ListByJob", err.Error()) + } + + req, err := client.ListByJobPreparer(ctx, resourceGroupName, automationAccountName, jobID) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscCompilationJobStreamClient", "ListByJob", nil, "Failure preparing request") + return + } + + resp, err := client.ListByJobSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.DscCompilationJobStreamClient", "ListByJob", resp, "Failure sending request") + return + } + + result, err = client.ListByJobResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscCompilationJobStreamClient", "ListByJob", resp, "Failure responding to request") + } + + return +} + +// ListByJobPreparer prepares the ListByJob request. +func (client DscCompilationJobStreamClient) ListByJobPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, jobID uuid.UUID) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "jobId": autorest.Encode("path", jobID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-01-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/compilationjobs/{jobId}/streams", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByJobSender sends the ListByJob request. The method will close the +// http.Response Body if it receives an error. +func (client DscCompilationJobStreamClient) ListByJobSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByJobResponder handles the response to the ListByJob request. The method always +// closes the http.Response Body. +func (client DscCompilationJobStreamClient) ListByJobResponder(resp *http.Response) (result JobStreamListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/dscconfiguration.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/dscconfiguration.go new file mode 100644 index 000000000..fe6935747 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/dscconfiguration.go @@ -0,0 +1,562 @@ +package automation + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// DscConfigurationClient is the automation Client +type DscConfigurationClient struct { + BaseClient +} + +// NewDscConfigurationClient creates an instance of the DscConfigurationClient client. +func NewDscConfigurationClient(subscriptionID string, countType1 CountType) DscConfigurationClient { + return NewDscConfigurationClientWithBaseURI(DefaultBaseURI, subscriptionID, countType1) +} + +// NewDscConfigurationClientWithBaseURI creates an instance of the DscConfigurationClient client. +func NewDscConfigurationClientWithBaseURI(baseURI string, subscriptionID string, countType1 CountType) DscConfigurationClient { + return DscConfigurationClient{NewWithBaseURI(baseURI, subscriptionID, countType1)} +} + +// CreateOrUpdate create the configuration identified by configuration name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// configurationName - the create or update parameters for configuration. +// parameters - the create or update parameters for configuration. +func (client DscConfigurationClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, automationAccountName string, configurationName string, parameters DscConfigurationCreateOrUpdateParameters) (result DscConfiguration, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.DscConfigurationCreateOrUpdateProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.DscConfigurationCreateOrUpdateProperties.Source", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.DscConfigurationCreateOrUpdateProperties.Source.Hash", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.DscConfigurationCreateOrUpdateProperties.Source.Hash.Algorithm", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.DscConfigurationCreateOrUpdateProperties.Source.Hash.Value", Name: validation.Null, Rule: true, Chain: nil}, + }}, + }}, + }}}}}); err != nil { + return result, validation.NewError("automation.DscConfigurationClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, automationAccountName, configurationName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscConfigurationClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.DscConfigurationClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscConfigurationClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client DscConfigurationClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, configurationName string, parameters DscConfigurationCreateOrUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "configurationName": autorest.Encode("path", configurationName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/configurations/{configurationName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client DscConfigurationClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client DscConfigurationClient) CreateOrUpdateResponder(resp *http.Response) (result DscConfiguration, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete delete the dsc configuration identified by configuration name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// configurationName - the configuration name. +func (client DscConfigurationClient) Delete(ctx context.Context, resourceGroupName string, automationAccountName string, configurationName string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.DscConfigurationClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, automationAccountName, configurationName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscConfigurationClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "automation.DscConfigurationClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscConfigurationClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client DscConfigurationClient) DeletePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, configurationName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "configurationName": autorest.Encode("path", configurationName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/configurations/{configurationName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client DscConfigurationClient) DeleteSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client DscConfigurationClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get retrieve the configuration identified by configuration name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// configurationName - the configuration name. +func (client DscConfigurationClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, configurationName string) (result DscConfiguration, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.DscConfigurationClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, configurationName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscConfigurationClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.DscConfigurationClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscConfigurationClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client DscConfigurationClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, configurationName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "configurationName": autorest.Encode("path", configurationName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/configurations/{configurationName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client DscConfigurationClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client DscConfigurationClient) GetResponder(resp *http.Response) (result DscConfiguration, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetContent retrieve the configuration script identified by configuration name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// configurationName - the configuration name. +func (client DscConfigurationClient) GetContent(ctx context.Context, resourceGroupName string, automationAccountName string, configurationName string) (result String, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.DscConfigurationClient", "GetContent", err.Error()) + } + + req, err := client.GetContentPreparer(ctx, resourceGroupName, automationAccountName, configurationName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscConfigurationClient", "GetContent", nil, "Failure preparing request") + return + } + + resp, err := client.GetContentSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.DscConfigurationClient", "GetContent", resp, "Failure sending request") + return + } + + result, err = client.GetContentResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscConfigurationClient", "GetContent", resp, "Failure responding to request") + } + + return +} + +// GetContentPreparer prepares the GetContent request. +func (client DscConfigurationClient) GetContentPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, configurationName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "configurationName": autorest.Encode("path", configurationName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/configurations/{configurationName}/content", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetContentSender sends the GetContent request. The method will close the +// http.Response Body if it receives an error. +func (client DscConfigurationClient) GetContentSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetContentResponder handles the response to the GetContent request. The method always +// closes the http.Response Body. +func (client DscConfigurationClient) GetContentResponder(resp *http.Response) (result String, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByAutomationAccount retrieve a list of configurations. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// filter - the filter to apply on the operation. +// skip - the number of rows to skip. +// top - the the number of rows to take. +// inlinecount - return total rows. +func (client DscConfigurationClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string, filter string, skip *int32, top *int32, inlinecount string) (result DscConfigurationListResultPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.DscConfigurationClient", "ListByAutomationAccount", err.Error()) + } + + result.fn = client.listByAutomationAccountNextResults + req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName, filter, skip, top, inlinecount) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscConfigurationClient", "ListByAutomationAccount", nil, "Failure preparing request") + return + } + + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.dclr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.DscConfigurationClient", "ListByAutomationAccount", resp, "Failure sending request") + return + } + + result.dclr, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscConfigurationClient", "ListByAutomationAccount", resp, "Failure responding to request") + } + + return +} + +// ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. +func (client DscConfigurationClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, filter string, skip *int32, top *int32, inlinecount string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if skip != nil { + queryParameters["$skip"] = autorest.Encode("query", *skip) + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + if len(inlinecount) > 0 { + queryParameters["$inlinecount"] = autorest.Encode("query", inlinecount) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/configurations", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByAutomationAccountSender sends the ListByAutomationAccount request. The method will close the +// http.Response Body if it receives an error. +func (client DscConfigurationClient) ListByAutomationAccountSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByAutomationAccountResponder handles the response to the ListByAutomationAccount request. The method always +// closes the http.Response Body. +func (client DscConfigurationClient) ListByAutomationAccountResponder(resp *http.Response) (result DscConfigurationListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByAutomationAccountNextResults retrieves the next set of results, if any. +func (client DscConfigurationClient) listByAutomationAccountNextResults(lastResults DscConfigurationListResult) (result DscConfigurationListResult, err error) { + req, err := lastResults.dscConfigurationListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "automation.DscConfigurationClient", "listByAutomationAccountNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "automation.DscConfigurationClient", "listByAutomationAccountNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscConfigurationClient", "listByAutomationAccountNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByAutomationAccountComplete enumerates all values, automatically crossing page boundaries as required. +func (client DscConfigurationClient) ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string, filter string, skip *int32, top *int32, inlinecount string) (result DscConfigurationListResultIterator, err error) { + result.page, err = client.ListByAutomationAccount(ctx, resourceGroupName, automationAccountName, filter, skip, top, inlinecount) + return +} + +// Update create the configuration identified by configuration name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// configurationName - the create or update parameters for configuration. +// parameters - the create or update parameters for configuration. +func (client DscConfigurationClient) Update(ctx context.Context, resourceGroupName string, automationAccountName string, configurationName string, parameters *DscConfigurationUpdateParameters) (result DscConfiguration, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.DscConfigurationClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, automationAccountName, configurationName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscConfigurationClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.DscConfigurationClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscConfigurationClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client DscConfigurationClient) UpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, configurationName string, parameters *DscConfigurationUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "configurationName": autorest.Encode("path", configurationName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/configurations/{configurationName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if parameters != nil { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithJSON(parameters)) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client DscConfigurationClient) UpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client DscConfigurationClient) UpdateResponder(resp *http.Response) (result DscConfiguration, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/dscnode.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/dscnode.go new file mode 100644 index 000000000..c850d333e --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/dscnode.go @@ -0,0 +1,394 @@ +package automation + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// DscNodeClient is the automation Client +type DscNodeClient struct { + BaseClient +} + +// NewDscNodeClient creates an instance of the DscNodeClient client. +func NewDscNodeClient(subscriptionID string, countType1 CountType) DscNodeClient { + return NewDscNodeClientWithBaseURI(DefaultBaseURI, subscriptionID, countType1) +} + +// NewDscNodeClientWithBaseURI creates an instance of the DscNodeClient client. +func NewDscNodeClientWithBaseURI(baseURI string, subscriptionID string, countType1 CountType) DscNodeClient { + return DscNodeClient{NewWithBaseURI(baseURI, subscriptionID, countType1)} +} + +// Delete delete the dsc node identified by node id. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// nodeID - the node id. +func (client DscNodeClient) Delete(ctx context.Context, resourceGroupName string, automationAccountName string, nodeID string) (result DscNode, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.DscNodeClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, automationAccountName, nodeID) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscNodeClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.DscNodeClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscNodeClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client DscNodeClient) DeletePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, nodeID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "nodeId": autorest.Encode("path", nodeID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-01-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodes/{nodeId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client DscNodeClient) DeleteSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client DscNodeClient) DeleteResponder(resp *http.Response) (result DscNode, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get retrieve the dsc node identified by node id. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// nodeID - the node id. +func (client DscNodeClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, nodeID string) (result DscNode, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.DscNodeClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, nodeID) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscNodeClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.DscNodeClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscNodeClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client DscNodeClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, nodeID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "nodeId": autorest.Encode("path", nodeID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-01-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodes/{nodeId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client DscNodeClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client DscNodeClient) GetResponder(resp *http.Response) (result DscNode, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByAutomationAccount retrieve a list of dsc nodes. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// filter - the filter to apply on the operation. +// skip - the number of rows to skip. +// top - the the number of rows to take. +// inlinecount - return total rows. +func (client DscNodeClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string, filter string, skip *int32, top *int32, inlinecount string) (result DscNodeListResultPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.DscNodeClient", "ListByAutomationAccount", err.Error()) + } + + result.fn = client.listByAutomationAccountNextResults + req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName, filter, skip, top, inlinecount) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscNodeClient", "ListByAutomationAccount", nil, "Failure preparing request") + return + } + + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.dnlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.DscNodeClient", "ListByAutomationAccount", resp, "Failure sending request") + return + } + + result.dnlr, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscNodeClient", "ListByAutomationAccount", resp, "Failure responding to request") + } + + return +} + +// ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. +func (client DscNodeClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, filter string, skip *int32, top *int32, inlinecount string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-01-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if skip != nil { + queryParameters["$skip"] = autorest.Encode("query", *skip) + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + if len(inlinecount) > 0 { + queryParameters["$inlinecount"] = autorest.Encode("query", inlinecount) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodes", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByAutomationAccountSender sends the ListByAutomationAccount request. The method will close the +// http.Response Body if it receives an error. +func (client DscNodeClient) ListByAutomationAccountSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByAutomationAccountResponder handles the response to the ListByAutomationAccount request. The method always +// closes the http.Response Body. +func (client DscNodeClient) ListByAutomationAccountResponder(resp *http.Response) (result DscNodeListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByAutomationAccountNextResults retrieves the next set of results, if any. +func (client DscNodeClient) listByAutomationAccountNextResults(lastResults DscNodeListResult) (result DscNodeListResult, err error) { + req, err := lastResults.dscNodeListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "automation.DscNodeClient", "listByAutomationAccountNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "automation.DscNodeClient", "listByAutomationAccountNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscNodeClient", "listByAutomationAccountNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByAutomationAccountComplete enumerates all values, automatically crossing page boundaries as required. +func (client DscNodeClient) ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string, filter string, skip *int32, top *int32, inlinecount string) (result DscNodeListResultIterator, err error) { + result.page, err = client.ListByAutomationAccount(ctx, resourceGroupName, automationAccountName, filter, skip, top, inlinecount) + return +} + +// Update update the dsc node. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// nodeID - parameters supplied to the update dsc node. +// dscNodeUpdateParameters - parameters supplied to the update dsc node. +func (client DscNodeClient) Update(ctx context.Context, resourceGroupName string, automationAccountName string, nodeID string, dscNodeUpdateParameters DscNodeUpdateParameters) (result DscNode, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.DscNodeClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, automationAccountName, nodeID, dscNodeUpdateParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscNodeClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.DscNodeClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscNodeClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client DscNodeClient) UpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, nodeID string, dscNodeUpdateParameters DscNodeUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "nodeId": autorest.Encode("path", nodeID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-01-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodes/{nodeId}", pathParameters), + autorest.WithJSON(dscNodeUpdateParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client DscNodeClient) UpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client DscNodeClient) UpdateResponder(resp *http.Response) (result DscNode, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/dscnodeconfiguration.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/dscnodeconfiguration.go new file mode 100644 index 000000000..673ece89d --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/dscnodeconfiguration.go @@ -0,0 +1,407 @@ +package automation + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// DscNodeConfigurationClient is the automation Client +type DscNodeConfigurationClient struct { + BaseClient +} + +// NewDscNodeConfigurationClient creates an instance of the DscNodeConfigurationClient client. +func NewDscNodeConfigurationClient(subscriptionID string, countType1 CountType) DscNodeConfigurationClient { + return NewDscNodeConfigurationClientWithBaseURI(DefaultBaseURI, subscriptionID, countType1) +} + +// NewDscNodeConfigurationClientWithBaseURI creates an instance of the DscNodeConfigurationClient client. +func NewDscNodeConfigurationClientWithBaseURI(baseURI string, subscriptionID string, countType1 CountType) DscNodeConfigurationClient { + return DscNodeConfigurationClient{NewWithBaseURI(baseURI, subscriptionID, countType1)} +} + +// CreateOrUpdate create the node configuration identified by node configuration name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// nodeConfigurationName - the Dsc node configuration name. +// parameters - the create or update parameters for configuration. +func (client DscNodeConfigurationClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, automationAccountName string, nodeConfigurationName string, parameters DscNodeConfigurationCreateOrUpdateParameters) (result DscNodeConfigurationCreateOrUpdateFuture, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.DscNodeConfigurationCreateOrUpdateParametersProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.DscNodeConfigurationCreateOrUpdateParametersProperties.Source", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.DscNodeConfigurationCreateOrUpdateParametersProperties.Source.Hash", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.DscNodeConfigurationCreateOrUpdateParametersProperties.Source.Hash.Algorithm", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.DscNodeConfigurationCreateOrUpdateParametersProperties.Source.Hash.Value", Name: validation.Null, Rule: true, Chain: nil}, + }}, + }}, + {Target: "parameters.DscNodeConfigurationCreateOrUpdateParametersProperties.Configuration", Name: validation.Null, Rule: true, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("automation.DscNodeConfigurationClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, automationAccountName, nodeConfigurationName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscNodeConfigurationClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscNodeConfigurationClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client DscNodeConfigurationClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, nodeConfigurationName string, parameters DscNodeConfigurationCreateOrUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "nodeConfigurationName": autorest.Encode("path", nodeConfigurationName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-01-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodeConfigurations/{nodeConfigurationName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client DscNodeConfigurationClient) CreateOrUpdateSender(req *http.Request) (future DscNodeConfigurationCreateOrUpdateFuture, err error) { + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client DscNodeConfigurationClient) CreateOrUpdateResponder(resp *http.Response) (result DscNodeConfiguration, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete delete the Dsc node configurations by node configuration. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// nodeConfigurationName - the Dsc node configuration name. +func (client DscNodeConfigurationClient) Delete(ctx context.Context, resourceGroupName string, automationAccountName string, nodeConfigurationName string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.DscNodeConfigurationClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, automationAccountName, nodeConfigurationName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscNodeConfigurationClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "automation.DscNodeConfigurationClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscNodeConfigurationClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client DscNodeConfigurationClient) DeletePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, nodeConfigurationName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "nodeConfigurationName": autorest.Encode("path", nodeConfigurationName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-01-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodeConfigurations/{nodeConfigurationName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client DscNodeConfigurationClient) DeleteSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client DscNodeConfigurationClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get retrieve the Dsc node configurations by node configuration. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// nodeConfigurationName - the Dsc node configuration name. +func (client DscNodeConfigurationClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, nodeConfigurationName string) (result DscNodeConfiguration, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.DscNodeConfigurationClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, nodeConfigurationName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscNodeConfigurationClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.DscNodeConfigurationClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscNodeConfigurationClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client DscNodeConfigurationClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, nodeConfigurationName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "nodeConfigurationName": autorest.Encode("path", nodeConfigurationName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-01-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodeConfigurations/{nodeConfigurationName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client DscNodeConfigurationClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client DscNodeConfigurationClient) GetResponder(resp *http.Response) (result DscNodeConfiguration, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByAutomationAccount retrieve a list of dsc node configurations. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// filter - the filter to apply on the operation. +// skip - the number of rows to skip. +// top - the the number of rows to take. +// inlinecount - return total rows. +func (client DscNodeConfigurationClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string, filter string, skip *int32, top *int32, inlinecount string) (result DscNodeConfigurationListResultPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.DscNodeConfigurationClient", "ListByAutomationAccount", err.Error()) + } + + result.fn = client.listByAutomationAccountNextResults + req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName, filter, skip, top, inlinecount) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscNodeConfigurationClient", "ListByAutomationAccount", nil, "Failure preparing request") + return + } + + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.dnclr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.DscNodeConfigurationClient", "ListByAutomationAccount", resp, "Failure sending request") + return + } + + result.dnclr, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscNodeConfigurationClient", "ListByAutomationAccount", resp, "Failure responding to request") + } + + return +} + +// ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. +func (client DscNodeConfigurationClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, filter string, skip *int32, top *int32, inlinecount string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-01-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if skip != nil { + queryParameters["$skip"] = autorest.Encode("query", *skip) + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + if len(inlinecount) > 0 { + queryParameters["$inlinecount"] = autorest.Encode("query", inlinecount) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodeConfigurations", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByAutomationAccountSender sends the ListByAutomationAccount request. The method will close the +// http.Response Body if it receives an error. +func (client DscNodeConfigurationClient) ListByAutomationAccountSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByAutomationAccountResponder handles the response to the ListByAutomationAccount request. The method always +// closes the http.Response Body. +func (client DscNodeConfigurationClient) ListByAutomationAccountResponder(resp *http.Response) (result DscNodeConfigurationListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByAutomationAccountNextResults retrieves the next set of results, if any. +func (client DscNodeConfigurationClient) listByAutomationAccountNextResults(lastResults DscNodeConfigurationListResult) (result DscNodeConfigurationListResult, err error) { + req, err := lastResults.dscNodeConfigurationListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "automation.DscNodeConfigurationClient", "listByAutomationAccountNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "automation.DscNodeConfigurationClient", "listByAutomationAccountNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscNodeConfigurationClient", "listByAutomationAccountNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByAutomationAccountComplete enumerates all values, automatically crossing page boundaries as required. +func (client DscNodeConfigurationClient) ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string, filter string, skip *int32, top *int32, inlinecount string) (result DscNodeConfigurationListResultIterator, err error) { + result.page, err = client.ListByAutomationAccount(ctx, resourceGroupName, automationAccountName, filter, skip, top, inlinecount) + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/fields.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/fields.go new file mode 100644 index 000000000..60ec0e5e6 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/fields.go @@ -0,0 +1,120 @@ +package automation + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// FieldsClient is the automation Client +type FieldsClient struct { + BaseClient +} + +// NewFieldsClient creates an instance of the FieldsClient client. +func NewFieldsClient(subscriptionID string, countType1 CountType) FieldsClient { + return NewFieldsClientWithBaseURI(DefaultBaseURI, subscriptionID, countType1) +} + +// NewFieldsClientWithBaseURI creates an instance of the FieldsClient client. +func NewFieldsClientWithBaseURI(baseURI string, subscriptionID string, countType1 CountType) FieldsClient { + return FieldsClient{NewWithBaseURI(baseURI, subscriptionID, countType1)} +} + +// ListByType retrieve a list of fields of a given type identified by module name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// moduleName - the name of module. +// typeName - the name of type. +func (client FieldsClient) ListByType(ctx context.Context, resourceGroupName string, automationAccountName string, moduleName string, typeName string) (result TypeFieldListResult, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.FieldsClient", "ListByType", err.Error()) + } + + req, err := client.ListByTypePreparer(ctx, resourceGroupName, automationAccountName, moduleName, typeName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.FieldsClient", "ListByType", nil, "Failure preparing request") + return + } + + resp, err := client.ListByTypeSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.FieldsClient", "ListByType", resp, "Failure sending request") + return + } + + result, err = client.ListByTypeResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.FieldsClient", "ListByType", resp, "Failure responding to request") + } + + return +} + +// ListByTypePreparer prepares the ListByType request. +func (client FieldsClient) ListByTypePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, moduleName string, typeName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "moduleName": autorest.Encode("path", moduleName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "typeName": autorest.Encode("path", typeName), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/modules/{moduleName}/types/{typeName}/fields", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByTypeSender sends the ListByType request. The method will close the +// http.Response Body if it receives an error. +func (client FieldsClient) ListByTypeSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByTypeResponder handles the response to the ListByType request. The method always +// closes the http.Response Body. +func (client FieldsClient) ListByTypeResponder(resp *http.Response) (result TypeFieldListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/hybridrunbookworkergroup.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/hybridrunbookworkergroup.go new file mode 100644 index 000000000..35b70b811 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/hybridrunbookworkergroup.go @@ -0,0 +1,381 @@ +package automation + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// HybridRunbookWorkerGroupClient is the automation Client +type HybridRunbookWorkerGroupClient struct { + BaseClient +} + +// NewHybridRunbookWorkerGroupClient creates an instance of the HybridRunbookWorkerGroupClient client. +func NewHybridRunbookWorkerGroupClient(subscriptionID string, countType1 CountType) HybridRunbookWorkerGroupClient { + return NewHybridRunbookWorkerGroupClientWithBaseURI(DefaultBaseURI, subscriptionID, countType1) +} + +// NewHybridRunbookWorkerGroupClientWithBaseURI creates an instance of the HybridRunbookWorkerGroupClient client. +func NewHybridRunbookWorkerGroupClientWithBaseURI(baseURI string, subscriptionID string, countType1 CountType) HybridRunbookWorkerGroupClient { + return HybridRunbookWorkerGroupClient{NewWithBaseURI(baseURI, subscriptionID, countType1)} +} + +// Delete delete a hybrid runbook worker group. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// hybridRunbookWorkerGroupName - the hybrid runbook worker group name +func (client HybridRunbookWorkerGroupClient) Delete(ctx context.Context, resourceGroupName string, automationAccountName string, hybridRunbookWorkerGroupName string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.HybridRunbookWorkerGroupClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, automationAccountName, hybridRunbookWorkerGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.HybridRunbookWorkerGroupClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "automation.HybridRunbookWorkerGroupClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.HybridRunbookWorkerGroupClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client HybridRunbookWorkerGroupClient) DeletePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, hybridRunbookWorkerGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "hybridRunbookWorkerGroupName": autorest.Encode("path", hybridRunbookWorkerGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/hybridRunbookWorkerGroups/{hybridRunbookWorkerGroupName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client HybridRunbookWorkerGroupClient) DeleteSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client HybridRunbookWorkerGroupClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get retrieve a hybrid runbook worker group. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// hybridRunbookWorkerGroupName - the hybrid runbook worker group name +func (client HybridRunbookWorkerGroupClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, hybridRunbookWorkerGroupName string) (result HybridRunbookWorkerGroup, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.HybridRunbookWorkerGroupClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, hybridRunbookWorkerGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.HybridRunbookWorkerGroupClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.HybridRunbookWorkerGroupClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.HybridRunbookWorkerGroupClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client HybridRunbookWorkerGroupClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, hybridRunbookWorkerGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "hybridRunbookWorkerGroupName": autorest.Encode("path", hybridRunbookWorkerGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/hybridRunbookWorkerGroups/{hybridRunbookWorkerGroupName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client HybridRunbookWorkerGroupClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client HybridRunbookWorkerGroupClient) GetResponder(resp *http.Response) (result HybridRunbookWorkerGroup, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByAutomationAccount retrieve a list of hybrid runbook worker groups. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// filter - the filter to apply on the operation. +func (client HybridRunbookWorkerGroupClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (result HybridRunbookWorkerGroupsListResultPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.HybridRunbookWorkerGroupClient", "ListByAutomationAccount", err.Error()) + } + + result.fn = client.listByAutomationAccountNextResults + req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.HybridRunbookWorkerGroupClient", "ListByAutomationAccount", nil, "Failure preparing request") + return + } + + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.hrwglr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.HybridRunbookWorkerGroupClient", "ListByAutomationAccount", resp, "Failure sending request") + return + } + + result.hrwglr, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.HybridRunbookWorkerGroupClient", "ListByAutomationAccount", resp, "Failure responding to request") + } + + return +} + +// ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. +func (client HybridRunbookWorkerGroupClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/hybridRunbookWorkerGroups", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByAutomationAccountSender sends the ListByAutomationAccount request. The method will close the +// http.Response Body if it receives an error. +func (client HybridRunbookWorkerGroupClient) ListByAutomationAccountSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByAutomationAccountResponder handles the response to the ListByAutomationAccount request. The method always +// closes the http.Response Body. +func (client HybridRunbookWorkerGroupClient) ListByAutomationAccountResponder(resp *http.Response) (result HybridRunbookWorkerGroupsListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByAutomationAccountNextResults retrieves the next set of results, if any. +func (client HybridRunbookWorkerGroupClient) listByAutomationAccountNextResults(lastResults HybridRunbookWorkerGroupsListResult) (result HybridRunbookWorkerGroupsListResult, err error) { + req, err := lastResults.hybridRunbookWorkerGroupsListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "automation.HybridRunbookWorkerGroupClient", "listByAutomationAccountNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "automation.HybridRunbookWorkerGroupClient", "listByAutomationAccountNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.HybridRunbookWorkerGroupClient", "listByAutomationAccountNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByAutomationAccountComplete enumerates all values, automatically crossing page boundaries as required. +func (client HybridRunbookWorkerGroupClient) ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (result HybridRunbookWorkerGroupsListResultIterator, err error) { + result.page, err = client.ListByAutomationAccount(ctx, resourceGroupName, automationAccountName, filter) + return +} + +// Update update a hybrid runbook worker group. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// hybridRunbookWorkerGroupName - the hybrid runbook worker group name +// parameters - the hybrid runbook worker group +func (client HybridRunbookWorkerGroupClient) Update(ctx context.Context, resourceGroupName string, automationAccountName string, hybridRunbookWorkerGroupName string, parameters HybridRunbookWorkerGroupUpdateParameters) (result HybridRunbookWorkerGroup, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.HybridRunbookWorkerGroupClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, automationAccountName, hybridRunbookWorkerGroupName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.HybridRunbookWorkerGroupClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.HybridRunbookWorkerGroupClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.HybridRunbookWorkerGroupClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client HybridRunbookWorkerGroupClient) UpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, hybridRunbookWorkerGroupName string, parameters HybridRunbookWorkerGroupUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "hybridRunbookWorkerGroupName": autorest.Encode("path", hybridRunbookWorkerGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/hybridRunbookWorkerGroups/{hybridRunbookWorkerGroupName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client HybridRunbookWorkerGroupClient) UpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client HybridRunbookWorkerGroupClient) UpdateResponder(resp *http.Response) (result HybridRunbookWorkerGroup, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/job.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/job.go new file mode 100644 index 000000000..40f9f057e --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/job.go @@ -0,0 +1,729 @@ +package automation + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// JobClient is the automation Client +type JobClient struct { + BaseClient +} + +// NewJobClient creates an instance of the JobClient client. +func NewJobClient(subscriptionID string, countType1 CountType) JobClient { + return NewJobClientWithBaseURI(DefaultBaseURI, subscriptionID, countType1) +} + +// NewJobClientWithBaseURI creates an instance of the JobClient client. +func NewJobClientWithBaseURI(baseURI string, subscriptionID string, countType1 CountType) JobClient { + return JobClient{NewWithBaseURI(baseURI, subscriptionID, countType1)} +} + +// Create create a job of the runbook. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// jobName - the job name. +// parameters - the parameters supplied to the create job operation. +// clientRequestID - identifies this specific client request. +func (client JobClient) Create(ctx context.Context, resourceGroupName string, automationAccountName string, jobName string, parameters JobCreateParameters, clientRequestID string) (result Job, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.JobCreateProperties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.JobClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, resourceGroupName, automationAccountName, jobName, parameters, clientRequestID) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.JobClient", "Create", nil, "Failure preparing request") + return + } + + resp, err := client.CreateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.JobClient", "Create", resp, "Failure sending request") + return + } + + result, err = client.CreateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.JobClient", "Create", resp, "Failure responding to request") + } + + return +} + +// CreatePreparer prepares the Create request. +func (client JobClient) CreatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, jobName string, parameters JobCreateParameters, clientRequestID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "jobName": autorest.Encode("path", jobName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-05-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + if len(clientRequestID) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("clientRequestId", autorest.String(clientRequestID))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client JobClient) CreateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client JobClient) CreateResponder(resp *http.Response) (result Job, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get retrieve the job identified by job name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// jobName - the job name. +// clientRequestID - identifies this specific client request. +func (client JobClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, jobName string, clientRequestID string) (result Job, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.JobClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, jobName, clientRequestID) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.JobClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.JobClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.JobClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client JobClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, jobName string, clientRequestID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "jobName": autorest.Encode("path", jobName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-05-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if len(clientRequestID) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("clientRequestId", autorest.String(clientRequestID))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client JobClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client JobClient) GetResponder(resp *http.Response) (result Job, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetOutput retrieve the job output identified by job name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// jobName - the name of the job to be created. +// clientRequestID - identifies this specific client request. +func (client JobClient) GetOutput(ctx context.Context, resourceGroupName string, automationAccountName string, jobName string, clientRequestID string) (result String, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.JobClient", "GetOutput", err.Error()) + } + + req, err := client.GetOutputPreparer(ctx, resourceGroupName, automationAccountName, jobName, clientRequestID) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.JobClient", "GetOutput", nil, "Failure preparing request") + return + } + + resp, err := client.GetOutputSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.JobClient", "GetOutput", resp, "Failure sending request") + return + } + + result, err = client.GetOutputResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.JobClient", "GetOutput", resp, "Failure responding to request") + } + + return +} + +// GetOutputPreparer prepares the GetOutput request. +func (client JobClient) GetOutputPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, jobName string, clientRequestID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "jobName": autorest.Encode("path", jobName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-05-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobName}/output", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if len(clientRequestID) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("clientRequestId", autorest.String(clientRequestID))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetOutputSender sends the GetOutput request. The method will close the +// http.Response Body if it receives an error. +func (client JobClient) GetOutputSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetOutputResponder handles the response to the GetOutput request. The method always +// closes the http.Response Body. +func (client JobClient) GetOutputResponder(resp *http.Response) (result String, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetRunbookContent retrieve the runbook content of the job identified by job name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// jobName - the job name. +// clientRequestID - identifies this specific client request. +func (client JobClient) GetRunbookContent(ctx context.Context, resourceGroupName string, automationAccountName string, jobName string, clientRequestID string) (result String, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.JobClient", "GetRunbookContent", err.Error()) + } + + req, err := client.GetRunbookContentPreparer(ctx, resourceGroupName, automationAccountName, jobName, clientRequestID) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.JobClient", "GetRunbookContent", nil, "Failure preparing request") + return + } + + resp, err := client.GetRunbookContentSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.JobClient", "GetRunbookContent", resp, "Failure sending request") + return + } + + result, err = client.GetRunbookContentResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.JobClient", "GetRunbookContent", resp, "Failure responding to request") + } + + return +} + +// GetRunbookContentPreparer prepares the GetRunbookContent request. +func (client JobClient) GetRunbookContentPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, jobName string, clientRequestID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "jobName": autorest.Encode("path", jobName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-05-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobName}/runbookContent", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if len(clientRequestID) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("clientRequestId", autorest.String(clientRequestID))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetRunbookContentSender sends the GetRunbookContent request. The method will close the +// http.Response Body if it receives an error. +func (client JobClient) GetRunbookContentSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetRunbookContentResponder handles the response to the GetRunbookContent request. The method always +// closes the http.Response Body. +func (client JobClient) GetRunbookContentResponder(resp *http.Response) (result String, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByAutomationAccount retrieve a list of jobs. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// filter - the filter to apply on the operation. +// clientRequestID - identifies this specific client request. +func (client JobClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string, filter string, clientRequestID string) (result JobListResultV2Page, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.JobClient", "ListByAutomationAccount", err.Error()) + } + + result.fn = client.listByAutomationAccountNextResults + req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName, filter, clientRequestID) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.JobClient", "ListByAutomationAccount", nil, "Failure preparing request") + return + } + + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.jlrv.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.JobClient", "ListByAutomationAccount", resp, "Failure sending request") + return + } + + result.jlrv, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.JobClient", "ListByAutomationAccount", resp, "Failure responding to request") + } + + return +} + +// ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. +func (client JobClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, filter string, clientRequestID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-05-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if len(clientRequestID) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("clientRequestId", autorest.String(clientRequestID))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByAutomationAccountSender sends the ListByAutomationAccount request. The method will close the +// http.Response Body if it receives an error. +func (client JobClient) ListByAutomationAccountSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByAutomationAccountResponder handles the response to the ListByAutomationAccount request. The method always +// closes the http.Response Body. +func (client JobClient) ListByAutomationAccountResponder(resp *http.Response) (result JobListResultV2, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByAutomationAccountNextResults retrieves the next set of results, if any. +func (client JobClient) listByAutomationAccountNextResults(lastResults JobListResultV2) (result JobListResultV2, err error) { + req, err := lastResults.jobListResultV2Preparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "automation.JobClient", "listByAutomationAccountNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "automation.JobClient", "listByAutomationAccountNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.JobClient", "listByAutomationAccountNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByAutomationAccountComplete enumerates all values, automatically crossing page boundaries as required. +func (client JobClient) ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string, filter string, clientRequestID string) (result JobListResultV2Iterator, err error) { + result.page, err = client.ListByAutomationAccount(ctx, resourceGroupName, automationAccountName, filter, clientRequestID) + return +} + +// Resume resume the job identified by jobName. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// jobName - the job name. +// clientRequestID - identifies this specific client request. +func (client JobClient) Resume(ctx context.Context, resourceGroupName string, automationAccountName string, jobName string, clientRequestID string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.JobClient", "Resume", err.Error()) + } + + req, err := client.ResumePreparer(ctx, resourceGroupName, automationAccountName, jobName, clientRequestID) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.JobClient", "Resume", nil, "Failure preparing request") + return + } + + resp, err := client.ResumeSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "automation.JobClient", "Resume", resp, "Failure sending request") + return + } + + result, err = client.ResumeResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.JobClient", "Resume", resp, "Failure responding to request") + } + + return +} + +// ResumePreparer prepares the Resume request. +func (client JobClient) ResumePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, jobName string, clientRequestID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "jobName": autorest.Encode("path", jobName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-05-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobName}/resume", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if len(clientRequestID) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("clientRequestId", autorest.String(clientRequestID))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ResumeSender sends the Resume request. The method will close the +// http.Response Body if it receives an error. +func (client JobClient) ResumeSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ResumeResponder handles the response to the Resume request. The method always +// closes the http.Response Body. +func (client JobClient) ResumeResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Stop stop the job identified by jobName. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// jobName - the job name. +// clientRequestID - identifies this specific client request. +func (client JobClient) Stop(ctx context.Context, resourceGroupName string, automationAccountName string, jobName string, clientRequestID string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.JobClient", "Stop", err.Error()) + } + + req, err := client.StopPreparer(ctx, resourceGroupName, automationAccountName, jobName, clientRequestID) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.JobClient", "Stop", nil, "Failure preparing request") + return + } + + resp, err := client.StopSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "automation.JobClient", "Stop", resp, "Failure sending request") + return + } + + result, err = client.StopResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.JobClient", "Stop", resp, "Failure responding to request") + } + + return +} + +// StopPreparer prepares the Stop request. +func (client JobClient) StopPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, jobName string, clientRequestID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "jobName": autorest.Encode("path", jobName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-05-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobName}/stop", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if len(clientRequestID) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("clientRequestId", autorest.String(clientRequestID))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// StopSender sends the Stop request. The method will close the +// http.Response Body if it receives an error. +func (client JobClient) StopSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// StopResponder handles the response to the Stop request. The method always +// closes the http.Response Body. +func (client JobClient) StopResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Suspend suspend the job identified by job name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// jobName - the job name. +// clientRequestID - identifies this specific client request. +func (client JobClient) Suspend(ctx context.Context, resourceGroupName string, automationAccountName string, jobName string, clientRequestID string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.JobClient", "Suspend", err.Error()) + } + + req, err := client.SuspendPreparer(ctx, resourceGroupName, automationAccountName, jobName, clientRequestID) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.JobClient", "Suspend", nil, "Failure preparing request") + return + } + + resp, err := client.SuspendSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "automation.JobClient", "Suspend", resp, "Failure sending request") + return + } + + result, err = client.SuspendResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.JobClient", "Suspend", resp, "Failure responding to request") + } + + return +} + +// SuspendPreparer prepares the Suspend request. +func (client JobClient) SuspendPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, jobName string, clientRequestID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "jobName": autorest.Encode("path", jobName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-05-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobName}/suspend", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if len(clientRequestID) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("clientRequestId", autorest.String(clientRequestID))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// SuspendSender sends the Suspend request. The method will close the +// http.Response Body if it receives an error. +func (client JobClient) SuspendSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// SuspendResponder handles the response to the Suspend request. The method always +// closes the http.Response Body. +func (client JobClient) SuspendResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/jobschedule.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/jobschedule.go new file mode 100644 index 000000000..2d9c35c03 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/jobschedule.go @@ -0,0 +1,387 @@ +package automation + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/satori/go.uuid" + "net/http" +) + +// JobScheduleClient is the automation Client +type JobScheduleClient struct { + BaseClient +} + +// NewJobScheduleClient creates an instance of the JobScheduleClient client. +func NewJobScheduleClient(subscriptionID string, countType1 CountType) JobScheduleClient { + return NewJobScheduleClientWithBaseURI(DefaultBaseURI, subscriptionID, countType1) +} + +// NewJobScheduleClientWithBaseURI creates an instance of the JobScheduleClient client. +func NewJobScheduleClientWithBaseURI(baseURI string, subscriptionID string, countType1 CountType) JobScheduleClient { + return JobScheduleClient{NewWithBaseURI(baseURI, subscriptionID, countType1)} +} + +// Create create a job schedule. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// jobScheduleID - the job schedule name. +// parameters - the parameters supplied to the create job schedule operation. +func (client JobScheduleClient) Create(ctx context.Context, resourceGroupName string, automationAccountName string, jobScheduleID uuid.UUID, parameters JobScheduleCreateParameters) (result JobSchedule, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.JobScheduleCreateProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.JobScheduleCreateProperties.Schedule", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.JobScheduleCreateProperties.Runbook", Name: validation.Null, Rule: true, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("automation.JobScheduleClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, resourceGroupName, automationAccountName, jobScheduleID, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.JobScheduleClient", "Create", nil, "Failure preparing request") + return + } + + resp, err := client.CreateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.JobScheduleClient", "Create", resp, "Failure sending request") + return + } + + result, err = client.CreateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.JobScheduleClient", "Create", resp, "Failure responding to request") + } + + return +} + +// CreatePreparer prepares the Create request. +func (client JobScheduleClient) CreatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, jobScheduleID uuid.UUID, parameters JobScheduleCreateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "jobScheduleId": autorest.Encode("path", jobScheduleID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobSchedules/{jobScheduleId}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client JobScheduleClient) CreateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client JobScheduleClient) CreateResponder(resp *http.Response) (result JobSchedule, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete delete the job schedule identified by job schedule name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// jobScheduleID - the job schedule name. +func (client JobScheduleClient) Delete(ctx context.Context, resourceGroupName string, automationAccountName string, jobScheduleID uuid.UUID) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.JobScheduleClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, automationAccountName, jobScheduleID) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.JobScheduleClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "automation.JobScheduleClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.JobScheduleClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client JobScheduleClient) DeletePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, jobScheduleID uuid.UUID) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "jobScheduleId": autorest.Encode("path", jobScheduleID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobSchedules/{jobScheduleId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client JobScheduleClient) DeleteSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client JobScheduleClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get retrieve the job schedule identified by job schedule name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// jobScheduleID - the job schedule name. +func (client JobScheduleClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, jobScheduleID uuid.UUID) (result JobSchedule, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.JobScheduleClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, jobScheduleID) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.JobScheduleClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.JobScheduleClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.JobScheduleClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client JobScheduleClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, jobScheduleID uuid.UUID) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "jobScheduleId": autorest.Encode("path", jobScheduleID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobSchedules/{jobScheduleId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client JobScheduleClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client JobScheduleClient) GetResponder(resp *http.Response) (result JobSchedule, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByAutomationAccount retrieve a list of job schedules. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// filter - the filter to apply on the operation. +func (client JobScheduleClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (result JobScheduleListResultPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.JobScheduleClient", "ListByAutomationAccount", err.Error()) + } + + result.fn = client.listByAutomationAccountNextResults + req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.JobScheduleClient", "ListByAutomationAccount", nil, "Failure preparing request") + return + } + + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.jslr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.JobScheduleClient", "ListByAutomationAccount", resp, "Failure sending request") + return + } + + result.jslr, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.JobScheduleClient", "ListByAutomationAccount", resp, "Failure responding to request") + } + + return +} + +// ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. +func (client JobScheduleClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobSchedules", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByAutomationAccountSender sends the ListByAutomationAccount request. The method will close the +// http.Response Body if it receives an error. +func (client JobScheduleClient) ListByAutomationAccountSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByAutomationAccountResponder handles the response to the ListByAutomationAccount request. The method always +// closes the http.Response Body. +func (client JobScheduleClient) ListByAutomationAccountResponder(resp *http.Response) (result JobScheduleListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByAutomationAccountNextResults retrieves the next set of results, if any. +func (client JobScheduleClient) listByAutomationAccountNextResults(lastResults JobScheduleListResult) (result JobScheduleListResult, err error) { + req, err := lastResults.jobScheduleListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "automation.JobScheduleClient", "listByAutomationAccountNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "automation.JobScheduleClient", "listByAutomationAccountNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.JobScheduleClient", "listByAutomationAccountNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByAutomationAccountComplete enumerates all values, automatically crossing page boundaries as required. +func (client JobScheduleClient) ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (result JobScheduleListResultIterator, err error) { + result.page, err = client.ListByAutomationAccount(ctx, resourceGroupName, automationAccountName, filter) + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/jobstream.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/jobstream.go new file mode 100644 index 000000000..441700fca --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/jobstream.go @@ -0,0 +1,239 @@ +package automation + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// JobStreamClient is the automation Client +type JobStreamClient struct { + BaseClient +} + +// NewJobStreamClient creates an instance of the JobStreamClient client. +func NewJobStreamClient(subscriptionID string, countType1 CountType) JobStreamClient { + return NewJobStreamClientWithBaseURI(DefaultBaseURI, subscriptionID, countType1) +} + +// NewJobStreamClientWithBaseURI creates an instance of the JobStreamClient client. +func NewJobStreamClientWithBaseURI(baseURI string, subscriptionID string, countType1 CountType) JobStreamClient { + return JobStreamClient{NewWithBaseURI(baseURI, subscriptionID, countType1)} +} + +// Get retrieve the job stream identified by job stream id. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// jobName - the job name. +// jobStreamID - the job stream id. +// clientRequestID - identifies this specific client request. +func (client JobStreamClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, jobName string, jobStreamID string, clientRequestID string) (result JobStream, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.JobStreamClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, jobName, jobStreamID, clientRequestID) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.JobStreamClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.JobStreamClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.JobStreamClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client JobStreamClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, jobName string, jobStreamID string, clientRequestID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "jobName": autorest.Encode("path", jobName), + "jobStreamId": autorest.Encode("path", jobStreamID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-05-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobName}/streams/{jobStreamId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if len(clientRequestID) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("clientRequestId", autorest.String(clientRequestID))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client JobStreamClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client JobStreamClient) GetResponder(resp *http.Response) (result JobStream, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByJob retrieve a list of jobs streams identified by job name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// jobName - the job name. +// filter - the filter to apply on the operation. +// clientRequestID - identifies this specific client request. +func (client JobStreamClient) ListByJob(ctx context.Context, resourceGroupName string, automationAccountName string, jobName string, filter string, clientRequestID string) (result JobStreamListResultPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.JobStreamClient", "ListByJob", err.Error()) + } + + result.fn = client.listByJobNextResults + req, err := client.ListByJobPreparer(ctx, resourceGroupName, automationAccountName, jobName, filter, clientRequestID) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.JobStreamClient", "ListByJob", nil, "Failure preparing request") + return + } + + resp, err := client.ListByJobSender(req) + if err != nil { + result.jslr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.JobStreamClient", "ListByJob", resp, "Failure sending request") + return + } + + result.jslr, err = client.ListByJobResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.JobStreamClient", "ListByJob", resp, "Failure responding to request") + } + + return +} + +// ListByJobPreparer prepares the ListByJob request. +func (client JobStreamClient) ListByJobPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, jobName string, filter string, clientRequestID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "jobName": autorest.Encode("path", jobName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-05-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobName}/streams", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if len(clientRequestID) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("clientRequestId", autorest.String(clientRequestID))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByJobSender sends the ListByJob request. The method will close the +// http.Response Body if it receives an error. +func (client JobStreamClient) ListByJobSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByJobResponder handles the response to the ListByJob request. The method always +// closes the http.Response Body. +func (client JobStreamClient) ListByJobResponder(resp *http.Response) (result JobStreamListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByJobNextResults retrieves the next set of results, if any. +func (client JobStreamClient) listByJobNextResults(lastResults JobStreamListResult) (result JobStreamListResult, err error) { + req, err := lastResults.jobStreamListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "automation.JobStreamClient", "listByJobNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByJobSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "automation.JobStreamClient", "listByJobNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByJobResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.JobStreamClient", "listByJobNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByJobComplete enumerates all values, automatically crossing page boundaries as required. +func (client JobStreamClient) ListByJobComplete(ctx context.Context, resourceGroupName string, automationAccountName string, jobName string, filter string, clientRequestID string) (result JobStreamListResultIterator, err error) { + result.page, err = client.ListByJob(ctx, resourceGroupName, automationAccountName, jobName, filter, clientRequestID) + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/keys.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/keys.go new file mode 100644 index 000000000..8d53d162c --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/keys.go @@ -0,0 +1,116 @@ +package automation + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// KeysClient is the automation Client +type KeysClient struct { + BaseClient +} + +// NewKeysClient creates an instance of the KeysClient client. +func NewKeysClient(subscriptionID string, countType1 CountType) KeysClient { + return NewKeysClientWithBaseURI(DefaultBaseURI, subscriptionID, countType1) +} + +// NewKeysClientWithBaseURI creates an instance of the KeysClient client. +func NewKeysClientWithBaseURI(baseURI string, subscriptionID string, countType1 CountType) KeysClient { + return KeysClient{NewWithBaseURI(baseURI, subscriptionID, countType1)} +} + +// ListByAutomationAccount retrieve the automation keys for an account. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +func (client KeysClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string) (result KeyListResult, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.KeysClient", "ListByAutomationAccount", err.Error()) + } + + req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.KeysClient", "ListByAutomationAccount", nil, "Failure preparing request") + return + } + + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.KeysClient", "ListByAutomationAccount", resp, "Failure sending request") + return + } + + result, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.KeysClient", "ListByAutomationAccount", resp, "Failure responding to request") + } + + return +} + +// ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. +func (client KeysClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/listKeys", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByAutomationAccountSender sends the ListByAutomationAccount request. The method will close the +// http.Response Body if it receives an error. +func (client KeysClient) ListByAutomationAccountSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByAutomationAccountResponder handles the response to the ListByAutomationAccount request. The method always +// closes the http.Response Body. +func (client KeysClient) ListByAutomationAccountResponder(resp *http.Response) (result KeyListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/linkedworkspace.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/linkedworkspace.go new file mode 100644 index 000000000..5385fb666 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/linkedworkspace.go @@ -0,0 +1,116 @@ +package automation + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// LinkedWorkspaceClient is the automation Client +type LinkedWorkspaceClient struct { + BaseClient +} + +// NewLinkedWorkspaceClient creates an instance of the LinkedWorkspaceClient client. +func NewLinkedWorkspaceClient(subscriptionID string, countType1 CountType) LinkedWorkspaceClient { + return NewLinkedWorkspaceClientWithBaseURI(DefaultBaseURI, subscriptionID, countType1) +} + +// NewLinkedWorkspaceClientWithBaseURI creates an instance of the LinkedWorkspaceClient client. +func NewLinkedWorkspaceClientWithBaseURI(baseURI string, subscriptionID string, countType1 CountType) LinkedWorkspaceClient { + return LinkedWorkspaceClient{NewWithBaseURI(baseURI, subscriptionID, countType1)} +} + +// Get retrieve the linked workspace for the account id. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +func (client LinkedWorkspaceClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string) (result LinkedWorkspace, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.LinkedWorkspaceClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.LinkedWorkspaceClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.LinkedWorkspaceClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.LinkedWorkspaceClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client LinkedWorkspaceClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/linkedWorkspace", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client LinkedWorkspaceClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client LinkedWorkspaceClient) GetResponder(resp *http.Response) (result LinkedWorkspace, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/models.go new file mode 100644 index 000000000..30fcbdfae --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/models.go @@ -0,0 +1,9733 @@ +package automation + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "encoding/json" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/date" + "github.com/Azure/go-autorest/autorest/to" + "github.com/satori/go.uuid" + "net/http" +) + +// AccountState enumerates the values for account state. +type AccountState string + +const ( + // Ok ... + Ok AccountState = "Ok" + // Suspended ... + Suspended AccountState = "Suspended" + // Unavailable ... + Unavailable AccountState = "Unavailable" +) + +// PossibleAccountStateValues returns an array of possible values for the AccountState const type. +func PossibleAccountStateValues() []AccountState { + return []AccountState{Ok, Suspended, Unavailable} +} + +// AgentRegistrationKeyName enumerates the values for agent registration key name. +type AgentRegistrationKeyName string + +const ( + // Primary ... + Primary AgentRegistrationKeyName = "primary" + // Secondary ... + Secondary AgentRegistrationKeyName = "secondary" +) + +// PossibleAgentRegistrationKeyNameValues returns an array of possible values for the AgentRegistrationKeyName const type. +func PossibleAgentRegistrationKeyNameValues() []AgentRegistrationKeyName { + return []AgentRegistrationKeyName{Primary, Secondary} +} + +// ContentSourceType enumerates the values for content source type. +type ContentSourceType string + +const ( + // EmbeddedContent ... + EmbeddedContent ContentSourceType = "embeddedContent" + // URI ... + URI ContentSourceType = "uri" +) + +// PossibleContentSourceTypeValues returns an array of possible values for the ContentSourceType const type. +func PossibleContentSourceTypeValues() []ContentSourceType { + return []ContentSourceType{EmbeddedContent, URI} +} + +// CountType enumerates the values for count type. +type CountType string + +const ( + // Nodeconfiguration ... + Nodeconfiguration CountType = "nodeconfiguration" + // Status ... + Status CountType = "status" +) + +// PossibleCountTypeValues returns an array of possible values for the CountType const type. +func PossibleCountTypeValues() []CountType { + return []CountType{Nodeconfiguration, Status} +} + +// DscConfigurationProvisioningState enumerates the values for dsc configuration provisioning state. +type DscConfigurationProvisioningState string + +const ( + // Succeeded ... + Succeeded DscConfigurationProvisioningState = "Succeeded" +) + +// PossibleDscConfigurationProvisioningStateValues returns an array of possible values for the DscConfigurationProvisioningState const type. +func PossibleDscConfigurationProvisioningStateValues() []DscConfigurationProvisioningState { + return []DscConfigurationProvisioningState{Succeeded} +} + +// DscConfigurationState enumerates the values for dsc configuration state. +type DscConfigurationState string + +const ( + // DscConfigurationStateEdit ... + DscConfigurationStateEdit DscConfigurationState = "Edit" + // DscConfigurationStateNew ... + DscConfigurationStateNew DscConfigurationState = "New" + // DscConfigurationStatePublished ... + DscConfigurationStatePublished DscConfigurationState = "Published" +) + +// PossibleDscConfigurationStateValues returns an array of possible values for the DscConfigurationState const type. +func PossibleDscConfigurationStateValues() []DscConfigurationState { + return []DscConfigurationState{DscConfigurationStateEdit, DscConfigurationStateNew, DscConfigurationStatePublished} +} + +// GroupTypeEnum enumerates the values for group type enum. +type GroupTypeEnum string + +const ( + // System ... + System GroupTypeEnum = "System" + // User ... + User GroupTypeEnum = "User" +) + +// PossibleGroupTypeEnumValues returns an array of possible values for the GroupTypeEnum const type. +func PossibleGroupTypeEnumValues() []GroupTypeEnum { + return []GroupTypeEnum{System, User} +} + +// HTTPStatusCode enumerates the values for http status code. +type HTTPStatusCode string + +const ( + // Accepted ... + Accepted HTTPStatusCode = "Accepted" + // Ambiguous ... + Ambiguous HTTPStatusCode = "Ambiguous" + // BadGateway ... + BadGateway HTTPStatusCode = "BadGateway" + // BadRequest ... + BadRequest HTTPStatusCode = "BadRequest" + // Conflict ... + Conflict HTTPStatusCode = "Conflict" + // Continue ... + Continue HTTPStatusCode = "Continue" + // Created ... + Created HTTPStatusCode = "Created" + // ExpectationFailed ... + ExpectationFailed HTTPStatusCode = "ExpectationFailed" + // Forbidden ... + Forbidden HTTPStatusCode = "Forbidden" + // Found ... + Found HTTPStatusCode = "Found" + // GatewayTimeout ... + GatewayTimeout HTTPStatusCode = "GatewayTimeout" + // Gone ... + Gone HTTPStatusCode = "Gone" + // HTTPVersionNotSupported ... + HTTPVersionNotSupported HTTPStatusCode = "HttpVersionNotSupported" + // InternalServerError ... + InternalServerError HTTPStatusCode = "InternalServerError" + // LengthRequired ... + LengthRequired HTTPStatusCode = "LengthRequired" + // MethodNotAllowed ... + MethodNotAllowed HTTPStatusCode = "MethodNotAllowed" + // Moved ... + Moved HTTPStatusCode = "Moved" + // MovedPermanently ... + MovedPermanently HTTPStatusCode = "MovedPermanently" + // MultipleChoices ... + MultipleChoices HTTPStatusCode = "MultipleChoices" + // NoContent ... + NoContent HTTPStatusCode = "NoContent" + // NonAuthoritativeInformation ... + NonAuthoritativeInformation HTTPStatusCode = "NonAuthoritativeInformation" + // NotAcceptable ... + NotAcceptable HTTPStatusCode = "NotAcceptable" + // NotFound ... + NotFound HTTPStatusCode = "NotFound" + // NotImplemented ... + NotImplemented HTTPStatusCode = "NotImplemented" + // NotModified ... + NotModified HTTPStatusCode = "NotModified" + // OK ... + OK HTTPStatusCode = "OK" + // PartialContent ... + PartialContent HTTPStatusCode = "PartialContent" + // PaymentRequired ... + PaymentRequired HTTPStatusCode = "PaymentRequired" + // PreconditionFailed ... + PreconditionFailed HTTPStatusCode = "PreconditionFailed" + // ProxyAuthenticationRequired ... + ProxyAuthenticationRequired HTTPStatusCode = "ProxyAuthenticationRequired" + // Redirect ... + Redirect HTTPStatusCode = "Redirect" + // RedirectKeepVerb ... + RedirectKeepVerb HTTPStatusCode = "RedirectKeepVerb" + // RedirectMethod ... + RedirectMethod HTTPStatusCode = "RedirectMethod" + // RequestedRangeNotSatisfiable ... + RequestedRangeNotSatisfiable HTTPStatusCode = "RequestedRangeNotSatisfiable" + // RequestEntityTooLarge ... + RequestEntityTooLarge HTTPStatusCode = "RequestEntityTooLarge" + // RequestTimeout ... + RequestTimeout HTTPStatusCode = "RequestTimeout" + // RequestURITooLong ... + RequestURITooLong HTTPStatusCode = "RequestUriTooLong" + // ResetContent ... + ResetContent HTTPStatusCode = "ResetContent" + // SeeOther ... + SeeOther HTTPStatusCode = "SeeOther" + // ServiceUnavailable ... + ServiceUnavailable HTTPStatusCode = "ServiceUnavailable" + // SwitchingProtocols ... + SwitchingProtocols HTTPStatusCode = "SwitchingProtocols" + // TemporaryRedirect ... + TemporaryRedirect HTTPStatusCode = "TemporaryRedirect" + // Unauthorized ... + Unauthorized HTTPStatusCode = "Unauthorized" + // UnsupportedMediaType ... + UnsupportedMediaType HTTPStatusCode = "UnsupportedMediaType" + // Unused ... + Unused HTTPStatusCode = "Unused" + // UpgradeRequired ... + UpgradeRequired HTTPStatusCode = "UpgradeRequired" + // UseProxy ... + UseProxy HTTPStatusCode = "UseProxy" +) + +// PossibleHTTPStatusCodeValues returns an array of possible values for the HTTPStatusCode const type. +func PossibleHTTPStatusCodeValues() []HTTPStatusCode { + return []HTTPStatusCode{Accepted, Ambiguous, BadGateway, BadRequest, Conflict, Continue, Created, ExpectationFailed, Forbidden, Found, GatewayTimeout, Gone, HTTPVersionNotSupported, InternalServerError, LengthRequired, MethodNotAllowed, Moved, MovedPermanently, MultipleChoices, NoContent, NonAuthoritativeInformation, NotAcceptable, NotFound, NotImplemented, NotModified, OK, PartialContent, PaymentRequired, PreconditionFailed, ProxyAuthenticationRequired, Redirect, RedirectKeepVerb, RedirectMethod, RequestedRangeNotSatisfiable, RequestEntityTooLarge, RequestTimeout, RequestURITooLong, ResetContent, SeeOther, ServiceUnavailable, SwitchingProtocols, TemporaryRedirect, Unauthorized, UnsupportedMediaType, Unused, UpgradeRequired, UseProxy} +} + +// JobProvisioningState enumerates the values for job provisioning state. +type JobProvisioningState string + +const ( + // JobProvisioningStateFailed ... + JobProvisioningStateFailed JobProvisioningState = "Failed" + // JobProvisioningStateProcessing ... + JobProvisioningStateProcessing JobProvisioningState = "Processing" + // JobProvisioningStateSucceeded ... + JobProvisioningStateSucceeded JobProvisioningState = "Succeeded" + // JobProvisioningStateSuspended ... + JobProvisioningStateSuspended JobProvisioningState = "Suspended" +) + +// PossibleJobProvisioningStateValues returns an array of possible values for the JobProvisioningState const type. +func PossibleJobProvisioningStateValues() []JobProvisioningState { + return []JobProvisioningState{JobProvisioningStateFailed, JobProvisioningStateProcessing, JobProvisioningStateSucceeded, JobProvisioningStateSuspended} +} + +// JobStatus enumerates the values for job status. +type JobStatus string + +const ( + // JobStatusActivating ... + JobStatusActivating JobStatus = "Activating" + // JobStatusBlocked ... + JobStatusBlocked JobStatus = "Blocked" + // JobStatusCompleted ... + JobStatusCompleted JobStatus = "Completed" + // JobStatusDisconnected ... + JobStatusDisconnected JobStatus = "Disconnected" + // JobStatusFailed ... + JobStatusFailed JobStatus = "Failed" + // JobStatusNew ... + JobStatusNew JobStatus = "New" + // JobStatusRemoving ... + JobStatusRemoving JobStatus = "Removing" + // JobStatusResuming ... + JobStatusResuming JobStatus = "Resuming" + // JobStatusRunning ... + JobStatusRunning JobStatus = "Running" + // JobStatusStopped ... + JobStatusStopped JobStatus = "Stopped" + // JobStatusStopping ... + JobStatusStopping JobStatus = "Stopping" + // JobStatusSuspended ... + JobStatusSuspended JobStatus = "Suspended" + // JobStatusSuspending ... + JobStatusSuspending JobStatus = "Suspending" +) + +// PossibleJobStatusValues returns an array of possible values for the JobStatus const type. +func PossibleJobStatusValues() []JobStatus { + return []JobStatus{JobStatusActivating, JobStatusBlocked, JobStatusCompleted, JobStatusDisconnected, JobStatusFailed, JobStatusNew, JobStatusRemoving, JobStatusResuming, JobStatusRunning, JobStatusStopped, JobStatusStopping, JobStatusSuspended, JobStatusSuspending} +} + +// JobStreamType enumerates the values for job stream type. +type JobStreamType string + +const ( + // Any ... + Any JobStreamType = "Any" + // Debug ... + Debug JobStreamType = "Debug" + // Error ... + Error JobStreamType = "Error" + // Output ... + Output JobStreamType = "Output" + // Progress ... + Progress JobStreamType = "Progress" + // Verbose ... + Verbose JobStreamType = "Verbose" + // Warning ... + Warning JobStreamType = "Warning" +) + +// PossibleJobStreamTypeValues returns an array of possible values for the JobStreamType const type. +func PossibleJobStreamTypeValues() []JobStreamType { + return []JobStreamType{Any, Debug, Error, Output, Progress, Verbose, Warning} +} + +// KeyName enumerates the values for key name. +type KeyName string + +const ( + // KeyNamePrimary ... + KeyNamePrimary KeyName = "Primary" + // KeyNameSecondary ... + KeyNameSecondary KeyName = "Secondary" +) + +// PossibleKeyNameValues returns an array of possible values for the KeyName const type. +func PossibleKeyNameValues() []KeyName { + return []KeyName{KeyNamePrimary, KeyNameSecondary} +} + +// KeyPermissions enumerates the values for key permissions. +type KeyPermissions string + +const ( + // Full ... + Full KeyPermissions = "Full" + // Read ... + Read KeyPermissions = "Read" +) + +// PossibleKeyPermissionsValues returns an array of possible values for the KeyPermissions const type. +func PossibleKeyPermissionsValues() []KeyPermissions { + return []KeyPermissions{Full, Read} +} + +// LinuxUpdateClasses enumerates the values for linux update classes. +type LinuxUpdateClasses string + +const ( + // Critical ... + Critical LinuxUpdateClasses = "Critical" + // Other ... + Other LinuxUpdateClasses = "Other" + // Security ... + Security LinuxUpdateClasses = "Security" + // Unclassified ... + Unclassified LinuxUpdateClasses = "Unclassified" +) + +// PossibleLinuxUpdateClassesValues returns an array of possible values for the LinuxUpdateClasses const type. +func PossibleLinuxUpdateClassesValues() []LinuxUpdateClasses { + return []LinuxUpdateClasses{Critical, Other, Security, Unclassified} +} + +// ModuleProvisioningState enumerates the values for module provisioning state. +type ModuleProvisioningState string + +const ( + // ModuleProvisioningStateActivitiesStored ... + ModuleProvisioningStateActivitiesStored ModuleProvisioningState = "ActivitiesStored" + // ModuleProvisioningStateCancelled ... + ModuleProvisioningStateCancelled ModuleProvisioningState = "Cancelled" + // ModuleProvisioningStateConnectionTypeImported ... + ModuleProvisioningStateConnectionTypeImported ModuleProvisioningState = "ConnectionTypeImported" + // ModuleProvisioningStateContentDownloaded ... + ModuleProvisioningStateContentDownloaded ModuleProvisioningState = "ContentDownloaded" + // ModuleProvisioningStateContentRetrieved ... + ModuleProvisioningStateContentRetrieved ModuleProvisioningState = "ContentRetrieved" + // ModuleProvisioningStateContentStored ... + ModuleProvisioningStateContentStored ModuleProvisioningState = "ContentStored" + // ModuleProvisioningStateContentValidated ... + ModuleProvisioningStateContentValidated ModuleProvisioningState = "ContentValidated" + // ModuleProvisioningStateCreated ... + ModuleProvisioningStateCreated ModuleProvisioningState = "Created" + // ModuleProvisioningStateCreating ... + ModuleProvisioningStateCreating ModuleProvisioningState = "Creating" + // ModuleProvisioningStateFailed ... + ModuleProvisioningStateFailed ModuleProvisioningState = "Failed" + // ModuleProvisioningStateModuleDataStored ... + ModuleProvisioningStateModuleDataStored ModuleProvisioningState = "ModuleDataStored" + // ModuleProvisioningStateModuleImportRunbookComplete ... + ModuleProvisioningStateModuleImportRunbookComplete ModuleProvisioningState = "ModuleImportRunbookComplete" + // ModuleProvisioningStateRunningImportModuleRunbook ... + ModuleProvisioningStateRunningImportModuleRunbook ModuleProvisioningState = "RunningImportModuleRunbook" + // ModuleProvisioningStateStartingImportModuleRunbook ... + ModuleProvisioningStateStartingImportModuleRunbook ModuleProvisioningState = "StartingImportModuleRunbook" + // ModuleProvisioningStateSucceeded ... + ModuleProvisioningStateSucceeded ModuleProvisioningState = "Succeeded" + // ModuleProvisioningStateUpdating ... + ModuleProvisioningStateUpdating ModuleProvisioningState = "Updating" +) + +// PossibleModuleProvisioningStateValues returns an array of possible values for the ModuleProvisioningState const type. +func PossibleModuleProvisioningStateValues() []ModuleProvisioningState { + return []ModuleProvisioningState{ModuleProvisioningStateActivitiesStored, ModuleProvisioningStateCancelled, ModuleProvisioningStateConnectionTypeImported, ModuleProvisioningStateContentDownloaded, ModuleProvisioningStateContentRetrieved, ModuleProvisioningStateContentStored, ModuleProvisioningStateContentValidated, ModuleProvisioningStateCreated, ModuleProvisioningStateCreating, ModuleProvisioningStateFailed, ModuleProvisioningStateModuleDataStored, ModuleProvisioningStateModuleImportRunbookComplete, ModuleProvisioningStateRunningImportModuleRunbook, ModuleProvisioningStateStartingImportModuleRunbook, ModuleProvisioningStateSucceeded, ModuleProvisioningStateUpdating} +} + +// OperatingSystemType enumerates the values for operating system type. +type OperatingSystemType string + +const ( + // Linux ... + Linux OperatingSystemType = "Linux" + // Windows ... + Windows OperatingSystemType = "Windows" +) + +// PossibleOperatingSystemTypeValues returns an array of possible values for the OperatingSystemType const type. +func PossibleOperatingSystemTypeValues() []OperatingSystemType { + return []OperatingSystemType{Linux, Windows} +} + +// ProvisioningState enumerates the values for provisioning state. +type ProvisioningState string + +const ( + // Completed ... + Completed ProvisioningState = "Completed" + // Failed ... + Failed ProvisioningState = "Failed" + // Running ... + Running ProvisioningState = "Running" +) + +// PossibleProvisioningStateValues returns an array of possible values for the ProvisioningState const type. +func PossibleProvisioningStateValues() []ProvisioningState { + return []ProvisioningState{Completed, Failed, Running} +} + +// RunbookProvisioningState enumerates the values for runbook provisioning state. +type RunbookProvisioningState string + +const ( + // RunbookProvisioningStateSucceeded ... + RunbookProvisioningStateSucceeded RunbookProvisioningState = "Succeeded" +) + +// PossibleRunbookProvisioningStateValues returns an array of possible values for the RunbookProvisioningState const type. +func PossibleRunbookProvisioningStateValues() []RunbookProvisioningState { + return []RunbookProvisioningState{RunbookProvisioningStateSucceeded} +} + +// RunbookState enumerates the values for runbook state. +type RunbookState string + +const ( + // RunbookStateEdit ... + RunbookStateEdit RunbookState = "Edit" + // RunbookStateNew ... + RunbookStateNew RunbookState = "New" + // RunbookStatePublished ... + RunbookStatePublished RunbookState = "Published" +) + +// PossibleRunbookStateValues returns an array of possible values for the RunbookState const type. +func PossibleRunbookStateValues() []RunbookState { + return []RunbookState{RunbookStateEdit, RunbookStateNew, RunbookStatePublished} +} + +// RunbookTypeEnum enumerates the values for runbook type enum. +type RunbookTypeEnum string + +const ( + // Graph ... + Graph RunbookTypeEnum = "Graph" + // GraphPowerShell ... + GraphPowerShell RunbookTypeEnum = "GraphPowerShell" + // GraphPowerShellWorkflow ... + GraphPowerShellWorkflow RunbookTypeEnum = "GraphPowerShellWorkflow" + // PowerShell ... + PowerShell RunbookTypeEnum = "PowerShell" + // PowerShellWorkflow ... + PowerShellWorkflow RunbookTypeEnum = "PowerShellWorkflow" + // Script ... + Script RunbookTypeEnum = "Script" +) + +// PossibleRunbookTypeEnumValues returns an array of possible values for the RunbookTypeEnum const type. +func PossibleRunbookTypeEnumValues() []RunbookTypeEnum { + return []RunbookTypeEnum{Graph, GraphPowerShell, GraphPowerShellWorkflow, PowerShell, PowerShellWorkflow, Script} +} + +// ScheduleDay enumerates the values for schedule day. +type ScheduleDay string + +const ( + // Friday ... + Friday ScheduleDay = "Friday" + // Monday ... + Monday ScheduleDay = "Monday" + // Saturday ... + Saturday ScheduleDay = "Saturday" + // Sunday ... + Sunday ScheduleDay = "Sunday" + // Thursday ... + Thursday ScheduleDay = "Thursday" + // Tuesday ... + Tuesday ScheduleDay = "Tuesday" + // Wednesday ... + Wednesday ScheduleDay = "Wednesday" +) + +// PossibleScheduleDayValues returns an array of possible values for the ScheduleDay const type. +func PossibleScheduleDayValues() []ScheduleDay { + return []ScheduleDay{Friday, Monday, Saturday, Sunday, Thursday, Tuesday, Wednesday} +} + +// ScheduleFrequency enumerates the values for schedule frequency. +type ScheduleFrequency string + +const ( + // Day ... + Day ScheduleFrequency = "Day" + // Hour ... + Hour ScheduleFrequency = "Hour" + // Month ... + Month ScheduleFrequency = "Month" + // OneTime ... + OneTime ScheduleFrequency = "OneTime" + // Week ... + Week ScheduleFrequency = "Week" +) + +// PossibleScheduleFrequencyValues returns an array of possible values for the ScheduleFrequency const type. +func PossibleScheduleFrequencyValues() []ScheduleFrequency { + return []ScheduleFrequency{Day, Hour, Month, OneTime, Week} +} + +// SkuNameEnum enumerates the values for sku name enum. +type SkuNameEnum string + +const ( + // Basic ... + Basic SkuNameEnum = "Basic" + // Free ... + Free SkuNameEnum = "Free" +) + +// PossibleSkuNameEnumValues returns an array of possible values for the SkuNameEnum const type. +func PossibleSkuNameEnumValues() []SkuNameEnum { + return []SkuNameEnum{Basic, Free} +} + +// SourceType enumerates the values for source type. +type SourceType string + +const ( + // GitHub ... + GitHub SourceType = "GitHub" + // VsoGit ... + VsoGit SourceType = "VsoGit" + // VsoTfvc ... + VsoTfvc SourceType = "VsoTfvc" +) + +// PossibleSourceTypeValues returns an array of possible values for the SourceType const type. +func PossibleSourceTypeValues() []SourceType { + return []SourceType{GitHub, VsoGit, VsoTfvc} +} + +// StartType enumerates the values for start type. +type StartType string + +const ( + // AutoSync ... + AutoSync StartType = "AutoSync" + // ManualSync ... + ManualSync StartType = "ManualSync" +) + +// PossibleStartTypeValues returns an array of possible values for the StartType const type. +func PossibleStartTypeValues() []StartType { + return []StartType{AutoSync, ManualSync} +} + +// StreamType enumerates the values for stream type. +type StreamType string + +const ( + // StreamTypeError ... + StreamTypeError StreamType = "Error" + // StreamTypeOutput ... + StreamTypeOutput StreamType = "Output" +) + +// PossibleStreamTypeValues returns an array of possible values for the StreamType const type. +func PossibleStreamTypeValues() []StreamType { + return []StreamType{StreamTypeError, StreamTypeOutput} +} + +// WindowsUpdateClasses enumerates the values for windows update classes. +type WindowsUpdateClasses string + +const ( + // WindowsUpdateClassesCritical ... + WindowsUpdateClassesCritical WindowsUpdateClasses = "Critical" + // WindowsUpdateClassesDefinition ... + WindowsUpdateClassesDefinition WindowsUpdateClasses = "Definition" + // WindowsUpdateClassesFeaturePack ... + WindowsUpdateClassesFeaturePack WindowsUpdateClasses = "FeaturePack" + // WindowsUpdateClassesSecurity ... + WindowsUpdateClassesSecurity WindowsUpdateClasses = "Security" + // WindowsUpdateClassesServicePack ... + WindowsUpdateClassesServicePack WindowsUpdateClasses = "ServicePack" + // WindowsUpdateClassesTools ... + WindowsUpdateClassesTools WindowsUpdateClasses = "Tools" + // WindowsUpdateClassesUnclassified ... + WindowsUpdateClassesUnclassified WindowsUpdateClasses = "Unclassified" + // WindowsUpdateClassesUpdateRollup ... + WindowsUpdateClassesUpdateRollup WindowsUpdateClasses = "UpdateRollup" + // WindowsUpdateClassesUpdates ... + WindowsUpdateClassesUpdates WindowsUpdateClasses = "Updates" +) + +// PossibleWindowsUpdateClassesValues returns an array of possible values for the WindowsUpdateClasses const type. +func PossibleWindowsUpdateClassesValues() []WindowsUpdateClasses { + return []WindowsUpdateClasses{WindowsUpdateClassesCritical, WindowsUpdateClassesDefinition, WindowsUpdateClassesFeaturePack, WindowsUpdateClassesSecurity, WindowsUpdateClassesServicePack, WindowsUpdateClassesTools, WindowsUpdateClassesUnclassified, WindowsUpdateClassesUpdateRollup, WindowsUpdateClassesUpdates} +} + +// Account definition of the automation account type. +type Account struct { + autorest.Response `json:"-"` + // AccountProperties - Gets or sets the automation account properties. + *AccountProperties `json:"properties,omitempty"` + // Etag - Gets or sets the etag of the resource. + Etag *string `json:"etag,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // Location - The Azure Region where the resource lives + Location *string `json:"location,omitempty"` + // ID - Fully qualified resource Id for the resource + ID *string `json:"id,omitempty"` + // Name - The name of the resource + Name *string `json:"name,omitempty"` + // Type - The type of the resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Account. +func (a Account) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if a.AccountProperties != nil { + objectMap["properties"] = a.AccountProperties + } + if a.Etag != nil { + objectMap["etag"] = a.Etag + } + if a.Tags != nil { + objectMap["tags"] = a.Tags + } + if a.Location != nil { + objectMap["location"] = a.Location + } + if a.ID != nil { + objectMap["id"] = a.ID + } + if a.Name != nil { + objectMap["name"] = a.Name + } + if a.Type != nil { + objectMap["type"] = a.Type + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Account struct. +func (a *Account) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var accountProperties AccountProperties + err = json.Unmarshal(*v, &accountProperties) + if err != nil { + return err + } + a.AccountProperties = &accountProperties + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + a.Etag = &etag + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + a.Tags = tags + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + a.Location = &location + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + a.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + a.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + a.Type = &typeVar + } + } + } + + return nil +} + +// AccountCreateOrUpdateParameters the parameters supplied to the create or update automation account operation. +type AccountCreateOrUpdateParameters struct { + // AccountCreateOrUpdateProperties - Gets or sets account create or update properties. + *AccountCreateOrUpdateProperties `json:"properties,omitempty"` + // Name - Gets or sets name of the resource. + Name *string `json:"name,omitempty"` + // Location - Gets or sets the location of the resource. + Location *string `json:"location,omitempty"` + // Tags - Gets or sets the tags attached to the resource. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for AccountCreateOrUpdateParameters. +func (acoup AccountCreateOrUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if acoup.AccountCreateOrUpdateProperties != nil { + objectMap["properties"] = acoup.AccountCreateOrUpdateProperties + } + if acoup.Name != nil { + objectMap["name"] = acoup.Name + } + if acoup.Location != nil { + objectMap["location"] = acoup.Location + } + if acoup.Tags != nil { + objectMap["tags"] = acoup.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for AccountCreateOrUpdateParameters struct. +func (acoup *AccountCreateOrUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var accountCreateOrUpdateProperties AccountCreateOrUpdateProperties + err = json.Unmarshal(*v, &accountCreateOrUpdateProperties) + if err != nil { + return err + } + acoup.AccountCreateOrUpdateProperties = &accountCreateOrUpdateProperties + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + acoup.Name = &name + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + acoup.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + acoup.Tags = tags + } + } + } + + return nil +} + +// AccountCreateOrUpdateProperties the parameters supplied to the create or update account properties. +type AccountCreateOrUpdateProperties struct { + // Sku - Gets or sets account SKU. + Sku *Sku `json:"sku,omitempty"` +} + +// AccountListResult the response model for the list account operation. +type AccountListResult struct { + autorest.Response `json:"-"` + // Value - Gets or sets list of accounts. + Value *[]Account `json:"value,omitempty"` + // NextLink - Gets or sets the next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// AccountListResultIterator provides access to a complete listing of Account values. +type AccountListResultIterator struct { + i int + page AccountListResultPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *AccountListResultIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter AccountListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter AccountListResultIterator) Response() AccountListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter AccountListResultIterator) Value() Account { + if !iter.page.NotDone() { + return Account{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (alr AccountListResult) IsEmpty() bool { + return alr.Value == nil || len(*alr.Value) == 0 +} + +// accountListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (alr AccountListResult) accountListResultPreparer() (*http.Request, error) { + if alr.NextLink == nil || len(to.String(alr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(alr.NextLink))) +} + +// AccountListResultPage contains a page of Account values. +type AccountListResultPage struct { + fn func(AccountListResult) (AccountListResult, error) + alr AccountListResult +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *AccountListResultPage) Next() error { + next, err := page.fn(page.alr) + if err != nil { + return err + } + page.alr = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page AccountListResultPage) NotDone() bool { + return !page.alr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page AccountListResultPage) Response() AccountListResult { + return page.alr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page AccountListResultPage) Values() []Account { + if page.alr.IsEmpty() { + return nil + } + return *page.alr.Value +} + +// AccountProperties definition of the account property. +type AccountProperties struct { + // Sku - Gets or sets the SKU of account. + Sku *Sku `json:"sku,omitempty"` + // LastModifiedBy - Gets or sets the last modified by. + LastModifiedBy *string `json:"lastModifiedBy,omitempty"` + // State - Gets status of account. Possible values include: 'Ok', 'Unavailable', 'Suspended' + State AccountState `json:"state,omitempty"` + // CreationTime - Gets the creation time. + CreationTime *date.Time `json:"creationTime,omitempty"` + // LastModifiedTime - Gets the last modified time. + LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` + // Description - Gets or sets the description. + Description *string `json:"description,omitempty"` +} + +// AccountUpdateParameters the parameters supplied to the update automation account operation. +type AccountUpdateParameters struct { + // AccountUpdateProperties - Gets or sets account update properties. + *AccountUpdateProperties `json:"properties,omitempty"` + // Name - Gets or sets the name of the resource. + Name *string `json:"name,omitempty"` + // Location - Gets or sets the location of the resource. + Location *string `json:"location,omitempty"` + // Tags - Gets or sets the tags attached to the resource. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for AccountUpdateParameters. +func (aup AccountUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if aup.AccountUpdateProperties != nil { + objectMap["properties"] = aup.AccountUpdateProperties + } + if aup.Name != nil { + objectMap["name"] = aup.Name + } + if aup.Location != nil { + objectMap["location"] = aup.Location + } + if aup.Tags != nil { + objectMap["tags"] = aup.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for AccountUpdateParameters struct. +func (aup *AccountUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var accountUpdateProperties AccountUpdateProperties + err = json.Unmarshal(*v, &accountUpdateProperties) + if err != nil { + return err + } + aup.AccountUpdateProperties = &accountUpdateProperties + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + aup.Name = &name + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + aup.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + aup.Tags = tags + } + } + } + + return nil +} + +// AccountUpdateProperties the parameters supplied to the update account properties. +type AccountUpdateProperties struct { + // Sku - Gets or sets account SKU. + Sku *Sku `json:"sku,omitempty"` +} + +// Activity definition of the activity. +type Activity struct { + autorest.Response `json:"-"` + // ID - Gets or sets the id of the resource. + ID *string `json:"id,omitempty"` + // Name - Gets the name of the activity. + Name *string `json:"name,omitempty"` + // ActivityProperties - Gets or sets the properties of the activity. + *ActivityProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for Activity. +func (a Activity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if a.ID != nil { + objectMap["id"] = a.ID + } + if a.Name != nil { + objectMap["name"] = a.Name + } + if a.ActivityProperties != nil { + objectMap["properties"] = a.ActivityProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Activity struct. +func (a *Activity) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + a.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + a.Name = &name + } + case "properties": + if v != nil { + var activityProperties ActivityProperties + err = json.Unmarshal(*v, &activityProperties) + if err != nil { + return err + } + a.ActivityProperties = &activityProperties + } + } + } + + return nil +} + +// ActivityListResult the response model for the list activity operation. +type ActivityListResult struct { + autorest.Response `json:"-"` + // Value - Gets or sets a list of activities. + Value *[]Activity `json:"value,omitempty"` + // NextLink - Gets or sets the next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// ActivityListResultIterator provides access to a complete listing of Activity values. +type ActivityListResultIterator struct { + i int + page ActivityListResultPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ActivityListResultIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ActivityListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ActivityListResultIterator) Response() ActivityListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ActivityListResultIterator) Value() Activity { + if !iter.page.NotDone() { + return Activity{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (alr ActivityListResult) IsEmpty() bool { + return alr.Value == nil || len(*alr.Value) == 0 +} + +// activityListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (alr ActivityListResult) activityListResultPreparer() (*http.Request, error) { + if alr.NextLink == nil || len(to.String(alr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(alr.NextLink))) +} + +// ActivityListResultPage contains a page of Activity values. +type ActivityListResultPage struct { + fn func(ActivityListResult) (ActivityListResult, error) + alr ActivityListResult +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ActivityListResultPage) Next() error { + next, err := page.fn(page.alr) + if err != nil { + return err + } + page.alr = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ActivityListResultPage) NotDone() bool { + return !page.alr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ActivityListResultPage) Response() ActivityListResult { + return page.alr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ActivityListResultPage) Values() []Activity { + if page.alr.IsEmpty() { + return nil + } + return *page.alr.Value +} + +// ActivityOutputType definition of the activity output type. +type ActivityOutputType struct { + // Name - Gets or sets the name of the activity output type. + Name *string `json:"name,omitempty"` + // Type - Gets or sets the type of the activity output type. + Type *string `json:"type,omitempty"` +} + +// ActivityParameter definition of the activity parameter. +type ActivityParameter struct { + // Name - Gets or sets the name of the activity parameter. + Name *string `json:"name,omitempty"` + // Type - Gets or sets the type of the activity parameter. + Type *string `json:"type,omitempty"` + // IsMandatory - Gets or sets a Boolean value that indicates true if the parameter is required. If the value is false, the parameter is optional. + IsMandatory *bool `json:"isMandatory,omitempty"` + // IsDynamic - Gets or sets a Boolean value that indicates true if the parameter is dynamic. + IsDynamic *bool `json:"isDynamic,omitempty"` + // Position - Gets or sets the position of the activity parameter. + Position *int64 `json:"position,omitempty"` + // ValueFromPipeline - Gets or sets a Boolean value that indicates true if the parameter can take values from the incoming pipeline objects. This setting is used if the cmdlet must access the complete input object. false indicates that the parameter cannot take values from the complete input object. + ValueFromPipeline *bool `json:"valueFromPipeline,omitempty"` + // ValueFromPipelineByPropertyName - Gets or sets a Boolean value that indicates true if the parameter can be filled from a property of the incoming pipeline object that has the same name as this parameter. false indicates that the parameter cannot be filled from the incoming pipeline object property with the same name. + ValueFromPipelineByPropertyName *bool `json:"valueFromPipelineByPropertyName,omitempty"` + // ValueFromRemainingArguments - Gets or sets a Boolean value that indicates true if the cmdlet parameter accepts all the remaining command-line arguments that are associated with this parameter in the form of an array. false if the cmdlet parameter does not accept all the remaining argument values. + ValueFromRemainingArguments *bool `json:"valueFromRemainingArguments,omitempty"` + // Description - Gets or sets the description of the activity parameter. + Description *string `json:"description,omitempty"` + // ValidationSet - Gets or sets the validation set of activity parameter. + ValidationSet *[]ActivityParameterValidationSet `json:"validationSet,omitempty"` +} + +// ActivityParameterSet definition of the activity parameter set. +type ActivityParameterSet struct { + // Name - Gets or sets the name of the activity parameter set. + Name *string `json:"name,omitempty"` + // Parameters - Gets or sets the parameters of the activity parameter set. + Parameters *[]ActivityParameter `json:"parameters,omitempty"` +} + +// ActivityParameterValidationSet definition of the activity parameter validation set. +type ActivityParameterValidationSet struct { + // MemberValue - Gets or sets the name of the activity parameter validation set member. + MemberValue *string `json:"memberValue,omitempty"` +} + +// ActivityProperties properties of the activity. +type ActivityProperties struct { + // Definition - Gets or sets the user name of the activity. + Definition *string `json:"definition,omitempty"` + // ParameterSets - Gets or sets the parameter sets of the activity. + ParameterSets *[]ActivityParameterSet `json:"parameterSets,omitempty"` + // OutputTypes - Gets or sets the output types of the activity. + OutputTypes *[]ActivityOutputType `json:"outputTypes,omitempty"` + // CreationTime - Gets or sets the creation time. + CreationTime *date.Time `json:"creationTime,omitempty"` + // LastModifiedTime - Gets or sets the last modified time. + LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` + // Description - Gets or sets the description. + Description *string `json:"description,omitempty"` +} + +// AdvancedSchedule the properties of the create Advanced Schedule. +type AdvancedSchedule struct { + // WeekDays - Days of the week that the job should execute on. + WeekDays *[]string `json:"weekDays,omitempty"` + // MonthDays - Days of the month that the job should execute on. Must be between 1 and 31. + MonthDays *[]int32 `json:"monthDays,omitempty"` + // MonthlyOccurrences - Occurrences of days within a month. + MonthlyOccurrences *[]AdvancedScheduleMonthlyOccurrence `json:"monthlyOccurrences,omitempty"` +} + +// AdvancedScheduleMonthlyOccurrence the properties of the create advanced schedule monthly occurrence. +type AdvancedScheduleMonthlyOccurrence struct { + // Occurrence - Occurrence of the week within the month. Must be between 1 and 5 + Occurrence *int32 `json:"occurrence,omitempty"` + // Day - Day of the occurrence. Must be one of monday, tuesday, wednesday, thursday, friday, saturday, sunday. Possible values include: 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday' + Day ScheduleDay `json:"day,omitempty"` +} + +// AgentRegistration definition of the agent registration infomration type. +type AgentRegistration struct { + autorest.Response `json:"-"` + // DscMetaConfiguration - Gets or sets the dsc meta configuration. + DscMetaConfiguration *string `json:"dscMetaConfiguration,omitempty"` + // Endpoint - Gets or sets the dsc server endpoint. + Endpoint *string `json:"endpoint,omitempty"` + // Keys - Gets or sets the agent registration keys. + Keys *AgentRegistrationKeys `json:"keys,omitempty"` + // ID - Gets or sets the id. + ID *string `json:"id,omitempty"` +} + +// AgentRegistrationKeys definition of the agent registration keys. +type AgentRegistrationKeys struct { + // Primary - Gets or sets the primary key. + Primary *string `json:"primary,omitempty"` + // Secondary - Gets or sets the secondary key. + Secondary *string `json:"secondary,omitempty"` +} + +// AgentRegistrationRegenerateKeyParameter the parameters supplied to the regenerate keys operation. +type AgentRegistrationRegenerateKeyParameter struct { + // KeyName - Gets or sets the agent registration key name - primary or secondary. Possible values include: 'Primary', 'Secondary' + KeyName AgentRegistrationKeyName `json:"keyName,omitempty"` +} + +// Certificate definition of the certificate. +type Certificate struct { + autorest.Response `json:"-"` + // CertificateProperties - Gets or sets the properties of the certificate. + *CertificateProperties `json:"properties,omitempty"` + // ID - Fully qualified resource Id for the resource + ID *string `json:"id,omitempty"` + // Name - The name of the resource + Name *string `json:"name,omitempty"` + // Type - The type of the resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Certificate. +func (c Certificate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if c.CertificateProperties != nil { + objectMap["properties"] = c.CertificateProperties + } + if c.ID != nil { + objectMap["id"] = c.ID + } + if c.Name != nil { + objectMap["name"] = c.Name + } + if c.Type != nil { + objectMap["type"] = c.Type + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Certificate struct. +func (c *Certificate) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var certificateProperties CertificateProperties + err = json.Unmarshal(*v, &certificateProperties) + if err != nil { + return err + } + c.CertificateProperties = &certificateProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + c.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + c.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + c.Type = &typeVar + } + } + } + + return nil +} + +// CertificateCreateOrUpdateParameters the parameters supplied to the create or update or replace certificate +// operation. +type CertificateCreateOrUpdateParameters struct { + // Name - Gets or sets the name of the certificate. + Name *string `json:"name,omitempty"` + // CertificateCreateOrUpdateProperties - Gets or sets the properties of the certificate. + *CertificateCreateOrUpdateProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for CertificateCreateOrUpdateParameters. +func (ccoup CertificateCreateOrUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ccoup.Name != nil { + objectMap["name"] = ccoup.Name + } + if ccoup.CertificateCreateOrUpdateProperties != nil { + objectMap["properties"] = ccoup.CertificateCreateOrUpdateProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for CertificateCreateOrUpdateParameters struct. +func (ccoup *CertificateCreateOrUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ccoup.Name = &name + } + case "properties": + if v != nil { + var certificateCreateOrUpdateProperties CertificateCreateOrUpdateProperties + err = json.Unmarshal(*v, &certificateCreateOrUpdateProperties) + if err != nil { + return err + } + ccoup.CertificateCreateOrUpdateProperties = &certificateCreateOrUpdateProperties + } + } + } + + return nil +} + +// CertificateCreateOrUpdateProperties the properties of the create certificate operation. +type CertificateCreateOrUpdateProperties struct { + // Base64Value - Gets or sets the base64 encoded value of the certificate. + Base64Value *string `json:"base64Value,omitempty"` + // Description - Gets or sets the description of the certificate. + Description *string `json:"description,omitempty"` + // Thumbprint - Gets or sets the thumbprint of the certificate. + Thumbprint *string `json:"thumbprint,omitempty"` + // IsExportable - Gets or sets the is exportable flag of the certificate. + IsExportable *bool `json:"isExportable,omitempty"` +} + +// CertificateListResult the response model for the list certificate operation. +type CertificateListResult struct { + autorest.Response `json:"-"` + // Value - Gets or sets a list of certificates. + Value *[]Certificate `json:"value,omitempty"` + // NextLink - Gets or sets the next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// CertificateListResultIterator provides access to a complete listing of Certificate values. +type CertificateListResultIterator struct { + i int + page CertificateListResultPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *CertificateListResultIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter CertificateListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter CertificateListResultIterator) Response() CertificateListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter CertificateListResultIterator) Value() Certificate { + if !iter.page.NotDone() { + return Certificate{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (clr CertificateListResult) IsEmpty() bool { + return clr.Value == nil || len(*clr.Value) == 0 +} + +// certificateListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (clr CertificateListResult) certificateListResultPreparer() (*http.Request, error) { + if clr.NextLink == nil || len(to.String(clr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(clr.NextLink))) +} + +// CertificateListResultPage contains a page of Certificate values. +type CertificateListResultPage struct { + fn func(CertificateListResult) (CertificateListResult, error) + clr CertificateListResult +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *CertificateListResultPage) Next() error { + next, err := page.fn(page.clr) + if err != nil { + return err + } + page.clr = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page CertificateListResultPage) NotDone() bool { + return !page.clr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page CertificateListResultPage) Response() CertificateListResult { + return page.clr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page CertificateListResultPage) Values() []Certificate { + if page.clr.IsEmpty() { + return nil + } + return *page.clr.Value +} + +// CertificateProperties properties of the certificate. +type CertificateProperties struct { + // Thumbprint - Gets the thumbprint of the certificate. + Thumbprint *string `json:"thumbprint,omitempty"` + // ExpiryTime - Gets the expiry time of the certificate. + ExpiryTime *date.Time `json:"expiryTime,omitempty"` + // IsExportable - Gets the is exportable flag of the certificate. + IsExportable *bool `json:"isExportable,omitempty"` + // CreationTime - Gets the creation time. + CreationTime *date.Time `json:"creationTime,omitempty"` + // LastModifiedTime - Gets the last modified time. + LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` + // Description - Gets or sets the description. + Description *string `json:"description,omitempty"` +} + +// CertificateUpdateParameters the parameters supplied to the update certificate operation. +type CertificateUpdateParameters struct { + // Name - Gets or sets the name of the certificate. + Name *string `json:"name,omitempty"` + // CertificateUpdateProperties - Gets or sets the properties of the certificate. + *CertificateUpdateProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for CertificateUpdateParameters. +func (cup CertificateUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cup.Name != nil { + objectMap["name"] = cup.Name + } + if cup.CertificateUpdateProperties != nil { + objectMap["properties"] = cup.CertificateUpdateProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for CertificateUpdateParameters struct. +func (cup *CertificateUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + cup.Name = &name + } + case "properties": + if v != nil { + var certificateUpdateProperties CertificateUpdateProperties + err = json.Unmarshal(*v, &certificateUpdateProperties) + if err != nil { + return err + } + cup.CertificateUpdateProperties = &certificateUpdateProperties + } + } + } + + return nil +} + +// CertificateUpdateProperties the properties of the update certificate operation +type CertificateUpdateProperties struct { + // Description - Gets or sets the description of the certificate. + Description *string `json:"description,omitempty"` +} + +// CollectionItemUpdateConfiguration object returned when requesting a collection of software update configuration +type CollectionItemUpdateConfiguration struct { + // AzureVirtualMachines - List of azure resource Ids for azure virtual machines targeted by the software update configuration. + AzureVirtualMachines *[]string `json:"azureVirtualMachines,omitempty"` + // Duration - Maximum time allowed for the software update configuration run. Duration needs to be specified using the format PT[n]H[n]M[n]S as per ISO8601 + Duration *string `json:"duration,omitempty"` +} + +// Connection definition of the connection. +type Connection struct { + autorest.Response `json:"-"` + // ConnectionProperties - Gets or sets the properties of the connection. + *ConnectionProperties `json:"properties,omitempty"` + // ID - Fully qualified resource Id for the resource + ID *string `json:"id,omitempty"` + // Name - The name of the resource + Name *string `json:"name,omitempty"` + // Type - The type of the resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Connection. +func (c Connection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if c.ConnectionProperties != nil { + objectMap["properties"] = c.ConnectionProperties + } + if c.ID != nil { + objectMap["id"] = c.ID + } + if c.Name != nil { + objectMap["name"] = c.Name + } + if c.Type != nil { + objectMap["type"] = c.Type + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Connection struct. +func (c *Connection) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var connectionProperties ConnectionProperties + err = json.Unmarshal(*v, &connectionProperties) + if err != nil { + return err + } + c.ConnectionProperties = &connectionProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + c.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + c.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + c.Type = &typeVar + } + } + } + + return nil +} + +// ConnectionCreateOrUpdateParameters the parameters supplied to the create or update connection operation. +type ConnectionCreateOrUpdateParameters struct { + // Name - Gets or sets the name of the connection. + Name *string `json:"name,omitempty"` + // ConnectionCreateOrUpdateProperties - Gets or sets the properties of the connection. + *ConnectionCreateOrUpdateProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for ConnectionCreateOrUpdateParameters. +func (ccoup ConnectionCreateOrUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ccoup.Name != nil { + objectMap["name"] = ccoup.Name + } + if ccoup.ConnectionCreateOrUpdateProperties != nil { + objectMap["properties"] = ccoup.ConnectionCreateOrUpdateProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ConnectionCreateOrUpdateParameters struct. +func (ccoup *ConnectionCreateOrUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ccoup.Name = &name + } + case "properties": + if v != nil { + var connectionCreateOrUpdateProperties ConnectionCreateOrUpdateProperties + err = json.Unmarshal(*v, &connectionCreateOrUpdateProperties) + if err != nil { + return err + } + ccoup.ConnectionCreateOrUpdateProperties = &connectionCreateOrUpdateProperties + } + } + } + + return nil +} + +// ConnectionCreateOrUpdateProperties the properties of the create connection properties +type ConnectionCreateOrUpdateProperties struct { + // Description - Gets or sets the description of the connection. + Description *string `json:"description,omitempty"` + // ConnectionType - Gets or sets the connectionType of the connection. + ConnectionType *ConnectionTypeAssociationProperty `json:"connectionType,omitempty"` + // FieldDefinitionValues - Gets or sets the field definition properties of the connection. + FieldDefinitionValues map[string]*string `json:"fieldDefinitionValues"` +} + +// MarshalJSON is the custom marshaler for ConnectionCreateOrUpdateProperties. +func (ccoup ConnectionCreateOrUpdateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ccoup.Description != nil { + objectMap["description"] = ccoup.Description + } + if ccoup.ConnectionType != nil { + objectMap["connectionType"] = ccoup.ConnectionType + } + if ccoup.FieldDefinitionValues != nil { + objectMap["fieldDefinitionValues"] = ccoup.FieldDefinitionValues + } + return json.Marshal(objectMap) +} + +// ConnectionListResult the response model for the list connection operation. +type ConnectionListResult struct { + autorest.Response `json:"-"` + // Value - Gets or sets a list of connection. + Value *[]Connection `json:"value,omitempty"` + // NextLink - Gets or sets the next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// ConnectionListResultIterator provides access to a complete listing of Connection values. +type ConnectionListResultIterator struct { + i int + page ConnectionListResultPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ConnectionListResultIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ConnectionListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ConnectionListResultIterator) Response() ConnectionListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ConnectionListResultIterator) Value() Connection { + if !iter.page.NotDone() { + return Connection{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (clr ConnectionListResult) IsEmpty() bool { + return clr.Value == nil || len(*clr.Value) == 0 +} + +// connectionListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (clr ConnectionListResult) connectionListResultPreparer() (*http.Request, error) { + if clr.NextLink == nil || len(to.String(clr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(clr.NextLink))) +} + +// ConnectionListResultPage contains a page of Connection values. +type ConnectionListResultPage struct { + fn func(ConnectionListResult) (ConnectionListResult, error) + clr ConnectionListResult +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ConnectionListResultPage) Next() error { + next, err := page.fn(page.clr) + if err != nil { + return err + } + page.clr = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ConnectionListResultPage) NotDone() bool { + return !page.clr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ConnectionListResultPage) Response() ConnectionListResult { + return page.clr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ConnectionListResultPage) Values() []Connection { + if page.clr.IsEmpty() { + return nil + } + return *page.clr.Value +} + +// ConnectionProperties definition of the connection properties. +type ConnectionProperties struct { + // ConnectionType - Gets or sets the connectionType of the connection. + ConnectionType *ConnectionTypeAssociationProperty `json:"connectionType,omitempty"` + // FieldDefinitionValues - Gets the field definition values of the connection. + FieldDefinitionValues map[string]*string `json:"fieldDefinitionValues"` + // CreationTime - Gets the creation time. + CreationTime *date.Time `json:"creationTime,omitempty"` + // LastModifiedTime - Gets the last modified time. + LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` + // Description - Gets or sets the description. + Description *string `json:"description,omitempty"` +} + +// MarshalJSON is the custom marshaler for ConnectionProperties. +func (cp ConnectionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cp.ConnectionType != nil { + objectMap["connectionType"] = cp.ConnectionType + } + if cp.FieldDefinitionValues != nil { + objectMap["fieldDefinitionValues"] = cp.FieldDefinitionValues + } + if cp.CreationTime != nil { + objectMap["creationTime"] = cp.CreationTime + } + if cp.LastModifiedTime != nil { + objectMap["lastModifiedTime"] = cp.LastModifiedTime + } + if cp.Description != nil { + objectMap["description"] = cp.Description + } + return json.Marshal(objectMap) +} + +// ConnectionType definition of the connection type. +type ConnectionType struct { + autorest.Response `json:"-"` + // ID - Gets the id of the resource. + ID *string `json:"id,omitempty"` + // Name - Gets the name of the connection type. + Name *string `json:"name,omitempty"` + // Type - Resource type + Type *string `json:"type,omitempty"` + // ConnectionTypeProperties - Gets or sets the properties of the connection type. + *ConnectionTypeProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for ConnectionType. +func (ct ConnectionType) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ct.ID != nil { + objectMap["id"] = ct.ID + } + if ct.Name != nil { + objectMap["name"] = ct.Name + } + if ct.Type != nil { + objectMap["type"] = ct.Type + } + if ct.ConnectionTypeProperties != nil { + objectMap["properties"] = ct.ConnectionTypeProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ConnectionType struct. +func (ct *ConnectionType) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ct.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ct.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ct.Type = &typeVar + } + case "properties": + if v != nil { + var connectionTypeProperties ConnectionTypeProperties + err = json.Unmarshal(*v, &connectionTypeProperties) + if err != nil { + return err + } + ct.ConnectionTypeProperties = &connectionTypeProperties + } + } + } + + return nil +} + +// ConnectionTypeAssociationProperty the connection type property associated with the entity. +type ConnectionTypeAssociationProperty struct { + // Name - Gets or sets the name of the connection type. + Name *string `json:"name,omitempty"` +} + +// ConnectionTypeCreateOrUpdateParameters the parameters supplied to the create or update connection type +// operation. +type ConnectionTypeCreateOrUpdateParameters struct { + // Name - Gets or sets the name of the connection type. + Name *string `json:"name,omitempty"` + // ConnectionTypeCreateOrUpdateProperties - Gets or sets the value of the connection type. + *ConnectionTypeCreateOrUpdateProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for ConnectionTypeCreateOrUpdateParameters. +func (ctcoup ConnectionTypeCreateOrUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ctcoup.Name != nil { + objectMap["name"] = ctcoup.Name + } + if ctcoup.ConnectionTypeCreateOrUpdateProperties != nil { + objectMap["properties"] = ctcoup.ConnectionTypeCreateOrUpdateProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ConnectionTypeCreateOrUpdateParameters struct. +func (ctcoup *ConnectionTypeCreateOrUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ctcoup.Name = &name + } + case "properties": + if v != nil { + var connectionTypeCreateOrUpdateProperties ConnectionTypeCreateOrUpdateProperties + err = json.Unmarshal(*v, &connectionTypeCreateOrUpdateProperties) + if err != nil { + return err + } + ctcoup.ConnectionTypeCreateOrUpdateProperties = &connectionTypeCreateOrUpdateProperties + } + } + } + + return nil +} + +// ConnectionTypeCreateOrUpdateProperties the properties of the create connection type. +type ConnectionTypeCreateOrUpdateProperties struct { + // IsGlobal - Gets or sets a Boolean value to indicate if the connection type is global. + IsGlobal *bool `json:"isGlobal,omitempty"` + // FieldDefinitions - Gets or sets the field definitions of the connection type. + FieldDefinitions map[string]*FieldDefinition `json:"fieldDefinitions"` +} + +// MarshalJSON is the custom marshaler for ConnectionTypeCreateOrUpdateProperties. +func (ctcoup ConnectionTypeCreateOrUpdateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ctcoup.IsGlobal != nil { + objectMap["isGlobal"] = ctcoup.IsGlobal + } + if ctcoup.FieldDefinitions != nil { + objectMap["fieldDefinitions"] = ctcoup.FieldDefinitions + } + return json.Marshal(objectMap) +} + +// ConnectionTypeListResult the response model for the list connection type operation. +type ConnectionTypeListResult struct { + autorest.Response `json:"-"` + // Value - Gets or sets a list of connection types. + Value *[]ConnectionType `json:"value,omitempty"` + // NextLink - Gets or sets the next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// ConnectionTypeListResultIterator provides access to a complete listing of ConnectionType values. +type ConnectionTypeListResultIterator struct { + i int + page ConnectionTypeListResultPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ConnectionTypeListResultIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ConnectionTypeListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ConnectionTypeListResultIterator) Response() ConnectionTypeListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ConnectionTypeListResultIterator) Value() ConnectionType { + if !iter.page.NotDone() { + return ConnectionType{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (ctlr ConnectionTypeListResult) IsEmpty() bool { + return ctlr.Value == nil || len(*ctlr.Value) == 0 +} + +// connectionTypeListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (ctlr ConnectionTypeListResult) connectionTypeListResultPreparer() (*http.Request, error) { + if ctlr.NextLink == nil || len(to.String(ctlr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(ctlr.NextLink))) +} + +// ConnectionTypeListResultPage contains a page of ConnectionType values. +type ConnectionTypeListResultPage struct { + fn func(ConnectionTypeListResult) (ConnectionTypeListResult, error) + ctlr ConnectionTypeListResult +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ConnectionTypeListResultPage) Next() error { + next, err := page.fn(page.ctlr) + if err != nil { + return err + } + page.ctlr = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ConnectionTypeListResultPage) NotDone() bool { + return !page.ctlr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ConnectionTypeListResultPage) Response() ConnectionTypeListResult { + return page.ctlr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ConnectionTypeListResultPage) Values() []ConnectionType { + if page.ctlr.IsEmpty() { + return nil + } + return *page.ctlr.Value +} + +// ConnectionTypeProperties properties of the connection type. +type ConnectionTypeProperties struct { + // IsGlobal - Gets or sets a Boolean value to indicate if the connection type is global. + IsGlobal *bool `json:"isGlobal,omitempty"` + // FieldDefinitions - Gets the field definitions of the connection type. + FieldDefinitions map[string]*FieldDefinition `json:"fieldDefinitions"` + // CreationTime - Gets the creation time. + CreationTime *date.Time `json:"creationTime,omitempty"` + // LastModifiedTime - Gets or sets the last modified time. + LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` + // Description - Gets or sets the description. + Description *string `json:"description,omitempty"` +} + +// MarshalJSON is the custom marshaler for ConnectionTypeProperties. +func (ctp ConnectionTypeProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ctp.IsGlobal != nil { + objectMap["isGlobal"] = ctp.IsGlobal + } + if ctp.FieldDefinitions != nil { + objectMap["fieldDefinitions"] = ctp.FieldDefinitions + } + if ctp.CreationTime != nil { + objectMap["creationTime"] = ctp.CreationTime + } + if ctp.LastModifiedTime != nil { + objectMap["lastModifiedTime"] = ctp.LastModifiedTime + } + if ctp.Description != nil { + objectMap["description"] = ctp.Description + } + return json.Marshal(objectMap) +} + +// ConnectionUpdateParameters the parameters supplied to the update connection operation. +type ConnectionUpdateParameters struct { + // Name - Gets or sets the name of the connection. + Name *string `json:"name,omitempty"` + // ConnectionUpdateProperties - Gets or sets the properties of the connection. + *ConnectionUpdateProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for ConnectionUpdateParameters. +func (cup ConnectionUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cup.Name != nil { + objectMap["name"] = cup.Name + } + if cup.ConnectionUpdateProperties != nil { + objectMap["properties"] = cup.ConnectionUpdateProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ConnectionUpdateParameters struct. +func (cup *ConnectionUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + cup.Name = &name + } + case "properties": + if v != nil { + var connectionUpdateProperties ConnectionUpdateProperties + err = json.Unmarshal(*v, &connectionUpdateProperties) + if err != nil { + return err + } + cup.ConnectionUpdateProperties = &connectionUpdateProperties + } + } + } + + return nil +} + +// ConnectionUpdateProperties the properties of the update connection operation. +type ConnectionUpdateProperties struct { + // Description - Gets or sets the description of the connection. + Description *string `json:"description,omitempty"` + // FieldDefinitionValues - Gets or sets the field definition values of the connection. + FieldDefinitionValues map[string]*string `json:"fieldDefinitionValues"` +} + +// MarshalJSON is the custom marshaler for ConnectionUpdateProperties. +func (cup ConnectionUpdateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cup.Description != nil { + objectMap["description"] = cup.Description + } + if cup.FieldDefinitionValues != nil { + objectMap["fieldDefinitionValues"] = cup.FieldDefinitionValues + } + return json.Marshal(objectMap) +} + +// ContentHash definition of the runbook property type. +type ContentHash struct { + // Algorithm - Gets or sets the content hash algorithm used to hash the content. + Algorithm *string `json:"algorithm,omitempty"` + // Value - Gets or sets expected hash value of the content. + Value *string `json:"value,omitempty"` +} + +// ContentLink definition of the content link. +type ContentLink struct { + // URI - Gets or sets the uri of the runbook content. + URI *string `json:"uri,omitempty"` + // ContentHash - Gets or sets the hash. + ContentHash *ContentHash `json:"contentHash,omitempty"` + // Version - Gets or sets the version of the content. + Version *string `json:"version,omitempty"` +} + +// ContentSource definition of the content source. +type ContentSource struct { + // Hash - Gets or sets the hash. + Hash *ContentHash `json:"hash,omitempty"` + // Type - Gets or sets the content source type. Possible values include: 'EmbeddedContent', 'URI' + Type ContentSourceType `json:"type,omitempty"` + // Value - Gets or sets the value of the content. This is based on the content source type. + Value *string `json:"value,omitempty"` + // Version - Gets or sets the version of the content. + Version *string `json:"version,omitempty"` +} + +// Credential definition of the credential. +type Credential struct { + autorest.Response `json:"-"` + // CredentialProperties - Gets or sets the properties of the credential. + *CredentialProperties `json:"properties,omitempty"` + // ID - Fully qualified resource Id for the resource + ID *string `json:"id,omitempty"` + // Name - The name of the resource + Name *string `json:"name,omitempty"` + // Type - The type of the resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Credential. +func (c Credential) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if c.CredentialProperties != nil { + objectMap["properties"] = c.CredentialProperties + } + if c.ID != nil { + objectMap["id"] = c.ID + } + if c.Name != nil { + objectMap["name"] = c.Name + } + if c.Type != nil { + objectMap["type"] = c.Type + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Credential struct. +func (c *Credential) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var credentialProperties CredentialProperties + err = json.Unmarshal(*v, &credentialProperties) + if err != nil { + return err + } + c.CredentialProperties = &credentialProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + c.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + c.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + c.Type = &typeVar + } + } + } + + return nil +} + +// CredentialCreateOrUpdateParameters the parameters supplied to the create or update credential operation. +type CredentialCreateOrUpdateParameters struct { + // Name - Gets or sets the name of the credential. + Name *string `json:"name,omitempty"` + // CredentialCreateOrUpdateProperties - Gets or sets the properties of the credential. + *CredentialCreateOrUpdateProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for CredentialCreateOrUpdateParameters. +func (ccoup CredentialCreateOrUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ccoup.Name != nil { + objectMap["name"] = ccoup.Name + } + if ccoup.CredentialCreateOrUpdateProperties != nil { + objectMap["properties"] = ccoup.CredentialCreateOrUpdateProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for CredentialCreateOrUpdateParameters struct. +func (ccoup *CredentialCreateOrUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ccoup.Name = &name + } + case "properties": + if v != nil { + var credentialCreateOrUpdateProperties CredentialCreateOrUpdateProperties + err = json.Unmarshal(*v, &credentialCreateOrUpdateProperties) + if err != nil { + return err + } + ccoup.CredentialCreateOrUpdateProperties = &credentialCreateOrUpdateProperties + } + } + } + + return nil +} + +// CredentialCreateOrUpdateProperties the properties of the create cerdential operation. +type CredentialCreateOrUpdateProperties struct { + // UserName - Gets or sets the user name of the credential. + UserName *string `json:"userName,omitempty"` + // Password - Gets or sets the password of the credential. + Password *string `json:"password,omitempty"` + // Description - Gets or sets the description of the credential. + Description *string `json:"description,omitempty"` +} + +// CredentialListResult the response model for the list credential operation. +type CredentialListResult struct { + autorest.Response `json:"-"` + // Value - Gets or sets a list of credentials. + Value *[]Credential `json:"value,omitempty"` + // NextLink - Gets or sets the next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// CredentialListResultIterator provides access to a complete listing of Credential values. +type CredentialListResultIterator struct { + i int + page CredentialListResultPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *CredentialListResultIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter CredentialListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter CredentialListResultIterator) Response() CredentialListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter CredentialListResultIterator) Value() Credential { + if !iter.page.NotDone() { + return Credential{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (clr CredentialListResult) IsEmpty() bool { + return clr.Value == nil || len(*clr.Value) == 0 +} + +// credentialListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (clr CredentialListResult) credentialListResultPreparer() (*http.Request, error) { + if clr.NextLink == nil || len(to.String(clr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(clr.NextLink))) +} + +// CredentialListResultPage contains a page of Credential values. +type CredentialListResultPage struct { + fn func(CredentialListResult) (CredentialListResult, error) + clr CredentialListResult +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *CredentialListResultPage) Next() error { + next, err := page.fn(page.clr) + if err != nil { + return err + } + page.clr = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page CredentialListResultPage) NotDone() bool { + return !page.clr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page CredentialListResultPage) Response() CredentialListResult { + return page.clr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page CredentialListResultPage) Values() []Credential { + if page.clr.IsEmpty() { + return nil + } + return *page.clr.Value +} + +// CredentialProperties definition of the credential properties +type CredentialProperties struct { + // UserName - Gets the user name of the credential. + UserName *string `json:"userName,omitempty"` + // CreationTime - Gets the creation time. + CreationTime *date.Time `json:"creationTime,omitempty"` + // LastModifiedTime - Gets the last modified time. + LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` + // Description - Gets or sets the description. + Description *string `json:"description,omitempty"` +} + +// CredentialUpdateParameters the parameters supplied to the Update credential operation. +type CredentialUpdateParameters struct { + // Name - Gets or sets the name of the credential. + Name *string `json:"name,omitempty"` + // CredentialUpdateProperties - Gets or sets the properties of the variable. + *CredentialUpdateProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for CredentialUpdateParameters. +func (cup CredentialUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cup.Name != nil { + objectMap["name"] = cup.Name + } + if cup.CredentialUpdateProperties != nil { + objectMap["properties"] = cup.CredentialUpdateProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for CredentialUpdateParameters struct. +func (cup *CredentialUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + cup.Name = &name + } + case "properties": + if v != nil { + var credentialUpdateProperties CredentialUpdateProperties + err = json.Unmarshal(*v, &credentialUpdateProperties) + if err != nil { + return err + } + cup.CredentialUpdateProperties = &credentialUpdateProperties + } + } + } + + return nil +} + +// CredentialUpdateProperties the properties of the Update credential +type CredentialUpdateProperties struct { + // UserName - Gets or sets the user name of the credential. + UserName *string `json:"userName,omitempty"` + // Password - Gets or sets the password of the credential. + Password *string `json:"password,omitempty"` + // Description - Gets or sets the description of the credential. + Description *string `json:"description,omitempty"` +} + +// DscCompilationJob definition of the Dsc Compilation job. +type DscCompilationJob struct { + autorest.Response `json:"-"` + // DscCompilationJobProperties - Gets or sets the properties of the Dsc Compilation job. + *DscCompilationJobProperties `json:"properties,omitempty"` + // ID - Fully qualified resource Id for the resource + ID *string `json:"id,omitempty"` + // Name - The name of the resource + Name *string `json:"name,omitempty"` + // Type - The type of the resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for DscCompilationJob. +func (dcj DscCompilationJob) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dcj.DscCompilationJobProperties != nil { + objectMap["properties"] = dcj.DscCompilationJobProperties + } + if dcj.ID != nil { + objectMap["id"] = dcj.ID + } + if dcj.Name != nil { + objectMap["name"] = dcj.Name + } + if dcj.Type != nil { + objectMap["type"] = dcj.Type + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for DscCompilationJob struct. +func (dcj *DscCompilationJob) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var dscCompilationJobProperties DscCompilationJobProperties + err = json.Unmarshal(*v, &dscCompilationJobProperties) + if err != nil { + return err + } + dcj.DscCompilationJobProperties = &dscCompilationJobProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + dcj.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + dcj.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + dcj.Type = &typeVar + } + } + } + + return nil +} + +// DscCompilationJobCreateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type DscCompilationJobCreateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *DscCompilationJobCreateFuture) Result(client DscCompilationJobClient) (dcj DscCompilationJob, err error) { + var done bool + done, err = future.Done(client) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscCompilationJobCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("automation.DscCompilationJobCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if dcj.Response.Response, err = future.GetResult(sender); err == nil && dcj.Response.Response.StatusCode != http.StatusNoContent { + dcj, err = client.CreateResponder(dcj.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscCompilationJobCreateFuture", "Result", dcj.Response.Response, "Failure responding to request") + } + } + return +} + +// DscCompilationJobCreateParameters the parameters supplied to the create compilation job operation. +type DscCompilationJobCreateParameters struct { + // DscCompilationJobCreateProperties - Gets or sets the list of compilation job properties. + *DscCompilationJobCreateProperties `json:"properties,omitempty"` + // Name - Gets or sets name of the resource. + Name *string `json:"name,omitempty"` + // Location - Gets or sets the location of the resource. + Location *string `json:"location,omitempty"` + // Tags - Gets or sets the tags attached to the resource. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for DscCompilationJobCreateParameters. +func (dcjcp DscCompilationJobCreateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dcjcp.DscCompilationJobCreateProperties != nil { + objectMap["properties"] = dcjcp.DscCompilationJobCreateProperties + } + if dcjcp.Name != nil { + objectMap["name"] = dcjcp.Name + } + if dcjcp.Location != nil { + objectMap["location"] = dcjcp.Location + } + if dcjcp.Tags != nil { + objectMap["tags"] = dcjcp.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for DscCompilationJobCreateParameters struct. +func (dcjcp *DscCompilationJobCreateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var dscCompilationJobCreateProperties DscCompilationJobCreateProperties + err = json.Unmarshal(*v, &dscCompilationJobCreateProperties) + if err != nil { + return err + } + dcjcp.DscCompilationJobCreateProperties = &dscCompilationJobCreateProperties + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + dcjcp.Name = &name + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + dcjcp.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + dcjcp.Tags = tags + } + } + } + + return nil +} + +// DscCompilationJobCreateProperties the parameters supplied to the create compilation job operation. +type DscCompilationJobCreateProperties struct { + // Configuration - Gets or sets the configuration. + Configuration *DscConfigurationAssociationProperty `json:"configuration,omitempty"` + // Parameters - Gets or sets the parameters of the job. + Parameters map[string]*string `json:"parameters"` + // IncrementNodeConfigurationBuild - If a new build version of NodeConfiguration is required. + IncrementNodeConfigurationBuild *bool `json:"incrementNodeConfigurationBuild,omitempty"` +} + +// MarshalJSON is the custom marshaler for DscCompilationJobCreateProperties. +func (dcjcp DscCompilationJobCreateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dcjcp.Configuration != nil { + objectMap["configuration"] = dcjcp.Configuration + } + if dcjcp.Parameters != nil { + objectMap["parameters"] = dcjcp.Parameters + } + if dcjcp.IncrementNodeConfigurationBuild != nil { + objectMap["incrementNodeConfigurationBuild"] = dcjcp.IncrementNodeConfigurationBuild + } + return json.Marshal(objectMap) +} + +// DscCompilationJobListResult the response model for the list job operation. +type DscCompilationJobListResult struct { + autorest.Response `json:"-"` + // Value - Gets or sets a list of Dsc Compilation jobs. + Value *[]DscCompilationJob `json:"value,omitempty"` + // NextLink - Gets or sets the next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// DscCompilationJobListResultIterator provides access to a complete listing of DscCompilationJob values. +type DscCompilationJobListResultIterator struct { + i int + page DscCompilationJobListResultPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *DscCompilationJobListResultIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter DscCompilationJobListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter DscCompilationJobListResultIterator) Response() DscCompilationJobListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter DscCompilationJobListResultIterator) Value() DscCompilationJob { + if !iter.page.NotDone() { + return DscCompilationJob{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (dcjlr DscCompilationJobListResult) IsEmpty() bool { + return dcjlr.Value == nil || len(*dcjlr.Value) == 0 +} + +// dscCompilationJobListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (dcjlr DscCompilationJobListResult) dscCompilationJobListResultPreparer() (*http.Request, error) { + if dcjlr.NextLink == nil || len(to.String(dcjlr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(dcjlr.NextLink))) +} + +// DscCompilationJobListResultPage contains a page of DscCompilationJob values. +type DscCompilationJobListResultPage struct { + fn func(DscCompilationJobListResult) (DscCompilationJobListResult, error) + dcjlr DscCompilationJobListResult +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *DscCompilationJobListResultPage) Next() error { + next, err := page.fn(page.dcjlr) + if err != nil { + return err + } + page.dcjlr = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page DscCompilationJobListResultPage) NotDone() bool { + return !page.dcjlr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page DscCompilationJobListResultPage) Response() DscCompilationJobListResult { + return page.dcjlr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page DscCompilationJobListResultPage) Values() []DscCompilationJob { + if page.dcjlr.IsEmpty() { + return nil + } + return *page.dcjlr.Value +} + +// DscCompilationJobProperties definition of Dsc Compilation job properties. +type DscCompilationJobProperties struct { + // Configuration - Gets or sets the configuration. + Configuration *DscConfigurationAssociationProperty `json:"configuration,omitempty"` + // StartedBy - Gets the compilation job started by. + StartedBy *string `json:"startedBy,omitempty"` + // JobID - Gets the id of the job. + JobID *uuid.UUID `json:"jobId,omitempty"` + // CreationTime - Gets the creation time of the job. + CreationTime *date.Time `json:"creationTime,omitempty"` + // ProvisioningState - The current provisioning state of the job. Possible values include: 'JobProvisioningStateFailed', 'JobProvisioningStateSucceeded', 'JobProvisioningStateSuspended', 'JobProvisioningStateProcessing' + ProvisioningState JobProvisioningState `json:"provisioningState,omitempty"` + // RunOn - Gets or sets the runOn which specifies the group name where the job is to be executed. + RunOn *string `json:"runOn,omitempty"` + // Status - Gets or sets the status of the job. Possible values include: 'JobStatusNew', 'JobStatusActivating', 'JobStatusRunning', 'JobStatusCompleted', 'JobStatusFailed', 'JobStatusStopped', 'JobStatusBlocked', 'JobStatusSuspended', 'JobStatusDisconnected', 'JobStatusSuspending', 'JobStatusStopping', 'JobStatusResuming', 'JobStatusRemoving' + Status JobStatus `json:"status,omitempty"` + // StatusDetails - Gets or sets the status details of the job. + StatusDetails *string `json:"statusDetails,omitempty"` + // StartTime - Gets the start time of the job. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - Gets the end time of the job. + EndTime *date.Time `json:"endTime,omitempty"` + // Exception - Gets the exception of the job. + Exception *string `json:"exception,omitempty"` + // LastModifiedTime - Gets the last modified time of the job. + LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` + // LastStatusModifiedTime - Gets the last status modified time of the job. + LastStatusModifiedTime *date.Time `json:"lastStatusModifiedTime,omitempty"` + // Parameters - Gets or sets the parameters of the job. + Parameters map[string]*string `json:"parameters"` +} + +// MarshalJSON is the custom marshaler for DscCompilationJobProperties. +func (dcjp DscCompilationJobProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dcjp.Configuration != nil { + objectMap["configuration"] = dcjp.Configuration + } + if dcjp.StartedBy != nil { + objectMap["startedBy"] = dcjp.StartedBy + } + if dcjp.JobID != nil { + objectMap["jobId"] = dcjp.JobID + } + if dcjp.CreationTime != nil { + objectMap["creationTime"] = dcjp.CreationTime + } + if dcjp.ProvisioningState != "" { + objectMap["provisioningState"] = dcjp.ProvisioningState + } + if dcjp.RunOn != nil { + objectMap["runOn"] = dcjp.RunOn + } + if dcjp.Status != "" { + objectMap["status"] = dcjp.Status + } + if dcjp.StatusDetails != nil { + objectMap["statusDetails"] = dcjp.StatusDetails + } + if dcjp.StartTime != nil { + objectMap["startTime"] = dcjp.StartTime + } + if dcjp.EndTime != nil { + objectMap["endTime"] = dcjp.EndTime + } + if dcjp.Exception != nil { + objectMap["exception"] = dcjp.Exception + } + if dcjp.LastModifiedTime != nil { + objectMap["lastModifiedTime"] = dcjp.LastModifiedTime + } + if dcjp.LastStatusModifiedTime != nil { + objectMap["lastStatusModifiedTime"] = dcjp.LastStatusModifiedTime + } + if dcjp.Parameters != nil { + objectMap["parameters"] = dcjp.Parameters + } + return json.Marshal(objectMap) +} + +// DscConfiguration definition of the configuration type. +type DscConfiguration struct { + autorest.Response `json:"-"` + // DscConfigurationProperties - Gets or sets the configuration properties. + *DscConfigurationProperties `json:"properties,omitempty"` + // Etag - Gets or sets the etag of the resource. + Etag *string `json:"etag,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // Location - The Azure Region where the resource lives + Location *string `json:"location,omitempty"` + // ID - Fully qualified resource Id for the resource + ID *string `json:"id,omitempty"` + // Name - The name of the resource + Name *string `json:"name,omitempty"` + // Type - The type of the resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for DscConfiguration. +func (dc DscConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dc.DscConfigurationProperties != nil { + objectMap["properties"] = dc.DscConfigurationProperties + } + if dc.Etag != nil { + objectMap["etag"] = dc.Etag + } + if dc.Tags != nil { + objectMap["tags"] = dc.Tags + } + if dc.Location != nil { + objectMap["location"] = dc.Location + } + if dc.ID != nil { + objectMap["id"] = dc.ID + } + if dc.Name != nil { + objectMap["name"] = dc.Name + } + if dc.Type != nil { + objectMap["type"] = dc.Type + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for DscConfiguration struct. +func (dc *DscConfiguration) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var dscConfigurationProperties DscConfigurationProperties + err = json.Unmarshal(*v, &dscConfigurationProperties) + if err != nil { + return err + } + dc.DscConfigurationProperties = &dscConfigurationProperties + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + dc.Etag = &etag + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + dc.Tags = tags + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + dc.Location = &location + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + dc.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + dc.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + dc.Type = &typeVar + } + } + } + + return nil +} + +// DscConfigurationAssociationProperty the Dsc configuration property associated with the entity. +type DscConfigurationAssociationProperty struct { + // Name - Gets or sets the name of the Dsc configuration. + Name *string `json:"name,omitempty"` +} + +// DscConfigurationCreateOrUpdateParameters the parameters supplied to the create or update configuration +// operation. +type DscConfigurationCreateOrUpdateParameters struct { + // DscConfigurationCreateOrUpdateProperties - Gets or sets configuration create or update properties. + *DscConfigurationCreateOrUpdateProperties `json:"properties,omitempty"` + // Name - Gets or sets name of the resource. + Name *string `json:"name,omitempty"` + // Location - Gets or sets the location of the resource. + Location *string `json:"location,omitempty"` + // Tags - Gets or sets the tags attached to the resource. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for DscConfigurationCreateOrUpdateParameters. +func (dccoup DscConfigurationCreateOrUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dccoup.DscConfigurationCreateOrUpdateProperties != nil { + objectMap["properties"] = dccoup.DscConfigurationCreateOrUpdateProperties + } + if dccoup.Name != nil { + objectMap["name"] = dccoup.Name + } + if dccoup.Location != nil { + objectMap["location"] = dccoup.Location + } + if dccoup.Tags != nil { + objectMap["tags"] = dccoup.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for DscConfigurationCreateOrUpdateParameters struct. +func (dccoup *DscConfigurationCreateOrUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var dscConfigurationCreateOrUpdateProperties DscConfigurationCreateOrUpdateProperties + err = json.Unmarshal(*v, &dscConfigurationCreateOrUpdateProperties) + if err != nil { + return err + } + dccoup.DscConfigurationCreateOrUpdateProperties = &dscConfigurationCreateOrUpdateProperties + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + dccoup.Name = &name + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + dccoup.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + dccoup.Tags = tags + } + } + } + + return nil +} + +// DscConfigurationCreateOrUpdateProperties the properties to create or update configuration. +type DscConfigurationCreateOrUpdateProperties struct { + // LogVerbose - Gets or sets verbose log option. + LogVerbose *bool `json:"logVerbose,omitempty"` + // LogProgress - Gets or sets progress log option. + LogProgress *bool `json:"logProgress,omitempty"` + // Source - Gets or sets the source. + Source *ContentSource `json:"source,omitempty"` + // Parameters - Gets or sets the configuration parameters. + Parameters map[string]*DscConfigurationParameter `json:"parameters"` + // Description - Gets or sets the description of the configuration. + Description *string `json:"description,omitempty"` +} + +// MarshalJSON is the custom marshaler for DscConfigurationCreateOrUpdateProperties. +func (dccoup DscConfigurationCreateOrUpdateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dccoup.LogVerbose != nil { + objectMap["logVerbose"] = dccoup.LogVerbose + } + if dccoup.LogProgress != nil { + objectMap["logProgress"] = dccoup.LogProgress + } + if dccoup.Source != nil { + objectMap["source"] = dccoup.Source + } + if dccoup.Parameters != nil { + objectMap["parameters"] = dccoup.Parameters + } + if dccoup.Description != nil { + objectMap["description"] = dccoup.Description + } + return json.Marshal(objectMap) +} + +// DscConfigurationListResult the response model for the list configuration operation. +type DscConfigurationListResult struct { + autorest.Response `json:"-"` + // Value - Gets or sets a list of configurations. + Value *[]DscConfiguration `json:"value,omitempty"` + // NextLink - Gets or sets the next link. + NextLink *string `json:"nextLink,omitempty"` + // TotalCount - Gets the total number of configurations matching filter criteria. + TotalCount *int32 `json:"totalCount,omitempty"` +} + +// DscConfigurationListResultIterator provides access to a complete listing of DscConfiguration values. +type DscConfigurationListResultIterator struct { + i int + page DscConfigurationListResultPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *DscConfigurationListResultIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter DscConfigurationListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter DscConfigurationListResultIterator) Response() DscConfigurationListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter DscConfigurationListResultIterator) Value() DscConfiguration { + if !iter.page.NotDone() { + return DscConfiguration{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (dclr DscConfigurationListResult) IsEmpty() bool { + return dclr.Value == nil || len(*dclr.Value) == 0 +} + +// dscConfigurationListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (dclr DscConfigurationListResult) dscConfigurationListResultPreparer() (*http.Request, error) { + if dclr.NextLink == nil || len(to.String(dclr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(dclr.NextLink))) +} + +// DscConfigurationListResultPage contains a page of DscConfiguration values. +type DscConfigurationListResultPage struct { + fn func(DscConfigurationListResult) (DscConfigurationListResult, error) + dclr DscConfigurationListResult +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *DscConfigurationListResultPage) Next() error { + next, err := page.fn(page.dclr) + if err != nil { + return err + } + page.dclr = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page DscConfigurationListResultPage) NotDone() bool { + return !page.dclr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page DscConfigurationListResultPage) Response() DscConfigurationListResult { + return page.dclr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page DscConfigurationListResultPage) Values() []DscConfiguration { + if page.dclr.IsEmpty() { + return nil + } + return *page.dclr.Value +} + +// DscConfigurationParameter definition of the configuration parameter type. +type DscConfigurationParameter struct { + // Type - Gets or sets the type of the parameter. + Type *string `json:"type,omitempty"` + // IsMandatory - Gets or sets a Boolean value to indicate whether the parameter is madatory or not. + IsMandatory *bool `json:"isMandatory,omitempty"` + // Position - Get or sets the position of the parameter. + Position *int32 `json:"position,omitempty"` + // DefaultValue - Gets or sets the default value of parameter. + DefaultValue *string `json:"defaultValue,omitempty"` +} + +// DscConfigurationProperties definition of the configuration property type. +type DscConfigurationProperties struct { + // ProvisioningState - Gets or sets the provisioning state of the configuration. Possible values include: 'Succeeded' + ProvisioningState DscConfigurationProvisioningState `json:"provisioningState,omitempty"` + // JobCount - Gets or sets the job count of the configuration. + JobCount *int32 `json:"jobCount,omitempty"` + // Parameters - Gets or sets the configuration parameters. + Parameters map[string]*DscConfigurationParameter `json:"parameters"` + // Source - Gets or sets the source. + Source *ContentSource `json:"source,omitempty"` + // State - Gets or sets the state of the configuration. Possible values include: 'DscConfigurationStateNew', 'DscConfigurationStateEdit', 'DscConfigurationStatePublished' + State DscConfigurationState `json:"state,omitempty"` + // LogVerbose - Gets or sets verbose log option. + LogVerbose *bool `json:"logVerbose,omitempty"` + // CreationTime - Gets or sets the creation time. + CreationTime *date.Time `json:"creationTime,omitempty"` + // LastModifiedTime - Gets or sets the last modified time. + LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` + // NodeConfigurationCount - Gets the number of compiled node configurations. + NodeConfigurationCount *int32 `json:"nodeConfigurationCount,omitempty"` + // Description - Gets or sets the description. + Description *string `json:"description,omitempty"` +} + +// MarshalJSON is the custom marshaler for DscConfigurationProperties. +func (dcp DscConfigurationProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dcp.ProvisioningState != "" { + objectMap["provisioningState"] = dcp.ProvisioningState + } + if dcp.JobCount != nil { + objectMap["jobCount"] = dcp.JobCount + } + if dcp.Parameters != nil { + objectMap["parameters"] = dcp.Parameters + } + if dcp.Source != nil { + objectMap["source"] = dcp.Source + } + if dcp.State != "" { + objectMap["state"] = dcp.State + } + if dcp.LogVerbose != nil { + objectMap["logVerbose"] = dcp.LogVerbose + } + if dcp.CreationTime != nil { + objectMap["creationTime"] = dcp.CreationTime + } + if dcp.LastModifiedTime != nil { + objectMap["lastModifiedTime"] = dcp.LastModifiedTime + } + if dcp.NodeConfigurationCount != nil { + objectMap["nodeConfigurationCount"] = dcp.NodeConfigurationCount + } + if dcp.Description != nil { + objectMap["description"] = dcp.Description + } + return json.Marshal(objectMap) +} + +// DscConfigurationUpdateParameters the parameters supplied to the create or update configuration operation. +type DscConfigurationUpdateParameters struct { + // DscConfigurationCreateOrUpdateProperties - Gets or sets configuration create or update properties. + *DscConfigurationCreateOrUpdateProperties `json:"properties,omitempty"` + // Name - Gets or sets name of the resource. + Name *string `json:"name,omitempty"` + // Tags - Gets or sets the tags attached to the resource. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for DscConfigurationUpdateParameters. +func (dcup DscConfigurationUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dcup.DscConfigurationCreateOrUpdateProperties != nil { + objectMap["properties"] = dcup.DscConfigurationCreateOrUpdateProperties + } + if dcup.Name != nil { + objectMap["name"] = dcup.Name + } + if dcup.Tags != nil { + objectMap["tags"] = dcup.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for DscConfigurationUpdateParameters struct. +func (dcup *DscConfigurationUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var dscConfigurationCreateOrUpdateProperties DscConfigurationCreateOrUpdateProperties + err = json.Unmarshal(*v, &dscConfigurationCreateOrUpdateProperties) + if err != nil { + return err + } + dcup.DscConfigurationCreateOrUpdateProperties = &dscConfigurationCreateOrUpdateProperties + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + dcup.Name = &name + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + dcup.Tags = tags + } + } + } + + return nil +} + +// DscMetaConfiguration definition of the DSC Meta Configuration. +type DscMetaConfiguration struct { + // ConfigurationModeFrequencyMins - Gets or sets the ConfigurationModeFrequencyMins value of the meta configuration. + ConfigurationModeFrequencyMins *int32 `json:"configurationModeFrequencyMins,omitempty"` + // RebootNodeIfNeeded - Gets or sets the RebootNodeIfNeeded value of the meta configuration. + RebootNodeIfNeeded *bool `json:"rebootNodeIfNeeded,omitempty"` + // ConfigurationMode - Gets or sets the ConfigurationMode value of the meta configuration. + ConfigurationMode *string `json:"configurationMode,omitempty"` + // ActionAfterReboot - Gets or sets the ActionAfterReboot value of the meta configuration. + ActionAfterReboot *string `json:"actionAfterReboot,omitempty"` + // CertificateID - Gets or sets the CertificateId value of the meta configuration. + CertificateID *string `json:"certificateId,omitempty"` + // RefreshFrequencyMins - Gets or sets the RefreshFrequencyMins value of the meta configuration. + RefreshFrequencyMins *int32 `json:"refreshFrequencyMins,omitempty"` + // AllowModuleOverwrite - Gets or sets the AllowModuleOverwrite value of the meta configuration. + AllowModuleOverwrite *bool `json:"allowModuleOverwrite,omitempty"` +} + +// DscNode definition of a DscNode +type DscNode struct { + autorest.Response `json:"-"` + // DscNodeProperties - The properties of a DscNode. + *DscNodeProperties `json:"properties,omitempty"` + // ID - Fully qualified resource Id for the resource + ID *string `json:"id,omitempty"` + // Name - The name of the resource + Name *string `json:"name,omitempty"` + // Type - The type of the resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for DscNode. +func (dn DscNode) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dn.DscNodeProperties != nil { + objectMap["properties"] = dn.DscNodeProperties + } + if dn.ID != nil { + objectMap["id"] = dn.ID + } + if dn.Name != nil { + objectMap["name"] = dn.Name + } + if dn.Type != nil { + objectMap["type"] = dn.Type + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for DscNode struct. +func (dn *DscNode) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var dscNodeProperties DscNodeProperties + err = json.Unmarshal(*v, &dscNodeProperties) + if err != nil { + return err + } + dn.DscNodeProperties = &dscNodeProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + dn.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + dn.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + dn.Type = &typeVar + } + } + } + + return nil +} + +// DscNodeConfiguration definition of the dsc node configuration. +type DscNodeConfiguration struct { + autorest.Response `json:"-"` + // DscNodeConfigurationProperties - Gets or sets the configuration properties. + *DscNodeConfigurationProperties `json:"properties,omitempty"` + // ID - Fully qualified resource Id for the resource + ID *string `json:"id,omitempty"` + // Name - The name of the resource + Name *string `json:"name,omitempty"` + // Type - The type of the resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for DscNodeConfiguration. +func (dnc DscNodeConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dnc.DscNodeConfigurationProperties != nil { + objectMap["properties"] = dnc.DscNodeConfigurationProperties + } + if dnc.ID != nil { + objectMap["id"] = dnc.ID + } + if dnc.Name != nil { + objectMap["name"] = dnc.Name + } + if dnc.Type != nil { + objectMap["type"] = dnc.Type + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for DscNodeConfiguration struct. +func (dnc *DscNodeConfiguration) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var dscNodeConfigurationProperties DscNodeConfigurationProperties + err = json.Unmarshal(*v, &dscNodeConfigurationProperties) + if err != nil { + return err + } + dnc.DscNodeConfigurationProperties = &dscNodeConfigurationProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + dnc.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + dnc.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + dnc.Type = &typeVar + } + } + } + + return nil +} + +// DscNodeConfigurationAssociationProperty the dsc nodeconfiguration property associated with the entity. +type DscNodeConfigurationAssociationProperty struct { + // Name - Gets or sets the name of the dsc nodeconfiguration. + Name *string `json:"name,omitempty"` +} + +// DscNodeConfigurationCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type DscNodeConfigurationCreateOrUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *DscNodeConfigurationCreateOrUpdateFuture) Result(client DscNodeConfigurationClient) (dnc DscNodeConfiguration, err error) { + var done bool + done, err = future.Done(client) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscNodeConfigurationCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("automation.DscNodeConfigurationCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if dnc.Response.Response, err = future.GetResult(sender); err == nil && dnc.Response.Response.StatusCode != http.StatusNoContent { + dnc, err = client.CreateOrUpdateResponder(dnc.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscNodeConfigurationCreateOrUpdateFuture", "Result", dnc.Response.Response, "Failure responding to request") + } + } + return +} + +// DscNodeConfigurationCreateOrUpdateParameters the parameters supplied to the create or update node configuration +// operation. +type DscNodeConfigurationCreateOrUpdateParameters struct { + // DscNodeConfigurationCreateOrUpdateParametersProperties - Node configuration properties + *DscNodeConfigurationCreateOrUpdateParametersProperties `json:"properties,omitempty"` + // Name - Name of the node configuration. + Name *string `json:"name,omitempty"` + // Tags - Gets or sets the tags attached to the resource. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for DscNodeConfigurationCreateOrUpdateParameters. +func (dnccoup DscNodeConfigurationCreateOrUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dnccoup.DscNodeConfigurationCreateOrUpdateParametersProperties != nil { + objectMap["properties"] = dnccoup.DscNodeConfigurationCreateOrUpdateParametersProperties + } + if dnccoup.Name != nil { + objectMap["name"] = dnccoup.Name + } + if dnccoup.Tags != nil { + objectMap["tags"] = dnccoup.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for DscNodeConfigurationCreateOrUpdateParameters struct. +func (dnccoup *DscNodeConfigurationCreateOrUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var dscNodeConfigurationCreateOrUpdateParametersProperties DscNodeConfigurationCreateOrUpdateParametersProperties + err = json.Unmarshal(*v, &dscNodeConfigurationCreateOrUpdateParametersProperties) + if err != nil { + return err + } + dnccoup.DscNodeConfigurationCreateOrUpdateParametersProperties = &dscNodeConfigurationCreateOrUpdateParametersProperties + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + dnccoup.Name = &name + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + dnccoup.Tags = tags + } + } + } + + return nil +} + +// DscNodeConfigurationCreateOrUpdateParametersProperties the parameter properties supplied to the create or update +// node configuration operation. +type DscNodeConfigurationCreateOrUpdateParametersProperties struct { + // Source - Gets or sets the source. + Source *ContentSource `json:"source,omitempty"` + // Configuration - Gets or sets the configuration of the node. + Configuration *DscConfigurationAssociationProperty `json:"configuration,omitempty"` + // IncrementNodeConfigurationBuild - If a new build version of NodeConfiguration is required. + IncrementNodeConfigurationBuild *bool `json:"incrementNodeConfigurationBuild,omitempty"` +} + +// DscNodeConfigurationListResult the response model for the list job operation. +type DscNodeConfigurationListResult struct { + autorest.Response `json:"-"` + // Value - Gets or sets a list of Dsc node configurations. + Value *[]DscNodeConfiguration `json:"value,omitempty"` + // NextLink - Gets or sets the next link. + NextLink *string `json:"nextLink,omitempty"` + // TotalCount - Gets or sets the total rows in query. + TotalCount *int32 `json:"totalCount,omitempty"` +} + +// DscNodeConfigurationListResultIterator provides access to a complete listing of DscNodeConfiguration values. +type DscNodeConfigurationListResultIterator struct { + i int + page DscNodeConfigurationListResultPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *DscNodeConfigurationListResultIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter DscNodeConfigurationListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter DscNodeConfigurationListResultIterator) Response() DscNodeConfigurationListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter DscNodeConfigurationListResultIterator) Value() DscNodeConfiguration { + if !iter.page.NotDone() { + return DscNodeConfiguration{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (dnclr DscNodeConfigurationListResult) IsEmpty() bool { + return dnclr.Value == nil || len(*dnclr.Value) == 0 +} + +// dscNodeConfigurationListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (dnclr DscNodeConfigurationListResult) dscNodeConfigurationListResultPreparer() (*http.Request, error) { + if dnclr.NextLink == nil || len(to.String(dnclr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(dnclr.NextLink))) +} + +// DscNodeConfigurationListResultPage contains a page of DscNodeConfiguration values. +type DscNodeConfigurationListResultPage struct { + fn func(DscNodeConfigurationListResult) (DscNodeConfigurationListResult, error) + dnclr DscNodeConfigurationListResult +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *DscNodeConfigurationListResultPage) Next() error { + next, err := page.fn(page.dnclr) + if err != nil { + return err + } + page.dnclr = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page DscNodeConfigurationListResultPage) NotDone() bool { + return !page.dnclr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page DscNodeConfigurationListResultPage) Response() DscNodeConfigurationListResult { + return page.dnclr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page DscNodeConfigurationListResultPage) Values() []DscNodeConfiguration { + if page.dnclr.IsEmpty() { + return nil + } + return *page.dnclr.Value +} + +// DscNodeConfigurationProperties properties for the DscNodeConfiguration +type DscNodeConfigurationProperties struct { + // LastModifiedTime - Gets or sets the last modified time. + LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` + // CreationTime - Gets or sets creation time. + CreationTime *date.Time `json:"creationTime,omitempty"` + // Configuration - Gets or sets the configuration of the node. + Configuration *DscConfigurationAssociationProperty `json:"configuration,omitempty"` + // Source - Source of node configuration. + Source *string `json:"source,omitempty"` + // NodeCount - Number of nodes with this nodeconfiguration assigned + NodeCount *int64 `json:"nodeCount,omitempty"` + // IncrementNodeConfigurationBuild - If a new build version of NodeConfiguration is required. + IncrementNodeConfigurationBuild *bool `json:"incrementNodeConfigurationBuild,omitempty"` +} + +// DscNodeExtensionHandlerAssociationProperty the dsc extensionHandler property associated with the node +type DscNodeExtensionHandlerAssociationProperty struct { + // Name - Gets or sets the name of the extension handler. + Name *string `json:"name,omitempty"` + // Version - Gets or sets the version of the extension handler. + Version *string `json:"version,omitempty"` +} + +// DscNodeListResult the response model for the list dsc nodes operation. +type DscNodeListResult struct { + autorest.Response `json:"-"` + // Value - Gets or sets a list of dsc nodes. + Value *[]DscNode `json:"value,omitempty"` + // NextLink - Gets or sets the next link. + NextLink *string `json:"nextLink,omitempty"` + // TotalCount - Gets the total number of nodes matching filter criteria. + TotalCount *int32 `json:"totalCount,omitempty"` +} + +// DscNodeListResultIterator provides access to a complete listing of DscNode values. +type DscNodeListResultIterator struct { + i int + page DscNodeListResultPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *DscNodeListResultIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter DscNodeListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter DscNodeListResultIterator) Response() DscNodeListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter DscNodeListResultIterator) Value() DscNode { + if !iter.page.NotDone() { + return DscNode{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (dnlr DscNodeListResult) IsEmpty() bool { + return dnlr.Value == nil || len(*dnlr.Value) == 0 +} + +// dscNodeListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (dnlr DscNodeListResult) dscNodeListResultPreparer() (*http.Request, error) { + if dnlr.NextLink == nil || len(to.String(dnlr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(dnlr.NextLink))) +} + +// DscNodeListResultPage contains a page of DscNode values. +type DscNodeListResultPage struct { + fn func(DscNodeListResult) (DscNodeListResult, error) + dnlr DscNodeListResult +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *DscNodeListResultPage) Next() error { + next, err := page.fn(page.dnlr) + if err != nil { + return err + } + page.dnlr = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page DscNodeListResultPage) NotDone() bool { + return !page.dnlr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page DscNodeListResultPage) Response() DscNodeListResult { + return page.dnlr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page DscNodeListResultPage) Values() []DscNode { + if page.dnlr.IsEmpty() { + return nil + } + return *page.dnlr.Value +} + +// DscNodeProperties the properties of a DscNode +type DscNodeProperties struct { + // LastSeen - Gets or sets the last seen time of the node. + LastSeen *date.Time `json:"lastSeen,omitempty"` + // RegistrationTime - Gets or sets the registration time of the node. + RegistrationTime *date.Time `json:"registrationTime,omitempty"` + // IP - Gets or sets the ip of the node. + IP *string `json:"ip,omitempty"` + // AccountID - Gets or sets the account id of the node. + AccountID *string `json:"accountId,omitempty"` + // DscNodeConfigurationAssociationProperty - Gets or sets the configuration of the node. + *DscNodeConfigurationAssociationProperty `json:"nodeConfiguration,omitempty"` + // Status - Gets or sets the status of the node. + Status *string `json:"status,omitempty"` + // NodeID - Gets or sets the node id. + NodeID *string `json:"nodeId,omitempty"` + // Etag - Gets or sets the etag of the resource. + Etag *string `json:"etag,omitempty"` + // TotalCount - Gets the total number of records matching filter criteria. + TotalCount *int32 `json:"totalCount,omitempty"` + // ExtensionHandler - Gets or sets the list of extensionHandler properties for a Node. + ExtensionHandler *[]DscNodeExtensionHandlerAssociationProperty `json:"extensionHandler,omitempty"` +} + +// MarshalJSON is the custom marshaler for DscNodeProperties. +func (dnp DscNodeProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dnp.LastSeen != nil { + objectMap["lastSeen"] = dnp.LastSeen + } + if dnp.RegistrationTime != nil { + objectMap["registrationTime"] = dnp.RegistrationTime + } + if dnp.IP != nil { + objectMap["ip"] = dnp.IP + } + if dnp.AccountID != nil { + objectMap["accountId"] = dnp.AccountID + } + if dnp.DscNodeConfigurationAssociationProperty != nil { + objectMap["nodeConfiguration"] = dnp.DscNodeConfigurationAssociationProperty + } + if dnp.Status != nil { + objectMap["status"] = dnp.Status + } + if dnp.NodeID != nil { + objectMap["nodeId"] = dnp.NodeID + } + if dnp.Etag != nil { + objectMap["etag"] = dnp.Etag + } + if dnp.TotalCount != nil { + objectMap["totalCount"] = dnp.TotalCount + } + if dnp.ExtensionHandler != nil { + objectMap["extensionHandler"] = dnp.ExtensionHandler + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for DscNodeProperties struct. +func (dnp *DscNodeProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "lastSeen": + if v != nil { + var lastSeen date.Time + err = json.Unmarshal(*v, &lastSeen) + if err != nil { + return err + } + dnp.LastSeen = &lastSeen + } + case "registrationTime": + if v != nil { + var registrationTime date.Time + err = json.Unmarshal(*v, ®istrationTime) + if err != nil { + return err + } + dnp.RegistrationTime = ®istrationTime + } + case "ip": + if v != nil { + var IP string + err = json.Unmarshal(*v, &IP) + if err != nil { + return err + } + dnp.IP = &IP + } + case "accountId": + if v != nil { + var accountID string + err = json.Unmarshal(*v, &accountID) + if err != nil { + return err + } + dnp.AccountID = &accountID + } + case "nodeConfiguration": + if v != nil { + var dscNodeConfigurationAssociationProperty DscNodeConfigurationAssociationProperty + err = json.Unmarshal(*v, &dscNodeConfigurationAssociationProperty) + if err != nil { + return err + } + dnp.DscNodeConfigurationAssociationProperty = &dscNodeConfigurationAssociationProperty + } + case "status": + if v != nil { + var status string + err = json.Unmarshal(*v, &status) + if err != nil { + return err + } + dnp.Status = &status + } + case "nodeId": + if v != nil { + var nodeID string + err = json.Unmarshal(*v, &nodeID) + if err != nil { + return err + } + dnp.NodeID = &nodeID + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + dnp.Etag = &etag + } + case "totalCount": + if v != nil { + var totalCount int32 + err = json.Unmarshal(*v, &totalCount) + if err != nil { + return err + } + dnp.TotalCount = &totalCount + } + case "extensionHandler": + if v != nil { + var extensionHandler []DscNodeExtensionHandlerAssociationProperty + err = json.Unmarshal(*v, &extensionHandler) + if err != nil { + return err + } + dnp.ExtensionHandler = &extensionHandler + } + } + } + + return nil +} + +// DscNodeReport definition of the dsc node report type. +type DscNodeReport struct { + autorest.Response `json:"-"` + // EndTime - Gets or sets the end time of the node report. + EndTime *date.Time `json:"endTime,omitempty"` + // LastModifiedTime - Gets or sets the lastModifiedTime of the node report. + LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` + // StartTime - Gets or sets the start time of the node report. + StartTime *date.Time `json:"startTime,omitempty"` + // Type - Gets or sets the type of the node report. + Type *string `json:"type,omitempty"` + // ReportID - Gets or sets the id of the node report. + ReportID *string `json:"reportId,omitempty"` + // Status - Gets or sets the status of the node report. + Status *string `json:"status,omitempty"` + // RefreshMode - Gets or sets the refreshMode of the node report. + RefreshMode *string `json:"refreshMode,omitempty"` + // RebootRequested - Gets or sets the rebootRequested of the node report. + RebootRequested *string `json:"rebootRequested,omitempty"` + // ReportFormatVersion - Gets or sets the reportFormatVersion of the node report. + ReportFormatVersion *string `json:"reportFormatVersion,omitempty"` + // ConfigurationVersion - Gets or sets the configurationVersion of the node report. + ConfigurationVersion *string `json:"configurationVersion,omitempty"` + // ID - Gets or sets the id. + ID *string `json:"id,omitempty"` + // Errors - Gets or sets the errors for the node report. + Errors *[]DscReportError `json:"errors,omitempty"` + // Resources - Gets or sets the resource for the node report. + Resources *[]DscReportResource `json:"resources,omitempty"` + // MetaConfiguration - Gets or sets the metaConfiguration of the node at the time of the report. + MetaConfiguration *DscMetaConfiguration `json:"metaConfiguration,omitempty"` + // HostName - Gets or sets the hostname of the node that sent the report. + HostName *string `json:"hostName,omitempty"` + // IPV4Addresses - Gets or sets the IPv4 address of the node that sent the report. + IPV4Addresses *[]string `json:"iPV4Addresses,omitempty"` + // IPV6Addresses - Gets or sets the IPv6 address of the node that sent the report. + IPV6Addresses *[]string `json:"iPV6Addresses,omitempty"` + // NumberOfResources - Gets or sets the number of resource in the node report. + NumberOfResources *int32 `json:"numberOfResources,omitempty"` + // RawErrors - Gets or sets the unparsed errors for the node report. + RawErrors *string `json:"rawErrors,omitempty"` +} + +// DscNodeReportListResult the response model for the list dsc nodes operation. +type DscNodeReportListResult struct { + autorest.Response `json:"-"` + // Value - Gets or sets a list of dsc node reports. + Value *[]DscNodeReport `json:"value,omitempty"` + // NextLink - Gets or sets the next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// DscNodeReportListResultIterator provides access to a complete listing of DscNodeReport values. +type DscNodeReportListResultIterator struct { + i int + page DscNodeReportListResultPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *DscNodeReportListResultIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter DscNodeReportListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter DscNodeReportListResultIterator) Response() DscNodeReportListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter DscNodeReportListResultIterator) Value() DscNodeReport { + if !iter.page.NotDone() { + return DscNodeReport{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (dnrlr DscNodeReportListResult) IsEmpty() bool { + return dnrlr.Value == nil || len(*dnrlr.Value) == 0 +} + +// dscNodeReportListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (dnrlr DscNodeReportListResult) dscNodeReportListResultPreparer() (*http.Request, error) { + if dnrlr.NextLink == nil || len(to.String(dnrlr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(dnrlr.NextLink))) +} + +// DscNodeReportListResultPage contains a page of DscNodeReport values. +type DscNodeReportListResultPage struct { + fn func(DscNodeReportListResult) (DscNodeReportListResult, error) + dnrlr DscNodeReportListResult +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *DscNodeReportListResultPage) Next() error { + next, err := page.fn(page.dnrlr) + if err != nil { + return err + } + page.dnrlr = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page DscNodeReportListResultPage) NotDone() bool { + return !page.dnrlr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page DscNodeReportListResultPage) Response() DscNodeReportListResult { + return page.dnrlr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page DscNodeReportListResultPage) Values() []DscNodeReport { + if page.dnrlr.IsEmpty() { + return nil + } + return *page.dnrlr.Value +} + +// DscNodeUpdateParameters the parameters supplied to the update dsc node operation. +type DscNodeUpdateParameters struct { + // NodeID - Gets or sets the id of the dsc node. + NodeID *string `json:"nodeId,omitempty"` + Properties *DscNodeUpdateParametersProperties `json:"properties,omitempty"` +} + +// DscNodeUpdateParametersProperties ... +type DscNodeUpdateParametersProperties struct { + // DscNodeConfigurationAssociationProperty - Gets or sets the configuration of the node. + *DscNodeConfigurationAssociationProperty `json:"nodeConfiguration,omitempty"` +} + +// MarshalJSON is the custom marshaler for DscNodeUpdateParametersProperties. +func (dnup DscNodeUpdateParametersProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dnup.DscNodeConfigurationAssociationProperty != nil { + objectMap["nodeConfiguration"] = dnup.DscNodeConfigurationAssociationProperty + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for DscNodeUpdateParametersProperties struct. +func (dnup *DscNodeUpdateParametersProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "nodeConfiguration": + if v != nil { + var dscNodeConfigurationAssociationProperty DscNodeConfigurationAssociationProperty + err = json.Unmarshal(*v, &dscNodeConfigurationAssociationProperty) + if err != nil { + return err + } + dnup.DscNodeConfigurationAssociationProperty = &dscNodeConfigurationAssociationProperty + } + } + } + + return nil +} + +// DscReportError definition of the dsc node report error type. +type DscReportError struct { + // ErrorSource - Gets or sets the source of the error. + ErrorSource *string `json:"errorSource,omitempty"` + // ResourceID - Gets or sets the resource ID which generated the error. + ResourceID *string `json:"resourceId,omitempty"` + // ErrorCode - Gets or sets the error code. + ErrorCode *string `json:"errorCode,omitempty"` + // ErrorMessage - Gets or sets the error message. + ErrorMessage *string `json:"errorMessage,omitempty"` + // Locale - Gets or sets the locale of the error. + Locale *string `json:"locale,omitempty"` + // ErrorDetails - Gets or sets the error details. + ErrorDetails *string `json:"errorDetails,omitempty"` +} + +// DscReportResource definition of the DSC Report Resource. +type DscReportResource struct { + // ResourceID - Gets or sets the ID of the resource. + ResourceID *string `json:"resourceId,omitempty"` + // SourceInfo - Gets or sets the source info of the resource. + SourceInfo *string `json:"sourceInfo,omitempty"` + // DependsOn - Gets or sets the Resource Navigation values for resources the resource depends on. + DependsOn *[]DscReportResourceNavigation `json:"dependsOn,omitempty"` + // ModuleName - Gets or sets the module name of the resource. + ModuleName *string `json:"moduleName,omitempty"` + // ModuleVersion - Gets or sets the module version of the resource. + ModuleVersion *string `json:"moduleVersion,omitempty"` + // ResourceName - Gets or sets the name of the resource. + ResourceName *string `json:"resourceName,omitempty"` + // Error - Gets or sets the error of the resource. + Error *string `json:"error,omitempty"` + // Status - Gets or sets the status of the resource. + Status *string `json:"status,omitempty"` + // DurationInSeconds - Gets or sets the duration in seconds for the resource. + DurationInSeconds *float64 `json:"durationInSeconds,omitempty"` + // StartDate - Gets or sets the start date of the resource. + StartDate *date.Time `json:"startDate,omitempty"` +} + +// DscReportResourceNavigation navigation for DSC Report Resource. +type DscReportResourceNavigation struct { + // ResourceID - Gets or sets the ID of the resource to navigate to. + ResourceID *string `json:"resourceId,omitempty"` +} + +// ErrorResponse error response of an operation failure +type ErrorResponse struct { + // Code - Error code + Code *string `json:"code,omitempty"` + // Message - Error message indicating why the operation failed. + Message *string `json:"message,omitempty"` +} + +// FieldDefinition definition of the connection fields. +type FieldDefinition struct { + // IsEncrypted - Gets or sets the isEncrypted flag of the connection field definition. + IsEncrypted *bool `json:"isEncrypted,omitempty"` + // IsOptional - Gets or sets the isOptional flag of the connection field definition. + IsOptional *bool `json:"isOptional,omitempty"` + // Type - Gets or sets the type of the connection field definition. + Type *string `json:"type,omitempty"` +} + +// HybridRunbookWorker definition of hybrid runbook worker. +type HybridRunbookWorker struct { + // Name - Gets or sets the worker machine name. + Name *string `json:"name,omitempty"` + // IP - Gets or sets the assigned machine IP address. + IP *string `json:"ip,omitempty"` + // RegistrationTime - Gets or sets the registration time of the worker machine. + RegistrationTime *date.Time `json:"registrationTime,omitempty"` + // LastSeenDateTime - Last Heartbeat from the Worker + LastSeenDateTime *date.Time `json:"lastSeenDateTime,omitempty"` +} + +// HybridRunbookWorkerGroup definition of hybrid runbook worker group. +type HybridRunbookWorkerGroup struct { + autorest.Response `json:"-"` + // ID - Gets or sets the id of the resource. + ID *string `json:"id,omitempty"` + // Name - Gets or sets the name of the group. + Name *string `json:"name,omitempty"` + // HybridRunbookWorkers - Gets or sets the list of hybrid runbook workers. + HybridRunbookWorkers *[]HybridRunbookWorker `json:"hybridRunbookWorkers,omitempty"` + // Credential - Sets the credential of a worker group. + Credential *RunAsCredentialAssociationProperty `json:"credential,omitempty"` + // GroupType - Type of the HybridWorkerGroup. Possible values include: 'User', 'System' + GroupType GroupTypeEnum `json:"groupType,omitempty"` +} + +// HybridRunbookWorkerGroupsListResult the response model for the list hybrid runbook worker groups. +type HybridRunbookWorkerGroupsListResult struct { + autorest.Response `json:"-"` + // Value - Gets or sets a list of hybrid runbook worker groups. + Value *[]HybridRunbookWorkerGroup `json:"value,omitempty"` + // NextLink - Gets or sets the next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// HybridRunbookWorkerGroupsListResultIterator provides access to a complete listing of HybridRunbookWorkerGroup +// values. +type HybridRunbookWorkerGroupsListResultIterator struct { + i int + page HybridRunbookWorkerGroupsListResultPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *HybridRunbookWorkerGroupsListResultIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter HybridRunbookWorkerGroupsListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter HybridRunbookWorkerGroupsListResultIterator) Response() HybridRunbookWorkerGroupsListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter HybridRunbookWorkerGroupsListResultIterator) Value() HybridRunbookWorkerGroup { + if !iter.page.NotDone() { + return HybridRunbookWorkerGroup{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (hrwglr HybridRunbookWorkerGroupsListResult) IsEmpty() bool { + return hrwglr.Value == nil || len(*hrwglr.Value) == 0 +} + +// hybridRunbookWorkerGroupsListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (hrwglr HybridRunbookWorkerGroupsListResult) hybridRunbookWorkerGroupsListResultPreparer() (*http.Request, error) { + if hrwglr.NextLink == nil || len(to.String(hrwglr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(hrwglr.NextLink))) +} + +// HybridRunbookWorkerGroupsListResultPage contains a page of HybridRunbookWorkerGroup values. +type HybridRunbookWorkerGroupsListResultPage struct { + fn func(HybridRunbookWorkerGroupsListResult) (HybridRunbookWorkerGroupsListResult, error) + hrwglr HybridRunbookWorkerGroupsListResult +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *HybridRunbookWorkerGroupsListResultPage) Next() error { + next, err := page.fn(page.hrwglr) + if err != nil { + return err + } + page.hrwglr = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page HybridRunbookWorkerGroupsListResultPage) NotDone() bool { + return !page.hrwglr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page HybridRunbookWorkerGroupsListResultPage) Response() HybridRunbookWorkerGroupsListResult { + return page.hrwglr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page HybridRunbookWorkerGroupsListResultPage) Values() []HybridRunbookWorkerGroup { + if page.hrwglr.IsEmpty() { + return nil + } + return *page.hrwglr.Value +} + +// HybridRunbookWorkerGroupUpdateParameters parameters supplied to the update operation. +type HybridRunbookWorkerGroupUpdateParameters struct { + // Credential - Sets the credential of a worker group. + Credential *RunAsCredentialAssociationProperty `json:"credential,omitempty"` +} + +// Job definition of the job. +type Job struct { + autorest.Response `json:"-"` + // JobProperties - The properties of the job. + *JobProperties `json:"properties,omitempty"` + // ID - Fully qualified resource Id for the resource + ID *string `json:"id,omitempty"` + // Name - The name of the resource + Name *string `json:"name,omitempty"` + // Type - The type of the resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Job. +func (j Job) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if j.JobProperties != nil { + objectMap["properties"] = j.JobProperties + } + if j.ID != nil { + objectMap["id"] = j.ID + } + if j.Name != nil { + objectMap["name"] = j.Name + } + if j.Type != nil { + objectMap["type"] = j.Type + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Job struct. +func (j *Job) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var jobProperties JobProperties + err = json.Unmarshal(*v, &jobProperties) + if err != nil { + return err + } + j.JobProperties = &jobProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + j.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + j.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + j.Type = &typeVar + } + } + } + + return nil +} + +// JobCollectionItem job collection item properties. +type JobCollectionItem struct { + // JobCollectionItemProperties - Job properties. + *JobCollectionItemProperties `json:"properties,omitempty"` + // ID - Fully qualified resource Id for the resource + ID *string `json:"id,omitempty"` + // Name - The name of the resource + Name *string `json:"name,omitempty"` + // Type - The type of the resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for JobCollectionItem. +func (jci JobCollectionItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if jci.JobCollectionItemProperties != nil { + objectMap["properties"] = jci.JobCollectionItemProperties + } + if jci.ID != nil { + objectMap["id"] = jci.ID + } + if jci.Name != nil { + objectMap["name"] = jci.Name + } + if jci.Type != nil { + objectMap["type"] = jci.Type + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for JobCollectionItem struct. +func (jci *JobCollectionItem) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var jobCollectionItemProperties JobCollectionItemProperties + err = json.Unmarshal(*v, &jobCollectionItemProperties) + if err != nil { + return err + } + jci.JobCollectionItemProperties = &jobCollectionItemProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + jci.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + jci.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + jci.Type = &typeVar + } + } + } + + return nil +} + +// JobCollectionItemProperties job collection item properties. +type JobCollectionItemProperties struct { + // Runbook - The runbook association. + Runbook *RunbookAssociationProperty `json:"runbook,omitempty"` + // JobID - The id of the job. + JobID *uuid.UUID `json:"jobId,omitempty"` + // CreationTime - The creation time of the job. + CreationTime *date.Time `json:"creationTime,omitempty"` + // Status - The status of the job. Possible values include: 'JobStatusNew', 'JobStatusActivating', 'JobStatusRunning', 'JobStatusCompleted', 'JobStatusFailed', 'JobStatusStopped', 'JobStatusBlocked', 'JobStatusSuspended', 'JobStatusDisconnected', 'JobStatusSuspending', 'JobStatusStopping', 'JobStatusResuming', 'JobStatusRemoving' + Status JobStatus `json:"status,omitempty"` + // StartTime - The start time of the job. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - The end time of the job. + EndTime *date.Time `json:"endTime,omitempty"` + // LastModifiedTime - The last modified time of the job. + LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` + // ProvisioningState - The provisioning state of a resource. + ProvisioningState *string `json:"provisioningState,omitempty"` + // RunOn - Specifies the runOn group name where the job was executed. + RunOn *string `json:"runOn,omitempty"` +} + +// JobCreateParameters the parameters supplied to the create job operation. +type JobCreateParameters struct { + // JobCreateProperties - Gets or sets the list of job properties. + *JobCreateProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for JobCreateParameters. +func (jcp JobCreateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if jcp.JobCreateProperties != nil { + objectMap["properties"] = jcp.JobCreateProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for JobCreateParameters struct. +func (jcp *JobCreateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var jobCreateProperties JobCreateProperties + err = json.Unmarshal(*v, &jobCreateProperties) + if err != nil { + return err + } + jcp.JobCreateProperties = &jobCreateProperties + } + } + } + + return nil +} + +// JobCreateProperties ... +type JobCreateProperties struct { + // Runbook - Gets or sets the runbook. + Runbook *RunbookAssociationProperty `json:"runbook,omitempty"` + // Parameters - Gets or sets the parameters of the job. + Parameters map[string]*string `json:"parameters"` + // RunOn - Gets or sets the runOn which specifies the group name where the job is to be executed. + RunOn *string `json:"runOn,omitempty"` +} + +// MarshalJSON is the custom marshaler for JobCreateProperties. +func (jcp JobCreateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if jcp.Runbook != nil { + objectMap["runbook"] = jcp.Runbook + } + if jcp.Parameters != nil { + objectMap["parameters"] = jcp.Parameters + } + if jcp.RunOn != nil { + objectMap["runOn"] = jcp.RunOn + } + return json.Marshal(objectMap) +} + +// JobListResultV2 the response model for the list job operation. +type JobListResultV2 struct { + autorest.Response `json:"-"` + // Value - List of jobs. + Value *[]JobCollectionItem `json:"value,omitempty"` + // NextLink - The link to the next page. + NextLink *string `json:"nextLink,omitempty"` +} + +// JobListResultV2Iterator provides access to a complete listing of JobCollectionItem values. +type JobListResultV2Iterator struct { + i int + page JobListResultV2Page +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *JobListResultV2Iterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter JobListResultV2Iterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter JobListResultV2Iterator) Response() JobListResultV2 { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter JobListResultV2Iterator) Value() JobCollectionItem { + if !iter.page.NotDone() { + return JobCollectionItem{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (jlrv JobListResultV2) IsEmpty() bool { + return jlrv.Value == nil || len(*jlrv.Value) == 0 +} + +// jobListResultV2Preparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (jlrv JobListResultV2) jobListResultV2Preparer() (*http.Request, error) { + if jlrv.NextLink == nil || len(to.String(jlrv.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(jlrv.NextLink))) +} + +// JobListResultV2Page contains a page of JobCollectionItem values. +type JobListResultV2Page struct { + fn func(JobListResultV2) (JobListResultV2, error) + jlrv JobListResultV2 +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *JobListResultV2Page) Next() error { + next, err := page.fn(page.jlrv) + if err != nil { + return err + } + page.jlrv = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page JobListResultV2Page) NotDone() bool { + return !page.jlrv.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page JobListResultV2Page) Response() JobListResultV2 { + return page.jlrv +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page JobListResultV2Page) Values() []JobCollectionItem { + if page.jlrv.IsEmpty() { + return nil + } + return *page.jlrv.Value +} + +// JobNavigation software update configuration machine run job navigation properties. +type JobNavigation struct { + // ID - Id of the job associated with the software update configuration run + ID *string `json:"id,omitempty"` +} + +// JobProperties definition of job properties. +type JobProperties struct { + // Runbook - Gets or sets the runbook. + Runbook *RunbookAssociationProperty `json:"runbook,omitempty"` + // StartedBy - Gets or sets the job started by. + StartedBy *string `json:"startedBy,omitempty"` + // RunOn - Gets or sets the runOn which specifies the group name where the job is to be executed. + RunOn *string `json:"runOn,omitempty"` + // JobID - Gets or sets the id of the job. + JobID *uuid.UUID `json:"jobId,omitempty"` + // CreationTime - Gets or sets the creation time of the job. + CreationTime *date.Time `json:"creationTime,omitempty"` + // Status - Gets or sets the status of the job. Possible values include: 'JobStatusNew', 'JobStatusActivating', 'JobStatusRunning', 'JobStatusCompleted', 'JobStatusFailed', 'JobStatusStopped', 'JobStatusBlocked', 'JobStatusSuspended', 'JobStatusDisconnected', 'JobStatusSuspending', 'JobStatusStopping', 'JobStatusResuming', 'JobStatusRemoving' + Status JobStatus `json:"status,omitempty"` + // StatusDetails - Gets or sets the status details of the job. + StatusDetails *string `json:"statusDetails,omitempty"` + // StartTime - Gets or sets the start time of the job. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - Gets or sets the end time of the job. + EndTime *date.Time `json:"endTime,omitempty"` + // Exception - Gets or sets the exception of the job. + Exception *string `json:"exception,omitempty"` + // LastModifiedTime - Gets or sets the last modified time of the job. + LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` + // LastStatusModifiedTime - Gets or sets the last status modified time of the job. + LastStatusModifiedTime *date.Time `json:"lastStatusModifiedTime,omitempty"` + // Parameters - Gets or sets the parameters of the job. + Parameters map[string]*string `json:"parameters"` + // ProvisioningState - The current provisioning state of the job. Possible values include: 'JobProvisioningStateFailed', 'JobProvisioningStateSucceeded', 'JobProvisioningStateSuspended', 'JobProvisioningStateProcessing' + ProvisioningState JobProvisioningState `json:"provisioningState,omitempty"` +} + +// MarshalJSON is the custom marshaler for JobProperties. +func (jp JobProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if jp.Runbook != nil { + objectMap["runbook"] = jp.Runbook + } + if jp.StartedBy != nil { + objectMap["startedBy"] = jp.StartedBy + } + if jp.RunOn != nil { + objectMap["runOn"] = jp.RunOn + } + if jp.JobID != nil { + objectMap["jobId"] = jp.JobID + } + if jp.CreationTime != nil { + objectMap["creationTime"] = jp.CreationTime + } + if jp.Status != "" { + objectMap["status"] = jp.Status + } + if jp.StatusDetails != nil { + objectMap["statusDetails"] = jp.StatusDetails + } + if jp.StartTime != nil { + objectMap["startTime"] = jp.StartTime + } + if jp.EndTime != nil { + objectMap["endTime"] = jp.EndTime + } + if jp.Exception != nil { + objectMap["exception"] = jp.Exception + } + if jp.LastModifiedTime != nil { + objectMap["lastModifiedTime"] = jp.LastModifiedTime + } + if jp.LastStatusModifiedTime != nil { + objectMap["lastStatusModifiedTime"] = jp.LastStatusModifiedTime + } + if jp.Parameters != nil { + objectMap["parameters"] = jp.Parameters + } + if jp.ProvisioningState != "" { + objectMap["provisioningState"] = jp.ProvisioningState + } + return json.Marshal(objectMap) +} + +// JobSchedule definition of the job schedule. +type JobSchedule struct { + autorest.Response `json:"-"` + // ID - Gets the id of the resource. + ID *string `json:"id,omitempty"` + // Name - Gets the name of the variable. + Name *string `json:"name,omitempty"` + // Type - Resource type + Type *string `json:"type,omitempty"` + // JobScheduleProperties - Gets or sets the properties of the job schedule. + *JobScheduleProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for JobSchedule. +func (js JobSchedule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if js.ID != nil { + objectMap["id"] = js.ID + } + if js.Name != nil { + objectMap["name"] = js.Name + } + if js.Type != nil { + objectMap["type"] = js.Type + } + if js.JobScheduleProperties != nil { + objectMap["properties"] = js.JobScheduleProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for JobSchedule struct. +func (js *JobSchedule) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + js.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + js.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + js.Type = &typeVar + } + case "properties": + if v != nil { + var jobScheduleProperties JobScheduleProperties + err = json.Unmarshal(*v, &jobScheduleProperties) + if err != nil { + return err + } + js.JobScheduleProperties = &jobScheduleProperties + } + } + } + + return nil +} + +// JobScheduleCreateParameters the parameters supplied to the create job schedule operation. +type JobScheduleCreateParameters struct { + // JobScheduleCreateProperties - Gets or sets the list of job schedule properties. + *JobScheduleCreateProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for JobScheduleCreateParameters. +func (jscp JobScheduleCreateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if jscp.JobScheduleCreateProperties != nil { + objectMap["properties"] = jscp.JobScheduleCreateProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for JobScheduleCreateParameters struct. +func (jscp *JobScheduleCreateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var jobScheduleCreateProperties JobScheduleCreateProperties + err = json.Unmarshal(*v, &jobScheduleCreateProperties) + if err != nil { + return err + } + jscp.JobScheduleCreateProperties = &jobScheduleCreateProperties + } + } + } + + return nil +} + +// JobScheduleCreateProperties the parameters supplied to the create job schedule operation. +type JobScheduleCreateProperties struct { + // Schedule - Gets or sets the schedule. + Schedule *ScheduleAssociationProperty `json:"schedule,omitempty"` + // Runbook - Gets or sets the runbook. + Runbook *RunbookAssociationProperty `json:"runbook,omitempty"` + // RunOn - Gets or sets the hybrid worker group that the scheduled job should run on. + RunOn *string `json:"runOn,omitempty"` + // Parameters - Gets or sets a list of job properties. + Parameters map[string]*string `json:"parameters"` +} + +// MarshalJSON is the custom marshaler for JobScheduleCreateProperties. +func (jscp JobScheduleCreateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if jscp.Schedule != nil { + objectMap["schedule"] = jscp.Schedule + } + if jscp.Runbook != nil { + objectMap["runbook"] = jscp.Runbook + } + if jscp.RunOn != nil { + objectMap["runOn"] = jscp.RunOn + } + if jscp.Parameters != nil { + objectMap["parameters"] = jscp.Parameters + } + return json.Marshal(objectMap) +} + +// JobScheduleListResult the response model for the list job schedule operation. +type JobScheduleListResult struct { + autorest.Response `json:"-"` + // Value - Gets or sets a list of job schedules. + Value *[]JobSchedule `json:"value,omitempty"` + // NextLink - Gets or sets the next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// JobScheduleListResultIterator provides access to a complete listing of JobSchedule values. +type JobScheduleListResultIterator struct { + i int + page JobScheduleListResultPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *JobScheduleListResultIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter JobScheduleListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter JobScheduleListResultIterator) Response() JobScheduleListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter JobScheduleListResultIterator) Value() JobSchedule { + if !iter.page.NotDone() { + return JobSchedule{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (jslr JobScheduleListResult) IsEmpty() bool { + return jslr.Value == nil || len(*jslr.Value) == 0 +} + +// jobScheduleListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (jslr JobScheduleListResult) jobScheduleListResultPreparer() (*http.Request, error) { + if jslr.NextLink == nil || len(to.String(jslr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(jslr.NextLink))) +} + +// JobScheduleListResultPage contains a page of JobSchedule values. +type JobScheduleListResultPage struct { + fn func(JobScheduleListResult) (JobScheduleListResult, error) + jslr JobScheduleListResult +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *JobScheduleListResultPage) Next() error { + next, err := page.fn(page.jslr) + if err != nil { + return err + } + page.jslr = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page JobScheduleListResultPage) NotDone() bool { + return !page.jslr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page JobScheduleListResultPage) Response() JobScheduleListResult { + return page.jslr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page JobScheduleListResultPage) Values() []JobSchedule { + if page.jslr.IsEmpty() { + return nil + } + return *page.jslr.Value +} + +// JobScheduleProperties definition of job schedule parameters. +type JobScheduleProperties struct { + // JobScheduleID - Gets or sets the id of job schedule. + JobScheduleID *string `json:"jobScheduleId,omitempty"` + // Schedule - Gets or sets the schedule. + Schedule *ScheduleAssociationProperty `json:"schedule,omitempty"` + // Runbook - Gets or sets the runbook. + Runbook *RunbookAssociationProperty `json:"runbook,omitempty"` + // RunOn - Gets or sets the hybrid worker group that the scheduled job should run on. + RunOn *string `json:"runOn,omitempty"` + // Parameters - Gets or sets the parameters of the job schedule. + Parameters map[string]*string `json:"parameters"` +} + +// MarshalJSON is the custom marshaler for JobScheduleProperties. +func (jsp JobScheduleProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if jsp.JobScheduleID != nil { + objectMap["jobScheduleId"] = jsp.JobScheduleID + } + if jsp.Schedule != nil { + objectMap["schedule"] = jsp.Schedule + } + if jsp.Runbook != nil { + objectMap["runbook"] = jsp.Runbook + } + if jsp.RunOn != nil { + objectMap["runOn"] = jsp.RunOn + } + if jsp.Parameters != nil { + objectMap["parameters"] = jsp.Parameters + } + return json.Marshal(objectMap) +} + +// JobStream definition of the job stream. +type JobStream struct { + autorest.Response `json:"-"` + // ID - Gets or sets the id of the resource. + ID *string `json:"id,omitempty"` + // JobStreamProperties - Gets or sets the id of the job stream. + *JobStreamProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for JobStream. +func (js JobStream) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if js.ID != nil { + objectMap["id"] = js.ID + } + if js.JobStreamProperties != nil { + objectMap["properties"] = js.JobStreamProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for JobStream struct. +func (js *JobStream) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + js.ID = &ID + } + case "properties": + if v != nil { + var jobStreamProperties JobStreamProperties + err = json.Unmarshal(*v, &jobStreamProperties) + if err != nil { + return err + } + js.JobStreamProperties = &jobStreamProperties + } + } + } + + return nil +} + +// JobStreamListResult the response model for the list job stream operation. +type JobStreamListResult struct { + autorest.Response `json:"-"` + // Value - A list of job streams. + Value *[]JobStream `json:"value,omitempty"` + // NextLink - Gets or sets the next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// JobStreamListResultIterator provides access to a complete listing of JobStream values. +type JobStreamListResultIterator struct { + i int + page JobStreamListResultPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *JobStreamListResultIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter JobStreamListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter JobStreamListResultIterator) Response() JobStreamListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter JobStreamListResultIterator) Value() JobStream { + if !iter.page.NotDone() { + return JobStream{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (jslr JobStreamListResult) IsEmpty() bool { + return jslr.Value == nil || len(*jslr.Value) == 0 +} + +// jobStreamListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (jslr JobStreamListResult) jobStreamListResultPreparer() (*http.Request, error) { + if jslr.NextLink == nil || len(to.String(jslr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(jslr.NextLink))) +} + +// JobStreamListResultPage contains a page of JobStream values. +type JobStreamListResultPage struct { + fn func(JobStreamListResult) (JobStreamListResult, error) + jslr JobStreamListResult +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *JobStreamListResultPage) Next() error { + next, err := page.fn(page.jslr) + if err != nil { + return err + } + page.jslr = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page JobStreamListResultPage) NotDone() bool { + return !page.jslr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page JobStreamListResultPage) Response() JobStreamListResult { + return page.jslr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page JobStreamListResultPage) Values() []JobStream { + if page.jslr.IsEmpty() { + return nil + } + return *page.jslr.Value +} + +// JobStreamProperties definition of the job stream. +type JobStreamProperties struct { + // JobStreamID - Gets or sets the id of the job stream. + JobStreamID *string `json:"jobStreamId,omitempty"` + // Time - Gets or sets the creation time of the job. + Time *date.Time `json:"time,omitempty"` + // StreamType - Gets or sets the stream type. Possible values include: 'Progress', 'Output', 'Warning', 'Error', 'Debug', 'Verbose', 'Any' + StreamType JobStreamType `json:"streamType,omitempty"` + // StreamText - Gets or sets the stream text. + StreamText *string `json:"streamText,omitempty"` + // Summary - Gets or sets the summary. + Summary *string `json:"summary,omitempty"` + // Value - Gets or sets the values of the job stream. + Value map[string]interface{} `json:"value"` +} + +// MarshalJSON is the custom marshaler for JobStreamProperties. +func (jsp JobStreamProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if jsp.JobStreamID != nil { + objectMap["jobStreamId"] = jsp.JobStreamID + } + if jsp.Time != nil { + objectMap["time"] = jsp.Time + } + if jsp.StreamType != "" { + objectMap["streamType"] = jsp.StreamType + } + if jsp.StreamText != nil { + objectMap["streamText"] = jsp.StreamText + } + if jsp.Summary != nil { + objectMap["summary"] = jsp.Summary + } + if jsp.Value != nil { + objectMap["value"] = jsp.Value + } + return json.Marshal(objectMap) +} + +// Key automation key which is used to register a DSC Node +type Key struct { + // KeyName - Automation key name. Possible values include: 'KeyNamePrimary', 'KeyNameSecondary' + KeyName KeyName `json:"KeyName,omitempty"` + // Permissions - Automation key permissions. Possible values include: 'Read', 'Full' + Permissions KeyPermissions `json:"Permissions,omitempty"` + // Value - Value of the Automation Key used for registration. + Value *string `json:"Value,omitempty"` +} + +// KeyListResult ... +type KeyListResult struct { + autorest.Response `json:"-"` + // Keys - Lists the automation keys. + Keys *[]Key `json:"keys,omitempty"` +} + +// LinkedWorkspace definition of the linked workspace. +type LinkedWorkspace struct { + autorest.Response `json:"-"` + // ID - Gets the id of the linked workspace. + ID *string `json:"id,omitempty"` +} + +// LinuxProperties linux specific update configuration. +type LinuxProperties struct { + // IncludedPackageClassifications - Update classifications included in the software update configuration. Possible values include: 'Unclassified', 'Critical', 'Security', 'Other' + IncludedPackageClassifications LinuxUpdateClasses `json:"includedPackageClassifications,omitempty"` + // ExcludedPackageNameMasks - packages excluded from the software update configuration. + ExcludedPackageNameMasks *[]string `json:"excludedPackageNameMasks,omitempty"` + // IncludedPackageNameMasks - packages included from the software update configuration. + IncludedPackageNameMasks *[]string `json:"includedPackageNameMasks,omitempty"` + // RebootSetting - Reboot setting for the software update configuration. + RebootSetting *string `json:"rebootSetting,omitempty"` +} + +// Module definition of the module type. +type Module struct { + autorest.Response `json:"-"` + // ModuleProperties - Gets or sets the module properties. + *ModuleProperties `json:"properties,omitempty"` + // Etag - Gets or sets the etag of the resource. + Etag *string `json:"etag,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // Location - The Azure Region where the resource lives + Location *string `json:"location,omitempty"` + // ID - Fully qualified resource Id for the resource + ID *string `json:"id,omitempty"` + // Name - The name of the resource + Name *string `json:"name,omitempty"` + // Type - The type of the resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Module. +func (mVar Module) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mVar.ModuleProperties != nil { + objectMap["properties"] = mVar.ModuleProperties + } + if mVar.Etag != nil { + objectMap["etag"] = mVar.Etag + } + if mVar.Tags != nil { + objectMap["tags"] = mVar.Tags + } + if mVar.Location != nil { + objectMap["location"] = mVar.Location + } + if mVar.ID != nil { + objectMap["id"] = mVar.ID + } + if mVar.Name != nil { + objectMap["name"] = mVar.Name + } + if mVar.Type != nil { + objectMap["type"] = mVar.Type + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Module struct. +func (mVar *Module) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var moduleProperties ModuleProperties + err = json.Unmarshal(*v, &moduleProperties) + if err != nil { + return err + } + mVar.ModuleProperties = &moduleProperties + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + mVar.Etag = &etag + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + mVar.Tags = tags + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + mVar.Location = &location + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + mVar.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + mVar.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + mVar.Type = &typeVar + } + } + } + + return nil +} + +// ModuleCreateOrUpdateParameters the parameters supplied to the create or update module operation. +type ModuleCreateOrUpdateParameters struct { + // ModuleCreateOrUpdateProperties - Gets or sets the module create properties. + *ModuleCreateOrUpdateProperties `json:"properties,omitempty"` + // Name - Gets or sets name of the resource. + Name *string `json:"name,omitempty"` + // Location - Gets or sets the location of the resource. + Location *string `json:"location,omitempty"` + // Tags - Gets or sets the tags attached to the resource. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for ModuleCreateOrUpdateParameters. +func (mcoup ModuleCreateOrUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mcoup.ModuleCreateOrUpdateProperties != nil { + objectMap["properties"] = mcoup.ModuleCreateOrUpdateProperties + } + if mcoup.Name != nil { + objectMap["name"] = mcoup.Name + } + if mcoup.Location != nil { + objectMap["location"] = mcoup.Location + } + if mcoup.Tags != nil { + objectMap["tags"] = mcoup.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ModuleCreateOrUpdateParameters struct. +func (mcoup *ModuleCreateOrUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var moduleCreateOrUpdateProperties ModuleCreateOrUpdateProperties + err = json.Unmarshal(*v, &moduleCreateOrUpdateProperties) + if err != nil { + return err + } + mcoup.ModuleCreateOrUpdateProperties = &moduleCreateOrUpdateProperties + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + mcoup.Name = &name + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + mcoup.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + mcoup.Tags = tags + } + } + } + + return nil +} + +// ModuleCreateOrUpdateProperties the parameters supplied to the create or update module properties. +type ModuleCreateOrUpdateProperties struct { + // ContentLink - Gets or sets the module content link. + ContentLink *ContentLink `json:"contentLink,omitempty"` +} + +// ModuleErrorInfo definition of the module error info type. +type ModuleErrorInfo struct { + // Code - Gets or sets the error code. + Code *string `json:"code,omitempty"` + // Message - Gets or sets the error message. + Message *string `json:"message,omitempty"` +} + +// ModuleListResult the response model for the list module operation. +type ModuleListResult struct { + autorest.Response `json:"-"` + // Value - Gets or sets a list of modules. + Value *[]Module `json:"value,omitempty"` + // NextLink - Gets or sets the next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// ModuleListResultIterator provides access to a complete listing of Module values. +type ModuleListResultIterator struct { + i int + page ModuleListResultPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ModuleListResultIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ModuleListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ModuleListResultIterator) Response() ModuleListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ModuleListResultIterator) Value() Module { + if !iter.page.NotDone() { + return Module{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (mlr ModuleListResult) IsEmpty() bool { + return mlr.Value == nil || len(*mlr.Value) == 0 +} + +// moduleListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (mlr ModuleListResult) moduleListResultPreparer() (*http.Request, error) { + if mlr.NextLink == nil || len(to.String(mlr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(mlr.NextLink))) +} + +// ModuleListResultPage contains a page of Module values. +type ModuleListResultPage struct { + fn func(ModuleListResult) (ModuleListResult, error) + mlr ModuleListResult +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ModuleListResultPage) Next() error { + next, err := page.fn(page.mlr) + if err != nil { + return err + } + page.mlr = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ModuleListResultPage) NotDone() bool { + return !page.mlr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ModuleListResultPage) Response() ModuleListResult { + return page.mlr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ModuleListResultPage) Values() []Module { + if page.mlr.IsEmpty() { + return nil + } + return *page.mlr.Value +} + +// ModuleProperties definition of the module property type. +type ModuleProperties struct { + // IsGlobal - Gets or sets the isGlobal flag of the module. + IsGlobal *bool `json:"isGlobal,omitempty"` + // Version - Gets or sets the version of the module. + Version *string `json:"version,omitempty"` + // SizeInBytes - Gets or sets the size in bytes of the module. + SizeInBytes *int64 `json:"sizeInBytes,omitempty"` + // ActivityCount - Gets or sets the activity count of the module. + ActivityCount *int32 `json:"activityCount,omitempty"` + // ProvisioningState - Gets or sets the provisioning state of the module. Possible values include: 'ModuleProvisioningStateCreated', 'ModuleProvisioningStateCreating', 'ModuleProvisioningStateStartingImportModuleRunbook', 'ModuleProvisioningStateRunningImportModuleRunbook', 'ModuleProvisioningStateContentRetrieved', 'ModuleProvisioningStateContentDownloaded', 'ModuleProvisioningStateContentValidated', 'ModuleProvisioningStateConnectionTypeImported', 'ModuleProvisioningStateContentStored', 'ModuleProvisioningStateModuleDataStored', 'ModuleProvisioningStateActivitiesStored', 'ModuleProvisioningStateModuleImportRunbookComplete', 'ModuleProvisioningStateSucceeded', 'ModuleProvisioningStateFailed', 'ModuleProvisioningStateCancelled', 'ModuleProvisioningStateUpdating' + ProvisioningState ModuleProvisioningState `json:"provisioningState,omitempty"` + // ContentLink - Gets or sets the contentLink of the module. + ContentLink *ContentLink `json:"contentLink,omitempty"` + // Error - Gets or sets the error info of the module. + Error *ModuleErrorInfo `json:"error,omitempty"` + // CreationTime - Gets or sets the creation time. + CreationTime *date.Time `json:"creationTime,omitempty"` + // LastModifiedTime - Gets or sets the last modified time. + LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` + // Description - Gets or sets the description. + Description *string `json:"description,omitempty"` + // IsComposite - Gets or sets type of module, if its composite or not. + IsComposite *bool `json:"isComposite,omitempty"` +} + +// ModuleUpdateParameters the parameters supplied to the update module operation. +type ModuleUpdateParameters struct { + // ModuleUpdateProperties - Gets or sets the module update properties. + *ModuleUpdateProperties `json:"properties,omitempty"` + // Name - Gets or sets name of the resource. + Name *string `json:"name,omitempty"` + // Location - Gets or sets the location of the resource. + Location *string `json:"location,omitempty"` + // Tags - Gets or sets the tags attached to the resource. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for ModuleUpdateParameters. +func (mup ModuleUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mup.ModuleUpdateProperties != nil { + objectMap["properties"] = mup.ModuleUpdateProperties + } + if mup.Name != nil { + objectMap["name"] = mup.Name + } + if mup.Location != nil { + objectMap["location"] = mup.Location + } + if mup.Tags != nil { + objectMap["tags"] = mup.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ModuleUpdateParameters struct. +func (mup *ModuleUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var moduleUpdateProperties ModuleUpdateProperties + err = json.Unmarshal(*v, &moduleUpdateProperties) + if err != nil { + return err + } + mup.ModuleUpdateProperties = &moduleUpdateProperties + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + mup.Name = &name + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + mup.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + mup.Tags = tags + } + } + } + + return nil +} + +// ModuleUpdateProperties the parameters supplied to the update properties. +type ModuleUpdateProperties struct { + // ContentLink - Gets or sets the module content link. + ContentLink *ContentLink `json:"contentLink,omitempty"` +} + +// NodeCount number of nodes based on the Filter +type NodeCount struct { + // Name - Gets the name of a count type + Name *string `json:"name,omitempty"` + Properties *NodeCountProperties `json:"properties,omitempty"` +} + +// NodeCountProperties ... +type NodeCountProperties struct { + // Count - Gets the count for the name + Count *int32 `json:"count,omitempty"` +} + +// NodeCounts gets the count of nodes by count type +type NodeCounts struct { + autorest.Response `json:"-"` + // Value - Gets an array of counts + Value *[]NodeCount `json:"value,omitempty"` + // TotalCount - Gets the total number of records matching countType criteria. + TotalCount *int32 `json:"totalCount,omitempty"` +} + +// Operation automation REST API operation +type Operation struct { + // Name - Operation name: {provider}/{resource}/{operation} + Name *string `json:"name,omitempty"` + // Display - Provider, Resource and Operation values + Display *OperationDisplay `json:"display,omitempty"` +} + +// OperationDisplay provider, Resource and Operation values +type OperationDisplay struct { + // Provider - Service provider: Microsoft.Automation + Provider *string `json:"provider,omitempty"` + // Resource - Resource on which the operation is performed: Runbooks, Jobs etc. + Resource *string `json:"resource,omitempty"` + // Operation - Operation type: Read, write, delete, etc. + Operation *string `json:"operation,omitempty"` +} + +// OperationListResult the response model for the list of Automation operations +type OperationListResult struct { + autorest.Response `json:"-"` + // Value - List of Automation operations supported by the Automation resource provider. + Value *[]Operation `json:"value,omitempty"` +} + +// ProxyResource ARM proxy resource. +type ProxyResource struct { + // ID - Fully qualified resource Id for the resource + ID *string `json:"id,omitempty"` + // Name - The name of the resource + Name *string `json:"name,omitempty"` + // Type - The type of the resource. + Type *string `json:"type,omitempty"` +} + +// Resource the core properties of ARM resources +type Resource struct { + // ID - Fully qualified resource Id for the resource + ID *string `json:"id,omitempty"` + // Name - The name of the resource + Name *string `json:"name,omitempty"` + // Type - The type of the resource. + Type *string `json:"type,omitempty"` +} + +// RunAsCredentialAssociationProperty definition of runas credential to use for hybrid worker. +type RunAsCredentialAssociationProperty struct { + // Name - Gets or sets the name of the credential. + Name *string `json:"name,omitempty"` +} + +// Runbook definition of the runbook type. +type Runbook struct { + autorest.Response `json:"-"` + // RunbookProperties - Gets or sets the runbook properties. + *RunbookProperties `json:"properties,omitempty"` + // Etag - Gets or sets the etag of the resource. + Etag *string `json:"etag,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // Location - The Azure Region where the resource lives + Location *string `json:"location,omitempty"` + // ID - Fully qualified resource Id for the resource + ID *string `json:"id,omitempty"` + // Name - The name of the resource + Name *string `json:"name,omitempty"` + // Type - The type of the resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Runbook. +func (r Runbook) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if r.RunbookProperties != nil { + objectMap["properties"] = r.RunbookProperties + } + if r.Etag != nil { + objectMap["etag"] = r.Etag + } + if r.Tags != nil { + objectMap["tags"] = r.Tags + } + if r.Location != nil { + objectMap["location"] = r.Location + } + if r.ID != nil { + objectMap["id"] = r.ID + } + if r.Name != nil { + objectMap["name"] = r.Name + } + if r.Type != nil { + objectMap["type"] = r.Type + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Runbook struct. +func (r *Runbook) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var runbookProperties RunbookProperties + err = json.Unmarshal(*v, &runbookProperties) + if err != nil { + return err + } + r.RunbookProperties = &runbookProperties + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + r.Etag = &etag + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + r.Tags = tags + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + r.Location = &location + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + r.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + r.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + r.Type = &typeVar + } + } + } + + return nil +} + +// RunbookAssociationProperty the runbook property associated with the entity. +type RunbookAssociationProperty struct { + // Name - Gets or sets the name of the runbook. + Name *string `json:"name,omitempty"` +} + +// RunbookCreateOrUpdateDraftParameters the parameters supplied to the create or update runbook operation. +type RunbookCreateOrUpdateDraftParameters struct { + // RunbookContent - Content of the Runbook. + RunbookContent *string `json:"runbookContent,omitempty"` +} + +// RunbookCreateOrUpdateDraftProperties the parameters supplied to the create or update dratft runbook properties. +type RunbookCreateOrUpdateDraftProperties struct { + // LogVerbose - Gets or sets verbose log option. + LogVerbose *bool `json:"logVerbose,omitempty"` + // LogProgress - Gets or sets progress log option. + LogProgress *bool `json:"logProgress,omitempty"` + // RunbookType - Gets or sets the type of the runbook. Possible values include: 'Script', 'Graph', 'PowerShellWorkflow', 'PowerShell', 'GraphPowerShellWorkflow', 'GraphPowerShell' + RunbookType RunbookTypeEnum `json:"runbookType,omitempty"` + // Draft - Gets or sets the draft runbook properties. + Draft *RunbookDraft `json:"draft,omitempty"` + // Description - Gets or sets the description of the runbook. + Description *string `json:"description,omitempty"` + // LogActivityTrace - Gets or sets the activity-level tracing options of the runbook. + LogActivityTrace *int32 `json:"logActivityTrace,omitempty"` +} + +// RunbookCreateOrUpdateParameters the parameters supplied to the create or update runbook operation. +type RunbookCreateOrUpdateParameters struct { + // RunbookCreateOrUpdateProperties - Gets or sets runbook create or update properties. + *RunbookCreateOrUpdateProperties `json:"properties,omitempty"` + // Name - Gets or sets the name of the resource. + Name *string `json:"name,omitempty"` + // Location - Gets or sets the location of the resource. + Location *string `json:"location,omitempty"` + // Tags - Gets or sets the tags attached to the resource. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for RunbookCreateOrUpdateParameters. +func (rcoup RunbookCreateOrUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rcoup.RunbookCreateOrUpdateProperties != nil { + objectMap["properties"] = rcoup.RunbookCreateOrUpdateProperties + } + if rcoup.Name != nil { + objectMap["name"] = rcoup.Name + } + if rcoup.Location != nil { + objectMap["location"] = rcoup.Location + } + if rcoup.Tags != nil { + objectMap["tags"] = rcoup.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for RunbookCreateOrUpdateParameters struct. +func (rcoup *RunbookCreateOrUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var runbookCreateOrUpdateProperties RunbookCreateOrUpdateProperties + err = json.Unmarshal(*v, &runbookCreateOrUpdateProperties) + if err != nil { + return err + } + rcoup.RunbookCreateOrUpdateProperties = &runbookCreateOrUpdateProperties + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + rcoup.Name = &name + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + rcoup.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + rcoup.Tags = tags + } + } + } + + return nil +} + +// RunbookCreateOrUpdateProperties the parameters supplied to the create or update runbook properties. +type RunbookCreateOrUpdateProperties struct { + // LogVerbose - Gets or sets verbose log option. + LogVerbose *bool `json:"logVerbose,omitempty"` + // LogProgress - Gets or sets progress log option. + LogProgress *bool `json:"logProgress,omitempty"` + // RunbookType - Gets or sets the type of the runbook. Possible values include: 'Script', 'Graph', 'PowerShellWorkflow', 'PowerShell', 'GraphPowerShellWorkflow', 'GraphPowerShell' + RunbookType RunbookTypeEnum `json:"runbookType,omitempty"` + // Draft - Gets or sets the draft runbook properties. + Draft *RunbookDraft `json:"draft,omitempty"` + // PublishContentLink - Gets or sets the published runbook content link. + PublishContentLink *ContentLink `json:"publishContentLink,omitempty"` + // Description - Gets or sets the description of the runbook. + Description *string `json:"description,omitempty"` + // LogActivityTrace - Gets or sets the activity-level tracing options of the runbook. + LogActivityTrace *int32 `json:"logActivityTrace,omitempty"` +} + +// RunbookDraft ... +type RunbookDraft struct { + autorest.Response `json:"-"` + // InEdit - Gets or sets whether runbook is in edit mode. + InEdit *bool `json:"inEdit,omitempty"` + // DraftContentLink - Gets or sets the draft runbook content link. + DraftContentLink *ContentLink `json:"draftContentLink,omitempty"` + // CreationTime - Gets or sets the creation time of the runbook draft. + CreationTime *date.Time `json:"creationTime,omitempty"` + // LastModifiedTime - Gets or sets the last modified time of the runbook draft. + LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` + // Parameters - Gets or sets the runbook draft parameters. + Parameters map[string]*RunbookParameter `json:"parameters"` + // OutputTypes - Gets or sets the runbook output types. + OutputTypes *[]string `json:"outputTypes,omitempty"` +} + +// MarshalJSON is the custom marshaler for RunbookDraft. +func (rd RunbookDraft) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rd.InEdit != nil { + objectMap["inEdit"] = rd.InEdit + } + if rd.DraftContentLink != nil { + objectMap["draftContentLink"] = rd.DraftContentLink + } + if rd.CreationTime != nil { + objectMap["creationTime"] = rd.CreationTime + } + if rd.LastModifiedTime != nil { + objectMap["lastModifiedTime"] = rd.LastModifiedTime + } + if rd.Parameters != nil { + objectMap["parameters"] = rd.Parameters + } + if rd.OutputTypes != nil { + objectMap["outputTypes"] = rd.OutputTypes + } + return json.Marshal(objectMap) +} + +// RunbookDraftPublishFuture an abstraction for monitoring and retrieving the results of a long-running operation. +type RunbookDraftPublishFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *RunbookDraftPublishFuture) Result(client RunbookDraftClient) (ar autorest.Response, err error) { + var done bool + done, err = future.Done(client) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.RunbookDraftPublishFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("automation.RunbookDraftPublishFuture") + return + } + ar.Response = future.Response() + return +} + +// RunbookDraftReplaceContentFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type RunbookDraftReplaceContentFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *RunbookDraftReplaceContentFuture) Result(client RunbookDraftClient) (s String, err error) { + var done bool + done, err = future.Done(client) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.RunbookDraftReplaceContentFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("automation.RunbookDraftReplaceContentFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if s.Response.Response, err = future.GetResult(sender); err == nil && s.Response.Response.StatusCode != http.StatusNoContent { + s, err = client.ReplaceContentResponder(s.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.RunbookDraftReplaceContentFuture", "Result", s.Response.Response, "Failure responding to request") + } + } + return +} + +// RunbookDraftUndoEditResult the response model for the undoedit runbook operation. +type RunbookDraftUndoEditResult struct { + autorest.Response `json:"-"` + // StatusCode - Possible values include: 'Continue', 'SwitchingProtocols', 'OK', 'Created', 'Accepted', 'NonAuthoritativeInformation', 'NoContent', 'ResetContent', 'PartialContent', 'MultipleChoices', 'Ambiguous', 'MovedPermanently', 'Moved', 'Found', 'Redirect', 'SeeOther', 'RedirectMethod', 'NotModified', 'UseProxy', 'Unused', 'TemporaryRedirect', 'RedirectKeepVerb', 'BadRequest', 'Unauthorized', 'PaymentRequired', 'Forbidden', 'NotFound', 'MethodNotAllowed', 'NotAcceptable', 'ProxyAuthenticationRequired', 'RequestTimeout', 'Conflict', 'Gone', 'LengthRequired', 'PreconditionFailed', 'RequestEntityTooLarge', 'RequestURITooLong', 'UnsupportedMediaType', 'RequestedRangeNotSatisfiable', 'ExpectationFailed', 'UpgradeRequired', 'InternalServerError', 'NotImplemented', 'BadGateway', 'ServiceUnavailable', 'GatewayTimeout', 'HTTPVersionNotSupported' + StatusCode HTTPStatusCode `json:"statusCode,omitempty"` + RequestID *string `json:"requestId,omitempty"` +} + +// RunbookListResult the response model for the list runbook operation. +type RunbookListResult struct { + autorest.Response `json:"-"` + // Value - Gets or sets a list of runbooks. + Value *[]Runbook `json:"value,omitempty"` + // NextLink - Gets or sets the next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// RunbookListResultIterator provides access to a complete listing of Runbook values. +type RunbookListResultIterator struct { + i int + page RunbookListResultPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *RunbookListResultIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter RunbookListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter RunbookListResultIterator) Response() RunbookListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter RunbookListResultIterator) Value() Runbook { + if !iter.page.NotDone() { + return Runbook{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (rlr RunbookListResult) IsEmpty() bool { + return rlr.Value == nil || len(*rlr.Value) == 0 +} + +// runbookListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (rlr RunbookListResult) runbookListResultPreparer() (*http.Request, error) { + if rlr.NextLink == nil || len(to.String(rlr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(rlr.NextLink))) +} + +// RunbookListResultPage contains a page of Runbook values. +type RunbookListResultPage struct { + fn func(RunbookListResult) (RunbookListResult, error) + rlr RunbookListResult +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *RunbookListResultPage) Next() error { + next, err := page.fn(page.rlr) + if err != nil { + return err + } + page.rlr = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page RunbookListResultPage) NotDone() bool { + return !page.rlr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page RunbookListResultPage) Response() RunbookListResult { + return page.rlr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page RunbookListResultPage) Values() []Runbook { + if page.rlr.IsEmpty() { + return nil + } + return *page.rlr.Value +} + +// RunbookParameter definition of the runbook parameter type. +type RunbookParameter struct { + // Type - Gets or sets the type of the parameter. + Type *string `json:"type,omitempty"` + // IsMandatory - Gets or sets a Boolean value to indicate whether the parameter is madatory or not. + IsMandatory *bool `json:"isMandatory,omitempty"` + // Position - Get or sets the position of the parameter. + Position *int32 `json:"position,omitempty"` + // DefaultValue - Gets or sets the default value of parameter. + DefaultValue *string `json:"defaultValue,omitempty"` +} + +// RunbookProperties definition of the runbook property type. +type RunbookProperties struct { + // RunbookType - Gets or sets the type of the runbook. Possible values include: 'Script', 'Graph', 'PowerShellWorkflow', 'PowerShell', 'GraphPowerShellWorkflow', 'GraphPowerShell' + RunbookType RunbookTypeEnum `json:"runbookType,omitempty"` + // PublishContentLink - Gets or sets the published runbook content link. + PublishContentLink *ContentLink `json:"publishContentLink,omitempty"` + // State - Gets or sets the state of the runbook. Possible values include: 'RunbookStateNew', 'RunbookStateEdit', 'RunbookStatePublished' + State RunbookState `json:"state,omitempty"` + // LogVerbose - Gets or sets verbose log option. + LogVerbose *bool `json:"logVerbose,omitempty"` + // LogProgress - Gets or sets progress log option. + LogProgress *bool `json:"logProgress,omitempty"` + // LogActivityTrace - Gets or sets the option to log activity trace of the runbook. + LogActivityTrace *int32 `json:"logActivityTrace,omitempty"` + // JobCount - Gets or sets the job count of the runbook. + JobCount *int32 `json:"jobCount,omitempty"` + // Parameters - Gets or sets the runbook parameters. + Parameters map[string]*RunbookParameter `json:"parameters"` + // OutputTypes - Gets or sets the runbook output types. + OutputTypes *[]string `json:"outputTypes,omitempty"` + // Draft - Gets or sets the draft runbook properties. + Draft *RunbookDraft `json:"draft,omitempty"` + // ProvisioningState - Gets or sets the provisioning state of the runbook. Possible values include: 'RunbookProvisioningStateSucceeded' + ProvisioningState RunbookProvisioningState `json:"provisioningState,omitempty"` + // LastModifiedBy - Gets or sets the last modified by. + LastModifiedBy *string `json:"lastModifiedBy,omitempty"` + // CreationTime - Gets or sets the creation time. + CreationTime *date.Time `json:"creationTime,omitempty"` + // LastModifiedTime - Gets or sets the last modified time. + LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` + // Description - Gets or sets the description. + Description *string `json:"description,omitempty"` +} + +// MarshalJSON is the custom marshaler for RunbookProperties. +func (rp RunbookProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rp.RunbookType != "" { + objectMap["runbookType"] = rp.RunbookType + } + if rp.PublishContentLink != nil { + objectMap["publishContentLink"] = rp.PublishContentLink + } + if rp.State != "" { + objectMap["state"] = rp.State + } + if rp.LogVerbose != nil { + objectMap["logVerbose"] = rp.LogVerbose + } + if rp.LogProgress != nil { + objectMap["logProgress"] = rp.LogProgress + } + if rp.LogActivityTrace != nil { + objectMap["logActivityTrace"] = rp.LogActivityTrace + } + if rp.JobCount != nil { + objectMap["jobCount"] = rp.JobCount + } + if rp.Parameters != nil { + objectMap["parameters"] = rp.Parameters + } + if rp.OutputTypes != nil { + objectMap["outputTypes"] = rp.OutputTypes + } + if rp.Draft != nil { + objectMap["draft"] = rp.Draft + } + if rp.ProvisioningState != "" { + objectMap["provisioningState"] = rp.ProvisioningState + } + if rp.LastModifiedBy != nil { + objectMap["lastModifiedBy"] = rp.LastModifiedBy + } + if rp.CreationTime != nil { + objectMap["creationTime"] = rp.CreationTime + } + if rp.LastModifiedTime != nil { + objectMap["lastModifiedTime"] = rp.LastModifiedTime + } + if rp.Description != nil { + objectMap["description"] = rp.Description + } + return json.Marshal(objectMap) +} + +// RunbookUpdateParameters the parameters supplied to the update runbook operation. +type RunbookUpdateParameters struct { + // RunbookUpdateProperties - Gets or sets the runbook update properties. + *RunbookUpdateProperties `json:"properties,omitempty"` + // Name - Gets or sets the name of the resource. + Name *string `json:"name,omitempty"` + // Location - Gets or sets the location of the resource. + Location *string `json:"location,omitempty"` + // Tags - Gets or sets the tags attached to the resource. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for RunbookUpdateParameters. +func (rup RunbookUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rup.RunbookUpdateProperties != nil { + objectMap["properties"] = rup.RunbookUpdateProperties + } + if rup.Name != nil { + objectMap["name"] = rup.Name + } + if rup.Location != nil { + objectMap["location"] = rup.Location + } + if rup.Tags != nil { + objectMap["tags"] = rup.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for RunbookUpdateParameters struct. +func (rup *RunbookUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var runbookUpdateProperties RunbookUpdateProperties + err = json.Unmarshal(*v, &runbookUpdateProperties) + if err != nil { + return err + } + rup.RunbookUpdateProperties = &runbookUpdateProperties + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + rup.Name = &name + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + rup.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + rup.Tags = tags + } + } + } + + return nil +} + +// RunbookUpdateProperties the parameters supplied to the update runbook properties. +type RunbookUpdateProperties struct { + // Description - Gets or sets the description of the runbook. + Description *string `json:"description,omitempty"` + // LogVerbose - Gets or sets verbose log option. + LogVerbose *bool `json:"logVerbose,omitempty"` + // LogProgress - Gets or sets progress log option. + LogProgress *bool `json:"logProgress,omitempty"` + // LogActivityTrace - Gets or sets the activity-level tracing options of the runbook. + LogActivityTrace *int32 `json:"logActivityTrace,omitempty"` +} + +// Schedule definition of the schedule. +type Schedule struct { + autorest.Response `json:"-"` + // ScheduleProperties - Gets or sets the properties of the schedule. + *ScheduleProperties `json:"properties,omitempty"` + // ID - Fully qualified resource Id for the resource + ID *string `json:"id,omitempty"` + // Name - The name of the resource + Name *string `json:"name,omitempty"` + // Type - The type of the resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Schedule. +func (s Schedule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if s.ScheduleProperties != nil { + objectMap["properties"] = s.ScheduleProperties + } + if s.ID != nil { + objectMap["id"] = s.ID + } + if s.Name != nil { + objectMap["name"] = s.Name + } + if s.Type != nil { + objectMap["type"] = s.Type + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Schedule struct. +func (s *Schedule) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var scheduleProperties ScheduleProperties + err = json.Unmarshal(*v, &scheduleProperties) + if err != nil { + return err + } + s.ScheduleProperties = &scheduleProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + s.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + s.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + s.Type = &typeVar + } + } + } + + return nil +} + +// ScheduleAssociationProperty the schedule property associated with the entity. +type ScheduleAssociationProperty struct { + // Name - Gets or sets the name of the Schedule. + Name *string `json:"name,omitempty"` +} + +// ScheduleCreateOrUpdateParameters the parameters supplied to the create or update schedule operation. +type ScheduleCreateOrUpdateParameters struct { + // Name - Gets or sets the name of the Schedule. + Name *string `json:"name,omitempty"` + // ScheduleCreateOrUpdateProperties - Gets or sets the list of schedule properties. + *ScheduleCreateOrUpdateProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for ScheduleCreateOrUpdateParameters. +func (scoup ScheduleCreateOrUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if scoup.Name != nil { + objectMap["name"] = scoup.Name + } + if scoup.ScheduleCreateOrUpdateProperties != nil { + objectMap["properties"] = scoup.ScheduleCreateOrUpdateProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ScheduleCreateOrUpdateParameters struct. +func (scoup *ScheduleCreateOrUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + scoup.Name = &name + } + case "properties": + if v != nil { + var scheduleCreateOrUpdateProperties ScheduleCreateOrUpdateProperties + err = json.Unmarshal(*v, &scheduleCreateOrUpdateProperties) + if err != nil { + return err + } + scoup.ScheduleCreateOrUpdateProperties = &scheduleCreateOrUpdateProperties + } + } + } + + return nil +} + +// ScheduleCreateOrUpdateProperties the parameters supplied to the create or update schedule operation. +type ScheduleCreateOrUpdateProperties struct { + // Description - Gets or sets the description of the schedule. + Description *string `json:"description,omitempty"` + // StartTime - Gets or sets the start time of the schedule. + StartTime *date.Time `json:"startTime,omitempty"` + // ExpiryTime - Gets or sets the end time of the schedule. + ExpiryTime *date.Time `json:"expiryTime,omitempty"` + // Interval - Gets or sets the interval of the schedule. + Interval interface{} `json:"interval,omitempty"` + // Frequency - Possible values include: 'OneTime', 'Day', 'Hour', 'Week', 'Month' + Frequency ScheduleFrequency `json:"frequency,omitempty"` + // TimeZone - Gets or sets the time zone of the schedule. + TimeZone *string `json:"timeZone,omitempty"` + // AdvancedSchedule - Gets or sets the AdvancedSchedule. + AdvancedSchedule *AdvancedSchedule `json:"advancedSchedule,omitempty"` +} + +// ScheduleListResult the response model for the list schedule operation. +type ScheduleListResult struct { + autorest.Response `json:"-"` + // Value - Gets or sets a list of schedules. + Value *[]Schedule `json:"value,omitempty"` + // NextLink - Gets or sets the next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// ScheduleListResultIterator provides access to a complete listing of Schedule values. +type ScheduleListResultIterator struct { + i int + page ScheduleListResultPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ScheduleListResultIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ScheduleListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ScheduleListResultIterator) Response() ScheduleListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ScheduleListResultIterator) Value() Schedule { + if !iter.page.NotDone() { + return Schedule{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (slr ScheduleListResult) IsEmpty() bool { + return slr.Value == nil || len(*slr.Value) == 0 +} + +// scheduleListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (slr ScheduleListResult) scheduleListResultPreparer() (*http.Request, error) { + if slr.NextLink == nil || len(to.String(slr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(slr.NextLink))) +} + +// ScheduleListResultPage contains a page of Schedule values. +type ScheduleListResultPage struct { + fn func(ScheduleListResult) (ScheduleListResult, error) + slr ScheduleListResult +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ScheduleListResultPage) Next() error { + next, err := page.fn(page.slr) + if err != nil { + return err + } + page.slr = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ScheduleListResultPage) NotDone() bool { + return !page.slr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ScheduleListResultPage) Response() ScheduleListResult { + return page.slr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ScheduleListResultPage) Values() []Schedule { + if page.slr.IsEmpty() { + return nil + } + return *page.slr.Value +} + +// ScheduleProperties definition of schedule parameters. +type ScheduleProperties struct { + // StartTime - Gets or sets the start time of the schedule. + StartTime *date.Time `json:"startTime,omitempty"` + // StartTimeOffsetMinutes - Gets the start time's offset in minutes. + StartTimeOffsetMinutes *float64 `json:"startTimeOffsetMinutes,omitempty"` + // ExpiryTime - Gets or sets the end time of the schedule. + ExpiryTime *date.Time `json:"expiryTime,omitempty"` + // ExpiryTimeOffsetMinutes - Gets or sets the expiry time's offset in minutes. + ExpiryTimeOffsetMinutes *float64 `json:"expiryTimeOffsetMinutes,omitempty"` + // IsEnabled - Gets or sets a value indicating whether this schedule is enabled. + IsEnabled *bool `json:"isEnabled,omitempty"` + // NextRun - Gets or sets the next run time of the schedule. + NextRun *date.Time `json:"nextRun,omitempty"` + // NextRunOffsetMinutes - Gets or sets the next run time's offset in minutes. + NextRunOffsetMinutes *float64 `json:"nextRunOffsetMinutes,omitempty"` + // Interval - Gets or sets the interval of the schedule. + Interval *int32 `json:"interval,omitempty"` + // Frequency - Gets or sets the frequency of the schedule. Possible values include: 'OneTime', 'Day', 'Hour', 'Week', 'Month' + Frequency ScheduleFrequency `json:"frequency,omitempty"` + // TimeZone - Gets or sets the time zone of the schedule. + TimeZone *string `json:"timeZone,omitempty"` + // AdvancedSchedule - Gets or sets the advanced schedule. + AdvancedSchedule *AdvancedSchedule `json:"advancedSchedule,omitempty"` + // CreationTime - Gets or sets the creation time. + CreationTime *date.Time `json:"creationTime,omitempty"` + // LastModifiedTime - Gets or sets the last modified time. + LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` + // Description - Gets or sets the description. + Description *string `json:"description,omitempty"` +} + +// ScheduleUpdateParameters the parameters supplied to the update schedule operation. +type ScheduleUpdateParameters struct { + // Name - Gets or sets the name of the Schedule. + Name *string `json:"name,omitempty"` + // ScheduleUpdateProperties - Gets or sets the list of schedule properties. + *ScheduleUpdateProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for ScheduleUpdateParameters. +func (sup ScheduleUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sup.Name != nil { + objectMap["name"] = sup.Name + } + if sup.ScheduleUpdateProperties != nil { + objectMap["properties"] = sup.ScheduleUpdateProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ScheduleUpdateParameters struct. +func (sup *ScheduleUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + sup.Name = &name + } + case "properties": + if v != nil { + var scheduleUpdateProperties ScheduleUpdateProperties + err = json.Unmarshal(*v, &scheduleUpdateProperties) + if err != nil { + return err + } + sup.ScheduleUpdateProperties = &scheduleUpdateProperties + } + } + } + + return nil +} + +// ScheduleUpdateProperties the parameters supplied to the update schedule operation. +type ScheduleUpdateProperties struct { + // Description - Gets or sets the description of the schedule. + Description *string `json:"description,omitempty"` + // IsEnabled - Gets or sets a value indicating whether this schedule is enabled. + IsEnabled *bool `json:"isEnabled,omitempty"` +} + +// SetObject ... +type SetObject struct { + autorest.Response `json:"-"` + Value interface{} `json:"value,omitempty"` +} + +// Sku the account SKU. +type Sku struct { + // Name - Gets or sets the SKU name of the account. Possible values include: 'Free', 'Basic' + Name SkuNameEnum `json:"name,omitempty"` + // Family - Gets or sets the SKU family. + Family *string `json:"family,omitempty"` + // Capacity - Gets or sets the SKU capacity. + Capacity *int32 `json:"capacity,omitempty"` +} + +// SoftwareUpdateConfiguration software update configuration properties. +type SoftwareUpdateConfiguration struct { + autorest.Response `json:"-"` + // Name - Resource name. + Name *string `json:"name,omitempty"` + // ID - Resource Id. + ID *string `json:"id,omitempty"` + // Type - Resource type + Type *string `json:"type,omitempty"` + // SoftwareUpdateConfigurationProperties - Software update configuration properties. + *SoftwareUpdateConfigurationProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for SoftwareUpdateConfiguration. +func (suc SoftwareUpdateConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if suc.Name != nil { + objectMap["name"] = suc.Name + } + if suc.ID != nil { + objectMap["id"] = suc.ID + } + if suc.Type != nil { + objectMap["type"] = suc.Type + } + if suc.SoftwareUpdateConfigurationProperties != nil { + objectMap["properties"] = suc.SoftwareUpdateConfigurationProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SoftwareUpdateConfiguration struct. +func (suc *SoftwareUpdateConfiguration) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + suc.Name = &name + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + suc.ID = &ID + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + suc.Type = &typeVar + } + case "properties": + if v != nil { + var softwareUpdateConfigurationProperties SoftwareUpdateConfigurationProperties + err = json.Unmarshal(*v, &softwareUpdateConfigurationProperties) + if err != nil { + return err + } + suc.SoftwareUpdateConfigurationProperties = &softwareUpdateConfigurationProperties + } + } + } + + return nil +} + +// SoftwareUpdateConfigurationCollectionItem software update configuration collection item properties. +type SoftwareUpdateConfigurationCollectionItem struct { + // Name - Name of the software update configuration. + Name *string `json:"name,omitempty"` + // ID - Resource Id of the software update configuration + ID *string `json:"id,omitempty"` + // SoftwareUpdateConfigurationCollectionItemProperties - Software update configuration properties. + *SoftwareUpdateConfigurationCollectionItemProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for SoftwareUpdateConfigurationCollectionItem. +func (succi SoftwareUpdateConfigurationCollectionItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if succi.Name != nil { + objectMap["name"] = succi.Name + } + if succi.ID != nil { + objectMap["id"] = succi.ID + } + if succi.SoftwareUpdateConfigurationCollectionItemProperties != nil { + objectMap["properties"] = succi.SoftwareUpdateConfigurationCollectionItemProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SoftwareUpdateConfigurationCollectionItem struct. +func (succi *SoftwareUpdateConfigurationCollectionItem) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + succi.Name = &name + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + succi.ID = &ID + } + case "properties": + if v != nil { + var softwareUpdateConfigurationCollectionItemProperties SoftwareUpdateConfigurationCollectionItemProperties + err = json.Unmarshal(*v, &softwareUpdateConfigurationCollectionItemProperties) + if err != nil { + return err + } + succi.SoftwareUpdateConfigurationCollectionItemProperties = &softwareUpdateConfigurationCollectionItemProperties + } + } + } + + return nil +} + +// SoftwareUpdateConfigurationCollectionItemProperties software update configuration collection item properties. +type SoftwareUpdateConfigurationCollectionItemProperties struct { + // UpdateConfiguration - Update specific properties of the software update configuration. + UpdateConfiguration *CollectionItemUpdateConfiguration `json:"updateConfiguration,omitempty"` + // Frequency - execution frequency of the schedule associated with the software update configuration. Possible values include: 'OneTime', 'Day', 'Hour', 'Week', 'Month' + Frequency ScheduleFrequency `json:"frequency,omitempty"` + // StartTime - the start time of the update. + StartTime *date.Time `json:"startTime,omitempty"` + // CreationTime - Creation time of the software update configuration, which only appears in the response. + CreationTime *date.Time `json:"creationTime,omitempty"` + // LastModifiedTime - Last time software update configuration was modified, which only appears in the response. + LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` + // ProvisioningState - Provisioning state for the software update configuration, which only appears in the response. + ProvisioningState *string `json:"provisioningState,omitempty"` + // NextRun - ext run time of the update. + NextRun *date.Time `json:"nextRun,omitempty"` +} + +// SoftwareUpdateConfigurationListResult result of listing all software update configuration +type SoftwareUpdateConfigurationListResult struct { + autorest.Response `json:"-"` + // Value - outer object returned when listing all software update configurations + Value *[]SoftwareUpdateConfigurationCollectionItem `json:"value,omitempty"` +} + +// SoftwareUpdateConfigurationMachineRun software update configuration machine run model. +type SoftwareUpdateConfigurationMachineRun struct { + autorest.Response `json:"-"` + // Name - Name of the software update configuration machine run + Name *string `json:"name,omitempty"` + // ID - Resource Id of the software update configuration machine run + ID *string `json:"id,omitempty"` + // UpdateConfigurationMachineRunProperties - Software update configuration machine run properties. + *UpdateConfigurationMachineRunProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for SoftwareUpdateConfigurationMachineRun. +func (sucmr SoftwareUpdateConfigurationMachineRun) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sucmr.Name != nil { + objectMap["name"] = sucmr.Name + } + if sucmr.ID != nil { + objectMap["id"] = sucmr.ID + } + if sucmr.UpdateConfigurationMachineRunProperties != nil { + objectMap["properties"] = sucmr.UpdateConfigurationMachineRunProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SoftwareUpdateConfigurationMachineRun struct. +func (sucmr *SoftwareUpdateConfigurationMachineRun) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + sucmr.Name = &name + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + sucmr.ID = &ID + } + case "properties": + if v != nil { + var updateConfigurationMachineRunProperties UpdateConfigurationMachineRunProperties + err = json.Unmarshal(*v, &updateConfigurationMachineRunProperties) + if err != nil { + return err + } + sucmr.UpdateConfigurationMachineRunProperties = &updateConfigurationMachineRunProperties + } + } + } + + return nil +} + +// SoftwareUpdateConfigurationMachineRunListResult result of listing all software update configuration machine runs +type SoftwareUpdateConfigurationMachineRunListResult struct { + autorest.Response `json:"-"` + // Value - outer object returned when listing all software update configuration machine runs + Value *[]SoftwareUpdateConfigurationMachineRun `json:"value,omitempty"` + // NextLink - link to next page of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// SoftwareUpdateConfigurationProperties software update configuration properties. +type SoftwareUpdateConfigurationProperties struct { + // UpdateConfiguration - update specific properties for the Software update configuration + UpdateConfiguration *UpdateConfiguration `json:"updateConfiguration,omitempty"` + // ScheduleInfo - Schedule information for the Software update configuration + ScheduleInfo *ScheduleProperties `json:"scheduleInfo,omitempty"` + // ProvisioningState - Provisioning state for the software update configuration, which only appears in the response. + ProvisioningState *string `json:"provisioningState,omitempty"` + // Error - detailes of provisioning error + Error *ErrorResponse `json:"error,omitempty"` + // CreationTime - Creation time of theresource, which only appears in the response. + CreationTime *date.Time `json:"creationTime,omitempty"` + // CreatedBy - createdBy property, which only appears in the response. + CreatedBy *string `json:"createdBy,omitempty"` + // LastModifiedTime - Last time resource was modified, which only appears in the response. + LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` + // LastModifiedBy - lastModifiedBy property, which only appears in the response. + LastModifiedBy *string `json:"lastModifiedBy,omitempty"` +} + +// SoftwareUpdateConfigurationRun software update configuration Run properties. +type SoftwareUpdateConfigurationRun struct { + autorest.Response `json:"-"` + // Name - Name of the software update configuration run. + Name *string `json:"name,omitempty"` + // ID - Resource Id of the software update configuration run + ID *string `json:"id,omitempty"` + // SoftwareUpdateConfigurationRunProperties - Software update configuration Run properties. + *SoftwareUpdateConfigurationRunProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for SoftwareUpdateConfigurationRun. +func (sucr SoftwareUpdateConfigurationRun) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sucr.Name != nil { + objectMap["name"] = sucr.Name + } + if sucr.ID != nil { + objectMap["id"] = sucr.ID + } + if sucr.SoftwareUpdateConfigurationRunProperties != nil { + objectMap["properties"] = sucr.SoftwareUpdateConfigurationRunProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SoftwareUpdateConfigurationRun struct. +func (sucr *SoftwareUpdateConfigurationRun) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + sucr.Name = &name + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + sucr.ID = &ID + } + case "properties": + if v != nil { + var softwareUpdateConfigurationRunProperties SoftwareUpdateConfigurationRunProperties + err = json.Unmarshal(*v, &softwareUpdateConfigurationRunProperties) + if err != nil { + return err + } + sucr.SoftwareUpdateConfigurationRunProperties = &softwareUpdateConfigurationRunProperties + } + } + } + + return nil +} + +// SoftwareUpdateConfigurationRunListResult result of listing all software update configuration runs +type SoftwareUpdateConfigurationRunListResult struct { + autorest.Response `json:"-"` + // Value - outer object returned when listing all software update configuration runs + Value *[]SoftwareUpdateConfigurationRun `json:"value,omitempty"` + // NextLink - link to next page of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// SoftwareUpdateConfigurationRunProperties software update configuration properties. +type SoftwareUpdateConfigurationRunProperties struct { + // SoftwareUpdateConfiguration - software update configuration triggered this run + SoftwareUpdateConfiguration *UpdateConfigurationNavigation `json:"softwareUpdateConfiguration,omitempty"` + // Status - Status of the software update configuration run. + Status *string `json:"status,omitempty"` + // ConfiguredDuration - configured duration for the software update configuration run. + ConfiguredDuration *string `json:"configuredDuration,omitempty"` + // OsType - Operating system target of the software update configuration triggered this run + OsType *string `json:"osType,omitempty"` + // StartTime - Etart time of the software update configuration run. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - End time of the software update configuration run. + EndTime *date.Time `json:"endTime,omitempty"` + // ComputerCount - Number of computers in the software update configuration run. + ComputerCount *int32 `json:"computerCount,omitempty"` + // FailedCount - Number of computers with failed status. + FailedCount *int32 `json:"failedCount,omitempty"` + // CreationTime - Creation time of theresource, which only appears in the response. + CreationTime *date.Time `json:"creationTime,omitempty"` + // CreatedBy - createdBy property, which only appears in the response. + CreatedBy *string `json:"createdBy,omitempty"` + // LastModifiedTime - Last time resource was modified, which only appears in the response. + LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` + // LastModifiedBy - lastModifiedBy property, which only appears in the response. + LastModifiedBy *string `json:"lastModifiedBy,omitempty"` +} + +// SourceControl definition of the source control. +type SourceControl struct { + autorest.Response `json:"-"` + // SourceControlProperties - Gets or sets the properties of the source control. + *SourceControlProperties `json:"properties,omitempty"` + // ID - Fully qualified resource Id for the resource + ID *string `json:"id,omitempty"` + // Name - The name of the resource + Name *string `json:"name,omitempty"` + // Type - The type of the resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for SourceControl. +func (sc SourceControl) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sc.SourceControlProperties != nil { + objectMap["properties"] = sc.SourceControlProperties + } + if sc.ID != nil { + objectMap["id"] = sc.ID + } + if sc.Name != nil { + objectMap["name"] = sc.Name + } + if sc.Type != nil { + objectMap["type"] = sc.Type + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SourceControl struct. +func (sc *SourceControl) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var sourceControlProperties SourceControlProperties + err = json.Unmarshal(*v, &sourceControlProperties) + if err != nil { + return err + } + sc.SourceControlProperties = &sourceControlProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + sc.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + sc.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + sc.Type = &typeVar + } + } + } + + return nil +} + +// SourceControlCreateOrUpdateParameters the parameters supplied to the create or update source control operation. +type SourceControlCreateOrUpdateParameters struct { + // SourceControlCreateOrUpdateProperties - Gets or sets the properties of the source control. + *SourceControlCreateOrUpdateProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for SourceControlCreateOrUpdateParameters. +func (sccoup SourceControlCreateOrUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sccoup.SourceControlCreateOrUpdateProperties != nil { + objectMap["properties"] = sccoup.SourceControlCreateOrUpdateProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SourceControlCreateOrUpdateParameters struct. +func (sccoup *SourceControlCreateOrUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var sourceControlCreateOrUpdateProperties SourceControlCreateOrUpdateProperties + err = json.Unmarshal(*v, &sourceControlCreateOrUpdateProperties) + if err != nil { + return err + } + sccoup.SourceControlCreateOrUpdateProperties = &sourceControlCreateOrUpdateProperties + } + } + } + + return nil +} + +// SourceControlCreateOrUpdateProperties the properties of the create source control operation. +type SourceControlCreateOrUpdateProperties struct { + // RepoURL - Gets or sets the repo url of the source control. + RepoURL *string `json:"repoUrl,omitempty"` + // Branch - Gets or sets the repo branch of the source control. Include branch as empty string for VsoTfvc. + Branch *string `json:"branch,omitempty"` + // FolderPath - Gets or sets the folder path of the source control. Path must be relative. + FolderPath *string `json:"folderPath,omitempty"` + // AutoSync - Gets or sets auto async of the source control. Default is false. + AutoSync *bool `json:"autoSync,omitempty"` + // PublishRunbook - Gets or sets the auto publish of the source control. Default is true. + PublishRunbook *bool `json:"publishRunbook,omitempty"` + // SourceType - The source type. Must be one of VsoGit, VsoTfvc, GitHub, case sensitive. Possible values include: 'VsoGit', 'VsoTfvc', 'GitHub' + SourceType SourceType `json:"sourceType,omitempty"` + // SecurityToken - Gets or sets the authorization token for the repo of the source control. + SecurityToken *string `json:"securityToken,omitempty"` + // Description - Gets or sets the user description of the source control. + Description *string `json:"description,omitempty"` +} + +// SourceControlListResult the response model for the list source controls operation. +type SourceControlListResult struct { + autorest.Response `json:"-"` + // Value - Gets or sets a list of souce controls. + Value *[]SourceControl `json:"value,omitempty"` + // NextLink - Gets or sets the next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// SourceControlListResultIterator provides access to a complete listing of SourceControl values. +type SourceControlListResultIterator struct { + i int + page SourceControlListResultPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *SourceControlListResultIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter SourceControlListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter SourceControlListResultIterator) Response() SourceControlListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter SourceControlListResultIterator) Value() SourceControl { + if !iter.page.NotDone() { + return SourceControl{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (sclr SourceControlListResult) IsEmpty() bool { + return sclr.Value == nil || len(*sclr.Value) == 0 +} + +// sourceControlListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (sclr SourceControlListResult) sourceControlListResultPreparer() (*http.Request, error) { + if sclr.NextLink == nil || len(to.String(sclr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(sclr.NextLink))) +} + +// SourceControlListResultPage contains a page of SourceControl values. +type SourceControlListResultPage struct { + fn func(SourceControlListResult) (SourceControlListResult, error) + sclr SourceControlListResult +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *SourceControlListResultPage) Next() error { + next, err := page.fn(page.sclr) + if err != nil { + return err + } + page.sclr = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page SourceControlListResultPage) NotDone() bool { + return !page.sclr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page SourceControlListResultPage) Response() SourceControlListResult { + return page.sclr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page SourceControlListResultPage) Values() []SourceControl { + if page.sclr.IsEmpty() { + return nil + } + return *page.sclr.Value +} + +// SourceControlProperties definition of the source control properties +type SourceControlProperties struct { + // RepoURL - Gets or sets the repo url of the source control. + RepoURL *string `json:"repoUrl,omitempty"` + // Branch - Gets or sets the repo branch of the source control. Include branch as empty string for VsoTfvc. + Branch *string `json:"branch,omitempty"` + // FolderPath - Gets or sets the folder path of the source control. + FolderPath *string `json:"folderPath,omitempty"` + // AutoSync - Gets or sets auto async of the source control. Default is false. + AutoSync *bool `json:"autoSync,omitempty"` + // PublishRunbook - Gets or sets the auto publish of the source control. Default is true. + PublishRunbook *bool `json:"publishRunbook,omitempty"` + // SourceType - The source type. Must be one of VsoGit, VsoTfvc, GitHub. Possible values include: 'VsoGit', 'VsoTfvc', 'GitHub' + SourceType SourceType `json:"sourceType,omitempty"` + // Description - Gets or sets the description. + Description *string `json:"description,omitempty"` + // CreationTime - Gets or sets the creation time. + CreationTime *date.Time `json:"creationTime,omitempty"` + // LastModifiedTime - Gets or sets the last modified time. + LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` +} + +// SourceControlSyncJob definition of the source control sync job. +type SourceControlSyncJob struct { + autorest.Response `json:"-"` + // Name - Resource name. + Name *string `json:"name,omitempty"` + // Type - Resource type. + Type *string `json:"type,omitempty"` + // ID - Resource id. + ID *string `json:"id,omitempty"` + // SourceControlSyncJobProperties - Gets the properties of the source control sync job. + *SourceControlSyncJobProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for SourceControlSyncJob. +func (scsj SourceControlSyncJob) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if scsj.Name != nil { + objectMap["name"] = scsj.Name + } + if scsj.Type != nil { + objectMap["type"] = scsj.Type + } + if scsj.ID != nil { + objectMap["id"] = scsj.ID + } + if scsj.SourceControlSyncJobProperties != nil { + objectMap["properties"] = scsj.SourceControlSyncJobProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SourceControlSyncJob struct. +func (scsj *SourceControlSyncJob) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + scsj.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + scsj.Type = &typeVar + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + scsj.ID = &ID + } + case "properties": + if v != nil { + var sourceControlSyncJobProperties SourceControlSyncJobProperties + err = json.Unmarshal(*v, &sourceControlSyncJobProperties) + if err != nil { + return err + } + scsj.SourceControlSyncJobProperties = &sourceControlSyncJobProperties + } + } + } + + return nil +} + +// SourceControlSyncJobByID definition of the source control sync job. +type SourceControlSyncJobByID struct { + autorest.Response `json:"-"` + // ID - Gets the id of the job. + ID *string `json:"id,omitempty"` + // SourceControlSyncJobByIDProperties - Gets the properties of the source control sync job. + *SourceControlSyncJobByIDProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for SourceControlSyncJobByID. +func (scsjbi SourceControlSyncJobByID) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if scsjbi.ID != nil { + objectMap["id"] = scsjbi.ID + } + if scsjbi.SourceControlSyncJobByIDProperties != nil { + objectMap["properties"] = scsjbi.SourceControlSyncJobByIDProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SourceControlSyncJobByID struct. +func (scsjbi *SourceControlSyncJobByID) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + scsjbi.ID = &ID + } + case "properties": + if v != nil { + var sourceControlSyncJobByIDProperties SourceControlSyncJobByIDProperties + err = json.Unmarshal(*v, &sourceControlSyncJobByIDProperties) + if err != nil { + return err + } + scsjbi.SourceControlSyncJobByIDProperties = &sourceControlSyncJobByIDProperties + } + } + } + + return nil +} + +// SourceControlSyncJobByIDProperties definition of source control sync job properties. +type SourceControlSyncJobByIDProperties struct { + // SyncJobID - Gets the source control sync job id. + SyncJobID *string `json:"syncJobId,omitempty"` + // CreationTime - Gets the creation time of the job. + CreationTime *date.Time `json:"creationTime,omitempty"` + // ProvisioningState - Gets the provisioning state of the job. Possible values include: 'Completed', 'Failed', 'Running' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // StartTime - Gets the start time of the job. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - Gets the end time of the job. + EndTime *date.Time `json:"endTime,omitempty"` + // StartType - Gets the type of start for the sync job. Possible values include: 'AutoSync', 'ManualSync' + StartType StartType `json:"startType,omitempty"` + // Exception - Gets the exceptions that occured while running the sync job. + Exception *string `json:"exception,omitempty"` +} + +// SourceControlSyncJobCreateParameters the parameters supplied to the create source control sync job operation. +type SourceControlSyncJobCreateParameters struct { + // SourceControlSyncJobCreateProperties - Sets the properties of the source control sync job. + *SourceControlSyncJobCreateProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for SourceControlSyncJobCreateParameters. +func (scsjcp SourceControlSyncJobCreateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if scsjcp.SourceControlSyncJobCreateProperties != nil { + objectMap["properties"] = scsjcp.SourceControlSyncJobCreateProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SourceControlSyncJobCreateParameters struct. +func (scsjcp *SourceControlSyncJobCreateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var sourceControlSyncJobCreateProperties SourceControlSyncJobCreateProperties + err = json.Unmarshal(*v, &sourceControlSyncJobCreateProperties) + if err != nil { + return err + } + scsjcp.SourceControlSyncJobCreateProperties = &sourceControlSyncJobCreateProperties + } + } + } + + return nil +} + +// SourceControlSyncJobCreateProperties definition of create source control sync job properties. +type SourceControlSyncJobCreateProperties struct { + // CommitID - Sets the commit id of the source control sync job. + CommitID *string `json:"commitId,omitempty"` +} + +// SourceControlSyncJobListResult the response model for the list source control sync jobs operation. +type SourceControlSyncJobListResult struct { + autorest.Response `json:"-"` + // Value - Gets a list of source control sync jobs. + Value *[]SourceControlSyncJob `json:"value,omitempty"` + // NextLink - Gets or sets the next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// SourceControlSyncJobListResultIterator provides access to a complete listing of SourceControlSyncJob values. +type SourceControlSyncJobListResultIterator struct { + i int + page SourceControlSyncJobListResultPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *SourceControlSyncJobListResultIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter SourceControlSyncJobListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter SourceControlSyncJobListResultIterator) Response() SourceControlSyncJobListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter SourceControlSyncJobListResultIterator) Value() SourceControlSyncJob { + if !iter.page.NotDone() { + return SourceControlSyncJob{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (scsjlr SourceControlSyncJobListResult) IsEmpty() bool { + return scsjlr.Value == nil || len(*scsjlr.Value) == 0 +} + +// sourceControlSyncJobListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (scsjlr SourceControlSyncJobListResult) sourceControlSyncJobListResultPreparer() (*http.Request, error) { + if scsjlr.NextLink == nil || len(to.String(scsjlr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(scsjlr.NextLink))) +} + +// SourceControlSyncJobListResultPage contains a page of SourceControlSyncJob values. +type SourceControlSyncJobListResultPage struct { + fn func(SourceControlSyncJobListResult) (SourceControlSyncJobListResult, error) + scsjlr SourceControlSyncJobListResult +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *SourceControlSyncJobListResultPage) Next() error { + next, err := page.fn(page.scsjlr) + if err != nil { + return err + } + page.scsjlr = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page SourceControlSyncJobListResultPage) NotDone() bool { + return !page.scsjlr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page SourceControlSyncJobListResultPage) Response() SourceControlSyncJobListResult { + return page.scsjlr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page SourceControlSyncJobListResultPage) Values() []SourceControlSyncJob { + if page.scsjlr.IsEmpty() { + return nil + } + return *page.scsjlr.Value +} + +// SourceControlSyncJobProperties definition of source control sync job properties. +type SourceControlSyncJobProperties struct { + // SyncJobID - Gets the source control sync job id. + SyncJobID *string `json:"syncJobId,omitempty"` + // CreationTime - Gets the creation time of the job. + CreationTime *date.Time `json:"creationTime,omitempty"` + // ProvisioningState - Gets the provisioning state of the job. Possible values include: 'Completed', 'Failed', 'Running' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // StartTime - Gets the start time of the job. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - Gets the end time of the job. + EndTime *date.Time `json:"endTime,omitempty"` + // StartType - Gets the type of start for the sync job. Possible values include: 'AutoSync', 'ManualSync' + StartType StartType `json:"startType,omitempty"` +} + +// SourceControlSyncJobStream definition of the source control sync job stream. +type SourceControlSyncJobStream struct { + // ID - Resource id. + ID *string `json:"id,omitempty"` + // SourceControlSyncJobStreamProperties - Gets the properties of the source control sync job stream. + *SourceControlSyncJobStreamProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for SourceControlSyncJobStream. +func (scsjs SourceControlSyncJobStream) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if scsjs.ID != nil { + objectMap["id"] = scsjs.ID + } + if scsjs.SourceControlSyncJobStreamProperties != nil { + objectMap["properties"] = scsjs.SourceControlSyncJobStreamProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SourceControlSyncJobStream struct. +func (scsjs *SourceControlSyncJobStream) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + scsjs.ID = &ID + } + case "properties": + if v != nil { + var sourceControlSyncJobStreamProperties SourceControlSyncJobStreamProperties + err = json.Unmarshal(*v, &sourceControlSyncJobStreamProperties) + if err != nil { + return err + } + scsjs.SourceControlSyncJobStreamProperties = &sourceControlSyncJobStreamProperties + } + } + } + + return nil +} + +// SourceControlSyncJobStreamByID definition of the source control sync job stream by id. +type SourceControlSyncJobStreamByID struct { + autorest.Response `json:"-"` + // ID - Resource id. + ID *string `json:"id,omitempty"` + // SourceControlSyncJobStreamByIDProperties - Gets the properties of the source control sync job stream. + *SourceControlSyncJobStreamByIDProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for SourceControlSyncJobStreamByID. +func (scsjsbi SourceControlSyncJobStreamByID) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if scsjsbi.ID != nil { + objectMap["id"] = scsjsbi.ID + } + if scsjsbi.SourceControlSyncJobStreamByIDProperties != nil { + objectMap["properties"] = scsjsbi.SourceControlSyncJobStreamByIDProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SourceControlSyncJobStreamByID struct. +func (scsjsbi *SourceControlSyncJobStreamByID) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + scsjsbi.ID = &ID + } + case "properties": + if v != nil { + var sourceControlSyncJobStreamByIDProperties SourceControlSyncJobStreamByIDProperties + err = json.Unmarshal(*v, &sourceControlSyncJobStreamByIDProperties) + if err != nil { + return err + } + scsjsbi.SourceControlSyncJobStreamByIDProperties = &sourceControlSyncJobStreamByIDProperties + } + } + } + + return nil +} + +// SourceControlSyncJobStreamByIDProperties definition of source control sync job stream by id properties. +type SourceControlSyncJobStreamByIDProperties struct { + // SyncJobStreamID - Gets the sync job stream id. + SyncJobStreamID *string `json:"syncJobStreamId,omitempty"` + // Summary - Gets the summary of the sync job stream. + Summary *string `json:"summary,omitempty"` + // Time - Gets the time of the sync job stream. + Time *date.Time `json:"time,omitempty"` + // StreamType - Gets the type of the sync job stream. Possible values include: 'StreamTypeError', 'StreamTypeOutput' + StreamType StreamType `json:"streamType,omitempty"` + // StreamText - Gets the text of the sync job stream. + StreamText *string `json:"streamText,omitempty"` + // Value - Gets the value of the sync job stream. + Value *string `json:"value,omitempty"` +} + +// SourceControlSyncJobStreamProperties definition of source control sync job stream properties. +type SourceControlSyncJobStreamProperties struct { + // SyncJobStreamID - Gets the sync job stream id. + SyncJobStreamID *string `json:"syncJobStreamId,omitempty"` + // Summary - Gets the summary of the sync job stream. + Summary *string `json:"summary,omitempty"` + // Time - Gets the time of the sync job stream. + Time *date.Time `json:"time,omitempty"` + // StreamType - Gets the type of the sync job stream. Possible values include: 'StreamTypeError', 'StreamTypeOutput' + StreamType StreamType `json:"streamType,omitempty"` +} + +// SourceControlSyncJobStreamsListBySyncJob the response model for the list source control sync job streams +// operation. +type SourceControlSyncJobStreamsListBySyncJob struct { + autorest.Response `json:"-"` + // Value - Gets a list of source control sync job streams. + Value *[]SourceControlSyncJobStream `json:"value,omitempty"` + // NextLink - Gets or sets the next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// SourceControlSyncJobStreamsListBySyncJobIterator provides access to a complete listing of +// SourceControlSyncJobStream values. +type SourceControlSyncJobStreamsListBySyncJobIterator struct { + i int + page SourceControlSyncJobStreamsListBySyncJobPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *SourceControlSyncJobStreamsListBySyncJobIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter SourceControlSyncJobStreamsListBySyncJobIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter SourceControlSyncJobStreamsListBySyncJobIterator) Response() SourceControlSyncJobStreamsListBySyncJob { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter SourceControlSyncJobStreamsListBySyncJobIterator) Value() SourceControlSyncJobStream { + if !iter.page.NotDone() { + return SourceControlSyncJobStream{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (scsjslbsj SourceControlSyncJobStreamsListBySyncJob) IsEmpty() bool { + return scsjslbsj.Value == nil || len(*scsjslbsj.Value) == 0 +} + +// sourceControlSyncJobStreamsListBySyncJobPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (scsjslbsj SourceControlSyncJobStreamsListBySyncJob) sourceControlSyncJobStreamsListBySyncJobPreparer() (*http.Request, error) { + if scsjslbsj.NextLink == nil || len(to.String(scsjslbsj.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(scsjslbsj.NextLink))) +} + +// SourceControlSyncJobStreamsListBySyncJobPage contains a page of SourceControlSyncJobStream values. +type SourceControlSyncJobStreamsListBySyncJobPage struct { + fn func(SourceControlSyncJobStreamsListBySyncJob) (SourceControlSyncJobStreamsListBySyncJob, error) + scsjslbsj SourceControlSyncJobStreamsListBySyncJob +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *SourceControlSyncJobStreamsListBySyncJobPage) Next() error { + next, err := page.fn(page.scsjslbsj) + if err != nil { + return err + } + page.scsjslbsj = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page SourceControlSyncJobStreamsListBySyncJobPage) NotDone() bool { + return !page.scsjslbsj.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page SourceControlSyncJobStreamsListBySyncJobPage) Response() SourceControlSyncJobStreamsListBySyncJob { + return page.scsjslbsj +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page SourceControlSyncJobStreamsListBySyncJobPage) Values() []SourceControlSyncJobStream { + if page.scsjslbsj.IsEmpty() { + return nil + } + return *page.scsjslbsj.Value +} + +// SourceControlUpdateParameters the parameters supplied to the update source control operation. +type SourceControlUpdateParameters struct { + // SourceControlUpdateProperties - Gets or sets the value of the source control. + *SourceControlUpdateProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for SourceControlUpdateParameters. +func (scup SourceControlUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if scup.SourceControlUpdateProperties != nil { + objectMap["properties"] = scup.SourceControlUpdateProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SourceControlUpdateParameters struct. +func (scup *SourceControlUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var sourceControlUpdateProperties SourceControlUpdateProperties + err = json.Unmarshal(*v, &sourceControlUpdateProperties) + if err != nil { + return err + } + scup.SourceControlUpdateProperties = &sourceControlUpdateProperties + } + } + } + + return nil +} + +// SourceControlUpdateProperties the properties of the update source control +type SourceControlUpdateProperties struct { + // Branch - Gets or sets the repo branch of the source control. + Branch *string `json:"branch,omitempty"` + // FolderPath - Gets or sets the folder path of the source control. Path must be relative. + FolderPath *string `json:"folderPath,omitempty"` + // AutoSync - Gets or sets auto async of the source control. Default is false. + AutoSync *bool `json:"autoSync,omitempty"` + // PublishRunbook - Gets or sets the auto publish of the source control. Default is true. + PublishRunbook *bool `json:"publishRunbook,omitempty"` + // SecurityToken - Gets or sets the authorization token for the repo of the source control. + SecurityToken *string `json:"securityToken,omitempty"` + // Description - Gets or sets the user description of the source control. + Description *string `json:"description,omitempty"` +} + +// Statistics definition of the statistic. +type Statistics struct { + // CounterProperty - Gets the property value of the statistic. + CounterProperty *string `json:"counterProperty,omitempty"` + // CounterValue - Gets the value of the statistic. + CounterValue *int64 `json:"counterValue,omitempty"` + // StartTime - Gets the startTime of the statistic. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - Gets the endTime of the statistic. + EndTime *date.Time `json:"endTime,omitempty"` + // ID - Gets the id. + ID *string `json:"id,omitempty"` +} + +// StatisticsListResult the response model for the list statistics operation. +type StatisticsListResult struct { + autorest.Response `json:"-"` + // Value - Gets or sets a list of statistics. + Value *[]Statistics `json:"value,omitempty"` +} + +// String ... +type String struct { + autorest.Response `json:"-"` + Value *string `json:"value,omitempty"` +} + +// TestJob definition of the test job. +type TestJob struct { + autorest.Response `json:"-"` + // CreationTime - Gets or sets the creation time of the test job. + CreationTime *date.Time `json:"creationTime,omitempty"` + // Status - Gets or sets the status of the test job. + Status *string `json:"status,omitempty"` + // StatusDetails - Gets or sets the status details of the test job. + StatusDetails *string `json:"statusDetails,omitempty"` + // RunOn - Gets or sets the runOn which specifies the group name where the job is to be executed. + RunOn *string `json:"runOn,omitempty"` + // StartTime - Gets or sets the start time of the test job. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - Gets or sets the end time of the test job. + EndTime *date.Time `json:"endTime,omitempty"` + // Exception - Gets or sets the exception of the test job. + Exception *string `json:"exception,omitempty"` + // LastModifiedTime - Gets or sets the last modified time of the test job. + LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` + // LastStatusModifiedTime - Gets or sets the last status modified time of the test job. + LastStatusModifiedTime *date.Time `json:"lastStatusModifiedTime,omitempty"` + // Parameters - Gets or sets the parameters of the test job. + Parameters map[string]*string `json:"parameters"` + // LogActivityTrace - The activity-level tracing options of the runbook. + LogActivityTrace *int32 `json:"logActivityTrace,omitempty"` +} + +// MarshalJSON is the custom marshaler for TestJob. +func (tj TestJob) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if tj.CreationTime != nil { + objectMap["creationTime"] = tj.CreationTime + } + if tj.Status != nil { + objectMap["status"] = tj.Status + } + if tj.StatusDetails != nil { + objectMap["statusDetails"] = tj.StatusDetails + } + if tj.RunOn != nil { + objectMap["runOn"] = tj.RunOn + } + if tj.StartTime != nil { + objectMap["startTime"] = tj.StartTime + } + if tj.EndTime != nil { + objectMap["endTime"] = tj.EndTime + } + if tj.Exception != nil { + objectMap["exception"] = tj.Exception + } + if tj.LastModifiedTime != nil { + objectMap["lastModifiedTime"] = tj.LastModifiedTime + } + if tj.LastStatusModifiedTime != nil { + objectMap["lastStatusModifiedTime"] = tj.LastStatusModifiedTime + } + if tj.Parameters != nil { + objectMap["parameters"] = tj.Parameters + } + if tj.LogActivityTrace != nil { + objectMap["logActivityTrace"] = tj.LogActivityTrace + } + return json.Marshal(objectMap) +} + +// TestJobCreateParameters the parameters supplied to the create test job operation. +type TestJobCreateParameters struct { + // Parameters - Gets or sets the parameters of the test job. + Parameters map[string]*string `json:"parameters"` + // RunOn - Gets or sets the runOn which specifies the group name where the job is to be executed. + RunOn *string `json:"runOn,omitempty"` +} + +// MarshalJSON is the custom marshaler for TestJobCreateParameters. +func (tjcp TestJobCreateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if tjcp.Parameters != nil { + objectMap["parameters"] = tjcp.Parameters + } + if tjcp.RunOn != nil { + objectMap["runOn"] = tjcp.RunOn + } + return json.Marshal(objectMap) +} + +// TrackedResource the resource model definition for a ARM tracked top level resource +type TrackedResource struct { + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // Location - The Azure Region where the resource lives + Location *string `json:"location,omitempty"` + // ID - Fully qualified resource Id for the resource + ID *string `json:"id,omitempty"` + // Name - The name of the resource + Name *string `json:"name,omitempty"` + // Type - The type of the resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for TrackedResource. +func (tr TrackedResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if tr.Tags != nil { + objectMap["tags"] = tr.Tags + } + if tr.Location != nil { + objectMap["location"] = tr.Location + } + if tr.ID != nil { + objectMap["id"] = tr.ID + } + if tr.Name != nil { + objectMap["name"] = tr.Name + } + if tr.Type != nil { + objectMap["type"] = tr.Type + } + return json.Marshal(objectMap) +} + +// TypeField information about a field of a type. +type TypeField struct { + // Name - Gets or sets the name of the field. + Name *string `json:"name,omitempty"` + // Type - Gets or sets the type of the field. + Type *string `json:"type,omitempty"` +} + +// TypeFieldListResult the response model for the list fields operation. +type TypeFieldListResult struct { + autorest.Response `json:"-"` + // Value - Gets or sets a list of fields. + Value *[]TypeField `json:"value,omitempty"` +} + +// UpdateConfiguration update specifc properties of the software update configuration. +type UpdateConfiguration struct { + // OperatingSystem - operating system of target machines. Possible values include: 'Windows', 'Linux' + OperatingSystem OperatingSystemType `json:"operatingSystem,omitempty"` + // Windows - Windows specific update configuration. + Windows *WindowsProperties `json:"windows,omitempty"` + // Linux - Linux specific update configuration. + Linux *LinuxProperties `json:"linux,omitempty"` + // Duration - Maximum time allowed for the software update configuration run. Duration needs to be specified using the format PT[n]H[n]M[n]S as per ISO8601 + Duration *string `json:"duration,omitempty"` + // AzureVirtualMachines - List of azure resource Ids for azure virtual machines targeted by the software update configuration. + AzureVirtualMachines *[]string `json:"azureVirtualMachines,omitempty"` + // NonAzureComputerNames - List of names of non-azure machines targeted by the software update configuration. + NonAzureComputerNames *[]string `json:"nonAzureComputerNames,omitempty"` +} + +// UpdateConfigurationMachineRunProperties software update configuration machine run properties. +type UpdateConfigurationMachineRunProperties struct { + // TargetComputer - name of the updated computer + TargetComputer *string `json:"targetComputer,omitempty"` + // TargetComputerType - type of the updated computer. + TargetComputerType *string `json:"targetComputerType,omitempty"` + // SoftwareUpdateConfiguration - software update configuration triggered this run + SoftwareUpdateConfiguration *UpdateConfigurationNavigation `json:"softwareUpdateConfiguration,omitempty"` + // Status - Status of the software update configuration machine run. + Status *string `json:"status,omitempty"` + // OsType - Operating system target of the software update configuration triggered this run + OsType *string `json:"osType,omitempty"` + // CorrelationID - correlation id of the software update configuration machine run + CorrelationID *uuid.UUID `json:"correlationId,omitempty"` + // SourceComputerID - source computer id of the software update configuration machine run + SourceComputerID *uuid.UUID `json:"sourceComputerId,omitempty"` + // StartTime - Start time of the software update configuration machine run. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - End time of the software update configuration machine run. + EndTime *date.Time `json:"endTime,omitempty"` + // ConfiguredDuration - configured duration for the software update configuration run. + ConfiguredDuration *string `json:"configuredDuration,omitempty"` + // Job - Job associated with the software update configuration machine run + Job *JobNavigation `json:"job,omitempty"` + // CreationTime - Creation time of theresource, which only appears in the response. + CreationTime *date.Time `json:"creationTime,omitempty"` + // CreatedBy - createdBy property, which only appears in the response. + CreatedBy *string `json:"createdBy,omitempty"` + // LastModifiedTime - Last time resource was modified, which only appears in the response. + LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` + // LastModifiedBy - lastModifiedBy property, which only appears in the response. + LastModifiedBy *string `json:"lastModifiedBy,omitempty"` +} + +// UpdateConfigurationNavigation software update configuration Run Navigation model. +type UpdateConfigurationNavigation struct { + // Name - Name of the software update configuration triggered the software update configuration run + Name *string `json:"name,omitempty"` +} + +// Usage definition of Usage. +type Usage struct { + // ID - Gets or sets the id of the resource. + ID *string `json:"id,omitempty"` + // Name - Gets or sets the usage counter name. + Name *UsageCounterName `json:"name,omitempty"` + // Unit - Gets or sets the usage unit name. + Unit *string `json:"unit,omitempty"` + // CurrentValue - Gets or sets the current usage value. + CurrentValue *float64 `json:"currentValue,omitempty"` + // Limit - Gets or sets max limit. -1 for unlimited + Limit *int64 `json:"limit,omitempty"` + // ThrottleStatus - Gets or sets the throttle status. + ThrottleStatus *string `json:"throttleStatus,omitempty"` +} + +// UsageCounterName definition of usage counter name. +type UsageCounterName struct { + // Value - Gets or sets the usage counter name. + Value *string `json:"value,omitempty"` + // LocalizedValue - Gets or sets the localized usage counter name. + LocalizedValue *string `json:"localizedValue,omitempty"` +} + +// UsageListResult the response model for the get usage operation. +type UsageListResult struct { + autorest.Response `json:"-"` + // Value - Gets or sets usage. + Value *[]Usage `json:"value,omitempty"` +} + +// Variable definition of the varible. +type Variable struct { + autorest.Response `json:"-"` + // VariableProperties - Gets or sets the properties of the variable. + *VariableProperties `json:"properties,omitempty"` + // ID - Fully qualified resource Id for the resource + ID *string `json:"id,omitempty"` + // Name - The name of the resource + Name *string `json:"name,omitempty"` + // Type - The type of the resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Variable. +func (vVar Variable) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vVar.VariableProperties != nil { + objectMap["properties"] = vVar.VariableProperties + } + if vVar.ID != nil { + objectMap["id"] = vVar.ID + } + if vVar.Name != nil { + objectMap["name"] = vVar.Name + } + if vVar.Type != nil { + objectMap["type"] = vVar.Type + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Variable struct. +func (vVar *Variable) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var variableProperties VariableProperties + err = json.Unmarshal(*v, &variableProperties) + if err != nil { + return err + } + vVar.VariableProperties = &variableProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + vVar.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + vVar.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + vVar.Type = &typeVar + } + } + } + + return nil +} + +// VariableCreateOrUpdateParameters the parameters supplied to the create or update variable operation. +type VariableCreateOrUpdateParameters struct { + // Name - Gets or sets the name of the variable. + Name *string `json:"name,omitempty"` + // VariableCreateOrUpdateProperties - Gets or sets the properties of the variable. + *VariableCreateOrUpdateProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for VariableCreateOrUpdateParameters. +func (vcoup VariableCreateOrUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vcoup.Name != nil { + objectMap["name"] = vcoup.Name + } + if vcoup.VariableCreateOrUpdateProperties != nil { + objectMap["properties"] = vcoup.VariableCreateOrUpdateProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for VariableCreateOrUpdateParameters struct. +func (vcoup *VariableCreateOrUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + vcoup.Name = &name + } + case "properties": + if v != nil { + var variableCreateOrUpdateProperties VariableCreateOrUpdateProperties + err = json.Unmarshal(*v, &variableCreateOrUpdateProperties) + if err != nil { + return err + } + vcoup.VariableCreateOrUpdateProperties = &variableCreateOrUpdateProperties + } + } + } + + return nil +} + +// VariableCreateOrUpdateProperties the properties of the create variable operation. +type VariableCreateOrUpdateProperties struct { + // Value - Gets or sets the value of the variable. + Value *string `json:"value,omitempty"` + // Description - Gets or sets the description of the variable. + Description *string `json:"description,omitempty"` + // IsEncrypted - Gets or sets the encrypted flag of the variable. + IsEncrypted *bool `json:"isEncrypted,omitempty"` +} + +// VariableListResult the response model for the list variables operation. +type VariableListResult struct { + autorest.Response `json:"-"` + // Value - Gets or sets a list of variables. + Value *[]Variable `json:"value,omitempty"` + // NextLink - Gets or sets the next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// VariableListResultIterator provides access to a complete listing of Variable values. +type VariableListResultIterator struct { + i int + page VariableListResultPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *VariableListResultIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter VariableListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter VariableListResultIterator) Response() VariableListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter VariableListResultIterator) Value() Variable { + if !iter.page.NotDone() { + return Variable{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (vlr VariableListResult) IsEmpty() bool { + return vlr.Value == nil || len(*vlr.Value) == 0 +} + +// variableListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (vlr VariableListResult) variableListResultPreparer() (*http.Request, error) { + if vlr.NextLink == nil || len(to.String(vlr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(vlr.NextLink))) +} + +// VariableListResultPage contains a page of Variable values. +type VariableListResultPage struct { + fn func(VariableListResult) (VariableListResult, error) + vlr VariableListResult +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *VariableListResultPage) Next() error { + next, err := page.fn(page.vlr) + if err != nil { + return err + } + page.vlr = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page VariableListResultPage) NotDone() bool { + return !page.vlr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page VariableListResultPage) Response() VariableListResult { + return page.vlr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page VariableListResultPage) Values() []Variable { + if page.vlr.IsEmpty() { + return nil + } + return *page.vlr.Value +} + +// VariableProperties definition of the varible properties +type VariableProperties struct { + // Value - Gets or sets the value of the variable. + Value *string `json:"value,omitempty"` + // IsEncrypted - Gets or sets the encrypted flag of the variable. + IsEncrypted *bool `json:"isEncrypted,omitempty"` + // CreationTime - Gets or sets the creation time. + CreationTime *date.Time `json:"creationTime,omitempty"` + // LastModifiedTime - Gets or sets the last modified time. + LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` + // Description - Gets or sets the description. + Description *string `json:"description,omitempty"` +} + +// VariableUpdateParameters the parameters supplied to the update variable operation. +type VariableUpdateParameters struct { + // Name - Gets or sets the name of the variable. + Name *string `json:"name,omitempty"` + // VariableUpdateProperties - Gets or sets the value of the variable. + *VariableUpdateProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for VariableUpdateParameters. +func (vup VariableUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vup.Name != nil { + objectMap["name"] = vup.Name + } + if vup.VariableUpdateProperties != nil { + objectMap["properties"] = vup.VariableUpdateProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for VariableUpdateParameters struct. +func (vup *VariableUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + vup.Name = &name + } + case "properties": + if v != nil { + var variableUpdateProperties VariableUpdateProperties + err = json.Unmarshal(*v, &variableUpdateProperties) + if err != nil { + return err + } + vup.VariableUpdateProperties = &variableUpdateProperties + } + } + } + + return nil +} + +// VariableUpdateProperties the properties of the update variable +type VariableUpdateProperties struct { + // Value - Gets or sets the value of the variable. + Value *string `json:"value,omitempty"` + // Description - Gets or sets the description of the variable. + Description *string `json:"description,omitempty"` +} + +// Watcher definition of the watcher type. +type Watcher struct { + autorest.Response `json:"-"` + // WatcherProperties - Gets or sets the watcher properties. + *WatcherProperties `json:"properties,omitempty"` + // Etag - Gets or sets the etag of the resource. + Etag *string `json:"etag,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // Location - The Azure Region where the resource lives + Location *string `json:"location,omitempty"` + // ID - Fully qualified resource Id for the resource + ID *string `json:"id,omitempty"` + // Name - The name of the resource + Name *string `json:"name,omitempty"` + // Type - The type of the resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Watcher. +func (w Watcher) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if w.WatcherProperties != nil { + objectMap["properties"] = w.WatcherProperties + } + if w.Etag != nil { + objectMap["etag"] = w.Etag + } + if w.Tags != nil { + objectMap["tags"] = w.Tags + } + if w.Location != nil { + objectMap["location"] = w.Location + } + if w.ID != nil { + objectMap["id"] = w.ID + } + if w.Name != nil { + objectMap["name"] = w.Name + } + if w.Type != nil { + objectMap["type"] = w.Type + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Watcher struct. +func (w *Watcher) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var watcherProperties WatcherProperties + err = json.Unmarshal(*v, &watcherProperties) + if err != nil { + return err + } + w.WatcherProperties = &watcherProperties + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + w.Etag = &etag + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + w.Tags = tags + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + w.Location = &location + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + w.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + w.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + w.Type = &typeVar + } + } + } + + return nil +} + +// WatcherListResult the response model for the list watcher operation. +type WatcherListResult struct { + autorest.Response `json:"-"` + // Value - Gets or sets a list of watchers. + Value *[]Watcher `json:"value,omitempty"` + // NextLink - Gets or sets the next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// WatcherListResultIterator provides access to a complete listing of Watcher values. +type WatcherListResultIterator struct { + i int + page WatcherListResultPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *WatcherListResultIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter WatcherListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter WatcherListResultIterator) Response() WatcherListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter WatcherListResultIterator) Value() Watcher { + if !iter.page.NotDone() { + return Watcher{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (wlr WatcherListResult) IsEmpty() bool { + return wlr.Value == nil || len(*wlr.Value) == 0 +} + +// watcherListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (wlr WatcherListResult) watcherListResultPreparer() (*http.Request, error) { + if wlr.NextLink == nil || len(to.String(wlr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(wlr.NextLink))) +} + +// WatcherListResultPage contains a page of Watcher values. +type WatcherListResultPage struct { + fn func(WatcherListResult) (WatcherListResult, error) + wlr WatcherListResult +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *WatcherListResultPage) Next() error { + next, err := page.fn(page.wlr) + if err != nil { + return err + } + page.wlr = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page WatcherListResultPage) NotDone() bool { + return !page.wlr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page WatcherListResultPage) Response() WatcherListResult { + return page.wlr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page WatcherListResultPage) Values() []Watcher { + if page.wlr.IsEmpty() { + return nil + } + return *page.wlr.Value +} + +// WatcherProperties definition of the watcher properties +type WatcherProperties struct { + // ExecutionFrequencyInSeconds - Gets or sets the frequency at which the watcher is invoked. + ExecutionFrequencyInSeconds *int64 `json:"executionFrequencyInSeconds,omitempty"` + // ScriptName - Gets or sets the name of the script the watcher is attached to, i.e. the name of an existing runbook. + ScriptName *string `json:"scriptName,omitempty"` + // ScriptParameters - Gets or sets the parameters of the script. + ScriptParameters map[string]*string `json:"scriptParameters"` + // ScriptRunOn - Gets or sets the name of the hybrid worker group the watcher will run on. + ScriptRunOn *string `json:"scriptRunOn,omitempty"` + // Status - Gets the current status of the watcher. + Status *string `json:"status,omitempty"` + // CreationTime - Gets or sets the creation time. + CreationTime *date.Time `json:"creationTime,omitempty"` + // LastModifiedTime - Gets or sets the last modified time. + LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` + // LastModifiedBy - Details of the user who last modified the watcher. + LastModifiedBy *string `json:"lastModifiedBy,omitempty"` + // Description - Gets or sets the description. + Description *string `json:"description,omitempty"` +} + +// MarshalJSON is the custom marshaler for WatcherProperties. +func (wp WatcherProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if wp.ExecutionFrequencyInSeconds != nil { + objectMap["executionFrequencyInSeconds"] = wp.ExecutionFrequencyInSeconds + } + if wp.ScriptName != nil { + objectMap["scriptName"] = wp.ScriptName + } + if wp.ScriptParameters != nil { + objectMap["scriptParameters"] = wp.ScriptParameters + } + if wp.ScriptRunOn != nil { + objectMap["scriptRunOn"] = wp.ScriptRunOn + } + if wp.Status != nil { + objectMap["status"] = wp.Status + } + if wp.CreationTime != nil { + objectMap["creationTime"] = wp.CreationTime + } + if wp.LastModifiedTime != nil { + objectMap["lastModifiedTime"] = wp.LastModifiedTime + } + if wp.LastModifiedBy != nil { + objectMap["lastModifiedBy"] = wp.LastModifiedBy + } + if wp.Description != nil { + objectMap["description"] = wp.Description + } + return json.Marshal(objectMap) +} + +// WatcherUpdateParameters ... +type WatcherUpdateParameters struct { + // WatcherUpdateProperties - Gets or sets the watcher update properties. + *WatcherUpdateProperties `json:"properties,omitempty"` + // Name - Gets or sets the name of the resource. + Name *string `json:"name,omitempty"` +} + +// MarshalJSON is the custom marshaler for WatcherUpdateParameters. +func (wup WatcherUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if wup.WatcherUpdateProperties != nil { + objectMap["properties"] = wup.WatcherUpdateProperties + } + if wup.Name != nil { + objectMap["name"] = wup.Name + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for WatcherUpdateParameters struct. +func (wup *WatcherUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var watcherUpdateProperties WatcherUpdateProperties + err = json.Unmarshal(*v, &watcherUpdateProperties) + if err != nil { + return err + } + wup.WatcherUpdateProperties = &watcherUpdateProperties + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + wup.Name = &name + } + } + } + + return nil +} + +// WatcherUpdateProperties the properties of the update watcher operation. +type WatcherUpdateProperties struct { + // ExecutionFrequencyInSeconds - Gets or sets the frequency at which the watcher is invoked. + ExecutionFrequencyInSeconds *int64 `json:"executionFrequencyInSeconds,omitempty"` +} + +// Webhook definition of the webhook type. +type Webhook struct { + autorest.Response `json:"-"` + // WebhookProperties - Gets or sets the webhook properties. + *WebhookProperties `json:"properties,omitempty"` + // ID - Fully qualified resource Id for the resource + ID *string `json:"id,omitempty"` + // Name - The name of the resource + Name *string `json:"name,omitempty"` + // Type - The type of the resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Webhook. +func (w Webhook) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if w.WebhookProperties != nil { + objectMap["properties"] = w.WebhookProperties + } + if w.ID != nil { + objectMap["id"] = w.ID + } + if w.Name != nil { + objectMap["name"] = w.Name + } + if w.Type != nil { + objectMap["type"] = w.Type + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Webhook struct. +func (w *Webhook) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var webhookProperties WebhookProperties + err = json.Unmarshal(*v, &webhookProperties) + if err != nil { + return err + } + w.WebhookProperties = &webhookProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + w.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + w.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + w.Type = &typeVar + } + } + } + + return nil +} + +// WebhookCreateOrUpdateParameters the parameters supplied to the create or update webhook operation. +type WebhookCreateOrUpdateParameters struct { + // Name - Gets or sets the name of the webhook. + Name *string `json:"name,omitempty"` + // WebhookCreateOrUpdateProperties - Gets or sets the properties of the webhook. + *WebhookCreateOrUpdateProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for WebhookCreateOrUpdateParameters. +func (wcoup WebhookCreateOrUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if wcoup.Name != nil { + objectMap["name"] = wcoup.Name + } + if wcoup.WebhookCreateOrUpdateProperties != nil { + objectMap["properties"] = wcoup.WebhookCreateOrUpdateProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for WebhookCreateOrUpdateParameters struct. +func (wcoup *WebhookCreateOrUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + wcoup.Name = &name + } + case "properties": + if v != nil { + var webhookCreateOrUpdateProperties WebhookCreateOrUpdateProperties + err = json.Unmarshal(*v, &webhookCreateOrUpdateProperties) + if err != nil { + return err + } + wcoup.WebhookCreateOrUpdateProperties = &webhookCreateOrUpdateProperties + } + } + } + + return nil +} + +// WebhookCreateOrUpdateProperties the properties of the create webhook operation. +type WebhookCreateOrUpdateProperties struct { + // IsEnabled - Gets or sets the value of the enabled flag of webhook. + IsEnabled *bool `json:"isEnabled,omitempty"` + // URI - Gets or sets the uri. + URI *string `json:"uri,omitempty"` + // ExpiryTime - Gets or sets the expiry time. + ExpiryTime *date.Time `json:"expiryTime,omitempty"` + // Parameters - Gets or sets the parameters of the job. + Parameters map[string]*string `json:"parameters"` + // Runbook - Gets or sets the runbook. + Runbook *RunbookAssociationProperty `json:"runbook,omitempty"` + // RunOn - Gets or sets the name of the hybrid worker group the webhook job will run on. + RunOn *string `json:"runOn,omitempty"` +} + +// MarshalJSON is the custom marshaler for WebhookCreateOrUpdateProperties. +func (wcoup WebhookCreateOrUpdateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if wcoup.IsEnabled != nil { + objectMap["isEnabled"] = wcoup.IsEnabled + } + if wcoup.URI != nil { + objectMap["uri"] = wcoup.URI + } + if wcoup.ExpiryTime != nil { + objectMap["expiryTime"] = wcoup.ExpiryTime + } + if wcoup.Parameters != nil { + objectMap["parameters"] = wcoup.Parameters + } + if wcoup.Runbook != nil { + objectMap["runbook"] = wcoup.Runbook + } + if wcoup.RunOn != nil { + objectMap["runOn"] = wcoup.RunOn + } + return json.Marshal(objectMap) +} + +// WebhookListResult the response model for the list webhook operation. +type WebhookListResult struct { + autorest.Response `json:"-"` + // Value - Gets or sets a list of webhooks. + Value *[]Webhook `json:"value,omitempty"` + // NextLink - Gets or sets the next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// WebhookListResultIterator provides access to a complete listing of Webhook values. +type WebhookListResultIterator struct { + i int + page WebhookListResultPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *WebhookListResultIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter WebhookListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter WebhookListResultIterator) Response() WebhookListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter WebhookListResultIterator) Value() Webhook { + if !iter.page.NotDone() { + return Webhook{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (wlr WebhookListResult) IsEmpty() bool { + return wlr.Value == nil || len(*wlr.Value) == 0 +} + +// webhookListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (wlr WebhookListResult) webhookListResultPreparer() (*http.Request, error) { + if wlr.NextLink == nil || len(to.String(wlr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(wlr.NextLink))) +} + +// WebhookListResultPage contains a page of Webhook values. +type WebhookListResultPage struct { + fn func(WebhookListResult) (WebhookListResult, error) + wlr WebhookListResult +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *WebhookListResultPage) Next() error { + next, err := page.fn(page.wlr) + if err != nil { + return err + } + page.wlr = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page WebhookListResultPage) NotDone() bool { + return !page.wlr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page WebhookListResultPage) Response() WebhookListResult { + return page.wlr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page WebhookListResultPage) Values() []Webhook { + if page.wlr.IsEmpty() { + return nil + } + return *page.wlr.Value +} + +// WebhookProperties definition of the webhook properties +type WebhookProperties struct { + // IsEnabled - Gets or sets the value of the enabled flag of the webhook. + IsEnabled *bool `json:"isEnabled,omitempty"` + // URI - Gets or sets the webhook uri. + URI *string `json:"uri,omitempty"` + // ExpiryTime - Gets or sets the expiry time. + ExpiryTime *date.Time `json:"expiryTime,omitempty"` + // LastInvokedTime - Gets or sets the last invoked time. + LastInvokedTime *date.Time `json:"lastInvokedTime,omitempty"` + // Parameters - Gets or sets the parameters of the job that is created when the webhook calls the runbook it is associated with. + Parameters map[string]*string `json:"parameters"` + // Runbook - Gets or sets the runbook the webhook is associated with. + Runbook *RunbookAssociationProperty `json:"runbook,omitempty"` + // RunOn - Gets or sets the name of the hybrid worker group the webhook job will run on. + RunOn *string `json:"runOn,omitempty"` + // CreationTime - Gets or sets the creation time. + CreationTime *date.Time `json:"creationTime,omitempty"` + // LastModifiedTime - Gets or sets the last modified time. + LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` + // LastModifiedBy - Details of the user who last modified the Webhook + LastModifiedBy *string `json:"lastModifiedBy,omitempty"` + // Description - Gets or sets the description. + Description *string `json:"description,omitempty"` +} + +// MarshalJSON is the custom marshaler for WebhookProperties. +func (wp WebhookProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if wp.IsEnabled != nil { + objectMap["isEnabled"] = wp.IsEnabled + } + if wp.URI != nil { + objectMap["uri"] = wp.URI + } + if wp.ExpiryTime != nil { + objectMap["expiryTime"] = wp.ExpiryTime + } + if wp.LastInvokedTime != nil { + objectMap["lastInvokedTime"] = wp.LastInvokedTime + } + if wp.Parameters != nil { + objectMap["parameters"] = wp.Parameters + } + if wp.Runbook != nil { + objectMap["runbook"] = wp.Runbook + } + if wp.RunOn != nil { + objectMap["runOn"] = wp.RunOn + } + if wp.CreationTime != nil { + objectMap["creationTime"] = wp.CreationTime + } + if wp.LastModifiedTime != nil { + objectMap["lastModifiedTime"] = wp.LastModifiedTime + } + if wp.LastModifiedBy != nil { + objectMap["lastModifiedBy"] = wp.LastModifiedBy + } + if wp.Description != nil { + objectMap["description"] = wp.Description + } + return json.Marshal(objectMap) +} + +// WebhookUpdateParameters the parameters supplied to the update webhook operation. +type WebhookUpdateParameters struct { + // Name - Gets or sets the name of the webhook. + Name *string `json:"name,omitempty"` + // WebhookUpdateProperties - Gets or sets the value of the webhook. + *WebhookUpdateProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for WebhookUpdateParameters. +func (wup WebhookUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if wup.Name != nil { + objectMap["name"] = wup.Name + } + if wup.WebhookUpdateProperties != nil { + objectMap["properties"] = wup.WebhookUpdateProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for WebhookUpdateParameters struct. +func (wup *WebhookUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + wup.Name = &name + } + case "properties": + if v != nil { + var webhookUpdateProperties WebhookUpdateProperties + err = json.Unmarshal(*v, &webhookUpdateProperties) + if err != nil { + return err + } + wup.WebhookUpdateProperties = &webhookUpdateProperties + } + } + } + + return nil +} + +// WebhookUpdateProperties the properties of the update webhook. +type WebhookUpdateProperties struct { + // IsEnabled - Gets or sets the value of the enabled flag of webhook. + IsEnabled *bool `json:"isEnabled,omitempty"` + // RunOn - Gets or sets the name of the hybrid worker group the webhook job will run on. + RunOn *string `json:"runOn,omitempty"` + // Parameters - Gets or sets the parameters of the job. + Parameters map[string]*string `json:"parameters"` + // Description - Gets or sets the description of the webhook. + Description *string `json:"description,omitempty"` +} + +// MarshalJSON is the custom marshaler for WebhookUpdateProperties. +func (wup WebhookUpdateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if wup.IsEnabled != nil { + objectMap["isEnabled"] = wup.IsEnabled + } + if wup.RunOn != nil { + objectMap["runOn"] = wup.RunOn + } + if wup.Parameters != nil { + objectMap["parameters"] = wup.Parameters + } + if wup.Description != nil { + objectMap["description"] = wup.Description + } + return json.Marshal(objectMap) +} + +// WindowsProperties windows specific update configuration. +type WindowsProperties struct { + // IncludedUpdateClassifications - Update classification included in the software update configuration. A comma separated string with required values. Possible values include: 'WindowsUpdateClassesUnclassified', 'WindowsUpdateClassesCritical', 'WindowsUpdateClassesSecurity', 'WindowsUpdateClassesUpdateRollup', 'WindowsUpdateClassesFeaturePack', 'WindowsUpdateClassesServicePack', 'WindowsUpdateClassesDefinition', 'WindowsUpdateClassesTools', 'WindowsUpdateClassesUpdates' + IncludedUpdateClassifications WindowsUpdateClasses `json:"includedUpdateClassifications,omitempty"` + // ExcludedKbNumbers - KB numbers excluded from the software update configuration. + ExcludedKbNumbers *[]string `json:"excludedKbNumbers,omitempty"` + // IncludedKbNumbers - KB numbers included from the software update configuration. + IncludedKbNumbers *[]string `json:"includedKbNumbers,omitempty"` + // RebootSetting - Reboot setting for the software update configuration. + RebootSetting *string `json:"rebootSetting,omitempty"` +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/module.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/module.go new file mode 100644 index 000000000..5c7a761c1 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/module.go @@ -0,0 +1,466 @@ +package automation + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// ModuleClient is the automation Client +type ModuleClient struct { + BaseClient +} + +// NewModuleClient creates an instance of the ModuleClient client. +func NewModuleClient(subscriptionID string, countType1 CountType) ModuleClient { + return NewModuleClientWithBaseURI(DefaultBaseURI, subscriptionID, countType1) +} + +// NewModuleClientWithBaseURI creates an instance of the ModuleClient client. +func NewModuleClientWithBaseURI(baseURI string, subscriptionID string, countType1 CountType) ModuleClient { + return ModuleClient{NewWithBaseURI(baseURI, subscriptionID, countType1)} +} + +// CreateOrUpdate create or Update the module identified by module name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// moduleName - the name of module. +// parameters - the create or update parameters for module. +func (client ModuleClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, automationAccountName string, moduleName string, parameters ModuleCreateOrUpdateParameters) (result Module, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.ModuleCreateOrUpdateProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.ModuleCreateOrUpdateProperties.ContentLink", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.ModuleCreateOrUpdateProperties.ContentLink.ContentHash", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ModuleCreateOrUpdateProperties.ContentLink.ContentHash.Algorithm", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.ModuleCreateOrUpdateProperties.ContentLink.ContentHash.Value", Name: validation.Null, Rule: true, Chain: nil}, + }}, + }}, + }}}}}); err != nil { + return result, validation.NewError("automation.ModuleClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, automationAccountName, moduleName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ModuleClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.ModuleClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ModuleClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client ModuleClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, moduleName string, parameters ModuleCreateOrUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "moduleName": autorest.Encode("path", moduleName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/modules/{moduleName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client ModuleClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client ModuleClient) CreateOrUpdateResponder(resp *http.Response) (result Module, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete delete the module by name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// moduleName - the module name. +func (client ModuleClient) Delete(ctx context.Context, resourceGroupName string, automationAccountName string, moduleName string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.ModuleClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, automationAccountName, moduleName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ModuleClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "automation.ModuleClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ModuleClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ModuleClient) DeletePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, moduleName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "moduleName": autorest.Encode("path", moduleName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/modules/{moduleName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ModuleClient) DeleteSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ModuleClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get retrieve the module identified by module name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// moduleName - the module name. +func (client ModuleClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, moduleName string) (result Module, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.ModuleClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, moduleName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ModuleClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.ModuleClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ModuleClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client ModuleClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, moduleName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "moduleName": autorest.Encode("path", moduleName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/modules/{moduleName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ModuleClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ModuleClient) GetResponder(resp *http.Response) (result Module, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByAutomationAccount retrieve a list of modules. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +func (client ModuleClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string) (result ModuleListResultPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.ModuleClient", "ListByAutomationAccount", err.Error()) + } + + result.fn = client.listByAutomationAccountNextResults + req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ModuleClient", "ListByAutomationAccount", nil, "Failure preparing request") + return + } + + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.mlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.ModuleClient", "ListByAutomationAccount", resp, "Failure sending request") + return + } + + result.mlr, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ModuleClient", "ListByAutomationAccount", resp, "Failure responding to request") + } + + return +} + +// ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. +func (client ModuleClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/modules", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByAutomationAccountSender sends the ListByAutomationAccount request. The method will close the +// http.Response Body if it receives an error. +func (client ModuleClient) ListByAutomationAccountSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByAutomationAccountResponder handles the response to the ListByAutomationAccount request. The method always +// closes the http.Response Body. +func (client ModuleClient) ListByAutomationAccountResponder(resp *http.Response) (result ModuleListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByAutomationAccountNextResults retrieves the next set of results, if any. +func (client ModuleClient) listByAutomationAccountNextResults(lastResults ModuleListResult) (result ModuleListResult, err error) { + req, err := lastResults.moduleListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "automation.ModuleClient", "listByAutomationAccountNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "automation.ModuleClient", "listByAutomationAccountNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ModuleClient", "listByAutomationAccountNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByAutomationAccountComplete enumerates all values, automatically crossing page boundaries as required. +func (client ModuleClient) ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string) (result ModuleListResultIterator, err error) { + result.page, err = client.ListByAutomationAccount(ctx, resourceGroupName, automationAccountName) + return +} + +// Update update the module identified by module name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// moduleName - the name of module. +// parameters - the update parameters for module. +func (client ModuleClient) Update(ctx context.Context, resourceGroupName string, automationAccountName string, moduleName string, parameters ModuleUpdateParameters) (result Module, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.ModuleClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, automationAccountName, moduleName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ModuleClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.ModuleClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ModuleClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client ModuleClient) UpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, moduleName string, parameters ModuleUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "moduleName": autorest.Encode("path", moduleName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/modules/{moduleName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client ModuleClient) UpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client ModuleClient) UpdateResponder(resp *http.Response) (result Module, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/nodecountinformation.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/nodecountinformation.go new file mode 100644 index 000000000..4227722e3 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/nodecountinformation.go @@ -0,0 +1,117 @@ +package automation + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// NodeCountInformationClient is the automation Client +type NodeCountInformationClient struct { + BaseClient +} + +// NewNodeCountInformationClient creates an instance of the NodeCountInformationClient client. +func NewNodeCountInformationClient(subscriptionID string, countType1 CountType) NodeCountInformationClient { + return NewNodeCountInformationClientWithBaseURI(DefaultBaseURI, subscriptionID, countType1) +} + +// NewNodeCountInformationClientWithBaseURI creates an instance of the NodeCountInformationClient client. +func NewNodeCountInformationClientWithBaseURI(baseURI string, subscriptionID string, countType1 CountType) NodeCountInformationClient { + return NodeCountInformationClient{NewWithBaseURI(baseURI, subscriptionID, countType1)} +} + +// Get retrieve counts for Dsc Nodes. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +func (client NodeCountInformationClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string) (result NodeCounts, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.NodeCountInformationClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.NodeCountInformationClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.NodeCountInformationClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.NodeCountInformationClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client NodeCountInformationClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "countType": autorest.Encode("path", client.CountType1), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-01-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodecounts/{countType}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client NodeCountInformationClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client NodeCountInformationClient) GetResponder(resp *http.Response) (result NodeCounts, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/nodereports.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/nodereports.go new file mode 100644 index 000000000..a6c3428b4 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/nodereports.go @@ -0,0 +1,308 @@ +package automation + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// NodeReportsClient is the automation Client +type NodeReportsClient struct { + BaseClient +} + +// NewNodeReportsClient creates an instance of the NodeReportsClient client. +func NewNodeReportsClient(subscriptionID string, countType1 CountType) NodeReportsClient { + return NewNodeReportsClientWithBaseURI(DefaultBaseURI, subscriptionID, countType1) +} + +// NewNodeReportsClientWithBaseURI creates an instance of the NodeReportsClient client. +func NewNodeReportsClientWithBaseURI(baseURI string, subscriptionID string, countType1 CountType) NodeReportsClient { + return NodeReportsClient{NewWithBaseURI(baseURI, subscriptionID, countType1)} +} + +// Get retrieve the Dsc node report data by node id and report id. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// nodeID - the Dsc node id. +// reportID - the report id. +func (client NodeReportsClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, nodeID string, reportID string) (result DscNodeReport, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.NodeReportsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, nodeID, reportID) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.NodeReportsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.NodeReportsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.NodeReportsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client NodeReportsClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, nodeID string, reportID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "nodeId": autorest.Encode("path", nodeID), + "reportId": autorest.Encode("path", reportID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-01-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodes/{nodeId}/reports/{reportId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client NodeReportsClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client NodeReportsClient) GetResponder(resp *http.Response) (result DscNodeReport, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetContent retrieve the Dsc node reports by node id and report id. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// nodeID - the Dsc node id. +// reportID - the report id. +func (client NodeReportsClient) GetContent(ctx context.Context, resourceGroupName string, automationAccountName string, nodeID string, reportID string) (result SetObject, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.NodeReportsClient", "GetContent", err.Error()) + } + + req, err := client.GetContentPreparer(ctx, resourceGroupName, automationAccountName, nodeID, reportID) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.NodeReportsClient", "GetContent", nil, "Failure preparing request") + return + } + + resp, err := client.GetContentSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.NodeReportsClient", "GetContent", resp, "Failure sending request") + return + } + + result, err = client.GetContentResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.NodeReportsClient", "GetContent", resp, "Failure responding to request") + } + + return +} + +// GetContentPreparer prepares the GetContent request. +func (client NodeReportsClient) GetContentPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, nodeID string, reportID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "nodeId": autorest.Encode("path", nodeID), + "reportId": autorest.Encode("path", reportID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-01-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodes/{nodeId}/reports/{reportId}/content", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetContentSender sends the GetContent request. The method will close the +// http.Response Body if it receives an error. +func (client NodeReportsClient) GetContentSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetContentResponder handles the response to the GetContent request. The method always +// closes the http.Response Body. +func (client NodeReportsClient) GetContentResponder(resp *http.Response) (result SetObject, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByNode retrieve the Dsc node report list by node id. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// nodeID - the parameters supplied to the list operation. +// filter - the filter to apply on the operation. +func (client NodeReportsClient) ListByNode(ctx context.Context, resourceGroupName string, automationAccountName string, nodeID string, filter string) (result DscNodeReportListResultPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.NodeReportsClient", "ListByNode", err.Error()) + } + + result.fn = client.listByNodeNextResults + req, err := client.ListByNodePreparer(ctx, resourceGroupName, automationAccountName, nodeID, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.NodeReportsClient", "ListByNode", nil, "Failure preparing request") + return + } + + resp, err := client.ListByNodeSender(req) + if err != nil { + result.dnrlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.NodeReportsClient", "ListByNode", resp, "Failure sending request") + return + } + + result.dnrlr, err = client.ListByNodeResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.NodeReportsClient", "ListByNode", resp, "Failure responding to request") + } + + return +} + +// ListByNodePreparer prepares the ListByNode request. +func (client NodeReportsClient) ListByNodePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, nodeID string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "nodeId": autorest.Encode("path", nodeID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-01-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodes/{nodeId}/reports", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByNodeSender sends the ListByNode request. The method will close the +// http.Response Body if it receives an error. +func (client NodeReportsClient) ListByNodeSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByNodeResponder handles the response to the ListByNode request. The method always +// closes the http.Response Body. +func (client NodeReportsClient) ListByNodeResponder(resp *http.Response) (result DscNodeReportListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByNodeNextResults retrieves the next set of results, if any. +func (client NodeReportsClient) listByNodeNextResults(lastResults DscNodeReportListResult) (result DscNodeReportListResult, err error) { + req, err := lastResults.dscNodeReportListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "automation.NodeReportsClient", "listByNodeNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByNodeSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "automation.NodeReportsClient", "listByNodeNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByNodeResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.NodeReportsClient", "listByNodeNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByNodeComplete enumerates all values, automatically crossing page boundaries as required. +func (client NodeReportsClient) ListByNodeComplete(ctx context.Context, resourceGroupName string, automationAccountName string, nodeID string, filter string) (result DscNodeReportListResultIterator, err error) { + result.page, err = client.ListByNode(ctx, resourceGroupName, automationAccountName, nodeID, filter) + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/objectdatatypes.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/objectdatatypes.go new file mode 100644 index 000000000..6c6ebe8d3 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/objectdatatypes.go @@ -0,0 +1,197 @@ +package automation + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// ObjectDataTypesClient is the automation Client +type ObjectDataTypesClient struct { + BaseClient +} + +// NewObjectDataTypesClient creates an instance of the ObjectDataTypesClient client. +func NewObjectDataTypesClient(subscriptionID string, countType1 CountType) ObjectDataTypesClient { + return NewObjectDataTypesClientWithBaseURI(DefaultBaseURI, subscriptionID, countType1) +} + +// NewObjectDataTypesClientWithBaseURI creates an instance of the ObjectDataTypesClient client. +func NewObjectDataTypesClientWithBaseURI(baseURI string, subscriptionID string, countType1 CountType) ObjectDataTypesClient { + return ObjectDataTypesClient{NewWithBaseURI(baseURI, subscriptionID, countType1)} +} + +// ListFieldsByModuleAndType retrieve a list of fields of a given type identified by module name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// moduleName - the name of module. +// typeName - the name of type. +func (client ObjectDataTypesClient) ListFieldsByModuleAndType(ctx context.Context, resourceGroupName string, automationAccountName string, moduleName string, typeName string) (result TypeFieldListResult, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.ObjectDataTypesClient", "ListFieldsByModuleAndType", err.Error()) + } + + req, err := client.ListFieldsByModuleAndTypePreparer(ctx, resourceGroupName, automationAccountName, moduleName, typeName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ObjectDataTypesClient", "ListFieldsByModuleAndType", nil, "Failure preparing request") + return + } + + resp, err := client.ListFieldsByModuleAndTypeSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.ObjectDataTypesClient", "ListFieldsByModuleAndType", resp, "Failure sending request") + return + } + + result, err = client.ListFieldsByModuleAndTypeResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ObjectDataTypesClient", "ListFieldsByModuleAndType", resp, "Failure responding to request") + } + + return +} + +// ListFieldsByModuleAndTypePreparer prepares the ListFieldsByModuleAndType request. +func (client ObjectDataTypesClient) ListFieldsByModuleAndTypePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, moduleName string, typeName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "moduleName": autorest.Encode("path", moduleName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "typeName": autorest.Encode("path", typeName), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/modules/{moduleName}/objectDataTypes/{typeName}/fields", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListFieldsByModuleAndTypeSender sends the ListFieldsByModuleAndType request. The method will close the +// http.Response Body if it receives an error. +func (client ObjectDataTypesClient) ListFieldsByModuleAndTypeSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListFieldsByModuleAndTypeResponder handles the response to the ListFieldsByModuleAndType request. The method always +// closes the http.Response Body. +func (client ObjectDataTypesClient) ListFieldsByModuleAndTypeResponder(resp *http.Response) (result TypeFieldListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListFieldsByType retrieve a list of fields of a given type across all accessible modules. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// typeName - the name of type. +func (client ObjectDataTypesClient) ListFieldsByType(ctx context.Context, resourceGroupName string, automationAccountName string, typeName string) (result TypeFieldListResult, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.ObjectDataTypesClient", "ListFieldsByType", err.Error()) + } + + req, err := client.ListFieldsByTypePreparer(ctx, resourceGroupName, automationAccountName, typeName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ObjectDataTypesClient", "ListFieldsByType", nil, "Failure preparing request") + return + } + + resp, err := client.ListFieldsByTypeSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.ObjectDataTypesClient", "ListFieldsByType", resp, "Failure sending request") + return + } + + result, err = client.ListFieldsByTypeResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ObjectDataTypesClient", "ListFieldsByType", resp, "Failure responding to request") + } + + return +} + +// ListFieldsByTypePreparer prepares the ListFieldsByType request. +func (client ObjectDataTypesClient) ListFieldsByTypePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, typeName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "typeName": autorest.Encode("path", typeName), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/objectDataTypes/{typeName}/fields", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListFieldsByTypeSender sends the ListFieldsByType request. The method will close the +// http.Response Body if it receives an error. +func (client ObjectDataTypesClient) ListFieldsByTypeSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListFieldsByTypeResponder handles the response to the ListFieldsByType request. The method always +// closes the http.Response Body. +func (client ObjectDataTypesClient) ListFieldsByTypeResponder(resp *http.Response) (result TypeFieldListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/operations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/operations.go new file mode 100644 index 000000000..4423e8db5 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/operations.go @@ -0,0 +1,98 @@ +package automation + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "net/http" +) + +// OperationsClient is the automation Client +type OperationsClient struct { + BaseClient +} + +// NewOperationsClient creates an instance of the OperationsClient client. +func NewOperationsClient(subscriptionID string, countType1 CountType) OperationsClient { + return NewOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID, countType1) +} + +// NewOperationsClientWithBaseURI creates an instance of the OperationsClient client. +func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string, countType1 CountType) OperationsClient { + return OperationsClient{NewWithBaseURI(baseURI, subscriptionID, countType1)} +} + +// List lists all of the available Automation REST API operations. +func (client OperationsClient) List(ctx context.Context) (result OperationListResult, err error) { + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.OperationsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.OperationsClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.OperationsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/providers/Microsoft.Automation/operations"), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client OperationsClient) ListSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client OperationsClient) ListResponder(resp *http.Response) (result OperationListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/runbook.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/runbook.go new file mode 100644 index 000000000..8add60582 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/runbook.go @@ -0,0 +1,552 @@ +package automation + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// RunbookClient is the automation Client +type RunbookClient struct { + BaseClient +} + +// NewRunbookClient creates an instance of the RunbookClient client. +func NewRunbookClient(subscriptionID string, countType1 CountType) RunbookClient { + return NewRunbookClientWithBaseURI(DefaultBaseURI, subscriptionID, countType1) +} + +// NewRunbookClientWithBaseURI creates an instance of the RunbookClient client. +func NewRunbookClientWithBaseURI(baseURI string, subscriptionID string, countType1 CountType) RunbookClient { + return RunbookClient{NewWithBaseURI(baseURI, subscriptionID, countType1)} +} + +// CreateOrUpdate create the runbook identified by runbook name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// runbookName - the runbook name. +// parameters - the create or update parameters for runbook. Provide either content link for a published +// runbook or draft, not both. +func (client RunbookClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string, parameters RunbookCreateOrUpdateParameters) (result Runbook, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.RunbookCreateOrUpdateProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.RunbookCreateOrUpdateProperties.Draft", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.RunbookCreateOrUpdateProperties.Draft.DraftContentLink", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.RunbookCreateOrUpdateProperties.Draft.DraftContentLink.ContentHash", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.RunbookCreateOrUpdateProperties.Draft.DraftContentLink.ContentHash.Algorithm", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.RunbookCreateOrUpdateProperties.Draft.DraftContentLink.ContentHash.Value", Name: validation.Null, Rule: true, Chain: nil}, + }}, + }}, + }}, + {Target: "parameters.RunbookCreateOrUpdateProperties.PublishContentLink", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.RunbookCreateOrUpdateProperties.PublishContentLink.ContentHash", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.RunbookCreateOrUpdateProperties.PublishContentLink.ContentHash.Algorithm", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.RunbookCreateOrUpdateProperties.PublishContentLink.ContentHash.Value", Name: validation.Null, Rule: true, Chain: nil}, + }}, + }}, + }}}}}); err != nil { + return result, validation.NewError("automation.RunbookClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, automationAccountName, runbookName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.RunbookClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.RunbookClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.RunbookClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client RunbookClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string, parameters RunbookCreateOrUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "runbookName": autorest.Encode("path", runbookName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client RunbookClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client RunbookClient) CreateOrUpdateResponder(resp *http.Response) (result Runbook, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusBadRequest), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete delete the runbook by name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// runbookName - the runbook name. +func (client RunbookClient) Delete(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.RunbookClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, automationAccountName, runbookName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.RunbookClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "automation.RunbookClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.RunbookClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client RunbookClient) DeletePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "runbookName": autorest.Encode("path", runbookName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client RunbookClient) DeleteSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client RunbookClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get retrieve the runbook identified by runbook name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// runbookName - the runbook name. +func (client RunbookClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (result Runbook, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.RunbookClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, runbookName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.RunbookClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.RunbookClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.RunbookClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client RunbookClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "runbookName": autorest.Encode("path", runbookName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client RunbookClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client RunbookClient) GetResponder(resp *http.Response) (result Runbook, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetContent retrieve the content of runbook identified by runbook name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// runbookName - the runbook name. +func (client RunbookClient) GetContent(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (result String, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.RunbookClient", "GetContent", err.Error()) + } + + req, err := client.GetContentPreparer(ctx, resourceGroupName, automationAccountName, runbookName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.RunbookClient", "GetContent", nil, "Failure preparing request") + return + } + + resp, err := client.GetContentSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.RunbookClient", "GetContent", resp, "Failure sending request") + return + } + + result, err = client.GetContentResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.RunbookClient", "GetContent", resp, "Failure responding to request") + } + + return +} + +// GetContentPreparer prepares the GetContent request. +func (client RunbookClient) GetContentPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "runbookName": autorest.Encode("path", runbookName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/content", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetContentSender sends the GetContent request. The method will close the +// http.Response Body if it receives an error. +func (client RunbookClient) GetContentSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetContentResponder handles the response to the GetContent request. The method always +// closes the http.Response Body. +func (client RunbookClient) GetContentResponder(resp *http.Response) (result String, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByAutomationAccount retrieve a list of runbooks. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +func (client RunbookClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string) (result RunbookListResultPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.RunbookClient", "ListByAutomationAccount", err.Error()) + } + + result.fn = client.listByAutomationAccountNextResults + req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.RunbookClient", "ListByAutomationAccount", nil, "Failure preparing request") + return + } + + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.rlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.RunbookClient", "ListByAutomationAccount", resp, "Failure sending request") + return + } + + result.rlr, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.RunbookClient", "ListByAutomationAccount", resp, "Failure responding to request") + } + + return +} + +// ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. +func (client RunbookClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByAutomationAccountSender sends the ListByAutomationAccount request. The method will close the +// http.Response Body if it receives an error. +func (client RunbookClient) ListByAutomationAccountSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByAutomationAccountResponder handles the response to the ListByAutomationAccount request. The method always +// closes the http.Response Body. +func (client RunbookClient) ListByAutomationAccountResponder(resp *http.Response) (result RunbookListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByAutomationAccountNextResults retrieves the next set of results, if any. +func (client RunbookClient) listByAutomationAccountNextResults(lastResults RunbookListResult) (result RunbookListResult, err error) { + req, err := lastResults.runbookListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "automation.RunbookClient", "listByAutomationAccountNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "automation.RunbookClient", "listByAutomationAccountNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.RunbookClient", "listByAutomationAccountNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByAutomationAccountComplete enumerates all values, automatically crossing page boundaries as required. +func (client RunbookClient) ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string) (result RunbookListResultIterator, err error) { + result.page, err = client.ListByAutomationAccount(ctx, resourceGroupName, automationAccountName) + return +} + +// Update update the runbook identified by runbook name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// runbookName - the runbook name. +// parameters - the update parameters for runbook. +func (client RunbookClient) Update(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string, parameters RunbookUpdateParameters) (result Runbook, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.RunbookClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, automationAccountName, runbookName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.RunbookClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.RunbookClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.RunbookClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client RunbookClient) UpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string, parameters RunbookUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "runbookName": autorest.Encode("path", runbookName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client RunbookClient) UpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client RunbookClient) UpdateResponder(resp *http.Response) (result Runbook, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/runbookdraft.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/runbookdraft.go new file mode 100644 index 000000000..154b92753 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/runbookdraft.go @@ -0,0 +1,436 @@ +package automation + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// RunbookDraftClient is the automation Client +type RunbookDraftClient struct { + BaseClient +} + +// NewRunbookDraftClient creates an instance of the RunbookDraftClient client. +func NewRunbookDraftClient(subscriptionID string, countType1 CountType) RunbookDraftClient { + return NewRunbookDraftClientWithBaseURI(DefaultBaseURI, subscriptionID, countType1) +} + +// NewRunbookDraftClientWithBaseURI creates an instance of the RunbookDraftClient client. +func NewRunbookDraftClientWithBaseURI(baseURI string, subscriptionID string, countType1 CountType) RunbookDraftClient { + return RunbookDraftClient{NewWithBaseURI(baseURI, subscriptionID, countType1)} +} + +// Get retrieve the runbook draft identified by runbook name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// runbookName - the runbook name. +func (client RunbookDraftClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (result RunbookDraft, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.RunbookDraftClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, runbookName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.RunbookDraftClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.RunbookDraftClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.RunbookDraftClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client RunbookDraftClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "runbookName": autorest.Encode("path", runbookName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client RunbookDraftClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client RunbookDraftClient) GetResponder(resp *http.Response) (result RunbookDraft, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetContent retrieve the content of runbook draft identified by runbook name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// runbookName - the runbook name. +func (client RunbookDraftClient) GetContent(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (result String, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.RunbookDraftClient", "GetContent", err.Error()) + } + + req, err := client.GetContentPreparer(ctx, resourceGroupName, automationAccountName, runbookName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.RunbookDraftClient", "GetContent", nil, "Failure preparing request") + return + } + + resp, err := client.GetContentSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.RunbookDraftClient", "GetContent", resp, "Failure sending request") + return + } + + result, err = client.GetContentResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.RunbookDraftClient", "GetContent", resp, "Failure responding to request") + } + + return +} + +// GetContentPreparer prepares the GetContent request. +func (client RunbookDraftClient) GetContentPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "runbookName": autorest.Encode("path", runbookName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/content", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetContentSender sends the GetContent request. The method will close the +// http.Response Body if it receives an error. +func (client RunbookDraftClient) GetContentSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetContentResponder handles the response to the GetContent request. The method always +// closes the http.Response Body. +func (client RunbookDraftClient) GetContentResponder(resp *http.Response) (result String, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Publish publish runbook draft. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// runbookName - the parameters supplied to the publish runbook operation. +func (client RunbookDraftClient) Publish(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (result RunbookDraftPublishFuture, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.RunbookDraftClient", "Publish", err.Error()) + } + + req, err := client.PublishPreparer(ctx, resourceGroupName, automationAccountName, runbookName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.RunbookDraftClient", "Publish", nil, "Failure preparing request") + return + } + + result, err = client.PublishSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.RunbookDraftClient", "Publish", result.Response(), "Failure sending request") + return + } + + return +} + +// PublishPreparer prepares the Publish request. +func (client RunbookDraftClient) PublishPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "runbookName": autorest.Encode("path", runbookName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/publish", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// PublishSender sends the Publish request. The method will close the +// http.Response Body if it receives an error. +func (client RunbookDraftClient) PublishSender(req *http.Request) (future RunbookDraftPublishFuture, err error) { + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// PublishResponder handles the response to the Publish request. The method always +// closes the http.Response Body. +func (client RunbookDraftClient) PublishResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// ReplaceContent replaces the runbook draft content. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// runbookName - the runbook name. +// runbookContent - the runbook draft content. +func (client RunbookDraftClient) ReplaceContent(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string, runbookContent string) (result RunbookDraftReplaceContentFuture, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.RunbookDraftClient", "ReplaceContent", err.Error()) + } + + req, err := client.ReplaceContentPreparer(ctx, resourceGroupName, automationAccountName, runbookName, runbookContent) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.RunbookDraftClient", "ReplaceContent", nil, "Failure preparing request") + return + } + + result, err = client.ReplaceContentSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.RunbookDraftClient", "ReplaceContent", result.Response(), "Failure sending request") + return + } + + return +} + +// ReplaceContentPreparer prepares the ReplaceContent request. +func (client RunbookDraftClient) ReplaceContentPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string, runbookContent string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "runbookName": autorest.Encode("path", runbookName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("text/powershell"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/content", pathParameters), + autorest.WithJSON(runbookContent), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ReplaceContentSender sends the ReplaceContent request. The method will close the +// http.Response Body if it receives an error. +func (client RunbookDraftClient) ReplaceContentSender(req *http.Request) (future RunbookDraftReplaceContentFuture, err error) { + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// ReplaceContentResponder handles the response to the ReplaceContent request. The method always +// closes the http.Response Body. +func (client RunbookDraftClient) ReplaceContentResponder(resp *http.Response) (result String, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UndoEdit undo draft edit to last known published state identified by runbook name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// runbookName - the runbook name. +func (client RunbookDraftClient) UndoEdit(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (result RunbookDraftUndoEditResult, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.RunbookDraftClient", "UndoEdit", err.Error()) + } + + req, err := client.UndoEditPreparer(ctx, resourceGroupName, automationAccountName, runbookName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.RunbookDraftClient", "UndoEdit", nil, "Failure preparing request") + return + } + + resp, err := client.UndoEditSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.RunbookDraftClient", "UndoEdit", resp, "Failure sending request") + return + } + + result, err = client.UndoEditResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.RunbookDraftClient", "UndoEdit", resp, "Failure responding to request") + } + + return +} + +// UndoEditPreparer prepares the UndoEdit request. +func (client RunbookDraftClient) UndoEditPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "runbookName": autorest.Encode("path", runbookName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/undoEdit", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UndoEditSender sends the UndoEdit request. The method will close the +// http.Response Body if it receives an error. +func (client RunbookDraftClient) UndoEditSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// UndoEditResponder handles the response to the UndoEdit request. The method always +// closes the http.Response Body. +func (client RunbookDraftClient) UndoEditResponder(resp *http.Response) (result RunbookDraftUndoEditResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/schedule.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/schedule.go new file mode 100644 index 000000000..8856aaa45 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/schedule.go @@ -0,0 +1,461 @@ +package automation + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// ScheduleClient is the automation Client +type ScheduleClient struct { + BaseClient +} + +// NewScheduleClient creates an instance of the ScheduleClient client. +func NewScheduleClient(subscriptionID string, countType1 CountType) ScheduleClient { + return NewScheduleClientWithBaseURI(DefaultBaseURI, subscriptionID, countType1) +} + +// NewScheduleClientWithBaseURI creates an instance of the ScheduleClient client. +func NewScheduleClientWithBaseURI(baseURI string, subscriptionID string, countType1 CountType) ScheduleClient { + return ScheduleClient{NewWithBaseURI(baseURI, subscriptionID, countType1)} +} + +// CreateOrUpdate create a schedule. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// scheduleName - the schedule name. +// parameters - the parameters supplied to the create or update schedule operation. +func (client ScheduleClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, automationAccountName string, scheduleName string, parameters ScheduleCreateOrUpdateParameters) (result Schedule, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.Name", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.ScheduleCreateOrUpdateProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.ScheduleCreateOrUpdateProperties.StartTime", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("automation.ScheduleClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, automationAccountName, scheduleName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ScheduleClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.ScheduleClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ScheduleClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client ScheduleClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, scheduleName string, parameters ScheduleCreateOrUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "scheduleName": autorest.Encode("path", scheduleName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/schedules/{scheduleName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client ScheduleClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client ScheduleClient) CreateOrUpdateResponder(resp *http.Response) (result Schedule, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusConflict), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete delete the schedule identified by schedule name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// scheduleName - the schedule name. +func (client ScheduleClient) Delete(ctx context.Context, resourceGroupName string, automationAccountName string, scheduleName string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.ScheduleClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, automationAccountName, scheduleName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ScheduleClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "automation.ScheduleClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ScheduleClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ScheduleClient) DeletePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, scheduleName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "scheduleName": autorest.Encode("path", scheduleName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/schedules/{scheduleName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ScheduleClient) DeleteSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ScheduleClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get retrieve the schedule identified by schedule name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// scheduleName - the schedule name. +func (client ScheduleClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, scheduleName string) (result Schedule, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.ScheduleClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, scheduleName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ScheduleClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.ScheduleClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ScheduleClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client ScheduleClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, scheduleName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "scheduleName": autorest.Encode("path", scheduleName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/schedules/{scheduleName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ScheduleClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ScheduleClient) GetResponder(resp *http.Response) (result Schedule, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByAutomationAccount retrieve a list of schedules. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +func (client ScheduleClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string) (result ScheduleListResultPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.ScheduleClient", "ListByAutomationAccount", err.Error()) + } + + result.fn = client.listByAutomationAccountNextResults + req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ScheduleClient", "ListByAutomationAccount", nil, "Failure preparing request") + return + } + + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.slr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.ScheduleClient", "ListByAutomationAccount", resp, "Failure sending request") + return + } + + result.slr, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ScheduleClient", "ListByAutomationAccount", resp, "Failure responding to request") + } + + return +} + +// ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. +func (client ScheduleClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/schedules", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByAutomationAccountSender sends the ListByAutomationAccount request. The method will close the +// http.Response Body if it receives an error. +func (client ScheduleClient) ListByAutomationAccountSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByAutomationAccountResponder handles the response to the ListByAutomationAccount request. The method always +// closes the http.Response Body. +func (client ScheduleClient) ListByAutomationAccountResponder(resp *http.Response) (result ScheduleListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByAutomationAccountNextResults retrieves the next set of results, if any. +func (client ScheduleClient) listByAutomationAccountNextResults(lastResults ScheduleListResult) (result ScheduleListResult, err error) { + req, err := lastResults.scheduleListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "automation.ScheduleClient", "listByAutomationAccountNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "automation.ScheduleClient", "listByAutomationAccountNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ScheduleClient", "listByAutomationAccountNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByAutomationAccountComplete enumerates all values, automatically crossing page boundaries as required. +func (client ScheduleClient) ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string) (result ScheduleListResultIterator, err error) { + result.page, err = client.ListByAutomationAccount(ctx, resourceGroupName, automationAccountName) + return +} + +// Update update the schedule identified by schedule name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// scheduleName - the schedule name. +// parameters - the parameters supplied to the update schedule operation. +func (client ScheduleClient) Update(ctx context.Context, resourceGroupName string, automationAccountName string, scheduleName string, parameters ScheduleUpdateParameters) (result Schedule, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.ScheduleClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, automationAccountName, scheduleName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ScheduleClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.ScheduleClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ScheduleClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client ScheduleClient) UpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, scheduleName string, parameters ScheduleUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "scheduleName": autorest.Encode("path", scheduleName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/schedules/{scheduleName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client ScheduleClient) UpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client ScheduleClient) UpdateResponder(resp *http.Response) (result Schedule, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/softwareupdateconfigurationmachineruns.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/softwareupdateconfigurationmachineruns.go new file mode 100644 index 000000000..b1ca235eb --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/softwareupdateconfigurationmachineruns.go @@ -0,0 +1,219 @@ +package automation + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/satori/go.uuid" + "net/http" +) + +// SoftwareUpdateConfigurationMachineRunsClient is the automation Client +type SoftwareUpdateConfigurationMachineRunsClient struct { + BaseClient +} + +// NewSoftwareUpdateConfigurationMachineRunsClient creates an instance of the +// SoftwareUpdateConfigurationMachineRunsClient client. +func NewSoftwareUpdateConfigurationMachineRunsClient(subscriptionID string, countType1 CountType) SoftwareUpdateConfigurationMachineRunsClient { + return NewSoftwareUpdateConfigurationMachineRunsClientWithBaseURI(DefaultBaseURI, subscriptionID, countType1) +} + +// NewSoftwareUpdateConfigurationMachineRunsClientWithBaseURI creates an instance of the +// SoftwareUpdateConfigurationMachineRunsClient client. +func NewSoftwareUpdateConfigurationMachineRunsClientWithBaseURI(baseURI string, subscriptionID string, countType1 CountType) SoftwareUpdateConfigurationMachineRunsClient { + return SoftwareUpdateConfigurationMachineRunsClient{NewWithBaseURI(baseURI, subscriptionID, countType1)} +} + +// GetByID get a single software update configuration machine run by Id. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// softwareUpdateConfigurationMachineRunID - the Id of the software update configuration machine run. +// clientRequestID - identifies this specific client request. +func (client SoftwareUpdateConfigurationMachineRunsClient) GetByID(ctx context.Context, resourceGroupName string, automationAccountName string, softwareUpdateConfigurationMachineRunID uuid.UUID, clientRequestID string) (result SoftwareUpdateConfigurationMachineRun, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.SoftwareUpdateConfigurationMachineRunsClient", "GetByID", err.Error()) + } + + req, err := client.GetByIDPreparer(ctx, resourceGroupName, automationAccountName, softwareUpdateConfigurationMachineRunID, clientRequestID) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SoftwareUpdateConfigurationMachineRunsClient", "GetByID", nil, "Failure preparing request") + return + } + + resp, err := client.GetByIDSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.SoftwareUpdateConfigurationMachineRunsClient", "GetByID", resp, "Failure sending request") + return + } + + result, err = client.GetByIDResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SoftwareUpdateConfigurationMachineRunsClient", "GetByID", resp, "Failure responding to request") + } + + return +} + +// GetByIDPreparer prepares the GetByID request. +func (client SoftwareUpdateConfigurationMachineRunsClient) GetByIDPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, softwareUpdateConfigurationMachineRunID uuid.UUID, clientRequestID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "softwareUpdateConfigurationMachineRunId": autorest.Encode("path", softwareUpdateConfigurationMachineRunID), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-05-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/softwareUpdateConfigurationMachineRuns/{softwareUpdateConfigurationMachineRunId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if len(clientRequestID) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("clientRequestId", autorest.String(clientRequestID))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetByIDSender sends the GetByID request. The method will close the +// http.Response Body if it receives an error. +func (client SoftwareUpdateConfigurationMachineRunsClient) GetByIDSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetByIDResponder handles the response to the GetByID request. The method always +// closes the http.Response Body. +func (client SoftwareUpdateConfigurationMachineRunsClient) GetByIDResponder(resp *http.Response) (result SoftwareUpdateConfigurationMachineRun, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List return list of software update configuration machine runs +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// clientRequestID - identifies this specific client request. +// filter - the filter to apply on the operation. You can use the following filters: 'properties/osType', +// 'properties/status', 'properties/startTime', and 'properties/softwareUpdateConfiguration/name' +// skip - number of entries you skip before returning results +// top - maximum number of entries returned in the results collection +func (client SoftwareUpdateConfigurationMachineRunsClient) List(ctx context.Context, resourceGroupName string, automationAccountName string, clientRequestID string, filter string, skip string, top string) (result SoftwareUpdateConfigurationMachineRunListResult, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.SoftwareUpdateConfigurationMachineRunsClient", "List", err.Error()) + } + + req, err := client.ListPreparer(ctx, resourceGroupName, automationAccountName, clientRequestID, filter, skip, top) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SoftwareUpdateConfigurationMachineRunsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.SoftwareUpdateConfigurationMachineRunsClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SoftwareUpdateConfigurationMachineRunsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client SoftwareUpdateConfigurationMachineRunsClient) ListPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, clientRequestID string, filter string, skip string, top string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-05-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if len(skip) > 0 { + queryParameters["$skip"] = autorest.Encode("query", skip) + } + if len(top) > 0 { + queryParameters["$top"] = autorest.Encode("query", top) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/softwareUpdateConfigurationMachineRuns", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if len(clientRequestID) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("clientRequestId", autorest.String(clientRequestID))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client SoftwareUpdateConfigurationMachineRunsClient) ListSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client SoftwareUpdateConfigurationMachineRunsClient) ListResponder(resp *http.Response) (result SoftwareUpdateConfigurationMachineRunListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/softwareupdateconfigurationruns.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/softwareupdateconfigurationruns.go new file mode 100644 index 000000000..51734e1ed --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/softwareupdateconfigurationruns.go @@ -0,0 +1,218 @@ +package automation + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/satori/go.uuid" + "net/http" +) + +// SoftwareUpdateConfigurationRunsClient is the automation Client +type SoftwareUpdateConfigurationRunsClient struct { + BaseClient +} + +// NewSoftwareUpdateConfigurationRunsClient creates an instance of the SoftwareUpdateConfigurationRunsClient client. +func NewSoftwareUpdateConfigurationRunsClient(subscriptionID string, countType1 CountType) SoftwareUpdateConfigurationRunsClient { + return NewSoftwareUpdateConfigurationRunsClientWithBaseURI(DefaultBaseURI, subscriptionID, countType1) +} + +// NewSoftwareUpdateConfigurationRunsClientWithBaseURI creates an instance of the SoftwareUpdateConfigurationRunsClient +// client. +func NewSoftwareUpdateConfigurationRunsClientWithBaseURI(baseURI string, subscriptionID string, countType1 CountType) SoftwareUpdateConfigurationRunsClient { + return SoftwareUpdateConfigurationRunsClient{NewWithBaseURI(baseURI, subscriptionID, countType1)} +} + +// GetByID get a single software update configuration Run by Id. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// softwareUpdateConfigurationRunID - the Id of the software update configuration run. +// clientRequestID - identifies this specific client request. +func (client SoftwareUpdateConfigurationRunsClient) GetByID(ctx context.Context, resourceGroupName string, automationAccountName string, softwareUpdateConfigurationRunID uuid.UUID, clientRequestID string) (result SoftwareUpdateConfigurationRun, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.SoftwareUpdateConfigurationRunsClient", "GetByID", err.Error()) + } + + req, err := client.GetByIDPreparer(ctx, resourceGroupName, automationAccountName, softwareUpdateConfigurationRunID, clientRequestID) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SoftwareUpdateConfigurationRunsClient", "GetByID", nil, "Failure preparing request") + return + } + + resp, err := client.GetByIDSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.SoftwareUpdateConfigurationRunsClient", "GetByID", resp, "Failure sending request") + return + } + + result, err = client.GetByIDResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SoftwareUpdateConfigurationRunsClient", "GetByID", resp, "Failure responding to request") + } + + return +} + +// GetByIDPreparer prepares the GetByID request. +func (client SoftwareUpdateConfigurationRunsClient) GetByIDPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, softwareUpdateConfigurationRunID uuid.UUID, clientRequestID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "softwareUpdateConfigurationRunId": autorest.Encode("path", softwareUpdateConfigurationRunID), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-05-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/softwareUpdateConfigurationRuns/{softwareUpdateConfigurationRunId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if len(clientRequestID) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("clientRequestId", autorest.String(clientRequestID))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetByIDSender sends the GetByID request. The method will close the +// http.Response Body if it receives an error. +func (client SoftwareUpdateConfigurationRunsClient) GetByIDSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetByIDResponder handles the response to the GetByID request. The method always +// closes the http.Response Body. +func (client SoftwareUpdateConfigurationRunsClient) GetByIDResponder(resp *http.Response) (result SoftwareUpdateConfigurationRun, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List return list of software update configuration runs +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// clientRequestID - identifies this specific client request. +// filter - the filter to apply on the operation. You can use the following filters: 'properties/osType', +// 'properties/status', 'properties/startTime', and 'properties/softwareUpdateConfiguration/name' +// skip - number of entries you skip before returning results +// top - maximum number of entries returned in the results collection +func (client SoftwareUpdateConfigurationRunsClient) List(ctx context.Context, resourceGroupName string, automationAccountName string, clientRequestID string, filter string, skip string, top string) (result SoftwareUpdateConfigurationRunListResult, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.SoftwareUpdateConfigurationRunsClient", "List", err.Error()) + } + + req, err := client.ListPreparer(ctx, resourceGroupName, automationAccountName, clientRequestID, filter, skip, top) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SoftwareUpdateConfigurationRunsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.SoftwareUpdateConfigurationRunsClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SoftwareUpdateConfigurationRunsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client SoftwareUpdateConfigurationRunsClient) ListPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, clientRequestID string, filter string, skip string, top string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-05-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if len(skip) > 0 { + queryParameters["$skip"] = autorest.Encode("query", skip) + } + if len(top) > 0 { + queryParameters["$top"] = autorest.Encode("query", top) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/softwareUpdateConfigurationRuns", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if len(clientRequestID) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("clientRequestId", autorest.String(clientRequestID))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client SoftwareUpdateConfigurationRunsClient) ListSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client SoftwareUpdateConfigurationRunsClient) ListResponder(resp *http.Response) (result SoftwareUpdateConfigurationRunListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/softwareupdateconfigurations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/softwareupdateconfigurations.go new file mode 100644 index 000000000..02991a282 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/softwareupdateconfigurations.go @@ -0,0 +1,379 @@ +package automation + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// SoftwareUpdateConfigurationsClient is the automation Client +type SoftwareUpdateConfigurationsClient struct { + BaseClient +} + +// NewSoftwareUpdateConfigurationsClient creates an instance of the SoftwareUpdateConfigurationsClient client. +func NewSoftwareUpdateConfigurationsClient(subscriptionID string, countType1 CountType) SoftwareUpdateConfigurationsClient { + return NewSoftwareUpdateConfigurationsClientWithBaseURI(DefaultBaseURI, subscriptionID, countType1) +} + +// NewSoftwareUpdateConfigurationsClientWithBaseURI creates an instance of the SoftwareUpdateConfigurationsClient +// client. +func NewSoftwareUpdateConfigurationsClientWithBaseURI(baseURI string, subscriptionID string, countType1 CountType) SoftwareUpdateConfigurationsClient { + return SoftwareUpdateConfigurationsClient{NewWithBaseURI(baseURI, subscriptionID, countType1)} +} + +// Create create a new software update configuration with the name given in the URI. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// softwareUpdateConfigurationName - the name of the software update configuration to be created. +// parameters - request body. +// clientRequestID - identifies this specific client request. +func (client SoftwareUpdateConfigurationsClient) Create(ctx context.Context, resourceGroupName string, automationAccountName string, softwareUpdateConfigurationName string, parameters SoftwareUpdateConfiguration, clientRequestID string) (result SoftwareUpdateConfiguration, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.SoftwareUpdateConfigurationProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.SoftwareUpdateConfigurationProperties.UpdateConfiguration", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.SoftwareUpdateConfigurationProperties.ScheduleInfo", Name: validation.Null, Rule: true, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("automation.SoftwareUpdateConfigurationsClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, resourceGroupName, automationAccountName, softwareUpdateConfigurationName, parameters, clientRequestID) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SoftwareUpdateConfigurationsClient", "Create", nil, "Failure preparing request") + return + } + + resp, err := client.CreateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.SoftwareUpdateConfigurationsClient", "Create", resp, "Failure sending request") + return + } + + result, err = client.CreateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SoftwareUpdateConfigurationsClient", "Create", resp, "Failure responding to request") + } + + return +} + +// CreatePreparer prepares the Create request. +func (client SoftwareUpdateConfigurationsClient) CreatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, softwareUpdateConfigurationName string, parameters SoftwareUpdateConfiguration, clientRequestID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "softwareUpdateConfigurationName": autorest.Encode("path", softwareUpdateConfigurationName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-05-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/softwareUpdateConfigurations/{softwareUpdateConfigurationName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + if len(clientRequestID) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("clientRequestId", autorest.String(clientRequestID))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client SoftwareUpdateConfigurationsClient) CreateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client SoftwareUpdateConfigurationsClient) CreateResponder(resp *http.Response) (result SoftwareUpdateConfiguration, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete delete a specific software update configuration. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// softwareUpdateConfigurationName - the name of the software update configuration to be created. +// clientRequestID - identifies this specific client request. +func (client SoftwareUpdateConfigurationsClient) Delete(ctx context.Context, resourceGroupName string, automationAccountName string, softwareUpdateConfigurationName string, clientRequestID string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.SoftwareUpdateConfigurationsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, automationAccountName, softwareUpdateConfigurationName, clientRequestID) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SoftwareUpdateConfigurationsClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "automation.SoftwareUpdateConfigurationsClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SoftwareUpdateConfigurationsClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client SoftwareUpdateConfigurationsClient) DeletePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, softwareUpdateConfigurationName string, clientRequestID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "softwareUpdateConfigurationName": autorest.Encode("path", softwareUpdateConfigurationName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-05-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/softwareUpdateConfigurations/{softwareUpdateConfigurationName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if len(clientRequestID) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("clientRequestId", autorest.String(clientRequestID))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client SoftwareUpdateConfigurationsClient) DeleteSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client SoftwareUpdateConfigurationsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// GetByName get a single software update configuration by name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// softwareUpdateConfigurationName - the name of the software update configuration to be created. +// clientRequestID - identifies this specific client request. +func (client SoftwareUpdateConfigurationsClient) GetByName(ctx context.Context, resourceGroupName string, automationAccountName string, softwareUpdateConfigurationName string, clientRequestID string) (result SoftwareUpdateConfiguration, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.SoftwareUpdateConfigurationsClient", "GetByName", err.Error()) + } + + req, err := client.GetByNamePreparer(ctx, resourceGroupName, automationAccountName, softwareUpdateConfigurationName, clientRequestID) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SoftwareUpdateConfigurationsClient", "GetByName", nil, "Failure preparing request") + return + } + + resp, err := client.GetByNameSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.SoftwareUpdateConfigurationsClient", "GetByName", resp, "Failure sending request") + return + } + + result, err = client.GetByNameResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SoftwareUpdateConfigurationsClient", "GetByName", resp, "Failure responding to request") + } + + return +} + +// GetByNamePreparer prepares the GetByName request. +func (client SoftwareUpdateConfigurationsClient) GetByNamePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, softwareUpdateConfigurationName string, clientRequestID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "softwareUpdateConfigurationName": autorest.Encode("path", softwareUpdateConfigurationName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-05-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/softwareUpdateConfigurations/{softwareUpdateConfigurationName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if len(clientRequestID) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("clientRequestId", autorest.String(clientRequestID))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetByNameSender sends the GetByName request. The method will close the +// http.Response Body if it receives an error. +func (client SoftwareUpdateConfigurationsClient) GetByNameSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetByNameResponder handles the response to the GetByName request. The method always +// closes the http.Response Body. +func (client SoftwareUpdateConfigurationsClient) GetByNameResponder(resp *http.Response) (result SoftwareUpdateConfiguration, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List get all software update configurations for the account. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// clientRequestID - identifies this specific client request. +// filter - the filter to apply on the operation. +func (client SoftwareUpdateConfigurationsClient) List(ctx context.Context, resourceGroupName string, automationAccountName string, clientRequestID string, filter string) (result SoftwareUpdateConfigurationListResult, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.SoftwareUpdateConfigurationsClient", "List", err.Error()) + } + + req, err := client.ListPreparer(ctx, resourceGroupName, automationAccountName, clientRequestID, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SoftwareUpdateConfigurationsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.SoftwareUpdateConfigurationsClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SoftwareUpdateConfigurationsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client SoftwareUpdateConfigurationsClient) ListPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, clientRequestID string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-05-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/softwareUpdateConfigurations", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if len(clientRequestID) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("clientRequestId", autorest.String(clientRequestID))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client SoftwareUpdateConfigurationsClient) ListSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client SoftwareUpdateConfigurationsClient) ListResponder(resp *http.Response) (result SoftwareUpdateConfigurationListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/sourcecontrol.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/sourcecontrol.go new file mode 100644 index 000000000..301e4cef9 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/sourcecontrol.go @@ -0,0 +1,474 @@ +package automation + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// SourceControlClient is the automation Client +type SourceControlClient struct { + BaseClient +} + +// NewSourceControlClient creates an instance of the SourceControlClient client. +func NewSourceControlClient(subscriptionID string, countType1 CountType) SourceControlClient { + return NewSourceControlClientWithBaseURI(DefaultBaseURI, subscriptionID, countType1) +} + +// NewSourceControlClientWithBaseURI creates an instance of the SourceControlClient client. +func NewSourceControlClientWithBaseURI(baseURI string, subscriptionID string, countType1 CountType) SourceControlClient { + return SourceControlClient{NewWithBaseURI(baseURI, subscriptionID, countType1)} +} + +// CreateOrUpdate create a source control. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// sourceControlName - the source control name. +// parameters - the parameters supplied to the create or update source control operation. +func (client SourceControlClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, automationAccountName string, sourceControlName string, parameters SourceControlCreateOrUpdateParameters) (result SourceControl, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.SourceControlCreateOrUpdateProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.SourceControlCreateOrUpdateProperties.RepoURL", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.SourceControlCreateOrUpdateProperties.RepoURL", Name: validation.MaxLength, Rule: 2000, Chain: nil}}}, + {Target: "parameters.SourceControlCreateOrUpdateProperties.Branch", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.SourceControlCreateOrUpdateProperties.Branch", Name: validation.MaxLength, Rule: 255, Chain: nil}}}, + {Target: "parameters.SourceControlCreateOrUpdateProperties.FolderPath", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.SourceControlCreateOrUpdateProperties.FolderPath", Name: validation.MaxLength, Rule: 255, Chain: nil}}}, + {Target: "parameters.SourceControlCreateOrUpdateProperties.SecurityToken", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.SourceControlCreateOrUpdateProperties.SecurityToken", Name: validation.MaxLength, Rule: 1024, Chain: nil}}}, + {Target: "parameters.SourceControlCreateOrUpdateProperties.Description", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.SourceControlCreateOrUpdateProperties.Description", Name: validation.MaxLength, Rule: 512, Chain: nil}}}, + }}}}}); err != nil { + return result, validation.NewError("automation.SourceControlClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, automationAccountName, sourceControlName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SourceControlClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.SourceControlClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SourceControlClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client SourceControlClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, sourceControlName string, parameters SourceControlCreateOrUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "sourceControlName": autorest.Encode("path", sourceControlName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-05-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/sourceControls/{sourceControlName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client SourceControlClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client SourceControlClient) CreateOrUpdateResponder(resp *http.Response) (result SourceControl, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete delete the source control. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// sourceControlName - the name of source control. +func (client SourceControlClient) Delete(ctx context.Context, resourceGroupName string, automationAccountName string, sourceControlName string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.SourceControlClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, automationAccountName, sourceControlName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SourceControlClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "automation.SourceControlClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SourceControlClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client SourceControlClient) DeletePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, sourceControlName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "sourceControlName": autorest.Encode("path", sourceControlName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-05-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/sourceControls/{sourceControlName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client SourceControlClient) DeleteSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client SourceControlClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get retrieve the source control identified by source control name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// sourceControlName - the name of source control. +func (client SourceControlClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, sourceControlName string) (result SourceControl, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.SourceControlClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, sourceControlName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SourceControlClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.SourceControlClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SourceControlClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client SourceControlClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, sourceControlName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "sourceControlName": autorest.Encode("path", sourceControlName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-05-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/sourceControls/{sourceControlName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client SourceControlClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client SourceControlClient) GetResponder(resp *http.Response) (result SourceControl, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByAutomationAccount retrieve a list of source controls. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// filter - the filter to apply on the operation. +func (client SourceControlClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (result SourceControlListResultPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.SourceControlClient", "ListByAutomationAccount", err.Error()) + } + + result.fn = client.listByAutomationAccountNextResults + req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SourceControlClient", "ListByAutomationAccount", nil, "Failure preparing request") + return + } + + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.sclr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.SourceControlClient", "ListByAutomationAccount", resp, "Failure sending request") + return + } + + result.sclr, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SourceControlClient", "ListByAutomationAccount", resp, "Failure responding to request") + } + + return +} + +// ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. +func (client SourceControlClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-05-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/sourceControls", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByAutomationAccountSender sends the ListByAutomationAccount request. The method will close the +// http.Response Body if it receives an error. +func (client SourceControlClient) ListByAutomationAccountSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByAutomationAccountResponder handles the response to the ListByAutomationAccount request. The method always +// closes the http.Response Body. +func (client SourceControlClient) ListByAutomationAccountResponder(resp *http.Response) (result SourceControlListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByAutomationAccountNextResults retrieves the next set of results, if any. +func (client SourceControlClient) listByAutomationAccountNextResults(lastResults SourceControlListResult) (result SourceControlListResult, err error) { + req, err := lastResults.sourceControlListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "automation.SourceControlClient", "listByAutomationAccountNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "automation.SourceControlClient", "listByAutomationAccountNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SourceControlClient", "listByAutomationAccountNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByAutomationAccountComplete enumerates all values, automatically crossing page boundaries as required. +func (client SourceControlClient) ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (result SourceControlListResultIterator, err error) { + result.page, err = client.ListByAutomationAccount(ctx, resourceGroupName, automationAccountName, filter) + return +} + +// Update update a source control. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// sourceControlName - the source control name. +// parameters - the parameters supplied to the update source control operation. +func (client SourceControlClient) Update(ctx context.Context, resourceGroupName string, automationAccountName string, sourceControlName string, parameters SourceControlUpdateParameters) (result SourceControl, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.SourceControlClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, automationAccountName, sourceControlName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SourceControlClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.SourceControlClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SourceControlClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client SourceControlClient) UpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, sourceControlName string, parameters SourceControlUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "sourceControlName": autorest.Encode("path", sourceControlName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-05-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/sourceControls/{sourceControlName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client SourceControlClient) UpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client SourceControlClient) UpdateResponder(resp *http.Response) (result SourceControl, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/sourcecontrolsyncjob.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/sourcecontrolsyncjob.go new file mode 100644 index 000000000..bdc1c56db --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/sourcecontrolsyncjob.go @@ -0,0 +1,314 @@ +package automation + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/satori/go.uuid" + "net/http" +) + +// SourceControlSyncJobClient is the automation Client +type SourceControlSyncJobClient struct { + BaseClient +} + +// NewSourceControlSyncJobClient creates an instance of the SourceControlSyncJobClient client. +func NewSourceControlSyncJobClient(subscriptionID string, countType1 CountType) SourceControlSyncJobClient { + return NewSourceControlSyncJobClientWithBaseURI(DefaultBaseURI, subscriptionID, countType1) +} + +// NewSourceControlSyncJobClientWithBaseURI creates an instance of the SourceControlSyncJobClient client. +func NewSourceControlSyncJobClientWithBaseURI(baseURI string, subscriptionID string, countType1 CountType) SourceControlSyncJobClient { + return SourceControlSyncJobClient{NewWithBaseURI(baseURI, subscriptionID, countType1)} +} + +// Create creates the sync job for a source control. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// sourceControlName - the source control name. +// sourceControlSyncJobID - the source control sync job id. +// parameters - the parameters supplied to the create source control sync job operation. +func (client SourceControlSyncJobClient) Create(ctx context.Context, resourceGroupName string, automationAccountName string, sourceControlName string, sourceControlSyncJobID uuid.UUID, parameters SourceControlSyncJobCreateParameters) (result SourceControlSyncJob, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.SourceControlSyncJobCreateProperties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.SourceControlSyncJobClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, resourceGroupName, automationAccountName, sourceControlName, sourceControlSyncJobID, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SourceControlSyncJobClient", "Create", nil, "Failure preparing request") + return + } + + resp, err := client.CreateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.SourceControlSyncJobClient", "Create", resp, "Failure sending request") + return + } + + result, err = client.CreateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SourceControlSyncJobClient", "Create", resp, "Failure responding to request") + } + + return +} + +// CreatePreparer prepares the Create request. +func (client SourceControlSyncJobClient) CreatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, sourceControlName string, sourceControlSyncJobID uuid.UUID, parameters SourceControlSyncJobCreateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "sourceControlName": autorest.Encode("path", sourceControlName), + "sourceControlSyncJobId": autorest.Encode("path", sourceControlSyncJobID), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-05-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/sourceControls/{sourceControlName}/sourceControlSyncJobs/{sourceControlSyncJobId}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client SourceControlSyncJobClient) CreateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client SourceControlSyncJobClient) CreateResponder(resp *http.Response) (result SourceControlSyncJob, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get retrieve the source control sync job identified by job id. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// sourceControlName - the source control name. +// sourceControlSyncJobID - the source control sync job id. +func (client SourceControlSyncJobClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, sourceControlName string, sourceControlSyncJobID uuid.UUID) (result SourceControlSyncJobByID, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.SourceControlSyncJobClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, sourceControlName, sourceControlSyncJobID) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SourceControlSyncJobClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.SourceControlSyncJobClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SourceControlSyncJobClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client SourceControlSyncJobClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, sourceControlName string, sourceControlSyncJobID uuid.UUID) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "sourceControlName": autorest.Encode("path", sourceControlName), + "sourceControlSyncJobId": autorest.Encode("path", sourceControlSyncJobID), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-05-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/sourceControls/{sourceControlName}/sourceControlSyncJobs/{sourceControlSyncJobId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client SourceControlSyncJobClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client SourceControlSyncJobClient) GetResponder(resp *http.Response) (result SourceControlSyncJobByID, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByAutomationAccount retrieve a list of source control sync jobs. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// sourceControlName - the source control name. +// filter - the filter to apply on the operation. +func (client SourceControlSyncJobClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string, sourceControlName string, filter string) (result SourceControlSyncJobListResultPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.SourceControlSyncJobClient", "ListByAutomationAccount", err.Error()) + } + + result.fn = client.listByAutomationAccountNextResults + req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName, sourceControlName, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SourceControlSyncJobClient", "ListByAutomationAccount", nil, "Failure preparing request") + return + } + + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.scsjlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.SourceControlSyncJobClient", "ListByAutomationAccount", resp, "Failure sending request") + return + } + + result.scsjlr, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SourceControlSyncJobClient", "ListByAutomationAccount", resp, "Failure responding to request") + } + + return +} + +// ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. +func (client SourceControlSyncJobClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, sourceControlName string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "sourceControlName": autorest.Encode("path", sourceControlName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-05-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/sourceControls/{sourceControlName}/sourceControlSyncJobs", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByAutomationAccountSender sends the ListByAutomationAccount request. The method will close the +// http.Response Body if it receives an error. +func (client SourceControlSyncJobClient) ListByAutomationAccountSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByAutomationAccountResponder handles the response to the ListByAutomationAccount request. The method always +// closes the http.Response Body. +func (client SourceControlSyncJobClient) ListByAutomationAccountResponder(resp *http.Response) (result SourceControlSyncJobListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByAutomationAccountNextResults retrieves the next set of results, if any. +func (client SourceControlSyncJobClient) listByAutomationAccountNextResults(lastResults SourceControlSyncJobListResult) (result SourceControlSyncJobListResult, err error) { + req, err := lastResults.sourceControlSyncJobListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "automation.SourceControlSyncJobClient", "listByAutomationAccountNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "automation.SourceControlSyncJobClient", "listByAutomationAccountNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SourceControlSyncJobClient", "listByAutomationAccountNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByAutomationAccountComplete enumerates all values, automatically crossing page boundaries as required. +func (client SourceControlSyncJobClient) ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string, sourceControlName string, filter string) (result SourceControlSyncJobListResultIterator, err error) { + result.page, err = client.ListByAutomationAccount(ctx, resourceGroupName, automationAccountName, sourceControlName, filter) + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/sourcecontrolsyncjobstreams.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/sourcecontrolsyncjobstreams.go new file mode 100644 index 000000000..0b3376722 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/sourcecontrolsyncjobstreams.go @@ -0,0 +1,234 @@ +package automation + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/satori/go.uuid" + "net/http" +) + +// SourceControlSyncJobStreamsClient is the automation Client +type SourceControlSyncJobStreamsClient struct { + BaseClient +} + +// NewSourceControlSyncJobStreamsClient creates an instance of the SourceControlSyncJobStreamsClient client. +func NewSourceControlSyncJobStreamsClient(subscriptionID string, countType1 CountType) SourceControlSyncJobStreamsClient { + return NewSourceControlSyncJobStreamsClientWithBaseURI(DefaultBaseURI, subscriptionID, countType1) +} + +// NewSourceControlSyncJobStreamsClientWithBaseURI creates an instance of the SourceControlSyncJobStreamsClient client. +func NewSourceControlSyncJobStreamsClientWithBaseURI(baseURI string, subscriptionID string, countType1 CountType) SourceControlSyncJobStreamsClient { + return SourceControlSyncJobStreamsClient{NewWithBaseURI(baseURI, subscriptionID, countType1)} +} + +// Get retrieve a sync job stream identified by stream id. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// sourceControlName - the source control name. +// sourceControlSyncJobID - the source control sync job id. +// streamID - the id of the sync job stream. +func (client SourceControlSyncJobStreamsClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, sourceControlName string, sourceControlSyncJobID uuid.UUID, streamID string) (result SourceControlSyncJobStreamByID, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.SourceControlSyncJobStreamsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, sourceControlName, sourceControlSyncJobID, streamID) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SourceControlSyncJobStreamsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.SourceControlSyncJobStreamsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SourceControlSyncJobStreamsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client SourceControlSyncJobStreamsClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, sourceControlName string, sourceControlSyncJobID uuid.UUID, streamID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "sourceControlName": autorest.Encode("path", sourceControlName), + "sourceControlSyncJobId": autorest.Encode("path", sourceControlSyncJobID), + "streamId": autorest.Encode("path", streamID), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-05-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/sourceControls/{sourceControlName}/sourceControlSyncJobs/{sourceControlSyncJobId}/streams/{streamId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client SourceControlSyncJobStreamsClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client SourceControlSyncJobStreamsClient) GetResponder(resp *http.Response) (result SourceControlSyncJobStreamByID, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListBySyncJob retrieve a list of sync job streams identified by sync job id. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// sourceControlName - the source control name. +// sourceControlSyncJobID - the source control sync job id. +// filter - the filter to apply on the operation. +func (client SourceControlSyncJobStreamsClient) ListBySyncJob(ctx context.Context, resourceGroupName string, automationAccountName string, sourceControlName string, sourceControlSyncJobID uuid.UUID, filter string) (result SourceControlSyncJobStreamsListBySyncJobPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.SourceControlSyncJobStreamsClient", "ListBySyncJob", err.Error()) + } + + result.fn = client.listBySyncJobNextResults + req, err := client.ListBySyncJobPreparer(ctx, resourceGroupName, automationAccountName, sourceControlName, sourceControlSyncJobID, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SourceControlSyncJobStreamsClient", "ListBySyncJob", nil, "Failure preparing request") + return + } + + resp, err := client.ListBySyncJobSender(req) + if err != nil { + result.scsjslbsj.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.SourceControlSyncJobStreamsClient", "ListBySyncJob", resp, "Failure sending request") + return + } + + result.scsjslbsj, err = client.ListBySyncJobResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SourceControlSyncJobStreamsClient", "ListBySyncJob", resp, "Failure responding to request") + } + + return +} + +// ListBySyncJobPreparer prepares the ListBySyncJob request. +func (client SourceControlSyncJobStreamsClient) ListBySyncJobPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, sourceControlName string, sourceControlSyncJobID uuid.UUID, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "sourceControlName": autorest.Encode("path", sourceControlName), + "sourceControlSyncJobId": autorest.Encode("path", sourceControlSyncJobID), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-05-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/sourceControls/{sourceControlName}/sourceControlSyncJobs/{sourceControlSyncJobId}/streams", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListBySyncJobSender sends the ListBySyncJob request. The method will close the +// http.Response Body if it receives an error. +func (client SourceControlSyncJobStreamsClient) ListBySyncJobSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListBySyncJobResponder handles the response to the ListBySyncJob request. The method always +// closes the http.Response Body. +func (client SourceControlSyncJobStreamsClient) ListBySyncJobResponder(resp *http.Response) (result SourceControlSyncJobStreamsListBySyncJob, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listBySyncJobNextResults retrieves the next set of results, if any. +func (client SourceControlSyncJobStreamsClient) listBySyncJobNextResults(lastResults SourceControlSyncJobStreamsListBySyncJob) (result SourceControlSyncJobStreamsListBySyncJob, err error) { + req, err := lastResults.sourceControlSyncJobStreamsListBySyncJobPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "automation.SourceControlSyncJobStreamsClient", "listBySyncJobNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListBySyncJobSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "automation.SourceControlSyncJobStreamsClient", "listBySyncJobNextResults", resp, "Failure sending next results request") + } + result, err = client.ListBySyncJobResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SourceControlSyncJobStreamsClient", "listBySyncJobNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListBySyncJobComplete enumerates all values, automatically crossing page boundaries as required. +func (client SourceControlSyncJobStreamsClient) ListBySyncJobComplete(ctx context.Context, resourceGroupName string, automationAccountName string, sourceControlName string, sourceControlSyncJobID uuid.UUID, filter string) (result SourceControlSyncJobStreamsListBySyncJobIterator, err error) { + result.page, err = client.ListBySyncJob(ctx, resourceGroupName, automationAccountName, sourceControlName, sourceControlSyncJobID, filter) + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/statistics.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/statistics.go new file mode 100644 index 000000000..a9c51ea07 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/statistics.go @@ -0,0 +1,120 @@ +package automation + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// StatisticsClient is the automation Client +type StatisticsClient struct { + BaseClient +} + +// NewStatisticsClient creates an instance of the StatisticsClient client. +func NewStatisticsClient(subscriptionID string, countType1 CountType) StatisticsClient { + return NewStatisticsClientWithBaseURI(DefaultBaseURI, subscriptionID, countType1) +} + +// NewStatisticsClientWithBaseURI creates an instance of the StatisticsClient client. +func NewStatisticsClientWithBaseURI(baseURI string, subscriptionID string, countType1 CountType) StatisticsClient { + return StatisticsClient{NewWithBaseURI(baseURI, subscriptionID, countType1)} +} + +// ListByAutomationAccount retrieve the statistics for the account. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// filter - the filter to apply on the operation. +func (client StatisticsClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (result StatisticsListResult, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.StatisticsClient", "ListByAutomationAccount", err.Error()) + } + + req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.StatisticsClient", "ListByAutomationAccount", nil, "Failure preparing request") + return + } + + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.StatisticsClient", "ListByAutomationAccount", resp, "Failure sending request") + return + } + + result, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.StatisticsClient", "ListByAutomationAccount", resp, "Failure responding to request") + } + + return +} + +// ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. +func (client StatisticsClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/statistics", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByAutomationAccountSender sends the ListByAutomationAccount request. The method will close the +// http.Response Body if it receives an error. +func (client StatisticsClient) ListByAutomationAccountSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByAutomationAccountResponder handles the response to the ListByAutomationAccount request. The method always +// closes the http.Response Body. +func (client StatisticsClient) ListByAutomationAccountResponder(resp *http.Response) (result StatisticsListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/testjob.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/testjob.go new file mode 100644 index 000000000..2c09885d6 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/testjob.go @@ -0,0 +1,426 @@ +package automation + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// TestJobClient is the automation Client +type TestJobClient struct { + BaseClient +} + +// NewTestJobClient creates an instance of the TestJobClient client. +func NewTestJobClient(subscriptionID string, countType1 CountType) TestJobClient { + return NewTestJobClientWithBaseURI(DefaultBaseURI, subscriptionID, countType1) +} + +// NewTestJobClientWithBaseURI creates an instance of the TestJobClient client. +func NewTestJobClientWithBaseURI(baseURI string, subscriptionID string, countType1 CountType) TestJobClient { + return TestJobClient{NewWithBaseURI(baseURI, subscriptionID, countType1)} +} + +// Create create a test job of the runbook. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// runbookName - the parameters supplied to the create test job operation. +// parameters - the parameters supplied to the create test job operation. +func (client TestJobClient) Create(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string, parameters TestJobCreateParameters) (result TestJob, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.TestJobClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, resourceGroupName, automationAccountName, runbookName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.TestJobClient", "Create", nil, "Failure preparing request") + return + } + + resp, err := client.CreateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.TestJobClient", "Create", resp, "Failure sending request") + return + } + + result, err = client.CreateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.TestJobClient", "Create", resp, "Failure responding to request") + } + + return +} + +// CreatePreparer prepares the Create request. +func (client TestJobClient) CreatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string, parameters TestJobCreateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "runbookName": autorest.Encode("path", runbookName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/testJob", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client TestJobClient) CreateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client TestJobClient) CreateResponder(resp *http.Response) (result TestJob, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get retrieve the test job for the specified runbook. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// runbookName - the runbook name. +func (client TestJobClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (result TestJob, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.TestJobClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, runbookName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.TestJobClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.TestJobClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.TestJobClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client TestJobClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "runbookName": autorest.Encode("path", runbookName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/testJob", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client TestJobClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client TestJobClient) GetResponder(resp *http.Response) (result TestJob, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Resume resume the test job. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// runbookName - the runbook name. +func (client TestJobClient) Resume(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.TestJobClient", "Resume", err.Error()) + } + + req, err := client.ResumePreparer(ctx, resourceGroupName, automationAccountName, runbookName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.TestJobClient", "Resume", nil, "Failure preparing request") + return + } + + resp, err := client.ResumeSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "automation.TestJobClient", "Resume", resp, "Failure sending request") + return + } + + result, err = client.ResumeResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.TestJobClient", "Resume", resp, "Failure responding to request") + } + + return +} + +// ResumePreparer prepares the Resume request. +func (client TestJobClient) ResumePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "runbookName": autorest.Encode("path", runbookName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/testJob/resume", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ResumeSender sends the Resume request. The method will close the +// http.Response Body if it receives an error. +func (client TestJobClient) ResumeSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ResumeResponder handles the response to the Resume request. The method always +// closes the http.Response Body. +func (client TestJobClient) ResumeResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Stop stop the test job. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// runbookName - the runbook name. +func (client TestJobClient) Stop(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.TestJobClient", "Stop", err.Error()) + } + + req, err := client.StopPreparer(ctx, resourceGroupName, automationAccountName, runbookName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.TestJobClient", "Stop", nil, "Failure preparing request") + return + } + + resp, err := client.StopSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "automation.TestJobClient", "Stop", resp, "Failure sending request") + return + } + + result, err = client.StopResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.TestJobClient", "Stop", resp, "Failure responding to request") + } + + return +} + +// StopPreparer prepares the Stop request. +func (client TestJobClient) StopPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "runbookName": autorest.Encode("path", runbookName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/testJob/stop", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// StopSender sends the Stop request. The method will close the +// http.Response Body if it receives an error. +func (client TestJobClient) StopSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// StopResponder handles the response to the Stop request. The method always +// closes the http.Response Body. +func (client TestJobClient) StopResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Suspend suspend the test job. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// runbookName - the runbook name. +func (client TestJobClient) Suspend(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.TestJobClient", "Suspend", err.Error()) + } + + req, err := client.SuspendPreparer(ctx, resourceGroupName, automationAccountName, runbookName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.TestJobClient", "Suspend", nil, "Failure preparing request") + return + } + + resp, err := client.SuspendSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "automation.TestJobClient", "Suspend", resp, "Failure sending request") + return + } + + result, err = client.SuspendResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.TestJobClient", "Suspend", resp, "Failure responding to request") + } + + return +} + +// SuspendPreparer prepares the Suspend request. +func (client TestJobClient) SuspendPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "runbookName": autorest.Encode("path", runbookName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/testJob/suspend", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// SuspendSender sends the Suspend request. The method will close the +// http.Response Body if it receives an error. +func (client TestJobClient) SuspendSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// SuspendResponder handles the response to the Suspend request. The method always +// closes the http.Response Body. +func (client TestJobClient) SuspendResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/testjobstreams.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/testjobstreams.go new file mode 100644 index 000000000..df38ce829 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/testjobstreams.go @@ -0,0 +1,229 @@ +package automation + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// TestJobStreamsClient is the automation Client +type TestJobStreamsClient struct { + BaseClient +} + +// NewTestJobStreamsClient creates an instance of the TestJobStreamsClient client. +func NewTestJobStreamsClient(subscriptionID string, countType1 CountType) TestJobStreamsClient { + return NewTestJobStreamsClientWithBaseURI(DefaultBaseURI, subscriptionID, countType1) +} + +// NewTestJobStreamsClientWithBaseURI creates an instance of the TestJobStreamsClient client. +func NewTestJobStreamsClientWithBaseURI(baseURI string, subscriptionID string, countType1 CountType) TestJobStreamsClient { + return TestJobStreamsClient{NewWithBaseURI(baseURI, subscriptionID, countType1)} +} + +// Get retrieve a test job stream of the test job identified by runbook name and stream id. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// runbookName - the runbook name. +// jobStreamID - the job stream id. +func (client TestJobStreamsClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string, jobStreamID string) (result JobStream, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.TestJobStreamsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, runbookName, jobStreamID) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.TestJobStreamsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.TestJobStreamsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.TestJobStreamsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client TestJobStreamsClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string, jobStreamID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "jobStreamId": autorest.Encode("path", jobStreamID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "runbookName": autorest.Encode("path", runbookName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/testJob/streams/{jobStreamId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client TestJobStreamsClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client TestJobStreamsClient) GetResponder(resp *http.Response) (result JobStream, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByTestJob retrieve a list of test job streams identified by runbook name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// runbookName - the runbook name. +// filter - the filter to apply on the operation. +func (client TestJobStreamsClient) ListByTestJob(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string, filter string) (result JobStreamListResultPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.TestJobStreamsClient", "ListByTestJob", err.Error()) + } + + result.fn = client.listByTestJobNextResults + req, err := client.ListByTestJobPreparer(ctx, resourceGroupName, automationAccountName, runbookName, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.TestJobStreamsClient", "ListByTestJob", nil, "Failure preparing request") + return + } + + resp, err := client.ListByTestJobSender(req) + if err != nil { + result.jslr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.TestJobStreamsClient", "ListByTestJob", resp, "Failure sending request") + return + } + + result.jslr, err = client.ListByTestJobResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.TestJobStreamsClient", "ListByTestJob", resp, "Failure responding to request") + } + + return +} + +// ListByTestJobPreparer prepares the ListByTestJob request. +func (client TestJobStreamsClient) ListByTestJobPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "runbookName": autorest.Encode("path", runbookName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/testJob/streams", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByTestJobSender sends the ListByTestJob request. The method will close the +// http.Response Body if it receives an error. +func (client TestJobStreamsClient) ListByTestJobSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByTestJobResponder handles the response to the ListByTestJob request. The method always +// closes the http.Response Body. +func (client TestJobStreamsClient) ListByTestJobResponder(resp *http.Response) (result JobStreamListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByTestJobNextResults retrieves the next set of results, if any. +func (client TestJobStreamsClient) listByTestJobNextResults(lastResults JobStreamListResult) (result JobStreamListResult, err error) { + req, err := lastResults.jobStreamListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "automation.TestJobStreamsClient", "listByTestJobNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByTestJobSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "automation.TestJobStreamsClient", "listByTestJobNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByTestJobResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.TestJobStreamsClient", "listByTestJobNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByTestJobComplete enumerates all values, automatically crossing page boundaries as required. +func (client TestJobStreamsClient) ListByTestJobComplete(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string, filter string) (result JobStreamListResultIterator, err error) { + result.page, err = client.ListByTestJob(ctx, resourceGroupName, automationAccountName, runbookName, filter) + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/usages.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/usages.go new file mode 100644 index 000000000..265bfaba0 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/usages.go @@ -0,0 +1,116 @@ +package automation + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// UsagesClient is the automation Client +type UsagesClient struct { + BaseClient +} + +// NewUsagesClient creates an instance of the UsagesClient client. +func NewUsagesClient(subscriptionID string, countType1 CountType) UsagesClient { + return NewUsagesClientWithBaseURI(DefaultBaseURI, subscriptionID, countType1) +} + +// NewUsagesClientWithBaseURI creates an instance of the UsagesClient client. +func NewUsagesClientWithBaseURI(baseURI string, subscriptionID string, countType1 CountType) UsagesClient { + return UsagesClient{NewWithBaseURI(baseURI, subscriptionID, countType1)} +} + +// ListByAutomationAccount retrieve the usage for the account id. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +func (client UsagesClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string) (result UsageListResult, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.UsagesClient", "ListByAutomationAccount", err.Error()) + } + + req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.UsagesClient", "ListByAutomationAccount", nil, "Failure preparing request") + return + } + + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.UsagesClient", "ListByAutomationAccount", resp, "Failure sending request") + return + } + + result, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.UsagesClient", "ListByAutomationAccount", resp, "Failure responding to request") + } + + return +} + +// ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. +func (client UsagesClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/usages", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByAutomationAccountSender sends the ListByAutomationAccount request. The method will close the +// http.Response Body if it receives an error. +func (client UsagesClient) ListByAutomationAccountSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByAutomationAccountResponder handles the response to the ListByAutomationAccount request. The method always +// closes the http.Response Body. +func (client UsagesClient) ListByAutomationAccountResponder(resp *http.Response) (result UsageListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/variable.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/variable.go new file mode 100644 index 000000000..be7b4b91c --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/variable.go @@ -0,0 +1,460 @@ +package automation + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// VariableClient is the automation Client +type VariableClient struct { + BaseClient +} + +// NewVariableClient creates an instance of the VariableClient client. +func NewVariableClient(subscriptionID string, countType1 CountType) VariableClient { + return NewVariableClientWithBaseURI(DefaultBaseURI, subscriptionID, countType1) +} + +// NewVariableClientWithBaseURI creates an instance of the VariableClient client. +func NewVariableClientWithBaseURI(baseURI string, subscriptionID string, countType1 CountType) VariableClient { + return VariableClient{NewWithBaseURI(baseURI, subscriptionID, countType1)} +} + +// CreateOrUpdate create a variable. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// variableName - the variable name. +// parameters - the parameters supplied to the create or update variable operation. +func (client VariableClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, automationAccountName string, variableName string, parameters VariableCreateOrUpdateParameters) (result Variable, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.Name", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.VariableCreateOrUpdateProperties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.VariableClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, automationAccountName, variableName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.VariableClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.VariableClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.VariableClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client VariableClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, variableName string, parameters VariableCreateOrUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "variableName": autorest.Encode("path", variableName), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/variables/{variableName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client VariableClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client VariableClient) CreateOrUpdateResponder(resp *http.Response) (result Variable, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete delete the variable. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// variableName - the name of variable. +func (client VariableClient) Delete(ctx context.Context, resourceGroupName string, automationAccountName string, variableName string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.VariableClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, automationAccountName, variableName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.VariableClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "automation.VariableClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.VariableClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client VariableClient) DeletePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, variableName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "variableName": autorest.Encode("path", variableName), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/variables/{variableName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client VariableClient) DeleteSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client VariableClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get retrieve the variable identified by variable name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// variableName - the name of variable. +func (client VariableClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, variableName string) (result Variable, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.VariableClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, variableName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.VariableClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.VariableClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.VariableClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client VariableClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, variableName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "variableName": autorest.Encode("path", variableName), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/variables/{variableName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client VariableClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client VariableClient) GetResponder(resp *http.Response) (result Variable, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByAutomationAccount retrieve a list of variables. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +func (client VariableClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string) (result VariableListResultPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.VariableClient", "ListByAutomationAccount", err.Error()) + } + + result.fn = client.listByAutomationAccountNextResults + req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.VariableClient", "ListByAutomationAccount", nil, "Failure preparing request") + return + } + + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.vlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.VariableClient", "ListByAutomationAccount", resp, "Failure sending request") + return + } + + result.vlr, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.VariableClient", "ListByAutomationAccount", resp, "Failure responding to request") + } + + return +} + +// ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. +func (client VariableClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/variables", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByAutomationAccountSender sends the ListByAutomationAccount request. The method will close the +// http.Response Body if it receives an error. +func (client VariableClient) ListByAutomationAccountSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByAutomationAccountResponder handles the response to the ListByAutomationAccount request. The method always +// closes the http.Response Body. +func (client VariableClient) ListByAutomationAccountResponder(resp *http.Response) (result VariableListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByAutomationAccountNextResults retrieves the next set of results, if any. +func (client VariableClient) listByAutomationAccountNextResults(lastResults VariableListResult) (result VariableListResult, err error) { + req, err := lastResults.variableListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "automation.VariableClient", "listByAutomationAccountNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "automation.VariableClient", "listByAutomationAccountNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.VariableClient", "listByAutomationAccountNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByAutomationAccountComplete enumerates all values, automatically crossing page boundaries as required. +func (client VariableClient) ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string) (result VariableListResultIterator, err error) { + result.page, err = client.ListByAutomationAccount(ctx, resourceGroupName, automationAccountName) + return +} + +// Update update a variable. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// variableName - the variable name. +// parameters - the parameters supplied to the update variable operation. +func (client VariableClient) Update(ctx context.Context, resourceGroupName string, automationAccountName string, variableName string, parameters VariableUpdateParameters) (result Variable, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.VariableClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, automationAccountName, variableName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.VariableClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.VariableClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.VariableClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client VariableClient) UpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, variableName string, parameters VariableUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "variableName": autorest.Encode("path", variableName), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/variables/{variableName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client VariableClient) UpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client VariableClient) UpdateResponder(resp *http.Response) (result Variable, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/version.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/version.go new file mode 100644 index 000000000..e86317c7b --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/version.go @@ -0,0 +1,30 @@ +package automation + +import "github.com/Azure/azure-sdk-for-go/version" + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// UserAgent returns the UserAgent string to use when sending http.Requests. +func UserAgent() string { + return "Azure-SDK-For-Go/" + version.Number + " automation/2018-01-preview" +} + +// Version returns the semantic version (see http://semver.org) of the client. +func Version() string { + return version.Number +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/watcher.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/watcher.go new file mode 100644 index 000000000..0039c8775 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/watcher.go @@ -0,0 +1,613 @@ +package automation + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// WatcherClient is the automation Client +type WatcherClient struct { + BaseClient +} + +// NewWatcherClient creates an instance of the WatcherClient client. +func NewWatcherClient(subscriptionID string, countType1 CountType) WatcherClient { + return NewWatcherClientWithBaseURI(DefaultBaseURI, subscriptionID, countType1) +} + +// NewWatcherClientWithBaseURI creates an instance of the WatcherClient client. +func NewWatcherClientWithBaseURI(baseURI string, subscriptionID string, countType1 CountType) WatcherClient { + return WatcherClient{NewWithBaseURI(baseURI, subscriptionID, countType1)} +} + +// CreateOrUpdate create the watcher identified by watcher name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// watcherName - the watcher name. +// parameters - the create or update parameters for watcher. +func (client WatcherClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, automationAccountName string, watcherName string, parameters Watcher) (result Watcher, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.WatcherClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, automationAccountName, watcherName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.WatcherClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.WatcherClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.WatcherClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client WatcherClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, watcherName string, parameters Watcher) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "watcherName": autorest.Encode("path", watcherName), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/watchers/{watcherName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client WatcherClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client WatcherClient) CreateOrUpdateResponder(resp *http.Response) (result Watcher, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete delete the watcher by name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// watcherName - the watcher name. +func (client WatcherClient) Delete(ctx context.Context, resourceGroupName string, automationAccountName string, watcherName string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.WatcherClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, automationAccountName, watcherName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.WatcherClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "automation.WatcherClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.WatcherClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client WatcherClient) DeletePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, watcherName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "watcherName": autorest.Encode("path", watcherName), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/watchers/{watcherName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client WatcherClient) DeleteSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client WatcherClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get retrieve the watcher identified by watcher name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// watcherName - the watcher name. +func (client WatcherClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, watcherName string) (result Watcher, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.WatcherClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, watcherName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.WatcherClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.WatcherClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.WatcherClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client WatcherClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, watcherName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "watcherName": autorest.Encode("path", watcherName), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/watchers/{watcherName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client WatcherClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client WatcherClient) GetResponder(resp *http.Response) (result Watcher, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByAutomationAccount retrieve a list of watchers. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// filter - the filter to apply on the operation. +func (client WatcherClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (result WatcherListResultPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.WatcherClient", "ListByAutomationAccount", err.Error()) + } + + result.fn = client.listByAutomationAccountNextResults + req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.WatcherClient", "ListByAutomationAccount", nil, "Failure preparing request") + return + } + + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.wlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.WatcherClient", "ListByAutomationAccount", resp, "Failure sending request") + return + } + + result.wlr, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.WatcherClient", "ListByAutomationAccount", resp, "Failure responding to request") + } + + return +} + +// ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. +func (client WatcherClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/watchers", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByAutomationAccountSender sends the ListByAutomationAccount request. The method will close the +// http.Response Body if it receives an error. +func (client WatcherClient) ListByAutomationAccountSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByAutomationAccountResponder handles the response to the ListByAutomationAccount request. The method always +// closes the http.Response Body. +func (client WatcherClient) ListByAutomationAccountResponder(resp *http.Response) (result WatcherListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByAutomationAccountNextResults retrieves the next set of results, if any. +func (client WatcherClient) listByAutomationAccountNextResults(lastResults WatcherListResult) (result WatcherListResult, err error) { + req, err := lastResults.watcherListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "automation.WatcherClient", "listByAutomationAccountNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "automation.WatcherClient", "listByAutomationAccountNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.WatcherClient", "listByAutomationAccountNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByAutomationAccountComplete enumerates all values, automatically crossing page boundaries as required. +func (client WatcherClient) ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (result WatcherListResultIterator, err error) { + result.page, err = client.ListByAutomationAccount(ctx, resourceGroupName, automationAccountName, filter) + return +} + +// Start resume the watcher identified by watcher name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// watcherName - the watcher name. +func (client WatcherClient) Start(ctx context.Context, resourceGroupName string, automationAccountName string, watcherName string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.WatcherClient", "Start", err.Error()) + } + + req, err := client.StartPreparer(ctx, resourceGroupName, automationAccountName, watcherName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.WatcherClient", "Start", nil, "Failure preparing request") + return + } + + resp, err := client.StartSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "automation.WatcherClient", "Start", resp, "Failure sending request") + return + } + + result, err = client.StartResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.WatcherClient", "Start", resp, "Failure responding to request") + } + + return +} + +// StartPreparer prepares the Start request. +func (client WatcherClient) StartPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, watcherName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "watcherName": autorest.Encode("path", watcherName), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/watchers/{watcherName}/start", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// StartSender sends the Start request. The method will close the +// http.Response Body if it receives an error. +func (client WatcherClient) StartSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// StartResponder handles the response to the Start request. The method always +// closes the http.Response Body. +func (client WatcherClient) StartResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Stop resume the watcher identified by watcher name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// watcherName - the watcher name. +func (client WatcherClient) Stop(ctx context.Context, resourceGroupName string, automationAccountName string, watcherName string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.WatcherClient", "Stop", err.Error()) + } + + req, err := client.StopPreparer(ctx, resourceGroupName, automationAccountName, watcherName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.WatcherClient", "Stop", nil, "Failure preparing request") + return + } + + resp, err := client.StopSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "automation.WatcherClient", "Stop", resp, "Failure sending request") + return + } + + result, err = client.StopResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.WatcherClient", "Stop", resp, "Failure responding to request") + } + + return +} + +// StopPreparer prepares the Stop request. +func (client WatcherClient) StopPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, watcherName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "watcherName": autorest.Encode("path", watcherName), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/watchers/{watcherName}/stop", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// StopSender sends the Stop request. The method will close the +// http.Response Body if it receives an error. +func (client WatcherClient) StopSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// StopResponder handles the response to the Stop request. The method always +// closes the http.Response Body. +func (client WatcherClient) StopResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Update update the watcher identified by watcher name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// watcherName - the watcher name. +// parameters - the update parameters for watcher. +func (client WatcherClient) Update(ctx context.Context, resourceGroupName string, automationAccountName string, watcherName string, parameters WatcherUpdateParameters) (result Watcher, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.WatcherClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, automationAccountName, watcherName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.WatcherClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.WatcherClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.WatcherClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client WatcherClient) UpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, watcherName string, parameters WatcherUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "watcherName": autorest.Encode("path", watcherName), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/watchers/{watcherName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client WatcherClient) UpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client WatcherClient) UpdateResponder(resp *http.Response) (result Watcher, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/webhook.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/webhook.go new file mode 100644 index 000000000..989daa4c5 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-01-preview/automation/webhook.go @@ -0,0 +1,539 @@ +package automation + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// WebhookClient is the automation Client +type WebhookClient struct { + BaseClient +} + +// NewWebhookClient creates an instance of the WebhookClient client. +func NewWebhookClient(subscriptionID string, countType1 CountType) WebhookClient { + return NewWebhookClientWithBaseURI(DefaultBaseURI, subscriptionID, countType1) +} + +// NewWebhookClientWithBaseURI creates an instance of the WebhookClient client. +func NewWebhookClientWithBaseURI(baseURI string, subscriptionID string, countType1 CountType) WebhookClient { + return WebhookClient{NewWithBaseURI(baseURI, subscriptionID, countType1)} +} + +// CreateOrUpdate create the webhook identified by webhook name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// webhookName - the webhook name. +// parameters - the create or update parameters for webhook. +func (client WebhookClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, automationAccountName string, webhookName string, parameters WebhookCreateOrUpdateParameters) (result Webhook, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.Name", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.WebhookCreateOrUpdateProperties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.WebhookClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, automationAccountName, webhookName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.WebhookClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.WebhookClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.WebhookClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client WebhookClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, webhookName string, parameters WebhookCreateOrUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "webhookName": autorest.Encode("path", webhookName), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/webhooks/{webhookName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client WebhookClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client WebhookClient) CreateOrUpdateResponder(resp *http.Response) (result Webhook, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete delete the webhook by name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// webhookName - the webhook name. +func (client WebhookClient) Delete(ctx context.Context, resourceGroupName string, automationAccountName string, webhookName string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.WebhookClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, automationAccountName, webhookName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.WebhookClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "automation.WebhookClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.WebhookClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client WebhookClient) DeletePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, webhookName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "webhookName": autorest.Encode("path", webhookName), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/webhooks/{webhookName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client WebhookClient) DeleteSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client WebhookClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// GenerateURI generates a Uri for use in creating a webhook. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +func (client WebhookClient) GenerateURI(ctx context.Context, resourceGroupName string, automationAccountName string) (result String, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.WebhookClient", "GenerateURI", err.Error()) + } + + req, err := client.GenerateURIPreparer(ctx, resourceGroupName, automationAccountName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.WebhookClient", "GenerateURI", nil, "Failure preparing request") + return + } + + resp, err := client.GenerateURISender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.WebhookClient", "GenerateURI", resp, "Failure sending request") + return + } + + result, err = client.GenerateURIResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.WebhookClient", "GenerateURI", resp, "Failure responding to request") + } + + return +} + +// GenerateURIPreparer prepares the GenerateURI request. +func (client WebhookClient) GenerateURIPreparer(ctx context.Context, resourceGroupName string, automationAccountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/webhooks/generateUri", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GenerateURISender sends the GenerateURI request. The method will close the +// http.Response Body if it receives an error. +func (client WebhookClient) GenerateURISender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GenerateURIResponder handles the response to the GenerateURI request. The method always +// closes the http.Response Body. +func (client WebhookClient) GenerateURIResponder(resp *http.Response) (result String, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get retrieve the webhook identified by webhook name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// webhookName - the webhook name. +func (client WebhookClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, webhookName string) (result Webhook, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.WebhookClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, webhookName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.WebhookClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.WebhookClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.WebhookClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client WebhookClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, webhookName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "webhookName": autorest.Encode("path", webhookName), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/webhooks/{webhookName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client WebhookClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client WebhookClient) GetResponder(resp *http.Response) (result Webhook, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByAutomationAccount retrieve a list of webhooks. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// filter - the filter to apply on the operation. +func (client WebhookClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (result WebhookListResultPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.WebhookClient", "ListByAutomationAccount", err.Error()) + } + + result.fn = client.listByAutomationAccountNextResults + req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.WebhookClient", "ListByAutomationAccount", nil, "Failure preparing request") + return + } + + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.wlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.WebhookClient", "ListByAutomationAccount", resp, "Failure sending request") + return + } + + result.wlr, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.WebhookClient", "ListByAutomationAccount", resp, "Failure responding to request") + } + + return +} + +// ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. +func (client WebhookClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/webhooks", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByAutomationAccountSender sends the ListByAutomationAccount request. The method will close the +// http.Response Body if it receives an error. +func (client WebhookClient) ListByAutomationAccountSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByAutomationAccountResponder handles the response to the ListByAutomationAccount request. The method always +// closes the http.Response Body. +func (client WebhookClient) ListByAutomationAccountResponder(resp *http.Response) (result WebhookListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByAutomationAccountNextResults retrieves the next set of results, if any. +func (client WebhookClient) listByAutomationAccountNextResults(lastResults WebhookListResult) (result WebhookListResult, err error) { + req, err := lastResults.webhookListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "automation.WebhookClient", "listByAutomationAccountNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "automation.WebhookClient", "listByAutomationAccountNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.WebhookClient", "listByAutomationAccountNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByAutomationAccountComplete enumerates all values, automatically crossing page boundaries as required. +func (client WebhookClient) ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (result WebhookListResultIterator, err error) { + result.page, err = client.ListByAutomationAccount(ctx, resourceGroupName, automationAccountName, filter) + return +} + +// Update update the webhook identified by webhook name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// webhookName - the webhook name. +// parameters - the update parameters for webhook. +func (client WebhookClient) Update(ctx context.Context, resourceGroupName string, automationAccountName string, webhookName string, parameters WebhookUpdateParameters) (result Webhook, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.WebhookClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, automationAccountName, webhookName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.WebhookClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.WebhookClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.WebhookClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client WebhookClient) UpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, webhookName string, parameters WebhookUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "webhookName": autorest.Encode("path", webhookName), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/webhooks/{webhookName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client WebhookClient) UpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client WebhookClient) UpdateResponder(resp *http.Response) (result Webhook, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/batchai/mgmt/2017-09-preview/batchai/clusters.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/batchai/mgmt/2017-09-preview/batchai/clusters.go index c5868da8e..de3cb5459 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/batchai/mgmt/2017-09-preview/batchai/clusters.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/batchai/mgmt/2017-09-preview/batchai/clusters.go @@ -326,7 +326,7 @@ func (client ClustersClient) List(ctx context.Context, filter string, selectPara if err := validation.Validate([]validation.Validation{ {TargetValue: maxResults, Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, + Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: int64(1000), Chain: nil}, {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("batchai.ClustersClient", "List", err.Error()) @@ -443,7 +443,7 @@ func (client ClustersClient) ListByResourceGroup(ctx context.Context, resourceGr Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, {TargetValue: maxResults, Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, + Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: int64(1000), Chain: nil}, {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("batchai.ClustersClient", "ListByResourceGroup", err.Error()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/batchai/mgmt/2017-09-preview/batchai/fileservers.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/batchai/mgmt/2017-09-preview/batchai/fileservers.go index bc5a2c8a2..b25975d64 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/batchai/mgmt/2017-09-preview/batchai/fileservers.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/batchai/mgmt/2017-09-preview/batchai/fileservers.go @@ -312,7 +312,7 @@ func (client FileServersClient) List(ctx context.Context, filter string, selectP if err := validation.Validate([]validation.Validation{ {TargetValue: maxResults, Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, + Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: int64(1000), Chain: nil}, {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("batchai.FileServersClient", "List", err.Error()) @@ -430,7 +430,7 @@ func (client FileServersClient) ListByResourceGroup(ctx context.Context, resourc Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, {TargetValue: maxResults, Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, + Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: int64(1000), Chain: nil}, {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("batchai.FileServersClient", "ListByResourceGroup", err.Error()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/batchai/mgmt/2017-09-preview/batchai/jobs.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/batchai/mgmt/2017-09-preview/batchai/jobs.go index 8e7cd2acc..305449c67 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/batchai/mgmt/2017-09-preview/batchai/jobs.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/batchai/mgmt/2017-09-preview/batchai/jobs.go @@ -327,7 +327,7 @@ func (client JobsClient) List(ctx context.Context, filter string, selectParamete if err := validation.Validate([]validation.Validation{ {TargetValue: maxResults, Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, + Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: int64(1000), Chain: nil}, {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("batchai.JobsClient", "List", err.Error()) @@ -444,7 +444,7 @@ func (client JobsClient) ListByResourceGroup(ctx context.Context, resourceGroupN Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, {TargetValue: maxResults, Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, + Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: int64(1000), Chain: nil}, {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("batchai.JobsClient", "ListByResourceGroup", err.Error()) @@ -571,12 +571,12 @@ func (client JobsClient) ListOutputFiles(ctx context.Context, resourceGroupName {Target: "jobName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, {TargetValue: linkexpiryinminutes, Constraints: []validation.Constraint{{Target: "linkexpiryinminutes", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "linkexpiryinminutes", Name: validation.InclusiveMaximum, Rule: 600, Chain: nil}, + Chain: []validation.Constraint{{Target: "linkexpiryinminutes", Name: validation.InclusiveMaximum, Rule: int64(600), Chain: nil}, {Target: "linkexpiryinminutes", Name: validation.InclusiveMinimum, Rule: 5, Chain: nil}, }}}}, {TargetValue: maxResults, Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, + Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: int64(1000), Chain: nil}, {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("batchai.JobsClient", "ListOutputFiles", err.Error()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/billing/mgmt/2017-02-27-preview/billing/invoices.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/billing/mgmt/2017-02-27-preview/billing/invoices.go index 88d5b65a4..931bab183 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/billing/mgmt/2017-02-27-preview/billing/invoices.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/billing/mgmt/2017-02-27-preview/billing/invoices.go @@ -188,7 +188,7 @@ func (client InvoicesClient) List(ctx context.Context, expand string, filter str if err := validation.Validate([]validation.Validation{ {TargetValue: top, Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: 100, Chain: nil}, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: int64(100), Chain: nil}, {Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("billing.InvoicesClient", "List", err.Error()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/billing/mgmt/2017-04-24-preview/billing/invoices.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/billing/mgmt/2017-04-24-preview/billing/invoices.go index a47bd9a05..fb800ece8 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/billing/mgmt/2017-04-24-preview/billing/invoices.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/billing/mgmt/2017-04-24-preview/billing/invoices.go @@ -188,7 +188,7 @@ func (client InvoicesClient) List(ctx context.Context, expand string, filter str if err := validation.Validate([]validation.Validation{ {TargetValue: top, Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: 100, Chain: nil}, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: int64(100), Chain: nil}, {Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("billing.InvoicesClient", "List", err.Error()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/billing/mgmt/2017-04-24-preview/billing/periods.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/billing/mgmt/2017-04-24-preview/billing/periods.go index a2c993c1e..9976cd1ed 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/billing/mgmt/2017-04-24-preview/billing/periods.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/billing/mgmt/2017-04-24-preview/billing/periods.go @@ -119,7 +119,7 @@ func (client PeriodsClient) List(ctx context.Context, filter string, skiptoken s if err := validation.Validate([]validation.Validation{ {TargetValue: top, Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: 100, Chain: nil}, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: int64(100), Chain: nil}, {Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("billing.PeriodsClient", "List", err.Error()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/billing/mgmt/2018-03-01-preview/billing/invoices.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/billing/mgmt/2018-03-01-preview/billing/invoices.go index 30fd138bf..b4bd4b245 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/billing/mgmt/2018-03-01-preview/billing/invoices.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/billing/mgmt/2018-03-01-preview/billing/invoices.go @@ -189,7 +189,7 @@ func (client InvoicesClient) List(ctx context.Context, expand string, filter str if err := validation.Validate([]validation.Validation{ {TargetValue: top, Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: 100, Chain: nil}, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: int64(100), Chain: nil}, {Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("billing.InvoicesClient", "List", err.Error()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/billing/mgmt/2018-03-01-preview/billing/periods.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/billing/mgmt/2018-03-01-preview/billing/periods.go index 273fbeb74..854873dfc 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/billing/mgmt/2018-03-01-preview/billing/periods.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/billing/mgmt/2018-03-01-preview/billing/periods.go @@ -120,7 +120,7 @@ func (client PeriodsClient) List(ctx context.Context, filter string, skiptoken s if err := validation.Validate([]validation.Validation{ {TargetValue: top, Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: 100, Chain: nil}, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: int64(100), Chain: nil}, {Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("billing.PeriodsClient", "List", err.Error()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/consumption/mgmt/2017-04-24-preview/consumption/usagedetails.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/consumption/mgmt/2017-04-24-preview/consumption/usagedetails.go index af16406cd..6c82be69e 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/consumption/mgmt/2017-04-24-preview/consumption/usagedetails.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/consumption/mgmt/2017-04-24-preview/consumption/usagedetails.go @@ -61,7 +61,7 @@ func (client UsageDetailsClient) List(ctx context.Context, scope string, expand if err := validation.Validate([]validation.Validation{ {TargetValue: top, Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: int64(1000), Chain: nil}, {Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("consumption.UsageDetailsClient", "List", err.Error()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2018-02-01/containerregistry/buildtasks.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2018-02-01/containerregistry/buildtasks.go index 9f19b88da..73acc26b1 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2018-02-01/containerregistry/buildtasks.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2018-02-01/containerregistry/buildtasks.go @@ -66,7 +66,7 @@ func (client BuildTasksClient) Create(ctx context.Context, resourceGroupName str }}, {Target: "buildTaskCreateParameters.BuildTaskProperties.Platform", Name: validation.Null, Rule: true, Chain: nil}, {Target: "buildTaskCreateParameters.BuildTaskProperties.Timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "buildTaskCreateParameters.BuildTaskProperties.Timeout", Name: validation.InclusiveMaximum, Rule: 28800, Chain: nil}, + Chain: []validation.Constraint{{Target: "buildTaskCreateParameters.BuildTaskProperties.Timeout", Name: validation.InclusiveMaximum, Rule: int64(28800), Chain: nil}, {Target: "buildTaskCreateParameters.BuildTaskProperties.Timeout", Name: validation.InclusiveMinimum, Rule: 300, Chain: nil}, }}, }}}}}); err != nil { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2018-02-01/containerregistry/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2018-02-01/containerregistry/models.go index fb0ecdbdd..5aeec2f32 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2018-02-01/containerregistry/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2018-02-01/containerregistry/models.go @@ -573,8 +573,8 @@ type BuildFilter struct { CreateTime *date.Time `json:"createTime,omitempty"` // FinishTime - The time the build finished. FinishTime *date.Time `json:"finishTime,omitempty"` - // OutputImageNames - The list of all images that were generated from the build. - OutputImageNames *[]string `json:"outputImageNames,omitempty"` + // OutputImageManifests - The list of comma-separated image manifests that were generated from the build. + OutputImageManifests *string `json:"outputImageManifests,omitempty"` // IsArchiveEnabled - The value that indicates whether archiving is enabled or not. IsArchiveEnabled *bool `json:"isArchiveEnabled,omitempty"` // BuildTaskName - The name of the build task that the build corresponds to. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/devspaces/mgmt/2018-06-01-preview/devspaces/client.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/devspaces/mgmt/2018-06-01-preview/devspaces/client.go new file mode 100644 index 000000000..ee2fccaf0 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/devspaces/mgmt/2018-06-01-preview/devspaces/client.go @@ -0,0 +1,51 @@ +// Package devspaces implements the Azure ARM Devspaces service API version 2018-06-01-preview. +// +// Dev Spaces Client +package devspaces + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/Azure/go-autorest/autorest" +) + +const ( + // DefaultBaseURI is the default URI used for the service Devspaces + DefaultBaseURI = "https://management.azure.com" +) + +// BaseClient is the base client for Devspaces. +type BaseClient struct { + autorest.Client + BaseURI string + SubscriptionID string +} + +// New creates an instance of the BaseClient client. +func New(subscriptionID string) BaseClient { + return NewWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewWithBaseURI creates an instance of the BaseClient client. +func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { + return BaseClient{ + Client: autorest.NewClientWithUserAgent(UserAgent()), + BaseURI: baseURI, + SubscriptionID: subscriptionID, + } +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/devspaces/mgmt/2018-06-01-preview/devspaces/controllers.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/devspaces/mgmt/2018-06-01-preview/devspaces/controllers.go new file mode 100644 index 000000000..dba3f1574 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/devspaces/mgmt/2018-06-01-preview/devspaces/controllers.go @@ -0,0 +1,643 @@ +package devspaces + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// ControllersClient is the dev Spaces Client +type ControllersClient struct { + BaseClient +} + +// NewControllersClient creates an instance of the ControllersClient client. +func NewControllersClient(subscriptionID string) ControllersClient { + return NewControllersClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewControllersClientWithBaseURI creates an instance of the ControllersClient client. +func NewControllersClientWithBaseURI(baseURI string, subscriptionID string) ControllersClient { + return ControllersClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Create creates an Azure Dev Spaces Controller with the specified create parameters. +// Parameters: +// resourceGroupName - resource group to which the resource belongs. +// name - name of the resource. +// controller - controller create parameters. +func (client ControllersClient) Create(ctx context.Context, resourceGroupName string, name string, controller Controller) (result ControllersCreateFuture, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: name, + Constraints: []validation.Constraint{{Target: "name", Name: validation.MaxLength, Rule: 31, Chain: nil}, + {Target: "name", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "name", Name: validation.Pattern, Rule: `^[a-zA-Z0-9](-?[a-zA-Z0-9])*$`, Chain: nil}}}, + {TargetValue: controller, + Constraints: []validation.Constraint{{Target: "controller.ControllerProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "controller.ControllerProperties.HostSuffix", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "controller.ControllerProperties.TargetContainerHostResourceID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "controller.ControllerProperties.TargetContainerHostCredentialsBase64", Name: validation.Null, Rule: true, Chain: nil}, + }}, + {Target: "controller.Sku", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "controller.Sku.Name", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("devspaces.ControllersClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, resourceGroupName, name, controller) + if err != nil { + err = autorest.NewErrorWithError(err, "devspaces.ControllersClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "devspaces.ControllersClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ControllersClient) CreatePreparer(ctx context.Context, resourceGroupName string, name string, controller Controller) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevSpaces/controllers/{name}", pathParameters), + autorest.WithJSON(controller), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ControllersClient) CreateSender(req *http.Request) (future ControllersCreateFuture, err error) { + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ControllersClient) CreateResponder(resp *http.Response) (result Controller, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes an existing Azure Dev Spaces Controller. +// Parameters: +// resourceGroupName - resource group to which the resource belongs. +// name - name of the resource. +func (client ControllersClient) Delete(ctx context.Context, resourceGroupName string, name string) (result ControllersDeleteFuture, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: name, + Constraints: []validation.Constraint{{Target: "name", Name: validation.MaxLength, Rule: 31, Chain: nil}, + {Target: "name", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "name", Name: validation.Pattern, Rule: `^[a-zA-Z0-9](-?[a-zA-Z0-9])*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("devspaces.ControllersClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "devspaces.ControllersClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "devspaces.ControllersClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ControllersClient) DeletePreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevSpaces/controllers/{name}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ControllersClient) DeleteSender(req *http.Request) (future ControllersDeleteFuture, err error) { + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ControllersClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the properties for an Azure Dev Spaces Controller. +// Parameters: +// resourceGroupName - resource group to which the resource belongs. +// name - name of the resource. +func (client ControllersClient) Get(ctx context.Context, resourceGroupName string, name string) (result Controller, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: name, + Constraints: []validation.Constraint{{Target: "name", Name: validation.MaxLength, Rule: 31, Chain: nil}, + {Target: "name", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "name", Name: validation.Pattern, Rule: `^[a-zA-Z0-9](-?[a-zA-Z0-9])*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("devspaces.ControllersClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "devspaces.ControllersClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "devspaces.ControllersClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "devspaces.ControllersClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client ControllersClient) GetPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevSpaces/controllers/{name}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ControllersClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ControllersClient) GetResponder(resp *http.Response) (result Controller, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists all the Azure Dev Spaces Controllers with their properties in the subscription. +func (client ControllersClient) List(ctx context.Context) (result ControllerListPage, err error) { + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "devspaces.ControllersClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.cl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "devspaces.ControllersClient", "List", resp, "Failure sending request") + return + } + + result.cl, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "devspaces.ControllersClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client ControllersClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.DevSpaces/controllers", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ControllersClient) ListSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ControllersClient) ListResponder(resp *http.Response) (result ControllerList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ControllersClient) listNextResults(lastResults ControllerList) (result ControllerList, err error) { + req, err := lastResults.controllerListPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "devspaces.ControllersClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "devspaces.ControllersClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "devspaces.ControllersClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ControllersClient) ListComplete(ctx context.Context) (result ControllerListIterator, err error) { + result.page, err = client.List(ctx) + return +} + +// ListByResourceGroup lists all the Azure Dev Spaces Controllers with their properties in the specified resource group +// and subscription. +// Parameters: +// resourceGroupName - resource group to which the resource belongs. +func (client ControllersClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result ControllerListPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("devspaces.ControllersClient", "ListByResourceGroup", err.Error()) + } + + result.fn = client.listByResourceGroupNextResults + req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "devspaces.ControllersClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.cl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "devspaces.ControllersClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result.cl, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "devspaces.ControllersClient", "ListByResourceGroup", resp, "Failure responding to request") + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client ControllersClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevSpaces/controllers", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the +// http.Response Body if it receives an error. +func (client ControllersClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always +// closes the http.Response Body. +func (client ControllersClient) ListByResourceGroupResponder(resp *http.Response) (result ControllerList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByResourceGroupNextResults retrieves the next set of results, if any. +func (client ControllersClient) listByResourceGroupNextResults(lastResults ControllerList) (result ControllerList, err error) { + req, err := lastResults.controllerListPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "devspaces.ControllersClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "devspaces.ControllersClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "devspaces.ControllersClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client ControllersClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result ControllerListIterator, err error) { + result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) + return +} + +// ListConnectionDetails lists connection details for the underlying container resources of an Azure Dev Spaces +// Controller. +// Parameters: +// resourceGroupName - resource group to which the resource belongs. +// name - name of the resource. +func (client ControllersClient) ListConnectionDetails(ctx context.Context, resourceGroupName string, name string) (result ControllerConnectionDetailsList, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: name, + Constraints: []validation.Constraint{{Target: "name", Name: validation.MaxLength, Rule: 31, Chain: nil}, + {Target: "name", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "name", Name: validation.Pattern, Rule: `^[a-zA-Z0-9](-?[a-zA-Z0-9])*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("devspaces.ControllersClient", "ListConnectionDetails", err.Error()) + } + + req, err := client.ListConnectionDetailsPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "devspaces.ControllersClient", "ListConnectionDetails", nil, "Failure preparing request") + return + } + + resp, err := client.ListConnectionDetailsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "devspaces.ControllersClient", "ListConnectionDetails", resp, "Failure sending request") + return + } + + result, err = client.ListConnectionDetailsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "devspaces.ControllersClient", "ListConnectionDetails", resp, "Failure responding to request") + } + + return +} + +// ListConnectionDetailsPreparer prepares the ListConnectionDetails request. +func (client ControllersClient) ListConnectionDetailsPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevSpaces/controllers/{name}/listConnectionDetails", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListConnectionDetailsSender sends the ListConnectionDetails request. The method will close the +// http.Response Body if it receives an error. +func (client ControllersClient) ListConnectionDetailsSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListConnectionDetailsResponder handles the response to the ListConnectionDetails request. The method always +// closes the http.Response Body. +func (client ControllersClient) ListConnectionDetailsResponder(resp *http.Response) (result ControllerConnectionDetailsList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Update updates the properties of an existing Azure Dev Spaces Controller with the specified update parameters. +// Parameters: +// resourceGroupName - resource group to which the resource belongs. +// name - name of the resource. +func (client ControllersClient) Update(ctx context.Context, resourceGroupName string, name string, controllerUpdateParameters ControllerUpdateParameters) (result Controller, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: name, + Constraints: []validation.Constraint{{Target: "name", Name: validation.MaxLength, Rule: 31, Chain: nil}, + {Target: "name", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "name", Name: validation.Pattern, Rule: `^[a-zA-Z0-9](-?[a-zA-Z0-9])*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("devspaces.ControllersClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, name, controllerUpdateParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "devspaces.ControllersClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "devspaces.ControllersClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "devspaces.ControllersClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client ControllersClient) UpdatePreparer(ctx context.Context, resourceGroupName string, name string, controllerUpdateParameters ControllerUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevSpaces/controllers/{name}", pathParameters), + autorest.WithJSON(controllerUpdateParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client ControllersClient) UpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client ControllersClient) UpdateResponder(resp *http.Response) (result Controller, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/devspaces/mgmt/2018-06-01-preview/devspaces/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/devspaces/mgmt/2018-06-01-preview/devspaces/models.go new file mode 100644 index 000000000..33603b57a --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/devspaces/mgmt/2018-06-01-preview/devspaces/models.go @@ -0,0 +1,750 @@ +package devspaces + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "encoding/json" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/to" + "net/http" +) + +// InstanceType enumerates the values for instance type. +type InstanceType string + +const ( + // InstanceTypeKubernetes ... + InstanceTypeKubernetes InstanceType = "Kubernetes" + // InstanceTypeOrchestratorSpecificConnectionDetails ... + InstanceTypeOrchestratorSpecificConnectionDetails InstanceType = "OrchestratorSpecificConnectionDetails" +) + +// PossibleInstanceTypeValues returns an array of possible values for the InstanceType const type. +func PossibleInstanceTypeValues() []InstanceType { + return []InstanceType{InstanceTypeKubernetes, InstanceTypeOrchestratorSpecificConnectionDetails} +} + +// ProvisioningState enumerates the values for provisioning state. +type ProvisioningState string + +const ( + // Canceled ... + Canceled ProvisioningState = "Canceled" + // Creating ... + Creating ProvisioningState = "Creating" + // Deleting ... + Deleting ProvisioningState = "Deleting" + // Failed ... + Failed ProvisioningState = "Failed" + // Succeeded ... + Succeeded ProvisioningState = "Succeeded" + // Updating ... + Updating ProvisioningState = "Updating" +) + +// PossibleProvisioningStateValues returns an array of possible values for the ProvisioningState const type. +func PossibleProvisioningStateValues() []ProvisioningState { + return []ProvisioningState{Canceled, Creating, Deleting, Failed, Succeeded, Updating} +} + +// SkuTier enumerates the values for sku tier. +type SkuTier string + +const ( + // Standard ... + Standard SkuTier = "Standard" +) + +// PossibleSkuTierValues returns an array of possible values for the SkuTier const type. +func PossibleSkuTierValues() []SkuTier { + return []SkuTier{Standard} +} + +// Controller ... +type Controller struct { + autorest.Response `json:"-"` + *ControllerProperties `json:"properties,omitempty"` + Sku *Sku `json:"sku,omitempty"` + // Tags - Tags for the Azure resource. + Tags map[string]*string `json:"tags"` + // Location - Region where the Azure resource is located. + Location *string `json:"location,omitempty"` + // ID - Fully qualified resource Id for the resource. + ID *string `json:"id,omitempty"` + // Name - The name of the resource. + Name *string `json:"name,omitempty"` + // Type - The type of the resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Controller. +func (c Controller) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if c.ControllerProperties != nil { + objectMap["properties"] = c.ControllerProperties + } + if c.Sku != nil { + objectMap["sku"] = c.Sku + } + if c.Tags != nil { + objectMap["tags"] = c.Tags + } + if c.Location != nil { + objectMap["location"] = c.Location + } + if c.ID != nil { + objectMap["id"] = c.ID + } + if c.Name != nil { + objectMap["name"] = c.Name + } + if c.Type != nil { + objectMap["type"] = c.Type + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Controller struct. +func (c *Controller) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var controllerProperties ControllerProperties + err = json.Unmarshal(*v, &controllerProperties) + if err != nil { + return err + } + c.ControllerProperties = &controllerProperties + } + case "sku": + if v != nil { + var sku Sku + err = json.Unmarshal(*v, &sku) + if err != nil { + return err + } + c.Sku = &sku + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + c.Tags = tags + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + c.Location = &location + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + c.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + c.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + c.Type = &typeVar + } + } + } + + return nil +} + +// ControllerConnectionDetails ... +type ControllerConnectionDetails struct { + // AuthKey - Authentication key for communicating with services. + AuthKey *string `json:"authKey,omitempty"` + // WorkspaceStorageAccountName - Workspace storage account name. + WorkspaceStorageAccountName *string `json:"workspaceStorageAccountName,omitempty"` + // WorkspaceStorageSasToken - Workspace storage account SAS token. + WorkspaceStorageSasToken *string `json:"workspaceStorageSasToken,omitempty"` + OrchestratorSpecificConnectionDetails BasicOrchestratorSpecificConnectionDetails `json:"orchestratorSpecificConnectionDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for ControllerConnectionDetails struct. +func (ccd *ControllerConnectionDetails) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "authKey": + if v != nil { + var authKey string + err = json.Unmarshal(*v, &authKey) + if err != nil { + return err + } + ccd.AuthKey = &authKey + } + case "workspaceStorageAccountName": + if v != nil { + var workspaceStorageAccountName string + err = json.Unmarshal(*v, &workspaceStorageAccountName) + if err != nil { + return err + } + ccd.WorkspaceStorageAccountName = &workspaceStorageAccountName + } + case "workspaceStorageSasToken": + if v != nil { + var workspaceStorageSasToken string + err = json.Unmarshal(*v, &workspaceStorageSasToken) + if err != nil { + return err + } + ccd.WorkspaceStorageSasToken = &workspaceStorageSasToken + } + case "orchestratorSpecificConnectionDetails": + if v != nil { + orchestratorSpecificConnectionDetails, err := unmarshalBasicOrchestratorSpecificConnectionDetails(*v) + if err != nil { + return err + } + ccd.OrchestratorSpecificConnectionDetails = orchestratorSpecificConnectionDetails + } + } + } + + return nil +} + +// ControllerConnectionDetailsList ... +type ControllerConnectionDetailsList struct { + autorest.Response `json:"-"` + // ConnectionDetailsList - List of Azure Dev Spaces Controller connection details. + ConnectionDetailsList *[]ControllerConnectionDetails `json:"connectionDetailsList,omitempty"` +} + +// ControllerList ... +type ControllerList struct { + autorest.Response `json:"-"` + // Value - List of Azure Dev Spaces Controllers. + Value *[]Controller `json:"value,omitempty"` + // NextLink - The URI that can be used to request the next page for list of Azure Dev Spaces Controllers. + NextLink *string `json:"nextLink,omitempty"` +} + +// ControllerListIterator provides access to a complete listing of Controller values. +type ControllerListIterator struct { + i int + page ControllerListPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ControllerListIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ControllerListIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ControllerListIterator) Response() ControllerList { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ControllerListIterator) Value() Controller { + if !iter.page.NotDone() { + return Controller{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (cl ControllerList) IsEmpty() bool { + return cl.Value == nil || len(*cl.Value) == 0 +} + +// controllerListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (cl ControllerList) controllerListPreparer() (*http.Request, error) { + if cl.NextLink == nil || len(to.String(cl.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(cl.NextLink))) +} + +// ControllerListPage contains a page of Controller values. +type ControllerListPage struct { + fn func(ControllerList) (ControllerList, error) + cl ControllerList +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ControllerListPage) Next() error { + next, err := page.fn(page.cl) + if err != nil { + return err + } + page.cl = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ControllerListPage) NotDone() bool { + return !page.cl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ControllerListPage) Response() ControllerList { + return page.cl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ControllerListPage) Values() []Controller { + if page.cl.IsEmpty() { + return nil + } + return *page.cl.Value +} + +// ControllerProperties ... +type ControllerProperties struct { + // ProvisioningState - Provisioning state of the Azure Dev Spaces Controller. Possible values include: 'Succeeded', 'Failed', 'Canceled', 'Updating', 'Creating', 'Deleting' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // HostSuffix - DNS suffix for public endpoints running in the Azure Dev Spaces Controller. + HostSuffix *string `json:"hostSuffix,omitempty"` + // DataPlaneFqdn - DNS name for accessing DataPlane services + DataPlaneFqdn *string `json:"dataPlaneFqdn,omitempty"` + // TargetContainerHostResourceID - Resource ID of the target container host + TargetContainerHostResourceID *string `json:"targetContainerHostResourceId,omitempty"` + // TargetContainerHostCredentialsBase64 - Credentials of the target container host (base64). + TargetContainerHostCredentialsBase64 *string `json:"targetContainerHostCredentialsBase64,omitempty"` +} + +// ControllersCreateFuture an abstraction for monitoring and retrieving the results of a long-running operation. +type ControllersCreateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ControllersCreateFuture) Result(client ControllersClient) (c Controller, err error) { + var done bool + done, err = future.Done(client) + if err != nil { + err = autorest.NewErrorWithError(err, "devspaces.ControllersCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("devspaces.ControllersCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if c.Response.Response, err = future.GetResult(sender); err == nil && c.Response.Response.StatusCode != http.StatusNoContent { + c, err = client.CreateResponder(c.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "devspaces.ControllersCreateFuture", "Result", c.Response.Response, "Failure responding to request") + } + } + return +} + +// ControllersDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. +type ControllersDeleteFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ControllersDeleteFuture) Result(client ControllersClient) (ar autorest.Response, err error) { + var done bool + done, err = future.Done(client) + if err != nil { + err = autorest.NewErrorWithError(err, "devspaces.ControllersDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("devspaces.ControllersDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ControllerUpdateParameters parameters for updating an Azure Dev Spaces Controller. +type ControllerUpdateParameters struct { + // Tags - Tags for the Azure Dev Spaces Controller. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for ControllerUpdateParameters. +func (cup ControllerUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cup.Tags != nil { + objectMap["tags"] = cup.Tags + } + return json.Marshal(objectMap) +} + +// ErrorDetails ... +type ErrorDetails struct { + // Code - Status code for the error. + Code *string `json:"code,omitempty"` + // Message - Error message describing the error in detail. + Message *string `json:"message,omitempty"` + // Target - The target of the particular error. + Target *string `json:"target,omitempty"` +} + +// ErrorResponse error response indicates that the service is not able to process the incoming request. The reason +// is provided in the error message. +type ErrorResponse struct { + // Error - The details of the error. + Error *ErrorDetails `json:"error,omitempty"` +} + +// KubernetesConnectionDetails ... +type KubernetesConnectionDetails struct { + // KubeConfig - Gets the kubeconfig for the cluster. + KubeConfig *string `json:"kubeConfig,omitempty"` + // InstanceType - Possible values include: 'InstanceTypeOrchestratorSpecificConnectionDetails', 'InstanceTypeKubernetes' + InstanceType InstanceType `json:"instanceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for KubernetesConnectionDetails. +func (kcd KubernetesConnectionDetails) MarshalJSON() ([]byte, error) { + kcd.InstanceType = InstanceTypeKubernetes + objectMap := make(map[string]interface{}) + if kcd.KubeConfig != nil { + objectMap["kubeConfig"] = kcd.KubeConfig + } + if kcd.InstanceType != "" { + objectMap["instanceType"] = kcd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsKubernetesConnectionDetails is the BasicOrchestratorSpecificConnectionDetails implementation for KubernetesConnectionDetails. +func (kcd KubernetesConnectionDetails) AsKubernetesConnectionDetails() (*KubernetesConnectionDetails, bool) { + return &kcd, true +} + +// AsOrchestratorSpecificConnectionDetails is the BasicOrchestratorSpecificConnectionDetails implementation for KubernetesConnectionDetails. +func (kcd KubernetesConnectionDetails) AsOrchestratorSpecificConnectionDetails() (*OrchestratorSpecificConnectionDetails, bool) { + return nil, false +} + +// AsBasicOrchestratorSpecificConnectionDetails is the BasicOrchestratorSpecificConnectionDetails implementation for KubernetesConnectionDetails. +func (kcd KubernetesConnectionDetails) AsBasicOrchestratorSpecificConnectionDetails() (BasicOrchestratorSpecificConnectionDetails, bool) { + return &kcd, true +} + +// BasicOrchestratorSpecificConnectionDetails ... +type BasicOrchestratorSpecificConnectionDetails interface { + AsKubernetesConnectionDetails() (*KubernetesConnectionDetails, bool) + AsOrchestratorSpecificConnectionDetails() (*OrchestratorSpecificConnectionDetails, bool) +} + +// OrchestratorSpecificConnectionDetails ... +type OrchestratorSpecificConnectionDetails struct { + // InstanceType - Possible values include: 'InstanceTypeOrchestratorSpecificConnectionDetails', 'InstanceTypeKubernetes' + InstanceType InstanceType `json:"instanceType,omitempty"` +} + +func unmarshalBasicOrchestratorSpecificConnectionDetails(body []byte) (BasicOrchestratorSpecificConnectionDetails, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["instanceType"] { + case string(InstanceTypeKubernetes): + var kcd KubernetesConnectionDetails + err := json.Unmarshal(body, &kcd) + return kcd, err + default: + var oscd OrchestratorSpecificConnectionDetails + err := json.Unmarshal(body, &oscd) + return oscd, err + } +} +func unmarshalBasicOrchestratorSpecificConnectionDetailsArray(body []byte) ([]BasicOrchestratorSpecificConnectionDetails, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + oscdArray := make([]BasicOrchestratorSpecificConnectionDetails, len(rawMessages)) + + for index, rawMessage := range rawMessages { + oscd, err := unmarshalBasicOrchestratorSpecificConnectionDetails(*rawMessage) + if err != nil { + return nil, err + } + oscdArray[index] = oscd + } + return oscdArray, nil +} + +// MarshalJSON is the custom marshaler for OrchestratorSpecificConnectionDetails. +func (oscd OrchestratorSpecificConnectionDetails) MarshalJSON() ([]byte, error) { + oscd.InstanceType = InstanceTypeOrchestratorSpecificConnectionDetails + objectMap := make(map[string]interface{}) + if oscd.InstanceType != "" { + objectMap["instanceType"] = oscd.InstanceType + } + return json.Marshal(objectMap) +} + +// AsKubernetesConnectionDetails is the BasicOrchestratorSpecificConnectionDetails implementation for OrchestratorSpecificConnectionDetails. +func (oscd OrchestratorSpecificConnectionDetails) AsKubernetesConnectionDetails() (*KubernetesConnectionDetails, bool) { + return nil, false +} + +// AsOrchestratorSpecificConnectionDetails is the BasicOrchestratorSpecificConnectionDetails implementation for OrchestratorSpecificConnectionDetails. +func (oscd OrchestratorSpecificConnectionDetails) AsOrchestratorSpecificConnectionDetails() (*OrchestratorSpecificConnectionDetails, bool) { + return &oscd, true +} + +// AsBasicOrchestratorSpecificConnectionDetails is the BasicOrchestratorSpecificConnectionDetails implementation for OrchestratorSpecificConnectionDetails. +func (oscd OrchestratorSpecificConnectionDetails) AsBasicOrchestratorSpecificConnectionDetails() (BasicOrchestratorSpecificConnectionDetails, bool) { + return &oscd, true +} + +// Resource an Azure resource. +type Resource struct { + // ID - Fully qualified resource Id for the resource. + ID *string `json:"id,omitempty"` + // Name - The name of the resource. + Name *string `json:"name,omitempty"` + // Type - The type of the resource. + Type *string `json:"type,omitempty"` +} + +// ResourceProviderOperationDefinition ... +type ResourceProviderOperationDefinition struct { + // Name - Resource provider operation name. + Name *string `json:"name,omitempty"` + Display *ResourceProviderOperationDisplay `json:"display,omitempty"` +} + +// ResourceProviderOperationDisplay ... +type ResourceProviderOperationDisplay struct { + // Provider - Name of the resource provider. + Provider *string `json:"provider,omitempty"` + // Resource - Name of the resource type. + Resource *string `json:"resource,omitempty"` + // Operation - Name of the resource provider operation. + Operation *string `json:"operation,omitempty"` + // Description - Description of the resource provider operation. + Description *string `json:"description,omitempty"` +} + +// ResourceProviderOperationList ... +type ResourceProviderOperationList struct { + autorest.Response `json:"-"` + // Value - Resource provider operations list. + Value *[]ResourceProviderOperationDefinition `json:"value,omitempty"` + // NextLink - The URI that can be used to request the next page for list of Azure operations. + NextLink *string `json:"nextLink,omitempty"` +} + +// ResourceProviderOperationListIterator provides access to a complete listing of +// ResourceProviderOperationDefinition values. +type ResourceProviderOperationListIterator struct { + i int + page ResourceProviderOperationListPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ResourceProviderOperationListIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ResourceProviderOperationListIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ResourceProviderOperationListIterator) Response() ResourceProviderOperationList { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ResourceProviderOperationListIterator) Value() ResourceProviderOperationDefinition { + if !iter.page.NotDone() { + return ResourceProviderOperationDefinition{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (rpol ResourceProviderOperationList) IsEmpty() bool { + return rpol.Value == nil || len(*rpol.Value) == 0 +} + +// resourceProviderOperationListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (rpol ResourceProviderOperationList) resourceProviderOperationListPreparer() (*http.Request, error) { + if rpol.NextLink == nil || len(to.String(rpol.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(rpol.NextLink))) +} + +// ResourceProviderOperationListPage contains a page of ResourceProviderOperationDefinition values. +type ResourceProviderOperationListPage struct { + fn func(ResourceProviderOperationList) (ResourceProviderOperationList, error) + rpol ResourceProviderOperationList +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ResourceProviderOperationListPage) Next() error { + next, err := page.fn(page.rpol) + if err != nil { + return err + } + page.rpol = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ResourceProviderOperationListPage) NotDone() bool { + return !page.rpol.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ResourceProviderOperationListPage) Response() ResourceProviderOperationList { + return page.rpol +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ResourceProviderOperationListPage) Values() []ResourceProviderOperationDefinition { + if page.rpol.IsEmpty() { + return nil + } + return *page.rpol.Value +} + +// Sku model representing SKU for Azure Dev Spaces Controller. +type Sku struct { + // Name - The name of the SKU for Azure Dev Spaces Controller. + Name *string `json:"name,omitempty"` + // Tier - The tier of the SKU for Azure Dev Spaces Controller. Possible values include: 'Standard' + Tier SkuTier `json:"tier,omitempty"` +} + +// TrackedResource the resource model definition for a ARM tracked top level resource. +type TrackedResource struct { + // Tags - Tags for the Azure resource. + Tags map[string]*string `json:"tags"` + // Location - Region where the Azure resource is located. + Location *string `json:"location,omitempty"` + // ID - Fully qualified resource Id for the resource. + ID *string `json:"id,omitempty"` + // Name - The name of the resource. + Name *string `json:"name,omitempty"` + // Type - The type of the resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for TrackedResource. +func (tr TrackedResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if tr.Tags != nil { + objectMap["tags"] = tr.Tags + } + if tr.Location != nil { + objectMap["location"] = tr.Location + } + if tr.ID != nil { + objectMap["id"] = tr.ID + } + if tr.Name != nil { + objectMap["name"] = tr.Name + } + if tr.Type != nil { + objectMap["type"] = tr.Type + } + return json.Marshal(objectMap) +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/devspaces/mgmt/2018-06-01-preview/devspaces/operations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/devspaces/mgmt/2018-06-01-preview/devspaces/operations.go new file mode 100644 index 000000000..baa7963ae --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/devspaces/mgmt/2018-06-01-preview/devspaces/operations.go @@ -0,0 +1,126 @@ +package devspaces + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "net/http" +) + +// OperationsClient is the dev Spaces Client +type OperationsClient struct { + BaseClient +} + +// NewOperationsClient creates an instance of the OperationsClient client. +func NewOperationsClient(subscriptionID string) OperationsClient { + return NewOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewOperationsClientWithBaseURI creates an instance of the OperationsClient client. +func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient { + return OperationsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// List lists all the supported operations by the Microsoft.DevSpaces resource provider along with their description. +func (client OperationsClient) List(ctx context.Context) (result ResourceProviderOperationListPage, err error) { + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "devspaces.OperationsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.rpol.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "devspaces.OperationsClient", "List", resp, "Failure sending request") + return + } + + result.rpol, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "devspaces.OperationsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/providers/Microsoft.DevSpaces/operations"), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client OperationsClient) ListSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client OperationsClient) ListResponder(resp *http.Response) (result ResourceProviderOperationList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client OperationsClient) listNextResults(lastResults ResourceProviderOperationList) (result ResourceProviderOperationList, err error) { + req, err := lastResults.resourceProviderOperationListPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "devspaces.OperationsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "devspaces.OperationsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "devspaces.OperationsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client OperationsClient) ListComplete(ctx context.Context) (result ResourceProviderOperationListIterator, err error) { + result.page, err = client.List(ctx) + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/devspaces/mgmt/2018-06-01-preview/devspaces/version.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/devspaces/mgmt/2018-06-01-preview/devspaces/version.go new file mode 100644 index 000000000..4185bde52 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/devspaces/mgmt/2018-06-01-preview/devspaces/version.go @@ -0,0 +1,30 @@ +package devspaces + +import "github.com/Azure/azure-sdk-for-go/version" + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// UserAgent returns the UserAgent string to use when sending http.Requests. +func UserAgent() string { + return "Azure-SDK-For-Go/" + version.Number + " devspaces/2018-06-01-preview" +} + +// Version returns the semantic version (see http://semver.org) of the client. +func Version() string { + return version.Number +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/dns/mgmt/2015-05-04-preview/dns/recordsets.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/dns/mgmt/2015-05-04-preview/dns/recordsets.go index 71ccb0886..ac5b88fdb 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/dns/mgmt/2015-05-04-preview/dns/recordsets.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/dns/mgmt/2015-05-04-preview/dns/recordsets.go @@ -21,6 +21,7 @@ import ( "context" "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" "net/http" ) @@ -41,7 +42,7 @@ func NewRecordSetsClientWithBaseURI(baseURI string, subscriptionID string) Recor // CreateOrUpdate creates a RecordSet within a DNS zone. // Parameters: -// resourceGroupName - the name of the resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // zoneName - the name of the zone without a terminating dot. // recordType - the type of DNS record. // relativeRecordSetName - the name of the RecordSet, relative to the name of the zone. @@ -50,6 +51,14 @@ func NewRecordSetsClientWithBaseURI(baseURI string, subscriptionID string) Recor // ifNoneMatch - defines the If-None-Match condition. Set to '*' to force Create-If-Not-Exist. Other values // will be ignored. func (client RecordSetsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, zoneName string, recordType RecordType, relativeRecordSetName string, parameters RecordSet, ifMatch string, ifNoneMatch string) (result RecordSet, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("dns.RecordSetsClient", "CreateOrUpdate", err.Error()) + } + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, zoneName, recordType, relativeRecordSetName, parameters, ifMatch, ifNoneMatch) if err != nil { err = autorest.NewErrorWithError(err, "dns.RecordSetsClient", "CreateOrUpdate", nil, "Failure preparing request") @@ -126,13 +135,21 @@ func (client RecordSetsClient) CreateOrUpdateResponder(resp *http.Response) (res // Delete removes a RecordSet from a DNS zone. // Parameters: -// resourceGroupName - the name of the resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // zoneName - the name of the zone without a terminating dot. // recordType - the type of DNS record. // relativeRecordSetName - the name of the RecordSet, relative to the name of the zone. // ifMatch - defines the If-Match condition. The delete operation will be performed only if the ETag of the // zone on the server matches this value. func (client RecordSetsClient) Delete(ctx context.Context, resourceGroupName string, zoneName string, recordType RecordType, relativeRecordSetName string, ifMatch string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("dns.RecordSetsClient", "Delete", err.Error()) + } + req, err := client.DeletePreparer(ctx, resourceGroupName, zoneName, recordType, relativeRecordSetName, ifMatch) if err != nil { err = autorest.NewErrorWithError(err, "dns.RecordSetsClient", "Delete", nil, "Failure preparing request") @@ -202,11 +219,19 @@ func (client RecordSetsClient) DeleteResponder(resp *http.Response) (result auto // Get gets a RecordSet. // Parameters: -// resourceGroupName - the name of the resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // zoneName - the name of the zone without a terminating dot. // recordType - the type of DNS record. // relativeRecordSetName - the name of the RecordSet, relative to the name of the zone. func (client RecordSetsClient) Get(ctx context.Context, resourceGroupName string, zoneName string, recordType RecordType, relativeRecordSetName string) (result RecordSet, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("dns.RecordSetsClient", "Get", err.Error()) + } + req, err := client.GetPreparer(ctx, resourceGroupName, zoneName, recordType, relativeRecordSetName) if err != nil { err = autorest.NewErrorWithError(err, "dns.RecordSetsClient", "Get", nil, "Failure preparing request") @@ -273,12 +298,20 @@ func (client RecordSetsClient) GetResponder(resp *http.Response) (result RecordS // List lists the RecordSets of a specified type in a DNS zone. // Parameters: -// resourceGroupName - the name of the resource group that contains the zone. +// resourceGroupName - the name of the resource group. The name is case insensitive. // zoneName - the name of the zone from which to enumerate RecordsSets. // recordType - the type of record sets to enumerate. // top - query parameters. If null is passed returns the default number of zones. // filter - the filter to apply on the operation. func (client RecordSetsClient) List(ctx context.Context, resourceGroupName string, zoneName string, recordType RecordType, top string, filter string) (result RecordSetListResultPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("dns.RecordSetsClient", "List", err.Error()) + } + result.fn = client.listNextResults req, err := client.ListPreparer(ctx, resourceGroupName, zoneName, recordType, top, filter) if err != nil { @@ -378,11 +411,19 @@ func (client RecordSetsClient) ListComplete(ctx context.Context, resourceGroupNa // ListAll lists all RecordSets in a DNS zone. // Parameters: -// resourceGroupName - the name of the resource group that contains the zone. +// resourceGroupName - the name of the resource group. The name is case insensitive. // zoneName - the name of the zone from which to enumerate RecordSets. // top - query parameters. If null is passed returns the default number of zones. // filter - the filter to apply on the operation. func (client RecordSetsClient) ListAll(ctx context.Context, resourceGroupName string, zoneName string, top string, filter string) (result RecordSetListResultPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("dns.RecordSetsClient", "ListAll", err.Error()) + } + result.fn = client.listAllNextResults req, err := client.ListAllPreparer(ctx, resourceGroupName, zoneName, top, filter) if err != nil { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/dns/mgmt/2015-05-04-preview/dns/zones.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/dns/mgmt/2015-05-04-preview/dns/zones.go index fcbbc38a9..0063e9c22 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/dns/mgmt/2015-05-04-preview/dns/zones.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/dns/mgmt/2015-05-04-preview/dns/zones.go @@ -21,6 +21,7 @@ import ( "context" "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" "net/http" ) @@ -41,13 +42,21 @@ func NewZonesClientWithBaseURI(baseURI string, subscriptionID string) ZonesClien // CreateOrUpdate creates a DNS zone within a resource group. // Parameters: -// resourceGroupName - the name of the resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // zoneName - the name of the zone without a terminating dot. // parameters - parameters supplied to the CreateOrUpdate operation. // ifMatch - the etag of Zone. // ifNoneMatch - defines the If-None-Match condition. Set to '*' to force Create-If-Not-Exist. Other values // will be ignored. func (client ZonesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, zoneName string, parameters Zone, ifMatch string, ifNoneMatch string) (result Zone, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("dns.ZonesClient", "CreateOrUpdate", err.Error()) + } + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, zoneName, parameters, ifMatch, ifNoneMatch) if err != nil { err = autorest.NewErrorWithError(err, "dns.ZonesClient", "CreateOrUpdate", nil, "Failure preparing request") @@ -122,11 +131,19 @@ func (client ZonesClient) CreateOrUpdateResponder(resp *http.Response) (result Z // Delete removes a DNS zone from a resource group. // Parameters: -// resourceGroupName - the name of the resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // zoneName - the name of the zone without a terminating dot. // ifMatch - defines the If-Match condition. The delete operation will be performed only if the ETag of the // zone on the server matches this value. func (client ZonesClient) Delete(ctx context.Context, resourceGroupName string, zoneName string, ifMatch string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("dns.ZonesClient", "Delete", err.Error()) + } + req, err := client.DeletePreparer(ctx, resourceGroupName, zoneName, ifMatch) if err != nil { err = autorest.NewErrorWithError(err, "dns.ZonesClient", "Delete", nil, "Failure preparing request") @@ -194,9 +211,17 @@ func (client ZonesClient) DeleteResponder(resp *http.Response) (result autorest. // Get gets a DNS zone. // Parameters: -// resourceGroupName - the name of the resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // zoneName - the name of the zone without a terminating dot. func (client ZonesClient) Get(ctx context.Context, resourceGroupName string, zoneName string) (result Zone, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("dns.ZonesClient", "Get", err.Error()) + } + req, err := client.GetPreparer(ctx, resourceGroupName, zoneName) if err != nil { err = autorest.NewErrorWithError(err, "dns.ZonesClient", "Get", nil, "Failure preparing request") @@ -261,10 +286,18 @@ func (client ZonesClient) GetResponder(resp *http.Response) (result Zone, err er // ListZonesInResourceGroup lists the DNS zones within a resource group. // Parameters: -// resourceGroupName - the name of the resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // top - query parameters. If null is passed returns the default number of zones. // filter - the filter to apply on the operation. func (client ZonesClient) ListZonesInResourceGroup(ctx context.Context, resourceGroupName string, top string, filter string) (result ZoneListResultPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("dns.ZonesClient", "ListZonesInResourceGroup", err.Error()) + } + result.fn = client.listZonesInResourceGroupNextResults req, err := client.ListZonesInResourceGroupPreparer(ctx, resourceGroupName, top, filter) if err != nil { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/dns/mgmt/2018-03-01-preview/dns/recordsets.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/dns/mgmt/2018-03-01-preview/dns/recordsets.go index 0f8233dbc..d27b31ee5 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/dns/mgmt/2018-03-01-preview/dns/recordsets.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/dns/mgmt/2018-03-01-preview/dns/recordsets.go @@ -21,6 +21,7 @@ import ( "context" "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" "net/http" ) @@ -41,7 +42,7 @@ func NewRecordSetsClientWithBaseURI(baseURI string, subscriptionID string) Recor // CreateOrUpdate creates or updates a record set within a DNS zone. // Parameters: -// resourceGroupName - the name of the resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // zoneName - the name of the DNS zone (without a terminating dot). // relativeRecordSetName - the name of the record set, relative to the name of the zone. // recordType - the type of DNS record in this record set. Record sets of type SOA can be updated but not @@ -52,6 +53,14 @@ func NewRecordSetsClientWithBaseURI(baseURI string, subscriptionID string) Recor // ifNoneMatch - set to '*' to allow a new record set to be created, but to prevent updating an existing record // set. Other values will be ignored. func (client RecordSetsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, zoneName string, relativeRecordSetName string, recordType RecordType, parameters RecordSet, ifMatch string, ifNoneMatch string) (result RecordSet, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("dns.RecordSetsClient", "CreateOrUpdate", err.Error()) + } + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, zoneName, relativeRecordSetName, recordType, parameters, ifMatch, ifNoneMatch) if err != nil { err = autorest.NewErrorWithError(err, "dns.RecordSetsClient", "CreateOrUpdate", nil, "Failure preparing request") @@ -128,7 +137,7 @@ func (client RecordSetsClient) CreateOrUpdateResponder(resp *http.Response) (res // Delete deletes a record set from a DNS zone. This operation cannot be undone. // Parameters: -// resourceGroupName - the name of the resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // zoneName - the name of the DNS zone (without a terminating dot). // relativeRecordSetName - the name of the record set, relative to the name of the zone. // recordType - the type of DNS record in this record set. Record sets of type SOA cannot be deleted (they are @@ -136,6 +145,14 @@ func (client RecordSetsClient) CreateOrUpdateResponder(resp *http.Response) (res // ifMatch - the etag of the record set. Omit this value to always delete the current record set. Specify the // last-seen etag value to prevent accidentally deleting any concurrent changes. func (client RecordSetsClient) Delete(ctx context.Context, resourceGroupName string, zoneName string, relativeRecordSetName string, recordType RecordType, ifMatch string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("dns.RecordSetsClient", "Delete", err.Error()) + } + req, err := client.DeletePreparer(ctx, resourceGroupName, zoneName, relativeRecordSetName, recordType, ifMatch) if err != nil { err = autorest.NewErrorWithError(err, "dns.RecordSetsClient", "Delete", nil, "Failure preparing request") @@ -205,11 +222,19 @@ func (client RecordSetsClient) DeleteResponder(resp *http.Response) (result auto // Get gets a record set. // Parameters: -// resourceGroupName - the name of the resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // zoneName - the name of the DNS zone (without a terminating dot). // relativeRecordSetName - the name of the record set, relative to the name of the zone. // recordType - the type of DNS record in this record set. func (client RecordSetsClient) Get(ctx context.Context, resourceGroupName string, zoneName string, relativeRecordSetName string, recordType RecordType) (result RecordSet, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("dns.RecordSetsClient", "Get", err.Error()) + } + req, err := client.GetPreparer(ctx, resourceGroupName, zoneName, relativeRecordSetName, recordType) if err != nil { err = autorest.NewErrorWithError(err, "dns.RecordSetsClient", "Get", nil, "Failure preparing request") @@ -276,13 +301,21 @@ func (client RecordSetsClient) GetResponder(resp *http.Response) (result RecordS // ListAllByDNSZone lists all record sets in a DNS zone. // Parameters: -// resourceGroupName - the name of the resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // zoneName - the name of the DNS zone (without a terminating dot). // top - the maximum number of record sets to return. If not specified, returns up to 100 record sets. // recordSetNameSuffix - the suffix label of the record set name that has to be used to filter the record set // enumerations. If this parameter is specified, Enumeration will return only records that end with // . func (client RecordSetsClient) ListAllByDNSZone(ctx context.Context, resourceGroupName string, zoneName string, top *int32, recordSetNameSuffix string) (result RecordSetListResultPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("dns.RecordSetsClient", "ListAllByDNSZone", err.Error()) + } + result.fn = client.listAllByDNSZoneNextResults req, err := client.ListAllByDNSZonePreparer(ctx, resourceGroupName, zoneName, top, recordSetNameSuffix) if err != nil { @@ -381,13 +414,21 @@ func (client RecordSetsClient) ListAllByDNSZoneComplete(ctx context.Context, res // ListByDNSZone lists all record sets in a DNS zone. // Parameters: -// resourceGroupName - the name of the resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // zoneName - the name of the DNS zone (without a terminating dot). // top - the maximum number of record sets to return. If not specified, returns up to 100 record sets. // recordsetnamesuffix - the suffix label of the record set name that has to be used to filter the record set // enumerations. If this parameter is specified, Enumeration will return only records that end with // . func (client RecordSetsClient) ListByDNSZone(ctx context.Context, resourceGroupName string, zoneName string, top *int32, recordsetnamesuffix string) (result RecordSetListResultPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("dns.RecordSetsClient", "ListByDNSZone", err.Error()) + } + result.fn = client.listByDNSZoneNextResults req, err := client.ListByDNSZonePreparer(ctx, resourceGroupName, zoneName, top, recordsetnamesuffix) if err != nil { @@ -486,7 +527,7 @@ func (client RecordSetsClient) ListByDNSZoneComplete(ctx context.Context, resour // ListByType lists the record sets of a specified type in a DNS zone. // Parameters: -// resourceGroupName - the name of the resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // zoneName - the name of the DNS zone (without a terminating dot). // recordType - the type of record sets to enumerate. // top - the maximum number of record sets to return. If not specified, returns up to 100 record sets. @@ -494,6 +535,14 @@ func (client RecordSetsClient) ListByDNSZoneComplete(ctx context.Context, resour // enumerations. If this parameter is specified, Enumeration will return only records that end with // . func (client RecordSetsClient) ListByType(ctx context.Context, resourceGroupName string, zoneName string, recordType RecordType, top *int32, recordsetnamesuffix string) (result RecordSetListResultPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("dns.RecordSetsClient", "ListByType", err.Error()) + } + result.fn = client.listByTypeNextResults req, err := client.ListByTypePreparer(ctx, resourceGroupName, zoneName, recordType, top, recordsetnamesuffix) if err != nil { @@ -593,7 +642,7 @@ func (client RecordSetsClient) ListByTypeComplete(ctx context.Context, resourceG // Update updates a record set within a DNS zone. // Parameters: -// resourceGroupName - the name of the resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // zoneName - the name of the DNS zone (without a terminating dot). // relativeRecordSetName - the name of the record set, relative to the name of the zone. // recordType - the type of DNS record in this record set. @@ -601,6 +650,14 @@ func (client RecordSetsClient) ListByTypeComplete(ctx context.Context, resourceG // ifMatch - the etag of the record set. Omit this value to always overwrite the current record set. Specify // the last-seen etag value to prevent accidentally overwritting concurrent changes. func (client RecordSetsClient) Update(ctx context.Context, resourceGroupName string, zoneName string, relativeRecordSetName string, recordType RecordType, parameters RecordSet, ifMatch string) (result RecordSet, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("dns.RecordSetsClient", "Update", err.Error()) + } + req, err := client.UpdatePreparer(ctx, resourceGroupName, zoneName, relativeRecordSetName, recordType, parameters, ifMatch) if err != nil { err = autorest.NewErrorWithError(err, "dns.RecordSetsClient", "Update", nil, "Failure preparing request") diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/dns/mgmt/2018-03-01-preview/dns/zones.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/dns/mgmt/2018-03-01-preview/dns/zones.go index a9369df17..1772b6eff 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/dns/mgmt/2018-03-01-preview/dns/zones.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/dns/mgmt/2018-03-01-preview/dns/zones.go @@ -21,6 +21,7 @@ import ( "context" "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" "net/http" ) @@ -41,7 +42,7 @@ func NewZonesClientWithBaseURI(baseURI string, subscriptionID string) ZonesClien // CreateOrUpdate creates or updates a DNS zone. Does not modify DNS records within the zone. // Parameters: -// resourceGroupName - the name of the resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // zoneName - the name of the DNS zone (without a terminating dot). // parameters - parameters supplied to the CreateOrUpdate operation. // ifMatch - the etag of the DNS zone. Omit this value to always overwrite the current zone. Specify the @@ -49,6 +50,14 @@ func NewZonesClientWithBaseURI(baseURI string, subscriptionID string) ZonesClien // ifNoneMatch - set to '*' to allow a new DNS zone to be created, but to prevent updating an existing zone. // Other values will be ignored. func (client ZonesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, zoneName string, parameters Zone, ifMatch string, ifNoneMatch string) (result Zone, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("dns.ZonesClient", "CreateOrUpdate", err.Error()) + } + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, zoneName, parameters, ifMatch, ifNoneMatch) if err != nil { err = autorest.NewErrorWithError(err, "dns.ZonesClient", "CreateOrUpdate", nil, "Failure preparing request") @@ -124,11 +133,19 @@ func (client ZonesClient) CreateOrUpdateResponder(resp *http.Response) (result Z // Delete deletes a DNS zone. WARNING: All DNS records in the zone will also be deleted. This operation cannot be // undone. // Parameters: -// resourceGroupName - the name of the resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // zoneName - the name of the DNS zone (without a terminating dot). // ifMatch - the etag of the DNS zone. Omit this value to always delete the current zone. Specify the last-seen // etag value to prevent accidentally deleting any concurrent changes. func (client ZonesClient) Delete(ctx context.Context, resourceGroupName string, zoneName string, ifMatch string) (result ZonesDeleteFuture, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("dns.ZonesClient", "Delete", err.Error()) + } + req, err := client.DeletePreparer(ctx, resourceGroupName, zoneName, ifMatch) if err != nil { err = autorest.NewErrorWithError(err, "dns.ZonesClient", "Delete", nil, "Failure preparing request") @@ -200,9 +217,17 @@ func (client ZonesClient) DeleteResponder(resp *http.Response) (result autorest. // Get gets a DNS zone. Retrieves the zone properties, but not the record sets within the zone. // Parameters: -// resourceGroupName - the name of the resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // zoneName - the name of the DNS zone (without a terminating dot). func (client ZonesClient) Get(ctx context.Context, resourceGroupName string, zoneName string) (result Zone, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("dns.ZonesClient", "Get", err.Error()) + } + req, err := client.GetPreparer(ctx, resourceGroupName, zoneName) if err != nil { err = autorest.NewErrorWithError(err, "dns.ZonesClient", "Get", nil, "Failure preparing request") @@ -362,9 +387,17 @@ func (client ZonesClient) ListComplete(ctx context.Context, top *int32) (result // ListByResourceGroup lists the DNS zones within a resource group. // Parameters: -// resourceGroupName - the name of the resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // top - the maximum number of record sets to return. If not specified, returns up to 100 record sets. func (client ZonesClient) ListByResourceGroup(ctx context.Context, resourceGroupName string, top *int32) (result ZoneListResultPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("dns.ZonesClient", "ListByResourceGroup", err.Error()) + } + result.fn = client.listByResourceGroupNextResults req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName, top) if err != nil { @@ -459,12 +492,20 @@ func (client ZonesClient) ListByResourceGroupComplete(ctx context.Context, resou // Update updates a DNS zone. Does not modify DNS records within the zone. // Parameters: -// resourceGroupName - the name of the resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // zoneName - the name of the DNS zone (without a terminating dot). // parameters - parameters supplied to the Update operation. // ifMatch - the etag of the DNS zone. Omit this value to always overwrite the current zone. Specify the // last-seen etag value to prevent accidentally overwritting any concurrent changes. func (client ZonesClient) Update(ctx context.Context, resourceGroupName string, zoneName string, parameters ZoneUpdate, ifMatch string) (result Zone, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("dns.ZonesClient", "Update", err.Error()) + } + req, err := client.UpdatePreparer(ctx, resourceGroupName, zoneName, parameters, ifMatch) if err != nil { err = autorest.NewErrorWithError(err, "dns.ZonesClient", "Update", nil, "Failure preparing request") diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/eventhub/mgmt/2018-01-01-preview/eventhub/client.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/eventhub/mgmt/2018-01-01-preview/eventhub/client.go index e44ca67a7..fc50af41c 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/eventhub/mgmt/2018-01-01-preview/eventhub/client.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/eventhub/mgmt/2018-01-01-preview/eventhub/client.go @@ -1,6 +1,6 @@ // Package eventhub implements the Azure ARM Eventhub service API version 2018-01-01-preview. // -// Azure Event Hubs Cluster client for managing Event Hubs Cluster resources. +// Azure Event Hubs client for managing Event Hubs Cluster, IPFilter Rules and VirtualNetworkRules resources. package eventhub // Copyright (c) Microsoft and contributors. All rights reserved. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/eventhub/mgmt/2018-01-01-preview/eventhub/clusters.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/eventhub/mgmt/2018-01-01-preview/eventhub/clusters.go index 2e9422482..0e6e69cff 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/eventhub/mgmt/2018-01-01-preview/eventhub/clusters.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/eventhub/mgmt/2018-01-01-preview/eventhub/clusters.go @@ -25,7 +25,8 @@ import ( "net/http" ) -// ClustersClient is the azure Event Hubs Cluster client for managing Event Hubs Cluster resources. +// ClustersClient is the azure Event Hubs client for managing Event Hubs Cluster, IPFilter Rules and +// VirtualNetworkRules resources. type ClustersClient struct { BaseClient } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/eventhub/mgmt/2018-01-01-preview/eventhub/configuration.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/eventhub/mgmt/2018-01-01-preview/eventhub/configuration.go index 14f26ef5f..bdfddfb09 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/eventhub/mgmt/2018-01-01-preview/eventhub/configuration.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/eventhub/mgmt/2018-01-01-preview/eventhub/configuration.go @@ -25,7 +25,8 @@ import ( "net/http" ) -// ConfigurationClient is the azure Event Hubs Cluster client for managing Event Hubs Cluster resources. +// ConfigurationClient is the azure Event Hubs client for managing Event Hubs Cluster, IPFilter Rules and +// VirtualNetworkRules resources. type ConfigurationClient struct { BaseClient } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/eventhub/mgmt/2018-01-01-preview/eventhub/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/eventhub/mgmt/2018-01-01-preview/eventhub/models.go index 614f304d8..babb8f39d 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/eventhub/mgmt/2018-01-01-preview/eventhub/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/eventhub/mgmt/2018-01-01-preview/eventhub/models.go @@ -21,10 +21,56 @@ import ( "encoding/json" "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/date" "github.com/Azure/go-autorest/autorest/to" "net/http" ) +// IPAction enumerates the values for ip action. +type IPAction string + +const ( + // Accept ... + Accept IPAction = "Accept" + // Reject ... + Reject IPAction = "Reject" +) + +// PossibleIPActionValues returns an array of possible values for the IPAction const type. +func PossibleIPActionValues() []IPAction { + return []IPAction{Accept, Reject} +} + +// SkuName enumerates the values for sku name. +type SkuName string + +const ( + // Basic ... + Basic SkuName = "Basic" + // Standard ... + Standard SkuName = "Standard" +) + +// PossibleSkuNameValues returns an array of possible values for the SkuName const type. +func PossibleSkuNameValues() []SkuName { + return []SkuName{Basic, Standard} +} + +// SkuTier enumerates the values for sku tier. +type SkuTier string + +const ( + // SkuTierBasic ... + SkuTierBasic SkuTier = "Basic" + // SkuTierStandard ... + SkuTierStandard SkuTier = "Standard" +) + +// PossibleSkuTierValues returns an array of possible values for the SkuTier const type. +func PossibleSkuTierValues() []SkuTier { + return []SkuTier{SkuTierBasic, SkuTierStandard} +} + // Cluster single Event Hubs Cluster resource in List or Get operations. type Cluster struct { autorest.Response `json:"-"` @@ -313,6 +359,254 @@ func (future *ClustersPatchFuture) Result(client ClustersClient) (c Cluster, err return } +// EHNamespace single Namespace item in List or Get Operation +type EHNamespace struct { + autorest.Response `json:"-"` + // Sku - Properties of sku resource + Sku *Sku `json:"sku,omitempty"` + // EHNamespaceProperties - Namespace properties supplied for create namespace operation. + *EHNamespaceProperties `json:"properties,omitempty"` + // Location - Resource location + Location *string `json:"location,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` + // ID - Resource Id + ID *string `json:"id,omitempty"` + // Name - Resource name + Name *string `json:"name,omitempty"` + // Type - Resource type + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for EHNamespace. +func (en EHNamespace) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if en.Sku != nil { + objectMap["sku"] = en.Sku + } + if en.EHNamespaceProperties != nil { + objectMap["properties"] = en.EHNamespaceProperties + } + if en.Location != nil { + objectMap["location"] = en.Location + } + if en.Tags != nil { + objectMap["tags"] = en.Tags + } + if en.ID != nil { + objectMap["id"] = en.ID + } + if en.Name != nil { + objectMap["name"] = en.Name + } + if en.Type != nil { + objectMap["type"] = en.Type + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for EHNamespace struct. +func (en *EHNamespace) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "sku": + if v != nil { + var sku Sku + err = json.Unmarshal(*v, &sku) + if err != nil { + return err + } + en.Sku = &sku + } + case "properties": + if v != nil { + var eHNamespaceProperties EHNamespaceProperties + err = json.Unmarshal(*v, &eHNamespaceProperties) + if err != nil { + return err + } + en.EHNamespaceProperties = &eHNamespaceProperties + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + en.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + en.Tags = tags + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + en.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + en.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + en.Type = &typeVar + } + } + } + + return nil +} + +// EHNamespaceListResult the response of the List Namespace operation +type EHNamespaceListResult struct { + autorest.Response `json:"-"` + // Value - Result of the List Namespace operation + Value *[]EHNamespace `json:"value,omitempty"` + // NextLink - Link to the next set of results. Not empty if Value contains incomplete list of namespaces. + NextLink *string `json:"nextLink,omitempty"` +} + +// EHNamespaceListResultIterator provides access to a complete listing of EHNamespace values. +type EHNamespaceListResultIterator struct { + i int + page EHNamespaceListResultPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *EHNamespaceListResultIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter EHNamespaceListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter EHNamespaceListResultIterator) Response() EHNamespaceListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter EHNamespaceListResultIterator) Value() EHNamespace { + if !iter.page.NotDone() { + return EHNamespace{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (enlr EHNamespaceListResult) IsEmpty() bool { + return enlr.Value == nil || len(*enlr.Value) == 0 +} + +// eHNamespaceListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (enlr EHNamespaceListResult) eHNamespaceListResultPreparer() (*http.Request, error) { + if enlr.NextLink == nil || len(to.String(enlr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(enlr.NextLink))) +} + +// EHNamespaceListResultPage contains a page of EHNamespace values. +type EHNamespaceListResultPage struct { + fn func(EHNamespaceListResult) (EHNamespaceListResult, error) + enlr EHNamespaceListResult +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *EHNamespaceListResultPage) Next() error { + next, err := page.fn(page.enlr) + if err != nil { + return err + } + page.enlr = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page EHNamespaceListResultPage) NotDone() bool { + return !page.enlr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page EHNamespaceListResultPage) Response() EHNamespaceListResult { + return page.enlr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page EHNamespaceListResultPage) Values() []EHNamespace { + if page.enlr.IsEmpty() { + return nil + } + return *page.enlr.Value +} + +// EHNamespaceProperties namespace properties supplied for create namespace operation. +type EHNamespaceProperties struct { + // ProvisioningState - Provisioning state of the Namespace. + ProvisioningState *string `json:"provisioningState,omitempty"` + // CreatedAt - The time the Namespace was created. + CreatedAt *date.Time `json:"createdAt,omitempty"` + // UpdatedAt - The time the Namespace was updated. + UpdatedAt *date.Time `json:"updatedAt,omitempty"` + // ServiceBusEndpoint - Endpoint you can use to perform Service Bus operations. + ServiceBusEndpoint *string `json:"serviceBusEndpoint,omitempty"` + // MetricID - Identifier for Azure Insights metrics. + MetricID *string `json:"metricId,omitempty"` + // IsAutoInflateEnabled - Value that indicates whether AutoInflate is enabled for eventhub namespace. + IsAutoInflateEnabled *bool `json:"isAutoInflateEnabled,omitempty"` + // MaximumThroughputUnits - Upper limit of throughput units when AutoInflate is enabled, vaule should be within 0 to 20 throughput units. ( '0' if AutoInflateEnabled = true) + MaximumThroughputUnits *int32 `json:"maximumThroughputUnits,omitempty"` + // KafkaEnabled - Value that indicates whether Kafka is enabled for eventhub namespace. + KafkaEnabled *bool `json:"kafkaEnabled,omitempty"` + // ZoneRedundant - Enabling this property creates a Standard Event Hubs Namespace in regions supported availability zones. + ZoneRedundant *bool `json:"zoneRedundant,omitempty"` +} + // ErrorResponse error response that indicates the service is not able to process the incoming request. The reason // is provided in the error message. type ErrorResponse struct { @@ -322,6 +616,251 @@ type ErrorResponse struct { Message *string `json:"message,omitempty"` } +// IPFilterRule single item in a List or Get IpFilterRules operation +type IPFilterRule struct { + autorest.Response `json:"-"` + // IPFilterRuleProperties - Properties supplied to create or update IpFilterRules + *IPFilterRuleProperties `json:"properties,omitempty"` + // ID - Resource Id + ID *string `json:"id,omitempty"` + // Name - Resource name + Name *string `json:"name,omitempty"` + // Type - Resource type + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for IPFilterRule. +func (ifr IPFilterRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ifr.IPFilterRuleProperties != nil { + objectMap["properties"] = ifr.IPFilterRuleProperties + } + if ifr.ID != nil { + objectMap["id"] = ifr.ID + } + if ifr.Name != nil { + objectMap["name"] = ifr.Name + } + if ifr.Type != nil { + objectMap["type"] = ifr.Type + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for IPFilterRule struct. +func (ifr *IPFilterRule) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var IPFilterRuleProperties IPFilterRuleProperties + err = json.Unmarshal(*v, &IPFilterRuleProperties) + if err != nil { + return err + } + ifr.IPFilterRuleProperties = &IPFilterRuleProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ifr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ifr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ifr.Type = &typeVar + } + } + } + + return nil +} + +// IPFilterRuleListResult the response from the List namespace operation. +type IPFilterRuleListResult struct { + autorest.Response `json:"-"` + // Value - Result of the List IpFilter Rules operation. + Value *[]IPFilterRule `json:"value,omitempty"` + // NextLink - Link to the next set of results. Not empty if Value contains an incomplete list of IpFilter Rules + NextLink *string `json:"nextLink,omitempty"` +} + +// IPFilterRuleListResultIterator provides access to a complete listing of IPFilterRule values. +type IPFilterRuleListResultIterator struct { + i int + page IPFilterRuleListResultPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *IPFilterRuleListResultIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter IPFilterRuleListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter IPFilterRuleListResultIterator) Response() IPFilterRuleListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter IPFilterRuleListResultIterator) Value() IPFilterRule { + if !iter.page.NotDone() { + return IPFilterRule{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (ifrlr IPFilterRuleListResult) IsEmpty() bool { + return ifrlr.Value == nil || len(*ifrlr.Value) == 0 +} + +// iPFilterRuleListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (ifrlr IPFilterRuleListResult) iPFilterRuleListResultPreparer() (*http.Request, error) { + if ifrlr.NextLink == nil || len(to.String(ifrlr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(ifrlr.NextLink))) +} + +// IPFilterRuleListResultPage contains a page of IPFilterRule values. +type IPFilterRuleListResultPage struct { + fn func(IPFilterRuleListResult) (IPFilterRuleListResult, error) + ifrlr IPFilterRuleListResult +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *IPFilterRuleListResultPage) Next() error { + next, err := page.fn(page.ifrlr) + if err != nil { + return err + } + page.ifrlr = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page IPFilterRuleListResultPage) NotDone() bool { + return !page.ifrlr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page IPFilterRuleListResultPage) Response() IPFilterRuleListResult { + return page.ifrlr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page IPFilterRuleListResultPage) Values() []IPFilterRule { + if page.ifrlr.IsEmpty() { + return nil + } + return *page.ifrlr.Value +} + +// IPFilterRuleProperties properties supplied to create or update IpFilterRules +type IPFilterRuleProperties struct { + // IPMask - IP Mask + IPMask *string `json:"ipMask,omitempty"` + // Action - The IP Filter Action. Possible values include: 'Accept', 'Reject' + Action IPAction `json:"action,omitempty"` + // FilterName - IP Filter name + FilterName *string `json:"filterName,omitempty"` +} + +// NamespacesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type NamespacesCreateOrUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *NamespacesCreateOrUpdateFuture) Result(client NamespacesClient) (en EHNamespace, err error) { + var done bool + done, err = future.Done(client) + if err != nil { + err = autorest.NewErrorWithError(err, "eventhub.NamespacesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("eventhub.NamespacesCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if en.Response.Response, err = future.GetResult(sender); err == nil && en.Response.Response.StatusCode != http.StatusNoContent { + en, err = client.CreateOrUpdateResponder(en.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "eventhub.NamespacesCreateOrUpdateFuture", "Result", en.Response.Response, "Failure responding to request") + } + } + return +} + +// NamespacesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. +type NamespacesDeleteFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *NamespacesDeleteFuture) Result(client NamespacesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.Done(client) + if err != nil { + err = autorest.NewErrorWithError(err, "eventhub.NamespacesDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("eventhub.NamespacesDeleteFuture") + return + } + ar.Response = future.Response() + return +} + // Operation a Event Hub REST API operation type Operation struct { // Name - Operation name: {provider}/{resource}/{operation} @@ -453,6 +992,16 @@ type Resource struct { Type *string `json:"type,omitempty"` } +// Sku SKU parameters supplied to the create namespace operation +type Sku struct { + // Name - Name of this SKU. Possible values include: 'Basic', 'Standard' + Name SkuName `json:"name,omitempty"` + // Tier - The billing tier of this particular SKU. Possible values include: 'SkuTierBasic', 'SkuTierStandard' + Tier SkuTier `json:"tier,omitempty"` + // Capacity - The Event Hubs throughput units, vaule should be 0 to 20 throughput units. + Capacity *int32 `json:"capacity,omitempty"` +} + // TrackedResource definition of an Azure resource. type TrackedResource struct { // Location - Resource location @@ -487,3 +1036,193 @@ func (tr TrackedResource) MarshalJSON() ([]byte, error) { } return json.Marshal(objectMap) } + +// VirtualNetworkRule single item in a List or Get VirtualNetworkRules operation +type VirtualNetworkRule struct { + autorest.Response `json:"-"` + // VirtualNetworkRuleProperties - Properties supplied to create or update VirtualNetworkRules + *VirtualNetworkRuleProperties `json:"properties,omitempty"` + // ID - Resource Id + ID *string `json:"id,omitempty"` + // Name - Resource name + Name *string `json:"name,omitempty"` + // Type - Resource type + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for VirtualNetworkRule. +func (vnr VirtualNetworkRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vnr.VirtualNetworkRuleProperties != nil { + objectMap["properties"] = vnr.VirtualNetworkRuleProperties + } + if vnr.ID != nil { + objectMap["id"] = vnr.ID + } + if vnr.Name != nil { + objectMap["name"] = vnr.Name + } + if vnr.Type != nil { + objectMap["type"] = vnr.Type + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for VirtualNetworkRule struct. +func (vnr *VirtualNetworkRule) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var virtualNetworkRuleProperties VirtualNetworkRuleProperties + err = json.Unmarshal(*v, &virtualNetworkRuleProperties) + if err != nil { + return err + } + vnr.VirtualNetworkRuleProperties = &virtualNetworkRuleProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + vnr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + vnr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + vnr.Type = &typeVar + } + } + } + + return nil +} + +// VirtualNetworkRuleListResult the response from the List namespace operation. +type VirtualNetworkRuleListResult struct { + autorest.Response `json:"-"` + // Value - Result of the List VirtualNetwork Rules operation. + Value *[]IPFilterRule `json:"value,omitempty"` + // NextLink - Link to the next set of results. Not empty if Value contains an incomplete list of VirtualNetwork Rules + NextLink *string `json:"nextLink,omitempty"` +} + +// VirtualNetworkRuleListResultIterator provides access to a complete listing of IPFilterRule values. +type VirtualNetworkRuleListResultIterator struct { + i int + page VirtualNetworkRuleListResultPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *VirtualNetworkRuleListResultIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter VirtualNetworkRuleListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter VirtualNetworkRuleListResultIterator) Response() VirtualNetworkRuleListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter VirtualNetworkRuleListResultIterator) Value() IPFilterRule { + if !iter.page.NotDone() { + return IPFilterRule{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (vnrlr VirtualNetworkRuleListResult) IsEmpty() bool { + return vnrlr.Value == nil || len(*vnrlr.Value) == 0 +} + +// virtualNetworkRuleListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (vnrlr VirtualNetworkRuleListResult) virtualNetworkRuleListResultPreparer() (*http.Request, error) { + if vnrlr.NextLink == nil || len(to.String(vnrlr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(vnrlr.NextLink))) +} + +// VirtualNetworkRuleListResultPage contains a page of IPFilterRule values. +type VirtualNetworkRuleListResultPage struct { + fn func(VirtualNetworkRuleListResult) (VirtualNetworkRuleListResult, error) + vnrlr VirtualNetworkRuleListResult +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *VirtualNetworkRuleListResultPage) Next() error { + next, err := page.fn(page.vnrlr) + if err != nil { + return err + } + page.vnrlr = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page VirtualNetworkRuleListResultPage) NotDone() bool { + return !page.vnrlr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page VirtualNetworkRuleListResultPage) Response() VirtualNetworkRuleListResult { + return page.vnrlr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page VirtualNetworkRuleListResultPage) Values() []IPFilterRule { + if page.vnrlr.IsEmpty() { + return nil + } + return *page.vnrlr.Value +} + +// VirtualNetworkRuleProperties properties supplied to create or update VirtualNetworkRules +type VirtualNetworkRuleProperties struct { + // VirtualNetworkSubnetID - ARM ID of Virtual Network Subnet + VirtualNetworkSubnetID *string `json:"virtualNetworkSubnetId,omitempty"` +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/eventhub/mgmt/2018-01-01-preview/eventhub/namespaces.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/eventhub/mgmt/2018-01-01-preview/eventhub/namespaces.go new file mode 100644 index 000000000..afc76a634 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/eventhub/mgmt/2018-01-01-preview/eventhub/namespaces.go @@ -0,0 +1,1268 @@ +package eventhub + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// NamespacesClient is the azure Event Hubs client for managing Event Hubs Cluster, IPFilter Rules and +// VirtualNetworkRules resources. +type NamespacesClient struct { + BaseClient +} + +// NewNamespacesClient creates an instance of the NamespacesClient client. +func NewNamespacesClient(subscriptionID string) NamespacesClient { + return NewNamespacesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewNamespacesClientWithBaseURI creates an instance of the NamespacesClient client. +func NewNamespacesClientWithBaseURI(baseURI string, subscriptionID string) NamespacesClient { + return NamespacesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or updates a namespace. Once created, this namespace's resource manifest is immutable. This +// operation is idempotent. +// Parameters: +// resourceGroupName - name of the resource group within the Azure subscription. +// namespaceName - the Namespace name +// parameters - parameters for creating a namespace resource. +func (client NamespacesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, namespaceName string, parameters EHNamespace) (result NamespacesCreateOrUpdateFuture, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: namespaceName, + Constraints: []validation.Constraint{{Target: "namespaceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "namespaceName", Name: validation.MinLength, Rule: 6, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.Sku", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.Sku.Capacity", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.Sku.Capacity", Name: validation.InclusiveMaximum, Rule: int64(20), Chain: nil}, + {Target: "parameters.Sku.Capacity", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, + }}, + }}, + {Target: "parameters.EHNamespaceProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.EHNamespaceProperties.MaximumThroughputUnits", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.EHNamespaceProperties.MaximumThroughputUnits", Name: validation.InclusiveMaximum, Rule: int64(20), Chain: nil}, + {Target: "parameters.EHNamespaceProperties.MaximumThroughputUnits", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, + }}, + }}}}}); err != nil { + return result, validation.NewError("eventhub.NamespacesClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, namespaceName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "eventhub.NamespacesClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "eventhub.NamespacesClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client NamespacesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, namespaceName string, parameters EHNamespace) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "namespaceName": autorest.Encode("path", namespaceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-01-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client NamespacesClient) CreateOrUpdateSender(req *http.Request) (future NamespacesCreateOrUpdateFuture, err error) { + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client NamespacesClient) CreateOrUpdateResponder(resp *http.Response) (result EHNamespace, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CreateOrUpdateIPFilterRule creates or updates an IpFilterRule for a Namespace. +// Parameters: +// resourceGroupName - name of the resource group within the Azure subscription. +// namespaceName - the Namespace name +// IPFilterRuleName - the IP Filter Rule name. +// parameters - the Namespace IpFilterRule. +func (client NamespacesClient) CreateOrUpdateIPFilterRule(ctx context.Context, resourceGroupName string, namespaceName string, IPFilterRuleName string, parameters IPFilterRule) (result IPFilterRule, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: namespaceName, + Constraints: []validation.Constraint{{Target: "namespaceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "namespaceName", Name: validation.MinLength, Rule: 6, Chain: nil}}}, + {TargetValue: IPFilterRuleName, + Constraints: []validation.Constraint{{Target: "IPFilterRuleName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("eventhub.NamespacesClient", "CreateOrUpdateIPFilterRule", err.Error()) + } + + req, err := client.CreateOrUpdateIPFilterRulePreparer(ctx, resourceGroupName, namespaceName, IPFilterRuleName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "eventhub.NamespacesClient", "CreateOrUpdateIPFilterRule", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateIPFilterRuleSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "eventhub.NamespacesClient", "CreateOrUpdateIPFilterRule", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateIPFilterRuleResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "eventhub.NamespacesClient", "CreateOrUpdateIPFilterRule", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdateIPFilterRulePreparer prepares the CreateOrUpdateIPFilterRule request. +func (client NamespacesClient) CreateOrUpdateIPFilterRulePreparer(ctx context.Context, resourceGroupName string, namespaceName string, IPFilterRuleName string, parameters IPFilterRule) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "ipFilterRuleName": autorest.Encode("path", IPFilterRuleName), + "namespaceName": autorest.Encode("path", namespaceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-01-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/ipfilterrules/{ipFilterRuleName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateIPFilterRuleSender sends the CreateOrUpdateIPFilterRule request. The method will close the +// http.Response Body if it receives an error. +func (client NamespacesClient) CreateOrUpdateIPFilterRuleSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateIPFilterRuleResponder handles the response to the CreateOrUpdateIPFilterRule request. The method always +// closes the http.Response Body. +func (client NamespacesClient) CreateOrUpdateIPFilterRuleResponder(resp *http.Response) (result IPFilterRule, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CreateOrUpdateVirtualNetworkRule creates or updates an VirtualNetworkRule for a Namespace. +// Parameters: +// resourceGroupName - name of the resource group within the Azure subscription. +// namespaceName - the Namespace name +// virtualNetworkRuleName - the Virtual Network Rule name. +// parameters - the Namespace VirtualNetworkRule. +func (client NamespacesClient) CreateOrUpdateVirtualNetworkRule(ctx context.Context, resourceGroupName string, namespaceName string, virtualNetworkRuleName string, parameters VirtualNetworkRule) (result VirtualNetworkRule, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: namespaceName, + Constraints: []validation.Constraint{{Target: "namespaceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "namespaceName", Name: validation.MinLength, Rule: 6, Chain: nil}}}, + {TargetValue: virtualNetworkRuleName, + Constraints: []validation.Constraint{{Target: "virtualNetworkRuleName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("eventhub.NamespacesClient", "CreateOrUpdateVirtualNetworkRule", err.Error()) + } + + req, err := client.CreateOrUpdateVirtualNetworkRulePreparer(ctx, resourceGroupName, namespaceName, virtualNetworkRuleName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "eventhub.NamespacesClient", "CreateOrUpdateVirtualNetworkRule", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateVirtualNetworkRuleSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "eventhub.NamespacesClient", "CreateOrUpdateVirtualNetworkRule", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateVirtualNetworkRuleResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "eventhub.NamespacesClient", "CreateOrUpdateVirtualNetworkRule", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdateVirtualNetworkRulePreparer prepares the CreateOrUpdateVirtualNetworkRule request. +func (client NamespacesClient) CreateOrUpdateVirtualNetworkRulePreparer(ctx context.Context, resourceGroupName string, namespaceName string, virtualNetworkRuleName string, parameters VirtualNetworkRule) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "namespaceName": autorest.Encode("path", namespaceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "virtualNetworkRuleName": autorest.Encode("path", virtualNetworkRuleName), + } + + const APIVersion = "2018-01-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/virtualnetworkrules/{virtualNetworkRuleName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateVirtualNetworkRuleSender sends the CreateOrUpdateVirtualNetworkRule request. The method will close the +// http.Response Body if it receives an error. +func (client NamespacesClient) CreateOrUpdateVirtualNetworkRuleSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateVirtualNetworkRuleResponder handles the response to the CreateOrUpdateVirtualNetworkRule request. The method always +// closes the http.Response Body. +func (client NamespacesClient) CreateOrUpdateVirtualNetworkRuleResponder(resp *http.Response) (result VirtualNetworkRule, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes an existing namespace. This operation also removes all associated resources under the namespace. +// Parameters: +// resourceGroupName - name of the resource group within the Azure subscription. +// namespaceName - the Namespace name +func (client NamespacesClient) Delete(ctx context.Context, resourceGroupName string, namespaceName string) (result NamespacesDeleteFuture, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: namespaceName, + Constraints: []validation.Constraint{{Target: "namespaceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "namespaceName", Name: validation.MinLength, Rule: 6, Chain: nil}}}}); err != nil { + return result, validation.NewError("eventhub.NamespacesClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, namespaceName) + if err != nil { + err = autorest.NewErrorWithError(err, "eventhub.NamespacesClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "eventhub.NamespacesClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client NamespacesClient) DeletePreparer(ctx context.Context, resourceGroupName string, namespaceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "namespaceName": autorest.Encode("path", namespaceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-01-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client NamespacesClient) DeleteSender(req *http.Request) (future NamespacesDeleteFuture, err error) { + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client NamespacesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// DeleteIPFilterRule deletes an IpFilterRule for a Namespace. +// Parameters: +// resourceGroupName - name of the resource group within the Azure subscription. +// namespaceName - the Namespace name +// IPFilterRuleName - the IP Filter Rule name. +func (client NamespacesClient) DeleteIPFilterRule(ctx context.Context, resourceGroupName string, namespaceName string, IPFilterRuleName string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: namespaceName, + Constraints: []validation.Constraint{{Target: "namespaceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "namespaceName", Name: validation.MinLength, Rule: 6, Chain: nil}}}, + {TargetValue: IPFilterRuleName, + Constraints: []validation.Constraint{{Target: "IPFilterRuleName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("eventhub.NamespacesClient", "DeleteIPFilterRule", err.Error()) + } + + req, err := client.DeleteIPFilterRulePreparer(ctx, resourceGroupName, namespaceName, IPFilterRuleName) + if err != nil { + err = autorest.NewErrorWithError(err, "eventhub.NamespacesClient", "DeleteIPFilterRule", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteIPFilterRuleSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "eventhub.NamespacesClient", "DeleteIPFilterRule", resp, "Failure sending request") + return + } + + result, err = client.DeleteIPFilterRuleResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "eventhub.NamespacesClient", "DeleteIPFilterRule", resp, "Failure responding to request") + } + + return +} + +// DeleteIPFilterRulePreparer prepares the DeleteIPFilterRule request. +func (client NamespacesClient) DeleteIPFilterRulePreparer(ctx context.Context, resourceGroupName string, namespaceName string, IPFilterRuleName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "ipFilterRuleName": autorest.Encode("path", IPFilterRuleName), + "namespaceName": autorest.Encode("path", namespaceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-01-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/ipfilterrules/{ipFilterRuleName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteIPFilterRuleSender sends the DeleteIPFilterRule request. The method will close the +// http.Response Body if it receives an error. +func (client NamespacesClient) DeleteIPFilterRuleSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteIPFilterRuleResponder handles the response to the DeleteIPFilterRule request. The method always +// closes the http.Response Body. +func (client NamespacesClient) DeleteIPFilterRuleResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// DeleteVirtualNetworkRule deletes an VirtualNetworkRule for a Namespace. +// Parameters: +// resourceGroupName - name of the resource group within the Azure subscription. +// namespaceName - the Namespace name +// virtualNetworkRuleName - the Virtual Network Rule name. +func (client NamespacesClient) DeleteVirtualNetworkRule(ctx context.Context, resourceGroupName string, namespaceName string, virtualNetworkRuleName string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: namespaceName, + Constraints: []validation.Constraint{{Target: "namespaceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "namespaceName", Name: validation.MinLength, Rule: 6, Chain: nil}}}, + {TargetValue: virtualNetworkRuleName, + Constraints: []validation.Constraint{{Target: "virtualNetworkRuleName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("eventhub.NamespacesClient", "DeleteVirtualNetworkRule", err.Error()) + } + + req, err := client.DeleteVirtualNetworkRulePreparer(ctx, resourceGroupName, namespaceName, virtualNetworkRuleName) + if err != nil { + err = autorest.NewErrorWithError(err, "eventhub.NamespacesClient", "DeleteVirtualNetworkRule", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteVirtualNetworkRuleSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "eventhub.NamespacesClient", "DeleteVirtualNetworkRule", resp, "Failure sending request") + return + } + + result, err = client.DeleteVirtualNetworkRuleResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "eventhub.NamespacesClient", "DeleteVirtualNetworkRule", resp, "Failure responding to request") + } + + return +} + +// DeleteVirtualNetworkRulePreparer prepares the DeleteVirtualNetworkRule request. +func (client NamespacesClient) DeleteVirtualNetworkRulePreparer(ctx context.Context, resourceGroupName string, namespaceName string, virtualNetworkRuleName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "namespaceName": autorest.Encode("path", namespaceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "virtualNetworkRuleName": autorest.Encode("path", virtualNetworkRuleName), + } + + const APIVersion = "2018-01-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/virtualnetworkrules/{virtualNetworkRuleName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteVirtualNetworkRuleSender sends the DeleteVirtualNetworkRule request. The method will close the +// http.Response Body if it receives an error. +func (client NamespacesClient) DeleteVirtualNetworkRuleSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteVirtualNetworkRuleResponder handles the response to the DeleteVirtualNetworkRule request. The method always +// closes the http.Response Body. +func (client NamespacesClient) DeleteVirtualNetworkRuleResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the description of the specified namespace. +// Parameters: +// resourceGroupName - name of the resource group within the Azure subscription. +// namespaceName - the Namespace name +func (client NamespacesClient) Get(ctx context.Context, resourceGroupName string, namespaceName string) (result EHNamespace, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: namespaceName, + Constraints: []validation.Constraint{{Target: "namespaceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "namespaceName", Name: validation.MinLength, Rule: 6, Chain: nil}}}}); err != nil { + return result, validation.NewError("eventhub.NamespacesClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, namespaceName) + if err != nil { + err = autorest.NewErrorWithError(err, "eventhub.NamespacesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "eventhub.NamespacesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "eventhub.NamespacesClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client NamespacesClient) GetPreparer(ctx context.Context, resourceGroupName string, namespaceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "namespaceName": autorest.Encode("path", namespaceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-01-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client NamespacesClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client NamespacesClient) GetResponder(resp *http.Response) (result EHNamespace, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetIPFilterRule gets an IpFilterRule for a Namespace by rule name. +// Parameters: +// resourceGroupName - name of the resource group within the Azure subscription. +// namespaceName - the Namespace name +// IPFilterRuleName - the IP Filter Rule name. +func (client NamespacesClient) GetIPFilterRule(ctx context.Context, resourceGroupName string, namespaceName string, IPFilterRuleName string) (result IPFilterRule, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: namespaceName, + Constraints: []validation.Constraint{{Target: "namespaceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "namespaceName", Name: validation.MinLength, Rule: 6, Chain: nil}}}, + {TargetValue: IPFilterRuleName, + Constraints: []validation.Constraint{{Target: "IPFilterRuleName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("eventhub.NamespacesClient", "GetIPFilterRule", err.Error()) + } + + req, err := client.GetIPFilterRulePreparer(ctx, resourceGroupName, namespaceName, IPFilterRuleName) + if err != nil { + err = autorest.NewErrorWithError(err, "eventhub.NamespacesClient", "GetIPFilterRule", nil, "Failure preparing request") + return + } + + resp, err := client.GetIPFilterRuleSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "eventhub.NamespacesClient", "GetIPFilterRule", resp, "Failure sending request") + return + } + + result, err = client.GetIPFilterRuleResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "eventhub.NamespacesClient", "GetIPFilterRule", resp, "Failure responding to request") + } + + return +} + +// GetIPFilterRulePreparer prepares the GetIPFilterRule request. +func (client NamespacesClient) GetIPFilterRulePreparer(ctx context.Context, resourceGroupName string, namespaceName string, IPFilterRuleName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "ipFilterRuleName": autorest.Encode("path", IPFilterRuleName), + "namespaceName": autorest.Encode("path", namespaceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-01-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/ipfilterrules/{ipFilterRuleName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetIPFilterRuleSender sends the GetIPFilterRule request. The method will close the +// http.Response Body if it receives an error. +func (client NamespacesClient) GetIPFilterRuleSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetIPFilterRuleResponder handles the response to the GetIPFilterRule request. The method always +// closes the http.Response Body. +func (client NamespacesClient) GetIPFilterRuleResponder(resp *http.Response) (result IPFilterRule, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetVirtualNetworkRule gets an VirtualNetworkRule for a Namespace by rule name. +// Parameters: +// resourceGroupName - name of the resource group within the Azure subscription. +// namespaceName - the Namespace name +// virtualNetworkRuleName - the Virtual Network Rule name. +func (client NamespacesClient) GetVirtualNetworkRule(ctx context.Context, resourceGroupName string, namespaceName string, virtualNetworkRuleName string) (result VirtualNetworkRule, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: namespaceName, + Constraints: []validation.Constraint{{Target: "namespaceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "namespaceName", Name: validation.MinLength, Rule: 6, Chain: nil}}}, + {TargetValue: virtualNetworkRuleName, + Constraints: []validation.Constraint{{Target: "virtualNetworkRuleName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("eventhub.NamespacesClient", "GetVirtualNetworkRule", err.Error()) + } + + req, err := client.GetVirtualNetworkRulePreparer(ctx, resourceGroupName, namespaceName, virtualNetworkRuleName) + if err != nil { + err = autorest.NewErrorWithError(err, "eventhub.NamespacesClient", "GetVirtualNetworkRule", nil, "Failure preparing request") + return + } + + resp, err := client.GetVirtualNetworkRuleSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "eventhub.NamespacesClient", "GetVirtualNetworkRule", resp, "Failure sending request") + return + } + + result, err = client.GetVirtualNetworkRuleResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "eventhub.NamespacesClient", "GetVirtualNetworkRule", resp, "Failure responding to request") + } + + return +} + +// GetVirtualNetworkRulePreparer prepares the GetVirtualNetworkRule request. +func (client NamespacesClient) GetVirtualNetworkRulePreparer(ctx context.Context, resourceGroupName string, namespaceName string, virtualNetworkRuleName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "namespaceName": autorest.Encode("path", namespaceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "virtualNetworkRuleName": autorest.Encode("path", virtualNetworkRuleName), + } + + const APIVersion = "2018-01-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/virtualnetworkrules/{virtualNetworkRuleName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetVirtualNetworkRuleSender sends the GetVirtualNetworkRule request. The method will close the +// http.Response Body if it receives an error. +func (client NamespacesClient) GetVirtualNetworkRuleSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetVirtualNetworkRuleResponder handles the response to the GetVirtualNetworkRule request. The method always +// closes the http.Response Body. +func (client NamespacesClient) GetVirtualNetworkRuleResponder(resp *http.Response) (result VirtualNetworkRule, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists all the available Namespaces within a subscription, irrespective of the resource groups. +func (client NamespacesClient) List(ctx context.Context) (result EHNamespaceListResultPage, err error) { + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "eventhub.NamespacesClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.enlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "eventhub.NamespacesClient", "List", resp, "Failure sending request") + return + } + + result.enlr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "eventhub.NamespacesClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client NamespacesClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-01-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.EventHub/namespaces", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client NamespacesClient) ListSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client NamespacesClient) ListResponder(resp *http.Response) (result EHNamespaceListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client NamespacesClient) listNextResults(lastResults EHNamespaceListResult) (result EHNamespaceListResult, err error) { + req, err := lastResults.eHNamespaceListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "eventhub.NamespacesClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "eventhub.NamespacesClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "eventhub.NamespacesClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client NamespacesClient) ListComplete(ctx context.Context) (result EHNamespaceListResultIterator, err error) { + result.page, err = client.List(ctx) + return +} + +// ListByResourceGroup lists the available Namespaces within a resource group. +// Parameters: +// resourceGroupName - name of the resource group within the Azure subscription. +func (client NamespacesClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result EHNamespaceListResultPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("eventhub.NamespacesClient", "ListByResourceGroup", err.Error()) + } + + result.fn = client.listByResourceGroupNextResults + req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "eventhub.NamespacesClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.enlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "eventhub.NamespacesClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result.enlr, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "eventhub.NamespacesClient", "ListByResourceGroup", resp, "Failure responding to request") + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client NamespacesClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-01-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the +// http.Response Body if it receives an error. +func (client NamespacesClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always +// closes the http.Response Body. +func (client NamespacesClient) ListByResourceGroupResponder(resp *http.Response) (result EHNamespaceListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByResourceGroupNextResults retrieves the next set of results, if any. +func (client NamespacesClient) listByResourceGroupNextResults(lastResults EHNamespaceListResult) (result EHNamespaceListResult, err error) { + req, err := lastResults.eHNamespaceListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "eventhub.NamespacesClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "eventhub.NamespacesClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "eventhub.NamespacesClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client NamespacesClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result EHNamespaceListResultIterator, err error) { + result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) + return +} + +// ListIPFilterRules gets a list of IP Filter rules for a Namespace. +// Parameters: +// resourceGroupName - name of the resource group within the Azure subscription. +// namespaceName - the Namespace name +func (client NamespacesClient) ListIPFilterRules(ctx context.Context, resourceGroupName string, namespaceName string) (result IPFilterRuleListResultPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: namespaceName, + Constraints: []validation.Constraint{{Target: "namespaceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "namespaceName", Name: validation.MinLength, Rule: 6, Chain: nil}}}}); err != nil { + return result, validation.NewError("eventhub.NamespacesClient", "ListIPFilterRules", err.Error()) + } + + result.fn = client.listIPFilterRulesNextResults + req, err := client.ListIPFilterRulesPreparer(ctx, resourceGroupName, namespaceName) + if err != nil { + err = autorest.NewErrorWithError(err, "eventhub.NamespacesClient", "ListIPFilterRules", nil, "Failure preparing request") + return + } + + resp, err := client.ListIPFilterRulesSender(req) + if err != nil { + result.ifrlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "eventhub.NamespacesClient", "ListIPFilterRules", resp, "Failure sending request") + return + } + + result.ifrlr, err = client.ListIPFilterRulesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "eventhub.NamespacesClient", "ListIPFilterRules", resp, "Failure responding to request") + } + + return +} + +// ListIPFilterRulesPreparer prepares the ListIPFilterRules request. +func (client NamespacesClient) ListIPFilterRulesPreparer(ctx context.Context, resourceGroupName string, namespaceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "namespaceName": autorest.Encode("path", namespaceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-01-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/ipfilterrules", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListIPFilterRulesSender sends the ListIPFilterRules request. The method will close the +// http.Response Body if it receives an error. +func (client NamespacesClient) ListIPFilterRulesSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListIPFilterRulesResponder handles the response to the ListIPFilterRules request. The method always +// closes the http.Response Body. +func (client NamespacesClient) ListIPFilterRulesResponder(resp *http.Response) (result IPFilterRuleListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listIPFilterRulesNextResults retrieves the next set of results, if any. +func (client NamespacesClient) listIPFilterRulesNextResults(lastResults IPFilterRuleListResult) (result IPFilterRuleListResult, err error) { + req, err := lastResults.iPFilterRuleListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "eventhub.NamespacesClient", "listIPFilterRulesNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListIPFilterRulesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "eventhub.NamespacesClient", "listIPFilterRulesNextResults", resp, "Failure sending next results request") + } + result, err = client.ListIPFilterRulesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "eventhub.NamespacesClient", "listIPFilterRulesNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListIPFilterRulesComplete enumerates all values, automatically crossing page boundaries as required. +func (client NamespacesClient) ListIPFilterRulesComplete(ctx context.Context, resourceGroupName string, namespaceName string) (result IPFilterRuleListResultIterator, err error) { + result.page, err = client.ListIPFilterRules(ctx, resourceGroupName, namespaceName) + return +} + +// ListVirtualNetworkRules gets a list of VirtualNetwork rules for a Namespace. +// Parameters: +// resourceGroupName - name of the resource group within the Azure subscription. +// namespaceName - the Namespace name +func (client NamespacesClient) ListVirtualNetworkRules(ctx context.Context, resourceGroupName string, namespaceName string) (result VirtualNetworkRuleListResultPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: namespaceName, + Constraints: []validation.Constraint{{Target: "namespaceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "namespaceName", Name: validation.MinLength, Rule: 6, Chain: nil}}}}); err != nil { + return result, validation.NewError("eventhub.NamespacesClient", "ListVirtualNetworkRules", err.Error()) + } + + result.fn = client.listVirtualNetworkRulesNextResults + req, err := client.ListVirtualNetworkRulesPreparer(ctx, resourceGroupName, namespaceName) + if err != nil { + err = autorest.NewErrorWithError(err, "eventhub.NamespacesClient", "ListVirtualNetworkRules", nil, "Failure preparing request") + return + } + + resp, err := client.ListVirtualNetworkRulesSender(req) + if err != nil { + result.vnrlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "eventhub.NamespacesClient", "ListVirtualNetworkRules", resp, "Failure sending request") + return + } + + result.vnrlr, err = client.ListVirtualNetworkRulesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "eventhub.NamespacesClient", "ListVirtualNetworkRules", resp, "Failure responding to request") + } + + return +} + +// ListVirtualNetworkRulesPreparer prepares the ListVirtualNetworkRules request. +func (client NamespacesClient) ListVirtualNetworkRulesPreparer(ctx context.Context, resourceGroupName string, namespaceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "namespaceName": autorest.Encode("path", namespaceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-01-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/virtualnetworkrules", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListVirtualNetworkRulesSender sends the ListVirtualNetworkRules request. The method will close the +// http.Response Body if it receives an error. +func (client NamespacesClient) ListVirtualNetworkRulesSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListVirtualNetworkRulesResponder handles the response to the ListVirtualNetworkRules request. The method always +// closes the http.Response Body. +func (client NamespacesClient) ListVirtualNetworkRulesResponder(resp *http.Response) (result VirtualNetworkRuleListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listVirtualNetworkRulesNextResults retrieves the next set of results, if any. +func (client NamespacesClient) listVirtualNetworkRulesNextResults(lastResults VirtualNetworkRuleListResult) (result VirtualNetworkRuleListResult, err error) { + req, err := lastResults.virtualNetworkRuleListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "eventhub.NamespacesClient", "listVirtualNetworkRulesNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListVirtualNetworkRulesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "eventhub.NamespacesClient", "listVirtualNetworkRulesNextResults", resp, "Failure sending next results request") + } + result, err = client.ListVirtualNetworkRulesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "eventhub.NamespacesClient", "listVirtualNetworkRulesNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListVirtualNetworkRulesComplete enumerates all values, automatically crossing page boundaries as required. +func (client NamespacesClient) ListVirtualNetworkRulesComplete(ctx context.Context, resourceGroupName string, namespaceName string) (result VirtualNetworkRuleListResultIterator, err error) { + result.page, err = client.ListVirtualNetworkRules(ctx, resourceGroupName, namespaceName) + return +} + +// Update creates or updates a namespace. Once created, this namespace's resource manifest is immutable. This operation +// is idempotent. +// Parameters: +// resourceGroupName - name of the resource group within the Azure subscription. +// namespaceName - the Namespace name +// parameters - parameters for updating a namespace resource. +func (client NamespacesClient) Update(ctx context.Context, resourceGroupName string, namespaceName string, parameters EHNamespace) (result EHNamespace, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: namespaceName, + Constraints: []validation.Constraint{{Target: "namespaceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "namespaceName", Name: validation.MinLength, Rule: 6, Chain: nil}}}}); err != nil { + return result, validation.NewError("eventhub.NamespacesClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, namespaceName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "eventhub.NamespacesClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "eventhub.NamespacesClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "eventhub.NamespacesClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client NamespacesClient) UpdatePreparer(ctx context.Context, resourceGroupName string, namespaceName string, parameters EHNamespace) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "namespaceName": autorest.Encode("path", namespaceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-01-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client NamespacesClient) UpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client NamespacesClient) UpdateResponder(resp *http.Response) (result EHNamespace, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/eventhub/mgmt/2018-01-01-preview/eventhub/operations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/eventhub/mgmt/2018-01-01-preview/eventhub/operations.go index e894b135f..ab36078bd 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/eventhub/mgmt/2018-01-01-preview/eventhub/operations.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/eventhub/mgmt/2018-01-01-preview/eventhub/operations.go @@ -24,7 +24,8 @@ import ( "net/http" ) -// OperationsClient is the azure Event Hubs Cluster client for managing Event Hubs Cluster resources. +// OperationsClient is the azure Event Hubs client for managing Event Hubs Cluster, IPFilter Rules and +// VirtualNetworkRules resources. type OperationsClient struct { BaseClient } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/hdinsight/mgmt/2015-03-01-preview/hdinsight/applications.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/hdinsight/mgmt/2015-03-01-preview/hdinsight/applications.go index f70f10841..b3d70f419 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/hdinsight/mgmt/2015-03-01-preview/hdinsight/applications.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/hdinsight/mgmt/2015-03-01-preview/hdinsight/applications.go @@ -43,33 +43,28 @@ func NewApplicationsClientWithBaseURI(baseURI string, subscriptionID string) App // Parameters: // resourceGroupName - the name of the resource group. // clusterName - the name of the cluster. +// applicationName - the constant value for the application name. // parameters - the application create request. -func (client ApplicationsClient) Create(ctx context.Context, resourceGroupName string, clusterName string, parameters ApplicationGetProperties) (result Application, err error) { - req, err := client.CreatePreparer(ctx, resourceGroupName, clusterName, parameters) +func (client ApplicationsClient) Create(ctx context.Context, resourceGroupName string, clusterName string, applicationName string, parameters ApplicationProperties) (result ApplicationsCreateFuture, err error) { + req, err := client.CreatePreparer(ctx, resourceGroupName, clusterName, applicationName, parameters) if err != nil { err = autorest.NewErrorWithError(err, "hdinsight.ApplicationsClient", "Create", nil, "Failure preparing request") return } - resp, err := client.CreateSender(req) + result, err = client.CreateSender(req) if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "hdinsight.ApplicationsClient", "Create", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "hdinsight.ApplicationsClient", "Create", result.Response(), "Failure sending request") return } - result, err = client.CreateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "hdinsight.ApplicationsClient", "Create", resp, "Failure responding to request") - } - return } // CreatePreparer prepares the Create request. -func (client ApplicationsClient) CreatePreparer(ctx context.Context, resourceGroupName string, clusterName string, parameters ApplicationGetProperties) (*http.Request, error) { +func (client ApplicationsClient) CreatePreparer(ctx context.Context, resourceGroupName string, clusterName string, applicationName string, parameters ApplicationProperties) (*http.Request, error) { pathParameters := map[string]interface{}{ - "applicationName": autorest.Encode("path", "hue"), + "applicationName": autorest.Encode("path", applicationName), "clusterName": autorest.Encode("path", clusterName), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), @@ -92,9 +87,19 @@ func (client ApplicationsClient) CreatePreparer(ctx context.Context, resourceGro // CreateSender sends the Create request. The method will close the // http.Response Body if it receives an error. -func (client ApplicationsClient) CreateSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, +func (client ApplicationsClient) CreateSender(req *http.Request) (future ApplicationsCreateFuture, err error) { + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return } // CreateResponder handles the response to the Create request. The method always @@ -114,8 +119,9 @@ func (client ApplicationsClient) CreateResponder(resp *http.Response) (result Ap // Parameters: // resourceGroupName - the name of the resource group. // clusterName - the name of the cluster. -func (client ApplicationsClient) Delete(ctx context.Context, resourceGroupName string, clusterName string) (result ApplicationsDeleteFuture, err error) { - req, err := client.DeletePreparer(ctx, resourceGroupName, clusterName) +// applicationName - the constant value for the application name. +func (client ApplicationsClient) Delete(ctx context.Context, resourceGroupName string, clusterName string, applicationName string) (result ApplicationsDeleteFuture, err error) { + req, err := client.DeletePreparer(ctx, resourceGroupName, clusterName, applicationName) if err != nil { err = autorest.NewErrorWithError(err, "hdinsight.ApplicationsClient", "Delete", nil, "Failure preparing request") return @@ -131,9 +137,9 @@ func (client ApplicationsClient) Delete(ctx context.Context, resourceGroupName s } // DeletePreparer prepares the Delete request. -func (client ApplicationsClient) DeletePreparer(ctx context.Context, resourceGroupName string, clusterName string) (*http.Request, error) { +func (client ApplicationsClient) DeletePreparer(ctx context.Context, resourceGroupName string, clusterName string, applicationName string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "applicationName": autorest.Encode("path", "hue"), + "applicationName": autorest.Encode("path", applicationName), "clusterName": autorest.Encode("path", clusterName), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), @@ -161,7 +167,7 @@ func (client ApplicationsClient) DeleteSender(req *http.Request) (future Applica if err != nil { return } - err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK)) + err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted)) if err != nil { return } @@ -175,7 +181,7 @@ func (client ApplicationsClient) DeleteResponder(resp *http.Response) (result au err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp return @@ -250,7 +256,7 @@ func (client ApplicationsClient) GetResponder(resp *http.Response) (result Appli return } -// List lists all of the applications HDInsight cluster. +// List lists all of the applications for the HDInsight cluster. // Parameters: // resourceGroupName - the name of the resource group. // clusterName - the name of the cluster. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/hdinsight/mgmt/2015-03-01-preview/hdinsight/configurations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/hdinsight/mgmt/2015-03-01-preview/hdinsight/configurations.go index 3bebc5fed..0c6118bab 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/hdinsight/mgmt/2015-03-01-preview/hdinsight/configurations.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/hdinsight/mgmt/2015-03-01-preview/hdinsight/configurations.go @@ -21,6 +21,7 @@ import ( "context" "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" "net/http" ) @@ -43,7 +44,7 @@ func NewConfigurationsClientWithBaseURI(baseURI string, subscriptionID string) C // Parameters: // resourceGroupName - the name of the resource group. // clusterName - the name of the cluster. -// configurationName - the constant for configuration type of gateway. +// configurationName - the name of the cluster configuration. func (client ConfigurationsClient) Get(ctx context.Context, resourceGroupName string, clusterName string, configurationName string) (result SetString, err error) { req, err := client.GetPreparer(ctx, resourceGroupName, clusterName, configurationName) if err != nil { @@ -112,9 +113,16 @@ func (client ConfigurationsClient) GetResponder(resp *http.Response) (result Set // Parameters: // resourceGroupName - the name of the resource group. // clusterName - the name of the cluster. -// parameters - the name of the resource group. -func (client ConfigurationsClient) UpdateHTTPSettings(ctx context.Context, resourceGroupName string, clusterName string, parameters HTTPConnectivitySettings) (result ConfigurationsUpdateHTTPSettingsFuture, err error) { - req, err := client.UpdateHTTPSettingsPreparer(ctx, resourceGroupName, clusterName, parameters) +// configurationName - the name of the cluster configuration. +// parameters - the cluster configurations. +func (client ConfigurationsClient) UpdateHTTPSettings(ctx context.Context, resourceGroupName string, clusterName string, configurationName string, parameters map[string]*string) (result ConfigurationsUpdateHTTPSettingsFuture, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("hdinsight.ConfigurationsClient", "UpdateHTTPSettings", err.Error()) + } + + req, err := client.UpdateHTTPSettingsPreparer(ctx, resourceGroupName, clusterName, configurationName, parameters) if err != nil { err = autorest.NewErrorWithError(err, "hdinsight.ConfigurationsClient", "UpdateHTTPSettings", nil, "Failure preparing request") return @@ -130,10 +138,10 @@ func (client ConfigurationsClient) UpdateHTTPSettings(ctx context.Context, resou } // UpdateHTTPSettingsPreparer prepares the UpdateHTTPSettings request. -func (client ConfigurationsClient) UpdateHTTPSettingsPreparer(ctx context.Context, resourceGroupName string, clusterName string, parameters HTTPConnectivitySettings) (*http.Request, error) { +func (client ConfigurationsClient) UpdateHTTPSettingsPreparer(ctx context.Context, resourceGroupName string, clusterName string, configurationName string, parameters map[string]*string) (*http.Request, error) { pathParameters := map[string]interface{}{ "clusterName": autorest.Encode("path", clusterName), - "configurationName": autorest.Encode("path", "gateway"), + "configurationName": autorest.Encode("path", configurationName), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/hdinsight/mgmt/2015-03-01-preview/hdinsight/extension.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/hdinsight/mgmt/2015-03-01-preview/hdinsight/extension.go index d69f4f48d..c9cbdd330 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/hdinsight/mgmt/2015-03-01-preview/hdinsight/extension.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/hdinsight/mgmt/2015-03-01-preview/hdinsight/extension.go @@ -43,9 +43,10 @@ func NewExtensionClientWithBaseURI(baseURI string, subscriptionID string) Extens // Parameters: // resourceGroupName - the name of the resource group. // clusterName - the name of the cluster. +// extensionName - the name of the cluster extension. // parameters - the cluster extensions create request. -func (client ExtensionClient) Create(ctx context.Context, resourceGroupName string, clusterName string, parameters Extension) (result autorest.Response, err error) { - req, err := client.CreatePreparer(ctx, resourceGroupName, clusterName, parameters) +func (client ExtensionClient) Create(ctx context.Context, resourceGroupName string, clusterName string, extensionName string, parameters Extension) (result autorest.Response, err error) { + req, err := client.CreatePreparer(ctx, resourceGroupName, clusterName, extensionName, parameters) if err != nil { err = autorest.NewErrorWithError(err, "hdinsight.ExtensionClient", "Create", nil, "Failure preparing request") return @@ -67,10 +68,10 @@ func (client ExtensionClient) Create(ctx context.Context, resourceGroupName stri } // CreatePreparer prepares the Create request. -func (client ExtensionClient) CreatePreparer(ctx context.Context, resourceGroupName string, clusterName string, parameters Extension) (*http.Request, error) { +func (client ExtensionClient) CreatePreparer(ctx context.Context, resourceGroupName string, clusterName string, extensionName string, parameters Extension) (*http.Request, error) { pathParameters := map[string]interface{}{ "clusterName": autorest.Encode("path", clusterName), - "extensionName": autorest.Encode("path", "clustermonitoring"), + "extensionName": autorest.Encode("path", extensionName), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -113,8 +114,9 @@ func (client ExtensionClient) CreateResponder(resp *http.Response) (result autor // Parameters: // resourceGroupName - the name of the resource group. // clusterName - the name of the cluster. -func (client ExtensionClient) Delete(ctx context.Context, resourceGroupName string, clusterName string) (result autorest.Response, err error) { - req, err := client.DeletePreparer(ctx, resourceGroupName, clusterName) +// extensionName - the name of the cluster extension. +func (client ExtensionClient) Delete(ctx context.Context, resourceGroupName string, clusterName string, extensionName string) (result autorest.Response, err error) { + req, err := client.DeletePreparer(ctx, resourceGroupName, clusterName, extensionName) if err != nil { err = autorest.NewErrorWithError(err, "hdinsight.ExtensionClient", "Delete", nil, "Failure preparing request") return @@ -136,10 +138,10 @@ func (client ExtensionClient) Delete(ctx context.Context, resourceGroupName stri } // DeletePreparer prepares the Delete request. -func (client ExtensionClient) DeletePreparer(ctx context.Context, resourceGroupName string, clusterName string) (*http.Request, error) { +func (client ExtensionClient) DeletePreparer(ctx context.Context, resourceGroupName string, clusterName string, extensionName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "clusterName": autorest.Encode("path", clusterName), - "extensionName": autorest.Encode("path", "clustermonitoring"), + "extensionName": autorest.Encode("path", extensionName), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -323,8 +325,9 @@ func (client ExtensionClient) EnableMonitoringResponder(resp *http.Response) (re // Parameters: // resourceGroupName - the name of the resource group. // clusterName - the name of the cluster. -func (client ExtensionClient) Get(ctx context.Context, resourceGroupName string, clusterName string) (result Extension, err error) { - req, err := client.GetPreparer(ctx, resourceGroupName, clusterName) +// extensionName - the name of the cluster extension. +func (client ExtensionClient) Get(ctx context.Context, resourceGroupName string, clusterName string, extensionName string) (result Extension, err error) { + req, err := client.GetPreparer(ctx, resourceGroupName, clusterName, extensionName) if err != nil { err = autorest.NewErrorWithError(err, "hdinsight.ExtensionClient", "Get", nil, "Failure preparing request") return @@ -346,10 +349,10 @@ func (client ExtensionClient) Get(ctx context.Context, resourceGroupName string, } // GetPreparer prepares the Get request. -func (client ExtensionClient) GetPreparer(ctx context.Context, resourceGroupName string, clusterName string) (*http.Request, error) { +func (client ExtensionClient) GetPreparer(ctx context.Context, resourceGroupName string, clusterName string, extensionName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "clusterName": autorest.Encode("path", clusterName), - "extensionName": autorest.Encode("path", "clustermonitoring"), + "extensionName": autorest.Encode("path", extensionName), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/hdinsight/mgmt/2015-03-01-preview/hdinsight/locations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/hdinsight/mgmt/2015-03-01-preview/hdinsight/locations.go new file mode 100644 index 000000000..6d4d04e32 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/hdinsight/mgmt/2015-03-01-preview/hdinsight/locations.go @@ -0,0 +1,170 @@ +package hdinsight + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "net/http" +) + +// LocationsClient is the hDInsight Management Client +type LocationsClient struct { + BaseClient +} + +// NewLocationsClient creates an instance of the LocationsClient client. +func NewLocationsClient(subscriptionID string) LocationsClient { + return NewLocationsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewLocationsClientWithBaseURI creates an instance of the LocationsClient client. +func NewLocationsClientWithBaseURI(baseURI string, subscriptionID string) LocationsClient { + return LocationsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// GetCapabilities gets the capabilities for the specified location. +// Parameters: +// location - the location. +func (client LocationsClient) GetCapabilities(ctx context.Context, location string) (result CapabilitiesResult, err error) { + req, err := client.GetCapabilitiesPreparer(ctx, location) + if err != nil { + err = autorest.NewErrorWithError(err, "hdinsight.LocationsClient", "GetCapabilities", nil, "Failure preparing request") + return + } + + resp, err := client.GetCapabilitiesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "hdinsight.LocationsClient", "GetCapabilities", resp, "Failure sending request") + return + } + + result, err = client.GetCapabilitiesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "hdinsight.LocationsClient", "GetCapabilities", resp, "Failure responding to request") + } + + return +} + +// GetCapabilitiesPreparer prepares the GetCapabilities request. +func (client LocationsClient) GetCapabilitiesPreparer(ctx context.Context, location string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "location": autorest.Encode("path", location), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-03-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.HDInsight/locations/{location}/capabilities", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetCapabilitiesSender sends the GetCapabilities request. The method will close the +// http.Response Body if it receives an error. +func (client LocationsClient) GetCapabilitiesSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetCapabilitiesResponder handles the response to the GetCapabilities request. The method always +// closes the http.Response Body. +func (client LocationsClient) GetCapabilitiesResponder(resp *http.Response) (result CapabilitiesResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListUsages lists the usages for the specified location. +// Parameters: +// location - the location. +func (client LocationsClient) ListUsages(ctx context.Context, location string) (result UsagesListResult, err error) { + req, err := client.ListUsagesPreparer(ctx, location) + if err != nil { + err = autorest.NewErrorWithError(err, "hdinsight.LocationsClient", "ListUsages", nil, "Failure preparing request") + return + } + + resp, err := client.ListUsagesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "hdinsight.LocationsClient", "ListUsages", resp, "Failure sending request") + return + } + + result, err = client.ListUsagesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "hdinsight.LocationsClient", "ListUsages", resp, "Failure responding to request") + } + + return +} + +// ListUsagesPreparer prepares the ListUsages request. +func (client LocationsClient) ListUsagesPreparer(ctx context.Context, location string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "location": autorest.Encode("path", location), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-03-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.HDInsight/locations/{location}/usages", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListUsagesSender sends the ListUsages request. The method will close the +// http.Response Body if it receives an error. +func (client LocationsClient) ListUsagesSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListUsagesResponder handles the response to the ListUsages request. The method always +// closes the http.Response Body. +func (client LocationsClient) ListUsagesResponder(resp *http.Response) (result UsagesListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/hdinsight/mgmt/2015-03-01-preview/hdinsight/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/hdinsight/mgmt/2015-03-01-preview/hdinsight/models.go index f1f531dce..4171a66fd 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/hdinsight/mgmt/2015-03-01-preview/hdinsight/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/hdinsight/mgmt/2015-03-01-preview/hdinsight/models.go @@ -76,21 +76,6 @@ func PossibleDirectoryTypeValues() []DirectoryType { return []DirectoryType{ActiveDirectory} } -// EnabledCredential enumerates the values for enabled credential. -type EnabledCredential string - -const ( - // False ... - False EnabledCredential = "false" - // True ... - True EnabledCredential = "true" -) - -// PossibleEnabledCredentialValues returns an array of possible values for the EnabledCredential const type. -func PossibleEnabledCredentialValues() []EnabledCredential { - return []EnabledCredential{False, True} -} - // OSType enumerates the values for os type. type OSType string @@ -129,7 +114,7 @@ type Application struct { // Tags - The tags for the application. Tags map[string]*string `json:"tags"` // Properties - The properties of the application. - Properties *ApplicationGetProperties `json:"properties,omitempty"` + Properties *ApplicationProperties `json:"properties,omitempty"` // ID - Fully qualified resource Id for the resource. ID *string `json:"id,omitempty"` // Name - The name of the resource @@ -207,34 +192,6 @@ func (aghe ApplicationGetHTTPSEndpoint) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// ApplicationGetProperties the HDInsight cluster application GET response. -type ApplicationGetProperties struct { - // ComputeProfile - The list of roles in the cluster. - ComputeProfile *ComputeProfile `json:"computeProfile,omitempty"` - // InstallScriptActions - The list of install script actions. - InstallScriptActions *[]RuntimeScriptAction `json:"installScriptActions,omitempty"` - // UninstallScriptActions - The list of uninstall script actions. - UninstallScriptActions *[]RuntimeScriptAction `json:"uninstallScriptActions,omitempty"` - // HTTPSEndpoints - The list of application HTTPS endpoints. - HTTPSEndpoints *[]ApplicationGetHTTPSEndpoint `json:"httpsEndpoints,omitempty"` - // SSHEndpoints - The list of application SSH endpoints. - SSHEndpoints *[]ApplicationGetEndpoint `json:"sshEndpoints,omitempty"` - // ProvisioningState - The provisioning state of the application. - ProvisioningState *string `json:"provisioningState,omitempty"` - // ApplicationType - The application type. - ApplicationType *string `json:"applicationType,omitempty"` - // ApplicationState - The application state. - ApplicationState *string `json:"applicationState,omitempty"` - // Errors - The list of errors. - Errors *[]Errors `json:"errors,omitempty"` - // CreatedDate - The application create date time. - CreatedDate *string `json:"createdDate,omitempty"` - // MarketplaceIdentifier - The marketplace identifier. - MarketplaceIdentifier *string `json:"marketplaceIdentifier,omitempty"` - // AdditionalProperties - The additional properties for application. - AdditionalProperties *string `json:"additionalProperties,omitempty"` -} - // ApplicationListResult result of the request to list cluster Applications. It contains a list of operations and a // URL link to get the next set of results. type ApplicationListResult struct { @@ -338,6 +295,62 @@ func (page ApplicationListResultPage) Values() []Application { return *page.alr.Value } +// ApplicationProperties the HDInsight cluster application GET response. +type ApplicationProperties struct { + // ComputeProfile - The list of roles in the cluster. + ComputeProfile *ComputeProfile `json:"computeProfile,omitempty"` + // InstallScriptActions - The list of install script actions. + InstallScriptActions *[]RuntimeScriptAction `json:"installScriptActions,omitempty"` + // UninstallScriptActions - The list of uninstall script actions. + UninstallScriptActions *[]RuntimeScriptAction `json:"uninstallScriptActions,omitempty"` + // HTTPSEndpoints - The list of application HTTPS endpoints. + HTTPSEndpoints *[]ApplicationGetHTTPSEndpoint `json:"httpsEndpoints,omitempty"` + // SSHEndpoints - The list of application SSH endpoints. + SSHEndpoints *[]ApplicationGetEndpoint `json:"sshEndpoints,omitempty"` + // ProvisioningState - The provisioning state of the application. + ProvisioningState *string `json:"provisioningState,omitempty"` + // ApplicationType - The application type. + ApplicationType *string `json:"applicationType,omitempty"` + // ApplicationState - The application state. + ApplicationState *string `json:"applicationState,omitempty"` + // Errors - The list of errors. + Errors *[]Errors `json:"errors,omitempty"` + // CreatedDate - The application create date time. + CreatedDate *string `json:"createdDate,omitempty"` + // MarketplaceIdentifier - The marketplace identifier. + MarketplaceIdentifier *string `json:"marketplaceIdentifier,omitempty"` + // AdditionalProperties - The additional properties for application. + AdditionalProperties *string `json:"additionalProperties,omitempty"` +} + +// ApplicationsCreateFuture an abstraction for monitoring and retrieving the results of a long-running operation. +type ApplicationsCreateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ApplicationsCreateFuture) Result(client ApplicationsClient) (a Application, err error) { + var done bool + done, err = future.Done(client) + if err != nil { + err = autorest.NewErrorWithError(err, "hdinsight.ApplicationsCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("hdinsight.ApplicationsCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if a.Response.Response, err = future.GetResult(sender); err == nil && a.Response.Response.StatusCode != http.StatusNoContent { + a, err = client.CreateResponder(a.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "hdinsight.ApplicationsCreateFuture", "Result", a.Response.Response, "Failure responding to request") + } + } + return +} + // ApplicationsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. type ApplicationsDeleteFuture struct { azure.Future @@ -676,9 +689,9 @@ type ClusterMonitoringRequest struct { type ClusterMonitoringResponse struct { autorest.Response `json:"-"` // ClusterMonitoringEnabled - The status of the Operations Management Suite (OMS) on the HDInsight cluster. - ClusterMonitoringEnabled *bool `json:"ClusterMonitoringEnabled,omitempty"` + ClusterMonitoringEnabled *bool `json:"clusterMonitoringEnabled,omitempty"` // WorkspaceID - The workspace ID of the Operations Management Suite (OMS) on the HDInsight cluster. - WorkspaceID *string `json:"WorkspaceId,omitempty"` + WorkspaceID *string `json:"workspaceId,omitempty"` } // ClusterPatchParameters the PatchCluster request parameters @@ -848,6 +861,14 @@ type DataDisksGroups struct { DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` } +// ErrorResponse describes the format of Error response. +type ErrorResponse struct { + // Code - Error code + Code *string `json:"code,omitempty"` + // Message - Error message indicating why the operation failed. + Message *string `json:"message,omitempty"` +} + // Errors the error message associated with the cluster creation. type Errors struct { // Code - The error code. @@ -925,16 +946,6 @@ type HardwareProfile struct { VMSize *string `json:"vmSize,omitempty"` } -// HTTPConnectivitySettings the payload for a Configure HTTP settings request. -type HTTPConnectivitySettings struct { - // EnabledCredential - Whether or not the HTTP based authorization is enabled. Possible values include: 'True', 'False' - EnabledCredential EnabledCredential `json:"restAuthCredential.isEnabled,omitempty"` - // Username - The HTTP username. - Username *string `json:"restAuthCredential.username,omitempty"` - // Password - The HTTP user password. - Password *string `json:"restAuthCredential.password,omitempty"` -} - // LinuxOperatingSystemProfile the ssh username, password, and ssh public key. type LinuxOperatingSystemProfile struct { // Username - The username. @@ -945,6 +956,14 @@ type LinuxOperatingSystemProfile struct { SSHProfile *SSHProfile `json:"sshProfile,omitempty"` } +// LocalizedName the details about the localizable name of a type of usage. +type LocalizedName struct { + // Value - The name of the used resource. + Value *string `json:"value,omitempty"` + // LocalizedValue - The localized name of the used resource. + LocalizedValue *string `json:"localizedValue,omitempty"` +} + // Operation the HDInsight REST API operation. type Operation struct { // Name - The operation name: {provider}/{resource}/{operation} @@ -957,7 +976,7 @@ type Operation struct { type OperationDisplay struct { // Provider - The service provider: Microsoft.HDInsight Provider *string `json:"provider,omitempty"` - // Resource - The resource on which the operation is performed: Cluster, Capabilities, etc. + // Resource - The resource on which the operation is performed: Cluster, Applications, etc. Resource *string `json:"resource,omitempty"` // Operation - The operation type: read, write, delete, etc. Operation *string `json:"operation,omitempty"` @@ -1527,6 +1546,25 @@ func (tr TrackedResource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// Usage the details about the usage of a particular limited resource. +type Usage struct { + // Unit - The type of measurement for usage. + Unit *string `json:"unit,omitempty"` + // CurrentValue - The current usage. + CurrentValue *int32 `json:"currentValue,omitempty"` + // Limit - The maximum allowed usage. + Limit *int32 `json:"limit,omitempty"` + // Name - The details about the localizable name of the used resource. + Name *LocalizedName `json:"name,omitempty"` +} + +// UsagesListResult the response for the operation to get regional usages for a subscription. +type UsagesListResult struct { + autorest.Response `json:"-"` + // Value - The list of usages. + Value *[]Usage `json:"value,omitempty"` +} + // VersionsCapability the version capability. type VersionsCapability struct { // Available - The list of version capabilities. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/hdinsight/mgmt/2015-03-01-preview/hdinsight/scriptexecutionhistory.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/hdinsight/mgmt/2015-03-01-preview/hdinsight/scriptexecutionhistory.go index 8412531be..28735f3fc 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/hdinsight/mgmt/2015-03-01-preview/hdinsight/scriptexecutionhistory.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/hdinsight/mgmt/2015-03-01-preview/hdinsight/scriptexecutionhistory.go @@ -138,8 +138,8 @@ func (client ScriptExecutionHistoryClient) ListComplete(ctx context.Context, res // Parameters: // resourceGroupName - the name of the resource group. // clusterName - the name of the cluster. -// scriptExecutionID - the script execution ID. -func (client ScriptExecutionHistoryClient) Promote(ctx context.Context, resourceGroupName string, clusterName string, scriptExecutionID int64) (result autorest.Response, err error) { +// scriptExecutionID - the script execution Id +func (client ScriptExecutionHistoryClient) Promote(ctx context.Context, resourceGroupName string, clusterName string, scriptExecutionID string) (result autorest.Response, err error) { req, err := client.PromotePreparer(ctx, resourceGroupName, clusterName, scriptExecutionID) if err != nil { err = autorest.NewErrorWithError(err, "hdinsight.ScriptExecutionHistoryClient", "Promote", nil, "Failure preparing request") @@ -162,7 +162,7 @@ func (client ScriptExecutionHistoryClient) Promote(ctx context.Context, resource } // PromotePreparer prepares the Promote request. -func (client ScriptExecutionHistoryClient) PromotePreparer(ctx context.Context, resourceGroupName string, clusterName string, scriptExecutionID int64) (*http.Request, error) { +func (client ScriptExecutionHistoryClient) PromotePreparer(ctx context.Context, resourceGroupName string, clusterName string, scriptExecutionID string) (*http.Request, error) { pathParameters := map[string]interface{}{ "clusterName": autorest.Encode("path", clusterName), "resourceGroupName": autorest.Encode("path", resourceGroupName), diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/hdinsight/mgmt/2018-06-01-preview/hdinsight/applications.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/hdinsight/mgmt/2018-06-01-preview/hdinsight/applications.go new file mode 100644 index 000000000..6f6cabc3d --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/hdinsight/mgmt/2018-06-01-preview/hdinsight/applications.go @@ -0,0 +1,352 @@ +package hdinsight + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "net/http" +) + +// ApplicationsClient is the hDInsight Management Client +type ApplicationsClient struct { + BaseClient +} + +// NewApplicationsClient creates an instance of the ApplicationsClient client. +func NewApplicationsClient(subscriptionID string) ApplicationsClient { + return NewApplicationsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewApplicationsClientWithBaseURI creates an instance of the ApplicationsClient client. +func NewApplicationsClientWithBaseURI(baseURI string, subscriptionID string) ApplicationsClient { + return ApplicationsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Create creates applications for the HDInsight cluster. +// Parameters: +// resourceGroupName - the name of the resource group. +// clusterName - the name of the cluster. +// applicationName - the constant value for the application name. +// parameters - the application create request. +func (client ApplicationsClient) Create(ctx context.Context, resourceGroupName string, clusterName string, applicationName string, parameters ApplicationProperties) (result ApplicationsCreateFuture, err error) { + req, err := client.CreatePreparer(ctx, resourceGroupName, clusterName, applicationName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "hdinsight.ApplicationsClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "hdinsight.ApplicationsClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ApplicationsClient) CreatePreparer(ctx context.Context, resourceGroupName string, clusterName string, applicationName string, parameters ApplicationProperties) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "applicationName": autorest.Encode("path", applicationName), + "clusterName": autorest.Encode("path", clusterName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/applications/{applicationName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ApplicationsClient) CreateSender(req *http.Request) (future ApplicationsCreateFuture, err error) { + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ApplicationsClient) CreateResponder(resp *http.Response) (result Application, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes the specified application on the HDInsight cluster. +// Parameters: +// resourceGroupName - the name of the resource group. +// clusterName - the name of the cluster. +// applicationName - the constant value for the application name. +func (client ApplicationsClient) Delete(ctx context.Context, resourceGroupName string, clusterName string, applicationName string) (result ApplicationsDeleteFuture, err error) { + req, err := client.DeletePreparer(ctx, resourceGroupName, clusterName, applicationName) + if err != nil { + err = autorest.NewErrorWithError(err, "hdinsight.ApplicationsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "hdinsight.ApplicationsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ApplicationsClient) DeletePreparer(ctx context.Context, resourceGroupName string, clusterName string, applicationName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "applicationName": autorest.Encode("path", applicationName), + "clusterName": autorest.Encode("path", clusterName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/applications/{applicationName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ApplicationsClient) DeleteSender(req *http.Request) (future ApplicationsDeleteFuture, err error) { + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ApplicationsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets properties of the specified application. +// Parameters: +// resourceGroupName - the name of the resource group. +// clusterName - the name of the cluster. +// applicationName - the constant value for the application name. +func (client ApplicationsClient) Get(ctx context.Context, resourceGroupName string, clusterName string, applicationName string) (result Application, err error) { + req, err := client.GetPreparer(ctx, resourceGroupName, clusterName, applicationName) + if err != nil { + err = autorest.NewErrorWithError(err, "hdinsight.ApplicationsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "hdinsight.ApplicationsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "hdinsight.ApplicationsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client ApplicationsClient) GetPreparer(ctx context.Context, resourceGroupName string, clusterName string, applicationName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "applicationName": autorest.Encode("path", applicationName), + "clusterName": autorest.Encode("path", clusterName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/applications/{applicationName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ApplicationsClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ApplicationsClient) GetResponder(resp *http.Response) (result Application, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByCluster lists all of the applications for the HDInsight cluster. +// Parameters: +// resourceGroupName - the name of the resource group. +// clusterName - the name of the cluster. +func (client ApplicationsClient) ListByCluster(ctx context.Context, resourceGroupName string, clusterName string) (result ApplicationListResultPage, err error) { + result.fn = client.listByClusterNextResults + req, err := client.ListByClusterPreparer(ctx, resourceGroupName, clusterName) + if err != nil { + err = autorest.NewErrorWithError(err, "hdinsight.ApplicationsClient", "ListByCluster", nil, "Failure preparing request") + return + } + + resp, err := client.ListByClusterSender(req) + if err != nil { + result.alr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "hdinsight.ApplicationsClient", "ListByCluster", resp, "Failure sending request") + return + } + + result.alr, err = client.ListByClusterResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "hdinsight.ApplicationsClient", "ListByCluster", resp, "Failure responding to request") + } + + return +} + +// ListByClusterPreparer prepares the ListByCluster request. +func (client ApplicationsClient) ListByClusterPreparer(ctx context.Context, resourceGroupName string, clusterName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/applications", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByClusterSender sends the ListByCluster request. The method will close the +// http.Response Body if it receives an error. +func (client ApplicationsClient) ListByClusterSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByClusterResponder handles the response to the ListByCluster request. The method always +// closes the http.Response Body. +func (client ApplicationsClient) ListByClusterResponder(resp *http.Response) (result ApplicationListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByClusterNextResults retrieves the next set of results, if any. +func (client ApplicationsClient) listByClusterNextResults(lastResults ApplicationListResult) (result ApplicationListResult, err error) { + req, err := lastResults.applicationListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "hdinsight.ApplicationsClient", "listByClusterNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByClusterSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "hdinsight.ApplicationsClient", "listByClusterNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByClusterResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "hdinsight.ApplicationsClient", "listByClusterNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByClusterComplete enumerates all values, automatically crossing page boundaries as required. +func (client ApplicationsClient) ListByClusterComplete(ctx context.Context, resourceGroupName string, clusterName string) (result ApplicationListResultIterator, err error) { + result.page, err = client.ListByCluster(ctx, resourceGroupName, clusterName) + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/hdinsight/mgmt/2018-06-01-preview/hdinsight/client.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/hdinsight/mgmt/2018-06-01-preview/hdinsight/client.go new file mode 100644 index 000000000..19b78b2d7 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/hdinsight/mgmt/2018-06-01-preview/hdinsight/client.go @@ -0,0 +1,51 @@ +// Package hdinsight implements the Azure ARM Hdinsight service API version 2018-06-01-preview. +// +// HDInsight Management Client +package hdinsight + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/Azure/go-autorest/autorest" +) + +const ( + // DefaultBaseURI is the default URI used for the service Hdinsight + DefaultBaseURI = "https://management.azure.com" +) + +// BaseClient is the base client for Hdinsight. +type BaseClient struct { + autorest.Client + BaseURI string + SubscriptionID string +} + +// New creates an instance of the BaseClient client. +func New(subscriptionID string) BaseClient { + return NewWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewWithBaseURI creates an instance of the BaseClient client. +func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { + return BaseClient{ + Client: autorest.NewClientWithUserAgent(UserAgent()), + BaseURI: baseURI, + SubscriptionID: subscriptionID, + } +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/hdinsight/mgmt/2018-06-01-preview/hdinsight/clusters.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/hdinsight/mgmt/2018-06-01-preview/hdinsight/clusters.go new file mode 100644 index 000000000..4f0acbaee --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/hdinsight/mgmt/2018-06-01-preview/hdinsight/clusters.go @@ -0,0 +1,658 @@ +package hdinsight + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// ClustersClient is the hDInsight Management Client +type ClustersClient struct { + BaseClient +} + +// NewClustersClient creates an instance of the ClustersClient client. +func NewClustersClient(subscriptionID string) ClustersClient { + return NewClustersClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewClustersClientWithBaseURI creates an instance of the ClustersClient client. +func NewClustersClientWithBaseURI(baseURI string, subscriptionID string) ClustersClient { + return ClustersClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Create creates a new HDInsight cluster with the specified parameters. +// Parameters: +// resourceGroupName - the name of the resource group. +// clusterName - the name of the cluster. +// parameters - the cluster create request. +func (client ClustersClient) Create(ctx context.Context, resourceGroupName string, clusterName string, parameters ClusterCreateParametersExtended) (result ClustersCreateFuture, err error) { + req, err := client.CreatePreparer(ctx, resourceGroupName, clusterName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "hdinsight.ClustersClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "hdinsight.ClustersClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ClustersClient) CreatePreparer(ctx context.Context, resourceGroupName string, clusterName string, parameters ClusterCreateParametersExtended) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ClustersClient) CreateSender(req *http.Request) (future ClustersCreateFuture, err error) { + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ClustersClient) CreateResponder(resp *http.Response) (result Cluster, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes the specified HDInsight cluster. +// Parameters: +// resourceGroupName - the name of the resource group. +// clusterName - the name of the cluster. +func (client ClustersClient) Delete(ctx context.Context, resourceGroupName string, clusterName string) (result ClustersDeleteFuture, err error) { + req, err := client.DeletePreparer(ctx, resourceGroupName, clusterName) + if err != nil { + err = autorest.NewErrorWithError(err, "hdinsight.ClustersClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "hdinsight.ClustersClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ClustersClient) DeletePreparer(ctx context.Context, resourceGroupName string, clusterName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ClustersClient) DeleteSender(req *http.Request) (future ClustersDeleteFuture, err error) { + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ClustersClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// ExecuteScriptActions executes script actions on the specified HDInsight cluster. +// Parameters: +// resourceGroupName - the name of the resource group. +// clusterName - the name of the cluster. +// parameters - the parameters for executing script actions. +func (client ClustersClient) ExecuteScriptActions(ctx context.Context, resourceGroupName string, clusterName string, parameters ExecuteScriptActionParameters) (result ClustersExecuteScriptActionsFuture, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.PersistOnSuccess", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("hdinsight.ClustersClient", "ExecuteScriptActions", err.Error()) + } + + req, err := client.ExecuteScriptActionsPreparer(ctx, resourceGroupName, clusterName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "hdinsight.ClustersClient", "ExecuteScriptActions", nil, "Failure preparing request") + return + } + + result, err = client.ExecuteScriptActionsSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "hdinsight.ClustersClient", "ExecuteScriptActions", result.Response(), "Failure sending request") + return + } + + return +} + +// ExecuteScriptActionsPreparer prepares the ExecuteScriptActions request. +func (client ClustersClient) ExecuteScriptActionsPreparer(ctx context.Context, resourceGroupName string, clusterName string, parameters ExecuteScriptActionParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/executeScriptActions", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ExecuteScriptActionsSender sends the ExecuteScriptActions request. The method will close the +// http.Response Body if it receives an error. +func (client ClustersClient) ExecuteScriptActionsSender(req *http.Request) (future ClustersExecuteScriptActionsFuture, err error) { + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// ExecuteScriptActionsResponder handles the response to the ExecuteScriptActions request. The method always +// closes the http.Response Body. +func (client ClustersClient) ExecuteScriptActionsResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the specified cluster. +// Parameters: +// resourceGroupName - the name of the resource group. +// clusterName - the name of the cluster. +func (client ClustersClient) Get(ctx context.Context, resourceGroupName string, clusterName string) (result Cluster, err error) { + req, err := client.GetPreparer(ctx, resourceGroupName, clusterName) + if err != nil { + err = autorest.NewErrorWithError(err, "hdinsight.ClustersClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "hdinsight.ClustersClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "hdinsight.ClustersClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client ClustersClient) GetPreparer(ctx context.Context, resourceGroupName string, clusterName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ClustersClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ClustersClient) GetResponder(resp *http.Response) (result Cluster, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists all the HDInsight clusters under the subscription. +func (client ClustersClient) List(ctx context.Context) (result ClusterListResultPage, err error) { + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "hdinsight.ClustersClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.clr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "hdinsight.ClustersClient", "List", resp, "Failure sending request") + return + } + + result.clr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "hdinsight.ClustersClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client ClustersClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.HDInsight/clusters", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ClustersClient) ListSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ClustersClient) ListResponder(resp *http.Response) (result ClusterListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ClustersClient) listNextResults(lastResults ClusterListResult) (result ClusterListResult, err error) { + req, err := lastResults.clusterListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "hdinsight.ClustersClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "hdinsight.ClustersClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "hdinsight.ClustersClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ClustersClient) ListComplete(ctx context.Context) (result ClusterListResultIterator, err error) { + result.page, err = client.List(ctx) + return +} + +// ListByResourceGroup lists the HDInsight clusters in a resource group. +// Parameters: +// resourceGroupName - the name of the resource group. +func (client ClustersClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result ClusterListResultPage, err error) { + result.fn = client.listByResourceGroupNextResults + req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "hdinsight.ClustersClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.clr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "hdinsight.ClustersClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result.clr, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "hdinsight.ClustersClient", "ListByResourceGroup", resp, "Failure responding to request") + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client ClustersClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the +// http.Response Body if it receives an error. +func (client ClustersClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always +// closes the http.Response Body. +func (client ClustersClient) ListByResourceGroupResponder(resp *http.Response) (result ClusterListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByResourceGroupNextResults retrieves the next set of results, if any. +func (client ClustersClient) listByResourceGroupNextResults(lastResults ClusterListResult) (result ClusterListResult, err error) { + req, err := lastResults.clusterListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "hdinsight.ClustersClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "hdinsight.ClustersClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "hdinsight.ClustersClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client ClustersClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result ClusterListResultIterator, err error) { + result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) + return +} + +// Resize resizes the specified HDInsight cluster to the specified size. +// Parameters: +// resourceGroupName - the name of the resource group. +// clusterName - the name of the cluster. +// parameters - the parameters for the resize operation. +func (client ClustersClient) Resize(ctx context.Context, resourceGroupName string, clusterName string, parameters ClusterResizeParameters) (result ClustersResizeFuture, err error) { + req, err := client.ResizePreparer(ctx, resourceGroupName, clusterName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "hdinsight.ClustersClient", "Resize", nil, "Failure preparing request") + return + } + + result, err = client.ResizeSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "hdinsight.ClustersClient", "Resize", result.Response(), "Failure sending request") + return + } + + return +} + +// ResizePreparer prepares the Resize request. +func (client ClustersClient) ResizePreparer(ctx context.Context, resourceGroupName string, clusterName string, parameters ClusterResizeParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "roleName": autorest.Encode("path", "workernode"), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/roles/{roleName}/resize", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ResizeSender sends the Resize request. The method will close the +// http.Response Body if it receives an error. +func (client ClustersClient) ResizeSender(req *http.Request) (future ClustersResizeFuture, err error) { + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// ResizeResponder handles the response to the Resize request. The method always +// closes the http.Response Body. +func (client ClustersClient) ResizeResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// Update patch HDInsight cluster with the specified parameters. +// Parameters: +// resourceGroupName - the name of the resource group. +// clusterName - the name of the cluster. +// parameters - the cluster patch request. +func (client ClustersClient) Update(ctx context.Context, resourceGroupName string, clusterName string, parameters ClusterPatchParameters) (result Cluster, err error) { + req, err := client.UpdatePreparer(ctx, resourceGroupName, clusterName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "hdinsight.ClustersClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "hdinsight.ClustersClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "hdinsight.ClustersClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client ClustersClient) UpdatePreparer(ctx context.Context, resourceGroupName string, clusterName string, parameters ClusterPatchParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client ClustersClient) UpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client ClustersClient) UpdateResponder(resp *http.Response) (result Cluster, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/hdinsight/mgmt/2018-06-01-preview/hdinsight/configurations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/hdinsight/mgmt/2018-06-01-preview/hdinsight/configurations.go new file mode 100644 index 000000000..6abb70cb0 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/hdinsight/mgmt/2018-06-01-preview/hdinsight/configurations.go @@ -0,0 +1,191 @@ +package hdinsight + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// ConfigurationsClient is the hDInsight Management Client +type ConfigurationsClient struct { + BaseClient +} + +// NewConfigurationsClient creates an instance of the ConfigurationsClient client. +func NewConfigurationsClient(subscriptionID string) ConfigurationsClient { + return NewConfigurationsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewConfigurationsClientWithBaseURI creates an instance of the ConfigurationsClient client. +func NewConfigurationsClientWithBaseURI(baseURI string, subscriptionID string) ConfigurationsClient { + return ConfigurationsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get the configuration object for the specified cluster. +// Parameters: +// resourceGroupName - the name of the resource group. +// clusterName - the name of the cluster. +// configurationName - the name of the cluster configuration. +func (client ConfigurationsClient) Get(ctx context.Context, resourceGroupName string, clusterName string, configurationName string) (result SetString, err error) { + req, err := client.GetPreparer(ctx, resourceGroupName, clusterName, configurationName) + if err != nil { + err = autorest.NewErrorWithError(err, "hdinsight.ConfigurationsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "hdinsight.ConfigurationsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "hdinsight.ConfigurationsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client ConfigurationsClient) GetPreparer(ctx context.Context, resourceGroupName string, clusterName string, configurationName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "configurationName": autorest.Encode("path", configurationName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/configurations/{configurationName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ConfigurationsClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ConfigurationsClient) GetResponder(resp *http.Response) (result SetString, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UpdateHTTPSettings configures the HTTP settings on the specified cluster. +// Parameters: +// resourceGroupName - the name of the resource group. +// clusterName - the name of the cluster. +// configurationName - the name of the cluster configuration. +// parameters - the cluster configurations. +func (client ConfigurationsClient) UpdateHTTPSettings(ctx context.Context, resourceGroupName string, clusterName string, configurationName string, parameters map[string]*string) (result ConfigurationsUpdateHTTPSettingsFuture, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("hdinsight.ConfigurationsClient", "UpdateHTTPSettings", err.Error()) + } + + req, err := client.UpdateHTTPSettingsPreparer(ctx, resourceGroupName, clusterName, configurationName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "hdinsight.ConfigurationsClient", "UpdateHTTPSettings", nil, "Failure preparing request") + return + } + + result, err = client.UpdateHTTPSettingsSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "hdinsight.ConfigurationsClient", "UpdateHTTPSettings", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdateHTTPSettingsPreparer prepares the UpdateHTTPSettings request. +func (client ConfigurationsClient) UpdateHTTPSettingsPreparer(ctx context.Context, resourceGroupName string, clusterName string, configurationName string, parameters map[string]*string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "configurationName": autorest.Encode("path", configurationName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/configurations/{configurationName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateHTTPSettingsSender sends the UpdateHTTPSettings request. The method will close the +// http.Response Body if it receives an error. +func (client ConfigurationsClient) UpdateHTTPSettingsSender(req *http.Request) (future ConfigurationsUpdateHTTPSettingsFuture, err error) { + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// UpdateHTTPSettingsResponder handles the response to the UpdateHTTPSettings request. The method always +// closes the http.Response Body. +func (client ConfigurationsClient) UpdateHTTPSettingsResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/hdinsight/mgmt/2018-06-01-preview/hdinsight/extensions.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/hdinsight/mgmt/2018-06-01-preview/hdinsight/extensions.go new file mode 100644 index 000000000..f01005716 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/hdinsight/mgmt/2018-06-01-preview/hdinsight/extensions.go @@ -0,0 +1,466 @@ +package hdinsight + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "net/http" +) + +// ExtensionsClient is the hDInsight Management Client +type ExtensionsClient struct { + BaseClient +} + +// NewExtensionsClient creates an instance of the ExtensionsClient client. +func NewExtensionsClient(subscriptionID string) ExtensionsClient { + return NewExtensionsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewExtensionsClientWithBaseURI creates an instance of the ExtensionsClient client. +func NewExtensionsClientWithBaseURI(baseURI string, subscriptionID string) ExtensionsClient { + return ExtensionsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Create creates an HDInsight cluster extension. +// Parameters: +// resourceGroupName - the name of the resource group. +// clusterName - the name of the cluster. +// extensionName - the name of the cluster extension. +// parameters - the cluster extensions create request. +func (client ExtensionsClient) Create(ctx context.Context, resourceGroupName string, clusterName string, extensionName string, parameters Extension) (result ExtensionsCreateFuture, err error) { + req, err := client.CreatePreparer(ctx, resourceGroupName, clusterName, extensionName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "hdinsight.ExtensionsClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "hdinsight.ExtensionsClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ExtensionsClient) CreatePreparer(ctx context.Context, resourceGroupName string, clusterName string, extensionName string, parameters Extension) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "extensionName": autorest.Encode("path", extensionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/extensions/{extensionName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ExtensionsClient) CreateSender(req *http.Request) (future ExtensionsCreateFuture, err error) { + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ExtensionsClient) CreateResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// Delete deletes the specified extension for HDInsight cluster. +// Parameters: +// resourceGroupName - the name of the resource group. +// clusterName - the name of the cluster. +// extensionName - the name of the cluster extension. +func (client ExtensionsClient) Delete(ctx context.Context, resourceGroupName string, clusterName string, extensionName string) (result ExtensionsDeleteFuture, err error) { + req, err := client.DeletePreparer(ctx, resourceGroupName, clusterName, extensionName) + if err != nil { + err = autorest.NewErrorWithError(err, "hdinsight.ExtensionsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "hdinsight.ExtensionsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ExtensionsClient) DeletePreparer(ctx context.Context, resourceGroupName string, clusterName string, extensionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "extensionName": autorest.Encode("path", extensionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/extensions/{extensionName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ExtensionsClient) DeleteSender(req *http.Request) (future ExtensionsDeleteFuture, err error) { + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ExtensionsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// DisableMonitoring disables the Operations Management Suite (OMS) on the HDInsight cluster. +// Parameters: +// resourceGroupName - the name of the resource group. +// clusterName - the name of the cluster. +func (client ExtensionsClient) DisableMonitoring(ctx context.Context, resourceGroupName string, clusterName string) (result ExtensionsDisableMonitoringFuture, err error) { + req, err := client.DisableMonitoringPreparer(ctx, resourceGroupName, clusterName) + if err != nil { + err = autorest.NewErrorWithError(err, "hdinsight.ExtensionsClient", "DisableMonitoring", nil, "Failure preparing request") + return + } + + result, err = client.DisableMonitoringSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "hdinsight.ExtensionsClient", "DisableMonitoring", result.Response(), "Failure sending request") + return + } + + return +} + +// DisableMonitoringPreparer prepares the DisableMonitoring request. +func (client ExtensionsClient) DisableMonitoringPreparer(ctx context.Context, resourceGroupName string, clusterName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/extensions/clustermonitoring", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DisableMonitoringSender sends the DisableMonitoring request. The method will close the +// http.Response Body if it receives an error. +func (client ExtensionsClient) DisableMonitoringSender(req *http.Request) (future ExtensionsDisableMonitoringFuture, err error) { + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// DisableMonitoringResponder handles the response to the DisableMonitoring request. The method always +// closes the http.Response Body. +func (client ExtensionsClient) DisableMonitoringResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// EnableMonitoring enables the Operations Management Suite (OMS) on the HDInsight cluster. +// Parameters: +// resourceGroupName - the name of the resource group. +// clusterName - the name of the cluster. +// parameters - the Operations Management Suite (OMS) workspace parameters. +func (client ExtensionsClient) EnableMonitoring(ctx context.Context, resourceGroupName string, clusterName string, parameters ClusterMonitoringRequest) (result ExtensionsEnableMonitoringFuture, err error) { + req, err := client.EnableMonitoringPreparer(ctx, resourceGroupName, clusterName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "hdinsight.ExtensionsClient", "EnableMonitoring", nil, "Failure preparing request") + return + } + + result, err = client.EnableMonitoringSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "hdinsight.ExtensionsClient", "EnableMonitoring", result.Response(), "Failure sending request") + return + } + + return +} + +// EnableMonitoringPreparer prepares the EnableMonitoring request. +func (client ExtensionsClient) EnableMonitoringPreparer(ctx context.Context, resourceGroupName string, clusterName string, parameters ClusterMonitoringRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/extensions/clustermonitoring", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// EnableMonitoringSender sends the EnableMonitoring request. The method will close the +// http.Response Body if it receives an error. +func (client ExtensionsClient) EnableMonitoringSender(req *http.Request) (future ExtensionsEnableMonitoringFuture, err error) { + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// EnableMonitoringResponder handles the response to the EnableMonitoring request. The method always +// closes the http.Response Body. +func (client ExtensionsClient) EnableMonitoringResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the extension properties for the specified HDInsight cluster extension. +// Parameters: +// resourceGroupName - the name of the resource group. +// clusterName - the name of the cluster. +// extensionName - the name of the cluster extension. +func (client ExtensionsClient) Get(ctx context.Context, resourceGroupName string, clusterName string, extensionName string) (result Extension, err error) { + req, err := client.GetPreparer(ctx, resourceGroupName, clusterName, extensionName) + if err != nil { + err = autorest.NewErrorWithError(err, "hdinsight.ExtensionsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "hdinsight.ExtensionsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "hdinsight.ExtensionsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client ExtensionsClient) GetPreparer(ctx context.Context, resourceGroupName string, clusterName string, extensionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "extensionName": autorest.Encode("path", extensionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/extensions/{extensionName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ExtensionsClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ExtensionsClient) GetResponder(resp *http.Response) (result Extension, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetMonitoringStatus gets the status of Operations Management Suite (OMS) on the HDInsight cluster. +// Parameters: +// resourceGroupName - the name of the resource group. +// clusterName - the name of the cluster. +func (client ExtensionsClient) GetMonitoringStatus(ctx context.Context, resourceGroupName string, clusterName string) (result ClusterMonitoringResponse, err error) { + req, err := client.GetMonitoringStatusPreparer(ctx, resourceGroupName, clusterName) + if err != nil { + err = autorest.NewErrorWithError(err, "hdinsight.ExtensionsClient", "GetMonitoringStatus", nil, "Failure preparing request") + return + } + + resp, err := client.GetMonitoringStatusSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "hdinsight.ExtensionsClient", "GetMonitoringStatus", resp, "Failure sending request") + return + } + + result, err = client.GetMonitoringStatusResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "hdinsight.ExtensionsClient", "GetMonitoringStatus", resp, "Failure responding to request") + } + + return +} + +// GetMonitoringStatusPreparer prepares the GetMonitoringStatus request. +func (client ExtensionsClient) GetMonitoringStatusPreparer(ctx context.Context, resourceGroupName string, clusterName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/extensions/clustermonitoring", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetMonitoringStatusSender sends the GetMonitoringStatus request. The method will close the +// http.Response Body if it receives an error. +func (client ExtensionsClient) GetMonitoringStatusSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetMonitoringStatusResponder handles the response to the GetMonitoringStatus request. The method always +// closes the http.Response Body. +func (client ExtensionsClient) GetMonitoringStatusResponder(resp *http.Response) (result ClusterMonitoringResponse, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/hdinsight/mgmt/2015-03-01-preview/hdinsight/location.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/hdinsight/mgmt/2018-06-01-preview/hdinsight/locations.go similarity index 51% rename from vendor/github.com/Azure/azure-sdk-for-go/services/preview/hdinsight/mgmt/2015-03-01-preview/hdinsight/location.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/preview/hdinsight/mgmt/2018-06-01-preview/hdinsight/locations.go index 37daa1980..05627d788 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/hdinsight/mgmt/2015-03-01-preview/hdinsight/location.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/hdinsight/mgmt/2018-06-01-preview/hdinsight/locations.go @@ -24,54 +24,54 @@ import ( "net/http" ) -// LocationClient is the hDInsight Management Client -type LocationClient struct { +// LocationsClient is the hDInsight Management Client +type LocationsClient struct { BaseClient } -// NewLocationClient creates an instance of the LocationClient client. -func NewLocationClient(subscriptionID string) LocationClient { - return NewLocationClientWithBaseURI(DefaultBaseURI, subscriptionID) +// NewLocationsClient creates an instance of the LocationsClient client. +func NewLocationsClient(subscriptionID string) LocationsClient { + return NewLocationsClientWithBaseURI(DefaultBaseURI, subscriptionID) } -// NewLocationClientWithBaseURI creates an instance of the LocationClient client. -func NewLocationClientWithBaseURI(baseURI string, subscriptionID string) LocationClient { - return LocationClient{NewWithBaseURI(baseURI, subscriptionID)} +// NewLocationsClientWithBaseURI creates an instance of the LocationsClient client. +func NewLocationsClientWithBaseURI(baseURI string, subscriptionID string) LocationsClient { + return LocationsClient{NewWithBaseURI(baseURI, subscriptionID)} } -// GetCapabilities gets the capabilities for the specified location. +// ListUsages lists the usages for the specified location. // Parameters: // location - the location to get capabilities for. -func (client LocationClient) GetCapabilities(ctx context.Context, location string) (result CapabilitiesResult, err error) { - req, err := client.GetCapabilitiesPreparer(ctx, location) +func (client LocationsClient) ListUsages(ctx context.Context, location string) (result UsagesListResult, err error) { + req, err := client.ListUsagesPreparer(ctx, location) if err != nil { - err = autorest.NewErrorWithError(err, "hdinsight.LocationClient", "GetCapabilities", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "hdinsight.LocationsClient", "ListUsages", nil, "Failure preparing request") return } - resp, err := client.GetCapabilitiesSender(req) + resp, err := client.ListUsagesSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "hdinsight.LocationClient", "GetCapabilities", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "hdinsight.LocationsClient", "ListUsages", resp, "Failure sending request") return } - result, err = client.GetCapabilitiesResponder(resp) + result, err = client.ListUsagesResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "hdinsight.LocationClient", "GetCapabilities", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "hdinsight.LocationsClient", "ListUsages", resp, "Failure responding to request") } return } -// GetCapabilitiesPreparer prepares the GetCapabilities request. -func (client LocationClient) GetCapabilitiesPreparer(ctx context.Context, location string) (*http.Request, error) { +// ListUsagesPreparer prepares the ListUsages request. +func (client LocationsClient) ListUsagesPreparer(ctx context.Context, location string) (*http.Request, error) { pathParameters := map[string]interface{}{ "location": autorest.Encode("path", location), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2015-03-01-preview" + const APIVersion = "2018-06-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -79,21 +79,21 @@ func (client LocationClient) GetCapabilitiesPreparer(ctx context.Context, locati preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.HDInsight/locations/{location}/capabilities", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.HDInsight/locations/{location}/usages", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// GetCapabilitiesSender sends the GetCapabilities request. The method will close the +// ListUsagesSender sends the ListUsages request. The method will close the // http.Response Body if it receives an error. -func (client LocationClient) GetCapabilitiesSender(req *http.Request) (*http.Response, error) { +func (client LocationsClient) ListUsagesSender(req *http.Request) (*http.Response, error) { return autorest.SendWithSender(client, req, azure.DoRetryWithRegistration(client.Client)) } -// GetCapabilitiesResponder handles the response to the GetCapabilities request. The method always +// ListUsagesResponder handles the response to the ListUsages request. The method always // closes the http.Response Body. -func (client LocationClient) GetCapabilitiesResponder(resp *http.Response) (result CapabilitiesResult, err error) { +func (client LocationsClient) ListUsagesResponder(resp *http.Response) (result UsagesListResult, err error) { err = autorest.Respond( resp, client.ByInspecting(), diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/hdinsight/mgmt/2018-06-01-preview/hdinsight/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/hdinsight/mgmt/2018-06-01-preview/hdinsight/models.go new file mode 100644 index 000000000..ad5634d95 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/hdinsight/mgmt/2018-06-01-preview/hdinsight/models.go @@ -0,0 +1,1555 @@ +package hdinsight + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "encoding/json" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/to" + "net/http" +) + +// AsyncOperationState enumerates the values for async operation state. +type AsyncOperationState string + +const ( + // Failed ... + Failed AsyncOperationState = "Failed" + // InProgress ... + InProgress AsyncOperationState = "InProgress" + // Succeeded ... + Succeeded AsyncOperationState = "Succeeded" +) + +// PossibleAsyncOperationStateValues returns an array of possible values for the AsyncOperationState const type. +func PossibleAsyncOperationStateValues() []AsyncOperationState { + return []AsyncOperationState{Failed, InProgress, Succeeded} +} + +// ClusterProvisioningState enumerates the values for cluster provisioning state. +type ClusterProvisioningState string + +const ( + // ClusterProvisioningStateCanceled ... + ClusterProvisioningStateCanceled ClusterProvisioningState = "Canceled" + // ClusterProvisioningStateDeleting ... + ClusterProvisioningStateDeleting ClusterProvisioningState = "Deleting" + // ClusterProvisioningStateFailed ... + ClusterProvisioningStateFailed ClusterProvisioningState = "Failed" + // ClusterProvisioningStateInProgress ... + ClusterProvisioningStateInProgress ClusterProvisioningState = "InProgress" + // ClusterProvisioningStateSucceeded ... + ClusterProvisioningStateSucceeded ClusterProvisioningState = "Succeeded" +) + +// PossibleClusterProvisioningStateValues returns an array of possible values for the ClusterProvisioningState const type. +func PossibleClusterProvisioningStateValues() []ClusterProvisioningState { + return []ClusterProvisioningState{ClusterProvisioningStateCanceled, ClusterProvisioningStateDeleting, ClusterProvisioningStateFailed, ClusterProvisioningStateInProgress, ClusterProvisioningStateSucceeded} +} + +// DirectoryType enumerates the values for directory type. +type DirectoryType string + +const ( + // ActiveDirectory ... + ActiveDirectory DirectoryType = "ActiveDirectory" +) + +// PossibleDirectoryTypeValues returns an array of possible values for the DirectoryType const type. +func PossibleDirectoryTypeValues() []DirectoryType { + return []DirectoryType{ActiveDirectory} +} + +// OSType enumerates the values for os type. +type OSType string + +const ( + // Linux ... + Linux OSType = "Linux" + // Windows ... + Windows OSType = "Windows" +) + +// PossibleOSTypeValues returns an array of possible values for the OSType const type. +func PossibleOSTypeValues() []OSType { + return []OSType{Linux, Windows} +} + +// Tier enumerates the values for tier. +type Tier string + +const ( + // Premium ... + Premium Tier = "Premium" + // Standard ... + Standard Tier = "Standard" +) + +// PossibleTierValues returns an array of possible values for the Tier const type. +func PossibleTierValues() []Tier { + return []Tier{Premium, Standard} +} + +// Application the HDInsight cluster application +type Application struct { + autorest.Response `json:"-"` + // Etag - The ETag for the application + Etag *string `json:"etag,omitempty"` + // Tags - The tags for the application. + Tags map[string]*string `json:"tags"` + // Properties - The properties of the application. + Properties *ApplicationProperties `json:"properties,omitempty"` + // ID - Fully qualified resource Id for the resource. + ID *string `json:"id,omitempty"` + // Name - The name of the resource + Name *string `json:"name,omitempty"` + // Type - The type of the resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Application. +func (a Application) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if a.Etag != nil { + objectMap["etag"] = a.Etag + } + if a.Tags != nil { + objectMap["tags"] = a.Tags + } + if a.Properties != nil { + objectMap["properties"] = a.Properties + } + if a.ID != nil { + objectMap["id"] = a.ID + } + if a.Name != nil { + objectMap["name"] = a.Name + } + if a.Type != nil { + objectMap["type"] = a.Type + } + return json.Marshal(objectMap) +} + +// ApplicationGetEndpoint gets the application SSH endpoint +type ApplicationGetEndpoint struct { + // Location - The location of the endpoint. + Location *string `json:"location,omitempty"` + // DestinationPort - The destination port to connect to. + DestinationPort *int32 `json:"destinationPort,omitempty"` + // PublicPort - The public port to connect to. + PublicPort *int32 `json:"publicPort,omitempty"` +} + +// ApplicationGetHTTPSEndpoint gets the application HTTP endpoints. +type ApplicationGetHTTPSEndpoint struct { + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]*string `json:""` + // AccessModes - The list of access modes for the application. + AccessModes *[]string `json:"accessModes,omitempty"` + // Location - The location of the endpoint. + Location *string `json:"location,omitempty"` + // DestinationPort - The destination port to connect to. + DestinationPort *int32 `json:"destinationPort,omitempty"` + // PublicPort - The public port to connect to. + PublicPort *int32 `json:"publicPort,omitempty"` +} + +// MarshalJSON is the custom marshaler for ApplicationGetHTTPSEndpoint. +func (aghe ApplicationGetHTTPSEndpoint) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if aghe.AccessModes != nil { + objectMap["accessModes"] = aghe.AccessModes + } + if aghe.Location != nil { + objectMap["location"] = aghe.Location + } + if aghe.DestinationPort != nil { + objectMap["destinationPort"] = aghe.DestinationPort + } + if aghe.PublicPort != nil { + objectMap["publicPort"] = aghe.PublicPort + } + for k, v := range aghe.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// ApplicationListResult result of the request to list cluster Applications. It contains a list of operations and a +// URL link to get the next set of results. +type ApplicationListResult struct { + autorest.Response `json:"-"` + // Value - The list of HDInsight applications installed on HDInsight cluster. + Value *[]Application `json:"value,omitempty"` + // NextLink - The URL to get the next set of operation list results if there are any. + NextLink *string `json:"nextLink,omitempty"` +} + +// ApplicationListResultIterator provides access to a complete listing of Application values. +type ApplicationListResultIterator struct { + i int + page ApplicationListResultPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ApplicationListResultIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ApplicationListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ApplicationListResultIterator) Response() ApplicationListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ApplicationListResultIterator) Value() Application { + if !iter.page.NotDone() { + return Application{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (alr ApplicationListResult) IsEmpty() bool { + return alr.Value == nil || len(*alr.Value) == 0 +} + +// applicationListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (alr ApplicationListResult) applicationListResultPreparer() (*http.Request, error) { + if alr.NextLink == nil || len(to.String(alr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(alr.NextLink))) +} + +// ApplicationListResultPage contains a page of Application values. +type ApplicationListResultPage struct { + fn func(ApplicationListResult) (ApplicationListResult, error) + alr ApplicationListResult +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ApplicationListResultPage) Next() error { + next, err := page.fn(page.alr) + if err != nil { + return err + } + page.alr = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ApplicationListResultPage) NotDone() bool { + return !page.alr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ApplicationListResultPage) Response() ApplicationListResult { + return page.alr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ApplicationListResultPage) Values() []Application { + if page.alr.IsEmpty() { + return nil + } + return *page.alr.Value +} + +// ApplicationProperties the HDInsight cluster application GET response. +type ApplicationProperties struct { + // ComputeProfile - The list of roles in the cluster. + ComputeProfile *ComputeProfile `json:"computeProfile,omitempty"` + // InstallScriptActions - The list of install script actions. + InstallScriptActions *[]RuntimeScriptAction `json:"installScriptActions,omitempty"` + // UninstallScriptActions - The list of uninstall script actions. + UninstallScriptActions *[]RuntimeScriptAction `json:"uninstallScriptActions,omitempty"` + // HTTPSEndpoints - The list of application HTTPS endpoints. + HTTPSEndpoints *[]ApplicationGetHTTPSEndpoint `json:"httpsEndpoints,omitempty"` + // SSHEndpoints - The list of application SSH endpoints. + SSHEndpoints *[]ApplicationGetEndpoint `json:"sshEndpoints,omitempty"` + // ProvisioningState - The provisioning state of the application. + ProvisioningState *string `json:"provisioningState,omitempty"` + // ApplicationType - The application type. + ApplicationType *string `json:"applicationType,omitempty"` + // ApplicationState - The application state. + ApplicationState *string `json:"applicationState,omitempty"` + // Errors - The list of errors. + Errors *[]Errors `json:"errors,omitempty"` + // CreatedDate - The application create date time. + CreatedDate *string `json:"createdDate,omitempty"` + // MarketplaceIdentifier - The marketplace identifier. + MarketplaceIdentifier *string `json:"marketplaceIdentifier,omitempty"` + // AdditionalProperties - The additional properties for application. + AdditionalProperties *string `json:"additionalProperties,omitempty"` +} + +// ApplicationsCreateFuture an abstraction for monitoring and retrieving the results of a long-running operation. +type ApplicationsCreateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ApplicationsCreateFuture) Result(client ApplicationsClient) (a Application, err error) { + var done bool + done, err = future.Done(client) + if err != nil { + err = autorest.NewErrorWithError(err, "hdinsight.ApplicationsCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("hdinsight.ApplicationsCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if a.Response.Response, err = future.GetResult(sender); err == nil && a.Response.Response.StatusCode != http.StatusNoContent { + a, err = client.CreateResponder(a.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "hdinsight.ApplicationsCreateFuture", "Result", a.Response.Response, "Failure responding to request") + } + } + return +} + +// ApplicationsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. +type ApplicationsDeleteFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ApplicationsDeleteFuture) Result(client ApplicationsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.Done(client) + if err != nil { + err = autorest.NewErrorWithError(err, "hdinsight.ApplicationsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("hdinsight.ApplicationsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// Cluster the HDInsight cluster. +type Cluster struct { + autorest.Response `json:"-"` + // Etag - The ETag for the resource + Etag *string `json:"etag,omitempty"` + // Properties - The properties of the cluster. + Properties *ClusterGetProperties `json:"properties,omitempty"` + // Location - The Azure Region where the resource lives + Location *string `json:"location,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // ID - Fully qualified resource Id for the resource. + ID *string `json:"id,omitempty"` + // Name - The name of the resource + Name *string `json:"name,omitempty"` + // Type - The type of the resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Cluster. +func (c Cluster) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if c.Etag != nil { + objectMap["etag"] = c.Etag + } + if c.Properties != nil { + objectMap["properties"] = c.Properties + } + if c.Location != nil { + objectMap["location"] = c.Location + } + if c.Tags != nil { + objectMap["tags"] = c.Tags + } + if c.ID != nil { + objectMap["id"] = c.ID + } + if c.Name != nil { + objectMap["name"] = c.Name + } + if c.Type != nil { + objectMap["type"] = c.Type + } + return json.Marshal(objectMap) +} + +// ClusterCreateParametersExtended the CreateCluster request parameters. +type ClusterCreateParametersExtended struct { + // Location - The location of the cluster. + Location *string `json:"location,omitempty"` + // Tags - The resource tags. + Tags map[string]*string `json:"tags"` + // Properties - The cluster create parameters. + Properties *ClusterCreateProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for ClusterCreateParametersExtended. +func (ccpe ClusterCreateParametersExtended) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ccpe.Location != nil { + objectMap["location"] = ccpe.Location + } + if ccpe.Tags != nil { + objectMap["tags"] = ccpe.Tags + } + if ccpe.Properties != nil { + objectMap["properties"] = ccpe.Properties + } + return json.Marshal(objectMap) +} + +// ClusterCreateProperties the cluster create parameters. +type ClusterCreateProperties struct { + // ClusterVersion - The version of the cluster. + ClusterVersion *string `json:"clusterVersion,omitempty"` + // OsType - The type of operating system. Possible values include: 'Windows', 'Linux' + OsType OSType `json:"osType,omitempty"` + // Tier - The cluster tier. Possible values include: 'Standard', 'Premium' + Tier Tier `json:"tier,omitempty"` + // ClusterDefinition - The cluster definition. + ClusterDefinition *ClusterDefinition `json:"clusterDefinition,omitempty"` + // SecurityProfile - The security profile. + SecurityProfile *SecurityProfile `json:"securityProfile,omitempty"` + // ComputeProfile - The compute profile. + ComputeProfile *ComputeProfile `json:"computeProfile,omitempty"` + // StorageProfile - The storage profile. + StorageProfile *StorageProfile `json:"storageProfile,omitempty"` +} + +// ClusterDefinition the cluster definition. +type ClusterDefinition struct { + // Blueprint - The link to the blueprint. + Blueprint *string `json:"blueprint,omitempty"` + // Kind - The type of cluster. + Kind *string `json:"kind,omitempty"` + // ComponentVersion - The versions of different services in the cluster. + ComponentVersion map[string]*string `json:"componentVersion"` + // Configurations - The cluster configurations. + Configurations interface{} `json:"configurations,omitempty"` +} + +// MarshalJSON is the custom marshaler for ClusterDefinition. +func (cd ClusterDefinition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cd.Blueprint != nil { + objectMap["blueprint"] = cd.Blueprint + } + if cd.Kind != nil { + objectMap["kind"] = cd.Kind + } + if cd.ComponentVersion != nil { + objectMap["componentVersion"] = cd.ComponentVersion + } + objectMap["configurations"] = cd.Configurations + return json.Marshal(objectMap) +} + +// ClusterGetProperties the properties of cluster. +type ClusterGetProperties struct { + // ClusterVersion - The version of the cluster. + ClusterVersion *string `json:"clusterVersion,omitempty"` + // OsType - The type of operating system. Possible values include: 'Windows', 'Linux' + OsType OSType `json:"osType,omitempty"` + // Tier - The cluster tier. Possible values include: 'Standard', 'Premium' + Tier Tier `json:"tier,omitempty"` + // ClusterDefinition - The cluster definition. + ClusterDefinition *ClusterDefinition `json:"clusterDefinition,omitempty"` + // SecurityProfile - The security profile. + SecurityProfile *SecurityProfile `json:"securityProfile,omitempty"` + // ComputeProfile - The compute profile. + ComputeProfile *ComputeProfile `json:"computeProfile,omitempty"` + // ProvisioningState - The provisioning state, which only appears in the response. Possible values include: 'ClusterProvisioningStateInProgress', 'ClusterProvisioningStateFailed', 'ClusterProvisioningStateSucceeded', 'ClusterProvisioningStateCanceled', 'ClusterProvisioningStateDeleting' + ProvisioningState ClusterProvisioningState `json:"provisioningState,omitempty"` + // CreatedDate - The date on which the cluster was created. + CreatedDate *string `json:"createdDate,omitempty"` + // ClusterState - The state of the cluster. + ClusterState *string `json:"clusterState,omitempty"` + // QuotaInfo - The quota information. + QuotaInfo *QuotaInfo `json:"quotaInfo,omitempty"` + // Errors - The list of errors. + Errors *[]Errors `json:"errors,omitempty"` + // ConnectivityEndpoints - The list of connectivity endpoints. + ConnectivityEndpoints *[]ConnectivityEndpoint `json:"connectivityEndpoints,omitempty"` +} + +// ClusterListPersistedScriptActionsResult the ListPersistedScriptActions operation response. +type ClusterListPersistedScriptActionsResult struct { + // Value - The list of Persisted Script Actions. + Value *[]RuntimeScriptAction `json:"value,omitempty"` + // NextLink - The link (url) to the next page of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// ClusterListResult the List Cluster operation response. +type ClusterListResult struct { + autorest.Response `json:"-"` + // Value - The list of Clusters. + Value *[]Cluster `json:"value,omitempty"` + // NextLink - The link (url) to the next page of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// ClusterListResultIterator provides access to a complete listing of Cluster values. +type ClusterListResultIterator struct { + i int + page ClusterListResultPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ClusterListResultIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ClusterListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ClusterListResultIterator) Response() ClusterListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ClusterListResultIterator) Value() Cluster { + if !iter.page.NotDone() { + return Cluster{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (clr ClusterListResult) IsEmpty() bool { + return clr.Value == nil || len(*clr.Value) == 0 +} + +// clusterListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (clr ClusterListResult) clusterListResultPreparer() (*http.Request, error) { + if clr.NextLink == nil || len(to.String(clr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(clr.NextLink))) +} + +// ClusterListResultPage contains a page of Cluster values. +type ClusterListResultPage struct { + fn func(ClusterListResult) (ClusterListResult, error) + clr ClusterListResult +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ClusterListResultPage) Next() error { + next, err := page.fn(page.clr) + if err != nil { + return err + } + page.clr = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ClusterListResultPage) NotDone() bool { + return !page.clr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ClusterListResultPage) Response() ClusterListResult { + return page.clr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ClusterListResultPage) Values() []Cluster { + if page.clr.IsEmpty() { + return nil + } + return *page.clr.Value +} + +// ClusterListRuntimeScriptActionDetailResult the list runtime script action detail response. +type ClusterListRuntimeScriptActionDetailResult struct { + // Value - The list of persisted script action details for the cluster. + Value *[]RuntimeScriptActionDetail `json:"value,omitempty"` + // NextLink - The link (url) to the next page of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// ClusterMonitoringRequest the Operations Management Suite (OMS) parameters. +type ClusterMonitoringRequest struct { + // WorkspaceID - The Operations Management Suite (OMS) workspace ID. + WorkspaceID *string `json:"workspaceId,omitempty"` + // PrimaryKey - The Operations Management Suite (OMS) workspace key. + PrimaryKey *string `json:"primaryKey,omitempty"` +} + +// ClusterMonitoringResponse the Operations Management Suite (OMS) status response +type ClusterMonitoringResponse struct { + autorest.Response `json:"-"` + // ClusterMonitoringEnabled - The status of the Operations Management Suite (OMS) on the HDInsight cluster. + ClusterMonitoringEnabled *bool `json:"clusterMonitoringEnabled,omitempty"` + // WorkspaceID - The workspace ID of the Operations Management Suite (OMS) on the HDInsight cluster. + WorkspaceID *string `json:"workspaceId,omitempty"` +} + +// ClusterPatchParameters the PatchCluster request parameters +type ClusterPatchParameters struct { + // Tags - The resource tags. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for ClusterPatchParameters. +func (cpp ClusterPatchParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cpp.Tags != nil { + objectMap["tags"] = cpp.Tags + } + return json.Marshal(objectMap) +} + +// ClusterResizeParameters the Resize Cluster request parameters. +type ClusterResizeParameters struct { + // TargetInstanceCount - The target instance count for the operation. + TargetInstanceCount *int32 `json:"targetInstanceCount,omitempty"` +} + +// ClustersCreateFuture an abstraction for monitoring and retrieving the results of a long-running operation. +type ClustersCreateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ClustersCreateFuture) Result(client ClustersClient) (c Cluster, err error) { + var done bool + done, err = future.Done(client) + if err != nil { + err = autorest.NewErrorWithError(err, "hdinsight.ClustersCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("hdinsight.ClustersCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if c.Response.Response, err = future.GetResult(sender); err == nil && c.Response.Response.StatusCode != http.StatusNoContent { + c, err = client.CreateResponder(c.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "hdinsight.ClustersCreateFuture", "Result", c.Response.Response, "Failure responding to request") + } + } + return +} + +// ClustersDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. +type ClustersDeleteFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ClustersDeleteFuture) Result(client ClustersClient) (ar autorest.Response, err error) { + var done bool + done, err = future.Done(client) + if err != nil { + err = autorest.NewErrorWithError(err, "hdinsight.ClustersDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("hdinsight.ClustersDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ClustersExecuteScriptActionsFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ClustersExecuteScriptActionsFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ClustersExecuteScriptActionsFuture) Result(client ClustersClient) (ar autorest.Response, err error) { + var done bool + done, err = future.Done(client) + if err != nil { + err = autorest.NewErrorWithError(err, "hdinsight.ClustersExecuteScriptActionsFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("hdinsight.ClustersExecuteScriptActionsFuture") + return + } + ar.Response = future.Response() + return +} + +// ClustersResizeFuture an abstraction for monitoring and retrieving the results of a long-running operation. +type ClustersResizeFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ClustersResizeFuture) Result(client ClustersClient) (ar autorest.Response, err error) { + var done bool + done, err = future.Done(client) + if err != nil { + err = autorest.NewErrorWithError(err, "hdinsight.ClustersResizeFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("hdinsight.ClustersResizeFuture") + return + } + ar.Response = future.Response() + return +} + +// ComputeProfile describes the compute profile. +type ComputeProfile struct { + // Roles - The list of roles in the cluster. + Roles *[]Role `json:"roles,omitempty"` +} + +// ConfigurationsUpdateHTTPSettingsFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ConfigurationsUpdateHTTPSettingsFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ConfigurationsUpdateHTTPSettingsFuture) Result(client ConfigurationsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.Done(client) + if err != nil { + err = autorest.NewErrorWithError(err, "hdinsight.ConfigurationsUpdateHTTPSettingsFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("hdinsight.ConfigurationsUpdateHTTPSettingsFuture") + return + } + ar.Response = future.Response() + return +} + +// ConnectivityEndpoint the connectivity properties +type ConnectivityEndpoint struct { + // Name - The name of the endpoint. + Name *string `json:"name,omitempty"` + // Protocol - The protocol of the endpoint. + Protocol *string `json:"protocol,omitempty"` + // Location - The location of the endpoint. + Location *string `json:"location,omitempty"` + // Port - The port to connect to. + Port *int32 `json:"port,omitempty"` +} + +// DataDisksGroups the data disks groups for the role. +type DataDisksGroups struct { + // DisksPerNode - The number of disks per node. + DisksPerNode *int32 `json:"disksPerNode,omitempty"` + // StorageAccountType - ReadOnly. The storage account type. Do not set this value. + StorageAccountType *string `json:"storageAccountType,omitempty"` + // DiskSizeGB - ReadOnly. The DiskSize in GB. Do not set this value. + DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` +} + +// ErrorResponse describes the format of Error response. +type ErrorResponse struct { + // Code - Error code + Code *string `json:"code,omitempty"` + // Message - Error message indicating why the operation failed. + Message *string `json:"message,omitempty"` +} + +// Errors the error message associated with the cluster creation. +type Errors struct { + // Code - The error code. + Code *string `json:"code,omitempty"` + // Message - The error message. + Message *string `json:"message,omitempty"` +} + +// ExecuteScriptActionParameters the parameters for the script actions to execute on a running cluster. +type ExecuteScriptActionParameters struct { + // ScriptActions - The list of run time script actions. + ScriptActions *[]RuntimeScriptAction `json:"scriptActions,omitempty"` + // PersistOnSuccess - Gets or sets if the scripts needs to be persisted. + PersistOnSuccess *bool `json:"persistOnSuccess,omitempty"` +} + +// Extension cluster monitoring extensions +type Extension struct { + autorest.Response `json:"-"` + // WorkspaceID - The workspace ID for the cluster monitoring extension. + WorkspaceID *string `json:"workspaceId,omitempty"` + // PrimaryKey - The certificate for the cluster monitoring extensions. + PrimaryKey *string `json:"primaryKey,omitempty"` +} + +// ExtensionsCreateFuture an abstraction for monitoring and retrieving the results of a long-running operation. +type ExtensionsCreateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ExtensionsCreateFuture) Result(client ExtensionsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.Done(client) + if err != nil { + err = autorest.NewErrorWithError(err, "hdinsight.ExtensionsCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("hdinsight.ExtensionsCreateFuture") + return + } + ar.Response = future.Response() + return +} + +// ExtensionsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. +type ExtensionsDeleteFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ExtensionsDeleteFuture) Result(client ExtensionsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.Done(client) + if err != nil { + err = autorest.NewErrorWithError(err, "hdinsight.ExtensionsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("hdinsight.ExtensionsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ExtensionsDisableMonitoringFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ExtensionsDisableMonitoringFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ExtensionsDisableMonitoringFuture) Result(client ExtensionsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.Done(client) + if err != nil { + err = autorest.NewErrorWithError(err, "hdinsight.ExtensionsDisableMonitoringFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("hdinsight.ExtensionsDisableMonitoringFuture") + return + } + ar.Response = future.Response() + return +} + +// ExtensionsEnableMonitoringFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ExtensionsEnableMonitoringFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ExtensionsEnableMonitoringFuture) Result(client ExtensionsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.Done(client) + if err != nil { + err = autorest.NewErrorWithError(err, "hdinsight.ExtensionsEnableMonitoringFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("hdinsight.ExtensionsEnableMonitoringFuture") + return + } + ar.Response = future.Response() + return +} + +// HardwareProfile the hardware profile. +type HardwareProfile struct { + // VMSize - The size of the VM + VMSize *string `json:"vmSize,omitempty"` +} + +// LinuxOperatingSystemProfile the ssh username, password, and ssh public key. +type LinuxOperatingSystemProfile struct { + // Username - The username. + Username *string `json:"username,omitempty"` + // Password - The password. + Password *string `json:"password,omitempty"` + // SSHProfile - The SSH profile. + SSHProfile *SSHProfile `json:"sshProfile,omitempty"` +} + +// LocalizedName the details about the localizable name of a type of usage. +type LocalizedName struct { + // Value - The name of the used resource. + Value *string `json:"value,omitempty"` + // LocalizedValue - The localized name of the used resource. + LocalizedValue *string `json:"localizedValue,omitempty"` +} + +// Operation the HDInsight REST API operation. +type Operation struct { + // Name - The operation name: {provider}/{resource}/{operation} + Name *string `json:"name,omitempty"` + // Display - The object that represents the operation. + Display *OperationDisplay `json:"display,omitempty"` +} + +// OperationDisplay the object that represents the operation. +type OperationDisplay struct { + // Provider - The service provider: Microsoft.HDInsight + Provider *string `json:"provider,omitempty"` + // Resource - The resource on which the operation is performed: Cluster, Applications, etc. + Resource *string `json:"resource,omitempty"` + // Operation - The operation type: read, write, delete, etc. + Operation *string `json:"operation,omitempty"` +} + +// OperationListResult result of the request to list HDInsight operations. It contains a list of operations and a +// URL link to get the next set of results. +type OperationListResult struct { + autorest.Response `json:"-"` + // Value - The list of HDInsight operations supported by the HDInsight resource provider. + Value *[]Operation `json:"value,omitempty"` + // NextLink - The URL to get the next set of operation list results if there are any. + NextLink *string `json:"nextLink,omitempty"` +} + +// OperationListResultIterator provides access to a complete listing of Operation values. +type OperationListResultIterator struct { + i int + page OperationListResultPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *OperationListResultIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter OperationListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter OperationListResultIterator) Response() OperationListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter OperationListResultIterator) Value() Operation { + if !iter.page.NotDone() { + return Operation{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (olr OperationListResult) IsEmpty() bool { + return olr.Value == nil || len(*olr.Value) == 0 +} + +// operationListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (olr OperationListResult) operationListResultPreparer() (*http.Request, error) { + if olr.NextLink == nil || len(to.String(olr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(olr.NextLink))) +} + +// OperationListResultPage contains a page of Operation values. +type OperationListResultPage struct { + fn func(OperationListResult) (OperationListResult, error) + olr OperationListResult +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *OperationListResultPage) Next() error { + next, err := page.fn(page.olr) + if err != nil { + return err + } + page.olr = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page OperationListResultPage) NotDone() bool { + return !page.olr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page OperationListResultPage) Response() OperationListResult { + return page.olr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page OperationListResultPage) Values() []Operation { + if page.olr.IsEmpty() { + return nil + } + return *page.olr.Value +} + +// OperationResource the azure async operation response. +type OperationResource struct { + // Status - The async operation state. Possible values include: 'InProgress', 'Succeeded', 'Failed' + Status AsyncOperationState `json:"status,omitempty"` + // Error - The operation error information. + Error *Errors `json:"error,omitempty"` +} + +// OsProfile the Linux operation systems profile. +type OsProfile struct { + // LinuxOperatingSystemProfile - The Linux OS profile. + LinuxOperatingSystemProfile *LinuxOperatingSystemProfile `json:"linuxOperatingSystemProfile,omitempty"` +} + +// ProxyResource the resource model definition for a ARM proxy resource. It will have everything other than +// required location and tags +type ProxyResource struct { + // ID - Fully qualified resource Id for the resource. + ID *string `json:"id,omitempty"` + // Name - The name of the resource + Name *string `json:"name,omitempty"` + // Type - The type of the resource. + Type *string `json:"type,omitempty"` +} + +// QuotaInfo the quota properties for the cluster. +type QuotaInfo struct { + // CoresUsed - The cores used by the cluster. + CoresUsed *int32 `json:"coresUsed,omitempty"` +} + +// Resource the core properties of ARM resources +type Resource struct { + // ID - Fully qualified resource Id for the resource. + ID *string `json:"id,omitempty"` + // Name - The name of the resource + Name *string `json:"name,omitempty"` + // Type - The type of the resource. + Type *string `json:"type,omitempty"` +} + +// Role describes a role on the cluster. +type Role struct { + // Name - The name of the role. + Name *string `json:"name,omitempty"` + // MinInstanceCount - The minimum instance count of the cluster. + MinInstanceCount *int32 `json:"minInstanceCount,omitempty"` + // TargetInstanceCount - The instance count of the cluster. + TargetInstanceCount *int32 `json:"targetInstanceCount,omitempty"` + // HardwareProfile - The hardware profile. + HardwareProfile *HardwareProfile `json:"hardwareProfile,omitempty"` + // OsProfile - The operating system profile. + OsProfile *OsProfile `json:"osProfile,omitempty"` + // VirtualNetworkProfile - The virtual network profile. + VirtualNetworkProfile *VirtualNetworkProfile `json:"virtualNetworkProfile,omitempty"` + // DataDisksGroups - The data disks groups for the role. + DataDisksGroups *[]DataDisksGroups `json:"dataDisksGroups,omitempty"` + // ScriptActions - The list of script actions on the role. + ScriptActions *[]ScriptAction `json:"scriptActions,omitempty"` +} + +// RuntimeScriptAction describes a script action on a running cluster. +type RuntimeScriptAction struct { + // Name - The name of the script action. + Name *string `json:"name,omitempty"` + // URI - The URI to the script. + URI *string `json:"uri,omitempty"` + // Parameters - The parameters for the script + Parameters *string `json:"parameters,omitempty"` + // Roles - The list of roles where script will be executed. + Roles *[]string `json:"roles,omitempty"` + // ApplicationName - The application name of the script action, if any. + ApplicationName *string `json:"applicationName,omitempty"` +} + +// RuntimeScriptActionDetail the execution details of a script action. +type RuntimeScriptActionDetail struct { + autorest.Response `json:"-"` + // ScriptExecutionID - The execution id of the script action. + ScriptExecutionID *int64 `json:"scriptExecutionId,omitempty"` + // StartTime - The start time of script action execution. + StartTime *string `json:"startTime,omitempty"` + // EndTime - The end time of script action execution. + EndTime *string `json:"endTime,omitempty"` + // Status - The current execution status of the script action. + Status *string `json:"status,omitempty"` + // Operation - The reason why the script action was executed. + Operation *string `json:"operation,omitempty"` + // ExecutionSummary - The summary of script action execution result. + ExecutionSummary *[]ScriptActionExecutionSummary `json:"executionSummary,omitempty"` + // DebugInformation - The script action execution debug information. + DebugInformation *string `json:"debugInformation,omitempty"` + // Name - The name of the script action. + Name *string `json:"name,omitempty"` + // URI - The URI to the script. + URI *string `json:"uri,omitempty"` + // Parameters - The parameters for the script + Parameters *string `json:"parameters,omitempty"` + // Roles - The list of roles where script will be executed. + Roles *[]string `json:"roles,omitempty"` + // ApplicationName - The application name of the script action, if any. + ApplicationName *string `json:"applicationName,omitempty"` +} + +// ScriptAction describes a script action on role on the cluster. +type ScriptAction struct { + // Name - The name of the script action. + Name *string `json:"name,omitempty"` + // URI - The URI to the script. + URI *string `json:"uri,omitempty"` + // Parameters - The parameters for the script provided. + Parameters *string `json:"parameters,omitempty"` +} + +// ScriptActionExecutionHistoryList the list script execution history response. +type ScriptActionExecutionHistoryList struct { + autorest.Response `json:"-"` + // Value - The list of persisted script action details for the cluster. + Value *[]RuntimeScriptActionDetail `json:"value,omitempty"` + // NextLink - The link (url) to the next page of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// ScriptActionExecutionHistoryListIterator provides access to a complete listing of RuntimeScriptActionDetail +// values. +type ScriptActionExecutionHistoryListIterator struct { + i int + page ScriptActionExecutionHistoryListPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ScriptActionExecutionHistoryListIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ScriptActionExecutionHistoryListIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ScriptActionExecutionHistoryListIterator) Response() ScriptActionExecutionHistoryList { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ScriptActionExecutionHistoryListIterator) Value() RuntimeScriptActionDetail { + if !iter.page.NotDone() { + return RuntimeScriptActionDetail{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (saehl ScriptActionExecutionHistoryList) IsEmpty() bool { + return saehl.Value == nil || len(*saehl.Value) == 0 +} + +// scriptActionExecutionHistoryListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (saehl ScriptActionExecutionHistoryList) scriptActionExecutionHistoryListPreparer() (*http.Request, error) { + if saehl.NextLink == nil || len(to.String(saehl.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(saehl.NextLink))) +} + +// ScriptActionExecutionHistoryListPage contains a page of RuntimeScriptActionDetail values. +type ScriptActionExecutionHistoryListPage struct { + fn func(ScriptActionExecutionHistoryList) (ScriptActionExecutionHistoryList, error) + saehl ScriptActionExecutionHistoryList +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ScriptActionExecutionHistoryListPage) Next() error { + next, err := page.fn(page.saehl) + if err != nil { + return err + } + page.saehl = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ScriptActionExecutionHistoryListPage) NotDone() bool { + return !page.saehl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ScriptActionExecutionHistoryListPage) Response() ScriptActionExecutionHistoryList { + return page.saehl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ScriptActionExecutionHistoryListPage) Values() []RuntimeScriptActionDetail { + if page.saehl.IsEmpty() { + return nil + } + return *page.saehl.Value +} + +// ScriptActionExecutionSummary the execution summary of a script action. +type ScriptActionExecutionSummary struct { + // Status - The status of script action execution. + Status *string `json:"status,omitempty"` + // InstanceCount - The instance count for a given script action execution status. + InstanceCount *int32 `json:"instanceCount,omitempty"` +} + +// ScriptActionPersistedGetResponseSpec the persisted script action for cluster. +type ScriptActionPersistedGetResponseSpec struct { + // Name - The name of script action. + Name *string `json:"name,omitempty"` + // URI - The URI to the script. + URI *string `json:"uri,omitempty"` + // Parameters - The parameters for the script provided. + Parameters *string `json:"parameters,omitempty"` + // Roles - The list of roles where script will be executed. + Roles *[]string `json:"roles,omitempty"` + // ApplicationName - The application name for the script action. + ApplicationName *string `json:"applicationName,omitempty"` +} + +// ScriptActionsList the persisted script action for the cluster. +type ScriptActionsList struct { + autorest.Response `json:"-"` + // Value - The list of persisted script action details for the cluster. + Value *[]RuntimeScriptActionDetail `json:"value,omitempty"` + // NextLink - The link (url) to the next page of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// ScriptActionsListIterator provides access to a complete listing of RuntimeScriptActionDetail values. +type ScriptActionsListIterator struct { + i int + page ScriptActionsListPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ScriptActionsListIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ScriptActionsListIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ScriptActionsListIterator) Response() ScriptActionsList { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ScriptActionsListIterator) Value() RuntimeScriptActionDetail { + if !iter.page.NotDone() { + return RuntimeScriptActionDetail{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (sal ScriptActionsList) IsEmpty() bool { + return sal.Value == nil || len(*sal.Value) == 0 +} + +// scriptActionsListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (sal ScriptActionsList) scriptActionsListPreparer() (*http.Request, error) { + if sal.NextLink == nil || len(to.String(sal.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(sal.NextLink))) +} + +// ScriptActionsListPage contains a page of RuntimeScriptActionDetail values. +type ScriptActionsListPage struct { + fn func(ScriptActionsList) (ScriptActionsList, error) + sal ScriptActionsList +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ScriptActionsListPage) Next() error { + next, err := page.fn(page.sal) + if err != nil { + return err + } + page.sal = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ScriptActionsListPage) NotDone() bool { + return !page.sal.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ScriptActionsListPage) Response() ScriptActionsList { + return page.sal +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ScriptActionsListPage) Values() []RuntimeScriptActionDetail { + if page.sal.IsEmpty() { + return nil + } + return *page.sal.Value +} + +// SecurityProfile the security profile which contains Ssh public key for the HDInsight cluster. +type SecurityProfile struct { + // DirectoryType - The directory type. Possible values include: 'ActiveDirectory' + DirectoryType DirectoryType `json:"directoryType,omitempty"` + // Domain - The organization's active directory domain. + Domain *string `json:"domain,omitempty"` + // OrganizationalUnitDN - The organizational unit within the Active Directory to place the cluster and service accounts. + OrganizationalUnitDN *string `json:"organizationalUnitDN,omitempty"` + // LdapsUrls - The LDAPS protocol URLs to communicate with the Active Directory. + LdapsUrls *[]string `json:"ldapsUrls,omitempty"` + // DomainUsername - The domain user account that will have admin privileges on the cluster. + DomainUsername *string `json:"domainUsername,omitempty"` + // DomainUserPassword - The domain admin password. + DomainUserPassword *string `json:"domainUserPassword,omitempty"` + // ClusterUsersGroupDNS - Optional. The Distinguished Names for cluster user groups + ClusterUsersGroupDNS *[]string `json:"clusterUsersGroupDNs,omitempty"` +} + +// SetString ... +type SetString struct { + autorest.Response `json:"-"` + Value map[string]*string `json:"value"` +} + +// MarshalJSON is the custom marshaler for SetString. +func (ss SetString) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ss.Value != nil { + objectMap["value"] = ss.Value + } + return json.Marshal(objectMap) +} + +// SSHProfile the list of SSH public keys. +type SSHProfile struct { + // PublicKeys - The list of SSH public keys. + PublicKeys *[]SSHPublicKey `json:"publicKeys,omitempty"` +} + +// SSHPublicKey the SSH public key for the cluster nodes. +type SSHPublicKey struct { + // CertificateData - The certificate for SSH. + CertificateData *string `json:"certificateData,omitempty"` +} + +// StorageAccount the storage Account. +type StorageAccount struct { + // Name - The name of the storage account. + Name *string `json:"name,omitempty"` + // IsDefault - Whether or not the storage account is the default storage account. + IsDefault *bool `json:"isDefault,omitempty"` + // Container - The container in the storage account. + Container *string `json:"container,omitempty"` + // Key - The storage account access key. + Key *string `json:"key,omitempty"` +} + +// StorageProfile the storage profile. +type StorageProfile struct { + // Storageaccounts - The list of storage accounts in the cluster. + Storageaccounts *[]StorageAccount `json:"storageaccounts,omitempty"` +} + +// TrackedResource the resource model definition for a ARM tracked top level resource +type TrackedResource struct { + // Location - The Azure Region where the resource lives + Location *string `json:"location,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // ID - Fully qualified resource Id for the resource. + ID *string `json:"id,omitempty"` + // Name - The name of the resource + Name *string `json:"name,omitempty"` + // Type - The type of the resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for TrackedResource. +func (tr TrackedResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if tr.Location != nil { + objectMap["location"] = tr.Location + } + if tr.Tags != nil { + objectMap["tags"] = tr.Tags + } + if tr.ID != nil { + objectMap["id"] = tr.ID + } + if tr.Name != nil { + objectMap["name"] = tr.Name + } + if tr.Type != nil { + objectMap["type"] = tr.Type + } + return json.Marshal(objectMap) +} + +// Usage the details about the usage of a particular limited resource. +type Usage struct { + // Unit - The type of measurement for usage. + Unit *string `json:"unit,omitempty"` + // CurrentValue - The current usage. + CurrentValue *int32 `json:"currentValue,omitempty"` + // Limit - The maximum allowed usage. + Limit *int32 `json:"limit,omitempty"` + // Name - The details about the localizable name of the used resource. + Name *LocalizedName `json:"name,omitempty"` +} + +// UsagesListResult the response for the operation to get regional usages for a subscription. +type UsagesListResult struct { + autorest.Response `json:"-"` + // Value - The list of usages. + Value *[]Usage `json:"value,omitempty"` +} + +// VirtualNetworkProfile the virtual network properties. +type VirtualNetworkProfile struct { + // ID - The ID of the virtual network. + ID *string `json:"id,omitempty"` + // Subnet - The name of the subnet. + Subnet *string `json:"subnet,omitempty"` +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/hdinsight/mgmt/2018-06-01-preview/hdinsight/operations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/hdinsight/mgmt/2018-06-01-preview/hdinsight/operations.go new file mode 100644 index 000000000..4cddc33df --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/hdinsight/mgmt/2018-06-01-preview/hdinsight/operations.go @@ -0,0 +1,126 @@ +package hdinsight + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "net/http" +) + +// OperationsClient is the hDInsight Management Client +type OperationsClient struct { + BaseClient +} + +// NewOperationsClient creates an instance of the OperationsClient client. +func NewOperationsClient(subscriptionID string) OperationsClient { + return NewOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewOperationsClientWithBaseURI creates an instance of the OperationsClient client. +func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient { + return OperationsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// List lists all of the available HDInsight REST API operations. +func (client OperationsClient) List(ctx context.Context) (result OperationListResultPage, err error) { + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "hdinsight.OperationsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.olr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "hdinsight.OperationsClient", "List", resp, "Failure sending request") + return + } + + result.olr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "hdinsight.OperationsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/providers/Microsoft.HDInsight/operations"), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client OperationsClient) ListSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client OperationsClient) ListResponder(resp *http.Response) (result OperationListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client OperationsClient) listNextResults(lastResults OperationListResult) (result OperationListResult, err error) { + req, err := lastResults.operationListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "hdinsight.OperationsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "hdinsight.OperationsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "hdinsight.OperationsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client OperationsClient) ListComplete(ctx context.Context) (result OperationListResultIterator, err error) { + result.page, err = client.List(ctx) + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/hdinsight/mgmt/2018-06-01-preview/hdinsight/scriptactions.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/hdinsight/mgmt/2018-06-01-preview/hdinsight/scriptactions.go new file mode 100644 index 000000000..1b49c0892 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/hdinsight/mgmt/2018-06-01-preview/hdinsight/scriptactions.go @@ -0,0 +1,272 @@ +package hdinsight + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "net/http" +) + +// ScriptActionsClient is the hDInsight Management Client +type ScriptActionsClient struct { + BaseClient +} + +// NewScriptActionsClient creates an instance of the ScriptActionsClient client. +func NewScriptActionsClient(subscriptionID string) ScriptActionsClient { + return NewScriptActionsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewScriptActionsClientWithBaseURI creates an instance of the ScriptActionsClient client. +func NewScriptActionsClientWithBaseURI(baseURI string, subscriptionID string) ScriptActionsClient { + return ScriptActionsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Delete deletes a specified persisted script action of the cluster. +// Parameters: +// resourceGroupName - the name of the resource group. +// clusterName - the name of the cluster. +// scriptName - the name of the script. +func (client ScriptActionsClient) Delete(ctx context.Context, resourceGroupName string, clusterName string, scriptName string) (result autorest.Response, err error) { + req, err := client.DeletePreparer(ctx, resourceGroupName, clusterName, scriptName) + if err != nil { + err = autorest.NewErrorWithError(err, "hdinsight.ScriptActionsClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "hdinsight.ScriptActionsClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "hdinsight.ScriptActionsClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ScriptActionsClient) DeletePreparer(ctx context.Context, resourceGroupName string, clusterName string, scriptName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "scriptName": autorest.Encode("path", scriptName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/scriptActions/{scriptName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ScriptActionsClient) DeleteSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ScriptActionsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// GetExecutionDetail gets the script execution detail for the given script execution ID. +// Parameters: +// resourceGroupName - the name of the resource group. +// clusterName - the name of the cluster. +// scriptExecutionID - the script execution Id +func (client ScriptActionsClient) GetExecutionDetail(ctx context.Context, resourceGroupName string, clusterName string, scriptExecutionID string) (result RuntimeScriptActionDetail, err error) { + req, err := client.GetExecutionDetailPreparer(ctx, resourceGroupName, clusterName, scriptExecutionID) + if err != nil { + err = autorest.NewErrorWithError(err, "hdinsight.ScriptActionsClient", "GetExecutionDetail", nil, "Failure preparing request") + return + } + + resp, err := client.GetExecutionDetailSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "hdinsight.ScriptActionsClient", "GetExecutionDetail", resp, "Failure sending request") + return + } + + result, err = client.GetExecutionDetailResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "hdinsight.ScriptActionsClient", "GetExecutionDetail", resp, "Failure responding to request") + } + + return +} + +// GetExecutionDetailPreparer prepares the GetExecutionDetail request. +func (client ScriptActionsClient) GetExecutionDetailPreparer(ctx context.Context, resourceGroupName string, clusterName string, scriptExecutionID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "scriptExecutionId": autorest.Encode("path", scriptExecutionID), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/scriptExecutionHistory/{scriptExecutionId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetExecutionDetailSender sends the GetExecutionDetail request. The method will close the +// http.Response Body if it receives an error. +func (client ScriptActionsClient) GetExecutionDetailSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetExecutionDetailResponder handles the response to the GetExecutionDetail request. The method always +// closes the http.Response Body. +func (client ScriptActionsClient) GetExecutionDetailResponder(resp *http.Response) (result RuntimeScriptActionDetail, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByCluster lists all the persisted script actions for the specified cluster. +// Parameters: +// resourceGroupName - the name of the resource group. +// clusterName - the name of the cluster. +func (client ScriptActionsClient) ListByCluster(ctx context.Context, resourceGroupName string, clusterName string) (result ScriptActionsListPage, err error) { + result.fn = client.listByClusterNextResults + req, err := client.ListByClusterPreparer(ctx, resourceGroupName, clusterName) + if err != nil { + err = autorest.NewErrorWithError(err, "hdinsight.ScriptActionsClient", "ListByCluster", nil, "Failure preparing request") + return + } + + resp, err := client.ListByClusterSender(req) + if err != nil { + result.sal.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "hdinsight.ScriptActionsClient", "ListByCluster", resp, "Failure sending request") + return + } + + result.sal, err = client.ListByClusterResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "hdinsight.ScriptActionsClient", "ListByCluster", resp, "Failure responding to request") + } + + return +} + +// ListByClusterPreparer prepares the ListByCluster request. +func (client ScriptActionsClient) ListByClusterPreparer(ctx context.Context, resourceGroupName string, clusterName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/scriptActions", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByClusterSender sends the ListByCluster request. The method will close the +// http.Response Body if it receives an error. +func (client ScriptActionsClient) ListByClusterSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByClusterResponder handles the response to the ListByCluster request. The method always +// closes the http.Response Body. +func (client ScriptActionsClient) ListByClusterResponder(resp *http.Response) (result ScriptActionsList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByClusterNextResults retrieves the next set of results, if any. +func (client ScriptActionsClient) listByClusterNextResults(lastResults ScriptActionsList) (result ScriptActionsList, err error) { + req, err := lastResults.scriptActionsListPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "hdinsight.ScriptActionsClient", "listByClusterNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByClusterSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "hdinsight.ScriptActionsClient", "listByClusterNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByClusterResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "hdinsight.ScriptActionsClient", "listByClusterNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByClusterComplete enumerates all values, automatically crossing page boundaries as required. +func (client ScriptActionsClient) ListByClusterComplete(ctx context.Context, resourceGroupName string, clusterName string) (result ScriptActionsListIterator, err error) { + result.page, err = client.ListByCluster(ctx, resourceGroupName, clusterName) + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/hdinsight/mgmt/2018-06-01-preview/hdinsight/scriptexecutionhistory.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/hdinsight/mgmt/2018-06-01-preview/hdinsight/scriptexecutionhistory.go new file mode 100644 index 000000000..a7121ef03 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/hdinsight/mgmt/2018-06-01-preview/hdinsight/scriptexecutionhistory.go @@ -0,0 +1,203 @@ +package hdinsight + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "net/http" +) + +// ScriptExecutionHistoryClient is the hDInsight Management Client +type ScriptExecutionHistoryClient struct { + BaseClient +} + +// NewScriptExecutionHistoryClient creates an instance of the ScriptExecutionHistoryClient client. +func NewScriptExecutionHistoryClient(subscriptionID string) ScriptExecutionHistoryClient { + return NewScriptExecutionHistoryClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewScriptExecutionHistoryClientWithBaseURI creates an instance of the ScriptExecutionHistoryClient client. +func NewScriptExecutionHistoryClientWithBaseURI(baseURI string, subscriptionID string) ScriptExecutionHistoryClient { + return ScriptExecutionHistoryClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// ListByCluster lists all scripts' execution history for the specified cluster. +// Parameters: +// resourceGroupName - the name of the resource group. +// clusterName - the name of the cluster. +func (client ScriptExecutionHistoryClient) ListByCluster(ctx context.Context, resourceGroupName string, clusterName string) (result ScriptActionExecutionHistoryListPage, err error) { + result.fn = client.listByClusterNextResults + req, err := client.ListByClusterPreparer(ctx, resourceGroupName, clusterName) + if err != nil { + err = autorest.NewErrorWithError(err, "hdinsight.ScriptExecutionHistoryClient", "ListByCluster", nil, "Failure preparing request") + return + } + + resp, err := client.ListByClusterSender(req) + if err != nil { + result.saehl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "hdinsight.ScriptExecutionHistoryClient", "ListByCluster", resp, "Failure sending request") + return + } + + result.saehl, err = client.ListByClusterResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "hdinsight.ScriptExecutionHistoryClient", "ListByCluster", resp, "Failure responding to request") + } + + return +} + +// ListByClusterPreparer prepares the ListByCluster request. +func (client ScriptExecutionHistoryClient) ListByClusterPreparer(ctx context.Context, resourceGroupName string, clusterName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/scriptExecutionHistory", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByClusterSender sends the ListByCluster request. The method will close the +// http.Response Body if it receives an error. +func (client ScriptExecutionHistoryClient) ListByClusterSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByClusterResponder handles the response to the ListByCluster request. The method always +// closes the http.Response Body. +func (client ScriptExecutionHistoryClient) ListByClusterResponder(resp *http.Response) (result ScriptActionExecutionHistoryList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByClusterNextResults retrieves the next set of results, if any. +func (client ScriptExecutionHistoryClient) listByClusterNextResults(lastResults ScriptActionExecutionHistoryList) (result ScriptActionExecutionHistoryList, err error) { + req, err := lastResults.scriptActionExecutionHistoryListPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "hdinsight.ScriptExecutionHistoryClient", "listByClusterNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByClusterSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "hdinsight.ScriptExecutionHistoryClient", "listByClusterNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByClusterResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "hdinsight.ScriptExecutionHistoryClient", "listByClusterNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByClusterComplete enumerates all values, automatically crossing page boundaries as required. +func (client ScriptExecutionHistoryClient) ListByClusterComplete(ctx context.Context, resourceGroupName string, clusterName string) (result ScriptActionExecutionHistoryListIterator, err error) { + result.page, err = client.ListByCluster(ctx, resourceGroupName, clusterName) + return +} + +// Promote promotes the specified ad-hoc script execution to a persisted script. +// Parameters: +// resourceGroupName - the name of the resource group. +// clusterName - the name of the cluster. +// scriptExecutionID - the script execution Id +func (client ScriptExecutionHistoryClient) Promote(ctx context.Context, resourceGroupName string, clusterName string, scriptExecutionID string) (result autorest.Response, err error) { + req, err := client.PromotePreparer(ctx, resourceGroupName, clusterName, scriptExecutionID) + if err != nil { + err = autorest.NewErrorWithError(err, "hdinsight.ScriptExecutionHistoryClient", "Promote", nil, "Failure preparing request") + return + } + + resp, err := client.PromoteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "hdinsight.ScriptExecutionHistoryClient", "Promote", resp, "Failure sending request") + return + } + + result, err = client.PromoteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "hdinsight.ScriptExecutionHistoryClient", "Promote", resp, "Failure responding to request") + } + + return +} + +// PromotePreparer prepares the Promote request. +func (client ScriptExecutionHistoryClient) PromotePreparer(ctx context.Context, resourceGroupName string, clusterName string, scriptExecutionID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "scriptExecutionId": autorest.Encode("path", scriptExecutionID), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/scriptExecutionHistory/{scriptExecutionId}/promote", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// PromoteSender sends the Promote request. The method will close the +// http.Response Body if it receives an error. +func (client ScriptExecutionHistoryClient) PromoteSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// PromoteResponder handles the response to the Promote request. The method always +// closes the http.Response Body. +func (client ScriptExecutionHistoryClient) PromoteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/hdinsight/mgmt/2018-06-01-preview/hdinsight/version.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/hdinsight/mgmt/2018-06-01-preview/hdinsight/version.go new file mode 100644 index 000000000..ab4bbf64a --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/hdinsight/mgmt/2018-06-01-preview/hdinsight/version.go @@ -0,0 +1,30 @@ +package hdinsight + +import "github.com/Azure/azure-sdk-for-go/version" + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// UserAgent returns the UserAgent string to use when sending http.Requests. +func UserAgent() string { + return "Azure-SDK-For-Go/" + version.Number + " hdinsight/2018-06-01-preview" +} + +// Version returns the semantic version (see http://semver.org) of the client. +func Version() string { + return version.Number +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/iotcentral/mgmt/2017-07-01-privatepreview/iotcentral/apps.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/iotcentral/mgmt/2017-07-01-privatepreview/iotcentral/apps.go index 78f96a16d..9ad8e25e7 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/iotcentral/mgmt/2017-07-01-privatepreview/iotcentral/apps.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/iotcentral/mgmt/2017-07-01-privatepreview/iotcentral/apps.go @@ -22,7 +22,6 @@ import ( "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" "github.com/Azure/go-autorest/autorest/validation" - "github.com/satori/go.uuid" "net/http" ) @@ -32,12 +31,12 @@ type AppsClient struct { } // NewAppsClient creates an instance of the AppsClient client. -func NewAppsClient(subscriptionID uuid.UUID) AppsClient { +func NewAppsClient(subscriptionID string) AppsClient { return NewAppsClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewAppsClientWithBaseURI creates an instance of the AppsClient client. -func NewAppsClientWithBaseURI(baseURI string, subscriptionID uuid.UUID) AppsClient { +func NewAppsClientWithBaseURI(baseURI string, subscriptionID string) AppsClient { return AppsClient{NewWithBaseURI(baseURI, subscriptionID)} } @@ -123,12 +122,6 @@ func (client AppsClient) CheckNameAvailabilityResponder(resp *http.Response) (re // app - the IoT Central application metadata and security metadata. func (client AppsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, app App) (result AppsCreateOrUpdateFuture, err error) { if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 64, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, - {TargetValue: resourceName, - Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 100, Chain: nil}, - {Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: app, Constraints: []validation.Constraint{{Target: "app.AppProperties", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "app.AppProperties.DisplayName", Name: validation.Null, Rule: false, @@ -213,16 +206,6 @@ func (client AppsClient) CreateOrUpdateResponder(resp *http.Response) (result Ap // resourceGroupName - the name of the resource group that contains the IoT Central application. // resourceName - the ARM resource name of the IoT Central application. func (client AppsClient) Delete(ctx context.Context, resourceGroupName string, resourceName string) (result AppsDeleteFuture, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 64, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, - {TargetValue: resourceName, - Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 100, Chain: nil}, - {Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewError("iotcentral.AppsClient", "Delete", err.Error()) - } - req, err := client.DeletePreparer(ctx, resourceGroupName, resourceName) if err != nil { err = autorest.NewErrorWithError(err, "iotcentral.AppsClient", "Delete", nil, "Failure preparing request") @@ -293,16 +276,6 @@ func (client AppsClient) DeleteResponder(resp *http.Response) (result autorest.R // resourceGroupName - the name of the resource group that contains the IoT Central application. // resourceName - the ARM resource name of the IoT Central application. func (client AppsClient) Get(ctx context.Context, resourceGroupName string, resourceName string) (result App, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 64, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, - {TargetValue: resourceName, - Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 100, Chain: nil}, - {Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewError("iotcentral.AppsClient", "Get", err.Error()) - } - req, err := client.GetPreparer(ctx, resourceGroupName, resourceName) if err != nil { err = autorest.NewErrorWithError(err, "iotcentral.AppsClient", "Get", nil, "Failure preparing request") @@ -369,13 +342,6 @@ func (client AppsClient) GetResponder(resp *http.Response) (result App, err erro // Parameters: // resourceGroupName - the name of the resource group that contains the IoT Central application. func (client AppsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result AppListResultPage, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 64, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewError("iotcentral.AppsClient", "ListByResourceGroup", err.Error()) - } - result.fn = client.listByResourceGroupNextResults req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) if err != nil { @@ -561,16 +527,6 @@ func (client AppsClient) ListBySubscriptionComplete(ctx context.Context) (result // resourceName - the ARM resource name of the IoT Central application. // appPatch - the IoT Central application metadata and security metadata. func (client AppsClient) Update(ctx context.Context, resourceGroupName string, resourceName string, appPatch AppPatch) (result AppsUpdateFuture, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 64, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, - {TargetValue: resourceName, - Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 100, Chain: nil}, - {Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewError("iotcentral.AppsClient", "Update", err.Error()) - } - req, err := client.UpdatePreparer(ctx, resourceGroupName, resourceName, appPatch) if err != nil { err = autorest.NewErrorWithError(err, "iotcentral.AppsClient", "Update", nil, "Failure preparing request") diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/iotcentral/mgmt/2017-07-01-privatepreview/iotcentral/client.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/iotcentral/mgmt/2017-07-01-privatepreview/iotcentral/client.go index 3cf1b26f3..307fac548 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/iotcentral/mgmt/2017-07-01-privatepreview/iotcentral/client.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/iotcentral/mgmt/2017-07-01-privatepreview/iotcentral/client.go @@ -22,7 +22,6 @@ package iotcentral import ( "github.com/Azure/go-autorest/autorest" - "github.com/satori/go.uuid" ) const ( @@ -34,16 +33,16 @@ const ( type BaseClient struct { autorest.Client BaseURI string - SubscriptionID uuid.UUID + SubscriptionID string } // New creates an instance of the BaseClient client. -func New(subscriptionID uuid.UUID) BaseClient { +func New(subscriptionID string) BaseClient { return NewWithBaseURI(DefaultBaseURI, subscriptionID) } // NewWithBaseURI creates an instance of the BaseClient client. -func NewWithBaseURI(baseURI string, subscriptionID uuid.UUID) BaseClient { +func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { return BaseClient{ Client: autorest.NewClientWithUserAgent(UserAgent()), BaseURI: baseURI, diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/iotcentral/mgmt/2017-07-01-privatepreview/iotcentral/operations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/iotcentral/mgmt/2017-07-01-privatepreview/iotcentral/operations.go index 4bc28470d..9b4c54d5e 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/iotcentral/mgmt/2017-07-01-privatepreview/iotcentral/operations.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/iotcentral/mgmt/2017-07-01-privatepreview/iotcentral/operations.go @@ -21,7 +21,6 @@ import ( "context" "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" - "github.com/satori/go.uuid" "net/http" ) @@ -31,12 +30,12 @@ type OperationsClient struct { } // NewOperationsClient creates an instance of the OperationsClient client. -func NewOperationsClient(subscriptionID uuid.UUID) OperationsClient { +func NewOperationsClient(subscriptionID string) OperationsClient { return NewOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewOperationsClientWithBaseURI creates an instance of the OperationsClient client. -func NewOperationsClientWithBaseURI(baseURI string, subscriptionID uuid.UUID) OperationsClient { +func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient { return OperationsClient{NewWithBaseURI(baseURI, subscriptionID)} } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/keyvault/v7.0/keyvault/client.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/keyvault/v7.0/keyvault/client.go index 592c83065..321cc21f3 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/keyvault/v7.0/keyvault/client.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/keyvault/v7.0/keyvault/client.go @@ -45,6 +45,76 @@ func NewWithoutDefaults() BaseClient { } } +// BackupCertificate requests that a backup of the specified certificate be downloaded to the client. All versions of +// the certificate will be downloaded. This operation requires the certificates/backup permission. +// Parameters: +// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net. +// certificateName - the name of the certificate. +func (client BaseClient) BackupCertificate(ctx context.Context, vaultBaseURL string, certificateName string) (result BackupCertificateResult, err error) { + req, err := client.BackupCertificatePreparer(ctx, vaultBaseURL, certificateName) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "BackupCertificate", nil, "Failure preparing request") + return + } + + resp, err := client.BackupCertificateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "BackupCertificate", resp, "Failure sending request") + return + } + + result, err = client.BackupCertificateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "BackupCertificate", resp, "Failure responding to request") + } + + return +} + +// BackupCertificatePreparer prepares the BackupCertificate request. +func (client BaseClient) BackupCertificatePreparer(ctx context.Context, vaultBaseURL string, certificateName string) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "vaultBaseUrl": vaultBaseURL, + } + + pathParameters := map[string]interface{}{ + "certificate-name": autorest.Encode("path", certificateName), + } + + const APIVersion = "7.0-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters), + autorest.WithPathParameters("/certificates/{certificate-name}/backup", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// BackupCertificateSender sends the BackupCertificate request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) BackupCertificateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// BackupCertificateResponder handles the response to the BackupCertificate request. The method always +// closes the http.Response Body. +func (client BaseClient) BackupCertificateResponder(resp *http.Response) (result BackupCertificateResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + // BackupKey the Key Backup operation exports a key from Azure Key Vault in a protected form. Note that this operation // does NOT return key material in a form that can be used outside the Azure Key Vault system, the returned key // material is either protected to a Azure Key Vault HSM or to Azure Key Vault itself. The intent of this operation is @@ -1629,7 +1699,8 @@ func (client BaseClient) GetCertificatePolicyResponder(resp *http.Response) (res // vaultBaseURL - the vault name, for example https://myvault.vault.azure.net. // maxresults - maximum number of results to return in a page. If not specified the service will return up to // 25 results. -func (client BaseClient) GetCertificates(ctx context.Context, vaultBaseURL string, maxresults *int32) (result CertificateListResultPage, err error) { +// includePending - specifies whether to include certificates which are not completely provisioned. +func (client BaseClient) GetCertificates(ctx context.Context, vaultBaseURL string, maxresults *int32, includePending *bool) (result CertificateListResultPage, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: maxresults, Constraints: []validation.Constraint{{Target: "maxresults", Name: validation.Null, Rule: false, @@ -1640,7 +1711,7 @@ func (client BaseClient) GetCertificates(ctx context.Context, vaultBaseURL strin } result.fn = client.getCertificatesNextResults - req, err := client.GetCertificatesPreparer(ctx, vaultBaseURL, maxresults) + req, err := client.GetCertificatesPreparer(ctx, vaultBaseURL, maxresults, includePending) if err != nil { err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetCertificates", nil, "Failure preparing request") return @@ -1662,7 +1733,7 @@ func (client BaseClient) GetCertificates(ctx context.Context, vaultBaseURL strin } // GetCertificatesPreparer prepares the GetCertificates request. -func (client BaseClient) GetCertificatesPreparer(ctx context.Context, vaultBaseURL string, maxresults *int32) (*http.Request, error) { +func (client BaseClient) GetCertificatesPreparer(ctx context.Context, vaultBaseURL string, maxresults *int32, includePending *bool) (*http.Request, error) { urlParameters := map[string]interface{}{ "vaultBaseUrl": vaultBaseURL, } @@ -1674,6 +1745,9 @@ func (client BaseClient) GetCertificatesPreparer(ctx context.Context, vaultBaseU if maxresults != nil { queryParameters["maxresults"] = autorest.Encode("query", *maxresults) } + if includePending != nil { + queryParameters["includePending"] = autorest.Encode("query", *includePending) + } preparer := autorest.CreatePreparer( autorest.AsGet(), @@ -1725,8 +1799,8 @@ func (client BaseClient) getCertificatesNextResults(lastResults CertificateListR } // GetCertificatesComplete enumerates all values, automatically crossing page boundaries as required. -func (client BaseClient) GetCertificatesComplete(ctx context.Context, vaultBaseURL string, maxresults *int32) (result CertificateListResultIterator, err error) { - result.page, err = client.GetCertificates(ctx, vaultBaseURL, maxresults) +func (client BaseClient) GetCertificatesComplete(ctx context.Context, vaultBaseURL string, maxresults *int32, includePending *bool) (result CertificateListResultIterator, err error) { + result.page, err = client.GetCertificates(ctx, vaultBaseURL, maxresults, includePending) return } @@ -1921,7 +1995,8 @@ func (client BaseClient) GetDeletedCertificateResponder(resp *http.Response) (re // vaultBaseURL - the vault name, for example https://myvault.vault.azure.net. // maxresults - maximum number of results to return in a page. If not specified the service will return up to // 25 results. -func (client BaseClient) GetDeletedCertificates(ctx context.Context, vaultBaseURL string, maxresults *int32) (result DeletedCertificateListResultPage, err error) { +// includePending - specifies whether to include certificates which are not completely provisioned. +func (client BaseClient) GetDeletedCertificates(ctx context.Context, vaultBaseURL string, maxresults *int32, includePending *bool) (result DeletedCertificateListResultPage, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: maxresults, Constraints: []validation.Constraint{{Target: "maxresults", Name: validation.Null, Rule: false, @@ -1932,7 +2007,7 @@ func (client BaseClient) GetDeletedCertificates(ctx context.Context, vaultBaseUR } result.fn = client.getDeletedCertificatesNextResults - req, err := client.GetDeletedCertificatesPreparer(ctx, vaultBaseURL, maxresults) + req, err := client.GetDeletedCertificatesPreparer(ctx, vaultBaseURL, maxresults, includePending) if err != nil { err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetDeletedCertificates", nil, "Failure preparing request") return @@ -1954,7 +2029,7 @@ func (client BaseClient) GetDeletedCertificates(ctx context.Context, vaultBaseUR } // GetDeletedCertificatesPreparer prepares the GetDeletedCertificates request. -func (client BaseClient) GetDeletedCertificatesPreparer(ctx context.Context, vaultBaseURL string, maxresults *int32) (*http.Request, error) { +func (client BaseClient) GetDeletedCertificatesPreparer(ctx context.Context, vaultBaseURL string, maxresults *int32, includePending *bool) (*http.Request, error) { urlParameters := map[string]interface{}{ "vaultBaseUrl": vaultBaseURL, } @@ -1966,6 +2041,9 @@ func (client BaseClient) GetDeletedCertificatesPreparer(ctx context.Context, vau if maxresults != nil { queryParameters["maxresults"] = autorest.Encode("query", *maxresults) } + if includePending != nil { + queryParameters["includePending"] = autorest.Encode("query", *includePending) + } preparer := autorest.CreatePreparer( autorest.AsGet(), @@ -2017,8 +2095,8 @@ func (client BaseClient) getDeletedCertificatesNextResults(lastResults DeletedCe } // GetDeletedCertificatesComplete enumerates all values, automatically crossing page boundaries as required. -func (client BaseClient) GetDeletedCertificatesComplete(ctx context.Context, vaultBaseURL string, maxresults *int32) (result DeletedCertificateListResultIterator, err error) { - result.page, err = client.GetDeletedCertificates(ctx, vaultBaseURL, maxresults) +func (client BaseClient) GetDeletedCertificatesComplete(ctx context.Context, vaultBaseURL string, maxresults *int32, includePending *bool) (result DeletedCertificateListResultIterator, err error) { + result.page, err = client.GetDeletedCertificates(ctx, vaultBaseURL, maxresults, includePending) return } @@ -4177,42 +4255,42 @@ func (client BaseClient) PurgeDeletedSecretResponder(resp *http.Response) (resul return } -// PurgeDeletedStorgeAccount the purge deleted storage account operation removes the secret permanently, without the +// PurgeDeletedStorageAccount the purge deleted storage account operation removes the secret permanently, without the // possibility of recovery. This operation can only be performed on a soft-delete enabled vault. This operation // requires the storage/purge permission. // Parameters: // vaultBaseURL - the vault name, for example https://myvault.vault.azure.net. // storageAccountName - the name of the storage account. -func (client BaseClient) PurgeDeletedStorgeAccount(ctx context.Context, vaultBaseURL string, storageAccountName string) (result autorest.Response, err error) { +func (client BaseClient) PurgeDeletedStorageAccount(ctx context.Context, vaultBaseURL string, storageAccountName string) (result autorest.Response, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: storageAccountName, Constraints: []validation.Constraint{{Target: "storageAccountName", Name: validation.Pattern, Rule: `^[0-9a-zA-Z]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("keyvault.BaseClient", "PurgeDeletedStorgeAccount", err.Error()) + return result, validation.NewError("keyvault.BaseClient", "PurgeDeletedStorageAccount", err.Error()) } - req, err := client.PurgeDeletedStorgeAccountPreparer(ctx, vaultBaseURL, storageAccountName) + req, err := client.PurgeDeletedStorageAccountPreparer(ctx, vaultBaseURL, storageAccountName) if err != nil { - err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "PurgeDeletedStorgeAccount", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "PurgeDeletedStorageAccount", nil, "Failure preparing request") return } - resp, err := client.PurgeDeletedStorgeAccountSender(req) + resp, err := client.PurgeDeletedStorageAccountSender(req) if err != nil { result.Response = resp - err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "PurgeDeletedStorgeAccount", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "PurgeDeletedStorageAccount", resp, "Failure sending request") return } - result, err = client.PurgeDeletedStorgeAccountResponder(resp) + result, err = client.PurgeDeletedStorageAccountResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "PurgeDeletedStorgeAccount", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "PurgeDeletedStorageAccount", resp, "Failure responding to request") } return } -// PurgeDeletedStorgeAccountPreparer prepares the PurgeDeletedStorgeAccount request. -func (client BaseClient) PurgeDeletedStorgeAccountPreparer(ctx context.Context, vaultBaseURL string, storageAccountName string) (*http.Request, error) { +// PurgeDeletedStorageAccountPreparer prepares the PurgeDeletedStorageAccount request. +func (client BaseClient) PurgeDeletedStorageAccountPreparer(ctx context.Context, vaultBaseURL string, storageAccountName string) (*http.Request, error) { urlParameters := map[string]interface{}{ "vaultBaseUrl": vaultBaseURL, } @@ -4234,16 +4312,16 @@ func (client BaseClient) PurgeDeletedStorgeAccountPreparer(ctx context.Context, return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// PurgeDeletedStorgeAccountSender sends the PurgeDeletedStorgeAccount request. The method will close the +// PurgeDeletedStorageAccountSender sends the PurgeDeletedStorageAccount request. The method will close the // http.Response Body if it receives an error. -func (client BaseClient) PurgeDeletedStorgeAccountSender(req *http.Request) (*http.Response, error) { +func (client BaseClient) PurgeDeletedStorageAccountSender(req *http.Request) (*http.Response, error) { return autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } -// PurgeDeletedStorgeAccountResponder handles the response to the PurgeDeletedStorgeAccount request. The method always +// PurgeDeletedStorageAccountResponder handles the response to the PurgeDeletedStorageAccount request. The method always // closes the http.Response Body. -func (client BaseClient) PurgeDeletedStorgeAccountResponder(resp *http.Response) (result autorest.Response, err error) { +func (client BaseClient) PurgeDeletedStorageAccountResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -4703,6 +4781,80 @@ func (client BaseClient) RegenerateStorageAccountKeyResponder(resp *http.Respons return } +// RestoreCertificate restores a backed up certificate, and all its versions, to a vault. This operation requires the +// certificates/restore permission. +// Parameters: +// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net. +// parameters - the parameters to restore the certificate. +func (client BaseClient) RestoreCertificate(ctx context.Context, vaultBaseURL string, parameters CertificateRestoreParameters) (result CertificateBundle, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.CertificateBundleBackup", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("keyvault.BaseClient", "RestoreCertificate", err.Error()) + } + + req, err := client.RestoreCertificatePreparer(ctx, vaultBaseURL, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "RestoreCertificate", nil, "Failure preparing request") + return + } + + resp, err := client.RestoreCertificateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "RestoreCertificate", resp, "Failure sending request") + return + } + + result, err = client.RestoreCertificateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "RestoreCertificate", resp, "Failure responding to request") + } + + return +} + +// RestoreCertificatePreparer prepares the RestoreCertificate request. +func (client BaseClient) RestoreCertificatePreparer(ctx context.Context, vaultBaseURL string, parameters CertificateRestoreParameters) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "vaultBaseUrl": vaultBaseURL, + } + + const APIVersion = "7.0-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters), + autorest.WithPath("/certificates/restore"), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RestoreCertificateSender sends the RestoreCertificate request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) RestoreCertificateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// RestoreCertificateResponder handles the response to the RestoreCertificate request. The method always +// closes the http.Response Body. +func (client BaseClient) RestoreCertificateResponder(resp *http.Response) (result CertificateBundle, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + // RestoreKey imports a previously backed up key into Azure Key Vault, restoring the key, its key identifier, // attributes and access control policies. The RESTORE operation may be used to import a previously backed up key. // Individual versions of a key cannot be restored. The key is restored in its entirety with the same key name as it diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/keyvault/v7.0/keyvault/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/keyvault/v7.0/keyvault/models.go index 19d37b0a5..e8e885195 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/keyvault/v7.0/keyvault/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/keyvault/v7.0/keyvault/models.go @@ -63,19 +63,19 @@ func PossibleDeletionRecoveryLevelValues() []DeletionRecoveryLevel { type JSONWebKeyCurveName string const ( - // P256 ... + // P256 The NIST P-256 elliptic curve, AKA SECG curve SECP256R1. P256 JSONWebKeyCurveName = "P-256" - // P384 ... + // P256K The SECG SECP256K1 elliptic curve. + P256K JSONWebKeyCurveName = "P-256K" + // P384 The NIST P-384 elliptic curve, AKA SECG curve SECP384R1. P384 JSONWebKeyCurveName = "P-384" - // P521 ... + // P521 The NIST P-521 elliptic curve, AKA SECG curve SECP521R1. P521 JSONWebKeyCurveName = "P-521" - // SECP256K1 ... - SECP256K1 JSONWebKeyCurveName = "SECP256K1" ) // PossibleJSONWebKeyCurveNameValues returns an array of possible values for the JSONWebKeyCurveName const type. func PossibleJSONWebKeyCurveNameValues() []JSONWebKeyCurveName { - return []JSONWebKeyCurveName{P256, P384, P521, SECP256K1} + return []JSONWebKeyCurveName{P256, P256K, P384, P521} } // JSONWebKeyEncryptionAlgorithm enumerates the values for json web key encryption algorithm. @@ -122,48 +122,51 @@ func PossibleJSONWebKeyOperationValues() []JSONWebKeyOperation { type JSONWebKeySignatureAlgorithm string const ( - // ECDSA256 ... - ECDSA256 JSONWebKeySignatureAlgorithm = "ECDSA256" - // ES256 ... + // ES256 ECDSA using P-256 and SHA-256, as described in https://tools.ietf.org/html/rfc7518. ES256 JSONWebKeySignatureAlgorithm = "ES256" - // ES384 ... + // ES256K ECDSA using P-256K and SHA-256, as described in https://tools.ietf.org/html/rfc7518 + ES256K JSONWebKeySignatureAlgorithm = "ES256K" + // ES384 ECDSA using P-384 and SHA-384, as described in https://tools.ietf.org/html/rfc7518 ES384 JSONWebKeySignatureAlgorithm = "ES384" - // ES512 ... + // ES512 ECDSA using P-521 and SHA-512, as described in https://tools.ietf.org/html/rfc7518 ES512 JSONWebKeySignatureAlgorithm = "ES512" - // PS256 ... + // PS256 RSASSA-PSS using SHA-256 and MGF1 with SHA-256, as described in + // https://tools.ietf.org/html/rfc7518 PS256 JSONWebKeySignatureAlgorithm = "PS256" - // PS384 ... + // PS384 RSASSA-PSS using SHA-384 and MGF1 with SHA-384, as described in + // https://tools.ietf.org/html/rfc7518 PS384 JSONWebKeySignatureAlgorithm = "PS384" - // PS512 ... + // PS512 RSASSA-PSS using SHA-512 and MGF1 with SHA-512, as described in + // https://tools.ietf.org/html/rfc7518 PS512 JSONWebKeySignatureAlgorithm = "PS512" - // RS256 ... + // RS256 RSASSA-PKCS1-v1_5 using SHA-256, as described in https://tools.ietf.org/html/rfc7518 RS256 JSONWebKeySignatureAlgorithm = "RS256" - // RS384 ... + // RS384 RSASSA-PKCS1-v1_5 using SHA-384, as described in https://tools.ietf.org/html/rfc7518 RS384 JSONWebKeySignatureAlgorithm = "RS384" - // RS512 ... + // RS512 RSASSA-PKCS1-v1_5 using SHA-512, as described in https://tools.ietf.org/html/rfc7518 RS512 JSONWebKeySignatureAlgorithm = "RS512" - // RSNULL ... + // RSNULL Reserved RSNULL JSONWebKeySignatureAlgorithm = "RSNULL" ) // PossibleJSONWebKeySignatureAlgorithmValues returns an array of possible values for the JSONWebKeySignatureAlgorithm const type. func PossibleJSONWebKeySignatureAlgorithmValues() []JSONWebKeySignatureAlgorithm { - return []JSONWebKeySignatureAlgorithm{ECDSA256, ES256, ES384, ES512, PS256, PS384, PS512, RS256, RS384, RS512, RSNULL} + return []JSONWebKeySignatureAlgorithm{ES256, ES256K, ES384, ES512, PS256, PS384, PS512, RS256, RS384, RS512, RSNULL} } // JSONWebKeyType enumerates the values for json web key type. type JSONWebKeyType string const ( - // EC ... + // EC Elliptic Curve. EC JSONWebKeyType = "EC" - // ECHSM ... + // ECHSM Elliptic Curve with a private key which is not exportable from the HSM. ECHSM JSONWebKeyType = "EC-HSM" - // Oct ... + // Oct Octet sequence (used to represent symmetric keys) Oct JSONWebKeyType = "oct" - // RSA ... + // RSA RSA (https://tools.ietf.org/html/rfc3447) RSA JSONWebKeyType = "RSA" - // RSAHSM ... + // RSAHSM RSA with a private key which is not exportable from the HSM. RSAHSM JSONWebKeyType = "RSA-HSM" ) @@ -248,6 +251,13 @@ type Attributes struct { Updated *date.UnixTime `json:"updated,omitempty"` } +// BackupCertificateResult the backup certificate result, containing the backup blob. +type BackupCertificateResult struct { + autorest.Response `json:"-"` + // Value - The backup blob containing the backed up certificate. + Value *string `json:"value,omitempty"` +} + // BackupKeyResult the backup key result, containing the backup blob. type BackupKeyResult struct { autorest.Response `json:"-"` @@ -740,6 +750,12 @@ type CertificatePolicy struct { Attributes *CertificateAttributes `json:"attributes,omitempty"` } +// CertificateRestoreParameters the certificate restore parameters. +type CertificateRestoreParameters struct { + // CertificateBundleBackup - The backup blob associated with a certificate bundle. + CertificateBundleBackup *string `json:"value,omitempty"` +} + // CertificateUpdateParameters the certificate update parameters. type CertificateUpdateParameters struct { // CertificatePolicy - The management policy for the certificate. @@ -1882,13 +1898,15 @@ type IssuerParameters struct { Name *string `json:"name,omitempty"` // CertificateType - Type of certificate to be requested from the issuer provider. CertificateType *string `json:"cty,omitempty"` + // CertificateTransparency - Indicates if the certificates generated under this policy should be published to certificate transparency logs. + CertificateTransparency *bool `json:"cert_transparency,omitempty"` } // JSONWebKey as of http://tools.ietf.org/html/draft-ietf-jose-json-web-key-18 type JSONWebKey struct { // Kid - Key identifier. Kid *string `json:"kid,omitempty"` - // Kty - JsonWebKey key type (kty). Possible values include: 'EC', 'ECHSM', 'RSA', 'RSAHSM', 'Oct' + // Kty - JsonWebKey Key Type (kty), as defined in https://tools.ietf.org/html/draft-ietf-jose-json-web-algorithms-40. Possible values include: 'EC', 'ECHSM', 'RSA', 'RSAHSM', 'Oct' Kty JSONWebKeyType `json:"kty,omitempty"` KeyOps *[]string `json:"key_ops,omitempty"` // N - RSA modulus. @@ -1911,7 +1929,7 @@ type JSONWebKey struct { K *string `json:"k,omitempty"` // T - HSM Token, used with 'Bring Your Own Key'. T *string `json:"key_hsm,omitempty"` - // Crv - Elliptic curve name. For valid values, see JsonWebKeyCurveName. Possible values include: 'P256', 'P384', 'P521', 'SECP256K1' + // Crv - Elliptic curve name. For valid values, see JsonWebKeyCurveName. Possible values include: 'P256', 'P384', 'P521', 'P256K' Crv JSONWebKeyCurveName `json:"crv,omitempty"` // X - X component of an EC public key. X *string `json:"x,omitempty"` @@ -1970,13 +1988,13 @@ func (kb KeyBundle) MarshalJSON() ([]byte, error) { type KeyCreateParameters struct { // Kty - The type of key to create. For valid values, see JsonWebKeyType. Possible values include: 'EC', 'ECHSM', 'RSA', 'RSAHSM', 'Oct' Kty JSONWebKeyType `json:"kty,omitempty"` - // KeySize - The key size in bytes. For example, 1024 or 2048. + // KeySize - The key size in bits. For example: 2048, 3072, or 4096 for RSA. KeySize *int32 `json:"key_size,omitempty"` KeyOps *[]JSONWebKeyOperation `json:"key_ops,omitempty"` KeyAttributes *KeyAttributes `json:"attributes,omitempty"` // Tags - Application specific metadata in the form of key-value pairs. Tags map[string]*string `json:"tags"` - // Curve - Elliptic curve name. For valid values, see JsonWebKeyCurveName. Possible values include: 'P256', 'P384', 'P521', 'SECP256K1' + // Curve - Elliptic curve name. For valid values, see JsonWebKeyCurveName. Possible values include: 'P256', 'P384', 'P521', 'P256K' Curve JSONWebKeyCurveName `json:"crv,omitempty"` } @@ -2185,12 +2203,14 @@ type KeyOperationsParameters struct { type KeyProperties struct { // Exportable - Indicates if the private key can be exported. Exportable *bool `json:"exportable,omitempty"` - // KeyType - The key type. - KeyType *string `json:"kty,omitempty"` - // KeySize - The key size in bytes. For example; 1024 or 2048. + // Kty - The type of key pair to be used for the certificate. Possible values include: 'EC', 'ECHSM', 'RSA', 'RSAHSM', 'Oct' + Kty JSONWebKeyType `json:"kty,omitempty"` + // KeySize - The key size in bits. For example: 2048, 3072, or 4096 for RSA. KeySize *int32 `json:"key_size,omitempty"` // ReuseKey - Indicates if the same key pair will be used on certificate renewal. ReuseKey *bool `json:"reuse_key,omitempty"` + // Curve - Elliptic curve name. For valid values, see JsonWebKeyCurveName. Possible values include: 'P256', 'P384', 'P521', 'P256K' + Curve JSONWebKeyCurveName `json:"crv,omitempty"` } // KeyRestoreParameters the key restore parameters. @@ -2201,7 +2221,7 @@ type KeyRestoreParameters struct { // KeySignParameters the key operations parameters. type KeySignParameters struct { - // Algorithm - The signing/verification algorithm identifier. For more information on possible algorithm types, see JsonWebKeySignatureAlgorithm. Possible values include: 'PS256', 'PS384', 'PS512', 'RS256', 'RS384', 'RS512', 'RSNULL', 'ES256', 'ES384', 'ES512', 'ECDSA256' + // Algorithm - The signing/verification algorithm identifier. For more information on possible algorithm types, see JsonWebKeySignatureAlgorithm. Possible values include: 'PS256', 'PS384', 'PS512', 'RS256', 'RS384', 'RS512', 'RSNULL', 'ES256', 'ES384', 'ES512', 'ES256K' Algorithm JSONWebKeySignatureAlgorithm `json:"alg,omitempty"` Value *string `json:"value,omitempty"` } @@ -2232,7 +2252,7 @@ func (kup KeyUpdateParameters) MarshalJSON() ([]byte, error) { // KeyVerifyParameters the key verify parameters. type KeyVerifyParameters struct { - // Algorithm - The signing/verification algorithm. For more information on possible algorithm types, see JsonWebKeySignatureAlgorithm. Possible values include: 'PS256', 'PS384', 'PS512', 'RS256', 'RS384', 'RS512', 'RSNULL', 'ES256', 'ES384', 'ES512', 'ECDSA256' + // Algorithm - The signing/verification algorithm. For more information on possible algorithm types, see JsonWebKeySignatureAlgorithm. Possible values include: 'PS256', 'PS384', 'PS512', 'RS256', 'RS384', 'RS512', 'RSNULL', 'ES256', 'ES384', 'ES512', 'ES256K' Algorithm JSONWebKeySignatureAlgorithm `json:"alg,omitempty"` // Digest - The digest used for signing. Digest *string `json:"digest,omitempty"` diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/machinelearning/mgmt/2016-05-01-preview/webservices/webservices.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/machinelearning/mgmt/2016-05-01-preview/webservices/webservices.go index f526d2fc2..a75660423 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/machinelearning/mgmt/2016-05-01-preview/webservices/webservices.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/machinelearning/mgmt/2016-05-01-preview/webservices/webservices.go @@ -56,7 +56,7 @@ func (client Client) CreateOrUpdate(ctx context.Context, resourceGroupName strin Constraints: []validation.Constraint{{Target: "createOrUpdatePayload.Properties", Name: validation.Null, Rule: true, Chain: []validation.Constraint{{Target: "createOrUpdatePayload.Properties.RealtimeConfiguration", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "createOrUpdatePayload.Properties.RealtimeConfiguration.MaxConcurrentCalls", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "createOrUpdatePayload.Properties.RealtimeConfiguration.MaxConcurrentCalls", Name: validation.InclusiveMaximum, Rule: 200, Chain: nil}, + Chain: []validation.Constraint{{Target: "createOrUpdatePayload.Properties.RealtimeConfiguration.MaxConcurrentCalls", Name: validation.InclusiveMaximum, Rule: int64(200), Chain: nil}, {Target: "createOrUpdatePayload.Properties.RealtimeConfiguration.MaxConcurrentCalls", Name: validation.InclusiveMinimum, Rule: 4, Chain: nil}, }}, }}, diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/machinelearning/mgmt/2017-08-01-preview/compute/operationalizationclusters.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/machinelearning/mgmt/2017-08-01-preview/compute/operationalizationclusters.go index 0c2c2a1f1..7154312be 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/machinelearning/mgmt/2017-08-01-preview/compute/operationalizationclusters.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/machinelearning/mgmt/2017-08-01-preview/compute/operationalizationclusters.go @@ -148,11 +148,11 @@ func (client OperationalizationClustersClient) CreateOrUpdate(ctx context.Contex }}, }}, {Target: "parameters.OperationalizationClusterProperties.ContainerService.MasterCount", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.OperationalizationClusterProperties.ContainerService.MasterCount", Name: validation.InclusiveMaximum, Rule: 5, Chain: nil}, + Chain: []validation.Constraint{{Target: "parameters.OperationalizationClusterProperties.ContainerService.MasterCount", Name: validation.InclusiveMaximum, Rule: int64(5), Chain: nil}, {Target: "parameters.OperationalizationClusterProperties.ContainerService.MasterCount", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}, {Target: "parameters.OperationalizationClusterProperties.ContainerService.AgentCount", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.OperationalizationClusterProperties.ContainerService.AgentCount", Name: validation.InclusiveMaximum, Rule: 100, Chain: nil}, + Chain: []validation.Constraint{{Target: "parameters.OperationalizationClusterProperties.ContainerService.AgentCount", Name: validation.InclusiveMaximum, Rule: int64(100), Chain: nil}, {Target: "parameters.OperationalizationClusterProperties.ContainerService.AgentCount", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}, }}, diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/mediaservices/mgmt/2018-06-01-preview/media/assets.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/mediaservices/mgmt/2018-06-01-preview/media/assets.go new file mode 100644 index 000000000..f7ef6d2e8 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/mediaservices/mgmt/2018-06-01-preview/media/assets.go @@ -0,0 +1,572 @@ +package media + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "net/http" +) + +// AssetsClient is the client for the Assets methods of the Media service. +type AssetsClient struct { + BaseClient +} + +// NewAssetsClient creates an instance of the AssetsClient client. +func NewAssetsClient(subscriptionID string) AssetsClient { + return NewAssetsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewAssetsClientWithBaseURI creates an instance of the AssetsClient client. +func NewAssetsClientWithBaseURI(baseURI string, subscriptionID string) AssetsClient { + return AssetsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or updates an Asset in the Media Services account +// Parameters: +// resourceGroupName - the name of the resource group within the Azure subscription. +// accountName - the Media Services account name. +// assetName - the Asset name. +// parameters - the request parameters +func (client AssetsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, accountName string, assetName string, parameters Asset) (result Asset, err error) { + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, accountName, assetName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "media.AssetsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "media.AssetsClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "media.AssetsClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client AssetsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, accountName string, assetName string, parameters Asset) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "assetName": autorest.Encode("path", assetName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/assets/{assetName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client AssetsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client AssetsClient) CreateOrUpdateResponder(resp *http.Response) (result Asset, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes an Asset in the Media Services account +// Parameters: +// resourceGroupName - the name of the resource group within the Azure subscription. +// accountName - the Media Services account name. +// assetName - the Asset name. +func (client AssetsClient) Delete(ctx context.Context, resourceGroupName string, accountName string, assetName string) (result autorest.Response, err error) { + req, err := client.DeletePreparer(ctx, resourceGroupName, accountName, assetName) + if err != nil { + err = autorest.NewErrorWithError(err, "media.AssetsClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "media.AssetsClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "media.AssetsClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client AssetsClient) DeletePreparer(ctx context.Context, resourceGroupName string, accountName string, assetName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "assetName": autorest.Encode("path", assetName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/assets/{assetName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client AssetsClient) DeleteSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client AssetsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get get the details of an Asset in the Media Services account +// Parameters: +// resourceGroupName - the name of the resource group within the Azure subscription. +// accountName - the Media Services account name. +// assetName - the Asset name. +func (client AssetsClient) Get(ctx context.Context, resourceGroupName string, accountName string, assetName string) (result Asset, err error) { + req, err := client.GetPreparer(ctx, resourceGroupName, accountName, assetName) + if err != nil { + err = autorest.NewErrorWithError(err, "media.AssetsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "media.AssetsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "media.AssetsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client AssetsClient) GetPreparer(ctx context.Context, resourceGroupName string, accountName string, assetName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "assetName": autorest.Encode("path", assetName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/assets/{assetName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client AssetsClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client AssetsClient) GetResponder(resp *http.Response) (result Asset, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetEncryptionKey gets the Asset storage encryption keys used to decrypt content created by version 2 of the Media +// Services API +// Parameters: +// resourceGroupName - the name of the resource group within the Azure subscription. +// accountName - the Media Services account name. +// assetName - the Asset name. +func (client AssetsClient) GetEncryptionKey(ctx context.Context, resourceGroupName string, accountName string, assetName string) (result AssetStorageEncryptionKey, err error) { + req, err := client.GetEncryptionKeyPreparer(ctx, resourceGroupName, accountName, assetName) + if err != nil { + err = autorest.NewErrorWithError(err, "media.AssetsClient", "GetEncryptionKey", nil, "Failure preparing request") + return + } + + resp, err := client.GetEncryptionKeySender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "media.AssetsClient", "GetEncryptionKey", resp, "Failure sending request") + return + } + + result, err = client.GetEncryptionKeyResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "media.AssetsClient", "GetEncryptionKey", resp, "Failure responding to request") + } + + return +} + +// GetEncryptionKeyPreparer prepares the GetEncryptionKey request. +func (client AssetsClient) GetEncryptionKeyPreparer(ctx context.Context, resourceGroupName string, accountName string, assetName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "assetName": autorest.Encode("path", assetName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/assets/{assetName}/getEncryptionKey", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetEncryptionKeySender sends the GetEncryptionKey request. The method will close the +// http.Response Body if it receives an error. +func (client AssetsClient) GetEncryptionKeySender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetEncryptionKeyResponder handles the response to the GetEncryptionKey request. The method always +// closes the http.Response Body. +func (client AssetsClient) GetEncryptionKeyResponder(resp *http.Response) (result AssetStorageEncryptionKey, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List list Assets in the Media Services account with optional filtering and ordering +// Parameters: +// resourceGroupName - the name of the resource group within the Azure subscription. +// accountName - the Media Services account name. +// filter - restricts the set of items returned. +// top - specifies a non-negative integer n that limits the number of items returned from a collection. The +// service returns the number of available items up to but not greater than the specified value n. +// orderby - specifies the the key by which the result collection should be ordered. +func (client AssetsClient) List(ctx context.Context, resourceGroupName string, accountName string, filter string, top *int32, orderby string) (result AssetCollectionPage, err error) { + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName, accountName, filter, top, orderby) + if err != nil { + err = autorest.NewErrorWithError(err, "media.AssetsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.ac.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "media.AssetsClient", "List", resp, "Failure sending request") + return + } + + result.ac, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "media.AssetsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client AssetsClient) ListPreparer(ctx context.Context, resourceGroupName string, accountName string, filter string, top *int32, orderby string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + if len(orderby) > 0 { + queryParameters["$orderby"] = autorest.Encode("query", orderby) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/assets", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client AssetsClient) ListSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client AssetsClient) ListResponder(resp *http.Response) (result AssetCollection, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client AssetsClient) listNextResults(lastResults AssetCollection) (result AssetCollection, err error) { + req, err := lastResults.assetCollectionPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "media.AssetsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "media.AssetsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "media.AssetsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client AssetsClient) ListComplete(ctx context.Context, resourceGroupName string, accountName string, filter string, top *int32, orderby string) (result AssetCollectionIterator, err error) { + result.page, err = client.List(ctx, resourceGroupName, accountName, filter, top, orderby) + return +} + +// ListContainerSas lists storage container URLs with shared access signatures (SAS) for uploading and downloading +// Asset content. The signatures are derived from the storage account keys. +// Parameters: +// resourceGroupName - the name of the resource group within the Azure subscription. +// accountName - the Media Services account name. +// assetName - the Asset name. +// parameters - the request parameters +func (client AssetsClient) ListContainerSas(ctx context.Context, resourceGroupName string, accountName string, assetName string, parameters ListContainerSasInput) (result AssetContainerSas, err error) { + req, err := client.ListContainerSasPreparer(ctx, resourceGroupName, accountName, assetName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "media.AssetsClient", "ListContainerSas", nil, "Failure preparing request") + return + } + + resp, err := client.ListContainerSasSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "media.AssetsClient", "ListContainerSas", resp, "Failure sending request") + return + } + + result, err = client.ListContainerSasResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "media.AssetsClient", "ListContainerSas", resp, "Failure responding to request") + } + + return +} + +// ListContainerSasPreparer prepares the ListContainerSas request. +func (client AssetsClient) ListContainerSasPreparer(ctx context.Context, resourceGroupName string, accountName string, assetName string, parameters ListContainerSasInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "assetName": autorest.Encode("path", assetName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/assets/{assetName}/listContainerSas", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListContainerSasSender sends the ListContainerSas request. The method will close the +// http.Response Body if it receives an error. +func (client AssetsClient) ListContainerSasSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListContainerSasResponder handles the response to the ListContainerSas request. The method always +// closes the http.Response Body. +func (client AssetsClient) ListContainerSasResponder(resp *http.Response) (result AssetContainerSas, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Update updates an existing Asset in the Media Services account +// Parameters: +// resourceGroupName - the name of the resource group within the Azure subscription. +// accountName - the Media Services account name. +// assetName - the Asset name. +// parameters - the request parameters +func (client AssetsClient) Update(ctx context.Context, resourceGroupName string, accountName string, assetName string, parameters Asset) (result Asset, err error) { + req, err := client.UpdatePreparer(ctx, resourceGroupName, accountName, assetName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "media.AssetsClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "media.AssetsClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "media.AssetsClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client AssetsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, accountName string, assetName string, parameters Asset) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "assetName": autorest.Encode("path", assetName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/assets/{assetName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client AssetsClient) UpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client AssetsClient) UpdateResponder(resp *http.Response) (result Asset, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/mediaservices/mgmt/2018-06-01-preview/media/client.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/mediaservices/mgmt/2018-06-01-preview/media/client.go new file mode 100644 index 000000000..2834528d9 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/mediaservices/mgmt/2018-06-01-preview/media/client.go @@ -0,0 +1,51 @@ +// Package media implements the Azure ARM Media service API version 2018-06-01-preview. +// +// +package media + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/Azure/go-autorest/autorest" +) + +const ( + // DefaultBaseURI is the default URI used for the service Media + DefaultBaseURI = "https://management.azure.com" +) + +// BaseClient is the base client for Media. +type BaseClient struct { + autorest.Client + BaseURI string + SubscriptionID string +} + +// New creates an instance of the BaseClient client. +func New(subscriptionID string) BaseClient { + return NewWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewWithBaseURI creates an instance of the BaseClient client. +func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { + return BaseClient{ + Client: autorest.NewClientWithUserAgent(UserAgent()), + BaseURI: baseURI, + SubscriptionID: subscriptionID, + } +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/mediaservices/mgmt/2018-06-01-preview/media/contentkeypolicies.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/mediaservices/mgmt/2018-06-01-preview/media/contentkeypolicies.go new file mode 100644 index 000000000..ed627e3ad --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/mediaservices/mgmt/2018-06-01-preview/media/contentkeypolicies.go @@ -0,0 +1,506 @@ +package media + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// ContentKeyPoliciesClient is the client for the ContentKeyPolicies methods of the Media service. +type ContentKeyPoliciesClient struct { + BaseClient +} + +// NewContentKeyPoliciesClient creates an instance of the ContentKeyPoliciesClient client. +func NewContentKeyPoliciesClient(subscriptionID string) ContentKeyPoliciesClient { + return NewContentKeyPoliciesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewContentKeyPoliciesClientWithBaseURI creates an instance of the ContentKeyPoliciesClient client. +func NewContentKeyPoliciesClientWithBaseURI(baseURI string, subscriptionID string) ContentKeyPoliciesClient { + return ContentKeyPoliciesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate create or update a Content Key Policy in the Media Services account +// Parameters: +// resourceGroupName - the name of the resource group within the Azure subscription. +// accountName - the Media Services account name. +// contentKeyPolicyName - the Content Key Policy name. +// parameters - the request parameters +func (client ContentKeyPoliciesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, accountName string, contentKeyPolicyName string, parameters ContentKeyPolicy) (result ContentKeyPolicy, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.ContentKeyPolicyProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ContentKeyPolicyProperties.Options", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("media.ContentKeyPoliciesClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, accountName, contentKeyPolicyName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "media.ContentKeyPoliciesClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "media.ContentKeyPoliciesClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "media.ContentKeyPoliciesClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client ContentKeyPoliciesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, accountName string, contentKeyPolicyName string, parameters ContentKeyPolicy) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "contentKeyPolicyName": autorest.Encode("path", contentKeyPolicyName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/contentKeyPolicies/{contentKeyPolicyName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client ContentKeyPoliciesClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client ContentKeyPoliciesClient) CreateOrUpdateResponder(resp *http.Response) (result ContentKeyPolicy, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes a Content Key Policy in the Media Services account +// Parameters: +// resourceGroupName - the name of the resource group within the Azure subscription. +// accountName - the Media Services account name. +// contentKeyPolicyName - the Content Key Policy name. +func (client ContentKeyPoliciesClient) Delete(ctx context.Context, resourceGroupName string, accountName string, contentKeyPolicyName string) (result autorest.Response, err error) { + req, err := client.DeletePreparer(ctx, resourceGroupName, accountName, contentKeyPolicyName) + if err != nil { + err = autorest.NewErrorWithError(err, "media.ContentKeyPoliciesClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "media.ContentKeyPoliciesClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "media.ContentKeyPoliciesClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ContentKeyPoliciesClient) DeletePreparer(ctx context.Context, resourceGroupName string, accountName string, contentKeyPolicyName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "contentKeyPolicyName": autorest.Encode("path", contentKeyPolicyName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/contentKeyPolicies/{contentKeyPolicyName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ContentKeyPoliciesClient) DeleteSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ContentKeyPoliciesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get get the details of a Content Key Policy in the Media Services account +// Parameters: +// resourceGroupName - the name of the resource group within the Azure subscription. +// accountName - the Media Services account name. +// contentKeyPolicyName - the Content Key Policy name. +func (client ContentKeyPoliciesClient) Get(ctx context.Context, resourceGroupName string, accountName string, contentKeyPolicyName string) (result ContentKeyPolicy, err error) { + req, err := client.GetPreparer(ctx, resourceGroupName, accountName, contentKeyPolicyName) + if err != nil { + err = autorest.NewErrorWithError(err, "media.ContentKeyPoliciesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "media.ContentKeyPoliciesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "media.ContentKeyPoliciesClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client ContentKeyPoliciesClient) GetPreparer(ctx context.Context, resourceGroupName string, accountName string, contentKeyPolicyName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "contentKeyPolicyName": autorest.Encode("path", contentKeyPolicyName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/contentKeyPolicies/{contentKeyPolicyName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ContentKeyPoliciesClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ContentKeyPoliciesClient) GetResponder(resp *http.Response) (result ContentKeyPolicy, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetPolicyPropertiesWithSecrets get a Content Key Policy including secret values +// Parameters: +// resourceGroupName - the name of the resource group within the Azure subscription. +// accountName - the Media Services account name. +// contentKeyPolicyName - the Content Key Policy name. +func (client ContentKeyPoliciesClient) GetPolicyPropertiesWithSecrets(ctx context.Context, resourceGroupName string, accountName string, contentKeyPolicyName string) (result ContentKeyPolicyProperties, err error) { + req, err := client.GetPolicyPropertiesWithSecretsPreparer(ctx, resourceGroupName, accountName, contentKeyPolicyName) + if err != nil { + err = autorest.NewErrorWithError(err, "media.ContentKeyPoliciesClient", "GetPolicyPropertiesWithSecrets", nil, "Failure preparing request") + return + } + + resp, err := client.GetPolicyPropertiesWithSecretsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "media.ContentKeyPoliciesClient", "GetPolicyPropertiesWithSecrets", resp, "Failure sending request") + return + } + + result, err = client.GetPolicyPropertiesWithSecretsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "media.ContentKeyPoliciesClient", "GetPolicyPropertiesWithSecrets", resp, "Failure responding to request") + } + + return +} + +// GetPolicyPropertiesWithSecretsPreparer prepares the GetPolicyPropertiesWithSecrets request. +func (client ContentKeyPoliciesClient) GetPolicyPropertiesWithSecretsPreparer(ctx context.Context, resourceGroupName string, accountName string, contentKeyPolicyName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "contentKeyPolicyName": autorest.Encode("path", contentKeyPolicyName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/contentKeyPolicies/{contentKeyPolicyName}/getPolicyPropertiesWithSecrets", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetPolicyPropertiesWithSecretsSender sends the GetPolicyPropertiesWithSecrets request. The method will close the +// http.Response Body if it receives an error. +func (client ContentKeyPoliciesClient) GetPolicyPropertiesWithSecretsSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetPolicyPropertiesWithSecretsResponder handles the response to the GetPolicyPropertiesWithSecrets request. The method always +// closes the http.Response Body. +func (client ContentKeyPoliciesClient) GetPolicyPropertiesWithSecretsResponder(resp *http.Response) (result ContentKeyPolicyProperties, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists the Content Key Policies in the account +// Parameters: +// resourceGroupName - the name of the resource group within the Azure subscription. +// accountName - the Media Services account name. +// filter - restricts the set of items returned. +// top - specifies a non-negative integer n that limits the number of items returned from a collection. The +// service returns the number of available items up to but not greater than the specified value n. +// orderby - specifies the the key by which the result collection should be ordered. +func (client ContentKeyPoliciesClient) List(ctx context.Context, resourceGroupName string, accountName string, filter string, top *int32, orderby string) (result ContentKeyPolicyCollectionPage, err error) { + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName, accountName, filter, top, orderby) + if err != nil { + err = autorest.NewErrorWithError(err, "media.ContentKeyPoliciesClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.ckpc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "media.ContentKeyPoliciesClient", "List", resp, "Failure sending request") + return + } + + result.ckpc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "media.ContentKeyPoliciesClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client ContentKeyPoliciesClient) ListPreparer(ctx context.Context, resourceGroupName string, accountName string, filter string, top *int32, orderby string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + if len(orderby) > 0 { + queryParameters["$orderby"] = autorest.Encode("query", orderby) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/contentKeyPolicies", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ContentKeyPoliciesClient) ListSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ContentKeyPoliciesClient) ListResponder(resp *http.Response) (result ContentKeyPolicyCollection, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ContentKeyPoliciesClient) listNextResults(lastResults ContentKeyPolicyCollection) (result ContentKeyPolicyCollection, err error) { + req, err := lastResults.contentKeyPolicyCollectionPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "media.ContentKeyPoliciesClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "media.ContentKeyPoliciesClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "media.ContentKeyPoliciesClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ContentKeyPoliciesClient) ListComplete(ctx context.Context, resourceGroupName string, accountName string, filter string, top *int32, orderby string) (result ContentKeyPolicyCollectionIterator, err error) { + result.page, err = client.List(ctx, resourceGroupName, accountName, filter, top, orderby) + return +} + +// Update updates an existing Content Key Policy in the Media Services account +// Parameters: +// resourceGroupName - the name of the resource group within the Azure subscription. +// accountName - the Media Services account name. +// contentKeyPolicyName - the Content Key Policy name. +// parameters - the request parameters +func (client ContentKeyPoliciesClient) Update(ctx context.Context, resourceGroupName string, accountName string, contentKeyPolicyName string, parameters ContentKeyPolicy) (result ContentKeyPolicy, err error) { + req, err := client.UpdatePreparer(ctx, resourceGroupName, accountName, contentKeyPolicyName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "media.ContentKeyPoliciesClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "media.ContentKeyPoliciesClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "media.ContentKeyPoliciesClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client ContentKeyPoliciesClient) UpdatePreparer(ctx context.Context, resourceGroupName string, accountName string, contentKeyPolicyName string, parameters ContentKeyPolicy) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "contentKeyPolicyName": autorest.Encode("path", contentKeyPolicyName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/contentKeyPolicies/{contentKeyPolicyName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client ContentKeyPoliciesClient) UpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client ContentKeyPoliciesClient) UpdateResponder(resp *http.Response) (result ContentKeyPolicy, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/mediaservices/mgmt/2018-06-01-preview/media/jobs.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/mediaservices/mgmt/2018-06-01-preview/media/jobs.go new file mode 100644 index 000000000..93a513b6c --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/mediaservices/mgmt/2018-06-01-preview/media/jobs.go @@ -0,0 +1,446 @@ +package media + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// JobsClient is the client for the Jobs methods of the Media service. +type JobsClient struct { + BaseClient +} + +// NewJobsClient creates an instance of the JobsClient client. +func NewJobsClient(subscriptionID string) JobsClient { + return NewJobsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewJobsClientWithBaseURI creates an instance of the JobsClient client. +func NewJobsClientWithBaseURI(baseURI string, subscriptionID string) JobsClient { + return JobsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CancelJob cancel a Job. +// Parameters: +// resourceGroupName - the name of the resource group within the Azure subscription. +// accountName - the Media Services account name. +// transformName - the Transform name. +// jobName - the Job name. +func (client JobsClient) CancelJob(ctx context.Context, resourceGroupName string, accountName string, transformName string, jobName string) (result autorest.Response, err error) { + req, err := client.CancelJobPreparer(ctx, resourceGroupName, accountName, transformName, jobName) + if err != nil { + err = autorest.NewErrorWithError(err, "media.JobsClient", "CancelJob", nil, "Failure preparing request") + return + } + + resp, err := client.CancelJobSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "media.JobsClient", "CancelJob", resp, "Failure sending request") + return + } + + result, err = client.CancelJobResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "media.JobsClient", "CancelJob", resp, "Failure responding to request") + } + + return +} + +// CancelJobPreparer prepares the CancelJob request. +func (client JobsClient) CancelJobPreparer(ctx context.Context, resourceGroupName string, accountName string, transformName string, jobName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "jobName": autorest.Encode("path", jobName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "transformName": autorest.Encode("path", transformName), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/transforms/{transformName}/jobs/{jobName}/cancelJob", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CancelJobSender sends the CancelJob request. The method will close the +// http.Response Body if it receives an error. +func (client JobsClient) CancelJobSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// CancelJobResponder handles the response to the CancelJob request. The method always +// closes the http.Response Body. +func (client JobsClient) CancelJobResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Create creates a Job. +// Parameters: +// resourceGroupName - the name of the resource group within the Azure subscription. +// accountName - the Media Services account name. +// transformName - the Transform name. +// jobName - the Job name. +// parameters - the request parameters +func (client JobsClient) Create(ctx context.Context, resourceGroupName string, accountName string, transformName string, jobName string, parameters Job) (result Job, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.JobProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.JobProperties.Input", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.JobProperties.Outputs", Name: validation.Null, Rule: true, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("media.JobsClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, resourceGroupName, accountName, transformName, jobName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "media.JobsClient", "Create", nil, "Failure preparing request") + return + } + + resp, err := client.CreateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "media.JobsClient", "Create", resp, "Failure sending request") + return + } + + result, err = client.CreateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "media.JobsClient", "Create", resp, "Failure responding to request") + } + + return +} + +// CreatePreparer prepares the Create request. +func (client JobsClient) CreatePreparer(ctx context.Context, resourceGroupName string, accountName string, transformName string, jobName string, parameters Job) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "jobName": autorest.Encode("path", jobName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "transformName": autorest.Encode("path", transformName), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/transforms/{transformName}/jobs/{jobName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client JobsClient) CreateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client JobsClient) CreateResponder(resp *http.Response) (result Job, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes a Job. +// Parameters: +// resourceGroupName - the name of the resource group within the Azure subscription. +// accountName - the Media Services account name. +// transformName - the Transform name. +// jobName - the Job name. +func (client JobsClient) Delete(ctx context.Context, resourceGroupName string, accountName string, transformName string, jobName string) (result autorest.Response, err error) { + req, err := client.DeletePreparer(ctx, resourceGroupName, accountName, transformName, jobName) + if err != nil { + err = autorest.NewErrorWithError(err, "media.JobsClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "media.JobsClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "media.JobsClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client JobsClient) DeletePreparer(ctx context.Context, resourceGroupName string, accountName string, transformName string, jobName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "jobName": autorest.Encode("path", jobName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "transformName": autorest.Encode("path", transformName), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/transforms/{transformName}/jobs/{jobName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client JobsClient) DeleteSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client JobsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets a Job. +// Parameters: +// resourceGroupName - the name of the resource group within the Azure subscription. +// accountName - the Media Services account name. +// transformName - the Transform name. +// jobName - the Job name. +func (client JobsClient) Get(ctx context.Context, resourceGroupName string, accountName string, transformName string, jobName string) (result Job, err error) { + req, err := client.GetPreparer(ctx, resourceGroupName, accountName, transformName, jobName) + if err != nil { + err = autorest.NewErrorWithError(err, "media.JobsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "media.JobsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "media.JobsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client JobsClient) GetPreparer(ctx context.Context, resourceGroupName string, accountName string, transformName string, jobName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "jobName": autorest.Encode("path", jobName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "transformName": autorest.Encode("path", transformName), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/transforms/{transformName}/jobs/{jobName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client JobsClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client JobsClient) GetResponder(resp *http.Response) (result Job, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists all of the Jobs for the Transform. +// Parameters: +// resourceGroupName - the name of the resource group within the Azure subscription. +// accountName - the Media Services account name. +// transformName - the Transform name. +// filter - restricts the set of items returned. +// top - specifies a non-negative integer n that limits the number of items returned from a collection. The +// service returns the number of available items up to but not greater than the specified value n. +// skip - specifies a non-negative integer n that excludes the first n items of the queried collection from the +// result. The service returns items starting at position n+1. +func (client JobsClient) List(ctx context.Context, resourceGroupName string, accountName string, transformName string, filter string, top *int32, skip *int32) (result JobCollectionPage, err error) { + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName, accountName, transformName, filter, top, skip) + if err != nil { + err = autorest.NewErrorWithError(err, "media.JobsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.jc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "media.JobsClient", "List", resp, "Failure sending request") + return + } + + result.jc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "media.JobsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client JobsClient) ListPreparer(ctx context.Context, resourceGroupName string, accountName string, transformName string, filter string, top *int32, skip *int32) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "transformName": autorest.Encode("path", transformName), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + if skip != nil { + queryParameters["$skip"] = autorest.Encode("query", *skip) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/transforms/{transformName}/jobs", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client JobsClient) ListSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client JobsClient) ListResponder(resp *http.Response) (result JobCollection, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client JobsClient) listNextResults(lastResults JobCollection) (result JobCollection, err error) { + req, err := lastResults.jobCollectionPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "media.JobsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "media.JobsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "media.JobsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client JobsClient) ListComplete(ctx context.Context, resourceGroupName string, accountName string, transformName string, filter string, top *int32, skip *int32) (result JobCollectionIterator, err error) { + result.page, err = client.List(ctx, resourceGroupName, accountName, transformName, filter, top, skip) + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/mediaservices/mgmt/2018-06-01-preview/media/liveevents.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/mediaservices/mgmt/2018-06-01-preview/media/liveevents.go new file mode 100644 index 000000000..fbcfa43a0 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/mediaservices/mgmt/2018-06-01-preview/media/liveevents.go @@ -0,0 +1,711 @@ +package media + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// LiveEventsClient is the client for the LiveEvents methods of the Media service. +type LiveEventsClient struct { + BaseClient +} + +// NewLiveEventsClient creates an instance of the LiveEventsClient client. +func NewLiveEventsClient(subscriptionID string) LiveEventsClient { + return NewLiveEventsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewLiveEventsClientWithBaseURI creates an instance of the LiveEventsClient client. +func NewLiveEventsClientWithBaseURI(baseURI string, subscriptionID string) LiveEventsClient { + return LiveEventsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Create creates a Live Event. +// Parameters: +// resourceGroupName - the name of the resource group within the Azure subscription. +// accountName - the Media Services account name. +// liveEventName - the name of the Live Event. +// parameters - live Event properties needed for creation. +// autoStart - the flag indicates if auto start the Live Event. +func (client LiveEventsClient) Create(ctx context.Context, resourceGroupName string, accountName string, liveEventName string, parameters LiveEvent, autoStart *bool) (result LiveEventsCreateFuture, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: liveEventName, + Constraints: []validation.Constraint{{Target: "liveEventName", Name: validation.MaxLength, Rule: 32, Chain: nil}, + {Target: "liveEventName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "liveEventName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.LiveEventProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.LiveEventProperties.Input", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("media.LiveEventsClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, resourceGroupName, accountName, liveEventName, parameters, autoStart) + if err != nil { + err = autorest.NewErrorWithError(err, "media.LiveEventsClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "media.LiveEventsClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client LiveEventsClient) CreatePreparer(ctx context.Context, resourceGroupName string, accountName string, liveEventName string, parameters LiveEvent, autoStart *bool) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "liveEventName": autorest.Encode("path", liveEventName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if autoStart != nil { + queryParameters["autoStart"] = autorest.Encode("query", *autoStart) + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/liveEvents/{liveEventName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client LiveEventsClient) CreateSender(req *http.Request) (future LiveEventsCreateFuture, err error) { + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client LiveEventsClient) CreateResponder(resp *http.Response) (result LiveEvent, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes a Live Event. +// Parameters: +// resourceGroupName - the name of the resource group within the Azure subscription. +// accountName - the Media Services account name. +// liveEventName - the name of the Live Event. +func (client LiveEventsClient) Delete(ctx context.Context, resourceGroupName string, accountName string, liveEventName string) (result LiveEventsDeleteFuture, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: liveEventName, + Constraints: []validation.Constraint{{Target: "liveEventName", Name: validation.MaxLength, Rule: 32, Chain: nil}, + {Target: "liveEventName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "liveEventName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("media.LiveEventsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, accountName, liveEventName) + if err != nil { + err = autorest.NewErrorWithError(err, "media.LiveEventsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "media.LiveEventsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client LiveEventsClient) DeletePreparer(ctx context.Context, resourceGroupName string, accountName string, liveEventName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "liveEventName": autorest.Encode("path", liveEventName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/liveEvents/{liveEventName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client LiveEventsClient) DeleteSender(req *http.Request) (future LiveEventsDeleteFuture, err error) { + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client LiveEventsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets a Live Event. +// Parameters: +// resourceGroupName - the name of the resource group within the Azure subscription. +// accountName - the Media Services account name. +// liveEventName - the name of the Live Event. +func (client LiveEventsClient) Get(ctx context.Context, resourceGroupName string, accountName string, liveEventName string) (result LiveEvent, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: liveEventName, + Constraints: []validation.Constraint{{Target: "liveEventName", Name: validation.MaxLength, Rule: 32, Chain: nil}, + {Target: "liveEventName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "liveEventName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("media.LiveEventsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, accountName, liveEventName) + if err != nil { + err = autorest.NewErrorWithError(err, "media.LiveEventsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "media.LiveEventsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "media.LiveEventsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client LiveEventsClient) GetPreparer(ctx context.Context, resourceGroupName string, accountName string, liveEventName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "liveEventName": autorest.Encode("path", liveEventName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/liveEvents/{liveEventName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client LiveEventsClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client LiveEventsClient) GetResponder(resp *http.Response) (result LiveEvent, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists the Live Events in the account. +// Parameters: +// resourceGroupName - the name of the resource group within the Azure subscription. +// accountName - the Media Services account name. +func (client LiveEventsClient) List(ctx context.Context, resourceGroupName string, accountName string) (result LiveEventListResultPage, err error) { + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName, accountName) + if err != nil { + err = autorest.NewErrorWithError(err, "media.LiveEventsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.lelr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "media.LiveEventsClient", "List", resp, "Failure sending request") + return + } + + result.lelr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "media.LiveEventsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client LiveEventsClient) ListPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/liveEvents", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client LiveEventsClient) ListSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client LiveEventsClient) ListResponder(resp *http.Response) (result LiveEventListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client LiveEventsClient) listNextResults(lastResults LiveEventListResult) (result LiveEventListResult, err error) { + req, err := lastResults.liveEventListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "media.LiveEventsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "media.LiveEventsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "media.LiveEventsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client LiveEventsClient) ListComplete(ctx context.Context, resourceGroupName string, accountName string) (result LiveEventListResultIterator, err error) { + result.page, err = client.List(ctx, resourceGroupName, accountName) + return +} + +// Reset resets an existing Live Event. +// Parameters: +// resourceGroupName - the name of the resource group within the Azure subscription. +// accountName - the Media Services account name. +// liveEventName - the name of the Live Event. +func (client LiveEventsClient) Reset(ctx context.Context, resourceGroupName string, accountName string, liveEventName string) (result LiveEventsResetFuture, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: liveEventName, + Constraints: []validation.Constraint{{Target: "liveEventName", Name: validation.MaxLength, Rule: 32, Chain: nil}, + {Target: "liveEventName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "liveEventName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("media.LiveEventsClient", "Reset", err.Error()) + } + + req, err := client.ResetPreparer(ctx, resourceGroupName, accountName, liveEventName) + if err != nil { + err = autorest.NewErrorWithError(err, "media.LiveEventsClient", "Reset", nil, "Failure preparing request") + return + } + + result, err = client.ResetSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "media.LiveEventsClient", "Reset", result.Response(), "Failure sending request") + return + } + + return +} + +// ResetPreparer prepares the Reset request. +func (client LiveEventsClient) ResetPreparer(ctx context.Context, resourceGroupName string, accountName string, liveEventName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "liveEventName": autorest.Encode("path", liveEventName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/liveEvents/{liveEventName}/reset", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ResetSender sends the Reset request. The method will close the +// http.Response Body if it receives an error. +func (client LiveEventsClient) ResetSender(req *http.Request) (future LiveEventsResetFuture, err error) { + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// ResetResponder handles the response to the Reset request. The method always +// closes the http.Response Body. +func (client LiveEventsClient) ResetResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// Start starts an existing Live Event. +// Parameters: +// resourceGroupName - the name of the resource group within the Azure subscription. +// accountName - the Media Services account name. +// liveEventName - the name of the Live Event. +func (client LiveEventsClient) Start(ctx context.Context, resourceGroupName string, accountName string, liveEventName string) (result LiveEventsStartFuture, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: liveEventName, + Constraints: []validation.Constraint{{Target: "liveEventName", Name: validation.MaxLength, Rule: 32, Chain: nil}, + {Target: "liveEventName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "liveEventName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("media.LiveEventsClient", "Start", err.Error()) + } + + req, err := client.StartPreparer(ctx, resourceGroupName, accountName, liveEventName) + if err != nil { + err = autorest.NewErrorWithError(err, "media.LiveEventsClient", "Start", nil, "Failure preparing request") + return + } + + result, err = client.StartSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "media.LiveEventsClient", "Start", result.Response(), "Failure sending request") + return + } + + return +} + +// StartPreparer prepares the Start request. +func (client LiveEventsClient) StartPreparer(ctx context.Context, resourceGroupName string, accountName string, liveEventName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "liveEventName": autorest.Encode("path", liveEventName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/liveEvents/{liveEventName}/start", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// StartSender sends the Start request. The method will close the +// http.Response Body if it receives an error. +func (client LiveEventsClient) StartSender(req *http.Request) (future LiveEventsStartFuture, err error) { + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// StartResponder handles the response to the Start request. The method always +// closes the http.Response Body. +func (client LiveEventsClient) StartResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// Stop stops an existing Live Event. +// Parameters: +// resourceGroupName - the name of the resource group within the Azure subscription. +// accountName - the Media Services account name. +// liveEventName - the name of the Live Event. +// parameters - liveEvent stop parameters +func (client LiveEventsClient) Stop(ctx context.Context, resourceGroupName string, accountName string, liveEventName string, parameters LiveEventActionInput) (result LiveEventsStopFuture, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: liveEventName, + Constraints: []validation.Constraint{{Target: "liveEventName", Name: validation.MaxLength, Rule: 32, Chain: nil}, + {Target: "liveEventName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "liveEventName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("media.LiveEventsClient", "Stop", err.Error()) + } + + req, err := client.StopPreparer(ctx, resourceGroupName, accountName, liveEventName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "media.LiveEventsClient", "Stop", nil, "Failure preparing request") + return + } + + result, err = client.StopSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "media.LiveEventsClient", "Stop", result.Response(), "Failure sending request") + return + } + + return +} + +// StopPreparer prepares the Stop request. +func (client LiveEventsClient) StopPreparer(ctx context.Context, resourceGroupName string, accountName string, liveEventName string, parameters LiveEventActionInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "liveEventName": autorest.Encode("path", liveEventName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/liveEvents/{liveEventName}/stop", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// StopSender sends the Stop request. The method will close the +// http.Response Body if it receives an error. +func (client LiveEventsClient) StopSender(req *http.Request) (future LiveEventsStopFuture, err error) { + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// StopResponder handles the response to the Stop request. The method always +// closes the http.Response Body. +func (client LiveEventsClient) StopResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// Update updates a existing Live Event. +// Parameters: +// resourceGroupName - the name of the resource group within the Azure subscription. +// accountName - the Media Services account name. +// liveEventName - the name of the Live Event. +// parameters - live Event properties needed for creation. +func (client LiveEventsClient) Update(ctx context.Context, resourceGroupName string, accountName string, liveEventName string, parameters LiveEvent) (result LiveEventsUpdateFuture, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: liveEventName, + Constraints: []validation.Constraint{{Target: "liveEventName", Name: validation.MaxLength, Rule: 32, Chain: nil}, + {Target: "liveEventName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "liveEventName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("media.LiveEventsClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, accountName, liveEventName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "media.LiveEventsClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "media.LiveEventsClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client LiveEventsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, accountName string, liveEventName string, parameters LiveEvent) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "liveEventName": autorest.Encode("path", liveEventName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/liveEvents/{liveEventName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client LiveEventsClient) UpdateSender(req *http.Request) (future LiveEventsUpdateFuture, err error) { + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client LiveEventsClient) UpdateResponder(resp *http.Response) (result LiveEvent, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/mediaservices/mgmt/2018-06-01-preview/media/liveoutputs.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/mediaservices/mgmt/2018-06-01-preview/media/liveoutputs.go new file mode 100644 index 000000000..a663812ee --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/mediaservices/mgmt/2018-06-01-preview/media/liveoutputs.go @@ -0,0 +1,410 @@ +package media + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// LiveOutputsClient is the client for the LiveOutputs methods of the Media service. +type LiveOutputsClient struct { + BaseClient +} + +// NewLiveOutputsClient creates an instance of the LiveOutputsClient client. +func NewLiveOutputsClient(subscriptionID string) LiveOutputsClient { + return NewLiveOutputsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewLiveOutputsClientWithBaseURI creates an instance of the LiveOutputsClient client. +func NewLiveOutputsClientWithBaseURI(baseURI string, subscriptionID string) LiveOutputsClient { + return LiveOutputsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Create creates a Live Output. +// Parameters: +// resourceGroupName - the name of the resource group within the Azure subscription. +// accountName - the Media Services account name. +// liveEventName - the name of the Live Event. +// liveOutputName - the name of the Live Output. +// parameters - live Output properties needed for creation. +func (client LiveOutputsClient) Create(ctx context.Context, resourceGroupName string, accountName string, liveEventName string, liveOutputName string, parameters LiveOutput) (result LiveOutputsCreateFuture, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: liveEventName, + Constraints: []validation.Constraint{{Target: "liveEventName", Name: validation.MaxLength, Rule: 32, Chain: nil}, + {Target: "liveEventName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "liveEventName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$`, Chain: nil}}}, + {TargetValue: liveOutputName, + Constraints: []validation.Constraint{{Target: "liveOutputName", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "liveOutputName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "liveOutputName", Name: validation.Pattern, Rule: `^([a-zA-Z0-9])+(-*[a-zA-Z0-9])*$`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.LiveOutputProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.LiveOutputProperties.AssetName", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.LiveOutputProperties.ArchiveWindowLength", Name: validation.Null, Rule: true, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("media.LiveOutputsClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, resourceGroupName, accountName, liveEventName, liveOutputName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "media.LiveOutputsClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "media.LiveOutputsClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client LiveOutputsClient) CreatePreparer(ctx context.Context, resourceGroupName string, accountName string, liveEventName string, liveOutputName string, parameters LiveOutput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "liveEventName": autorest.Encode("path", liveEventName), + "liveOutputName": autorest.Encode("path", liveOutputName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/liveEvents/{liveEventName}/liveOutputs/{liveOutputName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client LiveOutputsClient) CreateSender(req *http.Request) (future LiveOutputsCreateFuture, err error) { + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client LiveOutputsClient) CreateResponder(resp *http.Response) (result LiveOutput, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes a Live Output. +// Parameters: +// resourceGroupName - the name of the resource group within the Azure subscription. +// accountName - the Media Services account name. +// liveEventName - the name of the Live Event. +// liveOutputName - the name of the Live Output. +func (client LiveOutputsClient) Delete(ctx context.Context, resourceGroupName string, accountName string, liveEventName string, liveOutputName string) (result LiveOutputsDeleteFuture, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: liveEventName, + Constraints: []validation.Constraint{{Target: "liveEventName", Name: validation.MaxLength, Rule: 32, Chain: nil}, + {Target: "liveEventName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "liveEventName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$`, Chain: nil}}}, + {TargetValue: liveOutputName, + Constraints: []validation.Constraint{{Target: "liveOutputName", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "liveOutputName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "liveOutputName", Name: validation.Pattern, Rule: `^([a-zA-Z0-9])+(-*[a-zA-Z0-9])*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("media.LiveOutputsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, accountName, liveEventName, liveOutputName) + if err != nil { + err = autorest.NewErrorWithError(err, "media.LiveOutputsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "media.LiveOutputsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client LiveOutputsClient) DeletePreparer(ctx context.Context, resourceGroupName string, accountName string, liveEventName string, liveOutputName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "liveEventName": autorest.Encode("path", liveEventName), + "liveOutputName": autorest.Encode("path", liveOutputName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/liveEvents/{liveEventName}/liveOutputs/{liveOutputName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client LiveOutputsClient) DeleteSender(req *http.Request) (future LiveOutputsDeleteFuture, err error) { + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client LiveOutputsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets a Live Output. +// Parameters: +// resourceGroupName - the name of the resource group within the Azure subscription. +// accountName - the Media Services account name. +// liveEventName - the name of the Live Event. +// liveOutputName - the name of the Live Output. +func (client LiveOutputsClient) Get(ctx context.Context, resourceGroupName string, accountName string, liveEventName string, liveOutputName string) (result LiveOutput, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: liveEventName, + Constraints: []validation.Constraint{{Target: "liveEventName", Name: validation.MaxLength, Rule: 32, Chain: nil}, + {Target: "liveEventName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "liveEventName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$`, Chain: nil}}}, + {TargetValue: liveOutputName, + Constraints: []validation.Constraint{{Target: "liveOutputName", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "liveOutputName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "liveOutputName", Name: validation.Pattern, Rule: `^([a-zA-Z0-9])+(-*[a-zA-Z0-9])*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("media.LiveOutputsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, accountName, liveEventName, liveOutputName) + if err != nil { + err = autorest.NewErrorWithError(err, "media.LiveOutputsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "media.LiveOutputsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "media.LiveOutputsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client LiveOutputsClient) GetPreparer(ctx context.Context, resourceGroupName string, accountName string, liveEventName string, liveOutputName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "liveEventName": autorest.Encode("path", liveEventName), + "liveOutputName": autorest.Encode("path", liveOutputName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/liveEvents/{liveEventName}/liveOutputs/{liveOutputName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client LiveOutputsClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client LiveOutputsClient) GetResponder(resp *http.Response) (result LiveOutput, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists the Live Outputs in the Live Event. +// Parameters: +// resourceGroupName - the name of the resource group within the Azure subscription. +// accountName - the Media Services account name. +// liveEventName - the name of the Live Event. +func (client LiveOutputsClient) List(ctx context.Context, resourceGroupName string, accountName string, liveEventName string) (result LiveOutputListResultPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: liveEventName, + Constraints: []validation.Constraint{{Target: "liveEventName", Name: validation.MaxLength, Rule: 32, Chain: nil}, + {Target: "liveEventName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "liveEventName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("media.LiveOutputsClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName, accountName, liveEventName) + if err != nil { + err = autorest.NewErrorWithError(err, "media.LiveOutputsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.lolr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "media.LiveOutputsClient", "List", resp, "Failure sending request") + return + } + + result.lolr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "media.LiveOutputsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client LiveOutputsClient) ListPreparer(ctx context.Context, resourceGroupName string, accountName string, liveEventName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "liveEventName": autorest.Encode("path", liveEventName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/liveEvents/{liveEventName}/liveOutputs", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client LiveOutputsClient) ListSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client LiveOutputsClient) ListResponder(resp *http.Response) (result LiveOutputListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client LiveOutputsClient) listNextResults(lastResults LiveOutputListResult) (result LiveOutputListResult, err error) { + req, err := lastResults.liveOutputListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "media.LiveOutputsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "media.LiveOutputsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "media.LiveOutputsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client LiveOutputsClient) ListComplete(ctx context.Context, resourceGroupName string, accountName string, liveEventName string) (result LiveOutputListResultIterator, err error) { + result.page, err = client.List(ctx, resourceGroupName, accountName, liveEventName) + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/mediaservices/mgmt/2018-06-01-preview/media/locations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/mediaservices/mgmt/2018-06-01-preview/media/locations.go new file mode 100644 index 000000000..a84d2c8cc --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/mediaservices/mgmt/2018-06-01-preview/media/locations.go @@ -0,0 +1,107 @@ +package media + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "net/http" +) + +// LocationsClient is the client for the Locations methods of the Media service. +type LocationsClient struct { + BaseClient +} + +// NewLocationsClient creates an instance of the LocationsClient client. +func NewLocationsClient(subscriptionID string) LocationsClient { + return NewLocationsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewLocationsClientWithBaseURI creates an instance of the LocationsClient client. +func NewLocationsClientWithBaseURI(baseURI string, subscriptionID string) LocationsClient { + return LocationsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CheckNameAvailability checks whether the Media Service resource name is available. +// Parameters: +// parameters - the request parameters +func (client LocationsClient) CheckNameAvailability(ctx context.Context, locationName string, parameters CheckNameAvailabilityInput) (result EntityNameAvailabilityCheckOutput, err error) { + req, err := client.CheckNameAvailabilityPreparer(ctx, locationName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "media.LocationsClient", "CheckNameAvailability", nil, "Failure preparing request") + return + } + + resp, err := client.CheckNameAvailabilitySender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "media.LocationsClient", "CheckNameAvailability", resp, "Failure sending request") + return + } + + result, err = client.CheckNameAvailabilityResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "media.LocationsClient", "CheckNameAvailability", resp, "Failure responding to request") + } + + return +} + +// CheckNameAvailabilityPreparer prepares the CheckNameAvailability request. +func (client LocationsClient) CheckNameAvailabilityPreparer(ctx context.Context, locationName string, parameters CheckNameAvailabilityInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "locationName": autorest.Encode("path", locationName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Media/locations/{locationName}/checkNameAvailability", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CheckNameAvailabilitySender sends the CheckNameAvailability request. The method will close the +// http.Response Body if it receives an error. +func (client LocationsClient) CheckNameAvailabilitySender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// CheckNameAvailabilityResponder handles the response to the CheckNameAvailability request. The method always +// closes the http.Response Body. +func (client LocationsClient) CheckNameAvailabilityResponder(resp *http.Response) (result EntityNameAvailabilityCheckOutput, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/mediaservices/mgmt/2018-06-01-preview/media/mediaservices.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/mediaservices/mgmt/2018-06-01-preview/media/mediaservices.go new file mode 100644 index 000000000..363e1027b --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/mediaservices/mgmt/2018-06-01-preview/media/mediaservices.go @@ -0,0 +1,630 @@ +package media + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "net/http" +) + +// MediaservicesClient is the client for the Mediaservices methods of the Media service. +type MediaservicesClient struct { + BaseClient +} + +// NewMediaservicesClient creates an instance of the MediaservicesClient client. +func NewMediaservicesClient(subscriptionID string) MediaservicesClient { + return NewMediaservicesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewMediaservicesClientWithBaseURI creates an instance of the MediaservicesClient client. +func NewMediaservicesClientWithBaseURI(baseURI string, subscriptionID string) MediaservicesClient { + return MediaservicesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or updates a Media Services account +// Parameters: +// resourceGroupName - the name of the resource group within the Azure subscription. +// accountName - the Media Services account name. +// parameters - the request parameters +func (client MediaservicesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, accountName string, parameters Service) (result Service, err error) { + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, accountName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "media.MediaservicesClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "media.MediaservicesClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "media.MediaservicesClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client MediaservicesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, accountName string, parameters Service) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client MediaservicesClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client MediaservicesClient) CreateOrUpdateResponder(resp *http.Response) (result Service, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes a Media Services account +// Parameters: +// resourceGroupName - the name of the resource group within the Azure subscription. +// accountName - the Media Services account name. +func (client MediaservicesClient) Delete(ctx context.Context, resourceGroupName string, accountName string) (result autorest.Response, err error) { + req, err := client.DeletePreparer(ctx, resourceGroupName, accountName) + if err != nil { + err = autorest.NewErrorWithError(err, "media.MediaservicesClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "media.MediaservicesClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "media.MediaservicesClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client MediaservicesClient) DeletePreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client MediaservicesClient) DeleteSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client MediaservicesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get get the details of a Media Services account +// Parameters: +// resourceGroupName - the name of the resource group within the Azure subscription. +// accountName - the Media Services account name. +func (client MediaservicesClient) Get(ctx context.Context, resourceGroupName string, accountName string) (result Service, err error) { + req, err := client.GetPreparer(ctx, resourceGroupName, accountName) + if err != nil { + err = autorest.NewErrorWithError(err, "media.MediaservicesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "media.MediaservicesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "media.MediaservicesClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client MediaservicesClient) GetPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client MediaservicesClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client MediaservicesClient) GetResponder(resp *http.Response) (result Service, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetBySubscription get the details of a Media Services account +// Parameters: +// accountName - the Media Services account name. +func (client MediaservicesClient) GetBySubscription(ctx context.Context, accountName string) (result SubscriptionMediaService, err error) { + req, err := client.GetBySubscriptionPreparer(ctx, accountName) + if err != nil { + err = autorest.NewErrorWithError(err, "media.MediaservicesClient", "GetBySubscription", nil, "Failure preparing request") + return + } + + resp, err := client.GetBySubscriptionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "media.MediaservicesClient", "GetBySubscription", resp, "Failure sending request") + return + } + + result, err = client.GetBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "media.MediaservicesClient", "GetBySubscription", resp, "Failure responding to request") + } + + return +} + +// GetBySubscriptionPreparer prepares the GetBySubscription request. +func (client MediaservicesClient) GetBySubscriptionPreparer(ctx context.Context, accountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Media/mediaservices/{accountName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetBySubscriptionSender sends the GetBySubscription request. The method will close the +// http.Response Body if it receives an error. +func (client MediaservicesClient) GetBySubscriptionSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetBySubscriptionResponder handles the response to the GetBySubscription request. The method always +// closes the http.Response Body. +func (client MediaservicesClient) GetBySubscriptionResponder(resp *http.Response) (result SubscriptionMediaService, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List list Media Services accounts in the resource group +// Parameters: +// resourceGroupName - the name of the resource group within the Azure subscription. +func (client MediaservicesClient) List(ctx context.Context, resourceGroupName string) (result ServiceCollectionPage, err error) { + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "media.MediaservicesClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.sc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "media.MediaservicesClient", "List", resp, "Failure sending request") + return + } + + result.sc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "media.MediaservicesClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client MediaservicesClient) ListPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client MediaservicesClient) ListSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client MediaservicesClient) ListResponder(resp *http.Response) (result ServiceCollection, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client MediaservicesClient) listNextResults(lastResults ServiceCollection) (result ServiceCollection, err error) { + req, err := lastResults.serviceCollectionPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "media.MediaservicesClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "media.MediaservicesClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "media.MediaservicesClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client MediaservicesClient) ListComplete(ctx context.Context, resourceGroupName string) (result ServiceCollectionIterator, err error) { + result.page, err = client.List(ctx, resourceGroupName) + return +} + +// ListBySubscription list Media Services accounts in the subscription. +func (client MediaservicesClient) ListBySubscription(ctx context.Context) (result SubscriptionMediaServiceCollectionPage, err error) { + result.fn = client.listBySubscriptionNextResults + req, err := client.ListBySubscriptionPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "media.MediaservicesClient", "ListBySubscription", nil, "Failure preparing request") + return + } + + resp, err := client.ListBySubscriptionSender(req) + if err != nil { + result.smsc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "media.MediaservicesClient", "ListBySubscription", resp, "Failure sending request") + return + } + + result.smsc, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "media.MediaservicesClient", "ListBySubscription", resp, "Failure responding to request") + } + + return +} + +// ListBySubscriptionPreparer prepares the ListBySubscription request. +func (client MediaservicesClient) ListBySubscriptionPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Media/mediaservices", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListBySubscriptionSender sends the ListBySubscription request. The method will close the +// http.Response Body if it receives an error. +func (client MediaservicesClient) ListBySubscriptionSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListBySubscriptionResponder handles the response to the ListBySubscription request. The method always +// closes the http.Response Body. +func (client MediaservicesClient) ListBySubscriptionResponder(resp *http.Response) (result SubscriptionMediaServiceCollection, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listBySubscriptionNextResults retrieves the next set of results, if any. +func (client MediaservicesClient) listBySubscriptionNextResults(lastResults SubscriptionMediaServiceCollection) (result SubscriptionMediaServiceCollection, err error) { + req, err := lastResults.subscriptionMediaServiceCollectionPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "media.MediaservicesClient", "listBySubscriptionNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListBySubscriptionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "media.MediaservicesClient", "listBySubscriptionNextResults", resp, "Failure sending next results request") + } + result, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "media.MediaservicesClient", "listBySubscriptionNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required. +func (client MediaservicesClient) ListBySubscriptionComplete(ctx context.Context) (result SubscriptionMediaServiceCollectionIterator, err error) { + result.page, err = client.ListBySubscription(ctx) + return +} + +// SyncStorageKeys synchronizes storage account keys for a storage account associated with the Media Service account. +// Parameters: +// resourceGroupName - the name of the resource group within the Azure subscription. +// accountName - the Media Services account name. +// parameters - the request parameters +func (client MediaservicesClient) SyncStorageKeys(ctx context.Context, resourceGroupName string, accountName string, parameters SyncStorageKeysInput) (result autorest.Response, err error) { + req, err := client.SyncStorageKeysPreparer(ctx, resourceGroupName, accountName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "media.MediaservicesClient", "SyncStorageKeys", nil, "Failure preparing request") + return + } + + resp, err := client.SyncStorageKeysSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "media.MediaservicesClient", "SyncStorageKeys", resp, "Failure sending request") + return + } + + result, err = client.SyncStorageKeysResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "media.MediaservicesClient", "SyncStorageKeys", resp, "Failure responding to request") + } + + return +} + +// SyncStorageKeysPreparer prepares the SyncStorageKeys request. +func (client MediaservicesClient) SyncStorageKeysPreparer(ctx context.Context, resourceGroupName string, accountName string, parameters SyncStorageKeysInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/syncStorageKeys", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// SyncStorageKeysSender sends the SyncStorageKeys request. The method will close the +// http.Response Body if it receives an error. +func (client MediaservicesClient) SyncStorageKeysSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// SyncStorageKeysResponder handles the response to the SyncStorageKeys request. The method always +// closes the http.Response Body. +func (client MediaservicesClient) SyncStorageKeysResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Update updates an existing Media Services account +// Parameters: +// resourceGroupName - the name of the resource group within the Azure subscription. +// accountName - the Media Services account name. +// parameters - the request parameters +func (client MediaservicesClient) Update(ctx context.Context, resourceGroupName string, accountName string, parameters Service) (result Service, err error) { + req, err := client.UpdatePreparer(ctx, resourceGroupName, accountName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "media.MediaservicesClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "media.MediaservicesClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "media.MediaservicesClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client MediaservicesClient) UpdatePreparer(ctx context.Context, resourceGroupName string, accountName string, parameters Service) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client MediaservicesClient) UpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client MediaservicesClient) UpdateResponder(resp *http.Response) (result Service, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/mediaservices/mgmt/2018-06-01-preview/media/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/mediaservices/mgmt/2018-06-01-preview/media/models.go new file mode 100644 index 000000000..dda8304ce --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/mediaservices/mgmt/2018-06-01-preview/media/models.go @@ -0,0 +1,9643 @@ +package media + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "encoding/json" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/date" + "github.com/Azure/go-autorest/autorest/to" + "github.com/satori/go.uuid" + "net/http" +) + +// AacAudioProfile enumerates the values for aac audio profile. +type AacAudioProfile string + +const ( + // AacLc Specifies that the output audio is to be encoded into AAC Low Complexity profile (AAC-LC). + AacLc AacAudioProfile = "AacLc" + // HeAacV1 Specifies that the output audio is to be encoded into HE-AAC v1 profile. + HeAacV1 AacAudioProfile = "HeAacV1" + // HeAacV2 Specifies that the output audio is to be encoded into HE-AAC v2 profile. + HeAacV2 AacAudioProfile = "HeAacV2" +) + +// PossibleAacAudioProfileValues returns an array of possible values for the AacAudioProfile const type. +func PossibleAacAudioProfileValues() []AacAudioProfile { + return []AacAudioProfile{AacLc, HeAacV1, HeAacV2} +} + +// AssetContainerPermission enumerates the values for asset container permission. +type AssetContainerPermission string + +const ( + // Read The SAS URL will allow read access to the container. + Read AssetContainerPermission = "Read" + // ReadWrite The SAS URL will allow read and write access to the container. + ReadWrite AssetContainerPermission = "ReadWrite" + // ReadWriteDelete The SAS URL will allow read, write and delete access to the container. + ReadWriteDelete AssetContainerPermission = "ReadWriteDelete" +) + +// PossibleAssetContainerPermissionValues returns an array of possible values for the AssetContainerPermission const type. +func PossibleAssetContainerPermissionValues() []AssetContainerPermission { + return []AssetContainerPermission{Read, ReadWrite, ReadWriteDelete} +} + +// AssetStorageEncryptionFormat enumerates the values for asset storage encryption format. +type AssetStorageEncryptionFormat string + +const ( + // MediaStorageClientEncryption The Asset is encrypted with Media Services client-side encryption. + MediaStorageClientEncryption AssetStorageEncryptionFormat = "MediaStorageClientEncryption" + // None The Asset does not use client-side storage encryption (this is the only allowed value for new + // Assets). + None AssetStorageEncryptionFormat = "None" +) + +// PossibleAssetStorageEncryptionFormatValues returns an array of possible values for the AssetStorageEncryptionFormat const type. +func PossibleAssetStorageEncryptionFormatValues() []AssetStorageEncryptionFormat { + return []AssetStorageEncryptionFormat{MediaStorageClientEncryption, None} +} + +// ContentKeyPolicyFairPlayRentalAndLeaseKeyType enumerates the values for content key policy fair play rental +// and lease key type. +type ContentKeyPolicyFairPlayRentalAndLeaseKeyType string + +const ( + // PersistentLimited Content key can be persisted and the valid duration is limited by the Rental Duration + // value + PersistentLimited ContentKeyPolicyFairPlayRentalAndLeaseKeyType = "PersistentLimited" + // PersistentUnlimited Content key can be persisted with an unlimited duration + PersistentUnlimited ContentKeyPolicyFairPlayRentalAndLeaseKeyType = "PersistentUnlimited" + // Undefined Key duration is not specified. + Undefined ContentKeyPolicyFairPlayRentalAndLeaseKeyType = "Undefined" + // Unknown Represents a ContentKeyPolicyFairPlayRentalAndLeaseKeyType that is unavailable in current API + // version. + Unknown ContentKeyPolicyFairPlayRentalAndLeaseKeyType = "Unknown" +) + +// PossibleContentKeyPolicyFairPlayRentalAndLeaseKeyTypeValues returns an array of possible values for the ContentKeyPolicyFairPlayRentalAndLeaseKeyType const type. +func PossibleContentKeyPolicyFairPlayRentalAndLeaseKeyTypeValues() []ContentKeyPolicyFairPlayRentalAndLeaseKeyType { + return []ContentKeyPolicyFairPlayRentalAndLeaseKeyType{PersistentLimited, PersistentUnlimited, Undefined, Unknown} +} + +// ContentKeyPolicyPlayReadyContentType enumerates the values for content key policy play ready content type. +type ContentKeyPolicyPlayReadyContentType string + +const ( + // ContentKeyPolicyPlayReadyContentTypeUltraVioletDownload Ultraviolet download content type. + ContentKeyPolicyPlayReadyContentTypeUltraVioletDownload ContentKeyPolicyPlayReadyContentType = "UltraVioletDownload" + // ContentKeyPolicyPlayReadyContentTypeUltraVioletStreaming Ultraviolet streaming content type. + ContentKeyPolicyPlayReadyContentTypeUltraVioletStreaming ContentKeyPolicyPlayReadyContentType = "UltraVioletStreaming" + // ContentKeyPolicyPlayReadyContentTypeUnknown Represents a ContentKeyPolicyPlayReadyContentType that is + // unavailable in current API version. + ContentKeyPolicyPlayReadyContentTypeUnknown ContentKeyPolicyPlayReadyContentType = "Unknown" + // ContentKeyPolicyPlayReadyContentTypeUnspecified Unspecified content type. + ContentKeyPolicyPlayReadyContentTypeUnspecified ContentKeyPolicyPlayReadyContentType = "Unspecified" +) + +// PossibleContentKeyPolicyPlayReadyContentTypeValues returns an array of possible values for the ContentKeyPolicyPlayReadyContentType const type. +func PossibleContentKeyPolicyPlayReadyContentTypeValues() []ContentKeyPolicyPlayReadyContentType { + return []ContentKeyPolicyPlayReadyContentType{ContentKeyPolicyPlayReadyContentTypeUltraVioletDownload, ContentKeyPolicyPlayReadyContentTypeUltraVioletStreaming, ContentKeyPolicyPlayReadyContentTypeUnknown, ContentKeyPolicyPlayReadyContentTypeUnspecified} +} + +// ContentKeyPolicyPlayReadyLicenseType enumerates the values for content key policy play ready license type. +type ContentKeyPolicyPlayReadyLicenseType string + +const ( + // ContentKeyPolicyPlayReadyLicenseTypeNonPersistent Non persistent license. + ContentKeyPolicyPlayReadyLicenseTypeNonPersistent ContentKeyPolicyPlayReadyLicenseType = "NonPersistent" + // ContentKeyPolicyPlayReadyLicenseTypePersistent Persistent license. Allows offline playback. + ContentKeyPolicyPlayReadyLicenseTypePersistent ContentKeyPolicyPlayReadyLicenseType = "Persistent" + // ContentKeyPolicyPlayReadyLicenseTypeUnknown Represents a ContentKeyPolicyPlayReadyLicenseType that is + // unavailable in current API version. + ContentKeyPolicyPlayReadyLicenseTypeUnknown ContentKeyPolicyPlayReadyLicenseType = "Unknown" +) + +// PossibleContentKeyPolicyPlayReadyLicenseTypeValues returns an array of possible values for the ContentKeyPolicyPlayReadyLicenseType const type. +func PossibleContentKeyPolicyPlayReadyLicenseTypeValues() []ContentKeyPolicyPlayReadyLicenseType { + return []ContentKeyPolicyPlayReadyLicenseType{ContentKeyPolicyPlayReadyLicenseTypeNonPersistent, ContentKeyPolicyPlayReadyLicenseTypePersistent, ContentKeyPolicyPlayReadyLicenseTypeUnknown} +} + +// ContentKeyPolicyPlayReadyUnknownOutputPassingOption enumerates the values for content key policy play ready +// unknown output passing option. +type ContentKeyPolicyPlayReadyUnknownOutputPassingOption string + +const ( + // ContentKeyPolicyPlayReadyUnknownOutputPassingOptionAllowed Passing the video portion of protected + // content to an Unknown Output is allowed. + ContentKeyPolicyPlayReadyUnknownOutputPassingOptionAllowed ContentKeyPolicyPlayReadyUnknownOutputPassingOption = "Allowed" + // ContentKeyPolicyPlayReadyUnknownOutputPassingOptionAllowedWithVideoConstriction Passing the video + // portion of protected content to an Unknown Output is allowed but with constrained resolution. + ContentKeyPolicyPlayReadyUnknownOutputPassingOptionAllowedWithVideoConstriction ContentKeyPolicyPlayReadyUnknownOutputPassingOption = "AllowedWithVideoConstriction" + // ContentKeyPolicyPlayReadyUnknownOutputPassingOptionNotAllowed Passing the video portion of protected + // content to an Unknown Output is not allowed. + ContentKeyPolicyPlayReadyUnknownOutputPassingOptionNotAllowed ContentKeyPolicyPlayReadyUnknownOutputPassingOption = "NotAllowed" + // ContentKeyPolicyPlayReadyUnknownOutputPassingOptionUnknown Represents a + // ContentKeyPolicyPlayReadyUnknownOutputPassingOption that is unavailable in current API version. + ContentKeyPolicyPlayReadyUnknownOutputPassingOptionUnknown ContentKeyPolicyPlayReadyUnknownOutputPassingOption = "Unknown" +) + +// PossibleContentKeyPolicyPlayReadyUnknownOutputPassingOptionValues returns an array of possible values for the ContentKeyPolicyPlayReadyUnknownOutputPassingOption const type. +func PossibleContentKeyPolicyPlayReadyUnknownOutputPassingOptionValues() []ContentKeyPolicyPlayReadyUnknownOutputPassingOption { + return []ContentKeyPolicyPlayReadyUnknownOutputPassingOption{ContentKeyPolicyPlayReadyUnknownOutputPassingOptionAllowed, ContentKeyPolicyPlayReadyUnknownOutputPassingOptionAllowedWithVideoConstriction, ContentKeyPolicyPlayReadyUnknownOutputPassingOptionNotAllowed, ContentKeyPolicyPlayReadyUnknownOutputPassingOptionUnknown} +} + +// ContentKeyPolicyRestrictionTokenType enumerates the values for content key policy restriction token type. +type ContentKeyPolicyRestrictionTokenType string + +const ( + // ContentKeyPolicyRestrictionTokenTypeJwt JSON Web Token. + ContentKeyPolicyRestrictionTokenTypeJwt ContentKeyPolicyRestrictionTokenType = "Jwt" + // ContentKeyPolicyRestrictionTokenTypeSwt Simple Web Token. + ContentKeyPolicyRestrictionTokenTypeSwt ContentKeyPolicyRestrictionTokenType = "Swt" + // ContentKeyPolicyRestrictionTokenTypeUnknown Represents a ContentKeyPolicyRestrictionTokenType that is + // unavailable in current API version. + ContentKeyPolicyRestrictionTokenTypeUnknown ContentKeyPolicyRestrictionTokenType = "Unknown" +) + +// PossibleContentKeyPolicyRestrictionTokenTypeValues returns an array of possible values for the ContentKeyPolicyRestrictionTokenType const type. +func PossibleContentKeyPolicyRestrictionTokenTypeValues() []ContentKeyPolicyRestrictionTokenType { + return []ContentKeyPolicyRestrictionTokenType{ContentKeyPolicyRestrictionTokenTypeJwt, ContentKeyPolicyRestrictionTokenTypeSwt, ContentKeyPolicyRestrictionTokenTypeUnknown} +} + +// DeinterlaceMode enumerates the values for deinterlace mode. +type DeinterlaceMode string + +const ( + // AutoPixelAdaptive Apply automatic pixel adaptive de-interlacing on each frame in the input video. + AutoPixelAdaptive DeinterlaceMode = "AutoPixelAdaptive" + // Off Disables de-interlacing of the source video. + Off DeinterlaceMode = "Off" +) + +// PossibleDeinterlaceModeValues returns an array of possible values for the DeinterlaceMode const type. +func PossibleDeinterlaceModeValues() []DeinterlaceMode { + return []DeinterlaceMode{AutoPixelAdaptive, Off} +} + +// DeinterlaceParity enumerates the values for deinterlace parity. +type DeinterlaceParity string + +const ( + // Auto Automatically detect the order of fields + Auto DeinterlaceParity = "Auto" + // BottomFieldFirst Apply bottom field first processing of input video. + BottomFieldFirst DeinterlaceParity = "BottomFieldFirst" + // TopFieldFirst Apply top field first processing of input video. + TopFieldFirst DeinterlaceParity = "TopFieldFirst" +) + +// PossibleDeinterlaceParityValues returns an array of possible values for the DeinterlaceParity const type. +func PossibleDeinterlaceParityValues() []DeinterlaceParity { + return []DeinterlaceParity{Auto, BottomFieldFirst, TopFieldFirst} +} + +// EncoderNamedPreset enumerates the values for encoder named preset. +type EncoderNamedPreset string + +const ( + // AACGoodQualityAudio Produces a single MP4 file containing only stereo audio encoded at 192 kbps. + AACGoodQualityAudio EncoderNamedPreset = "AACGoodQualityAudio" + // AdaptiveStreaming Produces a set of GOP aligned MP4 files with H.264 video and stereo AAC audio. + // Auto-generates a bitrate ladder based on the input resolution and bitrate. The auto-generated preset + // will never exceed the input resolution and bitrate. For example, if the input is 720p at 3 Mbps, output + // will remain 720p at best, and will start at rates lower than 3 Mbps. The output will will have video and + // audio in separate MP4 files, which is optimal for adaptive streaming. + AdaptiveStreaming EncoderNamedPreset = "AdaptiveStreaming" + // H264MultipleBitrate1080p Produces a set of 8 GOP-aligned MP4 files, ranging from 6000 kbps to 400 kbps, + // and stereo AAC audio. Resolution starts at 1080p and goes down to 360p. + H264MultipleBitrate1080p EncoderNamedPreset = "H264MultipleBitrate1080p" + // H264MultipleBitrate720p Produces a set of 6 GOP-aligned MP4 files, ranging from 3400 kbps to 400 kbps, + // and stereo AAC audio. Resolution starts at 720p and goes down to 360p. + H264MultipleBitrate720p EncoderNamedPreset = "H264MultipleBitrate720p" + // H264MultipleBitrateSD Produces a set of 5 GOP-aligned MP4 files, ranging from 1600kbps to 400 kbps, and + // stereo AAC audio. Resolution starts at 480p and goes down to 360p. + H264MultipleBitrateSD EncoderNamedPreset = "H264MultipleBitrateSD" +) + +// PossibleEncoderNamedPresetValues returns an array of possible values for the EncoderNamedPreset const type. +func PossibleEncoderNamedPresetValues() []EncoderNamedPreset { + return []EncoderNamedPreset{AACGoodQualityAudio, AdaptiveStreaming, H264MultipleBitrate1080p, H264MultipleBitrate720p, H264MultipleBitrateSD} +} + +// EncryptionScheme enumerates the values for encryption scheme. +type EncryptionScheme string + +const ( + // EncryptionSchemeCommonEncryptionCbcs CommonEncryptionCbcs scheme + EncryptionSchemeCommonEncryptionCbcs EncryptionScheme = "CommonEncryptionCbcs" + // EncryptionSchemeCommonEncryptionCenc CommonEncryptionCenc scheme + EncryptionSchemeCommonEncryptionCenc EncryptionScheme = "CommonEncryptionCenc" + // EncryptionSchemeEnvelopeEncryption EnvelopeEncryption scheme + EncryptionSchemeEnvelopeEncryption EncryptionScheme = "EnvelopeEncryption" + // EncryptionSchemeNoEncryption NoEncryption scheme + EncryptionSchemeNoEncryption EncryptionScheme = "NoEncryption" +) + +// PossibleEncryptionSchemeValues returns an array of possible values for the EncryptionScheme const type. +func PossibleEncryptionSchemeValues() []EncryptionScheme { + return []EncryptionScheme{EncryptionSchemeCommonEncryptionCbcs, EncryptionSchemeCommonEncryptionCenc, EncryptionSchemeEnvelopeEncryption, EncryptionSchemeNoEncryption} +} + +// EntropyMode enumerates the values for entropy mode. +type EntropyMode string + +const ( + // Cabac Context Adaptive Binary Arithmetic Coder (CABAC) entropy encoding. + Cabac EntropyMode = "Cabac" + // Cavlc Context Adaptive Variable Length Coder (CAVLC) entropy encoding. + Cavlc EntropyMode = "Cavlc" +) + +// PossibleEntropyModeValues returns an array of possible values for the EntropyMode const type. +func PossibleEntropyModeValues() []EntropyMode { + return []EntropyMode{Cabac, Cavlc} +} + +// H264Complexity enumerates the values for h264 complexity. +type H264Complexity string + +const ( + // Balanced Tells the encoder to use settings that achieve a balance between speed and quality. + Balanced H264Complexity = "Balanced" + // Quality Tells the encoder to use settings that are optimized to produce higher quality output at the + // expense of slower overall encode time. + Quality H264Complexity = "Quality" + // Speed Tells the encoder to use settings that are optimized for faster encoding. Quality is sacrificed to + // decrease encoding time. + Speed H264Complexity = "Speed" +) + +// PossibleH264ComplexityValues returns an array of possible values for the H264Complexity const type. +func PossibleH264ComplexityValues() []H264Complexity { + return []H264Complexity{Balanced, Quality, Speed} +} + +// H264VideoProfile enumerates the values for h264 video profile. +type H264VideoProfile string + +const ( + // H264VideoProfileAuto Tells the encoder to automatically determine the appropriate H.264 profile. + H264VideoProfileAuto H264VideoProfile = "Auto" + // H264VideoProfileBaseline Baseline profile + H264VideoProfileBaseline H264VideoProfile = "Baseline" + // H264VideoProfileHigh High profile. + H264VideoProfileHigh H264VideoProfile = "High" + // H264VideoProfileHigh422 High 4:2:2 profile. + H264VideoProfileHigh422 H264VideoProfile = "High422" + // H264VideoProfileHigh444 High 4:4:4 predictive profile. + H264VideoProfileHigh444 H264VideoProfile = "High444" + // H264VideoProfileMain Main profile + H264VideoProfileMain H264VideoProfile = "Main" +) + +// PossibleH264VideoProfileValues returns an array of possible values for the H264VideoProfile const type. +func PossibleH264VideoProfileValues() []H264VideoProfile { + return []H264VideoProfile{H264VideoProfileAuto, H264VideoProfileBaseline, H264VideoProfileHigh, H264VideoProfileHigh422, H264VideoProfileHigh444, H264VideoProfileMain} +} + +// JobErrorCategory enumerates the values for job error category. +type JobErrorCategory string + +const ( + // JobErrorCategoryConfiguration The error is configuration related. + JobErrorCategoryConfiguration JobErrorCategory = "Configuration" + // JobErrorCategoryContent The error is related to data in the input files. + JobErrorCategoryContent JobErrorCategory = "Content" + // JobErrorCategoryDownload The error is download related. + JobErrorCategoryDownload JobErrorCategory = "Download" + // JobErrorCategoryService The error is service related. + JobErrorCategoryService JobErrorCategory = "Service" + // JobErrorCategoryUpload The error is upload related. + JobErrorCategoryUpload JobErrorCategory = "Upload" +) + +// PossibleJobErrorCategoryValues returns an array of possible values for the JobErrorCategory const type. +func PossibleJobErrorCategoryValues() []JobErrorCategory { + return []JobErrorCategory{JobErrorCategoryConfiguration, JobErrorCategoryContent, JobErrorCategoryDownload, JobErrorCategoryService, JobErrorCategoryUpload} +} + +// JobErrorCode enumerates the values for job error code. +type JobErrorCode string + +const ( + // ConfigurationUnsupported There was a problem with the combination of input files and the configuration + // settings applied, fix the configuration settings and retry with the same input, or change input to match + // the configuration. + ConfigurationUnsupported JobErrorCode = "ConfigurationUnsupported" + // ContentMalformed There was a problem with the input content (for example: zero byte files, or + // corrupt/non-decodable files), check the input files. + ContentMalformed JobErrorCode = "ContentMalformed" + // ContentUnsupported There was a problem with the format of the input (not valid media file, or an + // unsupported file/codec), check the validity of the input files. + ContentUnsupported JobErrorCode = "ContentUnsupported" + // DownloadNotAccessible While trying to download the input files, the files were not accessible, please + // check the availability of the source. + DownloadNotAccessible JobErrorCode = "DownloadNotAccessible" + // DownloadTransientError While trying to download the input files, there was an issue during transfer + // (storage service, network errors), see details and check your source. + DownloadTransientError JobErrorCode = "DownloadTransientError" + // ServiceError Fatal service error, please contact support. + ServiceError JobErrorCode = "ServiceError" + // ServiceTransientError Transient error, please retry, if retry is unsuccessful, please contact support. + ServiceTransientError JobErrorCode = "ServiceTransientError" + // UploadNotAccessible While trying to upload the output files, the destination was not reachable, please + // check the availability of the destination. + UploadNotAccessible JobErrorCode = "UploadNotAccessible" + // UploadTransientError While trying to upload the output files, there was an issue during transfer + // (storage service, network errors), see details and check your destination. + UploadTransientError JobErrorCode = "UploadTransientError" +) + +// PossibleJobErrorCodeValues returns an array of possible values for the JobErrorCode const type. +func PossibleJobErrorCodeValues() []JobErrorCode { + return []JobErrorCode{ConfigurationUnsupported, ContentMalformed, ContentUnsupported, DownloadNotAccessible, DownloadTransientError, ServiceError, ServiceTransientError, UploadNotAccessible, UploadTransientError} +} + +// JobRetry enumerates the values for job retry. +type JobRetry string + +const ( + // DoNotRetry Issue needs to be investigated and then the job resubmitted with corrections or retried once + // the underlying issue has been corrected. + DoNotRetry JobRetry = "DoNotRetry" + // MayRetry Issue may be resolved after waiting for a period of time and resubmitting the same Job. + MayRetry JobRetry = "MayRetry" +) + +// PossibleJobRetryValues returns an array of possible values for the JobRetry const type. +func PossibleJobRetryValues() []JobRetry { + return []JobRetry{DoNotRetry, MayRetry} +} + +// JobState enumerates the values for job state. +type JobState string + +const ( + // Canceled The job was canceled. This is a final state for the job. + Canceled JobState = "Canceled" + // Canceling The job is in the process of being canceled. This is a transient state for the job. + Canceling JobState = "Canceling" + // Error The job has encountered an error. This is a final state for the job. + Error JobState = "Error" + // Finished The job is finished. This is a final state for the job. + Finished JobState = "Finished" + // Processing The job is processing. This is a transient state for the job. + Processing JobState = "Processing" + // Queued The job is in a queued state, waiting for resources to become available. This is a transient + // state. + Queued JobState = "Queued" + // Scheduled The job is being scheduled to run on an available resource. This is a transient state, between + // queued and processing states. + Scheduled JobState = "Scheduled" +) + +// PossibleJobStateValues returns an array of possible values for the JobState const type. +func PossibleJobStateValues() []JobState { + return []JobState{Canceled, Canceling, Error, Finished, Processing, Queued, Scheduled} +} + +// LiveEventEncodingType enumerates the values for live event encoding type. +type LiveEventEncodingType string + +const ( + // LiveEventEncodingTypeBasic ... + LiveEventEncodingTypeBasic LiveEventEncodingType = "Basic" + // LiveEventEncodingTypeNone ... + LiveEventEncodingTypeNone LiveEventEncodingType = "None" +) + +// PossibleLiveEventEncodingTypeValues returns an array of possible values for the LiveEventEncodingType const type. +func PossibleLiveEventEncodingTypeValues() []LiveEventEncodingType { + return []LiveEventEncodingType{LiveEventEncodingTypeBasic, LiveEventEncodingTypeNone} +} + +// LiveEventInputProtocol enumerates the values for live event input protocol. +type LiveEventInputProtocol string + +const ( + // FragmentedMP4 ... + FragmentedMP4 LiveEventInputProtocol = "FragmentedMP4" + // RTMP ... + RTMP LiveEventInputProtocol = "RTMP" +) + +// PossibleLiveEventInputProtocolValues returns an array of possible values for the LiveEventInputProtocol const type. +func PossibleLiveEventInputProtocolValues() []LiveEventInputProtocol { + return []LiveEventInputProtocol{FragmentedMP4, RTMP} +} + +// LiveEventResourceState enumerates the values for live event resource state. +type LiveEventResourceState string + +const ( + // Deleting ... + Deleting LiveEventResourceState = "Deleting" + // Running ... + Running LiveEventResourceState = "Running" + // Starting ... + Starting LiveEventResourceState = "Starting" + // Stopped ... + Stopped LiveEventResourceState = "Stopped" + // Stopping ... + Stopping LiveEventResourceState = "Stopping" +) + +// PossibleLiveEventResourceStateValues returns an array of possible values for the LiveEventResourceState const type. +func PossibleLiveEventResourceStateValues() []LiveEventResourceState { + return []LiveEventResourceState{Deleting, Running, Starting, Stopped, Stopping} +} + +// LiveOutputResourceState enumerates the values for live output resource state. +type LiveOutputResourceState string + +const ( + // LiveOutputResourceStateCreating ... + LiveOutputResourceStateCreating LiveOutputResourceState = "Creating" + // LiveOutputResourceStateDeleting ... + LiveOutputResourceStateDeleting LiveOutputResourceState = "Deleting" + // LiveOutputResourceStateRunning ... + LiveOutputResourceStateRunning LiveOutputResourceState = "Running" +) + +// PossibleLiveOutputResourceStateValues returns an array of possible values for the LiveOutputResourceState const type. +func PossibleLiveOutputResourceStateValues() []LiveOutputResourceState { + return []LiveOutputResourceState{LiveOutputResourceStateCreating, LiveOutputResourceStateDeleting, LiveOutputResourceStateRunning} +} + +// OdataType enumerates the values for odata type. +type OdataType string + +const ( + // OdataTypeContentKeyPolicyPlayReadyContentKeyLocation ... + OdataTypeContentKeyPolicyPlayReadyContentKeyLocation OdataType = "ContentKeyPolicyPlayReadyContentKeyLocation" + // OdataTypeMicrosoftMediaContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader ... + OdataTypeMicrosoftMediaContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader OdataType = "#Microsoft.Media.ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader" + // OdataTypeMicrosoftMediaContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier ... + OdataTypeMicrosoftMediaContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier OdataType = "#Microsoft.Media.ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier" +) + +// PossibleOdataTypeValues returns an array of possible values for the OdataType const type. +func PossibleOdataTypeValues() []OdataType { + return []OdataType{OdataTypeContentKeyPolicyPlayReadyContentKeyLocation, OdataTypeMicrosoftMediaContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader, OdataTypeMicrosoftMediaContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier} +} + +// OdataTypeBasicCodec enumerates the values for odata type basic codec. +type OdataTypeBasicCodec string + +const ( + // OdataTypeCodec ... + OdataTypeCodec OdataTypeBasicCodec = "Codec" + // OdataTypeMicrosoftMediaAacAudio ... + OdataTypeMicrosoftMediaAacAudio OdataTypeBasicCodec = "#Microsoft.Media.AacAudio" + // OdataTypeMicrosoftMediaAudio ... + OdataTypeMicrosoftMediaAudio OdataTypeBasicCodec = "#Microsoft.Media.Audio" + // OdataTypeMicrosoftMediaCopyAudio ... + OdataTypeMicrosoftMediaCopyAudio OdataTypeBasicCodec = "#Microsoft.Media.CopyAudio" + // OdataTypeMicrosoftMediaCopyVideo ... + OdataTypeMicrosoftMediaCopyVideo OdataTypeBasicCodec = "#Microsoft.Media.CopyVideo" + // OdataTypeMicrosoftMediaH264Video ... + OdataTypeMicrosoftMediaH264Video OdataTypeBasicCodec = "#Microsoft.Media.H264Video" + // OdataTypeMicrosoftMediaImage ... + OdataTypeMicrosoftMediaImage OdataTypeBasicCodec = "#Microsoft.Media.Image" + // OdataTypeMicrosoftMediaJpgImage ... + OdataTypeMicrosoftMediaJpgImage OdataTypeBasicCodec = "#Microsoft.Media.JpgImage" + // OdataTypeMicrosoftMediaPngImage ... + OdataTypeMicrosoftMediaPngImage OdataTypeBasicCodec = "#Microsoft.Media.PngImage" + // OdataTypeMicrosoftMediaVideo ... + OdataTypeMicrosoftMediaVideo OdataTypeBasicCodec = "#Microsoft.Media.Video" +) + +// PossibleOdataTypeBasicCodecValues returns an array of possible values for the OdataTypeBasicCodec const type. +func PossibleOdataTypeBasicCodecValues() []OdataTypeBasicCodec { + return []OdataTypeBasicCodec{OdataTypeCodec, OdataTypeMicrosoftMediaAacAudio, OdataTypeMicrosoftMediaAudio, OdataTypeMicrosoftMediaCopyAudio, OdataTypeMicrosoftMediaCopyVideo, OdataTypeMicrosoftMediaH264Video, OdataTypeMicrosoftMediaImage, OdataTypeMicrosoftMediaJpgImage, OdataTypeMicrosoftMediaPngImage, OdataTypeMicrosoftMediaVideo} +} + +// OdataTypeBasicContentKeyPolicyConfiguration enumerates the values for odata type basic content key policy +// configuration. +type OdataTypeBasicContentKeyPolicyConfiguration string + +const ( + // OdataTypeContentKeyPolicyConfiguration ... + OdataTypeContentKeyPolicyConfiguration OdataTypeBasicContentKeyPolicyConfiguration = "ContentKeyPolicyConfiguration" + // OdataTypeMicrosoftMediaContentKeyPolicyClearKeyConfiguration ... + OdataTypeMicrosoftMediaContentKeyPolicyClearKeyConfiguration OdataTypeBasicContentKeyPolicyConfiguration = "#Microsoft.Media.ContentKeyPolicyClearKeyConfiguration" + // OdataTypeMicrosoftMediaContentKeyPolicyFairPlayConfiguration ... + OdataTypeMicrosoftMediaContentKeyPolicyFairPlayConfiguration OdataTypeBasicContentKeyPolicyConfiguration = "#Microsoft.Media.ContentKeyPolicyFairPlayConfiguration" + // OdataTypeMicrosoftMediaContentKeyPolicyPlayReadyConfiguration ... + OdataTypeMicrosoftMediaContentKeyPolicyPlayReadyConfiguration OdataTypeBasicContentKeyPolicyConfiguration = "#Microsoft.Media.ContentKeyPolicyPlayReadyConfiguration" + // OdataTypeMicrosoftMediaContentKeyPolicyUnknownConfiguration ... + OdataTypeMicrosoftMediaContentKeyPolicyUnknownConfiguration OdataTypeBasicContentKeyPolicyConfiguration = "#Microsoft.Media.ContentKeyPolicyUnknownConfiguration" + // OdataTypeMicrosoftMediaContentKeyPolicyWidevineConfiguration ... + OdataTypeMicrosoftMediaContentKeyPolicyWidevineConfiguration OdataTypeBasicContentKeyPolicyConfiguration = "#Microsoft.Media.ContentKeyPolicyWidevineConfiguration" +) + +// PossibleOdataTypeBasicContentKeyPolicyConfigurationValues returns an array of possible values for the OdataTypeBasicContentKeyPolicyConfiguration const type. +func PossibleOdataTypeBasicContentKeyPolicyConfigurationValues() []OdataTypeBasicContentKeyPolicyConfiguration { + return []OdataTypeBasicContentKeyPolicyConfiguration{OdataTypeContentKeyPolicyConfiguration, OdataTypeMicrosoftMediaContentKeyPolicyClearKeyConfiguration, OdataTypeMicrosoftMediaContentKeyPolicyFairPlayConfiguration, OdataTypeMicrosoftMediaContentKeyPolicyPlayReadyConfiguration, OdataTypeMicrosoftMediaContentKeyPolicyUnknownConfiguration, OdataTypeMicrosoftMediaContentKeyPolicyWidevineConfiguration} +} + +// OdataTypeBasicContentKeyPolicyRestriction enumerates the values for odata type basic content key policy +// restriction. +type OdataTypeBasicContentKeyPolicyRestriction string + +const ( + // OdataTypeContentKeyPolicyRestriction ... + OdataTypeContentKeyPolicyRestriction OdataTypeBasicContentKeyPolicyRestriction = "ContentKeyPolicyRestriction" + // OdataTypeMicrosoftMediaContentKeyPolicyOpenRestriction ... + OdataTypeMicrosoftMediaContentKeyPolicyOpenRestriction OdataTypeBasicContentKeyPolicyRestriction = "#Microsoft.Media.ContentKeyPolicyOpenRestriction" + // OdataTypeMicrosoftMediaContentKeyPolicyTokenRestriction ... + OdataTypeMicrosoftMediaContentKeyPolicyTokenRestriction OdataTypeBasicContentKeyPolicyRestriction = "#Microsoft.Media.ContentKeyPolicyTokenRestriction" + // OdataTypeMicrosoftMediaContentKeyPolicyUnknownRestriction ... + OdataTypeMicrosoftMediaContentKeyPolicyUnknownRestriction OdataTypeBasicContentKeyPolicyRestriction = "#Microsoft.Media.ContentKeyPolicyUnknownRestriction" +) + +// PossibleOdataTypeBasicContentKeyPolicyRestrictionValues returns an array of possible values for the OdataTypeBasicContentKeyPolicyRestriction const type. +func PossibleOdataTypeBasicContentKeyPolicyRestrictionValues() []OdataTypeBasicContentKeyPolicyRestriction { + return []OdataTypeBasicContentKeyPolicyRestriction{OdataTypeContentKeyPolicyRestriction, OdataTypeMicrosoftMediaContentKeyPolicyOpenRestriction, OdataTypeMicrosoftMediaContentKeyPolicyTokenRestriction, OdataTypeMicrosoftMediaContentKeyPolicyUnknownRestriction} +} + +// OdataTypeBasicContentKeyPolicyRestrictionTokenKey enumerates the values for odata type basic content key +// policy restriction token key. +type OdataTypeBasicContentKeyPolicyRestrictionTokenKey string + +const ( + // OdataTypeContentKeyPolicyRestrictionTokenKey ... + OdataTypeContentKeyPolicyRestrictionTokenKey OdataTypeBasicContentKeyPolicyRestrictionTokenKey = "ContentKeyPolicyRestrictionTokenKey" + // OdataTypeMicrosoftMediaContentKeyPolicyRsaTokenKey ... + OdataTypeMicrosoftMediaContentKeyPolicyRsaTokenKey OdataTypeBasicContentKeyPolicyRestrictionTokenKey = "#Microsoft.Media.ContentKeyPolicyRsaTokenKey" + // OdataTypeMicrosoftMediaContentKeyPolicySymmetricTokenKey ... + OdataTypeMicrosoftMediaContentKeyPolicySymmetricTokenKey OdataTypeBasicContentKeyPolicyRestrictionTokenKey = "#Microsoft.Media.ContentKeyPolicySymmetricTokenKey" + // OdataTypeMicrosoftMediaContentKeyPolicyX509CertificateTokenKey ... + OdataTypeMicrosoftMediaContentKeyPolicyX509CertificateTokenKey OdataTypeBasicContentKeyPolicyRestrictionTokenKey = "#Microsoft.Media.ContentKeyPolicyX509CertificateTokenKey" +) + +// PossibleOdataTypeBasicContentKeyPolicyRestrictionTokenKeyValues returns an array of possible values for the OdataTypeBasicContentKeyPolicyRestrictionTokenKey const type. +func PossibleOdataTypeBasicContentKeyPolicyRestrictionTokenKeyValues() []OdataTypeBasicContentKeyPolicyRestrictionTokenKey { + return []OdataTypeBasicContentKeyPolicyRestrictionTokenKey{OdataTypeContentKeyPolicyRestrictionTokenKey, OdataTypeMicrosoftMediaContentKeyPolicyRsaTokenKey, OdataTypeMicrosoftMediaContentKeyPolicySymmetricTokenKey, OdataTypeMicrosoftMediaContentKeyPolicyX509CertificateTokenKey} +} + +// OdataTypeBasicFormat enumerates the values for odata type basic format. +type OdataTypeBasicFormat string + +const ( + // OdataTypeFormat ... + OdataTypeFormat OdataTypeBasicFormat = "Format" + // OdataTypeMicrosoftMediaImageFormat ... + OdataTypeMicrosoftMediaImageFormat OdataTypeBasicFormat = "#Microsoft.Media.ImageFormat" + // OdataTypeMicrosoftMediaJpgFormat ... + OdataTypeMicrosoftMediaJpgFormat OdataTypeBasicFormat = "#Microsoft.Media.JpgFormat" + // OdataTypeMicrosoftMediaMp4Format ... + OdataTypeMicrosoftMediaMp4Format OdataTypeBasicFormat = "#Microsoft.Media.Mp4Format" + // OdataTypeMicrosoftMediaMultiBitrateFormat ... + OdataTypeMicrosoftMediaMultiBitrateFormat OdataTypeBasicFormat = "#Microsoft.Media.MultiBitrateFormat" + // OdataTypeMicrosoftMediaPngFormat ... + OdataTypeMicrosoftMediaPngFormat OdataTypeBasicFormat = "#Microsoft.Media.PngFormat" + // OdataTypeMicrosoftMediaTransportStreamFormat ... + OdataTypeMicrosoftMediaTransportStreamFormat OdataTypeBasicFormat = "#Microsoft.Media.TransportStreamFormat" +) + +// PossibleOdataTypeBasicFormatValues returns an array of possible values for the OdataTypeBasicFormat const type. +func PossibleOdataTypeBasicFormatValues() []OdataTypeBasicFormat { + return []OdataTypeBasicFormat{OdataTypeFormat, OdataTypeMicrosoftMediaImageFormat, OdataTypeMicrosoftMediaJpgFormat, OdataTypeMicrosoftMediaMp4Format, OdataTypeMicrosoftMediaMultiBitrateFormat, OdataTypeMicrosoftMediaPngFormat, OdataTypeMicrosoftMediaTransportStreamFormat} +} + +// OdataTypeBasicJobInput enumerates the values for odata type basic job input. +type OdataTypeBasicJobInput string + +const ( + // OdataTypeJobInput ... + OdataTypeJobInput OdataTypeBasicJobInput = "JobInput" + // OdataTypeMicrosoftMediaJobInputAsset ... + OdataTypeMicrosoftMediaJobInputAsset OdataTypeBasicJobInput = "#Microsoft.Media.JobInputAsset" + // OdataTypeMicrosoftMediaJobInputClip ... + OdataTypeMicrosoftMediaJobInputClip OdataTypeBasicJobInput = "#Microsoft.Media.JobInputClip" + // OdataTypeMicrosoftMediaJobInputHTTP ... + OdataTypeMicrosoftMediaJobInputHTTP OdataTypeBasicJobInput = "#Microsoft.Media.JobInputHttp" + // OdataTypeMicrosoftMediaJobInputs ... + OdataTypeMicrosoftMediaJobInputs OdataTypeBasicJobInput = "#Microsoft.Media.JobInputs" +) + +// PossibleOdataTypeBasicJobInputValues returns an array of possible values for the OdataTypeBasicJobInput const type. +func PossibleOdataTypeBasicJobInputValues() []OdataTypeBasicJobInput { + return []OdataTypeBasicJobInput{OdataTypeJobInput, OdataTypeMicrosoftMediaJobInputAsset, OdataTypeMicrosoftMediaJobInputClip, OdataTypeMicrosoftMediaJobInputHTTP, OdataTypeMicrosoftMediaJobInputs} +} + +// OdataTypeBasicJobOutput enumerates the values for odata type basic job output. +type OdataTypeBasicJobOutput string + +const ( + // OdataTypeJobOutput ... + OdataTypeJobOutput OdataTypeBasicJobOutput = "JobOutput" + // OdataTypeMicrosoftMediaJobOutputAsset ... + OdataTypeMicrosoftMediaJobOutputAsset OdataTypeBasicJobOutput = "#Microsoft.Media.JobOutputAsset" +) + +// PossibleOdataTypeBasicJobOutputValues returns an array of possible values for the OdataTypeBasicJobOutput const type. +func PossibleOdataTypeBasicJobOutputValues() []OdataTypeBasicJobOutput { + return []OdataTypeBasicJobOutput{OdataTypeJobOutput, OdataTypeMicrosoftMediaJobOutputAsset} +} + +// OdataTypeBasicLayer enumerates the values for odata type basic layer. +type OdataTypeBasicLayer string + +const ( + // OdataTypeLayer ... + OdataTypeLayer OdataTypeBasicLayer = "Layer" + // OdataTypeMicrosoftMediaH264Layer ... + OdataTypeMicrosoftMediaH264Layer OdataTypeBasicLayer = "#Microsoft.Media.H264Layer" + // OdataTypeMicrosoftMediaJpgLayer ... + OdataTypeMicrosoftMediaJpgLayer OdataTypeBasicLayer = "#Microsoft.Media.JpgLayer" + // OdataTypeMicrosoftMediaPngLayer ... + OdataTypeMicrosoftMediaPngLayer OdataTypeBasicLayer = "#Microsoft.Media.PngLayer" + // OdataTypeMicrosoftMediaVideoLayer ... + OdataTypeMicrosoftMediaVideoLayer OdataTypeBasicLayer = "#Microsoft.Media.VideoLayer" +) + +// PossibleOdataTypeBasicLayerValues returns an array of possible values for the OdataTypeBasicLayer const type. +func PossibleOdataTypeBasicLayerValues() []OdataTypeBasicLayer { + return []OdataTypeBasicLayer{OdataTypeLayer, OdataTypeMicrosoftMediaH264Layer, OdataTypeMicrosoftMediaJpgLayer, OdataTypeMicrosoftMediaPngLayer, OdataTypeMicrosoftMediaVideoLayer} +} + +// OdataTypeBasicOverlay enumerates the values for odata type basic overlay. +type OdataTypeBasicOverlay string + +const ( + // OdataTypeMicrosoftMediaAudioOverlay ... + OdataTypeMicrosoftMediaAudioOverlay OdataTypeBasicOverlay = "#Microsoft.Media.AudioOverlay" + // OdataTypeMicrosoftMediaVideoOverlay ... + OdataTypeMicrosoftMediaVideoOverlay OdataTypeBasicOverlay = "#Microsoft.Media.VideoOverlay" + // OdataTypeOverlay ... + OdataTypeOverlay OdataTypeBasicOverlay = "Overlay" +) + +// PossibleOdataTypeBasicOverlayValues returns an array of possible values for the OdataTypeBasicOverlay const type. +func PossibleOdataTypeBasicOverlayValues() []OdataTypeBasicOverlay { + return []OdataTypeBasicOverlay{OdataTypeMicrosoftMediaAudioOverlay, OdataTypeMicrosoftMediaVideoOverlay, OdataTypeOverlay} +} + +// OdataTypeBasicPreset enumerates the values for odata type basic preset. +type OdataTypeBasicPreset string + +const ( + // OdataTypeMicrosoftMediaAudioAnalyzerPreset ... + OdataTypeMicrosoftMediaAudioAnalyzerPreset OdataTypeBasicPreset = "#Microsoft.Media.AudioAnalyzerPreset" + // OdataTypeMicrosoftMediaBuiltInStandardEncoderPreset ... + OdataTypeMicrosoftMediaBuiltInStandardEncoderPreset OdataTypeBasicPreset = "#Microsoft.Media.BuiltInStandardEncoderPreset" + // OdataTypeMicrosoftMediaStandardEncoderPreset ... + OdataTypeMicrosoftMediaStandardEncoderPreset OdataTypeBasicPreset = "#Microsoft.Media.StandardEncoderPreset" + // OdataTypeMicrosoftMediaVideoAnalyzerPreset ... + OdataTypeMicrosoftMediaVideoAnalyzerPreset OdataTypeBasicPreset = "#Microsoft.Media.VideoAnalyzerPreset" + // OdataTypePreset ... + OdataTypePreset OdataTypeBasicPreset = "Preset" +) + +// PossibleOdataTypeBasicPresetValues returns an array of possible values for the OdataTypeBasicPreset const type. +func PossibleOdataTypeBasicPresetValues() []OdataTypeBasicPreset { + return []OdataTypeBasicPreset{OdataTypeMicrosoftMediaAudioAnalyzerPreset, OdataTypeMicrosoftMediaBuiltInStandardEncoderPreset, OdataTypeMicrosoftMediaStandardEncoderPreset, OdataTypeMicrosoftMediaVideoAnalyzerPreset, OdataTypePreset} +} + +// OnErrorType enumerates the values for on error type. +type OnErrorType string + +const ( + // ContinueJob Tells the service that if this TransformOutput fails, then allow any other TransformOutput + // to continue. + ContinueJob OnErrorType = "ContinueJob" + // StopProcessingJob Tells the service that if this TransformOutput fails, then any other incomplete + // TransformOutputs can be stopped. + StopProcessingJob OnErrorType = "StopProcessingJob" +) + +// PossibleOnErrorTypeValues returns an array of possible values for the OnErrorType const type. +func PossibleOnErrorTypeValues() []OnErrorType { + return []OnErrorType{ContinueJob, StopProcessingJob} +} + +// Priority enumerates the values for priority. +type Priority string + +const ( + // High Used for TransformOutputs that should take precedence over others. + High Priority = "High" + // Low Used for TransformOutputs that can be generated after Normal and High priority TransformOutputs. + Low Priority = "Low" + // Normal Used for TransformOutputs that can be generated at Normal priority. + Normal Priority = "Normal" +) + +// PossiblePriorityValues returns an array of possible values for the Priority const type. +func PossiblePriorityValues() []Priority { + return []Priority{High, Low, Normal} +} + +// Rotation enumerates the values for rotation. +type Rotation string + +const ( + // RotationAuto Automatically detect and rotate as needed. + RotationAuto Rotation = "Auto" + // RotationNone Do not rotate the video. If the output format supports it, any metadata about rotation is + // kept intact. + RotationNone Rotation = "None" + // RotationRotate0 Do not rotate the video but remove any metadata about the rotation. + RotationRotate0 Rotation = "Rotate0" + // RotationRotate180 Rotate 180 degrees clockwise. + RotationRotate180 Rotation = "Rotate180" + // RotationRotate270 Rotate 270 degrees clockwise. + RotationRotate270 Rotation = "Rotate270" + // RotationRotate90 Rotate 90 degrees clockwise. + RotationRotate90 Rotation = "Rotate90" +) + +// PossibleRotationValues returns an array of possible values for the Rotation const type. +func PossibleRotationValues() []Rotation { + return []Rotation{RotationAuto, RotationNone, RotationRotate0, RotationRotate180, RotationRotate270, RotationRotate90} +} + +// StorageAccountType enumerates the values for storage account type. +type StorageAccountType string + +const ( + // Primary The primary storage account for the Media Services account. + Primary StorageAccountType = "Primary" + // Secondary A secondary storage account for the Media Services account. + Secondary StorageAccountType = "Secondary" +) + +// PossibleStorageAccountTypeValues returns an array of possible values for the StorageAccountType const type. +func PossibleStorageAccountTypeValues() []StorageAccountType { + return []StorageAccountType{Primary, Secondary} +} + +// StreamingEndpointResourceState enumerates the values for streaming endpoint resource state. +type StreamingEndpointResourceState string + +const ( + // StreamingEndpointResourceStateDeleting ... + StreamingEndpointResourceStateDeleting StreamingEndpointResourceState = "Deleting" + // StreamingEndpointResourceStateRunning ... + StreamingEndpointResourceStateRunning StreamingEndpointResourceState = "Running" + // StreamingEndpointResourceStateScaling ... + StreamingEndpointResourceStateScaling StreamingEndpointResourceState = "Scaling" + // StreamingEndpointResourceStateStarting ... + StreamingEndpointResourceStateStarting StreamingEndpointResourceState = "Starting" + // StreamingEndpointResourceStateStopped ... + StreamingEndpointResourceStateStopped StreamingEndpointResourceState = "Stopped" + // StreamingEndpointResourceStateStopping ... + StreamingEndpointResourceStateStopping StreamingEndpointResourceState = "Stopping" +) + +// PossibleStreamingEndpointResourceStateValues returns an array of possible values for the StreamingEndpointResourceState const type. +func PossibleStreamingEndpointResourceStateValues() []StreamingEndpointResourceState { + return []StreamingEndpointResourceState{StreamingEndpointResourceStateDeleting, StreamingEndpointResourceStateRunning, StreamingEndpointResourceStateScaling, StreamingEndpointResourceStateStarting, StreamingEndpointResourceStateStopped, StreamingEndpointResourceStateStopping} +} + +// StreamingLocatorContentKeyType enumerates the values for streaming locator content key type. +type StreamingLocatorContentKeyType string + +const ( + // StreamingLocatorContentKeyTypeCommonEncryptionCbcs Common Encryption using CBCS + StreamingLocatorContentKeyTypeCommonEncryptionCbcs StreamingLocatorContentKeyType = "CommonEncryptionCbcs" + // StreamingLocatorContentKeyTypeCommonEncryptionCenc Common Encryption using CENC + StreamingLocatorContentKeyTypeCommonEncryptionCenc StreamingLocatorContentKeyType = "CommonEncryptionCenc" + // StreamingLocatorContentKeyTypeEnvelopeEncryption Envelope Encryption + StreamingLocatorContentKeyTypeEnvelopeEncryption StreamingLocatorContentKeyType = "EnvelopeEncryption" +) + +// PossibleStreamingLocatorContentKeyTypeValues returns an array of possible values for the StreamingLocatorContentKeyType const type. +func PossibleStreamingLocatorContentKeyTypeValues() []StreamingLocatorContentKeyType { + return []StreamingLocatorContentKeyType{StreamingLocatorContentKeyTypeCommonEncryptionCbcs, StreamingLocatorContentKeyTypeCommonEncryptionCenc, StreamingLocatorContentKeyTypeEnvelopeEncryption} +} + +// StreamingPolicyStreamingProtocol enumerates the values for streaming policy streaming protocol. +type StreamingPolicyStreamingProtocol string + +const ( + // StreamingPolicyStreamingProtocolDash DASH protocol + StreamingPolicyStreamingProtocolDash StreamingPolicyStreamingProtocol = "Dash" + // StreamingPolicyStreamingProtocolDownload Download protocol + StreamingPolicyStreamingProtocolDownload StreamingPolicyStreamingProtocol = "Download" + // StreamingPolicyStreamingProtocolHls HLS protocol + StreamingPolicyStreamingProtocolHls StreamingPolicyStreamingProtocol = "Hls" + // StreamingPolicyStreamingProtocolSmoothStreaming SmoothStreaming protocol + StreamingPolicyStreamingProtocolSmoothStreaming StreamingPolicyStreamingProtocol = "SmoothStreaming" +) + +// PossibleStreamingPolicyStreamingProtocolValues returns an array of possible values for the StreamingPolicyStreamingProtocol const type. +func PossibleStreamingPolicyStreamingProtocolValues() []StreamingPolicyStreamingProtocol { + return []StreamingPolicyStreamingProtocol{StreamingPolicyStreamingProtocolDash, StreamingPolicyStreamingProtocolDownload, StreamingPolicyStreamingProtocolHls, StreamingPolicyStreamingProtocolSmoothStreaming} +} + +// StreamOptionsFlag enumerates the values for stream options flag. +type StreamOptionsFlag string + +const ( + // Default ... + Default StreamOptionsFlag = "Default" + // LowLatency ... + LowLatency StreamOptionsFlag = "LowLatency" +) + +// PossibleStreamOptionsFlagValues returns an array of possible values for the StreamOptionsFlag const type. +func PossibleStreamOptionsFlagValues() []StreamOptionsFlag { + return []StreamOptionsFlag{Default, LowLatency} +} + +// StretchMode enumerates the values for stretch mode. +type StretchMode string + +const ( + // StretchModeAutoFit Pad the output (with either letterbox or pillar box) to honor the output resolution, + // while ensuring that the active video region in the output has the same aspect ratio as the input. For + // example, if the input is 1920x1080 and the encoding preset asks for 1280x1280, then the output will be + // at 1280x1280, which contains an inner rectangle of 1280x720 at aspect ratio of 16:9, and pillar box + // regions 280 pixels wide at the left and right. + StretchModeAutoFit StretchMode = "AutoFit" + // StretchModeAutoSize Override the output resolution, and change it to match the display aspect ratio of + // the input, without padding. For example, if the input is 1920x1080 and the encoding preset asks for + // 1280x1280, then the value in the preset is overridden, and the output will be at 1280x720, which + // maintains the input aspect ratio of 16:9. + StretchModeAutoSize StretchMode = "AutoSize" + // StretchModeNone Strictly respect the output resolution without considering the pixel aspect ratio or + // display aspect ratio of the input video. + StretchModeNone StretchMode = "None" +) + +// PossibleStretchModeValues returns an array of possible values for the StretchMode const type. +func PossibleStretchModeValues() []StretchMode { + return []StretchMode{StretchModeAutoFit, StretchModeAutoSize, StretchModeNone} +} + +// TrackPropertyCompareOperation enumerates the values for track property compare operation. +type TrackPropertyCompareOperation string + +const ( + // TrackPropertyCompareOperationEqual Equal operation + TrackPropertyCompareOperationEqual TrackPropertyCompareOperation = "Equal" + // TrackPropertyCompareOperationUnknown Unknown track property compare operation + TrackPropertyCompareOperationUnknown TrackPropertyCompareOperation = "Unknown" +) + +// PossibleTrackPropertyCompareOperationValues returns an array of possible values for the TrackPropertyCompareOperation const type. +func PossibleTrackPropertyCompareOperationValues() []TrackPropertyCompareOperation { + return []TrackPropertyCompareOperation{TrackPropertyCompareOperationEqual, TrackPropertyCompareOperationUnknown} +} + +// TrackPropertyType enumerates the values for track property type. +type TrackPropertyType string + +const ( + // TrackPropertyTypeFourCC Track FourCC + TrackPropertyTypeFourCC TrackPropertyType = "FourCC" + // TrackPropertyTypeUnknown Unknown track property + TrackPropertyTypeUnknown TrackPropertyType = "Unknown" +) + +// PossibleTrackPropertyTypeValues returns an array of possible values for the TrackPropertyType const type. +func PossibleTrackPropertyTypeValues() []TrackPropertyType { + return []TrackPropertyType{TrackPropertyTypeFourCC, TrackPropertyTypeUnknown} +} + +// AacAudio describes Advanced Audio Codec (AAC) audio encoding settings. +type AacAudio struct { + // Profile - The encoding profile to be used when encoding audio with AAC. Possible values include: 'AacLc', 'HeAacV1', 'HeAacV2' + Profile AacAudioProfile `json:"profile,omitempty"` + // Channels - The number of channels in the audio. + Channels *int32 `json:"channels,omitempty"` + // SamplingRate - The sampling rate to use for encoding in hertz. + SamplingRate *int32 `json:"samplingRate,omitempty"` + // Bitrate - The bitrate, in bits per second, of the output encoded audio. + Bitrate *int32 `json:"bitrate,omitempty"` + // Label - An optional label for the codec. The label can be used to control muxing behavior. + Label *string `json:"label,omitempty"` + // OdataType - Possible values include: 'OdataTypeCodec', 'OdataTypeMicrosoftMediaAudio', 'OdataTypeMicrosoftMediaAacAudio', 'OdataTypeMicrosoftMediaCopyVideo', 'OdataTypeMicrosoftMediaVideo', 'OdataTypeMicrosoftMediaImage', 'OdataTypeMicrosoftMediaCopyAudio', 'OdataTypeMicrosoftMediaH264Video', 'OdataTypeMicrosoftMediaJpgImage', 'OdataTypeMicrosoftMediaPngImage' + OdataType OdataTypeBasicCodec `json:"@odata.type,omitempty"` +} + +// MarshalJSON is the custom marshaler for AacAudio. +func (aa AacAudio) MarshalJSON() ([]byte, error) { + aa.OdataType = OdataTypeMicrosoftMediaAacAudio + objectMap := make(map[string]interface{}) + if aa.Profile != "" { + objectMap["profile"] = aa.Profile + } + if aa.Channels != nil { + objectMap["channels"] = aa.Channels + } + if aa.SamplingRate != nil { + objectMap["samplingRate"] = aa.SamplingRate + } + if aa.Bitrate != nil { + objectMap["bitrate"] = aa.Bitrate + } + if aa.Label != nil { + objectMap["label"] = aa.Label + } + if aa.OdataType != "" { + objectMap["@odata.type"] = aa.OdataType + } + return json.Marshal(objectMap) +} + +// AsAudio is the BasicCodec implementation for AacAudio. +func (aa AacAudio) AsAudio() (*Audio, bool) { + return nil, false +} + +// AsBasicAudio is the BasicCodec implementation for AacAudio. +func (aa AacAudio) AsBasicAudio() (BasicAudio, bool) { + return &aa, true +} + +// AsAacAudio is the BasicCodec implementation for AacAudio. +func (aa AacAudio) AsAacAudio() (*AacAudio, bool) { + return &aa, true +} + +// AsCopyVideo is the BasicCodec implementation for AacAudio. +func (aa AacAudio) AsCopyVideo() (*CopyVideo, bool) { + return nil, false +} + +// AsVideo is the BasicCodec implementation for AacAudio. +func (aa AacAudio) AsVideo() (*Video, bool) { + return nil, false +} + +// AsBasicVideo is the BasicCodec implementation for AacAudio. +func (aa AacAudio) AsBasicVideo() (BasicVideo, bool) { + return nil, false +} + +// AsImage is the BasicCodec implementation for AacAudio. +func (aa AacAudio) AsImage() (*Image, bool) { + return nil, false +} + +// AsBasicImage is the BasicCodec implementation for AacAudio. +func (aa AacAudio) AsBasicImage() (BasicImage, bool) { + return nil, false +} + +// AsCopyAudio is the BasicCodec implementation for AacAudio. +func (aa AacAudio) AsCopyAudio() (*CopyAudio, bool) { + return nil, false +} + +// AsH264Video is the BasicCodec implementation for AacAudio. +func (aa AacAudio) AsH264Video() (*H264Video, bool) { + return nil, false +} + +// AsJpgImage is the BasicCodec implementation for AacAudio. +func (aa AacAudio) AsJpgImage() (*JpgImage, bool) { + return nil, false +} + +// AsPngImage is the BasicCodec implementation for AacAudio. +func (aa AacAudio) AsPngImage() (*PngImage, bool) { + return nil, false +} + +// AsCodec is the BasicCodec implementation for AacAudio. +func (aa AacAudio) AsCodec() (*Codec, bool) { + return nil, false +} + +// AsBasicCodec is the BasicCodec implementation for AacAudio. +func (aa AacAudio) AsBasicCodec() (BasicCodec, bool) { + return &aa, true +} + +// AkamaiAccessControl akamai access control +type AkamaiAccessControl struct { + // AkamaiSignatureHeaderAuthenticationKeyList - authentication key list + AkamaiSignatureHeaderAuthenticationKeyList *[]AkamaiSignatureHeaderAuthenticationKey `json:"akamaiSignatureHeaderAuthenticationKeyList,omitempty"` +} + +// AkamaiSignatureHeaderAuthenticationKey akamai Signature Header authentication key. +type AkamaiSignatureHeaderAuthenticationKey struct { + // Identifier - identifier of the key + Identifier *string `json:"identifier,omitempty"` + // Base64Key - authentication key + Base64Key *string `json:"base64Key,omitempty"` + // Expiration - The exact time the authentication key. + Expiration *date.Time `json:"expiration,omitempty"` +} + +// APIError the API error. +type APIError struct { + // Error - The error properties. + Error *ODataError `json:"error,omitempty"` +} + +// Asset an Asset. +type Asset struct { + autorest.Response `json:"-"` + // AssetProperties - The resource properties. + *AssetProperties `json:"properties,omitempty"` + // ID - Fully qualified resource ID for the resource. + ID *string `json:"id,omitempty"` + // Name - The name of the resource. + Name *string `json:"name,omitempty"` + // Type - The type of the resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Asset. +func (a Asset) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if a.AssetProperties != nil { + objectMap["properties"] = a.AssetProperties + } + if a.ID != nil { + objectMap["id"] = a.ID + } + if a.Name != nil { + objectMap["name"] = a.Name + } + if a.Type != nil { + objectMap["type"] = a.Type + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Asset struct. +func (a *Asset) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var assetProperties AssetProperties + err = json.Unmarshal(*v, &assetProperties) + if err != nil { + return err + } + a.AssetProperties = &assetProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + a.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + a.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + a.Type = &typeVar + } + } + } + + return nil +} + +// AssetCollection a collection of Asset items. +type AssetCollection struct { + autorest.Response `json:"-"` + // Value - A collection of Asset items. + Value *[]Asset `json:"value,omitempty"` + // OdataNextLink - A link to the next page of the collection (when the collection contains too many results to return in one response). + OdataNextLink *string `json:"@odata.nextLink,omitempty"` +} + +// AssetCollectionIterator provides access to a complete listing of Asset values. +type AssetCollectionIterator struct { + i int + page AssetCollectionPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *AssetCollectionIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter AssetCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter AssetCollectionIterator) Response() AssetCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter AssetCollectionIterator) Value() Asset { + if !iter.page.NotDone() { + return Asset{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (ac AssetCollection) IsEmpty() bool { + return ac.Value == nil || len(*ac.Value) == 0 +} + +// assetCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (ac AssetCollection) assetCollectionPreparer() (*http.Request, error) { + if ac.OdataNextLink == nil || len(to.String(ac.OdataNextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(ac.OdataNextLink))) +} + +// AssetCollectionPage contains a page of Asset values. +type AssetCollectionPage struct { + fn func(AssetCollection) (AssetCollection, error) + ac AssetCollection +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *AssetCollectionPage) Next() error { + next, err := page.fn(page.ac) + if err != nil { + return err + } + page.ac = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page AssetCollectionPage) NotDone() bool { + return !page.ac.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page AssetCollectionPage) Response() AssetCollection { + return page.ac +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page AssetCollectionPage) Values() []Asset { + if page.ac.IsEmpty() { + return nil + } + return *page.ac.Value +} + +// AssetContainerSas the Asset Storage container SAS URLs. +type AssetContainerSas struct { + autorest.Response `json:"-"` + // AssetContainerSasUrls - The list of Asset container SAS URLs. + AssetContainerSasUrls *[]string `json:"assetContainerSasUrls,omitempty"` +} + +// AssetProperties the Asset properties. +type AssetProperties struct { + // AssetID - The Asset ID. + AssetID *uuid.UUID `json:"assetId,omitempty"` + // Created - The creation date of the Asset. + Created *date.Time `json:"created,omitempty"` + // LastModified - The last modified date of the Asset. + LastModified *date.Time `json:"lastModified,omitempty"` + // AlternateID - The alternate ID of the Asset. + AlternateID *string `json:"alternateId,omitempty"` + // Description - The Asset description. + Description *string `json:"description,omitempty"` + // Container - The name of the asset blob container. + Container *string `json:"container,omitempty"` + // StorageAccountName - The name of the storage account. + StorageAccountName *string `json:"storageAccountName,omitempty"` + // StorageEncryptionFormat - The Asset encryption format. One of None or MediaStorageEncryption. Possible values include: 'None', 'MediaStorageClientEncryption' + StorageEncryptionFormat AssetStorageEncryptionFormat `json:"storageEncryptionFormat,omitempty"` +} + +// AssetStorageEncryptionKey the Asset Storage encryption key. +type AssetStorageEncryptionKey struct { + autorest.Response `json:"-"` + // StorageEncryptionKey - The Asset storage encryption key. + StorageEncryptionKey *string `json:"storageEncryptionKey,omitempty"` +} + +// BasicAudio defines the common properties for all audio codecs. +type BasicAudio interface { + AsAacAudio() (*AacAudio, bool) + AsAudio() (*Audio, bool) +} + +// Audio defines the common properties for all audio codecs. +type Audio struct { + // Channels - The number of channels in the audio. + Channels *int32 `json:"channels,omitempty"` + // SamplingRate - The sampling rate to use for encoding in hertz. + SamplingRate *int32 `json:"samplingRate,omitempty"` + // Bitrate - The bitrate, in bits per second, of the output encoded audio. + Bitrate *int32 `json:"bitrate,omitempty"` + // Label - An optional label for the codec. The label can be used to control muxing behavior. + Label *string `json:"label,omitempty"` + // OdataType - Possible values include: 'OdataTypeCodec', 'OdataTypeMicrosoftMediaAudio', 'OdataTypeMicrosoftMediaAacAudio', 'OdataTypeMicrosoftMediaCopyVideo', 'OdataTypeMicrosoftMediaVideo', 'OdataTypeMicrosoftMediaImage', 'OdataTypeMicrosoftMediaCopyAudio', 'OdataTypeMicrosoftMediaH264Video', 'OdataTypeMicrosoftMediaJpgImage', 'OdataTypeMicrosoftMediaPngImage' + OdataType OdataTypeBasicCodec `json:"@odata.type,omitempty"` +} + +func unmarshalBasicAudio(body []byte) (BasicAudio, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["@odata.type"] { + case string(OdataTypeMicrosoftMediaAacAudio): + var aa AacAudio + err := json.Unmarshal(body, &aa) + return aa, err + default: + var a Audio + err := json.Unmarshal(body, &a) + return a, err + } +} +func unmarshalBasicAudioArray(body []byte) ([]BasicAudio, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + aArray := make([]BasicAudio, len(rawMessages)) + + for index, rawMessage := range rawMessages { + a, err := unmarshalBasicAudio(*rawMessage) + if err != nil { + return nil, err + } + aArray[index] = a + } + return aArray, nil +} + +// MarshalJSON is the custom marshaler for Audio. +func (a Audio) MarshalJSON() ([]byte, error) { + a.OdataType = OdataTypeMicrosoftMediaAudio + objectMap := make(map[string]interface{}) + if a.Channels != nil { + objectMap["channels"] = a.Channels + } + if a.SamplingRate != nil { + objectMap["samplingRate"] = a.SamplingRate + } + if a.Bitrate != nil { + objectMap["bitrate"] = a.Bitrate + } + if a.Label != nil { + objectMap["label"] = a.Label + } + if a.OdataType != "" { + objectMap["@odata.type"] = a.OdataType + } + return json.Marshal(objectMap) +} + +// AsAudio is the BasicCodec implementation for Audio. +func (a Audio) AsAudio() (*Audio, bool) { + return &a, true +} + +// AsBasicAudio is the BasicCodec implementation for Audio. +func (a Audio) AsBasicAudio() (BasicAudio, bool) { + return &a, true +} + +// AsAacAudio is the BasicCodec implementation for Audio. +func (a Audio) AsAacAudio() (*AacAudio, bool) { + return nil, false +} + +// AsCopyVideo is the BasicCodec implementation for Audio. +func (a Audio) AsCopyVideo() (*CopyVideo, bool) { + return nil, false +} + +// AsVideo is the BasicCodec implementation for Audio. +func (a Audio) AsVideo() (*Video, bool) { + return nil, false +} + +// AsBasicVideo is the BasicCodec implementation for Audio. +func (a Audio) AsBasicVideo() (BasicVideo, bool) { + return nil, false +} + +// AsImage is the BasicCodec implementation for Audio. +func (a Audio) AsImage() (*Image, bool) { + return nil, false +} + +// AsBasicImage is the BasicCodec implementation for Audio. +func (a Audio) AsBasicImage() (BasicImage, bool) { + return nil, false +} + +// AsCopyAudio is the BasicCodec implementation for Audio. +func (a Audio) AsCopyAudio() (*CopyAudio, bool) { + return nil, false +} + +// AsH264Video is the BasicCodec implementation for Audio. +func (a Audio) AsH264Video() (*H264Video, bool) { + return nil, false +} + +// AsJpgImage is the BasicCodec implementation for Audio. +func (a Audio) AsJpgImage() (*JpgImage, bool) { + return nil, false +} + +// AsPngImage is the BasicCodec implementation for Audio. +func (a Audio) AsPngImage() (*PngImage, bool) { + return nil, false +} + +// AsCodec is the BasicCodec implementation for Audio. +func (a Audio) AsCodec() (*Codec, bool) { + return nil, false +} + +// AsBasicCodec is the BasicCodec implementation for Audio. +func (a Audio) AsBasicCodec() (BasicCodec, bool) { + return &a, true +} + +// BasicAudioAnalyzerPreset the Audio Analyzer preset applies a pre-defined set of AI-based analysis operations, +// including speech transcription. Currently, the preset supports processing of content with a single audio track. +type BasicAudioAnalyzerPreset interface { + AsVideoAnalyzerPreset() (*VideoAnalyzerPreset, bool) + AsAudioAnalyzerPreset() (*AudioAnalyzerPreset, bool) +} + +// AudioAnalyzerPreset the Audio Analyzer preset applies a pre-defined set of AI-based analysis operations, +// including speech transcription. Currently, the preset supports processing of content with a single audio track. +type AudioAnalyzerPreset struct { + // AudioLanguage - The language for the audio payload in the input using the BCP-47 format of 'language tag-region' (e.g: 'en-US'). The list of supported languages are, 'en-US', 'en-GB', 'es-ES', 'es-MX', 'fr-FR', 'it-IT', 'ja-JP', 'pt-BR', 'zh-CN'. + AudioLanguage *string `json:"audioLanguage,omitempty"` + // OdataType - Possible values include: 'OdataTypePreset', 'OdataTypeMicrosoftMediaAudioAnalyzerPreset', 'OdataTypeMicrosoftMediaBuiltInStandardEncoderPreset', 'OdataTypeMicrosoftMediaStandardEncoderPreset', 'OdataTypeMicrosoftMediaVideoAnalyzerPreset' + OdataType OdataTypeBasicPreset `json:"@odata.type,omitempty"` +} + +func unmarshalBasicAudioAnalyzerPreset(body []byte) (BasicAudioAnalyzerPreset, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["@odata.type"] { + case string(OdataTypeMicrosoftMediaVideoAnalyzerPreset): + var vap VideoAnalyzerPreset + err := json.Unmarshal(body, &vap) + return vap, err + default: + var aap AudioAnalyzerPreset + err := json.Unmarshal(body, &aap) + return aap, err + } +} +func unmarshalBasicAudioAnalyzerPresetArray(body []byte) ([]BasicAudioAnalyzerPreset, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + aapArray := make([]BasicAudioAnalyzerPreset, len(rawMessages)) + + for index, rawMessage := range rawMessages { + aap, err := unmarshalBasicAudioAnalyzerPreset(*rawMessage) + if err != nil { + return nil, err + } + aapArray[index] = aap + } + return aapArray, nil +} + +// MarshalJSON is the custom marshaler for AudioAnalyzerPreset. +func (aap AudioAnalyzerPreset) MarshalJSON() ([]byte, error) { + aap.OdataType = OdataTypeMicrosoftMediaAudioAnalyzerPreset + objectMap := make(map[string]interface{}) + if aap.AudioLanguage != nil { + objectMap["audioLanguage"] = aap.AudioLanguage + } + if aap.OdataType != "" { + objectMap["@odata.type"] = aap.OdataType + } + return json.Marshal(objectMap) +} + +// AsAudioAnalyzerPreset is the BasicPreset implementation for AudioAnalyzerPreset. +func (aap AudioAnalyzerPreset) AsAudioAnalyzerPreset() (*AudioAnalyzerPreset, bool) { + return &aap, true +} + +// AsBasicAudioAnalyzerPreset is the BasicPreset implementation for AudioAnalyzerPreset. +func (aap AudioAnalyzerPreset) AsBasicAudioAnalyzerPreset() (BasicAudioAnalyzerPreset, bool) { + return &aap, true +} + +// AsBuiltInStandardEncoderPreset is the BasicPreset implementation for AudioAnalyzerPreset. +func (aap AudioAnalyzerPreset) AsBuiltInStandardEncoderPreset() (*BuiltInStandardEncoderPreset, bool) { + return nil, false +} + +// AsStandardEncoderPreset is the BasicPreset implementation for AudioAnalyzerPreset. +func (aap AudioAnalyzerPreset) AsStandardEncoderPreset() (*StandardEncoderPreset, bool) { + return nil, false +} + +// AsVideoAnalyzerPreset is the BasicPreset implementation for AudioAnalyzerPreset. +func (aap AudioAnalyzerPreset) AsVideoAnalyzerPreset() (*VideoAnalyzerPreset, bool) { + return nil, false +} + +// AsPreset is the BasicPreset implementation for AudioAnalyzerPreset. +func (aap AudioAnalyzerPreset) AsPreset() (*Preset, bool) { + return nil, false +} + +// AsBasicPreset is the BasicPreset implementation for AudioAnalyzerPreset. +func (aap AudioAnalyzerPreset) AsBasicPreset() (BasicPreset, bool) { + return &aap, true +} + +// AudioOverlay describes the properties of an audio overlay. +type AudioOverlay struct { + // InputLabel - The label of the job input which is to be used as an overlay. The Input must specify exactly one file. You can specify an image file in JPG or PNG formats, or an audio file (such as a WAV, MP3, WMA or M4A file), or a video file. See https://aka.ms/mesformats for the complete list of supported audio and video file formats. + InputLabel *string `json:"inputLabel,omitempty"` + // Start - The start position, with reference to the input video, at which the overlay starts. The value should be in ISO 8601 format. For example, PT05S to start the overlay at 5 seconds in to the input video. If not specified the overlay starts from the beginning of the input video. + Start *string `json:"start,omitempty"` + // End - The position in the input video at which the overlay ends. The value should be in ISO 8601 duration format. For example, PT30S to end the overlay at 30 seconds in to the input video. If not specified the overlay will be applied until the end of the input video if inputLoop is true. Else, if inputLoop is false, then overlay will last as long as the duration of the overlay media. + End *string `json:"end,omitempty"` + // FadeInDuration - The duration over which the overlay fades in onto the input video. The value should be in ISO 8601 duration format. If not specified the default behavior is to have no fade in (same as PT0S). + FadeInDuration *string `json:"fadeInDuration,omitempty"` + // FadeOutDuration - The duration over which the overlay fades out of the input video. The value should be in ISO 8601 duration format. If not specified the default behavior is to have no fade out (same as PT0S). + FadeOutDuration *string `json:"fadeOutDuration,omitempty"` + // AudioGainLevel - The gain level of audio in the overlay. The value should be in the range [0, 1.0]. The default is 1.0. + AudioGainLevel *float64 `json:"audioGainLevel,omitempty"` + // OdataType - Possible values include: 'OdataTypeOverlay', 'OdataTypeMicrosoftMediaAudioOverlay', 'OdataTypeMicrosoftMediaVideoOverlay' + OdataType OdataTypeBasicOverlay `json:"@odata.type,omitempty"` +} + +// MarshalJSON is the custom marshaler for AudioOverlay. +func (ao AudioOverlay) MarshalJSON() ([]byte, error) { + ao.OdataType = OdataTypeMicrosoftMediaAudioOverlay + objectMap := make(map[string]interface{}) + if ao.InputLabel != nil { + objectMap["inputLabel"] = ao.InputLabel + } + if ao.Start != nil { + objectMap["start"] = ao.Start + } + if ao.End != nil { + objectMap["end"] = ao.End + } + if ao.FadeInDuration != nil { + objectMap["fadeInDuration"] = ao.FadeInDuration + } + if ao.FadeOutDuration != nil { + objectMap["fadeOutDuration"] = ao.FadeOutDuration + } + if ao.AudioGainLevel != nil { + objectMap["audioGainLevel"] = ao.AudioGainLevel + } + if ao.OdataType != "" { + objectMap["@odata.type"] = ao.OdataType + } + return json.Marshal(objectMap) +} + +// AsAudioOverlay is the BasicOverlay implementation for AudioOverlay. +func (ao AudioOverlay) AsAudioOverlay() (*AudioOverlay, bool) { + return &ao, true +} + +// AsVideoOverlay is the BasicOverlay implementation for AudioOverlay. +func (ao AudioOverlay) AsVideoOverlay() (*VideoOverlay, bool) { + return nil, false +} + +// AsOverlay is the BasicOverlay implementation for AudioOverlay. +func (ao AudioOverlay) AsOverlay() (*Overlay, bool) { + return nil, false +} + +// AsBasicOverlay is the BasicOverlay implementation for AudioOverlay. +func (ao AudioOverlay) AsBasicOverlay() (BasicOverlay, bool) { + return &ao, true +} + +// BuiltInStandardEncoderPreset describes a built-in preset for encoding the input video with the Standard Encoder. +type BuiltInStandardEncoderPreset struct { + // PresetName - The built-in preset to be used for encoding videos. Possible values include: 'AdaptiveStreaming', 'AACGoodQualityAudio', 'H264MultipleBitrate1080p', 'H264MultipleBitrate720p', 'H264MultipleBitrateSD' + PresetName EncoderNamedPreset `json:"presetName,omitempty"` + // OdataType - Possible values include: 'OdataTypePreset', 'OdataTypeMicrosoftMediaAudioAnalyzerPreset', 'OdataTypeMicrosoftMediaBuiltInStandardEncoderPreset', 'OdataTypeMicrosoftMediaStandardEncoderPreset', 'OdataTypeMicrosoftMediaVideoAnalyzerPreset' + OdataType OdataTypeBasicPreset `json:"@odata.type,omitempty"` +} + +// MarshalJSON is the custom marshaler for BuiltInStandardEncoderPreset. +func (bisep BuiltInStandardEncoderPreset) MarshalJSON() ([]byte, error) { + bisep.OdataType = OdataTypeMicrosoftMediaBuiltInStandardEncoderPreset + objectMap := make(map[string]interface{}) + if bisep.PresetName != "" { + objectMap["presetName"] = bisep.PresetName + } + if bisep.OdataType != "" { + objectMap["@odata.type"] = bisep.OdataType + } + return json.Marshal(objectMap) +} + +// AsAudioAnalyzerPreset is the BasicPreset implementation for BuiltInStandardEncoderPreset. +func (bisep BuiltInStandardEncoderPreset) AsAudioAnalyzerPreset() (*AudioAnalyzerPreset, bool) { + return nil, false +} + +// AsBasicAudioAnalyzerPreset is the BasicPreset implementation for BuiltInStandardEncoderPreset. +func (bisep BuiltInStandardEncoderPreset) AsBasicAudioAnalyzerPreset() (BasicAudioAnalyzerPreset, bool) { + return nil, false +} + +// AsBuiltInStandardEncoderPreset is the BasicPreset implementation for BuiltInStandardEncoderPreset. +func (bisep BuiltInStandardEncoderPreset) AsBuiltInStandardEncoderPreset() (*BuiltInStandardEncoderPreset, bool) { + return &bisep, true +} + +// AsStandardEncoderPreset is the BasicPreset implementation for BuiltInStandardEncoderPreset. +func (bisep BuiltInStandardEncoderPreset) AsStandardEncoderPreset() (*StandardEncoderPreset, bool) { + return nil, false +} + +// AsVideoAnalyzerPreset is the BasicPreset implementation for BuiltInStandardEncoderPreset. +func (bisep BuiltInStandardEncoderPreset) AsVideoAnalyzerPreset() (*VideoAnalyzerPreset, bool) { + return nil, false +} + +// AsPreset is the BasicPreset implementation for BuiltInStandardEncoderPreset. +func (bisep BuiltInStandardEncoderPreset) AsPreset() (*Preset, bool) { + return nil, false +} + +// AsBasicPreset is the BasicPreset implementation for BuiltInStandardEncoderPreset. +func (bisep BuiltInStandardEncoderPreset) AsBasicPreset() (BasicPreset, bool) { + return &bisep, true +} + +// CbcsDrmConfiguration class to specify DRM configurations of CommonEncryptionCbcs scheme in Streaming Policy +type CbcsDrmConfiguration struct { + // FairPlay - FairPlay configurations + FairPlay *StreamingPolicyFairPlayConfiguration `json:"fairPlay,omitempty"` + // PlayReady - PlayReady configurations + PlayReady *StreamingPolicyPlayReadyConfiguration `json:"playReady,omitempty"` + // Widevine - Widevine configurations + Widevine *StreamingPolicyWidevineConfiguration `json:"widevine,omitempty"` +} + +// CencDrmConfiguration class to specify DRM configurations of CommonEncryptionCenc scheme in Streaming Policy +type CencDrmConfiguration struct { + // PlayReady - PlayReady configurations + PlayReady *StreamingPolicyPlayReadyConfiguration `json:"playReady,omitempty"` + // Widevine - Widevine configurations + Widevine *StreamingPolicyWidevineConfiguration `json:"widevine,omitempty"` +} + +// CheckNameAvailabilityInput the input to the check name availability request. +type CheckNameAvailabilityInput struct { + // Name - The account name. + Name *string `json:"name,omitempty"` + // Type - The account type. For a Media Services account, this should be 'MediaServices'. + Type *string `json:"type,omitempty"` +} + +// BasicCodec describes the basic properties of all codecs. +type BasicCodec interface { + AsAudio() (*Audio, bool) + AsBasicAudio() (BasicAudio, bool) + AsAacAudio() (*AacAudio, bool) + AsCopyVideo() (*CopyVideo, bool) + AsVideo() (*Video, bool) + AsBasicVideo() (BasicVideo, bool) + AsImage() (*Image, bool) + AsBasicImage() (BasicImage, bool) + AsCopyAudio() (*CopyAudio, bool) + AsH264Video() (*H264Video, bool) + AsJpgImage() (*JpgImage, bool) + AsPngImage() (*PngImage, bool) + AsCodec() (*Codec, bool) +} + +// Codec describes the basic properties of all codecs. +type Codec struct { + // Label - An optional label for the codec. The label can be used to control muxing behavior. + Label *string `json:"label,omitempty"` + // OdataType - Possible values include: 'OdataTypeCodec', 'OdataTypeMicrosoftMediaAudio', 'OdataTypeMicrosoftMediaAacAudio', 'OdataTypeMicrosoftMediaCopyVideo', 'OdataTypeMicrosoftMediaVideo', 'OdataTypeMicrosoftMediaImage', 'OdataTypeMicrosoftMediaCopyAudio', 'OdataTypeMicrosoftMediaH264Video', 'OdataTypeMicrosoftMediaJpgImage', 'OdataTypeMicrosoftMediaPngImage' + OdataType OdataTypeBasicCodec `json:"@odata.type,omitempty"` +} + +func unmarshalBasicCodec(body []byte) (BasicCodec, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["@odata.type"] { + case string(OdataTypeMicrosoftMediaAudio): + var a Audio + err := json.Unmarshal(body, &a) + return a, err + case string(OdataTypeMicrosoftMediaAacAudio): + var aa AacAudio + err := json.Unmarshal(body, &aa) + return aa, err + case string(OdataTypeMicrosoftMediaCopyVideo): + var cv CopyVideo + err := json.Unmarshal(body, &cv) + return cv, err + case string(OdataTypeMicrosoftMediaVideo): + var vVar Video + err := json.Unmarshal(body, &vVar) + return vVar, err + case string(OdataTypeMicrosoftMediaImage): + var i Image + err := json.Unmarshal(body, &i) + return i, err + case string(OdataTypeMicrosoftMediaCopyAudio): + var ca CopyAudio + err := json.Unmarshal(body, &ca) + return ca, err + case string(OdataTypeMicrosoftMediaH264Video): + var hv H264Video + err := json.Unmarshal(body, &hv) + return hv, err + case string(OdataTypeMicrosoftMediaJpgImage): + var ji JpgImage + err := json.Unmarshal(body, &ji) + return ji, err + case string(OdataTypeMicrosoftMediaPngImage): + var pi PngImage + err := json.Unmarshal(body, &pi) + return pi, err + default: + var c Codec + err := json.Unmarshal(body, &c) + return c, err + } +} +func unmarshalBasicCodecArray(body []byte) ([]BasicCodec, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + cArray := make([]BasicCodec, len(rawMessages)) + + for index, rawMessage := range rawMessages { + c, err := unmarshalBasicCodec(*rawMessage) + if err != nil { + return nil, err + } + cArray[index] = c + } + return cArray, nil +} + +// MarshalJSON is the custom marshaler for Codec. +func (c Codec) MarshalJSON() ([]byte, error) { + c.OdataType = OdataTypeCodec + objectMap := make(map[string]interface{}) + if c.Label != nil { + objectMap["label"] = c.Label + } + if c.OdataType != "" { + objectMap["@odata.type"] = c.OdataType + } + return json.Marshal(objectMap) +} + +// AsAudio is the BasicCodec implementation for Codec. +func (c Codec) AsAudio() (*Audio, bool) { + return nil, false +} + +// AsBasicAudio is the BasicCodec implementation for Codec. +func (c Codec) AsBasicAudio() (BasicAudio, bool) { + return nil, false +} + +// AsAacAudio is the BasicCodec implementation for Codec. +func (c Codec) AsAacAudio() (*AacAudio, bool) { + return nil, false +} + +// AsCopyVideo is the BasicCodec implementation for Codec. +func (c Codec) AsCopyVideo() (*CopyVideo, bool) { + return nil, false +} + +// AsVideo is the BasicCodec implementation for Codec. +func (c Codec) AsVideo() (*Video, bool) { + return nil, false +} + +// AsBasicVideo is the BasicCodec implementation for Codec. +func (c Codec) AsBasicVideo() (BasicVideo, bool) { + return nil, false +} + +// AsImage is the BasicCodec implementation for Codec. +func (c Codec) AsImage() (*Image, bool) { + return nil, false +} + +// AsBasicImage is the BasicCodec implementation for Codec. +func (c Codec) AsBasicImage() (BasicImage, bool) { + return nil, false +} + +// AsCopyAudio is the BasicCodec implementation for Codec. +func (c Codec) AsCopyAudio() (*CopyAudio, bool) { + return nil, false +} + +// AsH264Video is the BasicCodec implementation for Codec. +func (c Codec) AsH264Video() (*H264Video, bool) { + return nil, false +} + +// AsJpgImage is the BasicCodec implementation for Codec. +func (c Codec) AsJpgImage() (*JpgImage, bool) { + return nil, false +} + +// AsPngImage is the BasicCodec implementation for Codec. +func (c Codec) AsPngImage() (*PngImage, bool) { + return nil, false +} + +// AsCodec is the BasicCodec implementation for Codec. +func (c Codec) AsCodec() (*Codec, bool) { + return &c, true +} + +// AsBasicCodec is the BasicCodec implementation for Codec. +func (c Codec) AsBasicCodec() (BasicCodec, bool) { + return &c, true +} + +// CommonEncryptionCbcs class for CommonEncryptionCbcs encryption scheme +type CommonEncryptionCbcs struct { + // EnabledProtocols - Representing supported protocols + EnabledProtocols *EnabledProtocols `json:"enabledProtocols,omitempty"` + // ClearTracks - Representing which tracks should not be encrypted + ClearTracks *[]TrackSelection `json:"clearTracks,omitempty"` + // ContentKeys - Representing default content key for each encryption scheme and separate content keys for specific tracks + ContentKeys *StreamingPolicyContentKeys `json:"contentKeys,omitempty"` + // Drm - Configuration of DRMs for current encryption scheme + Drm *CbcsDrmConfiguration `json:"drm,omitempty"` +} + +// CommonEncryptionCenc class for envelope encryption scheme +type CommonEncryptionCenc struct { + // EnabledProtocols - Representing supported protocols + EnabledProtocols *EnabledProtocols `json:"enabledProtocols,omitempty"` + // ClearTracks - Representing which tracks should not be encrypted + ClearTracks *[]TrackSelection `json:"clearTracks,omitempty"` + // ContentKeys - Representing default content key for each encryption scheme and separate content keys for specific tracks + ContentKeys *StreamingPolicyContentKeys `json:"contentKeys,omitempty"` + // Drm - Configuration of DRMs for CommonEncryptionCenc encryption scheme + Drm *CencDrmConfiguration `json:"drm,omitempty"` +} + +// ContentKeyPolicy a Content Key Policy resource. +type ContentKeyPolicy struct { + autorest.Response `json:"-"` + *ContentKeyPolicyProperties `json:"properties,omitempty"` + // ID - Fully qualified resource ID for the resource. + ID *string `json:"id,omitempty"` + // Name - The name of the resource. + Name *string `json:"name,omitempty"` + // Type - The type of the resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ContentKeyPolicy. +func (ckp ContentKeyPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ckp.ContentKeyPolicyProperties != nil { + objectMap["properties"] = ckp.ContentKeyPolicyProperties + } + if ckp.ID != nil { + objectMap["id"] = ckp.ID + } + if ckp.Name != nil { + objectMap["name"] = ckp.Name + } + if ckp.Type != nil { + objectMap["type"] = ckp.Type + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ContentKeyPolicy struct. +func (ckp *ContentKeyPolicy) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var contentKeyPolicyProperties ContentKeyPolicyProperties + err = json.Unmarshal(*v, &contentKeyPolicyProperties) + if err != nil { + return err + } + ckp.ContentKeyPolicyProperties = &contentKeyPolicyProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ckp.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ckp.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ckp.Type = &typeVar + } + } + } + + return nil +} + +// ContentKeyPolicyClearKeyConfiguration represents a configuration for non-DRM keys. +type ContentKeyPolicyClearKeyConfiguration struct { + // OdataType - Possible values include: 'OdataTypeContentKeyPolicyConfiguration', 'OdataTypeMicrosoftMediaContentKeyPolicyClearKeyConfiguration', 'OdataTypeMicrosoftMediaContentKeyPolicyUnknownConfiguration', 'OdataTypeMicrosoftMediaContentKeyPolicyWidevineConfiguration', 'OdataTypeMicrosoftMediaContentKeyPolicyPlayReadyConfiguration', 'OdataTypeMicrosoftMediaContentKeyPolicyFairPlayConfiguration' + OdataType OdataTypeBasicContentKeyPolicyConfiguration `json:"@odata.type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ContentKeyPolicyClearKeyConfiguration. +func (ckpckc ContentKeyPolicyClearKeyConfiguration) MarshalJSON() ([]byte, error) { + ckpckc.OdataType = OdataTypeMicrosoftMediaContentKeyPolicyClearKeyConfiguration + objectMap := make(map[string]interface{}) + if ckpckc.OdataType != "" { + objectMap["@odata.type"] = ckpckc.OdataType + } + return json.Marshal(objectMap) +} + +// AsContentKeyPolicyClearKeyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyClearKeyConfiguration. +func (ckpckc ContentKeyPolicyClearKeyConfiguration) AsContentKeyPolicyClearKeyConfiguration() (*ContentKeyPolicyClearKeyConfiguration, bool) { + return &ckpckc, true +} + +// AsContentKeyPolicyUnknownConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyClearKeyConfiguration. +func (ckpckc ContentKeyPolicyClearKeyConfiguration) AsContentKeyPolicyUnknownConfiguration() (*ContentKeyPolicyUnknownConfiguration, bool) { + return nil, false +} + +// AsContentKeyPolicyWidevineConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyClearKeyConfiguration. +func (ckpckc ContentKeyPolicyClearKeyConfiguration) AsContentKeyPolicyWidevineConfiguration() (*ContentKeyPolicyWidevineConfiguration, bool) { + return nil, false +} + +// AsContentKeyPolicyPlayReadyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyClearKeyConfiguration. +func (ckpckc ContentKeyPolicyClearKeyConfiguration) AsContentKeyPolicyPlayReadyConfiguration() (*ContentKeyPolicyPlayReadyConfiguration, bool) { + return nil, false +} + +// AsContentKeyPolicyFairPlayConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyClearKeyConfiguration. +func (ckpckc ContentKeyPolicyClearKeyConfiguration) AsContentKeyPolicyFairPlayConfiguration() (*ContentKeyPolicyFairPlayConfiguration, bool) { + return nil, false +} + +// AsContentKeyPolicyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyClearKeyConfiguration. +func (ckpckc ContentKeyPolicyClearKeyConfiguration) AsContentKeyPolicyConfiguration() (*ContentKeyPolicyConfiguration, bool) { + return nil, false +} + +// AsBasicContentKeyPolicyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyClearKeyConfiguration. +func (ckpckc ContentKeyPolicyClearKeyConfiguration) AsBasicContentKeyPolicyConfiguration() (BasicContentKeyPolicyConfiguration, bool) { + return &ckpckc, true +} + +// ContentKeyPolicyCollection a collection of ContentKeyPolicy items. +type ContentKeyPolicyCollection struct { + autorest.Response `json:"-"` + // Value - A collection of ContentKeyPolicy items. + Value *[]ContentKeyPolicy `json:"value,omitempty"` + // OdataNextLink - A link to the next page of the collection (when the collection contains too many results to return in one response). + OdataNextLink *string `json:"@odata.nextLink,omitempty"` +} + +// ContentKeyPolicyCollectionIterator provides access to a complete listing of ContentKeyPolicy values. +type ContentKeyPolicyCollectionIterator struct { + i int + page ContentKeyPolicyCollectionPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ContentKeyPolicyCollectionIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ContentKeyPolicyCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ContentKeyPolicyCollectionIterator) Response() ContentKeyPolicyCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ContentKeyPolicyCollectionIterator) Value() ContentKeyPolicy { + if !iter.page.NotDone() { + return ContentKeyPolicy{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (ckpc ContentKeyPolicyCollection) IsEmpty() bool { + return ckpc.Value == nil || len(*ckpc.Value) == 0 +} + +// contentKeyPolicyCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (ckpc ContentKeyPolicyCollection) contentKeyPolicyCollectionPreparer() (*http.Request, error) { + if ckpc.OdataNextLink == nil || len(to.String(ckpc.OdataNextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(ckpc.OdataNextLink))) +} + +// ContentKeyPolicyCollectionPage contains a page of ContentKeyPolicy values. +type ContentKeyPolicyCollectionPage struct { + fn func(ContentKeyPolicyCollection) (ContentKeyPolicyCollection, error) + ckpc ContentKeyPolicyCollection +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ContentKeyPolicyCollectionPage) Next() error { + next, err := page.fn(page.ckpc) + if err != nil { + return err + } + page.ckpc = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ContentKeyPolicyCollectionPage) NotDone() bool { + return !page.ckpc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ContentKeyPolicyCollectionPage) Response() ContentKeyPolicyCollection { + return page.ckpc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ContentKeyPolicyCollectionPage) Values() []ContentKeyPolicy { + if page.ckpc.IsEmpty() { + return nil + } + return *page.ckpc.Value +} + +// BasicContentKeyPolicyConfiguration base class for Content Key Policy configuration. A derived class must be used to +// create a configuration. +type BasicContentKeyPolicyConfiguration interface { + AsContentKeyPolicyClearKeyConfiguration() (*ContentKeyPolicyClearKeyConfiguration, bool) + AsContentKeyPolicyUnknownConfiguration() (*ContentKeyPolicyUnknownConfiguration, bool) + AsContentKeyPolicyWidevineConfiguration() (*ContentKeyPolicyWidevineConfiguration, bool) + AsContentKeyPolicyPlayReadyConfiguration() (*ContentKeyPolicyPlayReadyConfiguration, bool) + AsContentKeyPolicyFairPlayConfiguration() (*ContentKeyPolicyFairPlayConfiguration, bool) + AsContentKeyPolicyConfiguration() (*ContentKeyPolicyConfiguration, bool) +} + +// ContentKeyPolicyConfiguration base class for Content Key Policy configuration. A derived class must be used to +// create a configuration. +type ContentKeyPolicyConfiguration struct { + // OdataType - Possible values include: 'OdataTypeContentKeyPolicyConfiguration', 'OdataTypeMicrosoftMediaContentKeyPolicyClearKeyConfiguration', 'OdataTypeMicrosoftMediaContentKeyPolicyUnknownConfiguration', 'OdataTypeMicrosoftMediaContentKeyPolicyWidevineConfiguration', 'OdataTypeMicrosoftMediaContentKeyPolicyPlayReadyConfiguration', 'OdataTypeMicrosoftMediaContentKeyPolicyFairPlayConfiguration' + OdataType OdataTypeBasicContentKeyPolicyConfiguration `json:"@odata.type,omitempty"` +} + +func unmarshalBasicContentKeyPolicyConfiguration(body []byte) (BasicContentKeyPolicyConfiguration, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["@odata.type"] { + case string(OdataTypeMicrosoftMediaContentKeyPolicyClearKeyConfiguration): + var ckpckc ContentKeyPolicyClearKeyConfiguration + err := json.Unmarshal(body, &ckpckc) + return ckpckc, err + case string(OdataTypeMicrosoftMediaContentKeyPolicyUnknownConfiguration): + var ckpuc ContentKeyPolicyUnknownConfiguration + err := json.Unmarshal(body, &ckpuc) + return ckpuc, err + case string(OdataTypeMicrosoftMediaContentKeyPolicyWidevineConfiguration): + var ckpwc ContentKeyPolicyWidevineConfiguration + err := json.Unmarshal(body, &ckpwc) + return ckpwc, err + case string(OdataTypeMicrosoftMediaContentKeyPolicyPlayReadyConfiguration): + var ckpprc ContentKeyPolicyPlayReadyConfiguration + err := json.Unmarshal(body, &ckpprc) + return ckpprc, err + case string(OdataTypeMicrosoftMediaContentKeyPolicyFairPlayConfiguration): + var ckpfpc ContentKeyPolicyFairPlayConfiguration + err := json.Unmarshal(body, &ckpfpc) + return ckpfpc, err + default: + var ckpc ContentKeyPolicyConfiguration + err := json.Unmarshal(body, &ckpc) + return ckpc, err + } +} +func unmarshalBasicContentKeyPolicyConfigurationArray(body []byte) ([]BasicContentKeyPolicyConfiguration, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + ckpcArray := make([]BasicContentKeyPolicyConfiguration, len(rawMessages)) + + for index, rawMessage := range rawMessages { + ckpc, err := unmarshalBasicContentKeyPolicyConfiguration(*rawMessage) + if err != nil { + return nil, err + } + ckpcArray[index] = ckpc + } + return ckpcArray, nil +} + +// MarshalJSON is the custom marshaler for ContentKeyPolicyConfiguration. +func (ckpc ContentKeyPolicyConfiguration) MarshalJSON() ([]byte, error) { + ckpc.OdataType = OdataTypeContentKeyPolicyConfiguration + objectMap := make(map[string]interface{}) + if ckpc.OdataType != "" { + objectMap["@odata.type"] = ckpc.OdataType + } + return json.Marshal(objectMap) +} + +// AsContentKeyPolicyClearKeyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyConfiguration. +func (ckpc ContentKeyPolicyConfiguration) AsContentKeyPolicyClearKeyConfiguration() (*ContentKeyPolicyClearKeyConfiguration, bool) { + return nil, false +} + +// AsContentKeyPolicyUnknownConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyConfiguration. +func (ckpc ContentKeyPolicyConfiguration) AsContentKeyPolicyUnknownConfiguration() (*ContentKeyPolicyUnknownConfiguration, bool) { + return nil, false +} + +// AsContentKeyPolicyWidevineConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyConfiguration. +func (ckpc ContentKeyPolicyConfiguration) AsContentKeyPolicyWidevineConfiguration() (*ContentKeyPolicyWidevineConfiguration, bool) { + return nil, false +} + +// AsContentKeyPolicyPlayReadyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyConfiguration. +func (ckpc ContentKeyPolicyConfiguration) AsContentKeyPolicyPlayReadyConfiguration() (*ContentKeyPolicyPlayReadyConfiguration, bool) { + return nil, false +} + +// AsContentKeyPolicyFairPlayConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyConfiguration. +func (ckpc ContentKeyPolicyConfiguration) AsContentKeyPolicyFairPlayConfiguration() (*ContentKeyPolicyFairPlayConfiguration, bool) { + return nil, false +} + +// AsContentKeyPolicyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyConfiguration. +func (ckpc ContentKeyPolicyConfiguration) AsContentKeyPolicyConfiguration() (*ContentKeyPolicyConfiguration, bool) { + return &ckpc, true +} + +// AsBasicContentKeyPolicyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyConfiguration. +func (ckpc ContentKeyPolicyConfiguration) AsBasicContentKeyPolicyConfiguration() (BasicContentKeyPolicyConfiguration, bool) { + return &ckpc, true +} + +// ContentKeyPolicyFairPlayConfiguration specifies a configuration for FairPlay licenses. +type ContentKeyPolicyFairPlayConfiguration struct { + // Ask - The key that must be used as FairPlay ASk. + Ask *[]byte `json:"ask,omitempty"` + // FairPlayPfxPassword - The password encrypting FairPlay certificate in PKCS 12 (pfx) format. + FairPlayPfxPassword *string `json:"fairPlayPfxPassword,omitempty"` + // FairPlayPfx - The Base64 representation of FairPlay certificate in PKCS 12 (pfx) format (including private key). + FairPlayPfx *string `json:"fairPlayPfx,omitempty"` + // RentalAndLeaseKeyType - The rental and lease key type. Possible values include: 'Unknown', 'Undefined', 'PersistentUnlimited', 'PersistentLimited' + RentalAndLeaseKeyType ContentKeyPolicyFairPlayRentalAndLeaseKeyType `json:"rentalAndLeaseKeyType,omitempty"` + // RentalDuration - The rental duration. Must be greater than or equal to 0. + RentalDuration *int64 `json:"rentalDuration,omitempty"` + // OdataType - Possible values include: 'OdataTypeContentKeyPolicyConfiguration', 'OdataTypeMicrosoftMediaContentKeyPolicyClearKeyConfiguration', 'OdataTypeMicrosoftMediaContentKeyPolicyUnknownConfiguration', 'OdataTypeMicrosoftMediaContentKeyPolicyWidevineConfiguration', 'OdataTypeMicrosoftMediaContentKeyPolicyPlayReadyConfiguration', 'OdataTypeMicrosoftMediaContentKeyPolicyFairPlayConfiguration' + OdataType OdataTypeBasicContentKeyPolicyConfiguration `json:"@odata.type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ContentKeyPolicyFairPlayConfiguration. +func (ckpfpc ContentKeyPolicyFairPlayConfiguration) MarshalJSON() ([]byte, error) { + ckpfpc.OdataType = OdataTypeMicrosoftMediaContentKeyPolicyFairPlayConfiguration + objectMap := make(map[string]interface{}) + if ckpfpc.Ask != nil { + objectMap["ask"] = ckpfpc.Ask + } + if ckpfpc.FairPlayPfxPassword != nil { + objectMap["fairPlayPfxPassword"] = ckpfpc.FairPlayPfxPassword + } + if ckpfpc.FairPlayPfx != nil { + objectMap["fairPlayPfx"] = ckpfpc.FairPlayPfx + } + if ckpfpc.RentalAndLeaseKeyType != "" { + objectMap["rentalAndLeaseKeyType"] = ckpfpc.RentalAndLeaseKeyType + } + if ckpfpc.RentalDuration != nil { + objectMap["rentalDuration"] = ckpfpc.RentalDuration + } + if ckpfpc.OdataType != "" { + objectMap["@odata.type"] = ckpfpc.OdataType + } + return json.Marshal(objectMap) +} + +// AsContentKeyPolicyClearKeyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyFairPlayConfiguration. +func (ckpfpc ContentKeyPolicyFairPlayConfiguration) AsContentKeyPolicyClearKeyConfiguration() (*ContentKeyPolicyClearKeyConfiguration, bool) { + return nil, false +} + +// AsContentKeyPolicyUnknownConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyFairPlayConfiguration. +func (ckpfpc ContentKeyPolicyFairPlayConfiguration) AsContentKeyPolicyUnknownConfiguration() (*ContentKeyPolicyUnknownConfiguration, bool) { + return nil, false +} + +// AsContentKeyPolicyWidevineConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyFairPlayConfiguration. +func (ckpfpc ContentKeyPolicyFairPlayConfiguration) AsContentKeyPolicyWidevineConfiguration() (*ContentKeyPolicyWidevineConfiguration, bool) { + return nil, false +} + +// AsContentKeyPolicyPlayReadyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyFairPlayConfiguration. +func (ckpfpc ContentKeyPolicyFairPlayConfiguration) AsContentKeyPolicyPlayReadyConfiguration() (*ContentKeyPolicyPlayReadyConfiguration, bool) { + return nil, false +} + +// AsContentKeyPolicyFairPlayConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyFairPlayConfiguration. +func (ckpfpc ContentKeyPolicyFairPlayConfiguration) AsContentKeyPolicyFairPlayConfiguration() (*ContentKeyPolicyFairPlayConfiguration, bool) { + return &ckpfpc, true +} + +// AsContentKeyPolicyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyFairPlayConfiguration. +func (ckpfpc ContentKeyPolicyFairPlayConfiguration) AsContentKeyPolicyConfiguration() (*ContentKeyPolicyConfiguration, bool) { + return nil, false +} + +// AsBasicContentKeyPolicyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyFairPlayConfiguration. +func (ckpfpc ContentKeyPolicyFairPlayConfiguration) AsBasicContentKeyPolicyConfiguration() (BasicContentKeyPolicyConfiguration, bool) { + return &ckpfpc, true +} + +// ContentKeyPolicyOpenRestriction represents an open restriction. License or key will be delivered on every +// request. +type ContentKeyPolicyOpenRestriction struct { + // OdataType - Possible values include: 'OdataTypeContentKeyPolicyRestriction', 'OdataTypeMicrosoftMediaContentKeyPolicyOpenRestriction', 'OdataTypeMicrosoftMediaContentKeyPolicyUnknownRestriction', 'OdataTypeMicrosoftMediaContentKeyPolicyTokenRestriction' + OdataType OdataTypeBasicContentKeyPolicyRestriction `json:"@odata.type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ContentKeyPolicyOpenRestriction. +func (ckpor ContentKeyPolicyOpenRestriction) MarshalJSON() ([]byte, error) { + ckpor.OdataType = OdataTypeMicrosoftMediaContentKeyPolicyOpenRestriction + objectMap := make(map[string]interface{}) + if ckpor.OdataType != "" { + objectMap["@odata.type"] = ckpor.OdataType + } + return json.Marshal(objectMap) +} + +// AsContentKeyPolicyOpenRestriction is the BasicContentKeyPolicyRestriction implementation for ContentKeyPolicyOpenRestriction. +func (ckpor ContentKeyPolicyOpenRestriction) AsContentKeyPolicyOpenRestriction() (*ContentKeyPolicyOpenRestriction, bool) { + return &ckpor, true +} + +// AsContentKeyPolicyUnknownRestriction is the BasicContentKeyPolicyRestriction implementation for ContentKeyPolicyOpenRestriction. +func (ckpor ContentKeyPolicyOpenRestriction) AsContentKeyPolicyUnknownRestriction() (*ContentKeyPolicyUnknownRestriction, bool) { + return nil, false +} + +// AsContentKeyPolicyTokenRestriction is the BasicContentKeyPolicyRestriction implementation for ContentKeyPolicyOpenRestriction. +func (ckpor ContentKeyPolicyOpenRestriction) AsContentKeyPolicyTokenRestriction() (*ContentKeyPolicyTokenRestriction, bool) { + return nil, false +} + +// AsContentKeyPolicyRestriction is the BasicContentKeyPolicyRestriction implementation for ContentKeyPolicyOpenRestriction. +func (ckpor ContentKeyPolicyOpenRestriction) AsContentKeyPolicyRestriction() (*ContentKeyPolicyRestriction, bool) { + return nil, false +} + +// AsBasicContentKeyPolicyRestriction is the BasicContentKeyPolicyRestriction implementation for ContentKeyPolicyOpenRestriction. +func (ckpor ContentKeyPolicyOpenRestriction) AsBasicContentKeyPolicyRestriction() (BasicContentKeyPolicyRestriction, bool) { + return &ckpor, true +} + +// ContentKeyPolicyOption represents a policy option. +type ContentKeyPolicyOption struct { + // PolicyOptionID - The legacy Policy Option ID. + PolicyOptionID *uuid.UUID `json:"policyOptionId,omitempty"` + // Name - The Policy Option description. + Name *string `json:"name,omitempty"` + // Configuration - The key delivery configuration. + Configuration BasicContentKeyPolicyConfiguration `json:"configuration,omitempty"` + // Restriction - The requirements that must be met to deliver keys with this configuration + Restriction BasicContentKeyPolicyRestriction `json:"restriction,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for ContentKeyPolicyOption struct. +func (ckpo *ContentKeyPolicyOption) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "policyOptionId": + if v != nil { + var policyOptionID uuid.UUID + err = json.Unmarshal(*v, &policyOptionID) + if err != nil { + return err + } + ckpo.PolicyOptionID = &policyOptionID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ckpo.Name = &name + } + case "configuration": + if v != nil { + configuration, err := unmarshalBasicContentKeyPolicyConfiguration(*v) + if err != nil { + return err + } + ckpo.Configuration = configuration + } + case "restriction": + if v != nil { + restriction, err := unmarshalBasicContentKeyPolicyRestriction(*v) + if err != nil { + return err + } + ckpo.Restriction = restriction + } + } + } + + return nil +} + +// ContentKeyPolicyPlayReadyConfiguration specifies a configuration for PlayReady licenses. +type ContentKeyPolicyPlayReadyConfiguration struct { + // Licenses - The PlayReady licenses. + Licenses *[]ContentKeyPolicyPlayReadyLicense `json:"licenses,omitempty"` + // ResponseCustomData - The custom response data. + ResponseCustomData *string `json:"responseCustomData,omitempty"` + // OdataType - Possible values include: 'OdataTypeContentKeyPolicyConfiguration', 'OdataTypeMicrosoftMediaContentKeyPolicyClearKeyConfiguration', 'OdataTypeMicrosoftMediaContentKeyPolicyUnknownConfiguration', 'OdataTypeMicrosoftMediaContentKeyPolicyWidevineConfiguration', 'OdataTypeMicrosoftMediaContentKeyPolicyPlayReadyConfiguration', 'OdataTypeMicrosoftMediaContentKeyPolicyFairPlayConfiguration' + OdataType OdataTypeBasicContentKeyPolicyConfiguration `json:"@odata.type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ContentKeyPolicyPlayReadyConfiguration. +func (ckpprc ContentKeyPolicyPlayReadyConfiguration) MarshalJSON() ([]byte, error) { + ckpprc.OdataType = OdataTypeMicrosoftMediaContentKeyPolicyPlayReadyConfiguration + objectMap := make(map[string]interface{}) + if ckpprc.Licenses != nil { + objectMap["licenses"] = ckpprc.Licenses + } + if ckpprc.ResponseCustomData != nil { + objectMap["responseCustomData"] = ckpprc.ResponseCustomData + } + if ckpprc.OdataType != "" { + objectMap["@odata.type"] = ckpprc.OdataType + } + return json.Marshal(objectMap) +} + +// AsContentKeyPolicyClearKeyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyPlayReadyConfiguration. +func (ckpprc ContentKeyPolicyPlayReadyConfiguration) AsContentKeyPolicyClearKeyConfiguration() (*ContentKeyPolicyClearKeyConfiguration, bool) { + return nil, false +} + +// AsContentKeyPolicyUnknownConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyPlayReadyConfiguration. +func (ckpprc ContentKeyPolicyPlayReadyConfiguration) AsContentKeyPolicyUnknownConfiguration() (*ContentKeyPolicyUnknownConfiguration, bool) { + return nil, false +} + +// AsContentKeyPolicyWidevineConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyPlayReadyConfiguration. +func (ckpprc ContentKeyPolicyPlayReadyConfiguration) AsContentKeyPolicyWidevineConfiguration() (*ContentKeyPolicyWidevineConfiguration, bool) { + return nil, false +} + +// AsContentKeyPolicyPlayReadyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyPlayReadyConfiguration. +func (ckpprc ContentKeyPolicyPlayReadyConfiguration) AsContentKeyPolicyPlayReadyConfiguration() (*ContentKeyPolicyPlayReadyConfiguration, bool) { + return &ckpprc, true +} + +// AsContentKeyPolicyFairPlayConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyPlayReadyConfiguration. +func (ckpprc ContentKeyPolicyPlayReadyConfiguration) AsContentKeyPolicyFairPlayConfiguration() (*ContentKeyPolicyFairPlayConfiguration, bool) { + return nil, false +} + +// AsContentKeyPolicyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyPlayReadyConfiguration. +func (ckpprc ContentKeyPolicyPlayReadyConfiguration) AsContentKeyPolicyConfiguration() (*ContentKeyPolicyConfiguration, bool) { + return nil, false +} + +// AsBasicContentKeyPolicyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyPlayReadyConfiguration. +func (ckpprc ContentKeyPolicyPlayReadyConfiguration) AsBasicContentKeyPolicyConfiguration() (BasicContentKeyPolicyConfiguration, bool) { + return &ckpprc, true +} + +// ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader specifies that the content key ID is in the PlayReady +// header. +type ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader struct { + // OdataType - Possible values include: 'OdataTypeContentKeyPolicyPlayReadyContentKeyLocation', 'OdataTypeMicrosoftMediaContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader', 'OdataTypeMicrosoftMediaContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier' + OdataType OdataType `json:"@odata.type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader. +func (ckpprcekfh ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader) MarshalJSON() ([]byte, error) { + ckpprcekfh.OdataType = OdataTypeMicrosoftMediaContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader + objectMap := make(map[string]interface{}) + if ckpprcekfh.OdataType != "" { + objectMap["@odata.type"] = ckpprcekfh.OdataType + } + return json.Marshal(objectMap) +} + +// AsContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader is the BasicContentKeyPolicyPlayReadyContentKeyLocation implementation for ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader. +func (ckpprcekfh ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader) AsContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader() (*ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader, bool) { + return &ckpprcekfh, true +} + +// AsContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier is the BasicContentKeyPolicyPlayReadyContentKeyLocation implementation for ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader. +func (ckpprcekfh ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader) AsContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier() (*ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier, bool) { + return nil, false +} + +// AsContentKeyPolicyPlayReadyContentKeyLocation is the BasicContentKeyPolicyPlayReadyContentKeyLocation implementation for ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader. +func (ckpprcekfh ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader) AsContentKeyPolicyPlayReadyContentKeyLocation() (*ContentKeyPolicyPlayReadyContentKeyLocation, bool) { + return nil, false +} + +// AsBasicContentKeyPolicyPlayReadyContentKeyLocation is the BasicContentKeyPolicyPlayReadyContentKeyLocation implementation for ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader. +func (ckpprcekfh ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader) AsBasicContentKeyPolicyPlayReadyContentKeyLocation() (BasicContentKeyPolicyPlayReadyContentKeyLocation, bool) { + return &ckpprcekfh, true +} + +// ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier specifies that the content key ID is specified in +// the PlayReady configuration. +type ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier struct { + // KeyID - The content key ID. + KeyID *uuid.UUID `json:"keyId,omitempty"` + // OdataType - Possible values include: 'OdataTypeContentKeyPolicyPlayReadyContentKeyLocation', 'OdataTypeMicrosoftMediaContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader', 'OdataTypeMicrosoftMediaContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier' + OdataType OdataType `json:"@odata.type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier. +func (ckpprcekfki ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier) MarshalJSON() ([]byte, error) { + ckpprcekfki.OdataType = OdataTypeMicrosoftMediaContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier + objectMap := make(map[string]interface{}) + if ckpprcekfki.KeyID != nil { + objectMap["keyId"] = ckpprcekfki.KeyID + } + if ckpprcekfki.OdataType != "" { + objectMap["@odata.type"] = ckpprcekfki.OdataType + } + return json.Marshal(objectMap) +} + +// AsContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader is the BasicContentKeyPolicyPlayReadyContentKeyLocation implementation for ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier. +func (ckpprcekfki ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier) AsContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader() (*ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader, bool) { + return nil, false +} + +// AsContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier is the BasicContentKeyPolicyPlayReadyContentKeyLocation implementation for ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier. +func (ckpprcekfki ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier) AsContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier() (*ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier, bool) { + return &ckpprcekfki, true +} + +// AsContentKeyPolicyPlayReadyContentKeyLocation is the BasicContentKeyPolicyPlayReadyContentKeyLocation implementation for ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier. +func (ckpprcekfki ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier) AsContentKeyPolicyPlayReadyContentKeyLocation() (*ContentKeyPolicyPlayReadyContentKeyLocation, bool) { + return nil, false +} + +// AsBasicContentKeyPolicyPlayReadyContentKeyLocation is the BasicContentKeyPolicyPlayReadyContentKeyLocation implementation for ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier. +func (ckpprcekfki ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier) AsBasicContentKeyPolicyPlayReadyContentKeyLocation() (BasicContentKeyPolicyPlayReadyContentKeyLocation, bool) { + return &ckpprcekfki, true +} + +// BasicContentKeyPolicyPlayReadyContentKeyLocation base class for content key ID location. A derived class must be +// used to represent the location. +type BasicContentKeyPolicyPlayReadyContentKeyLocation interface { + AsContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader() (*ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader, bool) + AsContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier() (*ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier, bool) + AsContentKeyPolicyPlayReadyContentKeyLocation() (*ContentKeyPolicyPlayReadyContentKeyLocation, bool) +} + +// ContentKeyPolicyPlayReadyContentKeyLocation base class for content key ID location. A derived class must be used +// to represent the location. +type ContentKeyPolicyPlayReadyContentKeyLocation struct { + // OdataType - Possible values include: 'OdataTypeContentKeyPolicyPlayReadyContentKeyLocation', 'OdataTypeMicrosoftMediaContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader', 'OdataTypeMicrosoftMediaContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier' + OdataType OdataType `json:"@odata.type,omitempty"` +} + +func unmarshalBasicContentKeyPolicyPlayReadyContentKeyLocation(body []byte) (BasicContentKeyPolicyPlayReadyContentKeyLocation, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["@odata.type"] { + case string(OdataTypeMicrosoftMediaContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader): + var ckpprcekfh ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader + err := json.Unmarshal(body, &ckpprcekfh) + return ckpprcekfh, err + case string(OdataTypeMicrosoftMediaContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier): + var ckpprcekfki ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier + err := json.Unmarshal(body, &ckpprcekfki) + return ckpprcekfki, err + default: + var ckpprckl ContentKeyPolicyPlayReadyContentKeyLocation + err := json.Unmarshal(body, &ckpprckl) + return ckpprckl, err + } +} +func unmarshalBasicContentKeyPolicyPlayReadyContentKeyLocationArray(body []byte) ([]BasicContentKeyPolicyPlayReadyContentKeyLocation, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + ckpprcklArray := make([]BasicContentKeyPolicyPlayReadyContentKeyLocation, len(rawMessages)) + + for index, rawMessage := range rawMessages { + ckpprckl, err := unmarshalBasicContentKeyPolicyPlayReadyContentKeyLocation(*rawMessage) + if err != nil { + return nil, err + } + ckpprcklArray[index] = ckpprckl + } + return ckpprcklArray, nil +} + +// MarshalJSON is the custom marshaler for ContentKeyPolicyPlayReadyContentKeyLocation. +func (ckpprckl ContentKeyPolicyPlayReadyContentKeyLocation) MarshalJSON() ([]byte, error) { + ckpprckl.OdataType = OdataTypeContentKeyPolicyPlayReadyContentKeyLocation + objectMap := make(map[string]interface{}) + if ckpprckl.OdataType != "" { + objectMap["@odata.type"] = ckpprckl.OdataType + } + return json.Marshal(objectMap) +} + +// AsContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader is the BasicContentKeyPolicyPlayReadyContentKeyLocation implementation for ContentKeyPolicyPlayReadyContentKeyLocation. +func (ckpprckl ContentKeyPolicyPlayReadyContentKeyLocation) AsContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader() (*ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader, bool) { + return nil, false +} + +// AsContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier is the BasicContentKeyPolicyPlayReadyContentKeyLocation implementation for ContentKeyPolicyPlayReadyContentKeyLocation. +func (ckpprckl ContentKeyPolicyPlayReadyContentKeyLocation) AsContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier() (*ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier, bool) { + return nil, false +} + +// AsContentKeyPolicyPlayReadyContentKeyLocation is the BasicContentKeyPolicyPlayReadyContentKeyLocation implementation for ContentKeyPolicyPlayReadyContentKeyLocation. +func (ckpprckl ContentKeyPolicyPlayReadyContentKeyLocation) AsContentKeyPolicyPlayReadyContentKeyLocation() (*ContentKeyPolicyPlayReadyContentKeyLocation, bool) { + return &ckpprckl, true +} + +// AsBasicContentKeyPolicyPlayReadyContentKeyLocation is the BasicContentKeyPolicyPlayReadyContentKeyLocation implementation for ContentKeyPolicyPlayReadyContentKeyLocation. +func (ckpprckl ContentKeyPolicyPlayReadyContentKeyLocation) AsBasicContentKeyPolicyPlayReadyContentKeyLocation() (BasicContentKeyPolicyPlayReadyContentKeyLocation, bool) { + return &ckpprckl, true +} + +// ContentKeyPolicyPlayReadyExplicitAnalogTelevisionRestriction configures the Explicit Analog Television Output +// Restriction control bits. For further details see the PlayReady Compliance Rules. +type ContentKeyPolicyPlayReadyExplicitAnalogTelevisionRestriction struct { + // BestEffort - Indicates whether this restriction is enforced on a Best Effort basis. + BestEffort *bool `json:"bestEffort,omitempty"` + // ConfigurationData - Configures the restriction control bits. Must be between 0 and 3 inclusive. + ConfigurationData *int32 `json:"configurationData,omitempty"` +} + +// ContentKeyPolicyPlayReadyLicense the PlayReady license +type ContentKeyPolicyPlayReadyLicense struct { + // AllowTestDevices - A flag indicating whether test devices can use the license. + AllowTestDevices *bool `json:"allowTestDevices,omitempty"` + // BeginDate - The begin date of license + BeginDate *date.Time `json:"beginDate,omitempty"` + // ExpirationDate - The expiration date of license. + ExpirationDate *date.Time `json:"expirationDate,omitempty"` + // RelativeBeginDate - The relative begin date of license. + RelativeBeginDate *string `json:"relativeBeginDate,omitempty"` + // RelativeExpirationDate - The relative expiration date of license. + RelativeExpirationDate *string `json:"relativeExpirationDate,omitempty"` + // GracePeriod - The grace period of license. + GracePeriod *string `json:"gracePeriod,omitempty"` + // PlayRight - The license PlayRight + PlayRight *ContentKeyPolicyPlayReadyPlayRight `json:"playRight,omitempty"` + // LicenseType - The license type. Possible values include: 'ContentKeyPolicyPlayReadyLicenseTypeUnknown', 'ContentKeyPolicyPlayReadyLicenseTypeNonPersistent', 'ContentKeyPolicyPlayReadyLicenseTypePersistent' + LicenseType ContentKeyPolicyPlayReadyLicenseType `json:"licenseType,omitempty"` + // ContentKeyLocation - The content key location. + ContentKeyLocation BasicContentKeyPolicyPlayReadyContentKeyLocation `json:"contentKeyLocation,omitempty"` + // ContentType - The PlayReady content type. Possible values include: 'ContentKeyPolicyPlayReadyContentTypeUnknown', 'ContentKeyPolicyPlayReadyContentTypeUnspecified', 'ContentKeyPolicyPlayReadyContentTypeUltraVioletDownload', 'ContentKeyPolicyPlayReadyContentTypeUltraVioletStreaming' + ContentType ContentKeyPolicyPlayReadyContentType `json:"contentType,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for ContentKeyPolicyPlayReadyLicense struct. +func (ckpprl *ContentKeyPolicyPlayReadyLicense) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "allowTestDevices": + if v != nil { + var allowTestDevices bool + err = json.Unmarshal(*v, &allowTestDevices) + if err != nil { + return err + } + ckpprl.AllowTestDevices = &allowTestDevices + } + case "beginDate": + if v != nil { + var beginDate date.Time + err = json.Unmarshal(*v, &beginDate) + if err != nil { + return err + } + ckpprl.BeginDate = &beginDate + } + case "expirationDate": + if v != nil { + var expirationDate date.Time + err = json.Unmarshal(*v, &expirationDate) + if err != nil { + return err + } + ckpprl.ExpirationDate = &expirationDate + } + case "relativeBeginDate": + if v != nil { + var relativeBeginDate string + err = json.Unmarshal(*v, &relativeBeginDate) + if err != nil { + return err + } + ckpprl.RelativeBeginDate = &relativeBeginDate + } + case "relativeExpirationDate": + if v != nil { + var relativeExpirationDate string + err = json.Unmarshal(*v, &relativeExpirationDate) + if err != nil { + return err + } + ckpprl.RelativeExpirationDate = &relativeExpirationDate + } + case "gracePeriod": + if v != nil { + var gracePeriod string + err = json.Unmarshal(*v, &gracePeriod) + if err != nil { + return err + } + ckpprl.GracePeriod = &gracePeriod + } + case "playRight": + if v != nil { + var playRight ContentKeyPolicyPlayReadyPlayRight + err = json.Unmarshal(*v, &playRight) + if err != nil { + return err + } + ckpprl.PlayRight = &playRight + } + case "licenseType": + if v != nil { + var licenseType ContentKeyPolicyPlayReadyLicenseType + err = json.Unmarshal(*v, &licenseType) + if err != nil { + return err + } + ckpprl.LicenseType = licenseType + } + case "contentKeyLocation": + if v != nil { + contentKeyLocation, err := unmarshalBasicContentKeyPolicyPlayReadyContentKeyLocation(*v) + if err != nil { + return err + } + ckpprl.ContentKeyLocation = contentKeyLocation + } + case "contentType": + if v != nil { + var contentType ContentKeyPolicyPlayReadyContentType + err = json.Unmarshal(*v, &contentType) + if err != nil { + return err + } + ckpprl.ContentType = contentType + } + } + } + + return nil +} + +// ContentKeyPolicyPlayReadyPlayRight configures the Play Right in the PlayReady license. +type ContentKeyPolicyPlayReadyPlayRight struct { + // FirstPlayExpiration - The amount of time that the license is valid after the license is first used to play content. + FirstPlayExpiration *string `json:"firstPlayExpiration,omitempty"` + // ScmsRestriction - Configures the Serial Copy Management System (SCMS) in the license. Must be between 0 and 3 inclusive. + ScmsRestriction *int32 `json:"scmsRestriction,omitempty"` + // AgcAndColorStripeRestriction - Configures Automatic Gain Control (AGC) and Color Stripe in the license. Must be between 0 and 3 inclusive. + AgcAndColorStripeRestriction *int32 `json:"agcAndColorStripeRestriction,omitempty"` + // ExplicitAnalogTelevisionOutputRestriction - Configures the Explicit Analog Television Output Restriction in the license. Configuration data must be between 0 and 3 inclusive. + ExplicitAnalogTelevisionOutputRestriction *ContentKeyPolicyPlayReadyExplicitAnalogTelevisionRestriction `json:"explicitAnalogTelevisionOutputRestriction,omitempty"` + // DigitalVideoOnlyContentRestriction - Enables the Image Constraint For Analog Component Video Restriction in the license. + DigitalVideoOnlyContentRestriction *bool `json:"digitalVideoOnlyContentRestriction,omitempty"` + // ImageConstraintForAnalogComponentVideoRestriction - Enables the Image Constraint For Analog Component Video Restriction in the license. + ImageConstraintForAnalogComponentVideoRestriction *bool `json:"imageConstraintForAnalogComponentVideoRestriction,omitempty"` + // ImageConstraintForAnalogComputerMonitorRestriction - Enables the Image Constraint For Analog Component Video Restriction in the license. + ImageConstraintForAnalogComputerMonitorRestriction *bool `json:"imageConstraintForAnalogComputerMonitorRestriction,omitempty"` + // AllowPassingVideoContentToUnknownOutput - Configures Unknown output handling settings of the license. Possible values include: 'ContentKeyPolicyPlayReadyUnknownOutputPassingOptionUnknown', 'ContentKeyPolicyPlayReadyUnknownOutputPassingOptionNotAllowed', 'ContentKeyPolicyPlayReadyUnknownOutputPassingOptionAllowed', 'ContentKeyPolicyPlayReadyUnknownOutputPassingOptionAllowedWithVideoConstriction' + AllowPassingVideoContentToUnknownOutput ContentKeyPolicyPlayReadyUnknownOutputPassingOption `json:"allowPassingVideoContentToUnknownOutput,omitempty"` + // UncompressedDigitalVideoOpl - Specifies the output protection level for uncompressed digital video. + UncompressedDigitalVideoOpl *int32 `json:"uncompressedDigitalVideoOpl,omitempty"` + // CompressedDigitalVideoOpl - Specifies the output protection level for compressed digital video. + CompressedDigitalVideoOpl *int32 `json:"compressedDigitalVideoOpl,omitempty"` + // AnalogVideoOpl - Specifies the output protection level for compressed digital audio. + AnalogVideoOpl *int32 `json:"analogVideoOpl,omitempty"` + // CompressedDigitalAudioOpl - Specifies the output protection level for compressed digital audio. + CompressedDigitalAudioOpl *int32 `json:"compressedDigitalAudioOpl,omitempty"` + // UncompressedDigitalAudioOpl - Specifies the output protection level for uncompressed digital audio. + UncompressedDigitalAudioOpl *int32 `json:"uncompressedDigitalAudioOpl,omitempty"` +} + +// ContentKeyPolicyProperties the properties of the Content Key Policy. +type ContentKeyPolicyProperties struct { + autorest.Response `json:"-"` + // PolicyID - The legacy Policy ID. + PolicyID *uuid.UUID `json:"policyId,omitempty"` + // Created - The creation date of the Policy + Created *date.Time `json:"created,omitempty"` + // LastModified - The last modified date of the Policy + LastModified *date.Time `json:"lastModified,omitempty"` + // Description - A description for the Policy. + Description *string `json:"description,omitempty"` + // Options - The Key Policy options. + Options *[]ContentKeyPolicyOption `json:"options,omitempty"` +} + +// BasicContentKeyPolicyRestriction base class for Content Key Policy restrictions. A derived class must be used to +// create a restriction. +type BasicContentKeyPolicyRestriction interface { + AsContentKeyPolicyOpenRestriction() (*ContentKeyPolicyOpenRestriction, bool) + AsContentKeyPolicyUnknownRestriction() (*ContentKeyPolicyUnknownRestriction, bool) + AsContentKeyPolicyTokenRestriction() (*ContentKeyPolicyTokenRestriction, bool) + AsContentKeyPolicyRestriction() (*ContentKeyPolicyRestriction, bool) +} + +// ContentKeyPolicyRestriction base class for Content Key Policy restrictions. A derived class must be used to +// create a restriction. +type ContentKeyPolicyRestriction struct { + // OdataType - Possible values include: 'OdataTypeContentKeyPolicyRestriction', 'OdataTypeMicrosoftMediaContentKeyPolicyOpenRestriction', 'OdataTypeMicrosoftMediaContentKeyPolicyUnknownRestriction', 'OdataTypeMicrosoftMediaContentKeyPolicyTokenRestriction' + OdataType OdataTypeBasicContentKeyPolicyRestriction `json:"@odata.type,omitempty"` +} + +func unmarshalBasicContentKeyPolicyRestriction(body []byte) (BasicContentKeyPolicyRestriction, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["@odata.type"] { + case string(OdataTypeMicrosoftMediaContentKeyPolicyOpenRestriction): + var ckpor ContentKeyPolicyOpenRestriction + err := json.Unmarshal(body, &ckpor) + return ckpor, err + case string(OdataTypeMicrosoftMediaContentKeyPolicyUnknownRestriction): + var ckpur ContentKeyPolicyUnknownRestriction + err := json.Unmarshal(body, &ckpur) + return ckpur, err + case string(OdataTypeMicrosoftMediaContentKeyPolicyTokenRestriction): + var ckptr ContentKeyPolicyTokenRestriction + err := json.Unmarshal(body, &ckptr) + return ckptr, err + default: + var ckpr ContentKeyPolicyRestriction + err := json.Unmarshal(body, &ckpr) + return ckpr, err + } +} +func unmarshalBasicContentKeyPolicyRestrictionArray(body []byte) ([]BasicContentKeyPolicyRestriction, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + ckprArray := make([]BasicContentKeyPolicyRestriction, len(rawMessages)) + + for index, rawMessage := range rawMessages { + ckpr, err := unmarshalBasicContentKeyPolicyRestriction(*rawMessage) + if err != nil { + return nil, err + } + ckprArray[index] = ckpr + } + return ckprArray, nil +} + +// MarshalJSON is the custom marshaler for ContentKeyPolicyRestriction. +func (ckpr ContentKeyPolicyRestriction) MarshalJSON() ([]byte, error) { + ckpr.OdataType = OdataTypeContentKeyPolicyRestriction + objectMap := make(map[string]interface{}) + if ckpr.OdataType != "" { + objectMap["@odata.type"] = ckpr.OdataType + } + return json.Marshal(objectMap) +} + +// AsContentKeyPolicyOpenRestriction is the BasicContentKeyPolicyRestriction implementation for ContentKeyPolicyRestriction. +func (ckpr ContentKeyPolicyRestriction) AsContentKeyPolicyOpenRestriction() (*ContentKeyPolicyOpenRestriction, bool) { + return nil, false +} + +// AsContentKeyPolicyUnknownRestriction is the BasicContentKeyPolicyRestriction implementation for ContentKeyPolicyRestriction. +func (ckpr ContentKeyPolicyRestriction) AsContentKeyPolicyUnknownRestriction() (*ContentKeyPolicyUnknownRestriction, bool) { + return nil, false +} + +// AsContentKeyPolicyTokenRestriction is the BasicContentKeyPolicyRestriction implementation for ContentKeyPolicyRestriction. +func (ckpr ContentKeyPolicyRestriction) AsContentKeyPolicyTokenRestriction() (*ContentKeyPolicyTokenRestriction, bool) { + return nil, false +} + +// AsContentKeyPolicyRestriction is the BasicContentKeyPolicyRestriction implementation for ContentKeyPolicyRestriction. +func (ckpr ContentKeyPolicyRestriction) AsContentKeyPolicyRestriction() (*ContentKeyPolicyRestriction, bool) { + return &ckpr, true +} + +// AsBasicContentKeyPolicyRestriction is the BasicContentKeyPolicyRestriction implementation for ContentKeyPolicyRestriction. +func (ckpr ContentKeyPolicyRestriction) AsBasicContentKeyPolicyRestriction() (BasicContentKeyPolicyRestriction, bool) { + return &ckpr, true +} + +// BasicContentKeyPolicyRestrictionTokenKey base class for Content Key Policy key for token validation. A derived class +// must be used to create a token key. +type BasicContentKeyPolicyRestrictionTokenKey interface { + AsContentKeyPolicySymmetricTokenKey() (*ContentKeyPolicySymmetricTokenKey, bool) + AsContentKeyPolicyRsaTokenKey() (*ContentKeyPolicyRsaTokenKey, bool) + AsContentKeyPolicyX509CertificateTokenKey() (*ContentKeyPolicyX509CertificateTokenKey, bool) + AsContentKeyPolicyRestrictionTokenKey() (*ContentKeyPolicyRestrictionTokenKey, bool) +} + +// ContentKeyPolicyRestrictionTokenKey base class for Content Key Policy key for token validation. A derived class +// must be used to create a token key. +type ContentKeyPolicyRestrictionTokenKey struct { + // OdataType - Possible values include: 'OdataTypeContentKeyPolicyRestrictionTokenKey', 'OdataTypeMicrosoftMediaContentKeyPolicySymmetricTokenKey', 'OdataTypeMicrosoftMediaContentKeyPolicyRsaTokenKey', 'OdataTypeMicrosoftMediaContentKeyPolicyX509CertificateTokenKey' + OdataType OdataTypeBasicContentKeyPolicyRestrictionTokenKey `json:"@odata.type,omitempty"` +} + +func unmarshalBasicContentKeyPolicyRestrictionTokenKey(body []byte) (BasicContentKeyPolicyRestrictionTokenKey, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["@odata.type"] { + case string(OdataTypeMicrosoftMediaContentKeyPolicySymmetricTokenKey): + var ckpstk ContentKeyPolicySymmetricTokenKey + err := json.Unmarshal(body, &ckpstk) + return ckpstk, err + case string(OdataTypeMicrosoftMediaContentKeyPolicyRsaTokenKey): + var ckprtk ContentKeyPolicyRsaTokenKey + err := json.Unmarshal(body, &ckprtk) + return ckprtk, err + case string(OdataTypeMicrosoftMediaContentKeyPolicyX509CertificateTokenKey): + var ckpxctk ContentKeyPolicyX509CertificateTokenKey + err := json.Unmarshal(body, &ckpxctk) + return ckpxctk, err + default: + var ckprtk ContentKeyPolicyRestrictionTokenKey + err := json.Unmarshal(body, &ckprtk) + return ckprtk, err + } +} +func unmarshalBasicContentKeyPolicyRestrictionTokenKeyArray(body []byte) ([]BasicContentKeyPolicyRestrictionTokenKey, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + ckprtkArray := make([]BasicContentKeyPolicyRestrictionTokenKey, len(rawMessages)) + + for index, rawMessage := range rawMessages { + ckprtk, err := unmarshalBasicContentKeyPolicyRestrictionTokenKey(*rawMessage) + if err != nil { + return nil, err + } + ckprtkArray[index] = ckprtk + } + return ckprtkArray, nil +} + +// MarshalJSON is the custom marshaler for ContentKeyPolicyRestrictionTokenKey. +func (ckprtk ContentKeyPolicyRestrictionTokenKey) MarshalJSON() ([]byte, error) { + ckprtk.OdataType = OdataTypeContentKeyPolicyRestrictionTokenKey + objectMap := make(map[string]interface{}) + if ckprtk.OdataType != "" { + objectMap["@odata.type"] = ckprtk.OdataType + } + return json.Marshal(objectMap) +} + +// AsContentKeyPolicySymmetricTokenKey is the BasicContentKeyPolicyRestrictionTokenKey implementation for ContentKeyPolicyRestrictionTokenKey. +func (ckprtk ContentKeyPolicyRestrictionTokenKey) AsContentKeyPolicySymmetricTokenKey() (*ContentKeyPolicySymmetricTokenKey, bool) { + return nil, false +} + +// AsContentKeyPolicyRsaTokenKey is the BasicContentKeyPolicyRestrictionTokenKey implementation for ContentKeyPolicyRestrictionTokenKey. +func (ckprtk ContentKeyPolicyRestrictionTokenKey) AsContentKeyPolicyRsaTokenKey() (*ContentKeyPolicyRsaTokenKey, bool) { + return nil, false +} + +// AsContentKeyPolicyX509CertificateTokenKey is the BasicContentKeyPolicyRestrictionTokenKey implementation for ContentKeyPolicyRestrictionTokenKey. +func (ckprtk ContentKeyPolicyRestrictionTokenKey) AsContentKeyPolicyX509CertificateTokenKey() (*ContentKeyPolicyX509CertificateTokenKey, bool) { + return nil, false +} + +// AsContentKeyPolicyRestrictionTokenKey is the BasicContentKeyPolicyRestrictionTokenKey implementation for ContentKeyPolicyRestrictionTokenKey. +func (ckprtk ContentKeyPolicyRestrictionTokenKey) AsContentKeyPolicyRestrictionTokenKey() (*ContentKeyPolicyRestrictionTokenKey, bool) { + return &ckprtk, true +} + +// AsBasicContentKeyPolicyRestrictionTokenKey is the BasicContentKeyPolicyRestrictionTokenKey implementation for ContentKeyPolicyRestrictionTokenKey. +func (ckprtk ContentKeyPolicyRestrictionTokenKey) AsBasicContentKeyPolicyRestrictionTokenKey() (BasicContentKeyPolicyRestrictionTokenKey, bool) { + return &ckprtk, true +} + +// ContentKeyPolicyRsaTokenKey specifies a RSA key for token validation +type ContentKeyPolicyRsaTokenKey struct { + // Exponent - The RSA Parameter exponent + Exponent *[]byte `json:"exponent,omitempty"` + // Modulus - The RSA Parameter modulus + Modulus *[]byte `json:"modulus,omitempty"` + // OdataType - Possible values include: 'OdataTypeContentKeyPolicyRestrictionTokenKey', 'OdataTypeMicrosoftMediaContentKeyPolicySymmetricTokenKey', 'OdataTypeMicrosoftMediaContentKeyPolicyRsaTokenKey', 'OdataTypeMicrosoftMediaContentKeyPolicyX509CertificateTokenKey' + OdataType OdataTypeBasicContentKeyPolicyRestrictionTokenKey `json:"@odata.type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ContentKeyPolicyRsaTokenKey. +func (ckprtk ContentKeyPolicyRsaTokenKey) MarshalJSON() ([]byte, error) { + ckprtk.OdataType = OdataTypeMicrosoftMediaContentKeyPolicyRsaTokenKey + objectMap := make(map[string]interface{}) + if ckprtk.Exponent != nil { + objectMap["exponent"] = ckprtk.Exponent + } + if ckprtk.Modulus != nil { + objectMap["modulus"] = ckprtk.Modulus + } + if ckprtk.OdataType != "" { + objectMap["@odata.type"] = ckprtk.OdataType + } + return json.Marshal(objectMap) +} + +// AsContentKeyPolicySymmetricTokenKey is the BasicContentKeyPolicyRestrictionTokenKey implementation for ContentKeyPolicyRsaTokenKey. +func (ckprtk ContentKeyPolicyRsaTokenKey) AsContentKeyPolicySymmetricTokenKey() (*ContentKeyPolicySymmetricTokenKey, bool) { + return nil, false +} + +// AsContentKeyPolicyRsaTokenKey is the BasicContentKeyPolicyRestrictionTokenKey implementation for ContentKeyPolicyRsaTokenKey. +func (ckprtk ContentKeyPolicyRsaTokenKey) AsContentKeyPolicyRsaTokenKey() (*ContentKeyPolicyRsaTokenKey, bool) { + return &ckprtk, true +} + +// AsContentKeyPolicyX509CertificateTokenKey is the BasicContentKeyPolicyRestrictionTokenKey implementation for ContentKeyPolicyRsaTokenKey. +func (ckprtk ContentKeyPolicyRsaTokenKey) AsContentKeyPolicyX509CertificateTokenKey() (*ContentKeyPolicyX509CertificateTokenKey, bool) { + return nil, false +} + +// AsContentKeyPolicyRestrictionTokenKey is the BasicContentKeyPolicyRestrictionTokenKey implementation for ContentKeyPolicyRsaTokenKey. +func (ckprtk ContentKeyPolicyRsaTokenKey) AsContentKeyPolicyRestrictionTokenKey() (*ContentKeyPolicyRestrictionTokenKey, bool) { + return nil, false +} + +// AsBasicContentKeyPolicyRestrictionTokenKey is the BasicContentKeyPolicyRestrictionTokenKey implementation for ContentKeyPolicyRsaTokenKey. +func (ckprtk ContentKeyPolicyRsaTokenKey) AsBasicContentKeyPolicyRestrictionTokenKey() (BasicContentKeyPolicyRestrictionTokenKey, bool) { + return &ckprtk, true +} + +// ContentKeyPolicySymmetricTokenKey specifies a symmetric key for token validation. +type ContentKeyPolicySymmetricTokenKey struct { + // KeyValue - The key value of the key + KeyValue *[]byte `json:"keyValue,omitempty"` + // OdataType - Possible values include: 'OdataTypeContentKeyPolicyRestrictionTokenKey', 'OdataTypeMicrosoftMediaContentKeyPolicySymmetricTokenKey', 'OdataTypeMicrosoftMediaContentKeyPolicyRsaTokenKey', 'OdataTypeMicrosoftMediaContentKeyPolicyX509CertificateTokenKey' + OdataType OdataTypeBasicContentKeyPolicyRestrictionTokenKey `json:"@odata.type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ContentKeyPolicySymmetricTokenKey. +func (ckpstk ContentKeyPolicySymmetricTokenKey) MarshalJSON() ([]byte, error) { + ckpstk.OdataType = OdataTypeMicrosoftMediaContentKeyPolicySymmetricTokenKey + objectMap := make(map[string]interface{}) + if ckpstk.KeyValue != nil { + objectMap["keyValue"] = ckpstk.KeyValue + } + if ckpstk.OdataType != "" { + objectMap["@odata.type"] = ckpstk.OdataType + } + return json.Marshal(objectMap) +} + +// AsContentKeyPolicySymmetricTokenKey is the BasicContentKeyPolicyRestrictionTokenKey implementation for ContentKeyPolicySymmetricTokenKey. +func (ckpstk ContentKeyPolicySymmetricTokenKey) AsContentKeyPolicySymmetricTokenKey() (*ContentKeyPolicySymmetricTokenKey, bool) { + return &ckpstk, true +} + +// AsContentKeyPolicyRsaTokenKey is the BasicContentKeyPolicyRestrictionTokenKey implementation for ContentKeyPolicySymmetricTokenKey. +func (ckpstk ContentKeyPolicySymmetricTokenKey) AsContentKeyPolicyRsaTokenKey() (*ContentKeyPolicyRsaTokenKey, bool) { + return nil, false +} + +// AsContentKeyPolicyX509CertificateTokenKey is the BasicContentKeyPolicyRestrictionTokenKey implementation for ContentKeyPolicySymmetricTokenKey. +func (ckpstk ContentKeyPolicySymmetricTokenKey) AsContentKeyPolicyX509CertificateTokenKey() (*ContentKeyPolicyX509CertificateTokenKey, bool) { + return nil, false +} + +// AsContentKeyPolicyRestrictionTokenKey is the BasicContentKeyPolicyRestrictionTokenKey implementation for ContentKeyPolicySymmetricTokenKey. +func (ckpstk ContentKeyPolicySymmetricTokenKey) AsContentKeyPolicyRestrictionTokenKey() (*ContentKeyPolicyRestrictionTokenKey, bool) { + return nil, false +} + +// AsBasicContentKeyPolicyRestrictionTokenKey is the BasicContentKeyPolicyRestrictionTokenKey implementation for ContentKeyPolicySymmetricTokenKey. +func (ckpstk ContentKeyPolicySymmetricTokenKey) AsBasicContentKeyPolicyRestrictionTokenKey() (BasicContentKeyPolicyRestrictionTokenKey, bool) { + return &ckpstk, true +} + +// ContentKeyPolicyTokenClaim represents a token claim. +type ContentKeyPolicyTokenClaim struct { + // ClaimType - Token claim type. + ClaimType *string `json:"claimType,omitempty"` + // ClaimValue - Token claim value. + ClaimValue *string `json:"claimValue,omitempty"` +} + +// ContentKeyPolicyTokenRestriction represents a token restriction. Provided token must match these requirements +// for successful license or key delivery. +type ContentKeyPolicyTokenRestriction struct { + // Issuer - The token issuer. + Issuer *string `json:"issuer,omitempty"` + // Audience - The audience for the token. + Audience *string `json:"audience,omitempty"` + // PrimaryVerificationKey - The primary verification key. + PrimaryVerificationKey BasicContentKeyPolicyRestrictionTokenKey `json:"primaryVerificationKey,omitempty"` + // AlternateVerificationKeys - A list of alternative verification keys. + AlternateVerificationKeys *[]BasicContentKeyPolicyRestrictionTokenKey `json:"alternateVerificationKeys,omitempty"` + // RequiredClaims - A list of required token claims. + RequiredClaims *[]ContentKeyPolicyTokenClaim `json:"requiredClaims,omitempty"` + // RestrictionTokenType - The type of token. Possible values include: 'ContentKeyPolicyRestrictionTokenTypeUnknown', 'ContentKeyPolicyRestrictionTokenTypeSwt', 'ContentKeyPolicyRestrictionTokenTypeJwt' + RestrictionTokenType ContentKeyPolicyRestrictionTokenType `json:"restrictionTokenType,omitempty"` + // OpenIDConnectDiscoveryDocument - The OpenID connect discovery document. + OpenIDConnectDiscoveryDocument *string `json:"openIdConnectDiscoveryDocument,omitempty"` + // OdataType - Possible values include: 'OdataTypeContentKeyPolicyRestriction', 'OdataTypeMicrosoftMediaContentKeyPolicyOpenRestriction', 'OdataTypeMicrosoftMediaContentKeyPolicyUnknownRestriction', 'OdataTypeMicrosoftMediaContentKeyPolicyTokenRestriction' + OdataType OdataTypeBasicContentKeyPolicyRestriction `json:"@odata.type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ContentKeyPolicyTokenRestriction. +func (ckptr ContentKeyPolicyTokenRestriction) MarshalJSON() ([]byte, error) { + ckptr.OdataType = OdataTypeMicrosoftMediaContentKeyPolicyTokenRestriction + objectMap := make(map[string]interface{}) + if ckptr.Issuer != nil { + objectMap["issuer"] = ckptr.Issuer + } + if ckptr.Audience != nil { + objectMap["audience"] = ckptr.Audience + } + objectMap["primaryVerificationKey"] = ckptr.PrimaryVerificationKey + if ckptr.AlternateVerificationKeys != nil { + objectMap["alternateVerificationKeys"] = ckptr.AlternateVerificationKeys + } + if ckptr.RequiredClaims != nil { + objectMap["requiredClaims"] = ckptr.RequiredClaims + } + if ckptr.RestrictionTokenType != "" { + objectMap["restrictionTokenType"] = ckptr.RestrictionTokenType + } + if ckptr.OpenIDConnectDiscoveryDocument != nil { + objectMap["openIdConnectDiscoveryDocument"] = ckptr.OpenIDConnectDiscoveryDocument + } + if ckptr.OdataType != "" { + objectMap["@odata.type"] = ckptr.OdataType + } + return json.Marshal(objectMap) +} + +// AsContentKeyPolicyOpenRestriction is the BasicContentKeyPolicyRestriction implementation for ContentKeyPolicyTokenRestriction. +func (ckptr ContentKeyPolicyTokenRestriction) AsContentKeyPolicyOpenRestriction() (*ContentKeyPolicyOpenRestriction, bool) { + return nil, false +} + +// AsContentKeyPolicyUnknownRestriction is the BasicContentKeyPolicyRestriction implementation for ContentKeyPolicyTokenRestriction. +func (ckptr ContentKeyPolicyTokenRestriction) AsContentKeyPolicyUnknownRestriction() (*ContentKeyPolicyUnknownRestriction, bool) { + return nil, false +} + +// AsContentKeyPolicyTokenRestriction is the BasicContentKeyPolicyRestriction implementation for ContentKeyPolicyTokenRestriction. +func (ckptr ContentKeyPolicyTokenRestriction) AsContentKeyPolicyTokenRestriction() (*ContentKeyPolicyTokenRestriction, bool) { + return &ckptr, true +} + +// AsContentKeyPolicyRestriction is the BasicContentKeyPolicyRestriction implementation for ContentKeyPolicyTokenRestriction. +func (ckptr ContentKeyPolicyTokenRestriction) AsContentKeyPolicyRestriction() (*ContentKeyPolicyRestriction, bool) { + return nil, false +} + +// AsBasicContentKeyPolicyRestriction is the BasicContentKeyPolicyRestriction implementation for ContentKeyPolicyTokenRestriction. +func (ckptr ContentKeyPolicyTokenRestriction) AsBasicContentKeyPolicyRestriction() (BasicContentKeyPolicyRestriction, bool) { + return &ckptr, true +} + +// UnmarshalJSON is the custom unmarshaler for ContentKeyPolicyTokenRestriction struct. +func (ckptr *ContentKeyPolicyTokenRestriction) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "issuer": + if v != nil { + var issuer string + err = json.Unmarshal(*v, &issuer) + if err != nil { + return err + } + ckptr.Issuer = &issuer + } + case "audience": + if v != nil { + var audience string + err = json.Unmarshal(*v, &audience) + if err != nil { + return err + } + ckptr.Audience = &audience + } + case "primaryVerificationKey": + if v != nil { + primaryVerificationKey, err := unmarshalBasicContentKeyPolicyRestrictionTokenKey(*v) + if err != nil { + return err + } + ckptr.PrimaryVerificationKey = primaryVerificationKey + } + case "alternateVerificationKeys": + if v != nil { + alternateVerificationKeys, err := unmarshalBasicContentKeyPolicyRestrictionTokenKeyArray(*v) + if err != nil { + return err + } + ckptr.AlternateVerificationKeys = &alternateVerificationKeys + } + case "requiredClaims": + if v != nil { + var requiredClaims []ContentKeyPolicyTokenClaim + err = json.Unmarshal(*v, &requiredClaims) + if err != nil { + return err + } + ckptr.RequiredClaims = &requiredClaims + } + case "restrictionTokenType": + if v != nil { + var restrictionTokenType ContentKeyPolicyRestrictionTokenType + err = json.Unmarshal(*v, &restrictionTokenType) + if err != nil { + return err + } + ckptr.RestrictionTokenType = restrictionTokenType + } + case "openIdConnectDiscoveryDocument": + if v != nil { + var openIDConnectDiscoveryDocument string + err = json.Unmarshal(*v, &openIDConnectDiscoveryDocument) + if err != nil { + return err + } + ckptr.OpenIDConnectDiscoveryDocument = &openIDConnectDiscoveryDocument + } + case "@odata.type": + if v != nil { + var odataType OdataTypeBasicContentKeyPolicyRestriction + err = json.Unmarshal(*v, &odataType) + if err != nil { + return err + } + ckptr.OdataType = odataType + } + } + } + + return nil +} + +// ContentKeyPolicyUnknownConfiguration represents a ContentKeyPolicyConfiguration that is unavailable in the +// current API version. +type ContentKeyPolicyUnknownConfiguration struct { + // OdataType - Possible values include: 'OdataTypeContentKeyPolicyConfiguration', 'OdataTypeMicrosoftMediaContentKeyPolicyClearKeyConfiguration', 'OdataTypeMicrosoftMediaContentKeyPolicyUnknownConfiguration', 'OdataTypeMicrosoftMediaContentKeyPolicyWidevineConfiguration', 'OdataTypeMicrosoftMediaContentKeyPolicyPlayReadyConfiguration', 'OdataTypeMicrosoftMediaContentKeyPolicyFairPlayConfiguration' + OdataType OdataTypeBasicContentKeyPolicyConfiguration `json:"@odata.type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ContentKeyPolicyUnknownConfiguration. +func (ckpuc ContentKeyPolicyUnknownConfiguration) MarshalJSON() ([]byte, error) { + ckpuc.OdataType = OdataTypeMicrosoftMediaContentKeyPolicyUnknownConfiguration + objectMap := make(map[string]interface{}) + if ckpuc.OdataType != "" { + objectMap["@odata.type"] = ckpuc.OdataType + } + return json.Marshal(objectMap) +} + +// AsContentKeyPolicyClearKeyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyUnknownConfiguration. +func (ckpuc ContentKeyPolicyUnknownConfiguration) AsContentKeyPolicyClearKeyConfiguration() (*ContentKeyPolicyClearKeyConfiguration, bool) { + return nil, false +} + +// AsContentKeyPolicyUnknownConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyUnknownConfiguration. +func (ckpuc ContentKeyPolicyUnknownConfiguration) AsContentKeyPolicyUnknownConfiguration() (*ContentKeyPolicyUnknownConfiguration, bool) { + return &ckpuc, true +} + +// AsContentKeyPolicyWidevineConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyUnknownConfiguration. +func (ckpuc ContentKeyPolicyUnknownConfiguration) AsContentKeyPolicyWidevineConfiguration() (*ContentKeyPolicyWidevineConfiguration, bool) { + return nil, false +} + +// AsContentKeyPolicyPlayReadyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyUnknownConfiguration. +func (ckpuc ContentKeyPolicyUnknownConfiguration) AsContentKeyPolicyPlayReadyConfiguration() (*ContentKeyPolicyPlayReadyConfiguration, bool) { + return nil, false +} + +// AsContentKeyPolicyFairPlayConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyUnknownConfiguration. +func (ckpuc ContentKeyPolicyUnknownConfiguration) AsContentKeyPolicyFairPlayConfiguration() (*ContentKeyPolicyFairPlayConfiguration, bool) { + return nil, false +} + +// AsContentKeyPolicyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyUnknownConfiguration. +func (ckpuc ContentKeyPolicyUnknownConfiguration) AsContentKeyPolicyConfiguration() (*ContentKeyPolicyConfiguration, bool) { + return nil, false +} + +// AsBasicContentKeyPolicyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyUnknownConfiguration. +func (ckpuc ContentKeyPolicyUnknownConfiguration) AsBasicContentKeyPolicyConfiguration() (BasicContentKeyPolicyConfiguration, bool) { + return &ckpuc, true +} + +// ContentKeyPolicyUnknownRestriction represents a ContentKeyPolicyRestriction that is unavailable in the current +// API version. +type ContentKeyPolicyUnknownRestriction struct { + // OdataType - Possible values include: 'OdataTypeContentKeyPolicyRestriction', 'OdataTypeMicrosoftMediaContentKeyPolicyOpenRestriction', 'OdataTypeMicrosoftMediaContentKeyPolicyUnknownRestriction', 'OdataTypeMicrosoftMediaContentKeyPolicyTokenRestriction' + OdataType OdataTypeBasicContentKeyPolicyRestriction `json:"@odata.type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ContentKeyPolicyUnknownRestriction. +func (ckpur ContentKeyPolicyUnknownRestriction) MarshalJSON() ([]byte, error) { + ckpur.OdataType = OdataTypeMicrosoftMediaContentKeyPolicyUnknownRestriction + objectMap := make(map[string]interface{}) + if ckpur.OdataType != "" { + objectMap["@odata.type"] = ckpur.OdataType + } + return json.Marshal(objectMap) +} + +// AsContentKeyPolicyOpenRestriction is the BasicContentKeyPolicyRestriction implementation for ContentKeyPolicyUnknownRestriction. +func (ckpur ContentKeyPolicyUnknownRestriction) AsContentKeyPolicyOpenRestriction() (*ContentKeyPolicyOpenRestriction, bool) { + return nil, false +} + +// AsContentKeyPolicyUnknownRestriction is the BasicContentKeyPolicyRestriction implementation for ContentKeyPolicyUnknownRestriction. +func (ckpur ContentKeyPolicyUnknownRestriction) AsContentKeyPolicyUnknownRestriction() (*ContentKeyPolicyUnknownRestriction, bool) { + return &ckpur, true +} + +// AsContentKeyPolicyTokenRestriction is the BasicContentKeyPolicyRestriction implementation for ContentKeyPolicyUnknownRestriction. +func (ckpur ContentKeyPolicyUnknownRestriction) AsContentKeyPolicyTokenRestriction() (*ContentKeyPolicyTokenRestriction, bool) { + return nil, false +} + +// AsContentKeyPolicyRestriction is the BasicContentKeyPolicyRestriction implementation for ContentKeyPolicyUnknownRestriction. +func (ckpur ContentKeyPolicyUnknownRestriction) AsContentKeyPolicyRestriction() (*ContentKeyPolicyRestriction, bool) { + return nil, false +} + +// AsBasicContentKeyPolicyRestriction is the BasicContentKeyPolicyRestriction implementation for ContentKeyPolicyUnknownRestriction. +func (ckpur ContentKeyPolicyUnknownRestriction) AsBasicContentKeyPolicyRestriction() (BasicContentKeyPolicyRestriction, bool) { + return &ckpur, true +} + +// ContentKeyPolicyWidevineConfiguration specifies a configuration for Widevine licenses. +type ContentKeyPolicyWidevineConfiguration struct { + // WidevineTemplate - The Widevine template. + WidevineTemplate *string `json:"widevineTemplate,omitempty"` + // OdataType - Possible values include: 'OdataTypeContentKeyPolicyConfiguration', 'OdataTypeMicrosoftMediaContentKeyPolicyClearKeyConfiguration', 'OdataTypeMicrosoftMediaContentKeyPolicyUnknownConfiguration', 'OdataTypeMicrosoftMediaContentKeyPolicyWidevineConfiguration', 'OdataTypeMicrosoftMediaContentKeyPolicyPlayReadyConfiguration', 'OdataTypeMicrosoftMediaContentKeyPolicyFairPlayConfiguration' + OdataType OdataTypeBasicContentKeyPolicyConfiguration `json:"@odata.type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ContentKeyPolicyWidevineConfiguration. +func (ckpwc ContentKeyPolicyWidevineConfiguration) MarshalJSON() ([]byte, error) { + ckpwc.OdataType = OdataTypeMicrosoftMediaContentKeyPolicyWidevineConfiguration + objectMap := make(map[string]interface{}) + if ckpwc.WidevineTemplate != nil { + objectMap["widevineTemplate"] = ckpwc.WidevineTemplate + } + if ckpwc.OdataType != "" { + objectMap["@odata.type"] = ckpwc.OdataType + } + return json.Marshal(objectMap) +} + +// AsContentKeyPolicyClearKeyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyWidevineConfiguration. +func (ckpwc ContentKeyPolicyWidevineConfiguration) AsContentKeyPolicyClearKeyConfiguration() (*ContentKeyPolicyClearKeyConfiguration, bool) { + return nil, false +} + +// AsContentKeyPolicyUnknownConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyWidevineConfiguration. +func (ckpwc ContentKeyPolicyWidevineConfiguration) AsContentKeyPolicyUnknownConfiguration() (*ContentKeyPolicyUnknownConfiguration, bool) { + return nil, false +} + +// AsContentKeyPolicyWidevineConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyWidevineConfiguration. +func (ckpwc ContentKeyPolicyWidevineConfiguration) AsContentKeyPolicyWidevineConfiguration() (*ContentKeyPolicyWidevineConfiguration, bool) { + return &ckpwc, true +} + +// AsContentKeyPolicyPlayReadyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyWidevineConfiguration. +func (ckpwc ContentKeyPolicyWidevineConfiguration) AsContentKeyPolicyPlayReadyConfiguration() (*ContentKeyPolicyPlayReadyConfiguration, bool) { + return nil, false +} + +// AsContentKeyPolicyFairPlayConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyWidevineConfiguration. +func (ckpwc ContentKeyPolicyWidevineConfiguration) AsContentKeyPolicyFairPlayConfiguration() (*ContentKeyPolicyFairPlayConfiguration, bool) { + return nil, false +} + +// AsContentKeyPolicyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyWidevineConfiguration. +func (ckpwc ContentKeyPolicyWidevineConfiguration) AsContentKeyPolicyConfiguration() (*ContentKeyPolicyConfiguration, bool) { + return nil, false +} + +// AsBasicContentKeyPolicyConfiguration is the BasicContentKeyPolicyConfiguration implementation for ContentKeyPolicyWidevineConfiguration. +func (ckpwc ContentKeyPolicyWidevineConfiguration) AsBasicContentKeyPolicyConfiguration() (BasicContentKeyPolicyConfiguration, bool) { + return &ckpwc, true +} + +// ContentKeyPolicyX509CertificateTokenKey specifies a certificate for token validation. +type ContentKeyPolicyX509CertificateTokenKey struct { + // RawBody - The raw data field of a certificate in PKCS 12 format (X509Certificate2 in .NET) + RawBody *[]byte `json:"rawBody,omitempty"` + // OdataType - Possible values include: 'OdataTypeContentKeyPolicyRestrictionTokenKey', 'OdataTypeMicrosoftMediaContentKeyPolicySymmetricTokenKey', 'OdataTypeMicrosoftMediaContentKeyPolicyRsaTokenKey', 'OdataTypeMicrosoftMediaContentKeyPolicyX509CertificateTokenKey' + OdataType OdataTypeBasicContentKeyPolicyRestrictionTokenKey `json:"@odata.type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ContentKeyPolicyX509CertificateTokenKey. +func (ckpxctk ContentKeyPolicyX509CertificateTokenKey) MarshalJSON() ([]byte, error) { + ckpxctk.OdataType = OdataTypeMicrosoftMediaContentKeyPolicyX509CertificateTokenKey + objectMap := make(map[string]interface{}) + if ckpxctk.RawBody != nil { + objectMap["rawBody"] = ckpxctk.RawBody + } + if ckpxctk.OdataType != "" { + objectMap["@odata.type"] = ckpxctk.OdataType + } + return json.Marshal(objectMap) +} + +// AsContentKeyPolicySymmetricTokenKey is the BasicContentKeyPolicyRestrictionTokenKey implementation for ContentKeyPolicyX509CertificateTokenKey. +func (ckpxctk ContentKeyPolicyX509CertificateTokenKey) AsContentKeyPolicySymmetricTokenKey() (*ContentKeyPolicySymmetricTokenKey, bool) { + return nil, false +} + +// AsContentKeyPolicyRsaTokenKey is the BasicContentKeyPolicyRestrictionTokenKey implementation for ContentKeyPolicyX509CertificateTokenKey. +func (ckpxctk ContentKeyPolicyX509CertificateTokenKey) AsContentKeyPolicyRsaTokenKey() (*ContentKeyPolicyRsaTokenKey, bool) { + return nil, false +} + +// AsContentKeyPolicyX509CertificateTokenKey is the BasicContentKeyPolicyRestrictionTokenKey implementation for ContentKeyPolicyX509CertificateTokenKey. +func (ckpxctk ContentKeyPolicyX509CertificateTokenKey) AsContentKeyPolicyX509CertificateTokenKey() (*ContentKeyPolicyX509CertificateTokenKey, bool) { + return &ckpxctk, true +} + +// AsContentKeyPolicyRestrictionTokenKey is the BasicContentKeyPolicyRestrictionTokenKey implementation for ContentKeyPolicyX509CertificateTokenKey. +func (ckpxctk ContentKeyPolicyX509CertificateTokenKey) AsContentKeyPolicyRestrictionTokenKey() (*ContentKeyPolicyRestrictionTokenKey, bool) { + return nil, false +} + +// AsBasicContentKeyPolicyRestrictionTokenKey is the BasicContentKeyPolicyRestrictionTokenKey implementation for ContentKeyPolicyX509CertificateTokenKey. +func (ckpxctk ContentKeyPolicyX509CertificateTokenKey) AsBasicContentKeyPolicyRestrictionTokenKey() (BasicContentKeyPolicyRestrictionTokenKey, bool) { + return &ckpxctk, true +} + +// CopyAudio a codec flag, which tells the encoder to copy the input audio bitstream. +type CopyAudio struct { + // Label - An optional label for the codec. The label can be used to control muxing behavior. + Label *string `json:"label,omitempty"` + // OdataType - Possible values include: 'OdataTypeCodec', 'OdataTypeMicrosoftMediaAudio', 'OdataTypeMicrosoftMediaAacAudio', 'OdataTypeMicrosoftMediaCopyVideo', 'OdataTypeMicrosoftMediaVideo', 'OdataTypeMicrosoftMediaImage', 'OdataTypeMicrosoftMediaCopyAudio', 'OdataTypeMicrosoftMediaH264Video', 'OdataTypeMicrosoftMediaJpgImage', 'OdataTypeMicrosoftMediaPngImage' + OdataType OdataTypeBasicCodec `json:"@odata.type,omitempty"` +} + +// MarshalJSON is the custom marshaler for CopyAudio. +func (ca CopyAudio) MarshalJSON() ([]byte, error) { + ca.OdataType = OdataTypeMicrosoftMediaCopyAudio + objectMap := make(map[string]interface{}) + if ca.Label != nil { + objectMap["label"] = ca.Label + } + if ca.OdataType != "" { + objectMap["@odata.type"] = ca.OdataType + } + return json.Marshal(objectMap) +} + +// AsAudio is the BasicCodec implementation for CopyAudio. +func (ca CopyAudio) AsAudio() (*Audio, bool) { + return nil, false +} + +// AsBasicAudio is the BasicCodec implementation for CopyAudio. +func (ca CopyAudio) AsBasicAudio() (BasicAudio, bool) { + return nil, false +} + +// AsAacAudio is the BasicCodec implementation for CopyAudio. +func (ca CopyAudio) AsAacAudio() (*AacAudio, bool) { + return nil, false +} + +// AsCopyVideo is the BasicCodec implementation for CopyAudio. +func (ca CopyAudio) AsCopyVideo() (*CopyVideo, bool) { + return nil, false +} + +// AsVideo is the BasicCodec implementation for CopyAudio. +func (ca CopyAudio) AsVideo() (*Video, bool) { + return nil, false +} + +// AsBasicVideo is the BasicCodec implementation for CopyAudio. +func (ca CopyAudio) AsBasicVideo() (BasicVideo, bool) { + return nil, false +} + +// AsImage is the BasicCodec implementation for CopyAudio. +func (ca CopyAudio) AsImage() (*Image, bool) { + return nil, false +} + +// AsBasicImage is the BasicCodec implementation for CopyAudio. +func (ca CopyAudio) AsBasicImage() (BasicImage, bool) { + return nil, false +} + +// AsCopyAudio is the BasicCodec implementation for CopyAudio. +func (ca CopyAudio) AsCopyAudio() (*CopyAudio, bool) { + return &ca, true +} + +// AsH264Video is the BasicCodec implementation for CopyAudio. +func (ca CopyAudio) AsH264Video() (*H264Video, bool) { + return nil, false +} + +// AsJpgImage is the BasicCodec implementation for CopyAudio. +func (ca CopyAudio) AsJpgImage() (*JpgImage, bool) { + return nil, false +} + +// AsPngImage is the BasicCodec implementation for CopyAudio. +func (ca CopyAudio) AsPngImage() (*PngImage, bool) { + return nil, false +} + +// AsCodec is the BasicCodec implementation for CopyAudio. +func (ca CopyAudio) AsCodec() (*Codec, bool) { + return nil, false +} + +// AsBasicCodec is the BasicCodec implementation for CopyAudio. +func (ca CopyAudio) AsBasicCodec() (BasicCodec, bool) { + return &ca, true +} + +// CopyVideo a codec flag, which tells the encoder to copy the input video bitstream without re-encoding. +type CopyVideo struct { + // Label - An optional label for the codec. The label can be used to control muxing behavior. + Label *string `json:"label,omitempty"` + // OdataType - Possible values include: 'OdataTypeCodec', 'OdataTypeMicrosoftMediaAudio', 'OdataTypeMicrosoftMediaAacAudio', 'OdataTypeMicrosoftMediaCopyVideo', 'OdataTypeMicrosoftMediaVideo', 'OdataTypeMicrosoftMediaImage', 'OdataTypeMicrosoftMediaCopyAudio', 'OdataTypeMicrosoftMediaH264Video', 'OdataTypeMicrosoftMediaJpgImage', 'OdataTypeMicrosoftMediaPngImage' + OdataType OdataTypeBasicCodec `json:"@odata.type,omitempty"` +} + +// MarshalJSON is the custom marshaler for CopyVideo. +func (cv CopyVideo) MarshalJSON() ([]byte, error) { + cv.OdataType = OdataTypeMicrosoftMediaCopyVideo + objectMap := make(map[string]interface{}) + if cv.Label != nil { + objectMap["label"] = cv.Label + } + if cv.OdataType != "" { + objectMap["@odata.type"] = cv.OdataType + } + return json.Marshal(objectMap) +} + +// AsAudio is the BasicCodec implementation for CopyVideo. +func (cv CopyVideo) AsAudio() (*Audio, bool) { + return nil, false +} + +// AsBasicAudio is the BasicCodec implementation for CopyVideo. +func (cv CopyVideo) AsBasicAudio() (BasicAudio, bool) { + return nil, false +} + +// AsAacAudio is the BasicCodec implementation for CopyVideo. +func (cv CopyVideo) AsAacAudio() (*AacAudio, bool) { + return nil, false +} + +// AsCopyVideo is the BasicCodec implementation for CopyVideo. +func (cv CopyVideo) AsCopyVideo() (*CopyVideo, bool) { + return &cv, true +} + +// AsVideo is the BasicCodec implementation for CopyVideo. +func (cv CopyVideo) AsVideo() (*Video, bool) { + return nil, false +} + +// AsBasicVideo is the BasicCodec implementation for CopyVideo. +func (cv CopyVideo) AsBasicVideo() (BasicVideo, bool) { + return nil, false +} + +// AsImage is the BasicCodec implementation for CopyVideo. +func (cv CopyVideo) AsImage() (*Image, bool) { + return nil, false +} + +// AsBasicImage is the BasicCodec implementation for CopyVideo. +func (cv CopyVideo) AsBasicImage() (BasicImage, bool) { + return nil, false +} + +// AsCopyAudio is the BasicCodec implementation for CopyVideo. +func (cv CopyVideo) AsCopyAudio() (*CopyAudio, bool) { + return nil, false +} + +// AsH264Video is the BasicCodec implementation for CopyVideo. +func (cv CopyVideo) AsH264Video() (*H264Video, bool) { + return nil, false +} + +// AsJpgImage is the BasicCodec implementation for CopyVideo. +func (cv CopyVideo) AsJpgImage() (*JpgImage, bool) { + return nil, false +} + +// AsPngImage is the BasicCodec implementation for CopyVideo. +func (cv CopyVideo) AsPngImage() (*PngImage, bool) { + return nil, false +} + +// AsCodec is the BasicCodec implementation for CopyVideo. +func (cv CopyVideo) AsCodec() (*Codec, bool) { + return nil, false +} + +// AsBasicCodec is the BasicCodec implementation for CopyVideo. +func (cv CopyVideo) AsBasicCodec() (BasicCodec, bool) { + return &cv, true +} + +// CrossSiteAccessPolicies the client access policy. +type CrossSiteAccessPolicies struct { + // ClientAccessPolicy - The content of clientaccesspolicy.xml used by Silverlight. + ClientAccessPolicy *string `json:"clientAccessPolicy,omitempty"` + // CrossDomainPolicy - The content of crossdomain.xml used by Silverlight. + CrossDomainPolicy *string `json:"crossDomainPolicy,omitempty"` +} + +// DefaultKey class to specify properties of default content key for each encryption scheme +type DefaultKey struct { + // Label - Label can be used to specify Content Key when creating a Streaming Locator + Label *string `json:"label,omitempty"` + // PolicyName - Policy used by Default Key + PolicyName *string `json:"policyName,omitempty"` +} + +// Deinterlace describes the de-interlacing settings. +type Deinterlace struct { + // Parity - The field parity for de-interlacing, defaults to Auto. Possible values include: 'Auto', 'TopFieldFirst', 'BottomFieldFirst' + Parity DeinterlaceParity `json:"parity,omitempty"` + // Mode - The deinterlacing mode. Defaults to AutoPixelAdaptive. Possible values include: 'Off', 'AutoPixelAdaptive' + Mode DeinterlaceMode `json:"mode,omitempty"` +} + +// EnabledProtocols class to specify which protocols are enabled +type EnabledProtocols struct { + // Download - Enable Download protocol or not + Download *bool `json:"download,omitempty"` + // Dash - Enable DASH protocol or not + Dash *bool `json:"dash,omitempty"` + // Hls - Enable HLS protocol or not + Hls *bool `json:"hls,omitempty"` + // SmoothStreaming - Enable SmoothStreaming protocol or not + SmoothStreaming *bool `json:"smoothStreaming,omitempty"` +} + +// EntityNameAvailabilityCheckOutput the response from the check name availability request. +type EntityNameAvailabilityCheckOutput struct { + autorest.Response `json:"-"` + // NameAvailable - Specifies if the name is available. + NameAvailable *bool `json:"nameAvailable,omitempty"` + // Reason - Specifies the reason if the name is not available. + Reason *string `json:"reason,omitempty"` + // Message - Specifies the detailed reason if the name is not available. + Message *string `json:"message,omitempty"` +} + +// EnvelopeEncryption class for EnvelopeEncryption encryption scheme +type EnvelopeEncryption struct { + // EnabledProtocols - Representing supported protocols + EnabledProtocols *EnabledProtocols `json:"enabledProtocols,omitempty"` + // ClearTracks - Representing which tracks should not be encrypted + ClearTracks *[]TrackSelection `json:"clearTracks,omitempty"` + // ContentKeys - Representing default content key for each encryption scheme and separate content keys for specific tracks + ContentKeys *StreamingPolicyContentKeys `json:"contentKeys,omitempty"` + // CustomKeyAcquisitionURLTemplate - KeyAcquistionUrlTemplate is used to point to user specified service to delivery content keys + CustomKeyAcquisitionURLTemplate *string `json:"customKeyAcquisitionUrlTemplate,omitempty"` +} + +// Filters describes all the filtering operations, such as de-interlacing, rotation etc. that are to be applied to +// the input media before encoding. +type Filters struct { + // Deinterlace - The de-interlacing settings. + Deinterlace *Deinterlace `json:"deinterlace,omitempty"` + // Rotation - The rotation, if any, to be applied to the input video, before it is encoded. Default is Auto. Possible values include: 'RotationAuto', 'RotationNone', 'RotationRotate0', 'RotationRotate90', 'RotationRotate180', 'RotationRotate270' + Rotation Rotation `json:"rotation,omitempty"` + // Crop - The parameters for the rectangular window with which to crop the input video. + Crop *Rectangle `json:"crop,omitempty"` + // Overlays - The properties of overlays to be applied to the input video. These could be audio, image or video overlays. + Overlays *[]BasicOverlay `json:"overlays,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for Filters struct. +func (f *Filters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "deinterlace": + if v != nil { + var deinterlace Deinterlace + err = json.Unmarshal(*v, &deinterlace) + if err != nil { + return err + } + f.Deinterlace = &deinterlace + } + case "rotation": + if v != nil { + var rotation Rotation + err = json.Unmarshal(*v, &rotation) + if err != nil { + return err + } + f.Rotation = rotation + } + case "crop": + if v != nil { + var crop Rectangle + err = json.Unmarshal(*v, &crop) + if err != nil { + return err + } + f.Crop = &crop + } + case "overlays": + if v != nil { + overlays, err := unmarshalBasicOverlayArray(*v) + if err != nil { + return err + } + f.Overlays = &overlays + } + } + } + + return nil +} + +// BasicFormat base class for output. +type BasicFormat interface { + AsImageFormat() (*ImageFormat, bool) + AsBasicImageFormat() (BasicImageFormat, bool) + AsJpgFormat() (*JpgFormat, bool) + AsPngFormat() (*PngFormat, bool) + AsMultiBitrateFormat() (*MultiBitrateFormat, bool) + AsBasicMultiBitrateFormat() (BasicMultiBitrateFormat, bool) + AsMp4Format() (*Mp4Format, bool) + AsTransportStreamFormat() (*TransportStreamFormat, bool) + AsFormat() (*Format, bool) +} + +// Format base class for output. +type Format struct { + // FilenamePattern - The pattern of the file names for the generated output files. The following macros are supported in the file name: {Basename} - The base name of the input video {Extension} - The appropriate extension for this format. {Label} - The label assigned to the codec/layer. {Index} - A unique index for thumbnails. Only applicable to thumbnails. {Bitrate} - The audio/video bitrate. Not applicable to thumbnails. {Codec} - The type of the audio/video codec. Any unsubstituted macros will be collapsed and removed from the filename. + FilenamePattern *string `json:"filenamePattern,omitempty"` + // OdataType - Possible values include: 'OdataTypeFormat', 'OdataTypeMicrosoftMediaImageFormat', 'OdataTypeMicrosoftMediaJpgFormat', 'OdataTypeMicrosoftMediaPngFormat', 'OdataTypeMicrosoftMediaMultiBitrateFormat', 'OdataTypeMicrosoftMediaMp4Format', 'OdataTypeMicrosoftMediaTransportStreamFormat' + OdataType OdataTypeBasicFormat `json:"@odata.type,omitempty"` +} + +func unmarshalBasicFormat(body []byte) (BasicFormat, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["@odata.type"] { + case string(OdataTypeMicrosoftMediaImageFormat): + var ifVar ImageFormat + err := json.Unmarshal(body, &ifVar) + return ifVar, err + case string(OdataTypeMicrosoftMediaJpgFormat): + var jf JpgFormat + err := json.Unmarshal(body, &jf) + return jf, err + case string(OdataTypeMicrosoftMediaPngFormat): + var pf PngFormat + err := json.Unmarshal(body, &pf) + return pf, err + case string(OdataTypeMicrosoftMediaMultiBitrateFormat): + var mbf MultiBitrateFormat + err := json.Unmarshal(body, &mbf) + return mbf, err + case string(OdataTypeMicrosoftMediaMp4Format): + var m4f Mp4Format + err := json.Unmarshal(body, &m4f) + return m4f, err + case string(OdataTypeMicrosoftMediaTransportStreamFormat): + var tsf TransportStreamFormat + err := json.Unmarshal(body, &tsf) + return tsf, err + default: + var f Format + err := json.Unmarshal(body, &f) + return f, err + } +} +func unmarshalBasicFormatArray(body []byte) ([]BasicFormat, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + fArray := make([]BasicFormat, len(rawMessages)) + + for index, rawMessage := range rawMessages { + f, err := unmarshalBasicFormat(*rawMessage) + if err != nil { + return nil, err + } + fArray[index] = f + } + return fArray, nil +} + +// MarshalJSON is the custom marshaler for Format. +func (f Format) MarshalJSON() ([]byte, error) { + f.OdataType = OdataTypeFormat + objectMap := make(map[string]interface{}) + if f.FilenamePattern != nil { + objectMap["filenamePattern"] = f.FilenamePattern + } + if f.OdataType != "" { + objectMap["@odata.type"] = f.OdataType + } + return json.Marshal(objectMap) +} + +// AsImageFormat is the BasicFormat implementation for Format. +func (f Format) AsImageFormat() (*ImageFormat, bool) { + return nil, false +} + +// AsBasicImageFormat is the BasicFormat implementation for Format. +func (f Format) AsBasicImageFormat() (BasicImageFormat, bool) { + return nil, false +} + +// AsJpgFormat is the BasicFormat implementation for Format. +func (f Format) AsJpgFormat() (*JpgFormat, bool) { + return nil, false +} + +// AsPngFormat is the BasicFormat implementation for Format. +func (f Format) AsPngFormat() (*PngFormat, bool) { + return nil, false +} + +// AsMultiBitrateFormat is the BasicFormat implementation for Format. +func (f Format) AsMultiBitrateFormat() (*MultiBitrateFormat, bool) { + return nil, false +} + +// AsBasicMultiBitrateFormat is the BasicFormat implementation for Format. +func (f Format) AsBasicMultiBitrateFormat() (BasicMultiBitrateFormat, bool) { + return nil, false +} + +// AsMp4Format is the BasicFormat implementation for Format. +func (f Format) AsMp4Format() (*Mp4Format, bool) { + return nil, false +} + +// AsTransportStreamFormat is the BasicFormat implementation for Format. +func (f Format) AsTransportStreamFormat() (*TransportStreamFormat, bool) { + return nil, false +} + +// AsFormat is the BasicFormat implementation for Format. +func (f Format) AsFormat() (*Format, bool) { + return &f, true +} + +// AsBasicFormat is the BasicFormat implementation for Format. +func (f Format) AsBasicFormat() (BasicFormat, bool) { + return &f, true +} + +// H264Layer describes the settings to be used when encoding the input video into a desired output bitrate layer +// with the H.264 video codec. +type H264Layer struct { + // Profile - Which profile of the H.264 standard should be used when encoding this layer. Default is Auto. Possible values include: 'H264VideoProfileAuto', 'H264VideoProfileBaseline', 'H264VideoProfileMain', 'H264VideoProfileHigh', 'H264VideoProfileHigh422', 'H264VideoProfileHigh444' + Profile H264VideoProfile `json:"profile,omitempty"` + // Level - Which level of the H.264 standard should be used when encoding this layer. The value can be Auto, or a number that matches the H.264 profile. If not specified, the default is Auto, which lets the encoder choose the Level that is appropriate for this layer. + Level *string `json:"level,omitempty"` + // BufferWindow - The VBV buffer window length. The value should be in ISO 8601 format. The value should be in the range [0.1-100] seconds. The default is 5 seconds (for example, PT5S). + BufferWindow *string `json:"bufferWindow,omitempty"` + // ReferenceFrames - The number of reference frames to be used when encoding this layer. If not specified, the encoder determines an appropriate number based on the encoder complexity setting. + ReferenceFrames *int32 `json:"referenceFrames,omitempty"` + // EntropyMode - The entropy mode to be used for this layer. If not specified, the encoder chooses the mode that is appropriate for the profile and level. Possible values include: 'Cabac', 'Cavlc' + EntropyMode EntropyMode `json:"entropyMode,omitempty"` + // Bitrate - The average bitrate in bits per second at which to encode the input video when generating this layer. This is a required field. + Bitrate *int32 `json:"bitrate,omitempty"` + // MaxBitrate - The maximum bitrate (in bits per second), at which the VBV buffer should be assumed to refill. If not specified, defaults to the same value as bitrate. + MaxBitrate *int32 `json:"maxBitrate,omitempty"` + // BFrames - The number of B-frames to be used when encoding this layer. If not specified, the encoder chooses an appropriate number based on the video profile and level. + BFrames *int32 `json:"bFrames,omitempty"` + // FrameRate - The frame rate (in frames per second) at which to encode this layer. The value can be in the form of M/N where M and N are integers (For example, 30000/1001), or in the form of a number (For example, 30, or 29.97). The encoder enforces constraints on allowed frame rates based on the profile and level. If it is not specified, the encoder will use the same frame rate as the input video. + FrameRate *string `json:"frameRate,omitempty"` + // Slices - The number of slices to be used when encoding this layer. If not specified, default is zero, which means that encoder will use a single slice for each frame. + Slices *int32 `json:"slices,omitempty"` + // AdaptiveBFrame - Whether or not adaptive B-frames are to be used when encoding this layer. If not specified, the encoder will turn it on whenever the video profile permits its use. + AdaptiveBFrame *bool `json:"adaptiveBFrame,omitempty"` + // Width - The width of the output video for this layer. The value can be absolute (in pixels) or relative (in percentage). For example 50% means the output video has half as many pixels in width as the input. + Width *string `json:"width,omitempty"` + // Height - The height of the output video for this layer. The value can be absolute (in pixels) or relative (in percentage). For example 50% means the output video has half as many pixels in height as the input. + Height *string `json:"height,omitempty"` + // Label - The alphanumeric label for this layer, which can be used in multiplexing different video and audio layers, or in naming the output file. + Label *string `json:"label,omitempty"` + // OdataType - Possible values include: 'OdataTypeLayer', 'OdataTypeMicrosoftMediaVideoLayer', 'OdataTypeMicrosoftMediaH264Layer', 'OdataTypeMicrosoftMediaJpgLayer', 'OdataTypeMicrosoftMediaPngLayer' + OdataType OdataTypeBasicLayer `json:"@odata.type,omitempty"` +} + +// MarshalJSON is the custom marshaler for H264Layer. +func (hl H264Layer) MarshalJSON() ([]byte, error) { + hl.OdataType = OdataTypeMicrosoftMediaH264Layer + objectMap := make(map[string]interface{}) + if hl.Profile != "" { + objectMap["profile"] = hl.Profile + } + if hl.Level != nil { + objectMap["level"] = hl.Level + } + if hl.BufferWindow != nil { + objectMap["bufferWindow"] = hl.BufferWindow + } + if hl.ReferenceFrames != nil { + objectMap["referenceFrames"] = hl.ReferenceFrames + } + if hl.EntropyMode != "" { + objectMap["entropyMode"] = hl.EntropyMode + } + if hl.Bitrate != nil { + objectMap["bitrate"] = hl.Bitrate + } + if hl.MaxBitrate != nil { + objectMap["maxBitrate"] = hl.MaxBitrate + } + if hl.BFrames != nil { + objectMap["bFrames"] = hl.BFrames + } + if hl.FrameRate != nil { + objectMap["frameRate"] = hl.FrameRate + } + if hl.Slices != nil { + objectMap["slices"] = hl.Slices + } + if hl.AdaptiveBFrame != nil { + objectMap["adaptiveBFrame"] = hl.AdaptiveBFrame + } + if hl.Width != nil { + objectMap["width"] = hl.Width + } + if hl.Height != nil { + objectMap["height"] = hl.Height + } + if hl.Label != nil { + objectMap["label"] = hl.Label + } + if hl.OdataType != "" { + objectMap["@odata.type"] = hl.OdataType + } + return json.Marshal(objectMap) +} + +// AsVideoLayer is the BasicLayer implementation for H264Layer. +func (hl H264Layer) AsVideoLayer() (*VideoLayer, bool) { + return nil, false +} + +// AsBasicVideoLayer is the BasicLayer implementation for H264Layer. +func (hl H264Layer) AsBasicVideoLayer() (BasicVideoLayer, bool) { + return &hl, true +} + +// AsH264Layer is the BasicLayer implementation for H264Layer. +func (hl H264Layer) AsH264Layer() (*H264Layer, bool) { + return &hl, true +} + +// AsJpgLayer is the BasicLayer implementation for H264Layer. +func (hl H264Layer) AsJpgLayer() (*JpgLayer, bool) { + return nil, false +} + +// AsPngLayer is the BasicLayer implementation for H264Layer. +func (hl H264Layer) AsPngLayer() (*PngLayer, bool) { + return nil, false +} + +// AsLayer is the BasicLayer implementation for H264Layer. +func (hl H264Layer) AsLayer() (*Layer, bool) { + return nil, false +} + +// AsBasicLayer is the BasicLayer implementation for H264Layer. +func (hl H264Layer) AsBasicLayer() (BasicLayer, bool) { + return &hl, true +} + +// H264Video describes all the properties for encoding a video with the H.264 codec. +type H264Video struct { + // SceneChangeDetection - Whether or not the encoder should insert key frames at scene changes. If not specified, the default is false. This flag should be set to true only when the encoder is being configured to produce a single output video. + SceneChangeDetection *bool `json:"sceneChangeDetection,omitempty"` + // Complexity - Tells the encoder how to choose its encoding settings. The default value is Balanced. Possible values include: 'Speed', 'Balanced', 'Quality' + Complexity H264Complexity `json:"complexity,omitempty"` + // Layers - The collection of output H.264 layers to be produced by the encoder. + Layers *[]H264Layer `json:"layers,omitempty"` + // KeyFrameInterval - The distance between two key frames, thereby defining a group of pictures (GOP). The value should be a non-zero integer in the range [1, 30] seconds, specified in ISO 8601 format. The default is 2 seconds (PT2S). + KeyFrameInterval *string `json:"keyFrameInterval,omitempty"` + // StretchMode - The resizing mode - how the input video will be resized to fit the desired output resolution(s). Default is AutoSize. Possible values include: 'StretchModeNone', 'StretchModeAutoSize', 'StretchModeAutoFit' + StretchMode StretchMode `json:"stretchMode,omitempty"` + // Label - An optional label for the codec. The label can be used to control muxing behavior. + Label *string `json:"label,omitempty"` + // OdataType - Possible values include: 'OdataTypeCodec', 'OdataTypeMicrosoftMediaAudio', 'OdataTypeMicrosoftMediaAacAudio', 'OdataTypeMicrosoftMediaCopyVideo', 'OdataTypeMicrosoftMediaVideo', 'OdataTypeMicrosoftMediaImage', 'OdataTypeMicrosoftMediaCopyAudio', 'OdataTypeMicrosoftMediaH264Video', 'OdataTypeMicrosoftMediaJpgImage', 'OdataTypeMicrosoftMediaPngImage' + OdataType OdataTypeBasicCodec `json:"@odata.type,omitempty"` +} + +// MarshalJSON is the custom marshaler for H264Video. +func (hv H264Video) MarshalJSON() ([]byte, error) { + hv.OdataType = OdataTypeMicrosoftMediaH264Video + objectMap := make(map[string]interface{}) + if hv.SceneChangeDetection != nil { + objectMap["sceneChangeDetection"] = hv.SceneChangeDetection + } + if hv.Complexity != "" { + objectMap["complexity"] = hv.Complexity + } + if hv.Layers != nil { + objectMap["layers"] = hv.Layers + } + if hv.KeyFrameInterval != nil { + objectMap["keyFrameInterval"] = hv.KeyFrameInterval + } + if hv.StretchMode != "" { + objectMap["stretchMode"] = hv.StretchMode + } + if hv.Label != nil { + objectMap["label"] = hv.Label + } + if hv.OdataType != "" { + objectMap["@odata.type"] = hv.OdataType + } + return json.Marshal(objectMap) +} + +// AsAudio is the BasicCodec implementation for H264Video. +func (hv H264Video) AsAudio() (*Audio, bool) { + return nil, false +} + +// AsBasicAudio is the BasicCodec implementation for H264Video. +func (hv H264Video) AsBasicAudio() (BasicAudio, bool) { + return nil, false +} + +// AsAacAudio is the BasicCodec implementation for H264Video. +func (hv H264Video) AsAacAudio() (*AacAudio, bool) { + return nil, false +} + +// AsCopyVideo is the BasicCodec implementation for H264Video. +func (hv H264Video) AsCopyVideo() (*CopyVideo, bool) { + return nil, false +} + +// AsVideo is the BasicCodec implementation for H264Video. +func (hv H264Video) AsVideo() (*Video, bool) { + return nil, false +} + +// AsBasicVideo is the BasicCodec implementation for H264Video. +func (hv H264Video) AsBasicVideo() (BasicVideo, bool) { + return &hv, true +} + +// AsImage is the BasicCodec implementation for H264Video. +func (hv H264Video) AsImage() (*Image, bool) { + return nil, false +} + +// AsBasicImage is the BasicCodec implementation for H264Video. +func (hv H264Video) AsBasicImage() (BasicImage, bool) { + return nil, false +} + +// AsCopyAudio is the BasicCodec implementation for H264Video. +func (hv H264Video) AsCopyAudio() (*CopyAudio, bool) { + return nil, false +} + +// AsH264Video is the BasicCodec implementation for H264Video. +func (hv H264Video) AsH264Video() (*H264Video, bool) { + return &hv, true +} + +// AsJpgImage is the BasicCodec implementation for H264Video. +func (hv H264Video) AsJpgImage() (*JpgImage, bool) { + return nil, false +} + +// AsPngImage is the BasicCodec implementation for H264Video. +func (hv H264Video) AsPngImage() (*PngImage, bool) { + return nil, false +} + +// AsCodec is the BasicCodec implementation for H264Video. +func (hv H264Video) AsCodec() (*Codec, bool) { + return nil, false +} + +// AsBasicCodec is the BasicCodec implementation for H264Video. +func (hv H264Video) AsBasicCodec() (BasicCodec, bool) { + return &hv, true +} + +// Hls the HLS configuration. +type Hls struct { + // FragmentsPerTsSegment - The amount of fragments per HTTP Live Streaming (HLS) segment. + FragmentsPerTsSegment *int32 `json:"fragmentsPerTsSegment,omitempty"` +} + +// BasicImage describes the basic properties for generating thumbnails from the input video +type BasicImage interface { + AsJpgImage() (*JpgImage, bool) + AsPngImage() (*PngImage, bool) + AsImage() (*Image, bool) +} + +// Image describes the basic properties for generating thumbnails from the input video +type Image struct { + // Start - The position in the input video from where to start generating thumbnails. The value can be in absolute timestamp (ISO 8601, e.g: PT05S), or a frame count (For example, 10 for the 10th frame), or a relative value (For example, 1%). Also supports a macro {Best}, which tells the encoder to select the best thumbnail from the first few seconds of the video. + Start *string `json:"start,omitempty"` + // Step - The intervals at which thumbnails are generated. The value can be in absolute timestamp (ISO 8601, e.g: PT05S for one image every 5 seconds), or a frame count (For example, 30 for every 30 frames), or a relative value (For example, 1%). + Step *string `json:"step,omitempty"` + // Range - The position in the input video at which to stop generating thumbnails. The value can be in absolute timestamp (ISO 8601, e.g: PT5M30S to stop at 5 minutes and 30 seconds), or a frame count (For example, 300 to stop at the 300th frame), or a relative value (For example, 100%). + Range *string `json:"range,omitempty"` + // KeyFrameInterval - The distance between two key frames, thereby defining a group of pictures (GOP). The value should be a non-zero integer in the range [1, 30] seconds, specified in ISO 8601 format. The default is 2 seconds (PT2S). + KeyFrameInterval *string `json:"keyFrameInterval,omitempty"` + // StretchMode - The resizing mode - how the input video will be resized to fit the desired output resolution(s). Default is AutoSize. Possible values include: 'StretchModeNone', 'StretchModeAutoSize', 'StretchModeAutoFit' + StretchMode StretchMode `json:"stretchMode,omitempty"` + // Label - An optional label for the codec. The label can be used to control muxing behavior. + Label *string `json:"label,omitempty"` + // OdataType - Possible values include: 'OdataTypeCodec', 'OdataTypeMicrosoftMediaAudio', 'OdataTypeMicrosoftMediaAacAudio', 'OdataTypeMicrosoftMediaCopyVideo', 'OdataTypeMicrosoftMediaVideo', 'OdataTypeMicrosoftMediaImage', 'OdataTypeMicrosoftMediaCopyAudio', 'OdataTypeMicrosoftMediaH264Video', 'OdataTypeMicrosoftMediaJpgImage', 'OdataTypeMicrosoftMediaPngImage' + OdataType OdataTypeBasicCodec `json:"@odata.type,omitempty"` +} + +func unmarshalBasicImage(body []byte) (BasicImage, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["@odata.type"] { + case string(OdataTypeMicrosoftMediaJpgImage): + var ji JpgImage + err := json.Unmarshal(body, &ji) + return ji, err + case string(OdataTypeMicrosoftMediaPngImage): + var pi PngImage + err := json.Unmarshal(body, &pi) + return pi, err + default: + var i Image + err := json.Unmarshal(body, &i) + return i, err + } +} +func unmarshalBasicImageArray(body []byte) ([]BasicImage, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + iArray := make([]BasicImage, len(rawMessages)) + + for index, rawMessage := range rawMessages { + i, err := unmarshalBasicImage(*rawMessage) + if err != nil { + return nil, err + } + iArray[index] = i + } + return iArray, nil +} + +// MarshalJSON is the custom marshaler for Image. +func (i Image) MarshalJSON() ([]byte, error) { + i.OdataType = OdataTypeMicrosoftMediaImage + objectMap := make(map[string]interface{}) + if i.Start != nil { + objectMap["start"] = i.Start + } + if i.Step != nil { + objectMap["step"] = i.Step + } + if i.Range != nil { + objectMap["range"] = i.Range + } + if i.KeyFrameInterval != nil { + objectMap["keyFrameInterval"] = i.KeyFrameInterval + } + if i.StretchMode != "" { + objectMap["stretchMode"] = i.StretchMode + } + if i.Label != nil { + objectMap["label"] = i.Label + } + if i.OdataType != "" { + objectMap["@odata.type"] = i.OdataType + } + return json.Marshal(objectMap) +} + +// AsAudio is the BasicCodec implementation for Image. +func (i Image) AsAudio() (*Audio, bool) { + return nil, false +} + +// AsBasicAudio is the BasicCodec implementation for Image. +func (i Image) AsBasicAudio() (BasicAudio, bool) { + return nil, false +} + +// AsAacAudio is the BasicCodec implementation for Image. +func (i Image) AsAacAudio() (*AacAudio, bool) { + return nil, false +} + +// AsCopyVideo is the BasicCodec implementation for Image. +func (i Image) AsCopyVideo() (*CopyVideo, bool) { + return nil, false +} + +// AsVideo is the BasicCodec implementation for Image. +func (i Image) AsVideo() (*Video, bool) { + return nil, false +} + +// AsBasicVideo is the BasicCodec implementation for Image. +func (i Image) AsBasicVideo() (BasicVideo, bool) { + return &i, true +} + +// AsImage is the BasicCodec implementation for Image. +func (i Image) AsImage() (*Image, bool) { + return &i, true +} + +// AsBasicImage is the BasicCodec implementation for Image. +func (i Image) AsBasicImage() (BasicImage, bool) { + return &i, true +} + +// AsCopyAudio is the BasicCodec implementation for Image. +func (i Image) AsCopyAudio() (*CopyAudio, bool) { + return nil, false +} + +// AsH264Video is the BasicCodec implementation for Image. +func (i Image) AsH264Video() (*H264Video, bool) { + return nil, false +} + +// AsJpgImage is the BasicCodec implementation for Image. +func (i Image) AsJpgImage() (*JpgImage, bool) { + return nil, false +} + +// AsPngImage is the BasicCodec implementation for Image. +func (i Image) AsPngImage() (*PngImage, bool) { + return nil, false +} + +// AsCodec is the BasicCodec implementation for Image. +func (i Image) AsCodec() (*Codec, bool) { + return nil, false +} + +// AsBasicCodec is the BasicCodec implementation for Image. +func (i Image) AsBasicCodec() (BasicCodec, bool) { + return &i, true +} + +// BasicImageFormat describes the properties for an output image file. +type BasicImageFormat interface { + AsJpgFormat() (*JpgFormat, bool) + AsPngFormat() (*PngFormat, bool) + AsImageFormat() (*ImageFormat, bool) +} + +// ImageFormat describes the properties for an output image file. +type ImageFormat struct { + // FilenamePattern - The pattern of the file names for the generated output files. The following macros are supported in the file name: {Basename} - The base name of the input video {Extension} - The appropriate extension for this format. {Label} - The label assigned to the codec/layer. {Index} - A unique index for thumbnails. Only applicable to thumbnails. {Bitrate} - The audio/video bitrate. Not applicable to thumbnails. {Codec} - The type of the audio/video codec. Any unsubstituted macros will be collapsed and removed from the filename. + FilenamePattern *string `json:"filenamePattern,omitempty"` + // OdataType - Possible values include: 'OdataTypeFormat', 'OdataTypeMicrosoftMediaImageFormat', 'OdataTypeMicrosoftMediaJpgFormat', 'OdataTypeMicrosoftMediaPngFormat', 'OdataTypeMicrosoftMediaMultiBitrateFormat', 'OdataTypeMicrosoftMediaMp4Format', 'OdataTypeMicrosoftMediaTransportStreamFormat' + OdataType OdataTypeBasicFormat `json:"@odata.type,omitempty"` +} + +func unmarshalBasicImageFormat(body []byte) (BasicImageFormat, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["@odata.type"] { + case string(OdataTypeMicrosoftMediaJpgFormat): + var jf JpgFormat + err := json.Unmarshal(body, &jf) + return jf, err + case string(OdataTypeMicrosoftMediaPngFormat): + var pf PngFormat + err := json.Unmarshal(body, &pf) + return pf, err + default: + var ifVar ImageFormat + err := json.Unmarshal(body, &ifVar) + return ifVar, err + } +} +func unmarshalBasicImageFormatArray(body []byte) ([]BasicImageFormat, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + ifVarArray := make([]BasicImageFormat, len(rawMessages)) + + for index, rawMessage := range rawMessages { + ifVar, err := unmarshalBasicImageFormat(*rawMessage) + if err != nil { + return nil, err + } + ifVarArray[index] = ifVar + } + return ifVarArray, nil +} + +// MarshalJSON is the custom marshaler for ImageFormat. +func (ifVar ImageFormat) MarshalJSON() ([]byte, error) { + ifVar.OdataType = OdataTypeMicrosoftMediaImageFormat + objectMap := make(map[string]interface{}) + if ifVar.FilenamePattern != nil { + objectMap["filenamePattern"] = ifVar.FilenamePattern + } + if ifVar.OdataType != "" { + objectMap["@odata.type"] = ifVar.OdataType + } + return json.Marshal(objectMap) +} + +// AsImageFormat is the BasicFormat implementation for ImageFormat. +func (ifVar ImageFormat) AsImageFormat() (*ImageFormat, bool) { + return &ifVar, true +} + +// AsBasicImageFormat is the BasicFormat implementation for ImageFormat. +func (ifVar ImageFormat) AsBasicImageFormat() (BasicImageFormat, bool) { + return &ifVar, true +} + +// AsJpgFormat is the BasicFormat implementation for ImageFormat. +func (ifVar ImageFormat) AsJpgFormat() (*JpgFormat, bool) { + return nil, false +} + +// AsPngFormat is the BasicFormat implementation for ImageFormat. +func (ifVar ImageFormat) AsPngFormat() (*PngFormat, bool) { + return nil, false +} + +// AsMultiBitrateFormat is the BasicFormat implementation for ImageFormat. +func (ifVar ImageFormat) AsMultiBitrateFormat() (*MultiBitrateFormat, bool) { + return nil, false +} + +// AsBasicMultiBitrateFormat is the BasicFormat implementation for ImageFormat. +func (ifVar ImageFormat) AsBasicMultiBitrateFormat() (BasicMultiBitrateFormat, bool) { + return nil, false +} + +// AsMp4Format is the BasicFormat implementation for ImageFormat. +func (ifVar ImageFormat) AsMp4Format() (*Mp4Format, bool) { + return nil, false +} + +// AsTransportStreamFormat is the BasicFormat implementation for ImageFormat. +func (ifVar ImageFormat) AsTransportStreamFormat() (*TransportStreamFormat, bool) { + return nil, false +} + +// AsFormat is the BasicFormat implementation for ImageFormat. +func (ifVar ImageFormat) AsFormat() (*Format, bool) { + return nil, false +} + +// AsBasicFormat is the BasicFormat implementation for ImageFormat. +func (ifVar ImageFormat) AsBasicFormat() (BasicFormat, bool) { + return &ifVar, true +} + +// IPAccessControl the IP access control. +type IPAccessControl struct { + // Allow - The IP allow list. + Allow *[]IPRange `json:"allow,omitempty"` +} + +// IPRange the IP address range in the CIDR scheme. +type IPRange struct { + // Name - The friendly name for the IP address range. + Name *string `json:"name,omitempty"` + // Address - The IP address. + Address *string `json:"address,omitempty"` + // SubnetPrefixLength - The subnet mask prefix length (see CIDR notation). + SubnetPrefixLength *int32 `json:"subnetPrefixLength,omitempty"` +} + +// Job a Job resource type. The progress and state can be obtained by polling a Job or subscribing to events using +// EventGrid. +type Job struct { + autorest.Response `json:"-"` + // JobProperties - The resource properties. + *JobProperties `json:"properties,omitempty"` + // ID - Fully qualified resource ID for the resource. + ID *string `json:"id,omitempty"` + // Name - The name of the resource. + Name *string `json:"name,omitempty"` + // Type - The type of the resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Job. +func (j Job) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if j.JobProperties != nil { + objectMap["properties"] = j.JobProperties + } + if j.ID != nil { + objectMap["id"] = j.ID + } + if j.Name != nil { + objectMap["name"] = j.Name + } + if j.Type != nil { + objectMap["type"] = j.Type + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Job struct. +func (j *Job) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var jobProperties JobProperties + err = json.Unmarshal(*v, &jobProperties) + if err != nil { + return err + } + j.JobProperties = &jobProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + j.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + j.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + j.Type = &typeVar + } + } + } + + return nil +} + +// JobCollection a collection of Job items. +type JobCollection struct { + autorest.Response `json:"-"` + // Value - A collection of Job items. + Value *[]Job `json:"value,omitempty"` + // OdataNextLink - A link to the next page of the collection (when the collection contains too many results to return in one response). + OdataNextLink *string `json:"@odata.nextLink,omitempty"` +} + +// JobCollectionIterator provides access to a complete listing of Job values. +type JobCollectionIterator struct { + i int + page JobCollectionPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *JobCollectionIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter JobCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter JobCollectionIterator) Response() JobCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter JobCollectionIterator) Value() Job { + if !iter.page.NotDone() { + return Job{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (jc JobCollection) IsEmpty() bool { + return jc.Value == nil || len(*jc.Value) == 0 +} + +// jobCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (jc JobCollection) jobCollectionPreparer() (*http.Request, error) { + if jc.OdataNextLink == nil || len(to.String(jc.OdataNextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(jc.OdataNextLink))) +} + +// JobCollectionPage contains a page of Job values. +type JobCollectionPage struct { + fn func(JobCollection) (JobCollection, error) + jc JobCollection +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *JobCollectionPage) Next() error { + next, err := page.fn(page.jc) + if err != nil { + return err + } + page.jc = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page JobCollectionPage) NotDone() bool { + return !page.jc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page JobCollectionPage) Response() JobCollection { + return page.jc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page JobCollectionPage) Values() []Job { + if page.jc.IsEmpty() { + return nil + } + return *page.jc.Value +} + +// JobError details of JobOutput errors. +type JobError struct { + // Code - Error code describing the error. Possible values include: 'ServiceError', 'ServiceTransientError', 'DownloadNotAccessible', 'DownloadTransientError', 'UploadNotAccessible', 'UploadTransientError', 'ConfigurationUnsupported', 'ContentMalformed', 'ContentUnsupported' + Code JobErrorCode `json:"code,omitempty"` + // Message - A human-readable language-dependent representation of the error. + Message *string `json:"message,omitempty"` + // Category - Helps with categorization of errors. Possible values include: 'JobErrorCategoryService', 'JobErrorCategoryDownload', 'JobErrorCategoryUpload', 'JobErrorCategoryConfiguration', 'JobErrorCategoryContent' + Category JobErrorCategory `json:"category,omitempty"` + // Retry - Indicates that it may be possible to retry the Job. If retry is unsuccessful, please contact Azure support via Azure Portal. Possible values include: 'DoNotRetry', 'MayRetry' + Retry JobRetry `json:"retry,omitempty"` + // Details - An array of details about specific errors that led to this reported error. + Details *[]JobErrorDetail `json:"details,omitempty"` +} + +// JobErrorDetail details of JobOutput errors. +type JobErrorDetail struct { + // Code - Code describing the error detail. + Code *string `json:"code,omitempty"` + // Message - A human-readable representation of the error. + Message *string `json:"message,omitempty"` +} + +// BasicJobInput base class for inputs to a Job. +type BasicJobInput interface { + AsJobInputClip() (*JobInputClip, bool) + AsBasicJobInputClip() (BasicJobInputClip, bool) + AsJobInputs() (*JobInputs, bool) + AsJobInputAsset() (*JobInputAsset, bool) + AsJobInputHTTP() (*JobInputHTTP, bool) + AsJobInput() (*JobInput, bool) +} + +// JobInput base class for inputs to a Job. +type JobInput struct { + // Label - A label that is assigned to a JobInput, that is used to satisfy a reference used in the Transform. For example, a Transform can be authored so as to take an image file with the label 'xyz' and apply it as an overlay onto the input video before it is encoded. When submitting a Job, exactly one of the JobInputs should be the image file, and it should have the label 'xyz'. + Label *string `json:"label,omitempty"` + // OdataType - Possible values include: 'OdataTypeJobInput', 'OdataTypeMicrosoftMediaJobInputClip', 'OdataTypeMicrosoftMediaJobInputs', 'OdataTypeMicrosoftMediaJobInputAsset', 'OdataTypeMicrosoftMediaJobInputHTTP' + OdataType OdataTypeBasicJobInput `json:"@odata.type,omitempty"` +} + +func unmarshalBasicJobInput(body []byte) (BasicJobInput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["@odata.type"] { + case string(OdataTypeMicrosoftMediaJobInputClip): + var jic JobInputClip + err := json.Unmarshal(body, &jic) + return jic, err + case string(OdataTypeMicrosoftMediaJobInputs): + var ji JobInputs + err := json.Unmarshal(body, &ji) + return ji, err + case string(OdataTypeMicrosoftMediaJobInputAsset): + var jia JobInputAsset + err := json.Unmarshal(body, &jia) + return jia, err + case string(OdataTypeMicrosoftMediaJobInputHTTP): + var jih JobInputHTTP + err := json.Unmarshal(body, &jih) + return jih, err + default: + var ji JobInput + err := json.Unmarshal(body, &ji) + return ji, err + } +} +func unmarshalBasicJobInputArray(body []byte) ([]BasicJobInput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + jiArray := make([]BasicJobInput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + ji, err := unmarshalBasicJobInput(*rawMessage) + if err != nil { + return nil, err + } + jiArray[index] = ji + } + return jiArray, nil +} + +// MarshalJSON is the custom marshaler for JobInput. +func (ji JobInput) MarshalJSON() ([]byte, error) { + ji.OdataType = OdataTypeJobInput + objectMap := make(map[string]interface{}) + if ji.Label != nil { + objectMap["label"] = ji.Label + } + if ji.OdataType != "" { + objectMap["@odata.type"] = ji.OdataType + } + return json.Marshal(objectMap) +} + +// AsJobInputClip is the BasicJobInput implementation for JobInput. +func (ji JobInput) AsJobInputClip() (*JobInputClip, bool) { + return nil, false +} + +// AsBasicJobInputClip is the BasicJobInput implementation for JobInput. +func (ji JobInput) AsBasicJobInputClip() (BasicJobInputClip, bool) { + return nil, false +} + +// AsJobInputs is the BasicJobInput implementation for JobInput. +func (ji JobInput) AsJobInputs() (*JobInputs, bool) { + return nil, false +} + +// AsJobInputAsset is the BasicJobInput implementation for JobInput. +func (ji JobInput) AsJobInputAsset() (*JobInputAsset, bool) { + return nil, false +} + +// AsJobInputHTTP is the BasicJobInput implementation for JobInput. +func (ji JobInput) AsJobInputHTTP() (*JobInputHTTP, bool) { + return nil, false +} + +// AsJobInput is the BasicJobInput implementation for JobInput. +func (ji JobInput) AsJobInput() (*JobInput, bool) { + return &ji, true +} + +// AsBasicJobInput is the BasicJobInput implementation for JobInput. +func (ji JobInput) AsBasicJobInput() (BasicJobInput, bool) { + return &ji, true +} + +// JobInputAsset represents an Asset for input into a Job. +type JobInputAsset struct { + // AssetName - The name of the input Asset. + AssetName *string `json:"assetName,omitempty"` + // Files - List of files. Required for JobInputHttp. + Files *[]string `json:"files,omitempty"` + // Label - A label that is assigned to a JobInput, that is used to satisfy a reference used in the Transform. For example, a Transform can be authored so as to take an image file with the label 'xyz' and apply it as an overlay onto the input video before it is encoded. When submitting a Job, exactly one of the JobInputs should be the image file, and it should have the label 'xyz'. + Label *string `json:"label,omitempty"` + // OdataType - Possible values include: 'OdataTypeJobInput', 'OdataTypeMicrosoftMediaJobInputClip', 'OdataTypeMicrosoftMediaJobInputs', 'OdataTypeMicrosoftMediaJobInputAsset', 'OdataTypeMicrosoftMediaJobInputHTTP' + OdataType OdataTypeBasicJobInput `json:"@odata.type,omitempty"` +} + +// MarshalJSON is the custom marshaler for JobInputAsset. +func (jia JobInputAsset) MarshalJSON() ([]byte, error) { + jia.OdataType = OdataTypeMicrosoftMediaJobInputAsset + objectMap := make(map[string]interface{}) + if jia.AssetName != nil { + objectMap["assetName"] = jia.AssetName + } + if jia.Files != nil { + objectMap["files"] = jia.Files + } + if jia.Label != nil { + objectMap["label"] = jia.Label + } + if jia.OdataType != "" { + objectMap["@odata.type"] = jia.OdataType + } + return json.Marshal(objectMap) +} + +// AsJobInputClip is the BasicJobInput implementation for JobInputAsset. +func (jia JobInputAsset) AsJobInputClip() (*JobInputClip, bool) { + return nil, false +} + +// AsBasicJobInputClip is the BasicJobInput implementation for JobInputAsset. +func (jia JobInputAsset) AsBasicJobInputClip() (BasicJobInputClip, bool) { + return &jia, true +} + +// AsJobInputs is the BasicJobInput implementation for JobInputAsset. +func (jia JobInputAsset) AsJobInputs() (*JobInputs, bool) { + return nil, false +} + +// AsJobInputAsset is the BasicJobInput implementation for JobInputAsset. +func (jia JobInputAsset) AsJobInputAsset() (*JobInputAsset, bool) { + return &jia, true +} + +// AsJobInputHTTP is the BasicJobInput implementation for JobInputAsset. +func (jia JobInputAsset) AsJobInputHTTP() (*JobInputHTTP, bool) { + return nil, false +} + +// AsJobInput is the BasicJobInput implementation for JobInputAsset. +func (jia JobInputAsset) AsJobInput() (*JobInput, bool) { + return nil, false +} + +// AsBasicJobInput is the BasicJobInput implementation for JobInputAsset. +func (jia JobInputAsset) AsBasicJobInput() (BasicJobInput, bool) { + return &jia, true +} + +// BasicJobInputClip represents input files for a Job. +type BasicJobInputClip interface { + AsJobInputAsset() (*JobInputAsset, bool) + AsJobInputHTTP() (*JobInputHTTP, bool) + AsJobInputClip() (*JobInputClip, bool) +} + +// JobInputClip represents input files for a Job. +type JobInputClip struct { + // Files - List of files. Required for JobInputHttp. + Files *[]string `json:"files,omitempty"` + // Label - A label that is assigned to a JobInput, that is used to satisfy a reference used in the Transform. For example, a Transform can be authored so as to take an image file with the label 'xyz' and apply it as an overlay onto the input video before it is encoded. When submitting a Job, exactly one of the JobInputs should be the image file, and it should have the label 'xyz'. + Label *string `json:"label,omitempty"` + // OdataType - Possible values include: 'OdataTypeJobInput', 'OdataTypeMicrosoftMediaJobInputClip', 'OdataTypeMicrosoftMediaJobInputs', 'OdataTypeMicrosoftMediaJobInputAsset', 'OdataTypeMicrosoftMediaJobInputHTTP' + OdataType OdataTypeBasicJobInput `json:"@odata.type,omitempty"` +} + +func unmarshalBasicJobInputClip(body []byte) (BasicJobInputClip, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["@odata.type"] { + case string(OdataTypeMicrosoftMediaJobInputAsset): + var jia JobInputAsset + err := json.Unmarshal(body, &jia) + return jia, err + case string(OdataTypeMicrosoftMediaJobInputHTTP): + var jih JobInputHTTP + err := json.Unmarshal(body, &jih) + return jih, err + default: + var jic JobInputClip + err := json.Unmarshal(body, &jic) + return jic, err + } +} +func unmarshalBasicJobInputClipArray(body []byte) ([]BasicJobInputClip, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + jicArray := make([]BasicJobInputClip, len(rawMessages)) + + for index, rawMessage := range rawMessages { + jic, err := unmarshalBasicJobInputClip(*rawMessage) + if err != nil { + return nil, err + } + jicArray[index] = jic + } + return jicArray, nil +} + +// MarshalJSON is the custom marshaler for JobInputClip. +func (jic JobInputClip) MarshalJSON() ([]byte, error) { + jic.OdataType = OdataTypeMicrosoftMediaJobInputClip + objectMap := make(map[string]interface{}) + if jic.Files != nil { + objectMap["files"] = jic.Files + } + if jic.Label != nil { + objectMap["label"] = jic.Label + } + if jic.OdataType != "" { + objectMap["@odata.type"] = jic.OdataType + } + return json.Marshal(objectMap) +} + +// AsJobInputClip is the BasicJobInput implementation for JobInputClip. +func (jic JobInputClip) AsJobInputClip() (*JobInputClip, bool) { + return &jic, true +} + +// AsBasicJobInputClip is the BasicJobInput implementation for JobInputClip. +func (jic JobInputClip) AsBasicJobInputClip() (BasicJobInputClip, bool) { + return &jic, true +} + +// AsJobInputs is the BasicJobInput implementation for JobInputClip. +func (jic JobInputClip) AsJobInputs() (*JobInputs, bool) { + return nil, false +} + +// AsJobInputAsset is the BasicJobInput implementation for JobInputClip. +func (jic JobInputClip) AsJobInputAsset() (*JobInputAsset, bool) { + return nil, false +} + +// AsJobInputHTTP is the BasicJobInput implementation for JobInputClip. +func (jic JobInputClip) AsJobInputHTTP() (*JobInputHTTP, bool) { + return nil, false +} + +// AsJobInput is the BasicJobInput implementation for JobInputClip. +func (jic JobInputClip) AsJobInput() (*JobInput, bool) { + return nil, false +} + +// AsBasicJobInput is the BasicJobInput implementation for JobInputClip. +func (jic JobInputClip) AsBasicJobInput() (BasicJobInput, bool) { + return &jic, true +} + +// JobInputHTTP represents HTTPS job input. +type JobInputHTTP struct { + // BaseURI - Base URI for HTTPS job input. It will be concatenated with provided file names. If no base uri is given, then the provided file list is assumed to be fully qualified uris. + BaseURI *string `json:"baseUri,omitempty"` + // Files - List of files. Required for JobInputHttp. + Files *[]string `json:"files,omitempty"` + // Label - A label that is assigned to a JobInput, that is used to satisfy a reference used in the Transform. For example, a Transform can be authored so as to take an image file with the label 'xyz' and apply it as an overlay onto the input video before it is encoded. When submitting a Job, exactly one of the JobInputs should be the image file, and it should have the label 'xyz'. + Label *string `json:"label,omitempty"` + // OdataType - Possible values include: 'OdataTypeJobInput', 'OdataTypeMicrosoftMediaJobInputClip', 'OdataTypeMicrosoftMediaJobInputs', 'OdataTypeMicrosoftMediaJobInputAsset', 'OdataTypeMicrosoftMediaJobInputHTTP' + OdataType OdataTypeBasicJobInput `json:"@odata.type,omitempty"` +} + +// MarshalJSON is the custom marshaler for JobInputHTTP. +func (jih JobInputHTTP) MarshalJSON() ([]byte, error) { + jih.OdataType = OdataTypeMicrosoftMediaJobInputHTTP + objectMap := make(map[string]interface{}) + if jih.BaseURI != nil { + objectMap["baseUri"] = jih.BaseURI + } + if jih.Files != nil { + objectMap["files"] = jih.Files + } + if jih.Label != nil { + objectMap["label"] = jih.Label + } + if jih.OdataType != "" { + objectMap["@odata.type"] = jih.OdataType + } + return json.Marshal(objectMap) +} + +// AsJobInputClip is the BasicJobInput implementation for JobInputHTTP. +func (jih JobInputHTTP) AsJobInputClip() (*JobInputClip, bool) { + return nil, false +} + +// AsBasicJobInputClip is the BasicJobInput implementation for JobInputHTTP. +func (jih JobInputHTTP) AsBasicJobInputClip() (BasicJobInputClip, bool) { + return &jih, true +} + +// AsJobInputs is the BasicJobInput implementation for JobInputHTTP. +func (jih JobInputHTTP) AsJobInputs() (*JobInputs, bool) { + return nil, false +} + +// AsJobInputAsset is the BasicJobInput implementation for JobInputHTTP. +func (jih JobInputHTTP) AsJobInputAsset() (*JobInputAsset, bool) { + return nil, false +} + +// AsJobInputHTTP is the BasicJobInput implementation for JobInputHTTP. +func (jih JobInputHTTP) AsJobInputHTTP() (*JobInputHTTP, bool) { + return &jih, true +} + +// AsJobInput is the BasicJobInput implementation for JobInputHTTP. +func (jih JobInputHTTP) AsJobInput() (*JobInput, bool) { + return nil, false +} + +// AsBasicJobInput is the BasicJobInput implementation for JobInputHTTP. +func (jih JobInputHTTP) AsBasicJobInput() (BasicJobInput, bool) { + return &jih, true +} + +// JobInputs describes a list of of inputs to a Job. +type JobInputs struct { + // Inputs - List of inputs to a Job. + Inputs *[]BasicJobInput `json:"inputs,omitempty"` + // Label - A label that is assigned to a JobInput, that is used to satisfy a reference used in the Transform. For example, a Transform can be authored so as to take an image file with the label 'xyz' and apply it as an overlay onto the input video before it is encoded. When submitting a Job, exactly one of the JobInputs should be the image file, and it should have the label 'xyz'. + Label *string `json:"label,omitempty"` + // OdataType - Possible values include: 'OdataTypeJobInput', 'OdataTypeMicrosoftMediaJobInputClip', 'OdataTypeMicrosoftMediaJobInputs', 'OdataTypeMicrosoftMediaJobInputAsset', 'OdataTypeMicrosoftMediaJobInputHTTP' + OdataType OdataTypeBasicJobInput `json:"@odata.type,omitempty"` +} + +// MarshalJSON is the custom marshaler for JobInputs. +func (ji JobInputs) MarshalJSON() ([]byte, error) { + ji.OdataType = OdataTypeMicrosoftMediaJobInputs + objectMap := make(map[string]interface{}) + if ji.Inputs != nil { + objectMap["inputs"] = ji.Inputs + } + if ji.Label != nil { + objectMap["label"] = ji.Label + } + if ji.OdataType != "" { + objectMap["@odata.type"] = ji.OdataType + } + return json.Marshal(objectMap) +} + +// AsJobInputClip is the BasicJobInput implementation for JobInputs. +func (ji JobInputs) AsJobInputClip() (*JobInputClip, bool) { + return nil, false +} + +// AsBasicJobInputClip is the BasicJobInput implementation for JobInputs. +func (ji JobInputs) AsBasicJobInputClip() (BasicJobInputClip, bool) { + return nil, false +} + +// AsJobInputs is the BasicJobInput implementation for JobInputs. +func (ji JobInputs) AsJobInputs() (*JobInputs, bool) { + return &ji, true +} + +// AsJobInputAsset is the BasicJobInput implementation for JobInputs. +func (ji JobInputs) AsJobInputAsset() (*JobInputAsset, bool) { + return nil, false +} + +// AsJobInputHTTP is the BasicJobInput implementation for JobInputs. +func (ji JobInputs) AsJobInputHTTP() (*JobInputHTTP, bool) { + return nil, false +} + +// AsJobInput is the BasicJobInput implementation for JobInputs. +func (ji JobInputs) AsJobInput() (*JobInput, bool) { + return nil, false +} + +// AsBasicJobInput is the BasicJobInput implementation for JobInputs. +func (ji JobInputs) AsBasicJobInput() (BasicJobInput, bool) { + return &ji, true +} + +// UnmarshalJSON is the custom unmarshaler for JobInputs struct. +func (ji *JobInputs) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "inputs": + if v != nil { + inputs, err := unmarshalBasicJobInputArray(*v) + if err != nil { + return err + } + ji.Inputs = &inputs + } + case "label": + if v != nil { + var label string + err = json.Unmarshal(*v, &label) + if err != nil { + return err + } + ji.Label = &label + } + case "@odata.type": + if v != nil { + var odataType OdataTypeBasicJobInput + err = json.Unmarshal(*v, &odataType) + if err != nil { + return err + } + ji.OdataType = odataType + } + } + } + + return nil +} + +// BasicJobOutput describes all the properties of a JobOutput. +type BasicJobOutput interface { + AsJobOutputAsset() (*JobOutputAsset, bool) + AsJobOutput() (*JobOutput, bool) +} + +// JobOutput describes all the properties of a JobOutput. +type JobOutput struct { + // Error - If the JobOutput is in the Error state, it contains the details of the error. + Error *JobError `json:"error,omitempty"` + // State - Describes the state of the JobOutput. Possible values include: 'Canceled', 'Canceling', 'Error', 'Finished', 'Processing', 'Queued', 'Scheduled' + State JobState `json:"state,omitempty"` + // Progress - If the JobOutput is in a Processing state, this contains the job completion percentage. The value is an estimate and not intended to be used to predict job completion times. To determine if the JobOutput is complete, use the State property. + Progress *int32 `json:"progress,omitempty"` + // OdataType - Possible values include: 'OdataTypeJobOutput', 'OdataTypeMicrosoftMediaJobOutputAsset' + OdataType OdataTypeBasicJobOutput `json:"@odata.type,omitempty"` +} + +func unmarshalBasicJobOutput(body []byte) (BasicJobOutput, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["@odata.type"] { + case string(OdataTypeMicrosoftMediaJobOutputAsset): + var joa JobOutputAsset + err := json.Unmarshal(body, &joa) + return joa, err + default: + var jo JobOutput + err := json.Unmarshal(body, &jo) + return jo, err + } +} +func unmarshalBasicJobOutputArray(body []byte) ([]BasicJobOutput, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + joArray := make([]BasicJobOutput, len(rawMessages)) + + for index, rawMessage := range rawMessages { + jo, err := unmarshalBasicJobOutput(*rawMessage) + if err != nil { + return nil, err + } + joArray[index] = jo + } + return joArray, nil +} + +// MarshalJSON is the custom marshaler for JobOutput. +func (jo JobOutput) MarshalJSON() ([]byte, error) { + jo.OdataType = OdataTypeJobOutput + objectMap := make(map[string]interface{}) + if jo.Error != nil { + objectMap["error"] = jo.Error + } + if jo.State != "" { + objectMap["state"] = jo.State + } + if jo.Progress != nil { + objectMap["progress"] = jo.Progress + } + if jo.OdataType != "" { + objectMap["@odata.type"] = jo.OdataType + } + return json.Marshal(objectMap) +} + +// AsJobOutputAsset is the BasicJobOutput implementation for JobOutput. +func (jo JobOutput) AsJobOutputAsset() (*JobOutputAsset, bool) { + return nil, false +} + +// AsJobOutput is the BasicJobOutput implementation for JobOutput. +func (jo JobOutput) AsJobOutput() (*JobOutput, bool) { + return &jo, true +} + +// AsBasicJobOutput is the BasicJobOutput implementation for JobOutput. +func (jo JobOutput) AsBasicJobOutput() (BasicJobOutput, bool) { + return &jo, true +} + +// JobOutputAsset represents an Asset used as a JobOutput. +type JobOutputAsset struct { + // AssetName - The name of the output Asset. + AssetName *string `json:"assetName,omitempty"` + // Error - If the JobOutput is in the Error state, it contains the details of the error. + Error *JobError `json:"error,omitempty"` + // State - Describes the state of the JobOutput. Possible values include: 'Canceled', 'Canceling', 'Error', 'Finished', 'Processing', 'Queued', 'Scheduled' + State JobState `json:"state,omitempty"` + // Progress - If the JobOutput is in a Processing state, this contains the job completion percentage. The value is an estimate and not intended to be used to predict job completion times. To determine if the JobOutput is complete, use the State property. + Progress *int32 `json:"progress,omitempty"` + // OdataType - Possible values include: 'OdataTypeJobOutput', 'OdataTypeMicrosoftMediaJobOutputAsset' + OdataType OdataTypeBasicJobOutput `json:"@odata.type,omitempty"` +} + +// MarshalJSON is the custom marshaler for JobOutputAsset. +func (joa JobOutputAsset) MarshalJSON() ([]byte, error) { + joa.OdataType = OdataTypeMicrosoftMediaJobOutputAsset + objectMap := make(map[string]interface{}) + if joa.AssetName != nil { + objectMap["assetName"] = joa.AssetName + } + if joa.Error != nil { + objectMap["error"] = joa.Error + } + if joa.State != "" { + objectMap["state"] = joa.State + } + if joa.Progress != nil { + objectMap["progress"] = joa.Progress + } + if joa.OdataType != "" { + objectMap["@odata.type"] = joa.OdataType + } + return json.Marshal(objectMap) +} + +// AsJobOutputAsset is the BasicJobOutput implementation for JobOutputAsset. +func (joa JobOutputAsset) AsJobOutputAsset() (*JobOutputAsset, bool) { + return &joa, true +} + +// AsJobOutput is the BasicJobOutput implementation for JobOutputAsset. +func (joa JobOutputAsset) AsJobOutput() (*JobOutput, bool) { + return nil, false +} + +// AsBasicJobOutput is the BasicJobOutput implementation for JobOutputAsset. +func (joa JobOutputAsset) AsBasicJobOutput() (BasicJobOutput, bool) { + return &joa, true +} + +// JobProperties properties of the Job. +type JobProperties struct { + // Created - The UTC date and time when the Job was created, in 'YYYY-MM-DDThh:mm:ssZ' format. + Created *date.Time `json:"created,omitempty"` + // State - The current state of the job. Possible values include: 'Canceled', 'Canceling', 'Error', 'Finished', 'Processing', 'Queued', 'Scheduled' + State JobState `json:"state,omitempty"` + // Description - Optional customer supplied description of the Job. + Description *string `json:"description,omitempty"` + // Input - The inputs for the Job. + Input BasicJobInput `json:"input,omitempty"` + // LastModified - The UTC date and time when the Job was last updated, in 'YYYY-MM-DDThh:mm:ssZ' format. + LastModified *date.Time `json:"lastModified,omitempty"` + // Outputs - The outputs for the Job. + Outputs *[]BasicJobOutput `json:"outputs,omitempty"` + // Priority - Priority with which the job should be processed. Higher priority jobs are processed before lower priority jobs. If not set, the default is normal. Possible values include: 'Low', 'Normal', 'High' + Priority Priority `json:"priority,omitempty"` + // CorrelationData - Customer provided correlation data that will be returned in Job completed events. + CorrelationData map[string]*string `json:"correlationData"` +} + +// MarshalJSON is the custom marshaler for JobProperties. +func (jp JobProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if jp.Created != nil { + objectMap["created"] = jp.Created + } + if jp.State != "" { + objectMap["state"] = jp.State + } + if jp.Description != nil { + objectMap["description"] = jp.Description + } + objectMap["input"] = jp.Input + if jp.LastModified != nil { + objectMap["lastModified"] = jp.LastModified + } + if jp.Outputs != nil { + objectMap["outputs"] = jp.Outputs + } + if jp.Priority != "" { + objectMap["priority"] = jp.Priority + } + if jp.CorrelationData != nil { + objectMap["correlationData"] = jp.CorrelationData + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for JobProperties struct. +func (jp *JobProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "created": + if v != nil { + var created date.Time + err = json.Unmarshal(*v, &created) + if err != nil { + return err + } + jp.Created = &created + } + case "state": + if v != nil { + var state JobState + err = json.Unmarshal(*v, &state) + if err != nil { + return err + } + jp.State = state + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + jp.Description = &description + } + case "input": + if v != nil { + input, err := unmarshalBasicJobInput(*v) + if err != nil { + return err + } + jp.Input = input + } + case "lastModified": + if v != nil { + var lastModified date.Time + err = json.Unmarshal(*v, &lastModified) + if err != nil { + return err + } + jp.LastModified = &lastModified + } + case "outputs": + if v != nil { + outputs, err := unmarshalBasicJobOutputArray(*v) + if err != nil { + return err + } + jp.Outputs = &outputs + } + case "priority": + if v != nil { + var priority Priority + err = json.Unmarshal(*v, &priority) + if err != nil { + return err + } + jp.Priority = priority + } + case "correlationData": + if v != nil { + var correlationData map[string]*string + err = json.Unmarshal(*v, &correlationData) + if err != nil { + return err + } + jp.CorrelationData = correlationData + } + } + } + + return nil +} + +// JpgFormat describes the settings for producing JPEG thumbnails. +type JpgFormat struct { + // FilenamePattern - The pattern of the file names for the generated output files. The following macros are supported in the file name: {Basename} - The base name of the input video {Extension} - The appropriate extension for this format. {Label} - The label assigned to the codec/layer. {Index} - A unique index for thumbnails. Only applicable to thumbnails. {Bitrate} - The audio/video bitrate. Not applicable to thumbnails. {Codec} - The type of the audio/video codec. Any unsubstituted macros will be collapsed and removed from the filename. + FilenamePattern *string `json:"filenamePattern,omitempty"` + // OdataType - Possible values include: 'OdataTypeFormat', 'OdataTypeMicrosoftMediaImageFormat', 'OdataTypeMicrosoftMediaJpgFormat', 'OdataTypeMicrosoftMediaPngFormat', 'OdataTypeMicrosoftMediaMultiBitrateFormat', 'OdataTypeMicrosoftMediaMp4Format', 'OdataTypeMicrosoftMediaTransportStreamFormat' + OdataType OdataTypeBasicFormat `json:"@odata.type,omitempty"` +} + +// MarshalJSON is the custom marshaler for JpgFormat. +func (jf JpgFormat) MarshalJSON() ([]byte, error) { + jf.OdataType = OdataTypeMicrosoftMediaJpgFormat + objectMap := make(map[string]interface{}) + if jf.FilenamePattern != nil { + objectMap["filenamePattern"] = jf.FilenamePattern + } + if jf.OdataType != "" { + objectMap["@odata.type"] = jf.OdataType + } + return json.Marshal(objectMap) +} + +// AsImageFormat is the BasicFormat implementation for JpgFormat. +func (jf JpgFormat) AsImageFormat() (*ImageFormat, bool) { + return nil, false +} + +// AsBasicImageFormat is the BasicFormat implementation for JpgFormat. +func (jf JpgFormat) AsBasicImageFormat() (BasicImageFormat, bool) { + return &jf, true +} + +// AsJpgFormat is the BasicFormat implementation for JpgFormat. +func (jf JpgFormat) AsJpgFormat() (*JpgFormat, bool) { + return &jf, true +} + +// AsPngFormat is the BasicFormat implementation for JpgFormat. +func (jf JpgFormat) AsPngFormat() (*PngFormat, bool) { + return nil, false +} + +// AsMultiBitrateFormat is the BasicFormat implementation for JpgFormat. +func (jf JpgFormat) AsMultiBitrateFormat() (*MultiBitrateFormat, bool) { + return nil, false +} + +// AsBasicMultiBitrateFormat is the BasicFormat implementation for JpgFormat. +func (jf JpgFormat) AsBasicMultiBitrateFormat() (BasicMultiBitrateFormat, bool) { + return nil, false +} + +// AsMp4Format is the BasicFormat implementation for JpgFormat. +func (jf JpgFormat) AsMp4Format() (*Mp4Format, bool) { + return nil, false +} + +// AsTransportStreamFormat is the BasicFormat implementation for JpgFormat. +func (jf JpgFormat) AsTransportStreamFormat() (*TransportStreamFormat, bool) { + return nil, false +} + +// AsFormat is the BasicFormat implementation for JpgFormat. +func (jf JpgFormat) AsFormat() (*Format, bool) { + return nil, false +} + +// AsBasicFormat is the BasicFormat implementation for JpgFormat. +func (jf JpgFormat) AsBasicFormat() (BasicFormat, bool) { + return &jf, true +} + +// JpgImage describes the properties for producing a series of JPEG images from the input video. +type JpgImage struct { + // Layers - A collection of output JPEG image layers to be produced by the encoder. + Layers *[]JpgLayer `json:"layers,omitempty"` + // Start - The position in the input video from where to start generating thumbnails. The value can be in absolute timestamp (ISO 8601, e.g: PT05S), or a frame count (For example, 10 for the 10th frame), or a relative value (For example, 1%). Also supports a macro {Best}, which tells the encoder to select the best thumbnail from the first few seconds of the video. + Start *string `json:"start,omitempty"` + // Step - The intervals at which thumbnails are generated. The value can be in absolute timestamp (ISO 8601, e.g: PT05S for one image every 5 seconds), or a frame count (For example, 30 for every 30 frames), or a relative value (For example, 1%). + Step *string `json:"step,omitempty"` + // Range - The position in the input video at which to stop generating thumbnails. The value can be in absolute timestamp (ISO 8601, e.g: PT5M30S to stop at 5 minutes and 30 seconds), or a frame count (For example, 300 to stop at the 300th frame), or a relative value (For example, 100%). + Range *string `json:"range,omitempty"` + // KeyFrameInterval - The distance between two key frames, thereby defining a group of pictures (GOP). The value should be a non-zero integer in the range [1, 30] seconds, specified in ISO 8601 format. The default is 2 seconds (PT2S). + KeyFrameInterval *string `json:"keyFrameInterval,omitempty"` + // StretchMode - The resizing mode - how the input video will be resized to fit the desired output resolution(s). Default is AutoSize. Possible values include: 'StretchModeNone', 'StretchModeAutoSize', 'StretchModeAutoFit' + StretchMode StretchMode `json:"stretchMode,omitempty"` + // Label - An optional label for the codec. The label can be used to control muxing behavior. + Label *string `json:"label,omitempty"` + // OdataType - Possible values include: 'OdataTypeCodec', 'OdataTypeMicrosoftMediaAudio', 'OdataTypeMicrosoftMediaAacAudio', 'OdataTypeMicrosoftMediaCopyVideo', 'OdataTypeMicrosoftMediaVideo', 'OdataTypeMicrosoftMediaImage', 'OdataTypeMicrosoftMediaCopyAudio', 'OdataTypeMicrosoftMediaH264Video', 'OdataTypeMicrosoftMediaJpgImage', 'OdataTypeMicrosoftMediaPngImage' + OdataType OdataTypeBasicCodec `json:"@odata.type,omitempty"` +} + +// MarshalJSON is the custom marshaler for JpgImage. +func (ji JpgImage) MarshalJSON() ([]byte, error) { + ji.OdataType = OdataTypeMicrosoftMediaJpgImage + objectMap := make(map[string]interface{}) + if ji.Layers != nil { + objectMap["layers"] = ji.Layers + } + if ji.Start != nil { + objectMap["start"] = ji.Start + } + if ji.Step != nil { + objectMap["step"] = ji.Step + } + if ji.Range != nil { + objectMap["range"] = ji.Range + } + if ji.KeyFrameInterval != nil { + objectMap["keyFrameInterval"] = ji.KeyFrameInterval + } + if ji.StretchMode != "" { + objectMap["stretchMode"] = ji.StretchMode + } + if ji.Label != nil { + objectMap["label"] = ji.Label + } + if ji.OdataType != "" { + objectMap["@odata.type"] = ji.OdataType + } + return json.Marshal(objectMap) +} + +// AsAudio is the BasicCodec implementation for JpgImage. +func (ji JpgImage) AsAudio() (*Audio, bool) { + return nil, false +} + +// AsBasicAudio is the BasicCodec implementation for JpgImage. +func (ji JpgImage) AsBasicAudio() (BasicAudio, bool) { + return nil, false +} + +// AsAacAudio is the BasicCodec implementation for JpgImage. +func (ji JpgImage) AsAacAudio() (*AacAudio, bool) { + return nil, false +} + +// AsCopyVideo is the BasicCodec implementation for JpgImage. +func (ji JpgImage) AsCopyVideo() (*CopyVideo, bool) { + return nil, false +} + +// AsVideo is the BasicCodec implementation for JpgImage. +func (ji JpgImage) AsVideo() (*Video, bool) { + return nil, false +} + +// AsBasicVideo is the BasicCodec implementation for JpgImage. +func (ji JpgImage) AsBasicVideo() (BasicVideo, bool) { + return &ji, true +} + +// AsImage is the BasicCodec implementation for JpgImage. +func (ji JpgImage) AsImage() (*Image, bool) { + return nil, false +} + +// AsBasicImage is the BasicCodec implementation for JpgImage. +func (ji JpgImage) AsBasicImage() (BasicImage, bool) { + return &ji, true +} + +// AsCopyAudio is the BasicCodec implementation for JpgImage. +func (ji JpgImage) AsCopyAudio() (*CopyAudio, bool) { + return nil, false +} + +// AsH264Video is the BasicCodec implementation for JpgImage. +func (ji JpgImage) AsH264Video() (*H264Video, bool) { + return nil, false +} + +// AsJpgImage is the BasicCodec implementation for JpgImage. +func (ji JpgImage) AsJpgImage() (*JpgImage, bool) { + return &ji, true +} + +// AsPngImage is the BasicCodec implementation for JpgImage. +func (ji JpgImage) AsPngImage() (*PngImage, bool) { + return nil, false +} + +// AsCodec is the BasicCodec implementation for JpgImage. +func (ji JpgImage) AsCodec() (*Codec, bool) { + return nil, false +} + +// AsBasicCodec is the BasicCodec implementation for JpgImage. +func (ji JpgImage) AsBasicCodec() (BasicCodec, bool) { + return &ji, true +} + +// JpgLayer describes the settings to produce a JPEG image from the input video. +type JpgLayer struct { + // Quality - The compression quality of the JPEG output. Range is from 0-100 and the default is 70. + Quality *int32 `json:"quality,omitempty"` + // Width - The width of the output video for this layer. The value can be absolute (in pixels) or relative (in percentage). For example 50% means the output video has half as many pixels in width as the input. + Width *string `json:"width,omitempty"` + // Height - The height of the output video for this layer. The value can be absolute (in pixels) or relative (in percentage). For example 50% means the output video has half as many pixels in height as the input. + Height *string `json:"height,omitempty"` + // Label - The alphanumeric label for this layer, which can be used in multiplexing different video and audio layers, or in naming the output file. + Label *string `json:"label,omitempty"` + // OdataType - Possible values include: 'OdataTypeLayer', 'OdataTypeMicrosoftMediaVideoLayer', 'OdataTypeMicrosoftMediaH264Layer', 'OdataTypeMicrosoftMediaJpgLayer', 'OdataTypeMicrosoftMediaPngLayer' + OdataType OdataTypeBasicLayer `json:"@odata.type,omitempty"` +} + +// MarshalJSON is the custom marshaler for JpgLayer. +func (jl JpgLayer) MarshalJSON() ([]byte, error) { + jl.OdataType = OdataTypeMicrosoftMediaJpgLayer + objectMap := make(map[string]interface{}) + if jl.Quality != nil { + objectMap["quality"] = jl.Quality + } + if jl.Width != nil { + objectMap["width"] = jl.Width + } + if jl.Height != nil { + objectMap["height"] = jl.Height + } + if jl.Label != nil { + objectMap["label"] = jl.Label + } + if jl.OdataType != "" { + objectMap["@odata.type"] = jl.OdataType + } + return json.Marshal(objectMap) +} + +// AsVideoLayer is the BasicLayer implementation for JpgLayer. +func (jl JpgLayer) AsVideoLayer() (*VideoLayer, bool) { + return nil, false +} + +// AsBasicVideoLayer is the BasicLayer implementation for JpgLayer. +func (jl JpgLayer) AsBasicVideoLayer() (BasicVideoLayer, bool) { + return nil, false +} + +// AsH264Layer is the BasicLayer implementation for JpgLayer. +func (jl JpgLayer) AsH264Layer() (*H264Layer, bool) { + return nil, false +} + +// AsJpgLayer is the BasicLayer implementation for JpgLayer. +func (jl JpgLayer) AsJpgLayer() (*JpgLayer, bool) { + return &jl, true +} + +// AsPngLayer is the BasicLayer implementation for JpgLayer. +func (jl JpgLayer) AsPngLayer() (*PngLayer, bool) { + return nil, false +} + +// AsLayer is the BasicLayer implementation for JpgLayer. +func (jl JpgLayer) AsLayer() (*Layer, bool) { + return nil, false +} + +// AsBasicLayer is the BasicLayer implementation for JpgLayer. +func (jl JpgLayer) AsBasicLayer() (BasicLayer, bool) { + return &jl, true +} + +// BasicLayer the encoder can be configured to produce video and/or images (thumbnails) at different resolutions, by +// specifying a layer for each desired resolution. A layer represents the properties for the video or image at a +// resolution. +type BasicLayer interface { + AsVideoLayer() (*VideoLayer, bool) + AsBasicVideoLayer() (BasicVideoLayer, bool) + AsH264Layer() (*H264Layer, bool) + AsJpgLayer() (*JpgLayer, bool) + AsPngLayer() (*PngLayer, bool) + AsLayer() (*Layer, bool) +} + +// Layer the encoder can be configured to produce video and/or images (thumbnails) at different resolutions, by +// specifying a layer for each desired resolution. A layer represents the properties for the video or image at a +// resolution. +type Layer struct { + // Width - The width of the output video for this layer. The value can be absolute (in pixels) or relative (in percentage). For example 50% means the output video has half as many pixels in width as the input. + Width *string `json:"width,omitempty"` + // Height - The height of the output video for this layer. The value can be absolute (in pixels) or relative (in percentage). For example 50% means the output video has half as many pixels in height as the input. + Height *string `json:"height,omitempty"` + // Label - The alphanumeric label for this layer, which can be used in multiplexing different video and audio layers, or in naming the output file. + Label *string `json:"label,omitempty"` + // OdataType - Possible values include: 'OdataTypeLayer', 'OdataTypeMicrosoftMediaVideoLayer', 'OdataTypeMicrosoftMediaH264Layer', 'OdataTypeMicrosoftMediaJpgLayer', 'OdataTypeMicrosoftMediaPngLayer' + OdataType OdataTypeBasicLayer `json:"@odata.type,omitempty"` +} + +func unmarshalBasicLayer(body []byte) (BasicLayer, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["@odata.type"] { + case string(OdataTypeMicrosoftMediaVideoLayer): + var vl VideoLayer + err := json.Unmarshal(body, &vl) + return vl, err + case string(OdataTypeMicrosoftMediaH264Layer): + var hl H264Layer + err := json.Unmarshal(body, &hl) + return hl, err + case string(OdataTypeMicrosoftMediaJpgLayer): + var jl JpgLayer + err := json.Unmarshal(body, &jl) + return jl, err + case string(OdataTypeMicrosoftMediaPngLayer): + var pl PngLayer + err := json.Unmarshal(body, &pl) + return pl, err + default: + var l Layer + err := json.Unmarshal(body, &l) + return l, err + } +} +func unmarshalBasicLayerArray(body []byte) ([]BasicLayer, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + lArray := make([]BasicLayer, len(rawMessages)) + + for index, rawMessage := range rawMessages { + l, err := unmarshalBasicLayer(*rawMessage) + if err != nil { + return nil, err + } + lArray[index] = l + } + return lArray, nil +} + +// MarshalJSON is the custom marshaler for Layer. +func (l Layer) MarshalJSON() ([]byte, error) { + l.OdataType = OdataTypeLayer + objectMap := make(map[string]interface{}) + if l.Width != nil { + objectMap["width"] = l.Width + } + if l.Height != nil { + objectMap["height"] = l.Height + } + if l.Label != nil { + objectMap["label"] = l.Label + } + if l.OdataType != "" { + objectMap["@odata.type"] = l.OdataType + } + return json.Marshal(objectMap) +} + +// AsVideoLayer is the BasicLayer implementation for Layer. +func (l Layer) AsVideoLayer() (*VideoLayer, bool) { + return nil, false +} + +// AsBasicVideoLayer is the BasicLayer implementation for Layer. +func (l Layer) AsBasicVideoLayer() (BasicVideoLayer, bool) { + return nil, false +} + +// AsH264Layer is the BasicLayer implementation for Layer. +func (l Layer) AsH264Layer() (*H264Layer, bool) { + return nil, false +} + +// AsJpgLayer is the BasicLayer implementation for Layer. +func (l Layer) AsJpgLayer() (*JpgLayer, bool) { + return nil, false +} + +// AsPngLayer is the BasicLayer implementation for Layer. +func (l Layer) AsPngLayer() (*PngLayer, bool) { + return nil, false +} + +// AsLayer is the BasicLayer implementation for Layer. +func (l Layer) AsLayer() (*Layer, bool) { + return &l, true +} + +// AsBasicLayer is the BasicLayer implementation for Layer. +func (l Layer) AsBasicLayer() (BasicLayer, bool) { + return &l, true +} + +// ListContainerSasInput the parameters to the list SAS requet. +type ListContainerSasInput struct { + // Permissions - The permissions to set on the SAS URL. Possible values include: 'Read', 'ReadWrite', 'ReadWriteDelete' + Permissions AssetContainerPermission `json:"permissions,omitempty"` + // ExpiryTime - The SAS URL expiration time. This must be less than 24 hours from the current time. + ExpiryTime *date.Time `json:"expiryTime,omitempty"` +} + +// ListContentKeysResponse class of response for listContentKeys action +type ListContentKeysResponse struct { + autorest.Response `json:"-"` + // ContentKeys - ContentKeys used by current Streaming Locator + ContentKeys *[]StreamingLocatorContentKey `json:"contentKeys,omitempty"` +} + +// ListPathsResponse class of response for listPaths action +type ListPathsResponse struct { + autorest.Response `json:"-"` + // StreamingPaths - Streaming Paths supported by current Streaming Locator + StreamingPaths *[]StreamingPath `json:"streamingPaths,omitempty"` + // DownloadPaths - Download Paths supported by current Streaming Locator + DownloadPaths *[]string `json:"downloadPaths,omitempty"` +} + +// LiveEvent the Live Event. +type LiveEvent struct { + autorest.Response `json:"-"` + // LiveEventProperties - The Live Event properties. + *LiveEventProperties `json:"properties,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // Location - The Azure Region of the resource. + Location *string `json:"location,omitempty"` + // ID - Fully qualified resource ID for the resource. + ID *string `json:"id,omitempty"` + // Name - The name of the resource. + Name *string `json:"name,omitempty"` + // Type - The type of the resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for LiveEvent. +func (le LiveEvent) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if le.LiveEventProperties != nil { + objectMap["properties"] = le.LiveEventProperties + } + if le.Tags != nil { + objectMap["tags"] = le.Tags + } + if le.Location != nil { + objectMap["location"] = le.Location + } + if le.ID != nil { + objectMap["id"] = le.ID + } + if le.Name != nil { + objectMap["name"] = le.Name + } + if le.Type != nil { + objectMap["type"] = le.Type + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for LiveEvent struct. +func (le *LiveEvent) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var liveEventProperties LiveEventProperties + err = json.Unmarshal(*v, &liveEventProperties) + if err != nil { + return err + } + le.LiveEventProperties = &liveEventProperties + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + le.Tags = tags + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + le.Location = &location + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + le.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + le.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + le.Type = &typeVar + } + } + } + + return nil +} + +// LiveEventActionInput the LiveEvent action input parameter definition. +type LiveEventActionInput struct { + // RemoveOutputsOnStop - The flag indicates if remove LiveOutputs on Stop. + RemoveOutputsOnStop *bool `json:"removeOutputsOnStop,omitempty"` +} + +// LiveEventEncoding the Live Event encoding. +type LiveEventEncoding struct { + // EncodingType - The encoding type for Live Event. Possible values include: 'LiveEventEncodingTypeNone', 'LiveEventEncodingTypeBasic' + EncodingType LiveEventEncodingType `json:"encodingType,omitempty"` + // PresetName - The encoding preset name. + PresetName *string `json:"presetName,omitempty"` +} + +// LiveEventEndpoint the Live Event endpoint. +type LiveEventEndpoint struct { + // Protocol - The endpoint protocol. + Protocol *string `json:"protocol,omitempty"` + // URL - The endpoint URL. + URL *string `json:"url,omitempty"` +} + +// LiveEventInput the Live Event input. +type LiveEventInput struct { + // StreamingProtocol - The streaming protocol for the Live Event. Possible values include: 'FragmentedMP4', 'RTMP' + StreamingProtocol LiveEventInputProtocol `json:"streamingProtocol,omitempty"` + // KeyFrameIntervalDuration - ISO 8601 timespan duration of the key frame interval duration. + KeyFrameIntervalDuration *string `json:"keyFrameIntervalDuration,omitempty"` + // AccessToken - The access token. + AccessToken *string `json:"accessToken,omitempty"` + // Endpoints - The input endpoints for the Live Event. + Endpoints *[]LiveEventEndpoint `json:"endpoints,omitempty"` +} + +// LiveEventListResult the LiveEvent list result. +type LiveEventListResult struct { + autorest.Response `json:"-"` + // Value - The result of the List Live Event operation. + Value *[]LiveEvent `json:"value,omitempty"` + // OdataCount - The number of result. + OdataCount *int32 `json:"@odata.count,omitempty"` + // OdataNextLink - Th link to the next set of results. Not empty if value contains incomplete list of Live Outputs. + OdataNextLink *string `json:"@odata.nextLink,omitempty"` +} + +// LiveEventListResultIterator provides access to a complete listing of LiveEvent values. +type LiveEventListResultIterator struct { + i int + page LiveEventListResultPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *LiveEventListResultIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter LiveEventListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter LiveEventListResultIterator) Response() LiveEventListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter LiveEventListResultIterator) Value() LiveEvent { + if !iter.page.NotDone() { + return LiveEvent{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (lelr LiveEventListResult) IsEmpty() bool { + return lelr.Value == nil || len(*lelr.Value) == 0 +} + +// liveEventListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (lelr LiveEventListResult) liveEventListResultPreparer() (*http.Request, error) { + if lelr.OdataNextLink == nil || len(to.String(lelr.OdataNextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(lelr.OdataNextLink))) +} + +// LiveEventListResultPage contains a page of LiveEvent values. +type LiveEventListResultPage struct { + fn func(LiveEventListResult) (LiveEventListResult, error) + lelr LiveEventListResult +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *LiveEventListResultPage) Next() error { + next, err := page.fn(page.lelr) + if err != nil { + return err + } + page.lelr = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page LiveEventListResultPage) NotDone() bool { + return !page.lelr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page LiveEventListResultPage) Response() LiveEventListResult { + return page.lelr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page LiveEventListResultPage) Values() []LiveEvent { + if page.lelr.IsEmpty() { + return nil + } + return *page.lelr.Value +} + +// LiveEventPreview the Live Event preview. +type LiveEventPreview struct { + // Endpoints - The endpoints for preview. + Endpoints *[]LiveEventEndpoint `json:"endpoints,omitempty"` + // AccessControl - The access control for LiveEvent preview. + AccessControl *LiveEventPreviewAccessControl `json:"accessControl,omitempty"` + // PreviewLocator - The preview locator Guid. + PreviewLocator *string `json:"previewLocator,omitempty"` + // StreamingPolicyName - The name of streaming policy used for LiveEvent preview + StreamingPolicyName *string `json:"streamingPolicyName,omitempty"` + // AlternativeMediaID - An Alternative Media Identifier associated with the preview url. This identifier can be used to distinguish the preview of different live events for authorization purposes in the CustomLicenseAcquisitionUrlTemplate or the CustomKeyAcquisitionUrlTemplate of the StreamingPolicy specified in the StreamingPolicyName field. + AlternativeMediaID *string `json:"alternativeMediaId,omitempty"` +} + +// LiveEventPreviewAccessControl the IP access control for Live Event preview. +type LiveEventPreviewAccessControl struct { + // IP - The IP access control properties. + IP *IPAccessControl `json:"ip,omitempty"` +} + +// LiveEventProperties the Live Event properties. +type LiveEventProperties struct { + // Description - The Live Event description. + Description *string `json:"description,omitempty"` + // Input - The Live Event input. + Input *LiveEventInput `json:"input,omitempty"` + // Preview - The Live Event preview. + Preview *LiveEventPreview `json:"preview,omitempty"` + // Encoding - The Live Event encoding. + Encoding *LiveEventEncoding `json:"encoding,omitempty"` + // ProvisioningState - The provisioning state of the Live Event. + ProvisioningState *string `json:"provisioningState,omitempty"` + // ResourceState - The resource state of the Live Event. Possible values include: 'Stopped', 'Starting', 'Running', 'Stopping', 'Deleting' + ResourceState LiveEventResourceState `json:"resourceState,omitempty"` + // CrossSiteAccessPolicies - The Live Event access policies. + CrossSiteAccessPolicies *CrossSiteAccessPolicies `json:"crossSiteAccessPolicies,omitempty"` + // VanityURL - The Live Event vanity URL flag. + VanityURL *bool `json:"vanityUrl,omitempty"` + // StreamOptions - The stream options. + StreamOptions *[]StreamOptionsFlag `json:"streamOptions,omitempty"` + // Created - The exact time the Live Event was created. + Created *date.Time `json:"created,omitempty"` + // LastModified - The exact time the Live Event was last modified. + LastModified *date.Time `json:"lastModified,omitempty"` +} + +// LiveEventsCreateFuture an abstraction for monitoring and retrieving the results of a long-running operation. +type LiveEventsCreateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *LiveEventsCreateFuture) Result(client LiveEventsClient) (le LiveEvent, err error) { + var done bool + done, err = future.Done(client) + if err != nil { + err = autorest.NewErrorWithError(err, "media.LiveEventsCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("media.LiveEventsCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if le.Response.Response, err = future.GetResult(sender); err == nil && le.Response.Response.StatusCode != http.StatusNoContent { + le, err = client.CreateResponder(le.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "media.LiveEventsCreateFuture", "Result", le.Response.Response, "Failure responding to request") + } + } + return +} + +// LiveEventsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. +type LiveEventsDeleteFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *LiveEventsDeleteFuture) Result(client LiveEventsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.Done(client) + if err != nil { + err = autorest.NewErrorWithError(err, "media.LiveEventsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("media.LiveEventsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// LiveEventsResetFuture an abstraction for monitoring and retrieving the results of a long-running operation. +type LiveEventsResetFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *LiveEventsResetFuture) Result(client LiveEventsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.Done(client) + if err != nil { + err = autorest.NewErrorWithError(err, "media.LiveEventsResetFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("media.LiveEventsResetFuture") + return + } + ar.Response = future.Response() + return +} + +// LiveEventsStartFuture an abstraction for monitoring and retrieving the results of a long-running operation. +type LiveEventsStartFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *LiveEventsStartFuture) Result(client LiveEventsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.Done(client) + if err != nil { + err = autorest.NewErrorWithError(err, "media.LiveEventsStartFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("media.LiveEventsStartFuture") + return + } + ar.Response = future.Response() + return +} + +// LiveEventsStopFuture an abstraction for monitoring and retrieving the results of a long-running operation. +type LiveEventsStopFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *LiveEventsStopFuture) Result(client LiveEventsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.Done(client) + if err != nil { + err = autorest.NewErrorWithError(err, "media.LiveEventsStopFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("media.LiveEventsStopFuture") + return + } + ar.Response = future.Response() + return +} + +// LiveEventsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation. +type LiveEventsUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *LiveEventsUpdateFuture) Result(client LiveEventsClient) (le LiveEvent, err error) { + var done bool + done, err = future.Done(client) + if err != nil { + err = autorest.NewErrorWithError(err, "media.LiveEventsUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("media.LiveEventsUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if le.Response.Response, err = future.GetResult(sender); err == nil && le.Response.Response.StatusCode != http.StatusNoContent { + le, err = client.UpdateResponder(le.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "media.LiveEventsUpdateFuture", "Result", le.Response.Response, "Failure responding to request") + } + } + return +} + +// LiveOutput the Live Output. +type LiveOutput struct { + autorest.Response `json:"-"` + // LiveOutputProperties - The Live Output properties. + *LiveOutputProperties `json:"properties,omitempty"` + // ID - Fully qualified resource ID for the resource. + ID *string `json:"id,omitempty"` + // Name - The name of the resource. + Name *string `json:"name,omitempty"` + // Type - The type of the resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for LiveOutput. +func (lo LiveOutput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if lo.LiveOutputProperties != nil { + objectMap["properties"] = lo.LiveOutputProperties + } + if lo.ID != nil { + objectMap["id"] = lo.ID + } + if lo.Name != nil { + objectMap["name"] = lo.Name + } + if lo.Type != nil { + objectMap["type"] = lo.Type + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for LiveOutput struct. +func (lo *LiveOutput) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var liveOutputProperties LiveOutputProperties + err = json.Unmarshal(*v, &liveOutputProperties) + if err != nil { + return err + } + lo.LiveOutputProperties = &liveOutputProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + lo.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + lo.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + lo.Type = &typeVar + } + } + } + + return nil +} + +// LiveOutputListResult the LiveOutput list result. +type LiveOutputListResult struct { + autorest.Response `json:"-"` + // Value - The result of the List Live Output operation. + Value *[]LiveOutput `json:"value,omitempty"` + // OdataCount - The number of result. + OdataCount *int32 `json:"@odata.count,omitempty"` + // OdataNextLink - Th link to the next set of results. Not empty if value contains incomplete list of Live Outputs. + OdataNextLink *string `json:"@odata.nextLink,omitempty"` +} + +// LiveOutputListResultIterator provides access to a complete listing of LiveOutput values. +type LiveOutputListResultIterator struct { + i int + page LiveOutputListResultPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *LiveOutputListResultIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter LiveOutputListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter LiveOutputListResultIterator) Response() LiveOutputListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter LiveOutputListResultIterator) Value() LiveOutput { + if !iter.page.NotDone() { + return LiveOutput{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (lolr LiveOutputListResult) IsEmpty() bool { + return lolr.Value == nil || len(*lolr.Value) == 0 +} + +// liveOutputListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (lolr LiveOutputListResult) liveOutputListResultPreparer() (*http.Request, error) { + if lolr.OdataNextLink == nil || len(to.String(lolr.OdataNextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(lolr.OdataNextLink))) +} + +// LiveOutputListResultPage contains a page of LiveOutput values. +type LiveOutputListResultPage struct { + fn func(LiveOutputListResult) (LiveOutputListResult, error) + lolr LiveOutputListResult +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *LiveOutputListResultPage) Next() error { + next, err := page.fn(page.lolr) + if err != nil { + return err + } + page.lolr = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page LiveOutputListResultPage) NotDone() bool { + return !page.lolr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page LiveOutputListResultPage) Response() LiveOutputListResult { + return page.lolr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page LiveOutputListResultPage) Values() []LiveOutput { + if page.lolr.IsEmpty() { + return nil + } + return *page.lolr.Value +} + +// LiveOutputProperties the JSON object that contains the properties required to create a Live Output. +type LiveOutputProperties struct { + // Description - The description of the Live Output. + Description *string `json:"description,omitempty"` + // AssetName - The asset name. + AssetName *string `json:"assetName,omitempty"` + // ArchiveWindowLength - ISO 8601 timespan duration of the archive window length. This is duration that customer want to retain the recorded content. + ArchiveWindowLength *string `json:"archiveWindowLength,omitempty"` + // ManifestName - The manifest file name. + ManifestName *string `json:"manifestName,omitempty"` + // Hls - The HLS configuration. + Hls *Hls `json:"hls,omitempty"` + // OutputSnapTime - The output snapshot time. + OutputSnapTime *int64 `json:"outputSnapTime,omitempty"` + // Created - The exact time the Live Output was created. + Created *date.Time `json:"created,omitempty"` + // LastModified - The exact time the Live Output was last modified. + LastModified *date.Time `json:"lastModified,omitempty"` + // ProvisioningState - The provisioning state of the Live Output. + ProvisioningState *string `json:"provisioningState,omitempty"` + // ResourceState - The resource state of the Live Output. Possible values include: 'LiveOutputResourceStateCreating', 'LiveOutputResourceStateRunning', 'LiveOutputResourceStateDeleting' + ResourceState LiveOutputResourceState `json:"resourceState,omitempty"` +} + +// LiveOutputsCreateFuture an abstraction for monitoring and retrieving the results of a long-running operation. +type LiveOutputsCreateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *LiveOutputsCreateFuture) Result(client LiveOutputsClient) (lo LiveOutput, err error) { + var done bool + done, err = future.Done(client) + if err != nil { + err = autorest.NewErrorWithError(err, "media.LiveOutputsCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("media.LiveOutputsCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if lo.Response.Response, err = future.GetResult(sender); err == nil && lo.Response.Response.StatusCode != http.StatusNoContent { + lo, err = client.CreateResponder(lo.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "media.LiveOutputsCreateFuture", "Result", lo.Response.Response, "Failure responding to request") + } + } + return +} + +// LiveOutputsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. +type LiveOutputsDeleteFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *LiveOutputsDeleteFuture) Result(client LiveOutputsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.Done(client) + if err != nil { + err = autorest.NewErrorWithError(err, "media.LiveOutputsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("media.LiveOutputsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// Location ... +type Location struct { + Name *string `json:"name,omitempty"` +} + +// Mp4Format describes the properties for an output ISO MP4 file. +type Mp4Format struct { + // OutputFiles - The list of output files to produce. Each entry in the list is a set of audio and video layer labels to be muxed together . + OutputFiles *[]OutputFile `json:"outputFiles,omitempty"` + // FilenamePattern - The pattern of the file names for the generated output files. The following macros are supported in the file name: {Basename} - The base name of the input video {Extension} - The appropriate extension for this format. {Label} - The label assigned to the codec/layer. {Index} - A unique index for thumbnails. Only applicable to thumbnails. {Bitrate} - The audio/video bitrate. Not applicable to thumbnails. {Codec} - The type of the audio/video codec. Any unsubstituted macros will be collapsed and removed from the filename. + FilenamePattern *string `json:"filenamePattern,omitempty"` + // OdataType - Possible values include: 'OdataTypeFormat', 'OdataTypeMicrosoftMediaImageFormat', 'OdataTypeMicrosoftMediaJpgFormat', 'OdataTypeMicrosoftMediaPngFormat', 'OdataTypeMicrosoftMediaMultiBitrateFormat', 'OdataTypeMicrosoftMediaMp4Format', 'OdataTypeMicrosoftMediaTransportStreamFormat' + OdataType OdataTypeBasicFormat `json:"@odata.type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Mp4Format. +func (m4f Mp4Format) MarshalJSON() ([]byte, error) { + m4f.OdataType = OdataTypeMicrosoftMediaMp4Format + objectMap := make(map[string]interface{}) + if m4f.OutputFiles != nil { + objectMap["outputFiles"] = m4f.OutputFiles + } + if m4f.FilenamePattern != nil { + objectMap["filenamePattern"] = m4f.FilenamePattern + } + if m4f.OdataType != "" { + objectMap["@odata.type"] = m4f.OdataType + } + return json.Marshal(objectMap) +} + +// AsImageFormat is the BasicFormat implementation for Mp4Format. +func (m4f Mp4Format) AsImageFormat() (*ImageFormat, bool) { + return nil, false +} + +// AsBasicImageFormat is the BasicFormat implementation for Mp4Format. +func (m4f Mp4Format) AsBasicImageFormat() (BasicImageFormat, bool) { + return nil, false +} + +// AsJpgFormat is the BasicFormat implementation for Mp4Format. +func (m4f Mp4Format) AsJpgFormat() (*JpgFormat, bool) { + return nil, false +} + +// AsPngFormat is the BasicFormat implementation for Mp4Format. +func (m4f Mp4Format) AsPngFormat() (*PngFormat, bool) { + return nil, false +} + +// AsMultiBitrateFormat is the BasicFormat implementation for Mp4Format. +func (m4f Mp4Format) AsMultiBitrateFormat() (*MultiBitrateFormat, bool) { + return nil, false +} + +// AsBasicMultiBitrateFormat is the BasicFormat implementation for Mp4Format. +func (m4f Mp4Format) AsBasicMultiBitrateFormat() (BasicMultiBitrateFormat, bool) { + return &m4f, true +} + +// AsMp4Format is the BasicFormat implementation for Mp4Format. +func (m4f Mp4Format) AsMp4Format() (*Mp4Format, bool) { + return &m4f, true +} + +// AsTransportStreamFormat is the BasicFormat implementation for Mp4Format. +func (m4f Mp4Format) AsTransportStreamFormat() (*TransportStreamFormat, bool) { + return nil, false +} + +// AsFormat is the BasicFormat implementation for Mp4Format. +func (m4f Mp4Format) AsFormat() (*Format, bool) { + return nil, false +} + +// AsBasicFormat is the BasicFormat implementation for Mp4Format. +func (m4f Mp4Format) AsBasicFormat() (BasicFormat, bool) { + return &m4f, true +} + +// BasicMultiBitrateFormat describes the properties for producing a collection of GOP aligned multi-bitrate files. The +// default behavior is to produce one output file for each video layer which is muxed together with all the audios. The +// exact output files produced can be controlled by specifying the outputFiles collection. +type BasicMultiBitrateFormat interface { + AsMp4Format() (*Mp4Format, bool) + AsTransportStreamFormat() (*TransportStreamFormat, bool) + AsMultiBitrateFormat() (*MultiBitrateFormat, bool) +} + +// MultiBitrateFormat describes the properties for producing a collection of GOP aligned multi-bitrate files. The +// default behavior is to produce one output file for each video layer which is muxed together with all the audios. +// The exact output files produced can be controlled by specifying the outputFiles collection. +type MultiBitrateFormat struct { + // OutputFiles - The list of output files to produce. Each entry in the list is a set of audio and video layer labels to be muxed together . + OutputFiles *[]OutputFile `json:"outputFiles,omitempty"` + // FilenamePattern - The pattern of the file names for the generated output files. The following macros are supported in the file name: {Basename} - The base name of the input video {Extension} - The appropriate extension for this format. {Label} - The label assigned to the codec/layer. {Index} - A unique index for thumbnails. Only applicable to thumbnails. {Bitrate} - The audio/video bitrate. Not applicable to thumbnails. {Codec} - The type of the audio/video codec. Any unsubstituted macros will be collapsed and removed from the filename. + FilenamePattern *string `json:"filenamePattern,omitempty"` + // OdataType - Possible values include: 'OdataTypeFormat', 'OdataTypeMicrosoftMediaImageFormat', 'OdataTypeMicrosoftMediaJpgFormat', 'OdataTypeMicrosoftMediaPngFormat', 'OdataTypeMicrosoftMediaMultiBitrateFormat', 'OdataTypeMicrosoftMediaMp4Format', 'OdataTypeMicrosoftMediaTransportStreamFormat' + OdataType OdataTypeBasicFormat `json:"@odata.type,omitempty"` +} + +func unmarshalBasicMultiBitrateFormat(body []byte) (BasicMultiBitrateFormat, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["@odata.type"] { + case string(OdataTypeMicrosoftMediaMp4Format): + var m4f Mp4Format + err := json.Unmarshal(body, &m4f) + return m4f, err + case string(OdataTypeMicrosoftMediaTransportStreamFormat): + var tsf TransportStreamFormat + err := json.Unmarshal(body, &tsf) + return tsf, err + default: + var mbf MultiBitrateFormat + err := json.Unmarshal(body, &mbf) + return mbf, err + } +} +func unmarshalBasicMultiBitrateFormatArray(body []byte) ([]BasicMultiBitrateFormat, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + mbfArray := make([]BasicMultiBitrateFormat, len(rawMessages)) + + for index, rawMessage := range rawMessages { + mbf, err := unmarshalBasicMultiBitrateFormat(*rawMessage) + if err != nil { + return nil, err + } + mbfArray[index] = mbf + } + return mbfArray, nil +} + +// MarshalJSON is the custom marshaler for MultiBitrateFormat. +func (mbf MultiBitrateFormat) MarshalJSON() ([]byte, error) { + mbf.OdataType = OdataTypeMicrosoftMediaMultiBitrateFormat + objectMap := make(map[string]interface{}) + if mbf.OutputFiles != nil { + objectMap["outputFiles"] = mbf.OutputFiles + } + if mbf.FilenamePattern != nil { + objectMap["filenamePattern"] = mbf.FilenamePattern + } + if mbf.OdataType != "" { + objectMap["@odata.type"] = mbf.OdataType + } + return json.Marshal(objectMap) +} + +// AsImageFormat is the BasicFormat implementation for MultiBitrateFormat. +func (mbf MultiBitrateFormat) AsImageFormat() (*ImageFormat, bool) { + return nil, false +} + +// AsBasicImageFormat is the BasicFormat implementation for MultiBitrateFormat. +func (mbf MultiBitrateFormat) AsBasicImageFormat() (BasicImageFormat, bool) { + return nil, false +} + +// AsJpgFormat is the BasicFormat implementation for MultiBitrateFormat. +func (mbf MultiBitrateFormat) AsJpgFormat() (*JpgFormat, bool) { + return nil, false +} + +// AsPngFormat is the BasicFormat implementation for MultiBitrateFormat. +func (mbf MultiBitrateFormat) AsPngFormat() (*PngFormat, bool) { + return nil, false +} + +// AsMultiBitrateFormat is the BasicFormat implementation for MultiBitrateFormat. +func (mbf MultiBitrateFormat) AsMultiBitrateFormat() (*MultiBitrateFormat, bool) { + return &mbf, true +} + +// AsBasicMultiBitrateFormat is the BasicFormat implementation for MultiBitrateFormat. +func (mbf MultiBitrateFormat) AsBasicMultiBitrateFormat() (BasicMultiBitrateFormat, bool) { + return &mbf, true +} + +// AsMp4Format is the BasicFormat implementation for MultiBitrateFormat. +func (mbf MultiBitrateFormat) AsMp4Format() (*Mp4Format, bool) { + return nil, false +} + +// AsTransportStreamFormat is the BasicFormat implementation for MultiBitrateFormat. +func (mbf MultiBitrateFormat) AsTransportStreamFormat() (*TransportStreamFormat, bool) { + return nil, false +} + +// AsFormat is the BasicFormat implementation for MultiBitrateFormat. +func (mbf MultiBitrateFormat) AsFormat() (*Format, bool) { + return nil, false +} + +// AsBasicFormat is the BasicFormat implementation for MultiBitrateFormat. +func (mbf MultiBitrateFormat) AsBasicFormat() (BasicFormat, bool) { + return &mbf, true +} + +// NoEncryption class for NoEncryption scheme +type NoEncryption struct { + // EnabledProtocols - Representing supported protocols + EnabledProtocols *EnabledProtocols `json:"enabledProtocols,omitempty"` +} + +// ODataError information about an error. +type ODataError struct { + // Code - A language-independent error name. + Code *string `json:"code,omitempty"` + // Message - The error message. + Message *string `json:"message,omitempty"` + // Target - The target of the error (for example, the name of the property in error). + Target *string `json:"target,omitempty"` + // Details - The error details. + Details *[]ODataError `json:"details,omitempty"` +} + +// Operation an operation. +type Operation struct { + // Name - The operation name. + Name *string `json:"name,omitempty"` + // Display - The operation display name. + Display *OperationDisplay `json:"display,omitempty"` +} + +// OperationCollection a collection of Operation items. +type OperationCollection struct { + autorest.Response `json:"-"` + // Value - A collection of Operation items. + Value *[]Operation `json:"value,omitempty"` + // OdataNextLink - A link to the next page of the collection (when the collection contains too many results to return in one response). + OdataNextLink *string `json:"@odata.nextLink,omitempty"` +} + +// OperationCollectionIterator provides access to a complete listing of Operation values. +type OperationCollectionIterator struct { + i int + page OperationCollectionPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *OperationCollectionIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter OperationCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter OperationCollectionIterator) Response() OperationCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter OperationCollectionIterator) Value() Operation { + if !iter.page.NotDone() { + return Operation{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (oc OperationCollection) IsEmpty() bool { + return oc.Value == nil || len(*oc.Value) == 0 +} + +// operationCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (oc OperationCollection) operationCollectionPreparer() (*http.Request, error) { + if oc.OdataNextLink == nil || len(to.String(oc.OdataNextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(oc.OdataNextLink))) +} + +// OperationCollectionPage contains a page of Operation values. +type OperationCollectionPage struct { + fn func(OperationCollection) (OperationCollection, error) + oc OperationCollection +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *OperationCollectionPage) Next() error { + next, err := page.fn(page.oc) + if err != nil { + return err + } + page.oc = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page OperationCollectionPage) NotDone() bool { + return !page.oc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page OperationCollectionPage) Response() OperationCollection { + return page.oc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page OperationCollectionPage) Values() []Operation { + if page.oc.IsEmpty() { + return nil + } + return *page.oc.Value +} + +// OperationDisplay operation details. +type OperationDisplay struct { + // Provider - The service provider. + Provider *string `json:"provider,omitempty"` + // Resource - Resource on which the operation is performed. + Resource *string `json:"resource,omitempty"` + // Operation - The operation type. + Operation *string `json:"operation,omitempty"` + // Description - The operation description. + Description *string `json:"description,omitempty"` +} + +// OutputFile represents an output file produced. +type OutputFile struct { + // Labels - The list of labels that describe how the encoder should multiplex video and audio into an output file. For example, if the encoder is producing two video layers with labels v1 and v2, and one audio layer with label a1, then an array like '[v1, a1]' tells the encoder to produce an output file with the video track represented by v1 and the audio track represented by a1. + Labels *[]string `json:"labels,omitempty"` +} + +// BasicOverlay base type for all overlays - image, audio or video. +type BasicOverlay interface { + AsAudioOverlay() (*AudioOverlay, bool) + AsVideoOverlay() (*VideoOverlay, bool) + AsOverlay() (*Overlay, bool) +} + +// Overlay base type for all overlays - image, audio or video. +type Overlay struct { + // InputLabel - The label of the job input which is to be used as an overlay. The Input must specify exactly one file. You can specify an image file in JPG or PNG formats, or an audio file (such as a WAV, MP3, WMA or M4A file), or a video file. See https://aka.ms/mesformats for the complete list of supported audio and video file formats. + InputLabel *string `json:"inputLabel,omitempty"` + // Start - The start position, with reference to the input video, at which the overlay starts. The value should be in ISO 8601 format. For example, PT05S to start the overlay at 5 seconds in to the input video. If not specified the overlay starts from the beginning of the input video. + Start *string `json:"start,omitempty"` + // End - The position in the input video at which the overlay ends. The value should be in ISO 8601 duration format. For example, PT30S to end the overlay at 30 seconds in to the input video. If not specified the overlay will be applied until the end of the input video if inputLoop is true. Else, if inputLoop is false, then overlay will last as long as the duration of the overlay media. + End *string `json:"end,omitempty"` + // FadeInDuration - The duration over which the overlay fades in onto the input video. The value should be in ISO 8601 duration format. If not specified the default behavior is to have no fade in (same as PT0S). + FadeInDuration *string `json:"fadeInDuration,omitempty"` + // FadeOutDuration - The duration over which the overlay fades out of the input video. The value should be in ISO 8601 duration format. If not specified the default behavior is to have no fade out (same as PT0S). + FadeOutDuration *string `json:"fadeOutDuration,omitempty"` + // AudioGainLevel - The gain level of audio in the overlay. The value should be in the range [0, 1.0]. The default is 1.0. + AudioGainLevel *float64 `json:"audioGainLevel,omitempty"` + // OdataType - Possible values include: 'OdataTypeOverlay', 'OdataTypeMicrosoftMediaAudioOverlay', 'OdataTypeMicrosoftMediaVideoOverlay' + OdataType OdataTypeBasicOverlay `json:"@odata.type,omitempty"` +} + +func unmarshalBasicOverlay(body []byte) (BasicOverlay, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["@odata.type"] { + case string(OdataTypeMicrosoftMediaAudioOverlay): + var ao AudioOverlay + err := json.Unmarshal(body, &ao) + return ao, err + case string(OdataTypeMicrosoftMediaVideoOverlay): + var vo VideoOverlay + err := json.Unmarshal(body, &vo) + return vo, err + default: + var o Overlay + err := json.Unmarshal(body, &o) + return o, err + } +} +func unmarshalBasicOverlayArray(body []byte) ([]BasicOverlay, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + oArray := make([]BasicOverlay, len(rawMessages)) + + for index, rawMessage := range rawMessages { + o, err := unmarshalBasicOverlay(*rawMessage) + if err != nil { + return nil, err + } + oArray[index] = o + } + return oArray, nil +} + +// MarshalJSON is the custom marshaler for Overlay. +func (o Overlay) MarshalJSON() ([]byte, error) { + o.OdataType = OdataTypeOverlay + objectMap := make(map[string]interface{}) + if o.InputLabel != nil { + objectMap["inputLabel"] = o.InputLabel + } + if o.Start != nil { + objectMap["start"] = o.Start + } + if o.End != nil { + objectMap["end"] = o.End + } + if o.FadeInDuration != nil { + objectMap["fadeInDuration"] = o.FadeInDuration + } + if o.FadeOutDuration != nil { + objectMap["fadeOutDuration"] = o.FadeOutDuration + } + if o.AudioGainLevel != nil { + objectMap["audioGainLevel"] = o.AudioGainLevel + } + if o.OdataType != "" { + objectMap["@odata.type"] = o.OdataType + } + return json.Marshal(objectMap) +} + +// AsAudioOverlay is the BasicOverlay implementation for Overlay. +func (o Overlay) AsAudioOverlay() (*AudioOverlay, bool) { + return nil, false +} + +// AsVideoOverlay is the BasicOverlay implementation for Overlay. +func (o Overlay) AsVideoOverlay() (*VideoOverlay, bool) { + return nil, false +} + +// AsOverlay is the BasicOverlay implementation for Overlay. +func (o Overlay) AsOverlay() (*Overlay, bool) { + return &o, true +} + +// AsBasicOverlay is the BasicOverlay implementation for Overlay. +func (o Overlay) AsBasicOverlay() (BasicOverlay, bool) { + return &o, true +} + +// PngFormat describes the settings for producing PNG thumbnails. +type PngFormat struct { + // FilenamePattern - The pattern of the file names for the generated output files. The following macros are supported in the file name: {Basename} - The base name of the input video {Extension} - The appropriate extension for this format. {Label} - The label assigned to the codec/layer. {Index} - A unique index for thumbnails. Only applicable to thumbnails. {Bitrate} - The audio/video bitrate. Not applicable to thumbnails. {Codec} - The type of the audio/video codec. Any unsubstituted macros will be collapsed and removed from the filename. + FilenamePattern *string `json:"filenamePattern,omitempty"` + // OdataType - Possible values include: 'OdataTypeFormat', 'OdataTypeMicrosoftMediaImageFormat', 'OdataTypeMicrosoftMediaJpgFormat', 'OdataTypeMicrosoftMediaPngFormat', 'OdataTypeMicrosoftMediaMultiBitrateFormat', 'OdataTypeMicrosoftMediaMp4Format', 'OdataTypeMicrosoftMediaTransportStreamFormat' + OdataType OdataTypeBasicFormat `json:"@odata.type,omitempty"` +} + +// MarshalJSON is the custom marshaler for PngFormat. +func (pf PngFormat) MarshalJSON() ([]byte, error) { + pf.OdataType = OdataTypeMicrosoftMediaPngFormat + objectMap := make(map[string]interface{}) + if pf.FilenamePattern != nil { + objectMap["filenamePattern"] = pf.FilenamePattern + } + if pf.OdataType != "" { + objectMap["@odata.type"] = pf.OdataType + } + return json.Marshal(objectMap) +} + +// AsImageFormat is the BasicFormat implementation for PngFormat. +func (pf PngFormat) AsImageFormat() (*ImageFormat, bool) { + return nil, false +} + +// AsBasicImageFormat is the BasicFormat implementation for PngFormat. +func (pf PngFormat) AsBasicImageFormat() (BasicImageFormat, bool) { + return &pf, true +} + +// AsJpgFormat is the BasicFormat implementation for PngFormat. +func (pf PngFormat) AsJpgFormat() (*JpgFormat, bool) { + return nil, false +} + +// AsPngFormat is the BasicFormat implementation for PngFormat. +func (pf PngFormat) AsPngFormat() (*PngFormat, bool) { + return &pf, true +} + +// AsMultiBitrateFormat is the BasicFormat implementation for PngFormat. +func (pf PngFormat) AsMultiBitrateFormat() (*MultiBitrateFormat, bool) { + return nil, false +} + +// AsBasicMultiBitrateFormat is the BasicFormat implementation for PngFormat. +func (pf PngFormat) AsBasicMultiBitrateFormat() (BasicMultiBitrateFormat, bool) { + return nil, false +} + +// AsMp4Format is the BasicFormat implementation for PngFormat. +func (pf PngFormat) AsMp4Format() (*Mp4Format, bool) { + return nil, false +} + +// AsTransportStreamFormat is the BasicFormat implementation for PngFormat. +func (pf PngFormat) AsTransportStreamFormat() (*TransportStreamFormat, bool) { + return nil, false +} + +// AsFormat is the BasicFormat implementation for PngFormat. +func (pf PngFormat) AsFormat() (*Format, bool) { + return nil, false +} + +// AsBasicFormat is the BasicFormat implementation for PngFormat. +func (pf PngFormat) AsBasicFormat() (BasicFormat, bool) { + return &pf, true +} + +// PngImage describes the properties for producing a series of PNG images from the input video. +type PngImage struct { + // Layers - A collection of output PNG image layers to be produced by the encoder. + Layers *[]PngLayer `json:"layers,omitempty"` + // Start - The position in the input video from where to start generating thumbnails. The value can be in absolute timestamp (ISO 8601, e.g: PT05S), or a frame count (For example, 10 for the 10th frame), or a relative value (For example, 1%). Also supports a macro {Best}, which tells the encoder to select the best thumbnail from the first few seconds of the video. + Start *string `json:"start,omitempty"` + // Step - The intervals at which thumbnails are generated. The value can be in absolute timestamp (ISO 8601, e.g: PT05S for one image every 5 seconds), or a frame count (For example, 30 for every 30 frames), or a relative value (For example, 1%). + Step *string `json:"step,omitempty"` + // Range - The position in the input video at which to stop generating thumbnails. The value can be in absolute timestamp (ISO 8601, e.g: PT5M30S to stop at 5 minutes and 30 seconds), or a frame count (For example, 300 to stop at the 300th frame), or a relative value (For example, 100%). + Range *string `json:"range,omitempty"` + // KeyFrameInterval - The distance between two key frames, thereby defining a group of pictures (GOP). The value should be a non-zero integer in the range [1, 30] seconds, specified in ISO 8601 format. The default is 2 seconds (PT2S). + KeyFrameInterval *string `json:"keyFrameInterval,omitempty"` + // StretchMode - The resizing mode - how the input video will be resized to fit the desired output resolution(s). Default is AutoSize. Possible values include: 'StretchModeNone', 'StretchModeAutoSize', 'StretchModeAutoFit' + StretchMode StretchMode `json:"stretchMode,omitempty"` + // Label - An optional label for the codec. The label can be used to control muxing behavior. + Label *string `json:"label,omitempty"` + // OdataType - Possible values include: 'OdataTypeCodec', 'OdataTypeMicrosoftMediaAudio', 'OdataTypeMicrosoftMediaAacAudio', 'OdataTypeMicrosoftMediaCopyVideo', 'OdataTypeMicrosoftMediaVideo', 'OdataTypeMicrosoftMediaImage', 'OdataTypeMicrosoftMediaCopyAudio', 'OdataTypeMicrosoftMediaH264Video', 'OdataTypeMicrosoftMediaJpgImage', 'OdataTypeMicrosoftMediaPngImage' + OdataType OdataTypeBasicCodec `json:"@odata.type,omitempty"` +} + +// MarshalJSON is the custom marshaler for PngImage. +func (pi PngImage) MarshalJSON() ([]byte, error) { + pi.OdataType = OdataTypeMicrosoftMediaPngImage + objectMap := make(map[string]interface{}) + if pi.Layers != nil { + objectMap["layers"] = pi.Layers + } + if pi.Start != nil { + objectMap["start"] = pi.Start + } + if pi.Step != nil { + objectMap["step"] = pi.Step + } + if pi.Range != nil { + objectMap["range"] = pi.Range + } + if pi.KeyFrameInterval != nil { + objectMap["keyFrameInterval"] = pi.KeyFrameInterval + } + if pi.StretchMode != "" { + objectMap["stretchMode"] = pi.StretchMode + } + if pi.Label != nil { + objectMap["label"] = pi.Label + } + if pi.OdataType != "" { + objectMap["@odata.type"] = pi.OdataType + } + return json.Marshal(objectMap) +} + +// AsAudio is the BasicCodec implementation for PngImage. +func (pi PngImage) AsAudio() (*Audio, bool) { + return nil, false +} + +// AsBasicAudio is the BasicCodec implementation for PngImage. +func (pi PngImage) AsBasicAudio() (BasicAudio, bool) { + return nil, false +} + +// AsAacAudio is the BasicCodec implementation for PngImage. +func (pi PngImage) AsAacAudio() (*AacAudio, bool) { + return nil, false +} + +// AsCopyVideo is the BasicCodec implementation for PngImage. +func (pi PngImage) AsCopyVideo() (*CopyVideo, bool) { + return nil, false +} + +// AsVideo is the BasicCodec implementation for PngImage. +func (pi PngImage) AsVideo() (*Video, bool) { + return nil, false +} + +// AsBasicVideo is the BasicCodec implementation for PngImage. +func (pi PngImage) AsBasicVideo() (BasicVideo, bool) { + return &pi, true +} + +// AsImage is the BasicCodec implementation for PngImage. +func (pi PngImage) AsImage() (*Image, bool) { + return nil, false +} + +// AsBasicImage is the BasicCodec implementation for PngImage. +func (pi PngImage) AsBasicImage() (BasicImage, bool) { + return &pi, true +} + +// AsCopyAudio is the BasicCodec implementation for PngImage. +func (pi PngImage) AsCopyAudio() (*CopyAudio, bool) { + return nil, false +} + +// AsH264Video is the BasicCodec implementation for PngImage. +func (pi PngImage) AsH264Video() (*H264Video, bool) { + return nil, false +} + +// AsJpgImage is the BasicCodec implementation for PngImage. +func (pi PngImage) AsJpgImage() (*JpgImage, bool) { + return nil, false +} + +// AsPngImage is the BasicCodec implementation for PngImage. +func (pi PngImage) AsPngImage() (*PngImage, bool) { + return &pi, true +} + +// AsCodec is the BasicCodec implementation for PngImage. +func (pi PngImage) AsCodec() (*Codec, bool) { + return nil, false +} + +// AsBasicCodec is the BasicCodec implementation for PngImage. +func (pi PngImage) AsBasicCodec() (BasicCodec, bool) { + return &pi, true +} + +// PngLayer describes the settings to produce a PNG image from the input video. +type PngLayer struct { + // Width - The width of the output video for this layer. The value can be absolute (in pixels) or relative (in percentage). For example 50% means the output video has half as many pixels in width as the input. + Width *string `json:"width,omitempty"` + // Height - The height of the output video for this layer. The value can be absolute (in pixels) or relative (in percentage). For example 50% means the output video has half as many pixels in height as the input. + Height *string `json:"height,omitempty"` + // Label - The alphanumeric label for this layer, which can be used in multiplexing different video and audio layers, or in naming the output file. + Label *string `json:"label,omitempty"` + // OdataType - Possible values include: 'OdataTypeLayer', 'OdataTypeMicrosoftMediaVideoLayer', 'OdataTypeMicrosoftMediaH264Layer', 'OdataTypeMicrosoftMediaJpgLayer', 'OdataTypeMicrosoftMediaPngLayer' + OdataType OdataTypeBasicLayer `json:"@odata.type,omitempty"` +} + +// MarshalJSON is the custom marshaler for PngLayer. +func (pl PngLayer) MarshalJSON() ([]byte, error) { + pl.OdataType = OdataTypeMicrosoftMediaPngLayer + objectMap := make(map[string]interface{}) + if pl.Width != nil { + objectMap["width"] = pl.Width + } + if pl.Height != nil { + objectMap["height"] = pl.Height + } + if pl.Label != nil { + objectMap["label"] = pl.Label + } + if pl.OdataType != "" { + objectMap["@odata.type"] = pl.OdataType + } + return json.Marshal(objectMap) +} + +// AsVideoLayer is the BasicLayer implementation for PngLayer. +func (pl PngLayer) AsVideoLayer() (*VideoLayer, bool) { + return nil, false +} + +// AsBasicVideoLayer is the BasicLayer implementation for PngLayer. +func (pl PngLayer) AsBasicVideoLayer() (BasicVideoLayer, bool) { + return nil, false +} + +// AsH264Layer is the BasicLayer implementation for PngLayer. +func (pl PngLayer) AsH264Layer() (*H264Layer, bool) { + return nil, false +} + +// AsJpgLayer is the BasicLayer implementation for PngLayer. +func (pl PngLayer) AsJpgLayer() (*JpgLayer, bool) { + return nil, false +} + +// AsPngLayer is the BasicLayer implementation for PngLayer. +func (pl PngLayer) AsPngLayer() (*PngLayer, bool) { + return &pl, true +} + +// AsLayer is the BasicLayer implementation for PngLayer. +func (pl PngLayer) AsLayer() (*Layer, bool) { + return nil, false +} + +// AsBasicLayer is the BasicLayer implementation for PngLayer. +func (pl PngLayer) AsBasicLayer() (BasicLayer, bool) { + return &pl, true +} + +// BasicPreset base type for all Presets, which define the recipe or instructions on how the input media files should +// be processed. +type BasicPreset interface { + AsAudioAnalyzerPreset() (*AudioAnalyzerPreset, bool) + AsBasicAudioAnalyzerPreset() (BasicAudioAnalyzerPreset, bool) + AsBuiltInStandardEncoderPreset() (*BuiltInStandardEncoderPreset, bool) + AsStandardEncoderPreset() (*StandardEncoderPreset, bool) + AsVideoAnalyzerPreset() (*VideoAnalyzerPreset, bool) + AsPreset() (*Preset, bool) +} + +// Preset base type for all Presets, which define the recipe or instructions on how the input media files should be +// processed. +type Preset struct { + // OdataType - Possible values include: 'OdataTypePreset', 'OdataTypeMicrosoftMediaAudioAnalyzerPreset', 'OdataTypeMicrosoftMediaBuiltInStandardEncoderPreset', 'OdataTypeMicrosoftMediaStandardEncoderPreset', 'OdataTypeMicrosoftMediaVideoAnalyzerPreset' + OdataType OdataTypeBasicPreset `json:"@odata.type,omitempty"` +} + +func unmarshalBasicPreset(body []byte) (BasicPreset, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["@odata.type"] { + case string(OdataTypeMicrosoftMediaAudioAnalyzerPreset): + var aap AudioAnalyzerPreset + err := json.Unmarshal(body, &aap) + return aap, err + case string(OdataTypeMicrosoftMediaBuiltInStandardEncoderPreset): + var bisep BuiltInStandardEncoderPreset + err := json.Unmarshal(body, &bisep) + return bisep, err + case string(OdataTypeMicrosoftMediaStandardEncoderPreset): + var sep StandardEncoderPreset + err := json.Unmarshal(body, &sep) + return sep, err + case string(OdataTypeMicrosoftMediaVideoAnalyzerPreset): + var vap VideoAnalyzerPreset + err := json.Unmarshal(body, &vap) + return vap, err + default: + var p Preset + err := json.Unmarshal(body, &p) + return p, err + } +} +func unmarshalBasicPresetArray(body []byte) ([]BasicPreset, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + pArray := make([]BasicPreset, len(rawMessages)) + + for index, rawMessage := range rawMessages { + p, err := unmarshalBasicPreset(*rawMessage) + if err != nil { + return nil, err + } + pArray[index] = p + } + return pArray, nil +} + +// MarshalJSON is the custom marshaler for Preset. +func (p Preset) MarshalJSON() ([]byte, error) { + p.OdataType = OdataTypePreset + objectMap := make(map[string]interface{}) + if p.OdataType != "" { + objectMap["@odata.type"] = p.OdataType + } + return json.Marshal(objectMap) +} + +// AsAudioAnalyzerPreset is the BasicPreset implementation for Preset. +func (p Preset) AsAudioAnalyzerPreset() (*AudioAnalyzerPreset, bool) { + return nil, false +} + +// AsBasicAudioAnalyzerPreset is the BasicPreset implementation for Preset. +func (p Preset) AsBasicAudioAnalyzerPreset() (BasicAudioAnalyzerPreset, bool) { + return nil, false +} + +// AsBuiltInStandardEncoderPreset is the BasicPreset implementation for Preset. +func (p Preset) AsBuiltInStandardEncoderPreset() (*BuiltInStandardEncoderPreset, bool) { + return nil, false +} + +// AsStandardEncoderPreset is the BasicPreset implementation for Preset. +func (p Preset) AsStandardEncoderPreset() (*StandardEncoderPreset, bool) { + return nil, false +} + +// AsVideoAnalyzerPreset is the BasicPreset implementation for Preset. +func (p Preset) AsVideoAnalyzerPreset() (*VideoAnalyzerPreset, bool) { + return nil, false +} + +// AsPreset is the BasicPreset implementation for Preset. +func (p Preset) AsPreset() (*Preset, bool) { + return &p, true +} + +// AsBasicPreset is the BasicPreset implementation for Preset. +func (p Preset) AsBasicPreset() (BasicPreset, bool) { + return &p, true +} + +// Provider a resource provider. +type Provider struct { + // ProviderName - The provider name. + ProviderName *string `json:"providerName,omitempty"` +} + +// ProxyResource the resource model definition for a ARM proxy resource. +type ProxyResource struct { + // ID - Fully qualified resource ID for the resource. + ID *string `json:"id,omitempty"` + // Name - The name of the resource. + Name *string `json:"name,omitempty"` + // Type - The type of the resource. + Type *string `json:"type,omitempty"` +} + +// Rectangle describes the properties of a rectangular window applied to the input media before processing it. +type Rectangle struct { + // Left - The number of pixels from the left-margin. This can be absolute pixel value (e.g 100), or relative to the size of the video (For example, 50%). + Left *string `json:"left,omitempty"` + // Top - The number of pixels from the top-margin. This can be absolute pixel value (e.g 100), or relative to the size of the video (For example, 50%). + Top *string `json:"top,omitempty"` + // Width - The width of the rectangular region in pixels. This can be absolute pixel value (e.g 100), or relative to the size of the video (For example, 50%). + Width *string `json:"width,omitempty"` + // Height - The height of the rectangular region in pixels. This can be absolute pixel value (e.g 100), or relative to the size of the video (For example, 50%). + Height *string `json:"height,omitempty"` +} + +// Resource the core properties of ARM resources. +type Resource struct { + // ID - Fully qualified resource ID for the resource. + ID *string `json:"id,omitempty"` + // Name - The name of the resource. + Name *string `json:"name,omitempty"` + // Type - The type of the resource. + Type *string `json:"type,omitempty"` +} + +// Service a Media Services account. +type Service struct { + autorest.Response `json:"-"` + // ServiceProperties - The resource properties. + *ServiceProperties `json:"properties,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // Location - The Azure Region of the resource. + Location *string `json:"location,omitempty"` + // ID - Fully qualified resource ID for the resource. + ID *string `json:"id,omitempty"` + // Name - The name of the resource. + Name *string `json:"name,omitempty"` + // Type - The type of the resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Service. +func (s Service) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if s.ServiceProperties != nil { + objectMap["properties"] = s.ServiceProperties + } + if s.Tags != nil { + objectMap["tags"] = s.Tags + } + if s.Location != nil { + objectMap["location"] = s.Location + } + if s.ID != nil { + objectMap["id"] = s.ID + } + if s.Name != nil { + objectMap["name"] = s.Name + } + if s.Type != nil { + objectMap["type"] = s.Type + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Service struct. +func (s *Service) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var serviceProperties ServiceProperties + err = json.Unmarshal(*v, &serviceProperties) + if err != nil { + return err + } + s.ServiceProperties = &serviceProperties + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + s.Tags = tags + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + s.Location = &location + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + s.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + s.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + s.Type = &typeVar + } + } + } + + return nil +} + +// ServiceCollection a collection of MediaService items. +type ServiceCollection struct { + autorest.Response `json:"-"` + // Value - A collection of MediaService items. + Value *[]Service `json:"value,omitempty"` + // OdataNextLink - A link to the next page of the collection (when the collection contains too many results to return in one response). + OdataNextLink *string `json:"@odata.nextLink,omitempty"` +} + +// ServiceCollectionIterator provides access to a complete listing of Service values. +type ServiceCollectionIterator struct { + i int + page ServiceCollectionPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ServiceCollectionIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ServiceCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ServiceCollectionIterator) Response() ServiceCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ServiceCollectionIterator) Value() Service { + if !iter.page.NotDone() { + return Service{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (sc ServiceCollection) IsEmpty() bool { + return sc.Value == nil || len(*sc.Value) == 0 +} + +// serviceCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (sc ServiceCollection) serviceCollectionPreparer() (*http.Request, error) { + if sc.OdataNextLink == nil || len(to.String(sc.OdataNextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(sc.OdataNextLink))) +} + +// ServiceCollectionPage contains a page of Service values. +type ServiceCollectionPage struct { + fn func(ServiceCollection) (ServiceCollection, error) + sc ServiceCollection +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ServiceCollectionPage) Next() error { + next, err := page.fn(page.sc) + if err != nil { + return err + } + page.sc = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ServiceCollectionPage) NotDone() bool { + return !page.sc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ServiceCollectionPage) Response() ServiceCollection { + return page.sc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ServiceCollectionPage) Values() []Service { + if page.sc.IsEmpty() { + return nil + } + return *page.sc.Value +} + +// ServiceProperties properties of the Media Services account. +type ServiceProperties struct { + // MediaServiceID - The Media Services account ID. + MediaServiceID *uuid.UUID `json:"mediaServiceId,omitempty"` + // StorageAccounts - The storage accounts for this resource. + StorageAccounts *[]StorageAccount `json:"storageAccounts,omitempty"` +} + +// StandardEncoderPreset describes all the settings to be used when encoding the input video with the Standard +// Encoder. +type StandardEncoderPreset struct { + // Filters - One or more filtering operations that are applied to the input media before encoding. + Filters *Filters `json:"filters,omitempty"` + // Codecs - The list of codecs to be used when encoding the input video. + Codecs *[]BasicCodec `json:"codecs,omitempty"` + // Formats - The list of outputs to be produced by the encoder. + Formats *[]BasicFormat `json:"formats,omitempty"` + // OdataType - Possible values include: 'OdataTypePreset', 'OdataTypeMicrosoftMediaAudioAnalyzerPreset', 'OdataTypeMicrosoftMediaBuiltInStandardEncoderPreset', 'OdataTypeMicrosoftMediaStandardEncoderPreset', 'OdataTypeMicrosoftMediaVideoAnalyzerPreset' + OdataType OdataTypeBasicPreset `json:"@odata.type,omitempty"` +} + +// MarshalJSON is the custom marshaler for StandardEncoderPreset. +func (sep StandardEncoderPreset) MarshalJSON() ([]byte, error) { + sep.OdataType = OdataTypeMicrosoftMediaStandardEncoderPreset + objectMap := make(map[string]interface{}) + if sep.Filters != nil { + objectMap["filters"] = sep.Filters + } + if sep.Codecs != nil { + objectMap["codecs"] = sep.Codecs + } + if sep.Formats != nil { + objectMap["formats"] = sep.Formats + } + if sep.OdataType != "" { + objectMap["@odata.type"] = sep.OdataType + } + return json.Marshal(objectMap) +} + +// AsAudioAnalyzerPreset is the BasicPreset implementation for StandardEncoderPreset. +func (sep StandardEncoderPreset) AsAudioAnalyzerPreset() (*AudioAnalyzerPreset, bool) { + return nil, false +} + +// AsBasicAudioAnalyzerPreset is the BasicPreset implementation for StandardEncoderPreset. +func (sep StandardEncoderPreset) AsBasicAudioAnalyzerPreset() (BasicAudioAnalyzerPreset, bool) { + return nil, false +} + +// AsBuiltInStandardEncoderPreset is the BasicPreset implementation for StandardEncoderPreset. +func (sep StandardEncoderPreset) AsBuiltInStandardEncoderPreset() (*BuiltInStandardEncoderPreset, bool) { + return nil, false +} + +// AsStandardEncoderPreset is the BasicPreset implementation for StandardEncoderPreset. +func (sep StandardEncoderPreset) AsStandardEncoderPreset() (*StandardEncoderPreset, bool) { + return &sep, true +} + +// AsVideoAnalyzerPreset is the BasicPreset implementation for StandardEncoderPreset. +func (sep StandardEncoderPreset) AsVideoAnalyzerPreset() (*VideoAnalyzerPreset, bool) { + return nil, false +} + +// AsPreset is the BasicPreset implementation for StandardEncoderPreset. +func (sep StandardEncoderPreset) AsPreset() (*Preset, bool) { + return nil, false +} + +// AsBasicPreset is the BasicPreset implementation for StandardEncoderPreset. +func (sep StandardEncoderPreset) AsBasicPreset() (BasicPreset, bool) { + return &sep, true +} + +// UnmarshalJSON is the custom unmarshaler for StandardEncoderPreset struct. +func (sep *StandardEncoderPreset) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "filters": + if v != nil { + var filters Filters + err = json.Unmarshal(*v, &filters) + if err != nil { + return err + } + sep.Filters = &filters + } + case "codecs": + if v != nil { + codecs, err := unmarshalBasicCodecArray(*v) + if err != nil { + return err + } + sep.Codecs = &codecs + } + case "formats": + if v != nil { + formats, err := unmarshalBasicFormatArray(*v) + if err != nil { + return err + } + sep.Formats = &formats + } + case "@odata.type": + if v != nil { + var odataType OdataTypeBasicPreset + err = json.Unmarshal(*v, &odataType) + if err != nil { + return err + } + sep.OdataType = odataType + } + } + } + + return nil +} + +// StorageAccount the storage account details. +type StorageAccount struct { + // ID - The ID of the storage account resource. Media Services relies on tables and queues as well as blobs, so the primary storage account must be a Standard Storage account (either Microsoft.ClassicStorage or Microsoft.Storage). Blob only storage accounts can be added as secondary storage accounts. + ID *string `json:"id,omitempty"` + // Type - The type of the storage account. Possible values include: 'Primary', 'Secondary' + Type StorageAccountType `json:"type,omitempty"` +} + +// StreamingEndpoint the StreamingEndpoint. +type StreamingEndpoint struct { + autorest.Response `json:"-"` + // StreamingEndpointProperties - The StreamingEndpoint properties. + *StreamingEndpointProperties `json:"properties,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // Location - The Azure Region of the resource. + Location *string `json:"location,omitempty"` + // ID - Fully qualified resource ID for the resource. + ID *string `json:"id,omitempty"` + // Name - The name of the resource. + Name *string `json:"name,omitempty"` + // Type - The type of the resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for StreamingEndpoint. +func (se StreamingEndpoint) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if se.StreamingEndpointProperties != nil { + objectMap["properties"] = se.StreamingEndpointProperties + } + if se.Tags != nil { + objectMap["tags"] = se.Tags + } + if se.Location != nil { + objectMap["location"] = se.Location + } + if se.ID != nil { + objectMap["id"] = se.ID + } + if se.Name != nil { + objectMap["name"] = se.Name + } + if se.Type != nil { + objectMap["type"] = se.Type + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for StreamingEndpoint struct. +func (se *StreamingEndpoint) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var streamingEndpointProperties StreamingEndpointProperties + err = json.Unmarshal(*v, &streamingEndpointProperties) + if err != nil { + return err + } + se.StreamingEndpointProperties = &streamingEndpointProperties + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + se.Tags = tags + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + se.Location = &location + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + se.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + se.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + se.Type = &typeVar + } + } + } + + return nil +} + +// StreamingEndpointAccessControl streamingEndpoint access control definition. +type StreamingEndpointAccessControl struct { + // Akamai - The access control of Akamai + Akamai *AkamaiAccessControl `json:"akamai,omitempty"` + // IP - The IP access control of the StreamingEndpoint. + IP *IPAccessControl `json:"ip,omitempty"` +} + +// StreamingEndpointListResult the StreamingEndpoint list result. +type StreamingEndpointListResult struct { + autorest.Response `json:"-"` + // Value - The result of the List StreamingEndpoint operation. + Value *[]StreamingEndpoint `json:"value,omitempty"` + // OdataCount - The number of result. + OdataCount *int32 `json:"@odata.count,omitempty"` + // OdataNextLink - Th link to the next set of results. Not empty if value contains incomplete list of StreamingEndpoints. + OdataNextLink *string `json:"@odata.nextLink,omitempty"` +} + +// StreamingEndpointListResultIterator provides access to a complete listing of StreamingEndpoint values. +type StreamingEndpointListResultIterator struct { + i int + page StreamingEndpointListResultPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *StreamingEndpointListResultIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter StreamingEndpointListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter StreamingEndpointListResultIterator) Response() StreamingEndpointListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter StreamingEndpointListResultIterator) Value() StreamingEndpoint { + if !iter.page.NotDone() { + return StreamingEndpoint{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (selr StreamingEndpointListResult) IsEmpty() bool { + return selr.Value == nil || len(*selr.Value) == 0 +} + +// streamingEndpointListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (selr StreamingEndpointListResult) streamingEndpointListResultPreparer() (*http.Request, error) { + if selr.OdataNextLink == nil || len(to.String(selr.OdataNextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(selr.OdataNextLink))) +} + +// StreamingEndpointListResultPage contains a page of StreamingEndpoint values. +type StreamingEndpointListResultPage struct { + fn func(StreamingEndpointListResult) (StreamingEndpointListResult, error) + selr StreamingEndpointListResult +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *StreamingEndpointListResultPage) Next() error { + next, err := page.fn(page.selr) + if err != nil { + return err + } + page.selr = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page StreamingEndpointListResultPage) NotDone() bool { + return !page.selr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page StreamingEndpointListResultPage) Response() StreamingEndpointListResult { + return page.selr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page StreamingEndpointListResultPage) Values() []StreamingEndpoint { + if page.selr.IsEmpty() { + return nil + } + return *page.selr.Value +} + +// StreamingEndpointProperties the StreamingEndpoint properties. +type StreamingEndpointProperties struct { + // Description - The StreamingEndpoint description. + Description *string `json:"description,omitempty"` + // ScaleUnits - The number of scale units. + ScaleUnits *int32 `json:"scaleUnits,omitempty"` + // AvailabilitySetName - AvailabilitySet name + AvailabilitySetName *string `json:"availabilitySetName,omitempty"` + // AccessControl - The access control definition of the StreamingEndpoint. + AccessControl *StreamingEndpointAccessControl `json:"accessControl,omitempty"` + // MaxCacheAge - Max cache age + MaxCacheAge *int64 `json:"maxCacheAge,omitempty"` + // CustomHostNames - The custom host names of the StreamingEndpoint + CustomHostNames *[]string `json:"customHostNames,omitempty"` + // HostName - The StreamingEndpoint host name. + HostName *string `json:"hostName,omitempty"` + // CdnEnabled - The CDN enabled flag. + CdnEnabled *bool `json:"cdnEnabled,omitempty"` + // CdnProvider - The CDN provider name. + CdnProvider *string `json:"cdnProvider,omitempty"` + // CdnProfile - The CDN profile name. + CdnProfile *string `json:"cdnProfile,omitempty"` + // ProvisioningState - The provisioning state of the StreamingEndpoint. + ProvisioningState *string `json:"provisioningState,omitempty"` + // ResourceState - The resource state of the StreamingEndpoint. Possible values include: 'StreamingEndpointResourceStateStopped', 'StreamingEndpointResourceStateStarting', 'StreamingEndpointResourceStateRunning', 'StreamingEndpointResourceStateStopping', 'StreamingEndpointResourceStateDeleting', 'StreamingEndpointResourceStateScaling' + ResourceState StreamingEndpointResourceState `json:"resourceState,omitempty"` + // CrossSiteAccessPolicies - The StreamingEndpoint access policies. + CrossSiteAccessPolicies *CrossSiteAccessPolicies `json:"crossSiteAccessPolicies,omitempty"` + // FreeTrialEndTime - The free trial expiration time. + FreeTrialEndTime *date.Time `json:"freeTrialEndTime,omitempty"` + // Created - The exact time the StreamingEndpoint was created. + Created *date.Time `json:"created,omitempty"` + // LastModified - The exact time the StreamingEndpoint was last modified. + LastModified *date.Time `json:"lastModified,omitempty"` +} + +// StreamingEndpointsCreateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type StreamingEndpointsCreateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *StreamingEndpointsCreateFuture) Result(client StreamingEndpointsClient) (se StreamingEndpoint, err error) { + var done bool + done, err = future.Done(client) + if err != nil { + err = autorest.NewErrorWithError(err, "media.StreamingEndpointsCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("media.StreamingEndpointsCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if se.Response.Response, err = future.GetResult(sender); err == nil && se.Response.Response.StatusCode != http.StatusNoContent { + se, err = client.CreateResponder(se.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "media.StreamingEndpointsCreateFuture", "Result", se.Response.Response, "Failure responding to request") + } + } + return +} + +// StreamingEndpointsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type StreamingEndpointsDeleteFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *StreamingEndpointsDeleteFuture) Result(client StreamingEndpointsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.Done(client) + if err != nil { + err = autorest.NewErrorWithError(err, "media.StreamingEndpointsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("media.StreamingEndpointsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// StreamingEndpointsScaleFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type StreamingEndpointsScaleFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *StreamingEndpointsScaleFuture) Result(client StreamingEndpointsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.Done(client) + if err != nil { + err = autorest.NewErrorWithError(err, "media.StreamingEndpointsScaleFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("media.StreamingEndpointsScaleFuture") + return + } + ar.Response = future.Response() + return +} + +// StreamingEndpointsStartFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type StreamingEndpointsStartFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *StreamingEndpointsStartFuture) Result(client StreamingEndpointsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.Done(client) + if err != nil { + err = autorest.NewErrorWithError(err, "media.StreamingEndpointsStartFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("media.StreamingEndpointsStartFuture") + return + } + ar.Response = future.Response() + return +} + +// StreamingEndpointsStopFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type StreamingEndpointsStopFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *StreamingEndpointsStopFuture) Result(client StreamingEndpointsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.Done(client) + if err != nil { + err = autorest.NewErrorWithError(err, "media.StreamingEndpointsStopFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("media.StreamingEndpointsStopFuture") + return + } + ar.Response = future.Response() + return +} + +// StreamingEndpointsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type StreamingEndpointsUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *StreamingEndpointsUpdateFuture) Result(client StreamingEndpointsClient) (se StreamingEndpoint, err error) { + var done bool + done, err = future.Done(client) + if err != nil { + err = autorest.NewErrorWithError(err, "media.StreamingEndpointsUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("media.StreamingEndpointsUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if se.Response.Response, err = future.GetResult(sender); err == nil && se.Response.Response.StatusCode != http.StatusNoContent { + se, err = client.UpdateResponder(se.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "media.StreamingEndpointsUpdateFuture", "Result", se.Response.Response, "Failure responding to request") + } + } + return +} + +// StreamingEntityScaleUnit scale units definition +type StreamingEntityScaleUnit struct { + // ScaleUnit - The scale unit number of the StreamingEndpoint. + ScaleUnit *int32 `json:"scaleUnit,omitempty"` +} + +// StreamingLocator a Streaming Locator resource +type StreamingLocator struct { + autorest.Response `json:"-"` + *StreamingLocatorProperties `json:"properties,omitempty"` + // ID - Fully qualified resource ID for the resource. + ID *string `json:"id,omitempty"` + // Name - The name of the resource. + Name *string `json:"name,omitempty"` + // Type - The type of the resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for StreamingLocator. +func (sl StreamingLocator) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sl.StreamingLocatorProperties != nil { + objectMap["properties"] = sl.StreamingLocatorProperties + } + if sl.ID != nil { + objectMap["id"] = sl.ID + } + if sl.Name != nil { + objectMap["name"] = sl.Name + } + if sl.Type != nil { + objectMap["type"] = sl.Type + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for StreamingLocator struct. +func (sl *StreamingLocator) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var streamingLocatorProperties StreamingLocatorProperties + err = json.Unmarshal(*v, &streamingLocatorProperties) + if err != nil { + return err + } + sl.StreamingLocatorProperties = &streamingLocatorProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + sl.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + sl.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + sl.Type = &typeVar + } + } + } + + return nil +} + +// StreamingLocatorCollection a collection of StreamingLocator items. +type StreamingLocatorCollection struct { + autorest.Response `json:"-"` + // Value - A collection of StreamingLocator items. + Value *[]StreamingLocator `json:"value,omitempty"` + // OdataNextLink - A link to the next page of the collection (when the collection contains too many results to return in one response). + OdataNextLink *string `json:"@odata.nextLink,omitempty"` +} + +// StreamingLocatorCollectionIterator provides access to a complete listing of StreamingLocator values. +type StreamingLocatorCollectionIterator struct { + i int + page StreamingLocatorCollectionPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *StreamingLocatorCollectionIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter StreamingLocatorCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter StreamingLocatorCollectionIterator) Response() StreamingLocatorCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter StreamingLocatorCollectionIterator) Value() StreamingLocator { + if !iter.page.NotDone() { + return StreamingLocator{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (slc StreamingLocatorCollection) IsEmpty() bool { + return slc.Value == nil || len(*slc.Value) == 0 +} + +// streamingLocatorCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (slc StreamingLocatorCollection) streamingLocatorCollectionPreparer() (*http.Request, error) { + if slc.OdataNextLink == nil || len(to.String(slc.OdataNextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(slc.OdataNextLink))) +} + +// StreamingLocatorCollectionPage contains a page of StreamingLocator values. +type StreamingLocatorCollectionPage struct { + fn func(StreamingLocatorCollection) (StreamingLocatorCollection, error) + slc StreamingLocatorCollection +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *StreamingLocatorCollectionPage) Next() error { + next, err := page.fn(page.slc) + if err != nil { + return err + } + page.slc = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page StreamingLocatorCollectionPage) NotDone() bool { + return !page.slc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page StreamingLocatorCollectionPage) Response() StreamingLocatorCollection { + return page.slc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page StreamingLocatorCollectionPage) Values() []StreamingLocator { + if page.slc.IsEmpty() { + return nil + } + return *page.slc.Value +} + +// StreamingLocatorContentKey class for content key in Streaming Locator +type StreamingLocatorContentKey struct { + // ID - ID of Content Key + ID *uuid.UUID `json:"id,omitempty"` + // Type - Encryption type of Content Key. Possible values include: 'StreamingLocatorContentKeyTypeCommonEncryptionCenc', 'StreamingLocatorContentKeyTypeCommonEncryptionCbcs', 'StreamingLocatorContentKeyTypeEnvelopeEncryption' + Type StreamingLocatorContentKeyType `json:"type,omitempty"` + // Label - Label of Content Key + Label *string `json:"label,omitempty"` + // Value - Value of of Content Key + Value *string `json:"value,omitempty"` + // PolicyName - ContentKeyPolicy used by Content Key + PolicyName *string `json:"policyName,omitempty"` + // Tracks - Tracks which use this Content Key + Tracks *[]TrackSelection `json:"tracks,omitempty"` +} + +// StreamingLocatorProperties class to specify properties of Streaming Locator +type StreamingLocatorProperties struct { + // AssetName - Asset Name + AssetName *string `json:"assetName,omitempty"` + // Created - Creation time of Streaming Locator + Created *date.Time `json:"created,omitempty"` + // StartTime - StartTime of Streaming Locator + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - EndTime of Streaming Locator + EndTime *date.Time `json:"endTime,omitempty"` + // StreamingLocatorID - StreamingLocatorId of Streaming Locator + StreamingLocatorID *uuid.UUID `json:"streamingLocatorId,omitempty"` + // StreamingPolicyName - Streaming policy name used by this streaming locator. Either specify the name of streaming policy you created or use one of the predefined streaming polices. The predefined streaming policies available are: 'Predefined_DownloadOnly', 'Predefined_ClearStreamingOnly', 'Predefined_DownloadAndClearStreaming', 'Predefined_ClearKey', 'Predefined_SecureStreaming' and 'Predefined_SecureStreamingWithFairPlay' + StreamingPolicyName *string `json:"streamingPolicyName,omitempty"` + // DefaultContentKeyPolicyName - Default ContentKeyPolicy used by this Streaming Locator + DefaultContentKeyPolicyName *string `json:"defaultContentKeyPolicyName,omitempty"` + // ContentKeys - ContentKeys used by this Streaming Locator + ContentKeys *[]StreamingLocatorContentKey `json:"contentKeys,omitempty"` + // AlternativeMediaID - An Alternative Media Identifier associated with the StreamingLocator. This identifier can be used to distinguish different StreamingLocators for the same Asset for authorization purposes in the CustomLicenseAcquisitionUrlTemplate or the CustomKeyAcquisitionUrlTemplate of the StreamingPolicy specified in the StreamingPolicyName field. + AlternativeMediaID *string `json:"alternativeMediaId,omitempty"` +} + +// StreamingPath class of paths for streaming +type StreamingPath struct { + // StreamingProtocol - Streaming protocol. Possible values include: 'StreamingPolicyStreamingProtocolHls', 'StreamingPolicyStreamingProtocolDash', 'StreamingPolicyStreamingProtocolSmoothStreaming', 'StreamingPolicyStreamingProtocolDownload' + StreamingProtocol StreamingPolicyStreamingProtocol `json:"streamingProtocol,omitempty"` + // EncryptionScheme - Encryption scheme. Possible values include: 'EncryptionSchemeNoEncryption', 'EncryptionSchemeEnvelopeEncryption', 'EncryptionSchemeCommonEncryptionCenc', 'EncryptionSchemeCommonEncryptionCbcs' + EncryptionScheme EncryptionScheme `json:"encryptionScheme,omitempty"` + // Paths - Streaming paths for each protocol and encryptionScheme pair + Paths *[]string `json:"paths,omitempty"` +} + +// StreamingPolicy a Streaming Policy resource +type StreamingPolicy struct { + autorest.Response `json:"-"` + *StreamingPolicyProperties `json:"properties,omitempty"` + // ID - Fully qualified resource ID for the resource. + ID *string `json:"id,omitempty"` + // Name - The name of the resource. + Name *string `json:"name,omitempty"` + // Type - The type of the resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for StreamingPolicy. +func (sp StreamingPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sp.StreamingPolicyProperties != nil { + objectMap["properties"] = sp.StreamingPolicyProperties + } + if sp.ID != nil { + objectMap["id"] = sp.ID + } + if sp.Name != nil { + objectMap["name"] = sp.Name + } + if sp.Type != nil { + objectMap["type"] = sp.Type + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for StreamingPolicy struct. +func (sp *StreamingPolicy) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var streamingPolicyProperties StreamingPolicyProperties + err = json.Unmarshal(*v, &streamingPolicyProperties) + if err != nil { + return err + } + sp.StreamingPolicyProperties = &streamingPolicyProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + sp.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + sp.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + sp.Type = &typeVar + } + } + } + + return nil +} + +// StreamingPolicyCollection a collection of StreamingPolicy items. +type StreamingPolicyCollection struct { + autorest.Response `json:"-"` + // Value - A collection of StreamingPolicy items. + Value *[]StreamingPolicy `json:"value,omitempty"` + // OdataNextLink - A link to the next page of the collection (when the collection contains too many results to return in one response). + OdataNextLink *string `json:"@odata.nextLink,omitempty"` +} + +// StreamingPolicyCollectionIterator provides access to a complete listing of StreamingPolicy values. +type StreamingPolicyCollectionIterator struct { + i int + page StreamingPolicyCollectionPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *StreamingPolicyCollectionIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter StreamingPolicyCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter StreamingPolicyCollectionIterator) Response() StreamingPolicyCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter StreamingPolicyCollectionIterator) Value() StreamingPolicy { + if !iter.page.NotDone() { + return StreamingPolicy{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (spc StreamingPolicyCollection) IsEmpty() bool { + return spc.Value == nil || len(*spc.Value) == 0 +} + +// streamingPolicyCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (spc StreamingPolicyCollection) streamingPolicyCollectionPreparer() (*http.Request, error) { + if spc.OdataNextLink == nil || len(to.String(spc.OdataNextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(spc.OdataNextLink))) +} + +// StreamingPolicyCollectionPage contains a page of StreamingPolicy values. +type StreamingPolicyCollectionPage struct { + fn func(StreamingPolicyCollection) (StreamingPolicyCollection, error) + spc StreamingPolicyCollection +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *StreamingPolicyCollectionPage) Next() error { + next, err := page.fn(page.spc) + if err != nil { + return err + } + page.spc = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page StreamingPolicyCollectionPage) NotDone() bool { + return !page.spc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page StreamingPolicyCollectionPage) Response() StreamingPolicyCollection { + return page.spc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page StreamingPolicyCollectionPage) Values() []StreamingPolicy { + if page.spc.IsEmpty() { + return nil + } + return *page.spc.Value +} + +// StreamingPolicyContentKey class to specify properties of content key +type StreamingPolicyContentKey struct { + // Label - Label can be used to specify Content Key when creating a Streaming Locator + Label *string `json:"label,omitempty"` + // PolicyName - Policy used by Content Key + PolicyName *string `json:"policyName,omitempty"` + // Tracks - Tracks which use this content key + Tracks *[]TrackSelection `json:"tracks,omitempty"` +} + +// StreamingPolicyContentKeys class to specify properties of all content keys in Streaming Policy +type StreamingPolicyContentKeys struct { + // DefaultKey - Default content key for an encryption scheme + DefaultKey *DefaultKey `json:"defaultKey,omitempty"` + // KeyToTrackMappings - Representing tracks needs separate content key + KeyToTrackMappings *[]StreamingPolicyContentKey `json:"keyToTrackMappings,omitempty"` +} + +// StreamingPolicyFairPlayConfiguration class to specify configurations of FairPlay in Streaming Policy +type StreamingPolicyFairPlayConfiguration struct { + // CustomLicenseAcquisitionURLTemplate - The template for a customer service to deliver keys to end users. Not needed when using Azure Media Services for issuing keys. + CustomLicenseAcquisitionURLTemplate *string `json:"customLicenseAcquisitionUrlTemplate,omitempty"` + // AllowPersistentLicense - All license to be persistent or not + AllowPersistentLicense *bool `json:"allowPersistentLicense,omitempty"` +} + +// StreamingPolicyPlayReadyConfiguration class to specify configurations of PlayReady in Streaming Policy +type StreamingPolicyPlayReadyConfiguration struct { + // CustomLicenseAcquisitionURLTemplate - The template for a customer service to deliver keys to end users. Not needed when using Azure Media Services for issuing keys. + CustomLicenseAcquisitionURLTemplate *string `json:"customLicenseAcquisitionUrlTemplate,omitempty"` + // PlayReadyCustomAttributes - Custom attributes for PlayReady + PlayReadyCustomAttributes *string `json:"playReadyCustomAttributes,omitempty"` +} + +// StreamingPolicyProperties class to specify properties of Streaming Policy +type StreamingPolicyProperties struct { + // Created - Creation time of Streaming Policy + Created *date.Time `json:"created,omitempty"` + // DefaultContentKeyPolicyName - Default ContentKey used by current Streaming Policy + DefaultContentKeyPolicyName *string `json:"defaultContentKeyPolicyName,omitempty"` + // EnvelopeEncryption - Configuration of EnvelopeEncryption + EnvelopeEncryption *EnvelopeEncryption `json:"envelopeEncryption,omitempty"` + // CommonEncryptionCenc - Configuration of CommonEncryptionCenc + CommonEncryptionCenc *CommonEncryptionCenc `json:"commonEncryptionCenc,omitempty"` + // CommonEncryptionCbcs - Configuration of CommonEncryptionCbcs + CommonEncryptionCbcs *CommonEncryptionCbcs `json:"commonEncryptionCbcs,omitempty"` + // NoEncryption - Configurations of NoEncryption + NoEncryption *NoEncryption `json:"noEncryption,omitempty"` +} + +// StreamingPolicyWidevineConfiguration class to specify configurations of Widevine in Streaming Policy +type StreamingPolicyWidevineConfiguration struct { + // CustomLicenseAcquisitionURLTemplate - The template for a customer service to deliver keys to end users. Not needed when using Azure Media Services for issuing keys. + CustomLicenseAcquisitionURLTemplate *string `json:"customLicenseAcquisitionUrlTemplate,omitempty"` +} + +// SubscriptionMediaService a Media Services account. +type SubscriptionMediaService struct { + autorest.Response `json:"-"` + // ServiceProperties - The resource properties. + *ServiceProperties `json:"properties,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // Location - The Azure Region of the resource. + Location *string `json:"location,omitempty"` + // ID - Fully qualified resource ID for the resource. + ID *string `json:"id,omitempty"` + // Name - The name of the resource. + Name *string `json:"name,omitempty"` + // Type - The type of the resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for SubscriptionMediaService. +func (sms SubscriptionMediaService) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sms.ServiceProperties != nil { + objectMap["properties"] = sms.ServiceProperties + } + if sms.Tags != nil { + objectMap["tags"] = sms.Tags + } + if sms.Location != nil { + objectMap["location"] = sms.Location + } + if sms.ID != nil { + objectMap["id"] = sms.ID + } + if sms.Name != nil { + objectMap["name"] = sms.Name + } + if sms.Type != nil { + objectMap["type"] = sms.Type + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SubscriptionMediaService struct. +func (sms *SubscriptionMediaService) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var serviceProperties ServiceProperties + err = json.Unmarshal(*v, &serviceProperties) + if err != nil { + return err + } + sms.ServiceProperties = &serviceProperties + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + sms.Tags = tags + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + sms.Location = &location + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + sms.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + sms.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + sms.Type = &typeVar + } + } + } + + return nil +} + +// SubscriptionMediaServiceCollection a collection of SubscriptionMediaService items. +type SubscriptionMediaServiceCollection struct { + autorest.Response `json:"-"` + // Value - A collection of SubscriptionMediaService items. + Value *[]SubscriptionMediaService `json:"value,omitempty"` + // OdataNextLink - A link to the next page of the collection (when the collection contains too many results to return in one response). + OdataNextLink *string `json:"@odata.nextLink,omitempty"` +} + +// SubscriptionMediaServiceCollectionIterator provides access to a complete listing of SubscriptionMediaService +// values. +type SubscriptionMediaServiceCollectionIterator struct { + i int + page SubscriptionMediaServiceCollectionPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *SubscriptionMediaServiceCollectionIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter SubscriptionMediaServiceCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter SubscriptionMediaServiceCollectionIterator) Response() SubscriptionMediaServiceCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter SubscriptionMediaServiceCollectionIterator) Value() SubscriptionMediaService { + if !iter.page.NotDone() { + return SubscriptionMediaService{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (smsc SubscriptionMediaServiceCollection) IsEmpty() bool { + return smsc.Value == nil || len(*smsc.Value) == 0 +} + +// subscriptionMediaServiceCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (smsc SubscriptionMediaServiceCollection) subscriptionMediaServiceCollectionPreparer() (*http.Request, error) { + if smsc.OdataNextLink == nil || len(to.String(smsc.OdataNextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(smsc.OdataNextLink))) +} + +// SubscriptionMediaServiceCollectionPage contains a page of SubscriptionMediaService values. +type SubscriptionMediaServiceCollectionPage struct { + fn func(SubscriptionMediaServiceCollection) (SubscriptionMediaServiceCollection, error) + smsc SubscriptionMediaServiceCollection +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *SubscriptionMediaServiceCollectionPage) Next() error { + next, err := page.fn(page.smsc) + if err != nil { + return err + } + page.smsc = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page SubscriptionMediaServiceCollectionPage) NotDone() bool { + return !page.smsc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page SubscriptionMediaServiceCollectionPage) Response() SubscriptionMediaServiceCollection { + return page.smsc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page SubscriptionMediaServiceCollectionPage) Values() []SubscriptionMediaService { + if page.smsc.IsEmpty() { + return nil + } + return *page.smsc.Value +} + +// SyncStorageKeysInput the input to the sync storage keys request. +type SyncStorageKeysInput struct { + // ID - The ID of the storage account resource. + ID *string `json:"id,omitempty"` +} + +// TrackedResource the resource model definition for a ARM tracked resource. +type TrackedResource struct { + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // Location - The Azure Region of the resource. + Location *string `json:"location,omitempty"` + // ID - Fully qualified resource ID for the resource. + ID *string `json:"id,omitempty"` + // Name - The name of the resource. + Name *string `json:"name,omitempty"` + // Type - The type of the resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for TrackedResource. +func (tr TrackedResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if tr.Tags != nil { + objectMap["tags"] = tr.Tags + } + if tr.Location != nil { + objectMap["location"] = tr.Location + } + if tr.ID != nil { + objectMap["id"] = tr.ID + } + if tr.Name != nil { + objectMap["name"] = tr.Name + } + if tr.Type != nil { + objectMap["type"] = tr.Type + } + return json.Marshal(objectMap) +} + +// TrackPropertyCondition class to specify one track property condition +type TrackPropertyCondition struct { + // Property - Track property type. Possible values include: 'TrackPropertyTypeUnknown', 'TrackPropertyTypeFourCC' + Property TrackPropertyType `json:"property,omitempty"` + // Operation - Track property condition operation. Possible values include: 'TrackPropertyCompareOperationUnknown', 'TrackPropertyCompareOperationEqual' + Operation TrackPropertyCompareOperation `json:"operation,omitempty"` + // Value - Track property value + Value *string `json:"value,omitempty"` +} + +// TrackSelection class to select a track +type TrackSelection struct { + // TrackSelections - TrackSelections is a track property condition list which can specify track(s) + TrackSelections *[]TrackPropertyCondition `json:"trackSelections,omitempty"` +} + +// Transform a Transform encapsulates the rules or instructions for generating desired outputs from input media, +// such as by transcoding or by extracting insights. After the Transform is created, it can be applied to input +// media by creating Jobs. +type Transform struct { + autorest.Response `json:"-"` + // TransformProperties - The resource properties. + *TransformProperties `json:"properties,omitempty"` + // ID - Fully qualified resource ID for the resource. + ID *string `json:"id,omitempty"` + // Name - The name of the resource. + Name *string `json:"name,omitempty"` + // Type - The type of the resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Transform. +func (t Transform) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if t.TransformProperties != nil { + objectMap["properties"] = t.TransformProperties + } + if t.ID != nil { + objectMap["id"] = t.ID + } + if t.Name != nil { + objectMap["name"] = t.Name + } + if t.Type != nil { + objectMap["type"] = t.Type + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Transform struct. +func (t *Transform) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var transformProperties TransformProperties + err = json.Unmarshal(*v, &transformProperties) + if err != nil { + return err + } + t.TransformProperties = &transformProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + t.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + t.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + t.Type = &typeVar + } + } + } + + return nil +} + +// TransformCollection a collection of Transform items. +type TransformCollection struct { + autorest.Response `json:"-"` + // Value - A collection of Transform items. + Value *[]Transform `json:"value,omitempty"` + // OdataNextLink - A link to the next page of the collection (when the collection contains too many results to return in one response). + OdataNextLink *string `json:"@odata.nextLink,omitempty"` +} + +// TransformCollectionIterator provides access to a complete listing of Transform values. +type TransformCollectionIterator struct { + i int + page TransformCollectionPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *TransformCollectionIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter TransformCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter TransformCollectionIterator) Response() TransformCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter TransformCollectionIterator) Value() Transform { + if !iter.page.NotDone() { + return Transform{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (tc TransformCollection) IsEmpty() bool { + return tc.Value == nil || len(*tc.Value) == 0 +} + +// transformCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (tc TransformCollection) transformCollectionPreparer() (*http.Request, error) { + if tc.OdataNextLink == nil || len(to.String(tc.OdataNextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(tc.OdataNextLink))) +} + +// TransformCollectionPage contains a page of Transform values. +type TransformCollectionPage struct { + fn func(TransformCollection) (TransformCollection, error) + tc TransformCollection +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *TransformCollectionPage) Next() error { + next, err := page.fn(page.tc) + if err != nil { + return err + } + page.tc = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page TransformCollectionPage) NotDone() bool { + return !page.tc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page TransformCollectionPage) Response() TransformCollection { + return page.tc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page TransformCollectionPage) Values() []Transform { + if page.tc.IsEmpty() { + return nil + } + return *page.tc.Value +} + +// TransformOutput describes the properties of a TransformOutput, which are the rules to be applied while +// generating the desired output. +type TransformOutput struct { + // OnError - A Transform can define more than one outputs. This property defines what the service should do when one output fails - either continue to produce other outputs, or, stop the other outputs. The default is stop. Possible values include: 'StopProcessingJob', 'ContinueJob' + OnError OnErrorType `json:"onError,omitempty"` + // RelativePriority - Sets the relative priority of the TransformOutputs within a Transform. This sets the priority that the service uses for processing TransformOutputs. The default priority is Normal. Possible values include: 'Low', 'Normal', 'High' + RelativePriority Priority `json:"relativePriority,omitempty"` + // Preset - Preset that describes the operations that will be used to modify, transcode, or extract insights from the source file to generate the output. + Preset BasicPreset `json:"preset,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for TransformOutput struct. +func (toVar *TransformOutput) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "onError": + if v != nil { + var onError OnErrorType + err = json.Unmarshal(*v, &onError) + if err != nil { + return err + } + toVar.OnError = onError + } + case "relativePriority": + if v != nil { + var relativePriority Priority + err = json.Unmarshal(*v, &relativePriority) + if err != nil { + return err + } + toVar.RelativePriority = relativePriority + } + case "preset": + if v != nil { + preset, err := unmarshalBasicPreset(*v) + if err != nil { + return err + } + toVar.Preset = preset + } + } + } + + return nil +} + +// TransformProperties a Transform. +type TransformProperties struct { + // Created - The UTC date and time when the Transform was created, in 'YYYY-MM-DDThh:mm:ssZ' format. + Created *date.Time `json:"created,omitempty"` + // Description - An optional verbose description of the Transform. + Description *string `json:"description,omitempty"` + // LastModified - The UTC date and time when the Transform was last updated, in 'YYYY-MM-DDThh:mm:ssZ' format. + LastModified *date.Time `json:"lastModified,omitempty"` + // Outputs - An array of one or more TransformOutputs that the Transform should generate. + Outputs *[]TransformOutput `json:"outputs,omitempty"` +} + +// TransportStreamFormat describes the properties for generating an MPEG-2 Transport Stream (ISO/IEC 13818-1) +// output video file(s). +type TransportStreamFormat struct { + // OutputFiles - The list of output files to produce. Each entry in the list is a set of audio and video layer labels to be muxed together . + OutputFiles *[]OutputFile `json:"outputFiles,omitempty"` + // FilenamePattern - The pattern of the file names for the generated output files. The following macros are supported in the file name: {Basename} - The base name of the input video {Extension} - The appropriate extension for this format. {Label} - The label assigned to the codec/layer. {Index} - A unique index for thumbnails. Only applicable to thumbnails. {Bitrate} - The audio/video bitrate. Not applicable to thumbnails. {Codec} - The type of the audio/video codec. Any unsubstituted macros will be collapsed and removed from the filename. + FilenamePattern *string `json:"filenamePattern,omitempty"` + // OdataType - Possible values include: 'OdataTypeFormat', 'OdataTypeMicrosoftMediaImageFormat', 'OdataTypeMicrosoftMediaJpgFormat', 'OdataTypeMicrosoftMediaPngFormat', 'OdataTypeMicrosoftMediaMultiBitrateFormat', 'OdataTypeMicrosoftMediaMp4Format', 'OdataTypeMicrosoftMediaTransportStreamFormat' + OdataType OdataTypeBasicFormat `json:"@odata.type,omitempty"` +} + +// MarshalJSON is the custom marshaler for TransportStreamFormat. +func (tsf TransportStreamFormat) MarshalJSON() ([]byte, error) { + tsf.OdataType = OdataTypeMicrosoftMediaTransportStreamFormat + objectMap := make(map[string]interface{}) + if tsf.OutputFiles != nil { + objectMap["outputFiles"] = tsf.OutputFiles + } + if tsf.FilenamePattern != nil { + objectMap["filenamePattern"] = tsf.FilenamePattern + } + if tsf.OdataType != "" { + objectMap["@odata.type"] = tsf.OdataType + } + return json.Marshal(objectMap) +} + +// AsImageFormat is the BasicFormat implementation for TransportStreamFormat. +func (tsf TransportStreamFormat) AsImageFormat() (*ImageFormat, bool) { + return nil, false +} + +// AsBasicImageFormat is the BasicFormat implementation for TransportStreamFormat. +func (tsf TransportStreamFormat) AsBasicImageFormat() (BasicImageFormat, bool) { + return nil, false +} + +// AsJpgFormat is the BasicFormat implementation for TransportStreamFormat. +func (tsf TransportStreamFormat) AsJpgFormat() (*JpgFormat, bool) { + return nil, false +} + +// AsPngFormat is the BasicFormat implementation for TransportStreamFormat. +func (tsf TransportStreamFormat) AsPngFormat() (*PngFormat, bool) { + return nil, false +} + +// AsMultiBitrateFormat is the BasicFormat implementation for TransportStreamFormat. +func (tsf TransportStreamFormat) AsMultiBitrateFormat() (*MultiBitrateFormat, bool) { + return nil, false +} + +// AsBasicMultiBitrateFormat is the BasicFormat implementation for TransportStreamFormat. +func (tsf TransportStreamFormat) AsBasicMultiBitrateFormat() (BasicMultiBitrateFormat, bool) { + return &tsf, true +} + +// AsMp4Format is the BasicFormat implementation for TransportStreamFormat. +func (tsf TransportStreamFormat) AsMp4Format() (*Mp4Format, bool) { + return nil, false +} + +// AsTransportStreamFormat is the BasicFormat implementation for TransportStreamFormat. +func (tsf TransportStreamFormat) AsTransportStreamFormat() (*TransportStreamFormat, bool) { + return &tsf, true +} + +// AsFormat is the BasicFormat implementation for TransportStreamFormat. +func (tsf TransportStreamFormat) AsFormat() (*Format, bool) { + return nil, false +} + +// AsBasicFormat is the BasicFormat implementation for TransportStreamFormat. +func (tsf TransportStreamFormat) AsBasicFormat() (BasicFormat, bool) { + return &tsf, true +} + +// BasicVideo describes the basic properties for encoding the input video. +type BasicVideo interface { + AsImage() (*Image, bool) + AsBasicImage() (BasicImage, bool) + AsH264Video() (*H264Video, bool) + AsJpgImage() (*JpgImage, bool) + AsPngImage() (*PngImage, bool) + AsVideo() (*Video, bool) +} + +// Video describes the basic properties for encoding the input video. +type Video struct { + // KeyFrameInterval - The distance between two key frames, thereby defining a group of pictures (GOP). The value should be a non-zero integer in the range [1, 30] seconds, specified in ISO 8601 format. The default is 2 seconds (PT2S). + KeyFrameInterval *string `json:"keyFrameInterval,omitempty"` + // StretchMode - The resizing mode - how the input video will be resized to fit the desired output resolution(s). Default is AutoSize. Possible values include: 'StretchModeNone', 'StretchModeAutoSize', 'StretchModeAutoFit' + StretchMode StretchMode `json:"stretchMode,omitempty"` + // Label - An optional label for the codec. The label can be used to control muxing behavior. + Label *string `json:"label,omitempty"` + // OdataType - Possible values include: 'OdataTypeCodec', 'OdataTypeMicrosoftMediaAudio', 'OdataTypeMicrosoftMediaAacAudio', 'OdataTypeMicrosoftMediaCopyVideo', 'OdataTypeMicrosoftMediaVideo', 'OdataTypeMicrosoftMediaImage', 'OdataTypeMicrosoftMediaCopyAudio', 'OdataTypeMicrosoftMediaH264Video', 'OdataTypeMicrosoftMediaJpgImage', 'OdataTypeMicrosoftMediaPngImage' + OdataType OdataTypeBasicCodec `json:"@odata.type,omitempty"` +} + +func unmarshalBasicVideo(body []byte) (BasicVideo, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["@odata.type"] { + case string(OdataTypeMicrosoftMediaImage): + var i Image + err := json.Unmarshal(body, &i) + return i, err + case string(OdataTypeMicrosoftMediaH264Video): + var hv H264Video + err := json.Unmarshal(body, &hv) + return hv, err + case string(OdataTypeMicrosoftMediaJpgImage): + var ji JpgImage + err := json.Unmarshal(body, &ji) + return ji, err + case string(OdataTypeMicrosoftMediaPngImage): + var pi PngImage + err := json.Unmarshal(body, &pi) + return pi, err + default: + var vVar Video + err := json.Unmarshal(body, &vVar) + return vVar, err + } +} +func unmarshalBasicVideoArray(body []byte) ([]BasicVideo, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + vVarArray := make([]BasicVideo, len(rawMessages)) + + for index, rawMessage := range rawMessages { + vVar, err := unmarshalBasicVideo(*rawMessage) + if err != nil { + return nil, err + } + vVarArray[index] = vVar + } + return vVarArray, nil +} + +// MarshalJSON is the custom marshaler for Video. +func (vVar Video) MarshalJSON() ([]byte, error) { + vVar.OdataType = OdataTypeMicrosoftMediaVideo + objectMap := make(map[string]interface{}) + if vVar.KeyFrameInterval != nil { + objectMap["keyFrameInterval"] = vVar.KeyFrameInterval + } + if vVar.StretchMode != "" { + objectMap["stretchMode"] = vVar.StretchMode + } + if vVar.Label != nil { + objectMap["label"] = vVar.Label + } + if vVar.OdataType != "" { + objectMap["@odata.type"] = vVar.OdataType + } + return json.Marshal(objectMap) +} + +// AsAudio is the BasicCodec implementation for Video. +func (vVar Video) AsAudio() (*Audio, bool) { + return nil, false +} + +// AsBasicAudio is the BasicCodec implementation for Video. +func (vVar Video) AsBasicAudio() (BasicAudio, bool) { + return nil, false +} + +// AsAacAudio is the BasicCodec implementation for Video. +func (vVar Video) AsAacAudio() (*AacAudio, bool) { + return nil, false +} + +// AsCopyVideo is the BasicCodec implementation for Video. +func (vVar Video) AsCopyVideo() (*CopyVideo, bool) { + return nil, false +} + +// AsVideo is the BasicCodec implementation for Video. +func (vVar Video) AsVideo() (*Video, bool) { + return &vVar, true +} + +// AsBasicVideo is the BasicCodec implementation for Video. +func (vVar Video) AsBasicVideo() (BasicVideo, bool) { + return &vVar, true +} + +// AsImage is the BasicCodec implementation for Video. +func (vVar Video) AsImage() (*Image, bool) { + return nil, false +} + +// AsBasicImage is the BasicCodec implementation for Video. +func (vVar Video) AsBasicImage() (BasicImage, bool) { + return nil, false +} + +// AsCopyAudio is the BasicCodec implementation for Video. +func (vVar Video) AsCopyAudio() (*CopyAudio, bool) { + return nil, false +} + +// AsH264Video is the BasicCodec implementation for Video. +func (vVar Video) AsH264Video() (*H264Video, bool) { + return nil, false +} + +// AsJpgImage is the BasicCodec implementation for Video. +func (vVar Video) AsJpgImage() (*JpgImage, bool) { + return nil, false +} + +// AsPngImage is the BasicCodec implementation for Video. +func (vVar Video) AsPngImage() (*PngImage, bool) { + return nil, false +} + +// AsCodec is the BasicCodec implementation for Video. +func (vVar Video) AsCodec() (*Codec, bool) { + return nil, false +} + +// AsBasicCodec is the BasicCodec implementation for Video. +func (vVar Video) AsBasicCodec() (BasicCodec, bool) { + return &vVar, true +} + +// VideoAnalyzerPreset a video analyzer preset that extracts insights (rich metadata) from both audio and video, +// and outputs a JSON format file. +type VideoAnalyzerPreset struct { + // AudioInsightsOnly - Whether to only extract audio insights when processing a video file. + AudioInsightsOnly *bool `json:"audioInsightsOnly,omitempty"` + // AudioLanguage - The language for the audio payload in the input using the BCP-47 format of 'language tag-region' (e.g: 'en-US'). The list of supported languages are, 'en-US', 'en-GB', 'es-ES', 'es-MX', 'fr-FR', 'it-IT', 'ja-JP', 'pt-BR', 'zh-CN'. + AudioLanguage *string `json:"audioLanguage,omitempty"` + // OdataType - Possible values include: 'OdataTypePreset', 'OdataTypeMicrosoftMediaAudioAnalyzerPreset', 'OdataTypeMicrosoftMediaBuiltInStandardEncoderPreset', 'OdataTypeMicrosoftMediaStandardEncoderPreset', 'OdataTypeMicrosoftMediaVideoAnalyzerPreset' + OdataType OdataTypeBasicPreset `json:"@odata.type,omitempty"` +} + +// MarshalJSON is the custom marshaler for VideoAnalyzerPreset. +func (vap VideoAnalyzerPreset) MarshalJSON() ([]byte, error) { + vap.OdataType = OdataTypeMicrosoftMediaVideoAnalyzerPreset + objectMap := make(map[string]interface{}) + if vap.AudioInsightsOnly != nil { + objectMap["audioInsightsOnly"] = vap.AudioInsightsOnly + } + if vap.AudioLanguage != nil { + objectMap["audioLanguage"] = vap.AudioLanguage + } + if vap.OdataType != "" { + objectMap["@odata.type"] = vap.OdataType + } + return json.Marshal(objectMap) +} + +// AsAudioAnalyzerPreset is the BasicPreset implementation for VideoAnalyzerPreset. +func (vap VideoAnalyzerPreset) AsAudioAnalyzerPreset() (*AudioAnalyzerPreset, bool) { + return nil, false +} + +// AsBasicAudioAnalyzerPreset is the BasicPreset implementation for VideoAnalyzerPreset. +func (vap VideoAnalyzerPreset) AsBasicAudioAnalyzerPreset() (BasicAudioAnalyzerPreset, bool) { + return &vap, true +} + +// AsBuiltInStandardEncoderPreset is the BasicPreset implementation for VideoAnalyzerPreset. +func (vap VideoAnalyzerPreset) AsBuiltInStandardEncoderPreset() (*BuiltInStandardEncoderPreset, bool) { + return nil, false +} + +// AsStandardEncoderPreset is the BasicPreset implementation for VideoAnalyzerPreset. +func (vap VideoAnalyzerPreset) AsStandardEncoderPreset() (*StandardEncoderPreset, bool) { + return nil, false +} + +// AsVideoAnalyzerPreset is the BasicPreset implementation for VideoAnalyzerPreset. +func (vap VideoAnalyzerPreset) AsVideoAnalyzerPreset() (*VideoAnalyzerPreset, bool) { + return &vap, true +} + +// AsPreset is the BasicPreset implementation for VideoAnalyzerPreset. +func (vap VideoAnalyzerPreset) AsPreset() (*Preset, bool) { + return nil, false +} + +// AsBasicPreset is the BasicPreset implementation for VideoAnalyzerPreset. +func (vap VideoAnalyzerPreset) AsBasicPreset() (BasicPreset, bool) { + return &vap, true +} + +// BasicVideoLayer describes the settings to be used when encoding the input video into a desired output bitrate layer. +type BasicVideoLayer interface { + AsH264Layer() (*H264Layer, bool) + AsVideoLayer() (*VideoLayer, bool) +} + +// VideoLayer describes the settings to be used when encoding the input video into a desired output bitrate layer. +type VideoLayer struct { + // Bitrate - The average bitrate in bits per second at which to encode the input video when generating this layer. This is a required field. + Bitrate *int32 `json:"bitrate,omitempty"` + // MaxBitrate - The maximum bitrate (in bits per second), at which the VBV buffer should be assumed to refill. If not specified, defaults to the same value as bitrate. + MaxBitrate *int32 `json:"maxBitrate,omitempty"` + // BFrames - The number of B-frames to be used when encoding this layer. If not specified, the encoder chooses an appropriate number based on the video profile and level. + BFrames *int32 `json:"bFrames,omitempty"` + // FrameRate - The frame rate (in frames per second) at which to encode this layer. The value can be in the form of M/N where M and N are integers (For example, 30000/1001), or in the form of a number (For example, 30, or 29.97). The encoder enforces constraints on allowed frame rates based on the profile and level. If it is not specified, the encoder will use the same frame rate as the input video. + FrameRate *string `json:"frameRate,omitempty"` + // Slices - The number of slices to be used when encoding this layer. If not specified, default is zero, which means that encoder will use a single slice for each frame. + Slices *int32 `json:"slices,omitempty"` + // AdaptiveBFrame - Whether or not adaptive B-frames are to be used when encoding this layer. If not specified, the encoder will turn it on whenever the video profile permits its use. + AdaptiveBFrame *bool `json:"adaptiveBFrame,omitempty"` + // Width - The width of the output video for this layer. The value can be absolute (in pixels) or relative (in percentage). For example 50% means the output video has half as many pixels in width as the input. + Width *string `json:"width,omitempty"` + // Height - The height of the output video for this layer. The value can be absolute (in pixels) or relative (in percentage). For example 50% means the output video has half as many pixels in height as the input. + Height *string `json:"height,omitempty"` + // Label - The alphanumeric label for this layer, which can be used in multiplexing different video and audio layers, or in naming the output file. + Label *string `json:"label,omitempty"` + // OdataType - Possible values include: 'OdataTypeLayer', 'OdataTypeMicrosoftMediaVideoLayer', 'OdataTypeMicrosoftMediaH264Layer', 'OdataTypeMicrosoftMediaJpgLayer', 'OdataTypeMicrosoftMediaPngLayer' + OdataType OdataTypeBasicLayer `json:"@odata.type,omitempty"` +} + +func unmarshalBasicVideoLayer(body []byte) (BasicVideoLayer, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["@odata.type"] { + case string(OdataTypeMicrosoftMediaH264Layer): + var hl H264Layer + err := json.Unmarshal(body, &hl) + return hl, err + default: + var vl VideoLayer + err := json.Unmarshal(body, &vl) + return vl, err + } +} +func unmarshalBasicVideoLayerArray(body []byte) ([]BasicVideoLayer, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + vlArray := make([]BasicVideoLayer, len(rawMessages)) + + for index, rawMessage := range rawMessages { + vl, err := unmarshalBasicVideoLayer(*rawMessage) + if err != nil { + return nil, err + } + vlArray[index] = vl + } + return vlArray, nil +} + +// MarshalJSON is the custom marshaler for VideoLayer. +func (vl VideoLayer) MarshalJSON() ([]byte, error) { + vl.OdataType = OdataTypeMicrosoftMediaVideoLayer + objectMap := make(map[string]interface{}) + if vl.Bitrate != nil { + objectMap["bitrate"] = vl.Bitrate + } + if vl.MaxBitrate != nil { + objectMap["maxBitrate"] = vl.MaxBitrate + } + if vl.BFrames != nil { + objectMap["bFrames"] = vl.BFrames + } + if vl.FrameRate != nil { + objectMap["frameRate"] = vl.FrameRate + } + if vl.Slices != nil { + objectMap["slices"] = vl.Slices + } + if vl.AdaptiveBFrame != nil { + objectMap["adaptiveBFrame"] = vl.AdaptiveBFrame + } + if vl.Width != nil { + objectMap["width"] = vl.Width + } + if vl.Height != nil { + objectMap["height"] = vl.Height + } + if vl.Label != nil { + objectMap["label"] = vl.Label + } + if vl.OdataType != "" { + objectMap["@odata.type"] = vl.OdataType + } + return json.Marshal(objectMap) +} + +// AsVideoLayer is the BasicLayer implementation for VideoLayer. +func (vl VideoLayer) AsVideoLayer() (*VideoLayer, bool) { + return &vl, true +} + +// AsBasicVideoLayer is the BasicLayer implementation for VideoLayer. +func (vl VideoLayer) AsBasicVideoLayer() (BasicVideoLayer, bool) { + return &vl, true +} + +// AsH264Layer is the BasicLayer implementation for VideoLayer. +func (vl VideoLayer) AsH264Layer() (*H264Layer, bool) { + return nil, false +} + +// AsJpgLayer is the BasicLayer implementation for VideoLayer. +func (vl VideoLayer) AsJpgLayer() (*JpgLayer, bool) { + return nil, false +} + +// AsPngLayer is the BasicLayer implementation for VideoLayer. +func (vl VideoLayer) AsPngLayer() (*PngLayer, bool) { + return nil, false +} + +// AsLayer is the BasicLayer implementation for VideoLayer. +func (vl VideoLayer) AsLayer() (*Layer, bool) { + return nil, false +} + +// AsBasicLayer is the BasicLayer implementation for VideoLayer. +func (vl VideoLayer) AsBasicLayer() (BasicLayer, bool) { + return &vl, true +} + +// VideoOverlay describes the properties of a video overlay. +type VideoOverlay struct { + // Position - The location in the input video where the overlay is applied. + Position *Rectangle `json:"position,omitempty"` + // Opacity - The opacity of the overlay. This is a value in the range [0 - 1.0]. Default is 1.0 which mean the overlay is opaque. + Opacity *float64 `json:"opacity,omitempty"` + // CropRectangle - An optional rectangular window used to crop the overlay image or video. + CropRectangle *Rectangle `json:"cropRectangle,omitempty"` + // InputLabel - The label of the job input which is to be used as an overlay. The Input must specify exactly one file. You can specify an image file in JPG or PNG formats, or an audio file (such as a WAV, MP3, WMA or M4A file), or a video file. See https://aka.ms/mesformats for the complete list of supported audio and video file formats. + InputLabel *string `json:"inputLabel,omitempty"` + // Start - The start position, with reference to the input video, at which the overlay starts. The value should be in ISO 8601 format. For example, PT05S to start the overlay at 5 seconds in to the input video. If not specified the overlay starts from the beginning of the input video. + Start *string `json:"start,omitempty"` + // End - The position in the input video at which the overlay ends. The value should be in ISO 8601 duration format. For example, PT30S to end the overlay at 30 seconds in to the input video. If not specified the overlay will be applied until the end of the input video if inputLoop is true. Else, if inputLoop is false, then overlay will last as long as the duration of the overlay media. + End *string `json:"end,omitempty"` + // FadeInDuration - The duration over which the overlay fades in onto the input video. The value should be in ISO 8601 duration format. If not specified the default behavior is to have no fade in (same as PT0S). + FadeInDuration *string `json:"fadeInDuration,omitempty"` + // FadeOutDuration - The duration over which the overlay fades out of the input video. The value should be in ISO 8601 duration format. If not specified the default behavior is to have no fade out (same as PT0S). + FadeOutDuration *string `json:"fadeOutDuration,omitempty"` + // AudioGainLevel - The gain level of audio in the overlay. The value should be in the range [0, 1.0]. The default is 1.0. + AudioGainLevel *float64 `json:"audioGainLevel,omitempty"` + // OdataType - Possible values include: 'OdataTypeOverlay', 'OdataTypeMicrosoftMediaAudioOverlay', 'OdataTypeMicrosoftMediaVideoOverlay' + OdataType OdataTypeBasicOverlay `json:"@odata.type,omitempty"` +} + +// MarshalJSON is the custom marshaler for VideoOverlay. +func (vo VideoOverlay) MarshalJSON() ([]byte, error) { + vo.OdataType = OdataTypeMicrosoftMediaVideoOverlay + objectMap := make(map[string]interface{}) + if vo.Position != nil { + objectMap["position"] = vo.Position + } + if vo.Opacity != nil { + objectMap["opacity"] = vo.Opacity + } + if vo.CropRectangle != nil { + objectMap["cropRectangle"] = vo.CropRectangle + } + if vo.InputLabel != nil { + objectMap["inputLabel"] = vo.InputLabel + } + if vo.Start != nil { + objectMap["start"] = vo.Start + } + if vo.End != nil { + objectMap["end"] = vo.End + } + if vo.FadeInDuration != nil { + objectMap["fadeInDuration"] = vo.FadeInDuration + } + if vo.FadeOutDuration != nil { + objectMap["fadeOutDuration"] = vo.FadeOutDuration + } + if vo.AudioGainLevel != nil { + objectMap["audioGainLevel"] = vo.AudioGainLevel + } + if vo.OdataType != "" { + objectMap["@odata.type"] = vo.OdataType + } + return json.Marshal(objectMap) +} + +// AsAudioOverlay is the BasicOverlay implementation for VideoOverlay. +func (vo VideoOverlay) AsAudioOverlay() (*AudioOverlay, bool) { + return nil, false +} + +// AsVideoOverlay is the BasicOverlay implementation for VideoOverlay. +func (vo VideoOverlay) AsVideoOverlay() (*VideoOverlay, bool) { + return &vo, true +} + +// AsOverlay is the BasicOverlay implementation for VideoOverlay. +func (vo VideoOverlay) AsOverlay() (*Overlay, bool) { + return nil, false +} + +// AsBasicOverlay is the BasicOverlay implementation for VideoOverlay. +func (vo VideoOverlay) AsBasicOverlay() (BasicOverlay, bool) { + return &vo, true +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/mediaservices/mgmt/2018-06-01-preview/media/operations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/mediaservices/mgmt/2018-06-01-preview/media/operations.go new file mode 100644 index 000000000..e66ab2ea8 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/mediaservices/mgmt/2018-06-01-preview/media/operations.go @@ -0,0 +1,126 @@ +package media + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "net/http" +) + +// OperationsClient is the client for the Operations methods of the Media service. +type OperationsClient struct { + BaseClient +} + +// NewOperationsClient creates an instance of the OperationsClient client. +func NewOperationsClient(subscriptionID string) OperationsClient { + return NewOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewOperationsClientWithBaseURI creates an instance of the OperationsClient client. +func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient { + return OperationsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// List lists all the Media Services operations. +func (client OperationsClient) List(ctx context.Context) (result OperationCollectionPage, err error) { + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "media.OperationsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.oc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "media.OperationsClient", "List", resp, "Failure sending request") + return + } + + result.oc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "media.OperationsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/providers/Microsoft.Media/operations"), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client OperationsClient) ListSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client OperationsClient) ListResponder(resp *http.Response) (result OperationCollection, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client OperationsClient) listNextResults(lastResults OperationCollection) (result OperationCollection, err error) { + req, err := lastResults.operationCollectionPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "media.OperationsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "media.OperationsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "media.OperationsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client OperationsClient) ListComplete(ctx context.Context) (result OperationCollectionIterator, err error) { + result.page, err = client.List(ctx) + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/mediaservices/mgmt/2018-06-01-preview/media/streamingendpoints.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/mediaservices/mgmt/2018-06-01-preview/media/streamingendpoints.go new file mode 100644 index 000000000..7f9f770ac --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/mediaservices/mgmt/2018-06-01-preview/media/streamingendpoints.go @@ -0,0 +1,708 @@ +package media + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// StreamingEndpointsClient is the client for the StreamingEndpoints methods of the Media service. +type StreamingEndpointsClient struct { + BaseClient +} + +// NewStreamingEndpointsClient creates an instance of the StreamingEndpointsClient client. +func NewStreamingEndpointsClient(subscriptionID string) StreamingEndpointsClient { + return NewStreamingEndpointsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewStreamingEndpointsClientWithBaseURI creates an instance of the StreamingEndpointsClient client. +func NewStreamingEndpointsClientWithBaseURI(baseURI string, subscriptionID string) StreamingEndpointsClient { + return StreamingEndpointsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Create creates a StreamingEndpoint. +// Parameters: +// resourceGroupName - the name of the resource group within the Azure subscription. +// accountName - the Media Services account name. +// streamingEndpointName - the name of the StreamingEndpoint. +// parameters - streamingEndpoint properties needed for creation. +// autoStart - the flag indicates if auto start the Live Event. +func (client StreamingEndpointsClient) Create(ctx context.Context, resourceGroupName string, accountName string, streamingEndpointName string, parameters StreamingEndpoint, autoStart *bool) (result StreamingEndpointsCreateFuture, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: streamingEndpointName, + Constraints: []validation.Constraint{{Target: "streamingEndpointName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "streamingEndpointName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "streamingEndpointName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("media.StreamingEndpointsClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, resourceGroupName, accountName, streamingEndpointName, parameters, autoStart) + if err != nil { + err = autorest.NewErrorWithError(err, "media.StreamingEndpointsClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "media.StreamingEndpointsClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client StreamingEndpointsClient) CreatePreparer(ctx context.Context, resourceGroupName string, accountName string, streamingEndpointName string, parameters StreamingEndpoint, autoStart *bool) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "streamingEndpointName": autorest.Encode("path", streamingEndpointName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if autoStart != nil { + queryParameters["autoStart"] = autorest.Encode("query", *autoStart) + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/streamingEndpoints/{streamingEndpointName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client StreamingEndpointsClient) CreateSender(req *http.Request) (future StreamingEndpointsCreateFuture, err error) { + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client StreamingEndpointsClient) CreateResponder(resp *http.Response) (result StreamingEndpoint, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes a StreamingEndpoint. +// Parameters: +// resourceGroupName - the name of the resource group within the Azure subscription. +// accountName - the Media Services account name. +// streamingEndpointName - the name of the StreamingEndpoint. +func (client StreamingEndpointsClient) Delete(ctx context.Context, resourceGroupName string, accountName string, streamingEndpointName string) (result StreamingEndpointsDeleteFuture, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: streamingEndpointName, + Constraints: []validation.Constraint{{Target: "streamingEndpointName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "streamingEndpointName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "streamingEndpointName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("media.StreamingEndpointsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, accountName, streamingEndpointName) + if err != nil { + err = autorest.NewErrorWithError(err, "media.StreamingEndpointsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "media.StreamingEndpointsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client StreamingEndpointsClient) DeletePreparer(ctx context.Context, resourceGroupName string, accountName string, streamingEndpointName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "streamingEndpointName": autorest.Encode("path", streamingEndpointName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/streamingEndpoints/{streamingEndpointName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client StreamingEndpointsClient) DeleteSender(req *http.Request) (future StreamingEndpointsDeleteFuture, err error) { + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client StreamingEndpointsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets a StreamingEndpoint. +// Parameters: +// resourceGroupName - the name of the resource group within the Azure subscription. +// accountName - the Media Services account name. +// streamingEndpointName - the name of the StreamingEndpoint. +func (client StreamingEndpointsClient) Get(ctx context.Context, resourceGroupName string, accountName string, streamingEndpointName string) (result StreamingEndpoint, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: streamingEndpointName, + Constraints: []validation.Constraint{{Target: "streamingEndpointName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "streamingEndpointName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "streamingEndpointName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("media.StreamingEndpointsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, accountName, streamingEndpointName) + if err != nil { + err = autorest.NewErrorWithError(err, "media.StreamingEndpointsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "media.StreamingEndpointsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "media.StreamingEndpointsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client StreamingEndpointsClient) GetPreparer(ctx context.Context, resourceGroupName string, accountName string, streamingEndpointName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "streamingEndpointName": autorest.Encode("path", streamingEndpointName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/streamingEndpoints/{streamingEndpointName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client StreamingEndpointsClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client StreamingEndpointsClient) GetResponder(resp *http.Response) (result StreamingEndpoint, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists the StreamingEndpoints in the account. +// Parameters: +// resourceGroupName - the name of the resource group within the Azure subscription. +// accountName - the Media Services account name. +func (client StreamingEndpointsClient) List(ctx context.Context, resourceGroupName string, accountName string) (result StreamingEndpointListResultPage, err error) { + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName, accountName) + if err != nil { + err = autorest.NewErrorWithError(err, "media.StreamingEndpointsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.selr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "media.StreamingEndpointsClient", "List", resp, "Failure sending request") + return + } + + result.selr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "media.StreamingEndpointsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client StreamingEndpointsClient) ListPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/streamingEndpoints", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client StreamingEndpointsClient) ListSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client StreamingEndpointsClient) ListResponder(resp *http.Response) (result StreamingEndpointListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client StreamingEndpointsClient) listNextResults(lastResults StreamingEndpointListResult) (result StreamingEndpointListResult, err error) { + req, err := lastResults.streamingEndpointListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "media.StreamingEndpointsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "media.StreamingEndpointsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "media.StreamingEndpointsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client StreamingEndpointsClient) ListComplete(ctx context.Context, resourceGroupName string, accountName string) (result StreamingEndpointListResultIterator, err error) { + result.page, err = client.List(ctx, resourceGroupName, accountName) + return +} + +// Scale scales an existing StreamingEndpoint. +// Parameters: +// resourceGroupName - the name of the resource group within the Azure subscription. +// accountName - the Media Services account name. +// streamingEndpointName - the name of the StreamingEndpoint. +// parameters - streamingEndpoint scale parameters +func (client StreamingEndpointsClient) Scale(ctx context.Context, resourceGroupName string, accountName string, streamingEndpointName string, parameters StreamingEntityScaleUnit) (result StreamingEndpointsScaleFuture, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: streamingEndpointName, + Constraints: []validation.Constraint{{Target: "streamingEndpointName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "streamingEndpointName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "streamingEndpointName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("media.StreamingEndpointsClient", "Scale", err.Error()) + } + + req, err := client.ScalePreparer(ctx, resourceGroupName, accountName, streamingEndpointName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "media.StreamingEndpointsClient", "Scale", nil, "Failure preparing request") + return + } + + result, err = client.ScaleSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "media.StreamingEndpointsClient", "Scale", result.Response(), "Failure sending request") + return + } + + return +} + +// ScalePreparer prepares the Scale request. +func (client StreamingEndpointsClient) ScalePreparer(ctx context.Context, resourceGroupName string, accountName string, streamingEndpointName string, parameters StreamingEntityScaleUnit) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "streamingEndpointName": autorest.Encode("path", streamingEndpointName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/streamingEndpoints/{streamingEndpointName}/scale", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ScaleSender sends the Scale request. The method will close the +// http.Response Body if it receives an error. +func (client StreamingEndpointsClient) ScaleSender(req *http.Request) (future StreamingEndpointsScaleFuture, err error) { + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// ScaleResponder handles the response to the Scale request. The method always +// closes the http.Response Body. +func (client StreamingEndpointsClient) ScaleResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// Start starts an existing StreamingEndpoint. +// Parameters: +// resourceGroupName - the name of the resource group within the Azure subscription. +// accountName - the Media Services account name. +// streamingEndpointName - the name of the StreamingEndpoint. +func (client StreamingEndpointsClient) Start(ctx context.Context, resourceGroupName string, accountName string, streamingEndpointName string) (result StreamingEndpointsStartFuture, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: streamingEndpointName, + Constraints: []validation.Constraint{{Target: "streamingEndpointName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "streamingEndpointName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "streamingEndpointName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("media.StreamingEndpointsClient", "Start", err.Error()) + } + + req, err := client.StartPreparer(ctx, resourceGroupName, accountName, streamingEndpointName) + if err != nil { + err = autorest.NewErrorWithError(err, "media.StreamingEndpointsClient", "Start", nil, "Failure preparing request") + return + } + + result, err = client.StartSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "media.StreamingEndpointsClient", "Start", result.Response(), "Failure sending request") + return + } + + return +} + +// StartPreparer prepares the Start request. +func (client StreamingEndpointsClient) StartPreparer(ctx context.Context, resourceGroupName string, accountName string, streamingEndpointName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "streamingEndpointName": autorest.Encode("path", streamingEndpointName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/streamingEndpoints/{streamingEndpointName}/start", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// StartSender sends the Start request. The method will close the +// http.Response Body if it receives an error. +func (client StreamingEndpointsClient) StartSender(req *http.Request) (future StreamingEndpointsStartFuture, err error) { + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// StartResponder handles the response to the Start request. The method always +// closes the http.Response Body. +func (client StreamingEndpointsClient) StartResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// Stop stops an existing StreamingEndpoint. +// Parameters: +// resourceGroupName - the name of the resource group within the Azure subscription. +// accountName - the Media Services account name. +// streamingEndpointName - the name of the StreamingEndpoint. +func (client StreamingEndpointsClient) Stop(ctx context.Context, resourceGroupName string, accountName string, streamingEndpointName string) (result StreamingEndpointsStopFuture, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: streamingEndpointName, + Constraints: []validation.Constraint{{Target: "streamingEndpointName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "streamingEndpointName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "streamingEndpointName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("media.StreamingEndpointsClient", "Stop", err.Error()) + } + + req, err := client.StopPreparer(ctx, resourceGroupName, accountName, streamingEndpointName) + if err != nil { + err = autorest.NewErrorWithError(err, "media.StreamingEndpointsClient", "Stop", nil, "Failure preparing request") + return + } + + result, err = client.StopSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "media.StreamingEndpointsClient", "Stop", result.Response(), "Failure sending request") + return + } + + return +} + +// StopPreparer prepares the Stop request. +func (client StreamingEndpointsClient) StopPreparer(ctx context.Context, resourceGroupName string, accountName string, streamingEndpointName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "streamingEndpointName": autorest.Encode("path", streamingEndpointName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/streamingEndpoints/{streamingEndpointName}/stop", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// StopSender sends the Stop request. The method will close the +// http.Response Body if it receives an error. +func (client StreamingEndpointsClient) StopSender(req *http.Request) (future StreamingEndpointsStopFuture, err error) { + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// StopResponder handles the response to the Stop request. The method always +// closes the http.Response Body. +func (client StreamingEndpointsClient) StopResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// Update updates a existing StreamingEndpoint. +// Parameters: +// resourceGroupName - the name of the resource group within the Azure subscription. +// accountName - the Media Services account name. +// streamingEndpointName - the name of the StreamingEndpoint. +// parameters - streamingEndpoint properties needed for creation. +func (client StreamingEndpointsClient) Update(ctx context.Context, resourceGroupName string, accountName string, streamingEndpointName string, parameters StreamingEndpoint) (result StreamingEndpointsUpdateFuture, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: streamingEndpointName, + Constraints: []validation.Constraint{{Target: "streamingEndpointName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "streamingEndpointName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "streamingEndpointName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("media.StreamingEndpointsClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, accountName, streamingEndpointName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "media.StreamingEndpointsClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "media.StreamingEndpointsClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client StreamingEndpointsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, accountName string, streamingEndpointName string, parameters StreamingEndpoint) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "streamingEndpointName": autorest.Encode("path", streamingEndpointName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/streamingEndpoints/{streamingEndpointName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client StreamingEndpointsClient) UpdateSender(req *http.Request) (future StreamingEndpointsUpdateFuture, err error) { + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client StreamingEndpointsClient) UpdateResponder(resp *http.Response) (result StreamingEndpoint, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/mediaservices/mgmt/2018-06-01-preview/media/streaminglocators.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/mediaservices/mgmt/2018-06-01-preview/media/streaminglocators.go new file mode 100644 index 000000000..af3a8e469 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/mediaservices/mgmt/2018-06-01-preview/media/streaminglocators.go @@ -0,0 +1,505 @@ +package media + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// StreamingLocatorsClient is the client for the StreamingLocators methods of the Media service. +type StreamingLocatorsClient struct { + BaseClient +} + +// NewStreamingLocatorsClient creates an instance of the StreamingLocatorsClient client. +func NewStreamingLocatorsClient(subscriptionID string) StreamingLocatorsClient { + return NewStreamingLocatorsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewStreamingLocatorsClientWithBaseURI creates an instance of the StreamingLocatorsClient client. +func NewStreamingLocatorsClientWithBaseURI(baseURI string, subscriptionID string) StreamingLocatorsClient { + return StreamingLocatorsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Create create a Streaming Locator in the Media Services account +// Parameters: +// resourceGroupName - the name of the resource group within the Azure subscription. +// accountName - the Media Services account name. +// streamingLocatorName - the Streaming Locator name. +// parameters - the request parameters +func (client StreamingLocatorsClient) Create(ctx context.Context, resourceGroupName string, accountName string, streamingLocatorName string, parameters StreamingLocator) (result StreamingLocator, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.StreamingLocatorProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.StreamingLocatorProperties.AssetName", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.StreamingLocatorProperties.StreamingPolicyName", Name: validation.Null, Rule: true, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("media.StreamingLocatorsClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, resourceGroupName, accountName, streamingLocatorName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "media.StreamingLocatorsClient", "Create", nil, "Failure preparing request") + return + } + + resp, err := client.CreateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "media.StreamingLocatorsClient", "Create", resp, "Failure sending request") + return + } + + result, err = client.CreateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "media.StreamingLocatorsClient", "Create", resp, "Failure responding to request") + } + + return +} + +// CreatePreparer prepares the Create request. +func (client StreamingLocatorsClient) CreatePreparer(ctx context.Context, resourceGroupName string, accountName string, streamingLocatorName string, parameters StreamingLocator) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "streamingLocatorName": autorest.Encode("path", streamingLocatorName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/streamingLocators/{streamingLocatorName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client StreamingLocatorsClient) CreateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client StreamingLocatorsClient) CreateResponder(resp *http.Response) (result StreamingLocator, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes a Streaming Locator in the Media Services account +// Parameters: +// resourceGroupName - the name of the resource group within the Azure subscription. +// accountName - the Media Services account name. +// streamingLocatorName - the Streaming Locator name. +func (client StreamingLocatorsClient) Delete(ctx context.Context, resourceGroupName string, accountName string, streamingLocatorName string) (result autorest.Response, err error) { + req, err := client.DeletePreparer(ctx, resourceGroupName, accountName, streamingLocatorName) + if err != nil { + err = autorest.NewErrorWithError(err, "media.StreamingLocatorsClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "media.StreamingLocatorsClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "media.StreamingLocatorsClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client StreamingLocatorsClient) DeletePreparer(ctx context.Context, resourceGroupName string, accountName string, streamingLocatorName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "streamingLocatorName": autorest.Encode("path", streamingLocatorName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/streamingLocators/{streamingLocatorName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client StreamingLocatorsClient) DeleteSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client StreamingLocatorsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get get the details of a Streaming Locator in the Media Services account +// Parameters: +// resourceGroupName - the name of the resource group within the Azure subscription. +// accountName - the Media Services account name. +// streamingLocatorName - the Streaming Locator name. +func (client StreamingLocatorsClient) Get(ctx context.Context, resourceGroupName string, accountName string, streamingLocatorName string) (result StreamingLocator, err error) { + req, err := client.GetPreparer(ctx, resourceGroupName, accountName, streamingLocatorName) + if err != nil { + err = autorest.NewErrorWithError(err, "media.StreamingLocatorsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "media.StreamingLocatorsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "media.StreamingLocatorsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client StreamingLocatorsClient) GetPreparer(ctx context.Context, resourceGroupName string, accountName string, streamingLocatorName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "streamingLocatorName": autorest.Encode("path", streamingLocatorName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/streamingLocators/{streamingLocatorName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client StreamingLocatorsClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client StreamingLocatorsClient) GetResponder(resp *http.Response) (result StreamingLocator, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists the Streaming Locators in the account +// Parameters: +// resourceGroupName - the name of the resource group within the Azure subscription. +// accountName - the Media Services account name. +// filter - restricts the set of items returned. +// top - specifies a non-negative integer n that limits the number of items returned from a collection. The +// service returns the number of available items up to but not greater than the specified value n. +// orderby - specifies the the key by which the result collection should be ordered. +func (client StreamingLocatorsClient) List(ctx context.Context, resourceGroupName string, accountName string, filter string, top *int32, orderby string) (result StreamingLocatorCollectionPage, err error) { + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName, accountName, filter, top, orderby) + if err != nil { + err = autorest.NewErrorWithError(err, "media.StreamingLocatorsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.slc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "media.StreamingLocatorsClient", "List", resp, "Failure sending request") + return + } + + result.slc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "media.StreamingLocatorsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client StreamingLocatorsClient) ListPreparer(ctx context.Context, resourceGroupName string, accountName string, filter string, top *int32, orderby string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + if len(orderby) > 0 { + queryParameters["$orderby"] = autorest.Encode("query", orderby) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/streamingLocators", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client StreamingLocatorsClient) ListSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client StreamingLocatorsClient) ListResponder(resp *http.Response) (result StreamingLocatorCollection, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client StreamingLocatorsClient) listNextResults(lastResults StreamingLocatorCollection) (result StreamingLocatorCollection, err error) { + req, err := lastResults.streamingLocatorCollectionPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "media.StreamingLocatorsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "media.StreamingLocatorsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "media.StreamingLocatorsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client StreamingLocatorsClient) ListComplete(ctx context.Context, resourceGroupName string, accountName string, filter string, top *int32, orderby string) (result StreamingLocatorCollectionIterator, err error) { + result.page, err = client.List(ctx, resourceGroupName, accountName, filter, top, orderby) + return +} + +// ListContentKeys list Content Keys used by this Streaming Locator +// Parameters: +// resourceGroupName - the name of the resource group within the Azure subscription. +// accountName - the Media Services account name. +// streamingLocatorName - the Streaming Locator name. +func (client StreamingLocatorsClient) ListContentKeys(ctx context.Context, resourceGroupName string, accountName string, streamingLocatorName string) (result ListContentKeysResponse, err error) { + req, err := client.ListContentKeysPreparer(ctx, resourceGroupName, accountName, streamingLocatorName) + if err != nil { + err = autorest.NewErrorWithError(err, "media.StreamingLocatorsClient", "ListContentKeys", nil, "Failure preparing request") + return + } + + resp, err := client.ListContentKeysSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "media.StreamingLocatorsClient", "ListContentKeys", resp, "Failure sending request") + return + } + + result, err = client.ListContentKeysResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "media.StreamingLocatorsClient", "ListContentKeys", resp, "Failure responding to request") + } + + return +} + +// ListContentKeysPreparer prepares the ListContentKeys request. +func (client StreamingLocatorsClient) ListContentKeysPreparer(ctx context.Context, resourceGroupName string, accountName string, streamingLocatorName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "streamingLocatorName": autorest.Encode("path", streamingLocatorName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/streamingLocators/{streamingLocatorName}/listContentKeys", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListContentKeysSender sends the ListContentKeys request. The method will close the +// http.Response Body if it receives an error. +func (client StreamingLocatorsClient) ListContentKeysSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListContentKeysResponder handles the response to the ListContentKeys request. The method always +// closes the http.Response Body. +func (client StreamingLocatorsClient) ListContentKeysResponder(resp *http.Response) (result ListContentKeysResponse, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListPaths list Paths supported by this Streaming Locator +// Parameters: +// resourceGroupName - the name of the resource group within the Azure subscription. +// accountName - the Media Services account name. +// streamingLocatorName - the Streaming Locator name. +func (client StreamingLocatorsClient) ListPaths(ctx context.Context, resourceGroupName string, accountName string, streamingLocatorName string) (result ListPathsResponse, err error) { + req, err := client.ListPathsPreparer(ctx, resourceGroupName, accountName, streamingLocatorName) + if err != nil { + err = autorest.NewErrorWithError(err, "media.StreamingLocatorsClient", "ListPaths", nil, "Failure preparing request") + return + } + + resp, err := client.ListPathsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "media.StreamingLocatorsClient", "ListPaths", resp, "Failure sending request") + return + } + + result, err = client.ListPathsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "media.StreamingLocatorsClient", "ListPaths", resp, "Failure responding to request") + } + + return +} + +// ListPathsPreparer prepares the ListPaths request. +func (client StreamingLocatorsClient) ListPathsPreparer(ctx context.Context, resourceGroupName string, accountName string, streamingLocatorName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "streamingLocatorName": autorest.Encode("path", streamingLocatorName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/streamingLocators/{streamingLocatorName}/listPaths", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListPathsSender sends the ListPaths request. The method will close the +// http.Response Body if it receives an error. +func (client StreamingLocatorsClient) ListPathsSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListPathsResponder handles the response to the ListPaths request. The method always +// closes the http.Response Body. +func (client StreamingLocatorsClient) ListPathsResponder(resp *http.Response) (result ListPathsResponse, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/mediaservices/mgmt/2018-06-01-preview/media/streamingpolicies.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/mediaservices/mgmt/2018-06-01-preview/media/streamingpolicies.go new file mode 100644 index 000000000..69846af4d --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/mediaservices/mgmt/2018-06-01-preview/media/streamingpolicies.go @@ -0,0 +1,401 @@ +package media + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// StreamingPoliciesClient is the client for the StreamingPolicies methods of the Media service. +type StreamingPoliciesClient struct { + BaseClient +} + +// NewStreamingPoliciesClient creates an instance of the StreamingPoliciesClient client. +func NewStreamingPoliciesClient(subscriptionID string) StreamingPoliciesClient { + return NewStreamingPoliciesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewStreamingPoliciesClientWithBaseURI creates an instance of the StreamingPoliciesClient client. +func NewStreamingPoliciesClientWithBaseURI(baseURI string, subscriptionID string) StreamingPoliciesClient { + return StreamingPoliciesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Create create a Streaming Policy in the Media Services account +// Parameters: +// resourceGroupName - the name of the resource group within the Azure subscription. +// accountName - the Media Services account name. +// streamingPolicyName - the Streaming Policy name. +// parameters - the request parameters +func (client StreamingPoliciesClient) Create(ctx context.Context, resourceGroupName string, accountName string, streamingPolicyName string, parameters StreamingPolicy) (result StreamingPolicy, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.StreamingPolicyProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.StreamingPolicyProperties.EnvelopeEncryption", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.StreamingPolicyProperties.EnvelopeEncryption.EnabledProtocols", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.StreamingPolicyProperties.EnvelopeEncryption.EnabledProtocols.Download", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.StreamingPolicyProperties.EnvelopeEncryption.EnabledProtocols.Dash", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.StreamingPolicyProperties.EnvelopeEncryption.EnabledProtocols.Hls", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.StreamingPolicyProperties.EnvelopeEncryption.EnabledProtocols.SmoothStreaming", Name: validation.Null, Rule: true, Chain: nil}, + }}, + }}, + {Target: "parameters.StreamingPolicyProperties.CommonEncryptionCenc", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.StreamingPolicyProperties.CommonEncryptionCenc.EnabledProtocols", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.StreamingPolicyProperties.CommonEncryptionCenc.EnabledProtocols.Download", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.StreamingPolicyProperties.CommonEncryptionCenc.EnabledProtocols.Dash", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.StreamingPolicyProperties.CommonEncryptionCenc.EnabledProtocols.Hls", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.StreamingPolicyProperties.CommonEncryptionCenc.EnabledProtocols.SmoothStreaming", Name: validation.Null, Rule: true, Chain: nil}, + }}, + }}, + {Target: "parameters.StreamingPolicyProperties.CommonEncryptionCbcs", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.StreamingPolicyProperties.CommonEncryptionCbcs.EnabledProtocols", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.StreamingPolicyProperties.CommonEncryptionCbcs.EnabledProtocols.Download", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.StreamingPolicyProperties.CommonEncryptionCbcs.EnabledProtocols.Dash", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.StreamingPolicyProperties.CommonEncryptionCbcs.EnabledProtocols.Hls", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.StreamingPolicyProperties.CommonEncryptionCbcs.EnabledProtocols.SmoothStreaming", Name: validation.Null, Rule: true, Chain: nil}, + }}, + {Target: "parameters.StreamingPolicyProperties.CommonEncryptionCbcs.Drm", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.StreamingPolicyProperties.CommonEncryptionCbcs.Drm.FairPlay", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.StreamingPolicyProperties.CommonEncryptionCbcs.Drm.FairPlay.AllowPersistentLicense", Name: validation.Null, Rule: true, Chain: nil}}}, + }}, + }}, + {Target: "parameters.StreamingPolicyProperties.NoEncryption", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.StreamingPolicyProperties.NoEncryption.EnabledProtocols", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.StreamingPolicyProperties.NoEncryption.EnabledProtocols.Download", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.StreamingPolicyProperties.NoEncryption.EnabledProtocols.Dash", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.StreamingPolicyProperties.NoEncryption.EnabledProtocols.Hls", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.StreamingPolicyProperties.NoEncryption.EnabledProtocols.SmoothStreaming", Name: validation.Null, Rule: true, Chain: nil}, + }}, + }}, + }}}}}); err != nil { + return result, validation.NewError("media.StreamingPoliciesClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, resourceGroupName, accountName, streamingPolicyName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "media.StreamingPoliciesClient", "Create", nil, "Failure preparing request") + return + } + + resp, err := client.CreateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "media.StreamingPoliciesClient", "Create", resp, "Failure sending request") + return + } + + result, err = client.CreateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "media.StreamingPoliciesClient", "Create", resp, "Failure responding to request") + } + + return +} + +// CreatePreparer prepares the Create request. +func (client StreamingPoliciesClient) CreatePreparer(ctx context.Context, resourceGroupName string, accountName string, streamingPolicyName string, parameters StreamingPolicy) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "streamingPolicyName": autorest.Encode("path", streamingPolicyName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/streamingPolicies/{streamingPolicyName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client StreamingPoliciesClient) CreateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client StreamingPoliciesClient) CreateResponder(resp *http.Response) (result StreamingPolicy, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes a Streaming Policy in the Media Services account +// Parameters: +// resourceGroupName - the name of the resource group within the Azure subscription. +// accountName - the Media Services account name. +// streamingPolicyName - the Streaming Policy name. +func (client StreamingPoliciesClient) Delete(ctx context.Context, resourceGroupName string, accountName string, streamingPolicyName string) (result autorest.Response, err error) { + req, err := client.DeletePreparer(ctx, resourceGroupName, accountName, streamingPolicyName) + if err != nil { + err = autorest.NewErrorWithError(err, "media.StreamingPoliciesClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "media.StreamingPoliciesClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "media.StreamingPoliciesClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client StreamingPoliciesClient) DeletePreparer(ctx context.Context, resourceGroupName string, accountName string, streamingPolicyName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "streamingPolicyName": autorest.Encode("path", streamingPolicyName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/streamingPolicies/{streamingPolicyName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client StreamingPoliciesClient) DeleteSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client StreamingPoliciesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get get the details of a Streaming Policy in the Media Services account +// Parameters: +// resourceGroupName - the name of the resource group within the Azure subscription. +// accountName - the Media Services account name. +// streamingPolicyName - the Streaming Policy name. +func (client StreamingPoliciesClient) Get(ctx context.Context, resourceGroupName string, accountName string, streamingPolicyName string) (result StreamingPolicy, err error) { + req, err := client.GetPreparer(ctx, resourceGroupName, accountName, streamingPolicyName) + if err != nil { + err = autorest.NewErrorWithError(err, "media.StreamingPoliciesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "media.StreamingPoliciesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "media.StreamingPoliciesClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client StreamingPoliciesClient) GetPreparer(ctx context.Context, resourceGroupName string, accountName string, streamingPolicyName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "streamingPolicyName": autorest.Encode("path", streamingPolicyName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/streamingPolicies/{streamingPolicyName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client StreamingPoliciesClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client StreamingPoliciesClient) GetResponder(resp *http.Response) (result StreamingPolicy, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists the Streaming Policies in the account +// Parameters: +// resourceGroupName - the name of the resource group within the Azure subscription. +// accountName - the Media Services account name. +// filter - restricts the set of items returned. +// top - specifies a non-negative integer n that limits the number of items returned from a collection. The +// service returns the number of available items up to but not greater than the specified value n. +// orderby - specifies the the key by which the result collection should be ordered. +func (client StreamingPoliciesClient) List(ctx context.Context, resourceGroupName string, accountName string, filter string, top *int32, orderby string) (result StreamingPolicyCollectionPage, err error) { + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName, accountName, filter, top, orderby) + if err != nil { + err = autorest.NewErrorWithError(err, "media.StreamingPoliciesClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.spc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "media.StreamingPoliciesClient", "List", resp, "Failure sending request") + return + } + + result.spc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "media.StreamingPoliciesClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client StreamingPoliciesClient) ListPreparer(ctx context.Context, resourceGroupName string, accountName string, filter string, top *int32, orderby string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + if len(orderby) > 0 { + queryParameters["$orderby"] = autorest.Encode("query", orderby) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/streamingPolicies", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client StreamingPoliciesClient) ListSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client StreamingPoliciesClient) ListResponder(resp *http.Response) (result StreamingPolicyCollection, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client StreamingPoliciesClient) listNextResults(lastResults StreamingPolicyCollection) (result StreamingPolicyCollection, err error) { + req, err := lastResults.streamingPolicyCollectionPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "media.StreamingPoliciesClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "media.StreamingPoliciesClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "media.StreamingPoliciesClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client StreamingPoliciesClient) ListComplete(ctx context.Context, resourceGroupName string, accountName string, filter string, top *int32, orderby string) (result StreamingPolicyCollectionIterator, err error) { + result.page, err = client.List(ctx, resourceGroupName, accountName, filter, top, orderby) + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/mediaservices/mgmt/2018-06-01-preview/media/transforms.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/mediaservices/mgmt/2018-06-01-preview/media/transforms.go new file mode 100644 index 000000000..3afb5bb08 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/mediaservices/mgmt/2018-06-01-preview/media/transforms.go @@ -0,0 +1,438 @@ +package media + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// TransformsClient is the client for the Transforms methods of the Media service. +type TransformsClient struct { + BaseClient +} + +// NewTransformsClient creates an instance of the TransformsClient client. +func NewTransformsClient(subscriptionID string) TransformsClient { + return NewTransformsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewTransformsClientWithBaseURI creates an instance of the TransformsClient client. +func NewTransformsClientWithBaseURI(baseURI string, subscriptionID string) TransformsClient { + return TransformsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or updates a new Transform. +// Parameters: +// resourceGroupName - the name of the resource group within the Azure subscription. +// accountName - the Media Services account name. +// transformName - the Transform name. +// parameters - the request parameters +func (client TransformsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, accountName string, transformName string, parameters Transform) (result Transform, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.TransformProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.TransformProperties.Outputs", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("media.TransformsClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, accountName, transformName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "media.TransformsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "media.TransformsClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "media.TransformsClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client TransformsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, accountName string, transformName string, parameters Transform) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "transformName": autorest.Encode("path", transformName), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/transforms/{transformName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client TransformsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client TransformsClient) CreateOrUpdateResponder(resp *http.Response) (result Transform, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes a Transform. +// Parameters: +// resourceGroupName - the name of the resource group within the Azure subscription. +// accountName - the Media Services account name. +// transformName - the Transform name. +func (client TransformsClient) Delete(ctx context.Context, resourceGroupName string, accountName string, transformName string) (result autorest.Response, err error) { + req, err := client.DeletePreparer(ctx, resourceGroupName, accountName, transformName) + if err != nil { + err = autorest.NewErrorWithError(err, "media.TransformsClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "media.TransformsClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "media.TransformsClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client TransformsClient) DeletePreparer(ctx context.Context, resourceGroupName string, accountName string, transformName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "transformName": autorest.Encode("path", transformName), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/transforms/{transformName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client TransformsClient) DeleteSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client TransformsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets a Transform. +// Parameters: +// resourceGroupName - the name of the resource group within the Azure subscription. +// accountName - the Media Services account name. +// transformName - the Transform name. +func (client TransformsClient) Get(ctx context.Context, resourceGroupName string, accountName string, transformName string) (result Transform, err error) { + req, err := client.GetPreparer(ctx, resourceGroupName, accountName, transformName) + if err != nil { + err = autorest.NewErrorWithError(err, "media.TransformsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "media.TransformsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "media.TransformsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client TransformsClient) GetPreparer(ctx context.Context, resourceGroupName string, accountName string, transformName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "transformName": autorest.Encode("path", transformName), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/transforms/{transformName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client TransformsClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client TransformsClient) GetResponder(resp *http.Response) (result Transform, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists the Transforms in the account. +// Parameters: +// resourceGroupName - the name of the resource group within the Azure subscription. +// accountName - the Media Services account name. +// filter - restricts the set of items returned. +// top - specifies a non-negative integer n that limits the number of items returned from a collection. The +// service returns the number of available items up to but not greater than the specified value n. +// skip - specifies a non-negative integer n that excludes the first n items of the queried collection from the +// result. The service returns items starting at position n+1. +func (client TransformsClient) List(ctx context.Context, resourceGroupName string, accountName string, filter string, top *int32, skip *int32) (result TransformCollectionPage, err error) { + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName, accountName, filter, top, skip) + if err != nil { + err = autorest.NewErrorWithError(err, "media.TransformsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.tc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "media.TransformsClient", "List", resp, "Failure sending request") + return + } + + result.tc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "media.TransformsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client TransformsClient) ListPreparer(ctx context.Context, resourceGroupName string, accountName string, filter string, top *int32, skip *int32) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + if skip != nil { + queryParameters["$skip"] = autorest.Encode("query", *skip) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/transforms", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client TransformsClient) ListSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client TransformsClient) ListResponder(resp *http.Response) (result TransformCollection, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client TransformsClient) listNextResults(lastResults TransformCollection) (result TransformCollection, err error) { + req, err := lastResults.transformCollectionPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "media.TransformsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "media.TransformsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "media.TransformsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client TransformsClient) ListComplete(ctx context.Context, resourceGroupName string, accountName string, filter string, top *int32, skip *int32) (result TransformCollectionIterator, err error) { + result.page, err = client.List(ctx, resourceGroupName, accountName, filter, top, skip) + return +} + +// Update updates a Transform. +// Parameters: +// resourceGroupName - the name of the resource group within the Azure subscription. +// accountName - the Media Services account name. +// transformName - the Transform name. +// parameters - the request parameters +func (client TransformsClient) Update(ctx context.Context, resourceGroupName string, accountName string, transformName string, parameters Transform) (result Transform, err error) { + req, err := client.UpdatePreparer(ctx, resourceGroupName, accountName, transformName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "media.TransformsClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "media.TransformsClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "media.TransformsClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client TransformsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, accountName string, transformName string, parameters Transform) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "transformName": autorest.Encode("path", transformName), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/transforms/{transformName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client TransformsClient) UpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client TransformsClient) UpdateResponder(resp *http.Response) (result Transform, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/mediaservices/mgmt/2018-06-01-preview/media/version.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/mediaservices/mgmt/2018-06-01-preview/media/version.go new file mode 100644 index 000000000..bc9dc4019 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/mediaservices/mgmt/2018-06-01-preview/media/version.go @@ -0,0 +1,30 @@ +package media + +import "github.com/Azure/azure-sdk-for-go/version" + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// UserAgent returns the UserAgent string to use when sending http.Requests. +func UserAgent() string { + return "Azure-SDK-For-Go/" + version.Number + " media/2018-06-01-preview" +} + +// Version returns the semantic version (see http://semver.org) of the client. +func Version() string { + return version.Number +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights/alertrules.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights/alertrules.go index c38f5453d..10956eedd 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights/alertrules.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights/alertrules.go @@ -318,6 +318,68 @@ func (client AlertRulesClient) ListByResourceGroupResponder(resp *http.Response) return } +// ListBySubscription list the alert rules within a subscription. +func (client AlertRulesClient) ListBySubscription(ctx context.Context) (result AlertRuleResourceCollection, err error) { + req, err := client.ListBySubscriptionPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "insights.AlertRulesClient", "ListBySubscription", nil, "Failure preparing request") + return + } + + resp, err := client.ListBySubscriptionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "insights.AlertRulesClient", "ListBySubscription", resp, "Failure sending request") + return + } + + result, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "insights.AlertRulesClient", "ListBySubscription", resp, "Failure responding to request") + } + + return +} + +// ListBySubscriptionPreparer prepares the ListBySubscription request. +func (client AlertRulesClient) ListBySubscriptionPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2016-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/microsoft.insights/alertrules", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListBySubscriptionSender sends the ListBySubscription request. The method will close the +// http.Response Body if it receives an error. +func (client AlertRulesClient) ListBySubscriptionSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListBySubscriptionResponder handles the response to the ListBySubscription request. The method always +// closes the http.Response Body. +func (client AlertRulesClient) ListBySubscriptionResponder(resp *http.Response) (result AlertRuleResourceCollection, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + // Update updates an existing AlertRuleResource. To update other fields use the CreateOrUpdate method. // Parameters: // resourceGroupName - the name of the resource group. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights/autoscalesettings.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights/autoscalesettings.go index 95eb1e80a..72f975844 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights/autoscalesettings.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights/autoscalesettings.go @@ -345,6 +345,96 @@ func (client AutoscaleSettingsClient) ListByResourceGroupComplete(ctx context.Co return } +// ListBySubscription lists the autoscale settings for a subscription +func (client AutoscaleSettingsClient) ListBySubscription(ctx context.Context) (result AutoscaleSettingResourceCollectionPage, err error) { + result.fn = client.listBySubscriptionNextResults + req, err := client.ListBySubscriptionPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "insights.AutoscaleSettingsClient", "ListBySubscription", nil, "Failure preparing request") + return + } + + resp, err := client.ListBySubscriptionSender(req) + if err != nil { + result.asrc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "insights.AutoscaleSettingsClient", "ListBySubscription", resp, "Failure sending request") + return + } + + result.asrc, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "insights.AutoscaleSettingsClient", "ListBySubscription", resp, "Failure responding to request") + } + + return +} + +// ListBySubscriptionPreparer prepares the ListBySubscription request. +func (client AutoscaleSettingsClient) ListBySubscriptionPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-04-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/microsoft.insights/autoscalesettings", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListBySubscriptionSender sends the ListBySubscription request. The method will close the +// http.Response Body if it receives an error. +func (client AutoscaleSettingsClient) ListBySubscriptionSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListBySubscriptionResponder handles the response to the ListBySubscription request. The method always +// closes the http.Response Body. +func (client AutoscaleSettingsClient) ListBySubscriptionResponder(resp *http.Response) (result AutoscaleSettingResourceCollection, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listBySubscriptionNextResults retrieves the next set of results, if any. +func (client AutoscaleSettingsClient) listBySubscriptionNextResults(lastResults AutoscaleSettingResourceCollection) (result AutoscaleSettingResourceCollection, err error) { + req, err := lastResults.autoscaleSettingResourceCollectionPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "insights.AutoscaleSettingsClient", "listBySubscriptionNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListBySubscriptionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "insights.AutoscaleSettingsClient", "listBySubscriptionNextResults", resp, "Failure sending next results request") + } + result, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "insights.AutoscaleSettingsClient", "listBySubscriptionNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required. +func (client AutoscaleSettingsClient) ListBySubscriptionComplete(ctx context.Context) (result AutoscaleSettingResourceCollectionIterator, err error) { + result.page, err = client.ListBySubscription(ctx) + return +} + // Update updates an existing AutoscaleSettingsResource. To update other fields use the CreateOrUpdate method. // Parameters: // resourceGroupName - the name of the resource group. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights/models.go index decb179ef..45ef7b546 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights/models.go @@ -1291,6 +1291,8 @@ type AzureAppPushReceiver struct { type DiagnosticSettings struct { // StorageAccountID - The resource ID of the storage account to which you would like to send Diagnostic Logs. StorageAccountID *string `json:"storageAccountId,omitempty"` + // ServiceBusRuleID - The service bus rule Id of the diagnostic setting. This is here to maintain backwards compatibility. + ServiceBusRuleID *string `json:"serviceBusRuleId,omitempty"` // EventHubAuthorizationRuleID - The resource Id for the event hub authorization rule. EventHubAuthorizationRuleID *string `json:"eventHubAuthorizationRuleId,omitempty"` // EventHubName - The name of the event hub. If none is specified, the default event hub will be selected. @@ -1311,7 +1313,8 @@ type DiagnosticSettingsCategory struct { // DiagnosticSettingsCategoryResource the diagnostic settings category resource. type DiagnosticSettingsCategoryResource struct { - autorest.Response `json:"-"` + autorest.Response `json:"-"` + // DiagnosticSettingsCategory - The properties of a Diagnostic Settings Category. *DiagnosticSettingsCategory `json:"properties,omitempty"` // ID - Azure resource Id ID *string `json:"id,omitempty"` @@ -1399,7 +1402,8 @@ type DiagnosticSettingsCategoryResourceCollection struct { // DiagnosticSettingsResource the diagnostic setting resource. type DiagnosticSettingsResource struct { - autorest.Response `json:"-"` + autorest.Response `json:"-"` + // DiagnosticSettings - Properties of a Diagnostic Settings Resource. *DiagnosticSettings `json:"properties,omitempty"` // ID - Azure resource Id ID *string `json:"id,omitempty"` diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2018-03-01/insights/alertrules.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2018-03-01/insights/alertrules.go index c38f5453d..10956eedd 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2018-03-01/insights/alertrules.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2018-03-01/insights/alertrules.go @@ -318,6 +318,68 @@ func (client AlertRulesClient) ListByResourceGroupResponder(resp *http.Response) return } +// ListBySubscription list the alert rules within a subscription. +func (client AlertRulesClient) ListBySubscription(ctx context.Context) (result AlertRuleResourceCollection, err error) { + req, err := client.ListBySubscriptionPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "insights.AlertRulesClient", "ListBySubscription", nil, "Failure preparing request") + return + } + + resp, err := client.ListBySubscriptionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "insights.AlertRulesClient", "ListBySubscription", resp, "Failure sending request") + return + } + + result, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "insights.AlertRulesClient", "ListBySubscription", resp, "Failure responding to request") + } + + return +} + +// ListBySubscriptionPreparer prepares the ListBySubscription request. +func (client AlertRulesClient) ListBySubscriptionPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2016-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/microsoft.insights/alertrules", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListBySubscriptionSender sends the ListBySubscription request. The method will close the +// http.Response Body if it receives an error. +func (client AlertRulesClient) ListBySubscriptionSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListBySubscriptionResponder handles the response to the ListBySubscription request. The method always +// closes the http.Response Body. +func (client AlertRulesClient) ListBySubscriptionResponder(resp *http.Response) (result AlertRuleResourceCollection, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + // Update updates an existing AlertRuleResource. To update other fields use the CreateOrUpdate method. // Parameters: // resourceGroupName - the name of the resource group. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2018-03-01/insights/autoscalesettings.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2018-03-01/insights/autoscalesettings.go index 95eb1e80a..72f975844 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2018-03-01/insights/autoscalesettings.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2018-03-01/insights/autoscalesettings.go @@ -345,6 +345,96 @@ func (client AutoscaleSettingsClient) ListByResourceGroupComplete(ctx context.Co return } +// ListBySubscription lists the autoscale settings for a subscription +func (client AutoscaleSettingsClient) ListBySubscription(ctx context.Context) (result AutoscaleSettingResourceCollectionPage, err error) { + result.fn = client.listBySubscriptionNextResults + req, err := client.ListBySubscriptionPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "insights.AutoscaleSettingsClient", "ListBySubscription", nil, "Failure preparing request") + return + } + + resp, err := client.ListBySubscriptionSender(req) + if err != nil { + result.asrc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "insights.AutoscaleSettingsClient", "ListBySubscription", resp, "Failure sending request") + return + } + + result.asrc, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "insights.AutoscaleSettingsClient", "ListBySubscription", resp, "Failure responding to request") + } + + return +} + +// ListBySubscriptionPreparer prepares the ListBySubscription request. +func (client AutoscaleSettingsClient) ListBySubscriptionPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-04-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/microsoft.insights/autoscalesettings", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListBySubscriptionSender sends the ListBySubscription request. The method will close the +// http.Response Body if it receives an error. +func (client AutoscaleSettingsClient) ListBySubscriptionSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListBySubscriptionResponder handles the response to the ListBySubscription request. The method always +// closes the http.Response Body. +func (client AutoscaleSettingsClient) ListBySubscriptionResponder(resp *http.Response) (result AutoscaleSettingResourceCollection, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listBySubscriptionNextResults retrieves the next set of results, if any. +func (client AutoscaleSettingsClient) listBySubscriptionNextResults(lastResults AutoscaleSettingResourceCollection) (result AutoscaleSettingResourceCollection, err error) { + req, err := lastResults.autoscaleSettingResourceCollectionPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "insights.AutoscaleSettingsClient", "listBySubscriptionNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListBySubscriptionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "insights.AutoscaleSettingsClient", "listBySubscriptionNextResults", resp, "Failure sending next results request") + } + result, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "insights.AutoscaleSettingsClient", "listBySubscriptionNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required. +func (client AutoscaleSettingsClient) ListBySubscriptionComplete(ctx context.Context) (result AutoscaleSettingResourceCollectionIterator, err error) { + result.page, err = client.ListBySubscription(ctx) + return +} + // Update updates an existing AutoscaleSettingsResource. To update other fields use the CreateOrUpdate method. // Parameters: // resourceGroupName - the name of the resource group. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2018-03-01/insights/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2018-03-01/insights/models.go index 629b8af12..0e9429117 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2018-03-01/insights/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2018-03-01/insights/models.go @@ -509,13 +509,13 @@ func PossibleUnitValues() []Unit { return []Unit{UnitBytes, UnitByteSeconds, UnitBytesPerSecond, UnitCount, UnitCountPerSecond, UnitMilliSeconds, UnitPercent, UnitSeconds, UnitUnspecified} } -// BasicAction ... +// BasicAction action descriptor. type BasicAction interface { AsAlertingAction() (*AlertingAction, bool) AsAction() (*Action, bool) } -// Action ... +// Action action descriptor. type Action struct { // OdataType - Possible values include: 'OdataTypeAction', 'OdataTypeMicrosoftWindowsAzureManagementMonitoringAlertsModelsMicrosoftAppInsightsNexusDataContractsResourcesScheduledQueryRulesAlertingAction' OdataType OdataTypeBasicAction `json:"odata.type,omitempty"` @@ -1806,6 +1806,8 @@ type CalculateBaselineResponse struct { type DiagnosticSettings struct { // StorageAccountID - The resource ID of the storage account to which you would like to send Diagnostic Logs. StorageAccountID *string `json:"storageAccountId,omitempty"` + // ServiceBusRuleID - The service bus rule Id of the diagnostic setting. This is here to maintain backwards compatibility. + ServiceBusRuleID *string `json:"serviceBusRuleId,omitempty"` // EventHubAuthorizationRuleID - The resource Id for the event hub authorization rule. EventHubAuthorizationRuleID *string `json:"eventHubAuthorizationRuleId,omitempty"` // EventHubName - The name of the event hub. If none is specified, the default event hub will be selected. @@ -1826,7 +1828,8 @@ type DiagnosticSettingsCategory struct { // DiagnosticSettingsCategoryResource the diagnostic settings category resource. type DiagnosticSettingsCategoryResource struct { - autorest.Response `json:"-"` + autorest.Response `json:"-"` + // DiagnosticSettingsCategory - The properties of a Diagnostic Settings Category. *DiagnosticSettingsCategory `json:"properties,omitempty"` // ID - Azure resource Id ID *string `json:"id,omitempty"` @@ -1914,7 +1917,8 @@ type DiagnosticSettingsCategoryResourceCollection struct { // DiagnosticSettingsResource the diagnostic setting resource. type DiagnosticSettingsResource struct { - autorest.Response `json:"-"` + autorest.Response `json:"-"` + // DiagnosticSettings - Properties of a Diagnostic Settings Resource. *DiagnosticSettings `json:"properties,omitempty"` // ID - Azure resource Id ID *string `json:"id,omitempty"` @@ -2044,6 +2048,7 @@ type EventCategoryCollection struct { // EventData the Azure event log entries are of type EventData type EventData struct { + // Authorization - The sender authorization information. Authorization *SenderAuthorization `json:"authorization,omitempty"` // Claims - key value pairs to identify ARM permissions. Claims map[string]*string `json:"claims"` @@ -2443,6 +2448,18 @@ type LogicAppReceiver struct { CallbackURL *string `json:"callbackUrl,omitempty"` } +// LogMetricTrigger a log metrics trigger descriptor. +type LogMetricTrigger struct { + // ThresholdOperator - Evaluation operation for Metric -'GreaterThan' or 'LessThan' or 'Equal'. Possible values include: 'ConditionalOperatorGreaterThan', 'ConditionalOperatorLessThan', 'ConditionalOperatorEqual' + ThresholdOperator ConditionalOperator `json:"thresholdOperator,omitempty"` + // Threshold - The threshold of the metric trigger. + Threshold *float64 `json:"threshold,omitempty"` + // MetricTriggerType - Metric Trigger Type - 'Consecutive' or 'Total'. Possible values include: 'MetricTriggerTypeConsecutive', 'MetricTriggerTypeTotal' + MetricTriggerType MetricTriggerType `json:"metricTriggerType,omitempty"` + // MetricColumn - Evaluation of metric on a particular column + MetricColumn *string `json:"metricColumn,omitempty"` +} + // LogProfileCollection represents a collection of log profiles. type LogProfileCollection struct { autorest.Response `json:"-"` @@ -2722,6 +2739,12 @@ func (lsr *LogSearchRule) UnmarshalJSON(body []byte) error { return nil } +// LogSearchRulePatch log Search Rule Definition for Patching +type LogSearchRulePatch struct { + // Enabled - The flag which indicates whether the Log Search rule is enabled. Value should be true or false. Possible values include: 'True', 'False' + Enabled Enabled `json:"enabled,omitempty"` +} + // LogSearchRuleResource the Log Search Rule resource. type LogSearchRuleResource struct { autorest.Response `json:"-"` @@ -2839,6 +2862,59 @@ type LogSearchRuleResourceCollection struct { Value *[]LogSearchRuleResource `json:"value,omitempty"` } +// LogSearchRuleResourcePatch the log search rule resource for patch operations. +type LogSearchRuleResourcePatch struct { + // Tags - Resource tags + Tags map[string]*string `json:"tags"` + // LogSearchRulePatch - The log search rule properties of the resource. + *LogSearchRulePatch `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for LogSearchRuleResourcePatch. +func (lsrrp LogSearchRuleResourcePatch) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if lsrrp.Tags != nil { + objectMap["tags"] = lsrrp.Tags + } + if lsrrp.LogSearchRulePatch != nil { + objectMap["properties"] = lsrrp.LogSearchRulePatch + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for LogSearchRuleResourcePatch struct. +func (lsrrp *LogSearchRuleResourcePatch) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + lsrrp.Tags = tags + } + case "properties": + if v != nil { + var logSearchRulePatch LogSearchRulePatch + err = json.Unmarshal(*v, &logSearchRulePatch) + if err != nil { + return err + } + lsrrp.LogSearchRulePatch = &logSearchRulePatch + } + } + } + + return nil +} + // LogSettings part of MultiTenantDiagnosticSettings. Specifies the settings for a particular log. type LogSettings struct { // Category - Name of a Diagnostic Log category for a resource type this setting is applied to. To obtain the list of Diagnostic Log categories for a resource, first perform a GET diagnostic settings operation. @@ -2974,7 +3050,8 @@ type Metric struct { // MetricAlertAction an alert action. type MetricAlertAction struct { // ActionGroupID - the id of the action group to use. - ActionGroupID *string `json:"actionGroupId,omitempty"` + ActionGroupID *string `json:"actionGroupId,omitempty"` + // WebhookProperties - The properties of a webhook object. WebhookProperties map[string]*string `json:"webhookProperties"` } @@ -3430,6 +3507,7 @@ type MetricAlertStatusCollection struct { // MetricAlertStatusProperties an alert status properties. type MetricAlertStatusProperties struct { + // Dimensions - An object describing the type of the dimensions. Dimensions map[string]*string `json:"dimensions"` // Status - status value Status *string `json:"status,omitempty"` @@ -3461,7 +3539,7 @@ type MetricAvailability struct { Retention *string `json:"retention,omitempty"` } -// MetricCriteria ... +// MetricCriteria criterion to filter metrics. type MetricCriteria struct { // Name - Name of the criteria. Name *string `json:"name,omitempty"` @@ -3510,7 +3588,7 @@ type MetricDefinitionCollection struct { Value *[]MetricDefinition `json:"value,omitempty"` } -// MetricDimension ... +// MetricDimension specifies a metric dimension. type MetricDimension struct { // Name - Name of the dimension. Name *string `json:"name,omitempty"` @@ -3550,12 +3628,6 @@ type MetricTrigger struct { Operator ComparisonOperationType `json:"operator,omitempty"` // Threshold - the threshold of the metric that triggers the scale action. Threshold *float64 `json:"threshold,omitempty"` - // ThresholdOperator - Evaluation operation for Metric -'GreaterThan' or 'LessThan' or 'Equal'. Possible values include: 'ConditionalOperatorGreaterThan', 'ConditionalOperatorLessThan', 'ConditionalOperatorEqual' - ThresholdOperator ConditionalOperator `json:"thresholdOperator,omitempty"` - // MetricTriggerType - Metric Trigger Type - 'Consecutive' or 'Total'. Possible values include: 'MetricTriggerTypeConsecutive', 'MetricTriggerTypeTotal' - MetricTriggerType MetricTriggerType `json:"metricTriggerType,omitempty"` - // MetricColumn - Evaluation of metric on a particular column - MetricColumn *string `json:"metricColumn,omitempty"` } // MetricValue represents a metric value. @@ -4300,7 +4372,7 @@ type Source struct { AuthorizedResources *[]string `json:"authorizedResources,omitempty"` // DataSourceID - The resource uri over which log search query is to be run. DataSourceID *string `json:"dataSourceId,omitempty"` - // QueryType - Set value to ResultCount if query should be returning search result count. Set it to Number if its a metric query. Possible values include: 'ResultCount' + // QueryType - Set value to 'ResultCount'. Possible values include: 'ResultCount' QueryType QueryType `json:"queryType,omitempty"` } @@ -4471,7 +4543,7 @@ type TriggerCondition struct { // Threshold - Result or count threshold based on which rule should be triggered. Threshold *float64 `json:"threshold,omitempty"` // MetricTrigger - Trigger condition for metric query rule - MetricTrigger *MetricTrigger `json:"metricTrigger,omitempty"` + MetricTrigger *LogMetricTrigger `json:"metricTrigger,omitempty"` } // VoiceReceiver a voice receiver. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2018-03-01/insights/scheduledqueryrules.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2018-03-01/insights/scheduledqueryrules.go index 99d77ba3b..d8cc76492 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2018-03-01/insights/scheduledqueryrules.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2018-03-01/insights/scheduledqueryrules.go @@ -396,3 +396,73 @@ func (client ScheduledQueryRulesClient) ListBySubscriptionResponder(resp *http.R result.Response = autorest.Response{Response: resp} return } + +// Update update log search Rule. +// Parameters: +// resourceGroupName - the name of the resource group. +// ruleName - the name of the rule. +// parameters - the parameters of the rule to update. +func (client ScheduledQueryRulesClient) Update(ctx context.Context, resourceGroupName string, ruleName string, parameters LogSearchRuleResourcePatch) (result LogSearchRuleResource, err error) { + req, err := client.UpdatePreparer(ctx, resourceGroupName, ruleName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "insights.ScheduledQueryRulesClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "insights.ScheduledQueryRulesClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "insights.ScheduledQueryRulesClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client ScheduledQueryRulesClient) UpdatePreparer(ctx context.Context, resourceGroupName string, ruleName string, parameters LogSearchRuleResourcePatch) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "ruleName": autorest.Encode("path", ruleName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-04-16" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights/scheduledQueryRules/{ruleName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client ScheduledQueryRulesClient) UpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client ScheduledQueryRulesClient) UpdateResponder(resp *http.Response) (result LogSearchRuleResource, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/operationalinsights/mgmt/2015-11-01-preview/operationalinsights/workspaces.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/operationalinsights/mgmt/2015-11-01-preview/operationalinsights/workspaces.go index f047c6afc..9883b790e 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/operationalinsights/mgmt/2015-11-01-preview/operationalinsights/workspaces.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/operationalinsights/mgmt/2015-11-01-preview/operationalinsights/workspaces.go @@ -54,7 +54,7 @@ func (client WorkspacesClient) CreateOrUpdate(ctx context.Context, resourceGroup {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.WorkspaceProperties", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "parameters.WorkspaceProperties.RetentionInDays", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.WorkspaceProperties.RetentionInDays", Name: validation.InclusiveMaximum, Rule: 730, Chain: nil}, + Chain: []validation.Constraint{{Target: "parameters.WorkspaceProperties.RetentionInDays", Name: validation.InclusiveMaximum, Rule: int64(730), Chain: nil}, {Target: "parameters.WorkspaceProperties.RetentionInDays", Name: validation.InclusiveMinimum, Rule: -1, Chain: nil}, }}, }}}}}); err != nil { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/operationalinsights/mgmt/2015-11-01-preview/servicemap/clientgroups.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/operationalinsights/mgmt/2015-11-01-preview/servicemap/clientgroups.go index 9a529c048..5dea91516 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/operationalinsights/mgmt/2015-11-01-preview/servicemap/clientgroups.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/operationalinsights/mgmt/2015-11-01-preview/servicemap/clientgroups.go @@ -254,7 +254,7 @@ func (client ClientGroupsClient) ListMembers(ctx context.Context, resourceGroupN {Target: "clientGroupName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, {TargetValue: top, Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: 200, Chain: nil}, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: int64(200), Chain: nil}, {Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicemap.ClientGroupsClient", "ListMembers", err.Error()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/operationalinsights/mgmt/2015-11-01-preview/servicemap/machines.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/operationalinsights/mgmt/2015-11-01-preview/servicemap/machines.go index 8e831d3f5..67d5db78a 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/operationalinsights/mgmt/2015-11-01-preview/servicemap/machines.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/operationalinsights/mgmt/2015-11-01-preview/servicemap/machines.go @@ -255,7 +255,7 @@ func (client MachinesClient) ListByWorkspace(ctx context.Context, resourceGroupN {Target: "workspaceName", Name: validation.Pattern, Rule: `[a-zA-Z0-9_][a-zA-Z0-9_-]+[a-zA-Z0-9_]`, Chain: nil}}}, {TargetValue: top, Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: 200, Chain: nil}, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: int64(200), Chain: nil}, {Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicemap.MachinesClient", "ListByWorkspace", err.Error()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/operationsmanagement/mgmt/2015-11-01-preview/operationsmanagement/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/operationsmanagement/mgmt/2015-11-01-preview/operationsmanagement/models.go index 34fc539c9..c97eaef96 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/operationsmanagement/mgmt/2015-11-01-preview/operationsmanagement/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/operationsmanagement/mgmt/2015-11-01-preview/operationsmanagement/models.go @@ -19,6 +19,8 @@ package operationsmanagement import ( "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "net/http" ) // ArmTemplateParameter parameter to pass to ARM template @@ -181,3 +183,54 @@ type SolutionPropertiesList struct { // Value - List of solution properites within the subscription. Value *[]Solution `json:"value,omitempty"` } + +// SolutionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type SolutionsCreateOrUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *SolutionsCreateOrUpdateFuture) Result(client SolutionsClient) (s Solution, err error) { + var done bool + done, err = future.Done(client) + if err != nil { + err = autorest.NewErrorWithError(err, "operationsmanagement.SolutionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("operationsmanagement.SolutionsCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if s.Response.Response, err = future.GetResult(sender); err == nil && s.Response.Response.StatusCode != http.StatusNoContent { + s, err = client.CreateOrUpdateResponder(s.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "operationsmanagement.SolutionsCreateOrUpdateFuture", "Result", s.Response.Response, "Failure responding to request") + } + } + return +} + +// SolutionsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. +type SolutionsDeleteFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *SolutionsDeleteFuture) Result(client SolutionsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.Done(client) + if err != nil { + err = autorest.NewErrorWithError(err, "operationsmanagement.SolutionsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("operationsmanagement.SolutionsDeleteFuture") + return + } + ar.Response = future.Response() + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/operationsmanagement/mgmt/2015-11-01-preview/operationsmanagement/solutions.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/operationsmanagement/mgmt/2015-11-01-preview/operationsmanagement/solutions.go index 91c0b6a4c..5f62153c6 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/operationsmanagement/mgmt/2015-11-01-preview/operationsmanagement/solutions.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/operationsmanagement/mgmt/2015-11-01-preview/operationsmanagement/solutions.go @@ -45,7 +45,7 @@ func NewSolutionsClientWithBaseURI(baseURI string, subscriptionID string, provid // resourceGroupName - the name of the resource group to get. The name is case insensitive. // solutionName - user Solution Name. // parameters - the parameters required to create OMS Solution. -func (client SolutionsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, solutionName string, parameters Solution) (result Solution, err error) { +func (client SolutionsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, solutionName string, parameters Solution) (result SolutionsCreateOrUpdateFuture, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, @@ -63,18 +63,12 @@ func (client SolutionsClient) CreateOrUpdate(ctx context.Context, resourceGroupN return } - resp, err := client.CreateOrUpdateSender(req) + result, err = client.CreateOrUpdateSender(req) if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "operationsmanagement.SolutionsClient", "CreateOrUpdate", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "operationsmanagement.SolutionsClient", "CreateOrUpdate", result.Response(), "Failure sending request") return } - result, err = client.CreateOrUpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "operationsmanagement.SolutionsClient", "CreateOrUpdate", resp, "Failure responding to request") - } - return } @@ -103,9 +97,19 @@ func (client SolutionsClient) CreateOrUpdatePreparer(ctx context.Context, resour // CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the // http.Response Body if it receives an error. -func (client SolutionsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, +func (client SolutionsClient) CreateOrUpdateSender(req *http.Request) (future SolutionsCreateOrUpdateFuture, err error) { + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return } // CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always @@ -114,7 +118,7 @@ func (client SolutionsClient) CreateOrUpdateResponder(resp *http.Response) (resu err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} @@ -125,7 +129,7 @@ func (client SolutionsClient) CreateOrUpdateResponder(resp *http.Response) (resu // Parameters: // resourceGroupName - the name of the resource group to get. The name is case insensitive. // solutionName - user Solution Name. -func (client SolutionsClient) Delete(ctx context.Context, resourceGroupName string, solutionName string) (result autorest.Response, err error) { +func (client SolutionsClient) Delete(ctx context.Context, resourceGroupName string, solutionName string) (result SolutionsDeleteFuture, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, @@ -140,18 +144,12 @@ func (client SolutionsClient) Delete(ctx context.Context, resourceGroupName stri return } - resp, err := client.DeleteSender(req) + result, err = client.DeleteSender(req) if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "operationsmanagement.SolutionsClient", "Delete", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "operationsmanagement.SolutionsClient", "Delete", result.Response(), "Failure sending request") return } - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "operationsmanagement.SolutionsClient", "Delete", resp, "Failure responding to request") - } - return } @@ -178,9 +176,19 @@ func (client SolutionsClient) DeletePreparer(ctx context.Context, resourceGroupN // DeleteSender sends the Delete request. The method will close the // http.Response Body if it receives an error. -func (client SolutionsClient) DeleteSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, +func (client SolutionsClient) DeleteSender(req *http.Request) (future SolutionsDeleteFuture, err error) { + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return } // DeleteResponder handles the response to the Delete request. The method always diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/signalr/mgmt/2018-03-01-preview/signalr/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/signalr/mgmt/2018-03-01-preview/signalr/models.go index e99f82d47..ac395bbf0 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/signalr/mgmt/2018-03-01-preview/signalr/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/signalr/mgmt/2018-03-01-preview/signalr/models.go @@ -79,11 +79,13 @@ const ( Free SkuTier = "Free" // Premium ... Premium SkuTier = "Premium" + // Standard ... + Standard SkuTier = "Standard" ) // PossibleSkuTierValues returns an array of possible values for the SkuTier const type. func PossibleSkuTierValues() []SkuTier { - return []SkuTier{Basic, Free, Premium} + return []SkuTier{Basic, Free, Premium, Standard} } // CreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation. @@ -527,7 +529,7 @@ func (page ResourceListPage) Values() []ResourceType { type ResourceSku struct { // Name - The name of the SKU. This is typically a letter + number code, such as A0 or P3. Required (if sku is specified) Name *string `json:"name,omitempty"` - // Tier - The tier of this particular SKU. Optional. Possible values include: 'Free', 'Basic', 'Premium' + // Tier - Optional tier of this particular SKU. `Basic` is deprecated, use `Standard` instead for Basic tier. Possible values include: 'Free', 'Basic', 'Standard', 'Premium' Tier SkuTier `json:"tier,omitempty"` // Size - Optional, string. When the name field is the combination of tier and some other value, this would be the standalone code. Size *string `json:"size,omitempty"` diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2015-05-01-preview/sql/databaseblobauditingpolicies.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2015-05-01-preview/sql/databaseblobauditingpolicies.go index 1b9d2fae1..0633f3963 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2015-05-01-preview/sql/databaseblobauditingpolicies.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2015-05-01-preview/sql/databaseblobauditingpolicies.go @@ -47,7 +47,7 @@ func NewDatabaseBlobAuditingPoliciesClientWithBaseURI(baseURI string, subscripti // resourceGroupName - the name of the resource group that contains the resource. You can obtain this value // from the Azure Resource Manager API or the portal. // serverName - the name of the server. -// databaseName - the name of the database for which the blob auditing policy will be defined. +// databaseName - the name of the database. // parameters - the database blob auditing policy. func (client DatabaseBlobAuditingPoliciesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters DatabaseBlobAuditingPolicy) (result DatabaseBlobAuditingPolicy, err error) { req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serverName, databaseName, parameters) @@ -121,7 +121,7 @@ func (client DatabaseBlobAuditingPoliciesClient) CreateOrUpdateResponder(resp *h // resourceGroupName - the name of the resource group that contains the resource. You can obtain this value // from the Azure Resource Manager API or the portal. // serverName - the name of the server. -// databaseName - the name of the database for which the blob audit policy is defined. +// databaseName - the name of the database. func (client DatabaseBlobAuditingPoliciesClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result DatabaseBlobAuditingPolicy, err error) { req, err := client.GetPreparer(ctx, resourceGroupName, serverName, databaseName) if err != nil { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2015-05-01-preview/sql/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2015-05-01-preview/sql/models.go index 428ca0a93..a0ab829d4 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2015-05-01-preview/sql/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2015-05-01-preview/sql/models.go @@ -1561,11 +1561,67 @@ type DatabaseBlobAuditingPolicyProperties struct { StorageAccountAccessKey *string `json:"storageAccountAccessKey,omitempty"` // RetentionDays - Specifies the number of days to keep in the audit logs. RetentionDays *int32 `json:"retentionDays,omitempty"` - // AuditActionsAndGroups - Specifies the Actions and Actions-Groups to audit. + // AuditActionsAndGroups - Specifies the Actions-Groups and Actions to audit. + // + // The recommended set of action groups to use is the following combination - this will audit all the queries and stored procedures executed against the database, as well as successful and failed logins: + // + // BATCH_COMPLETED_GROUP, + // SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP, + // FAILED_DATABASE_AUTHENTICATION_GROUP. + // + // This above combination is also the set that is configured by default when enabling auditing from the Azure portal. + // + // The supported action groups to audit are (note: choose only specific groups that cover your auditing needs. Using unnecessary groups could lead to very large quantities of audit records): + // + // APPLICATION_ROLE_CHANGE_PASSWORD_GROUP + // BACKUP_RESTORE_GROUP + // DATABASE_LOGOUT_GROUP + // DATABASE_OBJECT_CHANGE_GROUP + // DATABASE_OBJECT_OWNERSHIP_CHANGE_GROUP + // DATABASE_OBJECT_PERMISSION_CHANGE_GROUP + // DATABASE_OPERATION_GROUP + // DATABASE_PERMISSION_CHANGE_GROUP + // DATABASE_PRINCIPAL_CHANGE_GROUP + // DATABASE_PRINCIPAL_IMPERSONATION_GROUP + // DATABASE_ROLE_MEMBER_CHANGE_GROUP + // FAILED_DATABASE_AUTHENTICATION_GROUP + // SCHEMA_OBJECT_ACCESS_GROUP + // SCHEMA_OBJECT_CHANGE_GROUP + // SCHEMA_OBJECT_OWNERSHIP_CHANGE_GROUP + // SCHEMA_OBJECT_PERMISSION_CHANGE_GROUP + // SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP + // USER_CHANGE_PASSWORD_GROUP + // BATCH_STARTED_GROUP + // BATCH_COMPLETED_GROUP + // + // These are groups that cover all sql statements and stored procedures executed against the database, and should not be used in combination with other groups as this will result in duplicate audit logs. + // + // For more information, see [Database-Level Audit Action Groups](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-action-groups). + // + // For Database auditing policy, specific Actions can also be specified (note that Actions cannot be specified for Server auditing policy). The supported actions to audit are: + // SELECT + // UPDATE + // INSERT + // DELETE + // EXECUTE + // RECEIVE + // REFERENCES + // + // The general form for defining an action to be audited is: + // ON BY + // + // Note that in the above format can refer to an object like a table, view, or stored procedure, or an entire database or schema. For the latter cases, the forms DATABASE:: and SCHEMA:: are used, respectively. + // + // For example: + // SELECT on dbo.myTable by public + // SELECT on DATABASE::myDatabase by public + // SELECT on SCHEMA::mySchema by public + // + // For more information, see [Database-Level Audit Actions](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-actions) AuditActionsAndGroups *[]string `json:"auditActionsAndGroups,omitempty"` // StorageAccountSubscriptionID - Specifies the blob storage subscription Id. StorageAccountSubscriptionID *uuid.UUID `json:"storageAccountSubscriptionId,omitempty"` - // IsStorageSecondaryKeyInUse - Specifies whether storageAccountAccessKey value is the storage’s secondary key. + // IsStorageSecondaryKeyInUse - Specifies whether storageAccountAccessKey value is the storage's secondary key. IsStorageSecondaryKeyInUse *bool `json:"isStorageSecondaryKeyInUse,omitempty"` } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2017-03-01-preview/sql/databaseblobauditingpolicies.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2017-03-01-preview/sql/databaseblobauditingpolicies.go index 1b9d2fae1..28db05c6c 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2017-03-01-preview/sql/databaseblobauditingpolicies.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2017-03-01-preview/sql/databaseblobauditingpolicies.go @@ -47,7 +47,7 @@ func NewDatabaseBlobAuditingPoliciesClientWithBaseURI(baseURI string, subscripti // resourceGroupName - the name of the resource group that contains the resource. You can obtain this value // from the Azure Resource Manager API or the portal. // serverName - the name of the server. -// databaseName - the name of the database for which the blob auditing policy will be defined. +// databaseName - the name of the database. // parameters - the database blob auditing policy. func (client DatabaseBlobAuditingPoliciesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters DatabaseBlobAuditingPolicy) (result DatabaseBlobAuditingPolicy, err error) { req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serverName, databaseName, parameters) @@ -81,7 +81,7 @@ func (client DatabaseBlobAuditingPoliciesClient) CreateOrUpdatePreparer(ctx cont "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2015-05-01-preview" + const APIVersion = "2017-03-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -121,7 +121,7 @@ func (client DatabaseBlobAuditingPoliciesClient) CreateOrUpdateResponder(resp *h // resourceGroupName - the name of the resource group that contains the resource. You can obtain this value // from the Azure Resource Manager API or the portal. // serverName - the name of the server. -// databaseName - the name of the database for which the blob audit policy is defined. +// databaseName - the name of the database. func (client DatabaseBlobAuditingPoliciesClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result DatabaseBlobAuditingPolicy, err error) { req, err := client.GetPreparer(ctx, resourceGroupName, serverName, databaseName) if err != nil { @@ -154,7 +154,7 @@ func (client DatabaseBlobAuditingPoliciesClient) GetPreparer(ctx context.Context "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2015-05-01-preview" + const APIVersion = "2017-03-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2017-03-01-preview/sql/extendeddatabaseblobauditingpolicies.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2017-03-01-preview/sql/extendeddatabaseblobauditingpolicies.go new file mode 100644 index 000000000..24bffc2a5 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2017-03-01-preview/sql/extendeddatabaseblobauditingpolicies.go @@ -0,0 +1,189 @@ +package sql + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "net/http" +) + +// ExtendedDatabaseBlobAuditingPoliciesClient is the the Azure SQL Database management API provides a RESTful set of +// web services that interact with Azure SQL Database services to manage your databases. The API enables you to create, +// retrieve, update, and delete databases. +type ExtendedDatabaseBlobAuditingPoliciesClient struct { + BaseClient +} + +// NewExtendedDatabaseBlobAuditingPoliciesClient creates an instance of the ExtendedDatabaseBlobAuditingPoliciesClient +// client. +func NewExtendedDatabaseBlobAuditingPoliciesClient(subscriptionID string) ExtendedDatabaseBlobAuditingPoliciesClient { + return NewExtendedDatabaseBlobAuditingPoliciesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewExtendedDatabaseBlobAuditingPoliciesClientWithBaseURI creates an instance of the +// ExtendedDatabaseBlobAuditingPoliciesClient client. +func NewExtendedDatabaseBlobAuditingPoliciesClientWithBaseURI(baseURI string, subscriptionID string) ExtendedDatabaseBlobAuditingPoliciesClient { + return ExtendedDatabaseBlobAuditingPoliciesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or updates an extended database's blob auditing policy. +// Parameters: +// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value +// from the Azure Resource Manager API or the portal. +// serverName - the name of the server. +// databaseName - the name of the database. +// parameters - the extended database blob auditing policy. +func (client ExtendedDatabaseBlobAuditingPoliciesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters ExtendedDatabaseBlobAuditingPolicy) (result ExtendedDatabaseBlobAuditingPolicy, err error) { + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serverName, databaseName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.ExtendedDatabaseBlobAuditingPoliciesClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "sql.ExtendedDatabaseBlobAuditingPoliciesClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.ExtendedDatabaseBlobAuditingPoliciesClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client ExtendedDatabaseBlobAuditingPoliciesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters ExtendedDatabaseBlobAuditingPolicy) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "blobAuditingPolicyName": autorest.Encode("path", "default"), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serverName": autorest.Encode("path", serverName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-03-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/extendedAuditingSettings/{blobAuditingPolicyName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client ExtendedDatabaseBlobAuditingPoliciesClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client ExtendedDatabaseBlobAuditingPoliciesClient) CreateOrUpdateResponder(resp *http.Response) (result ExtendedDatabaseBlobAuditingPolicy, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get gets an extended database's blob auditing policy. +// Parameters: +// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value +// from the Azure Resource Manager API or the portal. +// serverName - the name of the server. +// databaseName - the name of the database. +func (client ExtendedDatabaseBlobAuditingPoliciesClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result ExtendedDatabaseBlobAuditingPolicy, err error) { + req, err := client.GetPreparer(ctx, resourceGroupName, serverName, databaseName) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.ExtendedDatabaseBlobAuditingPoliciesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "sql.ExtendedDatabaseBlobAuditingPoliciesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.ExtendedDatabaseBlobAuditingPoliciesClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client ExtendedDatabaseBlobAuditingPoliciesClient) GetPreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "blobAuditingPolicyName": autorest.Encode("path", "default"), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serverName": autorest.Encode("path", serverName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-03-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/extendedAuditingSettings/{blobAuditingPolicyName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ExtendedDatabaseBlobAuditingPoliciesClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ExtendedDatabaseBlobAuditingPoliciesClient) GetResponder(resp *http.Response) (result ExtendedDatabaseBlobAuditingPolicy, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2017-03-01-preview/sql/extendedserverblobauditingpolicies.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2017-03-01-preview/sql/extendedserverblobauditingpolicies.go new file mode 100644 index 000000000..7e66d7929 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2017-03-01-preview/sql/extendedserverblobauditingpolicies.go @@ -0,0 +1,189 @@ +package sql + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "net/http" +) + +// ExtendedServerBlobAuditingPoliciesClient is the the Azure SQL Database management API provides a RESTful set of web +// services that interact with Azure SQL Database services to manage your databases. The API enables you to create, +// retrieve, update, and delete databases. +type ExtendedServerBlobAuditingPoliciesClient struct { + BaseClient +} + +// NewExtendedServerBlobAuditingPoliciesClient creates an instance of the ExtendedServerBlobAuditingPoliciesClient +// client. +func NewExtendedServerBlobAuditingPoliciesClient(subscriptionID string) ExtendedServerBlobAuditingPoliciesClient { + return NewExtendedServerBlobAuditingPoliciesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewExtendedServerBlobAuditingPoliciesClientWithBaseURI creates an instance of the +// ExtendedServerBlobAuditingPoliciesClient client. +func NewExtendedServerBlobAuditingPoliciesClientWithBaseURI(baseURI string, subscriptionID string) ExtendedServerBlobAuditingPoliciesClient { + return ExtendedServerBlobAuditingPoliciesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or updates an extended server's blob auditing policy. +// Parameters: +// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value +// from the Azure Resource Manager API or the portal. +// serverName - the name of the server. +// parameters - properties of extended blob auditing policy +func (client ExtendedServerBlobAuditingPoliciesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, parameters ExtendedServerBlobAuditingPolicy) (result ExtendedServerBlobAuditingPoliciesCreateOrUpdateFuture, err error) { + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serverName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.ExtendedServerBlobAuditingPoliciesClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.ExtendedServerBlobAuditingPoliciesClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client ExtendedServerBlobAuditingPoliciesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serverName string, parameters ExtendedServerBlobAuditingPolicy) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "blobAuditingPolicyName": autorest.Encode("path", "default"), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serverName": autorest.Encode("path", serverName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-03-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/extendedAuditingSettings/{blobAuditingPolicyName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client ExtendedServerBlobAuditingPoliciesClient) CreateOrUpdateSender(req *http.Request) (future ExtendedServerBlobAuditingPoliciesCreateOrUpdateFuture, err error) { + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client ExtendedServerBlobAuditingPoliciesClient) CreateOrUpdateResponder(resp *http.Response) (result ExtendedServerBlobAuditingPolicy, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get gets an extended server's blob auditing policy. +// Parameters: +// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value +// from the Azure Resource Manager API or the portal. +// serverName - the name of the server. +func (client ExtendedServerBlobAuditingPoliciesClient) Get(ctx context.Context, resourceGroupName string, serverName string) (result ExtendedServerBlobAuditingPolicy, err error) { + req, err := client.GetPreparer(ctx, resourceGroupName, serverName) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.ExtendedServerBlobAuditingPoliciesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "sql.ExtendedServerBlobAuditingPoliciesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.ExtendedServerBlobAuditingPoliciesClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client ExtendedServerBlobAuditingPoliciesClient) GetPreparer(ctx context.Context, resourceGroupName string, serverName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "blobAuditingPolicyName": autorest.Encode("path", "default"), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serverName": autorest.Encode("path", serverName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-03-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/extendedAuditingSettings/{blobAuditingPolicyName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ExtendedServerBlobAuditingPoliciesClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ExtendedServerBlobAuditingPoliciesClient) GetResponder(resp *http.Response) (result ExtendedServerBlobAuditingPolicy, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2017-03-01-preview/sql/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2017-03-01-preview/sql/models.go index 72c25cf06..c6c1de3b7 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2017-03-01-preview/sql/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2017-03-01-preview/sql/models.go @@ -944,6 +944,21 @@ func PossibleSecurityAlertPolicyUseServerDefaultValues() []SecurityAlertPolicyUs return []SecurityAlertPolicyUseServerDefault{SecurityAlertPolicyUseServerDefaultDisabled, SecurityAlertPolicyUseServerDefaultEnabled} } +// SecurityAlertState enumerates the values for security alert state. +type SecurityAlertState string + +const ( + // SecurityAlertStateDisabled ... + SecurityAlertStateDisabled SecurityAlertState = "Disabled" + // SecurityAlertStateEnabled ... + SecurityAlertStateEnabled SecurityAlertState = "Enabled" +) + +// PossibleSecurityAlertStateValues returns an array of possible values for the SecurityAlertState const type. +func PossibleSecurityAlertStateValues() []SecurityAlertState { + return []SecurityAlertState{SecurityAlertStateDisabled, SecurityAlertStateEnabled} +} + // ServerConnectionType enumerates the values for server connection type. type ServerConnectionType string @@ -2096,11 +2111,67 @@ type DatabaseBlobAuditingPolicyProperties struct { StorageAccountAccessKey *string `json:"storageAccountAccessKey,omitempty"` // RetentionDays - Specifies the number of days to keep in the audit logs. RetentionDays *int32 `json:"retentionDays,omitempty"` - // AuditActionsAndGroups - Specifies the Actions and Actions-Groups to audit. + // AuditActionsAndGroups - Specifies the Actions-Groups and Actions to audit. + // + // The recommended set of action groups to use is the following combination - this will audit all the queries and stored procedures executed against the database, as well as successful and failed logins: + // + // BATCH_COMPLETED_GROUP, + // SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP, + // FAILED_DATABASE_AUTHENTICATION_GROUP. + // + // This above combination is also the set that is configured by default when enabling auditing from the Azure portal. + // + // The supported action groups to audit are (note: choose only specific groups that cover your auditing needs. Using unnecessary groups could lead to very large quantities of audit records): + // + // APPLICATION_ROLE_CHANGE_PASSWORD_GROUP + // BACKUP_RESTORE_GROUP + // DATABASE_LOGOUT_GROUP + // DATABASE_OBJECT_CHANGE_GROUP + // DATABASE_OBJECT_OWNERSHIP_CHANGE_GROUP + // DATABASE_OBJECT_PERMISSION_CHANGE_GROUP + // DATABASE_OPERATION_GROUP + // DATABASE_PERMISSION_CHANGE_GROUP + // DATABASE_PRINCIPAL_CHANGE_GROUP + // DATABASE_PRINCIPAL_IMPERSONATION_GROUP + // DATABASE_ROLE_MEMBER_CHANGE_GROUP + // FAILED_DATABASE_AUTHENTICATION_GROUP + // SCHEMA_OBJECT_ACCESS_GROUP + // SCHEMA_OBJECT_CHANGE_GROUP + // SCHEMA_OBJECT_OWNERSHIP_CHANGE_GROUP + // SCHEMA_OBJECT_PERMISSION_CHANGE_GROUP + // SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP + // USER_CHANGE_PASSWORD_GROUP + // BATCH_STARTED_GROUP + // BATCH_COMPLETED_GROUP + // + // These are groups that cover all sql statements and stored procedures executed against the database, and should not be used in combination with other groups as this will result in duplicate audit logs. + // + // For more information, see [Database-Level Audit Action Groups](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-action-groups). + // + // For Database auditing policy, specific Actions can also be specified (note that Actions cannot be specified for Server auditing policy). The supported actions to audit are: + // SELECT + // UPDATE + // INSERT + // DELETE + // EXECUTE + // RECEIVE + // REFERENCES + // + // The general form for defining an action to be audited is: + // ON BY + // + // Note that in the above format can refer to an object like a table, view, or stored procedure, or an entire database or schema. For the latter cases, the forms DATABASE:: and SCHEMA:: are used, respectively. + // + // For example: + // SELECT on dbo.myTable by public + // SELECT on DATABASE::myDatabase by public + // SELECT on SCHEMA::mySchema by public + // + // For more information, see [Database-Level Audit Actions](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-actions) AuditActionsAndGroups *[]string `json:"auditActionsAndGroups,omitempty"` // StorageAccountSubscriptionID - Specifies the blob storage subscription Id. StorageAccountSubscriptionID *uuid.UUID `json:"storageAccountSubscriptionId,omitempty"` - // IsStorageSecondaryKeyInUse - Specifies whether storageAccountAccessKey value is the storage’s secondary key. + // IsStorageSecondaryKeyInUse - Specifies whether storageAccountAccessKey value is the storage's secondary key. IsStorageSecondaryKeyInUse *bool `json:"isStorageSecondaryKeyInUse,omitempty"` } @@ -4287,6 +4358,351 @@ type ExportRequest struct { AuthenticationType AuthenticationType `json:"authenticationType,omitempty"` } +// ExtendedDatabaseBlobAuditingPolicy an extended database blob auditing policy. +type ExtendedDatabaseBlobAuditingPolicy struct { + autorest.Response `json:"-"` + // ExtendedDatabaseBlobAuditingPolicyProperties - Resource properties. + *ExtendedDatabaseBlobAuditingPolicyProperties `json:"properties,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` + // Name - Resource name. + Name *string `json:"name,omitempty"` + // Type - Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ExtendedDatabaseBlobAuditingPolicy. +func (edbap ExtendedDatabaseBlobAuditingPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if edbap.ExtendedDatabaseBlobAuditingPolicyProperties != nil { + objectMap["properties"] = edbap.ExtendedDatabaseBlobAuditingPolicyProperties + } + if edbap.ID != nil { + objectMap["id"] = edbap.ID + } + if edbap.Name != nil { + objectMap["name"] = edbap.Name + } + if edbap.Type != nil { + objectMap["type"] = edbap.Type + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ExtendedDatabaseBlobAuditingPolicy struct. +func (edbap *ExtendedDatabaseBlobAuditingPolicy) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var extendedDatabaseBlobAuditingPolicyProperties ExtendedDatabaseBlobAuditingPolicyProperties + err = json.Unmarshal(*v, &extendedDatabaseBlobAuditingPolicyProperties) + if err != nil { + return err + } + edbap.ExtendedDatabaseBlobAuditingPolicyProperties = &extendedDatabaseBlobAuditingPolicyProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + edbap.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + edbap.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + edbap.Type = &typeVar + } + } + } + + return nil +} + +// ExtendedDatabaseBlobAuditingPolicyProperties properties of an extended database blob auditing policy. +type ExtendedDatabaseBlobAuditingPolicyProperties struct { + // PredicateExpression - Specifies condition of where clause when creating an audit. + PredicateExpression *string `json:"predicateExpression,omitempty"` + // State - Specifies the state of the policy. If state is Enabled, storageEndpoint and storageAccountAccessKey are required. Possible values include: 'BlobAuditingPolicyStateEnabled', 'BlobAuditingPolicyStateDisabled' + State BlobAuditingPolicyState `json:"state,omitempty"` + // StorageEndpoint - Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). If state is Enabled, storageEndpoint is required. + StorageEndpoint *string `json:"storageEndpoint,omitempty"` + // StorageAccountAccessKey - Specifies the identifier key of the auditing storage account. If state is Enabled, storageAccountAccessKey is required. + StorageAccountAccessKey *string `json:"storageAccountAccessKey,omitempty"` + // RetentionDays - Specifies the number of days to keep in the audit logs. + RetentionDays *int32 `json:"retentionDays,omitempty"` + // AuditActionsAndGroups - Specifies the Actions-Groups and Actions to audit. + // + // The recommended set of action groups to use is the following combination - this will audit all the queries and stored procedures executed against the database, as well as successful and failed logins: + // + // BATCH_COMPLETED_GROUP, + // SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP, + // FAILED_DATABASE_AUTHENTICATION_GROUP. + // + // This above combination is also the set that is configured by default when enabling auditing from the Azure portal. + // + // The supported action groups to audit are (note: choose only specific groups that cover your auditing needs. Using unnecessary groups could lead to very large quantities of audit records): + // + // APPLICATION_ROLE_CHANGE_PASSWORD_GROUP + // BACKUP_RESTORE_GROUP + // DATABASE_LOGOUT_GROUP + // DATABASE_OBJECT_CHANGE_GROUP + // DATABASE_OBJECT_OWNERSHIP_CHANGE_GROUP + // DATABASE_OBJECT_PERMISSION_CHANGE_GROUP + // DATABASE_OPERATION_GROUP + // DATABASE_PERMISSION_CHANGE_GROUP + // DATABASE_PRINCIPAL_CHANGE_GROUP + // DATABASE_PRINCIPAL_IMPERSONATION_GROUP + // DATABASE_ROLE_MEMBER_CHANGE_GROUP + // FAILED_DATABASE_AUTHENTICATION_GROUP + // SCHEMA_OBJECT_ACCESS_GROUP + // SCHEMA_OBJECT_CHANGE_GROUP + // SCHEMA_OBJECT_OWNERSHIP_CHANGE_GROUP + // SCHEMA_OBJECT_PERMISSION_CHANGE_GROUP + // SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP + // USER_CHANGE_PASSWORD_GROUP + // BATCH_STARTED_GROUP + // BATCH_COMPLETED_GROUP + // + // These are groups that cover all sql statements and stored procedures executed against the database, and should not be used in combination with other groups as this will result in duplicate audit logs. + // + // For more information, see [Database-Level Audit Action Groups](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-action-groups). + // + // For Database auditing policy, specific Actions can also be specified (note that Actions cannot be specified for Server auditing policy). The supported actions to audit are: + // SELECT + // UPDATE + // INSERT + // DELETE + // EXECUTE + // RECEIVE + // REFERENCES + // + // The general form for defining an action to be audited is: + // ON BY + // + // Note that in the above format can refer to an object like a table, view, or stored procedure, or an entire database or schema. For the latter cases, the forms DATABASE:: and SCHEMA:: are used, respectively. + // + // For example: + // SELECT on dbo.myTable by public + // SELECT on DATABASE::myDatabase by public + // SELECT on SCHEMA::mySchema by public + // + // For more information, see [Database-Level Audit Actions](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-actions) + AuditActionsAndGroups *[]string `json:"auditActionsAndGroups,omitempty"` + // StorageAccountSubscriptionID - Specifies the blob storage subscription Id. + StorageAccountSubscriptionID *uuid.UUID `json:"storageAccountSubscriptionId,omitempty"` + // IsStorageSecondaryKeyInUse - Specifies whether storageAccountAccessKey value is the storage's secondary key. + IsStorageSecondaryKeyInUse *bool `json:"isStorageSecondaryKeyInUse,omitempty"` +} + +// ExtendedServerBlobAuditingPoliciesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type ExtendedServerBlobAuditingPoliciesCreateOrUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ExtendedServerBlobAuditingPoliciesCreateOrUpdateFuture) Result(client ExtendedServerBlobAuditingPoliciesClient) (esbap ExtendedServerBlobAuditingPolicy, err error) { + var done bool + done, err = future.Done(client) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.ExtendedServerBlobAuditingPoliciesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("sql.ExtendedServerBlobAuditingPoliciesCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if esbap.Response.Response, err = future.GetResult(sender); err == nil && esbap.Response.Response.StatusCode != http.StatusNoContent { + esbap, err = client.CreateOrUpdateResponder(esbap.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.ExtendedServerBlobAuditingPoliciesCreateOrUpdateFuture", "Result", esbap.Response.Response, "Failure responding to request") + } + } + return +} + +// ExtendedServerBlobAuditingPolicy an extended server blob auditing policy. +type ExtendedServerBlobAuditingPolicy struct { + autorest.Response `json:"-"` + // ExtendedServerBlobAuditingPolicyProperties - Resource properties. + *ExtendedServerBlobAuditingPolicyProperties `json:"properties,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` + // Name - Resource name. + Name *string `json:"name,omitempty"` + // Type - Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ExtendedServerBlobAuditingPolicy. +func (esbap ExtendedServerBlobAuditingPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if esbap.ExtendedServerBlobAuditingPolicyProperties != nil { + objectMap["properties"] = esbap.ExtendedServerBlobAuditingPolicyProperties + } + if esbap.ID != nil { + objectMap["id"] = esbap.ID + } + if esbap.Name != nil { + objectMap["name"] = esbap.Name + } + if esbap.Type != nil { + objectMap["type"] = esbap.Type + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ExtendedServerBlobAuditingPolicy struct. +func (esbap *ExtendedServerBlobAuditingPolicy) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var extendedServerBlobAuditingPolicyProperties ExtendedServerBlobAuditingPolicyProperties + err = json.Unmarshal(*v, &extendedServerBlobAuditingPolicyProperties) + if err != nil { + return err + } + esbap.ExtendedServerBlobAuditingPolicyProperties = &extendedServerBlobAuditingPolicyProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + esbap.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + esbap.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + esbap.Type = &typeVar + } + } + } + + return nil +} + +// ExtendedServerBlobAuditingPolicyProperties properties of an extended server blob auditing policy. +type ExtendedServerBlobAuditingPolicyProperties struct { + // PredicateExpression - Specifies condition of where clause when creating an audit. + PredicateExpression *string `json:"predicateExpression,omitempty"` + // State - Specifies the state of the policy. If state is Enabled, storageEndpoint and storageAccountAccessKey are required. Possible values include: 'BlobAuditingPolicyStateEnabled', 'BlobAuditingPolicyStateDisabled' + State BlobAuditingPolicyState `json:"state,omitempty"` + // StorageEndpoint - Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). If state is Enabled, storageEndpoint is required. + StorageEndpoint *string `json:"storageEndpoint,omitempty"` + // StorageAccountAccessKey - Specifies the identifier key of the auditing storage account. If state is Enabled, storageAccountAccessKey is required. + StorageAccountAccessKey *string `json:"storageAccountAccessKey,omitempty"` + // RetentionDays - Specifies the number of days to keep in the audit logs. + RetentionDays *int32 `json:"retentionDays,omitempty"` + // AuditActionsAndGroups - Specifies the Actions-Groups and Actions to audit. + // + // The recommended set of action groups to use is the following combination - this will audit all the queries and stored procedures executed against the database, as well as successful and failed logins: + // + // BATCH_COMPLETED_GROUP, + // SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP, + // FAILED_DATABASE_AUTHENTICATION_GROUP. + // + // This above combination is also the set that is configured by default when enabling auditing from the Azure portal. + // + // The supported action groups to audit are (note: choose only specific groups that cover your auditing needs. Using unnecessary groups could lead to very large quantities of audit records): + // + // APPLICATION_ROLE_CHANGE_PASSWORD_GROUP + // BACKUP_RESTORE_GROUP + // DATABASE_LOGOUT_GROUP + // DATABASE_OBJECT_CHANGE_GROUP + // DATABASE_OBJECT_OWNERSHIP_CHANGE_GROUP + // DATABASE_OBJECT_PERMISSION_CHANGE_GROUP + // DATABASE_OPERATION_GROUP + // DATABASE_PERMISSION_CHANGE_GROUP + // DATABASE_PRINCIPAL_CHANGE_GROUP + // DATABASE_PRINCIPAL_IMPERSONATION_GROUP + // DATABASE_ROLE_MEMBER_CHANGE_GROUP + // FAILED_DATABASE_AUTHENTICATION_GROUP + // SCHEMA_OBJECT_ACCESS_GROUP + // SCHEMA_OBJECT_CHANGE_GROUP + // SCHEMA_OBJECT_OWNERSHIP_CHANGE_GROUP + // SCHEMA_OBJECT_PERMISSION_CHANGE_GROUP + // SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP + // USER_CHANGE_PASSWORD_GROUP + // BATCH_STARTED_GROUP + // BATCH_COMPLETED_GROUP + // + // These are groups that cover all sql statements and stored procedures executed against the database, and should not be used in combination with other groups as this will result in duplicate audit logs. + // + // For more information, see [Database-Level Audit Action Groups](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-action-groups). + // + // For Database auditing policy, specific Actions can also be specified (note that Actions cannot be specified for Server auditing policy). The supported actions to audit are: + // SELECT + // UPDATE + // INSERT + // DELETE + // EXECUTE + // RECEIVE + // REFERENCES + // + // The general form for defining an action to be audited is: + // ON BY + // + // Note that in the above format can refer to an object like a table, view, or stored procedure, or an entire database or schema. For the latter cases, the forms DATABASE:: and SCHEMA:: are used, respectively. + // + // For example: + // SELECT on dbo.myTable by public + // SELECT on DATABASE::myDatabase by public + // SELECT on SCHEMA::mySchema by public + // + // For more information, see [Database-Level Audit Actions](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-actions) + AuditActionsAndGroups *[]string `json:"auditActionsAndGroups,omitempty"` + // StorageAccountSubscriptionID - Specifies the blob storage subscription Id. + StorageAccountSubscriptionID *uuid.UUID `json:"storageAccountSubscriptionId,omitempty"` + // IsStorageSecondaryKeyInUse - Specifies whether storageAccountAccessKey value is the storage's secondary key. + IsStorageSecondaryKeyInUse *bool `json:"isStorageSecondaryKeyInUse,omitempty"` +} + // FailoverGroup a failover group. type FailoverGroup struct { autorest.Response `json:"-"` @@ -8530,6 +8946,24 @@ func (future *RestorePointsCreateFuture) Result(client RestorePointsClient) (rp return } +// SecurityAlertPolicyProperties properties of a security alert policy. +type SecurityAlertPolicyProperties struct { + // State - Specifies the state of the policy, whether it is enabled or disabled. Possible values include: 'SecurityAlertPolicyStateNew', 'SecurityAlertPolicyStateEnabled', 'SecurityAlertPolicyStateDisabled' + State SecurityAlertPolicyState `json:"state,omitempty"` + // DisabledAlerts - Specifies an array of alerts that are disabled. Allowed values are: Sql_Injection, Sql_Injection_Vulnerability, Access_Anomaly + DisabledAlerts *[]string `json:"disabledAlerts,omitempty"` + // EmailAddresses - Specifies an array of e-mail addresses to which the alert is sent. + EmailAddresses *[]string `json:"emailAddresses,omitempty"` + // EmailAccountAdmins - Specifies that the alert is sent to the account administrators. + EmailAccountAdmins *bool `json:"emailAccountAdmins,omitempty"` + // StorageEndpoint - Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). This blob storage will hold all Threat Detection audit logs. + StorageEndpoint *string `json:"storageEndpoint,omitempty"` + // StorageAccountAccessKey - Specifies the identifier key of the Threat Detection audit storage account. + StorageAccountAccessKey *string `json:"storageAccountAccessKey,omitempty"` + // RetentionDays - Specifies the number of days to keep in the Threat Detection audit logs. + RetentionDays *int32 `json:"retentionDays,omitempty"` +} + // Server an Azure SQL Database server. type Server struct { autorest.Response `json:"-"` @@ -8909,6 +9343,191 @@ func (future *ServerAzureADAdministratorsDeleteFuture) Result(client ServerAzure return } +// ServerBlobAuditingPoliciesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ServerBlobAuditingPoliciesCreateOrUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ServerBlobAuditingPoliciesCreateOrUpdateFuture) Result(client ServerBlobAuditingPoliciesClient) (sbap ServerBlobAuditingPolicy, err error) { + var done bool + done, err = future.Done(client) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.ServerBlobAuditingPoliciesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("sql.ServerBlobAuditingPoliciesCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if sbap.Response.Response, err = future.GetResult(sender); err == nil && sbap.Response.Response.StatusCode != http.StatusNoContent { + sbap, err = client.CreateOrUpdateResponder(sbap.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.ServerBlobAuditingPoliciesCreateOrUpdateFuture", "Result", sbap.Response.Response, "Failure responding to request") + } + } + return +} + +// ServerBlobAuditingPolicy a server blob auditing policy. +type ServerBlobAuditingPolicy struct { + autorest.Response `json:"-"` + // ServerBlobAuditingPolicyProperties - Resource properties. + *ServerBlobAuditingPolicyProperties `json:"properties,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` + // Name - Resource name. + Name *string `json:"name,omitempty"` + // Type - Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ServerBlobAuditingPolicy. +func (sbap ServerBlobAuditingPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sbap.ServerBlobAuditingPolicyProperties != nil { + objectMap["properties"] = sbap.ServerBlobAuditingPolicyProperties + } + if sbap.ID != nil { + objectMap["id"] = sbap.ID + } + if sbap.Name != nil { + objectMap["name"] = sbap.Name + } + if sbap.Type != nil { + objectMap["type"] = sbap.Type + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ServerBlobAuditingPolicy struct. +func (sbap *ServerBlobAuditingPolicy) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var serverBlobAuditingPolicyProperties ServerBlobAuditingPolicyProperties + err = json.Unmarshal(*v, &serverBlobAuditingPolicyProperties) + if err != nil { + return err + } + sbap.ServerBlobAuditingPolicyProperties = &serverBlobAuditingPolicyProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + sbap.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + sbap.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + sbap.Type = &typeVar + } + } + } + + return nil +} + +// ServerBlobAuditingPolicyProperties properties of a server blob auditing policy. +type ServerBlobAuditingPolicyProperties struct { + // State - Specifies the state of the policy. If state is Enabled, storageEndpoint and storageAccountAccessKey are required. Possible values include: 'BlobAuditingPolicyStateEnabled', 'BlobAuditingPolicyStateDisabled' + State BlobAuditingPolicyState `json:"state,omitempty"` + // StorageEndpoint - Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). If state is Enabled, storageEndpoint is required. + StorageEndpoint *string `json:"storageEndpoint,omitempty"` + // StorageAccountAccessKey - Specifies the identifier key of the auditing storage account. If state is Enabled, storageAccountAccessKey is required. + StorageAccountAccessKey *string `json:"storageAccountAccessKey,omitempty"` + // RetentionDays - Specifies the number of days to keep in the audit logs. + RetentionDays *int32 `json:"retentionDays,omitempty"` + // AuditActionsAndGroups - Specifies the Actions-Groups and Actions to audit. + // + // The recommended set of action groups to use is the following combination - this will audit all the queries and stored procedures executed against the database, as well as successful and failed logins: + // + // BATCH_COMPLETED_GROUP, + // SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP, + // FAILED_DATABASE_AUTHENTICATION_GROUP. + // + // This above combination is also the set that is configured by default when enabling auditing from the Azure portal. + // + // The supported action groups to audit are (note: choose only specific groups that cover your auditing needs. Using unnecessary groups could lead to very large quantities of audit records): + // + // APPLICATION_ROLE_CHANGE_PASSWORD_GROUP + // BACKUP_RESTORE_GROUP + // DATABASE_LOGOUT_GROUP + // DATABASE_OBJECT_CHANGE_GROUP + // DATABASE_OBJECT_OWNERSHIP_CHANGE_GROUP + // DATABASE_OBJECT_PERMISSION_CHANGE_GROUP + // DATABASE_OPERATION_GROUP + // DATABASE_PERMISSION_CHANGE_GROUP + // DATABASE_PRINCIPAL_CHANGE_GROUP + // DATABASE_PRINCIPAL_IMPERSONATION_GROUP + // DATABASE_ROLE_MEMBER_CHANGE_GROUP + // FAILED_DATABASE_AUTHENTICATION_GROUP + // SCHEMA_OBJECT_ACCESS_GROUP + // SCHEMA_OBJECT_CHANGE_GROUP + // SCHEMA_OBJECT_OWNERSHIP_CHANGE_GROUP + // SCHEMA_OBJECT_PERMISSION_CHANGE_GROUP + // SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP + // USER_CHANGE_PASSWORD_GROUP + // BATCH_STARTED_GROUP + // BATCH_COMPLETED_GROUP + // + // These are groups that cover all sql statements and stored procedures executed against the database, and should not be used in combination with other groups as this will result in duplicate audit logs. + // + // For more information, see [Database-Level Audit Action Groups](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-action-groups). + // + // For Database auditing policy, specific Actions can also be specified (note that Actions cannot be specified for Server auditing policy). The supported actions to audit are: + // SELECT + // UPDATE + // INSERT + // DELETE + // EXECUTE + // RECEIVE + // REFERENCES + // + // The general form for defining an action to be audited is: + // ON BY + // + // Note that in the above format can refer to an object like a table, view, or stored procedure, or an entire database or schema. For the latter cases, the forms DATABASE:: and SCHEMA:: are used, respectively. + // + // For example: + // SELECT on dbo.myTable by public + // SELECT on DATABASE::myDatabase by public + // SELECT on SCHEMA::mySchema by public + // + // For more information, see [Database-Level Audit Actions](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-actions) + AuditActionsAndGroups *[]string `json:"auditActionsAndGroups,omitempty"` + // StorageAccountSubscriptionID - Specifies the blob storage subscription Id. + StorageAccountSubscriptionID *uuid.UUID `json:"storageAccountSubscriptionId,omitempty"` + // IsStorageSecondaryKeyInUse - Specifies whether storageAccountAccessKey value is the storage's secondary key. + IsStorageSecondaryKeyInUse *bool `json:"isStorageSecondaryKeyInUse,omitempty"` +} + // ServerCommunicationLink server communication link. type ServerCommunicationLink struct { autorest.Response `json:"-"` @@ -9894,6 +10513,117 @@ func (future *ServersDeleteFuture) Result(client ServersClient) (ar autorest.Res return } +// ServerSecurityAlertPoliciesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ServerSecurityAlertPoliciesCreateOrUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ServerSecurityAlertPoliciesCreateOrUpdateFuture) Result(client ServerSecurityAlertPoliciesClient) (ssap ServerSecurityAlertPolicy, err error) { + var done bool + done, err = future.Done(client) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.ServerSecurityAlertPoliciesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("sql.ServerSecurityAlertPoliciesCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if ssap.Response.Response, err = future.GetResult(sender); err == nil && ssap.Response.Response.StatusCode != http.StatusNoContent { + ssap, err = client.CreateOrUpdateResponder(ssap.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.ServerSecurityAlertPoliciesCreateOrUpdateFuture", "Result", ssap.Response.Response, "Failure responding to request") + } + } + return +} + +// ServerSecurityAlertPolicy a server security alert policy. +type ServerSecurityAlertPolicy struct { + autorest.Response `json:"-"` + // SecurityAlertPolicyProperties - Resource properties. + *SecurityAlertPolicyProperties `json:"properties,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` + // Name - Resource name. + Name *string `json:"name,omitempty"` + // Type - Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ServerSecurityAlertPolicy. +func (ssap ServerSecurityAlertPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ssap.SecurityAlertPolicyProperties != nil { + objectMap["properties"] = ssap.SecurityAlertPolicyProperties + } + if ssap.ID != nil { + objectMap["id"] = ssap.ID + } + if ssap.Name != nil { + objectMap["name"] = ssap.Name + } + if ssap.Type != nil { + objectMap["type"] = ssap.Type + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ServerSecurityAlertPolicy struct. +func (ssap *ServerSecurityAlertPolicy) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var securityAlertPolicyProperties SecurityAlertPolicyProperties + err = json.Unmarshal(*v, &securityAlertPolicyProperties) + if err != nil { + return err + } + ssap.SecurityAlertPolicyProperties = &securityAlertPolicyProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ssap.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ssap.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ssap.Type = &typeVar + } + } + } + + return nil +} + // ServersUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation. type ServersUpdateFuture struct { azure.Future diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2017-03-01-preview/sql/serverblobauditingpolicies.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2017-03-01-preview/sql/serverblobauditingpolicies.go new file mode 100644 index 000000000..4cbb2210a --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2017-03-01-preview/sql/serverblobauditingpolicies.go @@ -0,0 +1,187 @@ +package sql + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "net/http" +) + +// ServerBlobAuditingPoliciesClient is the the Azure SQL Database management API provides a RESTful set of web services +// that interact with Azure SQL Database services to manage your databases. The API enables you to create, retrieve, +// update, and delete databases. +type ServerBlobAuditingPoliciesClient struct { + BaseClient +} + +// NewServerBlobAuditingPoliciesClient creates an instance of the ServerBlobAuditingPoliciesClient client. +func NewServerBlobAuditingPoliciesClient(subscriptionID string) ServerBlobAuditingPoliciesClient { + return NewServerBlobAuditingPoliciesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewServerBlobAuditingPoliciesClientWithBaseURI creates an instance of the ServerBlobAuditingPoliciesClient client. +func NewServerBlobAuditingPoliciesClientWithBaseURI(baseURI string, subscriptionID string) ServerBlobAuditingPoliciesClient { + return ServerBlobAuditingPoliciesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or updates a server's blob auditing policy. +// Parameters: +// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value +// from the Azure Resource Manager API or the portal. +// serverName - the name of the server. +// parameters - properties of blob auditing policy +func (client ServerBlobAuditingPoliciesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, parameters ServerBlobAuditingPolicy) (result ServerBlobAuditingPoliciesCreateOrUpdateFuture, err error) { + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serverName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.ServerBlobAuditingPoliciesClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.ServerBlobAuditingPoliciesClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client ServerBlobAuditingPoliciesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serverName string, parameters ServerBlobAuditingPolicy) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "blobAuditingPolicyName": autorest.Encode("path", "default"), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serverName": autorest.Encode("path", serverName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-03-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/auditingSettings/{blobAuditingPolicyName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client ServerBlobAuditingPoliciesClient) CreateOrUpdateSender(req *http.Request) (future ServerBlobAuditingPoliciesCreateOrUpdateFuture, err error) { + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client ServerBlobAuditingPoliciesClient) CreateOrUpdateResponder(resp *http.Response) (result ServerBlobAuditingPolicy, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get gets a server's blob auditing policy. +// Parameters: +// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value +// from the Azure Resource Manager API or the portal. +// serverName - the name of the server. +func (client ServerBlobAuditingPoliciesClient) Get(ctx context.Context, resourceGroupName string, serverName string) (result ServerBlobAuditingPolicy, err error) { + req, err := client.GetPreparer(ctx, resourceGroupName, serverName) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.ServerBlobAuditingPoliciesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "sql.ServerBlobAuditingPoliciesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.ServerBlobAuditingPoliciesClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client ServerBlobAuditingPoliciesClient) GetPreparer(ctx context.Context, resourceGroupName string, serverName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "blobAuditingPolicyName": autorest.Encode("path", "default"), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serverName": autorest.Encode("path", serverName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-03-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/auditingSettings/{blobAuditingPolicyName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ServerBlobAuditingPoliciesClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ServerBlobAuditingPoliciesClient) GetResponder(resp *http.Response) (result ServerBlobAuditingPolicy, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2017-03-01-preview/sql/serversecurityalertpolicies.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2017-03-01-preview/sql/serversecurityalertpolicies.go new file mode 100644 index 000000000..38f709d0c --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2017-03-01-preview/sql/serversecurityalertpolicies.go @@ -0,0 +1,187 @@ +package sql + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "net/http" +) + +// ServerSecurityAlertPoliciesClient is the the Azure SQL Database management API provides a RESTful set of web +// services that interact with Azure SQL Database services to manage your databases. The API enables you to create, +// retrieve, update, and delete databases. +type ServerSecurityAlertPoliciesClient struct { + BaseClient +} + +// NewServerSecurityAlertPoliciesClient creates an instance of the ServerSecurityAlertPoliciesClient client. +func NewServerSecurityAlertPoliciesClient(subscriptionID string) ServerSecurityAlertPoliciesClient { + return NewServerSecurityAlertPoliciesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewServerSecurityAlertPoliciesClientWithBaseURI creates an instance of the ServerSecurityAlertPoliciesClient client. +func NewServerSecurityAlertPoliciesClientWithBaseURI(baseURI string, subscriptionID string) ServerSecurityAlertPoliciesClient { + return ServerSecurityAlertPoliciesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or updates a threat detection policy. +// Parameters: +// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value +// from the Azure Resource Manager API or the portal. +// serverName - the name of the server. +// parameters - the server security alert policy. +func (client ServerSecurityAlertPoliciesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, parameters ServerSecurityAlertPolicy) (result ServerSecurityAlertPoliciesCreateOrUpdateFuture, err error) { + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serverName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.ServerSecurityAlertPoliciesClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.ServerSecurityAlertPoliciesClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client ServerSecurityAlertPoliciesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serverName string, parameters ServerSecurityAlertPolicy) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "securityAlertPolicyName": autorest.Encode("path", "Default"), + "serverName": autorest.Encode("path", serverName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-03-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/securityAlertPolicies/{securityAlertPolicyName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client ServerSecurityAlertPoliciesClient) CreateOrUpdateSender(req *http.Request) (future ServerSecurityAlertPoliciesCreateOrUpdateFuture, err error) { + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client ServerSecurityAlertPoliciesClient) CreateOrUpdateResponder(resp *http.Response) (result ServerSecurityAlertPolicy, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get get a server's security alert policy. +// Parameters: +// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value +// from the Azure Resource Manager API or the portal. +// serverName - the name of the server. +func (client ServerSecurityAlertPoliciesClient) Get(ctx context.Context, resourceGroupName string, serverName string) (result ServerSecurityAlertPolicy, err error) { + req, err := client.GetPreparer(ctx, resourceGroupName, serverName) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.ServerSecurityAlertPoliciesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "sql.ServerSecurityAlertPoliciesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.ServerSecurityAlertPoliciesClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client ServerSecurityAlertPoliciesClient) GetPreparer(ctx context.Context, resourceGroupName string, serverName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "securityAlertPolicyName": autorest.Encode("path", "Default"), + "serverName": autorest.Encode("path", serverName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-03-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/securityAlertPolicies/{securityAlertPolicyName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ServerSecurityAlertPoliciesClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ServerSecurityAlertPoliciesClient) GetResponder(resp *http.Response) (result ServerSecurityAlertPolicy, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2017-10-01-preview/sql/backupshorttermretentionpolicies.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2017-10-01-preview/sql/backupshorttermretentionpolicies.go index 158209f2a..a9c2ff6ae 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2017-10-01-preview/sql/backupshorttermretentionpolicies.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2017-10-01-preview/sql/backupshorttermretentionpolicies.go @@ -191,6 +191,104 @@ func (client BackupShortTermRetentionPoliciesClient) GetResponder(resp *http.Res return } +// ListByDatabase gets a database's short term retention policy. +// Parameters: +// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value +// from the Azure Resource Manager API or the portal. +// serverName - the name of the server. +// databaseName - the name of the database. +func (client BackupShortTermRetentionPoliciesClient) ListByDatabase(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result BackupShortTermRetentionPolicyListResultPage, err error) { + result.fn = client.listByDatabaseNextResults + req, err := client.ListByDatabasePreparer(ctx, resourceGroupName, serverName, databaseName) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.BackupShortTermRetentionPoliciesClient", "ListByDatabase", nil, "Failure preparing request") + return + } + + resp, err := client.ListByDatabaseSender(req) + if err != nil { + result.bstrplr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "sql.BackupShortTermRetentionPoliciesClient", "ListByDatabase", resp, "Failure sending request") + return + } + + result.bstrplr, err = client.ListByDatabaseResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.BackupShortTermRetentionPoliciesClient", "ListByDatabase", resp, "Failure responding to request") + } + + return +} + +// ListByDatabasePreparer prepares the ListByDatabase request. +func (client BackupShortTermRetentionPoliciesClient) ListByDatabasePreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serverName": autorest.Encode("path", serverName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-10-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/backupShortTermRetentionPolicies", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByDatabaseSender sends the ListByDatabase request. The method will close the +// http.Response Body if it receives an error. +func (client BackupShortTermRetentionPoliciesClient) ListByDatabaseSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByDatabaseResponder handles the response to the ListByDatabase request. The method always +// closes the http.Response Body. +func (client BackupShortTermRetentionPoliciesClient) ListByDatabaseResponder(resp *http.Response) (result BackupShortTermRetentionPolicyListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByDatabaseNextResults retrieves the next set of results, if any. +func (client BackupShortTermRetentionPoliciesClient) listByDatabaseNextResults(lastResults BackupShortTermRetentionPolicyListResult) (result BackupShortTermRetentionPolicyListResult, err error) { + req, err := lastResults.backupShortTermRetentionPolicyListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "sql.BackupShortTermRetentionPoliciesClient", "listByDatabaseNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByDatabaseSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "sql.BackupShortTermRetentionPoliciesClient", "listByDatabaseNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByDatabaseResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.BackupShortTermRetentionPoliciesClient", "listByDatabaseNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByDatabaseComplete enumerates all values, automatically crossing page boundaries as required. +func (client BackupShortTermRetentionPoliciesClient) ListByDatabaseComplete(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result BackupShortTermRetentionPolicyListResultIterator, err error) { + result.page, err = client.ListByDatabase(ctx, resourceGroupName, serverName, databaseName) + return +} + // Update updates a database's short term retention policy. // Parameters: // resourceGroupName - the name of the resource group that contains the resource. You can obtain this value diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2017-10-01-preview/sql/managedinstancetdecertificates.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2017-10-01-preview/sql/managedinstancetdecertificates.go new file mode 100644 index 000000000..0f1f97acf --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2017-10-01-preview/sql/managedinstancetdecertificates.go @@ -0,0 +1,125 @@ +package sql + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// ManagedInstanceTdeCertificatesClient is the the Azure SQL Database management API provides a RESTful set of web +// services that interact with Azure SQL Database services to manage your databases. The API enables you to create, +// retrieve, update, and delete databases. +type ManagedInstanceTdeCertificatesClient struct { + BaseClient +} + +// NewManagedInstanceTdeCertificatesClient creates an instance of the ManagedInstanceTdeCertificatesClient client. +func NewManagedInstanceTdeCertificatesClient(subscriptionID string) ManagedInstanceTdeCertificatesClient { + return NewManagedInstanceTdeCertificatesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewManagedInstanceTdeCertificatesClientWithBaseURI creates an instance of the ManagedInstanceTdeCertificatesClient +// client. +func NewManagedInstanceTdeCertificatesClientWithBaseURI(baseURI string, subscriptionID string) ManagedInstanceTdeCertificatesClient { + return ManagedInstanceTdeCertificatesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Create creates a TDE certificate for a given server. +// Parameters: +// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value +// from the Azure Resource Manager API or the portal. +// managedInstanceName - the name of the managed instance. +// parameters - the requested TDE certificate to be created or updated. +func (client ManagedInstanceTdeCertificatesClient) Create(ctx context.Context, resourceGroupName string, managedInstanceName string, parameters TdeCertificate) (result ManagedInstanceTdeCertificatesCreateFuture, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.TdeCertificateProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.TdeCertificateProperties.PrivateBlob", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("sql.ManagedInstanceTdeCertificatesClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, resourceGroupName, managedInstanceName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.ManagedInstanceTdeCertificatesClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.ManagedInstanceTdeCertificatesClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ManagedInstanceTdeCertificatesClient) CreatePreparer(ctx context.Context, resourceGroupName string, managedInstanceName string, parameters TdeCertificate) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "managedInstanceName": autorest.Encode("path", managedInstanceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-10-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/tdeCertificates", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ManagedInstanceTdeCertificatesClient) CreateSender(req *http.Request) (future ManagedInstanceTdeCertificatesCreateFuture, err error) { + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ManagedInstanceTdeCertificatesClient) CreateResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2017-10-01-preview/sql/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2017-10-01-preview/sql/models.go index d95d16692..e7879e738 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2017-10-01-preview/sql/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2017-10-01-preview/sql/models.go @@ -532,6 +532,109 @@ func (bstrp *BackupShortTermRetentionPolicy) UnmarshalJSON(body []byte) error { return nil } +// BackupShortTermRetentionPolicyListResult a list of short term retention policies. +type BackupShortTermRetentionPolicyListResult struct { + autorest.Response `json:"-"` + // Value - Array of results. + Value *[]BackupShortTermRetentionPolicy `json:"value,omitempty"` + // NextLink - Link to retrieve next page of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// BackupShortTermRetentionPolicyListResultIterator provides access to a complete listing of +// BackupShortTermRetentionPolicy values. +type BackupShortTermRetentionPolicyListResultIterator struct { + i int + page BackupShortTermRetentionPolicyListResultPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *BackupShortTermRetentionPolicyListResultIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter BackupShortTermRetentionPolicyListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter BackupShortTermRetentionPolicyListResultIterator) Response() BackupShortTermRetentionPolicyListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter BackupShortTermRetentionPolicyListResultIterator) Value() BackupShortTermRetentionPolicy { + if !iter.page.NotDone() { + return BackupShortTermRetentionPolicy{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (bstrplr BackupShortTermRetentionPolicyListResult) IsEmpty() bool { + return bstrplr.Value == nil || len(*bstrplr.Value) == 0 +} + +// backupShortTermRetentionPolicyListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (bstrplr BackupShortTermRetentionPolicyListResult) backupShortTermRetentionPolicyListResultPreparer() (*http.Request, error) { + if bstrplr.NextLink == nil || len(to.String(bstrplr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(bstrplr.NextLink))) +} + +// BackupShortTermRetentionPolicyListResultPage contains a page of BackupShortTermRetentionPolicy values. +type BackupShortTermRetentionPolicyListResultPage struct { + fn func(BackupShortTermRetentionPolicyListResult) (BackupShortTermRetentionPolicyListResult, error) + bstrplr BackupShortTermRetentionPolicyListResult +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *BackupShortTermRetentionPolicyListResultPage) Next() error { + next, err := page.fn(page.bstrplr) + if err != nil { + return err + } + page.bstrplr = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page BackupShortTermRetentionPolicyListResultPage) NotDone() bool { + return !page.bstrplr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page BackupShortTermRetentionPolicyListResultPage) Response() BackupShortTermRetentionPolicyListResult { + return page.bstrplr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page BackupShortTermRetentionPolicyListResultPage) Values() []BackupShortTermRetentionPolicy { + if page.bstrplr.IsEmpty() { + return nil + } + return *page.bstrplr.Value +} + // BackupShortTermRetentionPolicyProperties properties of a short term retention policy type BackupShortTermRetentionPolicyProperties struct { // RetentionDays - The backup retention period in days. This is how many days Point-in-Time Restore will be supported. @@ -2616,6 +2719,29 @@ type ManagedInstancePairInfo struct { PartnerManagedInstanceID *string `json:"partnerManagedInstanceId,omitempty"` } +// ManagedInstanceTdeCertificatesCreateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ManagedInstanceTdeCertificatesCreateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ManagedInstanceTdeCertificatesCreateFuture) Result(client ManagedInstanceTdeCertificatesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.Done(client) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.ManagedInstanceTdeCertificatesCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("sql.ManagedInstanceTdeCertificatesCreateFuture") + return + } + ar.Response = future.Response() + return +} + // ManagedInstanceVcoresCapability the managed instance virtual cores capability. type ManagedInstanceVcoresCapability struct { // Name - The virtual cores identifier. @@ -2756,6 +2882,118 @@ type Sku struct { Capacity *int32 `json:"capacity,omitempty"` } +// TdeCertificate a TDE certificate that can be uploaded into a server. +type TdeCertificate struct { + // TdeCertificateProperties - Resource properties. + *TdeCertificateProperties `json:"properties,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` + // Name - Resource name. + Name *string `json:"name,omitempty"` + // Type - Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for TdeCertificate. +func (tc TdeCertificate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if tc.TdeCertificateProperties != nil { + objectMap["properties"] = tc.TdeCertificateProperties + } + if tc.ID != nil { + objectMap["id"] = tc.ID + } + if tc.Name != nil { + objectMap["name"] = tc.Name + } + if tc.Type != nil { + objectMap["type"] = tc.Type + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for TdeCertificate struct. +func (tc *TdeCertificate) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var tdeCertificateProperties TdeCertificateProperties + err = json.Unmarshal(*v, &tdeCertificateProperties) + if err != nil { + return err + } + tc.TdeCertificateProperties = &tdeCertificateProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + tc.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + tc.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + tc.Type = &typeVar + } + } + } + + return nil +} + +// TdeCertificateProperties properties of a TDE certificate. +type TdeCertificateProperties struct { + // PrivateBlob - The base64 encoded certificate private blob. + PrivateBlob *string `json:"privateBlob,omitempty"` + // CertPassword - The certificate password. + CertPassword *string `json:"certPassword,omitempty"` +} + +// TdeCertificatesCreateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type TdeCertificatesCreateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *TdeCertificatesCreateFuture) Result(client TdeCertificatesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.Done(client) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.TdeCertificatesCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("sql.TdeCertificatesCreateFuture") + return + } + ar.Response = future.Response() + return +} + // TrackedResource ARM tracked top level resource. type TrackedResource struct { // Location - Resource location. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2017-10-01-preview/sql/tdecertificates.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2017-10-01-preview/sql/tdecertificates.go new file mode 100644 index 000000000..41eab8cc9 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2017-10-01-preview/sql/tdecertificates.go @@ -0,0 +1,124 @@ +package sql + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// TdeCertificatesClient is the the Azure SQL Database management API provides a RESTful set of web services that +// interact with Azure SQL Database services to manage your databases. The API enables you to create, retrieve, update, +// and delete databases. +type TdeCertificatesClient struct { + BaseClient +} + +// NewTdeCertificatesClient creates an instance of the TdeCertificatesClient client. +func NewTdeCertificatesClient(subscriptionID string) TdeCertificatesClient { + return NewTdeCertificatesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewTdeCertificatesClientWithBaseURI creates an instance of the TdeCertificatesClient client. +func NewTdeCertificatesClientWithBaseURI(baseURI string, subscriptionID string) TdeCertificatesClient { + return TdeCertificatesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Create creates a TDE certificate for a given server. +// Parameters: +// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value +// from the Azure Resource Manager API or the portal. +// serverName - the name of the server. +// parameters - the requested TDE certificate to be created or updated. +func (client TdeCertificatesClient) Create(ctx context.Context, resourceGroupName string, serverName string, parameters TdeCertificate) (result TdeCertificatesCreateFuture, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.TdeCertificateProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.TdeCertificateProperties.PrivateBlob", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("sql.TdeCertificatesClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, resourceGroupName, serverName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.TdeCertificatesClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.TdeCertificatesClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client TdeCertificatesClient) CreatePreparer(ctx context.Context, resourceGroupName string, serverName string, parameters TdeCertificate) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serverName": autorest.Encode("path", serverName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-10-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/tdeCertificates", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client TdeCertificatesClient) CreateSender(req *http.Request) (future TdeCertificatesCreateFuture, err error) { + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client TdeCertificatesClient) CreateResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/storage/mgmt/2018-03-01-preview/storage/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/storage/mgmt/2018-03-01-preview/storage/models.go index de89ab8c5..4cb5f15df 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/storage/mgmt/2018-03-01-preview/storage/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/storage/mgmt/2018-03-01-preview/storage/models.go @@ -886,6 +886,8 @@ type AccountProperties struct { EnableHTTPSTrafficOnly *bool `json:"supportsHttpsTrafficOnly,omitempty"` // NetworkRuleSet - Network rule set NetworkRuleSet *NetworkRuleSet `json:"networkAcls,omitempty"` + // IsHnsEnabled - Account HierarchicalNamespace enabled if sets to true. + IsHnsEnabled *bool `json:"isHnsEnabled,omitempty"` } // AccountPropertiesCreateParameters the parameters used to create the storage account. @@ -900,6 +902,8 @@ type AccountPropertiesCreateParameters struct { AccessTier AccessTier `json:"accessTier,omitempty"` // EnableHTTPSTrafficOnly - Allows https traffic only to storage service if sets to true. EnableHTTPSTrafficOnly *bool `json:"supportsHttpsTrafficOnly,omitempty"` + // IsHnsEnabled - Account HierarchicalNamespace enabled if sets to true. + IsHnsEnabled *bool `json:"isHnsEnabled,omitempty"` } // AccountPropertiesUpdateParameters the parameters used when updating a storage account. @@ -1290,7 +1294,7 @@ type EncryptionServices struct { Queue *EncryptionService `json:"queue,omitempty"` } -// Endpoints the URIs that are used to perform a retrieval of a public blob, queue, or table object. +// Endpoints the URIs that are used to perform a retrieval of a public blob, queue, table, web or dfs object. type Endpoints struct { // Blob - Gets the blob endpoint. Blob *string `json:"blob,omitempty"` @@ -1300,6 +1304,10 @@ type Endpoints struct { Table *string `json:"table,omitempty"` // File - Gets the file endpoint. File *string `json:"file,omitempty"` + // Web - Gets the web endpoint. + Web *string `json:"web,omitempty"` + // Dfs - Gets the dfs endpoint. + Dfs *string `json:"dfs,omitempty"` } // Identity identity for the resource. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/timeseriesinsights/mgmt/2017-02-28-preview/timeseriesinsights/environments.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/timeseriesinsights/mgmt/2017-02-28-preview/timeseriesinsights/environments.go index 25c30e9a8..5ba54d7b8 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/timeseriesinsights/mgmt/2017-02-28-preview/timeseriesinsights/environments.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/timeseriesinsights/mgmt/2017-02-28-preview/timeseriesinsights/environments.go @@ -54,7 +54,7 @@ func (client EnvironmentsClient) CreateOrUpdate(ctx context.Context, resourceGro {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.Sku", Name: validation.Null, Rule: true, Chain: []validation.Constraint{{Target: "parameters.Sku.Capacity", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.Sku.Capacity", Name: validation.InclusiveMaximum, Rule: 10, Chain: nil}, + Chain: []validation.Constraint{{Target: "parameters.Sku.Capacity", Name: validation.InclusiveMaximum, Rule: int64(10), Chain: nil}, {Target: "parameters.Sku.Capacity", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}, }}, diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2016-12-01/backup/backups.go b/vendor/github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2016-12-01/backup/backups.go new file mode 100644 index 000000000..bdb21f4e6 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2016-12-01/backup/backups.go @@ -0,0 +1,116 @@ +package backup + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "net/http" +) + +// BackupsClient is the open API 2.0 Specs for Azure RecoveryServices Backup service +type BackupsClient struct { + BaseClient +} + +// NewBackupsClient creates an instance of the BackupsClient client. +func NewBackupsClient(subscriptionID string) BackupsClient { + return NewBackupsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewBackupsClientWithBaseURI creates an instance of the BackupsClient client. +func NewBackupsClientWithBaseURI(baseURI string, subscriptionID string) BackupsClient { + return BackupsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Trigger triggers backup for specified backed up item. This is an asynchronous operation. To know the status of the +// operation, call GetProtectedItemOperationResult API. +// Parameters: +// vaultName - the name of the recovery services vault. +// resourceGroupName - the name of the resource group where the recovery services vault is present. +// fabricName - fabric name associated with the backup item. +// containerName - container name associated with the backup item. +// protectedItemName - backup item for which backup needs to be triggered. +// parameters - resource backup request +func (client BackupsClient) Trigger(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, parameters RequestResource) (result autorest.Response, err error) { + req, err := client.TriggerPreparer(ctx, vaultName, resourceGroupName, fabricName, containerName, protectedItemName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.BackupsClient", "Trigger", nil, "Failure preparing request") + return + } + + resp, err := client.TriggerSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "backup.BackupsClient", "Trigger", resp, "Failure sending request") + return + } + + result, err = client.TriggerResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.BackupsClient", "Trigger", resp, "Failure responding to request") + } + + return +} + +// TriggerPreparer prepares the Trigger request. +func (client BackupsClient) TriggerPreparer(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, parameters RequestResource) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "containerName": autorest.Encode("path", containerName), + "fabricName": autorest.Encode("path", fabricName), + "protectedItemName": autorest.Encode("path", protectedItemName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vaultName": autorest.Encode("path", vaultName), + } + + const APIVersion = "2016-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/backup", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// TriggerSender sends the Trigger request. The method will close the +// http.Response Body if it receives an error. +func (client BackupsClient) TriggerSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// TriggerResponder handles the response to the Trigger request. The method always +// closes the http.Response Body. +func (client BackupsClient) TriggerResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2016-12-01/backup/client.go b/vendor/github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2016-12-01/backup/client.go new file mode 100644 index 000000000..fb9c2765d --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2016-12-01/backup/client.go @@ -0,0 +1,51 @@ +// Package backup implements the Azure ARM Backup service API version 2016-12-01. +// +// Open API 2.0 Specs for Azure RecoveryServices Backup service +package backup + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/Azure/go-autorest/autorest" +) + +const ( + // DefaultBaseURI is the default URI used for the service Backup + DefaultBaseURI = "https://management.azure.com" +) + +// BaseClient is the base client for Backup. +type BaseClient struct { + autorest.Client + BaseURI string + SubscriptionID string +} + +// New creates an instance of the BaseClient client. +func New(subscriptionID string) BaseClient { + return NewWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewWithBaseURI creates an instance of the BaseClient client. +func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { + return BaseClient{ + Client: autorest.NewClientWithUserAgent(UserAgent()), + BaseURI: baseURI, + SubscriptionID: subscriptionID, + } +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2016-12-01/backup/engines.go b/vendor/github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2016-12-01/backup/engines.go new file mode 100644 index 000000000..5100de301 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2016-12-01/backup/engines.go @@ -0,0 +1,220 @@ +package backup + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "net/http" +) + +// EnginesClient is the open API 2.0 Specs for Azure RecoveryServices Backup service +type EnginesClient struct { + BaseClient +} + +// NewEnginesClient creates an instance of the EnginesClient client. +func NewEnginesClient(subscriptionID string) EnginesClient { + return NewEnginesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewEnginesClientWithBaseURI creates an instance of the EnginesClient client. +func NewEnginesClientWithBaseURI(baseURI string, subscriptionID string) EnginesClient { + return EnginesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get returns backup management server registered to Recovery Services Vault. +// Parameters: +// vaultName - the name of the recovery services vault. +// resourceGroupName - the name of the resource group where the recovery services vault is present. +// backupEngineName - name of the backup management server. +// filter - oData filter options. +// skipToken - skipToken Filter. +func (client EnginesClient) Get(ctx context.Context, vaultName string, resourceGroupName string, backupEngineName string, filter string, skipToken string) (result EngineBaseResource, err error) { + req, err := client.GetPreparer(ctx, vaultName, resourceGroupName, backupEngineName, filter, skipToken) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.EnginesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "backup.EnginesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.EnginesClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client EnginesClient) GetPreparer(ctx context.Context, vaultName string, resourceGroupName string, backupEngineName string, filter string, skipToken string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "backupEngineName": autorest.Encode("path", backupEngineName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vaultName": autorest.Encode("path", vaultName), + } + + const APIVersion = "2016-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if len(skipToken) > 0 { + queryParameters["$skipToken"] = autorest.Encode("query", skipToken) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupEngines/{backupEngineName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client EnginesClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client EnginesClient) GetResponder(resp *http.Response) (result EngineBaseResource, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List backup management servers registered to Recovery Services Vault. Returns a pageable list of servers. +// Parameters: +// vaultName - the name of the recovery services vault. +// resourceGroupName - the name of the resource group where the recovery services vault is present. +// filter - oData filter options. +// skipToken - skipToken Filter. +func (client EnginesClient) List(ctx context.Context, vaultName string, resourceGroupName string, filter string, skipToken string) (result EngineBaseResourceListPage, err error) { + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, vaultName, resourceGroupName, filter, skipToken) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.EnginesClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.ebrl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "backup.EnginesClient", "List", resp, "Failure sending request") + return + } + + result.ebrl, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.EnginesClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client EnginesClient) ListPreparer(ctx context.Context, vaultName string, resourceGroupName string, filter string, skipToken string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vaultName": autorest.Encode("path", vaultName), + } + + const APIVersion = "2016-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if len(skipToken) > 0 { + queryParameters["$skipToken"] = autorest.Encode("query", skipToken) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupEngines", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client EnginesClient) ListSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client EnginesClient) ListResponder(resp *http.Response) (result EngineBaseResourceList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client EnginesClient) listNextResults(lastResults EngineBaseResourceList) (result EngineBaseResourceList, err error) { + req, err := lastResults.engineBaseResourceListPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "backup.EnginesClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "backup.EnginesClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.EnginesClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client EnginesClient) ListComplete(ctx context.Context, vaultName string, resourceGroupName string, filter string, skipToken string) (result EngineBaseResourceListIterator, err error) { + result.page, err = client.List(ctx, vaultName, resourceGroupName, filter, skipToken) + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2016-12-01/backup/itemlevelrecoveryconnections.go b/vendor/github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2016-12-01/backup/itemlevelrecoveryconnections.go new file mode 100644 index 000000000..75a1ff3d5 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2016-12-01/backup/itemlevelrecoveryconnections.go @@ -0,0 +1,197 @@ +package backup + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "net/http" +) + +// ItemLevelRecoveryConnectionsClient is the open API 2.0 Specs for Azure RecoveryServices Backup service +type ItemLevelRecoveryConnectionsClient struct { + BaseClient +} + +// NewItemLevelRecoveryConnectionsClient creates an instance of the ItemLevelRecoveryConnectionsClient client. +func NewItemLevelRecoveryConnectionsClient(subscriptionID string) ItemLevelRecoveryConnectionsClient { + return NewItemLevelRecoveryConnectionsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewItemLevelRecoveryConnectionsClientWithBaseURI creates an instance of the ItemLevelRecoveryConnectionsClient +// client. +func NewItemLevelRecoveryConnectionsClientWithBaseURI(baseURI string, subscriptionID string) ItemLevelRecoveryConnectionsClient { + return ItemLevelRecoveryConnectionsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Provision provisions a script which invokes an iSCSI connection to the backup data. Executing this script opens a +// file explorer displaying all the recoverable files and folders. This is an asynchronous operation. To know the +// status of provisioning, call GetProtectedItemOperationResult API. +// Parameters: +// vaultName - the name of the recovery services vault. +// resourceGroupName - the name of the resource group where the recovery services vault is present. +// fabricName - fabric name associated with the backed up items. +// containerName - container name associated with the backed up items. +// protectedItemName - backed up item name whose files/folders are to be restored. +// recoveryPointID - recovery point ID which represents backed up data. iSCSI connection will be provisioned +// for this backed up data. +// parameters - resource ILR request +func (client ItemLevelRecoveryConnectionsClient) Provision(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, recoveryPointID string, parameters ILRRequestResource) (result autorest.Response, err error) { + req, err := client.ProvisionPreparer(ctx, vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointID, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.ItemLevelRecoveryConnectionsClient", "Provision", nil, "Failure preparing request") + return + } + + resp, err := client.ProvisionSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "backup.ItemLevelRecoveryConnectionsClient", "Provision", resp, "Failure sending request") + return + } + + result, err = client.ProvisionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.ItemLevelRecoveryConnectionsClient", "Provision", resp, "Failure responding to request") + } + + return +} + +// ProvisionPreparer prepares the Provision request. +func (client ItemLevelRecoveryConnectionsClient) ProvisionPreparer(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, recoveryPointID string, parameters ILRRequestResource) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "containerName": autorest.Encode("path", containerName), + "fabricName": autorest.Encode("path", fabricName), + "protectedItemName": autorest.Encode("path", protectedItemName), + "recoveryPointId": autorest.Encode("path", recoveryPointID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vaultName": autorest.Encode("path", vaultName), + } + + const APIVersion = "2016-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointId}/provisionInstantItemRecovery", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ProvisionSender sends the Provision request. The method will close the +// http.Response Body if it receives an error. +func (client ItemLevelRecoveryConnectionsClient) ProvisionSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ProvisionResponder handles the response to the Provision request. The method always +// closes the http.Response Body. +func (client ItemLevelRecoveryConnectionsClient) ProvisionResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// Revoke revokes an iSCSI connection which can be used to download a script. Executing this script opens a file +// explorer displaying all recoverable files and folders. This is an asynchronous operation. +// Parameters: +// vaultName - the name of the recovery services vault. +// resourceGroupName - the name of the resource group where the recovery services vault is present. +// fabricName - fabric name associated with the backed up items. +// containerName - container name associated with the backed up items. +// protectedItemName - backed up item name whose files/folders are to be restored. +// recoveryPointID - recovery point ID which represents backed up data. iSCSI connection will be revoked for +// this backed up data. +func (client ItemLevelRecoveryConnectionsClient) Revoke(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, recoveryPointID string) (result autorest.Response, err error) { + req, err := client.RevokePreparer(ctx, vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointID) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.ItemLevelRecoveryConnectionsClient", "Revoke", nil, "Failure preparing request") + return + } + + resp, err := client.RevokeSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "backup.ItemLevelRecoveryConnectionsClient", "Revoke", resp, "Failure sending request") + return + } + + result, err = client.RevokeResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.ItemLevelRecoveryConnectionsClient", "Revoke", resp, "Failure responding to request") + } + + return +} + +// RevokePreparer prepares the Revoke request. +func (client ItemLevelRecoveryConnectionsClient) RevokePreparer(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, recoveryPointID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "containerName": autorest.Encode("path", containerName), + "fabricName": autorest.Encode("path", fabricName), + "protectedItemName": autorest.Encode("path", protectedItemName), + "recoveryPointId": autorest.Encode("path", recoveryPointID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vaultName": autorest.Encode("path", vaultName), + } + + const APIVersion = "2016-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointId}/revokeInstantItemRecovery", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RevokeSender sends the Revoke request. The method will close the +// http.Response Body if it receives an error. +func (client ItemLevelRecoveryConnectionsClient) RevokeSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// RevokeResponder handles the response to the Revoke request. The method always +// closes the http.Response Body. +func (client ItemLevelRecoveryConnectionsClient) RevokeResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2016-12-01/backup/jobcancellations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2016-12-01/backup/jobcancellations.go new file mode 100644 index 000000000..a1699e824 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2016-12-01/backup/jobcancellations.go @@ -0,0 +1,109 @@ +package backup + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "net/http" +) + +// JobCancellationsClient is the open API 2.0 Specs for Azure RecoveryServices Backup service +type JobCancellationsClient struct { + BaseClient +} + +// NewJobCancellationsClient creates an instance of the JobCancellationsClient client. +func NewJobCancellationsClient(subscriptionID string) JobCancellationsClient { + return NewJobCancellationsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewJobCancellationsClientWithBaseURI creates an instance of the JobCancellationsClient client. +func NewJobCancellationsClientWithBaseURI(baseURI string, subscriptionID string) JobCancellationsClient { + return JobCancellationsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Trigger cancels a job. This is an asynchronous operation. To know the status of the cancellation, call +// GetCancelOperationResult API. +// Parameters: +// vaultName - the name of the recovery services vault. +// resourceGroupName - the name of the resource group where the recovery services vault is present. +// jobName - name of the job to cancel. +func (client JobCancellationsClient) Trigger(ctx context.Context, vaultName string, resourceGroupName string, jobName string) (result autorest.Response, err error) { + req, err := client.TriggerPreparer(ctx, vaultName, resourceGroupName, jobName) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.JobCancellationsClient", "Trigger", nil, "Failure preparing request") + return + } + + resp, err := client.TriggerSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "backup.JobCancellationsClient", "Trigger", resp, "Failure sending request") + return + } + + result, err = client.TriggerResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.JobCancellationsClient", "Trigger", resp, "Failure responding to request") + } + + return +} + +// TriggerPreparer prepares the Trigger request. +func (client JobCancellationsClient) TriggerPreparer(ctx context.Context, vaultName string, resourceGroupName string, jobName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "jobName": autorest.Encode("path", jobName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vaultName": autorest.Encode("path", vaultName), + } + + const APIVersion = "2016-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupJobs/{jobName}/cancel", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// TriggerSender sends the Trigger request. The method will close the +// http.Response Body if it receives an error. +func (client JobCancellationsClient) TriggerSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// TriggerResponder handles the response to the Trigger request. The method always +// closes the http.Response Body. +func (client JobCancellationsClient) TriggerResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2016-12-01/backup/joboperationresults.go b/vendor/github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2016-12-01/backup/joboperationresults.go new file mode 100644 index 000000000..b706cdff9 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2016-12-01/backup/joboperationresults.go @@ -0,0 +1,111 @@ +package backup + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "net/http" +) + +// JobOperationResultsClient is the open API 2.0 Specs for Azure RecoveryServices Backup service +type JobOperationResultsClient struct { + BaseClient +} + +// NewJobOperationResultsClient creates an instance of the JobOperationResultsClient client. +func NewJobOperationResultsClient(subscriptionID string) JobOperationResultsClient { + return NewJobOperationResultsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewJobOperationResultsClientWithBaseURI creates an instance of the JobOperationResultsClient client. +func NewJobOperationResultsClientWithBaseURI(baseURI string, subscriptionID string) JobOperationResultsClient { + return JobOperationResultsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get fetches the result of any operation. +// the operation. +// Parameters: +// vaultName - the name of the recovery services vault. +// resourceGroupName - the name of the resource group where the recovery services vault is present. +// jobName - job name whose operation result has to be fetched. +// operationID - operationID which represents the operation whose result has to be fetched. +func (client JobOperationResultsClient) Get(ctx context.Context, vaultName string, resourceGroupName string, jobName string, operationID string) (result autorest.Response, err error) { + req, err := client.GetPreparer(ctx, vaultName, resourceGroupName, jobName, operationID) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.JobOperationResultsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "backup.JobOperationResultsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.JobOperationResultsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client JobOperationResultsClient) GetPreparer(ctx context.Context, vaultName string, resourceGroupName string, jobName string, operationID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "jobName": autorest.Encode("path", jobName), + "operationId": autorest.Encode("path", operationID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vaultName": autorest.Encode("path", vaultName), + } + + const APIVersion = "2016-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupJobs/{jobName}/operationResults/{operationId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client JobOperationResultsClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client JobOperationResultsClient) GetResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2016-12-01/backup/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2016-12-01/backup/models.go new file mode 100644 index 000000000..bbb373cba --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2016-12-01/backup/models.go @@ -0,0 +1,15114 @@ +package backup + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "encoding/json" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/date" + "github.com/Azure/go-autorest/autorest/to" + "net/http" +) + +// AzureFileShareType enumerates the values for azure file share type. +type AzureFileShareType string + +const ( + // Invalid ... + Invalid AzureFileShareType = "Invalid" + // XSMB ... + XSMB AzureFileShareType = "XSMB" + // XSync ... + XSync AzureFileShareType = "XSync" +) + +// PossibleAzureFileShareTypeValues returns an array of possible values for the AzureFileShareType const type. +func PossibleAzureFileShareTypeValues() []AzureFileShareType { + return []AzureFileShareType{Invalid, XSMB, XSync} +} + +// ContainerType enumerates the values for container type. +type ContainerType string + +const ( + // ContainerTypeAzureBackupServerContainer ... + ContainerTypeAzureBackupServerContainer ContainerType = "AzureBackupServerContainer" + // ContainerTypeAzureSQLContainer ... + ContainerTypeAzureSQLContainer ContainerType = "AzureSqlContainer" + // ContainerTypeCluster ... + ContainerTypeCluster ContainerType = "Cluster" + // ContainerTypeDPMContainer ... + ContainerTypeDPMContainer ContainerType = "DPMContainer" + // ContainerTypeExchangeDAG ... + ContainerTypeExchangeDAG ContainerType = "ExchangeDAG" + // ContainerTypeGenericContainer ... + ContainerTypeGenericContainer ContainerType = "GenericContainer" + // ContainerTypeHyperVCluster ... + ContainerTypeHyperVCluster ContainerType = "HyperVCluster" + // ContainerTypeIaasVMContainer ... + ContainerTypeIaasVMContainer ContainerType = "IaasVMContainer" + // ContainerTypeIaasVMServiceContainer ... + ContainerTypeIaasVMServiceContainer ContainerType = "IaasVMServiceContainer" + // ContainerTypeInvalid ... + ContainerTypeInvalid ContainerType = "Invalid" + // ContainerTypeMABContainer ... + ContainerTypeMABContainer ContainerType = "MABContainer" + // ContainerTypeSharepointFarm ... + ContainerTypeSharepointFarm ContainerType = "SharepointFarm" + // ContainerTypeSQLAGWorkLoadContainer ... + ContainerTypeSQLAGWorkLoadContainer ContainerType = "SQLAGWorkLoadContainer" + // ContainerTypeSQLCluster ... + ContainerTypeSQLCluster ContainerType = "SqlCluster" + // ContainerTypeStorageContainer ... + ContainerTypeStorageContainer ContainerType = "StorageContainer" + // ContainerTypeUnknown ... + ContainerTypeUnknown ContainerType = "Unknown" + // ContainerTypeVCenter ... + ContainerTypeVCenter ContainerType = "VCenter" + // ContainerTypeVMAppContainer ... + ContainerTypeVMAppContainer ContainerType = "VMAppContainer" + // ContainerTypeWindows ... + ContainerTypeWindows ContainerType = "Windows" + // ContainerTypeWindowsClient ... + ContainerTypeWindowsClient ContainerType = "WindowsClient" +) + +// PossibleContainerTypeValues returns an array of possible values for the ContainerType const type. +func PossibleContainerTypeValues() []ContainerType { + return []ContainerType{ContainerTypeAzureBackupServerContainer, ContainerTypeAzureSQLContainer, ContainerTypeCluster, ContainerTypeDPMContainer, ContainerTypeExchangeDAG, ContainerTypeGenericContainer, ContainerTypeHyperVCluster, ContainerTypeIaasVMContainer, ContainerTypeIaasVMServiceContainer, ContainerTypeInvalid, ContainerTypeMABContainer, ContainerTypeSharepointFarm, ContainerTypeSQLAGWorkLoadContainer, ContainerTypeSQLCluster, ContainerTypeStorageContainer, ContainerTypeUnknown, ContainerTypeVCenter, ContainerTypeVMAppContainer, ContainerTypeWindows, ContainerTypeWindowsClient} +} + +// ContainerTypeBasicProtectionContainer enumerates the values for container type basic protection container. +type ContainerTypeBasicProtectionContainer string + +const ( + // ContainerTypeAzureBackupServerContainer1 ... + ContainerTypeAzureBackupServerContainer1 ContainerTypeBasicProtectionContainer = "AzureBackupServerContainer" + // ContainerTypeAzureSQLContainer1 ... + ContainerTypeAzureSQLContainer1 ContainerTypeBasicProtectionContainer = "AzureSqlContainer" + // ContainerTypeAzureWorkloadContainer ... + ContainerTypeAzureWorkloadContainer ContainerTypeBasicProtectionContainer = "AzureWorkloadContainer" + // ContainerTypeDPMContainer1 ... + ContainerTypeDPMContainer1 ContainerTypeBasicProtectionContainer = "DPMContainer" + // ContainerTypeGenericContainer1 ... + ContainerTypeGenericContainer1 ContainerTypeBasicProtectionContainer = "GenericContainer" + // ContainerTypeIaaSVMContainer ... + ContainerTypeIaaSVMContainer ContainerTypeBasicProtectionContainer = "IaaSVMContainer" + // ContainerTypeMicrosoftClassicComputevirtualMachines ... + ContainerTypeMicrosoftClassicComputevirtualMachines ContainerTypeBasicProtectionContainer = "Microsoft.ClassicCompute/virtualMachines" + // ContainerTypeMicrosoftComputevirtualMachines ... + ContainerTypeMicrosoftComputevirtualMachines ContainerTypeBasicProtectionContainer = "Microsoft.Compute/virtualMachines" + // ContainerTypeProtectionContainer ... + ContainerTypeProtectionContainer ContainerTypeBasicProtectionContainer = "ProtectionContainer" + // ContainerTypeSQLAGWorkLoadContainer1 ... + ContainerTypeSQLAGWorkLoadContainer1 ContainerTypeBasicProtectionContainer = "SQLAGWorkLoadContainer" + // ContainerTypeStorageContainer1 ... + ContainerTypeStorageContainer1 ContainerTypeBasicProtectionContainer = "StorageContainer" + // ContainerTypeVMAppContainer1 ... + ContainerTypeVMAppContainer1 ContainerTypeBasicProtectionContainer = "VMAppContainer" + // ContainerTypeWindows1 ... + ContainerTypeWindows1 ContainerTypeBasicProtectionContainer = "Windows" +) + +// PossibleContainerTypeBasicProtectionContainerValues returns an array of possible values for the ContainerTypeBasicProtectionContainer const type. +func PossibleContainerTypeBasicProtectionContainerValues() []ContainerTypeBasicProtectionContainer { + return []ContainerTypeBasicProtectionContainer{ContainerTypeAzureBackupServerContainer1, ContainerTypeAzureSQLContainer1, ContainerTypeAzureWorkloadContainer, ContainerTypeDPMContainer1, ContainerTypeGenericContainer1, ContainerTypeIaaSVMContainer, ContainerTypeMicrosoftClassicComputevirtualMachines, ContainerTypeMicrosoftComputevirtualMachines, ContainerTypeProtectionContainer, ContainerTypeSQLAGWorkLoadContainer1, ContainerTypeStorageContainer1, ContainerTypeVMAppContainer1, ContainerTypeWindows1} +} + +// CopyOptions enumerates the values for copy options. +type CopyOptions string + +const ( + // CopyOptionsCreateCopy ... + CopyOptionsCreateCopy CopyOptions = "CreateCopy" + // CopyOptionsFailOnConflict ... + CopyOptionsFailOnConflict CopyOptions = "FailOnConflict" + // CopyOptionsInvalid ... + CopyOptionsInvalid CopyOptions = "Invalid" + // CopyOptionsOverwrite ... + CopyOptionsOverwrite CopyOptions = "Overwrite" + // CopyOptionsSkip ... + CopyOptionsSkip CopyOptions = "Skip" +) + +// PossibleCopyOptionsValues returns an array of possible values for the CopyOptions const type. +func PossibleCopyOptionsValues() []CopyOptions { + return []CopyOptions{CopyOptionsCreateCopy, CopyOptionsFailOnConflict, CopyOptionsInvalid, CopyOptionsOverwrite, CopyOptionsSkip} +} + +// CreateMode enumerates the values for create mode. +type CreateMode string + +const ( + // CreateModeDefault ... + CreateModeDefault CreateMode = "Default" + // CreateModeInvalid ... + CreateModeInvalid CreateMode = "Invalid" + // CreateModeRecover ... + CreateModeRecover CreateMode = "Recover" +) + +// PossibleCreateModeValues returns an array of possible values for the CreateMode const type. +func PossibleCreateModeValues() []CreateMode { + return []CreateMode{CreateModeDefault, CreateModeInvalid, CreateModeRecover} +} + +// DataSourceType enumerates the values for data source type. +type DataSourceType string + +const ( + // DataSourceTypeAzureFileShare ... + DataSourceTypeAzureFileShare DataSourceType = "AzureFileShare" + // DataSourceTypeAzureSQLDb ... + DataSourceTypeAzureSQLDb DataSourceType = "AzureSqlDb" + // DataSourceTypeClient ... + DataSourceTypeClient DataSourceType = "Client" + // DataSourceTypeExchange ... + DataSourceTypeExchange DataSourceType = "Exchange" + // DataSourceTypeFileFolder ... + DataSourceTypeFileFolder DataSourceType = "FileFolder" + // DataSourceTypeGenericDataSource ... + DataSourceTypeGenericDataSource DataSourceType = "GenericDataSource" + // DataSourceTypeInvalid ... + DataSourceTypeInvalid DataSourceType = "Invalid" + // DataSourceTypeSAPHanaDatabase ... + DataSourceTypeSAPHanaDatabase DataSourceType = "SAPHanaDatabase" + // DataSourceTypeSharepoint ... + DataSourceTypeSharepoint DataSourceType = "Sharepoint" + // DataSourceTypeSQLDataBase ... + DataSourceTypeSQLDataBase DataSourceType = "SQLDataBase" + // DataSourceTypeSQLDB ... + DataSourceTypeSQLDB DataSourceType = "SQLDB" + // DataSourceTypeSystemState ... + DataSourceTypeSystemState DataSourceType = "SystemState" + // DataSourceTypeVM ... + DataSourceTypeVM DataSourceType = "VM" + // DataSourceTypeVMwareVM ... + DataSourceTypeVMwareVM DataSourceType = "VMwareVM" +) + +// PossibleDataSourceTypeValues returns an array of possible values for the DataSourceType const type. +func PossibleDataSourceTypeValues() []DataSourceType { + return []DataSourceType{DataSourceTypeAzureFileShare, DataSourceTypeAzureSQLDb, DataSourceTypeClient, DataSourceTypeExchange, DataSourceTypeFileFolder, DataSourceTypeGenericDataSource, DataSourceTypeInvalid, DataSourceTypeSAPHanaDatabase, DataSourceTypeSharepoint, DataSourceTypeSQLDataBase, DataSourceTypeSQLDB, DataSourceTypeSystemState, DataSourceTypeVM, DataSourceTypeVMwareVM} +} + +// DayOfWeek enumerates the values for day of week. +type DayOfWeek string + +const ( + // Friday ... + Friday DayOfWeek = "Friday" + // Monday ... + Monday DayOfWeek = "Monday" + // Saturday ... + Saturday DayOfWeek = "Saturday" + // Sunday ... + Sunday DayOfWeek = "Sunday" + // Thursday ... + Thursday DayOfWeek = "Thursday" + // Tuesday ... + Tuesday DayOfWeek = "Tuesday" + // Wednesday ... + Wednesday DayOfWeek = "Wednesday" +) + +// PossibleDayOfWeekValues returns an array of possible values for the DayOfWeek const type. +func PossibleDayOfWeekValues() []DayOfWeek { + return []DayOfWeek{Friday, Monday, Saturday, Sunday, Thursday, Tuesday, Wednesday} +} + +// EngineType enumerates the values for engine type. +type EngineType string + +const ( + // BackupEngineTypeAzureBackupServerEngine ... + BackupEngineTypeAzureBackupServerEngine EngineType = "AzureBackupServerEngine" + // BackupEngineTypeBackupEngineBase ... + BackupEngineTypeBackupEngineBase EngineType = "BackupEngineBase" + // BackupEngineTypeDpmBackupEngine ... + BackupEngineTypeDpmBackupEngine EngineType = "DpmBackupEngine" +) + +// PossibleEngineTypeValues returns an array of possible values for the EngineType const type. +func PossibleEngineTypeValues() []EngineType { + return []EngineType{BackupEngineTypeAzureBackupServerEngine, BackupEngineTypeBackupEngineBase, BackupEngineTypeDpmBackupEngine} +} + +// EnhancedSecurityState enumerates the values for enhanced security state. +type EnhancedSecurityState string + +const ( + // EnhancedSecurityStateDisabled ... + EnhancedSecurityStateDisabled EnhancedSecurityState = "Disabled" + // EnhancedSecurityStateEnabled ... + EnhancedSecurityStateEnabled EnhancedSecurityState = "Enabled" + // EnhancedSecurityStateInvalid ... + EnhancedSecurityStateInvalid EnhancedSecurityState = "Invalid" +) + +// PossibleEnhancedSecurityStateValues returns an array of possible values for the EnhancedSecurityState const type. +func PossibleEnhancedSecurityStateValues() []EnhancedSecurityState { + return []EnhancedSecurityState{EnhancedSecurityStateDisabled, EnhancedSecurityStateEnabled, EnhancedSecurityStateInvalid} +} + +// HealthStatus enumerates the values for health status. +type HealthStatus string + +const ( + // HealthStatusActionRequired ... + HealthStatusActionRequired HealthStatus = "ActionRequired" + // HealthStatusActionSuggested ... + HealthStatusActionSuggested HealthStatus = "ActionSuggested" + // HealthStatusInvalid ... + HealthStatusInvalid HealthStatus = "Invalid" + // HealthStatusPassed ... + HealthStatusPassed HealthStatus = "Passed" +) + +// PossibleHealthStatusValues returns an array of possible values for the HealthStatus const type. +func PossibleHealthStatusValues() []HealthStatus { + return []HealthStatus{HealthStatusActionRequired, HealthStatusActionSuggested, HealthStatusInvalid, HealthStatusPassed} +} + +// InquiryStatus enumerates the values for inquiry status. +type InquiryStatus string + +const ( + // InquiryStatusFailed ... + InquiryStatusFailed InquiryStatus = "Failed" + // InquiryStatusInvalid ... + InquiryStatusInvalid InquiryStatus = "Invalid" + // InquiryStatusSuccess ... + InquiryStatusSuccess InquiryStatus = "Success" +) + +// PossibleInquiryStatusValues returns an array of possible values for the InquiryStatus const type. +func PossibleInquiryStatusValues() []InquiryStatus { + return []InquiryStatus{InquiryStatusFailed, InquiryStatusInvalid, InquiryStatusSuccess} +} + +// ItemType enumerates the values for item type. +type ItemType string + +const ( + // ItemTypeAzureFileShare ... + ItemTypeAzureFileShare ItemType = "AzureFileShare" + // ItemTypeAzureSQLDb ... + ItemTypeAzureSQLDb ItemType = "AzureSqlDb" + // ItemTypeClient ... + ItemTypeClient ItemType = "Client" + // ItemTypeExchange ... + ItemTypeExchange ItemType = "Exchange" + // ItemTypeFileFolder ... + ItemTypeFileFolder ItemType = "FileFolder" + // ItemTypeGenericDataSource ... + ItemTypeGenericDataSource ItemType = "GenericDataSource" + // ItemTypeInvalid ... + ItemTypeInvalid ItemType = "Invalid" + // ItemTypeSAPHanaDatabase ... + ItemTypeSAPHanaDatabase ItemType = "SAPHanaDatabase" + // ItemTypeSharepoint ... + ItemTypeSharepoint ItemType = "Sharepoint" + // ItemTypeSQLDataBase ... + ItemTypeSQLDataBase ItemType = "SQLDataBase" + // ItemTypeSQLDB ... + ItemTypeSQLDB ItemType = "SQLDB" + // ItemTypeSystemState ... + ItemTypeSystemState ItemType = "SystemState" + // ItemTypeVM ... + ItemTypeVM ItemType = "VM" + // ItemTypeVMwareVM ... + ItemTypeVMwareVM ItemType = "VMwareVM" +) + +// PossibleItemTypeValues returns an array of possible values for the ItemType const type. +func PossibleItemTypeValues() []ItemType { + return []ItemType{ItemTypeAzureFileShare, ItemTypeAzureSQLDb, ItemTypeClient, ItemTypeExchange, ItemTypeFileFolder, ItemTypeGenericDataSource, ItemTypeInvalid, ItemTypeSAPHanaDatabase, ItemTypeSharepoint, ItemTypeSQLDataBase, ItemTypeSQLDB, ItemTypeSystemState, ItemTypeVM, ItemTypeVMwareVM} +} + +// LastBackupStatus enumerates the values for last backup status. +type LastBackupStatus string + +const ( + // LastBackupStatusHealthy ... + LastBackupStatusHealthy LastBackupStatus = "Healthy" + // LastBackupStatusInvalid ... + LastBackupStatusInvalid LastBackupStatus = "Invalid" + // LastBackupStatusIRPending ... + LastBackupStatusIRPending LastBackupStatus = "IRPending" + // LastBackupStatusUnhealthy ... + LastBackupStatusUnhealthy LastBackupStatus = "Unhealthy" +) + +// PossibleLastBackupStatusValues returns an array of possible values for the LastBackupStatus const type. +func PossibleLastBackupStatusValues() []LastBackupStatus { + return []LastBackupStatus{LastBackupStatusHealthy, LastBackupStatusInvalid, LastBackupStatusIRPending, LastBackupStatusUnhealthy} +} + +// ManagementType enumerates the values for management type. +type ManagementType string + +const ( + // ManagementTypeAzureBackupServer ... + ManagementTypeAzureBackupServer ManagementType = "AzureBackupServer" + // ManagementTypeAzureIaasVM ... + ManagementTypeAzureIaasVM ManagementType = "AzureIaasVM" + // ManagementTypeAzureSQL ... + ManagementTypeAzureSQL ManagementType = "AzureSql" + // ManagementTypeAzureStorage ... + ManagementTypeAzureStorage ManagementType = "AzureStorage" + // ManagementTypeAzureWorkload ... + ManagementTypeAzureWorkload ManagementType = "AzureWorkload" + // ManagementTypeDefaultBackup ... + ManagementTypeDefaultBackup ManagementType = "DefaultBackup" + // ManagementTypeDPM ... + ManagementTypeDPM ManagementType = "DPM" + // ManagementTypeInvalid ... + ManagementTypeInvalid ManagementType = "Invalid" + // ManagementTypeMAB ... + ManagementTypeMAB ManagementType = "MAB" +) + +// PossibleManagementTypeValues returns an array of possible values for the ManagementType const type. +func PossibleManagementTypeValues() []ManagementType { + return []ManagementType{ManagementTypeAzureBackupServer, ManagementTypeAzureIaasVM, ManagementTypeAzureSQL, ManagementTypeAzureStorage, ManagementTypeAzureWorkload, ManagementTypeDefaultBackup, ManagementTypeDPM, ManagementTypeInvalid, ManagementTypeMAB} +} + +// ManagementTypeBasicProtectionPolicy enumerates the values for management type basic protection policy. +type ManagementTypeBasicProtectionPolicy string + +const ( + // BackupManagementTypeAzureIaasVM ... + BackupManagementTypeAzureIaasVM ManagementTypeBasicProtectionPolicy = "AzureIaasVM" + // BackupManagementTypeAzureSQL ... + BackupManagementTypeAzureSQL ManagementTypeBasicProtectionPolicy = "AzureSql" + // BackupManagementTypeAzureStorage ... + BackupManagementTypeAzureStorage ManagementTypeBasicProtectionPolicy = "AzureStorage" + // BackupManagementTypeAzureWorkload ... + BackupManagementTypeAzureWorkload ManagementTypeBasicProtectionPolicy = "AzureWorkload" + // BackupManagementTypeGenericProtectionPolicy ... + BackupManagementTypeGenericProtectionPolicy ManagementTypeBasicProtectionPolicy = "GenericProtectionPolicy" + // BackupManagementTypeMAB ... + BackupManagementTypeMAB ManagementTypeBasicProtectionPolicy = "MAB" + // BackupManagementTypeProtectionPolicy ... + BackupManagementTypeProtectionPolicy ManagementTypeBasicProtectionPolicy = "ProtectionPolicy" +) + +// PossibleManagementTypeBasicProtectionPolicyValues returns an array of possible values for the ManagementTypeBasicProtectionPolicy const type. +func PossibleManagementTypeBasicProtectionPolicyValues() []ManagementTypeBasicProtectionPolicy { + return []ManagementTypeBasicProtectionPolicy{BackupManagementTypeAzureIaasVM, BackupManagementTypeAzureSQL, BackupManagementTypeAzureStorage, BackupManagementTypeAzureWorkload, BackupManagementTypeGenericProtectionPolicy, BackupManagementTypeMAB, BackupManagementTypeProtectionPolicy} +} + +// MonthOfYear enumerates the values for month of year. +type MonthOfYear string + +const ( + // MonthOfYearApril ... + MonthOfYearApril MonthOfYear = "April" + // MonthOfYearAugust ... + MonthOfYearAugust MonthOfYear = "August" + // MonthOfYearDecember ... + MonthOfYearDecember MonthOfYear = "December" + // MonthOfYearFebruary ... + MonthOfYearFebruary MonthOfYear = "February" + // MonthOfYearInvalid ... + MonthOfYearInvalid MonthOfYear = "Invalid" + // MonthOfYearJanuary ... + MonthOfYearJanuary MonthOfYear = "January" + // MonthOfYearJuly ... + MonthOfYearJuly MonthOfYear = "July" + // MonthOfYearJune ... + MonthOfYearJune MonthOfYear = "June" + // MonthOfYearMarch ... + MonthOfYearMarch MonthOfYear = "March" + // MonthOfYearMay ... + MonthOfYearMay MonthOfYear = "May" + // MonthOfYearNovember ... + MonthOfYearNovember MonthOfYear = "November" + // MonthOfYearOctober ... + MonthOfYearOctober MonthOfYear = "October" + // MonthOfYearSeptember ... + MonthOfYearSeptember MonthOfYear = "September" +) + +// PossibleMonthOfYearValues returns an array of possible values for the MonthOfYear const type. +func PossibleMonthOfYearValues() []MonthOfYear { + return []MonthOfYear{MonthOfYearApril, MonthOfYearAugust, MonthOfYearDecember, MonthOfYearFebruary, MonthOfYearInvalid, MonthOfYearJanuary, MonthOfYearJuly, MonthOfYearJune, MonthOfYearMarch, MonthOfYearMay, MonthOfYearNovember, MonthOfYearOctober, MonthOfYearSeptember} +} + +// ObjectType enumerates the values for object type. +type ObjectType string + +const ( + // ObjectTypeAzureFileShareBackupRequest ... + ObjectTypeAzureFileShareBackupRequest ObjectType = "AzureFileShareBackupRequest" + // ObjectTypeAzureWorkloadBackupRequest ... + ObjectTypeAzureWorkloadBackupRequest ObjectType = "AzureWorkloadBackupRequest" + // ObjectTypeBackupRequest ... + ObjectTypeBackupRequest ObjectType = "BackupRequest" + // ObjectTypeIaasVMBackupRequest ... + ObjectTypeIaasVMBackupRequest ObjectType = "IaasVMBackupRequest" +) + +// PossibleObjectTypeValues returns an array of possible values for the ObjectType const type. +func PossibleObjectTypeValues() []ObjectType { + return []ObjectType{ObjectTypeAzureFileShareBackupRequest, ObjectTypeAzureWorkloadBackupRequest, ObjectTypeBackupRequest, ObjectTypeIaasVMBackupRequest} +} + +// ObjectTypeBasicILRRequest enumerates the values for object type basic ilr request. +type ObjectTypeBasicILRRequest string + +const ( + // ObjectTypeIaasVMILRRegistrationRequest ... + ObjectTypeIaasVMILRRegistrationRequest ObjectTypeBasicILRRequest = "IaasVMILRRegistrationRequest" + // ObjectTypeILRRequest ... + ObjectTypeILRRequest ObjectTypeBasicILRRequest = "ILRRequest" +) + +// PossibleObjectTypeBasicILRRequestValues returns an array of possible values for the ObjectTypeBasicILRRequest const type. +func PossibleObjectTypeBasicILRRequestValues() []ObjectTypeBasicILRRequest { + return []ObjectTypeBasicILRRequest{ObjectTypeIaasVMILRRegistrationRequest, ObjectTypeILRRequest} +} + +// ObjectTypeBasicOperationStatusExtendedInfo enumerates the values for object type basic operation status +// extended info. +type ObjectTypeBasicOperationStatusExtendedInfo string + +const ( + // ObjectTypeOperationStatusExtendedInfo ... + ObjectTypeOperationStatusExtendedInfo ObjectTypeBasicOperationStatusExtendedInfo = "OperationStatusExtendedInfo" + // ObjectTypeOperationStatusJobExtendedInfo ... + ObjectTypeOperationStatusJobExtendedInfo ObjectTypeBasicOperationStatusExtendedInfo = "OperationStatusJobExtendedInfo" + // ObjectTypeOperationStatusJobsExtendedInfo ... + ObjectTypeOperationStatusJobsExtendedInfo ObjectTypeBasicOperationStatusExtendedInfo = "OperationStatusJobsExtendedInfo" + // ObjectTypeOperationStatusProvisionILRExtendedInfo ... + ObjectTypeOperationStatusProvisionILRExtendedInfo ObjectTypeBasicOperationStatusExtendedInfo = "OperationStatusProvisionILRExtendedInfo" +) + +// PossibleObjectTypeBasicOperationStatusExtendedInfoValues returns an array of possible values for the ObjectTypeBasicOperationStatusExtendedInfo const type. +func PossibleObjectTypeBasicOperationStatusExtendedInfoValues() []ObjectTypeBasicOperationStatusExtendedInfo { + return []ObjectTypeBasicOperationStatusExtendedInfo{ObjectTypeOperationStatusExtendedInfo, ObjectTypeOperationStatusJobExtendedInfo, ObjectTypeOperationStatusJobsExtendedInfo, ObjectTypeOperationStatusProvisionILRExtendedInfo} +} + +// ObjectTypeBasicRecoveryPoint enumerates the values for object type basic recovery point. +type ObjectTypeBasicRecoveryPoint string + +const ( + // ObjectTypeAzureFileShareRecoveryPoint ... + ObjectTypeAzureFileShareRecoveryPoint ObjectTypeBasicRecoveryPoint = "AzureFileShareRecoveryPoint" + // ObjectTypeAzureWorkloadRecoveryPoint ... + ObjectTypeAzureWorkloadRecoveryPoint ObjectTypeBasicRecoveryPoint = "AzureWorkloadRecoveryPoint" + // ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint ... + ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint ObjectTypeBasicRecoveryPoint = "AzureWorkloadSAPHanaPointInTimeRecoveryPoint" + // ObjectTypeAzureWorkloadSAPHanaRecoveryPoint ... + ObjectTypeAzureWorkloadSAPHanaRecoveryPoint ObjectTypeBasicRecoveryPoint = "AzureWorkloadSAPHanaRecoveryPoint" + // ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint ... + ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint ObjectTypeBasicRecoveryPoint = "AzureWorkloadSQLPointInTimeRecoveryPoint" + // ObjectTypeAzureWorkloadSQLRecoveryPoint ... + ObjectTypeAzureWorkloadSQLRecoveryPoint ObjectTypeBasicRecoveryPoint = "AzureWorkloadSQLRecoveryPoint" + // ObjectTypeGenericRecoveryPoint ... + ObjectTypeGenericRecoveryPoint ObjectTypeBasicRecoveryPoint = "GenericRecoveryPoint" + // ObjectTypeIaasVMRecoveryPoint ... + ObjectTypeIaasVMRecoveryPoint ObjectTypeBasicRecoveryPoint = "IaasVMRecoveryPoint" + // ObjectTypeRecoveryPoint ... + ObjectTypeRecoveryPoint ObjectTypeBasicRecoveryPoint = "RecoveryPoint" +) + +// PossibleObjectTypeBasicRecoveryPointValues returns an array of possible values for the ObjectTypeBasicRecoveryPoint const type. +func PossibleObjectTypeBasicRecoveryPointValues() []ObjectTypeBasicRecoveryPoint { + return []ObjectTypeBasicRecoveryPoint{ObjectTypeAzureFileShareRecoveryPoint, ObjectTypeAzureWorkloadRecoveryPoint, ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint, ObjectTypeAzureWorkloadSAPHanaRecoveryPoint, ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint, ObjectTypeAzureWorkloadSQLRecoveryPoint, ObjectTypeGenericRecoveryPoint, ObjectTypeIaasVMRecoveryPoint, ObjectTypeRecoveryPoint} +} + +// ObjectTypeBasicRestoreRequest enumerates the values for object type basic restore request. +type ObjectTypeBasicRestoreRequest string + +const ( + // ObjectTypeAzureFileShareRestoreRequest ... + ObjectTypeAzureFileShareRestoreRequest ObjectTypeBasicRestoreRequest = "AzureFileShareRestoreRequest" + // ObjectTypeAzureWorkloadRestoreRequest ... + ObjectTypeAzureWorkloadRestoreRequest ObjectTypeBasicRestoreRequest = "AzureWorkloadRestoreRequest" + // ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest ... + ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest ObjectTypeBasicRestoreRequest = "AzureWorkloadSAPHanaPointInTimeRestoreRequest" + // ObjectTypeAzureWorkloadSAPHanaRestoreRequest ... + ObjectTypeAzureWorkloadSAPHanaRestoreRequest ObjectTypeBasicRestoreRequest = "AzureWorkloadSAPHanaRestoreRequest" + // ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest ... + ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest ObjectTypeBasicRestoreRequest = "AzureWorkloadSQLPointInTimeRestoreRequest" + // ObjectTypeAzureWorkloadSQLRestoreRequest ... + ObjectTypeAzureWorkloadSQLRestoreRequest ObjectTypeBasicRestoreRequest = "AzureWorkloadSQLRestoreRequest" + // ObjectTypeIaasVMRestoreRequest ... + ObjectTypeIaasVMRestoreRequest ObjectTypeBasicRestoreRequest = "IaasVMRestoreRequest" + // ObjectTypeRestoreRequest ... + ObjectTypeRestoreRequest ObjectTypeBasicRestoreRequest = "RestoreRequest" +) + +// PossibleObjectTypeBasicRestoreRequestValues returns an array of possible values for the ObjectTypeBasicRestoreRequest const type. +func PossibleObjectTypeBasicRestoreRequestValues() []ObjectTypeBasicRestoreRequest { + return []ObjectTypeBasicRestoreRequest{ObjectTypeAzureFileShareRestoreRequest, ObjectTypeAzureWorkloadRestoreRequest, ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest, ObjectTypeAzureWorkloadSAPHanaRestoreRequest, ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest, ObjectTypeAzureWorkloadSQLRestoreRequest, ObjectTypeIaasVMRestoreRequest, ObjectTypeRestoreRequest} +} + +// OperationStatusValues enumerates the values for operation status values. +type OperationStatusValues string + +const ( + // OperationStatusValuesCanceled ... + OperationStatusValuesCanceled OperationStatusValues = "Canceled" + // OperationStatusValuesFailed ... + OperationStatusValuesFailed OperationStatusValues = "Failed" + // OperationStatusValuesInProgress ... + OperationStatusValuesInProgress OperationStatusValues = "InProgress" + // OperationStatusValuesInvalid ... + OperationStatusValuesInvalid OperationStatusValues = "Invalid" + // OperationStatusValuesSucceeded ... + OperationStatusValuesSucceeded OperationStatusValues = "Succeeded" +) + +// PossibleOperationStatusValuesValues returns an array of possible values for the OperationStatusValues const type. +func PossibleOperationStatusValuesValues() []OperationStatusValues { + return []OperationStatusValues{OperationStatusValuesCanceled, OperationStatusValuesFailed, OperationStatusValuesInProgress, OperationStatusValuesInvalid, OperationStatusValuesSucceeded} +} + +// OverwriteOptions enumerates the values for overwrite options. +type OverwriteOptions string + +const ( + // OverwriteOptionsFailOnConflict ... + OverwriteOptionsFailOnConflict OverwriteOptions = "FailOnConflict" + // OverwriteOptionsInvalid ... + OverwriteOptionsInvalid OverwriteOptions = "Invalid" + // OverwriteOptionsOverwrite ... + OverwriteOptionsOverwrite OverwriteOptions = "Overwrite" +) + +// PossibleOverwriteOptionsValues returns an array of possible values for the OverwriteOptions const type. +func PossibleOverwriteOptionsValues() []OverwriteOptions { + return []OverwriteOptions{OverwriteOptionsFailOnConflict, OverwriteOptionsInvalid, OverwriteOptionsOverwrite} +} + +// ProtectableContainerType enumerates the values for protectable container type. +type ProtectableContainerType string + +const ( + // ProtectableContainerTypeProtectableContainer ... + ProtectableContainerTypeProtectableContainer ProtectableContainerType = "ProtectableContainer" + // ProtectableContainerTypeStorageContainer ... + ProtectableContainerTypeStorageContainer ProtectableContainerType = "StorageContainer" + // ProtectableContainerTypeVMAppContainer ... + ProtectableContainerTypeVMAppContainer ProtectableContainerType = "VMAppContainer" +) + +// PossibleProtectableContainerTypeValues returns an array of possible values for the ProtectableContainerType const type. +func PossibleProtectableContainerTypeValues() []ProtectableContainerType { + return []ProtectableContainerType{ProtectableContainerTypeProtectableContainer, ProtectableContainerTypeStorageContainer, ProtectableContainerTypeVMAppContainer} +} + +// ProtectableItemType enumerates the values for protectable item type. +type ProtectableItemType string + +const ( + // ProtectableItemTypeAzureFileShare ... + ProtectableItemTypeAzureFileShare ProtectableItemType = "AzureFileShare" + // ProtectableItemTypeAzureVMWorkloadProtectableItem ... + ProtectableItemTypeAzureVMWorkloadProtectableItem ProtectableItemType = "AzureVmWorkloadProtectableItem" + // ProtectableItemTypeIaaSVMProtectableItem ... + ProtectableItemTypeIaaSVMProtectableItem ProtectableItemType = "IaaSVMProtectableItem" + // ProtectableItemTypeMicrosoftClassicComputevirtualMachines ... + ProtectableItemTypeMicrosoftClassicComputevirtualMachines ProtectableItemType = "Microsoft.ClassicCompute/virtualMachines" + // ProtectableItemTypeMicrosoftComputevirtualMachines ... + ProtectableItemTypeMicrosoftComputevirtualMachines ProtectableItemType = "Microsoft.Compute/virtualMachines" + // ProtectableItemTypeSAPHanaDatabase ... + ProtectableItemTypeSAPHanaDatabase ProtectableItemType = "SAPHanaDatabase" + // ProtectableItemTypeSAPHanaSystem ... + ProtectableItemTypeSAPHanaSystem ProtectableItemType = "SAPHanaSystem" + // ProtectableItemTypeSQLAvailabilityGroupContainer ... + ProtectableItemTypeSQLAvailabilityGroupContainer ProtectableItemType = "SQLAvailabilityGroupContainer" + // ProtectableItemTypeSQLDataBase ... + ProtectableItemTypeSQLDataBase ProtectableItemType = "SQLDataBase" + // ProtectableItemTypeSQLInstance ... + ProtectableItemTypeSQLInstance ProtectableItemType = "SQLInstance" + // ProtectableItemTypeWorkloadProtectableItem ... + ProtectableItemTypeWorkloadProtectableItem ProtectableItemType = "WorkloadProtectableItem" +) + +// PossibleProtectableItemTypeValues returns an array of possible values for the ProtectableItemType const type. +func PossibleProtectableItemTypeValues() []ProtectableItemType { + return []ProtectableItemType{ProtectableItemTypeAzureFileShare, ProtectableItemTypeAzureVMWorkloadProtectableItem, ProtectableItemTypeIaaSVMProtectableItem, ProtectableItemTypeMicrosoftClassicComputevirtualMachines, ProtectableItemTypeMicrosoftComputevirtualMachines, ProtectableItemTypeSAPHanaDatabase, ProtectableItemTypeSAPHanaSystem, ProtectableItemTypeSQLAvailabilityGroupContainer, ProtectableItemTypeSQLDataBase, ProtectableItemTypeSQLInstance, ProtectableItemTypeWorkloadProtectableItem} +} + +// ProtectedItemHealthStatus enumerates the values for protected item health status. +type ProtectedItemHealthStatus string + +const ( + // ProtectedItemHealthStatusHealthy ... + ProtectedItemHealthStatusHealthy ProtectedItemHealthStatus = "Healthy" + // ProtectedItemHealthStatusInvalid ... + ProtectedItemHealthStatusInvalid ProtectedItemHealthStatus = "Invalid" + // ProtectedItemHealthStatusIRPending ... + ProtectedItemHealthStatusIRPending ProtectedItemHealthStatus = "IRPending" + // ProtectedItemHealthStatusNotReachable ... + ProtectedItemHealthStatusNotReachable ProtectedItemHealthStatus = "NotReachable" + // ProtectedItemHealthStatusUnhealthy ... + ProtectedItemHealthStatusUnhealthy ProtectedItemHealthStatus = "Unhealthy" +) + +// PossibleProtectedItemHealthStatusValues returns an array of possible values for the ProtectedItemHealthStatus const type. +func PossibleProtectedItemHealthStatusValues() []ProtectedItemHealthStatus { + return []ProtectedItemHealthStatus{ProtectedItemHealthStatusHealthy, ProtectedItemHealthStatusInvalid, ProtectedItemHealthStatusIRPending, ProtectedItemHealthStatusNotReachable, ProtectedItemHealthStatusUnhealthy} +} + +// ProtectedItemState enumerates the values for protected item state. +type ProtectedItemState string + +const ( + // ProtectedItemStateInvalid ... + ProtectedItemStateInvalid ProtectedItemState = "Invalid" + // ProtectedItemStateIRPending ... + ProtectedItemStateIRPending ProtectedItemState = "IRPending" + // ProtectedItemStateProtected ... + ProtectedItemStateProtected ProtectedItemState = "Protected" + // ProtectedItemStateProtectionError ... + ProtectedItemStateProtectionError ProtectedItemState = "ProtectionError" + // ProtectedItemStateProtectionPaused ... + ProtectedItemStateProtectionPaused ProtectedItemState = "ProtectionPaused" + // ProtectedItemStateProtectionStopped ... + ProtectedItemStateProtectionStopped ProtectedItemState = "ProtectionStopped" +) + +// PossibleProtectedItemStateValues returns an array of possible values for the ProtectedItemState const type. +func PossibleProtectedItemStateValues() []ProtectedItemState { + return []ProtectedItemState{ProtectedItemStateInvalid, ProtectedItemStateIRPending, ProtectedItemStateProtected, ProtectedItemStateProtectionError, ProtectedItemStateProtectionPaused, ProtectedItemStateProtectionStopped} +} + +// ProtectedItemType enumerates the values for protected item type. +type ProtectedItemType string + +const ( + // ProtectedItemTypeAzureFileShareProtectedItem ... + ProtectedItemTypeAzureFileShareProtectedItem ProtectedItemType = "AzureFileShareProtectedItem" + // ProtectedItemTypeAzureIaaSVMProtectedItem ... + ProtectedItemTypeAzureIaaSVMProtectedItem ProtectedItemType = "AzureIaaSVMProtectedItem" + // ProtectedItemTypeAzureVMWorkloadProtectedItem ... + ProtectedItemTypeAzureVMWorkloadProtectedItem ProtectedItemType = "AzureVmWorkloadProtectedItem" + // ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase ... + ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase ProtectedItemType = "AzureVmWorkloadSAPHanaDatabase" + // ProtectedItemTypeAzureVMWorkloadSQLDatabase ... + ProtectedItemTypeAzureVMWorkloadSQLDatabase ProtectedItemType = "AzureVmWorkloadSQLDatabase" + // ProtectedItemTypeDPMProtectedItem ... + ProtectedItemTypeDPMProtectedItem ProtectedItemType = "DPMProtectedItem" + // ProtectedItemTypeGenericProtectedItem ... + ProtectedItemTypeGenericProtectedItem ProtectedItemType = "GenericProtectedItem" + // ProtectedItemTypeMabFileFolderProtectedItem ... + ProtectedItemTypeMabFileFolderProtectedItem ProtectedItemType = "MabFileFolderProtectedItem" + // ProtectedItemTypeMicrosoftClassicComputevirtualMachines ... + ProtectedItemTypeMicrosoftClassicComputevirtualMachines ProtectedItemType = "Microsoft.ClassicCompute/virtualMachines" + // ProtectedItemTypeMicrosoftComputevirtualMachines ... + ProtectedItemTypeMicrosoftComputevirtualMachines ProtectedItemType = "Microsoft.Compute/virtualMachines" + // ProtectedItemTypeMicrosoftSqlserversdatabases ... + ProtectedItemTypeMicrosoftSqlserversdatabases ProtectedItemType = "Microsoft.Sql/servers/databases" + // ProtectedItemTypeProtectedItem ... + ProtectedItemTypeProtectedItem ProtectedItemType = "ProtectedItem" +) + +// PossibleProtectedItemTypeValues returns an array of possible values for the ProtectedItemType const type. +func PossibleProtectedItemTypeValues() []ProtectedItemType { + return []ProtectedItemType{ProtectedItemTypeAzureFileShareProtectedItem, ProtectedItemTypeAzureIaaSVMProtectedItem, ProtectedItemTypeAzureVMWorkloadProtectedItem, ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase, ProtectedItemTypeAzureVMWorkloadSQLDatabase, ProtectedItemTypeDPMProtectedItem, ProtectedItemTypeGenericProtectedItem, ProtectedItemTypeMabFileFolderProtectedItem, ProtectedItemTypeMicrosoftClassicComputevirtualMachines, ProtectedItemTypeMicrosoftComputevirtualMachines, ProtectedItemTypeMicrosoftSqlserversdatabases, ProtectedItemTypeProtectedItem} +} + +// ProtectionState enumerates the values for protection state. +type ProtectionState string + +const ( + // ProtectionStateInvalid ... + ProtectionStateInvalid ProtectionState = "Invalid" + // ProtectionStateIRPending ... + ProtectionStateIRPending ProtectionState = "IRPending" + // ProtectionStateProtected ... + ProtectionStateProtected ProtectionState = "Protected" + // ProtectionStateProtectionError ... + ProtectionStateProtectionError ProtectionState = "ProtectionError" + // ProtectionStateProtectionPaused ... + ProtectionStateProtectionPaused ProtectionState = "ProtectionPaused" + // ProtectionStateProtectionStopped ... + ProtectionStateProtectionStopped ProtectionState = "ProtectionStopped" +) + +// PossibleProtectionStateValues returns an array of possible values for the ProtectionState const type. +func PossibleProtectionStateValues() []ProtectionState { + return []ProtectionState{ProtectionStateInvalid, ProtectionStateIRPending, ProtectionStateProtected, ProtectionStateProtectionError, ProtectionStateProtectionPaused, ProtectionStateProtectionStopped} +} + +// ProtectionStatus enumerates the values for protection status. +type ProtectionStatus string + +const ( + // ProtectionStatusInvalid ... + ProtectionStatusInvalid ProtectionStatus = "Invalid" + // ProtectionStatusNotProtected ... + ProtectionStatusNotProtected ProtectionStatus = "NotProtected" + // ProtectionStatusProtected ... + ProtectionStatusProtected ProtectionStatus = "Protected" + // ProtectionStatusProtecting ... + ProtectionStatusProtecting ProtectionStatus = "Protecting" + // ProtectionStatusProtectionFailed ... + ProtectionStatusProtectionFailed ProtectionStatus = "ProtectionFailed" +) + +// PossibleProtectionStatusValues returns an array of possible values for the ProtectionStatus const type. +func PossibleProtectionStatusValues() []ProtectionStatus { + return []ProtectionStatus{ProtectionStatusInvalid, ProtectionStatusNotProtected, ProtectionStatusProtected, ProtectionStatusProtecting, ProtectionStatusProtectionFailed} +} + +// RecoveryPointTierStatus enumerates the values for recovery point tier status. +type RecoveryPointTierStatus string + +const ( + // RecoveryPointTierStatusDeleted ... + RecoveryPointTierStatusDeleted RecoveryPointTierStatus = "Deleted" + // RecoveryPointTierStatusDisabled ... + RecoveryPointTierStatusDisabled RecoveryPointTierStatus = "Disabled" + // RecoveryPointTierStatusInvalid ... + RecoveryPointTierStatusInvalid RecoveryPointTierStatus = "Invalid" + // RecoveryPointTierStatusValid ... + RecoveryPointTierStatusValid RecoveryPointTierStatus = "Valid" +) + +// PossibleRecoveryPointTierStatusValues returns an array of possible values for the RecoveryPointTierStatus const type. +func PossibleRecoveryPointTierStatusValues() []RecoveryPointTierStatus { + return []RecoveryPointTierStatus{RecoveryPointTierStatusDeleted, RecoveryPointTierStatusDisabled, RecoveryPointTierStatusInvalid, RecoveryPointTierStatusValid} +} + +// RecoveryPointTierType enumerates the values for recovery point tier type. +type RecoveryPointTierType string + +const ( + // RecoveryPointTierTypeHardenedRP ... + RecoveryPointTierTypeHardenedRP RecoveryPointTierType = "HardenedRP" + // RecoveryPointTierTypeInstantRP ... + RecoveryPointTierTypeInstantRP RecoveryPointTierType = "InstantRP" + // RecoveryPointTierTypeInvalid ... + RecoveryPointTierTypeInvalid RecoveryPointTierType = "Invalid" +) + +// PossibleRecoveryPointTierTypeValues returns an array of possible values for the RecoveryPointTierType const type. +func PossibleRecoveryPointTierTypeValues() []RecoveryPointTierType { + return []RecoveryPointTierType{RecoveryPointTierTypeHardenedRP, RecoveryPointTierTypeInstantRP, RecoveryPointTierTypeInvalid} +} + +// RecoveryType enumerates the values for recovery type. +type RecoveryType string + +const ( + // RecoveryTypeAlternateLocation ... + RecoveryTypeAlternateLocation RecoveryType = "AlternateLocation" + // RecoveryTypeInvalid ... + RecoveryTypeInvalid RecoveryType = "Invalid" + // RecoveryTypeOriginalLocation ... + RecoveryTypeOriginalLocation RecoveryType = "OriginalLocation" + // RecoveryTypeRestoreDisks ... + RecoveryTypeRestoreDisks RecoveryType = "RestoreDisks" +) + +// PossibleRecoveryTypeValues returns an array of possible values for the RecoveryType const type. +func PossibleRecoveryTypeValues() []RecoveryType { + return []RecoveryType{RecoveryTypeAlternateLocation, RecoveryTypeInvalid, RecoveryTypeOriginalLocation, RecoveryTypeRestoreDisks} +} + +// RestorePointQueryType enumerates the values for restore point query type. +type RestorePointQueryType string + +const ( + // RestorePointQueryTypeAll ... + RestorePointQueryTypeAll RestorePointQueryType = "All" + // RestorePointQueryTypeDifferential ... + RestorePointQueryTypeDifferential RestorePointQueryType = "Differential" + // RestorePointQueryTypeFull ... + RestorePointQueryTypeFull RestorePointQueryType = "Full" + // RestorePointQueryTypeFullAndDifferential ... + RestorePointQueryTypeFullAndDifferential RestorePointQueryType = "FullAndDifferential" + // RestorePointQueryTypeInvalid ... + RestorePointQueryTypeInvalid RestorePointQueryType = "Invalid" + // RestorePointQueryTypeLog ... + RestorePointQueryTypeLog RestorePointQueryType = "Log" +) + +// PossibleRestorePointQueryTypeValues returns an array of possible values for the RestorePointQueryType const type. +func PossibleRestorePointQueryTypeValues() []RestorePointQueryType { + return []RestorePointQueryType{RestorePointQueryTypeAll, RestorePointQueryTypeDifferential, RestorePointQueryTypeFull, RestorePointQueryTypeFullAndDifferential, RestorePointQueryTypeInvalid, RestorePointQueryTypeLog} +} + +// RestorePointType enumerates the values for restore point type. +type RestorePointType string + +const ( + // RestorePointTypeDifferential ... + RestorePointTypeDifferential RestorePointType = "Differential" + // RestorePointTypeFull ... + RestorePointTypeFull RestorePointType = "Full" + // RestorePointTypeInvalid ... + RestorePointTypeInvalid RestorePointType = "Invalid" + // RestorePointTypeLog ... + RestorePointTypeLog RestorePointType = "Log" +) + +// PossibleRestorePointTypeValues returns an array of possible values for the RestorePointType const type. +func PossibleRestorePointTypeValues() []RestorePointType { + return []RestorePointType{RestorePointTypeDifferential, RestorePointTypeFull, RestorePointTypeInvalid, RestorePointTypeLog} +} + +// RestoreRequestType enumerates the values for restore request type. +type RestoreRequestType string + +const ( + // RestoreRequestTypeFullShareRestore ... + RestoreRequestTypeFullShareRestore RestoreRequestType = "FullShareRestore" + // RestoreRequestTypeInvalid ... + RestoreRequestTypeInvalid RestoreRequestType = "Invalid" + // RestoreRequestTypeItemLevelRestore ... + RestoreRequestTypeItemLevelRestore RestoreRequestType = "ItemLevelRestore" +) + +// PossibleRestoreRequestTypeValues returns an array of possible values for the RestoreRequestType const type. +func PossibleRestoreRequestTypeValues() []RestoreRequestType { + return []RestoreRequestType{RestoreRequestTypeFullShareRestore, RestoreRequestTypeInvalid, RestoreRequestTypeItemLevelRestore} +} + +// RetentionDurationType enumerates the values for retention duration type. +type RetentionDurationType string + +const ( + // RetentionDurationTypeDays ... + RetentionDurationTypeDays RetentionDurationType = "Days" + // RetentionDurationTypeInvalid ... + RetentionDurationTypeInvalid RetentionDurationType = "Invalid" + // RetentionDurationTypeMonths ... + RetentionDurationTypeMonths RetentionDurationType = "Months" + // RetentionDurationTypeWeeks ... + RetentionDurationTypeWeeks RetentionDurationType = "Weeks" + // RetentionDurationTypeYears ... + RetentionDurationTypeYears RetentionDurationType = "Years" +) + +// PossibleRetentionDurationTypeValues returns an array of possible values for the RetentionDurationType const type. +func PossibleRetentionDurationTypeValues() []RetentionDurationType { + return []RetentionDurationType{RetentionDurationTypeDays, RetentionDurationTypeInvalid, RetentionDurationTypeMonths, RetentionDurationTypeWeeks, RetentionDurationTypeYears} +} + +// RetentionPolicyType enumerates the values for retention policy type. +type RetentionPolicyType string + +const ( + // RetentionPolicyTypeLongTermRetentionPolicy ... + RetentionPolicyTypeLongTermRetentionPolicy RetentionPolicyType = "LongTermRetentionPolicy" + // RetentionPolicyTypeRetentionPolicy ... + RetentionPolicyTypeRetentionPolicy RetentionPolicyType = "RetentionPolicy" + // RetentionPolicyTypeSimpleRetentionPolicy ... + RetentionPolicyTypeSimpleRetentionPolicy RetentionPolicyType = "SimpleRetentionPolicy" +) + +// PossibleRetentionPolicyTypeValues returns an array of possible values for the RetentionPolicyType const type. +func PossibleRetentionPolicyTypeValues() []RetentionPolicyType { + return []RetentionPolicyType{RetentionPolicyTypeLongTermRetentionPolicy, RetentionPolicyTypeRetentionPolicy, RetentionPolicyTypeSimpleRetentionPolicy} +} + +// RetentionScheduleFormat enumerates the values for retention schedule format. +type RetentionScheduleFormat string + +const ( + // RetentionScheduleFormatDaily ... + RetentionScheduleFormatDaily RetentionScheduleFormat = "Daily" + // RetentionScheduleFormatInvalid ... + RetentionScheduleFormatInvalid RetentionScheduleFormat = "Invalid" + // RetentionScheduleFormatWeekly ... + RetentionScheduleFormatWeekly RetentionScheduleFormat = "Weekly" +) + +// PossibleRetentionScheduleFormatValues returns an array of possible values for the RetentionScheduleFormat const type. +func PossibleRetentionScheduleFormatValues() []RetentionScheduleFormat { + return []RetentionScheduleFormat{RetentionScheduleFormatDaily, RetentionScheduleFormatInvalid, RetentionScheduleFormatWeekly} +} + +// SchedulePolicyType enumerates the values for schedule policy type. +type SchedulePolicyType string + +const ( + // SchedulePolicyTypeLogSchedulePolicy ... + SchedulePolicyTypeLogSchedulePolicy SchedulePolicyType = "LogSchedulePolicy" + // SchedulePolicyTypeLongTermSchedulePolicy ... + SchedulePolicyTypeLongTermSchedulePolicy SchedulePolicyType = "LongTermSchedulePolicy" + // SchedulePolicyTypeSchedulePolicy ... + SchedulePolicyTypeSchedulePolicy SchedulePolicyType = "SchedulePolicy" + // SchedulePolicyTypeSimpleSchedulePolicy ... + SchedulePolicyTypeSimpleSchedulePolicy SchedulePolicyType = "SimpleSchedulePolicy" +) + +// PossibleSchedulePolicyTypeValues returns an array of possible values for the SchedulePolicyType const type. +func PossibleSchedulePolicyTypeValues() []SchedulePolicyType { + return []SchedulePolicyType{SchedulePolicyTypeLogSchedulePolicy, SchedulePolicyTypeLongTermSchedulePolicy, SchedulePolicyTypeSchedulePolicy, SchedulePolicyTypeSimpleSchedulePolicy} +} + +// ScheduleRunType enumerates the values for schedule run type. +type ScheduleRunType string + +const ( + // ScheduleRunTypeDaily ... + ScheduleRunTypeDaily ScheduleRunType = "Daily" + // ScheduleRunTypeInvalid ... + ScheduleRunTypeInvalid ScheduleRunType = "Invalid" + // ScheduleRunTypeWeekly ... + ScheduleRunTypeWeekly ScheduleRunType = "Weekly" +) + +// PossibleScheduleRunTypeValues returns an array of possible values for the ScheduleRunType const type. +func PossibleScheduleRunTypeValues() []ScheduleRunType { + return []ScheduleRunType{ScheduleRunTypeDaily, ScheduleRunTypeInvalid, ScheduleRunTypeWeekly} +} + +// SQLDataDirectoryType enumerates the values for sql data directory type. +type SQLDataDirectoryType string + +const ( + // SQLDataDirectoryTypeData ... + SQLDataDirectoryTypeData SQLDataDirectoryType = "Data" + // SQLDataDirectoryTypeInvalid ... + SQLDataDirectoryTypeInvalid SQLDataDirectoryType = "Invalid" + // SQLDataDirectoryTypeLog ... + SQLDataDirectoryTypeLog SQLDataDirectoryType = "Log" +) + +// PossibleSQLDataDirectoryTypeValues returns an array of possible values for the SQLDataDirectoryType const type. +func PossibleSQLDataDirectoryTypeValues() []SQLDataDirectoryType { + return []SQLDataDirectoryType{SQLDataDirectoryTypeData, SQLDataDirectoryTypeInvalid, SQLDataDirectoryTypeLog} +} + +// StorageType enumerates the values for storage type. +type StorageType string + +const ( + // StorageTypeGeoRedundant ... + StorageTypeGeoRedundant StorageType = "GeoRedundant" + // StorageTypeInvalid ... + StorageTypeInvalid StorageType = "Invalid" + // StorageTypeLocallyRedundant ... + StorageTypeLocallyRedundant StorageType = "LocallyRedundant" +) + +// PossibleStorageTypeValues returns an array of possible values for the StorageType const type. +func PossibleStorageTypeValues() []StorageType { + return []StorageType{StorageTypeGeoRedundant, StorageTypeInvalid, StorageTypeLocallyRedundant} +} + +// StorageTypeState enumerates the values for storage type state. +type StorageTypeState string + +const ( + // StorageTypeStateInvalid ... + StorageTypeStateInvalid StorageTypeState = "Invalid" + // StorageTypeStateLocked ... + StorageTypeStateLocked StorageTypeState = "Locked" + // StorageTypeStateUnlocked ... + StorageTypeStateUnlocked StorageTypeState = "Unlocked" +) + +// PossibleStorageTypeStateValues returns an array of possible values for the StorageTypeState const type. +func PossibleStorageTypeStateValues() []StorageTypeState { + return []StorageTypeState{StorageTypeStateInvalid, StorageTypeStateLocked, StorageTypeStateUnlocked} +} + +// Type enumerates the values for type. +type Type string + +const ( + // TypeCopyOnlyFull ... + TypeCopyOnlyFull Type = "CopyOnlyFull" + // TypeDifferential ... + TypeDifferential Type = "Differential" + // TypeFull ... + TypeFull Type = "Full" + // TypeInvalid ... + TypeInvalid Type = "Invalid" + // TypeLog ... + TypeLog Type = "Log" +) + +// PossibleTypeValues returns an array of possible values for the Type const type. +func PossibleTypeValues() []Type { + return []Type{TypeCopyOnlyFull, TypeDifferential, TypeFull, TypeInvalid, TypeLog} +} + +// WeekOfMonth enumerates the values for week of month. +type WeekOfMonth string + +const ( + // WeekOfMonthFirst ... + WeekOfMonthFirst WeekOfMonth = "First" + // WeekOfMonthFourth ... + WeekOfMonthFourth WeekOfMonth = "Fourth" + // WeekOfMonthInvalid ... + WeekOfMonthInvalid WeekOfMonth = "Invalid" + // WeekOfMonthLast ... + WeekOfMonthLast WeekOfMonth = "Last" + // WeekOfMonthSecond ... + WeekOfMonthSecond WeekOfMonth = "Second" + // WeekOfMonthThird ... + WeekOfMonthThird WeekOfMonth = "Third" +) + +// PossibleWeekOfMonthValues returns an array of possible values for the WeekOfMonth const type. +func PossibleWeekOfMonthValues() []WeekOfMonth { + return []WeekOfMonth{WeekOfMonthFirst, WeekOfMonthFourth, WeekOfMonthInvalid, WeekOfMonthLast, WeekOfMonthSecond, WeekOfMonthThird} +} + +// WorkloadItemType enumerates the values for workload item type. +type WorkloadItemType string + +const ( + // WorkloadItemTypeInvalid ... + WorkloadItemTypeInvalid WorkloadItemType = "Invalid" + // WorkloadItemTypeSAPHanaDatabase ... + WorkloadItemTypeSAPHanaDatabase WorkloadItemType = "SAPHanaDatabase" + // WorkloadItemTypeSAPHanaSystem ... + WorkloadItemTypeSAPHanaSystem WorkloadItemType = "SAPHanaSystem" + // WorkloadItemTypeSQLDataBase ... + WorkloadItemTypeSQLDataBase WorkloadItemType = "SQLDataBase" + // WorkloadItemTypeSQLInstance ... + WorkloadItemTypeSQLInstance WorkloadItemType = "SQLInstance" +) + +// PossibleWorkloadItemTypeValues returns an array of possible values for the WorkloadItemType const type. +func PossibleWorkloadItemTypeValues() []WorkloadItemType { + return []WorkloadItemType{WorkloadItemTypeInvalid, WorkloadItemTypeSAPHanaDatabase, WorkloadItemTypeSAPHanaSystem, WorkloadItemTypeSQLDataBase, WorkloadItemTypeSQLInstance} +} + +// WorkloadItemTypeBasicWorkloadItem enumerates the values for workload item type basic workload item. +type WorkloadItemTypeBasicWorkloadItem string + +const ( + // WorkloadItemTypeAzureVMWorkloadItem ... + WorkloadItemTypeAzureVMWorkloadItem WorkloadItemTypeBasicWorkloadItem = "AzureVmWorkloadItem" + // WorkloadItemTypeSAPHanaDatabase1 ... + WorkloadItemTypeSAPHanaDatabase1 WorkloadItemTypeBasicWorkloadItem = "SAPHanaDatabase" + // WorkloadItemTypeSAPHanaSystem1 ... + WorkloadItemTypeSAPHanaSystem1 WorkloadItemTypeBasicWorkloadItem = "SAPHanaSystem" + // WorkloadItemTypeSQLDataBase1 ... + WorkloadItemTypeSQLDataBase1 WorkloadItemTypeBasicWorkloadItem = "SQLDataBase" + // WorkloadItemTypeSQLInstance1 ... + WorkloadItemTypeSQLInstance1 WorkloadItemTypeBasicWorkloadItem = "SQLInstance" + // WorkloadItemTypeWorkloadItem ... + WorkloadItemTypeWorkloadItem WorkloadItemTypeBasicWorkloadItem = "WorkloadItem" +) + +// PossibleWorkloadItemTypeBasicWorkloadItemValues returns an array of possible values for the WorkloadItemTypeBasicWorkloadItem const type. +func PossibleWorkloadItemTypeBasicWorkloadItemValues() []WorkloadItemTypeBasicWorkloadItem { + return []WorkloadItemTypeBasicWorkloadItem{WorkloadItemTypeAzureVMWorkloadItem, WorkloadItemTypeSAPHanaDatabase1, WorkloadItemTypeSAPHanaSystem1, WorkloadItemTypeSQLDataBase1, WorkloadItemTypeSQLInstance1, WorkloadItemTypeWorkloadItem} +} + +// WorkloadType enumerates the values for workload type. +type WorkloadType string + +const ( + // WorkloadTypeAzureFileShare ... + WorkloadTypeAzureFileShare WorkloadType = "AzureFileShare" + // WorkloadTypeAzureSQLDb ... + WorkloadTypeAzureSQLDb WorkloadType = "AzureSqlDb" + // WorkloadTypeClient ... + WorkloadTypeClient WorkloadType = "Client" + // WorkloadTypeExchange ... + WorkloadTypeExchange WorkloadType = "Exchange" + // WorkloadTypeFileFolder ... + WorkloadTypeFileFolder WorkloadType = "FileFolder" + // WorkloadTypeGenericDataSource ... + WorkloadTypeGenericDataSource WorkloadType = "GenericDataSource" + // WorkloadTypeInvalid ... + WorkloadTypeInvalid WorkloadType = "Invalid" + // WorkloadTypeSAPHanaDatabase ... + WorkloadTypeSAPHanaDatabase WorkloadType = "SAPHanaDatabase" + // WorkloadTypeSharepoint ... + WorkloadTypeSharepoint WorkloadType = "Sharepoint" + // WorkloadTypeSQLDataBase ... + WorkloadTypeSQLDataBase WorkloadType = "SQLDataBase" + // WorkloadTypeSQLDB ... + WorkloadTypeSQLDB WorkloadType = "SQLDB" + // WorkloadTypeSystemState ... + WorkloadTypeSystemState WorkloadType = "SystemState" + // WorkloadTypeVM ... + WorkloadTypeVM WorkloadType = "VM" + // WorkloadTypeVMwareVM ... + WorkloadTypeVMwareVM WorkloadType = "VMwareVM" +) + +// PossibleWorkloadTypeValues returns an array of possible values for the WorkloadType const type. +func PossibleWorkloadTypeValues() []WorkloadType { + return []WorkloadType{WorkloadTypeAzureFileShare, WorkloadTypeAzureSQLDb, WorkloadTypeClient, WorkloadTypeExchange, WorkloadTypeFileFolder, WorkloadTypeGenericDataSource, WorkloadTypeInvalid, WorkloadTypeSAPHanaDatabase, WorkloadTypeSharepoint, WorkloadTypeSQLDataBase, WorkloadTypeSQLDB, WorkloadTypeSystemState, WorkloadTypeVM, WorkloadTypeVMwareVM} +} + +// AzureBackupServerContainer azureBackupServer (DPMVenus) workload-specific protection container. +type AzureBackupServerContainer struct { + // CanReRegister - Specifies whether the container is re-registrable. + CanReRegister *bool `json:"canReRegister,omitempty"` + // ContainerID - ID of container. + ContainerID *string `json:"containerId,omitempty"` + // ProtectedItemCount - Number of protected items in the BackupEngine + ProtectedItemCount *int64 `json:"protectedItemCount,omitempty"` + // DpmAgentVersion - Backup engine Agent version + DpmAgentVersion *string `json:"dpmAgentVersion,omitempty"` + // DpmServers - List of BackupEngines protecting the container + DpmServers *[]string `json:"dpmServers,omitempty"` + // UpgradeAvailable - To check if upgrade available + UpgradeAvailable *bool `json:"upgradeAvailable,omitempty"` + // ProtectionStatus - Protection status of the container. + ProtectionStatus *string `json:"protectionStatus,omitempty"` + // ExtendedInfo - Extended Info of the container. + ExtendedInfo *DPMContainerExtendedInfo `json:"extendedInfo,omitempty"` + // FriendlyName - Friendly name of the container. + FriendlyName *string `json:"friendlyName,omitempty"` + // BackupManagementType - Type of backup managemenent for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // RegistrationStatus - Status of registration of the container with the Recovery Services Vault. + RegistrationStatus *string `json:"registrationStatus,omitempty"` + // HealthStatus - Status of health of the container. + HealthStatus *string `json:"healthStatus,omitempty"` + // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaaSVMContainer', 'ContainerTypeWindows1' + ContainerType ContainerTypeBasicProtectionContainer `json:"containerType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureBackupServerContainer. +func (absc AzureBackupServerContainer) MarshalJSON() ([]byte, error) { + absc.ContainerType = ContainerTypeAzureBackupServerContainer1 + objectMap := make(map[string]interface{}) + if absc.CanReRegister != nil { + objectMap["canReRegister"] = absc.CanReRegister + } + if absc.ContainerID != nil { + objectMap["containerId"] = absc.ContainerID + } + if absc.ProtectedItemCount != nil { + objectMap["protectedItemCount"] = absc.ProtectedItemCount + } + if absc.DpmAgentVersion != nil { + objectMap["dpmAgentVersion"] = absc.DpmAgentVersion + } + if absc.DpmServers != nil { + objectMap["dpmServers"] = absc.DpmServers + } + if absc.UpgradeAvailable != nil { + objectMap["upgradeAvailable"] = absc.UpgradeAvailable + } + if absc.ProtectionStatus != nil { + objectMap["protectionStatus"] = absc.ProtectionStatus + } + if absc.ExtendedInfo != nil { + objectMap["extendedInfo"] = absc.ExtendedInfo + } + if absc.FriendlyName != nil { + objectMap["friendlyName"] = absc.FriendlyName + } + if absc.BackupManagementType != "" { + objectMap["backupManagementType"] = absc.BackupManagementType + } + if absc.RegistrationStatus != nil { + objectMap["registrationStatus"] = absc.RegistrationStatus + } + if absc.HealthStatus != nil { + objectMap["healthStatus"] = absc.HealthStatus + } + if absc.ContainerType != "" { + objectMap["containerType"] = absc.ContainerType + } + return json.Marshal(objectMap) +} + +// AsAzureBackupServerContainer is the BasicProtectionContainer implementation for AzureBackupServerContainer. +func (absc AzureBackupServerContainer) AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) { + return &absc, true +} + +// AsAzureIaaSClassicComputeVMContainer is the BasicProtectionContainer implementation for AzureBackupServerContainer. +func (absc AzureBackupServerContainer) AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) { + return nil, false +} + +// AsAzureIaaSComputeVMContainer is the BasicProtectionContainer implementation for AzureBackupServerContainer. +func (absc AzureBackupServerContainer) AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) { + return nil, false +} + +// AsAzureSQLAGWorkloadContainerProtectionContainer is the BasicProtectionContainer implementation for AzureBackupServerContainer. +func (absc AzureBackupServerContainer) AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) { + return nil, false +} + +// AsAzureSQLContainer is the BasicProtectionContainer implementation for AzureBackupServerContainer. +func (absc AzureBackupServerContainer) AsAzureSQLContainer() (*AzureSQLContainer, bool) { + return nil, false +} + +// AsAzureStorageContainer is the BasicProtectionContainer implementation for AzureBackupServerContainer. +func (absc AzureBackupServerContainer) AsAzureStorageContainer() (*AzureStorageContainer, bool) { + return nil, false +} + +// AsAzureVMAppContainerProtectionContainer is the BasicProtectionContainer implementation for AzureBackupServerContainer. +func (absc AzureBackupServerContainer) AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) { + return nil, false +} + +// AsAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureBackupServerContainer. +func (absc AzureBackupServerContainer) AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) { + return nil, false +} + +// AsBasicAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureBackupServerContainer. +func (absc AzureBackupServerContainer) AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) { + return nil, false +} + +// AsDpmContainer is the BasicProtectionContainer implementation for AzureBackupServerContainer. +func (absc AzureBackupServerContainer) AsDpmContainer() (*DpmContainer, bool) { + return nil, false +} + +// AsGenericContainer is the BasicProtectionContainer implementation for AzureBackupServerContainer. +func (absc AzureBackupServerContainer) AsGenericContainer() (*GenericContainer, bool) { + return nil, false +} + +// AsIaaSVMContainer is the BasicProtectionContainer implementation for AzureBackupServerContainer. +func (absc AzureBackupServerContainer) AsIaaSVMContainer() (*IaaSVMContainer, bool) { + return nil, false +} + +// AsBasicIaaSVMContainer is the BasicProtectionContainer implementation for AzureBackupServerContainer. +func (absc AzureBackupServerContainer) AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) { + return nil, false +} + +// AsMabContainer is the BasicProtectionContainer implementation for AzureBackupServerContainer. +func (absc AzureBackupServerContainer) AsMabContainer() (*MabContainer, bool) { + return nil, false +} + +// AsProtectionContainer is the BasicProtectionContainer implementation for AzureBackupServerContainer. +func (absc AzureBackupServerContainer) AsProtectionContainer() (*ProtectionContainer, bool) { + return nil, false +} + +// AsBasicProtectionContainer is the BasicProtectionContainer implementation for AzureBackupServerContainer. +func (absc AzureBackupServerContainer) AsBasicProtectionContainer() (BasicProtectionContainer, bool) { + return &absc, true +} + +// AzureBackupServerEngine backup engine type when Azure Backup Server is used to manage the backups. +type AzureBackupServerEngine struct { + // FriendlyName - Friendly name of the backup engine. + FriendlyName *string `json:"friendlyName,omitempty"` + // BackupManagementType - Type of backup management for the backup engine. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // RegistrationStatus - Registration status of the backup engine with the Recovery Services Vault. + RegistrationStatus *string `json:"registrationStatus,omitempty"` + // BackupEngineState - Status of the backup engine with the Recovery Services Vault. = {Active/Deleting/DeleteFailed} + BackupEngineState *string `json:"backupEngineState,omitempty"` + // HealthStatus - Backup status of the backup engine. + HealthStatus *string `json:"healthStatus,omitempty"` + // CanReRegister - Flag indicating if the backup engine be registered, once already registered. + CanReRegister *bool `json:"canReRegister,omitempty"` + // BackupEngineID - ID of the backup engine. + BackupEngineID *string `json:"backupEngineId,omitempty"` + // DpmVersion - Backup engine version + DpmVersion *string `json:"dpmVersion,omitempty"` + // AzureBackupAgentVersion - Backup agent version + AzureBackupAgentVersion *string `json:"azureBackupAgentVersion,omitempty"` + // IsAzureBackupAgentUpgradeAvailable - To check if backup agent upgrade available + IsAzureBackupAgentUpgradeAvailable *bool `json:"isAzureBackupAgentUpgradeAvailable,omitempty"` + // IsDpmUpgradeAvailable - To check if backup engine upgrade available + IsDpmUpgradeAvailable *bool `json:"isDpmUpgradeAvailable,omitempty"` + // ExtendedInfo - Extended info of the backupengine + ExtendedInfo *EngineExtendedInfo `json:"extendedInfo,omitempty"` + // BackupEngineType - Possible values include: 'BackupEngineTypeBackupEngineBase', 'BackupEngineTypeAzureBackupServerEngine', 'BackupEngineTypeDpmBackupEngine' + BackupEngineType EngineType `json:"backupEngineType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureBackupServerEngine. +func (abse AzureBackupServerEngine) MarshalJSON() ([]byte, error) { + abse.BackupEngineType = BackupEngineTypeAzureBackupServerEngine + objectMap := make(map[string]interface{}) + if abse.FriendlyName != nil { + objectMap["friendlyName"] = abse.FriendlyName + } + if abse.BackupManagementType != "" { + objectMap["backupManagementType"] = abse.BackupManagementType + } + if abse.RegistrationStatus != nil { + objectMap["registrationStatus"] = abse.RegistrationStatus + } + if abse.BackupEngineState != nil { + objectMap["backupEngineState"] = abse.BackupEngineState + } + if abse.HealthStatus != nil { + objectMap["healthStatus"] = abse.HealthStatus + } + if abse.CanReRegister != nil { + objectMap["canReRegister"] = abse.CanReRegister + } + if abse.BackupEngineID != nil { + objectMap["backupEngineId"] = abse.BackupEngineID + } + if abse.DpmVersion != nil { + objectMap["dpmVersion"] = abse.DpmVersion + } + if abse.AzureBackupAgentVersion != nil { + objectMap["azureBackupAgentVersion"] = abse.AzureBackupAgentVersion + } + if abse.IsAzureBackupAgentUpgradeAvailable != nil { + objectMap["isAzureBackupAgentUpgradeAvailable"] = abse.IsAzureBackupAgentUpgradeAvailable + } + if abse.IsDpmUpgradeAvailable != nil { + objectMap["isDpmUpgradeAvailable"] = abse.IsDpmUpgradeAvailable + } + if abse.ExtendedInfo != nil { + objectMap["extendedInfo"] = abse.ExtendedInfo + } + if abse.BackupEngineType != "" { + objectMap["backupEngineType"] = abse.BackupEngineType + } + return json.Marshal(objectMap) +} + +// AsAzureBackupServerEngine is the BasicEngineBase implementation for AzureBackupServerEngine. +func (abse AzureBackupServerEngine) AsAzureBackupServerEngine() (*AzureBackupServerEngine, bool) { + return &abse, true +} + +// AsDpmBackupEngine is the BasicEngineBase implementation for AzureBackupServerEngine. +func (abse AzureBackupServerEngine) AsDpmBackupEngine() (*DpmBackupEngine, bool) { + return nil, false +} + +// AsEngineBase is the BasicEngineBase implementation for AzureBackupServerEngine. +func (abse AzureBackupServerEngine) AsEngineBase() (*EngineBase, bool) { + return nil, false +} + +// AsBasicEngineBase is the BasicEngineBase implementation for AzureBackupServerEngine. +func (abse AzureBackupServerEngine) AsBasicEngineBase() (BasicEngineBase, bool) { + return &abse, true +} + +// AzureFileShareBackupRequest azureFileShare workload-specific backup request. +type AzureFileShareBackupRequest struct { + // RecoveryPointExpiryTimeInUTC - Backup copy will expire after the time specified (UTC). + RecoveryPointExpiryTimeInUTC *date.Time `json:"recoveryPointExpiryTimeInUTC,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeBackupRequest', 'ObjectTypeAzureFileShareBackupRequest', 'ObjectTypeAzureWorkloadBackupRequest', 'ObjectTypeIaasVMBackupRequest' + ObjectType ObjectType `json:"objectType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureFileShareBackupRequest. +func (afsbr AzureFileShareBackupRequest) MarshalJSON() ([]byte, error) { + afsbr.ObjectType = ObjectTypeAzureFileShareBackupRequest + objectMap := make(map[string]interface{}) + if afsbr.RecoveryPointExpiryTimeInUTC != nil { + objectMap["recoveryPointExpiryTimeInUTC"] = afsbr.RecoveryPointExpiryTimeInUTC + } + if afsbr.ObjectType != "" { + objectMap["objectType"] = afsbr.ObjectType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareBackupRequest is the BasicRequest implementation for AzureFileShareBackupRequest. +func (afsbr AzureFileShareBackupRequest) AsAzureFileShareBackupRequest() (*AzureFileShareBackupRequest, bool) { + return &afsbr, true +} + +// AsAzureWorkloadBackupRequest is the BasicRequest implementation for AzureFileShareBackupRequest. +func (afsbr AzureFileShareBackupRequest) AsAzureWorkloadBackupRequest() (*AzureWorkloadBackupRequest, bool) { + return nil, false +} + +// AsIaasVMBackupRequest is the BasicRequest implementation for AzureFileShareBackupRequest. +func (afsbr AzureFileShareBackupRequest) AsIaasVMBackupRequest() (*IaasVMBackupRequest, bool) { + return nil, false +} + +// AsRequest is the BasicRequest implementation for AzureFileShareBackupRequest. +func (afsbr AzureFileShareBackupRequest) AsRequest() (*Request, bool) { + return nil, false +} + +// AsBasicRequest is the BasicRequest implementation for AzureFileShareBackupRequest. +func (afsbr AzureFileShareBackupRequest) AsBasicRequest() (BasicRequest, bool) { + return &afsbr, true +} + +// AzureFileShareProtectableItem protectable item for Azure Fileshare workloads. +type AzureFileShareProtectableItem struct { + // ParentContainerFabricID - Full Fabric ID of container to which this protectable item belongs. For example, ARM ID. + ParentContainerFabricID *string `json:"parentContainerFabricId,omitempty"` + // ParentContainerFriendlyName - Friendly name of container to which this protectable item belongs. + ParentContainerFriendlyName *string `json:"parentContainerFriendlyName,omitempty"` + // AzureFileShareType - File Share type XSync or XSMB. Possible values include: 'Invalid', 'XSMB', 'XSync' + AzureFileShareType AzureFileShareType `json:"azureFileShareType,omitempty"` + // BackupManagementType - Type of backup managemenent to backup an item. + BackupManagementType *string `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload for the backup management + WorkloadType *string `json:"workloadType,omitempty"` + // FriendlyName - Friendly name of the backup item. + FriendlyName *string `json:"friendlyName,omitempty"` + // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' + ProtectionState ProtectionStatus `json:"protectionState,omitempty"` + // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' + ProtectableItemType ProtectableItemType `json:"protectableItemType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureFileShareProtectableItem. +func (afspi AzureFileShareProtectableItem) MarshalJSON() ([]byte, error) { + afspi.ProtectableItemType = ProtectableItemTypeAzureFileShare + objectMap := make(map[string]interface{}) + if afspi.ParentContainerFabricID != nil { + objectMap["parentContainerFabricId"] = afspi.ParentContainerFabricID + } + if afspi.ParentContainerFriendlyName != nil { + objectMap["parentContainerFriendlyName"] = afspi.ParentContainerFriendlyName + } + if afspi.AzureFileShareType != "" { + objectMap["azureFileShareType"] = afspi.AzureFileShareType + } + if afspi.BackupManagementType != nil { + objectMap["backupManagementType"] = afspi.BackupManagementType + } + if afspi.WorkloadType != nil { + objectMap["workloadType"] = afspi.WorkloadType + } + if afspi.FriendlyName != nil { + objectMap["friendlyName"] = afspi.FriendlyName + } + if afspi.ProtectionState != "" { + objectMap["protectionState"] = afspi.ProtectionState + } + if afspi.ProtectableItemType != "" { + objectMap["protectableItemType"] = afspi.ProtectableItemType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareProtectableItem is the BasicWorkloadProtectableItem implementation for AzureFileShareProtectableItem. +func (afspi AzureFileShareProtectableItem) AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) { + return &afspi, true +} + +// AsAzureIaaSClassicComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureFileShareProtectableItem. +func (afspi AzureFileShareProtectableItem) AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) { + return nil, false +} + +// AsAzureIaaSComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureFileShareProtectableItem. +func (afspi AzureFileShareProtectableItem) AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureFileShareProtectableItem. +func (afspi AzureFileShareProtectableItem) AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) { + return nil, false +} + +// AsBasicAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureFileShareProtectableItem. +func (afspi AzureFileShareProtectableItem) AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureFileShareProtectableItem. +func (afspi AzureFileShareProtectableItem) AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureFileShareProtectableItem. +func (afspi AzureFileShareProtectableItem) AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem is the BasicWorkloadProtectableItem implementation for AzureFileShareProtectableItem. +func (afspi AzureFileShareProtectableItem) AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureFileShareProtectableItem. +func (afspi AzureFileShareProtectableItem) AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLInstanceProtectableItem is the BasicWorkloadProtectableItem implementation for AzureFileShareProtectableItem. +func (afspi AzureFileShareProtectableItem) AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) { + return nil, false +} + +// AsIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureFileShareProtectableItem. +func (afspi AzureFileShareProtectableItem) AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) { + return nil, false +} + +// AsBasicIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureFileShareProtectableItem. +func (afspi AzureFileShareProtectableItem) AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) { + return nil, false +} + +// AsWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureFileShareProtectableItem. +func (afspi AzureFileShareProtectableItem) AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) { + return nil, false +} + +// AsBasicWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureFileShareProtectableItem. +func (afspi AzureFileShareProtectableItem) AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) { + return &afspi, true +} + +// AzureFileshareProtectedItem azure File Share workload-specific backup item. +type AzureFileshareProtectedItem struct { + // FriendlyName - Friendly name of the fileshare represented by this backup item. + FriendlyName *string `json:"friendlyName,omitempty"` + // ProtectionStatus - Backup status of this backup item. + ProtectionStatus *string `json:"protectionStatus,omitempty"` + // ProtectionState - Backup state of this backup item. Possible values include: 'ProtectionStateInvalid', 'ProtectionStateIRPending', 'ProtectionStateProtected', 'ProtectionStateProtectionError', 'ProtectionStateProtectionStopped', 'ProtectionStateProtectionPaused' + ProtectionState ProtectionState `json:"protectionState,omitempty"` + // HealthStatus - backups running status for this backup item. Possible values include: 'HealthStatusPassed', 'HealthStatusActionRequired', 'HealthStatusActionSuggested', 'HealthStatusInvalid' + HealthStatus HealthStatus `json:"healthStatus,omitempty"` + // LastBackupStatus - Last backup operation status. Possible values: Healthy, Unhealthy. + LastBackupStatus *string `json:"lastBackupStatus,omitempty"` + // LastBackupTime - Timestamp of the last backup operation on this backup item. + LastBackupTime *date.Time `json:"lastBackupTime,omitempty"` + // ExtendedInfo - Additional information with this backup item. + ExtendedInfo *AzureFileshareProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` + // BackupManagementType - Type of backup managemenent for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase' + WorkloadType DataSourceType `json:"workloadType,omitempty"` + // ContainerName - Unique name of container + ContainerName *string `json:"containerName,omitempty"` + // SourceResourceID - ARM ID of the resource to be backed up. + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // PolicyID - ID of the backup policy with which this item is backed up. + PolicyID *string `json:"policyId,omitempty"` + // LastRecoveryPoint - Timestamp when the last (latest) backup copy was created for this backup item. + LastRecoveryPoint *date.Time `json:"lastRecoveryPoint,omitempty"` + // BackupSetName - Name of the backup set the backup item belongs to + BackupSetName *string `json:"backupSetName,omitempty"` + // CreateMode - Create mode to indicate recovery of existing soft deleted data source or creation of new data source. Possible values include: 'CreateModeInvalid', 'CreateModeDefault', 'CreateModeRecover' + CreateMode CreateMode `json:"createMode,omitempty"` + // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' + ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureFileshareProtectedItem. +func (afpi AzureFileshareProtectedItem) MarshalJSON() ([]byte, error) { + afpi.ProtectedItemType = ProtectedItemTypeAzureFileShareProtectedItem + objectMap := make(map[string]interface{}) + if afpi.FriendlyName != nil { + objectMap["friendlyName"] = afpi.FriendlyName + } + if afpi.ProtectionStatus != nil { + objectMap["protectionStatus"] = afpi.ProtectionStatus + } + if afpi.ProtectionState != "" { + objectMap["protectionState"] = afpi.ProtectionState + } + if afpi.HealthStatus != "" { + objectMap["healthStatus"] = afpi.HealthStatus + } + if afpi.LastBackupStatus != nil { + objectMap["lastBackupStatus"] = afpi.LastBackupStatus + } + if afpi.LastBackupTime != nil { + objectMap["lastBackupTime"] = afpi.LastBackupTime + } + if afpi.ExtendedInfo != nil { + objectMap["extendedInfo"] = afpi.ExtendedInfo + } + if afpi.BackupManagementType != "" { + objectMap["backupManagementType"] = afpi.BackupManagementType + } + if afpi.WorkloadType != "" { + objectMap["workloadType"] = afpi.WorkloadType + } + if afpi.ContainerName != nil { + objectMap["containerName"] = afpi.ContainerName + } + if afpi.SourceResourceID != nil { + objectMap["sourceResourceId"] = afpi.SourceResourceID + } + if afpi.PolicyID != nil { + objectMap["policyId"] = afpi.PolicyID + } + if afpi.LastRecoveryPoint != nil { + objectMap["lastRecoveryPoint"] = afpi.LastRecoveryPoint + } + if afpi.BackupSetName != nil { + objectMap["backupSetName"] = afpi.BackupSetName + } + if afpi.CreateMode != "" { + objectMap["createMode"] = afpi.CreateMode + } + if afpi.ProtectedItemType != "" { + objectMap["protectedItemType"] = afpi.ProtectedItemType + } + return json.Marshal(objectMap) +} + +// AsAzureFileshareProtectedItem is the BasicProtectedItem implementation for AzureFileshareProtectedItem. +func (afpi AzureFileshareProtectedItem) AsAzureFileshareProtectedItem() (*AzureFileshareProtectedItem, bool) { + return &afpi, true +} + +// AsAzureIaaSClassicComputeVMProtectedItem is the BasicProtectedItem implementation for AzureFileshareProtectedItem. +func (afpi AzureFileshareProtectedItem) AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) { + return nil, false +} + +// AsAzureIaaSComputeVMProtectedItem is the BasicProtectedItem implementation for AzureFileshareProtectedItem. +func (afpi AzureFileshareProtectedItem) AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) { + return nil, false +} + +// AsAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureFileshareProtectedItem. +func (afpi AzureFileshareProtectedItem) AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) { + return nil, false +} + +// AsBasicAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureFileshareProtectedItem. +func (afpi AzureFileshareProtectedItem) AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) { + return nil, false +} + +// AsAzureSQLProtectedItem is the BasicProtectedItem implementation for AzureFileshareProtectedItem. +func (afpi AzureFileshareProtectedItem) AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureFileshareProtectedItem. +func (afpi AzureFileshareProtectedItem) AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) { + return nil, false +} + +// AsBasicAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureFileshareProtectedItem. +func (afpi AzureFileshareProtectedItem) AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaDatabaseProtectedItem is the BasicProtectedItem implementation for AzureFileshareProtectedItem. +func (afpi AzureFileshareProtectedItem) AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLDatabaseProtectedItem is the BasicProtectedItem implementation for AzureFileshareProtectedItem. +func (afpi AzureFileshareProtectedItem) AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) { + return nil, false +} + +// AsDPMProtectedItem is the BasicProtectedItem implementation for AzureFileshareProtectedItem. +func (afpi AzureFileshareProtectedItem) AsDPMProtectedItem() (*DPMProtectedItem, bool) { + return nil, false +} + +// AsGenericProtectedItem is the BasicProtectedItem implementation for AzureFileshareProtectedItem. +func (afpi AzureFileshareProtectedItem) AsGenericProtectedItem() (*GenericProtectedItem, bool) { + return nil, false +} + +// AsMabFileFolderProtectedItem is the BasicProtectedItem implementation for AzureFileshareProtectedItem. +func (afpi AzureFileshareProtectedItem) AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) { + return nil, false +} + +// AsProtectedItem is the BasicProtectedItem implementation for AzureFileshareProtectedItem. +func (afpi AzureFileshareProtectedItem) AsProtectedItem() (*ProtectedItem, bool) { + return nil, false +} + +// AsBasicProtectedItem is the BasicProtectedItem implementation for AzureFileshareProtectedItem. +func (afpi AzureFileshareProtectedItem) AsBasicProtectedItem() (BasicProtectedItem, bool) { + return &afpi, true +} + +// AzureFileshareProtectedItemExtendedInfo additional information about Azure File Share backup item. +type AzureFileshareProtectedItemExtendedInfo struct { + // OldestRecoveryPoint - The oldest backup copy available for this item in the service. + OldestRecoveryPoint *date.Time `json:"oldestRecoveryPoint,omitempty"` + // RecoveryPointCount - Number of available backup copies associated with this backup item. + RecoveryPointCount *int32 `json:"recoveryPointCount,omitempty"` + // PolicyState - Indicates consistency of policy object and policy applied to this backup item. + PolicyState *string `json:"policyState,omitempty"` +} + +// AzureFileShareProtectionPolicy azureStorage backup policy. +type AzureFileShareProtectionPolicy struct { + // WorkLoadType - Type of workload for the backup management + WorkLoadType *string `json:"workLoadType,omitempty"` + // SchedulePolicy - Backup schedule specified as part of backup policy. + SchedulePolicy BasicSchedulePolicy `json:"schedulePolicy,omitempty"` + // RetentionPolicy - Retention policy with the details on backup copy retention ranges. + RetentionPolicy BasicRetentionPolicy `json:"retentionPolicy,omitempty"` + // TimeZone - TimeZone optional input as string. For example: TimeZone = "Pacific Standard Time". + TimeZone *string `json:"timeZone,omitempty"` + // ProtectedItemsCount - Number of items associated with this policy. + ProtectedItemsCount *int32 `json:"protectedItemsCount,omitempty"` + // BackupManagementType - Possible values include: 'BackupManagementTypeProtectionPolicy', 'BackupManagementTypeAzureStorage', 'BackupManagementTypeAzureIaasVM', 'BackupManagementTypeAzureSQL', 'BackupManagementTypeAzureWorkload', 'BackupManagementTypeGenericProtectionPolicy', 'BackupManagementTypeMAB' + BackupManagementType ManagementTypeBasicProtectionPolicy `json:"backupManagementType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureFileShareProtectionPolicy. +func (afspp AzureFileShareProtectionPolicy) MarshalJSON() ([]byte, error) { + afspp.BackupManagementType = BackupManagementTypeAzureStorage + objectMap := make(map[string]interface{}) + if afspp.WorkLoadType != nil { + objectMap["workLoadType"] = afspp.WorkLoadType + } + objectMap["schedulePolicy"] = afspp.SchedulePolicy + objectMap["retentionPolicy"] = afspp.RetentionPolicy + if afspp.TimeZone != nil { + objectMap["timeZone"] = afspp.TimeZone + } + if afspp.ProtectedItemsCount != nil { + objectMap["protectedItemsCount"] = afspp.ProtectedItemsCount + } + if afspp.BackupManagementType != "" { + objectMap["backupManagementType"] = afspp.BackupManagementType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareProtectionPolicy is the BasicProtectionPolicy implementation for AzureFileShareProtectionPolicy. +func (afspp AzureFileShareProtectionPolicy) AsAzureFileShareProtectionPolicy() (*AzureFileShareProtectionPolicy, bool) { + return &afspp, true +} + +// AsAzureIaaSVMProtectionPolicy is the BasicProtectionPolicy implementation for AzureFileShareProtectionPolicy. +func (afspp AzureFileShareProtectionPolicy) AsAzureIaaSVMProtectionPolicy() (*AzureIaaSVMProtectionPolicy, bool) { + return nil, false +} + +// AsAzureSQLProtectionPolicy is the BasicProtectionPolicy implementation for AzureFileShareProtectionPolicy. +func (afspp AzureFileShareProtectionPolicy) AsAzureSQLProtectionPolicy() (*AzureSQLProtectionPolicy, bool) { + return nil, false +} + +// AsAzureVMWorkloadProtectionPolicy is the BasicProtectionPolicy implementation for AzureFileShareProtectionPolicy. +func (afspp AzureFileShareProtectionPolicy) AsAzureVMWorkloadProtectionPolicy() (*AzureVMWorkloadProtectionPolicy, bool) { + return nil, false +} + +// AsGenericProtectionPolicy is the BasicProtectionPolicy implementation for AzureFileShareProtectionPolicy. +func (afspp AzureFileShareProtectionPolicy) AsGenericProtectionPolicy() (*GenericProtectionPolicy, bool) { + return nil, false +} + +// AsMabProtectionPolicy is the BasicProtectionPolicy implementation for AzureFileShareProtectionPolicy. +func (afspp AzureFileShareProtectionPolicy) AsMabProtectionPolicy() (*MabProtectionPolicy, bool) { + return nil, false +} + +// AsProtectionPolicy is the BasicProtectionPolicy implementation for AzureFileShareProtectionPolicy. +func (afspp AzureFileShareProtectionPolicy) AsProtectionPolicy() (*ProtectionPolicy, bool) { + return nil, false +} + +// AsBasicProtectionPolicy is the BasicProtectionPolicy implementation for AzureFileShareProtectionPolicy. +func (afspp AzureFileShareProtectionPolicy) AsBasicProtectionPolicy() (BasicProtectionPolicy, bool) { + return &afspp, true +} + +// UnmarshalJSON is the custom unmarshaler for AzureFileShareProtectionPolicy struct. +func (afspp *AzureFileShareProtectionPolicy) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "workLoadType": + if v != nil { + var workLoadType string + err = json.Unmarshal(*v, &workLoadType) + if err != nil { + return err + } + afspp.WorkLoadType = &workLoadType + } + case "schedulePolicy": + if v != nil { + schedulePolicy, err := unmarshalBasicSchedulePolicy(*v) + if err != nil { + return err + } + afspp.SchedulePolicy = schedulePolicy + } + case "retentionPolicy": + if v != nil { + retentionPolicy, err := unmarshalBasicRetentionPolicy(*v) + if err != nil { + return err + } + afspp.RetentionPolicy = retentionPolicy + } + case "timeZone": + if v != nil { + var timeZone string + err = json.Unmarshal(*v, &timeZone) + if err != nil { + return err + } + afspp.TimeZone = &timeZone + } + case "protectedItemsCount": + if v != nil { + var protectedItemsCount int32 + err = json.Unmarshal(*v, &protectedItemsCount) + if err != nil { + return err + } + afspp.ProtectedItemsCount = &protectedItemsCount + } + case "backupManagementType": + if v != nil { + var backupManagementType ManagementTypeBasicProtectionPolicy + err = json.Unmarshal(*v, &backupManagementType) + if err != nil { + return err + } + afspp.BackupManagementType = backupManagementType + } + } + } + + return nil +} + +// AzureFileShareRecoveryPoint azure File Share workload specific backup copy. +type AzureFileShareRecoveryPoint struct { + // RecoveryPointType - Type of the backup copy. Specifies whether it is a crash consistent backup or app consistent. + RecoveryPointType *string `json:"recoveryPointType,omitempty"` + // RecoveryPointTime - Time at which this backup copy was created. + RecoveryPointTime *date.Time `json:"recoveryPointTime,omitempty"` + // FileShareSnapshotURI - Contains Url to the snapshot of fileshare, if applicable + FileShareSnapshotURI *string `json:"fileShareSnapshotUri,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeRecoveryPoint', 'ObjectTypeAzureFileShareRecoveryPoint', 'ObjectTypeAzureWorkloadRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaRecoveryPoint', 'ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSQLRecoveryPoint', 'ObjectTypeGenericRecoveryPoint', 'ObjectTypeIaasVMRecoveryPoint' + ObjectType ObjectTypeBasicRecoveryPoint `json:"objectType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureFileShareRecoveryPoint. +func (afsrp AzureFileShareRecoveryPoint) MarshalJSON() ([]byte, error) { + afsrp.ObjectType = ObjectTypeAzureFileShareRecoveryPoint + objectMap := make(map[string]interface{}) + if afsrp.RecoveryPointType != nil { + objectMap["recoveryPointType"] = afsrp.RecoveryPointType + } + if afsrp.RecoveryPointTime != nil { + objectMap["recoveryPointTime"] = afsrp.RecoveryPointTime + } + if afsrp.FileShareSnapshotURI != nil { + objectMap["fileShareSnapshotUri"] = afsrp.FileShareSnapshotURI + } + if afsrp.ObjectType != "" { + objectMap["objectType"] = afsrp.ObjectType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareRecoveryPoint is the BasicRecoveryPoint implementation for AzureFileShareRecoveryPoint. +func (afsrp AzureFileShareRecoveryPoint) AsAzureFileShareRecoveryPoint() (*AzureFileShareRecoveryPoint, bool) { + return &afsrp, true +} + +// AsAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for AzureFileShareRecoveryPoint. +func (afsrp AzureFileShareRecoveryPoint) AsAzureWorkloadRecoveryPoint() (*AzureWorkloadRecoveryPoint, bool) { + return nil, false +} + +// AsBasicAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for AzureFileShareRecoveryPoint. +func (afsrp AzureFileShareRecoveryPoint) AsBasicAzureWorkloadRecoveryPoint() (BasicAzureWorkloadRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureFileShareRecoveryPoint. +func (afsrp AzureFileShareRecoveryPoint) AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadSAPHanaRecoveryPoint is the BasicRecoveryPoint implementation for AzureFileShareRecoveryPoint. +func (afsrp AzureFileShareRecoveryPoint) AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSAPHanaRecoveryPoint is the BasicRecoveryPoint implementation for AzureFileShareRecoveryPoint. +func (afsrp AzureFileShareRecoveryPoint) AsBasicAzureWorkloadSAPHanaRecoveryPoint() (BasicAzureWorkloadSAPHanaRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadSQLPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureFileShareRecoveryPoint. +func (afsrp AzureFileShareRecoveryPoint) AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for AzureFileShareRecoveryPoint. +func (afsrp AzureFileShareRecoveryPoint) AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for AzureFileShareRecoveryPoint. +func (afsrp AzureFileShareRecoveryPoint) AsBasicAzureWorkloadSQLRecoveryPoint() (BasicAzureWorkloadSQLRecoveryPoint, bool) { + return nil, false +} + +// AsGenericRecoveryPoint is the BasicRecoveryPoint implementation for AzureFileShareRecoveryPoint. +func (afsrp AzureFileShareRecoveryPoint) AsGenericRecoveryPoint() (*GenericRecoveryPoint, bool) { + return nil, false +} + +// AsIaasVMRecoveryPoint is the BasicRecoveryPoint implementation for AzureFileShareRecoveryPoint. +func (afsrp AzureFileShareRecoveryPoint) AsIaasVMRecoveryPoint() (*IaasVMRecoveryPoint, bool) { + return nil, false +} + +// AsRecoveryPoint is the BasicRecoveryPoint implementation for AzureFileShareRecoveryPoint. +func (afsrp AzureFileShareRecoveryPoint) AsRecoveryPoint() (*RecoveryPoint, bool) { + return nil, false +} + +// AsBasicRecoveryPoint is the BasicRecoveryPoint implementation for AzureFileShareRecoveryPoint. +func (afsrp AzureFileShareRecoveryPoint) AsBasicRecoveryPoint() (BasicRecoveryPoint, bool) { + return &afsrp, true +} + +// AzureFileShareRestoreRequest azureFileShare Restore Request +type AzureFileShareRestoreRequest struct { + // RecoveryType - Type of this recovery. Possible values include: 'RecoveryTypeInvalid', 'RecoveryTypeOriginalLocation', 'RecoveryTypeAlternateLocation', 'RecoveryTypeRestoreDisks' + RecoveryType RecoveryType `json:"recoveryType,omitempty"` + // SourceResourceID - Source storage account ARM Id + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // CopyOptions - Options to resolve copy conflicts. Possible values include: 'CopyOptionsInvalid', 'CopyOptionsCreateCopy', 'CopyOptionsSkip', 'CopyOptionsOverwrite', 'CopyOptionsFailOnConflict' + CopyOptions CopyOptions `json:"copyOptions,omitempty"` + // RestoreRequestType - Restore Type (FullShareRestore or ItemLevelRestore). Possible values include: 'RestoreRequestTypeInvalid', 'RestoreRequestTypeFullShareRestore', 'RestoreRequestTypeItemLevelRestore' + RestoreRequestType RestoreRequestType `json:"restoreRequestType,omitempty"` + // RestoreFileSpecs - List of Source Files/Folders(which need to recover) and TargetFolderPath details + RestoreFileSpecs *[]RestoreFileSpecs `json:"restoreFileSpecs,omitempty"` + // TargetDetails - Target File Share Details + TargetDetails *TargetAFSRestoreInfo `json:"targetDetails,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeRestoreRequest', 'ObjectTypeAzureFileShareRestoreRequest', 'ObjectTypeAzureWorkloadRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaRestoreRequest', 'ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSQLRestoreRequest', 'ObjectTypeIaasVMRestoreRequest' + ObjectType ObjectTypeBasicRestoreRequest `json:"objectType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureFileShareRestoreRequest. +func (afsrr AzureFileShareRestoreRequest) MarshalJSON() ([]byte, error) { + afsrr.ObjectType = ObjectTypeAzureFileShareRestoreRequest + objectMap := make(map[string]interface{}) + if afsrr.RecoveryType != "" { + objectMap["recoveryType"] = afsrr.RecoveryType + } + if afsrr.SourceResourceID != nil { + objectMap["sourceResourceId"] = afsrr.SourceResourceID + } + if afsrr.CopyOptions != "" { + objectMap["copyOptions"] = afsrr.CopyOptions + } + if afsrr.RestoreRequestType != "" { + objectMap["restoreRequestType"] = afsrr.RestoreRequestType + } + if afsrr.RestoreFileSpecs != nil { + objectMap["restoreFileSpecs"] = afsrr.RestoreFileSpecs + } + if afsrr.TargetDetails != nil { + objectMap["targetDetails"] = afsrr.TargetDetails + } + if afsrr.ObjectType != "" { + objectMap["objectType"] = afsrr.ObjectType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareRestoreRequest is the BasicRestoreRequest implementation for AzureFileShareRestoreRequest. +func (afsrr AzureFileShareRestoreRequest) AsAzureFileShareRestoreRequest() (*AzureFileShareRestoreRequest, bool) { + return &afsrr, true +} + +// AsAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureFileShareRestoreRequest. +func (afsrr AzureFileShareRestoreRequest) AsAzureWorkloadRestoreRequest() (*AzureWorkloadRestoreRequest, bool) { + return nil, false +} + +// AsBasicAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureFileShareRestoreRequest. +func (afsrr AzureFileShareRestoreRequest) AsBasicAzureWorkloadRestoreRequest() (BasicAzureWorkloadRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSAPHanaPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureFileShareRestoreRequest. +func (afsrr AzureFileShareRestoreRequest) AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureFileShareRestoreRequest. +func (afsrr AzureFileShareRestoreRequest) AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureFileShareRestoreRequest. +func (afsrr AzureFileShareRestoreRequest) AsBasicAzureWorkloadSAPHanaRestoreRequest() (BasicAzureWorkloadSAPHanaRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSQLPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureFileShareRestoreRequest. +func (afsrr AzureFileShareRestoreRequest) AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureFileShareRestoreRequest. +func (afsrr AzureFileShareRestoreRequest) AsAzureWorkloadSQLRestoreRequest() (*AzureWorkloadSQLRestoreRequest, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureFileShareRestoreRequest. +func (afsrr AzureFileShareRestoreRequest) AsBasicAzureWorkloadSQLRestoreRequest() (BasicAzureWorkloadSQLRestoreRequest, bool) { + return nil, false +} + +// AsIaasVMRestoreRequest is the BasicRestoreRequest implementation for AzureFileShareRestoreRequest. +func (afsrr AzureFileShareRestoreRequest) AsIaasVMRestoreRequest() (*IaasVMRestoreRequest, bool) { + return nil, false +} + +// AsRestoreRequest is the BasicRestoreRequest implementation for AzureFileShareRestoreRequest. +func (afsrr AzureFileShareRestoreRequest) AsRestoreRequest() (*RestoreRequest, bool) { + return nil, false +} + +// AsBasicRestoreRequest is the BasicRestoreRequest implementation for AzureFileShareRestoreRequest. +func (afsrr AzureFileShareRestoreRequest) AsBasicRestoreRequest() (BasicRestoreRequest, bool) { + return &afsrr, true +} + +// AzureIaaSClassicComputeVMContainer iaaS VM workload-specific backup item representing a classic virtual machine. +type AzureIaaSClassicComputeVMContainer struct { + // VirtualMachineID - Fully qualified ARM url of the virtual machine represented by this Azure IaaS VM container. + VirtualMachineID *string `json:"virtualMachineId,omitempty"` + // VirtualMachineVersion - Specifies whether the container represents a Classic or an Azure Resource Manager VM. + VirtualMachineVersion *string `json:"virtualMachineVersion,omitempty"` + // ResourceGroup - Resource group name of Recovery Services Vault. + ResourceGroup *string `json:"resourceGroup,omitempty"` + // FriendlyName - Friendly name of the container. + FriendlyName *string `json:"friendlyName,omitempty"` + // BackupManagementType - Type of backup managemenent for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // RegistrationStatus - Status of registration of the container with the Recovery Services Vault. + RegistrationStatus *string `json:"registrationStatus,omitempty"` + // HealthStatus - Status of health of the container. + HealthStatus *string `json:"healthStatus,omitempty"` + // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaaSVMContainer', 'ContainerTypeWindows1' + ContainerType ContainerTypeBasicProtectionContainer `json:"containerType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureIaaSClassicComputeVMContainer. +func (aisccvc AzureIaaSClassicComputeVMContainer) MarshalJSON() ([]byte, error) { + aisccvc.ContainerType = ContainerTypeMicrosoftClassicComputevirtualMachines + objectMap := make(map[string]interface{}) + if aisccvc.VirtualMachineID != nil { + objectMap["virtualMachineId"] = aisccvc.VirtualMachineID + } + if aisccvc.VirtualMachineVersion != nil { + objectMap["virtualMachineVersion"] = aisccvc.VirtualMachineVersion + } + if aisccvc.ResourceGroup != nil { + objectMap["resourceGroup"] = aisccvc.ResourceGroup + } + if aisccvc.FriendlyName != nil { + objectMap["friendlyName"] = aisccvc.FriendlyName + } + if aisccvc.BackupManagementType != "" { + objectMap["backupManagementType"] = aisccvc.BackupManagementType + } + if aisccvc.RegistrationStatus != nil { + objectMap["registrationStatus"] = aisccvc.RegistrationStatus + } + if aisccvc.HealthStatus != nil { + objectMap["healthStatus"] = aisccvc.HealthStatus + } + if aisccvc.ContainerType != "" { + objectMap["containerType"] = aisccvc.ContainerType + } + return json.Marshal(objectMap) +} + +// AsAzureBackupServerContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. +func (aisccvc AzureIaaSClassicComputeVMContainer) AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) { + return nil, false +} + +// AsAzureIaaSClassicComputeVMContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. +func (aisccvc AzureIaaSClassicComputeVMContainer) AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) { + return &aisccvc, true +} + +// AsAzureIaaSComputeVMContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. +func (aisccvc AzureIaaSClassicComputeVMContainer) AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) { + return nil, false +} + +// AsAzureSQLAGWorkloadContainerProtectionContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. +func (aisccvc AzureIaaSClassicComputeVMContainer) AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) { + return nil, false +} + +// AsAzureSQLContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. +func (aisccvc AzureIaaSClassicComputeVMContainer) AsAzureSQLContainer() (*AzureSQLContainer, bool) { + return nil, false +} + +// AsAzureStorageContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. +func (aisccvc AzureIaaSClassicComputeVMContainer) AsAzureStorageContainer() (*AzureStorageContainer, bool) { + return nil, false +} + +// AsAzureVMAppContainerProtectionContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. +func (aisccvc AzureIaaSClassicComputeVMContainer) AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) { + return nil, false +} + +// AsAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. +func (aisccvc AzureIaaSClassicComputeVMContainer) AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) { + return nil, false +} + +// AsBasicAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. +func (aisccvc AzureIaaSClassicComputeVMContainer) AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) { + return nil, false +} + +// AsDpmContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. +func (aisccvc AzureIaaSClassicComputeVMContainer) AsDpmContainer() (*DpmContainer, bool) { + return nil, false +} + +// AsGenericContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. +func (aisccvc AzureIaaSClassicComputeVMContainer) AsGenericContainer() (*GenericContainer, bool) { + return nil, false +} + +// AsIaaSVMContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. +func (aisccvc AzureIaaSClassicComputeVMContainer) AsIaaSVMContainer() (*IaaSVMContainer, bool) { + return nil, false +} + +// AsBasicIaaSVMContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. +func (aisccvc AzureIaaSClassicComputeVMContainer) AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) { + return &aisccvc, true +} + +// AsMabContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. +func (aisccvc AzureIaaSClassicComputeVMContainer) AsMabContainer() (*MabContainer, bool) { + return nil, false +} + +// AsProtectionContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. +func (aisccvc AzureIaaSClassicComputeVMContainer) AsProtectionContainer() (*ProtectionContainer, bool) { + return nil, false +} + +// AsBasicProtectionContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. +func (aisccvc AzureIaaSClassicComputeVMContainer) AsBasicProtectionContainer() (BasicProtectionContainer, bool) { + return &aisccvc, true +} + +// AzureIaaSClassicComputeVMProtectableItem iaaS VM workload-specific backup item representing the Classic Compute +// VM. +type AzureIaaSClassicComputeVMProtectableItem struct { + // VirtualMachineID - Fully qualified ARM ID of the virtual machine. + VirtualMachineID *string `json:"virtualMachineId,omitempty"` + // BackupManagementType - Type of backup managemenent to backup an item. + BackupManagementType *string `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload for the backup management + WorkloadType *string `json:"workloadType,omitempty"` + // FriendlyName - Friendly name of the backup item. + FriendlyName *string `json:"friendlyName,omitempty"` + // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' + ProtectionState ProtectionStatus `json:"protectionState,omitempty"` + // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' + ProtectableItemType ProtectableItemType `json:"protectableItemType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureIaaSClassicComputeVMProtectableItem. +func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) MarshalJSON() ([]byte, error) { + aisccvpi.ProtectableItemType = ProtectableItemTypeMicrosoftClassicComputevirtualMachines + objectMap := make(map[string]interface{}) + if aisccvpi.VirtualMachineID != nil { + objectMap["virtualMachineId"] = aisccvpi.VirtualMachineID + } + if aisccvpi.BackupManagementType != nil { + objectMap["backupManagementType"] = aisccvpi.BackupManagementType + } + if aisccvpi.WorkloadType != nil { + objectMap["workloadType"] = aisccvpi.WorkloadType + } + if aisccvpi.FriendlyName != nil { + objectMap["friendlyName"] = aisccvpi.FriendlyName + } + if aisccvpi.ProtectionState != "" { + objectMap["protectionState"] = aisccvpi.ProtectionState + } + if aisccvpi.ProtectableItemType != "" { + objectMap["protectableItemType"] = aisccvpi.ProtectableItemType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. +func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) { + return nil, false +} + +// AsAzureIaaSClassicComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. +func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) { + return &aisccvpi, true +} + +// AsAzureIaaSComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. +func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. +func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) { + return nil, false +} + +// AsBasicAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. +func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. +func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. +func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. +func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. +func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLInstanceProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. +func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) { + return nil, false +} + +// AsIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. +func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) { + return nil, false +} + +// AsBasicIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. +func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) { + return &aisccvpi, true +} + +// AsWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. +func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) { + return nil, false +} + +// AsBasicWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. +func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) { + return &aisccvpi, true +} + +// AzureIaaSClassicComputeVMProtectedItem iaaS VM workload-specific backup item representing the Classic Compute +// VM. +type AzureIaaSClassicComputeVMProtectedItem struct { + // FriendlyName - Friendly name of the VM represented by this backup item. + FriendlyName *string `json:"friendlyName,omitempty"` + // VirtualMachineID - Fully qualified ARM ID of the virtual machine represented by this item. + VirtualMachineID *string `json:"virtualMachineId,omitempty"` + // ProtectionStatus - Backup status of this backup item. + ProtectionStatus *string `json:"protectionStatus,omitempty"` + // ProtectionState - Backup state of this backup item. Possible values include: 'ProtectionStateInvalid', 'ProtectionStateIRPending', 'ProtectionStateProtected', 'ProtectionStateProtectionError', 'ProtectionStateProtectionStopped', 'ProtectionStateProtectionPaused' + ProtectionState ProtectionState `json:"protectionState,omitempty"` + // HealthStatus - Health status of protected item. Possible values include: 'HealthStatusPassed', 'HealthStatusActionRequired', 'HealthStatusActionSuggested', 'HealthStatusInvalid' + HealthStatus HealthStatus `json:"healthStatus,omitempty"` + // HealthDetails - Health details on this backup item. + HealthDetails *[]AzureIaaSVMHealthDetails `json:"healthDetails,omitempty"` + // LastBackupStatus - Last backup operation status. + LastBackupStatus *string `json:"lastBackupStatus,omitempty"` + // LastBackupTime - Timestamp of the last backup operation on this backup item. + LastBackupTime *date.Time `json:"lastBackupTime,omitempty"` + // ProtectedItemDataID - Data ID of the protected item. + ProtectedItemDataID *string `json:"protectedItemDataId,omitempty"` + // ExtendedInfo - Additional information for this backup item. + ExtendedInfo *AzureIaaSVMProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` + // BackupManagementType - Type of backup managemenent for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase' + WorkloadType DataSourceType `json:"workloadType,omitempty"` + // ContainerName - Unique name of container + ContainerName *string `json:"containerName,omitempty"` + // SourceResourceID - ARM ID of the resource to be backed up. + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // PolicyID - ID of the backup policy with which this item is backed up. + PolicyID *string `json:"policyId,omitempty"` + // LastRecoveryPoint - Timestamp when the last (latest) backup copy was created for this backup item. + LastRecoveryPoint *date.Time `json:"lastRecoveryPoint,omitempty"` + // BackupSetName - Name of the backup set the backup item belongs to + BackupSetName *string `json:"backupSetName,omitempty"` + // CreateMode - Create mode to indicate recovery of existing soft deleted data source or creation of new data source. Possible values include: 'CreateModeInvalid', 'CreateModeDefault', 'CreateModeRecover' + CreateMode CreateMode `json:"createMode,omitempty"` + // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' + ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureIaaSClassicComputeVMProtectedItem. +func (aisccvpi AzureIaaSClassicComputeVMProtectedItem) MarshalJSON() ([]byte, error) { + aisccvpi.ProtectedItemType = ProtectedItemTypeMicrosoftClassicComputevirtualMachines + objectMap := make(map[string]interface{}) + if aisccvpi.FriendlyName != nil { + objectMap["friendlyName"] = aisccvpi.FriendlyName + } + if aisccvpi.VirtualMachineID != nil { + objectMap["virtualMachineId"] = aisccvpi.VirtualMachineID + } + if aisccvpi.ProtectionStatus != nil { + objectMap["protectionStatus"] = aisccvpi.ProtectionStatus + } + if aisccvpi.ProtectionState != "" { + objectMap["protectionState"] = aisccvpi.ProtectionState + } + if aisccvpi.HealthStatus != "" { + objectMap["healthStatus"] = aisccvpi.HealthStatus + } + if aisccvpi.HealthDetails != nil { + objectMap["healthDetails"] = aisccvpi.HealthDetails + } + if aisccvpi.LastBackupStatus != nil { + objectMap["lastBackupStatus"] = aisccvpi.LastBackupStatus + } + if aisccvpi.LastBackupTime != nil { + objectMap["lastBackupTime"] = aisccvpi.LastBackupTime + } + if aisccvpi.ProtectedItemDataID != nil { + objectMap["protectedItemDataId"] = aisccvpi.ProtectedItemDataID + } + if aisccvpi.ExtendedInfo != nil { + objectMap["extendedInfo"] = aisccvpi.ExtendedInfo + } + if aisccvpi.BackupManagementType != "" { + objectMap["backupManagementType"] = aisccvpi.BackupManagementType + } + if aisccvpi.WorkloadType != "" { + objectMap["workloadType"] = aisccvpi.WorkloadType + } + if aisccvpi.ContainerName != nil { + objectMap["containerName"] = aisccvpi.ContainerName + } + if aisccvpi.SourceResourceID != nil { + objectMap["sourceResourceId"] = aisccvpi.SourceResourceID + } + if aisccvpi.PolicyID != nil { + objectMap["policyId"] = aisccvpi.PolicyID + } + if aisccvpi.LastRecoveryPoint != nil { + objectMap["lastRecoveryPoint"] = aisccvpi.LastRecoveryPoint + } + if aisccvpi.BackupSetName != nil { + objectMap["backupSetName"] = aisccvpi.BackupSetName + } + if aisccvpi.CreateMode != "" { + objectMap["createMode"] = aisccvpi.CreateMode + } + if aisccvpi.ProtectedItemType != "" { + objectMap["protectedItemType"] = aisccvpi.ProtectedItemType + } + return json.Marshal(objectMap) +} + +// AsAzureFileshareProtectedItem is the BasicProtectedItem implementation for AzureIaaSClassicComputeVMProtectedItem. +func (aisccvpi AzureIaaSClassicComputeVMProtectedItem) AsAzureFileshareProtectedItem() (*AzureFileshareProtectedItem, bool) { + return nil, false +} + +// AsAzureIaaSClassicComputeVMProtectedItem is the BasicProtectedItem implementation for AzureIaaSClassicComputeVMProtectedItem. +func (aisccvpi AzureIaaSClassicComputeVMProtectedItem) AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) { + return &aisccvpi, true +} + +// AsAzureIaaSComputeVMProtectedItem is the BasicProtectedItem implementation for AzureIaaSClassicComputeVMProtectedItem. +func (aisccvpi AzureIaaSClassicComputeVMProtectedItem) AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) { + return nil, false +} + +// AsAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureIaaSClassicComputeVMProtectedItem. +func (aisccvpi AzureIaaSClassicComputeVMProtectedItem) AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) { + return nil, false +} + +// AsBasicAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureIaaSClassicComputeVMProtectedItem. +func (aisccvpi AzureIaaSClassicComputeVMProtectedItem) AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) { + return &aisccvpi, true +} + +// AsAzureSQLProtectedItem is the BasicProtectedItem implementation for AzureIaaSClassicComputeVMProtectedItem. +func (aisccvpi AzureIaaSClassicComputeVMProtectedItem) AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureIaaSClassicComputeVMProtectedItem. +func (aisccvpi AzureIaaSClassicComputeVMProtectedItem) AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) { + return nil, false +} + +// AsBasicAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureIaaSClassicComputeVMProtectedItem. +func (aisccvpi AzureIaaSClassicComputeVMProtectedItem) AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaDatabaseProtectedItem is the BasicProtectedItem implementation for AzureIaaSClassicComputeVMProtectedItem. +func (aisccvpi AzureIaaSClassicComputeVMProtectedItem) AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLDatabaseProtectedItem is the BasicProtectedItem implementation for AzureIaaSClassicComputeVMProtectedItem. +func (aisccvpi AzureIaaSClassicComputeVMProtectedItem) AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) { + return nil, false +} + +// AsDPMProtectedItem is the BasicProtectedItem implementation for AzureIaaSClassicComputeVMProtectedItem. +func (aisccvpi AzureIaaSClassicComputeVMProtectedItem) AsDPMProtectedItem() (*DPMProtectedItem, bool) { + return nil, false +} + +// AsGenericProtectedItem is the BasicProtectedItem implementation for AzureIaaSClassicComputeVMProtectedItem. +func (aisccvpi AzureIaaSClassicComputeVMProtectedItem) AsGenericProtectedItem() (*GenericProtectedItem, bool) { + return nil, false +} + +// AsMabFileFolderProtectedItem is the BasicProtectedItem implementation for AzureIaaSClassicComputeVMProtectedItem. +func (aisccvpi AzureIaaSClassicComputeVMProtectedItem) AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) { + return nil, false +} + +// AsProtectedItem is the BasicProtectedItem implementation for AzureIaaSClassicComputeVMProtectedItem. +func (aisccvpi AzureIaaSClassicComputeVMProtectedItem) AsProtectedItem() (*ProtectedItem, bool) { + return nil, false +} + +// AsBasicProtectedItem is the BasicProtectedItem implementation for AzureIaaSClassicComputeVMProtectedItem. +func (aisccvpi AzureIaaSClassicComputeVMProtectedItem) AsBasicProtectedItem() (BasicProtectedItem, bool) { + return &aisccvpi, true +} + +// AzureIaaSComputeVMContainer iaaS VM workload-specific backup item representing an Azure Resource Manager virtual +// machine. +type AzureIaaSComputeVMContainer struct { + // VirtualMachineID - Fully qualified ARM url of the virtual machine represented by this Azure IaaS VM container. + VirtualMachineID *string `json:"virtualMachineId,omitempty"` + // VirtualMachineVersion - Specifies whether the container represents a Classic or an Azure Resource Manager VM. + VirtualMachineVersion *string `json:"virtualMachineVersion,omitempty"` + // ResourceGroup - Resource group name of Recovery Services Vault. + ResourceGroup *string `json:"resourceGroup,omitempty"` + // FriendlyName - Friendly name of the container. + FriendlyName *string `json:"friendlyName,omitempty"` + // BackupManagementType - Type of backup managemenent for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // RegistrationStatus - Status of registration of the container with the Recovery Services Vault. + RegistrationStatus *string `json:"registrationStatus,omitempty"` + // HealthStatus - Status of health of the container. + HealthStatus *string `json:"healthStatus,omitempty"` + // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaaSVMContainer', 'ContainerTypeWindows1' + ContainerType ContainerTypeBasicProtectionContainer `json:"containerType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureIaaSComputeVMContainer. +func (aiscvc AzureIaaSComputeVMContainer) MarshalJSON() ([]byte, error) { + aiscvc.ContainerType = ContainerTypeMicrosoftComputevirtualMachines + objectMap := make(map[string]interface{}) + if aiscvc.VirtualMachineID != nil { + objectMap["virtualMachineId"] = aiscvc.VirtualMachineID + } + if aiscvc.VirtualMachineVersion != nil { + objectMap["virtualMachineVersion"] = aiscvc.VirtualMachineVersion + } + if aiscvc.ResourceGroup != nil { + objectMap["resourceGroup"] = aiscvc.ResourceGroup + } + if aiscvc.FriendlyName != nil { + objectMap["friendlyName"] = aiscvc.FriendlyName + } + if aiscvc.BackupManagementType != "" { + objectMap["backupManagementType"] = aiscvc.BackupManagementType + } + if aiscvc.RegistrationStatus != nil { + objectMap["registrationStatus"] = aiscvc.RegistrationStatus + } + if aiscvc.HealthStatus != nil { + objectMap["healthStatus"] = aiscvc.HealthStatus + } + if aiscvc.ContainerType != "" { + objectMap["containerType"] = aiscvc.ContainerType + } + return json.Marshal(objectMap) +} + +// AsAzureBackupServerContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. +func (aiscvc AzureIaaSComputeVMContainer) AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) { + return nil, false +} + +// AsAzureIaaSClassicComputeVMContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. +func (aiscvc AzureIaaSComputeVMContainer) AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) { + return nil, false +} + +// AsAzureIaaSComputeVMContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. +func (aiscvc AzureIaaSComputeVMContainer) AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) { + return &aiscvc, true +} + +// AsAzureSQLAGWorkloadContainerProtectionContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. +func (aiscvc AzureIaaSComputeVMContainer) AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) { + return nil, false +} + +// AsAzureSQLContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. +func (aiscvc AzureIaaSComputeVMContainer) AsAzureSQLContainer() (*AzureSQLContainer, bool) { + return nil, false +} + +// AsAzureStorageContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. +func (aiscvc AzureIaaSComputeVMContainer) AsAzureStorageContainer() (*AzureStorageContainer, bool) { + return nil, false +} + +// AsAzureVMAppContainerProtectionContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. +func (aiscvc AzureIaaSComputeVMContainer) AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) { + return nil, false +} + +// AsAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. +func (aiscvc AzureIaaSComputeVMContainer) AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) { + return nil, false +} + +// AsBasicAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. +func (aiscvc AzureIaaSComputeVMContainer) AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) { + return nil, false +} + +// AsDpmContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. +func (aiscvc AzureIaaSComputeVMContainer) AsDpmContainer() (*DpmContainer, bool) { + return nil, false +} + +// AsGenericContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. +func (aiscvc AzureIaaSComputeVMContainer) AsGenericContainer() (*GenericContainer, bool) { + return nil, false +} + +// AsIaaSVMContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. +func (aiscvc AzureIaaSComputeVMContainer) AsIaaSVMContainer() (*IaaSVMContainer, bool) { + return nil, false +} + +// AsBasicIaaSVMContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. +func (aiscvc AzureIaaSComputeVMContainer) AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) { + return &aiscvc, true +} + +// AsMabContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. +func (aiscvc AzureIaaSComputeVMContainer) AsMabContainer() (*MabContainer, bool) { + return nil, false +} + +// AsProtectionContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. +func (aiscvc AzureIaaSComputeVMContainer) AsProtectionContainer() (*ProtectionContainer, bool) { + return nil, false +} + +// AsBasicProtectionContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. +func (aiscvc AzureIaaSComputeVMContainer) AsBasicProtectionContainer() (BasicProtectionContainer, bool) { + return &aiscvc, true +} + +// AzureIaaSComputeVMProtectableItem iaaS VM workload-specific backup item representing the Azure Resource Manager +// VM. +type AzureIaaSComputeVMProtectableItem struct { + // VirtualMachineID - Fully qualified ARM ID of the virtual machine. + VirtualMachineID *string `json:"virtualMachineId,omitempty"` + // BackupManagementType - Type of backup managemenent to backup an item. + BackupManagementType *string `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload for the backup management + WorkloadType *string `json:"workloadType,omitempty"` + // FriendlyName - Friendly name of the backup item. + FriendlyName *string `json:"friendlyName,omitempty"` + // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' + ProtectionState ProtectionStatus `json:"protectionState,omitempty"` + // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' + ProtectableItemType ProtectableItemType `json:"protectableItemType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureIaaSComputeVMProtectableItem. +func (aiscvpi AzureIaaSComputeVMProtectableItem) MarshalJSON() ([]byte, error) { + aiscvpi.ProtectableItemType = ProtectableItemTypeMicrosoftComputevirtualMachines + objectMap := make(map[string]interface{}) + if aiscvpi.VirtualMachineID != nil { + objectMap["virtualMachineId"] = aiscvpi.VirtualMachineID + } + if aiscvpi.BackupManagementType != nil { + objectMap["backupManagementType"] = aiscvpi.BackupManagementType + } + if aiscvpi.WorkloadType != nil { + objectMap["workloadType"] = aiscvpi.WorkloadType + } + if aiscvpi.FriendlyName != nil { + objectMap["friendlyName"] = aiscvpi.FriendlyName + } + if aiscvpi.ProtectionState != "" { + objectMap["protectionState"] = aiscvpi.ProtectionState + } + if aiscvpi.ProtectableItemType != "" { + objectMap["protectableItemType"] = aiscvpi.ProtectableItemType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. +func (aiscvpi AzureIaaSComputeVMProtectableItem) AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) { + return nil, false +} + +// AsAzureIaaSClassicComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. +func (aiscvpi AzureIaaSComputeVMProtectableItem) AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) { + return nil, false +} + +// AsAzureIaaSComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. +func (aiscvpi AzureIaaSComputeVMProtectableItem) AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) { + return &aiscvpi, true +} + +// AsAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. +func (aiscvpi AzureIaaSComputeVMProtectableItem) AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) { + return nil, false +} + +// AsBasicAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. +func (aiscvpi AzureIaaSComputeVMProtectableItem) AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. +func (aiscvpi AzureIaaSComputeVMProtectableItem) AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. +func (aiscvpi AzureIaaSComputeVMProtectableItem) AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. +func (aiscvpi AzureIaaSComputeVMProtectableItem) AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. +func (aiscvpi AzureIaaSComputeVMProtectableItem) AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLInstanceProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. +func (aiscvpi AzureIaaSComputeVMProtectableItem) AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) { + return nil, false +} + +// AsIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. +func (aiscvpi AzureIaaSComputeVMProtectableItem) AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) { + return nil, false +} + +// AsBasicIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. +func (aiscvpi AzureIaaSComputeVMProtectableItem) AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) { + return &aiscvpi, true +} + +// AsWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. +func (aiscvpi AzureIaaSComputeVMProtectableItem) AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) { + return nil, false +} + +// AsBasicWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. +func (aiscvpi AzureIaaSComputeVMProtectableItem) AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) { + return &aiscvpi, true +} + +// AzureIaaSComputeVMProtectedItem iaaS VM workload-specific backup item representing the Azure Resource Manager +// VM. +type AzureIaaSComputeVMProtectedItem struct { + // FriendlyName - Friendly name of the VM represented by this backup item. + FriendlyName *string `json:"friendlyName,omitempty"` + // VirtualMachineID - Fully qualified ARM ID of the virtual machine represented by this item. + VirtualMachineID *string `json:"virtualMachineId,omitempty"` + // ProtectionStatus - Backup status of this backup item. + ProtectionStatus *string `json:"protectionStatus,omitempty"` + // ProtectionState - Backup state of this backup item. Possible values include: 'ProtectionStateInvalid', 'ProtectionStateIRPending', 'ProtectionStateProtected', 'ProtectionStateProtectionError', 'ProtectionStateProtectionStopped', 'ProtectionStateProtectionPaused' + ProtectionState ProtectionState `json:"protectionState,omitempty"` + // HealthStatus - Health status of protected item. Possible values include: 'HealthStatusPassed', 'HealthStatusActionRequired', 'HealthStatusActionSuggested', 'HealthStatusInvalid' + HealthStatus HealthStatus `json:"healthStatus,omitempty"` + // HealthDetails - Health details on this backup item. + HealthDetails *[]AzureIaaSVMHealthDetails `json:"healthDetails,omitempty"` + // LastBackupStatus - Last backup operation status. + LastBackupStatus *string `json:"lastBackupStatus,omitempty"` + // LastBackupTime - Timestamp of the last backup operation on this backup item. + LastBackupTime *date.Time `json:"lastBackupTime,omitempty"` + // ProtectedItemDataID - Data ID of the protected item. + ProtectedItemDataID *string `json:"protectedItemDataId,omitempty"` + // ExtendedInfo - Additional information for this backup item. + ExtendedInfo *AzureIaaSVMProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` + // BackupManagementType - Type of backup managemenent for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase' + WorkloadType DataSourceType `json:"workloadType,omitempty"` + // ContainerName - Unique name of container + ContainerName *string `json:"containerName,omitempty"` + // SourceResourceID - ARM ID of the resource to be backed up. + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // PolicyID - ID of the backup policy with which this item is backed up. + PolicyID *string `json:"policyId,omitempty"` + // LastRecoveryPoint - Timestamp when the last (latest) backup copy was created for this backup item. + LastRecoveryPoint *date.Time `json:"lastRecoveryPoint,omitempty"` + // BackupSetName - Name of the backup set the backup item belongs to + BackupSetName *string `json:"backupSetName,omitempty"` + // CreateMode - Create mode to indicate recovery of existing soft deleted data source or creation of new data source. Possible values include: 'CreateModeInvalid', 'CreateModeDefault', 'CreateModeRecover' + CreateMode CreateMode `json:"createMode,omitempty"` + // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' + ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureIaaSComputeVMProtectedItem. +func (aiscvpi AzureIaaSComputeVMProtectedItem) MarshalJSON() ([]byte, error) { + aiscvpi.ProtectedItemType = ProtectedItemTypeMicrosoftComputevirtualMachines + objectMap := make(map[string]interface{}) + if aiscvpi.FriendlyName != nil { + objectMap["friendlyName"] = aiscvpi.FriendlyName + } + if aiscvpi.VirtualMachineID != nil { + objectMap["virtualMachineId"] = aiscvpi.VirtualMachineID + } + if aiscvpi.ProtectionStatus != nil { + objectMap["protectionStatus"] = aiscvpi.ProtectionStatus + } + if aiscvpi.ProtectionState != "" { + objectMap["protectionState"] = aiscvpi.ProtectionState + } + if aiscvpi.HealthStatus != "" { + objectMap["healthStatus"] = aiscvpi.HealthStatus + } + if aiscvpi.HealthDetails != nil { + objectMap["healthDetails"] = aiscvpi.HealthDetails + } + if aiscvpi.LastBackupStatus != nil { + objectMap["lastBackupStatus"] = aiscvpi.LastBackupStatus + } + if aiscvpi.LastBackupTime != nil { + objectMap["lastBackupTime"] = aiscvpi.LastBackupTime + } + if aiscvpi.ProtectedItemDataID != nil { + objectMap["protectedItemDataId"] = aiscvpi.ProtectedItemDataID + } + if aiscvpi.ExtendedInfo != nil { + objectMap["extendedInfo"] = aiscvpi.ExtendedInfo + } + if aiscvpi.BackupManagementType != "" { + objectMap["backupManagementType"] = aiscvpi.BackupManagementType + } + if aiscvpi.WorkloadType != "" { + objectMap["workloadType"] = aiscvpi.WorkloadType + } + if aiscvpi.ContainerName != nil { + objectMap["containerName"] = aiscvpi.ContainerName + } + if aiscvpi.SourceResourceID != nil { + objectMap["sourceResourceId"] = aiscvpi.SourceResourceID + } + if aiscvpi.PolicyID != nil { + objectMap["policyId"] = aiscvpi.PolicyID + } + if aiscvpi.LastRecoveryPoint != nil { + objectMap["lastRecoveryPoint"] = aiscvpi.LastRecoveryPoint + } + if aiscvpi.BackupSetName != nil { + objectMap["backupSetName"] = aiscvpi.BackupSetName + } + if aiscvpi.CreateMode != "" { + objectMap["createMode"] = aiscvpi.CreateMode + } + if aiscvpi.ProtectedItemType != "" { + objectMap["protectedItemType"] = aiscvpi.ProtectedItemType + } + return json.Marshal(objectMap) +} + +// AsAzureFileshareProtectedItem is the BasicProtectedItem implementation for AzureIaaSComputeVMProtectedItem. +func (aiscvpi AzureIaaSComputeVMProtectedItem) AsAzureFileshareProtectedItem() (*AzureFileshareProtectedItem, bool) { + return nil, false +} + +// AsAzureIaaSClassicComputeVMProtectedItem is the BasicProtectedItem implementation for AzureIaaSComputeVMProtectedItem. +func (aiscvpi AzureIaaSComputeVMProtectedItem) AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) { + return nil, false +} + +// AsAzureIaaSComputeVMProtectedItem is the BasicProtectedItem implementation for AzureIaaSComputeVMProtectedItem. +func (aiscvpi AzureIaaSComputeVMProtectedItem) AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) { + return &aiscvpi, true +} + +// AsAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureIaaSComputeVMProtectedItem. +func (aiscvpi AzureIaaSComputeVMProtectedItem) AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) { + return nil, false +} + +// AsBasicAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureIaaSComputeVMProtectedItem. +func (aiscvpi AzureIaaSComputeVMProtectedItem) AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) { + return &aiscvpi, true +} + +// AsAzureSQLProtectedItem is the BasicProtectedItem implementation for AzureIaaSComputeVMProtectedItem. +func (aiscvpi AzureIaaSComputeVMProtectedItem) AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureIaaSComputeVMProtectedItem. +func (aiscvpi AzureIaaSComputeVMProtectedItem) AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) { + return nil, false +} + +// AsBasicAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureIaaSComputeVMProtectedItem. +func (aiscvpi AzureIaaSComputeVMProtectedItem) AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaDatabaseProtectedItem is the BasicProtectedItem implementation for AzureIaaSComputeVMProtectedItem. +func (aiscvpi AzureIaaSComputeVMProtectedItem) AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLDatabaseProtectedItem is the BasicProtectedItem implementation for AzureIaaSComputeVMProtectedItem. +func (aiscvpi AzureIaaSComputeVMProtectedItem) AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) { + return nil, false +} + +// AsDPMProtectedItem is the BasicProtectedItem implementation for AzureIaaSComputeVMProtectedItem. +func (aiscvpi AzureIaaSComputeVMProtectedItem) AsDPMProtectedItem() (*DPMProtectedItem, bool) { + return nil, false +} + +// AsGenericProtectedItem is the BasicProtectedItem implementation for AzureIaaSComputeVMProtectedItem. +func (aiscvpi AzureIaaSComputeVMProtectedItem) AsGenericProtectedItem() (*GenericProtectedItem, bool) { + return nil, false +} + +// AsMabFileFolderProtectedItem is the BasicProtectedItem implementation for AzureIaaSComputeVMProtectedItem. +func (aiscvpi AzureIaaSComputeVMProtectedItem) AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) { + return nil, false +} + +// AsProtectedItem is the BasicProtectedItem implementation for AzureIaaSComputeVMProtectedItem. +func (aiscvpi AzureIaaSComputeVMProtectedItem) AsProtectedItem() (*ProtectedItem, bool) { + return nil, false +} + +// AsBasicProtectedItem is the BasicProtectedItem implementation for AzureIaaSComputeVMProtectedItem. +func (aiscvpi AzureIaaSComputeVMProtectedItem) AsBasicProtectedItem() (BasicProtectedItem, bool) { + return &aiscvpi, true +} + +// AzureIaaSVMHealthDetails azure IaaS VM workload-specific Health Details. +type AzureIaaSVMHealthDetails struct { + // Code - Health Code + Code *int32 `json:"code,omitempty"` + // Title - Health Title + Title *string `json:"title,omitempty"` + // Message - Health Message + Message *string `json:"message,omitempty"` + // Recommendations - Health Recommended Actions + Recommendations *[]string `json:"recommendations,omitempty"` +} + +// BasicAzureIaaSVMProtectedItem iaaS VM workload-specific backup item. +type BasicAzureIaaSVMProtectedItem interface { + AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) + AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) + AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) +} + +// AzureIaaSVMProtectedItem iaaS VM workload-specific backup item. +type AzureIaaSVMProtectedItem struct { + // FriendlyName - Friendly name of the VM represented by this backup item. + FriendlyName *string `json:"friendlyName,omitempty"` + // VirtualMachineID - Fully qualified ARM ID of the virtual machine represented by this item. + VirtualMachineID *string `json:"virtualMachineId,omitempty"` + // ProtectionStatus - Backup status of this backup item. + ProtectionStatus *string `json:"protectionStatus,omitempty"` + // ProtectionState - Backup state of this backup item. Possible values include: 'ProtectionStateInvalid', 'ProtectionStateIRPending', 'ProtectionStateProtected', 'ProtectionStateProtectionError', 'ProtectionStateProtectionStopped', 'ProtectionStateProtectionPaused' + ProtectionState ProtectionState `json:"protectionState,omitempty"` + // HealthStatus - Health status of protected item. Possible values include: 'HealthStatusPassed', 'HealthStatusActionRequired', 'HealthStatusActionSuggested', 'HealthStatusInvalid' + HealthStatus HealthStatus `json:"healthStatus,omitempty"` + // HealthDetails - Health details on this backup item. + HealthDetails *[]AzureIaaSVMHealthDetails `json:"healthDetails,omitempty"` + // LastBackupStatus - Last backup operation status. + LastBackupStatus *string `json:"lastBackupStatus,omitempty"` + // LastBackupTime - Timestamp of the last backup operation on this backup item. + LastBackupTime *date.Time `json:"lastBackupTime,omitempty"` + // ProtectedItemDataID - Data ID of the protected item. + ProtectedItemDataID *string `json:"protectedItemDataId,omitempty"` + // ExtendedInfo - Additional information for this backup item. + ExtendedInfo *AzureIaaSVMProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` + // BackupManagementType - Type of backup managemenent for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase' + WorkloadType DataSourceType `json:"workloadType,omitempty"` + // ContainerName - Unique name of container + ContainerName *string `json:"containerName,omitempty"` + // SourceResourceID - ARM ID of the resource to be backed up. + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // PolicyID - ID of the backup policy with which this item is backed up. + PolicyID *string `json:"policyId,omitempty"` + // LastRecoveryPoint - Timestamp when the last (latest) backup copy was created for this backup item. + LastRecoveryPoint *date.Time `json:"lastRecoveryPoint,omitempty"` + // BackupSetName - Name of the backup set the backup item belongs to + BackupSetName *string `json:"backupSetName,omitempty"` + // CreateMode - Create mode to indicate recovery of existing soft deleted data source or creation of new data source. Possible values include: 'CreateModeInvalid', 'CreateModeDefault', 'CreateModeRecover' + CreateMode CreateMode `json:"createMode,omitempty"` + // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' + ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` +} + +func unmarshalBasicAzureIaaSVMProtectedItem(body []byte) (BasicAzureIaaSVMProtectedItem, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["protectedItemType"] { + case string(ProtectedItemTypeMicrosoftClassicComputevirtualMachines): + var aisccvpi AzureIaaSClassicComputeVMProtectedItem + err := json.Unmarshal(body, &aisccvpi) + return aisccvpi, err + case string(ProtectedItemTypeMicrosoftComputevirtualMachines): + var aiscvpi AzureIaaSComputeVMProtectedItem + err := json.Unmarshal(body, &aiscvpi) + return aiscvpi, err + default: + var aispi AzureIaaSVMProtectedItem + err := json.Unmarshal(body, &aispi) + return aispi, err + } +} +func unmarshalBasicAzureIaaSVMProtectedItemArray(body []byte) ([]BasicAzureIaaSVMProtectedItem, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + aispiArray := make([]BasicAzureIaaSVMProtectedItem, len(rawMessages)) + + for index, rawMessage := range rawMessages { + aispi, err := unmarshalBasicAzureIaaSVMProtectedItem(*rawMessage) + if err != nil { + return nil, err + } + aispiArray[index] = aispi + } + return aispiArray, nil +} + +// MarshalJSON is the custom marshaler for AzureIaaSVMProtectedItem. +func (aispi AzureIaaSVMProtectedItem) MarshalJSON() ([]byte, error) { + aispi.ProtectedItemType = ProtectedItemTypeAzureIaaSVMProtectedItem + objectMap := make(map[string]interface{}) + if aispi.FriendlyName != nil { + objectMap["friendlyName"] = aispi.FriendlyName + } + if aispi.VirtualMachineID != nil { + objectMap["virtualMachineId"] = aispi.VirtualMachineID + } + if aispi.ProtectionStatus != nil { + objectMap["protectionStatus"] = aispi.ProtectionStatus + } + if aispi.ProtectionState != "" { + objectMap["protectionState"] = aispi.ProtectionState + } + if aispi.HealthStatus != "" { + objectMap["healthStatus"] = aispi.HealthStatus + } + if aispi.HealthDetails != nil { + objectMap["healthDetails"] = aispi.HealthDetails + } + if aispi.LastBackupStatus != nil { + objectMap["lastBackupStatus"] = aispi.LastBackupStatus + } + if aispi.LastBackupTime != nil { + objectMap["lastBackupTime"] = aispi.LastBackupTime + } + if aispi.ProtectedItemDataID != nil { + objectMap["protectedItemDataId"] = aispi.ProtectedItemDataID + } + if aispi.ExtendedInfo != nil { + objectMap["extendedInfo"] = aispi.ExtendedInfo + } + if aispi.BackupManagementType != "" { + objectMap["backupManagementType"] = aispi.BackupManagementType + } + if aispi.WorkloadType != "" { + objectMap["workloadType"] = aispi.WorkloadType + } + if aispi.ContainerName != nil { + objectMap["containerName"] = aispi.ContainerName + } + if aispi.SourceResourceID != nil { + objectMap["sourceResourceId"] = aispi.SourceResourceID + } + if aispi.PolicyID != nil { + objectMap["policyId"] = aispi.PolicyID + } + if aispi.LastRecoveryPoint != nil { + objectMap["lastRecoveryPoint"] = aispi.LastRecoveryPoint + } + if aispi.BackupSetName != nil { + objectMap["backupSetName"] = aispi.BackupSetName + } + if aispi.CreateMode != "" { + objectMap["createMode"] = aispi.CreateMode + } + if aispi.ProtectedItemType != "" { + objectMap["protectedItemType"] = aispi.ProtectedItemType + } + return json.Marshal(objectMap) +} + +// AsAzureFileshareProtectedItem is the BasicProtectedItem implementation for AzureIaaSVMProtectedItem. +func (aispi AzureIaaSVMProtectedItem) AsAzureFileshareProtectedItem() (*AzureFileshareProtectedItem, bool) { + return nil, false +} + +// AsAzureIaaSClassicComputeVMProtectedItem is the BasicProtectedItem implementation for AzureIaaSVMProtectedItem. +func (aispi AzureIaaSVMProtectedItem) AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) { + return nil, false +} + +// AsAzureIaaSComputeVMProtectedItem is the BasicProtectedItem implementation for AzureIaaSVMProtectedItem. +func (aispi AzureIaaSVMProtectedItem) AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) { + return nil, false +} + +// AsAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureIaaSVMProtectedItem. +func (aispi AzureIaaSVMProtectedItem) AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) { + return &aispi, true +} + +// AsBasicAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureIaaSVMProtectedItem. +func (aispi AzureIaaSVMProtectedItem) AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) { + return &aispi, true +} + +// AsAzureSQLProtectedItem is the BasicProtectedItem implementation for AzureIaaSVMProtectedItem. +func (aispi AzureIaaSVMProtectedItem) AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureIaaSVMProtectedItem. +func (aispi AzureIaaSVMProtectedItem) AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) { + return nil, false +} + +// AsBasicAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureIaaSVMProtectedItem. +func (aispi AzureIaaSVMProtectedItem) AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaDatabaseProtectedItem is the BasicProtectedItem implementation for AzureIaaSVMProtectedItem. +func (aispi AzureIaaSVMProtectedItem) AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLDatabaseProtectedItem is the BasicProtectedItem implementation for AzureIaaSVMProtectedItem. +func (aispi AzureIaaSVMProtectedItem) AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) { + return nil, false +} + +// AsDPMProtectedItem is the BasicProtectedItem implementation for AzureIaaSVMProtectedItem. +func (aispi AzureIaaSVMProtectedItem) AsDPMProtectedItem() (*DPMProtectedItem, bool) { + return nil, false +} + +// AsGenericProtectedItem is the BasicProtectedItem implementation for AzureIaaSVMProtectedItem. +func (aispi AzureIaaSVMProtectedItem) AsGenericProtectedItem() (*GenericProtectedItem, bool) { + return nil, false +} + +// AsMabFileFolderProtectedItem is the BasicProtectedItem implementation for AzureIaaSVMProtectedItem. +func (aispi AzureIaaSVMProtectedItem) AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) { + return nil, false +} + +// AsProtectedItem is the BasicProtectedItem implementation for AzureIaaSVMProtectedItem. +func (aispi AzureIaaSVMProtectedItem) AsProtectedItem() (*ProtectedItem, bool) { + return nil, false +} + +// AsBasicProtectedItem is the BasicProtectedItem implementation for AzureIaaSVMProtectedItem. +func (aispi AzureIaaSVMProtectedItem) AsBasicProtectedItem() (BasicProtectedItem, bool) { + return &aispi, true +} + +// AzureIaaSVMProtectedItemExtendedInfo additional information on Azure IaaS VM specific backup item. +type AzureIaaSVMProtectedItemExtendedInfo struct { + // OldestRecoveryPoint - The oldest backup copy available for this backup item. + OldestRecoveryPoint *date.Time `json:"oldestRecoveryPoint,omitempty"` + // RecoveryPointCount - Number of backup copies available for this backup item. + RecoveryPointCount *int32 `json:"recoveryPointCount,omitempty"` + // PolicyInconsistent - Specifies if backup policy associated with the backup item is inconsistent. + PolicyInconsistent *bool `json:"policyInconsistent,omitempty"` +} + +// AzureIaaSVMProtectionPolicy iaaS VM workload-specific backup policy. +type AzureIaaSVMProtectionPolicy struct { + // SchedulePolicy - Backup schedule specified as part of backup policy. + SchedulePolicy BasicSchedulePolicy `json:"schedulePolicy,omitempty"` + // RetentionPolicy - Retention policy with the details on backup copy retention ranges. + RetentionPolicy BasicRetentionPolicy `json:"retentionPolicy,omitempty"` + // InstantRpRetentionRangeInDays - Instant RP retention policy range in days + InstantRpRetentionRangeInDays *int32 `json:"instantRpRetentionRangeInDays,omitempty"` + // TimeZone - TimeZone optional input as string. For example: TimeZone = "Pacific Standard Time". + TimeZone *string `json:"timeZone,omitempty"` + // ProtectedItemsCount - Number of items associated with this policy. + ProtectedItemsCount *int32 `json:"protectedItemsCount,omitempty"` + // BackupManagementType - Possible values include: 'BackupManagementTypeProtectionPolicy', 'BackupManagementTypeAzureStorage', 'BackupManagementTypeAzureIaasVM', 'BackupManagementTypeAzureSQL', 'BackupManagementTypeAzureWorkload', 'BackupManagementTypeGenericProtectionPolicy', 'BackupManagementTypeMAB' + BackupManagementType ManagementTypeBasicProtectionPolicy `json:"backupManagementType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureIaaSVMProtectionPolicy. +func (aispp AzureIaaSVMProtectionPolicy) MarshalJSON() ([]byte, error) { + aispp.BackupManagementType = BackupManagementTypeAzureIaasVM + objectMap := make(map[string]interface{}) + objectMap["schedulePolicy"] = aispp.SchedulePolicy + objectMap["retentionPolicy"] = aispp.RetentionPolicy + if aispp.InstantRpRetentionRangeInDays != nil { + objectMap["instantRpRetentionRangeInDays"] = aispp.InstantRpRetentionRangeInDays + } + if aispp.TimeZone != nil { + objectMap["timeZone"] = aispp.TimeZone + } + if aispp.ProtectedItemsCount != nil { + objectMap["protectedItemsCount"] = aispp.ProtectedItemsCount + } + if aispp.BackupManagementType != "" { + objectMap["backupManagementType"] = aispp.BackupManagementType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareProtectionPolicy is the BasicProtectionPolicy implementation for AzureIaaSVMProtectionPolicy. +func (aispp AzureIaaSVMProtectionPolicy) AsAzureFileShareProtectionPolicy() (*AzureFileShareProtectionPolicy, bool) { + return nil, false +} + +// AsAzureIaaSVMProtectionPolicy is the BasicProtectionPolicy implementation for AzureIaaSVMProtectionPolicy. +func (aispp AzureIaaSVMProtectionPolicy) AsAzureIaaSVMProtectionPolicy() (*AzureIaaSVMProtectionPolicy, bool) { + return &aispp, true +} + +// AsAzureSQLProtectionPolicy is the BasicProtectionPolicy implementation for AzureIaaSVMProtectionPolicy. +func (aispp AzureIaaSVMProtectionPolicy) AsAzureSQLProtectionPolicy() (*AzureSQLProtectionPolicy, bool) { + return nil, false +} + +// AsAzureVMWorkloadProtectionPolicy is the BasicProtectionPolicy implementation for AzureIaaSVMProtectionPolicy. +func (aispp AzureIaaSVMProtectionPolicy) AsAzureVMWorkloadProtectionPolicy() (*AzureVMWorkloadProtectionPolicy, bool) { + return nil, false +} + +// AsGenericProtectionPolicy is the BasicProtectionPolicy implementation for AzureIaaSVMProtectionPolicy. +func (aispp AzureIaaSVMProtectionPolicy) AsGenericProtectionPolicy() (*GenericProtectionPolicy, bool) { + return nil, false +} + +// AsMabProtectionPolicy is the BasicProtectionPolicy implementation for AzureIaaSVMProtectionPolicy. +func (aispp AzureIaaSVMProtectionPolicy) AsMabProtectionPolicy() (*MabProtectionPolicy, bool) { + return nil, false +} + +// AsProtectionPolicy is the BasicProtectionPolicy implementation for AzureIaaSVMProtectionPolicy. +func (aispp AzureIaaSVMProtectionPolicy) AsProtectionPolicy() (*ProtectionPolicy, bool) { + return nil, false +} + +// AsBasicProtectionPolicy is the BasicProtectionPolicy implementation for AzureIaaSVMProtectionPolicy. +func (aispp AzureIaaSVMProtectionPolicy) AsBasicProtectionPolicy() (BasicProtectionPolicy, bool) { + return &aispp, true +} + +// UnmarshalJSON is the custom unmarshaler for AzureIaaSVMProtectionPolicy struct. +func (aispp *AzureIaaSVMProtectionPolicy) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "schedulePolicy": + if v != nil { + schedulePolicy, err := unmarshalBasicSchedulePolicy(*v) + if err != nil { + return err + } + aispp.SchedulePolicy = schedulePolicy + } + case "retentionPolicy": + if v != nil { + retentionPolicy, err := unmarshalBasicRetentionPolicy(*v) + if err != nil { + return err + } + aispp.RetentionPolicy = retentionPolicy + } + case "instantRpRetentionRangeInDays": + if v != nil { + var instantRpRetentionRangeInDays int32 + err = json.Unmarshal(*v, &instantRpRetentionRangeInDays) + if err != nil { + return err + } + aispp.InstantRpRetentionRangeInDays = &instantRpRetentionRangeInDays + } + case "timeZone": + if v != nil { + var timeZone string + err = json.Unmarshal(*v, &timeZone) + if err != nil { + return err + } + aispp.TimeZone = &timeZone + } + case "protectedItemsCount": + if v != nil { + var protectedItemsCount int32 + err = json.Unmarshal(*v, &protectedItemsCount) + if err != nil { + return err + } + aispp.ProtectedItemsCount = &protectedItemsCount + } + case "backupManagementType": + if v != nil { + var backupManagementType ManagementTypeBasicProtectionPolicy + err = json.Unmarshal(*v, &backupManagementType) + if err != nil { + return err + } + aispp.BackupManagementType = backupManagementType + } + } + } + + return nil +} + +// AzureSQLAGWorkloadContainerProtectionContainer container for SQL workloads under SQL Availability Group. +type AzureSQLAGWorkloadContainerProtectionContainer struct { + // SourceResourceID - ARM ID of the virtual machine represented by this Azure Workload Container + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // LastUpdatedTime - Time stamp when this container was updated. + LastUpdatedTime *date.Time `json:"lastUpdatedTime,omitempty"` + // ExtendedInfo - Additional details of a workload container. + ExtendedInfo *AzureWorkloadContainerExtendedInfo `json:"extendedInfo,omitempty"` + // WorkloadType - Workload type for which registration was sent. Possible values include: 'WorkloadTypeInvalid', 'WorkloadTypeVM', 'WorkloadTypeFileFolder', 'WorkloadTypeAzureSQLDb', 'WorkloadTypeSQLDB', 'WorkloadTypeExchange', 'WorkloadTypeSharepoint', 'WorkloadTypeVMwareVM', 'WorkloadTypeSystemState', 'WorkloadTypeClient', 'WorkloadTypeGenericDataSource', 'WorkloadTypeSQLDataBase', 'WorkloadTypeAzureFileShare', 'WorkloadTypeSAPHanaDatabase' + WorkloadType WorkloadType `json:"workloadType,omitempty"` + // FriendlyName - Friendly name of the container. + FriendlyName *string `json:"friendlyName,omitempty"` + // BackupManagementType - Type of backup managemenent for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // RegistrationStatus - Status of registration of the container with the Recovery Services Vault. + RegistrationStatus *string `json:"registrationStatus,omitempty"` + // HealthStatus - Status of health of the container. + HealthStatus *string `json:"healthStatus,omitempty"` + // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaaSVMContainer', 'ContainerTypeWindows1' + ContainerType ContainerTypeBasicProtectionContainer `json:"containerType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureSQLAGWorkloadContainerProtectionContainer. +func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) MarshalJSON() ([]byte, error) { + aswcpc.ContainerType = ContainerTypeSQLAGWorkLoadContainer1 + objectMap := make(map[string]interface{}) + if aswcpc.SourceResourceID != nil { + objectMap["sourceResourceId"] = aswcpc.SourceResourceID + } + if aswcpc.LastUpdatedTime != nil { + objectMap["lastUpdatedTime"] = aswcpc.LastUpdatedTime + } + if aswcpc.ExtendedInfo != nil { + objectMap["extendedInfo"] = aswcpc.ExtendedInfo + } + if aswcpc.WorkloadType != "" { + objectMap["workloadType"] = aswcpc.WorkloadType + } + if aswcpc.FriendlyName != nil { + objectMap["friendlyName"] = aswcpc.FriendlyName + } + if aswcpc.BackupManagementType != "" { + objectMap["backupManagementType"] = aswcpc.BackupManagementType + } + if aswcpc.RegistrationStatus != nil { + objectMap["registrationStatus"] = aswcpc.RegistrationStatus + } + if aswcpc.HealthStatus != nil { + objectMap["healthStatus"] = aswcpc.HealthStatus + } + if aswcpc.ContainerType != "" { + objectMap["containerType"] = aswcpc.ContainerType + } + return json.Marshal(objectMap) +} + +// AsAzureBackupServerContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. +func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) { + return nil, false +} + +// AsAzureIaaSClassicComputeVMContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. +func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) { + return nil, false +} + +// AsAzureIaaSComputeVMContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. +func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) { + return nil, false +} + +// AsAzureSQLAGWorkloadContainerProtectionContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. +func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) { + return &aswcpc, true +} + +// AsAzureSQLContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. +func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsAzureSQLContainer() (*AzureSQLContainer, bool) { + return nil, false +} + +// AsAzureStorageContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. +func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsAzureStorageContainer() (*AzureStorageContainer, bool) { + return nil, false +} + +// AsAzureVMAppContainerProtectionContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. +func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) { + return nil, false +} + +// AsAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. +func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) { + return nil, false +} + +// AsBasicAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. +func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) { + return &aswcpc, true +} + +// AsDpmContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. +func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsDpmContainer() (*DpmContainer, bool) { + return nil, false +} + +// AsGenericContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. +func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsGenericContainer() (*GenericContainer, bool) { + return nil, false +} + +// AsIaaSVMContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. +func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsIaaSVMContainer() (*IaaSVMContainer, bool) { + return nil, false +} + +// AsBasicIaaSVMContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. +func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) { + return nil, false +} + +// AsMabContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. +func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsMabContainer() (*MabContainer, bool) { + return nil, false +} + +// AsProtectionContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. +func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsProtectionContainer() (*ProtectionContainer, bool) { + return nil, false +} + +// AsBasicProtectionContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. +func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsBasicProtectionContainer() (BasicProtectionContainer, bool) { + return &aswcpc, true +} + +// AzureSQLContainer azure Sql workload-specific container. +type AzureSQLContainer struct { + // FriendlyName - Friendly name of the container. + FriendlyName *string `json:"friendlyName,omitempty"` + // BackupManagementType - Type of backup managemenent for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // RegistrationStatus - Status of registration of the container with the Recovery Services Vault. + RegistrationStatus *string `json:"registrationStatus,omitempty"` + // HealthStatus - Status of health of the container. + HealthStatus *string `json:"healthStatus,omitempty"` + // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaaSVMContainer', 'ContainerTypeWindows1' + ContainerType ContainerTypeBasicProtectionContainer `json:"containerType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureSQLContainer. +func (asc AzureSQLContainer) MarshalJSON() ([]byte, error) { + asc.ContainerType = ContainerTypeAzureSQLContainer1 + objectMap := make(map[string]interface{}) + if asc.FriendlyName != nil { + objectMap["friendlyName"] = asc.FriendlyName + } + if asc.BackupManagementType != "" { + objectMap["backupManagementType"] = asc.BackupManagementType + } + if asc.RegistrationStatus != nil { + objectMap["registrationStatus"] = asc.RegistrationStatus + } + if asc.HealthStatus != nil { + objectMap["healthStatus"] = asc.HealthStatus + } + if asc.ContainerType != "" { + objectMap["containerType"] = asc.ContainerType + } + return json.Marshal(objectMap) +} + +// AsAzureBackupServerContainer is the BasicProtectionContainer implementation for AzureSQLContainer. +func (asc AzureSQLContainer) AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) { + return nil, false +} + +// AsAzureIaaSClassicComputeVMContainer is the BasicProtectionContainer implementation for AzureSQLContainer. +func (asc AzureSQLContainer) AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) { + return nil, false +} + +// AsAzureIaaSComputeVMContainer is the BasicProtectionContainer implementation for AzureSQLContainer. +func (asc AzureSQLContainer) AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) { + return nil, false +} + +// AsAzureSQLAGWorkloadContainerProtectionContainer is the BasicProtectionContainer implementation for AzureSQLContainer. +func (asc AzureSQLContainer) AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) { + return nil, false +} + +// AsAzureSQLContainer is the BasicProtectionContainer implementation for AzureSQLContainer. +func (asc AzureSQLContainer) AsAzureSQLContainer() (*AzureSQLContainer, bool) { + return &asc, true +} + +// AsAzureStorageContainer is the BasicProtectionContainer implementation for AzureSQLContainer. +func (asc AzureSQLContainer) AsAzureStorageContainer() (*AzureStorageContainer, bool) { + return nil, false +} + +// AsAzureVMAppContainerProtectionContainer is the BasicProtectionContainer implementation for AzureSQLContainer. +func (asc AzureSQLContainer) AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) { + return nil, false +} + +// AsAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureSQLContainer. +func (asc AzureSQLContainer) AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) { + return nil, false +} + +// AsBasicAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureSQLContainer. +func (asc AzureSQLContainer) AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) { + return nil, false +} + +// AsDpmContainer is the BasicProtectionContainer implementation for AzureSQLContainer. +func (asc AzureSQLContainer) AsDpmContainer() (*DpmContainer, bool) { + return nil, false +} + +// AsGenericContainer is the BasicProtectionContainer implementation for AzureSQLContainer. +func (asc AzureSQLContainer) AsGenericContainer() (*GenericContainer, bool) { + return nil, false +} + +// AsIaaSVMContainer is the BasicProtectionContainer implementation for AzureSQLContainer. +func (asc AzureSQLContainer) AsIaaSVMContainer() (*IaaSVMContainer, bool) { + return nil, false +} + +// AsBasicIaaSVMContainer is the BasicProtectionContainer implementation for AzureSQLContainer. +func (asc AzureSQLContainer) AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) { + return nil, false +} + +// AsMabContainer is the BasicProtectionContainer implementation for AzureSQLContainer. +func (asc AzureSQLContainer) AsMabContainer() (*MabContainer, bool) { + return nil, false +} + +// AsProtectionContainer is the BasicProtectionContainer implementation for AzureSQLContainer. +func (asc AzureSQLContainer) AsProtectionContainer() (*ProtectionContainer, bool) { + return nil, false +} + +// AsBasicProtectionContainer is the BasicProtectionContainer implementation for AzureSQLContainer. +func (asc AzureSQLContainer) AsBasicProtectionContainer() (BasicProtectionContainer, bool) { + return &asc, true +} + +// AzureSQLProtectedItem azure SQL workload-specific backup item. +type AzureSQLProtectedItem struct { + // ProtectedItemDataID - Internal ID of a backup item. Used by Azure SQL Backup engine to contact Recovery Services. + ProtectedItemDataID *string `json:"protectedItemDataId,omitempty"` + // ProtectionState - Backup state of the backed up item. Possible values include: 'ProtectedItemStateInvalid', 'ProtectedItemStateIRPending', 'ProtectedItemStateProtected', 'ProtectedItemStateProtectionError', 'ProtectedItemStateProtectionStopped', 'ProtectedItemStateProtectionPaused' + ProtectionState ProtectedItemState `json:"protectionState,omitempty"` + // ExtendedInfo - Additional information for this backup item. + ExtendedInfo *AzureSQLProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` + // BackupManagementType - Type of backup managemenent for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase' + WorkloadType DataSourceType `json:"workloadType,omitempty"` + // ContainerName - Unique name of container + ContainerName *string `json:"containerName,omitempty"` + // SourceResourceID - ARM ID of the resource to be backed up. + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // PolicyID - ID of the backup policy with which this item is backed up. + PolicyID *string `json:"policyId,omitempty"` + // LastRecoveryPoint - Timestamp when the last (latest) backup copy was created for this backup item. + LastRecoveryPoint *date.Time `json:"lastRecoveryPoint,omitempty"` + // BackupSetName - Name of the backup set the backup item belongs to + BackupSetName *string `json:"backupSetName,omitempty"` + // CreateMode - Create mode to indicate recovery of existing soft deleted data source or creation of new data source. Possible values include: 'CreateModeInvalid', 'CreateModeDefault', 'CreateModeRecover' + CreateMode CreateMode `json:"createMode,omitempty"` + // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' + ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureSQLProtectedItem. +func (aspi AzureSQLProtectedItem) MarshalJSON() ([]byte, error) { + aspi.ProtectedItemType = ProtectedItemTypeMicrosoftSqlserversdatabases + objectMap := make(map[string]interface{}) + if aspi.ProtectedItemDataID != nil { + objectMap["protectedItemDataId"] = aspi.ProtectedItemDataID + } + if aspi.ProtectionState != "" { + objectMap["protectionState"] = aspi.ProtectionState + } + if aspi.ExtendedInfo != nil { + objectMap["extendedInfo"] = aspi.ExtendedInfo + } + if aspi.BackupManagementType != "" { + objectMap["backupManagementType"] = aspi.BackupManagementType + } + if aspi.WorkloadType != "" { + objectMap["workloadType"] = aspi.WorkloadType + } + if aspi.ContainerName != nil { + objectMap["containerName"] = aspi.ContainerName + } + if aspi.SourceResourceID != nil { + objectMap["sourceResourceId"] = aspi.SourceResourceID + } + if aspi.PolicyID != nil { + objectMap["policyId"] = aspi.PolicyID + } + if aspi.LastRecoveryPoint != nil { + objectMap["lastRecoveryPoint"] = aspi.LastRecoveryPoint + } + if aspi.BackupSetName != nil { + objectMap["backupSetName"] = aspi.BackupSetName + } + if aspi.CreateMode != "" { + objectMap["createMode"] = aspi.CreateMode + } + if aspi.ProtectedItemType != "" { + objectMap["protectedItemType"] = aspi.ProtectedItemType + } + return json.Marshal(objectMap) +} + +// AsAzureFileshareProtectedItem is the BasicProtectedItem implementation for AzureSQLProtectedItem. +func (aspi AzureSQLProtectedItem) AsAzureFileshareProtectedItem() (*AzureFileshareProtectedItem, bool) { + return nil, false +} + +// AsAzureIaaSClassicComputeVMProtectedItem is the BasicProtectedItem implementation for AzureSQLProtectedItem. +func (aspi AzureSQLProtectedItem) AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) { + return nil, false +} + +// AsAzureIaaSComputeVMProtectedItem is the BasicProtectedItem implementation for AzureSQLProtectedItem. +func (aspi AzureSQLProtectedItem) AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) { + return nil, false +} + +// AsAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureSQLProtectedItem. +func (aspi AzureSQLProtectedItem) AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) { + return nil, false +} + +// AsBasicAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureSQLProtectedItem. +func (aspi AzureSQLProtectedItem) AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) { + return nil, false +} + +// AsAzureSQLProtectedItem is the BasicProtectedItem implementation for AzureSQLProtectedItem. +func (aspi AzureSQLProtectedItem) AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) { + return &aspi, true +} + +// AsAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureSQLProtectedItem. +func (aspi AzureSQLProtectedItem) AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) { + return nil, false +} + +// AsBasicAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureSQLProtectedItem. +func (aspi AzureSQLProtectedItem) AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaDatabaseProtectedItem is the BasicProtectedItem implementation for AzureSQLProtectedItem. +func (aspi AzureSQLProtectedItem) AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLDatabaseProtectedItem is the BasicProtectedItem implementation for AzureSQLProtectedItem. +func (aspi AzureSQLProtectedItem) AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) { + return nil, false +} + +// AsDPMProtectedItem is the BasicProtectedItem implementation for AzureSQLProtectedItem. +func (aspi AzureSQLProtectedItem) AsDPMProtectedItem() (*DPMProtectedItem, bool) { + return nil, false +} + +// AsGenericProtectedItem is the BasicProtectedItem implementation for AzureSQLProtectedItem. +func (aspi AzureSQLProtectedItem) AsGenericProtectedItem() (*GenericProtectedItem, bool) { + return nil, false +} + +// AsMabFileFolderProtectedItem is the BasicProtectedItem implementation for AzureSQLProtectedItem. +func (aspi AzureSQLProtectedItem) AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) { + return nil, false +} + +// AsProtectedItem is the BasicProtectedItem implementation for AzureSQLProtectedItem. +func (aspi AzureSQLProtectedItem) AsProtectedItem() (*ProtectedItem, bool) { + return nil, false +} + +// AsBasicProtectedItem is the BasicProtectedItem implementation for AzureSQLProtectedItem. +func (aspi AzureSQLProtectedItem) AsBasicProtectedItem() (BasicProtectedItem, bool) { + return &aspi, true +} + +// AzureSQLProtectedItemExtendedInfo additional information on Azure Sql specific protected item. +type AzureSQLProtectedItemExtendedInfo struct { + // OldestRecoveryPoint - The oldest backup copy available for this item in the service. + OldestRecoveryPoint *date.Time `json:"oldestRecoveryPoint,omitempty"` + // RecoveryPointCount - Number of available backup copies associated with this backup item. + RecoveryPointCount *int32 `json:"recoveryPointCount,omitempty"` + // PolicyState - State of the backup policy associated with this backup item. + PolicyState *string `json:"policyState,omitempty"` +} + +// AzureSQLProtectionPolicy azure SQL workload-specific backup policy. +type AzureSQLProtectionPolicy struct { + // RetentionPolicy - Retention policy details. + RetentionPolicy BasicRetentionPolicy `json:"retentionPolicy,omitempty"` + // ProtectedItemsCount - Number of items associated with this policy. + ProtectedItemsCount *int32 `json:"protectedItemsCount,omitempty"` + // BackupManagementType - Possible values include: 'BackupManagementTypeProtectionPolicy', 'BackupManagementTypeAzureStorage', 'BackupManagementTypeAzureIaasVM', 'BackupManagementTypeAzureSQL', 'BackupManagementTypeAzureWorkload', 'BackupManagementTypeGenericProtectionPolicy', 'BackupManagementTypeMAB' + BackupManagementType ManagementTypeBasicProtectionPolicy `json:"backupManagementType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureSQLProtectionPolicy. +func (aspp AzureSQLProtectionPolicy) MarshalJSON() ([]byte, error) { + aspp.BackupManagementType = BackupManagementTypeAzureSQL + objectMap := make(map[string]interface{}) + objectMap["retentionPolicy"] = aspp.RetentionPolicy + if aspp.ProtectedItemsCount != nil { + objectMap["protectedItemsCount"] = aspp.ProtectedItemsCount + } + if aspp.BackupManagementType != "" { + objectMap["backupManagementType"] = aspp.BackupManagementType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareProtectionPolicy is the BasicProtectionPolicy implementation for AzureSQLProtectionPolicy. +func (aspp AzureSQLProtectionPolicy) AsAzureFileShareProtectionPolicy() (*AzureFileShareProtectionPolicy, bool) { + return nil, false +} + +// AsAzureIaaSVMProtectionPolicy is the BasicProtectionPolicy implementation for AzureSQLProtectionPolicy. +func (aspp AzureSQLProtectionPolicy) AsAzureIaaSVMProtectionPolicy() (*AzureIaaSVMProtectionPolicy, bool) { + return nil, false +} + +// AsAzureSQLProtectionPolicy is the BasicProtectionPolicy implementation for AzureSQLProtectionPolicy. +func (aspp AzureSQLProtectionPolicy) AsAzureSQLProtectionPolicy() (*AzureSQLProtectionPolicy, bool) { + return &aspp, true +} + +// AsAzureVMWorkloadProtectionPolicy is the BasicProtectionPolicy implementation for AzureSQLProtectionPolicy. +func (aspp AzureSQLProtectionPolicy) AsAzureVMWorkloadProtectionPolicy() (*AzureVMWorkloadProtectionPolicy, bool) { + return nil, false +} + +// AsGenericProtectionPolicy is the BasicProtectionPolicy implementation for AzureSQLProtectionPolicy. +func (aspp AzureSQLProtectionPolicy) AsGenericProtectionPolicy() (*GenericProtectionPolicy, bool) { + return nil, false +} + +// AsMabProtectionPolicy is the BasicProtectionPolicy implementation for AzureSQLProtectionPolicy. +func (aspp AzureSQLProtectionPolicy) AsMabProtectionPolicy() (*MabProtectionPolicy, bool) { + return nil, false +} + +// AsProtectionPolicy is the BasicProtectionPolicy implementation for AzureSQLProtectionPolicy. +func (aspp AzureSQLProtectionPolicy) AsProtectionPolicy() (*ProtectionPolicy, bool) { + return nil, false +} + +// AsBasicProtectionPolicy is the BasicProtectionPolicy implementation for AzureSQLProtectionPolicy. +func (aspp AzureSQLProtectionPolicy) AsBasicProtectionPolicy() (BasicProtectionPolicy, bool) { + return &aspp, true +} + +// UnmarshalJSON is the custom unmarshaler for AzureSQLProtectionPolicy struct. +func (aspp *AzureSQLProtectionPolicy) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "retentionPolicy": + if v != nil { + retentionPolicy, err := unmarshalBasicRetentionPolicy(*v) + if err != nil { + return err + } + aspp.RetentionPolicy = retentionPolicy + } + case "protectedItemsCount": + if v != nil { + var protectedItemsCount int32 + err = json.Unmarshal(*v, &protectedItemsCount) + if err != nil { + return err + } + aspp.ProtectedItemsCount = &protectedItemsCount + } + case "backupManagementType": + if v != nil { + var backupManagementType ManagementTypeBasicProtectionPolicy + err = json.Unmarshal(*v, &backupManagementType) + if err != nil { + return err + } + aspp.BackupManagementType = backupManagementType + } + } + } + + return nil +} + +// AzureStorageContainer azure Storage Account workload-specific container. +type AzureStorageContainer struct { + // SourceResourceID - Fully qualified ARM url. + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // StorageAccountVersion - Storage account version. + StorageAccountVersion *string `json:"storageAccountVersion,omitempty"` + // ResourceGroup - Resource group name of Recovery Services Vault. + ResourceGroup *string `json:"resourceGroup,omitempty"` + // ProtectedItemCount - Number of items backed up in this container. + ProtectedItemCount *int64 `json:"protectedItemCount,omitempty"` + // FriendlyName - Friendly name of the container. + FriendlyName *string `json:"friendlyName,omitempty"` + // BackupManagementType - Type of backup managemenent for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // RegistrationStatus - Status of registration of the container with the Recovery Services Vault. + RegistrationStatus *string `json:"registrationStatus,omitempty"` + // HealthStatus - Status of health of the container. + HealthStatus *string `json:"healthStatus,omitempty"` + // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaaSVMContainer', 'ContainerTypeWindows1' + ContainerType ContainerTypeBasicProtectionContainer `json:"containerType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureStorageContainer. +func (asc AzureStorageContainer) MarshalJSON() ([]byte, error) { + asc.ContainerType = ContainerTypeStorageContainer1 + objectMap := make(map[string]interface{}) + if asc.SourceResourceID != nil { + objectMap["sourceResourceId"] = asc.SourceResourceID + } + if asc.StorageAccountVersion != nil { + objectMap["storageAccountVersion"] = asc.StorageAccountVersion + } + if asc.ResourceGroup != nil { + objectMap["resourceGroup"] = asc.ResourceGroup + } + if asc.ProtectedItemCount != nil { + objectMap["protectedItemCount"] = asc.ProtectedItemCount + } + if asc.FriendlyName != nil { + objectMap["friendlyName"] = asc.FriendlyName + } + if asc.BackupManagementType != "" { + objectMap["backupManagementType"] = asc.BackupManagementType + } + if asc.RegistrationStatus != nil { + objectMap["registrationStatus"] = asc.RegistrationStatus + } + if asc.HealthStatus != nil { + objectMap["healthStatus"] = asc.HealthStatus + } + if asc.ContainerType != "" { + objectMap["containerType"] = asc.ContainerType + } + return json.Marshal(objectMap) +} + +// AsAzureBackupServerContainer is the BasicProtectionContainer implementation for AzureStorageContainer. +func (asc AzureStorageContainer) AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) { + return nil, false +} + +// AsAzureIaaSClassicComputeVMContainer is the BasicProtectionContainer implementation for AzureStorageContainer. +func (asc AzureStorageContainer) AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) { + return nil, false +} + +// AsAzureIaaSComputeVMContainer is the BasicProtectionContainer implementation for AzureStorageContainer. +func (asc AzureStorageContainer) AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) { + return nil, false +} + +// AsAzureSQLAGWorkloadContainerProtectionContainer is the BasicProtectionContainer implementation for AzureStorageContainer. +func (asc AzureStorageContainer) AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) { + return nil, false +} + +// AsAzureSQLContainer is the BasicProtectionContainer implementation for AzureStorageContainer. +func (asc AzureStorageContainer) AsAzureSQLContainer() (*AzureSQLContainer, bool) { + return nil, false +} + +// AsAzureStorageContainer is the BasicProtectionContainer implementation for AzureStorageContainer. +func (asc AzureStorageContainer) AsAzureStorageContainer() (*AzureStorageContainer, bool) { + return &asc, true +} + +// AsAzureVMAppContainerProtectionContainer is the BasicProtectionContainer implementation for AzureStorageContainer. +func (asc AzureStorageContainer) AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) { + return nil, false +} + +// AsAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureStorageContainer. +func (asc AzureStorageContainer) AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) { + return nil, false +} + +// AsBasicAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureStorageContainer. +func (asc AzureStorageContainer) AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) { + return nil, false +} + +// AsDpmContainer is the BasicProtectionContainer implementation for AzureStorageContainer. +func (asc AzureStorageContainer) AsDpmContainer() (*DpmContainer, bool) { + return nil, false +} + +// AsGenericContainer is the BasicProtectionContainer implementation for AzureStorageContainer. +func (asc AzureStorageContainer) AsGenericContainer() (*GenericContainer, bool) { + return nil, false +} + +// AsIaaSVMContainer is the BasicProtectionContainer implementation for AzureStorageContainer. +func (asc AzureStorageContainer) AsIaaSVMContainer() (*IaaSVMContainer, bool) { + return nil, false +} + +// AsBasicIaaSVMContainer is the BasicProtectionContainer implementation for AzureStorageContainer. +func (asc AzureStorageContainer) AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) { + return nil, false +} + +// AsMabContainer is the BasicProtectionContainer implementation for AzureStorageContainer. +func (asc AzureStorageContainer) AsMabContainer() (*MabContainer, bool) { + return nil, false +} + +// AsProtectionContainer is the BasicProtectionContainer implementation for AzureStorageContainer. +func (asc AzureStorageContainer) AsProtectionContainer() (*ProtectionContainer, bool) { + return nil, false +} + +// AsBasicProtectionContainer is the BasicProtectionContainer implementation for AzureStorageContainer. +func (asc AzureStorageContainer) AsBasicProtectionContainer() (BasicProtectionContainer, bool) { + return &asc, true +} + +// AzureStorageProtectableContainer azure Storage-specific protectable containers +type AzureStorageProtectableContainer struct { + // FriendlyName - Friendly name of the container. + FriendlyName *string `json:"friendlyName,omitempty"` + // BackupManagementType - Type of backup managemenent for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // HealthStatus - Status of health of the container. + HealthStatus *string `json:"healthStatus,omitempty"` + // ContainerID - Fabric Id of the container such as ARM Id. + ContainerID *string `json:"containerId,omitempty"` + // ProtectableContainerType - Possible values include: 'ProtectableContainerTypeProtectableContainer', 'ProtectableContainerTypeStorageContainer', 'ProtectableContainerTypeVMAppContainer' + ProtectableContainerType ProtectableContainerType `json:"protectableContainerType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureStorageProtectableContainer. +func (aspc AzureStorageProtectableContainer) MarshalJSON() ([]byte, error) { + aspc.ProtectableContainerType = ProtectableContainerTypeStorageContainer + objectMap := make(map[string]interface{}) + if aspc.FriendlyName != nil { + objectMap["friendlyName"] = aspc.FriendlyName + } + if aspc.BackupManagementType != "" { + objectMap["backupManagementType"] = aspc.BackupManagementType + } + if aspc.HealthStatus != nil { + objectMap["healthStatus"] = aspc.HealthStatus + } + if aspc.ContainerID != nil { + objectMap["containerId"] = aspc.ContainerID + } + if aspc.ProtectableContainerType != "" { + objectMap["protectableContainerType"] = aspc.ProtectableContainerType + } + return json.Marshal(objectMap) +} + +// AsAzureStorageProtectableContainer is the BasicProtectableContainer implementation for AzureStorageProtectableContainer. +func (aspc AzureStorageProtectableContainer) AsAzureStorageProtectableContainer() (*AzureStorageProtectableContainer, bool) { + return &aspc, true +} + +// AsAzureVMAppContainerProtectableContainer is the BasicProtectableContainer implementation for AzureStorageProtectableContainer. +func (aspc AzureStorageProtectableContainer) AsAzureVMAppContainerProtectableContainer() (*AzureVMAppContainerProtectableContainer, bool) { + return nil, false +} + +// AsProtectableContainer is the BasicProtectableContainer implementation for AzureStorageProtectableContainer. +func (aspc AzureStorageProtectableContainer) AsProtectableContainer() (*ProtectableContainer, bool) { + return nil, false +} + +// AsBasicProtectableContainer is the BasicProtectableContainer implementation for AzureStorageProtectableContainer. +func (aspc AzureStorageProtectableContainer) AsBasicProtectableContainer() (BasicProtectableContainer, bool) { + return &aspc, true +} + +// AzureVMAppContainerProtectableContainer azure workload-specific container +type AzureVMAppContainerProtectableContainer struct { + // FriendlyName - Friendly name of the container. + FriendlyName *string `json:"friendlyName,omitempty"` + // BackupManagementType - Type of backup managemenent for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // HealthStatus - Status of health of the container. + HealthStatus *string `json:"healthStatus,omitempty"` + // ContainerID - Fabric Id of the container such as ARM Id. + ContainerID *string `json:"containerId,omitempty"` + // ProtectableContainerType - Possible values include: 'ProtectableContainerTypeProtectableContainer', 'ProtectableContainerTypeStorageContainer', 'ProtectableContainerTypeVMAppContainer' + ProtectableContainerType ProtectableContainerType `json:"protectableContainerType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureVMAppContainerProtectableContainer. +func (avacpc AzureVMAppContainerProtectableContainer) MarshalJSON() ([]byte, error) { + avacpc.ProtectableContainerType = ProtectableContainerTypeVMAppContainer + objectMap := make(map[string]interface{}) + if avacpc.FriendlyName != nil { + objectMap["friendlyName"] = avacpc.FriendlyName + } + if avacpc.BackupManagementType != "" { + objectMap["backupManagementType"] = avacpc.BackupManagementType + } + if avacpc.HealthStatus != nil { + objectMap["healthStatus"] = avacpc.HealthStatus + } + if avacpc.ContainerID != nil { + objectMap["containerId"] = avacpc.ContainerID + } + if avacpc.ProtectableContainerType != "" { + objectMap["protectableContainerType"] = avacpc.ProtectableContainerType + } + return json.Marshal(objectMap) +} + +// AsAzureStorageProtectableContainer is the BasicProtectableContainer implementation for AzureVMAppContainerProtectableContainer. +func (avacpc AzureVMAppContainerProtectableContainer) AsAzureStorageProtectableContainer() (*AzureStorageProtectableContainer, bool) { + return nil, false +} + +// AsAzureVMAppContainerProtectableContainer is the BasicProtectableContainer implementation for AzureVMAppContainerProtectableContainer. +func (avacpc AzureVMAppContainerProtectableContainer) AsAzureVMAppContainerProtectableContainer() (*AzureVMAppContainerProtectableContainer, bool) { + return &avacpc, true +} + +// AsProtectableContainer is the BasicProtectableContainer implementation for AzureVMAppContainerProtectableContainer. +func (avacpc AzureVMAppContainerProtectableContainer) AsProtectableContainer() (*ProtectableContainer, bool) { + return nil, false +} + +// AsBasicProtectableContainer is the BasicProtectableContainer implementation for AzureVMAppContainerProtectableContainer. +func (avacpc AzureVMAppContainerProtectableContainer) AsBasicProtectableContainer() (BasicProtectableContainer, bool) { + return &avacpc, true +} + +// AzureVMAppContainerProtectionContainer container for SQL workloads under Azure Virtual Machines. +type AzureVMAppContainerProtectionContainer struct { + // SourceResourceID - ARM ID of the virtual machine represented by this Azure Workload Container + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // LastUpdatedTime - Time stamp when this container was updated. + LastUpdatedTime *date.Time `json:"lastUpdatedTime,omitempty"` + // ExtendedInfo - Additional details of a workload container. + ExtendedInfo *AzureWorkloadContainerExtendedInfo `json:"extendedInfo,omitempty"` + // WorkloadType - Workload type for which registration was sent. Possible values include: 'WorkloadTypeInvalid', 'WorkloadTypeVM', 'WorkloadTypeFileFolder', 'WorkloadTypeAzureSQLDb', 'WorkloadTypeSQLDB', 'WorkloadTypeExchange', 'WorkloadTypeSharepoint', 'WorkloadTypeVMwareVM', 'WorkloadTypeSystemState', 'WorkloadTypeClient', 'WorkloadTypeGenericDataSource', 'WorkloadTypeSQLDataBase', 'WorkloadTypeAzureFileShare', 'WorkloadTypeSAPHanaDatabase' + WorkloadType WorkloadType `json:"workloadType,omitempty"` + // FriendlyName - Friendly name of the container. + FriendlyName *string `json:"friendlyName,omitempty"` + // BackupManagementType - Type of backup managemenent for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // RegistrationStatus - Status of registration of the container with the Recovery Services Vault. + RegistrationStatus *string `json:"registrationStatus,omitempty"` + // HealthStatus - Status of health of the container. + HealthStatus *string `json:"healthStatus,omitempty"` + // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaaSVMContainer', 'ContainerTypeWindows1' + ContainerType ContainerTypeBasicProtectionContainer `json:"containerType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureVMAppContainerProtectionContainer. +func (avacpc AzureVMAppContainerProtectionContainer) MarshalJSON() ([]byte, error) { + avacpc.ContainerType = ContainerTypeVMAppContainer1 + objectMap := make(map[string]interface{}) + if avacpc.SourceResourceID != nil { + objectMap["sourceResourceId"] = avacpc.SourceResourceID + } + if avacpc.LastUpdatedTime != nil { + objectMap["lastUpdatedTime"] = avacpc.LastUpdatedTime + } + if avacpc.ExtendedInfo != nil { + objectMap["extendedInfo"] = avacpc.ExtendedInfo + } + if avacpc.WorkloadType != "" { + objectMap["workloadType"] = avacpc.WorkloadType + } + if avacpc.FriendlyName != nil { + objectMap["friendlyName"] = avacpc.FriendlyName + } + if avacpc.BackupManagementType != "" { + objectMap["backupManagementType"] = avacpc.BackupManagementType + } + if avacpc.RegistrationStatus != nil { + objectMap["registrationStatus"] = avacpc.RegistrationStatus + } + if avacpc.HealthStatus != nil { + objectMap["healthStatus"] = avacpc.HealthStatus + } + if avacpc.ContainerType != "" { + objectMap["containerType"] = avacpc.ContainerType + } + return json.Marshal(objectMap) +} + +// AsAzureBackupServerContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. +func (avacpc AzureVMAppContainerProtectionContainer) AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) { + return nil, false +} + +// AsAzureIaaSClassicComputeVMContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. +func (avacpc AzureVMAppContainerProtectionContainer) AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) { + return nil, false +} + +// AsAzureIaaSComputeVMContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. +func (avacpc AzureVMAppContainerProtectionContainer) AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) { + return nil, false +} + +// AsAzureSQLAGWorkloadContainerProtectionContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. +func (avacpc AzureVMAppContainerProtectionContainer) AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) { + return nil, false +} + +// AsAzureSQLContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. +func (avacpc AzureVMAppContainerProtectionContainer) AsAzureSQLContainer() (*AzureSQLContainer, bool) { + return nil, false +} + +// AsAzureStorageContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. +func (avacpc AzureVMAppContainerProtectionContainer) AsAzureStorageContainer() (*AzureStorageContainer, bool) { + return nil, false +} + +// AsAzureVMAppContainerProtectionContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. +func (avacpc AzureVMAppContainerProtectionContainer) AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) { + return &avacpc, true +} + +// AsAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. +func (avacpc AzureVMAppContainerProtectionContainer) AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) { + return nil, false +} + +// AsBasicAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. +func (avacpc AzureVMAppContainerProtectionContainer) AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) { + return &avacpc, true +} + +// AsDpmContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. +func (avacpc AzureVMAppContainerProtectionContainer) AsDpmContainer() (*DpmContainer, bool) { + return nil, false +} + +// AsGenericContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. +func (avacpc AzureVMAppContainerProtectionContainer) AsGenericContainer() (*GenericContainer, bool) { + return nil, false +} + +// AsIaaSVMContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. +func (avacpc AzureVMAppContainerProtectionContainer) AsIaaSVMContainer() (*IaaSVMContainer, bool) { + return nil, false +} + +// AsBasicIaaSVMContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. +func (avacpc AzureVMAppContainerProtectionContainer) AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) { + return nil, false +} + +// AsMabContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. +func (avacpc AzureVMAppContainerProtectionContainer) AsMabContainer() (*MabContainer, bool) { + return nil, false +} + +// AsProtectionContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. +func (avacpc AzureVMAppContainerProtectionContainer) AsProtectionContainer() (*ProtectionContainer, bool) { + return nil, false +} + +// AsBasicProtectionContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. +func (avacpc AzureVMAppContainerProtectionContainer) AsBasicProtectionContainer() (BasicProtectionContainer, bool) { + return &avacpc, true +} + +// BasicAzureVMWorkloadItem azure VM workload-specific workload item. +type BasicAzureVMWorkloadItem interface { + AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem() (*AzureVMWorkloadSAPHanaDatabaseWorkloadItem, bool) + AsAzureVMWorkloadSAPHanaSystemWorkloadItem() (*AzureVMWorkloadSAPHanaSystemWorkloadItem, bool) + AsAzureVMWorkloadSQLDatabaseWorkloadItem() (*AzureVMWorkloadSQLDatabaseWorkloadItem, bool) + AsAzureVMWorkloadSQLInstanceWorkloadItem() (*AzureVMWorkloadSQLInstanceWorkloadItem, bool) + AsAzureVMWorkloadItem() (*AzureVMWorkloadItem, bool) +} + +// AzureVMWorkloadItem azure VM workload-specific workload item. +type AzureVMWorkloadItem struct { + // ParentName - Name for instance or AG + ParentName *string `json:"parentName,omitempty"` + // ServerName - Host/Cluster Name for instance or AG + ServerName *string `json:"serverName,omitempty"` + // IsAutoProtectable - Indicates if workload item is auto-protectable + IsAutoProtectable *bool `json:"isAutoProtectable,omitempty"` + // Subinquireditemcount - For instance or AG, indicates number of DB's present + Subinquireditemcount *int32 `json:"subinquireditemcount,omitempty"` + // SubWorkloadItemCount - For instance or AG, indicates number of DB's to be protected + SubWorkloadItemCount *int32 `json:"subWorkloadItemCount,omitempty"` + // BackupManagementType - Type of backup managemenent to backup an item. + BackupManagementType *string `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload for the backup management + WorkloadType *string `json:"workloadType,omitempty"` + // FriendlyName - Friendly name of the backup item. + FriendlyName *string `json:"friendlyName,omitempty"` + // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' + ProtectionState ProtectionStatus `json:"protectionState,omitempty"` + // WorkloadItemType - Possible values include: 'WorkloadItemTypeWorkloadItem', 'WorkloadItemTypeAzureVMWorkloadItem', 'WorkloadItemTypeSAPHanaDatabase1', 'WorkloadItemTypeSAPHanaSystem1', 'WorkloadItemTypeSQLDataBase1', 'WorkloadItemTypeSQLInstance1' + WorkloadItemType WorkloadItemTypeBasicWorkloadItem `json:"workloadItemType,omitempty"` +} + +func unmarshalBasicAzureVMWorkloadItem(body []byte) (BasicAzureVMWorkloadItem, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["workloadItemType"] { + case string(WorkloadItemTypeSAPHanaDatabase1): + var avwshdwi AzureVMWorkloadSAPHanaDatabaseWorkloadItem + err := json.Unmarshal(body, &avwshdwi) + return avwshdwi, err + case string(WorkloadItemTypeSAPHanaSystem1): + var avwshswi AzureVMWorkloadSAPHanaSystemWorkloadItem + err := json.Unmarshal(body, &avwshswi) + return avwshswi, err + case string(WorkloadItemTypeSQLDataBase1): + var avwsdwi AzureVMWorkloadSQLDatabaseWorkloadItem + err := json.Unmarshal(body, &avwsdwi) + return avwsdwi, err + case string(WorkloadItemTypeSQLInstance1): + var avwsiwi AzureVMWorkloadSQLInstanceWorkloadItem + err := json.Unmarshal(body, &avwsiwi) + return avwsiwi, err + default: + var avwi AzureVMWorkloadItem + err := json.Unmarshal(body, &avwi) + return avwi, err + } +} +func unmarshalBasicAzureVMWorkloadItemArray(body []byte) ([]BasicAzureVMWorkloadItem, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + avwiArray := make([]BasicAzureVMWorkloadItem, len(rawMessages)) + + for index, rawMessage := range rawMessages { + avwi, err := unmarshalBasicAzureVMWorkloadItem(*rawMessage) + if err != nil { + return nil, err + } + avwiArray[index] = avwi + } + return avwiArray, nil +} + +// MarshalJSON is the custom marshaler for AzureVMWorkloadItem. +func (avwi AzureVMWorkloadItem) MarshalJSON() ([]byte, error) { + avwi.WorkloadItemType = WorkloadItemTypeAzureVMWorkloadItem + objectMap := make(map[string]interface{}) + if avwi.ParentName != nil { + objectMap["parentName"] = avwi.ParentName + } + if avwi.ServerName != nil { + objectMap["serverName"] = avwi.ServerName + } + if avwi.IsAutoProtectable != nil { + objectMap["isAutoProtectable"] = avwi.IsAutoProtectable + } + if avwi.Subinquireditemcount != nil { + objectMap["subinquireditemcount"] = avwi.Subinquireditemcount + } + if avwi.SubWorkloadItemCount != nil { + objectMap["subWorkloadItemCount"] = avwi.SubWorkloadItemCount + } + if avwi.BackupManagementType != nil { + objectMap["backupManagementType"] = avwi.BackupManagementType + } + if avwi.WorkloadType != nil { + objectMap["workloadType"] = avwi.WorkloadType + } + if avwi.FriendlyName != nil { + objectMap["friendlyName"] = avwi.FriendlyName + } + if avwi.ProtectionState != "" { + objectMap["protectionState"] = avwi.ProtectionState + } + if avwi.WorkloadItemType != "" { + objectMap["workloadItemType"] = avwi.WorkloadItemType + } + return json.Marshal(objectMap) +} + +// AsAzureVMWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadItem. +func (avwi AzureVMWorkloadItem) AsAzureVMWorkloadItem() (*AzureVMWorkloadItem, bool) { + return &avwi, true +} + +// AsBasicAzureVMWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadItem. +func (avwi AzureVMWorkloadItem) AsBasicAzureVMWorkloadItem() (BasicAzureVMWorkloadItem, bool) { + return &avwi, true +} + +// AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadItem. +func (avwi AzureVMWorkloadItem) AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem() (*AzureVMWorkloadSAPHanaDatabaseWorkloadItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaSystemWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadItem. +func (avwi AzureVMWorkloadItem) AsAzureVMWorkloadSAPHanaSystemWorkloadItem() (*AzureVMWorkloadSAPHanaSystemWorkloadItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadItem. +func (avwi AzureVMWorkloadItem) AsAzureVMWorkloadSQLDatabaseWorkloadItem() (*AzureVMWorkloadSQLDatabaseWorkloadItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLInstanceWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadItem. +func (avwi AzureVMWorkloadItem) AsAzureVMWorkloadSQLInstanceWorkloadItem() (*AzureVMWorkloadSQLInstanceWorkloadItem, bool) { + return nil, false +} + +// AsWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadItem. +func (avwi AzureVMWorkloadItem) AsWorkloadItem() (*WorkloadItem, bool) { + return nil, false +} + +// AsBasicWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadItem. +func (avwi AzureVMWorkloadItem) AsBasicWorkloadItem() (BasicWorkloadItem, bool) { + return &avwi, true +} + +// BasicAzureVMWorkloadProtectableItem azure VM workload-specific protectable item. +type BasicAzureVMWorkloadProtectableItem interface { + AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) + AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) + AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) + AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) + AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) + AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) +} + +// AzureVMWorkloadProtectableItem azure VM workload-specific protectable item. +type AzureVMWorkloadProtectableItem struct { + // ParentName - Name for instance or AG + ParentName *string `json:"parentName,omitempty"` + // ParentUniqueName - Parent Unique Name is added to provide the service formatted URI Name of the Parent + // Only Applicable for data bases where the parent would be either Instance or a SQL AG. + ParentUniqueName *string `json:"parentUniqueName,omitempty"` + // ServerName - Host/Cluster Name for instance or AG + ServerName *string `json:"serverName,omitempty"` + // IsAutoProtectable - Indicates if protectable item is auto-protectable + IsAutoProtectable *bool `json:"isAutoProtectable,omitempty"` + // Subinquireditemcount - For instance or AG, indicates number of DB's present + Subinquireditemcount *int32 `json:"subinquireditemcount,omitempty"` + // Subprotectableitemcount - For instance or AG, indicates number of DB's to be protected + Subprotectableitemcount *int32 `json:"subprotectableitemcount,omitempty"` + // Prebackupvalidation - Pre-backup validation for protectable objects + Prebackupvalidation *PreBackupValidation `json:"prebackupvalidation,omitempty"` + // BackupManagementType - Type of backup managemenent to backup an item. + BackupManagementType *string `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload for the backup management + WorkloadType *string `json:"workloadType,omitempty"` + // FriendlyName - Friendly name of the backup item. + FriendlyName *string `json:"friendlyName,omitempty"` + // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' + ProtectionState ProtectionStatus `json:"protectionState,omitempty"` + // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' + ProtectableItemType ProtectableItemType `json:"protectableItemType,omitempty"` +} + +func unmarshalBasicAzureVMWorkloadProtectableItem(body []byte) (BasicAzureVMWorkloadProtectableItem, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["protectableItemType"] { + case string(ProtectableItemTypeSAPHanaDatabase): + var avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem + err := json.Unmarshal(body, &avwshdpi) + return avwshdpi, err + case string(ProtectableItemTypeSAPHanaSystem): + var avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem + err := json.Unmarshal(body, &avwshspi) + return avwshspi, err + case string(ProtectableItemTypeSQLAvailabilityGroupContainer): + var avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem + err := json.Unmarshal(body, &avwsagpi) + return avwsagpi, err + case string(ProtectableItemTypeSQLDataBase): + var avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem + err := json.Unmarshal(body, &avwsdpi) + return avwsdpi, err + case string(ProtectableItemTypeSQLInstance): + var avwsipi AzureVMWorkloadSQLInstanceProtectableItem + err := json.Unmarshal(body, &avwsipi) + return avwsipi, err + default: + var avwpi AzureVMWorkloadProtectableItem + err := json.Unmarshal(body, &avwpi) + return avwpi, err + } +} +func unmarshalBasicAzureVMWorkloadProtectableItemArray(body []byte) ([]BasicAzureVMWorkloadProtectableItem, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + avwpiArray := make([]BasicAzureVMWorkloadProtectableItem, len(rawMessages)) + + for index, rawMessage := range rawMessages { + avwpi, err := unmarshalBasicAzureVMWorkloadProtectableItem(*rawMessage) + if err != nil { + return nil, err + } + avwpiArray[index] = avwpi + } + return avwpiArray, nil +} + +// MarshalJSON is the custom marshaler for AzureVMWorkloadProtectableItem. +func (avwpi AzureVMWorkloadProtectableItem) MarshalJSON() ([]byte, error) { + avwpi.ProtectableItemType = ProtectableItemTypeAzureVMWorkloadProtectableItem + objectMap := make(map[string]interface{}) + if avwpi.ParentName != nil { + objectMap["parentName"] = avwpi.ParentName + } + if avwpi.ParentUniqueName != nil { + objectMap["parentUniqueName"] = avwpi.ParentUniqueName + } + if avwpi.ServerName != nil { + objectMap["serverName"] = avwpi.ServerName + } + if avwpi.IsAutoProtectable != nil { + objectMap["isAutoProtectable"] = avwpi.IsAutoProtectable + } + if avwpi.Subinquireditemcount != nil { + objectMap["subinquireditemcount"] = avwpi.Subinquireditemcount + } + if avwpi.Subprotectableitemcount != nil { + objectMap["subprotectableitemcount"] = avwpi.Subprotectableitemcount + } + if avwpi.Prebackupvalidation != nil { + objectMap["prebackupvalidation"] = avwpi.Prebackupvalidation + } + if avwpi.BackupManagementType != nil { + objectMap["backupManagementType"] = avwpi.BackupManagementType + } + if avwpi.WorkloadType != nil { + objectMap["workloadType"] = avwpi.WorkloadType + } + if avwpi.FriendlyName != nil { + objectMap["friendlyName"] = avwpi.FriendlyName + } + if avwpi.ProtectionState != "" { + objectMap["protectionState"] = avwpi.ProtectionState + } + if avwpi.ProtectableItemType != "" { + objectMap["protectableItemType"] = avwpi.ProtectableItemType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. +func (avwpi AzureVMWorkloadProtectableItem) AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) { + return nil, false +} + +// AsAzureIaaSClassicComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. +func (avwpi AzureVMWorkloadProtectableItem) AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) { + return nil, false +} + +// AsAzureIaaSComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. +func (avwpi AzureVMWorkloadProtectableItem) AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. +func (avwpi AzureVMWorkloadProtectableItem) AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) { + return &avwpi, true +} + +// AsBasicAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. +func (avwpi AzureVMWorkloadProtectableItem) AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) { + return &avwpi, true +} + +// AsAzureVMWorkloadSAPHanaDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. +func (avwpi AzureVMWorkloadProtectableItem) AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. +func (avwpi AzureVMWorkloadProtectableItem) AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. +func (avwpi AzureVMWorkloadProtectableItem) AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. +func (avwpi AzureVMWorkloadProtectableItem) AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLInstanceProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. +func (avwpi AzureVMWorkloadProtectableItem) AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) { + return nil, false +} + +// AsIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. +func (avwpi AzureVMWorkloadProtectableItem) AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) { + return nil, false +} + +// AsBasicIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. +func (avwpi AzureVMWorkloadProtectableItem) AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) { + return nil, false +} + +// AsWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. +func (avwpi AzureVMWorkloadProtectableItem) AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) { + return nil, false +} + +// AsBasicWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. +func (avwpi AzureVMWorkloadProtectableItem) AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) { + return &avwpi, true +} + +// BasicAzureVMWorkloadProtectedItem azure VM workload-specific protected item. +type BasicAzureVMWorkloadProtectedItem interface { + AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) + AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) +} + +// AzureVMWorkloadProtectedItem azure VM workload-specific protected item. +type AzureVMWorkloadProtectedItem struct { + // FriendlyName - Friendly name of the DB represented by this backup item. + FriendlyName *string `json:"friendlyName,omitempty"` + // ServerName - Host/Cluster Name for instance or AG + ServerName *string `json:"serverName,omitempty"` + // ParentName - Parent name of the DB such as Instance or Availability Group. + ParentName *string `json:"parentName,omitempty"` + // ParentType - Parent type of protected item, example: for a DB, standalone server or distributed + ParentType *string `json:"parentType,omitempty"` + // ProtectionStatus - Backup status of this backup item. + ProtectionStatus *string `json:"protectionStatus,omitempty"` + // ProtectionState - Backup state of this backup item. Possible values include: 'ProtectionStateInvalid', 'ProtectionStateIRPending', 'ProtectionStateProtected', 'ProtectionStateProtectionError', 'ProtectionStateProtectionStopped', 'ProtectionStateProtectionPaused' + ProtectionState ProtectionState `json:"protectionState,omitempty"` + // LastBackupStatus - Last backup operation status. Possible values: Healthy, Unhealthy. Possible values include: 'LastBackupStatusInvalid', 'LastBackupStatusHealthy', 'LastBackupStatusUnhealthy', 'LastBackupStatusIRPending' + LastBackupStatus LastBackupStatus `json:"lastBackupStatus,omitempty"` + // LastBackupTime - Timestamp of the last backup operation on this backup item. + LastBackupTime *date.Time `json:"lastBackupTime,omitempty"` + // LastBackupErrorDetail - Error details in last backup + LastBackupErrorDetail *ErrorDetail `json:"lastBackupErrorDetail,omitempty"` + // ProtectedItemDataSourceID - Data ID of the protected item. + ProtectedItemDataSourceID *string `json:"protectedItemDataSourceId,omitempty"` + // ProtectedItemHealthStatus - Health status of the backup item, evaluated based on last heartbeat received. Possible values include: 'ProtectedItemHealthStatusInvalid', 'ProtectedItemHealthStatusHealthy', 'ProtectedItemHealthStatusUnhealthy', 'ProtectedItemHealthStatusNotReachable', 'ProtectedItemHealthStatusIRPending' + ProtectedItemHealthStatus ProtectedItemHealthStatus `json:"protectedItemHealthStatus,omitempty"` + // ExtendedInfo - Additional information for this backup item. + ExtendedInfo *AzureVMWorkloadProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` + // BackupManagementType - Type of backup managemenent for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase' + WorkloadType DataSourceType `json:"workloadType,omitempty"` + // ContainerName - Unique name of container + ContainerName *string `json:"containerName,omitempty"` + // SourceResourceID - ARM ID of the resource to be backed up. + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // PolicyID - ID of the backup policy with which this item is backed up. + PolicyID *string `json:"policyId,omitempty"` + // LastRecoveryPoint - Timestamp when the last (latest) backup copy was created for this backup item. + LastRecoveryPoint *date.Time `json:"lastRecoveryPoint,omitempty"` + // BackupSetName - Name of the backup set the backup item belongs to + BackupSetName *string `json:"backupSetName,omitempty"` + // CreateMode - Create mode to indicate recovery of existing soft deleted data source or creation of new data source. Possible values include: 'CreateModeInvalid', 'CreateModeDefault', 'CreateModeRecover' + CreateMode CreateMode `json:"createMode,omitempty"` + // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' + ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` +} + +func unmarshalBasicAzureVMWorkloadProtectedItem(body []byte) (BasicAzureVMWorkloadProtectedItem, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["protectedItemType"] { + case string(ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase): + var avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem + err := json.Unmarshal(body, &avwshdpi) + return avwshdpi, err + default: + var avwpi AzureVMWorkloadProtectedItem + err := json.Unmarshal(body, &avwpi) + return avwpi, err + } +} +func unmarshalBasicAzureVMWorkloadProtectedItemArray(body []byte) ([]BasicAzureVMWorkloadProtectedItem, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + avwpiArray := make([]BasicAzureVMWorkloadProtectedItem, len(rawMessages)) + + for index, rawMessage := range rawMessages { + avwpi, err := unmarshalBasicAzureVMWorkloadProtectedItem(*rawMessage) + if err != nil { + return nil, err + } + avwpiArray[index] = avwpi + } + return avwpiArray, nil +} + +// MarshalJSON is the custom marshaler for AzureVMWorkloadProtectedItem. +func (avwpi AzureVMWorkloadProtectedItem) MarshalJSON() ([]byte, error) { + avwpi.ProtectedItemType = ProtectedItemTypeAzureVMWorkloadProtectedItem + objectMap := make(map[string]interface{}) + if avwpi.FriendlyName != nil { + objectMap["friendlyName"] = avwpi.FriendlyName + } + if avwpi.ServerName != nil { + objectMap["serverName"] = avwpi.ServerName + } + if avwpi.ParentName != nil { + objectMap["parentName"] = avwpi.ParentName + } + if avwpi.ParentType != nil { + objectMap["parentType"] = avwpi.ParentType + } + if avwpi.ProtectionStatus != nil { + objectMap["protectionStatus"] = avwpi.ProtectionStatus + } + if avwpi.ProtectionState != "" { + objectMap["protectionState"] = avwpi.ProtectionState + } + if avwpi.LastBackupStatus != "" { + objectMap["lastBackupStatus"] = avwpi.LastBackupStatus + } + if avwpi.LastBackupTime != nil { + objectMap["lastBackupTime"] = avwpi.LastBackupTime + } + if avwpi.LastBackupErrorDetail != nil { + objectMap["lastBackupErrorDetail"] = avwpi.LastBackupErrorDetail + } + if avwpi.ProtectedItemDataSourceID != nil { + objectMap["protectedItemDataSourceId"] = avwpi.ProtectedItemDataSourceID + } + if avwpi.ProtectedItemHealthStatus != "" { + objectMap["protectedItemHealthStatus"] = avwpi.ProtectedItemHealthStatus + } + if avwpi.ExtendedInfo != nil { + objectMap["extendedInfo"] = avwpi.ExtendedInfo + } + if avwpi.BackupManagementType != "" { + objectMap["backupManagementType"] = avwpi.BackupManagementType + } + if avwpi.WorkloadType != "" { + objectMap["workloadType"] = avwpi.WorkloadType + } + if avwpi.ContainerName != nil { + objectMap["containerName"] = avwpi.ContainerName + } + if avwpi.SourceResourceID != nil { + objectMap["sourceResourceId"] = avwpi.SourceResourceID + } + if avwpi.PolicyID != nil { + objectMap["policyId"] = avwpi.PolicyID + } + if avwpi.LastRecoveryPoint != nil { + objectMap["lastRecoveryPoint"] = avwpi.LastRecoveryPoint + } + if avwpi.BackupSetName != nil { + objectMap["backupSetName"] = avwpi.BackupSetName + } + if avwpi.CreateMode != "" { + objectMap["createMode"] = avwpi.CreateMode + } + if avwpi.ProtectedItemType != "" { + objectMap["protectedItemType"] = avwpi.ProtectedItemType + } + return json.Marshal(objectMap) +} + +// AsAzureFileshareProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. +func (avwpi AzureVMWorkloadProtectedItem) AsAzureFileshareProtectedItem() (*AzureFileshareProtectedItem, bool) { + return nil, false +} + +// AsAzureIaaSClassicComputeVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. +func (avwpi AzureVMWorkloadProtectedItem) AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) { + return nil, false +} + +// AsAzureIaaSComputeVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. +func (avwpi AzureVMWorkloadProtectedItem) AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) { + return nil, false +} + +// AsAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. +func (avwpi AzureVMWorkloadProtectedItem) AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) { + return nil, false +} + +// AsBasicAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. +func (avwpi AzureVMWorkloadProtectedItem) AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) { + return nil, false +} + +// AsAzureSQLProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. +func (avwpi AzureVMWorkloadProtectedItem) AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. +func (avwpi AzureVMWorkloadProtectedItem) AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) { + return &avwpi, true +} + +// AsBasicAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. +func (avwpi AzureVMWorkloadProtectedItem) AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) { + return &avwpi, true +} + +// AsAzureVMWorkloadSAPHanaDatabaseProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. +func (avwpi AzureVMWorkloadProtectedItem) AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLDatabaseProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. +func (avwpi AzureVMWorkloadProtectedItem) AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) { + return nil, false +} + +// AsDPMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. +func (avwpi AzureVMWorkloadProtectedItem) AsDPMProtectedItem() (*DPMProtectedItem, bool) { + return nil, false +} + +// AsGenericProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. +func (avwpi AzureVMWorkloadProtectedItem) AsGenericProtectedItem() (*GenericProtectedItem, bool) { + return nil, false +} + +// AsMabFileFolderProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. +func (avwpi AzureVMWorkloadProtectedItem) AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) { + return nil, false +} + +// AsProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. +func (avwpi AzureVMWorkloadProtectedItem) AsProtectedItem() (*ProtectedItem, bool) { + return nil, false +} + +// AsBasicProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. +func (avwpi AzureVMWorkloadProtectedItem) AsBasicProtectedItem() (BasicProtectedItem, bool) { + return &avwpi, true +} + +// AzureVMWorkloadProtectedItemExtendedInfo additional information on Azure Workload for SQL specific backup item. +type AzureVMWorkloadProtectedItemExtendedInfo struct { + // OldestRecoveryPoint - The oldest backup copy available for this backup item. + OldestRecoveryPoint *date.Time `json:"oldestRecoveryPoint,omitempty"` + // RecoveryPointCount - Number of backup copies available for this backup item. + RecoveryPointCount *int32 `json:"recoveryPointCount,omitempty"` + // PolicyState - Indicates consistency of policy object and policy applied to this backup item. + PolicyState *string `json:"policyState,omitempty"` +} + +// AzureVMWorkloadProtectionPolicy azure VM (Mercury) workload-specific backup policy. +type AzureVMWorkloadProtectionPolicy struct { + // WorkLoadType - Type of workload for the backup management + WorkLoadType *string `json:"workLoadType,omitempty"` + // Settings - Common settings for the backup management + Settings *Settings `json:"settings,omitempty"` + // SubProtectionPolicy - List of sub-protection policies which includes schedule and retention + SubProtectionPolicy *[]SubProtectionPolicy `json:"subProtectionPolicy,omitempty"` + // ProtectedItemsCount - Number of items associated with this policy. + ProtectedItemsCount *int32 `json:"protectedItemsCount,omitempty"` + // BackupManagementType - Possible values include: 'BackupManagementTypeProtectionPolicy', 'BackupManagementTypeAzureStorage', 'BackupManagementTypeAzureIaasVM', 'BackupManagementTypeAzureSQL', 'BackupManagementTypeAzureWorkload', 'BackupManagementTypeGenericProtectionPolicy', 'BackupManagementTypeMAB' + BackupManagementType ManagementTypeBasicProtectionPolicy `json:"backupManagementType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureVMWorkloadProtectionPolicy. +func (avwpp AzureVMWorkloadProtectionPolicy) MarshalJSON() ([]byte, error) { + avwpp.BackupManagementType = BackupManagementTypeAzureWorkload + objectMap := make(map[string]interface{}) + if avwpp.WorkLoadType != nil { + objectMap["workLoadType"] = avwpp.WorkLoadType + } + if avwpp.Settings != nil { + objectMap["settings"] = avwpp.Settings + } + if avwpp.SubProtectionPolicy != nil { + objectMap["subProtectionPolicy"] = avwpp.SubProtectionPolicy + } + if avwpp.ProtectedItemsCount != nil { + objectMap["protectedItemsCount"] = avwpp.ProtectedItemsCount + } + if avwpp.BackupManagementType != "" { + objectMap["backupManagementType"] = avwpp.BackupManagementType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareProtectionPolicy is the BasicProtectionPolicy implementation for AzureVMWorkloadProtectionPolicy. +func (avwpp AzureVMWorkloadProtectionPolicy) AsAzureFileShareProtectionPolicy() (*AzureFileShareProtectionPolicy, bool) { + return nil, false +} + +// AsAzureIaaSVMProtectionPolicy is the BasicProtectionPolicy implementation for AzureVMWorkloadProtectionPolicy. +func (avwpp AzureVMWorkloadProtectionPolicy) AsAzureIaaSVMProtectionPolicy() (*AzureIaaSVMProtectionPolicy, bool) { + return nil, false +} + +// AsAzureSQLProtectionPolicy is the BasicProtectionPolicy implementation for AzureVMWorkloadProtectionPolicy. +func (avwpp AzureVMWorkloadProtectionPolicy) AsAzureSQLProtectionPolicy() (*AzureSQLProtectionPolicy, bool) { + return nil, false +} + +// AsAzureVMWorkloadProtectionPolicy is the BasicProtectionPolicy implementation for AzureVMWorkloadProtectionPolicy. +func (avwpp AzureVMWorkloadProtectionPolicy) AsAzureVMWorkloadProtectionPolicy() (*AzureVMWorkloadProtectionPolicy, bool) { + return &avwpp, true +} + +// AsGenericProtectionPolicy is the BasicProtectionPolicy implementation for AzureVMWorkloadProtectionPolicy. +func (avwpp AzureVMWorkloadProtectionPolicy) AsGenericProtectionPolicy() (*GenericProtectionPolicy, bool) { + return nil, false +} + +// AsMabProtectionPolicy is the BasicProtectionPolicy implementation for AzureVMWorkloadProtectionPolicy. +func (avwpp AzureVMWorkloadProtectionPolicy) AsMabProtectionPolicy() (*MabProtectionPolicy, bool) { + return nil, false +} + +// AsProtectionPolicy is the BasicProtectionPolicy implementation for AzureVMWorkloadProtectionPolicy. +func (avwpp AzureVMWorkloadProtectionPolicy) AsProtectionPolicy() (*ProtectionPolicy, bool) { + return nil, false +} + +// AsBasicProtectionPolicy is the BasicProtectionPolicy implementation for AzureVMWorkloadProtectionPolicy. +func (avwpp AzureVMWorkloadProtectionPolicy) AsBasicProtectionPolicy() (BasicProtectionPolicy, bool) { + return &avwpp, true +} + +// AzureVMWorkloadSAPHanaDatabaseProtectableItem azure VM workload-specific protectable item representing SAP Hana +// Database. +type AzureVMWorkloadSAPHanaDatabaseProtectableItem struct { + // ParentName - Name for instance or AG + ParentName *string `json:"parentName,omitempty"` + // ParentUniqueName - Parent Unique Name is added to provide the service formatted URI Name of the Parent + // Only Applicable for data bases where the parent would be either Instance or a SQL AG. + ParentUniqueName *string `json:"parentUniqueName,omitempty"` + // ServerName - Host/Cluster Name for instance or AG + ServerName *string `json:"serverName,omitempty"` + // IsAutoProtectable - Indicates if protectable item is auto-protectable + IsAutoProtectable *bool `json:"isAutoProtectable,omitempty"` + // Subinquireditemcount - For instance or AG, indicates number of DB's present + Subinquireditemcount *int32 `json:"subinquireditemcount,omitempty"` + // Subprotectableitemcount - For instance or AG, indicates number of DB's to be protected + Subprotectableitemcount *int32 `json:"subprotectableitemcount,omitempty"` + // Prebackupvalidation - Pre-backup validation for protectable objects + Prebackupvalidation *PreBackupValidation `json:"prebackupvalidation,omitempty"` + // BackupManagementType - Type of backup managemenent to backup an item. + BackupManagementType *string `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload for the backup management + WorkloadType *string `json:"workloadType,omitempty"` + // FriendlyName - Friendly name of the backup item. + FriendlyName *string `json:"friendlyName,omitempty"` + // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' + ProtectionState ProtectionStatus `json:"protectionState,omitempty"` + // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' + ProtectableItemType ProtectableItemType `json:"protectableItemType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureVMWorkloadSAPHanaDatabaseProtectableItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) MarshalJSON() ([]byte, error) { + avwshdpi.ProtectableItemType = ProtectableItemTypeSAPHanaDatabase + objectMap := make(map[string]interface{}) + if avwshdpi.ParentName != nil { + objectMap["parentName"] = avwshdpi.ParentName + } + if avwshdpi.ParentUniqueName != nil { + objectMap["parentUniqueName"] = avwshdpi.ParentUniqueName + } + if avwshdpi.ServerName != nil { + objectMap["serverName"] = avwshdpi.ServerName + } + if avwshdpi.IsAutoProtectable != nil { + objectMap["isAutoProtectable"] = avwshdpi.IsAutoProtectable + } + if avwshdpi.Subinquireditemcount != nil { + objectMap["subinquireditemcount"] = avwshdpi.Subinquireditemcount + } + if avwshdpi.Subprotectableitemcount != nil { + objectMap["subprotectableitemcount"] = avwshdpi.Subprotectableitemcount + } + if avwshdpi.Prebackupvalidation != nil { + objectMap["prebackupvalidation"] = avwshdpi.Prebackupvalidation + } + if avwshdpi.BackupManagementType != nil { + objectMap["backupManagementType"] = avwshdpi.BackupManagementType + } + if avwshdpi.WorkloadType != nil { + objectMap["workloadType"] = avwshdpi.WorkloadType + } + if avwshdpi.FriendlyName != nil { + objectMap["friendlyName"] = avwshdpi.FriendlyName + } + if avwshdpi.ProtectionState != "" { + objectMap["protectionState"] = avwshdpi.ProtectionState + } + if avwshdpi.ProtectableItemType != "" { + objectMap["protectableItemType"] = avwshdpi.ProtectableItemType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) { + return nil, false +} + +// AsAzureIaaSClassicComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) { + return nil, false +} + +// AsAzureIaaSComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) { + return nil, false +} + +// AsBasicAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) { + return &avwshdpi, true +} + +// AsAzureVMWorkloadSAPHanaDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) { + return &avwshdpi, true +} + +// AsAzureVMWorkloadSAPHanaSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLInstanceProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) { + return nil, false +} + +// AsIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) { + return nil, false +} + +// AsBasicIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) { + return nil, false +} + +// AsWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) { + return nil, false +} + +// AsBasicWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) { + return &avwshdpi, true +} + +// AzureVMWorkloadSAPHanaDatabaseProtectedItem azure VM workload-specific protected item representing SAP Hana +// Database. +type AzureVMWorkloadSAPHanaDatabaseProtectedItem struct { + // FriendlyName - Friendly name of the DB represented by this backup item. + FriendlyName *string `json:"friendlyName,omitempty"` + // ServerName - Host/Cluster Name for instance or AG + ServerName *string `json:"serverName,omitempty"` + // ParentName - Parent name of the DB such as Instance or Availability Group. + ParentName *string `json:"parentName,omitempty"` + // ParentType - Parent type of protected item, example: for a DB, standalone server or distributed + ParentType *string `json:"parentType,omitempty"` + // ProtectionStatus - Backup status of this backup item. + ProtectionStatus *string `json:"protectionStatus,omitempty"` + // ProtectionState - Backup state of this backup item. Possible values include: 'ProtectionStateInvalid', 'ProtectionStateIRPending', 'ProtectionStateProtected', 'ProtectionStateProtectionError', 'ProtectionStateProtectionStopped', 'ProtectionStateProtectionPaused' + ProtectionState ProtectionState `json:"protectionState,omitempty"` + // LastBackupStatus - Last backup operation status. Possible values: Healthy, Unhealthy. Possible values include: 'LastBackupStatusInvalid', 'LastBackupStatusHealthy', 'LastBackupStatusUnhealthy', 'LastBackupStatusIRPending' + LastBackupStatus LastBackupStatus `json:"lastBackupStatus,omitempty"` + // LastBackupTime - Timestamp of the last backup operation on this backup item. + LastBackupTime *date.Time `json:"lastBackupTime,omitempty"` + // LastBackupErrorDetail - Error details in last backup + LastBackupErrorDetail *ErrorDetail `json:"lastBackupErrorDetail,omitempty"` + // ProtectedItemDataSourceID - Data ID of the protected item. + ProtectedItemDataSourceID *string `json:"protectedItemDataSourceId,omitempty"` + // ProtectedItemHealthStatus - Health status of the backup item, evaluated based on last heartbeat received. Possible values include: 'ProtectedItemHealthStatusInvalid', 'ProtectedItemHealthStatusHealthy', 'ProtectedItemHealthStatusUnhealthy', 'ProtectedItemHealthStatusNotReachable', 'ProtectedItemHealthStatusIRPending' + ProtectedItemHealthStatus ProtectedItemHealthStatus `json:"protectedItemHealthStatus,omitempty"` + // ExtendedInfo - Additional information for this backup item. + ExtendedInfo *AzureVMWorkloadProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` + // BackupManagementType - Type of backup managemenent for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase' + WorkloadType DataSourceType `json:"workloadType,omitempty"` + // ContainerName - Unique name of container + ContainerName *string `json:"containerName,omitempty"` + // SourceResourceID - ARM ID of the resource to be backed up. + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // PolicyID - ID of the backup policy with which this item is backed up. + PolicyID *string `json:"policyId,omitempty"` + // LastRecoveryPoint - Timestamp when the last (latest) backup copy was created for this backup item. + LastRecoveryPoint *date.Time `json:"lastRecoveryPoint,omitempty"` + // BackupSetName - Name of the backup set the backup item belongs to + BackupSetName *string `json:"backupSetName,omitempty"` + // CreateMode - Create mode to indicate recovery of existing soft deleted data source or creation of new data source. Possible values include: 'CreateModeInvalid', 'CreateModeDefault', 'CreateModeRecover' + CreateMode CreateMode `json:"createMode,omitempty"` + // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' + ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureVMWorkloadSAPHanaDatabaseProtectedItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) MarshalJSON() ([]byte, error) { + avwshdpi.ProtectedItemType = ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase + objectMap := make(map[string]interface{}) + if avwshdpi.FriendlyName != nil { + objectMap["friendlyName"] = avwshdpi.FriendlyName + } + if avwshdpi.ServerName != nil { + objectMap["serverName"] = avwshdpi.ServerName + } + if avwshdpi.ParentName != nil { + objectMap["parentName"] = avwshdpi.ParentName + } + if avwshdpi.ParentType != nil { + objectMap["parentType"] = avwshdpi.ParentType + } + if avwshdpi.ProtectionStatus != nil { + objectMap["protectionStatus"] = avwshdpi.ProtectionStatus + } + if avwshdpi.ProtectionState != "" { + objectMap["protectionState"] = avwshdpi.ProtectionState + } + if avwshdpi.LastBackupStatus != "" { + objectMap["lastBackupStatus"] = avwshdpi.LastBackupStatus + } + if avwshdpi.LastBackupTime != nil { + objectMap["lastBackupTime"] = avwshdpi.LastBackupTime + } + if avwshdpi.LastBackupErrorDetail != nil { + objectMap["lastBackupErrorDetail"] = avwshdpi.LastBackupErrorDetail + } + if avwshdpi.ProtectedItemDataSourceID != nil { + objectMap["protectedItemDataSourceId"] = avwshdpi.ProtectedItemDataSourceID + } + if avwshdpi.ProtectedItemHealthStatus != "" { + objectMap["protectedItemHealthStatus"] = avwshdpi.ProtectedItemHealthStatus + } + if avwshdpi.ExtendedInfo != nil { + objectMap["extendedInfo"] = avwshdpi.ExtendedInfo + } + if avwshdpi.BackupManagementType != "" { + objectMap["backupManagementType"] = avwshdpi.BackupManagementType + } + if avwshdpi.WorkloadType != "" { + objectMap["workloadType"] = avwshdpi.WorkloadType + } + if avwshdpi.ContainerName != nil { + objectMap["containerName"] = avwshdpi.ContainerName + } + if avwshdpi.SourceResourceID != nil { + objectMap["sourceResourceId"] = avwshdpi.SourceResourceID + } + if avwshdpi.PolicyID != nil { + objectMap["policyId"] = avwshdpi.PolicyID + } + if avwshdpi.LastRecoveryPoint != nil { + objectMap["lastRecoveryPoint"] = avwshdpi.LastRecoveryPoint + } + if avwshdpi.BackupSetName != nil { + objectMap["backupSetName"] = avwshdpi.BackupSetName + } + if avwshdpi.CreateMode != "" { + objectMap["createMode"] = avwshdpi.CreateMode + } + if avwshdpi.ProtectedItemType != "" { + objectMap["protectedItemType"] = avwshdpi.ProtectedItemType + } + return json.Marshal(objectMap) +} + +// AsAzureFileshareProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsAzureFileshareProtectedItem() (*AzureFileshareProtectedItem, bool) { + return nil, false +} + +// AsAzureIaaSClassicComputeVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) { + return nil, false +} + +// AsAzureIaaSComputeVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) { + return nil, false +} + +// AsAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) { + return nil, false +} + +// AsBasicAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) { + return nil, false +} + +// AsAzureSQLProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) { + return nil, false +} + +// AsBasicAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) { + return &avwshdpi, true +} + +// AsAzureVMWorkloadSAPHanaDatabaseProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) { + return &avwshdpi, true +} + +// AsAzureVMWorkloadSQLDatabaseProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) { + return nil, false +} + +// AsDPMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsDPMProtectedItem() (*DPMProtectedItem, bool) { + return nil, false +} + +// AsGenericProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsGenericProtectedItem() (*GenericProtectedItem, bool) { + return nil, false +} + +// AsMabFileFolderProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) { + return nil, false +} + +// AsProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsProtectedItem() (*ProtectedItem, bool) { + return nil, false +} + +// AsBasicProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsBasicProtectedItem() (BasicProtectedItem, bool) { + return &avwshdpi, true +} + +// AzureVMWorkloadSAPHanaDatabaseWorkloadItem azure VM workload-specific workload item representing SAP Hana +// Database. +type AzureVMWorkloadSAPHanaDatabaseWorkloadItem struct { + // ParentName - Name for instance or AG + ParentName *string `json:"parentName,omitempty"` + // ServerName - Host/Cluster Name for instance or AG + ServerName *string `json:"serverName,omitempty"` + // IsAutoProtectable - Indicates if workload item is auto-protectable + IsAutoProtectable *bool `json:"isAutoProtectable,omitempty"` + // Subinquireditemcount - For instance or AG, indicates number of DB's present + Subinquireditemcount *int32 `json:"subinquireditemcount,omitempty"` + // SubWorkloadItemCount - For instance or AG, indicates number of DB's to be protected + SubWorkloadItemCount *int32 `json:"subWorkloadItemCount,omitempty"` + // BackupManagementType - Type of backup managemenent to backup an item. + BackupManagementType *string `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload for the backup management + WorkloadType *string `json:"workloadType,omitempty"` + // FriendlyName - Friendly name of the backup item. + FriendlyName *string `json:"friendlyName,omitempty"` + // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' + ProtectionState ProtectionStatus `json:"protectionState,omitempty"` + // WorkloadItemType - Possible values include: 'WorkloadItemTypeWorkloadItem', 'WorkloadItemTypeAzureVMWorkloadItem', 'WorkloadItemTypeSAPHanaDatabase1', 'WorkloadItemTypeSAPHanaSystem1', 'WorkloadItemTypeSQLDataBase1', 'WorkloadItemTypeSQLInstance1' + WorkloadItemType WorkloadItemTypeBasicWorkloadItem `json:"workloadItemType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureVMWorkloadSAPHanaDatabaseWorkloadItem. +func (avwshdwi AzureVMWorkloadSAPHanaDatabaseWorkloadItem) MarshalJSON() ([]byte, error) { + avwshdwi.WorkloadItemType = WorkloadItemTypeSAPHanaDatabase1 + objectMap := make(map[string]interface{}) + if avwshdwi.ParentName != nil { + objectMap["parentName"] = avwshdwi.ParentName + } + if avwshdwi.ServerName != nil { + objectMap["serverName"] = avwshdwi.ServerName + } + if avwshdwi.IsAutoProtectable != nil { + objectMap["isAutoProtectable"] = avwshdwi.IsAutoProtectable + } + if avwshdwi.Subinquireditemcount != nil { + objectMap["subinquireditemcount"] = avwshdwi.Subinquireditemcount + } + if avwshdwi.SubWorkloadItemCount != nil { + objectMap["subWorkloadItemCount"] = avwshdwi.SubWorkloadItemCount + } + if avwshdwi.BackupManagementType != nil { + objectMap["backupManagementType"] = avwshdwi.BackupManagementType + } + if avwshdwi.WorkloadType != nil { + objectMap["workloadType"] = avwshdwi.WorkloadType + } + if avwshdwi.FriendlyName != nil { + objectMap["friendlyName"] = avwshdwi.FriendlyName + } + if avwshdwi.ProtectionState != "" { + objectMap["protectionState"] = avwshdwi.ProtectionState + } + if avwshdwi.WorkloadItemType != "" { + objectMap["workloadItemType"] = avwshdwi.WorkloadItemType + } + return json.Marshal(objectMap) +} + +// AsAzureVMWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaDatabaseWorkloadItem. +func (avwshdwi AzureVMWorkloadSAPHanaDatabaseWorkloadItem) AsAzureVMWorkloadItem() (*AzureVMWorkloadItem, bool) { + return nil, false +} + +// AsBasicAzureVMWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaDatabaseWorkloadItem. +func (avwshdwi AzureVMWorkloadSAPHanaDatabaseWorkloadItem) AsBasicAzureVMWorkloadItem() (BasicAzureVMWorkloadItem, bool) { + return &avwshdwi, true +} + +// AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaDatabaseWorkloadItem. +func (avwshdwi AzureVMWorkloadSAPHanaDatabaseWorkloadItem) AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem() (*AzureVMWorkloadSAPHanaDatabaseWorkloadItem, bool) { + return &avwshdwi, true +} + +// AsAzureVMWorkloadSAPHanaSystemWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaDatabaseWorkloadItem. +func (avwshdwi AzureVMWorkloadSAPHanaDatabaseWorkloadItem) AsAzureVMWorkloadSAPHanaSystemWorkloadItem() (*AzureVMWorkloadSAPHanaSystemWorkloadItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaDatabaseWorkloadItem. +func (avwshdwi AzureVMWorkloadSAPHanaDatabaseWorkloadItem) AsAzureVMWorkloadSQLDatabaseWorkloadItem() (*AzureVMWorkloadSQLDatabaseWorkloadItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLInstanceWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaDatabaseWorkloadItem. +func (avwshdwi AzureVMWorkloadSAPHanaDatabaseWorkloadItem) AsAzureVMWorkloadSQLInstanceWorkloadItem() (*AzureVMWorkloadSQLInstanceWorkloadItem, bool) { + return nil, false +} + +// AsWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaDatabaseWorkloadItem. +func (avwshdwi AzureVMWorkloadSAPHanaDatabaseWorkloadItem) AsWorkloadItem() (*WorkloadItem, bool) { + return nil, false +} + +// AsBasicWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaDatabaseWorkloadItem. +func (avwshdwi AzureVMWorkloadSAPHanaDatabaseWorkloadItem) AsBasicWorkloadItem() (BasicWorkloadItem, bool) { + return &avwshdwi, true +} + +// AzureVMWorkloadSAPHanaSystemProtectableItem azure VM workload-specific protectable item representing SAP Hana +// System. +type AzureVMWorkloadSAPHanaSystemProtectableItem struct { + // ParentName - Name for instance or AG + ParentName *string `json:"parentName,omitempty"` + // ParentUniqueName - Parent Unique Name is added to provide the service formatted URI Name of the Parent + // Only Applicable for data bases where the parent would be either Instance or a SQL AG. + ParentUniqueName *string `json:"parentUniqueName,omitempty"` + // ServerName - Host/Cluster Name for instance or AG + ServerName *string `json:"serverName,omitempty"` + // IsAutoProtectable - Indicates if protectable item is auto-protectable + IsAutoProtectable *bool `json:"isAutoProtectable,omitempty"` + // Subinquireditemcount - For instance or AG, indicates number of DB's present + Subinquireditemcount *int32 `json:"subinquireditemcount,omitempty"` + // Subprotectableitemcount - For instance or AG, indicates number of DB's to be protected + Subprotectableitemcount *int32 `json:"subprotectableitemcount,omitempty"` + // Prebackupvalidation - Pre-backup validation for protectable objects + Prebackupvalidation *PreBackupValidation `json:"prebackupvalidation,omitempty"` + // BackupManagementType - Type of backup managemenent to backup an item. + BackupManagementType *string `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload for the backup management + WorkloadType *string `json:"workloadType,omitempty"` + // FriendlyName - Friendly name of the backup item. + FriendlyName *string `json:"friendlyName,omitempty"` + // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' + ProtectionState ProtectionStatus `json:"protectionState,omitempty"` + // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' + ProtectableItemType ProtectableItemType `json:"protectableItemType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureVMWorkloadSAPHanaSystemProtectableItem. +func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) MarshalJSON() ([]byte, error) { + avwshspi.ProtectableItemType = ProtectableItemTypeSAPHanaSystem + objectMap := make(map[string]interface{}) + if avwshspi.ParentName != nil { + objectMap["parentName"] = avwshspi.ParentName + } + if avwshspi.ParentUniqueName != nil { + objectMap["parentUniqueName"] = avwshspi.ParentUniqueName + } + if avwshspi.ServerName != nil { + objectMap["serverName"] = avwshspi.ServerName + } + if avwshspi.IsAutoProtectable != nil { + objectMap["isAutoProtectable"] = avwshspi.IsAutoProtectable + } + if avwshspi.Subinquireditemcount != nil { + objectMap["subinquireditemcount"] = avwshspi.Subinquireditemcount + } + if avwshspi.Subprotectableitemcount != nil { + objectMap["subprotectableitemcount"] = avwshspi.Subprotectableitemcount + } + if avwshspi.Prebackupvalidation != nil { + objectMap["prebackupvalidation"] = avwshspi.Prebackupvalidation + } + if avwshspi.BackupManagementType != nil { + objectMap["backupManagementType"] = avwshspi.BackupManagementType + } + if avwshspi.WorkloadType != nil { + objectMap["workloadType"] = avwshspi.WorkloadType + } + if avwshspi.FriendlyName != nil { + objectMap["friendlyName"] = avwshspi.FriendlyName + } + if avwshspi.ProtectionState != "" { + objectMap["protectionState"] = avwshspi.ProtectionState + } + if avwshspi.ProtectableItemType != "" { + objectMap["protectableItemType"] = avwshspi.ProtectableItemType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. +func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) { + return nil, false +} + +// AsAzureIaaSClassicComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. +func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) { + return nil, false +} + +// AsAzureIaaSComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. +func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. +func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) { + return nil, false +} + +// AsBasicAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. +func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) { + return &avwshspi, true +} + +// AsAzureVMWorkloadSAPHanaDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. +func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. +func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) { + return &avwshspi, true +} + +// AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. +func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. +func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLInstanceProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. +func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) { + return nil, false +} + +// AsIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. +func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) { + return nil, false +} + +// AsBasicIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. +func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) { + return nil, false +} + +// AsWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. +func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) { + return nil, false +} + +// AsBasicWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. +func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) { + return &avwshspi, true +} + +// AzureVMWorkloadSAPHanaSystemWorkloadItem azure VM workload-specific workload item representing SAP Hana System. +type AzureVMWorkloadSAPHanaSystemWorkloadItem struct { + // ParentName - Name for instance or AG + ParentName *string `json:"parentName,omitempty"` + // ServerName - Host/Cluster Name for instance or AG + ServerName *string `json:"serverName,omitempty"` + // IsAutoProtectable - Indicates if workload item is auto-protectable + IsAutoProtectable *bool `json:"isAutoProtectable,omitempty"` + // Subinquireditemcount - For instance or AG, indicates number of DB's present + Subinquireditemcount *int32 `json:"subinquireditemcount,omitempty"` + // SubWorkloadItemCount - For instance or AG, indicates number of DB's to be protected + SubWorkloadItemCount *int32 `json:"subWorkloadItemCount,omitempty"` + // BackupManagementType - Type of backup managemenent to backup an item. + BackupManagementType *string `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload for the backup management + WorkloadType *string `json:"workloadType,omitempty"` + // FriendlyName - Friendly name of the backup item. + FriendlyName *string `json:"friendlyName,omitempty"` + // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' + ProtectionState ProtectionStatus `json:"protectionState,omitempty"` + // WorkloadItemType - Possible values include: 'WorkloadItemTypeWorkloadItem', 'WorkloadItemTypeAzureVMWorkloadItem', 'WorkloadItemTypeSAPHanaDatabase1', 'WorkloadItemTypeSAPHanaSystem1', 'WorkloadItemTypeSQLDataBase1', 'WorkloadItemTypeSQLInstance1' + WorkloadItemType WorkloadItemTypeBasicWorkloadItem `json:"workloadItemType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureVMWorkloadSAPHanaSystemWorkloadItem. +func (avwshswi AzureVMWorkloadSAPHanaSystemWorkloadItem) MarshalJSON() ([]byte, error) { + avwshswi.WorkloadItemType = WorkloadItemTypeSAPHanaSystem1 + objectMap := make(map[string]interface{}) + if avwshswi.ParentName != nil { + objectMap["parentName"] = avwshswi.ParentName + } + if avwshswi.ServerName != nil { + objectMap["serverName"] = avwshswi.ServerName + } + if avwshswi.IsAutoProtectable != nil { + objectMap["isAutoProtectable"] = avwshswi.IsAutoProtectable + } + if avwshswi.Subinquireditemcount != nil { + objectMap["subinquireditemcount"] = avwshswi.Subinquireditemcount + } + if avwshswi.SubWorkloadItemCount != nil { + objectMap["subWorkloadItemCount"] = avwshswi.SubWorkloadItemCount + } + if avwshswi.BackupManagementType != nil { + objectMap["backupManagementType"] = avwshswi.BackupManagementType + } + if avwshswi.WorkloadType != nil { + objectMap["workloadType"] = avwshswi.WorkloadType + } + if avwshswi.FriendlyName != nil { + objectMap["friendlyName"] = avwshswi.FriendlyName + } + if avwshswi.ProtectionState != "" { + objectMap["protectionState"] = avwshswi.ProtectionState + } + if avwshswi.WorkloadItemType != "" { + objectMap["workloadItemType"] = avwshswi.WorkloadItemType + } + return json.Marshal(objectMap) +} + +// AsAzureVMWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaSystemWorkloadItem. +func (avwshswi AzureVMWorkloadSAPHanaSystemWorkloadItem) AsAzureVMWorkloadItem() (*AzureVMWorkloadItem, bool) { + return nil, false +} + +// AsBasicAzureVMWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaSystemWorkloadItem. +func (avwshswi AzureVMWorkloadSAPHanaSystemWorkloadItem) AsBasicAzureVMWorkloadItem() (BasicAzureVMWorkloadItem, bool) { + return &avwshswi, true +} + +// AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaSystemWorkloadItem. +func (avwshswi AzureVMWorkloadSAPHanaSystemWorkloadItem) AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem() (*AzureVMWorkloadSAPHanaDatabaseWorkloadItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaSystemWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaSystemWorkloadItem. +func (avwshswi AzureVMWorkloadSAPHanaSystemWorkloadItem) AsAzureVMWorkloadSAPHanaSystemWorkloadItem() (*AzureVMWorkloadSAPHanaSystemWorkloadItem, bool) { + return &avwshswi, true +} + +// AsAzureVMWorkloadSQLDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaSystemWorkloadItem. +func (avwshswi AzureVMWorkloadSAPHanaSystemWorkloadItem) AsAzureVMWorkloadSQLDatabaseWorkloadItem() (*AzureVMWorkloadSQLDatabaseWorkloadItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLInstanceWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaSystemWorkloadItem. +func (avwshswi AzureVMWorkloadSAPHanaSystemWorkloadItem) AsAzureVMWorkloadSQLInstanceWorkloadItem() (*AzureVMWorkloadSQLInstanceWorkloadItem, bool) { + return nil, false +} + +// AsWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaSystemWorkloadItem. +func (avwshswi AzureVMWorkloadSAPHanaSystemWorkloadItem) AsWorkloadItem() (*WorkloadItem, bool) { + return nil, false +} + +// AsBasicWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaSystemWorkloadItem. +func (avwshswi AzureVMWorkloadSAPHanaSystemWorkloadItem) AsBasicWorkloadItem() (BasicWorkloadItem, bool) { + return &avwshswi, true +} + +// AzureVMWorkloadSQLAvailabilityGroupProtectableItem azure VM workload-specific protectable item representing SQL +// Availability Group. +type AzureVMWorkloadSQLAvailabilityGroupProtectableItem struct { + // ParentName - Name for instance or AG + ParentName *string `json:"parentName,omitempty"` + // ParentUniqueName - Parent Unique Name is added to provide the service formatted URI Name of the Parent + // Only Applicable for data bases where the parent would be either Instance or a SQL AG. + ParentUniqueName *string `json:"parentUniqueName,omitempty"` + // ServerName - Host/Cluster Name for instance or AG + ServerName *string `json:"serverName,omitempty"` + // IsAutoProtectable - Indicates if protectable item is auto-protectable + IsAutoProtectable *bool `json:"isAutoProtectable,omitempty"` + // Subinquireditemcount - For instance or AG, indicates number of DB's present + Subinquireditemcount *int32 `json:"subinquireditemcount,omitempty"` + // Subprotectableitemcount - For instance or AG, indicates number of DB's to be protected + Subprotectableitemcount *int32 `json:"subprotectableitemcount,omitempty"` + // Prebackupvalidation - Pre-backup validation for protectable objects + Prebackupvalidation *PreBackupValidation `json:"prebackupvalidation,omitempty"` + // BackupManagementType - Type of backup managemenent to backup an item. + BackupManagementType *string `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload for the backup management + WorkloadType *string `json:"workloadType,omitempty"` + // FriendlyName - Friendly name of the backup item. + FriendlyName *string `json:"friendlyName,omitempty"` + // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' + ProtectionState ProtectionStatus `json:"protectionState,omitempty"` + // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' + ProtectableItemType ProtectableItemType `json:"protectableItemType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. +func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) MarshalJSON() ([]byte, error) { + avwsagpi.ProtectableItemType = ProtectableItemTypeSQLAvailabilityGroupContainer + objectMap := make(map[string]interface{}) + if avwsagpi.ParentName != nil { + objectMap["parentName"] = avwsagpi.ParentName + } + if avwsagpi.ParentUniqueName != nil { + objectMap["parentUniqueName"] = avwsagpi.ParentUniqueName + } + if avwsagpi.ServerName != nil { + objectMap["serverName"] = avwsagpi.ServerName + } + if avwsagpi.IsAutoProtectable != nil { + objectMap["isAutoProtectable"] = avwsagpi.IsAutoProtectable + } + if avwsagpi.Subinquireditemcount != nil { + objectMap["subinquireditemcount"] = avwsagpi.Subinquireditemcount + } + if avwsagpi.Subprotectableitemcount != nil { + objectMap["subprotectableitemcount"] = avwsagpi.Subprotectableitemcount + } + if avwsagpi.Prebackupvalidation != nil { + objectMap["prebackupvalidation"] = avwsagpi.Prebackupvalidation + } + if avwsagpi.BackupManagementType != nil { + objectMap["backupManagementType"] = avwsagpi.BackupManagementType + } + if avwsagpi.WorkloadType != nil { + objectMap["workloadType"] = avwsagpi.WorkloadType + } + if avwsagpi.FriendlyName != nil { + objectMap["friendlyName"] = avwsagpi.FriendlyName + } + if avwsagpi.ProtectionState != "" { + objectMap["protectionState"] = avwsagpi.ProtectionState + } + if avwsagpi.ProtectableItemType != "" { + objectMap["protectableItemType"] = avwsagpi.ProtectableItemType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. +func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) { + return nil, false +} + +// AsAzureIaaSClassicComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. +func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) { + return nil, false +} + +// AsAzureIaaSComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. +func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. +func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) { + return nil, false +} + +// AsBasicAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. +func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) { + return &avwsagpi, true +} + +// AsAzureVMWorkloadSAPHanaDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. +func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. +func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. +func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) { + return &avwsagpi, true +} + +// AsAzureVMWorkloadSQLDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. +func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLInstanceProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. +func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) { + return nil, false +} + +// AsIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. +func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) { + return nil, false +} + +// AsBasicIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. +func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) { + return nil, false +} + +// AsWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. +func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) { + return nil, false +} + +// AsBasicWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. +func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) { + return &avwsagpi, true +} + +// AzureVMWorkloadSQLDatabaseProtectableItem azure VM workload-specific protectable item representing SQL Database. +type AzureVMWorkloadSQLDatabaseProtectableItem struct { + // ParentName - Name for instance or AG + ParentName *string `json:"parentName,omitempty"` + // ParentUniqueName - Parent Unique Name is added to provide the service formatted URI Name of the Parent + // Only Applicable for data bases where the parent would be either Instance or a SQL AG. + ParentUniqueName *string `json:"parentUniqueName,omitempty"` + // ServerName - Host/Cluster Name for instance or AG + ServerName *string `json:"serverName,omitempty"` + // IsAutoProtectable - Indicates if protectable item is auto-protectable + IsAutoProtectable *bool `json:"isAutoProtectable,omitempty"` + // Subinquireditemcount - For instance or AG, indicates number of DB's present + Subinquireditemcount *int32 `json:"subinquireditemcount,omitempty"` + // Subprotectableitemcount - For instance or AG, indicates number of DB's to be protected + Subprotectableitemcount *int32 `json:"subprotectableitemcount,omitempty"` + // Prebackupvalidation - Pre-backup validation for protectable objects + Prebackupvalidation *PreBackupValidation `json:"prebackupvalidation,omitempty"` + // BackupManagementType - Type of backup managemenent to backup an item. + BackupManagementType *string `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload for the backup management + WorkloadType *string `json:"workloadType,omitempty"` + // FriendlyName - Friendly name of the backup item. + FriendlyName *string `json:"friendlyName,omitempty"` + // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' + ProtectionState ProtectionStatus `json:"protectionState,omitempty"` + // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' + ProtectableItemType ProtectableItemType `json:"protectableItemType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureVMWorkloadSQLDatabaseProtectableItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) MarshalJSON() ([]byte, error) { + avwsdpi.ProtectableItemType = ProtectableItemTypeSQLDataBase + objectMap := make(map[string]interface{}) + if avwsdpi.ParentName != nil { + objectMap["parentName"] = avwsdpi.ParentName + } + if avwsdpi.ParentUniqueName != nil { + objectMap["parentUniqueName"] = avwsdpi.ParentUniqueName + } + if avwsdpi.ServerName != nil { + objectMap["serverName"] = avwsdpi.ServerName + } + if avwsdpi.IsAutoProtectable != nil { + objectMap["isAutoProtectable"] = avwsdpi.IsAutoProtectable + } + if avwsdpi.Subinquireditemcount != nil { + objectMap["subinquireditemcount"] = avwsdpi.Subinquireditemcount + } + if avwsdpi.Subprotectableitemcount != nil { + objectMap["subprotectableitemcount"] = avwsdpi.Subprotectableitemcount + } + if avwsdpi.Prebackupvalidation != nil { + objectMap["prebackupvalidation"] = avwsdpi.Prebackupvalidation + } + if avwsdpi.BackupManagementType != nil { + objectMap["backupManagementType"] = avwsdpi.BackupManagementType + } + if avwsdpi.WorkloadType != nil { + objectMap["workloadType"] = avwsdpi.WorkloadType + } + if avwsdpi.FriendlyName != nil { + objectMap["friendlyName"] = avwsdpi.FriendlyName + } + if avwsdpi.ProtectionState != "" { + objectMap["protectionState"] = avwsdpi.ProtectionState + } + if avwsdpi.ProtectableItemType != "" { + objectMap["protectableItemType"] = avwsdpi.ProtectableItemType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) { + return nil, false +} + +// AsAzureIaaSClassicComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) { + return nil, false +} + +// AsAzureIaaSComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) { + return nil, false +} + +// AsBasicAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) { + return &avwsdpi, true +} + +// AsAzureVMWorkloadSAPHanaDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) { + return &avwsdpi, true +} + +// AsAzureVMWorkloadSQLInstanceProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) { + return nil, false +} + +// AsIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) { + return nil, false +} + +// AsBasicIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) { + return nil, false +} + +// AsWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) { + return nil, false +} + +// AsBasicWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) { + return &avwsdpi, true +} + +// AzureVMWorkloadSQLDatabaseProtectedItem azure VM workload-specific protected item representing SQL Database. +type AzureVMWorkloadSQLDatabaseProtectedItem struct { + // FriendlyName - Friendly name of the DB represented by this backup item. + FriendlyName *string `json:"friendlyName,omitempty"` + // ServerName - Host/Cluster Name for instance or AG + ServerName *string `json:"serverName,omitempty"` + // ParentName - Parent name of the DB such as Instance or Availability Group. + ParentName *string `json:"parentName,omitempty"` + // ParentType - Parent type of DB, SQLAG or StandAlone + ParentType *string `json:"parentType,omitempty"` + // ProtectionStatus - Backup status of this backup item. + ProtectionStatus *string `json:"protectionStatus,omitempty"` + // ProtectionState - Backup state of this backup item. Possible values include: 'ProtectionStateInvalid', 'ProtectionStateIRPending', 'ProtectionStateProtected', 'ProtectionStateProtectionError', 'ProtectionStateProtectionStopped', 'ProtectionStateProtectionPaused' + ProtectionState ProtectionState `json:"protectionState,omitempty"` + // LastBackupStatus - Last backup operation status. Possible values: Healthy, Unhealthy. Possible values include: 'LastBackupStatusInvalid', 'LastBackupStatusHealthy', 'LastBackupStatusUnhealthy', 'LastBackupStatusIRPending' + LastBackupStatus LastBackupStatus `json:"lastBackupStatus,omitempty"` + // LastBackupTime - Timestamp of the last backup operation on this backup item. + LastBackupTime *date.Time `json:"lastBackupTime,omitempty"` + // LastBackupErrorDetail - Error details in last backup + LastBackupErrorDetail *ErrorDetail `json:"lastBackupErrorDetail,omitempty"` + // ProtectedItemDataSourceID - Data ID of the protected item. + ProtectedItemDataSourceID *string `json:"protectedItemDataSourceId,omitempty"` + // ProtectedItemHealthStatus - Health status of the backup item, evaluated based on last heartbeat received. Possible values include: 'ProtectedItemHealthStatusInvalid', 'ProtectedItemHealthStatusHealthy', 'ProtectedItemHealthStatusUnhealthy', 'ProtectedItemHealthStatusNotReachable', 'ProtectedItemHealthStatusIRPending' + ProtectedItemHealthStatus ProtectedItemHealthStatus `json:"protectedItemHealthStatus,omitempty"` + // ExtendedInfo - Additional information for this backup item. + ExtendedInfo *AzureVMWorkloadProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` + // BackupManagementType - Type of backup managemenent for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase' + WorkloadType DataSourceType `json:"workloadType,omitempty"` + // ContainerName - Unique name of container + ContainerName *string `json:"containerName,omitempty"` + // SourceResourceID - ARM ID of the resource to be backed up. + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // PolicyID - ID of the backup policy with which this item is backed up. + PolicyID *string `json:"policyId,omitempty"` + // LastRecoveryPoint - Timestamp when the last (latest) backup copy was created for this backup item. + LastRecoveryPoint *date.Time `json:"lastRecoveryPoint,omitempty"` + // BackupSetName - Name of the backup set the backup item belongs to + BackupSetName *string `json:"backupSetName,omitempty"` + // CreateMode - Create mode to indicate recovery of existing soft deleted data source or creation of new data source. Possible values include: 'CreateModeInvalid', 'CreateModeDefault', 'CreateModeRecover' + CreateMode CreateMode `json:"createMode,omitempty"` + // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' + ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureVMWorkloadSQLDatabaseProtectedItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) MarshalJSON() ([]byte, error) { + avwsdpi.ProtectedItemType = ProtectedItemTypeAzureVMWorkloadSQLDatabase + objectMap := make(map[string]interface{}) + if avwsdpi.FriendlyName != nil { + objectMap["friendlyName"] = avwsdpi.FriendlyName + } + if avwsdpi.ServerName != nil { + objectMap["serverName"] = avwsdpi.ServerName + } + if avwsdpi.ParentName != nil { + objectMap["parentName"] = avwsdpi.ParentName + } + if avwsdpi.ParentType != nil { + objectMap["parentType"] = avwsdpi.ParentType + } + if avwsdpi.ProtectionStatus != nil { + objectMap["protectionStatus"] = avwsdpi.ProtectionStatus + } + if avwsdpi.ProtectionState != "" { + objectMap["protectionState"] = avwsdpi.ProtectionState + } + if avwsdpi.LastBackupStatus != "" { + objectMap["lastBackupStatus"] = avwsdpi.LastBackupStatus + } + if avwsdpi.LastBackupTime != nil { + objectMap["lastBackupTime"] = avwsdpi.LastBackupTime + } + if avwsdpi.LastBackupErrorDetail != nil { + objectMap["lastBackupErrorDetail"] = avwsdpi.LastBackupErrorDetail + } + if avwsdpi.ProtectedItemDataSourceID != nil { + objectMap["protectedItemDataSourceId"] = avwsdpi.ProtectedItemDataSourceID + } + if avwsdpi.ProtectedItemHealthStatus != "" { + objectMap["protectedItemHealthStatus"] = avwsdpi.ProtectedItemHealthStatus + } + if avwsdpi.ExtendedInfo != nil { + objectMap["extendedInfo"] = avwsdpi.ExtendedInfo + } + if avwsdpi.BackupManagementType != "" { + objectMap["backupManagementType"] = avwsdpi.BackupManagementType + } + if avwsdpi.WorkloadType != "" { + objectMap["workloadType"] = avwsdpi.WorkloadType + } + if avwsdpi.ContainerName != nil { + objectMap["containerName"] = avwsdpi.ContainerName + } + if avwsdpi.SourceResourceID != nil { + objectMap["sourceResourceId"] = avwsdpi.SourceResourceID + } + if avwsdpi.PolicyID != nil { + objectMap["policyId"] = avwsdpi.PolicyID + } + if avwsdpi.LastRecoveryPoint != nil { + objectMap["lastRecoveryPoint"] = avwsdpi.LastRecoveryPoint + } + if avwsdpi.BackupSetName != nil { + objectMap["backupSetName"] = avwsdpi.BackupSetName + } + if avwsdpi.CreateMode != "" { + objectMap["createMode"] = avwsdpi.CreateMode + } + if avwsdpi.ProtectedItemType != "" { + objectMap["protectedItemType"] = avwsdpi.ProtectedItemType + } + return json.Marshal(objectMap) +} + +// AsAzureFileshareProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsAzureFileshareProtectedItem() (*AzureFileshareProtectedItem, bool) { + return nil, false +} + +// AsAzureIaaSClassicComputeVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) { + return nil, false +} + +// AsAzureIaaSComputeVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) { + return nil, false +} + +// AsAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) { + return nil, false +} + +// AsBasicAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) { + return nil, false +} + +// AsAzureSQLProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) { + return nil, false +} + +// AsBasicAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaDatabaseProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLDatabaseProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) { + return &avwsdpi, true +} + +// AsDPMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsDPMProtectedItem() (*DPMProtectedItem, bool) { + return nil, false +} + +// AsGenericProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsGenericProtectedItem() (*GenericProtectedItem, bool) { + return nil, false +} + +// AsMabFileFolderProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) { + return nil, false +} + +// AsProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsProtectedItem() (*ProtectedItem, bool) { + return nil, false +} + +// AsBasicProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsBasicProtectedItem() (BasicProtectedItem, bool) { + return &avwsdpi, true +} + +// AzureVMWorkloadSQLDatabaseWorkloadItem azure VM workload-specific workload item representing SQL Database. +type AzureVMWorkloadSQLDatabaseWorkloadItem struct { + // ParentName - Name for instance or AG + ParentName *string `json:"parentName,omitempty"` + // ServerName - Host/Cluster Name for instance or AG + ServerName *string `json:"serverName,omitempty"` + // IsAutoProtectable - Indicates if workload item is auto-protectable + IsAutoProtectable *bool `json:"isAutoProtectable,omitempty"` + // Subinquireditemcount - For instance or AG, indicates number of DB's present + Subinquireditemcount *int32 `json:"subinquireditemcount,omitempty"` + // SubWorkloadItemCount - For instance or AG, indicates number of DB's to be protected + SubWorkloadItemCount *int32 `json:"subWorkloadItemCount,omitempty"` + // BackupManagementType - Type of backup managemenent to backup an item. + BackupManagementType *string `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload for the backup management + WorkloadType *string `json:"workloadType,omitempty"` + // FriendlyName - Friendly name of the backup item. + FriendlyName *string `json:"friendlyName,omitempty"` + // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' + ProtectionState ProtectionStatus `json:"protectionState,omitempty"` + // WorkloadItemType - Possible values include: 'WorkloadItemTypeWorkloadItem', 'WorkloadItemTypeAzureVMWorkloadItem', 'WorkloadItemTypeSAPHanaDatabase1', 'WorkloadItemTypeSAPHanaSystem1', 'WorkloadItemTypeSQLDataBase1', 'WorkloadItemTypeSQLInstance1' + WorkloadItemType WorkloadItemTypeBasicWorkloadItem `json:"workloadItemType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureVMWorkloadSQLDatabaseWorkloadItem. +func (avwsdwi AzureVMWorkloadSQLDatabaseWorkloadItem) MarshalJSON() ([]byte, error) { + avwsdwi.WorkloadItemType = WorkloadItemTypeSQLDataBase1 + objectMap := make(map[string]interface{}) + if avwsdwi.ParentName != nil { + objectMap["parentName"] = avwsdwi.ParentName + } + if avwsdwi.ServerName != nil { + objectMap["serverName"] = avwsdwi.ServerName + } + if avwsdwi.IsAutoProtectable != nil { + objectMap["isAutoProtectable"] = avwsdwi.IsAutoProtectable + } + if avwsdwi.Subinquireditemcount != nil { + objectMap["subinquireditemcount"] = avwsdwi.Subinquireditemcount + } + if avwsdwi.SubWorkloadItemCount != nil { + objectMap["subWorkloadItemCount"] = avwsdwi.SubWorkloadItemCount + } + if avwsdwi.BackupManagementType != nil { + objectMap["backupManagementType"] = avwsdwi.BackupManagementType + } + if avwsdwi.WorkloadType != nil { + objectMap["workloadType"] = avwsdwi.WorkloadType + } + if avwsdwi.FriendlyName != nil { + objectMap["friendlyName"] = avwsdwi.FriendlyName + } + if avwsdwi.ProtectionState != "" { + objectMap["protectionState"] = avwsdwi.ProtectionState + } + if avwsdwi.WorkloadItemType != "" { + objectMap["workloadItemType"] = avwsdwi.WorkloadItemType + } + return json.Marshal(objectMap) +} + +// AsAzureVMWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLDatabaseWorkloadItem. +func (avwsdwi AzureVMWorkloadSQLDatabaseWorkloadItem) AsAzureVMWorkloadItem() (*AzureVMWorkloadItem, bool) { + return nil, false +} + +// AsBasicAzureVMWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLDatabaseWorkloadItem. +func (avwsdwi AzureVMWorkloadSQLDatabaseWorkloadItem) AsBasicAzureVMWorkloadItem() (BasicAzureVMWorkloadItem, bool) { + return &avwsdwi, true +} + +// AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLDatabaseWorkloadItem. +func (avwsdwi AzureVMWorkloadSQLDatabaseWorkloadItem) AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem() (*AzureVMWorkloadSAPHanaDatabaseWorkloadItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaSystemWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLDatabaseWorkloadItem. +func (avwsdwi AzureVMWorkloadSQLDatabaseWorkloadItem) AsAzureVMWorkloadSAPHanaSystemWorkloadItem() (*AzureVMWorkloadSAPHanaSystemWorkloadItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLDatabaseWorkloadItem. +func (avwsdwi AzureVMWorkloadSQLDatabaseWorkloadItem) AsAzureVMWorkloadSQLDatabaseWorkloadItem() (*AzureVMWorkloadSQLDatabaseWorkloadItem, bool) { + return &avwsdwi, true +} + +// AsAzureVMWorkloadSQLInstanceWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLDatabaseWorkloadItem. +func (avwsdwi AzureVMWorkloadSQLDatabaseWorkloadItem) AsAzureVMWorkloadSQLInstanceWorkloadItem() (*AzureVMWorkloadSQLInstanceWorkloadItem, bool) { + return nil, false +} + +// AsWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLDatabaseWorkloadItem. +func (avwsdwi AzureVMWorkloadSQLDatabaseWorkloadItem) AsWorkloadItem() (*WorkloadItem, bool) { + return nil, false +} + +// AsBasicWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLDatabaseWorkloadItem. +func (avwsdwi AzureVMWorkloadSQLDatabaseWorkloadItem) AsBasicWorkloadItem() (BasicWorkloadItem, bool) { + return &avwsdwi, true +} + +// AzureVMWorkloadSQLInstanceProtectableItem azure VM workload-specific protectable item representing SQL Instance. +type AzureVMWorkloadSQLInstanceProtectableItem struct { + // ParentName - Name for instance or AG + ParentName *string `json:"parentName,omitempty"` + // ParentUniqueName - Parent Unique Name is added to provide the service formatted URI Name of the Parent + // Only Applicable for data bases where the parent would be either Instance or a SQL AG. + ParentUniqueName *string `json:"parentUniqueName,omitempty"` + // ServerName - Host/Cluster Name for instance or AG + ServerName *string `json:"serverName,omitempty"` + // IsAutoProtectable - Indicates if protectable item is auto-protectable + IsAutoProtectable *bool `json:"isAutoProtectable,omitempty"` + // Subinquireditemcount - For instance or AG, indicates number of DB's present + Subinquireditemcount *int32 `json:"subinquireditemcount,omitempty"` + // Subprotectableitemcount - For instance or AG, indicates number of DB's to be protected + Subprotectableitemcount *int32 `json:"subprotectableitemcount,omitempty"` + // Prebackupvalidation - Pre-backup validation for protectable objects + Prebackupvalidation *PreBackupValidation `json:"prebackupvalidation,omitempty"` + // BackupManagementType - Type of backup managemenent to backup an item. + BackupManagementType *string `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload for the backup management + WorkloadType *string `json:"workloadType,omitempty"` + // FriendlyName - Friendly name of the backup item. + FriendlyName *string `json:"friendlyName,omitempty"` + // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' + ProtectionState ProtectionStatus `json:"protectionState,omitempty"` + // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' + ProtectableItemType ProtectableItemType `json:"protectableItemType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureVMWorkloadSQLInstanceProtectableItem. +func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) MarshalJSON() ([]byte, error) { + avwsipi.ProtectableItemType = ProtectableItemTypeSQLInstance + objectMap := make(map[string]interface{}) + if avwsipi.ParentName != nil { + objectMap["parentName"] = avwsipi.ParentName + } + if avwsipi.ParentUniqueName != nil { + objectMap["parentUniqueName"] = avwsipi.ParentUniqueName + } + if avwsipi.ServerName != nil { + objectMap["serverName"] = avwsipi.ServerName + } + if avwsipi.IsAutoProtectable != nil { + objectMap["isAutoProtectable"] = avwsipi.IsAutoProtectable + } + if avwsipi.Subinquireditemcount != nil { + objectMap["subinquireditemcount"] = avwsipi.Subinquireditemcount + } + if avwsipi.Subprotectableitemcount != nil { + objectMap["subprotectableitemcount"] = avwsipi.Subprotectableitemcount + } + if avwsipi.Prebackupvalidation != nil { + objectMap["prebackupvalidation"] = avwsipi.Prebackupvalidation + } + if avwsipi.BackupManagementType != nil { + objectMap["backupManagementType"] = avwsipi.BackupManagementType + } + if avwsipi.WorkloadType != nil { + objectMap["workloadType"] = avwsipi.WorkloadType + } + if avwsipi.FriendlyName != nil { + objectMap["friendlyName"] = avwsipi.FriendlyName + } + if avwsipi.ProtectionState != "" { + objectMap["protectionState"] = avwsipi.ProtectionState + } + if avwsipi.ProtectableItemType != "" { + objectMap["protectableItemType"] = avwsipi.ProtectableItemType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. +func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) { + return nil, false +} + +// AsAzureIaaSClassicComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. +func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) { + return nil, false +} + +// AsAzureIaaSComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. +func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. +func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) { + return nil, false +} + +// AsBasicAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. +func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) { + return &avwsipi, true +} + +// AsAzureVMWorkloadSAPHanaDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. +func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. +func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. +func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. +func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLInstanceProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. +func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) { + return &avwsipi, true +} + +// AsIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. +func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) { + return nil, false +} + +// AsBasicIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. +func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) { + return nil, false +} + +// AsWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. +func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) { + return nil, false +} + +// AsBasicWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. +func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) { + return &avwsipi, true +} + +// AzureVMWorkloadSQLInstanceWorkloadItem azure VM workload-specific workload item representing SQL Instance. +type AzureVMWorkloadSQLInstanceWorkloadItem struct { + // DataDirectoryPaths - Data Directory Paths for default directories + DataDirectoryPaths *[]SQLDataDirectory `json:"dataDirectoryPaths,omitempty"` + // ParentName - Name for instance or AG + ParentName *string `json:"parentName,omitempty"` + // ServerName - Host/Cluster Name for instance or AG + ServerName *string `json:"serverName,omitempty"` + // IsAutoProtectable - Indicates if workload item is auto-protectable + IsAutoProtectable *bool `json:"isAutoProtectable,omitempty"` + // Subinquireditemcount - For instance or AG, indicates number of DB's present + Subinquireditemcount *int32 `json:"subinquireditemcount,omitempty"` + // SubWorkloadItemCount - For instance or AG, indicates number of DB's to be protected + SubWorkloadItemCount *int32 `json:"subWorkloadItemCount,omitempty"` + // BackupManagementType - Type of backup managemenent to backup an item. + BackupManagementType *string `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload for the backup management + WorkloadType *string `json:"workloadType,omitempty"` + // FriendlyName - Friendly name of the backup item. + FriendlyName *string `json:"friendlyName,omitempty"` + // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' + ProtectionState ProtectionStatus `json:"protectionState,omitempty"` + // WorkloadItemType - Possible values include: 'WorkloadItemTypeWorkloadItem', 'WorkloadItemTypeAzureVMWorkloadItem', 'WorkloadItemTypeSAPHanaDatabase1', 'WorkloadItemTypeSAPHanaSystem1', 'WorkloadItemTypeSQLDataBase1', 'WorkloadItemTypeSQLInstance1' + WorkloadItemType WorkloadItemTypeBasicWorkloadItem `json:"workloadItemType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureVMWorkloadSQLInstanceWorkloadItem. +func (avwsiwi AzureVMWorkloadSQLInstanceWorkloadItem) MarshalJSON() ([]byte, error) { + avwsiwi.WorkloadItemType = WorkloadItemTypeSQLInstance1 + objectMap := make(map[string]interface{}) + if avwsiwi.DataDirectoryPaths != nil { + objectMap["dataDirectoryPaths"] = avwsiwi.DataDirectoryPaths + } + if avwsiwi.ParentName != nil { + objectMap["parentName"] = avwsiwi.ParentName + } + if avwsiwi.ServerName != nil { + objectMap["serverName"] = avwsiwi.ServerName + } + if avwsiwi.IsAutoProtectable != nil { + objectMap["isAutoProtectable"] = avwsiwi.IsAutoProtectable + } + if avwsiwi.Subinquireditemcount != nil { + objectMap["subinquireditemcount"] = avwsiwi.Subinquireditemcount + } + if avwsiwi.SubWorkloadItemCount != nil { + objectMap["subWorkloadItemCount"] = avwsiwi.SubWorkloadItemCount + } + if avwsiwi.BackupManagementType != nil { + objectMap["backupManagementType"] = avwsiwi.BackupManagementType + } + if avwsiwi.WorkloadType != nil { + objectMap["workloadType"] = avwsiwi.WorkloadType + } + if avwsiwi.FriendlyName != nil { + objectMap["friendlyName"] = avwsiwi.FriendlyName + } + if avwsiwi.ProtectionState != "" { + objectMap["protectionState"] = avwsiwi.ProtectionState + } + if avwsiwi.WorkloadItemType != "" { + objectMap["workloadItemType"] = avwsiwi.WorkloadItemType + } + return json.Marshal(objectMap) +} + +// AsAzureVMWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLInstanceWorkloadItem. +func (avwsiwi AzureVMWorkloadSQLInstanceWorkloadItem) AsAzureVMWorkloadItem() (*AzureVMWorkloadItem, bool) { + return nil, false +} + +// AsBasicAzureVMWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLInstanceWorkloadItem. +func (avwsiwi AzureVMWorkloadSQLInstanceWorkloadItem) AsBasicAzureVMWorkloadItem() (BasicAzureVMWorkloadItem, bool) { + return &avwsiwi, true +} + +// AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLInstanceWorkloadItem. +func (avwsiwi AzureVMWorkloadSQLInstanceWorkloadItem) AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem() (*AzureVMWorkloadSAPHanaDatabaseWorkloadItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaSystemWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLInstanceWorkloadItem. +func (avwsiwi AzureVMWorkloadSQLInstanceWorkloadItem) AsAzureVMWorkloadSAPHanaSystemWorkloadItem() (*AzureVMWorkloadSAPHanaSystemWorkloadItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLInstanceWorkloadItem. +func (avwsiwi AzureVMWorkloadSQLInstanceWorkloadItem) AsAzureVMWorkloadSQLDatabaseWorkloadItem() (*AzureVMWorkloadSQLDatabaseWorkloadItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLInstanceWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLInstanceWorkloadItem. +func (avwsiwi AzureVMWorkloadSQLInstanceWorkloadItem) AsAzureVMWorkloadSQLInstanceWorkloadItem() (*AzureVMWorkloadSQLInstanceWorkloadItem, bool) { + return &avwsiwi, true +} + +// AsWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLInstanceWorkloadItem. +func (avwsiwi AzureVMWorkloadSQLInstanceWorkloadItem) AsWorkloadItem() (*WorkloadItem, bool) { + return nil, false +} + +// AsBasicWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLInstanceWorkloadItem. +func (avwsiwi AzureVMWorkloadSQLInstanceWorkloadItem) AsBasicWorkloadItem() (BasicWorkloadItem, bool) { + return &avwsiwi, true +} + +// AzureWorkloadBackupRequest azureWorkload workload-specific backup request. +type AzureWorkloadBackupRequest struct { + // BackupType - Type of backup, viz. Full, Differential, Log or CopyOnlyFull. Possible values include: 'TypeInvalid', 'TypeFull', 'TypeDifferential', 'TypeLog', 'TypeCopyOnlyFull' + BackupType Type `json:"backupType,omitempty"` + // EnableCompression - Bool for Compression setting + EnableCompression *bool `json:"enableCompression,omitempty"` + // RecoveryPointExpiryTimeInUTC - Backup copy will expire after the time specified (UTC). + RecoveryPointExpiryTimeInUTC *date.Time `json:"recoveryPointExpiryTimeInUTC,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeBackupRequest', 'ObjectTypeAzureFileShareBackupRequest', 'ObjectTypeAzureWorkloadBackupRequest', 'ObjectTypeIaasVMBackupRequest' + ObjectType ObjectType `json:"objectType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureWorkloadBackupRequest. +func (awbr AzureWorkloadBackupRequest) MarshalJSON() ([]byte, error) { + awbr.ObjectType = ObjectTypeAzureWorkloadBackupRequest + objectMap := make(map[string]interface{}) + if awbr.BackupType != "" { + objectMap["backupType"] = awbr.BackupType + } + if awbr.EnableCompression != nil { + objectMap["enableCompression"] = awbr.EnableCompression + } + if awbr.RecoveryPointExpiryTimeInUTC != nil { + objectMap["recoveryPointExpiryTimeInUTC"] = awbr.RecoveryPointExpiryTimeInUTC + } + if awbr.ObjectType != "" { + objectMap["objectType"] = awbr.ObjectType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareBackupRequest is the BasicRequest implementation for AzureWorkloadBackupRequest. +func (awbr AzureWorkloadBackupRequest) AsAzureFileShareBackupRequest() (*AzureFileShareBackupRequest, bool) { + return nil, false +} + +// AsAzureWorkloadBackupRequest is the BasicRequest implementation for AzureWorkloadBackupRequest. +func (awbr AzureWorkloadBackupRequest) AsAzureWorkloadBackupRequest() (*AzureWorkloadBackupRequest, bool) { + return &awbr, true +} + +// AsIaasVMBackupRequest is the BasicRequest implementation for AzureWorkloadBackupRequest. +func (awbr AzureWorkloadBackupRequest) AsIaasVMBackupRequest() (*IaasVMBackupRequest, bool) { + return nil, false +} + +// AsRequest is the BasicRequest implementation for AzureWorkloadBackupRequest. +func (awbr AzureWorkloadBackupRequest) AsRequest() (*Request, bool) { + return nil, false +} + +// AsBasicRequest is the BasicRequest implementation for AzureWorkloadBackupRequest. +func (awbr AzureWorkloadBackupRequest) AsBasicRequest() (BasicRequest, bool) { + return &awbr, true +} + +// BasicAzureWorkloadContainer container for the workloads running inside Azure Compute or Classic Compute. +type BasicAzureWorkloadContainer interface { + AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) + AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) + AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) +} + +// AzureWorkloadContainer container for the workloads running inside Azure Compute or Classic Compute. +type AzureWorkloadContainer struct { + // SourceResourceID - ARM ID of the virtual machine represented by this Azure Workload Container + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // LastUpdatedTime - Time stamp when this container was updated. + LastUpdatedTime *date.Time `json:"lastUpdatedTime,omitempty"` + // ExtendedInfo - Additional details of a workload container. + ExtendedInfo *AzureWorkloadContainerExtendedInfo `json:"extendedInfo,omitempty"` + // WorkloadType - Workload type for which registration was sent. Possible values include: 'WorkloadTypeInvalid', 'WorkloadTypeVM', 'WorkloadTypeFileFolder', 'WorkloadTypeAzureSQLDb', 'WorkloadTypeSQLDB', 'WorkloadTypeExchange', 'WorkloadTypeSharepoint', 'WorkloadTypeVMwareVM', 'WorkloadTypeSystemState', 'WorkloadTypeClient', 'WorkloadTypeGenericDataSource', 'WorkloadTypeSQLDataBase', 'WorkloadTypeAzureFileShare', 'WorkloadTypeSAPHanaDatabase' + WorkloadType WorkloadType `json:"workloadType,omitempty"` + // FriendlyName - Friendly name of the container. + FriendlyName *string `json:"friendlyName,omitempty"` + // BackupManagementType - Type of backup managemenent for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // RegistrationStatus - Status of registration of the container with the Recovery Services Vault. + RegistrationStatus *string `json:"registrationStatus,omitempty"` + // HealthStatus - Status of health of the container. + HealthStatus *string `json:"healthStatus,omitempty"` + // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaaSVMContainer', 'ContainerTypeWindows1' + ContainerType ContainerTypeBasicProtectionContainer `json:"containerType,omitempty"` +} + +func unmarshalBasicAzureWorkloadContainer(body []byte) (BasicAzureWorkloadContainer, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["containerType"] { + case string(ContainerTypeSQLAGWorkLoadContainer1): + var aswcpc AzureSQLAGWorkloadContainerProtectionContainer + err := json.Unmarshal(body, &aswcpc) + return aswcpc, err + case string(ContainerTypeVMAppContainer1): + var avacpc AzureVMAppContainerProtectionContainer + err := json.Unmarshal(body, &avacpc) + return avacpc, err + default: + var awc AzureWorkloadContainer + err := json.Unmarshal(body, &awc) + return awc, err + } +} +func unmarshalBasicAzureWorkloadContainerArray(body []byte) ([]BasicAzureWorkloadContainer, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + awcArray := make([]BasicAzureWorkloadContainer, len(rawMessages)) + + for index, rawMessage := range rawMessages { + awc, err := unmarshalBasicAzureWorkloadContainer(*rawMessage) + if err != nil { + return nil, err + } + awcArray[index] = awc + } + return awcArray, nil +} + +// MarshalJSON is the custom marshaler for AzureWorkloadContainer. +func (awc AzureWorkloadContainer) MarshalJSON() ([]byte, error) { + awc.ContainerType = ContainerTypeAzureWorkloadContainer + objectMap := make(map[string]interface{}) + if awc.SourceResourceID != nil { + objectMap["sourceResourceId"] = awc.SourceResourceID + } + if awc.LastUpdatedTime != nil { + objectMap["lastUpdatedTime"] = awc.LastUpdatedTime + } + if awc.ExtendedInfo != nil { + objectMap["extendedInfo"] = awc.ExtendedInfo + } + if awc.WorkloadType != "" { + objectMap["workloadType"] = awc.WorkloadType + } + if awc.FriendlyName != nil { + objectMap["friendlyName"] = awc.FriendlyName + } + if awc.BackupManagementType != "" { + objectMap["backupManagementType"] = awc.BackupManagementType + } + if awc.RegistrationStatus != nil { + objectMap["registrationStatus"] = awc.RegistrationStatus + } + if awc.HealthStatus != nil { + objectMap["healthStatus"] = awc.HealthStatus + } + if awc.ContainerType != "" { + objectMap["containerType"] = awc.ContainerType + } + return json.Marshal(objectMap) +} + +// AsAzureBackupServerContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. +func (awc AzureWorkloadContainer) AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) { + return nil, false +} + +// AsAzureIaaSClassicComputeVMContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. +func (awc AzureWorkloadContainer) AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) { + return nil, false +} + +// AsAzureIaaSComputeVMContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. +func (awc AzureWorkloadContainer) AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) { + return nil, false +} + +// AsAzureSQLAGWorkloadContainerProtectionContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. +func (awc AzureWorkloadContainer) AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) { + return nil, false +} + +// AsAzureSQLContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. +func (awc AzureWorkloadContainer) AsAzureSQLContainer() (*AzureSQLContainer, bool) { + return nil, false +} + +// AsAzureStorageContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. +func (awc AzureWorkloadContainer) AsAzureStorageContainer() (*AzureStorageContainer, bool) { + return nil, false +} + +// AsAzureVMAppContainerProtectionContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. +func (awc AzureWorkloadContainer) AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) { + return nil, false +} + +// AsAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. +func (awc AzureWorkloadContainer) AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) { + return &awc, true +} + +// AsBasicAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. +func (awc AzureWorkloadContainer) AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) { + return &awc, true +} + +// AsDpmContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. +func (awc AzureWorkloadContainer) AsDpmContainer() (*DpmContainer, bool) { + return nil, false +} + +// AsGenericContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. +func (awc AzureWorkloadContainer) AsGenericContainer() (*GenericContainer, bool) { + return nil, false +} + +// AsIaaSVMContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. +func (awc AzureWorkloadContainer) AsIaaSVMContainer() (*IaaSVMContainer, bool) { + return nil, false +} + +// AsBasicIaaSVMContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. +func (awc AzureWorkloadContainer) AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) { + return nil, false +} + +// AsMabContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. +func (awc AzureWorkloadContainer) AsMabContainer() (*MabContainer, bool) { + return nil, false +} + +// AsProtectionContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. +func (awc AzureWorkloadContainer) AsProtectionContainer() (*ProtectionContainer, bool) { + return nil, false +} + +// AsBasicProtectionContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. +func (awc AzureWorkloadContainer) AsBasicProtectionContainer() (BasicProtectionContainer, bool) { + return &awc, true +} + +// AzureWorkloadContainerExtendedInfo extended information of the container. +type AzureWorkloadContainerExtendedInfo struct { + // HostServerName - Host Os Name in case of Stand Alone and + // Cluster Name in case of distributed container. + HostServerName *string `json:"hostServerName,omitempty"` + // InquiryInfo - Inquiry Status for the container. + InquiryInfo *InquiryInfo `json:"inquiryInfo,omitempty"` + // NodesList - List of the nodes in case of distributed container. + NodesList *[]DistributedNodesInfo `json:"nodesList,omitempty"` +} + +// BasicAzureWorkloadRecoveryPoint workload specific recoverypoint, specifcally encaspulates full/diff recoverypoint +type BasicAzureWorkloadRecoveryPoint interface { + AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) + AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) + AsBasicAzureWorkloadSQLRecoveryPoint() (BasicAzureWorkloadSQLRecoveryPoint, bool) + AsAzureWorkloadRecoveryPoint() (*AzureWorkloadRecoveryPoint, bool) +} + +// AzureWorkloadRecoveryPoint workload specific recoverypoint, specifcally encaspulates full/diff recoverypoint +type AzureWorkloadRecoveryPoint struct { + // RecoveryPointTimeInUTC - UTC time at which recoverypoint was created + RecoveryPointTimeInUTC *date.Time `json:"recoveryPointTimeInUTC,omitempty"` + // Type - Type of restore point. Possible values include: 'RestorePointTypeInvalid', 'RestorePointTypeFull', 'RestorePointTypeLog', 'RestorePointTypeDifferential' + Type RestorePointType `json:"type,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeRecoveryPoint', 'ObjectTypeAzureFileShareRecoveryPoint', 'ObjectTypeAzureWorkloadRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaRecoveryPoint', 'ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSQLRecoveryPoint', 'ObjectTypeGenericRecoveryPoint', 'ObjectTypeIaasVMRecoveryPoint' + ObjectType ObjectTypeBasicRecoveryPoint `json:"objectType,omitempty"` +} + +func unmarshalBasicAzureWorkloadRecoveryPoint(body []byte) (BasicAzureWorkloadRecoveryPoint, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["objectType"] { + case string(ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint): + var awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint + err := json.Unmarshal(body, &awspitrp) + return awspitrp, err + case string(ObjectTypeAzureWorkloadSQLRecoveryPoint): + var awsrp AzureWorkloadSQLRecoveryPoint + err := json.Unmarshal(body, &awsrp) + return awsrp, err + default: + var awrp AzureWorkloadRecoveryPoint + err := json.Unmarshal(body, &awrp) + return awrp, err + } +} +func unmarshalBasicAzureWorkloadRecoveryPointArray(body []byte) ([]BasicAzureWorkloadRecoveryPoint, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + awrpArray := make([]BasicAzureWorkloadRecoveryPoint, len(rawMessages)) + + for index, rawMessage := range rawMessages { + awrp, err := unmarshalBasicAzureWorkloadRecoveryPoint(*rawMessage) + if err != nil { + return nil, err + } + awrpArray[index] = awrp + } + return awrpArray, nil +} + +// MarshalJSON is the custom marshaler for AzureWorkloadRecoveryPoint. +func (awrp AzureWorkloadRecoveryPoint) MarshalJSON() ([]byte, error) { + awrp.ObjectType = ObjectTypeAzureWorkloadRecoveryPoint + objectMap := make(map[string]interface{}) + if awrp.RecoveryPointTimeInUTC != nil { + objectMap["recoveryPointTimeInUTC"] = awrp.RecoveryPointTimeInUTC + } + if awrp.Type != "" { + objectMap["type"] = awrp.Type + } + if awrp.ObjectType != "" { + objectMap["objectType"] = awrp.ObjectType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. +func (awrp AzureWorkloadRecoveryPoint) AsAzureFileShareRecoveryPoint() (*AzureFileShareRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. +func (awrp AzureWorkloadRecoveryPoint) AsAzureWorkloadRecoveryPoint() (*AzureWorkloadRecoveryPoint, bool) { + return &awrp, true +} + +// AsBasicAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. +func (awrp AzureWorkloadRecoveryPoint) AsBasicAzureWorkloadRecoveryPoint() (BasicAzureWorkloadRecoveryPoint, bool) { + return &awrp, true +} + +// AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. +func (awrp AzureWorkloadRecoveryPoint) AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadSAPHanaRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. +func (awrp AzureWorkloadRecoveryPoint) AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSAPHanaRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. +func (awrp AzureWorkloadRecoveryPoint) AsBasicAzureWorkloadSAPHanaRecoveryPoint() (BasicAzureWorkloadSAPHanaRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadSQLPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. +func (awrp AzureWorkloadRecoveryPoint) AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. +func (awrp AzureWorkloadRecoveryPoint) AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. +func (awrp AzureWorkloadRecoveryPoint) AsBasicAzureWorkloadSQLRecoveryPoint() (BasicAzureWorkloadSQLRecoveryPoint, bool) { + return nil, false +} + +// AsGenericRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. +func (awrp AzureWorkloadRecoveryPoint) AsGenericRecoveryPoint() (*GenericRecoveryPoint, bool) { + return nil, false +} + +// AsIaasVMRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. +func (awrp AzureWorkloadRecoveryPoint) AsIaasVMRecoveryPoint() (*IaasVMRecoveryPoint, bool) { + return nil, false +} + +// AsRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. +func (awrp AzureWorkloadRecoveryPoint) AsRecoveryPoint() (*RecoveryPoint, bool) { + return nil, false +} + +// AsBasicRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. +func (awrp AzureWorkloadRecoveryPoint) AsBasicRecoveryPoint() (BasicRecoveryPoint, bool) { + return &awrp, true +} + +// BasicAzureWorkloadRestoreRequest azureWorkload-specific restore. +type BasicAzureWorkloadRestoreRequest interface { + AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) + AsAzureWorkloadSQLRestoreRequest() (*AzureWorkloadSQLRestoreRequest, bool) + AsBasicAzureWorkloadSQLRestoreRequest() (BasicAzureWorkloadSQLRestoreRequest, bool) + AsAzureWorkloadRestoreRequest() (*AzureWorkloadRestoreRequest, bool) +} + +// AzureWorkloadRestoreRequest azureWorkload-specific restore. +type AzureWorkloadRestoreRequest struct { + // RecoveryType - OLR/ALR, RestoreDisks is invalid option. Possible values include: 'RecoveryTypeInvalid', 'RecoveryTypeOriginalLocation', 'RecoveryTypeAlternateLocation', 'RecoveryTypeRestoreDisks' + RecoveryType RecoveryType `json:"recoveryType,omitempty"` + // SourceResourceID - Fully qualified ARM ID of the VM on which workload that was running is being recovered. + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // PropertyBag - Workload specific property bag. + PropertyBag map[string]*string `json:"propertyBag"` + // ObjectType - Possible values include: 'ObjectTypeRestoreRequest', 'ObjectTypeAzureFileShareRestoreRequest', 'ObjectTypeAzureWorkloadRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaRestoreRequest', 'ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSQLRestoreRequest', 'ObjectTypeIaasVMRestoreRequest' + ObjectType ObjectTypeBasicRestoreRequest `json:"objectType,omitempty"` +} + +func unmarshalBasicAzureWorkloadRestoreRequest(body []byte) (BasicAzureWorkloadRestoreRequest, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["objectType"] { + case string(ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest): + var awspitrr AzureWorkloadSQLPointInTimeRestoreRequest + err := json.Unmarshal(body, &awspitrr) + return awspitrr, err + case string(ObjectTypeAzureWorkloadSQLRestoreRequest): + var awsrr AzureWorkloadSQLRestoreRequest + err := json.Unmarshal(body, &awsrr) + return awsrr, err + default: + var awrr AzureWorkloadRestoreRequest + err := json.Unmarshal(body, &awrr) + return awrr, err + } +} +func unmarshalBasicAzureWorkloadRestoreRequestArray(body []byte) ([]BasicAzureWorkloadRestoreRequest, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + awrrArray := make([]BasicAzureWorkloadRestoreRequest, len(rawMessages)) + + for index, rawMessage := range rawMessages { + awrr, err := unmarshalBasicAzureWorkloadRestoreRequest(*rawMessage) + if err != nil { + return nil, err + } + awrrArray[index] = awrr + } + return awrrArray, nil +} + +// MarshalJSON is the custom marshaler for AzureWorkloadRestoreRequest. +func (awrr AzureWorkloadRestoreRequest) MarshalJSON() ([]byte, error) { + awrr.ObjectType = ObjectTypeAzureWorkloadRestoreRequest + objectMap := make(map[string]interface{}) + if awrr.RecoveryType != "" { + objectMap["recoveryType"] = awrr.RecoveryType + } + if awrr.SourceResourceID != nil { + objectMap["sourceResourceId"] = awrr.SourceResourceID + } + if awrr.PropertyBag != nil { + objectMap["propertyBag"] = awrr.PropertyBag + } + if awrr.ObjectType != "" { + objectMap["objectType"] = awrr.ObjectType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. +func (awrr AzureWorkloadRestoreRequest) AsAzureFileShareRestoreRequest() (*AzureFileShareRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. +func (awrr AzureWorkloadRestoreRequest) AsAzureWorkloadRestoreRequest() (*AzureWorkloadRestoreRequest, bool) { + return &awrr, true +} + +// AsBasicAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. +func (awrr AzureWorkloadRestoreRequest) AsBasicAzureWorkloadRestoreRequest() (BasicAzureWorkloadRestoreRequest, bool) { + return &awrr, true +} + +// AsAzureWorkloadSAPHanaPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. +func (awrr AzureWorkloadRestoreRequest) AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. +func (awrr AzureWorkloadRestoreRequest) AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. +func (awrr AzureWorkloadRestoreRequest) AsBasicAzureWorkloadSAPHanaRestoreRequest() (BasicAzureWorkloadSAPHanaRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSQLPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. +func (awrr AzureWorkloadRestoreRequest) AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. +func (awrr AzureWorkloadRestoreRequest) AsAzureWorkloadSQLRestoreRequest() (*AzureWorkloadSQLRestoreRequest, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. +func (awrr AzureWorkloadRestoreRequest) AsBasicAzureWorkloadSQLRestoreRequest() (BasicAzureWorkloadSQLRestoreRequest, bool) { + return nil, false +} + +// AsIaasVMRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. +func (awrr AzureWorkloadRestoreRequest) AsIaasVMRestoreRequest() (*IaasVMRestoreRequest, bool) { + return nil, false +} + +// AsRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. +func (awrr AzureWorkloadRestoreRequest) AsRestoreRequest() (*RestoreRequest, bool) { + return nil, false +} + +// AsBasicRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. +func (awrr AzureWorkloadRestoreRequest) AsBasicRestoreRequest() (BasicRestoreRequest, bool) { + return &awrr, true +} + +// AzureWorkloadSAPHanaPointInTimeRecoveryPoint recovery point specific to PointInTime in SAPHana +type AzureWorkloadSAPHanaPointInTimeRecoveryPoint struct { + // TimeRanges - List of log ranges + TimeRanges *[]PointInTimeRange `json:"timeRanges,omitempty"` + // RecoveryPointTimeInUTC - UTC time at which recoverypoint was created + RecoveryPointTimeInUTC *date.Time `json:"recoveryPointTimeInUTC,omitempty"` + // Type - Type of restore point. Possible values include: 'RestorePointTypeInvalid', 'RestorePointTypeFull', 'RestorePointTypeLog', 'RestorePointTypeDifferential' + Type RestorePointType `json:"type,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeRecoveryPoint', 'ObjectTypeAzureFileShareRecoveryPoint', 'ObjectTypeAzureWorkloadRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaRecoveryPoint', 'ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSQLRecoveryPoint', 'ObjectTypeGenericRecoveryPoint', 'ObjectTypeIaasVMRecoveryPoint' + ObjectType ObjectTypeBasicRecoveryPoint `json:"objectType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. +func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) MarshalJSON() ([]byte, error) { + awshpitrp.ObjectType = ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint + objectMap := make(map[string]interface{}) + if awshpitrp.TimeRanges != nil { + objectMap["timeRanges"] = awshpitrp.TimeRanges + } + if awshpitrp.RecoveryPointTimeInUTC != nil { + objectMap["recoveryPointTimeInUTC"] = awshpitrp.RecoveryPointTimeInUTC + } + if awshpitrp.Type != "" { + objectMap["type"] = awshpitrp.Type + } + if awshpitrp.ObjectType != "" { + objectMap["objectType"] = awshpitrp.ObjectType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. +func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsAzureFileShareRecoveryPoint() (*AzureFileShareRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. +func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsAzureWorkloadRecoveryPoint() (*AzureWorkloadRecoveryPoint, bool) { + return nil, false +} + +// AsBasicAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. +func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsBasicAzureWorkloadRecoveryPoint() (BasicAzureWorkloadRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. +func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) { + return &awshpitrp, true +} + +// AsAzureWorkloadSAPHanaRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. +func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSAPHanaRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. +func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsBasicAzureWorkloadSAPHanaRecoveryPoint() (BasicAzureWorkloadSAPHanaRecoveryPoint, bool) { + return &awshpitrp, true +} + +// AsAzureWorkloadSQLPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. +func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. +func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. +func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsBasicAzureWorkloadSQLRecoveryPoint() (BasicAzureWorkloadSQLRecoveryPoint, bool) { + return nil, false +} + +// AsGenericRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. +func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsGenericRecoveryPoint() (*GenericRecoveryPoint, bool) { + return nil, false +} + +// AsIaasVMRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. +func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsIaasVMRecoveryPoint() (*IaasVMRecoveryPoint, bool) { + return nil, false +} + +// AsRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. +func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsRecoveryPoint() (*RecoveryPoint, bool) { + return nil, false +} + +// AsBasicRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. +func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsBasicRecoveryPoint() (BasicRecoveryPoint, bool) { + return &awshpitrp, true +} + +// AzureWorkloadSAPHanaPointInTimeRestoreRequest azureWorkload SAP Hana -specific restore. Specifically for +// PointInTime/Log restore +type AzureWorkloadSAPHanaPointInTimeRestoreRequest struct { + // PointInTime - PointInTime value + PointInTime *date.Time `json:"pointInTime,omitempty"` + // TargetInfo - Details of target database + TargetInfo *TargetRestoreInfo `json:"targetInfo,omitempty"` + // RecoveryType - OLR/ALR, RestoreDisks is invalid option. Possible values include: 'RecoveryTypeInvalid', 'RecoveryTypeOriginalLocation', 'RecoveryTypeAlternateLocation', 'RecoveryTypeRestoreDisks' + RecoveryType RecoveryType `json:"recoveryType,omitempty"` + // SourceResourceID - Fully qualified ARM ID of the VM on which workload that was running is being recovered. + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // PropertyBag - Workload specific property bag. + PropertyBag map[string]*string `json:"propertyBag"` + // ObjectType - Possible values include: 'ObjectTypeRestoreRequest', 'ObjectTypeAzureFileShareRestoreRequest', 'ObjectTypeAzureWorkloadRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaRestoreRequest', 'ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSQLRestoreRequest', 'ObjectTypeIaasVMRestoreRequest' + ObjectType ObjectTypeBasicRestoreRequest `json:"objectType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureWorkloadSAPHanaPointInTimeRestoreRequest. +func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) MarshalJSON() ([]byte, error) { + awshpitrr.ObjectType = ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest + objectMap := make(map[string]interface{}) + if awshpitrr.PointInTime != nil { + objectMap["pointInTime"] = awshpitrr.PointInTime + } + if awshpitrr.TargetInfo != nil { + objectMap["targetInfo"] = awshpitrr.TargetInfo + } + if awshpitrr.RecoveryType != "" { + objectMap["recoveryType"] = awshpitrr.RecoveryType + } + if awshpitrr.SourceResourceID != nil { + objectMap["sourceResourceId"] = awshpitrr.SourceResourceID + } + if awshpitrr.PropertyBag != nil { + objectMap["propertyBag"] = awshpitrr.PropertyBag + } + if awshpitrr.ObjectType != "" { + objectMap["objectType"] = awshpitrr.ObjectType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. +func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsAzureFileShareRestoreRequest() (*AzureFileShareRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. +func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsAzureWorkloadRestoreRequest() (*AzureWorkloadRestoreRequest, bool) { + return nil, false +} + +// AsBasicAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. +func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsBasicAzureWorkloadRestoreRequest() (BasicAzureWorkloadRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSAPHanaPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. +func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) { + return &awshpitrr, true +} + +// AsAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. +func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. +func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsBasicAzureWorkloadSAPHanaRestoreRequest() (BasicAzureWorkloadSAPHanaRestoreRequest, bool) { + return &awshpitrr, true +} + +// AsAzureWorkloadSQLPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. +func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. +func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsAzureWorkloadSQLRestoreRequest() (*AzureWorkloadSQLRestoreRequest, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. +func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsBasicAzureWorkloadSQLRestoreRequest() (BasicAzureWorkloadSQLRestoreRequest, bool) { + return nil, false +} + +// AsIaasVMRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. +func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsIaasVMRestoreRequest() (*IaasVMRestoreRequest, bool) { + return nil, false +} + +// AsRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. +func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsRestoreRequest() (*RestoreRequest, bool) { + return nil, false +} + +// AsBasicRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. +func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsBasicRestoreRequest() (BasicRestoreRequest, bool) { + return &awshpitrr, true +} + +// BasicAzureWorkloadSAPHanaRecoveryPoint sAPHana specific recoverypoint, specifcally encaspulates full/diff +// recoverypoints +type BasicAzureWorkloadSAPHanaRecoveryPoint interface { + AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) + AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) +} + +// AzureWorkloadSAPHanaRecoveryPoint sAPHana specific recoverypoint, specifcally encaspulates full/diff +// recoverypoints +type AzureWorkloadSAPHanaRecoveryPoint struct { + // RecoveryPointTimeInUTC - UTC time at which recoverypoint was created + RecoveryPointTimeInUTC *date.Time `json:"recoveryPointTimeInUTC,omitempty"` + // Type - Type of restore point. Possible values include: 'RestorePointTypeInvalid', 'RestorePointTypeFull', 'RestorePointTypeLog', 'RestorePointTypeDifferential' + Type RestorePointType `json:"type,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeRecoveryPoint', 'ObjectTypeAzureFileShareRecoveryPoint', 'ObjectTypeAzureWorkloadRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaRecoveryPoint', 'ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSQLRecoveryPoint', 'ObjectTypeGenericRecoveryPoint', 'ObjectTypeIaasVMRecoveryPoint' + ObjectType ObjectTypeBasicRecoveryPoint `json:"objectType,omitempty"` +} + +func unmarshalBasicAzureWorkloadSAPHanaRecoveryPoint(body []byte) (BasicAzureWorkloadSAPHanaRecoveryPoint, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["objectType"] { + case string(ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint): + var awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint + err := json.Unmarshal(body, &awshpitrp) + return awshpitrp, err + default: + var awshrp AzureWorkloadSAPHanaRecoveryPoint + err := json.Unmarshal(body, &awshrp) + return awshrp, err + } +} +func unmarshalBasicAzureWorkloadSAPHanaRecoveryPointArray(body []byte) ([]BasicAzureWorkloadSAPHanaRecoveryPoint, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + awshrpArray := make([]BasicAzureWorkloadSAPHanaRecoveryPoint, len(rawMessages)) + + for index, rawMessage := range rawMessages { + awshrp, err := unmarshalBasicAzureWorkloadSAPHanaRecoveryPoint(*rawMessage) + if err != nil { + return nil, err + } + awshrpArray[index] = awshrp + } + return awshrpArray, nil +} + +// MarshalJSON is the custom marshaler for AzureWorkloadSAPHanaRecoveryPoint. +func (awshrp AzureWorkloadSAPHanaRecoveryPoint) MarshalJSON() ([]byte, error) { + awshrp.ObjectType = ObjectTypeAzureWorkloadSAPHanaRecoveryPoint + objectMap := make(map[string]interface{}) + if awshrp.RecoveryPointTimeInUTC != nil { + objectMap["recoveryPointTimeInUTC"] = awshrp.RecoveryPointTimeInUTC + } + if awshrp.Type != "" { + objectMap["type"] = awshrp.Type + } + if awshrp.ObjectType != "" { + objectMap["objectType"] = awshrp.ObjectType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. +func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsAzureFileShareRecoveryPoint() (*AzureFileShareRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. +func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsAzureWorkloadRecoveryPoint() (*AzureWorkloadRecoveryPoint, bool) { + return nil, false +} + +// AsBasicAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. +func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsBasicAzureWorkloadRecoveryPoint() (BasicAzureWorkloadRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. +func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadSAPHanaRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. +func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) { + return &awshrp, true +} + +// AsBasicAzureWorkloadSAPHanaRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. +func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsBasicAzureWorkloadSAPHanaRecoveryPoint() (BasicAzureWorkloadSAPHanaRecoveryPoint, bool) { + return &awshrp, true +} + +// AsAzureWorkloadSQLPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. +func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. +func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. +func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsBasicAzureWorkloadSQLRecoveryPoint() (BasicAzureWorkloadSQLRecoveryPoint, bool) { + return nil, false +} + +// AsGenericRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. +func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsGenericRecoveryPoint() (*GenericRecoveryPoint, bool) { + return nil, false +} + +// AsIaasVMRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. +func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsIaasVMRecoveryPoint() (*IaasVMRecoveryPoint, bool) { + return nil, false +} + +// AsRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. +func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsRecoveryPoint() (*RecoveryPoint, bool) { + return nil, false +} + +// AsBasicRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. +func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsBasicRecoveryPoint() (BasicRecoveryPoint, bool) { + return &awshrp, true +} + +// BasicAzureWorkloadSAPHanaRestoreRequest azureWorkload SAP Hana-specific restore. +type BasicAzureWorkloadSAPHanaRestoreRequest interface { + AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) + AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) +} + +// AzureWorkloadSAPHanaRestoreRequest azureWorkload SAP Hana-specific restore. +type AzureWorkloadSAPHanaRestoreRequest struct { + // TargetInfo - Details of target database + TargetInfo *TargetRestoreInfo `json:"targetInfo,omitempty"` + // RecoveryType - OLR/ALR, RestoreDisks is invalid option. Possible values include: 'RecoveryTypeInvalid', 'RecoveryTypeOriginalLocation', 'RecoveryTypeAlternateLocation', 'RecoveryTypeRestoreDisks' + RecoveryType RecoveryType `json:"recoveryType,omitempty"` + // SourceResourceID - Fully qualified ARM ID of the VM on which workload that was running is being recovered. + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // PropertyBag - Workload specific property bag. + PropertyBag map[string]*string `json:"propertyBag"` + // ObjectType - Possible values include: 'ObjectTypeRestoreRequest', 'ObjectTypeAzureFileShareRestoreRequest', 'ObjectTypeAzureWorkloadRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaRestoreRequest', 'ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSQLRestoreRequest', 'ObjectTypeIaasVMRestoreRequest' + ObjectType ObjectTypeBasicRestoreRequest `json:"objectType,omitempty"` +} + +func unmarshalBasicAzureWorkloadSAPHanaRestoreRequest(body []byte) (BasicAzureWorkloadSAPHanaRestoreRequest, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["objectType"] { + case string(ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest): + var awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest + err := json.Unmarshal(body, &awshpitrr) + return awshpitrr, err + default: + var awshrr AzureWorkloadSAPHanaRestoreRequest + err := json.Unmarshal(body, &awshrr) + return awshrr, err + } +} +func unmarshalBasicAzureWorkloadSAPHanaRestoreRequestArray(body []byte) ([]BasicAzureWorkloadSAPHanaRestoreRequest, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + awshrrArray := make([]BasicAzureWorkloadSAPHanaRestoreRequest, len(rawMessages)) + + for index, rawMessage := range rawMessages { + awshrr, err := unmarshalBasicAzureWorkloadSAPHanaRestoreRequest(*rawMessage) + if err != nil { + return nil, err + } + awshrrArray[index] = awshrr + } + return awshrrArray, nil +} + +// MarshalJSON is the custom marshaler for AzureWorkloadSAPHanaRestoreRequest. +func (awshrr AzureWorkloadSAPHanaRestoreRequest) MarshalJSON() ([]byte, error) { + awshrr.ObjectType = ObjectTypeAzureWorkloadSAPHanaRestoreRequest + objectMap := make(map[string]interface{}) + if awshrr.TargetInfo != nil { + objectMap["targetInfo"] = awshrr.TargetInfo + } + if awshrr.RecoveryType != "" { + objectMap["recoveryType"] = awshrr.RecoveryType + } + if awshrr.SourceResourceID != nil { + objectMap["sourceResourceId"] = awshrr.SourceResourceID + } + if awshrr.PropertyBag != nil { + objectMap["propertyBag"] = awshrr.PropertyBag + } + if awshrr.ObjectType != "" { + objectMap["objectType"] = awshrr.ObjectType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. +func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsAzureFileShareRestoreRequest() (*AzureFileShareRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. +func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsAzureWorkloadRestoreRequest() (*AzureWorkloadRestoreRequest, bool) { + return nil, false +} + +// AsBasicAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. +func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsBasicAzureWorkloadRestoreRequest() (BasicAzureWorkloadRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSAPHanaPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. +func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. +func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) { + return &awshrr, true +} + +// AsBasicAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. +func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsBasicAzureWorkloadSAPHanaRestoreRequest() (BasicAzureWorkloadSAPHanaRestoreRequest, bool) { + return &awshrr, true +} + +// AsAzureWorkloadSQLPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. +func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. +func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsAzureWorkloadSQLRestoreRequest() (*AzureWorkloadSQLRestoreRequest, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. +func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsBasicAzureWorkloadSQLRestoreRequest() (BasicAzureWorkloadSQLRestoreRequest, bool) { + return nil, false +} + +// AsIaasVMRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. +func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsIaasVMRestoreRequest() (*IaasVMRestoreRequest, bool) { + return nil, false +} + +// AsRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. +func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsRestoreRequest() (*RestoreRequest, bool) { + return nil, false +} + +// AsBasicRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. +func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsBasicRestoreRequest() (BasicRestoreRequest, bool) { + return &awshrr, true +} + +// AzureWorkloadSQLPointInTimeRecoveryPoint recovery point specific to PointInTime +type AzureWorkloadSQLPointInTimeRecoveryPoint struct { + // TimeRanges - List of log ranges + TimeRanges *[]PointInTimeRange `json:"timeRanges,omitempty"` + // ExtendedInfo - Extended Info that provides data directory details. Will be populated in two cases: + // When a specific recovery point is accessed using GetRecoveryPoint + // Or when ListRecoveryPoints is called for Log RP only with ExtendedInfo query filter + ExtendedInfo *AzureWorkloadSQLRecoveryPointExtendedInfo `json:"extendedInfo,omitempty"` + // RecoveryPointTimeInUTC - UTC time at which recoverypoint was created + RecoveryPointTimeInUTC *date.Time `json:"recoveryPointTimeInUTC,omitempty"` + // Type - Type of restore point. Possible values include: 'RestorePointTypeInvalid', 'RestorePointTypeFull', 'RestorePointTypeLog', 'RestorePointTypeDifferential' + Type RestorePointType `json:"type,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeRecoveryPoint', 'ObjectTypeAzureFileShareRecoveryPoint', 'ObjectTypeAzureWorkloadRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaRecoveryPoint', 'ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSQLRecoveryPoint', 'ObjectTypeGenericRecoveryPoint', 'ObjectTypeIaasVMRecoveryPoint' + ObjectType ObjectTypeBasicRecoveryPoint `json:"objectType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureWorkloadSQLPointInTimeRecoveryPoint. +func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) MarshalJSON() ([]byte, error) { + awspitrp.ObjectType = ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint + objectMap := make(map[string]interface{}) + if awspitrp.TimeRanges != nil { + objectMap["timeRanges"] = awspitrp.TimeRanges + } + if awspitrp.ExtendedInfo != nil { + objectMap["extendedInfo"] = awspitrp.ExtendedInfo + } + if awspitrp.RecoveryPointTimeInUTC != nil { + objectMap["recoveryPointTimeInUTC"] = awspitrp.RecoveryPointTimeInUTC + } + if awspitrp.Type != "" { + objectMap["type"] = awspitrp.Type + } + if awspitrp.ObjectType != "" { + objectMap["objectType"] = awspitrp.ObjectType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. +func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsAzureFileShareRecoveryPoint() (*AzureFileShareRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. +func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsAzureWorkloadRecoveryPoint() (*AzureWorkloadRecoveryPoint, bool) { + return nil, false +} + +// AsBasicAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. +func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsBasicAzureWorkloadRecoveryPoint() (BasicAzureWorkloadRecoveryPoint, bool) { + return &awspitrp, true +} + +// AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. +func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadSAPHanaRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. +func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSAPHanaRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. +func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsBasicAzureWorkloadSAPHanaRecoveryPoint() (BasicAzureWorkloadSAPHanaRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadSQLPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. +func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) { + return &awspitrp, true +} + +// AsAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. +func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. +func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsBasicAzureWorkloadSQLRecoveryPoint() (BasicAzureWorkloadSQLRecoveryPoint, bool) { + return &awspitrp, true +} + +// AsGenericRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. +func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsGenericRecoveryPoint() (*GenericRecoveryPoint, bool) { + return nil, false +} + +// AsIaasVMRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. +func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsIaasVMRecoveryPoint() (*IaasVMRecoveryPoint, bool) { + return nil, false +} + +// AsRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. +func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsRecoveryPoint() (*RecoveryPoint, bool) { + return nil, false +} + +// AsBasicRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. +func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsBasicRecoveryPoint() (BasicRecoveryPoint, bool) { + return &awspitrp, true +} + +// AzureWorkloadSQLPointInTimeRestoreRequest azureWorkload SQL -specific restore. Specifically for PointInTime/Log +// restore +type AzureWorkloadSQLPointInTimeRestoreRequest struct { + // PointInTime - PointInTime value + PointInTime *date.Time `json:"pointInTime,omitempty"` + // ShouldUseAlternateTargetLocation - Default option set to true. If this is set to false, alternate data directory must be provided + ShouldUseAlternateTargetLocation *bool `json:"shouldUseAlternateTargetLocation,omitempty"` + // IsNonRecoverable - SQL specific property where user can chose to set no-recovery when restore operation is tried + IsNonRecoverable *bool `json:"isNonRecoverable,omitempty"` + // TargetInfo - Details of target database + TargetInfo *TargetRestoreInfo `json:"targetInfo,omitempty"` + // AlternateDirectoryPaths - Data directory details + AlternateDirectoryPaths *[]SQLDataDirectoryMapping `json:"alternateDirectoryPaths,omitempty"` + // RecoveryType - OLR/ALR, RestoreDisks is invalid option. Possible values include: 'RecoveryTypeInvalid', 'RecoveryTypeOriginalLocation', 'RecoveryTypeAlternateLocation', 'RecoveryTypeRestoreDisks' + RecoveryType RecoveryType `json:"recoveryType,omitempty"` + // SourceResourceID - Fully qualified ARM ID of the VM on which workload that was running is being recovered. + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // PropertyBag - Workload specific property bag. + PropertyBag map[string]*string `json:"propertyBag"` + // ObjectType - Possible values include: 'ObjectTypeRestoreRequest', 'ObjectTypeAzureFileShareRestoreRequest', 'ObjectTypeAzureWorkloadRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaRestoreRequest', 'ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSQLRestoreRequest', 'ObjectTypeIaasVMRestoreRequest' + ObjectType ObjectTypeBasicRestoreRequest `json:"objectType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureWorkloadSQLPointInTimeRestoreRequest. +func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) MarshalJSON() ([]byte, error) { + awspitrr.ObjectType = ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest + objectMap := make(map[string]interface{}) + if awspitrr.PointInTime != nil { + objectMap["pointInTime"] = awspitrr.PointInTime + } + if awspitrr.ShouldUseAlternateTargetLocation != nil { + objectMap["shouldUseAlternateTargetLocation"] = awspitrr.ShouldUseAlternateTargetLocation + } + if awspitrr.IsNonRecoverable != nil { + objectMap["isNonRecoverable"] = awspitrr.IsNonRecoverable + } + if awspitrr.TargetInfo != nil { + objectMap["targetInfo"] = awspitrr.TargetInfo + } + if awspitrr.AlternateDirectoryPaths != nil { + objectMap["alternateDirectoryPaths"] = awspitrr.AlternateDirectoryPaths + } + if awspitrr.RecoveryType != "" { + objectMap["recoveryType"] = awspitrr.RecoveryType + } + if awspitrr.SourceResourceID != nil { + objectMap["sourceResourceId"] = awspitrr.SourceResourceID + } + if awspitrr.PropertyBag != nil { + objectMap["propertyBag"] = awspitrr.PropertyBag + } + if awspitrr.ObjectType != "" { + objectMap["objectType"] = awspitrr.ObjectType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. +func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsAzureFileShareRestoreRequest() (*AzureFileShareRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. +func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsAzureWorkloadRestoreRequest() (*AzureWorkloadRestoreRequest, bool) { + return nil, false +} + +// AsBasicAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. +func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsBasicAzureWorkloadRestoreRequest() (BasicAzureWorkloadRestoreRequest, bool) { + return &awspitrr, true +} + +// AsAzureWorkloadSAPHanaPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. +func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. +func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. +func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsBasicAzureWorkloadSAPHanaRestoreRequest() (BasicAzureWorkloadSAPHanaRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSQLPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. +func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) { + return &awspitrr, true +} + +// AsAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. +func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsAzureWorkloadSQLRestoreRequest() (*AzureWorkloadSQLRestoreRequest, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. +func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsBasicAzureWorkloadSQLRestoreRequest() (BasicAzureWorkloadSQLRestoreRequest, bool) { + return &awspitrr, true +} + +// AsIaasVMRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. +func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsIaasVMRestoreRequest() (*IaasVMRestoreRequest, bool) { + return nil, false +} + +// AsRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. +func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsRestoreRequest() (*RestoreRequest, bool) { + return nil, false +} + +// AsBasicRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. +func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsBasicRestoreRequest() (BasicRestoreRequest, bool) { + return &awspitrr, true +} + +// BasicAzureWorkloadSQLRecoveryPoint SQL specific recoverypoint, specifcally encaspulates full/diff recoverypoint +// alongwith extended info +type BasicAzureWorkloadSQLRecoveryPoint interface { + AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) + AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) +} + +// AzureWorkloadSQLRecoveryPoint SQL specific recoverypoint, specifcally encaspulates full/diff recoverypoint +// alongwith extended info +type AzureWorkloadSQLRecoveryPoint struct { + // ExtendedInfo - Extended Info that provides data directory details. Will be populated in two cases: + // When a specific recovery point is accessed using GetRecoveryPoint + // Or when ListRecoveryPoints is called for Log RP only with ExtendedInfo query filter + ExtendedInfo *AzureWorkloadSQLRecoveryPointExtendedInfo `json:"extendedInfo,omitempty"` + // RecoveryPointTimeInUTC - UTC time at which recoverypoint was created + RecoveryPointTimeInUTC *date.Time `json:"recoveryPointTimeInUTC,omitempty"` + // Type - Type of restore point. Possible values include: 'RestorePointTypeInvalid', 'RestorePointTypeFull', 'RestorePointTypeLog', 'RestorePointTypeDifferential' + Type RestorePointType `json:"type,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeRecoveryPoint', 'ObjectTypeAzureFileShareRecoveryPoint', 'ObjectTypeAzureWorkloadRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaRecoveryPoint', 'ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSQLRecoveryPoint', 'ObjectTypeGenericRecoveryPoint', 'ObjectTypeIaasVMRecoveryPoint' + ObjectType ObjectTypeBasicRecoveryPoint `json:"objectType,omitempty"` +} + +func unmarshalBasicAzureWorkloadSQLRecoveryPoint(body []byte) (BasicAzureWorkloadSQLRecoveryPoint, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["objectType"] { + case string(ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint): + var awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint + err := json.Unmarshal(body, &awspitrp) + return awspitrp, err + default: + var awsrp AzureWorkloadSQLRecoveryPoint + err := json.Unmarshal(body, &awsrp) + return awsrp, err + } +} +func unmarshalBasicAzureWorkloadSQLRecoveryPointArray(body []byte) ([]BasicAzureWorkloadSQLRecoveryPoint, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + awsrpArray := make([]BasicAzureWorkloadSQLRecoveryPoint, len(rawMessages)) + + for index, rawMessage := range rawMessages { + awsrp, err := unmarshalBasicAzureWorkloadSQLRecoveryPoint(*rawMessage) + if err != nil { + return nil, err + } + awsrpArray[index] = awsrp + } + return awsrpArray, nil +} + +// MarshalJSON is the custom marshaler for AzureWorkloadSQLRecoveryPoint. +func (awsrp AzureWorkloadSQLRecoveryPoint) MarshalJSON() ([]byte, error) { + awsrp.ObjectType = ObjectTypeAzureWorkloadSQLRecoveryPoint + objectMap := make(map[string]interface{}) + if awsrp.ExtendedInfo != nil { + objectMap["extendedInfo"] = awsrp.ExtendedInfo + } + if awsrp.RecoveryPointTimeInUTC != nil { + objectMap["recoveryPointTimeInUTC"] = awsrp.RecoveryPointTimeInUTC + } + if awsrp.Type != "" { + objectMap["type"] = awsrp.Type + } + if awsrp.ObjectType != "" { + objectMap["objectType"] = awsrp.ObjectType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. +func (awsrp AzureWorkloadSQLRecoveryPoint) AsAzureFileShareRecoveryPoint() (*AzureFileShareRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. +func (awsrp AzureWorkloadSQLRecoveryPoint) AsAzureWorkloadRecoveryPoint() (*AzureWorkloadRecoveryPoint, bool) { + return nil, false +} + +// AsBasicAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. +func (awsrp AzureWorkloadSQLRecoveryPoint) AsBasicAzureWorkloadRecoveryPoint() (BasicAzureWorkloadRecoveryPoint, bool) { + return &awsrp, true +} + +// AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. +func (awsrp AzureWorkloadSQLRecoveryPoint) AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadSAPHanaRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. +func (awsrp AzureWorkloadSQLRecoveryPoint) AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSAPHanaRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. +func (awsrp AzureWorkloadSQLRecoveryPoint) AsBasicAzureWorkloadSAPHanaRecoveryPoint() (BasicAzureWorkloadSAPHanaRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadSQLPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. +func (awsrp AzureWorkloadSQLRecoveryPoint) AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. +func (awsrp AzureWorkloadSQLRecoveryPoint) AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) { + return &awsrp, true +} + +// AsBasicAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. +func (awsrp AzureWorkloadSQLRecoveryPoint) AsBasicAzureWorkloadSQLRecoveryPoint() (BasicAzureWorkloadSQLRecoveryPoint, bool) { + return &awsrp, true +} + +// AsGenericRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. +func (awsrp AzureWorkloadSQLRecoveryPoint) AsGenericRecoveryPoint() (*GenericRecoveryPoint, bool) { + return nil, false +} + +// AsIaasVMRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. +func (awsrp AzureWorkloadSQLRecoveryPoint) AsIaasVMRecoveryPoint() (*IaasVMRecoveryPoint, bool) { + return nil, false +} + +// AsRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. +func (awsrp AzureWorkloadSQLRecoveryPoint) AsRecoveryPoint() (*RecoveryPoint, bool) { + return nil, false +} + +// AsBasicRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. +func (awsrp AzureWorkloadSQLRecoveryPoint) AsBasicRecoveryPoint() (BasicRecoveryPoint, bool) { + return &awsrp, true +} + +// AzureWorkloadSQLRecoveryPointExtendedInfo extended info class details +type AzureWorkloadSQLRecoveryPointExtendedInfo struct { + // DataDirectoryTimeInUTC - UTC time at which data directory info was captured + DataDirectoryTimeInUTC *date.Time `json:"dataDirectoryTimeInUTC,omitempty"` + // DataDirectoryPaths - List of data directory paths during restore operation. + DataDirectoryPaths *[]SQLDataDirectory `json:"dataDirectoryPaths,omitempty"` +} + +// BasicAzureWorkloadSQLRestoreRequest azureWorkload SQL -specific restore. Specifically for full/diff restore +type BasicAzureWorkloadSQLRestoreRequest interface { + AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) + AsAzureWorkloadSQLRestoreRequest() (*AzureWorkloadSQLRestoreRequest, bool) +} + +// AzureWorkloadSQLRestoreRequest azureWorkload SQL -specific restore. Specifically for full/diff restore +type AzureWorkloadSQLRestoreRequest struct { + // ShouldUseAlternateTargetLocation - Default option set to true. If this is set to false, alternate data directory must be provided + ShouldUseAlternateTargetLocation *bool `json:"shouldUseAlternateTargetLocation,omitempty"` + // IsNonRecoverable - SQL specific property where user can chose to set no-recovery when restore operation is tried + IsNonRecoverable *bool `json:"isNonRecoverable,omitempty"` + // TargetInfo - Details of target database + TargetInfo *TargetRestoreInfo `json:"targetInfo,omitempty"` + // AlternateDirectoryPaths - Data directory details + AlternateDirectoryPaths *[]SQLDataDirectoryMapping `json:"alternateDirectoryPaths,omitempty"` + // RecoveryType - OLR/ALR, RestoreDisks is invalid option. Possible values include: 'RecoveryTypeInvalid', 'RecoveryTypeOriginalLocation', 'RecoveryTypeAlternateLocation', 'RecoveryTypeRestoreDisks' + RecoveryType RecoveryType `json:"recoveryType,omitempty"` + // SourceResourceID - Fully qualified ARM ID of the VM on which workload that was running is being recovered. + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // PropertyBag - Workload specific property bag. + PropertyBag map[string]*string `json:"propertyBag"` + // ObjectType - Possible values include: 'ObjectTypeRestoreRequest', 'ObjectTypeAzureFileShareRestoreRequest', 'ObjectTypeAzureWorkloadRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaRestoreRequest', 'ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSQLRestoreRequest', 'ObjectTypeIaasVMRestoreRequest' + ObjectType ObjectTypeBasicRestoreRequest `json:"objectType,omitempty"` +} + +func unmarshalBasicAzureWorkloadSQLRestoreRequest(body []byte) (BasicAzureWorkloadSQLRestoreRequest, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["objectType"] { + case string(ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest): + var awspitrr AzureWorkloadSQLPointInTimeRestoreRequest + err := json.Unmarshal(body, &awspitrr) + return awspitrr, err + default: + var awsrr AzureWorkloadSQLRestoreRequest + err := json.Unmarshal(body, &awsrr) + return awsrr, err + } +} +func unmarshalBasicAzureWorkloadSQLRestoreRequestArray(body []byte) ([]BasicAzureWorkloadSQLRestoreRequest, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + awsrrArray := make([]BasicAzureWorkloadSQLRestoreRequest, len(rawMessages)) + + for index, rawMessage := range rawMessages { + awsrr, err := unmarshalBasicAzureWorkloadSQLRestoreRequest(*rawMessage) + if err != nil { + return nil, err + } + awsrrArray[index] = awsrr + } + return awsrrArray, nil +} + +// MarshalJSON is the custom marshaler for AzureWorkloadSQLRestoreRequest. +func (awsrr AzureWorkloadSQLRestoreRequest) MarshalJSON() ([]byte, error) { + awsrr.ObjectType = ObjectTypeAzureWorkloadSQLRestoreRequest + objectMap := make(map[string]interface{}) + if awsrr.ShouldUseAlternateTargetLocation != nil { + objectMap["shouldUseAlternateTargetLocation"] = awsrr.ShouldUseAlternateTargetLocation + } + if awsrr.IsNonRecoverable != nil { + objectMap["isNonRecoverable"] = awsrr.IsNonRecoverable + } + if awsrr.TargetInfo != nil { + objectMap["targetInfo"] = awsrr.TargetInfo + } + if awsrr.AlternateDirectoryPaths != nil { + objectMap["alternateDirectoryPaths"] = awsrr.AlternateDirectoryPaths + } + if awsrr.RecoveryType != "" { + objectMap["recoveryType"] = awsrr.RecoveryType + } + if awsrr.SourceResourceID != nil { + objectMap["sourceResourceId"] = awsrr.SourceResourceID + } + if awsrr.PropertyBag != nil { + objectMap["propertyBag"] = awsrr.PropertyBag + } + if awsrr.ObjectType != "" { + objectMap["objectType"] = awsrr.ObjectType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. +func (awsrr AzureWorkloadSQLRestoreRequest) AsAzureFileShareRestoreRequest() (*AzureFileShareRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. +func (awsrr AzureWorkloadSQLRestoreRequest) AsAzureWorkloadRestoreRequest() (*AzureWorkloadRestoreRequest, bool) { + return nil, false +} + +// AsBasicAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. +func (awsrr AzureWorkloadSQLRestoreRequest) AsBasicAzureWorkloadRestoreRequest() (BasicAzureWorkloadRestoreRequest, bool) { + return &awsrr, true +} + +// AsAzureWorkloadSAPHanaPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. +func (awsrr AzureWorkloadSQLRestoreRequest) AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. +func (awsrr AzureWorkloadSQLRestoreRequest) AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. +func (awsrr AzureWorkloadSQLRestoreRequest) AsBasicAzureWorkloadSAPHanaRestoreRequest() (BasicAzureWorkloadSAPHanaRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSQLPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. +func (awsrr AzureWorkloadSQLRestoreRequest) AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. +func (awsrr AzureWorkloadSQLRestoreRequest) AsAzureWorkloadSQLRestoreRequest() (*AzureWorkloadSQLRestoreRequest, bool) { + return &awsrr, true +} + +// AsBasicAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. +func (awsrr AzureWorkloadSQLRestoreRequest) AsBasicAzureWorkloadSQLRestoreRequest() (BasicAzureWorkloadSQLRestoreRequest, bool) { + return &awsrr, true +} + +// AsIaasVMRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. +func (awsrr AzureWorkloadSQLRestoreRequest) AsIaasVMRestoreRequest() (*IaasVMRestoreRequest, bool) { + return nil, false +} + +// AsRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. +func (awsrr AzureWorkloadSQLRestoreRequest) AsRestoreRequest() (*RestoreRequest, bool) { + return nil, false +} + +// AsBasicRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. +func (awsrr AzureWorkloadSQLRestoreRequest) AsBasicRestoreRequest() (BasicRestoreRequest, bool) { + return &awsrr, true +} + +// BEKDetails BEK is bitlocker encrpytion key. +type BEKDetails struct { + // SecretURL - Secret is BEK. + SecretURL *string `json:"secretUrl,omitempty"` + // SecretVaultID - ID of the Key Vault where this Secret is stored. + SecretVaultID *string `json:"secretVaultId,omitempty"` + // SecretData - BEK data. + SecretData *string `json:"secretData,omitempty"` +} + +// BMSBackupEngineQueryObject query parameters to fetch list of backup engines. +type BMSBackupEngineQueryObject struct { + // Expand - attribute to add extended info + Expand *string `json:"expand,omitempty"` +} + +// BMSBackupEnginesQueryObject query parameters to fetch list of backup engines. +type BMSBackupEnginesQueryObject struct { + // BackupManagementType - Backup management type for the backup engine. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // FriendlyName - Friendly name of the backup engine. + FriendlyName *string `json:"friendlyName,omitempty"` + // Expand - Attribute to add extended info. + Expand *string `json:"expand,omitempty"` +} + +// BMSContainerQueryObject the query filters that can be used with the list containers API. +type BMSContainerQueryObject struct { + // BackupManagementType - Backup management type for this container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // ContainerType - Type of container for filter. Possible values include: 'ContainerTypeInvalid', 'ContainerTypeUnknown', 'ContainerTypeIaasVMContainer', 'ContainerTypeIaasVMServiceContainer', 'ContainerTypeDPMContainer', 'ContainerTypeAzureBackupServerContainer', 'ContainerTypeMABContainer', 'ContainerTypeCluster', 'ContainerTypeAzureSQLContainer', 'ContainerTypeWindows', 'ContainerTypeVCenter', 'ContainerTypeVMAppContainer', 'ContainerTypeSQLAGWorkLoadContainer', 'ContainerTypeStorageContainer', 'ContainerTypeGenericContainer', 'ContainerTypeSQLCluster', 'ContainerTypeExchangeDAG', 'ContainerTypeSharepointFarm', 'ContainerTypeHyperVCluster', 'ContainerTypeWindowsClient' + ContainerType ContainerType `json:"containerType,omitempty"` + // BackupEngineName - Backup engine name + BackupEngineName *string `json:"backupEngineName,omitempty"` + // FabricName - Fabric name for filter + FabricName *string `json:"fabricName,omitempty"` + // Status - Status of registration of this container with the Recovery Services Vault. + Status *string `json:"status,omitempty"` + // FriendlyName - Friendly name of this container. + FriendlyName *string `json:"friendlyName,omitempty"` +} + +// BMSContainersInquiryQueryObject the query filters that can be used with the inquire container API. +type BMSContainersInquiryQueryObject struct { + // BackupManagementType - Backup management type for this container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // WorkloadType - Workload type for this container. Possible values include: 'WorkloadTypeInvalid', 'WorkloadTypeVM', 'WorkloadTypeFileFolder', 'WorkloadTypeAzureSQLDb', 'WorkloadTypeSQLDB', 'WorkloadTypeExchange', 'WorkloadTypeSharepoint', 'WorkloadTypeVMwareVM', 'WorkloadTypeSystemState', 'WorkloadTypeClient', 'WorkloadTypeGenericDataSource', 'WorkloadTypeSQLDataBase', 'WorkloadTypeAzureFileShare', 'WorkloadTypeSAPHanaDatabase' + WorkloadType WorkloadType `json:"workloadType,omitempty"` +} + +// BMSPOQueryObject filters to list items that can be backed up. +type BMSPOQueryObject struct { + // BackupManagementType - Backup management type. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // WorkloadType - Workload type. Possible values include: 'WorkloadTypeInvalid', 'WorkloadTypeVM', 'WorkloadTypeFileFolder', 'WorkloadTypeAzureSQLDb', 'WorkloadTypeSQLDB', 'WorkloadTypeExchange', 'WorkloadTypeSharepoint', 'WorkloadTypeVMwareVM', 'WorkloadTypeSystemState', 'WorkloadTypeClient', 'WorkloadTypeGenericDataSource', 'WorkloadTypeSQLDataBase', 'WorkloadTypeAzureFileShare', 'WorkloadTypeSAPHanaDatabase' + WorkloadType WorkloadType `json:"workloadType,omitempty"` + // ContainerName - Full name of the container whose Protectable Objects should be returned. + ContainerName *string `json:"containerName,omitempty"` + // Status - Backup status query parameter. + Status *string `json:"status,omitempty"` + // FriendlyName - Friendly name. + FriendlyName *string `json:"friendlyName,omitempty"` +} + +// BMSRefreshContainersQueryObject the query filters that can be used with the refresh container API. +type BMSRefreshContainersQueryObject struct { + // BackupManagementType - Backup management type for this container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` +} + +// BMSRPQueryObject filters to list backup copies. +type BMSRPQueryObject struct { + // StartDate - Backup copies created after this time. + StartDate *date.Time `json:"startDate,omitempty"` + // EndDate - Backup copies created before this time. + EndDate *date.Time `json:"endDate,omitempty"` + // RestorePointQueryType - RestorePoint type. Possible values include: 'RestorePointQueryTypeInvalid', 'RestorePointQueryTypeFull', 'RestorePointQueryTypeLog', 'RestorePointQueryTypeDifferential', 'RestorePointQueryTypeFullAndDifferential', 'RestorePointQueryTypeAll' + RestorePointQueryType RestorePointQueryType `json:"restorePointQueryType,omitempty"` + // ExtendedInfo - In Get Recovery Point, it tells whether extended information about recovery point is asked. + ExtendedInfo *bool `json:"extendedInfo,omitempty"` +} + +// BMSWorkloadItemQueryObject filters to list items that can be backed up. +type BMSWorkloadItemQueryObject struct { + // BackupManagementType - Backup management type. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // WorkloadItemType - Workload Item type. Possible values include: 'WorkloadItemTypeInvalid', 'WorkloadItemTypeSQLInstance', 'WorkloadItemTypeSQLDataBase', 'WorkloadItemTypeSAPHanaSystem', 'WorkloadItemTypeSAPHanaDatabase' + WorkloadItemType WorkloadItemType `json:"workloadItemType,omitempty"` + // WorkloadType - Workload type. Possible values include: 'WorkloadTypeInvalid', 'WorkloadTypeVM', 'WorkloadTypeFileFolder', 'WorkloadTypeAzureSQLDb', 'WorkloadTypeSQLDB', 'WorkloadTypeExchange', 'WorkloadTypeSharepoint', 'WorkloadTypeVMwareVM', 'WorkloadTypeSystemState', 'WorkloadTypeClient', 'WorkloadTypeGenericDataSource', 'WorkloadTypeSQLDataBase', 'WorkloadTypeAzureFileShare', 'WorkloadTypeSAPHanaDatabase' + WorkloadType WorkloadType `json:"workloadType,omitempty"` + // ProtectionStatus - Backup status query parameter. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' + ProtectionStatus ProtectionStatus `json:"protectionStatus,omitempty"` +} + +// ClientScriptForConnect client script details for file / folder restore. +type ClientScriptForConnect struct { + // ScriptContent - File content of the client script for file / folder restore. + ScriptContent *string `json:"scriptContent,omitempty"` + // ScriptExtension - File extension of the client script for file / folder restore - .ps1 , .sh , etc. + ScriptExtension *string `json:"scriptExtension,omitempty"` + // OsType - OS type - Windows, Linux etc. for which this file / folder restore client script works. + OsType *string `json:"osType,omitempty"` + // URL - URL of Executable from where to source the content. If this is not null then ScriptContent should not be used + URL *string `json:"url,omitempty"` + // ScriptNameSuffix - Mandator suffix that should be added to the name of script that is given for download to user. + // If its null or empty then , ignore it. + ScriptNameSuffix *string `json:"scriptNameSuffix,omitempty"` +} + +// ContainerIdentityInfo container identity information +type ContainerIdentityInfo struct { + // UniqueName - Unique name of the container + UniqueName *string `json:"uniqueName,omitempty"` + // AadTenantID - Protection container identity - AAD Tenant + AadTenantID *string `json:"aadTenantId,omitempty"` + // ServicePrincipalClientID - Protection container identity - AAD Service Principal + ServicePrincipalClientID *string `json:"servicePrincipalClientId,omitempty"` + // Audience - Protection container identity - Audience + Audience *string `json:"audience,omitempty"` +} + +// DailyRetentionFormat daily retention format. +type DailyRetentionFormat struct { + // DaysOfTheMonth - List of days of the month. + DaysOfTheMonth *[]Day `json:"daysOfTheMonth,omitempty"` +} + +// DailyRetentionSchedule daily retention schedule. +type DailyRetentionSchedule struct { + // RetentionTimes - Retention times of retention policy. + RetentionTimes *[]date.Time `json:"retentionTimes,omitempty"` + // RetentionDuration - Retention duration of retention Policy. + RetentionDuration *RetentionDuration `json:"retentionDuration,omitempty"` +} + +// Day day of the week. +type Day struct { + // Date - Date of the month + Date *int32 `json:"date,omitempty"` + // IsLast - Whether Date is last date of month + IsLast *bool `json:"isLast,omitempty"` +} + +// DistributedNodesInfo this is used to represent the various nodes of the distributed container. +type DistributedNodesInfo struct { + // NodeName - Name of the node under a distributed container. + NodeName *string `json:"nodeName,omitempty"` + // Status - Status of this Node. + // Failed | Succeeded + Status *string `json:"status,omitempty"` + // ErrorDetail - Error Details if the Status is non-success. + ErrorDetail *ErrorDetail `json:"errorDetail,omitempty"` +} + +// DpmBackupEngine data Protection Manager (DPM) specific backup engine. +type DpmBackupEngine struct { + // FriendlyName - Friendly name of the backup engine. + FriendlyName *string `json:"friendlyName,omitempty"` + // BackupManagementType - Type of backup management for the backup engine. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // RegistrationStatus - Registration status of the backup engine with the Recovery Services Vault. + RegistrationStatus *string `json:"registrationStatus,omitempty"` + // BackupEngineState - Status of the backup engine with the Recovery Services Vault. = {Active/Deleting/DeleteFailed} + BackupEngineState *string `json:"backupEngineState,omitempty"` + // HealthStatus - Backup status of the backup engine. + HealthStatus *string `json:"healthStatus,omitempty"` + // CanReRegister - Flag indicating if the backup engine be registered, once already registered. + CanReRegister *bool `json:"canReRegister,omitempty"` + // BackupEngineID - ID of the backup engine. + BackupEngineID *string `json:"backupEngineId,omitempty"` + // DpmVersion - Backup engine version + DpmVersion *string `json:"dpmVersion,omitempty"` + // AzureBackupAgentVersion - Backup agent version + AzureBackupAgentVersion *string `json:"azureBackupAgentVersion,omitempty"` + // IsAzureBackupAgentUpgradeAvailable - To check if backup agent upgrade available + IsAzureBackupAgentUpgradeAvailable *bool `json:"isAzureBackupAgentUpgradeAvailable,omitempty"` + // IsDpmUpgradeAvailable - To check if backup engine upgrade available + IsDpmUpgradeAvailable *bool `json:"isDpmUpgradeAvailable,omitempty"` + // ExtendedInfo - Extended info of the backupengine + ExtendedInfo *EngineExtendedInfo `json:"extendedInfo,omitempty"` + // BackupEngineType - Possible values include: 'BackupEngineTypeBackupEngineBase', 'BackupEngineTypeAzureBackupServerEngine', 'BackupEngineTypeDpmBackupEngine' + BackupEngineType EngineType `json:"backupEngineType,omitempty"` +} + +// MarshalJSON is the custom marshaler for DpmBackupEngine. +func (dbe DpmBackupEngine) MarshalJSON() ([]byte, error) { + dbe.BackupEngineType = BackupEngineTypeDpmBackupEngine + objectMap := make(map[string]interface{}) + if dbe.FriendlyName != nil { + objectMap["friendlyName"] = dbe.FriendlyName + } + if dbe.BackupManagementType != "" { + objectMap["backupManagementType"] = dbe.BackupManagementType + } + if dbe.RegistrationStatus != nil { + objectMap["registrationStatus"] = dbe.RegistrationStatus + } + if dbe.BackupEngineState != nil { + objectMap["backupEngineState"] = dbe.BackupEngineState + } + if dbe.HealthStatus != nil { + objectMap["healthStatus"] = dbe.HealthStatus + } + if dbe.CanReRegister != nil { + objectMap["canReRegister"] = dbe.CanReRegister + } + if dbe.BackupEngineID != nil { + objectMap["backupEngineId"] = dbe.BackupEngineID + } + if dbe.DpmVersion != nil { + objectMap["dpmVersion"] = dbe.DpmVersion + } + if dbe.AzureBackupAgentVersion != nil { + objectMap["azureBackupAgentVersion"] = dbe.AzureBackupAgentVersion + } + if dbe.IsAzureBackupAgentUpgradeAvailable != nil { + objectMap["isAzureBackupAgentUpgradeAvailable"] = dbe.IsAzureBackupAgentUpgradeAvailable + } + if dbe.IsDpmUpgradeAvailable != nil { + objectMap["isDpmUpgradeAvailable"] = dbe.IsDpmUpgradeAvailable + } + if dbe.ExtendedInfo != nil { + objectMap["extendedInfo"] = dbe.ExtendedInfo + } + if dbe.BackupEngineType != "" { + objectMap["backupEngineType"] = dbe.BackupEngineType + } + return json.Marshal(objectMap) +} + +// AsAzureBackupServerEngine is the BasicEngineBase implementation for DpmBackupEngine. +func (dbe DpmBackupEngine) AsAzureBackupServerEngine() (*AzureBackupServerEngine, bool) { + return nil, false +} + +// AsDpmBackupEngine is the BasicEngineBase implementation for DpmBackupEngine. +func (dbe DpmBackupEngine) AsDpmBackupEngine() (*DpmBackupEngine, bool) { + return &dbe, true +} + +// AsEngineBase is the BasicEngineBase implementation for DpmBackupEngine. +func (dbe DpmBackupEngine) AsEngineBase() (*EngineBase, bool) { + return nil, false +} + +// AsBasicEngineBase is the BasicEngineBase implementation for DpmBackupEngine. +func (dbe DpmBackupEngine) AsBasicEngineBase() (BasicEngineBase, bool) { + return &dbe, true +} + +// DpmContainer DPM workload-specific protection container. +type DpmContainer struct { + // CanReRegister - Specifies whether the container is re-registrable. + CanReRegister *bool `json:"canReRegister,omitempty"` + // ContainerID - ID of container. + ContainerID *string `json:"containerId,omitempty"` + // ProtectedItemCount - Number of protected items in the BackupEngine + ProtectedItemCount *int64 `json:"protectedItemCount,omitempty"` + // DpmAgentVersion - Backup engine Agent version + DpmAgentVersion *string `json:"dpmAgentVersion,omitempty"` + // DpmServers - List of BackupEngines protecting the container + DpmServers *[]string `json:"dpmServers,omitempty"` + // UpgradeAvailable - To check if upgrade available + UpgradeAvailable *bool `json:"upgradeAvailable,omitempty"` + // ProtectionStatus - Protection status of the container. + ProtectionStatus *string `json:"protectionStatus,omitempty"` + // ExtendedInfo - Extended Info of the container. + ExtendedInfo *DPMContainerExtendedInfo `json:"extendedInfo,omitempty"` + // FriendlyName - Friendly name of the container. + FriendlyName *string `json:"friendlyName,omitempty"` + // BackupManagementType - Type of backup managemenent for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // RegistrationStatus - Status of registration of the container with the Recovery Services Vault. + RegistrationStatus *string `json:"registrationStatus,omitempty"` + // HealthStatus - Status of health of the container. + HealthStatus *string `json:"healthStatus,omitempty"` + // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaaSVMContainer', 'ContainerTypeWindows1' + ContainerType ContainerTypeBasicProtectionContainer `json:"containerType,omitempty"` +} + +// MarshalJSON is the custom marshaler for DpmContainer. +func (dc DpmContainer) MarshalJSON() ([]byte, error) { + dc.ContainerType = ContainerTypeDPMContainer1 + objectMap := make(map[string]interface{}) + if dc.CanReRegister != nil { + objectMap["canReRegister"] = dc.CanReRegister + } + if dc.ContainerID != nil { + objectMap["containerId"] = dc.ContainerID + } + if dc.ProtectedItemCount != nil { + objectMap["protectedItemCount"] = dc.ProtectedItemCount + } + if dc.DpmAgentVersion != nil { + objectMap["dpmAgentVersion"] = dc.DpmAgentVersion + } + if dc.DpmServers != nil { + objectMap["dpmServers"] = dc.DpmServers + } + if dc.UpgradeAvailable != nil { + objectMap["upgradeAvailable"] = dc.UpgradeAvailable + } + if dc.ProtectionStatus != nil { + objectMap["protectionStatus"] = dc.ProtectionStatus + } + if dc.ExtendedInfo != nil { + objectMap["extendedInfo"] = dc.ExtendedInfo + } + if dc.FriendlyName != nil { + objectMap["friendlyName"] = dc.FriendlyName + } + if dc.BackupManagementType != "" { + objectMap["backupManagementType"] = dc.BackupManagementType + } + if dc.RegistrationStatus != nil { + objectMap["registrationStatus"] = dc.RegistrationStatus + } + if dc.HealthStatus != nil { + objectMap["healthStatus"] = dc.HealthStatus + } + if dc.ContainerType != "" { + objectMap["containerType"] = dc.ContainerType + } + return json.Marshal(objectMap) +} + +// AsAzureBackupServerContainer is the BasicProtectionContainer implementation for DpmContainer. +func (dc DpmContainer) AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) { + return nil, false +} + +// AsAzureIaaSClassicComputeVMContainer is the BasicProtectionContainer implementation for DpmContainer. +func (dc DpmContainer) AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) { + return nil, false +} + +// AsAzureIaaSComputeVMContainer is the BasicProtectionContainer implementation for DpmContainer. +func (dc DpmContainer) AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) { + return nil, false +} + +// AsAzureSQLAGWorkloadContainerProtectionContainer is the BasicProtectionContainer implementation for DpmContainer. +func (dc DpmContainer) AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) { + return nil, false +} + +// AsAzureSQLContainer is the BasicProtectionContainer implementation for DpmContainer. +func (dc DpmContainer) AsAzureSQLContainer() (*AzureSQLContainer, bool) { + return nil, false +} + +// AsAzureStorageContainer is the BasicProtectionContainer implementation for DpmContainer. +func (dc DpmContainer) AsAzureStorageContainer() (*AzureStorageContainer, bool) { + return nil, false +} + +// AsAzureVMAppContainerProtectionContainer is the BasicProtectionContainer implementation for DpmContainer. +func (dc DpmContainer) AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) { + return nil, false +} + +// AsAzureWorkloadContainer is the BasicProtectionContainer implementation for DpmContainer. +func (dc DpmContainer) AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) { + return nil, false +} + +// AsBasicAzureWorkloadContainer is the BasicProtectionContainer implementation for DpmContainer. +func (dc DpmContainer) AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) { + return nil, false +} + +// AsDpmContainer is the BasicProtectionContainer implementation for DpmContainer. +func (dc DpmContainer) AsDpmContainer() (*DpmContainer, bool) { + return &dc, true +} + +// AsGenericContainer is the BasicProtectionContainer implementation for DpmContainer. +func (dc DpmContainer) AsGenericContainer() (*GenericContainer, bool) { + return nil, false +} + +// AsIaaSVMContainer is the BasicProtectionContainer implementation for DpmContainer. +func (dc DpmContainer) AsIaaSVMContainer() (*IaaSVMContainer, bool) { + return nil, false +} + +// AsBasicIaaSVMContainer is the BasicProtectionContainer implementation for DpmContainer. +func (dc DpmContainer) AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) { + return nil, false +} + +// AsMabContainer is the BasicProtectionContainer implementation for DpmContainer. +func (dc DpmContainer) AsMabContainer() (*MabContainer, bool) { + return nil, false +} + +// AsProtectionContainer is the BasicProtectionContainer implementation for DpmContainer. +func (dc DpmContainer) AsProtectionContainer() (*ProtectionContainer, bool) { + return nil, false +} + +// AsBasicProtectionContainer is the BasicProtectionContainer implementation for DpmContainer. +func (dc DpmContainer) AsBasicProtectionContainer() (BasicProtectionContainer, bool) { + return &dc, true +} + +// DPMContainerExtendedInfo additional information of the DPMContainer. +type DPMContainerExtendedInfo struct { + // LastRefreshedAt - Last refresh time of the DPMContainer. + LastRefreshedAt *date.Time `json:"lastRefreshedAt,omitempty"` +} + +// DPMProtectedItem additional information on Backup engine specific backup item. +type DPMProtectedItem struct { + // FriendlyName - Friendly name of the managed item + FriendlyName *string `json:"friendlyName,omitempty"` + // BackupEngineName - Backup Management server protecting this backup item + BackupEngineName *string `json:"backupEngineName,omitempty"` + // ProtectionState - Protection state of the backupengine. Possible values include: 'ProtectedItemStateInvalid', 'ProtectedItemStateIRPending', 'ProtectedItemStateProtected', 'ProtectedItemStateProtectionError', 'ProtectedItemStateProtectionStopped', 'ProtectedItemStateProtectionPaused' + ProtectionState ProtectedItemState `json:"protectionState,omitempty"` + // IsScheduledForDeferredDelete - To check if backup item is scheduled for deferred delete + IsScheduledForDeferredDelete *bool `json:"isScheduledForDeferredDelete,omitempty"` + // ExtendedInfo - Extended info of the backup item. + ExtendedInfo *DPMProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` + // BackupManagementType - Type of backup managemenent for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase' + WorkloadType DataSourceType `json:"workloadType,omitempty"` + // ContainerName - Unique name of container + ContainerName *string `json:"containerName,omitempty"` + // SourceResourceID - ARM ID of the resource to be backed up. + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // PolicyID - ID of the backup policy with which this item is backed up. + PolicyID *string `json:"policyId,omitempty"` + // LastRecoveryPoint - Timestamp when the last (latest) backup copy was created for this backup item. + LastRecoveryPoint *date.Time `json:"lastRecoveryPoint,omitempty"` + // BackupSetName - Name of the backup set the backup item belongs to + BackupSetName *string `json:"backupSetName,omitempty"` + // CreateMode - Create mode to indicate recovery of existing soft deleted data source or creation of new data source. Possible values include: 'CreateModeInvalid', 'CreateModeDefault', 'CreateModeRecover' + CreateMode CreateMode `json:"createMode,omitempty"` + // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' + ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` +} + +// MarshalJSON is the custom marshaler for DPMProtectedItem. +func (dpi DPMProtectedItem) MarshalJSON() ([]byte, error) { + dpi.ProtectedItemType = ProtectedItemTypeDPMProtectedItem + objectMap := make(map[string]interface{}) + if dpi.FriendlyName != nil { + objectMap["friendlyName"] = dpi.FriendlyName + } + if dpi.BackupEngineName != nil { + objectMap["backupEngineName"] = dpi.BackupEngineName + } + if dpi.ProtectionState != "" { + objectMap["protectionState"] = dpi.ProtectionState + } + if dpi.IsScheduledForDeferredDelete != nil { + objectMap["isScheduledForDeferredDelete"] = dpi.IsScheduledForDeferredDelete + } + if dpi.ExtendedInfo != nil { + objectMap["extendedInfo"] = dpi.ExtendedInfo + } + if dpi.BackupManagementType != "" { + objectMap["backupManagementType"] = dpi.BackupManagementType + } + if dpi.WorkloadType != "" { + objectMap["workloadType"] = dpi.WorkloadType + } + if dpi.ContainerName != nil { + objectMap["containerName"] = dpi.ContainerName + } + if dpi.SourceResourceID != nil { + objectMap["sourceResourceId"] = dpi.SourceResourceID + } + if dpi.PolicyID != nil { + objectMap["policyId"] = dpi.PolicyID + } + if dpi.LastRecoveryPoint != nil { + objectMap["lastRecoveryPoint"] = dpi.LastRecoveryPoint + } + if dpi.BackupSetName != nil { + objectMap["backupSetName"] = dpi.BackupSetName + } + if dpi.CreateMode != "" { + objectMap["createMode"] = dpi.CreateMode + } + if dpi.ProtectedItemType != "" { + objectMap["protectedItemType"] = dpi.ProtectedItemType + } + return json.Marshal(objectMap) +} + +// AsAzureFileshareProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. +func (dpi DPMProtectedItem) AsAzureFileshareProtectedItem() (*AzureFileshareProtectedItem, bool) { + return nil, false +} + +// AsAzureIaaSClassicComputeVMProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. +func (dpi DPMProtectedItem) AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) { + return nil, false +} + +// AsAzureIaaSComputeVMProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. +func (dpi DPMProtectedItem) AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) { + return nil, false +} + +// AsAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. +func (dpi DPMProtectedItem) AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) { + return nil, false +} + +// AsBasicAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. +func (dpi DPMProtectedItem) AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) { + return nil, false +} + +// AsAzureSQLProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. +func (dpi DPMProtectedItem) AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. +func (dpi DPMProtectedItem) AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) { + return nil, false +} + +// AsBasicAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. +func (dpi DPMProtectedItem) AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaDatabaseProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. +func (dpi DPMProtectedItem) AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLDatabaseProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. +func (dpi DPMProtectedItem) AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) { + return nil, false +} + +// AsDPMProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. +func (dpi DPMProtectedItem) AsDPMProtectedItem() (*DPMProtectedItem, bool) { + return &dpi, true +} + +// AsGenericProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. +func (dpi DPMProtectedItem) AsGenericProtectedItem() (*GenericProtectedItem, bool) { + return nil, false +} + +// AsMabFileFolderProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. +func (dpi DPMProtectedItem) AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) { + return nil, false +} + +// AsProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. +func (dpi DPMProtectedItem) AsProtectedItem() (*ProtectedItem, bool) { + return nil, false +} + +// AsBasicProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. +func (dpi DPMProtectedItem) AsBasicProtectedItem() (BasicProtectedItem, bool) { + return &dpi, true +} + +// DPMProtectedItemExtendedInfo additional information of DPM Protected item. +type DPMProtectedItemExtendedInfo struct { + // ProtectableObjectLoadPath - Attribute to provide information on various DBs. + ProtectableObjectLoadPath map[string]*string `json:"protectableObjectLoadPath"` + // Protected - To check if backup item is disk protected. + Protected *bool `json:"protected,omitempty"` + // IsPresentOnCloud - To check if backup item is cloud protected. + IsPresentOnCloud *bool `json:"isPresentOnCloud,omitempty"` + // LastBackupStatus - Last backup status information on backup item. + LastBackupStatus *string `json:"lastBackupStatus,omitempty"` + // LastRefreshedAt - Last refresh time on backup item. + LastRefreshedAt *date.Time `json:"lastRefreshedAt,omitempty"` + // OldestRecoveryPoint - Oldest cloud recovery point time. + OldestRecoveryPoint *date.Time `json:"oldestRecoveryPoint,omitempty"` + // RecoveryPointCount - cloud recovery point count. + RecoveryPointCount *int32 `json:"recoveryPointCount,omitempty"` + // OnPremiseOldestRecoveryPoint - Oldest disk recovery point time. + OnPremiseOldestRecoveryPoint *date.Time `json:"onPremiseOldestRecoveryPoint,omitempty"` + // OnPremiseLatestRecoveryPoint - latest disk recovery point time. + OnPremiseLatestRecoveryPoint *date.Time `json:"onPremiseLatestRecoveryPoint,omitempty"` + // OnPremiseRecoveryPointCount - disk recovery point count. + OnPremiseRecoveryPointCount *int32 `json:"onPremiseRecoveryPointCount,omitempty"` + // IsCollocated - To check if backup item is collocated. + IsCollocated *bool `json:"isCollocated,omitempty"` + // ProtectionGroupName - Protection group name of the backup item. + ProtectionGroupName *string `json:"protectionGroupName,omitempty"` + // DiskStorageUsedInBytes - Used Disk storage in bytes. + DiskStorageUsedInBytes *string `json:"diskStorageUsedInBytes,omitempty"` + // TotalDiskStorageSizeInBytes - total Disk storage in bytes. + TotalDiskStorageSizeInBytes *string `json:"totalDiskStorageSizeInBytes,omitempty"` +} + +// MarshalJSON is the custom marshaler for DPMProtectedItemExtendedInfo. +func (dpiei DPMProtectedItemExtendedInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dpiei.ProtectableObjectLoadPath != nil { + objectMap["protectableObjectLoadPath"] = dpiei.ProtectableObjectLoadPath + } + if dpiei.Protected != nil { + objectMap["protected"] = dpiei.Protected + } + if dpiei.IsPresentOnCloud != nil { + objectMap["isPresentOnCloud"] = dpiei.IsPresentOnCloud + } + if dpiei.LastBackupStatus != nil { + objectMap["lastBackupStatus"] = dpiei.LastBackupStatus + } + if dpiei.LastRefreshedAt != nil { + objectMap["lastRefreshedAt"] = dpiei.LastRefreshedAt + } + if dpiei.OldestRecoveryPoint != nil { + objectMap["oldestRecoveryPoint"] = dpiei.OldestRecoveryPoint + } + if dpiei.RecoveryPointCount != nil { + objectMap["recoveryPointCount"] = dpiei.RecoveryPointCount + } + if dpiei.OnPremiseOldestRecoveryPoint != nil { + objectMap["onPremiseOldestRecoveryPoint"] = dpiei.OnPremiseOldestRecoveryPoint + } + if dpiei.OnPremiseLatestRecoveryPoint != nil { + objectMap["onPremiseLatestRecoveryPoint"] = dpiei.OnPremiseLatestRecoveryPoint + } + if dpiei.OnPremiseRecoveryPointCount != nil { + objectMap["onPremiseRecoveryPointCount"] = dpiei.OnPremiseRecoveryPointCount + } + if dpiei.IsCollocated != nil { + objectMap["isCollocated"] = dpiei.IsCollocated + } + if dpiei.ProtectionGroupName != nil { + objectMap["protectionGroupName"] = dpiei.ProtectionGroupName + } + if dpiei.DiskStorageUsedInBytes != nil { + objectMap["diskStorageUsedInBytes"] = dpiei.DiskStorageUsedInBytes + } + if dpiei.TotalDiskStorageSizeInBytes != nil { + objectMap["totalDiskStorageSizeInBytes"] = dpiei.TotalDiskStorageSizeInBytes + } + return json.Marshal(objectMap) +} + +// EncryptionDetails details needed if the VM was encrypted at the time of backup. +type EncryptionDetails struct { + // EncryptionEnabled - Identifies whether this backup copy represents an encrypted VM at the time of backup. + EncryptionEnabled *bool `json:"encryptionEnabled,omitempty"` + // KekURL - Key Url. + KekURL *string `json:"kekUrl,omitempty"` + // SecretKeyURL - Secret Url. + SecretKeyURL *string `json:"secretKeyUrl,omitempty"` + // KekVaultID - ID of Key Vault where KEK is stored. + KekVaultID *string `json:"kekVaultId,omitempty"` + // SecretKeyVaultID - ID of Key Vault where Secret is stored. + SecretKeyVaultID *string `json:"secretKeyVaultId,omitempty"` +} + +// BasicEngineBase the base backup engine class. All workload specific backup engines derive from this class. +type BasicEngineBase interface { + AsAzureBackupServerEngine() (*AzureBackupServerEngine, bool) + AsDpmBackupEngine() (*DpmBackupEngine, bool) + AsEngineBase() (*EngineBase, bool) +} + +// EngineBase the base backup engine class. All workload specific backup engines derive from this class. +type EngineBase struct { + // FriendlyName - Friendly name of the backup engine. + FriendlyName *string `json:"friendlyName,omitempty"` + // BackupManagementType - Type of backup management for the backup engine. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // RegistrationStatus - Registration status of the backup engine with the Recovery Services Vault. + RegistrationStatus *string `json:"registrationStatus,omitempty"` + // BackupEngineState - Status of the backup engine with the Recovery Services Vault. = {Active/Deleting/DeleteFailed} + BackupEngineState *string `json:"backupEngineState,omitempty"` + // HealthStatus - Backup status of the backup engine. + HealthStatus *string `json:"healthStatus,omitempty"` + // CanReRegister - Flag indicating if the backup engine be registered, once already registered. + CanReRegister *bool `json:"canReRegister,omitempty"` + // BackupEngineID - ID of the backup engine. + BackupEngineID *string `json:"backupEngineId,omitempty"` + // DpmVersion - Backup engine version + DpmVersion *string `json:"dpmVersion,omitempty"` + // AzureBackupAgentVersion - Backup agent version + AzureBackupAgentVersion *string `json:"azureBackupAgentVersion,omitempty"` + // IsAzureBackupAgentUpgradeAvailable - To check if backup agent upgrade available + IsAzureBackupAgentUpgradeAvailable *bool `json:"isAzureBackupAgentUpgradeAvailable,omitempty"` + // IsDpmUpgradeAvailable - To check if backup engine upgrade available + IsDpmUpgradeAvailable *bool `json:"isDpmUpgradeAvailable,omitempty"` + // ExtendedInfo - Extended info of the backupengine + ExtendedInfo *EngineExtendedInfo `json:"extendedInfo,omitempty"` + // BackupEngineType - Possible values include: 'BackupEngineTypeBackupEngineBase', 'BackupEngineTypeAzureBackupServerEngine', 'BackupEngineTypeDpmBackupEngine' + BackupEngineType EngineType `json:"backupEngineType,omitempty"` +} + +func unmarshalBasicEngineBase(body []byte) (BasicEngineBase, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["backupEngineType"] { + case string(BackupEngineTypeAzureBackupServerEngine): + var abse AzureBackupServerEngine + err := json.Unmarshal(body, &abse) + return abse, err + case string(BackupEngineTypeDpmBackupEngine): + var dbe DpmBackupEngine + err := json.Unmarshal(body, &dbe) + return dbe, err + default: + var eb EngineBase + err := json.Unmarshal(body, &eb) + return eb, err + } +} +func unmarshalBasicEngineBaseArray(body []byte) ([]BasicEngineBase, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + ebArray := make([]BasicEngineBase, len(rawMessages)) + + for index, rawMessage := range rawMessages { + eb, err := unmarshalBasicEngineBase(*rawMessage) + if err != nil { + return nil, err + } + ebArray[index] = eb + } + return ebArray, nil +} + +// MarshalJSON is the custom marshaler for EngineBase. +func (eb EngineBase) MarshalJSON() ([]byte, error) { + eb.BackupEngineType = BackupEngineTypeBackupEngineBase + objectMap := make(map[string]interface{}) + if eb.FriendlyName != nil { + objectMap["friendlyName"] = eb.FriendlyName + } + if eb.BackupManagementType != "" { + objectMap["backupManagementType"] = eb.BackupManagementType + } + if eb.RegistrationStatus != nil { + objectMap["registrationStatus"] = eb.RegistrationStatus + } + if eb.BackupEngineState != nil { + objectMap["backupEngineState"] = eb.BackupEngineState + } + if eb.HealthStatus != nil { + objectMap["healthStatus"] = eb.HealthStatus + } + if eb.CanReRegister != nil { + objectMap["canReRegister"] = eb.CanReRegister + } + if eb.BackupEngineID != nil { + objectMap["backupEngineId"] = eb.BackupEngineID + } + if eb.DpmVersion != nil { + objectMap["dpmVersion"] = eb.DpmVersion + } + if eb.AzureBackupAgentVersion != nil { + objectMap["azureBackupAgentVersion"] = eb.AzureBackupAgentVersion + } + if eb.IsAzureBackupAgentUpgradeAvailable != nil { + objectMap["isAzureBackupAgentUpgradeAvailable"] = eb.IsAzureBackupAgentUpgradeAvailable + } + if eb.IsDpmUpgradeAvailable != nil { + objectMap["isDpmUpgradeAvailable"] = eb.IsDpmUpgradeAvailable + } + if eb.ExtendedInfo != nil { + objectMap["extendedInfo"] = eb.ExtendedInfo + } + if eb.BackupEngineType != "" { + objectMap["backupEngineType"] = eb.BackupEngineType + } + return json.Marshal(objectMap) +} + +// AsAzureBackupServerEngine is the BasicEngineBase implementation for EngineBase. +func (eb EngineBase) AsAzureBackupServerEngine() (*AzureBackupServerEngine, bool) { + return nil, false +} + +// AsDpmBackupEngine is the BasicEngineBase implementation for EngineBase. +func (eb EngineBase) AsDpmBackupEngine() (*DpmBackupEngine, bool) { + return nil, false +} + +// AsEngineBase is the BasicEngineBase implementation for EngineBase. +func (eb EngineBase) AsEngineBase() (*EngineBase, bool) { + return &eb, true +} + +// AsBasicEngineBase is the BasicEngineBase implementation for EngineBase. +func (eb EngineBase) AsBasicEngineBase() (BasicEngineBase, bool) { + return &eb, true +} + +// EngineBaseResource the base backup engine class. All workload specific backup engines derive from this class. +type EngineBaseResource struct { + autorest.Response `json:"-"` + // Properties - BackupEngineBaseResource properties + Properties BasicEngineBase `json:"properties,omitempty"` + // ID - Resource Id represents the complete path to the resource. + ID *string `json:"id,omitempty"` + // Name - Resource name associated with the resource. + Name *string `json:"name,omitempty"` + // Type - Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... + Type *string `json:"type,omitempty"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // ETag - Optional ETag. + ETag *string `json:"eTag,omitempty"` +} + +// MarshalJSON is the custom marshaler for EngineBaseResource. +func (ebr EngineBaseResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["properties"] = ebr.Properties + if ebr.ID != nil { + objectMap["id"] = ebr.ID + } + if ebr.Name != nil { + objectMap["name"] = ebr.Name + } + if ebr.Type != nil { + objectMap["type"] = ebr.Type + } + if ebr.Location != nil { + objectMap["location"] = ebr.Location + } + if ebr.Tags != nil { + objectMap["tags"] = ebr.Tags + } + if ebr.ETag != nil { + objectMap["eTag"] = ebr.ETag + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for EngineBaseResource struct. +func (ebr *EngineBaseResource) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + properties, err := unmarshalBasicEngineBase(*v) + if err != nil { + return err + } + ebr.Properties = properties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ebr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ebr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ebr.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + ebr.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + ebr.Tags = tags + } + case "eTag": + if v != nil { + var eTag string + err = json.Unmarshal(*v, &eTag) + if err != nil { + return err + } + ebr.ETag = &eTag + } + } + } + + return nil +} + +// EngineBaseResourceList list of BackupEngineBase resources +type EngineBaseResourceList struct { + autorest.Response `json:"-"` + // Value - List of resources. + Value *[]EngineBaseResource `json:"value,omitempty"` + // NextLink - The uri to fetch the next page of resources. Call ListNext() fetches next page of resources. + NextLink *string `json:"nextLink,omitempty"` +} + +// EngineBaseResourceListIterator provides access to a complete listing of EngineBaseResource values. +type EngineBaseResourceListIterator struct { + i int + page EngineBaseResourceListPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *EngineBaseResourceListIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter EngineBaseResourceListIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter EngineBaseResourceListIterator) Response() EngineBaseResourceList { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter EngineBaseResourceListIterator) Value() EngineBaseResource { + if !iter.page.NotDone() { + return EngineBaseResource{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (ebrl EngineBaseResourceList) IsEmpty() bool { + return ebrl.Value == nil || len(*ebrl.Value) == 0 +} + +// engineBaseResourceListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (ebrl EngineBaseResourceList) engineBaseResourceListPreparer() (*http.Request, error) { + if ebrl.NextLink == nil || len(to.String(ebrl.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(ebrl.NextLink))) +} + +// EngineBaseResourceListPage contains a page of EngineBaseResource values. +type EngineBaseResourceListPage struct { + fn func(EngineBaseResourceList) (EngineBaseResourceList, error) + ebrl EngineBaseResourceList +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *EngineBaseResourceListPage) Next() error { + next, err := page.fn(page.ebrl) + if err != nil { + return err + } + page.ebrl = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page EngineBaseResourceListPage) NotDone() bool { + return !page.ebrl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page EngineBaseResourceListPage) Response() EngineBaseResourceList { + return page.ebrl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page EngineBaseResourceListPage) Values() []EngineBaseResource { + if page.ebrl.IsEmpty() { + return nil + } + return *page.ebrl.Value +} + +// EngineExtendedInfo additional information on backup engine. +type EngineExtendedInfo struct { + // DatabaseName - Database name of backup engine. + DatabaseName *string `json:"databaseName,omitempty"` + // ProtectedItemsCount - Number of protected items in the backup engine. + ProtectedItemsCount *int32 `json:"protectedItemsCount,omitempty"` + // ProtectedServersCount - Number of protected servers in the backup engine. + ProtectedServersCount *int32 `json:"protectedServersCount,omitempty"` + // DiskCount - Number of disks in the backup engine. + DiskCount *int32 `json:"diskCount,omitempty"` + // UsedDiskSpace - Diskspace used in the backup engine. + UsedDiskSpace *float64 `json:"usedDiskSpace,omitempty"` + // AvailableDiskSpace - Diskspace currently available in the backup engine. + AvailableDiskSpace *float64 `json:"availableDiskSpace,omitempty"` + // RefreshedAt - Last refresh time in the backup engine. + RefreshedAt *date.Time `json:"refreshedAt,omitempty"` + // AzureProtectedInstances - Protected instances in the backup engine. + AzureProtectedInstances *int32 `json:"azureProtectedInstances,omitempty"` +} + +// ErrorDetail error Detail class which encapsulates Code, Message and Recommendations. +type ErrorDetail struct { + // Code - Error code. + Code *string `json:"code,omitempty"` + // Message - Error Message related to the Code. + Message *string `json:"message,omitempty"` + // Recommendations - List of recommendation strings. + Recommendations *[]string `json:"recommendations,omitempty"` +} + +// GenericContainer base class for generic container of backup items +type GenericContainer struct { + // FabricName - Name of the container's fabric + FabricName *string `json:"fabricName,omitempty"` + // ExtendedInformation - Extended information (not returned in List container API calls) + ExtendedInformation *GenericContainerExtendedInfo `json:"extendedInformation,omitempty"` + // FriendlyName - Friendly name of the container. + FriendlyName *string `json:"friendlyName,omitempty"` + // BackupManagementType - Type of backup managemenent for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // RegistrationStatus - Status of registration of the container with the Recovery Services Vault. + RegistrationStatus *string `json:"registrationStatus,omitempty"` + // HealthStatus - Status of health of the container. + HealthStatus *string `json:"healthStatus,omitempty"` + // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaaSVMContainer', 'ContainerTypeWindows1' + ContainerType ContainerTypeBasicProtectionContainer `json:"containerType,omitempty"` +} + +// MarshalJSON is the custom marshaler for GenericContainer. +func (gc GenericContainer) MarshalJSON() ([]byte, error) { + gc.ContainerType = ContainerTypeGenericContainer1 + objectMap := make(map[string]interface{}) + if gc.FabricName != nil { + objectMap["fabricName"] = gc.FabricName + } + if gc.ExtendedInformation != nil { + objectMap["extendedInformation"] = gc.ExtendedInformation + } + if gc.FriendlyName != nil { + objectMap["friendlyName"] = gc.FriendlyName + } + if gc.BackupManagementType != "" { + objectMap["backupManagementType"] = gc.BackupManagementType + } + if gc.RegistrationStatus != nil { + objectMap["registrationStatus"] = gc.RegistrationStatus + } + if gc.HealthStatus != nil { + objectMap["healthStatus"] = gc.HealthStatus + } + if gc.ContainerType != "" { + objectMap["containerType"] = gc.ContainerType + } + return json.Marshal(objectMap) +} + +// AsAzureBackupServerContainer is the BasicProtectionContainer implementation for GenericContainer. +func (gc GenericContainer) AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) { + return nil, false +} + +// AsAzureIaaSClassicComputeVMContainer is the BasicProtectionContainer implementation for GenericContainer. +func (gc GenericContainer) AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) { + return nil, false +} + +// AsAzureIaaSComputeVMContainer is the BasicProtectionContainer implementation for GenericContainer. +func (gc GenericContainer) AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) { + return nil, false +} + +// AsAzureSQLAGWorkloadContainerProtectionContainer is the BasicProtectionContainer implementation for GenericContainer. +func (gc GenericContainer) AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) { + return nil, false +} + +// AsAzureSQLContainer is the BasicProtectionContainer implementation for GenericContainer. +func (gc GenericContainer) AsAzureSQLContainer() (*AzureSQLContainer, bool) { + return nil, false +} + +// AsAzureStorageContainer is the BasicProtectionContainer implementation for GenericContainer. +func (gc GenericContainer) AsAzureStorageContainer() (*AzureStorageContainer, bool) { + return nil, false +} + +// AsAzureVMAppContainerProtectionContainer is the BasicProtectionContainer implementation for GenericContainer. +func (gc GenericContainer) AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) { + return nil, false +} + +// AsAzureWorkloadContainer is the BasicProtectionContainer implementation for GenericContainer. +func (gc GenericContainer) AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) { + return nil, false +} + +// AsBasicAzureWorkloadContainer is the BasicProtectionContainer implementation for GenericContainer. +func (gc GenericContainer) AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) { + return nil, false +} + +// AsDpmContainer is the BasicProtectionContainer implementation for GenericContainer. +func (gc GenericContainer) AsDpmContainer() (*DpmContainer, bool) { + return nil, false +} + +// AsGenericContainer is the BasicProtectionContainer implementation for GenericContainer. +func (gc GenericContainer) AsGenericContainer() (*GenericContainer, bool) { + return &gc, true +} + +// AsIaaSVMContainer is the BasicProtectionContainer implementation for GenericContainer. +func (gc GenericContainer) AsIaaSVMContainer() (*IaaSVMContainer, bool) { + return nil, false +} + +// AsBasicIaaSVMContainer is the BasicProtectionContainer implementation for GenericContainer. +func (gc GenericContainer) AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) { + return nil, false +} + +// AsMabContainer is the BasicProtectionContainer implementation for GenericContainer. +func (gc GenericContainer) AsMabContainer() (*MabContainer, bool) { + return nil, false +} + +// AsProtectionContainer is the BasicProtectionContainer implementation for GenericContainer. +func (gc GenericContainer) AsProtectionContainer() (*ProtectionContainer, bool) { + return nil, false +} + +// AsBasicProtectionContainer is the BasicProtectionContainer implementation for GenericContainer. +func (gc GenericContainer) AsBasicProtectionContainer() (BasicProtectionContainer, bool) { + return &gc, true +} + +// GenericContainerExtendedInfo container extended information +type GenericContainerExtendedInfo struct { + // RawCertData - Public key of container cert + RawCertData *string `json:"rawCertData,omitempty"` + // ContainerIdentityInfo - Container identity information + ContainerIdentityInfo *ContainerIdentityInfo `json:"containerIdentityInfo,omitempty"` + // ServiceEndpoints - Azure Backup Service Endpoints for the container + ServiceEndpoints map[string]*string `json:"serviceEndpoints"` +} + +// MarshalJSON is the custom marshaler for GenericContainerExtendedInfo. +func (gcei GenericContainerExtendedInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if gcei.RawCertData != nil { + objectMap["rawCertData"] = gcei.RawCertData + } + if gcei.ContainerIdentityInfo != nil { + objectMap["containerIdentityInfo"] = gcei.ContainerIdentityInfo + } + if gcei.ServiceEndpoints != nil { + objectMap["serviceEndpoints"] = gcei.ServiceEndpoints + } + return json.Marshal(objectMap) +} + +// GenericProtectedItem base class for backup items. +type GenericProtectedItem struct { + // FriendlyName - Friendly name of the container. + FriendlyName *string `json:"friendlyName,omitempty"` + // PolicyState - Indicates consistency of policy object and policy applied to this backup item. + PolicyState *string `json:"policyState,omitempty"` + // ProtectionState - Backup state of this backup item. Possible values include: 'ProtectionStateInvalid', 'ProtectionStateIRPending', 'ProtectionStateProtected', 'ProtectionStateProtectionError', 'ProtectionStateProtectionStopped', 'ProtectionStateProtectionPaused' + ProtectionState ProtectionState `json:"protectionState,omitempty"` + // ProtectedItemID - Data Plane Service ID of the protected item. + ProtectedItemID *int64 `json:"protectedItemId,omitempty"` + // SourceAssociations - Loosely coupled (type, value) associations (example - parent of a protected item) + SourceAssociations map[string]*string `json:"sourceAssociations"` + // FabricName - Name of this backup item's fabric. + FabricName *string `json:"fabricName,omitempty"` + // BackupManagementType - Type of backup managemenent for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase' + WorkloadType DataSourceType `json:"workloadType,omitempty"` + // ContainerName - Unique name of container + ContainerName *string `json:"containerName,omitempty"` + // SourceResourceID - ARM ID of the resource to be backed up. + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // PolicyID - ID of the backup policy with which this item is backed up. + PolicyID *string `json:"policyId,omitempty"` + // LastRecoveryPoint - Timestamp when the last (latest) backup copy was created for this backup item. + LastRecoveryPoint *date.Time `json:"lastRecoveryPoint,omitempty"` + // BackupSetName - Name of the backup set the backup item belongs to + BackupSetName *string `json:"backupSetName,omitempty"` + // CreateMode - Create mode to indicate recovery of existing soft deleted data source or creation of new data source. Possible values include: 'CreateModeInvalid', 'CreateModeDefault', 'CreateModeRecover' + CreateMode CreateMode `json:"createMode,omitempty"` + // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' + ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` +} + +// MarshalJSON is the custom marshaler for GenericProtectedItem. +func (gpi GenericProtectedItem) MarshalJSON() ([]byte, error) { + gpi.ProtectedItemType = ProtectedItemTypeGenericProtectedItem + objectMap := make(map[string]interface{}) + if gpi.FriendlyName != nil { + objectMap["friendlyName"] = gpi.FriendlyName + } + if gpi.PolicyState != nil { + objectMap["policyState"] = gpi.PolicyState + } + if gpi.ProtectionState != "" { + objectMap["protectionState"] = gpi.ProtectionState + } + if gpi.ProtectedItemID != nil { + objectMap["protectedItemId"] = gpi.ProtectedItemID + } + if gpi.SourceAssociations != nil { + objectMap["sourceAssociations"] = gpi.SourceAssociations + } + if gpi.FabricName != nil { + objectMap["fabricName"] = gpi.FabricName + } + if gpi.BackupManagementType != "" { + objectMap["backupManagementType"] = gpi.BackupManagementType + } + if gpi.WorkloadType != "" { + objectMap["workloadType"] = gpi.WorkloadType + } + if gpi.ContainerName != nil { + objectMap["containerName"] = gpi.ContainerName + } + if gpi.SourceResourceID != nil { + objectMap["sourceResourceId"] = gpi.SourceResourceID + } + if gpi.PolicyID != nil { + objectMap["policyId"] = gpi.PolicyID + } + if gpi.LastRecoveryPoint != nil { + objectMap["lastRecoveryPoint"] = gpi.LastRecoveryPoint + } + if gpi.BackupSetName != nil { + objectMap["backupSetName"] = gpi.BackupSetName + } + if gpi.CreateMode != "" { + objectMap["createMode"] = gpi.CreateMode + } + if gpi.ProtectedItemType != "" { + objectMap["protectedItemType"] = gpi.ProtectedItemType + } + return json.Marshal(objectMap) +} + +// AsAzureFileshareProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. +func (gpi GenericProtectedItem) AsAzureFileshareProtectedItem() (*AzureFileshareProtectedItem, bool) { + return nil, false +} + +// AsAzureIaaSClassicComputeVMProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. +func (gpi GenericProtectedItem) AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) { + return nil, false +} + +// AsAzureIaaSComputeVMProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. +func (gpi GenericProtectedItem) AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) { + return nil, false +} + +// AsAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. +func (gpi GenericProtectedItem) AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) { + return nil, false +} + +// AsBasicAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. +func (gpi GenericProtectedItem) AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) { + return nil, false +} + +// AsAzureSQLProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. +func (gpi GenericProtectedItem) AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. +func (gpi GenericProtectedItem) AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) { + return nil, false +} + +// AsBasicAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. +func (gpi GenericProtectedItem) AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaDatabaseProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. +func (gpi GenericProtectedItem) AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLDatabaseProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. +func (gpi GenericProtectedItem) AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) { + return nil, false +} + +// AsDPMProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. +func (gpi GenericProtectedItem) AsDPMProtectedItem() (*DPMProtectedItem, bool) { + return nil, false +} + +// AsGenericProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. +func (gpi GenericProtectedItem) AsGenericProtectedItem() (*GenericProtectedItem, bool) { + return &gpi, true +} + +// AsMabFileFolderProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. +func (gpi GenericProtectedItem) AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) { + return nil, false +} + +// AsProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. +func (gpi GenericProtectedItem) AsProtectedItem() (*ProtectedItem, bool) { + return nil, false +} + +// AsBasicProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. +func (gpi GenericProtectedItem) AsBasicProtectedItem() (BasicProtectedItem, bool) { + return &gpi, true +} + +// GenericProtectionPolicy azure VM (Mercury) workload-specific backup policy. +type GenericProtectionPolicy struct { + // SubProtectionPolicy - List of sub-protection policies which includes schedule and retention + SubProtectionPolicy *[]SubProtectionPolicy `json:"subProtectionPolicy,omitempty"` + // TimeZone - TimeZone optional input as string. For example: TimeZone = "Pacific Standard Time". + TimeZone *string `json:"timeZone,omitempty"` + // FabricName - Name of this policy's fabric. + FabricName *string `json:"fabricName,omitempty"` + // ProtectedItemsCount - Number of items associated with this policy. + ProtectedItemsCount *int32 `json:"protectedItemsCount,omitempty"` + // BackupManagementType - Possible values include: 'BackupManagementTypeProtectionPolicy', 'BackupManagementTypeAzureStorage', 'BackupManagementTypeAzureIaasVM', 'BackupManagementTypeAzureSQL', 'BackupManagementTypeAzureWorkload', 'BackupManagementTypeGenericProtectionPolicy', 'BackupManagementTypeMAB' + BackupManagementType ManagementTypeBasicProtectionPolicy `json:"backupManagementType,omitempty"` +} + +// MarshalJSON is the custom marshaler for GenericProtectionPolicy. +func (gpp GenericProtectionPolicy) MarshalJSON() ([]byte, error) { + gpp.BackupManagementType = BackupManagementTypeGenericProtectionPolicy + objectMap := make(map[string]interface{}) + if gpp.SubProtectionPolicy != nil { + objectMap["subProtectionPolicy"] = gpp.SubProtectionPolicy + } + if gpp.TimeZone != nil { + objectMap["timeZone"] = gpp.TimeZone + } + if gpp.FabricName != nil { + objectMap["fabricName"] = gpp.FabricName + } + if gpp.ProtectedItemsCount != nil { + objectMap["protectedItemsCount"] = gpp.ProtectedItemsCount + } + if gpp.BackupManagementType != "" { + objectMap["backupManagementType"] = gpp.BackupManagementType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareProtectionPolicy is the BasicProtectionPolicy implementation for GenericProtectionPolicy. +func (gpp GenericProtectionPolicy) AsAzureFileShareProtectionPolicy() (*AzureFileShareProtectionPolicy, bool) { + return nil, false +} + +// AsAzureIaaSVMProtectionPolicy is the BasicProtectionPolicy implementation for GenericProtectionPolicy. +func (gpp GenericProtectionPolicy) AsAzureIaaSVMProtectionPolicy() (*AzureIaaSVMProtectionPolicy, bool) { + return nil, false +} + +// AsAzureSQLProtectionPolicy is the BasicProtectionPolicy implementation for GenericProtectionPolicy. +func (gpp GenericProtectionPolicy) AsAzureSQLProtectionPolicy() (*AzureSQLProtectionPolicy, bool) { + return nil, false +} + +// AsAzureVMWorkloadProtectionPolicy is the BasicProtectionPolicy implementation for GenericProtectionPolicy. +func (gpp GenericProtectionPolicy) AsAzureVMWorkloadProtectionPolicy() (*AzureVMWorkloadProtectionPolicy, bool) { + return nil, false +} + +// AsGenericProtectionPolicy is the BasicProtectionPolicy implementation for GenericProtectionPolicy. +func (gpp GenericProtectionPolicy) AsGenericProtectionPolicy() (*GenericProtectionPolicy, bool) { + return &gpp, true +} + +// AsMabProtectionPolicy is the BasicProtectionPolicy implementation for GenericProtectionPolicy. +func (gpp GenericProtectionPolicy) AsMabProtectionPolicy() (*MabProtectionPolicy, bool) { + return nil, false +} + +// AsProtectionPolicy is the BasicProtectionPolicy implementation for GenericProtectionPolicy. +func (gpp GenericProtectionPolicy) AsProtectionPolicy() (*ProtectionPolicy, bool) { + return nil, false +} + +// AsBasicProtectionPolicy is the BasicProtectionPolicy implementation for GenericProtectionPolicy. +func (gpp GenericProtectionPolicy) AsBasicProtectionPolicy() (BasicProtectionPolicy, bool) { + return &gpp, true +} + +// GenericRecoveryPoint generic backup copy. +type GenericRecoveryPoint struct { + // FriendlyName - Friendly name of the backup copy. + FriendlyName *string `json:"friendlyName,omitempty"` + // RecoveryPointType - Type of the backup copy. + RecoveryPointType *string `json:"recoveryPointType,omitempty"` + // RecoveryPointTime - Time at which this backup copy was created. + RecoveryPointTime *date.Time `json:"recoveryPointTime,omitempty"` + // RecoveryPointAdditionalInfo - Additional information associated with this backup copy. + RecoveryPointAdditionalInfo *string `json:"recoveryPointAdditionalInfo,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeRecoveryPoint', 'ObjectTypeAzureFileShareRecoveryPoint', 'ObjectTypeAzureWorkloadRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaRecoveryPoint', 'ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSQLRecoveryPoint', 'ObjectTypeGenericRecoveryPoint', 'ObjectTypeIaasVMRecoveryPoint' + ObjectType ObjectTypeBasicRecoveryPoint `json:"objectType,omitempty"` +} + +// MarshalJSON is the custom marshaler for GenericRecoveryPoint. +func (grp GenericRecoveryPoint) MarshalJSON() ([]byte, error) { + grp.ObjectType = ObjectTypeGenericRecoveryPoint + objectMap := make(map[string]interface{}) + if grp.FriendlyName != nil { + objectMap["friendlyName"] = grp.FriendlyName + } + if grp.RecoveryPointType != nil { + objectMap["recoveryPointType"] = grp.RecoveryPointType + } + if grp.RecoveryPointTime != nil { + objectMap["recoveryPointTime"] = grp.RecoveryPointTime + } + if grp.RecoveryPointAdditionalInfo != nil { + objectMap["recoveryPointAdditionalInfo"] = grp.RecoveryPointAdditionalInfo + } + if grp.ObjectType != "" { + objectMap["objectType"] = grp.ObjectType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. +func (grp GenericRecoveryPoint) AsAzureFileShareRecoveryPoint() (*AzureFileShareRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. +func (grp GenericRecoveryPoint) AsAzureWorkloadRecoveryPoint() (*AzureWorkloadRecoveryPoint, bool) { + return nil, false +} + +// AsBasicAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. +func (grp GenericRecoveryPoint) AsBasicAzureWorkloadRecoveryPoint() (BasicAzureWorkloadRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. +func (grp GenericRecoveryPoint) AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadSAPHanaRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. +func (grp GenericRecoveryPoint) AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSAPHanaRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. +func (grp GenericRecoveryPoint) AsBasicAzureWorkloadSAPHanaRecoveryPoint() (BasicAzureWorkloadSAPHanaRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadSQLPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. +func (grp GenericRecoveryPoint) AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. +func (grp GenericRecoveryPoint) AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. +func (grp GenericRecoveryPoint) AsBasicAzureWorkloadSQLRecoveryPoint() (BasicAzureWorkloadSQLRecoveryPoint, bool) { + return nil, false +} + +// AsGenericRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. +func (grp GenericRecoveryPoint) AsGenericRecoveryPoint() (*GenericRecoveryPoint, bool) { + return &grp, true +} + +// AsIaasVMRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. +func (grp GenericRecoveryPoint) AsIaasVMRecoveryPoint() (*IaasVMRecoveryPoint, bool) { + return nil, false +} + +// AsRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. +func (grp GenericRecoveryPoint) AsRecoveryPoint() (*RecoveryPoint, bool) { + return nil, false +} + +// AsBasicRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. +func (grp GenericRecoveryPoint) AsBasicRecoveryPoint() (BasicRecoveryPoint, bool) { + return &grp, true +} + +// GetProtectedItemQueryObject filters to list backup items. +type GetProtectedItemQueryObject struct { + // Expand - Specifies if the additional information should be provided for this item. + Expand *string `json:"expand,omitempty"` +} + +// IaasVMBackupRequest iaaS VM workload-specific backup request. +type IaasVMBackupRequest struct { + // RecoveryPointExpiryTimeInUTC - Backup copy will expire after the time specified (UTC). + RecoveryPointExpiryTimeInUTC *date.Time `json:"recoveryPointExpiryTimeInUTC,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeBackupRequest', 'ObjectTypeAzureFileShareBackupRequest', 'ObjectTypeAzureWorkloadBackupRequest', 'ObjectTypeIaasVMBackupRequest' + ObjectType ObjectType `json:"objectType,omitempty"` +} + +// MarshalJSON is the custom marshaler for IaasVMBackupRequest. +func (ivbr IaasVMBackupRequest) MarshalJSON() ([]byte, error) { + ivbr.ObjectType = ObjectTypeIaasVMBackupRequest + objectMap := make(map[string]interface{}) + if ivbr.RecoveryPointExpiryTimeInUTC != nil { + objectMap["recoveryPointExpiryTimeInUTC"] = ivbr.RecoveryPointExpiryTimeInUTC + } + if ivbr.ObjectType != "" { + objectMap["objectType"] = ivbr.ObjectType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareBackupRequest is the BasicRequest implementation for IaasVMBackupRequest. +func (ivbr IaasVMBackupRequest) AsAzureFileShareBackupRequest() (*AzureFileShareBackupRequest, bool) { + return nil, false +} + +// AsAzureWorkloadBackupRequest is the BasicRequest implementation for IaasVMBackupRequest. +func (ivbr IaasVMBackupRequest) AsAzureWorkloadBackupRequest() (*AzureWorkloadBackupRequest, bool) { + return nil, false +} + +// AsIaasVMBackupRequest is the BasicRequest implementation for IaasVMBackupRequest. +func (ivbr IaasVMBackupRequest) AsIaasVMBackupRequest() (*IaasVMBackupRequest, bool) { + return &ivbr, true +} + +// AsRequest is the BasicRequest implementation for IaasVMBackupRequest. +func (ivbr IaasVMBackupRequest) AsRequest() (*Request, bool) { + return nil, false +} + +// AsBasicRequest is the BasicRequest implementation for IaasVMBackupRequest. +func (ivbr IaasVMBackupRequest) AsBasicRequest() (BasicRequest, bool) { + return &ivbr, true +} + +// BasicIaaSVMContainer iaaS VM workload-specific container. +type BasicIaaSVMContainer interface { + AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) + AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) + AsIaaSVMContainer() (*IaaSVMContainer, bool) +} + +// IaaSVMContainer iaaS VM workload-specific container. +type IaaSVMContainer struct { + // VirtualMachineID - Fully qualified ARM url of the virtual machine represented by this Azure IaaS VM container. + VirtualMachineID *string `json:"virtualMachineId,omitempty"` + // VirtualMachineVersion - Specifies whether the container represents a Classic or an Azure Resource Manager VM. + VirtualMachineVersion *string `json:"virtualMachineVersion,omitempty"` + // ResourceGroup - Resource group name of Recovery Services Vault. + ResourceGroup *string `json:"resourceGroup,omitempty"` + // FriendlyName - Friendly name of the container. + FriendlyName *string `json:"friendlyName,omitempty"` + // BackupManagementType - Type of backup managemenent for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // RegistrationStatus - Status of registration of the container with the Recovery Services Vault. + RegistrationStatus *string `json:"registrationStatus,omitempty"` + // HealthStatus - Status of health of the container. + HealthStatus *string `json:"healthStatus,omitempty"` + // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaaSVMContainer', 'ContainerTypeWindows1' + ContainerType ContainerTypeBasicProtectionContainer `json:"containerType,omitempty"` +} + +func unmarshalBasicIaaSVMContainer(body []byte) (BasicIaaSVMContainer, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["containerType"] { + case string(ContainerTypeMicrosoftClassicComputevirtualMachines): + var aisccvc AzureIaaSClassicComputeVMContainer + err := json.Unmarshal(body, &aisccvc) + return aisccvc, err + case string(ContainerTypeMicrosoftComputevirtualMachines): + var aiscvc AzureIaaSComputeVMContainer + err := json.Unmarshal(body, &aiscvc) + return aiscvc, err + default: + var isc IaaSVMContainer + err := json.Unmarshal(body, &isc) + return isc, err + } +} +func unmarshalBasicIaaSVMContainerArray(body []byte) ([]BasicIaaSVMContainer, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + iscArray := make([]BasicIaaSVMContainer, len(rawMessages)) + + for index, rawMessage := range rawMessages { + isc, err := unmarshalBasicIaaSVMContainer(*rawMessage) + if err != nil { + return nil, err + } + iscArray[index] = isc + } + return iscArray, nil +} + +// MarshalJSON is the custom marshaler for IaaSVMContainer. +func (isc IaaSVMContainer) MarshalJSON() ([]byte, error) { + isc.ContainerType = ContainerTypeIaaSVMContainer + objectMap := make(map[string]interface{}) + if isc.VirtualMachineID != nil { + objectMap["virtualMachineId"] = isc.VirtualMachineID + } + if isc.VirtualMachineVersion != nil { + objectMap["virtualMachineVersion"] = isc.VirtualMachineVersion + } + if isc.ResourceGroup != nil { + objectMap["resourceGroup"] = isc.ResourceGroup + } + if isc.FriendlyName != nil { + objectMap["friendlyName"] = isc.FriendlyName + } + if isc.BackupManagementType != "" { + objectMap["backupManagementType"] = isc.BackupManagementType + } + if isc.RegistrationStatus != nil { + objectMap["registrationStatus"] = isc.RegistrationStatus + } + if isc.HealthStatus != nil { + objectMap["healthStatus"] = isc.HealthStatus + } + if isc.ContainerType != "" { + objectMap["containerType"] = isc.ContainerType + } + return json.Marshal(objectMap) +} + +// AsAzureBackupServerContainer is the BasicProtectionContainer implementation for IaaSVMContainer. +func (isc IaaSVMContainer) AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) { + return nil, false +} + +// AsAzureIaaSClassicComputeVMContainer is the BasicProtectionContainer implementation for IaaSVMContainer. +func (isc IaaSVMContainer) AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) { + return nil, false +} + +// AsAzureIaaSComputeVMContainer is the BasicProtectionContainer implementation for IaaSVMContainer. +func (isc IaaSVMContainer) AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) { + return nil, false +} + +// AsAzureSQLAGWorkloadContainerProtectionContainer is the BasicProtectionContainer implementation for IaaSVMContainer. +func (isc IaaSVMContainer) AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) { + return nil, false +} + +// AsAzureSQLContainer is the BasicProtectionContainer implementation for IaaSVMContainer. +func (isc IaaSVMContainer) AsAzureSQLContainer() (*AzureSQLContainer, bool) { + return nil, false +} + +// AsAzureStorageContainer is the BasicProtectionContainer implementation for IaaSVMContainer. +func (isc IaaSVMContainer) AsAzureStorageContainer() (*AzureStorageContainer, bool) { + return nil, false +} + +// AsAzureVMAppContainerProtectionContainer is the BasicProtectionContainer implementation for IaaSVMContainer. +func (isc IaaSVMContainer) AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) { + return nil, false +} + +// AsAzureWorkloadContainer is the BasicProtectionContainer implementation for IaaSVMContainer. +func (isc IaaSVMContainer) AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) { + return nil, false +} + +// AsBasicAzureWorkloadContainer is the BasicProtectionContainer implementation for IaaSVMContainer. +func (isc IaaSVMContainer) AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) { + return nil, false +} + +// AsDpmContainer is the BasicProtectionContainer implementation for IaaSVMContainer. +func (isc IaaSVMContainer) AsDpmContainer() (*DpmContainer, bool) { + return nil, false +} + +// AsGenericContainer is the BasicProtectionContainer implementation for IaaSVMContainer. +func (isc IaaSVMContainer) AsGenericContainer() (*GenericContainer, bool) { + return nil, false +} + +// AsIaaSVMContainer is the BasicProtectionContainer implementation for IaaSVMContainer. +func (isc IaaSVMContainer) AsIaaSVMContainer() (*IaaSVMContainer, bool) { + return &isc, true +} + +// AsBasicIaaSVMContainer is the BasicProtectionContainer implementation for IaaSVMContainer. +func (isc IaaSVMContainer) AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) { + return &isc, true +} + +// AsMabContainer is the BasicProtectionContainer implementation for IaaSVMContainer. +func (isc IaaSVMContainer) AsMabContainer() (*MabContainer, bool) { + return nil, false +} + +// AsProtectionContainer is the BasicProtectionContainer implementation for IaaSVMContainer. +func (isc IaaSVMContainer) AsProtectionContainer() (*ProtectionContainer, bool) { + return nil, false +} + +// AsBasicProtectionContainer is the BasicProtectionContainer implementation for IaaSVMContainer. +func (isc IaaSVMContainer) AsBasicProtectionContainer() (BasicProtectionContainer, bool) { + return &isc, true +} + +// IaasVMILRRegistrationRequest restore files/folders from a backup copy of IaaS VM. +type IaasVMILRRegistrationRequest struct { + // RecoveryPointID - ID of the IaaS VM backup copy from where the files/folders have to be restored. + RecoveryPointID *string `json:"recoveryPointId,omitempty"` + // VirtualMachineID - Fully qualified ARM ID of the virtual machine whose the files / folders have to be restored. + VirtualMachineID *string `json:"virtualMachineId,omitempty"` + // InitiatorName - iSCSI initiator name. + InitiatorName *string `json:"initiatorName,omitempty"` + // RenewExistingRegistration - Whether to renew existing registration with the iSCSI server. + RenewExistingRegistration *bool `json:"renewExistingRegistration,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeILRRequest', 'ObjectTypeIaasVMILRRegistrationRequest' + ObjectType ObjectTypeBasicILRRequest `json:"objectType,omitempty"` +} + +// MarshalJSON is the custom marshaler for IaasVMILRRegistrationRequest. +func (ivrr IaasVMILRRegistrationRequest) MarshalJSON() ([]byte, error) { + ivrr.ObjectType = ObjectTypeIaasVMILRRegistrationRequest + objectMap := make(map[string]interface{}) + if ivrr.RecoveryPointID != nil { + objectMap["recoveryPointId"] = ivrr.RecoveryPointID + } + if ivrr.VirtualMachineID != nil { + objectMap["virtualMachineId"] = ivrr.VirtualMachineID + } + if ivrr.InitiatorName != nil { + objectMap["initiatorName"] = ivrr.InitiatorName + } + if ivrr.RenewExistingRegistration != nil { + objectMap["renewExistingRegistration"] = ivrr.RenewExistingRegistration + } + if ivrr.ObjectType != "" { + objectMap["objectType"] = ivrr.ObjectType + } + return json.Marshal(objectMap) +} + +// AsIaasVMILRRegistrationRequest is the BasicILRRequest implementation for IaasVMILRRegistrationRequest. +func (ivrr IaasVMILRRegistrationRequest) AsIaasVMILRRegistrationRequest() (*IaasVMILRRegistrationRequest, bool) { + return &ivrr, true +} + +// AsILRRequest is the BasicILRRequest implementation for IaasVMILRRegistrationRequest. +func (ivrr IaasVMILRRegistrationRequest) AsILRRequest() (*ILRRequest, bool) { + return nil, false +} + +// AsBasicILRRequest is the BasicILRRequest implementation for IaasVMILRRegistrationRequest. +func (ivrr IaasVMILRRegistrationRequest) AsBasicILRRequest() (BasicILRRequest, bool) { + return &ivrr, true +} + +// BasicIaaSVMProtectableItem iaaS VM workload-specific backup item. +type BasicIaaSVMProtectableItem interface { + AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) + AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) + AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) +} + +// IaaSVMProtectableItem iaaS VM workload-specific backup item. +type IaaSVMProtectableItem struct { + // VirtualMachineID - Fully qualified ARM ID of the virtual machine. + VirtualMachineID *string `json:"virtualMachineId,omitempty"` + // BackupManagementType - Type of backup managemenent to backup an item. + BackupManagementType *string `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload for the backup management + WorkloadType *string `json:"workloadType,omitempty"` + // FriendlyName - Friendly name of the backup item. + FriendlyName *string `json:"friendlyName,omitempty"` + // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' + ProtectionState ProtectionStatus `json:"protectionState,omitempty"` + // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' + ProtectableItemType ProtectableItemType `json:"protectableItemType,omitempty"` +} + +func unmarshalBasicIaaSVMProtectableItem(body []byte) (BasicIaaSVMProtectableItem, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["protectableItemType"] { + case string(ProtectableItemTypeMicrosoftClassicComputevirtualMachines): + var aisccvpi AzureIaaSClassicComputeVMProtectableItem + err := json.Unmarshal(body, &aisccvpi) + return aisccvpi, err + case string(ProtectableItemTypeMicrosoftComputevirtualMachines): + var aiscvpi AzureIaaSComputeVMProtectableItem + err := json.Unmarshal(body, &aiscvpi) + return aiscvpi, err + default: + var ispi IaaSVMProtectableItem + err := json.Unmarshal(body, &ispi) + return ispi, err + } +} +func unmarshalBasicIaaSVMProtectableItemArray(body []byte) ([]BasicIaaSVMProtectableItem, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + ispiArray := make([]BasicIaaSVMProtectableItem, len(rawMessages)) + + for index, rawMessage := range rawMessages { + ispi, err := unmarshalBasicIaaSVMProtectableItem(*rawMessage) + if err != nil { + return nil, err + } + ispiArray[index] = ispi + } + return ispiArray, nil +} + +// MarshalJSON is the custom marshaler for IaaSVMProtectableItem. +func (ispi IaaSVMProtectableItem) MarshalJSON() ([]byte, error) { + ispi.ProtectableItemType = ProtectableItemTypeIaaSVMProtectableItem + objectMap := make(map[string]interface{}) + if ispi.VirtualMachineID != nil { + objectMap["virtualMachineId"] = ispi.VirtualMachineID + } + if ispi.BackupManagementType != nil { + objectMap["backupManagementType"] = ispi.BackupManagementType + } + if ispi.WorkloadType != nil { + objectMap["workloadType"] = ispi.WorkloadType + } + if ispi.FriendlyName != nil { + objectMap["friendlyName"] = ispi.FriendlyName + } + if ispi.ProtectionState != "" { + objectMap["protectionState"] = ispi.ProtectionState + } + if ispi.ProtectableItemType != "" { + objectMap["protectableItemType"] = ispi.ProtectableItemType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. +func (ispi IaaSVMProtectableItem) AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) { + return nil, false +} + +// AsAzureIaaSClassicComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. +func (ispi IaaSVMProtectableItem) AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) { + return nil, false +} + +// AsAzureIaaSComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. +func (ispi IaaSVMProtectableItem) AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. +func (ispi IaaSVMProtectableItem) AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) { + return nil, false +} + +// AsBasicAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. +func (ispi IaaSVMProtectableItem) AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. +func (ispi IaaSVMProtectableItem) AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaSystemProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. +func (ispi IaaSVMProtectableItem) AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. +func (ispi IaaSVMProtectableItem) AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. +func (ispi IaaSVMProtectableItem) AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLInstanceProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. +func (ispi IaaSVMProtectableItem) AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) { + return nil, false +} + +// AsIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. +func (ispi IaaSVMProtectableItem) AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) { + return &ispi, true +} + +// AsBasicIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. +func (ispi IaaSVMProtectableItem) AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) { + return &ispi, true +} + +// AsWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. +func (ispi IaaSVMProtectableItem) AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) { + return nil, false +} + +// AsBasicWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. +func (ispi IaaSVMProtectableItem) AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) { + return &ispi, true +} + +// IaasVMRecoveryPoint iaaS VM workload specific backup copy. +type IaasVMRecoveryPoint struct { + // RecoveryPointType - Type of the backup copy. + RecoveryPointType *string `json:"recoveryPointType,omitempty"` + // RecoveryPointTime - Time at which this backup copy was created. + RecoveryPointTime *date.Time `json:"recoveryPointTime,omitempty"` + // RecoveryPointAdditionalInfo - Additional information associated with this backup copy. + RecoveryPointAdditionalInfo *string `json:"recoveryPointAdditionalInfo,omitempty"` + // SourceVMStorageType - Storage type of the VM whose backup copy is created. + SourceVMStorageType *string `json:"sourceVMStorageType,omitempty"` + // IsSourceVMEncrypted - Identifies whether the VM was encrypted when the backup copy is created. + IsSourceVMEncrypted *bool `json:"isSourceVMEncrypted,omitempty"` + // KeyAndSecret - Required details for recovering an encrypted VM. Applicable only when IsSourceVMEncrypted is true. + KeyAndSecret *KeyAndSecretDetails `json:"keyAndSecret,omitempty"` + // IsInstantIlrSessionActive - Is the session to recover items from this backup copy still active. + IsInstantIlrSessionActive *bool `json:"isInstantIlrSessionActive,omitempty"` + // RecoveryPointTierDetails - Recovery point tier information. + RecoveryPointTierDetails *[]RecoveryPointTierInformation `json:"recoveryPointTierDetails,omitempty"` + // IsManagedVirtualMachine - Whether VM is with Managed Disks + IsManagedVirtualMachine *bool `json:"isManagedVirtualMachine,omitempty"` + // VirtualMachineSize - Virtual Machine Size + VirtualMachineSize *string `json:"virtualMachineSize,omitempty"` + // OriginalStorageAccountOption - Original Storage Account Option + OriginalStorageAccountOption *bool `json:"originalStorageAccountOption,omitempty"` + // OsType - OS type + OsType *string `json:"osType,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeRecoveryPoint', 'ObjectTypeAzureFileShareRecoveryPoint', 'ObjectTypeAzureWorkloadRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaRecoveryPoint', 'ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSQLRecoveryPoint', 'ObjectTypeGenericRecoveryPoint', 'ObjectTypeIaasVMRecoveryPoint' + ObjectType ObjectTypeBasicRecoveryPoint `json:"objectType,omitempty"` +} + +// MarshalJSON is the custom marshaler for IaasVMRecoveryPoint. +func (ivrp IaasVMRecoveryPoint) MarshalJSON() ([]byte, error) { + ivrp.ObjectType = ObjectTypeIaasVMRecoveryPoint + objectMap := make(map[string]interface{}) + if ivrp.RecoveryPointType != nil { + objectMap["recoveryPointType"] = ivrp.RecoveryPointType + } + if ivrp.RecoveryPointTime != nil { + objectMap["recoveryPointTime"] = ivrp.RecoveryPointTime + } + if ivrp.RecoveryPointAdditionalInfo != nil { + objectMap["recoveryPointAdditionalInfo"] = ivrp.RecoveryPointAdditionalInfo + } + if ivrp.SourceVMStorageType != nil { + objectMap["sourceVMStorageType"] = ivrp.SourceVMStorageType + } + if ivrp.IsSourceVMEncrypted != nil { + objectMap["isSourceVMEncrypted"] = ivrp.IsSourceVMEncrypted + } + if ivrp.KeyAndSecret != nil { + objectMap["keyAndSecret"] = ivrp.KeyAndSecret + } + if ivrp.IsInstantIlrSessionActive != nil { + objectMap["isInstantIlrSessionActive"] = ivrp.IsInstantIlrSessionActive + } + if ivrp.RecoveryPointTierDetails != nil { + objectMap["recoveryPointTierDetails"] = ivrp.RecoveryPointTierDetails + } + if ivrp.IsManagedVirtualMachine != nil { + objectMap["isManagedVirtualMachine"] = ivrp.IsManagedVirtualMachine + } + if ivrp.VirtualMachineSize != nil { + objectMap["virtualMachineSize"] = ivrp.VirtualMachineSize + } + if ivrp.OriginalStorageAccountOption != nil { + objectMap["originalStorageAccountOption"] = ivrp.OriginalStorageAccountOption + } + if ivrp.OsType != nil { + objectMap["osType"] = ivrp.OsType + } + if ivrp.ObjectType != "" { + objectMap["objectType"] = ivrp.ObjectType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. +func (ivrp IaasVMRecoveryPoint) AsAzureFileShareRecoveryPoint() (*AzureFileShareRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. +func (ivrp IaasVMRecoveryPoint) AsAzureWorkloadRecoveryPoint() (*AzureWorkloadRecoveryPoint, bool) { + return nil, false +} + +// AsBasicAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. +func (ivrp IaasVMRecoveryPoint) AsBasicAzureWorkloadRecoveryPoint() (BasicAzureWorkloadRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. +func (ivrp IaasVMRecoveryPoint) AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadSAPHanaRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. +func (ivrp IaasVMRecoveryPoint) AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSAPHanaRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. +func (ivrp IaasVMRecoveryPoint) AsBasicAzureWorkloadSAPHanaRecoveryPoint() (BasicAzureWorkloadSAPHanaRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadSQLPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. +func (ivrp IaasVMRecoveryPoint) AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. +func (ivrp IaasVMRecoveryPoint) AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. +func (ivrp IaasVMRecoveryPoint) AsBasicAzureWorkloadSQLRecoveryPoint() (BasicAzureWorkloadSQLRecoveryPoint, bool) { + return nil, false +} + +// AsGenericRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. +func (ivrp IaasVMRecoveryPoint) AsGenericRecoveryPoint() (*GenericRecoveryPoint, bool) { + return nil, false +} + +// AsIaasVMRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. +func (ivrp IaasVMRecoveryPoint) AsIaasVMRecoveryPoint() (*IaasVMRecoveryPoint, bool) { + return &ivrp, true +} + +// AsRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. +func (ivrp IaasVMRecoveryPoint) AsRecoveryPoint() (*RecoveryPoint, bool) { + return nil, false +} + +// AsBasicRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. +func (ivrp IaasVMRecoveryPoint) AsBasicRecoveryPoint() (BasicRecoveryPoint, bool) { + return &ivrp, true +} + +// IaasVMRestoreRequest iaaS VM workload-specific restore. +type IaasVMRestoreRequest struct { + // RecoveryPointID - ID of the backup copy to be recovered. + RecoveryPointID *string `json:"recoveryPointId,omitempty"` + // RecoveryType - Type of this recovery. Possible values include: 'RecoveryTypeInvalid', 'RecoveryTypeOriginalLocation', 'RecoveryTypeAlternateLocation', 'RecoveryTypeRestoreDisks' + RecoveryType RecoveryType `json:"recoveryType,omitempty"` + // SourceResourceID - Fully qualified ARM ID of the VM which is being recovered. + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // TargetVirtualMachineID - This is the complete ARM Id of the VM that will be created. + // For e.g. /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm} + TargetVirtualMachineID *string `json:"targetVirtualMachineId,omitempty"` + // TargetResourceGroupID - This is the ARM Id of the resource group that you want to create for this Virtual machine and other artifacts. + // For e.g. /subscriptions/{subId}/resourcegroups/{rg} + TargetResourceGroupID *string `json:"targetResourceGroupId,omitempty"` + // StorageAccountID - Fully qualified ARM ID of the storage account to which the VM has to be restored. + StorageAccountID *string `json:"storageAccountId,omitempty"` + // VirtualNetworkID - This is the virtual network Id of the vnet that will be attached to the virtual machine. + // User will be validated for join action permissions in the linked access. + VirtualNetworkID *string `json:"virtualNetworkId,omitempty"` + // SubnetID - Subnet ID, is the subnet ID associated with the to be restored VM. For Classic VMs it would be {VnetID}/Subnet/{SubnetName} and, for the Azure Resource Manager VMs it would be ARM resource ID used to represent the subnet. + SubnetID *string `json:"subnetId,omitempty"` + // TargetDomainNameID - Fully qualified ARM ID of the domain name to be associated to the VM being restored. This applies only to Classic Virtual Machines. + TargetDomainNameID *string `json:"targetDomainNameId,omitempty"` + // Region - Region in which the virtual machine is restored. + Region *string `json:"region,omitempty"` + // AffinityGroup - Affinity group associated to VM to be restored. Used only for Classic Compute Virtual Machines. + AffinityGroup *string `json:"affinityGroup,omitempty"` + // CreateNewCloudService - Should a new cloud service be created while restoring the VM. If this is false, VM will be restored to the same cloud service as it was at the time of backup. + CreateNewCloudService *bool `json:"createNewCloudService,omitempty"` + // OriginalStorageAccountOption - Original Storage Account Option + OriginalStorageAccountOption *bool `json:"originalStorageAccountOption,omitempty"` + // EncryptionDetails - Details needed if the VM was encrypted at the time of backup. + EncryptionDetails *EncryptionDetails `json:"encryptionDetails,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeRestoreRequest', 'ObjectTypeAzureFileShareRestoreRequest', 'ObjectTypeAzureWorkloadRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaRestoreRequest', 'ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSQLRestoreRequest', 'ObjectTypeIaasVMRestoreRequest' + ObjectType ObjectTypeBasicRestoreRequest `json:"objectType,omitempty"` +} + +// MarshalJSON is the custom marshaler for IaasVMRestoreRequest. +func (ivrr IaasVMRestoreRequest) MarshalJSON() ([]byte, error) { + ivrr.ObjectType = ObjectTypeIaasVMRestoreRequest + objectMap := make(map[string]interface{}) + if ivrr.RecoveryPointID != nil { + objectMap["recoveryPointId"] = ivrr.RecoveryPointID + } + if ivrr.RecoveryType != "" { + objectMap["recoveryType"] = ivrr.RecoveryType + } + if ivrr.SourceResourceID != nil { + objectMap["sourceResourceId"] = ivrr.SourceResourceID + } + if ivrr.TargetVirtualMachineID != nil { + objectMap["targetVirtualMachineId"] = ivrr.TargetVirtualMachineID + } + if ivrr.TargetResourceGroupID != nil { + objectMap["targetResourceGroupId"] = ivrr.TargetResourceGroupID + } + if ivrr.StorageAccountID != nil { + objectMap["storageAccountId"] = ivrr.StorageAccountID + } + if ivrr.VirtualNetworkID != nil { + objectMap["virtualNetworkId"] = ivrr.VirtualNetworkID + } + if ivrr.SubnetID != nil { + objectMap["subnetId"] = ivrr.SubnetID + } + if ivrr.TargetDomainNameID != nil { + objectMap["targetDomainNameId"] = ivrr.TargetDomainNameID + } + if ivrr.Region != nil { + objectMap["region"] = ivrr.Region + } + if ivrr.AffinityGroup != nil { + objectMap["affinityGroup"] = ivrr.AffinityGroup + } + if ivrr.CreateNewCloudService != nil { + objectMap["createNewCloudService"] = ivrr.CreateNewCloudService + } + if ivrr.OriginalStorageAccountOption != nil { + objectMap["originalStorageAccountOption"] = ivrr.OriginalStorageAccountOption + } + if ivrr.EncryptionDetails != nil { + objectMap["encryptionDetails"] = ivrr.EncryptionDetails + } + if ivrr.ObjectType != "" { + objectMap["objectType"] = ivrr.ObjectType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. +func (ivrr IaasVMRestoreRequest) AsAzureFileShareRestoreRequest() (*AzureFileShareRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. +func (ivrr IaasVMRestoreRequest) AsAzureWorkloadRestoreRequest() (*AzureWorkloadRestoreRequest, bool) { + return nil, false +} + +// AsBasicAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. +func (ivrr IaasVMRestoreRequest) AsBasicAzureWorkloadRestoreRequest() (BasicAzureWorkloadRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSAPHanaPointInTimeRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. +func (ivrr IaasVMRestoreRequest) AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. +func (ivrr IaasVMRestoreRequest) AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. +func (ivrr IaasVMRestoreRequest) AsBasicAzureWorkloadSAPHanaRestoreRequest() (BasicAzureWorkloadSAPHanaRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSQLPointInTimeRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. +func (ivrr IaasVMRestoreRequest) AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. +func (ivrr IaasVMRestoreRequest) AsAzureWorkloadSQLRestoreRequest() (*AzureWorkloadSQLRestoreRequest, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. +func (ivrr IaasVMRestoreRequest) AsBasicAzureWorkloadSQLRestoreRequest() (BasicAzureWorkloadSQLRestoreRequest, bool) { + return nil, false +} + +// AsIaasVMRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. +func (ivrr IaasVMRestoreRequest) AsIaasVMRestoreRequest() (*IaasVMRestoreRequest, bool) { + return &ivrr, true +} + +// AsRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. +func (ivrr IaasVMRestoreRequest) AsRestoreRequest() (*RestoreRequest, bool) { + return nil, false +} + +// AsBasicRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. +func (ivrr IaasVMRestoreRequest) AsBasicRestoreRequest() (BasicRestoreRequest, bool) { + return &ivrr, true +} + +// BasicILRRequest parameters to restore file/folders API. +type BasicILRRequest interface { + AsIaasVMILRRegistrationRequest() (*IaasVMILRRegistrationRequest, bool) + AsILRRequest() (*ILRRequest, bool) +} + +// ILRRequest parameters to restore file/folders API. +type ILRRequest struct { + // ObjectType - Possible values include: 'ObjectTypeILRRequest', 'ObjectTypeIaasVMILRRegistrationRequest' + ObjectType ObjectTypeBasicILRRequest `json:"objectType,omitempty"` +} + +func unmarshalBasicILRRequest(body []byte) (BasicILRRequest, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["objectType"] { + case string(ObjectTypeIaasVMILRRegistrationRequest): + var ivrr IaasVMILRRegistrationRequest + err := json.Unmarshal(body, &ivrr) + return ivrr, err + default: + var ir ILRRequest + err := json.Unmarshal(body, &ir) + return ir, err + } +} +func unmarshalBasicILRRequestArray(body []byte) ([]BasicILRRequest, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + irArray := make([]BasicILRRequest, len(rawMessages)) + + for index, rawMessage := range rawMessages { + ir, err := unmarshalBasicILRRequest(*rawMessage) + if err != nil { + return nil, err + } + irArray[index] = ir + } + return irArray, nil +} + +// MarshalJSON is the custom marshaler for ILRRequest. +func (ir ILRRequest) MarshalJSON() ([]byte, error) { + ir.ObjectType = ObjectTypeILRRequest + objectMap := make(map[string]interface{}) + if ir.ObjectType != "" { + objectMap["objectType"] = ir.ObjectType + } + return json.Marshal(objectMap) +} + +// AsIaasVMILRRegistrationRequest is the BasicILRRequest implementation for ILRRequest. +func (ir ILRRequest) AsIaasVMILRRegistrationRequest() (*IaasVMILRRegistrationRequest, bool) { + return nil, false +} + +// AsILRRequest is the BasicILRRequest implementation for ILRRequest. +func (ir ILRRequest) AsILRRequest() (*ILRRequest, bool) { + return &ir, true +} + +// AsBasicILRRequest is the BasicILRRequest implementation for ILRRequest. +func (ir ILRRequest) AsBasicILRRequest() (BasicILRRequest, bool) { + return &ir, true +} + +// ILRRequestResource parameters to restore file/folders API. +type ILRRequestResource struct { + // Properties - ILRRequestResource properties + Properties BasicILRRequest `json:"properties,omitempty"` + // ID - Resource Id represents the complete path to the resource. + ID *string `json:"id,omitempty"` + // Name - Resource name associated with the resource. + Name *string `json:"name,omitempty"` + // Type - Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... + Type *string `json:"type,omitempty"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // ETag - Optional ETag. + ETag *string `json:"eTag,omitempty"` +} + +// MarshalJSON is the custom marshaler for ILRRequestResource. +func (irr ILRRequestResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["properties"] = irr.Properties + if irr.ID != nil { + objectMap["id"] = irr.ID + } + if irr.Name != nil { + objectMap["name"] = irr.Name + } + if irr.Type != nil { + objectMap["type"] = irr.Type + } + if irr.Location != nil { + objectMap["location"] = irr.Location + } + if irr.Tags != nil { + objectMap["tags"] = irr.Tags + } + if irr.ETag != nil { + objectMap["eTag"] = irr.ETag + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ILRRequestResource struct. +func (irr *ILRRequestResource) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + properties, err := unmarshalBasicILRRequest(*v) + if err != nil { + return err + } + irr.Properties = properties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + irr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + irr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + irr.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + irr.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + irr.Tags = tags + } + case "eTag": + if v != nil { + var eTag string + err = json.Unmarshal(*v, &eTag) + if err != nil { + return err + } + irr.ETag = &eTag + } + } + } + + return nil +} + +// InquiryInfo details about inquired protectable items under a given container. +type InquiryInfo struct { + // Status - Inquiry Status for this container such as + // InProgress | Failed | Succeeded + Status *string `json:"status,omitempty"` + // ErrorDetail - Error Details if the Status is non-success. + ErrorDetail *ErrorDetail `json:"errorDetail,omitempty"` + // InquiryDetails - Inquiry Details which will have workload specific details. + // For e.g. - For SQL and oracle this will contain different details. + InquiryDetails *[]WorkloadInquiryDetails `json:"inquiryDetails,omitempty"` +} + +// InquiryValidation validation for inquired protectable items under a given container. +type InquiryValidation struct { + // Status - Status for the Inquiry Validation. + Status *string `json:"status,omitempty"` + // ErrorDetail - Error Detail in case the status is non-success. + ErrorDetail *ErrorDetail `json:"errorDetail,omitempty"` +} + +// InstantItemRecoveryTarget target details for file / folder restore. +type InstantItemRecoveryTarget struct { + // ClientScripts - List of client scripts. + ClientScripts *[]ClientScriptForConnect `json:"clientScripts,omitempty"` +} + +// KEKDetails KEK is encryption key for BEK. +type KEKDetails struct { + // KeyURL - Key is KEK. + KeyURL *string `json:"keyUrl,omitempty"` + // KeyVaultID - Key Vault ID where this Key is stored. + KeyVaultID *string `json:"keyVaultId,omitempty"` + // KeyBackupData - KEK data. + KeyBackupData *string `json:"keyBackupData,omitempty"` +} + +// KeyAndSecretDetails BEK is bitlocker key. +// KEK is encryption key for BEK +// If the VM was encrypted then we will store follwing details : +// 1. Secret(BEK) - Url + Backup Data + vaultId. +// 2. Key(KEK) - Url + Backup Data + vaultId. +// 3. EncryptionMechanism +// BEK and KEK can potentiallty have different vault ids. +type KeyAndSecretDetails struct { + // KekDetails - KEK is encryption key for BEK. + KekDetails *KEKDetails `json:"kekDetails,omitempty"` + // BekDetails - BEK is bitlocker encrpytion key. + BekDetails *BEKDetails `json:"bekDetails,omitempty"` + // EncryptionMechanism - Encryption mechanism: None/ SinglePass/ DoublePass + EncryptionMechanism *string `json:"encryptionMechanism,omitempty"` +} + +// LogSchedulePolicy log policy schedule. +type LogSchedulePolicy struct { + // ScheduleFrequencyInMins - Frequency of the log schedule operation of this policy in minutes. + ScheduleFrequencyInMins *int32 `json:"scheduleFrequencyInMins,omitempty"` + // SchedulePolicyType - Possible values include: 'SchedulePolicyTypeSchedulePolicy', 'SchedulePolicyTypeLogSchedulePolicy', 'SchedulePolicyTypeLongTermSchedulePolicy', 'SchedulePolicyTypeSimpleSchedulePolicy' + SchedulePolicyType SchedulePolicyType `json:"schedulePolicyType,omitempty"` +} + +// MarshalJSON is the custom marshaler for LogSchedulePolicy. +func (lsp LogSchedulePolicy) MarshalJSON() ([]byte, error) { + lsp.SchedulePolicyType = SchedulePolicyTypeLogSchedulePolicy + objectMap := make(map[string]interface{}) + if lsp.ScheduleFrequencyInMins != nil { + objectMap["scheduleFrequencyInMins"] = lsp.ScheduleFrequencyInMins + } + if lsp.SchedulePolicyType != "" { + objectMap["schedulePolicyType"] = lsp.SchedulePolicyType + } + return json.Marshal(objectMap) +} + +// AsLogSchedulePolicy is the BasicSchedulePolicy implementation for LogSchedulePolicy. +func (lsp LogSchedulePolicy) AsLogSchedulePolicy() (*LogSchedulePolicy, bool) { + return &lsp, true +} + +// AsLongTermSchedulePolicy is the BasicSchedulePolicy implementation for LogSchedulePolicy. +func (lsp LogSchedulePolicy) AsLongTermSchedulePolicy() (*LongTermSchedulePolicy, bool) { + return nil, false +} + +// AsSimpleSchedulePolicy is the BasicSchedulePolicy implementation for LogSchedulePolicy. +func (lsp LogSchedulePolicy) AsSimpleSchedulePolicy() (*SimpleSchedulePolicy, bool) { + return nil, false +} + +// AsSchedulePolicy is the BasicSchedulePolicy implementation for LogSchedulePolicy. +func (lsp LogSchedulePolicy) AsSchedulePolicy() (*SchedulePolicy, bool) { + return nil, false +} + +// AsBasicSchedulePolicy is the BasicSchedulePolicy implementation for LogSchedulePolicy. +func (lsp LogSchedulePolicy) AsBasicSchedulePolicy() (BasicSchedulePolicy, bool) { + return &lsp, true +} + +// LongTermRetentionPolicy long term retention policy. +type LongTermRetentionPolicy struct { + // DailySchedule - Daily retention schedule of the protection policy. + DailySchedule *DailyRetentionSchedule `json:"dailySchedule,omitempty"` + // WeeklySchedule - Weekly retention schedule of the protection policy. + WeeklySchedule *WeeklyRetentionSchedule `json:"weeklySchedule,omitempty"` + // MonthlySchedule - Monthly retention schedule of the protection policy. + MonthlySchedule *MonthlyRetentionSchedule `json:"monthlySchedule,omitempty"` + // YearlySchedule - Yearly retention schedule of the protection policy. + YearlySchedule *YearlyRetentionSchedule `json:"yearlySchedule,omitempty"` + // RetentionPolicyType - Possible values include: 'RetentionPolicyTypeRetentionPolicy', 'RetentionPolicyTypeLongTermRetentionPolicy', 'RetentionPolicyTypeSimpleRetentionPolicy' + RetentionPolicyType RetentionPolicyType `json:"retentionPolicyType,omitempty"` +} + +// MarshalJSON is the custom marshaler for LongTermRetentionPolicy. +func (ltrp LongTermRetentionPolicy) MarshalJSON() ([]byte, error) { + ltrp.RetentionPolicyType = RetentionPolicyTypeLongTermRetentionPolicy + objectMap := make(map[string]interface{}) + if ltrp.DailySchedule != nil { + objectMap["dailySchedule"] = ltrp.DailySchedule + } + if ltrp.WeeklySchedule != nil { + objectMap["weeklySchedule"] = ltrp.WeeklySchedule + } + if ltrp.MonthlySchedule != nil { + objectMap["monthlySchedule"] = ltrp.MonthlySchedule + } + if ltrp.YearlySchedule != nil { + objectMap["yearlySchedule"] = ltrp.YearlySchedule + } + if ltrp.RetentionPolicyType != "" { + objectMap["retentionPolicyType"] = ltrp.RetentionPolicyType + } + return json.Marshal(objectMap) +} + +// AsLongTermRetentionPolicy is the BasicRetentionPolicy implementation for LongTermRetentionPolicy. +func (ltrp LongTermRetentionPolicy) AsLongTermRetentionPolicy() (*LongTermRetentionPolicy, bool) { + return <rp, true +} + +// AsSimpleRetentionPolicy is the BasicRetentionPolicy implementation for LongTermRetentionPolicy. +func (ltrp LongTermRetentionPolicy) AsSimpleRetentionPolicy() (*SimpleRetentionPolicy, bool) { + return nil, false +} + +// AsRetentionPolicy is the BasicRetentionPolicy implementation for LongTermRetentionPolicy. +func (ltrp LongTermRetentionPolicy) AsRetentionPolicy() (*RetentionPolicy, bool) { + return nil, false +} + +// AsBasicRetentionPolicy is the BasicRetentionPolicy implementation for LongTermRetentionPolicy. +func (ltrp LongTermRetentionPolicy) AsBasicRetentionPolicy() (BasicRetentionPolicy, bool) { + return <rp, true +} + +// LongTermSchedulePolicy long term policy schedule. +type LongTermSchedulePolicy struct { + // SchedulePolicyType - Possible values include: 'SchedulePolicyTypeSchedulePolicy', 'SchedulePolicyTypeLogSchedulePolicy', 'SchedulePolicyTypeLongTermSchedulePolicy', 'SchedulePolicyTypeSimpleSchedulePolicy' + SchedulePolicyType SchedulePolicyType `json:"schedulePolicyType,omitempty"` +} + +// MarshalJSON is the custom marshaler for LongTermSchedulePolicy. +func (ltsp LongTermSchedulePolicy) MarshalJSON() ([]byte, error) { + ltsp.SchedulePolicyType = SchedulePolicyTypeLongTermSchedulePolicy + objectMap := make(map[string]interface{}) + if ltsp.SchedulePolicyType != "" { + objectMap["schedulePolicyType"] = ltsp.SchedulePolicyType + } + return json.Marshal(objectMap) +} + +// AsLogSchedulePolicy is the BasicSchedulePolicy implementation for LongTermSchedulePolicy. +func (ltsp LongTermSchedulePolicy) AsLogSchedulePolicy() (*LogSchedulePolicy, bool) { + return nil, false +} + +// AsLongTermSchedulePolicy is the BasicSchedulePolicy implementation for LongTermSchedulePolicy. +func (ltsp LongTermSchedulePolicy) AsLongTermSchedulePolicy() (*LongTermSchedulePolicy, bool) { + return <sp, true +} + +// AsSimpleSchedulePolicy is the BasicSchedulePolicy implementation for LongTermSchedulePolicy. +func (ltsp LongTermSchedulePolicy) AsSimpleSchedulePolicy() (*SimpleSchedulePolicy, bool) { + return nil, false +} + +// AsSchedulePolicy is the BasicSchedulePolicy implementation for LongTermSchedulePolicy. +func (ltsp LongTermSchedulePolicy) AsSchedulePolicy() (*SchedulePolicy, bool) { + return nil, false +} + +// AsBasicSchedulePolicy is the BasicSchedulePolicy implementation for LongTermSchedulePolicy. +func (ltsp LongTermSchedulePolicy) AsBasicSchedulePolicy() (BasicSchedulePolicy, bool) { + return <sp, true +} + +// MabContainer container with items backed up using MAB backup engine. +type MabContainer struct { + // CanReRegister - Can the container be registered one more time. + CanReRegister *bool `json:"canReRegister,omitempty"` + // ContainerID - ContainerID represents the container. + ContainerID *int64 `json:"containerId,omitempty"` + // ProtectedItemCount - Number of items backed up in this container. + ProtectedItemCount *int64 `json:"protectedItemCount,omitempty"` + // AgentVersion - Agent version of this container. + AgentVersion *string `json:"agentVersion,omitempty"` + // ExtendedInfo - Additional information for this container + ExtendedInfo *MabContainerExtendedInfo `json:"extendedInfo,omitempty"` + // MabContainerHealthDetails - Health details on this mab container. + MabContainerHealthDetails *[]MABContainerHealthDetails `json:"mabContainerHealthDetails,omitempty"` + // ContainerHealthState - Health state of mab container. + ContainerHealthState *string `json:"containerHealthState,omitempty"` + // FriendlyName - Friendly name of the container. + FriendlyName *string `json:"friendlyName,omitempty"` + // BackupManagementType - Type of backup managemenent for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // RegistrationStatus - Status of registration of the container with the Recovery Services Vault. + RegistrationStatus *string `json:"registrationStatus,omitempty"` + // HealthStatus - Status of health of the container. + HealthStatus *string `json:"healthStatus,omitempty"` + // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaaSVMContainer', 'ContainerTypeWindows1' + ContainerType ContainerTypeBasicProtectionContainer `json:"containerType,omitempty"` +} + +// MarshalJSON is the custom marshaler for MabContainer. +func (mc MabContainer) MarshalJSON() ([]byte, error) { + mc.ContainerType = ContainerTypeWindows1 + objectMap := make(map[string]interface{}) + if mc.CanReRegister != nil { + objectMap["canReRegister"] = mc.CanReRegister + } + if mc.ContainerID != nil { + objectMap["containerId"] = mc.ContainerID + } + if mc.ProtectedItemCount != nil { + objectMap["protectedItemCount"] = mc.ProtectedItemCount + } + if mc.AgentVersion != nil { + objectMap["agentVersion"] = mc.AgentVersion + } + if mc.ExtendedInfo != nil { + objectMap["extendedInfo"] = mc.ExtendedInfo + } + if mc.MabContainerHealthDetails != nil { + objectMap["mabContainerHealthDetails"] = mc.MabContainerHealthDetails + } + if mc.ContainerHealthState != nil { + objectMap["containerHealthState"] = mc.ContainerHealthState + } + if mc.FriendlyName != nil { + objectMap["friendlyName"] = mc.FriendlyName + } + if mc.BackupManagementType != "" { + objectMap["backupManagementType"] = mc.BackupManagementType + } + if mc.RegistrationStatus != nil { + objectMap["registrationStatus"] = mc.RegistrationStatus + } + if mc.HealthStatus != nil { + objectMap["healthStatus"] = mc.HealthStatus + } + if mc.ContainerType != "" { + objectMap["containerType"] = mc.ContainerType + } + return json.Marshal(objectMap) +} + +// AsAzureBackupServerContainer is the BasicProtectionContainer implementation for MabContainer. +func (mc MabContainer) AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) { + return nil, false +} + +// AsAzureIaaSClassicComputeVMContainer is the BasicProtectionContainer implementation for MabContainer. +func (mc MabContainer) AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) { + return nil, false +} + +// AsAzureIaaSComputeVMContainer is the BasicProtectionContainer implementation for MabContainer. +func (mc MabContainer) AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) { + return nil, false +} + +// AsAzureSQLAGWorkloadContainerProtectionContainer is the BasicProtectionContainer implementation for MabContainer. +func (mc MabContainer) AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) { + return nil, false +} + +// AsAzureSQLContainer is the BasicProtectionContainer implementation for MabContainer. +func (mc MabContainer) AsAzureSQLContainer() (*AzureSQLContainer, bool) { + return nil, false +} + +// AsAzureStorageContainer is the BasicProtectionContainer implementation for MabContainer. +func (mc MabContainer) AsAzureStorageContainer() (*AzureStorageContainer, bool) { + return nil, false +} + +// AsAzureVMAppContainerProtectionContainer is the BasicProtectionContainer implementation for MabContainer. +func (mc MabContainer) AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) { + return nil, false +} + +// AsAzureWorkloadContainer is the BasicProtectionContainer implementation for MabContainer. +func (mc MabContainer) AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) { + return nil, false +} + +// AsBasicAzureWorkloadContainer is the BasicProtectionContainer implementation for MabContainer. +func (mc MabContainer) AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) { + return nil, false +} + +// AsDpmContainer is the BasicProtectionContainer implementation for MabContainer. +func (mc MabContainer) AsDpmContainer() (*DpmContainer, bool) { + return nil, false +} + +// AsGenericContainer is the BasicProtectionContainer implementation for MabContainer. +func (mc MabContainer) AsGenericContainer() (*GenericContainer, bool) { + return nil, false +} + +// AsIaaSVMContainer is the BasicProtectionContainer implementation for MabContainer. +func (mc MabContainer) AsIaaSVMContainer() (*IaaSVMContainer, bool) { + return nil, false +} + +// AsBasicIaaSVMContainer is the BasicProtectionContainer implementation for MabContainer. +func (mc MabContainer) AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) { + return nil, false +} + +// AsMabContainer is the BasicProtectionContainer implementation for MabContainer. +func (mc MabContainer) AsMabContainer() (*MabContainer, bool) { + return &mc, true +} + +// AsProtectionContainer is the BasicProtectionContainer implementation for MabContainer. +func (mc MabContainer) AsProtectionContainer() (*ProtectionContainer, bool) { + return nil, false +} + +// AsBasicProtectionContainer is the BasicProtectionContainer implementation for MabContainer. +func (mc MabContainer) AsBasicProtectionContainer() (BasicProtectionContainer, bool) { + return &mc, true +} + +// MabContainerExtendedInfo additional information of the container. +type MabContainerExtendedInfo struct { + // LastRefreshedAt - Time stamp when this container was refreshed. + LastRefreshedAt *date.Time `json:"lastRefreshedAt,omitempty"` + // BackupItemType - Type of backup items associated with this container. Possible values include: 'ItemTypeInvalid', 'ItemTypeVM', 'ItemTypeFileFolder', 'ItemTypeAzureSQLDb', 'ItemTypeSQLDB', 'ItemTypeExchange', 'ItemTypeSharepoint', 'ItemTypeVMwareVM', 'ItemTypeSystemState', 'ItemTypeClient', 'ItemTypeGenericDataSource', 'ItemTypeSQLDataBase', 'ItemTypeAzureFileShare', 'ItemTypeSAPHanaDatabase' + BackupItemType ItemType `json:"backupItemType,omitempty"` + // BackupItems - List of backup items associated with this container. + BackupItems *[]string `json:"backupItems,omitempty"` + // PolicyName - Backup policy associated with this container. + PolicyName *string `json:"policyName,omitempty"` + // LastBackupStatus - Latest backup status of this container. + LastBackupStatus *string `json:"lastBackupStatus,omitempty"` +} + +// MABContainerHealthDetails MAB workload-specific Health Details. +type MABContainerHealthDetails struct { + // Code - Health Code + Code *int32 `json:"code,omitempty"` + // Title - Health Title + Title *string `json:"title,omitempty"` + // Message - Health Message + Message *string `json:"message,omitempty"` + // Recommendations - Health Recommended Actions + Recommendations *[]string `json:"recommendations,omitempty"` +} + +// MabFileFolderProtectedItem MAB workload-specific backup item. +type MabFileFolderProtectedItem struct { + // FriendlyName - Friendly name of this backup item. + FriendlyName *string `json:"friendlyName,omitempty"` + // ComputerName - Name of the computer associated with this backup item. + ComputerName *string `json:"computerName,omitempty"` + // LastBackupStatus - Status of last backup operation. + LastBackupStatus *string `json:"lastBackupStatus,omitempty"` + // ProtectionState - Protected, ProtectionStopped, IRPending or ProtectionError + ProtectionState *string `json:"protectionState,omitempty"` + // IsScheduledForDeferredDelete - Specifies if the item is scheduled for deferred deletion. + IsScheduledForDeferredDelete *bool `json:"isScheduledForDeferredDelete,omitempty"` + // DeferredDeleteSyncTimeInUTC - Sync time for deferred deletion. + DeferredDeleteSyncTimeInUTC *int64 `json:"deferredDeleteSyncTimeInUTC,omitempty"` + // ExtendedInfo - Additional information with this backup item. + ExtendedInfo *MabFileFolderProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` + // BackupManagementType - Type of backup managemenent for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase' + WorkloadType DataSourceType `json:"workloadType,omitempty"` + // ContainerName - Unique name of container + ContainerName *string `json:"containerName,omitempty"` + // SourceResourceID - ARM ID of the resource to be backed up. + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // PolicyID - ID of the backup policy with which this item is backed up. + PolicyID *string `json:"policyId,omitempty"` + // LastRecoveryPoint - Timestamp when the last (latest) backup copy was created for this backup item. + LastRecoveryPoint *date.Time `json:"lastRecoveryPoint,omitempty"` + // BackupSetName - Name of the backup set the backup item belongs to + BackupSetName *string `json:"backupSetName,omitempty"` + // CreateMode - Create mode to indicate recovery of existing soft deleted data source or creation of new data source. Possible values include: 'CreateModeInvalid', 'CreateModeDefault', 'CreateModeRecover' + CreateMode CreateMode `json:"createMode,omitempty"` + // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' + ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` +} + +// MarshalJSON is the custom marshaler for MabFileFolderProtectedItem. +func (mffpi MabFileFolderProtectedItem) MarshalJSON() ([]byte, error) { + mffpi.ProtectedItemType = ProtectedItemTypeMabFileFolderProtectedItem + objectMap := make(map[string]interface{}) + if mffpi.FriendlyName != nil { + objectMap["friendlyName"] = mffpi.FriendlyName + } + if mffpi.ComputerName != nil { + objectMap["computerName"] = mffpi.ComputerName + } + if mffpi.LastBackupStatus != nil { + objectMap["lastBackupStatus"] = mffpi.LastBackupStatus + } + if mffpi.ProtectionState != nil { + objectMap["protectionState"] = mffpi.ProtectionState + } + if mffpi.IsScheduledForDeferredDelete != nil { + objectMap["isScheduledForDeferredDelete"] = mffpi.IsScheduledForDeferredDelete + } + if mffpi.DeferredDeleteSyncTimeInUTC != nil { + objectMap["deferredDeleteSyncTimeInUTC"] = mffpi.DeferredDeleteSyncTimeInUTC + } + if mffpi.ExtendedInfo != nil { + objectMap["extendedInfo"] = mffpi.ExtendedInfo + } + if mffpi.BackupManagementType != "" { + objectMap["backupManagementType"] = mffpi.BackupManagementType + } + if mffpi.WorkloadType != "" { + objectMap["workloadType"] = mffpi.WorkloadType + } + if mffpi.ContainerName != nil { + objectMap["containerName"] = mffpi.ContainerName + } + if mffpi.SourceResourceID != nil { + objectMap["sourceResourceId"] = mffpi.SourceResourceID + } + if mffpi.PolicyID != nil { + objectMap["policyId"] = mffpi.PolicyID + } + if mffpi.LastRecoveryPoint != nil { + objectMap["lastRecoveryPoint"] = mffpi.LastRecoveryPoint + } + if mffpi.BackupSetName != nil { + objectMap["backupSetName"] = mffpi.BackupSetName + } + if mffpi.CreateMode != "" { + objectMap["createMode"] = mffpi.CreateMode + } + if mffpi.ProtectedItemType != "" { + objectMap["protectedItemType"] = mffpi.ProtectedItemType + } + return json.Marshal(objectMap) +} + +// AsAzureFileshareProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. +func (mffpi MabFileFolderProtectedItem) AsAzureFileshareProtectedItem() (*AzureFileshareProtectedItem, bool) { + return nil, false +} + +// AsAzureIaaSClassicComputeVMProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. +func (mffpi MabFileFolderProtectedItem) AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) { + return nil, false +} + +// AsAzureIaaSComputeVMProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. +func (mffpi MabFileFolderProtectedItem) AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) { + return nil, false +} + +// AsAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. +func (mffpi MabFileFolderProtectedItem) AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) { + return nil, false +} + +// AsBasicAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. +func (mffpi MabFileFolderProtectedItem) AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) { + return nil, false +} + +// AsAzureSQLProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. +func (mffpi MabFileFolderProtectedItem) AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. +func (mffpi MabFileFolderProtectedItem) AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) { + return nil, false +} + +// AsBasicAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. +func (mffpi MabFileFolderProtectedItem) AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaDatabaseProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. +func (mffpi MabFileFolderProtectedItem) AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLDatabaseProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. +func (mffpi MabFileFolderProtectedItem) AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) { + return nil, false +} + +// AsDPMProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. +func (mffpi MabFileFolderProtectedItem) AsDPMProtectedItem() (*DPMProtectedItem, bool) { + return nil, false +} + +// AsGenericProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. +func (mffpi MabFileFolderProtectedItem) AsGenericProtectedItem() (*GenericProtectedItem, bool) { + return nil, false +} + +// AsMabFileFolderProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. +func (mffpi MabFileFolderProtectedItem) AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) { + return &mffpi, true +} + +// AsProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. +func (mffpi MabFileFolderProtectedItem) AsProtectedItem() (*ProtectedItem, bool) { + return nil, false +} + +// AsBasicProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. +func (mffpi MabFileFolderProtectedItem) AsBasicProtectedItem() (BasicProtectedItem, bool) { + return &mffpi, true +} + +// MabFileFolderProtectedItemExtendedInfo additional information on the backed up item. +type MabFileFolderProtectedItemExtendedInfo struct { + // LastRefreshedAt - Last time when the agent data synced to service. + LastRefreshedAt *date.Time `json:"lastRefreshedAt,omitempty"` + // OldestRecoveryPoint - The oldest backup copy available. + OldestRecoveryPoint *date.Time `json:"oldestRecoveryPoint,omitempty"` + // RecoveryPointCount - Number of backup copies associated with the backup item. + RecoveryPointCount *int32 `json:"recoveryPointCount,omitempty"` +} + +// MabProtectionPolicy mab container-specific backup policy. +type MabProtectionPolicy struct { + // SchedulePolicy - Backup schedule of backup policy. + SchedulePolicy BasicSchedulePolicy `json:"schedulePolicy,omitempty"` + // RetentionPolicy - Retention policy details. + RetentionPolicy BasicRetentionPolicy `json:"retentionPolicy,omitempty"` + // ProtectedItemsCount - Number of items associated with this policy. + ProtectedItemsCount *int32 `json:"protectedItemsCount,omitempty"` + // BackupManagementType - Possible values include: 'BackupManagementTypeProtectionPolicy', 'BackupManagementTypeAzureStorage', 'BackupManagementTypeAzureIaasVM', 'BackupManagementTypeAzureSQL', 'BackupManagementTypeAzureWorkload', 'BackupManagementTypeGenericProtectionPolicy', 'BackupManagementTypeMAB' + BackupManagementType ManagementTypeBasicProtectionPolicy `json:"backupManagementType,omitempty"` +} + +// MarshalJSON is the custom marshaler for MabProtectionPolicy. +func (mpp MabProtectionPolicy) MarshalJSON() ([]byte, error) { + mpp.BackupManagementType = BackupManagementTypeMAB + objectMap := make(map[string]interface{}) + objectMap["schedulePolicy"] = mpp.SchedulePolicy + objectMap["retentionPolicy"] = mpp.RetentionPolicy + if mpp.ProtectedItemsCount != nil { + objectMap["protectedItemsCount"] = mpp.ProtectedItemsCount + } + if mpp.BackupManagementType != "" { + objectMap["backupManagementType"] = mpp.BackupManagementType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareProtectionPolicy is the BasicProtectionPolicy implementation for MabProtectionPolicy. +func (mpp MabProtectionPolicy) AsAzureFileShareProtectionPolicy() (*AzureFileShareProtectionPolicy, bool) { + return nil, false +} + +// AsAzureIaaSVMProtectionPolicy is the BasicProtectionPolicy implementation for MabProtectionPolicy. +func (mpp MabProtectionPolicy) AsAzureIaaSVMProtectionPolicy() (*AzureIaaSVMProtectionPolicy, bool) { + return nil, false +} + +// AsAzureSQLProtectionPolicy is the BasicProtectionPolicy implementation for MabProtectionPolicy. +func (mpp MabProtectionPolicy) AsAzureSQLProtectionPolicy() (*AzureSQLProtectionPolicy, bool) { + return nil, false +} + +// AsAzureVMWorkloadProtectionPolicy is the BasicProtectionPolicy implementation for MabProtectionPolicy. +func (mpp MabProtectionPolicy) AsAzureVMWorkloadProtectionPolicy() (*AzureVMWorkloadProtectionPolicy, bool) { + return nil, false +} + +// AsGenericProtectionPolicy is the BasicProtectionPolicy implementation for MabProtectionPolicy. +func (mpp MabProtectionPolicy) AsGenericProtectionPolicy() (*GenericProtectionPolicy, bool) { + return nil, false +} + +// AsMabProtectionPolicy is the BasicProtectionPolicy implementation for MabProtectionPolicy. +func (mpp MabProtectionPolicy) AsMabProtectionPolicy() (*MabProtectionPolicy, bool) { + return &mpp, true +} + +// AsProtectionPolicy is the BasicProtectionPolicy implementation for MabProtectionPolicy. +func (mpp MabProtectionPolicy) AsProtectionPolicy() (*ProtectionPolicy, bool) { + return nil, false +} + +// AsBasicProtectionPolicy is the BasicProtectionPolicy implementation for MabProtectionPolicy. +func (mpp MabProtectionPolicy) AsBasicProtectionPolicy() (BasicProtectionPolicy, bool) { + return &mpp, true +} + +// UnmarshalJSON is the custom unmarshaler for MabProtectionPolicy struct. +func (mpp *MabProtectionPolicy) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "schedulePolicy": + if v != nil { + schedulePolicy, err := unmarshalBasicSchedulePolicy(*v) + if err != nil { + return err + } + mpp.SchedulePolicy = schedulePolicy + } + case "retentionPolicy": + if v != nil { + retentionPolicy, err := unmarshalBasicRetentionPolicy(*v) + if err != nil { + return err + } + mpp.RetentionPolicy = retentionPolicy + } + case "protectedItemsCount": + if v != nil { + var protectedItemsCount int32 + err = json.Unmarshal(*v, &protectedItemsCount) + if err != nil { + return err + } + mpp.ProtectedItemsCount = &protectedItemsCount + } + case "backupManagementType": + if v != nil { + var backupManagementType ManagementTypeBasicProtectionPolicy + err = json.Unmarshal(*v, &backupManagementType) + if err != nil { + return err + } + mpp.BackupManagementType = backupManagementType + } + } + } + + return nil +} + +// MonthlyRetentionSchedule monthly retention schedule. +type MonthlyRetentionSchedule struct { + // RetentionScheduleFormatType - Retention schedule format type for monthly retention policy. Possible values include: 'RetentionScheduleFormatInvalid', 'RetentionScheduleFormatDaily', 'RetentionScheduleFormatWeekly' + RetentionScheduleFormatType RetentionScheduleFormat `json:"retentionScheduleFormatType,omitempty"` + // RetentionScheduleDaily - Daily retention format for monthly retention policy. + RetentionScheduleDaily *DailyRetentionFormat `json:"retentionScheduleDaily,omitempty"` + // RetentionScheduleWeekly - Weekly retention format for monthly retention policy. + RetentionScheduleWeekly *WeeklyRetentionFormat `json:"retentionScheduleWeekly,omitempty"` + // RetentionTimes - Retention times of retention policy. + RetentionTimes *[]date.Time `json:"retentionTimes,omitempty"` + // RetentionDuration - Retention duration of retention Policy. + RetentionDuration *RetentionDuration `json:"retentionDuration,omitempty"` +} + +// OperationStatus operation status. +type OperationStatus struct { + autorest.Response `json:"-"` + // ID - ID of the operation. + ID *string `json:"id,omitempty"` + // Name - Name of the operation. + Name *string `json:"name,omitempty"` + // Status - Operation status. Possible values include: 'OperationStatusValuesInvalid', 'OperationStatusValuesInProgress', 'OperationStatusValuesSucceeded', 'OperationStatusValuesFailed', 'OperationStatusValuesCanceled' + Status OperationStatusValues `json:"status,omitempty"` + // StartTime - Operation start time. Format: ISO-8601. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - Operation end time. Format: ISO-8601. + EndTime *date.Time `json:"endTime,omitempty"` + // Error - Error information related to this operation. + Error *OperationStatusError `json:"error,omitempty"` + // Properties - Additional information associated with this operation. + Properties BasicOperationStatusExtendedInfo `json:"properties,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for OperationStatus struct. +func (osVar *OperationStatus) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + osVar.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + osVar.Name = &name + } + case "status": + if v != nil { + var status OperationStatusValues + err = json.Unmarshal(*v, &status) + if err != nil { + return err + } + osVar.Status = status + } + case "startTime": + if v != nil { + var startTime date.Time + err = json.Unmarshal(*v, &startTime) + if err != nil { + return err + } + osVar.StartTime = &startTime + } + case "endTime": + if v != nil { + var endTime date.Time + err = json.Unmarshal(*v, &endTime) + if err != nil { + return err + } + osVar.EndTime = &endTime + } + case "error": + if v != nil { + var errorVar OperationStatusError + err = json.Unmarshal(*v, &errorVar) + if err != nil { + return err + } + osVar.Error = &errorVar + } + case "properties": + if v != nil { + properties, err := unmarshalBasicOperationStatusExtendedInfo(*v) + if err != nil { + return err + } + osVar.Properties = properties + } + } + } + + return nil +} + +// OperationStatusError error information associated with operation status call. +type OperationStatusError struct { + // Code - Error code of the operation failure. + Code *string `json:"code,omitempty"` + // Message - Error message displayed if the operation failure. + Message *string `json:"message,omitempty"` +} + +// BasicOperationStatusExtendedInfo base class for additional information of operation status. +type BasicOperationStatusExtendedInfo interface { + AsOperationStatusJobExtendedInfo() (*OperationStatusJobExtendedInfo, bool) + AsOperationStatusJobsExtendedInfo() (*OperationStatusJobsExtendedInfo, bool) + AsOperationStatusProvisionILRExtendedInfo() (*OperationStatusProvisionILRExtendedInfo, bool) + AsOperationStatusExtendedInfo() (*OperationStatusExtendedInfo, bool) +} + +// OperationStatusExtendedInfo base class for additional information of operation status. +type OperationStatusExtendedInfo struct { + // ObjectType - Possible values include: 'ObjectTypeOperationStatusExtendedInfo', 'ObjectTypeOperationStatusJobExtendedInfo', 'ObjectTypeOperationStatusJobsExtendedInfo', 'ObjectTypeOperationStatusProvisionILRExtendedInfo' + ObjectType ObjectTypeBasicOperationStatusExtendedInfo `json:"objectType,omitempty"` +} + +func unmarshalBasicOperationStatusExtendedInfo(body []byte) (BasicOperationStatusExtendedInfo, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["objectType"] { + case string(ObjectTypeOperationStatusJobExtendedInfo): + var osjei OperationStatusJobExtendedInfo + err := json.Unmarshal(body, &osjei) + return osjei, err + case string(ObjectTypeOperationStatusJobsExtendedInfo): + var osjei OperationStatusJobsExtendedInfo + err := json.Unmarshal(body, &osjei) + return osjei, err + case string(ObjectTypeOperationStatusProvisionILRExtendedInfo): + var ospiei OperationStatusProvisionILRExtendedInfo + err := json.Unmarshal(body, &ospiei) + return ospiei, err + default: + var osei OperationStatusExtendedInfo + err := json.Unmarshal(body, &osei) + return osei, err + } +} +func unmarshalBasicOperationStatusExtendedInfoArray(body []byte) ([]BasicOperationStatusExtendedInfo, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + oseiArray := make([]BasicOperationStatusExtendedInfo, len(rawMessages)) + + for index, rawMessage := range rawMessages { + osei, err := unmarshalBasicOperationStatusExtendedInfo(*rawMessage) + if err != nil { + return nil, err + } + oseiArray[index] = osei + } + return oseiArray, nil +} + +// MarshalJSON is the custom marshaler for OperationStatusExtendedInfo. +func (osei OperationStatusExtendedInfo) MarshalJSON() ([]byte, error) { + osei.ObjectType = ObjectTypeOperationStatusExtendedInfo + objectMap := make(map[string]interface{}) + if osei.ObjectType != "" { + objectMap["objectType"] = osei.ObjectType + } + return json.Marshal(objectMap) +} + +// AsOperationStatusJobExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusExtendedInfo. +func (osei OperationStatusExtendedInfo) AsOperationStatusJobExtendedInfo() (*OperationStatusJobExtendedInfo, bool) { + return nil, false +} + +// AsOperationStatusJobsExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusExtendedInfo. +func (osei OperationStatusExtendedInfo) AsOperationStatusJobsExtendedInfo() (*OperationStatusJobsExtendedInfo, bool) { + return nil, false +} + +// AsOperationStatusProvisionILRExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusExtendedInfo. +func (osei OperationStatusExtendedInfo) AsOperationStatusProvisionILRExtendedInfo() (*OperationStatusProvisionILRExtendedInfo, bool) { + return nil, false +} + +// AsOperationStatusExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusExtendedInfo. +func (osei OperationStatusExtendedInfo) AsOperationStatusExtendedInfo() (*OperationStatusExtendedInfo, bool) { + return &osei, true +} + +// AsBasicOperationStatusExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusExtendedInfo. +func (osei OperationStatusExtendedInfo) AsBasicOperationStatusExtendedInfo() (BasicOperationStatusExtendedInfo, bool) { + return &osei, true +} + +// OperationStatusJobExtendedInfo operation status job extended info. +type OperationStatusJobExtendedInfo struct { + // JobID - ID of the job created for this protected item. + JobID *string `json:"jobId,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeOperationStatusExtendedInfo', 'ObjectTypeOperationStatusJobExtendedInfo', 'ObjectTypeOperationStatusJobsExtendedInfo', 'ObjectTypeOperationStatusProvisionILRExtendedInfo' + ObjectType ObjectTypeBasicOperationStatusExtendedInfo `json:"objectType,omitempty"` +} + +// MarshalJSON is the custom marshaler for OperationStatusJobExtendedInfo. +func (osjei OperationStatusJobExtendedInfo) MarshalJSON() ([]byte, error) { + osjei.ObjectType = ObjectTypeOperationStatusJobExtendedInfo + objectMap := make(map[string]interface{}) + if osjei.JobID != nil { + objectMap["jobId"] = osjei.JobID + } + if osjei.ObjectType != "" { + objectMap["objectType"] = osjei.ObjectType + } + return json.Marshal(objectMap) +} + +// AsOperationStatusJobExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusJobExtendedInfo. +func (osjei OperationStatusJobExtendedInfo) AsOperationStatusJobExtendedInfo() (*OperationStatusJobExtendedInfo, bool) { + return &osjei, true +} + +// AsOperationStatusJobsExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusJobExtendedInfo. +func (osjei OperationStatusJobExtendedInfo) AsOperationStatusJobsExtendedInfo() (*OperationStatusJobsExtendedInfo, bool) { + return nil, false +} + +// AsOperationStatusProvisionILRExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusJobExtendedInfo. +func (osjei OperationStatusJobExtendedInfo) AsOperationStatusProvisionILRExtendedInfo() (*OperationStatusProvisionILRExtendedInfo, bool) { + return nil, false +} + +// AsOperationStatusExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusJobExtendedInfo. +func (osjei OperationStatusJobExtendedInfo) AsOperationStatusExtendedInfo() (*OperationStatusExtendedInfo, bool) { + return nil, false +} + +// AsBasicOperationStatusExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusJobExtendedInfo. +func (osjei OperationStatusJobExtendedInfo) AsBasicOperationStatusExtendedInfo() (BasicOperationStatusExtendedInfo, bool) { + return &osjei, true +} + +// OperationStatusJobsExtendedInfo operation status extended info for list of jobs. +type OperationStatusJobsExtendedInfo struct { + // JobIds - IDs of the jobs created for the protected item. + JobIds *[]string `json:"jobIds,omitempty"` + // FailedJobsError - Stores all the failed jobs along with the corresponding error codes. + FailedJobsError map[string]*string `json:"failedJobsError"` + // ObjectType - Possible values include: 'ObjectTypeOperationStatusExtendedInfo', 'ObjectTypeOperationStatusJobExtendedInfo', 'ObjectTypeOperationStatusJobsExtendedInfo', 'ObjectTypeOperationStatusProvisionILRExtendedInfo' + ObjectType ObjectTypeBasicOperationStatusExtendedInfo `json:"objectType,omitempty"` +} + +// MarshalJSON is the custom marshaler for OperationStatusJobsExtendedInfo. +func (osjei OperationStatusJobsExtendedInfo) MarshalJSON() ([]byte, error) { + osjei.ObjectType = ObjectTypeOperationStatusJobsExtendedInfo + objectMap := make(map[string]interface{}) + if osjei.JobIds != nil { + objectMap["jobIds"] = osjei.JobIds + } + if osjei.FailedJobsError != nil { + objectMap["failedJobsError"] = osjei.FailedJobsError + } + if osjei.ObjectType != "" { + objectMap["objectType"] = osjei.ObjectType + } + return json.Marshal(objectMap) +} + +// AsOperationStatusJobExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusJobsExtendedInfo. +func (osjei OperationStatusJobsExtendedInfo) AsOperationStatusJobExtendedInfo() (*OperationStatusJobExtendedInfo, bool) { + return nil, false +} + +// AsOperationStatusJobsExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusJobsExtendedInfo. +func (osjei OperationStatusJobsExtendedInfo) AsOperationStatusJobsExtendedInfo() (*OperationStatusJobsExtendedInfo, bool) { + return &osjei, true +} + +// AsOperationStatusProvisionILRExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusJobsExtendedInfo. +func (osjei OperationStatusJobsExtendedInfo) AsOperationStatusProvisionILRExtendedInfo() (*OperationStatusProvisionILRExtendedInfo, bool) { + return nil, false +} + +// AsOperationStatusExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusJobsExtendedInfo. +func (osjei OperationStatusJobsExtendedInfo) AsOperationStatusExtendedInfo() (*OperationStatusExtendedInfo, bool) { + return nil, false +} + +// AsBasicOperationStatusExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusJobsExtendedInfo. +func (osjei OperationStatusJobsExtendedInfo) AsBasicOperationStatusExtendedInfo() (BasicOperationStatusExtendedInfo, bool) { + return &osjei, true +} + +// OperationStatusProvisionILRExtendedInfo operation status extended info for ILR provision action. +type OperationStatusProvisionILRExtendedInfo struct { + // RecoveryTarget - Target details for file / folder restore. + RecoveryTarget *InstantItemRecoveryTarget `json:"recoveryTarget,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeOperationStatusExtendedInfo', 'ObjectTypeOperationStatusJobExtendedInfo', 'ObjectTypeOperationStatusJobsExtendedInfo', 'ObjectTypeOperationStatusProvisionILRExtendedInfo' + ObjectType ObjectTypeBasicOperationStatusExtendedInfo `json:"objectType,omitempty"` +} + +// MarshalJSON is the custom marshaler for OperationStatusProvisionILRExtendedInfo. +func (ospiei OperationStatusProvisionILRExtendedInfo) MarshalJSON() ([]byte, error) { + ospiei.ObjectType = ObjectTypeOperationStatusProvisionILRExtendedInfo + objectMap := make(map[string]interface{}) + if ospiei.RecoveryTarget != nil { + objectMap["recoveryTarget"] = ospiei.RecoveryTarget + } + if ospiei.ObjectType != "" { + objectMap["objectType"] = ospiei.ObjectType + } + return json.Marshal(objectMap) +} + +// AsOperationStatusJobExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusProvisionILRExtendedInfo. +func (ospiei OperationStatusProvisionILRExtendedInfo) AsOperationStatusJobExtendedInfo() (*OperationStatusJobExtendedInfo, bool) { + return nil, false +} + +// AsOperationStatusJobsExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusProvisionILRExtendedInfo. +func (ospiei OperationStatusProvisionILRExtendedInfo) AsOperationStatusJobsExtendedInfo() (*OperationStatusJobsExtendedInfo, bool) { + return nil, false +} + +// AsOperationStatusProvisionILRExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusProvisionILRExtendedInfo. +func (ospiei OperationStatusProvisionILRExtendedInfo) AsOperationStatusProvisionILRExtendedInfo() (*OperationStatusProvisionILRExtendedInfo, bool) { + return &ospiei, true +} + +// AsOperationStatusExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusProvisionILRExtendedInfo. +func (ospiei OperationStatusProvisionILRExtendedInfo) AsOperationStatusExtendedInfo() (*OperationStatusExtendedInfo, bool) { + return nil, false +} + +// AsBasicOperationStatusExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusProvisionILRExtendedInfo. +func (ospiei OperationStatusProvisionILRExtendedInfo) AsBasicOperationStatusExtendedInfo() (BasicOperationStatusExtendedInfo, bool) { + return &ospiei, true +} + +// PointInTimeRange provides details for log ranges +type PointInTimeRange struct { + // StartTime - Start time of the time range for log recovery. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - End time of the time range for log recovery. + EndTime *date.Time `json:"endTime,omitempty"` +} + +// PreBackupValidation pre-backup validation for Azure VM Workload provider. +type PreBackupValidation struct { + // Status - Status of protectable item, i.e. InProgress,Succeeded,Failed. Possible values include: 'InquiryStatusInvalid', 'InquiryStatusSuccess', 'InquiryStatusFailed' + Status InquiryStatus `json:"status,omitempty"` + // Code - Error code of protectable item + Code *string `json:"code,omitempty"` + // Message - Message corresponding to the error code for the protectable item + Message *string `json:"message,omitempty"` +} + +// BasicProtectableContainer protectable Container Class. +type BasicProtectableContainer interface { + AsAzureStorageProtectableContainer() (*AzureStorageProtectableContainer, bool) + AsAzureVMAppContainerProtectableContainer() (*AzureVMAppContainerProtectableContainer, bool) + AsProtectableContainer() (*ProtectableContainer, bool) +} + +// ProtectableContainer protectable Container Class. +type ProtectableContainer struct { + // FriendlyName - Friendly name of the container. + FriendlyName *string `json:"friendlyName,omitempty"` + // BackupManagementType - Type of backup managemenent for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // HealthStatus - Status of health of the container. + HealthStatus *string `json:"healthStatus,omitempty"` + // ContainerID - Fabric Id of the container such as ARM Id. + ContainerID *string `json:"containerId,omitempty"` + // ProtectableContainerType - Possible values include: 'ProtectableContainerTypeProtectableContainer', 'ProtectableContainerTypeStorageContainer', 'ProtectableContainerTypeVMAppContainer' + ProtectableContainerType ProtectableContainerType `json:"protectableContainerType,omitempty"` +} + +func unmarshalBasicProtectableContainer(body []byte) (BasicProtectableContainer, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["protectableContainerType"] { + case string(ProtectableContainerTypeStorageContainer): + var aspc AzureStorageProtectableContainer + err := json.Unmarshal(body, &aspc) + return aspc, err + case string(ProtectableContainerTypeVMAppContainer): + var avacpc AzureVMAppContainerProtectableContainer + err := json.Unmarshal(body, &avacpc) + return avacpc, err + default: + var pc ProtectableContainer + err := json.Unmarshal(body, &pc) + return pc, err + } +} +func unmarshalBasicProtectableContainerArray(body []byte) ([]BasicProtectableContainer, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + pcArray := make([]BasicProtectableContainer, len(rawMessages)) + + for index, rawMessage := range rawMessages { + pc, err := unmarshalBasicProtectableContainer(*rawMessage) + if err != nil { + return nil, err + } + pcArray[index] = pc + } + return pcArray, nil +} + +// MarshalJSON is the custom marshaler for ProtectableContainer. +func (pc ProtectableContainer) MarshalJSON() ([]byte, error) { + pc.ProtectableContainerType = ProtectableContainerTypeProtectableContainer + objectMap := make(map[string]interface{}) + if pc.FriendlyName != nil { + objectMap["friendlyName"] = pc.FriendlyName + } + if pc.BackupManagementType != "" { + objectMap["backupManagementType"] = pc.BackupManagementType + } + if pc.HealthStatus != nil { + objectMap["healthStatus"] = pc.HealthStatus + } + if pc.ContainerID != nil { + objectMap["containerId"] = pc.ContainerID + } + if pc.ProtectableContainerType != "" { + objectMap["protectableContainerType"] = pc.ProtectableContainerType + } + return json.Marshal(objectMap) +} + +// AsAzureStorageProtectableContainer is the BasicProtectableContainer implementation for ProtectableContainer. +func (pc ProtectableContainer) AsAzureStorageProtectableContainer() (*AzureStorageProtectableContainer, bool) { + return nil, false +} + +// AsAzureVMAppContainerProtectableContainer is the BasicProtectableContainer implementation for ProtectableContainer. +func (pc ProtectableContainer) AsAzureVMAppContainerProtectableContainer() (*AzureVMAppContainerProtectableContainer, bool) { + return nil, false +} + +// AsProtectableContainer is the BasicProtectableContainer implementation for ProtectableContainer. +func (pc ProtectableContainer) AsProtectableContainer() (*ProtectableContainer, bool) { + return &pc, true +} + +// AsBasicProtectableContainer is the BasicProtectableContainer implementation for ProtectableContainer. +func (pc ProtectableContainer) AsBasicProtectableContainer() (BasicProtectableContainer, bool) { + return &pc, true +} + +// ProtectableContainerResource protectable Container Class. +type ProtectableContainerResource struct { + // Properties - ProtectableContainerResource properties + Properties BasicProtectableContainer `json:"properties,omitempty"` + // ID - Resource Id represents the complete path to the resource. + ID *string `json:"id,omitempty"` + // Name - Resource name associated with the resource. + Name *string `json:"name,omitempty"` + // Type - Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... + Type *string `json:"type,omitempty"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // ETag - Optional ETag. + ETag *string `json:"eTag,omitempty"` +} + +// MarshalJSON is the custom marshaler for ProtectableContainerResource. +func (pcr ProtectableContainerResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["properties"] = pcr.Properties + if pcr.ID != nil { + objectMap["id"] = pcr.ID + } + if pcr.Name != nil { + objectMap["name"] = pcr.Name + } + if pcr.Type != nil { + objectMap["type"] = pcr.Type + } + if pcr.Location != nil { + objectMap["location"] = pcr.Location + } + if pcr.Tags != nil { + objectMap["tags"] = pcr.Tags + } + if pcr.ETag != nil { + objectMap["eTag"] = pcr.ETag + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ProtectableContainerResource struct. +func (pcr *ProtectableContainerResource) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + properties, err := unmarshalBasicProtectableContainer(*v) + if err != nil { + return err + } + pcr.Properties = properties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + pcr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + pcr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + pcr.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + pcr.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + pcr.Tags = tags + } + case "eTag": + if v != nil { + var eTag string + err = json.Unmarshal(*v, &eTag) + if err != nil { + return err + } + pcr.ETag = &eTag + } + } + } + + return nil +} + +// ProtectableContainerResourceList list of ProtectableContainer resources +type ProtectableContainerResourceList struct { + autorest.Response `json:"-"` + // Value - List of resources. + Value *[]ProtectableContainerResource `json:"value,omitempty"` + // NextLink - The uri to fetch the next page of resources. Call ListNext() fetches next page of resources. + NextLink *string `json:"nextLink,omitempty"` +} + +// ProtectableContainerResourceListIterator provides access to a complete listing of ProtectableContainerResource +// values. +type ProtectableContainerResourceListIterator struct { + i int + page ProtectableContainerResourceListPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ProtectableContainerResourceListIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ProtectableContainerResourceListIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ProtectableContainerResourceListIterator) Response() ProtectableContainerResourceList { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ProtectableContainerResourceListIterator) Value() ProtectableContainerResource { + if !iter.page.NotDone() { + return ProtectableContainerResource{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (pcrl ProtectableContainerResourceList) IsEmpty() bool { + return pcrl.Value == nil || len(*pcrl.Value) == 0 +} + +// protectableContainerResourceListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (pcrl ProtectableContainerResourceList) protectableContainerResourceListPreparer() (*http.Request, error) { + if pcrl.NextLink == nil || len(to.String(pcrl.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(pcrl.NextLink))) +} + +// ProtectableContainerResourceListPage contains a page of ProtectableContainerResource values. +type ProtectableContainerResourceListPage struct { + fn func(ProtectableContainerResourceList) (ProtectableContainerResourceList, error) + pcrl ProtectableContainerResourceList +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ProtectableContainerResourceListPage) Next() error { + next, err := page.fn(page.pcrl) + if err != nil { + return err + } + page.pcrl = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ProtectableContainerResourceListPage) NotDone() bool { + return !page.pcrl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ProtectableContainerResourceListPage) Response() ProtectableContainerResourceList { + return page.pcrl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ProtectableContainerResourceListPage) Values() []ProtectableContainerResource { + if page.pcrl.IsEmpty() { + return nil + } + return *page.pcrl.Value +} + +// BasicProtectedItem base class for backup items. +type BasicProtectedItem interface { + AsAzureFileshareProtectedItem() (*AzureFileshareProtectedItem, bool) + AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) + AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) + AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) + AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) + AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) + AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) + AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) + AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) + AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) + AsDPMProtectedItem() (*DPMProtectedItem, bool) + AsGenericProtectedItem() (*GenericProtectedItem, bool) + AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) + AsProtectedItem() (*ProtectedItem, bool) +} + +// ProtectedItem base class for backup items. +type ProtectedItem struct { + // BackupManagementType - Type of backup managemenent for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase' + WorkloadType DataSourceType `json:"workloadType,omitempty"` + // ContainerName - Unique name of container + ContainerName *string `json:"containerName,omitempty"` + // SourceResourceID - ARM ID of the resource to be backed up. + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // PolicyID - ID of the backup policy with which this item is backed up. + PolicyID *string `json:"policyId,omitempty"` + // LastRecoveryPoint - Timestamp when the last (latest) backup copy was created for this backup item. + LastRecoveryPoint *date.Time `json:"lastRecoveryPoint,omitempty"` + // BackupSetName - Name of the backup set the backup item belongs to + BackupSetName *string `json:"backupSetName,omitempty"` + // CreateMode - Create mode to indicate recovery of existing soft deleted data source or creation of new data source. Possible values include: 'CreateModeInvalid', 'CreateModeDefault', 'CreateModeRecover' + CreateMode CreateMode `json:"createMode,omitempty"` + // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' + ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` +} + +func unmarshalBasicProtectedItem(body []byte) (BasicProtectedItem, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["protectedItemType"] { + case string(ProtectedItemTypeAzureFileShareProtectedItem): + var afpi AzureFileshareProtectedItem + err := json.Unmarshal(body, &afpi) + return afpi, err + case string(ProtectedItemTypeMicrosoftClassicComputevirtualMachines): + var aisccvpi AzureIaaSClassicComputeVMProtectedItem + err := json.Unmarshal(body, &aisccvpi) + return aisccvpi, err + case string(ProtectedItemTypeMicrosoftComputevirtualMachines): + var aiscvpi AzureIaaSComputeVMProtectedItem + err := json.Unmarshal(body, &aiscvpi) + return aiscvpi, err + case string(ProtectedItemTypeAzureIaaSVMProtectedItem): + var aispi AzureIaaSVMProtectedItem + err := json.Unmarshal(body, &aispi) + return aispi, err + case string(ProtectedItemTypeMicrosoftSqlserversdatabases): + var aspi AzureSQLProtectedItem + err := json.Unmarshal(body, &aspi) + return aspi, err + case string(ProtectedItemTypeAzureVMWorkloadProtectedItem): + var avwpi AzureVMWorkloadProtectedItem + err := json.Unmarshal(body, &avwpi) + return avwpi, err + case string(ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase): + var avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem + err := json.Unmarshal(body, &avwshdpi) + return avwshdpi, err + case string(ProtectedItemTypeAzureVMWorkloadSQLDatabase): + var avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem + err := json.Unmarshal(body, &avwsdpi) + return avwsdpi, err + case string(ProtectedItemTypeDPMProtectedItem): + var dpi DPMProtectedItem + err := json.Unmarshal(body, &dpi) + return dpi, err + case string(ProtectedItemTypeGenericProtectedItem): + var gpi GenericProtectedItem + err := json.Unmarshal(body, &gpi) + return gpi, err + case string(ProtectedItemTypeMabFileFolderProtectedItem): + var mffpi MabFileFolderProtectedItem + err := json.Unmarshal(body, &mffpi) + return mffpi, err + default: + var pi ProtectedItem + err := json.Unmarshal(body, &pi) + return pi, err + } +} +func unmarshalBasicProtectedItemArray(body []byte) ([]BasicProtectedItem, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + piArray := make([]BasicProtectedItem, len(rawMessages)) + + for index, rawMessage := range rawMessages { + pi, err := unmarshalBasicProtectedItem(*rawMessage) + if err != nil { + return nil, err + } + piArray[index] = pi + } + return piArray, nil +} + +// MarshalJSON is the custom marshaler for ProtectedItem. +func (pi ProtectedItem) MarshalJSON() ([]byte, error) { + pi.ProtectedItemType = ProtectedItemTypeProtectedItem + objectMap := make(map[string]interface{}) + if pi.BackupManagementType != "" { + objectMap["backupManagementType"] = pi.BackupManagementType + } + if pi.WorkloadType != "" { + objectMap["workloadType"] = pi.WorkloadType + } + if pi.ContainerName != nil { + objectMap["containerName"] = pi.ContainerName + } + if pi.SourceResourceID != nil { + objectMap["sourceResourceId"] = pi.SourceResourceID + } + if pi.PolicyID != nil { + objectMap["policyId"] = pi.PolicyID + } + if pi.LastRecoveryPoint != nil { + objectMap["lastRecoveryPoint"] = pi.LastRecoveryPoint + } + if pi.BackupSetName != nil { + objectMap["backupSetName"] = pi.BackupSetName + } + if pi.CreateMode != "" { + objectMap["createMode"] = pi.CreateMode + } + if pi.ProtectedItemType != "" { + objectMap["protectedItemType"] = pi.ProtectedItemType + } + return json.Marshal(objectMap) +} + +// AsAzureFileshareProtectedItem is the BasicProtectedItem implementation for ProtectedItem. +func (pi ProtectedItem) AsAzureFileshareProtectedItem() (*AzureFileshareProtectedItem, bool) { + return nil, false +} + +// AsAzureIaaSClassicComputeVMProtectedItem is the BasicProtectedItem implementation for ProtectedItem. +func (pi ProtectedItem) AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) { + return nil, false +} + +// AsAzureIaaSComputeVMProtectedItem is the BasicProtectedItem implementation for ProtectedItem. +func (pi ProtectedItem) AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) { + return nil, false +} + +// AsAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for ProtectedItem. +func (pi ProtectedItem) AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) { + return nil, false +} + +// AsBasicAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for ProtectedItem. +func (pi ProtectedItem) AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) { + return nil, false +} + +// AsAzureSQLProtectedItem is the BasicProtectedItem implementation for ProtectedItem. +func (pi ProtectedItem) AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for ProtectedItem. +func (pi ProtectedItem) AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) { + return nil, false +} + +// AsBasicAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for ProtectedItem. +func (pi ProtectedItem) AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaDatabaseProtectedItem is the BasicProtectedItem implementation for ProtectedItem. +func (pi ProtectedItem) AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLDatabaseProtectedItem is the BasicProtectedItem implementation for ProtectedItem. +func (pi ProtectedItem) AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) { + return nil, false +} + +// AsDPMProtectedItem is the BasicProtectedItem implementation for ProtectedItem. +func (pi ProtectedItem) AsDPMProtectedItem() (*DPMProtectedItem, bool) { + return nil, false +} + +// AsGenericProtectedItem is the BasicProtectedItem implementation for ProtectedItem. +func (pi ProtectedItem) AsGenericProtectedItem() (*GenericProtectedItem, bool) { + return nil, false +} + +// AsMabFileFolderProtectedItem is the BasicProtectedItem implementation for ProtectedItem. +func (pi ProtectedItem) AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) { + return nil, false +} + +// AsProtectedItem is the BasicProtectedItem implementation for ProtectedItem. +func (pi ProtectedItem) AsProtectedItem() (*ProtectedItem, bool) { + return &pi, true +} + +// AsBasicProtectedItem is the BasicProtectedItem implementation for ProtectedItem. +func (pi ProtectedItem) AsBasicProtectedItem() (BasicProtectedItem, bool) { + return &pi, true +} + +// ProtectedItemResource base class for backup items. +type ProtectedItemResource struct { + autorest.Response `json:"-"` + // Properties - ProtectedItemResource properties + Properties BasicProtectedItem `json:"properties,omitempty"` + // ID - Resource Id represents the complete path to the resource. + ID *string `json:"id,omitempty"` + // Name - Resource name associated with the resource. + Name *string `json:"name,omitempty"` + // Type - Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... + Type *string `json:"type,omitempty"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // ETag - Optional ETag. + ETag *string `json:"eTag,omitempty"` +} + +// MarshalJSON is the custom marshaler for ProtectedItemResource. +func (pir ProtectedItemResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["properties"] = pir.Properties + if pir.ID != nil { + objectMap["id"] = pir.ID + } + if pir.Name != nil { + objectMap["name"] = pir.Name + } + if pir.Type != nil { + objectMap["type"] = pir.Type + } + if pir.Location != nil { + objectMap["location"] = pir.Location + } + if pir.Tags != nil { + objectMap["tags"] = pir.Tags + } + if pir.ETag != nil { + objectMap["eTag"] = pir.ETag + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ProtectedItemResource struct. +func (pir *ProtectedItemResource) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + properties, err := unmarshalBasicProtectedItem(*v) + if err != nil { + return err + } + pir.Properties = properties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + pir.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + pir.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + pir.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + pir.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + pir.Tags = tags + } + case "eTag": + if v != nil { + var eTag string + err = json.Unmarshal(*v, &eTag) + if err != nil { + return err + } + pir.ETag = &eTag + } + } + } + + return nil +} + +// BasicProtectionContainer base class for container with backup items. Containers with specific workloads are derived +// from this class. +type BasicProtectionContainer interface { + AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) + AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) + AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) + AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) + AsAzureSQLContainer() (*AzureSQLContainer, bool) + AsAzureStorageContainer() (*AzureStorageContainer, bool) + AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) + AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) + AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) + AsDpmContainer() (*DpmContainer, bool) + AsGenericContainer() (*GenericContainer, bool) + AsIaaSVMContainer() (*IaaSVMContainer, bool) + AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) + AsMabContainer() (*MabContainer, bool) + AsProtectionContainer() (*ProtectionContainer, bool) +} + +// ProtectionContainer base class for container with backup items. Containers with specific workloads are derived +// from this class. +type ProtectionContainer struct { + // FriendlyName - Friendly name of the container. + FriendlyName *string `json:"friendlyName,omitempty"` + // BackupManagementType - Type of backup managemenent for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // RegistrationStatus - Status of registration of the container with the Recovery Services Vault. + RegistrationStatus *string `json:"registrationStatus,omitempty"` + // HealthStatus - Status of health of the container. + HealthStatus *string `json:"healthStatus,omitempty"` + // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaaSVMContainer', 'ContainerTypeWindows1' + ContainerType ContainerTypeBasicProtectionContainer `json:"containerType,omitempty"` +} + +func unmarshalBasicProtectionContainer(body []byte) (BasicProtectionContainer, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["containerType"] { + case string(ContainerTypeAzureBackupServerContainer1): + var absc AzureBackupServerContainer + err := json.Unmarshal(body, &absc) + return absc, err + case string(ContainerTypeMicrosoftClassicComputevirtualMachines): + var aisccvc AzureIaaSClassicComputeVMContainer + err := json.Unmarshal(body, &aisccvc) + return aisccvc, err + case string(ContainerTypeMicrosoftComputevirtualMachines): + var aiscvc AzureIaaSComputeVMContainer + err := json.Unmarshal(body, &aiscvc) + return aiscvc, err + case string(ContainerTypeSQLAGWorkLoadContainer1): + var aswcpc AzureSQLAGWorkloadContainerProtectionContainer + err := json.Unmarshal(body, &aswcpc) + return aswcpc, err + case string(ContainerTypeAzureSQLContainer1): + var asc AzureSQLContainer + err := json.Unmarshal(body, &asc) + return asc, err + case string(ContainerTypeStorageContainer1): + var asc AzureStorageContainer + err := json.Unmarshal(body, &asc) + return asc, err + case string(ContainerTypeVMAppContainer1): + var avacpc AzureVMAppContainerProtectionContainer + err := json.Unmarshal(body, &avacpc) + return avacpc, err + case string(ContainerTypeAzureWorkloadContainer): + var awc AzureWorkloadContainer + err := json.Unmarshal(body, &awc) + return awc, err + case string(ContainerTypeDPMContainer1): + var dc DpmContainer + err := json.Unmarshal(body, &dc) + return dc, err + case string(ContainerTypeGenericContainer1): + var gc GenericContainer + err := json.Unmarshal(body, &gc) + return gc, err + case string(ContainerTypeIaaSVMContainer): + var isc IaaSVMContainer + err := json.Unmarshal(body, &isc) + return isc, err + case string(ContainerTypeWindows1): + var mc MabContainer + err := json.Unmarshal(body, &mc) + return mc, err + default: + var pc ProtectionContainer + err := json.Unmarshal(body, &pc) + return pc, err + } +} +func unmarshalBasicProtectionContainerArray(body []byte) ([]BasicProtectionContainer, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + pcArray := make([]BasicProtectionContainer, len(rawMessages)) + + for index, rawMessage := range rawMessages { + pc, err := unmarshalBasicProtectionContainer(*rawMessage) + if err != nil { + return nil, err + } + pcArray[index] = pc + } + return pcArray, nil +} + +// MarshalJSON is the custom marshaler for ProtectionContainer. +func (pc ProtectionContainer) MarshalJSON() ([]byte, error) { + pc.ContainerType = ContainerTypeProtectionContainer + objectMap := make(map[string]interface{}) + if pc.FriendlyName != nil { + objectMap["friendlyName"] = pc.FriendlyName + } + if pc.BackupManagementType != "" { + objectMap["backupManagementType"] = pc.BackupManagementType + } + if pc.RegistrationStatus != nil { + objectMap["registrationStatus"] = pc.RegistrationStatus + } + if pc.HealthStatus != nil { + objectMap["healthStatus"] = pc.HealthStatus + } + if pc.ContainerType != "" { + objectMap["containerType"] = pc.ContainerType + } + return json.Marshal(objectMap) +} + +// AsAzureBackupServerContainer is the BasicProtectionContainer implementation for ProtectionContainer. +func (pc ProtectionContainer) AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) { + return nil, false +} + +// AsAzureIaaSClassicComputeVMContainer is the BasicProtectionContainer implementation for ProtectionContainer. +func (pc ProtectionContainer) AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) { + return nil, false +} + +// AsAzureIaaSComputeVMContainer is the BasicProtectionContainer implementation for ProtectionContainer. +func (pc ProtectionContainer) AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) { + return nil, false +} + +// AsAzureSQLAGWorkloadContainerProtectionContainer is the BasicProtectionContainer implementation for ProtectionContainer. +func (pc ProtectionContainer) AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) { + return nil, false +} + +// AsAzureSQLContainer is the BasicProtectionContainer implementation for ProtectionContainer. +func (pc ProtectionContainer) AsAzureSQLContainer() (*AzureSQLContainer, bool) { + return nil, false +} + +// AsAzureStorageContainer is the BasicProtectionContainer implementation for ProtectionContainer. +func (pc ProtectionContainer) AsAzureStorageContainer() (*AzureStorageContainer, bool) { + return nil, false +} + +// AsAzureVMAppContainerProtectionContainer is the BasicProtectionContainer implementation for ProtectionContainer. +func (pc ProtectionContainer) AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) { + return nil, false +} + +// AsAzureWorkloadContainer is the BasicProtectionContainer implementation for ProtectionContainer. +func (pc ProtectionContainer) AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) { + return nil, false +} + +// AsBasicAzureWorkloadContainer is the BasicProtectionContainer implementation for ProtectionContainer. +func (pc ProtectionContainer) AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) { + return nil, false +} + +// AsDpmContainer is the BasicProtectionContainer implementation for ProtectionContainer. +func (pc ProtectionContainer) AsDpmContainer() (*DpmContainer, bool) { + return nil, false +} + +// AsGenericContainer is the BasicProtectionContainer implementation for ProtectionContainer. +func (pc ProtectionContainer) AsGenericContainer() (*GenericContainer, bool) { + return nil, false +} + +// AsIaaSVMContainer is the BasicProtectionContainer implementation for ProtectionContainer. +func (pc ProtectionContainer) AsIaaSVMContainer() (*IaaSVMContainer, bool) { + return nil, false +} + +// AsBasicIaaSVMContainer is the BasicProtectionContainer implementation for ProtectionContainer. +func (pc ProtectionContainer) AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) { + return nil, false +} + +// AsMabContainer is the BasicProtectionContainer implementation for ProtectionContainer. +func (pc ProtectionContainer) AsMabContainer() (*MabContainer, bool) { + return nil, false +} + +// AsProtectionContainer is the BasicProtectionContainer implementation for ProtectionContainer. +func (pc ProtectionContainer) AsProtectionContainer() (*ProtectionContainer, bool) { + return &pc, true +} + +// AsBasicProtectionContainer is the BasicProtectionContainer implementation for ProtectionContainer. +func (pc ProtectionContainer) AsBasicProtectionContainer() (BasicProtectionContainer, bool) { + return &pc, true +} + +// ProtectionContainerResource base class for container with backup items. Containers with specific workloads are +// derived from this class. +type ProtectionContainerResource struct { + autorest.Response `json:"-"` + // Properties - ProtectionContainerResource properties + Properties BasicProtectionContainer `json:"properties,omitempty"` + // ID - Resource Id represents the complete path to the resource. + ID *string `json:"id,omitempty"` + // Name - Resource name associated with the resource. + Name *string `json:"name,omitempty"` + // Type - Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... + Type *string `json:"type,omitempty"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // ETag - Optional ETag. + ETag *string `json:"eTag,omitempty"` +} + +// MarshalJSON is the custom marshaler for ProtectionContainerResource. +func (pcr ProtectionContainerResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["properties"] = pcr.Properties + if pcr.ID != nil { + objectMap["id"] = pcr.ID + } + if pcr.Name != nil { + objectMap["name"] = pcr.Name + } + if pcr.Type != nil { + objectMap["type"] = pcr.Type + } + if pcr.Location != nil { + objectMap["location"] = pcr.Location + } + if pcr.Tags != nil { + objectMap["tags"] = pcr.Tags + } + if pcr.ETag != nil { + objectMap["eTag"] = pcr.ETag + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ProtectionContainerResource struct. +func (pcr *ProtectionContainerResource) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + properties, err := unmarshalBasicProtectionContainer(*v) + if err != nil { + return err + } + pcr.Properties = properties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + pcr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + pcr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + pcr.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + pcr.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + pcr.Tags = tags + } + case "eTag": + if v != nil { + var eTag string + err = json.Unmarshal(*v, &eTag) + if err != nil { + return err + } + pcr.ETag = &eTag + } + } + } + + return nil +} + +// ProtectionContainerResourceList list of ProtectionContainer resources +type ProtectionContainerResourceList struct { + autorest.Response `json:"-"` + // Value - List of resources. + Value *[]ProtectionContainerResource `json:"value,omitempty"` + // NextLink - The uri to fetch the next page of resources. Call ListNext() fetches next page of resources. + NextLink *string `json:"nextLink,omitempty"` +} + +// ProtectionContainerResourceListIterator provides access to a complete listing of ProtectionContainerResource +// values. +type ProtectionContainerResourceListIterator struct { + i int + page ProtectionContainerResourceListPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ProtectionContainerResourceListIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ProtectionContainerResourceListIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ProtectionContainerResourceListIterator) Response() ProtectionContainerResourceList { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ProtectionContainerResourceListIterator) Value() ProtectionContainerResource { + if !iter.page.NotDone() { + return ProtectionContainerResource{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (pcrl ProtectionContainerResourceList) IsEmpty() bool { + return pcrl.Value == nil || len(*pcrl.Value) == 0 +} + +// protectionContainerResourceListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (pcrl ProtectionContainerResourceList) protectionContainerResourceListPreparer() (*http.Request, error) { + if pcrl.NextLink == nil || len(to.String(pcrl.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(pcrl.NextLink))) +} + +// ProtectionContainerResourceListPage contains a page of ProtectionContainerResource values. +type ProtectionContainerResourceListPage struct { + fn func(ProtectionContainerResourceList) (ProtectionContainerResourceList, error) + pcrl ProtectionContainerResourceList +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ProtectionContainerResourceListPage) Next() error { + next, err := page.fn(page.pcrl) + if err != nil { + return err + } + page.pcrl = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ProtectionContainerResourceListPage) NotDone() bool { + return !page.pcrl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ProtectionContainerResourceListPage) Response() ProtectionContainerResourceList { + return page.pcrl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ProtectionContainerResourceListPage) Values() []ProtectionContainerResource { + if page.pcrl.IsEmpty() { + return nil + } + return *page.pcrl.Value +} + +// BasicProtectionPolicy base class for backup policy. Workload-specific backup policies are derived from this class. +type BasicProtectionPolicy interface { + AsAzureFileShareProtectionPolicy() (*AzureFileShareProtectionPolicy, bool) + AsAzureIaaSVMProtectionPolicy() (*AzureIaaSVMProtectionPolicy, bool) + AsAzureSQLProtectionPolicy() (*AzureSQLProtectionPolicy, bool) + AsAzureVMWorkloadProtectionPolicy() (*AzureVMWorkloadProtectionPolicy, bool) + AsGenericProtectionPolicy() (*GenericProtectionPolicy, bool) + AsMabProtectionPolicy() (*MabProtectionPolicy, bool) + AsProtectionPolicy() (*ProtectionPolicy, bool) +} + +// ProtectionPolicy base class for backup policy. Workload-specific backup policies are derived from this class. +type ProtectionPolicy struct { + // ProtectedItemsCount - Number of items associated with this policy. + ProtectedItemsCount *int32 `json:"protectedItemsCount,omitempty"` + // BackupManagementType - Possible values include: 'BackupManagementTypeProtectionPolicy', 'BackupManagementTypeAzureStorage', 'BackupManagementTypeAzureIaasVM', 'BackupManagementTypeAzureSQL', 'BackupManagementTypeAzureWorkload', 'BackupManagementTypeGenericProtectionPolicy', 'BackupManagementTypeMAB' + BackupManagementType ManagementTypeBasicProtectionPolicy `json:"backupManagementType,omitempty"` +} + +func unmarshalBasicProtectionPolicy(body []byte) (BasicProtectionPolicy, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["backupManagementType"] { + case string(BackupManagementTypeAzureStorage): + var afspp AzureFileShareProtectionPolicy + err := json.Unmarshal(body, &afspp) + return afspp, err + case string(BackupManagementTypeAzureIaasVM): + var aispp AzureIaaSVMProtectionPolicy + err := json.Unmarshal(body, &aispp) + return aispp, err + case string(BackupManagementTypeAzureSQL): + var aspp AzureSQLProtectionPolicy + err := json.Unmarshal(body, &aspp) + return aspp, err + case string(BackupManagementTypeAzureWorkload): + var avwpp AzureVMWorkloadProtectionPolicy + err := json.Unmarshal(body, &avwpp) + return avwpp, err + case string(BackupManagementTypeGenericProtectionPolicy): + var gpp GenericProtectionPolicy + err := json.Unmarshal(body, &gpp) + return gpp, err + case string(BackupManagementTypeMAB): + var mpp MabProtectionPolicy + err := json.Unmarshal(body, &mpp) + return mpp, err + default: + var pp ProtectionPolicy + err := json.Unmarshal(body, &pp) + return pp, err + } +} +func unmarshalBasicProtectionPolicyArray(body []byte) ([]BasicProtectionPolicy, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + ppArray := make([]BasicProtectionPolicy, len(rawMessages)) + + for index, rawMessage := range rawMessages { + pp, err := unmarshalBasicProtectionPolicy(*rawMessage) + if err != nil { + return nil, err + } + ppArray[index] = pp + } + return ppArray, nil +} + +// MarshalJSON is the custom marshaler for ProtectionPolicy. +func (pp ProtectionPolicy) MarshalJSON() ([]byte, error) { + pp.BackupManagementType = BackupManagementTypeProtectionPolicy + objectMap := make(map[string]interface{}) + if pp.ProtectedItemsCount != nil { + objectMap["protectedItemsCount"] = pp.ProtectedItemsCount + } + if pp.BackupManagementType != "" { + objectMap["backupManagementType"] = pp.BackupManagementType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareProtectionPolicy is the BasicProtectionPolicy implementation for ProtectionPolicy. +func (pp ProtectionPolicy) AsAzureFileShareProtectionPolicy() (*AzureFileShareProtectionPolicy, bool) { + return nil, false +} + +// AsAzureIaaSVMProtectionPolicy is the BasicProtectionPolicy implementation for ProtectionPolicy. +func (pp ProtectionPolicy) AsAzureIaaSVMProtectionPolicy() (*AzureIaaSVMProtectionPolicy, bool) { + return nil, false +} + +// AsAzureSQLProtectionPolicy is the BasicProtectionPolicy implementation for ProtectionPolicy. +func (pp ProtectionPolicy) AsAzureSQLProtectionPolicy() (*AzureSQLProtectionPolicy, bool) { + return nil, false +} + +// AsAzureVMWorkloadProtectionPolicy is the BasicProtectionPolicy implementation for ProtectionPolicy. +func (pp ProtectionPolicy) AsAzureVMWorkloadProtectionPolicy() (*AzureVMWorkloadProtectionPolicy, bool) { + return nil, false +} + +// AsGenericProtectionPolicy is the BasicProtectionPolicy implementation for ProtectionPolicy. +func (pp ProtectionPolicy) AsGenericProtectionPolicy() (*GenericProtectionPolicy, bool) { + return nil, false +} + +// AsMabProtectionPolicy is the BasicProtectionPolicy implementation for ProtectionPolicy. +func (pp ProtectionPolicy) AsMabProtectionPolicy() (*MabProtectionPolicy, bool) { + return nil, false +} + +// AsProtectionPolicy is the BasicProtectionPolicy implementation for ProtectionPolicy. +func (pp ProtectionPolicy) AsProtectionPolicy() (*ProtectionPolicy, bool) { + return &pp, true +} + +// AsBasicProtectionPolicy is the BasicProtectionPolicy implementation for ProtectionPolicy. +func (pp ProtectionPolicy) AsBasicProtectionPolicy() (BasicProtectionPolicy, bool) { + return &pp, true +} + +// ProtectionPolicyResource base class for backup policy. Workload-specific backup policies are derived from this +// class. +type ProtectionPolicyResource struct { + autorest.Response `json:"-"` + // Properties - ProtectionPolicyResource properties + Properties BasicProtectionPolicy `json:"properties,omitempty"` + // ID - Resource Id represents the complete path to the resource. + ID *string `json:"id,omitempty"` + // Name - Resource name associated with the resource. + Name *string `json:"name,omitempty"` + // Type - Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... + Type *string `json:"type,omitempty"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // ETag - Optional ETag. + ETag *string `json:"eTag,omitempty"` +} + +// MarshalJSON is the custom marshaler for ProtectionPolicyResource. +func (ppr ProtectionPolicyResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["properties"] = ppr.Properties + if ppr.ID != nil { + objectMap["id"] = ppr.ID + } + if ppr.Name != nil { + objectMap["name"] = ppr.Name + } + if ppr.Type != nil { + objectMap["type"] = ppr.Type + } + if ppr.Location != nil { + objectMap["location"] = ppr.Location + } + if ppr.Tags != nil { + objectMap["tags"] = ppr.Tags + } + if ppr.ETag != nil { + objectMap["eTag"] = ppr.ETag + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ProtectionPolicyResource struct. +func (ppr *ProtectionPolicyResource) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + properties, err := unmarshalBasicProtectionPolicy(*v) + if err != nil { + return err + } + ppr.Properties = properties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ppr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ppr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ppr.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + ppr.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + ppr.Tags = tags + } + case "eTag": + if v != nil { + var eTag string + err = json.Unmarshal(*v, &eTag) + if err != nil { + return err + } + ppr.ETag = &eTag + } + } + } + + return nil +} + +// BasicRecoveryPoint base class for backup copies. Workload-specific backup copies are derived from this class. +type BasicRecoveryPoint interface { + AsAzureFileShareRecoveryPoint() (*AzureFileShareRecoveryPoint, bool) + AsAzureWorkloadRecoveryPoint() (*AzureWorkloadRecoveryPoint, bool) + AsBasicAzureWorkloadRecoveryPoint() (BasicAzureWorkloadRecoveryPoint, bool) + AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) + AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) + AsBasicAzureWorkloadSAPHanaRecoveryPoint() (BasicAzureWorkloadSAPHanaRecoveryPoint, bool) + AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) + AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) + AsBasicAzureWorkloadSQLRecoveryPoint() (BasicAzureWorkloadSQLRecoveryPoint, bool) + AsGenericRecoveryPoint() (*GenericRecoveryPoint, bool) + AsIaasVMRecoveryPoint() (*IaasVMRecoveryPoint, bool) + AsRecoveryPoint() (*RecoveryPoint, bool) +} + +// RecoveryPoint base class for backup copies. Workload-specific backup copies are derived from this class. +type RecoveryPoint struct { + // ObjectType - Possible values include: 'ObjectTypeRecoveryPoint', 'ObjectTypeAzureFileShareRecoveryPoint', 'ObjectTypeAzureWorkloadRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaRecoveryPoint', 'ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSQLRecoveryPoint', 'ObjectTypeGenericRecoveryPoint', 'ObjectTypeIaasVMRecoveryPoint' + ObjectType ObjectTypeBasicRecoveryPoint `json:"objectType,omitempty"` +} + +func unmarshalBasicRecoveryPoint(body []byte) (BasicRecoveryPoint, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["objectType"] { + case string(ObjectTypeAzureFileShareRecoveryPoint): + var afsrp AzureFileShareRecoveryPoint + err := json.Unmarshal(body, &afsrp) + return afsrp, err + case string(ObjectTypeAzureWorkloadRecoveryPoint): + var awrp AzureWorkloadRecoveryPoint + err := json.Unmarshal(body, &awrp) + return awrp, err + case string(ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint): + var awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint + err := json.Unmarshal(body, &awshpitrp) + return awshpitrp, err + case string(ObjectTypeAzureWorkloadSAPHanaRecoveryPoint): + var awshrp AzureWorkloadSAPHanaRecoveryPoint + err := json.Unmarshal(body, &awshrp) + return awshrp, err + case string(ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint): + var awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint + err := json.Unmarshal(body, &awspitrp) + return awspitrp, err + case string(ObjectTypeAzureWorkloadSQLRecoveryPoint): + var awsrp AzureWorkloadSQLRecoveryPoint + err := json.Unmarshal(body, &awsrp) + return awsrp, err + case string(ObjectTypeGenericRecoveryPoint): + var grp GenericRecoveryPoint + err := json.Unmarshal(body, &grp) + return grp, err + case string(ObjectTypeIaasVMRecoveryPoint): + var ivrp IaasVMRecoveryPoint + err := json.Unmarshal(body, &ivrp) + return ivrp, err + default: + var rp RecoveryPoint + err := json.Unmarshal(body, &rp) + return rp, err + } +} +func unmarshalBasicRecoveryPointArray(body []byte) ([]BasicRecoveryPoint, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rpArray := make([]BasicRecoveryPoint, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rp, err := unmarshalBasicRecoveryPoint(*rawMessage) + if err != nil { + return nil, err + } + rpArray[index] = rp + } + return rpArray, nil +} + +// MarshalJSON is the custom marshaler for RecoveryPoint. +func (rp RecoveryPoint) MarshalJSON() ([]byte, error) { + rp.ObjectType = ObjectTypeRecoveryPoint + objectMap := make(map[string]interface{}) + if rp.ObjectType != "" { + objectMap["objectType"] = rp.ObjectType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. +func (rp RecoveryPoint) AsAzureFileShareRecoveryPoint() (*AzureFileShareRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. +func (rp RecoveryPoint) AsAzureWorkloadRecoveryPoint() (*AzureWorkloadRecoveryPoint, bool) { + return nil, false +} + +// AsBasicAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. +func (rp RecoveryPoint) AsBasicAzureWorkloadRecoveryPoint() (BasicAzureWorkloadRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. +func (rp RecoveryPoint) AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadSAPHanaRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. +func (rp RecoveryPoint) AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSAPHanaRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. +func (rp RecoveryPoint) AsBasicAzureWorkloadSAPHanaRecoveryPoint() (BasicAzureWorkloadSAPHanaRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadSQLPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. +func (rp RecoveryPoint) AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. +func (rp RecoveryPoint) AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. +func (rp RecoveryPoint) AsBasicAzureWorkloadSQLRecoveryPoint() (BasicAzureWorkloadSQLRecoveryPoint, bool) { + return nil, false +} + +// AsGenericRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. +func (rp RecoveryPoint) AsGenericRecoveryPoint() (*GenericRecoveryPoint, bool) { + return nil, false +} + +// AsIaasVMRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. +func (rp RecoveryPoint) AsIaasVMRecoveryPoint() (*IaasVMRecoveryPoint, bool) { + return nil, false +} + +// AsRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. +func (rp RecoveryPoint) AsRecoveryPoint() (*RecoveryPoint, bool) { + return &rp, true +} + +// AsBasicRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. +func (rp RecoveryPoint) AsBasicRecoveryPoint() (BasicRecoveryPoint, bool) { + return &rp, true +} + +// RecoveryPointResource base class for backup copies. Workload-specific backup copies are derived from this class. +type RecoveryPointResource struct { + autorest.Response `json:"-"` + // Properties - RecoveryPointResource properties + Properties BasicRecoveryPoint `json:"properties,omitempty"` + // ID - Resource Id represents the complete path to the resource. + ID *string `json:"id,omitempty"` + // Name - Resource name associated with the resource. + Name *string `json:"name,omitempty"` + // Type - Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... + Type *string `json:"type,omitempty"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // ETag - Optional ETag. + ETag *string `json:"eTag,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryPointResource. +func (rpr RecoveryPointResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["properties"] = rpr.Properties + if rpr.ID != nil { + objectMap["id"] = rpr.ID + } + if rpr.Name != nil { + objectMap["name"] = rpr.Name + } + if rpr.Type != nil { + objectMap["type"] = rpr.Type + } + if rpr.Location != nil { + objectMap["location"] = rpr.Location + } + if rpr.Tags != nil { + objectMap["tags"] = rpr.Tags + } + if rpr.ETag != nil { + objectMap["eTag"] = rpr.ETag + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for RecoveryPointResource struct. +func (rpr *RecoveryPointResource) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + properties, err := unmarshalBasicRecoveryPoint(*v) + if err != nil { + return err + } + rpr.Properties = properties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + rpr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + rpr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + rpr.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + rpr.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + rpr.Tags = tags + } + case "eTag": + if v != nil { + var eTag string + err = json.Unmarshal(*v, &eTag) + if err != nil { + return err + } + rpr.ETag = &eTag + } + } + } + + return nil +} + +// RecoveryPointResourceList list of RecoveryPoint resources +type RecoveryPointResourceList struct { + autorest.Response `json:"-"` + // Value - List of resources. + Value *[]RecoveryPointResource `json:"value,omitempty"` + // NextLink - The uri to fetch the next page of resources. Call ListNext() fetches next page of resources. + NextLink *string `json:"nextLink,omitempty"` +} + +// RecoveryPointResourceListIterator provides access to a complete listing of RecoveryPointResource values. +type RecoveryPointResourceListIterator struct { + i int + page RecoveryPointResourceListPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *RecoveryPointResourceListIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter RecoveryPointResourceListIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter RecoveryPointResourceListIterator) Response() RecoveryPointResourceList { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter RecoveryPointResourceListIterator) Value() RecoveryPointResource { + if !iter.page.NotDone() { + return RecoveryPointResource{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (rprl RecoveryPointResourceList) IsEmpty() bool { + return rprl.Value == nil || len(*rprl.Value) == 0 +} + +// recoveryPointResourceListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (rprl RecoveryPointResourceList) recoveryPointResourceListPreparer() (*http.Request, error) { + if rprl.NextLink == nil || len(to.String(rprl.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(rprl.NextLink))) +} + +// RecoveryPointResourceListPage contains a page of RecoveryPointResource values. +type RecoveryPointResourceListPage struct { + fn func(RecoveryPointResourceList) (RecoveryPointResourceList, error) + rprl RecoveryPointResourceList +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *RecoveryPointResourceListPage) Next() error { + next, err := page.fn(page.rprl) + if err != nil { + return err + } + page.rprl = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page RecoveryPointResourceListPage) NotDone() bool { + return !page.rprl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page RecoveryPointResourceListPage) Response() RecoveryPointResourceList { + return page.rprl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page RecoveryPointResourceListPage) Values() []RecoveryPointResource { + if page.rprl.IsEmpty() { + return nil + } + return *page.rprl.Value +} + +// RecoveryPointTierInformation recovery point tier information. +type RecoveryPointTierInformation struct { + // Type - Recovery point tier type. Possible values include: 'RecoveryPointTierTypeInvalid', 'RecoveryPointTierTypeInstantRP', 'RecoveryPointTierTypeHardenedRP' + Type RecoveryPointTierType `json:"type,omitempty"` + // Status - Recovery point tier status. Possible values include: 'RecoveryPointTierStatusInvalid', 'RecoveryPointTierStatusValid', 'RecoveryPointTierStatusDisabled', 'RecoveryPointTierStatusDeleted' + Status RecoveryPointTierStatus `json:"status,omitempty"` +} + +// BasicRequest base class for backup request. Workload-specific backup requests are derived from this class. +type BasicRequest interface { + AsAzureFileShareBackupRequest() (*AzureFileShareBackupRequest, bool) + AsAzureWorkloadBackupRequest() (*AzureWorkloadBackupRequest, bool) + AsIaasVMBackupRequest() (*IaasVMBackupRequest, bool) + AsRequest() (*Request, bool) +} + +// Request base class for backup request. Workload-specific backup requests are derived from this class. +type Request struct { + // ObjectType - Possible values include: 'ObjectTypeBackupRequest', 'ObjectTypeAzureFileShareBackupRequest', 'ObjectTypeAzureWorkloadBackupRequest', 'ObjectTypeIaasVMBackupRequest' + ObjectType ObjectType `json:"objectType,omitempty"` +} + +func unmarshalBasicRequest(body []byte) (BasicRequest, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["objectType"] { + case string(ObjectTypeAzureFileShareBackupRequest): + var afsbr AzureFileShareBackupRequest + err := json.Unmarshal(body, &afsbr) + return afsbr, err + case string(ObjectTypeAzureWorkloadBackupRequest): + var awbr AzureWorkloadBackupRequest + err := json.Unmarshal(body, &awbr) + return awbr, err + case string(ObjectTypeIaasVMBackupRequest): + var ivbr IaasVMBackupRequest + err := json.Unmarshal(body, &ivbr) + return ivbr, err + default: + var r Request + err := json.Unmarshal(body, &r) + return r, err + } +} +func unmarshalBasicRequestArray(body []byte) ([]BasicRequest, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rArray := make([]BasicRequest, len(rawMessages)) + + for index, rawMessage := range rawMessages { + r, err := unmarshalBasicRequest(*rawMessage) + if err != nil { + return nil, err + } + rArray[index] = r + } + return rArray, nil +} + +// MarshalJSON is the custom marshaler for Request. +func (r Request) MarshalJSON() ([]byte, error) { + r.ObjectType = ObjectTypeBackupRequest + objectMap := make(map[string]interface{}) + if r.ObjectType != "" { + objectMap["objectType"] = r.ObjectType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareBackupRequest is the BasicRequest implementation for Request. +func (r Request) AsAzureFileShareBackupRequest() (*AzureFileShareBackupRequest, bool) { + return nil, false +} + +// AsAzureWorkloadBackupRequest is the BasicRequest implementation for Request. +func (r Request) AsAzureWorkloadBackupRequest() (*AzureWorkloadBackupRequest, bool) { + return nil, false +} + +// AsIaasVMBackupRequest is the BasicRequest implementation for Request. +func (r Request) AsIaasVMBackupRequest() (*IaasVMBackupRequest, bool) { + return nil, false +} + +// AsRequest is the BasicRequest implementation for Request. +func (r Request) AsRequest() (*Request, bool) { + return &r, true +} + +// AsBasicRequest is the BasicRequest implementation for Request. +func (r Request) AsBasicRequest() (BasicRequest, bool) { + return &r, true +} + +// RequestResource base class for backup request. Workload-specific backup requests are derived from this class. +type RequestResource struct { + // Properties - BackupRequestResource properties + Properties BasicRequest `json:"properties,omitempty"` + // ID - Resource Id represents the complete path to the resource. + ID *string `json:"id,omitempty"` + // Name - Resource name associated with the resource. + Name *string `json:"name,omitempty"` + // Type - Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... + Type *string `json:"type,omitempty"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // ETag - Optional ETag. + ETag *string `json:"eTag,omitempty"` +} + +// MarshalJSON is the custom marshaler for RequestResource. +func (rr RequestResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["properties"] = rr.Properties + if rr.ID != nil { + objectMap["id"] = rr.ID + } + if rr.Name != nil { + objectMap["name"] = rr.Name + } + if rr.Type != nil { + objectMap["type"] = rr.Type + } + if rr.Location != nil { + objectMap["location"] = rr.Location + } + if rr.Tags != nil { + objectMap["tags"] = rr.Tags + } + if rr.ETag != nil { + objectMap["eTag"] = rr.ETag + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for RequestResource struct. +func (rr *RequestResource) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + properties, err := unmarshalBasicRequest(*v) + if err != nil { + return err + } + rr.Properties = properties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + rr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + rr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + rr.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + rr.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + rr.Tags = tags + } + case "eTag": + if v != nil { + var eTag string + err = json.Unmarshal(*v, &eTag) + if err != nil { + return err + } + rr.ETag = &eTag + } + } + } + + return nil +} + +// Resource ARM Resource. +type Resource struct { + // ID - Resource Id represents the complete path to the resource. + ID *string `json:"id,omitempty"` + // Name - Resource name associated with the resource. + Name *string `json:"name,omitempty"` + // Type - Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... + Type *string `json:"type,omitempty"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // ETag - Optional ETag. + ETag *string `json:"eTag,omitempty"` +} + +// MarshalJSON is the custom marshaler for Resource. +func (r Resource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if r.ID != nil { + objectMap["id"] = r.ID + } + if r.Name != nil { + objectMap["name"] = r.Name + } + if r.Type != nil { + objectMap["type"] = r.Type + } + if r.Location != nil { + objectMap["location"] = r.Location + } + if r.Tags != nil { + objectMap["tags"] = r.Tags + } + if r.ETag != nil { + objectMap["eTag"] = r.ETag + } + return json.Marshal(objectMap) +} + +// ResourceConfig the resource storage details. +type ResourceConfig struct { + // StorageModelType - Storage type. Possible values include: 'StorageTypeInvalid', 'StorageTypeGeoRedundant', 'StorageTypeLocallyRedundant' + StorageModelType StorageType `json:"storageModelType,omitempty"` + // StorageType - Storage type. Possible values include: 'StorageTypeInvalid', 'StorageTypeGeoRedundant', 'StorageTypeLocallyRedundant' + StorageType StorageType `json:"storageType,omitempty"` + // StorageTypeState - Locked or Unlocked. Once a machine is registered against a resource, the storageTypeState is always Locked. Possible values include: 'StorageTypeStateInvalid', 'StorageTypeStateLocked', 'StorageTypeStateUnlocked' + StorageTypeState StorageTypeState `json:"storageTypeState,omitempty"` +} + +// ResourceConfigResource the resource storage details. +type ResourceConfigResource struct { + autorest.Response `json:"-"` + // Properties - BackupResourceConfigResource properties + Properties *ResourceConfig `json:"properties,omitempty"` + // ID - Resource Id represents the complete path to the resource. + ID *string `json:"id,omitempty"` + // Name - Resource name associated with the resource. + Name *string `json:"name,omitempty"` + // Type - Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... + Type *string `json:"type,omitempty"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // ETag - Optional ETag. + ETag *string `json:"eTag,omitempty"` +} + +// MarshalJSON is the custom marshaler for ResourceConfigResource. +func (rcr ResourceConfigResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rcr.Properties != nil { + objectMap["properties"] = rcr.Properties + } + if rcr.ID != nil { + objectMap["id"] = rcr.ID + } + if rcr.Name != nil { + objectMap["name"] = rcr.Name + } + if rcr.Type != nil { + objectMap["type"] = rcr.Type + } + if rcr.Location != nil { + objectMap["location"] = rcr.Location + } + if rcr.Tags != nil { + objectMap["tags"] = rcr.Tags + } + if rcr.ETag != nil { + objectMap["eTag"] = rcr.ETag + } + return json.Marshal(objectMap) +} + +// ResourceList base for all lists of resources. +type ResourceList struct { + // NextLink - The uri to fetch the next page of resources. Call ListNext() fetches next page of resources. + NextLink *string `json:"nextLink,omitempty"` +} + +// ResourceVaultConfig backup resource vault config details. +type ResourceVaultConfig struct { + // StorageModelType - Storage type. Possible values include: 'StorageTypeInvalid', 'StorageTypeGeoRedundant', 'StorageTypeLocallyRedundant' + StorageModelType StorageType `json:"storageModelType,omitempty"` + // StorageType - Storage type. Possible values include: 'StorageTypeInvalid', 'StorageTypeGeoRedundant', 'StorageTypeLocallyRedundant' + StorageType StorageType `json:"storageType,omitempty"` + // StorageTypeState - Locked or Unlocked. Once a machine is registered against a resource, the storageTypeState is always Locked. Possible values include: 'StorageTypeStateInvalid', 'StorageTypeStateLocked', 'StorageTypeStateUnlocked' + StorageTypeState StorageTypeState `json:"storageTypeState,omitempty"` + // EnhancedSecurityState - Enabled or Disabled. Possible values include: 'EnhancedSecurityStateInvalid', 'EnhancedSecurityStateEnabled', 'EnhancedSecurityStateDisabled' + EnhancedSecurityState EnhancedSecurityState `json:"enhancedSecurityState,omitempty"` +} + +// ResourceVaultConfigResource backup resource vault config details. +type ResourceVaultConfigResource struct { + autorest.Response `json:"-"` + // Properties - BackupResourceVaultConfigResource properties + Properties *ResourceVaultConfig `json:"properties,omitempty"` + // ID - Resource Id represents the complete path to the resource. + ID *string `json:"id,omitempty"` + // Name - Resource name associated with the resource. + Name *string `json:"name,omitempty"` + // Type - Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... + Type *string `json:"type,omitempty"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // ETag - Optional ETag. + ETag *string `json:"eTag,omitempty"` +} + +// MarshalJSON is the custom marshaler for ResourceVaultConfigResource. +func (rvcr ResourceVaultConfigResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rvcr.Properties != nil { + objectMap["properties"] = rvcr.Properties + } + if rvcr.ID != nil { + objectMap["id"] = rvcr.ID + } + if rvcr.Name != nil { + objectMap["name"] = rvcr.Name + } + if rvcr.Type != nil { + objectMap["type"] = rvcr.Type + } + if rvcr.Location != nil { + objectMap["location"] = rvcr.Location + } + if rvcr.Tags != nil { + objectMap["tags"] = rvcr.Tags + } + if rvcr.ETag != nil { + objectMap["eTag"] = rvcr.ETag + } + return json.Marshal(objectMap) +} + +// RestoreFileSpecs restore file specs like file path, type and target folder path info. +type RestoreFileSpecs struct { + // Path - Source File/Folder path + Path *string `json:"path,omitempty"` + // FileSpecType - Indicates what the Path variable stands for + FileSpecType *string `json:"fileSpecType,omitempty"` + // TargetFolderPath - Destination folder path in target FileShare + TargetFolderPath *string `json:"targetFolderPath,omitempty"` +} + +// BasicRestoreRequest base class for restore request. Workload-specific restore requests are derived from this class. +type BasicRestoreRequest interface { + AsAzureFileShareRestoreRequest() (*AzureFileShareRestoreRequest, bool) + AsAzureWorkloadRestoreRequest() (*AzureWorkloadRestoreRequest, bool) + AsBasicAzureWorkloadRestoreRequest() (BasicAzureWorkloadRestoreRequest, bool) + AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) + AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) + AsBasicAzureWorkloadSAPHanaRestoreRequest() (BasicAzureWorkloadSAPHanaRestoreRequest, bool) + AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) + AsAzureWorkloadSQLRestoreRequest() (*AzureWorkloadSQLRestoreRequest, bool) + AsBasicAzureWorkloadSQLRestoreRequest() (BasicAzureWorkloadSQLRestoreRequest, bool) + AsIaasVMRestoreRequest() (*IaasVMRestoreRequest, bool) + AsRestoreRequest() (*RestoreRequest, bool) +} + +// RestoreRequest base class for restore request. Workload-specific restore requests are derived from this class. +type RestoreRequest struct { + // ObjectType - Possible values include: 'ObjectTypeRestoreRequest', 'ObjectTypeAzureFileShareRestoreRequest', 'ObjectTypeAzureWorkloadRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaRestoreRequest', 'ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSQLRestoreRequest', 'ObjectTypeIaasVMRestoreRequest' + ObjectType ObjectTypeBasicRestoreRequest `json:"objectType,omitempty"` +} + +func unmarshalBasicRestoreRequest(body []byte) (BasicRestoreRequest, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["objectType"] { + case string(ObjectTypeAzureFileShareRestoreRequest): + var afsrr AzureFileShareRestoreRequest + err := json.Unmarshal(body, &afsrr) + return afsrr, err + case string(ObjectTypeAzureWorkloadRestoreRequest): + var awrr AzureWorkloadRestoreRequest + err := json.Unmarshal(body, &awrr) + return awrr, err + case string(ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest): + var awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest + err := json.Unmarshal(body, &awshpitrr) + return awshpitrr, err + case string(ObjectTypeAzureWorkloadSAPHanaRestoreRequest): + var awshrr AzureWorkloadSAPHanaRestoreRequest + err := json.Unmarshal(body, &awshrr) + return awshrr, err + case string(ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest): + var awspitrr AzureWorkloadSQLPointInTimeRestoreRequest + err := json.Unmarshal(body, &awspitrr) + return awspitrr, err + case string(ObjectTypeAzureWorkloadSQLRestoreRequest): + var awsrr AzureWorkloadSQLRestoreRequest + err := json.Unmarshal(body, &awsrr) + return awsrr, err + case string(ObjectTypeIaasVMRestoreRequest): + var ivrr IaasVMRestoreRequest + err := json.Unmarshal(body, &ivrr) + return ivrr, err + default: + var rr RestoreRequest + err := json.Unmarshal(body, &rr) + return rr, err + } +} +func unmarshalBasicRestoreRequestArray(body []byte) ([]BasicRestoreRequest, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rrArray := make([]BasicRestoreRequest, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rr, err := unmarshalBasicRestoreRequest(*rawMessage) + if err != nil { + return nil, err + } + rrArray[index] = rr + } + return rrArray, nil +} + +// MarshalJSON is the custom marshaler for RestoreRequest. +func (rr RestoreRequest) MarshalJSON() ([]byte, error) { + rr.ObjectType = ObjectTypeRestoreRequest + objectMap := make(map[string]interface{}) + if rr.ObjectType != "" { + objectMap["objectType"] = rr.ObjectType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest. +func (rr RestoreRequest) AsAzureFileShareRestoreRequest() (*AzureFileShareRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest. +func (rr RestoreRequest) AsAzureWorkloadRestoreRequest() (*AzureWorkloadRestoreRequest, bool) { + return nil, false +} + +// AsBasicAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest. +func (rr RestoreRequest) AsBasicAzureWorkloadRestoreRequest() (BasicAzureWorkloadRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSAPHanaPointInTimeRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest. +func (rr RestoreRequest) AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest. +func (rr RestoreRequest) AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest. +func (rr RestoreRequest) AsBasicAzureWorkloadSAPHanaRestoreRequest() (BasicAzureWorkloadSAPHanaRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSQLPointInTimeRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest. +func (rr RestoreRequest) AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest. +func (rr RestoreRequest) AsAzureWorkloadSQLRestoreRequest() (*AzureWorkloadSQLRestoreRequest, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest. +func (rr RestoreRequest) AsBasicAzureWorkloadSQLRestoreRequest() (BasicAzureWorkloadSQLRestoreRequest, bool) { + return nil, false +} + +// AsIaasVMRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest. +func (rr RestoreRequest) AsIaasVMRestoreRequest() (*IaasVMRestoreRequest, bool) { + return nil, false +} + +// AsRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest. +func (rr RestoreRequest) AsRestoreRequest() (*RestoreRequest, bool) { + return &rr, true +} + +// AsBasicRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest. +func (rr RestoreRequest) AsBasicRestoreRequest() (BasicRestoreRequest, bool) { + return &rr, true +} + +// RestoreRequestResource base class for restore request. Workload-specific restore requests are derived from this +// class. +type RestoreRequestResource struct { + // Properties - RestoreRequestResource properties + Properties BasicRestoreRequest `json:"properties,omitempty"` + // ID - Resource Id represents the complete path to the resource. + ID *string `json:"id,omitempty"` + // Name - Resource name associated with the resource. + Name *string `json:"name,omitempty"` + // Type - Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... + Type *string `json:"type,omitempty"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // ETag - Optional ETag. + ETag *string `json:"eTag,omitempty"` +} + +// MarshalJSON is the custom marshaler for RestoreRequestResource. +func (rrr RestoreRequestResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["properties"] = rrr.Properties + if rrr.ID != nil { + objectMap["id"] = rrr.ID + } + if rrr.Name != nil { + objectMap["name"] = rrr.Name + } + if rrr.Type != nil { + objectMap["type"] = rrr.Type + } + if rrr.Location != nil { + objectMap["location"] = rrr.Location + } + if rrr.Tags != nil { + objectMap["tags"] = rrr.Tags + } + if rrr.ETag != nil { + objectMap["eTag"] = rrr.ETag + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for RestoreRequestResource struct. +func (rrr *RestoreRequestResource) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + properties, err := unmarshalBasicRestoreRequest(*v) + if err != nil { + return err + } + rrr.Properties = properties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + rrr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + rrr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + rrr.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + rrr.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + rrr.Tags = tags + } + case "eTag": + if v != nil { + var eTag string + err = json.Unmarshal(*v, &eTag) + if err != nil { + return err + } + rrr.ETag = &eTag + } + } + } + + return nil +} + +// RetentionDuration retention duration. +type RetentionDuration struct { + // Count - Count of duration types. Retention duration is obtained by the counting the duration type Count times. + // For example, when Count = 3 and DurationType = Weeks, retention duration will be three weeks. + Count *int32 `json:"count,omitempty"` + // DurationType - Retention duration type of retention policy. Possible values include: 'RetentionDurationTypeInvalid', 'RetentionDurationTypeDays', 'RetentionDurationTypeWeeks', 'RetentionDurationTypeMonths', 'RetentionDurationTypeYears' + DurationType RetentionDurationType `json:"durationType,omitempty"` +} + +// BasicRetentionPolicy base class for retention policy. +type BasicRetentionPolicy interface { + AsLongTermRetentionPolicy() (*LongTermRetentionPolicy, bool) + AsSimpleRetentionPolicy() (*SimpleRetentionPolicy, bool) + AsRetentionPolicy() (*RetentionPolicy, bool) +} + +// RetentionPolicy base class for retention policy. +type RetentionPolicy struct { + // RetentionPolicyType - Possible values include: 'RetentionPolicyTypeRetentionPolicy', 'RetentionPolicyTypeLongTermRetentionPolicy', 'RetentionPolicyTypeSimpleRetentionPolicy' + RetentionPolicyType RetentionPolicyType `json:"retentionPolicyType,omitempty"` +} + +func unmarshalBasicRetentionPolicy(body []byte) (BasicRetentionPolicy, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["retentionPolicyType"] { + case string(RetentionPolicyTypeLongTermRetentionPolicy): + var ltrp LongTermRetentionPolicy + err := json.Unmarshal(body, <rp) + return ltrp, err + case string(RetentionPolicyTypeSimpleRetentionPolicy): + var srp SimpleRetentionPolicy + err := json.Unmarshal(body, &srp) + return srp, err + default: + var rp RetentionPolicy + err := json.Unmarshal(body, &rp) + return rp, err + } +} +func unmarshalBasicRetentionPolicyArray(body []byte) ([]BasicRetentionPolicy, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rpArray := make([]BasicRetentionPolicy, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rp, err := unmarshalBasicRetentionPolicy(*rawMessage) + if err != nil { + return nil, err + } + rpArray[index] = rp + } + return rpArray, nil +} + +// MarshalJSON is the custom marshaler for RetentionPolicy. +func (rp RetentionPolicy) MarshalJSON() ([]byte, error) { + rp.RetentionPolicyType = RetentionPolicyTypeRetentionPolicy + objectMap := make(map[string]interface{}) + if rp.RetentionPolicyType != "" { + objectMap["retentionPolicyType"] = rp.RetentionPolicyType + } + return json.Marshal(objectMap) +} + +// AsLongTermRetentionPolicy is the BasicRetentionPolicy implementation for RetentionPolicy. +func (rp RetentionPolicy) AsLongTermRetentionPolicy() (*LongTermRetentionPolicy, bool) { + return nil, false +} + +// AsSimpleRetentionPolicy is the BasicRetentionPolicy implementation for RetentionPolicy. +func (rp RetentionPolicy) AsSimpleRetentionPolicy() (*SimpleRetentionPolicy, bool) { + return nil, false +} + +// AsRetentionPolicy is the BasicRetentionPolicy implementation for RetentionPolicy. +func (rp RetentionPolicy) AsRetentionPolicy() (*RetentionPolicy, bool) { + return &rp, true +} + +// AsBasicRetentionPolicy is the BasicRetentionPolicy implementation for RetentionPolicy. +func (rp RetentionPolicy) AsBasicRetentionPolicy() (BasicRetentionPolicy, bool) { + return &rp, true +} + +// BasicSchedulePolicy base class for backup schedule. +type BasicSchedulePolicy interface { + AsLogSchedulePolicy() (*LogSchedulePolicy, bool) + AsLongTermSchedulePolicy() (*LongTermSchedulePolicy, bool) + AsSimpleSchedulePolicy() (*SimpleSchedulePolicy, bool) + AsSchedulePolicy() (*SchedulePolicy, bool) +} + +// SchedulePolicy base class for backup schedule. +type SchedulePolicy struct { + // SchedulePolicyType - Possible values include: 'SchedulePolicyTypeSchedulePolicy', 'SchedulePolicyTypeLogSchedulePolicy', 'SchedulePolicyTypeLongTermSchedulePolicy', 'SchedulePolicyTypeSimpleSchedulePolicy' + SchedulePolicyType SchedulePolicyType `json:"schedulePolicyType,omitempty"` +} + +func unmarshalBasicSchedulePolicy(body []byte) (BasicSchedulePolicy, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["schedulePolicyType"] { + case string(SchedulePolicyTypeLogSchedulePolicy): + var lsp LogSchedulePolicy + err := json.Unmarshal(body, &lsp) + return lsp, err + case string(SchedulePolicyTypeLongTermSchedulePolicy): + var ltsp LongTermSchedulePolicy + err := json.Unmarshal(body, <sp) + return ltsp, err + case string(SchedulePolicyTypeSimpleSchedulePolicy): + var ssp SimpleSchedulePolicy + err := json.Unmarshal(body, &ssp) + return ssp, err + default: + var sp SchedulePolicy + err := json.Unmarshal(body, &sp) + return sp, err + } +} +func unmarshalBasicSchedulePolicyArray(body []byte) ([]BasicSchedulePolicy, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + spArray := make([]BasicSchedulePolicy, len(rawMessages)) + + for index, rawMessage := range rawMessages { + sp, err := unmarshalBasicSchedulePolicy(*rawMessage) + if err != nil { + return nil, err + } + spArray[index] = sp + } + return spArray, nil +} + +// MarshalJSON is the custom marshaler for SchedulePolicy. +func (sp SchedulePolicy) MarshalJSON() ([]byte, error) { + sp.SchedulePolicyType = SchedulePolicyTypeSchedulePolicy + objectMap := make(map[string]interface{}) + if sp.SchedulePolicyType != "" { + objectMap["schedulePolicyType"] = sp.SchedulePolicyType + } + return json.Marshal(objectMap) +} + +// AsLogSchedulePolicy is the BasicSchedulePolicy implementation for SchedulePolicy. +func (sp SchedulePolicy) AsLogSchedulePolicy() (*LogSchedulePolicy, bool) { + return nil, false +} + +// AsLongTermSchedulePolicy is the BasicSchedulePolicy implementation for SchedulePolicy. +func (sp SchedulePolicy) AsLongTermSchedulePolicy() (*LongTermSchedulePolicy, bool) { + return nil, false +} + +// AsSimpleSchedulePolicy is the BasicSchedulePolicy implementation for SchedulePolicy. +func (sp SchedulePolicy) AsSimpleSchedulePolicy() (*SimpleSchedulePolicy, bool) { + return nil, false +} + +// AsSchedulePolicy is the BasicSchedulePolicy implementation for SchedulePolicy. +func (sp SchedulePolicy) AsSchedulePolicy() (*SchedulePolicy, bool) { + return &sp, true +} + +// AsBasicSchedulePolicy is the BasicSchedulePolicy implementation for SchedulePolicy. +func (sp SchedulePolicy) AsBasicSchedulePolicy() (BasicSchedulePolicy, bool) { + return &sp, true +} + +// Settings common settings field for backup management +type Settings struct { + // TimeZone - TimeZone optional input as string. For example: TimeZone = "Pacific Standard Time". + TimeZone *string `json:"timeZone,omitempty"` + // Issqlcompression - SQL compression flag + Issqlcompression *bool `json:"issqlcompression,omitempty"` + // IsCompression - Workload compression flag. This has been added so that 'isSqlCompression' + // will be deprecated once clients upgrade to consider this flag. + IsCompression *bool `json:"isCompression,omitempty"` +} + +// SimpleRetentionPolicy simple policy retention. +type SimpleRetentionPolicy struct { + // RetentionDuration - Retention duration of the protection policy. + RetentionDuration *RetentionDuration `json:"retentionDuration,omitempty"` + // RetentionPolicyType - Possible values include: 'RetentionPolicyTypeRetentionPolicy', 'RetentionPolicyTypeLongTermRetentionPolicy', 'RetentionPolicyTypeSimpleRetentionPolicy' + RetentionPolicyType RetentionPolicyType `json:"retentionPolicyType,omitempty"` +} + +// MarshalJSON is the custom marshaler for SimpleRetentionPolicy. +func (srp SimpleRetentionPolicy) MarshalJSON() ([]byte, error) { + srp.RetentionPolicyType = RetentionPolicyTypeSimpleRetentionPolicy + objectMap := make(map[string]interface{}) + if srp.RetentionDuration != nil { + objectMap["retentionDuration"] = srp.RetentionDuration + } + if srp.RetentionPolicyType != "" { + objectMap["retentionPolicyType"] = srp.RetentionPolicyType + } + return json.Marshal(objectMap) +} + +// AsLongTermRetentionPolicy is the BasicRetentionPolicy implementation for SimpleRetentionPolicy. +func (srp SimpleRetentionPolicy) AsLongTermRetentionPolicy() (*LongTermRetentionPolicy, bool) { + return nil, false +} + +// AsSimpleRetentionPolicy is the BasicRetentionPolicy implementation for SimpleRetentionPolicy. +func (srp SimpleRetentionPolicy) AsSimpleRetentionPolicy() (*SimpleRetentionPolicy, bool) { + return &srp, true +} + +// AsRetentionPolicy is the BasicRetentionPolicy implementation for SimpleRetentionPolicy. +func (srp SimpleRetentionPolicy) AsRetentionPolicy() (*RetentionPolicy, bool) { + return nil, false +} + +// AsBasicRetentionPolicy is the BasicRetentionPolicy implementation for SimpleRetentionPolicy. +func (srp SimpleRetentionPolicy) AsBasicRetentionPolicy() (BasicRetentionPolicy, bool) { + return &srp, true +} + +// SimpleSchedulePolicy simple policy schedule. +type SimpleSchedulePolicy struct { + // ScheduleRunFrequency - Frequency of the schedule operation of this policy. Possible values include: 'ScheduleRunTypeInvalid', 'ScheduleRunTypeDaily', 'ScheduleRunTypeWeekly' + ScheduleRunFrequency ScheduleRunType `json:"scheduleRunFrequency,omitempty"` + // ScheduleRunDays - List of days of week this schedule has to be run. + ScheduleRunDays *[]DayOfWeek `json:"scheduleRunDays,omitempty"` + // ScheduleRunTimes - List of times of day this schedule has to be run. + ScheduleRunTimes *[]date.Time `json:"scheduleRunTimes,omitempty"` + // ScheduleWeeklyFrequency - At every number weeks this schedule has to be run. + ScheduleWeeklyFrequency *int32 `json:"scheduleWeeklyFrequency,omitempty"` + // SchedulePolicyType - Possible values include: 'SchedulePolicyTypeSchedulePolicy', 'SchedulePolicyTypeLogSchedulePolicy', 'SchedulePolicyTypeLongTermSchedulePolicy', 'SchedulePolicyTypeSimpleSchedulePolicy' + SchedulePolicyType SchedulePolicyType `json:"schedulePolicyType,omitempty"` +} + +// MarshalJSON is the custom marshaler for SimpleSchedulePolicy. +func (ssp SimpleSchedulePolicy) MarshalJSON() ([]byte, error) { + ssp.SchedulePolicyType = SchedulePolicyTypeSimpleSchedulePolicy + objectMap := make(map[string]interface{}) + if ssp.ScheduleRunFrequency != "" { + objectMap["scheduleRunFrequency"] = ssp.ScheduleRunFrequency + } + if ssp.ScheduleRunDays != nil { + objectMap["scheduleRunDays"] = ssp.ScheduleRunDays + } + if ssp.ScheduleRunTimes != nil { + objectMap["scheduleRunTimes"] = ssp.ScheduleRunTimes + } + if ssp.ScheduleWeeklyFrequency != nil { + objectMap["scheduleWeeklyFrequency"] = ssp.ScheduleWeeklyFrequency + } + if ssp.SchedulePolicyType != "" { + objectMap["schedulePolicyType"] = ssp.SchedulePolicyType + } + return json.Marshal(objectMap) +} + +// AsLogSchedulePolicy is the BasicSchedulePolicy implementation for SimpleSchedulePolicy. +func (ssp SimpleSchedulePolicy) AsLogSchedulePolicy() (*LogSchedulePolicy, bool) { + return nil, false +} + +// AsLongTermSchedulePolicy is the BasicSchedulePolicy implementation for SimpleSchedulePolicy. +func (ssp SimpleSchedulePolicy) AsLongTermSchedulePolicy() (*LongTermSchedulePolicy, bool) { + return nil, false +} + +// AsSimpleSchedulePolicy is the BasicSchedulePolicy implementation for SimpleSchedulePolicy. +func (ssp SimpleSchedulePolicy) AsSimpleSchedulePolicy() (*SimpleSchedulePolicy, bool) { + return &ssp, true +} + +// AsSchedulePolicy is the BasicSchedulePolicy implementation for SimpleSchedulePolicy. +func (ssp SimpleSchedulePolicy) AsSchedulePolicy() (*SchedulePolicy, bool) { + return nil, false +} + +// AsBasicSchedulePolicy is the BasicSchedulePolicy implementation for SimpleSchedulePolicy. +func (ssp SimpleSchedulePolicy) AsBasicSchedulePolicy() (BasicSchedulePolicy, bool) { + return &ssp, true +} + +// SQLDataDirectory sQLDataDirectory info +type SQLDataDirectory struct { + // Type - Type of data directory mapping. Possible values include: 'SQLDataDirectoryTypeInvalid', 'SQLDataDirectoryTypeData', 'SQLDataDirectoryTypeLog' + Type SQLDataDirectoryType `json:"type,omitempty"` + // Path - File path + Path *string `json:"path,omitempty"` + // LogicalName - Logical name of the file + LogicalName *string `json:"logicalName,omitempty"` +} + +// SQLDataDirectoryMapping encapsulates information regarding data directory +type SQLDataDirectoryMapping struct { + // MappingType - Type of data directory mapping. Possible values include: 'SQLDataDirectoryTypeInvalid', 'SQLDataDirectoryTypeData', 'SQLDataDirectoryTypeLog' + MappingType SQLDataDirectoryType `json:"mappingType,omitempty"` + // SourceLogicalName - Restore source logical name path + SourceLogicalName *string `json:"sourceLogicalName,omitempty"` + // SourcePath - Restore source path + SourcePath *string `json:"sourcePath,omitempty"` + // TargetPath - Target path + TargetPath *string `json:"targetPath,omitempty"` +} + +// SubProtectionPolicy sub-protection policy which includes schedule and retention +type SubProtectionPolicy struct { + // PolicyType - Type of backup policy type + PolicyType *string `json:"policyType,omitempty"` + // SchedulePolicy - Backup schedule specified as part of backup policy. + SchedulePolicy BasicSchedulePolicy `json:"schedulePolicy,omitempty"` + // RetentionPolicy - Retention policy with the details on backup copy retention ranges. + RetentionPolicy BasicRetentionPolicy `json:"retentionPolicy,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for SubProtectionPolicy struct. +func (spp *SubProtectionPolicy) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "policyType": + if v != nil { + var policyType string + err = json.Unmarshal(*v, &policyType) + if err != nil { + return err + } + spp.PolicyType = &policyType + } + case "schedulePolicy": + if v != nil { + schedulePolicy, err := unmarshalBasicSchedulePolicy(*v) + if err != nil { + return err + } + spp.SchedulePolicy = schedulePolicy + } + case "retentionPolicy": + if v != nil { + retentionPolicy, err := unmarshalBasicRetentionPolicy(*v) + if err != nil { + return err + } + spp.RetentionPolicy = retentionPolicy + } + } + } + + return nil +} + +// TargetAFSRestoreInfo target Azure File Share Info. +type TargetAFSRestoreInfo struct { + // Name - File share name + Name *string `json:"name,omitempty"` + // TargetResourceID - Target file share resource ARM ID + TargetResourceID *string `json:"targetResourceId,omitempty"` +} + +// TargetRestoreInfo details about target workload during restore operation. +type TargetRestoreInfo struct { + // OverwriteOption - Can Overwrite if Target DataBase already exists. Possible values include: 'OverwriteOptionsInvalid', 'OverwriteOptionsFailOnConflict', 'OverwriteOptionsOverwrite' + OverwriteOption OverwriteOptions `json:"overwriteOption,omitempty"` + // ContainerID - Resource Id name of the container in which Target DataBase resides + ContainerID *string `json:"containerId,omitempty"` + // DatabaseName - Database name InstanceName/DataBaseName for SQL or System/DbName for SAP Hana + DatabaseName *string `json:"databaseName,omitempty"` +} + +// TokenInformation the token information details. +type TokenInformation struct { + autorest.Response `json:"-"` + // Token - Token value. + Token *string `json:"token,omitempty"` + // ExpiryTimeInUtcTicks - Expiry time of token. + ExpiryTimeInUtcTicks *int64 `json:"expiryTimeInUtcTicks,omitempty"` + // SecurityPIN - Security PIN + SecurityPIN *string `json:"securityPIN,omitempty"` +} + +// WeeklyRetentionFormat weekly retention format. +type WeeklyRetentionFormat struct { + // DaysOfTheWeek - List of days of the week. + DaysOfTheWeek *[]DayOfWeek `json:"daysOfTheWeek,omitempty"` + // WeeksOfTheMonth - List of weeks of month. + WeeksOfTheMonth *[]WeekOfMonth `json:"weeksOfTheMonth,omitempty"` +} + +// WeeklyRetentionSchedule weekly retention schedule. +type WeeklyRetentionSchedule struct { + // DaysOfTheWeek - List of days of week for weekly retention policy. + DaysOfTheWeek *[]DayOfWeek `json:"daysOfTheWeek,omitempty"` + // RetentionTimes - Retention times of retention policy. + RetentionTimes *[]date.Time `json:"retentionTimes,omitempty"` + // RetentionDuration - Retention duration of retention Policy. + RetentionDuration *RetentionDuration `json:"retentionDuration,omitempty"` +} + +// WorkloadInquiryDetails details of an inquired protectable item. +type WorkloadInquiryDetails struct { + // Type - Type of the Workload such as SQL, Oracle etc. + Type *string `json:"type,omitempty"` + // ItemCount - Contains the protectable item Count inside this Container. + ItemCount *int64 `json:"itemCount,omitempty"` + // InquiryValidation - Inquiry validation such as permissions and other backup validations. + InquiryValidation *InquiryValidation `json:"inquiryValidation,omitempty"` +} + +// BasicWorkloadItem base class for backup item. Workload-specific backup items are derived from this class. +type BasicWorkloadItem interface { + AsAzureVMWorkloadItem() (*AzureVMWorkloadItem, bool) + AsBasicAzureVMWorkloadItem() (BasicAzureVMWorkloadItem, bool) + AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem() (*AzureVMWorkloadSAPHanaDatabaseWorkloadItem, bool) + AsAzureVMWorkloadSAPHanaSystemWorkloadItem() (*AzureVMWorkloadSAPHanaSystemWorkloadItem, bool) + AsAzureVMWorkloadSQLDatabaseWorkloadItem() (*AzureVMWorkloadSQLDatabaseWorkloadItem, bool) + AsAzureVMWorkloadSQLInstanceWorkloadItem() (*AzureVMWorkloadSQLInstanceWorkloadItem, bool) + AsWorkloadItem() (*WorkloadItem, bool) +} + +// WorkloadItem base class for backup item. Workload-specific backup items are derived from this class. +type WorkloadItem struct { + // BackupManagementType - Type of backup managemenent to backup an item. + BackupManagementType *string `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload for the backup management + WorkloadType *string `json:"workloadType,omitempty"` + // FriendlyName - Friendly name of the backup item. + FriendlyName *string `json:"friendlyName,omitempty"` + // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' + ProtectionState ProtectionStatus `json:"protectionState,omitempty"` + // WorkloadItemType - Possible values include: 'WorkloadItemTypeWorkloadItem', 'WorkloadItemTypeAzureVMWorkloadItem', 'WorkloadItemTypeSAPHanaDatabase1', 'WorkloadItemTypeSAPHanaSystem1', 'WorkloadItemTypeSQLDataBase1', 'WorkloadItemTypeSQLInstance1' + WorkloadItemType WorkloadItemTypeBasicWorkloadItem `json:"workloadItemType,omitempty"` +} + +func unmarshalBasicWorkloadItem(body []byte) (BasicWorkloadItem, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["workloadItemType"] { + case string(WorkloadItemTypeAzureVMWorkloadItem): + var avwi AzureVMWorkloadItem + err := json.Unmarshal(body, &avwi) + return avwi, err + case string(WorkloadItemTypeSAPHanaDatabase1): + var avwshdwi AzureVMWorkloadSAPHanaDatabaseWorkloadItem + err := json.Unmarshal(body, &avwshdwi) + return avwshdwi, err + case string(WorkloadItemTypeSAPHanaSystem1): + var avwshswi AzureVMWorkloadSAPHanaSystemWorkloadItem + err := json.Unmarshal(body, &avwshswi) + return avwshswi, err + case string(WorkloadItemTypeSQLDataBase1): + var avwsdwi AzureVMWorkloadSQLDatabaseWorkloadItem + err := json.Unmarshal(body, &avwsdwi) + return avwsdwi, err + case string(WorkloadItemTypeSQLInstance1): + var avwsiwi AzureVMWorkloadSQLInstanceWorkloadItem + err := json.Unmarshal(body, &avwsiwi) + return avwsiwi, err + default: + var wi WorkloadItem + err := json.Unmarshal(body, &wi) + return wi, err + } +} +func unmarshalBasicWorkloadItemArray(body []byte) ([]BasicWorkloadItem, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + wiArray := make([]BasicWorkloadItem, len(rawMessages)) + + for index, rawMessage := range rawMessages { + wi, err := unmarshalBasicWorkloadItem(*rawMessage) + if err != nil { + return nil, err + } + wiArray[index] = wi + } + return wiArray, nil +} + +// MarshalJSON is the custom marshaler for WorkloadItem. +func (wi WorkloadItem) MarshalJSON() ([]byte, error) { + wi.WorkloadItemType = WorkloadItemTypeWorkloadItem + objectMap := make(map[string]interface{}) + if wi.BackupManagementType != nil { + objectMap["backupManagementType"] = wi.BackupManagementType + } + if wi.WorkloadType != nil { + objectMap["workloadType"] = wi.WorkloadType + } + if wi.FriendlyName != nil { + objectMap["friendlyName"] = wi.FriendlyName + } + if wi.ProtectionState != "" { + objectMap["protectionState"] = wi.ProtectionState + } + if wi.WorkloadItemType != "" { + objectMap["workloadItemType"] = wi.WorkloadItemType + } + return json.Marshal(objectMap) +} + +// AsAzureVMWorkloadItem is the BasicWorkloadItem implementation for WorkloadItem. +func (wi WorkloadItem) AsAzureVMWorkloadItem() (*AzureVMWorkloadItem, bool) { + return nil, false +} + +// AsBasicAzureVMWorkloadItem is the BasicWorkloadItem implementation for WorkloadItem. +func (wi WorkloadItem) AsBasicAzureVMWorkloadItem() (BasicAzureVMWorkloadItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem is the BasicWorkloadItem implementation for WorkloadItem. +func (wi WorkloadItem) AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem() (*AzureVMWorkloadSAPHanaDatabaseWorkloadItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaSystemWorkloadItem is the BasicWorkloadItem implementation for WorkloadItem. +func (wi WorkloadItem) AsAzureVMWorkloadSAPHanaSystemWorkloadItem() (*AzureVMWorkloadSAPHanaSystemWorkloadItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLDatabaseWorkloadItem is the BasicWorkloadItem implementation for WorkloadItem. +func (wi WorkloadItem) AsAzureVMWorkloadSQLDatabaseWorkloadItem() (*AzureVMWorkloadSQLDatabaseWorkloadItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLInstanceWorkloadItem is the BasicWorkloadItem implementation for WorkloadItem. +func (wi WorkloadItem) AsAzureVMWorkloadSQLInstanceWorkloadItem() (*AzureVMWorkloadSQLInstanceWorkloadItem, bool) { + return nil, false +} + +// AsWorkloadItem is the BasicWorkloadItem implementation for WorkloadItem. +func (wi WorkloadItem) AsWorkloadItem() (*WorkloadItem, bool) { + return &wi, true +} + +// AsBasicWorkloadItem is the BasicWorkloadItem implementation for WorkloadItem. +func (wi WorkloadItem) AsBasicWorkloadItem() (BasicWorkloadItem, bool) { + return &wi, true +} + +// WorkloadItemResource base class for backup item. Workload-specific backup items are derived from this class. +type WorkloadItemResource struct { + // Properties - WorkloadItemResource properties + Properties BasicWorkloadItem `json:"properties,omitempty"` + // ID - Resource Id represents the complete path to the resource. + ID *string `json:"id,omitempty"` + // Name - Resource name associated with the resource. + Name *string `json:"name,omitempty"` + // Type - Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... + Type *string `json:"type,omitempty"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // ETag - Optional ETag. + ETag *string `json:"eTag,omitempty"` +} + +// MarshalJSON is the custom marshaler for WorkloadItemResource. +func (wir WorkloadItemResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["properties"] = wir.Properties + if wir.ID != nil { + objectMap["id"] = wir.ID + } + if wir.Name != nil { + objectMap["name"] = wir.Name + } + if wir.Type != nil { + objectMap["type"] = wir.Type + } + if wir.Location != nil { + objectMap["location"] = wir.Location + } + if wir.Tags != nil { + objectMap["tags"] = wir.Tags + } + if wir.ETag != nil { + objectMap["eTag"] = wir.ETag + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for WorkloadItemResource struct. +func (wir *WorkloadItemResource) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + properties, err := unmarshalBasicWorkloadItem(*v) + if err != nil { + return err + } + wir.Properties = properties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + wir.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + wir.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + wir.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + wir.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + wir.Tags = tags + } + case "eTag": + if v != nil { + var eTag string + err = json.Unmarshal(*v, &eTag) + if err != nil { + return err + } + wir.ETag = &eTag + } + } + } + + return nil +} + +// WorkloadItemResourceList list of WorkloadItem resources +type WorkloadItemResourceList struct { + autorest.Response `json:"-"` + // Value - List of resources. + Value *[]WorkloadItemResource `json:"value,omitempty"` + // NextLink - The uri to fetch the next page of resources. Call ListNext() fetches next page of resources. + NextLink *string `json:"nextLink,omitempty"` +} + +// WorkloadItemResourceListIterator provides access to a complete listing of WorkloadItemResource values. +type WorkloadItemResourceListIterator struct { + i int + page WorkloadItemResourceListPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *WorkloadItemResourceListIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter WorkloadItemResourceListIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter WorkloadItemResourceListIterator) Response() WorkloadItemResourceList { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter WorkloadItemResourceListIterator) Value() WorkloadItemResource { + if !iter.page.NotDone() { + return WorkloadItemResource{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (wirl WorkloadItemResourceList) IsEmpty() bool { + return wirl.Value == nil || len(*wirl.Value) == 0 +} + +// workloadItemResourceListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (wirl WorkloadItemResourceList) workloadItemResourceListPreparer() (*http.Request, error) { + if wirl.NextLink == nil || len(to.String(wirl.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(wirl.NextLink))) +} + +// WorkloadItemResourceListPage contains a page of WorkloadItemResource values. +type WorkloadItemResourceListPage struct { + fn func(WorkloadItemResourceList) (WorkloadItemResourceList, error) + wirl WorkloadItemResourceList +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *WorkloadItemResourceListPage) Next() error { + next, err := page.fn(page.wirl) + if err != nil { + return err + } + page.wirl = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page WorkloadItemResourceListPage) NotDone() bool { + return !page.wirl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page WorkloadItemResourceListPage) Response() WorkloadItemResourceList { + return page.wirl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page WorkloadItemResourceListPage) Values() []WorkloadItemResource { + if page.wirl.IsEmpty() { + return nil + } + return *page.wirl.Value +} + +// BasicWorkloadProtectableItem base class for backup item. Workload-specific backup items are derived from this class. +type BasicWorkloadProtectableItem interface { + AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) + AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) + AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) + AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) + AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) + AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) + AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) + AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) + AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) + AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) + AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) + AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) + AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) +} + +// WorkloadProtectableItem base class for backup item. Workload-specific backup items are derived from this class. +type WorkloadProtectableItem struct { + // BackupManagementType - Type of backup managemenent to backup an item. + BackupManagementType *string `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload for the backup management + WorkloadType *string `json:"workloadType,omitempty"` + // FriendlyName - Friendly name of the backup item. + FriendlyName *string `json:"friendlyName,omitempty"` + // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' + ProtectionState ProtectionStatus `json:"protectionState,omitempty"` + // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' + ProtectableItemType ProtectableItemType `json:"protectableItemType,omitempty"` +} + +func unmarshalBasicWorkloadProtectableItem(body []byte) (BasicWorkloadProtectableItem, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["protectableItemType"] { + case string(ProtectableItemTypeAzureFileShare): + var afspi AzureFileShareProtectableItem + err := json.Unmarshal(body, &afspi) + return afspi, err + case string(ProtectableItemTypeMicrosoftClassicComputevirtualMachines): + var aisccvpi AzureIaaSClassicComputeVMProtectableItem + err := json.Unmarshal(body, &aisccvpi) + return aisccvpi, err + case string(ProtectableItemTypeMicrosoftComputevirtualMachines): + var aiscvpi AzureIaaSComputeVMProtectableItem + err := json.Unmarshal(body, &aiscvpi) + return aiscvpi, err + case string(ProtectableItemTypeAzureVMWorkloadProtectableItem): + var avwpi AzureVMWorkloadProtectableItem + err := json.Unmarshal(body, &avwpi) + return avwpi, err + case string(ProtectableItemTypeSAPHanaDatabase): + var avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem + err := json.Unmarshal(body, &avwshdpi) + return avwshdpi, err + case string(ProtectableItemTypeSAPHanaSystem): + var avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem + err := json.Unmarshal(body, &avwshspi) + return avwshspi, err + case string(ProtectableItemTypeSQLAvailabilityGroupContainer): + var avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem + err := json.Unmarshal(body, &avwsagpi) + return avwsagpi, err + case string(ProtectableItemTypeSQLDataBase): + var avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem + err := json.Unmarshal(body, &avwsdpi) + return avwsdpi, err + case string(ProtectableItemTypeSQLInstance): + var avwsipi AzureVMWorkloadSQLInstanceProtectableItem + err := json.Unmarshal(body, &avwsipi) + return avwsipi, err + case string(ProtectableItemTypeIaaSVMProtectableItem): + var ispi IaaSVMProtectableItem + err := json.Unmarshal(body, &ispi) + return ispi, err + default: + var wpi WorkloadProtectableItem + err := json.Unmarshal(body, &wpi) + return wpi, err + } +} +func unmarshalBasicWorkloadProtectableItemArray(body []byte) ([]BasicWorkloadProtectableItem, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + wpiArray := make([]BasicWorkloadProtectableItem, len(rawMessages)) + + for index, rawMessage := range rawMessages { + wpi, err := unmarshalBasicWorkloadProtectableItem(*rawMessage) + if err != nil { + return nil, err + } + wpiArray[index] = wpi + } + return wpiArray, nil +} + +// MarshalJSON is the custom marshaler for WorkloadProtectableItem. +func (wpi WorkloadProtectableItem) MarshalJSON() ([]byte, error) { + wpi.ProtectableItemType = ProtectableItemTypeWorkloadProtectableItem + objectMap := make(map[string]interface{}) + if wpi.BackupManagementType != nil { + objectMap["backupManagementType"] = wpi.BackupManagementType + } + if wpi.WorkloadType != nil { + objectMap["workloadType"] = wpi.WorkloadType + } + if wpi.FriendlyName != nil { + objectMap["friendlyName"] = wpi.FriendlyName + } + if wpi.ProtectionState != "" { + objectMap["protectionState"] = wpi.ProtectionState + } + if wpi.ProtectableItemType != "" { + objectMap["protectableItemType"] = wpi.ProtectableItemType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareProtectableItem is the BasicWorkloadProtectableItem implementation for WorkloadProtectableItem. +func (wpi WorkloadProtectableItem) AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) { + return nil, false +} + +// AsAzureIaaSClassicComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for WorkloadProtectableItem. +func (wpi WorkloadProtectableItem) AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) { + return nil, false +} + +// AsAzureIaaSComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for WorkloadProtectableItem. +func (wpi WorkloadProtectableItem) AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for WorkloadProtectableItem. +func (wpi WorkloadProtectableItem) AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) { + return nil, false +} + +// AsBasicAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for WorkloadProtectableItem. +func (wpi WorkloadProtectableItem) AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for WorkloadProtectableItem. +func (wpi WorkloadProtectableItem) AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaSystemProtectableItem is the BasicWorkloadProtectableItem implementation for WorkloadProtectableItem. +func (wpi WorkloadProtectableItem) AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem is the BasicWorkloadProtectableItem implementation for WorkloadProtectableItem. +func (wpi WorkloadProtectableItem) AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for WorkloadProtectableItem. +func (wpi WorkloadProtectableItem) AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLInstanceProtectableItem is the BasicWorkloadProtectableItem implementation for WorkloadProtectableItem. +func (wpi WorkloadProtectableItem) AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) { + return nil, false +} + +// AsIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for WorkloadProtectableItem. +func (wpi WorkloadProtectableItem) AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) { + return nil, false +} + +// AsBasicIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for WorkloadProtectableItem. +func (wpi WorkloadProtectableItem) AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) { + return nil, false +} + +// AsWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for WorkloadProtectableItem. +func (wpi WorkloadProtectableItem) AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) { + return &wpi, true +} + +// AsBasicWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for WorkloadProtectableItem. +func (wpi WorkloadProtectableItem) AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) { + return &wpi, true +} + +// WorkloadProtectableItemResource base class for backup item. Workload-specific backup items are derived from this +// class. +type WorkloadProtectableItemResource struct { + // Properties - WorkloadProtectableItemResource properties + Properties BasicWorkloadProtectableItem `json:"properties,omitempty"` + // ID - Resource Id represents the complete path to the resource. + ID *string `json:"id,omitempty"` + // Name - Resource name associated with the resource. + Name *string `json:"name,omitempty"` + // Type - Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... + Type *string `json:"type,omitempty"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // ETag - Optional ETag. + ETag *string `json:"eTag,omitempty"` +} + +// MarshalJSON is the custom marshaler for WorkloadProtectableItemResource. +func (wpir WorkloadProtectableItemResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["properties"] = wpir.Properties + if wpir.ID != nil { + objectMap["id"] = wpir.ID + } + if wpir.Name != nil { + objectMap["name"] = wpir.Name + } + if wpir.Type != nil { + objectMap["type"] = wpir.Type + } + if wpir.Location != nil { + objectMap["location"] = wpir.Location + } + if wpir.Tags != nil { + objectMap["tags"] = wpir.Tags + } + if wpir.ETag != nil { + objectMap["eTag"] = wpir.ETag + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for WorkloadProtectableItemResource struct. +func (wpir *WorkloadProtectableItemResource) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + properties, err := unmarshalBasicWorkloadProtectableItem(*v) + if err != nil { + return err + } + wpir.Properties = properties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + wpir.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + wpir.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + wpir.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + wpir.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + wpir.Tags = tags + } + case "eTag": + if v != nil { + var eTag string + err = json.Unmarshal(*v, &eTag) + if err != nil { + return err + } + wpir.ETag = &eTag + } + } + } + + return nil +} + +// WorkloadProtectableItemResourceList list of WorkloadProtectableItem resources +type WorkloadProtectableItemResourceList struct { + autorest.Response `json:"-"` + // Value - List of resources. + Value *[]WorkloadProtectableItemResource `json:"value,omitempty"` + // NextLink - The uri to fetch the next page of resources. Call ListNext() fetches next page of resources. + NextLink *string `json:"nextLink,omitempty"` +} + +// WorkloadProtectableItemResourceListIterator provides access to a complete listing of +// WorkloadProtectableItemResource values. +type WorkloadProtectableItemResourceListIterator struct { + i int + page WorkloadProtectableItemResourceListPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *WorkloadProtectableItemResourceListIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter WorkloadProtectableItemResourceListIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter WorkloadProtectableItemResourceListIterator) Response() WorkloadProtectableItemResourceList { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter WorkloadProtectableItemResourceListIterator) Value() WorkloadProtectableItemResource { + if !iter.page.NotDone() { + return WorkloadProtectableItemResource{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (wpirl WorkloadProtectableItemResourceList) IsEmpty() bool { + return wpirl.Value == nil || len(*wpirl.Value) == 0 +} + +// workloadProtectableItemResourceListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (wpirl WorkloadProtectableItemResourceList) workloadProtectableItemResourceListPreparer() (*http.Request, error) { + if wpirl.NextLink == nil || len(to.String(wpirl.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(wpirl.NextLink))) +} + +// WorkloadProtectableItemResourceListPage contains a page of WorkloadProtectableItemResource values. +type WorkloadProtectableItemResourceListPage struct { + fn func(WorkloadProtectableItemResourceList) (WorkloadProtectableItemResourceList, error) + wpirl WorkloadProtectableItemResourceList +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *WorkloadProtectableItemResourceListPage) Next() error { + next, err := page.fn(page.wpirl) + if err != nil { + return err + } + page.wpirl = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page WorkloadProtectableItemResourceListPage) NotDone() bool { + return !page.wpirl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page WorkloadProtectableItemResourceListPage) Response() WorkloadProtectableItemResourceList { + return page.wpirl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page WorkloadProtectableItemResourceListPage) Values() []WorkloadProtectableItemResource { + if page.wpirl.IsEmpty() { + return nil + } + return *page.wpirl.Value +} + +// YearlyRetentionSchedule yearly retention schedule. +type YearlyRetentionSchedule struct { + // RetentionScheduleFormatType - Retention schedule format for yearly retention policy. Possible values include: 'RetentionScheduleFormatInvalid', 'RetentionScheduleFormatDaily', 'RetentionScheduleFormatWeekly' + RetentionScheduleFormatType RetentionScheduleFormat `json:"retentionScheduleFormatType,omitempty"` + // MonthsOfYear - List of months of year of yearly retention policy. + MonthsOfYear *[]MonthOfYear `json:"monthsOfYear,omitempty"` + // RetentionScheduleDaily - Daily retention format for yearly retention policy. + RetentionScheduleDaily *DailyRetentionFormat `json:"retentionScheduleDaily,omitempty"` + // RetentionScheduleWeekly - Weekly retention format for yearly retention policy. + RetentionScheduleWeekly *WeeklyRetentionFormat `json:"retentionScheduleWeekly,omitempty"` + // RetentionTimes - Retention times of retention policy. + RetentionTimes *[]date.Time `json:"retentionTimes,omitempty"` + // RetentionDuration - Retention duration of retention Policy. + RetentionDuration *RetentionDuration `json:"retentionDuration,omitempty"` +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2016-12-01/backup/operationresults.go b/vendor/github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2016-12-01/backup/operationresults.go new file mode 100644 index 000000000..1d8c5669a --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2016-12-01/backup/operationresults.go @@ -0,0 +1,111 @@ +package backup + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "net/http" +) + +// OperationResultsClient is the open API 2.0 Specs for Azure RecoveryServices Backup service +type OperationResultsClient struct { + BaseClient +} + +// NewOperationResultsClient creates an instance of the OperationResultsClient client. +func NewOperationResultsClient(subscriptionID string) OperationResultsClient { + return NewOperationResultsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewOperationResultsClientWithBaseURI creates an instance of the OperationResultsClient client. +func NewOperationResultsClientWithBaseURI(baseURI string, subscriptionID string) OperationResultsClient { + return OperationResultsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get provides the status of the delete operations such as deleting backed up item. Once the operation has started, +// the status code in the response would be Accepted. It will continue to be in this state till it reaches completion. +// On successful completion, the status code will be OK. This method expects OperationID as an argument. OperationID is +// part of the Location header of the operation response. +// Parameters: +// vaultName - the name of the recovery services vault. +// resourceGroupName - the name of the resource group where the recovery services vault is present. +// operationID - operationID which represents the operation. +func (client OperationResultsClient) Get(ctx context.Context, vaultName string, resourceGroupName string, operationID string) (result autorest.Response, err error) { + req, err := client.GetPreparer(ctx, vaultName, resourceGroupName, operationID) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.OperationResultsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "backup.OperationResultsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.OperationResultsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client OperationResultsClient) GetPreparer(ctx context.Context, vaultName string, resourceGroupName string, operationID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "operationId": autorest.Encode("path", operationID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vaultName": autorest.Encode("path", vaultName), + } + + const APIVersion = "2016-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupOperationResults/{operationId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client OperationResultsClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client OperationResultsClient) GetResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2016-12-01/backup/operationstatuses.go b/vendor/github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2016-12-01/backup/operationstatuses.go new file mode 100644 index 000000000..137a0cdcb --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2016-12-01/backup/operationstatuses.go @@ -0,0 +1,111 @@ +package backup + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "net/http" +) + +// OperationStatusesClient is the open API 2.0 Specs for Azure RecoveryServices Backup service +type OperationStatusesClient struct { + BaseClient +} + +// NewOperationStatusesClient creates an instance of the OperationStatusesClient client. +func NewOperationStatusesClient(subscriptionID string) OperationStatusesClient { + return NewOperationStatusesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewOperationStatusesClientWithBaseURI creates an instance of the OperationStatusesClient client. +func NewOperationStatusesClientWithBaseURI(baseURI string, subscriptionID string) OperationStatusesClient { + return OperationStatusesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get fetches the status of an operation such as triggering a backup, restore. The status can be in progress, +// completed or failed. You can refer to the OperationStatus enum for all the possible states of an operation. Some +// operations create jobs. This method returns the list of jobs when the operation is complete. +// Parameters: +// vaultName - the name of the recovery services vault. +// resourceGroupName - the name of the resource group where the recovery services vault is present. +// operationID - operationID which represents the operation. +func (client OperationStatusesClient) Get(ctx context.Context, vaultName string, resourceGroupName string, operationID string) (result OperationStatus, err error) { + req, err := client.GetPreparer(ctx, vaultName, resourceGroupName, operationID) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.OperationStatusesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "backup.OperationStatusesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.OperationStatusesClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client OperationStatusesClient) GetPreparer(ctx context.Context, vaultName string, resourceGroupName string, operationID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "operationId": autorest.Encode("path", operationID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vaultName": autorest.Encode("path", vaultName), + } + + const APIVersion = "2016-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupOperations/{operationId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client OperationStatusesClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client OperationStatusesClient) GetResponder(resp *http.Response) (result OperationStatus, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2016-12-01/backup/protectablecontainers.go b/vendor/github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2016-12-01/backup/protectablecontainers.go new file mode 100644 index 000000000..729cd4773 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2016-12-01/backup/protectablecontainers.go @@ -0,0 +1,141 @@ +package backup + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "net/http" +) + +// ProtectableContainersClient is the open API 2.0 Specs for Azure RecoveryServices Backup service +type ProtectableContainersClient struct { + BaseClient +} + +// NewProtectableContainersClient creates an instance of the ProtectableContainersClient client. +func NewProtectableContainersClient(subscriptionID string) ProtectableContainersClient { + return NewProtectableContainersClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewProtectableContainersClientWithBaseURI creates an instance of the ProtectableContainersClient client. +func NewProtectableContainersClientWithBaseURI(baseURI string, subscriptionID string) ProtectableContainersClient { + return ProtectableContainersClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// List lists the containers registered to Recovery Services Vault. +// Parameters: +// vaultName - the name of the recovery services vault. +// resourceGroupName - the name of the resource group where the recovery services vault is present. +// fabricName - fabric name associated with the container. +// filter - oData filter options. +func (client ProtectableContainersClient) List(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, filter string) (result ProtectableContainerResourceListPage, err error) { + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, vaultName, resourceGroupName, fabricName, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.ProtectableContainersClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.pcrl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "backup.ProtectableContainersClient", "List", resp, "Failure sending request") + return + } + + result.pcrl, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.ProtectableContainersClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client ProtectableContainersClient) ListPreparer(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vaultName": autorest.Encode("path", vaultName), + } + + const APIVersion = "2016-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectableContainers", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ProtectableContainersClient) ListSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ProtectableContainersClient) ListResponder(resp *http.Response) (result ProtectableContainerResourceList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ProtectableContainersClient) listNextResults(lastResults ProtectableContainerResourceList) (result ProtectableContainerResourceList, err error) { + req, err := lastResults.protectableContainerResourceListPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "backup.ProtectableContainersClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "backup.ProtectableContainersClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.ProtectableContainersClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ProtectableContainersClient) ListComplete(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, filter string) (result ProtectableContainerResourceListIterator, err error) { + result.page, err = client.List(ctx, vaultName, resourceGroupName, fabricName, filter) + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2016-12-01/backup/protectableitems.go b/vendor/github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2016-12-01/backup/protectableitems.go new file mode 100644 index 000000000..55fab8ac1 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2016-12-01/backup/protectableitems.go @@ -0,0 +1,144 @@ +package backup + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "net/http" +) + +// ProtectableItemsClient is the open API 2.0 Specs for Azure RecoveryServices Backup service +type ProtectableItemsClient struct { + BaseClient +} + +// NewProtectableItemsClient creates an instance of the ProtectableItemsClient client. +func NewProtectableItemsClient(subscriptionID string) ProtectableItemsClient { + return NewProtectableItemsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewProtectableItemsClientWithBaseURI creates an instance of the ProtectableItemsClient client. +func NewProtectableItemsClientWithBaseURI(baseURI string, subscriptionID string) ProtectableItemsClient { + return ProtectableItemsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// List provides a pageable list of protectable objects within your subscription according to the query filter and the +// pagination parameters. +// Parameters: +// vaultName - the name of the recovery services vault. +// resourceGroupName - the name of the resource group where the recovery services vault is present. +// filter - oData filter options. +// skipToken - skipToken Filter. +func (client ProtectableItemsClient) List(ctx context.Context, vaultName string, resourceGroupName string, filter string, skipToken string) (result WorkloadProtectableItemResourceListPage, err error) { + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, vaultName, resourceGroupName, filter, skipToken) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.ProtectableItemsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.wpirl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "backup.ProtectableItemsClient", "List", resp, "Failure sending request") + return + } + + result.wpirl, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.ProtectableItemsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client ProtectableItemsClient) ListPreparer(ctx context.Context, vaultName string, resourceGroupName string, filter string, skipToken string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vaultName": autorest.Encode("path", vaultName), + } + + const APIVersion = "2016-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if len(skipToken) > 0 { + queryParameters["$skipToken"] = autorest.Encode("query", skipToken) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupProtectableItems", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ProtectableItemsClient) ListSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ProtectableItemsClient) ListResponder(resp *http.Response) (result WorkloadProtectableItemResourceList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ProtectableItemsClient) listNextResults(lastResults WorkloadProtectableItemResourceList) (result WorkloadProtectableItemResourceList, err error) { + req, err := lastResults.workloadProtectableItemResourceListPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "backup.ProtectableItemsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "backup.ProtectableItemsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.ProtectableItemsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ProtectableItemsClient) ListComplete(ctx context.Context, vaultName string, resourceGroupName string, filter string, skipToken string) (result WorkloadProtectableItemResourceListIterator, err error) { + result.page, err = client.List(ctx, vaultName, resourceGroupName, filter, skipToken) + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2016-12-01/backup/protecteditemoperationresults.go b/vendor/github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2016-12-01/backup/protecteditemoperationresults.go new file mode 100644 index 000000000..77e472b40 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2016-12-01/backup/protecteditemoperationresults.go @@ -0,0 +1,116 @@ +package backup + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "net/http" +) + +// ProtectedItemOperationResultsClient is the open API 2.0 Specs for Azure RecoveryServices Backup service +type ProtectedItemOperationResultsClient struct { + BaseClient +} + +// NewProtectedItemOperationResultsClient creates an instance of the ProtectedItemOperationResultsClient client. +func NewProtectedItemOperationResultsClient(subscriptionID string) ProtectedItemOperationResultsClient { + return NewProtectedItemOperationResultsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewProtectedItemOperationResultsClientWithBaseURI creates an instance of the ProtectedItemOperationResultsClient +// client. +func NewProtectedItemOperationResultsClientWithBaseURI(baseURI string, subscriptionID string) ProtectedItemOperationResultsClient { + return ProtectedItemOperationResultsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get fetches the result of any operation on the backup item. +// Parameters: +// vaultName - the name of the recovery services vault. +// resourceGroupName - the name of the resource group where the recovery services vault is present. +// fabricName - fabric name associated with the backup item. +// containerName - container name associated with the backup item. +// protectedItemName - backup item name whose details are to be fetched. +// operationID - operationID which represents the operation whose result needs to be fetched. +func (client ProtectedItemOperationResultsClient) Get(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, operationID string) (result ProtectedItemResource, err error) { + req, err := client.GetPreparer(ctx, vaultName, resourceGroupName, fabricName, containerName, protectedItemName, operationID) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.ProtectedItemOperationResultsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "backup.ProtectedItemOperationResultsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.ProtectedItemOperationResultsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client ProtectedItemOperationResultsClient) GetPreparer(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, operationID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "containerName": autorest.Encode("path", containerName), + "fabricName": autorest.Encode("path", fabricName), + "operationId": autorest.Encode("path", operationID), + "protectedItemName": autorest.Encode("path", protectedItemName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vaultName": autorest.Encode("path", vaultName), + } + + const APIVersion = "2016-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/operationResults/{operationId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ProtectedItemOperationResultsClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ProtectedItemOperationResultsClient) GetResponder(resp *http.Response) (result ProtectedItemResource, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2016-12-01/backup/protecteditemoperationstatuses.go b/vendor/github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2016-12-01/backup/protecteditemoperationstatuses.go new file mode 100644 index 000000000..8d7d8dc0a --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2016-12-01/backup/protecteditemoperationstatuses.go @@ -0,0 +1,118 @@ +package backup + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "net/http" +) + +// ProtectedItemOperationStatusesClient is the open API 2.0 Specs for Azure RecoveryServices Backup service +type ProtectedItemOperationStatusesClient struct { + BaseClient +} + +// NewProtectedItemOperationStatusesClient creates an instance of the ProtectedItemOperationStatusesClient client. +func NewProtectedItemOperationStatusesClient(subscriptionID string) ProtectedItemOperationStatusesClient { + return NewProtectedItemOperationStatusesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewProtectedItemOperationStatusesClientWithBaseURI creates an instance of the ProtectedItemOperationStatusesClient +// client. +func NewProtectedItemOperationStatusesClientWithBaseURI(baseURI string, subscriptionID string) ProtectedItemOperationStatusesClient { + return ProtectedItemOperationStatusesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get fetches the status of an operation such as triggering a backup, restore. The status can be in progress, +// completed or failed. You can refer to the OperationStatus enum for all the possible states of the operation. Some +// operations create jobs. This method returns the list of jobs associated with the operation. +// Parameters: +// vaultName - the name of the recovery services vault. +// resourceGroupName - the name of the resource group where the recovery services vault is present. +// fabricName - fabric name associated with the backup item. +// containerName - container name associated with the backup item. +// protectedItemName - backup item name whose details are to be fetched. +// operationID - operationID represents the operation whose status needs to be fetched. +func (client ProtectedItemOperationStatusesClient) Get(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, operationID string) (result OperationStatus, err error) { + req, err := client.GetPreparer(ctx, vaultName, resourceGroupName, fabricName, containerName, protectedItemName, operationID) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.ProtectedItemOperationStatusesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "backup.ProtectedItemOperationStatusesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.ProtectedItemOperationStatusesClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client ProtectedItemOperationStatusesClient) GetPreparer(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, operationID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "containerName": autorest.Encode("path", containerName), + "fabricName": autorest.Encode("path", fabricName), + "operationId": autorest.Encode("path", operationID), + "protectedItemName": autorest.Encode("path", protectedItemName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vaultName": autorest.Encode("path", vaultName), + } + + const APIVersion = "2016-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/operationsStatus/{operationId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ProtectedItemOperationStatusesClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ProtectedItemOperationStatusesClient) GetResponder(resp *http.Response) (result OperationStatus, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2016-12-01/backup/protecteditems.go b/vendor/github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2016-12-01/backup/protecteditems.go new file mode 100644 index 000000000..8ef3537c8 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2016-12-01/backup/protecteditems.go @@ -0,0 +1,267 @@ +package backup + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "net/http" +) + +// ProtectedItemsClient is the open API 2.0 Specs for Azure RecoveryServices Backup service +type ProtectedItemsClient struct { + BaseClient +} + +// NewProtectedItemsClient creates an instance of the ProtectedItemsClient client. +func NewProtectedItemsClient(subscriptionID string) ProtectedItemsClient { + return NewProtectedItemsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewProtectedItemsClientWithBaseURI creates an instance of the ProtectedItemsClient client. +func NewProtectedItemsClientWithBaseURI(baseURI string, subscriptionID string) ProtectedItemsClient { + return ProtectedItemsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate enables backup of an item or to modifies the backup policy information of an already backed up item. +// This is an asynchronous operation. To know the status of the operation, call the GetItemOperationResult API. +// Parameters: +// vaultName - the name of the recovery services vault. +// resourceGroupName - the name of the resource group where the recovery services vault is present. +// fabricName - fabric name associated with the backup item. +// containerName - container name associated with the backup item. +// protectedItemName - item name to be backed up. +// parameters - resource backed up item +func (client ProtectedItemsClient) CreateOrUpdate(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, parameters ProtectedItemResource) (result autorest.Response, err error) { + req, err := client.CreateOrUpdatePreparer(ctx, vaultName, resourceGroupName, fabricName, containerName, protectedItemName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.ProtectedItemsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "backup.ProtectedItemsClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.ProtectedItemsClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client ProtectedItemsClient) CreateOrUpdatePreparer(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, parameters ProtectedItemResource) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "containerName": autorest.Encode("path", containerName), + "fabricName": autorest.Encode("path", fabricName), + "protectedItemName": autorest.Encode("path", protectedItemName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vaultName": autorest.Encode("path", vaultName), + } + + const APIVersion = "2016-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client ProtectedItemsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client ProtectedItemsClient) CreateOrUpdateResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// Delete used to disable backup of an item within a container. This is an asynchronous operation. To know the status +// of the request, call the GetItemOperationResult API. +// Parameters: +// vaultName - the name of the recovery services vault. +// resourceGroupName - the name of the resource group where the recovery services vault is present. +// fabricName - fabric name associated with the backed up item. +// containerName - container name associated with the backed up item. +// protectedItemName - backed up item to be deleted. +func (client ProtectedItemsClient) Delete(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string) (result autorest.Response, err error) { + req, err := client.DeletePreparer(ctx, vaultName, resourceGroupName, fabricName, containerName, protectedItemName) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.ProtectedItemsClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "backup.ProtectedItemsClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.ProtectedItemsClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ProtectedItemsClient) DeletePreparer(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "containerName": autorest.Encode("path", containerName), + "fabricName": autorest.Encode("path", fabricName), + "protectedItemName": autorest.Encode("path", protectedItemName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vaultName": autorest.Encode("path", vaultName), + } + + const APIVersion = "2016-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ProtectedItemsClient) DeleteSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ProtectedItemsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get provides the details of the backed up item. This is an asynchronous operation. To know the status of the +// operation, call the GetItemOperationResult API. +// Parameters: +// vaultName - the name of the recovery services vault. +// resourceGroupName - the name of the resource group where the recovery services vault is present. +// fabricName - fabric name associated with the backed up item. +// containerName - container name associated with the backed up item. +// protectedItemName - backed up item name whose details are to be fetched. +// filter - oData filter options. +func (client ProtectedItemsClient) Get(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, filter string) (result ProtectedItemResource, err error) { + req, err := client.GetPreparer(ctx, vaultName, resourceGroupName, fabricName, containerName, protectedItemName, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.ProtectedItemsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "backup.ProtectedItemsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.ProtectedItemsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client ProtectedItemsClient) GetPreparer(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "containerName": autorest.Encode("path", containerName), + "fabricName": autorest.Encode("path", fabricName), + "protectedItemName": autorest.Encode("path", protectedItemName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vaultName": autorest.Encode("path", vaultName), + } + + const APIVersion = "2016-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ProtectedItemsClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ProtectedItemsClient) GetResponder(resp *http.Response) (result ProtectedItemResource, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2016-12-01/backup/protectioncontaineroperationresults.go b/vendor/github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2016-12-01/backup/protectioncontaineroperationresults.go new file mode 100644 index 000000000..4a270cff2 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2016-12-01/backup/protectioncontaineroperationresults.go @@ -0,0 +1,115 @@ +package backup + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "net/http" +) + +// ProtectionContainerOperationResultsClient is the open API 2.0 Specs for Azure RecoveryServices Backup service +type ProtectionContainerOperationResultsClient struct { + BaseClient +} + +// NewProtectionContainerOperationResultsClient creates an instance of the ProtectionContainerOperationResultsClient +// client. +func NewProtectionContainerOperationResultsClient(subscriptionID string) ProtectionContainerOperationResultsClient { + return NewProtectionContainerOperationResultsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewProtectionContainerOperationResultsClientWithBaseURI creates an instance of the +// ProtectionContainerOperationResultsClient client. +func NewProtectionContainerOperationResultsClientWithBaseURI(baseURI string, subscriptionID string) ProtectionContainerOperationResultsClient { + return ProtectionContainerOperationResultsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get fetches the result of any operation on the container. +// Parameters: +// vaultName - the name of the recovery services vault. +// resourceGroupName - the name of the resource group where the recovery services vault is present. +// fabricName - fabric name associated with the container. +// containerName - container name whose information should be fetched. +// operationID - operation ID which represents the operation whose result needs to be fetched. +func (client ProtectionContainerOperationResultsClient) Get(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, operationID string) (result ProtectionContainerResource, err error) { + req, err := client.GetPreparer(ctx, vaultName, resourceGroupName, fabricName, containerName, operationID) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.ProtectionContainerOperationResultsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "backup.ProtectionContainerOperationResultsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.ProtectionContainerOperationResultsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client ProtectionContainerOperationResultsClient) GetPreparer(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, operationID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "containerName": autorest.Encode("path", containerName), + "fabricName": autorest.Encode("path", fabricName), + "operationId": autorest.Encode("path", operationID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vaultName": autorest.Encode("path", vaultName), + } + + const APIVersion = "2016-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/operationResults/{operationId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ProtectionContainerOperationResultsClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ProtectionContainerOperationResultsClient) GetResponder(resp *http.Response) (result ProtectionContainerResource, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2016-12-01/backup/protectioncontainerrefreshoperationresults.go b/vendor/github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2016-12-01/backup/protectioncontainerrefreshoperationresults.go new file mode 100644 index 000000000..cf919e740 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2016-12-01/backup/protectioncontainerrefreshoperationresults.go @@ -0,0 +1,112 @@ +package backup + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "net/http" +) + +// ProtectionContainerRefreshOperationResultsClient is the open API 2.0 Specs for Azure RecoveryServices Backup service +type ProtectionContainerRefreshOperationResultsClient struct { + BaseClient +} + +// NewProtectionContainerRefreshOperationResultsClient creates an instance of the +// ProtectionContainerRefreshOperationResultsClient client. +func NewProtectionContainerRefreshOperationResultsClient(subscriptionID string) ProtectionContainerRefreshOperationResultsClient { + return NewProtectionContainerRefreshOperationResultsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewProtectionContainerRefreshOperationResultsClientWithBaseURI creates an instance of the +// ProtectionContainerRefreshOperationResultsClient client. +func NewProtectionContainerRefreshOperationResultsClientWithBaseURI(baseURI string, subscriptionID string) ProtectionContainerRefreshOperationResultsClient { + return ProtectionContainerRefreshOperationResultsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get provides the result of the refresh operation triggered by the BeginRefresh operation. +// Parameters: +// vaultName - the name of the recovery services vault. +// resourceGroupName - the name of the resource group where the recovery services vault is present. +// fabricName - fabric name associated with the container. +// operationID - operation ID associated with the operation whose result needs to be fetched. +func (client ProtectionContainerRefreshOperationResultsClient) Get(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, operationID string) (result autorest.Response, err error) { + req, err := client.GetPreparer(ctx, vaultName, resourceGroupName, fabricName, operationID) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.ProtectionContainerRefreshOperationResultsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "backup.ProtectionContainerRefreshOperationResultsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.ProtectionContainerRefreshOperationResultsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client ProtectionContainerRefreshOperationResultsClient) GetPreparer(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, operationID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "operationId": autorest.Encode("path", operationID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vaultName": autorest.Encode("path", vaultName), + } + + const APIVersion = "2016-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/operationResults/{operationId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ProtectionContainerRefreshOperationResultsClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ProtectionContainerRefreshOperationResultsClient) GetResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2016-12-01/backup/protectioncontainers.go b/vendor/github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2016-12-01/backup/protectioncontainers.go new file mode 100644 index 000000000..142dce500 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2016-12-01/backup/protectioncontainers.go @@ -0,0 +1,406 @@ +package backup + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "net/http" +) + +// ProtectionContainersClient is the open API 2.0 Specs for Azure RecoveryServices Backup service +type ProtectionContainersClient struct { + BaseClient +} + +// NewProtectionContainersClient creates an instance of the ProtectionContainersClient client. +func NewProtectionContainersClient(subscriptionID string) ProtectionContainersClient { + return NewProtectionContainersClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewProtectionContainersClientWithBaseURI creates an instance of the ProtectionContainersClient client. +func NewProtectionContainersClientWithBaseURI(baseURI string, subscriptionID string) ProtectionContainersClient { + return ProtectionContainersClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get gets details of the specific container registered to your Recovery Services Vault. +// Parameters: +// vaultName - the name of the recovery services vault. +// resourceGroupName - the name of the resource group where the recovery services vault is present. +// fabricName - name of the fabric where the container belongs. +// containerName - name of the container whose details need to be fetched. +func (client ProtectionContainersClient) Get(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string) (result ProtectionContainerResource, err error) { + req, err := client.GetPreparer(ctx, vaultName, resourceGroupName, fabricName, containerName) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.ProtectionContainersClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "backup.ProtectionContainersClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.ProtectionContainersClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client ProtectionContainersClient) GetPreparer(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "containerName": autorest.Encode("path", containerName), + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vaultName": autorest.Encode("path", vaultName), + } + + const APIVersion = "2016-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ProtectionContainersClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ProtectionContainersClient) GetResponder(resp *http.Response) (result ProtectionContainerResource, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Inquire inquires all the protectable items that are protectable under the given container. +// Parameters: +// vaultName - the name of the recovery services vault. +// resourceGroupName - the name of the resource group where the recovery services vault is present. +// fabricName - fabric Name associated with the container. +// containerName - name of the container in which inquiry needs to be triggered. +// filter - oData filter options. +func (client ProtectionContainersClient) Inquire(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, filter string) (result autorest.Response, err error) { + req, err := client.InquirePreparer(ctx, vaultName, resourceGroupName, fabricName, containerName, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.ProtectionContainersClient", "Inquire", nil, "Failure preparing request") + return + } + + resp, err := client.InquireSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "backup.ProtectionContainersClient", "Inquire", resp, "Failure sending request") + return + } + + result, err = client.InquireResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.ProtectionContainersClient", "Inquire", resp, "Failure responding to request") + } + + return +} + +// InquirePreparer prepares the Inquire request. +func (client ProtectionContainersClient) InquirePreparer(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "containerName": autorest.Encode("path", containerName), + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vaultName": autorest.Encode("path", vaultName), + } + + const APIVersion = "2016-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/inquire", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// InquireSender sends the Inquire request. The method will close the +// http.Response Body if it receives an error. +func (client ProtectionContainersClient) InquireSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// InquireResponder handles the response to the Inquire request. The method always +// closes the http.Response Body. +func (client ProtectionContainersClient) InquireResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// Refresh discovers all the containers in the subscription that can be backed up to Recovery Services Vault. This is +// an asynchronous operation. To know the status of the operation, call GetRefreshOperationResult API. +// Parameters: +// vaultName - the name of the recovery services vault. +// resourceGroupName - the name of the resource group where the recovery services vault is present. +// fabricName - fabric name associated the container. +// filter - oData filter options. +func (client ProtectionContainersClient) Refresh(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, filter string) (result autorest.Response, err error) { + req, err := client.RefreshPreparer(ctx, vaultName, resourceGroupName, fabricName, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.ProtectionContainersClient", "Refresh", nil, "Failure preparing request") + return + } + + resp, err := client.RefreshSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "backup.ProtectionContainersClient", "Refresh", resp, "Failure sending request") + return + } + + result, err = client.RefreshResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.ProtectionContainersClient", "Refresh", resp, "Failure responding to request") + } + + return +} + +// RefreshPreparer prepares the Refresh request. +func (client ProtectionContainersClient) RefreshPreparer(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vaultName": autorest.Encode("path", vaultName), + } + + const APIVersion = "2016-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/refreshContainers", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RefreshSender sends the Refresh request. The method will close the +// http.Response Body if it receives an error. +func (client ProtectionContainersClient) RefreshSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// RefreshResponder handles the response to the Refresh request. The method always +// closes the http.Response Body. +func (client ProtectionContainersClient) RefreshResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// Register registers the container with Recovery Services vault. +// This is an asynchronous operation. To track the operation status, use location header to call get latest status of +// the operation. +// Parameters: +// vaultName - the name of the recovery services vault. +// resourceGroupName - the name of the resource group where the recovery services vault is present. +// fabricName - fabric name associated with the container. +// containerName - name of the container to be registered. +// parameters - request body for operation +func (client ProtectionContainersClient) Register(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, parameters ProtectionContainerResource) (result ProtectionContainerResource, err error) { + req, err := client.RegisterPreparer(ctx, vaultName, resourceGroupName, fabricName, containerName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.ProtectionContainersClient", "Register", nil, "Failure preparing request") + return + } + + resp, err := client.RegisterSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "backup.ProtectionContainersClient", "Register", resp, "Failure sending request") + return + } + + result, err = client.RegisterResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.ProtectionContainersClient", "Register", resp, "Failure responding to request") + } + + return +} + +// RegisterPreparer prepares the Register request. +func (client ProtectionContainersClient) RegisterPreparer(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, parameters ProtectionContainerResource) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "containerName": autorest.Encode("path", containerName), + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vaultName": autorest.Encode("path", vaultName), + } + + const APIVersion = "2016-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RegisterSender sends the Register request. The method will close the +// http.Response Body if it receives an error. +func (client ProtectionContainersClient) RegisterSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// RegisterResponder handles the response to the Register request. The method always +// closes the http.Response Body. +func (client ProtectionContainersClient) RegisterResponder(resp *http.Response) (result ProtectionContainerResource, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Unregister unregisters the given container from your Recovery Services Vault. +// This is an asynchronous operation. To determine whether the backend service has finished processing the request, +// call Get Container Operation Result API. +// Parameters: +// vaultName - the name of the recovery services vault. +// resourceGroupName - the name of the resource group where the recovery services vault is present. +// fabricName - name of the fabric where the container belongs. +// containerName - name of the container which needs to be unregistered from the Recovery Services Vault. +func (client ProtectionContainersClient) Unregister(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string) (result autorest.Response, err error) { + req, err := client.UnregisterPreparer(ctx, vaultName, resourceGroupName, fabricName, containerName) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.ProtectionContainersClient", "Unregister", nil, "Failure preparing request") + return + } + + resp, err := client.UnregisterSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "backup.ProtectionContainersClient", "Unregister", resp, "Failure sending request") + return + } + + result, err = client.UnregisterResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.ProtectionContainersClient", "Unregister", resp, "Failure responding to request") + } + + return +} + +// UnregisterPreparer prepares the Unregister request. +func (client ProtectionContainersClient) UnregisterPreparer(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "containerName": autorest.Encode("path", containerName), + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vaultName": autorest.Encode("path", vaultName), + } + + const APIVersion = "2016-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UnregisterSender sends the Unregister request. The method will close the +// http.Response Body if it receives an error. +func (client ProtectionContainersClient) UnregisterSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// UnregisterResponder handles the response to the Unregister request. The method always +// closes the http.Response Body. +func (client ProtectionContainersClient) UnregisterResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2016-12-01/backup/protectioncontainersgroup.go b/vendor/github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2016-12-01/backup/protectioncontainersgroup.go new file mode 100644 index 000000000..d8e7f82b8 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2016-12-01/backup/protectioncontainersgroup.go @@ -0,0 +1,139 @@ +package backup + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "net/http" +) + +// ProtectionContainersGroupClient is the open API 2.0 Specs for Azure RecoveryServices Backup service +type ProtectionContainersGroupClient struct { + BaseClient +} + +// NewProtectionContainersGroupClient creates an instance of the ProtectionContainersGroupClient client. +func NewProtectionContainersGroupClient(subscriptionID string) ProtectionContainersGroupClient { + return NewProtectionContainersGroupClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewProtectionContainersGroupClientWithBaseURI creates an instance of the ProtectionContainersGroupClient client. +func NewProtectionContainersGroupClientWithBaseURI(baseURI string, subscriptionID string) ProtectionContainersGroupClient { + return ProtectionContainersGroupClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// List lists the containers registered to Recovery Services Vault. +// Parameters: +// vaultName - the name of the recovery services vault. +// resourceGroupName - the name of the resource group where the recovery services vault is present. +// filter - oData filter options. +func (client ProtectionContainersGroupClient) List(ctx context.Context, vaultName string, resourceGroupName string, filter string) (result ProtectionContainerResourceListPage, err error) { + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, vaultName, resourceGroupName, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.ProtectionContainersGroupClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.pcrl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "backup.ProtectionContainersGroupClient", "List", resp, "Failure sending request") + return + } + + result.pcrl, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.ProtectionContainersGroupClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client ProtectionContainersGroupClient) ListPreparer(ctx context.Context, vaultName string, resourceGroupName string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vaultName": autorest.Encode("path", vaultName), + } + + const APIVersion = "2016-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupProtectionContainers", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ProtectionContainersGroupClient) ListSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ProtectionContainersGroupClient) ListResponder(resp *http.Response) (result ProtectionContainerResourceList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ProtectionContainersGroupClient) listNextResults(lastResults ProtectionContainerResourceList) (result ProtectionContainerResourceList, err error) { + req, err := lastResults.protectionContainerResourceListPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "backup.ProtectionContainersGroupClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "backup.ProtectionContainersGroupClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.ProtectionContainersGroupClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ProtectionContainersGroupClient) ListComplete(ctx context.Context, vaultName string, resourceGroupName string, filter string) (result ProtectionContainerResourceListIterator, err error) { + result.page, err = client.List(ctx, vaultName, resourceGroupName, filter) + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2016-12-01/backup/protectionpolicies.go b/vendor/github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2016-12-01/backup/protectionpolicies.go new file mode 100644 index 000000000..fdf77e1b3 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2016-12-01/backup/protectionpolicies.go @@ -0,0 +1,252 @@ +package backup + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "net/http" +) + +// ProtectionPoliciesClient is the open API 2.0 Specs for Azure RecoveryServices Backup service +type ProtectionPoliciesClient struct { + BaseClient +} + +// NewProtectionPoliciesClient creates an instance of the ProtectionPoliciesClient client. +func NewProtectionPoliciesClient(subscriptionID string) ProtectionPoliciesClient { + return NewProtectionPoliciesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewProtectionPoliciesClientWithBaseURI creates an instance of the ProtectionPoliciesClient client. +func NewProtectionPoliciesClientWithBaseURI(baseURI string, subscriptionID string) ProtectionPoliciesClient { + return ProtectionPoliciesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or modifies a backup policy. This is an asynchronous operation. Status of the operation can +// be fetched using GetPolicyOperationResult API. +// Parameters: +// vaultName - the name of the recovery services vault. +// resourceGroupName - the name of the resource group where the recovery services vault is present. +// policyName - backup policy to be created. +// parameters - resource backup policy +func (client ProtectionPoliciesClient) CreateOrUpdate(ctx context.Context, vaultName string, resourceGroupName string, policyName string, parameters ProtectionPolicyResource) (result ProtectionPolicyResource, err error) { + req, err := client.CreateOrUpdatePreparer(ctx, vaultName, resourceGroupName, policyName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.ProtectionPoliciesClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "backup.ProtectionPoliciesClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.ProtectionPoliciesClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client ProtectionPoliciesClient) CreateOrUpdatePreparer(ctx context.Context, vaultName string, resourceGroupName string, policyName string, parameters ProtectionPolicyResource) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "policyName": autorest.Encode("path", policyName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vaultName": autorest.Encode("path", vaultName), + } + + const APIVersion = "2016-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupPolicies/{policyName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client ProtectionPoliciesClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client ProtectionPoliciesClient) CreateOrUpdateResponder(resp *http.Response) (result ProtectionPolicyResource, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes specified backup policy from your Recovery Services Vault. This is an asynchronous operation. Status +// of the operation can be fetched using GetPolicyOperationResult API. +// Parameters: +// vaultName - the name of the recovery services vault. +// resourceGroupName - the name of the resource group where the recovery services vault is present. +// policyName - backup policy to be deleted. +func (client ProtectionPoliciesClient) Delete(ctx context.Context, vaultName string, resourceGroupName string, policyName string) (result autorest.Response, err error) { + req, err := client.DeletePreparer(ctx, vaultName, resourceGroupName, policyName) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.ProtectionPoliciesClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "backup.ProtectionPoliciesClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.ProtectionPoliciesClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ProtectionPoliciesClient) DeletePreparer(ctx context.Context, vaultName string, resourceGroupName string, policyName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "policyName": autorest.Encode("path", policyName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vaultName": autorest.Encode("path", vaultName), + } + + const APIVersion = "2016-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupPolicies/{policyName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ProtectionPoliciesClient) DeleteSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ProtectionPoliciesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get provides the details of the backup policies associated to Recovery Services Vault. This is an asynchronous +// operation. Status of the operation can be fetched using GetPolicyOperationResult API. +// Parameters: +// vaultName - the name of the recovery services vault. +// resourceGroupName - the name of the resource group where the recovery services vault is present. +// policyName - backup policy information to be fetched. +func (client ProtectionPoliciesClient) Get(ctx context.Context, vaultName string, resourceGroupName string, policyName string) (result ProtectionPolicyResource, err error) { + req, err := client.GetPreparer(ctx, vaultName, resourceGroupName, policyName) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.ProtectionPoliciesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "backup.ProtectionPoliciesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.ProtectionPoliciesClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client ProtectionPoliciesClient) GetPreparer(ctx context.Context, vaultName string, resourceGroupName string, policyName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "policyName": autorest.Encode("path", policyName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vaultName": autorest.Encode("path", vaultName), + } + + const APIVersion = "2016-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupPolicies/{policyName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ProtectionPoliciesClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ProtectionPoliciesClient) GetResponder(resp *http.Response) (result ProtectionPolicyResource, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2016-12-01/backup/protectionpolicyoperationresults.go b/vendor/github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2016-12-01/backup/protectionpolicyoperationresults.go new file mode 100644 index 000000000..95e2e8fbd --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2016-12-01/backup/protectionpolicyoperationresults.go @@ -0,0 +1,112 @@ +package backup + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "net/http" +) + +// ProtectionPolicyOperationResultsClient is the open API 2.0 Specs for Azure RecoveryServices Backup service +type ProtectionPolicyOperationResultsClient struct { + BaseClient +} + +// NewProtectionPolicyOperationResultsClient creates an instance of the ProtectionPolicyOperationResultsClient client. +func NewProtectionPolicyOperationResultsClient(subscriptionID string) ProtectionPolicyOperationResultsClient { + return NewProtectionPolicyOperationResultsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewProtectionPolicyOperationResultsClientWithBaseURI creates an instance of the +// ProtectionPolicyOperationResultsClient client. +func NewProtectionPolicyOperationResultsClientWithBaseURI(baseURI string, subscriptionID string) ProtectionPolicyOperationResultsClient { + return ProtectionPolicyOperationResultsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get provides the result of an operation. +// Parameters: +// vaultName - the name of the recovery services vault. +// resourceGroupName - the name of the resource group where the recovery services vault is present. +// policyName - backup policy name whose operation's result needs to be fetched. +// operationID - operation ID which represents the operation whose result needs to be fetched. +func (client ProtectionPolicyOperationResultsClient) Get(ctx context.Context, vaultName string, resourceGroupName string, policyName string, operationID string) (result ProtectionPolicyResource, err error) { + req, err := client.GetPreparer(ctx, vaultName, resourceGroupName, policyName, operationID) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.ProtectionPolicyOperationResultsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "backup.ProtectionPolicyOperationResultsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.ProtectionPolicyOperationResultsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client ProtectionPolicyOperationResultsClient) GetPreparer(ctx context.Context, vaultName string, resourceGroupName string, policyName string, operationID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "operationId": autorest.Encode("path", operationID), + "policyName": autorest.Encode("path", policyName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vaultName": autorest.Encode("path", vaultName), + } + + const APIVersion = "2016-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupPolicies/{policyName}/operationResults/{operationId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ProtectionPolicyOperationResultsClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ProtectionPolicyOperationResultsClient) GetResponder(resp *http.Response) (result ProtectionPolicyResource, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2016-12-01/backup/protectionpolicyoperationstatuses.go b/vendor/github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2016-12-01/backup/protectionpolicyoperationstatuses.go new file mode 100644 index 000000000..d2e5669ce --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2016-12-01/backup/protectionpolicyoperationstatuses.go @@ -0,0 +1,115 @@ +package backup + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "net/http" +) + +// ProtectionPolicyOperationStatusesClient is the open API 2.0 Specs for Azure RecoveryServices Backup service +type ProtectionPolicyOperationStatusesClient struct { + BaseClient +} + +// NewProtectionPolicyOperationStatusesClient creates an instance of the ProtectionPolicyOperationStatusesClient +// client. +func NewProtectionPolicyOperationStatusesClient(subscriptionID string) ProtectionPolicyOperationStatusesClient { + return NewProtectionPolicyOperationStatusesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewProtectionPolicyOperationStatusesClientWithBaseURI creates an instance of the +// ProtectionPolicyOperationStatusesClient client. +func NewProtectionPolicyOperationStatusesClientWithBaseURI(baseURI string, subscriptionID string) ProtectionPolicyOperationStatusesClient { + return ProtectionPolicyOperationStatusesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get provides the status of the asynchronous operations like backup, restore. The status can be in progress, +// completed or failed. You can refer to the Operation Status enum for all the possible states of an operation. Some +// operations create jobs. This method returns the list of jobs associated with operation. +// Parameters: +// vaultName - the name of the recovery services vault. +// resourceGroupName - the name of the resource group where the recovery services vault is present. +// policyName - backup policy name whose operation's status needs to be fetched. +// operationID - operation ID which represents an operation whose status needs to be fetched. +func (client ProtectionPolicyOperationStatusesClient) Get(ctx context.Context, vaultName string, resourceGroupName string, policyName string, operationID string) (result OperationStatus, err error) { + req, err := client.GetPreparer(ctx, vaultName, resourceGroupName, policyName, operationID) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.ProtectionPolicyOperationStatusesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "backup.ProtectionPolicyOperationStatusesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.ProtectionPolicyOperationStatusesClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client ProtectionPolicyOperationStatusesClient) GetPreparer(ctx context.Context, vaultName string, resourceGroupName string, policyName string, operationID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "operationId": autorest.Encode("path", operationID), + "policyName": autorest.Encode("path", policyName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vaultName": autorest.Encode("path", vaultName), + } + + const APIVersion = "2016-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupPolicies/{policyName}/operations/{operationId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ProtectionPolicyOperationStatusesClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ProtectionPolicyOperationStatusesClient) GetResponder(resp *http.Response) (result OperationStatus, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2016-12-01/backup/recoverypoints.go b/vendor/github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2016-12-01/backup/recoverypoints.go new file mode 100644 index 000000000..b03dfbb7d --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2016-12-01/backup/recoverypoints.go @@ -0,0 +1,221 @@ +package backup + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "net/http" +) + +// RecoveryPointsClient is the open API 2.0 Specs for Azure RecoveryServices Backup service +type RecoveryPointsClient struct { + BaseClient +} + +// NewRecoveryPointsClient creates an instance of the RecoveryPointsClient client. +func NewRecoveryPointsClient(subscriptionID string) RecoveryPointsClient { + return NewRecoveryPointsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewRecoveryPointsClientWithBaseURI creates an instance of the RecoveryPointsClient client. +func NewRecoveryPointsClientWithBaseURI(baseURI string, subscriptionID string) RecoveryPointsClient { + return RecoveryPointsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get provides the information of the backed up data identified using RecoveryPointID. This is an asynchronous +// operation. To know the status of the operation, call the GetProtectedItemOperationResult API. +// Parameters: +// vaultName - the name of the recovery services vault. +// resourceGroupName - the name of the resource group where the recovery services vault is present. +// fabricName - fabric name associated with backed up item. +// containerName - container name associated with backed up item. +// protectedItemName - backed up item name whose backup data needs to be fetched. +// recoveryPointID - recoveryPointID represents the backed up data to be fetched. +func (client RecoveryPointsClient) Get(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, recoveryPointID string) (result RecoveryPointResource, err error) { + req, err := client.GetPreparer(ctx, vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointID) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.RecoveryPointsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "backup.RecoveryPointsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.RecoveryPointsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client RecoveryPointsClient) GetPreparer(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, recoveryPointID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "containerName": autorest.Encode("path", containerName), + "fabricName": autorest.Encode("path", fabricName), + "protectedItemName": autorest.Encode("path", protectedItemName), + "recoveryPointId": autorest.Encode("path", recoveryPointID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vaultName": autorest.Encode("path", vaultName), + } + + const APIVersion = "2016-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client RecoveryPointsClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client RecoveryPointsClient) GetResponder(resp *http.Response) (result RecoveryPointResource, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists the backup copies for the backed up item. +// Parameters: +// vaultName - the name of the recovery services vault. +// resourceGroupName - the name of the resource group where the recovery services vault is present. +// fabricName - fabric name associated with the backed up item. +// containerName - container name associated with the backed up item. +// protectedItemName - backed up item whose backup copies are to be fetched. +// filter - oData filter options. +func (client RecoveryPointsClient) List(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, filter string) (result RecoveryPointResourceListPage, err error) { + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, vaultName, resourceGroupName, fabricName, containerName, protectedItemName, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.RecoveryPointsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.rprl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "backup.RecoveryPointsClient", "List", resp, "Failure sending request") + return + } + + result.rprl, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.RecoveryPointsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client RecoveryPointsClient) ListPreparer(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "containerName": autorest.Encode("path", containerName), + "fabricName": autorest.Encode("path", fabricName), + "protectedItemName": autorest.Encode("path", protectedItemName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vaultName": autorest.Encode("path", vaultName), + } + + const APIVersion = "2016-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client RecoveryPointsClient) ListSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client RecoveryPointsClient) ListResponder(resp *http.Response) (result RecoveryPointResourceList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client RecoveryPointsClient) listNextResults(lastResults RecoveryPointResourceList) (result RecoveryPointResourceList, err error) { + req, err := lastResults.recoveryPointResourceListPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "backup.RecoveryPointsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "backup.RecoveryPointsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.RecoveryPointsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client RecoveryPointsClient) ListComplete(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, filter string) (result RecoveryPointResourceListIterator, err error) { + result.page, err = client.List(ctx, vaultName, resourceGroupName, fabricName, containerName, protectedItemName, filter) + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2016-12-01/backup/resourcestorageconfigs.go b/vendor/github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2016-12-01/backup/resourcestorageconfigs.go new file mode 100644 index 000000000..467d314da --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2016-12-01/backup/resourcestorageconfigs.go @@ -0,0 +1,176 @@ +package backup + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "net/http" +) + +// ResourceStorageConfigsClient is the open API 2.0 Specs for Azure RecoveryServices Backup service +type ResourceStorageConfigsClient struct { + BaseClient +} + +// NewResourceStorageConfigsClient creates an instance of the ResourceStorageConfigsClient client. +func NewResourceStorageConfigsClient(subscriptionID string) ResourceStorageConfigsClient { + return NewResourceStorageConfigsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewResourceStorageConfigsClientWithBaseURI creates an instance of the ResourceStorageConfigsClient client. +func NewResourceStorageConfigsClientWithBaseURI(baseURI string, subscriptionID string) ResourceStorageConfigsClient { + return ResourceStorageConfigsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get fetches resource storage config. +// Parameters: +// vaultName - the name of the recovery services vault. +// resourceGroupName - the name of the resource group where the recovery services vault is present. +func (client ResourceStorageConfigsClient) Get(ctx context.Context, vaultName string, resourceGroupName string) (result ResourceConfigResource, err error) { + req, err := client.GetPreparer(ctx, vaultName, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.ResourceStorageConfigsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "backup.ResourceStorageConfigsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.ResourceStorageConfigsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client ResourceStorageConfigsClient) GetPreparer(ctx context.Context, vaultName string, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vaultName": autorest.Encode("path", vaultName), + } + + const APIVersion = "2016-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ResourceStorageConfigsClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ResourceStorageConfigsClient) GetResponder(resp *http.Response) (result ResourceConfigResource, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Update updates vault storage model type. +// Parameters: +// vaultName - the name of the recovery services vault. +// resourceGroupName - the name of the resource group where the recovery services vault is present. +// parameters - vault storage config request +func (client ResourceStorageConfigsClient) Update(ctx context.Context, vaultName string, resourceGroupName string, parameters ResourceConfigResource) (result autorest.Response, err error) { + req, err := client.UpdatePreparer(ctx, vaultName, resourceGroupName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.ResourceStorageConfigsClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "backup.ResourceStorageConfigsClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.ResourceStorageConfigsClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client ResourceStorageConfigsClient) UpdatePreparer(ctx context.Context, vaultName string, resourceGroupName string, parameters ResourceConfigResource) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vaultName": autorest.Encode("path", vaultName), + } + + const APIVersion = "2016-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client ResourceStorageConfigsClient) UpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client ResourceStorageConfigsClient) UpdateResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2016-12-01/backup/resourcevaultconfigs.go b/vendor/github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2016-12-01/backup/resourcevaultconfigs.go new file mode 100644 index 000000000..dd336b6cb --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2016-12-01/backup/resourcevaultconfigs.go @@ -0,0 +1,177 @@ +package backup + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "net/http" +) + +// ResourceVaultConfigsClient is the open API 2.0 Specs for Azure RecoveryServices Backup service +type ResourceVaultConfigsClient struct { + BaseClient +} + +// NewResourceVaultConfigsClient creates an instance of the ResourceVaultConfigsClient client. +func NewResourceVaultConfigsClient(subscriptionID string) ResourceVaultConfigsClient { + return NewResourceVaultConfigsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewResourceVaultConfigsClientWithBaseURI creates an instance of the ResourceVaultConfigsClient client. +func NewResourceVaultConfigsClientWithBaseURI(baseURI string, subscriptionID string) ResourceVaultConfigsClient { + return ResourceVaultConfigsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get fetches resource vault config. +// Parameters: +// vaultName - the name of the recovery services vault. +// resourceGroupName - the name of the resource group where the recovery services vault is present. +func (client ResourceVaultConfigsClient) Get(ctx context.Context, vaultName string, resourceGroupName string) (result ResourceVaultConfigResource, err error) { + req, err := client.GetPreparer(ctx, vaultName, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.ResourceVaultConfigsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "backup.ResourceVaultConfigsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.ResourceVaultConfigsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client ResourceVaultConfigsClient) GetPreparer(ctx context.Context, vaultName string, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vaultName": autorest.Encode("path", vaultName), + } + + const APIVersion = "2016-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupconfig/vaultconfig", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ResourceVaultConfigsClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ResourceVaultConfigsClient) GetResponder(resp *http.Response) (result ResourceVaultConfigResource, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Update updates vault security config. +// Parameters: +// vaultName - the name of the recovery services vault. +// resourceGroupName - the name of the resource group where the recovery services vault is present. +// parameters - resource config request +func (client ResourceVaultConfigsClient) Update(ctx context.Context, vaultName string, resourceGroupName string, parameters ResourceVaultConfigResource) (result ResourceVaultConfigResource, err error) { + req, err := client.UpdatePreparer(ctx, vaultName, resourceGroupName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.ResourceVaultConfigsClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "backup.ResourceVaultConfigsClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.ResourceVaultConfigsClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client ResourceVaultConfigsClient) UpdatePreparer(ctx context.Context, vaultName string, resourceGroupName string, parameters ResourceVaultConfigResource) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vaultName": autorest.Encode("path", vaultName), + } + + const APIVersion = "2016-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupconfig/vaultconfig", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client ResourceVaultConfigsClient) UpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client ResourceVaultConfigsClient) UpdateResponder(resp *http.Response) (result ResourceVaultConfigResource, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2016-12-01/backup/restores.go b/vendor/github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2016-12-01/backup/restores.go new file mode 100644 index 000000000..d44d95cca --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2016-12-01/backup/restores.go @@ -0,0 +1,118 @@ +package backup + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "net/http" +) + +// RestoresClient is the open API 2.0 Specs for Azure RecoveryServices Backup service +type RestoresClient struct { + BaseClient +} + +// NewRestoresClient creates an instance of the RestoresClient client. +func NewRestoresClient(subscriptionID string) RestoresClient { + return NewRestoresClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewRestoresClientWithBaseURI creates an instance of the RestoresClient client. +func NewRestoresClientWithBaseURI(baseURI string, subscriptionID string) RestoresClient { + return RestoresClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Trigger restores the specified backed up data. This is an asynchronous operation. To know the status of this API +// call, use GetProtectedItemOperationResult API. +// Parameters: +// vaultName - the name of the recovery services vault. +// resourceGroupName - the name of the resource group where the recovery services vault is present. +// fabricName - fabric name associated with the backed up items. +// containerName - container name associated with the backed up items. +// protectedItemName - backed up item to be restored. +// recoveryPointID - recovery point ID which represents the backed up data to be restored. +// parameters - resource restore request +func (client RestoresClient) Trigger(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, recoveryPointID string, parameters RestoreRequestResource) (result autorest.Response, err error) { + req, err := client.TriggerPreparer(ctx, vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointID, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.RestoresClient", "Trigger", nil, "Failure preparing request") + return + } + + resp, err := client.TriggerSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "backup.RestoresClient", "Trigger", resp, "Failure sending request") + return + } + + result, err = client.TriggerResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.RestoresClient", "Trigger", resp, "Failure responding to request") + } + + return +} + +// TriggerPreparer prepares the Trigger request. +func (client RestoresClient) TriggerPreparer(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, recoveryPointID string, parameters RestoreRequestResource) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "containerName": autorest.Encode("path", containerName), + "fabricName": autorest.Encode("path", fabricName), + "protectedItemName": autorest.Encode("path", protectedItemName), + "recoveryPointId": autorest.Encode("path", recoveryPointID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vaultName": autorest.Encode("path", vaultName), + } + + const APIVersion = "2016-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointId}/restore", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// TriggerSender sends the Trigger request. The method will close the +// http.Response Body if it receives an error. +func (client RestoresClient) TriggerSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// TriggerResponder handles the response to the Trigger request. The method always +// closes the http.Response Body. +func (client RestoresClient) TriggerResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2016-12-01/backup/securitypins.go b/vendor/github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2016-12-01/backup/securitypins.go new file mode 100644 index 000000000..30b619af5 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2016-12-01/backup/securitypins.go @@ -0,0 +1,107 @@ +package backup + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "net/http" +) + +// SecurityPINsClient is the open API 2.0 Specs for Azure RecoveryServices Backup service +type SecurityPINsClient struct { + BaseClient +} + +// NewSecurityPINsClient creates an instance of the SecurityPINsClient client. +func NewSecurityPINsClient(subscriptionID string) SecurityPINsClient { + return NewSecurityPINsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewSecurityPINsClientWithBaseURI creates an instance of the SecurityPINsClient client. +func NewSecurityPINsClientWithBaseURI(baseURI string, subscriptionID string) SecurityPINsClient { + return SecurityPINsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get get the security PIN. +// Parameters: +// vaultName - the name of the recovery services vault. +// resourceGroupName - the name of the resource group where the recovery services vault is present. +func (client SecurityPINsClient) Get(ctx context.Context, vaultName string, resourceGroupName string) (result TokenInformation, err error) { + req, err := client.GetPreparer(ctx, vaultName, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.SecurityPINsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "backup.SecurityPINsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.SecurityPINsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client SecurityPINsClient) GetPreparer(ctx context.Context, vaultName string, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vaultName": autorest.Encode("path", vaultName), + } + + const APIVersion = "2016-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupSecurityPIN", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client SecurityPINsClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client SecurityPINsClient) GetResponder(resp *http.Response) (result TokenInformation, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2016-12-01/backup/version.go b/vendor/github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2016-12-01/backup/version.go new file mode 100644 index 000000000..6789f2a16 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2016-12-01/backup/version.go @@ -0,0 +1,30 @@ +package backup + +import "github.com/Azure/azure-sdk-for-go/version" + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// UserAgent returns the UserAgent string to use when sending http.Requests. +func UserAgent() string { + return "Azure-SDK-For-Go/" + version.Number + " backup/2016-12-01" +} + +// Version returns the semantic version (see http://semver.org) of the client. +func Version() string { + return version.Number +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2016-12-01/backup/workloaditems.go b/vendor/github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2016-12-01/backup/workloaditems.go new file mode 100644 index 000000000..082037efb --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2016-12-01/backup/workloaditems.go @@ -0,0 +1,148 @@ +package backup + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "net/http" +) + +// WorkloadItemsClient is the open API 2.0 Specs for Azure RecoveryServices Backup service +type WorkloadItemsClient struct { + BaseClient +} + +// NewWorkloadItemsClient creates an instance of the WorkloadItemsClient client. +func NewWorkloadItemsClient(subscriptionID string) WorkloadItemsClient { + return NewWorkloadItemsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewWorkloadItemsClientWithBaseURI creates an instance of the WorkloadItemsClient client. +func NewWorkloadItemsClientWithBaseURI(baseURI string, subscriptionID string) WorkloadItemsClient { + return WorkloadItemsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// List provides a pageable list of workload item of a specific container according to the query filter and the +// pagination parameters. +// Parameters: +// vaultName - the name of the recovery services vault. +// resourceGroupName - the name of the resource group where the recovery services vault is present. +// fabricName - fabric name associated with the container. +// containerName - name of the container. +// filter - oData filter options. +// skipToken - skipToken Filter. +func (client WorkloadItemsClient) List(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, filter string, skipToken string) (result WorkloadItemResourceListPage, err error) { + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, vaultName, resourceGroupName, fabricName, containerName, filter, skipToken) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.WorkloadItemsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.wirl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "backup.WorkloadItemsClient", "List", resp, "Failure sending request") + return + } + + result.wirl, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.WorkloadItemsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client WorkloadItemsClient) ListPreparer(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, filter string, skipToken string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "containerName": autorest.Encode("path", containerName), + "fabricName": autorest.Encode("path", fabricName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vaultName": autorest.Encode("path", vaultName), + } + + const APIVersion = "2016-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if len(skipToken) > 0 { + queryParameters["$skipToken"] = autorest.Encode("query", skipToken) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/items", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client WorkloadItemsClient) ListSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client WorkloadItemsClient) ListResponder(resp *http.Response) (result WorkloadItemResourceList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client WorkloadItemsClient) listNextResults(lastResults WorkloadItemResourceList) (result WorkloadItemResourceList, err error) { + req, err := lastResults.workloadItemResourceListPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "backup.WorkloadItemsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "backup.WorkloadItemsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.WorkloadItemsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client WorkloadItemsClient) ListComplete(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, filter string, skipToken string) (result WorkloadItemResourceListIterator, err error) { + result.page, err = client.List(ctx, vaultName, resourceGroupName, fabricName, containerName, filter, skipToken) + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2017-07-01/backup/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2017-07-01/backup/models.go index 55ecf36af..2d5c35376 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2017-07-01/backup/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2017-07-01/backup/models.go @@ -54,8 +54,12 @@ const ( ContainerTypeCluster ContainerType = "Cluster" // ContainerTypeDPMContainer ... ContainerTypeDPMContainer ContainerType = "DPMContainer" + // ContainerTypeExchangeDAG ... + ContainerTypeExchangeDAG ContainerType = "ExchangeDAG" // ContainerTypeGenericContainer ... ContainerTypeGenericContainer ContainerType = "GenericContainer" + // ContainerTypeHyperVCluster ... + ContainerTypeHyperVCluster ContainerType = "HyperVCluster" // ContainerTypeIaasVMContainer ... ContainerTypeIaasVMContainer ContainerType = "IaasVMContainer" // ContainerTypeIaasVMServiceContainer ... @@ -64,8 +68,12 @@ const ( ContainerTypeInvalid ContainerType = "Invalid" // ContainerTypeMABContainer ... ContainerTypeMABContainer ContainerType = "MABContainer" + // ContainerTypeSharepointFarm ... + ContainerTypeSharepointFarm ContainerType = "SharepointFarm" // ContainerTypeSQLAGWorkLoadContainer ... ContainerTypeSQLAGWorkLoadContainer ContainerType = "SQLAGWorkLoadContainer" + // ContainerTypeSQLCluster ... + ContainerTypeSQLCluster ContainerType = "SqlCluster" // ContainerTypeStorageContainer ... ContainerTypeStorageContainer ContainerType = "StorageContainer" // ContainerTypeUnknown ... @@ -76,11 +84,13 @@ const ( ContainerTypeVMAppContainer ContainerType = "VMAppContainer" // ContainerTypeWindows ... ContainerTypeWindows ContainerType = "Windows" + // ContainerTypeWindowsClient ... + ContainerTypeWindowsClient ContainerType = "WindowsClient" ) // PossibleContainerTypeValues returns an array of possible values for the ContainerType const type. func PossibleContainerTypeValues() []ContainerType { - return []ContainerType{ContainerTypeAzureBackupServerContainer, ContainerTypeAzureSQLContainer, ContainerTypeCluster, ContainerTypeDPMContainer, ContainerTypeGenericContainer, ContainerTypeIaasVMContainer, ContainerTypeIaasVMServiceContainer, ContainerTypeInvalid, ContainerTypeMABContainer, ContainerTypeSQLAGWorkLoadContainer, ContainerTypeStorageContainer, ContainerTypeUnknown, ContainerTypeVCenter, ContainerTypeVMAppContainer, ContainerTypeWindows} + return []ContainerType{ContainerTypeAzureBackupServerContainer, ContainerTypeAzureSQLContainer, ContainerTypeCluster, ContainerTypeDPMContainer, ContainerTypeExchangeDAG, ContainerTypeGenericContainer, ContainerTypeHyperVCluster, ContainerTypeIaasVMContainer, ContainerTypeIaasVMServiceContainer, ContainerTypeInvalid, ContainerTypeMABContainer, ContainerTypeSharepointFarm, ContainerTypeSQLAGWorkLoadContainer, ContainerTypeSQLCluster, ContainerTypeStorageContainer, ContainerTypeUnknown, ContainerTypeVCenter, ContainerTypeVMAppContainer, ContainerTypeWindows, ContainerTypeWindowsClient} } // ContainerTypeBasicProtectionContainer enumerates the values for container type basic protection container. @@ -99,8 +109,6 @@ const ( ContainerTypeGenericContainer1 ContainerTypeBasicProtectionContainer = "GenericContainer" // ContainerTypeIaaSVMContainer ... ContainerTypeIaaSVMContainer ContainerTypeBasicProtectionContainer = "IaaSVMContainer" - // ContainerTypeMABWindowsContainer ... - ContainerTypeMABWindowsContainer ContainerTypeBasicProtectionContainer = "MABWindowsContainer" // ContainerTypeMicrosoftClassicComputevirtualMachines ... ContainerTypeMicrosoftClassicComputevirtualMachines ContainerTypeBasicProtectionContainer = "Microsoft.ClassicCompute/virtualMachines" // ContainerTypeMicrosoftComputevirtualMachines ... @@ -113,11 +121,13 @@ const ( ContainerTypeStorageContainer1 ContainerTypeBasicProtectionContainer = "StorageContainer" // ContainerTypeVMAppContainer1 ... ContainerTypeVMAppContainer1 ContainerTypeBasicProtectionContainer = "VMAppContainer" + // ContainerTypeWindows1 ... + ContainerTypeWindows1 ContainerTypeBasicProtectionContainer = "Windows" ) // PossibleContainerTypeBasicProtectionContainerValues returns an array of possible values for the ContainerTypeBasicProtectionContainer const type. func PossibleContainerTypeBasicProtectionContainerValues() []ContainerTypeBasicProtectionContainer { - return []ContainerTypeBasicProtectionContainer{ContainerTypeAzureBackupServerContainer1, ContainerTypeAzureSQLContainer1, ContainerTypeAzureWorkloadContainer, ContainerTypeDPMContainer1, ContainerTypeGenericContainer1, ContainerTypeIaaSVMContainer, ContainerTypeMABWindowsContainer, ContainerTypeMicrosoftClassicComputevirtualMachines, ContainerTypeMicrosoftComputevirtualMachines, ContainerTypeProtectionContainer, ContainerTypeSQLAGWorkLoadContainer1, ContainerTypeStorageContainer1, ContainerTypeVMAppContainer1} + return []ContainerTypeBasicProtectionContainer{ContainerTypeAzureBackupServerContainer1, ContainerTypeAzureSQLContainer1, ContainerTypeAzureWorkloadContainer, ContainerTypeDPMContainer1, ContainerTypeGenericContainer1, ContainerTypeIaaSVMContainer, ContainerTypeMicrosoftClassicComputevirtualMachines, ContainerTypeMicrosoftComputevirtualMachines, ContainerTypeProtectionContainer, ContainerTypeSQLAGWorkLoadContainer1, ContainerTypeStorageContainer1, ContainerTypeVMAppContainer1, ContainerTypeWindows1} } // CopyOptions enumerates the values for copy options. @@ -141,6 +151,23 @@ func PossibleCopyOptionsValues() []CopyOptions { return []CopyOptions{CopyOptionsCreateCopy, CopyOptionsFailOnConflict, CopyOptionsInvalid, CopyOptionsOverwrite, CopyOptionsSkip} } +// CreateMode enumerates the values for create mode. +type CreateMode string + +const ( + // CreateModeDefault ... + CreateModeDefault CreateMode = "Default" + // CreateModeInvalid ... + CreateModeInvalid CreateMode = "Invalid" + // CreateModeRecover ... + CreateModeRecover CreateMode = "Recover" +) + +// PossibleCreateModeValues returns an array of possible values for the CreateMode const type. +func PossibleCreateModeValues() []CreateMode { + return []CreateMode{CreateModeDefault, CreateModeInvalid, CreateModeRecover} +} + // DataSourceType enumerates the values for data source type. type DataSourceType string @@ -159,6 +186,8 @@ const ( DataSourceTypeGenericDataSource DataSourceType = "GenericDataSource" // DataSourceTypeInvalid ... DataSourceTypeInvalid DataSourceType = "Invalid" + // DataSourceTypeSAPHanaDatabase ... + DataSourceTypeSAPHanaDatabase DataSourceType = "SAPHanaDatabase" // DataSourceTypeSharepoint ... DataSourceTypeSharepoint DataSourceType = "Sharepoint" // DataSourceTypeSQLDataBase ... @@ -175,7 +204,7 @@ const ( // PossibleDataSourceTypeValues returns an array of possible values for the DataSourceType const type. func PossibleDataSourceTypeValues() []DataSourceType { - return []DataSourceType{DataSourceTypeAzureFileShare, DataSourceTypeAzureSQLDb, DataSourceTypeClient, DataSourceTypeExchange, DataSourceTypeFileFolder, DataSourceTypeGenericDataSource, DataSourceTypeInvalid, DataSourceTypeSharepoint, DataSourceTypeSQLDataBase, DataSourceTypeSQLDB, DataSourceTypeSystemState, DataSourceTypeVM, DataSourceTypeVMwareVM} + return []DataSourceType{DataSourceTypeAzureFileShare, DataSourceTypeAzureSQLDb, DataSourceTypeClient, DataSourceTypeExchange, DataSourceTypeFileFolder, DataSourceTypeGenericDataSource, DataSourceTypeInvalid, DataSourceTypeSAPHanaDatabase, DataSourceTypeSharepoint, DataSourceTypeSQLDataBase, DataSourceTypeSQLDB, DataSourceTypeSystemState, DataSourceTypeVM, DataSourceTypeVMwareVM} } // DayOfWeek enumerates the values for day of week. @@ -256,6 +285,8 @@ func PossibleFabricNameValues() []FabricName { type FeatureType string const ( + // FeatureTypeAzureBackupGoals ... + FeatureTypeAzureBackupGoals FeatureType = "AzureBackupGoals" // FeatureTypeAzureVMResourceBackup ... FeatureTypeAzureVMResourceBackup FeatureType = "AzureVMResourceBackup" // FeatureTypeFeatureSupportRequest ... @@ -264,7 +295,7 @@ const ( // PossibleFeatureTypeValues returns an array of possible values for the FeatureType const type. func PossibleFeatureTypeValues() []FeatureType { - return []FeatureType{FeatureTypeAzureVMResourceBackup, FeatureTypeFeatureSupportRequest} + return []FeatureType{FeatureTypeAzureBackupGoals, FeatureTypeAzureVMResourceBackup, FeatureTypeFeatureSupportRequest} } // HealthState enumerates the values for health state. @@ -445,6 +476,8 @@ const ( ItemTypeGenericDataSource ItemType = "GenericDataSource" // ItemTypeInvalid ... ItemTypeInvalid ItemType = "Invalid" + // ItemTypeSAPHanaDatabase ... + ItemTypeSAPHanaDatabase ItemType = "SAPHanaDatabase" // ItemTypeSharepoint ... ItemTypeSharepoint ItemType = "Sharepoint" // ItemTypeSQLDataBase ... @@ -461,7 +494,7 @@ const ( // PossibleItemTypeValues returns an array of possible values for the ItemType const type. func PossibleItemTypeValues() []ItemType { - return []ItemType{ItemTypeAzureFileShare, ItemTypeAzureSQLDb, ItemTypeClient, ItemTypeExchange, ItemTypeFileFolder, ItemTypeGenericDataSource, ItemTypeInvalid, ItemTypeSharepoint, ItemTypeSQLDataBase, ItemTypeSQLDB, ItemTypeSystemState, ItemTypeVM, ItemTypeVMwareVM} + return []ItemType{ItemTypeAzureFileShare, ItemTypeAzureSQLDb, ItemTypeClient, ItemTypeExchange, ItemTypeFileFolder, ItemTypeGenericDataSource, ItemTypeInvalid, ItemTypeSAPHanaDatabase, ItemTypeSharepoint, ItemTypeSQLDataBase, ItemTypeSQLDB, ItemTypeSystemState, ItemTypeVM, ItemTypeVMwareVM} } // JobOperationType enumerates the values for job operation type. @@ -587,8 +620,12 @@ const ( MabServerTypeCluster MabServerType = "Cluster" // MabServerTypeDPMContainer ... MabServerTypeDPMContainer MabServerType = "DPMContainer" + // MabServerTypeExchangeDAG ... + MabServerTypeExchangeDAG MabServerType = "ExchangeDAG" // MabServerTypeGenericContainer ... MabServerTypeGenericContainer MabServerType = "GenericContainer" + // MabServerTypeHyperVCluster ... + MabServerTypeHyperVCluster MabServerType = "HyperVCluster" // MabServerTypeIaasVMContainer ... MabServerTypeIaasVMContainer MabServerType = "IaasVMContainer" // MabServerTypeIaasVMServiceContainer ... @@ -597,8 +634,12 @@ const ( MabServerTypeInvalid MabServerType = "Invalid" // MabServerTypeMABContainer ... MabServerTypeMABContainer MabServerType = "MABContainer" + // MabServerTypeSharepointFarm ... + MabServerTypeSharepointFarm MabServerType = "SharepointFarm" // MabServerTypeSQLAGWorkLoadContainer ... MabServerTypeSQLAGWorkLoadContainer MabServerType = "SQLAGWorkLoadContainer" + // MabServerTypeSQLCluster ... + MabServerTypeSQLCluster MabServerType = "SqlCluster" // MabServerTypeStorageContainer ... MabServerTypeStorageContainer MabServerType = "StorageContainer" // MabServerTypeUnknown ... @@ -609,11 +650,13 @@ const ( MabServerTypeVMAppContainer MabServerType = "VMAppContainer" // MabServerTypeWindows ... MabServerTypeWindows MabServerType = "Windows" + // MabServerTypeWindowsClient ... + MabServerTypeWindowsClient MabServerType = "WindowsClient" ) // PossibleMabServerTypeValues returns an array of possible values for the MabServerType const type. func PossibleMabServerTypeValues() []MabServerType { - return []MabServerType{MabServerTypeAzureBackupServerContainer, MabServerTypeAzureSQLContainer, MabServerTypeCluster, MabServerTypeDPMContainer, MabServerTypeGenericContainer, MabServerTypeIaasVMContainer, MabServerTypeIaasVMServiceContainer, MabServerTypeInvalid, MabServerTypeMABContainer, MabServerTypeSQLAGWorkLoadContainer, MabServerTypeStorageContainer, MabServerTypeUnknown, MabServerTypeVCenter, MabServerTypeVMAppContainer, MabServerTypeWindows} + return []MabServerType{MabServerTypeAzureBackupServerContainer, MabServerTypeAzureSQLContainer, MabServerTypeCluster, MabServerTypeDPMContainer, MabServerTypeExchangeDAG, MabServerTypeGenericContainer, MabServerTypeHyperVCluster, MabServerTypeIaasVMContainer, MabServerTypeIaasVMServiceContainer, MabServerTypeInvalid, MabServerTypeMABContainer, MabServerTypeSharepointFarm, MabServerTypeSQLAGWorkLoadContainer, MabServerTypeSQLCluster, MabServerTypeStorageContainer, MabServerTypeUnknown, MabServerTypeVCenter, MabServerTypeVMAppContainer, MabServerTypeWindows, MabServerTypeWindowsClient} } // ManagementType enumerates the values for management type. @@ -786,6 +829,10 @@ const ( ObjectTypeAzureFileShareRecoveryPoint ObjectTypeBasicRecoveryPoint = "AzureFileShareRecoveryPoint" // ObjectTypeAzureWorkloadRecoveryPoint ... ObjectTypeAzureWorkloadRecoveryPoint ObjectTypeBasicRecoveryPoint = "AzureWorkloadRecoveryPoint" + // ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint ... + ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint ObjectTypeBasicRecoveryPoint = "AzureWorkloadSAPHanaPointInTimeRecoveryPoint" + // ObjectTypeAzureWorkloadSAPHanaRecoveryPoint ... + ObjectTypeAzureWorkloadSAPHanaRecoveryPoint ObjectTypeBasicRecoveryPoint = "AzureWorkloadSAPHanaRecoveryPoint" // ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint ... ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint ObjectTypeBasicRecoveryPoint = "AzureWorkloadSQLPointInTimeRecoveryPoint" // ObjectTypeAzureWorkloadSQLRecoveryPoint ... @@ -800,7 +847,7 @@ const ( // PossibleObjectTypeBasicRecoveryPointValues returns an array of possible values for the ObjectTypeBasicRecoveryPoint const type. func PossibleObjectTypeBasicRecoveryPointValues() []ObjectTypeBasicRecoveryPoint { - return []ObjectTypeBasicRecoveryPoint{ObjectTypeAzureFileShareRecoveryPoint, ObjectTypeAzureWorkloadRecoveryPoint, ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint, ObjectTypeAzureWorkloadSQLRecoveryPoint, ObjectTypeGenericRecoveryPoint, ObjectTypeIaasVMRecoveryPoint, ObjectTypeRecoveryPoint} + return []ObjectTypeBasicRecoveryPoint{ObjectTypeAzureFileShareRecoveryPoint, ObjectTypeAzureWorkloadRecoveryPoint, ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint, ObjectTypeAzureWorkloadSAPHanaRecoveryPoint, ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint, ObjectTypeAzureWorkloadSQLRecoveryPoint, ObjectTypeGenericRecoveryPoint, ObjectTypeIaasVMRecoveryPoint, ObjectTypeRecoveryPoint} } // ObjectTypeBasicRestoreRequest enumerates the values for object type basic restore request. @@ -811,6 +858,10 @@ const ( ObjectTypeAzureFileShareRestoreRequest ObjectTypeBasicRestoreRequest = "AzureFileShareRestoreRequest" // ObjectTypeAzureWorkloadRestoreRequest ... ObjectTypeAzureWorkloadRestoreRequest ObjectTypeBasicRestoreRequest = "AzureWorkloadRestoreRequest" + // ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest ... + ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest ObjectTypeBasicRestoreRequest = "AzureWorkloadSAPHanaPointInTimeRestoreRequest" + // ObjectTypeAzureWorkloadSAPHanaRestoreRequest ... + ObjectTypeAzureWorkloadSAPHanaRestoreRequest ObjectTypeBasicRestoreRequest = "AzureWorkloadSAPHanaRestoreRequest" // ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest ... ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest ObjectTypeBasicRestoreRequest = "AzureWorkloadSQLPointInTimeRestoreRequest" // ObjectTypeAzureWorkloadSQLRestoreRequest ... @@ -823,7 +874,7 @@ const ( // PossibleObjectTypeBasicRestoreRequestValues returns an array of possible values for the ObjectTypeBasicRestoreRequest const type. func PossibleObjectTypeBasicRestoreRequestValues() []ObjectTypeBasicRestoreRequest { - return []ObjectTypeBasicRestoreRequest{ObjectTypeAzureFileShareRestoreRequest, ObjectTypeAzureWorkloadRestoreRequest, ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest, ObjectTypeAzureWorkloadSQLRestoreRequest, ObjectTypeIaasVMRestoreRequest, ObjectTypeRestoreRequest} + return []ObjectTypeBasicRestoreRequest{ObjectTypeAzureFileShareRestoreRequest, ObjectTypeAzureWorkloadRestoreRequest, ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest, ObjectTypeAzureWorkloadSAPHanaRestoreRequest, ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest, ObjectTypeAzureWorkloadSQLRestoreRequest, ObjectTypeIaasVMRestoreRequest, ObjectTypeRestoreRequest} } // OperationStatusValues enumerates the values for operation status values. @@ -895,6 +946,10 @@ const ( ProtectableItemTypeMicrosoftClassicComputevirtualMachines ProtectableItemType = "Microsoft.ClassicCompute/virtualMachines" // ProtectableItemTypeMicrosoftComputevirtualMachines ... ProtectableItemTypeMicrosoftComputevirtualMachines ProtectableItemType = "Microsoft.Compute/virtualMachines" + // ProtectableItemTypeSAPHanaDatabase ... + ProtectableItemTypeSAPHanaDatabase ProtectableItemType = "SAPHanaDatabase" + // ProtectableItemTypeSAPHanaSystem ... + ProtectableItemTypeSAPHanaSystem ProtectableItemType = "SAPHanaSystem" // ProtectableItemTypeSQLAvailabilityGroupContainer ... ProtectableItemTypeSQLAvailabilityGroupContainer ProtectableItemType = "SQLAvailabilityGroupContainer" // ProtectableItemTypeSQLDataBase ... @@ -907,7 +962,7 @@ const ( // PossibleProtectableItemTypeValues returns an array of possible values for the ProtectableItemType const type. func PossibleProtectableItemTypeValues() []ProtectableItemType { - return []ProtectableItemType{ProtectableItemTypeAzureFileShare, ProtectableItemTypeAzureVMWorkloadProtectableItem, ProtectableItemTypeIaaSVMProtectableItem, ProtectableItemTypeMicrosoftClassicComputevirtualMachines, ProtectableItemTypeMicrosoftComputevirtualMachines, ProtectableItemTypeSQLAvailabilityGroupContainer, ProtectableItemTypeSQLDataBase, ProtectableItemTypeSQLInstance, ProtectableItemTypeWorkloadProtectableItem} + return []ProtectableItemType{ProtectableItemTypeAzureFileShare, ProtectableItemTypeAzureVMWorkloadProtectableItem, ProtectableItemTypeIaaSVMProtectableItem, ProtectableItemTypeMicrosoftClassicComputevirtualMachines, ProtectableItemTypeMicrosoftComputevirtualMachines, ProtectableItemTypeSAPHanaDatabase, ProtectableItemTypeSAPHanaSystem, ProtectableItemTypeSQLAvailabilityGroupContainer, ProtectableItemTypeSQLDataBase, ProtectableItemTypeSQLInstance, ProtectableItemTypeWorkloadProtectableItem} } // ProtectedItemHealthStatus enumerates the values for protected item health status. @@ -962,6 +1017,10 @@ const ( ProtectedItemTypeAzureFileShareProtectedItem ProtectedItemType = "AzureFileShareProtectedItem" // ProtectedItemTypeAzureIaaSVMProtectedItem ... ProtectedItemTypeAzureIaaSVMProtectedItem ProtectedItemType = "AzureIaaSVMProtectedItem" + // ProtectedItemTypeAzureVMWorkloadProtectedItem ... + ProtectedItemTypeAzureVMWorkloadProtectedItem ProtectedItemType = "AzureVmWorkloadProtectedItem" + // ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase ... + ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase ProtectedItemType = "AzureVmWorkloadSAPHanaDatabase" // ProtectedItemTypeAzureVMWorkloadSQLDatabase ... ProtectedItemTypeAzureVMWorkloadSQLDatabase ProtectedItemType = "AzureVmWorkloadSQLDatabase" // ProtectedItemTypeDPMProtectedItem ... @@ -982,7 +1041,7 @@ const ( // PossibleProtectedItemTypeValues returns an array of possible values for the ProtectedItemType const type. func PossibleProtectedItemTypeValues() []ProtectedItemType { - return []ProtectedItemType{ProtectedItemTypeAzureFileShareProtectedItem, ProtectedItemTypeAzureIaaSVMProtectedItem, ProtectedItemTypeAzureVMWorkloadSQLDatabase, ProtectedItemTypeDPMProtectedItem, ProtectedItemTypeGenericProtectedItem, ProtectedItemTypeMabFileFolderProtectedItem, ProtectedItemTypeMicrosoftClassicComputevirtualMachines, ProtectedItemTypeMicrosoftComputevirtualMachines, ProtectedItemTypeMicrosoftSqlserversdatabases, ProtectedItemTypeProtectedItem} + return []ProtectedItemType{ProtectedItemTypeAzureFileShareProtectedItem, ProtectedItemTypeAzureIaaSVMProtectedItem, ProtectedItemTypeAzureVMWorkloadProtectedItem, ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase, ProtectedItemTypeAzureVMWorkloadSQLDatabase, ProtectedItemTypeDPMProtectedItem, ProtectedItemTypeGenericProtectedItem, ProtectedItemTypeMabFileFolderProtectedItem, ProtectedItemTypeMicrosoftClassicComputevirtualMachines, ProtectedItemTypeMicrosoftComputevirtualMachines, ProtectedItemTypeMicrosoftSqlserversdatabases, ProtectedItemTypeProtectedItem} } // ProtectionIntentItemType enumerates the values for protection intent item type. @@ -991,13 +1050,19 @@ type ProtectionIntentItemType string const ( // ProtectionIntentItemTypeAzureResourceItem ... ProtectionIntentItemTypeAzureResourceItem ProtectionIntentItemType = "AzureResourceItem" + // ProtectionIntentItemTypeAzureWorkloadAutoProtectionIntent ... + ProtectionIntentItemTypeAzureWorkloadAutoProtectionIntent ProtectionIntentItemType = "AzureWorkloadAutoProtectionIntent" + // ProtectionIntentItemTypeAzureWorkloadSQLAutoProtectionIntent ... + ProtectionIntentItemTypeAzureWorkloadSQLAutoProtectionIntent ProtectionIntentItemType = "AzureWorkloadSQLAutoProtectionIntent" // ProtectionIntentItemTypeProtectionIntent ... ProtectionIntentItemTypeProtectionIntent ProtectionIntentItemType = "ProtectionIntent" + // ProtectionIntentItemTypeRecoveryServiceVaultItem ... + ProtectionIntentItemTypeRecoveryServiceVaultItem ProtectionIntentItemType = "RecoveryServiceVaultItem" ) // PossibleProtectionIntentItemTypeValues returns an array of possible values for the ProtectionIntentItemType const type. func PossibleProtectionIntentItemTypeValues() []ProtectionIntentItemType { - return []ProtectionIntentItemType{ProtectionIntentItemTypeAzureResourceItem, ProtectionIntentItemTypeProtectionIntent} + return []ProtectionIntentItemType{ProtectionIntentItemTypeAzureResourceItem, ProtectionIntentItemTypeAzureWorkloadAutoProtectionIntent, ProtectionIntentItemTypeAzureWorkloadSQLAutoProtectionIntent, ProtectionIntentItemTypeProtectionIntent, ProtectionIntentItemTypeRecoveryServiceVaultItem} } // ProtectionState enumerates the values for protection state. @@ -1403,21 +1468,23 @@ func PossibleValidationStatusValues() []ValidationStatus { type WeekOfMonth string const ( - // First ... - First WeekOfMonth = "First" - // Fourth ... - Fourth WeekOfMonth = "Fourth" - // Last ... - Last WeekOfMonth = "Last" - // Second ... - Second WeekOfMonth = "Second" - // Third ... - Third WeekOfMonth = "Third" + // WeekOfMonthFirst ... + WeekOfMonthFirst WeekOfMonth = "First" + // WeekOfMonthFourth ... + WeekOfMonthFourth WeekOfMonth = "Fourth" + // WeekOfMonthInvalid ... + WeekOfMonthInvalid WeekOfMonth = "Invalid" + // WeekOfMonthLast ... + WeekOfMonthLast WeekOfMonth = "Last" + // WeekOfMonthSecond ... + WeekOfMonthSecond WeekOfMonth = "Second" + // WeekOfMonthThird ... + WeekOfMonthThird WeekOfMonth = "Third" ) // PossibleWeekOfMonthValues returns an array of possible values for the WeekOfMonth const type. func PossibleWeekOfMonthValues() []WeekOfMonth { - return []WeekOfMonth{First, Fourth, Last, Second, Third} + return []WeekOfMonth{WeekOfMonthFirst, WeekOfMonthFourth, WeekOfMonthInvalid, WeekOfMonthLast, WeekOfMonthSecond, WeekOfMonthThird} } // WorkloadItemType enumerates the values for workload item type. @@ -1426,6 +1493,10 @@ type WorkloadItemType string const ( // WorkloadItemTypeInvalid ... WorkloadItemTypeInvalid WorkloadItemType = "Invalid" + // WorkloadItemTypeSAPHanaDatabase ... + WorkloadItemTypeSAPHanaDatabase WorkloadItemType = "SAPHanaDatabase" + // WorkloadItemTypeSAPHanaSystem ... + WorkloadItemTypeSAPHanaSystem WorkloadItemType = "SAPHanaSystem" // WorkloadItemTypeSQLDataBase ... WorkloadItemTypeSQLDataBase WorkloadItemType = "SQLDataBase" // WorkloadItemTypeSQLInstance ... @@ -1434,7 +1505,7 @@ const ( // PossibleWorkloadItemTypeValues returns an array of possible values for the WorkloadItemType const type. func PossibleWorkloadItemTypeValues() []WorkloadItemType { - return []WorkloadItemType{WorkloadItemTypeInvalid, WorkloadItemTypeSQLDataBase, WorkloadItemTypeSQLInstance} + return []WorkloadItemType{WorkloadItemTypeInvalid, WorkloadItemTypeSAPHanaDatabase, WorkloadItemTypeSAPHanaSystem, WorkloadItemTypeSQLDataBase, WorkloadItemTypeSQLInstance} } // WorkloadItemTypeBasicWorkloadItem enumerates the values for workload item type basic workload item. @@ -1443,6 +1514,10 @@ type WorkloadItemTypeBasicWorkloadItem string const ( // WorkloadItemTypeAzureVMWorkloadItem ... WorkloadItemTypeAzureVMWorkloadItem WorkloadItemTypeBasicWorkloadItem = "AzureVmWorkloadItem" + // WorkloadItemTypeSAPHanaDatabase1 ... + WorkloadItemTypeSAPHanaDatabase1 WorkloadItemTypeBasicWorkloadItem = "SAPHanaDatabase" + // WorkloadItemTypeSAPHanaSystem1 ... + WorkloadItemTypeSAPHanaSystem1 WorkloadItemTypeBasicWorkloadItem = "SAPHanaSystem" // WorkloadItemTypeSQLDataBase1 ... WorkloadItemTypeSQLDataBase1 WorkloadItemTypeBasicWorkloadItem = "SQLDataBase" // WorkloadItemTypeSQLInstance1 ... @@ -1453,7 +1528,7 @@ const ( // PossibleWorkloadItemTypeBasicWorkloadItemValues returns an array of possible values for the WorkloadItemTypeBasicWorkloadItem const type. func PossibleWorkloadItemTypeBasicWorkloadItemValues() []WorkloadItemTypeBasicWorkloadItem { - return []WorkloadItemTypeBasicWorkloadItem{WorkloadItemTypeAzureVMWorkloadItem, WorkloadItemTypeSQLDataBase1, WorkloadItemTypeSQLInstance1, WorkloadItemTypeWorkloadItem} + return []WorkloadItemTypeBasicWorkloadItem{WorkloadItemTypeAzureVMWorkloadItem, WorkloadItemTypeSAPHanaDatabase1, WorkloadItemTypeSAPHanaSystem1, WorkloadItemTypeSQLDataBase1, WorkloadItemTypeSQLInstance1, WorkloadItemTypeWorkloadItem} } // WorkloadType enumerates the values for workload type. @@ -1474,6 +1549,8 @@ const ( WorkloadTypeGenericDataSource WorkloadType = "GenericDataSource" // WorkloadTypeInvalid ... WorkloadTypeInvalid WorkloadType = "Invalid" + // WorkloadTypeSAPHanaDatabase ... + WorkloadTypeSAPHanaDatabase WorkloadType = "SAPHanaDatabase" // WorkloadTypeSharepoint ... WorkloadTypeSharepoint WorkloadType = "Sharepoint" // WorkloadTypeSQLDataBase ... @@ -1490,7 +1567,43 @@ const ( // PossibleWorkloadTypeValues returns an array of possible values for the WorkloadType const type. func PossibleWorkloadTypeValues() []WorkloadType { - return []WorkloadType{WorkloadTypeAzureFileShare, WorkloadTypeAzureSQLDb, WorkloadTypeClient, WorkloadTypeExchange, WorkloadTypeFileFolder, WorkloadTypeGenericDataSource, WorkloadTypeInvalid, WorkloadTypeSharepoint, WorkloadTypeSQLDataBase, WorkloadTypeSQLDB, WorkloadTypeSystemState, WorkloadTypeVM, WorkloadTypeVMwareVM} + return []WorkloadType{WorkloadTypeAzureFileShare, WorkloadTypeAzureSQLDb, WorkloadTypeClient, WorkloadTypeExchange, WorkloadTypeFileFolder, WorkloadTypeGenericDataSource, WorkloadTypeInvalid, WorkloadTypeSAPHanaDatabase, WorkloadTypeSharepoint, WorkloadTypeSQLDataBase, WorkloadTypeSQLDB, WorkloadTypeSystemState, WorkloadTypeVM, WorkloadTypeVMwareVM} +} + +// AzureBackupGoalFeatureSupportRequest azure backup goal feature specific request. +type AzureBackupGoalFeatureSupportRequest struct { + // FeatureType - Possible values include: 'FeatureTypeFeatureSupportRequest', 'FeatureTypeAzureBackupGoals', 'FeatureTypeAzureVMResourceBackup' + FeatureType FeatureType `json:"featureType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureBackupGoalFeatureSupportRequest. +func (abgfsr AzureBackupGoalFeatureSupportRequest) MarshalJSON() ([]byte, error) { + abgfsr.FeatureType = FeatureTypeAzureBackupGoals + objectMap := make(map[string]interface{}) + if abgfsr.FeatureType != "" { + objectMap["featureType"] = abgfsr.FeatureType + } + return json.Marshal(objectMap) +} + +// AsAzureBackupGoalFeatureSupportRequest is the BasicFeatureSupportRequest implementation for AzureBackupGoalFeatureSupportRequest. +func (abgfsr AzureBackupGoalFeatureSupportRequest) AsAzureBackupGoalFeatureSupportRequest() (*AzureBackupGoalFeatureSupportRequest, bool) { + return &abgfsr, true +} + +// AsAzureVMResourceFeatureSupportRequest is the BasicFeatureSupportRequest implementation for AzureBackupGoalFeatureSupportRequest. +func (abgfsr AzureBackupGoalFeatureSupportRequest) AsAzureVMResourceFeatureSupportRequest() (*AzureVMResourceFeatureSupportRequest, bool) { + return nil, false +} + +// AsFeatureSupportRequest is the BasicFeatureSupportRequest implementation for AzureBackupGoalFeatureSupportRequest. +func (abgfsr AzureBackupGoalFeatureSupportRequest) AsFeatureSupportRequest() (*FeatureSupportRequest, bool) { + return nil, false +} + +// AsBasicFeatureSupportRequest is the BasicFeatureSupportRequest implementation for AzureBackupGoalFeatureSupportRequest. +func (abgfsr AzureBackupGoalFeatureSupportRequest) AsBasicFeatureSupportRequest() (BasicFeatureSupportRequest, bool) { + return &abgfsr, true } // AzureBackupServerContainer azureBackupServer (DPMVenus) workload-specific protection container. @@ -1519,7 +1632,7 @@ type AzureBackupServerContainer struct { RegistrationStatus *string `json:"registrationStatus,omitempty"` // HealthStatus - Status of health of the container. HealthStatus *string `json:"healthStatus,omitempty"` - // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaaSVMContainer', 'ContainerTypeMABWindowsContainer' + // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaaSVMContainer', 'ContainerTypeWindows1' ContainerType ContainerTypeBasicProtectionContainer `json:"containerType,omitempty"` } @@ -1807,7 +1920,7 @@ type AzureFileShareProtectableItem struct { FriendlyName *string `json:"friendlyName,omitempty"` // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' + // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' ProtectableItemType ProtectableItemType `json:"protectableItemType,omitempty"` } @@ -1867,6 +1980,16 @@ func (afspi AzureFileShareProtectableItem) AsBasicAzureVMWorkloadProtectableItem return nil, false } +// AsAzureVMWorkloadSAPHanaDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureFileShareProtectableItem. +func (afspi AzureFileShareProtectableItem) AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureFileShareProtectableItem. +func (afspi AzureFileShareProtectableItem) AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) { + return nil, false +} + // AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem is the BasicWorkloadProtectableItem implementation for AzureFileShareProtectableItem. func (afspi AzureFileShareProtectableItem) AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) { return nil, false @@ -1920,7 +2043,7 @@ type AzureFileshareProtectedItem struct { ExtendedInfo *AzureFileshareProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` // BackupManagementType - Type of backup managemenent for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare' + // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase' WorkloadType DataSourceType `json:"workloadType,omitempty"` // ContainerName - Unique name of container ContainerName *string `json:"containerName,omitempty"` @@ -1932,7 +2055,9 @@ type AzureFileshareProtectedItem struct { LastRecoveryPoint *date.Time `json:"lastRecoveryPoint,omitempty"` // BackupSetName - Name of the backup set the backup item belongs to BackupSetName *string `json:"backupSetName,omitempty"` - // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' + // CreateMode - Create mode to indicate recovery of existing soft deleted data source or creation of new data source. Possible values include: 'CreateModeInvalid', 'CreateModeDefault', 'CreateModeRecover' + CreateMode CreateMode `json:"createMode,omitempty"` + // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` } @@ -1982,6 +2107,9 @@ func (afpi AzureFileshareProtectedItem) MarshalJSON() ([]byte, error) { if afpi.BackupSetName != nil { objectMap["backupSetName"] = afpi.BackupSetName } + if afpi.CreateMode != "" { + objectMap["createMode"] = afpi.CreateMode + } if afpi.ProtectedItemType != "" { objectMap["protectedItemType"] = afpi.ProtectedItemType } @@ -2018,6 +2146,21 @@ func (afpi AzureFileshareProtectedItem) AsAzureSQLProtectedItem() (*AzureSQLProt return nil, false } +// AsAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureFileshareProtectedItem. +func (afpi AzureFileshareProtectedItem) AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) { + return nil, false +} + +// AsBasicAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureFileshareProtectedItem. +func (afpi AzureFileshareProtectedItem) AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaDatabaseProtectedItem is the BasicProtectedItem implementation for AzureFileshareProtectedItem. +func (afpi AzureFileshareProtectedItem) AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) { + return nil, false +} + // AsAzureVMWorkloadSQLDatabaseProtectedItem is the BasicProtectedItem implementation for AzureFileshareProtectedItem. func (afpi AzureFileshareProtectedItem) AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) { return nil, false @@ -2210,7 +2353,7 @@ type AzureFileShareRecoveryPoint struct { RecoveryPointTime *date.Time `json:"recoveryPointTime,omitempty"` // FileShareSnapshotURI - Contains Url to the snapshot of fileshare, if applicable FileShareSnapshotURI *string `json:"fileShareSnapshotUri,omitempty"` - // ObjectType - Possible values include: 'ObjectTypeRecoveryPoint', 'ObjectTypeAzureFileShareRecoveryPoint', 'ObjectTypeAzureWorkloadRecoveryPoint', 'ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSQLRecoveryPoint', 'ObjectTypeGenericRecoveryPoint', 'ObjectTypeIaasVMRecoveryPoint' + // ObjectType - Possible values include: 'ObjectTypeRecoveryPoint', 'ObjectTypeAzureFileShareRecoveryPoint', 'ObjectTypeAzureWorkloadRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaRecoveryPoint', 'ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSQLRecoveryPoint', 'ObjectTypeGenericRecoveryPoint', 'ObjectTypeIaasVMRecoveryPoint' ObjectType ObjectTypeBasicRecoveryPoint `json:"objectType,omitempty"` } @@ -2248,6 +2391,21 @@ func (afsrp AzureFileShareRecoveryPoint) AsBasicAzureWorkloadRecoveryPoint() (Ba return nil, false } +// AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureFileShareRecoveryPoint. +func (afsrp AzureFileShareRecoveryPoint) AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadSAPHanaRecoveryPoint is the BasicRecoveryPoint implementation for AzureFileShareRecoveryPoint. +func (afsrp AzureFileShareRecoveryPoint) AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSAPHanaRecoveryPoint is the BasicRecoveryPoint implementation for AzureFileShareRecoveryPoint. +func (afsrp AzureFileShareRecoveryPoint) AsBasicAzureWorkloadSAPHanaRecoveryPoint() (BasicAzureWorkloadSAPHanaRecoveryPoint, bool) { + return nil, false +} + // AsAzureWorkloadSQLPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureFileShareRecoveryPoint. func (afsrp AzureFileShareRecoveryPoint) AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) { return nil, false @@ -2297,7 +2455,7 @@ type AzureFileShareRestoreRequest struct { RestoreFileSpecs *[]RestoreFileSpecs `json:"restoreFileSpecs,omitempty"` // TargetDetails - Target File Share Details TargetDetails *TargetAFSRestoreInfo `json:"targetDetails,omitempty"` - // ObjectType - Possible values include: 'ObjectTypeRestoreRequest', 'ObjectTypeAzureFileShareRestoreRequest', 'ObjectTypeAzureWorkloadRestoreRequest', 'ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSQLRestoreRequest', 'ObjectTypeIaasVMRestoreRequest' + // ObjectType - Possible values include: 'ObjectTypeRestoreRequest', 'ObjectTypeAzureFileShareRestoreRequest', 'ObjectTypeAzureWorkloadRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaRestoreRequest', 'ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSQLRestoreRequest', 'ObjectTypeIaasVMRestoreRequest' ObjectType ObjectTypeBasicRestoreRequest `json:"objectType,omitempty"` } @@ -2344,6 +2502,21 @@ func (afsrr AzureFileShareRestoreRequest) AsBasicAzureWorkloadRestoreRequest() ( return nil, false } +// AsAzureWorkloadSAPHanaPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureFileShareRestoreRequest. +func (afsrr AzureFileShareRestoreRequest) AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureFileShareRestoreRequest. +func (afsrr AzureFileShareRestoreRequest) AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureFileShareRestoreRequest. +func (afsrr AzureFileShareRestoreRequest) AsBasicAzureWorkloadSAPHanaRestoreRequest() (BasicAzureWorkloadSAPHanaRestoreRequest, bool) { + return nil, false +} + // AsAzureWorkloadSQLPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureFileShareRestoreRequest. func (afsrr AzureFileShareRestoreRequest) AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) { return nil, false @@ -2390,7 +2563,7 @@ type AzureIaaSClassicComputeVMContainer struct { RegistrationStatus *string `json:"registrationStatus,omitempty"` // HealthStatus - Status of health of the container. HealthStatus *string `json:"healthStatus,omitempty"` - // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaaSVMContainer', 'ContainerTypeMABWindowsContainer' + // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaaSVMContainer', 'ContainerTypeWindows1' ContainerType ContainerTypeBasicProtectionContainer `json:"containerType,omitempty"` } @@ -2518,7 +2691,7 @@ type AzureIaaSClassicComputeVMProtectableItem struct { FriendlyName *string `json:"friendlyName,omitempty"` // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' + // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' ProtectableItemType ProtectableItemType `json:"protectableItemType,omitempty"` } @@ -2572,6 +2745,16 @@ func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsBasicAzureVMWorkloadP return nil, false } +// AsAzureVMWorkloadSAPHanaDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. +func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. +func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) { + return nil, false +} + // AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) { return nil, false @@ -2632,7 +2815,7 @@ type AzureIaaSClassicComputeVMProtectedItem struct { ExtendedInfo *AzureIaaSVMProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` // BackupManagementType - Type of backup managemenent for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare' + // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase' WorkloadType DataSourceType `json:"workloadType,omitempty"` // ContainerName - Unique name of container ContainerName *string `json:"containerName,omitempty"` @@ -2644,7 +2827,9 @@ type AzureIaaSClassicComputeVMProtectedItem struct { LastRecoveryPoint *date.Time `json:"lastRecoveryPoint,omitempty"` // BackupSetName - Name of the backup set the backup item belongs to BackupSetName *string `json:"backupSetName,omitempty"` - // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' + // CreateMode - Create mode to indicate recovery of existing soft deleted data source or creation of new data source. Possible values include: 'CreateModeInvalid', 'CreateModeDefault', 'CreateModeRecover' + CreateMode CreateMode `json:"createMode,omitempty"` + // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` } @@ -2703,6 +2888,9 @@ func (aisccvpi AzureIaaSClassicComputeVMProtectedItem) MarshalJSON() ([]byte, er if aisccvpi.BackupSetName != nil { objectMap["backupSetName"] = aisccvpi.BackupSetName } + if aisccvpi.CreateMode != "" { + objectMap["createMode"] = aisccvpi.CreateMode + } if aisccvpi.ProtectedItemType != "" { objectMap["protectedItemType"] = aisccvpi.ProtectedItemType } @@ -2739,6 +2927,21 @@ func (aisccvpi AzureIaaSClassicComputeVMProtectedItem) AsAzureSQLProtectedItem() return nil, false } +// AsAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureIaaSClassicComputeVMProtectedItem. +func (aisccvpi AzureIaaSClassicComputeVMProtectedItem) AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) { + return nil, false +} + +// AsBasicAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureIaaSClassicComputeVMProtectedItem. +func (aisccvpi AzureIaaSClassicComputeVMProtectedItem) AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaDatabaseProtectedItem is the BasicProtectedItem implementation for AzureIaaSClassicComputeVMProtectedItem. +func (aisccvpi AzureIaaSClassicComputeVMProtectedItem) AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) { + return nil, false +} + // AsAzureVMWorkloadSQLDatabaseProtectedItem is the BasicProtectedItem implementation for AzureIaaSClassicComputeVMProtectedItem. func (aisccvpi AzureIaaSClassicComputeVMProtectedItem) AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) { return nil, false @@ -2786,7 +2989,7 @@ type AzureIaaSComputeVMContainer struct { RegistrationStatus *string `json:"registrationStatus,omitempty"` // HealthStatus - Status of health of the container. HealthStatus *string `json:"healthStatus,omitempty"` - // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaaSVMContainer', 'ContainerTypeMABWindowsContainer' + // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaaSVMContainer', 'ContainerTypeWindows1' ContainerType ContainerTypeBasicProtectionContainer `json:"containerType,omitempty"` } @@ -2914,7 +3117,7 @@ type AzureIaaSComputeVMProtectableItem struct { FriendlyName *string `json:"friendlyName,omitempty"` // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' + // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' ProtectableItemType ProtectableItemType `json:"protectableItemType,omitempty"` } @@ -2968,6 +3171,16 @@ func (aiscvpi AzureIaaSComputeVMProtectableItem) AsBasicAzureVMWorkloadProtectab return nil, false } +// AsAzureVMWorkloadSAPHanaDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. +func (aiscvpi AzureIaaSComputeVMProtectableItem) AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. +func (aiscvpi AzureIaaSComputeVMProtectableItem) AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) { + return nil, false +} + // AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. func (aiscvpi AzureIaaSComputeVMProtectableItem) AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) { return nil, false @@ -3028,7 +3241,7 @@ type AzureIaaSComputeVMProtectedItem struct { ExtendedInfo *AzureIaaSVMProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` // BackupManagementType - Type of backup managemenent for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare' + // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase' WorkloadType DataSourceType `json:"workloadType,omitempty"` // ContainerName - Unique name of container ContainerName *string `json:"containerName,omitempty"` @@ -3040,7 +3253,9 @@ type AzureIaaSComputeVMProtectedItem struct { LastRecoveryPoint *date.Time `json:"lastRecoveryPoint,omitempty"` // BackupSetName - Name of the backup set the backup item belongs to BackupSetName *string `json:"backupSetName,omitempty"` - // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' + // CreateMode - Create mode to indicate recovery of existing soft deleted data source or creation of new data source. Possible values include: 'CreateModeInvalid', 'CreateModeDefault', 'CreateModeRecover' + CreateMode CreateMode `json:"createMode,omitempty"` + // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` } @@ -3099,6 +3314,9 @@ func (aiscvpi AzureIaaSComputeVMProtectedItem) MarshalJSON() ([]byte, error) { if aiscvpi.BackupSetName != nil { objectMap["backupSetName"] = aiscvpi.BackupSetName } + if aiscvpi.CreateMode != "" { + objectMap["createMode"] = aiscvpi.CreateMode + } if aiscvpi.ProtectedItemType != "" { objectMap["protectedItemType"] = aiscvpi.ProtectedItemType } @@ -3135,6 +3353,21 @@ func (aiscvpi AzureIaaSComputeVMProtectedItem) AsAzureSQLProtectedItem() (*Azure return nil, false } +// AsAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureIaaSComputeVMProtectedItem. +func (aiscvpi AzureIaaSComputeVMProtectedItem) AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) { + return nil, false +} + +// AsBasicAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureIaaSComputeVMProtectedItem. +func (aiscvpi AzureIaaSComputeVMProtectedItem) AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaDatabaseProtectedItem is the BasicProtectedItem implementation for AzureIaaSComputeVMProtectedItem. +func (aiscvpi AzureIaaSComputeVMProtectedItem) AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) { + return nil, false +} + // AsAzureVMWorkloadSQLDatabaseProtectedItem is the BasicProtectedItem implementation for AzureIaaSComputeVMProtectedItem. func (aiscvpi AzureIaaSComputeVMProtectedItem) AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) { return nil, false @@ -3306,6 +3539,8 @@ type AzureIaaSVMJobExtendedInfo struct { TasksList *[]AzureIaaSVMJobTaskDetails `json:"tasksList,omitempty"` // PropertyBag - Job properties. PropertyBag map[string]*string `json:"propertyBag"` + // InternalPropertyBag - Job internal properties. + InternalPropertyBag map[string]*string `json:"internalPropertyBag"` // ProgressPercentage - Indicates progress of the job. Null if it has not started or completed. ProgressPercentage *float64 `json:"progressPercentage,omitempty"` // DynamicErrorMessage - Non localized error message on job execution. @@ -3321,6 +3556,9 @@ func (aisjei AzureIaaSVMJobExtendedInfo) MarshalJSON() ([]byte, error) { if aisjei.PropertyBag != nil { objectMap["propertyBag"] = aisjei.PropertyBag } + if aisjei.InternalPropertyBag != nil { + objectMap["internalPropertyBag"] = aisjei.InternalPropertyBag + } if aisjei.ProgressPercentage != nil { objectMap["progressPercentage"] = aisjei.ProgressPercentage } @@ -3379,7 +3617,7 @@ type AzureIaaSVMProtectedItem struct { ExtendedInfo *AzureIaaSVMProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` // BackupManagementType - Type of backup managemenent for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare' + // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase' WorkloadType DataSourceType `json:"workloadType,omitempty"` // ContainerName - Unique name of container ContainerName *string `json:"containerName,omitempty"` @@ -3391,7 +3629,9 @@ type AzureIaaSVMProtectedItem struct { LastRecoveryPoint *date.Time `json:"lastRecoveryPoint,omitempty"` // BackupSetName - Name of the backup set the backup item belongs to BackupSetName *string `json:"backupSetName,omitempty"` - // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' + // CreateMode - Create mode to indicate recovery of existing soft deleted data source or creation of new data source. Possible values include: 'CreateModeInvalid', 'CreateModeDefault', 'CreateModeRecover' + CreateMode CreateMode `json:"createMode,omitempty"` + // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` } @@ -3491,6 +3731,9 @@ func (aispi AzureIaaSVMProtectedItem) MarshalJSON() ([]byte, error) { if aispi.BackupSetName != nil { objectMap["backupSetName"] = aispi.BackupSetName } + if aispi.CreateMode != "" { + objectMap["createMode"] = aispi.CreateMode + } if aispi.ProtectedItemType != "" { objectMap["protectedItemType"] = aispi.ProtectedItemType } @@ -3527,6 +3770,21 @@ func (aispi AzureIaaSVMProtectedItem) AsAzureSQLProtectedItem() (*AzureSQLProtec return nil, false } +// AsAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureIaaSVMProtectedItem. +func (aispi AzureIaaSVMProtectedItem) AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) { + return nil, false +} + +// AsBasicAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureIaaSVMProtectedItem. +func (aispi AzureIaaSVMProtectedItem) AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaDatabaseProtectedItem is the BasicProtectedItem implementation for AzureIaaSVMProtectedItem. +func (aispi AzureIaaSVMProtectedItem) AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) { + return nil, false +} + // AsAzureVMWorkloadSQLDatabaseProtectedItem is the BasicProtectedItem implementation for AzureIaaSVMProtectedItem. func (aispi AzureIaaSVMProtectedItem) AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) { return nil, false @@ -3573,6 +3831,8 @@ type AzureIaaSVMProtectionPolicy struct { SchedulePolicy BasicSchedulePolicy `json:"schedulePolicy,omitempty"` // RetentionPolicy - Retention policy with the details on backup copy retention ranges. RetentionPolicy BasicRetentionPolicy `json:"retentionPolicy,omitempty"` + // InstantRpRetentionRangeInDays - Instant RP retention policy range in days + InstantRpRetentionRangeInDays *int32 `json:"instantRpRetentionRangeInDays,omitempty"` // TimeZone - TimeZone optional input as string. For example: TimeZone = "Pacific Standard Time". TimeZone *string `json:"timeZone,omitempty"` // ProtectedItemsCount - Number of items associated with this policy. @@ -3587,6 +3847,9 @@ func (aispp AzureIaaSVMProtectionPolicy) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) objectMap["schedulePolicy"] = aispp.SchedulePolicy objectMap["retentionPolicy"] = aispp.RetentionPolicy + if aispp.InstantRpRetentionRangeInDays != nil { + objectMap["instantRpRetentionRangeInDays"] = aispp.InstantRpRetentionRangeInDays + } if aispp.TimeZone != nil { objectMap["timeZone"] = aispp.TimeZone } @@ -3664,6 +3927,15 @@ func (aispp *AzureIaaSVMProtectionPolicy) UnmarshalJSON(body []byte) error { } aispp.RetentionPolicy = retentionPolicy } + case "instantRpRetentionRangeInDays": + if v != nil { + var instantRpRetentionRangeInDays int32 + err = json.Unmarshal(*v, &instantRpRetentionRangeInDays) + if err != nil { + return err + } + aispp.InstantRpRetentionRangeInDays = &instantRpRetentionRangeInDays + } case "timeZone": if v != nil { var timeZone string @@ -3697,6 +3969,136 @@ func (aispp *AzureIaaSVMProtectionPolicy) UnmarshalJSON(body []byte) error { return nil } +// BasicAzureRecoveryServiceVaultProtectionIntent azure Recovery Services Vault specific protection intent item. +type BasicAzureRecoveryServiceVaultProtectionIntent interface { + AsAzureWorkloadAutoProtectionIntent() (*AzureWorkloadAutoProtectionIntent, bool) + AsBasicAzureWorkloadAutoProtectionIntent() (BasicAzureWorkloadAutoProtectionIntent, bool) + AsAzureWorkloadSQLAutoProtectionIntent() (*AzureWorkloadSQLAutoProtectionIntent, bool) + AsAzureRecoveryServiceVaultProtectionIntent() (*AzureRecoveryServiceVaultProtectionIntent, bool) +} + +// AzureRecoveryServiceVaultProtectionIntent azure Recovery Services Vault specific protection intent item. +type AzureRecoveryServiceVaultProtectionIntent struct { + // BackupManagementType - Type of backup managemenent for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // SourceResourceID - ARM ID of the resource to be backed up. + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // ItemID - ID of the item which is getting protected, In case of Azure Vm , it is ProtectedItemId + ItemID *string `json:"itemId,omitempty"` + // PolicyID - ID of the backup policy with which this item is backed up. + PolicyID *string `json:"policyId,omitempty"` + // ProtectionState - Backup state of this backup item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' + ProtectionState ProtectionStatus `json:"protectionState,omitempty"` + // ProtectionIntentItemType - Possible values include: 'ProtectionIntentItemTypeProtectionIntent', 'ProtectionIntentItemTypeRecoveryServiceVaultItem', 'ProtectionIntentItemTypeAzureResourceItem', 'ProtectionIntentItemTypeAzureWorkloadAutoProtectionIntent', 'ProtectionIntentItemTypeAzureWorkloadSQLAutoProtectionIntent' + ProtectionIntentItemType ProtectionIntentItemType `json:"protectionIntentItemType,omitempty"` +} + +func unmarshalBasicAzureRecoveryServiceVaultProtectionIntent(body []byte) (BasicAzureRecoveryServiceVaultProtectionIntent, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["protectionIntentItemType"] { + case string(ProtectionIntentItemTypeAzureWorkloadAutoProtectionIntent): + var awapi AzureWorkloadAutoProtectionIntent + err := json.Unmarshal(body, &awapi) + return awapi, err + case string(ProtectionIntentItemTypeAzureWorkloadSQLAutoProtectionIntent): + var awsapi AzureWorkloadSQLAutoProtectionIntent + err := json.Unmarshal(body, &awsapi) + return awsapi, err + default: + var arsvpi AzureRecoveryServiceVaultProtectionIntent + err := json.Unmarshal(body, &arsvpi) + return arsvpi, err + } +} +func unmarshalBasicAzureRecoveryServiceVaultProtectionIntentArray(body []byte) ([]BasicAzureRecoveryServiceVaultProtectionIntent, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + arsvpiArray := make([]BasicAzureRecoveryServiceVaultProtectionIntent, len(rawMessages)) + + for index, rawMessage := range rawMessages { + arsvpi, err := unmarshalBasicAzureRecoveryServiceVaultProtectionIntent(*rawMessage) + if err != nil { + return nil, err + } + arsvpiArray[index] = arsvpi + } + return arsvpiArray, nil +} + +// MarshalJSON is the custom marshaler for AzureRecoveryServiceVaultProtectionIntent. +func (arsvpi AzureRecoveryServiceVaultProtectionIntent) MarshalJSON() ([]byte, error) { + arsvpi.ProtectionIntentItemType = ProtectionIntentItemTypeRecoveryServiceVaultItem + objectMap := make(map[string]interface{}) + if arsvpi.BackupManagementType != "" { + objectMap["backupManagementType"] = arsvpi.BackupManagementType + } + if arsvpi.SourceResourceID != nil { + objectMap["sourceResourceId"] = arsvpi.SourceResourceID + } + if arsvpi.ItemID != nil { + objectMap["itemId"] = arsvpi.ItemID + } + if arsvpi.PolicyID != nil { + objectMap["policyId"] = arsvpi.PolicyID + } + if arsvpi.ProtectionState != "" { + objectMap["protectionState"] = arsvpi.ProtectionState + } + if arsvpi.ProtectionIntentItemType != "" { + objectMap["protectionIntentItemType"] = arsvpi.ProtectionIntentItemType + } + return json.Marshal(objectMap) +} + +// AsAzureRecoveryServiceVaultProtectionIntent is the BasicProtectionIntent implementation for AzureRecoveryServiceVaultProtectionIntent. +func (arsvpi AzureRecoveryServiceVaultProtectionIntent) AsAzureRecoveryServiceVaultProtectionIntent() (*AzureRecoveryServiceVaultProtectionIntent, bool) { + return &arsvpi, true +} + +// AsBasicAzureRecoveryServiceVaultProtectionIntent is the BasicProtectionIntent implementation for AzureRecoveryServiceVaultProtectionIntent. +func (arsvpi AzureRecoveryServiceVaultProtectionIntent) AsBasicAzureRecoveryServiceVaultProtectionIntent() (BasicAzureRecoveryServiceVaultProtectionIntent, bool) { + return &arsvpi, true +} + +// AsAzureResourceProtectionIntent is the BasicProtectionIntent implementation for AzureRecoveryServiceVaultProtectionIntent. +func (arsvpi AzureRecoveryServiceVaultProtectionIntent) AsAzureResourceProtectionIntent() (*AzureResourceProtectionIntent, bool) { + return nil, false +} + +// AsAzureWorkloadAutoProtectionIntent is the BasicProtectionIntent implementation for AzureRecoveryServiceVaultProtectionIntent. +func (arsvpi AzureRecoveryServiceVaultProtectionIntent) AsAzureWorkloadAutoProtectionIntent() (*AzureWorkloadAutoProtectionIntent, bool) { + return nil, false +} + +// AsBasicAzureWorkloadAutoProtectionIntent is the BasicProtectionIntent implementation for AzureRecoveryServiceVaultProtectionIntent. +func (arsvpi AzureRecoveryServiceVaultProtectionIntent) AsBasicAzureWorkloadAutoProtectionIntent() (BasicAzureWorkloadAutoProtectionIntent, bool) { + return nil, false +} + +// AsAzureWorkloadSQLAutoProtectionIntent is the BasicProtectionIntent implementation for AzureRecoveryServiceVaultProtectionIntent. +func (arsvpi AzureRecoveryServiceVaultProtectionIntent) AsAzureWorkloadSQLAutoProtectionIntent() (*AzureWorkloadSQLAutoProtectionIntent, bool) { + return nil, false +} + +// AsProtectionIntent is the BasicProtectionIntent implementation for AzureRecoveryServiceVaultProtectionIntent. +func (arsvpi AzureRecoveryServiceVaultProtectionIntent) AsProtectionIntent() (*ProtectionIntent, bool) { + return nil, false +} + +// AsBasicProtectionIntent is the BasicProtectionIntent implementation for AzureRecoveryServiceVaultProtectionIntent. +func (arsvpi AzureRecoveryServiceVaultProtectionIntent) AsBasicProtectionIntent() (BasicProtectionIntent, bool) { + return &arsvpi, true +} + // AzureResourceProtectionIntent iaaS VM specific backup protection intent item. type AzureResourceProtectionIntent struct { // FriendlyName - Friendly name of the VM represented by this backup item. @@ -3711,7 +4113,7 @@ type AzureResourceProtectionIntent struct { PolicyID *string `json:"policyId,omitempty"` // ProtectionState - Backup state of this backup item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // ProtectionIntentItemType - Possible values include: 'ProtectionIntentItemTypeProtectionIntent', 'ProtectionIntentItemTypeAzureResourceItem' + // ProtectionIntentItemType - Possible values include: 'ProtectionIntentItemTypeProtectionIntent', 'ProtectionIntentItemTypeRecoveryServiceVaultItem', 'ProtectionIntentItemTypeAzureResourceItem', 'ProtectionIntentItemTypeAzureWorkloadAutoProtectionIntent', 'ProtectionIntentItemTypeAzureWorkloadSQLAutoProtectionIntent' ProtectionIntentItemType ProtectionIntentItemType `json:"protectionIntentItemType,omitempty"` } @@ -3743,11 +4145,36 @@ func (arpi AzureResourceProtectionIntent) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsAzureRecoveryServiceVaultProtectionIntent is the BasicProtectionIntent implementation for AzureResourceProtectionIntent. +func (arpi AzureResourceProtectionIntent) AsAzureRecoveryServiceVaultProtectionIntent() (*AzureRecoveryServiceVaultProtectionIntent, bool) { + return nil, false +} + +// AsBasicAzureRecoveryServiceVaultProtectionIntent is the BasicProtectionIntent implementation for AzureResourceProtectionIntent. +func (arpi AzureResourceProtectionIntent) AsBasicAzureRecoveryServiceVaultProtectionIntent() (BasicAzureRecoveryServiceVaultProtectionIntent, bool) { + return nil, false +} + // AsAzureResourceProtectionIntent is the BasicProtectionIntent implementation for AzureResourceProtectionIntent. func (arpi AzureResourceProtectionIntent) AsAzureResourceProtectionIntent() (*AzureResourceProtectionIntent, bool) { return &arpi, true } +// AsAzureWorkloadAutoProtectionIntent is the BasicProtectionIntent implementation for AzureResourceProtectionIntent. +func (arpi AzureResourceProtectionIntent) AsAzureWorkloadAutoProtectionIntent() (*AzureWorkloadAutoProtectionIntent, bool) { + return nil, false +} + +// AsBasicAzureWorkloadAutoProtectionIntent is the BasicProtectionIntent implementation for AzureResourceProtectionIntent. +func (arpi AzureResourceProtectionIntent) AsBasicAzureWorkloadAutoProtectionIntent() (BasicAzureWorkloadAutoProtectionIntent, bool) { + return nil, false +} + +// AsAzureWorkloadSQLAutoProtectionIntent is the BasicProtectionIntent implementation for AzureResourceProtectionIntent. +func (arpi AzureResourceProtectionIntent) AsAzureWorkloadSQLAutoProtectionIntent() (*AzureWorkloadSQLAutoProtectionIntent, bool) { + return nil, false +} + // AsProtectionIntent is the BasicProtectionIntent implementation for AzureResourceProtectionIntent. func (arpi AzureResourceProtectionIntent) AsProtectionIntent() (*ProtectionIntent, bool) { return nil, false @@ -3766,6 +4193,8 @@ type AzureSQLAGWorkloadContainerProtectionContainer struct { LastUpdatedTime *date.Time `json:"lastUpdatedTime,omitempty"` // ExtendedInfo - Additional details of a workload container. ExtendedInfo *AzureWorkloadContainerExtendedInfo `json:"extendedInfo,omitempty"` + // WorkloadType - Workload type for which registration was sent. Possible values include: 'WorkloadTypeInvalid', 'WorkloadTypeVM', 'WorkloadTypeFileFolder', 'WorkloadTypeAzureSQLDb', 'WorkloadTypeSQLDB', 'WorkloadTypeExchange', 'WorkloadTypeSharepoint', 'WorkloadTypeVMwareVM', 'WorkloadTypeSystemState', 'WorkloadTypeClient', 'WorkloadTypeGenericDataSource', 'WorkloadTypeSQLDataBase', 'WorkloadTypeAzureFileShare', 'WorkloadTypeSAPHanaDatabase' + WorkloadType WorkloadType `json:"workloadType,omitempty"` // FriendlyName - Friendly name of the container. FriendlyName *string `json:"friendlyName,omitempty"` // BackupManagementType - Type of backup managemenent for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' @@ -3774,7 +4203,7 @@ type AzureSQLAGWorkloadContainerProtectionContainer struct { RegistrationStatus *string `json:"registrationStatus,omitempty"` // HealthStatus - Status of health of the container. HealthStatus *string `json:"healthStatus,omitempty"` - // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaaSVMContainer', 'ContainerTypeMABWindowsContainer' + // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaaSVMContainer', 'ContainerTypeWindows1' ContainerType ContainerTypeBasicProtectionContainer `json:"containerType,omitempty"` } @@ -3791,6 +4220,9 @@ func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) MarshalJSON() ([]by if aswcpc.ExtendedInfo != nil { objectMap["extendedInfo"] = aswcpc.ExtendedInfo } + if aswcpc.WorkloadType != "" { + objectMap["workloadType"] = aswcpc.WorkloadType + } if aswcpc.FriendlyName != nil { objectMap["friendlyName"] = aswcpc.FriendlyName } @@ -3899,7 +4331,7 @@ type AzureSQLContainer struct { RegistrationStatus *string `json:"registrationStatus,omitempty"` // HealthStatus - Status of health of the container. HealthStatus *string `json:"healthStatus,omitempty"` - // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaaSVMContainer', 'ContainerTypeMABWindowsContainer' + // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaaSVMContainer', 'ContainerTypeWindows1' ContainerType ContainerTypeBasicProtectionContainer `json:"containerType,omitempty"` } @@ -4015,7 +4447,7 @@ type AzureSQLProtectedItem struct { ExtendedInfo *AzureSQLProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` // BackupManagementType - Type of backup managemenent for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare' + // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase' WorkloadType DataSourceType `json:"workloadType,omitempty"` // ContainerName - Unique name of container ContainerName *string `json:"containerName,omitempty"` @@ -4027,7 +4459,9 @@ type AzureSQLProtectedItem struct { LastRecoveryPoint *date.Time `json:"lastRecoveryPoint,omitempty"` // BackupSetName - Name of the backup set the backup item belongs to BackupSetName *string `json:"backupSetName,omitempty"` - // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' + // CreateMode - Create mode to indicate recovery of existing soft deleted data source or creation of new data source. Possible values include: 'CreateModeInvalid', 'CreateModeDefault', 'CreateModeRecover' + CreateMode CreateMode `json:"createMode,omitempty"` + // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` } @@ -4065,6 +4499,9 @@ func (aspi AzureSQLProtectedItem) MarshalJSON() ([]byte, error) { if aspi.BackupSetName != nil { objectMap["backupSetName"] = aspi.BackupSetName } + if aspi.CreateMode != "" { + objectMap["createMode"] = aspi.CreateMode + } if aspi.ProtectedItemType != "" { objectMap["protectedItemType"] = aspi.ProtectedItemType } @@ -4101,6 +4538,21 @@ func (aspi AzureSQLProtectedItem) AsAzureSQLProtectedItem() (*AzureSQLProtectedI return &aspi, true } +// AsAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureSQLProtectedItem. +func (aspi AzureSQLProtectedItem) AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) { + return nil, false +} + +// AsBasicAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureSQLProtectedItem. +func (aspi AzureSQLProtectedItem) AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaDatabaseProtectedItem is the BasicProtectedItem implementation for AzureSQLProtectedItem. +func (aspi AzureSQLProtectedItem) AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) { + return nil, false +} + // AsAzureVMWorkloadSQLDatabaseProtectedItem is the BasicProtectedItem implementation for AzureSQLProtectedItem. func (aspi AzureSQLProtectedItem) AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) { return nil, false @@ -4264,7 +4716,7 @@ type AzureStorageContainer struct { RegistrationStatus *string `json:"registrationStatus,omitempty"` // HealthStatus - Status of health of the container. HealthStatus *string `json:"healthStatus,omitempty"` - // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaaSVMContainer', 'ContainerTypeMABWindowsContainer' + // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaaSVMContainer', 'ContainerTypeWindows1' ContainerType ContainerTypeBasicProtectionContainer `json:"containerType,omitempty"` } @@ -4661,6 +5113,8 @@ type AzureVMAppContainerProtectionContainer struct { LastUpdatedTime *date.Time `json:"lastUpdatedTime,omitempty"` // ExtendedInfo - Additional details of a workload container. ExtendedInfo *AzureWorkloadContainerExtendedInfo `json:"extendedInfo,omitempty"` + // WorkloadType - Workload type for which registration was sent. Possible values include: 'WorkloadTypeInvalid', 'WorkloadTypeVM', 'WorkloadTypeFileFolder', 'WorkloadTypeAzureSQLDb', 'WorkloadTypeSQLDB', 'WorkloadTypeExchange', 'WorkloadTypeSharepoint', 'WorkloadTypeVMwareVM', 'WorkloadTypeSystemState', 'WorkloadTypeClient', 'WorkloadTypeGenericDataSource', 'WorkloadTypeSQLDataBase', 'WorkloadTypeAzureFileShare', 'WorkloadTypeSAPHanaDatabase' + WorkloadType WorkloadType `json:"workloadType,omitempty"` // FriendlyName - Friendly name of the container. FriendlyName *string `json:"friendlyName,omitempty"` // BackupManagementType - Type of backup managemenent for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' @@ -4669,7 +5123,7 @@ type AzureVMAppContainerProtectionContainer struct { RegistrationStatus *string `json:"registrationStatus,omitempty"` // HealthStatus - Status of health of the container. HealthStatus *string `json:"healthStatus,omitempty"` - // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaaSVMContainer', 'ContainerTypeMABWindowsContainer' + // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaaSVMContainer', 'ContainerTypeWindows1' ContainerType ContainerTypeBasicProtectionContainer `json:"containerType,omitempty"` } @@ -4686,6 +5140,9 @@ func (avacpc AzureVMAppContainerProtectionContainer) MarshalJSON() ([]byte, erro if avacpc.ExtendedInfo != nil { objectMap["extendedInfo"] = avacpc.ExtendedInfo } + if avacpc.WorkloadType != "" { + objectMap["workloadType"] = avacpc.WorkloadType + } if avacpc.FriendlyName != nil { objectMap["friendlyName"] = avacpc.FriendlyName } @@ -4790,7 +5247,7 @@ type AzureVMResourceFeatureSupportRequest struct { VMSize *string `json:"vmSize,omitempty"` // VMSku - SKUs (Premium/Managed etc) in case of IaasVM VMSku *string `json:"vmSku,omitempty"` - // FeatureType - Possible values include: 'FeatureTypeFeatureSupportRequest', 'FeatureTypeAzureVMResourceBackup' + // FeatureType - Possible values include: 'FeatureTypeFeatureSupportRequest', 'FeatureTypeAzureBackupGoals', 'FeatureTypeAzureVMResourceBackup' FeatureType FeatureType `json:"featureType,omitempty"` } @@ -4810,6 +5267,11 @@ func (avrfsr AzureVMResourceFeatureSupportRequest) MarshalJSON() ([]byte, error) return json.Marshal(objectMap) } +// AsAzureBackupGoalFeatureSupportRequest is the BasicFeatureSupportRequest implementation for AzureVMResourceFeatureSupportRequest. +func (avrfsr AzureVMResourceFeatureSupportRequest) AsAzureBackupGoalFeatureSupportRequest() (*AzureBackupGoalFeatureSupportRequest, bool) { + return nil, false +} + // AsAzureVMResourceFeatureSupportRequest is the BasicFeatureSupportRequest implementation for AzureVMResourceFeatureSupportRequest. func (avrfsr AzureVMResourceFeatureSupportRequest) AsAzureVMResourceFeatureSupportRequest() (*AzureVMResourceFeatureSupportRequest, bool) { return &avrfsr, true @@ -4834,6 +5296,8 @@ type AzureVMResourceFeatureSupportResponse struct { // BasicAzureVMWorkloadItem azure VM workload-specific workload item. type BasicAzureVMWorkloadItem interface { + AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem() (*AzureVMWorkloadSAPHanaDatabaseWorkloadItem, bool) + AsAzureVMWorkloadSAPHanaSystemWorkloadItem() (*AzureVMWorkloadSAPHanaSystemWorkloadItem, bool) AsAzureVMWorkloadSQLDatabaseWorkloadItem() (*AzureVMWorkloadSQLDatabaseWorkloadItem, bool) AsAzureVMWorkloadSQLInstanceWorkloadItem() (*AzureVMWorkloadSQLInstanceWorkloadItem, bool) AsAzureVMWorkloadItem() (*AzureVMWorkloadItem, bool) @@ -4859,7 +5323,7 @@ type AzureVMWorkloadItem struct { FriendlyName *string `json:"friendlyName,omitempty"` // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // WorkloadItemType - Possible values include: 'WorkloadItemTypeWorkloadItem', 'WorkloadItemTypeAzureVMWorkloadItem', 'WorkloadItemTypeSQLDataBase1', 'WorkloadItemTypeSQLInstance1' + // WorkloadItemType - Possible values include: 'WorkloadItemTypeWorkloadItem', 'WorkloadItemTypeAzureVMWorkloadItem', 'WorkloadItemTypeSAPHanaDatabase1', 'WorkloadItemTypeSAPHanaSystem1', 'WorkloadItemTypeSQLDataBase1', 'WorkloadItemTypeSQLInstance1' WorkloadItemType WorkloadItemTypeBasicWorkloadItem `json:"workloadItemType,omitempty"` } @@ -4871,6 +5335,14 @@ func unmarshalBasicAzureVMWorkloadItem(body []byte) (BasicAzureVMWorkloadItem, e } switch m["workloadItemType"] { + case string(WorkloadItemTypeSAPHanaDatabase1): + var avwshdwi AzureVMWorkloadSAPHanaDatabaseWorkloadItem + err := json.Unmarshal(body, &avwshdwi) + return avwshdwi, err + case string(WorkloadItemTypeSAPHanaSystem1): + var avwshswi AzureVMWorkloadSAPHanaSystemWorkloadItem + err := json.Unmarshal(body, &avwshswi) + return avwshswi, err case string(WorkloadItemTypeSQLDataBase1): var avwsdwi AzureVMWorkloadSQLDatabaseWorkloadItem err := json.Unmarshal(body, &avwsdwi) @@ -4951,6 +5423,16 @@ func (avwi AzureVMWorkloadItem) AsBasicAzureVMWorkloadItem() (BasicAzureVMWorklo return &avwi, true } +// AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadItem. +func (avwi AzureVMWorkloadItem) AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem() (*AzureVMWorkloadSAPHanaDatabaseWorkloadItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaSystemWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadItem. +func (avwi AzureVMWorkloadItem) AsAzureVMWorkloadSAPHanaSystemWorkloadItem() (*AzureVMWorkloadSAPHanaSystemWorkloadItem, bool) { + return nil, false +} + // AsAzureVMWorkloadSQLDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadItem. func (avwi AzureVMWorkloadItem) AsAzureVMWorkloadSQLDatabaseWorkloadItem() (*AzureVMWorkloadSQLDatabaseWorkloadItem, bool) { return nil, false @@ -4973,6 +5455,8 @@ func (avwi AzureVMWorkloadItem) AsBasicWorkloadItem() (BasicWorkloadItem, bool) // BasicAzureVMWorkloadProtectableItem azure VM workload-specific protectable item. type BasicAzureVMWorkloadProtectableItem interface { + AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) + AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) @@ -5004,7 +5488,7 @@ type AzureVMWorkloadProtectableItem struct { FriendlyName *string `json:"friendlyName,omitempty"` // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' + // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' ProtectableItemType ProtectableItemType `json:"protectableItemType,omitempty"` } @@ -5016,6 +5500,14 @@ func unmarshalBasicAzureVMWorkloadProtectableItem(body []byte) (BasicAzureVMWork } switch m["protectableItemType"] { + case string(ProtectableItemTypeSAPHanaDatabase): + var avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem + err := json.Unmarshal(body, &avwshdpi) + return avwshdpi, err + case string(ProtectableItemTypeSAPHanaSystem): + var avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem + err := json.Unmarshal(body, &avwshspi) + return avwshspi, err case string(ProtectableItemTypeSQLAvailabilityGroupContainer): var avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem err := json.Unmarshal(body, &avwsagpi) @@ -5121,6 +5613,16 @@ func (avwpi AzureVMWorkloadProtectableItem) AsBasicAzureVMWorkloadProtectableIte return &avwpi, true } +// AsAzureVMWorkloadSAPHanaDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. +func (avwpi AzureVMWorkloadProtectableItem) AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. +func (avwpi AzureVMWorkloadProtectableItem) AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) { + return nil, false +} + // AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. func (avwpi AzureVMWorkloadProtectableItem) AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) { return nil, false @@ -5156,6 +5658,240 @@ func (avwpi AzureVMWorkloadProtectableItem) AsBasicWorkloadProtectableItem() (Ba return &avwpi, true } +// BasicAzureVMWorkloadProtectedItem azure VM workload-specific protected item. +type BasicAzureVMWorkloadProtectedItem interface { + AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) + AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) +} + +// AzureVMWorkloadProtectedItem azure VM workload-specific protected item. +type AzureVMWorkloadProtectedItem struct { + // FriendlyName - Friendly name of the DB represented by this backup item. + FriendlyName *string `json:"friendlyName,omitempty"` + // ServerName - Host/Cluster Name for instance or AG + ServerName *string `json:"serverName,omitempty"` + // ParentName - Parent name of the DB such as Instance or Availability Group. + ParentName *string `json:"parentName,omitempty"` + // ParentType - Parent type of protected item, example: for a DB, standalone server or distributed + ParentType *string `json:"parentType,omitempty"` + // ProtectionStatus - Backup status of this backup item. + ProtectionStatus *string `json:"protectionStatus,omitempty"` + // ProtectionState - Backup state of this backup item. Possible values include: 'ProtectionStateInvalid', 'ProtectionStateIRPending', 'ProtectionStateProtected', 'ProtectionStateProtectionError', 'ProtectionStateProtectionStopped', 'ProtectionStateProtectionPaused' + ProtectionState ProtectionState `json:"protectionState,omitempty"` + // LastBackupStatus - Last backup operation status. Possible values: Healthy, Unhealthy. Possible values include: 'LastBackupStatusInvalid', 'LastBackupStatusHealthy', 'LastBackupStatusUnhealthy', 'LastBackupStatusIRPending' + LastBackupStatus LastBackupStatus `json:"lastBackupStatus,omitempty"` + // LastBackupTime - Timestamp of the last backup operation on this backup item. + LastBackupTime *date.Time `json:"lastBackupTime,omitempty"` + // LastBackupErrorDetail - Error details in last backup + LastBackupErrorDetail *ErrorDetail `json:"lastBackupErrorDetail,omitempty"` + // ProtectedItemDataSourceID - Data ID of the protected item. + ProtectedItemDataSourceID *string `json:"protectedItemDataSourceId,omitempty"` + // ProtectedItemHealthStatus - Health status of the backup item, evaluated based on last heartbeat received. Possible values include: 'ProtectedItemHealthStatusInvalid', 'ProtectedItemHealthStatusHealthy', 'ProtectedItemHealthStatusUnhealthy', 'ProtectedItemHealthStatusNotReachable', 'ProtectedItemHealthStatusIRPending' + ProtectedItemHealthStatus ProtectedItemHealthStatus `json:"protectedItemHealthStatus,omitempty"` + // ExtendedInfo - Additional information for this backup item. + ExtendedInfo *AzureVMWorkloadProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` + // BackupManagementType - Type of backup managemenent for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase' + WorkloadType DataSourceType `json:"workloadType,omitempty"` + // ContainerName - Unique name of container + ContainerName *string `json:"containerName,omitempty"` + // SourceResourceID - ARM ID of the resource to be backed up. + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // PolicyID - ID of the backup policy with which this item is backed up. + PolicyID *string `json:"policyId,omitempty"` + // LastRecoveryPoint - Timestamp when the last (latest) backup copy was created for this backup item. + LastRecoveryPoint *date.Time `json:"lastRecoveryPoint,omitempty"` + // BackupSetName - Name of the backup set the backup item belongs to + BackupSetName *string `json:"backupSetName,omitempty"` + // CreateMode - Create mode to indicate recovery of existing soft deleted data source or creation of new data source. Possible values include: 'CreateModeInvalid', 'CreateModeDefault', 'CreateModeRecover' + CreateMode CreateMode `json:"createMode,omitempty"` + // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' + ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` +} + +func unmarshalBasicAzureVMWorkloadProtectedItem(body []byte) (BasicAzureVMWorkloadProtectedItem, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["protectedItemType"] { + case string(ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase): + var avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem + err := json.Unmarshal(body, &avwshdpi) + return avwshdpi, err + default: + var avwpi AzureVMWorkloadProtectedItem + err := json.Unmarshal(body, &avwpi) + return avwpi, err + } +} +func unmarshalBasicAzureVMWorkloadProtectedItemArray(body []byte) ([]BasicAzureVMWorkloadProtectedItem, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + avwpiArray := make([]BasicAzureVMWorkloadProtectedItem, len(rawMessages)) + + for index, rawMessage := range rawMessages { + avwpi, err := unmarshalBasicAzureVMWorkloadProtectedItem(*rawMessage) + if err != nil { + return nil, err + } + avwpiArray[index] = avwpi + } + return avwpiArray, nil +} + +// MarshalJSON is the custom marshaler for AzureVMWorkloadProtectedItem. +func (avwpi AzureVMWorkloadProtectedItem) MarshalJSON() ([]byte, error) { + avwpi.ProtectedItemType = ProtectedItemTypeAzureVMWorkloadProtectedItem + objectMap := make(map[string]interface{}) + if avwpi.FriendlyName != nil { + objectMap["friendlyName"] = avwpi.FriendlyName + } + if avwpi.ServerName != nil { + objectMap["serverName"] = avwpi.ServerName + } + if avwpi.ParentName != nil { + objectMap["parentName"] = avwpi.ParentName + } + if avwpi.ParentType != nil { + objectMap["parentType"] = avwpi.ParentType + } + if avwpi.ProtectionStatus != nil { + objectMap["protectionStatus"] = avwpi.ProtectionStatus + } + if avwpi.ProtectionState != "" { + objectMap["protectionState"] = avwpi.ProtectionState + } + if avwpi.LastBackupStatus != "" { + objectMap["lastBackupStatus"] = avwpi.LastBackupStatus + } + if avwpi.LastBackupTime != nil { + objectMap["lastBackupTime"] = avwpi.LastBackupTime + } + if avwpi.LastBackupErrorDetail != nil { + objectMap["lastBackupErrorDetail"] = avwpi.LastBackupErrorDetail + } + if avwpi.ProtectedItemDataSourceID != nil { + objectMap["protectedItemDataSourceId"] = avwpi.ProtectedItemDataSourceID + } + if avwpi.ProtectedItemHealthStatus != "" { + objectMap["protectedItemHealthStatus"] = avwpi.ProtectedItemHealthStatus + } + if avwpi.ExtendedInfo != nil { + objectMap["extendedInfo"] = avwpi.ExtendedInfo + } + if avwpi.BackupManagementType != "" { + objectMap["backupManagementType"] = avwpi.BackupManagementType + } + if avwpi.WorkloadType != "" { + objectMap["workloadType"] = avwpi.WorkloadType + } + if avwpi.ContainerName != nil { + objectMap["containerName"] = avwpi.ContainerName + } + if avwpi.SourceResourceID != nil { + objectMap["sourceResourceId"] = avwpi.SourceResourceID + } + if avwpi.PolicyID != nil { + objectMap["policyId"] = avwpi.PolicyID + } + if avwpi.LastRecoveryPoint != nil { + objectMap["lastRecoveryPoint"] = avwpi.LastRecoveryPoint + } + if avwpi.BackupSetName != nil { + objectMap["backupSetName"] = avwpi.BackupSetName + } + if avwpi.CreateMode != "" { + objectMap["createMode"] = avwpi.CreateMode + } + if avwpi.ProtectedItemType != "" { + objectMap["protectedItemType"] = avwpi.ProtectedItemType + } + return json.Marshal(objectMap) +} + +// AsAzureFileshareProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. +func (avwpi AzureVMWorkloadProtectedItem) AsAzureFileshareProtectedItem() (*AzureFileshareProtectedItem, bool) { + return nil, false +} + +// AsAzureIaaSClassicComputeVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. +func (avwpi AzureVMWorkloadProtectedItem) AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) { + return nil, false +} + +// AsAzureIaaSComputeVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. +func (avwpi AzureVMWorkloadProtectedItem) AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) { + return nil, false +} + +// AsAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. +func (avwpi AzureVMWorkloadProtectedItem) AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) { + return nil, false +} + +// AsBasicAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. +func (avwpi AzureVMWorkloadProtectedItem) AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) { + return nil, false +} + +// AsAzureSQLProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. +func (avwpi AzureVMWorkloadProtectedItem) AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. +func (avwpi AzureVMWorkloadProtectedItem) AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) { + return &avwpi, true +} + +// AsBasicAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. +func (avwpi AzureVMWorkloadProtectedItem) AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) { + return &avwpi, true +} + +// AsAzureVMWorkloadSAPHanaDatabaseProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. +func (avwpi AzureVMWorkloadProtectedItem) AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLDatabaseProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. +func (avwpi AzureVMWorkloadProtectedItem) AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) { + return nil, false +} + +// AsDPMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. +func (avwpi AzureVMWorkloadProtectedItem) AsDPMProtectedItem() (*DPMProtectedItem, bool) { + return nil, false +} + +// AsGenericProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. +func (avwpi AzureVMWorkloadProtectedItem) AsGenericProtectedItem() (*GenericProtectedItem, bool) { + return nil, false +} + +// AsMabFileFolderProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. +func (avwpi AzureVMWorkloadProtectedItem) AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) { + return nil, false +} + +// AsProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. +func (avwpi AzureVMWorkloadProtectedItem) AsProtectedItem() (*ProtectedItem, bool) { + return nil, false +} + +// AsBasicProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. +func (avwpi AzureVMWorkloadProtectedItem) AsBasicProtectedItem() (BasicProtectedItem, bool) { + return &avwpi, true +} + // AzureVMWorkloadProtectedItemExtendedInfo additional information on Azure Workload for SQL specific backup item. type AzureVMWorkloadProtectedItemExtendedInfo struct { // OldestRecoveryPoint - The oldest backup copy available for this backup item. @@ -5242,6 +5978,687 @@ func (avwpp AzureVMWorkloadProtectionPolicy) AsBasicProtectionPolicy() (BasicPro return &avwpp, true } +// AzureVMWorkloadSAPHanaDatabaseProtectableItem azure VM workload-specific protectable item representing SAP Hana +// Database. +type AzureVMWorkloadSAPHanaDatabaseProtectableItem struct { + // ParentName - Name for instance or AG + ParentName *string `json:"parentName,omitempty"` + // ParentUniqueName - Parent Unique Name is added to provide the service formatted URI Name of the Parent + // Only Applicable for data bases where the parent would be either Instance or a SQL AG. + ParentUniqueName *string `json:"parentUniqueName,omitempty"` + // ServerName - Host/Cluster Name for instance or AG + ServerName *string `json:"serverName,omitempty"` + // IsAutoProtectable - Indicates if protectable item is auto-protectable + IsAutoProtectable *bool `json:"isAutoProtectable,omitempty"` + // Subinquireditemcount - For instance or AG, indicates number of DB's present + Subinquireditemcount *int32 `json:"subinquireditemcount,omitempty"` + // Subprotectableitemcount - For instance or AG, indicates number of DB's to be protected + Subprotectableitemcount *int32 `json:"subprotectableitemcount,omitempty"` + // Prebackupvalidation - Pre-backup validation for protectable objects + Prebackupvalidation *PreBackupValidation `json:"prebackupvalidation,omitempty"` + // BackupManagementType - Type of backup managemenent to backup an item. + BackupManagementType *string `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload for the backup management + WorkloadType *string `json:"workloadType,omitempty"` + // FriendlyName - Friendly name of the backup item. + FriendlyName *string `json:"friendlyName,omitempty"` + // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' + ProtectionState ProtectionStatus `json:"protectionState,omitempty"` + // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' + ProtectableItemType ProtectableItemType `json:"protectableItemType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureVMWorkloadSAPHanaDatabaseProtectableItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) MarshalJSON() ([]byte, error) { + avwshdpi.ProtectableItemType = ProtectableItemTypeSAPHanaDatabase + objectMap := make(map[string]interface{}) + if avwshdpi.ParentName != nil { + objectMap["parentName"] = avwshdpi.ParentName + } + if avwshdpi.ParentUniqueName != nil { + objectMap["parentUniqueName"] = avwshdpi.ParentUniqueName + } + if avwshdpi.ServerName != nil { + objectMap["serverName"] = avwshdpi.ServerName + } + if avwshdpi.IsAutoProtectable != nil { + objectMap["isAutoProtectable"] = avwshdpi.IsAutoProtectable + } + if avwshdpi.Subinquireditemcount != nil { + objectMap["subinquireditemcount"] = avwshdpi.Subinquireditemcount + } + if avwshdpi.Subprotectableitemcount != nil { + objectMap["subprotectableitemcount"] = avwshdpi.Subprotectableitemcount + } + if avwshdpi.Prebackupvalidation != nil { + objectMap["prebackupvalidation"] = avwshdpi.Prebackupvalidation + } + if avwshdpi.BackupManagementType != nil { + objectMap["backupManagementType"] = avwshdpi.BackupManagementType + } + if avwshdpi.WorkloadType != nil { + objectMap["workloadType"] = avwshdpi.WorkloadType + } + if avwshdpi.FriendlyName != nil { + objectMap["friendlyName"] = avwshdpi.FriendlyName + } + if avwshdpi.ProtectionState != "" { + objectMap["protectionState"] = avwshdpi.ProtectionState + } + if avwshdpi.ProtectableItemType != "" { + objectMap["protectableItemType"] = avwshdpi.ProtectableItemType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) { + return nil, false +} + +// AsAzureIaaSClassicComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) { + return nil, false +} + +// AsAzureIaaSComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) { + return nil, false +} + +// AsBasicAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) { + return &avwshdpi, true +} + +// AsAzureVMWorkloadSAPHanaDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) { + return &avwshdpi, true +} + +// AsAzureVMWorkloadSAPHanaSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLInstanceProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) { + return nil, false +} + +// AsIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) { + return nil, false +} + +// AsBasicIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) { + return nil, false +} + +// AsWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) { + return nil, false +} + +// AsBasicWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) { + return &avwshdpi, true +} + +// AzureVMWorkloadSAPHanaDatabaseProtectedItem azure VM workload-specific protected item representing SAP Hana +// Database. +type AzureVMWorkloadSAPHanaDatabaseProtectedItem struct { + // FriendlyName - Friendly name of the DB represented by this backup item. + FriendlyName *string `json:"friendlyName,omitempty"` + // ServerName - Host/Cluster Name for instance or AG + ServerName *string `json:"serverName,omitempty"` + // ParentName - Parent name of the DB such as Instance or Availability Group. + ParentName *string `json:"parentName,omitempty"` + // ParentType - Parent type of protected item, example: for a DB, standalone server or distributed + ParentType *string `json:"parentType,omitempty"` + // ProtectionStatus - Backup status of this backup item. + ProtectionStatus *string `json:"protectionStatus,omitempty"` + // ProtectionState - Backup state of this backup item. Possible values include: 'ProtectionStateInvalid', 'ProtectionStateIRPending', 'ProtectionStateProtected', 'ProtectionStateProtectionError', 'ProtectionStateProtectionStopped', 'ProtectionStateProtectionPaused' + ProtectionState ProtectionState `json:"protectionState,omitempty"` + // LastBackupStatus - Last backup operation status. Possible values: Healthy, Unhealthy. Possible values include: 'LastBackupStatusInvalid', 'LastBackupStatusHealthy', 'LastBackupStatusUnhealthy', 'LastBackupStatusIRPending' + LastBackupStatus LastBackupStatus `json:"lastBackupStatus,omitempty"` + // LastBackupTime - Timestamp of the last backup operation on this backup item. + LastBackupTime *date.Time `json:"lastBackupTime,omitempty"` + // LastBackupErrorDetail - Error details in last backup + LastBackupErrorDetail *ErrorDetail `json:"lastBackupErrorDetail,omitempty"` + // ProtectedItemDataSourceID - Data ID of the protected item. + ProtectedItemDataSourceID *string `json:"protectedItemDataSourceId,omitempty"` + // ProtectedItemHealthStatus - Health status of the backup item, evaluated based on last heartbeat received. Possible values include: 'ProtectedItemHealthStatusInvalid', 'ProtectedItemHealthStatusHealthy', 'ProtectedItemHealthStatusUnhealthy', 'ProtectedItemHealthStatusNotReachable', 'ProtectedItemHealthStatusIRPending' + ProtectedItemHealthStatus ProtectedItemHealthStatus `json:"protectedItemHealthStatus,omitempty"` + // ExtendedInfo - Additional information for this backup item. + ExtendedInfo *AzureVMWorkloadProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` + // BackupManagementType - Type of backup managemenent for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase' + WorkloadType DataSourceType `json:"workloadType,omitempty"` + // ContainerName - Unique name of container + ContainerName *string `json:"containerName,omitempty"` + // SourceResourceID - ARM ID of the resource to be backed up. + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // PolicyID - ID of the backup policy with which this item is backed up. + PolicyID *string `json:"policyId,omitempty"` + // LastRecoveryPoint - Timestamp when the last (latest) backup copy was created for this backup item. + LastRecoveryPoint *date.Time `json:"lastRecoveryPoint,omitempty"` + // BackupSetName - Name of the backup set the backup item belongs to + BackupSetName *string `json:"backupSetName,omitempty"` + // CreateMode - Create mode to indicate recovery of existing soft deleted data source or creation of new data source. Possible values include: 'CreateModeInvalid', 'CreateModeDefault', 'CreateModeRecover' + CreateMode CreateMode `json:"createMode,omitempty"` + // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' + ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureVMWorkloadSAPHanaDatabaseProtectedItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) MarshalJSON() ([]byte, error) { + avwshdpi.ProtectedItemType = ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase + objectMap := make(map[string]interface{}) + if avwshdpi.FriendlyName != nil { + objectMap["friendlyName"] = avwshdpi.FriendlyName + } + if avwshdpi.ServerName != nil { + objectMap["serverName"] = avwshdpi.ServerName + } + if avwshdpi.ParentName != nil { + objectMap["parentName"] = avwshdpi.ParentName + } + if avwshdpi.ParentType != nil { + objectMap["parentType"] = avwshdpi.ParentType + } + if avwshdpi.ProtectionStatus != nil { + objectMap["protectionStatus"] = avwshdpi.ProtectionStatus + } + if avwshdpi.ProtectionState != "" { + objectMap["protectionState"] = avwshdpi.ProtectionState + } + if avwshdpi.LastBackupStatus != "" { + objectMap["lastBackupStatus"] = avwshdpi.LastBackupStatus + } + if avwshdpi.LastBackupTime != nil { + objectMap["lastBackupTime"] = avwshdpi.LastBackupTime + } + if avwshdpi.LastBackupErrorDetail != nil { + objectMap["lastBackupErrorDetail"] = avwshdpi.LastBackupErrorDetail + } + if avwshdpi.ProtectedItemDataSourceID != nil { + objectMap["protectedItemDataSourceId"] = avwshdpi.ProtectedItemDataSourceID + } + if avwshdpi.ProtectedItemHealthStatus != "" { + objectMap["protectedItemHealthStatus"] = avwshdpi.ProtectedItemHealthStatus + } + if avwshdpi.ExtendedInfo != nil { + objectMap["extendedInfo"] = avwshdpi.ExtendedInfo + } + if avwshdpi.BackupManagementType != "" { + objectMap["backupManagementType"] = avwshdpi.BackupManagementType + } + if avwshdpi.WorkloadType != "" { + objectMap["workloadType"] = avwshdpi.WorkloadType + } + if avwshdpi.ContainerName != nil { + objectMap["containerName"] = avwshdpi.ContainerName + } + if avwshdpi.SourceResourceID != nil { + objectMap["sourceResourceId"] = avwshdpi.SourceResourceID + } + if avwshdpi.PolicyID != nil { + objectMap["policyId"] = avwshdpi.PolicyID + } + if avwshdpi.LastRecoveryPoint != nil { + objectMap["lastRecoveryPoint"] = avwshdpi.LastRecoveryPoint + } + if avwshdpi.BackupSetName != nil { + objectMap["backupSetName"] = avwshdpi.BackupSetName + } + if avwshdpi.CreateMode != "" { + objectMap["createMode"] = avwshdpi.CreateMode + } + if avwshdpi.ProtectedItemType != "" { + objectMap["protectedItemType"] = avwshdpi.ProtectedItemType + } + return json.Marshal(objectMap) +} + +// AsAzureFileshareProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsAzureFileshareProtectedItem() (*AzureFileshareProtectedItem, bool) { + return nil, false +} + +// AsAzureIaaSClassicComputeVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) { + return nil, false +} + +// AsAzureIaaSComputeVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) { + return nil, false +} + +// AsAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) { + return nil, false +} + +// AsBasicAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) { + return nil, false +} + +// AsAzureSQLProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) { + return nil, false +} + +// AsBasicAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) { + return &avwshdpi, true +} + +// AsAzureVMWorkloadSAPHanaDatabaseProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) { + return &avwshdpi, true +} + +// AsAzureVMWorkloadSQLDatabaseProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) { + return nil, false +} + +// AsDPMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsDPMProtectedItem() (*DPMProtectedItem, bool) { + return nil, false +} + +// AsGenericProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsGenericProtectedItem() (*GenericProtectedItem, bool) { + return nil, false +} + +// AsMabFileFolderProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) { + return nil, false +} + +// AsProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsProtectedItem() (*ProtectedItem, bool) { + return nil, false +} + +// AsBasicProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsBasicProtectedItem() (BasicProtectedItem, bool) { + return &avwshdpi, true +} + +// AzureVMWorkloadSAPHanaDatabaseWorkloadItem azure VM workload-specific workload item representing SAP Hana +// Database. +type AzureVMWorkloadSAPHanaDatabaseWorkloadItem struct { + // ParentName - Name for instance or AG + ParentName *string `json:"parentName,omitempty"` + // ServerName - Host/Cluster Name for instance or AG + ServerName *string `json:"serverName,omitempty"` + // IsAutoProtectable - Indicates if workload item is auto-protectable + IsAutoProtectable *bool `json:"isAutoProtectable,omitempty"` + // Subinquireditemcount - For instance or AG, indicates number of DB's present + Subinquireditemcount *int32 `json:"subinquireditemcount,omitempty"` + // SubWorkloadItemCount - For instance or AG, indicates number of DB's to be protected + SubWorkloadItemCount *int32 `json:"subWorkloadItemCount,omitempty"` + // BackupManagementType - Type of backup managemenent to backup an item. + BackupManagementType *string `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload for the backup management + WorkloadType *string `json:"workloadType,omitempty"` + // FriendlyName - Friendly name of the backup item. + FriendlyName *string `json:"friendlyName,omitempty"` + // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' + ProtectionState ProtectionStatus `json:"protectionState,omitempty"` + // WorkloadItemType - Possible values include: 'WorkloadItemTypeWorkloadItem', 'WorkloadItemTypeAzureVMWorkloadItem', 'WorkloadItemTypeSAPHanaDatabase1', 'WorkloadItemTypeSAPHanaSystem1', 'WorkloadItemTypeSQLDataBase1', 'WorkloadItemTypeSQLInstance1' + WorkloadItemType WorkloadItemTypeBasicWorkloadItem `json:"workloadItemType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureVMWorkloadSAPHanaDatabaseWorkloadItem. +func (avwshdwi AzureVMWorkloadSAPHanaDatabaseWorkloadItem) MarshalJSON() ([]byte, error) { + avwshdwi.WorkloadItemType = WorkloadItemTypeSAPHanaDatabase1 + objectMap := make(map[string]interface{}) + if avwshdwi.ParentName != nil { + objectMap["parentName"] = avwshdwi.ParentName + } + if avwshdwi.ServerName != nil { + objectMap["serverName"] = avwshdwi.ServerName + } + if avwshdwi.IsAutoProtectable != nil { + objectMap["isAutoProtectable"] = avwshdwi.IsAutoProtectable + } + if avwshdwi.Subinquireditemcount != nil { + objectMap["subinquireditemcount"] = avwshdwi.Subinquireditemcount + } + if avwshdwi.SubWorkloadItemCount != nil { + objectMap["subWorkloadItemCount"] = avwshdwi.SubWorkloadItemCount + } + if avwshdwi.BackupManagementType != nil { + objectMap["backupManagementType"] = avwshdwi.BackupManagementType + } + if avwshdwi.WorkloadType != nil { + objectMap["workloadType"] = avwshdwi.WorkloadType + } + if avwshdwi.FriendlyName != nil { + objectMap["friendlyName"] = avwshdwi.FriendlyName + } + if avwshdwi.ProtectionState != "" { + objectMap["protectionState"] = avwshdwi.ProtectionState + } + if avwshdwi.WorkloadItemType != "" { + objectMap["workloadItemType"] = avwshdwi.WorkloadItemType + } + return json.Marshal(objectMap) +} + +// AsAzureVMWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaDatabaseWorkloadItem. +func (avwshdwi AzureVMWorkloadSAPHanaDatabaseWorkloadItem) AsAzureVMWorkloadItem() (*AzureVMWorkloadItem, bool) { + return nil, false +} + +// AsBasicAzureVMWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaDatabaseWorkloadItem. +func (avwshdwi AzureVMWorkloadSAPHanaDatabaseWorkloadItem) AsBasicAzureVMWorkloadItem() (BasicAzureVMWorkloadItem, bool) { + return &avwshdwi, true +} + +// AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaDatabaseWorkloadItem. +func (avwshdwi AzureVMWorkloadSAPHanaDatabaseWorkloadItem) AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem() (*AzureVMWorkloadSAPHanaDatabaseWorkloadItem, bool) { + return &avwshdwi, true +} + +// AsAzureVMWorkloadSAPHanaSystemWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaDatabaseWorkloadItem. +func (avwshdwi AzureVMWorkloadSAPHanaDatabaseWorkloadItem) AsAzureVMWorkloadSAPHanaSystemWorkloadItem() (*AzureVMWorkloadSAPHanaSystemWorkloadItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaDatabaseWorkloadItem. +func (avwshdwi AzureVMWorkloadSAPHanaDatabaseWorkloadItem) AsAzureVMWorkloadSQLDatabaseWorkloadItem() (*AzureVMWorkloadSQLDatabaseWorkloadItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLInstanceWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaDatabaseWorkloadItem. +func (avwshdwi AzureVMWorkloadSAPHanaDatabaseWorkloadItem) AsAzureVMWorkloadSQLInstanceWorkloadItem() (*AzureVMWorkloadSQLInstanceWorkloadItem, bool) { + return nil, false +} + +// AsWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaDatabaseWorkloadItem. +func (avwshdwi AzureVMWorkloadSAPHanaDatabaseWorkloadItem) AsWorkloadItem() (*WorkloadItem, bool) { + return nil, false +} + +// AsBasicWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaDatabaseWorkloadItem. +func (avwshdwi AzureVMWorkloadSAPHanaDatabaseWorkloadItem) AsBasicWorkloadItem() (BasicWorkloadItem, bool) { + return &avwshdwi, true +} + +// AzureVMWorkloadSAPHanaSystemProtectableItem azure VM workload-specific protectable item representing SAP Hana +// System. +type AzureVMWorkloadSAPHanaSystemProtectableItem struct { + // ParentName - Name for instance or AG + ParentName *string `json:"parentName,omitempty"` + // ParentUniqueName - Parent Unique Name is added to provide the service formatted URI Name of the Parent + // Only Applicable for data bases where the parent would be either Instance or a SQL AG. + ParentUniqueName *string `json:"parentUniqueName,omitempty"` + // ServerName - Host/Cluster Name for instance or AG + ServerName *string `json:"serverName,omitempty"` + // IsAutoProtectable - Indicates if protectable item is auto-protectable + IsAutoProtectable *bool `json:"isAutoProtectable,omitempty"` + // Subinquireditemcount - For instance or AG, indicates number of DB's present + Subinquireditemcount *int32 `json:"subinquireditemcount,omitempty"` + // Subprotectableitemcount - For instance or AG, indicates number of DB's to be protected + Subprotectableitemcount *int32 `json:"subprotectableitemcount,omitempty"` + // Prebackupvalidation - Pre-backup validation for protectable objects + Prebackupvalidation *PreBackupValidation `json:"prebackupvalidation,omitempty"` + // BackupManagementType - Type of backup managemenent to backup an item. + BackupManagementType *string `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload for the backup management + WorkloadType *string `json:"workloadType,omitempty"` + // FriendlyName - Friendly name of the backup item. + FriendlyName *string `json:"friendlyName,omitempty"` + // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' + ProtectionState ProtectionStatus `json:"protectionState,omitempty"` + // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' + ProtectableItemType ProtectableItemType `json:"protectableItemType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureVMWorkloadSAPHanaSystemProtectableItem. +func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) MarshalJSON() ([]byte, error) { + avwshspi.ProtectableItemType = ProtectableItemTypeSAPHanaSystem + objectMap := make(map[string]interface{}) + if avwshspi.ParentName != nil { + objectMap["parentName"] = avwshspi.ParentName + } + if avwshspi.ParentUniqueName != nil { + objectMap["parentUniqueName"] = avwshspi.ParentUniqueName + } + if avwshspi.ServerName != nil { + objectMap["serverName"] = avwshspi.ServerName + } + if avwshspi.IsAutoProtectable != nil { + objectMap["isAutoProtectable"] = avwshspi.IsAutoProtectable + } + if avwshspi.Subinquireditemcount != nil { + objectMap["subinquireditemcount"] = avwshspi.Subinquireditemcount + } + if avwshspi.Subprotectableitemcount != nil { + objectMap["subprotectableitemcount"] = avwshspi.Subprotectableitemcount + } + if avwshspi.Prebackupvalidation != nil { + objectMap["prebackupvalidation"] = avwshspi.Prebackupvalidation + } + if avwshspi.BackupManagementType != nil { + objectMap["backupManagementType"] = avwshspi.BackupManagementType + } + if avwshspi.WorkloadType != nil { + objectMap["workloadType"] = avwshspi.WorkloadType + } + if avwshspi.FriendlyName != nil { + objectMap["friendlyName"] = avwshspi.FriendlyName + } + if avwshspi.ProtectionState != "" { + objectMap["protectionState"] = avwshspi.ProtectionState + } + if avwshspi.ProtectableItemType != "" { + objectMap["protectableItemType"] = avwshspi.ProtectableItemType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. +func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) { + return nil, false +} + +// AsAzureIaaSClassicComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. +func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) { + return nil, false +} + +// AsAzureIaaSComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. +func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. +func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) { + return nil, false +} + +// AsBasicAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. +func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) { + return &avwshspi, true +} + +// AsAzureVMWorkloadSAPHanaDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. +func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. +func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) { + return &avwshspi, true +} + +// AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. +func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. +func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLInstanceProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. +func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) { + return nil, false +} + +// AsIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. +func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) { + return nil, false +} + +// AsBasicIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. +func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) { + return nil, false +} + +// AsWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. +func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) { + return nil, false +} + +// AsBasicWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. +func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) { + return &avwshspi, true +} + +// AzureVMWorkloadSAPHanaSystemWorkloadItem azure VM workload-specific workload item representing SAP Hana System. +type AzureVMWorkloadSAPHanaSystemWorkloadItem struct { + // ParentName - Name for instance or AG + ParentName *string `json:"parentName,omitempty"` + // ServerName - Host/Cluster Name for instance or AG + ServerName *string `json:"serverName,omitempty"` + // IsAutoProtectable - Indicates if workload item is auto-protectable + IsAutoProtectable *bool `json:"isAutoProtectable,omitempty"` + // Subinquireditemcount - For instance or AG, indicates number of DB's present + Subinquireditemcount *int32 `json:"subinquireditemcount,omitempty"` + // SubWorkloadItemCount - For instance or AG, indicates number of DB's to be protected + SubWorkloadItemCount *int32 `json:"subWorkloadItemCount,omitempty"` + // BackupManagementType - Type of backup managemenent to backup an item. + BackupManagementType *string `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload for the backup management + WorkloadType *string `json:"workloadType,omitempty"` + // FriendlyName - Friendly name of the backup item. + FriendlyName *string `json:"friendlyName,omitempty"` + // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' + ProtectionState ProtectionStatus `json:"protectionState,omitempty"` + // WorkloadItemType - Possible values include: 'WorkloadItemTypeWorkloadItem', 'WorkloadItemTypeAzureVMWorkloadItem', 'WorkloadItemTypeSAPHanaDatabase1', 'WorkloadItemTypeSAPHanaSystem1', 'WorkloadItemTypeSQLDataBase1', 'WorkloadItemTypeSQLInstance1' + WorkloadItemType WorkloadItemTypeBasicWorkloadItem `json:"workloadItemType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureVMWorkloadSAPHanaSystemWorkloadItem. +func (avwshswi AzureVMWorkloadSAPHanaSystemWorkloadItem) MarshalJSON() ([]byte, error) { + avwshswi.WorkloadItemType = WorkloadItemTypeSAPHanaSystem1 + objectMap := make(map[string]interface{}) + if avwshswi.ParentName != nil { + objectMap["parentName"] = avwshswi.ParentName + } + if avwshswi.ServerName != nil { + objectMap["serverName"] = avwshswi.ServerName + } + if avwshswi.IsAutoProtectable != nil { + objectMap["isAutoProtectable"] = avwshswi.IsAutoProtectable + } + if avwshswi.Subinquireditemcount != nil { + objectMap["subinquireditemcount"] = avwshswi.Subinquireditemcount + } + if avwshswi.SubWorkloadItemCount != nil { + objectMap["subWorkloadItemCount"] = avwshswi.SubWorkloadItemCount + } + if avwshswi.BackupManagementType != nil { + objectMap["backupManagementType"] = avwshswi.BackupManagementType + } + if avwshswi.WorkloadType != nil { + objectMap["workloadType"] = avwshswi.WorkloadType + } + if avwshswi.FriendlyName != nil { + objectMap["friendlyName"] = avwshswi.FriendlyName + } + if avwshswi.ProtectionState != "" { + objectMap["protectionState"] = avwshswi.ProtectionState + } + if avwshswi.WorkloadItemType != "" { + objectMap["workloadItemType"] = avwshswi.WorkloadItemType + } + return json.Marshal(objectMap) +} + +// AsAzureVMWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaSystemWorkloadItem. +func (avwshswi AzureVMWorkloadSAPHanaSystemWorkloadItem) AsAzureVMWorkloadItem() (*AzureVMWorkloadItem, bool) { + return nil, false +} + +// AsBasicAzureVMWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaSystemWorkloadItem. +func (avwshswi AzureVMWorkloadSAPHanaSystemWorkloadItem) AsBasicAzureVMWorkloadItem() (BasicAzureVMWorkloadItem, bool) { + return &avwshswi, true +} + +// AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaSystemWorkloadItem. +func (avwshswi AzureVMWorkloadSAPHanaSystemWorkloadItem) AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem() (*AzureVMWorkloadSAPHanaDatabaseWorkloadItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaSystemWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaSystemWorkloadItem. +func (avwshswi AzureVMWorkloadSAPHanaSystemWorkloadItem) AsAzureVMWorkloadSAPHanaSystemWorkloadItem() (*AzureVMWorkloadSAPHanaSystemWorkloadItem, bool) { + return &avwshswi, true +} + +// AsAzureVMWorkloadSQLDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaSystemWorkloadItem. +func (avwshswi AzureVMWorkloadSAPHanaSystemWorkloadItem) AsAzureVMWorkloadSQLDatabaseWorkloadItem() (*AzureVMWorkloadSQLDatabaseWorkloadItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLInstanceWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaSystemWorkloadItem. +func (avwshswi AzureVMWorkloadSAPHanaSystemWorkloadItem) AsAzureVMWorkloadSQLInstanceWorkloadItem() (*AzureVMWorkloadSQLInstanceWorkloadItem, bool) { + return nil, false +} + +// AsWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaSystemWorkloadItem. +func (avwshswi AzureVMWorkloadSAPHanaSystemWorkloadItem) AsWorkloadItem() (*WorkloadItem, bool) { + return nil, false +} + +// AsBasicWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaSystemWorkloadItem. +func (avwshswi AzureVMWorkloadSAPHanaSystemWorkloadItem) AsBasicWorkloadItem() (BasicWorkloadItem, bool) { + return &avwshswi, true +} + // AzureVMWorkloadSQLAvailabilityGroupProtectableItem azure VM workload-specific protectable item representing SQL // Availability Group. type AzureVMWorkloadSQLAvailabilityGroupProtectableItem struct { @@ -5268,7 +6685,7 @@ type AzureVMWorkloadSQLAvailabilityGroupProtectableItem struct { FriendlyName *string `json:"friendlyName,omitempty"` // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' + // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' ProtectableItemType ProtectableItemType `json:"protectableItemType,omitempty"` } @@ -5340,6 +6757,16 @@ func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsBasicAzureV return &avwsagpi, true } +// AsAzureVMWorkloadSAPHanaDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. +func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. +func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) { + return nil, false +} + // AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) { return &avwsagpi, true @@ -5400,7 +6827,7 @@ type AzureVMWorkloadSQLDatabaseProtectableItem struct { FriendlyName *string `json:"friendlyName,omitempty"` // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' + // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' ProtectableItemType ProtectableItemType `json:"protectableItemType,omitempty"` } @@ -5472,6 +6899,16 @@ func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsBasicAzureVMWorkloadP return &avwsdpi, true } +// AsAzureVMWorkloadSAPHanaDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) { + return nil, false +} + // AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) { return nil, false @@ -5535,7 +6972,7 @@ type AzureVMWorkloadSQLDatabaseProtectedItem struct { ExtendedInfo *AzureVMWorkloadProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` // BackupManagementType - Type of backup managemenent for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare' + // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase' WorkloadType DataSourceType `json:"workloadType,omitempty"` // ContainerName - Unique name of container ContainerName *string `json:"containerName,omitempty"` @@ -5547,7 +6984,9 @@ type AzureVMWorkloadSQLDatabaseProtectedItem struct { LastRecoveryPoint *date.Time `json:"lastRecoveryPoint,omitempty"` // BackupSetName - Name of the backup set the backup item belongs to BackupSetName *string `json:"backupSetName,omitempty"` - // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' + // CreateMode - Create mode to indicate recovery of existing soft deleted data source or creation of new data source. Possible values include: 'CreateModeInvalid', 'CreateModeDefault', 'CreateModeRecover' + CreateMode CreateMode `json:"createMode,omitempty"` + // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` } @@ -5612,6 +7051,9 @@ func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) MarshalJSON() ([]byte, er if avwsdpi.BackupSetName != nil { objectMap["backupSetName"] = avwsdpi.BackupSetName } + if avwsdpi.CreateMode != "" { + objectMap["createMode"] = avwsdpi.CreateMode + } if avwsdpi.ProtectedItemType != "" { objectMap["protectedItemType"] = avwsdpi.ProtectedItemType } @@ -5648,6 +7090,21 @@ func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsAzureSQLProtectedItem() return nil, false } +// AsAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) { + return nil, false +} + +// AsBasicAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaDatabaseProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) { + return nil, false +} + // AsAzureVMWorkloadSQLDatabaseProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) { return &avwsdpi, true @@ -5698,7 +7155,7 @@ type AzureVMWorkloadSQLDatabaseWorkloadItem struct { FriendlyName *string `json:"friendlyName,omitempty"` // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // WorkloadItemType - Possible values include: 'WorkloadItemTypeWorkloadItem', 'WorkloadItemTypeAzureVMWorkloadItem', 'WorkloadItemTypeSQLDataBase1', 'WorkloadItemTypeSQLInstance1' + // WorkloadItemType - Possible values include: 'WorkloadItemTypeWorkloadItem', 'WorkloadItemTypeAzureVMWorkloadItem', 'WorkloadItemTypeSAPHanaDatabase1', 'WorkloadItemTypeSAPHanaSystem1', 'WorkloadItemTypeSQLDataBase1', 'WorkloadItemTypeSQLInstance1' WorkloadItemType WorkloadItemTypeBasicWorkloadItem `json:"workloadItemType,omitempty"` } @@ -5749,6 +7206,16 @@ func (avwsdwi AzureVMWorkloadSQLDatabaseWorkloadItem) AsBasicAzureVMWorkloadItem return &avwsdwi, true } +// AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLDatabaseWorkloadItem. +func (avwsdwi AzureVMWorkloadSQLDatabaseWorkloadItem) AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem() (*AzureVMWorkloadSAPHanaDatabaseWorkloadItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaSystemWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLDatabaseWorkloadItem. +func (avwsdwi AzureVMWorkloadSQLDatabaseWorkloadItem) AsAzureVMWorkloadSAPHanaSystemWorkloadItem() (*AzureVMWorkloadSAPHanaSystemWorkloadItem, bool) { + return nil, false +} + // AsAzureVMWorkloadSQLDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLDatabaseWorkloadItem. func (avwsdwi AzureVMWorkloadSQLDatabaseWorkloadItem) AsAzureVMWorkloadSQLDatabaseWorkloadItem() (*AzureVMWorkloadSQLDatabaseWorkloadItem, bool) { return &avwsdwi, true @@ -5794,7 +7261,7 @@ type AzureVMWorkloadSQLInstanceProtectableItem struct { FriendlyName *string `json:"friendlyName,omitempty"` // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' + // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' ProtectableItemType ProtectableItemType `json:"protectableItemType,omitempty"` } @@ -5866,6 +7333,16 @@ func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsBasicAzureVMWorkloadP return &avwsipi, true } +// AsAzureVMWorkloadSAPHanaDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. +func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. +func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) { + return nil, false +} + // AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) { return nil, false @@ -5923,7 +7400,7 @@ type AzureVMWorkloadSQLInstanceWorkloadItem struct { FriendlyName *string `json:"friendlyName,omitempty"` // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // WorkloadItemType - Possible values include: 'WorkloadItemTypeWorkloadItem', 'WorkloadItemTypeAzureVMWorkloadItem', 'WorkloadItemTypeSQLDataBase1', 'WorkloadItemTypeSQLInstance1' + // WorkloadItemType - Possible values include: 'WorkloadItemTypeWorkloadItem', 'WorkloadItemTypeAzureVMWorkloadItem', 'WorkloadItemTypeSAPHanaDatabase1', 'WorkloadItemTypeSAPHanaSystem1', 'WorkloadItemTypeSQLDataBase1', 'WorkloadItemTypeSQLInstance1' WorkloadItemType WorkloadItemTypeBasicWorkloadItem `json:"workloadItemType,omitempty"` } @@ -5977,6 +7454,16 @@ func (avwsiwi AzureVMWorkloadSQLInstanceWorkloadItem) AsBasicAzureVMWorkloadItem return &avwsiwi, true } +// AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLInstanceWorkloadItem. +func (avwsiwi AzureVMWorkloadSQLInstanceWorkloadItem) AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem() (*AzureVMWorkloadSAPHanaDatabaseWorkloadItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaSystemWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLInstanceWorkloadItem. +func (avwsiwi AzureVMWorkloadSQLInstanceWorkloadItem) AsAzureVMWorkloadSAPHanaSystemWorkloadItem() (*AzureVMWorkloadSAPHanaSystemWorkloadItem, bool) { + return nil, false +} + // AsAzureVMWorkloadSQLDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLInstanceWorkloadItem. func (avwsiwi AzureVMWorkloadSQLInstanceWorkloadItem) AsAzureVMWorkloadSQLDatabaseWorkloadItem() (*AzureVMWorkloadSQLDatabaseWorkloadItem, bool) { return nil, false @@ -5997,6 +7484,130 @@ func (avwsiwi AzureVMWorkloadSQLInstanceWorkloadItem) AsBasicWorkloadItem() (Bas return &avwsiwi, true } +// BasicAzureWorkloadAutoProtectionIntent azure Recovery Services Vault specific protection intent item. +type BasicAzureWorkloadAutoProtectionIntent interface { + AsAzureWorkloadSQLAutoProtectionIntent() (*AzureWorkloadSQLAutoProtectionIntent, bool) + AsAzureWorkloadAutoProtectionIntent() (*AzureWorkloadAutoProtectionIntent, bool) +} + +// AzureWorkloadAutoProtectionIntent azure Recovery Services Vault specific protection intent item. +type AzureWorkloadAutoProtectionIntent struct { + // BackupManagementType - Type of backup managemenent for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // SourceResourceID - ARM ID of the resource to be backed up. + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // ItemID - ID of the item which is getting protected, In case of Azure Vm , it is ProtectedItemId + ItemID *string `json:"itemId,omitempty"` + // PolicyID - ID of the backup policy with which this item is backed up. + PolicyID *string `json:"policyId,omitempty"` + // ProtectionState - Backup state of this backup item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' + ProtectionState ProtectionStatus `json:"protectionState,omitempty"` + // ProtectionIntentItemType - Possible values include: 'ProtectionIntentItemTypeProtectionIntent', 'ProtectionIntentItemTypeRecoveryServiceVaultItem', 'ProtectionIntentItemTypeAzureResourceItem', 'ProtectionIntentItemTypeAzureWorkloadAutoProtectionIntent', 'ProtectionIntentItemTypeAzureWorkloadSQLAutoProtectionIntent' + ProtectionIntentItemType ProtectionIntentItemType `json:"protectionIntentItemType,omitempty"` +} + +func unmarshalBasicAzureWorkloadAutoProtectionIntent(body []byte) (BasicAzureWorkloadAutoProtectionIntent, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["protectionIntentItemType"] { + case string(ProtectionIntentItemTypeAzureWorkloadSQLAutoProtectionIntent): + var awsapi AzureWorkloadSQLAutoProtectionIntent + err := json.Unmarshal(body, &awsapi) + return awsapi, err + default: + var awapi AzureWorkloadAutoProtectionIntent + err := json.Unmarshal(body, &awapi) + return awapi, err + } +} +func unmarshalBasicAzureWorkloadAutoProtectionIntentArray(body []byte) ([]BasicAzureWorkloadAutoProtectionIntent, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + awapiArray := make([]BasicAzureWorkloadAutoProtectionIntent, len(rawMessages)) + + for index, rawMessage := range rawMessages { + awapi, err := unmarshalBasicAzureWorkloadAutoProtectionIntent(*rawMessage) + if err != nil { + return nil, err + } + awapiArray[index] = awapi + } + return awapiArray, nil +} + +// MarshalJSON is the custom marshaler for AzureWorkloadAutoProtectionIntent. +func (awapi AzureWorkloadAutoProtectionIntent) MarshalJSON() ([]byte, error) { + awapi.ProtectionIntentItemType = ProtectionIntentItemTypeAzureWorkloadAutoProtectionIntent + objectMap := make(map[string]interface{}) + if awapi.BackupManagementType != "" { + objectMap["backupManagementType"] = awapi.BackupManagementType + } + if awapi.SourceResourceID != nil { + objectMap["sourceResourceId"] = awapi.SourceResourceID + } + if awapi.ItemID != nil { + objectMap["itemId"] = awapi.ItemID + } + if awapi.PolicyID != nil { + objectMap["policyId"] = awapi.PolicyID + } + if awapi.ProtectionState != "" { + objectMap["protectionState"] = awapi.ProtectionState + } + if awapi.ProtectionIntentItemType != "" { + objectMap["protectionIntentItemType"] = awapi.ProtectionIntentItemType + } + return json.Marshal(objectMap) +} + +// AsAzureRecoveryServiceVaultProtectionIntent is the BasicProtectionIntent implementation for AzureWorkloadAutoProtectionIntent. +func (awapi AzureWorkloadAutoProtectionIntent) AsAzureRecoveryServiceVaultProtectionIntent() (*AzureRecoveryServiceVaultProtectionIntent, bool) { + return nil, false +} + +// AsBasicAzureRecoveryServiceVaultProtectionIntent is the BasicProtectionIntent implementation for AzureWorkloadAutoProtectionIntent. +func (awapi AzureWorkloadAutoProtectionIntent) AsBasicAzureRecoveryServiceVaultProtectionIntent() (BasicAzureRecoveryServiceVaultProtectionIntent, bool) { + return &awapi, true +} + +// AsAzureResourceProtectionIntent is the BasicProtectionIntent implementation for AzureWorkloadAutoProtectionIntent. +func (awapi AzureWorkloadAutoProtectionIntent) AsAzureResourceProtectionIntent() (*AzureResourceProtectionIntent, bool) { + return nil, false +} + +// AsAzureWorkloadAutoProtectionIntent is the BasicProtectionIntent implementation for AzureWorkloadAutoProtectionIntent. +func (awapi AzureWorkloadAutoProtectionIntent) AsAzureWorkloadAutoProtectionIntent() (*AzureWorkloadAutoProtectionIntent, bool) { + return &awapi, true +} + +// AsBasicAzureWorkloadAutoProtectionIntent is the BasicProtectionIntent implementation for AzureWorkloadAutoProtectionIntent. +func (awapi AzureWorkloadAutoProtectionIntent) AsBasicAzureWorkloadAutoProtectionIntent() (BasicAzureWorkloadAutoProtectionIntent, bool) { + return &awapi, true +} + +// AsAzureWorkloadSQLAutoProtectionIntent is the BasicProtectionIntent implementation for AzureWorkloadAutoProtectionIntent. +func (awapi AzureWorkloadAutoProtectionIntent) AsAzureWorkloadSQLAutoProtectionIntent() (*AzureWorkloadSQLAutoProtectionIntent, bool) { + return nil, false +} + +// AsProtectionIntent is the BasicProtectionIntent implementation for AzureWorkloadAutoProtectionIntent. +func (awapi AzureWorkloadAutoProtectionIntent) AsProtectionIntent() (*ProtectionIntent, bool) { + return nil, false +} + +// AsBasicProtectionIntent is the BasicProtectionIntent implementation for AzureWorkloadAutoProtectionIntent. +func (awapi AzureWorkloadAutoProtectionIntent) AsBasicProtectionIntent() (BasicProtectionIntent, bool) { + return &awapi, true +} + // AzureWorkloadBackupRequest azureWorkload workload-specific backup request. type AzureWorkloadBackupRequest struct { // BackupType - Type of backup, viz. Full, Differential, Log or CopyOnlyFull. Possible values include: 'TypeEnumInvalid', 'TypeEnumFull', 'TypeEnumDifferential', 'TypeEnumLog', 'TypeEnumCopyOnlyFull' @@ -6068,6 +7679,8 @@ type AzureWorkloadContainer struct { LastUpdatedTime *date.Time `json:"lastUpdatedTime,omitempty"` // ExtendedInfo - Additional details of a workload container. ExtendedInfo *AzureWorkloadContainerExtendedInfo `json:"extendedInfo,omitempty"` + // WorkloadType - Workload type for which registration was sent. Possible values include: 'WorkloadTypeInvalid', 'WorkloadTypeVM', 'WorkloadTypeFileFolder', 'WorkloadTypeAzureSQLDb', 'WorkloadTypeSQLDB', 'WorkloadTypeExchange', 'WorkloadTypeSharepoint', 'WorkloadTypeVMwareVM', 'WorkloadTypeSystemState', 'WorkloadTypeClient', 'WorkloadTypeGenericDataSource', 'WorkloadTypeSQLDataBase', 'WorkloadTypeAzureFileShare', 'WorkloadTypeSAPHanaDatabase' + WorkloadType WorkloadType `json:"workloadType,omitempty"` // FriendlyName - Friendly name of the container. FriendlyName *string `json:"friendlyName,omitempty"` // BackupManagementType - Type of backup managemenent for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' @@ -6076,7 +7689,7 @@ type AzureWorkloadContainer struct { RegistrationStatus *string `json:"registrationStatus,omitempty"` // HealthStatus - Status of health of the container. HealthStatus *string `json:"healthStatus,omitempty"` - // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaaSVMContainer', 'ContainerTypeMABWindowsContainer' + // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaaSVMContainer', 'ContainerTypeWindows1' ContainerType ContainerTypeBasicProtectionContainer `json:"containerType,omitempty"` } @@ -6134,6 +7747,9 @@ func (awc AzureWorkloadContainer) MarshalJSON() ([]byte, error) { if awc.ExtendedInfo != nil { objectMap["extendedInfo"] = awc.ExtendedInfo } + if awc.WorkloadType != "" { + objectMap["workloadType"] = awc.WorkloadType + } if awc.FriendlyName != nil { objectMap["friendlyName"] = awc.FriendlyName } @@ -6259,6 +7875,8 @@ type AzureWorkloadErrorInfo struct { // AzureWorkloadJob azure storage specific job. type AzureWorkloadJob struct { + // WorkloadType - Workload type of the job + WorkloadType *string `json:"workloadType,omitempty"` // Duration - Time elapsed during the execution of this job. Duration *string `json:"duration,omitempty"` // ActionsInfo - Gets or sets the state/actions applicable on this job like cancel/retry. @@ -6289,6 +7907,9 @@ type AzureWorkloadJob struct { func (awj AzureWorkloadJob) MarshalJSON() ([]byte, error) { awj.JobType = JobTypeAzureWorkloadJob objectMap := make(map[string]interface{}) + if awj.WorkloadType != nil { + objectMap["workloadType"] = awj.WorkloadType + } if awj.Duration != nil { objectMap["duration"] = awj.Duration } @@ -6410,7 +8031,7 @@ type AzureWorkloadRecoveryPoint struct { RecoveryPointTimeInUTC *date.Time `json:"recoveryPointTimeInUTC,omitempty"` // Type - Type of restore point. Possible values include: 'RestorePointTypeInvalid', 'RestorePointTypeFull', 'RestorePointTypeLog', 'RestorePointTypeDifferential' Type RestorePointType `json:"type,omitempty"` - // ObjectType - Possible values include: 'ObjectTypeRecoveryPoint', 'ObjectTypeAzureFileShareRecoveryPoint', 'ObjectTypeAzureWorkloadRecoveryPoint', 'ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSQLRecoveryPoint', 'ObjectTypeGenericRecoveryPoint', 'ObjectTypeIaasVMRecoveryPoint' + // ObjectType - Possible values include: 'ObjectTypeRecoveryPoint', 'ObjectTypeAzureFileShareRecoveryPoint', 'ObjectTypeAzureWorkloadRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaRecoveryPoint', 'ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSQLRecoveryPoint', 'ObjectTypeGenericRecoveryPoint', 'ObjectTypeIaasVMRecoveryPoint' ObjectType ObjectTypeBasicRecoveryPoint `json:"objectType,omitempty"` } @@ -6486,6 +8107,21 @@ func (awrp AzureWorkloadRecoveryPoint) AsBasicAzureWorkloadRecoveryPoint() (Basi return &awrp, true } +// AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. +func (awrp AzureWorkloadRecoveryPoint) AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadSAPHanaRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. +func (awrp AzureWorkloadRecoveryPoint) AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSAPHanaRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. +func (awrp AzureWorkloadRecoveryPoint) AsBasicAzureWorkloadSAPHanaRecoveryPoint() (BasicAzureWorkloadSAPHanaRecoveryPoint, bool) { + return nil, false +} + // AsAzureWorkloadSQLPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. func (awrp AzureWorkloadRecoveryPoint) AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) { return nil, false @@ -6537,7 +8173,7 @@ type AzureWorkloadRestoreRequest struct { SourceResourceID *string `json:"sourceResourceId,omitempty"` // PropertyBag - Workload specific property bag. PropertyBag map[string]*string `json:"propertyBag"` - // ObjectType - Possible values include: 'ObjectTypeRestoreRequest', 'ObjectTypeAzureFileShareRestoreRequest', 'ObjectTypeAzureWorkloadRestoreRequest', 'ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSQLRestoreRequest', 'ObjectTypeIaasVMRestoreRequest' + // ObjectType - Possible values include: 'ObjectTypeRestoreRequest', 'ObjectTypeAzureFileShareRestoreRequest', 'ObjectTypeAzureWorkloadRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaRestoreRequest', 'ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSQLRestoreRequest', 'ObjectTypeIaasVMRestoreRequest' ObjectType ObjectTypeBasicRestoreRequest `json:"objectType,omitempty"` } @@ -6616,6 +8252,21 @@ func (awrr AzureWorkloadRestoreRequest) AsBasicAzureWorkloadRestoreRequest() (Ba return &awrr, true } +// AsAzureWorkloadSAPHanaPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. +func (awrr AzureWorkloadRestoreRequest) AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. +func (awrr AzureWorkloadRestoreRequest) AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. +func (awrr AzureWorkloadRestoreRequest) AsBasicAzureWorkloadSAPHanaRestoreRequest() (BasicAzureWorkloadSAPHanaRestoreRequest, bool) { + return nil, false +} + // AsAzureWorkloadSQLPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. func (awrr AzureWorkloadRestoreRequest) AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) { return nil, false @@ -6646,6 +8297,565 @@ func (awrr AzureWorkloadRestoreRequest) AsBasicRestoreRequest() (BasicRestoreReq return &awrr, true } +// AzureWorkloadSAPHanaPointInTimeRecoveryPoint recovery point specific to PointInTime in SAPHana +type AzureWorkloadSAPHanaPointInTimeRecoveryPoint struct { + // TimeRanges - List of log ranges + TimeRanges *[]PointInTimeRange `json:"timeRanges,omitempty"` + // RecoveryPointTimeInUTC - UTC time at which recoverypoint was created + RecoveryPointTimeInUTC *date.Time `json:"recoveryPointTimeInUTC,omitempty"` + // Type - Type of restore point. Possible values include: 'RestorePointTypeInvalid', 'RestorePointTypeFull', 'RestorePointTypeLog', 'RestorePointTypeDifferential' + Type RestorePointType `json:"type,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeRecoveryPoint', 'ObjectTypeAzureFileShareRecoveryPoint', 'ObjectTypeAzureWorkloadRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaRecoveryPoint', 'ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSQLRecoveryPoint', 'ObjectTypeGenericRecoveryPoint', 'ObjectTypeIaasVMRecoveryPoint' + ObjectType ObjectTypeBasicRecoveryPoint `json:"objectType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. +func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) MarshalJSON() ([]byte, error) { + awshpitrp.ObjectType = ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint + objectMap := make(map[string]interface{}) + if awshpitrp.TimeRanges != nil { + objectMap["timeRanges"] = awshpitrp.TimeRanges + } + if awshpitrp.RecoveryPointTimeInUTC != nil { + objectMap["recoveryPointTimeInUTC"] = awshpitrp.RecoveryPointTimeInUTC + } + if awshpitrp.Type != "" { + objectMap["type"] = awshpitrp.Type + } + if awshpitrp.ObjectType != "" { + objectMap["objectType"] = awshpitrp.ObjectType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. +func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsAzureFileShareRecoveryPoint() (*AzureFileShareRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. +func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsAzureWorkloadRecoveryPoint() (*AzureWorkloadRecoveryPoint, bool) { + return nil, false +} + +// AsBasicAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. +func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsBasicAzureWorkloadRecoveryPoint() (BasicAzureWorkloadRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. +func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) { + return &awshpitrp, true +} + +// AsAzureWorkloadSAPHanaRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. +func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSAPHanaRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. +func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsBasicAzureWorkloadSAPHanaRecoveryPoint() (BasicAzureWorkloadSAPHanaRecoveryPoint, bool) { + return &awshpitrp, true +} + +// AsAzureWorkloadSQLPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. +func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. +func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. +func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsBasicAzureWorkloadSQLRecoveryPoint() (BasicAzureWorkloadSQLRecoveryPoint, bool) { + return nil, false +} + +// AsGenericRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. +func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsGenericRecoveryPoint() (*GenericRecoveryPoint, bool) { + return nil, false +} + +// AsIaasVMRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. +func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsIaasVMRecoveryPoint() (*IaasVMRecoveryPoint, bool) { + return nil, false +} + +// AsRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. +func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsRecoveryPoint() (*RecoveryPoint, bool) { + return nil, false +} + +// AsBasicRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. +func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsBasicRecoveryPoint() (BasicRecoveryPoint, bool) { + return &awshpitrp, true +} + +// AzureWorkloadSAPHanaPointInTimeRestoreRequest azureWorkload SAP Hana -specific restore. Specifically for +// PointInTime/Log restore +type AzureWorkloadSAPHanaPointInTimeRestoreRequest struct { + // PointInTime - PointInTime value + PointInTime *date.Time `json:"pointInTime,omitempty"` + // TargetInfo - Details of target database + TargetInfo *TargetRestoreInfo `json:"targetInfo,omitempty"` + // RecoveryType - OLR/ALR, RestoreDisks is invalid option. Possible values include: 'RecoveryTypeInvalid', 'RecoveryTypeOriginalLocation', 'RecoveryTypeAlternateLocation', 'RecoveryTypeRestoreDisks' + RecoveryType RecoveryType `json:"recoveryType,omitempty"` + // SourceResourceID - Fully qualified ARM ID of the VM on which workload that was running is being recovered. + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // PropertyBag - Workload specific property bag. + PropertyBag map[string]*string `json:"propertyBag"` + // ObjectType - Possible values include: 'ObjectTypeRestoreRequest', 'ObjectTypeAzureFileShareRestoreRequest', 'ObjectTypeAzureWorkloadRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaRestoreRequest', 'ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSQLRestoreRequest', 'ObjectTypeIaasVMRestoreRequest' + ObjectType ObjectTypeBasicRestoreRequest `json:"objectType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureWorkloadSAPHanaPointInTimeRestoreRequest. +func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) MarshalJSON() ([]byte, error) { + awshpitrr.ObjectType = ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest + objectMap := make(map[string]interface{}) + if awshpitrr.PointInTime != nil { + objectMap["pointInTime"] = awshpitrr.PointInTime + } + if awshpitrr.TargetInfo != nil { + objectMap["targetInfo"] = awshpitrr.TargetInfo + } + if awshpitrr.RecoveryType != "" { + objectMap["recoveryType"] = awshpitrr.RecoveryType + } + if awshpitrr.SourceResourceID != nil { + objectMap["sourceResourceId"] = awshpitrr.SourceResourceID + } + if awshpitrr.PropertyBag != nil { + objectMap["propertyBag"] = awshpitrr.PropertyBag + } + if awshpitrr.ObjectType != "" { + objectMap["objectType"] = awshpitrr.ObjectType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. +func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsAzureFileShareRestoreRequest() (*AzureFileShareRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. +func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsAzureWorkloadRestoreRequest() (*AzureWorkloadRestoreRequest, bool) { + return nil, false +} + +// AsBasicAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. +func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsBasicAzureWorkloadRestoreRequest() (BasicAzureWorkloadRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSAPHanaPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. +func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) { + return &awshpitrr, true +} + +// AsAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. +func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. +func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsBasicAzureWorkloadSAPHanaRestoreRequest() (BasicAzureWorkloadSAPHanaRestoreRequest, bool) { + return &awshpitrr, true +} + +// AsAzureWorkloadSQLPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. +func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. +func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsAzureWorkloadSQLRestoreRequest() (*AzureWorkloadSQLRestoreRequest, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. +func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsBasicAzureWorkloadSQLRestoreRequest() (BasicAzureWorkloadSQLRestoreRequest, bool) { + return nil, false +} + +// AsIaasVMRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. +func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsIaasVMRestoreRequest() (*IaasVMRestoreRequest, bool) { + return nil, false +} + +// AsRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. +func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsRestoreRequest() (*RestoreRequest, bool) { + return nil, false +} + +// AsBasicRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. +func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsBasicRestoreRequest() (BasicRestoreRequest, bool) { + return &awshpitrr, true +} + +// BasicAzureWorkloadSAPHanaRecoveryPoint sAPHana specific recoverypoint, specifcally encaspulates full/diff +// recoverypoints +type BasicAzureWorkloadSAPHanaRecoveryPoint interface { + AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) + AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) +} + +// AzureWorkloadSAPHanaRecoveryPoint sAPHana specific recoverypoint, specifcally encaspulates full/diff +// recoverypoints +type AzureWorkloadSAPHanaRecoveryPoint struct { + // RecoveryPointTimeInUTC - UTC time at which recoverypoint was created + RecoveryPointTimeInUTC *date.Time `json:"recoveryPointTimeInUTC,omitempty"` + // Type - Type of restore point. Possible values include: 'RestorePointTypeInvalid', 'RestorePointTypeFull', 'RestorePointTypeLog', 'RestorePointTypeDifferential' + Type RestorePointType `json:"type,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeRecoveryPoint', 'ObjectTypeAzureFileShareRecoveryPoint', 'ObjectTypeAzureWorkloadRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaRecoveryPoint', 'ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSQLRecoveryPoint', 'ObjectTypeGenericRecoveryPoint', 'ObjectTypeIaasVMRecoveryPoint' + ObjectType ObjectTypeBasicRecoveryPoint `json:"objectType,omitempty"` +} + +func unmarshalBasicAzureWorkloadSAPHanaRecoveryPoint(body []byte) (BasicAzureWorkloadSAPHanaRecoveryPoint, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["objectType"] { + case string(ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint): + var awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint + err := json.Unmarshal(body, &awshpitrp) + return awshpitrp, err + default: + var awshrp AzureWorkloadSAPHanaRecoveryPoint + err := json.Unmarshal(body, &awshrp) + return awshrp, err + } +} +func unmarshalBasicAzureWorkloadSAPHanaRecoveryPointArray(body []byte) ([]BasicAzureWorkloadSAPHanaRecoveryPoint, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + awshrpArray := make([]BasicAzureWorkloadSAPHanaRecoveryPoint, len(rawMessages)) + + for index, rawMessage := range rawMessages { + awshrp, err := unmarshalBasicAzureWorkloadSAPHanaRecoveryPoint(*rawMessage) + if err != nil { + return nil, err + } + awshrpArray[index] = awshrp + } + return awshrpArray, nil +} + +// MarshalJSON is the custom marshaler for AzureWorkloadSAPHanaRecoveryPoint. +func (awshrp AzureWorkloadSAPHanaRecoveryPoint) MarshalJSON() ([]byte, error) { + awshrp.ObjectType = ObjectTypeAzureWorkloadSAPHanaRecoveryPoint + objectMap := make(map[string]interface{}) + if awshrp.RecoveryPointTimeInUTC != nil { + objectMap["recoveryPointTimeInUTC"] = awshrp.RecoveryPointTimeInUTC + } + if awshrp.Type != "" { + objectMap["type"] = awshrp.Type + } + if awshrp.ObjectType != "" { + objectMap["objectType"] = awshrp.ObjectType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. +func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsAzureFileShareRecoveryPoint() (*AzureFileShareRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. +func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsAzureWorkloadRecoveryPoint() (*AzureWorkloadRecoveryPoint, bool) { + return nil, false +} + +// AsBasicAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. +func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsBasicAzureWorkloadRecoveryPoint() (BasicAzureWorkloadRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. +func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadSAPHanaRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. +func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) { + return &awshrp, true +} + +// AsBasicAzureWorkloadSAPHanaRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. +func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsBasicAzureWorkloadSAPHanaRecoveryPoint() (BasicAzureWorkloadSAPHanaRecoveryPoint, bool) { + return &awshrp, true +} + +// AsAzureWorkloadSQLPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. +func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. +func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. +func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsBasicAzureWorkloadSQLRecoveryPoint() (BasicAzureWorkloadSQLRecoveryPoint, bool) { + return nil, false +} + +// AsGenericRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. +func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsGenericRecoveryPoint() (*GenericRecoveryPoint, bool) { + return nil, false +} + +// AsIaasVMRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. +func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsIaasVMRecoveryPoint() (*IaasVMRecoveryPoint, bool) { + return nil, false +} + +// AsRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. +func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsRecoveryPoint() (*RecoveryPoint, bool) { + return nil, false +} + +// AsBasicRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. +func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsBasicRecoveryPoint() (BasicRecoveryPoint, bool) { + return &awshrp, true +} + +// BasicAzureWorkloadSAPHanaRestoreRequest azureWorkload SAP Hana-specific restore. +type BasicAzureWorkloadSAPHanaRestoreRequest interface { + AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) + AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) +} + +// AzureWorkloadSAPHanaRestoreRequest azureWorkload SAP Hana-specific restore. +type AzureWorkloadSAPHanaRestoreRequest struct { + // TargetInfo - Details of target database + TargetInfo *TargetRestoreInfo `json:"targetInfo,omitempty"` + // RecoveryType - OLR/ALR, RestoreDisks is invalid option. Possible values include: 'RecoveryTypeInvalid', 'RecoveryTypeOriginalLocation', 'RecoveryTypeAlternateLocation', 'RecoveryTypeRestoreDisks' + RecoveryType RecoveryType `json:"recoveryType,omitempty"` + // SourceResourceID - Fully qualified ARM ID of the VM on which workload that was running is being recovered. + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // PropertyBag - Workload specific property bag. + PropertyBag map[string]*string `json:"propertyBag"` + // ObjectType - Possible values include: 'ObjectTypeRestoreRequest', 'ObjectTypeAzureFileShareRestoreRequest', 'ObjectTypeAzureWorkloadRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaRestoreRequest', 'ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSQLRestoreRequest', 'ObjectTypeIaasVMRestoreRequest' + ObjectType ObjectTypeBasicRestoreRequest `json:"objectType,omitempty"` +} + +func unmarshalBasicAzureWorkloadSAPHanaRestoreRequest(body []byte) (BasicAzureWorkloadSAPHanaRestoreRequest, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["objectType"] { + case string(ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest): + var awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest + err := json.Unmarshal(body, &awshpitrr) + return awshpitrr, err + default: + var awshrr AzureWorkloadSAPHanaRestoreRequest + err := json.Unmarshal(body, &awshrr) + return awshrr, err + } +} +func unmarshalBasicAzureWorkloadSAPHanaRestoreRequestArray(body []byte) ([]BasicAzureWorkloadSAPHanaRestoreRequest, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + awshrrArray := make([]BasicAzureWorkloadSAPHanaRestoreRequest, len(rawMessages)) + + for index, rawMessage := range rawMessages { + awshrr, err := unmarshalBasicAzureWorkloadSAPHanaRestoreRequest(*rawMessage) + if err != nil { + return nil, err + } + awshrrArray[index] = awshrr + } + return awshrrArray, nil +} + +// MarshalJSON is the custom marshaler for AzureWorkloadSAPHanaRestoreRequest. +func (awshrr AzureWorkloadSAPHanaRestoreRequest) MarshalJSON() ([]byte, error) { + awshrr.ObjectType = ObjectTypeAzureWorkloadSAPHanaRestoreRequest + objectMap := make(map[string]interface{}) + if awshrr.TargetInfo != nil { + objectMap["targetInfo"] = awshrr.TargetInfo + } + if awshrr.RecoveryType != "" { + objectMap["recoveryType"] = awshrr.RecoveryType + } + if awshrr.SourceResourceID != nil { + objectMap["sourceResourceId"] = awshrr.SourceResourceID + } + if awshrr.PropertyBag != nil { + objectMap["propertyBag"] = awshrr.PropertyBag + } + if awshrr.ObjectType != "" { + objectMap["objectType"] = awshrr.ObjectType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. +func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsAzureFileShareRestoreRequest() (*AzureFileShareRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. +func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsAzureWorkloadRestoreRequest() (*AzureWorkloadRestoreRequest, bool) { + return nil, false +} + +// AsBasicAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. +func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsBasicAzureWorkloadRestoreRequest() (BasicAzureWorkloadRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSAPHanaPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. +func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. +func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) { + return &awshrr, true +} + +// AsBasicAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. +func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsBasicAzureWorkloadSAPHanaRestoreRequest() (BasicAzureWorkloadSAPHanaRestoreRequest, bool) { + return &awshrr, true +} + +// AsAzureWorkloadSQLPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. +func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. +func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsAzureWorkloadSQLRestoreRequest() (*AzureWorkloadSQLRestoreRequest, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. +func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsBasicAzureWorkloadSQLRestoreRequest() (BasicAzureWorkloadSQLRestoreRequest, bool) { + return nil, false +} + +// AsIaasVMRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. +func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsIaasVMRestoreRequest() (*IaasVMRestoreRequest, bool) { + return nil, false +} + +// AsRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. +func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsRestoreRequest() (*RestoreRequest, bool) { + return nil, false +} + +// AsBasicRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. +func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsBasicRestoreRequest() (BasicRestoreRequest, bool) { + return &awshrr, true +} + +// AzureWorkloadSQLAutoProtectionIntent azure Workload SQL Auto Protection intent item. +type AzureWorkloadSQLAutoProtectionIntent struct { + // WorkloadItemType - Workload item type of the item for which intent is to be set. Possible values include: 'WorkloadItemTypeInvalid', 'WorkloadItemTypeSQLInstance', 'WorkloadItemTypeSQLDataBase', 'WorkloadItemTypeSAPHanaSystem', 'WorkloadItemTypeSAPHanaDatabase' + WorkloadItemType WorkloadItemType `json:"workloadItemType,omitempty"` + // BackupManagementType - Type of backup managemenent for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // SourceResourceID - ARM ID of the resource to be backed up. + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // ItemID - ID of the item which is getting protected, In case of Azure Vm , it is ProtectedItemId + ItemID *string `json:"itemId,omitempty"` + // PolicyID - ID of the backup policy with which this item is backed up. + PolicyID *string `json:"policyId,omitempty"` + // ProtectionState - Backup state of this backup item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' + ProtectionState ProtectionStatus `json:"protectionState,omitempty"` + // ProtectionIntentItemType - Possible values include: 'ProtectionIntentItemTypeProtectionIntent', 'ProtectionIntentItemTypeRecoveryServiceVaultItem', 'ProtectionIntentItemTypeAzureResourceItem', 'ProtectionIntentItemTypeAzureWorkloadAutoProtectionIntent', 'ProtectionIntentItemTypeAzureWorkloadSQLAutoProtectionIntent' + ProtectionIntentItemType ProtectionIntentItemType `json:"protectionIntentItemType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureWorkloadSQLAutoProtectionIntent. +func (awsapi AzureWorkloadSQLAutoProtectionIntent) MarshalJSON() ([]byte, error) { + awsapi.ProtectionIntentItemType = ProtectionIntentItemTypeAzureWorkloadSQLAutoProtectionIntent + objectMap := make(map[string]interface{}) + if awsapi.WorkloadItemType != "" { + objectMap["workloadItemType"] = awsapi.WorkloadItemType + } + if awsapi.BackupManagementType != "" { + objectMap["backupManagementType"] = awsapi.BackupManagementType + } + if awsapi.SourceResourceID != nil { + objectMap["sourceResourceId"] = awsapi.SourceResourceID + } + if awsapi.ItemID != nil { + objectMap["itemId"] = awsapi.ItemID + } + if awsapi.PolicyID != nil { + objectMap["policyId"] = awsapi.PolicyID + } + if awsapi.ProtectionState != "" { + objectMap["protectionState"] = awsapi.ProtectionState + } + if awsapi.ProtectionIntentItemType != "" { + objectMap["protectionIntentItemType"] = awsapi.ProtectionIntentItemType + } + return json.Marshal(objectMap) +} + +// AsAzureRecoveryServiceVaultProtectionIntent is the BasicProtectionIntent implementation for AzureWorkloadSQLAutoProtectionIntent. +func (awsapi AzureWorkloadSQLAutoProtectionIntent) AsAzureRecoveryServiceVaultProtectionIntent() (*AzureRecoveryServiceVaultProtectionIntent, bool) { + return nil, false +} + +// AsBasicAzureRecoveryServiceVaultProtectionIntent is the BasicProtectionIntent implementation for AzureWorkloadSQLAutoProtectionIntent. +func (awsapi AzureWorkloadSQLAutoProtectionIntent) AsBasicAzureRecoveryServiceVaultProtectionIntent() (BasicAzureRecoveryServiceVaultProtectionIntent, bool) { + return &awsapi, true +} + +// AsAzureResourceProtectionIntent is the BasicProtectionIntent implementation for AzureWorkloadSQLAutoProtectionIntent. +func (awsapi AzureWorkloadSQLAutoProtectionIntent) AsAzureResourceProtectionIntent() (*AzureResourceProtectionIntent, bool) { + return nil, false +} + +// AsAzureWorkloadAutoProtectionIntent is the BasicProtectionIntent implementation for AzureWorkloadSQLAutoProtectionIntent. +func (awsapi AzureWorkloadSQLAutoProtectionIntent) AsAzureWorkloadAutoProtectionIntent() (*AzureWorkloadAutoProtectionIntent, bool) { + return nil, false +} + +// AsBasicAzureWorkloadAutoProtectionIntent is the BasicProtectionIntent implementation for AzureWorkloadSQLAutoProtectionIntent. +func (awsapi AzureWorkloadSQLAutoProtectionIntent) AsBasicAzureWorkloadAutoProtectionIntent() (BasicAzureWorkloadAutoProtectionIntent, bool) { + return &awsapi, true +} + +// AsAzureWorkloadSQLAutoProtectionIntent is the BasicProtectionIntent implementation for AzureWorkloadSQLAutoProtectionIntent. +func (awsapi AzureWorkloadSQLAutoProtectionIntent) AsAzureWorkloadSQLAutoProtectionIntent() (*AzureWorkloadSQLAutoProtectionIntent, bool) { + return &awsapi, true +} + +// AsProtectionIntent is the BasicProtectionIntent implementation for AzureWorkloadSQLAutoProtectionIntent. +func (awsapi AzureWorkloadSQLAutoProtectionIntent) AsProtectionIntent() (*ProtectionIntent, bool) { + return nil, false +} + +// AsBasicProtectionIntent is the BasicProtectionIntent implementation for AzureWorkloadSQLAutoProtectionIntent. +func (awsapi AzureWorkloadSQLAutoProtectionIntent) AsBasicProtectionIntent() (BasicProtectionIntent, bool) { + return &awsapi, true +} + // AzureWorkloadSQLPointInTimeRecoveryPoint recovery point specific to PointInTime type AzureWorkloadSQLPointInTimeRecoveryPoint struct { // TimeRanges - List of log ranges @@ -6658,7 +8868,7 @@ type AzureWorkloadSQLPointInTimeRecoveryPoint struct { RecoveryPointTimeInUTC *date.Time `json:"recoveryPointTimeInUTC,omitempty"` // Type - Type of restore point. Possible values include: 'RestorePointTypeInvalid', 'RestorePointTypeFull', 'RestorePointTypeLog', 'RestorePointTypeDifferential' Type RestorePointType `json:"type,omitempty"` - // ObjectType - Possible values include: 'ObjectTypeRecoveryPoint', 'ObjectTypeAzureFileShareRecoveryPoint', 'ObjectTypeAzureWorkloadRecoveryPoint', 'ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSQLRecoveryPoint', 'ObjectTypeGenericRecoveryPoint', 'ObjectTypeIaasVMRecoveryPoint' + // ObjectType - Possible values include: 'ObjectTypeRecoveryPoint', 'ObjectTypeAzureFileShareRecoveryPoint', 'ObjectTypeAzureWorkloadRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaRecoveryPoint', 'ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSQLRecoveryPoint', 'ObjectTypeGenericRecoveryPoint', 'ObjectTypeIaasVMRecoveryPoint' ObjectType ObjectTypeBasicRecoveryPoint `json:"objectType,omitempty"` } @@ -6699,6 +8909,21 @@ func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsBasicAzureWorkloadRec return &awspitrp, true } +// AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. +func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadSAPHanaRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. +func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSAPHanaRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. +func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsBasicAzureWorkloadSAPHanaRecoveryPoint() (BasicAzureWorkloadSAPHanaRecoveryPoint, bool) { + return nil, false +} + // AsAzureWorkloadSQLPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) { return &awspitrp, true @@ -6753,7 +8978,7 @@ type AzureWorkloadSQLPointInTimeRestoreRequest struct { SourceResourceID *string `json:"sourceResourceId,omitempty"` // PropertyBag - Workload specific property bag. PropertyBag map[string]*string `json:"propertyBag"` - // ObjectType - Possible values include: 'ObjectTypeRestoreRequest', 'ObjectTypeAzureFileShareRestoreRequest', 'ObjectTypeAzureWorkloadRestoreRequest', 'ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSQLRestoreRequest', 'ObjectTypeIaasVMRestoreRequest' + // ObjectType - Possible values include: 'ObjectTypeRestoreRequest', 'ObjectTypeAzureFileShareRestoreRequest', 'ObjectTypeAzureWorkloadRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaRestoreRequest', 'ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSQLRestoreRequest', 'ObjectTypeIaasVMRestoreRequest' ObjectType ObjectTypeBasicRestoreRequest `json:"objectType,omitempty"` } @@ -6806,6 +9031,21 @@ func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsBasicAzureWorkloadRe return &awspitrr, true } +// AsAzureWorkloadSAPHanaPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. +func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. +func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. +func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsBasicAzureWorkloadSAPHanaRestoreRequest() (BasicAzureWorkloadSAPHanaRestoreRequest, bool) { + return nil, false +} + // AsAzureWorkloadSQLPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) { return &awspitrr, true @@ -6854,7 +9094,7 @@ type AzureWorkloadSQLRecoveryPoint struct { RecoveryPointTimeInUTC *date.Time `json:"recoveryPointTimeInUTC,omitempty"` // Type - Type of restore point. Possible values include: 'RestorePointTypeInvalid', 'RestorePointTypeFull', 'RestorePointTypeLog', 'RestorePointTypeDifferential' Type RestorePointType `json:"type,omitempty"` - // ObjectType - Possible values include: 'ObjectTypeRecoveryPoint', 'ObjectTypeAzureFileShareRecoveryPoint', 'ObjectTypeAzureWorkloadRecoveryPoint', 'ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSQLRecoveryPoint', 'ObjectTypeGenericRecoveryPoint', 'ObjectTypeIaasVMRecoveryPoint' + // ObjectType - Possible values include: 'ObjectTypeRecoveryPoint', 'ObjectTypeAzureFileShareRecoveryPoint', 'ObjectTypeAzureWorkloadRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaRecoveryPoint', 'ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSQLRecoveryPoint', 'ObjectTypeGenericRecoveryPoint', 'ObjectTypeIaasVMRecoveryPoint' ObjectType ObjectTypeBasicRecoveryPoint `json:"objectType,omitempty"` } @@ -6929,6 +9169,21 @@ func (awsrp AzureWorkloadSQLRecoveryPoint) AsBasicAzureWorkloadRecoveryPoint() ( return &awsrp, true } +// AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. +func (awsrp AzureWorkloadSQLRecoveryPoint) AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadSAPHanaRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. +func (awsrp AzureWorkloadSQLRecoveryPoint) AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSAPHanaRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. +func (awsrp AzureWorkloadSQLRecoveryPoint) AsBasicAzureWorkloadSAPHanaRecoveryPoint() (BasicAzureWorkloadSAPHanaRecoveryPoint, bool) { + return nil, false +} + // AsAzureWorkloadSQLPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. func (awsrp AzureWorkloadSQLRecoveryPoint) AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) { return nil, false @@ -6994,7 +9249,7 @@ type AzureWorkloadSQLRestoreRequest struct { SourceResourceID *string `json:"sourceResourceId,omitempty"` // PropertyBag - Workload specific property bag. PropertyBag map[string]*string `json:"propertyBag"` - // ObjectType - Possible values include: 'ObjectTypeRestoreRequest', 'ObjectTypeAzureFileShareRestoreRequest', 'ObjectTypeAzureWorkloadRestoreRequest', 'ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSQLRestoreRequest', 'ObjectTypeIaasVMRestoreRequest' + // ObjectType - Possible values include: 'ObjectTypeRestoreRequest', 'ObjectTypeAzureFileShareRestoreRequest', 'ObjectTypeAzureWorkloadRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaRestoreRequest', 'ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSQLRestoreRequest', 'ObjectTypeIaasVMRestoreRequest' ObjectType ObjectTypeBasicRestoreRequest `json:"objectType,omitempty"` } @@ -7081,6 +9336,21 @@ func (awsrr AzureWorkloadSQLRestoreRequest) AsBasicAzureWorkloadRestoreRequest() return &awsrr, true } +// AsAzureWorkloadSAPHanaPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. +func (awsrr AzureWorkloadSQLRestoreRequest) AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. +func (awsrr AzureWorkloadSQLRestoreRequest) AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. +func (awsrr AzureWorkloadSQLRestoreRequest) AsBasicAzureWorkloadSAPHanaRestoreRequest() (BasicAzureWorkloadSAPHanaRestoreRequest, bool) { + return nil, false +} + // AsAzureWorkloadSQLPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. func (awsrr AzureWorkloadSQLRestoreRequest) AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) { return nil, false @@ -7147,7 +9417,7 @@ type BMSBackupSummariesQueryObject struct { type BMSContainerQueryObject struct { // BackupManagementType - Backup management type for this container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // ContainerType - Type of container for filter. Possible values include: 'ContainerTypeInvalid', 'ContainerTypeUnknown', 'ContainerTypeIaasVMContainer', 'ContainerTypeIaasVMServiceContainer', 'ContainerTypeDPMContainer', 'ContainerTypeAzureBackupServerContainer', 'ContainerTypeMABContainer', 'ContainerTypeCluster', 'ContainerTypeAzureSQLContainer', 'ContainerTypeWindows', 'ContainerTypeVCenter', 'ContainerTypeVMAppContainer', 'ContainerTypeSQLAGWorkLoadContainer', 'ContainerTypeStorageContainer', 'ContainerTypeGenericContainer' + // ContainerType - Type of container for filter. Possible values include: 'ContainerTypeInvalid', 'ContainerTypeUnknown', 'ContainerTypeIaasVMContainer', 'ContainerTypeIaasVMServiceContainer', 'ContainerTypeDPMContainer', 'ContainerTypeAzureBackupServerContainer', 'ContainerTypeMABContainer', 'ContainerTypeCluster', 'ContainerTypeAzureSQLContainer', 'ContainerTypeWindows', 'ContainerTypeVCenter', 'ContainerTypeVMAppContainer', 'ContainerTypeSQLAGWorkLoadContainer', 'ContainerTypeStorageContainer', 'ContainerTypeGenericContainer', 'ContainerTypeSQLCluster', 'ContainerTypeExchangeDAG', 'ContainerTypeSharepointFarm', 'ContainerTypeHyperVCluster', 'ContainerTypeWindowsClient' ContainerType ContainerType `json:"containerType,omitempty"` // BackupEngineName - Backup engine name BackupEngineName *string `json:"backupEngineName,omitempty"` @@ -7159,11 +9429,19 @@ type BMSContainerQueryObject struct { FriendlyName *string `json:"friendlyName,omitempty"` } +// BMSContainersInquiryQueryObject the query filters that can be used with the inquire container API. +type BMSContainersInquiryQueryObject struct { + // BackupManagementType - Backup management type for this container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // WorkloadType - Workload type for this container. Possible values include: 'WorkloadTypeInvalid', 'WorkloadTypeVM', 'WorkloadTypeFileFolder', 'WorkloadTypeAzureSQLDb', 'WorkloadTypeSQLDB', 'WorkloadTypeExchange', 'WorkloadTypeSharepoint', 'WorkloadTypeVMwareVM', 'WorkloadTypeSystemState', 'WorkloadTypeClient', 'WorkloadTypeGenericDataSource', 'WorkloadTypeSQLDataBase', 'WorkloadTypeAzureFileShare', 'WorkloadTypeSAPHanaDatabase' + WorkloadType WorkloadType `json:"workloadType,omitempty"` +} + // BMSPOQueryObject filters to list items that can be backed up. type BMSPOQueryObject struct { // BackupManagementType - Backup management type. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // WorkloadType - Workload type. Possible values include: 'WorkloadTypeInvalid', 'WorkloadTypeVM', 'WorkloadTypeFileFolder', 'WorkloadTypeAzureSQLDb', 'WorkloadTypeSQLDB', 'WorkloadTypeExchange', 'WorkloadTypeSharepoint', 'WorkloadTypeVMwareVM', 'WorkloadTypeSystemState', 'WorkloadTypeClient', 'WorkloadTypeGenericDataSource', 'WorkloadTypeSQLDataBase', 'WorkloadTypeAzureFileShare' + // WorkloadType - Workload type. Possible values include: 'WorkloadTypeInvalid', 'WorkloadTypeVM', 'WorkloadTypeFileFolder', 'WorkloadTypeAzureSQLDb', 'WorkloadTypeSQLDB', 'WorkloadTypeExchange', 'WorkloadTypeSharepoint', 'WorkloadTypeVMwareVM', 'WorkloadTypeSystemState', 'WorkloadTypeClient', 'WorkloadTypeGenericDataSource', 'WorkloadTypeSQLDataBase', 'WorkloadTypeAzureFileShare', 'WorkloadTypeSAPHanaDatabase' WorkloadType WorkloadType `json:"workloadType,omitempty"` // ContainerName - Full name of the container whose Protectable Objects should be returned. ContainerName *string `json:"containerName,omitempty"` @@ -7173,7 +9451,7 @@ type BMSPOQueryObject struct { FriendlyName *string `json:"friendlyName,omitempty"` } -// BMSRefreshContainersQueryObject the query filters that can be used with the list containers API. +// BMSRefreshContainersQueryObject the query filters that can be used with the refresh container API. type BMSRefreshContainersQueryObject struct { // BackupManagementType - Backup management type for this container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' BackupManagementType ManagementType `json:"backupManagementType,omitempty"` @@ -7195,9 +9473,9 @@ type BMSRPQueryObject struct { type BMSWorkloadItemQueryObject struct { // BackupManagementType - Backup management type. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // WorkloadItemType - Workload Item type. Possible values include: 'WorkloadItemTypeInvalid', 'WorkloadItemTypeSQLInstance', 'WorkloadItemTypeSQLDataBase' + // WorkloadItemType - Workload Item type. Possible values include: 'WorkloadItemTypeInvalid', 'WorkloadItemTypeSQLInstance', 'WorkloadItemTypeSQLDataBase', 'WorkloadItemTypeSAPHanaSystem', 'WorkloadItemTypeSAPHanaDatabase' WorkloadItemType WorkloadItemType `json:"workloadItemType,omitempty"` - // WorkloadType - Workload type. Possible values include: 'WorkloadTypeInvalid', 'WorkloadTypeVM', 'WorkloadTypeFileFolder', 'WorkloadTypeAzureSQLDb', 'WorkloadTypeSQLDB', 'WorkloadTypeExchange', 'WorkloadTypeSharepoint', 'WorkloadTypeVMwareVM', 'WorkloadTypeSystemState', 'WorkloadTypeClient', 'WorkloadTypeGenericDataSource', 'WorkloadTypeSQLDataBase', 'WorkloadTypeAzureFileShare' + // WorkloadType - Workload type. Possible values include: 'WorkloadTypeInvalid', 'WorkloadTypeVM', 'WorkloadTypeFileFolder', 'WorkloadTypeAzureSQLDb', 'WorkloadTypeSQLDB', 'WorkloadTypeExchange', 'WorkloadTypeSharepoint', 'WorkloadTypeVMwareVM', 'WorkloadTypeSystemState', 'WorkloadTypeClient', 'WorkloadTypeGenericDataSource', 'WorkloadTypeSQLDataBase', 'WorkloadTypeAzureFileShare', 'WorkloadTypeSAPHanaDatabase' WorkloadType WorkloadType `json:"workloadType,omitempty"` // ProtectionStatus - Backup status query parameter. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' ProtectionStatus ProtectionStatus `json:"protectionStatus,omitempty"` @@ -7535,7 +9813,7 @@ type DpmContainer struct { RegistrationStatus *string `json:"registrationStatus,omitempty"` // HealthStatus - Status of health of the container. HealthStatus *string `json:"healthStatus,omitempty"` - // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaaSVMContainer', 'ContainerTypeMABWindowsContainer' + // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaaSVMContainer', 'ContainerTypeWindows1' ContainerType ContainerTypeBasicProtectionContainer `json:"containerType,omitempty"` } @@ -7858,7 +10136,7 @@ type DPMProtectedItem struct { ExtendedInfo *DPMProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` // BackupManagementType - Type of backup managemenent for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare' + // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase' WorkloadType DataSourceType `json:"workloadType,omitempty"` // ContainerName - Unique name of container ContainerName *string `json:"containerName,omitempty"` @@ -7870,7 +10148,9 @@ type DPMProtectedItem struct { LastRecoveryPoint *date.Time `json:"lastRecoveryPoint,omitempty"` // BackupSetName - Name of the backup set the backup item belongs to BackupSetName *string `json:"backupSetName,omitempty"` - // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' + // CreateMode - Create mode to indicate recovery of existing soft deleted data source or creation of new data source. Possible values include: 'CreateModeInvalid', 'CreateModeDefault', 'CreateModeRecover' + CreateMode CreateMode `json:"createMode,omitempty"` + // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` } @@ -7914,6 +10194,9 @@ func (dpi DPMProtectedItem) MarshalJSON() ([]byte, error) { if dpi.BackupSetName != nil { objectMap["backupSetName"] = dpi.BackupSetName } + if dpi.CreateMode != "" { + objectMap["createMode"] = dpi.CreateMode + } if dpi.ProtectedItemType != "" { objectMap["protectedItemType"] = dpi.ProtectedItemType } @@ -7950,6 +10233,21 @@ func (dpi DPMProtectedItem) AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, b return nil, false } +// AsAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. +func (dpi DPMProtectedItem) AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) { + return nil, false +} + +// AsBasicAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. +func (dpi DPMProtectedItem) AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaDatabaseProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. +func (dpi DPMProtectedItem) AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) { + return nil, false +} + // AsAzureVMWorkloadSQLDatabaseProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. func (dpi DPMProtectedItem) AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) { return nil, false @@ -8519,13 +10817,14 @@ func (ejori ExportJobsOperationResultInfo) AsBasicOperationResultInfoBase() (Bas // BasicFeatureSupportRequest base class for feature request type BasicFeatureSupportRequest interface { + AsAzureBackupGoalFeatureSupportRequest() (*AzureBackupGoalFeatureSupportRequest, bool) AsAzureVMResourceFeatureSupportRequest() (*AzureVMResourceFeatureSupportRequest, bool) AsFeatureSupportRequest() (*FeatureSupportRequest, bool) } // FeatureSupportRequest base class for feature request type FeatureSupportRequest struct { - // FeatureType - Possible values include: 'FeatureTypeFeatureSupportRequest', 'FeatureTypeAzureVMResourceBackup' + // FeatureType - Possible values include: 'FeatureTypeFeatureSupportRequest', 'FeatureTypeAzureBackupGoals', 'FeatureTypeAzureVMResourceBackup' FeatureType FeatureType `json:"featureType,omitempty"` } @@ -8537,6 +10836,10 @@ func unmarshalBasicFeatureSupportRequest(body []byte) (BasicFeatureSupportReques } switch m["featureType"] { + case string(FeatureTypeAzureBackupGoals): + var abgfsr AzureBackupGoalFeatureSupportRequest + err := json.Unmarshal(body, &abgfsr) + return abgfsr, err case string(FeatureTypeAzureVMResourceBackup): var avrfsr AzureVMResourceFeatureSupportRequest err := json.Unmarshal(body, &avrfsr) @@ -8576,6 +10879,11 @@ func (fsr FeatureSupportRequest) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsAzureBackupGoalFeatureSupportRequest is the BasicFeatureSupportRequest implementation for FeatureSupportRequest. +func (fsr FeatureSupportRequest) AsAzureBackupGoalFeatureSupportRequest() (*AzureBackupGoalFeatureSupportRequest, bool) { + return nil, false +} + // AsAzureVMResourceFeatureSupportRequest is the BasicFeatureSupportRequest implementation for FeatureSupportRequest. func (fsr FeatureSupportRequest) AsAzureVMResourceFeatureSupportRequest() (*AzureVMResourceFeatureSupportRequest, bool) { return nil, false @@ -8605,7 +10913,7 @@ type GenericContainer struct { RegistrationStatus *string `json:"registrationStatus,omitempty"` // HealthStatus - Status of health of the container. HealthStatus *string `json:"healthStatus,omitempty"` - // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaaSVMContainer', 'ContainerTypeMABWindowsContainer' + // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaaSVMContainer', 'ContainerTypeWindows1' ContainerType ContainerTypeBasicProtectionContainer `json:"containerType,omitempty"` } @@ -8758,7 +11066,7 @@ type GenericProtectedItem struct { FabricName *string `json:"fabricName,omitempty"` // BackupManagementType - Type of backup managemenent for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare' + // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase' WorkloadType DataSourceType `json:"workloadType,omitempty"` // ContainerName - Unique name of container ContainerName *string `json:"containerName,omitempty"` @@ -8770,7 +11078,9 @@ type GenericProtectedItem struct { LastRecoveryPoint *date.Time `json:"lastRecoveryPoint,omitempty"` // BackupSetName - Name of the backup set the backup item belongs to BackupSetName *string `json:"backupSetName,omitempty"` - // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' + // CreateMode - Create mode to indicate recovery of existing soft deleted data source or creation of new data source. Possible values include: 'CreateModeInvalid', 'CreateModeDefault', 'CreateModeRecover' + CreateMode CreateMode `json:"createMode,omitempty"` + // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` } @@ -8817,6 +11127,9 @@ func (gpi GenericProtectedItem) MarshalJSON() ([]byte, error) { if gpi.BackupSetName != nil { objectMap["backupSetName"] = gpi.BackupSetName } + if gpi.CreateMode != "" { + objectMap["createMode"] = gpi.CreateMode + } if gpi.ProtectedItemType != "" { objectMap["protectedItemType"] = gpi.ProtectedItemType } @@ -8853,6 +11166,21 @@ func (gpi GenericProtectedItem) AsAzureSQLProtectedItem() (*AzureSQLProtectedIte return nil, false } +// AsAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. +func (gpi GenericProtectedItem) AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) { + return nil, false +} + +// AsBasicAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. +func (gpi GenericProtectedItem) AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaDatabaseProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. +func (gpi GenericProtectedItem) AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) { + return nil, false +} + // AsAzureVMWorkloadSQLDatabaseProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. func (gpi GenericProtectedItem) AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) { return nil, false @@ -8969,7 +11297,7 @@ type GenericRecoveryPoint struct { RecoveryPointTime *date.Time `json:"recoveryPointTime,omitempty"` // RecoveryPointAdditionalInfo - Additional information associated with this backup copy. RecoveryPointAdditionalInfo *string `json:"recoveryPointAdditionalInfo,omitempty"` - // ObjectType - Possible values include: 'ObjectTypeRecoveryPoint', 'ObjectTypeAzureFileShareRecoveryPoint', 'ObjectTypeAzureWorkloadRecoveryPoint', 'ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSQLRecoveryPoint', 'ObjectTypeGenericRecoveryPoint', 'ObjectTypeIaasVMRecoveryPoint' + // ObjectType - Possible values include: 'ObjectTypeRecoveryPoint', 'ObjectTypeAzureFileShareRecoveryPoint', 'ObjectTypeAzureWorkloadRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaRecoveryPoint', 'ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSQLRecoveryPoint', 'ObjectTypeGenericRecoveryPoint', 'ObjectTypeIaasVMRecoveryPoint' ObjectType ObjectTypeBasicRecoveryPoint `json:"objectType,omitempty"` } @@ -9010,6 +11338,21 @@ func (grp GenericRecoveryPoint) AsBasicAzureWorkloadRecoveryPoint() (BasicAzureW return nil, false } +// AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. +func (grp GenericRecoveryPoint) AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadSAPHanaRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. +func (grp GenericRecoveryPoint) AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSAPHanaRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. +func (grp GenericRecoveryPoint) AsBasicAzureWorkloadSAPHanaRecoveryPoint() (BasicAzureWorkloadSAPHanaRecoveryPoint, bool) { + return nil, false +} + // AsAzureWorkloadSQLPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. func (grp GenericRecoveryPoint) AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) { return nil, false @@ -9120,7 +11463,7 @@ type IaaSVMContainer struct { RegistrationStatus *string `json:"registrationStatus,omitempty"` // HealthStatus - Status of health of the container. HealthStatus *string `json:"healthStatus,omitempty"` - // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaaSVMContainer', 'ContainerTypeMABWindowsContainer' + // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaaSVMContainer', 'ContainerTypeWindows1' ContainerType ContainerTypeBasicProtectionContainer `json:"containerType,omitempty"` } @@ -9346,7 +11689,7 @@ type IaaSVMProtectableItem struct { FriendlyName *string `json:"friendlyName,omitempty"` // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' + // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' ProtectableItemType ProtectableItemType `json:"protectableItemType,omitempty"` } @@ -9441,6 +11784,16 @@ func (ispi IaaSVMProtectableItem) AsBasicAzureVMWorkloadProtectableItem() (Basic return nil, false } +// AsAzureVMWorkloadSAPHanaDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. +func (ispi IaaSVMProtectableItem) AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaSystemProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. +func (ispi IaaSVMProtectableItem) AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) { + return nil, false +} + // AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. func (ispi IaaSVMProtectableItem) AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) { return nil, false @@ -9498,9 +11851,11 @@ type IaasVMRecoveryPoint struct { IsManagedVirtualMachine *bool `json:"isManagedVirtualMachine,omitempty"` // VirtualMachineSize - Virtual Machine Size VirtualMachineSize *string `json:"virtualMachineSize,omitempty"` - // OriginalStorageAccountOption - Original SA Option + // OriginalStorageAccountOption - Original Storage Account Option OriginalStorageAccountOption *bool `json:"originalStorageAccountOption,omitempty"` - // ObjectType - Possible values include: 'ObjectTypeRecoveryPoint', 'ObjectTypeAzureFileShareRecoveryPoint', 'ObjectTypeAzureWorkloadRecoveryPoint', 'ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSQLRecoveryPoint', 'ObjectTypeGenericRecoveryPoint', 'ObjectTypeIaasVMRecoveryPoint' + // OsType - OS type + OsType *string `json:"osType,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeRecoveryPoint', 'ObjectTypeAzureFileShareRecoveryPoint', 'ObjectTypeAzureWorkloadRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaRecoveryPoint', 'ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSQLRecoveryPoint', 'ObjectTypeGenericRecoveryPoint', 'ObjectTypeIaasVMRecoveryPoint' ObjectType ObjectTypeBasicRecoveryPoint `json:"objectType,omitempty"` } @@ -9541,6 +11896,9 @@ func (ivrp IaasVMRecoveryPoint) MarshalJSON() ([]byte, error) { if ivrp.OriginalStorageAccountOption != nil { objectMap["originalStorageAccountOption"] = ivrp.OriginalStorageAccountOption } + if ivrp.OsType != nil { + objectMap["osType"] = ivrp.OsType + } if ivrp.ObjectType != "" { objectMap["objectType"] = ivrp.ObjectType } @@ -9562,6 +11920,21 @@ func (ivrp IaasVMRecoveryPoint) AsBasicAzureWorkloadRecoveryPoint() (BasicAzureW return nil, false } +// AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. +func (ivrp IaasVMRecoveryPoint) AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadSAPHanaRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. +func (ivrp IaasVMRecoveryPoint) AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSAPHanaRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. +func (ivrp IaasVMRecoveryPoint) AsBasicAzureWorkloadSAPHanaRecoveryPoint() (BasicAzureWorkloadSAPHanaRecoveryPoint, bool) { + return nil, false +} + // AsAzureWorkloadSQLPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. func (ivrp IaasVMRecoveryPoint) AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) { return nil, false @@ -9626,11 +11999,11 @@ type IaasVMRestoreRequest struct { AffinityGroup *string `json:"affinityGroup,omitempty"` // CreateNewCloudService - Should a new cloud service be created while restoring the VM. If this is false, VM will be restored to the same cloud service as it was at the time of backup. CreateNewCloudService *bool `json:"createNewCloudService,omitempty"` - // OriginalStorageAccountOption - Original SA Option + // OriginalStorageAccountOption - Original Storage Account Option OriginalStorageAccountOption *bool `json:"originalStorageAccountOption,omitempty"` // EncryptionDetails - Details needed if the VM was encrypted at the time of backup. EncryptionDetails *EncryptionDetails `json:"encryptionDetails,omitempty"` - // ObjectType - Possible values include: 'ObjectTypeRestoreRequest', 'ObjectTypeAzureFileShareRestoreRequest', 'ObjectTypeAzureWorkloadRestoreRequest', 'ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSQLRestoreRequest', 'ObjectTypeIaasVMRestoreRequest' + // ObjectType - Possible values include: 'ObjectTypeRestoreRequest', 'ObjectTypeAzureFileShareRestoreRequest', 'ObjectTypeAzureWorkloadRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaRestoreRequest', 'ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSQLRestoreRequest', 'ObjectTypeIaasVMRestoreRequest' ObjectType ObjectTypeBasicRestoreRequest `json:"objectType,omitempty"` } @@ -9701,6 +12074,21 @@ func (ivrr IaasVMRestoreRequest) AsBasicAzureWorkloadRestoreRequest() (BasicAzur return nil, false } +// AsAzureWorkloadSAPHanaPointInTimeRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. +func (ivrr IaasVMRestoreRequest) AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. +func (ivrr IaasVMRestoreRequest) AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. +func (ivrr IaasVMRestoreRequest) AsBasicAzureWorkloadSAPHanaRestoreRequest() (BasicAzureWorkloadSAPHanaRestoreRequest, bool) { + return nil, false +} + // AsAzureWorkloadSQLPointInTimeRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. func (ivrr IaasVMRestoreRequest) AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) { return nil, false @@ -10354,12 +12742,15 @@ type KEKDetails struct { // If the VM was encrypted then we will store follwing details : // 1. Secret(BEK) - Url + Backup Data + vaultId. // 2. Key(KEK) - Url + Backup Data + vaultId. +// 3. EncryptionMechanism // BEK and KEK can potentiallty have different vault ids. type KeyAndSecretDetails struct { // KekDetails - KEK is encryption key for BEK. KekDetails *KEKDetails `json:"kekDetails,omitempty"` // BekDetails - BEK is bitlocker encrpytion key. BekDetails *BEKDetails `json:"bekDetails,omitempty"` + // EncryptionMechanism - Encryption mechanism: None/ SinglePass/ DoublePass + EncryptionMechanism *string `json:"encryptionMechanism,omitempty"` } // LogSchedulePolicy log policy schedule. @@ -10529,13 +12920,13 @@ type MabContainer struct { RegistrationStatus *string `json:"registrationStatus,omitempty"` // HealthStatus - Status of health of the container. HealthStatus *string `json:"healthStatus,omitempty"` - // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaaSVMContainer', 'ContainerTypeMABWindowsContainer' + // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaaSVMContainer', 'ContainerTypeWindows1' ContainerType ContainerTypeBasicProtectionContainer `json:"containerType,omitempty"` } // MarshalJSON is the custom marshaler for MabContainer. func (mc MabContainer) MarshalJSON() ([]byte, error) { - mc.ContainerType = ContainerTypeMABWindowsContainer + mc.ContainerType = ContainerTypeWindows1 objectMap := make(map[string]interface{}) if mc.CanReRegister != nil { objectMap["canReRegister"] = mc.CanReRegister @@ -10660,7 +13051,7 @@ func (mc MabContainer) AsBasicProtectionContainer() (BasicProtectionContainer, b type MabContainerExtendedInfo struct { // LastRefreshedAt - Time stamp when this container was refreshed. LastRefreshedAt *date.Time `json:"lastRefreshedAt,omitempty"` - // BackupItemType - Type of backup items associated with this container. Possible values include: 'ItemTypeInvalid', 'ItemTypeVM', 'ItemTypeFileFolder', 'ItemTypeAzureSQLDb', 'ItemTypeSQLDB', 'ItemTypeExchange', 'ItemTypeSharepoint', 'ItemTypeVMwareVM', 'ItemTypeSystemState', 'ItemTypeClient', 'ItemTypeGenericDataSource', 'ItemTypeSQLDataBase', 'ItemTypeAzureFileShare' + // BackupItemType - Type of backup items associated with this container. Possible values include: 'ItemTypeInvalid', 'ItemTypeVM', 'ItemTypeFileFolder', 'ItemTypeAzureSQLDb', 'ItemTypeSQLDB', 'ItemTypeExchange', 'ItemTypeSharepoint', 'ItemTypeVMwareVM', 'ItemTypeSystemState', 'ItemTypeClient', 'ItemTypeGenericDataSource', 'ItemTypeSQLDataBase', 'ItemTypeAzureFileShare', 'ItemTypeSAPHanaDatabase' BackupItemType ItemType `json:"backupItemType,omitempty"` // BackupItems - List of backup items associated with this container. BackupItems *[]string `json:"backupItems,omitempty"` @@ -10708,7 +13099,7 @@ type MabFileFolderProtectedItem struct { ExtendedInfo *MabFileFolderProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` // BackupManagementType - Type of backup managemenent for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare' + // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase' WorkloadType DataSourceType `json:"workloadType,omitempty"` // ContainerName - Unique name of container ContainerName *string `json:"containerName,omitempty"` @@ -10720,7 +13111,9 @@ type MabFileFolderProtectedItem struct { LastRecoveryPoint *date.Time `json:"lastRecoveryPoint,omitempty"` // BackupSetName - Name of the backup set the backup item belongs to BackupSetName *string `json:"backupSetName,omitempty"` - // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' + // CreateMode - Create mode to indicate recovery of existing soft deleted data source or creation of new data source. Possible values include: 'CreateModeInvalid', 'CreateModeDefault', 'CreateModeRecover' + CreateMode CreateMode `json:"createMode,omitempty"` + // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` } @@ -10770,6 +13163,9 @@ func (mffpi MabFileFolderProtectedItem) MarshalJSON() ([]byte, error) { if mffpi.BackupSetName != nil { objectMap["backupSetName"] = mffpi.BackupSetName } + if mffpi.CreateMode != "" { + objectMap["createMode"] = mffpi.CreateMode + } if mffpi.ProtectedItemType != "" { objectMap["protectedItemType"] = mffpi.ProtectedItemType } @@ -10806,6 +13202,21 @@ func (mffpi MabFileFolderProtectedItem) AsAzureSQLProtectedItem() (*AzureSQLProt return nil, false } +// AsAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. +func (mffpi MabFileFolderProtectedItem) AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) { + return nil, false +} + +// AsBasicAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. +func (mffpi MabFileFolderProtectedItem) AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaDatabaseProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. +func (mffpi MabFileFolderProtectedItem) AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) { + return nil, false +} + // AsAzureVMWorkloadSQLDatabaseProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. func (mffpi MabFileFolderProtectedItem) AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) { return nil, false @@ -10854,9 +13265,9 @@ type MabJob struct { ActionsInfo *[]JobSupportedAction `json:"actionsInfo,omitempty"` // MabServerName - Name of server protecting the DS. MabServerName *string `json:"mabServerName,omitempty"` - // MabServerType - Server type of MAB container. Possible values include: 'MabServerTypeInvalid', 'MabServerTypeUnknown', 'MabServerTypeIaasVMContainer', 'MabServerTypeIaasVMServiceContainer', 'MabServerTypeDPMContainer', 'MabServerTypeAzureBackupServerContainer', 'MabServerTypeMABContainer', 'MabServerTypeCluster', 'MabServerTypeAzureSQLContainer', 'MabServerTypeWindows', 'MabServerTypeVCenter', 'MabServerTypeVMAppContainer', 'MabServerTypeSQLAGWorkLoadContainer', 'MabServerTypeStorageContainer', 'MabServerTypeGenericContainer' + // MabServerType - Server type of MAB container. Possible values include: 'MabServerTypeInvalid', 'MabServerTypeUnknown', 'MabServerTypeIaasVMContainer', 'MabServerTypeIaasVMServiceContainer', 'MabServerTypeDPMContainer', 'MabServerTypeAzureBackupServerContainer', 'MabServerTypeMABContainer', 'MabServerTypeCluster', 'MabServerTypeAzureSQLContainer', 'MabServerTypeWindows', 'MabServerTypeVCenter', 'MabServerTypeVMAppContainer', 'MabServerTypeSQLAGWorkLoadContainer', 'MabServerTypeStorageContainer', 'MabServerTypeGenericContainer', 'MabServerTypeSQLCluster', 'MabServerTypeExchangeDAG', 'MabServerTypeSharepointFarm', 'MabServerTypeHyperVCluster', 'MabServerTypeWindowsClient' MabServerType MabServerType `json:"mabServerType,omitempty"` - // WorkloadType - Workload type of backup item. Possible values include: 'WorkloadTypeInvalid', 'WorkloadTypeVM', 'WorkloadTypeFileFolder', 'WorkloadTypeAzureSQLDb', 'WorkloadTypeSQLDB', 'WorkloadTypeExchange', 'WorkloadTypeSharepoint', 'WorkloadTypeVMwareVM', 'WorkloadTypeSystemState', 'WorkloadTypeClient', 'WorkloadTypeGenericDataSource', 'WorkloadTypeSQLDataBase', 'WorkloadTypeAzureFileShare' + // WorkloadType - Workload type of backup item. Possible values include: 'WorkloadTypeInvalid', 'WorkloadTypeVM', 'WorkloadTypeFileFolder', 'WorkloadTypeAzureSQLDb', 'WorkloadTypeSQLDB', 'WorkloadTypeExchange', 'WorkloadTypeSharepoint', 'WorkloadTypeVMwareVM', 'WorkloadTypeSystemState', 'WorkloadTypeClient', 'WorkloadTypeGenericDataSource', 'WorkloadTypeSQLDataBase', 'WorkloadTypeAzureFileShare', 'WorkloadTypeSAPHanaDatabase' WorkloadType WorkloadType `json:"workloadType,omitempty"` // ErrorDetails - The errors. ErrorDetails *[]MabErrorInfo `json:"errorDetails,omitempty"` @@ -11743,11 +14154,11 @@ type PreBackupValidation struct { // 2. VM is already protected // 3. Any VM related configuration passed in properties. type PreValidateEnableBackupRequest struct { - // ResourceType - Container Type - VM, SQLPaaS, DPM etc. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare' + // ResourceType - ProtectedItem Type- VM, SqlDataBase, AzureFileShare etc. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase' ResourceType DataSourceType `json:"resourceType,omitempty"` - // ResourceID - Entire ARM VM Id + // ResourceID - ARM Virtual Machine Id ResourceID *string `json:"resourceId,omitempty"` - // VaultID - Entire vault id of the resource + // VaultID - ARM id of the Recovery Services Vault VaultID *string `json:"vaultId,omitempty"` // Properties - Configuration of VM if any needs to be validated like OS type etc Properties *string `json:"properties,omitempty"` @@ -12105,6 +14516,9 @@ type BasicProtectedItem interface { AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) + AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) + AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) + AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) AsDPMProtectedItem() (*DPMProtectedItem, bool) AsGenericProtectedItem() (*GenericProtectedItem, bool) @@ -12116,7 +14530,7 @@ type BasicProtectedItem interface { type ProtectedItem struct { // BackupManagementType - Type of backup managemenent for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare' + // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase' WorkloadType DataSourceType `json:"workloadType,omitempty"` // ContainerName - Unique name of container ContainerName *string `json:"containerName,omitempty"` @@ -12128,7 +14542,9 @@ type ProtectedItem struct { LastRecoveryPoint *date.Time `json:"lastRecoveryPoint,omitempty"` // BackupSetName - Name of the backup set the backup item belongs to BackupSetName *string `json:"backupSetName,omitempty"` - // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' + // CreateMode - Create mode to indicate recovery of existing soft deleted data source or creation of new data source. Possible values include: 'CreateModeInvalid', 'CreateModeDefault', 'CreateModeRecover' + CreateMode CreateMode `json:"createMode,omitempty"` + // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` } @@ -12160,6 +14576,14 @@ func unmarshalBasicProtectedItem(body []byte) (BasicProtectedItem, error) { var aspi AzureSQLProtectedItem err := json.Unmarshal(body, &aspi) return aspi, err + case string(ProtectedItemTypeAzureVMWorkloadProtectedItem): + var avwpi AzureVMWorkloadProtectedItem + err := json.Unmarshal(body, &avwpi) + return avwpi, err + case string(ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase): + var avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem + err := json.Unmarshal(body, &avwshdpi) + return avwshdpi, err case string(ProtectedItemTypeAzureVMWorkloadSQLDatabase): var avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem err := json.Unmarshal(body, &avwsdpi) @@ -12226,6 +14650,9 @@ func (pi ProtectedItem) MarshalJSON() ([]byte, error) { if pi.BackupSetName != nil { objectMap["backupSetName"] = pi.BackupSetName } + if pi.CreateMode != "" { + objectMap["createMode"] = pi.CreateMode + } if pi.ProtectedItemType != "" { objectMap["protectedItemType"] = pi.ProtectedItemType } @@ -12262,6 +14689,21 @@ func (pi ProtectedItem) AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) return nil, false } +// AsAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for ProtectedItem. +func (pi ProtectedItem) AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) { + return nil, false +} + +// AsBasicAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for ProtectedItem. +func (pi ProtectedItem) AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaDatabaseProtectedItem is the BasicProtectedItem implementation for ProtectedItem. +func (pi ProtectedItem) AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) { + return nil, false +} + // AsAzureVMWorkloadSQLDatabaseProtectedItem is the BasicProtectedItem implementation for ProtectedItem. func (pi ProtectedItem) AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) { return nil, false @@ -12298,7 +14740,7 @@ type ProtectedItemQueryObject struct { HealthState HealthState `json:"healthState,omitempty"` // BackupManagementType - Backup management type for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // ItemType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare' + // ItemType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase' ItemType DataSourceType `json:"itemType,omitempty"` // PolicyName - Backup policy name associated with the backup item. PolicyName *string `json:"policyName,omitempty"` @@ -12568,7 +15010,7 @@ type ProtectionContainer struct { RegistrationStatus *string `json:"registrationStatus,omitempty"` // HealthStatus - Status of health of the container. HealthStatus *string `json:"healthStatus,omitempty"` - // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaaSVMContainer', 'ContainerTypeMABWindowsContainer' + // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaaSVMContainer', 'ContainerTypeWindows1' ContainerType ContainerTypeBasicProtectionContainer `json:"containerType,omitempty"` } @@ -12624,7 +15066,7 @@ func unmarshalBasicProtectionContainer(body []byte) (BasicProtectionContainer, e var isc IaaSVMContainer err := json.Unmarshal(body, &isc) return isc, err - case string(ContainerTypeMABWindowsContainer): + case string(ContainerTypeWindows1): var mc MabContainer err := json.Unmarshal(body, &mc) return mc, err @@ -12982,7 +15424,12 @@ func (page ProtectionContainerResourceListPage) Values() []ProtectionContainerRe // BasicProtectionIntent base class for backup ProtectionIntent. type BasicProtectionIntent interface { + AsAzureRecoveryServiceVaultProtectionIntent() (*AzureRecoveryServiceVaultProtectionIntent, bool) + AsBasicAzureRecoveryServiceVaultProtectionIntent() (BasicAzureRecoveryServiceVaultProtectionIntent, bool) AsAzureResourceProtectionIntent() (*AzureResourceProtectionIntent, bool) + AsAzureWorkloadAutoProtectionIntent() (*AzureWorkloadAutoProtectionIntent, bool) + AsBasicAzureWorkloadAutoProtectionIntent() (BasicAzureWorkloadAutoProtectionIntent, bool) + AsAzureWorkloadSQLAutoProtectionIntent() (*AzureWorkloadSQLAutoProtectionIntent, bool) AsProtectionIntent() (*ProtectionIntent, bool) } @@ -12998,7 +15445,7 @@ type ProtectionIntent struct { PolicyID *string `json:"policyId,omitempty"` // ProtectionState - Backup state of this backup item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // ProtectionIntentItemType - Possible values include: 'ProtectionIntentItemTypeProtectionIntent', 'ProtectionIntentItemTypeAzureResourceItem' + // ProtectionIntentItemType - Possible values include: 'ProtectionIntentItemTypeProtectionIntent', 'ProtectionIntentItemTypeRecoveryServiceVaultItem', 'ProtectionIntentItemTypeAzureResourceItem', 'ProtectionIntentItemTypeAzureWorkloadAutoProtectionIntent', 'ProtectionIntentItemTypeAzureWorkloadSQLAutoProtectionIntent' ProtectionIntentItemType ProtectionIntentItemType `json:"protectionIntentItemType,omitempty"` } @@ -13010,10 +15457,22 @@ func unmarshalBasicProtectionIntent(body []byte) (BasicProtectionIntent, error) } switch m["protectionIntentItemType"] { + case string(ProtectionIntentItemTypeRecoveryServiceVaultItem): + var arsvpi AzureRecoveryServiceVaultProtectionIntent + err := json.Unmarshal(body, &arsvpi) + return arsvpi, err case string(ProtectionIntentItemTypeAzureResourceItem): var arpi AzureResourceProtectionIntent err := json.Unmarshal(body, &arpi) return arpi, err + case string(ProtectionIntentItemTypeAzureWorkloadAutoProtectionIntent): + var awapi AzureWorkloadAutoProtectionIntent + err := json.Unmarshal(body, &awapi) + return awapi, err + case string(ProtectionIntentItemTypeAzureWorkloadSQLAutoProtectionIntent): + var awsapi AzureWorkloadSQLAutoProtectionIntent + err := json.Unmarshal(body, &awsapi) + return awsapi, err default: var pi ProtectionIntent err := json.Unmarshal(body, &pi) @@ -13064,11 +15523,36 @@ func (pi ProtectionIntent) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsAzureRecoveryServiceVaultProtectionIntent is the BasicProtectionIntent implementation for ProtectionIntent. +func (pi ProtectionIntent) AsAzureRecoveryServiceVaultProtectionIntent() (*AzureRecoveryServiceVaultProtectionIntent, bool) { + return nil, false +} + +// AsBasicAzureRecoveryServiceVaultProtectionIntent is the BasicProtectionIntent implementation for ProtectionIntent. +func (pi ProtectionIntent) AsBasicAzureRecoveryServiceVaultProtectionIntent() (BasicAzureRecoveryServiceVaultProtectionIntent, bool) { + return nil, false +} + // AsAzureResourceProtectionIntent is the BasicProtectionIntent implementation for ProtectionIntent. func (pi ProtectionIntent) AsAzureResourceProtectionIntent() (*AzureResourceProtectionIntent, bool) { return nil, false } +// AsAzureWorkloadAutoProtectionIntent is the BasicProtectionIntent implementation for ProtectionIntent. +func (pi ProtectionIntent) AsAzureWorkloadAutoProtectionIntent() (*AzureWorkloadAutoProtectionIntent, bool) { + return nil, false +} + +// AsBasicAzureWorkloadAutoProtectionIntent is the BasicProtectionIntent implementation for ProtectionIntent. +func (pi ProtectionIntent) AsBasicAzureWorkloadAutoProtectionIntent() (BasicAzureWorkloadAutoProtectionIntent, bool) { + return nil, false +} + +// AsAzureWorkloadSQLAutoProtectionIntent is the BasicProtectionIntent implementation for ProtectionIntent. +func (pi ProtectionIntent) AsAzureWorkloadSQLAutoProtectionIntent() (*AzureWorkloadSQLAutoProtectionIntent, bool) { + return nil, false +} + // AsProtectionIntent is the BasicProtectionIntent implementation for ProtectionIntent. func (pi ProtectionIntent) AsProtectionIntent() (*ProtectionIntent, bool) { return &pi, true @@ -13335,6 +15819,8 @@ type ProtectionPolicyQueryObject struct { BackupManagementType ManagementType `json:"backupManagementType,omitempty"` // FabricName - Fabric name for filter FabricName *string `json:"fabricName,omitempty"` + // WorkloadType - Workload type for the backup policy. Possible values include: 'WorkloadTypeInvalid', 'WorkloadTypeVM', 'WorkloadTypeFileFolder', 'WorkloadTypeAzureSQLDb', 'WorkloadTypeSQLDB', 'WorkloadTypeExchange', 'WorkloadTypeSharepoint', 'WorkloadTypeVMwareVM', 'WorkloadTypeSystemState', 'WorkloadTypeClient', 'WorkloadTypeGenericDataSource', 'WorkloadTypeSQLDataBase', 'WorkloadTypeAzureFileShare', 'WorkloadTypeSAPHanaDatabase' + WorkloadType WorkloadType `json:"workloadType,omitempty"` } // ProtectionPolicyResource base class for backup policy. Workload-specific backup policies are derived from this @@ -13566,6 +16052,9 @@ type BasicRecoveryPoint interface { AsAzureFileShareRecoveryPoint() (*AzureFileShareRecoveryPoint, bool) AsAzureWorkloadRecoveryPoint() (*AzureWorkloadRecoveryPoint, bool) AsBasicAzureWorkloadRecoveryPoint() (BasicAzureWorkloadRecoveryPoint, bool) + AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) + AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) + AsBasicAzureWorkloadSAPHanaRecoveryPoint() (BasicAzureWorkloadSAPHanaRecoveryPoint, bool) AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) AsBasicAzureWorkloadSQLRecoveryPoint() (BasicAzureWorkloadSQLRecoveryPoint, bool) @@ -13576,7 +16065,7 @@ type BasicRecoveryPoint interface { // RecoveryPoint base class for backup copies. Workload-specific backup copies are derived from this class. type RecoveryPoint struct { - // ObjectType - Possible values include: 'ObjectTypeRecoveryPoint', 'ObjectTypeAzureFileShareRecoveryPoint', 'ObjectTypeAzureWorkloadRecoveryPoint', 'ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSQLRecoveryPoint', 'ObjectTypeGenericRecoveryPoint', 'ObjectTypeIaasVMRecoveryPoint' + // ObjectType - Possible values include: 'ObjectTypeRecoveryPoint', 'ObjectTypeAzureFileShareRecoveryPoint', 'ObjectTypeAzureWorkloadRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaRecoveryPoint', 'ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSQLRecoveryPoint', 'ObjectTypeGenericRecoveryPoint', 'ObjectTypeIaasVMRecoveryPoint' ObjectType ObjectTypeBasicRecoveryPoint `json:"objectType,omitempty"` } @@ -13596,6 +16085,14 @@ func unmarshalBasicRecoveryPoint(body []byte) (BasicRecoveryPoint, error) { var awrp AzureWorkloadRecoveryPoint err := json.Unmarshal(body, &awrp) return awrp, err + case string(ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint): + var awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint + err := json.Unmarshal(body, &awshpitrp) + return awshpitrp, err + case string(ObjectTypeAzureWorkloadSAPHanaRecoveryPoint): + var awshrp AzureWorkloadSAPHanaRecoveryPoint + err := json.Unmarshal(body, &awshrp) + return awshrp, err case string(ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint): var awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint err := json.Unmarshal(body, &awspitrp) @@ -13662,6 +16159,21 @@ func (rp RecoveryPoint) AsBasicAzureWorkloadRecoveryPoint() (BasicAzureWorkloadR return nil, false } +// AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. +func (rp RecoveryPoint) AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadSAPHanaRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. +func (rp RecoveryPoint) AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSAPHanaRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. +func (rp RecoveryPoint) AsBasicAzureWorkloadSAPHanaRecoveryPoint() (BasicAzureWorkloadSAPHanaRecoveryPoint, bool) { + return nil, false +} + // AsAzureWorkloadSQLPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. func (rp RecoveryPoint) AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) { return nil, false @@ -14317,6 +16829,9 @@ type BasicRestoreRequest interface { AsAzureFileShareRestoreRequest() (*AzureFileShareRestoreRequest, bool) AsAzureWorkloadRestoreRequest() (*AzureWorkloadRestoreRequest, bool) AsBasicAzureWorkloadRestoreRequest() (BasicAzureWorkloadRestoreRequest, bool) + AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) + AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) + AsBasicAzureWorkloadSAPHanaRestoreRequest() (BasicAzureWorkloadSAPHanaRestoreRequest, bool) AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) AsAzureWorkloadSQLRestoreRequest() (*AzureWorkloadSQLRestoreRequest, bool) AsBasicAzureWorkloadSQLRestoreRequest() (BasicAzureWorkloadSQLRestoreRequest, bool) @@ -14326,7 +16841,7 @@ type BasicRestoreRequest interface { // RestoreRequest base class for restore request. Workload-specific restore requests are derived from this class. type RestoreRequest struct { - // ObjectType - Possible values include: 'ObjectTypeRestoreRequest', 'ObjectTypeAzureFileShareRestoreRequest', 'ObjectTypeAzureWorkloadRestoreRequest', 'ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSQLRestoreRequest', 'ObjectTypeIaasVMRestoreRequest' + // ObjectType - Possible values include: 'ObjectTypeRestoreRequest', 'ObjectTypeAzureFileShareRestoreRequest', 'ObjectTypeAzureWorkloadRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaRestoreRequest', 'ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSQLRestoreRequest', 'ObjectTypeIaasVMRestoreRequest' ObjectType ObjectTypeBasicRestoreRequest `json:"objectType,omitempty"` } @@ -14346,6 +16861,14 @@ func unmarshalBasicRestoreRequest(body []byte) (BasicRestoreRequest, error) { var awrr AzureWorkloadRestoreRequest err := json.Unmarshal(body, &awrr) return awrr, err + case string(ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest): + var awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest + err := json.Unmarshal(body, &awshpitrr) + return awshpitrr, err + case string(ObjectTypeAzureWorkloadSAPHanaRestoreRequest): + var awshrr AzureWorkloadSAPHanaRestoreRequest + err := json.Unmarshal(body, &awshrr) + return awshrr, err case string(ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest): var awspitrr AzureWorkloadSQLPointInTimeRestoreRequest err := json.Unmarshal(body, &awspitrr) @@ -14408,6 +16931,21 @@ func (rr RestoreRequest) AsBasicAzureWorkloadRestoreRequest() (BasicAzureWorkloa return nil, false } +// AsAzureWorkloadSAPHanaPointInTimeRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest. +func (rr RestoreRequest) AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest. +func (rr RestoreRequest) AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest. +func (rr RestoreRequest) AsBasicAzureWorkloadSAPHanaRestoreRequest() (BasicAzureWorkloadSAPHanaRestoreRequest, bool) { + return nil, false +} + // AsAzureWorkloadSQLPointInTimeRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest. func (rr RestoreRequest) AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) { return nil, false @@ -14752,6 +17290,9 @@ type Settings struct { TimeZone *string `json:"timeZone,omitempty"` // Issqlcompression - SQL compression flag Issqlcompression *bool `json:"issqlcompression,omitempty"` + // IsCompression - Workload compression flag. This has been added so that 'isSqlCompression' + // will be deprecated once clients upgrade to consider this flag. + IsCompression *bool `json:"isCompression,omitempty"` } // SimpleRetentionPolicy simple policy retention. @@ -14880,7 +17421,7 @@ type SQLDataDirectoryMapping struct { // StatusRequest backupStatus request. type StatusRequest struct { - // ResourceType - Container Type - VM, SQLPaaS, DPM, AzureFileShare. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare' + // ResourceType - Container Type - VM, SQLPaaS, DPM, AzureFileShare. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase' ResourceType DataSourceType `json:"resourceType,omitempty"` // ResourceID - Entire ARM resource id of the resource ResourceID *string `json:"resourceId,omitempty"` @@ -14895,11 +17436,11 @@ type StatusResponse struct { ProtectionStatus ProtectionStatus `json:"protectionStatus,omitempty"` // VaultID - Specifies the arm resource id of the vault VaultID *string `json:"vaultId,omitempty"` - // FabricName - Specifies the fabric name - Azure or AAD. Possible values include: 'FabricNameInvalid', 'FabricNameAzure' + // FabricName - Specifies the fabric name - Azure or AD. Possible values include: 'FabricNameInvalid', 'FabricNameAzure' FabricName FabricName `json:"fabricName,omitempty"` - // ContainerName - Specifies the product specific container name. E.g. iaasvmcontainer;iaasvmcontainer;csname;vmname. This is required for portal + // ContainerName - Specifies the product specific container name. E.g. iaasvmcontainer;iaasvmcontainer;csname;vmname. ContainerName *string `json:"containerName,omitempty"` - // ProtectedItemName - Specifies the product specific ds name. E.g. vm;iaasvmcontainer;csname;vmname. This is required for portal + // ProtectedItemName - Specifies the product specific ds name. E.g. vm;iaasvmcontainer;csname;vmname. ProtectedItemName *string `json:"protectedItemName,omitempty"` // ErrorCode - ErrorCode in case of intent failed ErrorCode *string `json:"errorCode,omitempty"` @@ -14975,7 +17516,7 @@ type TargetRestoreInfo struct { OverwriteOption OverwriteOptions `json:"overwriteOption,omitempty"` // ContainerID - Resource Id name of the container in which Target DataBase resides ContainerID *string `json:"containerId,omitempty"` - // DatabaseName - Database name SQL InstanceName/DataBaseName + // DatabaseName - Database name InstanceName/DataBaseName for SQL or System/DbName for SAP Hana DatabaseName *string `json:"databaseName,omitempty"` } @@ -15022,6 +17563,8 @@ type WorkloadInquiryDetails struct { type BasicWorkloadItem interface { AsAzureVMWorkloadItem() (*AzureVMWorkloadItem, bool) AsBasicAzureVMWorkloadItem() (BasicAzureVMWorkloadItem, bool) + AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem() (*AzureVMWorkloadSAPHanaDatabaseWorkloadItem, bool) + AsAzureVMWorkloadSAPHanaSystemWorkloadItem() (*AzureVMWorkloadSAPHanaSystemWorkloadItem, bool) AsAzureVMWorkloadSQLDatabaseWorkloadItem() (*AzureVMWorkloadSQLDatabaseWorkloadItem, bool) AsAzureVMWorkloadSQLInstanceWorkloadItem() (*AzureVMWorkloadSQLInstanceWorkloadItem, bool) AsWorkloadItem() (*WorkloadItem, bool) @@ -15037,7 +17580,7 @@ type WorkloadItem struct { FriendlyName *string `json:"friendlyName,omitempty"` // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // WorkloadItemType - Possible values include: 'WorkloadItemTypeWorkloadItem', 'WorkloadItemTypeAzureVMWorkloadItem', 'WorkloadItemTypeSQLDataBase1', 'WorkloadItemTypeSQLInstance1' + // WorkloadItemType - Possible values include: 'WorkloadItemTypeWorkloadItem', 'WorkloadItemTypeAzureVMWorkloadItem', 'WorkloadItemTypeSAPHanaDatabase1', 'WorkloadItemTypeSAPHanaSystem1', 'WorkloadItemTypeSQLDataBase1', 'WorkloadItemTypeSQLInstance1' WorkloadItemType WorkloadItemTypeBasicWorkloadItem `json:"workloadItemType,omitempty"` } @@ -15053,6 +17596,14 @@ func unmarshalBasicWorkloadItem(body []byte) (BasicWorkloadItem, error) { var avwi AzureVMWorkloadItem err := json.Unmarshal(body, &avwi) return avwi, err + case string(WorkloadItemTypeSAPHanaDatabase1): + var avwshdwi AzureVMWorkloadSAPHanaDatabaseWorkloadItem + err := json.Unmarshal(body, &avwshdwi) + return avwshdwi, err + case string(WorkloadItemTypeSAPHanaSystem1): + var avwshswi AzureVMWorkloadSAPHanaSystemWorkloadItem + err := json.Unmarshal(body, &avwshswi) + return avwshswi, err case string(WorkloadItemTypeSQLDataBase1): var avwsdwi AzureVMWorkloadSQLDatabaseWorkloadItem err := json.Unmarshal(body, &avwsdwi) @@ -15118,6 +17669,16 @@ func (wi WorkloadItem) AsBasicAzureVMWorkloadItem() (BasicAzureVMWorkloadItem, b return nil, false } +// AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem is the BasicWorkloadItem implementation for WorkloadItem. +func (wi WorkloadItem) AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem() (*AzureVMWorkloadSAPHanaDatabaseWorkloadItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaSystemWorkloadItem is the BasicWorkloadItem implementation for WorkloadItem. +func (wi WorkloadItem) AsAzureVMWorkloadSAPHanaSystemWorkloadItem() (*AzureVMWorkloadSAPHanaSystemWorkloadItem, bool) { + return nil, false +} + // AsAzureVMWorkloadSQLDatabaseWorkloadItem is the BasicWorkloadItem implementation for WorkloadItem. func (wi WorkloadItem) AsAzureVMWorkloadSQLDatabaseWorkloadItem() (*AzureVMWorkloadSQLDatabaseWorkloadItem, bool) { return nil, false @@ -15367,6 +17928,8 @@ type BasicWorkloadProtectableItem interface { AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) + AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) + AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) @@ -15385,7 +17948,7 @@ type WorkloadProtectableItem struct { FriendlyName *string `json:"friendlyName,omitempty"` // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' + // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' ProtectableItemType ProtectableItemType `json:"protectableItemType,omitempty"` } @@ -15413,6 +17976,14 @@ func unmarshalBasicWorkloadProtectableItem(body []byte) (BasicWorkloadProtectabl var avwpi AzureVMWorkloadProtectableItem err := json.Unmarshal(body, &avwpi) return avwpi, err + case string(ProtectableItemTypeSAPHanaDatabase): + var avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem + err := json.Unmarshal(body, &avwshdpi) + return avwshdpi, err + case string(ProtectableItemTypeSAPHanaSystem): + var avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem + err := json.Unmarshal(body, &avwshspi) + return avwshspi, err case string(ProtectableItemTypeSQLAvailabilityGroupContainer): var avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem err := json.Unmarshal(body, &avwsagpi) @@ -15501,6 +18072,16 @@ func (wpi WorkloadProtectableItem) AsBasicAzureVMWorkloadProtectableItem() (Basi return nil, false } +// AsAzureVMWorkloadSAPHanaDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for WorkloadProtectableItem. +func (wpi WorkloadProtectableItem) AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaSystemProtectableItem is the BasicWorkloadProtectableItem implementation for WorkloadProtectableItem. +func (wpi WorkloadProtectableItem) AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) { + return nil, false +} + // AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem is the BasicWorkloadProtectableItem implementation for WorkloadProtectableItem. func (wpi WorkloadProtectableItem) AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) { return nil, false diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2017-07-01/backup/protectioncontainers.go b/vendor/github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2017-07-01/backup/protectioncontainers.go index 13616dbb0..142dce500 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2017-07-01/backup/protectioncontainers.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2017-07-01/backup/protectioncontainers.go @@ -116,8 +116,9 @@ func (client ProtectionContainersClient) GetResponder(resp *http.Response) (resu // resourceGroupName - the name of the resource group where the recovery services vault is present. // fabricName - fabric Name associated with the container. // containerName - name of the container in which inquiry needs to be triggered. -func (client ProtectionContainersClient) Inquire(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string) (result autorest.Response, err error) { - req, err := client.InquirePreparer(ctx, vaultName, resourceGroupName, fabricName, containerName) +// filter - oData filter options. +func (client ProtectionContainersClient) Inquire(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, filter string) (result autorest.Response, err error) { + req, err := client.InquirePreparer(ctx, vaultName, resourceGroupName, fabricName, containerName, filter) if err != nil { err = autorest.NewErrorWithError(err, "backup.ProtectionContainersClient", "Inquire", nil, "Failure preparing request") return @@ -139,7 +140,7 @@ func (client ProtectionContainersClient) Inquire(ctx context.Context, vaultName } // InquirePreparer prepares the Inquire request. -func (client ProtectionContainersClient) InquirePreparer(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string) (*http.Request, error) { +func (client ProtectionContainersClient) InquirePreparer(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, filter string) (*http.Request, error) { pathParameters := map[string]interface{}{ "containerName": autorest.Encode("path", containerName), "fabricName": autorest.Encode("path", fabricName), @@ -152,6 +153,9 @@ func (client ProtectionContainersClient) InquirePreparer(ctx context.Context, va queryParameters := map[string]interface{}{ "api-version": APIVersion, } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } preparer := autorest.CreatePreparer( autorest.AsPost(), diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/relay/mgmt/2016-07-01/relay/hybridconnections.go b/vendor/github.com/Azure/azure-sdk-for-go/services/relay/mgmt/2016-07-01/relay/hybridconnections.go index 73ed80a0d..a18a62cf1 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/relay/mgmt/2016-07-01/relay/hybridconnections.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/relay/mgmt/2016-07-01/relay/hybridconnections.go @@ -60,7 +60,7 @@ func (client HybridConnectionsClient) CreateOrUpdate(ctx context.Context, resour {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.HybridConnectionProperties", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "parameters.HybridConnectionProperties.ListenerCount", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.HybridConnectionProperties.ListenerCount", Name: validation.InclusiveMaximum, Rule: 25, Chain: nil}, + Chain: []validation.Constraint{{Target: "parameters.HybridConnectionProperties.ListenerCount", Name: validation.InclusiveMaximum, Rule: int64(25), Chain: nil}, {Target: "parameters.HybridConnectionProperties.ListenerCount", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}, }}}}}); err != nil { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/relay/mgmt/2017-04-01/relay/hybridconnections.go b/vendor/github.com/Azure/azure-sdk-for-go/services/relay/mgmt/2017-04-01/relay/hybridconnections.go index 9310fa033..976ff8481 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/relay/mgmt/2017-04-01/relay/hybridconnections.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/relay/mgmt/2017-04-01/relay/hybridconnections.go @@ -59,7 +59,7 @@ func (client HybridConnectionsClient) CreateOrUpdate(ctx context.Context, resour {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.HybridConnectionProperties", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "parameters.HybridConnectionProperties.ListenerCount", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.HybridConnectionProperties.ListenerCount", Name: validation.InclusiveMaximum, Rule: 25, Chain: nil}, + Chain: []validation.Constraint{{Target: "parameters.HybridConnectionProperties.ListenerCount", Name: validation.InclusiveMaximum, Rule: int64(25), Chain: nil}, {Target: "parameters.HybridConnectionProperties.ListenerCount", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, }}, }}}}}); err != nil { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/relay/mgmt/2017-04-01/relay/wcfrelays.go b/vendor/github.com/Azure/azure-sdk-for-go/services/relay/mgmt/2017-04-01/relay/wcfrelays.go index 37b5a7a20..d6f828209 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/relay/mgmt/2017-04-01/relay/wcfrelays.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/relay/mgmt/2017-04-01/relay/wcfrelays.go @@ -59,7 +59,7 @@ func (client WCFRelaysClient) CreateOrUpdate(ctx context.Context, resourceGroupN {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.WcfRelayProperties", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "parameters.WcfRelayProperties.ListenerCount", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.WcfRelayProperties.ListenerCount", Name: validation.InclusiveMaximum, Rule: 25, Chain: nil}, + Chain: []validation.Constraint{{Target: "parameters.WcfRelayProperties.ListenerCount", Name: validation.InclusiveMaximum, Rule: int64(25), Chain: nil}, {Target: "parameters.WcfRelayProperties.ListenerCount", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, }}, }}}}}); err != nil { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/reservations/mgmt/2018-06-01/reservations/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/reservations/mgmt/2018-06-01/reservations/models.go index f2b664283..704f761ae 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/reservations/mgmt/2018-06-01/reservations/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/reservations/mgmt/2018-06-01/reservations/models.go @@ -19,11 +19,12 @@ package reservations import ( "encoding/json" + "net/http" + "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" "github.com/Azure/go-autorest/autorest/date" "github.com/Azure/go-autorest/autorest/to" - "net/http" ) // AppliedScopeType enumerates the values for applied scope type. @@ -41,140 +42,125 @@ func PossibleAppliedScopeTypeValues() []AppliedScopeType { return []AppliedScopeType{Shared, Single} } -// AppliedScopeType1 enumerates the values for applied scope type 1. -type AppliedScopeType1 string - -const ( - // AppliedScopeType1Shared ... - AppliedScopeType1Shared AppliedScopeType1 = "Shared" - // AppliedScopeType1Single ... - AppliedScopeType1Single AppliedScopeType1 = "Single" -) - -// PossibleAppliedScopeType1Values returns an array of possible values for the AppliedScopeType1 const type. -func PossibleAppliedScopeType1Values() []AppliedScopeType1 { - return []AppliedScopeType1{AppliedScopeType1Shared, AppliedScopeType1Single} -} - -// Code enumerates the values for code. -type Code string +// ErrorResponseCode enumerates the values for error response code. +type ErrorResponseCode string const ( // ActivateQuoteFailed ... - ActivateQuoteFailed Code = "ActivateQuoteFailed" + ActivateQuoteFailed ErrorResponseCode = "ActivateQuoteFailed" // AppliedScopesNotAssociatedWithCommerceAccount ... - AppliedScopesNotAssociatedWithCommerceAccount Code = "AppliedScopesNotAssociatedWithCommerceAccount" + AppliedScopesNotAssociatedWithCommerceAccount ErrorResponseCode = "AppliedScopesNotAssociatedWithCommerceAccount" // AuthorizationFailed ... - AuthorizationFailed Code = "AuthorizationFailed" + AuthorizationFailed ErrorResponseCode = "AuthorizationFailed" // BadRequest ... - BadRequest Code = "BadRequest" + BadRequest ErrorResponseCode = "BadRequest" // BillingCustomerInputError ... - BillingCustomerInputError Code = "BillingCustomerInputError" + BillingCustomerInputError ErrorResponseCode = "BillingCustomerInputError" // BillingError ... - BillingError Code = "BillingError" + BillingError ErrorResponseCode = "BillingError" // BillingPaymentInstrumentHardError ... - BillingPaymentInstrumentHardError Code = "BillingPaymentInstrumentHardError" + BillingPaymentInstrumentHardError ErrorResponseCode = "BillingPaymentInstrumentHardError" // BillingPaymentInstrumentSoftError ... - BillingPaymentInstrumentSoftError Code = "BillingPaymentInstrumentSoftError" + BillingPaymentInstrumentSoftError ErrorResponseCode = "BillingPaymentInstrumentSoftError" // BillingScopeIDCannotBeChanged ... - BillingScopeIDCannotBeChanged Code = "BillingScopeIdCannotBeChanged" + BillingScopeIDCannotBeChanged ErrorResponseCode = "BillingScopeIdCannotBeChanged" // BillingTransientError ... - BillingTransientError Code = "BillingTransientError" + BillingTransientError ErrorResponseCode = "BillingTransientError" // CalculatePriceFailed ... - CalculatePriceFailed Code = "CalculatePriceFailed" + CalculatePriceFailed ErrorResponseCode = "CalculatePriceFailed" // CapacityUpdateScopesFailed ... - CapacityUpdateScopesFailed Code = "CapacityUpdateScopesFailed" + CapacityUpdateScopesFailed ErrorResponseCode = "CapacityUpdateScopesFailed" // ClientCertificateThumbprintNotSet ... - ClientCertificateThumbprintNotSet Code = "ClientCertificateThumbprintNotSet" + ClientCertificateThumbprintNotSet ErrorResponseCode = "ClientCertificateThumbprintNotSet" // CreateQuoteFailed ... - CreateQuoteFailed Code = "CreateQuoteFailed" + CreateQuoteFailed ErrorResponseCode = "CreateQuoteFailed" // Forbidden ... - Forbidden Code = "Forbidden" + Forbidden ErrorResponseCode = "Forbidden" // FulfillmentConfigurationError ... - FulfillmentConfigurationError Code = "FulfillmentConfigurationError" + FulfillmentConfigurationError ErrorResponseCode = "FulfillmentConfigurationError" // FulfillmentError ... - FulfillmentError Code = "FulfillmentError" + FulfillmentError ErrorResponseCode = "FulfillmentError" // FulfillmentOutOfStockError ... - FulfillmentOutOfStockError Code = "FulfillmentOutOfStockError" + FulfillmentOutOfStockError ErrorResponseCode = "FulfillmentOutOfStockError" // FulfillmentTransientError ... - FulfillmentTransientError Code = "FulfillmentTransientError" + FulfillmentTransientError ErrorResponseCode = "FulfillmentTransientError" // HTTPMethodNotSupported ... - HTTPMethodNotSupported Code = "HttpMethodNotSupported" + HTTPMethodNotSupported ErrorResponseCode = "HttpMethodNotSupported" // InternalServerError ... - InternalServerError Code = "InternalServerError" + InternalServerError ErrorResponseCode = "InternalServerError" // InvalidAccessToken ... - InvalidAccessToken Code = "InvalidAccessToken" + InvalidAccessToken ErrorResponseCode = "InvalidAccessToken" // InvalidFulfillmentRequestParameters ... - InvalidFulfillmentRequestParameters Code = "InvalidFulfillmentRequestParameters" + InvalidFulfillmentRequestParameters ErrorResponseCode = "InvalidFulfillmentRequestParameters" // InvalidHealthCheckType ... - InvalidHealthCheckType Code = "InvalidHealthCheckType" + InvalidHealthCheckType ErrorResponseCode = "InvalidHealthCheckType" // InvalidLocationID ... - InvalidLocationID Code = "InvalidLocationId" + InvalidLocationID ErrorResponseCode = "InvalidLocationId" // InvalidRefundQuantity ... - InvalidRefundQuantity Code = "InvalidRefundQuantity" + InvalidRefundQuantity ErrorResponseCode = "InvalidRefundQuantity" // InvalidRequestContent ... - InvalidRequestContent Code = "InvalidRequestContent" + InvalidRequestContent ErrorResponseCode = "InvalidRequestContent" // InvalidRequestURI ... - InvalidRequestURI Code = "InvalidRequestUri" + InvalidRequestURI ErrorResponseCode = "InvalidRequestUri" // InvalidReservationID ... - InvalidReservationID Code = "InvalidReservationId" + InvalidReservationID ErrorResponseCode = "InvalidReservationId" // InvalidReservationOrderID ... - InvalidReservationOrderID Code = "InvalidReservationOrderId" + InvalidReservationOrderID ErrorResponseCode = "InvalidReservationOrderId" // InvalidSingleAppliedScopesCount ... - InvalidSingleAppliedScopesCount Code = "InvalidSingleAppliedScopesCount" + InvalidSingleAppliedScopesCount ErrorResponseCode = "InvalidSingleAppliedScopesCount" // InvalidSubscriptionID ... - InvalidSubscriptionID Code = "InvalidSubscriptionId" + InvalidSubscriptionID ErrorResponseCode = "InvalidSubscriptionId" // InvalidTenantID ... - InvalidTenantID Code = "InvalidTenantId" + InvalidTenantID ErrorResponseCode = "InvalidTenantId" // MissingAppliedScopesForSingle ... - MissingAppliedScopesForSingle Code = "MissingAppliedScopesForSingle" + MissingAppliedScopesForSingle ErrorResponseCode = "MissingAppliedScopesForSingle" // MissingTenantID ... - MissingTenantID Code = "MissingTenantId" + MissingTenantID ErrorResponseCode = "MissingTenantId" // NonsupportedAccountID ... - NonsupportedAccountID Code = "NonsupportedAccountId" + NonsupportedAccountID ErrorResponseCode = "NonsupportedAccountId" // NotSpecified ... - NotSpecified Code = "NotSpecified" + NotSpecified ErrorResponseCode = "NotSpecified" // NotSupportedCountry ... - NotSupportedCountry Code = "NotSupportedCountry" + NotSupportedCountry ErrorResponseCode = "NotSupportedCountry" // NoValidReservationsToReRate ... - NoValidReservationsToReRate Code = "NoValidReservationsToReRate" + NoValidReservationsToReRate ErrorResponseCode = "NoValidReservationsToReRate" // OperationCannotBePerformedInCurrentState ... - OperationCannotBePerformedInCurrentState Code = "OperationCannotBePerformedInCurrentState" + OperationCannotBePerformedInCurrentState ErrorResponseCode = "OperationCannotBePerformedInCurrentState" // OperationFailed ... - OperationFailed Code = "OperationFailed" + OperationFailed ErrorResponseCode = "OperationFailed" // PatchValuesSameAsExisting ... - PatchValuesSameAsExisting Code = "PatchValuesSameAsExisting" + PatchValuesSameAsExisting ErrorResponseCode = "PatchValuesSameAsExisting" // PaymentInstrumentNotFound ... - PaymentInstrumentNotFound Code = "PaymentInstrumentNotFound" + PaymentInstrumentNotFound ErrorResponseCode = "PaymentInstrumentNotFound" // PurchaseError ... - PurchaseError Code = "PurchaseError" + PurchaseError ErrorResponseCode = "PurchaseError" // ReRateOnlyAllowedForEA ... - ReRateOnlyAllowedForEA Code = "ReRateOnlyAllowedForEA" + ReRateOnlyAllowedForEA ErrorResponseCode = "ReRateOnlyAllowedForEA" // ReservationIDNotInReservationOrder ... - ReservationIDNotInReservationOrder Code = "ReservationIdNotInReservationOrder" + ReservationIDNotInReservationOrder ErrorResponseCode = "ReservationIdNotInReservationOrder" // ReservationOrderCreationFailed ... - ReservationOrderCreationFailed Code = "ReservationOrderCreationFailed" + ReservationOrderCreationFailed ErrorResponseCode = "ReservationOrderCreationFailed" // ReservationOrderIDAlreadyExists ... - ReservationOrderIDAlreadyExists Code = "ReservationOrderIdAlreadyExists" + ReservationOrderIDAlreadyExists ErrorResponseCode = "ReservationOrderIdAlreadyExists" // ReservationOrderNotEnabled ... - ReservationOrderNotEnabled Code = "ReservationOrderNotEnabled" + ReservationOrderNotEnabled ErrorResponseCode = "ReservationOrderNotEnabled" // ReservationOrderNotFound ... - ReservationOrderNotFound Code = "ReservationOrderNotFound" + ReservationOrderNotFound ErrorResponseCode = "ReservationOrderNotFound" // RiskCheckFailed ... - RiskCheckFailed Code = "RiskCheckFailed" + RiskCheckFailed ErrorResponseCode = "RiskCheckFailed" // RoleAssignmentCreationFailed ... - RoleAssignmentCreationFailed Code = "RoleAssignmentCreationFailed" + RoleAssignmentCreationFailed ErrorResponseCode = "RoleAssignmentCreationFailed" // ServerTimeout ... - ServerTimeout Code = "ServerTimeout" + ServerTimeout ErrorResponseCode = "ServerTimeout" // UnauthenticatedRequestsThrottled ... - UnauthenticatedRequestsThrottled Code = "UnauthenticatedRequestsThrottled" + UnauthenticatedRequestsThrottled ErrorResponseCode = "UnauthenticatedRequestsThrottled" // UnsupportedReservationTerm ... - UnsupportedReservationTerm Code = "UnsupportedReservationTerm" + UnsupportedReservationTerm ErrorResponseCode = "UnsupportedReservationTerm" ) -// PossibleCodeValues returns an array of possible values for the Code const type. -func PossibleCodeValues() []Code { - return []Code{ActivateQuoteFailed, AppliedScopesNotAssociatedWithCommerceAccount, AuthorizationFailed, BadRequest, BillingCustomerInputError, BillingError, BillingPaymentInstrumentHardError, BillingPaymentInstrumentSoftError, BillingScopeIDCannotBeChanged, BillingTransientError, CalculatePriceFailed, CapacityUpdateScopesFailed, ClientCertificateThumbprintNotSet, CreateQuoteFailed, Forbidden, FulfillmentConfigurationError, FulfillmentError, FulfillmentOutOfStockError, FulfillmentTransientError, HTTPMethodNotSupported, InternalServerError, InvalidAccessToken, InvalidFulfillmentRequestParameters, InvalidHealthCheckType, InvalidLocationID, InvalidRefundQuantity, InvalidRequestContent, InvalidRequestURI, InvalidReservationID, InvalidReservationOrderID, InvalidSingleAppliedScopesCount, InvalidSubscriptionID, InvalidTenantID, MissingAppliedScopesForSingle, MissingTenantID, NonsupportedAccountID, NotSpecified, NotSupportedCountry, NoValidReservationsToReRate, OperationCannotBePerformedInCurrentState, OperationFailed, PatchValuesSameAsExisting, PaymentInstrumentNotFound, PurchaseError, ReRateOnlyAllowedForEA, ReservationIDNotInReservationOrder, ReservationOrderCreationFailed, ReservationOrderIDAlreadyExists, ReservationOrderNotEnabled, ReservationOrderNotFound, RiskCheckFailed, RoleAssignmentCreationFailed, ServerTimeout, UnauthenticatedRequestsThrottled, UnsupportedReservationTerm} +// PossibleErrorResponseCodeValues returns an array of possible values for the ErrorResponseCode const type. +func PossibleErrorResponseCodeValues() []ErrorResponseCode { + return []ErrorResponseCode{ActivateQuoteFailed, AppliedScopesNotAssociatedWithCommerceAccount, AuthorizationFailed, BadRequest, BillingCustomerInputError, BillingError, BillingPaymentInstrumentHardError, BillingPaymentInstrumentSoftError, BillingScopeIDCannotBeChanged, BillingTransientError, CalculatePriceFailed, CapacityUpdateScopesFailed, ClientCertificateThumbprintNotSet, CreateQuoteFailed, Forbidden, FulfillmentConfigurationError, FulfillmentError, FulfillmentOutOfStockError, FulfillmentTransientError, HTTPMethodNotSupported, InternalServerError, InvalidAccessToken, InvalidFulfillmentRequestParameters, InvalidHealthCheckType, InvalidLocationID, InvalidRefundQuantity, InvalidRequestContent, InvalidRequestURI, InvalidReservationID, InvalidReservationOrderID, InvalidSingleAppliedScopesCount, InvalidSubscriptionID, InvalidTenantID, MissingAppliedScopesForSingle, MissingTenantID, NonsupportedAccountID, NotSpecified, NotSupportedCountry, NoValidReservationsToReRate, OperationCannotBePerformedInCurrentState, OperationFailed, PatchValuesSameAsExisting, PaymentInstrumentNotFound, PurchaseError, ReRateOnlyAllowedForEA, ReservationIDNotInReservationOrder, ReservationOrderCreationFailed, ReservationOrderIDAlreadyExists, ReservationOrderNotEnabled, ReservationOrderNotFound, RiskCheckFailed, RoleAssignmentCreationFailed, ServerTimeout, UnauthenticatedRequestsThrottled, UnsupportedReservationTerm} } // InstanceFlexibility enumerates the values for instance flexibility. @@ -194,162 +180,19 @@ func PossibleInstanceFlexibilityValues() []InstanceFlexibility { return []InstanceFlexibility{NotSupported, Off, On} } -// InstanceFlexibility1 enumerates the values for instance flexibility 1. -type InstanceFlexibility1 string +// ReservationTerm enumerates the values for reservation term. +type ReservationTerm string const ( - // InstanceFlexibility1NotSupported ... - InstanceFlexibility1NotSupported InstanceFlexibility1 = "NotSupported" - // InstanceFlexibility1Off ... - InstanceFlexibility1Off InstanceFlexibility1 = "Off" - // InstanceFlexibility1On ... - InstanceFlexibility1On InstanceFlexibility1 = "On" + // P1Y ... + P1Y ReservationTerm = "P1Y" + // P3Y ... + P3Y ReservationTerm = "P3Y" ) -// PossibleInstanceFlexibility1Values returns an array of possible values for the InstanceFlexibility1 const type. -func PossibleInstanceFlexibility1Values() []InstanceFlexibility1 { - return []InstanceFlexibility1{InstanceFlexibility1NotSupported, InstanceFlexibility1Off, InstanceFlexibility1On} -} - -// Location enumerates the values for location. -type Location string - -const ( - // Australiac ... - Australiac Location = "australiac" - // Australiac2 ... - Australiac2 Location = "australiac2" - // Australiaeast ... - Australiaeast Location = "australiaeast" - // Australiasoutheast ... - Australiasoutheast Location = "australiasoutheast" - // Brazilsouth ... - Brazilsouth Location = "brazilsouth" - // Canadacentral ... - Canadacentral Location = "canadacentral" - // Canadaeast ... - Canadaeast Location = "canadaeast" - // Centralindia ... - Centralindia Location = "centralindia" - // Centralus ... - Centralus Location = "centralus" - // Eastasia ... - Eastasia Location = "eastasia" - // Eastus ... - Eastus Location = "eastus" - // Eastus2 ... - Eastus2 Location = "eastus2" - // Francecentral ... - Francecentral Location = "francecentral" - // Francesouth ... - Francesouth Location = "francesouth" - // Japaneast ... - Japaneast Location = "japaneast" - // Japanwest ... - Japanwest Location = "japanwest" - // Northcentralus ... - Northcentralus Location = "northcentralus" - // Northeurope ... - Northeurope Location = "northeurope" - // Southcentralus ... - Southcentralus Location = "southcentralus" - // Southeastasia ... - Southeastasia Location = "southeastasia" - // Southindia ... - Southindia Location = "southindia" - // Uksouth ... - Uksouth Location = "uksouth" - // Ukwest ... - Ukwest Location = "ukwest" - // Westcentralus ... - Westcentralus Location = "westcentralus" - // Westeurope ... - Westeurope Location = "westeurope" - // Westindia ... - Westindia Location = "westindia" - // Westus ... - Westus Location = "westus" - // Westus2 ... - Westus2 Location = "westus2" -) - -// PossibleLocationValues returns an array of possible values for the Location const type. -func PossibleLocationValues() []Location { - return []Location{Australiac, Australiac2, Australiaeast, Australiasoutheast, Brazilsouth, Canadacentral, Canadaeast, Centralindia, Centralus, Eastasia, Eastus, Eastus2, Francecentral, Francesouth, Japaneast, Japanwest, Northcentralus, Northeurope, Southcentralus, Southeastasia, Southindia, Uksouth, Ukwest, Westcentralus, Westeurope, Westindia, Westus, Westus2} -} - -// ProvisioningState enumerates the values for provisioning state. -type ProvisioningState string - -const ( - // BillingFailed ... - BillingFailed ProvisioningState = "BillingFailed" - // Cancelled ... - Cancelled ProvisioningState = "Cancelled" - // ConfirmedBilling ... - ConfirmedBilling ProvisioningState = "ConfirmedBilling" - // ConfirmedResourceHold ... - ConfirmedResourceHold ProvisioningState = "ConfirmedResourceHold" - // Created ... - Created ProvisioningState = "Created" - // Creating ... - Creating ProvisioningState = "Creating" - // Expired ... - Expired ProvisioningState = "Expired" - // Failed ... - Failed ProvisioningState = "Failed" - // Merged ... - Merged ProvisioningState = "Merged" - // PendingBilling ... - PendingBilling ProvisioningState = "PendingBilling" - // PendingResourceHold ... - PendingResourceHold ProvisioningState = "PendingResourceHold" - // Split ... - Split ProvisioningState = "Split" - // Succeeded ... - Succeeded ProvisioningState = "Succeeded" -) - -// PossibleProvisioningStateValues returns an array of possible values for the ProvisioningState const type. -func PossibleProvisioningStateValues() []ProvisioningState { - return []ProvisioningState{BillingFailed, Cancelled, ConfirmedBilling, ConfirmedResourceHold, Created, Creating, Expired, Failed, Merged, PendingBilling, PendingResourceHold, Split, Succeeded} -} - -// ProvisioningState1 enumerates the values for provisioning state 1. -type ProvisioningState1 string - -const ( - // ProvisioningState1BillingFailed ... - ProvisioningState1BillingFailed ProvisioningState1 = "BillingFailed" - // ProvisioningState1Cancelled ... - ProvisioningState1Cancelled ProvisioningState1 = "Cancelled" - // ProvisioningState1ConfirmedBilling ... - ProvisioningState1ConfirmedBilling ProvisioningState1 = "ConfirmedBilling" - // ProvisioningState1ConfirmedResourceHold ... - ProvisioningState1ConfirmedResourceHold ProvisioningState1 = "ConfirmedResourceHold" - // ProvisioningState1Created ... - ProvisioningState1Created ProvisioningState1 = "Created" - // ProvisioningState1Creating ... - ProvisioningState1Creating ProvisioningState1 = "Creating" - // ProvisioningState1Expired ... - ProvisioningState1Expired ProvisioningState1 = "Expired" - // ProvisioningState1Failed ... - ProvisioningState1Failed ProvisioningState1 = "Failed" - // ProvisioningState1Merged ... - ProvisioningState1Merged ProvisioningState1 = "Merged" - // ProvisioningState1PendingBilling ... - ProvisioningState1PendingBilling ProvisioningState1 = "PendingBilling" - // ProvisioningState1PendingResourceHold ... - ProvisioningState1PendingResourceHold ProvisioningState1 = "PendingResourceHold" - // ProvisioningState1Split ... - ProvisioningState1Split ProvisioningState1 = "Split" - // ProvisioningState1Succeeded ... - ProvisioningState1Succeeded ProvisioningState1 = "Succeeded" -) - -// PossibleProvisioningState1Values returns an array of possible values for the ProvisioningState1 const type. -func PossibleProvisioningState1Values() []ProvisioningState1 { - return []ProvisioningState1{ProvisioningState1BillingFailed, ProvisioningState1Cancelled, ProvisioningState1ConfirmedBilling, ProvisioningState1ConfirmedResourceHold, ProvisioningState1Created, ProvisioningState1Creating, ProvisioningState1Expired, ProvisioningState1Failed, ProvisioningState1Merged, ProvisioningState1PendingBilling, ProvisioningState1PendingResourceHold, ProvisioningState1Split, ProvisioningState1Succeeded} +// PossibleReservationTermValues returns an array of possible values for the ReservationTerm const type. +func PossibleReservationTermValues() []ReservationTerm { + return []ReservationTerm{P1Y, P3Y} } // ReservedResourceType enumerates the values for reserved resource type. @@ -398,21 +241,6 @@ func PossibleStatusCodeValues() []StatusCode { return []StatusCode{StatusCodeActive, StatusCodeExpired, StatusCodeMerged, StatusCodeNone, StatusCodePaymentInstrumentError, StatusCodePending, StatusCodePurchaseError, StatusCodeSplit, StatusCodeSucceeded} } -// Term enumerates the values for term. -type Term string - -const ( - // P1Y ... - P1Y Term = "P1Y" - // P3Y ... - P3Y Term = "P3Y" -) - -// PossibleTermValues returns an array of possible values for the Term const type. -func PossibleTermValues() []Term { - return []Term{P1Y, P3Y} -} - // AppliedReservationList ... type AppliedReservationList struct { Value *[]string `json:"value,omitempty"` @@ -513,10 +341,10 @@ type Catalog struct { // Name - The name of SKU Name *string `json:"name,omitempty"` // Terms - Available reservation terms for this resource - Terms *[]string `json:"terms,omitempty"` - Locations *[]string `json:"locations,omitempty"` - SkuProperties *[]SkuProperty `json:"skuProperties,omitempty"` - Restrictions *[]SkuRestriction `json:"restrictions,omitempty"` + Terms *[]ReservationTerm `json:"terms,omitempty"` + Locations *[]string `json:"locations,omitempty"` + SkuProperties *[]SkuProperty `json:"skuProperties,omitempty"` + Restrictions *[]SkuRestriction `json:"restrictions,omitempty"` } // Error ... @@ -527,8 +355,8 @@ type Error struct { // ExtendedErrorInfo ... type ExtendedErrorInfo struct { // Code - Possible values include: 'NotSpecified', 'InternalServerError', 'ServerTimeout', 'AuthorizationFailed', 'BadRequest', 'ClientCertificateThumbprintNotSet', 'InvalidRequestContent', 'OperationFailed', 'HTTPMethodNotSupported', 'InvalidRequestURI', 'MissingTenantID', 'InvalidTenantID', 'InvalidReservationOrderID', 'InvalidReservationID', 'ReservationIDNotInReservationOrder', 'ReservationOrderNotFound', 'InvalidSubscriptionID', 'InvalidAccessToken', 'InvalidLocationID', 'UnauthenticatedRequestsThrottled', 'InvalidHealthCheckType', 'Forbidden', 'BillingScopeIDCannotBeChanged', 'AppliedScopesNotAssociatedWithCommerceAccount', 'PatchValuesSameAsExisting', 'RoleAssignmentCreationFailed', 'ReservationOrderCreationFailed', 'ReservationOrderNotEnabled', 'CapacityUpdateScopesFailed', 'UnsupportedReservationTerm', 'ReservationOrderIDAlreadyExists', 'RiskCheckFailed', 'CreateQuoteFailed', 'ActivateQuoteFailed', 'NonsupportedAccountID', 'PaymentInstrumentNotFound', 'MissingAppliedScopesForSingle', 'NoValidReservationsToReRate', 'ReRateOnlyAllowedForEA', 'OperationCannotBePerformedInCurrentState', 'InvalidSingleAppliedScopesCount', 'InvalidFulfillmentRequestParameters', 'NotSupportedCountry', 'InvalidRefundQuantity', 'PurchaseError', 'BillingCustomerInputError', 'BillingPaymentInstrumentSoftError', 'BillingPaymentInstrumentHardError', 'BillingTransientError', 'BillingError', 'FulfillmentConfigurationError', 'FulfillmentOutOfStockError', 'FulfillmentTransientError', 'FulfillmentError', 'CalculatePriceFailed' - Code Code `json:"code,omitempty"` - Message *string `json:"message,omitempty"` + Code ErrorResponseCode `json:"code,omitempty"` + Message *string `json:"message,omitempty"` } // ExtendedStatusInfo ... @@ -934,10 +762,10 @@ type OrderProperties struct { // OriginalQuantity - Total Quantity of the SKUs purchased in the Reservation. OriginalQuantity *int32 `json:"originalQuantity,omitempty"` // Term - Possible values include: 'P1Y', 'P3Y' - Term Term `json:"term,omitempty"` - // ProvisioningState - Possible values include: 'ProvisioningState1Creating', 'ProvisioningState1PendingResourceHold', 'ProvisioningState1ConfirmedResourceHold', 'ProvisioningState1PendingBilling', 'ProvisioningState1ConfirmedBilling', 'ProvisioningState1Created', 'ProvisioningState1Succeeded', 'ProvisioningState1Cancelled', 'ProvisioningState1Expired', 'ProvisioningState1BillingFailed', 'ProvisioningState1Failed', 'ProvisioningState1Split', 'ProvisioningState1Merged' - ProvisioningState ProvisioningState1 `json:"provisioningState,omitempty"` - ReservationsProperty *[]Response `json:"reservations,omitempty"` + Term ReservationTerm `json:"term,omitempty"` + // ProvisioningState - Current state of the reservation. + ProvisioningState *string `json:"provisioningState,omitempty"` + ReservationsProperty *[]Response `json:"reservations,omitempty"` } // OrderResponse ... @@ -1074,11 +902,11 @@ func (p *Patch) UnmarshalJSON(body []byte) error { // PatchProperties ... type PatchProperties struct { - // AppliedScopeType - Possible values include: 'AppliedScopeType1Single', 'AppliedScopeType1Shared' - AppliedScopeType AppliedScopeType1 `json:"appliedScopeType,omitempty"` - AppliedScopes *[]string `json:"appliedScopes,omitempty"` - // InstanceFlexibility - Possible values include: 'InstanceFlexibility1On', 'InstanceFlexibility1Off', 'InstanceFlexibility1NotSupported' - InstanceFlexibility InstanceFlexibility1 `json:"instanceFlexibility,omitempty"` + // AppliedScopeType - Possible values include: 'Single', 'Shared' + AppliedScopeType AppliedScopeType `json:"appliedScopeType,omitempty"` + AppliedScopes *[]string `json:"appliedScopes,omitempty"` + // InstanceFlexibility - Possible values include: 'On', 'Off', 'NotSupported' + InstanceFlexibility InstanceFlexibility `json:"instanceFlexibility,omitempty"` } // Properties ... @@ -1094,8 +922,8 @@ type Properties struct { AppliedScopeType AppliedScopeType `json:"appliedScopeType,omitempty"` // Quantity - Quantity of the SKUs that are part of the Reservation. Quantity *int32 `json:"quantity,omitempty"` - // ProvisioningState - Possible values include: 'Creating', 'PendingResourceHold', 'ConfirmedResourceHold', 'PendingBilling', 'ConfirmedBilling', 'Created', 'Succeeded', 'Cancelled', 'Expired', 'BillingFailed', 'Failed', 'Split', 'Merged' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // ProvisioningState - Current state of the reservation. + ProvisioningState *string `json:"provisioningState,omitempty"` // EffectiveDateTime - DateTime of the Reservation starting when this version is effective from. EffectiveDateTime *date.Time `json:"effectiveDateTime,omitempty"` // LastUpdatedDateTime - DateTime of the last time the Reservation was updated. @@ -1168,9 +996,9 @@ func (future *ReservationUpdateFuture) Result(client Client) (r Response, err er // Response ... type Response struct { autorest.Response `json:"-"` - // Location - Possible values include: 'Westus', 'Eastus', 'Eastus2', 'Northcentralus', 'Westus2', 'Southcentralus', 'Centralus', 'Westeurope', 'Northeurope', 'Eastasia', 'Southeastasia', 'Japaneast', 'Japanwest', 'Brazilsouth', 'Australiaeast', 'Australiasoutheast', 'Southindia', 'Westindia', 'Centralindia', 'Canadacentral', 'Canadaeast', 'Uksouth', 'Westcentralus', 'Ukwest', 'Francecentral', 'Francesouth', 'Australiac', 'Australiac2' - Location Location `json:"location,omitempty"` - Etag *int32 `json:"etag,omitempty"` + // Location - The Azure Region where the reserved resource lives. + Location *string `json:"location,omitempty"` + Etag *int32 `json:"etag,omitempty"` // ID - Identifier of the reservation ID *string `json:"id,omitempty"` // Name - Name of the reservation diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-03-01/policy/definitions.go b/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-03-01/policy/definitions.go index 438d5668f..d75b2eba9 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-03-01/policy/definitions.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-03-01/policy/definitions.go @@ -680,7 +680,7 @@ func (client DefinitionsClient) ListBuiltInComplete(ctx context.Context) (result return } -// ListByManagementGroup gets all the policy definitions in a management group. +// ListByManagementGroup this operation retrieves a list of all the policy definitions in a given management group. // Parameters: // managementGroupID - the ID of the management group. func (client DefinitionsClient) ListByManagementGroup(ctx context.Context, managementGroupID string) (result DefinitionListResultPage, err error) { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-03-01/policy/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-03-01/policy/models.go index f90fd7939..56c7df2ce 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-03-01/policy/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-03-01/policy/models.go @@ -69,7 +69,7 @@ type Assignment struct { Type *string `json:"type,omitempty"` // Name - The name of the policy assignment. Name *string `json:"name,omitempty"` - // Sku - The policy sku. + // Sku - The policy sku. This property is optional, obsolete, and will be ignored. Sku *Sku `json:"sku,omitempty"` } @@ -260,7 +260,7 @@ func (page AssignmentListResultPage) Values() []Assignment { type AssignmentProperties struct { // DisplayName - The display name of the policy assignment. DisplayName *string `json:"displayName,omitempty"` - // PolicyDefinitionID - The ID of the policy definition. + // PolicyDefinitionID - The ID of the policy definition or policy set definition being assigned. PolicyDefinitionID *string `json:"policyDefinitionId,omitempty"` // Scope - The scope for the policy assignment. Scope *string `json:"scope,omitempty"` @@ -484,8 +484,8 @@ type DefinitionReference struct { Parameters interface{} `json:"parameters,omitempty"` } -// ErrorResponse error reponse indicates ARM is not able to process the incoming request. The reason is provided in -// the error message. +// ErrorResponse error reponse indicates Azure Resource Manager is not able to process the incoming request. The +// reason is provided in the error message. type ErrorResponse struct { // HTTPStatus - Http status code. HTTPStatus *string `json:"httpStatus,omitempty"` @@ -695,7 +695,7 @@ type SetDefinitionProperties struct { PolicyDefinitions *[]DefinitionReference `json:"policyDefinitions,omitempty"` } -// Sku the policy sku. +// Sku the policy sku. This property is optional, obsolete, and will be ignored. type Sku struct { // Name - The name of the policy sku. Possible values are A0 and A1. Name *string `json:"name,omitempty"` diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/scheduler/mgmt/2016-03-01/scheduler/jobs.go b/vendor/github.com/Azure/azure-sdk-for-go/services/scheduler/mgmt/2016-03-01/scheduler/jobs.go index 047ea31ca..08bd112af 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/scheduler/mgmt/2016-03-01/scheduler/jobs.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/scheduler/mgmt/2016-03-01/scheduler/jobs.go @@ -260,7 +260,7 @@ func (client JobsClient) List(ctx context.Context, resourceGroupName string, job if err := validation.Validate([]validation.Validation{ {TargetValue: top, Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: 100, Chain: nil}, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: int64(100), Chain: nil}, {Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("scheduler.JobsClient", "List", err.Error()) @@ -377,7 +377,7 @@ func (client JobsClient) ListJobHistory(ctx context.Context, resourceGroupName s if err := validation.Validate([]validation.Validation{ {TargetValue: top, Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: 100, Chain: nil}, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: int64(100), Chain: nil}, {Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("scheduler.JobsClient", "ListJobHistory", err.Error()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/search/mgmt/2015-08-19/search/services.go b/vendor/github.com/Azure/azure-sdk-for-go/services/search/mgmt/2015-08-19/search/services.go index 56ddc928d..7a3240c47 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/search/mgmt/2015-08-19/search/services.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/search/mgmt/2015-08-19/search/services.go @@ -139,11 +139,11 @@ func (client ServicesClient) CreateOrUpdate(ctx context.Context, resourceGroupNa {TargetValue: service, Constraints: []validation.Constraint{{Target: "service.ServiceProperties", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "service.ServiceProperties.ReplicaCount", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "service.ServiceProperties.ReplicaCount", Name: validation.InclusiveMaximum, Rule: 12, Chain: nil}, + Chain: []validation.Constraint{{Target: "service.ServiceProperties.ReplicaCount", Name: validation.InclusiveMaximum, Rule: int64(12), Chain: nil}, {Target: "service.ServiceProperties.ReplicaCount", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}, {Target: "service.ServiceProperties.PartitionCount", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "service.ServiceProperties.PartitionCount", Name: validation.InclusiveMaximum, Rule: 12, Chain: nil}, + Chain: []validation.Constraint{{Target: "service.ServiceProperties.PartitionCount", Name: validation.InclusiveMaximum, Rule: int64(12), Chain: nil}, {Target: "service.ServiceProperties.PartitionCount", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}, }}}}}); err != nil { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/servicebus/mgmt/2017-04-01/servicebus/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/servicebus/mgmt/2017-04-01/servicebus/models.go index b65c94052..be823f3af 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/servicebus/mgmt/2017-04-01/servicebus/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/servicebus/mgmt/2017-04-01/servicebus/models.go @@ -427,6 +427,8 @@ func (page ArmDisasterRecoveryListResultPage) Values() []ArmDisasterRecovery { type ArmDisasterRecoveryProperties struct { // ProvisioningState - Provisioning state of the Alias(Disaster Recovery configuration) - possible values 'Accepted' or 'Succeeded' or 'Failed'. Possible values include: 'Accepted', 'Succeeded', 'Failed' ProvisioningState ProvisioningStateDR `json:"provisioningState,omitempty"` + // PendingReplicationOperationsCount - Number of entities pending to be replicated. + PendingReplicationOperationsCount *int64 `json:"pendingReplicationOperationsCount,omitempty"` // PartnerNamespace - ARM Id of the Primary/Secondary eventhub namespace name, which is part of GEO DR pairning PartnerNamespace *string `json:"partnerNamespace,omitempty"` // AlternateName - Primary/Secondary eventhub namespace name, which is part of GEO DR pairning @@ -1008,6 +1010,8 @@ func (mcp *MigrationConfigProperties) UnmarshalJSON(body []byte) error { type MigrationConfigPropertiesProperties struct { // ProvisioningState - Provisioning state of Migration Configuration ProvisioningState *string `json:"provisioningState,omitempty"` + // PendingReplicationOperationsCount - Number of entities pending to be replicated. + PendingReplicationOperationsCount *int64 `json:"pendingReplicationOperationsCount,omitempty"` // TargetNamespace - Existing premium Namespace ARM Id name which has no entities, will be used for migration TargetNamespace *string `json:"targetNamespace,omitempty"` // PostMigrationName - Name to access Standard Namespace after migration diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/servicebus/mgmt/2017-04-01/servicebus/queues.go b/vendor/github.com/Azure/azure-sdk-for-go/services/servicebus/mgmt/2017-04-01/servicebus/queues.go index 63588cc11..78843ee98 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/servicebus/mgmt/2017-04-01/servicebus/queues.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/servicebus/mgmt/2017-04-01/servicebus/queues.go @@ -675,12 +675,12 @@ func (client QueuesClient) ListByNamespace(ctx context.Context, resourceGroupNam {Target: "namespaceName", Name: validation.MinLength, Rule: 6, Chain: nil}}}, {TargetValue: skip, Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, + Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMaximum, Rule: int64(1000), Chain: nil}, {Target: "skip", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, }}}}, {TargetValue: top, Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: int64(1000), Chain: nil}, {Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicebus.QueuesClient", "ListByNamespace", err.Error()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/servicebus/mgmt/2017-04-01/servicebus/rules.go b/vendor/github.com/Azure/azure-sdk-for-go/services/servicebus/mgmt/2017-04-01/servicebus/rules.go index ecd6ca245..4cbe705fa 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/servicebus/mgmt/2017-04-01/servicebus/rules.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/servicebus/mgmt/2017-04-01/servicebus/rules.go @@ -340,12 +340,12 @@ func (client RulesClient) ListBySubscriptions(ctx context.Context, resourceGroup {Target: "subscriptionName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: skip, Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, + Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMaximum, Rule: int64(1000), Chain: nil}, {Target: "skip", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, }}}}, {TargetValue: top, Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: int64(1000), Chain: nil}, {Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicebus.RulesClient", "ListBySubscriptions", err.Error()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/servicebus/mgmt/2017-04-01/servicebus/subscriptions.go b/vendor/github.com/Azure/azure-sdk-for-go/services/servicebus/mgmt/2017-04-01/servicebus/subscriptions.go index c0b63ff12..1a087cb81 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/servicebus/mgmt/2017-04-01/servicebus/subscriptions.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/servicebus/mgmt/2017-04-01/servicebus/subscriptions.go @@ -321,12 +321,12 @@ func (client SubscriptionsClient) ListByTopic(ctx context.Context, resourceGroup Constraints: []validation.Constraint{{Target: "topicName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: skip, Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, + Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMaximum, Rule: int64(1000), Chain: nil}, {Target: "skip", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, }}}}, {TargetValue: top, Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: int64(1000), Chain: nil}, {Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicebus.SubscriptionsClient", "ListByTopic", err.Error()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/servicebus/mgmt/2017-04-01/servicebus/topics.go b/vendor/github.com/Azure/azure-sdk-for-go/services/servicebus/mgmt/2017-04-01/servicebus/topics.go index 85b93c821..ce8b0c1a9 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/servicebus/mgmt/2017-04-01/servicebus/topics.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/servicebus/mgmt/2017-04-01/servicebus/topics.go @@ -675,12 +675,12 @@ func (client TopicsClient) ListByNamespace(ctx context.Context, resourceGroupNam {Target: "namespaceName", Name: validation.MinLength, Rule: 6, Chain: nil}}}, {TargetValue: skip, Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, + Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMaximum, Rule: int64(1000), Chain: nil}, {Target: "skip", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, }}}}, {TargetValue: top, Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil}, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: int64(1000), Chain: nil}, {Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicebus.TopicsClient", "ListByNamespace", err.Error()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/servicefabric/5.6/servicefabric/client.go b/vendor/github.com/Azure/azure-sdk-for-go/services/servicefabric/5.6/servicefabric/client.go index 28f857bc8..4fafa18b0 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/servicefabric/5.6/servicefabric/client.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/servicefabric/5.6/servicefabric/client.go @@ -85,7 +85,7 @@ func (client BaseClient) CancelOperation(ctx context.Context, operationID uuid.U if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "CancelOperation", err.Error()) @@ -167,7 +167,7 @@ func (client BaseClient) CopyImageStoreContent(ctx context.Context, imageStoreCo {Target: "imageStoreCopyDescription.RemoteDestination", Name: validation.Null, Rule: true, Chain: nil}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "CopyImageStoreContent", err.Error()) @@ -255,7 +255,7 @@ func (client BaseClient) CreateApplication(ctx context.Context, applicationDescr }}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "CreateApplication", err.Error()) @@ -336,7 +336,7 @@ func (client BaseClient) CreateComposeApplication(ctx context.Context, createCom {Target: "createComposeApplicationDescription.ComposeFileContent", Name: validation.Null, Rule: true, Chain: nil}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "CreateComposeApplication", err.Error()) @@ -420,7 +420,7 @@ func (client BaseClient) CreateService(ctx context.Context, applicationID string {Target: "serviceDescription.PartitionDescription", Name: validation.Null, Rule: true, Chain: nil}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "CreateService", err.Error()) @@ -510,7 +510,7 @@ func (client BaseClient) CreateServiceFromTemplate(ctx context.Context, applicat {Target: "serviceFromTemplateDescription.ServiceTypeName", Name: validation.Null, Rule: true, Chain: nil}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "CreateServiceFromTemplate", err.Error()) @@ -601,7 +601,7 @@ func (client BaseClient) DeleteApplication(ctx context.Context, applicationID st if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "DeleteApplication", err.Error()) @@ -685,7 +685,7 @@ func (client BaseClient) DeleteImageStoreContent(ctx context.Context, contentPat if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "DeleteImageStoreContent", err.Error()) @@ -772,7 +772,7 @@ func (client BaseClient) DeleteService(ctx context.Context, serviceID string, fo if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "DeleteService", err.Error()) @@ -863,7 +863,7 @@ func (client BaseClient) DeployedServicePackageToNode(ctx context.Context, nodeN {Target: "deployServicePackageToNodeDescription.NodeName", Name: validation.Null, Rule: true, Chain: nil}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "DeployedServicePackageToNode", err.Error()) @@ -951,7 +951,7 @@ func (client BaseClient) DisableNode(ctx context.Context, nodeName string, deact if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "DisableNode", err.Error()) @@ -1035,7 +1035,7 @@ func (client BaseClient) EnableNode(ctx context.Context, nodeName string, timeou if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "EnableNode", err.Error()) @@ -1116,7 +1116,7 @@ func (client BaseClient) GetAadMetadata(ctx context.Context, timeout *int64) (re if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetAadMetadata", err.Error()) @@ -1245,7 +1245,7 @@ func (client BaseClient) GetApplicationHealth(ctx context.Context, applicationID if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetApplicationHealth", err.Error()) @@ -1398,7 +1398,7 @@ func (client BaseClient) GetApplicationHealthUsingPolicy(ctx context.Context, ap if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetApplicationHealthUsingPolicy", err.Error()) @@ -1504,7 +1504,7 @@ func (client BaseClient) GetApplicationInfo(ctx context.Context, applicationID s if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetApplicationInfo", err.Error()) @@ -1601,7 +1601,7 @@ func (client BaseClient) GetApplicationInfoList(ctx context.Context, application if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetApplicationInfoList", err.Error()) @@ -1691,7 +1691,7 @@ func (client BaseClient) GetApplicationManifest(ctx context.Context, application if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetApplicationManifest", err.Error()) @@ -1775,7 +1775,7 @@ func (client BaseClient) GetApplicationNameInfo(ctx context.Context, serviceID s if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetApplicationNameInfo", err.Error()) @@ -1877,7 +1877,7 @@ func (client BaseClient) GetApplicationTypeInfoList(ctx context.Context, exclude Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetApplicationTypeInfoList", err.Error()) @@ -1991,7 +1991,7 @@ func (client BaseClient) GetApplicationTypeInfoListByName(ctx context.Context, a Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetApplicationTypeInfoListByName", err.Error()) @@ -2087,7 +2087,7 @@ func (client BaseClient) GetApplicationUpgrade(ctx context.Context, applicationI if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetApplicationUpgrade", err.Error()) @@ -2185,7 +2185,7 @@ func (client BaseClient) GetChaosReport(ctx context.Context, continuationToken s if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetChaosReport", err.Error()) @@ -2326,7 +2326,7 @@ func (client BaseClient) GetClusterHealth(ctx context.Context, nodesHealthStateF if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetClusterHealth", err.Error()) @@ -2420,7 +2420,7 @@ func (client BaseClient) GetClusterHealthChunk(ctx context.Context, timeout *int if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetClusterHealthChunk", err.Error()) @@ -2518,7 +2518,7 @@ func (client BaseClient) GetClusterHealthChunkUsingPolicyAndAdvancedFilters(ctx if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetClusterHealthChunkUsingPolicyAndAdvancedFilters", err.Error()) @@ -2664,7 +2664,7 @@ func (client BaseClient) GetClusterHealthUsingPolicy(ctx context.Context, nodesH if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetClusterHealthUsingPolicy", err.Error()) @@ -2770,7 +2770,7 @@ func (client BaseClient) GetClusterManifest(ctx context.Context, timeout *int64) if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetClusterManifest", err.Error()) @@ -2847,7 +2847,7 @@ func (client BaseClient) GetClusterUpgradeProgress(ctx context.Context, timeout if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetClusterUpgradeProgress", err.Error()) @@ -2927,7 +2927,7 @@ func (client BaseClient) GetComposeApplicationStatus(ctx context.Context, applic if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetComposeApplicationStatus", err.Error()) @@ -3023,7 +3023,7 @@ func (client BaseClient) GetComposeApplicationStatusList(ctx context.Context, co Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetComposeApplicationStatusList", err.Error()) @@ -3112,7 +3112,7 @@ func (client BaseClient) GetDataLossProgress(ctx context.Context, serviceID stri if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetDataLossProgress", err.Error()) @@ -3233,7 +3233,7 @@ func (client BaseClient) GetDeployedApplicationHealth(ctx context.Context, nodeN if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetDeployedApplicationHealth", err.Error()) @@ -3370,7 +3370,7 @@ func (client BaseClient) GetDeployedApplicationHealthUsingPolicy(ctx context.Con if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetDeployedApplicationHealthUsingPolicy", err.Error()) @@ -3469,7 +3469,7 @@ func (client BaseClient) GetDeployedApplicationInfo(ctx context.Context, nodeNam if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetDeployedApplicationInfo", err.Error()) @@ -3551,7 +3551,7 @@ func (client BaseClient) GetDeployedApplicationInfoList(ctx context.Context, nod if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetDeployedApplicationInfoList", err.Error()) @@ -3639,7 +3639,7 @@ func (client BaseClient) GetDeployedCodePackageInfoList(ctx context.Context, nod if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetDeployedCodePackageInfoList", err.Error()) @@ -3747,7 +3747,7 @@ func (client BaseClient) GetDeployedServicePackageHealth(ctx context.Context, no if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetDeployedServicePackageHealth", err.Error()) @@ -3862,7 +3862,7 @@ func (client BaseClient) GetDeployedServicePackageHealthUsingPolicy(ctx context. if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetDeployedServicePackageHealthUsingPolicy", err.Error()) @@ -3958,7 +3958,7 @@ func (client BaseClient) GetDeployedServicePackageInfoList(ctx context.Context, if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetDeployedServicePackageInfoList", err.Error()) @@ -4045,7 +4045,7 @@ func (client BaseClient) GetDeployedServicePackageInfoListByName(ctx context.Con if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetDeployedServicePackageInfoListByName", err.Error()) @@ -4132,7 +4132,7 @@ func (client BaseClient) GetDeployedServiceReplicaDetailInfo(ctx context.Context if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetDeployedServiceReplicaDetailInfo", err.Error()) @@ -4223,7 +4223,7 @@ func (client BaseClient) GetDeployedServiceReplicaInfoList(ctx context.Context, if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetDeployedServiceReplicaInfoList", err.Error()) @@ -4319,7 +4319,7 @@ func (client BaseClient) GetDeployedServiceTypeInfoByName(ctx context.Context, n if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetDeployedServiceTypeInfoByName", err.Error()) @@ -4412,7 +4412,7 @@ func (client BaseClient) GetDeployedServiceTypeInfoList(ctx context.Context, nod if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetDeployedServiceTypeInfoList", err.Error()) @@ -4510,7 +4510,7 @@ func (client BaseClient) GetFaultOperationList(ctx context.Context, typeFilter i if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetFaultOperationList", err.Error()) @@ -4590,7 +4590,7 @@ func (client BaseClient) GetImageStoreContent(ctx context.Context, contentPath s if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetImageStoreContent", err.Error()) @@ -4670,7 +4670,7 @@ func (client BaseClient) GetImageStoreRootContent(ctx context.Context, timeout * if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetImageStoreRootContent", err.Error()) @@ -4764,7 +4764,7 @@ func (client BaseClient) GetNodeHealth(ctx context.Context, nodeName string, eve if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetNodeHealth", err.Error()) @@ -4870,7 +4870,7 @@ func (client BaseClient) GetNodeHealthUsingPolicy(ctx context.Context, nodeName if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetNodeHealthUsingPolicy", err.Error()) @@ -4962,7 +4962,7 @@ func (client BaseClient) GetNodeInfo(ctx context.Context, nodeName string, timeo if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetNodeInfo", err.Error()) @@ -5066,7 +5066,7 @@ func (client BaseClient) GetNodeInfoList(ctx context.Context, continuationToken if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetNodeInfoList", err.Error()) @@ -5151,7 +5151,7 @@ func (client BaseClient) GetNodeLoadInfo(ctx context.Context, nodeName string, t if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetNodeLoadInfo", err.Error()) @@ -5235,7 +5235,7 @@ func (client BaseClient) GetNodeTransitionProgress(ctx context.Context, nodeName if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetNodeTransitionProgress", err.Error()) @@ -5351,7 +5351,7 @@ func (client BaseClient) GetPartitionHealth(ctx context.Context, partitionID uui if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetPartitionHealth", err.Error()) @@ -5484,7 +5484,7 @@ func (client BaseClient) GetPartitionHealthUsingPolicy(ctx context.Context, part if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetPartitionHealthUsingPolicy", err.Error()) @@ -5582,7 +5582,7 @@ func (client BaseClient) GetPartitionInfo(ctx context.Context, partitionID uuid. if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetPartitionInfo", err.Error()) @@ -5671,7 +5671,7 @@ func (client BaseClient) GetPartitionInfoList(ctx context.Context, serviceID str if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetPartitionInfoList", err.Error()) @@ -5757,7 +5757,7 @@ func (client BaseClient) GetPartitionLoadInformation(ctx context.Context, partit if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetPartitionLoadInformation", err.Error()) @@ -5843,7 +5843,7 @@ func (client BaseClient) GetPartitionRestartProgress(ctx context.Context, servic if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetPartitionRestartProgress", err.Error()) @@ -5928,7 +5928,7 @@ func (client BaseClient) GetProvisionedFabricCodeVersionInfoList(ctx context.Con if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetProvisionedFabricCodeVersionInfoList", err.Error()) @@ -6010,7 +6010,7 @@ func (client BaseClient) GetProvisionedFabricConfigVersionInfoList(ctx context.C if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetProvisionedFabricConfigVersionInfoList", err.Error()) @@ -6095,7 +6095,7 @@ func (client BaseClient) GetQuorumLossProgress(ctx context.Context, serviceID st if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetQuorumLossProgress", err.Error()) @@ -6196,7 +6196,7 @@ func (client BaseClient) GetReplicaHealth(ctx context.Context, partitionID uuid. if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetReplicaHealth", err.Error()) @@ -6309,7 +6309,7 @@ func (client BaseClient) GetReplicaHealthUsingPolicy(ctx context.Context, partit if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetReplicaHealthUsingPolicy", err.Error()) @@ -6408,7 +6408,7 @@ func (client BaseClient) GetReplicaInfo(ctx context.Context, partitionID uuid.UU if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetReplicaInfo", err.Error()) @@ -6499,7 +6499,7 @@ func (client BaseClient) GetReplicaInfoList(ctx context.Context, partitionID uui if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetReplicaInfoList", err.Error()) @@ -6585,7 +6585,7 @@ func (client BaseClient) GetServiceDescription(ctx context.Context, serviceID st if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetServiceDescription", err.Error()) @@ -6703,7 +6703,7 @@ func (client BaseClient) GetServiceHealth(ctx context.Context, serviceID string, if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetServiceHealth", err.Error()) @@ -6838,7 +6838,7 @@ func (client BaseClient) GetServiceHealthUsingPolicy(ctx context.Context, servic if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetServiceHealthUsingPolicy", err.Error()) @@ -6938,7 +6938,7 @@ func (client BaseClient) GetServiceInfo(ctx context.Context, applicationID strin if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetServiceInfo", err.Error()) @@ -7028,7 +7028,7 @@ func (client BaseClient) GetServiceInfoList(ctx context.Context, applicationID s if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetServiceInfoList", err.Error()) @@ -7119,7 +7119,7 @@ func (client BaseClient) GetServiceManifest(ctx context.Context, applicationType if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetServiceManifest", err.Error()) @@ -7202,7 +7202,7 @@ func (client BaseClient) GetServiceNameInfo(ctx context.Context, partitionID uui if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetServiceNameInfo", err.Error()) @@ -7287,7 +7287,7 @@ func (client BaseClient) GetServiceTypeInfoList(ctx context.Context, application if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetServiceTypeInfoList", err.Error()) @@ -7379,7 +7379,7 @@ func (client BaseClient) InvokeInfrastructureCommand(ctx context.Context, comman if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "InvokeInfrastructureCommand", err.Error()) @@ -7469,7 +7469,7 @@ func (client BaseClient) InvokeInfrastructureQuery(ctx context.Context, command if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "InvokeInfrastructureQuery", err.Error()) @@ -7553,7 +7553,7 @@ func (client BaseClient) ProvisionApplicationType(ctx context.Context, applicati Constraints: []validation.Constraint{{Target: "applicationTypeImageStorePath.ApplicationTypeBuildPath", Name: validation.Null, Rule: true, Chain: nil}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "ProvisionApplicationType", err.Error()) @@ -7633,7 +7633,7 @@ func (client BaseClient) RecoverAllPartitions(ctx context.Context, timeout *int6 if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "RecoverAllPartitions", err.Error()) @@ -7711,7 +7711,7 @@ func (client BaseClient) RecoverPartition(ctx context.Context, partitionID uuid. if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "RecoverPartition", err.Error()) @@ -7794,7 +7794,7 @@ func (client BaseClient) RecoverServicePartitions(ctx context.Context, serviceID if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "RecoverServicePartitions", err.Error()) @@ -7875,7 +7875,7 @@ func (client BaseClient) RecoverSystemPartitions(ctx context.Context, timeout *i if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "RecoverSystemPartitions", err.Error()) @@ -7953,7 +7953,7 @@ func (client BaseClient) RemoveComposeApplication(ctx context.Context, applicati if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "RemoveComposeApplication", err.Error()) @@ -8038,7 +8038,7 @@ func (client BaseClient) RemoveNodeState(ctx context.Context, nodeName string, t if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "RemoveNodeState", err.Error()) @@ -8128,7 +8128,7 @@ func (client BaseClient) RemoveReplica(ctx context.Context, nodeName string, par if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "RemoveReplica", err.Error()) @@ -8225,7 +8225,7 @@ func (client BaseClient) ReportApplicationHealth(ctx context.Context, applicatio {Target: "healthInformation.Property", Name: validation.Null, Rule: true, Chain: nil}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "ReportApplicationHealth", err.Error()) @@ -8317,7 +8317,7 @@ func (client BaseClient) ReportClusterHealth(ctx context.Context, healthInformat {Target: "healthInformation.Property", Name: validation.Null, Rule: true, Chain: nil}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "ReportClusterHealth", err.Error()) @@ -8408,7 +8408,7 @@ func (client BaseClient) ReportDeployedApplicationHealth(ctx context.Context, no {Target: "healthInformation.Property", Name: validation.Null, Rule: true, Chain: nil}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "ReportDeployedApplicationHealth", err.Error()) @@ -8506,7 +8506,7 @@ func (client BaseClient) ReportDeployedServicePackageHealth(ctx context.Context, {Target: "healthInformation.Property", Name: validation.Null, Rule: true, Chain: nil}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "ReportDeployedServicePackageHealth", err.Error()) @@ -8601,7 +8601,7 @@ func (client BaseClient) ReportNodeHealth(ctx context.Context, nodeName string, {Target: "healthInformation.Property", Name: validation.Null, Rule: true, Chain: nil}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "ReportNodeHealth", err.Error()) @@ -8694,7 +8694,7 @@ func (client BaseClient) ReportPartitionHealth(ctx context.Context, partitionID {Target: "healthInformation.Property", Name: validation.Null, Rule: true, Chain: nil}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "ReportPartitionHealth", err.Error()) @@ -8793,7 +8793,7 @@ func (client BaseClient) ReportReplicaHealth(ctx context.Context, partitionID uu {Target: "healthInformation.Property", Name: validation.Null, Rule: true, Chain: nil}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "ReportReplicaHealth", err.Error()) @@ -8889,7 +8889,7 @@ func (client BaseClient) ReportServiceHealth(ctx context.Context, serviceID stri {Target: "healthInformation.Property", Name: validation.Null, Rule: true, Chain: nil}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "ReportServiceHealth", err.Error()) @@ -8971,7 +8971,7 @@ func (client BaseClient) ResetPartitionLoad(ctx context.Context, partitionID uui if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "ResetPartitionLoad", err.Error()) @@ -9064,7 +9064,7 @@ func (client BaseClient) ResolveService(ctx context.Context, serviceID string, p if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "ResolveService", err.Error()) @@ -9159,7 +9159,7 @@ func (client BaseClient) RestartDeployedCodePackage(ctx context.Context, nodeNam if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "RestartDeployedCodePackage", err.Error()) @@ -9246,7 +9246,7 @@ func (client BaseClient) RestartNode(ctx context.Context, nodeName string, resta Constraints: []validation.Constraint{{Target: "restartNodeDescription.NodeInstanceID", Name: validation.Null, Rule: true, Chain: nil}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "RestartNode", err.Error()) @@ -9332,7 +9332,7 @@ func (client BaseClient) RestartReplica(ctx context.Context, nodeName string, pa if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "RestartReplica", err.Error()) @@ -9420,7 +9420,7 @@ func (client BaseClient) ResumeApplicationUpgrade(ctx context.Context, applicati Constraints: []validation.Constraint{{Target: "resumeApplicationUpgradeDescription.UpgradeDomainName", Name: validation.Null, Rule: true, Chain: nil}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "ResumeApplicationUpgrade", err.Error()) @@ -9506,7 +9506,7 @@ func (client BaseClient) RollbackApplicationUpgrade(ctx context.Context, applica if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "RollbackApplicationUpgrade", err.Error()) @@ -9593,7 +9593,7 @@ func (client BaseClient) StartApplicationUpgrade(ctx context.Context, applicatio {Target: "applicationUpgradeDescription.Parameters", Name: validation.Null, Rule: true, Chain: nil}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "StartApplicationUpgrade", err.Error()) @@ -9679,24 +9679,24 @@ func (client BaseClient) StartChaos(ctx context.Context, chaosParameters ChaosPa if err := validation.Validate([]validation.Validation{ {TargetValue: chaosParameters, Constraints: []validation.Constraint{{Target: "chaosParameters.MaxClusterStabilizationTimeoutInSeconds", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "chaosParameters.MaxClusterStabilizationTimeoutInSeconds", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "chaosParameters.MaxClusterStabilizationTimeoutInSeconds", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "chaosParameters.MaxClusterStabilizationTimeoutInSeconds", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, }}, {Target: "chaosParameters.MaxConcurrentFaults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "chaosParameters.MaxConcurrentFaults", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "chaosParameters.MaxConcurrentFaults", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "chaosParameters.MaxConcurrentFaults", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, }}, {Target: "chaosParameters.WaitTimeBetweenFaultsInSeconds", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "chaosParameters.WaitTimeBetweenFaultsInSeconds", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "chaosParameters.WaitTimeBetweenFaultsInSeconds", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "chaosParameters.WaitTimeBetweenFaultsInSeconds", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, }}, {Target: "chaosParameters.WaitTimeBetweenIterationsInSeconds", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "chaosParameters.WaitTimeBetweenIterationsInSeconds", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "chaosParameters.WaitTimeBetweenIterationsInSeconds", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "chaosParameters.WaitTimeBetweenIterationsInSeconds", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, }}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "StartChaos", err.Error()) @@ -9799,7 +9799,7 @@ func (client BaseClient) StartDataLoss(ctx context.Context, serviceID string, pa if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "StartDataLoss", err.Error()) @@ -9885,7 +9885,7 @@ func (client BaseClient) StartNode(ctx context.Context, nodeName string, startNo Constraints: []validation.Constraint{{Target: "startNodeDescription.NodeInstanceID", Name: validation.Null, Rule: true, Chain: nil}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "StartNode", err.Error()) @@ -9983,7 +9983,7 @@ func (client BaseClient) StartNodeTransition(ctx context.Context, nodeName strin Constraints: []validation.Constraint{{Target: "stopDurationInSeconds", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "StartNodeTransition", err.Error()) @@ -10078,7 +10078,7 @@ func (client BaseClient) StartPartitionRestart(ctx context.Context, serviceID st if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "StartPartitionRestart", err.Error()) @@ -10181,7 +10181,7 @@ func (client BaseClient) StartQuorumLoss(ctx context.Context, serviceID string, if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "StartQuorumLoss", err.Error()) @@ -10264,7 +10264,7 @@ func (client BaseClient) StopChaos(ctx context.Context, timeout *int64) (result if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "StopChaos", err.Error()) @@ -10344,7 +10344,7 @@ func (client BaseClient) StopNode(ctx context.Context, nodeName string, stopNode Constraints: []validation.Constraint{{Target: "stopNodeDescription.NodeInstanceID", Name: validation.Null, Rule: true, Chain: nil}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "StopNode", err.Error()) @@ -10431,7 +10431,7 @@ func (client BaseClient) UnprovisionApplicationType(ctx context.Context, applica Constraints: []validation.Constraint{{Target: "applicationTypeImageStoreVersion.ApplicationTypeVersion", Name: validation.Null, Rule: true, Chain: nil}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "UnprovisionApplicationType", err.Error()) @@ -10519,7 +10519,7 @@ func (client BaseClient) UpdateApplicationUpgrade(ctx context.Context, applicati Constraints: []validation.Constraint{{Target: "applicationUpgradeUpdateDescription.Name", Name: validation.Null, Rule: true, Chain: nil}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "UpdateApplicationUpgrade", err.Error()) @@ -10603,7 +10603,7 @@ func (client BaseClient) UpdateService(ctx context.Context, serviceID string, se if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "UpdateService", err.Error()) @@ -10687,7 +10687,7 @@ func (client BaseClient) UploadFile(ctx context.Context, contentPath string, tim if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "UploadFile", err.Error()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/servicefabric/6.0/servicefabric/client.go b/vendor/github.com/Azure/azure-sdk-for-go/services/servicefabric/6.0/servicefabric/client.go index bc91d46bc..98c7776f2 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/servicefabric/6.0/servicefabric/client.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/servicefabric/6.0/servicefabric/client.go @@ -85,7 +85,7 @@ func (client BaseClient) CancelOperation(ctx context.Context, operationID uuid.U if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "CancelOperation", err.Error()) @@ -235,7 +235,7 @@ func (client BaseClient) CopyImageStoreContent(ctx context.Context, imageStoreCo {Target: "imageStoreCopyDescription.RemoteDestination", Name: validation.Null, Rule: true, Chain: nil}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "CopyImageStoreContent", err.Error()) @@ -323,7 +323,7 @@ func (client BaseClient) CreateApplication(ctx context.Context, applicationDescr }}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "CreateApplication", err.Error()) @@ -404,7 +404,7 @@ func (client BaseClient) CreateComposeDeployment(ctx context.Context, createComp {Target: "createComposeDeploymentDescription.ComposeFileContent", Name: validation.Null, Rule: true, Chain: nil}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "CreateComposeDeployment", err.Error()) @@ -484,7 +484,7 @@ func (client BaseClient) CreateName(ctx context.Context, nameDescription NameDes Constraints: []validation.Constraint{{Target: "nameDescription.Name", Name: validation.Null, Rule: true, Chain: nil}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "CreateName", err.Error()) @@ -649,7 +649,7 @@ func (client BaseClient) CreateService(ctx context.Context, applicationID string {Target: "serviceDescription.PartitionDescription", Name: validation.Null, Rule: true, Chain: nil}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "CreateService", err.Error()) @@ -741,7 +741,7 @@ func (client BaseClient) CreateServiceFromTemplate(ctx context.Context, applicat {Target: "serviceFromTemplateDescription.ServiceTypeName", Name: validation.Null, Rule: true, Chain: nil}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "CreateServiceFromTemplate", err.Error()) @@ -834,7 +834,7 @@ func (client BaseClient) DeleteApplication(ctx context.Context, applicationID st if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "DeleteApplication", err.Error()) @@ -918,7 +918,7 @@ func (client BaseClient) DeleteImageStoreContent(ctx context.Context, contentPat if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "DeleteImageStoreContent", err.Error()) @@ -999,7 +999,7 @@ func (client BaseClient) DeleteName(ctx context.Context, nameID string, timeout if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "DeleteName", err.Error()) @@ -1081,7 +1081,7 @@ func (client BaseClient) DeleteProperty(ctx context.Context, nameID string, prop if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "DeleteProperty", err.Error()) @@ -1238,7 +1238,7 @@ func (client BaseClient) DeleteService(ctx context.Context, serviceID string, fo if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "DeleteService", err.Error()) @@ -1329,7 +1329,7 @@ func (client BaseClient) DeployedServicePackageToNode(ctx context.Context, nodeN {Target: "deployServicePackageToNodeDescription.NodeName", Name: validation.Null, Rule: true, Chain: nil}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "DeployedServicePackageToNode", err.Error()) @@ -1417,7 +1417,7 @@ func (client BaseClient) DisableNode(ctx context.Context, nodeName string, deact if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "DisableNode", err.Error()) @@ -1501,7 +1501,7 @@ func (client BaseClient) EnableNode(ctx context.Context, nodeName string, timeou if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "EnableNode", err.Error()) @@ -1651,7 +1651,7 @@ func (client BaseClient) GetAadMetadata(ctx context.Context, timeout *int64) (re if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetAadMetadata", err.Error()) @@ -1785,7 +1785,7 @@ func (client BaseClient) GetApplicationHealth(ctx context.Context, applicationID if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetApplicationHealth", err.Error()) @@ -1948,7 +1948,7 @@ func (client BaseClient) GetApplicationHealthUsingPolicy(ctx context.Context, ap if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetApplicationHealthUsingPolicy", err.Error()) @@ -2061,7 +2061,7 @@ func (client BaseClient) GetApplicationInfo(ctx context.Context, applicationID s if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetApplicationInfo", err.Error()) @@ -2166,7 +2166,7 @@ func (client BaseClient) GetApplicationInfoList(ctx context.Context, application if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetApplicationInfoList", err.Error()) @@ -2265,7 +2265,7 @@ func (client BaseClient) GetApplicationLoadInfo(ctx context.Context, application if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetApplicationLoadInfo", err.Error()) @@ -2348,7 +2348,7 @@ func (client BaseClient) GetApplicationManifest(ctx context.Context, application if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetApplicationManifest", err.Error()) @@ -2434,7 +2434,7 @@ func (client BaseClient) GetApplicationNameInfo(ctx context.Context, serviceID s if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetApplicationNameInfo", err.Error()) @@ -2543,7 +2543,7 @@ func (client BaseClient) GetApplicationTypeInfoList(ctx context.Context, applica Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetApplicationTypeInfoList", err.Error()) @@ -2663,7 +2663,7 @@ func (client BaseClient) GetApplicationTypeInfoListByName(ctx context.Context, a Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetApplicationTypeInfoListByName", err.Error()) @@ -2764,7 +2764,7 @@ func (client BaseClient) GetApplicationUpgrade(ctx context.Context, applicationI if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetApplicationUpgrade", err.Error()) @@ -2862,7 +2862,7 @@ func (client BaseClient) GetChaosReport(ctx context.Context, continuationToken s if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetChaosReport", err.Error()) @@ -2950,7 +2950,7 @@ func (client BaseClient) GetClusterConfiguration(ctx context.Context, configurat if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetClusterConfiguration", err.Error()) @@ -3028,7 +3028,7 @@ func (client BaseClient) GetClusterConfigurationUpgradeStatus(ctx context.Contex if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetClusterConfigurationUpgradeStatus", err.Error()) @@ -3169,7 +3169,7 @@ func (client BaseClient) GetClusterHealth(ctx context.Context, nodesHealthStateF if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetClusterHealth", err.Error()) @@ -3273,7 +3273,7 @@ func (client BaseClient) GetClusterHealthChunk(ctx context.Context, timeout *int if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetClusterHealthChunk", err.Error()) @@ -3371,7 +3371,7 @@ func (client BaseClient) GetClusterHealthChunkUsingPolicyAndAdvancedFilters(ctx if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetClusterHealthChunkUsingPolicyAndAdvancedFilters", err.Error()) @@ -3526,7 +3526,7 @@ func (client BaseClient) GetClusterHealthUsingPolicy(ctx context.Context, nodesH if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetClusterHealthUsingPolicy", err.Error()) @@ -3642,7 +3642,7 @@ func (client BaseClient) GetClusterManifest(ctx context.Context, timeout *int64) if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetClusterManifest", err.Error()) @@ -3719,7 +3719,7 @@ func (client BaseClient) GetClusterUpgradeProgress(ctx context.Context, timeout if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetClusterUpgradeProgress", err.Error()) @@ -3798,7 +3798,7 @@ func (client BaseClient) GetComposeDeploymentStatus(ctx context.Context, deploym if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetComposeDeploymentStatus", err.Error()) @@ -3894,7 +3894,7 @@ func (client BaseClient) GetComposeDeploymentStatusList(ctx context.Context, con Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetComposeDeploymentStatusList", err.Error()) @@ -3980,7 +3980,7 @@ func (client BaseClient) GetComposeDeploymentUpgradeProgress(ctx context.Context if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetComposeDeploymentUpgradeProgress", err.Error()) @@ -4067,7 +4067,7 @@ func (client BaseClient) GetDataLossProgress(ctx context.Context, serviceID stri if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetDataLossProgress", err.Error()) @@ -4193,7 +4193,7 @@ func (client BaseClient) GetDeployedApplicationHealth(ctx context.Context, nodeN if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetDeployedApplicationHealth", err.Error()) @@ -4340,7 +4340,7 @@ func (client BaseClient) GetDeployedApplicationHealthUsingPolicy(ctx context.Con if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetDeployedApplicationHealthUsingPolicy", err.Error()) @@ -4446,7 +4446,7 @@ func (client BaseClient) GetDeployedApplicationInfo(ctx context.Context, nodeNam if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetDeployedApplicationInfo", err.Error()) @@ -4528,7 +4528,7 @@ func (client BaseClient) GetDeployedApplicationInfoList(ctx context.Context, nod if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetDeployedApplicationInfoList", err.Error()) @@ -4618,7 +4618,7 @@ func (client BaseClient) GetDeployedCodePackageInfoList(ctx context.Context, nod if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetDeployedCodePackageInfoList", err.Error()) @@ -4728,7 +4728,7 @@ func (client BaseClient) GetDeployedServicePackageHealth(ctx context.Context, no if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetDeployedServicePackageHealth", err.Error()) @@ -4845,7 +4845,7 @@ func (client BaseClient) GetDeployedServicePackageHealthUsingPolicy(ctx context. if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetDeployedServicePackageHealthUsingPolicy", err.Error()) @@ -4943,7 +4943,7 @@ func (client BaseClient) GetDeployedServicePackageInfoList(ctx context.Context, if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetDeployedServicePackageInfoList", err.Error()) @@ -5032,7 +5032,7 @@ func (client BaseClient) GetDeployedServicePackageInfoListByName(ctx context.Con if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetDeployedServicePackageInfoListByName", err.Error()) @@ -5119,7 +5119,7 @@ func (client BaseClient) GetDeployedServiceReplicaDetailInfo(ctx context.Context if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetDeployedServiceReplicaDetailInfo", err.Error()) @@ -5205,7 +5205,7 @@ func (client BaseClient) GetDeployedServiceReplicaDetailInfoByPartitionID(ctx co if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetDeployedServiceReplicaDetailInfoByPartitionID", err.Error()) @@ -5297,7 +5297,7 @@ func (client BaseClient) GetDeployedServiceReplicaInfoList(ctx context.Context, if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetDeployedServiceReplicaInfoList", err.Error()) @@ -5396,7 +5396,7 @@ func (client BaseClient) GetDeployedServiceTypeInfoByName(ctx context.Context, n if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetDeployedServiceTypeInfoByName", err.Error()) @@ -5491,7 +5491,7 @@ func (client BaseClient) GetDeployedServiceTypeInfoList(ctx context.Context, nod if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetDeployedServiceTypeInfoList", err.Error()) @@ -5589,7 +5589,7 @@ func (client BaseClient) GetFaultOperationList(ctx context.Context, typeFilter i if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetFaultOperationList", err.Error()) @@ -5669,7 +5669,7 @@ func (client BaseClient) GetImageStoreContent(ctx context.Context, contentPath s if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetImageStoreContent", err.Error()) @@ -5749,7 +5749,7 @@ func (client BaseClient) GetImageStoreRootContent(ctx context.Context, timeout * if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetImageStoreRootContent", err.Error()) @@ -5826,7 +5826,7 @@ func (client BaseClient) GetNameExistsInfo(ctx context.Context, nameID string, t if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetNameExistsInfo", err.Error()) @@ -5923,7 +5923,7 @@ func (client BaseClient) GetNodeHealth(ctx context.Context, nodeName string, eve if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetNodeHealth", err.Error()) @@ -6029,7 +6029,7 @@ func (client BaseClient) GetNodeHealthUsingPolicy(ctx context.Context, nodeName if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetNodeHealthUsingPolicy", err.Error()) @@ -6121,7 +6121,7 @@ func (client BaseClient) GetNodeInfo(ctx context.Context, nodeName string, timeo if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetNodeInfo", err.Error()) @@ -6225,7 +6225,7 @@ func (client BaseClient) GetNodeInfoList(ctx context.Context, continuationToken if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetNodeInfoList", err.Error()) @@ -6310,7 +6310,7 @@ func (client BaseClient) GetNodeLoadInfo(ctx context.Context, nodeName string, t if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetNodeLoadInfo", err.Error()) @@ -6394,7 +6394,7 @@ func (client BaseClient) GetNodeTransitionProgress(ctx context.Context, nodeName if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetNodeTransitionProgress", err.Error()) @@ -6513,7 +6513,7 @@ func (client BaseClient) GetPartitionHealth(ctx context.Context, partitionID uui if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetPartitionHealth", err.Error()) @@ -6654,7 +6654,7 @@ func (client BaseClient) GetPartitionHealthUsingPolicy(ctx context.Context, part if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetPartitionHealthUsingPolicy", err.Error()) @@ -6757,7 +6757,7 @@ func (client BaseClient) GetPartitionInfo(ctx context.Context, partitionID uuid. if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetPartitionInfo", err.Error()) @@ -6848,7 +6848,7 @@ func (client BaseClient) GetPartitionInfoList(ctx context.Context, serviceID str if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetPartitionInfoList", err.Error()) @@ -6934,7 +6934,7 @@ func (client BaseClient) GetPartitionLoadInformation(ctx context.Context, partit if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetPartitionLoadInformation", err.Error()) @@ -7022,7 +7022,7 @@ func (client BaseClient) GetPartitionRestartProgress(ctx context.Context, servic if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetPartitionRestartProgress", err.Error()) @@ -7107,7 +7107,7 @@ func (client BaseClient) GetPropertyInfo(ctx context.Context, nameID string, pro if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetPropertyInfo", err.Error()) @@ -7196,7 +7196,7 @@ func (client BaseClient) GetPropertyInfoList(ctx context.Context, nameID string, if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetPropertyInfoList", err.Error()) @@ -7287,7 +7287,7 @@ func (client BaseClient) GetProvisionedFabricCodeVersionInfoList(ctx context.Con if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetProvisionedFabricCodeVersionInfoList", err.Error()) @@ -7369,7 +7369,7 @@ func (client BaseClient) GetProvisionedFabricConfigVersionInfoList(ctx context.C if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetProvisionedFabricConfigVersionInfoList", err.Error()) @@ -7456,7 +7456,7 @@ func (client BaseClient) GetQuorumLossProgress(ctx context.Context, serviceID st if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetQuorumLossProgress", err.Error()) @@ -7636,7 +7636,7 @@ func (client BaseClient) GetReplicaHealth(ctx context.Context, partitionID uuid. if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetReplicaHealth", err.Error()) @@ -7749,7 +7749,7 @@ func (client BaseClient) GetReplicaHealthUsingPolicy(ctx context.Context, partit if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetReplicaHealthUsingPolicy", err.Error()) @@ -7848,7 +7848,7 @@ func (client BaseClient) GetReplicaInfo(ctx context.Context, partitionID uuid.UU if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetReplicaInfo", err.Error()) @@ -7939,7 +7939,7 @@ func (client BaseClient) GetReplicaInfoList(ctx context.Context, partitionID uui if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetReplicaInfoList", err.Error()) @@ -8027,7 +8027,7 @@ func (client BaseClient) GetServiceDescription(ctx context.Context, serviceID st if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetServiceDescription", err.Error()) @@ -8150,7 +8150,7 @@ func (client BaseClient) GetServiceHealth(ctx context.Context, serviceID string, if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetServiceHealth", err.Error()) @@ -8295,7 +8295,7 @@ func (client BaseClient) GetServiceHealthUsingPolicy(ctx context.Context, servic if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetServiceHealthUsingPolicy", err.Error()) @@ -8404,7 +8404,7 @@ func (client BaseClient) GetServiceInfo(ctx context.Context, applicationID strin if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetServiceInfo", err.Error()) @@ -8496,7 +8496,7 @@ func (client BaseClient) GetServiceInfoList(ctx context.Context, applicationID s if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetServiceInfoList", err.Error()) @@ -8587,7 +8587,7 @@ func (client BaseClient) GetServiceManifest(ctx context.Context, applicationType if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetServiceManifest", err.Error()) @@ -8670,7 +8670,7 @@ func (client BaseClient) GetServiceNameInfo(ctx context.Context, partitionID uui if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetServiceNameInfo", err.Error()) @@ -8755,7 +8755,7 @@ func (client BaseClient) GetServiceTypeInfoList(ctx context.Context, application if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetServiceTypeInfoList", err.Error()) @@ -8845,7 +8845,7 @@ func (client BaseClient) GetSubNameInfoList(ctx context.Context, nameID string, if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetSubNameInfoList", err.Error()) @@ -8944,7 +8944,7 @@ func (client BaseClient) InvokeInfrastructureCommand(ctx context.Context, comman if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "InvokeInfrastructureCommand", err.Error()) @@ -9035,7 +9035,7 @@ func (client BaseClient) InvokeInfrastructureQuery(ctx context.Context, command if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "InvokeInfrastructureQuery", err.Error()) @@ -9120,7 +9120,7 @@ func (client BaseClient) ProvisionApplicationType(ctx context.Context, applicati Constraints: []validation.Constraint{{Target: "applicationTypeImageStorePath.ApplicationTypeBuildPath", Name: validation.Null, Rule: true, Chain: nil}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "ProvisionApplicationType", err.Error()) @@ -9198,7 +9198,7 @@ func (client BaseClient) ProvisionCluster(ctx context.Context, provisionFabricDe if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "ProvisionCluster", err.Error()) @@ -9280,7 +9280,7 @@ func (client BaseClient) PutProperty(ctx context.Context, nameID string, propert {Target: "propertyDescription.Value", Name: validation.Null, Rule: true, Chain: nil}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "PutProperty", err.Error()) @@ -9364,7 +9364,7 @@ func (client BaseClient) RecoverAllPartitions(ctx context.Context, timeout *int6 if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "RecoverAllPartitions", err.Error()) @@ -9442,7 +9442,7 @@ func (client BaseClient) RecoverPartition(ctx context.Context, partitionID uuid. if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "RecoverPartition", err.Error()) @@ -9527,7 +9527,7 @@ func (client BaseClient) RecoverServicePartitions(ctx context.Context, serviceID if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "RecoverServicePartitions", err.Error()) @@ -9608,7 +9608,7 @@ func (client BaseClient) RecoverSystemPartitions(ctx context.Context, timeout *i if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "RecoverSystemPartitions", err.Error()) @@ -9684,7 +9684,7 @@ func (client BaseClient) RemoveComposeDeployment(ctx context.Context, deployment if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "RemoveComposeDeployment", err.Error()) @@ -9769,7 +9769,7 @@ func (client BaseClient) RemoveNodeState(ctx context.Context, nodeName string, t if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "RemoveNodeState", err.Error()) @@ -9859,7 +9859,7 @@ func (client BaseClient) RemoveReplica(ctx context.Context, nodeName string, par if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "RemoveReplica", err.Error()) @@ -9970,7 +9970,7 @@ func (client BaseClient) ReportApplicationHealth(ctx context.Context, applicatio {Target: "healthInformation.Property", Name: validation.Null, Rule: true, Chain: nil}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "ReportApplicationHealth", err.Error()) @@ -10079,7 +10079,7 @@ func (client BaseClient) ReportClusterHealth(ctx context.Context, healthInformat {Target: "healthInformation.Property", Name: validation.Null, Rule: true, Chain: nil}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "ReportClusterHealth", err.Error()) @@ -10189,7 +10189,7 @@ func (client BaseClient) ReportDeployedApplicationHealth(ctx context.Context, no {Target: "healthInformation.Property", Name: validation.Null, Rule: true, Chain: nil}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "ReportDeployedApplicationHealth", err.Error()) @@ -10306,7 +10306,7 @@ func (client BaseClient) ReportDeployedServicePackageHealth(ctx context.Context, {Target: "healthInformation.Property", Name: validation.Null, Rule: true, Chain: nil}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "ReportDeployedServicePackageHealth", err.Error()) @@ -10418,7 +10418,7 @@ func (client BaseClient) ReportNodeHealth(ctx context.Context, nodeName string, {Target: "healthInformation.Property", Name: validation.Null, Rule: true, Chain: nil}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "ReportNodeHealth", err.Error()) @@ -10528,7 +10528,7 @@ func (client BaseClient) ReportPartitionHealth(ctx context.Context, partitionID {Target: "healthInformation.Property", Name: validation.Null, Rule: true, Chain: nil}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "ReportPartitionHealth", err.Error()) @@ -10644,7 +10644,7 @@ func (client BaseClient) ReportReplicaHealth(ctx context.Context, partitionID uu {Target: "healthInformation.Property", Name: validation.Null, Rule: true, Chain: nil}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "ReportReplicaHealth", err.Error()) @@ -10759,7 +10759,7 @@ func (client BaseClient) ReportServiceHealth(ctx context.Context, serviceID stri {Target: "healthInformation.Property", Name: validation.Null, Rule: true, Chain: nil}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "ReportServiceHealth", err.Error()) @@ -10846,7 +10846,7 @@ func (client BaseClient) ResetPartitionLoad(ctx context.Context, partitionID uui if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "ResetPartitionLoad", err.Error()) @@ -10941,7 +10941,7 @@ func (client BaseClient) ResolveService(ctx context.Context, serviceID string, p if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "ResolveService", err.Error()) @@ -11042,7 +11042,7 @@ func (client BaseClient) RestartDeployedCodePackage(ctx context.Context, nodeNam {Target: "restartDeployedCodePackageDescription.CodePackageInstanceID", Name: validation.Null, Rule: true, Chain: nil}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "RestartDeployedCodePackage", err.Error()) @@ -11129,7 +11129,7 @@ func (client BaseClient) RestartNode(ctx context.Context, nodeName string, resta Constraints: []validation.Constraint{{Target: "restartNodeDescription.NodeInstanceID", Name: validation.Null, Rule: true, Chain: nil}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "RestartNode", err.Error()) @@ -11215,7 +11215,7 @@ func (client BaseClient) RestartReplica(ctx context.Context, nodeName string, pa if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "RestartReplica", err.Error()) @@ -11305,7 +11305,7 @@ func (client BaseClient) ResumeApplicationUpgrade(ctx context.Context, applicati Constraints: []validation.Constraint{{Target: "resumeApplicationUpgradeDescription.UpgradeDomainName", Name: validation.Null, Rule: true, Chain: nil}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "ResumeApplicationUpgrade", err.Error()) @@ -11389,7 +11389,7 @@ func (client BaseClient) ResumeClusterUpgrade(ctx context.Context, resumeCluster Constraints: []validation.Constraint{{Target: "resumeClusterUpgradeDescription.UpgradeDomain", Name: validation.Null, Rule: true, Chain: nil}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "ResumeClusterUpgrade", err.Error()) @@ -11473,7 +11473,7 @@ func (client BaseClient) RollbackApplicationUpgrade(ctx context.Context, applica if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "RollbackApplicationUpgrade", err.Error()) @@ -11552,7 +11552,7 @@ func (client BaseClient) RollbackClusterUpgrade(ctx context.Context, timeout *in if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "RollbackClusterUpgrade", err.Error()) @@ -11637,7 +11637,7 @@ func (client BaseClient) StartApplicationUpgrade(ctx context.Context, applicatio {Target: "applicationUpgradeDescription.Parameters", Name: validation.Null, Rule: true, Chain: nil}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "StartApplicationUpgrade", err.Error()) @@ -11723,24 +11723,24 @@ func (client BaseClient) StartChaos(ctx context.Context, chaosParameters ChaosPa if err := validation.Validate([]validation.Validation{ {TargetValue: chaosParameters, Constraints: []validation.Constraint{{Target: "chaosParameters.MaxClusterStabilizationTimeoutInSeconds", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "chaosParameters.MaxClusterStabilizationTimeoutInSeconds", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "chaosParameters.MaxClusterStabilizationTimeoutInSeconds", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "chaosParameters.MaxClusterStabilizationTimeoutInSeconds", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, }}, {Target: "chaosParameters.MaxConcurrentFaults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "chaosParameters.MaxConcurrentFaults", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "chaosParameters.MaxConcurrentFaults", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "chaosParameters.MaxConcurrentFaults", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, }}, {Target: "chaosParameters.WaitTimeBetweenFaultsInSeconds", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "chaosParameters.WaitTimeBetweenFaultsInSeconds", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "chaosParameters.WaitTimeBetweenFaultsInSeconds", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "chaosParameters.WaitTimeBetweenFaultsInSeconds", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, }}, {Target: "chaosParameters.WaitTimeBetweenIterationsInSeconds", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "chaosParameters.WaitTimeBetweenIterationsInSeconds", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "chaosParameters.WaitTimeBetweenIterationsInSeconds", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "chaosParameters.WaitTimeBetweenIterationsInSeconds", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, }}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "StartChaos", err.Error()) @@ -11821,7 +11821,7 @@ func (client BaseClient) StartClusterConfigurationUpgrade(ctx context.Context, c Constraints: []validation.Constraint{{Target: "clusterConfigurationUpgradeDescription.ClusterConfig", Name: validation.Null, Rule: true, Chain: nil}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "StartClusterConfigurationUpgrade", err.Error()) @@ -11901,17 +11901,17 @@ func (client BaseClient) StartClusterUpgrade(ctx context.Context, startClusterUp {TargetValue: startClusterUpgradeDescription, Constraints: []validation.Constraint{{Target: "startClusterUpgradeDescription.ClusterUpgradeHealthPolicy", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "startClusterUpgradeDescription.ClusterUpgradeHealthPolicy.MaxPercentDeltaUnhealthyNodes", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "startClusterUpgradeDescription.ClusterUpgradeHealthPolicy.MaxPercentDeltaUnhealthyNodes", Name: validation.InclusiveMaximum, Rule: 100, Chain: nil}, + Chain: []validation.Constraint{{Target: "startClusterUpgradeDescription.ClusterUpgradeHealthPolicy.MaxPercentDeltaUnhealthyNodes", Name: validation.InclusiveMaximum, Rule: int64(100), Chain: nil}, {Target: "startClusterUpgradeDescription.ClusterUpgradeHealthPolicy.MaxPercentDeltaUnhealthyNodes", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, }}, {Target: "startClusterUpgradeDescription.ClusterUpgradeHealthPolicy.MaxPercentUpgradeDomainDeltaUnhealthyNodes", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "startClusterUpgradeDescription.ClusterUpgradeHealthPolicy.MaxPercentUpgradeDomainDeltaUnhealthyNodes", Name: validation.InclusiveMaximum, Rule: 100, Chain: nil}, + Chain: []validation.Constraint{{Target: "startClusterUpgradeDescription.ClusterUpgradeHealthPolicy.MaxPercentUpgradeDomainDeltaUnhealthyNodes", Name: validation.InclusiveMaximum, Rule: int64(100), Chain: nil}, {Target: "startClusterUpgradeDescription.ClusterUpgradeHealthPolicy.MaxPercentUpgradeDomainDeltaUnhealthyNodes", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, }}, }}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "StartClusterUpgrade", err.Error()) @@ -11994,7 +11994,7 @@ func (client BaseClient) StartComposeDeploymentUpgrade(ctx context.Context, depl {Target: "composeDeploymentUpgradeDescription.ComposeFileContent", Name: validation.Null, Rule: true, Chain: nil}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "StartComposeDeploymentUpgrade", err.Error()) @@ -12103,7 +12103,7 @@ func (client BaseClient) StartDataLoss(ctx context.Context, serviceID string, pa if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "StartDataLoss", err.Error()) @@ -12202,7 +12202,7 @@ func (client BaseClient) StartNodeTransition(ctx context.Context, nodeName strin Constraints: []validation.Constraint{{Target: "stopDurationInSeconds", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "StartNodeTransition", err.Error()) @@ -12299,7 +12299,7 @@ func (client BaseClient) StartPartitionRestart(ctx context.Context, serviceID st if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "StartPartitionRestart", err.Error()) @@ -12404,7 +12404,7 @@ func (client BaseClient) StartQuorumLoss(ctx context.Context, serviceID string, if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "StartQuorumLoss", err.Error()) @@ -12487,7 +12487,7 @@ func (client BaseClient) StopChaos(ctx context.Context, timeout *int64) (result if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "StopChaos", err.Error()) @@ -12564,7 +12564,7 @@ func (client BaseClient) SubmitPropertyBatch(ctx context.Context, nameID string, if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "SubmitPropertyBatch", err.Error()) @@ -12652,7 +12652,7 @@ func (client BaseClient) UnprovisionApplicationType(ctx context.Context, applica Constraints: []validation.Constraint{{Target: "applicationTypeImageStoreVersion.ApplicationTypeVersion", Name: validation.Null, Rule: true, Chain: nil}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "UnprovisionApplicationType", err.Error()) @@ -12734,7 +12734,7 @@ func (client BaseClient) UnprovisionCluster(ctx context.Context, unprovisionFabr if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "UnprovisionCluster", err.Error()) @@ -12820,7 +12820,7 @@ func (client BaseClient) UpdateApplicationUpgrade(ctx context.Context, applicati Constraints: []validation.Constraint{{Target: "applicationUpgradeUpdateDescription.Name", Name: validation.Null, Rule: true, Chain: nil}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "UpdateApplicationUpgrade", err.Error()) @@ -12903,17 +12903,17 @@ func (client BaseClient) UpdateClusterUpgrade(ctx context.Context, updateCluster {TargetValue: updateClusterUpgradeDescription, Constraints: []validation.Constraint{{Target: "updateClusterUpgradeDescription.ClusterUpgradeHealthPolicy", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "updateClusterUpgradeDescription.ClusterUpgradeHealthPolicy.MaxPercentDeltaUnhealthyNodes", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "updateClusterUpgradeDescription.ClusterUpgradeHealthPolicy.MaxPercentDeltaUnhealthyNodes", Name: validation.InclusiveMaximum, Rule: 100, Chain: nil}, + Chain: []validation.Constraint{{Target: "updateClusterUpgradeDescription.ClusterUpgradeHealthPolicy.MaxPercentDeltaUnhealthyNodes", Name: validation.InclusiveMaximum, Rule: int64(100), Chain: nil}, {Target: "updateClusterUpgradeDescription.ClusterUpgradeHealthPolicy.MaxPercentDeltaUnhealthyNodes", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, }}, {Target: "updateClusterUpgradeDescription.ClusterUpgradeHealthPolicy.MaxPercentUpgradeDomainDeltaUnhealthyNodes", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "updateClusterUpgradeDescription.ClusterUpgradeHealthPolicy.MaxPercentUpgradeDomainDeltaUnhealthyNodes", Name: validation.InclusiveMaximum, Rule: 100, Chain: nil}, + Chain: []validation.Constraint{{Target: "updateClusterUpgradeDescription.ClusterUpgradeHealthPolicy.MaxPercentUpgradeDomainDeltaUnhealthyNodes", Name: validation.InclusiveMaximum, Rule: int64(100), Chain: nil}, {Target: "updateClusterUpgradeDescription.ClusterUpgradeHealthPolicy.MaxPercentUpgradeDomainDeltaUnhealthyNodes", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, }}, }}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "UpdateClusterUpgrade", err.Error()) @@ -13134,7 +13134,7 @@ func (client BaseClient) UpdateService(ctx context.Context, serviceID string, se if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "UpdateService", err.Error()) @@ -13222,7 +13222,7 @@ func (client BaseClient) UploadFile(ctx context.Context, contentPath string, tim if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "UploadFile", err.Error()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/servicefabric/6.1/servicefabric/client.go b/vendor/github.com/Azure/azure-sdk-for-go/services/servicefabric/6.1/servicefabric/client.go index c9f26151e..c4ed70418 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/servicefabric/6.1/servicefabric/client.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/servicefabric/6.1/servicefabric/client.go @@ -85,7 +85,7 @@ func (client BaseClient) CancelOperation(ctx context.Context, operationID uuid.U if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "CancelOperation", err.Error()) @@ -234,7 +234,7 @@ func (client BaseClient) CommitImageStoreUploadSession(ctx context.Context, sess if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "CommitImageStoreUploadSession", err.Error()) @@ -315,7 +315,7 @@ func (client BaseClient) CopyImageStoreContent(ctx context.Context, imageStoreCo {Target: "imageStoreCopyDescription.RemoteDestination", Name: validation.Null, Rule: true, Chain: nil}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "CopyImageStoreContent", err.Error()) @@ -403,7 +403,7 @@ func (client BaseClient) CreateApplication(ctx context.Context, applicationDescr }}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "CreateApplication", err.Error()) @@ -486,7 +486,7 @@ func (client BaseClient) CreateComposeDeployment(ctx context.Context, createComp {Target: "createComposeDeploymentDescription.ComposeFileContent", Name: validation.Null, Rule: true, Chain: nil}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "CreateComposeDeployment", err.Error()) @@ -566,7 +566,7 @@ func (client BaseClient) CreateName(ctx context.Context, nameDescription NameDes Constraints: []validation.Constraint{{Target: "nameDescription.Name", Name: validation.Null, Rule: true, Chain: nil}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "CreateName", err.Error()) @@ -734,7 +734,7 @@ func (client BaseClient) CreateService(ctx context.Context, applicationID string {Target: "serviceDescription.PartitionDescription", Name: validation.Null, Rule: true, Chain: nil}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "CreateService", err.Error()) @@ -828,7 +828,7 @@ func (client BaseClient) CreateServiceFromTemplate(ctx context.Context, applicat {Target: "serviceFromTemplateDescription.ServiceTypeName", Name: validation.Null, Rule: true, Chain: nil}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "CreateServiceFromTemplate", err.Error()) @@ -922,7 +922,7 @@ func (client BaseClient) DeleteApplication(ctx context.Context, applicationID st if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "DeleteApplication", err.Error()) @@ -1006,7 +1006,7 @@ func (client BaseClient) DeleteImageStoreContent(ctx context.Context, contentPat if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "DeleteImageStoreContent", err.Error()) @@ -1088,7 +1088,7 @@ func (client BaseClient) DeleteImageStoreUploadSession(ctx context.Context, sess if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "DeleteImageStoreUploadSession", err.Error()) @@ -1166,7 +1166,7 @@ func (client BaseClient) DeleteName(ctx context.Context, nameID string, timeout if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "DeleteName", err.Error()) @@ -1248,7 +1248,7 @@ func (client BaseClient) DeleteProperty(ctx context.Context, nameID string, prop if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "DeleteProperty", err.Error()) @@ -1406,7 +1406,7 @@ func (client BaseClient) DeleteService(ctx context.Context, serviceID string, fo if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "DeleteService", err.Error()) @@ -1499,7 +1499,7 @@ func (client BaseClient) DeployedServicePackageToNode(ctx context.Context, nodeN {Target: "deployServicePackageToNodeDescription.NodeName", Name: validation.Null, Rule: true, Chain: nil}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "DeployedServicePackageToNode", err.Error()) @@ -1587,7 +1587,7 @@ func (client BaseClient) DisableNode(ctx context.Context, nodeName string, deact if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "DisableNode", err.Error()) @@ -1671,7 +1671,7 @@ func (client BaseClient) EnableNode(ctx context.Context, nodeName string, timeou if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "EnableNode", err.Error()) @@ -1821,7 +1821,7 @@ func (client BaseClient) GetAadMetadata(ctx context.Context, timeout *int64) (re if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetAadMetadata", err.Error()) @@ -1956,7 +1956,7 @@ func (client BaseClient) GetApplicationHealth(ctx context.Context, applicationID if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetApplicationHealth", err.Error()) @@ -2120,7 +2120,7 @@ func (client BaseClient) GetApplicationHealthUsingPolicy(ctx context.Context, ap if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetApplicationHealthUsingPolicy", err.Error()) @@ -2234,7 +2234,7 @@ func (client BaseClient) GetApplicationInfo(ctx context.Context, applicationID s if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetApplicationInfo", err.Error()) @@ -2347,7 +2347,7 @@ func (client BaseClient) GetApplicationInfoList(ctx context.Context, application Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetApplicationInfoList", err.Error()) @@ -2452,7 +2452,7 @@ func (client BaseClient) GetApplicationLoadInfo(ctx context.Context, application if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetApplicationLoadInfo", err.Error()) @@ -2535,7 +2535,7 @@ func (client BaseClient) GetApplicationManifest(ctx context.Context, application if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetApplicationManifest", err.Error()) @@ -2622,7 +2622,7 @@ func (client BaseClient) GetApplicationNameInfo(ctx context.Context, serviceID s if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetApplicationNameInfo", err.Error()) @@ -2731,7 +2731,7 @@ func (client BaseClient) GetApplicationTypeInfoList(ctx context.Context, applica Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetApplicationTypeInfoList", err.Error()) @@ -2851,7 +2851,7 @@ func (client BaseClient) GetApplicationTypeInfoListByName(ctx context.Context, a Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetApplicationTypeInfoListByName", err.Error()) @@ -2953,7 +2953,7 @@ func (client BaseClient) GetApplicationUpgrade(ctx context.Context, applicationI if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetApplicationUpgrade", err.Error()) @@ -3049,7 +3049,7 @@ func (client BaseClient) GetChaosReport(ctx context.Context, continuationToken s if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetChaosReport", err.Error()) @@ -3137,7 +3137,7 @@ func (client BaseClient) GetClusterConfiguration(ctx context.Context, configurat if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetClusterConfiguration", err.Error()) @@ -3215,7 +3215,7 @@ func (client BaseClient) GetClusterConfigurationUpgradeStatus(ctx context.Contex if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetClusterConfigurationUpgradeStatus", err.Error()) @@ -3356,7 +3356,7 @@ func (client BaseClient) GetClusterHealth(ctx context.Context, nodesHealthStateF if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetClusterHealth", err.Error()) @@ -3460,7 +3460,7 @@ func (client BaseClient) GetClusterHealthChunk(ctx context.Context, timeout *int if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetClusterHealthChunk", err.Error()) @@ -3558,7 +3558,7 @@ func (client BaseClient) GetClusterHealthChunkUsingPolicyAndAdvancedFilters(ctx if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetClusterHealthChunkUsingPolicyAndAdvancedFilters", err.Error()) @@ -3713,7 +3713,7 @@ func (client BaseClient) GetClusterHealthUsingPolicy(ctx context.Context, nodesH if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetClusterHealthUsingPolicy", err.Error()) @@ -3829,7 +3829,7 @@ func (client BaseClient) GetClusterManifest(ctx context.Context, timeout *int64) if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetClusterManifest", err.Error()) @@ -3906,7 +3906,7 @@ func (client BaseClient) GetClusterUpgradeProgress(ctx context.Context, timeout if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetClusterUpgradeProgress", err.Error()) @@ -3985,7 +3985,7 @@ func (client BaseClient) GetComposeDeploymentStatus(ctx context.Context, deploym if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetComposeDeploymentStatus", err.Error()) @@ -4081,7 +4081,7 @@ func (client BaseClient) GetComposeDeploymentStatusList(ctx context.Context, con Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetComposeDeploymentStatusList", err.Error()) @@ -4167,7 +4167,7 @@ func (client BaseClient) GetComposeDeploymentUpgradeProgress(ctx context.Context if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetComposeDeploymentUpgradeProgress", err.Error()) @@ -4259,7 +4259,7 @@ func (client BaseClient) GetContainerLogsDeployedOnNode(ctx context.Context, nod if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetContainerLogsDeployedOnNode", err.Error()) @@ -4353,7 +4353,7 @@ func (client BaseClient) GetDataLossProgress(ctx context.Context, serviceID stri if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetDataLossProgress", err.Error()) @@ -4480,7 +4480,7 @@ func (client BaseClient) GetDeployedApplicationHealth(ctx context.Context, nodeN if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetDeployedApplicationHealth", err.Error()) @@ -4628,7 +4628,7 @@ func (client BaseClient) GetDeployedApplicationHealthUsingPolicy(ctx context.Con if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetDeployedApplicationHealthUsingPolicy", err.Error()) @@ -4744,7 +4744,7 @@ func (client BaseClient) GetDeployedApplicationInfo(ctx context.Context, nodeNam if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetDeployedApplicationInfo", err.Error()) @@ -4850,7 +4850,7 @@ func (client BaseClient) GetDeployedApplicationInfoList(ctx context.Context, nod if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}, {TargetValue: maxResults, @@ -4957,7 +4957,7 @@ func (client BaseClient) GetDeployedCodePackageInfoList(ctx context.Context, nod if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetDeployedCodePackageInfoList", err.Error()) @@ -5068,7 +5068,7 @@ func (client BaseClient) GetDeployedServicePackageHealth(ctx context.Context, no if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetDeployedServicePackageHealth", err.Error()) @@ -5186,7 +5186,7 @@ func (client BaseClient) GetDeployedServicePackageHealthUsingPolicy(ctx context. if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetDeployedServicePackageHealthUsingPolicy", err.Error()) @@ -5285,7 +5285,7 @@ func (client BaseClient) GetDeployedServicePackageInfoList(ctx context.Context, if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetDeployedServicePackageInfoList", err.Error()) @@ -5375,7 +5375,7 @@ func (client BaseClient) GetDeployedServicePackageInfoListByName(ctx context.Con if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetDeployedServicePackageInfoListByName", err.Error()) @@ -5462,7 +5462,7 @@ func (client BaseClient) GetDeployedServiceReplicaDetailInfo(ctx context.Context if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetDeployedServiceReplicaDetailInfo", err.Error()) @@ -5548,7 +5548,7 @@ func (client BaseClient) GetDeployedServiceReplicaDetailInfoByPartitionID(ctx co if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetDeployedServiceReplicaDetailInfoByPartitionID", err.Error()) @@ -5641,7 +5641,7 @@ func (client BaseClient) GetDeployedServiceReplicaInfoList(ctx context.Context, if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetDeployedServiceReplicaInfoList", err.Error()) @@ -5741,7 +5741,7 @@ func (client BaseClient) GetDeployedServiceTypeInfoByName(ctx context.Context, n if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetDeployedServiceTypeInfoByName", err.Error()) @@ -5837,7 +5837,7 @@ func (client BaseClient) GetDeployedServiceTypeInfoList(ctx context.Context, nod if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetDeployedServiceTypeInfoList", err.Error()) @@ -5935,7 +5935,7 @@ func (client BaseClient) GetFaultOperationList(ctx context.Context, typeFilter i if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetFaultOperationList", err.Error()) @@ -6015,7 +6015,7 @@ func (client BaseClient) GetImageStoreContent(ctx context.Context, contentPath s if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetImageStoreContent", err.Error()) @@ -6095,7 +6095,7 @@ func (client BaseClient) GetImageStoreRootContent(ctx context.Context, timeout * if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetImageStoreRootContent", err.Error()) @@ -6174,7 +6174,7 @@ func (client BaseClient) GetImageStoreUploadSessionByID(ctx context.Context, ses if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetImageStoreUploadSessionByID", err.Error()) @@ -6253,7 +6253,7 @@ func (client BaseClient) GetImageStoreUploadSessionByPath(ctx context.Context, c if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetImageStoreUploadSessionByPath", err.Error()) @@ -6334,7 +6334,7 @@ func (client BaseClient) GetNameExistsInfo(ctx context.Context, nameID string, t if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetNameExistsInfo", err.Error()) @@ -6431,7 +6431,7 @@ func (client BaseClient) GetNodeHealth(ctx context.Context, nodeName string, eve if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetNodeHealth", err.Error()) @@ -6537,7 +6537,7 @@ func (client BaseClient) GetNodeHealthUsingPolicy(ctx context.Context, nodeName if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetNodeHealthUsingPolicy", err.Error()) @@ -6629,7 +6629,7 @@ func (client BaseClient) GetNodeInfo(ctx context.Context, nodeName string, timeo if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetNodeInfo", err.Error()) @@ -6717,7 +6717,7 @@ func (client BaseClient) GetNodeInfoList(ctx context.Context, continuationToken if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetNodeInfoList", err.Error()) @@ -6803,7 +6803,7 @@ func (client BaseClient) GetNodeLoadInfo(ctx context.Context, nodeName string, t if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetNodeLoadInfo", err.Error()) @@ -6887,7 +6887,7 @@ func (client BaseClient) GetNodeTransitionProgress(ctx context.Context, nodeName if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetNodeTransitionProgress", err.Error()) @@ -7006,7 +7006,7 @@ func (client BaseClient) GetPartitionHealth(ctx context.Context, partitionID uui if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetPartitionHealth", err.Error()) @@ -7147,7 +7147,7 @@ func (client BaseClient) GetPartitionHealthUsingPolicy(ctx context.Context, part if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetPartitionHealthUsingPolicy", err.Error()) @@ -7250,7 +7250,7 @@ func (client BaseClient) GetPartitionInfo(ctx context.Context, partitionID uuid. if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetPartitionInfo", err.Error()) @@ -7342,7 +7342,7 @@ func (client BaseClient) GetPartitionInfoList(ctx context.Context, serviceID str if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetPartitionInfoList", err.Error()) @@ -7428,7 +7428,7 @@ func (client BaseClient) GetPartitionLoadInformation(ctx context.Context, partit if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetPartitionLoadInformation", err.Error()) @@ -7517,7 +7517,7 @@ func (client BaseClient) GetPartitionRestartProgress(ctx context.Context, servic if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetPartitionRestartProgress", err.Error()) @@ -7602,7 +7602,7 @@ func (client BaseClient) GetPropertyInfo(ctx context.Context, nameID string, pro if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetPropertyInfo", err.Error()) @@ -7693,7 +7693,7 @@ func (client BaseClient) GetPropertyInfoList(ctx context.Context, nameID string, if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetPropertyInfoList", err.Error()) @@ -7784,7 +7784,7 @@ func (client BaseClient) GetProvisionedFabricCodeVersionInfoList(ctx context.Con if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetProvisionedFabricCodeVersionInfoList", err.Error()) @@ -7866,7 +7866,7 @@ func (client BaseClient) GetProvisionedFabricConfigVersionInfoList(ctx context.C if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetProvisionedFabricConfigVersionInfoList", err.Error()) @@ -7954,7 +7954,7 @@ func (client BaseClient) GetQuorumLossProgress(ctx context.Context, serviceID st if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetQuorumLossProgress", err.Error()) @@ -8134,7 +8134,7 @@ func (client BaseClient) GetReplicaHealth(ctx context.Context, partitionID uuid. if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetReplicaHealth", err.Error()) @@ -8247,7 +8247,7 @@ func (client BaseClient) GetReplicaHealthUsingPolicy(ctx context.Context, partit if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetReplicaHealthUsingPolicy", err.Error()) @@ -8346,7 +8346,7 @@ func (client BaseClient) GetReplicaInfo(ctx context.Context, partitionID uuid.UU if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetReplicaInfo", err.Error()) @@ -8437,7 +8437,7 @@ func (client BaseClient) GetReplicaInfoList(ctx context.Context, partitionID uui if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetReplicaInfoList", err.Error()) @@ -8526,7 +8526,7 @@ func (client BaseClient) GetServiceDescription(ctx context.Context, serviceID st if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetServiceDescription", err.Error()) @@ -8650,7 +8650,7 @@ func (client BaseClient) GetServiceHealth(ctx context.Context, serviceID string, if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetServiceHealth", err.Error()) @@ -8796,7 +8796,7 @@ func (client BaseClient) GetServiceHealthUsingPolicy(ctx context.Context, servic if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetServiceHealthUsingPolicy", err.Error()) @@ -8907,7 +8907,7 @@ func (client BaseClient) GetServiceInfo(ctx context.Context, applicationID strin if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetServiceInfo", err.Error()) @@ -9000,7 +9000,7 @@ func (client BaseClient) GetServiceInfoList(ctx context.Context, applicationID s if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetServiceInfoList", err.Error()) @@ -9091,7 +9091,7 @@ func (client BaseClient) GetServiceManifest(ctx context.Context, applicationType if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetServiceManifest", err.Error()) @@ -9174,7 +9174,7 @@ func (client BaseClient) GetServiceNameInfo(ctx context.Context, partitionID uui if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetServiceNameInfo", err.Error()) @@ -9259,7 +9259,7 @@ func (client BaseClient) GetServiceTypeInfoList(ctx context.Context, application if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetServiceTypeInfoList", err.Error()) @@ -9349,7 +9349,7 @@ func (client BaseClient) GetSubNameInfoList(ctx context.Context, nameID string, if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetSubNameInfoList", err.Error()) @@ -9438,7 +9438,7 @@ func (client BaseClient) GetUpgradeOrchestrationServiceState(ctx context.Context if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetUpgradeOrchestrationServiceState", err.Error()) @@ -9525,7 +9525,7 @@ func (client BaseClient) InvokeInfrastructureCommand(ctx context.Context, comman if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "InvokeInfrastructureCommand", err.Error()) @@ -9616,7 +9616,7 @@ func (client BaseClient) InvokeInfrastructureQuery(ctx context.Context, command if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "InvokeInfrastructureQuery", err.Error()) @@ -9703,7 +9703,7 @@ func (client BaseClient) ProvisionApplicationType(ctx context.Context, provision Constraints: []validation.Constraint{{Target: "provisionApplicationTypeDescriptionBaseRequiredBodyParam.Async", Name: validation.Null, Rule: true, Chain: nil}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "ProvisionApplicationType", err.Error()) @@ -9781,7 +9781,7 @@ func (client BaseClient) ProvisionCluster(ctx context.Context, provisionFabricDe if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "ProvisionCluster", err.Error()) @@ -9863,7 +9863,7 @@ func (client BaseClient) PutProperty(ctx context.Context, nameID string, propert {Target: "propertyDescription.Value", Name: validation.Null, Rule: true, Chain: nil}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "PutProperty", err.Error()) @@ -9947,7 +9947,7 @@ func (client BaseClient) RecoverAllPartitions(ctx context.Context, timeout *int6 if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "RecoverAllPartitions", err.Error()) @@ -10025,7 +10025,7 @@ func (client BaseClient) RecoverPartition(ctx context.Context, partitionID uuid. if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "RecoverPartition", err.Error()) @@ -10111,7 +10111,7 @@ func (client BaseClient) RecoverServicePartitions(ctx context.Context, serviceID if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "RecoverServicePartitions", err.Error()) @@ -10192,7 +10192,7 @@ func (client BaseClient) RecoverSystemPartitions(ctx context.Context, timeout *i if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "RecoverSystemPartitions", err.Error()) @@ -10268,7 +10268,7 @@ func (client BaseClient) RemoveComposeDeployment(ctx context.Context, deployment if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "RemoveComposeDeployment", err.Error()) @@ -10353,7 +10353,7 @@ func (client BaseClient) RemoveNodeState(ctx context.Context, nodeName string, t if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "RemoveNodeState", err.Error()) @@ -10443,7 +10443,7 @@ func (client BaseClient) RemoveReplica(ctx context.Context, nodeName string, par if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "RemoveReplica", err.Error()) @@ -10555,7 +10555,7 @@ func (client BaseClient) ReportApplicationHealth(ctx context.Context, applicatio {Target: "healthInformation.Property", Name: validation.Null, Rule: true, Chain: nil}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "ReportApplicationHealth", err.Error()) @@ -10664,7 +10664,7 @@ func (client BaseClient) ReportClusterHealth(ctx context.Context, healthInformat {Target: "healthInformation.Property", Name: validation.Null, Rule: true, Chain: nil}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "ReportClusterHealth", err.Error()) @@ -10775,7 +10775,7 @@ func (client BaseClient) ReportDeployedApplicationHealth(ctx context.Context, no {Target: "healthInformation.Property", Name: validation.Null, Rule: true, Chain: nil}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "ReportDeployedApplicationHealth", err.Error()) @@ -10893,7 +10893,7 @@ func (client BaseClient) ReportDeployedServicePackageHealth(ctx context.Context, {Target: "healthInformation.Property", Name: validation.Null, Rule: true, Chain: nil}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "ReportDeployedServicePackageHealth", err.Error()) @@ -11005,7 +11005,7 @@ func (client BaseClient) ReportNodeHealth(ctx context.Context, nodeName string, {Target: "healthInformation.Property", Name: validation.Null, Rule: true, Chain: nil}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "ReportNodeHealth", err.Error()) @@ -11115,7 +11115,7 @@ func (client BaseClient) ReportPartitionHealth(ctx context.Context, partitionID {Target: "healthInformation.Property", Name: validation.Null, Rule: true, Chain: nil}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "ReportPartitionHealth", err.Error()) @@ -11228,7 +11228,7 @@ func (client BaseClient) ReportReplicaHealth(ctx context.Context, partitionID uu {Target: "healthInformation.Property", Name: validation.Null, Rule: true, Chain: nil}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "ReportReplicaHealth", err.Error()) @@ -11344,7 +11344,7 @@ func (client BaseClient) ReportServiceHealth(ctx context.Context, serviceID stri {Target: "healthInformation.Property", Name: validation.Null, Rule: true, Chain: nil}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "ReportServiceHealth", err.Error()) @@ -11431,7 +11431,7 @@ func (client BaseClient) ResetPartitionLoad(ctx context.Context, partitionID uui if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "ResetPartitionLoad", err.Error()) @@ -11527,7 +11527,7 @@ func (client BaseClient) ResolveService(ctx context.Context, serviceID string, p if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "ResolveService", err.Error()) @@ -11629,7 +11629,7 @@ func (client BaseClient) RestartDeployedCodePackage(ctx context.Context, nodeNam {Target: "restartDeployedCodePackageDescription.CodePackageInstanceID", Name: validation.Null, Rule: true, Chain: nil}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "RestartDeployedCodePackage", err.Error()) @@ -11716,7 +11716,7 @@ func (client BaseClient) RestartNode(ctx context.Context, nodeName string, resta Constraints: []validation.Constraint{{Target: "restartNodeDescription.NodeInstanceID", Name: validation.Null, Rule: true, Chain: nil}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "RestartNode", err.Error()) @@ -11802,7 +11802,7 @@ func (client BaseClient) RestartReplica(ctx context.Context, nodeName string, pa if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "RestartReplica", err.Error()) @@ -11893,7 +11893,7 @@ func (client BaseClient) ResumeApplicationUpgrade(ctx context.Context, applicati Constraints: []validation.Constraint{{Target: "resumeApplicationUpgradeDescription.UpgradeDomainName", Name: validation.Null, Rule: true, Chain: nil}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "ResumeApplicationUpgrade", err.Error()) @@ -11978,7 +11978,7 @@ func (client BaseClient) ResumeClusterUpgrade(ctx context.Context, resumeCluster Constraints: []validation.Constraint{{Target: "resumeClusterUpgradeDescription.UpgradeDomain", Name: validation.Null, Rule: true, Chain: nil}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "ResumeClusterUpgrade", err.Error()) @@ -12063,7 +12063,7 @@ func (client BaseClient) RollbackApplicationUpgrade(ctx context.Context, applica if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "RollbackApplicationUpgrade", err.Error()) @@ -12142,7 +12142,7 @@ func (client BaseClient) RollbackClusterUpgrade(ctx context.Context, timeout *in if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "RollbackClusterUpgrade", err.Error()) @@ -12219,7 +12219,7 @@ func (client BaseClient) SetUpgradeOrchestrationServiceState(ctx context.Context if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "SetUpgradeOrchestrationServiceState", err.Error()) @@ -12308,7 +12308,7 @@ func (client BaseClient) StartApplicationUpgrade(ctx context.Context, applicatio {Target: "applicationUpgradeDescription.Parameters", Name: validation.Null, Rule: true, Chain: nil}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "StartApplicationUpgrade", err.Error()) @@ -12394,24 +12394,24 @@ func (client BaseClient) StartChaos(ctx context.Context, chaosParameters ChaosPa if err := validation.Validate([]validation.Validation{ {TargetValue: chaosParameters, Constraints: []validation.Constraint{{Target: "chaosParameters.MaxClusterStabilizationTimeoutInSeconds", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "chaosParameters.MaxClusterStabilizationTimeoutInSeconds", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "chaosParameters.MaxClusterStabilizationTimeoutInSeconds", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "chaosParameters.MaxClusterStabilizationTimeoutInSeconds", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, }}, {Target: "chaosParameters.MaxConcurrentFaults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "chaosParameters.MaxConcurrentFaults", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "chaosParameters.MaxConcurrentFaults", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "chaosParameters.MaxConcurrentFaults", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, }}, {Target: "chaosParameters.WaitTimeBetweenFaultsInSeconds", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "chaosParameters.WaitTimeBetweenFaultsInSeconds", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "chaosParameters.WaitTimeBetweenFaultsInSeconds", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "chaosParameters.WaitTimeBetweenFaultsInSeconds", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, }}, {Target: "chaosParameters.WaitTimeBetweenIterationsInSeconds", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "chaosParameters.WaitTimeBetweenIterationsInSeconds", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "chaosParameters.WaitTimeBetweenIterationsInSeconds", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "chaosParameters.WaitTimeBetweenIterationsInSeconds", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, }}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "StartChaos", err.Error()) @@ -12492,7 +12492,7 @@ func (client BaseClient) StartClusterConfigurationUpgrade(ctx context.Context, c Constraints: []validation.Constraint{{Target: "clusterConfigurationUpgradeDescription.ClusterConfig", Name: validation.Null, Rule: true, Chain: nil}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "StartClusterConfigurationUpgrade", err.Error()) @@ -12572,17 +12572,17 @@ func (client BaseClient) StartClusterUpgrade(ctx context.Context, startClusterUp {TargetValue: startClusterUpgradeDescription, Constraints: []validation.Constraint{{Target: "startClusterUpgradeDescription.ClusterUpgradeHealthPolicy", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "startClusterUpgradeDescription.ClusterUpgradeHealthPolicy.MaxPercentDeltaUnhealthyNodes", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "startClusterUpgradeDescription.ClusterUpgradeHealthPolicy.MaxPercentDeltaUnhealthyNodes", Name: validation.InclusiveMaximum, Rule: 100, Chain: nil}, + Chain: []validation.Constraint{{Target: "startClusterUpgradeDescription.ClusterUpgradeHealthPolicy.MaxPercentDeltaUnhealthyNodes", Name: validation.InclusiveMaximum, Rule: int64(100), Chain: nil}, {Target: "startClusterUpgradeDescription.ClusterUpgradeHealthPolicy.MaxPercentDeltaUnhealthyNodes", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, }}, {Target: "startClusterUpgradeDescription.ClusterUpgradeHealthPolicy.MaxPercentUpgradeDomainDeltaUnhealthyNodes", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "startClusterUpgradeDescription.ClusterUpgradeHealthPolicy.MaxPercentUpgradeDomainDeltaUnhealthyNodes", Name: validation.InclusiveMaximum, Rule: 100, Chain: nil}, + Chain: []validation.Constraint{{Target: "startClusterUpgradeDescription.ClusterUpgradeHealthPolicy.MaxPercentUpgradeDomainDeltaUnhealthyNodes", Name: validation.InclusiveMaximum, Rule: int64(100), Chain: nil}, {Target: "startClusterUpgradeDescription.ClusterUpgradeHealthPolicy.MaxPercentUpgradeDomainDeltaUnhealthyNodes", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, }}, }}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "StartClusterUpgrade", err.Error()) @@ -12665,7 +12665,7 @@ func (client BaseClient) StartComposeDeploymentUpgrade(ctx context.Context, depl {Target: "composeDeploymentUpgradeDescription.ComposeFileContent", Name: validation.Null, Rule: true, Chain: nil}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "StartComposeDeploymentUpgrade", err.Error()) @@ -12771,7 +12771,7 @@ func (client BaseClient) StartDataLoss(ctx context.Context, serviceID string, pa if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "StartDataLoss", err.Error()) @@ -12867,7 +12867,7 @@ func (client BaseClient) StartNodeTransition(ctx context.Context, nodeName strin Constraints: []validation.Constraint{{Target: "stopDurationInSeconds", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "StartNodeTransition", err.Error()) @@ -12963,7 +12963,7 @@ func (client BaseClient) StartPartitionRestart(ctx context.Context, serviceID st if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "StartPartitionRestart", err.Error()) @@ -13064,7 +13064,7 @@ func (client BaseClient) StartQuorumLoss(ctx context.Context, serviceID string, if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "StartQuorumLoss", err.Error()) @@ -13147,7 +13147,7 @@ func (client BaseClient) StopChaos(ctx context.Context, timeout *int64) (result if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "StopChaos", err.Error()) @@ -13224,7 +13224,7 @@ func (client BaseClient) SubmitPropertyBatch(ctx context.Context, nameID string, if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "SubmitPropertyBatch", err.Error()) @@ -13313,7 +13313,7 @@ func (client BaseClient) UnprovisionApplicationType(ctx context.Context, applica Constraints: []validation.Constraint{{Target: "unprovisionApplicationTypeDescriptionInfo.ApplicationTypeVersion", Name: validation.Null, Rule: true, Chain: nil}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "UnprovisionApplicationType", err.Error()) @@ -13396,7 +13396,7 @@ func (client BaseClient) UnprovisionCluster(ctx context.Context, unprovisionFabr if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "UnprovisionCluster", err.Error()) @@ -13483,7 +13483,7 @@ func (client BaseClient) UpdateApplicationUpgrade(ctx context.Context, applicati Constraints: []validation.Constraint{{Target: "applicationUpgradeUpdateDescription.Name", Name: validation.Null, Rule: true, Chain: nil}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "UpdateApplicationUpgrade", err.Error()) @@ -13566,17 +13566,17 @@ func (client BaseClient) UpdateClusterUpgrade(ctx context.Context, updateCluster {TargetValue: updateClusterUpgradeDescription, Constraints: []validation.Constraint{{Target: "updateClusterUpgradeDescription.ClusterUpgradeHealthPolicy", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "updateClusterUpgradeDescription.ClusterUpgradeHealthPolicy.MaxPercentDeltaUnhealthyNodes", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "updateClusterUpgradeDescription.ClusterUpgradeHealthPolicy.MaxPercentDeltaUnhealthyNodes", Name: validation.InclusiveMaximum, Rule: 100, Chain: nil}, + Chain: []validation.Constraint{{Target: "updateClusterUpgradeDescription.ClusterUpgradeHealthPolicy.MaxPercentDeltaUnhealthyNodes", Name: validation.InclusiveMaximum, Rule: int64(100), Chain: nil}, {Target: "updateClusterUpgradeDescription.ClusterUpgradeHealthPolicy.MaxPercentDeltaUnhealthyNodes", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, }}, {Target: "updateClusterUpgradeDescription.ClusterUpgradeHealthPolicy.MaxPercentUpgradeDomainDeltaUnhealthyNodes", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "updateClusterUpgradeDescription.ClusterUpgradeHealthPolicy.MaxPercentUpgradeDomainDeltaUnhealthyNodes", Name: validation.InclusiveMaximum, Rule: 100, Chain: nil}, + Chain: []validation.Constraint{{Target: "updateClusterUpgradeDescription.ClusterUpgradeHealthPolicy.MaxPercentUpgradeDomainDeltaUnhealthyNodes", Name: validation.InclusiveMaximum, Rule: int64(100), Chain: nil}, {Target: "updateClusterUpgradeDescription.ClusterUpgradeHealthPolicy.MaxPercentUpgradeDomainDeltaUnhealthyNodes", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, }}, }}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "UpdateClusterUpgrade", err.Error()) @@ -13803,7 +13803,7 @@ func (client BaseClient) UpdateService(ctx context.Context, serviceID string, se if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "UpdateService", err.Error()) @@ -13891,7 +13891,7 @@ func (client BaseClient) UploadFile(ctx context.Context, contentPath string, tim if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "UploadFile", err.Error()) @@ -13983,7 +13983,7 @@ func (client BaseClient) UploadFileChunk(ctx context.Context, contentPath string if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "UploadFileChunk", err.Error()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric/client.go b/vendor/github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric/client.go index 5a489cbf3..b26dac14b 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric/client.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric/client.go @@ -75,7 +75,7 @@ func (client BaseClient) BackupPartition(ctx context.Context, partitionID uuid.U if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "BackupPartition", err.Error()) @@ -187,7 +187,7 @@ func (client BaseClient) CancelOperation(ctx context.Context, operationID uuid.U if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "CancelOperation", err.Error()) @@ -336,7 +336,7 @@ func (client BaseClient) CommitImageStoreUploadSession(ctx context.Context, sess if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "CommitImageStoreUploadSession", err.Error()) @@ -417,7 +417,7 @@ func (client BaseClient) CopyImageStoreContent(ctx context.Context, imageStoreCo {Target: "imageStoreCopyDescription.RemoteDestination", Name: validation.Null, Rule: true, Chain: nil}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "CopyImageStoreContent", err.Error()) @@ -505,7 +505,7 @@ func (client BaseClient) CreateApplication(ctx context.Context, applicationDescr }}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "CreateApplication", err.Error()) @@ -586,14 +586,14 @@ func (client BaseClient) CreateBackupPolicy(ctx context.Context, backupPolicyDes Constraints: []validation.Constraint{{Target: "backupPolicyDescription.Name", Name: validation.Null, Rule: true, Chain: nil}, {Target: "backupPolicyDescription.AutoRestoreOnDataLoss", Name: validation.Null, Rule: true, Chain: nil}, {Target: "backupPolicyDescription.MaxIncrementalBackups", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "backupPolicyDescription.MaxIncrementalBackups", Name: validation.InclusiveMaximum, Rule: 255, Chain: nil}, + Chain: []validation.Constraint{{Target: "backupPolicyDescription.MaxIncrementalBackups", Name: validation.InclusiveMaximum, Rule: int64(255), Chain: nil}, {Target: "backupPolicyDescription.MaxIncrementalBackups", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, }}, {Target: "backupPolicyDescription.Schedule", Name: validation.Null, Rule: true, Chain: nil}, {Target: "backupPolicyDescription.Storage", Name: validation.Null, Rule: true, Chain: nil}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "CreateBackupPolicy", err.Error()) @@ -676,7 +676,7 @@ func (client BaseClient) CreateComposeDeployment(ctx context.Context, createComp {Target: "createComposeDeploymentDescription.ComposeFileContent", Name: validation.Null, Rule: true, Chain: nil}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "CreateComposeDeployment", err.Error()) @@ -756,7 +756,7 @@ func (client BaseClient) CreateName(ctx context.Context, nameDescription NameDes Constraints: []validation.Constraint{{Target: "nameDescription.Name", Name: validation.Null, Rule: true, Chain: nil}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "CreateName", err.Error()) @@ -924,7 +924,7 @@ func (client BaseClient) CreateService(ctx context.Context, applicationID string {Target: "serviceDescription.PartitionDescription", Name: validation.Null, Rule: true, Chain: nil}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "CreateService", err.Error()) @@ -1018,7 +1018,7 @@ func (client BaseClient) CreateServiceFromTemplate(ctx context.Context, applicat {Target: "serviceFromTemplateDescription.ServiceTypeName", Name: validation.Null, Rule: true, Chain: nil}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "CreateServiceFromTemplate", err.Error()) @@ -1112,7 +1112,7 @@ func (client BaseClient) DeleteApplication(ctx context.Context, applicationID st if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "DeleteApplication", err.Error()) @@ -1197,7 +1197,7 @@ func (client BaseClient) DeleteBackupPolicy(ctx context.Context, backupPolicyNam if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "DeleteBackupPolicy", err.Error()) @@ -1278,7 +1278,7 @@ func (client BaseClient) DeleteImageStoreContent(ctx context.Context, contentPat if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "DeleteImageStoreContent", err.Error()) @@ -1360,7 +1360,7 @@ func (client BaseClient) DeleteImageStoreUploadSession(ctx context.Context, sess if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "DeleteImageStoreUploadSession", err.Error()) @@ -1438,7 +1438,7 @@ func (client BaseClient) DeleteName(ctx context.Context, nameID string, timeout if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "DeleteName", err.Error()) @@ -1520,7 +1520,7 @@ func (client BaseClient) DeleteProperty(ctx context.Context, nameID string, prop if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "DeleteProperty", err.Error()) @@ -1679,7 +1679,7 @@ func (client BaseClient) DeleteService(ctx context.Context, serviceID string, fo if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "DeleteService", err.Error()) @@ -1772,7 +1772,7 @@ func (client BaseClient) DeployServicePackageToNode(ctx context.Context, nodeNam {Target: "deployServicePackageToNodeDescription.NodeName", Name: validation.Null, Rule: true, Chain: nil}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "DeployServicePackageToNode", err.Error()) @@ -1858,7 +1858,7 @@ func (client BaseClient) DisableApplicationBackup(ctx context.Context, applicati if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "DisableApplicationBackup", err.Error()) @@ -1944,7 +1944,7 @@ func (client BaseClient) DisableNode(ctx context.Context, nodeName string, deact if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "DisableNode", err.Error()) @@ -2029,7 +2029,7 @@ func (client BaseClient) DisablePartitionBackup(ctx context.Context, partitionID if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "DisablePartitionBackup", err.Error()) @@ -2116,7 +2116,7 @@ func (client BaseClient) DisableServiceBackup(ctx context.Context, serviceID str if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "DisableServiceBackup", err.Error()) @@ -2205,7 +2205,7 @@ func (client BaseClient) EnableApplicationBackup(ctx context.Context, applicatio Constraints: []validation.Constraint{{Target: "enableBackupDescription.BackupPolicyName", Name: validation.Null, Rule: true, Chain: nil}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "EnableApplicationBackup", err.Error()) @@ -2289,7 +2289,7 @@ func (client BaseClient) EnableNode(ctx context.Context, nodeName string, timeou if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "EnableNode", err.Error()) @@ -2376,7 +2376,7 @@ func (client BaseClient) EnablePartitionBackup(ctx context.Context, partitionID Constraints: []validation.Constraint{{Target: "enableBackupDescription.BackupPolicyName", Name: validation.Null, Rule: true, Chain: nil}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "EnablePartitionBackup", err.Error()) @@ -2470,7 +2470,7 @@ func (client BaseClient) EnableServiceBackup(ctx context.Context, serviceID stri Constraints: []validation.Constraint{{Target: "enableBackupDescription.BackupPolicyName", Name: validation.Null, Rule: true, Chain: nil}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "EnableServiceBackup", err.Error()) @@ -2622,7 +2622,7 @@ func (client BaseClient) GetAadMetadata(ctx context.Context, timeout *int64) (re if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetAadMetadata", err.Error()) @@ -2713,7 +2713,7 @@ func (client BaseClient) GetAllEntitiesBackedUpByPolicy(ctx context.Context, bac Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetAllEntitiesBackedUpByPolicy", err.Error()) @@ -2820,7 +2820,7 @@ func (client BaseClient) GetApplicationBackupConfigurationInfo(ctx context.Conte Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetApplicationBackupConfigurationInfo", err.Error()) @@ -2934,7 +2934,7 @@ func (client BaseClient) GetApplicationBackupList(ctx context.Context, applicati if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}, {TargetValue: maxResults, @@ -3049,7 +3049,7 @@ func (client BaseClient) GetApplicationEventList(ctx context.Context, applicatio if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetApplicationEventList", err.Error()) @@ -3199,7 +3199,7 @@ func (client BaseClient) GetApplicationHealth(ctx context.Context, applicationID if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetApplicationHealth", err.Error()) @@ -3363,7 +3363,7 @@ func (client BaseClient) GetApplicationHealthUsingPolicy(ctx context.Context, ap if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetApplicationHealthUsingPolicy", err.Error()) @@ -3477,7 +3477,7 @@ func (client BaseClient) GetApplicationInfo(ctx context.Context, applicationID s if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetApplicationInfo", err.Error()) @@ -3590,7 +3590,7 @@ func (client BaseClient) GetApplicationInfoList(ctx context.Context, application Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetApplicationInfoList", err.Error()) @@ -3695,7 +3695,7 @@ func (client BaseClient) GetApplicationLoadInfo(ctx context.Context, application if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetApplicationLoadInfo", err.Error()) @@ -3778,7 +3778,7 @@ func (client BaseClient) GetApplicationManifest(ctx context.Context, application if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetApplicationManifest", err.Error()) @@ -3865,7 +3865,7 @@ func (client BaseClient) GetApplicationNameInfo(ctx context.Context, serviceID s if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetApplicationNameInfo", err.Error()) @@ -3953,7 +3953,7 @@ func (client BaseClient) GetApplicationsEventList(ctx context.Context, startTime if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetApplicationsEventList", err.Error()) @@ -4069,7 +4069,7 @@ func (client BaseClient) GetApplicationTypeInfoList(ctx context.Context, applica Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetApplicationTypeInfoList", err.Error()) @@ -4189,7 +4189,7 @@ func (client BaseClient) GetApplicationTypeInfoListByName(ctx context.Context, a Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetApplicationTypeInfoListByName", err.Error()) @@ -4291,7 +4291,7 @@ func (client BaseClient) GetApplicationUpgrade(ctx context.Context, applicationI if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetApplicationUpgrade", err.Error()) @@ -4372,7 +4372,7 @@ func (client BaseClient) GetBackupPolicyByName(ctx context.Context, backupPolicy if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetBackupPolicyByName", err.Error()) @@ -4465,7 +4465,7 @@ func (client BaseClient) GetBackupPolicyList(ctx context.Context, continuationTo Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetBackupPolicyList", err.Error()) @@ -4562,7 +4562,7 @@ func (client BaseClient) GetBackupsFromBackupLocation(ctx context.Context, getBa if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}, {TargetValue: maxResults, @@ -4655,7 +4655,7 @@ func (client BaseClient) GetChaos(ctx context.Context, timeout *int64) (result C if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetChaos", err.Error()) @@ -4756,7 +4756,7 @@ func (client BaseClient) GetChaosEvents(ctx context.Context, continuationToken s Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetChaosEvents", err.Error()) @@ -4908,7 +4908,7 @@ func (client BaseClient) GetClusterConfiguration(ctx context.Context, configurat if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetClusterConfiguration", err.Error()) @@ -4986,7 +4986,7 @@ func (client BaseClient) GetClusterConfigurationUpgradeStatus(ctx context.Contex if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetClusterConfigurationUpgradeStatus", err.Error()) @@ -5070,7 +5070,7 @@ func (client BaseClient) GetClusterEventList(ctx context.Context, startTimeUtc s if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetClusterEventList", err.Error()) @@ -5222,7 +5222,7 @@ func (client BaseClient) GetClusterHealth(ctx context.Context, nodesHealthStateF if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetClusterHealth", err.Error()) @@ -5326,7 +5326,7 @@ func (client BaseClient) GetClusterHealthChunk(ctx context.Context, timeout *int if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetClusterHealthChunk", err.Error()) @@ -5424,7 +5424,7 @@ func (client BaseClient) GetClusterHealthChunkUsingPolicyAndAdvancedFilters(ctx if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetClusterHealthChunkUsingPolicyAndAdvancedFilters", err.Error()) @@ -5579,7 +5579,7 @@ func (client BaseClient) GetClusterHealthUsingPolicy(ctx context.Context, nodesH if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetClusterHealthUsingPolicy", err.Error()) @@ -5695,7 +5695,7 @@ func (client BaseClient) GetClusterManifest(ctx context.Context, timeout *int64) if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetClusterManifest", err.Error()) @@ -5772,7 +5772,7 @@ func (client BaseClient) GetClusterUpgradeProgress(ctx context.Context, timeout if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetClusterUpgradeProgress", err.Error()) @@ -5851,7 +5851,7 @@ func (client BaseClient) GetComposeDeploymentStatus(ctx context.Context, deploym if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetComposeDeploymentStatus", err.Error()) @@ -5947,7 +5947,7 @@ func (client BaseClient) GetComposeDeploymentStatusList(ctx context.Context, con Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetComposeDeploymentStatusList", err.Error()) @@ -6033,7 +6033,7 @@ func (client BaseClient) GetComposeDeploymentUpgradeProgress(ctx context.Context if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetComposeDeploymentUpgradeProgress", err.Error()) @@ -6126,7 +6126,7 @@ func (client BaseClient) GetContainerLogsDeployedOnNode(ctx context.Context, nod if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetContainerLogsDeployedOnNode", err.Error()) @@ -6225,7 +6225,7 @@ func (client BaseClient) GetContainersEventList(ctx context.Context, startTimeUt if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetContainersEventList", err.Error()) @@ -6313,7 +6313,7 @@ func (client BaseClient) GetCorrelatedEventList(ctx context.Context, eventInstan if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetCorrelatedEventList", err.Error()) @@ -6401,7 +6401,7 @@ func (client BaseClient) GetDataLossProgress(ctx context.Context, serviceID stri if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetDataLossProgress", err.Error()) @@ -6528,7 +6528,7 @@ func (client BaseClient) GetDeployedApplicationHealth(ctx context.Context, nodeN if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetDeployedApplicationHealth", err.Error()) @@ -6676,7 +6676,7 @@ func (client BaseClient) GetDeployedApplicationHealthUsingPolicy(ctx context.Con if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetDeployedApplicationHealthUsingPolicy", err.Error()) @@ -6792,7 +6792,7 @@ func (client BaseClient) GetDeployedApplicationInfo(ctx context.Context, nodeNam if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetDeployedApplicationInfo", err.Error()) @@ -6898,7 +6898,7 @@ func (client BaseClient) GetDeployedApplicationInfoList(ctx context.Context, nod if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}, {TargetValue: maxResults, @@ -7005,7 +7005,7 @@ func (client BaseClient) GetDeployedCodePackageInfoList(ctx context.Context, nod if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetDeployedCodePackageInfoList", err.Error()) @@ -7116,7 +7116,7 @@ func (client BaseClient) GetDeployedServicePackageHealth(ctx context.Context, no if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetDeployedServicePackageHealth", err.Error()) @@ -7234,7 +7234,7 @@ func (client BaseClient) GetDeployedServicePackageHealthUsingPolicy(ctx context. if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetDeployedServicePackageHealthUsingPolicy", err.Error()) @@ -7333,7 +7333,7 @@ func (client BaseClient) GetDeployedServicePackageInfoList(ctx context.Context, if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetDeployedServicePackageInfoList", err.Error()) @@ -7423,7 +7423,7 @@ func (client BaseClient) GetDeployedServicePackageInfoListByName(ctx context.Con if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetDeployedServicePackageInfoListByName", err.Error()) @@ -7510,7 +7510,7 @@ func (client BaseClient) GetDeployedServiceReplicaDetailInfo(ctx context.Context if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetDeployedServiceReplicaDetailInfo", err.Error()) @@ -7596,7 +7596,7 @@ func (client BaseClient) GetDeployedServiceReplicaDetailInfoByPartitionID(ctx co if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetDeployedServiceReplicaDetailInfoByPartitionID", err.Error()) @@ -7689,7 +7689,7 @@ func (client BaseClient) GetDeployedServiceReplicaInfoList(ctx context.Context, if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetDeployedServiceReplicaInfoList", err.Error()) @@ -7789,7 +7789,7 @@ func (client BaseClient) GetDeployedServiceTypeInfoByName(ctx context.Context, n if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetDeployedServiceTypeInfoByName", err.Error()) @@ -7885,7 +7885,7 @@ func (client BaseClient) GetDeployedServiceTypeInfoList(ctx context.Context, nod if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetDeployedServiceTypeInfoList", err.Error()) @@ -7983,7 +7983,7 @@ func (client BaseClient) GetFaultOperationList(ctx context.Context, typeFilter i if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetFaultOperationList", err.Error()) @@ -8063,7 +8063,7 @@ func (client BaseClient) GetImageStoreContent(ctx context.Context, contentPath s if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetImageStoreContent", err.Error()) @@ -8143,7 +8143,7 @@ func (client BaseClient) GetImageStoreRootContent(ctx context.Context, timeout * if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetImageStoreRootContent", err.Error()) @@ -8222,7 +8222,7 @@ func (client BaseClient) GetImageStoreUploadSessionByID(ctx context.Context, ses if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetImageStoreUploadSessionByID", err.Error()) @@ -8301,7 +8301,7 @@ func (client BaseClient) GetImageStoreUploadSessionByPath(ctx context.Context, c if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetImageStoreUploadSessionByPath", err.Error()) @@ -8382,7 +8382,7 @@ func (client BaseClient) GetNameExistsInfo(ctx context.Context, nameID string, t if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetNameExistsInfo", err.Error()) @@ -8470,7 +8470,7 @@ func (client BaseClient) GetNodeEventList(ctx context.Context, nodeName string, if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetNodeEventList", err.Error()) @@ -8579,7 +8579,7 @@ func (client BaseClient) GetNodeHealth(ctx context.Context, nodeName string, eve if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetNodeHealth", err.Error()) @@ -8685,7 +8685,7 @@ func (client BaseClient) GetNodeHealthUsingPolicy(ctx context.Context, nodeName if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetNodeHealthUsingPolicy", err.Error()) @@ -8777,7 +8777,7 @@ func (client BaseClient) GetNodeInfo(ctx context.Context, nodeName string, timeo if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetNodeInfo", err.Error()) @@ -8865,7 +8865,7 @@ func (client BaseClient) GetNodeInfoList(ctx context.Context, continuationToken if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetNodeInfoList", err.Error()) @@ -8951,7 +8951,7 @@ func (client BaseClient) GetNodeLoadInfo(ctx context.Context, nodeName string, t if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetNodeLoadInfo", err.Error()) @@ -9039,7 +9039,7 @@ func (client BaseClient) GetNodesEventList(ctx context.Context, startTimeUtc str if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetNodesEventList", err.Error()) @@ -9130,7 +9130,7 @@ func (client BaseClient) GetNodeTransitionProgress(ctx context.Context, nodeName if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetNodeTransitionProgress", err.Error()) @@ -9213,7 +9213,7 @@ func (client BaseClient) GetPartitionBackupConfigurationInfo(ctx context.Context if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetPartitionBackupConfigurationInfo", err.Error()) @@ -9304,7 +9304,7 @@ func (client BaseClient) GetPartitionBackupList(ctx context.Context, partitionID if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetPartitionBackupList", err.Error()) @@ -9397,7 +9397,7 @@ func (client BaseClient) GetPartitionBackupProgress(ctx context.Context, partiti if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetPartitionBackupProgress", err.Error()) @@ -9486,7 +9486,7 @@ func (client BaseClient) GetPartitionEventList(ctx context.Context, partitionID if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetPartitionEventList", err.Error()) @@ -9615,7 +9615,7 @@ func (client BaseClient) GetPartitionHealth(ctx context.Context, partitionID uui if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetPartitionHealth", err.Error()) @@ -9756,7 +9756,7 @@ func (client BaseClient) GetPartitionHealthUsingPolicy(ctx context.Context, part if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetPartitionHealthUsingPolicy", err.Error()) @@ -9859,7 +9859,7 @@ func (client BaseClient) GetPartitionInfo(ctx context.Context, partitionID uuid. if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetPartitionInfo", err.Error()) @@ -9951,7 +9951,7 @@ func (client BaseClient) GetPartitionInfoList(ctx context.Context, serviceID str if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetPartitionInfoList", err.Error()) @@ -10037,7 +10037,7 @@ func (client BaseClient) GetPartitionLoadInformation(ctx context.Context, partit if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetPartitionLoadInformation", err.Error()) @@ -10127,7 +10127,7 @@ func (client BaseClient) GetPartitionReplicaEventList(ctx context.Context, parti if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetPartitionReplicaEventList", err.Error()) @@ -10228,7 +10228,7 @@ func (client BaseClient) GetPartitionReplicasEventList(ctx context.Context, part if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetPartitionReplicasEventList", err.Error()) @@ -10328,7 +10328,7 @@ func (client BaseClient) GetPartitionRestartProgress(ctx context.Context, servic if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetPartitionRestartProgress", err.Error()) @@ -10412,7 +10412,7 @@ func (client BaseClient) GetPartitionRestoreProgress(ctx context.Context, partit if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetPartitionRestoreProgress", err.Error()) @@ -10500,7 +10500,7 @@ func (client BaseClient) GetPartitionsEventList(ctx context.Context, startTimeUt if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetPartitionsEventList", err.Error()) @@ -10590,7 +10590,7 @@ func (client BaseClient) GetPropertyInfo(ctx context.Context, nameID string, pro if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetPropertyInfo", err.Error()) @@ -10681,7 +10681,7 @@ func (client BaseClient) GetPropertyInfoList(ctx context.Context, nameID string, if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetPropertyInfoList", err.Error()) @@ -10772,7 +10772,7 @@ func (client BaseClient) GetProvisionedFabricCodeVersionInfoList(ctx context.Con if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetProvisionedFabricCodeVersionInfoList", err.Error()) @@ -10854,7 +10854,7 @@ func (client BaseClient) GetProvisionedFabricConfigVersionInfoList(ctx context.C if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetProvisionedFabricConfigVersionInfoList", err.Error()) @@ -10942,7 +10942,7 @@ func (client BaseClient) GetQuorumLossProgress(ctx context.Context, serviceID st if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetQuorumLossProgress", err.Error()) @@ -11122,7 +11122,7 @@ func (client BaseClient) GetReplicaHealth(ctx context.Context, partitionID uuid. if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetReplicaHealth", err.Error()) @@ -11235,7 +11235,7 @@ func (client BaseClient) GetReplicaHealthUsingPolicy(ctx context.Context, partit if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetReplicaHealthUsingPolicy", err.Error()) @@ -11329,7 +11329,7 @@ func (client BaseClient) GetReplicaInfo(ctx context.Context, partitionID uuid.UU if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetReplicaInfo", err.Error()) @@ -11417,7 +11417,7 @@ func (client BaseClient) GetReplicaInfoList(ctx context.Context, partitionID uui if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetReplicaInfoList", err.Error()) @@ -11519,7 +11519,7 @@ func (client BaseClient) GetServiceBackupConfigurationInfo(ctx context.Context, Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetServiceBackupConfigurationInfo", err.Error()) @@ -11633,7 +11633,7 @@ func (client BaseClient) GetServiceBackupList(ctx context.Context, serviceID str if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}, {TargetValue: maxResults, @@ -11741,7 +11741,7 @@ func (client BaseClient) GetServiceDescription(ctx context.Context, serviceID st if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetServiceDescription", err.Error()) @@ -11834,7 +11834,7 @@ func (client BaseClient) GetServiceEventList(ctx context.Context, serviceID stri if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetServiceEventList", err.Error()) @@ -11969,7 +11969,7 @@ func (client BaseClient) GetServiceHealth(ctx context.Context, serviceID string, if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetServiceHealth", err.Error()) @@ -12115,7 +12115,7 @@ func (client BaseClient) GetServiceHealthUsingPolicy(ctx context.Context, servic if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetServiceHealthUsingPolicy", err.Error()) @@ -12226,7 +12226,7 @@ func (client BaseClient) GetServiceInfo(ctx context.Context, applicationID strin if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetServiceInfo", err.Error()) @@ -12319,7 +12319,7 @@ func (client BaseClient) GetServiceInfoList(ctx context.Context, applicationID s if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetServiceInfoList", err.Error()) @@ -12410,7 +12410,7 @@ func (client BaseClient) GetServiceManifest(ctx context.Context, applicationType if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetServiceManifest", err.Error()) @@ -12494,7 +12494,7 @@ func (client BaseClient) GetServiceNameInfo(ctx context.Context, partitionID uui if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetServiceNameInfo", err.Error()) @@ -12582,7 +12582,7 @@ func (client BaseClient) GetServicesEventList(ctx context.Context, startTimeUtc if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetServicesEventList", err.Error()) @@ -12674,7 +12674,7 @@ func (client BaseClient) GetServiceTypeInfoByName(ctx context.Context, applicati if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetServiceTypeInfoByName", err.Error()) @@ -12760,7 +12760,7 @@ func (client BaseClient) GetServiceTypeInfoList(ctx context.Context, application if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetServiceTypeInfoList", err.Error()) @@ -12850,7 +12850,7 @@ func (client BaseClient) GetSubNameInfoList(ctx context.Context, nameID string, if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetSubNameInfoList", err.Error()) @@ -12939,7 +12939,7 @@ func (client BaseClient) GetUpgradeOrchestrationServiceState(ctx context.Context if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "GetUpgradeOrchestrationServiceState", err.Error()) @@ -13028,7 +13028,7 @@ func (client BaseClient) InvokeContainerAPI(ctx context.Context, nodeName string if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}, {TargetValue: containerAPIRequestBody, @@ -13127,7 +13127,7 @@ func (client BaseClient) InvokeInfrastructureCommand(ctx context.Context, comman if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "InvokeInfrastructureCommand", err.Error()) @@ -13218,7 +13218,7 @@ func (client BaseClient) InvokeInfrastructureQuery(ctx context.Context, command if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "InvokeInfrastructureQuery", err.Error()) @@ -13379,7 +13379,7 @@ func (client BaseClient) ProvisionApplicationType(ctx context.Context, provision Constraints: []validation.Constraint{{Target: "provisionApplicationTypeDescriptionBaseRequiredBodyParam.Async", Name: validation.Null, Rule: true, Chain: nil}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "ProvisionApplicationType", err.Error()) @@ -13457,7 +13457,7 @@ func (client BaseClient) ProvisionCluster(ctx context.Context, provisionFabricDe if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "ProvisionCluster", err.Error()) @@ -13539,7 +13539,7 @@ func (client BaseClient) PutProperty(ctx context.Context, nameID string, propert {Target: "propertyDescription.Value", Name: validation.Null, Rule: true, Chain: nil}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "PutProperty", err.Error()) @@ -13623,7 +13623,7 @@ func (client BaseClient) RecoverAllPartitions(ctx context.Context, timeout *int6 if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "RecoverAllPartitions", err.Error()) @@ -13701,7 +13701,7 @@ func (client BaseClient) RecoverPartition(ctx context.Context, partitionID uuid. if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "RecoverPartition", err.Error()) @@ -13787,7 +13787,7 @@ func (client BaseClient) RecoverServicePartitions(ctx context.Context, serviceID if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "RecoverServicePartitions", err.Error()) @@ -13868,7 +13868,7 @@ func (client BaseClient) RecoverSystemPartitions(ctx context.Context, timeout *i if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "RecoverSystemPartitions", err.Error()) @@ -13944,7 +13944,7 @@ func (client BaseClient) RemoveComposeDeployment(ctx context.Context, deployment if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "RemoveComposeDeployment", err.Error()) @@ -14029,7 +14029,7 @@ func (client BaseClient) RemoveNodeState(ctx context.Context, nodeName string, t if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "RemoveNodeState", err.Error()) @@ -14119,7 +14119,7 @@ func (client BaseClient) RemoveReplica(ctx context.Context, nodeName string, par if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "RemoveReplica", err.Error()) @@ -14231,7 +14231,7 @@ func (client BaseClient) ReportApplicationHealth(ctx context.Context, applicatio {Target: "healthInformation.Property", Name: validation.Null, Rule: true, Chain: nil}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "ReportApplicationHealth", err.Error()) @@ -14340,7 +14340,7 @@ func (client BaseClient) ReportClusterHealth(ctx context.Context, healthInformat {Target: "healthInformation.Property", Name: validation.Null, Rule: true, Chain: nil}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "ReportClusterHealth", err.Error()) @@ -14451,7 +14451,7 @@ func (client BaseClient) ReportDeployedApplicationHealth(ctx context.Context, no {Target: "healthInformation.Property", Name: validation.Null, Rule: true, Chain: nil}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "ReportDeployedApplicationHealth", err.Error()) @@ -14569,7 +14569,7 @@ func (client BaseClient) ReportDeployedServicePackageHealth(ctx context.Context, {Target: "healthInformation.Property", Name: validation.Null, Rule: true, Chain: nil}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "ReportDeployedServicePackageHealth", err.Error()) @@ -14681,7 +14681,7 @@ func (client BaseClient) ReportNodeHealth(ctx context.Context, nodeName string, {Target: "healthInformation.Property", Name: validation.Null, Rule: true, Chain: nil}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "ReportNodeHealth", err.Error()) @@ -14791,7 +14791,7 @@ func (client BaseClient) ReportPartitionHealth(ctx context.Context, partitionID {Target: "healthInformation.Property", Name: validation.Null, Rule: true, Chain: nil}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "ReportPartitionHealth", err.Error()) @@ -14904,7 +14904,7 @@ func (client BaseClient) ReportReplicaHealth(ctx context.Context, partitionID uu {Target: "healthInformation.Property", Name: validation.Null, Rule: true, Chain: nil}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "ReportReplicaHealth", err.Error()) @@ -15020,7 +15020,7 @@ func (client BaseClient) ReportServiceHealth(ctx context.Context, serviceID stri {Target: "healthInformation.Property", Name: validation.Null, Rule: true, Chain: nil}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "ReportServiceHealth", err.Error()) @@ -15107,7 +15107,7 @@ func (client BaseClient) ResetPartitionLoad(ctx context.Context, partitionID uui if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "ResetPartitionLoad", err.Error()) @@ -15203,7 +15203,7 @@ func (client BaseClient) ResolveService(ctx context.Context, serviceID string, p if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "ResolveService", err.Error()) @@ -15305,7 +15305,7 @@ func (client BaseClient) RestartDeployedCodePackage(ctx context.Context, nodeNam {Target: "restartDeployedCodePackageDescription.CodePackageInstanceID", Name: validation.Null, Rule: true, Chain: nil}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "RestartDeployedCodePackage", err.Error()) @@ -15392,7 +15392,7 @@ func (client BaseClient) RestartNode(ctx context.Context, nodeName string, resta Constraints: []validation.Constraint{{Target: "restartNodeDescription.NodeInstanceID", Name: validation.Null, Rule: true, Chain: nil}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "RestartNode", err.Error()) @@ -15478,7 +15478,7 @@ func (client BaseClient) RestartReplica(ctx context.Context, nodeName string, pa if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "RestartReplica", err.Error()) @@ -15574,7 +15574,7 @@ func (client BaseClient) RestorePartition(ctx context.Context, partitionID uuid. {Target: "restorePartitionDescription.BackupLocation", Name: validation.Null, Rule: true, Chain: nil}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "RestorePartition", err.Error()) @@ -15666,7 +15666,7 @@ func (client BaseClient) ResumeApplicationBackup(ctx context.Context, applicatio if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "ResumeApplicationBackup", err.Error()) @@ -15755,7 +15755,7 @@ func (client BaseClient) ResumeApplicationUpgrade(ctx context.Context, applicati Constraints: []validation.Constraint{{Target: "resumeApplicationUpgradeDescription.UpgradeDomainName", Name: validation.Null, Rule: true, Chain: nil}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "ResumeApplicationUpgrade", err.Error()) @@ -15840,7 +15840,7 @@ func (client BaseClient) ResumeClusterUpgrade(ctx context.Context, resumeCluster Constraints: []validation.Constraint{{Target: "resumeClusterUpgradeDescription.UpgradeDomain", Name: validation.Null, Rule: true, Chain: nil}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "ResumeClusterUpgrade", err.Error()) @@ -15919,7 +15919,7 @@ func (client BaseClient) ResumePartitionBackup(ctx context.Context, partitionID if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "ResumePartitionBackup", err.Error()) @@ -16004,7 +16004,7 @@ func (client BaseClient) ResumeServiceBackup(ctx context.Context, serviceID stri if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "ResumeServiceBackup", err.Error()) @@ -16091,7 +16091,7 @@ func (client BaseClient) RollbackApplicationUpgrade(ctx context.Context, applica if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "RollbackApplicationUpgrade", err.Error()) @@ -16170,7 +16170,7 @@ func (client BaseClient) RollbackClusterUpgrade(ctx context.Context, timeout *in if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "RollbackClusterUpgrade", err.Error()) @@ -16247,7 +16247,7 @@ func (client BaseClient) SetUpgradeOrchestrationServiceState(ctx context.Context if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "SetUpgradeOrchestrationServiceState", err.Error()) @@ -16336,7 +16336,7 @@ func (client BaseClient) StartApplicationUpgrade(ctx context.Context, applicatio {Target: "applicationUpgradeDescription.Parameters", Name: validation.Null, Rule: true, Chain: nil}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "StartApplicationUpgrade", err.Error()) @@ -16422,24 +16422,24 @@ func (client BaseClient) StartChaos(ctx context.Context, chaosParameters ChaosPa if err := validation.Validate([]validation.Validation{ {TargetValue: chaosParameters, Constraints: []validation.Constraint{{Target: "chaosParameters.MaxClusterStabilizationTimeoutInSeconds", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "chaosParameters.MaxClusterStabilizationTimeoutInSeconds", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "chaosParameters.MaxClusterStabilizationTimeoutInSeconds", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "chaosParameters.MaxClusterStabilizationTimeoutInSeconds", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, }}, {Target: "chaosParameters.MaxConcurrentFaults", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "chaosParameters.MaxConcurrentFaults", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "chaosParameters.MaxConcurrentFaults", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "chaosParameters.MaxConcurrentFaults", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, }}, {Target: "chaosParameters.WaitTimeBetweenFaultsInSeconds", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "chaosParameters.WaitTimeBetweenFaultsInSeconds", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "chaosParameters.WaitTimeBetweenFaultsInSeconds", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "chaosParameters.WaitTimeBetweenFaultsInSeconds", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, }}, {Target: "chaosParameters.WaitTimeBetweenIterationsInSeconds", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "chaosParameters.WaitTimeBetweenIterationsInSeconds", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "chaosParameters.WaitTimeBetweenIterationsInSeconds", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "chaosParameters.WaitTimeBetweenIterationsInSeconds", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, }}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "StartChaos", err.Error()) @@ -16520,7 +16520,7 @@ func (client BaseClient) StartClusterConfigurationUpgrade(ctx context.Context, c Constraints: []validation.Constraint{{Target: "clusterConfigurationUpgradeDescription.ClusterConfig", Name: validation.Null, Rule: true, Chain: nil}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "StartClusterConfigurationUpgrade", err.Error()) @@ -16600,17 +16600,17 @@ func (client BaseClient) StartClusterUpgrade(ctx context.Context, startClusterUp {TargetValue: startClusterUpgradeDescription, Constraints: []validation.Constraint{{Target: "startClusterUpgradeDescription.ClusterUpgradeHealthPolicy", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "startClusterUpgradeDescription.ClusterUpgradeHealthPolicy.MaxPercentDeltaUnhealthyNodes", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "startClusterUpgradeDescription.ClusterUpgradeHealthPolicy.MaxPercentDeltaUnhealthyNodes", Name: validation.InclusiveMaximum, Rule: 100, Chain: nil}, + Chain: []validation.Constraint{{Target: "startClusterUpgradeDescription.ClusterUpgradeHealthPolicy.MaxPercentDeltaUnhealthyNodes", Name: validation.InclusiveMaximum, Rule: int64(100), Chain: nil}, {Target: "startClusterUpgradeDescription.ClusterUpgradeHealthPolicy.MaxPercentDeltaUnhealthyNodes", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, }}, {Target: "startClusterUpgradeDescription.ClusterUpgradeHealthPolicy.MaxPercentUpgradeDomainDeltaUnhealthyNodes", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "startClusterUpgradeDescription.ClusterUpgradeHealthPolicy.MaxPercentUpgradeDomainDeltaUnhealthyNodes", Name: validation.InclusiveMaximum, Rule: 100, Chain: nil}, + Chain: []validation.Constraint{{Target: "startClusterUpgradeDescription.ClusterUpgradeHealthPolicy.MaxPercentUpgradeDomainDeltaUnhealthyNodes", Name: validation.InclusiveMaximum, Rule: int64(100), Chain: nil}, {Target: "startClusterUpgradeDescription.ClusterUpgradeHealthPolicy.MaxPercentUpgradeDomainDeltaUnhealthyNodes", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, }}, }}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "StartClusterUpgrade", err.Error()) @@ -16693,7 +16693,7 @@ func (client BaseClient) StartComposeDeploymentUpgrade(ctx context.Context, depl {Target: "composeDeploymentUpgradeDescription.ComposeFileContent", Name: validation.Null, Rule: true, Chain: nil}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "StartComposeDeploymentUpgrade", err.Error()) @@ -16799,7 +16799,7 @@ func (client BaseClient) StartDataLoss(ctx context.Context, serviceID string, pa if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "StartDataLoss", err.Error()) @@ -16895,7 +16895,7 @@ func (client BaseClient) StartNodeTransition(ctx context.Context, nodeName strin Constraints: []validation.Constraint{{Target: "stopDurationInSeconds", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "StartNodeTransition", err.Error()) @@ -16991,7 +16991,7 @@ func (client BaseClient) StartPartitionRestart(ctx context.Context, serviceID st if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "StartPartitionRestart", err.Error()) @@ -17092,7 +17092,7 @@ func (client BaseClient) StartQuorumLoss(ctx context.Context, serviceID string, if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "StartQuorumLoss", err.Error()) @@ -17178,7 +17178,7 @@ func (client BaseClient) StopChaos(ctx context.Context, timeout *int64) (result if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "StopChaos", err.Error()) @@ -17255,7 +17255,7 @@ func (client BaseClient) SubmitPropertyBatch(ctx context.Context, nameID string, if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "SubmitPropertyBatch", err.Error()) @@ -17344,7 +17344,7 @@ func (client BaseClient) SuspendApplicationBackup(ctx context.Context, applicati if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "SuspendApplicationBackup", err.Error()) @@ -17425,7 +17425,7 @@ func (client BaseClient) SuspendPartitionBackup(ctx context.Context, partitionID if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "SuspendPartitionBackup", err.Error()) @@ -17511,7 +17511,7 @@ func (client BaseClient) SuspendServiceBackup(ctx context.Context, serviceID str if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "SuspendServiceBackup", err.Error()) @@ -17597,7 +17597,7 @@ func (client BaseClient) UnprovisionApplicationType(ctx context.Context, applica Constraints: []validation.Constraint{{Target: "unprovisionApplicationTypeDescriptionInfo.ApplicationTypeVersion", Name: validation.Null, Rule: true, Chain: nil}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "UnprovisionApplicationType", err.Error()) @@ -17680,7 +17680,7 @@ func (client BaseClient) UnprovisionCluster(ctx context.Context, unprovisionFabr if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "UnprovisionCluster", err.Error()) @@ -17767,7 +17767,7 @@ func (client BaseClient) UpdateApplicationUpgrade(ctx context.Context, applicati Constraints: []validation.Constraint{{Target: "applicationUpgradeUpdateDescription.Name", Name: validation.Null, Rule: true, Chain: nil}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "UpdateApplicationUpgrade", err.Error()) @@ -17852,14 +17852,14 @@ func (client BaseClient) UpdateBackupPolicy(ctx context.Context, backupPolicyDes Constraints: []validation.Constraint{{Target: "backupPolicyDescription.Name", Name: validation.Null, Rule: true, Chain: nil}, {Target: "backupPolicyDescription.AutoRestoreOnDataLoss", Name: validation.Null, Rule: true, Chain: nil}, {Target: "backupPolicyDescription.MaxIncrementalBackups", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "backupPolicyDescription.MaxIncrementalBackups", Name: validation.InclusiveMaximum, Rule: 255, Chain: nil}, + Chain: []validation.Constraint{{Target: "backupPolicyDescription.MaxIncrementalBackups", Name: validation.InclusiveMaximum, Rule: int64(255), Chain: nil}, {Target: "backupPolicyDescription.MaxIncrementalBackups", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, }}, {Target: "backupPolicyDescription.Schedule", Name: validation.Null, Rule: true, Chain: nil}, {Target: "backupPolicyDescription.Storage", Name: validation.Null, Rule: true, Chain: nil}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "UpdateBackupPolicy", err.Error()) @@ -17942,17 +17942,17 @@ func (client BaseClient) UpdateClusterUpgrade(ctx context.Context, updateCluster {TargetValue: updateClusterUpgradeDescription, Constraints: []validation.Constraint{{Target: "updateClusterUpgradeDescription.ClusterUpgradeHealthPolicy", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "updateClusterUpgradeDescription.ClusterUpgradeHealthPolicy.MaxPercentDeltaUnhealthyNodes", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "updateClusterUpgradeDescription.ClusterUpgradeHealthPolicy.MaxPercentDeltaUnhealthyNodes", Name: validation.InclusiveMaximum, Rule: 100, Chain: nil}, + Chain: []validation.Constraint{{Target: "updateClusterUpgradeDescription.ClusterUpgradeHealthPolicy.MaxPercentDeltaUnhealthyNodes", Name: validation.InclusiveMaximum, Rule: int64(100), Chain: nil}, {Target: "updateClusterUpgradeDescription.ClusterUpgradeHealthPolicy.MaxPercentDeltaUnhealthyNodes", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, }}, {Target: "updateClusterUpgradeDescription.ClusterUpgradeHealthPolicy.MaxPercentUpgradeDomainDeltaUnhealthyNodes", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "updateClusterUpgradeDescription.ClusterUpgradeHealthPolicy.MaxPercentUpgradeDomainDeltaUnhealthyNodes", Name: validation.InclusiveMaximum, Rule: 100, Chain: nil}, + Chain: []validation.Constraint{{Target: "updateClusterUpgradeDescription.ClusterUpgradeHealthPolicy.MaxPercentUpgradeDomainDeltaUnhealthyNodes", Name: validation.InclusiveMaximum, Rule: int64(100), Chain: nil}, {Target: "updateClusterUpgradeDescription.ClusterUpgradeHealthPolicy.MaxPercentUpgradeDomainDeltaUnhealthyNodes", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, }}, }}}}, {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "UpdateClusterUpgrade", err.Error()) @@ -18179,7 +18179,7 @@ func (client BaseClient) UpdateService(ctx context.Context, serviceID string, se if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "UpdateService", err.Error()) @@ -18267,7 +18267,7 @@ func (client BaseClient) UploadFile(ctx context.Context, contentPath string, tim if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "UploadFile", err.Error()) @@ -18359,7 +18359,7 @@ func (client BaseClient) UploadFileChunk(ctx context.Context, contentPath string if err := validation.Validate([]validation.Validation{ {TargetValue: timeout, Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil}, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("servicefabric.BaseClient", "UploadFileChunk", err.Error()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/storage/datalake/2018-06-17/storagedatalake/client.go b/vendor/github.com/Azure/azure-sdk-for-go/services/storage/datalake/2018-06-17/storagedatalake/client.go new file mode 100644 index 000000000..3c0a26892 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/storage/datalake/2018-06-17/storagedatalake/client.go @@ -0,0 +1,53 @@ +// Package storagedatalake implements the Azure ARM Storagedatalake service API version 2018-06-17. +// +// Azure Data Lake Storage provides storage for Hadoop and other big data workloads. +package storagedatalake + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/Azure/go-autorest/autorest" +) + +const ( + // DefaultDNSSuffix is the default value for dns suffix + DefaultDNSSuffix = "dfs.core.windows.net" +) + +// BaseClient is the base client for Storagedatalake. +type BaseClient struct { + autorest.Client + XMsVersion string + AccountName string + DNSSuffix string +} + +// New creates an instance of the BaseClient client. +func New(xMsVersion string, accountName string) BaseClient { + return NewWithoutDefaults(xMsVersion, accountName, DefaultDNSSuffix) +} + +// NewWithoutDefaults creates an instance of the BaseClient client. +func NewWithoutDefaults(xMsVersion string, accountName string, dNSSuffix string) BaseClient { + return BaseClient{ + Client: autorest.NewClientWithUserAgent(UserAgent()), + XMsVersion: xMsVersion, + AccountName: accountName, + DNSSuffix: dNSSuffix, + } +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/storage/datalake/2018-06-17/storagedatalake/filesystem.go b/vendor/github.com/Azure/azure-sdk-for-go/services/storage/datalake/2018-06-17/storagedatalake/filesystem.go new file mode 100644 index 000000000..a835d6656 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/storage/datalake/2018-06-17/storagedatalake/filesystem.go @@ -0,0 +1,588 @@ +package storagedatalake + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// FilesystemClient is the azure Data Lake Storage provides storage for Hadoop and other big data workloads. +type FilesystemClient struct { + BaseClient +} + +// NewFilesystemClient creates an instance of the FilesystemClient client. +func NewFilesystemClient(xMsVersion string, accountName string) FilesystemClient { + return FilesystemClient{New(xMsVersion, accountName)} +} + +// Create create a filesystem rooted at the specified location. If the filesystem already exists, the operation fails. +// This operation does not support conditional HTTP requests. +// Parameters: +// filesystem - the filesystem identifier. The value must start and end with a letter or number and must +// contain only letters, numbers, and the dash (-) character. Consecutive dashes are not permitted. All +// letters must be lowercase. The value must have between 3 and 63 characters. +// xMsProperties - user-defined properties to be stored with the filesystem, in the format of a comma-separated +// list of name and value pairs "n1=v1, n2=v2, ...", where each value is base64 encoded. +// xMsClientRequestID - a UUID recorded in the analytics logs for troubleshooting and correlation. +// timeout - an optional operation timeout value in seconds. The period begins when the request is received by +// the service. If the timeout value elapses before the operation completes, the operation fails. +// xMsDate - specifies the Coordinated Universal Time (UTC) for the request. This is required when using +// shared key authorization. +func (client FilesystemClient) Create(ctx context.Context, filesystem string, xMsProperties string, xMsClientRequestID string, timeout *int32, xMsDate string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: xMsClientRequestID, + Constraints: []validation.Constraint{{Target: "xMsClientRequestID", Name: validation.Pattern, Rule: `^[{(]?[0-9a-f]{8}[-]?([0-9a-f]{4}[-]?){3}[0-9a-f]{12}[)}]?$`, Chain: nil}}}, + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("storagedatalake.FilesystemClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, filesystem, xMsProperties, xMsClientRequestID, timeout, xMsDate) + if err != nil { + err = autorest.NewErrorWithError(err, "storagedatalake.FilesystemClient", "Create", nil, "Failure preparing request") + return + } + + resp, err := client.CreateSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "storagedatalake.FilesystemClient", "Create", resp, "Failure sending request") + return + } + + result, err = client.CreateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "storagedatalake.FilesystemClient", "Create", resp, "Failure responding to request") + } + + return +} + +// CreatePreparer prepares the Create request. +func (client FilesystemClient) CreatePreparer(ctx context.Context, filesystem string, xMsProperties string, xMsClientRequestID string, timeout *int32, xMsDate string) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "accountName": client.AccountName, + "dnsSuffix": client.DNSSuffix, + } + + pathParameters := map[string]interface{}{ + "filesystem": autorest.Encode("path", filesystem), + } + + queryParameters := map[string]interface{}{ + "resource": autorest.Encode("query", "filesystem"), + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } + + preparer := autorest.CreatePreparer( + autorest.AsPut(), + autorest.WithCustomBaseURL("http://{accountName}.{dnsSuffix}", urlParameters), + autorest.WithPathParameters("/{filesystem}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if len(xMsProperties) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-properties", autorest.String(xMsProperties))) + } + if len(xMsClientRequestID) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-client-request-id", autorest.String(xMsClientRequestID))) + } + if len(xMsDate) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-date", autorest.String(xMsDate))) + } + if len(client.XMsVersion) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-version", autorest.String(client.XMsVersion))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client FilesystemClient) CreateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client FilesystemClient) CreateResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByClosing()) + result.Response = resp + return +} + +// Delete marks the filesystem for deletion. When a filesystem is deleted, a filesystem with the same identifier +// cannot be created for at least 30 seconds. While the filesystem is being deleted, attempts to create a filesystem +// with the same identifier will fail with status code 409 (Conflict), with the service returning additional error +// information indicating that the filesystem is being deleted. All other operations, including operations on any files +// or directories within the filesystem, will fail with status code 404 (Not Found) while the filesystem is being +// deleted. This operation supports conditional HTTP requests. For more information, see [Specifying Conditional +// Headers for Blob Service +// Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations). +// Parameters: +// filesystem - the filesystem identifier. The value must start and end with a letter or number and must +// contain only letters, numbers, and the dash (-) character. Consecutive dashes are not permitted. All +// letters must be lowercase. The value must have between 3 and 63 characters. +// ifModifiedSince - optional. A date and time value. Specify this header to perform the operation only if the +// resource has been modified since the specified date and time. +// ifUnmodifiedSince - optional. A date and time value. Specify this header to perform the operation only if +// the resource has not been modified since the specified date and time. +// xMsClientRequestID - a UUID recorded in the analytics logs for troubleshooting and correlation. +// timeout - an optional operation timeout value in seconds. The period begins when the request is received by +// the service. If the timeout value elapses before the operation completes, the operation fails. +// xMsDate - specifies the Coordinated Universal Time (UTC) for the request. This is required when using +// shared key authorization. +func (client FilesystemClient) Delete(ctx context.Context, filesystem string, ifModifiedSince string, ifUnmodifiedSince string, xMsClientRequestID string, timeout *int32, xMsDate string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: xMsClientRequestID, + Constraints: []validation.Constraint{{Target: "xMsClientRequestID", Name: validation.Pattern, Rule: `^[{(]?[0-9a-f]{8}[-]?([0-9a-f]{4}[-]?){3}[0-9a-f]{12}[)}]?$`, Chain: nil}}}, + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("storagedatalake.FilesystemClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, filesystem, ifModifiedSince, ifUnmodifiedSince, xMsClientRequestID, timeout, xMsDate) + if err != nil { + err = autorest.NewErrorWithError(err, "storagedatalake.FilesystemClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "storagedatalake.FilesystemClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "storagedatalake.FilesystemClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client FilesystemClient) DeletePreparer(ctx context.Context, filesystem string, ifModifiedSince string, ifUnmodifiedSince string, xMsClientRequestID string, timeout *int32, xMsDate string) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "accountName": client.AccountName, + "dnsSuffix": client.DNSSuffix, + } + + pathParameters := map[string]interface{}{ + "filesystem": autorest.Encode("path", filesystem), + } + + queryParameters := map[string]interface{}{ + "resource": autorest.Encode("query", "filesystem"), + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithCustomBaseURL("http://{accountName}.{dnsSuffix}", urlParameters), + autorest.WithPathParameters("/{filesystem}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if len(ifModifiedSince) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) + } + if len(ifUnmodifiedSince) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) + } + if len(xMsClientRequestID) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-client-request-id", autorest.String(xMsClientRequestID))) + } + if len(xMsDate) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-date", autorest.String(xMsDate))) + } + if len(client.XMsVersion) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-version", autorest.String(client.XMsVersion))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client FilesystemClient) DeleteSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client FilesystemClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// GetProperties all system and user-defined filesystem properties are specified in the response headers. +// Parameters: +// filesystem - the filesystem identifier. The value must start and end with a letter or number and must +// contain only letters, numbers, and the dash (-) character. Consecutive dashes are not permitted. All +// letters must be lowercase. The value must have between 3 and 63 characters. +// xMsClientRequestID - a UUID recorded in the analytics logs for troubleshooting and correlation. +// timeout - an optional operation timeout value in seconds. The period begins when the request is received by +// the service. If the timeout value elapses before the operation completes, the operation fails. +// xMsDate - specifies the Coordinated Universal Time (UTC) for the request. This is required when using +// shared key authorization. +func (client FilesystemClient) GetProperties(ctx context.Context, filesystem string, xMsClientRequestID string, timeout *int32, xMsDate string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: xMsClientRequestID, + Constraints: []validation.Constraint{{Target: "xMsClientRequestID", Name: validation.Pattern, Rule: `^[{(]?[0-9a-f]{8}[-]?([0-9a-f]{4}[-]?){3}[0-9a-f]{12}[)}]?$`, Chain: nil}}}, + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("storagedatalake.FilesystemClient", "GetProperties", err.Error()) + } + + req, err := client.GetPropertiesPreparer(ctx, filesystem, xMsClientRequestID, timeout, xMsDate) + if err != nil { + err = autorest.NewErrorWithError(err, "storagedatalake.FilesystemClient", "GetProperties", nil, "Failure preparing request") + return + } + + resp, err := client.GetPropertiesSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "storagedatalake.FilesystemClient", "GetProperties", resp, "Failure sending request") + return + } + + result, err = client.GetPropertiesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "storagedatalake.FilesystemClient", "GetProperties", resp, "Failure responding to request") + } + + return +} + +// GetPropertiesPreparer prepares the GetProperties request. +func (client FilesystemClient) GetPropertiesPreparer(ctx context.Context, filesystem string, xMsClientRequestID string, timeout *int32, xMsDate string) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "accountName": client.AccountName, + "dnsSuffix": client.DNSSuffix, + } + + pathParameters := map[string]interface{}{ + "filesystem": autorest.Encode("path", filesystem), + } + + queryParameters := map[string]interface{}{ + "resource": autorest.Encode("query", "filesystem"), + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } + + preparer := autorest.CreatePreparer( + autorest.AsHead(), + autorest.WithCustomBaseURL("http://{accountName}.{dnsSuffix}", urlParameters), + autorest.WithPathParameters("/{filesystem}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if len(xMsClientRequestID) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-client-request-id", autorest.String(xMsClientRequestID))) + } + if len(xMsDate) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-date", autorest.String(xMsDate))) + } + if len(client.XMsVersion) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-version", autorest.String(client.XMsVersion))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetPropertiesSender sends the GetProperties request. The method will close the +// http.Response Body if it receives an error. +func (client FilesystemClient) GetPropertiesSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetPropertiesResponder handles the response to the GetProperties request. The method always +// closes the http.Response Body. +func (client FilesystemClient) GetPropertiesResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// List list filesystems and their properties in given account. +// Parameters: +// prefix - filters results to filesystems within the specified prefix. +// continuation - the number of filesystems returned with each invocation is limited. If the number of +// filesystems to be returned exceeds this limit, a continuation token is returned in the response header +// x-ms-continuation. When a continuation token is returned in the response, it must be specified in a +// subsequent invocation of the list operation to continue listing the filesystems. +// maxResults - an optional value that specifies the maximum number of items to return. If omitted or greater +// than 5,000, the response will include up to 5,000 items. +// xMsClientRequestID - a UUID recorded in the analytics logs for troubleshooting and correlation. +// timeout - an optional operation timeout value in seconds. The period begins when the request is received by +// the service. If the timeout value elapses before the operation completes, the operation fails. +// xMsDate - specifies the Coordinated Universal Time (UTC) for the request. This is required when using +// shared key authorization. +func (client FilesystemClient) List(ctx context.Context, prefix string, continuation string, maxResults *int32, xMsClientRequestID string, timeout *int32, xMsDate string) (result FilesystemList, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: maxResults, + Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}}}, + {TargetValue: xMsClientRequestID, + Constraints: []validation.Constraint{{Target: "xMsClientRequestID", Name: validation.Pattern, Rule: `^[{(]?[0-9a-f]{8}[-]?([0-9a-f]{4}[-]?){3}[0-9a-f]{12}[)}]?$`, Chain: nil}}}, + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("storagedatalake.FilesystemClient", "List", err.Error()) + } + + req, err := client.ListPreparer(ctx, prefix, continuation, maxResults, xMsClientRequestID, timeout, xMsDate) + if err != nil { + err = autorest.NewErrorWithError(err, "storagedatalake.FilesystemClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "storagedatalake.FilesystemClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "storagedatalake.FilesystemClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client FilesystemClient) ListPreparer(ctx context.Context, prefix string, continuation string, maxResults *int32, xMsClientRequestID string, timeout *int32, xMsDate string) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "accountName": client.AccountName, + "dnsSuffix": client.DNSSuffix, + } + + queryParameters := map[string]interface{}{ + "resource": autorest.Encode("query", "account"), + } + if len(prefix) > 0 { + queryParameters["prefix"] = autorest.Encode("query", prefix) + } + if len(continuation) > 0 { + queryParameters["continuation"] = autorest.Encode("query", continuation) + } + if maxResults != nil { + queryParameters["maxResults"] = autorest.Encode("query", *maxResults) + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithCustomBaseURL("http://{accountName}.{dnsSuffix}", urlParameters), + autorest.WithPath("/"), + autorest.WithQueryParameters(queryParameters)) + if len(xMsClientRequestID) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-client-request-id", autorest.String(xMsClientRequestID))) + } + if len(xMsDate) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-date", autorest.String(xMsDate))) + } + if len(client.XMsVersion) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-version", autorest.String(client.XMsVersion))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client FilesystemClient) ListSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client FilesystemClient) ListResponder(resp *http.Response) (result FilesystemList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// SetProperties set properties for the filesystem. This operation supports conditional HTTP requests. For more +// information, see [Specifying Conditional Headers for Blob Service +// Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations). +// Parameters: +// filesystem - the filesystem identifier. The value must start and end with a letter or number and must +// contain only letters, numbers, and the dash (-) character. Consecutive dashes are not permitted. All +// letters must be lowercase. The value must have between 3 and 63 characters. +// xMsProperties - optional. User-defined properties to be stored with the filesystem, in the format of a +// comma-separated list of name and value pairs "n1=v1, n2=v2, ...", where each value is base64 encoded. If +// the filesystem exists, any properties not included in the list will be removed. All properties are removed +// if the header is omitted. To merge new and existing properties, first get all existing properties and the +// current E-Tag, then make a conditional request with the E-Tag and include values for all properties. +// ifModifiedSince - optional. A date and time value. Specify this header to perform the operation only if the +// resource has been modified since the specified date and time. +// ifUnmodifiedSince - optional. A date and time value. Specify this header to perform the operation only if +// the resource has not been modified since the specified date and time. +// xMsClientRequestID - a UUID recorded in the analytics logs for troubleshooting and correlation. +// timeout - an optional operation timeout value in seconds. The period begins when the request is received by +// the service. If the timeout value elapses before the operation completes, the operation fails. +// xMsDate - specifies the Coordinated Universal Time (UTC) for the request. This is required when using +// shared key authorization. +func (client FilesystemClient) SetProperties(ctx context.Context, filesystem string, xMsProperties string, ifModifiedSince string, ifUnmodifiedSince string, xMsClientRequestID string, timeout *int32, xMsDate string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: xMsClientRequestID, + Constraints: []validation.Constraint{{Target: "xMsClientRequestID", Name: validation.Pattern, Rule: `^[{(]?[0-9a-f]{8}[-]?([0-9a-f]{4}[-]?){3}[0-9a-f]{12}[)}]?$`, Chain: nil}}}, + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("storagedatalake.FilesystemClient", "SetProperties", err.Error()) + } + + req, err := client.SetPropertiesPreparer(ctx, filesystem, xMsProperties, ifModifiedSince, ifUnmodifiedSince, xMsClientRequestID, timeout, xMsDate) + if err != nil { + err = autorest.NewErrorWithError(err, "storagedatalake.FilesystemClient", "SetProperties", nil, "Failure preparing request") + return + } + + resp, err := client.SetPropertiesSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "storagedatalake.FilesystemClient", "SetProperties", resp, "Failure sending request") + return + } + + result, err = client.SetPropertiesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "storagedatalake.FilesystemClient", "SetProperties", resp, "Failure responding to request") + } + + return +} + +// SetPropertiesPreparer prepares the SetProperties request. +func (client FilesystemClient) SetPropertiesPreparer(ctx context.Context, filesystem string, xMsProperties string, ifModifiedSince string, ifUnmodifiedSince string, xMsClientRequestID string, timeout *int32, xMsDate string) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "accountName": client.AccountName, + "dnsSuffix": client.DNSSuffix, + } + + pathParameters := map[string]interface{}{ + "filesystem": autorest.Encode("path", filesystem), + } + + queryParameters := map[string]interface{}{ + "resource": autorest.Encode("query", "filesystem"), + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } + + preparer := autorest.CreatePreparer( + autorest.AsPatch(), + autorest.WithCustomBaseURL("http://{accountName}.{dnsSuffix}", urlParameters), + autorest.WithPathParameters("/{filesystem}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if len(xMsProperties) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-properties", autorest.String(xMsProperties))) + } + if len(ifModifiedSince) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) + } + if len(ifUnmodifiedSince) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) + } + if len(xMsClientRequestID) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-client-request-id", autorest.String(xMsClientRequestID))) + } + if len(xMsDate) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-date", autorest.String(xMsDate))) + } + if len(client.XMsVersion) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-version", autorest.String(client.XMsVersion))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// SetPropertiesSender sends the SetProperties request. The method will close the +// http.Response Body if it receives an error. +func (client FilesystemClient) SetPropertiesSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// SetPropertiesResponder handles the response to the SetProperties request. The method always +// closes the http.Response Body. +func (client FilesystemClient) SetPropertiesResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/storage/datalake/2018-06-17/storagedatalake/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/storage/datalake/2018-06-17/storagedatalake/models.go new file mode 100644 index 000000000..25bcc6a4c --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/storage/datalake/2018-06-17/storagedatalake/models.go @@ -0,0 +1,172 @@ +package storagedatalake + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/Azure/go-autorest/autorest" + "io" +) + +// PathGetPropertiesAction enumerates the values for path get properties action. +type PathGetPropertiesAction string + +const ( + // GetAccessControl ... + GetAccessControl PathGetPropertiesAction = "getAccessControl" +) + +// PossiblePathGetPropertiesActionValues returns an array of possible values for the PathGetPropertiesAction const type. +func PossiblePathGetPropertiesActionValues() []PathGetPropertiesAction { + return []PathGetPropertiesAction{GetAccessControl} +} + +// PathLeaseAction enumerates the values for path lease action. +type PathLeaseAction string + +const ( + // Acquire ... + Acquire PathLeaseAction = "acquire" + // Break ... + Break PathLeaseAction = "break" + // Change ... + Change PathLeaseAction = "change" + // Release ... + Release PathLeaseAction = "release" + // Renew ... + Renew PathLeaseAction = "renew" +) + +// PossiblePathLeaseActionValues returns an array of possible values for the PathLeaseAction const type. +func PossiblePathLeaseActionValues() []PathLeaseAction { + return []PathLeaseAction{Acquire, Break, Change, Release, Renew} +} + +// PathRenameMode enumerates the values for path rename mode. +type PathRenameMode string + +const ( + // Legacy ... + Legacy PathRenameMode = "legacy" + // Posix ... + Posix PathRenameMode = "posix" +) + +// PossiblePathRenameModeValues returns an array of possible values for the PathRenameMode const type. +func PossiblePathRenameModeValues() []PathRenameMode { + return []PathRenameMode{Legacy, Posix} +} + +// PathResourceType enumerates the values for path resource type. +type PathResourceType string + +const ( + // Directory ... + Directory PathResourceType = "directory" + // File ... + File PathResourceType = "file" +) + +// PossiblePathResourceTypeValues returns an array of possible values for the PathResourceType const type. +func PossiblePathResourceTypeValues() []PathResourceType { + return []PathResourceType{Directory, File} +} + +// PathUpdateAction enumerates the values for path update action. +type PathUpdateAction string + +const ( + // Append ... + Append PathUpdateAction = "append" + // Flush ... + Flush PathUpdateAction = "flush" + // SetAccessControl ... + SetAccessControl PathUpdateAction = "setAccessControl" + // SetProperties ... + SetProperties PathUpdateAction = "setProperties" +) + +// PossiblePathUpdateActionValues returns an array of possible values for the PathUpdateAction const type. +func PossiblePathUpdateActionValues() []PathUpdateAction { + return []PathUpdateAction{Append, Flush, SetAccessControl, SetProperties} +} + +// PathUpdateLeaseAction enumerates the values for path update lease action. +type PathUpdateLeaseAction string + +const ( + // PathUpdateLeaseActionRelease ... + PathUpdateLeaseActionRelease PathUpdateLeaseAction = "release" + // PathUpdateLeaseActionRenew ... + PathUpdateLeaseActionRenew PathUpdateLeaseAction = "renew" +) + +// PossiblePathUpdateLeaseActionValues returns an array of possible values for the PathUpdateLeaseAction const type. +func PossiblePathUpdateLeaseActionValues() []PathUpdateLeaseAction { + return []PathUpdateLeaseAction{PathUpdateLeaseActionRelease, PathUpdateLeaseActionRenew} +} + +// DataLakeStorageError ... +type DataLakeStorageError struct { + // Error - The service error response object. + Error *DataLakeStorageErrorError `json:"error,omitempty"` +} + +// DataLakeStorageErrorError the service error response object. +type DataLakeStorageErrorError struct { + // Code - The service error code. + Code *string `json:"code,omitempty"` + // Message - The service error message. + Message *string `json:"message,omitempty"` +} + +// Filesystem ... +type Filesystem struct { + Name *string `json:"name,omitempty"` + LastModified *string `json:"lastModified,omitempty"` + ETag *string `json:"eTag,omitempty"` +} + +// FilesystemList ... +type FilesystemList struct { + autorest.Response `json:"-"` + Filesystems *[]Filesystem `json:"filesystems,omitempty"` +} + +// Path ... +type Path struct { + Name *string `json:"name,omitempty"` + IsDirectory *bool `json:"isDirectory,omitempty"` + LastModified *string `json:"lastModified,omitempty"` + ETag *string `json:"eTag,omitempty"` + ContentLength *int64 `json:"contentLength,omitempty"` + Owner *string `json:"owner,omitempty"` + Group *string `json:"group,omitempty"` + Permissions *string `json:"permissions,omitempty"` +} + +// PathList ... +type PathList struct { + autorest.Response `json:"-"` + Paths *[]Path `json:"paths,omitempty"` +} + +// ReadCloser ... +type ReadCloser struct { + autorest.Response `json:"-"` + Value *io.ReadCloser `json:"value,omitempty"` +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/storage/datalake/2018-06-17/storagedatalake/path.go b/vendor/github.com/Azure/azure-sdk-for-go/services/storage/datalake/2018-06-17/storagedatalake/path.go new file mode 100644 index 000000000..3c7056726 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/storage/datalake/2018-06-17/storagedatalake/path.go @@ -0,0 +1,1260 @@ +package storagedatalake + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "io" + "net/http" +) + +// PathClient is the azure Data Lake Storage provides storage for Hadoop and other big data workloads. +type PathClient struct { + BaseClient +} + +// NewPathClient creates an instance of the PathClient client. +func NewPathClient(xMsVersion string, accountName string) PathClient { + return PathClient{New(xMsVersion, accountName)} +} + +// Create create or rename a file or directory. By default, the destination is overwritten and if the destination +// already exists and has a lease the lease is broken. This operation supports conditional HTTP requests. For more +// information, see [Specifying Conditional Headers for Blob Service +// Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations). +// To fail if the destination already exists, use a conditional request with If-None-Match: "*". +// Parameters: +// filesystem - the filesystem identifier. +// pathParameter - the file or directory path. +// resource - required only for Create File and Create Directory. The value must be "file" or "directory". +// continuation - optional. When renaming a directory, the number of paths that are renamed with each +// invocation is limited. If the number of paths to be renamed exceeds this limit, a continuation token is +// returned in this response header. When a continuation token is returned in the response, it must be +// specified in a subsequent invocation of the rename operation to continue renaming the directory. +// mode - optional. Valid only when namespace is enabled. This parameter determines the behavior of the rename +// operation. The value must be "legacy" or "posix", and the default value will be "posix". +// cacheControl - optional. The service stores this value and includes it in the "Cache-Control" response +// header for "Read File" operations for "Read File" operations. +// contentEncoding - optional. Specifies which content encodings have been applied to the file. This value is +// returned to the client when the "Read File" operation is performed. +// contentLanguage - optional. Specifies the natural language used by the intended audience for the file. +// contentDisposition - optional. The service stores this value and includes it in the "Content-Disposition" +// response header for "Read File" operations. +// xMsCacheControl - optional. The service stores this value and includes it in the "Cache-Control" response +// header for "Read File" operations. +// xMsContentType - optional. The service stores this value and includes it in the "Content-Type" response +// header for "Read File" operations. +// xMsContentEncoding - optional. The service stores this value and includes it in the "Content-Encoding" +// response header for "Read File" operations. +// xMsContentLanguage - optional. The service stores this value and includes it in the "Content-Language" +// response header for "Read File" operations. +// xMsContentDisposition - optional. The service stores this value and includes it in the +// "Content-Disposition" response header for "Read File" operations. +// xMsRenameSource - an optional file or directory to be renamed. The value must have the following format: +// "/{filesysystem}/{path}". If "x-ms-properties" is specified, the properties will overwrite the existing +// properties; otherwise, the existing properties will be preserved. +// xMsLeaseID - optional. A lease ID for the path specified in the URI. The path to be overwritten must have +// an active lease and the lease ID must match. +// xMsProposedLeaseID - optional for create operations. Required when "x-ms-lease-action" is used. A lease +// will be acquired using the proposed ID when the resource is created. +// xMsSourceLeaseID - optional for rename operations. A lease ID for the source path. The source path must +// have an active lease and the lease ID must match. +// xMsProperties - optional. User-defined properties to be stored with the file or directory, in the format of +// a comma-separated list of name and value pairs "n1=v1, n2=v2, ...", where each value is base64 encoded. +// xMsPermissions - optional and only valid if Hierarchical Namespace is enabled for the account. Sets POSIX +// access permissions for the file owner, the file owning group, and others. Each class may be granted read, +// write, or execute permission. The sticky bit is also supported. Both symbolic (rwxrw-rw-) and 4-digit +// octal notation (e.g. 0766) are supported. +// ifMatch - optional. An ETag value. Specify this header to perform the operation only if the resource's ETag +// matches the value specified. The ETag must be specified in quotes. +// ifNoneMatch - optional. An ETag value or the special wildcard ("*") value. Specify this header to perform +// the operation only if the resource's ETag does not match the value specified. The ETag must be specified in +// quotes. +// ifModifiedSince - optional. A date and time value. Specify this header to perform the operation only if the +// resource has been modified since the specified date and time. +// ifUnmodifiedSince - optional. A date and time value. Specify this header to perform the operation only if +// the resource has not been modified since the specified date and time. +// xMsSourceIfMatch - optional. An ETag value. Specify this header to perform the rename operation only if the +// source's ETag matches the value specified. The ETag must be specified in quotes. +// xMsSourceIfNoneMatch - optional. An ETag value or the special wildcard ("*") value. Specify this header to +// perform the rename operation only if the source's ETag does not match the value specified. The ETag must be +// specified in quotes. +// xMsSourceIfModifiedSince - optional. A date and time value. Specify this header to perform the rename +// operation only if the source has been modified since the specified date and time. +// xMsSourceIfUnmodifiedSince - optional. A date and time value. Specify this header to perform the rename +// operation only if the source has not been modified since the specified date and time. +// xMsClientRequestID - a UUID recorded in the analytics logs for troubleshooting and correlation. +// timeout - an optional operation timeout value in seconds. The period begins when the request is received by +// the service. If the timeout value elapses before the operation completes, the operation fails. +// xMsDate - specifies the Coordinated Universal Time (UTC) for the request. This is required when using +// shared key authorization. +func (client PathClient) Create(ctx context.Context, filesystem string, pathParameter string, resource PathResourceType, continuation string, mode PathRenameMode, cacheControl string, contentEncoding string, contentLanguage string, contentDisposition string, xMsCacheControl string, xMsContentType string, xMsContentEncoding string, xMsContentLanguage string, xMsContentDisposition string, xMsRenameSource string, xMsLeaseID string, xMsProposedLeaseID string, xMsSourceLeaseID string, xMsProperties string, xMsPermissions string, ifMatch string, ifNoneMatch string, ifModifiedSince string, ifUnmodifiedSince string, xMsSourceIfMatch string, xMsSourceIfNoneMatch string, xMsSourceIfModifiedSince string, xMsSourceIfUnmodifiedSince string, xMsClientRequestID string, timeout *int32, xMsDate string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: xMsLeaseID, + Constraints: []validation.Constraint{{Target: "xMsLeaseID", Name: validation.Pattern, Rule: `^[{(]?[0-9a-f]{8}[-]?([0-9a-f]{4}[-]?){3}[0-9a-f]{12}[)}]?$`, Chain: nil}}}, + {TargetValue: xMsProposedLeaseID, + Constraints: []validation.Constraint{{Target: "xMsProposedLeaseID", Name: validation.Pattern, Rule: `^[{(]?[0-9a-f]{8}[-]?([0-9a-f]{4}[-]?){3}[0-9a-f]{12}[)}]?$`, Chain: nil}}}, + {TargetValue: xMsSourceLeaseID, + Constraints: []validation.Constraint{{Target: "xMsSourceLeaseID", Name: validation.Pattern, Rule: `^[{(]?[0-9a-f]{8}[-]?([0-9a-f]{4}[-]?){3}[0-9a-f]{12}[)}]?$`, Chain: nil}}}, + {TargetValue: filesystem, + Constraints: []validation.Constraint{{Target: "filesystem", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "filesystem", Name: validation.MinLength, Rule: 3, Chain: nil}}}, + {TargetValue: xMsClientRequestID, + Constraints: []validation.Constraint{{Target: "xMsClientRequestID", Name: validation.Pattern, Rule: `^[{(]?[0-9a-f]{8}[-]?([0-9a-f]{4}[-]?){3}[0-9a-f]{12}[)}]?$`, Chain: nil}}}, + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("storagedatalake.PathClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, filesystem, pathParameter, resource, continuation, mode, cacheControl, contentEncoding, contentLanguage, contentDisposition, xMsCacheControl, xMsContentType, xMsContentEncoding, xMsContentLanguage, xMsContentDisposition, xMsRenameSource, xMsLeaseID, xMsProposedLeaseID, xMsSourceLeaseID, xMsProperties, xMsPermissions, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince, xMsSourceIfMatch, xMsSourceIfNoneMatch, xMsSourceIfModifiedSince, xMsSourceIfUnmodifiedSince, xMsClientRequestID, timeout, xMsDate) + if err != nil { + err = autorest.NewErrorWithError(err, "storagedatalake.PathClient", "Create", nil, "Failure preparing request") + return + } + + resp, err := client.CreateSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "storagedatalake.PathClient", "Create", resp, "Failure sending request") + return + } + + result, err = client.CreateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "storagedatalake.PathClient", "Create", resp, "Failure responding to request") + } + + return +} + +// CreatePreparer prepares the Create request. +func (client PathClient) CreatePreparer(ctx context.Context, filesystem string, pathParameter string, resource PathResourceType, continuation string, mode PathRenameMode, cacheControl string, contentEncoding string, contentLanguage string, contentDisposition string, xMsCacheControl string, xMsContentType string, xMsContentEncoding string, xMsContentLanguage string, xMsContentDisposition string, xMsRenameSource string, xMsLeaseID string, xMsProposedLeaseID string, xMsSourceLeaseID string, xMsProperties string, xMsPermissions string, ifMatch string, ifNoneMatch string, ifModifiedSince string, ifUnmodifiedSince string, xMsSourceIfMatch string, xMsSourceIfNoneMatch string, xMsSourceIfModifiedSince string, xMsSourceIfUnmodifiedSince string, xMsClientRequestID string, timeout *int32, xMsDate string) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "accountName": client.AccountName, + "dnsSuffix": client.DNSSuffix, + } + + pathParameters := map[string]interface{}{ + "filesystem": autorest.Encode("path", filesystem), + "path": autorest.Encode("path", pathParameter), + } + + queryParameters := map[string]interface{}{} + if len(string(resource)) > 0 { + queryParameters["resource"] = autorest.Encode("query", resource) + } + if len(continuation) > 0 { + queryParameters["continuation"] = autorest.Encode("query", continuation) + } + if len(string(mode)) > 0 { + queryParameters["mode"] = autorest.Encode("query", mode) + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } + + preparer := autorest.CreatePreparer( + autorest.AsPut(), + autorest.WithCustomBaseURL("http://{accountName}.{dnsSuffix}", urlParameters), + autorest.WithPathParameters("/{filesystem}/{path}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if len(cacheControl) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("Cache-Control", autorest.String(cacheControl))) + } + if len(contentEncoding) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("Content-Encoding", autorest.String(contentEncoding))) + } + if len(contentLanguage) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("Content-Language", autorest.String(contentLanguage))) + } + if len(contentDisposition) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("Content-Disposition", autorest.String(contentDisposition))) + } + if len(xMsCacheControl) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-cache-control", autorest.String(xMsCacheControl))) + } + if len(xMsContentType) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-content-type", autorest.String(xMsContentType))) + } + if len(xMsContentEncoding) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-content-encoding", autorest.String(xMsContentEncoding))) + } + if len(xMsContentLanguage) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-content-language", autorest.String(xMsContentLanguage))) + } + if len(xMsContentDisposition) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-content-disposition", autorest.String(xMsContentDisposition))) + } + if len(xMsRenameSource) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-rename-source", autorest.String(xMsRenameSource))) + } + if len(xMsLeaseID) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-lease-id", autorest.String(xMsLeaseID))) + } + if len(xMsProposedLeaseID) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-proposed-lease-id", autorest.String(xMsProposedLeaseID))) + } + if len(xMsSourceLeaseID) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-source-lease-id", autorest.String(xMsSourceLeaseID))) + } + if len(xMsProperties) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-properties", autorest.String(xMsProperties))) + } + if len(xMsPermissions) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-permissions", autorest.String(xMsPermissions))) + } + if len(ifMatch) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + } + if len(ifNoneMatch) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) + } + if len(ifModifiedSince) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) + } + if len(ifUnmodifiedSince) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) + } + if len(xMsSourceIfMatch) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-source-if-match", autorest.String(xMsSourceIfMatch))) + } + if len(xMsSourceIfNoneMatch) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-source-if-none-match", autorest.String(xMsSourceIfNoneMatch))) + } + if len(xMsSourceIfModifiedSince) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-source-if-modified-since", autorest.String(xMsSourceIfModifiedSince))) + } + if len(xMsSourceIfUnmodifiedSince) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-source-if-unmodified-since", autorest.String(xMsSourceIfUnmodifiedSince))) + } + if len(xMsClientRequestID) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-client-request-id", autorest.String(xMsClientRequestID))) + } + if len(xMsDate) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-date", autorest.String(xMsDate))) + } + if len(client.XMsVersion) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-version", autorest.String(client.XMsVersion))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client PathClient) CreateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client PathClient) CreateResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByClosing()) + result.Response = resp + return +} + +// Delete delete the file or directory. This operation supports conditional HTTP requests. For more information, see +// [Specifying Conditional Headers for Blob Service +// Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations). +// Parameters: +// filesystem - the filesystem identifier. +// pathParameter - the file or directory path. +// recursive - required and valid only when the resource is a directory. If "true", all paths beneath the +// directory will be deleted. If "false" and the directory is non-empty, an error occurs. +// continuation - optional. When deleting a directory, the number of paths that are deleted with each +// invocation is limited. If the number of paths to be deleted exceeds this limit, a continuation token is +// returned in this response header. When a continuation token is returned in the response, it must be +// specified in a subsequent invocation of the delete operation to continue deleting the directory. +// xMsLeaseID - the lease ID must be specified if there is an active lease. +// ifMatch - optional. An ETag value. Specify this header to perform the operation only if the resource's ETag +// matches the value specified. The ETag must be specified in quotes. +// ifNoneMatch - optional. An ETag value or the special wildcard ("*") value. Specify this header to perform +// the operation only if the resource's ETag does not match the value specified. The ETag must be specified in +// quotes. +// ifModifiedSince - optional. A date and time value. Specify this header to perform the operation only if the +// resource has been modified since the specified date and time. +// ifUnmodifiedSince - optional. A date and time value. Specify this header to perform the operation only if +// the resource has not been modified since the specified date and time. +// xMsClientRequestID - a UUID recorded in the analytics logs for troubleshooting and correlation. +// timeout - an optional operation timeout value in seconds. The period begins when the request is received by +// the service. If the timeout value elapses before the operation completes, the operation fails. +// xMsDate - specifies the Coordinated Universal Time (UTC) for the request. This is required when using +// shared key authorization. +func (client PathClient) Delete(ctx context.Context, filesystem string, pathParameter string, recursive *bool, continuation string, xMsLeaseID string, ifMatch string, ifNoneMatch string, ifModifiedSince string, ifUnmodifiedSince string, xMsClientRequestID string, timeout *int32, xMsDate string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: xMsLeaseID, + Constraints: []validation.Constraint{{Target: "xMsLeaseID", Name: validation.Pattern, Rule: `^[{(]?[0-9a-f]{8}[-]?([0-9a-f]{4}[-]?){3}[0-9a-f]{12}[)}]?$`, Chain: nil}}}, + {TargetValue: filesystem, + Constraints: []validation.Constraint{{Target: "filesystem", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "filesystem", Name: validation.MinLength, Rule: 3, Chain: nil}}}, + {TargetValue: xMsClientRequestID, + Constraints: []validation.Constraint{{Target: "xMsClientRequestID", Name: validation.Pattern, Rule: `^[{(]?[0-9a-f]{8}[-]?([0-9a-f]{4}[-]?){3}[0-9a-f]{12}[)}]?$`, Chain: nil}}}, + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("storagedatalake.PathClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, filesystem, pathParameter, recursive, continuation, xMsLeaseID, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince, xMsClientRequestID, timeout, xMsDate) + if err != nil { + err = autorest.NewErrorWithError(err, "storagedatalake.PathClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "storagedatalake.PathClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "storagedatalake.PathClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client PathClient) DeletePreparer(ctx context.Context, filesystem string, pathParameter string, recursive *bool, continuation string, xMsLeaseID string, ifMatch string, ifNoneMatch string, ifModifiedSince string, ifUnmodifiedSince string, xMsClientRequestID string, timeout *int32, xMsDate string) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "accountName": client.AccountName, + "dnsSuffix": client.DNSSuffix, + } + + pathParameters := map[string]interface{}{ + "filesystem": autorest.Encode("path", filesystem), + "path": autorest.Encode("path", pathParameter), + } + + queryParameters := map[string]interface{}{} + if recursive != nil { + queryParameters["recursive"] = autorest.Encode("query", *recursive) + } + if len(continuation) > 0 { + queryParameters["continuation"] = autorest.Encode("query", continuation) + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithCustomBaseURL("http://{accountName}.{dnsSuffix}", urlParameters), + autorest.WithPathParameters("/{filesystem}/{path}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if len(xMsLeaseID) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-lease-id", autorest.String(xMsLeaseID))) + } + if len(ifMatch) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + } + if len(ifNoneMatch) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) + } + if len(ifModifiedSince) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) + } + if len(ifUnmodifiedSince) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) + } + if len(xMsClientRequestID) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-client-request-id", autorest.String(xMsClientRequestID))) + } + if len(xMsDate) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-date", autorest.String(xMsDate))) + } + if len(client.XMsVersion) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-version", autorest.String(client.XMsVersion))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client PathClient) DeleteSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client PathClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// GetProperties get the properties for a file or directory, and optionally include the access control list. This +// operation supports conditional HTTP requests. For more information, see [Specifying Conditional Headers for Blob +// Service +// Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations). +// Parameters: +// filesystem - the filesystem identifier. +// pathParameter - the file or directory path. +// action - optional. If the value is "getAccessControl" the access control list is returned in the response +// headers (Hierarchical Namespace must be enabled for the account). +// ifMatch - optional. An ETag value. Specify this header to perform the operation only if the resource's ETag +// matches the value specified. The ETag must be specified in quotes. +// ifNoneMatch - optional. An ETag value or the special wildcard ("*") value. Specify this header to perform +// the operation only if the resource's ETag does not match the value specified. The ETag must be specified in +// quotes. +// ifModifiedSince - optional. A date and time value. Specify this header to perform the operation only if the +// resource has been modified since the specified date and time. +// ifUnmodifiedSince - optional. A date and time value. Specify this header to perform the operation only if +// the resource has not been modified since the specified date and time. +// xMsClientRequestID - a UUID recorded in the analytics logs for troubleshooting and correlation. +// timeout - an optional operation timeout value in seconds. The period begins when the request is received by +// the service. If the timeout value elapses before the operation completes, the operation fails. +// xMsDate - specifies the Coordinated Universal Time (UTC) for the request. This is required when using +// shared key authorization. +func (client PathClient) GetProperties(ctx context.Context, filesystem string, pathParameter string, action PathGetPropertiesAction, ifMatch string, ifNoneMatch string, ifModifiedSince string, ifUnmodifiedSince string, xMsClientRequestID string, timeout *int32, xMsDate string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: filesystem, + Constraints: []validation.Constraint{{Target: "filesystem", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "filesystem", Name: validation.MinLength, Rule: 3, Chain: nil}}}, + {TargetValue: xMsClientRequestID, + Constraints: []validation.Constraint{{Target: "xMsClientRequestID", Name: validation.Pattern, Rule: `^[{(]?[0-9a-f]{8}[-]?([0-9a-f]{4}[-]?){3}[0-9a-f]{12}[)}]?$`, Chain: nil}}}, + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("storagedatalake.PathClient", "GetProperties", err.Error()) + } + + req, err := client.GetPropertiesPreparer(ctx, filesystem, pathParameter, action, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince, xMsClientRequestID, timeout, xMsDate) + if err != nil { + err = autorest.NewErrorWithError(err, "storagedatalake.PathClient", "GetProperties", nil, "Failure preparing request") + return + } + + resp, err := client.GetPropertiesSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "storagedatalake.PathClient", "GetProperties", resp, "Failure sending request") + return + } + + result, err = client.GetPropertiesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "storagedatalake.PathClient", "GetProperties", resp, "Failure responding to request") + } + + return +} + +// GetPropertiesPreparer prepares the GetProperties request. +func (client PathClient) GetPropertiesPreparer(ctx context.Context, filesystem string, pathParameter string, action PathGetPropertiesAction, ifMatch string, ifNoneMatch string, ifModifiedSince string, ifUnmodifiedSince string, xMsClientRequestID string, timeout *int32, xMsDate string) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "accountName": client.AccountName, + "dnsSuffix": client.DNSSuffix, + } + + pathParameters := map[string]interface{}{ + "filesystem": autorest.Encode("path", filesystem), + "path": autorest.Encode("path", pathParameter), + } + + queryParameters := map[string]interface{}{} + if len(string(action)) > 0 { + queryParameters["action"] = autorest.Encode("query", action) + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } + + preparer := autorest.CreatePreparer( + autorest.AsHead(), + autorest.WithCustomBaseURL("http://{accountName}.{dnsSuffix}", urlParameters), + autorest.WithPathParameters("/{filesystem}/{path}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if len(ifMatch) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + } + if len(ifNoneMatch) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) + } + if len(ifModifiedSince) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) + } + if len(ifUnmodifiedSince) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) + } + if len(xMsClientRequestID) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-client-request-id", autorest.String(xMsClientRequestID))) + } + if len(xMsDate) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-date", autorest.String(xMsDate))) + } + if len(client.XMsVersion) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-version", autorest.String(client.XMsVersion))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetPropertiesSender sends the GetProperties request. The method will close the +// http.Response Body if it receives an error. +func (client PathClient) GetPropertiesSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetPropertiesResponder handles the response to the GetProperties request. The method always +// closes the http.Response Body. +func (client PathClient) GetPropertiesResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Lease create and manage a lease to restrict write and delete access to the path. This operation supports conditional +// HTTP requests. For more information, see [Specifying Conditional Headers for Blob Service +// Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations). +// Parameters: +// xMsLeaseAction - there are five lease actions: "acquire", "break", "change", "renew", and "release". Use +// "acquire" and specify the "x-ms-proposed-lease-id" and "x-ms-lease-duration" to acquire a new lease. Use +// "break" to break an existing lease. When a lease is broken, the lease break period is allowed to elapse, +// during which time no lease operation except break and release can be performed on the file. When a lease is +// successfully broken, the response indicates the interval in seconds until a new lease can be acquired. Use +// "change" and specify the current lease ID in "x-ms-lease-id" and the new lease ID in +// "x-ms-proposed-lease-id" to change the lease ID of an active lease. Use "renew" and specify the +// "x-ms-lease-id" to renew an existing lease. Use "release" and specify the "x-ms-lease-id" to release a +// lease. +// filesystem - the filesystem identifier. +// pathParameter - the file or directory path. +// xMsLeaseDuration - the lease duration is required to acquire a lease, and specifies the duration of the +// lease in seconds. The lease duration must be between 15 and 60 seconds or -1 for infinite lease. +// xMsLeaseBreakPeriod - the lease break period duration is optional to break a lease, and specifies the break +// period of the lease in seconds. The lease break duration must be between 0 and 60 seconds. +// xMsLeaseID - required when "x-ms-lease-action" is "renew", "change" or "release". For the renew and release +// actions, this must match the current lease ID. +// xMsProposedLeaseID - required when "x-ms-lease-action" is "acquire" or "change". A lease will be acquired +// with this lease ID if the operation is successful. +// ifMatch - optional. An ETag value. Specify this header to perform the operation only if the resource's ETag +// matches the value specified. The ETag must be specified in quotes. +// ifNoneMatch - optional. An ETag value or the special wildcard ("*") value. Specify this header to perform +// the operation only if the resource's ETag does not match the value specified. The ETag must be specified in +// quotes. +// ifModifiedSince - optional. A date and time value. Specify this header to perform the operation only if the +// resource has been modified since the specified date and time. +// ifUnmodifiedSince - optional. A date and time value. Specify this header to perform the operation only if +// the resource has not been modified since the specified date and time. +// xMsClientRequestID - a UUID recorded in the analytics logs for troubleshooting and correlation. +// timeout - an optional operation timeout value in seconds. The period begins when the request is received by +// the service. If the timeout value elapses before the operation completes, the operation fails. +// xMsDate - specifies the Coordinated Universal Time (UTC) for the request. This is required when using +// shared key authorization. +func (client PathClient) Lease(ctx context.Context, xMsLeaseAction PathLeaseAction, filesystem string, pathParameter string, xMsLeaseDuration *int32, xMsLeaseBreakPeriod *int32, xMsLeaseID string, xMsProposedLeaseID string, ifMatch string, ifNoneMatch string, ifModifiedSince string, ifUnmodifiedSince string, xMsClientRequestID string, timeout *int32, xMsDate string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: xMsLeaseID, + Constraints: []validation.Constraint{{Target: "xMsLeaseID", Name: validation.Pattern, Rule: `^[{(]?[0-9a-f]{8}[-]?([0-9a-f]{4}[-]?){3}[0-9a-f]{12}[)}]?$`, Chain: nil}}}, + {TargetValue: xMsProposedLeaseID, + Constraints: []validation.Constraint{{Target: "xMsProposedLeaseID", Name: validation.Pattern, Rule: `^[{(]?[0-9a-f]{8}[-]?([0-9a-f]{4}[-]?){3}[0-9a-f]{12}[)}]?$`, Chain: nil}}}, + {TargetValue: filesystem, + Constraints: []validation.Constraint{{Target: "filesystem", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "filesystem", Name: validation.MinLength, Rule: 3, Chain: nil}}}, + {TargetValue: xMsClientRequestID, + Constraints: []validation.Constraint{{Target: "xMsClientRequestID", Name: validation.Pattern, Rule: `^[{(]?[0-9a-f]{8}[-]?([0-9a-f]{4}[-]?){3}[0-9a-f]{12}[)}]?$`, Chain: nil}}}, + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("storagedatalake.PathClient", "Lease", err.Error()) + } + + req, err := client.LeasePreparer(ctx, xMsLeaseAction, filesystem, pathParameter, xMsLeaseDuration, xMsLeaseBreakPeriod, xMsLeaseID, xMsProposedLeaseID, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince, xMsClientRequestID, timeout, xMsDate) + if err != nil { + err = autorest.NewErrorWithError(err, "storagedatalake.PathClient", "Lease", nil, "Failure preparing request") + return + } + + resp, err := client.LeaseSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "storagedatalake.PathClient", "Lease", resp, "Failure sending request") + return + } + + result, err = client.LeaseResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "storagedatalake.PathClient", "Lease", resp, "Failure responding to request") + } + + return +} + +// LeasePreparer prepares the Lease request. +func (client PathClient) LeasePreparer(ctx context.Context, xMsLeaseAction PathLeaseAction, filesystem string, pathParameter string, xMsLeaseDuration *int32, xMsLeaseBreakPeriod *int32, xMsLeaseID string, xMsProposedLeaseID string, ifMatch string, ifNoneMatch string, ifModifiedSince string, ifUnmodifiedSince string, xMsClientRequestID string, timeout *int32, xMsDate string) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "accountName": client.AccountName, + "dnsSuffix": client.DNSSuffix, + } + + pathParameters := map[string]interface{}{ + "filesystem": autorest.Encode("path", filesystem), + "path": autorest.Encode("path", pathParameter), + } + + queryParameters := map[string]interface{}{} + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithCustomBaseURL("http://{accountName}.{dnsSuffix}", urlParameters), + autorest.WithPathParameters("/{filesystem}/{path}", pathParameters), + autorest.WithQueryParameters(queryParameters), + autorest.WithHeader("x-ms-lease-action", autorest.String(xMsLeaseAction))) + if xMsLeaseDuration != nil { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-lease-duration", autorest.String(xMsLeaseDuration))) + } + if xMsLeaseBreakPeriod != nil { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-lease-break-period", autorest.String(xMsLeaseBreakPeriod))) + } + if len(xMsLeaseID) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-lease-id", autorest.String(xMsLeaseID))) + } + if len(xMsProposedLeaseID) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-proposed-lease-id", autorest.String(xMsProposedLeaseID))) + } + if len(ifMatch) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + } + if len(ifNoneMatch) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) + } + if len(ifModifiedSince) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) + } + if len(ifUnmodifiedSince) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) + } + if len(xMsClientRequestID) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-client-request-id", autorest.String(xMsClientRequestID))) + } + if len(xMsDate) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-date", autorest.String(xMsDate))) + } + if len(client.XMsVersion) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-version", autorest.String(client.XMsVersion))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// LeaseSender sends the Lease request. The method will close the +// http.Response Body if it receives an error. +func (client PathClient) LeaseSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// LeaseResponder handles the response to the Lease request. The method always +// closes the http.Response Body. +func (client PathClient) LeaseResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// List list filesystem paths and their properties. +// Parameters: +// recursive - if "true", all paths are listed; otherwise, only paths at the root of the filesystem are listed. +// If "directory" is specified, the list will only include paths that share the same root. +// filesystem - the filesystem identifier. The value must start and end with a letter or number and must +// contain only letters, numbers, and the dash (-) character. Consecutive dashes are not permitted. All +// letters must be lowercase. The value must have between 3 and 63 characters. +// directory - filters results to paths within the specified directory. An error occurs if the directory does +// not exist. +// continuation - the number of paths returned with each invocation is limited. If the number of paths to be +// returned exceeds this limit, a continuation token is returned in the response header x-ms-continuation. When +// a continuation token is returned in the response, it must be specified in a subsequent invocation of the +// list operation to continue listing the paths. +// maxResults - an optional value that specifies the maximum number of items to return. If omitted or greater +// than 5,000, the response will include up to 5,000 items. +// xMsClientRequestID - a UUID recorded in the analytics logs for troubleshooting and correlation. +// timeout - an optional operation timeout value in seconds. The period begins when the request is received by +// the service. If the timeout value elapses before the operation completes, the operation fails. +// xMsDate - specifies the Coordinated Universal Time (UTC) for the request. This is required when using +// shared key authorization. +func (client PathClient) List(ctx context.Context, recursive bool, filesystem string, directory string, continuation string, maxResults *int32, xMsClientRequestID string, timeout *int32, xMsDate string) (result PathList, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: maxResults, + Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}}}, + {TargetValue: xMsClientRequestID, + Constraints: []validation.Constraint{{Target: "xMsClientRequestID", Name: validation.Pattern, Rule: `^[{(]?[0-9a-f]{8}[-]?([0-9a-f]{4}[-]?){3}[0-9a-f]{12}[)}]?$`, Chain: nil}}}, + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("storagedatalake.PathClient", "List", err.Error()) + } + + req, err := client.ListPreparer(ctx, recursive, filesystem, directory, continuation, maxResults, xMsClientRequestID, timeout, xMsDate) + if err != nil { + err = autorest.NewErrorWithError(err, "storagedatalake.PathClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "storagedatalake.PathClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "storagedatalake.PathClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client PathClient) ListPreparer(ctx context.Context, recursive bool, filesystem string, directory string, continuation string, maxResults *int32, xMsClientRequestID string, timeout *int32, xMsDate string) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "accountName": client.AccountName, + "dnsSuffix": client.DNSSuffix, + } + + pathParameters := map[string]interface{}{ + "filesystem": autorest.Encode("path", filesystem), + } + + queryParameters := map[string]interface{}{ + "recursive": autorest.Encode("query", recursive), + "resource": autorest.Encode("query", "filesystem"), + } + if len(directory) > 0 { + queryParameters["directory"] = autorest.Encode("query", directory) + } + if len(continuation) > 0 { + queryParameters["continuation"] = autorest.Encode("query", continuation) + } + if maxResults != nil { + queryParameters["maxResults"] = autorest.Encode("query", *maxResults) + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithCustomBaseURL("http://{accountName}.{dnsSuffix}", urlParameters), + autorest.WithPathParameters("/{filesystem}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if len(xMsClientRequestID) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-client-request-id", autorest.String(xMsClientRequestID))) + } + if len(xMsDate) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-date", autorest.String(xMsDate))) + } + if len(client.XMsVersion) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-version", autorest.String(client.XMsVersion))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client PathClient) ListSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client PathClient) ListResponder(resp *http.Response) (result PathList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Read read the contents of a file. For read operations, range requests are supported. This operation supports +// conditional HTTP requests. For more information, see [Specifying Conditional Headers for Blob Service +// Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations). +// Parameters: +// filesystem - the filesystem identifier. +// pathParameter - the file or directory path. +// rangeParameter - the HTTP Range request header specifies one or more byte ranges of the resource to be +// retrieved. +// ifMatch - optional. An ETag value. Specify this header to perform the operation only if the resource's ETag +// matches the value specified. The ETag must be specified in quotes. +// ifNoneMatch - optional. An ETag value or the special wildcard ("*") value. Specify this header to perform +// the operation only if the resource's ETag does not match the value specified. The ETag must be specified in +// quotes. +// ifModifiedSince - optional. A date and time value. Specify this header to perform the operation only if the +// resource has been modified since the specified date and time. +// ifUnmodifiedSince - optional. A date and time value. Specify this header to perform the operation only if +// the resource has not been modified since the specified date and time. +// xMsClientRequestID - a UUID recorded in the analytics logs for troubleshooting and correlation. +// timeout - an optional operation timeout value in seconds. The period begins when the request is received by +// the service. If the timeout value elapses before the operation completes, the operation fails. +// xMsDate - specifies the Coordinated Universal Time (UTC) for the request. This is required when using +// shared key authorization. +func (client PathClient) Read(ctx context.Context, filesystem string, pathParameter string, rangeParameter string, ifMatch string, ifNoneMatch string, ifModifiedSince string, ifUnmodifiedSince string, xMsClientRequestID string, timeout *int32, xMsDate string) (result ReadCloser, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: filesystem, + Constraints: []validation.Constraint{{Target: "filesystem", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "filesystem", Name: validation.MinLength, Rule: 3, Chain: nil}}}, + {TargetValue: xMsClientRequestID, + Constraints: []validation.Constraint{{Target: "xMsClientRequestID", Name: validation.Pattern, Rule: `^[{(]?[0-9a-f]{8}[-]?([0-9a-f]{4}[-]?){3}[0-9a-f]{12}[)}]?$`, Chain: nil}}}, + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("storagedatalake.PathClient", "Read", err.Error()) + } + + req, err := client.ReadPreparer(ctx, filesystem, pathParameter, rangeParameter, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince, xMsClientRequestID, timeout, xMsDate) + if err != nil { + err = autorest.NewErrorWithError(err, "storagedatalake.PathClient", "Read", nil, "Failure preparing request") + return + } + + resp, err := client.ReadSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "storagedatalake.PathClient", "Read", resp, "Failure sending request") + return + } + + result, err = client.ReadResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "storagedatalake.PathClient", "Read", resp, "Failure responding to request") + } + + return +} + +// ReadPreparer prepares the Read request. +func (client PathClient) ReadPreparer(ctx context.Context, filesystem string, pathParameter string, rangeParameter string, ifMatch string, ifNoneMatch string, ifModifiedSince string, ifUnmodifiedSince string, xMsClientRequestID string, timeout *int32, xMsDate string) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "accountName": client.AccountName, + "dnsSuffix": client.DNSSuffix, + } + + pathParameters := map[string]interface{}{ + "filesystem": autorest.Encode("path", filesystem), + "path": autorest.Encode("path", pathParameter), + } + + queryParameters := map[string]interface{}{} + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithCustomBaseURL("http://{accountName}.{dnsSuffix}", urlParameters), + autorest.WithPathParameters("/{filesystem}/{path}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if len(rangeParameter) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("Range", autorest.String(rangeParameter))) + } + if len(ifMatch) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + } + if len(ifNoneMatch) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) + } + if len(ifModifiedSince) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) + } + if len(ifUnmodifiedSince) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) + } + if len(xMsClientRequestID) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-client-request-id", autorest.String(xMsClientRequestID))) + } + if len(xMsDate) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-date", autorest.String(xMsDate))) + } + if len(client.XMsVersion) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-version", autorest.String(client.XMsVersion))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ReadSender sends the Read request. The method will close the +// http.Response Body if it receives an error. +func (client PathClient) ReadSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// ReadResponder handles the response to the Read request. The method always +// closes the http.Response Body. +func (client PathClient) ReadResponder(resp *http.Response) (result ReadCloser, err error) { + result.Value = &resp.Body + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusPartialContent)) + result.Response = autorest.Response{Response: resp} + return +} + +// Update uploads data to be appended to a file, flushes (writes) previously uploaded data to a file, sets properties +// for a file or directory, or sets access control for a file or directory. Data can only be appended to a file. This +// operation supports conditional HTTP requests. For more information, see [Specifying Conditional Headers for Blob +// Service +// Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations). +// Parameters: +// action - the action must be "append" to upload data to be appended to a file, "flush" to flush previously +// uploaded data to a file, "setProperties" to set the properties of a file or directory, or "setAccessControl" +// to set the owner, group, permissions, or access control list for a file or directory. Note that +// Hierarchical Namespace must be enabled for the account in order to use access control. Also note that the +// Access Control List (ACL) includes permissions for the owner, owning group, and others, so the +// x-ms-permissions and x-ms-acl request headers are mutually exclusive. +// filesystem - the filesystem identifier. +// pathParameter - the file or directory path. +// position - this parameter allows the caller to upload data in parallel and control the order in which it is +// appended to the file. It is required when uploading data to be appended to the file and when flushing +// previously uploaded data to the file. The value must be the position where the data is to be appended. +// Uploaded data is not immediately flushed, or written, to the file. To flush, the previously uploaded data +// must be contiguous, the position parameter must be specified and equal to the length of the file after all +// data has been written, and there must not be a request entity body included with the request. +// retainUncommittedData - valid only for flush operations. If "true", uncommitted data is retained after the +// flush operation completes; otherwise, the uncommitted data is deleted after the flush operation. The +// default is false. Data at offsets less than the specified position are written to the file when flush +// succeeds, but this optional parameter allows data after the flush position to be retained for a future flush +// operation. +// contentLength - required for "Append Data" and "Flush Data". Must be 0 for "Flush Data". Must be the +// length of the request content in bytes for "Append Data". +// xMsLeaseAction - optional. The lease action can be "renew" to renew an existing lease or "release" to +// release a lease. +// xMsLeaseID - the lease ID must be specified if there is an active lease. +// xMsCacheControl - optional and only valid for flush and set properties operations. The service stores this +// value and includes it in the "Cache-Control" response header for "Read File" operations. +// xMsContentType - optional and only valid for flush and set properties operations. The service stores this +// value and includes it in the "Content-Type" response header for "Read File" operations. +// xMsContentDisposition - optional and only valid for flush and set properties operations. The service stores +// this value and includes it in the "Content-Disposition" response header for "Read File" operations. +// xMsContentEncoding - optional and only valid for flush and set properties operations. The service stores +// this value and includes it in the "Content-Encoding" response header for "Read File" operations. +// xMsContentLanguage - optional and only valid for flush and set properties operations. The service stores +// this value and includes it in the "Content-Language" response header for "Read File" operations. +// xMsProperties - optional. User-defined properties to be stored with the file or directory, in the format of +// a comma-separated list of name and value pairs "n1=v1, n2=v2, ...", where each value is base64 encoded. +// Valid only for the setProperties operation. If the file or directory exists, any properties not included in +// the list will be removed. All properties are removed if the header is omitted. To merge new and existing +// properties, first get all existing properties and the current E-Tag, then make a conditional request with +// the E-Tag and include values for all properties. +// xMsOwner - optional and valid only for the setAccessControl operation. Sets the owner of the file or +// directory. +// xMsGroup - optional and valid only for the setAccessControl operation. Sets the owning group of the file or +// directory. +// xMsPermissions - optional and only valid if Hierarchical Namespace is enabled for the account. Sets POSIX +// access permissions for the file owner, the file owning group, and others. Each class may be granted read, +// write, or execute permission. The sticky bit is also supported. Both symbolic (rwxrw-rw-) and 4-digit +// octal notation (e.g. 0766) are supported. Invalid in conjunction with x-ms-acl. +// xMsACL - optional and valid only for the setAccessControl operation. Sets POSIX access control rights on +// files and directories. The value is a comma-separated list of access control entries that fully replaces the +// existing access control list (ACL). Each access control entry (ACE) consists of a scope, a type, a user or +// group identifier, and permissions in the format "[scope:][type]:[id]:[permissions]". The scope must be +// "default" to indicate the ACE belongs to the default ACL for a directory; otherwise scope is implicit and +// the ACE belongs to the access ACL. There are four ACE types: "user" grants rights to the owner or a named +// user, "group" grants rights to the owning group or a named group, "mask" restricts rights granted to named +// users and the members of groups, and "other" grants rights to all users not found in any of the other +// entries. The user or group identifier is omitted for entries of type "mask" and "other". The user or group +// identifier is also omitted for the owner and owning group. The permission field is a 3-character sequence +// where the first character is 'r' to grant read access, the second character is 'w' to grant write access, +// and the third character is 'x' to grant execute permission. If access is not granted, the '-' character is +// used to denote that the permission is denied. For example, the following ACL grants read, write, and execute +// rights to the file owner and john.doe@contoso, the read right to the owning group, and nothing to everyone +// else: "user::rwx,user:john.doe@contoso:rwx,group::r--,other::---,mask=rwx". Invalid in conjunction with +// x-ms-permissions. +// ifMatch - optional for Flush Data and Set Properties, but invalid for Append Data. An ETag value. Specify +// this header to perform the operation only if the resource's ETag matches the value specified. The ETag must +// be specified in quotes. +// ifNoneMatch - optional for Flush Data and Set Properties, but invalid for Append Data. An ETag value or the +// special wildcard ("*") value. Specify this header to perform the operation only if the resource's ETag does +// not match the value specified. The ETag must be specified in quotes. +// ifModifiedSince - optional for Flush Data and Set Properties, but invalid for Append Data. A date and time +// value. Specify this header to perform the operation only if the resource has been modified since the +// specified date and time. +// ifUnmodifiedSince - optional for Flush Data and Set Properties, but invalid for Append Data. A date and time +// value. Specify this header to perform the operation only if the resource has not been modified since the +// specified date and time. +// requestBody - valid only for append operations. The data to be uploaded and appended to the file. +// xMsClientRequestID - a UUID recorded in the analytics logs for troubleshooting and correlation. +// timeout - an optional operation timeout value in seconds. The period begins when the request is received by +// the service. If the timeout value elapses before the operation completes, the operation fails. +// xMsDate - specifies the Coordinated Universal Time (UTC) for the request. This is required when using +// shared key authorization. +func (client PathClient) Update(ctx context.Context, action PathUpdateAction, filesystem string, pathParameter string, position *int64, retainUncommittedData *bool, contentLength string, xMsLeaseAction PathUpdateLeaseAction, xMsLeaseID string, xMsCacheControl string, xMsContentType string, xMsContentDisposition string, xMsContentEncoding string, xMsContentLanguage string, xMsProperties string, xMsOwner string, xMsGroup string, xMsPermissions string, xMsACL string, ifMatch string, ifNoneMatch string, ifModifiedSince string, ifUnmodifiedSince string, requestBody io.ReadCloser, xMsClientRequestID string, timeout *int32, xMsDate string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: xMsLeaseID, + Constraints: []validation.Constraint{{Target: "xMsLeaseID", Name: validation.Pattern, Rule: `^[{(]?[0-9a-f]{8}[-]?([0-9a-f]{4}[-]?){3}[0-9a-f]{12}[)}]?$`, Chain: nil}}}, + {TargetValue: filesystem, + Constraints: []validation.Constraint{{Target: "filesystem", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "filesystem", Name: validation.MinLength, Rule: 3, Chain: nil}}}, + {TargetValue: xMsClientRequestID, + Constraints: []validation.Constraint{{Target: "xMsClientRequestID", Name: validation.Pattern, Rule: `^[{(]?[0-9a-f]{8}[-]?([0-9a-f]{4}[-]?){3}[0-9a-f]{12}[)}]?$`, Chain: nil}}}, + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("storagedatalake.PathClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, action, filesystem, pathParameter, position, retainUncommittedData, contentLength, xMsLeaseAction, xMsLeaseID, xMsCacheControl, xMsContentType, xMsContentDisposition, xMsContentEncoding, xMsContentLanguage, xMsProperties, xMsOwner, xMsGroup, xMsPermissions, xMsACL, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince, requestBody, xMsClientRequestID, timeout, xMsDate) + if err != nil { + err = autorest.NewErrorWithError(err, "storagedatalake.PathClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "storagedatalake.PathClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "storagedatalake.PathClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client PathClient) UpdatePreparer(ctx context.Context, action PathUpdateAction, filesystem string, pathParameter string, position *int64, retainUncommittedData *bool, contentLength string, xMsLeaseAction PathUpdateLeaseAction, xMsLeaseID string, xMsCacheControl string, xMsContentType string, xMsContentDisposition string, xMsContentEncoding string, xMsContentLanguage string, xMsProperties string, xMsOwner string, xMsGroup string, xMsPermissions string, xMsACL string, ifMatch string, ifNoneMatch string, ifModifiedSince string, ifUnmodifiedSince string, requestBody io.ReadCloser, xMsClientRequestID string, timeout *int32, xMsDate string) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "accountName": client.AccountName, + "dnsSuffix": client.DNSSuffix, + } + + pathParameters := map[string]interface{}{ + "filesystem": autorest.Encode("path", filesystem), + "path": autorest.Encode("path", pathParameter), + } + + queryParameters := map[string]interface{}{ + "action": autorest.Encode("query", action), + } + if position != nil { + queryParameters["position"] = autorest.Encode("query", *position) + } + if retainUncommittedData != nil { + queryParameters["retainUncommittedData"] = autorest.Encode("query", *retainUncommittedData) + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/octet-stream"), + autorest.AsPatch(), + autorest.WithCustomBaseURL("http://{accountName}.{dnsSuffix}", urlParameters), + autorest.WithPathParameters("/{filesystem}/{path}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if requestBody != nil { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithFile(requestBody)) + } + if len(contentLength) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("Content-Length", autorest.String(contentLength))) + } + if len(string(xMsLeaseAction)) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-lease-action", autorest.String(xMsLeaseAction))) + } + if len(xMsLeaseID) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-lease-id", autorest.String(xMsLeaseID))) + } + if len(xMsCacheControl) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-cache-control", autorest.String(xMsCacheControl))) + } + if len(xMsContentType) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-content-type", autorest.String(xMsContentType))) + } + if len(xMsContentDisposition) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-content-disposition", autorest.String(xMsContentDisposition))) + } + if len(xMsContentEncoding) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-content-encoding", autorest.String(xMsContentEncoding))) + } + if len(xMsContentLanguage) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-content-language", autorest.String(xMsContentLanguage))) + } + if len(xMsProperties) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-properties", autorest.String(xMsProperties))) + } + if len(xMsOwner) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-owner", autorest.String(xMsOwner))) + } + if len(xMsGroup) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-group", autorest.String(xMsGroup))) + } + if len(xMsPermissions) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-permissions", autorest.String(xMsPermissions))) + } + if len(xMsACL) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-acl", autorest.String(xMsACL))) + } + if len(ifMatch) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + } + if len(ifNoneMatch) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) + } + if len(ifModifiedSince) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince))) + } + if len(ifUnmodifiedSince) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince))) + } + if len(xMsClientRequestID) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-client-request-id", autorest.String(xMsClientRequestID))) + } + if len(xMsDate) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-date", autorest.String(xMsDate))) + } + if len(client.XMsVersion) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-version", autorest.String(client.XMsVersion))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client PathClient) UpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client PathClient) UpdateResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/storage/datalake/2018-06-17/storagedatalake/version.go b/vendor/github.com/Azure/azure-sdk-for-go/services/storage/datalake/2018-06-17/storagedatalake/version.go new file mode 100644 index 000000000..20c50acb4 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/storage/datalake/2018-06-17/storagedatalake/version.go @@ -0,0 +1,30 @@ +package storagedatalake + +import "github.com/Azure/azure-sdk-for-go/version" + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// UserAgent returns the UserAgent string to use when sending http.Requests. +func UserAgent() string { + return "Azure-SDK-For-Go/" + version.Number + " storagedatalake/2018-06-17" +} + +// Version returns the semantic version (see http://semver.org) of the client. +func Version() string { + return version.Number +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2018-02-01/storage/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2018-02-01/storage/models.go index d9dd94375..6cb70114c 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2018-02-01/storage/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2018-02-01/storage/models.go @@ -796,6 +796,8 @@ type AccountProperties struct { EnableHTTPSTrafficOnly *bool `json:"supportsHttpsTrafficOnly,omitempty"` // NetworkRuleSet - Network rule set NetworkRuleSet *NetworkRuleSet `json:"networkAcls,omitempty"` + // IsHnsEnabled - Account HierarchicalNamespace enabled if sets to true. + IsHnsEnabled *bool `json:"isHnsEnabled,omitempty"` } // AccountPropertiesCreateParameters the parameters used to create the storage account. @@ -810,6 +812,8 @@ type AccountPropertiesCreateParameters struct { AccessTier AccessTier `json:"accessTier,omitempty"` // EnableHTTPSTrafficOnly - Allows https traffic only to storage service if sets to true. EnableHTTPSTrafficOnly *bool `json:"supportsHttpsTrafficOnly,omitempty"` + // IsHnsEnabled - Account HierarchicalNamespace enabled if sets to true. + IsHnsEnabled *bool `json:"isHnsEnabled,omitempty"` } // AccountPropertiesUpdateParameters the parameters used when updating a storage account. @@ -1200,7 +1204,7 @@ type EncryptionServices struct { Queue *EncryptionService `json:"queue,omitempty"` } -// Endpoints the URIs that are used to perform a retrieval of a public blob, queue, or table object. +// Endpoints the URIs that are used to perform a retrieval of a public blob, queue, table, web or dfs object. type Endpoints struct { // Blob - Gets the blob endpoint. Blob *string `json:"blob,omitempty"` @@ -1210,6 +1214,10 @@ type Endpoints struct { Table *string `json:"table,omitempty"` // File - Gets the file endpoint. File *string `json:"file,omitempty"` + // Web - Gets the web endpoint. + Web *string `json:"web,omitempty"` + // Dfs - Gets the dfs endpoint. + Dfs *string `json:"dfs,omitempty"` } // Identity identity for the resource. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/timeseriesinsights/mgmt/2017-11-15/timeseriesinsights/environments.go b/vendor/github.com/Azure/azure-sdk-for-go/services/timeseriesinsights/mgmt/2017-11-15/timeseriesinsights/environments.go index 202aace55..ac2174356 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/timeseriesinsights/mgmt/2017-11-15/timeseriesinsights/environments.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/timeseriesinsights/mgmt/2017-11-15/timeseriesinsights/environments.go @@ -54,7 +54,7 @@ func (client EnvironmentsClient) CreateOrUpdate(ctx context.Context, resourceGro {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.Sku", Name: validation.Null, Rule: true, Chain: []validation.Constraint{{Target: "parameters.Sku.Capacity", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.Sku.Capacity", Name: validation.InclusiveMaximum, Rule: 10, Chain: nil}, + Chain: []validation.Constraint{{Target: "parameters.Sku.Capacity", Name: validation.InclusiveMaximum, Rule: int64(10), Chain: nil}, {Target: "parameters.Sku.Capacity", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}, }}, diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/web/mgmt/2016-09-01/web/apps.go b/vendor/github.com/Azure/azure-sdk-for-go/services/web/mgmt/2016-09-01/web/apps.go index 414b7700f..4db43838e 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/web/mgmt/2016-09-01/web/apps.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/web/mgmt/2016-09-01/web/apps.go @@ -24719,7 +24719,7 @@ func (client AppsClient) UpdateDiagnosticLogsConfig(ctx context.Context, resourc {Target: "siteLogsConfig.SiteLogsConfigProperties.HTTPLogs", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "siteLogsConfig.SiteLogsConfigProperties.HTTPLogs.FileSystem", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "siteLogsConfig.SiteLogsConfigProperties.HTTPLogs.FileSystem.RetentionInMb", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "siteLogsConfig.SiteLogsConfigProperties.HTTPLogs.FileSystem.RetentionInMb", Name: validation.InclusiveMaximum, Rule: 100, Chain: nil}, + Chain: []validation.Constraint{{Target: "siteLogsConfig.SiteLogsConfigProperties.HTTPLogs.FileSystem.RetentionInMb", Name: validation.InclusiveMaximum, Rule: int64(100), Chain: nil}, {Target: "siteLogsConfig.SiteLogsConfigProperties.HTTPLogs.FileSystem.RetentionInMb", Name: validation.InclusiveMinimum, Rule: 25, Chain: nil}, }}, }}, @@ -24815,7 +24815,7 @@ func (client AppsClient) UpdateDiagnosticLogsConfigSlot(ctx context.Context, res {Target: "siteLogsConfig.SiteLogsConfigProperties.HTTPLogs", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "siteLogsConfig.SiteLogsConfigProperties.HTTPLogs.FileSystem", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "siteLogsConfig.SiteLogsConfigProperties.HTTPLogs.FileSystem.RetentionInMb", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "siteLogsConfig.SiteLogsConfigProperties.HTTPLogs.FileSystem.RetentionInMb", Name: validation.InclusiveMaximum, Rule: 100, Chain: nil}, + Chain: []validation.Constraint{{Target: "siteLogsConfig.SiteLogsConfigProperties.HTTPLogs.FileSystem.RetentionInMb", Name: validation.InclusiveMaximum, Rule: int64(100), Chain: nil}, {Target: "siteLogsConfig.SiteLogsConfigProperties.HTTPLogs.FileSystem.RetentionInMb", Name: validation.InclusiveMinimum, Rule: 25, Chain: nil}, }}, }}, diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/web/mgmt/2016-09-01/web/appservicecertificateorders.go b/vendor/github.com/Azure/azure-sdk-for-go/services/web/mgmt/2016-09-01/web/appservicecertificateorders.go index ba9c790ce..40d00aabb 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/web/mgmt/2016-09-01/web/appservicecertificateorders.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/web/mgmt/2016-09-01/web/appservicecertificateorders.go @@ -54,7 +54,7 @@ func (client AppServiceCertificateOrdersClient) CreateOrUpdate(ctx context.Conte {TargetValue: certificateDistinguishedName, Constraints: []validation.Constraint{{Target: "certificateDistinguishedName.AppServiceCertificateOrderProperties", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "certificateDistinguishedName.AppServiceCertificateOrderProperties.ValidityInYears", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "certificateDistinguishedName.AppServiceCertificateOrderProperties.ValidityInYears", Name: validation.InclusiveMaximum, Rule: 3, Chain: nil}, + Chain: []validation.Constraint{{Target: "certificateDistinguishedName.AppServiceCertificateOrderProperties.ValidityInYears", Name: validation.InclusiveMaximum, Rule: int64(3), Chain: nil}, {Target: "certificateDistinguishedName.AppServiceCertificateOrderProperties.ValidityInYears", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}, }}}}}); err != nil { @@ -1508,7 +1508,7 @@ func (client AppServiceCertificateOrdersClient) ValidatePurchaseInformation(ctx {TargetValue: appServiceCertificateOrder, Constraints: []validation.Constraint{{Target: "appServiceCertificateOrder.AppServiceCertificateOrderProperties", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "appServiceCertificateOrder.AppServiceCertificateOrderProperties.ValidityInYears", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "appServiceCertificateOrder.AppServiceCertificateOrderProperties.ValidityInYears", Name: validation.InclusiveMaximum, Rule: 3, Chain: nil}, + Chain: []validation.Constraint{{Target: "appServiceCertificateOrder.AppServiceCertificateOrderProperties.ValidityInYears", Name: validation.InclusiveMaximum, Rule: int64(3), Chain: nil}, {Target: "appServiceCertificateOrder.AppServiceCertificateOrderProperties.ValidityInYears", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}, }}}}}); err != nil { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/web/mgmt/2018-02-01/web/apps.go b/vendor/github.com/Azure/azure-sdk-for-go/services/web/mgmt/2018-02-01/web/apps.go index 04df7a05f..4b21fdd2b 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/web/mgmt/2018-02-01/web/apps.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/web/mgmt/2018-02-01/web/apps.go @@ -25344,7 +25344,7 @@ func (client AppsClient) UpdateDiagnosticLogsConfig(ctx context.Context, resourc {Target: "siteLogsConfig.SiteLogsConfigProperties.HTTPLogs", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "siteLogsConfig.SiteLogsConfigProperties.HTTPLogs.FileSystem", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "siteLogsConfig.SiteLogsConfigProperties.HTTPLogs.FileSystem.RetentionInMb", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "siteLogsConfig.SiteLogsConfigProperties.HTTPLogs.FileSystem.RetentionInMb", Name: validation.InclusiveMaximum, Rule: 100, Chain: nil}, + Chain: []validation.Constraint{{Target: "siteLogsConfig.SiteLogsConfigProperties.HTTPLogs.FileSystem.RetentionInMb", Name: validation.InclusiveMaximum, Rule: int64(100), Chain: nil}, {Target: "siteLogsConfig.SiteLogsConfigProperties.HTTPLogs.FileSystem.RetentionInMb", Name: validation.InclusiveMinimum, Rule: 25, Chain: nil}, }}, }}, @@ -25440,7 +25440,7 @@ func (client AppsClient) UpdateDiagnosticLogsConfigSlot(ctx context.Context, res {Target: "siteLogsConfig.SiteLogsConfigProperties.HTTPLogs", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "siteLogsConfig.SiteLogsConfigProperties.HTTPLogs.FileSystem", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "siteLogsConfig.SiteLogsConfigProperties.HTTPLogs.FileSystem.RetentionInMb", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "siteLogsConfig.SiteLogsConfigProperties.HTTPLogs.FileSystem.RetentionInMb", Name: validation.InclusiveMaximum, Rule: 100, Chain: nil}, + Chain: []validation.Constraint{{Target: "siteLogsConfig.SiteLogsConfigProperties.HTTPLogs.FileSystem.RetentionInMb", Name: validation.InclusiveMaximum, Rule: int64(100), Chain: nil}, {Target: "siteLogsConfig.SiteLogsConfigProperties.HTTPLogs.FileSystem.RetentionInMb", Name: validation.InclusiveMinimum, Rule: 25, Chain: nil}, }}, }}, diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/web/mgmt/2018-02-01/web/appservicecertificateorders.go b/vendor/github.com/Azure/azure-sdk-for-go/services/web/mgmt/2018-02-01/web/appservicecertificateorders.go index 77ef0e4f4..be9cbbdd2 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/web/mgmt/2018-02-01/web/appservicecertificateorders.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/web/mgmt/2018-02-01/web/appservicecertificateorders.go @@ -54,7 +54,7 @@ func (client AppServiceCertificateOrdersClient) CreateOrUpdate(ctx context.Conte {TargetValue: certificateDistinguishedName, Constraints: []validation.Constraint{{Target: "certificateDistinguishedName.AppServiceCertificateOrderProperties", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "certificateDistinguishedName.AppServiceCertificateOrderProperties.ValidityInYears", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "certificateDistinguishedName.AppServiceCertificateOrderProperties.ValidityInYears", Name: validation.InclusiveMaximum, Rule: 3, Chain: nil}, + Chain: []validation.Constraint{{Target: "certificateDistinguishedName.AppServiceCertificateOrderProperties.ValidityInYears", Name: validation.InclusiveMaximum, Rule: int64(3), Chain: nil}, {Target: "certificateDistinguishedName.AppServiceCertificateOrderProperties.ValidityInYears", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}, }}}}}); err != nil { @@ -1508,7 +1508,7 @@ func (client AppServiceCertificateOrdersClient) ValidatePurchaseInformation(ctx {TargetValue: appServiceCertificateOrder, Constraints: []validation.Constraint{{Target: "appServiceCertificateOrder.AppServiceCertificateOrderProperties", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "appServiceCertificateOrder.AppServiceCertificateOrderProperties.ValidityInYears", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "appServiceCertificateOrder.AppServiceCertificateOrderProperties.ValidityInYears", Name: validation.InclusiveMaximum, Rule: 3, Chain: nil}, + Chain: []validation.Constraint{{Target: "appServiceCertificateOrder.AppServiceCertificateOrderProperties.ValidityInYears", Name: validation.InclusiveMaximum, Rule: int64(3), Chain: nil}, {Target: "appServiceCertificateOrder.AppServiceCertificateOrderProperties.ValidityInYears", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}, }}}}}); err != nil { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/web/mgmt/2018-02-01/web/appserviceenvironments.go b/vendor/github.com/Azure/azure-sdk-for-go/services/web/mgmt/2018-02-01/web/appserviceenvironments.go index 976c1299d..029c06823 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/web/mgmt/2018-02-01/web/appserviceenvironments.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/web/mgmt/2018-02-01/web/appserviceenvironments.go @@ -1848,7 +1848,7 @@ func (client AppServiceEnvironmentsClient) ListMultiRolePoolInstanceMetricsPrepa preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default/instances/{instance}metrics", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default/instances/{instance}/metrics", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -3073,7 +3073,7 @@ func (client AppServiceEnvironmentsClient) ListWorkerPoolInstanceMetricsPreparer preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}/instances/{instance}metrics", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}/instances/{instance}/metrics", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/storage/README.md b/vendor/github.com/Azure/azure-sdk-for-go/storage/README.md index 49e48cdf1..459b45831 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/storage/README.md +++ b/vendor/github.com/Azure/azure-sdk-for-go/storage/README.md @@ -1,9 +1,13 @@ # Azure Storage SDK for Go (Preview) :exclamation: IMPORTANT: This package is in maintenance only and will be deprecated in the -future. Consider using the new package for blobs currently in preview at -[github.com/Azure/azure-storage-blob-go](https://github.com/Azure/azure-storage-blob-go). -New Table, Queue and File packages are also in development. +future. Please use one of the following packages instead. + +| Service | Import Path/Repo | +|---------|------------------| +| Storage - Blobs | [github.com/Azure/azure-storage-blob-go](https://github.com/Azure/azure-storage-blob-go) | +| Storage - Files | [github.com/Azure/azure-storage-file-go](https://github.com/Azure/azure-storage-file-go) | +| Storage - Queues | [github.com/Azure/azure-storage-queue-go](https://github.com/Azure/azure-storage-queue-go) | The `github.com/Azure/azure-sdk-for-go/storage` package is used to manage [Azure Storage](https://docs.microsoft.com/en-us/azure/storage/) data plane diff --git a/vendor/github.com/Azure/azure-sdk-for-go/storage/blobserviceclient.go b/vendor/github.com/Azure/azure-sdk-for-go/storage/blobserviceclient.go index f6a9da282..02fa5929c 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/storage/blobserviceclient.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/storage/blobserviceclient.go @@ -69,7 +69,11 @@ func GetContainerReferenceFromSASURI(sasuri url.URL) (*Container, error) { if len(path) <= 1 { return nil, fmt.Errorf("could not find a container in URI: %s", sasuri.String()) } - cli := newSASClient().GetBlobService() + c, err := newSASClientFromURL(&sasuri) + if err != nil { + return nil, err + } + cli := c.GetBlobService() return &Container{ bsc: &cli, Name: path[1], diff --git a/vendor/github.com/Azure/azure-sdk-for-go/storage/client.go b/vendor/github.com/Azure/azure-sdk-for-go/storage/client.go index 2930824b2..427558b5d 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/storage/client.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/storage/client.go @@ -336,15 +336,7 @@ func IsValidStorageAccount(account string) bool { // NewAccountSASClient contructs a client that uses accountSAS authorization // for its operations. func NewAccountSASClient(account string, token url.Values, env azure.Environment) Client { - c := newSASClient() - c.accountSASToken = token - c.accountName = account - c.baseURL = env.StorageEndpointSuffix - - // Get API version and protocol from token - c.apiVersion = token.Get("sv") - c.useHTTPS = token.Get("spr") == "https" - return c + return newSASClient(account, env.StorageEndpointSuffix, token) } // NewAccountSASClientFromEndpointToken constructs a client that uses accountSAS authorization @@ -354,12 +346,36 @@ func NewAccountSASClientFromEndpointToken(endpoint string, sasToken string) (Cli if err != nil { return Client{}, err } - - token, err := url.ParseQuery(sasToken) + _, err = url.ParseQuery(sasToken) if err != nil { return Client{}, err } + u.RawQuery = sasToken + return newSASClientFromURL(u) +} +func newSASClient(accountName, baseURL string, sasToken url.Values) Client { + c := Client{ + HTTPClient: http.DefaultClient, + apiVersion: DefaultAPIVersion, + sasClient: true, + Sender: &DefaultSender{ + RetryAttempts: defaultRetryAttempts, + ValidStatusCodes: defaultValidStatusCodes, + RetryDuration: defaultRetryDuration, + }, + accountName: accountName, + baseURL: baseURL, + accountSASToken: sasToken, + } + c.userAgent = c.getDefaultUserAgent() + // Get API version and protocol from token + c.apiVersion = sasToken.Get("sv") + c.useHTTPS = sasToken.Get("spr") == "https" + return c +} + +func newSASClientFromURL(u *url.URL) (Client, error) { // the host name will look something like this // - foo.blob.core.windows.net // "foo" is the account name @@ -377,30 +393,13 @@ func NewAccountSASClientFromEndpointToken(endpoint string, sasToken string) (Cli return Client{}, fmt.Errorf("failed to find '.' in %s", u.Host[i1+1:]) } - c := newSASClient() - c.accountSASToken = token - c.accountName = u.Host[:i1] - c.baseURL = u.Host[i1+i2+2:] - - // Get API version and protocol from token - c.apiVersion = token.Get("sv") - c.useHTTPS = token.Get("spr") == "https" - return c, nil -} - -func newSASClient() Client { - c := Client{ - HTTPClient: http.DefaultClient, - apiVersion: DefaultAPIVersion, - sasClient: true, - Sender: &DefaultSender{ - RetryAttempts: defaultRetryAttempts, - ValidStatusCodes: defaultValidStatusCodes, - RetryDuration: defaultRetryDuration, - }, + sasToken := u.Query() + c := newSASClient(u.Host[:i1], u.Host[i1+i2+2:], sasToken) + if spr := sasToken.Get("spr"); spr == "" { + // infer from URL if not in the query params set + c.useHTTPS = u.Scheme == "https" } - c.userAgent = c.getDefaultUserAgent() - return c + return c, nil } func (c Client) isServiceSASClient() bool { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/storage/message.go b/vendor/github.com/Azure/azure-sdk-for-go/storage/message.go index ce33dcb72..ffc183be6 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/storage/message.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/storage/message.go @@ -114,7 +114,8 @@ func (m *Message) Update(options *UpdateMessageOptions) error { return err } headers["Content-Length"] = strconv.Itoa(nn) - + // visibilitytimeout is required for Update (zero or greater) so set the default here + query.Set("visibilitytimeout", "0") if options != nil { if options.VisibilityTimeout != 0 { query.Set("visibilitytimeout", strconv.Itoa(options.VisibilityTimeout)) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/swagger_to_sdk_config.json b/vendor/github.com/Azure/azure-sdk-for-go/swagger_to_sdk_config.json index aad62018a..b3d83f948 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/swagger_to_sdk_config.json +++ b/vendor/github.com/Azure/azure-sdk-for-go/swagger_to_sdk_config.json @@ -7,7 +7,7 @@ "gofmt -w ./services/" ], "autorest_options": { - "use": "@microsoft.azure/autorest.go@~2.1.100", + "use": "@microsoft.azure/autorest.go@~2.1.105", "go": "", "verbose": "", "sdkrel:go-sdk-folder": ".", diff --git a/vendor/github.com/Azure/azure-sdk-for-go/tools/apidiff/cmd/common.go b/vendor/github.com/Azure/azure-sdk-for-go/tools/apidiff/cmd/common.go index 115348922..8683e34e1 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/tools/apidiff/cmd/common.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/tools/apidiff/cmd/common.go @@ -41,6 +41,18 @@ func println(a ...interface{}) { } } +func dprintf(format string, a ...interface{}) { + if debugFlag { + printf(format, a...) + } +} + +func dprintln(a ...interface{}) { + if debugFlag { + println(a...) + } +} + func vprintf(format string, a ...interface{}) { if verboseFlag { printf(format, a...) @@ -161,11 +173,13 @@ func printReport(r report) error { return nil } - b, err := json.MarshalIndent(r, "", " ") - if err != nil { - return fmt.Errorf("failed to marshal report: %v", err) + if !suppressReport { + b, err := json.MarshalIndent(r, "", " ") + if err != nil { + return fmt.Errorf("failed to marshal report: %v", err) + } + println(string(b)) } - println(string(b)) return nil } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/tools/apidiff/cmd/packages.go b/vendor/github.com/Azure/azure-sdk-for-go/tools/apidiff/cmd/packages.go index e264ea49b..a49ba103d 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/tools/apidiff/cmd/packages.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/tools/apidiff/cmd/packages.go @@ -63,15 +63,16 @@ func thePackagesCmd(args []string) (rpt CommitPkgsReport, err error) { rpt.CommitsReports = map[string]pkgsReport{} worker := func(rootDir string, cloneRepo repo.WorkingTree, baseCommit, targetCommit string) error { + vprintf("generating diff between %s and %s\n", baseCommit, targetCommit) // get for lhs - vprintf("checking out base commit %s and gathering exports\n", baseCommit) + dprintf("checking out base commit %s and gathering exports\n", baseCommit) lhs, err := getRepoContentForCommit(cloneRepo, rootDir, baseCommit) if err != nil { return err } // get for rhs - vprintf("checking out target commit %s and gathering exports\n", targetCommit) + dprintf("checking out target commit %s and gathering exports\n", targetCommit) var rhs repoContent rhs, err = getRepoContentForCommit(cloneRepo, rootDir, targetCommit) if err != nil { @@ -129,59 +130,53 @@ func getRepoContentForCommit(wt repo.WorkingTree, dir, commit string) (r repoCon if err != nil { return } - if verboseFlag { + if debugFlag { fmt.Println("found the following package directories") for _, d := range pkgDirs { fmt.Printf("\t%s\n", d) } } - r, err = getExportsForPackages(pkgDirs) + r, err = getExportsForPackages(wt.Root(), pkgDirs) if err != nil { err = fmt.Errorf("failed to get exports for commit '%s': %s", commit, err) } return } -// contains repo content, it's structured as "package":"apiversion":content -type repoContent map[string]map[string]exports.Content +// contains repo content, it's structured as "package path":content +type repoContent map[string]exports.Content // returns repoContent based on the provided slice of package directories -func getExportsForPackages(pkgDirs []string) (repoContent, error) { +func getExportsForPackages(root string, pkgDirs []string) (repoContent, error) { exps := repoContent{} for _, pkgDir := range pkgDirs { - vprintf("getting exports for %s\n", pkgDir) - // pkgDir = "D:\work\src\github.com\Azure\azure-sdk-for-go\services\analysisservices\mgmt\2016-05-16\analysisservices" - // we want ver = "2016-05-16", pkg = "analysisservices" - i := strings.LastIndexByte(pkgDir, os.PathSeparator) - j := strings.LastIndexByte(pkgDir[:i], os.PathSeparator) - ver := pkgDir[j+1 : j+(i-j)] - pkg := pkgDir[i+1:] - - if _, ok := exps[pkg]; !ok { - exps[pkg] = map[string]exports.Content{} + dprintf("getting exports for %s\n", pkgDir) + // pkgDir = "C:\Users\somebody\AppData\Local\Temp\apidiff-1529437978\services\addons\mgmt\2017-05-15\addons" + // convert to package path "github.com/Azure/azure-sdk-for-go/services/analysisservices/mgmt/2016-05-16/analysisservices" + pkgPath := strings.Replace(pkgDir, root, "github.com/Azure/azure-sdk-for-go", -1) + pkgPath = strings.Replace(pkgPath, string(os.PathSeparator), "/", -1) + if _, ok := exps[pkgPath]; ok { + return nil, fmt.Errorf("duplicate package: %s", pkgPath) } - - if _, ok := exps[pkg][ver]; !ok { - exp, err := exports.Get(pkgDir) - if err != nil { - return nil, err - } - exps[pkg][ver] = exp + exp, err := exports.Get(pkgDir) + if err != nil { + return nil, err } + exps[pkgPath] = exp } return exps, nil } -// contains a collection of packages, it's structured as "package":{"apiver1", "apiver2",...} -type pkgsList map[string][]string +// contains a collection of packages +type pkgsList []string -// contains a collection of package reports, it's structured as "package":"apiversion":pkgReport -type modifiedPackages map[string]map[string]pkgReport +// contains a collection of package reports, it's structured as "package path":pkgReport +type modifiedPackages map[string]pkgReport // CommitPkgsReport represents a collection of reports, one for each commit hash. type CommitPkgsReport struct { - AffectedPackages pkgsList `json:"affectedPackages"` + AffectedPackages map[string]pkgsList `json:"affectedPackages"` BreakingChanges []string `json:"breakingChanges,omitempty"` CommitsReports map[string]pkgsReport `json:"deltas"` } @@ -219,25 +214,19 @@ func (c CommitPkgsReport) hasAdditiveChanges() bool { // updates the collection of affected packages with the packages that were touched in the specified commit func (c *CommitPkgsReport) updateAffectedPackages(commit string, r pkgsReport) { if c.AffectedPackages == nil { - c.AffectedPackages = map[string][]string{} + c.AffectedPackages = map[string]pkgsList{} } - for pkgName, apiVers := range r.AddedPackages { - for _, apiVer := range apiVers { - c.AffectedPackages[commit] = append(c.AffectedPackages[commit], fmt.Sprintf("%s/%s", pkgName, apiVer)) - } + for _, pkg := range r.AddedPackages { + c.AffectedPackages[commit] = append(c.AffectedPackages[commit], pkg) } - for pkgName, apiVers := range r.ModifiedPackages { - for apiVer := range apiVers { - c.AffectedPackages[commit] = append(c.AffectedPackages[commit], fmt.Sprintf("%s/%s", pkgName, apiVer)) - } + for pkgName := range r.ModifiedPackages { + c.AffectedPackages[commit] = append(c.AffectedPackages[commit], pkgName) } - for pkgName, apiVers := range r.RemovedPackages { - for _, apiVer := range apiVers { - c.AffectedPackages[commit] = append(c.AffectedPackages[commit], fmt.Sprintf("%s/%s", pkgName, apiVer)) - } + for _, pkg := range r.RemovedPackages { + c.AffectedPackages[commit] = append(c.AffectedPackages[commit], pkg) } } @@ -277,30 +266,22 @@ func getPkgsReport(lhs, rhs repoContent) pkgsReport { } // diff packages - for rhsK, rhsV := range rhs { - if _, ok := lhs[rhsK]; !ok { + for rhsPkg, rhsCnt := range rhs { + if _, ok := lhs[rhsPkg]; !ok { continue } - for rhsAPI, rhsCnt := range rhsV { - if _, ok := lhs[rhsK][rhsAPI]; !ok { - continue + if r := getPkgReport(lhs[rhsPkg], rhsCnt); !r.isEmpty() { + if r.hasBreakingChanges() { + report.modPkgHasBreaking = true } - if r := getPkgReport(lhs[rhsK][rhsAPI], rhsCnt); !r.isEmpty() { - if r.hasBreakingChanges() { - report.modPkgHasBreaking = true - } - if r.hasAdditiveChanges() { - report.modPkgHasAdditions = true - } - // only add an entry if the report contains data - if report.ModifiedPackages == nil { - report.ModifiedPackages = modifiedPackages{} - } - if _, ok := report.ModifiedPackages[rhsK]; !ok { - report.ModifiedPackages[rhsK] = map[string]pkgReport{} - } - report.ModifiedPackages[rhsK][rhsAPI] = r + if r.hasAdditiveChanges() { + report.modPkgHasAdditions = true } + // only add an entry if the report contains data + if report.ModifiedPackages == nil { + report.ModifiedPackages = modifiedPackages{} + } + report.ModifiedPackages[rhsPkg] = r } } @@ -310,26 +291,9 @@ func getPkgsReport(lhs, rhs repoContent) pkgsReport { // returns a list of packages in rhs that aren't in lhs func getPkgsList(lhs, rhs repoContent) pkgsList { list := pkgsList{} - for rhsK, rhsV := range rhs { - if lhsV, ok := lhs[rhsK]; !ok { - // package doesn't exist, add all API versions - apis := []string{} - for rhsAPI := range rhsV { - apis = append(apis, rhsAPI) - } - list[rhsK] = apis - } else { - // package exists, check for any new API versions - for rhsAPI := range rhsV { - apis := []string{} - if _, ok := lhsV[rhsAPI]; !ok { - // API version is new, add to slice - apis = append(apis, rhsAPI) - } - if len(apis) > 0 { - list[rhsK] = apis - } - } + for rhsPkg := range rhs { + if _, ok := lhs[rhsPkg]; !ok { + list = append(list, rhsPkg) } } return list diff --git a/vendor/github.com/Azure/azure-sdk-for-go/tools/apidiff/cmd/root.go b/vendor/github.com/Azure/azure-sdk-for-go/tools/apidiff/cmd/root.go index aeecccffe..134353299 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/tools/apidiff/cmd/root.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/tools/apidiff/cmd/root.go @@ -21,9 +21,11 @@ import ( ) var copyRepoFlag bool +var debugFlag bool var onlyAdditionsFlag bool var onlyBreakingChangesFlag bool var quietFlag bool +var suppressReport bool var verboseFlag bool var rootCmd = &cobra.Command{ @@ -36,6 +38,7 @@ individual packages or a set of packages under a specified directory.`, func init() { rootCmd.PersistentFlags().BoolVarP(©RepoFlag, "copyrepo", "c", false, "copy the repo instead of cloning it") + rootCmd.PersistentFlags().BoolVarP(&debugFlag, "debug", "d", false, "debug output") rootCmd.PersistentFlags().BoolVarP(&onlyAdditionsFlag, "additions", "a", false, "only include additive changes in the report") rootCmd.PersistentFlags().BoolVarP(&onlyBreakingChangesFlag, "breakingchanges", "b", false, "only include breaking changes in the report") rootCmd.PersistentFlags().BoolVarP(&quietFlag, "quiet", "q", false, "suppress console output") @@ -52,17 +55,21 @@ func Execute() { // CommandFlags is used to specify flags when invoking commands programatically. type CommandFlags struct { CopyRepo bool + Debug bool OnlyAdditions bool OnlyBreakingChanges bool Quiet bool + SuppressReport bool Verbose bool } // applies the specified flags to their global equivalents func (cf CommandFlags) apply() { copyRepoFlag = cf.CopyRepo + debugFlag = cf.Debug onlyAdditionsFlag = cf.OnlyAdditions onlyBreakingChangesFlag = cf.OnlyBreakingChanges quietFlag = cf.Quiet + suppressReport = cf.SuppressReport verboseFlag = cf.Verbose } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/tools/apidiff/repo/repo.go b/vendor/github.com/Azure/azure-sdk-for-go/tools/apidiff/repo/repo.go index e6fbce467..c7b41a6d1 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/tools/apidiff/repo/repo.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/tools/apidiff/repo/repo.go @@ -60,6 +60,22 @@ func Get(dir string) (wt WorkingTree, err error) { return } +// Branch calls "git branch" to determine the current branch. +func (tw WorkingTree) Branch() (string, error) { + cmd := exec.Command("git", "branch") + output, err := cmd.CombinedOutput() + if err != nil { + return "", errors.New(string(output)) + } + branches := strings.Split(string(output), "\n") + for _, branch := range branches { + if branch[0] == '*' { + return branch[2:], nil + } + } + return "", fmt.Errorf("failed to determine active branch: %s", strings.Join(branches, ",")) +} + // Clone calls "git clone", cloning the working tree into the specified directory. // The returned WorkingTree points to the clone of the repository. func (wt WorkingTree) Clone(dest string) (result WorkingTree, err error) { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/tools/picker/cmd/root.go b/vendor/github.com/Azure/azure-sdk-for-go/tools/picker/cmd/root.go index 6e1afbd43..e24d374f9 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/tools/picker/cmd/root.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/tools/picker/cmd/root.go @@ -26,6 +26,8 @@ import ( "github.com/spf13/cobra" ) +var dryRunFlag bool + var rootCmd = &cobra.Command{ Use: "picker ", Short: "Cherry-picks commits with non-breaking changes between two branches.", @@ -39,6 +41,10 @@ NOTE: running this tool will modify your working tree!`, }, } +func init() { + rootCmd.PersistentFlags().BoolVarP(&dryRunFlag, "dryrun", "d", false, "reports what the tool would have done without actually doing it") +} + // Execute executes the specified command. func Execute() { if err := rootCmd.Execute(); err != nil { @@ -64,6 +70,16 @@ func theCommand(args []string) error { return fmt.Errorf("failed to get the working tree: %v", err) } + if dryRunFlag { + // dry run shouldn't modify state so ensure that the active branch matches from + branch, err := wt.Branch() + if err != nil { + return err + } + if branch != from { + return fmt.Errorf("dry run failed, current branch '%s' doesn't match from branch '%s'", branch, from) + } + } // checkout "from" branch fmt.Printf("checking out branch '%s' to get list of candidate commits for cherry-picking\n", from) err = wt.Checkout(from) @@ -76,35 +92,40 @@ func theCommand(args []string) error { return fmt.Errorf("the command 'git cherry' failed: %v", err) } - // for each commit, if it wasn't found in the "to" branch add it to the candidate list - candidates := []string{} - for _, commit := range commits { - if !commit.Found { - candidates = append(candidates, commit.Hash) - } - } - - if len(candidates) == 0 { - fmt.Println("didn't find any candidate commits") - return nil - } - - fmt.Printf("found %v candidate commits, looking for breaking changes...\n", len(candidates)) + fmt.Printf("found %v commits, calculating breaking changes...\n", len(commits)) // generate report to find the breaking changes report, err := apidiff.ExecPackagesCmd(filepath.Join(wt.Root(), "services"), - fmt.Sprintf("%s~1,%s", candidates[0], strings.Join(candidates, ",")), - apidiff.CommandFlags{Quiet: true}) + fmt.Sprintf("%s~1,%s", commits[0].Hash, strings.Join(func() []string { + hashes := []string{} + for _, commit := range commits { + hashes = append(hashes, commit.Hash) + } + return hashes + }(), ",")), + apidiff.CommandFlags{ + SuppressReport: true, + Verbose: true, + }) if err != nil { return fmt.Errorf("failed to obtain the breaking changes report: %v", err) } - forPicking := pruneCandidates(candidates, report) + forPicking := pruneCommits(commits, report) if len(forPicking) == 0 { fmt.Println("didn't find any commits to cherry-pick") return nil } + fmt.Println("will cherry-pick the following commits:") + for _, commit := range forPicking { + fmt.Printf("\t%s\n", commit) + } + + if dryRunFlag { + return nil + } + // now cherry-pick the commits fmt.Printf("checking out branch '%s' to begin cherry-picking\n", to) err = wt.Checkout(to) @@ -136,16 +157,21 @@ func contains(ss []string, s string) bool { } // removes commits and decendents thereof that contain breaking changes -func pruneCandidates(candidates []string, report apidiff.CommitPkgsReport) []string { +func pruneCommits(commits []repo.CherryCommit, report apidiff.CommitPkgsReport) []string { pkgsToSkip := map[string]string{} forPicking := []string{} - for _, commit := range candidates { - if contains(report.BreakingChanges, commit) { - fmt.Printf("omitting %s as it contains breaking changes\n", commit) + for _, commit := range commits { + if commit.Found { + // if this commit was found in the target branch skip it + fmt.Printf("skipping %s as it was found in the target branch\n", commit.Hash) + continue + } + if contains(report.BreakingChanges, commit.Hash) { + fmt.Printf("omitting %s as it contains breaking changes\n", commit.Hash) // add the affected packages to the collection of packages to skip - for _, pkg := range report.AffectedPackages[commit] { + for _, pkg := range report.AffectedPackages[commit.Hash] { if _, ok := pkgsToSkip[pkg]; !ok { - pkgsToSkip[pkg] = commit + pkgsToSkip[pkg] = commit.Hash } } continue @@ -154,16 +180,16 @@ func pruneCandidates(candidates []string, report apidiff.CommitPkgsReport) []str // check the packages impacted by this commit, if any of them are in // the list of packages to skip then this commit can't be cherry-picked include := true - for _, pkg := range report.AffectedPackages[commit] { + for _, pkg := range report.AffectedPackages[commit.Hash] { if _, ok := pkgsToSkip[pkg]; ok { include = false - fmt.Printf("omitting %s as it's an aggregate of breaking changes commit %s\n", commit, pkgsToSkip[pkg]) + fmt.Printf("omitting %s as it's an aggregate of commit %s that includes breaking changes\n", commit.Hash, pkgsToSkip[pkg]) break } } if include { - forPicking = append(forPicking, commit) + forPicking = append(forPicking, commit.Hash) } } return forPicking diff --git a/vendor/github.com/Azure/azure-sdk-for-go/version/version.go b/vendor/github.com/Azure/azure-sdk-for-go/version/version.go index 710f029a7..fe7724a03 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/version/version.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/version/version.go @@ -18,4 +18,4 @@ package version // Changes may cause incorrect behavior and will be lost if the code is regenerated. // Number contains the semantic version of this SDK. -const Number = "v17.3.0" +const Number = "v18.0.0" diff --git a/vendor/github.com/Azure/go-autorest/CHANGELOG.md b/vendor/github.com/Azure/go-autorest/CHANGELOG.md index 5998c5bb4..5f46611e4 100644 --- a/vendor/github.com/Azure/go-autorest/CHANGELOG.md +++ b/vendor/github.com/Azure/go-autorest/CHANGELOG.md @@ -1,5 +1,28 @@ # CHANGELOG +## v10.12.0 + +### New Features + +- Added field ServicePrincipalToken.MaxMSIRefreshAttempts to configure the maximun number of attempts to refresh an MSI token. + +## v10.11.4 + +### Bug Fixes + +- If an LRO returns http.StatusOK on the initial response with no async headers return the response body from Future.GetResult(). +- If there is no "final GET URL" return an error from Future.GetResult(). + +## v10.11.3 + +### Bug Fixes + +- In IMDS retry logic, if we don't receive a response don't retry. + - Renamed the retry function so it's clear it's meant for IMDS only. +- For error response bodies that aren't OData-v4 compliant stick the raw JSON in the ServiceError.Details field so the information isn't lost. + - Also add the raw HTTP response to the DetailedResponse. +- Removed superfluous wrapping of response error in azure.DoRetryWithRegistration(). + ## v10.11.2 ### Bug Fixes diff --git a/vendor/github.com/Azure/go-autorest/autorest/adal/token.go b/vendor/github.com/Azure/go-autorest/autorest/adal/token.go index 50e43044d..eec4dced7 100644 --- a/vendor/github.com/Azure/go-autorest/autorest/adal/token.go +++ b/vendor/github.com/Azure/go-autorest/autorest/adal/token.go @@ -61,6 +61,9 @@ const ( // msiEndpoint is the well known endpoint for getting MSI authentications tokens msiEndpoint = "http://169.254.169.254/metadata/identity/oauth2/token" + + // the default number of attempts to refresh an MSI authentication token + defaultMaxMSIRefreshAttempts = 5 ) // OAuthTokenProvider is an interface which should be implemented by an access token retriever @@ -323,6 +326,8 @@ type ServicePrincipalToken struct { refreshLock *sync.RWMutex sender Sender refreshCallbacks []TokenRefreshCallback + // MaxMSIRefreshAttempts is the maximum number of attempts to refresh an MSI token. + MaxMSIRefreshAttempts int } // MarshalTokenJSON returns the marshalled inner token. @@ -655,9 +660,10 @@ func newServicePrincipalTokenFromMSI(msiEndpoint, resource string, userAssignedI AutoRefresh: true, RefreshWithin: defaultRefresh, }, - refreshLock: &sync.RWMutex{}, - sender: &http.Client{}, - refreshCallbacks: callbacks, + refreshLock: &sync.RWMutex{}, + sender: &http.Client{}, + refreshCallbacks: callbacks, + MaxMSIRefreshAttempts: defaultMaxMSIRefreshAttempts, } if userAssignedID != nil { @@ -811,7 +817,7 @@ func (spt *ServicePrincipalToken) refreshInternal(ctx context.Context, resource var resp *http.Response if isIMDS(spt.inner.OauthConfig.TokenEndpoint) { - resp, err = retry(spt.sender, req) + resp, err = retryForIMDS(spt.sender, req, spt.MaxMSIRefreshAttempts) } else { resp, err = spt.sender.Do(req) } @@ -850,7 +856,8 @@ func (spt *ServicePrincipalToken) refreshInternal(ctx context.Context, resource return spt.InvokeRefreshCallbacks(token) } -func retry(sender Sender, req *http.Request) (resp *http.Response, err error) { +// retry logic specific to retrieving a token from the IMDS endpoint +func retryForIMDS(sender Sender, req *http.Request, maxAttempts int) (resp *http.Response, err error) { // copied from client.go due to circular dependency retries := []int{ http.StatusRequestTimeout, // 408 @@ -875,7 +882,6 @@ func retry(sender Sender, req *http.Request) (resp *http.Response, err error) { // see https://docs.microsoft.com/en-us/azure/active-directory/managed-service-identity/how-to-use-vm-token#retry-guidance - const maxAttempts int = 5 const maxDelay time.Duration = 60 * time.Second attempt := 0 @@ -884,7 +890,9 @@ func retry(sender Sender, req *http.Request) (resp *http.Response, err error) { for attempt < maxAttempts { resp, err = sender.Do(req) // retry on temporary network errors, e.g. transient network failures. - if (err != nil && !isTemporaryNetworkError(err)) || resp.StatusCode == http.StatusOK || !containsInt(retries, resp.StatusCode) { + // if we don't receive a response then assume we can't connect to the + // endpoint so we're likely not running on an Azure VM so don't retry. + if (err != nil && !isTemporaryNetworkError(err)) || resp == nil || resp.StatusCode == http.StatusOK || !containsInt(retries, resp.StatusCode) { return } diff --git a/vendor/github.com/Azure/go-autorest/autorest/azure/async.go b/vendor/github.com/Azure/go-autorest/autorest/azure/async.go index 290752708..cda1e180a 100644 --- a/vendor/github.com/Azure/go-autorest/autorest/azure/async.go +++ b/vendor/github.com/Azure/go-autorest/autorest/azure/async.go @@ -245,7 +245,13 @@ func (f Future) PollingURL() string { // It makes the final GET call to retrieve the resultant payload. func (f Future) GetResult(sender autorest.Sender) (*http.Response, error) { if f.pt.finalGetURL() == "" { - return nil, nil + // we can end up in this situation if the async operation returns a 200 + // with no polling URLs. in that case return the response which should + // contain the JSON payload (only do this for successful terminal cases). + if lr := f.pt.latestResponse(); lr != nil && f.pt.hasSucceeded() { + return lr, nil + } + return nil, autorest.NewError("Future", "GetResult", "missing URL for retrieving result") } req, err := http.NewRequest(http.MethodGet, f.pt.finalGetURL(), nil) if err != nil { diff --git a/vendor/github.com/Azure/go-autorest/autorest/azure/async_test.go b/vendor/github.com/Azure/go-autorest/autorest/azure/async_test.go index 91e61c3cf..b4d4cb967 100644 --- a/vendor/github.com/Azure/go-autorest/autorest/azure/async_test.go +++ b/vendor/github.com/Azure/go-autorest/autorest/azure/async_test.go @@ -934,6 +934,47 @@ func TestFuture_WaitForCompletionCancelled(t *testing.T) { } } +func TestFuture_GetResultFromNonAsyncOperation(t *testing.T) { + resp := newAsyncResp(newAsyncReq(http.MethodPost, nil), http.StatusOK, mocks.NewBody(someResource)) + future, err := NewFutureFromResponse(resp) + if err != nil { + t.Fatalf("failed to create tracker: %v", err) + } + if pm := future.PollingMethod(); pm != PollingUnknown { + t.Fatalf("wrong polling method: %s", pm) + } + done, err := future.Done(nil) + if err != nil { + t.Fatalf("failed to check status: %v", err) + } + if !done { + t.Fatal("operation should be done") + } + res, err := future.GetResult(nil) + if err != nil { + t.Fatalf("failed to get result: %v", err) + } + if res != resp { + t.Fatal("result and response don't match") + } +} + +func TestFuture_GetResultNonTerminal(t *testing.T) { + resp := newAsyncResp(newAsyncReq(http.MethodDelete, nil), http.StatusAccepted, mocks.NewBody(fmt.Sprintf(operationResourceFormat, operationInProgress))) + mocks.SetResponseHeader(resp, headerAsyncOperation, mocks.TestAzureAsyncURL) + future, err := NewFutureFromResponse(resp) + if err != nil { + t.Fatalf("failed to create future: %v", err) + } + res, err := future.GetResult(nil) + if err == nil { + t.Fatal("expected non-nil error") + } + if res != nil { + t.Fatal("expected nil result") + } +} + const ( operationResourceIllegal = ` This is not JSON and should fail...badly. @@ -1011,6 +1052,17 @@ const ( } } ` + + // returned from an operation marked as LRO but really isn't + someResource = ` + { + "id": "/subscriptions/guid/resourceGroups/rg/providers/something/else/thing", + "name": "thing", + "type": "Imaginary.type", + "location": "Central US", + "properties": {} + } + ` ) // creates an async request with the specified body. diff --git a/vendor/github.com/Azure/go-autorest/autorest/azure/azure.go b/vendor/github.com/Azure/go-autorest/autorest/azure/azure.go index 18d029526..a702ffe75 100644 --- a/vendor/github.com/Azure/go-autorest/autorest/azure/azure.go +++ b/vendor/github.com/Azure/go-autorest/autorest/azure/azure.go @@ -279,16 +279,29 @@ func WithErrorUnlessStatusCode(codes ...int) autorest.RespondDecorator { resp.Body = ioutil.NopCloser(&b) if decodeErr != nil { return fmt.Errorf("autorest/azure: error response cannot be parsed: %q error: %v", b.String(), decodeErr) - } else if e.ServiceError == nil { + } + if e.ServiceError == nil { // Check if error is unwrapped ServiceError - if err := json.Unmarshal(b.Bytes(), &e.ServiceError); err != nil || e.ServiceError.Message == "" { - e.ServiceError = &ServiceError{ - Code: "Unknown", - Message: "Unknown service error", - } + if err := json.Unmarshal(b.Bytes(), &e.ServiceError); err != nil { + return err } } - + if e.ServiceError.Message == "" { + // if we're here it means the returned error wasn't OData v4 compliant. + // try to unmarshal the body as raw JSON in hopes of getting something. + rawBody := map[string]interface{}{} + if err := json.Unmarshal(b.Bytes(), &rawBody); err != nil { + return err + } + e.ServiceError = &ServiceError{ + Code: "Unknown", + Message: "Unknown service error", + } + if len(rawBody) > 0 { + e.ServiceError.Details = []map[string]interface{}{rawBody} + } + } + e.Response = resp e.RequestID = ExtractRequestID(resp) if e.StatusCode == nil { e.StatusCode = resp.StatusCode diff --git a/vendor/github.com/Azure/go-autorest/autorest/azure/azure_test.go b/vendor/github.com/Azure/go-autorest/autorest/azure/azure_test.go index ee7126b21..612e3a674 100644 --- a/vendor/github.com/Azure/go-autorest/autorest/azure/azure_test.go +++ b/vendor/github.com/Azure/go-autorest/autorest/azure/azure_test.go @@ -333,6 +333,9 @@ func TestWithErrorUnlessStatusCode_NoAzureError(t *testing.T) { expected := &ServiceError{ Code: "Unknown", Message: "Unknown service error", + Details: []map[string]interface{}{ + {"Status": "NotFound"}, + }, } if !reflect.DeepEqual(expected, azErr.ServiceError) { diff --git a/vendor/github.com/Azure/go-autorest/autorest/azure/rp.go b/vendor/github.com/Azure/go-autorest/autorest/azure/rp.go index 65ad0afc8..bd34f0ed5 100644 --- a/vendor/github.com/Azure/go-autorest/autorest/azure/rp.go +++ b/vendor/github.com/Azure/go-autorest/autorest/azure/rp.go @@ -64,7 +64,7 @@ func DoRetryWithRegistration(client autorest.Client) autorest.SendDecorator { } } } - return resp, fmt.Errorf("failed request: %s", err) + return resp, err }) } } diff --git a/vendor/github.com/Azure/go-autorest/autorest/version.go b/vendor/github.com/Azure/go-autorest/autorest/version.go index 0eee44027..e32cd68fe 100644 --- a/vendor/github.com/Azure/go-autorest/autorest/version.go +++ b/vendor/github.com/Azure/go-autorest/autorest/version.go @@ -16,5 +16,5 @@ package autorest // Version returns the semantic version (see http://semver.org). func Version() string { - return "v10.11.2" + return "v10.12.0" }